summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.hgignore4
-rwxr-xr-x.hgtags11
-rwxr-xr-xBuildParams33
-rwxr-xr-xautobuild.xml288
-rwxr-xr-xdoc/contributions.txt79
-rwxr-xr-xindra/CMakeLists.txt6
-rw-r--r--indra/cmake/00-COMPILE-LINK-RUN.txt344
-rwxr-xr-xindra/cmake/00-Common.cmake15
-rwxr-xr-xindra/cmake/APR.cmake6
-rwxr-xr-xindra/cmake/Audio.cmake6
-rwxr-xr-xindra/cmake/BerkeleyDB.cmake6
-rwxr-xr-xindra/cmake/Boost.cmake19
-rwxr-xr-xindra/cmake/BuildVersion.cmake5
-rwxr-xr-xindra/cmake/CARes.cmake6
-rwxr-xr-xindra/cmake/CURL.cmake6
-rwxr-xr-xindra/cmake/Copy3rdPartyLibs.cmake33
-rwxr-xr-xindra/cmake/DBusGlib.cmake4
-rwxr-xr-xindra/cmake/EXPAT.cmake6
-rwxr-xr-xindra/cmake/ExamplePlugin.cmake6
-rw-r--r--indra/cmake/FMODEX.cmake10
-rwxr-xr-xindra/cmake/FindJsonCpp.cmake4
-rwxr-xr-xindra/cmake/FreeType.cmake8
-rw-r--r--indra/cmake/GLEXT.cmake4
-rwxr-xr-xindra/cmake/GLH.cmake6
-rwxr-xr-xindra/cmake/GLOD.cmake4
-rwxr-xr-xindra/cmake/GStreamer010Plugin.cmake8
-rwxr-xr-xindra/cmake/Glui.cmake6
-rwxr-xr-xindra/cmake/GoogleBreakpad.cmake6
-rwxr-xr-xindra/cmake/GoogleMock.cmake2
-rwxr-xr-xindra/cmake/GooglePerfTools.cmake6
-rwxr-xr-xindra/cmake/Hunspell.cmake6
-rwxr-xr-xindra/cmake/JPEG.cmake6
-rwxr-xr-xindra/cmake/JsonCpp.cmake6
-rw-r--r--indra/cmake/LLAddBuildTest.cmake12
-rwxr-xr-xindra/cmake/LLPrimitive.cmake27
-rwxr-xr-xindra/cmake/LLWindow.cmake6
-rwxr-xr-xindra/cmake/Linking.cmake1
-rwxr-xr-xindra/cmake/NDOF.cmake6
-rwxr-xr-xindra/cmake/OPENAL.cmake6
-rwxr-xr-xindra/cmake/OpenJPEG.cmake6
-rwxr-xr-xindra/cmake/OpenSSL.cmake10
-rwxr-xr-xindra/cmake/PNG.cmake31
-rwxr-xr-xindra/cmake/Prebuilt.cmake10
-rwxr-xr-xindra/cmake/PulseAudio.cmake4
-rwxr-xr-xindra/cmake/Tut.cmake4
-rwxr-xr-xindra/cmake/UI.cmake6
-rwxr-xr-xindra/cmake/Variables.cmake2
-rwxr-xr-xindra/cmake/ViewerMiscLibs.cmake4
-rwxr-xr-xindra/cmake/WebKitLibPlugin.cmake49
-rwxr-xr-xindra/cmake/XmlRpcEpi.cmake6
-rwxr-xr-xindra/cmake/ZLIB.cmake27
-rwxr-xr-xindra/edit-me-to-trigger-new-build.txt7
-rwxr-xr-xindra/integration_tests/llimage_libtest/CMakeLists.txt3
-rw-r--r--indra/integration_tests/llimage_libtest/filters/1970colorize.xml41
-rwxr-xr-xindra/integration_tests/llimage_libtest/filters/autocontrast.xml11
-rwxr-xr-xindra/integration_tests/llimage_libtest/filters/badtrip.xml36
-rw-r--r--indra/integration_tests/llimage_libtest/filters/blowhighlights.xml25
-rw-r--r--indra/integration_tests/llimage_libtest/filters/blur.xml7
-rwxr-xr-xindra/integration_tests/llimage_libtest/filters/brighten.xml11
-rw-r--r--indra/integration_tests/llimage_libtest/filters/colorize.xml24
-rw-r--r--indra/integration_tests/llimage_libtest/filters/colortransform.xml16
-rw-r--r--indra/integration_tests/llimage_libtest/filters/contrast.xml11
-rw-r--r--indra/integration_tests/llimage_libtest/filters/convolve.xml18
-rwxr-xr-xindra/integration_tests/llimage_libtest/filters/darken.xml11
-rw-r--r--indra/integration_tests/llimage_libtest/filters/dodgeandburn.xml47
-rw-r--r--indra/integration_tests/llimage_libtest/filters/edges.xml24
-rw-r--r--indra/integration_tests/llimage_libtest/filters/focus.xml39
-rw-r--r--indra/integration_tests/llimage_libtest/filters/gamma.xml11
-rw-r--r--indra/integration_tests/llimage_libtest/filters/grayscale.xml14
-rw-r--r--indra/integration_tests/llimage_libtest/filters/heatwave.xml38
-rw-r--r--indra/integration_tests/llimage_libtest/filters/horizontalscreen.xml20
-rw-r--r--indra/integration_tests/llimage_libtest/filters/julesverne.xml20
-rw-r--r--indra/integration_tests/llimage_libtest/filters/lensflare.xml131
-rwxr-xr-xindra/integration_tests/llimage_libtest/filters/lightleak.xml78
-rwxr-xr-xindra/integration_tests/llimage_libtest/filters/linearize.xml11
-rwxr-xr-xindra/integration_tests/llimage_libtest/filters/miniature.xml118
-rwxr-xr-xindra/integration_tests/llimage_libtest/filters/newsscreen.xml20
-rw-r--r--indra/integration_tests/llimage_libtest/filters/overcast.xml24
-rwxr-xr-xindra/integration_tests/llimage_libtest/filters/pixelate.xml35
-rwxr-xr-xindra/integration_tests/llimage_libtest/filters/posterize.xml11
-rw-r--r--indra/integration_tests/llimage_libtest/filters/rotatecolors180.xml8
-rw-r--r--indra/integration_tests/llimage_libtest/filters/saturate.xml8
-rw-r--r--indra/integration_tests/llimage_libtest/filters/sepia.xml14
-rw-r--r--indra/integration_tests/llimage_libtest/filters/sharpen.xml7
-rw-r--r--indra/integration_tests/llimage_libtest/filters/slantedscreen.xml20
-rw-r--r--indra/integration_tests/llimage_libtest/filters/spotlight.xml45
-rw-r--r--indra/integration_tests/llimage_libtest/filters/stencilgradient.xml24
-rw-r--r--indra/integration_tests/llimage_libtest/filters/stencilscanlines.xml22
-rw-r--r--indra/integration_tests/llimage_libtest/filters/stenciluniform.xml20
-rw-r--r--indra/integration_tests/llimage_libtest/filters/stencilvignette.xml24
-rwxr-xr-xindra/integration_tests/llimage_libtest/filters/thematrix.xml42
-rwxr-xr-xindra/integration_tests/llimage_libtest/filters/toycamera.xml46
-rw-r--r--indra/integration_tests/llimage_libtest/filters/verticalscreen.xml20
-rwxr-xr-xindra/integration_tests/llimage_libtest/filters/video.xml44
-rwxr-xr-xindra/integration_tests/llimage_libtest/llimage_libtest.cpp39
-rwxr-xr-xindra/integration_tests/llui_libtest/llui_libtest.cpp4
-rwxr-xr-xindra/linux_crash_logger/linux_crash_logger.cpp6
-rwxr-xr-xindra/linux_crash_logger/llcrashloggerlinux.cpp2
-rw-r--r--indra/linux_updater/CMakeLists.txt57
-rw-r--r--indra/linux_updater/linux_updater.cpp924
-rwxr-xr-x[-rw-r--r--]indra/llappearance/llavatarappearance.cpp220
-rwxr-xr-x[-rw-r--r--]indra/llappearance/llavatarappearance.h10
-rw-r--r--indra/llappearance/llavatarjoint.cpp2
-rw-r--r--indra/llappearance/llavatarjointmesh.cpp30
-rw-r--r--indra/llappearance/llavatarjointmesh.h1
-rwxr-xr-x[-rw-r--r--]indra/llappearance/lldriverparam.cpp64
-rwxr-xr-x[-rw-r--r--]indra/llappearance/lldriverparam.h10
-rw-r--r--indra/llappearance/lllocaltextureobject.cpp2
-rw-r--r--indra/llappearance/llpolymesh.cpp91
-rw-r--r--indra/llappearance/llpolymesh.h3
-rw-r--r--indra/llappearance/llpolymorph.cpp92
-rw-r--r--indra/llappearance/llpolymorph.h3
-rw-r--r--indra/llappearance/llpolyskeletaldistortion.cpp69
-rw-r--r--indra/llappearance/llpolyskeletaldistortion.h3
-rwxr-xr-x[-rw-r--r--]indra/llappearance/lltexglobalcolor.cpp30
-rwxr-xr-x[-rw-r--r--]indra/llappearance/lltexglobalcolor.h4
-rw-r--r--indra/llappearance/lltexlayer.cpp82
-rwxr-xr-x[-rw-r--r--]indra/llappearance/lltexlayerparams.cpp115
-rwxr-xr-x[-rw-r--r--]indra/llappearance/lltexlayerparams.h20
-rw-r--r--indra/llappearance/llviewervisualparam.cpp18
-rw-r--r--indra/llappearance/llviewervisualparam.h4
-rwxr-xr-x[-rw-r--r--]indra/llappearance/llwearable.cpp135
-rwxr-xr-x[-rw-r--r--]indra/llappearance/llwearable.h10
-rwxr-xr-x[-rw-r--r--]indra/llappearance/llwearabledata.cpp15
-rwxr-xr-xindra/llaudio/llaudiodecodemgr.cpp36
-rwxr-xr-xindra/llaudio/llaudiodecodemgr.h3
-rwxr-xr-xindra/llaudio/llaudioengine.cpp140
-rwxr-xr-xindra/llaudio/llaudioengine.h4
-rw-r--r--indra/llaudio/llaudioengine_fmodex.cpp30
-rwxr-xr-xindra/llaudio/llaudioengine_openal.cpp74
-rwxr-xr-xindra/llaudio/lllistener_openal.cpp10
-rw-r--r--indra/llaudio/llstreamingaudio_fmodex.cpp26
-rw-r--r--indra/llaudio/llstreamingaudio_fmodex.h4
-rwxr-xr-xindra/llaudio/llvorbisencode.cpp20
-rwxr-xr-xindra/llcharacter/llanimationstates.h2
-rwxr-xr-xindra/llcharacter/llbvhloader.cpp44
-rwxr-xr-xindra/llcharacter/llcharacter.cpp59
-rwxr-xr-xindra/llcharacter/llcharacter.h10
-rwxr-xr-xindra/llcharacter/lleditingmotion.cpp12
-rwxr-xr-xindra/llcharacter/llgesture.cpp57
-rwxr-xr-xindra/llcharacter/llgesture.h17
-rwxr-xr-xindra/llcharacter/llhandmotion.cpp4
-rwxr-xr-xindra/llcharacter/llheadrotmotion.cpp26
-rwxr-xr-xindra/llcharacter/lljoint.cpp46
-rwxr-xr-xindra/llcharacter/lljoint.h11
-rwxr-xr-xindra/llcharacter/lljointsolverrp3.cpp74
-rwxr-xr-xindra/llcharacter/llkeyframemotion.cpp185
-rwxr-xr-xindra/llcharacter/llkeyframemotionparam.cpp18
-rwxr-xr-xindra/llcharacter/llkeyframemotionparam.h1
-rwxr-xr-xindra/llcharacter/llkeyframestandmotion.cpp6
-rwxr-xr-xindra/llcharacter/llkeyframewalkmotion.cpp14
-rwxr-xr-xindra/llcharacter/llmotion.cpp6
-rwxr-xr-xindra/llcharacter/llmotion.h8
-rwxr-xr-xindra/llcharacter/llmotioncontroller.cpp34
-rwxr-xr-xindra/llcharacter/llmotioncontroller.h1
-rwxr-xr-xindra/llcharacter/llmultigesture.cpp28
-rwxr-xr-xindra/llcharacter/llpose.h1
-rwxr-xr-xindra/llcharacter/llstatemachine.cpp12
-rwxr-xr-xindra/llcharacter/lltargetingmotion.cpp4
-rwxr-xr-xindra/llcharacter/llvisualparam.cpp58
-rwxr-xr-xindra/llcharacter/llvisualparam.h12
-rwxr-xr-xindra/llcommon/CMakeLists.txt90
-rwxr-xr-xindra/llcommon/doublelinkedlist.h1397
-rwxr-xr-xindra/llcommon/imageids.cpp73
-rwxr-xr-xindra/llcommon/imageids.h70
-rwxr-xr-xindra/llcommon/indra_constants.cpp31
-rwxr-xr-xindra/llcommon/indra_constants.h356
-rwxr-xr-xindra/llcommon/linked_lists.h937
-rwxr-xr-xindra/llcommon/ll_template_cast.h177
-rwxr-xr-xindra/llcommon/llaccountingcost.h86
-rwxr-xr-xindra/llcommon/llagentconstants.h159
-rw-r--r--indra/llcommon/llalignedarray.h10
-rwxr-xr-xindra/llcommon/llallocator_heap_profile.cpp2
-rwxr-xr-xindra/llcommon/llapp.cpp50
-rwxr-xr-xindra/llcommon/llapp.h5
-rwxr-xr-xindra/llcommon/llapr.cpp25
-rwxr-xr-xindra/llcommon/llapr.h40
-rwxr-xr-xindra/llcommon/llassettype.h2
-rwxr-xr-xindra/llcommon/llassoclist.h296
-rwxr-xr-xindra/llcommon/llavatarconstants.h55
-rwxr-xr-xindra/llcommon/llbase32.cpp4
-rwxr-xr-xindra/llcommon/llbitpack.cpp (renamed from indra/llcommon/bitpack.cpp)2
-rwxr-xr-xindra/llcommon/llbitpack.h (renamed from indra/llcommon/bitpack.h)12
-rw-r--r--[-rwxr-xr-x]indra/llcommon/llclickaction.h11
-rwxr-xr-xindra/llcommon/llcommon.cpp16
-rwxr-xr-xindra/llcommon/llcommonutils.h2
-rwxr-xr-xindra/llcommon/llcrc.cpp4
-rwxr-xr-xindra/llcommon/llcrc.h2
-rwxr-xr-xindra/llcommon/llcriticaldamp.cpp77
-rwxr-xr-xindra/llcommon/llcriticaldamp.h32
-rwxr-xr-xindra/llcommon/lldarray.h223
-rwxr-xr-xindra/llcommon/lldate.cpp24
-rwxr-xr-xindra/llcommon/lldate.h5
-rw-r--r--indra/llcommon/lldeadmantimer.cpp6
-rwxr-xr-xindra/llcommon/lldeleteutils.h47
-rwxr-xr-xindra/llcommon/lldepthstack.h39
-rwxr-xr-xindra/llcommon/lldictionary.h2
-rwxr-xr-xindra/llcommon/lldlinked.h93
-rwxr-xr-xindra/llcommon/lldqueueptr.h352
-rwxr-xr-xindra/llcommon/llenum.h78
-rwxr-xr-xindra/llcommon/llerror.cpp799
-rwxr-xr-xindra/llcommon/llerror.h252
-rwxr-xr-xindra/llcommon/llerrorcontrol.h39
-rwxr-xr-xindra/llcommon/llerrorlegacy.h86
-rwxr-xr-xindra/llcommon/llerrorthread.cpp18
-rwxr-xr-xindra/llcommon/llevent.h2
-rwxr-xr-xindra/llcommon/llevents.cpp1
-rwxr-xr-xindra/llcommon/llevents.h2
-rwxr-xr-xindra/llcommon/llfasttimer.cpp662
-rwxr-xr-xindra/llcommon/llfasttimer.h380
-rwxr-xr-xindra/llcommon/llfile.cpp26
-rwxr-xr-xindra/llcommon/llfindlocale.cpp2
-rwxr-xr-xindra/llcommon/llformat.h2
-rwxr-xr-xindra/llcommon/llframetimer.cpp8
-rwxr-xr-xindra/llcommon/llframetimer.h5
-rwxr-xr-xindra/llcommon/llheartbeat.cpp8
-rwxr-xr-xindra/llcommon/llhttpstatuscodes.h89
-rwxr-xr-xindra/llcommon/llindexedqueue.h155
-rwxr-xr-xindra/llcommon/llindexedvector.h100
-rwxr-xr-xindra/llcommon/llinitparam.cpp46
-rwxr-xr-xindra/llcommon/llinitparam.h446
-rwxr-xr-xindra/llcommon/llinstancetracker.cpp18
-rwxr-xr-xindra/llcommon/llinstancetracker.h109
-rwxr-xr-xindra/llcommon/lllazy.cpp40
-rwxr-xr-xindra/llcommon/lllazy.h399
-rwxr-xr-xindra/llcommon/llleap.cpp2
-rwxr-xr-xindra/llcommon/lllinkedqueue.h309
-rwxr-xr-xindra/llcommon/llliveappconfig.cpp10
-rwxr-xr-xindra/llcommon/lllocalidhashmap.h895
-rwxr-xr-xindra/llcommon/lllog.cpp111
-rwxr-xr-xindra/llcommon/llmap.h245
-rwxr-xr-xindra/llcommon/llmd5.cpp1
-rwxr-xr-xindra/llcommon/llmemory.cpp283
-rwxr-xr-xindra/llcommon/llmemory.h139
-rwxr-xr-xindra/llcommon/llmemorystream.cpp2
-rwxr-xr-xindra/llcommon/llmetricperformancetester.cpp17
-rwxr-xr-xindra/llcommon/llmetrics.cpp4
-rwxr-xr-xindra/llcommon/llmetrics.h2
-rwxr-xr-xindra/llcommon/llmortician.h1
-rw-r--r--indra/llcommon/llmutex.cpp205
-rw-r--r--indra/llcommon/llmutex.h141
-rw-r--r--[-rwxr-xr-x]indra/llcommon/llnametable.h0
-rwxr-xr-xindra/llcommon/llpointer.h183
-rw-r--r--[-rwxr-xr-x]indra/llcommon/llpredicate.cpp (renamed from indra/llui/llfunctorregistry.cpp)28
-rw-r--r--indra/llcommon/llpredicate.h210
-rwxr-xr-xindra/llcommon/llpreprocessor.h21
-rwxr-xr-xindra/llcommon/llpriqueuemap.h6
-rwxr-xr-xindra/llcommon/llprocess.h4
-rwxr-xr-xindra/llcommon/llprocessor.cpp8
-rwxr-xr-xindra/llcommon/llprocessor.h4
-rwxr-xr-xindra/llcommon/llptrskiplist.h724
-rwxr-xr-xindra/llcommon/llptrskipmap.h1239
-rwxr-xr-xindra/llcommon/llptrto.h1
-rwxr-xr-xindra/llcommon/llqueuedthread.cpp33
-rwxr-xr-xindra/llcommon/llrefcount.cpp10
-rwxr-xr-xindra/llcommon/llrefcount.h79
-rwxr-xr-xindra/llcommon/llregistry.h16
-rwxr-xr-xindra/llcommon/llsafehandle.h2
-rwxr-xr-xindra/llcommon/llsd.cpp11
-rwxr-xr-xindra/llcommon/llsd.h5
-rwxr-xr-xindra/llcommon/llsdparam.cpp15
-rwxr-xr-xindra/llcommon/llsdparam.h24
-rwxr-xr-xindra/llcommon/llsdserialize.cpp135
-rwxr-xr-xindra/llcommon/llsdserialize.h28
-rwxr-xr-xindra/llcommon/llsdserialize_xml.cpp23
-rwxr-xr-xindra/llcommon/llsdutil.cpp2
-rwxr-xr-xindra/llcommon/llsdutil.h2
-rwxr-xr-xindra/llcommon/llsecondlifeurls.cpp84
-rwxr-xr-xindra/llcommon/llsecondlifeurls.h76
-rwxr-xr-xindra/llcommon/llsingleton.h16
-rwxr-xr-xindra/llcommon/llskiplist.h517
-rwxr-xr-xindra/llcommon/llskipmap.h1022
-rwxr-xr-xindra/llcommon/llsortedvector.h152
-rwxr-xr-xindra/llcommon/llstacktrace.cpp2
-rwxr-xr-xindra/llcommon/llstat.cpp404
-rwxr-xr-xindra/llcommon/llstat.h116
-rw-r--r--[-rwxr-xr-x]indra/llcommon/llstatenums.h44
-rwxr-xr-xindra/llcommon/llstl.h200
-rwxr-xr-xindra/llcommon/llstring.cpp16
-rwxr-xr-xindra/llcommon/llstring.h9
-rwxr-xr-xindra/llcommon/llstringtable.cpp4
-rwxr-xr-xindra/llcommon/llsys.cpp72
-rwxr-xr-xindra/llcommon/llsys.h10
-rwxr-xr-xindra/llcommon/llthread.cpp274
-rwxr-xr-xindra/llcommon/llthread.h202
-rw-r--r--indra/llcommon/llthreadlocalstorage.cpp119
-rw-r--r--indra/llcommon/llthreadlocalstorage.h185
-rwxr-xr-xindra/llcommon/llthreadsafequeue.cpp2
-rwxr-xr-xindra/llcommon/lltimer.cpp124
-rwxr-xr-xindra/llcommon/lltimer.h63
-rw-r--r--indra/llcommon/lltrace.cpp86
-rw-r--r--indra/llcommon/lltrace.h492
-rw-r--r--indra/llcommon/lltraceaccumulators.cpp302
-rw-r--r--indra/llcommon/lltraceaccumulators.h590
-rw-r--r--indra/llcommon/lltracerecording.cpp1251
-rw-r--r--indra/llcommon/lltracerecording.h670
-rw-r--r--indra/llcommon/lltracethreadrecorder.cpp329
-rw-r--r--indra/llcommon/lltracethreadrecorder.h102
-rwxr-xr-xindra/llcommon/lltypeinfolookup.h117
-rw-r--r--indra/llcommon/llunits.h129
-rw-r--r--indra/llcommon/llunittype.h836
-rwxr-xr-xindra/llcommon/lluri.cpp12
-rwxr-xr-xindra/llcommon/lluuid.cpp12
-rwxr-xr-xindra/llcommon/lluuid.h14
-rwxr-xr-xindra/llcommon/lluuidhashmap.h583
-rw-r--r--[-rwxr-xr-x]indra/llcommon/llwin32headers.h (renamed from indra/llcommon/llversionserver.h)28
-rw-r--r--[-rwxr-xr-x]indra/llcommon/llwin32headerslean.h (renamed from indra/llcommon/lldarrayptr.h)24
-rwxr-xr-xindra/llcommon/llworkerthread.cpp24
-rwxr-xr-xindra/llcommon/llworkerthread.h5
-rwxr-xr-xindra/llcommon/metaclass.cpp81
-rwxr-xr-xindra/llcommon/metaclass.h82
-rwxr-xr-xindra/llcommon/metaclasst.h60
-rwxr-xr-xindra/llcommon/metaproperty.cpp56
-rwxr-xr-xindra/llcommon/metaproperty.h73
-rwxr-xr-xindra/llcommon/metapropertyt.h183
-rwxr-xr-xindra/llcommon/reflective.h42
-rwxr-xr-xindra/llcommon/roles_constants.h192
-rwxr-xr-xindra/llcommon/stdenums.h137
-rw-r--r--[-rwxr-xr-x]indra/llcommon/string_table.h0
-rwxr-xr-xindra/llcommon/stringize.h2
-rwxr-xr-xindra/llcommon/tests/bitpack_test.cpp2
-rwxr-xr-xindra/llcommon/tests/commonmisc_test.cpp10
-rw-r--r--indra/llcommon/tests/lldeadmantimer_test.cpp6
-rwxr-xr-xindra/llcommon/tests/llerror_test.cpp168
-rwxr-xr-xindra/llcommon/tests/lleventcoro_test.cpp8
-rwxr-xr-xindra/llcommon/tests/lleventdispatcher_test.cpp2
-rwxr-xr-xindra/llcommon/tests/lleventfilter_test.cpp4
-rwxr-xr-xindra/llcommon/tests/llinstancetracker_test.cpp16
-rwxr-xr-xindra/llcommon/tests/llleap_test.cpp3
-rwxr-xr-xindra/llcommon/tests/llprocess_test.cpp13
-rwxr-xr-xindra/llcommon/tests/llsdserialize_test.cpp6
-rw-r--r--indra/llcommon/tests/lltrace_test.cpp142
-rw-r--r--indra/llcommon/tests/llunits_test.cpp388
-rwxr-xr-xindra/llcommon/tests/reflection_test.cpp220
-rwxr-xr-xindra/llcommon/tests/stringize_test.cpp2
-rwxr-xr-xindra/llcommon/tests/wrapllerrs.h125
-rwxr-xr-xindra/llcommon/u64.cpp2
-rwxr-xr-xindra/llcorehttp/CMakeLists.txt2
-rwxr-xr-xindra/llcorehttp/_httplibcurl.cpp2
-rwxr-xr-xindra/llcorehttp/_httpoprequest.cpp3
-rwxr-xr-xindra/llcorehttp/_refcounted.h4
-rw-r--r--indra/llcrashlogger/llcrashlock.cpp9
-rwxr-xr-xindra/llcrashlogger/llcrashlogger.cpp19
-rwxr-xr-xindra/llcrashlogger/llcrashlogger.h5
-rwxr-xr-xindra/llimage/CMakeLists.txt2
-rwxr-xr-xindra/llimage/llimage.cpp168
-rwxr-xr-xindra/llimage/llimage.h11
-rwxr-xr-xindra/llimage/llimagebmp.cpp4
-rwxr-xr-xindra/llimage/llimagedimensionsinfo.cpp20
-rwxr-xr-xindra/llimage/llimagedimensionsinfo.h2
-rwxr-xr-xindra/llimage/llimagedxt.cpp22
-rwxr-xr-xindra/llimage/llimagefilter.cpp939
-rwxr-xr-xindra/llimage/llimagefilter.h137
-rwxr-xr-xindra/llimage/llimagej2c.cpp3
-rwxr-xr-xindra/llimage/llimagejpeg.cpp14
-rwxr-xr-xindra/llimage/llimagejpeg.h3
-rwxr-xr-xindra/llimage/llimagetga.cpp10
-rwxr-xr-xindra/llimage/llimageworker.cpp2
-rwxr-xr-xindra/llimage/tests/llimageworker_test.cpp7
-rwxr-xr-xindra/llimagej2coj/llimagej2coj.cpp10
-rwxr-xr-xindra/llinventory/CMakeLists.txt2
-rwxr-xr-xindra/llinventory/llcategory.h2
-rwxr-xr-xindra/llinventory/lleconomy.cpp44
-rwxr-xr-xindra/llinventory/lleconomy.h1
-rwxr-xr-xindra/llinventory/llfoldertype.cpp (renamed from indra/llcommon/llfoldertype.cpp)8
-rwxr-xr-x[-rw-r--r--]indra/llinventory/llfoldertype.h (renamed from indra/llcommon/llfoldertype.h)0
-rwxr-xr-xindra/llinventory/llinventory.cpp135
-rwxr-xr-xindra/llinventory/llinventory.h17
-rwxr-xr-xindra/llinventory/lllandmark.cpp20
-rwxr-xr-xindra/llinventory/llnotecard.cpp36
-rwxr-xr-xindra/llinventory/llparcel.cpp20
-rwxr-xr-xindra/llinventory/llpermissions.cpp30
-rwxr-xr-xindra/llinventory/llpermissions.h6
-rwxr-xr-xindra/llinventory/llsaleinfo.cpp12
-rwxr-xr-xindra/llinventory/lltransactionflags.cpp8
-rwxr-xr-xindra/llinventory/tests/inventorymisc_test.cpp12
-rwxr-xr-xindra/llkdu/llimagej2ckdu.cpp12
-rwxr-xr-xindra/llkdu/tests/llimagej2ckdu_test.cpp7
-rwxr-xr-xindra/llmath/llcalc.cpp6
-rwxr-xr-xindra/llmath/llcalcparser.h5
-rwxr-xr-xindra/llmath/llcamera.cpp90
-rwxr-xr-xindra/llmath/llcamera.h10
-rwxr-xr-xindra/llmath/llcoordframe.cpp54
-rwxr-xr-xindra/llmath/llline.cpp4
-rwxr-xr-xindra/llmath/llmath.h15
-rwxr-xr-xindra/llmath/lloctree.h49
-rwxr-xr-xindra/llmath/llplane.h8
-rwxr-xr-xindra/llmath/llquaternion.cpp449
-rwxr-xr-xindra/llmath/llquaternion.h50
-rwxr-xr-xindra/llmath/lltreenode.h9
-rwxr-xr-xindra/llmath/llvolume.cpp84
-rwxr-xr-xindra/llmath/llvolume.h1
-rwxr-xr-xindra/llmath/llvolumemgr.cpp14
-rwxr-xr-xindra/llmath/llvolumeoctree.cpp6
-rwxr-xr-xindra/llmath/llvolumeoctree.h4
-rwxr-xr-xindra/llmath/v3dmath.h150
-rwxr-xr-xindra/llmath/v3math.h43
-rwxr-xr-xindra/llmath/v4color.cpp6
-rwxr-xr-xindra/llmath/v4color.h4
-rwxr-xr-xindra/llmath/xform.cpp4
-rwxr-xr-xindra/llmath/xform.h4
-rwxr-xr-xindra/llmessage/CMakeLists.txt14
-rwxr-xr-xindra/llmessage/llares.cpp59
-rwxr-xr-xindra/llmessage/llares.h3
-rwxr-xr-xindra/llmessage/llareslistener.cpp2
-rwxr-xr-xindra/llmessage/llassetstorage.cpp149
-rwxr-xr-xindra/llmessage/llassetstorage.h31
-rw-r--r--[-rwxr-xr-x]indra/llmessage/llavatarname.cpp (renamed from indra/llcommon/llavatarname.cpp)0
-rw-r--r--[-rwxr-xr-x]indra/llmessage/llavatarname.h (renamed from indra/llcommon/llavatarname.h)0
-rwxr-xr-xindra/llmessage/llavatarnamecache.cpp49
-rwxr-xr-xindra/llmessage/llavatarnamecache.h2
-rwxr-xr-xindra/llmessage/llblowfishcipher.cpp10
-rwxr-xr-xindra/llmessage/llbuffer.cpp31
-rwxr-xr-xindra/llmessage/llbufferstream.cpp2
-rwxr-xr-xindra/llmessage/llcachename.cpp30
-rwxr-xr-xindra/llmessage/llcircuit.cpp249
-rwxr-xr-xindra/llmessage/llcircuit.h81
-rwxr-xr-xindra/llmessage/llcurl.cpp287
-rwxr-xr-xindra/llmessage/llcurl.h116
-rwxr-xr-xindra/llmessage/lldatapacker.cpp74
-rwxr-xr-xindra/llmessage/lldatapacker.h9
-rwxr-xr-xindra/llmessage/lldispatcher.cpp3
-rwxr-xr-xindra/llmessage/llextendedstatus.h (renamed from indra/llcommon/llextendedstatus.h)0
-rwxr-xr-xindra/llmessage/llfiltersd2xmlrpc.cpp93
-rwxr-xr-xindra/llmessage/llhost.cpp18
-rwxr-xr-xindra/llmessage/llhttpassetstorage.cpp130
-rwxr-xr-xindra/llmessage/llhttpassetstorage.h4
-rwxr-xr-xindra/llmessage/llhttpclient.cpp214
-rwxr-xr-xindra/llmessage/llhttpclient.h26
-rwxr-xr-xindra/llmessage/llhttpclientadapter.cpp25
-rwxr-xr-xindra/llmessage/llhttpclientadapter.h8
-rwxr-xr-xindra/llmessage/llhttpconstants.cpp228
-rwxr-xr-xindra/llmessage/llhttpconstants.h225
-rwxr-xr-xindra/llmessage/llhttpnode.cpp43
-rwxr-xr-xindra/llmessage/llhttpnode.h30
-rwxr-xr-xindra/llmessage/llhttpsender.cpp4
-rwxr-xr-xindra/llmessage/llinstantmessage.cpp6
-rwxr-xr-xindra/llmessage/lliobuffer.cpp2
-rwxr-xr-xindra/llmessage/lliohttpserver.cpp165
-rwxr-xr-xindra/llmessage/lliohttpserver.h12
-rwxr-xr-xindra/llmessage/lliopipe.cpp2
-rwxr-xr-xindra/llmessage/lliopipe.h1
-rwxr-xr-xindra/llmessage/lliosocket.cpp66
-rwxr-xr-xindra/llmessage/lliosocket.h4
-rwxr-xr-xindra/llmessage/llioutil.cpp9
-rwxr-xr-xindra/llmessage/llmail.cpp45
-rwxr-xr-xindra/llmessage/llmessageconfig.cpp12
-rwxr-xr-xindra/llmessage/llmessagetemplate.cpp8
-rwxr-xr-xindra/llmessage/llmessagetemplate.h14
-rwxr-xr-xindra/llmessage/llmessagetemplateparser.cpp78
-rwxr-xr-xindra/llmessage/llmime.cpp629
-rwxr-xr-xindra/llmessage/llmime.h292
-rwxr-xr-xindra/llmessage/llnamevalue.cpp38
-rwxr-xr-xindra/llmessage/llnamevalue.h2
-rwxr-xr-xindra/llmessage/llpacketack.cpp6
-rwxr-xr-xindra/llmessage/llpacketack.h11
-rwxr-xr-xindra/llmessage/llpacketbuffer.cpp4
-rwxr-xr-xindra/llmessage/llpacketring.cpp7
-rwxr-xr-xindra/llmessage/llproxy.cpp10
-rwxr-xr-xindra/llmessage/llpumpio.cpp147
-rwxr-xr-xindra/llmessage/llregionflags.h2
-rwxr-xr-xindra/llmessage/llregionhandle.h4
-rwxr-xr-xindra/llmessage/llregionpresenceverifier.cpp153
-rwxr-xr-xindra/llmessage/llregionpresenceverifier.h98
-rwxr-xr-xindra/llmessage/llsdappservices.cpp18
-rwxr-xr-xindra/llmessage/llsdhttpserver.cpp2
-rwxr-xr-xindra/llmessage/llsdmessage.cpp22
-rwxr-xr-xindra/llmessage/llsdmessage.h6
-rwxr-xr-xindra/llmessage/llsdmessagebuilder.cpp6
-rwxr-xr-xindra/llmessage/llsdmessagereader.cpp12
-rwxr-xr-xindra/llmessage/llsdrpcclient.cpp25
-rwxr-xr-xindra/llmessage/llsdrpcclient.h16
-rwxr-xr-xindra/llmessage/llsdrpcserver.cpp17
-rwxr-xr-xindra/llmessage/llsdrpcserver.h4
-rwxr-xr-xindra/llmessage/llservice.cpp12
-rwxr-xr-xindra/llmessage/llservicebuilder.cpp18
-rwxr-xr-xindra/llmessage/lltemplatemessagebuilder.cpp70
-rwxr-xr-xindra/llmessage/lltemplatemessagereader.cpp120
-rwxr-xr-xindra/llmessage/llthrottle.cpp54
-rwxr-xr-xindra/llmessage/llthrottle.h6
-rwxr-xr-xindra/llmessage/lltransfermanager.cpp132
-rwxr-xr-xindra/llmessage/lltransfersourceasset.cpp24
-rwxr-xr-xindra/llmessage/lltransfersourcefile.cpp16
-rwxr-xr-xindra/llmessage/lltransfertargetfile.cpp16
-rwxr-xr-xindra/llmessage/lltransfertargetvfile.cpp20
-rwxr-xr-xindra/llmessage/lltrustedmessageservice.cpp14
-rwxr-xr-xindra/llmessage/lltrustedmessageservice.h4
-rwxr-xr-xindra/llmessage/llurlrequest.cpp140
-rwxr-xr-xindra/llmessage/llurlrequest.h54
-rwxr-xr-xindra/llmessage/lluseroperation.cpp6
-rwxr-xr-xindra/llmessage/llxfer.cpp24
-rwxr-xr-xindra/llmessage/llxfer.h4
-rwxr-xr-xindra/llmessage/llxfer_file.cpp44
-rwxr-xr-xindra/llmessage/llxfer_mem.cpp4
-rwxr-xr-xindra/llmessage/llxfer_vfile.cpp8
-rwxr-xr-xindra/llmessage/llxfermanager.cpp94
-rwxr-xr-xindra/llmessage/llxfermanager.h4
-rwxr-xr-xindra/llmessage/machine.cpp4
-rwxr-xr-xindra/llmessage/message.cpp311
-rwxr-xr-xindra/llmessage/message.h101
-rwxr-xr-xindra/llmessage/message_string_table.cpp4
-rwxr-xr-xindra/llmessage/net.cpp64
-rwxr-xr-xindra/llmessage/net.h3
-rwxr-xr-xindra/llmessage/partsyspacket.cpp4
-rwxr-xr-xindra/llmessage/patch_code.cpp6
-rwxr-xr-xindra/llmessage/tests/llareslistener_test.cpp16
-rwxr-xr-xindra/llmessage/tests/llcurl_stub.cpp59
-rwxr-xr-xindra/llmessage/tests/llhttpclient_test.cpp33
-rwxr-xr-xindra/llmessage/tests/llhttpclientadapter_test.cpp81
-rwxr-xr-xindra/llmessage/tests/llhttpnode_stub.cpp107
-rwxr-xr-xindra/llmessage/tests/llmime_test.cpp445
-rwxr-xr-xindra/llmessage/tests/llregionpresenceverifier_test.cpp108
-rwxr-xr-xindra/llmessage/tests/lltrustedmessageservice_test.cpp1
-rwxr-xr-xindra/llplugin/llplugincookiestore.cpp13
-rwxr-xr-xindra/llplugin/llpluginmessagepipe.cpp2
-rwxr-xr-xindra/llplugin/llpluginprocesschild.h1
-rwxr-xr-xindra/llplugin/llpluginprocessparent.cpp10
-rwxr-xr-xindra/llplugin/llpluginprocessparent.h2
-rwxr-xr-xindra/llplugin/tests/llplugincookiestore_test.cpp1
-rwxr-xr-xindra/llprimitive/CMakeLists.txt3
-rw-r--r--[-rwxr-xr-x]indra/llprimitive/lllslconstants.h (renamed from indra/llcommon/lllslconstants.h)0
-rw-r--r--indra/llprimitive/llmaterial.cpp4
-rw-r--r--indra/llprimitive/llmaterialid.h1
-rwxr-xr-xindra/llprimitive/llmaterialtable.cpp6
-rwxr-xr-xindra/llprimitive/llmodel.cpp98
-rwxr-xr-xindra/llprimitive/llprimitive.cpp31
-rwxr-xr-xindra/llprimitive/llprimitive.h24
-rwxr-xr-xindra/llprimitive/llprimlinkinfo.h8
-rwxr-xr-xindra/llprimitive/llprimtexturelist.cpp2
-rwxr-xr-xindra/llprimitive/lltextureanim.cpp4
-rwxr-xr-xindra/llprimitive/lltextureentry.cpp4
-rwxr-xr-xindra/llprimitive/lltreeparams.cpp2
-rwxr-xr-xindra/llprimitive/llvolumemessage.cpp54
-rwxr-xr-xindra/llprimitive/llvolumexml.cpp78
-rwxr-xr-xindra/llprimitive/llvolumexml.h45
-rwxr-xr-xindra/llprimitive/tests/llmediaentry_test.cpp2
-rwxr-xr-xindra/llrender/llcubemap.cpp2
-rwxr-xr-xindra/llrender/llfontbitmapcache.cpp20
-rwxr-xr-xindra/llrender/llfontbitmapcache.h3
-rwxr-xr-xindra/llrender/llfontfreetype.cpp30
-rwxr-xr-xindra/llrender/llfontfreetype.h6
-rwxr-xr-xindra/llrender/llfontgl.cpp13
-rwxr-xr-xindra/llrender/llfontregistry.cpp54
-rwxr-xr-xindra/llrender/llfontregistry.h5
-rwxr-xr-xindra/llrender/llgl.cpp49
-rwxr-xr-xindra/llrender/llgldbg.cpp82
-rwxr-xr-xindra/llrender/llglheaders.h4
-rwxr-xr-xindra/llrender/llglslshader.cpp32
-rw-r--r--indra/llrender/llgltexture.cpp2
-rw-r--r--indra/llrender/llgltexture.h4
-rwxr-xr-xindra/llrender/llimagegl.cpp226
-rwxr-xr-xindra/llrender/llimagegl.h20
-rwxr-xr-xindra/llrender/llpostprocess.cpp4
-rwxr-xr-xindra/llrender/llrender.cpp78
-rw-r--r--indra/llrender/llrender2dutils.cpp470
-rw-r--r--indra/llrender/llrender2dutils.h9
-rwxr-xr-xindra/llrender/llrendertarget.cpp24
-rwxr-xr-xindra/llrender/llshadermgr.cpp12
-rwxr-xr-xindra/llrender/lltexture.h10
-rw-r--r--indra/llrender/lluiimage.cpp50
-rw-r--r--indra/llrender/lluiimage.h18
-rwxr-xr-xindra/llrender/llvertexbuffer.cpp209
-rwxr-xr-xindra/llrender/llvertexbuffer.h8
-rwxr-xr-xindra/llui/CMakeLists.txt6
-rwxr-xr-xindra/llui/llaccordionctrl.cpp4
-rwxr-xr-xindra/llui/llaccordionctrltab.cpp4
-rwxr-xr-xindra/llui/llaccordionctrltab.h2
-rwxr-xr-xindra/llui/llbadge.cpp4
-rwxr-xr-xindra/llui/llbadgeowner.cpp45
-rwxr-xr-xindra/llui/llbadgeowner.h8
-rwxr-xr-xindra/llui/llbutton.cpp16
-rwxr-xr-xindra/llui/llchat.h (renamed from indra/llcommon/llchat.h)0
-rwxr-xr-xindra/llui/llchatentry.cpp10
-rwxr-xr-xindra/llui/llclipboard.cpp1
-rwxr-xr-xindra/llui/llclipboard.h1
-rwxr-xr-xindra/llui/llcommandmanager.cpp6
-rwxr-xr-xindra/llui/llcontainerview.cpp12
-rwxr-xr-xindra/llui/llcontainerview.h4
-rwxr-xr-xindra/llui/llctrlselectioninterface.h2
-rwxr-xr-xindra/llui/lldraghandle.cpp4
-rwxr-xr-xindra/llui/llflashtimer.cpp20
-rwxr-xr-xindra/llui/llflashtimer.h1
-rwxr-xr-xindra/llui/llflatlistview.cpp4
-rwxr-xr-xindra/llui/llfloater.cpp68
-rwxr-xr-xindra/llui/llfloater.h4
-rwxr-xr-xindra/llui/llfloaterreg.cpp8
-rwxr-xr-xindra/llui/llfloaterreg.h1
-rwxr-xr-xindra/llui/llfocusmgr.cpp4
-rwxr-xr-xindra/llui/llfolderview.cpp88
-rwxr-xr-xindra/llui/llfolderview.h35
-rw-r--r--indra/llui/llfolderviewitem.cpp54
-rw-r--r--indra/llui/llfolderviewitem.h1
-rwxr-xr-xindra/llui/llfolderviewmodel.h66
-rwxr-xr-xindra/llui/llfunctorregistry.h8
-rwxr-xr-xindra/llui/lliconctrl.cpp26
-rwxr-xr-xindra/llui/lliconctrl.h11
-rwxr-xr-xindra/llui/llkeywords.cpp500
-rwxr-xr-xindra/llui/llkeywords.h119
-rwxr-xr-xindra/llui/lllayoutstack.cpp136
-rwxr-xr-xindra/llui/lllayoutstack.h22
-rwxr-xr-xindra/llui/lllineeditor.cpp14
-rwxr-xr-xindra/llui/llmenubutton.cpp3
-rwxr-xr-xindra/llui/llmenugl.cpp29
-rwxr-xr-xindra/llui/llmenugl.h21
-rwxr-xr-xindra/llui/llmodaldialog.cpp8
-rwxr-xr-xindra/llui/llmultifloater.cpp15
-rwxr-xr-xindra/llui/llmultifloater.h5
-rwxr-xr-xindra/llui/llmultislider.cpp6
-rwxr-xr-xindra/llui/llmultisliderctrl.cpp2
-rwxr-xr-xindra/llui/llnotifications.cpp48
-rwxr-xr-xindra/llui/llnotifications.h16
-rw-r--r--indra/llui/llnotificationslistener.cpp27
-rwxr-xr-xindra/llui/llnotificationsutil.h1
-rwxr-xr-xindra/llui/llnotificationtemplate.h23
-rwxr-xr-xindra/llui/llpanel.cpp249
-rwxr-xr-xindra/llui/llpanel.h40
-rwxr-xr-xindra/llui/llradiogroup.cpp4
-rwxr-xr-xindra/llui/llresizebar.cpp78
-rwxr-xr-xindra/llui/llresizebar.h15
-rwxr-xr-xindra/llui/llresmgr.cpp29
-rwxr-xr-xindra/llui/llrngwriter.cpp1
-rwxr-xr-xindra/llui/llscrollbar.cpp8
-rwxr-xr-xindra/llui/llscrollbar.h8
-rwxr-xr-xindra/llui/llscrollcontainer.cpp8
-rwxr-xr-xindra/llui/llscrollcontainer.h4
-rwxr-xr-xindra/llui/llscrollingpanellist.cpp2
-rwxr-xr-xindra/llui/llscrolllistctrl.cpp13
-rwxr-xr-xindra/llui/llscrolllistctrl.h1
-rwxr-xr-xindra/llui/llscrolllistitem.cpp2
-rwxr-xr-xindra/llui/llslider.cpp4
-rwxr-xr-xindra/llui/llslider.h4
-rwxr-xr-xindra/llui/llsliderctrl.cpp2
-rwxr-xr-xindra/llui/llspinctrl.cpp4
-rwxr-xr-xindra/llui/llstatbar.cpp751
-rwxr-xr-xindra/llui/llstatbar.h122
-rwxr-xr-xindra/llui/llstatgraph.cpp89
-rwxr-xr-xindra/llui/llstatgraph.h99
-rwxr-xr-xindra/llui/llstatview.h3
-rwxr-xr-xindra/llui/lltabcontainer.cpp25
-rwxr-xr-xindra/llui/lltextbase.cpp118
-rwxr-xr-xindra/llui/lltextbase.h63
-rwxr-xr-xindra/llui/lltexteditor.cpp162
-rwxr-xr-xindra/llui/lltexteditor.h58
-rwxr-xr-xindra/llui/lltextparser.cpp2
-rwxr-xr-xindra/llui/lltextutil.cpp4
-rwxr-xr-xindra/llui/lltextutil.h2
-rwxr-xr-xindra/llui/lltoggleablemenu.cpp2
-rwxr-xr-xindra/llui/lltoggleablemenu.h2
-rwxr-xr-xindra/llui/lltoolbar.cpp15
-rwxr-xr-xindra/llui/lltoolbar.h3
-rwxr-xr-xindra/llui/lltooltip.cpp6
-rwxr-xr-xindra/llui/lltrans.cpp22
-rwxr-xr-xindra/llui/lltrans.h1
-rwxr-xr-xindra/llui/lltransutil.cpp4
-rwxr-xr-xindra/llui/llui.cpp10
-rwxr-xr-xindra/llui/llui.h59
-rwxr-xr-xindra/llui/lluicolortable.cpp10
-rwxr-xr-xindra/llui/lluictrl.cpp188
-rwxr-xr-xindra/llui/lluictrl.h3
-rwxr-xr-xindra/llui/lluictrlfactory.cpp22
-rwxr-xr-xindra/llui/lluictrlfactory.h24
-rwxr-xr-xindra/llui/lluistring.cpp8
-rwxr-xr-xindra/llui/lluistring.h6
-rwxr-xr-xindra/llui/llundo.cpp2
-rwxr-xr-xindra/llui/llurlentry.cpp4
-rwxr-xr-xindra/llui/llurlentry.h1
-rwxr-xr-xindra/llui/llurlregistry.cpp11
-rwxr-xr-xindra/llui/llurlregistry.h4
-rwxr-xr-xindra/llui/llview.cpp329
-rwxr-xr-xindra/llui/llview.h54
-rw-r--r--indra/llui/llviewereventrecorder.cpp30
-rwxr-xr-xindra/llui/llviewmodel.cpp18
-rwxr-xr-xindra/llui/llviewmodel.h7
-rwxr-xr-xindra/llui/llviewquery.cpp25
-rwxr-xr-xindra/llui/llviewquery.h7
-rwxr-xr-xindra/llui/llxuiparser.cpp27
-rwxr-xr-xindra/llui/llxuiparser.h30
-rwxr-xr-xindra/llvfs/lldir.cpp64
-rwxr-xr-xindra/llvfs/lldir_linux.cpp26
-rwxr-xr-xindra/llvfs/lldir_mac.cpp4
-rwxr-xr-xindra/llvfs/lldir_solaris.cpp34
-rwxr-xr-xindra/llvfs/lldir_win32.cpp14
-rwxr-xr-xindra/llvfs/lldirguard.h2
-rwxr-xr-xindra/llvfs/lldiriterator.cpp18
-rwxr-xr-xindra/llvfs/lllfsthread.cpp20
-rw-r--r--[-rwxr-xr-x]indra/llvfs/llpidlock.cpp8
-rw-r--r--[-rwxr-xr-x]indra/llvfs/llpidlock.h0
-rwxr-xr-xindra/llvfs/llvfile.cpp51
-rwxr-xr-xindra/llvfs/llvfs.cpp200
-rwxr-xr-xindra/llvfs/llvfs.h1
-rwxr-xr-xindra/llvfs/llvfsthread.cpp26
-rwxr-xr-xindra/llvfs/tests/lldiriterator_test.cpp6
-rwxr-xr-xindra/llwindow/CMakeLists.txt2
-rwxr-xr-xindra/llwindow/llcursortypes.cpp (renamed from indra/llcommon/llcursortypes.cpp)0
-rwxr-xr-xindra/llwindow/llcursortypes.h (renamed from indra/llcommon/llcursortypes.h)0
-rwxr-xr-xindra/llwindow/lldragdropwin32.cpp10
-rwxr-xr-xindra/llwindow/lldragdropwin32.h4
-rwxr-xr-xindra/llwindow/lldxhardware.cpp210
-rwxr-xr-xindra/llwindow/llkeyboard.cpp8
-rwxr-xr-xindra/llwindow/llkeyboard.h3
-rwxr-xr-xindra/llwindow/llkeyboardwin32.cpp7
-rwxr-xr-xindra/llwindow/llmousehandler.cpp4
-rw-r--r--indra/llwindow/llopenglview-objc.h4
-rw-r--r--indra/llwindow/llopenglview-objc.mm219
-rwxr-xr-xindra/llwindow/llwindow.cpp13
-rwxr-xr-xindra/llwindow/llwindow.h3
-rwxr-xr-xindra/llwindow/llwindowmacosx-objc.h1
-rwxr-xr-xindra/llwindow/llwindowmacosx-objc.mm7
-rwxr-xr-xindra/llwindow/llwindowmacosx.cpp68
-rwxr-xr-xindra/llwindow/llwindowmacosx.h5
-rwxr-xr-xindra/llwindow/llwindowmesaheadless.cpp4
-rwxr-xr-xindra/llwindow/llwindowsdl.cpp230
-rwxr-xr-xindra/llwindow/llwindowwin32.cpp151
-rwxr-xr-xindra/llwindow/llwindowwin32.h4
-rwxr-xr-xindra/llxml/llcontrol.cpp34
-rwxr-xr-xindra/llxml/llcontrol.h23
-rwxr-xr-xindra/llxml/llxmlnode.cpp94
-rwxr-xr-xindra/llxml/llxmlnode.h7
-rwxr-xr-xindra/llxml/llxmlparser.cpp2
-rwxr-xr-xindra/llxml/llxmlparser.h2
-rwxr-xr-xindra/llxml/llxmltree.cpp40
-rwxr-xr-xindra/llxml/llxmltree.h4
-rwxr-xr-xindra/lscript/lscript_compile/indra.l4
-rwxr-xr-xindra/lscript/lscript_compile/lscript_bytecode.cpp19
-rwxr-xr-xindra/lscript/lscript_compile/lscript_bytecode.h5
-rwxr-xr-xindra/lscript/lscript_compile/lscript_scope.h51
-rwxr-xr-xindra/lscript/lscript_compile/lscript_tree.h9
-rwxr-xr-xindra/lscript/lscript_execute.h65
-rwxr-xr-xindra/lscript/lscript_execute/llscriptresourceconsumer.cpp2
-rwxr-xr-xindra/lscript/lscript_execute/lscript_execute.cpp33
-rwxr-xr-xindra/lscript/lscript_execute/lscript_readlso.cpp4
-rwxr-xr-xindra/lscript/lscript_execute/lscript_readlso.h1
-rwxr-xr-xindra/lscript/lscript_library.h16
-rwxr-xr-xindra/lscript/lscript_library/lscript_alloc.cpp2
-rwxr-xr-xindra/lscript/lscript_library/lscript_library.cpp2
-rwxr-xr-xindra/mac_crash_logger/mac_crash_logger.cpp4
-rw-r--r--indra/mac_updater/mac_updater.cpp1266
-rwxr-xr-xindra/media_plugins/quicktime/media_plugin_quicktime.cpp23
-rwxr-xr-xindra/media_plugins/webkit/CMakeLists.txt12
-rwxr-xr-xindra/media_plugins/webkit/mac_volume_catcher.cpp1
-rwxr-xr-xindra/media_plugins/webkit/media_plugin_webkit.cpp16
-rwxr-xr-xindra/media_plugins/winmmshim/winmm_shim.cpp2
-rwxr-xr-xindra/newview/CMakeLists.txt130
-rw-r--r--indra/newview/SecondLife.nibbin12348 -> 12345 bytes
-rw-r--r--indra/newview/SecondLife.xib2
-rw-r--r--indra/newview/VIEWER_VERSION.txt2
-rwxr-xr-xindra/newview/app_settings/commands.xml32
-rwxr-xr-xindra/newview/app_settings/filters/Autocontrast.xml11
-rw-r--r--indra/newview/app_settings/filters/BlackAndWhite.xml7
-rw-r--r--indra/newview/app_settings/filters/Colors1970.xml47
-rw-r--r--indra/newview/app_settings/filters/Intense.xml8
-rw-r--r--indra/newview/app_settings/filters/LensFlare.xml131
-rwxr-xr-xindra/newview/app_settings/filters/Miniature.xml118
-rwxr-xr-xindra/newview/app_settings/filters/Newspaper.xml20
-rw-r--r--indra/newview/app_settings/filters/Sepia.xml7
-rw-r--r--indra/newview/app_settings/filters/Spotlight.xml47
-rwxr-xr-xindra/newview/app_settings/filters/Toycamera.xml46
-rwxr-xr-xindra/newview/app_settings/filters/Video.xml44
-rwxr-xr-xindra/newview/app_settings/keys.xml13
-rwxr-xr-xindra/newview/app_settings/keywords.ini47
-rwxr-xr-xindra/newview/app_settings/keywords_lsl_default.xml18289
-rwxr-xr-xindra/newview/app_settings/llsd-lsl-syntax.rng390
-rwxr-xr-xindra/newview/app_settings/logcontrol.xml2
-rwxr-xr-xindra/newview/app_settings/settings.xml792
-rwxr-xr-xindra/newview/app_settings/settings_per_account.xml2
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl2
-rw-r--r--[-rwxr-xr-x]indra/newview/app_settings/shaders/class1/interface/onetexturefilterF.glsl (renamed from indra/llcommon/timing.h)39
-rw-r--r--[-rwxr-xr-x]indra/newview/app_settings/shaders/class1/interface/onetexturefilterV.glsl (renamed from indra/llcommon/reflective.cpp)26
-rw-r--r--[-rwxr-xr-x]indra/newview/app_settings/shaders/class1/interface/twotexturecompareF.glsl (renamed from indra/llcommon/lllog.h)58
-rw-r--r--[-rwxr-xr-x]indra/newview/app_settings/shaders/class1/interface/twotexturecompareV.glsl (renamed from indra/llcommon/lloptioninterface.cpp)22
-rwxr-xr-xindra/newview/app_settings/toolbars.xml2
-rwxr-xr-xindra/newview/character/avatar_lad.xml18
-rwxr-xr-xindra/newview/featuretable_mac.txt6
-rwxr-xr-xindra/newview/gpu_table.txt3
-rwxr-xr-xindra/newview/icons/beta/secondlife_128.pngbin18268 -> 16200 bytes
-rwxr-xr-xindra/newview/icons/beta/secondlife_16.pngbin3536 -> 1020 bytes
-rwxr-xr-xindra/newview/icons/beta/secondlife_256.pngbin49418 -> 49119 bytes
-rwxr-xr-xindra/newview/icons/beta/secondlife_32.pngbin4767 -> 2252 bytes
-rwxr-xr-xindra/newview/icons/beta/secondlife_48.pngbin6438 -> 3940 bytes
-rwxr-xr-xindra/newview/icons/beta/secondlife_512.pngbin151779 -> 157618 bytes
-rwxr-xr-xindra/newview/icons/project/secondlife_128.pngbin17706 -> 15587 bytes
-rwxr-xr-xindra/newview/icons/project/secondlife_16.pngbin3471 -> 956 bytes
-rwxr-xr-xindra/newview/icons/project/secondlife_256.pngbin48488 -> 48230 bytes
-rwxr-xr-xindra/newview/icons/project/secondlife_32.pngbin4675 -> 2153 bytes
-rwxr-xr-xindra/newview/icons/project/secondlife_48.pngbin6195 -> 3704 bytes
-rwxr-xr-xindra/newview/icons/project/secondlife_512.pngbin149145 -> 155555 bytes
-rwxr-xr-xindra/newview/icons/release/secondlife_128.pngbin17198 -> 15184 bytes
-rwxr-xr-xindra/newview/icons/release/secondlife_16.pngbin3524 -> 1009 bytes
-rwxr-xr-xindra/newview/icons/release/secondlife_256.pngbin47946 -> 47740 bytes
-rwxr-xr-xindra/newview/icons/release/secondlife_32.pngbin4746 -> 2237 bytes
-rwxr-xr-xindra/newview/icons/release/secondlife_48.pngbin6249 -> 3748 bytes
-rwxr-xr-xindra/newview/icons/release/secondlife_512.pngbin147963 -> 154396 bytes
-rwxr-xr-xindra/newview/icons/test/secondlife_128.pngbin17156 -> 15058 bytes
-rwxr-xr-xindra/newview/icons/test/secondlife_16.pngbin3471 -> 956 bytes
-rwxr-xr-xindra/newview/icons/test/secondlife_256.pngbin47522 -> 47320 bytes
-rwxr-xr-xindra/newview/icons/test/secondlife_32.pngbin4644 -> 2130 bytes
-rwxr-xr-xindra/newview/icons/test/secondlife_48.pngbin6115 -> 3630 bytes
-rwxr-xr-xindra/newview/icons/test/secondlife_512.pngbin146971 -> 153502 bytes
-rwxr-xr-xindra/newview/installers/windows/installer_template.nsi210
-rwxr-xr-xindra/newview/installers/windows/lang_da.nsibin7108 -> 8026 bytes
-rwxr-xr-xindra/newview/installers/windows/lang_de.nsibin8260 -> 9346 bytes
-rwxr-xr-xindra/newview/installers/windows/lang_en-us.nsibin7542 -> 8120 bytes
-rwxr-xr-xindra/newview/installers/windows/lang_es.nsibin7846 -> 8764 bytes
-rwxr-xr-xindra/newview/installers/windows/lang_fr.nsibin8114 -> 9030 bytes
-rwxr-xr-xindra/newview/installers/windows/lang_it.nsibin7438 -> 8372 bytes
-rwxr-xr-xindra/newview/installers/windows/lang_ja.nsibin6302 -> 7288 bytes
-rwxr-xr-xindra/newview/installers/windows/lang_pl.nsibin7450 -> 8426 bytes
-rwxr-xr-xindra/newview/installers/windows/lang_pt-br.nsibin7832 -> 8788 bytes
-rwxr-xr-xindra/newview/installers/windows/lang_ru.nsibin7598 -> 8144 bytes
-rwxr-xr-xindra/newview/installers/windows/lang_tr.nsibin7722 -> 8266 bytes
-rwxr-xr-xindra/newview/installers/windows/lang_zh.nsibin5824 -> 6798 bytes
-rwxr-xr-xindra/newview/llaccountingcost.h (renamed from indra/llcommon/llstack.h)45
-rwxr-xr-xindra/newview/llaccountingcostmanager.cpp18
-rwxr-xr-xindra/newview/llaccountingcostmanager.h2
-rwxr-xr-xindra/newview/llagent.cpp577
-rwxr-xr-xindra/newview/llagent.h46
-rwxr-xr-xindra/newview/llagentcamera.cpp66
-rwxr-xr-xindra/newview/llagentcamera.h1
-rwxr-xr-xindra/newview/llagentlistener.cpp10
-rwxr-xr-xindra/newview/llagentpicksinfo.cpp6
-rwxr-xr-xindra/newview/llagentpilot.cpp61
-rwxr-xr-xindra/newview/llagentpilot.h3
-rwxr-xr-xindra/newview/llagentwearables.cpp820
-rwxr-xr-xindra/newview/llagentwearables.h58
-rwxr-xr-xindra/newview/llagentwearablesfetch.cpp600
-rwxr-xr-xindra/newview/llagentwearablesfetch.h114
-rwxr-xr-xindra/newview/llaisapi.cpp888
-rwxr-xr-xindra/newview/llaisapi.h183
-rw-r--r--indra/newview/llappdelegate-objc.mm2
-rwxr-xr-xindra/newview/llappearancemgr.cpp1995
-rwxr-xr-xindra/newview/llappearancemgr.h98
-rwxr-xr-xindra/newview/llappviewer.cpp556
-rwxr-xr-xindra/newview/llappviewer.h17
-rwxr-xr-xindra/newview/llappviewerlinux.cpp14
-rwxr-xr-xindra/newview/llappviewerlinux_api_dbus.cpp6
-rwxr-xr-xindra/newview/llappviewermacosx.cpp8
-rw-r--r--indra/newview/llappviewerwin32.cpp73
-rw-r--r--indra/newview/llappviewerwin32.h3
-rwxr-xr-xindra/newview/llassetuploadqueue.cpp89
-rwxr-xr-xindra/newview/llassetuploadresponders.cpp160
-rwxr-xr-xindra/newview/llassetuploadresponders.h41
-rwxr-xr-xindra/newview/llattachmentsmgr.cpp2
-rwxr-xr-xindra/newview/llavataractions.cpp32
-rwxr-xr-xindra/newview/llavataractions.h1
-rwxr-xr-xindra/newview/llavatariconctrl.cpp72
-rwxr-xr-xindra/newview/llavatariconctrl.h46
-rwxr-xr-xindra/newview/llavatarlist.cpp2
-rwxr-xr-xindra/newview/llavatarpropertiesprocessor.cpp5
-rwxr-xr-xindra/newview/llavatarpropertiesprocessor.h8
-rw-r--r--indra/newview/llavatarrenderinfoaccountant.cpp66
-rwxr-xr-xindra/newview/llblocklist.cpp2
-rwxr-xr-xindra/newview/llbreastmotion.cpp3
-rwxr-xr-xindra/newview/llbuycurrencyhtml.cpp2
-rwxr-xr-xindra/newview/llcallbacklist.cpp30
-rwxr-xr-xindra/newview/llcallingcard.cpp54
-rwxr-xr-xindra/newview/llcaphttpsender.cpp4
-rwxr-xr-xindra/newview/llchannelmanager.cpp54
-rwxr-xr-xindra/newview/llchatbar.cpp33
-rwxr-xr-xindra/newview/llchathistory.cpp51
-rwxr-xr-xindra/newview/llchathistory.h7
-rwxr-xr-xindra/newview/llchatitemscontainerctrl.cpp27
-rwxr-xr-xindra/newview/llchatitemscontainerctrl.h2
-rwxr-xr-xindra/newview/llchiclet.cpp7
-rwxr-xr-xindra/newview/llchiclet.h8
-rwxr-xr-xindra/newview/llchicletbar.cpp22
-rwxr-xr-xindra/newview/llclassifiedstatsresponder.cpp30
-rwxr-xr-xindra/newview/llclassifiedstatsresponder.h8
-rwxr-xr-xindra/newview/llcofwearables.cpp6
-rwxr-xr-xindra/newview/llcolorswatch.cpp15
-rwxr-xr-xindra/newview/llcolorswatch.h32
-rwxr-xr-xindra/newview/llcommandlineparser.cpp30
-rwxr-xr-xindra/newview/llcompilequeue.cpp246
-rwxr-xr-xindra/newview/llcompilequeue.h22
-rwxr-xr-xindra/newview/llconversationlog.cpp86
-rwxr-xr-xindra/newview/llconversationlog.h9
-rwxr-xr-xindra/newview/llconversationloglist.cpp6
-rwxr-xr-xindra/newview/llconversationmodel.cpp15
-rw-r--r--indra/newview/llconversationmodel.h5
-rw-r--r--indra/newview/llconversationview.cpp7
-rwxr-xr-xindra/newview/lldaycyclemanager.cpp2
-rwxr-xr-xindra/newview/lldebugmessagebox.cpp6
-rwxr-xr-xindra/newview/lldebugmessagebox.h1
-rwxr-xr-xindra/newview/lldebugview.cpp14
-rwxr-xr-xindra/newview/lldebugview.h2
-rwxr-xr-xindra/newview/lldeferredsounds.cpp5
-rwxr-xr-xindra/newview/lldirpicker.cpp2
-rwxr-xr-xindra/newview/lldirpicker.h5
-rwxr-xr-xindra/newview/lldonotdisturbnotificationstorage.cpp8
-rwxr-xr-xindra/newview/lldrawable.cpp403
-rwxr-xr-xindra/newview/lldrawable.h74
-rwxr-xr-xindra/newview/lldrawpool.cpp12
-rwxr-xr-xindra/newview/lldrawpoolalpha.cpp40
-rwxr-xr-xindra/newview/lldrawpoolavatar.cpp50
-rwxr-xr-xindra/newview/lldrawpoolbump.cpp96
-rw-r--r--indra/newview/lldrawpoolmaterials.cpp4
-rwxr-xr-xindra/newview/lldrawpoolsimple.cpp60
-rwxr-xr-xindra/newview/lldrawpoolsky.cpp2
-rwxr-xr-xindra/newview/lldrawpoolterrain.cpp20
-rwxr-xr-xindra/newview/lldrawpooltree.cpp16
-rwxr-xr-xindra/newview/lldrawpoolwater.cpp8
-rwxr-xr-xindra/newview/lldrawpoolwlsky.cpp18
-rwxr-xr-xindra/newview/lldynamictexture.cpp2
-rwxr-xr-xindra/newview/lldynamictexture.h6
-rwxr-xr-xindra/newview/llemote.cpp12
-rwxr-xr-xindra/newview/llenvmanager.cpp30
-rwxr-xr-xindra/newview/llestateinfomodel.cpp18
-rwxr-xr-xindra/newview/lleventnotifier.cpp2
-rwxr-xr-xindra/newview/lleventpoll.cpp81
-rwxr-xr-xindra/newview/llexternaleditor.cpp18
-rwxr-xr-xindra/newview/llface.cpp290
-rwxr-xr-xindra/newview/llface.h27
-rwxr-xr-xindra/newview/llface.inl6
-rwxr-xr-x[-rw-r--r--]indra/newview/llfacebookconnect.cpp307
-rw-r--r--indra/newview/llfacebookconnect.h2
-rwxr-xr-xindra/newview/llfasttimerview.cpp1667
-rwxr-xr-xindra/newview/llfasttimerview.h112
-rwxr-xr-xindra/newview/llfavoritesbar.cpp76
-rwxr-xr-xindra/newview/llfavoritesbar.h2
-rwxr-xr-xindra/newview/llfeaturemanager.cpp39
-rwxr-xr-xindra/newview/llfilepicker.cpp64
-rwxr-xr-xindra/newview/llfilepicker.h4
-rw-r--r--indra/newview/llfilepicker_mac.mm2
-rwxr-xr-xindra/newview/llfirstuse.cpp5
-rwxr-xr-xindra/newview/llflexibleobject.cpp30
-rwxr-xr-xindra/newview/llflexibleobject.h2
-rw-r--r--indra/newview/llflickrconnect.cpp509
-rw-r--r--indra/newview/llflickrconnect.h98
-rwxr-xr-xindra/newview/llfloaterabout.cpp38
-rwxr-xr-xindra/newview/llfloaterauction.cpp22
-rwxr-xr-xindra/newview/llfloateravatar.cpp8
-rwxr-xr-xindra/newview/llfloateravatarpicker.cpp27
-rwxr-xr-xindra/newview/llfloateravatartextures.cpp7
-rw-r--r--indra/newview/llfloaterbigpreview.cpp110
-rw-r--r--indra/newview/llfloaterbigpreview.h54
-rwxr-xr-xindra/newview/llfloaterbulkpermission.cpp35
-rwxr-xr-xindra/newview/llfloaterbulkpermission.h6
-rwxr-xr-xindra/newview/llfloaterbump.cpp4
-rwxr-xr-xindra/newview/llfloaterbuy.cpp6
-rwxr-xr-xindra/newview/llfloaterbuycontents.cpp6
-rwxr-xr-xindra/newview/llfloaterbuycurrencyhtml.cpp5
-rwxr-xr-xindra/newview/llfloaterbuyland.cpp8
-rwxr-xr-xindra/newview/llfloaterbvhpreview.cpp12
-rwxr-xr-xindra/newview/llfloatercolorpicker.cpp25
-rwxr-xr-xindra/newview/llfloatercolorpicker.h5
-rwxr-xr-xindra/newview/llfloaterconversationpreview.cpp104
-rwxr-xr-xindra/newview/llfloaterconversationpreview.h11
-rwxr-xr-xindra/newview/llfloaterdeleteenvpreset.cpp4
-rwxr-xr-xindra/newview/llfloaterdisplayname.cpp2
-rwxr-xr-xindra/newview/llfloatereditdaycycle.cpp22
-rwxr-xr-xindra/newview/llfloatereditsky.cpp6
-rwxr-xr-xindra/newview/llfloatereditwater.cpp6
-rwxr-xr-xindra/newview/llfloaterevent.cpp1
-rw-r--r--indra/newview/llfloaterfacebook.cpp (renamed from indra/newview/llfloatersocial.cpp)765
-rw-r--r--indra/newview/llfloaterfacebook.h (renamed from indra/newview/llfloatersocial.h)105
-rw-r--r--indra/newview/llfloaterflickr.cpp789
-rw-r--r--indra/newview/llfloaterflickr.h134
-rwxr-xr-xindra/newview/llfloatergesture.cpp37
-rwxr-xr-xindra/newview/llfloatergodtools.cpp8
-rw-r--r--indra/newview/llfloatergotoline.cpp2
-rw-r--r--indra/newview/llfloatergroupbulkban.cpp134
-rw-r--r--indra/newview/llfloatergroupbulkban.h48
-rwxr-xr-xindra/newview/llfloatergroupinvite.cpp2
-rwxr-xr-xindra/newview/llfloatergroups.cpp10
-rwxr-xr-xindra/newview/llfloaterhardwaresettings.cpp11
-rwxr-xr-xindra/newview/llfloaterhelpbrowser.cpp6
-rwxr-xr-xindra/newview/llfloaterimcontainer.cpp171
-rwxr-xr-xindra/newview/llfloaterimcontainer.h7
-rwxr-xr-xindra/newview/llfloaterimnearbychat.cpp21
-rwxr-xr-xindra/newview/llfloaterimnearbychathandler.cpp18
-rwxr-xr-xindra/newview/llfloaterimsession.cpp34
-rw-r--r--[-rwxr-xr-x]indra/newview/llfloaterimsession.h2
-rwxr-xr-xindra/newview/llfloaterimsessiontab.cpp36
-rwxr-xr-xindra/newview/llfloaterjoystick.cpp27
-rwxr-xr-xindra/newview/llfloaterjoystick.h1
-rw-r--r--[-rwxr-xr-x]indra/newview/llfloaterlagmeter.cpp47
-rw-r--r--[-rwxr-xr-x]indra/newview/llfloaterlagmeter.h36
-rwxr-xr-xindra/newview/llfloaterland.cpp96
-rwxr-xr-xindra/newview/llfloaterland.h3
-rwxr-xr-xindra/newview/llfloaterlandholdings.cpp10
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp176
-rwxr-xr-xindra/newview/llfloatermodelpreview.h4
-rwxr-xr-xindra/newview/llfloatermodeluploadbase.cpp6
-rwxr-xr-xindra/newview/llfloatermodeluploadbase.h4
-rwxr-xr-xindra/newview/llfloaternamedesc.cpp6
-rwxr-xr-xindra/newview/llfloaternotificationsconsole.cpp19
-rwxr-xr-xindra/newview/llfloaterobjectweights.cpp4
-rwxr-xr-xindra/newview/llfloaterobjectweights.h2
-rwxr-xr-xindra/newview/llfloateropenobject.cpp20
-rwxr-xr-xindra/newview/llfloateropenobject.h11
-rwxr-xr-xindra/newview/llfloateroutbox.cpp8
-rwxr-xr-xindra/newview/llfloaterpathfindingconsole.cpp2
-rwxr-xr-xindra/newview/llfloaterperms.cpp229
-rwxr-xr-xindra/newview/llfloaterperms.h55
-rwxr-xr-xindra/newview/llfloaterpreference.cpp29
-rwxr-xr-xindra/newview/llfloaterpreference.h4
-rwxr-xr-xindra/newview/llfloaterproperties.cpp10
-rwxr-xr-xindra/newview/llfloaterregiondebugconsole.cpp20
-rwxr-xr-xindra/newview/llfloaterregioninfo.cpp128
-rwxr-xr-xindra/newview/llfloaterregioninfo.h5
-rwxr-xr-xindra/newview/llfloaterreporter.cpp38
-rw-r--r--indra/newview/llfloatersceneloadstats.cpp40
-rw-r--r--[-rwxr-xr-x]indra/newview/llfloatersceneloadstats.h (renamed from indra/llcommon/lloptioninterface.h)27
-rw-r--r--indra/newview/llfloaterscriptedprefs.cpp65
-rw-r--r--[-rwxr-xr-x]indra/newview/llfloaterscriptedprefs.h (renamed from indra/llcommon/reflectivet.h)45
-rwxr-xr-xindra/newview/llfloaterscriptlimits.cpp115
-rwxr-xr-xindra/newview/llfloaterscriptlimits.h62
-rwxr-xr-xindra/newview/llfloatersearch.cpp3
-rwxr-xr-xindra/newview/llfloatersettingsdebug.cpp4
-rwxr-xr-xindra/newview/llfloatersidepanelcontainer.cpp4
-rwxr-xr-xindra/newview/llfloatersidepanelcontainer.h4
-rwxr-xr-xindra/newview/llfloatersnapshot.cpp319
-rwxr-xr-xindra/newview/llfloatersnapshot.h3
-rwxr-xr-xindra/newview/llfloatertools.cpp15
-rwxr-xr-xindra/newview/llfloatertopobjects.cpp24
-rwxr-xr-xindra/newview/llfloatertopobjects.h17
-rwxr-xr-xindra/newview/llfloatertos.cpp68
-rwxr-xr-xindra/newview/llfloatertranslationsettings.cpp2
-rw-r--r--indra/newview/llfloatertwitter.cpp818
-rw-r--r--indra/newview/llfloatertwitter.h138
-rwxr-xr-xindra/newview/llfloateruipreview.cpp15
-rwxr-xr-xindra/newview/llfloaterurlentry.cpp55
-rwxr-xr-xindra/newview/llfloaterurlentry.h2
-rwxr-xr-xindra/newview/llfloaterwebcontent.cpp71
-rwxr-xr-xindra/newview/llfloaterwebcontent.h8
-rwxr-xr-xindra/newview/llfloaterwebprofile.cpp6
-rwxr-xr-xindra/newview/llfloaterworldmap.cpp33
-rwxr-xr-xindra/newview/llfloaterworldmap.h5
-rwxr-xr-xindra/newview/llfolderviewmodelinventory.cpp8
-rwxr-xr-xindra/newview/llfolderviewmodelinventory.h4
-rwxr-xr-xindra/newview/llfollowcam.cpp16
-rwxr-xr-xindra/newview/llfriendcard.cpp59
-rwxr-xr-xindra/newview/llgesturelistener.cpp8
-rwxr-xr-xindra/newview/llgesturemgr.cpp105
-rwxr-xr-xindra/newview/llgiveinventory.cpp34
-rwxr-xr-xindra/newview/llglsandbox.cpp9
-rwxr-xr-xindra/newview/llgroupactions.cpp23
-rwxr-xr-xindra/newview/llgroupiconctrl.cpp28
-rwxr-xr-xindra/newview/llgrouplist.cpp6
-rwxr-xr-xindra/newview/llgroupmgr.cpp345
-rwxr-xr-xindra/newview/llgroupmgr.h90
-rwxr-xr-xindra/newview/llhomelocationresponder.cpp37
-rwxr-xr-xindra/newview/llhomelocationresponder.h6
-rwxr-xr-xindra/newview/llhttpretrypolicy.cpp142
-rwxr-xr-xindra/newview/llhttpretrypolicy.h98
-rwxr-xr-xindra/newview/llhudeffect.cpp2
-rwxr-xr-xindra/newview/llhudeffectbeam.cpp10
-rwxr-xr-xindra/newview/llhudeffectlookat.cpp12
-rwxr-xr-xindra/newview/llhudeffectpointat.cpp8
-rwxr-xr-xindra/newview/llhudeffecttrail.cpp4
-rwxr-xr-xindra/newview/llhudicon.h4
-rwxr-xr-xindra/newview/llhudmanager.cpp36
-rwxr-xr-xindra/newview/llhudmanager.h7
-rwxr-xr-xindra/newview/llhudnametag.cpp9
-rwxr-xr-xindra/newview/llhudobject.cpp10
-rwxr-xr-xindra/newview/llhudtext.cpp2
-rw-r--r--indra/newview/llimagefiltersmanager.cpp115
-rw-r--r--indra/newview/llimagefiltersmanager.h55
-rwxr-xr-xindra/newview/llimpanel.cpp17
-rwxr-xr-xindra/newview/llimview.cpp140
-rwxr-xr-xindra/newview/llimview.h20
-rwxr-xr-xindra/newview/llinspect.cpp2
-rwxr-xr-xindra/newview/llinspectavatar.cpp5
-rwxr-xr-xindra/newview/llinspecttoast.cpp4
-rwxr-xr-xindra/newview/llinventorybridge.cpp523
-rwxr-xr-xindra/newview/llinventorybridge.h11
-rwxr-xr-xindra/newview/llinventoryfilter.cpp95
-rwxr-xr-xindra/newview/llinventoryfilter.h14
-rwxr-xr-xindra/newview/llinventoryfunctions.cpp22
-rwxr-xr-xindra/newview/llinventoryfunctions.h7
-rwxr-xr-xindra/newview/llinventoryicon.cpp3
-rwxr-xr-xindra/newview/llinventoryicon.h5
-rwxr-xr-xindra/newview/llinventoryitemslist.cpp8
-rwxr-xr-xindra/newview/llinventoryitemslist.h4
-rwxr-xr-xindra/newview/llinventorymodel.cpp1580
-rwxr-xr-xindra/newview/llinventorymodel.h96
-rwxr-xr-xindra/newview/llinventorymodelbackgroundfetch.cpp132
-rwxr-xr-xindra/newview/llinventoryobserver.cpp213
-rwxr-xr-xindra/newview/llinventoryobserver.h63
-rwxr-xr-xindra/newview/llinventorypanel.cpp73
-rwxr-xr-xindra/newview/llinventorypanel.h2
-rwxr-xr-xindra/newview/lljoystickbutton.cpp14
-rwxr-xr-xindra/newview/lllandmarkactions.cpp6
-rwxr-xr-xindra/newview/lllandmarklist.cpp9
-rwxr-xr-xindra/newview/lllistcontextmenu.cpp3
-rwxr-xr-xindra/newview/lllocalbitmaps.cpp97
-rwxr-xr-xindra/newview/lllocalbitmaps.h4
-rwxr-xr-xindra/newview/lllocationhistory.cpp14
-rwxr-xr-xindra/newview/lllocationinputctrl.cpp16
-rwxr-xr-xindra/newview/lllogchat.cpp489
-rwxr-xr-xindra/newview/lllogchat.h65
-rwxr-xr-xindra/newview/llloginhandler.cpp27
-rwxr-xr-xindra/newview/lllogininstance.cpp36
-rwxr-xr-xindra/newview/llmainlooprepeater.cpp2
-rwxr-xr-xindra/newview/llmanip.cpp59
-rwxr-xr-xindra/newview/llmanip.h2
-rwxr-xr-xindra/newview/llmaniprotate.cpp65
-rwxr-xr-xindra/newview/llmanipscale.cpp812
-rwxr-xr-xindra/newview/llmanipscale.h53
-rwxr-xr-xindra/newview/llmaniptranslate.cpp60
-rwxr-xr-xindra/newview/llmaniptranslate.h2
-rwxr-xr-xindra/newview/llmarketplacefunctions.cpp92
-rwxr-xr-x[-rw-r--r--]indra/newview/llmaterialmgr.cpp17
-rwxr-xr-xindra/newview/llmediactrl.cpp44
-rwxr-xr-xindra/newview/llmediactrl.h9
-rwxr-xr-xindra/newview/llmediadataclient.cpp52
-rwxr-xr-xindra/newview/llmediadataclient.h29
-rwxr-xr-xindra/newview/llmeshrepository.cpp411
-rwxr-xr-xindra/newview/llmimetypes.cpp4
-rwxr-xr-xindra/newview/llmoveview.cpp8
-rwxr-xr-xindra/newview/llmutelist.cpp28
-rwxr-xr-xindra/newview/llnamelistctrl.cpp70
-rwxr-xr-xindra/newview/llnamelistctrl.h26
-rwxr-xr-xindra/newview/llnavigationbar.cpp4
-rwxr-xr-xindra/newview/llnetmap.cpp2
-rwxr-xr-xindra/newview/llnotificationhandlerutil.cpp6
-rwxr-xr-xindra/newview/llnotificationstorage.cpp24
-rwxr-xr-xindra/newview/llnotificationstorage.h4
-rwxr-xr-xindra/newview/lloutfitslist.cpp4
-rwxr-xr-xindra/newview/llpanelavatar.cpp3
-rwxr-xr-xindra/newview/llpanelblockedlist.cpp2
-rwxr-xr-xindra/newview/llpanelclassified.cpp29
-rwxr-xr-xindra/newview/llpanelcontents.cpp18
-rwxr-xr-xindra/newview/llpanelcontents.h2
-rwxr-xr-xindra/newview/llpaneleditwearable.cpp103
-rwxr-xr-xindra/newview/llpanelface.cpp151
-rwxr-xr-xindra/newview/llpanelface.h2
-rwxr-xr-xindra/newview/llpanelgroup.cpp30
-rw-r--r--indra/newview/llpanelgroupbulk.cpp421
-rw-r--r--indra/newview/llpanelgroupbulk.h74
-rw-r--r--indra/newview/llpanelgroupbulkban.cpp259
-rw-r--r--indra/newview/llpanelgroupbulkban.h49
-rw-r--r--indra/newview/llpanelgroupbulkimpl.h99
-rwxr-xr-xindra/newview/llpanelgroupgeneral.cpp8
-rwxr-xr-xindra/newview/llpanelgroupinvite.cpp7
-rwxr-xr-xindra/newview/llpanelgrouplandmoney.cpp101
-rwxr-xr-xindra/newview/llpanelgrouplandmoney.h5
-rwxr-xr-xindra/newview/llpanelgroupnotices.cpp16
-rwxr-xr-xindra/newview/llpanelgrouproles.cpp926
-rwxr-xr-xindra/newview/llpanelgrouproles.h70
-rwxr-xr-xindra/newview/llpanelland.cpp4
-rwxr-xr-xindra/newview/llpanellandmarkinfo.cpp10
-rwxr-xr-xindra/newview/llpanellandmarks.cpp22
-rwxr-xr-xindra/newview/llpanellandmarks.h4
-rwxr-xr-xindra/newview/llpanellogin.cpp404
-rwxr-xr-xindra/newview/llpanellogin.h27
-rwxr-xr-xindra/newview/llpanelmaininventory.cpp55
-rwxr-xr-xindra/newview/llpanelmarketplaceinboxinventory.cpp14
-rwxr-xr-xindra/newview/llpanelme.cpp1
-rwxr-xr-xindra/newview/llpanelnearbymedia.cpp11
-rwxr-xr-xindra/newview/llpanelnearbymedia.h2
-rwxr-xr-xindra/newview/llpanelobject.cpp22
-rwxr-xr-xindra/newview/llpanelobjectinventory.cpp109
-rwxr-xr-xindra/newview/llpanelobjectinventory.h4
-rwxr-xr-xindra/newview/llpaneloutfitedit.cpp26
-rwxr-xr-xindra/newview/llpaneloutfitedit.h2
-rwxr-xr-xindra/newview/llpaneloutfitsinventory.cpp19
-rwxr-xr-xindra/newview/llpanelpeople.cpp36
-rwxr-xr-xindra/newview/llpanelpeople.h3
-rwxr-xr-xindra/newview/llpanelpeoplemenus.cpp15
-rwxr-xr-xindra/newview/llpanelpeoplemenus.h1
-rwxr-xr-xindra/newview/llpanelpermissions.cpp13
-rwxr-xr-xindra/newview/llpanelpick.h2
-rwxr-xr-xindra/newview/llpanelpicks.cpp15
-rwxr-xr-xindra/newview/llpanelplaceinfo.cpp6
-rwxr-xr-xindra/newview/llpanelplaceinfo.h2
-rwxr-xr-xindra/newview/llpanelplaceprofile.cpp14
-rwxr-xr-xindra/newview/llpanelplaceprofile.h5
-rwxr-xr-xindra/newview/llpanelplaces.cpp25
-rwxr-xr-xindra/newview/llpanelplaces.h4
-rwxr-xr-xindra/newview/llpanelprimmediacontrols.cpp4
-rwxr-xr-xindra/newview/llpanelprofile.cpp13
-rwxr-xr-xindra/newview/llpanelsnapshot.cpp21
-rwxr-xr-xindra/newview/llpanelsnapshot.h1
-rwxr-xr-xindra/newview/llpanelsnapshotinventory.cpp13
-rwxr-xr-xindra/newview/llpanelsnapshotoptions.cpp56
-rwxr-xr-xindra/newview/llpanelsnapshotpostcard.cpp26
-rwxr-xr-xindra/newview/llpanelteleporthistory.cpp88
-rwxr-xr-xindra/newview/llpanelteleporthistory.h2
-rwxr-xr-xindra/newview/llpaneltopinfobar.cpp4
-rwxr-xr-xindra/newview/llpaneltopinfobar.h2
-rwxr-xr-xindra/newview/llpanelvoicedevicesettings.cpp2
-rwxr-xr-xindra/newview/llpanelvoicedevicesettings.h2
-rwxr-xr-xindra/newview/llpanelvoiceeffect.cpp1
-rwxr-xr-xindra/newview/llpanelvolume.cpp4
-rwxr-xr-xindra/newview/llpanelvolumepulldown.cpp2
-rwxr-xr-xindra/newview/llpanelvolumepulldown.h2
-rwxr-xr-xindra/newview/llpanelwearing.cpp2
-rwxr-xr-xindra/newview/llpatchvertexarray.cpp2
-rwxr-xr-xindra/newview/llpathfindingmanager.cpp182
-rwxr-xr-xindra/newview/llpathfindingnavmesh.cpp10
-rwxr-xr-xindra/newview/llpathfindingnavmesh.h2
-rwxr-xr-xindra/newview/llpersistentnotificationstorage.cpp23
-rwxr-xr-xindra/newview/llphysicsmotion.cpp10
-rwxr-xr-xindra/newview/llphysicsshapebuilderutil.h2
-rwxr-xr-xindra/newview/llplacesfolderview.cpp13
-rwxr-xr-xindra/newview/llplacesfolderview.h2
-rwxr-xr-xindra/newview/llplacesinventorybridge.cpp2
-rwxr-xr-xindra/newview/llpostcard.cpp18
-rwxr-xr-xindra/newview/llpreview.cpp14
-rwxr-xr-xindra/newview/llpreviewgesture.cpp30
-rwxr-xr-xindra/newview/llpreviewgesture.h2
-rwxr-xr-xindra/newview/llpreviewnotecard.cpp39
-rwxr-xr-xindra/newview/llpreviewscript.cpp215
-rwxr-xr-xindra/newview/llpreviewscript.h26
-rwxr-xr-xindra/newview/llpreviewsound.cpp5
-rwxr-xr-xindra/newview/llpreviewtexture.cpp68
-rwxr-xr-xindra/newview/llpreviewtexture.h2
-rwxr-xr-xindra/newview/llproductinforequest.cpp20
-rwxr-xr-xindra/newview/llregioninfomodel.cpp6
-rwxr-xr-xindra/newview/llremoteparcelrequest.cpp17
-rwxr-xr-xindra/newview/llremoteparcelrequest.h12
-rw-r--r--indra/newview/llscenemonitor.cpp774
-rw-r--r--indra/newview/llscenemonitor.h125
-rwxr-xr-xindra/newview/llsceneview.cpp6
-rwxr-xr-xindra/newview/llsceneview.h3
-rwxr-xr-xindra/newview/llscreenchannel.cpp28
-rw-r--r--indra/newview/llscripteditor.cpp289
-rw-r--r--indra/newview/llscripteditor.h70
-rwxr-xr-xindra/newview/llscriptfloater.cpp16
-rwxr-xr-xindra/newview/llscrollingpanelparam.cpp6
-rwxr-xr-xindra/newview/llscrollingpanelparambase.cpp2
-rwxr-xr-xindra/newview/llsecapi.h2
-rwxr-xr-xindra/newview/llsechandler_basic.cpp6
-rwxr-xr-xindra/newview/llselectmgr.cpp85
-rwxr-xr-xindra/newview/llselectmgr.h27
-rwxr-xr-xindra/newview/llsidepanelappearance.cpp10
-rwxr-xr-xindra/newview/llsidepanelappearance.h4
-rwxr-xr-xindra/newview/llsidepanelinventory.cpp20
-rwxr-xr-xindra/newview/llsidepaneliteminfo.cpp12
-rwxr-xr-xindra/newview/llsidepaneltaskinfo.cpp13
-rwxr-xr-xindra/newview/llsidepaneltaskinfo.h2
-rwxr-xr-xindra/newview/llsimplestat.h152
-rw-r--r--indra/newview/llsnapshotlivepreview.cpp748
-rw-r--r--indra/newview/llsnapshotlivepreview.h44
-rwxr-xr-xindra/newview/llspatialpartition.cpp1490
-rwxr-xr-xindra/newview/llspatialpartition.h217
-rwxr-xr-xindra/newview/llspeakers.cpp37
-rwxr-xr-xindra/newview/llspeakingindicatormanager.cpp2
-rwxr-xr-xindra/newview/llsrv.cpp2
-rwxr-xr-xindra/newview/llstartup.cpp190
-rwxr-xr-xindra/newview/llstartup.h12
-rwxr-xr-xindra/newview/llstatusbar.cpp38
-rwxr-xr-xindra/newview/llsurface.cpp22
-rwxr-xr-xindra/newview/llsurface.h1
-rwxr-xr-xindra/newview/llsurfacepatch.cpp9
-rw-r--r--indra/newview/llsyntaxid.cpp329
-rw-r--r--indra/newview/llsyntaxid.h73
-rwxr-xr-xindra/newview/llsyswellwindow.cpp14
-rwxr-xr-xindra/newview/llteleporthistory.cpp10
-rwxr-xr-xindra/newview/llteleporthistorystorage.cpp12
-rwxr-xr-xindra/newview/lltextureatlas.cpp6
-rwxr-xr-xindra/newview/lltexturecache.cpp78
-rwxr-xr-xindra/newview/lltexturecache.h6
-rwxr-xr-xindra/newview/lltexturectrl.cpp20
-rwxr-xr-xindra/newview/lltexturectrl.h4
-rwxr-xr-x[-rw-r--r--]indra/newview/lltexturefetch.cpp727
-rwxr-xr-xindra/newview/lltexturefetch.h25
-rwxr-xr-xindra/newview/lltextureinfo.cpp90
-rwxr-xr-xindra/newview/lltextureinfo.h32
-rwxr-xr-xindra/newview/lltextureinfodetails.cpp4
-rwxr-xr-xindra/newview/lltextureinfodetails.h14
-rwxr-xr-xindra/newview/lltexturestats.cpp5
-rwxr-xr-xindra/newview/lltexturestatsuploader.cpp12
-rwxr-xr-xindra/newview/lltexturestatsuploader.h4
-rwxr-xr-xindra/newview/lltextureview.cpp76
-rwxr-xr-xindra/newview/lltoast.cpp4
-rwxr-xr-xindra/newview/lltoastalertpanel.cpp10
-rwxr-xr-xindra/newview/lltoastgroupnotifypanel.cpp2
-rwxr-xr-xindra/newview/lltoastgroupnotifypanel.h1
-rwxr-xr-xindra/newview/lltoastimpanel.cpp7
-rwxr-xr-xindra/newview/lltoastnotifypanel.cpp11
-rwxr-xr-xindra/newview/lltoastnotifypanel.h2
-rwxr-xr-xindra/newview/lltoastscripttextbox.cpp2
-rwxr-xr-xindra/newview/lltool.cpp26
-rwxr-xr-xindra/newview/lltoolbarview.cpp22
-rwxr-xr-xindra/newview/lltoolbrush.cpp63
-rwxr-xr-xindra/newview/lltoolbrush.h8
-rwxr-xr-xindra/newview/lltoolcomp.cpp89
-rwxr-xr-xindra/newview/lltoolcomp.h14
-rwxr-xr-xindra/newview/lltooldraganddrop.cpp229
-rwxr-xr-xindra/newview/lltooldraganddrop.h3
-rwxr-xr-xindra/newview/lltoolfocus.cpp20
-rwxr-xr-xindra/newview/lltoolfocus.h1
-rwxr-xr-xindra/newview/lltoolgrab.cpp57
-rwxr-xr-xindra/newview/lltoolgrab.h3
-rwxr-xr-xindra/newview/lltoolgun.cpp4
-rwxr-xr-xindra/newview/lltoolmgr.cpp18
-rwxr-xr-xindra/newview/lltoolmorph.cpp22
-rwxr-xr-xindra/newview/lltoolobjpicker.cpp4
-rwxr-xr-xindra/newview/lltoolpie.cpp51
-rwxr-xr-xindra/newview/lltoolplacer.cpp8
-rwxr-xr-xindra/newview/lltoolselect.cpp17
-rwxr-xr-xindra/newview/lltoolselectland.cpp8
-rwxr-xr-xindra/newview/lltoolselectrect.cpp5
-rwxr-xr-xindra/newview/lltoolview.cpp2
-rwxr-xr-xindra/newview/lltracker.cpp85
-rwxr-xr-xindra/newview/lltracker.h5
-rwxr-xr-xindra/newview/lltranslate.cpp20
-rwxr-xr-xindra/newview/lltranslate.h7
-rw-r--r--indra/newview/lltwitterconnect.cpp503
-rw-r--r--indra/newview/lltwitterconnect.h99
-rwxr-xr-xindra/newview/lluploadfloaterobservers.cpp20
-rwxr-xr-xindra/newview/lluploadfloaterobservers.h19
-rwxr-xr-xindra/newview/llurl.cpp14
-rwxr-xr-xindra/newview/llurldispatcher.cpp47
-rwxr-xr-xindra/newview/llurlhistory.cpp10
-rwxr-xr-xindra/newview/llurlwhitelist.cpp2
-rwxr-xr-xindra/newview/llviewerassetstats.cpp818
-rwxr-xr-xindra/newview/llviewerassetstats.h234
-rwxr-xr-xindra/newview/llviewerassetstorage.cpp36
-rwxr-xr-xindra/newview/llviewerassetstorage.h4
-rwxr-xr-xindra/newview/llviewerassettype.h1
-rwxr-xr-xindra/newview/llvieweraudio.cpp83
-rwxr-xr-xindra/newview/llviewercamera.cpp16
-rwxr-xr-xindra/newview/llviewercamera.h18
-rwxr-xr-xindra/newview/llviewerchat.cpp2
-rwxr-xr-xindra/newview/llviewercontrol.cpp15
-rwxr-xr-xindra/newview/llviewerdisplay.cpp141
-rwxr-xr-xindra/newview/llviewerdisplayname.cpp22
-rwxr-xr-xindra/newview/llviewerfloaterreg.cpp50
-rw-r--r--indra/newview/llviewerfoldertype.cpp20
-rwxr-xr-xindra/newview/llviewergenericmessage.cpp6
-rwxr-xr-xindra/newview/llviewergesture.cpp4
-rwxr-xr-xindra/newview/llviewergesture.h1
-rwxr-xr-xindra/newview/llviewerinventory.cpp865
-rwxr-xr-xindra/newview/llviewerinventory.h90
-rwxr-xr-xindra/newview/llviewerjointattachment.cpp8
-rwxr-xr-xindra/newview/llviewerjointmesh.cpp15
-rwxr-xr-xindra/newview/llviewerjoystick.cpp22
-rwxr-xr-xindra/newview/llviewerkeyboard.cpp40
-rwxr-xr-xindra/newview/llviewermedia.cpp302
-rwxr-xr-xindra/newview/llviewermedia.h5
-rwxr-xr-xindra/newview/llviewermedia_streamingaudio.cpp14
-rwxr-xr-xindra/newview/llviewermediafocus.cpp28
-rwxr-xr-xindra/newview/llviewermenu.cpp219
-rwxr-xr-xindra/newview/llviewermenufile.cpp116
-rwxr-xr-xindra/newview/llviewermenufile.h2
-rwxr-xr-xindra/newview/llviewermessage.cpp528
-rwxr-xr-xindra/newview/llviewermessage.h1
-rwxr-xr-xindra/newview/llviewernetwork.cpp4
-rwxr-xr-xindra/newview/llviewerobject.cpp561
-rwxr-xr-xindra/newview/llviewerobject.h62
-rwxr-xr-xindra/newview/llviewerobjectlist.cpp487
-rwxr-xr-xindra/newview/llviewerobjectlist.h26
-rw-r--r--indra/newview/llvieweroctree.cpp1560
-rw-r--r--indra/newview/llvieweroctree.h420
-rwxr-xr-xindra/newview/llviewerparcelmedia.cpp6
-rwxr-xr-xindra/newview/llviewerparcelmgr.cpp81
-rwxr-xr-xindra/newview/llviewerparcelmgr.h4
-rwxr-xr-xindra/newview/llviewerparceloverlay.cpp91
-rwxr-xr-xindra/newview/llviewerparceloverlay.h7
-rwxr-xr-xindra/newview/llviewerpartsim.cpp42
-rwxr-xr-xindra/newview/llviewerpartsim.h4
-rwxr-xr-xindra/newview/llviewerpartsource.cpp4
-rwxr-xr-xindra/newview/llviewerprecompiledheaders.h12
-rwxr-xr-xindra/newview/llviewerregion.cpp1580
-rwxr-xr-xindra/newview/llviewerregion.h137
-rwxr-xr-xindra/newview/llviewershadermgr.cpp59
-rwxr-xr-xindra/newview/llviewershadermgr.h5
-rwxr-xr-xindra/newview/llviewerstats.cpp662
-rwxr-xr-xindra/newview/llviewerstats.h396
-rwxr-xr-xindra/newview/llviewerstatsrecorder.cpp16
-rwxr-xr-xindra/newview/llviewertexlayer.cpp408
-rwxr-xr-x[-rw-r--r--]indra/newview/llviewertexlayer.h47
-rwxr-xr-xindra/newview/llviewertexteditor.cpp18
-rwxr-xr-xindra/newview/llviewertexteditor.h2
-rwxr-xr-xindra/newview/llviewertexture.cpp1729
-rwxr-xr-xindra/newview/llviewertexture.h69
-rwxr-xr-xindra/newview/llviewertexturelist.cpp356
-rwxr-xr-xindra/newview/llviewertexturelist.h40
-rwxr-xr-xindra/newview/llviewerthrottle.cpp15
-rwxr-xr-x[-rw-r--r--]indra/newview/llviewerwearable.cpp67
-rwxr-xr-x[-rw-r--r--]indra/newview/llviewerwearable.h13
-rwxr-xr-xindra/newview/llviewerwindow.cpp269
-rwxr-xr-xindra/newview/llviewerwindow.h7
-rwxr-xr-xindra/newview/llvlcomposition.cpp13
-rwxr-xr-xindra/newview/llvlmanager.cpp42
-rwxr-xr-xindra/newview/llvlmanager.h19
-rwxr-xr-xindra/newview/llvoavatar.cpp908
-rwxr-xr-xindra/newview/llvoavatar.h69
-rwxr-xr-xindra/newview/llvoavatarself.cpp629
-rwxr-xr-xindra/newview/llvoavatarself.h47
-rwxr-xr-xindra/newview/llvocache.cpp980
-rwxr-xr-xindra/newview/llvocache.h187
-rwxr-xr-xindra/newview/llvograss.cpp41
-rwxr-xr-xindra/newview/llvograss.h1
-rwxr-xr-xindra/newview/llvoicechannel.cpp29
-rwxr-xr-xindra/newview/llvoiceclient.cpp10
-rwxr-xr-xindra/newview/llvoiceclient.h1
-rwxr-xr-xindra/newview/llvoicevisualizer.cpp6
-rwxr-xr-xindra/newview/llvoicevivox.cpp58
-rwxr-xr-xindra/newview/llvoicevivox.h2
-rwxr-xr-xindra/newview/llvoinventorylistener.h4
-rwxr-xr-xindra/newview/llvopartgroup.cpp38
-rwxr-xr-xindra/newview/llvosky.cpp12
-rwxr-xr-xindra/newview/llvosurfacepatch.cpp16
-rwxr-xr-xindra/newview/llvosurfacepatch.h2
-rwxr-xr-xindra/newview/llvotree.cpp26
-rwxr-xr-xindra/newview/llvotree.h1
-rwxr-xr-xindra/newview/llvotreenew.h218
-rwxr-xr-xindra/newview/llvovolume.cpp444
-rwxr-xr-xindra/newview/llvowater.cpp11
-rwxr-xr-xindra/newview/llvowlsky.cpp16
-rwxr-xr-xindra/newview/llwatchdog.cpp5
-rwxr-xr-xindra/newview/llwaterparammanager.cpp12
-rwxr-xr-xindra/newview/llwearableitemslist.cpp18
-rwxr-xr-xindra/newview/llwearableitemslist.h2
-rwxr-xr-xindra/newview/llwearablelist.cpp6
-rwxr-xr-xindra/newview/llweb.cpp23
-rwxr-xr-xindra/newview/llweb.h8
-rwxr-xr-xindra/newview/llwebprofile.cpp66
-rwxr-xr-xindra/newview/llwebsharing.cpp603
-rwxr-xr-xindra/newview/llwebsharing.h224
-rwxr-xr-xindra/newview/llwind.h2
-rwxr-xr-xindra/newview/llwindebug.cpp20
-rwxr-xr-xindra/newview/llwindebug.h2
-rwxr-xr-xindra/newview/llwldaycycle.cpp30
-rwxr-xr-xindra/newview/llwlhandlers.cpp27
-rwxr-xr-xindra/newview/llwlhandlers.h14
-rwxr-xr-xindra/newview/llwlparammanager.cpp26
-rwxr-xr-xindra/newview/llwlparamset.cpp4
-rwxr-xr-xindra/newview/llworld.cpp202
-rwxr-xr-xindra/newview/llworld.h10
-rwxr-xr-xindra/newview/llworldmap.h12
-rwxr-xr-xindra/newview/llworldmapmessage.cpp2
-rwxr-xr-xindra/newview/llworldmapmessage.h2
-rwxr-xr-xindra/newview/llworldmapview.cpp8
-rwxr-xr-xindra/newview/llxmlrpctransaction.cpp24
-rwxr-xr-xindra/newview/pipeline.cpp781
-rwxr-xr-xindra/newview/pipeline.h68
-rw-r--r--indra/newview/roles_constants.h194
-rwxr-xr-xindra/newview/skins/default/colors.xml44
-rwxr-xr-xindra/newview/skins/default/textures/bottomtray/ChatBarHandle.pngbin2808 -> 260 bytes
-rwxr-xr-xindra/newview/skins/default/textures/bottomtray/Move_Fly_Off.pngbin3347 -> 609 bytes
-rwxr-xr-xindra/newview/skins/default/textures/bottomtray/Notices_Unread.pngbin3693 -> 436 bytes
-rwxr-xr-xindra/newview/skins/default/textures/bottomtray/Snapshot_Off.pngbin3204 -> 549 bytes
-rwxr-xr-xindra/newview/skins/default/textures/down_arrow.pngbin2936 -> 423 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Edit_Wrench.pngbin3000 -> 452 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Generic_Group_Large.pngbin7507 -> 5274 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Generic_Person.pngbin3280 -> 481 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Hierarchy_View_On.pngbin2839 -> 306 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Inv_Link.pngbin2857 -> 317 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Inv_LostClosed.pngbin3033 -> 526 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Inv_LostOpen.pngbin3223 -> 708 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Inv_Mesh.pngbin3263 -> 751 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Inv_SysClosed.pngbin3153 -> 643 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Inv_SysOpen.pngbin3251 -> 734 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Inv_TrashClosed.pngbin2978 -> 465 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Inv_TrashOpen.pngbin2970 -> 457 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Parcel_FlyNo_Dark.pngbin3221 -> 681 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Parcel_FlyNo_Light.pngbin3235 -> 696 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Parcel_Fly_Dark.pngbin3077 -> 474 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Parcel_SeeAVsOff_Dark.pngbin3194 -> 680 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Parcel_SeeAVsOff_Light.pngbin3189 -> 680 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Parcel_SeeAVsOn_Dark.pngbin3011 -> 452 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Parcel_SeeAVsOn_Light.pngbin3011 -> 453 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Person_Check.pngbin3824 -> 925 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Person_Star.pngbin3762 -> 739 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/SL_Logo.pngbin3999 -> 1484 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Shop.pngbin3052 -> 473 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/Web_Profile_Off.pngbin2961 -> 410 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/back_arrow_off.pngbin3775 -> 1261 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/back_arrow_over.pngbin3792 -> 1277 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/back_arrow_press.pngbin3844 -> 1329 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/check_mark.pngbin3166 -> 650 bytes
-rwxr-xr-xindra/newview/skins/default/textures/icons/pop_up_caution.pngbin3158 -> 642 bytes
-rwxr-xr-xindra/newview/skins/default/textures/menu_separator.pngbin2831 -> 304 bytes
-rwxr-xr-xindra/newview/skins/default/textures/model_wizard/progress_bar_bg.pngbin3180 -> 556 bytes
-rwxr-xr-xindra/newview/skins/default/textures/model_wizard/progress_light.pngbin2979 -> 464 bytes
-rwxr-xr-xindra/newview/skins/default/textures/navbar/Search.pngbin3182 -> 516 bytes
-rwxr-xr-xindra/newview/skins/default/textures/navbar/separator.pngbin2826 -> 330 bytes
-rwxr-xr-xindra/newview/skins/default/textures/taskpanel/Sidebar_Icon_Dock_Foreground.pngbin2899 -> 355 bytes
-rwxr-xr-xindra/newview/skins/default/textures/taskpanel/Sidebar_Icon_Dock_Press.pngbin2886 -> 339 bytes
-rwxr-xr-xindra/newview/skins/default/textures/taskpanel/Sidebar_Icon_Undock_Foreground.pngbin2896 -> 341 bytes
-rwxr-xr-xindra/newview/skins/default/textures/taskpanel/Sidebar_Icon_Undock_Press.pngbin2920 -> 344 bytes
-rwxr-xr-xindra/newview/skins/default/textures/textures.xml24
-rw-r--r--indra/newview/skins/default/textures/toolbar_icons/facebook.pngbin2974 -> 424 bytes
-rw-r--r--indra/newview/skins/default/textures/toolbar_icons/flickr.pngbin0 -> 15530 bytes
-rwxr-xr-xindra/newview/skins/default/textures/toolbar_icons/mini_cart.pngbin2987 -> 474 bytes
-rw-r--r--indra/newview/skins/default/textures/toolbar_icons/twitter.pngbin0 -> 16051 bytes
-rwxr-xr-xindra/newview/skins/default/textures/up_arrow.pngbin2930 -> 426 bytes
-rwxr-xr-xindra/newview/skins/default/textures/widgets/Arrow_Down.pngbin3066 -> 467 bytes
-rwxr-xr-xindra/newview/skins/default/textures/widgets/BreadCrumbBtn_Left_Disabled.pngbin3576 -> 801 bytes
-rwxr-xr-xindra/newview/skins/default/textures/widgets/BreadCrumbBtn_Left_Off.pngbin4309 -> 1873 bytes
-rwxr-xr-xindra/newview/skins/default/textures/widgets/BreadCrumbBtn_Left_Over.pngbin4272 -> 1828 bytes
-rwxr-xr-xindra/newview/skins/default/textures/widgets/BreadCrumbBtn_Left_Press.pngbin4278 -> 1851 bytes
-rwxr-xr-xindra/newview/skins/default/textures/widgets/BreadCrumbBtn_Middle_Disabled.pngbin3425 -> 746 bytes
-rwxr-xr-xindra/newview/skins/default/textures/widgets/BreadCrumbBtn_Middle_Off.pngbin4151 -> 1726 bytes
-rwxr-xr-xindra/newview/skins/default/textures/widgets/BreadCrumbBtn_Middle_Over.pngbin4137 -> 1696 bytes
-rwxr-xr-xindra/newview/skins/default/textures/widgets/BreadCrumbBtn_Middle_Press.pngbin4200 -> 1767 bytes
-rwxr-xr-xindra/newview/skins/default/textures/widgets/BreadCrumbBtn_Right_Disabled.pngbin3169 -> 538 bytes
-rwxr-xr-xindra/newview/skins/default/textures/widgets/BreadCrumbBtn_Right_Off.pngbin3845 -> 1388 bytes
-rwxr-xr-xindra/newview/skins/default/textures/widgets/BreadCrumbBtn_Right_Over.pngbin3867 -> 1410 bytes
-rwxr-xr-xindra/newview/skins/default/textures/widgets/BreadCrumbBtn_Right_Press.pngbin3915 -> 1477 bytes
-rw-r--r--indra/newview/skins/default/textures/widgets/PushButton_Login.pngbin0 -> 1485 bytes
-rw-r--r--indra/newview/skins/default/textures/widgets/PushButton_Login_Over.pngbin0 -> 1568 bytes
-rw-r--r--indra/newview/skins/default/textures/widgets/PushButton_Login_Pressed.pngbin0 -> 1569 bytes
-rwxr-xr-xindra/newview/skins/default/textures/widgets/Tooltip.pngbin2910 -> 402 bytes
-rw-r--r--indra/newview/skins/default/textures/widgets/horizontal_drag_handle.pngbin197 -> 217 bytes
-rw-r--r--indra/newview/skins/default/textures/widgets/vertical_drag_handle.pngbin196 -> 238 bytes
-rwxr-xr-xindra/newview/skins/default/textures/windows/Icon_Close_Foreground.pngbin2871 -> 352 bytes
-rwxr-xr-xindra/newview/skins/default/textures/windows/Icon_Help_Foreground.pngbin3084 -> 451 bytes
-rwxr-xr-xindra/newview/skins/default/textures/windows/Icon_Help_Press.pngbin3062 -> 451 bytes
-rwxr-xr-xindra/newview/skins/default/textures/windows/Icon_Minimize_Foreground.pngbin2839 -> 301 bytes
-rwxr-xr-xindra/newview/skins/default/textures/windows/Icon_Minimize_Press.pngbin2839 -> 301 bytes
-rwxr-xr-xindra/newview/skins/default/textures/windows/Icon_Restore_Foreground.pngbin2955 -> 446 bytes
-rwxr-xr-xindra/newview/skins/default/textures/windows/Icon_Restore_Press.pngbin2971 -> 406 bytes
-rw-r--r--indra/newview/skins/default/textures/windows/first_login_image_left.pngbin0 -> 311306 bytes
-rw-r--r--indra/newview/skins/default/textures/windows/first_login_image_right.pngbin0 -> 329170 bytes
-rwxr-xr-xindra/newview/skins/default/textures/windows/hint_arrow_down.pngbin3170 -> 573 bytes
-rwxr-xr-xindra/newview/skins/default/textures/windows/hint_arrow_left.pngbin3059 -> 482 bytes
-rwxr-xr-xindra/newview/skins/default/textures/windows/hint_arrow_lower_left.pngbin3081 -> 490 bytes
-rwxr-xr-xindra/newview/skins/default/textures/windows/hint_arrow_right.pngbin3112 -> 513 bytes
-rwxr-xr-xindra/newview/skins/default/textures/windows/hint_arrow_up.pngbin3219 -> 587 bytes
-rwxr-xr-xindra/newview/skins/default/textures/windows/hint_background.pngbin4316 -> 1532 bytes
-rw-r--r--indra/newview/skins/default/textures/windows/login_sl_logo.pngbin0 -> 21797 bytes
-rw-r--r--indra/newview/skins/default/textures/windows/login_sl_logo_small.pngbin0 -> 5978 bytes
-rwxr-xr-xindra/newview/skins/default/textures/windows/yellow_gradient.pngbin3634 -> 1125 bytes
-rwxr-xr-xindra/newview/skins/default/textures/world/CameraDragDot.pngbin3101 -> 563 bytes
-rwxr-xr-xindra/newview/skins/default/textures/world/NoEntryLines.pngbin3523 -> 1265 bytes
-rw-r--r--[-rwxr-xr-x]indra/newview/skins/default/xui/da/floater_lagmeter.xml0
-rwxr-xr-xindra/newview/skins/default/xui/da/panel_preferences_privacy.xml2
-rwxr-xr-xindra/newview/skins/default/xui/da/sidepanel_inventory.xml2
-rwxr-xr-xindra/newview/skins/default/xui/da/strings.xml3
-rw-r--r--indra/newview/skins/default/xui/de/floater_big_preview.xml2
-rw-r--r--indra/newview/skins/default/xui/de/floater_facebook.xml20
-rw-r--r--indra/newview/skins/default/xui/de/floater_flickr.xml17
-rw-r--r--[-rwxr-xr-x]indra/newview/skins/default/xui/de/floater_lagmeter.xml0
-rw-r--r--indra/newview/skins/default/xui/de/floater_perms_default.xml6
-rw-r--r--indra/newview/skins/default/xui/de/floater_region_restarting.xml23
-rwxr-xr-xindra/newview/skins/default/xui/de/floater_report_abuse.xml10
-rw-r--r--indra/newview/skins/default/xui/de/floater_scene_load_stats.xml64
-rw-r--r--indra/newview/skins/default/xui/de/floater_script_ed_prefs.xml48
-rwxr-xr-xindra/newview/skins/default/xui/de/floater_snapshot.xml17
-rwxr-xr-xindra/newview/skins/default/xui/de/floater_stats.xml47
-rwxr-xr-xindra/newview/skins/default/xui/de/floater_tools.xml2
-rw-r--r--indra/newview/skins/default/xui/de/floater_twitter.xml17
-rwxr-xr-xindra/newview/skins/default/xui/de/menu_avatar_icon.xml1
-rw-r--r--indra/newview/skins/default/xui/de/menu_conversation.xml1
-rwxr-xr-xindra/newview/skins/default/xui/de/menu_inventory.xml1
-rwxr-xr-xindra/newview/skins/default/xui/de/menu_login.xml10
-rwxr-xr-xindra/newview/skins/default/xui/de/menu_object.xml1
-rwxr-xr-xindra/newview/skins/default/xui/de/menu_teleport_history_item.xml2
-rwxr-xr-xindra/newview/skins/default/xui/de/menu_viewer.xml26
-rwxr-xr-xindra/newview/skins/default/xui/de/notifications.xml75
-rw-r--r--indra/newview/skins/default/xui/de/panel_facebook_account.xml15
-rw-r--r--indra/newview/skins/default/xui/de/panel_facebook_friends.xml12
-rw-r--r--indra/newview/skins/default/xui/de/panel_facebook_photo.xml26
-rw-r--r--indra/newview/skins/default/xui/de/panel_facebook_place.xml17
-rw-r--r--indra/newview/skins/default/xui/de/panel_facebook_status.xml14
-rw-r--r--indra/newview/skins/default/xui/de/panel_flickr_account.xml15
-rw-r--r--indra/newview/skins/default/xui/de/panel_flickr_photo.xml41
-rw-r--r--indra/newview/skins/default/xui/de/panel_group_bulk_ban.xml43
-rwxr-xr-xindra/newview/skins/default/xui/de/panel_group_info_sidetray.xml2
-rwxr-xr-xindra/newview/skins/default/xui/de/panel_group_invite.xml2
-rwxr-xr-xindra/newview/skins/default/xui/de/panel_group_roles.xml25
-rwxr-xr-xindra/newview/skins/default/xui/de/panel_login.xml51
-rw-r--r--indra/newview/skins/default/xui/de/panel_login_first.xml33
-rwxr-xr-xindra/newview/skins/default/xui/de/panel_postcard_message.xml4
-rwxr-xr-xindra/newview/skins/default/xui/de/panel_postcard_settings.xml19
-rwxr-xr-xindra/newview/skins/default/xui/de/panel_preferences_advanced.xml1
-rwxr-xr-xindra/newview/skins/default/xui/de/panel_preferences_general.xml10
-rwxr-xr-xindra/newview/skins/default/xui/de/panel_preferences_privacy.xml4
-rwxr-xr-xindra/newview/skins/default/xui/de/panel_region_debug.xml9
-rwxr-xr-xindra/newview/skins/default/xui/de/panel_region_general.xml2
-rwxr-xr-xindra/newview/skins/default/xui/de/panel_script_ed.xml5
-rwxr-xr-xindra/newview/skins/default/xui/de/panel_snapshot_inventory.xml5
-rwxr-xr-xindra/newview/skins/default/xui/de/panel_snapshot_local.xml31
-rwxr-xr-xindra/newview/skins/default/xui/de/panel_snapshot_options.xml17
-rwxr-xr-xindra/newview/skins/default/xui/de/panel_snapshot_postcard.xml8
-rwxr-xr-xindra/newview/skins/default/xui/de/panel_snapshot_profile.xml31
-rwxr-xr-xindra/newview/skins/default/xui/de/panel_teleport_history_item.xml1
-rw-r--r--indra/newview/skins/default/xui/de/panel_twitter_account.xml15
-rw-r--r--indra/newview/skins/default/xui/de/panel_twitter_photo.xml32
-rwxr-xr-xindra/newview/skins/default/xui/de/role_actions.xml1
-rwxr-xr-xindra/newview/skins/default/xui/de/sidepanel_inventory.xml6
-rwxr-xr-xindra/newview/skins/default/xui/de/strings.xml165
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_about.xml2
-rw-r--r--indra/newview/skins/default/xui/en/floater_big_preview.xml25
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_buy_object.xml4
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_conversation_preview.xml1
-rw-r--r--indra/newview/skins/default/xui/en/floater_facebook.xml96
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_fast_timers.xml69
-rw-r--r--indra/newview/skins/default/xui/en/floater_flickr.xml (renamed from indra/newview/skins/default/xui/en/floater_social.xml)56
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_im_session.xml4
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_inventory_view_finder.xml96
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_joystick.xml11
-rw-r--r--[-rwxr-xr-x]indra/newview/skins/default/xui/en/floater_lagmeter.xml0
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_model_preview.xml8
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_openobject.xml16
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_perm_prefs.xml108
-rw-r--r--indra/newview/skins/default/xui/en/floater_perms_default.xml503
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_places.xml2
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_preview_texture.xml24
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_region_debug_console.xml1
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_report_abuse.xml128
-rw-r--r--indra/newview/skins/default/xui/en/floater_scene_load_stats.xml446
-rw-r--r--indra/newview/skins/default/xui/en/floater_script_ed_prefs.xml359
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_snapshot.xml458
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_stats.xml1262
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_tools.xml20
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_top_objects.xml14
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_toybox.xml1
-rw-r--r--indra/newview/skins/default/xui/en/floater_twitter.xml76
-rwxr-xr-xindra/newview/skins/default/xui/en/main_view.xml1
-rwxr-xr-xindra/newview/skins/default/xui/en/menu_conversation.xml9
-rwxr-xr-xindra/newview/skins/default/xui/en/menu_inventory_add.xml7
-rwxr-xr-xindra/newview/skins/default/xui/en/menu_inventory_gear_default.xml2
-rwxr-xr-xindra/newview/skins/default/xui/en/menu_login.xml68
-rwxr-xr-xindra/newview/skins/default/xui/en/menu_object.xml19
-rwxr-xr-xindra/newview/skins/default/xui/en/menu_viewer.xml159
-rwxr-xr-xindra/newview/skins/default/xui/en/mime_types.xml21
-rwxr-xr-xindra/newview/skins/default/xui/en/mime_types_linux.xml21
-rwxr-xr-xindra/newview/skins/default/xui/en/mime_types_mac.xml21
-rwxr-xr-xindra/newview/skins/default/xui/en/notifications.xml180
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_bottomtray_lite.xml1
-rw-r--r--indra/newview/skins/default/xui/en/panel_facebook_friends.xml73
-rw-r--r--indra/newview/skins/default/xui/en/panel_facebook_photo.xml (renamed from indra/newview/skins/default/xui/en/panel_social_photo.xml)152
-rw-r--r--indra/newview/skins/default/xui/en/panel_facebook_place.xml (renamed from indra/newview/skins/default/xui/en/panel_social_place.xml)127
-rw-r--r--indra/newview/skins/default/xui/en/panel_facebook_status.xml130
-rw-r--r--indra/newview/skins/default/xui/en/panel_flickr_account.xml (renamed from indra/newview/skins/default/xui/en/panel_social_account.xml)38
-rw-r--r--indra/newview/skins/default/xui/en/panel_flickr_photo.xml258
-rw-r--r--indra/newview/skins/default/xui/en/panel_group_bulk_ban.xml108
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_group_invite.xml4
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_group_roles.xml946
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_login.xml457
-rw-r--r--indra/newview/skins/default/xui/en/panel_login_first.xml265
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_main_inventory.xml2
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml1
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_outfit_edit.xml963
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_people.xml2
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_place_profile.xml22
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_places.xml3
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_postcard_message.xml59
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_postcard_settings.xml156
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_preferences_advanced.xml11
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_preferences_general.xml63
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_preferences_privacy.xml13
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_preferences_setup.xml44
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_region_debug.xml10
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_region_general.xml27
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_script_ed.xml30
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_snapshot_inventory.xml83
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_snapshot_local.xml242
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_snapshot_options.xml123
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_snapshot_postcard.xml88
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_snapshot_profile.xml206
-rw-r--r--indra/newview/skins/default/xui/en/panel_social_status.xml67
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_teleport_history_item.xml15
-rw-r--r--indra/newview/skins/default/xui/en/panel_tools_texture.xml3
-rw-r--r--indra/newview/skins/default/xui/en/panel_twitter_account.xml81
-rw-r--r--indra/newview/skins/default/xui/en/panel_twitter_photo.xml195
-rwxr-xr-xindra/newview/skins/default/xui/en/role_actions.xml5
-rw-r--r--indra/newview/skins/default/xui/en/script_editor.xml11
-rwxr-xr-xindra/newview/skins/default/xui/en/sidepanel_inventory.xml105
-rwxr-xr-xindra/newview/skins/default/xui/en/strings.xml61
-rwxr-xr-xindra/newview/skins/default/xui/en/teleport_strings.xml5
-rwxr-xr-xindra/newview/skins/default/xui/en/widgets/avatar_icon.xml12
-rwxr-xr-xindra/newview/skins/default/xui/en/widgets/combo_box.xml2
-rwxr-xr-xindra/newview/skins/default/xui/en/widgets/floater.xml1
-rw-r--r--indra/newview/skins/default/xui/es/floater_big_preview.xml2
-rw-r--r--indra/newview/skins/default/xui/es/floater_facebook.xml20
-rw-r--r--indra/newview/skins/default/xui/es/floater_flickr.xml17
-rw-r--r--[-rwxr-xr-x]indra/newview/skins/default/xui/es/floater_lagmeter.xml0
-rw-r--r--indra/newview/skins/default/xui/es/floater_perms_default.xml6
-rw-r--r--indra/newview/skins/default/xui/es/floater_region_restarting.xml23
-rwxr-xr-xindra/newview/skins/default/xui/es/floater_report_abuse.xml12
-rw-r--r--indra/newview/skins/default/xui/es/floater_scene_load_stats.xml64
-rw-r--r--indra/newview/skins/default/xui/es/floater_script_ed_prefs.xml48
-rwxr-xr-xindra/newview/skins/default/xui/es/floater_snapshot.xml8
-rwxr-xr-xindra/newview/skins/default/xui/es/floater_stats.xml46
-rwxr-xr-xindra/newview/skins/default/xui/es/floater_tools.xml2
-rw-r--r--indra/newview/skins/default/xui/es/floater_twitter.xml17
-rwxr-xr-xindra/newview/skins/default/xui/es/menu_avatar_icon.xml1
-rw-r--r--indra/newview/skins/default/xui/es/menu_conversation.xml1
-rwxr-xr-xindra/newview/skins/default/xui/es/menu_inventory.xml1
-rwxr-xr-xindra/newview/skins/default/xui/es/menu_login.xml10
-rwxr-xr-xindra/newview/skins/default/xui/es/menu_object.xml1
-rwxr-xr-xindra/newview/skins/default/xui/es/menu_teleport_history_item.xml2
-rwxr-xr-xindra/newview/skins/default/xui/es/menu_viewer.xml26
-rwxr-xr-xindra/newview/skins/default/xui/es/notifications.xml77
-rw-r--r--indra/newview/skins/default/xui/es/panel_facebook_account.xml15
-rw-r--r--indra/newview/skins/default/xui/es/panel_facebook_friends.xml12
-rw-r--r--indra/newview/skins/default/xui/es/panel_facebook_photo.xml26
-rw-r--r--indra/newview/skins/default/xui/es/panel_facebook_place.xml17
-rw-r--r--indra/newview/skins/default/xui/es/panel_facebook_status.xml14
-rw-r--r--indra/newview/skins/default/xui/es/panel_flickr_account.xml15
-rw-r--r--indra/newview/skins/default/xui/es/panel_flickr_photo.xml41
-rw-r--r--indra/newview/skins/default/xui/es/panel_group_bulk_ban.xml43
-rwxr-xr-xindra/newview/skins/default/xui/es/panel_group_info_sidetray.xml2
-rwxr-xr-xindra/newview/skins/default/xui/es/panel_group_invite.xml2
-rwxr-xr-xindra/newview/skins/default/xui/es/panel_group_roles.xml26
-rwxr-xr-xindra/newview/skins/default/xui/es/panel_login.xml51
-rw-r--r--indra/newview/skins/default/xui/es/panel_login_first.xml33
-rwxr-xr-xindra/newview/skins/default/xui/es/panel_preferences_advanced.xml1
-rwxr-xr-xindra/newview/skins/default/xui/es/panel_preferences_general.xml10
-rwxr-xr-xindra/newview/skins/default/xui/es/panel_preferences_privacy.xml4
-rwxr-xr-xindra/newview/skins/default/xui/es/panel_region_debug.xml9
-rwxr-xr-xindra/newview/skins/default/xui/es/panel_region_general.xml2
-rwxr-xr-xindra/newview/skins/default/xui/es/panel_script_ed.xml5
-rwxr-xr-xindra/newview/skins/default/xui/es/panel_snapshot_options.xml9
-rwxr-xr-xindra/newview/skins/default/xui/es/panel_teleport_history_item.xml1
-rw-r--r--indra/newview/skins/default/xui/es/panel_twitter_account.xml15
-rw-r--r--indra/newview/skins/default/xui/es/panel_twitter_photo.xml32
-rwxr-xr-xindra/newview/skins/default/xui/es/role_actions.xml1
-rwxr-xr-xindra/newview/skins/default/xui/es/sidepanel_inventory.xml8
-rwxr-xr-xindra/newview/skins/default/xui/es/strings.xml165
-rw-r--r--indra/newview/skins/default/xui/fr/floater_big_preview.xml2
-rw-r--r--indra/newview/skins/default/xui/fr/floater_facebook.xml20
-rw-r--r--indra/newview/skins/default/xui/fr/floater_flickr.xml17
-rw-r--r--[-rwxr-xr-x]indra/newview/skins/default/xui/fr/floater_lagmeter.xml0
-rw-r--r--indra/newview/skins/default/xui/fr/floater_perms_default.xml6
-rw-r--r--indra/newview/skins/default/xui/fr/floater_region_restarting.xml23
-rwxr-xr-xindra/newview/skins/default/xui/fr/floater_report_abuse.xml12
-rw-r--r--indra/newview/skins/default/xui/fr/floater_scene_load_stats.xml64
-rw-r--r--indra/newview/skins/default/xui/fr/floater_script_ed_prefs.xml48
-rwxr-xr-xindra/newview/skins/default/xui/fr/floater_snapshot.xml8
-rwxr-xr-xindra/newview/skins/default/xui/fr/floater_stats.xml43
-rwxr-xr-xindra/newview/skins/default/xui/fr/floater_tools.xml2
-rw-r--r--indra/newview/skins/default/xui/fr/floater_twitter.xml17
-rwxr-xr-xindra/newview/skins/default/xui/fr/menu_avatar_icon.xml1
-rw-r--r--indra/newview/skins/default/xui/fr/menu_conversation.xml1
-rwxr-xr-xindra/newview/skins/default/xui/fr/menu_inventory.xml1
-rwxr-xr-xindra/newview/skins/default/xui/fr/menu_login.xml10
-rwxr-xr-xindra/newview/skins/default/xui/fr/menu_object.xml1
-rwxr-xr-xindra/newview/skins/default/xui/fr/menu_teleport_history_item.xml2
-rwxr-xr-xindra/newview/skins/default/xui/fr/menu_viewer.xml26
-rwxr-xr-xindra/newview/skins/default/xui/fr/notifications.xml75
-rw-r--r--indra/newview/skins/default/xui/fr/panel_facebook_account.xml15
-rw-r--r--indra/newview/skins/default/xui/fr/panel_facebook_friends.xml12
-rw-r--r--indra/newview/skins/default/xui/fr/panel_facebook_photo.xml26
-rw-r--r--indra/newview/skins/default/xui/fr/panel_facebook_place.xml17
-rw-r--r--indra/newview/skins/default/xui/fr/panel_facebook_status.xml14
-rw-r--r--indra/newview/skins/default/xui/fr/panel_flickr_account.xml15
-rw-r--r--indra/newview/skins/default/xui/fr/panel_flickr_photo.xml41
-rw-r--r--indra/newview/skins/default/xui/fr/panel_group_bulk_ban.xml43
-rwxr-xr-xindra/newview/skins/default/xui/fr/panel_group_info_sidetray.xml2
-rwxr-xr-xindra/newview/skins/default/xui/fr/panel_group_invite.xml2
-rwxr-xr-xindra/newview/skins/default/xui/fr/panel_group_roles.xml26
-rwxr-xr-xindra/newview/skins/default/xui/fr/panel_login.xml51
-rw-r--r--indra/newview/skins/default/xui/fr/panel_login_first.xml33
-rwxr-xr-xindra/newview/skins/default/xui/fr/panel_preferences_advanced.xml1
-rwxr-xr-xindra/newview/skins/default/xui/fr/panel_preferences_general.xml10
-rwxr-xr-xindra/newview/skins/default/xui/fr/panel_preferences_privacy.xml6
-rwxr-xr-xindra/newview/skins/default/xui/fr/panel_region_debug.xml9
-rwxr-xr-xindra/newview/skins/default/xui/fr/panel_region_general.xml2
-rwxr-xr-xindra/newview/skins/default/xui/fr/panel_script_ed.xml5
-rwxr-xr-xindra/newview/skins/default/xui/fr/panel_snapshot_options.xml9
-rwxr-xr-xindra/newview/skins/default/xui/fr/panel_teleport_history_item.xml1
-rw-r--r--indra/newview/skins/default/xui/fr/panel_twitter_account.xml15
-rw-r--r--indra/newview/skins/default/xui/fr/panel_twitter_photo.xml32
-rwxr-xr-xindra/newview/skins/default/xui/fr/role_actions.xml1
-rwxr-xr-xindra/newview/skins/default/xui/fr/sidepanel_inventory.xml8
-rwxr-xr-xindra/newview/skins/default/xui/fr/strings.xml165
-rw-r--r--indra/newview/skins/default/xui/it/floater_big_preview.xml2
-rw-r--r--indra/newview/skins/default/xui/it/floater_facebook.xml20
-rw-r--r--indra/newview/skins/default/xui/it/floater_flickr.xml17
-rw-r--r--[-rwxr-xr-x]indra/newview/skins/default/xui/it/floater_lagmeter.xml0
-rw-r--r--indra/newview/skins/default/xui/it/floater_perms_default.xml6
-rw-r--r--indra/newview/skins/default/xui/it/floater_region_restarting.xml23
-rwxr-xr-xindra/newview/skins/default/xui/it/floater_report_abuse.xml12
-rw-r--r--indra/newview/skins/default/xui/it/floater_scene_load_stats.xml64
-rw-r--r--indra/newview/skins/default/xui/it/floater_script_ed_prefs.xml48
-rwxr-xr-xindra/newview/skins/default/xui/it/floater_snapshot.xml8
-rwxr-xr-xindra/newview/skins/default/xui/it/floater_stats.xml46
-rwxr-xr-xindra/newview/skins/default/xui/it/floater_tools.xml2
-rw-r--r--indra/newview/skins/default/xui/it/floater_twitter.xml17
-rwxr-xr-xindra/newview/skins/default/xui/it/menu_avatar_icon.xml1
-rw-r--r--indra/newview/skins/default/xui/it/menu_conversation.xml1
-rwxr-xr-xindra/newview/skins/default/xui/it/menu_inventory.xml1
-rwxr-xr-xindra/newview/skins/default/xui/it/menu_login.xml10
-rwxr-xr-xindra/newview/skins/default/xui/it/menu_object.xml1
-rwxr-xr-xindra/newview/skins/default/xui/it/menu_teleport_history_item.xml2
-rwxr-xr-xindra/newview/skins/default/xui/it/menu_viewer.xml26
-rwxr-xr-xindra/newview/skins/default/xui/it/notifications.xml77
-rw-r--r--indra/newview/skins/default/xui/it/panel_facebook_account.xml15
-rw-r--r--indra/newview/skins/default/xui/it/panel_facebook_friends.xml12
-rw-r--r--indra/newview/skins/default/xui/it/panel_facebook_photo.xml26
-rw-r--r--indra/newview/skins/default/xui/it/panel_facebook_place.xml17
-rw-r--r--indra/newview/skins/default/xui/it/panel_facebook_status.xml14
-rw-r--r--indra/newview/skins/default/xui/it/panel_flickr_account.xml15
-rw-r--r--indra/newview/skins/default/xui/it/panel_flickr_photo.xml41
-rw-r--r--indra/newview/skins/default/xui/it/panel_group_bulk_ban.xml43
-rwxr-xr-xindra/newview/skins/default/xui/it/panel_group_info_sidetray.xml2
-rwxr-xr-xindra/newview/skins/default/xui/it/panel_group_invite.xml2
-rwxr-xr-xindra/newview/skins/default/xui/it/panel_group_roles.xml27
-rwxr-xr-xindra/newview/skins/default/xui/it/panel_login.xml51
-rw-r--r--indra/newview/skins/default/xui/it/panel_login_first.xml33
-rwxr-xr-xindra/newview/skins/default/xui/it/panel_preferences_advanced.xml1
-rwxr-xr-xindra/newview/skins/default/xui/it/panel_preferences_general.xml10
-rwxr-xr-xindra/newview/skins/default/xui/it/panel_preferences_privacy.xml2
-rwxr-xr-xindra/newview/skins/default/xui/it/panel_region_debug.xml9
-rwxr-xr-xindra/newview/skins/default/xui/it/panel_region_general.xml2
-rwxr-xr-xindra/newview/skins/default/xui/it/panel_script_ed.xml5
-rwxr-xr-xindra/newview/skins/default/xui/it/panel_snapshot_options.xml9
-rwxr-xr-xindra/newview/skins/default/xui/it/panel_teleport_history_item.xml1
-rw-r--r--indra/newview/skins/default/xui/it/panel_twitter_account.xml15
-rw-r--r--indra/newview/skins/default/xui/it/panel_twitter_photo.xml32
-rwxr-xr-xindra/newview/skins/default/xui/it/role_actions.xml1
-rwxr-xr-xindra/newview/skins/default/xui/it/sidepanel_inventory.xml4
-rwxr-xr-xindra/newview/skins/default/xui/it/strings.xml165
-rw-r--r--indra/newview/skins/default/xui/ja/floater_big_preview.xml2
-rw-r--r--indra/newview/skins/default/xui/ja/floater_facebook.xml20
-rw-r--r--indra/newview/skins/default/xui/ja/floater_flickr.xml17
-rw-r--r--[-rwxr-xr-x]indra/newview/skins/default/xui/ja/floater_lagmeter.xml0
-rw-r--r--indra/newview/skins/default/xui/ja/floater_perms_default.xml6
-rw-r--r--indra/newview/skins/default/xui/ja/floater_region_restarting.xml23
-rwxr-xr-xindra/newview/skins/default/xui/ja/floater_report_abuse.xml12
-rw-r--r--indra/newview/skins/default/xui/ja/floater_scene_load_stats.xml64
-rw-r--r--indra/newview/skins/default/xui/ja/floater_script_ed_prefs.xml48
-rwxr-xr-xindra/newview/skins/default/xui/ja/floater_snapshot.xml8
-rwxr-xr-xindra/newview/skins/default/xui/ja/floater_stats.xml47
-rwxr-xr-xindra/newview/skins/default/xui/ja/floater_tools.xml2
-rw-r--r--indra/newview/skins/default/xui/ja/floater_twitter.xml17
-rwxr-xr-xindra/newview/skins/default/xui/ja/menu_avatar_icon.xml1
-rw-r--r--indra/newview/skins/default/xui/ja/menu_conversation.xml1
-rwxr-xr-xindra/newview/skins/default/xui/ja/menu_inventory.xml1
-rwxr-xr-xindra/newview/skins/default/xui/ja/menu_login.xml10
-rwxr-xr-xindra/newview/skins/default/xui/ja/menu_object.xml1
-rwxr-xr-xindra/newview/skins/default/xui/ja/menu_teleport_history_item.xml2
-rwxr-xr-xindra/newview/skins/default/xui/ja/menu_viewer.xml26
-rwxr-xr-xindra/newview/skins/default/xui/ja/notifications.xml73
-rw-r--r--indra/newview/skins/default/xui/ja/panel_facebook_account.xml15
-rw-r--r--indra/newview/skins/default/xui/ja/panel_facebook_friends.xml12
-rw-r--r--indra/newview/skins/default/xui/ja/panel_facebook_photo.xml26
-rw-r--r--indra/newview/skins/default/xui/ja/panel_facebook_place.xml17
-rw-r--r--indra/newview/skins/default/xui/ja/panel_facebook_status.xml14
-rw-r--r--indra/newview/skins/default/xui/ja/panel_flickr_account.xml15
-rw-r--r--indra/newview/skins/default/xui/ja/panel_flickr_photo.xml41
-rw-r--r--indra/newview/skins/default/xui/ja/panel_group_bulk_ban.xml41
-rwxr-xr-xindra/newview/skins/default/xui/ja/panel_group_info_sidetray.xml4
-rwxr-xr-xindra/newview/skins/default/xui/ja/panel_group_invite.xml2
-rwxr-xr-xindra/newview/skins/default/xui/ja/panel_group_roles.xml25
-rwxr-xr-xindra/newview/skins/default/xui/ja/panel_login.xml51
-rw-r--r--indra/newview/skins/default/xui/ja/panel_login_first.xml33
-rwxr-xr-xindra/newview/skins/default/xui/ja/panel_preferences_advanced.xml1
-rwxr-xr-xindra/newview/skins/default/xui/ja/panel_preferences_general.xml10
-rwxr-xr-xindra/newview/skins/default/xui/ja/panel_preferences_privacy.xml2
-rwxr-xr-xindra/newview/skins/default/xui/ja/panel_region_debug.xml9
-rwxr-xr-xindra/newview/skins/default/xui/ja/panel_region_general.xml2
-rwxr-xr-xindra/newview/skins/default/xui/ja/panel_script_ed.xml5
-rwxr-xr-xindra/newview/skins/default/xui/ja/panel_snapshot_options.xml11
-rwxr-xr-xindra/newview/skins/default/xui/ja/panel_teleport_history_item.xml1
-rw-r--r--indra/newview/skins/default/xui/ja/panel_twitter_account.xml15
-rw-r--r--indra/newview/skins/default/xui/ja/panel_twitter_photo.xml32
-rwxr-xr-xindra/newview/skins/default/xui/ja/role_actions.xml1
-rwxr-xr-xindra/newview/skins/default/xui/ja/sidepanel_inventory.xml8
-rwxr-xr-xindra/newview/skins/default/xui/ja/strings.xml164
-rw-r--r--[-rwxr-xr-x]indra/newview/skins/default/xui/pl/floater_lagmeter.xml0
-rwxr-xr-xindra/newview/skins/default/xui/pl/panel_preferences_privacy.xml2
-rwxr-xr-xindra/newview/skins/default/xui/pl/sidepanel_inventory.xml2
-rwxr-xr-xindra/newview/skins/default/xui/pl/strings.xml1
-rw-r--r--indra/newview/skins/default/xui/pt/floater_big_preview.xml2
-rw-r--r--indra/newview/skins/default/xui/pt/floater_facebook.xml20
-rw-r--r--indra/newview/skins/default/xui/pt/floater_flickr.xml17
-rw-r--r--[-rwxr-xr-x]indra/newview/skins/default/xui/pt/floater_lagmeter.xml0
-rw-r--r--indra/newview/skins/default/xui/pt/floater_perms_default.xml6
-rw-r--r--indra/newview/skins/default/xui/pt/floater_region_restarting.xml23
-rwxr-xr-xindra/newview/skins/default/xui/pt/floater_report_abuse.xml12
-rw-r--r--indra/newview/skins/default/xui/pt/floater_scene_load_stats.xml64
-rw-r--r--indra/newview/skins/default/xui/pt/floater_script_ed_prefs.xml48
-rwxr-xr-xindra/newview/skins/default/xui/pt/floater_snapshot.xml8
-rwxr-xr-xindra/newview/skins/default/xui/pt/floater_stats.xml46
-rwxr-xr-xindra/newview/skins/default/xui/pt/floater_tools.xml2
-rw-r--r--indra/newview/skins/default/xui/pt/floater_twitter.xml17
-rwxr-xr-xindra/newview/skins/default/xui/pt/menu_avatar_icon.xml1
-rw-r--r--indra/newview/skins/default/xui/pt/menu_conversation.xml1
-rwxr-xr-xindra/newview/skins/default/xui/pt/menu_inventory.xml1
-rwxr-xr-xindra/newview/skins/default/xui/pt/menu_login.xml10
-rwxr-xr-xindra/newview/skins/default/xui/pt/menu_object.xml1
-rwxr-xr-xindra/newview/skins/default/xui/pt/menu_teleport_history_item.xml2
-rwxr-xr-xindra/newview/skins/default/xui/pt/menu_viewer.xml26
-rwxr-xr-xindra/newview/skins/default/xui/pt/notifications.xml85
-rw-r--r--indra/newview/skins/default/xui/pt/panel_facebook_account.xml15
-rw-r--r--indra/newview/skins/default/xui/pt/panel_facebook_friends.xml12
-rw-r--r--indra/newview/skins/default/xui/pt/panel_facebook_photo.xml26
-rw-r--r--indra/newview/skins/default/xui/pt/panel_facebook_place.xml17
-rw-r--r--indra/newview/skins/default/xui/pt/panel_facebook_status.xml14
-rw-r--r--indra/newview/skins/default/xui/pt/panel_flickr_account.xml15
-rw-r--r--indra/newview/skins/default/xui/pt/panel_flickr_photo.xml41
-rw-r--r--indra/newview/skins/default/xui/pt/panel_group_bulk_ban.xml43
-rwxr-xr-xindra/newview/skins/default/xui/pt/panel_group_info_sidetray.xml2
-rwxr-xr-xindra/newview/skins/default/xui/pt/panel_group_invite.xml2
-rwxr-xr-xindra/newview/skins/default/xui/pt/panel_group_roles.xml30
-rwxr-xr-xindra/newview/skins/default/xui/pt/panel_login.xml51
-rw-r--r--indra/newview/skins/default/xui/pt/panel_login_first.xml33
-rwxr-xr-xindra/newview/skins/default/xui/pt/panel_preferences_advanced.xml1
-rwxr-xr-xindra/newview/skins/default/xui/pt/panel_preferences_general.xml10
-rwxr-xr-xindra/newview/skins/default/xui/pt/panel_preferences_privacy.xml2
-rwxr-xr-xindra/newview/skins/default/xui/pt/panel_region_debug.xml9
-rwxr-xr-xindra/newview/skins/default/xui/pt/panel_region_general.xml2
-rwxr-xr-xindra/newview/skins/default/xui/pt/panel_script_ed.xml5
-rwxr-xr-xindra/newview/skins/default/xui/pt/panel_snapshot_options.xml9
-rwxr-xr-xindra/newview/skins/default/xui/pt/panel_teleport_history_item.xml1
-rw-r--r--indra/newview/skins/default/xui/pt/panel_twitter_account.xml15
-rw-r--r--indra/newview/skins/default/xui/pt/panel_twitter_photo.xml32
-rwxr-xr-xindra/newview/skins/default/xui/pt/role_actions.xml1
-rwxr-xr-xindra/newview/skins/default/xui/pt/sidepanel_inventory.xml4
-rwxr-xr-xindra/newview/skins/default/xui/pt/strings.xml165
-rw-r--r--indra/newview/skins/default/xui/ru/floater_big_preview.xml2
-rw-r--r--indra/newview/skins/default/xui/ru/floater_facebook.xml20
-rw-r--r--indra/newview/skins/default/xui/ru/floater_flickr.xml17
-rw-r--r--[-rwxr-xr-x]indra/newview/skins/default/xui/ru/floater_lagmeter.xml0
-rw-r--r--indra/newview/skins/default/xui/ru/floater_perms_default.xml6
-rw-r--r--indra/newview/skins/default/xui/ru/floater_region_restarting.xml23
-rwxr-xr-xindra/newview/skins/default/xui/ru/floater_report_abuse.xml12
-rw-r--r--indra/newview/skins/default/xui/ru/floater_scene_load_stats.xml64
-rw-r--r--indra/newview/skins/default/xui/ru/floater_script_ed_prefs.xml48
-rwxr-xr-xindra/newview/skins/default/xui/ru/floater_snapshot.xml8
-rwxr-xr-xindra/newview/skins/default/xui/ru/floater_stats.xml43
-rwxr-xr-xindra/newview/skins/default/xui/ru/floater_tools.xml81
-rw-r--r--indra/newview/skins/default/xui/ru/floater_twitter.xml17
-rwxr-xr-xindra/newview/skins/default/xui/ru/menu_avatar_icon.xml1
-rw-r--r--indra/newview/skins/default/xui/ru/menu_conversation.xml1
-rwxr-xr-xindra/newview/skins/default/xui/ru/menu_inventory.xml1
-rwxr-xr-xindra/newview/skins/default/xui/ru/menu_login.xml10
-rwxr-xr-xindra/newview/skins/default/xui/ru/menu_object.xml1
-rwxr-xr-xindra/newview/skins/default/xui/ru/menu_teleport_history_item.xml2
-rwxr-xr-xindra/newview/skins/default/xui/ru/menu_viewer.xml25
-rwxr-xr-xindra/newview/skins/default/xui/ru/notifications.xml71
-rw-r--r--indra/newview/skins/default/xui/ru/panel_facebook_account.xml15
-rw-r--r--indra/newview/skins/default/xui/ru/panel_facebook_friends.xml12
-rw-r--r--indra/newview/skins/default/xui/ru/panel_facebook_photo.xml26
-rw-r--r--indra/newview/skins/default/xui/ru/panel_facebook_place.xml17
-rw-r--r--indra/newview/skins/default/xui/ru/panel_facebook_status.xml14
-rw-r--r--indra/newview/skins/default/xui/ru/panel_flickr_account.xml15
-rw-r--r--indra/newview/skins/default/xui/ru/panel_flickr_photo.xml40
-rw-r--r--indra/newview/skins/default/xui/ru/panel_group_bulk_ban.xml41
-rwxr-xr-xindra/newview/skins/default/xui/ru/panel_group_info_sidetray.xml2
-rwxr-xr-xindra/newview/skins/default/xui/ru/panel_group_invite.xml2
-rwxr-xr-xindra/newview/skins/default/xui/ru/panel_group_roles.xml25
-rwxr-xr-xindra/newview/skins/default/xui/ru/panel_login.xml51
-rw-r--r--indra/newview/skins/default/xui/ru/panel_login_first.xml33
-rwxr-xr-xindra/newview/skins/default/xui/ru/panel_preferences_advanced.xml1
-rwxr-xr-xindra/newview/skins/default/xui/ru/panel_preferences_general.xml10
-rwxr-xr-xindra/newview/skins/default/xui/ru/panel_preferences_privacy.xml2
-rwxr-xr-xindra/newview/skins/default/xui/ru/panel_region_debug.xml3
-rwxr-xr-xindra/newview/skins/default/xui/ru/panel_region_general.xml2
-rwxr-xr-xindra/newview/skins/default/xui/ru/panel_script_ed.xml5
-rwxr-xr-xindra/newview/skins/default/xui/ru/panel_snapshot_options.xml9
-rwxr-xr-xindra/newview/skins/default/xui/ru/panel_teleport_history_item.xml1
-rw-r--r--indra/newview/skins/default/xui/ru/panel_twitter_account.xml15
-rw-r--r--indra/newview/skins/default/xui/ru/panel_twitter_photo.xml32
-rwxr-xr-xindra/newview/skins/default/xui/ru/role_actions.xml1
-rwxr-xr-xindra/newview/skins/default/xui/ru/sidepanel_inventory.xml10
-rwxr-xr-xindra/newview/skins/default/xui/ru/strings.xml165
-rw-r--r--indra/newview/skins/default/xui/tr/floater_big_preview.xml2
-rw-r--r--indra/newview/skins/default/xui/tr/floater_facebook.xml20
-rw-r--r--indra/newview/skins/default/xui/tr/floater_flickr.xml17
-rw-r--r--[-rwxr-xr-x]indra/newview/skins/default/xui/tr/floater_lagmeter.xml0
-rw-r--r--indra/newview/skins/default/xui/tr/floater_perms_default.xml6
-rw-r--r--indra/newview/skins/default/xui/tr/floater_region_restarting.xml23
-rwxr-xr-xindra/newview/skins/default/xui/tr/floater_report_abuse.xml12
-rw-r--r--indra/newview/skins/default/xui/tr/floater_scene_load_stats.xml64
-rw-r--r--indra/newview/skins/default/xui/tr/floater_script_ed_prefs.xml48
-rwxr-xr-xindra/newview/skins/default/xui/tr/floater_snapshot.xml8
-rwxr-xr-xindra/newview/skins/default/xui/tr/floater_stats.xml47
-rwxr-xr-xindra/newview/skins/default/xui/tr/floater_tools.xml81
-rw-r--r--indra/newview/skins/default/xui/tr/floater_twitter.xml17
-rwxr-xr-xindra/newview/skins/default/xui/tr/menu_avatar_icon.xml1
-rw-r--r--indra/newview/skins/default/xui/tr/menu_conversation.xml1
-rwxr-xr-xindra/newview/skins/default/xui/tr/menu_inventory.xml1
-rwxr-xr-xindra/newview/skins/default/xui/tr/menu_login.xml10
-rwxr-xr-xindra/newview/skins/default/xui/tr/menu_object.xml1
-rwxr-xr-xindra/newview/skins/default/xui/tr/menu_teleport_history_item.xml2
-rwxr-xr-xindra/newview/skins/default/xui/tr/menu_viewer.xml26
-rwxr-xr-xindra/newview/skins/default/xui/tr/notifications.xml73
-rw-r--r--indra/newview/skins/default/xui/tr/panel_facebook_account.xml15
-rw-r--r--indra/newview/skins/default/xui/tr/panel_facebook_friends.xml12
-rw-r--r--indra/newview/skins/default/xui/tr/panel_facebook_photo.xml26
-rw-r--r--indra/newview/skins/default/xui/tr/panel_facebook_place.xml17
-rw-r--r--indra/newview/skins/default/xui/tr/panel_facebook_status.xml14
-rw-r--r--indra/newview/skins/default/xui/tr/panel_flickr_account.xml15
-rw-r--r--indra/newview/skins/default/xui/tr/panel_flickr_photo.xml41
-rw-r--r--indra/newview/skins/default/xui/tr/panel_group_bulk_ban.xml43
-rwxr-xr-xindra/newview/skins/default/xui/tr/panel_group_info_sidetray.xml2
-rwxr-xr-xindra/newview/skins/default/xui/tr/panel_group_invite.xml2
-rwxr-xr-xindra/newview/skins/default/xui/tr/panel_group_roles.xml23
-rwxr-xr-xindra/newview/skins/default/xui/tr/panel_login.xml51
-rw-r--r--indra/newview/skins/default/xui/tr/panel_login_first.xml33
-rwxr-xr-xindra/newview/skins/default/xui/tr/panel_preferences_advanced.xml1
-rwxr-xr-xindra/newview/skins/default/xui/tr/panel_preferences_general.xml10
-rwxr-xr-xindra/newview/skins/default/xui/tr/panel_preferences_privacy.xml2
-rwxr-xr-xindra/newview/skins/default/xui/tr/panel_region_debug.xml3
-rwxr-xr-xindra/newview/skins/default/xui/tr/panel_region_general.xml2
-rwxr-xr-xindra/newview/skins/default/xui/tr/panel_script_ed.xml5
-rwxr-xr-xindra/newview/skins/default/xui/tr/panel_snapshot_options.xml9
-rwxr-xr-xindra/newview/skins/default/xui/tr/panel_teleport_history_item.xml1
-rw-r--r--indra/newview/skins/default/xui/tr/panel_twitter_account.xml15
-rw-r--r--indra/newview/skins/default/xui/tr/panel_twitter_photo.xml32
-rwxr-xr-xindra/newview/skins/default/xui/tr/role_actions.xml1
-rwxr-xr-xindra/newview/skins/default/xui/tr/sidepanel_inventory.xml2
-rwxr-xr-xindra/newview/skins/default/xui/tr/strings.xml165
-rw-r--r--indra/newview/skins/default/xui/zh/floater_big_preview.xml2
-rw-r--r--indra/newview/skins/default/xui/zh/floater_facebook.xml20
-rw-r--r--indra/newview/skins/default/xui/zh/floater_flickr.xml17
-rw-r--r--[-rwxr-xr-x]indra/newview/skins/default/xui/zh/floater_lagmeter.xml28
-rw-r--r--indra/newview/skins/default/xui/zh/floater_perms_default.xml6
-rw-r--r--indra/newview/skins/default/xui/zh/floater_region_restarting.xml23
-rwxr-xr-xindra/newview/skins/default/xui/zh/floater_report_abuse.xml12
-rw-r--r--indra/newview/skins/default/xui/zh/floater_scene_load_stats.xml64
-rw-r--r--indra/newview/skins/default/xui/zh/floater_script_ed_prefs.xml48
-rwxr-xr-xindra/newview/skins/default/xui/zh/floater_snapshot.xml8
-rwxr-xr-xindra/newview/skins/default/xui/zh/floater_stats.xml47
-rwxr-xr-xindra/newview/skins/default/xui/zh/floater_tools.xml81
-rw-r--r--indra/newview/skins/default/xui/zh/floater_twitter.xml17
-rwxr-xr-xindra/newview/skins/default/xui/zh/menu_avatar_icon.xml1
-rw-r--r--indra/newview/skins/default/xui/zh/menu_conversation.xml1
-rwxr-xr-xindra/newview/skins/default/xui/zh/menu_inventory.xml1
-rwxr-xr-xindra/newview/skins/default/xui/zh/menu_login.xml10
-rwxr-xr-xindra/newview/skins/default/xui/zh/menu_object.xml1
-rwxr-xr-xindra/newview/skins/default/xui/zh/menu_teleport_history_item.xml2
-rwxr-xr-xindra/newview/skins/default/xui/zh/menu_viewer.xml26
-rwxr-xr-xindra/newview/skins/default/xui/zh/notifications.xml73
-rw-r--r--indra/newview/skins/default/xui/zh/panel_facebook_account.xml15
-rw-r--r--indra/newview/skins/default/xui/zh/panel_facebook_friends.xml12
-rw-r--r--indra/newview/skins/default/xui/zh/panel_facebook_photo.xml26
-rw-r--r--indra/newview/skins/default/xui/zh/panel_facebook_place.xml17
-rw-r--r--indra/newview/skins/default/xui/zh/panel_facebook_status.xml14
-rw-r--r--indra/newview/skins/default/xui/zh/panel_flickr_account.xml15
-rw-r--r--indra/newview/skins/default/xui/zh/panel_flickr_photo.xml41
-rw-r--r--indra/newview/skins/default/xui/zh/panel_group_bulk_ban.xml43
-rwxr-xr-xindra/newview/skins/default/xui/zh/panel_group_info_sidetray.xml2
-rwxr-xr-xindra/newview/skins/default/xui/zh/panel_group_invite.xml2
-rwxr-xr-xindra/newview/skins/default/xui/zh/panel_group_roles.xml28
-rwxr-xr-xindra/newview/skins/default/xui/zh/panel_login.xml51
-rw-r--r--indra/newview/skins/default/xui/zh/panel_login_first.xml33
-rwxr-xr-xindra/newview/skins/default/xui/zh/panel_preferences_advanced.xml1
-rwxr-xr-xindra/newview/skins/default/xui/zh/panel_preferences_general.xml10
-rwxr-xr-xindra/newview/skins/default/xui/zh/panel_preferences_privacy.xml2
-rwxr-xr-xindra/newview/skins/default/xui/zh/panel_region_debug.xml3
-rwxr-xr-xindra/newview/skins/default/xui/zh/panel_region_general.xml2
-rwxr-xr-xindra/newview/skins/default/xui/zh/panel_script_ed.xml5
-rwxr-xr-xindra/newview/skins/default/xui/zh/panel_snapshot_options.xml9
-rwxr-xr-xindra/newview/skins/default/xui/zh/panel_teleport_history_item.xml1
-rw-r--r--indra/newview/skins/default/xui/zh/panel_twitter_account.xml15
-rw-r--r--indra/newview/skins/default/xui/zh/panel_twitter_photo.xml32
-rwxr-xr-xindra/newview/skins/default/xui/zh/role_actions.xml1
-rwxr-xr-xindra/newview/skins/default/xui/zh/sidepanel_inventory.xml8
-rwxr-xr-xindra/newview/skins/default/xui/zh/strings.xml165
-rwxr-xr-xindra/newview/tests/llcapabilitylistener_test.cpp12
-rwxr-xr-xindra/newview/tests/llhttpretrypolicy_test.cpp328
-rwxr-xr-xindra/newview/tests/llmediadataclient_test.cpp8
-rwxr-xr-xindra/newview/tests/llremoteparcelrequest_test.cpp16
-rwxr-xr-xindra/newview/tests/llsimplestat_test.cpp580
-rwxr-xr-xindra/newview/tests/lltexturestatsuploader_test.cpp2
-rwxr-xr-xindra/newview/tests/lltranslate_test.cpp12
-rwxr-xr-xindra/newview/tests/llviewerassetstats_test.cpp686
-rwxr-xr-xindra/newview/tests/llxmlrpclistener_test.cpp8
-rwxr-xr-xindra/newview/viewer_manifest.py109
-rwxr-xr-xindra/test/CMakeLists.txt1
-rwxr-xr-xindra/test/io.cpp63
-rwxr-xr-xindra/test/llassetuploadqueue_tut.cpp4
-rwxr-xr-xindra/test/llblowfish_tut.cpp4
-rwxr-xr-xindra/test/lldatapacker_tut.cpp4
-rwxr-xr-xindra/test/llhttpdate_tut.cpp7
-rwxr-xr-xindra/test/llhttpnode_tut.cpp3
-rwxr-xr-xindra/test/lliohttpserver_tut.cpp9
-rwxr-xr-xindra/test/llmessagetemplateparser_tut.cpp2
-rwxr-xr-xindra/test/llpermissions_tut.cpp4
-rwxr-xr-xindra/test/llpipeutil.cpp4
-rwxr-xr-xindra/test/llsaleinfo_tut.cpp4
-rwxr-xr-xindra/test/llsd_new_tut.cpp55
-rwxr-xr-xindra/test/llsdmessagebuilder_tut.cpp2
-rwxr-xr-xindra/test/llsdtraits.h2
-rwxr-xr-xindra/test/lltemplatemessagebuilder_tut.cpp11
-rwxr-xr-xindra/test/lltut.h10
-rwxr-xr-xindra/test/lluuidhashmap_tut.cpp455
-rwxr-xr-xindra/test/manageapr.h46
-rwxr-xr-xindra/test/message_tut.cpp10
-rwxr-xr-xindra/test/mock_http_client.cpp3
-rwxr-xr-xindra/test/mock_http_client.h23
-rwxr-xr-xindra/test/test.cpp82
-rw-r--r--indra/test_apps/llfbconnecttest/CMakeLists.txt118
-rw-r--r--indra/test_apps/llfbconnecttest/README.Linden20
-rwxr-xr-xindra/test_apps/llplugintest/CMakeLists.txt128
-rw-r--r--indra/test_apps/llplugintest/README.Linden21
-rwxr-xr-xindra/test_apps/llplugintest/llmediaplugintest.cpp10
-rwxr-xr-xindra/viewer_components/login/CMakeLists.txt4
-rwxr-xr-xindra/viewer_components/login/lllogin.cpp2
-rwxr-xr-xindra/viewer_components/updater/llupdatechecker.cpp12
-rwxr-xr-xindra/viewer_components/updater/llupdatechecker.h7
-rw-r--r--indra/win_crash_logger/llcrashloggerwindows.cpp23
-rwxr-xr-xindra/win_crash_logger/win_crash_logger.cpp10
-rwxr-xr-xindra/win_updater/CMakeLists.txt45
-rwxr-xr-xindra/win_updater/updater.cpp516
2086 files changed, 91168 insertions, 56428 deletions
diff --git a/.hgignore b/.hgignore
index a8a244596d..f3fca9bcb2 100755
--- a/.hgignore
+++ b/.hgignore
@@ -75,4 +75,6 @@ glob:indra/newview/filters.xml
glob:indra/newview/avatar_icons_cache.txt
glob:indra/newview/avatar_lad.log
glob:*.diff
-#*.rej
+indra/newview/pilot.txt
+indra/newview/pilot.xml
+*.rej
diff --git a/.hgtags b/.hgtags
index 08f079a3a1..b88fef6ba5 100755
--- a/.hgtags
+++ b/.hgtags
@@ -479,3 +479,14 @@ b842534cb4d76c9ef87676a62b1d2d19e79c015f 3.7.2-release
d076568ff7883b41c149e6afb421f39c29dbfe2b 3.7.4-release
fc066b82343fca51f9c1b8eda0abc6bee9bb4503 3.7.5-release
d029faf69f20a23007f32420a1ac6a3b89a6d441 3.7.6-release
+83959480cb986522d07b151a0c778ab7f920d41b 3.7.7-release
+bba9b3722eea08949e4ff69591f736bf0f808434 3.7.8-release
+a9f2d0cb11f73b06858e6083bb50083becc3f9cd 3.7.9-release
+91dae9494b4d147541c7a01902334ba19a7ec05e 3.7.10-release
+64799eb298834073a3e9992cd8d27c3cb9d30b10 3.7.11-release
+3b44ea8988cb902f0dda8429e8d5e4569e304532 3.7.12-release
+d86a7e1bc96d27b683f951d3701d5b7042158c68 3.7.13-release
+a7872554f3665588f1e8347d472cec3a299254b3 3.7.14-release
+3f11f57f2b4d15a9f987d12bc70ef507eefb5018 3.7.15-release
+562e7dace7465060ac9adb2e8eca800b699ff024 3.7.16-release
+bcc2770e21c125e0bab59141c51db9145aec068d 3.7.17-release
diff --git a/BuildParams b/BuildParams
index 51434a4912..c2fadf5943 100755
--- a/BuildParams
+++ b/BuildParams
@@ -55,21 +55,9 @@ Amazon_viewer_channel_suffix = "Amazon"
Desura_sourceid = "1208_desura"
Desura_viewer_channel_suffix = "Desura"
-# Report changes since...
-viewer-development.show_changes_since = last_sprint
-
-# Build Settings
-viewer-development.build_debug_release_separately = true
-
# Notifications - to configure email notices, add a setting like this:
# <username>_<reponame>.email = <email-address>
-viewer-release.viewer_channel = "Second Life Release"
-viewer-release.build_debug_release_separately = true
-viewer-release.build_viewer_update_version_manager = true
-viewer-release.codeticket_add_context = false
-
-
# ========================================
# mesh-development
# ========================================
@@ -121,25 +109,6 @@ viewer-mesh.viewer_channel = "Project Viewer - Mesh"
viewer-mesh.viewer_grid = aditi
viewer-mesh.email = shining@lists.lindenlab.com
-# ========================================
-# viewer-pathfinding
-# ========================================
-
-viewer-pathfinding.viewer_channel = "Project Viewer - Pathfinding"
-viewer-pathfinding.viewer_grid = agni
-viewer-pathfinding.build_debug_release_separately = true
-viewer-pathfinding.build_CYGWIN_Debug = false
-viewer-pathfinding.build_viewer_update_version_manager = false
-
-# ========================================
-# viewer-materials
-# ========================================
-
-viewer-materials.viewer_channel = "Second Life Beta Materials"
-viewer-materials.build_debug_release_separately = true
-viewer-materials.build_CYGWIN_Debug = false
-viewer-materials.build_viewer_update_version_manager = false
-
# =================================================================
# asset delivery 2010 projects
# =================================================================
@@ -201,8 +170,6 @@ runway.viewer_grid = agni
runway.build_debug_release_separately = true
runway.build_CYGWIN_Debug = false
runway.build_viewer_update_version_manager = false
-
-
# eof
diff --git a/autobuild.xml b/autobuild.xml
index 468a7c6182..b6586b25b7 100755
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -66,9 +66,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>69ae3b1c9cdb0ebc0d0e1ac8413e3eb7</string>
+ <string>8da309d24fb0bad8eaaa667fb04c6dc7</string>
<key>url</key>
- <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/SDL-1.2.14-linux-20110309.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-sdl-update/rev/290561/arch/Linux/installer/SDL-1.2.15-linux-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
@@ -138,9 +138,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>e6caaeea16131e1f2343ecd7765e3147</string>
+ <string>127c6c37726b11a0750cd4d3b920beff</string>
<key>url</key>
- <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/ares-1.7.1-darwin-20110217.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-ares-update/rev/290399/arch/Darwin/installer/ares-1.10.0-darwin-20140529.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@@ -150,9 +150,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>0745872db83d45f4ab3bdc697d98e264</string>
+ <string>92f6a454d90b5740a38fb68e369cc13e</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ares/rev/223275/arch/Linux/installer/ares-1.7.1-linux-20110310.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-ares-update/rev/290399/arch/Linux/installer/ares-1.10.0-linux-20140529.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
@@ -162,9 +162,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>1dcec6babd249a2597114d4ac226c461</string>
+ <string>887c93c4075beefefa44b69fb2c0461e</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-ares/rev/220963/arch/CYGWIN/installer/ares-1.7.1-windows-20110211.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-ares-update/rev/290399/arch/CYGWIN/installer/ares-1.10.0-windows-20140529.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@@ -186,9 +186,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>06dd7af75e1eb179aed54fd58d8688af</string>
+ <string>b57789bd22dd166aade4a35ec5d36fbb</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-boost/rev/270698/arch/Darwin/installer/boost-1.52.0-darwin-20130221.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-boost-update/rev/290566/arch/Darwin/installer/boost-1.55.0-darwin-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@@ -198,9 +198,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>50c8b50b7cced52cc5656fb44e9b12cf</string>
+ <string>2f076eae296600a1b810ce375dc4b42d</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-boost/rev/270698/arch/Linux/installer/boost-1.52.0-linux-20130222.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-boost-update/rev/290566/arch/Linux/installer/boost-1.55.0-linux-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
@@ -210,9 +210,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>742fc9675b033df7f9c6f215ff250f6c</string>
+ <string>8af0500013739866a41cfc2ce90e4f4b</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-boost/rev/270698/arch/CYGWIN/installer/boost-1.52.0-windows-20130221.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-boost-update/rev/290566/arch/CYGWIN/installer/boost-1.55.0-windows-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@@ -234,9 +234,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>480b27a0cb39a4adfcdeabef895de3e1</string>
+ <string>68dc13f49a686331df6f0128c5483da3</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-colladadom/rev/227230/arch/Darwin/installer/colladadom-2.2-darwin-20110420.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-colladadom-update/rev/290576/arch/Darwin/installer/colladadom-2.3-darwin-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@@ -246,9 +246,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>be7321370b69b6d66938b82a9230a067</string>
+ <string>bdec5fe5fd008da4328f84115128ee61</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-colladadom/rev/233450/arch/Linux/installer/colladadom-2.2-linux-20110621.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-colladadom-update/rev/290576/arch/Linux/installer/colladadom-2.3-linux-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
@@ -258,9 +258,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>a9f548eb6f9aaf292508a8b09c7f2f73</string>
+ <string>ae103c9481be20cd6c035940832b2650</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-colladadom/rev/226584/arch/CYGWIN/installer/colladadom-2.2-windows-20110413.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-colladadom-update/rev/290576/arch/CYGWIN/installer/colladadom-2.3-windows-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@@ -282,9 +282,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>f7d9b6a9c624364389b71209881f39de</string>
+ <string>f5a699c93beb1a854d0b51382b5cecc8</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-curl/rev/280289/arch/Darwin/installer/curl-7.24.0-darwin-20130826.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-curl-update/rev/290664/arch/Darwin/installer/curl-7.37.0-darwin-20140605.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@@ -294,9 +294,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>58b7bf45383c1b1bc24afb303b1519c8</string>
+ <string>2bc285edffd0e55e0cd6290f39854a89</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-curl/rev/280289/arch/Linux/installer/curl-7.24.0-linux-20130826.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-curl-update/rev/290664/arch/Linux/installer/curl-7.37.0-linux-20140605.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
@@ -306,9 +306,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>8d9ccb0277a26bfe3f346c3c49ce4b58</string>
+ <string>8d3b197d7a114d2b688d2831a0a59757</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-curl/rev/280289/arch/CYGWIN/installer/curl-7.24.0-windows-20130826.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-curl-update/rev/290664/arch/CYGWIN/installer/curl-7.37.0-windows-20140605.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@@ -546,9 +546,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>d8b08b657247566bde5fd853c7622478</string>
+ <string>2843c48e6c84a51e3d6aa05dace4c8c0</string>
<key>url</key>
- <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/fontconfig-2.8.0-linux-20110311.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-fontconfig-update/rev/290569/arch/Linux/installer/fontconfig-2.11.0-linux-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
@@ -594,9 +594,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>c0eacb6348e032fbc69cfdc4bd215ee4</string>
+ <string>71c8d80de052f0c2a49e4c7ddf1a56a0</string>
<key>url</key>
- <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/freetype-2.4.4-darwin-20110307.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-freetype-update/rev/290557/arch/Darwin/installer/freetype-2.4.4-darwin-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@@ -606,9 +606,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>bd6f84f9fb3c2e68850676d06935373f</string>
+ <string>52f87a65cc61ec4b05721c079d015b19</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-freetype/rev/271684/arch/Linux/installer/freetype-2.4.4-linux-20130312.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-freetype-update/rev/290557/arch/Linux/installer/freetype-2.4.4-linux-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
@@ -618,9 +618,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>271349827b939406162ce42e42cd18e0</string>
+ <string>6e9fc0fe628a7c88f6f614bf3b0450ae</string>
<key>url</key>
- <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/freetype-2.4.4-windows-20110218.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-freetype-update/rev/290557/arch/CYGWIN/installer/freetype-2.4.4-windows-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@@ -747,14 +747,14 @@
</map>
</map>
</map>
- <key>google_breakpad</key>
+ <key>gmock</key>
<map>
<key>license</key>
<string>bsd</string>
<key>license_file</key>
- <string>LICENSES/google_breakpad.txt</string>
+ <string>LICENSES/gmock.txt</string>
<key>name</key>
- <string>google_breakpad</string>
+ <string>gmock</string>
<key>platforms</key>
<map>
<key>darwin</key>
@@ -762,9 +762,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>aff5566e04003de0383941981198e04e</string>
+ <string>36b0ea1a8be38f5749a7b13536b871ab</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-breakpad/rev/273073/arch/Darwin/installer/google_breakpad-0.0.0-rev1099-darwin-20130329.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-google-mock-update/rev/290574/arch/Darwin/installer/gmock-1.7.0-darwin-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@@ -774,9 +774,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>52257e5eb166a0b69c9c0c38f6e1920e</string>
+ <string>3de99704847b34c7acccf5ab87222f6c</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-breakpad/rev/273079/arch/Linux/installer/google_breakpad-0.0.0-rev1099-linux-20130329.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-google-mock-update/rev/290574/arch/Linux/installer/gmock-1.7.0-linux-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
@@ -786,23 +786,23 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>a1e519d08c507c12f9d412b2ae8328c8</string>
+ <string>5d91c1d03780aa26bcd5481145ee9e86</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-breakpad/rev/279804/arch/CYGWIN/installer/google_breakpad-0.0.0-rev1099-windows-20130813.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-google-mock-update/rev/290574/arch/CYGWIN/installer/gmock-1.7.0-windows-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
</map>
</map>
</map>
- <key>googlemock</key>
+ <key>google_breakpad</key>
<map>
<key>license</key>
<string>bsd</string>
<key>license_file</key>
- <string>LICENSES/googlemock.txt</string>
+ <string>LICENSES/google_breakpad.txt</string>
<key>name</key>
- <string>googlemock</string>
+ <string>google_breakpad</string>
<key>platforms</key>
<map>
<key>darwin</key>
@@ -810,9 +810,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>886ee428f058005ab7f90f61784ec9d9</string>
+ <string>aff5566e04003de0383941981198e04e</string>
<key>url</key>
- <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/googlemock-1.1.0-darwin-20101004.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-breakpad/rev/273073/arch/Darwin/installer/google_breakpad-0.0.0-rev1099-darwin-20130329.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@@ -822,9 +822,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>782ca04e56d8eab755adcae297cafa7c</string>
+ <string>52257e5eb166a0b69c9c0c38f6e1920e</string>
<key>url</key>
- <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/googlemock-1.1.0-linux-20101001.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-breakpad/rev/273079/arch/Linux/installer/google_breakpad-0.0.0-rev1099-linux-20130329.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
@@ -834,9 +834,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>d2542614df9dd99cbb5ff67e76d4a6c1</string>
+ <string>a1e519d08c507c12f9d412b2ae8328c8</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-mock/rev/274899/arch/CYGWIN/installer/gmock-1.6.0-windows-20130426.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-google-breakpad/rev/279804/arch/CYGWIN/installer/google_breakpad-0.0.0-rev1099-windows-20130813.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@@ -1194,9 +1194,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>6fe1adf12d98bce9111f60ee762007b9</string>
+ <string>80a84bbbb363e1a38f39bb6be8a3f166</string>
<key>url</key>
- <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libpng-1.5.1-darwin-20110222.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-libpng-update/rev/290558/arch/Darwin/installer/libpng-1.6.8-darwin-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@@ -1206,9 +1206,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>0681ab7e1988dfdbdad7dd9edb7760ee</string>
+ <string>3368a25b361c22a03f7ec7e0f8d5ff9d</string>
<key>url</key>
- <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libpng-1.5.1-linux-20110223.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-libpng-update/rev/290558/arch/Linux/installer/libpng-1.6.8-linux-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
@@ -1218,9 +1218,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>f194ba857ca8dd86483a3ef24535d0db</string>
+ <string>596f4798f90941817b1ca5009c24d16a</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-libpng/rev/226532/arch/CYGWIN/installer/libpng-1.5.1-windows-20110413.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-libpng-update/rev/290558/arch/CYGWIN/installer/libpng-1.6.8-windows-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@@ -1251,28 +1251,52 @@
</map>
</map>
</map>
- <key>libxml</key>
+ <key>libxml2</key>
<map>
<key>license</key>
<string>mit</string>
<key>license_file</key>
- <string>LICENSES/libxml.txt</string>
+ <string>LICENSES/libxml2.txt</string>
<key>name</key>
- <string>libxml</string>
+ <string>libxml2</string>
<key>platforms</key>
<map>
+ <key>darwin</key>
+ <map>
+ <key>archive</key>
+ <map>
+ <key>hash</key>
+ <string>4a5880b8235beb5ca21f1e252a46e342</string>
+ <key>url</key>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-libxml-update/rev/290562/arch/Darwin/installer/libxml2-2.9.1-darwin-20140602.tar.bz2</string>
+ </map>
+ <key>name</key>
+ <string>darwin</string>
+ </map>
<key>linux</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
- <string>6414642528f42dac1cd9a012c99cd748</string>
+ <string>7eb90f075730f8d7d176f8fb7bad5ef5</string>
<key>url</key>
- <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/libxml-2.6.24-linux-20101013.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-libxml-update/rev/290562/arch/Linux/installer/libxml2-2.9.1-linux-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
</map>
+ <key>windows</key>
+ <map>
+ <key>archive</key>
+ <map>
+ <key>hash</key>
+ <string>ba20e2634b4c249a7064620d135f7972</string>
+ <key>url</key>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-libxml-update/rev/290562/arch/CYGWIN/installer/libxml2-2.9.1-windows-20140602.tar.bz2</string>
+ </map>
+ <key>name</key>
+ <string>windows</string>
+ </map>
</map>
</map>
<key>llappearanceutility-source</key>
@@ -1290,9 +1314,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>5bc44db15eb3cca021382e40e04a9a38</string>
+ <string>54e46715e72b7805d9d3f84d45b6b1b7</string>
<key>url</key>
- <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llappearanceutility-source/rev/271972/arch/Linux/installer/llappearanceutility_source-0.1-linux-20130315.tar.bz2</string>
+ <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llappearanceutility-source/rev/290120/arch/Linux/installer/llappearanceutility_source-0.1-linux-20140519.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
@@ -1420,9 +1444,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>4a98d727561cd1f4ac5ee02907411df1</string>
+ <string>79afb464255be2be7c02fdfac10bcd5c</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/250147/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20120228.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-llqtwebkit2/rev/290663/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20140605.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@@ -1432,9 +1456,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>f50e5f0cc880c55b3f0f7e67dc8f7221</string>
+ <string>090190a8dd80efe1f0933c7ed307e6f1</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/250147/arch/Linux/installer/llqtwebkit-4.7.1-linux-20120228.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-llqtwebkit2/rev/290663/arch/Linux/installer/llqtwebkit-4.7.1-linux-20140605.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
@@ -1444,9 +1468,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>5e3cd6af397e853a963a6de40d440ff4</string>
+ <string>650f2a30a83eacde238fcc87ff161190</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/250147/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20120228.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-llqtwebkit2/rev/290663/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20140605.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@@ -1597,36 +1621,26 @@
</map>
</map>
</map>
- <key>openSSL</key>
+ <key>openal_soft</key>
<map>
<key>license</key>
- <string>openSSL</string>
+ <string>lgpl</string>
<key>license_file</key>
- <string>LICENSES/openssl.txt</string>
+ <string>LICENSES/OPENAL.txt</string>
<key>name</key>
- <string>openSSL</string>
+ <string>openal_soft</string>
<key>platforms</key>
<map>
- <key>darwin</key>
- <map>
- <key>archive</key>
- <map>
- <key>hash</key>
- <string>facee34b8bd57ad602157e65a5af1a49</string>
- <key>url</key>
- <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openssl-0.9.8q-darwin-20110211.tar.bz2</string>
- </map>
- <key>name</key>
- <string>darwin</string>
- </map>
<key>linux</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
- <string>3d40be8566fa4b9df9a38e2a0f9ea467</string>
+ <string>fccdca18a950ac9363c6fb39118b80e1</string>
+ <key>hash_algorithm</key>
+ <string>md5</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-openssl/rev/226882/arch/Linux/installer/openssl-1.0.0d-linux-20110418.tar.bz2</string>
+ <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openal-3ad86a1c-linux-20110114.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
@@ -1636,35 +1650,47 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>774c7f0a0312bee3054757a623e227bc</string>
+ <string>04df406f3e5d04cf176660bdac66c3a1</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-openssl/rev/220986/arch/CYGWIN/installer/openssl-0.9.8q-windows-20110211.tar.bz2</string>
+ <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openal-1.12.854-1.1.0-windows-20110301.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
</map>
</map>
+ <key>version</key>
+ <string>3ad86a1c</string>
</map>
- <key>openal_soft</key>
+ <key>openjpeg</key>
<map>
<key>license</key>
- <string>lgpl</string>
+ <string>openjpeg</string>
<key>license_file</key>
- <string>LICENSES/OPENAL.txt</string>
+ <string>LICENSES/openjpeg.txt</string>
<key>name</key>
- <string>openal_soft</string>
+ <string>openjpeg</string>
<key>platforms</key>
<map>
+ <key>darwin</key>
+ <map>
+ <key>archive</key>
+ <map>
+ <key>hash</key>
+ <string>4be51c7cca7d84831e30b63279df7ae5</string>
+ <key>url</key>
+ <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.4-darwin-20110302.tar.bz2</string>
+ </map>
+ <key>name</key>
+ <string>darwin</string>
+ </map>
<key>linux</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
- <string>fccdca18a950ac9363c6fb39118b80e1</string>
- <key>hash_algorithm</key>
- <string>md5</string>
+ <string>fb2382014c79e0049746e4e29bd834f9</string>
<key>url</key>
- <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openal-3ad86a1c-linux-20110114.tar.bz2</string>
+ <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.4-linux-20110314.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
@@ -1674,25 +1700,23 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>04df406f3e5d04cf176660bdac66c3a1</string>
+ <string>ca5765af55f798724d601720afdf6953</string>
<key>url</key>
- <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openal-1.12.854-1.1.0-windows-20110301.tar.bz2</string>
+ <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.4-windows-20110302.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
</map>
</map>
- <key>version</key>
- <string>3ad86a1c</string>
</map>
- <key>openjpeg</key>
+ <key>openssl</key>
<map>
<key>license</key>
- <string>openjpeg</string>
+ <string>openssl</string>
<key>license_file</key>
- <string>LICENSES/openjpeg.txt</string>
+ <string>LICENSES/openssl.txt</string>
<key>name</key>
- <string>openjpeg</string>
+ <string>openssl</string>
<key>platforms</key>
<map>
<key>darwin</key>
@@ -1700,9 +1724,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>4be51c7cca7d84831e30b63279df7ae5</string>
+ <string>4db126327bbb125ea2490c79c73103bf</string>
<key>url</key>
- <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.4-darwin-20110302.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-openssl-update/rev/290662/arch/Darwin/installer/openssl-1.0.1h-darwin-20140605.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@@ -1712,9 +1736,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>fb2382014c79e0049746e4e29bd834f9</string>
+ <string>0665c18f8cdbe2f90cb0a2f088cfe1a6</string>
<key>url</key>
- <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.4-linux-20110314.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-openssl-update/rev/290662/arch/Linux/installer/openssl-1.0.1h-linux-20140605.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
@@ -1724,9 +1748,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>ca5765af55f798724d601720afdf6953</string>
+ <string>138997e1a73c65525d45c00f43f08010</string>
<key>url</key>
- <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/openjpeg-1.4-windows-20110302.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-openssl-update/rev/290662/arch/CYGWIN/installer/openssl-1.0.1h-windows-20140605.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@@ -1748,9 +1772,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>a8e74694a0f4248228c13c845ed0a6f8</string>
+ <string>af0d38a4c56b52c4df40a4ff0d51efef</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-pcre/rev/228822/arch/Darwin/installer/pcre-7.6-darwin-20110504.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-pcre-update/rev/290406/arch/Darwin/installer/pcre-8.35-darwin-20140529.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@@ -1760,9 +1784,21 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>bb0abe962b3b8208ed2dab0424aab33d</string>
+ <string>5e6368d39b95f2c0d5162dac2c17c67f</string>
+ <key>url</key>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-pcre-update/rev/290406/arch/Linux/installer/pcre-8.35-linux-20140530.tar.bz2</string>
+ </map>
+ <key>name</key>
+ <string>linux</string>
+ </map>
+ <key>windows</key>
+ <map>
+ <key>archive</key>
+ <map>
+ <key>hash</key>
+ <string>9250f74fed826ad1b8700229e964519d</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-pcre/rev/228822/arch/Linux/installer/pcre-7.6-linux-20110504.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-pcre-update/rev/290406/arch/CYGWIN/installer/pcre-8.35-windows-20140529.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
@@ -1928,9 +1964,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>49b8de20f3bb43537f51311894a72de1</string>
+ <string>6658071e3b54b1dd5f5279227aff402a</string>
<key>url</key>
- <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/zlib-1.2.5-darwin-20110211.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-zlib-update/rev/290556/arch/Darwin/installer/zlib-1.2.8-darwin-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@@ -1940,9 +1976,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>7b4cf3aa2c04937d0a20761516587896</string>
+ <string>63a62bb3cbef2aad3cca49cb6f2d0aeb</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-zlib/rev/223739/arch/Linux/installer/zlib-1.2.5-linux-20110314.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-zlib-update/rev/290556/arch/Linux/installer/zlib-1.2.8-linux-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
@@ -1952,9 +1988,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>5852192646681817fc3c3a8c95e91c1e</string>
+ <string>ab45a628e22a495814e806ce46081806</string>
<key>url</key>
- <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-zlib/rev/220983/arch/CYGWIN/installer/zlib-1.2.5-windows-20110211.tar.bz2</string>
+ <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3pl_3p-zlib-update/rev/290556/arch/CYGWIN/installer/zlib-1.2.8-windows-20140602.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@@ -2321,7 +2357,7 @@
<string>make</string>
<key>options</key>
<array>
- <string>-j 2</string>
+ <string>-j 7</string>
</array>
</map>
<key>configure</key>
@@ -2371,7 +2407,7 @@
<string>make</string>
<key>options</key>
<array>
- <string>-j 2</string>
+ <string>-j 7</string>
</array>
</map>
<key>configure</key>
@@ -2419,7 +2455,7 @@
<string>make</string>
<key>options</key>
<array>
- <string>-j 2</string>
+ <string>-j 7</string>
</array>
</map>
<key>configure</key>
diff --git a/doc/contributions.txt b/doc/contributions.txt
index 89390d9977..b5db1fa5a3 100755
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -180,6 +180,8 @@ Ansariel Hiller
MAINT-2368
STORM-1931
MAINT-2773
+ STORM-2011
+ MAINT-3187
BUG-3764
STORM-1984
STORM-1979
@@ -313,11 +315,16 @@ Cinder Roxley
BUG-3863
OPEN-185
STORM-1703
- STORM-1948
+ STORM-1948
+ STORM-1831
STORM-1888
STORM-1958
STORM-1952
STORM-1951
+ STORM-2035
+ STORM-2036
+ STORM-2037
+ STORM-2053
Clara Young
Coaldust Numbers
VWR-1095
@@ -330,6 +337,9 @@ Cron Stardust
VWR-25120
STORM-1075
STORM-1919
+ STORM-1920
+ OPEN-209
+ STORM-2017
Cypren Christenson
STORM-417
Dante Tucker
@@ -519,8 +529,16 @@ Ima Mechanique
STORM-959
STORM-1175
STORM-1708
+ STORM-1831
+ STORM-1832
STORM-1855
+ VWR-10791
VWR-20553
+ VWR-19213
+ VWR-22401
+ VWR-23739
+ VWR-24766
+ VWR-28065
Imnotgoing Sideways
Inma Rau
Innula Zenovka
@@ -663,6 +681,7 @@ Jonathan Yap
STORM-1809
STORM-1793
STORM-1810
+ STORM-68
STORM-1838
STORM-1892
STORM-1894
@@ -673,12 +692,15 @@ Jonathan Yap
STORM-1858
STORM-1862
STORM-1918
+ STORM-1915
STORM-1929
STORM-1953
OPEN-161
STORM-1953
STORM-1957
STORM-1993
+ STORM-2017
+ STORM-2007
STORM-1980
OPEN-113
STORM-1975
@@ -691,6 +713,11 @@ Jonathan Yap
STORM-1987
STORM-1986
STORM-1981
+ STORM-2015
+ STORM-2031
+ STORM-2030
+ STORM-2034
+ STORM-2018
Kadah Coba
STORM-1060
STORM-1843
@@ -744,6 +771,7 @@ Kunnis Basiat
Lance Corrimal
STORM-1910
VWR-25269
+ STORM-2008
Latif Khalifa
VWR-5370
leliel Mirihi
@@ -862,6 +890,8 @@ Mm Alder
VWR-4794
VWR-13578
Mo Hax
+Moon Metty
+ STORM-2078
Mourna Biziou
Mr Greggan
VWR-445
@@ -960,12 +990,45 @@ Nicky Dasmijn
OPEN-187
STORM-1937
OPEN-187
+ STORM-2010
Nicky Perian
OPEN-1
STORM-1087
STORM-1090
STORM-1828
Nicoladie Gymnast
+NiranV Dean
+ STORM-2040
+ STORM-2042
+ STORM-2043
+ STORM-2044
+ STORM-2045
+ STORM-2046
+ STORM-2047
+ STORM-2048
+ STORM-2049
+ STORM-2050
+ STORM-2051
+ STORM-2052
+ STORM-2057
+ STORM-2058
+ STORM-2059
+ STORM-2060
+ STORM-2061
+ STORM-2063
+ STORM-2065
+ STORM-2066
+ STORM-2068
+ STORM-2073
+ STORM-2076
+ BUG-372
+ BUG-1179
+ BUG-6835
+ BUG-6837
+ BUG-6839
+ BUG-6840
+ BUG-6958
+ BUG-7020
Nounouch Hapmouche
VWR-238
Ollie Kubrick
@@ -993,6 +1056,11 @@ Peekay Semyorka
VWR-19
VWR-49
VWR-79
+Pell Smit
+ STORM-2069
+ STORM-2070
+ STORM-2071
+ STORM-2072
Peter Lameth
VWR-7331
PeterPunk Mooney
@@ -1157,7 +1225,9 @@ snowy Sidran
Sovereign Engineer
MAINT-2334
OPEN-189
+ STORM-1972
OPEN-195
+ OPEN-217
SpacedOut Frye
VWR-34
VWR-45
@@ -1198,6 +1268,7 @@ Takeda Terrawyng
TankMaster Finesmith
OPEN-140
OPEN-142
+ OPEN-154
STORM-1100
STORM-1258
STORM-1602
@@ -1332,6 +1403,8 @@ Whirly Fizzle
VWR-29543
MAINT-873
STORM-1930
+ BUG-6659
+ STORM-2078
Whoops Babii
VWR-631
VWR-1640
@@ -1417,7 +1490,3 @@ Zipherius Turas
VWR-77
Zoex Flanagan
-
-
-
-
diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt
index 410d25ad97..24ea59ca49 100755
--- a/indra/CMakeLists.txt
+++ b/indra/CMakeLists.txt
@@ -71,7 +71,6 @@ add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins)
if (LINUX)
add_subdirectory(${VIEWER_PREFIX}linux_crash_logger)
- add_subdirectory(${VIEWER_PREFIX}linux_updater)
if (INSTALL_PROPRIETARY)
include(LLAppearanceUtility)
add_subdirectory(${LLAPPEARANCEUTILITY_SRC_DIR} ${LLAPPEARANCEUTILITY_BIN_DIR})
@@ -86,9 +85,8 @@ elseif (WINDOWS)
if (EXISTS ${VIEWER_DIR}win_setup)
add_subdirectory(${VIEWER_DIR}win_setup)
endif (EXISTS ${VIEWER_DIR}win_setup)
- add_subdirectory(${VIEWER_PREFIX}win_updater)
- # add_dependencies(viewer windows-updater windows-setup windows-crash-logger)
- add_dependencies(viewer windows-updater windows-crash-logger)
+ # add_dependencies(viewer windows-setup windows-crash-logger)
+ add_dependencies(viewer windows-crash-logger)
elseif (SOLARIS)
add_subdirectory(solaris_crash_logger)
add_dependencies(viewer solaris-crash-logger)
diff --git a/indra/cmake/00-COMPILE-LINK-RUN.txt b/indra/cmake/00-COMPILE-LINK-RUN.txt
new file mode 100644
index 0000000000..d08cc2dc0c
--- /dev/null
+++ b/indra/cmake/00-COMPILE-LINK-RUN.txt
@@ -0,0 +1,344 @@
+
+ A short guide to compiling, linking, running and debugging issues
+ in the viewer and its packaged libraries.
+
+Introduction
+
+ A recent pass through some third-party libraries resulted in the
+ collection of a lot of information about how things should and
+ shouldn't be built in the viewer. Some of that is presented below
+ with hints and rules about doing things well. What's presented is
+ a guideline only. Not all suggestions are hard rules and you'll
+ find exceptions all over. Some exceptions arise from solid
+ reasoning, others may be legacy that hasn't been re-examined.
+
+ Use good engineering judgement when applying this information.
+
+Compilation
+
+ Windows Targets
+
+ Significant compilation flags and defines follow:
+
+ ----------------------------------------------------------------------------
+ Option Release RelWithDebInfo Debug
+ ----------------------------------------------------------------------------
+ wchar_t /Zc:wchar_t- " "
+ RTL type /MD /MD /MDd
+ FLoating Point /fp:fast " "
+ Debug Info /Zi (app/dll), /Z7 (lib) " "
+ Optimizer /O2 /Ob2 /GR /Od /Ob0 /GR /Od /GR
+ Incr. Link /INCREMENTAL:NO /INCREMENTAL /INCREMENTAL:NO
+ Debug /DEBUG /DEBUG /DEBUG
+ /OPT:REF
+ Ignore Libs LIBCMT LIBCMT LIBCMT;LIBCMTD;MSVCRT
+ Alignment Default " "
+
+ Defines WIN32 " "
+ _WINDOWS " "
+ LL_RELEASE=1 LL_RELEASE=1 n/a
+ LL_RELEASE_FOR_DOWNLOAD=1 n/a n/a
+ NDEBUG NDEBUG _DEBUG
+ n/a n/a LL_DEBUG=1
+ n/a LL_RELEASE_WITH_\ n/a
+ DEBUG_INFO=1
+ n/a n/a _SCL_SECURE_NO_WARNINGS=1
+ _SECURE_STL=0 _SECURE_STL=0 _SECURE_STL=0
+ _HAS_ITERATOR_DEBUGGING=0 n/a n/a
+ LL_WINDOWS=1 " "
+ UNICODE " "
+ _UNICODE " "
+ WINVER=0x0501 " "
+ _WIN32_WINNT=0x0501 " "
+ LL_OS_DRAGDROP_ENABLED=1 " "
+ CARES_STATICLIB " "
+ LIB_NDOF=1 " "
+
+ ----------------------------------------------------------------------------
+ Notes:
+
+ 1. /Zc:wchar_t-. Not certain where this comes from. It may be
+ due to a default set of compilation flags in Qt 4.X that then
+ propagates outward. In Qt 5.X, this setting is flipped back to
+ default (wchar_t is a built-in). Other options for dealing with
+ this include:
+
+ http://msdn.microsoft.com/en-us/library/dh8che7s%28v=vs.110%29.aspx
+
+ Recommend trying to stay with /Zc:wchar_t (the default) when
+ adding libraries. If incompatible, you'll typically get some
+ missing ostream '<<' operators or something similar in the stream
+ headers.
+
+ 2. /Z7 (VC 7.0 compatibility symbols) gives us debug information
+ in the static libraries we build. Otherwise builds generate
+ vc100.pdb files all over the place which generally aren't useful.
+ DLL's and .EXEs are to get /Zi or /ZI with separate .PDB files.
+ These .PDB files can then be packaged up in symbol tarballs for
+ the crash dump analyzer or used in debugging. There are issues here
+ for VS 2013 (see below).
+
+
+ Mac Targets
+
+ Fairly straightforward, optimization level is easily changed (may
+ be little or negative gain for -O3 and RelWithDebInfo should be
+ kicked up to 1 or 2. Boost debug symbols to dwarf-2 with a goal
+ of dwarf-2 in separate dSYM file when building .dylibs and
+ executables.
+
+ ----------------------------------------------------------------------------
+ Option Release RelWithDebInfo Debug
+ ----------------------------------------------------------------------------
+ Strip Debug Symbols On " "
+ During Copy
+
+ Generate Debug Syms On " "
+
+ Level Debug Syms -gdwarf-2 " "
+
+ Optimization -O3 -O0 -O0
+
+ PIC -fPIC -DPIC " "
+
+ Defines LL_RELEASE=1 LL_RELEASE=1 n/a
+ LL_RELEASE_FOR_DOWNLOAD=1 n/a n/a
+ NDEBUG NDEBUG _DEBUG
+ n/a n/a LL_DEBUG=1
+ n/a LL_RELEASE_WITH_\ n/a
+ DEBUG_INFO=1
+ LL_DARWIN=1 " "
+ LL_OS_DRAGDROP_ENABLED=1 " "
+ CARES_STATICLIB " "
+ LIB_NDOF=1 " "
+
+ ----------------------------------------------------------------------------
+ Notes:
+
+ 1. We’re also building dylibs in a somewhat unusual way. They’re
+ currently being generated with a link path of
+ ‘@executable_path/../Resources/<library>’. If we were to follow
+ the recommendations in dyld’s man page, we’d instead reference
+ ‘@loader_path/<library>’, use -rpath on the executable link
+ (pointing to the ‘Resources’ subdir of the main executable), and
+ be able to avoid some symlinking in the .app tree.
+
+ 2. Use the -headerpad_max_install_names link option on all .dylibs.
+
+
+ Linux Targets
+
+ Not much variety here.
+
+ ----------------------------------------------------------------------------
+ Option Release RelWithDebInfo Debug
+ ----------------------------------------------------------------------------
+ Debug Level -g (-g0/1 better?) -g -g
+ During Copy
+
+ Optimization -O2 -O0 -O0
+
+ PIC -fPIC " "
+ ----------------------------------------------------------------------------
+ Notes:
+
+
+Linking
+
+ The library update work has generally moved in the direction of
+ preferring static libraries over dynamic (Qt4 being the notable
+ exception). It also mostly eliminated the extremely bad practice
+ of having multiple versions of a library built into an image.
+
+ How bad was it? Very. Appalling. A nightmare. On Windows, at
+ least four versions of zlib (1.2.3, 1.2.5, 1.2.6, unknown), three
+ versions of Boost (1.45, 1.48, 1.52), two versions of OpenSSL
+ (0.9.8q, 1.0.0g) and three different builds of libexpat
+ 2.0.5/1.5.2 were used. Mac was worse with five builds or versions
+ of zlib, two of PCRE, two of c-ares, and three of OpenSSL. Linux
+ topped that by adding two builds of libpng.
+
+ DO NOT ALLOW THIS TO HAPPEN AGAIN. It isn't enough to update a
+ library and then stuff a new triplet of S3 URLs into the viewer's
+ autobuild.xml. If you update a library you MUST:
+
+ * Update the autobuild.xml of ALL consumers of the library. In
+ the case of zlib, that meant updating freetype, libpng, openssl,
+ libxml2, fontconfig, curl, Boost, SDL, llqtwebkit, google-mock and
+ colladadom.
+
+ * Confirm by test and observation that the consumers actually use
+ your library rather than 'call home to mother' and find
+ system-supplied versions of your library. This may consist of
+ watching configuration scripts, probing with ldd/depends/otool,
+ pulling text out of binaries with 'strings'. The previously-
+ mentioned libraries all have a README.Linden file that gives
+ examples specific to the consumer library.
+
+ * DO NOT RE-EXPORT LIBRARIES. Colladadom was the worst offender
+ of this rule. As a shared library, it was re-exporting part, but
+ not all, of Boost filesystem and system, some zlib, some PCRE,
+ some libxml2 and minizip. This meant that depending upon link-
+ time and run-time symbol resolution, data constructed with one
+ version of a library might be processed by a method built in a
+ second, incompatible version of the library. Switching colladadom
+ to a static library ended the re-export problem.
+
+ * Preventing re-export is not sufficient. other libraries will
+ still be shipped as shared and they can still have Singleton and
+ Fragile Base Class issues. A DLL may be built with a static
+ archive of a library that has global data. That same static
+ archive might be linked into the application proper. An object
+ created with a method in the DLL may pass into a method in the
+ application where the archive's global data has a second instance
+ and no knowledge of the object. This is a failure due to an
+ assumption of Singleton global data which leads to some kind of
+ failure. This is the same effect as when, in Windows, both MSVCRT
+ and MSVCRTD get activated in a program. If you're lucky, some
+ asserts fail in that case having to do with file handle global
+ data.
+
+
+Running
+
+ Windows Debug Build. Seems to have been rendered nearly useless
+ by having the LL_CHECK_MEMORY define in llmemory.h calling
+ _CrtCheckMemory(). Viewer is almost useful disabling this in
+ llvoavatar code alone but not quite.
+
+
+Futures
+
+ Static Versus Dynamic Libraries
+
+ One solution to the above linking problems is the use of static
+ libraries for everything. Single version, singleton instancing of
+ data, etc. But it's not the 1950's and we're not running our
+ applications on bare metal. Every platform comes with 100s of
+ libraries waiting to interfere with operations by breaking the
+ single-version and singleton-data assumption.
+
+ Additionally, there are libraries that simply expect to be built
+ into shared libraries. Qt4 is one such. The version we're using
+ now, 4.7.1, is actually trying to disable both Webkit and plugin
+ modules because we're building it statically on Mac and Linux.
+ It's only because of configuration bugs that we're getting the
+ functionality out of it that we want.
+
+ With enough libraries and a single, global namespace, eventually
+ there will be collisions and there may not be a warning. All it
+ takes is two programmers who thought that 'FILE * open_file(const
+ char *);' was a safe signature to use between compilation units in
+ their libraries and glorious debugging sessions are in your
+ future. Having debugged it, you will now become the proud owner
+ of a one-off version of one of those libraries that uses a special
+ symbol prefix which you will be maintaining forever.
+
+ Lastly, we have some binary blobs that we must use as delivered.
+ Executables can be isolated at run-time if necessary. Shared
+ libraries are a different problem. They may bring their own
+ library dependencies that affect link- and run-time symbol
+ resolution and they'll impose that on us according to platform
+ rules.
+
+ So, what to do? My natural bias for large software is to use
+ shared libraries for everything. It's a path to single-version
+ and singleton data and isolates namespaces and prevents
+ interactions. It also has some field serviceability benefits if
+ you need to debug some bizarre problem a user has.
+
+ But there's a local preference for static. Here, my
+ rules-of-thumb are:
+
+ * Static library used by default.
+
+ * Shared library where the library must be built shared.
+
+ * Shared library if that is the only means to enforce the
+ single-version and singleton-data requirements.
+
+ * Shared library *on a case-by-case basis* if the library is also
+ provided by the platform and some benefit is plausible. (An
+ example of this is freetype/fontconfig on Linux. The .so
+ versions we build with, and incompletely ship, are inferior in
+ behavior to the platform libraries. By being shared libraries,
+ the platform-supplied option is available to all Linux users.)
+
+ In all cases, beware of cmake which appears to collapse and move
+ library references in links. This can drastically affect symbol
+ resolution when there are multiple sources for a symbol.
+
+ General
+
+ VS 2013. The /Z7 flag is rumored to be somewhat broken in 2013.
+ But it also sounds like there are explicit controls to name .PDB
+ files associated with static archives. That would make this an
+ ideal time to switch to /Zi or /ZI everywhere with explicit naming
+ and bring all the .PDBs together.
+
+ The embedded browser technology (e.g. Qt4 with Webkit) is the
+ 800-pound gorilla in the viewer. When starting any major work,
+ decide what changes you need here as those changes will propagate
+ outwards forcing many other decisions (cf: /Zc:wchar_t- flag).
+
+ The current package structure (./include, ./lib/release,
+ ./lib/debug, etc.) really works against the conventions used by
+ configure-like programs. I wasted a lot of time getting each
+ library to work with our structure without having to go back to
+ automake/autoconf. For Linux and Mac (and even for Windows), a
+ structure like the following where each grouping is optional would
+ probably save some work:
+
+ ./debug/bin
+ /include
+ /lib
+ ./debug/shared/bin
+ /include
+ /lib
+ ./debug/static/bin
+ /include
+ /lib
+ ./release/bin
+ /include
+ /lib
+ ...
+
+ In zlib and openssl and in a few of the libraries that consume
+ them, I experimented with packaging both static and shared
+ libraries and then having the consumer library move the unwanted
+ pieces out of the way to use the library type of choice (see
+ restore_dylibs() and restore_sos() functions). It was a bit fussy
+ and simplicity and clarity are the keys to maintaining libraries
+ in the future.
+
+ But it did suggest another approach. The idea is that every build
+ pre-stages inputs. Before anything is built, package pieces are
+ copied or symlinked from the 'stage/packages' area to the
+ 'stage/input' area. Builds then proceed with a single set of
+ -I/-L options for the dependencies. And products are built and
+ installed in a similar output staging structure for the next
+ consumer:
+
+ stage/packages/<package>/[above structure]
+ stage/input/{bin,include,lib}
+ stage/<package>/[above structure]
+
+ Next library project. I'd recommend working on the related set of
+ libexpat, apr, aprutil, xmlrpc-epi. We know libexpat has some
+ updates that should improve stability. Libapr consumes it and it
+ could use some /Z7 flag work to get rid of some 1000's of PDB
+ warnings and improve our debug symbols.
+
+ Miscellany to be sorted out:
+
+ * The packaging of libfreetype and libfontconfig on Linux.
+ Determine what the right thing is, do it.
+
+ * Maybe do something with ICU4C. Qt5 will require it and a number
+ of our packages can consume it typically replacing iconv or some
+ other library. But it is a huge bolus of static data. It can be
+ trimmed, but still.
+
+ * Revisit openssl. Package as a shared library? Replace with
+ LibreSSL when available? Start using platform-supplied crypto?
+
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index 87484f4ae3..52b0f4e8b4 100755
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -61,7 +61,8 @@ if (WINDOWS)
add_definitions(
/DLL_WINDOWS=1
- /DDOM_DYNAMIC
+ /DNOMINMAX
+# /DDOM_DYNAMIC # For shared library colladadom
/DUNICODE
/D_UNICODE
/GS
@@ -173,12 +174,12 @@ if (LINUX)
endif (WORD_SIZE EQUAL 32)
add_definitions(-mfpmath=sse)
#add_definitions(-ftree-vectorize) # THIS CRASHES GCC 3.1-3.2
- if (NOT STANDALONE)
+ if (NOT USESYSTEMLIBS)
# this stops us requiring a really recent glibc at runtime
add_definitions(-fno-stack-protector)
# linking can be very memory-hungry, especially the final viewer link
set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory")
- endif (NOT STANDALONE)
+ endif (NOT USESYSTEMLIBS)
set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 ${CMAKE_CXX_FLAGS_RELEASE}")
@@ -225,14 +226,14 @@ if (LINUX OR DARWIN)
endif (LINUX OR DARWIN)
-if (STANDALONE)
- add_definitions(-DLL_STANDALONE=1)
+if (USESYSTEMLIBS)
+ add_definitions(-DLL_USESYSTEMLIBS=1)
if (LINUX AND ${ARCH} STREQUAL "i686")
add_definitions(-march=pentiumpro)
endif (LINUX AND ${ARCH} STREQUAL "i686")
-else (STANDALONE)
+else (USESYSTEMLIBS)
set(${ARCH}_linux_INCLUDES
ELFIO
atk-1.0
@@ -241,6 +242,6 @@ else (STANDALONE)
gtk-2.0
pango-1.0
)
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
diff --git a/indra/cmake/APR.cmake b/indra/cmake/APR.cmake
index a87027f5f6..1a01671002 100755
--- a/indra/cmake/APR.cmake
+++ b/indra/cmake/APR.cmake
@@ -8,9 +8,9 @@ set(APR_FIND_REQUIRED ON)
set(APRUTIL_FIND_QUIETLY ON)
set(APRUTIL_FIND_REQUIRED ON)
-if (STANDALONE)
+if (USESYSTEMLIBS)
include(FindAPR)
-else (STANDALONE)
+else (USESYSTEMLIBS)
use_prebuilt_binary(apr_suite)
if (WINDOWS)
if (LLCOMMON_LINK_SHARED)
@@ -52,4 +52,4 @@ else (STANDALONE)
list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES} uuid)
list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES} rt)
endif (LINUX)
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
diff --git a/indra/cmake/Audio.cmake b/indra/cmake/Audio.cmake
index d23bc2f9c6..876b7f82a8 100755
--- a/indra/cmake/Audio.cmake
+++ b/indra/cmake/Audio.cmake
@@ -1,13 +1,13 @@
# -*- cmake -*-
include(Prebuilt)
-if (STANDALONE)
+if (USESYSTEMLIBS)
include(FindPkgConfig)
pkg_check_modules(OGG REQUIRED ogg)
pkg_check_modules(VORBIS REQUIRED vorbis)
pkg_check_modules(VORBISENC REQUIRED vorbisenc)
pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
-else (STANDALONE)
+else (USESYSTEMLIBS)
use_prebuilt_binary(ogg-vorbis)
set(VORBIS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
set(VORBISENC_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
@@ -32,7 +32,7 @@ else (STANDALONE)
set(VORBISENC_LIBRARIES vorbisenc)
set(VORBISFILE_LIBRARIES vorbisfile)
endif (WINDOWS)
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
link_directories(
${VORBIS_LIBRARY_DIRS}
diff --git a/indra/cmake/BerkeleyDB.cmake b/indra/cmake/BerkeleyDB.cmake
index 57b53f46ff..5f6b644a15 100755
--- a/indra/cmake/BerkeleyDB.cmake
+++ b/indra/cmake/BerkeleyDB.cmake
@@ -3,9 +3,9 @@
set(DB_FIND_QUIETLY ON)
set(DB_FIND_REQUIRED ON)
-if (STANDALONE)
+if (USESYSTEMLIBS)
include(FindBerkeleyDB)
-else (STANDALONE)
+else (USESYSTEMLIBS)
if (LINUX)
# Need to add dependency pthread explicitely to support ld.gold.
use_prebuilt_binary(db)
@@ -14,4 +14,4 @@ else (STANDALONE)
set(DB_LIBRARIES db-4.2)
endif (LINUX)
set(DB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake
index cff762e1f0..25e54b7cbd 100755
--- a/indra/cmake/Boost.cmake
+++ b/indra/cmake/Boost.cmake
@@ -4,23 +4,25 @@ include(Prebuilt)
set(Boost_FIND_QUIETLY ON)
set(Boost_FIND_REQUIRED ON)
-if (STANDALONE)
+if (USESYSTEMLIBS)
include(FindBoost)
set(BOOST_CONTEXT_LIBRARY boost_context-mt)
+ set(BOOST_COROUTINE_LIBRARY boost_coroutine-mt)
set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt)
set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt)
set(BOOST_REGEX_LIBRARY boost_regex-mt)
set(BOOST_SIGNALS_LIBRARY boost_signals-mt)
set(BOOST_SYSTEM_LIBRARY boost_system-mt)
set(BOOST_THREAD_LIBRARY boost_thread-mt)
-else (STANDALONE)
+else (USESYSTEMLIBS)
use_prebuilt_binary(boost)
set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
- set(BOOST_VERSION "1.52")
+ set(BOOST_VERSION "1.55")
if (WINDOWS)
if(MSVC80)
+ # This should be obsolete at this point
set(BOOST_CONTEXT_LIBRARY
optimized libboost_context-vc80-mt-${BOOST_VERSION}
debug libboost_context-vc80-mt-gd-${BOOST_VERSION})
@@ -47,6 +49,9 @@ else (STANDALONE)
set(BOOST_CONTEXT_LIBRARY
optimized libboost_context-mt
debug libboost_context-mt-gd)
+ set(BOOST_COROUTINE_LIBRARY
+ optimized libboost_coroutine-mt
+ debug libboost_coroutine-mt-gd)
set(BOOST_FILESYSTEM_LIBRARY
optimized libboost_filesystem-mt
debug libboost_filesystem-mt-gd)
@@ -70,6 +75,9 @@ else (STANDALONE)
set(BOOST_CONTEXT_LIBRARY
optimized boost_context-mt
debug boost_context-mt-d)
+ set(BOOST_COROUTINE_LIBRARY
+ optimized boost_coroutine-mt
+ debug boost_coroutine-mt-d)
set(BOOST_FILESYSTEM_LIBRARY
optimized boost_filesystem-mt
debug boost_filesystem-mt-d)
@@ -92,6 +100,9 @@ else (STANDALONE)
set(BOOST_CONTEXT_LIBRARY
optimized boost_context-mt
debug boost_context-mt-d)
+ set(BOOST_COROUTINE_LIBRARY
+ optimized boost_coroutine-mt
+ debug boost_coroutine-mt-d)
set(BOOST_FILESYSTEM_LIBRARY
optimized boost_filesystem-mt
debug boost_filesystem-mt-d)
@@ -111,4 +122,4 @@ else (STANDALONE)
optimized boost_thread-mt
debug boost_thread-mt-d)
endif (WINDOWS)
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
diff --git a/indra/cmake/BuildVersion.cmake b/indra/cmake/BuildVersion.cmake
index e4b63dc7cb..e618a988b8 100755
--- a/indra/cmake/BuildVersion.cmake
+++ b/indra/cmake/BuildVersion.cmake
@@ -42,6 +42,11 @@ if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/n
message(SEND_ERROR "Cannot get viewer version from '${VIEWER_VERSION_BASE_FILE}'")
endif ( EXISTS ${VIEWER_VERSION_BASE_FILE} )
+ if ("${VIEWER_VERSION_REVISION}" STREQUAL "")
+ message("Ultimate fallback, revision was blank or not set: will use 0")
+ set(VIEWER_VERSION_REVISION 0)
+ endif ("${VIEWER_VERSION_REVISION}" STREQUAL "")
+
set(VIEWER_CHANNEL_VERSION_DEFINES
"LL_VIEWER_CHANNEL=\"${VIEWER_CHANNEL}\""
"LL_VIEWER_VERSION_MAJOR=${VIEWER_VERSION_MAJOR}"
diff --git a/indra/cmake/CARes.cmake b/indra/cmake/CARes.cmake
index b0dac5b12f..baa55aa49d 100755
--- a/indra/cmake/CARes.cmake
+++ b/indra/cmake/CARes.cmake
@@ -5,9 +5,9 @@ include(Prebuilt)
set(CARES_FIND_QUIETLY ON)
set(CARES_FIND_REQUIRED ON)
-if (STANDALONE)
+if (USESYSTEMLIBS)
include(FindCARes)
-else (STANDALONE)
+else (USESYSTEMLIBS)
use_prebuilt_binary(ares)
add_definitions("-DCARES_STATICLIB")
if (WINDOWS)
@@ -18,4 +18,4 @@ else (STANDALONE)
set(CARES_LIBRARIES cares)
endif (WINDOWS)
set(CARES_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/ares)
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
diff --git a/indra/cmake/CURL.cmake b/indra/cmake/CURL.cmake
index 9aba08e573..04afae594d 100755
--- a/indra/cmake/CURL.cmake
+++ b/indra/cmake/CURL.cmake
@@ -4,9 +4,9 @@ include(Prebuilt)
set(CURL_FIND_QUIETLY ON)
set(CURL_FIND_REQUIRED ON)
-if (STANDALONE)
+if (USESYSTEMLIBS)
include(FindCURL)
-else (STANDALONE)
+else (USESYSTEMLIBS)
use_prebuilt_binary(curl)
if (WINDOWS)
set(CURL_LIBRARIES
@@ -16,4 +16,4 @@ else (STANDALONE)
set(CURL_LIBRARIES libcurl.a)
endif (WINDOWS)
set(CURL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake
index f98e88b697..28202f85d6 100755
--- a/indra/cmake/Copy3rdPartyLibs.cmake
+++ b/indra/cmake/Copy3rdPartyLibs.cmake
@@ -40,7 +40,6 @@ if(WINDOWS)
libapriconv-1.dll
ssleay32.dll
libeay32.dll
- libcollada14dom22-d.dll
glod.dll
libhunspell.dll
)
@@ -53,7 +52,6 @@ if(WINDOWS)
libapriconv-1.dll
ssleay32.dll
libeay32.dll
- libcollada14dom22.dll
glod.dll
libhunspell.dll
)
@@ -213,15 +211,12 @@ elseif(DARWIN)
libapr-1.dylib
libaprutil-1.0.dylib
libaprutil-1.dylib
+ libexception_handler.dylib
libexpat.1.5.2.dylib
libexpat.dylib
libGLOD.dylib
- libllqtwebkit.dylib
- libminizip.a
- libndofdev.dylib
libhunspell-1.3.0.dylib
- libexception_handler.dylib
- libcollada14dom.dylib
+ libndofdev.dylib
)
if (FMODEX)
@@ -259,35 +254,21 @@ elseif(LINUX)
libapr-1.so.0
libaprutil-1.so.0
libatk-1.0.so
- libboost_context-mt.so.${BOOST_VERSION}.0
- libboost_filesystem-mt.so.${BOOST_VERSION}.0
- libboost_program_options-mt.so.${BOOST_VERSION}.0
- libboost_regex-mt.so.${BOOST_VERSION}.0
- libboost_signals-mt.so.${BOOST_VERSION}.0
- libboost_system-mt.so.${BOOST_VERSION}.0
- libboost_thread-mt.so.${BOOST_VERSION}.0
- libcollada14dom.so
- libcrypto.so.1.0.0
libdb-5.1.so
libexpat.so
libexpat.so.1
+ libfreetype.so.6.6.2
libfreetype.so.6
libGLOD.so
- libgmock_main.so
- libgmock.so.0
libgmodule-2.0.so
libgobject-2.0.so
- libgtest_main.so
- libgtest.so.0
libhunspell-1.3.so.0.0.0
- libminizip.so
libopenal.so
libopenjpeg.so
- libssl.so
libuuid.so.16
libuuid.so.16.0.22
- libssl.so.1.0.0
- libfontconfig.so.1.4.4
+ libfontconfig.so.1.8.0
+ libfontconfig.so.1
)
if (USE_TCMALLOC)
@@ -374,9 +355,9 @@ copy_if_different(
)
set(third_party_targets ${third_party_targets} ${out_targets})
-if(NOT STANDALONE)
+if(NOT USESYSTEMLIBS)
add_custom_target(
stage_third_party_libs ALL
DEPENDS ${third_party_targets}
)
-endif(NOT STANDALONE)
+endif(NOT USESYSTEMLIBS)
diff --git a/indra/cmake/DBusGlib.cmake b/indra/cmake/DBusGlib.cmake
index 83c08d3350..d148a35a5b 100755
--- a/indra/cmake/DBusGlib.cmake
+++ b/indra/cmake/DBusGlib.cmake
@@ -1,7 +1,7 @@
# -*- cmake -*-
include(Prebuilt)
-if (STANDALONE)
+if (USESYSTEMLIBS)
include(FindPkgConfig)
pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1)
@@ -18,7 +18,7 @@ elseif (LINUX)
gobject-2.0
glib-2.0
)
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
if (DBUSGLIB_FOUND)
set(DBUSGLIB ON CACHE BOOL "Build with dbus-glib message bus support.")
diff --git a/indra/cmake/EXPAT.cmake b/indra/cmake/EXPAT.cmake
index acb15dc623..c1155531ff 100755
--- a/indra/cmake/EXPAT.cmake
+++ b/indra/cmake/EXPAT.cmake
@@ -4,9 +4,9 @@ include(Prebuilt)
set(EXPAT_FIND_QUIETLY ON)
set(EXPAT_FIND_REQUIRED ON)
-if (STANDALONE)
+if (USESYSTEMLIBS)
include(FindEXPAT)
-else (STANDALONE)
+else (USESYSTEMLIBS)
use_prebuilt_binary(expat)
if (WINDOWS)
set(EXPAT_LIBRARIES libexpatMT)
@@ -14,4 +14,4 @@ else (STANDALONE)
set(EXPAT_LIBRARIES expat)
endif (WINDOWS)
set(EXPAT_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
diff --git a/indra/cmake/ExamplePlugin.cmake b/indra/cmake/ExamplePlugin.cmake
index 599787ad21..5d826c1f66 100755
--- a/indra/cmake/ExamplePlugin.cmake
+++ b/indra/cmake/ExamplePlugin.cmake
@@ -2,13 +2,13 @@
include(Linking)
include(Prebuilt)
-if (STANDALONE)
+if (USESYSTEMLIBS)
set(EXAMPLEPLUGIN OFF CACHE BOOL
"EXAMPLEPLUGIN support for the llplugin/llmedia test apps.")
-else (STANDALONE)
+else (USESYSTEMLIBS)
set(EXAMPLEPLUGIN ON CACHE BOOL
"EXAMPLEPLUGIN support for the llplugin/llmedia test apps.")
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
if (WINDOWS)
elseif (DARWIN)
diff --git a/indra/cmake/FMODEX.cmake b/indra/cmake/FMODEX.cmake
index 163260137b..720933d1b7 100644
--- a/indra/cmake/FMODEX.cmake
+++ b/indra/cmake/FMODEX.cmake
@@ -4,17 +4,17 @@
# When building using proprietary binaries though (i.e. having access to LL private servers),
# we always build with FMODEX.
# Open source devs should use the -DFMODEX:BOOL=ON then if they want to build with FMOD, whether
-# they are using STANDALONE or not.
+# they are using USESYSTEMLIBS or not.
if (INSTALL_PROPRIETARY)
set(FMODEX ON CACHE BOOL "Using FMOD Ex sound library.")
endif (INSTALL_PROPRIETARY)
if (FMODEX)
- if (STANDALONE)
+ if (USESYSTEMLIBS)
# In that case, we use the version of the library installed on the system
set(FMODEX_FIND_REQUIRED ON)
include(FindFMODEX)
- else (STANDALONE)
+ else (USESYSTEMLIBS)
if (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)
# If the path have been specified in the arguments, use that
set(FMODEX_LIBRARIES ${FMODEX_LIBRARY})
@@ -39,8 +39,8 @@ if (FMODEX)
optimized fmodex)
endif (WINDOWS)
set(FMODEX_LIBRARIES ${FMODEX_LIBRARY})
- set(FMODEX_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/)
+ set(FMODEX_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/fmodex)
endif (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)
- endif (STANDALONE)
+ endif (USESYSTEMLIBS)
endif (FMODEX)
diff --git a/indra/cmake/FindJsonCpp.cmake b/indra/cmake/FindJsonCpp.cmake
index 0b056ada58..9398779cff 100755
--- a/indra/cmake/FindJsonCpp.cmake
+++ b/indra/cmake/FindJsonCpp.cmake
@@ -23,10 +23,10 @@ EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
# Try to find a library that was compiled with the same compiler version as we currently use.
SET(JSONCPP_NAMES ${JSONCPP_NAMES} libjson_linux-gcc-${_gcc_COMPILER_VERSION}_libmt.so)
-IF (STANDALONE)
+IF (USESYSTEMLIBS)
# On standalone, assume that the system installed library was compiled with the used compiler.
SET(JSONCPP_NAMES ${JSONCPP_NAMES} libjson.so)
-ENDIF (STANDALONE)
+ENDIF (USESYSTEMLIBS)
FIND_LIBRARY(JSONCPP_LIBRARY
NAMES ${JSONCPP_NAMES}
PATHS /usr/lib /usr/local/lib
diff --git a/indra/cmake/FreeType.cmake b/indra/cmake/FreeType.cmake
index c9a90a9a8d..a36485f6d0 100755
--- a/indra/cmake/FreeType.cmake
+++ b/indra/cmake/FreeType.cmake
@@ -1,14 +1,14 @@
# -*- cmake -*-
include(Prebuilt)
-if (STANDALONE)
+if (USESYSTEMLIBS)
include(FindPkgConfig)
pkg_check_modules(FREETYPE REQUIRED freetype2)
-else (STANDALONE)
+else (USESYSTEMLIBS)
use_prebuilt_binary(freetype)
- set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
+ set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/freetype2/)
set(FREETYPE_LIBRARIES freetype)
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
link_directories(${FREETYPE_LIBRARY_DIRS})
diff --git a/indra/cmake/GLEXT.cmake b/indra/cmake/GLEXT.cmake
index 0a3dd976b4..a749644202 100644
--- a/indra/cmake/GLEXT.cmake
+++ b/indra/cmake/GLEXT.cmake
@@ -1,8 +1,8 @@
# -*- cmake -*-
include(Prebuilt)
-if (NOT STANDALONE)
+if (NOT USESYSTEMLIBS)
use_prebuilt_binary(glext)
use_prebuilt_binary(glh_linear)
set(GLEXT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
-endif (NOT STANDALONE)
+endif (NOT USESYSTEMLIBS)
diff --git a/indra/cmake/GLH.cmake b/indra/cmake/GLH.cmake
index 911dbe4017..d5262f2efa 100755
--- a/indra/cmake/GLH.cmake
+++ b/indra/cmake/GLH.cmake
@@ -4,8 +4,8 @@ include(Prebuilt)
set(GLH_FIND_REQUIRED TRUE)
set(GLH_FIND_QUIETLY TRUE)
-if (STANDALONE)
+if (USESYSTEMLIBS)
include(FindGLH)
-else (STANDALONE)
+else (USESYSTEMLIBS)
use_prebuilt_binary(glh_linear)
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
diff --git a/indra/cmake/GLOD.cmake b/indra/cmake/GLOD.cmake
index 6bdbaf621e..3683768af9 100755
--- a/indra/cmake/GLOD.cmake
+++ b/indra/cmake/GLOD.cmake
@@ -1,9 +1,9 @@
# -*- cmake -*-
include(Prebuilt)
-if (NOT STANDALONE)
+if (NOT USESYSTEMLIBS)
use_prebuilt_binary(GLOD)
-endif (NOT STANDALONE)
+endif (NOT USESYSTEMLIBS)
set(GLOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
set(GLOD_LIBRARIES GLOD)
diff --git a/indra/cmake/GStreamer010Plugin.cmake b/indra/cmake/GStreamer010Plugin.cmake
index d2d0699bcd..3fbc40ef8f 100755
--- a/indra/cmake/GStreamer010Plugin.cmake
+++ b/indra/cmake/GStreamer010Plugin.cmake
@@ -1,15 +1,15 @@
# -*- cmake -*-
include(Prebuilt)
-if (STANDALONE)
+if (USESYSTEMLIBS)
include(FindPkgConfig)
pkg_check_modules(GSTREAMER010 REQUIRED gstreamer-0.10)
pkg_check_modules(GSTREAMER010_PLUGINS_BASE REQUIRED gstreamer-plugins-base-0.10)
elseif (LINUX)
use_prebuilt_binary(gstreamer)
- # possible libxml should have its own .cmake file instead
- use_prebuilt_binary(libxml)
+ # possible libxml2 should have its own .cmake file instead
+ use_prebuilt_binary(libxml2)
set(GSTREAMER010_FOUND ON FORCE BOOL)
set(GSTREAMER010_PLUGINS_BASE_FOUND ON FORCE BOOL)
set(GSTREAMER010_INCLUDE_DIRS
@@ -26,7 +26,7 @@ elseif (LINUX)
gthread-2.0
glib-2.0
)
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
if (GSTREAMER010_FOUND AND GSTREAMER010_PLUGINS_BASE_FOUND)
set(GSTREAMER010 ON CACHE BOOL "Build with GStreamer-0.10 streaming media support.")
diff --git a/indra/cmake/Glui.cmake b/indra/cmake/Glui.cmake
index f62a56856c..db353a91ec 100755
--- a/indra/cmake/Glui.cmake
+++ b/indra/cmake/Glui.cmake
@@ -2,14 +2,14 @@
include(Linking)
include(Prebuilt)
-if (STANDALONE)
+if (USESYSTEMLIBS)
set(GLUI OFF CACHE BOOL
"GLUI support for the llplugin/llmedia test apps.")
-else (STANDALONE)
+else (USESYSTEMLIBS)
use_prebuilt_binary(glui)
set(GLUI ON CACHE BOOL
"GLUI support for the llplugin/llmedia test apps.")
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
if (LINUX)
set(GLUI ON CACHE BOOL
diff --git a/indra/cmake/GoogleBreakpad.cmake b/indra/cmake/GoogleBreakpad.cmake
index 7f9ba4ea8e..829e1ac08a 100755
--- a/indra/cmake/GoogleBreakpad.cmake
+++ b/indra/cmake/GoogleBreakpad.cmake
@@ -1,10 +1,10 @@
# -*- cmake -*-
include(Prebuilt)
-if (STANDALONE)
+if (USESYSTEMLIBS)
set(BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED ON)
include(FindGoogleBreakpad)
-else (STANDALONE)
+else (USESYSTEMLIBS)
use_prebuilt_binary(google_breakpad)
if (DARWIN)
set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler)
@@ -18,5 +18,5 @@ else (STANDALONE)
# yes, this does look dumb, no, it's not incorrect
#
set(BREAKPAD_INCLUDE_DIRECTORIES "${LIBS_PREBUILT_DIR}/include/google_breakpad" "${LIBS_PREBUILT_DIR}/include/google_breakpad/google_breakpad")
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake
index c4c96a9af7..cac072988e 100755
--- a/indra/cmake/GoogleMock.cmake
+++ b/indra/cmake/GoogleMock.cmake
@@ -2,7 +2,7 @@
include(Prebuilt)
include(Linking)
-use_prebuilt_binary(googlemock)
+use_prebuilt_binary(gmock)
set(GOOGLEMOCK_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/include)
diff --git a/indra/cmake/GooglePerfTools.cmake b/indra/cmake/GooglePerfTools.cmake
index f3fd008e49..c1faeb9325 100755
--- a/indra/cmake/GooglePerfTools.cmake
+++ b/indra/cmake/GooglePerfTools.cmake
@@ -5,9 +5,9 @@ include(Prebuilt)
# set ON or OFF as desired.
set (USE_TCMALLOC OFF)
-if (STANDALONE)
+if (USESYSTEMLIBS)
include(FindGooglePerfTools)
-else (STANDALONE)
+else (USESYSTEMLIBS)
if (WINDOWS)
if (USE_TCMALLOC)
use_prebuilt_binary(gperftools)
@@ -34,7 +34,7 @@ else (STANDALONE)
${LIBS_PREBUILT_DIR}/include)
set(GOOGLE_PERFTOOLS_FOUND "YES")
endif (LINUX)
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
if (GOOGLE_PERFTOOLS_FOUND)
# XXX Disable temporarily, until we have compilation issues on 64-bit
diff --git a/indra/cmake/Hunspell.cmake b/indra/cmake/Hunspell.cmake
index 0c9cf93316..ef74d95b2a 100755
--- a/indra/cmake/Hunspell.cmake
+++ b/indra/cmake/Hunspell.cmake
@@ -4,9 +4,9 @@ include(Prebuilt)
set(HUNSPELL_FIND_QUIETLY ON)
set(HUNSPELL_FIND_REQUIRED ON)
-if (STANDALONE)
+if (USESYSTEMLIBS)
include(FindHUNSPELL)
-else (STANDALONE)
+else (USESYSTEMLIBS)
use_prebuilt_binary(libhunspell)
if (WINDOWS)
set(HUNSPELL_LIBRARY libhunspell)
@@ -19,4 +19,4 @@ else (STANDALONE)
endif()
set(HUNSPELL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/hunspell)
use_prebuilt_binary(dictionaries)
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
diff --git a/indra/cmake/JPEG.cmake b/indra/cmake/JPEG.cmake
index 4f99efd602..d6da22aecc 100755
--- a/indra/cmake/JPEG.cmake
+++ b/indra/cmake/JPEG.cmake
@@ -5,9 +5,9 @@ include(Linking)
set(JPEG_FIND_QUIETLY ON)
set(JPEG_FIND_REQUIRED ON)
-if (STANDALONE)
+if (USESYSTEMLIBS)
include(FindJPEG)
-else (STANDALONE)
+else (USESYSTEMLIBS)
use_prebuilt_binary(jpeglib)
if (LINUX)
set(JPEG_LIBRARIES jpeg)
@@ -17,4 +17,4 @@ else (STANDALONE)
set(JPEG_LIBRARIES jpeglib)
endif (LINUX)
set(JPEG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
diff --git a/indra/cmake/JsonCpp.cmake b/indra/cmake/JsonCpp.cmake
index 7ad73e5683..0aab2d6634 100755
--- a/indra/cmake/JsonCpp.cmake
+++ b/indra/cmake/JsonCpp.cmake
@@ -5,9 +5,9 @@ include(Prebuilt)
set(JSONCPP_FIND_QUIETLY ON)
set(JSONCPP_FIND_REQUIRED ON)
-if (STANDALONE)
+if (USESYSTEMLIBS)
include(FindJsonCpp)
-else (STANDALONE)
+else (USESYSTEMLIBS)
use_prebuilt_binary(jsoncpp)
if (WINDOWS)
set(JSONCPP_LIBRARIES
@@ -19,4 +19,4 @@ else (STANDALONE)
set(JSONCPP_LIBRARIES libjson_linux-gcc-4.1.3_libmt.a)
endif (WINDOWS)
set(JSONCPP_INCLUDE_DIR "${LIBS_PREBUILT_DIR}/include/jsoncpp" "${LIBS_PREBUILT_DIR}/include/json")
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake
index 9bb3077797..804624f5ec 100644
--- a/indra/cmake/LLAddBuildTest.cmake
+++ b/indra/cmake/LLAddBuildTest.cmake
@@ -202,16 +202,16 @@ FUNCTION(LL_ADD_INTEGRATION_TEST
ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files})
SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}")
- if(STANDALONE)
+ if(USESYSTEMLIBS)
SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES COMPILE_FLAGS -I"${TUT_INCLUDE_DIR}")
- endif(STANDALONE)
+ endif(USESYSTEMLIBS)
# The following was copied to llcorehttp/CMakeLists.txt's texture_load target.
# Any changes made here should be replicated there.
if (WINDOWS)
SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname}
PROPERTIES
- LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS"
+ LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:CONSOLE"
LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO"
LINK_FLAGS_RELEASE ""
)
@@ -275,10 +275,10 @@ MACRO(SET_TEST_PATH LISTVAR)
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources ${SHARED_LIB_STAGING_DIR}/Release/Resources /usr/lib)
ELSE(WINDOWS)
# Linux uses a single staging directory anyway.
- IF (STANDALONE)
+ IF (USESYSTEMLIBS)
set(${LISTVAR} ${CMAKE_BINARY_DIR}/llcommon /usr/lib /usr/local/lib)
- ELSE (STANDALONE)
+ ELSE (USESYSTEMLIBS)
set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} /usr/lib)
- ENDIF (STANDALONE)
+ ENDIF (USESYSTEMLIBS)
ENDIF(WINDOWS)
ENDMACRO(SET_TEST_PATH)
diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake
index 0d87ff579a..93626f689f 100755
--- a/indra/cmake/LLPrimitive.cmake
+++ b/indra/cmake/LLPrimitive.cmake
@@ -6,7 +6,7 @@ include(Boost)
use_prebuilt_binary(colladadom)
use_prebuilt_binary(pcre)
-use_prebuilt_binary(libxml)
+use_prebuilt_binary(libxml2)
set(LLPRIMITIVE_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llprimitive
@@ -15,14 +15,31 @@ if (WINDOWS)
set(LLPRIMITIVE_LIBRARIES
debug llprimitive
optimized llprimitive
- debug libcollada14dom22-d
- optimized libcollada14dom22
+ debug libcollada14dom23-sd
+ optimized libcollada14dom23-s
+ libxml2_a
+ debug pcrecppd
+ optimized pcrecpp
+ debug pcred
+ optimized pcre
${BOOST_SYSTEM_LIBRARIES}
)
-else (WINDOWS)
+elseif (DARWIN)
set(LLPRIMITIVE_LIBRARIES
llprimitive
- collada14dom
+ debug collada14dom-d
+ optimized collada14dom
+ minizip
+ xml2
+ pcrecpp
+ pcre
+ iconv # Required by libxml2
+ )
+elseif (LINUX)
+ set(LLPRIMITIVE_LIBRARIES
+ llprimitive
+ debug collada14dom-d
+ optimized collada14dom
minizip
xml2
pcrecpp
diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake
index ad732ef650..ba07a80f05 100755
--- a/indra/cmake/LLWindow.cmake
+++ b/indra/cmake/LLWindow.cmake
@@ -4,7 +4,7 @@ include(Variables)
include(GLEXT)
include(Prebuilt)
-if (STANDALONE)
+if (USESYSTEMLIBS)
include(FindSDL)
# This should be done by FindSDL. Sigh.
@@ -13,14 +13,14 @@ if (STANDALONE)
SDL_INCLUDE_DIR
SDL_LIBRARY
)
-else (STANDALONE)
+else (USESYSTEMLIBS)
if (LINUX)
use_prebuilt_binary(SDL)
set (SDL_FOUND TRUE)
set (SDL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/i686-linux)
set (SDL_LIBRARY SDL directfb fusion direct)
endif (LINUX)
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
if (SDL_FOUND)
include_directories(${SDL_INCLUDE_DIR})
diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake
index b9c9e531fc..74fe3f1137 100755
--- a/indra/cmake/Linking.cmake
+++ b/indra/cmake/Linking.cmake
@@ -6,6 +6,7 @@ set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
include(Variables)
set(ARCH_PREBUILT_DIRS ${AUTOBUILD_INSTALL_DIR}/lib)
+set(ARCH_PREBUILT_DIRS_PLUGINS ${AUTOBUILD_INSTALL_DIR}/plugins)
set(ARCH_PREBUILT_DIRS_RELEASE ${AUTOBUILD_INSTALL_DIR}/lib/release)
set(ARCH_PREBUILT_DIRS_DEBUG ${AUTOBUILD_INSTALL_DIR}/lib/debug)
if (WINDOWS)
diff --git a/indra/cmake/NDOF.cmake b/indra/cmake/NDOF.cmake
index be6fe415f2..e72845db53 100755
--- a/indra/cmake/NDOF.cmake
+++ b/indra/cmake/NDOF.cmake
@@ -4,10 +4,10 @@ include(Prebuilt)
set(NDOF ON CACHE BOOL "Use NDOF space navigator joystick library.")
if (NDOF)
- if (STANDALONE)
+ if (USESYSTEMLIBS)
set(NDOF_FIND_REQUIRED ON)
include(FindNDOF)
- else (STANDALONE)
+ else (USESYSTEMLIBS)
use_prebuilt_binary(ndofdev)
if (WINDOWS)
@@ -18,7 +18,7 @@ if (NDOF)
set(NDOF_INCLUDE_DIR ${ARCH_PREBUILT_DIRS}/include/ndofdev)
set(NDOF_FOUND 1)
- endif (STANDALONE)
+ endif (USESYSTEMLIBS)
endif (NDOF)
if (NDOF_FOUND)
diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake
index a3e1fb924e..c084d68de7 100755
--- a/indra/cmake/OPENAL.cmake
+++ b/indra/cmake/OPENAL.cmake
@@ -10,14 +10,14 @@ endif (LINUX)
if (OPENAL)
set(OPENAL_LIB_INCLUDE_DIRS "${LIBS_PREBUILT_DIR}/include/AL")
- if (STANDALONE)
+ if (USESYSTEMLIBS)
include(FindPkgConfig)
include(FindOpenAL)
pkg_check_modules(OPENAL_LIB REQUIRED openal)
pkg_check_modules(FREEALUT_LIB REQUIRED freealut)
- else (STANDALONE)
+ else (USESYSTEMLIBS)
use_prebuilt_binary(openal_soft)
- endif (STANDALONE)
+ endif (USESYSTEMLIBS)
if(WINDOWS)
set(OPENAL_LIBRARIES
OpenAL32
diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake
index fcc82c2f49..bf0bde2ba7 100755
--- a/indra/cmake/OpenJPEG.cmake
+++ b/indra/cmake/OpenJPEG.cmake
@@ -4,9 +4,9 @@ include(Prebuilt)
set(OPENJPEG_FIND_QUIETLY ON)
set(OPENJPEG_FIND_REQUIRED ON)
-if (STANDALONE)
+if (USESYSTEMLIBS)
include(FindOpenJPEG)
-else (STANDALONE)
+else (USESYSTEMLIBS)
use_prebuilt_binary(openjpeg)
if(WINDOWS)
@@ -19,4 +19,4 @@ else (STANDALONE)
endif(WINDOWS)
set(OPENJPEG_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/openjpeg)
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake
index 2704912eb5..eb548bdcc1 100755
--- a/indra/cmake/OpenSSL.cmake
+++ b/indra/cmake/OpenSSL.cmake
@@ -4,20 +4,20 @@ include(Prebuilt)
set(OpenSSL_FIND_QUIETLY ON)
set(OpenSSL_FIND_REQUIRED ON)
-if (STANDALONE)
+if (USESYSTEMLIBS)
include(FindOpenSSL)
-else (STANDALONE)
- use_prebuilt_binary(openSSL)
+else (USESYSTEMLIBS)
+ use_prebuilt_binary(openssl)
if (WINDOWS)
set(OPENSSL_LIBRARIES ssleay32 libeay32)
else (WINDOWS)
set(OPENSSL_LIBRARIES ssl crypto)
endif (WINDOWS)
set(OPENSSL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
if (LINUX)
- set(CRYPTO_LIBRARIES crypto)
+ set(CRYPTO_LIBRARIES crypto dl)
elseif (DARWIN)
set(CRYPTO_LIBRARIES crypto)
endif (LINUX)
diff --git a/indra/cmake/PNG.cmake b/indra/cmake/PNG.cmake
index 913c575672..248a875a19 100755
--- a/indra/cmake/PNG.cmake
+++ b/indra/cmake/PNG.cmake
@@ -4,18 +4,31 @@ include(Prebuilt)
set(PNG_FIND_QUIETLY ON)
set(PNG_FIND_REQUIRED ON)
-if (STANDALONE)
+if (USESYSTEMLIBS)
include(FindPNG)
-else (STANDALONE)
+else (USESYSTEMLIBS)
use_prebuilt_binary(libpng)
if (WINDOWS)
- set(PNG_LIBRARIES libpng15)
- set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng15)
+ set(PNG_LIBRARIES libpng16)
+ set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng16)
elseif(DARWIN)
- set(PNG_LIBRARIES png15)
- set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng15)
+ set(PNG_LIBRARIES png16)
+ set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng16)
else()
- set(PNG_LIBRARIES png15)
- set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng15)
+ #
+ # When we have updated static libraries in competition with older
+ # shared libraries and we want the former to win, we need to do some
+ # extra work. The *_PRELOAD_ARCHIVES settings are invoked early
+ # and will pull in the entire archive to the binary giving it
+ # priority in symbol resolution. Beware of cmake moving the
+ # achive load itself to another place on the link command line. If
+ # that happens, you can try something like -Wl,-lpng16 here to hide
+ # the archive. Also be aware that the linker will not tolerate a
+ # second whole-archive load of the archive. See viewer's
+ # CMakeLists.txt for more information.
+ #
+ set(PNG_PRELOAD_ARCHIVES -Wl,--whole-archive png16 -Wl,--no-whole-archive)
+ set(PNG_LIBRARIES png16)
+ set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/libpng16)
endif()
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake
index ac0cbde253..e548805148 100755
--- a/indra/cmake/Prebuilt.cmake
+++ b/indra/cmake/Prebuilt.cmake
@@ -17,11 +17,11 @@ endif(INSTALL_PROPRIETARY)
# of previous attempts is serialized in the file
# ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
macro (use_prebuilt_binary _binary)
- if (NOT DEFINED STANDALONE_${_binary})
- set(STANDALONE_${_binary} ${STANDALONE})
- endif (NOT DEFINED STANDALONE_${_binary})
+ if (NOT DEFINED USESYSTEMLIBS_${_binary})
+ set(USESYSTEMLIBS_${_binary} ${USESYSTEMLIBS})
+ endif (NOT DEFINED USESYSTEMLIBS_${_binary})
- if (NOT STANDALONE_${_binary})
+ if (NOT USESYSTEMLIBS_${_binary})
if("${${_binary}_installed}" STREQUAL "" AND EXISTS "${CMAKE_BINARY_DIR}/temp/${_binary}_installed")
file(READ ${CMAKE_BINARY_DIR}/temp/${_binary}_installed "${_binary}_installed")
if(DEBUG_PREBUILT)
@@ -52,7 +52,7 @@ macro (use_prebuilt_binary _binary)
"Failed to download or unpack prebuilt '${_binary}'."
" Process returned ${${_binary}_installed}.")
endif (NOT ${_binary}_installed EQUAL 0)
- endif (NOT STANDALONE_${_binary})
+ endif (NOT USESYSTEMLIBS_${_binary})
endmacro (use_prebuilt_binary _binary)
endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
diff --git a/indra/cmake/PulseAudio.cmake b/indra/cmake/PulseAudio.cmake
index 360a971058..cce27f1bdd 100755
--- a/indra/cmake/PulseAudio.cmake
+++ b/indra/cmake/PulseAudio.cmake
@@ -4,7 +4,7 @@ include(Prebuilt)
set(PULSEAUDIO OFF CACHE BOOL "Build with PulseAudio support, if available.")
if (PULSEAUDIO)
- if (STANDALONE)
+ if (USESYSTEMLIBS)
include(FindPkgConfig)
pkg_check_modules(PULSEAUDIO libpulse)
@@ -20,7 +20,7 @@ if (PULSEAUDIO)
set(PULSEAUDIO_LIBRARIES
# none needed!
)
- endif (STANDALONE)
+ endif (USESYSTEMLIBS)
endif (PULSEAUDIO)
if (PULSEAUDIO_FOUND)
diff --git a/indra/cmake/Tut.cmake b/indra/cmake/Tut.cmake
index 7488e9dcb0..e11a3c3314 100755
--- a/indra/cmake/Tut.cmake
+++ b/indra/cmake/Tut.cmake
@@ -1,6 +1,6 @@
# -*- cmake -*-
include(Prebuilt)
-if (NOT STANDALONE)
+if (NOT USESYSTEMLIBS)
use_prebuilt_binary(tut)
-endif(NOT STANDALONE)
+endif(NOT USESYSTEMLIBS)
diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake
index d0fd4df03a..58acdc22bd 100755
--- a/indra/cmake/UI.cmake
+++ b/indra/cmake/UI.cmake
@@ -2,7 +2,7 @@
include(Prebuilt)
include(FreeType)
-if (STANDALONE)
+if (USESYSTEMLIBS)
include(FindPkgConfig)
if (LINUX)
@@ -31,7 +31,7 @@ if (STANDALONE)
list(APPEND UI_LIBRARIES ${${pkg}_LIBRARIES})
add_definitions(${${pkg}_CFLAGS_OTHERS})
endforeach(pkg)
-else (STANDALONE)
+else (USESYSTEMLIBS)
use_prebuilt_binary(gtk-atk-pango-glib)
if (LINUX)
set(UI_LIBRARIES
@@ -59,7 +59,7 @@ else (STANDALONE)
foreach(include ${${LL_ARCH}_INCLUDES})
include_directories(${LIBS_PREBUILT_DIR}/include/${include})
endforeach(include)
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
if (LINUX)
add_definitions(-DLL_GTK=1 -DLL_X11=1)
diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake
index 22d0a7f0fe..963b1bd386 100755
--- a/indra/cmake/Variables.cmake
+++ b/indra/cmake/Variables.cmake
@@ -183,7 +183,7 @@ if (XCODE_VERSION GREATER 4.2)
endif (XCODE_VERSION GREATER 4.2)
set(VERSION_BUILD "0" CACHE STRING "Revision number passed in from the outside")
-set(STANDALONE OFF CACHE BOOL "Do not use Linden-supplied prebuilt libraries.")
+set(USESYSTEMLIBS OFF CACHE BOOL "Use libraries from your system rather than Linden-supplied prebuilt libraries.")
set(UNATTENDED OFF CACHE BOOL "Should be set to ON for building with VC Express editions.")
set(USE_PRECOMPILED_HEADERS ON CACHE BOOL "Enable use of precompiled header directives where supported.")
diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake
index 5b00c989a4..d4be24799f 100755
--- a/indra/cmake/ViewerMiscLibs.cmake
+++ b/indra/cmake/ViewerMiscLibs.cmake
@@ -1,10 +1,10 @@
# -*- cmake -*-
include(Prebuilt)
-if (NOT STANDALONE)
+if (NOT USESYSTEMLIBS)
use_prebuilt_binary(libhunspell)
use_prebuilt_binary(libuuid)
use_prebuilt_binary(slvoice)
use_prebuilt_binary(fontconfig)
-endif(NOT STANDALONE)
+endif(NOT USESYSTEMLIBS)
diff --git a/indra/cmake/WebKitLibPlugin.cmake b/indra/cmake/WebKitLibPlugin.cmake
index d9df78bfc8..f7c548a2fd 100755
--- a/indra/cmake/WebKitLibPlugin.cmake
+++ b/indra/cmake/WebKitLibPlugin.cmake
@@ -1,8 +1,9 @@
# -*- cmake -*-
include(Linking)
include(Prebuilt)
+include(OpenSSL)
-if (STANDALONE)
+if (USESYSTEMLIBS)
# The minimal version, 4.4.3, is rather arbitrary: it's the version in Debian/Lenny.
find_package(Qt4 4.4.3 COMPONENTS QtCore QtGui QtNetwork QtOpenGL QtWebKit REQUIRED)
include(${QT_USE_FILE})
@@ -28,35 +29,40 @@ if (STANDALONE)
list(APPEND QT_PLUGIN_LIBRARIES jpeg)
set(WEBKITLIBPLUGIN OFF CACHE BOOL
"WEBKITLIBPLUGIN support for the llplugin/llmedia test apps.")
-else (STANDALONE)
+else (USESYSTEMLIBS)
use_prebuilt_binary(llqtwebkit)
set(WEBKITLIBPLUGIN ON CACHE BOOL
"WEBKITLIBPLUGIN support for the llplugin/llmedia test apps.")
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
if (WINDOWS)
set(WEBKIT_PLUGIN_LIBRARIES
- debug llqtwebkitd
- debug QtWebKitd4
- debug QtOpenGLd4
- debug QtNetworkd4
- debug QtGuid4
- debug QtCored4
- debug qtmaind
- optimized llqtwebkit
- optimized QtWebKit4
- optimized QtOpenGL4
- optimized QtNetwork4
- optimized QtGui4
- optimized QtCore4
- optimized qtmain
+ debug llqtwebkitd
+ debug QtWebKitd4
+ debug QtOpenGLd4
+ debug QtNetworkd4
+ debug QtGuid4
+ debug QtCored4
+ debug qtmaind
+ optimized llqtwebkit
+ optimized QtWebKit4
+ optimized QtOpenGL4
+ optimized QtNetwork4
+ optimized QtGui4
+ optimized QtCore4
+ optimized qtmain
)
elseif (DARWIN)
set(WEBKIT_PLUGIN_LIBRARIES
- optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib
- debug ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib
- )
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.a
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libQtWebKit.4.dylib
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libQtOpenGL.4.dylib
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libQtNetwork.4.dylib
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libQtGui.4.dylib
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libQtCore.4.dylib
+ )
elseif (LINUX)
+ # *HUH: What does this do?
set(WEBKIT_PLUGIN_LIBRARIES ${LLQTWEBKIT_LIBRARY} ${QT_LIBRARIES} ${QT_PLUGIN_LIBRARIES})
set(WEBKIT_PLUGIN_LIBRARIES
llqtwebkit
@@ -68,9 +74,10 @@ elseif (LINUX)
QtWebKit
QtOpenGL
QtNetwork
+ ${OPENSSL_LIBRARIES}
QtGui
QtCore
- jscore
+# jscore
# qgif
# qjpeg
# jpeg
diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake
index 5bd4848245..3a0caa0a06 100755
--- a/indra/cmake/XmlRpcEpi.cmake
+++ b/indra/cmake/XmlRpcEpi.cmake
@@ -4,9 +4,9 @@ include(Prebuilt)
set(XMLRPCEPI_FIND_QUIETLY ON)
set(XMLRPCEPI_FIND_REQUIRED ON)
-if (STANDALONE)
+if (USESYSTEMLIBS)
include(FindXmlRpcEpi)
-else (STANDALONE)
+else (USESYSTEMLIBS)
use_prebuilt_binary(xmlrpc-epi)
if (WINDOWS)
set(XMLRPCEPI_LIBRARIES
@@ -17,4 +17,4 @@ else (STANDALONE)
set(XMLRPCEPI_LIBRARIES xmlrpc-epi)
endif (WINDOWS)
set(XMLRPCEPI_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
-endif (STANDALONE)
+endif (USESYSTEMLIBS)
diff --git a/indra/cmake/ZLIB.cmake b/indra/cmake/ZLIB.cmake
index 48e5130ad5..6cff0753b2 100755
--- a/indra/cmake/ZLIB.cmake
+++ b/indra/cmake/ZLIB.cmake
@@ -5,18 +5,31 @@ set(ZLIB_FIND_REQUIRED ON)
include(Prebuilt)
-if (STANDALONE)
+if (USESYSTEMLIBS)
include(FindZLIB)
-else (STANDALONE)
+else (USESYSTEMLIBS)
use_prebuilt_binary(zlib)
if (WINDOWS)
set(ZLIB_LIBRARIES
debug zlibd
optimized zlib)
- else (WINDOWS)
+ elseif (LINUX)
+ #
+ # When we have updated static libraries in competition with older
+ # shared libraries and we want the former to win, we need to do some
+ # extra work. The *_PRELOAD_ARCHIVES settings are invoked early
+ # and will pull in the entire archive to the binary giving it
+ # priority in symbol resolution. Beware of cmake moving the
+ # achive load itself to another place on the link command line. If
+ # that happens, you can try something like -Wl,-lz here to hide
+ # the archive. Also be aware that the linker will not tolerate a
+ # second whole-archive load of the archive. See viewer's
+ # CMakeLists.txt for more information.
+ #
+ set(ZLIB_PRELOAD_ARCHIVES -Wl,--whole-archive z -Wl,--no-whole-archive)
+ set(ZLIB_LIBRARIES z)
+ elseif (DARWIN)
set(ZLIB_LIBRARIES z)
endif (WINDOWS)
- if (WINDOWS OR LINUX)
- set(ZLIB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/zlib)
- endif (WINDOWS OR LINUX)
-endif (STANDALONE)
+ set(ZLIB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/zlib)
+endif (USESYSTEMLIBS)
diff --git a/indra/edit-me-to-trigger-new-build.txt b/indra/edit-me-to-trigger-new-build.txt
index beeb570496..6f2087d580 100755
--- a/indra/edit-me-to-trigger-new-build.txt
+++ b/indra/edit-me-to-trigger-new-build.txt
@@ -1,7 +1,2 @@
-Wed Nov 7 00:25:19 UTC 2012
-
-
-
-
-
+2014-02-25 10:34
diff --git a/indra/integration_tests/llimage_libtest/CMakeLists.txt b/indra/integration_tests/llimage_libtest/CMakeLists.txt
index 36a7d38bb7..8a83ac498f 100755
--- a/indra/integration_tests/llimage_libtest/CMakeLists.txt
+++ b/indra/integration_tests/llimage_libtest/CMakeLists.txt
@@ -7,6 +7,7 @@ project (llimage_libtest)
include(00-Common)
include(LLCommon)
include(LLImage)
+include(LLMath)
include(LLImageJ2COJ)
include(LLKDU)
include(LLVFS)
@@ -15,6 +16,7 @@ include_directories(
${LLCOMMON_INCLUDE_DIRS}
${LLVFS_INCLUDE_DIRS}
${LLIMAGE_INCLUDE_DIRS}
+ ${LLMATH_INCLUDE_DIRS}
)
include_directories(SYSTEM
${LLCOMMON_SYSTEM_INCLUDE_DIRS}
@@ -64,6 +66,7 @@ endif (DARWIN)
target_link_libraries(llimage_libtest
${LLCOMMON_LIBRARIES}
${LLVFS_LIBRARIES}
+ ${LLMATH_LIBRARIES}
${LLIMAGE_LIBRARIES}
${LLKDU_LIBRARIES}
${KDU_LIBRARY}
diff --git a/indra/integration_tests/llimage_libtest/filters/1970colorize.xml b/indra/integration_tests/llimage_libtest/filters/1970colorize.xml
new file mode 100644
index 0000000000..0dab2489a0
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/1970colorize.xml
@@ -0,0 +1,41 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>contrast</string>
+ <real>0.8</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.5</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>blend</string>
+ <real>10.0</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.1</real>
+ <real>0.1</real>
+ <real>0.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/autocontrast.xml b/indra/integration_tests/llimage_libtest/filters/autocontrast.xml
new file mode 100755
index 0000000000..ec3d7561bd
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/autocontrast.xml
@@ -0,0 +1,11 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.01</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/badtrip.xml b/indra/integration_tests/llimage_libtest/filters/badtrip.xml
new file mode 100755
index 0000000000..14ee0baff3
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/badtrip.xml
@@ -0,0 +1,36 @@
+<llsd>
+ <array>
+ <array>
+ <string>grayscale</string>
+ </array>
+ <array>
+ <string>linearize</string>
+ <real>0.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>posterize</string>
+ <real>10.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>gradient</string>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>0.15</real>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/blowhighlights.xml b/indra/integration_tests/llimage_libtest/filters/blowhighlights.xml
new file mode 100644
index 0000000000..2474a1b953
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/blowhighlights.xml
@@ -0,0 +1,25 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>uniform</string>
+ <string>add</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>gamma</string>
+ <real>0.25</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/blur.xml b/indra/integration_tests/llimage_libtest/filters/blur.xml
new file mode 100644
index 0000000000..addd056855
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/blur.xml
@@ -0,0 +1,7 @@
+<llsd>
+ <array>
+ <array>
+ <string>blur</string>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/brighten.xml b/indra/integration_tests/llimage_libtest/filters/brighten.xml
new file mode 100755
index 0000000000..9b4232229f
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/brighten.xml
@@ -0,0 +1,11 @@
+<llsd>
+ <array>
+ <array>
+ <string>brighten</string>
+ <real>0.5</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/colorize.xml b/indra/integration_tests/llimage_libtest/filters/colorize.xml
new file mode 100644
index 0000000000..72e58b0ffe
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/colorize.xml
@@ -0,0 +1,24 @@
+<llsd>
+ <array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>blend</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>10.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>0.5</real>
+ <real>0.5</real>
+ <real>0.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/colortransform.xml b/indra/integration_tests/llimage_libtest/filters/colortransform.xml
new file mode 100644
index 0000000000..de4bebcce2
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/colortransform.xml
@@ -0,0 +1,16 @@
+<llsd>
+ <array>
+ <array>
+ <string>colortransform</string>
+ <real>0.2125</real>
+ <real>0.7154</real>
+ <real>0.0721</real>
+ <real>0.2125</real>
+ <real>0.7154</real>
+ <real>0.0721</real>
+ <real>0.2125</real>
+ <real>0.7154</real>
+ <real>0.0721</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/contrast.xml b/indra/integration_tests/llimage_libtest/filters/contrast.xml
new file mode 100644
index 0000000000..00746b8a9e
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/contrast.xml
@@ -0,0 +1,11 @@
+<llsd>
+ <array>
+ <array>
+ <string>contrast</string>
+ <real>1.5</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/convolve.xml b/indra/integration_tests/llimage_libtest/filters/convolve.xml
new file mode 100644
index 0000000000..6e65b5f88a
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/convolve.xml
@@ -0,0 +1,18 @@
+<llsd>
+ <array>
+ <array>
+ <string>convolve</string>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>4.0</real>
+ <real>1.0</real>
+ <real>4.0</real>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>4.0</real>
+ <real>1.0</real>
+ <real>4.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/darken.xml b/indra/integration_tests/llimage_libtest/filters/darken.xml
new file mode 100755
index 0000000000..5cec3589b6
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/darken.xml
@@ -0,0 +1,11 @@
+<llsd>
+ <array>
+ <array>
+ <string>darken</string>
+ <real>0.5</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/dodgeandburn.xml b/indra/integration_tests/llimage_libtest/filters/dodgeandburn.xml
new file mode 100644
index 0000000000..0e2e0ad68c
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/dodgeandburn.xml
@@ -0,0 +1,47 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>add</string>
+ <real>0.0</real>
+ <real>0.4</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>2.0</real>
+ </array>
+ <array>
+ <string>contrast</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>add</string>
+ <real>-0.8</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>2.0</real>
+ </array>
+ <array>
+ <string>contrast</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/edges.xml b/indra/integration_tests/llimage_libtest/filters/edges.xml
new file mode 100644
index 0000000000..a66b81d01e
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/edges.xml
@@ -0,0 +1,24 @@
+<llsd>
+ <array>
+ <array>
+ <string>gradient</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>linearize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>contrast</string>
+ <real>2.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/focus.xml b/indra/integration_tests/llimage_libtest/filters/focus.xml
new file mode 100644
index 0000000000..d8525fea62
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/focus.xml
@@ -0,0 +1,39 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>blend</string>
+ <real>0.0</real>
+ <real>0.4</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>0.5</real>
+ <real>2.0</real>
+ </array>
+ <array>
+ <string>sharpen</string>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>blend</string>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>0.5</real>
+ <real>2.0</real>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/gamma.xml b/indra/integration_tests/llimage_libtest/filters/gamma.xml
new file mode 100644
index 0000000000..19af09b046
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/gamma.xml
@@ -0,0 +1,11 @@
+<llsd>
+ <array>
+ <array>
+ <string>gamma</string>
+ <real>1.7</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/grayscale.xml b/indra/integration_tests/llimage_libtest/filters/grayscale.xml
new file mode 100644
index 0000000000..984312c4fd
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/grayscale.xml
@@ -0,0 +1,14 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>grayscale</string>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/heatwave.xml b/indra/integration_tests/llimage_libtest/filters/heatwave.xml
new file mode 100644
index 0000000000..a99f41c833
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/heatwave.xml
@@ -0,0 +1,38 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>contrast</string>
+ <real>0.8</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>fade</string>
+ <real>0.5</real>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>4.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>0.4</real>
+ <real>0.0</real>
+ <real>0.2</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/horizontalscreen.xml b/indra/integration_tests/llimage_libtest/filters/horizontalscreen.xml
new file mode 100644
index 0000000000..21cab70e54
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/horizontalscreen.xml
@@ -0,0 +1,20 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>grayscale</string>
+ </array>
+ <array>
+ <string>screen</string>
+ <string>line</string>
+ <real>0.015</real>
+ <real>0.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/julesverne.xml b/indra/integration_tests/llimage_libtest/filters/julesverne.xml
new file mode 100644
index 0000000000..981e221da9
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/julesverne.xml
@@ -0,0 +1,20 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>grayscale</string>
+ </array>
+ <array>
+ <string>screen</string>
+ <string>line</string>
+ <real>0.02</real>
+ <real>0.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/lensflare.xml b/indra/integration_tests/llimage_libtest/filters/lensflare.xml
new file mode 100644
index 0000000000..0b5af9c82b
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/lensflare.xml
@@ -0,0 +1,131 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.01</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>gradient</string>
+ <string>add</string>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>-1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>-1.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.1</real>
+ <real>0.1</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>add</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>-1.0</real>
+ <real>1.0</real>
+ <real>1.5</real>
+ <real>5.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.6</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>add</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>-1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>5.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.6</real>
+ <real>0.6</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>add</string>
+ <real>0.0</real>
+ <real>0.5</real>
+ <real>0.5</real>
+ <real>-0.5</real>
+ <real>0.10</real>
+ <real>20.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.7</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>add</string>
+ <real>0.0</real>
+ <real>0.5</real>
+ <real>0.6</real>
+ <real>-0.6</real>
+ <real>0.05</real>
+ <real>20.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.7</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>add</string>
+ <real>0.0</real>
+ <real>0.5</real>
+ <real>0.4</real>
+ <real>-0.4</real>
+ <real>0.025</real>
+ <real>20.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.7</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/lightleak.xml b/indra/integration_tests/llimage_libtest/filters/lightleak.xml
new file mode 100755
index 0000000000..6fe496506e
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/lightleak.xml
@@ -0,0 +1,78 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.01</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>brighten</string>
+ <real>0.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>gradient</string>
+ <string>add</string>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>-1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>-1.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.1</real>
+ <real>0.1</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>add</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>-1.0</real>
+ <real>1.0</real>
+ <real>1.5</real>
+ <real>5.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.8</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>add</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>-1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>5.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.8</real>
+ <real>0.8</real>
+ <real>0.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/linearize.xml b/indra/integration_tests/llimage_libtest/filters/linearize.xml
new file mode 100755
index 0000000000..23d0290e07
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/linearize.xml
@@ -0,0 +1,11 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/miniature.xml b/indra/integration_tests/llimage_libtest/filters/miniature.xml
new file mode 100755
index 0000000000..9aa8a87c6f
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/miniature.xml
@@ -0,0 +1,118 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.02</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>contrast</string>
+ <real>1.02</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>saturate</string>
+ <real>1.2</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>blend</string>
+ <real>0.0</real>
+ <real>0.25</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>0.25</real>
+ <real>2.0</real>
+ </array>
+ <array>
+ <string>sharpen</string>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>gradient</string>
+ <string>blend</string>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>-1.0</real>
+ <real>0.0</real>
+ <real>-0.25</real>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>gradient</string>
+ <string>blend</string>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.25</real>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ </array>
+</llsd> \ No newline at end of file
diff --git a/indra/integration_tests/llimage_libtest/filters/newsscreen.xml b/indra/integration_tests/llimage_libtest/filters/newsscreen.xml
new file mode 100755
index 0000000000..50ed27c6db
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/newsscreen.xml
@@ -0,0 +1,20 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>grayscale</string>
+ </array>
+ <array>
+ <string>screen</string>
+ <string>2Dsine</string>
+ <real>0.015</real>
+ <real>0.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/overcast.xml b/indra/integration_tests/llimage_libtest/filters/overcast.xml
new file mode 100644
index 0000000000..dce5ab3e9e
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/overcast.xml
@@ -0,0 +1,24 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.3</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>saturate</string>
+ <real>0.35</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/pixelate.xml b/indra/integration_tests/llimage_libtest/filters/pixelate.xml
new file mode 100755
index 0000000000..f643419aa0
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/pixelate.xml
@@ -0,0 +1,35 @@
+<llsd>
+ <array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>darken</string>
+ <real>0.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>contrast</string>
+ <real>0.9</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>linearize</string>
+ <real>0.01</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>posterize</string>
+ <real>4.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd> \ No newline at end of file
diff --git a/indra/integration_tests/llimage_libtest/filters/posterize.xml b/indra/integration_tests/llimage_libtest/filters/posterize.xml
new file mode 100755
index 0000000000..4d03df3c66
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/posterize.xml
@@ -0,0 +1,11 @@
+<llsd>
+ <array>
+ <array>
+ <string>posterize</string>
+ <real>10.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/rotatecolors180.xml b/indra/integration_tests/llimage_libtest/filters/rotatecolors180.xml
new file mode 100644
index 0000000000..e25029720f
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/rotatecolors180.xml
@@ -0,0 +1,8 @@
+<llsd>
+ <array>
+ <array>
+ <string>rotate</string>
+ <real>180.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/saturate.xml b/indra/integration_tests/llimage_libtest/filters/saturate.xml
new file mode 100644
index 0000000000..b77f07a037
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/saturate.xml
@@ -0,0 +1,8 @@
+<llsd>
+ <array>
+ <array>
+ <string>saturate</string>
+ <real>3.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/sepia.xml b/indra/integration_tests/llimage_libtest/filters/sepia.xml
new file mode 100644
index 0000000000..0304ead015
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/sepia.xml
@@ -0,0 +1,14 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>sepia</string>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/sharpen.xml b/indra/integration_tests/llimage_libtest/filters/sharpen.xml
new file mode 100644
index 0000000000..6d3f9ae1a2
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/sharpen.xml
@@ -0,0 +1,7 @@
+<llsd>
+ <array>
+ <array>
+ <string>sharpen</string>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/slantedscreen.xml b/indra/integration_tests/llimage_libtest/filters/slantedscreen.xml
new file mode 100644
index 0000000000..6cd1a96185
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/slantedscreen.xml
@@ -0,0 +1,20 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>grayscale</string>
+ </array>
+ <array>
+ <string>screen</string>
+ <string>line</string>
+ <real>0.015</real>
+ <real>45.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/spotlight.xml b/indra/integration_tests/llimage_libtest/filters/spotlight.xml
new file mode 100644
index 0000000000..203130bdee
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/spotlight.xml
@@ -0,0 +1,45 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>contrast</string>
+ <real>0.8</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>saturate</string>
+ <real>1.5</real>
+ </array>
+ <array>
+ <string>fade</string>
+ <real>1.0</real>
+ <real>0.25</real>
+ </array>
+ <array>
+ <string>saturate</string>
+ <real>0.8</real>
+ </array>
+ <array>
+ <string>contrast</string>
+ <real>1.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>brighten</string>
+ <real>30</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/stencilgradient.xml b/indra/integration_tests/llimage_libtest/filters/stencilgradient.xml
new file mode 100644
index 0000000000..d22809a9bf
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/stencilgradient.xml
@@ -0,0 +1,24 @@
+<llsd>
+ <array>
+ <array>
+ <string>stencil</string>
+ <string>gradient</string>
+ <string>blend</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>-1.0</real>
+ <real>0.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/stencilscanlines.xml b/indra/integration_tests/llimage_libtest/filters/stencilscanlines.xml
new file mode 100644
index 0000000000..3ce428503d
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/stencilscanlines.xml
@@ -0,0 +1,22 @@
+<llsd>
+ <array>
+ <array>
+ <string>stencil</string>
+ <string>scanlines</string>
+ <string>blend</string>
+ <real>0.0</real>
+ <real>0.5</real>
+ <real>0.1</real>
+ <real>45.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/stenciluniform.xml b/indra/integration_tests/llimage_libtest/filters/stenciluniform.xml
new file mode 100644
index 0000000000..7d72f0ed93
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/stenciluniform.xml
@@ -0,0 +1,20 @@
+<llsd>
+ <array>
+ <array>
+ <string>stencil</string>
+ <string>uniform</string>
+ <string>blend</string>
+ <real>0.0</real>
+ <real>0.5</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/stencilvignette.xml b/indra/integration_tests/llimage_libtest/filters/stencilvignette.xml
new file mode 100644
index 0000000000..d30637fef5
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/stencilvignette.xml
@@ -0,0 +1,24 @@
+<llsd>
+ <array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>blend</string>
+ <real>0.0</real>
+ <real>0.5</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>10.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/thematrix.xml b/indra/integration_tests/llimage_libtest/filters/thematrix.xml
new file mode 100755
index 0000000000..af9a5eced8
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/thematrix.xml
@@ -0,0 +1,42 @@
+<llsd>
+ <array>
+ <array>
+ <string>grayscale</string>
+ </array>
+ <array>
+ <string>linearize</string>
+ <real>0.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>posterize</string>
+ <real>50.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>gradient</string>
+ </array>
+ <array>
+ <string>screen</string>
+ <string>line</string>
+ <real>0.025</real>
+ <real>90.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.1</real>
+ <real>0.2</real>
+ <real>0.2</real>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ </array>
+</llsd> \ No newline at end of file
diff --git a/indra/integration_tests/llimage_libtest/filters/toycamera.xml b/indra/integration_tests/llimage_libtest/filters/toycamera.xml
new file mode 100755
index 0000000000..4e76f6b2fb
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/toycamera.xml
@@ -0,0 +1,46 @@
+<llsd>
+ <array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>fade</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>1.2</real>
+ <real>3.0</real>
+ </array>
+ <array>
+ <string>linearize</string>
+ <real>0.05</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>grayscale</string>
+ </array>
+ <array>
+ <string>contrast</string>
+ <real>1.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>blend</string>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>0.5</real>
+ <real>2.0</real>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ </array>
+</llsd> \ No newline at end of file
diff --git a/indra/integration_tests/llimage_libtest/filters/verticalscreen.xml b/indra/integration_tests/llimage_libtest/filters/verticalscreen.xml
new file mode 100644
index 0000000000..0768d1d7e1
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/verticalscreen.xml
@@ -0,0 +1,20 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>grayscale</string>
+ </array>
+ <array>
+ <string>screen</string>
+ <string>line</string>
+ <real>0.015</real>
+ <real>90.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/filters/video.xml b/indra/integration_tests/llimage_libtest/filters/video.xml
new file mode 100755
index 0000000000..fe17f3950a
--- /dev/null
+++ b/indra/integration_tests/llimage_libtest/filters/video.xml
@@ -0,0 +1,44 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>darken</string>
+ <real>0.15</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>uniform</string>
+ <string>add</string>
+ <real>0.0</real>
+ <real>0.5</real>
+ </array>
+ <array>
+ <string>screen</string>
+ <string>line</string>
+ <real>0.02</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>gamma</string>
+ <real>0.25</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp
index 034c816742..3d27b4a5b5 100755
--- a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp
+++ b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp
@@ -32,6 +32,7 @@
// Linden library includes
#include "llimage.h"
+#include "llimagefilter.h"
#include "llimagejpeg.h"
#include "llimagepng.h"
#include "llimagebmp.h"
@@ -39,6 +40,8 @@
#include "llimagej2c.h"
#include "lldir.h"
#include "lldiriterator.h"
+#include "v4coloru.h"
+#include "llsdserialize.h"
// system libraries
#include <iostream>
@@ -83,6 +86,8 @@ static const char USAGE[] = "\n"
" -rev, --reversible\n"
" Set the compression to be lossless (reversible in j2c parlance).\n"
" Only valid for output j2c images.\n"
+" -f, --filter <file>\n"
+" Apply the filter <file> to the input images.\n"
" -log, --logmetrics <metric>\n"
" Log performance data for <metric>. Results in <metric>.slp\n"
" Note: so far, only ImageCompressionTester has been tested.\n"
@@ -99,7 +104,7 @@ static bool sAllDone = false;
// Create an empty formatted image instance of the correct type from the filename
LLPointer<LLImageFormatted> create_image(const std::string &filename)
{
- std::string exten = gDirUtilp->getExtension(filename);
+ std::string exten = gDirUtilp->getExtension(filename);
LLPointer<LLImageFormatted> image = LLImageFormatted::createFromExtension(exten);
return image;
}
@@ -350,6 +355,7 @@ int main(int argc, char** argv)
int blocks_size = -1;
int levels = 0;
bool reversible = false;
+ std::string filter_name = "";
// Init whatever is necessary
ll_init_apr();
@@ -523,7 +529,26 @@ int main(int argc, char** argv)
break;
}
}
- else if (!strcmp(argv[arg], "--analyzeperformance") || !strcmp(argv[arg], "-a"))
+ else if (!strcmp(argv[arg], "--filter") || !strcmp(argv[arg], "-f"))
+ {
+ // '--filter' needs to be specified with a named filter argument
+ if ((arg + 1) < argc)
+ {
+ filter_name = argv[arg+1];
+ }
+ if (((arg + 1) >= argc) || (filter_name[0] == '-'))
+ {
+ // We don't have an argument left in the arg list or the next argument is another option
+ std::cout << "No --filter argument given, no filter will be applied" << std::endl;
+ }
+ else
+ {
+ arg += 1; // Skip that arg now we know it's a valid test name
+ if ((arg + 1) == argc) // Break out of the loop if we reach the end of the arg list
+ break;
+ }
+ }
+ else if (!strcmp(argv[arg], "--analyzeperformance") || !strcmp(argv[arg], "-a"))
{
analyze_performance = true;
}
@@ -553,7 +578,10 @@ int main(int argc, char** argv)
fast_timer_log_thread = new LogThread(LLFastTimer::sLogName);
fast_timer_log_thread->start();
}
-
+
+ // Load the filter once and for all
+ LLImageFilter filter(filter_name);
+
// Perform action on each input file
std::list<std::string>::iterator in_file = input_filenames.begin();
std::list<std::string>::iterator out_file = output_filenames.begin();
@@ -568,7 +596,10 @@ int main(int argc, char** argv)
std::cout << "Error: Image " << *in_file << " could not be loaded" << std::endl;
continue;
}
-
+
+ // Apply the filter
+ filter.executeFilter(raw_image);
+
// Save file
if (out_file != out_end)
{
diff --git a/indra/integration_tests/llui_libtest/llui_libtest.cpp b/indra/integration_tests/llui_libtest/llui_libtest.cpp
index 38aa1bbeb2..a0418f09d5 100755
--- a/indra/integration_tests/llui_libtest/llui_libtest.cpp
+++ b/indra/integration_tests/llui_libtest/llui_libtest.cpp
@@ -182,7 +182,7 @@ void export_test_floaters()
// don't re-export other test floaters
continue;
}
- llinfos << "Converting " << filename << llendl;
+ LL_INFOS() << "Converting " << filename << LL_ENDL;
// Build a floater and output new attributes
LLXMLNodePtr output_node = new LLXMLNode();
LLFloater* floater = new LLFloater(LLSD());
@@ -194,7 +194,7 @@ void export_test_floaters()
out_filename.resize(extension_pos);
out_filename += "_new.xml";
- llinfos << "Output: " << out_filename << llendl;
+ LL_INFOS() << "Output: " << out_filename << LL_ENDL;
LLFILE* floater_file = LLFile::fopen(out_filename.c_str(), "w");
LLXMLNode::writeHeaderToFile(floater_file);
output_node->writeToFile(floater_file);
diff --git a/indra/linux_crash_logger/linux_crash_logger.cpp b/indra/linux_crash_logger/linux_crash_logger.cpp
index d4e7ad7be3..36f62451d7 100755
--- a/indra/linux_crash_logger/linux_crash_logger.cpp
+++ b/indra/linux_crash_logger/linux_crash_logger.cpp
@@ -30,7 +30,7 @@
int main(int argc, char **argv)
{
- llinfos << "Starting crash reporter." << llendl;
+ LL_INFOS() << "Starting crash reporter." << LL_ENDL;
LLCrashLoggerLinux app;
app.parseCommandOptions(argc, argv);
@@ -47,12 +47,12 @@ int main(int argc, char **argv)
if (! app.init())
{
- llwarns << "Unable to initialize application." << llendl;
+ LL_WARNS() << "Unable to initialize application." << LL_ENDL;
return 1;
}
app.mainLoop();
app.cleanup();
- llinfos << "Crash reporter finished normally." << llendl;
+ LL_INFOS() << "Crash reporter finished normally." << LL_ENDL;
return 0;
}
diff --git a/indra/linux_crash_logger/llcrashloggerlinux.cpp b/indra/linux_crash_logger/llcrashloggerlinux.cpp
index 871d6377cb..e2d2e7ff26 100755
--- a/indra/linux_crash_logger/llcrashloggerlinux.cpp
+++ b/indra/linux_crash_logger/llcrashloggerlinux.cpp
@@ -71,7 +71,7 @@ static BOOL do_ask_dialog(void)
#if LL_GTK
gtk_disable_setlocale();
if (!gtk_init_check(NULL, NULL)) {
- llinfos << "Could not initialize GTK for 'ask to send crash report' dialog; not sending report." << llendl;
+ LL_INFOS() << "Could not initialize GTK for 'ask to send crash report' dialog; not sending report." << LL_ENDL;
return FALSE;
}
diff --git a/indra/linux_updater/CMakeLists.txt b/indra/linux_updater/CMakeLists.txt
deleted file mode 100644
index 4a9e82f9b6..0000000000
--- a/indra/linux_updater/CMakeLists.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-# -*- cmake -*-
-
-project(linux_updater)
-
-include(00-Common)
-include(CURL)
-include(CARes)
-include(OpenSSL)
-include(UI)
-include(LLCommon)
-include(LLMessage)
-include(LLVFS)
-include(LLXML)
-include(LLUI)
-include(Linking)
-
-include_directories(
- ${LLCOMMON_INCLUDE_DIRS}
- ${LLVFS_INCLUDE_DIRS}
- ${LLXML_INCLUDE_DIRS}
- ${LLUI_INCLUDE_DIRS}
- ${CURL_INCLUDE_DIRS}
- ${CARES_INCLUDE_DIRS}
- ${OPENSSL_INCLUDE_DIRS}
- ${UI_INCLUDE_DIRS}
- )
-include_directories(SYSTEM
- ${LLCOMMON_SYSTEM_INCLUDE_DIRS}
- ${LLXML_SYSTEM_INCLUDE_DIRS}
- )
-
-set(linux_updater_SOURCE_FILES linux_updater.cpp)
-
-set(linux_updater_HEADER_FILES CMakeLists.txt)
-
-set_source_files_properties(${linux_updater_HEADER_FILES}
- PROPERTIES HEADER_FILES_ONLY TRUE)
-
-list(APPEND linux_updater_SOURCE_FILES ${linux_updater_HEADER_FILES})
-
-add_executable(linux-updater ${linux_updater_SOURCE_FILES})
-
-target_link_libraries(linux-updater
- ${CURL_LIBRARIES}
- ${CARES_LIBRARIES}
- ${OPENSSL_LIBRARIES}
- ${CRYPTO_LIBRARIES}
- ${LLMESSAGE_LIBRARIES}
- ${UI_LIBRARIES}
- ${LLXML_LIBRARIES}
- ${LLUI_LIBRARIES}
- ${LLVFS_LIBRARIES}
- ${LLCOMMON_LIBRARIES}
- )
-
-add_custom_target(linux-updater-target ALL
- DEPENDS linux-updater)
diff --git a/indra/linux_updater/linux_updater.cpp b/indra/linux_updater/linux_updater.cpp
deleted file mode 100644
index 86fa596aef..0000000000
--- a/indra/linux_updater/linux_updater.cpp
+++ /dev/null
@@ -1,924 +0,0 @@
-/**
- * @file linux_updater.cpp
- * @author Kyle Ambroff <ambroff@lindenlab.com>, Tofu Linden
- * @brief Viewer update program for unix platforms that support GTK+
- *
- * $LicenseInfo:firstyear=2008&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include <unistd.h>
-#include <signal.h>
-#include <errno.h>
-
-#include "linden_common.h"
-#include "llerrorcontrol.h"
-#include "llfile.h"
-#include "lldir.h"
-#include "lldiriterator.h"
-
-/*==========================================================================*|
-// IQA-490: Use of LLTrans -- by this program at least -- appears to be buggy.
-// With it, the 3.3.2 beta 1 linux-updater.bin crashes; without it seems stable.
-#include "llxmlnode.h"
-#include "lltrans.h"
-|*==========================================================================*/
-
-static class LLTrans
-{
-public:
- LLTrans();
- static std::string getString(const std::string& key);
-
-private:
- std::string _getString(const std::string& key) const;
-
- typedef std::map<std::string, std::string> MessageMap;
- MessageMap mMessages;
-} sLLTransInstance;
-
-#include <curl/curl.h>
-#include <map>
-#include <boost/foreach.hpp>
-
-extern "C" {
-#include <gtk/gtk.h>
-}
-
-const guint UPDATE_PROGRESS_TIMEOUT = 100;
-const guint UPDATE_PROGRESS_TEXT_TIMEOUT = 1000;
-const guint ROTATE_IMAGE_TIMEOUT = 8000;
-
-typedef struct _updater_app_state {
- std::string app_name;
- std::string url;
- std::string file;
- std::string image_dir;
- std::string dest_dir;
- std::string strings_dirs;
- std::string strings_file;
-
- LLDirIterator *image_dir_iter;
-
- GtkWidget *window;
- GtkWidget *progress_bar;
- GtkWidget *image;
-
- double progress_value;
- bool activity_mode;
-
- guint image_rotation_timeout_id;
- guint progress_update_timeout_id;
- guint update_progress_text_timeout_id;
-
- bool failure;
-} UpdaterAppState;
-
-// List of entries from strings.xml to always replace
-static std::set<std::string> default_trans_args;
-void init_default_trans_args()
-{
- default_trans_args.insert("SECOND_LIFE"); // World
- default_trans_args.insert("APP_NAME");
- default_trans_args.insert("SECOND_LIFE_GRID");
- default_trans_args.insert("SUPPORT_SITE");
-}
-
-bool translate_init(std::string comma_delim_path_list,
- std::string base_xml_name)
-{
- return true;
-/*==========================================================================*|
- init_default_trans_args();
-
- // extract paths string vector from comma-delimited flat string
- std::vector<std::string> paths;
- LLStringUtil::getTokens(comma_delim_path_list, paths, ","); // split over ','
-
- for(std::vector<std::string>::iterator it = paths.begin(), end_it = paths.end();
- it != end_it;
- ++it)
- {
- (*it) = gDirUtilp->findSkinnedFilename(*it, base_xml_name);
- }
-
- // suck the translation xml files into memory
- LLXMLNodePtr root;
- bool success = LLXMLNode::getLayeredXMLNode(root, paths);
- if (!success)
- {
- // couldn't load string table XML
- return false;
- }
- else
- {
- // get those strings out of the XML
- LLTrans::parseStrings(root, default_trans_args);
- return true;
- }
-|*==========================================================================*/
-}
-
-
-void updater_app_ui_init(void);
-void updater_app_quit(UpdaterAppState *app_state);
-void parse_args_and_init(int argc, char **argv, UpdaterAppState *app_state);
-std::string next_image_filename(std::string& image_path, LLDirIterator& iter);
-void display_error(GtkWidget *parent, std::string title, std::string message);
-BOOL install_package(std::string package_file, std::string destination);
-BOOL spawn_viewer(UpdaterAppState *app_state);
-
-extern "C" {
- void on_window_closed(GtkWidget *sender, GdkEvent *event, gpointer state);
- gpointer worker_thread_cb(gpointer *data);
- int download_progress_cb(gpointer data, double t, double d, double utotal, double ulnow);
- gboolean rotate_image_cb(gpointer data);
- gboolean progress_update_timeout(gpointer data);
- gboolean update_progress_text_timeout(gpointer data);
-}
-
-void updater_app_ui_init(UpdaterAppState *app_state)
-{
- GtkWidget *vbox;
- GtkWidget *summary_label;
- GtkWidget *description_label;
- GtkWidget *frame;
-
- llassert(app_state != NULL);
-
- // set up window and main container
- std::string window_title = LLTrans::getString("UpdaterWindowTitle");
- app_state->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- gtk_window_set_title(GTK_WINDOW(app_state->window),
- window_title.c_str());
- gtk_window_set_resizable(GTK_WINDOW(app_state->window), FALSE);
- gtk_window_set_position(GTK_WINDOW(app_state->window),
- GTK_WIN_POS_CENTER_ALWAYS);
-
- gtk_container_set_border_width(GTK_CONTAINER(app_state->window), 12);
- g_signal_connect(G_OBJECT(app_state->window), "delete-event",
- G_CALLBACK(on_window_closed), app_state);
-
- vbox = gtk_vbox_new(FALSE, 6);
- gtk_container_add(GTK_CONTAINER(app_state->window), vbox);
-
- // set top label
- std::ostringstream label_ostr;
- label_ostr << "<big><b>"
- << LLTrans::getString("UpdaterNowUpdating")
- << "</b></big>";
-
- summary_label = gtk_label_new(NULL);
- gtk_label_set_use_markup(GTK_LABEL(summary_label), TRUE);
- gtk_label_set_markup(GTK_LABEL(summary_label),
- label_ostr.str().c_str());
- gtk_misc_set_alignment(GTK_MISC(summary_label), 0, 0.5);
- gtk_box_pack_start(GTK_BOX(vbox), summary_label, FALSE, FALSE, 0);
-
- // create the description label
- description_label = gtk_label_new(LLTrans::getString("UpdaterUpdatingDescriptive").c_str());
- gtk_label_set_line_wrap(GTK_LABEL(description_label), TRUE);
- gtk_misc_set_alignment(GTK_MISC(description_label), 0, 0.5);
- gtk_box_pack_start(GTK_BOX(vbox), description_label, FALSE, FALSE, 0);
-
- // If an image path has been set, load the background images
- if (!app_state->image_dir.empty()) {
- frame = gtk_frame_new(NULL);
- gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
- gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
-
- // load the first image
- app_state->image = gtk_image_new_from_file
- (next_image_filename(app_state->image_dir, *app_state->image_dir_iter).c_str());
- gtk_widget_set_size_request(app_state->image, 340, 310);
- gtk_container_add(GTK_CONTAINER(frame), app_state->image);
-
- // rotate the images every 5 seconds
- app_state->image_rotation_timeout_id = g_timeout_add
- (ROTATE_IMAGE_TIMEOUT, rotate_image_cb, app_state);
- }
-
- // set up progress bar, and update it roughly every 1/10 of a second
- app_state->progress_bar = gtk_progress_bar_new();
- gtk_progress_bar_set_text(GTK_PROGRESS_BAR(app_state->progress_bar),
- LLTrans::getString("UpdaterProgressBarTextWithEllipses").c_str());
- gtk_box_pack_start(GTK_BOX(vbox),
- app_state->progress_bar, FALSE, TRUE, 0);
- app_state->progress_update_timeout_id = g_timeout_add
- (UPDATE_PROGRESS_TIMEOUT, progress_update_timeout, app_state);
- app_state->update_progress_text_timeout_id = g_timeout_add
- (UPDATE_PROGRESS_TEXT_TIMEOUT, update_progress_text_timeout, app_state);
-
- gtk_widget_show_all(app_state->window);
-}
-
-gboolean rotate_image_cb(gpointer data)
-{
- UpdaterAppState *app_state;
- std::string filename;
-
- llassert(data != NULL);
- app_state = (UpdaterAppState *) data;
-
- filename = next_image_filename(app_state->image_dir, *app_state->image_dir_iter);
-
- gdk_threads_enter();
- gtk_image_set_from_file(GTK_IMAGE(app_state->image), filename.c_str());
- gdk_threads_leave();
-
- return TRUE;
-}
-
-std::string next_image_filename(std::string& image_path, LLDirIterator& iter)
-{
- std::string image_filename;
- iter.next(image_filename);
- return gDirUtilp->add(image_path, image_filename);
-}
-
-void on_window_closed(GtkWidget *sender, GdkEvent* event, gpointer data)
-{
- UpdaterAppState *app_state;
-
- llassert(data != NULL);
- app_state = (UpdaterAppState *) data;
-
- updater_app_quit(app_state);
-}
-
-void updater_app_quit(UpdaterAppState *app_state)
-{
- if (app_state != NULL)
- {
- g_source_remove(app_state->progress_update_timeout_id);
-
- if (!app_state->image_dir.empty())
- {
- g_source_remove(app_state->image_rotation_timeout_id);
- }
- }
-
- gtk_main_quit();
-}
-
-void display_error(GtkWidget *parent, std::string title, std::string message)
-{
- GtkWidget *dialog;
-
- dialog = gtk_message_dialog_new(GTK_WINDOW(parent),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- "%s", message.c_str());
- gtk_window_set_title(GTK_WINDOW(dialog), title.c_str());
- gtk_dialog_run(GTK_DIALOG(dialog));
- gtk_widget_destroy(dialog);
-}
-
-gpointer worker_thread_cb(gpointer data)
-{
- UpdaterAppState *app_state;
- CURL *curl;
- CURLcode result;
- FILE *package_file;
- GError *error = NULL;
- int fd;
-
- //g_return_val_if_fail (data != NULL, NULL);
- app_state = (UpdaterAppState *) data;
-
- try {
-
- if(!app_state->url.empty())
- {
- char* tmp_local_filename = NULL;
- // create temporary file to store the package.
- fd = g_file_open_tmp
- ("secondlife-update-XXXXXX", &tmp_local_filename, &error);
- if (error != NULL)
- {
- llerrs << "Unable to create temporary file: "
- << error->message
- << llendl;
-
- g_error_free(error);
- throw 0;
- }
-
- if(tmp_local_filename != NULL)
- {
- app_state->file = tmp_local_filename;
- g_free(tmp_local_filename);
- }
-
- package_file = fdopen(fd, "wb");
- if (package_file == NULL)
- {
- llerrs << "Failed to create temporary file: "
- << app_state->file.c_str()
- << llendl;
-
- gdk_threads_enter();
- display_error(app_state->window,
- LLTrans::getString("UpdaterFailDownloadTitle"),
- LLTrans::getString("UpdaterFailUpdateDescriptive"));
- gdk_threads_leave();
- throw 0;
- }
-
- // initialize curl and start downloading the package
- llinfos << "Downloading package: " << app_state->url << llendl;
-
- curl = curl_easy_init();
- if (curl == NULL)
- {
- llerrs << "Failed to initialize libcurl" << llendl;
-
- gdk_threads_enter();
- display_error(app_state->window,
- LLTrans::getString("UpdaterFailDownloadTitle"),
- LLTrans::getString("UpdaterFailUpdateDescriptive"));
- gdk_threads_leave();
- throw 0;
- }
-
- curl_easy_setopt(curl, CURLOPT_URL, app_state->url.c_str());
- curl_easy_setopt(curl, CURLOPT_NOSIGNAL, TRUE);
- curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, TRUE);
- curl_easy_setopt(curl, CURLOPT_WRITEDATA, package_file);
- curl_easy_setopt(curl, CURLOPT_NOPROGRESS, FALSE);
- curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION,
- &download_progress_cb);
- curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, app_state);
-
- result = curl_easy_perform(curl);
- fclose(package_file);
- curl_easy_cleanup(curl);
-
- if (result)
- {
- llerrs << "Failed to download update: "
- << app_state->url
- << llendl;
-
- gdk_threads_enter();
- display_error(app_state->window,
- LLTrans::getString("UpdaterFailDownloadTitle"),
- LLTrans::getString("UpdaterFailUpdateDescriptive"));
- gdk_threads_leave();
-
- throw 0;
- }
- }
-
- // now pulse the progres bar back and forth while the package is
- // being unpacked
- gdk_threads_enter();
- std::string installing_msg = LLTrans::getString("UpdaterNowInstalling");
- gtk_progress_bar_set_text(
- GTK_PROGRESS_BAR(app_state->progress_bar),
- installing_msg.c_str());
- app_state->activity_mode = TRUE;
- gdk_threads_leave();
-
- // *TODO: if the destination is not writable, terminate this
- // thread and show file chooser?
- if (!install_package(app_state->file.c_str(), app_state->dest_dir))
- {
- llwarns << "Failed to install package to destination: "
- << app_state->dest_dir
- << llendl;
-
- gdk_threads_enter();
- display_error(app_state->window,
- LLTrans::getString("UpdaterFailInstallTitle"),
- LLTrans::getString("UpdaterFailUpdateDescriptive"));
- //"Failed to update " + app_state->app_name,
- gdk_threads_leave();
- throw 0;
- }
-
- // try to spawn the new viewer
- if (!spawn_viewer(app_state))
- {
- llwarns << "Viewer was not installed properly in : "
- << app_state->dest_dir
- << llendl;
-
- gdk_threads_enter();
- display_error(app_state->window,
- LLTrans::getString("UpdaterFailStartTitle"),
- LLTrans::getString("UpdaterFailUpdateDescriptive"));
- gdk_threads_leave();
- throw 0;
- }
- }
- catch (...)
- {
- app_state->failure = TRUE;
- }
-
- gdk_threads_enter();
- updater_app_quit(app_state);
- gdk_threads_leave();
-
- return NULL;
-}
-
-
-gboolean less_anal_gspawnsync(gchar **argv,
- gchar **stderr_output,
- gint *child_exit_status,
- GError **spawn_error)
-{
- // store current SIGCHLD handler if there is one, replace with default
- // handler to make glib happy
- struct sigaction sigchld_backup;
- struct sigaction sigchld_appease_glib;
- sigchld_appease_glib.sa_handler = SIG_DFL;
- sigemptyset(&sigchld_appease_glib.sa_mask);
- sigchld_appease_glib.sa_flags = 0;
- sigaction(SIGCHLD, &sigchld_appease_glib, &sigchld_backup);
-
- gboolean rtn = g_spawn_sync(NULL,
- argv,
- NULL,
- (GSpawnFlags) (G_SPAWN_STDOUT_TO_DEV_NULL),
- NULL,
- NULL,
- NULL,
- stderr_output,
- child_exit_status,
- spawn_error);
-
- // restore SIGCHLD handler
- sigaction(SIGCHLD, &sigchld_backup, NULL);
-
- return rtn;
-}
-
-
-// perform a rename, or perform a (prompted) root rename if that fails
-int
-rename_with_sudo_fallback(const std::string& filename, const std::string& newname)
-{
- int rtncode = ::rename(filename.c_str(), newname.c_str());
- lldebugs << "rename result is: " << rtncode << " / " << errno << llendl;
- if (rtncode && (EACCES == errno || EPERM == errno || EXDEV == errno))
- {
- llinfos << "Permission problem in rename, or moving between different mount points. Retrying as a mv under a sudo." << llendl;
- // failed due to permissions, try again as a gksudo or kdesu mv wrapper hack
- char *sudo_cmd = NULL;
- sudo_cmd = g_find_program_in_path("gksudo");
- if (!sudo_cmd)
- {
- sudo_cmd = g_find_program_in_path("kdesu");
- }
- if (sudo_cmd)
- {
- char *mv_cmd = NULL;
- mv_cmd = g_find_program_in_path("mv");
- if (mv_cmd)
- {
- char *src_string_copy = g_strdup(filename.c_str());
- char *dst_string_copy = g_strdup(newname.c_str());
- char* argv[] =
- {
- sudo_cmd,
- mv_cmd,
- src_string_copy,
- dst_string_copy,
- NULL
- };
-
- gchar *stderr_output = NULL;
- gint child_exit_status = 0;
- GError *spawn_error = NULL;
- if (!less_anal_gspawnsync(argv, &stderr_output,
- &child_exit_status, &spawn_error))
- {
- llwarns << "Failed to spawn child process: "
- << spawn_error->message
- << llendl;
- }
- else if (child_exit_status)
- {
- llwarns << "mv command failed: "
- << (stderr_output ? stderr_output : "(no reason given)")
- << llendl;
- }
- else
- {
- // everything looks good, clear the error code
- rtncode = 0;
- }
-
- g_free(src_string_copy);
- g_free(dst_string_copy);
- if (spawn_error) g_error_free(spawn_error);
- }
- }
- }
- return rtncode;
-}
-
-gboolean install_package(std::string package_file, std::string destination)
-{
- char *tar_cmd = NULL;
- std::ostringstream command;
-
- // Find the absolute path to the 'tar' command.
- tar_cmd = g_find_program_in_path("tar");
- if (!tar_cmd)
- {
- llerrs << "`tar' was not found in $PATH" << llendl;
- return FALSE;
- }
- llinfos << "Found tar command: " << tar_cmd << llendl;
-
- // Unpack the tarball in a temporary place first, then move it to
- // its final destination
- std::string tmp_dest_dir = gDirUtilp->getTempFilename();
- if (LLFile::mkdir(tmp_dest_dir, 0744))
- {
- llerrs << "Failed to create directory: "
- << destination
- << llendl;
-
- return FALSE;
- }
-
- char *package_file_string_copy = g_strdup(package_file.c_str());
- char *tmp_dest_dir_string_copy = g_strdup(tmp_dest_dir.c_str());
- gchar *argv[8] = {
- tar_cmd,
- const_cast<gchar*>("--strip"), const_cast<gchar*>("1"),
- const_cast<gchar*>("-xjf"),
- package_file_string_copy,
- const_cast<gchar*>("-C"), tmp_dest_dir_string_copy,
- NULL,
- };
-
- llinfos << "Untarring package: " << package_file << llendl;
-
- // store current SIGCHLD handler if there is one, replace with default
- // handler to make glib happy
- struct sigaction sigchld_backup;
- struct sigaction sigchld_appease_glib;
- sigchld_appease_glib.sa_handler = SIG_DFL;
- sigemptyset(&sigchld_appease_glib.sa_mask);
- sigchld_appease_glib.sa_flags = 0;
- sigaction(SIGCHLD, &sigchld_appease_glib, &sigchld_backup);
-
- gchar *stderr_output = NULL;
- gint child_exit_status = 0;
- GError *untar_error = NULL;
- if (!less_anal_gspawnsync(argv, &stderr_output,
- &child_exit_status, &untar_error))
- {
- llwarns << "Failed to spawn child process: "
- << untar_error->message
- << llendl;
- return FALSE;
- }
-
- if (child_exit_status)
- {
- llwarns << "Untar command failed: "
- << (stderr_output ? stderr_output : "(no reason given)")
- << llendl;
- return FALSE;
- }
-
- g_free(tar_cmd);
- g_free(package_file_string_copy);
- g_free(tmp_dest_dir_string_copy);
- g_free(stderr_output);
- if (untar_error) g_error_free(untar_error);
-
- // move the existing package out of the way if it exists
- if (gDirUtilp->fileExists(destination))
- {
- std::string backup_dir = destination + ".backup";
- int oldcounter = 1;
- while (gDirUtilp->fileExists(backup_dir))
- {
- // find a foo.backup.N folder name that isn't taken yet
- backup_dir = destination + ".backup." + llformat("%d", oldcounter);
- ++oldcounter;
- }
-
- if (rename_with_sudo_fallback(destination, backup_dir))
- {
- llwarns << "Failed to move directory: '"
- << destination << "' -> '" << backup_dir
- << llendl;
- return FALSE;
- }
- }
-
- // The package has been unpacked in a staging directory, now we just
- // need to move it to its destination.
- if (rename_with_sudo_fallback(tmp_dest_dir, destination))
- {
- llwarns << "Failed to move installation to the destination: "
- << destination
- << llendl;
- return FALSE;
- }
-
- // \0/ Success!
- return TRUE;
-}
-
-gboolean progress_update_timeout(gpointer data)
-{
- UpdaterAppState *app_state;
-
- llassert(data != NULL);
-
- app_state = (UpdaterAppState *) data;
-
- gdk_threads_enter();
- if (app_state->activity_mode)
- {
- gtk_progress_bar_pulse
- (GTK_PROGRESS_BAR(app_state->progress_bar));
- }
- else
- {
- gtk_progress_set_value(GTK_PROGRESS(app_state->progress_bar),
- app_state->progress_value);
- }
- gdk_threads_leave();
-
- return TRUE;
-}
-
-gboolean update_progress_text_timeout(gpointer data)
-{
- UpdaterAppState *app_state;
-
- llassert(data != NULL);
- app_state = (UpdaterAppState *) data;
-
- if (app_state->activity_mode == TRUE)
- {
- // We no longer need this timeout, it will be removed.
- return FALSE;
- }
-
- if (!app_state->progress_value)
- {
- return TRUE;
- }
-
- std::string progress_text = llformat((LLTrans::getString("UpdaterProgressBarText")+" (%.0f%%)").c_str(), app_state->progress_value);
-
- gdk_threads_enter();
- gtk_progress_bar_set_text(GTK_PROGRESS_BAR(app_state->progress_bar),
- progress_text.c_str());
- gdk_threads_leave();
-
- return TRUE;
-}
-
-int download_progress_cb(gpointer data,
- double t,
- double d,
- double utotal,
- double ulnow)
-{
- UpdaterAppState *app_state;
-
- llassert(data != NULL);
- app_state = (UpdaterAppState *) data;
-
- if (t <= 0.0)
- {
- app_state->progress_value = 0;
- }
- else
- {
- app_state->progress_value = d * 100.0 / t;
- }
- return 0;
-}
-
-BOOL spawn_viewer(UpdaterAppState *app_state)
-{
- llassert(app_state != NULL);
-
- std::string cmd = app_state->dest_dir + "/secondlife";
- GError *error = NULL;
-
- // We want to spawn the Viewer on the same display as the updater app
- gboolean success = gdk_spawn_command_line_on_screen
- (gtk_widget_get_screen(app_state->window), cmd.c_str(), &error);
-
- if (!success)
- {
- llwarns << "Failed to launch viewer: " << error->message
- << llendl;
- }
-
- if (error) g_error_free(error);
-
- return success;
-}
-
-void show_usage_and_exit()
-{
- std::cout << "Usage: linux-updater <--url URL | --file FILE> --name NAME --dest PATH --stringsdir PATH1,PATH2 --stringsfile FILE"
- << "[--image-dir PATH]"
- << std::endl;
- exit(1);
-}
-
-void parse_args_and_init(int argc, char **argv, UpdaterAppState *app_state)
-{
- int i;
-
- for (i = 1; i < argc; i++)
- {
- if ((!strcmp(argv[i], "--url")) && (++i < argc))
- {
- app_state->url = argv[i];
- }
- else if ((!strcmp(argv[i], "--file")) && (++i < argc))
- {
- app_state->file = argv[i];
- }
- else if ((!strcmp(argv[i], "--name")) && (++i < argc))
- {
- app_state->app_name = argv[i];
- }
- else if ((!strcmp(argv[i], "--image-dir")) && (++i < argc))
- {
- app_state->image_dir = argv[i];
- app_state->image_dir_iter = new LLDirIterator(argv[i], "*.jpg");
- }
- else if ((!strcmp(argv[i], "--dest")) && (++i < argc))
- {
- app_state->dest_dir = argv[i];
- }
- else if ((!strcmp(argv[i], "--stringsdir")) && (++i < argc))
- {
- app_state->strings_dirs = argv[i];
- }
- else if ((!strcmp(argv[i], "--stringsfile")) && (++i < argc))
- {
- app_state->strings_file = argv[i];
- }
- else
- {
- // show usage, an invalid option was given.
- show_usage_and_exit();
- }
- }
-
- if (app_state->app_name.empty()
- || (app_state->url.empty() && app_state->file.empty())
- || app_state->dest_dir.empty())
- {
- show_usage_and_exit();
- }
-
- app_state->progress_value = 0.0;
- app_state->activity_mode = FALSE;
- app_state->failure = FALSE;
-
- translate_init(app_state->strings_dirs, app_state->strings_file);
-}
-
-int main(int argc, char **argv)
-{
- UpdaterAppState* app_state = new UpdaterAppState;
-
- parse_args_and_init(argc, argv, app_state);
-
- // Initialize logger, and rename old log file
- gDirUtilp->initAppDirs("SecondLife");
- LLError::initForApplication
- (gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, ""));
- std::string old_log_file = gDirUtilp->getExpandedFilename
- (LL_PATH_LOGS, "updater.log.old");
- std::string log_file =
- gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "updater.log");
- LLFile::rename(log_file, old_log_file);
- LLError::logToFile(log_file);
-
- // initialize gthreads and gtk+
- if (!g_thread_supported())
- {
- g_thread_init(NULL);
- gdk_threads_init();
- }
-
- gtk_init(&argc, &argv);
-
- // create UI
- updater_app_ui_init(app_state);
-
- //llinfos << "SAMPLE TRANSLATION IS: " << LLTrans::getString("LoginInProgress") << llendl;
-
- // create download thread
- g_thread_create(GThreadFunc(worker_thread_cb), app_state, FALSE, NULL);
-
- gdk_threads_enter();
- gtk_main();
- gdk_threads_leave();
-
- // Delete the file only if created from url download.
- if(!app_state->url.empty() && !app_state->file.empty())
- {
- if (gDirUtilp->fileExists(app_state->file))
- {
- LLFile::remove(app_state->file);
- }
- }
-
- bool success = !app_state->failure;
- delete app_state->image_dir_iter;
- delete app_state;
- return success ? 0 : 1;
-}
-
-/*****************************************************************************
-* Dummy LLTrans implementation (IQA-490)
-*****************************************************************************/
-static LLTrans sStaticStrings;
-
-// lookup
-std::string LLTrans::_getString(const std::string& key) const
-{
- MessageMap::const_iterator found = mMessages.find(key);
- if (found != mMessages.end())
- {
- return found->second;
- }
- LL_WARNS("linux_updater") << "No message for key '" << key
- << "' -- add to LLTrans::LLTrans() in linux_updater.cpp"
- << LL_ENDL;
- return key;
-}
-
-// static lookup
-std::string LLTrans::getString(const std::string& key)
-{
- return sLLTransInstance._getString(key);
-}
-
-// initialization
-LLTrans::LLTrans()
-{
- typedef std::pair<const char*, const char*> Pair;
- static const Pair data[] =
- {
- Pair("UpdaterFailDownloadTitle",
- "Failed to download update"),
- Pair("UpdaterFailInstallTitle",
- "Failed to install update"),
- Pair("UpdaterFailStartTitle",
- "Failed to start viewer"),
- Pair("UpdaterFailUpdateDescriptive",
- "An error occurred while updating Second Life. "
- "Please download the latest version from www.secondlife.com."),
- Pair("UpdaterNowInstalling",
- "Installing Second Life..."),
- Pair("UpdaterNowUpdating",
- "Now updating Second Life..."),
- Pair("UpdaterProgressBarText",
- "Downloading update"),
- Pair("UpdaterProgressBarTextWithEllipses",
- "Downloading update..."),
- Pair("UpdaterUpdatingDescriptive",
- "Your Second Life Viewer is being updated to the latest release. "
- "This may take some time, so please be patient."),
- Pair("UpdaterWindowTitle",
- "Second Life Update")
- };
-
- BOOST_FOREACH(Pair pair, data)
- {
- mMessages[pair.first] = pair.second;
- }
-}
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp
index 0f5d729e77..6fdf9e2e07 100644..100755
--- a/indra/llappearance/llavatarappearance.cpp
+++ b/indra/llappearance/llavatarappearance.cpp
@@ -35,15 +35,15 @@
#include "llavatarappearance.h"
#include "llavatarappearancedefines.h"
#include "llavatarjointmesh.h"
-#include "imageids.h"
+#include "llstl.h"
#include "lldir.h"
-#include "lldeleteutils.h"
#include "llpolymorph.h"
#include "llpolymesh.h"
#include "llpolyskeletaldistortion.h"
#include "llstl.h"
#include "lltexglobalcolor.h"
#include "llwearabledata.h"
+#include "boost/bind.hpp"
#if LL_MSVC
@@ -142,9 +142,9 @@ LLAvatarAppearance::LLAvatarXmlInfo::~LLAvatarXmlInfo()
std::for_each(mAttachmentInfoList.begin(), mAttachmentInfoList.end(), DeletePointer());
mAttachmentInfoList.clear();
- deleteAndClear(mTexSkinColorInfo);
- deleteAndClear(mTexHairColorInfo);
- deleteAndClear(mTexEyeColorInfo);
+ delete_and_clear(mTexSkinColorInfo);
+ delete_and_clear(mTexHairColorInfo);
+ delete_and_clear(mTexEyeColorInfo);
std::for_each(mLayerInfoList.begin(), mLayerInfoList.end(), DeletePointer());
mLayerInfoList.clear();
@@ -235,7 +235,7 @@ void LLAvatarAppearance::initInstance()
mesh->setMeshID(mesh_index);
mesh->setPickName(mesh_dict->mPickName);
mesh->setIsTransparent(FALSE);
- switch((int)mesh_index)
+ switch((S32)mesh_index)
{
case MESH_ID_HAIR:
mesh->setIsTransparent(TRUE);
@@ -271,7 +271,7 @@ void LLAvatarAppearance::initInstance()
++iter)
{
LLAvatarJointMesh* mesh = (*iter);
- mBakedTextureDatas[(int)baked_texture_index].mJointMeshes.push_back(mesh);
+ mBakedTextureDatas[(S32)baked_texture_index].mJointMeshes.push_back(mesh);
}
}
@@ -282,13 +282,13 @@ void LLAvatarAppearance::initInstance()
// virtual
LLAvatarAppearance::~LLAvatarAppearance()
{
- deleteAndClear(mTexSkinColor);
- deleteAndClear(mTexHairColor);
- deleteAndClear(mTexEyeColor);
+ delete_and_clear(mTexSkinColor);
+ delete_and_clear(mTexHairColor);
+ delete_and_clear(mTexEyeColor);
for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
{
- deleteAndClear(mBakedTextureDatas[i].mTexLayerSet);
+ delete_and_clear(mBakedTextureDatas[i].mTexLayerSet);
mBakedTextureDatas[i].mJointMeshes.clear();
for (morph_list_t::iterator iter2 = mBakedTextureDatas[i].mMaskedMorphs.begin();
@@ -303,7 +303,7 @@ LLAvatarAppearance::~LLAvatarAppearance()
mJointMap.clear();
clearSkeleton();
- deleteAndClearArray(mCollisionVolumes);
+ delete_and_clear_array(mCollisionVolumes);
std::for_each(mPolyMeshes.begin(), mPolyMeshes.end(), DeletePairedPointer());
mPolyMeshes.clear();
@@ -329,14 +329,14 @@ void LLAvatarAppearance::initClass()
BOOL success = sXMLTree.parseFile( xmlFile, FALSE );
if (!success)
{
- llerrs << "Problem reading avatar configuration file:" << xmlFile << llendl;
+ LL_ERRS() << "Problem reading avatar configuration file:" << xmlFile << LL_ENDL;
}
// now sanity check xml file
LLXmlTreeNode* root = sXMLTree.getRoot();
if (!root)
{
- llerrs << "No root node found in avatar configuration file: " << xmlFile << llendl;
+ LL_ERRS() << "No root node found in avatar configuration file: " << xmlFile << LL_ENDL;
return;
}
@@ -345,14 +345,14 @@ void LLAvatarAppearance::initClass()
//-------------------------------------------------------------------------
if( !root->hasName( "linden_avatar" ) )
{
- llerrs << "Invalid avatar file header: " << xmlFile << llendl;
+ LL_ERRS() << "Invalid avatar file header: " << xmlFile << LL_ENDL;
}
std::string version;
static LLStdStringHandle version_string = LLXmlTree::addAttributeString("version");
if( !root->getFastAttributeString( version_string, version ) || (version != "1.0") )
{
- llerrs << "Invalid avatar file version: " << version << " in file: " << xmlFile << llendl;
+ LL_ERRS() << "Invalid avatar file version: " << version << " in file: " << xmlFile << LL_ENDL;
}
S32 wearable_def_version = 1;
@@ -365,7 +365,7 @@ void LLAvatarAppearance::initClass()
LLXmlTreeNode* skeleton_node = root->getChildByName( "skeleton" );
if (!skeleton_node)
{
- llerrs << "No skeleton in avatar configuration file: " << xmlFile << llendl;
+ LL_ERRS() << "No skeleton in avatar configuration file: " << xmlFile << LL_ENDL;
return;
}
@@ -373,14 +373,14 @@ void LLAvatarAppearance::initClass()
static LLStdStringHandle file_name_string = LLXmlTree::addAttributeString("file_name");
if (!skeleton_node->getFastAttributeString(file_name_string, skeleton_file_name))
{
- llerrs << "No file name in skeleton node in avatar config file: " << xmlFile << llendl;
+ LL_ERRS() << "No file name in skeleton node in avatar config file: " << xmlFile << LL_ENDL;
}
std::string skeleton_path;
skeleton_path = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,skeleton_file_name);
if (!parseSkeletonFile(skeleton_path))
{
- llerrs << "Error parsing skeleton file: " << skeleton_path << llendl;
+ LL_ERRS() << "Error parsing skeleton file: " << skeleton_path << LL_ENDL;
}
// Process XML data
@@ -393,43 +393,43 @@ void LLAvatarAppearance::initClass()
sAvatarSkeletonInfo = new LLAvatarSkeletonInfo;
if (!sAvatarSkeletonInfo->parseXml(sSkeletonXMLTree.getRoot()))
{
- llerrs << "Error parsing skeleton XML file: " << skeleton_path << llendl;
+ LL_ERRS() << "Error parsing skeleton XML file: " << skeleton_path << LL_ENDL;
}
// parse avatar_lad.xml
if (sAvatarXmlInfo)
{ //this can happen if a login attempt failed
- deleteAndClear(sAvatarXmlInfo);
+ delete_and_clear(sAvatarXmlInfo);
}
sAvatarXmlInfo = new LLAvatarXmlInfo;
if (!sAvatarXmlInfo->parseXmlSkeletonNode(root))
{
- llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
+ LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
}
if (!sAvatarXmlInfo->parseXmlMeshNodes(root))
{
- llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
+ LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
}
if (!sAvatarXmlInfo->parseXmlColorNodes(root))
{
- llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
+ LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
}
if (!sAvatarXmlInfo->parseXmlLayerNodes(root))
{
- llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
+ LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
}
if (!sAvatarXmlInfo->parseXmlDriverNodes(root))
{
- llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
+ LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
}
if (!sAvatarXmlInfo->parseXmlMorphNodes(root))
{
- llerrs << "Error parsing skeleton node in avatar XML file: " << skeleton_path << llendl;
+ LL_ERRS() << "Error parsing skeleton node in avatar XML file: " << skeleton_path << LL_ENDL;
}
}
void LLAvatarAppearance::cleanupClass()
{
- deleteAndClear(sAvatarXmlInfo);
+ delete_and_clear(sAvatarXmlInfo);
// *TODO: What about sAvatarSkeletonInfo ???
sSkeletonXMLTree.cleanup();
sXMLTree.cleanup();
@@ -498,29 +498,9 @@ void LLAvatarAppearance::computeBodySize()
mAvatarOffset.mV[VX] = 0.0f;
mAvatarOffset.mV[VY] = 0.0f;
- // Certain configurations of avatars can force the overall height (with offset) to go negative.
- // Enforce a constraint to make sure we don't go below 0.1 meters.
- // Camera positioning and other things start to break down when your avatar is "walking" while being fully underground
- if (new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] < 0.1f)
- {
- mAvatarOffset.mV[VZ] = -(new_body_size.mV[VZ] - 0.11f); // avoid floating point rounding making the above check continue to fail.
-
- llassert(new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] >= 0.1f);
-
- if (mWearableData && isSelf())
- {
- LLWearable* shape = mWearableData->getWearable(LLWearableType::WT_SHAPE, 0);
- if (shape)
- {
- shape->setVisualParamWeight(AVATAR_HOVER, mAvatarOffset.mV[VZ], false);
- }
- }
- }
-
if (new_body_size != mBodySize || old_offset != mAvatarOffset.mV[VZ])
{
mBodySize = new_body_size;
- bodySizeChanged();
}
}
@@ -536,7 +516,7 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename)
if (!parsesuccess)
{
- llerrs << "Can't parse skeleton file: " << filename << llendl;
+ LL_ERRS() << "Can't parse skeleton file: " << filename << LL_ENDL;
return FALSE;
}
@@ -544,13 +524,13 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename)
LLXmlTreeNode* root = sSkeletonXMLTree.getRoot();
if (!root)
{
- llerrs << "No root node found in avatar skeleton file: " << filename << llendl;
+ LL_ERRS() << "No root node found in avatar skeleton file: " << filename << LL_ENDL;
return FALSE;
}
if( !root->hasName( "linden_skeleton" ) )
{
- llerrs << "Invalid avatar skeleton file header: " << filename << llendl;
+ LL_ERRS() << "Invalid avatar skeleton file header: " << filename << LL_ENDL;
return FALSE;
}
@@ -558,7 +538,7 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename)
static LLStdStringHandle version_string = LLXmlTree::addAttributeString("version");
if( !root->getFastAttributeString( version_string, version ) || (version != "1.0") )
{
- llerrs << "Invalid avatar skeleton file version: " << version << " in file: " << filename << llendl;
+ LL_ERRS() << "Invalid avatar skeleton file version: " << version << " in file: " << filename << LL_ENDL;
return FALSE;
}
@@ -577,7 +557,7 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
joint = getCharacterJoint(joint_num);
if (!joint)
{
- llwarns << "Too many bones" << llendl;
+ LL_WARNS() << "Too many bones" << LL_ENDL;
return FALSE;
}
joint->setName( info->mName );
@@ -586,7 +566,7 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
{
if (volume_num >= (S32)mNumCollisionVolumes)
{
- llwarns << "Too many bones" << llendl;
+ LL_WARNS() << "Too many bones" << LL_ENDL;
return FALSE;
}
joint = (&mCollisionVolumes[volume_num]);
@@ -656,7 +636,7 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
//-------------------------------------------------------------------------
if (!allocateCharacterJoints(info->mNumBones))
{
- llerrs << "Can't allocate " << info->mNumBones << " joints" << llendl;
+ LL_ERRS() << "Can't allocate " << info->mNumBones << " joints" << LL_ENDL;
return FALSE;
}
@@ -667,7 +647,7 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
{
if (!allocateCollisionVolumes(info->mNumCollisionVolumes))
{
- llerrs << "Can't allocate " << info->mNumCollisionVolumes << " collision volumes" << llendl;
+ LL_ERRS() << "Can't allocate " << info->mNumCollisionVolumes << " collision volumes" << LL_ENDL;
return FALSE;
}
}
@@ -680,7 +660,7 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info)
LLAvatarBoneInfo *info = *iter;
if (!setupBone(info, NULL, current_volume_num, current_joint_num))
{
- llerrs << "Error parsing bone in skeleton file" << llendl;
+ LL_ERRS() << "Error parsing bone in skeleton file" << LL_ENDL;
return FALSE;
}
}
@@ -740,17 +720,17 @@ void LLAvatarAppearance::buildCharacter()
stop_glerror();
// gPrintMessagesThisFrame = TRUE;
- lldebugs << "Avatar load took " << timer.getElapsedTimeF32() << " seconds." << llendl;
+ LL_DEBUGS() << "Avatar load took " << timer.getElapsedTimeF32() << " seconds." << LL_ENDL;
if (!status)
{
if (isSelf())
{
- llerrs << "Unable to load user's avatar" << llendl;
+ LL_ERRS() << "Unable to load user's avatar" << LL_ENDL;
}
else
{
- llwarns << "Unable to load other's avatar" << llendl;
+ LL_WARNS() << "Unable to load other's avatar" << LL_ENDL;
}
return;
}
@@ -799,7 +779,7 @@ void LLAvatarAppearance::buildCharacter()
mEyeLeftp &&
mEyeRightp))
{
- llerrs << "Failed to create avatar." << llendl;
+ LL_ERRS() << "Failed to create avatar." << LL_ENDL;
return;
}
@@ -815,26 +795,26 @@ void LLAvatarAppearance::buildCharacter()
BOOL LLAvatarAppearance::loadAvatar()
{
-// LLFastTimer t(FTM_LOAD_AVATAR);
+// LL_RECORD_BLOCK_TIME(FTM_LOAD_AVATAR);
// avatar_skeleton.xml
if( !buildSkeleton(sAvatarSkeletonInfo) )
{
- llwarns << "avatar file: buildSkeleton() failed" << llendl;
+ LL_WARNS() << "avatar file: buildSkeleton() failed" << LL_ENDL;
return FALSE;
}
// avatar_lad.xml : <skeleton>
if( !loadSkeletonNode() )
{
- llwarns << "avatar file: loadNodeSkeleton() failed" << llendl;
+ LL_WARNS() << "avatar file: loadNodeSkeleton() failed" << LL_ENDL;
return FALSE;
}
// avatar_lad.xml : <mesh>
if( !loadMeshNodes() )
{
- llwarns << "avatar file: loadNodeMesh() failed" << llendl;
+ LL_WARNS() << "avatar file: loadNodeMesh() failed" << LL_ENDL;
return FALSE;
}
@@ -844,13 +824,13 @@ BOOL LLAvatarAppearance::loadAvatar()
mTexSkinColor = new LLTexGlobalColor( this );
if( !mTexSkinColor->setInfo( sAvatarXmlInfo->mTexSkinColorInfo ) )
{
- llwarns << "avatar file: mTexSkinColor->setInfo() failed" << llendl;
+ LL_WARNS() << "avatar file: mTexSkinColor->setInfo() failed" << LL_ENDL;
return FALSE;
}
}
else
{
- llwarns << "<global_color> name=\"skin_color\" not found" << llendl;
+ LL_WARNS() << "<global_color> name=\"skin_color\" not found" << LL_ENDL;
return FALSE;
}
if( sAvatarXmlInfo->mTexHairColorInfo )
@@ -858,13 +838,13 @@ BOOL LLAvatarAppearance::loadAvatar()
mTexHairColor = new LLTexGlobalColor( this );
if( !mTexHairColor->setInfo( sAvatarXmlInfo->mTexHairColorInfo ) )
{
- llwarns << "avatar file: mTexHairColor->setInfo() failed" << llendl;
+ LL_WARNS() << "avatar file: mTexHairColor->setInfo() failed" << LL_ENDL;
return FALSE;
}
}
else
{
- llwarns << "<global_color> name=\"hair_color\" not found" << llendl;
+ LL_WARNS() << "<global_color> name=\"hair_color\" not found" << LL_ENDL;
return FALSE;
}
if( sAvatarXmlInfo->mTexEyeColorInfo )
@@ -872,26 +852,26 @@ BOOL LLAvatarAppearance::loadAvatar()
mTexEyeColor = new LLTexGlobalColor( this );
if( !mTexEyeColor->setInfo( sAvatarXmlInfo->mTexEyeColorInfo ) )
{
- llwarns << "avatar file: mTexEyeColor->setInfo() failed" << llendl;
+ LL_WARNS() << "avatar file: mTexEyeColor->setInfo() failed" << LL_ENDL;
return FALSE;
}
}
else
{
- llwarns << "<global_color> name=\"eye_color\" not found" << llendl;
+ LL_WARNS() << "<global_color> name=\"eye_color\" not found" << LL_ENDL;
return FALSE;
}
// avatar_lad.xml : <layer_set>
if (sAvatarXmlInfo->mLayerInfoList.empty())
{
- llwarns << "avatar file: missing <layer_set> node" << llendl;
+ LL_WARNS() << "avatar file: missing <layer_set> node" << LL_ENDL;
return FALSE;
}
if (sAvatarXmlInfo->mMorphMaskInfoList.empty())
{
- llwarns << "avatar file: missing <morph_masks> node" << llendl;
+ LL_WARNS() << "avatar file: missing <morph_masks> node" << LL_ENDL;
return FALSE;
}
@@ -933,14 +913,14 @@ BOOL LLAvatarAppearance::loadAvatar()
LLVisualParam*(LLAvatarAppearance::*avatar_function)(S32)const = &LLAvatarAppearance::getVisualParam;
if( !driver_param->linkDrivenParams(boost::bind(avatar_function,(LLAvatarAppearance*)this,_1 ), false))
{
- llwarns << "could not link driven params for avatar " << getID().asString() << " param id: " << driver_param->getID() << llendl;
+ LL_WARNS() << "could not link driven params for avatar " << getID().asString() << " param id: " << driver_param->getID() << LL_ENDL;
continue;
}
}
else
{
delete driver_param;
- llwarns << "avatar file: driver_param->parseData() failed" << llendl;
+ LL_WARNS() << "avatar file: driver_param->parseData() failed" << LL_ENDL;
return FALSE;
}
}
@@ -1060,17 +1040,17 @@ BOOL LLAvatarAppearance::loadMeshNodes()
}
else
{
- llwarns << "Avatar file: <mesh> has invalid lod setting " << lod << llendl;
+ LL_WARNS() << "Avatar file: <mesh> has invalid lod setting " << lod << LL_ENDL;
return FALSE;
}
}
else
{
- llwarns << "Ignoring unrecognized mesh type: " << type << llendl;
+ LL_WARNS() << "Ignoring unrecognized mesh type: " << type << LL_ENDL;
return FALSE;
}
- // llinfos << "Parsing mesh data for " << type << "..." << llendl;
+ // LL_INFOS() << "Parsing mesh data for " << type << "..." << LL_ENDL;
// If this isn't set to white (1.0), avatars will *ALWAYS* be darker than their surroundings.
// Do not touch!!!
@@ -1100,7 +1080,7 @@ BOOL LLAvatarAppearance::loadMeshNodes()
if( !poly_mesh )
{
- llwarns << "Failed to load mesh of type " << type << llendl;
+ LL_WARNS() << "Failed to load mesh of type " << type << LL_ENDL;
return FALSE;
}
@@ -1160,7 +1140,7 @@ BOOL LLAvatarAppearance::loadLayersets()
{
stop_glerror();
delete layer_set;
- llwarns << "avatar file: layer_set->setInfo() failed" << llendl;
+ LL_WARNS() << "avatar file: layer_set->setInfo() failed" << LL_ENDL;
return FALSE;
}
@@ -1183,7 +1163,7 @@ BOOL LLAvatarAppearance::loadLayersets()
// if no baked texture was found, warn and cleanup
if (baked_index == BAKED_NUM_INDICES)
{
- llwarns << "<layer_set> has invalid body_region attribute" << llendl;
+ LL_WARNS() << "<layer_set> has invalid body_region attribute" << LL_ENDL;
delete layer_set;
return FALSE;
}
@@ -1201,7 +1181,7 @@ BOOL LLAvatarAppearance::loadLayersets()
}
else
{
- llwarns << "Could not find layer named " << morph->mLayer << " to set morph flag" << llendl;
+ LL_WARNS() << "Could not find layer named " << morph->mLayer << " to set morph flag" << LL_ENDL;
success = FALSE;
}
}
@@ -1297,7 +1277,7 @@ BOOL LLAvatarAppearance::isValid() const
// This should only be called on ourself.
if (!isSelf())
{
- llerrs << "Called LLAvatarAppearance::isValid() on when isSelf() == false" << llendl;
+ LL_ERRS() << "Called LLAvatarAppearance::isValid() on when isSelf() == false" << LL_ENDL;
}
return TRUE;
}
@@ -1390,14 +1370,14 @@ BOOL LLAvatarAppearance::teToColorParams( ETextureIndex te, U32 *param_name )
return TRUE;
}
-void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_color, BOOL upload_bake )
+void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_color)
{
U32 param_name[3];
if( teToColorParams( te, param_name ) )
{
- setVisualParamWeight( param_name[0], new_color.mV[VX], upload_bake );
- setVisualParamWeight( param_name[1], new_color.mV[VY], upload_bake );
- setVisualParamWeight( param_name[2], new_color.mV[VZ], upload_bake );
+ setVisualParamWeight( param_name[0], new_color.mV[VX]);
+ setVisualParamWeight( param_name[1], new_color.mV[VY]);
+ setVisualParamWeight( param_name[2], new_color.mV[VZ]);
}
}
@@ -1462,7 +1442,7 @@ LLTexLayerSet* LLAvatarAppearance::getAvatarLayerSet(EBakedTextureIndex baked_in
//-----------------------------------------------------------------------------
BOOL LLAvatarAppearance::allocateCollisionVolumes( U32 num )
{
- deleteAndClearArray(mCollisionVolumes);
+ delete_and_clear_array(mCollisionVolumes);
mNumCollisionVolumes = 0;
mCollisionVolumes = new LLAvatarJointCollisionVolume[num];
@@ -1486,7 +1466,7 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
if (!node->getFastAttributeString(name_string, mName))
{
- llwarns << "Bone without name" << llendl;
+ LL_WARNS() << "Bone without name" << LL_ENDL;
return FALSE;
}
}
@@ -1501,28 +1481,28 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
}
else
{
- llwarns << "Invalid node " << node->getName() << llendl;
+ LL_WARNS() << "Invalid node " << node->getName() << LL_ENDL;
return FALSE;
}
static LLStdStringHandle pos_string = LLXmlTree::addAttributeString("pos");
if (!node->getFastAttributeVector3(pos_string, mPos))
{
- llwarns << "Bone without position" << llendl;
+ LL_WARNS() << "Bone without position" << LL_ENDL;
return FALSE;
}
static LLStdStringHandle rot_string = LLXmlTree::addAttributeString("rot");
if (!node->getFastAttributeVector3(rot_string, mRot))
{
- llwarns << "Bone without rotation" << llendl;
+ LL_WARNS() << "Bone without rotation" << LL_ENDL;
return FALSE;
}
static LLStdStringHandle scale_string = LLXmlTree::addAttributeString("scale");
if (!node->getFastAttributeVector3(scale_string, mScale))
{
- llwarns << "Bone without scale" << llendl;
+ LL_WARNS() << "Bone without scale" << LL_ENDL;
return FALSE;
}
@@ -1531,7 +1511,7 @@ BOOL LLAvatarBoneInfo::parseXml(LLXmlTreeNode* node)
static LLStdStringHandle pivot_string = LLXmlTree::addAttributeString("pivot");
if (!node->getFastAttributeVector3(pivot_string, mPivot))
{
- llwarns << "Bone without pivot" << llendl;
+ LL_WARNS() << "Bone without pivot" << LL_ENDL;
return FALSE;
}
}
@@ -1559,7 +1539,7 @@ BOOL LLAvatarSkeletonInfo::parseXml(LLXmlTreeNode* node)
static LLStdStringHandle num_bones_string = LLXmlTree::addAttributeString("num_bones");
if (!node->getFastAttributeS32(num_bones_string, mNumBones))
{
- llwarns << "Couldn't find number of bones." << llendl;
+ LL_WARNS() << "Couldn't find number of bones." << LL_ENDL;
return FALSE;
}
@@ -1573,7 +1553,7 @@ BOOL LLAvatarSkeletonInfo::parseXml(LLXmlTreeNode* node)
if (!info->parseXml(child))
{
delete info;
- llwarns << "Error parsing bone in skeleton file" << llendl;
+ LL_WARNS() << "Error parsing bone in skeleton file" << LL_ENDL;
return FALSE;
}
mBoneInfoList.push_back(info);
@@ -1590,7 +1570,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
LLXmlTreeNode* node = root->getChildByName( "skeleton" );
if( !node )
{
- llwarns << "avatar file: missing <skeleton>" << llendl;
+ LL_WARNS() << "avatar file: missing <skeleton>" << LL_ENDL;
return FALSE;
}
@@ -1605,11 +1585,11 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
{
if (child->getChildByName("param_morph"))
{
- llwarns << "Can't specify morph param in skeleton definition." << llendl;
+ LL_WARNS() << "Can't specify morph param in skeleton definition." << LL_ENDL;
}
else
{
- llwarns << "Unknown param type." << llendl;
+ LL_WARNS() << "Unknown param type." << LL_ENDL;
}
continue;
}
@@ -1634,7 +1614,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
if (!child->getFastAttributeString(name_string, info->mName))
{
- llwarns << "No name supplied for attachment point." << llendl;
+ LL_WARNS() << "No name supplied for attachment point." << LL_ENDL;
delete info;
continue;
}
@@ -1642,7 +1622,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
static LLStdStringHandle joint_string = LLXmlTree::addAttributeString("joint");
if (!child->getFastAttributeString(joint_string, info->mJointName))
{
- llwarns << "No bone declared in attachment point " << info->mName << llendl;
+ LL_WARNS() << "No bone declared in attachment point " << info->mName << LL_ENDL;
delete info;
continue;
}
@@ -1668,7 +1648,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlSkeletonNode(LLXmlTreeNode* ro
static LLStdStringHandle id_string = LLXmlTree::addAttributeString("id");
if (!child->getFastAttributeS32(id_string, info->mAttachmentID))
{
- llwarns << "No id supplied for attachment point " << info->mName << llendl;
+ LL_WARNS() << "No id supplied for attachment point " << info->mName << LL_ENDL;
delete info;
continue;
}
@@ -1703,7 +1683,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
static LLStdStringHandle type_string = LLXmlTree::addAttributeString("type");
if( !node->getFastAttributeString( type_string, info->mType ) )
{
- llwarns << "Avatar file: <mesh> is missing type attribute. Ignoring element. " << llendl;
+ LL_WARNS() << "Avatar file: <mesh> is missing type attribute. Ignoring element. " << LL_ENDL;
delete info;
return FALSE; // Ignore this element
}
@@ -1711,7 +1691,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
static LLStdStringHandle lod_string = LLXmlTree::addAttributeString("lod");
if (!node->getFastAttributeS32( lod_string, info->mLOD ))
{
- llwarns << "Avatar file: <mesh> is missing lod attribute. Ignoring element. " << llendl;
+ LL_WARNS() << "Avatar file: <mesh> is missing lod attribute. Ignoring element. " << LL_ENDL;
delete info;
return FALSE; // Ignore this element
}
@@ -1719,7 +1699,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
static LLStdStringHandle file_name_string = LLXmlTree::addAttributeString("file_name");
if( !node->getFastAttributeString( file_name_string, info->mMeshFileName ) )
{
- llwarns << "Avatar file: <mesh> is missing file_name attribute. Ignoring: " << info->mType << llendl;
+ LL_WARNS() << "Avatar file: <mesh> is missing file_name attribute. Ignoring: " << info->mType << LL_ENDL;
delete info;
return FALSE; // Ignore this element
}
@@ -1750,11 +1730,11 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMeshNodes(LLXmlTreeNode* root)
{
if (child->getChildByName("param_skeleton"))
{
- llwarns << "Can't specify skeleton param in a mesh definition." << llendl;
+ LL_WARNS() << "Can't specify skeleton param in a mesh definition." << LL_ENDL;
}
else
{
- llwarns << "Unknown param type." << llendl;
+ LL_WARNS() << "Unknown param type." << LL_ENDL;
}
continue;
}
@@ -1795,14 +1775,14 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root
{
if (mTexSkinColorInfo)
{
- llwarns << "avatar file: multiple instances of skin_color" << llendl;
+ LL_WARNS() << "avatar file: multiple instances of skin_color" << LL_ENDL;
return FALSE;
}
mTexSkinColorInfo = new LLTexGlobalColorInfo;
if( !mTexSkinColorInfo->parseXml( color_node ) )
{
- deleteAndClear(mTexSkinColorInfo);
- llwarns << "avatar file: mTexSkinColor->parseXml() failed" << llendl;
+ delete_and_clear(mTexSkinColorInfo);
+ LL_WARNS() << "avatar file: mTexSkinColor->parseXml() failed" << LL_ENDL;
return FALSE;
}
}
@@ -1810,14 +1790,14 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root
{
if (mTexHairColorInfo)
{
- llwarns << "avatar file: multiple instances of hair_color" << llendl;
+ LL_WARNS() << "avatar file: multiple instances of hair_color" << LL_ENDL;
return FALSE;
}
mTexHairColorInfo = new LLTexGlobalColorInfo;
if( !mTexHairColorInfo->parseXml( color_node ) )
{
- deleteAndClear(mTexHairColorInfo);
- llwarns << "avatar file: mTexHairColor->parseXml() failed" << llendl;
+ delete_and_clear(mTexHairColorInfo);
+ LL_WARNS() << "avatar file: mTexHairColor->parseXml() failed" << LL_ENDL;
return FALSE;
}
}
@@ -1825,13 +1805,13 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlColorNodes(LLXmlTreeNode* root
{
if (mTexEyeColorInfo)
{
- llwarns << "avatar file: multiple instances of eye_color" << llendl;
+ LL_WARNS() << "avatar file: multiple instances of eye_color" << LL_ENDL;
return FALSE;
}
mTexEyeColorInfo = new LLTexGlobalColorInfo;
if( !mTexEyeColorInfo->parseXml( color_node ) )
{
- llwarns << "avatar file: mTexEyeColor->parseXml() failed" << llendl;
+ LL_WARNS() << "avatar file: mTexEyeColor->parseXml() failed" << LL_ENDL;
return FALSE;
}
}
@@ -1857,7 +1837,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlLayerNodes(LLXmlTreeNode* root
else
{
delete layer_info;
- llwarns << "avatar file: layer_set->parseXml() failed" << llendl;
+ LL_WARNS() << "avatar file: layer_set->parseXml() failed" << LL_ENDL;
return FALSE;
}
}
@@ -1886,7 +1866,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlDriverNodes(LLXmlTreeNode* roo
else
{
delete driver_info;
- llwarns << "avatar file: driver_param->parseXml() failed" << llendl;
+ LL_WARNS() << "avatar file: driver_param->parseXml() failed" << LL_ENDL;
return FALSE;
}
}
@@ -1915,7 +1895,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("morph_name");
if (!grand_child->getFastAttributeString(name_string, info->mName))
{
- llwarns << "No name supplied for morph mask." << llendl;
+ LL_WARNS() << "No name supplied for morph mask." << LL_ENDL;
delete info;
continue;
}
@@ -1923,7 +1903,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
static LLStdStringHandle region_string = LLXmlTree::addAttributeString("body_region");
if (!grand_child->getFastAttributeString(region_string, info->mRegion))
{
- llwarns << "No region supplied for morph mask." << llendl;
+ LL_WARNS() << "No region supplied for morph mask." << LL_ENDL;
delete info;
continue;
}
@@ -1931,7 +1911,7 @@ BOOL LLAvatarAppearance::LLAvatarXmlInfo::parseXmlMorphNodes(LLXmlTreeNode* root
static LLStdStringHandle layer_string = LLXmlTree::addAttributeString("layer");
if (!grand_child->getFastAttributeString(layer_string, info->mLayer))
{
- llwarns << "No layer supplied for morph mask." << llendl;
+ LL_WARNS() << "No layer supplied for morph mask." << LL_ENDL;
delete info;
continue;
}
diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h
index bce2540258..1e898026c0 100644..100755
--- a/indra/llappearance/llavatarappearance.h
+++ b/indra/llappearance/llavatarappearance.h
@@ -107,7 +107,6 @@ public:
public:
virtual bool isSelf() const { return false; } // True if this avatar is for this viewer's agent
virtual BOOL isValid() const;
- virtual BOOL isUsingServerBakes() const = 0;
virtual BOOL isUsingLocalAppearance() const = 0;
virtual BOOL isEditingAppearance() const = 0;
@@ -137,14 +136,13 @@ public:
typedef std::map<std::string, LLJoint*> joint_map_t;
joint_map_t mJointMap;
- void computeBodySize();
+ void computeBodySize();
protected:
static BOOL parseSkeletonFile(const std::string& filename);
virtual void buildCharacter();
virtual BOOL loadAvatar();
- virtual void bodySizeChanged() = 0;
BOOL setupBone(const LLAvatarBoneInfo* info, LLJoint* parent, S32 &current_volume_num, S32 &current_joint_num);
BOOL allocateCharacterJoints(U32 num);
@@ -225,7 +223,7 @@ public:
// Composites
//--------------------------------------------------------------------
public:
- virtual void invalidateComposite(LLTexLayerSet* layerset, BOOL upload_result) = 0;
+ virtual void invalidateComposite(LLTexLayerSet* layerset) = 0;
/********************************************************************************
** **
@@ -256,7 +254,7 @@ protected:
// Clothing colors (convenience functions to access visual parameters)
//--------------------------------------------------------------------
public:
- void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color, BOOL upload_bake);
+ void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color);
LLColor4 getClothesColor(LLAvatarAppearanceDefines::ETextureIndex te);
static BOOL teToColorParams(LLAvatarAppearanceDefines::ETextureIndex te, U32 *param_name);
@@ -265,7 +263,7 @@ public:
//--------------------------------------------------------------------
public:
LLColor4 getGlobalColor(const std::string& color_name ) const;
- virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake) = 0;
+ virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color) = 0;
protected:
LLTexGlobalColor* mTexSkinColor;
LLTexGlobalColor* mTexHairColor;
diff --git a/indra/llappearance/llavatarjoint.cpp b/indra/llappearance/llavatarjoint.cpp
index 6ab341af64..2ee3c65a01 100644
--- a/indra/llappearance/llavatarjoint.cpp
+++ b/indra/llappearance/llavatarjoint.cpp
@@ -238,7 +238,7 @@ LLAvatarJointCollisionVolume::LLAvatarJointCollisionVolume()
/*virtual*/
U32 LLAvatarJointCollisionVolume::render( F32 pixelArea, BOOL first_pass, BOOL is_dummy )
{
- llerrs << "Cannot call render() on LLAvatarJointCollisionVolume" << llendl;
+ LL_ERRS() << "Cannot call render() on LLAvatarJointCollisionVolume" << LL_ENDL;
return 0;
}
diff --git a/indra/llappearance/llavatarjointmesh.cpp b/indra/llappearance/llavatarjointmesh.cpp
index 4a5cff1dc3..520ad775db 100644
--- a/indra/llappearance/llavatarjointmesh.cpp
+++ b/indra/llappearance/llavatarjointmesh.cpp
@@ -28,7 +28,6 @@
// Header Files
//-----------------------------------------------------------------------------
#include "linden_common.h"
-#include "imageids.h"
#include "llfasttimer.h"
#include "llrender.h"
@@ -89,7 +88,7 @@ BOOL LLSkinJoint::setupSkinJoint( LLAvatarJoint *joint)
mJoint = joint;
if ( !mJoint )
{
- llinfos << "Can't find joint" << llendl;
+ LL_INFOS() << "Can't find joint" << LL_ENDL;
}
// compute the inverse root skin matrix
@@ -117,7 +116,6 @@ BOOL LLSkinJoint::setupSkinJoint( LLAvatarJoint *joint)
//-----------------------------------------------------------------------------
BOOL LLAvatarJointMesh::sPipelineRender = FALSE;
-EAvatarRenderPass LLAvatarJointMesh::sRenderPass = AVATAR_RENDER_PASS_SINGLE;
U32 LLAvatarJointMesh::sClothingMaskImageName = 0;
LLColor4 LLAvatarJointMesh::sClothingInnerColor;
@@ -306,7 +304,7 @@ void LLAvatarJointMesh::setMesh( LLPolyMesh *mesh )
U32 jn;
for (jn = 0; jn < numJointNames; jn++)
{
- //llinfos << "Setting up joint " << jointNames[jn] << llendl;
+ //LL_INFOS() << "Setting up joint " << jointNames[jn] << LL_ENDL;
LLAvatarJoint* joint = (LLAvatarJoint*)(getRoot()->findJoint(jointNames[jn]) );
mSkinJoints[jn].setupSkinJoint( joint );
}
@@ -318,7 +316,7 @@ void LLAvatarJointMesh::setMesh( LLPolyMesh *mesh )
setupJoint((LLAvatarJoint*)getRoot());
}
-// llinfos << "joint render entries: " << mMesh->mJointRenderData.count() << llendl;
+ LL_DEBUGS() << "joint render entries: " << mMesh->mJointRenderData.size() << LL_ENDL;
}
//-----------------------------------------------------------------------------
@@ -326,10 +324,11 @@ void LLAvatarJointMesh::setMesh( LLPolyMesh *mesh )
//-----------------------------------------------------------------------------
void LLAvatarJointMesh::setupJoint(LLAvatarJoint* current_joint)
{
-// llinfos << "Mesh: " << getName() << llendl;
+ LL_DEBUGS() << "Mesh: " << getName() << LL_ENDL;
-// S32 joint_count = 0;
+ S32 joint_count = 0;
U32 sj;
+
for (sj=0; sj<mNumSkinJoints; sj++)
{
LLSkinJoint &js = mSkinJoints[sj];
@@ -342,23 +341,20 @@ void LLAvatarJointMesh::setupJoint(LLAvatarJoint* current_joint)
// we've found a skinjoint for this joint..
// is the last joint in the array our parent?
- if(mMesh->mJointRenderData.count() && mMesh->mJointRenderData[mMesh->mJointRenderData.count() - 1]->mWorldMatrix == &current_joint->getParent()->getWorldMatrix())
+ if(mMesh->mJointRenderData.size() && mMesh->mJointRenderData[mMesh->mJointRenderData.size() - 1]->mWorldMatrix == &current_joint->getParent()->getWorldMatrix())
{
// ...then just add ourselves
LLAvatarJoint* jointp = js.mJoint;
- mMesh->mJointRenderData.put(new LLJointRenderData(&jointp->getWorldMatrix(), &js));
-// llinfos << "joint " << joint_count << js.mJoint->getName() << llendl;
-// joint_count++;
+ mMesh->mJointRenderData.push_back(new LLJointRenderData(&jointp->getWorldMatrix(), &js));
+ LL_DEBUGS() << "joint " << joint_count++ << js.mJoint->getName() << LL_ENDL;
}
// otherwise add our parent and ourselves
else
{
- mMesh->mJointRenderData.put(new LLJointRenderData(&current_joint->getParent()->getWorldMatrix(), NULL));
-// llinfos << "joint " << joint_count << current_joint->getParent()->getName() << llendl;
-// joint_count++;
- mMesh->mJointRenderData.put(new LLJointRenderData(&current_joint->getWorldMatrix(), &js));
-// llinfos << "joint " << joint_count << current_joint->getName() << llendl;
-// joint_count++;
+ mMesh->mJointRenderData.push_back(new LLJointRenderData(&current_joint->getParent()->getWorldMatrix(), NULL));
+ LL_DEBUGS() << "joint " << joint_count++ << current_joint->getParent()->getName() << LL_ENDL;
+ mMesh->mJointRenderData.push_back(new LLJointRenderData(&current_joint->getWorldMatrix(), &js));
+ LL_DEBUGS() << "joint " << joint_count++ << current_joint->getName() << LL_ENDL;
}
}
diff --git a/indra/llappearance/llavatarjointmesh.h b/indra/llappearance/llavatarjointmesh.h
index 6486932cdf..5980b29b46 100644
--- a/indra/llappearance/llavatarjointmesh.h
+++ b/indra/llappearance/llavatarjointmesh.h
@@ -82,7 +82,6 @@ public:
static BOOL sPipelineRender;
//RN: this is here for testing purposes
static U32 sClothingMaskImageName;
- static EAvatarRenderPass sRenderPass;
static LLColor4 sClothingInnerColor;
public:
diff --git a/indra/llappearance/lldriverparam.cpp b/indra/llappearance/lldriverparam.cpp
index 1f7e8b8652..e630c1118b 100644..100755
--- a/indra/llappearance/lldriverparam.cpp
+++ b/indra/llappearance/lldriverparam.cpp
@@ -89,7 +89,7 @@ BOOL LLDriverParamInfo::parseXml(LLXmlTreeNode* node)
}
else
{
- llerrs << "<driven> Unable to resolve driven parameter: " << driven_id << llendl;
+ LL_ERRS() << "<driven> Unable to resolve driven parameter: " << driven_id << LL_ENDL;
return FALSE;
}
}
@@ -139,9 +139,9 @@ void LLDriverParamInfo::toStream(std::ostream &out)
}
else
{
- llwarns << "could not get parameter " << driven.mDrivenID << " from avatar "
+ LL_WARNS() << "could not get parameter " << driven.mDrivenID << " from avatar "
<< mDriverParam->getAvatarAppearance()
- << " for driver parameter " << getID() << llendl;
+ << " for driver parameter " << getID() << LL_ENDL;
}
out << std::endl;
}
@@ -152,19 +152,31 @@ void LLDriverParamInfo::toStream(std::ostream &out)
// LLDriverParam
//-----------------------------------------------------------------------------
-LLDriverParam::LLDriverParam(LLAvatarAppearance *appearance, LLWearable* wearable /* = NULL */) :
+LLDriverParam::LLDriverParam(LLAvatarAppearance *appearance, LLWearable* wearable /* = NULL */)
+ : LLViewerVisualParam(),
+ mDefaultVec(),
+ mDriven(),
mCurrentDistortionParam( NULL ),
mAvatarAppearance(appearance),
mWearablep(wearable)
{
llassert(mAvatarAppearance);
- if (mWearablep)
- {
- llassert(mAvatarAppearance->isSelf());
- }
+ llassert((mWearablep == NULL) || mAvatarAppearance->isSelf());
mDefaultVec.clear();
}
+LLDriverParam::LLDriverParam(const LLDriverParam& pOther)
+ : LLViewerVisualParam(pOther),
+ mDefaultVec(pOther.mDefaultVec),
+ mDriven(pOther.mDriven),
+ mCurrentDistortionParam(pOther.mCurrentDistortionParam),
+ mAvatarAppearance(pOther.mAvatarAppearance),
+ mWearablep(pOther.mWearablep)
+{
+ llassert(mAvatarAppearance);
+ llassert((mWearablep == NULL) || mAvatarAppearance->isSelf());
+}
+
LLDriverParam::~LLDriverParam()
{
}
@@ -178,7 +190,7 @@ BOOL LLDriverParam::setInfo(LLDriverParamInfo *info)
mID = info->mID;
info->mDriverParam = this;
- setWeight(getDefaultWeight(), FALSE );
+ setWeight(getDefaultWeight());
return TRUE;
}
@@ -186,16 +198,10 @@ BOOL LLDriverParam::setInfo(LLDriverParamInfo *info)
/*virtual*/ LLViewerVisualParam* LLDriverParam::cloneParam(LLWearable* wearable) const
{
llassert(wearable);
- LLDriverParam *new_param = new LLDriverParam(mAvatarAppearance, wearable);
- // FIXME DRANO this clobbers mWearablep, which means any code
- // currently using mWearablep is wrong, or at least untested.
- *new_param = *this;
- //new_param->mWearablep = wearable;
-// new_param->mDriven.clear(); // clear driven list to avoid overwriting avatar driven params from wearables.
- return new_param;
+ return new LLDriverParam(*this);
}
-void LLDriverParam::setWeight(F32 weight, BOOL upload_bake)
+void LLDriverParam::setWeight(F32 weight)
{
F32 min_weight = getMinWeight();
F32 max_weight = getMaxWeight();
@@ -254,7 +260,7 @@ void LLDriverParam::setWeight(F32 weight, BOOL upload_bake)
driven_weight = driven_min;
}
- setDrivenWeight(driven,driven_weight,upload_bake);
+ setDrivenWeight(driven,driven_weight);
continue;
}
else
@@ -278,13 +284,13 @@ void LLDriverParam::setWeight(F32 weight, BOOL upload_bake)
driven_weight = driven_min;
}
- setDrivenWeight(driven,driven_weight,upload_bake);
+ setDrivenWeight(driven,driven_weight);
continue;
}
}
driven_weight = getDrivenWeight(driven, mCurWeight);
- setDrivenWeight(driven,driven_weight,upload_bake);
+ setDrivenWeight(driven,driven_weight);
}
}
@@ -430,9 +436,9 @@ const LLViewerVisualParam* LLDriverParam::getDrivenParam(S32 index) const
//-----------------------------------------------------------------------------
// setAnimationTarget()
//-----------------------------------------------------------------------------
-void LLDriverParam::setAnimationTarget( F32 target_value, BOOL upload_bake )
+void LLDriverParam::setAnimationTarget( F32 target_value)
{
- LLVisualParam::setAnimationTarget(target_value, upload_bake);
+ LLVisualParam::setAnimationTarget(target_value);
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ )
{
@@ -441,16 +447,16 @@ void LLDriverParam::setAnimationTarget( F32 target_value, BOOL upload_bake )
// this isn't normally necessary, as driver params handle interpolation of their driven params
// but texture params need to know to assume their final value at beginning of interpolation
- driven->mParam->setAnimationTarget(driven_weight, upload_bake);
+ driven->mParam->setAnimationTarget(driven_weight);
}
}
//-----------------------------------------------------------------------------
// stopAnimating()
//-----------------------------------------------------------------------------
-void LLDriverParam::stopAnimating(BOOL upload_bake)
+void LLDriverParam::stopAnimating()
{
- LLVisualParam::stopAnimating(upload_bake);
+ LLVisualParam::stopAnimating();
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ )
{
@@ -530,7 +536,7 @@ void LLDriverParam::updateCrossDrivenParams(LLWearableType::EType driven_type)
LLWearable *wearable = mAvatarAppearance->getWearableData()->getTopWearable(driver_type);
if (wearable)
{
- wearable->setVisualParamWeight(mID, wearable->getVisualParamWeight(mID), false);
+ wearable->setVisualParamWeight(mID, wearable->getVisualParamWeight(mID));
}
}
}
@@ -593,7 +599,7 @@ F32 LLDriverParam::getDrivenWeight(const LLDrivenEntry* driven, F32 input_weight
return driven_weight;
}
-void LLDriverParam::setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight, bool upload_bake)
+void LLDriverParam::setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight)
{
bool use_self = false;
if(mWearablep &&
@@ -610,10 +616,10 @@ void LLDriverParam::setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight, bo
if (use_self)
{
// call setWeight through LLVOAvatarSelf so other wearables can be updated with the correct values
- mAvatarAppearance->setVisualParamWeight( (LLVisualParam*)driven->mParam, driven_weight, upload_bake );
+ mAvatarAppearance->setVisualParamWeight( (LLVisualParam*)driven->mParam, driven_weight);
}
else
{
- driven->mParam->setWeight( driven_weight, upload_bake );
+ driven->mParam->setWeight( driven_weight);
}
}
diff --git a/indra/llappearance/lldriverparam.h b/indra/llappearance/lldriverparam.h
index 040c9cf5be..f71c930e5e 100644..100755
--- a/indra/llappearance/lldriverparam.h
+++ b/indra/llappearance/lldriverparam.h
@@ -29,6 +29,7 @@
#include "llviewervisualparam.h"
#include "llwearabletype.h"
+#include <deque>
class LLAvatarAppearance;
class LLDriverParam;
@@ -110,9 +111,9 @@ public:
// LLVisualParam Virtual functions
/*virtual*/ void apply( ESex sex ) {} // apply is called separately for each driven param.
- /*virtual*/ void setWeight(F32 weight, BOOL upload_bake);
- /*virtual*/ void setAnimationTarget( F32 target_value, BOOL upload_bake );
- /*virtual*/ void stopAnimating(BOOL upload_bake);
+ /*virtual*/ void setWeight(F32 weight);
+ /*virtual*/ void setAnimationTarget( F32 target_value);
+ /*virtual*/ void stopAnimating();
/*virtual*/ BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params);
/*virtual*/ void resetDrivenParams();
@@ -128,8 +129,9 @@ public:
const LLViewerVisualParam* getDrivenParam(S32 index) const;
protected:
+ LLDriverParam(const LLDriverParam& pOther);
F32 getDrivenWeight(const LLDrivenEntry* driven, F32 input_weight);
- void setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight, bool upload_bake);
+ void setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight);
LL_ALIGN_16(LLVector4a mDefaultVec); // temp holder
diff --git a/indra/llappearance/lllocaltextureobject.cpp b/indra/llappearance/lllocaltextureobject.cpp
index 7e36a06797..f49cf21512 100644
--- a/indra/llappearance/lllocaltextureobject.cpp
+++ b/indra/llappearance/lllocaltextureobject.cpp
@@ -64,7 +64,7 @@ LLLocalTextureObject::LLLocalTextureObject(const LLLocalTextureObject& lto) :
LLTexLayer* original_layer = lto.getTexLayer(index);
if (!original_layer)
{
- llerrs << "could not clone Local Texture Object: unable to extract texlayer!" << llendl;
+ LL_ERRS() << "could not clone Local Texture Object: unable to extract texlayer!" << LL_ENDL;
continue;
}
diff --git a/indra/llappearance/llpolymesh.cpp b/indra/llappearance/llpolymesh.cpp
index a01457246e..0a7a8d27bb 100644
--- a/indra/llappearance/llpolymesh.cpp
+++ b/indra/llappearance/llpolymesh.cpp
@@ -161,8 +161,8 @@ void LLPolyMeshSharedData::freeMeshData()
// mVertFaceMap.deleteAllData();
}
-// compate_int is used by the qsort function to sort the index array
-int compare_int(const void *a, const void *b);
+// compare_int is used by the qsort function to sort the index array
+S32 compare_int(const void *a, const void *b);
//-----------------------------------------------------------------------------
// genIndices()
@@ -277,13 +277,13 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
//-------------------------------------------------------------------------
if(fileName.empty())
{
- llerrs << "Filename is Empty!" << llendl;
+ LL_ERRS() << "Filename is Empty!" << LL_ENDL;
return FALSE;
}
LLFILE* fp = LLFile::fopen(fileName, "rb"); /*Flawfinder: ignore*/
if (!fp)
{
- llerrs << "can't open: " << fileName << llendl;
+ LL_ERRS() << "can't open: " << fileName << LL_ENDL;
return FALSE;
}
@@ -293,7 +293,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
char header[128]; /*Flawfinder: ignore*/
if (fread(header, sizeof(char), 128, fp) != 128)
{
- llwarns << "Short read" << llendl;
+ LL_WARNS() << "Short read" << LL_ENDL;
}
//-------------------------------------------------------------------------
@@ -302,7 +302,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
BOOL status = FALSE;
if ( strncmp(header, HEADER_BINARY, strlen(HEADER_BINARY)) == 0 ) /*Flawfinder: ignore*/
{
- lldebugs << "Loading " << fileName << llendl;
+ LL_DEBUGS() << "Loading " << fileName << LL_ENDL;
//----------------------------------------------------------------
// File Header (seek past it)
@@ -316,7 +316,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
size_t numRead = fread(&hasWeights, sizeof(U8), 1, fp);
if (numRead != 1)
{
- llerrs << "can't read HasWeights flag from " << fileName << llendl;
+ LL_ERRS() << "can't read HasWeights flag from " << fileName << LL_ENDL;
return FALSE;
}
if (!isLOD())
@@ -331,7 +331,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
numRead = fread(&hasDetailTexCoords, sizeof(U8), 1, fp);
if (numRead != 1)
{
- llerrs << "can't read HasDetailTexCoords flag from " << fileName << llendl;
+ LL_ERRS() << "can't read HasDetailTexCoords flag from " << fileName << LL_ENDL;
return FALSE;
}
@@ -343,7 +343,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(position.mV, sizeof(float), 3);
if (numRead != 3)
{
- llerrs << "can't read Position from " << fileName << llendl;
+ LL_ERRS() << "can't read Position from " << fileName << LL_ENDL;
return FALSE;
}
setPosition( position );
@@ -356,7 +356,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(rotationAngles.mV, sizeof(float), 3);
if (numRead != 3)
{
- llerrs << "can't read RotationAngles from " << fileName << llendl;
+ LL_ERRS() << "can't read RotationAngles from " << fileName << LL_ENDL;
return FALSE;
}
@@ -365,7 +365,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
if (numRead != 1)
{
- llerrs << "can't read RotationOrder from " << fileName << llendl;
+ LL_ERRS() << "can't read RotationOrder from " << fileName << LL_ENDL;
return FALSE;
}
@@ -384,7 +384,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(scale.mV, sizeof(float), 3);
if (numRead != 3)
{
- llerrs << "can't read Scale from " << fileName << llendl;
+ LL_ERRS() << "can't read Scale from " << fileName << LL_ENDL;
return FALSE;
}
setScale( scale );
@@ -405,7 +405,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(&numVertices, sizeof(U16), 1);
if (numRead != 1)
{
- llerrs << "can't read NumVertices from " << fileName << llendl;
+ LL_ERRS() << "can't read NumVertices from " << fileName << LL_ENDL;
return FALSE;
}
@@ -420,7 +420,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(&mBaseCoords[i], sizeof(float), 3);
if (numRead != 3)
{
- llerrs << "can't read Coordinates from " << fileName << llendl;
+ LL_ERRS() << "can't read Coordinates from " << fileName << LL_ENDL;
return FALSE;
}
}
@@ -434,7 +434,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(&mBaseNormals[i], sizeof(float), 3);
if (numRead != 3)
{
- llerrs << " can't read Normals from " << fileName << llendl;
+ LL_ERRS() << " can't read Normals from " << fileName << LL_ENDL;
return FALSE;
}
}
@@ -448,7 +448,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(&mBaseBinormals[i], sizeof(float), 3);
if (numRead != 3)
{
- llerrs << " can't read Binormals from " << fileName << llendl;
+ LL_ERRS() << " can't read Binormals from " << fileName << LL_ENDL;
return FALSE;
}
}
@@ -460,7 +460,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(mTexCoords, sizeof(float), 2*numVertices);
if (numRead != numVertices)
{
- llerrs << "can't read TexCoords from " << fileName << llendl;
+ LL_ERRS() << "can't read TexCoords from " << fileName << LL_ENDL;
return FALSE;
}
@@ -473,7 +473,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(mDetailTexCoords, sizeof(float), 2*numVertices);
if (numRead != numVertices)
{
- llerrs << "can't read DetailTexCoords from " << fileName << llendl;
+ LL_ERRS() << "can't read DetailTexCoords from " << fileName << LL_ENDL;
return FALSE;
}
}
@@ -487,7 +487,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(mWeights, sizeof(float), numVertices);
if (numRead != numVertices)
{
- llerrs << "can't read Weights from " << fileName << llendl;
+ LL_ERRS() << "can't read Weights from " << fileName << LL_ENDL;
return FALSE;
}
}
@@ -501,7 +501,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(&numFaces, sizeof(U16), 1);
if (numRead != 1)
{
- llerrs << "can't read NumFaces from " << fileName << llendl;
+ LL_ERRS() << "can't read NumFaces from " << fileName << LL_ENDL;
return FALSE;
}
allocateFaceData( numFaces );
@@ -519,7 +519,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(face, sizeof(U16), 3);
if (numRead != 3)
{
- llerrs << "can't read Face[" << i << "] from " << fileName << llendl;
+ LL_ERRS() << "can't read Face[" << i << "] from " << fileName << LL_ENDL;
return FALSE;
}
if (mReferenceData)
@@ -547,10 +547,10 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
// S32 j;
// for(j = 0; j < 3; j++)
// {
-// LLDynamicArray<S32> *face_list = mVertFaceMap.getIfThere(face[j]);
+// std::vector<S32> *face_list = mVertFaceMap.getIfThere(face[j]);
// if (!face_list)
// {
-// face_list = new LLDynamicArray<S32>;
+// face_list = new std::vector<S32>;
// mVertFaceMap.addData(face[j], face_list);
// }
// face_list->put(i);
@@ -559,10 +559,10 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
numTris++;
}
- lldebugs << "verts: " << numVertices
+ LL_DEBUGS() << "verts: " << numVertices
<< ", faces: " << numFaces
<< ", tris: " << numTris
- << llendl;
+ << LL_ENDL;
//----------------------------------------------------------------
// NumSkinJoints
@@ -576,7 +576,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
llendianswizzle(&numSkinJoints, sizeof(U16), 1);
if (numRead != 1)
{
- llerrs << "can't read NumSkinJoints from " << fileName << llendl;
+ LL_ERRS() << "can't read NumSkinJoints from " << fileName << LL_ENDL;
return FALSE;
}
allocateJointNames( numSkinJoints );
@@ -592,7 +592,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
jointName[sizeof(jointName)-1] = '\0'; // ensure nul-termination
if (numRead != 1)
{
- llerrs << "can't read Skin[" << i << "].Name from " << fileName << llendl;
+ LL_ERRS() << "can't read Skin[" << i << "].Name from " << fileName << LL_ENDL;
return FALSE;
}
@@ -687,12 +687,12 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
S32 remapDst;
if (fread(&remapSrc, sizeof(S32), 1, fp) != 1)
{
- llerrs << "can't read source vertex in vertex remap data" << llendl;
+ LL_ERRS() << "can't read source vertex in vertex remap data" << LL_ENDL;
break;
}
if (fread(&remapDst, sizeof(S32), 1, fp) != 1)
{
- llerrs << "can't read destination vertex in vertex remap data" << llendl;
+ LL_ERRS() << "can't read destination vertex in vertex remap data" << LL_ENDL;
break;
}
llendianswizzle(&remapSrc, sizeof(S32), 1);
@@ -707,7 +707,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
}
else
{
- llerrs << "invalid mesh file header: " << fileName << llendl;
+ LL_ERRS() << "invalid mesh file header: " << fileName << LL_ENDL;
status = FALSE;
}
@@ -808,15 +808,8 @@ LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_
//-----------------------------------------------------------------------------
LLPolyMesh::~LLPolyMesh()
{
- S32 i;
- for (i = 0; i < mJointRenderData.count(); i++)
- {
- delete mJointRenderData[i];
- mJointRenderData[i] = NULL;
- }
-
- ll_aligned_free_16(mVertexData);
-
+ delete_and_clear(mJointRenderData);
+ ll_aligned_free_16(mVertexData);
}
@@ -831,7 +824,7 @@ LLPolyMesh *LLPolyMesh::getMesh(const std::string &name, LLPolyMesh* reference_m
LLPolyMeshSharedData* meshSharedData = get_if_there(sGlobalSharedMeshList, name, (LLPolyMeshSharedData*)NULL);
if (meshSharedData)
{
-// llinfos << "Polymesh " << name << " found in global mesh table." << llendl;
+// LL_INFOS() << "Polymesh " << name << " found in global mesh table." << LL_ENDL;
LLPolyMesh *poly_mesh = new LLPolyMesh(meshSharedData, reference_mesh);
return poly_mesh;
}
@@ -855,7 +848,7 @@ LLPolyMesh *LLPolyMesh::getMesh(const std::string &name, LLPolyMesh* reference_m
LLPolyMesh *poly_mesh = new LLPolyMesh(mesh_data, reference_mesh);
-// llinfos << "Polymesh " << name << " added to global mesh table." << llendl;
+// LL_INFOS() << "Polymesh " << name << " added to global mesh table." << LL_ENDL;
sGlobalSharedMeshList[name] = poly_mesh->mSharedData;
return poly_mesh;
@@ -889,10 +882,10 @@ void LLPolyMesh::dumpDiagInfo()
std::string buf;
- llinfos << "-----------------------------------------------------" << llendl;
- llinfos << " Global PolyMesh Table (DEBUG only)" << llendl;
- llinfos << " Verts Faces Mem(KB) Name" << llendl;
- llinfos << "-----------------------------------------------------" << llendl;
+ LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
+ LL_INFOS() << " Global PolyMesh Table (DEBUG only)" << LL_ENDL;
+ LL_INFOS() << " Verts Faces Mem(KB) Name" << LL_ENDL;
+ LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
// print each loaded mesh, and it's memory usage
for(LLPolyMeshSharedDataTable::iterator iter = sGlobalSharedMeshList.begin();
@@ -906,17 +899,17 @@ void LLPolyMesh::dumpDiagInfo()
U32 num_kb = mesh->getNumKB();
buf = llformat("%8d %8d %8d %s", num_verts, num_faces, num_kb, mesh_name.c_str());
- llinfos << buf << llendl;
+ LL_INFOS() << buf << LL_ENDL;
total_verts += num_verts;
total_faces += num_faces;
total_kb += num_kb;
}
- llinfos << "-----------------------------------------------------" << llendl;
+ LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
buf = llformat("%8d %8d %8d TOTAL", total_verts, total_faces, total_kb );
- llinfos << buf << llendl;
- llinfos << "-----------------------------------------------------" << llendl;
+ LL_INFOS() << buf << LL_ENDL;
+ LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
}
//-----------------------------------------------------------------------------
diff --git a/indra/llappearance/llpolymesh.h b/indra/llappearance/llpolymesh.h
index ef1dfb1adb..83659d9514 100644
--- a/indra/llappearance/llpolymesh.h
+++ b/indra/llappearance/llpolymesh.h
@@ -36,7 +36,6 @@
#include "llquaternion.h"
#include "llpolymorph.h"
#include "lljoint.h"
-//#include "lldarray.h"
class LLSkinJoint;
class LLAvatarAppearance;
@@ -322,7 +321,7 @@ public:
void setAvatar(LLAvatarAppearance* avatarp) { mAvatarp = avatarp; }
LLAvatarAppearance* getAvatar() { return mAvatarp; }
- LLDynamicArray<LLJointRenderData*> mJointRenderData;
+ std::vector<LLJointRenderData*> mJointRenderData;
U32 mFaceVertexOffset;
U32 mFaceVertexCount;
diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp
index 93c2f15a53..e3992a080e 100644
--- a/indra/llappearance/llpolymorph.cpp
+++ b/indra/llappearance/llpolymorph.cpp
@@ -35,6 +35,7 @@
#include "llxmltree.h"
#include "llendianswizzle.h"
#include "llpolymesh.h"
+#include "llfasttimer.h"
//#include "../tools/imdebug/imdebug.h"
@@ -112,7 +113,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
llendianswizzle(&numVertices, sizeof(S32), 1);
if (numRead != 1)
{
- llwarns << "Can't read number of morph target vertices" << llendl;
+ LL_WARNS() << "Can't read number of morph target vertices" << LL_ENDL;
return FALSE;
}
@@ -149,13 +150,13 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
llendianswizzle(&mVertexIndices[v], sizeof(U32), 1);
if (numRead != 1)
{
- llwarns << "Can't read morph target vertex number" << llendl;
+ LL_WARNS() << "Can't read morph target vertex number" << LL_ENDL;
return FALSE;
}
if (mVertexIndices[v] > 10000)
{
- llerrs << "Bad morph index: " << mVertexIndices[v] << llendl;
+ LL_ERRS() << "Bad morph index: " << mVertexIndices[v] << LL_ENDL;
}
@@ -163,7 +164,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
llendianswizzle(&mCoords[v], sizeof(F32), 3);
if (numRead != 3)
{
- llwarns << "Can't read morph target vertex coordinates" << llendl;
+ LL_WARNS() << "Can't read morph target vertex coordinates" << LL_ENDL;
return FALSE;
}
@@ -183,7 +184,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
llendianswizzle(&mNormals[v], sizeof(F32), 3);
if (numRead != 3)
{
- llwarns << "Can't read morph target normal" << llendl;
+ LL_WARNS() << "Can't read morph target normal" << LL_ENDL;
return FALSE;
}
@@ -191,7 +192,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
llendianswizzle(&mBinormals[v], sizeof(F32), 3);
if (numRead != 3)
{
- llwarns << "Can't read morph target binormal" << llendl;
+ LL_WARNS() << "Can't read morph target binormal" << LL_ENDL;
return FALSE;
}
@@ -200,7 +201,7 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
llendianswizzle(&mTexCoords[v].mV, sizeof(F32), 2);
if (numRead != 2)
{
- llwarns << "Can't read morph target uv" << llendl;
+ LL_WARNS() << "Can't read morph target uv" << LL_ENDL;
return FALSE;
}
@@ -268,7 +269,7 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
if( !node->getFastAttributeString( name_string, mMorphName ) )
{
- llwarns << "Avatar file: <param> is missing name attribute" << llendl;
+ LL_WARNS() << "Avatar file: <param> is missing name attribute" << LL_ENDL;
return FALSE; // Continue, ignoring this tag
}
@@ -279,8 +280,8 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
if (NULL == paramNode)
{
- llwarns << "Failed to getChildByName(\"param_morph\")"
- << llendl;
+ LL_WARNS() << "Failed to getChildByName(\"param_morph\")"
+ << LL_ENDL;
return FALSE;
}
@@ -314,10 +315,27 @@ BOOL LLPolyMorphTargetInfo::parseXml(LLXmlTreeNode* node)
// LLPolyMorphTarget()
//-----------------------------------------------------------------------------
LLPolyMorphTarget::LLPolyMorphTarget(LLPolyMesh *poly_mesh)
- : mMorphData(NULL), mMesh(poly_mesh),
- mVertMask(NULL),
- mLastSex(SEX_FEMALE),
- mNumMorphMasksPending(0)
+ : LLViewerVisualParam(),
+ mMorphData(NULL),
+ mMesh(poly_mesh),
+ mVertMask(NULL),
+ mLastSex(SEX_FEMALE),
+ mNumMorphMasksPending(0),
+ mVolumeMorphs()
+{
+}
+
+//-----------------------------------------------------------------------------
+// LLPolyMorphTarget()
+//-----------------------------------------------------------------------------
+LLPolyMorphTarget::LLPolyMorphTarget(const LLPolyMorphTarget& pOther)
+ : LLViewerVisualParam(pOther),
+ mMorphData(pOther.mMorphData),
+ mMesh(pOther.mMesh),
+ mVertMask(pOther.mVertMask == NULL ? NULL : new LLPolyVertexMask(*pOther.mVertMask)),
+ mLastSex(pOther.mLastSex),
+ mNumMorphMasksPending(pOther.mNumMorphMasksPending),
+ mVolumeMorphs(pOther.mVolumeMorphs)
{
}
@@ -326,10 +344,8 @@ LLPolyMorphTarget::LLPolyMorphTarget(LLPolyMesh *poly_mesh)
//-----------------------------------------------------------------------------
LLPolyMorphTarget::~LLPolyMorphTarget()
{
- if (mVertMask)
- {
- delete mVertMask;
- }
+ delete mVertMask;
+ mVertMask = NULL;
}
//-----------------------------------------------------------------------------
@@ -342,7 +358,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
return FALSE;
mInfo = info;
mID = info->mID;
- setWeight(getDefaultWeight(), FALSE );
+ setWeight(getDefaultWeight());
LLAvatarAppearance* avatarp = mMesh->getAvatar();
LLPolyMorphTargetInfo::volume_info_list_t::iterator iter;
@@ -376,7 +392,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
}
if (!mMorphData)
{
- llwarns << "No morph target named " << morph_param_name << " found in mesh." << llendl;
+ LL_WARNS() << "No morph target named " << morph_param_name << " found in mesh." << LL_ENDL;
return FALSE; // Continue, ignoring this tag
}
return TRUE;
@@ -384,9 +400,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
/*virtual*/ LLViewerVisualParam* LLPolyMorphTarget::cloneParam(LLWearable* wearable) const
{
- LLPolyMorphTarget *new_param = new LLPolyMorphTarget(mMesh);
- *new_param = *this;
- return new_param;
+ return new LLPolyMorphTarget(*this);
}
#if 0 // obsolete
@@ -524,7 +538,7 @@ F32 LLPolyMorphTarget::getMaxDistortion()
//-----------------------------------------------------------------------------
// apply()
//-----------------------------------------------------------------------------
-static LLFastTimer::DeclareTimer FTM_APPLY_MORPH_TARGET("Apply Morph");
+static LLTrace::BlockTimerStatHandle FTM_APPLY_MORPH_TARGET("Apply Morph");
void LLPolyMorphTarget::apply( ESex avatar_sex )
{
@@ -533,7 +547,7 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
return;
}
- LLFastTimer t(FTM_APPLY_MORPH_TARGET);
+ LL_RECORD_BLOCK_TIME(FTM_APPLY_MORPH_TARGET);
mLastSex = avatar_sex;
@@ -619,9 +633,9 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
tangent.setCross3(scaled_binormals[vert_index_mesh], norm);
LLVector4a& normalized_binormal = binormals[vert_index_mesh];
- normalized_binormal.setCross3(norm, tangent);
+ normalized_binormal.setCross3(norm, tangent);
normalized_binormal.normalize3fast();
-
+
tex_coords[vert_index_mesh] += mMorphData->mTexCoords[vert_index_morph] * delta_weight * maskWeight;
}
@@ -721,10 +735,25 @@ void LLPolyMorphTarget::applyMask(U8 *maskTextureData, S32 width, S32 height, S3
// LLPolyVertexMask()
//-----------------------------------------------------------------------------
LLPolyVertexMask::LLPolyVertexMask(LLPolyMorphData* morph_data)
+ : mWeights(new F32[morph_data->mNumIndices]),
+ mMorphData(morph_data),
+ mWeightsGenerated(FALSE)
+{
+ llassert(mMorphData != NULL);
+ llassert(mMorphData->mNumIndices > 0);
+}
+
+//-----------------------------------------------------------------------------
+// LLPolyVertexMask()
+//-----------------------------------------------------------------------------
+LLPolyVertexMask::LLPolyVertexMask(const LLPolyVertexMask& pOther)
+ : mWeights(new F32[pOther.mMorphData->mNumIndices]),
+ mMorphData(pOther.mMorphData),
+ mWeightsGenerated(pOther.mWeightsGenerated)
{
- mWeights = new F32[morph_data->mNumIndices];
- mMorphData = morph_data;
- mWeightsGenerated = FALSE;
+ llassert(mMorphData != NULL);
+ llassert(mMorphData->mNumIndices > 0);
+ memcpy(mWeights, pOther.mWeights, sizeof(F32) * mMorphData->mNumIndices);
}
//-----------------------------------------------------------------------------
@@ -732,7 +761,8 @@ LLPolyVertexMask::LLPolyVertexMask(LLPolyMorphData* morph_data)
//-----------------------------------------------------------------------------
LLPolyVertexMask::~LLPolyVertexMask()
{
- delete[] mWeights;
+ delete [] mWeights;
+ mWeights = NULL;
}
//-----------------------------------------------------------------------------
diff --git a/indra/llappearance/llpolymorph.h b/indra/llappearance/llpolymorph.h
index ee380ae7c3..7e712f9e94 100644
--- a/indra/llappearance/llpolymorph.h
+++ b/indra/llappearance/llpolymorph.h
@@ -91,6 +91,7 @@ class LLPolyVertexMask
{
public:
LLPolyVertexMask(LLPolyMorphData* morph_data);
+ LLPolyVertexMask(const LLPolyVertexMask& pOther);
~LLPolyVertexMask();
void generateMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert, LLVector4a *clothing_weights);
@@ -182,6 +183,8 @@ public:
void addPendingMorphMask() { mNumMorphMasksPending++; }
protected:
+ LLPolyMorphTarget(const LLPolyMorphTarget& pOther);
+
LLPolyMorphData* mMorphData;
LLPolyMesh* mMesh;
LLPolyVertexMask * mVertMask;
diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp
index 4ba16691c2..ea29cbd451 100644
--- a/indra/llappearance/llpolyskeletaldistortion.cpp
+++ b/indra/llappearance/llpolyskeletaldistortion.cpp
@@ -28,19 +28,12 @@
// Header Files
//-----------------------------------------------------------------------------
#include "llpreprocessor.h"
-#include "llerrorlegacy.h"
-//#include "llcommon.h"
-//#include "llmemory.h"
+#include "llerror.h"
#include "llavatarappearance.h"
#include "llavatarjoint.h"
#include "llpolymorph.h"
-//#include "llviewercontrol.h"
-//#include "llxmltree.h"
-//#include "llvoavatar.h"
#include "llwearable.h"
-//#include "lldir.h"
-//#include "llvolume.h"
-//#include "llendianswizzle.h"
+#include "llfasttimer.h"
#include "llpolyskeletaldistortion.h"
@@ -62,8 +55,8 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
if (NULL == skeletalParam)
{
- llwarns << "Failed to getChildByName(\"param_skeleton\")"
- << llendl;
+ LL_WARNS() << "Failed to getChildByName(\"param_skeleton\")"
+ << LL_ENDL;
return FALSE;
}
@@ -79,14 +72,14 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
if (!bone->getFastAttributeString(name_string, name))
{
- llwarns << "No bone name specified for skeletal param." << llendl;
+ LL_WARNS() << "No bone name specified for skeletal param." << LL_ENDL;
continue;
}
static LLStdStringHandle scale_string = LLXmlTree::addAttributeString("scale");
if (!bone->getFastAttributeVector3(scale_string, scale))
{
- llwarns << "No scale specified for bone " << name << "." << llendl;
+ LL_WARNS() << "No scale specified for bone " << name << "." << LL_ENDL;
continue;
}
@@ -100,7 +93,7 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
}
else
{
- llwarns << "Unrecognized element " << bone->getName() << " in skeletal distortion" << llendl;
+ LL_WARNS() << "Unrecognized element " << bone->getName() << " in skeletal distortion" << LL_ENDL;
continue;
}
}
@@ -111,9 +104,25 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node)
// LLPolySkeletalDistortion()
//-----------------------------------------------------------------------------
LLPolySkeletalDistortion::LLPolySkeletalDistortion(LLAvatarAppearance *avatarp)
+ : LLViewerVisualParam(),
+ mDefaultVec(),
+ mJointScales(),
+ mJointOffsets(),
+ mAvatar(avatarp)
+{
+ mDefaultVec.splat(0.001f);
+}
+
+//-----------------------------------------------------------------------------
+// LLPolySkeletalDistortion()
+//-----------------------------------------------------------------------------
+LLPolySkeletalDistortion::LLPolySkeletalDistortion(const LLPolySkeletalDistortion &pOther)
+ : LLViewerVisualParam(pOther),
+ mDefaultVec(pOther.mDefaultVec),
+ mJointScales(pOther.mJointScales),
+ mJointOffsets(pOther.mJointOffsets),
+ mAvatar(pOther.mAvatar)
{
- mAvatar = avatarp;
- mDefaultVec.splat(0.001f);
}
//-----------------------------------------------------------------------------
@@ -130,7 +139,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
return FALSE;
mInfo = info;
mID = info->mID;
- setWeight(getDefaultWeight(), FALSE );
+ setWeight(getDefaultWeight());
LLPolySkeletalDistortionInfo::bone_info_list_t::iterator iter;
for (iter = getInfo()->mBoneInfoList.begin(); iter != getInfo()->mBoneInfoList.end(); iter++)
@@ -139,13 +148,13 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
LLJoint* joint = mAvatar->getJoint(bone_info->mBoneName);
if (!joint)
{
- llwarns << "Joint " << bone_info->mBoneName << " not found." << llendl;
+ LL_WARNS() << "Joint " << bone_info->mBoneName << " not found." << LL_ENDL;
continue;
}
if (mJointScales.find(joint) != mJointScales.end())
{
- llwarns << "Scale deformation already supplied for joint " << joint->getName() << "." << llendl;
+ LL_WARNS() << "Scale deformation already supplied for joint " << joint->getName() << "." << LL_ENDL;
}
// store it
@@ -168,7 +177,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
{
if (mJointOffsets.find(joint) != mJointOffsets.end())
{
- llwarns << "Offset deformation already supplied for joint " << joint->getName() << "." << llendl;
+ LL_WARNS() << "Offset deformation already supplied for joint " << joint->getName() << "." << LL_ENDL;
}
mJointOffsets[joint] = bone_info->mPositionDeformation;
}
@@ -178,21 +187,19 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
/*virtual*/ LLViewerVisualParam* LLPolySkeletalDistortion::cloneParam(LLWearable* wearable) const
{
- LLPolySkeletalDistortion *new_param = new LLPolySkeletalDistortion(mAvatar);
- *new_param = *this;
- return new_param;
+ return new LLPolySkeletalDistortion(*this);
}
//-----------------------------------------------------------------------------
// apply()
//-----------------------------------------------------------------------------
-static LLFastTimer::DeclareTimer FTM_POLYSKELETAL_DISTORTION_APPLY("Skeletal Distortion");
+static LLTrace::BlockTimerStatHandle FTM_POLYSKELETAL_DISTORTION_APPLY("Skeletal Distortion");
void LLPolySkeletalDistortion::apply( ESex avatar_sex )
{
- LLFastTimer t(FTM_POLYSKELETAL_DISTORTION_APPLY);
+ LL_RECORD_BLOCK_TIME(FTM_POLYSKELETAL_DISTORTION_APPLY);
- F32 effective_weight = ( getSex() & avatar_sex ) ? mCurWeight : getDefaultWeight();
+ F32 effective_weight = ( getSex() & avatar_sex ) ? mCurWeight : getDefaultWeight();
LLJoint* joint;
joint_vec_map_t::iterator iter;
@@ -204,8 +211,10 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex )
joint = iter->first;
LLVector3 newScale = joint->getScale();
LLVector3 scaleDelta = iter->second;
- newScale = newScale + (effective_weight * scaleDelta) - (mLastWeight * scaleDelta);
- joint->setScale(newScale);
+ newScale = newScale + (effective_weight * scaleDelta) - (mLastWeight * scaleDelta);
+ //An aspect of attached mesh objects (which contain joint offsets) that need to be cleaned up when detached
+ joint->storeScaleForReset( newScale );
+ joint->setScale(newScale);
}
for (iter = mJointOffsets.begin();
@@ -214,8 +223,8 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex )
{
joint = iter->first;
LLVector3 newPosition = joint->getPosition();
- LLVector3 positionDelta = iter->second;
- newPosition = newPosition + (effective_weight * positionDelta) - (mLastWeight * positionDelta);
+ LLVector3 positionDelta = iter->second;
+ newPosition = newPosition + (effective_weight * positionDelta) - (mLastWeight * positionDelta);
joint->setPosition(newPosition);
}
diff --git a/indra/llappearance/llpolyskeletaldistortion.h b/indra/llappearance/llpolyskeletaldistortion.h
index 774bc7dfa2..ea2adb8a87 100644
--- a/indra/llappearance/llpolyskeletaldistortion.h
+++ b/indra/llappearance/llpolyskeletaldistortion.h
@@ -39,7 +39,6 @@
//#include "llpolymorph.h"
#include "lljoint.h"
#include "llviewervisualparam.h"
-//#include "lldarray.h"
//class LLSkinJoint;
class LLAvatarAppearance;
@@ -119,6 +118,8 @@ public:
/*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh){index = 0; poly_mesh = NULL; return NULL;};
protected:
+ LLPolySkeletalDistortion(const LLPolySkeletalDistortion& pOther);
+
LL_ALIGN_16(LLVector4a mDefaultVec);
typedef std::map<LLJoint*, LLVector3> joint_vec_map_t;
joint_vec_map_t mJointScales;
diff --git a/indra/llappearance/lltexglobalcolor.cpp b/indra/llappearance/lltexglobalcolor.cpp
index 16b0260d1a..3df2254b14 100644..100755
--- a/indra/llappearance/lltexglobalcolor.cpp
+++ b/indra/llappearance/lltexglobalcolor.cpp
@@ -90,22 +90,36 @@ const std::string& LLTexGlobalColor::getName() const
//-----------------------------------------------------------------------------
// LLTexParamGlobalColor
//-----------------------------------------------------------------------------
-LLTexParamGlobalColor::LLTexParamGlobalColor(LLTexGlobalColor* tex_global_color) :
- LLTexLayerParamColor(tex_global_color->getAvatarAppearance()),
+LLTexParamGlobalColor::LLTexParamGlobalColor(LLTexGlobalColor* tex_global_color)
+ : LLTexLayerParamColor(tex_global_color->getAvatarAppearance()),
mTexGlobalColor(tex_global_color)
{
}
+//-----------------------------------------------------------------------------
+// LLTexParamGlobalColor
+//-----------------------------------------------------------------------------
+LLTexParamGlobalColor::LLTexParamGlobalColor(const LLTexParamGlobalColor& pOther)
+ : LLTexLayerParamColor(pOther),
+ mTexGlobalColor(pOther.mTexGlobalColor)
+{
+}
+
+//-----------------------------------------------------------------------------
+// ~LLTexParamGlobalColor
+//-----------------------------------------------------------------------------
+LLTexParamGlobalColor::~LLTexParamGlobalColor()
+{
+}
+
/*virtual*/ LLViewerVisualParam* LLTexParamGlobalColor::cloneParam(LLWearable* wearable) const
{
- LLTexParamGlobalColor *new_param = new LLTexParamGlobalColor(mTexGlobalColor);
- *new_param = *this;
- return new_param;
+ return new LLTexParamGlobalColor(*this);
}
-void LLTexParamGlobalColor::onGlobalColorChanged(bool upload_bake)
+void LLTexParamGlobalColor::onGlobalColorChanged()
{
- mAvatarAppearance->onGlobalColorChanged(mTexGlobalColor, upload_bake);
+ mAvatarAppearance->onGlobalColorChanged(mTexGlobalColor);
}
//-----------------------------------------------------------------------------
@@ -129,7 +143,7 @@ BOOL LLTexGlobalColorInfo::parseXml(LLXmlTreeNode* node)
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
if (!node->getFastAttributeString(name_string, mName))
{
- llwarns << "<global_color> element is missing name attribute." << llendl;
+ LL_WARNS() << "<global_color> element is missing name attribute." << LL_ENDL;
return FALSE;
}
// <param> sub-element
diff --git a/indra/llappearance/lltexglobalcolor.h b/indra/llappearance/lltexglobalcolor.h
index 2867479876..3b426053de 100644..100755
--- a/indra/llappearance/lltexglobalcolor.h
+++ b/indra/llappearance/lltexglobalcolor.h
@@ -73,9 +73,11 @@ class LLTexParamGlobalColor : public LLTexLayerParamColor
{
public:
LLTexParamGlobalColor(LLTexGlobalColor *tex_color);
+ virtual ~LLTexParamGlobalColor();
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const;
protected:
- /*virtual*/ void onGlobalColorChanged(bool upload_bake);
+ LLTexParamGlobalColor(const LLTexParamGlobalColor& pOther);
+ /*virtual*/ void onGlobalColorChanged();
private:
LLTexGlobalColor* mTexGlobalColor;
};
diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp
index 63d01999f0..2cf86bb4fe 100644
--- a/indra/llappearance/lltexlayer.cpp
+++ b/indra/llappearance/lltexlayer.cpp
@@ -30,7 +30,6 @@
#include "llavatarappearance.h"
#include "llcrc.h"
-#include "imageids.h"
#include "llimagej2c.h"
#include "llimagetga.h"
#include "lldir.h"
@@ -38,11 +37,13 @@
#include "llvfs.h"
#include "lltexlayerparams.h"
#include "lltexturemanagerbridge.h"
+#include "lllocaltextureobject.h"
#include "../llui/llui.h"
#include "llwearable.h"
#include "llwearabledata.h"
#include "llvertexbuffer.h"
#include "llviewervisualparam.h"
+#include "llfasttimer.h"
//#include "../tools/imdebug/imdebug.h"
@@ -210,7 +211,7 @@ BOOL LLTexLayerSetInfo::parseXml(LLXmlTreeNode* node)
static LLStdStringHandle body_region_string = LLXmlTree::addAttributeString("body_region");
if( !node->getFastAttributeString( body_region_string, mBodyRegion ) )
{
- llwarns << "<layer_set> is missing body_region attribute" << llendl;
+ LL_WARNS() << "<layer_set> is missing body_region attribute" << LL_ENDL;
return FALSE;
}
@@ -521,10 +522,10 @@ const LLTexLayerSetBuffer* LLTexLayerSet::getComposite() const
return mComposite;
}
-static LLFastTimer::DeclareTimer FTM_GATHER_MORPH_MASK_ALPHA("gatherMorphMaskAlpha");
+static LLTrace::BlockTimerStatHandle FTM_GATHER_MORPH_MASK_ALPHA("gatherMorphMaskAlpha");
void LLTexLayerSet::gatherMorphMaskAlpha(U8 *data, S32 origin_x, S32 origin_y, S32 width, S32 height)
{
- LLFastTimer t(FTM_GATHER_MORPH_MASK_ALPHA);
+ LL_RECORD_BLOCK_TIME(FTM_GATHER_MORPH_MASK_ALPHA);
memset(data, 255, width * height);
for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ )
@@ -537,10 +538,10 @@ void LLTexLayerSet::gatherMorphMaskAlpha(U8 *data, S32 origin_x, S32 origin_y, S
renderAlphaMaskTextures(origin_x, origin_y, width, height, true);
}
-static LLFastTimer::DeclareTimer FTM_RENDER_ALPHA_MASK_TEXTURES("renderAlphaMaskTextures");
+static LLTrace::BlockTimerStatHandle FTM_RENDER_ALPHA_MASK_TEXTURES("renderAlphaMaskTextures");
void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height, bool forceClear)
{
- LLFastTimer t(FTM_RENDER_ALPHA_MASK_TEXTURES);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_MASK_TEXTURES);
const LLTexLayerSetInfo *info = getInfo();
bool use_shaders = LLGLSLShader::sNoFixedFunction;
@@ -740,13 +741,13 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
}
if (mLocalTexture == TEX_NUM_INDICES)
{
- llwarns << "<texture> element has invalid local_texture attribute: " << mName << " " << local_texture_name << llendl;
+ LL_WARNS() << "<texture> element has invalid local_texture attribute: " << mName << " " << local_texture_name << LL_ENDL;
return FALSE;
}
}
else
{
- llwarns << "<texture> element is missing a required attribute. " << mName << llendl;
+ LL_WARNS() << "<texture> element is missing a required attribute. " << mName << LL_ENDL;
return FALSE;
}
}
@@ -809,7 +810,7 @@ BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance)
LLTexLayerParamColor* param_color = new LLTexLayerParamColor(appearance);
if (!param_color->setInfo(color_info, TRUE))
{
- llwarns << "NULL TexLayer Color Param could not be added to visual param list. Deleting." << llendl;
+ LL_WARNS() << "NULL TexLayer Color Param could not be added to visual param list. Deleting." << LL_ENDL;
delete param_color;
success = FALSE;
}
@@ -823,7 +824,7 @@ BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance)
LLTexLayerParamAlpha* param_alpha = new LLTexLayerParamAlpha(appearance);
if (!param_alpha->setInfo(alpha_info, TRUE))
{
- llwarns << "NULL TexLayer Alpha Param could not be added to visual param list. Deleting." << llendl;
+ LL_WARNS() << "NULL TexLayer Alpha Param could not be added to visual param list. Deleting." << LL_ENDL;
delete param_alpha;
success = FALSE;
}
@@ -856,7 +857,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab
// Not a critical warning, but could be useful for debugging later issues. -Nyx
if (mInfo != NULL)
{
- llwarns << "mInfo != NULL" << llendl;
+ LL_WARNS() << "mInfo != NULL" << LL_ENDL;
}
mInfo = info;
//mID = info->mID; // No ID
@@ -1212,7 +1213,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
}
else
{
- llinfos << "lto not defined or image not defined: " << getInfo()->getLocalTexture() << " lto: " << mLocalTextureObject << llendl;
+ LL_INFOS() << "lto not defined or image not defined: " << getInfo()->getLocalTexture() << " lto: " << mLocalTextureObject << LL_ENDL;
}
// if( mTexLayerSet->getAvatarAppearance()->getLocalTextureGL((ETextureIndex)getInfo()->mLocalTexture, &image_gl ) )
{
@@ -1300,7 +1301,7 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height)
if( !success )
{
- llinfos << "LLTexLayer::render() partial: " << getInfo()->mName << llendl;
+ LL_INFOS() << "LLTexLayer::render() partial: " << getInfo()->mName << LL_ENDL;
}
return success;
}
@@ -1432,15 +1433,15 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
addAlphaMask(data, originX, originY, width, height);
}
-static LLFastTimer::DeclareTimer FTM_RENDER_MORPH_MASKS("renderMorphMasks");
+static LLTrace::BlockTimerStatHandle FTM_RENDER_MORPH_MASKS("renderMorphMasks");
void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLColor4 &layer_color, bool force_render)
{
if (!force_render && !hasMorph())
{
- lldebugs << "skipping renderMorphMasks for " << getUUID() << llendl;
+ LL_DEBUGS() << "skipping renderMorphMasks for " << getUUID() << LL_ENDL;
return;
}
- LLFastTimer t(FTM_RENDER_MORPH_MASKS);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_MORPH_MASKS);
BOOL success = TRUE;
llassert( !mParamAlphaList.empty() );
@@ -1478,7 +1479,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
success &= param->render( x, y, width, height );
if (!success && !force_render)
{
- lldebugs << "Failed to render param " << param->getID() << " ; skipping morph mask." << llendl;
+ LL_DEBUGS() << "Failed to render param " << param->getID() << " ; skipping morph mask." << LL_ENDL;
return;
}
}
@@ -1520,8 +1521,8 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
}
else
{
- llwarns << "Skipping rendering of " << getInfo()->mStaticImageFileName
- << "; expected 1 or 4 components." << llendl;
+ LL_WARNS() << "Skipping rendering of " << getInfo()->mStaticImageFileName
+ << "; expected 1 or 4 components." << LL_ENDL;
}
}
}
@@ -1559,10 +1560,13 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
}
U32 cache_index = alpha_mask_crc.getCRC();
- U8* alpha_data = get_if_there(mAlphaCache,cache_index,(U8*)NULL);
- if (!alpha_data)
+ U8* alpha_data = NULL;
+ // We believe we need to generate morph masks, do not assume that the cached version is accurate.
+ // We can get bad morph masks during login, on minimize, and occasional gl errors.
+ // We should only be doing this when we believe something has changed with respect to the user's appearance.
{
- // clear out a slot if we have filled our cache
+ LL_DEBUGS("Avatar") << "gl alpha cache of morph mask not found, doing readback: " << getName() << LL_ENDL;
+ // clear out a slot if we have filled our cache
S32 max_cache_entries = getTexLayerSet()->getAvatarAppearance()->isSelf() ? 4 : 1;
while ((S32)mAlphaCache.size() >= max_cache_entries)
{
@@ -1583,10 +1587,10 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
}
}
-static LLFastTimer::DeclareTimer FTM_ADD_ALPHA_MASK("addAlphaMask");
+static LLTrace::BlockTimerStatHandle FTM_ADD_ALPHA_MASK("addAlphaMask");
void LLTexLayer::addAlphaMask(U8 *data, S32 originX, S32 originY, S32 width, S32 height)
{
- LLFastTimer t(FTM_ADD_ALPHA_MASK);
+ LL_RECORD_BLOCK_TIME(FTM_ADD_ALPHA_MASK);
S32 size = width * height;
const U8* alphaData = getAlphaData();
if (!alphaData && hasAlphaParams())
@@ -1782,13 +1786,11 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const
/*virtual*/ void LLTexLayerTemplate::gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height)
{
U32 num_wearables = updateWearableCache();
- for (U32 i = 0; i < num_wearables; i++)
+ U32 i = num_wearables - 1; // For rendering morph masks, we only want to use the top wearable
+ LLTexLayer *layer = getLayer(i);
+ if (layer)
{
- LLTexLayer *layer = getLayer(i);
- if (layer)
- {
- layer->addAlphaMask(data, originX, originY, width, height);
- }
+ layer->addAlphaMask(data, originX, originY, width, height);
}
}
@@ -1900,18 +1902,18 @@ LLTexLayerStaticImageList::~LLTexLayerStaticImageList()
void LLTexLayerStaticImageList::dumpByteCount() const
{
- llinfos << "Avatar Static Textures " <<
+ LL_INFOS() << "Avatar Static Textures " <<
"KB GL:" << (mGLBytes / 1024) <<
- "KB TGA:" << (mTGABytes / 1024) << "KB" << llendl;
+ "KB TGA:" << (mTGABytes / 1024) << "KB" << LL_ENDL;
}
void LLTexLayerStaticImageList::deleteCachedImages()
{
if( mGLBytes || mTGABytes )
{
- llinfos << "Clearing Static Textures " <<
+ LL_INFOS() << "Clearing Static Textures " <<
"KB GL:" << (mGLBytes / 1024) <<
- "KB TGA:" << (mTGABytes / 1024) << "KB" << llendl;
+ "KB TGA:" << (mTGABytes / 1024) << "KB" << LL_ENDL;
//mStaticImageLists uses LLPointers, clear() will cause deletion
@@ -1929,10 +1931,10 @@ void LLTexLayerStaticImageList::deleteCachedImages()
// Returns an LLImageTGA that contains the encoded data from a tga file named file_name.
// Caches the result to speed identical subsequent requests.
-static LLFastTimer::DeclareTimer FTM_LOAD_STATIC_TGA("getImageTGA");
+static LLTrace::BlockTimerStatHandle FTM_LOAD_STATIC_TGA("getImageTGA");
LLImageTGA* LLTexLayerStaticImageList::getImageTGA(const std::string& file_name)
{
- LLFastTimer t(FTM_LOAD_STATIC_TGA);
+ LL_RECORD_BLOCK_TIME(FTM_LOAD_STATIC_TGA);
const char *namekey = mImageNames.addString(file_name);
image_tga_map_t::const_iterator iter = mStaticImageListTGA.find(namekey);
if( iter != mStaticImageListTGA.end() )
@@ -1959,10 +1961,10 @@ LLImageTGA* LLTexLayerStaticImageList::getImageTGA(const std::string& file_name)
// Returns a GL Image (without a backing ImageRaw) that contains the decoded data from a tga file named file_name.
// Caches the result to speed identical subsequent requests.
-static LLFastTimer::DeclareTimer FTM_LOAD_STATIC_TEXTURE("getTexture");
+static LLTrace::BlockTimerStatHandle FTM_LOAD_STATIC_TEXTURE("getTexture");
LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name, BOOL is_mask)
{
- LLFastTimer t(FTM_LOAD_STATIC_TEXTURE);
+ LL_RECORD_BLOCK_TIME(FTM_LOAD_STATIC_TEXTURE);
LLPointer<LLGLTexture> tex;
const char *namekey = mImageNames.addString(file_name);
@@ -2009,10 +2011,10 @@ LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name,
// Reads a .tga file, decodes it, and puts the decoded data in image_raw.
// Returns TRUE if successful.
-static LLFastTimer::DeclareTimer FTM_LOAD_IMAGE_RAW("loadImageRaw");
+static LLTrace::BlockTimerStatHandle FTM_LOAD_IMAGE_RAW("loadImageRaw");
BOOL LLTexLayerStaticImageList::loadImageRaw(const std::string& file_name, LLImageRaw* image_raw)
{
- LLFastTimer t(FTM_LOAD_IMAGE_RAW);
+ LL_RECORD_BLOCK_TIME(FTM_LOAD_IMAGE_RAW);
BOOL success = FALSE;
std::string path;
path = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,file_name);
diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp
index 6aae9a8cc1..ff682d6906 100644..100755
--- a/indra/llappearance/lltexlayerparams.cpp
+++ b/indra/llappearance/lltexlayerparams.cpp
@@ -35,11 +35,13 @@
#include "lltexturemanagerbridge.h"
#include "../llui/llui.h"
#include "llwearable.h"
+#include "llfasttimer.h"
//-----------------------------------------------------------------------------
// LLTexLayerParam
//-----------------------------------------------------------------------------
-LLTexLayerParam::LLTexLayerParam(LLTexLayerInterface *layer) :
+LLTexLayerParam::LLTexLayerParam(LLTexLayerInterface *layer)
+ : LLViewerVisualParam(),
mTexLayer(layer),
mAvatarAppearance(NULL)
{
@@ -49,16 +51,23 @@ LLTexLayerParam::LLTexLayerParam(LLTexLayerInterface *layer) :
}
else
{
- llerrs << "LLTexLayerParam constructor passed with NULL reference for layer!" << llendl;
+ LL_ERRS() << "LLTexLayerParam constructor passed with NULL reference for layer!" << LL_ENDL;
}
}
-LLTexLayerParam::LLTexLayerParam(LLAvatarAppearance *appearance) :
+LLTexLayerParam::LLTexLayerParam(LLAvatarAppearance *appearance)
+ : LLViewerVisualParam(),
mTexLayer(NULL),
mAvatarAppearance(appearance)
{
}
+LLTexLayerParam::LLTexLayerParam(const LLTexLayerParam& pOther)
+ : LLViewerVisualParam(pOther),
+ mTexLayer(pOther.mTexLayer),
+ mAvatarAppearance(pOther.mAvatarAppearance)
+{
+}
BOOL LLTexLayerParam::setInfo(LLViewerVisualParamInfo *info, BOOL add_to_appearance)
{
@@ -86,7 +95,7 @@ void LLTexLayerParamAlpha::dumpCacheByteCount()
{
S32 gl_bytes = 0;
getCacheByteCount( &gl_bytes);
- llinfos << "Processed Alpha Texture Cache GL:" << (gl_bytes/1024) << "KB" << llendl;
+ LL_INFOS() << "Processed Alpha Texture Cache GL:" << (gl_bytes/1024) << "KB" << LL_ENDL;
}
// static
@@ -111,9 +120,11 @@ void LLTexLayerParamAlpha::getCacheByteCount(S32* gl_bytes)
}
}
-LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLTexLayerInterface* layer) :
- LLTexLayerParam(layer),
+LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLTexLayerInterface* layer)
+ : LLTexLayerParam(layer),
mCachedProcessedTexture(NULL),
+ mStaticImageTGA(),
+ mStaticImageRaw(),
mNeedsCreateTexture(FALSE),
mStaticImageInvalid(FALSE),
mAvgDistortionVec(1.f, 1.f, 1.f),
@@ -122,9 +133,11 @@ LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLTexLayerInterface* layer) :
sInstances.push_front(this);
}
-LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLAvatarAppearance* appearance) :
- LLTexLayerParam(appearance),
+LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLAvatarAppearance* appearance)
+ : LLTexLayerParam(appearance),
mCachedProcessedTexture(NULL),
+ mStaticImageTGA(),
+ mStaticImageRaw(),
mNeedsCreateTexture(FALSE),
mStaticImageInvalid(FALSE),
mAvgDistortionVec(1.f, 1.f, 1.f),
@@ -133,6 +146,18 @@ LLTexLayerParamAlpha::LLTexLayerParamAlpha(LLAvatarAppearance* appearance) :
sInstances.push_front(this);
}
+LLTexLayerParamAlpha::LLTexLayerParamAlpha(const LLTexLayerParamAlpha& pOther)
+ : LLTexLayerParam(pOther),
+ mCachedProcessedTexture(pOther.mCachedProcessedTexture),
+ mStaticImageTGA(pOther.mStaticImageTGA),
+ mStaticImageRaw(pOther.mStaticImageRaw),
+ mNeedsCreateTexture(pOther.mNeedsCreateTexture),
+ mStaticImageInvalid(pOther.mStaticImageInvalid),
+ mAvgDistortionVec(pOther.mAvgDistortionVec),
+ mCachedEffectiveWeight(pOther.mCachedEffectiveWeight)
+{
+ sInstances.push_front(this);
+}
LLTexLayerParamAlpha::~LLTexLayerParamAlpha()
{
@@ -142,9 +167,7 @@ LLTexLayerParamAlpha::~LLTexLayerParamAlpha()
/*virtual*/ LLViewerVisualParam* LLTexLayerParamAlpha::cloneParam(LLWearable* wearable) const
{
- LLTexLayerParamAlpha *new_param = new LLTexLayerParamAlpha(mTexLayer);
- *new_param = *this;
- return new_param;
+ return new LLTexLayerParamAlpha(*this);
}
void LLTexLayerParamAlpha::deleteCaches()
@@ -160,7 +183,7 @@ BOOL LLTexLayerParamAlpha::getMultiplyBlend() const
return ((LLTexLayerParamAlphaInfo *)getInfo())->mMultiplyBlend;
}
-void LLTexLayerParamAlpha::setWeight(F32 weight, BOOL upload_bake)
+void LLTexLayerParamAlpha::setWeight(F32 weight)
{
if (mIsAnimating || mTexLayer == NULL)
{
@@ -178,35 +201,35 @@ void LLTexLayerParamAlpha::setWeight(F32 weight, BOOL upload_bake)
if ((mAvatarAppearance->getSex() & getSex()) &&
(mAvatarAppearance->isSelf() && !mIsDummy)) // only trigger a baked texture update if we're changing a wearable's visual param.
{
- mAvatarAppearance->invalidateComposite(mTexLayer->getTexLayerSet(), upload_bake);
+ mAvatarAppearance->invalidateComposite(mTexLayer->getTexLayerSet());
mTexLayer->invalidateMorphMasks();
}
}
}
-void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value, BOOL upload_bake)
+void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value)
{
// do not animate dummy parameters
if (mIsDummy)
{
- setWeight(target_value, upload_bake);
+ setWeight(target_value);
return;
}
mTargetWeight = target_value;
- setWeight(target_value, upload_bake);
+ setWeight(target_value);
mIsAnimating = TRUE;
if (mNext)
{
- mNext->setAnimationTarget(target_value, upload_bake);
+ mNext->setAnimationTarget(target_value);
}
}
-void LLTexLayerParamAlpha::animate(F32 delta, BOOL upload_bake)
+void LLTexLayerParamAlpha::animate(F32 delta)
{
if (mNext)
{
- mNext->animate(delta, upload_bake);
+ mNext->animate(delta);
}
}
@@ -238,10 +261,10 @@ BOOL LLTexLayerParamAlpha::getSkip() const
}
-static LLFastTimer::DeclareTimer FTM_TEX_LAYER_PARAM_ALPHA("alpha render");
+static LLTrace::BlockTimerStatHandle FTM_TEX_LAYER_PARAM_ALPHA("alpha render");
BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
{
- LLFastTimer t(FTM_TEX_LAYER_PARAM_ALPHA);
+ LL_RECORD_BLOCK_TIME(FTM_TEX_LAYER_PARAM_ALPHA);
BOOL success = TRUE;
if (!mTexLayer)
@@ -278,7 +301,7 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
if (mStaticImageTGA.isNull())
{
- llwarns << "Unable to load static file: " << info->mStaticImageFileName << llendl;
+ LL_WARNS() << "Unable to load static file: " << info->mStaticImageFileName << LL_ENDL;
mStaticImageInvalid = TRUE; // don't try again.
return FALSE;
}
@@ -309,7 +332,7 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
mStaticImageRaw = new LLImageRaw;
mStaticImageTGA->decodeAndProcess(mStaticImageRaw, info->mDomain, effective_weight);
mNeedsCreateTexture = TRUE;
- lldebugs << "Built Cached Alpha: " << info->mStaticImageFileName << ": (" << mStaticImageRaw->getWidth() << ", " << mStaticImageRaw->getHeight() << ") " << "Domain: " << info->mDomain << " Weight: " << effective_weight << llendl;
+ LL_DEBUGS() << "Built Cached Alpha: " << info->mStaticImageFileName << ": (" << mStaticImageRaw->getWidth() << ", " << mStaticImageRaw->getHeight() << ") " << "Domain: " << info->mDomain << " Weight: " << effective_weight << LL_ENDL;
}
if (mCachedProcessedTexture)
@@ -380,7 +403,7 @@ BOOL LLTexLayerParamAlphaInfo::parseXml(LLXmlTreeNode* node)
}
// else
// {
-// llwarns << "<param_alpha> element is missing tga_file attribute." << llendl;
+// LL_WARNS() << "<param_alpha> element is missing tga_file attribute." << LL_ENDL;
// }
static LLStdStringHandle multiply_blend_string = LLXmlTree::addAttributeString("multiply_blend");
@@ -398,27 +421,31 @@ BOOL LLTexLayerParamAlphaInfo::parseXml(LLXmlTreeNode* node)
-LLTexLayerParamColor::LLTexLayerParamColor(LLTexLayerInterface* layer) :
- LLTexLayerParam(layer),
+LLTexLayerParamColor::LLTexLayerParamColor(LLTexLayerInterface* layer)
+ : LLTexLayerParam(layer),
mAvgDistortionVec(1.f, 1.f, 1.f)
{
}
-LLTexLayerParamColor::LLTexLayerParamColor(LLAvatarAppearance *appearance) :
- LLTexLayerParam(appearance),
+LLTexLayerParamColor::LLTexLayerParamColor(LLAvatarAppearance *appearance)
+ : LLTexLayerParam(appearance),
mAvgDistortionVec(1.f, 1.f, 1.f)
{
}
+LLTexLayerParamColor::LLTexLayerParamColor(const LLTexLayerParamColor& pOther)
+ : LLTexLayerParam(pOther),
+ mAvgDistortionVec(pOther.mAvgDistortionVec)
+{
+}
+
LLTexLayerParamColor::~LLTexLayerParamColor()
{
}
/*virtual*/ LLViewerVisualParam* LLTexLayerParamColor::cloneParam(LLWearable* wearable) const
{
- LLTexLayerParamColor *new_param = new LLTexLayerParamColor(mTexLayer);
- *new_param = *this;
- return new_param;
+ return new LLTexLayerParamColor(*this);
}
LLColor4 LLTexLayerParamColor::getNetColor() const
@@ -449,14 +476,14 @@ LLColor4 LLTexLayerParamColor::getNetColor() const
}
}
-void LLTexLayerParamColor::setWeight(F32 weight, BOOL upload_bake)
+
+void LLTexLayerParamColor::setWeight(F32 weight)
{
if (mIsAnimating)
{
return;
}
- const LLTexLayerParamColorInfo *info = (LLTexLayerParamColorInfo *)getInfo();
F32 min_weight = getMinWeight();
F32 max_weight = getMaxWeight();
F32 new_weight = llclamp(weight, min_weight, max_weight);
@@ -466,6 +493,8 @@ void LLTexLayerParamColor::setWeight(F32 weight, BOOL upload_bake)
{
mCurWeight = new_weight;
+ const LLTexLayerParamColorInfo *info = (LLTexLayerParamColorInfo *)getInfo();
+
if (info->mNumColors <= 0)
{
// This will happen when we set the default weight the first time.
@@ -474,34 +503,34 @@ void LLTexLayerParamColor::setWeight(F32 weight, BOOL upload_bake)
if ((mAvatarAppearance->getSex() & getSex()) && (mAvatarAppearance->isSelf() && !mIsDummy)) // only trigger a baked texture update if we're changing a wearable's visual param.
{
- onGlobalColorChanged(upload_bake);
+ onGlobalColorChanged();
if (mTexLayer)
{
- mAvatarAppearance->invalidateComposite(mTexLayer->getTexLayerSet(), upload_bake);
+ mAvatarAppearance->invalidateComposite(mTexLayer->getTexLayerSet());
}
}
-// llinfos << "param " << mName << " = " << new_weight << llendl;
+// LL_INFOS() << "param " << mName << " = " << new_weight << LL_ENDL;
}
}
-void LLTexLayerParamColor::setAnimationTarget(F32 target_value, BOOL upload_bake)
+void LLTexLayerParamColor::setAnimationTarget(F32 target_value)
{
// set value first then set interpolating flag to ignore further updates
mTargetWeight = target_value;
- setWeight(target_value, upload_bake);
+ setWeight(target_value);
mIsAnimating = TRUE;
if (mNext)
{
- mNext->setAnimationTarget(target_value, upload_bake);
+ mNext->setAnimationTarget(target_value);
}
}
-void LLTexLayerParamColor::animate(F32 delta, BOOL upload_bake)
+void LLTexLayerParamColor::animate(F32 delta)
{
if (mNext)
{
- mNext->animate(delta, upload_bake);
+ mNext->animate(delta);
}
}
@@ -556,13 +585,13 @@ BOOL LLTexLayerParamColorInfo::parseXml(LLXmlTreeNode *node)
}
if (!mNumColors)
{
- llwarns << "<param_color> is missing <value> sub-elements" << llendl;
+ LL_WARNS() << "<param_color> is missing <value> sub-elements" << LL_ENDL;
return FALSE;
}
if ((mOperation == LLTexLayerParamColor::OP_BLEND) && (mNumColors != 1))
{
- llwarns << "<param_color> with operation\"blend\" must have exactly one <value>" << llendl;
+ LL_WARNS() << "<param_color> with operation\"blend\" must have exactly one <value>" << LL_ENDL;
return FALSE;
}
diff --git a/indra/llappearance/lltexlayerparams.h b/indra/llappearance/lltexlayerparams.h
index b38d28d3eb..0cb2dedbff 100644..100755
--- a/indra/llappearance/lltexlayerparams.h
+++ b/indra/llappearance/lltexlayerparams.h
@@ -52,6 +52,8 @@ public:
/*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const = 0;
protected:
+ LLTexLayerParam(const LLTexLayerParam& pOther);
+
LLTexLayerInterface* mTexLayer;
LLAvatarAppearance* mAvatarAppearance;
};
@@ -83,9 +85,9 @@ public:
// LLVisualParam Virtual functions
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
/*virtual*/ void apply( ESex avatar_sex ) {}
- /*virtual*/ void setWeight(F32 weight, BOOL upload_bake);
- /*virtual*/ void setAnimationTarget(F32 target_value, BOOL upload_bake);
- /*virtual*/ void animate(F32 delta, BOOL upload_bake);
+ /*virtual*/ void setWeight(F32 weight);
+ /*virtual*/ void setAnimationTarget(F32 target_value);
+ /*virtual*/ void animate(F32 delta);
// LLViewerVisualParam Virtual functions
/*virtual*/ F32 getTotalDistortion() { return 1.f; }
@@ -102,6 +104,8 @@ public:
BOOL getMultiplyBlend() const;
private:
+ LLTexLayerParamAlpha(const LLTexLayerParamAlpha& pOther);
+
LLPointer<LLGLTexture> mCachedProcessedTexture;
LLPointer<LLImageTGA> mStaticImageTGA;
LLPointer<LLImageRaw> mStaticImageRaw;
@@ -174,9 +178,9 @@ public:
// LLVisualParam Virtual functions
///*virtual*/ BOOL parseData(LLXmlTreeNode* node);
/*virtual*/ void apply( ESex avatar_sex ) {}
- /*virtual*/ void setWeight(F32 weight, BOOL upload_bake);
- /*virtual*/ void setAnimationTarget(F32 target_value, BOOL upload_bake);
- /*virtual*/ void animate(F32 delta, BOOL upload_bake);
+ /*virtual*/ void setWeight(F32 weight);
+ /*virtual*/ void setAnimationTarget(F32 target_value);
+ /*virtual*/ void animate(F32 delta);
// LLViewerVisualParam Virtual functions
@@ -190,7 +194,9 @@ public:
// New functions
LLColor4 getNetColor() const;
protected:
- virtual void onGlobalColorChanged(bool upload_bake) {}
+ LLTexLayerParamColor(const LLTexLayerParamColor& pOther);
+
+ virtual void onGlobalColorChanged() {}
private:
LL_ALIGN_16(LLVector4a mAvgDistortionVec);
} LL_ALIGN_POSTFIX(16);
diff --git a/indra/llappearance/llviewervisualparam.cpp b/indra/llappearance/llviewervisualparam.cpp
index cc81bcf118..af8394b60c 100644
--- a/indra/llappearance/llviewervisualparam.cpp
+++ b/indra/llappearance/llviewervisualparam.cpp
@@ -123,6 +123,22 @@ BOOL LLViewerVisualParamInfo::parseXml(LLXmlTreeNode *node)
// LLViewerVisualParam()
//-----------------------------------------------------------------------------
LLViewerVisualParam::LLViewerVisualParam()
+ : LLVisualParam()
+{
+}
+
+//-----------------------------------------------------------------------------
+// LLViewerVisualParam()
+//-----------------------------------------------------------------------------
+LLViewerVisualParam::LLViewerVisualParam(const LLViewerVisualParam& pOther)
+ : LLVisualParam(pOther)
+{
+}
+
+//-----------------------------------------------------------------------------
+// ~LLViewerVisualParam()
+//-----------------------------------------------------------------------------
+LLViewerVisualParam::~LLViewerVisualParam()
{
}
@@ -137,7 +153,7 @@ BOOL LLViewerVisualParam::setInfo(LLViewerVisualParamInfo *info)
return FALSE;
mInfo = info;
mID = info->mID;
- setWeight(getDefaultWeight(), FALSE );
+ setWeight(getDefaultWeight());
return TRUE;
}
diff --git a/indra/llappearance/llviewervisualparam.h b/indra/llappearance/llviewervisualparam.h
index 2826e6c316..1a710c0ca6 100644
--- a/indra/llappearance/llviewervisualparam.h
+++ b/indra/llappearance/llviewervisualparam.h
@@ -70,7 +70,7 @@ class LLViewerVisualParam : public LLVisualParam
{
public:
LLViewerVisualParam();
- /*virtual*/ ~LLViewerVisualParam(){};
+ virtual ~LLViewerVisualParam();
// Special: These functions are overridden by child classes
LLViewerVisualParamInfo *getInfo() const { return (LLViewerVisualParamInfo*)mInfo; };
@@ -105,6 +105,8 @@ public:
BOOL getCrossWearable() const { return getInfo()->mCrossWearable; }
+protected:
+ LLViewerVisualParam(const LLViewerVisualParam& pOther);
} LL_ALIGN_POSTFIX(16);
#endif // LL_LLViewerVisualParam_H
diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp
index d86a460511..4bce3f99ed 100644..100755
--- a/indra/llappearance/llwearable.cpp
+++ b/indra/llappearance/llwearable.cpp
@@ -33,6 +33,7 @@
#include "llvisualparam.h"
#include "llavatarappearancedefines.h"
#include "llwearable.h"
+#include "boost/bind.hpp"
using namespace LLAvatarAppearanceDefines;
@@ -42,9 +43,32 @@ S32 LLWearable::sCurrentDefinitionVersion = 1;
// Private local functions
static std::string terse_F32_to_string(F32 f);
+LLWearable::LLWearable()
+ : mDefinitionVersion(-1),
+ mName(),
+ mDescription(),
+ mPermissions(),
+ mSaleInfo(),
+ mType(LLWearableType::WT_NONE),
+ mSavedVisualParamMap(),
+ mVisualParamIndexMap(),
+ mTEMap(),
+ mSavedTEMap()
+{
+}
+
// virtual
LLWearable::~LLWearable()
{
+ for (visual_param_index_map_t::iterator vpIter = mVisualParamIndexMap.begin(); vpIter != mVisualParamIndexMap.end(); ++vpIter)
+ {
+ LLVisualParam* vp = vpIter->second;
+ vp->clearNextParam();
+ delete vp;
+ vpIter->second = NULL;
+ }
+
+ destroyTextures();
}
const std::string& LLWearable::getTypeLabel() const
@@ -149,7 +173,7 @@ void LLWearable::createVisualParams(LLAvatarAppearance *avatarp)
{
if( !param->linkDrivenParams(boost::bind(param_function,avatarp,_1 ), true))
{
- llwarns << "could not link driven params for wearable " << getName() << " id: " << param->getID() << llendl;
+ LL_WARNS() << "could not link driven params for wearable " << getName() << " id: " << param->getID() << LL_ENDL;
continue;
}
}
@@ -173,7 +197,7 @@ void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp)
}
else
{
- llerrs << "could not find layerset for LTO in wearable!" << llendl;
+ LL_ERRS() << "could not find layerset for LTO in wearable!" << LL_ENDL;
}
}
@@ -207,7 +231,7 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
// read header and version
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
{
- llwarns << "Failed to read wearable asset input stream." << llendl;
+ LL_WARNS() << "Failed to read wearable asset input stream." << LL_ENDL;
return LLWearable::FAILURE;
}
if ( 1 != sscanf( /* Flawfinder: ignore */
@@ -225,15 +249,15 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
// these wearables get re-saved with version definition 22.
if( mDefinitionVersion > LLWearable::sCurrentDefinitionVersion && mDefinitionVersion != 24 )
{
- llwarns << "Wearable asset has newer version (" << mDefinitionVersion << ") than XML (" << LLWearable::sCurrentDefinitionVersion << ")" << llendl;
+ LL_WARNS() << "Wearable asset has newer version (" << mDefinitionVersion << ") than XML (" << LLWearable::sCurrentDefinitionVersion << ")" << LL_ENDL;
return LLWearable::FAILURE;
}
// name may be empty
if (!input_stream.good())
{
- llwarns << "Bad Wearable asset: early end of input stream "
- << "while reading name" << llendl;
+ LL_WARNS() << "Bad Wearable asset: early end of input stream "
+ << "while reading name" << LL_ENDL;
return LLWearable::FAILURE;
}
input_stream.getline(buffer, PARSE_BUFFER_SIZE);
@@ -242,8 +266,8 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
// description may be empty
if (!input_stream.good())
{
- llwarns << "Bad Wearable asset: early end of input stream "
- << "while reading description" << llendl;
+ LL_WARNS() << "Bad Wearable asset: early end of input stream "
+ << "while reading description" << LL_ENDL;
return LLWearable::FAILURE;
}
input_stream.getline(buffer, PARSE_BUFFER_SIZE);
@@ -252,15 +276,15 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
// permissions may have extra empty lines before the correct line
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
{
- llwarns << "Bad Wearable asset: early end of input stream "
- << "while reading permissions" << llendl;
+ LL_WARNS() << "Bad Wearable asset: early end of input stream "
+ << "while reading permissions" << LL_ENDL;
return LLWearable::FAILURE;
}
S32 perm_version = -1;
if ( 1 != sscanf( buffer, " permissions %d\n", &perm_version ) ||
perm_version != 0 )
{
- llwarns << "Bad Wearable asset: missing valid permissions" << llendl;
+ LL_WARNS() << "Bad Wearable asset: missing valid permissions" << LL_ENDL;
return LLWearable::FAILURE;
}
if( !mPermissions.importLegacyStream( input_stream ) )
@@ -271,15 +295,15 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
// sale info
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
{
- llwarns << "Bad Wearable asset: early end of input stream "
- << "while reading sale info" << llendl;
+ LL_WARNS() << "Bad Wearable asset: early end of input stream "
+ << "while reading sale info" << LL_ENDL;
return LLWearable::FAILURE;
}
S32 sale_info_version = -1;
if ( 1 != sscanf( buffer, " sale_info %d\n", &sale_info_version ) ||
sale_info_version != 0 )
{
- llwarns << "Bad Wearable asset: missing valid sale_info" << llendl;
+ LL_WARNS() << "Bad Wearable asset: missing valid sale_info" << LL_ENDL;
return LLWearable::FAILURE;
}
// Sale info used to contain next owner perm. It is now in the
@@ -305,14 +329,14 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
// wearable type
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
{
- llwarns << "Bad Wearable asset: early end of input stream "
- << "while reading type" << llendl;
+ LL_WARNS() << "Bad Wearable asset: early end of input stream "
+ << "while reading type" << LL_ENDL;
return LLWearable::FAILURE;
}
S32 type = -1;
if ( 1 != sscanf( buffer, "type %d\n", &type ) )
{
- llwarns << "Bad Wearable asset: bad type" << llendl;
+ LL_WARNS() << "Bad Wearable asset: bad type" << LL_ENDL;
return LLWearable::FAILURE;
}
if( 0 <= type && type < LLWearableType::WT_COUNT )
@@ -322,36 +346,36 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
else
{
mType = LLWearableType::WT_COUNT;
- llwarns << "Bad Wearable asset: bad type #" << type << llendl;
+ LL_WARNS() << "Bad Wearable asset: bad type #" << type << LL_ENDL;
return LLWearable::FAILURE;
}
// parameters header
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
{
- llwarns << "Bad Wearable asset: early end of input stream "
- << "while reading parameters header" << llendl;
+ LL_WARNS() << "Bad Wearable asset: early end of input stream "
+ << "while reading parameters header" << LL_ENDL;
return LLWearable::FAILURE;
}
S32 num_parameters = -1;
if ( 1 != sscanf( buffer, "parameters %d\n", &num_parameters ) )
{
- llwarns << "Bad Wearable asset: missing parameters block" << llendl;
+ LL_WARNS() << "Bad Wearable asset: missing parameters block" << LL_ENDL;
return LLWearable::FAILURE;
}
if ( num_parameters > MAX_WEARABLE_ASSET_PARAMETERS )
{
- llwarns << "Bad Wearable asset: too many parameters, "
- << num_parameters << llendl;
+ LL_WARNS() << "Bad Wearable asset: too many parameters, "
+ << num_parameters << LL_ENDL;
return LLWearable::FAILURE;
}
if( num_parameters != mVisualParamIndexMap.size() )
{
- llwarns << "Wearable parameter mismatch. Reading in "
+ LL_WARNS() << "Wearable parameter mismatch. Reading in "
<< num_parameters << " from file, but created "
<< mVisualParamIndexMap.size()
<< " from avatar parameters. type: "
- << getType() << llendl;
+ << getType() << LL_ENDL;
}
// parameters
@@ -360,15 +384,15 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
{
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
{
- llwarns << "Bad Wearable asset: early end of input stream "
- << "while reading parameter #" << i << llendl;
+ LL_WARNS() << "Bad Wearable asset: early end of input stream "
+ << "while reading parameter #" << i << LL_ENDL;
return LLWearable::FAILURE;
}
S32 param_id = 0;
F32 param_weight = 0.f;
if ( 2 != sscanf( buffer, "%d %f\n", &param_id, &param_weight ) )
{
- llwarns << "Bad Wearable asset: bad parameter, #" << i << llendl;
+ LL_WARNS() << "Bad Wearable asset: bad parameter, #" << i << LL_ENDL;
return LLWearable::FAILURE;
}
mSavedVisualParamMap[param_id] = param_weight;
@@ -377,20 +401,20 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
// textures header
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
{
- llwarns << "Bad Wearable asset: early end of input stream "
- << "while reading textures header" << i << llendl;
+ LL_WARNS() << "Bad Wearable asset: early end of input stream "
+ << "while reading textures header" << i << LL_ENDL;
return LLWearable::FAILURE;
}
S32 num_textures = -1;
if ( 1 != sscanf( buffer, "textures %d\n", &num_textures) )
{
- llwarns << "Bad Wearable asset: missing textures block" << llendl;
+ LL_WARNS() << "Bad Wearable asset: missing textures block" << LL_ENDL;
return LLWearable::FAILURE;
}
if ( num_textures > MAX_WEARABLE_ASSET_TEXTURES )
{
- llwarns << "Bad Wearable asset: too many textures, "
- << num_textures << llendl;
+ LL_WARNS() << "Bad Wearable asset: too many textures, "
+ << num_textures << LL_ENDL;
return LLWearable::FAILURE;
}
@@ -399,8 +423,8 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
{
if (!getNextPopulatedLine(input_stream, buffer, PARSE_BUFFER_SIZE))
{
- llwarns << "Bad Wearable asset: early end of input stream "
- << "while reading textures #" << i << llendl;
+ LL_WARNS() << "Bad Wearable asset: early end of input stream "
+ << "while reading textures #" << i << LL_ENDL;
return LLWearable::FAILURE;
}
S32 te = 0;
@@ -409,14 +433,14 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
"%d %36s\n",
&te, uuid_buffer) )
{
- llwarns << "Bad Wearable asset: bad texture, #" << i << llendl;
+ LL_WARNS() << "Bad Wearable asset: bad texture, #" << i << LL_ENDL;
return LLWearable::FAILURE;
}
if( !LLUUID::validate( uuid_buffer ) )
{
- llwarns << "Bad Wearable asset: bad texture uuid: "
- << uuid_buffer << llendl;
+ LL_WARNS() << "Bad Wearable asset: bad texture uuid: "
+ << uuid_buffer << LL_ENDL;
return LLWearable::FAILURE;
}
LLUUID id = LLUUID(uuid_buffer);
@@ -524,7 +548,7 @@ void LLWearable::revertValues()
LLVisualParam *param = getVisualParam(id);
if(param && !dynamic_cast<LLDriverParam*>(param) )
{
- setVisualParamWeight(id, value, TRUE);
+ setVisualParamWeight(id, value);
}
}
@@ -536,7 +560,7 @@ void LLWearable::revertValues()
LLVisualParam *param = getVisualParam(id);
if(param && dynamic_cast<LLDriverParam*>(param) )
{
- setVisualParamWeight(id, value, TRUE);
+ setVisualParamWeight(id, value);
}
}
@@ -619,17 +643,10 @@ void LLWearable::syncImages(te_map_t &src, te_map_t &dst)
void LLWearable::destroyTextures()
{
- for( te_map_t::iterator iter = mTEMap.begin(); iter != mTEMap.end(); ++iter )
- {
- LLLocalTextureObject *lto = iter->second;
- delete lto;
- }
+ std::for_each(mTEMap.begin(), mTEMap.end(), DeletePairedPointer());
mTEMap.clear();
- for( te_map_t::iterator iter = mSavedTEMap.begin(); iter != mSavedTEMap.end(); ++iter )
- {
- LLLocalTextureObject *lto = iter->second;
- delete lto;
- }
+
+ std::for_each(mSavedTEMap.begin(), mSavedTEMap.end(), DeletePairedPointer());
mSavedTEMap.clear();
}
@@ -646,16 +663,16 @@ void LLWearable::addVisualParam(LLVisualParam *param)
}
-void LLWearable::setVisualParamWeight(S32 param_index, F32 value, BOOL upload_bake)
+void LLWearable::setVisualParamWeight(S32 param_index, F32 value)
{
if( is_in_map(mVisualParamIndexMap, param_index ) )
{
LLVisualParam *wearable_param = mVisualParamIndexMap[param_index];
- wearable_param->setWeight(value, upload_bake);
+ wearable_param->setWeight(value);
}
else
{
- llerrs << "LLWearable::setVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << llendl;
+ LL_ERRS() << "LLWearable::setVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << LL_ENDL;
}
}
@@ -668,7 +685,7 @@ F32 LLWearable::getVisualParamWeight(S32 param_index) const
}
else
{
- llwarns << "LLWerable::getVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << llendl;
+ LL_WARNS() << "LLWerable::getVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << LL_ENDL;
}
return (F32)-1.0;
}
@@ -692,14 +709,14 @@ void LLWearable::getVisualParams(visual_param_vec_t &list)
}
}
-void LLWearable::animateParams(F32 delta, BOOL upload_bake)
+void LLWearable::animateParams(F32 delta)
{
for(visual_param_index_map_t::iterator iter = mVisualParamIndexMap.begin();
iter != mVisualParamIndexMap.end();
++iter)
{
LLVisualParam *param = (LLVisualParam*) iter->second;
- param->animate(delta, upload_bake);
+ param->animate(delta);
}
}
@@ -717,14 +734,14 @@ LLColor4 LLWearable::getClothesColor(S32 te) const
return color;
}
-void LLWearable::setClothesColor( S32 te, const LLColor4& new_color, BOOL upload_bake )
+void LLWearable::setClothesColor( S32 te, const LLColor4& new_color)
{
U32 param_name[3];
if( LLAvatarAppearance::teToColorParams( (LLAvatarAppearanceDefines::ETextureIndex)te, param_name ) )
{
for( U8 index = 0; index < 3; index++ )
{
- setVisualParamWeight(param_name[index], new_color.mV[index], upload_bake);
+ setVisualParamWeight(param_name[index], new_color.mV[index]);
}
}
}
@@ -743,7 +760,7 @@ void LLWearable::writeToAvatar(LLAvatarAppearance* avatarp)
S32 param_id = param->getID();
F32 weight = getVisualParamWeight(param_id);
- avatarp->setVisualParamWeight( param_id, weight, FALSE );
+ avatarp->setVisualParamWeight( param_id, weight);
}
}
}
diff --git a/indra/llappearance/llwearable.h b/indra/llappearance/llwearable.h
index 6f5a1e14e8..406fc7e883 100644..100755
--- a/indra/llappearance/llwearable.h
+++ b/indra/llappearance/llwearable.h
@@ -28,16 +28,15 @@
#define LL_LLWEARABLE_H
#include "llavatarappearancedefines.h"
-#include "llextendedstatus.h"
#include "llpermissions.h"
#include "llsaleinfo.h"
#include "llwearabletype.h"
-#include "lllocaltextureobject.h"
class LLMD5;
class LLVisualParam;
class LLTexGlobalColorInfo;
class LLTexGlobalColor;
+class LLLocalTextureObject;
class LLAvatarAppearance;
// Abstract class.
@@ -47,6 +46,7 @@ class LLWearable
// Constructors and destructors
//--------------------------------------------------------------------
public:
+ LLWearable();
virtual ~LLWearable();
//--------------------------------------------------------------------
@@ -95,14 +95,14 @@ public:
void setLocalTextureObject(S32 index, LLLocalTextureObject &lto);
void addVisualParam(LLVisualParam *param);
- void setVisualParamWeight(S32 index, F32 value, BOOL upload_bake);
+ void setVisualParamWeight(S32 index, F32 value);
F32 getVisualParamWeight(S32 index) const;
LLVisualParam* getVisualParam(S32 index) const;
void getVisualParams(visual_param_vec_t &list);
- void animateParams(F32 delta, BOOL upload_bake);
+ void animateParams(F32 delta);
LLColor4 getClothesColor(S32 te) const;
- void setClothesColor( S32 te, const LLColor4& new_color, BOOL upload_bake );
+ void setClothesColor( S32 te, const LLColor4& new_color);
virtual void revertValues();
virtual void saveValues();
diff --git a/indra/llappearance/llwearabledata.cpp b/indra/llappearance/llwearabledata.cpp
index 68fdcca782..cf1ee435a8 100644..100755
--- a/indra/llappearance/llwearabledata.cpp
+++ b/indra/llappearance/llwearabledata.cpp
@@ -75,13 +75,13 @@ void LLWearableData::setWearable(const LLWearableType::EType type, U32 index, LL
wearableentry_map_t::iterator wearable_iter = mWearableDatas.find(type);
if (wearable_iter == mWearableDatas.end())
{
- llwarns << "invalid type, type " << type << " index " << index << llendl;
+ LL_WARNS() << "invalid type, type " << type << " index " << index << LL_ENDL;
return;
}
wearableentry_vec_t& wearable_vec = wearable_iter->second;
if (index>=wearable_vec.size())
{
- llwarns << "invalid index, type " << type << " index " << index << llendl;
+ LL_WARNS() << "invalid index, type " << type << " index " << index << LL_ENDL;
}
else
{
@@ -99,7 +99,7 @@ U32 LLWearableData::pushWearable(const LLWearableType::EType type,
if (wearable == NULL)
{
// no null wearables please!
- llwarns << "Null wearable sent for type " << type << llendl;
+ LL_WARNS() << "Null wearable sent for type " << type << LL_ENDL;
return MAX_CLOTHING_PER_TYPE;
}
if (type < LLWearableType::WT_COUNT || mWearableDatas[type].size() < MAX_CLOTHING_PER_TYPE)
@@ -119,13 +119,6 @@ U32 LLWearableData::pushWearable(const LLWearableType::EType type,
void LLWearableData::wearableUpdated(LLWearable *wearable, BOOL removed)
{
wearable->setUpdated();
- // FIXME DRANO avoid updating params via wearables when rendering server-baked appearance.
-#if 0
- if (mAvatarAppearance->isUsingServerBakes() && !mAvatarAppearance->isUsingLocalAppearance())
- {
- return;
- }
-#endif
if (!removed)
{
pullCrossWearableValues(wearable->getType());
@@ -221,7 +214,7 @@ U32 LLWearableData::getWearableIndex(const LLWearable *wearable) const
wearableentry_map_t::const_iterator wearable_iter = mWearableDatas.find(type);
if (wearable_iter == mWearableDatas.end())
{
- llwarns << "tried to get wearable index with an invalid type!" << llendl;
+ LL_WARNS() << "tried to get wearable index with an invalid type!" << LL_ENDL;
return MAX_CLOTHING_PER_TYPE;
}
const wearableentry_vec_t& wearable_vec = wearable_iter->second;
diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp
index 8c31f8b4de..20a7afc748 100755
--- a/indra/llaudio/llaudiodecodemgr.cpp
+++ b/indra/llaudio/llaudiodecodemgr.cpp
@@ -40,6 +40,8 @@
#include "vorbis/codec.h"
#include "vorbis/vorbisfile.h"
+#include <iterator>
+#include <deque>
extern LLAudioEngine *gAudiop;
@@ -113,7 +115,7 @@ size_t vfs_read(void *ptr, size_t size, size_t nmemb, void *datasource)
}
}
-int vfs_seek(void *datasource, ogg_int64_t offset, int whence)
+S32 vfs_seek(void *datasource, ogg_int64_t offset, S32 whence)
{
LLVFile *file = (LLVFile *)datasource;
@@ -149,7 +151,7 @@ int vfs_seek(void *datasource, ogg_int64_t offset, int whence)
}
}
-int vfs_close (void *datasource)
+S32 vfs_close (void *datasource)
{
LLVFile *file = (LLVFile *)datasource;
delete file;
@@ -208,7 +210,7 @@ BOOL LLVorbisDecodeState::initDecode()
return FALSE;
}
- int r = ov_open_callbacks(mInFilep, &mVF, NULL, 0, vfs_callbacks);
+ S32 r = ov_open_callbacks(mInFilep, &mVF, NULL, 0, vfs_callbacks);
if(r < 0)
{
LL_WARNS("AudioEngine") << r << " Input to vorbis decode does not appear to be an Ogg bitstream: " << mUUID << LL_ENDL;
@@ -541,7 +543,7 @@ public:
void processQueue(const F32 num_secs = 0.005);
protected:
- LLLinkedQueue<LLUUID> mDecodeQueue;
+ std::deque<LLUUID> mDecodeQueue;
LLPointer<LLVorbisDecodeState> mCurrentDecodep;
};
@@ -570,9 +572,14 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
// We had an error when decoding, abort.
LL_WARNS("AudioEngine") << mCurrentDecodep->getUUID() << " has invalid vorbis data, aborting decode" << LL_ENDL;
mCurrentDecodep->flushBadFile();
- LLAudioData *adp = gAudiop->getAudioData(mCurrentDecodep->getUUID());
- adp->setHasValidData(false);
- adp->setHasCompletedDecode(true);
+
+ if (gAudiop)
+ {
+ LLAudioData *adp = gAudiop->getAudioData(mCurrentDecodep->getUUID());
+ adp->setHasValidData(false);
+ adp->setHasCompletedDecode(true);
+ }
+
mCurrentDecodep = NULL;
done = TRUE;
}
@@ -584,7 +591,7 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
}
else if (mCurrentDecodep)
{
- if (mCurrentDecodep->finishDecode())
+ if (gAudiop && mCurrentDecodep->finishDecode())
{
// We finished!
LLAudioData *adp = gAudiop->getAudioData(mCurrentDecodep->getUUID());
@@ -616,7 +623,7 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
if (!done)
{
- if (!mDecodeQueue.getLength())
+ if (mDecodeQueue.empty())
{
// Nothing else on the queue.
done = TRUE;
@@ -624,14 +631,15 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
else
{
LLUUID uuid;
- mDecodeQueue.pop(uuid);
- if (gAudiop->hasDecodedFile(uuid))
+ uuid = mDecodeQueue.front();
+ mDecodeQueue.pop_front();
+ if (!gAudiop || gAudiop->hasDecodedFile(uuid))
{
// This file has already been decoded, don't decode it again.
continue;
}
- lldebugs << "Decoding " << uuid << " from audio queue!" << LL_ENDL;
+ LL_DEBUGS() << "Decoding " << uuid << " from audio queue!" << LL_ENDL;
std::string uuid_str;
std::string d_path;
@@ -671,7 +679,7 @@ void LLAudioDecodeMgr::processQueue(const F32 num_secs)
BOOL LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
{
- if (gAudiop->hasDecodedFile(uuid))
+ if (gAudiop && gAudiop->hasDecodedFile(uuid))
{
// Already have a decoded version, don't need to decode it.
LL_DEBUGS("AudioEngine") << "addDecodeRequest for " << uuid << " has decoded file already" << LL_ENDL;
@@ -682,7 +690,7 @@ BOOL LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
{
// Just put it on the decode queue.
LL_DEBUGS("AudioEngine") << "addDecodeRequest for " << uuid << " has local asset file already" << LL_ENDL;
- mImpl->mDecodeQueue.push(uuid);
+ mImpl->mDecodeQueue.push_back(uuid);
return TRUE;
}
diff --git a/indra/llaudio/llaudiodecodemgr.h b/indra/llaudio/llaudiodecodemgr.h
index e42fe8a40d..8228e20e8c 100755
--- a/indra/llaudio/llaudiodecodemgr.h
+++ b/indra/llaudio/llaudiodecodemgr.h
@@ -24,11 +24,10 @@
*/
#ifndef LL_LLAUDIODECODEMGR_H
-#define LL_LLAUDIODECODEMG_H
+#define LL_LLAUDIODECODEMGR_H
#include "stdtypes.h"
-#include "lllinkedqueue.h"
#include "lluuid.h"
#include "llassettype.h"
diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp
index ca614f5395..f49028aad5 100755
--- a/indra/llaudio/llaudioengine.cpp
+++ b/indra/llaudio/llaudioengine.cpp
@@ -187,7 +187,7 @@ void LLAudioEngine::stopInternetStream()
}
// virtual
-void LLAudioEngine::pauseInternetStream(int pause)
+void LLAudioEngine::pauseInternetStream(S32 pause)
{
if (mStreamingAudioImpl)
mStreamingAudioImpl->pause(pause);
@@ -308,7 +308,7 @@ void LLAudioEngine::idle(F32 max_decode_time)
LLAudioChannel *channelp = getFreeChannel(max_priority);
if (channelp)
{
- LL_DEBUGS("AudioEngine") << "Replacing source in channel due to priority!" << LL_ENDL;
+ //LL_INFOS() << "Replacing source in channel due to priority!" << LL_ENDL;
max_sourcep->setChannel(channelp);
channelp->setSource(max_sourcep);
if (max_sourcep->isSyncSlave())
@@ -479,7 +479,7 @@ void LLAudioEngine::idle(F32 max_decode_time)
{
if (!mBuffers[i]->mInUse && mBuffers[i]->mLastUseTimer.getElapsedTimeF32() > 30.f)
{
- LL_DEBUGS("AudioEngine") << "Flushing unused buffer!" << LL_ENDL;
+ //LL_INFOS() << "Flushing unused buffer!" << LL_ENDL;
mBuffers[i]->mAudioDatap->mBufferp = NULL;
delete mBuffers[i];
mBuffers[i] = NULL;
@@ -591,8 +591,8 @@ LLAudioBuffer * LLAudioEngine::getFreeBuffer()
if (buffer_id >= 0)
{
- lldebugs << "Taking over unused buffer " << buffer_id << LL_ENDL;
- LL_DEBUGS("AudioEngine") << "Flushing unused buffer!" << LL_ENDL;
+ LL_DEBUGS() << "Taking over unused buffer " << buffer_id << LL_ENDL;
+ //LL_INFOS() << "Flushing unused buffer!" << LL_ENDL;
mBuffers[buffer_id]->mAudioDatap->mBufferp = NULL;
delete mBuffers[buffer_id];
mBuffers[buffer_id] = createBuffer();
@@ -674,8 +674,8 @@ void LLAudioEngine::cleanupBuffer(LLAudioBuffer *bufferp)
bool LLAudioEngine::preloadSound(const LLUUID &uuid)
{
LL_DEBUGS("AudioEngine")<<"( "<<uuid<<" )"<<LL_ENDL;
-
- gAudiop->getAudioData(uuid); // We don't care about the return value, this is just to make sure
+
+ getAudioData(uuid); // We don't care about the return value, this is just to make sure
// that we have an entry, which will mean that the audio engine knows about this
if (gAudioDecodeMgrp->addDecodeRequest(uuid))
@@ -686,7 +686,7 @@ bool LLAudioEngine::preloadSound(const LLUUID &uuid)
// At some point we need to have the audio/asset system check the static VFS
// before it goes off and fetches stuff from the server.
- LL_DEBUGS("AudioEngine") << "Used internal preload for non-local sound "<< uuid << LL_ENDL;
+ //LL_WARNS() << "Used internal preload for non-local sound" << LL_ENDL;
return false;
}
@@ -817,7 +817,7 @@ void LLAudioEngine::triggerSound(const LLUUID &audio_uuid, const LLUUID& owner_i
const S32 type, const LLVector3d &pos_global)
{
// Create a new source (since this can't be associated with an existing source.
- LL_DEBUGS("AudioEngine") << "Localized: " << audio_uuid << LL_ENDL;
+ //LL_INFOS() << "Localized: " << audio_uuid << LL_ENDL;
if (mMuted)
{
@@ -828,7 +828,7 @@ void LLAudioEngine::triggerSound(const LLUUID &audio_uuid, const LLUUID& owner_i
source_id.generate();
LLAudioSource *asp = new LLAudioSource(source_id, owner_id, gain, type);
- gAudiop->addAudioSource(asp);
+ addAudioSource(asp);
if (pos_global.isExactlyZero())
{
asp->setAmbient(true);
@@ -984,14 +984,15 @@ void LLAudioEngine::cleanupAudioSource(LLAudioSource *asp)
iter = mAllSources.find(asp->getID());
if (iter == mAllSources.end())
{
- LL_WARNS("AudioEngine") << "Cleaning up unknown audio source!" << LL_ENDL;
+ LL_WARNS() << "Cleaning up unknown audio source!" << LL_ENDL;
+ return;
}
else
{
LL_DEBUGS("AudioEngine") << "Cleaning up audio sources for "<< asp->getID() <<LL_ENDL;
- delete asp;
- mAllSources.erase(iter);
- }
+ delete asp;
+ mAllSources.erase(iter);
+}
}
@@ -1026,10 +1027,10 @@ bool LLAudioEngine::hasLocalFile(const LLUUID &uuid)
void LLAudioEngine::startNextTransfer()
{
- //LL_DEBUGS("AudioEngine") << "LLAudioEngine::startNextTransfer()" << LL_ENDL;
+ //LL_INFOS() << "LLAudioEngine::startNextTransfer()" << LL_ENDL;
if (mCurrentTransfer.notNull() || getMuted())
{
- //LL_DEBUGS("AudioEngine") << "Transfer in progress, aborting" << LL_ENDL;
+ //LL_INFOS() << "Transfer in progress, aborting" << LL_ENDL;
return;
}
@@ -1210,15 +1211,15 @@ void LLAudioEngine::startNextTransfer()
if (asset_id.notNull())
{
- LL_INFOS("AudioEngine") << "Getting audio asset data for: " << asset_id << LL_ENDL;
- gAudiop->mCurrentTransfer = asset_id;
- gAudiop->mCurrentTransferTimer.reset();
+ LL_INFOS() << "Getting asset data for: " << asset_id << LL_ENDL;
+ mCurrentTransfer = asset_id;
+ mCurrentTransferTimer.reset();
gAssetStorage->getAssetData(asset_id, LLAssetType::AT_SOUND,
assetCallback, NULL);
}
else
{
- //LL_DEBUGS("AudioEngine") << "No pending transfers?" << LL_ENDL;
+ //LL_INFOS() << "No pending transfers?" << LL_ENDL;
}
}
@@ -1226,9 +1227,15 @@ void LLAudioEngine::startNextTransfer()
// static
void LLAudioEngine::assetCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, void *user_data, S32 result_code, LLExtStat ext_status)
{
+ if (!gAudiop)
+ {
+ LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
+ return;
+ }
+
if (result_code)
{
- LL_INFOS("AudioEngine") << "Boom, error in audio file transfer: " << LLAssetStorage::getErrorString( result_code ) << " (" << result_code << ")" << LL_ENDL;
+ LL_INFOS() << "Boom, error in audio file transfer: " << LLAssetStorage::getErrorString( result_code ) << " (" << result_code << ")" << LL_ENDL;
// Need to mark data as bad to avoid constant rerequests.
LLAudioData *adp = gAudiop->getAudioData(uuid);
if (adp)
@@ -1245,11 +1252,11 @@ void LLAudioEngine::assetCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::E
if (!adp)
{
// Should never happen
- LL_WARNS("AudioEngine") << "Got asset callback without audio data for " << uuid << LL_ENDL;
+ LL_WARNS() << "Got asset callback without audio data for " << uuid << LL_ENDL;
}
else
{
- LL_DEBUGS("AudioEngine") << "Got asset callback with good audio data for " << uuid << ", making decode request" << LL_ENDL;
+ // LL_INFOS() << "Got asset callback with good audio data for " << uuid << ", making decode request" << LL_ENDL;
adp->setHasValidData(true);
adp->setHasLocalData(true);
gAudioDecodeMgrp->addDecodeRequest(uuid);
@@ -1328,7 +1335,7 @@ void LLAudioSource::update()
}
else if (adp->hasCompletedDecode()) // Only mark corrupted after decode is done
{
- LL_WARNS("AudioEngine") << "Marking LLAudioSource corrupted for " << adp->getID() << LL_ENDL;
+ LL_WARNS() << "Marking LLAudioSource corrupted for " << adp->getID() << LL_ENDL;
mCorrupted = true ;
}
}
@@ -1350,7 +1357,12 @@ void LLAudioSource::updatePriority()
// Priority is based on distance
LLVector3 dist_vec;
dist_vec.setVec(getPositionGlobal());
- dist_vec -= gAudiop->getListenerPos();
+
+ if (gAudiop)
+ {
+ dist_vec -= gAudiop->getListenerPos();
+ }
+
F32 dist_squared = llmax(1.f, dist_vec.magVecSquared());
mPriority = mGain / dist_squared;
@@ -1364,9 +1376,15 @@ bool LLAudioSource::setupChannel()
if (!adp->getBuffer())
{
// We're not ready to play back the sound yet, so don't try and allocate a channel for it.
+ //LL_WARNS() << "Aborting, no buffer" << LL_ENDL;
return false;
}
+ if (!gAudiop)
+ {
+ LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
+ return false;
+ }
if (!mChannelp)
{
@@ -1381,7 +1399,7 @@ bool LLAudioSource::setupChannel()
// Ugh, we don't have any free channels.
// Now we have to reprioritize.
// For now, just don't play the sound.
- //llwarns << "Aborting, no free channels" << LL_ENDL;
+ //LL_WARNS() << "Aborting, no free channels" << LL_ENDL;
return false;
}
@@ -1410,6 +1428,12 @@ bool LLAudioSource::play(const LLUUID &audio_uuid)
// Reset our age timeout if someone attempts to play the source.
mAgeTimer.reset();
+ if (!gAudiop)
+ {
+ LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
+ return false;
+ }
+
LLAudioData *adp = gAudiop->getAudioData(audio_uuid);
addAudioData(adp);
@@ -1480,7 +1504,7 @@ bool LLAudioSource::isDone() const
{
// We don't have a channel assigned, and it's been
// over 15 seconds since we tried to play it. Don't bother.
- LL_DEBUGS("AudioEngine") << "No channel assigned, source is done" << LL_ENDL;
+ //LL_INFOS() << "No channel assigned, source is done" << LL_ENDL;
return true;
}
else
@@ -1517,6 +1541,13 @@ void LLAudioSource::addAudioData(LLAudioData *adp, const bool set_current)
{
// Only handle a single piece of audio data associated with a source right now,
// until I implement prefetch.
+
+ if (!gAudiop)
+ {
+ LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
+ return;
+ }
+
if (set_current)
{
if (!mCurrentDatap)
@@ -1646,7 +1677,7 @@ LLAudioChannel::LLAudioChannel() :
LLAudioChannel::~LLAudioChannel()
{
// Need to disconnect any sources which are using this channel.
- LL_DEBUGS("AudioEngine") << "Cleaning up audio channel" << LL_ENDL;
+ //LL_INFOS() << "Cleaning up audio channel" << LL_ENDL;
if (mCurrentSourcep)
{
mCurrentSourcep->setChannel(NULL);
@@ -1657,10 +1688,12 @@ LLAudioChannel::~LLAudioChannel()
void LLAudioChannel::setSource(LLAudioSource *sourcep)
{
+ //LL_INFOS() << this << ": setSource(" << sourcep << ")" << LL_ENDL;
+
if (!sourcep)
{
// Clearing the source for this channel, don't need to do anything.
- LL_DEBUGS("AudioEngine") << "Clearing source" << ( mCurrentSourcep ? mCurrentSourcep->getID() : LLUUID::null ) << LL_ENDL;
+ //LL_INFOS() << "Clearing source for channel" << LL_ENDL;
cleanup();
mCurrentSourcep = NULL;
mWaiting = false;
@@ -1669,22 +1702,28 @@ void LLAudioChannel::setSource(LLAudioSource *sourcep)
{
LL_DEBUGS("AudioEngine") << "( id: " << sourcep->getID() << ")" << LL_ENDL;
- if (sourcep == mCurrentSourcep)
- {
- // Don't reallocate the channel, this will make FMOD goofy.
- //LL_DEBUGS("AudioEngine") << "Calling setSource with same source!" << LL_ENDL;
- }
-
- mCurrentSourcep = sourcep;
-
- updateBuffer();
- update3DPosition();
+ if (sourcep == mCurrentSourcep)
+ {
+ // Don't reallocate the channel, this will make FMOD goofy.
+ //LL_INFOS() << "Calling setSource with same source!" << LL_ENDL;
}
+
+ mCurrentSourcep = sourcep;
+
+ updateBuffer();
+ update3DPosition();
+}
}
bool LLAudioChannel::updateBuffer()
{
+ if (!gAudiop)
+ {
+ LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
+ return false;
+ }
+
if (!mCurrentSourcep)
{
// This channel isn't associated with any source, nothing
@@ -1693,10 +1732,7 @@ bool LLAudioChannel::updateBuffer()
}
// Initialize the channel's gain setting for this sound.
- if(gAudiop)
- {
- setSecondaryGain(gAudiop->getSecondaryGain(mCurrentSourcep->getType()));
- }
+ setSecondaryGain(gAudiop->getSecondaryGain(mCurrentSourcep->getType()));
LLAudioBuffer *bufferp = mCurrentSourcep->getCurrentBuffer();
if (bufferp == mCurrentBufferp)
@@ -1753,8 +1789,14 @@ LLAudioData::LLAudioData(const LLUUID &uuid) :
// This is a null sound.
return;
}
+
+ if (!gAudiop)
+ {
+ LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
+ return;
+ }
- if (gAudiop && gAudiop->hasDecodedFile(uuid))
+ if (gAudiop->hasDecodedFile(uuid))
{
// Already have a decoded version, don't need to decode it.
setHasLocalData(true);
@@ -1774,15 +1816,21 @@ bool LLAudioData::load()
if (mBufferp)
{
// We already have this sound in a buffer, don't do anything.
- LL_INFOS("AudioEngine") << "Already have a buffer for this sound, don't bother loading!" << LL_ENDL;
+ LL_INFOS() << "Already have a buffer for this sound, don't bother loading!" << LL_ENDL;
return true;
}
+
+ if (!gAudiop)
+ {
+ LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
+ return false;
+ }
mBufferp = gAudiop->getFreeBuffer();
if (!mBufferp)
{
// No free buffers, abort.
- LL_INFOS("AudioEngine") << "Not able to allocate a new audio buffer, aborting." << LL_ENDL;
+ LL_INFOS() << "Not able to allocate a new audio buffer, aborting." << LL_ENDL;
return true;
}
diff --git a/indra/llaudio/llaudioengine.h b/indra/llaudio/llaudioengine.h
index da1629a1db..f1e1b4e308 100755
--- a/indra/llaudio/llaudioengine.h
+++ b/indra/llaudio/llaudioengine.h
@@ -88,7 +88,7 @@ public:
enum LLAudioPlayState
{
- // isInternetStreamPlaying() returns an *int*, with
+ // isInternetStreamPlaying() returns an *S32*, with
// 0 = stopped, 1 = playing, 2 = paused.
AUDIO_STOPPED = 0,
AUDIO_PLAYING = 1,
@@ -160,7 +160,7 @@ public:
// Internet stream methods - these will call down into the *mStreamingAudioImpl if it exists
void startInternetStream(const std::string& url);
void stopInternetStream();
- void pauseInternetStream(int pause);
+ void pauseInternetStream(S32 pause);
void updateInternetStream(); // expected to be called often
LLAudioPlayState isInternetStreamPlaying();
// use a value from 0.0 to 1.0, inclusive
diff --git a/indra/llaudio/llaudioengine_fmodex.cpp b/indra/llaudio/llaudioengine_fmodex.cpp
index 36e8044a25..7e65a05e48 100644
--- a/indra/llaudio/llaudioengine_fmodex.cpp
+++ b/indra/llaudio/llaudioengine_fmodex.cpp
@@ -69,7 +69,7 @@ inline bool Check_FMOD_Error(FMOD_RESULT result, const char *string)
{
if(result == FMOD_OK)
return false;
- lldebugs << string << " Error: " << FMOD_ErrorString(result) << llendl;
+ LL_DEBUGS() << string << " Error: " << FMOD_ErrorString(result) << LL_ENDL;
return true;
}
@@ -77,11 +77,11 @@ void* F_STDCALL decode_alloc(unsigned int size, FMOD_MEMORY_TYPE type, const cha
{
if(type & FMOD_MEMORY_STREAM_DECODE)
{
- llinfos << "Decode buffer size: " << size << llendl;
+ LL_INFOS() << "Decode buffer size: " << size << LL_ENDL;
}
else if(type & FMOD_MEMORY_STREAM_FILE)
{
- llinfos << "Strean buffer size: " << size << llendl;
+ LL_INFOS() << "Strean buffer size: " << size << LL_ENDL;
}
return new char[size];
}
@@ -307,7 +307,7 @@ void LLAudioEngine_FMODEX::allocateListener(void)
mListenerp = (LLListener *) new LLListener_FMODEX(mSystem);
if (!mListenerp)
{
- llwarns << "Listener creation failed" << llendl;
+ LL_WARNS() << "Listener creation failed" << LL_ENDL;
}
}
@@ -316,16 +316,16 @@ void LLAudioEngine_FMODEX::shutdown()
{
stopInternetStream();
- llinfos << "About to LLAudioEngine::shutdown()" << llendl;
+ LL_INFOS() << "About to LLAudioEngine::shutdown()" << LL_ENDL;
LLAudioEngine::shutdown();
- llinfos << "LLAudioEngine_FMODEX::shutdown() closing FMOD Ex" << llendl;
+ LL_INFOS() << "LLAudioEngine_FMODEX::shutdown() closing FMOD Ex" << LL_ENDL;
if ( mSystem ) // speculative fix for MAINT-2657
{
mSystem->close();
mSystem->release();
}
- llinfos << "LLAudioEngine_FMODEX::shutdown() done closing FMOD Ex" << llendl;
+ LL_INFOS() << "LLAudioEngine_FMODEX::shutdown() done closing FMOD Ex" << LL_ENDL;
delete mListenerp;
mListenerp = NULL;
@@ -474,7 +474,7 @@ bool LLAudioChannelFMODEX::updateBuffer()
{
// This is bad, there should ALWAYS be a sound associated with a legit
// buffer.
- llerrs << "No FMOD sound!" << llendl;
+ LL_ERRS() << "No FMOD sound!" << LL_ENDL;
return false;
}
@@ -487,7 +487,7 @@ bool LLAudioChannelFMODEX::updateBuffer()
Check_FMOD_Error(result, "FMOD::System::playSound");
}
- //llinfos << "Setting up channel " << std::hex << mChannelID << std::dec << llendl;
+ //LL_INFOS() << "Setting up channel " << std::hex << mChannelID << std::dec << LL_ENDL;
}
// If we have a source for the channel, we need to update its gain.
@@ -504,8 +504,8 @@ bool LLAudioChannelFMODEX::updateBuffer()
{
S32 index;
mChannelp->getIndex(&index);
- llwarns << "Channel " << index << "Source ID: " << mCurrentSourcep->getID()
- << " at " << mCurrentSourcep->getPositionGlobal() << llendl;
+ LL_WARNS() << "Channel " << index << "Source ID: " << mCurrentSourcep->getID()
+ << " at " << mCurrentSourcep->getPositionGlobal() << LL_ENDL;
}*/
}
@@ -575,11 +575,11 @@ void LLAudioChannelFMODEX::cleanup()
{
if (!mChannelp)
{
- //llinfos << "Aborting cleanup with no channel handle." << llendl;
+ //LL_INFOS() << "Aborting cleanup with no channel handle." << LL_ENDL;
return;
}
- //llinfos << "Cleaning up channel: " << mChannelID << llendl;
+ //LL_INFOS() << "Cleaning up channel: " << mChannelID << LL_ENDL;
Check_FMOD_Error(mChannelp->stop(),"FMOD::Channel::stop");
mCurrentBufferp = NULL;
@@ -591,7 +591,7 @@ void LLAudioChannelFMODEX::play()
{
if (!mChannelp)
{
- llwarns << "Playing without a channel handle, aborting" << llendl;
+ LL_WARNS() << "Playing without a channel handle, aborting" << LL_ENDL;
return;
}
@@ -699,7 +699,7 @@ bool LLAudioBufferFMODEX::loadWAV(const std::string& filename)
if (result != FMOD_OK)
{
// We failed to load the file for some reason.
- llwarns << "Could not load data '" << filename << "': " << FMOD_ErrorString(result) << llendl;
+ LL_WARNS() << "Could not load data '" << filename << "': " << FMOD_ErrorString(result) << LL_ENDL;
//
// If we EVER want to load wav files provided by end users, we need
diff --git a/indra/llaudio/llaudioengine_openal.cpp b/indra/llaudio/llaudioengine_openal.cpp
index 34a057dcc0..e6ac586618 100755
--- a/indra/llaudio/llaudioengine_openal.cpp
+++ b/indra/llaudio/llaudioengine_openal.cpp
@@ -59,33 +59,33 @@ bool LLAudioEngine_OpenAL::init(const S32 num_channels, void* userdata)
if(!alutInit(NULL, NULL))
{
- llwarns << "LLAudioEngine_OpenAL::init() ALUT initialization failed: " << alutGetErrorString (alutGetError ()) << llendl;
+ LL_WARNS() << "LLAudioEngine_OpenAL::init() ALUT initialization failed: " << alutGetErrorString (alutGetError ()) << LL_ENDL;
return false;
}
- llinfos << "LLAudioEngine_OpenAL::init() OpenAL successfully initialized" << llendl;
+ LL_INFOS() << "LLAudioEngine_OpenAL::init() OpenAL successfully initialized" << LL_ENDL;
- llinfos << "OpenAL version: "
- << ll_safe_string(alGetString(AL_VERSION)) << llendl;
- llinfos << "OpenAL vendor: "
- << ll_safe_string(alGetString(AL_VENDOR)) << llendl;
- llinfos << "OpenAL renderer: "
- << ll_safe_string(alGetString(AL_RENDERER)) << llendl;
+ LL_INFOS() << "OpenAL version: "
+ << ll_safe_string(alGetString(AL_VERSION)) << LL_ENDL;
+ LL_INFOS() << "OpenAL vendor: "
+ << ll_safe_string(alGetString(AL_VENDOR)) << LL_ENDL;
+ LL_INFOS() << "OpenAL renderer: "
+ << ll_safe_string(alGetString(AL_RENDERER)) << LL_ENDL;
ALint major = alutGetMajorVersion ();
ALint minor = alutGetMinorVersion ();
- llinfos << "ALUT version: " << major << "." << minor << llendl;
+ LL_INFOS() << "ALUT version: " << major << "." << minor << LL_ENDL;
ALCdevice *device = alcGetContextsDevice(alcGetCurrentContext());
alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &major);
alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &minor);
- llinfos << "ALC version: " << major << "." << minor << llendl;
+ LL_INFOS() << "ALC version: " << major << "." << minor << LL_ENDL;
- llinfos << "ALC default device: "
+ LL_INFOS() << "ALC default device: "
<< ll_safe_string(alcGetString(device,
ALC_DEFAULT_DEVICE_SPECIFIER))
- << llendl;
+ << LL_ENDL;
return true;
}
@@ -125,24 +125,24 @@ void LLAudioEngine_OpenAL::allocateListener()
mListenerp = (LLListener *) new LLListener_OpenAL();
if(!mListenerp)
{
- llwarns << "LLAudioEngine_OpenAL::allocateListener() Listener creation failed" << llendl;
+ LL_WARNS() << "LLAudioEngine_OpenAL::allocateListener() Listener creation failed" << LL_ENDL;
}
}
// virtual
void LLAudioEngine_OpenAL::shutdown()
{
- llinfos << "About to LLAudioEngine::shutdown()" << llendl;
+ LL_INFOS() << "About to LLAudioEngine::shutdown()" << LL_ENDL;
LLAudioEngine::shutdown();
- llinfos << "About to alutExit()" << llendl;
+ LL_INFOS() << "About to alutExit()" << LL_ENDL;
if(!alutExit())
{
- llwarns << "Nuts." << llendl;
- llwarns << "LLAudioEngine_OpenAL::shutdown() ALUT shutdown failed: " << alutGetErrorString (alutGetError ()) << llendl;
+ LL_WARNS() << "Nuts." << LL_ENDL;
+ LL_WARNS() << "LLAudioEngine_OpenAL::shutdown() ALUT shutdown failed: " << alutGetErrorString (alutGetError ()) << LL_ENDL;
}
- llinfos << "LLAudioEngine_OpenAL::shutdown() OpenAL successfully shut down" << llendl;
+ LL_INFOS() << "LLAudioEngine_OpenAL::shutdown() OpenAL successfully shut down" << LL_ENDL;
delete mListenerp;
mListenerp = NULL;
@@ -160,7 +160,7 @@ LLAudioChannel *LLAudioEngine_OpenAL::createChannel()
void LLAudioEngine_OpenAL::setInternalGain(F32 gain)
{
- //llinfos << "LLAudioEngine_OpenAL::setInternalGain() Gain: " << gain << llendl;
+ //LL_INFOS() << "LLAudioEngine_OpenAL::setInternalGain() Gain: " << gain << LL_ENDL;
alListenerf(AL_GAIN, gain);
}
@@ -188,7 +188,7 @@ void LLAudioChannelOpenAL::play()
{
if (mALSource == AL_NONE)
{
- llwarns << "Playing without a mALSource, aborting" << llendl;
+ LL_WARNS() << "Playing without a mALSource, aborting" << LL_ENDL;
return;
}
@@ -213,8 +213,8 @@ void LLAudioChannelOpenAL::playSynced(LLAudioChannel *channelp)
alGetSourcef(masterchannelp->mALSource, AL_SEC_OFFSET,
&master_offset);
- llinfos << "Syncing with master at " << master_offset
- << "sec" << llendl;
+ LL_INFOS() << "Syncing with master at " << master_offset
+ << "sec" << LL_ENDL;
// *TODO: detect when this fails, maybe use AL_SAMPLE_
alSourcef(mALSource, AL_SEC_OFFSET, master_offset);
}
@@ -334,18 +334,18 @@ bool LLAudioBufferOpenAL::loadWAV(const std::string& filename)
ALenum error = alutGetError();
if (gDirUtilp->fileExists(filename))
{
- llwarns <<
+ LL_WARNS() <<
"LLAudioBufferOpenAL::loadWAV() Error loading "
<< filename
- << " " << alutGetErrorString(error) << llendl;
+ << " " << alutGetErrorString(error) << LL_ENDL;
}
else
{
// It's common for the file to not actually exist.
- lldebugs <<
+ LL_DEBUGS() <<
"LLAudioBufferOpenAL::loadWAV() Error loading "
<< filename
- << " " << alutGetErrorString(error) << llendl;
+ << " " << alutGetErrorString(error) << LL_ENDL;
}
return false;
}
@@ -369,7 +369,7 @@ U32 LLAudioBufferOpenAL::getLength()
bool LLAudioEngine_OpenAL::initWind()
{
ALenum error;
- llinfos << "LLAudioEngine_OpenAL::initWind() start" << llendl;
+ LL_INFOS() << "LLAudioEngine_OpenAL::initWind() start" << LL_ENDL;
mNumEmptyWindALBuffers = MAX_NUM_WIND_BUFFERS;
@@ -379,7 +379,7 @@ bool LLAudioEngine_OpenAL::initWind()
if((error=alGetError()) != AL_NO_ERROR)
{
- llwarns << "LLAudioEngine_OpenAL::initWind() Error creating wind sources: "<<error<<llendl;
+ LL_WARNS() << "LLAudioEngine_OpenAL::initWind() Error creating wind sources: "<<error<<LL_ENDL;
}
mWindGen = new LLWindGen<WIND_SAMPLE_T>;
@@ -392,18 +392,18 @@ bool LLAudioEngine_OpenAL::initWind()
if(mWindBuf==NULL)
{
- llerrs << "LLAudioEngine_OpenAL::initWind() Error creating wind memory buffer" << llendl;
+ LL_ERRS() << "LLAudioEngine_OpenAL::initWind() Error creating wind memory buffer" << LL_ENDL;
return false;
}
- llinfos << "LLAudioEngine_OpenAL::initWind() done" << llendl;
+ LL_INFOS() << "LLAudioEngine_OpenAL::initWind() done" << LL_ENDL;
return true;
}
void LLAudioEngine_OpenAL::cleanupWind()
{
- llinfos << "LLAudioEngine_OpenAL::cleanupWind()" << llendl;
+ LL_INFOS() << "LLAudioEngine_OpenAL::cleanupWind()" << LL_ENDL;
if (mWindSource != AL_NONE)
{
@@ -479,7 +479,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)
mNumEmptyWindALBuffers = llmin(mNumEmptyWindALBuffers + processed * 3 - unprocessed, MAX_NUM_WIND_BUFFERS-unprocessed);
mNumEmptyWindALBuffers = llmax(mNumEmptyWindALBuffers, 0);
- //llinfos << "mNumEmptyWindALBuffers: " << mNumEmptyWindALBuffers <<" (" << unprocessed << ":" << processed << ")" << llendl;
+ //LL_INFOS() << "mNumEmptyWindALBuffers: " << mNumEmptyWindALBuffers <<" (" << unprocessed << ":" << processed << ")" << LL_ENDL;
while(processed--) // unqueue old buffers
{
@@ -490,7 +490,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)
error = alGetError();
if(error != AL_NO_ERROR)
{
- llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (unqueuing) buffers" << llendl;
+ LL_WARNS() << "LLAudioEngine_OpenAL::updateWind() error swapping (unqueuing) buffers" << LL_ENDL;
}
else
{
@@ -506,7 +506,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)
alGenBuffers(1,&buffer);
if((error=alGetError()) != AL_NO_ERROR)
{
- llwarns << "LLAudioEngine_OpenAL::updateWind() Error creating wind buffer: " << error << llendl;
+ LL_WARNS() << "LLAudioEngine_OpenAL::updateWind() Error creating wind buffer: " << error << LL_ENDL;
break;
}
@@ -519,14 +519,14 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)
error = alGetError();
if(error != AL_NO_ERROR)
{
- llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (bufferdata) buffers" << llendl;
+ LL_WARNS() << "LLAudioEngine_OpenAL::updateWind() error swapping (bufferdata) buffers" << LL_ENDL;
}
alSourceQueueBuffers(mWindSource, 1, &buffer);
error = alGetError();
if(error != AL_NO_ERROR)
{
- llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (queuing) buffers" << llendl;
+ LL_WARNS() << "LLAudioEngine_OpenAL::updateWind() error swapping (queuing) buffers" << LL_ENDL;
}
--mNumEmptyWindALBuffers;
@@ -538,7 +538,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)
{
alSourcePlay(mWindSource);
- lldebugs << "Wind had stopped - probably ran out of buffers - restarting: " << (unprocessed+mNumEmptyWindALBuffers) << " now queued." << llendl;
+ LL_DEBUGS() << "Wind had stopped - probably ran out of buffers - restarting: " << (unprocessed+mNumEmptyWindALBuffers) << " now queued." << LL_ENDL;
}
}
diff --git a/indra/llaudio/lllistener_openal.cpp b/indra/llaudio/lllistener_openal.cpp
index b3d4b02f09..9dd4c86854 100755
--- a/indra/llaudio/lllistener_openal.cpp
+++ b/indra/llaudio/lllistener_openal.cpp
@@ -41,13 +41,13 @@ LLListener_OpenAL::~LLListener_OpenAL()
void LLListener_OpenAL::translate(LLVector3 offset)
{
- //llinfos << "LLListener_OpenAL::translate() : " << offset << llendl;
+ //LL_INFOS() << "LLListener_OpenAL::translate() : " << offset << LL_ENDL;
LLListener::translate(offset);
}
void LLListener_OpenAL::setPosition(LLVector3 pos)
{
- //llinfos << "LLListener_OpenAL::setPosition() : " << pos << llendl;
+ //LL_INFOS() << "LLListener_OpenAL::setPosition() : " << pos << LL_ENDL;
LLListener::setPosition(pos);
}
@@ -58,7 +58,7 @@ void LLListener_OpenAL::setVelocity(LLVector3 vel)
void LLListener_OpenAL::orient(LLVector3 up, LLVector3 at)
{
- //llinfos << "LLListener_OpenAL::orient() up: " << up << " at: " << at << llendl;
+ //LL_INFOS() << "LLListener_OpenAL::orient() up: " << up << " at: " << at << LL_ENDL;
LLListener::orient(up, at);
}
@@ -84,7 +84,7 @@ void LLListener_OpenAL::commitDeferredChanges()
void LLListener_OpenAL::setDopplerFactor(F32 factor)
{
- //llinfos << "LLListener_OpenAL::setDopplerFactor() : " << factor << llendl;
+ //LL_INFOS() << "LLListener_OpenAL::setDopplerFactor() : " << factor << LL_ENDL;
alDopplerFactor(factor);
}
@@ -92,7 +92,7 @@ F32 LLListener_OpenAL::getDopplerFactor()
{
ALfloat factor;
factor = alGetFloat(AL_DOPPLER_FACTOR);
- //llinfos << "LLListener_OpenAL::getDopplerFactor() : " << factor << llendl;
+ //LL_INFOS() << "LLListener_OpenAL::getDopplerFactor() : " << factor << LL_ENDL;
return factor;
}
diff --git a/indra/llaudio/llstreamingaudio_fmodex.cpp b/indra/llaudio/llstreamingaudio_fmodex.cpp
index 42f30aa1c4..9c9e85c00c 100644
--- a/indra/llaudio/llstreamingaudio_fmodex.cpp
+++ b/indra/llaudio/llstreamingaudio_fmodex.cpp
@@ -91,7 +91,7 @@ void LLStreamingAudio_FMODEX::start(const std::string& url)
{
//if (!mInited)
//{
- // llwarns << "startInternetStream before audio initialized" << llendl;
+ // LL_WARNS() << "startInternetStream before audio initialized" << LL_ENDL;
// return;
//}
@@ -100,13 +100,13 @@ void LLStreamingAudio_FMODEX::start(const std::string& url)
if (!url.empty())
{
- llinfos << "Starting internet stream: " << url << llendl;
+ LL_INFOS() << "Starting internet stream: " << url << LL_ENDL;
mCurrentInternetStreamp = new LLAudioStreamManagerFMODEX(mSystem,url);
mURL = url;
}
else
{
- llinfos << "Set internet stream to null" << llendl;
+ LL_INFOS() << "Set internet stream to null" << LL_ENDL;
mURL.clear();
}
}
@@ -121,7 +121,7 @@ void LLStreamingAudio_FMODEX::update()
LLAudioStreamManagerFMODEX *streamp = *iter;
if (streamp->stopStream())
{
- llinfos << "Closed dead stream" << llendl;
+ LL_INFOS() << "Closed dead stream" << LL_ENDL;
delete streamp;
mDeadStreams.erase(iter++);
}
@@ -181,7 +181,7 @@ void LLStreamingAudio_FMODEX::update()
{
if (!strcmp(tag.name, "Sample Rate Change"))
{
- llinfos << "Stream forced changing sample rate to " << *((float *)tag.data) << llendl;
+ LL_INFOS() << "Stream forced changing sample rate to " << *((float *)tag.data) << LL_ENDL;
mFMODInternetStreamChannelp->setFrequency(*((float *)tag.data));
}
continue;
@@ -195,9 +195,9 @@ void LLStreamingAudio_FMODEX::update()
mFMODInternetStreamChannelp->getPaused(&paused);
if(!paused)
{
- llinfos << "Stream starvation detected! Pausing stream until buffer nearly full." << llendl;
- llinfos << " (diskbusy="<<diskbusy<<")" << llendl;
- llinfos << " (progress="<<progress<<")" << llendl;
+ LL_INFOS() << "Stream starvation detected! Pausing stream until buffer nearly full." << LL_ENDL;
+ LL_INFOS() << " (diskbusy="<<diskbusy<<")" << LL_ENDL;
+ LL_INFOS() << " (progress="<<progress<<")" << LL_ENDL;
mFMODInternetStreamChannelp->setPaused(true);
}
}
@@ -220,14 +220,14 @@ void LLStreamingAudio_FMODEX::stop()
if (mCurrentInternetStreamp)
{
- llinfos << "Stopping internet stream: " << mCurrentInternetStreamp->getURL() << llendl;
+ LL_INFOS() << "Stopping internet stream: " << mCurrentInternetStreamp->getURL() << LL_ENDL;
if (mCurrentInternetStreamp->stopStream())
{
delete mCurrentInternetStreamp;
}
else
{
- llwarns << "Pushing stream to dead list: " << mCurrentInternetStreamp->getURL() << llendl;
+ LL_WARNS() << "Pushing stream to dead list: " << mCurrentInternetStreamp->getURL() << LL_ENDL;
mDeadStreams.push_back(mCurrentInternetStreamp);
}
mCurrentInternetStreamp = NULL;
@@ -314,9 +314,9 @@ LLAudioStreamManagerFMODEX::LLAudioStreamManagerFMODEX(FMOD::System *system, con
if (result!= FMOD_OK)
{
- llwarns << "Couldn't open fmod stream, error "
+ LL_WARNS() << "Couldn't open fmod stream, error "
<< FMOD_ErrorString(result)
- << llendl;
+ << LL_ENDL;
mReady = false;
return;
}
@@ -329,7 +329,7 @@ FMOD::Channel *LLAudioStreamManagerFMODEX::startStream()
// We need a live and opened stream before we try and play it.
if (!mInternetStream || getOpenState() != FMOD_OPENSTATE_READY)
{
- llwarns << "No internet stream to start playing!" << llendl;
+ LL_WARNS() << "No internet stream to start playing!" << LL_ENDL;
return NULL;
}
diff --git a/indra/llaudio/llstreamingaudio_fmodex.h b/indra/llaudio/llstreamingaudio_fmodex.h
index 1dee18ae7d..2787840ba1 100644
--- a/indra/llaudio/llstreamingaudio_fmodex.h
+++ b/indra/llaudio/llstreamingaudio_fmodex.h
@@ -49,9 +49,9 @@ class LLStreamingAudio_FMODEX : public LLStreamingAudioInterface
/*virtual*/ void start(const std::string& url);
/*virtual*/ void stop();
- /*virtual*/ void pause(int pause);
+ /*virtual*/ void pause(S32 pause);
/*virtual*/ void update();
- /*virtual*/ int isPlaying();
+ /*virtual*/ S32 isPlaying();
/*virtual*/ void setGain(F32 vol);
/*virtual*/ F32 getGain();
/*virtual*/ std::string getURL();
diff --git a/indra/llaudio/llvorbisencode.cpp b/indra/llaudio/llvorbisencode.cpp
index dfd5da12b3..2e1ed9b505 100755
--- a/indra/llaudio/llvorbisencode.cpp
+++ b/indra/llaudio/llvorbisencode.cpp
@@ -127,7 +127,7 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro
return(LLVORBISENC_CHUNK_SIZE_ERR);
}
-// llinfos << "chunk found: '" << wav_header[0] << wav_header[1] << wav_header[2] << wav_header[3] << "'" << llendl;
+// LL_INFOS() << "chunk found: '" << wav_header[0] << wav_header[1] << wav_header[2] << wav_header[3] << "'" << LL_ENDL;
if (!(strncmp((char *)&(wav_header[0]),"fmt ",4)))
{
@@ -224,7 +224,7 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
std::string error_msg;
if ((format_error = check_for_invalid_wav_formats(in_fname, error_msg)))
{
- llwarns << error_msg << ": " << in_fname << llendl;
+ LL_WARNS() << error_msg << ": " << in_fname << LL_ENDL;
return(format_error);
}
@@ -237,8 +237,8 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
infile.open(in_fname,LL_APR_RB);
if (!infile.getFileHandle())
{
- llwarns << "Couldn't open temporary ogg file for writing: " << in_fname
- << llendl;
+ LL_WARNS() << "Couldn't open temporary ogg file for writing: " << in_fname
+ << LL_ENDL;
return(LLVORBISENC_SOURCE_OPEN_ERR);
}
@@ -246,8 +246,8 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
outfile.open(out_fname,LL_APR_WPB);
if (!outfile.getFileHandle())
{
- llwarns << "Couldn't open upload sound file for reading: " << in_fname
- << llendl;
+ LL_WARNS() << "Couldn't open upload sound file for reading: " << in_fname
+ << LL_ENDL;
return(LLVORBISENC_DEST_OPEN_ERR);
}
@@ -265,7 +265,7 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
+ ((U32) wav_header[5] << 8)
+ wav_header[4];
-// llinfos << "chunk found: '" << wav_header[0] << wav_header[1] << wav_header[2] << wav_header[3] << "'" << llendl;
+// LL_INFOS() << "chunk found: '" << wav_header[0] << wav_header[1] << wav_header[2] << wav_header[3] << "'" << LL_ENDL;
if (!(strncmp((char *)&(wav_header[0]),"fmt ",4)))
{
@@ -308,8 +308,8 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
// vorbis_encode_ctl(&vi,OV_ECTL_RATEMANAGE_AVG,NULL) ||
// vorbis_encode_setup_init(&vi))
{
- llwarns << "unable to initialize vorbis codec at quality " << quality << llendl;
- // llwarns << "unable to initialize vorbis codec at bitrate " << bitrate << llendl;
+ LL_WARNS() << "unable to initialize vorbis codec at quality " << quality << LL_ENDL;
+ // LL_WARNS() << "unable to initialize vorbis codec at bitrate " << bitrate << LL_ENDL;
return(LLVORBISENC_DEST_OPEN_ERR);
}
@@ -498,7 +498,7 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname
libvorbis. They're never freed or manipulated directly */
// fprintf(stderr,"Vorbis encoding: Done.\n");
- llinfos << "Vorbis encoding: Done." << llendl;
+ LL_INFOS() << "Vorbis encoding: Done." << LL_ENDL;
#endif
return(LLVORBISENC_NOERR);
diff --git a/indra/llcharacter/llanimationstates.h b/indra/llcharacter/llanimationstates.h
index 84185c3f92..79cbcabdc1 100755
--- a/indra/llcharacter/llanimationstates.h
+++ b/indra/llcharacter/llanimationstates.h
@@ -29,7 +29,7 @@
#include <map>
-#include "string_table.h"
+#include "llstringtable.h"
#include "lluuid.h"
//-----------------------------------------------------------------------------
diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp
index 8c02a25367..0d558aeaa2 100755
--- a/indra/llcharacter/llbvhloader.cpp
+++ b/indra/llcharacter/llbvhloader.cpp
@@ -130,14 +130,14 @@ LLQuaternion::Order bvhStringToOrder( char *str )
if (mStatus == LLBVHLoader::ST_NO_XLT_FILE)
{
- llwarns << "NOTE: No translation table found." << llendl;
+ LL_WARNS() << "NOTE: No translation table found." << LL_ENDL;
return;
}
else
{
if (mStatus != LLBVHLoader::ST_OK)
{
- llwarns << "ERROR: [line: " << getLineNumber() << "] " << mStatus << llendl;
+ LL_WARNS() << "ERROR: [line: " << getLineNumber() << "] " << mStatus << LL_ENDL;
return;
}
}
@@ -147,7 +147,7 @@ LLQuaternion::Order bvhStringToOrder( char *str )
mStatus = loadBVHFile(buffer, error_text, error_line);
if (mStatus != LLBVHLoader::ST_OK)
{
- llwarns << "ERROR: [line: " << getLineNumber() << "] " << mStatus << llendl;
+ LL_WARNS() << "ERROR: [line: " << getLineNumber() << "] " << mStatus << LL_ENDL;
return;
}
@@ -163,10 +163,10 @@ LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &error
errorLine = 0;
mStatus = loadTranslationTable("anim.ini");
loadStatus = mStatus;
- llinfos<<"Load Status 00 : "<< loadStatus << llendl;
+ LL_INFOS()<<"Load Status 00 : "<< loadStatus << LL_ENDL;
if (mStatus == E_ST_NO_XLT_FILE)
{
- //llwarns << "NOTE: No translation table found." << llendl;
+ //LL_WARNS() << "NOTE: No translation table found." << LL_ENDL;
loadStatus = mStatus;
return;
}
@@ -174,7 +174,7 @@ LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &error
{
if (mStatus != E_ST_OK)
{
- //llwarns << "ERROR: [line: " << getLineNumber() << "] " << mStatus << llendl;
+ //LL_WARNS() << "ERROR: [line: " << getLineNumber() << "] " << mStatus << LL_ENDL;
errorLine = getLineNumber();
loadStatus = mStatus;
return;
@@ -187,7 +187,7 @@ LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &error
if (mStatus != E_ST_OK)
{
- //llwarns << "ERROR: [line: " << getLineNumber() << "] " << mStatus << llendl;
+ //LL_WARNS() << "ERROR: [line: " << getLineNumber() << "] " << mStatus << LL_ENDL;
loadStatus = mStatus;
errorLine = getLineNumber();
return;
@@ -226,7 +226,7 @@ ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName)
if (!fp)
return E_ST_NO_XLT_FILE;
- llinfos << "NOTE: Loading translation table: " << fileName << llendl;
+ LL_INFOS() << "NOTE: Loading translation table: " << fileName << LL_ENDL;
//--------------------------------------------------------------------
// register file to be closed on function exit
@@ -290,7 +290,7 @@ ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName)
return E_ST_NO_XLT_EMOTE;
mEmoteName.assign( emote_str );
-// llinfos << "NOTE: Emote: " << mEmoteName.c_str() << llendl;
+// LL_INFOS() << "NOTE: Emote: " << mEmoteName.c_str() << LL_ENDL;
continue;
}
@@ -305,7 +305,7 @@ ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName)
return E_ST_NO_XLT_PRIORITY;
mPriority = priority;
-// llinfos << "NOTE: Priority: " << mPriority << llendl;
+// LL_INFOS() << "NOTE: Priority: " << mPriority << LL_ENDL;
continue;
}
@@ -698,7 +698,7 @@ ELoadStatus LLBVHLoader::loadBVHFile(const char *buffer, char* error_text, S32 &
if ( !strstr(line.c_str(), "HIERARCHY") )
{
-// llinfos << line << llendl;
+// LL_INFOS() << line << LL_ENDL;
return E_ST_NO_HIER;
}
@@ -1045,7 +1045,7 @@ void LLBVHLoader::applyTranslations()
//----------------------------------------------------------------
if ( trans.mIgnore )
{
- //llinfos << "NOTE: Ignoring " << joint->mName.c_str() << llendl;
+ //LL_INFOS() << "NOTE: Ignoring " << joint->mName.c_str() << LL_ENDL;
joint->mIgnore = TRUE;
continue;
}
@@ -1055,7 +1055,7 @@ void LLBVHLoader::applyTranslations()
//----------------------------------------------------------------
if ( ! trans.mOutName.empty() )
{
- //llinfos << "NOTE: Changing " << joint->mName.c_str() << " to " << trans.mOutName.c_str() << llendl;
+ //LL_INFOS() << "NOTE: Changing " << joint->mName.c_str() << " to " << trans.mOutName.c_str() << LL_ENDL;
joint->mOutName = trans.mOutName;
}
@@ -1072,25 +1072,25 @@ void LLBVHLoader::applyTranslations()
//----------------------------------------------------------------
if ( trans.mRelativePositionKey )
{
-// llinfos << "NOTE: Removing 1st position offset from all keys for " << joint->mOutName.c_str() << llendl;
+// LL_INFOS() << "NOTE: Removing 1st position offset from all keys for " << joint->mOutName.c_str() << LL_ENDL;
joint->mRelativePositionKey = TRUE;
}
if ( trans.mRelativeRotationKey )
{
-// llinfos << "NOTE: Removing 1st rotation from all keys for " << joint->mOutName.c_str() << llendl;
+// LL_INFOS() << "NOTE: Removing 1st rotation from all keys for " << joint->mOutName.c_str() << LL_ENDL;
joint->mRelativeRotationKey = TRUE;
}
if ( trans.mRelativePosition.magVec() > 0.0f )
{
joint->mRelativePosition = trans.mRelativePosition;
-// llinfos << "NOTE: Removing " <<
+// LL_INFOS() << "NOTE: Removing " <<
// joint->mRelativePosition.mV[0] << " " <<
// joint->mRelativePosition.mV[1] << " " <<
// joint->mRelativePosition.mV[2] <<
// " from all position keys in " <<
-// joint->mOutName.c_str() << llendl;
+// joint->mOutName.c_str() << LL_ENDL;
}
//----------------------------------------------------------------
@@ -1104,9 +1104,9 @@ void LLBVHLoader::applyTranslations()
//----------------------------------------------------------------
if ( ! trans.mMergeParentName.empty() )
{
-// llinfos << "NOTE: Merging " << joint->mOutName.c_str() <<
+// LL_INFOS() << "NOTE: Merging " << joint->mOutName.c_str() <<
// " with parent " <<
-// trans.mMergeParentName.c_str() << llendl;
+// trans.mMergeParentName.c_str() << LL_ENDL;
joint->mMergeParentName = trans.mMergeParentName;
}
@@ -1115,8 +1115,8 @@ void LLBVHLoader::applyTranslations()
//----------------------------------------------------------------
if ( ! trans.mMergeChildName.empty() )
{
-// llinfos << "NOTE: Merging " << joint->mName.c_str() <<
-// " with child " << trans.mMergeChildName.c_str() << llendl;
+// LL_INFOS() << "NOTE: Merging " << joint->mName.c_str() <<
+// " with child " << trans.mMergeChildName.c_str() << LL_ENDL;
joint->mMergeChildName = trans.mMergeChildName;
}
@@ -1311,7 +1311,7 @@ void LLBVHLoader::optimize()
// don't output joints with no motion
if (!(pos_changed || rot_changed))
{
- //llinfos << "Ignoring joint " << joint->mName << llendl;
+ //LL_INFOS() << "Ignoring joint " << joint->mName << LL_ENDL;
joint->mIgnore = TRUE;
}
}
diff --git a/indra/llcharacter/llcharacter.cpp b/indra/llcharacter/llcharacter.cpp
index 85cf1cd3f5..4df975ecc5 100755
--- a/indra/llcharacter/llcharacter.cpp
+++ b/indra/llcharacter/llcharacter.cpp
@@ -32,6 +32,7 @@
#include "llcharacter.h"
#include "llstring.h"
+#include "llfasttimer.h"
#define SKEL_HEADER "Linden Skeleton 1.0"
@@ -105,7 +106,7 @@ LLJoint *LLCharacter::getJoint( const std::string &name )
if (!joint)
{
- llwarns << "Failed to find joint." << llendl;
+ LL_WARNS() << "Failed to find joint." << LL_ENDL;
}
return joint;
}
@@ -180,27 +181,27 @@ BOOL LLCharacter::isMotionActive(const LLUUID& id)
//-----------------------------------------------------------------------------
void LLCharacter::requestStopMotion( LLMotion* motion)
{
-// llinfos << "DEBUG: Char::onDeactivateMotion( " << motionName << " )" << llendl;
+// LL_INFOS() << "DEBUG: Char::onDeactivateMotion( " << motionName << " )" << LL_ENDL;
}
//-----------------------------------------------------------------------------
// updateMotions()
//-----------------------------------------------------------------------------
-static LLFastTimer::DeclareTimer FTM_UPDATE_ANIMATION("Update Animation");
-static LLFastTimer::DeclareTimer FTM_UPDATE_HIDDEN_ANIMATION("Update Hidden Anim");
-static LLFastTimer::DeclareTimer FTM_UPDATE_MOTIONS("Update Motions");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_ANIMATION("Update Animation");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_HIDDEN_ANIMATION("Update Hidden Anim");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_MOTIONS("Update Motions");
void LLCharacter::updateMotions(e_update_t update_type)
{
if (update_type == HIDDEN_UPDATE)
{
- LLFastTimer t(FTM_UPDATE_HIDDEN_ANIMATION);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_HIDDEN_ANIMATION);
mMotionController.updateMotionsMinimal();
}
else
{
- LLFastTimer t(FTM_UPDATE_ANIMATION);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_ANIMATION);
// unpause if the number of outstanding pause requests has dropped to the initial one
if (mMotionController.isPaused() && mPauseRequest->getNumRefs() == 1)
{
@@ -208,7 +209,7 @@ void LLCharacter::updateMotions(e_update_t update_type)
}
bool force_update = (update_type == FORCE_UPDATE);
{
- LLFastTimer t(FTM_UPDATE_MOTIONS);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_MOTIONS);
mMotionController.updateMotions(force_update);
}
}
@@ -241,14 +242,14 @@ void LLCharacter::dumpCharacter( LLJoint* joint )
// handle top level entry into recursion
if (joint == NULL)
{
- llinfos << "DEBUG: Dumping Character @" << this << llendl;
+ LL_INFOS() << "DEBUG: Dumping Character @" << this << LL_ENDL;
dumpCharacter( getRootJoint() );
- llinfos << "DEBUG: Done." << llendl;
+ LL_INFOS() << "DEBUG: Done." << LL_ENDL;
return;
}
// print joint info
- llinfos << "DEBUG: " << joint->getName() << " (" << (joint->getParent()?joint->getParent()->getName():std::string("ROOT")) << ")" << llendl;
+ LL_INFOS() << "DEBUG: " << joint->getName() << " (" << (joint->getParent()?joint->getParent()->getName():std::string("ROOT")) << ")" << LL_ENDL;
// recurse
for (LLJoint::child_list_t::iterator iter = joint->mChildren.begin();
@@ -286,13 +287,13 @@ void LLCharacter::removeAnimationData(std::string name)
//-----------------------------------------------------------------------------
// setVisualParamWeight()
//-----------------------------------------------------------------------------
-BOOL LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 weight, BOOL upload_bake)
+BOOL LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 weight)
{
S32 index = which_param->getID();
visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index);
if (index_iter != mVisualParamIndexMap.end())
{
- index_iter->second->setWeight(weight, upload_bake);
+ index_iter->second->setWeight(weight);
return TRUE;
}
return FALSE;
@@ -301,7 +302,7 @@ BOOL LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 wei
//-----------------------------------------------------------------------------
// setVisualParamWeight()
//-----------------------------------------------------------------------------
-BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight, BOOL upload_bake)
+BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight)
{
std::string tname(param_name);
LLStringUtil::toLower(tname);
@@ -309,25 +310,25 @@ BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight, BOOL
visual_param_name_map_t::iterator name_iter = mVisualParamNameMap.find(tableptr);
if (name_iter != mVisualParamNameMap.end())
{
- name_iter->second->setWeight(weight, upload_bake);
+ name_iter->second->setWeight(weight);
return TRUE;
}
- llwarns << "LLCharacter::setVisualParamWeight() Invalid visual parameter: " << param_name << llendl;
+ LL_WARNS() << "LLCharacter::setVisualParamWeight() Invalid visual parameter: " << param_name << LL_ENDL;
return FALSE;
}
//-----------------------------------------------------------------------------
// setVisualParamWeight()
//-----------------------------------------------------------------------------
-BOOL LLCharacter::setVisualParamWeight(S32 index, F32 weight, BOOL upload_bake)
+BOOL LLCharacter::setVisualParamWeight(S32 index, F32 weight)
{
visual_param_index_map_t::iterator index_iter = mVisualParamIndexMap.find(index);
if (index_iter != mVisualParamIndexMap.end())
{
- index_iter->second->setWeight(weight, upload_bake);
+ index_iter->second->setWeight(weight);
return TRUE;
}
- llwarns << "LLCharacter::setVisualParamWeight() Invalid visual parameter index: " << index << llendl;
+ LL_WARNS() << "LLCharacter::setVisualParamWeight() Invalid visual parameter index: " << index << LL_ENDL;
return FALSE;
}
@@ -344,7 +345,7 @@ F32 LLCharacter::getVisualParamWeight(LLVisualParam *which_param)
}
else
{
- llwarns << "LLCharacter::getVisualParamWeight() Invalid visual parameter*, index= " << index << llendl;
+ LL_WARNS() << "LLCharacter::getVisualParamWeight() Invalid visual parameter*, index= " << index << LL_ENDL;
return 0.f;
}
}
@@ -362,7 +363,7 @@ F32 LLCharacter::getVisualParamWeight(const char* param_name)
{
return name_iter->second->getWeight();
}
- llwarns << "LLCharacter::getVisualParamWeight() Invalid visual parameter: " << param_name << llendl;
+ LL_WARNS() << "LLCharacter::getVisualParamWeight() Invalid visual parameter: " << param_name << LL_ENDL;
return 0.f;
}
@@ -378,7 +379,7 @@ F32 LLCharacter::getVisualParamWeight(S32 index)
}
else
{
- llwarns << "LLCharacter::getVisualParamWeight() Invalid visual parameter index: " << index << llendl;
+ LL_WARNS() << "LLCharacter::getVisualParamWeight() Invalid visual parameter index: " << index << LL_ENDL;
return 0.f;
}
}
@@ -394,7 +395,7 @@ void LLCharacter::clearVisualParamWeights()
{
if (param->isTweakable())
{
- param->setWeight( param->getDefaultWeight(), FALSE );
+ param->setWeight( param->getDefaultWeight());
}
}
}
@@ -412,7 +413,7 @@ LLVisualParam* LLCharacter::getVisualParam(const char *param_name)
{
return name_iter->second;
}
- llwarns << "LLCharacter::getVisualParam() Invalid visual parameter: " << param_name << llendl;
+ LL_WARNS() << "LLCharacter::getVisualParam() Invalid visual parameter: " << param_name << LL_ENDL;
return NULL;
}
@@ -437,8 +438,8 @@ void LLCharacter::addSharedVisualParam(LLVisualParam *param)
}
else
{
- llwarns << "Shared visual parameter " << param->getName() << " does not already exist with ID " <<
- param->getID() << llendl;
+ LL_WARNS() << "Shared visual parameter " << param->getName() << " does not already exist with ID " <<
+ param->getID() << LL_ENDL;
}
}
@@ -453,8 +454,8 @@ void LLCharacter::addVisualParam(LLVisualParam *param)
idxres = mVisualParamIndexMap.insert(visual_param_index_map_t::value_type(index, param));
if (!idxres.second)
{
- llwarns << "Visual parameter " << param->getName() << " already exists with same ID as " <<
- param->getName() << llendl;
+ LL_WARNS() << "Visual parameter " << param->getName() << " already exists with same ID as " <<
+ param->getName() << LL_ENDL;
visual_param_index_map_t::iterator index_iter = idxres.first;
index_iter->second = param;
}
@@ -474,7 +475,7 @@ void LLCharacter::addVisualParam(LLVisualParam *param)
name_iter->second = param;
}
}
- //llinfos << "Adding Visual Param '" << param->getName() << "' ( " << index << " )" << llendl;
+ //LL_INFOS() << "Adding Visual Param '" << param->getName() << "' ( " << index << " )" << LL_ENDL;
}
//-----------------------------------------------------------------------------
diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h
index 5740dbce77..d4e3b76386 100755
--- a/indra/llcharacter/llcharacter.h
+++ b/indra/llcharacter/llcharacter.h
@@ -35,9 +35,9 @@
#include "lljoint.h"
#include "llmotioncontroller.h"
#include "llvisualparam.h"
-#include "string_table.h"
+#include "llstringtable.h"
#include "llpointer.h"
-#include "llthread.h"
+#include "llrefcount.h"
class LLPolyMesh;
@@ -190,9 +190,9 @@ public:
void addVisualParam(LLVisualParam *param);
void addSharedVisualParam(LLVisualParam *param);
- virtual BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight, BOOL upload_bake = FALSE );
- virtual BOOL setVisualParamWeight(const char* param_name, F32 weight, BOOL upload_bake = FALSE );
- virtual BOOL setVisualParamWeight(S32 index, F32 weight, BOOL upload_bake = FALSE );
+ virtual BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight);
+ virtual BOOL setVisualParamWeight(const char* param_name, F32 weight);
+ virtual BOOL setVisualParamWeight(S32 index, F32 weight);
// get visual param weight by param or name
F32 getVisualParamWeight(LLVisualParam *distortion);
diff --git a/indra/llcharacter/lleditingmotion.cpp b/indra/llcharacter/lleditingmotion.cpp
index 4e8c3268c5..36341065ae 100755
--- a/indra/llcharacter/lleditingmotion.cpp
+++ b/indra/llcharacter/lleditingmotion.cpp
@@ -89,7 +89,7 @@ LLMotion::LLMotionInitStatus LLEditingMotion::onInitialize(LLCharacter *characte
!mCharacter->getJoint("mElbowLeft") ||
!mCharacter->getJoint("mWristLeft"))
{
- llwarns << "Invalid skeleton for editing motion!" << llendl;
+ LL_WARNS() << "Invalid skeleton for editing motion!" << LL_ENDL;
return STATUS_FAILURE;
}
@@ -102,7 +102,7 @@ LLMotion::LLMotionInitStatus LLEditingMotion::onInitialize(LLCharacter *characte
if ( ! mParentState->getJoint() )
{
- llinfos << getName() << ": Can't get parent joint." << llendl;
+ LL_INFOS() << getName() << ": Can't get parent joint." << LL_ENDL;
return STATUS_FAILURE;
}
@@ -215,14 +215,14 @@ BOOL LLEditingMotion::onUpdate(F32 time, U8* joint_mask)
if (!target.isFinite())
{
// Don't error out here, set a fail-safe target vector
- llwarns << "Non finite target in editing motion with target distance of " << target_dist <<
- " and focus point " << focus_pt << llendl;
+ LL_WARNS() << "Non finite target in editing motion with target distance of " << target_dist <<
+ " and focus point " << focus_pt << LL_ENDL;
target.setVec(1.f, 1.f, 1.f);
}
mTarget.setPosition( target + mParentJoint.getPosition());
-// llinfos << "Point At: " << mTarget.getPosition() << llendl;
+// LL_INFOS() << "Point At: " << mTarget.getPosition() << LL_ENDL;
// update the ikSolver
if (!mTarget.getPosition().isExactlyZero())
@@ -232,7 +232,7 @@ BOOL LLEditingMotion::onUpdate(F32 time, U8* joint_mask)
mIKSolver.solve();
// use blending...
- F32 slerp_amt = LLCriticalDamp::getInterpolant(TARGET_LAG_HALF_LIFE);
+ F32 slerp_amt = LLSmoothInterpolation::getInterpolant(TARGET_LAG_HALF_LIFE);
shoulderRot = slerp(slerp_amt, mShoulderJoint.getRotation(), shoulderRot);
elbowRot = slerp(slerp_amt, mElbowJoint.getRotation(), elbowRot);
diff --git a/indra/llcharacter/llgesture.cpp b/indra/llcharacter/llgesture.cpp
index c23694639e..1549c41e62 100755
--- a/indra/llcharacter/llgesture.cpp
+++ b/indra/llcharacter/llgesture.cpp
@@ -93,14 +93,14 @@ const LLGesture &LLGesture::operator =(const LLGesture &rhs)
BOOL LLGesture::trigger(KEY key, MASK mask)
{
- llwarns << "Parent class trigger called: you probably didn't mean this." << llendl;
+ LL_WARNS() << "Parent class trigger called: you probably didn't mean this." << LL_ENDL;
return FALSE;
}
BOOL LLGesture::trigger(const std::string& trigger_string)
{
- llwarns << "Parent class trigger called: you probably didn't mean this." << llendl;
+ LL_WARNS() << "Parent class trigger called: you probably didn't mean this." << LL_ENDL;
return FALSE;
}
@@ -130,7 +130,7 @@ U8 *LLGesture::deserialize(U8 *buffer, S32 max_size)
if (tmp + sizeof(mKey) + sizeof(mMask) + 16 > buffer + max_size)
{
- llwarns << "Attempt to read past end of buffer, bad data!!!!" << llendl;
+ LL_WARNS() << "Attempt to read past end of buffer, bad data!!!!" << LL_ENDL;
return buffer;
}
@@ -155,7 +155,7 @@ U8 *LLGesture::deserialize(U8 *buffer, S32 max_size)
if (tmp > buffer + max_size)
{
- llwarns << "Read past end of buffer, bad data!!!!" << llendl;
+ LL_WARNS() << "Read past end of buffer, bad data!!!!" << LL_ENDL;
return tmp;
}
@@ -173,27 +173,7 @@ S32 LLGesture::getMaxSerialSize()
LLGestureList::LLGestureList()
: mList(0)
-{
- // add some gestures for debugging
-// LLGesture *gesture = NULL;
-/*
- gesture = new LLGesture(KEY_F2, MASK_NONE, ":-)",
- SND_CHIRP, "dance2", ":-)" );
- mList.put(gesture);
-
- gesture = new LLGesture(KEY_F3, MASK_NONE, "/dance",
- SND_OBJECT_CREATE, "dance3", "(dances)" );
- mList.put(gesture);
-
- gesture = new LLGesture(KEY_F4, MASK_NONE, "/boogie",
- LLUUID::null, "dance4", LLStringUtil::null );
- mList.put(gesture);
-
- gesture = new LLGesture(KEY_F5, MASK_SHIFT, "/tongue",
- LLUUID::null, "Express_Tongue_Out", LLStringUtil::null );
- mList.put(gesture);
- */
-}
+{}
LLGestureList::~LLGestureList()
{
@@ -203,12 +183,7 @@ LLGestureList::~LLGestureList()
void LLGestureList::deleteAll()
{
- S32 count = mList.count();
- for (S32 i = 0; i < count; i++)
- {
- delete mList.get(i);
- }
- mList.reset();
+ delete_and_clear(mList);
}
// Iterates through space delimited tokens in string, triggering any gestures found.
@@ -235,9 +210,9 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin
std::string cur_token_lower = *token_iter;
LLStringUtil::toLower(cur_token_lower);
- for (S32 i = 0; i < mList.count(); i++)
+ for (U32 i = 0; i < mList.size(); i++)
{
- gesture = mList.get(i);
+ gesture = mList.at(i);
if (gesture->trigger(cur_token_lower))
{
if( !gesture->getOutputString().empty() )
@@ -286,9 +261,9 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin
BOOL LLGestureList::trigger(KEY key, MASK mask)
{
- for (S32 i = 0; i < mList.count(); i++)
+ for (U32 i = 0; i < mList.size(); i++)
{
- LLGesture* gesture = mList.get(i);
+ LLGesture* gesture = mList.at(i);
if( gesture )
{
if (gesture->trigger(key, mask))
@@ -298,7 +273,7 @@ BOOL LLGestureList::trigger(KEY key, MASK mask)
}
else
{
- llwarns << "NULL gesture in gesture list (" << i << ")" << llendl;
+ LL_WARNS() << "NULL gesture in gesture list (" << i << ")" << LL_ENDL;
}
}
return FALSE;
@@ -308,7 +283,7 @@ BOOL LLGestureList::trigger(KEY key, MASK mask)
U8 *LLGestureList::serialize(U8 *buffer) const
{
// a single S32 serves as the header that tells us how many to read
- S32 count = mList.count();
+ U32 count = mList.size();
htonmemcpy(buffer, &count, MVT_S32, 4);
buffer += sizeof(count);
@@ -331,7 +306,7 @@ U8 *LLGestureList::deserialize(U8 *buffer, S32 max_size)
if (tmp + sizeof(count) > buffer + max_size)
{
- llwarns << "Invalid max_size" << llendl;
+ LL_WARNS() << "Invalid max_size" << LL_ENDL;
return buffer;
}
@@ -339,20 +314,20 @@ U8 *LLGestureList::deserialize(U8 *buffer, S32 max_size)
if (count > MAX_GESTURES)
{
- llwarns << "Unreasonably large gesture list count in deserialize: " << count << llendl;
+ LL_WARNS() << "Unreasonably large gesture list count in deserialize: " << count << LL_ENDL;
return tmp;
}
tmp += sizeof(count);
- mList.reserve_block(count);
+ mList.resize(count);
for (S32 i = 0; i < count; i++)
{
mList[i] = create_gesture(&tmp, max_size - (S32)(tmp - buffer));
if (tmp - buffer > max_size)
{
- llwarns << "Deserialization read past end of buffer, bad data!!!!" << llendl;
+ LL_WARNS() << "Deserialization read past end of buffer, bad data!!!!" << LL_ENDL;
return tmp;
}
}
diff --git a/indra/llcharacter/llgesture.h b/indra/llcharacter/llgesture.h
index 66b618c473..cfb489f727 100755
--- a/indra/llcharacter/llgesture.h
+++ b/indra/llcharacter/llgesture.h
@@ -31,7 +31,6 @@
#include "llanimationstates.h"
#include "lluuid.h"
#include "llstring.h"
-#include "lldarray.h"
class LLGesture
{
@@ -67,12 +66,12 @@ public:
static S32 getMaxSerialSize();
protected:
- KEY mKey; // usually a function key
- MASK mMask; // usually MASK_NONE, or MASK_SHIFT
+ KEY mKey; // usually a function key
+ MASK mMask; // usually MASK_NONE, or MASK_SHIFT
std::string mTrigger; // string, no whitespace allowed
std::string mTriggerLower; // lowercase version of mTrigger
- LLUUID mSoundItemID; // ItemID of sound to play, LLUUID::null if none
- std::string mAnimation; // canonical name of animation or face animation
+ LLUUID mSoundItemID; // ItemID of sound to play, LLUUID::null if none
+ std::string mAnimation; // canonical name of animation or face animation
std::string mOutputString; // string to say
static const S32 MAX_SERIAL_SIZE;
@@ -91,9 +90,9 @@ public:
BOOL triggerAndReviseString(const std::string &string, std::string* revised_string);
// Used for construction from UI
- S32 count() const { return mList.count(); }
- virtual LLGesture* get(S32 i) const { return mList.get(i); }
- virtual void put(LLGesture* gesture) { mList.put( gesture ); }
+ S32 count() const { return mList.size(); }
+ virtual LLGesture* get(S32 i) const { return mList.at(i); }
+ virtual void put(LLGesture* gesture) { mList.push_back( gesture ); }
void deleteAll();
// non-endian-neutral serialization
@@ -106,7 +105,7 @@ protected:
virtual LLGesture *create_gesture(U8 **buffer, S32 max_size);
protected:
- LLDynamicArray<LLGesture*> mList;
+ std::vector<LLGesture*> mList;
static const S32 SERIAL_HEADER_SIZE;
};
diff --git a/indra/llcharacter/llhandmotion.cpp b/indra/llcharacter/llhandmotion.cpp
index 696dba0d95..b3bf5a9a91 100755
--- a/indra/llcharacter/llhandmotion.cpp
+++ b/indra/llcharacter/llhandmotion.cpp
@@ -192,7 +192,7 @@ BOOL LLHandMotion::onUpdate(F32 time, U8* joint_mask)
}
else
{
- llwarns << "Requested hand pose out of range. Ignoring requested pose." << llendl;
+ LL_WARNS() << "Requested hand pose out of range. Ignoring requested pose." << LL_ENDL;
}
}
@@ -200,7 +200,7 @@ BOOL LLHandMotion::onUpdate(F32 time, U8* joint_mask)
mCharacter->removeAnimationData("Hand Pose Priority");
// if (requestedHandPose)
-// llinfos << "Hand Pose " << *requestedHandPose << llendl;
+// LL_INFOS() << "Hand Pose " << *requestedHandPose << LL_ENDL;
// if we are still blending...
if (mCurrentPose != mNewPose)
diff --git a/indra/llcharacter/llheadrotmotion.cpp b/indra/llcharacter/llheadrotmotion.cpp
index 2b1aa194a9..d045bca22e 100755
--- a/indra/llcharacter/llheadrotmotion.cpp
+++ b/indra/llcharacter/llheadrotmotion.cpp
@@ -104,49 +104,49 @@ LLMotion::LLMotionInitStatus LLHeadRotMotion::onInitialize(LLCharacter *characte
mPelvisJoint = character->getJoint("mPelvis");
if ( ! mPelvisJoint )
{
- llinfos << getName() << ": Can't get pelvis joint." << llendl;
+ LL_INFOS() << getName() << ": Can't get pelvis joint." << LL_ENDL;
return STATUS_FAILURE;
}
mRootJoint = character->getJoint("mRoot");
if ( ! mRootJoint )
{
- llinfos << getName() << ": Can't get root joint." << llendl;
+ LL_INFOS() << getName() << ": Can't get root joint." << LL_ENDL;
return STATUS_FAILURE;
}
mTorsoJoint = character->getJoint("mTorso");
if ( ! mTorsoJoint )
{
- llinfos << getName() << ": Can't get torso joint." << llendl;
+ LL_INFOS() << getName() << ": Can't get torso joint." << LL_ENDL;
return STATUS_FAILURE;
}
mHeadJoint = character->getJoint("mHead");
if ( ! mHeadJoint )
{
- llinfos << getName() << ": Can't get head joint." << llendl;
+ LL_INFOS() << getName() << ": Can't get head joint." << LL_ENDL;
return STATUS_FAILURE;
}
mTorsoState->setJoint( character->getJoint("mTorso") );
if ( ! mTorsoState->getJoint() )
{
- llinfos << getName() << ": Can't get torso joint." << llendl;
+ LL_INFOS() << getName() << ": Can't get torso joint." << LL_ENDL;
return STATUS_FAILURE;
}
mNeckState->setJoint( character->getJoint("mNeck") );
if ( ! mNeckState->getJoint() )
{
- llinfos << getName() << ": Can't get neck joint." << llendl;
+ LL_INFOS() << getName() << ": Can't get neck joint." << LL_ENDL;
return STATUS_FAILURE;
}
mHeadState->setJoint( character->getJoint("mHead") );
if ( ! mHeadState->getJoint() )
{
- llinfos << getName() << ": Can't get head joint." << llendl;
+ LL_INFOS() << getName() << ": Can't get head joint." << LL_ENDL;
return STATUS_FAILURE;
}
@@ -182,8 +182,8 @@ BOOL LLHeadRotMotion::onUpdate(F32 time, U8* joint_mask)
LLQuaternion currentRootRotWorld = mRootJoint->getWorldRotation();
LLQuaternion currentInvRootRotWorld = ~currentRootRotWorld;
- F32 head_slerp_amt = LLCriticalDamp::getInterpolant(HEAD_LOOKAT_LAG_HALF_LIFE);
- F32 torso_slerp_amt = LLCriticalDamp::getInterpolant(TORSO_LOOKAT_LAG_HALF_LIFE);
+ F32 head_slerp_amt = LLSmoothInterpolation::getInterpolant(HEAD_LOOKAT_LAG_HALF_LIFE);
+ F32 torso_slerp_amt = LLSmoothInterpolation::getInterpolant(TORSO_LOOKAT_LAG_HALF_LIFE);
LLVector3* targetPos = (LLVector3*)mCharacter->getAnimationData("LookAtPoint");
@@ -191,7 +191,7 @@ BOOL LLHeadRotMotion::onUpdate(F32 time, U8* joint_mask)
{
LLVector3 headLookAt = *targetPos;
-// llinfos << "Look At: " << headLookAt + mHeadJoint->getWorldPosition() << llendl;
+// LL_INFOS() << "Look At: " << headLookAt + mHeadJoint->getWorldPosition() << LL_ENDL;
F32 lookatDistance = headLookAt.normVec();
@@ -310,21 +310,21 @@ LLMotion::LLMotionInitStatus LLEyeMotion::onInitialize(LLCharacter *character)
mHeadJoint = character->getJoint("mHead");
if ( ! mHeadJoint )
{
- llinfos << getName() << ": Can't get head joint." << llendl;
+ LL_INFOS() << getName() << ": Can't get head joint." << LL_ENDL;
return STATUS_FAILURE;
}
mLeftEyeState->setJoint( character->getJoint("mEyeLeft") );
if ( ! mLeftEyeState->getJoint() )
{
- llinfos << getName() << ": Can't get left eyeball joint." << llendl;
+ LL_INFOS() << getName() << ": Can't get left eyeball joint." << LL_ENDL;
return STATUS_FAILURE;
}
mRightEyeState->setJoint( character->getJoint("mEyeRight") );
if ( ! mRightEyeState->getJoint() )
{
- llinfos << getName() << ": Can't get Right eyeball joint." << llendl;
+ LL_INFOS() << getName() << ": Can't get Right eyeball joint." << LL_ENDL;
return STATUS_FAILURE;
}
diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp
index 09a7c11a22..dbd6d48a95 100755
--- a/indra/llcharacter/lljoint.cpp
+++ b/indra/llcharacter/lljoint.cpp
@@ -48,8 +48,11 @@ void LLJoint::init()
mParent = NULL;
mXform.setScaleChildOffset(TRUE);
mXform.setScale(LLVector3(1.0f, 1.0f, 1.0f));
+ mOldXform.setScaleChildOffset(TRUE);
+ mOldXform.setScale(LLVector3(1.0f, 1.0f, 1.0f));
mDirtyFlags = MATRIX_DIRTY | ROTATION_DIRTY | POSITION_DIRTY;
mUpdateXform = TRUE;
+ mResetAfterRestoreOldXform = false;
}
LLJoint::LLJoint() :
@@ -57,7 +60,6 @@ LLJoint::LLJoint() :
{
init();
touch();
- mResetAfterRestoreOldXform = false;
}
LLJoint::LLJoint(S32 joint_num) :
@@ -65,7 +67,6 @@ LLJoint::LLJoint(S32 joint_num) :
{
init();
touch();
- mResetAfterRestoreOldXform = false;
}
@@ -78,7 +79,6 @@ LLJoint::LLJoint(const std::string &name, LLJoint *parent) :
{
init();
mUpdateXform = FALSE;
- // *TODO: mResetAfterRestoreOldXform is not initialized!!!
setName(name);
if (parent)
@@ -239,11 +239,8 @@ const LLVector3& LLJoint::getPosition()
//--------------------------------------------------------------------
void LLJoint::setPosition( const LLVector3& pos )
{
-// if (mXform.getPosition() != pos)
- {
- mXform.setPosition(pos);
- touch(MATRIX_DIRTY | POSITION_DIRTY);
- }
+ mXform.setPosition(pos);
+ touch(MATRIX_DIRTY | POSITION_DIRTY);
}
@@ -251,38 +248,37 @@ void LLJoint::setPosition( const LLVector3& pos )
// setPosition()
//--------------------------------------------------------------------
void LLJoint::setDefaultFromCurrentXform( void )
-{
+{
mDefaultXform = mXform;
- touch(MATRIX_DIRTY | POSITION_DIRTY);
-
}
//--------------------------------------------------------------------
// storeCurrentXform()
//--------------------------------------------------------------------
void LLJoint::storeCurrentXform( const LLVector3& pos )
-{
+{
mOldXform = mXform;
- mResetAfterRestoreOldXform = true;
+ mResetAfterRestoreOldXform = true;
setPosition( pos );
+ touch(ALL_DIRTY);
}
+
//--------------------------------------------------------------------
-// restoreOldXform()
+// storeScaleForReset()
//--------------------------------------------------------------------
-void LLJoint::restoreOldXform( void )
+void LLJoint::storeScaleForReset( const LLVector3& scale )
{
- mResetAfterRestoreOldXform = false;
- mXform = mOldXform;
+ mOldXform.setScale( scale );
}
//--------------------------------------------------------------------
// restoreOldXform()
//--------------------------------------------------------------------
-void LLJoint::restoreToDefaultXform( void )
+void LLJoint::restoreOldXform( void )
{
mXform = mDefaultXform;
- setPosition( mXform.getPosition() );
+ mResetAfterRestoreOldXform = false;
+ mDirtyFlags = ALL_DIRTY;
}
-
//--------------------------------------------------------------------
// getWorldPosition()
//--------------------------------------------------------------------
@@ -299,8 +295,6 @@ LLVector3 LLJoint::getLastWorldPosition()
{
return mXform.getWorldPosition();
}
-
-
//--------------------------------------------------------------------
// setWorldPosition()
//--------------------------------------------------------------------
@@ -404,7 +398,7 @@ void LLJoint::setWorldRotation( const LLQuaternion& rot )
//--------------------------------------------------------------------
const LLVector3& LLJoint::getScale()
{
- return mXform.getScale();
+ return mXform.getScale();
}
//--------------------------------------------------------------------
@@ -413,7 +407,7 @@ const LLVector3& LLJoint::getScale()
void LLJoint::setScale( const LLVector3& scale )
{
// if (mXform.getScale() != scale)
- {
+ {
mXform.setScale(scale);
touch();
}
@@ -438,7 +432,7 @@ const LLMatrix4 &LLJoint::getWorldMatrix()
//--------------------------------------------------------------------
void LLJoint::setWorldMatrix( const LLMatrix4& mat )
{
-llinfos << "WARNING: LLJoint::setWorldMatrix() not correctly implemented yet" << llendl;
+LL_INFOS() << "WARNING: LLJoint::setWorldMatrix() not correctly implemented yet" << LL_ENDL;
// extract global translation
LLVector3 trans( mat.mMatrix[VW][VX],
mat.mMatrix[VW][VY],
@@ -560,7 +554,7 @@ void LLJoint::clampRotation(LLQuaternion old_rot, LLQuaternion new_rot)
// LLVector3 old_axis = main_axis * old_rot;
// LLVector3 new_axis = main_axis * new_rot;
-// for (S32 i = 0; i < mConstraintSilhouette.count() - 1; i++)
+// for (S32 i = 0; i < mConstraintSilhouette.size() - 1; i++)
// {
// LLVector3 vert1 = mConstraintSilhouette[i];
// LLVector3 vert2 = mConstraintSilhouette[i + 1];
diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h
index 2b1e2005c6..b65d6979d4 100755
--- a/indra/llcharacter/lljoint.h
+++ b/indra/llcharacter/lljoint.h
@@ -31,14 +31,13 @@
// Header Files
//-----------------------------------------------------------------------------
#include <string>
+#include <list>
-#include "linked_lists.h"
#include "v3math.h"
#include "v4math.h"
#include "m4math.h"
#include "llquaternion.h"
#include "xform.h"
-#include "lldarray.h"
const S32 LL_CHARACTER_MAX_JOINTS_PER_MESH = 15;
const U32 LL_CHARACTER_MAX_JOINTS = 32; // must be divisible by 4!
@@ -84,6 +83,7 @@ protected:
LLXformMatrix mDefaultXform;
LLUUID mId;
+
public:
U32 mDirtyFlags;
BOOL mUpdateXform;
@@ -160,7 +160,7 @@ public:
// get/set local scale
const LLVector3& getScale();
void setScale( const LLVector3& scale );
-
+ void storeScaleForReset( const LLVector3& scale );
// get/set world matrix
const LLMatrix4 &getWorldMatrix();
void setWorldMatrix( const LLMatrix4& mat );
@@ -185,7 +185,6 @@ public:
S32 getJointNum() const { return mJointNum; }
void restoreOldXform( void );
- void restoreToDefaultXform( void );
void setDefaultFromCurrentXform( void );
void storeCurrentXform( const LLVector3& pos );
@@ -196,8 +195,8 @@ public:
//If the old transform flag has been set, then the reset logic in avatar needs to be aware(test) of it
const BOOL doesJointNeedToBeReset( void ) const { return mResetAfterRestoreOldXform; }
- //Setter for joint reset flag
- void setJointToBeReset( BOOL val ) { mResetAfterRestoreOldXform = val; }
+ void setJointResetFlag( bool val ) { mResetAfterRestoreOldXform = val; }
+
};
#endif // LL_LLJOINT_H
diff --git a/indra/llcharacter/lljointsolverrp3.cpp b/indra/llcharacter/lljointsolverrp3.cpp
index 1331900791..69a7e3dc6e 100755
--- a/indra/llcharacter/lljointsolverrp3.cpp
+++ b/indra/llcharacter/lljointsolverrp3.cpp
@@ -135,8 +135,6 @@ void LLJointSolverRP3::setTwist( F32 twist )
//-----------------------------------------------------------------------------
void LLJointSolverRP3::solve()
{
-// llinfos << llendl;
-// llinfos << "LLJointSolverRP3::solve()" << llendl;
//-------------------------------------------------------------------------
// setup joints in their base rotations
@@ -152,15 +150,15 @@ void LLJointSolverRP3::solve()
LLVector3 cPos = mJointC->getWorldPosition();
LLVector3 gPos = mJointGoal->getWorldPosition();
-// llinfos << "bPosLocal = " << mJointB->getPosition() << llendl;
-// llinfos << "cPosLocal = " << mJointC->getPosition() << llendl;
-// llinfos << "bRotLocal = " << mJointB->getRotation() << llendl;
-// llinfos << "cRotLocal = " << mJointC->getRotation() << llendl;
-
-// llinfos << "aPos : " << aPos << llendl;
-// llinfos << "bPos : " << bPos << llendl;
-// llinfos << "cPos : " << cPos << llendl;
-// llinfos << "gPos : " << gPos << llendl;
+ LL_DEBUGS("JointSolver") << "LLJointSolverRP3::solve()" << LL_NEWLINE
+ << "bPosLocal = " << mJointB->getPosition() << LL_NEWLINE
+ << "cPosLocal = " << mJointC->getPosition() << LL_NEWLINE
+ << "bRotLocal = " << mJointB->getRotation() << LL_NEWLINE
+ << "cRotLocal = " << mJointC->getRotation() << LL_NEWLINE
+ << "aPos : " << aPos << LL_NEWLINE
+ << "bPos : " << bPos << LL_NEWLINE
+ << "cPos : " << cPos << LL_NEWLINE
+ << "gPos : " << gPos << LL_ENDL;
//-------------------------------------------------------------------------
// get the poleVector in world space
@@ -184,11 +182,6 @@ void LLJointSolverRP3::solve()
LLVector3 acVec = cPos - aPos;
LLVector3 agVec = gPos - aPos;
-// llinfos << "abVec : " << abVec << llendl;
-// llinfos << "bcVec : " << bcVec << llendl;
-// llinfos << "acVec : " << acVec << llendl;
-// llinfos << "agVec : " << agVec << llendl;
-
//-------------------------------------------------------------------------
// compute needed lengths of those vectors
//-------------------------------------------------------------------------
@@ -196,16 +189,19 @@ void LLJointSolverRP3::solve()
F32 bcLen = bcVec.magVec();
F32 agLen = agVec.magVec();
-// llinfos << "abLen : " << abLen << llendl;
-// llinfos << "bcLen : " << bcLen << llendl;
-// llinfos << "agLen : " << agLen << llendl;
-
//-------------------------------------------------------------------------
// compute component vector of (A->B) orthogonal to (A->C)
//-------------------------------------------------------------------------
LLVector3 abacCompOrthoVec = abVec - acVec * ((abVec * acVec)/(acVec * acVec));
-// llinfos << "abacCompOrthoVec : " << abacCompOrthoVec << llendl;
+ LL_DEBUGS("JointSolver") << "abVec : " << abVec << LL_NEWLINE
+ << "bcVec : " << bcVec << LL_NEWLINE
+ << "acVec : " << acVec << LL_NEWLINE
+ << "agVec : " << agVec << LL_NEWLINE
+ << "abLen : " << abLen << LL_NEWLINE
+ << "bcLen : " << bcLen << LL_NEWLINE
+ << "agLen : " << agLen << LL_NEWLINE
+ << "abacCompOrthoVec : " << abacCompOrthoVec << LL_ENDL;
//-------------------------------------------------------------------------
// compute the normal of the original ABC plane (and store for later)
@@ -273,13 +269,17 @@ void LLJointSolverRP3::solve()
LLQuaternion bRot(theta - abbcAng, abbcOrthoVec);
-// llinfos << "abbcAng : " << abbcAng << llendl;
-// llinfos << "abbcOrthoVec : " << abbcOrthoVec << llendl;
-// llinfos << "agLenSq : " << agLenSq << llendl;
-// llinfos << "cosTheta : " << cosTheta << llendl;
-// llinfos << "theta : " << theta << llendl;
-// llinfos << "bRot : " << bRot << llendl;
-// llinfos << "theta abbcAng theta-abbcAng: " << theta*180.0/F_PI << " " << abbcAng*180.0f/F_PI << " " << (theta - abbcAng)*180.0f/F_PI << llendl;
+ LL_DEBUGS("JointSolver") << "abbcAng : " << abbcAng << LL_NEWLINE
+ << "abbcOrthoVec : " << abbcOrthoVec << LL_NEWLINE
+ << "agLenSq : " << agLenSq << LL_NEWLINE
+ << "cosTheta : " << cosTheta << LL_NEWLINE
+ << "theta : " << theta << LL_NEWLINE
+ << "bRot : " << bRot << LL_NEWLINE
+ << "theta abbcAng theta-abbcAng: "
+ << theta*180.0/F_PI << " "
+ << abbcAng*180.0f/F_PI << " "
+ << (theta - abbcAng)*180.0f/F_PI
+ << LL_ENDL;
//-------------------------------------------------------------------------
// compute rotation that rotates new A->C to A->G
@@ -293,9 +293,9 @@ void LLJointSolverRP3::solve()
LLQuaternion cgRot;
cgRot.shortestArc( acVec, agVec );
-// llinfos << "bcVec : " << bcVec << llendl;
-// llinfos << "acVec : " << acVec << llendl;
-// llinfos << "cgRot : " << cgRot << llendl;
+ LL_DEBUGS("JointSolver") << "bcVec : " << bcVec << LL_NEWLINE
+ << "acVec : " << acVec << LL_NEWLINE
+ << "cgRot : " << cgRot << LL_ENDL;
// update A->B and B->C with rotation from C to G
abVec = abVec * cgRot;
@@ -353,18 +353,16 @@ void LLJointSolverRP3::solve()
pRot.shortestArc( abcNorm, apgNorm );
}
-// llinfos << "abcNorm = " << abcNorm << llendl;
-// llinfos << "apgNorm = " << apgNorm << llendl;
-// llinfos << "pRot = " << pRot << llendl;
-
//-------------------------------------------------------------------------
// compute twist rotation
//-------------------------------------------------------------------------
LLQuaternion twistRot( mTwist, agVec );
-// llinfos << "twist : " << mTwist*180.0/F_PI << llendl;
-// llinfos << "agNormVec: " << agNormVec << llendl;
-// llinfos << "twistRot : " << twistRot << llendl;
+ LL_DEBUGS("JointSolver") << "abcNorm = " << abcNorm << LL_NEWLINE
+ << "apgNorm = " << apgNorm << LL_NEWLINE
+ << "pRot = " << pRot << LL_NEWLINE
+ << "twist : " << mTwist*180.0/F_PI << LL_NEWLINE
+ << "twistRot : " << twistRot << LL_ENDL;
//-------------------------------------------------------------------------
// compute rotation of A
diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp
index 2241a59513..22aa4f1d2f 100755
--- a/indra/llcharacter/llkeyframemotion.cpp
+++ b/indra/llcharacter/llkeyframemotion.cpp
@@ -94,30 +94,30 @@ U32 LLKeyframeMotion::JointMotionList::dumpDiagInfo()
{
LLKeyframeMotion::JointMotion* joint_motion_p = mJointMotionArray[i];
- llinfos << "\tJoint " << joint_motion_p->mJointName << llendl;
+ LL_INFOS() << "\tJoint " << joint_motion_p->mJointName << LL_ENDL;
if (joint_motion_p->mUsage & LLJointState::SCALE)
{
- llinfos << "\t" << joint_motion_p->mScaleCurve.mNumKeys << " scale keys at "
- << joint_motion_p->mScaleCurve.mNumKeys * sizeof(ScaleKey) << " bytes" << llendl;
+ LL_INFOS() << "\t" << joint_motion_p->mScaleCurve.mNumKeys << " scale keys at "
+ << joint_motion_p->mScaleCurve.mNumKeys * sizeof(ScaleKey) << " bytes" << LL_ENDL;
total_size += joint_motion_p->mScaleCurve.mNumKeys * sizeof(ScaleKey);
}
if (joint_motion_p->mUsage & LLJointState::ROT)
{
- llinfos << "\t" << joint_motion_p->mRotationCurve.mNumKeys << " rotation keys at "
- << joint_motion_p->mRotationCurve.mNumKeys * sizeof(RotationKey) << " bytes" << llendl;
+ LL_INFOS() << "\t" << joint_motion_p->mRotationCurve.mNumKeys << " rotation keys at "
+ << joint_motion_p->mRotationCurve.mNumKeys * sizeof(RotationKey) << " bytes" << LL_ENDL;
total_size += joint_motion_p->mRotationCurve.mNumKeys * sizeof(RotationKey);
}
if (joint_motion_p->mUsage & LLJointState::POS)
{
- llinfos << "\t" << joint_motion_p->mPositionCurve.mNumKeys << " position keys at "
- << joint_motion_p->mPositionCurve.mNumKeys * sizeof(PositionKey) << " bytes" << llendl;
+ LL_INFOS() << "\t" << joint_motion_p->mPositionCurve.mNumKeys << " position keys at "
+ << joint_motion_p->mPositionCurve.mNumKeys * sizeof(PositionKey) << " bytes" << LL_ENDL;
total_size += joint_motion_p->mPositionCurve.mNumKeys * sizeof(PositionKey);
}
}
- llinfos << "Size: " << total_size << " bytes" << llendl;
+ LL_INFOS() << "Size: " << total_size << " bytes" << LL_ENDL;
return total_size;
}
@@ -560,7 +560,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact
if (!sVFS)
{
- llerrs << "Must call LLKeyframeMotion::setVFS() first before loading a keyframe file!" << llendl;
+ LL_ERRS() << "Must call LLKeyframeMotion::setVFS() first before loading a keyframe file!" << LL_ENDL;
}
BOOL success = FALSE;
@@ -586,18 +586,18 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact
if (!success)
{
- llwarns << "Can't open animation file " << mID << llendl;
+ LL_WARNS() << "Can't open animation file " << mID << LL_ENDL;
mAssetStatus = ASSET_FETCH_FAILED;
return STATUS_FAILURE;
}
- lldebugs << "Loading keyframe data for: " << getName() << ":" << getID() << " (" << anim_file_size << " bytes)" << llendl;
+ LL_DEBUGS() << "Loading keyframe data for: " << getName() << ":" << getID() << " (" << anim_file_size << " bytes)" << LL_ENDL;
LLDataPackerBinaryBuffer dp(anim_data, anim_file_size);
if (!deserialize(dp))
{
- llwarns << "Failed to decode asset for animation " << getName() << ":" << getID() << llendl;
+ LL_WARNS() << "Failed to decode asset for animation " << getName() << ":" << getID() << LL_ENDL;
mAssetStatus = ASSET_FETCH_FAILED;
return STATUS_FAILURE;
}
@@ -984,7 +984,7 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
{
case CONSTRAINT_TARGET_TYPE_GROUND:
target_pos = mCharacter->getPosAgentFromGlobal(constraint->mGroundPos);
-// llinfos << "Target Pos " << constraint->mGroundPos << " on " << mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << llendl;
+// LL_INFOS() << "Target Pos " << constraint->mGroundPos << " on " << mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << LL_ENDL;
break;
case CONSTRAINT_TARGET_TYPE_BODY:
target_pos = mCharacter->getVolumePos(shared_data->mTargetConstraintVolume, shared_data->mTargetConstraintOffset);
@@ -1035,11 +1035,11 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
if (constraint->mSharedData->mChainLength != 0 &&
dist_vec_squared(root_pos, target_pos) * 0.95f > constraint->mTotalLength * constraint->mTotalLength)
{
- constraint->mWeight = lerp(constraint->mWeight, 0.f, LLCriticalDamp::getInterpolant(0.1f));
+ constraint->mWeight = LLSmoothInterpolation::lerp(constraint->mWeight, 0.f, 0.1f);
}
else
{
- constraint->mWeight = lerp(constraint->mWeight, 1.f, LLCriticalDamp::getInterpolant(0.3f));
+ constraint->mWeight = LLSmoothInterpolation::lerp(constraint->mWeight, 1.f, 0.3f);
}
F32 weight = constraint->mWeight * ((shared_data->mEaseOutStopTime == 0.f) ? 1.f :
@@ -1086,9 +1086,9 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
// convert intermediate joint positions to world coordinates
positions[joint_num] = ( constraint->mPositions[joint_num] * mPelvisp->getWorldRotation()) + mPelvisp->getWorldPosition();
F32 time_constant = 1.f / clamp_rescale(constraint->mFixupDistanceRMS, 0.f, 0.5f, 0.2f, 8.f);
-// llinfos << "Interpolant " << LLCriticalDamp::getInterpolant(time_constant, FALSE) << " and fixup distance " << constraint->mFixupDistanceRMS << " on " << mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << llendl;
+// LL_INFOS() << "Interpolant " << LLSmoothInterpolation::getInterpolant(time_constant, FALSE) << " and fixup distance " << constraint->mFixupDistanceRMS << " on " << mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << LL_ENDL;
positions[joint_num] = lerp(positions[joint_num], kinematic_position,
- LLCriticalDamp::getInterpolant(time_constant, FALSE));
+ LLSmoothInterpolation::getInterpolant(time_constant, FALSE));
}
S32 iteration_count;
@@ -1117,8 +1117,8 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
if ((iteration_count >= MIN_ITERATION_COUNT) &&
(num_joints_finished == shared_data->mChainLength - 1))
{
-// llinfos << iteration_count << " iterations on " <<
-// mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << llendl;
+// LL_INFOS() << iteration_count << " iterations on " <<
+// mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << LL_ENDL;
break;
}
}
@@ -1234,13 +1234,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if (!dp.unpackU16(version, "version"))
{
- llwarns << "can't read version number" << llendl;
+ LL_WARNS() << "can't read version number" << LL_ENDL;
return FALSE;
}
if (!dp.unpackU16(sub_version, "sub_version"))
{
- llwarns << "can't read sub version number" << llendl;
+ LL_WARNS() << "can't read sub version number" << LL_ENDL;
return FALSE;
}
@@ -1251,28 +1251,28 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
else if (version != KEYFRAME_MOTION_VERSION || sub_version != KEYFRAME_MOTION_SUBVERSION)
{
#if LL_RELEASE
- llwarns << "Bad animation version " << version << "." << sub_version << llendl;
+ LL_WARNS() << "Bad animation version " << version << "." << sub_version << LL_ENDL;
return FALSE;
#else
- llerrs << "Bad animation version " << version << "." << sub_version << llendl;
+ LL_ERRS() << "Bad animation version " << version << "." << sub_version << LL_ENDL;
#endif
}
if (!dp.unpackS32(temp_priority, "base_priority"))
{
- llwarns << "can't read animation base_priority" << llendl;
+ LL_WARNS() << "can't read animation base_priority" << LL_ENDL;
return FALSE;
}
mJointMotionList->mBasePriority = (LLJoint::JointPriority) temp_priority;
if (mJointMotionList->mBasePriority >= LLJoint::ADDITIVE_PRIORITY)
{
- mJointMotionList->mBasePriority = (LLJoint::JointPriority)((int)LLJoint::ADDITIVE_PRIORITY-1);
+ mJointMotionList->mBasePriority = (LLJoint::JointPriority)((S32)LLJoint::ADDITIVE_PRIORITY-1);
mJointMotionList->mMaxPriority = mJointMotionList->mBasePriority;
}
else if (mJointMotionList->mBasePriority < LLJoint::USE_MOTION_PRIORITY)
{
- llwarns << "bad animation base_priority " << mJointMotionList->mBasePriority << llendl;
+ LL_WARNS() << "bad animation base_priority " << mJointMotionList->mBasePriority << LL_ENDL;
return FALSE;
}
@@ -1281,14 +1281,14 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
//-------------------------------------------------------------------------
if (!dp.unpackF32(mJointMotionList->mDuration, "duration"))
{
- llwarns << "can't read duration" << llendl;
+ LL_WARNS() << "can't read duration" << LL_ENDL;
return FALSE;
}
if (mJointMotionList->mDuration > MAX_ANIM_DURATION ||
!llfinite(mJointMotionList->mDuration))
{
- llwarns << "invalid animation duration" << llendl;
+ LL_WARNS() << "invalid animation duration" << LL_ENDL;
return FALSE;
}
@@ -1297,13 +1297,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
//-------------------------------------------------------------------------
if (!dp.unpackString(mJointMotionList->mEmoteName, "emote_name"))
{
- llwarns << "can't read optional_emote_animation" << llendl;
+ LL_WARNS() << "can't read optional_emote_animation" << LL_ENDL;
return FALSE;
}
if(mJointMotionList->mEmoteName==mID.asString())
{
- llwarns << "Malformed animation mEmoteName==mID" << llendl;
+ LL_WARNS() << "Malformed animation mEmoteName==mID" << LL_ENDL;
return FALSE;
}
@@ -1313,20 +1313,20 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if (!dp.unpackF32(mJointMotionList->mLoopInPoint, "loop_in_point") ||
!llfinite(mJointMotionList->mLoopInPoint))
{
- llwarns << "can't read loop point" << llendl;
+ LL_WARNS() << "can't read loop point" << LL_ENDL;
return FALSE;
}
if (!dp.unpackF32(mJointMotionList->mLoopOutPoint, "loop_out_point") ||
!llfinite(mJointMotionList->mLoopOutPoint))
{
- llwarns << "can't read loop point" << llendl;
+ LL_WARNS() << "can't read loop point" << LL_ENDL;
return FALSE;
}
if (!dp.unpackS32(mJointMotionList->mLoop, "loop"))
{
- llwarns << "can't read loop" << llendl;
+ LL_WARNS() << "can't read loop" << LL_ENDL;
return FALSE;
}
@@ -1336,14 +1336,14 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if (!dp.unpackF32(mJointMotionList->mEaseInDuration, "ease_in_duration") ||
!llfinite(mJointMotionList->mEaseInDuration))
{
- llwarns << "can't read easeIn" << llendl;
+ LL_WARNS() << "can't read easeIn" << LL_ENDL;
return FALSE;
}
if (!dp.unpackF32(mJointMotionList->mEaseOutDuration, "ease_out_duration") ||
!llfinite(mJointMotionList->mEaseOutDuration))
{
- llwarns << "can't read easeOut" << llendl;
+ LL_WARNS() << "can't read easeOut" << LL_ENDL;
return FALSE;
}
@@ -1353,13 +1353,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
U32 word;
if (!dp.unpackU32(word, "hand_pose"))
{
- llwarns << "can't read hand pose" << llendl;
+ LL_WARNS() << "can't read hand pose" << LL_ENDL;
return FALSE;
}
if(word > LLHandMotion::NUM_HAND_POSES)
{
- llwarns << "invalid LLHandMotion::eHandPose index: " << word << llendl;
+ LL_WARNS() << "invalid LLHandMotion::eHandPose index: " << word << LL_ENDL;
return FALSE;
}
@@ -1371,18 +1371,18 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
U32 num_motions = 0;
if (!dp.unpackU32(num_motions, "num_joints"))
{
- llwarns << "can't read number of joints" << llendl;
+ LL_WARNS() << "can't read number of joints" << LL_ENDL;
return FALSE;
}
if (num_motions == 0)
{
- llwarns << "no joints in animation" << llendl;
+ LL_WARNS() << "no joints in animation" << LL_ENDL;
return FALSE;
}
else if (num_motions > LL_CHARACTER_MAX_JOINTS)
{
- llwarns << "too many joints in animation" << llendl;
+ LL_WARNS() << "too many joints in animation" << LL_ENDL;
return FALSE;
}
@@ -1403,13 +1403,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
std::string joint_name;
if (!dp.unpackString(joint_name, "joint_name"))
{
- llwarns << "can't read joint name" << llendl;
+ LL_WARNS() << "can't read joint name" << LL_ENDL;
return FALSE;
}
if (joint_name == "mScreen" || joint_name == "mRoot")
{
- llwarns << "attempted to animate special " << joint_name << " joint" << llendl;
+ LL_WARNS() << "attempted to animate special " << joint_name << " joint" << LL_ENDL;
return FALSE;
}
@@ -1419,11 +1419,11 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
LLJoint *joint = mCharacter->getJoint( joint_name );
if (joint)
{
-// llinfos << " joint: " << joint_name << llendl;
+// LL_INFOS() << " joint: " << joint_name << LL_ENDL;
}
else
{
- llwarns << "joint not found: " << joint_name << llendl;
+ LL_WARNS() << "joint not found: " << joint_name << LL_ENDL;
//return FALSE;
}
@@ -1440,13 +1440,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
S32 joint_priority;
if (!dp.unpackS32(joint_priority, "joint_priority"))
{
- llwarns << "can't read joint priority." << llendl;
+ LL_WARNS() << "can't read joint priority." << LL_ENDL;
return FALSE;
}
if (joint_priority < LLJoint::USE_MOTION_PRIORITY)
{
- llwarns << "joint priority unknown - too low." << llendl;
+ LL_WARNS() << "joint priority unknown - too low." << LL_ENDL;
return FALSE;
}
@@ -1464,7 +1464,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
//---------------------------------------------------------------------
if (!dp.unpackS32(joint_motion->mRotationCurve.mNumKeys, "num_rot_keys") || joint_motion->mRotationCurve.mNumKeys < 0)
{
- llwarns << "can't read number of rotation keys" << llendl;
+ LL_WARNS() << "can't read number of rotation keys" << LL_ENDL;
return FALSE;
}
@@ -1489,7 +1489,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if (!dp.unpackF32(time, "time") ||
!llfinite(time))
{
- llwarns << "can't read rotation key (" << k << ")" << llendl;
+ LL_WARNS() << "can't read rotation key (" << k << ")" << LL_ENDL;
return FALSE;
}
@@ -1498,7 +1498,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
{
if (!dp.unpackU16(time_short, "time"))
{
- llwarns << "can't read rotation key (" << k << ")" << llendl;
+ LL_WARNS() << "can't read rotation key (" << k << ")" << LL_ENDL;
return FALSE;
}
@@ -1506,7 +1506,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if (time < 0 || time > mJointMotionList->mDuration)
{
- llwarns << "invalid frame time" << llendl;
+ LL_WARNS() << "invalid frame time" << LL_ENDL;
return FALSE;
}
}
@@ -1540,13 +1540,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if( !(rot_key.mRotation.isFinite()) )
{
- llwarns << "non-finite angle in rotation key" << llendl;
+ LL_WARNS() << "non-finite angle in rotation key" << LL_ENDL;
success = FALSE;
}
if (!success)
{
- llwarns << "can't read rotation key (" << k << ")" << llendl;
+ LL_WARNS() << "can't read rotation key (" << k << ")" << LL_ENDL;
return FALSE;
}
@@ -1558,7 +1558,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
//---------------------------------------------------------------------
if (!dp.unpackS32(joint_motion->mPositionCurve.mNumKeys, "num_pos_keys") || joint_motion->mPositionCurve.mNumKeys < 0)
{
- llwarns << "can't read number of position keys" << llendl;
+ LL_WARNS() << "can't read number of position keys" << LL_ENDL;
return FALSE;
}
@@ -1583,7 +1583,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if (!dp.unpackF32(pos_key.mTime, "time") ||
!llfinite(pos_key.mTime))
{
- llwarns << "can't read position key (" << k << ")" << llendl;
+ LL_WARNS() << "can't read position key (" << k << ")" << LL_ENDL;
return FALSE;
}
}
@@ -1591,7 +1591,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
{
if (!dp.unpackU16(time_short, "time"))
{
- llwarns << "can't read position key (" << k << ")" << llendl;
+ LL_WARNS() << "can't read position key (" << k << ")" << LL_ENDL;
return FALSE;
}
@@ -1619,13 +1619,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if( !(pos_key.mPosition.isFinite()) )
{
- llwarns << "non-finite position in key" << llendl;
+ LL_WARNS() << "non-finite position in key" << LL_ENDL;
success = FALSE;
}
if (!success)
{
- llwarns << "can't read position key (" << k << ")" << llendl;
+ LL_WARNS() << "can't read position key (" << k << ")" << LL_ENDL;
return FALSE;
}
@@ -1646,13 +1646,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
S32 num_constraints = 0;
if (!dp.unpackS32(num_constraints, "num_constraints"))
{
- llwarns << "can't read number of constraints" << llendl;
+ LL_WARNS() << "can't read number of constraints" << LL_ENDL;
return FALSE;
}
if (num_constraints > MAX_CONSTRAINTS || num_constraints < 0)
{
- llwarns << "Bad number of constraints... ignoring: " << num_constraints << llendl;
+ LL_WARNS() << "Bad number of constraints... ignoring: " << num_constraints << LL_ENDL;
}
else
{
@@ -1668,7 +1668,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if (!dp.unpackU8(byte, "chain_length"))
{
- llwarns << "can't read constraint chain length" << llendl;
+ LL_WARNS() << "can't read constraint chain length" << LL_ENDL;
delete constraintp;
return FALSE;
}
@@ -1676,21 +1676,21 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if((U32)constraintp->mChainLength > mJointMotionList->getNumJointMotions())
{
- llwarns << "invalid constraint chain length" << llendl;
+ LL_WARNS() << "invalid constraint chain length" << LL_ENDL;
delete constraintp;
return FALSE;
}
if (!dp.unpackU8(byte, "constraint_type"))
{
- llwarns << "can't read constraint type" << llendl;
+ LL_WARNS() << "can't read constraint type" << LL_ENDL;
delete constraintp;
return FALSE;
}
if( byte >= NUM_CONSTRAINT_TYPES )
{
- llwarns << "invalid constraint type" << llendl;
+ LL_WARNS() << "invalid constraint type" << LL_ENDL;
delete constraintp;
return FALSE;
}
@@ -1700,7 +1700,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
U8 bin_data[BIN_DATA_LENGTH+1];
if (!dp.unpackBinaryDataFixed(bin_data, BIN_DATA_LENGTH, "source_volume"))
{
- llwarns << "can't read source volume name" << llendl;
+ LL_WARNS() << "can't read source volume name" << LL_ENDL;
delete constraintp;
return FALSE;
}
@@ -1711,21 +1711,21 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if (!dp.unpackVector3(constraintp->mSourceConstraintOffset, "source_offset"))
{
- llwarns << "can't read constraint source offset" << llendl;
+ LL_WARNS() << "can't read constraint source offset" << LL_ENDL;
delete constraintp;
return FALSE;
}
if( !(constraintp->mSourceConstraintOffset.isFinite()) )
{
- llwarns << "non-finite constraint source offset" << llendl;
+ LL_WARNS() << "non-finite constraint source offset" << LL_ENDL;
delete constraintp;
return FALSE;
}
if (!dp.unpackBinaryDataFixed(bin_data, BIN_DATA_LENGTH, "target_volume"))
{
- llwarns << "can't read target volume name" << llendl;
+ LL_WARNS() << "can't read target volume name" << LL_ENDL;
delete constraintp;
return FALSE;
}
@@ -1745,28 +1745,28 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if (!dp.unpackVector3(constraintp->mTargetConstraintOffset, "target_offset"))
{
- llwarns << "can't read constraint target offset" << llendl;
+ LL_WARNS() << "can't read constraint target offset" << LL_ENDL;
delete constraintp;
return FALSE;
}
if( !(constraintp->mTargetConstraintOffset.isFinite()) )
{
- llwarns << "non-finite constraint target offset" << llendl;
+ LL_WARNS() << "non-finite constraint target offset" << LL_ENDL;
delete constraintp;
return FALSE;
}
if (!dp.unpackVector3(constraintp->mTargetConstraintDir, "target_dir"))
{
- llwarns << "can't read constraint target direction" << llendl;
+ LL_WARNS() << "can't read constraint target direction" << LL_ENDL;
delete constraintp;
return FALSE;
}
if( !(constraintp->mTargetConstraintDir.isFinite()) )
{
- llwarns << "non-finite constraint target direction" << llendl;
+ LL_WARNS() << "non-finite constraint target direction" << LL_ENDL;
delete constraintp;
return FALSE;
}
@@ -1779,28 +1779,28 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if (!dp.unpackF32(constraintp->mEaseInStartTime, "ease_in_start") || !llfinite(constraintp->mEaseInStartTime))
{
- llwarns << "can't read constraint ease in start time" << llendl;
+ LL_WARNS() << "can't read constraint ease in start time" << LL_ENDL;
delete constraintp;
return FALSE;
}
if (!dp.unpackF32(constraintp->mEaseInStopTime, "ease_in_stop") || !llfinite(constraintp->mEaseInStopTime))
{
- llwarns << "can't read constraint ease in stop time" << llendl;
+ LL_WARNS() << "can't read constraint ease in stop time" << LL_ENDL;
delete constraintp;
return FALSE;
}
if (!dp.unpackF32(constraintp->mEaseOutStartTime, "ease_out_start") || !llfinite(constraintp->mEaseOutStartTime))
{
- llwarns << "can't read constraint ease out start time" << llendl;
+ LL_WARNS() << "can't read constraint ease out start time" << LL_ENDL;
delete constraintp;
return FALSE;
}
if (!dp.unpackF32(constraintp->mEaseOutStopTime, "ease_out_stop") || !llfinite(constraintp->mEaseOutStopTime))
{
- llwarns << "can't read constraint ease out stop time" << llendl;
+ LL_WARNS() << "can't read constraint ease out stop time" << LL_ENDL;
delete constraintp;
return FALSE;
}
@@ -1820,8 +1820,8 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
LLJoint* parent = joint->getParent();
if (!parent)
{
- llwarns << "Joint with no parent: " << joint->getName()
- << " Emote: " << mJointMotionList->mEmoteName << llendl;
+ LL_WARNS() << "Joint with no parent: " << joint->getName()
+ << " Emote: " << mJointMotionList->mEmoteName << LL_ENDL;
return FALSE;
}
joint = parent;
@@ -1832,7 +1832,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
if ( !constraint_joint )
{
- llwarns << "Invalid joint " << j << llendl;
+ LL_WARNS() << "Invalid joint " << j << LL_ENDL;
return FALSE;
}
@@ -1844,7 +1844,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp)
}
if (constraintp->mJointStateIndices[i] < 0 )
{
- llwarns << "No joint index for constraint " << i << llendl;
+ LL_WARNS() << "No joint index for constraint " << i << LL_ENDL;
delete constraintp;
return FALSE;
}
@@ -2165,7 +2165,7 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs,
U8* buffer = new U8[size];
file.read((U8*)buffer, size); /*Flawfinder: ignore*/
- lldebugs << "Loading keyframe data for: " << motionp->getName() << ":" << motionp->getID() << " (" << size << " bytes)" << llendl;
+ LL_DEBUGS() << "Loading keyframe data for: " << motionp->getName() << ":" << motionp->getID() << " (" << size << " bytes)" << LL_ENDL;
LLDataPackerBinaryBuffer dp(buffer, size);
if (motionp->deserialize(dp))
@@ -2174,7 +2174,7 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs,
}
else
{
- llwarns << "Failed to decode asset for animation " << motionp->getName() << ":" << motionp->getID() << llendl;
+ LL_WARNS() << "Failed to decode asset for animation " << motionp->getName() << ":" << motionp->getID() << LL_ENDL;
motionp->mAssetStatus = ASSET_FETCH_FAILED;
}
@@ -2182,13 +2182,13 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs,
}
else
{
- llwarns << "Failed to load asset for animation " << motionp->getName() << ":" << motionp->getID() << llendl;
+ LL_WARNS() << "Failed to load asset for animation " << motionp->getName() << ":" << motionp->getID() << LL_ENDL;
motionp->mAssetStatus = ASSET_FETCH_FAILED;
}
}
else
{
- llwarns << "No existing motion for asset data. UUID: " << asset_uuid << llendl;
+ LL_WARNS() << "No existing motion for asset data. UUID: " << asset_uuid << LL_ENDL;
}
}
@@ -2202,9 +2202,9 @@ void LLKeyframeDataCache::dumpDiagInfo()
char buf[1024]; /* Flawfinder: ignore */
- llinfos << "-----------------------------------------------------" << llendl;
- llinfos << " Global Motion Table (DEBUG only)" << llendl;
- llinfos << "-----------------------------------------------------" << llendl;
+ LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
+ LL_INFOS() << " Global Motion Table (DEBUG only)" << LL_ENDL;
+ LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
// print each loaded mesh, and it's memory usage
for (keyframe_data_map_t::iterator map_it = sKeyframeDataMap.begin();
@@ -2214,18 +2214,18 @@ void LLKeyframeDataCache::dumpDiagInfo()
LLKeyframeMotion::JointMotionList *motion_list_p = map_it->second;
- llinfos << "Motion: " << map_it->first << llendl;
+ LL_INFOS() << "Motion: " << map_it->first << LL_ENDL;
joint_motion_kb = motion_list_p->dumpDiagInfo();
total_size += joint_motion_kb;
}
- llinfos << "-----------------------------------------------------" << llendl;
- llinfos << "Motions\tTotal Size" << llendl;
+ LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
+ LL_INFOS() << "Motions\tTotal Size" << LL_ENDL;
snprintf(buf, sizeof(buf), "%d\t\t%d bytes", (S32)sKeyframeDataMap.size(), total_size ); /* Flawfinder: ignore */
- llinfos << buf << llendl;
- llinfos << "-----------------------------------------------------" << llendl;
+ LL_INFOS() << buf << LL_ENDL;
+ LL_INFOS() << "-----------------------------------------------------" << LL_ENDL;
}
@@ -2292,8 +2292,7 @@ LLKeyframeMotion::JointConstraint::JointConstraint(JointConstraintSharedData* sh
mTargetVolume = NULL;
mFixupDistanceRMS = 0.f;
- int i;
- for (i=0; i<MAX_CHAIN_LENGTH; ++i)
+ for (S32 i=0; i<MAX_CHAIN_LENGTH; ++i)
{
mJointLengths[i] = 0.f;
mJointLengthFractions[i] = 0.f;
diff --git a/indra/llcharacter/llkeyframemotionparam.cpp b/indra/llcharacter/llkeyframemotionparam.cpp
index 82fe8971f5..6ed18bc445 100755
--- a/indra/llcharacter/llkeyframemotionparam.cpp
+++ b/indra/llcharacter/llkeyframemotionparam.cpp
@@ -168,7 +168,7 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask)
for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2)
{
const ParameterizedMotion& paramMotion = *iter2;
-// llinfos << "Weight for pose " << paramMotion.mMotion->getName() << " is " << paramMotion.mMotion->getPose()->getWeight() << llendl;
+// LL_INFOS() << "Weight for pose " << paramMotion.mMotion->getName() << " is " << paramMotion.mMotion->getPose()->getWeight() << LL_ENDL;
paramMotion.mMotion->getPose()->setWeight(0.f);
}
}
@@ -181,7 +181,7 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask)
F32* paramValue = (F32 *)mCharacter->getAnimationData(paramName);
if (NULL == paramValue) // unexpected, but...
{
- llwarns << "paramValue == NULL" << llendl;
+ LL_WARNS() << "paramValue == NULL" << LL_ENDL;
continue;
}
@@ -256,8 +256,8 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask)
firstPose->setWeight(first_weight * weightFactor);
secondPose->setWeight(second_weight * weightFactor);
-// llinfos << "Parameter " << *paramName << ": " << *paramValue << llendl;
-// llinfos << "Weights " << firstPose->getWeight() << " " << secondPose->getWeight() << llendl;
+// LL_INFOS() << "Parameter " << *paramName << ": " << *paramValue << LL_ENDL;
+// LL_INFOS() << "Weights " << firstPose->getWeight() << " " << secondPose->getWeight() << LL_ENDL;
}
}
else if (firstMotion && !secondMotion)
@@ -269,7 +269,7 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask)
// blend poses
mPoseBlender.blendAndApply();
- llinfos << "Param Motion weight " << mPoseBlender.getBlendedPose()->getWeight() << llendl;
+ LL_INFOS() << "Param Motion weight " << mPoseBlender.getBlendedPose()->getWeight() << LL_ENDL;
return TRUE;
}
@@ -356,7 +356,7 @@ BOOL LLKeyframeMotionParam::loadMotions()
apr_file_t* fp = infile.getFileHandle() ;
if (!fp || fileSize == 0)
{
- llinfos << "ERROR: can't open: " << path << llendl;
+ LL_INFOS() << "ERROR: can't open: " << path << LL_ENDL;
return FALSE;
}
@@ -395,11 +395,11 @@ BOOL LLKeyframeMotionParam::loadMotions()
if ( error )
{
- llinfos << "ERROR: error while reading from " << path << llendl;
+ LL_INFOS() << "ERROR: error while reading from " << path << LL_ENDL;
return FALSE;
}
- llinfos << "Loading parametric keyframe data for: " << getName() << llendl;
+ LL_INFOS() << "Loading parametric keyframe data for: " << getName() << LL_ENDL;
//-------------------------------------------------------------------------
// parse the text and build keyframe data structures
@@ -422,7 +422,7 @@ BOOL LLKeyframeMotionParam::loadMotions()
if (num == 0 || num == EOF) break;
if ((num != 3))
{
- llinfos << "WARNING: can't read parametric motion" << llendl;
+ LL_INFOS() << "WARNING: can't read parametric motion" << LL_ENDL;
return FALSE;
}
diff --git a/indra/llcharacter/llkeyframemotionparam.h b/indra/llcharacter/llkeyframemotionparam.h
index 24e8141753..0fac3724d1 100755
--- a/indra/llcharacter/llkeyframemotionparam.h
+++ b/indra/llcharacter/llkeyframemotionparam.h
@@ -37,7 +37,6 @@
#include "lljointstate.h"
#include "v3math.h"
#include "llquaternion.h"
-#include "linked_lists.h"
#include "llkeyframemotion.h"
//-----------------------------------------------------------------------------
diff --git a/indra/llcharacter/llkeyframestandmotion.cpp b/indra/llcharacter/llkeyframestandmotion.cpp
index 3f91532c8e..fdeddf55e1 100755
--- a/indra/llcharacter/llkeyframestandmotion.cpp
+++ b/indra/llcharacter/llkeyframestandmotion.cpp
@@ -119,7 +119,7 @@ LLMotion::LLMotionInitStatus LLKeyframeStandMotion::onInitialize(LLCharacter *ch
!mKneeRightState ||
!mAnkleRightState )
{
- llinfos << getName() << ": Can't find necessary joint states" << llendl;
+ LL_INFOS() << getName() << ": Can't find necessary joint states" << LL_ENDL;
return STATUS_FAILURE;
}
@@ -329,9 +329,9 @@ BOOL LLKeyframeStandMotion::onUpdate(F32 time, U8* joint_mask)
mKneeRightState->setRotation( mKneeRightJoint.getRotation() );
mAnkleRightState->setRotation( mAnkleRightJoint.getRotation() );
- //llinfos << "Stand drift amount " << (mCharacter->getCharacterPosition() - mLastGoodPosition).magVec() << llendl;
+ //LL_INFOS() << "Stand drift amount " << (mCharacter->getCharacterPosition() - mLastGoodPosition).magVec() << LL_ENDL;
-// llinfos << "DEBUG: " << speed << " : " << mTrackAnkles << llendl;
+// LL_INFOS() << "DEBUG: " << speed << " : " << mTrackAnkles << LL_ENDL;
return TRUE;
}
diff --git a/indra/llcharacter/llkeyframewalkmotion.cpp b/indra/llcharacter/llkeyframewalkmotion.cpp
index 69f064b615..7c1fcacf8a 100755
--- a/indra/llcharacter/llkeyframewalkmotion.cpp
+++ b/indra/llcharacter/llkeyframewalkmotion.cpp
@@ -163,7 +163,7 @@ LLMotion::LLMotionInitStatus LLWalkAdjustMotion::onInitialize(LLCharacter *chara
mPelvisState->setJoint( mPelvisJoint );
if ( !mPelvisJoint )
{
- llwarns << getName() << ": Can't get pelvis joint." << llendl;
+ LL_WARNS() << getName() << ": Can't get pelvis joint." << LL_ENDL;
return STATUS_FAILURE;
}
@@ -258,7 +258,7 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
// but this will cause the animation playback rate calculation below to
// kick in too slowly and sometimes start playing the animation in reverse.
- //mPelvisOffset -= PELVIS_COMPENSATION_WIEGHT * (foot_slip_vector * world_to_avatar_rot);//lerp(LLVector3::zero, -1.f * (foot_slip_vector * world_to_avatar_rot), LLCriticalDamp::getInterpolant(0.1f));
+ //mPelvisOffset -= PELVIS_COMPENSATION_WIEGHT * (foot_slip_vector * world_to_avatar_rot);//lerp(LLVector3::zero, -1.f * (foot_slip_vector * world_to_avatar_rot), LLSmoothInterpolation::getInterpolant(0.1f));
////F32 drift_comp_max = DRIFT_COMP_MAX_TOTAL * (llclamp(speed, 0.f, DRIFT_COMP_MAX_SPEED) / DRIFT_COMP_MAX_SPEED);
//F32 drift_comp_max = DRIFT_COMP_MAX_TOTAL;
@@ -287,7 +287,7 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
F32 desired_speed_multiplier = llclamp(speed / foot_speed, min_speed_multiplier, ANIM_SPEED_MAX);
// blend towards new speed adjustment value
- F32 new_speed_adjust = lerp(mAdjustedSpeed, desired_speed_multiplier, LLCriticalDamp::getInterpolant(SPEED_ADJUST_TIME_CONSTANT));
+ F32 new_speed_adjust = LLSmoothInterpolation::lerp(mAdjustedSpeed, desired_speed_multiplier, SPEED_ADJUST_TIME_CONSTANT);
// limit that rate at which the speed adjustment changes
F32 speedDelta = llclamp(new_speed_adjust - mAdjustedSpeed, -SPEED_ADJUST_MAX_SEC * delta_time, SPEED_ADJUST_MAX_SEC * delta_time);
@@ -305,8 +305,8 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
{ // standing/turning
// damp out speed adjustment to 0
- mAnimSpeed = lerp(mAnimSpeed, 1.f, LLCriticalDamp::getInterpolant(0.2f));
- //mPelvisOffset = lerp(mPelvisOffset, LLVector3::zero, LLCriticalDamp::getInterpolant(0.2f));
+ mAnimSpeed = LLSmoothInterpolation::lerp(mAnimSpeed, 1.f, 0.2f);
+ //mPelvisOffset = lerp(mPelvisOffset, LLVector3::zero, LLSmoothInterpolation::getInterpolant(0.2f));
}
// broadcast walk speed change
@@ -350,7 +350,7 @@ LLMotion::LLMotionInitStatus LLFlyAdjustMotion::onInitialize(LLCharacter *charac
mPelvisState->setJoint( pelvisJoint );
if ( !pelvisJoint )
{
- llwarns << getName() << ": Can't get pelvis joint." << llendl;
+ LL_WARNS() << getName() << ": Can't get pelvis joint." << LL_ENDL;
return STATUS_FAILURE;
}
@@ -383,7 +383,7 @@ BOOL LLFlyAdjustMotion::onUpdate(F32 time, U8* joint_mask)
F32 target_roll = llclamp(ang_vel.mV[VZ], -4.f, 4.f) * roll_factor;
// roll is critically damped interpolation between current roll and angular velocity-derived target roll
- mRoll = lerp(mRoll, target_roll, LLCriticalDamp::getInterpolant(0.1f));
+ mRoll = LLSmoothInterpolation::lerp(mRoll, target_roll, U32Milliseconds(100));
LLQuaternion roll(mRoll, LLVector3(0.f, 0.f, 1.f));
mPelvisState->setRotation(roll);
diff --git a/indra/llcharacter/llmotion.cpp b/indra/llcharacter/llmotion.cpp
index a07f9f4d2e..4803f855de 100755
--- a/indra/llcharacter/llmotion.cpp
+++ b/indra/llcharacter/llmotion.cpp
@@ -54,7 +54,7 @@ LLMotion::LLMotion( const LLUUID &id ) :
mDeactivateCallback(NULL),
mDeactivateCallbackUserData(NULL)
{
- for (int i=0; i<3; ++i)
+ for (S32 i=0; i<3; ++i)
memset(&mJointSignature[i][0], 0, sizeof(U8) * LL_CHARACTER_MAX_JOINTS);
}
@@ -73,7 +73,7 @@ void LLMotion::fadeOut()
{
if (mFadeWeight > 0.01f)
{
- mFadeWeight = lerp(mFadeWeight, 0.f, LLCriticalDamp::getInterpolant(0.15f));
+ mFadeWeight = lerp(mFadeWeight, 0.f, LLSmoothInterpolation::getInterpolant(0.15f));
}
else
{
@@ -88,7 +88,7 @@ void LLMotion::fadeIn()
{
if (mFadeWeight < 0.99f)
{
- mFadeWeight = lerp(mFadeWeight, 1.f, LLCriticalDamp::getInterpolant(0.15f));
+ mFadeWeight = lerp(mFadeWeight, 1.f, LLSmoothInterpolation::getInterpolant(0.15f));
}
else
{
diff --git a/indra/llcharacter/llmotion.h b/indra/llcharacter/llmotion.h
index 6e532aac2f..5e37f094b8 100755
--- a/indra/llcharacter/llmotion.h
+++ b/indra/llcharacter/llmotion.h
@@ -204,10 +204,10 @@ public:
LLMotionBlendType getBlendType() { return NORMAL_BLEND; }
F32 getMinPixelArea() { return 0.f; }
- LLMotionInitStatus onInitialize(LLCharacter*) { llinfos << "LLTestMotion::onInitialize()" << llendl; return STATUS_SUCCESS; }
- BOOL onActivate() { llinfos << "LLTestMotion::onActivate()" << llendl; return TRUE; }
- BOOL onUpdate(F32 time, U8* joint_mask) { llinfos << "LLTestMotion::onUpdate(" << time << ")" << llendl; return TRUE; }
- void onDeactivate() { llinfos << "LLTestMotion::onDeactivate()" << llendl; }
+ LLMotionInitStatus onInitialize(LLCharacter*) { LL_INFOS() << "LLTestMotion::onInitialize()" << LL_ENDL; return STATUS_SUCCESS; }
+ BOOL onActivate() { LL_INFOS() << "LLTestMotion::onActivate()" << LL_ENDL; return TRUE; }
+ BOOL onUpdate(F32 time, U8* joint_mask) { LL_INFOS() << "LLTestMotion::onUpdate(" << time << ")" << LL_ENDL; return TRUE; }
+ void onDeactivate() { LL_INFOS() << "LLTestMotion::onDeactivate()" << LL_ENDL; }
};
diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp
index e9fb91ad73..e02b139608 100755
--- a/indra/llcharacter/llmotioncontroller.cpp
+++ b/indra/llcharacter/llmotioncontroller.cpp
@@ -30,6 +30,7 @@
#include "linden_common.h"
#include "llmotioncontroller.h"
+#include "llfasttimer.h"
#include "llkeyframemotion.h"
#include "llmath.h"
#include "lltimer.h"
@@ -76,7 +77,7 @@ LLMotionRegistry::~LLMotionRegistry()
//-----------------------------------------------------------------------------
BOOL LLMotionRegistry::registerMotion( const LLUUID& id, LLMotionConstructor constructor )
{
- // llinfos << "Registering motion: " << name << llendl;
+ // LL_INFOS() << "Registering motion: " << name << LL_ENDL;
if (!is_in_map(mMotionTable, id))
{
mMotionTable[id] = constructor;
@@ -171,6 +172,13 @@ void LLMotionController::deleteAllMotions()
for_each(mAllMotions.begin(), mAllMotions.end(), DeletePairedPointer());
mAllMotions.clear();
+
+ // stinson 05/12/20014 : Ownership of the LLMotion pointers is transferred from
+ // mAllMotions to mDeprecatedMotions in method
+ // LLMotionController::deprecateMotionInstance(). Thus, we should also clean
+ // up the mDeprecatedMotions list as well.
+ for_each(mDeprecatedMotions.begin(), mDeprecatedMotions.end(), DeletePointer());
+ mDeprecatedMotions.clear();
}
//-----------------------------------------------------------------------------
@@ -231,7 +239,7 @@ void LLMotionController::purgeExcessMotions()
if (mLoadedMotions.size() > 2*MAX_MOTION_INSTANCES)
{
- LL_WARNS_ONCE("Animation") << "> " << 2*MAX_MOTION_INSTANCES << " Loaded Motions" << llendl;
+ LL_WARNS_ONCE("Animation") << "> " << 2*MAX_MOTION_INSTANCES << " Loaded Motions" << LL_ENDL;
}
}
@@ -359,7 +367,7 @@ LLMotion* LLMotionController::createMotion( const LLUUID &id )
switch(stat)
{
case LLMotion::STATUS_FAILURE:
- llinfos << "Motion " << id << " init failed." << llendl;
+ LL_INFOS() << "Motion " << id << " init failed." << LL_ENDL;
sRegistry.markBad(id);
delete motion;
return NULL;
@@ -371,7 +379,7 @@ LLMotion* LLMotionController::createMotion( const LLUUID &id )
mLoadedMotions.insert(motion);
break;
default:
- llerrs << "Invalid initialization status" << llendl;
+ LL_ERRS() << "Invalid initialization status" << LL_ENDL;
break;
}
@@ -417,7 +425,7 @@ BOOL LLMotionController::startMotion(const LLUUID &id, F32 start_offset)
return TRUE;
}
-// llinfos << "Starting motion " << name << llendl;
+// LL_INFOS() << "Starting motion " << name << LL_ENDL;
return activateMotionInstance(motion, mAnimTime - start_offset);
}
@@ -540,7 +548,7 @@ void LLMotionController::updateIdleActiveMotions()
//-----------------------------------------------------------------------------
// updateMotionsByType()
//-----------------------------------------------------------------------------
-static LLFastTimer::DeclareTimer FTM_MOTION_ON_UPDATE("Motion onUpdate");
+static LLTrace::BlockTimerStatHandle FTM_MOTION_ON_UPDATE("Motion onUpdate");
void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_type)
{
@@ -700,7 +708,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
// perform motion update
{
- LLFastTimer t(FTM_MOTION_ON_UPDATE);
+ LL_RECORD_BLOCK_TIME(FTM_MOTION_ON_UPDATE);
update_result = motionp->onUpdate(mAnimTime - motionp->mActivationTimestamp, last_joint_signature);
}
}
@@ -780,7 +788,7 @@ void LLMotionController::updateLoadingMotions()
}
else if (status == LLMotion::STATUS_FAILURE)
{
- llinfos << "Motion " << motionp->getID() << " init failed." << llendl;
+ LL_INFOS() << "Motion " << motionp->getID() << " init failed." << LL_ENDL;
sRegistry.markBad(motionp->getID());
mLoadingMotions.erase(curiter);
motion_set_t::iterator found_it = mDeprecatedMotions.find(motionp);
@@ -882,7 +890,7 @@ void LLMotionController::updateMotions(bool force_update)
}
mHasRunOnce = TRUE;
-// llinfos << "Motion controller time " << motionTimer.getElapsedTimeF32() << llendl;
+// LL_INFOS() << "Motion controller time " << motionTimer.getElapsedTimeF32() << LL_ENDL;
}
//-----------------------------------------------------------------------------
@@ -1038,7 +1046,7 @@ LLMotion* LLMotionController::findMotion(const LLUUID& id) const
//-----------------------------------------------------------------------------
void LLMotionController::dumpMotions()
{
- llinfos << "=====================================" << llendl;
+ LL_INFOS() << "=====================================" << LL_ENDL;
for (motion_map_t::iterator iter = mAllMotions.begin();
iter != mAllMotions.end(); iter++)
{
@@ -1053,7 +1061,7 @@ void LLMotionController::dumpMotions()
state_string += std::string("A");
if (mDeprecatedMotions.find(motion) != mDeprecatedMotions.end())
state_string += std::string("D");
- llinfos << gAnimLibrary.animationName(id) << " " << state_string << llendl;
+ LL_INFOS() << gAnimLibrary.animationName(id) << " " << state_string << LL_ENDL;
}
}
@@ -1112,7 +1120,7 @@ void LLMotionController::pauseAllMotions()
{
if (!mPaused)
{
- //llinfos << "Pausing animations..." << llendl;
+ //LL_INFOS() << "Pausing animations..." << LL_ENDL;
mPaused = TRUE;
}
@@ -1125,7 +1133,7 @@ void LLMotionController::unpauseAllMotions()
{
if (mPaused)
{
- //llinfos << "Unpausing animations..." << llendl;
+ //LL_INFOS() << "Unpausing animations..." << LL_ENDL;
mPaused = FALSE;
}
}
diff --git a/indra/llcharacter/llmotioncontroller.h b/indra/llcharacter/llmotioncontroller.h
index 52eaf557b1..2bd5271c4f 100755
--- a/indra/llcharacter/llmotioncontroller.h
+++ b/indra/llcharacter/llmotioncontroller.h
@@ -34,7 +34,6 @@
#include <map>
#include <deque>
-#include "lluuidhashmap.h"
#include "llmotion.h"
#include "llpose.h"
#include "llframetimer.h"
diff --git a/indra/llcharacter/llmultigesture.cpp b/indra/llcharacter/llmultigesture.cpp
index 411bb094fd..2045739c7f 100755
--- a/indra/llcharacter/llmultigesture.cpp
+++ b/indra/llcharacter/llmultigesture.cpp
@@ -147,9 +147,9 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp)
dp.unpackS32(version, "version");
if (version != GESTURE_VERSION)
{
- llwarns << "Bad LLMultiGesture version " << version
+ LL_WARNS() << "Bad LLMultiGesture version " << version
<< " should be " << GESTURE_VERSION
- << llendl;
+ << LL_ENDL;
return FALSE;
}
@@ -165,7 +165,7 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp)
dp.unpackS32(count, "step_count");
if (count < 0)
{
- llwarns << "Bad LLMultiGesture step count " << count << llendl;
+ LL_WARNS() << "Bad LLMultiGesture step count " << count << LL_ENDL;
return FALSE;
}
@@ -212,7 +212,7 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp)
}
default:
{
- llwarns << "Bad LLMultiGesture step type " << type << llendl;
+ LL_WARNS() << "Bad LLMultiGesture step type " << type << LL_ENDL;
return FALSE;
}
}
@@ -222,10 +222,10 @@ BOOL LLMultiGesture::deserialize(LLDataPacker& dp)
void LLMultiGesture::dump()
{
- llinfos << "key " << S32(mKey) << " mask " << U32(mMask)
+ LL_INFOS() << "key " << S32(mKey) << " mask " << U32(mMask)
<< " trigger " << mTrigger
<< " replace " << mReplaceText
- << llendl;
+ << LL_ENDL;
U32 i;
for (i = 0; i < mSteps.size(); ++i)
{
@@ -313,10 +313,10 @@ std::vector<std::string> LLGestureStepAnimation::getLabel() const
void LLGestureStepAnimation::dump()
{
- llinfos << "step animation " << mAnimName
+ LL_INFOS() << "step animation " << mAnimName
<< " id " << mAnimAssetID
<< " flags " << mFlags
- << llendl;
+ << LL_ENDL;
}
//---------------------------------------------------------------------------
@@ -375,10 +375,10 @@ std::vector<std::string> LLGestureStepSound::getLabel() const
void LLGestureStepSound::dump()
{
- llinfos << "step sound " << mSoundName
+ LL_INFOS() << "step sound " << mSoundName
<< " id " << mSoundAssetID
<< " flags " << mFlags
- << llendl;
+ << LL_ENDL;
}
@@ -431,9 +431,9 @@ std::vector<std::string> LLGestureStepChat::getLabel() const
void LLGestureStepChat::dump()
{
- llinfos << "step chat " << mChatText
+ LL_INFOS() << "step chat " << mChatText
<< " flags " << mFlags
- << llendl;
+ << LL_ENDL;
}
@@ -504,7 +504,7 @@ std::vector<std::string> LLGestureStepWait::getLabel() const
void LLGestureStepWait::dump()
{
- llinfos << "step wait " << mWaitSeconds
+ LL_INFOS() << "step wait " << mWaitSeconds
<< " flags " << mFlags
- << llendl;
+ << LL_ENDL;
}
diff --git a/indra/llcharacter/llpose.h b/indra/llcharacter/llpose.h
index b486852605..c004a0f3b7 100755
--- a/indra/llcharacter/llpose.h
+++ b/indra/llcharacter/llpose.h
@@ -33,7 +33,6 @@
#include "lljointstate.h"
#include "lljoint.h"
-#include "llmap.h"
#include "llpointer.h"
#include <map>
diff --git a/indra/llcharacter/llstatemachine.cpp b/indra/llcharacter/llstatemachine.cpp
index e0454131a5..b917db3117 100755
--- a/indra/llcharacter/llstatemachine.cpp
+++ b/indra/llcharacter/llstatemachine.cpp
@@ -88,7 +88,7 @@ BOOL LLStateDiagram::addTransition(LLFSMState& start_state, LLFSMState& end_stat
Transitions::iterator transition_it = state_transitions->find(&transition);
if (transition_it != state_transitions->end())
{
- llerrs << "LLStateTable::addDirectedTransition() : transition already exists" << llendl;
+ LL_ERRS() << "LLStateTable::addDirectedTransition() : transition already exists" << LL_ENDL;
return FALSE; // transition already exists
}
@@ -210,7 +210,7 @@ BOOL LLStateDiagram::saveDotFile(const std::string& filename)
if (!dot_file)
{
- llwarns << "LLStateDiagram::saveDotFile() : Couldn't open " << filename << " to save state diagram." << llendl;
+ LL_WARNS() << "LLStateDiagram::saveDotFile() : Couldn't open " << filename << " to save state diagram." << LL_ENDL;
return FALSE;
}
apr_file_printf(dot_file, "digraph StateMachine {\n\tsize=\"100,100\";\n\tfontsize=40;\n\tlabel=\"Finite State Machine\";\n\torientation=landscape\n\tratio=.77\n");
@@ -364,7 +364,7 @@ void LLStateMachine::processTransition(LLFSMTransition& transition, void* user_d
if (NULL == mCurrentState)
{
- llwarns << "mCurrentState == NULL; aborting processTransition()" << llendl;
+ LL_WARNS() << "mCurrentState == NULL; aborting processTransition()" << LL_ENDL;
return;
}
@@ -372,7 +372,7 @@ void LLStateMachine::processTransition(LLFSMTransition& transition, void* user_d
if (NULL == new_state)
{
- llwarns << "new_state == NULL; aborting processTransition()" << llendl;
+ LL_WARNS() << "new_state == NULL; aborting processTransition()" << LL_ENDL;
return;
}
@@ -385,9 +385,9 @@ void LLStateMachine::processTransition(LLFSMTransition& transition, void* user_d
mCurrentState = new_state;
mCurrentState->onEntry(user_data);
#if FSM_PRINT_STATE_TRANSITIONS
- llinfos << "Entering state " << mCurrentState->getName() <<
+ LL_INFOS() << "Entering state " << mCurrentState->getName() <<
" on transition " << transition.getName() << " from state " <<
- mLastState->getName() << llendl;
+ mLastState->getName() << LL_ENDL;
#endif
}
}
diff --git a/indra/llcharacter/lltargetingmotion.cpp b/indra/llcharacter/lltargetingmotion.cpp
index fa5f06328e..007834b178 100755
--- a/indra/llcharacter/lltargetingmotion.cpp
+++ b/indra/llcharacter/lltargetingmotion.cpp
@@ -80,7 +80,7 @@ LLMotion::LLMotionInitStatus LLTargetingMotion::onInitialize(LLCharacter *charac
!mTorsoJoint ||
!mRightHandJoint)
{
- llwarns << "Invalid skeleton for targeting motion!" << llendl;
+ LL_WARNS() << "Invalid skeleton for targeting motion!" << LL_ENDL;
return STATUS_FAILURE;
}
@@ -106,7 +106,7 @@ BOOL LLTargetingMotion::onActivate()
//-----------------------------------------------------------------------------
BOOL LLTargetingMotion::onUpdate(F32 time, U8* joint_mask)
{
- F32 slerp_amt = LLCriticalDamp::getInterpolant(TORSO_TARGET_HALF_LIFE);
+ F32 slerp_amt = LLSmoothInterpolation::getInterpolant(TORSO_TARGET_HALF_LIFE);
LLVector3 target;
LLVector3* lookAtPoint = (LLVector3*)mCharacter->getAnimationData("LookAtPoint");
diff --git a/indra/llcharacter/llvisualparam.cpp b/indra/llcharacter/llvisualparam.cpp
index f7cb0f76b7..2235496ac5 100755
--- a/indra/llcharacter/llvisualparam.cpp
+++ b/indra/llcharacter/llvisualparam.cpp
@@ -79,7 +79,7 @@ BOOL LLVisualParamInfo::parseXml(LLXmlTreeNode *node)
mDefaultWeight = llclamp( default_weight, mMinWeight, mMaxWeight );
if( default_weight != mDefaultWeight )
{
- llwarns << "value_default attribute is out of range in node " << mName << " " << default_weight << llendl;
+ LL_WARNS() << "value_default attribute is out of range in node " << mName << " " << default_weight << LL_ENDL;
}
}
@@ -101,7 +101,7 @@ BOOL LLVisualParamInfo::parseXml(LLXmlTreeNode *node)
}
else
{
- llwarns << "Avatar file: <param> has invalid sex attribute: " << sex << llendl;
+ LL_WARNS() << "Avatar file: <param> has invalid sex attribute: " << sex << LL_ENDL;
return FALSE;
}
@@ -109,7 +109,7 @@ BOOL LLVisualParamInfo::parseXml(LLXmlTreeNode *node)
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
if( !node->getFastAttributeString( name_string, mName ) )
{
- llwarns << "Avatar file: <param> is missing name attribute" << llendl;
+ LL_WARNS() << "Avatar file: <param> is missing name attribute" << LL_ENDL;
return FALSE;
}
@@ -159,26 +159,42 @@ void LLVisualParamInfo::toStream(std::ostream &out)
//-----------------------------------------------------------------------------
// LLVisualParam()
//-----------------------------------------------------------------------------
-LLVisualParam::LLVisualParam()
- :
- mCurWeight( 0.f ),
+LLVisualParam::LLVisualParam()
+ : mCurWeight( 0.f ),
mLastWeight( 0.f ),
mNext( NULL ),
mTargetWeight( 0.f ),
mIsAnimating( FALSE ),
+ mIsDummy(FALSE),
mID( -1 ),
mInfo( 0 ),
- mIsDummy(FALSE),
mParamLocation(LOC_UNKNOWN)
{
}
//-----------------------------------------------------------------------------
+// LLVisualParam()
+//-----------------------------------------------------------------------------
+LLVisualParam::LLVisualParam(const LLVisualParam& pOther)
+ : mCurWeight(pOther.mCurWeight),
+ mLastWeight(pOther.mLastWeight),
+ mNext(pOther.mNext),
+ mTargetWeight(pOther.mTargetWeight),
+ mIsAnimating(pOther.mIsAnimating),
+ mIsDummy(pOther.mIsDummy),
+ mID(pOther.mID),
+ mInfo(pOther.mInfo),
+ mParamLocation(pOther.mParamLocation)
+{
+}
+
+//-----------------------------------------------------------------------------
// ~LLVisualParam()
//-----------------------------------------------------------------------------
LLVisualParam::~LLVisualParam()
{
delete mNext;
+ mNext = NULL;
}
/*
@@ -220,7 +236,7 @@ BOOL LLVisualParam::parseData(LLXmlTreeNode *node)
//-----------------------------------------------------------------------------
// setWeight()
//-----------------------------------------------------------------------------
-void LLVisualParam::setWeight(F32 weight, BOOL upload_bake)
+void LLVisualParam::setWeight(F32 weight)
{
if (mIsAnimating)
{
@@ -238,19 +254,19 @@ void LLVisualParam::setWeight(F32 weight, BOOL upload_bake)
if (mNext)
{
- mNext->setWeight(weight, upload_bake);
+ mNext->setWeight(weight);
}
}
//-----------------------------------------------------------------------------
// setAnimationTarget()
//-----------------------------------------------------------------------------
-void LLVisualParam::setAnimationTarget(F32 target_value, BOOL upload_bake)
+void LLVisualParam::setAnimationTarget(F32 target_value)
{
// don't animate dummy parameters
if (mIsDummy)
{
- setWeight(target_value, upload_bake);
+ setWeight(target_value);
mTargetWeight = mCurWeight;
return;
}
@@ -270,7 +286,7 @@ void LLVisualParam::setAnimationTarget(F32 target_value, BOOL upload_bake)
if (mNext)
{
- mNext->setAnimationTarget(target_value, upload_bake);
+ mNext->setAnimationTarget(target_value);
}
}
@@ -285,26 +301,34 @@ void LLVisualParam::setNextParam( LLVisualParam *next )
}
//-----------------------------------------------------------------------------
+// clearNextParam()
+//-----------------------------------------------------------------------------
+void LLVisualParam::clearNextParam()
+{
+ mNext = NULL;
+}
+
+//-----------------------------------------------------------------------------
// animate()
//-----------------------------------------------------------------------------
-void LLVisualParam::animate( F32 delta, BOOL upload_bake )
+void LLVisualParam::animate( F32 delta)
{
if (mIsAnimating)
{
F32 new_weight = ((mTargetWeight - mCurWeight) * delta) + mCurWeight;
- setWeight(new_weight, upload_bake);
+ setWeight(new_weight);
}
}
//-----------------------------------------------------------------------------
// stopAnimating()
//-----------------------------------------------------------------------------
-void LLVisualParam::stopAnimating(BOOL upload_bake)
+void LLVisualParam::stopAnimating()
{
if (mIsAnimating && isTweakable())
{
mIsAnimating = FALSE;
- setWeight(mTargetWeight, upload_bake);
+ setWeight(mTargetWeight);
}
}
@@ -346,7 +370,7 @@ void LLVisualParam::setParamLocation(EParamLocation loc)
}
else
{
- lldebugs << "param location is already " << mParamLocation << ", not slamming to " << loc << llendl;
+ LL_DEBUGS() << "param location is already " << mParamLocation << ", not slamming to " << loc << LL_ENDL;
}
}
diff --git a/indra/llcharacter/llvisualparam.h b/indra/llcharacter/llvisualparam.h
index 60ea7a369a..c6b97d7e8b 100755
--- a/indra/llcharacter/llvisualparam.h
+++ b/indra/llcharacter/llvisualparam.h
@@ -47,6 +47,7 @@ enum EVisualParamGroup
VISUAL_PARAM_GROUP_TWEAKABLE,
VISUAL_PARAM_GROUP_ANIMATABLE,
VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT,
+ VISUAL_PARAM_GROUP_TRANSMIT_NOT_TWEAKABLE, // deprecated params that used to be tweakable.
NUM_VISUAL_PARAM_GROUPS
};
@@ -119,10 +120,10 @@ public:
//virtual BOOL parseData( LLXmlTreeNode *node ) = 0;
virtual void apply( ESex avatar_sex ) = 0;
// Default functions
- virtual void setWeight(F32 weight, BOOL upload_bake);
- virtual void setAnimationTarget( F32 target_value, BOOL upload_bake );
- virtual void animate(F32 delta, BOOL upload_bake);
- virtual void stopAnimating(BOOL upload_bake);
+ virtual void setWeight(F32 weight);
+ virtual void setAnimationTarget( F32 target_value);
+ virtual void animate(F32 delta);
+ virtual void stopAnimating();
virtual BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params);
virtual void resetDrivenParams();
@@ -154,6 +155,7 @@ public:
LLVisualParam* getNextParam() { return mNext; }
void setNextParam( LLVisualParam *next );
+ void clearNextParam();
virtual void setAnimating(BOOL is_animating) { mIsAnimating = is_animating && !mIsDummy; }
BOOL getAnimating() const { return mIsAnimating; }
@@ -164,6 +166,8 @@ public:
EParamLocation getParamLocation() const { return mParamLocation; }
protected:
+ LLVisualParam(const LLVisualParam& pOther);
+
F32 mCurWeight; // current weight
F32 mLastWeight; // last weight
LLVisualParam* mNext; // next param in a shared chain
diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index 8767616a70..763f5a3521 100755
--- a/indra/llcommon/CMakeLists.txt
+++ b/indra/llcommon/CMakeLists.txt
@@ -26,22 +26,20 @@ include_directories(
# ${LLCOMMON_LIBRARIES})
set(llcommon_SOURCE_FILES
- imageids.cpp
indra_constants.cpp
llallocator.cpp
llallocator_heap_profile.cpp
llapp.cpp
llapr.cpp
llassettype.cpp
- llavatarname.cpp
llbase32.cpp
llbase64.cpp
+ llbitpack.cpp
llcommon.cpp
llcommonutils.cpp
llcoros.cpp
llcrc.cpp
llcriticaldamp.cpp
- llcursortypes.cpp
lldate.cpp
lldeadmantimer.cpp
lldependencies.cpp
@@ -59,7 +57,6 @@ set(llcommon_SOURCE_FILES
llfile.cpp
llfindlocale.cpp
llfixedbuffer.cpp
- llfoldertype.cpp
llformat.cpp
llframetimer.cpp
llheartbeat.cpp
@@ -69,15 +66,15 @@ set(llcommon_SOURCE_FILES
llleaplistener.cpp
llliveappconfig.cpp
lllivefile.cpp
- lllog.cpp
llmd5.cpp
llmemory.cpp
llmemorystream.cpp
llmetrics.cpp
llmetricperformancetester.cpp
llmortician.cpp
- lloptioninterface.cpp
+ llmutex.cpp
llptrto.cpp
+ llpredicate.cpp
llprocess.cpp
llprocessor.cpp
llprocinfo.cpp
@@ -90,9 +87,7 @@ set(llcommon_SOURCE_FILES
llsdserialize.cpp
llsdserialize_xml.cpp
llsdutil.cpp
- llsecondlifeurls.cpp
llsingleton.cpp
- llstat.cpp
llstacktrace.cpp
llstreamqueue.cpp
llstreamtools.cpp
@@ -100,14 +95,16 @@ set(llcommon_SOURCE_FILES
llstringtable.cpp
llsys.cpp
llthread.cpp
+ llthreadlocalstorage.cpp
llthreadsafequeue.cpp
lltimer.cpp
+ lltrace.cpp
+ lltraceaccumulators.cpp
+ lltracerecording.cpp
+ lltracethreadrecorder.cpp
lluri.cpp
lluuid.cpp
llworkerthread.cpp
- metaclass.cpp
- metaproperty.cpp
- reflective.cpp
timing.cpp
u64.cpp
)
@@ -115,53 +112,35 @@ set(llcommon_SOURCE_FILES
set(llcommon_HEADER_FILES
CMakeLists.txt
- bitpack.h
ctype_workaround.h
- doublelinkedlist.h
fix_macros.h
- imageids.h
indra_constants.h
linden_common.h
- linked_lists.h
- llaccountingcost.h
llalignedarray.h
llallocator.h
llallocator_heap_profile.h
- llagentconstants.h
- llavatarname.h
llapp.h
llapr.h
llassettype.h
- llassoclist.h
- llavatarconstants.h
llbase32.h
llbase64.h
+ llbitpack.h
llboost.h
- llchat.h
- llclickaction.h
llcommon.h
llcommonutils.h
llcoros.h
llcrc.h
llcriticaldamp.h
- llcursortypes.h
- lldarray.h
- lldarrayptr.h
lldate.h
lldeadmantimer.h
lldefs.h
lldependencies.h
- lldeleteutils.h
lldepthstack.h
lldictionary.h
- lldlinked.h
lldoubledispatch.h
- lldqueueptr.h
llendianswizzle.h
- llenum.h
llerror.h
llerrorcontrol.h
- llerrorlegacy.h
llerrorthread.h
llevent.h
lleventapi.h
@@ -170,33 +149,24 @@ set(llcommon_HEADER_FILES
lleventfilter.h
llevents.h
lleventemitter.h
- llextendedstatus.h
llfasttimer.h
llfile.h
llfindlocale.h
llfixedbuffer.h
- llfoldertype.h
llformat.h
llframetimer.h
llhandle.h
llhash.h
llheartbeat.h
- llhttpstatuscodes.h
- llindexedqueue.h
+ llindexedvector.h
llinitparam.h
llinstancetracker.h
llkeythrottle.h
- lllazy.h
llleap.h
llleaplistener.h
lllistenerwrapper.h
- lllinkedqueue.h
llliveappconfig.h
lllivefile.h
- lllocalidhashmap.h
- lllog.h
- lllslconstants.h
- llmap.h
llmd5.h
llmemory.h
llmemorystream.h
@@ -204,15 +174,13 @@ set(llcommon_HEADER_FILES
llmetricperformancetester.h
llmortician.h
llnametable.h
- lloptioninterface.h
llpointer.h
+ llpredicate.h
llpreprocessor.h
llpriqueuemap.h
llprocess.h
llprocessor.h
llprocinfo.h
- llptrskiplist.h
- llptrskipmap.h
llptrto.h
llqueuedthread.h
llrand.h
@@ -226,16 +194,9 @@ set(llcommon_HEADER_FILES
llsdserialize.h
llsdserialize_xml.h
llsdutil.h
- llsecondlifeurls.h
llsimplehash.h
llsingleton.h
- llskiplist.h
- llskipmap.h
- llsortedvector.h
- llstack.h
llstacktrace.h
- llstat.h
- llstatenums.h
llstl.h
llstreamqueue.h
llstreamtools.h
@@ -245,29 +206,24 @@ set(llcommon_HEADER_FILES
llstaticstringtable.h
llsys.h
llthread.h
+ llthreadlocalstorage.h
llthreadsafequeue.h
lltimer.h
+ lltrace.h
+ lltraceaccumulators.h
+ lltracerecording.h
+ lltracethreadrecorder.h
lltreeiterators.h
- lltypeinfolookup.h
+ llunits.h
+ llunittype.h
lluri.h
lluuid.h
- lluuidhashmap.h
- llversionserver.h
+ llwin32headers.h
+ llwin32headerslean.h
llworkerthread.h
- ll_template_cast.h
- metaclass.h
- metaclasst.h
- metaproperty.h
- metapropertyt.h
- reflective.h
- reflectivet.h
- roles_constants.h
- stdenums.h
stdtypes.h
- string_table.h
stringize.h
timer.h
- timing.h
u64.h
)
@@ -333,19 +289,19 @@ if (LL_TESTS)
LL_ADD_INTEGRATION_TEST(llerror "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(llframetimer "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(llinstancetracker "" "${test_libs}")
- LL_ADD_INTEGRATION_TEST(lllazy "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(llprocessor "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(llprocinfo "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(llrand "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(llsdserialize "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(llsingleton "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(llstring "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(lltrace "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(lltreeiterators "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(lluri "" "${test_libs}")
- LL_ADD_INTEGRATION_TEST(reflection "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(llunits "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(stringize "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(lleventdispatcher "" "${test_libs}")
- LL_ADD_INTEGRATION_TEST(lleventcoro "" "${test_libs};${BOOST_CONTEXT_LIBRARY}")
+ LL_ADD_INTEGRATION_TEST(lleventcoro "" "${test_libs};${BOOST_CONTEXT_LIBRARY};${BOOST_COROUTINE_LIBRARY};${BOOST_SYSTEM_LIBRARY}")
LL_ADD_INTEGRATION_TEST(llprocess "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(llleap "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(llstreamqueue "" "${test_libs}")
diff --git a/indra/llcommon/doublelinkedlist.h b/indra/llcommon/doublelinkedlist.h
deleted file mode 100755
index 0aeaa69df3..0000000000
--- a/indra/llcommon/doublelinkedlist.h
+++ /dev/null
@@ -1,1397 +0,0 @@
-/**
- * @file doublelinkedlist.h
- * @brief Provides a standard doubly linked list for fun and profit.
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_DOUBLELINKEDLIST_H
-#define LL_DOUBLELINKEDLIST_H
-
-#include "llerror.h"
-#include "llrand.h"
-
-// node that actually contains the data
-template <class DATA_TYPE> class LLDoubleLinkedNode
-{
-public:
- DATA_TYPE *mDatap;
- LLDoubleLinkedNode *mNextp;
- LLDoubleLinkedNode *mPrevp;
-
-
-public:
- // assign the mDatap pointer
- LLDoubleLinkedNode(DATA_TYPE *data);
-
- // destructor does not, by default, destroy associated data
- // however, the mDatap must be NULL to ensure that we aren't causing memory leaks
- ~LLDoubleLinkedNode();
-
- // delete associated data and NULL out pointer
- void deleteData();
-
- // remove associated data and NULL out pointer
- void removeData();
-};
-
-
-const U32 LLDOUBLE_LINKED_LIST_STATE_STACK_DEPTH = 4;
-
-template <class DATA_TYPE> class LLDoubleLinkedList
-{
-private:
- LLDoubleLinkedNode<DATA_TYPE> mHead; // head node
- LLDoubleLinkedNode<DATA_TYPE> mTail; // tail node
- LLDoubleLinkedNode<DATA_TYPE> *mQueuep; // The node in the batter's box
- LLDoubleLinkedNode<DATA_TYPE> *mCurrentp; // The node we're talking about
-
- // The state stack allows nested exploration of the LLDoubleLinkedList
- // but should be used with great care
- LLDoubleLinkedNode<DATA_TYPE> *mQueuepStack[LLDOUBLE_LINKED_LIST_STATE_STACK_DEPTH];
- LLDoubleLinkedNode<DATA_TYPE> *mCurrentpStack[LLDOUBLE_LINKED_LIST_STATE_STACK_DEPTH];
- U32 mStateStackDepth;
- U32 mCount;
-
- // mInsertBefore is a pointer to a user-set function that returns
- // TRUE if "first" should be located before "second"
- // NOTE: mInsertBefore() should never return TRUE when ("first" == "second")
- // or never-ending loops can occur
- BOOL (*mInsertBefore)(DATA_TYPE *first, DATA_TYPE *second);
-
-public:
- LLDoubleLinkedList();
-
- // destructor destroys list and nodes, but not data in nodes
- ~LLDoubleLinkedList();
-
- // put data into a node and stick it at the front of the list
- // set mCurrentp to mQueuep
- void addData(DATA_TYPE *data);
-
- // put data into a node and stick it at the end of the list
- // set mCurrentp to mQueuep
- void addDataAtEnd(DATA_TYPE *data);
-
- S32 getLength() const;
- // search the list starting at mHead.mNextp and remove the link with mDatap == data
- // set mCurrentp to mQueuep
- // return TRUE if found, FALSE if not found
- BOOL removeData(const DATA_TYPE *data);
-
- // search the list starting at mHead.mNextp and delete the link with mDatap == data
- // set mCurrentp to mQueuep
- // return TRUE if found, FALSE if not found
- BOOL deleteData(DATA_TYPE *data);
-
- // remove all nodes from the list and delete the associated data
- void deleteAllData();
-
- // remove all nodes from the list but do not delete data
- void removeAllNodes();
-
- BOOL isEmpty();
-
- // check to see if data is in list
- // set mCurrentp and mQueuep to the target of search if found, otherwise set mCurrentp to mQueuep
- // return TRUE if found, FALSE if not found
- BOOL checkData(const DATA_TYPE *data);
-
- // NOTE: This next two funtions are only included here
- // for those too familiar with the LLLinkedList template class.
- // They are depreciated. resetList() is unecessary while
- // getCurrentData() is identical to getNextData() and has
- // a misleading name.
- //
- // The recommended way to loop through a list is as follows:
- //
- // datap = list.getFirstData();
- // while (datap)
- // {
- // /* do stuff */
- // datap = list.getNextData();
- // }
-
- // place mQueuep on mHead node
- void resetList();
-
- // return the data currently pointed to,
- // set mCurrentp to that node and bump mQueuep down the list
- // NOTE: this function is identical to getNextData()
- DATA_TYPE *getCurrentData();
-
-
- // reset the list and return the data currently pointed to,
- // set mCurrentp to that node and bump mQueuep down the list
- DATA_TYPE *getFirstData();
-
-
- // reset the list and return the data at position n, set mCurentp
- // to that node and bump mQueuep down the list
- // Note: n=0 will behave like getFirstData()
- DATA_TYPE *getNthData(U32 n);
-
- // reset the list and return the last data in it,
- // set mCurrentp to that node and bump mQueuep up the list
- DATA_TYPE *getLastData();
-
- // return data in mQueuep,
- // set mCurrentp mQueuep and bump mQueuep down the list
- DATA_TYPE *getNextData();
-
- // return the data in mQueuep,
- // set mCurrentp to mQueuep and bump mQueuep up the list
- DATA_TYPE *getPreviousData();
-
- // remove the Node at mCurrentp
- // set mCurrentp to mQueuep
- void removeCurrentData();
-
- // delete the Node at mCurrentp
- // set mCurrentp to mQueuep
- void deleteCurrentData();
-
- // remove the Node at mCurrentp and insert it into newlist
- // set mCurrentp to mQueuep
- void moveCurrentData(LLDoubleLinkedList<DATA_TYPE> *newlist);
-
- // insert the node in front of mCurrentp
- // set mCurrentp to mQueuep
- void insertNode(LLDoubleLinkedNode<DATA_TYPE> *node);
-
- // insert the data in front of mCurrentp
- // set mCurrentp to mQueuep
- void insertData(DATA_TYPE *data);
-
- // if mCurrentp has a previous node then :
- // * swaps mCurrentp with its previous
- // * set mCurrentp to mQueuep
- // (convenient for forward bubble-sort)
- // otherwise does nothing
- void swapCurrentWithPrevious();
-
- // if mCurrentp has a next node then :
- // * swaps mCurrentp with its next
- // * set mCurrentp to mQueuep
- // (convenient for backwards bubble-sort)
- // otherwise does nothing
- void swapCurrentWithNext();
-
- // move mCurrentp to the front of the list
- // set mCurrentp to mQueuep
- void moveCurrentToFront();
-
- // move mCurrentp to the end of the list
- // set mCurrentp to mQueuep
- void moveCurrentToEnd();
-
- // set mInsertBefore
- void setInsertBefore(BOOL (*insert_before)(DATA_TYPE *first, DATA_TYPE *second));
-
- // add data in front of first node for which mInsertBefore(datap, node->mDatap) returns TRUE
- // set mCurrentp to mQueuep
- BOOL addDataSorted(DATA_TYPE *datap);
-
- // sort the list using bubble-sort
- // Yes, this is a different name than the same function in LLLinkedList.
- // When it comes time for a name consolidation hopefully this one will win.
- BOOL bubbleSort();
-
- // does a single bubble sort pass on the list
- BOOL lazyBubbleSort();
-
- // returns TRUE if state successfully pushed (state stack not full)
- BOOL pushState();
-
- // returns TRUE if state successfully popped (state stack not empty)
- BOOL popState();
-
- // empties the state stack
- void clearStateStack();
-
- // randomly move the the links in the list for debug or (Discordian) purposes
- // sets mCurrentp and mQueuep to top of list
- void scramble();
-
-private:
- // add node to beginning of list
- // set mCurrentp to mQueuep
- void addNode(LLDoubleLinkedNode<DATA_TYPE> *node);
-
- // add node to end of list
- // set mCurrentp to mQueuep
- void addNodeAtEnd(LLDoubleLinkedNode<DATA_TYPE> *node);
-};
-
-//#endif
-
-////////////////////////////////////////////////////////////////////////////////////////////
-
-// doublelinkedlist.cpp
-// LLDoubleLinkedList template class implementation file.
-// Provides a standard doubly linked list for fun and profit.
-//
-// Copyright 2001, Linden Research, Inc.
-
-//#include "llerror.h"
-//#include "doublelinkedlist.h"
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// LLDoubleLinkedNode
-//////////////////////////////////////////////////////////////////////////////////////////
-
-
-// assign the mDatap pointer
-template <class DATA_TYPE>
-LLDoubleLinkedNode<DATA_TYPE>::LLDoubleLinkedNode(DATA_TYPE *data) :
- mDatap(data), mNextp(NULL), mPrevp(NULL)
-{
-}
-
-
-// destructor does not, by default, destroy associated data
-// however, the mDatap must be NULL to ensure that we aren't causing memory leaks
-template <class DATA_TYPE>
-LLDoubleLinkedNode<DATA_TYPE>::~LLDoubleLinkedNode()
-{
- if (mDatap)
- {
- llerror("Attempting to call LLDoubleLinkedNode destructor with a non-null mDatap!", 1);
- }
-}
-
-
-// delete associated data and NULL out pointer
-template <class DATA_TYPE>
-void LLDoubleLinkedNode<DATA_TYPE>::deleteData()
-{
- delete mDatap;
- mDatap = NULL;
-}
-
-
-template <class DATA_TYPE>
-void LLDoubleLinkedNode<DATA_TYPE>::removeData()
-{
- mDatap = NULL;
-}
-
-
-//////////////////////////////////////////////////////////////////////////////////////
-// LLDoubleLinkedList
-//////////////////////////////////////////////////////////////////////////////////////
-
-// <------- up -------
-//
-// mCurrentp
-// mQueuep |
-// | |
-// | |
-// .------. .------. .------. .------.
-// | |---->| |---->| |----->| |-----> NULL
-// NULL <-----| |<----| |<----| |<-----| |
-// _'------' '------' '------' '------:_
-// .------. /| | | |\ .------.
-// NULL <-----|mHead |/ | mQueuep \|mTail |-----> NULL
-// | | mCurrentp | |
-// '------' '------'
-// -------- down --------->
-
-template <class DATA_TYPE>
-LLDoubleLinkedList<DATA_TYPE>::LLDoubleLinkedList()
-: mHead(NULL), mTail(NULL), mQueuep(NULL)
-{
- mCurrentp = mHead.mNextp;
- mQueuep = mHead.mNextp;
- mStateStackDepth = 0;
- mCount = 0;
- mInsertBefore = NULL;
-}
-
-
-// destructor destroys list and nodes, but not data in nodes
-template <class DATA_TYPE>
-LLDoubleLinkedList<DATA_TYPE>::~LLDoubleLinkedList()
-{
- removeAllNodes();
-}
-
-
-// put data into a node and stick it at the front of the list
-// doesn't change mCurrentp nor mQueuep
-template <class DATA_TYPE>
-void LLDoubleLinkedList<DATA_TYPE>::addData(DATA_TYPE *data)
-{
- // don't allow NULL to be passed to addData
- if (!data)
- {
- llerror("NULL pointer passed to LLDoubleLinkedList::addData()", 0);
- }
-
- // make the new node
- LLDoubleLinkedNode<DATA_TYPE> *temp = new LLDoubleLinkedNode<DATA_TYPE> (data);
-
- // add the node to the front of the list
- temp->mPrevp = NULL;
- temp->mNextp = mHead.mNextp;
- mHead.mNextp = temp;
-
- // if there's something in the list, fix its back pointer
- if (temp->mNextp)
- {
- temp->mNextp->mPrevp = temp;
- }
- // otherwise, fix the tail of the list
- else
- {
- mTail.mPrevp = temp;
- }
-
- mCount++;
-}
-
-
-// put data into a node and stick it at the end of the list
-template <class DATA_TYPE>
-void LLDoubleLinkedList<DATA_TYPE>::addDataAtEnd(DATA_TYPE *data)
-{
- // don't allow NULL to be passed to addData
- if (!data)
- {
- llerror("NULL pointer passed to LLDoubleLinkedList::addData()", 0);
- }
-
- // make the new node
- LLDoubleLinkedNode<DATA_TYPE> *nodep = new LLDoubleLinkedNode<DATA_TYPE>(data);
-
- addNodeAtEnd(nodep);
- mCount++;
-}
-
-
-// search the list starting at mHead.mNextp and remove the link with mDatap == data
-// set mCurrentp to mQueuep, or NULL if mQueuep points to node with mDatap == data
-// return TRUE if found, FALSE if not found
-template <class DATA_TYPE>
-BOOL LLDoubleLinkedList<DATA_TYPE>::removeData(const DATA_TYPE *data)
-{
- BOOL b_found = FALSE;
- // don't allow NULL to be passed to addData
- if (!data)
- {
- llerror("NULL pointer passed to LLDoubleLinkedList::removeData()", 0);
- }
-
- mCurrentp = mHead.mNextp;
-
- while (mCurrentp)
- {
- if (mCurrentp->mDatap == data)
- {
- b_found = TRUE;
-
- // if there is a next one, fix it
- if (mCurrentp->mNextp)
- {
- mCurrentp->mNextp->mPrevp = mCurrentp->mPrevp;
- }
- else // we are at end of list
- {
- mTail.mPrevp = mCurrentp->mPrevp;
- }
-
- // if there is a previous one, fix it
- if (mCurrentp->mPrevp)
- {
- mCurrentp->mPrevp->mNextp = mCurrentp->mNextp;
- }
- else // we are at beginning of list
- {
- mHead.mNextp = mCurrentp->mNextp;
- }
-
- // remove the node
- mCurrentp->removeData();
- delete mCurrentp;
- mCount--;
- break;
- }
- mCurrentp = mCurrentp->mNextp;
- }
-
- // reset the list back to where it was
- if (mCurrentp == mQueuep)
- {
- mCurrentp = mQueuep = NULL;
- }
- else
- {
- mCurrentp = mQueuep;
- }
-
- return b_found;
-}
-
-
-// search the list starting at mHead.mNextp and delete the link with mDatap == data
-// set mCurrentp to mQueuep, or NULL if mQueuep points to node with mDatap == data
-// return TRUE if found, FALSE if not found
-template <class DATA_TYPE>
-BOOL LLDoubleLinkedList<DATA_TYPE>::deleteData(DATA_TYPE *data)
-{
- BOOL b_found = FALSE;
- // don't allow NULL to be passed to addData
- if (!data)
- {
- llerror("NULL pointer passed to LLDoubleLinkedList::deleteData()", 0);
- }
-
- mCurrentp = mHead.mNextp;
-
- while (mCurrentp)
- {
- if (mCurrentp->mDatap == data)
- {
- b_found = TRUE;
-
- // if there is a next one, fix it
- if (mCurrentp->mNextp)
- {
- mCurrentp->mNextp->mPrevp = mCurrentp->mPrevp;
- }
- else // we are at end of list
- {
- mTail.mPrevp = mCurrentp->mPrevp;
- }
-
- // if there is a previous one, fix it
- if (mCurrentp->mPrevp)
- {
- mCurrentp->mPrevp->mNextp = mCurrentp->mNextp;
- }
- else // we are at beginning of list
- {
- mHead.mNextp = mCurrentp->mNextp;
- }
-
- // remove the node
- mCurrentp->deleteData();
- delete mCurrentp;
- mCount--;
- break;
- }
- mCurrentp = mCurrentp->mNextp;
- }
-
- // reset the list back to where it was
- if (mCurrentp == mQueuep)
- {
- mCurrentp = mQueuep = NULL;
- }
- else
- {
- mCurrentp = mQueuep;
- }
-
- return b_found;
-}
-
-
-// remove all nodes from the list and delete the associated data
-template <class DATA_TYPE>
-void LLDoubleLinkedList<DATA_TYPE>::deleteAllData()
-{
- mCurrentp = mHead.mNextp;
-
- while (mCurrentp)
- {
- mQueuep = mCurrentp->mNextp;
- mCurrentp->deleteData();
- delete mCurrentp;
- mCurrentp = mQueuep;
- }
-
- // reset mHead and mQueuep
- mHead.mNextp = NULL;
- mTail.mPrevp = NULL;
- mCurrentp = mHead.mNextp;
- mQueuep = mHead.mNextp;
- mStateStackDepth = 0;
- mCount = 0;
-}
-
-
-// remove all nodes from the list but do not delete associated data
-template <class DATA_TYPE>
-void LLDoubleLinkedList<DATA_TYPE>::removeAllNodes()
-{
- mCurrentp = mHead.mNextp;
-
- while (mCurrentp)
- {
- mQueuep = mCurrentp->mNextp;
- mCurrentp->removeData();
- delete mCurrentp;
- mCurrentp = mQueuep;
- }
-
- // reset mHead and mCurrentp
- mHead.mNextp = NULL;
- mTail.mPrevp = NULL;
- mCurrentp = mHead.mNextp;
- mQueuep = mHead.mNextp;
- mStateStackDepth = 0;
- mCount = 0;
-}
-
-template <class DATA_TYPE>
-S32 LLDoubleLinkedList<DATA_TYPE>::getLength() const
-{
-// U32 length = 0;
-// for (LLDoubleLinkedNode<DATA_TYPE>* temp = mHead.mNextp; temp != NULL; temp = temp->mNextp)
-// {
-// length++;
-// }
- return mCount;
-}
-
-// check to see if data is in list
-// set mCurrentp and mQueuep to the target of search if found, otherwise set mCurrentp to mQueuep
-// return TRUE if found, FALSE if not found
-template <class DATA_TYPE>
-BOOL LLDoubleLinkedList<DATA_TYPE>::checkData(const DATA_TYPE *data)
-{
- mCurrentp = mHead.mNextp;
-
- while (mCurrentp)
- {
- if (mCurrentp->mDatap == data)
- {
- mQueuep = mCurrentp;
- return TRUE;
- }
- mCurrentp = mCurrentp->mNextp;
- }
-
- mCurrentp = mQueuep;
- return FALSE;
-}
-
-// NOTE: This next two funtions are only included here
-// for those too familiar with the LLLinkedList template class.
-// They are depreciated. resetList() is unecessary while
-// getCurrentData() is identical to getNextData() and has
-// a misleading name.
-//
-// The recommended way to loop through a list is as follows:
-//
-// datap = list.getFirstData();
-// while (datap)
-// {
-// /* do stuff */
-// datap = list.getNextData();
-// }
-
- // place mCurrentp and mQueuep on first node
- template <class DATA_TYPE>
- void LLDoubleLinkedList<DATA_TYPE>::resetList()
- {
- mCurrentp = mHead.mNextp;
- mQueuep = mHead.mNextp;
- mStateStackDepth = 0;
- }
-
-
- // return the data currently pointed to,
- // set mCurrentp to that node and bump mQueuep down the list
- template <class DATA_TYPE>
- DATA_TYPE* LLDoubleLinkedList<DATA_TYPE>::getCurrentData()
- {
- if (mQueuep)
- {
- mCurrentp = mQueuep;
- mQueuep = mQueuep->mNextp;
- return mCurrentp->mDatap;
- }
- else
- {
- return NULL;
- }
- }
-
-
-// reset the list and return the data currently pointed to,
-// set mCurrentp to that node and bump mQueuep down the list
-template <class DATA_TYPE>
-DATA_TYPE* LLDoubleLinkedList<DATA_TYPE>::getFirstData()
-{
- mQueuep = mHead.mNextp;
- mCurrentp = mQueuep;
- if (mQueuep)
- {
- mQueuep = mQueuep->mNextp;
- return mCurrentp->mDatap;
- }
- else
- {
- return NULL;
- }
-}
-
-
-// reset the list and return the data at position n, set mCurentp
-// to that node and bump mQueuep down the list
-// Note: n=0 will behave like getFirstData()
-template <class DATA_TYPE>
-DATA_TYPE* LLDoubleLinkedList<DATA_TYPE>::getNthData(U32 n)
-{
- mCurrentp = mHead.mNextp;
-
- if (mCurrentp)
- {
- for (U32 i=0; i<n; i++)
- {
- mCurrentp = mCurrentp->mNextp;
- if (!mCurrentp)
- {
- break;
- }
- }
- }
-
- if (mCurrentp)
- {
- // bump mQueuep down the list
- mQueuep = mCurrentp->mNextp;
- return mCurrentp->mDatap;
- }
- else
- {
- mQueuep = NULL;
- return NULL;
- }
-}
-
-
-// reset the list and return the last data in it,
-// set mCurrentp to that node and bump mQueuep up the list
-template <class DATA_TYPE>
-DATA_TYPE* LLDoubleLinkedList<DATA_TYPE>::getLastData()
-{
- mQueuep = mTail.mPrevp;
- mCurrentp = mQueuep;
- if (mQueuep)
- {
- mQueuep = mQueuep->mPrevp;
- return mCurrentp->mDatap;
- }
- else
- {
- return NULL;
- }
-}
-
-
-// return the data in mQueuep,
-// set mCurrentp to mQueuep and bump mQueuep down the list
-template <class DATA_TYPE>
-DATA_TYPE* LLDoubleLinkedList<DATA_TYPE>::getNextData()
-{
- if (mQueuep)
- {
- mCurrentp = mQueuep;
- mQueuep = mQueuep->mNextp;
- return mCurrentp->mDatap;
- }
- else
- {
- return NULL;
- }
-}
-
-
-// return the data in mQueuep,
-// set mCurrentp to mQueuep and bump mQueuep up the list
-template <class DATA_TYPE>
-DATA_TYPE* LLDoubleLinkedList<DATA_TYPE>::getPreviousData()
-{
- if (mQueuep)
- {
- mCurrentp = mQueuep;
- mQueuep = mQueuep->mPrevp;
- return mCurrentp->mDatap;
- }
- else
- {
- return NULL;
- }
-}
-
-
-// remove the Node at mCurrentp
-// set mCurrentp to mQueuep, or NULL if (mCurrentp == mQueuep)
-template <class DATA_TYPE>
-void LLDoubleLinkedList<DATA_TYPE>::removeCurrentData()
-{
- if (mCurrentp)
- {
- // if there is a next one, fix it
- if (mCurrentp->mNextp)
- {
- mCurrentp->mNextp->mPrevp = mCurrentp->mPrevp;
- }
- else // otherwise we are at end of list
- {
- mTail.mPrevp = mCurrentp->mPrevp;
- }
-
- // if there is a previous one, fix it
- if (mCurrentp->mPrevp)
- {
- mCurrentp->mPrevp->mNextp = mCurrentp->mNextp;
- }
- else // otherwise we are at beginning of list
- {
- mHead.mNextp = mCurrentp->mNextp;
- }
-
- // remove the node
- mCurrentp->removeData();
- delete mCurrentp;
- mCount--;
-
- // check for redundant pointing
- if (mCurrentp == mQueuep)
- {
- mCurrentp = mQueuep = NULL;
- }
- else
- {
- mCurrentp = mQueuep;
- }
- }
-}
-
-
-// delete the Node at mCurrentp
-// set mCurrentp to mQueuep, or NULL if (mCurrentp == mQueuep)
-template <class DATA_TYPE>
-void LLDoubleLinkedList<DATA_TYPE>::deleteCurrentData()
-{
- if (mCurrentp)
- {
- // remove the node
- // if there is a next one, fix it
- if (mCurrentp->mNextp)
- {
- mCurrentp->mNextp->mPrevp = mCurrentp->mPrevp;
- }
- else // otherwise we are at end of list
- {
- mTail.mPrevp = mCurrentp->mPrevp;
- }
-
- // if there is a previous one, fix it
- if (mCurrentp->mPrevp)
- {
- mCurrentp->mPrevp->mNextp = mCurrentp->mNextp;
- }
- else // otherwise we are at beginning of list
- {
- mHead.mNextp = mCurrentp->mNextp;
- }
-
- // remove the LLDoubleLinkedNode
- mCurrentp->deleteData();
- delete mCurrentp;
- mCount--;
-
- // check for redundant pointing
- if (mCurrentp == mQueuep)
- {
- mCurrentp = mQueuep = NULL;
- }
- else
- {
- mCurrentp = mQueuep;
- }
- }
-}
-
-
-// remove the Node at mCurrentp and insert it into newlist
-// set mCurrentp to mQueuep, or NULL if (mCurrentp == mQueuep)
-template <class DATA_TYPE>
-void LLDoubleLinkedList<DATA_TYPE>::moveCurrentData(LLDoubleLinkedList<DATA_TYPE> *newlist)
-{
- if (mCurrentp)
- {
- // remove the node
- // if there is a next one, fix it
- if (mCurrentp->mNextp)
- {
- mCurrentp->mNextp->mPrevp = mCurrentp->mPrevp;
- }
- else // otherwise we are at end of list
- {
- mTail.mPrevp = mCurrentp->mPrevp;
- }
-
- // if there is a previous one, fix it
- if (mCurrentp->mPrevp)
- {
- mCurrentp->mPrevp->mNextp = mCurrentp->mNextp;
- }
- else // otherwise we are at beginning of list
- {
- mHead.mNextp = mCurrentp->mNextp;
- }
-
- // move the node to the new list
- newlist->addNode(mCurrentp);
-
- // check for redundant pointing
- if (mCurrentp == mQueuep)
- {
- mCurrentp = mQueuep = NULL;
- }
- else
- {
- mCurrentp = mQueuep;
- }
- }
-}
-
-
-// Inserts the node previous to mCurrentp
-// set mCurrentp to mQueuep
-template <class DATA_TYPE>
-void LLDoubleLinkedList<DATA_TYPE>::insertNode(LLDoubleLinkedNode<DATA_TYPE> *nodep)
-{
- // don't allow pointer to NULL to be passed
- if (!nodep)
- {
- llerror("NULL pointer passed to LLDoubleLinkedList::insertNode()", 0);
- }
- if (!nodep->mDatap)
- {
- llerror("NULL data pointer passed to LLDoubleLinkedList::insertNode()", 0);
- }
-
- if (mCurrentp)
- {
- if (mCurrentp->mPrevp)
- {
- nodep->mPrevp = mCurrentp->mPrevp;
- nodep->mNextp = mCurrentp;
- mCurrentp->mPrevp->mNextp = nodep;
- mCurrentp->mPrevp = nodep;
- }
- else // at beginning of list
- {
- nodep->mPrevp = NULL;
- nodep->mNextp = mCurrentp;
- mHead.mNextp = nodep;
- mCurrentp->mPrevp = nodep;
- }
- mCurrentp = mQueuep;
- }
- else // add to front of list
- {
- addNode(nodep);
- }
-}
-
-
-// insert the data in front of mCurrentp
-// set mCurrentp to mQueuep
-template <class DATA_TYPE>
-void LLDoubleLinkedList<DATA_TYPE>::insertData(DATA_TYPE *data)
-{
- if (!data)
- {
- llerror("NULL data pointer passed to LLDoubleLinkedList::insertNode()", 0);
- }
- LLDoubleLinkedNode<DATA_TYPE> *node = new LLDoubleLinkedNode<DATA_TYPE>(data);
- insertNode(node);
- mCount++;
-}
-
-
-// if mCurrentp has a previous node then :
-// * swaps mCurrentp with its previous
-// * set mCurrentp to mQueuep
-// otherwise does nothing
-template <class DATA_TYPE>
-void LLDoubleLinkedList<DATA_TYPE>::swapCurrentWithPrevious()
-{
- if (mCurrentp)
- {
- if (mCurrentp->mPrevp)
- {
- // Pull mCurrentp out of list
- mCurrentp->mPrevp->mNextp = mCurrentp->mNextp;
- if (mCurrentp->mNextp)
- {
- mCurrentp->mNextp->mPrevp = mCurrentp->mPrevp;
- }
- else // mCurrentp was at end of list
- {
- mTail.mPrevp = mCurrentp->mPrevp;
- }
-
- // Fix mCurrentp's pointers
- mCurrentp->mNextp = mCurrentp->mPrevp;
- mCurrentp->mPrevp = mCurrentp->mNextp->mPrevp;
- mCurrentp->mNextp->mPrevp = mCurrentp;
-
- if (mCurrentp->mPrevp)
- {
- // Fix the backward pointer of mCurrentp's new previous
- mCurrentp->mPrevp->mNextp = mCurrentp;
- }
- else // mCurrentp is now at beginning of list
- {
- mHead.mNextp = mCurrentp;
- }
-
- // Set the list back to the way it was
- mCurrentp = mQueuep;
- }
- }
-}
-
-
-// if mCurrentp has a next node then :
-// * swaps mCurrentp with its next
-// * set mCurrentp to mQueuep
-// otherwise does nothing
-template <class DATA_TYPE>
-void LLDoubleLinkedList<DATA_TYPE>::swapCurrentWithNext()
-{
- if (mCurrentp)
- {
- if (mCurrentp->mNextp)
- {
- // Pull mCurrentp out of list
- mCurrentp->mNextp->mPrevp = mCurrentp->mPrevp;
- if (mCurrentp->mPrevp)
- {
- mCurrentp->mPrevp->mNextp = mCurrentp->mNextp;
- }
- else // mCurrentp was at beginning of list
- {
- mHead.mNextp = mCurrentp->mNextp;
- }
-
- // Fix mCurrentp's pointers
- mCurrentp->mPrevp = mCurrentp->mNextp;
- mCurrentp->mNextp = mCurrentp->mPrevp->mNextp;
- mCurrentp->mPrevp->mNextp = mCurrentp;
-
- if (mCurrentp->mNextp)
- {
- // Fix the back pointer of mCurrentp's new next
- mCurrentp->mNextp->mPrevp = mCurrentp;
- }
- else // mCurrentp is now at end of list
- {
- mTail.mPrevp = mCurrentp;
- }
-
- // Set the list back to the way it was
- mCurrentp = mQueuep;
- }
- }
-}
-
-// move mCurrentp to the front of the list
-// set mCurrentp to mQueuep
-template <class DATA_TYPE>
-void LLDoubleLinkedList<DATA_TYPE>::moveCurrentToFront()
-{
- if (mCurrentp)
- {
- // if there is a previous one, fix it
- if (mCurrentp->mPrevp)
- {
- mCurrentp->mPrevp->mNextp = mCurrentp->mNextp;
- }
- else // otherwise we are at beginning of list
- {
- // check for redundant pointing
- if (mCurrentp == mQueuep)
- {
- mCurrentp = mQueuep = NULL;
- }
- else
- {
- mCurrentp = mQueuep;
- }
- return;
- }
-
- // if there is a next one, fix it
- if (mCurrentp->mNextp)
- {
- mCurrentp->mNextp->mPrevp = mCurrentp->mPrevp;
- }
- else // otherwise we are at end of list
- {
- mTail.mPrevp = mCurrentp->mPrevp;
- }
-
- // add mCurrentp to beginning of list
- mCurrentp->mNextp = mHead.mNextp;
- mHead.mNextp->mPrevp = mCurrentp; // mHead.mNextp MUST be valid,
- // or the list had only one node
- // and we would have returned already
- mCurrentp->mPrevp = NULL;
- mHead.mNextp = mCurrentp;
-
- // check for redundant pointing
- if (mCurrentp == mQueuep)
- {
- mCurrentp = mQueuep = NULL;
- }
- else
- {
- mCurrentp = mQueuep;
- }
- }
-
-}
-
-// move mCurrentp to the end of the list
-// set mCurrentp to mQueuep
-template <class DATA_TYPE>
-void LLDoubleLinkedList<DATA_TYPE>::moveCurrentToEnd()
-{
- if (mCurrentp)
- {
- // if there is a next one, fix it
- if (mCurrentp->mNextp)
- {
- mCurrentp->mNextp->mPrevp = mCurrentp->mPrevp;
- }
- else // otherwise we are at end of list and we're done
- {
- // check for redundant pointing
- if (mCurrentp == mQueuep)
- {
- mCurrentp = mQueuep = NULL;
- }
- else
- {
- mCurrentp = mQueuep;
- }
- return;
- }
-
- // if there is a previous one, fix it
- if (mCurrentp->mPrevp)
- {
- mCurrentp->mPrevp->mNextp = mCurrentp->mNextp;
- }
- else // otherwise we are at beginning of list
- {
- mHead.mNextp = mCurrentp->mNextp;
- }
-
- // add mCurrentp to end of list
- mCurrentp->mPrevp = mTail.mPrevp;
- mTail.mPrevp->mNextp = mCurrentp; // mTail.mPrevp MUST be valid,
- // or the list had only one node
- // and we would have returned already
- mCurrentp->mNextp = NULL;
- mTail.mPrevp = mCurrentp;
-
- // check for redundant pointing
- if (mCurrentp == mQueuep)
- {
- mCurrentp = mQueuep = NULL;
- }
- else
- {
- mCurrentp = mQueuep;
- }
- }
-}
-
-
-template <class DATA_TYPE>
-void LLDoubleLinkedList<DATA_TYPE>::setInsertBefore(BOOL (*insert_before)(DATA_TYPE *first, DATA_TYPE *second) )
-{
- mInsertBefore = insert_before;
-}
-
-
-// add data in front of the first node for which mInsertBefore(datap, node->mDatap) returns TRUE
-// set mCurrentp to mQueuep
-template <class DATA_TYPE>
-BOOL LLDoubleLinkedList<DATA_TYPE>::addDataSorted(DATA_TYPE *datap)
-{
- // don't allow NULL to be passed to addData()
- if (!datap)
- {
- llerror("NULL pointer passed to LLDoubleLinkedList::addDataSorted()", 0);
- }
-
- // has mInsertBefore not been set?
- if (!mInsertBefore)
- {
- addData(datap);
- return FALSE;
- }
-
- // is the list empty?
- if (!mHead.mNextp)
- {
- addData(datap);
- return TRUE;
- }
-
- // Note: this step has been added so that the behavior of LLDoubleLinkedList
- // is as rigorous as the LLLinkedList class about adding duplicate nodes.
- // Duplicate nodes can cause a problem when sorting if mInsertBefore(foo, foo)
- // returns TRUE. However, if mInsertBefore(foo, foo) returns FALSE, then there
- // shouldn't be any reason to exclude duplicate nodes (as we do here).
- if (checkData(datap))
- {
- return FALSE;
- }
-
- mCurrentp = mHead.mNextp;
- while (mCurrentp)
- {
- // check to see if datap is already in the list
- if (datap == mCurrentp->mDatap)
- {
- return FALSE;
- }
- else if (mInsertBefore(datap, mCurrentp->mDatap))
- {
- insertData(datap);
- return TRUE;
- }
- mCurrentp = mCurrentp->mNextp;
- }
-
- addDataAtEnd(datap);
- return TRUE;
-}
-
-
-// bubble-sort until sorted and return TRUE if anything was sorted
-// leaves mQueuep pointing at last node that was swapped with its mNextp
-//
-// NOTE: if you find this function looping for really long times, then you
-// probably need to check your implementation of mInsertBefore(a,b) and make
-// sure it does not return TRUE when (a == b)!
-template <class DATA_TYPE>
-BOOL LLDoubleLinkedList<DATA_TYPE>::bubbleSort()
-{
- BOOL b_swapped = FALSE;
- U32 count = 0;
- while (lazyBubbleSort())
- {
- b_swapped = TRUE;
- if (count++ > 0x7FFFFFFF)
- {
- llwarning("LLDoubleLinkedList::bubbleSort() : too many passes...", 1);
- llwarning(" make sure the mInsertBefore(a, b) does not return TRUE for a == b", 1);
- break;
- }
- }
- return b_swapped;
-}
-
-
-// do a single bubble-sort pass and return TRUE if anything was sorted
-// leaves mQueuep pointing at last node that was swapped with its mNextp
-template <class DATA_TYPE>
-BOOL LLDoubleLinkedList<DATA_TYPE>::lazyBubbleSort()
-{
- // has mInsertBefore been set?
- if (!mInsertBefore)
- {
- return FALSE;
- }
-
- // is list empty?
- mCurrentp = mHead.mNextp;
- if (!mCurrentp)
- {
- return FALSE;
- }
-
- BOOL b_swapped = FALSE;
-
- // the sort will exit after 0x7FFFFFFF nodes or the end of the list, whichever is first
- S32 length = 0x7FFFFFFF;
- S32 count = 0;
-
- while (mCurrentp && mCurrentp->mNextp && count<length)
- {
- if (mInsertBefore(mCurrentp->mNextp->mDatap, mCurrentp->mDatap))
- {
- b_swapped = TRUE;
- mQueuep = mCurrentp;
- swapCurrentWithNext(); // sets mCurrentp to mQueuep
- }
- count++;
- mCurrentp = mCurrentp->mNextp;
- }
-
- return b_swapped;
-}
-
-
-template <class DATA_TYPE>
-BOOL LLDoubleLinkedList<DATA_TYPE>::pushState()
-{
- if (mStateStackDepth < LLDOUBLE_LINKED_LIST_STATE_STACK_DEPTH)
- {
- *(mQueuepStack + mStateStackDepth) = mQueuep;
- *(mCurrentpStack + mStateStackDepth) = mCurrentp;
- mStateStackDepth++;
- return TRUE;
- }
- return FALSE;
-}
-
-
-template <class DATA_TYPE>
-BOOL LLDoubleLinkedList<DATA_TYPE>::popState()
-{
- if (mStateStackDepth > 0)
- {
- mStateStackDepth--;
- mQueuep = *(mQueuepStack + mStateStackDepth);
- mCurrentp = *(mCurrentpStack + mStateStackDepth);
- return TRUE;
- }
- return FALSE;
-}
-
-
-template <class DATA_TYPE>
-void LLDoubleLinkedList<DATA_TYPE>::clearStateStack()
-{
- mStateStackDepth = 0;
-}
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// private members
-//////////////////////////////////////////////////////////////////////////////////////////
-
-// add node to beginning of list
-// set mCurrentp to mQueuep
-template <class DATA_TYPE>
-void LLDoubleLinkedList<DATA_TYPE>::addNode(LLDoubleLinkedNode<DATA_TYPE> *nodep)
-{
- // add the node to the front of the list
- nodep->mPrevp = NULL;
- nodep->mNextp = mHead.mNextp;
- mHead.mNextp = nodep;
-
- // if there's something in the list, fix its back pointer
- if (nodep->mNextp)
- {
- nodep->mNextp->mPrevp = nodep;
- }
- else // otherwise fix the tail node
- {
- mTail.mPrevp = nodep;
- }
-
- mCurrentp = mQueuep;
-}
-
-
-// add node to end of list
-// set mCurrentp to mQueuep
-template <class DATA_TYPE>
-void LLDoubleLinkedList<DATA_TYPE>::addNodeAtEnd(LLDoubleLinkedNode<DATA_TYPE> *node)
-{
- // add the node to the end of the list
- node->mNextp = NULL;
- node->mPrevp = mTail.mPrevp;
- mTail.mPrevp = node;
-
- // if there's something in the list, fix its back pointer
- if (node->mPrevp)
- {
- node->mPrevp->mNextp = node;
- }
- else // otherwise fix the head node
- {
- mHead.mNextp = node;
- }
-
- mCurrentp = mQueuep;
-}
-
-
-// randomly move nodes in the list for DEBUG (or Discordian) purposes
-// sets mCurrentp and mQueuep to top of list
-template <class DATA_TYPE>
-void LLDoubleLinkedList<DATA_TYPE>::scramble()
-{
- S32 random_number;
- DATA_TYPE *datap = getFirstData();
- while(datap)
- {
- random_number = ll_rand(5);
-
- if (0 == random_number)
- {
- removeCurrentData();
- addData(datap);
- }
- else if (1 == random_number)
- {
- removeCurrentData();
- addDataAtEnd(datap);
- }
- else if (2 == random_number)
- {
- swapCurrentWithPrevious();
- }
- else if (3 == random_number)
- {
- swapCurrentWithNext();
- }
- datap = getNextData();
- }
- mQueuep = mHead.mNextp;
- mCurrentp = mQueuep;
-}
-
-template <class DATA_TYPE>
-BOOL LLDoubleLinkedList<DATA_TYPE>::isEmpty()
-{
- return (mCount == 0);
-}
-
-
-#endif
diff --git a/indra/llcommon/imageids.cpp b/indra/llcommon/imageids.cpp
deleted file mode 100755
index 7d647e5c36..0000000000
--- a/indra/llcommon/imageids.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * @file imageids.cpp
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "linden_common.h"
-
-#include "imageids.h"
-
-#include "lluuid.h"
-
-//
-// USE OF THIS FILE IS DEPRECATED
-//
-// Please use viewerart.ini and the standard
-// art import path. // indicates if file is only
- // on dataserver, or also
- // pre-cached on viewer
-
-// Grass Images
-const LLUUID IMG_SMOKE ("b4ba225c-373f-446d-9f7e-6cb7b5cf9b3d"); // VIEWER
-
-const LLUUID IMG_DEFAULT ("d2114404-dd59-4a4d-8e6c-49359e91bbf0"); // VIEWER
-
-const LLUUID IMG_SUN ("cce0f112-878f-4586-a2e2-a8f104bba271"); // dataserver
-const LLUUID IMG_MOON ("d07f6eed-b96a-47cd-b51d-400ad4a1c428"); // dataserver
-const LLUUID IMG_CLOUD_POOF ("fc4b9f0b-d008-45c6-96a4-01dd947ac621"); // dataserver
-const LLUUID IMG_SHOT ("35f217a3-f618-49cf-bbca-c86d486551a9"); // dataserver
-const LLUUID IMG_SPARK ("d2e75ac1-d0fb-4532-820e-a20034ac814d"); // dataserver
-const LLUUID IMG_FIRE ("aca40aa8-44cf-44ca-a0fa-93e1a2986f82"); // dataserver
-const LLUUID IMG_FACE_SELECT ("a85ac674-cb75-4af6-9499-df7c5aaf7a28"); // face selector
-const LLUUID IMG_DEFAULT_AVATAR ("c228d1cf-4b5d-4ba8-84f4-899a0796aa97"); // dataserver
-const LLUUID IMG_INVISIBLE ("3a367d1c-bef1-6d43-7595-e88c1e3aadb3"); // dataserver
-
-const LLUUID IMG_EXPLOSION ("68edcf47-ccd7-45b8-9f90-1649d7f12806"); // On dataserver
-const LLUUID IMG_EXPLOSION_2 ("21ce046c-83fe-430a-b629-c7660ac78d7c"); // On dataserver
-const LLUUID IMG_EXPLOSION_3 ("fedea30a-1be8-47a6-bc06-337a04a39c4b"); // On dataserver
-const LLUUID IMG_EXPLOSION_4 ("abf0d56b-82e5-47a2-a8ad-74741bb2c29e"); // On dataserver
-const LLUUID IMG_SMOKE_POOF ("1e63e323-5fe0-452e-92f8-b98bd0f764e3"); // On dataserver
-
-const LLUUID IMG_BIG_EXPLOSION_1 ("5e47a0dc-97bf-44e0-8b40-de06718cee9d"); // On dataserver
-const LLUUID IMG_BIG_EXPLOSION_2 ("9c8eca51-53d5-42a7-bb58-cef070395db8"); // On dataserver
-
-const LLUUID IMG_BLOOM1 ("3c59f7fe-9dc8-47f9-8aaf-a9dd1fbc3bef"); // VIEWER
-const LLUUID TERRAIN_DIRT_DETAIL ("0bc58228-74a0-7e83-89bc-5c23464bcec5"); // VIEWER
-const LLUUID TERRAIN_GRASS_DETAIL ("63338ede-0037-c4fd-855b-015d77112fc8"); // VIEWER
-const LLUUID TERRAIN_MOUNTAIN_DETAIL ("303cd381-8560-7579-23f1-f0a880799740"); // VIEWER
-const LLUUID TERRAIN_ROCK_DETAIL ("53a2f406-4895-1d13-d541-d2e3b86bc19c"); // VIEWER
-
-const LLUUID DEFAULT_WATER_NORMAL ("822ded49-9a6c-f61c-cb89-6df54f42cdf4"); // VIEWER
-
-const LLUUID IMG_CHECKERBOARD_RGBA ("2585a0f3-4163-6dd1-0f34-ad48cb909e25"); // dataserver
-
diff --git a/indra/llcommon/imageids.h b/indra/llcommon/imageids.h
deleted file mode 100755
index 18c8ecb074..0000000000
--- a/indra/llcommon/imageids.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * @file imageids.h
- * @brief Temporary holder for image IDs
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_IMAGEIDS_H
-#define LL_IMAGEIDS_H
-
-//
-// USE OF THIS FILE IS DEPRECATED
-//
-// Please use viewerart.ini and the standard
-// art import path.
-
-class LLUUID;
-
-LL_COMMON_API extern const LLUUID IMG_SMOKE;
-
-LL_COMMON_API extern const LLUUID IMG_DEFAULT;
-
-LL_COMMON_API extern const LLUUID IMG_SUN;
-LL_COMMON_API extern const LLUUID IMG_MOON;
-LL_COMMON_API extern const LLUUID IMG_CLOUD_POOF;
-LL_COMMON_API extern const LLUUID IMG_SHOT;
-LL_COMMON_API extern const LLUUID IMG_SPARK;
-LL_COMMON_API extern const LLUUID IMG_FIRE;
-LL_COMMON_API extern const LLUUID IMG_FACE_SELECT;
-LL_COMMON_API extern const LLUUID IMG_DEFAULT_AVATAR;
-LL_COMMON_API extern const LLUUID IMG_INVISIBLE;
-
-LL_COMMON_API extern const LLUUID IMG_EXPLOSION;
-LL_COMMON_API extern const LLUUID IMG_EXPLOSION_2;
-LL_COMMON_API extern const LLUUID IMG_EXPLOSION_3;
-LL_COMMON_API extern const LLUUID IMG_EXPLOSION_4;
-LL_COMMON_API extern const LLUUID IMG_SMOKE_POOF;
-
-LL_COMMON_API extern const LLUUID IMG_BIG_EXPLOSION_1;
-LL_COMMON_API extern const LLUUID IMG_BIG_EXPLOSION_2;
-
-LL_COMMON_API extern const LLUUID IMG_BLOOM1;
-LL_COMMON_API extern const LLUUID TERRAIN_DIRT_DETAIL;
-LL_COMMON_API extern const LLUUID TERRAIN_GRASS_DETAIL;
-LL_COMMON_API extern const LLUUID TERRAIN_MOUNTAIN_DETAIL;
-LL_COMMON_API extern const LLUUID TERRAIN_ROCK_DETAIL;
-
-LL_COMMON_API extern const LLUUID DEFAULT_WATER_NORMAL;
-
-LL_COMMON_API extern const LLUUID IMG_CHECKERBOARD_RGBA;
-#endif
diff --git a/indra/llcommon/indra_constants.cpp b/indra/llcommon/indra_constants.cpp
index d32ae6c041..f3989ee1d0 100755
--- a/indra/llcommon/indra_constants.cpp
+++ b/indra/llcommon/indra_constants.cpp
@@ -35,6 +35,35 @@ const LLUUID LL_UUID_ALL_AGENTS("44e87126-e794-4ded-05b3-7c42da3d5cdb");
// Governor Linden's agent id.
const LLUUID ALEXANDRIA_LINDEN_ID("ba2a564a-f0f1-4b82-9c61-b7520bfcd09f");
const LLUUID GOVERNOR_LINDEN_ID("3d6181b0-6a4b-97ef-18d8-722652995cf1");
-const LLUUID REALESTATE_LINDEN_ID("3d6181b0-6a4b-97ef-18d8-722652995cf1");
// Maintenance's group id.
const LLUUID MAINTENANCE_GROUP_ID("dc7b21cd-3c89-fcaa-31c8-25f9ffd224cd");
+// Grass Images
+const LLUUID IMG_SMOKE ("b4ba225c-373f-446d-9f7e-6cb7b5cf9b3d"); // VIEWER
+
+const LLUUID IMG_DEFAULT ("d2114404-dd59-4a4d-8e6c-49359e91bbf0"); // VIEWER
+
+const LLUUID IMG_SUN ("cce0f112-878f-4586-a2e2-a8f104bba271"); // dataserver
+const LLUUID IMG_MOON ("d07f6eed-b96a-47cd-b51d-400ad4a1c428"); // dataserver
+const LLUUID IMG_SHOT ("35f217a3-f618-49cf-bbca-c86d486551a9"); // dataserver
+const LLUUID IMG_SPARK ("d2e75ac1-d0fb-4532-820e-a20034ac814d"); // dataserver
+const LLUUID IMG_FIRE ("aca40aa8-44cf-44ca-a0fa-93e1a2986f82"); // dataserver
+const LLUUID IMG_FACE_SELECT ("a85ac674-cb75-4af6-9499-df7c5aaf7a28"); // face selector
+const LLUUID IMG_DEFAULT_AVATAR ("c228d1cf-4b5d-4ba8-84f4-899a0796aa97"); // dataserver
+const LLUUID IMG_INVISIBLE ("3a367d1c-bef1-6d43-7595-e88c1e3aadb3"); // dataserver
+
+const LLUUID IMG_EXPLOSION ("68edcf47-ccd7-45b8-9f90-1649d7f12806"); // On dataserver
+const LLUUID IMG_EXPLOSION_2 ("21ce046c-83fe-430a-b629-c7660ac78d7c"); // On dataserver
+const LLUUID IMG_EXPLOSION_3 ("fedea30a-1be8-47a6-bc06-337a04a39c4b"); // On dataserver
+const LLUUID IMG_EXPLOSION_4 ("abf0d56b-82e5-47a2-a8ad-74741bb2c29e"); // On dataserver
+const LLUUID IMG_SMOKE_POOF ("1e63e323-5fe0-452e-92f8-b98bd0f764e3"); // On dataserver
+
+const LLUUID IMG_BIG_EXPLOSION_1 ("5e47a0dc-97bf-44e0-8b40-de06718cee9d"); // On dataserver
+const LLUUID IMG_BIG_EXPLOSION_2 ("9c8eca51-53d5-42a7-bb58-cef070395db8"); // On dataserver
+
+const LLUUID IMG_BLOOM1 ("3c59f7fe-9dc8-47f9-8aaf-a9dd1fbc3bef"); // VIEWER
+const LLUUID TERRAIN_DIRT_DETAIL ("0bc58228-74a0-7e83-89bc-5c23464bcec5"); // VIEWER
+const LLUUID TERRAIN_GRASS_DETAIL ("63338ede-0037-c4fd-855b-015d77112fc8"); // VIEWER
+const LLUUID TERRAIN_MOUNTAIN_DETAIL ("303cd381-8560-7579-23f1-f0a880799740"); // VIEWER
+const LLUUID TERRAIN_ROCK_DETAIL ("53a2f406-4895-1d13-d541-d2e3b86bc19c"); // VIEWER
+
+const LLUUID DEFAULT_WATER_NORMAL ("822ded49-9a6c-f61c-cb89-6df54f42cdf4"); // VIEWER
diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h
index 0da83720bd..02f063f5e8 100755
--- a/indra/llcommon/indra_constants.h
+++ b/indra/llcommon/indra_constants.h
@@ -31,122 +31,28 @@
class LLUUID;
-// At 45 Hz collisions seem stable and objects seem
-// to settle down at a reasonable rate.
-// JC 3/18/2003
-
-// const F32 PHYSICS_TIMESTEP = 1.f / 45.f;
-// This must be a #define due to anal retentive restrictions on const expressions
-// CG 2008-06-05
-#define PHYSICS_TIMESTEP (1.f / 45.f)
-
-const F32 COLLISION_TOLERANCE = 0.1f;
-const F32 HALF_COLLISION_TOLERANCE = 0.05f;
-
-// Time constants
-const U32 HOURS_PER_LINDEN_DAY = 4;
-const U32 DAYS_PER_LINDEN_YEAR = 11;
-
-const U32 SEC_PER_LINDEN_DAY = HOURS_PER_LINDEN_DAY * 60 * 60;
-const U32 SEC_PER_LINDEN_YEAR = DAYS_PER_LINDEN_YEAR * SEC_PER_LINDEN_DAY;
-
static const F32 REGION_WIDTH_METERS = 256.f;
static const S32 REGION_WIDTH_UNITS = 256;
static const U32 REGION_WIDTH_U32 = 256;
const F32 REGION_HEIGHT_METERS = 4096.f;
-// Bits for simulator performance query flags
-enum LAND_STAT_FLAGS
-{
- STAT_FILTER_BY_PARCEL = 0x00000001,
- STAT_FILTER_BY_OWNER = 0x00000002,
- STAT_FILTER_BY_OBJECT = 0x00000004,
- STAT_FILTER_BY_PARCEL_NAME = 0x00000008,
- STAT_REQUEST_LAST_ENTRY = 0x80000000,
-};
-
-enum LAND_STAT_REPORT_TYPE
-{
- STAT_REPORT_TOP_SCRIPTS = 0,
- STAT_REPORT_TOP_COLLIDERS
-};
-
-const U32 STAT_FILTER_MASK = 0x1FFFFFFF;
-
-// Region absolute limits
-static const S32 REGION_AGENT_COUNT_MIN = 1;
-static const S32 REGION_AGENT_COUNT_MAX = 200; // Must fit in U8 for the moment (RegionInfo msg)
-static const S32 REGION_PRIM_COUNT_MIN = 0;
-static const S32 REGION_PRIM_COUNT_MAX = 40000;
-static const F32 REGION_PRIM_BONUS_MIN = 1.0;
-static const F32 REGION_PRIM_BONUS_MAX = 10.0;
-
-// Default maximum number of tasks/prims per region.
-const U32 DEFAULT_MAX_REGION_WIDE_PRIM_COUNT = 15000;
-
-const F32 MIN_AGENT_DEPTH = 0.30f;
const F32 DEFAULT_AGENT_DEPTH = 0.45f;
-const F32 MAX_AGENT_DEPTH = 0.60f;
-
-const F32 MIN_AGENT_WIDTH = 0.40f;
const F32 DEFAULT_AGENT_WIDTH = 0.60f;
-const F32 MAX_AGENT_WIDTH = 0.80f;
-
-const F32 MIN_AGENT_HEIGHT = 1.1f;
const F32 DEFAULT_AGENT_HEIGHT = 1.9f;
-const F32 MAX_AGENT_HEIGHT = 2.45f;
-
-// For linked sets
-const S32 MAX_CHILDREN_PER_TASK = 255;
-const S32 MAX_CHILDREN_PER_PHYSICAL_TASK = 32;
-
-const S32 MAX_JOINTS_PER_OBJECT = 1; // limiting to 1 until Havok 2.x
-
-const char* const DEFAULT_DMZ_SPACE_SERVER = "192.168.0.140";
-const char* const DEFAULT_DMZ_USER_SERVER = "192.168.0.140";
-const char* const DEFAULT_DMZ_DATA_SERVER = "192.168.0.140";
-const char* const DEFAULT_DMZ_ASSET_SERVER = "http://asset.dmz.lindenlab.com:80";
-
-const char* const DEFAULT_AGNI_SPACE_SERVER = "63.211.139.100";
-const char* const DEFAULT_AGNI_USER_SERVER = "63.211.139.100";
-const char* const DEFAULT_AGNI_DATA_SERVER = "63.211.139.100";
-const char* const DEFAULT_AGNI_ASSET_SERVER = "http://asset.agni.lindenlab.com:80";
-
-// Information about what ports are for what services is in the wiki Name Space Ports page
-// https://wiki.lindenlab.com/wiki/Name_Space_Ports
-const char* const DEFAULT_LOCAL_ASSET_SERVER = "http://localhost:12041/asset/tmp";
-const char* const LOCAL_ASSET_URL_FORMAT = "http://%s:12041/asset";
-
-const U32 DEFAULT_LAUNCHER_PORT = 12029;
-//const U32 DEFAULT_BIGBOARD_PORT = 12030; // Deprecated
-//const U32 DEFAULT_QUERYSIM_PORT = 12031; // Deprecated
-const U32 DEFAULT_DATA_SERVER_PORT = 12032;
-const U32 DEFAULT_SPACE_SERVER_PORT = 12033;
-const U32 DEFAULT_VIEWER_PORT = 12034;
-const U32 DEFAULT_SIMULATOR_PORT = 12035;
-const U32 DEFAULT_USER_SERVER_PORT = 12036;
-const U32 DEFAULT_RPC_SERVER_PORT = 12037;
-const U32 DEFAULT_LOG_DATA_SERVER_PORT = 12039;
-const U32 DEFAULT_BACKBONE_PORT = 12040;
-const U32 DEFAULT_LOCAL_ASSET_PORT = 12041;
-//const U32 DEFAULT_BACKBONE_CAP_PORT = 12042; // Deprecated
-const U32 DEFAULT_CAP_PROXY_PORT = 12043;
-const U32 DEFAULT_INV_DATA_SERVER_PORT = 12044;
-const U32 DEFAULT_CGI_SERVICES_PORT = 12045;
-
-// Mapserver uses ports 12124 - 12139 to allow multiple mapservers to run
-// on a single host for map tile generation. JC
-const U32 DEFAULT_MAPSERVER_PORT = 12124;
-
-// For automatic port discovery when running multiple viewers on one host
-const U32 PORT_DISCOVERY_RANGE_MIN = 13000;
-const U32 PORT_DISCOVERY_RANGE_MAX = PORT_DISCOVERY_RANGE_MIN + 50;
-
-const char LAND_LAYER_CODE = 'L';
-const char WATER_LAYER_CODE = 'W';
-const char WIND_LAYER_CODE = '7';
-const char CLOUD_LAYER_CODE = '8';
+
+enum ETerrainBrushType
+{
+ // the valid brush numbers cannot be reordered, because they
+ // are used in the binary LSL format as arguments to llModifyLand()
+ E_LANDBRUSH_LEVEL = 0,
+ E_LANDBRUSH_RAISE = 1,
+ E_LANDBRUSH_LOWER = 2,
+ E_LANDBRUSH_SMOOTH = 3,
+ E_LANDBRUSH_NOISE = 4,
+ E_LANDBRUSH_REVERT = 5,
+ E_LANDBRUSH_INVALID = 6
+};
// keys
// Bit masks for various keyboard modifier keys.
@@ -265,89 +171,43 @@ LL_COMMON_API extern const LLUUID LL_UUID_ALL_AGENTS;
LL_COMMON_API extern const LLUUID ALEXANDRIA_LINDEN_ID;
LL_COMMON_API extern const LLUUID GOVERNOR_LINDEN_ID;
-LL_COMMON_API extern const LLUUID REALESTATE_LINDEN_ID;
// Maintenance's group id.
LL_COMMON_API extern const LLUUID MAINTENANCE_GROUP_ID;
-// Flags for kick message
-const U32 KICK_FLAGS_DEFAULT = 0x0;
-const U32 KICK_FLAGS_FREEZE = 1 << 0;
-const U32 KICK_FLAGS_UNFREEZE = 1 << 1;
-
-const U8 UPD_NONE = 0x00;
-const U8 UPD_POSITION = 0x01;
-const U8 UPD_ROTATION = 0x02;
-const U8 UPD_SCALE = 0x04;
-const U8 UPD_LINKED_SETS = 0x08;
-const U8 UPD_UNIFORM = 0x10; // used with UPD_SCALE
-
-// Agent Update Flags (U8)
-const U8 AU_FLAGS_NONE = 0x00;
-const U8 AU_FLAGS_HIDETITLE = 0x01;
-const U8 AU_FLAGS_CLIENT_AUTOPILOT = 0x02;
-
-// start location constants
-const U32 START_LOCATION_ID_LAST = 0;
-const U32 START_LOCATION_ID_HOME = 1;
-const U32 START_LOCATION_ID_DIRECT = 2; // for direct teleport
-const U32 START_LOCATION_ID_PARCEL = 3; // for teleports to a parcel
-const U32 START_LOCATION_ID_TELEHUB = 4; // for teleports to a spawnpoint
-const U32 START_LOCATION_ID_URL = 5;
-const U32 START_LOCATION_ID_COUNT = 6;
-
-// group constants
-const U32 GROUP_MIN_SIZE = 2;
-
-// gMaxAgentGroups is now sent by login.cgi, which
-// looks it up from globals.xml.
-//
-// For now we need an old default value however,
-// so the viewer can be deployed ahead of login.cgi.
-//
-const S32 DEFAULT_MAX_AGENT_GROUPS = 25;
+// image ids
+LL_COMMON_API extern const LLUUID IMG_SMOKE;
-// radius within which a chat message is fully audible
-const F32 CHAT_WHISPER_RADIUS = 10.f;
-const F32 CHAT_NORMAL_RADIUS = 20.f;
-const F32 CHAT_SHOUT_RADIUS = 100.f;
-const F32 CHAT_MAX_RADIUS = CHAT_SHOUT_RADIUS;
-const F32 CHAT_MAX_RADIUS_BY_TWO = CHAT_MAX_RADIUS / 2.f;
+LL_COMMON_API extern const LLUUID IMG_DEFAULT;
-// squared editions of the above for distance checks
-const F32 CHAT_WHISPER_RADIUS_SQUARED = CHAT_WHISPER_RADIUS * CHAT_WHISPER_RADIUS;
-const F32 CHAT_NORMAL_RADIUS_SQUARED = CHAT_NORMAL_RADIUS * CHAT_NORMAL_RADIUS;
-const F32 CHAT_SHOUT_RADIUS_SQUARED = CHAT_SHOUT_RADIUS * CHAT_SHOUT_RADIUS;
-const F32 CHAT_MAX_RADIUS_SQUARED = CHAT_SHOUT_RADIUS_SQUARED;
-const F32 CHAT_MAX_RADIUS_BY_TWO_SQUARED = CHAT_MAX_RADIUS_BY_TWO * CHAT_MAX_RADIUS_BY_TWO;
+LL_COMMON_API extern const LLUUID IMG_SUN;
+LL_COMMON_API extern const LLUUID IMG_MOON;
+LL_COMMON_API extern const LLUUID IMG_SHOT;
+LL_COMMON_API extern const LLUUID IMG_SPARK;
+LL_COMMON_API extern const LLUUID IMG_FIRE;
+LL_COMMON_API extern const LLUUID IMG_FACE_SELECT;
+LL_COMMON_API extern const LLUUID IMG_DEFAULT_AVATAR;
+LL_COMMON_API extern const LLUUID IMG_INVISIBLE;
+LL_COMMON_API extern const LLUUID IMG_EXPLOSION;
+LL_COMMON_API extern const LLUUID IMG_EXPLOSION_2;
+LL_COMMON_API extern const LLUUID IMG_EXPLOSION_3;
+LL_COMMON_API extern const LLUUID IMG_EXPLOSION_4;
+LL_COMMON_API extern const LLUUID IMG_SMOKE_POOF;
-// this times above gives barely audible radius
-const F32 CHAT_BARELY_AUDIBLE_FACTOR = 2.0f;
+LL_COMMON_API extern const LLUUID IMG_BIG_EXPLOSION_1;
+LL_COMMON_API extern const LLUUID IMG_BIG_EXPLOSION_2;
-// distance in front of speaking agent the sphere is centered
-const F32 CHAT_WHISPER_OFFSET = 5.f;
-const F32 CHAT_NORMAL_OFFSET = 10.f;
-const F32 CHAT_SHOUT_OFFSET = 50.f;
+LL_COMMON_API extern const LLUUID IMG_BLOOM1;
+LL_COMMON_API extern const LLUUID TERRAIN_DIRT_DETAIL;
+LL_COMMON_API extern const LLUUID TERRAIN_GRASS_DETAIL;
+LL_COMMON_API extern const LLUUID TERRAIN_MOUNTAIN_DETAIL;
+LL_COMMON_API extern const LLUUID TERRAIN_ROCK_DETAIL;
-// first clean starts at 3 AM
-const S32 SANDBOX_FIRST_CLEAN_HOUR = 3;
-// clean every <n> hours
-const S32 SANDBOX_CLEAN_FREQ = 12;
+LL_COMMON_API extern const LLUUID DEFAULT_WATER_NORMAL;
-const F32 WIND_SCALE_HACK = 2.0f; // hack to make wind speeds more realistic
-enum ETerrainBrushType
-{
- // the valid brush numbers cannot be reordered, because they
- // are used in the binary LSL format as arguments to llModifyLand()
- E_LANDBRUSH_LEVEL = 0,
- E_LANDBRUSH_RAISE = 1,
- E_LANDBRUSH_LOWER = 2,
- E_LANDBRUSH_SMOOTH = 3,
- E_LANDBRUSH_NOISE = 4,
- E_LANDBRUSH_REVERT = 5,
- E_LANDBRUSH_INVALID = 6
-};
+// radius within which a chat message is fully audible
+const F32 CHAT_NORMAL_RADIUS = 20.f;
// media commands
const U32 PARCEL_MEDIA_COMMAND_STOP = 0;
@@ -365,51 +225,101 @@ const U32 PARCEL_MEDIA_COMMAND_SIZE = 11;
const U32 PARCEL_MEDIA_COMMAND_DESC = 12;
const U32 PARCEL_MEDIA_COMMAND_LOOP_SET = 13;
-// map item types
-const U32 MAP_ITEM_TELEHUB = 0x01;
-const U32 MAP_ITEM_PG_EVENT = 0x02;
-const U32 MAP_ITEM_MATURE_EVENT = 0x03;
-//const U32 MAP_ITEM_POPULAR = 0x04; // No longer supported, 2009-03-02 KLW
-//const U32 MAP_ITEM_AGENT_COUNT = 0x05;
-const U32 MAP_ITEM_AGENT_LOCATIONS = 0x06;
-const U32 MAP_ITEM_LAND_FOR_SALE = 0x07;
-const U32 MAP_ITEM_CLASSIFIED = 0x08;
-const U32 MAP_ITEM_ADULT_EVENT = 0x09;
-const U32 MAP_ITEM_LAND_FOR_SALE_ADULT = 0x0a;
-
-// Region map layer numbers
-const S32 MAP_SIM_OBJECTS = 0;
-const S32 MAP_SIM_TERRAIN = 1;
-const S32 MAP_SIM_LAND_FOR_SALE = 2; // Transparent alpha overlay of land for sale
-const S32 MAP_SIM_IMAGE_TYPES = 3; // Number of map layers
-const S32 MAP_SIM_INFO_MASK = 0x00FFFFFF; // Agent access may be stuffed into upper byte
-const S32 MAP_SIM_LAYER_MASK = 0x0000FFFF; // Layer info is in lower 16 bits
-const S32 MAP_SIM_RETURN_NULL_SIMS = 0x00010000;
-const S32 MAP_SIM_PRELUDE = 0x00020000;
-
-// Crash reporter behavior
-const S32 CRASH_BEHAVIOR_ASK = 0;
-const S32 CRASH_BEHAVIOR_ALWAYS_SEND = 1;
-const S32 CRASH_BEHAVIOR_NEVER_SEND = 2;
-
-// Export/Import return values
-const S32 EXPORT_SUCCESS = 0;
-const S32 EXPORT_ERROR_PERMISSIONS = -1;
-const S32 EXPORT_ERROR_UNKNOWN = -2;
-
-// This is how long the sim will try to teleport you before giving up.
-const F32 TELEPORT_EXPIRY = 15.0f;
-// Additional time (in seconds) to wait per attachment
-const F32 TELEPORT_EXPIRY_PER_ATTACHMENT = 3.f;
-
-// The maximum size of an object extra parameters binary (packed) block
-#define MAX_OBJECT_PARAMS_SIZE 1024
-
const S32 CHAT_CHANNEL_DEBUG = S32_MAX;
-// PLEASE don't add constants here. Every dev will have to do
-// a complete rebuild. Try to find another shared header file,
-// like llregionflags.h, lllslconstants.h, llagentconstants.h,
-// or create a new one. JC
+// agent constants
+const U32 CONTROL_AT_POS_INDEX = 0;
+const U32 CONTROL_AT_NEG_INDEX = 1;
+const U32 CONTROL_LEFT_POS_INDEX = 2;
+const U32 CONTROL_LEFT_NEG_INDEX = 3;
+const U32 CONTROL_UP_POS_INDEX = 4;
+const U32 CONTROL_UP_NEG_INDEX = 5;
+const U32 CONTROL_PITCH_POS_INDEX = 6;
+const U32 CONTROL_PITCH_NEG_INDEX = 7;
+const U32 CONTROL_YAW_POS_INDEX = 8;
+const U32 CONTROL_YAW_NEG_INDEX = 9;
+const U32 CONTROL_FAST_AT_INDEX = 10;
+const U32 CONTROL_FAST_LEFT_INDEX = 11;
+const U32 CONTROL_FAST_UP_INDEX = 12;
+const U32 CONTROL_FLY_INDEX = 13;
+const U32 CONTROL_STOP_INDEX = 14;
+const U32 CONTROL_FINISH_ANIM_INDEX = 15;
+const U32 CONTROL_STAND_UP_INDEX = 16;
+const U32 CONTROL_SIT_ON_GROUND_INDEX = 17;
+const U32 CONTROL_MOUSELOOK_INDEX = 18;
+const U32 CONTROL_NUDGE_AT_POS_INDEX = 19;
+const U32 CONTROL_NUDGE_AT_NEG_INDEX = 20;
+const U32 CONTROL_NUDGE_LEFT_POS_INDEX = 21;
+const U32 CONTROL_NUDGE_LEFT_NEG_INDEX = 22;
+const U32 CONTROL_NUDGE_UP_POS_INDEX = 23;
+const U32 CONTROL_NUDGE_UP_NEG_INDEX = 24;
+const U32 CONTROL_TURN_LEFT_INDEX = 25;
+const U32 CONTROL_TURN_RIGHT_INDEX = 26;
+const U32 CONTROL_AWAY_INDEX = 27;
+const U32 CONTROL_LBUTTON_DOWN_INDEX = 28;
+const U32 CONTROL_LBUTTON_UP_INDEX = 29;
+const U32 CONTROL_ML_LBUTTON_DOWN_INDEX = 30;
+const U32 CONTROL_ML_LBUTTON_UP_INDEX = 31;
+const U32 TOTAL_CONTROLS = 32;
+
+const U32 AGENT_CONTROL_AT_POS = 0x1 << CONTROL_AT_POS_INDEX; // 0x00000001
+const U32 AGENT_CONTROL_AT_NEG = 0x1 << CONTROL_AT_NEG_INDEX; // 0x00000002
+const U32 AGENT_CONTROL_LEFT_POS = 0x1 << CONTROL_LEFT_POS_INDEX; // 0x00000004
+const U32 AGENT_CONTROL_LEFT_NEG = 0x1 << CONTROL_LEFT_NEG_INDEX; // 0x00000008
+const U32 AGENT_CONTROL_UP_POS = 0x1 << CONTROL_UP_POS_INDEX; // 0x00000010
+const U32 AGENT_CONTROL_UP_NEG = 0x1 << CONTROL_UP_NEG_INDEX; // 0x00000020
+const U32 AGENT_CONTROL_PITCH_POS = 0x1 << CONTROL_PITCH_POS_INDEX; // 0x00000040
+const U32 AGENT_CONTROL_PITCH_NEG = 0x1 << CONTROL_PITCH_NEG_INDEX; // 0x00000080
+const U32 AGENT_CONTROL_YAW_POS = 0x1 << CONTROL_YAW_POS_INDEX; // 0x00000100
+const U32 AGENT_CONTROL_YAW_NEG = 0x1 << CONTROL_YAW_NEG_INDEX; // 0x00000200
+
+const U32 AGENT_CONTROL_FAST_AT = 0x1 << CONTROL_FAST_AT_INDEX; // 0x00000400
+const U32 AGENT_CONTROL_FAST_LEFT = 0x1 << CONTROL_FAST_LEFT_INDEX; // 0x00000800
+const U32 AGENT_CONTROL_FAST_UP = 0x1 << CONTROL_FAST_UP_INDEX; // 0x00001000
+
+const U32 AGENT_CONTROL_FLY = 0x1 << CONTROL_FLY_INDEX; // 0x00002000
+const U32 AGENT_CONTROL_STOP = 0x1 << CONTROL_STOP_INDEX; // 0x00004000
+const U32 AGENT_CONTROL_FINISH_ANIM = 0x1 << CONTROL_FINISH_ANIM_INDEX; // 0x00008000
+const U32 AGENT_CONTROL_STAND_UP = 0x1 << CONTROL_STAND_UP_INDEX; // 0x00010000
+const U32 AGENT_CONTROL_SIT_ON_GROUND = 0x1 << CONTROL_SIT_ON_GROUND_INDEX; // 0x00020000
+const U32 AGENT_CONTROL_MOUSELOOK = 0x1 << CONTROL_MOUSELOOK_INDEX; // 0x00040000
+
+const U32 AGENT_CONTROL_NUDGE_AT_POS = 0x1 << CONTROL_NUDGE_AT_POS_INDEX; // 0x00080000
+const U32 AGENT_CONTROL_NUDGE_AT_NEG = 0x1 << CONTROL_NUDGE_AT_NEG_INDEX; // 0x00100000
+const U32 AGENT_CONTROL_NUDGE_LEFT_POS = 0x1 << CONTROL_NUDGE_LEFT_POS_INDEX; // 0x00200000
+const U32 AGENT_CONTROL_NUDGE_LEFT_NEG = 0x1 << CONTROL_NUDGE_LEFT_NEG_INDEX; // 0x00400000
+const U32 AGENT_CONTROL_NUDGE_UP_POS = 0x1 << CONTROL_NUDGE_UP_POS_INDEX; // 0x00800000
+const U32 AGENT_CONTROL_NUDGE_UP_NEG = 0x1 << CONTROL_NUDGE_UP_NEG_INDEX; // 0x01000000
+const U32 AGENT_CONTROL_TURN_LEFT = 0x1 << CONTROL_TURN_LEFT_INDEX; // 0x02000000
+const U32 AGENT_CONTROL_TURN_RIGHT = 0x1 << CONTROL_TURN_RIGHT_INDEX; // 0x04000000
+
+const U32 AGENT_CONTROL_AWAY = 0x1 << CONTROL_AWAY_INDEX; // 0x08000000
+
+const U32 AGENT_CONTROL_LBUTTON_DOWN = 0x1 << CONTROL_LBUTTON_DOWN_INDEX; // 0x10000000
+const U32 AGENT_CONTROL_LBUTTON_UP = 0x1 << CONTROL_LBUTTON_UP_INDEX; // 0x20000000
+const U32 AGENT_CONTROL_ML_LBUTTON_DOWN = 0x1 << CONTROL_ML_LBUTTON_DOWN_INDEX; // 0x40000000
+const U32 AGENT_CONTROL_ML_LBUTTON_UP = ((U32)0x1) << CONTROL_ML_LBUTTON_UP_INDEX; // 0x80000000
+
+// move these up so that we can hide them in "State" for object updates
+// (for now)
+const U32 AGENT_ATTACH_OFFSET = 4;
+const U32 AGENT_ATTACH_MASK = 0xf << AGENT_ATTACH_OFFSET;
+
+// RN: this method swaps the upper and lower nibbles to maintain backward
+// compatibility with old objects that only used the upper nibble
+#define ATTACHMENT_ID_FROM_STATE(state) ((S32)((((U8)state & AGENT_ATTACH_MASK) >> 4) | (((U8)state & ~AGENT_ATTACH_MASK) << 4)))
+
+// DO NOT CHANGE THE SEQUENCE OF THIS LIST!!
+const U8 CLICK_ACTION_NONE = 0;
+const U8 CLICK_ACTION_TOUCH = 0;
+const U8 CLICK_ACTION_SIT = 1;
+const U8 CLICK_ACTION_BUY = 2;
+const U8 CLICK_ACTION_PAY = 3;
+const U8 CLICK_ACTION_OPEN = 4;
+const U8 CLICK_ACTION_PLAY = 5;
+const U8 CLICK_ACTION_OPEN_MEDIA = 6;
+const U8 CLICK_ACTION_ZOOM = 7;
+// DO NOT CHANGE THE SEQUENCE OF THIS LIST!!
+
#endif
diff --git a/indra/llcommon/linked_lists.h b/indra/llcommon/linked_lists.h
deleted file mode 100755
index 6b25295b7b..0000000000
--- a/indra/llcommon/linked_lists.h
+++ /dev/null
@@ -1,937 +0,0 @@
-/**
- * @file linked_lists.h
- * @brief LLLinkedList class header amd implementation file.
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LINKED_LISTS_H
-#define LL_LINKED_LISTS_H
-
-/**
- * Provides a standard doubly linked list for fun and profit
- * Utilizes a neat trick off of Flipcode where the back pointer is a
- * pointer to a pointer, allowing easier transfer of nodes between lists, &c
- * And a template class, of course
- */
-
-#include "llerror.h"
-
-
-template <class DATA_TYPE> class LLLinkedList
-{
-public:
- friend class LLLinkNode;
- // External interface
-
- // basic constructor
- LLLinkedList() : mHead(NULL), mCurrentp(NULL), mInsertBefore(NULL)
- {
- mCurrentp = mHead.mNextp;
- mCurrentOperatingp = mHead.mNextp;
- mCount = 0;
- }
-
- // basic constructor
- LLLinkedList(BOOL (*insert_before)(DATA_TYPE *data_new, DATA_TYPE *data_tested)) : mHead(NULL), mCurrentp(NULL), mInsertBefore(insert_before)
- {
- mCurrentp = mHead.mNextp;
- mCurrentOperatingp = mHead.mNextp;
- mCount = 0;
- }
-
- // destructor destroys list and nodes, but not data in nodes
- ~LLLinkedList()
- {
- removeAllNodes();
- }
-
- // set mInsertBefore
- void setInsertBefore(BOOL (*insert_before)(DATA_TYPE *data_new, DATA_TYPE *data_tested))
- {
- mInsertBefore = insert_before;
- }
-
- //
- // WARNING!!!!!!!
- // addData and addDataSorted are NOT O(1) operations, but O(n) because they check
- // for existence of the data in the linked list first. Why, I don't know - djs
- // If you don't care about dupes, use addDataNoCheck
- //
-
- // put data into a node and stick it at the front of the list
- inline BOOL addData(DATA_TYPE *data);
-
- // put data into a node and sort into list by mInsertBefore()
- // calls normal add if mInsertBefore isn't set
- inline BOOL addDataSorted(DATA_TYPE *data);
-
- inline BOOL addDataNoCheck(DATA_TYPE *data);
-
- // bubbleSortList
- // does an improved bubble sort of the list . . . works best with almost sorted data
- // does nothing if mInsertBefore isn't set
- // Nota Bene: Swaps are accomplished by swapping data pointers
- inline void bubbleSortList();
-
- // put data into a node and stick it at the end of the list
- inline BOOL addDataAtEnd(DATA_TYPE *data);
-
- // returns number of items in the list
- inline S32 getLength() const;
-
- inline BOOL isEmpty();
-
- // search the list starting at mHead.mNextp and remove the link with mDatap == data
- // leave mCurrentp and mCurrentOperatingp on the next entry
- // return TRUE if found, FALSE if not found
- inline BOOL removeData(DATA_TYPE *data);
-
- // search the list starting at mHead.mNextp and delete the link with mDatap == data
- // leave mCurrentp and mCurrentOperatingp on the next entry
- // return TRUE if found, FALSE if not found
- inline BOOL deleteData(DATA_TYPE *data);
-
- // remove all nodes from the list and delete the associated data
- inline void deleteAllData();
-
- // remove all nodes from the list but do not delete data
- inline void removeAllNodes();
-
- // check to see if data is in list
- // if TRUE then mCurrentp and mCurrentOperatingp point to data
- inline BOOL checkData(DATA_TYPE *data);
-
- // place mCurrentp on first node
- inline void resetList();
-
- // return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
- inline DATA_TYPE *getCurrentData();
-
- // same as getCurrentData() but a more intuitive name for the operation
- inline DATA_TYPE *getNextData();
-
- // reset the list and return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
- inline DATA_TYPE *getFirstData();
-
- // reset the list and return the data at position n, set mCurentOperatingp to that node and bump mCurrentp
- // Note: n is zero-based
- inline DATA_TYPE *getNthData( U32 n);
-
- // reset the list and return the last data in it, set mCurentOperatingp to that node and bump mCurrentp
- inline DATA_TYPE *getLastData();
-
- // remove the Node at mCurentOperatingp
- // leave mCurrentp and mCurentOperatingp on the next entry
- inline void removeCurrentData();
-
- // remove the Node at mCurentOperatingp and add it to newlist
- // leave mCurrentp and mCurentOperatingp on the next entry
- void moveCurrentData(LLLinkedList *newlist, BOOL b_sort);
-
- BOOL moveData(DATA_TYPE *data, LLLinkedList *newlist, BOOL b_sort);
-
- // delete the Node at mCurentOperatingp
- // leave mCurrentp anf mCurentOperatingp on the next entry
- void deleteCurrentData();
-
-private:
- // node that actually contains the data
- class LLLinkNode
- {
- public:
- // assign the mDatap pointer
- LLLinkNode(DATA_TYPE *data) : mDatap(data), mNextp(NULL), mPrevpp(NULL)
- {
- }
-
- // destructor does not, by default, destroy associated data
- // however, the mDatap must be NULL to ensure that we aren't causing memory leaks
- ~LLLinkNode()
- {
- if (mDatap)
- {
- llerror("Attempting to call LLLinkNode destructor with a non-null mDatap!", 1);
- }
- }
-
- // delete associated data and NULL out pointer
- void deleteData()
- {
- delete mDatap;
- mDatap = NULL;
- }
-
- // NULL out pointer
- void removeData()
- {
- mDatap = NULL;
- }
-
- DATA_TYPE *mDatap;
- LLLinkNode *mNextp;
- LLLinkNode **mPrevpp;
- };
-
- // add a node at the front of the list
- void addData(LLLinkNode *node)
- {
- // don't allow NULL to be passed to addData
- if (!node)
- {
- llerror("NULL pointer passed to LLLinkedList::addData", 0);
- }
-
- // add the node to the front of the list
- node->mPrevpp = &mHead.mNextp;
- node->mNextp = mHead.mNextp;
-
- // if there's something in the list, fix its back pointer
- if (node->mNextp)
- {
- node->mNextp->mPrevpp = &node->mNextp;
- }
-
- mHead.mNextp = node;
- }
-
- LLLinkNode mHead; // fake head node. . . makes pointer operations faster and easier
- LLLinkNode *mCurrentp; // mCurrentp is the Node that getCurrentData returns
- LLLinkNode *mCurrentOperatingp; // this is the node that the various mumbleCurrentData functions act on
- BOOL (*mInsertBefore)(DATA_TYPE *data_new, DATA_TYPE *data_tested); // user function set to allow sorted lists
- U32 mCount;
-};
-
-template <class DATA_TYPE>
-BOOL LLLinkedList<DATA_TYPE>::addData(DATA_TYPE *data)
-{
- // don't allow NULL to be passed to addData
- if (!data)
- {
- llerror("NULL pointer passed to LLLinkedList::addData", 0);
- }
-
- LLLinkNode *tcurr = mCurrentp;
- LLLinkNode *tcurrop = mCurrentOperatingp;
-
- if ( checkData(data))
- {
- mCurrentp = tcurr;
- mCurrentOperatingp = tcurrop;
- return FALSE;
- }
-
- // make the new node
- LLLinkNode *temp = new LLLinkNode(data);
-
- // add the node to the front of the list
- temp->mPrevpp = &mHead.mNextp;
- temp->mNextp = mHead.mNextp;
-
- // if there's something in the list, fix its back pointer
- if (temp->mNextp)
- {
- temp->mNextp->mPrevpp = &temp->mNextp;
- }
-
- mHead.mNextp = temp;
- mCurrentp = tcurr;
- mCurrentOperatingp = tcurrop;
- mCount++;
- return TRUE;
-}
-
-
-template <class DATA_TYPE>
-BOOL LLLinkedList<DATA_TYPE>::addDataNoCheck(DATA_TYPE *data)
-{
- // don't allow NULL to be passed to addData
- if (!data)
- {
- llerror("NULL pointer passed to LLLinkedList::addData", 0);
- }
-
- LLLinkNode *tcurr = mCurrentp;
- LLLinkNode *tcurrop = mCurrentOperatingp;
-
- // make the new node
- LLLinkNode *temp = new LLLinkNode(data);
-
- // add the node to the front of the list
- temp->mPrevpp = &mHead.mNextp;
- temp->mNextp = mHead.mNextp;
-
- // if there's something in the list, fix its back pointer
- if (temp->mNextp)
- {
- temp->mNextp->mPrevpp = &temp->mNextp;
- }
-
- mHead.mNextp = temp;
- mCurrentp = tcurr;
- mCurrentOperatingp = tcurrop;
- mCount++;
- return TRUE;
-}
-
-
-template <class DATA_TYPE>
-BOOL LLLinkedList<DATA_TYPE>::addDataSorted(DATA_TYPE *data)
-{
- LLLinkNode *tcurr = mCurrentp;
- LLLinkNode *tcurrop = mCurrentOperatingp;
- // don't allow NULL to be passed to addData
- if (!data)
- {
- llerror("NULL pointer passed to LLLinkedList::addDataSorted", 0);
- }
-
- if (checkData(data))
- {
- // restore
- mCurrentp = tcurr;
- mCurrentOperatingp = tcurrop;
- return FALSE;
- }
-
- // mInsertBefore not set?
- if (!mInsertBefore)
- {
- addData(data);
- // restore
- mCurrentp = tcurr;
- mCurrentOperatingp = tcurrop;
- return FALSE;
- }
-
- // empty list?
- if (!mHead.mNextp)
- {
- addData(data);
- // restore
- mCurrentp = tcurr;
- mCurrentOperatingp = tcurrop;
- return TRUE;
- }
-
- // make the new node
- LLLinkNode *temp = new LLLinkNode(data);
-
- // walk the list until mInsertBefore returns true
- mCurrentp = mHead.mNextp;
- while (mCurrentp->mNextp)
- {
- if (mInsertBefore(data, mCurrentp->mDatap))
- {
- // insert before the current one
- temp->mPrevpp = mCurrentp->mPrevpp;
- temp->mNextp = mCurrentp;
- *(temp->mPrevpp) = temp;
- mCurrentp->mPrevpp = &temp->mNextp;
- // restore
- mCurrentp = tcurr;
- mCurrentOperatingp = tcurrop;
- mCount++;
- return TRUE;
- }
- else
- {
- mCurrentp = mCurrentp->mNextp;
- }
- }
-
- // on the last element, add before?
- if (mInsertBefore(data, mCurrentp->mDatap))
- {
- // insert before the current one
- temp->mPrevpp = mCurrentp->mPrevpp;
- temp->mNextp = mCurrentp;
- *(temp->mPrevpp) = temp;
- mCurrentp->mPrevpp = &temp->mNextp;
- // restore
- mCurrentp = tcurr;
- mCurrentOperatingp = tcurrop;
- }
- else // insert after
- {
- temp->mPrevpp = &mCurrentp->mNextp;
- temp->mNextp = NULL;
- mCurrentp->mNextp = temp;
-
- // restore
- mCurrentp = tcurr;
- mCurrentOperatingp = tcurrop;
- }
- mCount++;
- return TRUE;
-}
-
-template <class DATA_TYPE>
-void LLLinkedList<DATA_TYPE>::bubbleSortList()
-{
- // mInsertBefore not set
- if (!mInsertBefore)
- {
- return;
- }
-
- LLLinkNode *tcurr = mCurrentp;
- LLLinkNode *tcurrop = mCurrentOperatingp;
-
- BOOL b_swapped = FALSE;
- DATA_TYPE *temp;
-
- // Nota Bene: This will break if more than 0x7FFFFFFF members in list!
- S32 length = 0x7FFFFFFF;
- S32 count = 0;
- do
- {
- b_swapped = FALSE;
- mCurrentp = mHead.mNextp;
- count = 0;
- while ( (count + 1 < length)
- &&(mCurrentp))
- {
- if (mCurrentp->mNextp)
- {
- if (!mInsertBefore(mCurrentp->mDatap, mCurrentp->mNextp->mDatap))
- {
- // swap data pointers!
- temp = mCurrentp->mDatap;
- mCurrentp->mDatap = mCurrentp->mNextp->mDatap;
- mCurrentp->mNextp->mDatap = temp;
- b_swapped = TRUE;
- }
- }
- else
- {
- break;
- }
- count++;
- mCurrentp = mCurrentp->mNextp;
- }
- length = count;
- } while (b_swapped);
-
- // restore
- mCurrentp = tcurr;
- mCurrentOperatingp = tcurrop;
-}
-
-
-template <class DATA_TYPE>
-BOOL LLLinkedList<DATA_TYPE>::addDataAtEnd(DATA_TYPE *data)
-{
- LLLinkNode *tcurr = mCurrentp;
- LLLinkNode *tcurrop = mCurrentOperatingp;
-
- // don't allow NULL to be passed to addData
- if (!data)
- {
- llerror("NULL pointer passed to LLLinkedList::addData", 0);
- }
-
- if (checkData(data))
- {
- mCurrentp = tcurr;
- mCurrentOperatingp = tcurrop;
- return FALSE;
- }
-
- // make the new node
- LLLinkNode *temp = new LLLinkNode(data);
-
- // add the node to the end of the list
-
- // if empty, add to the front and be done with it
- if (!mHead.mNextp)
- {
- temp->mPrevpp = &mHead.mNextp;
- temp->mNextp = NULL;
- mHead.mNextp = temp;
- }
- else
- {
- // otherwise, walk to the end of the list
- mCurrentp = mHead.mNextp;
- while (mCurrentp->mNextp)
- {
- mCurrentp = mCurrentp->mNextp;
- }
- temp->mPrevpp = &mCurrentp->mNextp;
- temp->mNextp = NULL;
- mCurrentp->mNextp = temp;
- }
-
- // restore
- mCurrentp = tcurr;
- mCurrentOperatingp = tcurrop;
- mCount++;
- return TRUE;
-}
-
-
-// returns number of items in the list
-template <class DATA_TYPE>
-S32 LLLinkedList<DATA_TYPE>::getLength() const
-{
-// S32 length = 0;
-// for (LLLinkNode* temp = mHead.mNextp; temp != NULL; temp = temp->mNextp)
-// {
-// length++;
-// }
- return mCount;
-}
-
-
-template <class DATA_TYPE>
-BOOL LLLinkedList<DATA_TYPE>::isEmpty()
-{
- return (mCount == 0);
-}
-
-
-// search the list starting at mHead.mNextp and remove the link with mDatap == data
-// leave mCurrentp and mCurrentOperatingp on the next entry
-// return TRUE if found, FALSE if not found
-template <class DATA_TYPE>
-BOOL LLLinkedList<DATA_TYPE>::removeData(DATA_TYPE *data)
-{
- BOOL b_found = FALSE;
- // don't allow NULL to be passed to addData
- if (!data)
- {
- llerror("NULL pointer passed to LLLinkedList::removeData", 0);
- }
-
- LLLinkNode *tcurr = mCurrentp;
- LLLinkNode *tcurrop = mCurrentOperatingp;
-
- mCurrentp = mHead.mNextp;
- mCurrentOperatingp = mHead.mNextp;
-
- while (mCurrentOperatingp)
- {
- if (mCurrentOperatingp->mDatap == data)
- {
- b_found = TRUE;
-
- // remove the node
-
- // if there is a next one, fix it
- if (mCurrentOperatingp->mNextp)
- {
- mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp;
- }
- *(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp;
-
- // remove the LLLinkNode
-
- // if we were on the one we want to delete, bump the cached copies
- if (mCurrentOperatingp == tcurrop)
- {
- tcurrop = tcurr = mCurrentOperatingp->mNextp;
- }
- else if (mCurrentOperatingp == tcurr)
- {
- tcurrop = tcurr = mCurrentOperatingp->mNextp;
- }
-
- mCurrentp = mCurrentOperatingp->mNextp;
-
- mCurrentOperatingp->removeData();
- delete mCurrentOperatingp;
- mCurrentOperatingp = mCurrentp;
- mCount--;
- break;
- }
- mCurrentOperatingp = mCurrentOperatingp->mNextp;
- }
- // restore
- mCurrentp = tcurr;
- mCurrentOperatingp = tcurrop;
- return b_found;
-}
-
-// search the list starting at mHead.mNextp and delete the link with mDatap == data
-// leave mCurrentp and mCurrentOperatingp on the next entry
-// return TRUE if found, FALSE if not found
-template <class DATA_TYPE>
-BOOL LLLinkedList<DATA_TYPE>::deleteData(DATA_TYPE *data)
-{
- BOOL b_found = FALSE;
- // don't allow NULL to be passed to addData
- if (!data)
- {
- llerror("NULL pointer passed to LLLinkedList::removeData", 0);
- }
-
- LLLinkNode *tcurr = mCurrentp;
- LLLinkNode *tcurrop = mCurrentOperatingp;
-
- mCurrentp = mHead.mNextp;
- mCurrentOperatingp = mHead.mNextp;
-
- while (mCurrentOperatingp)
- {
- if (mCurrentOperatingp->mDatap == data)
- {
- b_found = TRUE;
-
- // remove the node
- // if there is a next one, fix it
- if (mCurrentOperatingp->mNextp)
- {
- mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp;
- }
- *(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp;
-
- // delete the LLLinkNode
- // if we were on the one we want to delete, bump the cached copies
- if (mCurrentOperatingp == tcurrop)
- {
- tcurrop = tcurr = mCurrentOperatingp->mNextp;
- }
-
- // and delete the associated data
- llassert(mCurrentOperatingp);
- mCurrentp = mCurrentOperatingp->mNextp;
- mCurrentOperatingp->deleteData();
- delete mCurrentOperatingp;
- mCurrentOperatingp = mCurrentp;
- mCount--;
- break;
- }
- mCurrentOperatingp = mCurrentOperatingp->mNextp;
- }
- // restore
- mCurrentp = tcurr;
- mCurrentOperatingp = tcurrop;
- return b_found;
-}
-
- // remove all nodes from the list and delete the associated data
-template <class DATA_TYPE>
-void LLLinkedList<DATA_TYPE>::deleteAllData()
-{
- LLLinkNode *temp;
- // reset mCurrentp
- mCurrentp = mHead.mNextp;
-
- while (mCurrentp)
- {
- temp = mCurrentp->mNextp;
- mCurrentp->deleteData();
- delete mCurrentp;
- mCurrentp = temp;
- }
-
- // reset mHead and mCurrentp
- mHead.mNextp = NULL;
- mCurrentp = mHead.mNextp;
- mCurrentOperatingp = mHead.mNextp;
- mCount = 0;
-}
-
-// remove all nodes from the list but do not delete data
-template <class DATA_TYPE>
-void LLLinkedList<DATA_TYPE>::removeAllNodes()
-{
- LLLinkNode *temp;
- // reset mCurrentp
- mCurrentp = mHead.mNextp;
-
- while (mCurrentp)
- {
- temp = mCurrentp->mNextp;
- mCurrentp->removeData();
- delete mCurrentp;
- mCurrentp = temp;
- }
-
- // reset mHead and mCurrentp
- mHead.mNextp = NULL;
- mCurrentp = mHead.mNextp;
- mCurrentOperatingp = mHead.mNextp;
- mCount = 0;
-}
-
-// check to see if data is in list
-// if TRUE then mCurrentp and mCurrentOperatingp point to data
-template <class DATA_TYPE>
-BOOL LLLinkedList<DATA_TYPE>::checkData(DATA_TYPE *data)
-{
- // reset mCurrentp
- mCurrentp = mHead.mNextp;
-
- while (mCurrentp)
- {
- if (mCurrentp->mDatap == data)
- {
- mCurrentOperatingp = mCurrentp;
- return TRUE;
- }
- mCurrentp = mCurrentp->mNextp;
- }
- mCurrentOperatingp = mCurrentp;
- return FALSE;
-}
-
-// place mCurrentp on first node
-template <class DATA_TYPE>
-void LLLinkedList<DATA_TYPE>::resetList()
-{
- mCurrentp = mHead.mNextp;
- mCurrentOperatingp = mHead.mNextp;
-}
-
-// return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
-template <class DATA_TYPE>
-DATA_TYPE *LLLinkedList<DATA_TYPE>::getCurrentData()
-{
- if (mCurrentp)
- {
- mCurrentOperatingp = mCurrentp;
- mCurrentp = mCurrentp->mNextp;
- return mCurrentOperatingp->mDatap;
- }
- else
- {
- return NULL;
- }
-}
-
-// same as getCurrentData() but a more intuitive name for the operation
-template <class DATA_TYPE>
-DATA_TYPE *LLLinkedList<DATA_TYPE>::getNextData()
-{
- if (mCurrentp)
- {
- mCurrentOperatingp = mCurrentp;
- mCurrentp = mCurrentp->mNextp;
- return mCurrentOperatingp->mDatap;
- }
- else
- {
- return NULL;
- }
-}
-
-// reset the list and return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
-template <class DATA_TYPE>
-DATA_TYPE *LLLinkedList<DATA_TYPE>::getFirstData()
-{
- mCurrentp = mHead.mNextp;
- mCurrentOperatingp = mHead.mNextp;
- if (mCurrentp)
- {
- mCurrentOperatingp = mCurrentp;
- mCurrentp = mCurrentp->mNextp;
- return mCurrentOperatingp->mDatap;
- }
- else
- {
- return NULL;
- }
-}
-
-// Note: n is zero-based
-template <class DATA_TYPE>
-DATA_TYPE *LLLinkedList<DATA_TYPE>::getNthData( U32 n )
-{
- mCurrentOperatingp = mHead.mNextp;
-
- // if empty, return NULL
- if (!mCurrentOperatingp)
- {
- return NULL;
- }
-
- for( U32 i = 0; i < n; i++ )
- {
- mCurrentOperatingp = mCurrentOperatingp->mNextp;
- if( !mCurrentOperatingp )
- {
- return NULL;
- }
- }
-
- mCurrentp = mCurrentOperatingp->mNextp;
- return mCurrentOperatingp->mDatap;
-}
-
-
-// reset the list and return the last data in it, set mCurentOperatingp to that node and bump mCurrentp
-template <class DATA_TYPE>
-DATA_TYPE *LLLinkedList<DATA_TYPE>::getLastData()
-{
- mCurrentOperatingp = mHead.mNextp;
-
- // if empty, return NULL
- if (!mCurrentOperatingp)
- return NULL;
-
- // walk until we're pointing at the last entry
- while (mCurrentOperatingp->mNextp)
- {
- mCurrentOperatingp = mCurrentOperatingp->mNextp;
- }
- mCurrentp = mCurrentOperatingp->mNextp;
- return mCurrentOperatingp->mDatap;
-}
-
-// remove the Node at mCurentOperatingp
-// leave mCurrentp and mCurentOperatingp on the next entry
-// return TRUE if found, FALSE if not found
-template <class DATA_TYPE>
-void LLLinkedList<DATA_TYPE>::removeCurrentData()
-{
- if (mCurrentOperatingp)
- {
- // remove the node
- // if there is a next one, fix it
- if (mCurrentOperatingp->mNextp)
- {
- mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp;
- }
- *(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp;
-
- // remove the LLLinkNode
- mCurrentp = mCurrentOperatingp->mNextp;
-
- mCurrentOperatingp->removeData();
- delete mCurrentOperatingp;
- mCount--;
- mCurrentOperatingp = mCurrentp;
- }
-}
-
-// remove the Node at mCurentOperatingp and add it to newlist
-// leave mCurrentp and mCurentOperatingp on the next entry
-// return TRUE if found, FALSE if not found
-template <class DATA_TYPE>
-void LLLinkedList<DATA_TYPE>::moveCurrentData(LLLinkedList *newlist, BOOL b_sort)
-{
- if (mCurrentOperatingp)
- {
- // remove the node
- // if there is a next one, fix it
- if (mCurrentOperatingp->mNextp)
- {
- mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp;
- }
- *(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp;
-
- // remove the LLLinkNode
- mCurrentp = mCurrentOperatingp->mNextp;
- // move the node to the new list
- newlist->addData(mCurrentOperatingp);
- if (b_sort)
- bubbleSortList();
- mCurrentOperatingp = mCurrentp;
- }
-}
-
-template <class DATA_TYPE>
-BOOL LLLinkedList<DATA_TYPE>::moveData(DATA_TYPE *data, LLLinkedList *newlist, BOOL b_sort)
-{
- BOOL b_found = FALSE;
- // don't allow NULL to be passed to addData
- if (!data)
- {
- llerror("NULL pointer passed to LLLinkedList::removeData", 0);
- }
-
- LLLinkNode *tcurr = mCurrentp;
- LLLinkNode *tcurrop = mCurrentOperatingp;
-
- mCurrentp = mHead.mNextp;
- mCurrentOperatingp = mHead.mNextp;
-
- while (mCurrentOperatingp)
- {
- if (mCurrentOperatingp->mDatap == data)
- {
- b_found = TRUE;
-
- // remove the node
-
- // if there is a next one, fix it
- if (mCurrentOperatingp->mNextp)
- {
- mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp;
- }
- *(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp;
-
- // if we were on the one we want to delete, bump the cached copies
- if ( (mCurrentOperatingp == tcurrop)
- ||(mCurrentOperatingp == tcurr))
- {
- tcurrop = tcurr = mCurrentOperatingp->mNextp;
- }
-
- // remove the LLLinkNode
- mCurrentp = mCurrentOperatingp->mNextp;
- // move the node to the new list
- newlist->addData(mCurrentOperatingp);
- if (b_sort)
- newlist->bubbleSortList();
- mCurrentOperatingp = mCurrentp;
- break;
- }
- mCurrentOperatingp = mCurrentOperatingp->mNextp;
- }
- // restore
- mCurrentp = tcurr;
- mCurrentOperatingp = tcurrop;
- return b_found;
-}
-
-// delete the Node at mCurentOperatingp
-// leave mCurrentp anf mCurentOperatingp on the next entry
-// return TRUE if found, FALSE if not found
-template <class DATA_TYPE>
-void LLLinkedList<DATA_TYPE>::deleteCurrentData()
-{
- if (mCurrentOperatingp)
- {
- // remove the node
- // if there is a next one, fix it
- if (mCurrentOperatingp->mNextp)
- {
- mCurrentOperatingp->mNextp->mPrevpp = mCurrentOperatingp->mPrevpp;
- }
- *(mCurrentOperatingp->mPrevpp) = mCurrentOperatingp->mNextp;
-
- // remove the LLLinkNode
- mCurrentp = mCurrentOperatingp->mNextp;
-
- mCurrentOperatingp->deleteData();
- if (mCurrentOperatingp->mDatap)
- llerror("This is impossible!", 0);
- delete mCurrentOperatingp;
- mCurrentOperatingp = mCurrentp;
- mCount--;
- }
-}
-
-#endif
diff --git a/indra/llcommon/ll_template_cast.h b/indra/llcommon/ll_template_cast.h
deleted file mode 100755
index c8f9a2f7eb..0000000000
--- a/indra/llcommon/ll_template_cast.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/**
- * @file ll_template_cast.h
- * @author Nat Goodspeed
- * @date 2009-11-21
- * @brief Define ll_template_cast function
- *
- * $LicenseInfo:firstyear=2009&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#if ! defined(LL_LL_TEMPLATE_CAST_H)
-#define LL_LL_TEMPLATE_CAST_H
-
-/**
- * Implementation for ll_template_cast() (q.v.).
- *
- * Default implementation: trying to cast two completely unrelated types
- * returns 0. Typically you'd specify T and U as pointer types, but in fact T
- * can be any type that can be initialized with 0.
- */
-template <typename T, typename U>
-struct ll_template_cast_impl
-{
- T operator()(U)
- {
- return 0;
- }
-};
-
-/**
- * ll_template_cast<T>(some_value) is for use in a template function when
- * some_value might be of arbitrary type, but you want to recognize type T
- * specially.
- *
- * It's designed for use with pointer types. Example:
- * @code
- * struct SpecialClass
- * {
- * void someMethod(const std::string&) const;
- * };
- *
- * template <class REALCLASS>
- * void somefunc(const REALCLASS& instance)
- * {
- * const SpecialClass* ptr = ll_template_cast<const SpecialClass*>(&instance);
- * if (ptr)
- * {
- * ptr->someMethod("Call method only available on SpecialClass");
- * }
- * }
- * @endcode
- *
- * Why is this better than dynamic_cast<>? Because unless OtherClass is
- * polymorphic, the following won't even compile (gcc 4.0.1):
- * @code
- * OtherClass other;
- * SpecialClass* ptr = dynamic_cast<SpecialClass*>(&other);
- * @endcode
- * to say nothing of this:
- * @code
- * void function(int);
- * SpecialClass* ptr = dynamic_cast<SpecialClass*>(&function);
- * @endcode
- * ll_template_cast handles these kinds of cases by returning 0.
- */
-template <typename T, typename U>
-T ll_template_cast(U value)
-{
- return ll_template_cast_impl<T, U>()(value);
-}
-
-/**
- * Implementation for ll_template_cast() (q.v.).
- *
- * Implementation for identical types: return same value.
- */
-template <typename T>
-struct ll_template_cast_impl<T, T>
-{
- T operator()(T value)
- {
- return value;
- }
-};
-
-/**
- * LL_TEMPLATE_CONVERTIBLE(dest, source) asserts that, for a value @c s of
- * type @c source, <tt>ll_template_cast<dest>(s)</tt> will return @c s --
- * presuming that @c source can be converted to @c dest by the normal rules of
- * C++.
- *
- * By default, <tt>ll_template_cast<dest>(s)</tt> will return 0 unless @c s's
- * type is literally identical to @c dest. (This is because of the
- * straightforward application of template specialization rules.) That can
- * lead to surprising results, e.g.:
- *
- * @code
- * Foo myFoo;
- * const Foo* fooptr = ll_template_cast<const Foo*>(&myFoo);
- * @endcode
- *
- * Here @c fooptr will be 0 because <tt>&myFoo</tt> is of type <tt>Foo*</tt>
- * -- @em not <tt>const Foo*</tt>. (Declaring <tt>const Foo myFoo;</tt> would
- * force the compiler to do the right thing.)
- *
- * More disappointingly:
- * @code
- * struct Base {};
- * struct Subclass: public Base {};
- * Subclass object;
- * Base* ptr = ll_template_cast<Base*>(&object);
- * @endcode
- *
- * Here @c ptr will be 0 because <tt>&object</tt> is of type
- * <tt>Subclass*</tt> rather than <tt>Base*</tt>. We @em want this cast to
- * succeed, but without our help ll_template_cast can't recognize it.
- *
- * The following would suffice:
- * @code
- * LL_TEMPLATE_CONVERTIBLE(Base*, Subclass*);
- * ...
- * Base* ptr = ll_template_cast<Base*>(&object);
- * @endcode
- *
- * However, as noted earlier, this is easily fooled:
- * @code
- * const Base* ptr = ll_template_cast<const Base*>(&object);
- * @endcode
- * would still produce 0 because we haven't yet seen:
- * @code
- * LL_TEMPLATE_CONVERTIBLE(const Base*, Subclass*);
- * @endcode
- *
- * @TODO
- * This macro should use Boost type_traits facilities for stripping and
- * re-adding @c const and @c volatile qualifiers so that invoking
- * LL_TEMPLATE_CONVERTIBLE(dest, source) will automatically generate all
- * permitted permutations. It's really not fair to the coder to require
- * separate:
- * @code
- * LL_TEMPLATE_CONVERTIBLE(Base*, Subclass*);
- * LL_TEMPLATE_CONVERTIBLE(const Base*, Subclass*);
- * LL_TEMPLATE_CONVERTIBLE(const Base*, const Subclass*);
- * @endcode
- *
- * (Naturally we omit <tt>LL_TEMPLATE_CONVERTIBLE(Base*, const Subclass*)</tt>
- * because that's not permitted by normal C++ assignment anyway.)
- */
-#define LL_TEMPLATE_CONVERTIBLE(DEST, SOURCE) \
-template <> \
-struct ll_template_cast_impl<DEST, SOURCE> \
-{ \
- DEST operator()(SOURCE wrapper) \
- { \
- return wrapper; \
- } \
-}
-
-#endif /* ! defined(LL_LL_TEMPLATE_CAST_H) */
diff --git a/indra/llcommon/llaccountingcost.h b/indra/llcommon/llaccountingcost.h
deleted file mode 100755
index 0ef3b50c6d..0000000000
--- a/indra/llcommon/llaccountingcost.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * @file llaccountingcost.h
- * @
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2011, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_ACCOUNTINGQUOTA_H
-#define LL_ACCOUNTINGQUOTA_H
-
-struct ParcelQuota
-{
- ParcelQuota( F32 ownerRenderCost, F32 ownerPhysicsCost, F32 ownerNetworkCost, F32 ownerSimulationCost,
- F32 groupRenderCost, F32 groupPhysicsCost, F32 groupNetworkCost, F32 groupSimulationCost,
- F32 otherRenderCost, F32 otherPhysicsCost, F32 otherNetworkCost, F32 otherSimulationCost,
- F32 tempRenderCost, F32 tempPhysicsCost, F32 tempNetworkCost, F32 tempSimulationCost,
- F32 selectedRenderCost, F32 selectedPhysicsCost, F32 selectedNetworkCost, F32 selectedSimulationCost,
- F32 parcelCapacity )
- : mOwnerRenderCost( ownerRenderCost ), mOwnerPhysicsCost( ownerPhysicsCost )
- , mOwnerNetworkCost( ownerNetworkCost ), mOwnerSimulationCost( ownerSimulationCost )
- , mGroupRenderCost( groupRenderCost ), mGroupPhysicsCost( groupPhysicsCost )
- , mGroupNetworkCost( groupNetworkCost ), mGroupSimulationCost( groupSimulationCost )
- , mOtherRenderCost( otherRenderCost ), mOtherPhysicsCost( otherPhysicsCost )
- , mOtherNetworkCost( otherNetworkCost ), mOtherSimulationCost( otherSimulationCost )
- , mTempRenderCost( tempRenderCost ), mTempPhysicsCost( tempPhysicsCost )
- , mTempNetworkCost( tempNetworkCost ), mTempSimulationCost( tempSimulationCost )
- , mSelectedRenderCost( tempRenderCost ), mSelectedPhysicsCost( tempPhysicsCost )
- , mSelectedNetworkCost( tempNetworkCost ), mSelectedSimulationCost( selectedSimulationCost )
- , mParcelCapacity( parcelCapacity )
- {
- }
-
- ParcelQuota(){}
- F32 mOwnerRenderCost, mOwnerPhysicsCost, mOwnerNetworkCost, mOwnerSimulationCost;
- F32 mGroupRenderCost, mGroupPhysicsCost, mGroupNetworkCost, mGroupSimulationCost;
- F32 mOtherRenderCost, mOtherPhysicsCost, mOtherNetworkCost, mOtherSimulationCost;
- F32 mTempRenderCost, mTempPhysicsCost, mTempNetworkCost, mTempSimulationCost;
- F32 mSelectedRenderCost, mSelectedPhysicsCost, mSelectedNetworkCost, mSelectedSimulationCost;
- F32 mParcelCapacity;
-};
-
-//SelectionQuota atm does not require a id
-struct SelectionCost
-{
- SelectionCost( /*LLTransactionID transactionId, */ F32 physicsCost, F32 networkCost, F32 simulationCost )
- //: mTransactionId( transactionId)
- : mPhysicsCost( physicsCost )
- , mNetworkCost( networkCost )
- , mSimulationCost( simulationCost )
- {
- }
- SelectionCost()
- : mPhysicsCost( 0.0f )
- , mNetworkCost( 0.0f )
- , mSimulationCost( 0.0f )
- {}
-
- F32 mPhysicsCost, mNetworkCost, mSimulationCost;
- //LLTransactionID mTransactionId;
-};
-
-typedef enum { Roots = 0 , Prims } eSelectionType;
-
-#endif
-
-
-
diff --git a/indra/llcommon/llagentconstants.h b/indra/llcommon/llagentconstants.h
deleted file mode 100755
index cd237da4eb..0000000000
--- a/indra/llcommon/llagentconstants.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/**
- * @file llagentconstants.h
- * @author James Cook, Andrew Meadows, Richard Nelson
- * @brief Shared constants through the system for agents.
- *
- * $LicenseInfo:firstyear=2006&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLAGENTCONSTANTS_H
-#define LL_LLAGENTCONSTANTS_H
-
-const U32 CONTROL_AT_POS_INDEX = 0;
-const U32 CONTROL_AT_NEG_INDEX = 1;
-const U32 CONTROL_LEFT_POS_INDEX = 2;
-const U32 CONTROL_LEFT_NEG_INDEX = 3;
-const U32 CONTROL_UP_POS_INDEX = 4;
-const U32 CONTROL_UP_NEG_INDEX = 5;
-const U32 CONTROL_PITCH_POS_INDEX = 6;
-const U32 CONTROL_PITCH_NEG_INDEX = 7;
-const U32 CONTROL_YAW_POS_INDEX = 8;
-const U32 CONTROL_YAW_NEG_INDEX = 9;
-const U32 CONTROL_FAST_AT_INDEX = 10;
-const U32 CONTROL_FAST_LEFT_INDEX = 11;
-const U32 CONTROL_FAST_UP_INDEX = 12;
-const U32 CONTROL_FLY_INDEX = 13;
-const U32 CONTROL_STOP_INDEX = 14;
-const U32 CONTROL_FINISH_ANIM_INDEX = 15;
-const U32 CONTROL_STAND_UP_INDEX = 16;
-const U32 CONTROL_SIT_ON_GROUND_INDEX = 17;
-const U32 CONTROL_MOUSELOOK_INDEX = 18;
-const U32 CONTROL_NUDGE_AT_POS_INDEX = 19;
-const U32 CONTROL_NUDGE_AT_NEG_INDEX = 20;
-const U32 CONTROL_NUDGE_LEFT_POS_INDEX = 21;
-const U32 CONTROL_NUDGE_LEFT_NEG_INDEX = 22;
-const U32 CONTROL_NUDGE_UP_POS_INDEX = 23;
-const U32 CONTROL_NUDGE_UP_NEG_INDEX = 24;
-const U32 CONTROL_TURN_LEFT_INDEX = 25;
-const U32 CONTROL_TURN_RIGHT_INDEX = 26;
-const U32 CONTROL_AWAY_INDEX = 27;
-const U32 CONTROL_LBUTTON_DOWN_INDEX = 28;
-const U32 CONTROL_LBUTTON_UP_INDEX = 29;
-const U32 CONTROL_ML_LBUTTON_DOWN_INDEX = 30;
-const U32 CONTROL_ML_LBUTTON_UP_INDEX = 31;
-const U32 TOTAL_CONTROLS = 32;
-
-const U32 AGENT_CONTROL_AT_POS = 0x1 << CONTROL_AT_POS_INDEX; // 0x00000001
-const U32 AGENT_CONTROL_AT_NEG = 0x1 << CONTROL_AT_NEG_INDEX; // 0x00000002
-const U32 AGENT_CONTROL_LEFT_POS = 0x1 << CONTROL_LEFT_POS_INDEX; // 0x00000004
-const U32 AGENT_CONTROL_LEFT_NEG = 0x1 << CONTROL_LEFT_NEG_INDEX; // 0x00000008
-const U32 AGENT_CONTROL_UP_POS = 0x1 << CONTROL_UP_POS_INDEX; // 0x00000010
-const U32 AGENT_CONTROL_UP_NEG = 0x1 << CONTROL_UP_NEG_INDEX; // 0x00000020
-const U32 AGENT_CONTROL_PITCH_POS = 0x1 << CONTROL_PITCH_POS_INDEX; // 0x00000040
-const U32 AGENT_CONTROL_PITCH_NEG = 0x1 << CONTROL_PITCH_NEG_INDEX; // 0x00000080
-const U32 AGENT_CONTROL_YAW_POS = 0x1 << CONTROL_YAW_POS_INDEX; // 0x00000100
-const U32 AGENT_CONTROL_YAW_NEG = 0x1 << CONTROL_YAW_NEG_INDEX; // 0x00000200
-
-const U32 AGENT_CONTROL_FAST_AT = 0x1 << CONTROL_FAST_AT_INDEX; // 0x00000400
-const U32 AGENT_CONTROL_FAST_LEFT = 0x1 << CONTROL_FAST_LEFT_INDEX; // 0x00000800
-const U32 AGENT_CONTROL_FAST_UP = 0x1 << CONTROL_FAST_UP_INDEX; // 0x00001000
-
-const U32 AGENT_CONTROL_FLY = 0x1 << CONTROL_FLY_INDEX; // 0x00002000
-const U32 AGENT_CONTROL_STOP = 0x1 << CONTROL_STOP_INDEX; // 0x00004000
-const U32 AGENT_CONTROL_FINISH_ANIM = 0x1 << CONTROL_FINISH_ANIM_INDEX; // 0x00008000
-const U32 AGENT_CONTROL_STAND_UP = 0x1 << CONTROL_STAND_UP_INDEX; // 0x00010000
-const U32 AGENT_CONTROL_SIT_ON_GROUND = 0x1 << CONTROL_SIT_ON_GROUND_INDEX; // 0x00020000
-const U32 AGENT_CONTROL_MOUSELOOK = 0x1 << CONTROL_MOUSELOOK_INDEX; // 0x00040000
-
-const U32 AGENT_CONTROL_NUDGE_AT_POS = 0x1 << CONTROL_NUDGE_AT_POS_INDEX; // 0x00080000
-const U32 AGENT_CONTROL_NUDGE_AT_NEG = 0x1 << CONTROL_NUDGE_AT_NEG_INDEX; // 0x00100000
-const U32 AGENT_CONTROL_NUDGE_LEFT_POS = 0x1 << CONTROL_NUDGE_LEFT_POS_INDEX; // 0x00200000
-const U32 AGENT_CONTROL_NUDGE_LEFT_NEG = 0x1 << CONTROL_NUDGE_LEFT_NEG_INDEX; // 0x00400000
-const U32 AGENT_CONTROL_NUDGE_UP_POS = 0x1 << CONTROL_NUDGE_UP_POS_INDEX; // 0x00800000
-const U32 AGENT_CONTROL_NUDGE_UP_NEG = 0x1 << CONTROL_NUDGE_UP_NEG_INDEX; // 0x01000000
-const U32 AGENT_CONTROL_TURN_LEFT = 0x1 << CONTROL_TURN_LEFT_INDEX; // 0x02000000
-const U32 AGENT_CONTROL_TURN_RIGHT = 0x1 << CONTROL_TURN_RIGHT_INDEX; // 0x04000000
-
-const U32 AGENT_CONTROL_AWAY = 0x1 << CONTROL_AWAY_INDEX; // 0x08000000
-
-const U32 AGENT_CONTROL_LBUTTON_DOWN = 0x1 << CONTROL_LBUTTON_DOWN_INDEX; // 0x10000000
-const U32 AGENT_CONTROL_LBUTTON_UP = 0x1 << CONTROL_LBUTTON_UP_INDEX; // 0x20000000
-const U32 AGENT_CONTROL_ML_LBUTTON_DOWN = 0x1 << CONTROL_ML_LBUTTON_DOWN_INDEX; // 0x40000000
-const U32 AGENT_CONTROL_ML_LBUTTON_UP = ((U32)0x1) << CONTROL_ML_LBUTTON_UP_INDEX; // 0x80000000
-
-const U32 AGENT_CONTROL_AT = AGENT_CONTROL_AT_POS
- | AGENT_CONTROL_AT_NEG
- | AGENT_CONTROL_NUDGE_AT_POS
- | AGENT_CONTROL_NUDGE_AT_NEG;
-
-const U32 AGENT_CONTROL_LEFT = AGENT_CONTROL_LEFT_POS
- | AGENT_CONTROL_LEFT_NEG
- | AGENT_CONTROL_NUDGE_LEFT_POS
- | AGENT_CONTROL_NUDGE_LEFT_NEG;
-
-const U32 AGENT_CONTROL_UP = AGENT_CONTROL_UP_POS
- | AGENT_CONTROL_UP_NEG
- | AGENT_CONTROL_NUDGE_UP_POS
- | AGENT_CONTROL_NUDGE_UP_NEG;
-
-const U32 AGENT_CONTROL_HORIZONTAL = AGENT_CONTROL_AT
- | AGENT_CONTROL_LEFT;
-
-const U32 AGENT_CONTROL_NOT_USED_BY_LSL = AGENT_CONTROL_FLY
- | AGENT_CONTROL_STOP
- | AGENT_CONTROL_FINISH_ANIM
- | AGENT_CONTROL_STAND_UP
- | AGENT_CONTROL_SIT_ON_GROUND
- | AGENT_CONTROL_MOUSELOOK
- | AGENT_CONTROL_AWAY;
-
-const U32 AGENT_CONTROL_MOVEMENT = AGENT_CONTROL_AT
- | AGENT_CONTROL_LEFT
- | AGENT_CONTROL_UP;
-
-const U32 AGENT_CONTROL_ROTATION = AGENT_CONTROL_PITCH_POS
- | AGENT_CONTROL_PITCH_NEG
- | AGENT_CONTROL_YAW_POS
- | AGENT_CONTROL_YAW_NEG;
-
-const U32 AGENT_CONTROL_NUDGE = AGENT_CONTROL_NUDGE_AT_POS
- | AGENT_CONTROL_NUDGE_AT_NEG
- | AGENT_CONTROL_NUDGE_LEFT_POS
- | AGENT_CONTROL_NUDGE_LEFT_NEG;
-
-
-// move these up so that we can hide them in "State" for object updates
-// (for now)
-const U32 AGENT_ATTACH_OFFSET = 4;
-const U32 AGENT_ATTACH_MASK = 0xf << AGENT_ATTACH_OFFSET;
-const U32 AGENT_ATTACH_CLEAR = 0x00;
-
-// RN: this method swaps the upper and lower nibbles to maintain backward
-// compatibility with old objects that only used the upper nibble
-#define ATTACHMENT_ID_FROM_STATE(state) ((S32)((((U8)state & AGENT_ATTACH_MASK) >> 4) | (((U8)state & ~AGENT_ATTACH_MASK) << 4)))
-
-// test state for use in testing grabbing the camera
-const U32 AGENT_CAMERA_OBJECT = 0x1 << 3;
-
-const F32 MAX_ATTACHMENT_DIST = 3.5f; // meters?
-
-#endif
diff --git a/indra/llcommon/llalignedarray.h b/indra/llcommon/llalignedarray.h
index ed8fd31205..b68e9e0f82 100644
--- a/indra/llcommon/llalignedarray.h
+++ b/indra/llcommon/llalignedarray.h
@@ -60,7 +60,7 @@ LLAlignedArray<T, alignment>::LLAlignedArray()
template <class T, U32 alignment>
LLAlignedArray<T, alignment>::~LLAlignedArray()
{
- ll_aligned_free(mArray);
+ ll_aligned_free<alignment>(mArray);
mArray = NULL;
mElementCount = 0;
mCapacity = 0;
@@ -74,7 +74,7 @@ void LLAlignedArray<T, alignment>::push_back(const T& elem)
{
mCapacity++;
mCapacity *= 2;
- T* new_buf = (T*) ll_aligned_malloc(mCapacity*sizeof(T), alignment);
+ T* new_buf = (T*) ll_aligned_malloc<alignment>(mCapacity*sizeof(T));
if (mArray)
{
ll_memcpy_nonaliased_aligned_16((char*)new_buf, (char*)mArray, sizeof(T)*mElementCount);
@@ -86,7 +86,7 @@ void LLAlignedArray<T, alignment>::push_back(const T& elem)
mArray[mElementCount++] = elem;
//delete old array here to prevent error on a.push_back(a[0])
- ll_aligned_free(old_buf);
+ ll_aligned_free<alignment>(old_buf);
}
template <class T, U32 alignment>
@@ -95,11 +95,11 @@ void LLAlignedArray<T, alignment>::resize(U32 size)
if (mCapacity < size)
{
mCapacity = size+mCapacity*2;
- T* new_buf = mCapacity > 0 ? (T*) ll_aligned_malloc(mCapacity*sizeof(T), alignment) : NULL;
+ T* new_buf = mCapacity > 0 ? (T*) ll_aligned_malloc<alignment>(mCapacity*sizeof(T)) : NULL;
if (mArray)
{
ll_memcpy_nonaliased_aligned_16((char*) new_buf, (char*) mArray, sizeof(T)*mElementCount);
- ll_aligned_free(mArray);
+ ll_aligned_free<alignment>(mArray);
}
/*for (U32 i = mElementCount; i < mCapacity; ++i)
diff --git a/indra/llcommon/llallocator_heap_profile.cpp b/indra/llcommon/llallocator_heap_profile.cpp
index b574ef668b..b2eafde1aa 100755
--- a/indra/llcommon/llallocator_heap_profile.cpp
+++ b/indra/llcommon/llallocator_heap_profile.cpp
@@ -59,7 +59,7 @@ void LLAllocatorHeapProfile::parse(std::string const & prof_text)
{
// *TODO - determine if there should be some better error state than
// mLines being empty. -brad
- llwarns << "invalid heap profile data passed into parser." << llendl;
+ LL_WARNS() << "invalid heap profile data passed into parser." << LL_ENDL;
return;
}
diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp
index 63a38f2884..5a40845e7d 100755
--- a/indra/llcommon/llapp.cpp
+++ b/indra/llcommon/llapp.cpp
@@ -209,8 +209,8 @@ bool LLApp::parseCommandOptions(int argc, char** argv)
{
if(argv[ii][0] != '-')
{
- llinfos << "Did not find option identifier while parsing token: "
- << argv[ii] << llendl;
+ LL_INFOS() << "Did not find option identifier while parsing token: "
+ << argv[ii] << LL_ENDL;
return false;
}
int offset = 1;
@@ -348,7 +348,7 @@ void LLApp::setupErrorHandling(bool second_instance)
}
else
{
- llwarns << "adding breakpad exception handler" << llendl;
+ LL_WARNS() << "adding breakpad exception handler" << LL_ENDL;
std::wstring wpipe_name;
wpipe_name = mCrashReportPipeStr + wstringize(getPid());
@@ -463,7 +463,7 @@ void LLApp::startErrorThread()
//
if(!mThreadErrorp)
{
- llinfos << "Starting error thread" << llendl;
+ LL_INFOS() << "Starting error thread" << LL_ENDL;
mThreadErrorp = new LLErrorThread();
mThreadErrorp->setUserData((void *) this);
mThreadErrorp->start();
@@ -483,7 +483,7 @@ void LLApp::runErrorHandler()
LLApp::sErrorHandler();
}
- //llinfos << "App status now STOPPED" << llendl;
+ //LL_INFOS() << "App status now STOPPED" << LL_ENDL;
LLApp::setStopped();
}
@@ -544,7 +544,7 @@ void LLApp::setQuitting()
if (!isExiting())
{
// If we're already exiting, we don't want to reset our state back to quitting.
- llinfos << "Setting app state to QUITTING" << llendl;
+ LL_INFOS() << "Setting app state to QUITTING" << LL_ENDL;
setStatus(APP_STATUS_QUITTING);
}
}
@@ -629,7 +629,7 @@ LONG WINAPI default_windows_exception_handler(struct _EXCEPTION_POINTERS *except
if (LLApp::isError())
{
- llwarns << "Got another fatal signal while in the error handler, die now!" << llendl;
+ LL_WARNS() << "Got another fatal signal while in the error handler, die now!" << LL_ENDL;
retval = EXCEPTION_EXECUTE_HANDLER;
return retval;
}
@@ -675,7 +675,7 @@ BOOL ConsoleCtrlHandler(DWORD fdwCtrlType)
// We're already trying to die, just ignore this signal
if (LLApp::sLogInSignal)
{
- llinfos << "Signal handler - Already trying to quit, ignoring signal!" << llendl;
+ LL_INFOS() << "Signal handler - Already trying to quit, ignoring signal!" << LL_ENDL;
}
return TRUE;
}
@@ -776,7 +776,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
if (LLApp::sLogInSignal)
{
- llinfos << "Signal handler - Got signal " << signum << " - " << apr_signal_description_get(signum) << llendl;
+ LL_INFOS() << "Signal handler - Got signal " << signum << " - " << apr_signal_description_get(signum) << LL_ENDL;
}
@@ -785,7 +785,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
case SIGCHLD:
if (LLApp::sLogInSignal)
{
- llinfos << "Signal handler - Got SIGCHLD from " << info->si_pid << llendl;
+ LL_INFOS() << "Signal handler - Got SIGCHLD from " << info->si_pid << LL_ENDL;
}
return;
@@ -793,7 +793,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
// Abort just results in termination of the app, no funky error handling.
if (LLApp::sLogInSignal)
{
- llwarns << "Signal handler - Got SIGABRT, terminating" << llendl;
+ LL_WARNS() << "Signal handler - Got SIGABRT, terminating" << LL_ENDL;
}
clear_signals();
raise(signum);
@@ -803,7 +803,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
case SIGTERM:
if (LLApp::sLogInSignal)
{
- llwarns << "Signal handler - Got SIGINT, HUP, or TERM, exiting gracefully" << llendl;
+ LL_WARNS() << "Signal handler - Got SIGINT, HUP, or TERM, exiting gracefully" << LL_ENDL;
}
// Graceful exit
// Just set our state to quitting, not error
@@ -812,7 +812,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
// We're already trying to die, just ignore this signal
if (LLApp::sLogInSignal)
{
- llinfos << "Signal handler - Already trying to quit, ignoring signal!" << llendl;
+ LL_INFOS() << "Signal handler - Already trying to quit, ignoring signal!" << LL_ENDL;
}
return;
}
@@ -834,7 +834,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
// Smackdown treated just like any other app termination, for now
if (LLApp::sLogInSignal)
{
- llwarns << "Signal handler - Handling smackdown signal!" << llendl;
+ LL_WARNS() << "Signal handler - Handling smackdown signal!" << LL_ENDL;
}
else
{
@@ -848,7 +848,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
if (LLApp::sLogInSignal)
{
- llwarns << "Signal handler - Handling fatal signal!" << llendl;
+ LL_WARNS() << "Signal handler - Handling fatal signal!" << LL_ENDL;
}
if (LLApp::isError())
{
@@ -858,7 +858,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
if (LLApp::sLogInSignal)
{
- llwarns << "Signal handler - Got another fatal signal while in the error handler, die now!" << llendl;
+ LL_WARNS() << "Signal handler - Got another fatal signal while in the error handler, die now!" << LL_ENDL;
}
raise(signum);
return;
@@ -866,13 +866,13 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
if (LLApp::sLogInSignal)
{
- llwarns << "Signal handler - Flagging error status and waiting for shutdown" << llendl;
+ LL_WARNS() << "Signal handler - Flagging error status and waiting for shutdown" << LL_ENDL;
}
if (LLApp::isCrashloggerDisabled()) // Don't gracefully handle any signal, crash and core for a gdb post mortem
{
clear_signals();
- llwarns << "Fatal signal received, not handling the crash here, passing back to operating system" << llendl;
+ LL_WARNS() << "Fatal signal received, not handling the crash here, passing back to operating system" << LL_ENDL;
raise(signum);
return;
}
@@ -887,7 +887,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
if (LLApp::sLogInSignal)
{
- llwarns << "Signal handler - App is stopped, reraising signal" << llendl;
+ LL_WARNS() << "Signal handler - App is stopped, reraising signal" << LL_ENDL;
}
clear_signals();
raise(signum);
@@ -895,7 +895,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
} else {
if (LLApp::sLogInSignal)
{
- llinfos << "Signal handler - Unhandled signal " << signum << ", ignoring!" << llendl;
+ LL_INFOS() << "Signal handler - Unhandled signal " << signum << ", ignoring!" << LL_ENDL;
}
}
}
@@ -929,7 +929,7 @@ bool unix_minidump_callback(const google_breakpad::MinidumpDescriptor& minidump_
strncpy(path, minidump_desc.path(), remaining);
- llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl;
+ LL_INFOS() << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << LL_ENDL;
LLApp::runErrorHandler();
#ifndef LL_RELEASE_FOR_DOWNLOAD
@@ -975,7 +975,7 @@ bool unix_post_minidump_callback(const char *dump_dir,
strncpy(path, ".dmp", remaining);
}
- llinfos << "generated minidump: " << path << llendl;
+ LL_INFOS() << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << LL_ENDL;
LLApp::runErrorHandler();
#ifndef LL_RELEASE_FOR_DOWNLOAD
@@ -1019,16 +1019,16 @@ bool windows_post_minidump_callback(const wchar_t* dump_path,
strncpy(path, ".dmp", remaining);
}
- llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl;
+ LL_INFOS() << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << LL_ENDL;
// *NOTE:Mani - this code is stolen from LLApp, where its never actually used.
//OSMessageBox("Attach Debugger Now", "Error", OSMB_OK);
// *TODO: Translate the signals/exceptions into cross-platform stuff
// Windows implementation
- llinfos << "Entering Windows Exception Handler..." << llendl;
+ LL_INFOS() << "Entering Windows Exception Handler..." << LL_ENDL;
if (LLApp::isError())
{
- llwarns << "Got another fatal signal while in the error handler, die now!" << llendl;
+ LL_WARNS() << "Got another fatal signal while in the error handler, die now!" << LL_ENDL;
}
// Flag status to error, so thread_error starts its work
diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h
index 3f7bf2ca47..d9933b3d36 100755
--- a/indra/llcommon/llapp.h
+++ b/indra/llcommon/llapp.h
@@ -30,7 +30,6 @@
#include <map>
#include "llrun.h"
#include "llsd.h"
-#include "lloptioninterface.h"
// Forward declarations
template <typename Type> class LLAtomic32;
typedef LLAtomic32<U32> LLAtomicU32;
@@ -55,7 +54,7 @@ namespace google_breakpad {
class ExceptionHandler; // See exception_handler.h
}
-class LL_COMMON_API LLApp : public LLOptionInterface
+class LL_COMMON_API LLApp
{
friend class LLErrorThread;
public:
@@ -104,7 +103,7 @@ public:
* @param name The name of the option.
* @return Returns the option data.
*/
- virtual LLSD getOption(const std::string& name) const;
+ LLSD getOption(const std::string& name) const;
/**
* @brief Parse command line options and insert them into
diff --git a/indra/llcommon/llapr.cpp b/indra/llcommon/llapr.cpp
index b7815b0e35..a548c96002 100755
--- a/indra/llcommon/llapr.cpp
+++ b/indra/llcommon/llapr.cpp
@@ -29,6 +29,7 @@
#include "linden_common.h"
#include "llapr.h"
#include "apr_dso.h"
+#include "llthreadlocalstorage.h"
apr_pool_t *gAPRPoolp = NULL; // Global APR memory pool
LLVolatileAPRPool *LLAPRFile::sAPRFilePoolp = NULL ; //global volatile APR memory pool.
@@ -37,12 +38,15 @@ apr_thread_mutex_t *gCallStacksLogMutexp = NULL;
const S32 FULL_VOLATILE_APR_POOL = 1024 ; //number of references to LLVolatileAPRPool
+bool gAPRInitialized = false;
+
void ll_init_apr()
{
+ // Initialize APR and create the global pool
+ apr_initialize();
+
if (!gAPRPoolp)
{
- // Initialize APR and create the global pool
- apr_initialize();
apr_pool_create(&gAPRPoolp, NULL);
// Initialize the logging mutex
@@ -54,11 +58,21 @@ void ll_init_apr()
{
LLAPRFile::sAPRFilePoolp = new LLVolatileAPRPool(FALSE) ;
}
+
+ LLThreadLocalPointerBase::initAllThreadLocalStorage();
+ gAPRInitialized = true;
}
+bool ll_apr_is_initialized()
+{
+ return gAPRInitialized;
+}
+
void ll_cleanup_apr()
{
+ gAPRInitialized = false;
+
LL_INFOS("APR") << "Cleaning up APR" << LL_ENDL;
if (gLogMutexp)
@@ -77,6 +91,9 @@ void ll_cleanup_apr()
apr_thread_mutex_destroy(gCallStacksLogMutexp);
gCallStacksLogMutexp = NULL;
}
+
+ LLThreadLocalPointerBase::destroyAllThreadLocalStorage();
+
if (gAPRPoolp)
{
apr_pool_destroy(gAPRPoolp);
@@ -429,7 +446,7 @@ S32 LLAPRFile::read(void *buf, S32 nbytes)
{
if(!mFile)
{
- llwarns << "apr mFile is removed by somebody else. Can not read." << llendl ;
+ LL_WARNS() << "apr mFile is removed by somebody else. Can not read." << LL_ENDL ;
return 0;
}
@@ -451,7 +468,7 @@ S32 LLAPRFile::write(const void *buf, S32 nbytes)
{
if(!mFile)
{
- llwarns << "apr mFile is removed by somebody else. Can not write." << llendl ;
+ LL_WARNS() << "apr mFile is removed by somebody else. Can not write." << LL_ENDL ;
return 0;
}
diff --git a/indra/llcommon/llapr.h b/indra/llcommon/llapr.h
index 1fe7d98472..b1b0fc4718 100755
--- a/indra/llcommon/llapr.h
+++ b/indra/llcommon/llapr.h
@@ -32,28 +32,34 @@
#if LL_LINUX || LL_SOLARIS
#include <sys/param.h> // Need PATH_MAX in APR headers...
#endif
-#if LL_WINDOWS
- // Limit Windows API to small and manageable set.
- // If you get undefined symbols, find the appropriate
- // Windows header file and include that in your .cpp file.
- #define WIN32_LEAN_AND_MEAN
- #include <winsock2.h>
- #include <windows.h>
-#endif
#include <boost/noncopyable.hpp>
-
+#include "llwin32headerslean.h"
#include "apr_thread_proc.h"
#include "apr_thread_mutex.h"
#include "apr_getopt.h"
#include "apr_signal.h"
#include "apr_atomic.h"
+
#include "llstring.h"
extern LL_COMMON_API apr_thread_mutex_t* gLogMutexp;
extern apr_thread_mutex_t* gCallStacksLogMutexp;
struct apr_dso_handle_t;
+/**
+ * @brief Function which appropriately logs error or remains quiet on
+ * APR_SUCCESS.
+ * @return Returns <code>true</code> if status is an error condition.
+ */
+bool LL_COMMON_API ll_apr_warn_status(apr_status_t status);
+/// There's a whole other APR error-message function if you pass a DSO handle.
+bool LL_COMMON_API ll_apr_warn_status(apr_status_t status, apr_dso_handle_t* handle);
+
+void LL_COMMON_API ll_apr_assert_status(apr_status_t status);
+void LL_COMMON_API ll_apr_assert_status(apr_status_t status, apr_dso_handle_t* handle);
+
+extern "C" LL_COMMON_API apr_pool_t* gAPRPoolp; // Global APR memory pool
/**
* @brief initialize the common apr constructs -- apr itself, the
@@ -66,6 +72,9 @@ void LL_COMMON_API ll_init_apr();
*/
void LL_COMMON_API ll_cleanup_apr();
+bool LL_COMMON_API ll_apr_is_initialized();
+
+
//
//LL apr_pool
//manage apr_pool_t, destroy allocated apr_pool in the destruction function.
@@ -263,18 +272,5 @@ public:
//*******************************************************************************************************************************
};
-/**
- * @brief Function which appropriately logs error or remains quiet on
- * APR_SUCCESS.
- * @return Returns <code>true</code> if status is an error condition.
- */
-bool LL_COMMON_API ll_apr_warn_status(apr_status_t status);
-/// There's a whole other APR error-message function if you pass a DSO handle.
-bool LL_COMMON_API ll_apr_warn_status(apr_status_t status, apr_dso_handle_t* handle);
-
-void LL_COMMON_API ll_apr_assert_status(apr_status_t status);
-void LL_COMMON_API ll_apr_assert_status(apr_status_t status, apr_dso_handle_t* handle);
-
-extern "C" LL_COMMON_API apr_pool_t* gAPRPoolp; // Global APR memory pool
#endif // LL_LLAPR_H
diff --git a/indra/llcommon/llassettype.h b/indra/llcommon/llassettype.h
index 69b01731e5..5a95a58d93 100755
--- a/indra/llcommon/llassettype.h
+++ b/indra/llcommon/llassettype.h
@@ -29,8 +29,6 @@
#include <string>
-#include "stdenums.h" // for EDragAndDropType
-
class LL_COMMON_API LLAssetType
{
public:
diff --git a/indra/llcommon/llassoclist.h b/indra/llcommon/llassoclist.h
deleted file mode 100755
index 2950504155..0000000000
--- a/indra/llcommon/llassoclist.h
+++ /dev/null
@@ -1,296 +0,0 @@
-/**
- * @file llassoclist.h
- * @brief LLAssocList class header file
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLASSOCLIST_H
-#define LL_LLASSOCLIST_H
-
-//------------------------------------------------------------------------
-// LLAssocList is an associative list container class.
-//
-// The implementation is a single linked list.
-// Both index and value objects are stored by value (not reference).
-// If pointer values are specified for index and/or value, this
-// container does NOT assume ownership of the referenced objects,
-// and does NOT delete() them on removal or destruction of the container.
-//
-// Note that operations are generally not optimized, and may of them
-// are O(n) complexity.
-//------------------------------------------------------------------------
-
-#include <iostream>
-
-template<class INDEX_TYPE, class VALUE_TYPE>
-class LLAssocList
-{
-private:
- // internal list node type
- class Node
- {
- public:
- Node(const INDEX_TYPE &index, const VALUE_TYPE &value, Node *next)
- {
- mIndex = index;
- mValue = value;
- mNext = next;
- }
- ~Node() { }
- INDEX_TYPE mIndex;
- VALUE_TYPE mValue;
- Node *mNext;
- };
-
- // head of the linked list
- Node *mHead;
-
-public:
- // Constructor
- LLAssocList()
- {
- mHead = NULL;
- }
-
- // Destructor
- ~LLAssocList()
- {
- removeAll();
- }
-
- // Returns TRUE if list is empty.
- BOOL isEmpty()
- {
- return (mHead == NULL);
- }
-
- // Returns the number of items in the list.
- U32 length()
- {
- U32 count = 0;
- for ( Node *node = mHead;
- node;
- node = node->mNext )
- {
- count++;
- }
- return count;
- }
-
- // Removes item with the specified index.
- BOOL remove( const INDEX_TYPE &index )
- {
- if (!mHead)
- return FALSE;
-
- if (mHead->mIndex == index)
- {
- Node *node = mHead;
- mHead = mHead->mNext;
- delete node;
- return TRUE;
- }
-
- for ( Node *prev = mHead;
- prev->mNext;
- prev = prev->mNext )
- {
- if (prev->mNext->mIndex == index)
- {
- Node *node = prev->mNext;
- prev->mNext = prev->mNext->mNext;
- delete node;
- return TRUE;
- }
- }
- return FALSE;
- }
-
- // Removes all items from the list.
- void removeAll()
- {
- while ( mHead )
- {
- Node *node = mHead;
- mHead = mHead->mNext;
- delete node;
- }
- }
-
- // Adds a new item to the head of the list,
- // removing any existing item with same index.
- void addToHead( const INDEX_TYPE &index, const VALUE_TYPE &value )
- {
- remove(index);
- Node *node = new Node(index, value, mHead);
- mHead = node;
- }
-
- // Adds a new item to the end of the list,
- // removing any existing item with the same index.
- void addToTail( const INDEX_TYPE &index, const VALUE_TYPE &value )
- {
- remove(index);
- Node *node = new Node(index, value, NULL);
- if (!mHead)
- {
- mHead = node;
- return;
- }
- for ( Node *prev=mHead;
- prev;
- prev=prev->mNext )
- {
- if (!prev->mNext)
- {
- prev->mNext=node;
- return;
- }
- }
- }
-
- // Sets the value of a specified index.
- // If index does not exist, a new value will be added only if
- // 'addIfNotFound' is set to TRUE.
- // Returns TRUE if successful.
- BOOL setValue( const INDEX_TYPE &index, const VALUE_TYPE &value, BOOL addIfNotFound=FALSE )
- {
- VALUE_TYPE *valueP = getValue(index);
- if (valueP)
- {
- *valueP = value;
- return TRUE;
- }
- if (!addIfNotFound)
- return FALSE;
- addToTail(index, value);
- return TRUE;
- }
-
- // Sets the ith value in the list.
- // A new value will NOT be addded, if the ith value does not exist.
- // Returns TRUE if successful.
- BOOL setValueAt( U32 i, const VALUE_TYPE &value )
- {
- VALUE_TYPE *valueP = getValueAt(i);
- if (valueP)
- {
- *valueP = value;
- return TRUE;
- }
- return FALSE;
- }
-
- // Returns a pointer to the value for the specified index,
- // or NULL if no item found.
- VALUE_TYPE *getValue( const INDEX_TYPE &index )
- {
- for ( Node *node = mHead;
- node;
- node = node->mNext )
- {
- if (node->mIndex == index)
- return &node->mValue;
- }
- return NULL;
- }
-
- // Returns a pointer to the ith value in the list, or
- // NULL if i is not valid.
- VALUE_TYPE *getValueAt( U32 i )
- {
- U32 count = 0;
- for ( Node *node = mHead;
- node;
- node = node->mNext )
- {
- if (count == i)
- return &node->mValue;
- count++;
- }
- return NULL;
- }
-
- // Returns a pointer to the index for the specified index,
- // or NULL if no item found.
- INDEX_TYPE *getIndex( const INDEX_TYPE &index )
- {
- for ( Node *node = mHead;
- node;
- node = node->mNext )
- {
- if (node->mIndex == index)
- return &node->mIndex;
- }
- return NULL;
- }
-
- // Returns a pointer to the ith index in the list, or
- // NULL if i is not valid.
- INDEX_TYPE *getIndexAt( U32 i )
- {
- U32 count = 0;
- for ( Node *node = mHead;
- node;
- node = node->mNext )
- {
- if (count == i)
- return &node->mIndex;
- count++;
- }
- return NULL;
- }
-
- // Returns a pointer to the value for the specified index,
- // or NULL if no item found.
- VALUE_TYPE *operator[](const INDEX_TYPE &index)
- {
- return getValue(index);
- }
-
- // Returns a pointer to the ith value in the list, or
- // NULL if i is not valid.
- VALUE_TYPE *operator[](U32 i)
- {
- return getValueAt(i);
- }
-
- // Prints the list contents to the specified stream.
- friend std::ostream &operator<<( std::ostream &os, LLAssocList &map )
- {
- os << "{";
- for ( Node *node = map.mHead;
- node;
- node = node->mNext )
- {
- os << "<" << node->mIndex << ", " << node->mValue << ">";
- if (node->mNext)
- os << ", ";
- }
- os << "}";
-
- return os;
- }
-};
-
-#endif // LL_LLASSOCLIST_H
diff --git a/indra/llcommon/llavatarconstants.h b/indra/llcommon/llavatarconstants.h
deleted file mode 100755
index f47f447b45..0000000000
--- a/indra/llcommon/llavatarconstants.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * @file llavatarconstants.h
- * @brief some useful short term constants for Indra
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_AVATAR_CONSTANTS_H
-#define LL_AVATAR_CONSTANTS_H
-
-// If this string is passed to dataserver in AvatarPropertiesUpdate
-// then no change is made to user.profile_web
-const char* const BLACKLIST_PROFILE_WEB_STR = "featureWebProfilesDisabled";
-
-// If profile web pages are feature blacklisted then this URL is
-// shown in the profile instead of the user's set URL
-const char* const BLACKLIST_PROFILE_WEB_URL = "http://secondlife.com/app/webdisabled";
-
-// Maximum number of avatar picks
-const S32 MAX_AVATAR_PICKS = 10;
-
-// For Flags in AvatarPropertiesReply
-const U32 AVATAR_ALLOW_PUBLISH = 0x1 << 0; // whether profile is externally visible or not
-const U32 AVATAR_MATURE_PUBLISH = 0x1 << 1; // profile is "mature"
-const U32 AVATAR_IDENTIFIED = 0x1 << 2; // whether avatar has provided payment info
-const U32 AVATAR_TRANSACTED = 0x1 << 3; // whether avatar has actively used payment info
-const U32 AVATAR_ONLINE = 0x1 << 4; // the online status of this avatar, if known.
-const U32 AVATAR_AGEVERIFIED = 0x1 << 5; // whether avatar has been age-verified
-
-char const* const VISIBILITY_DEFAULT = "default";
-char const* const VISIBILITY_HIDDEN = "hidden";
-char const* const VISIBILITY_VISIBLE = "visible";
-char const* const VISIBILITY_INVISIBLE = "invisible";
-
-#endif
-
diff --git a/indra/llcommon/llbase32.cpp b/indra/llcommon/llbase32.cpp
index 053ac0d32f..349567c90b 100755
--- a/indra/llcommon/llbase32.cpp
+++ b/indra/llcommon/llbase32.cpp
@@ -231,8 +231,8 @@ std::string LLBase32::encode(const U8* input, size_t input_size)
size_t encoded = base32_encode(&output[0], output_size, input, input_size);
- llinfos << "encoded " << encoded << " into buffer of size "
- << output_size << llendl;
+ LL_INFOS() << "encoded " << encoded << " into buffer of size "
+ << output_size << LL_ENDL;
}
return output;
}
diff --git a/indra/llcommon/bitpack.cpp b/indra/llcommon/llbitpack.cpp
index cdcaba0765..622a099945 100755
--- a/indra/llcommon/bitpack.cpp
+++ b/indra/llcommon/llbitpack.cpp
@@ -27,4 +27,4 @@
#include "linden_common.h"
// implementation is all in the header, this include dep ensures the unit test is rerun if the implementation changes.
-#include "bitpack.h"
+#include "llbitpack.h"
diff --git a/indra/llcommon/bitpack.h b/indra/llcommon/llbitpack.h
index 037300dd14..f99a354cd4 100755
--- a/indra/llcommon/bitpack.h
+++ b/indra/llcommon/llbitpack.h
@@ -1,5 +1,5 @@
/**
- * @file bitpack.h
+ * @file llbitpack.h
* @brief Convert data to packed bit stream
*
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
@@ -79,7 +79,7 @@ public:
*(mBuffer + mBufferSize++) = mLoad;
if (mBufferSize > mMaxSize)
{
- llerror("mBufferSize exceeding mMaxSize!", 0);
+ LL_ERRS() << "mBufferSize exceeding mMaxSize!" << LL_ENDL;
}
mLoadSize = 0;
mLoad = 0x00;
@@ -122,7 +122,7 @@ public:
*(mBuffer + mBufferSize++) = mLoad;
if (mBufferSize > mMaxSize)
{
- llerror("mBufferSize exceeding mMaxSize!", 0);
+ LL_ERRS() << "mBufferSize exceeding mMaxSize!" << LL_ENDL;
}
mLoadSize = 0;
mLoad = 0x00;
@@ -165,8 +165,8 @@ public:
#ifdef _DEBUG
if (mBufferSize > mMaxSize)
{
- llerrs << "mBufferSize exceeding mMaxSize" << llendl;
- llerrs << mBufferSize << " > " << mMaxSize << llendl;
+ LL_ERRS() << "mBufferSize exceeding mMaxSize" << LL_ENDL;
+ LL_ERRS() << mBufferSize << " > " << mMaxSize << LL_ENDL;
}
#endif
mLoad = *(mBuffer + mBufferSize++);
@@ -190,7 +190,7 @@ public:
*(mBuffer + mBufferSize++) = mLoad;
if (mBufferSize > mMaxSize)
{
- llerror("mBufferSize exceeding mMaxSize!", 0);
+ LL_ERRS() << "mBufferSize exceeding mMaxSize!" << LL_ENDL;
}
mLoadSize = 0;
}
diff --git a/indra/llcommon/llclickaction.h b/indra/llcommon/llclickaction.h
index 1f87d8eec3..2f83113af9 100755..100644
--- a/indra/llcommon/llclickaction.h
+++ b/indra/llcommon/llclickaction.h
@@ -27,15 +27,4 @@
#ifndef LL_LLCLICKACTION_H
#define LL_LLCLICKACTION_H
-// DO NOT CHANGE THE SEQUENCE OF THIS LIST!!
-const U8 CLICK_ACTION_NONE = 0;
-const U8 CLICK_ACTION_TOUCH = 0;
-const U8 CLICK_ACTION_SIT = 1;
-const U8 CLICK_ACTION_BUY = 2;
-const U8 CLICK_ACTION_PAY = 3;
-const U8 CLICK_ACTION_OPEN = 4;
-const U8 CLICK_ACTION_PLAY = 5;
-const U8 CLICK_ACTION_OPEN_MEDIA = 6;
-const U8 CLICK_ACTION_ZOOM = 7;
-// DO NOT CHANGE THE SEQUENCE OF THIS LIST!!
#endif
diff --git a/indra/llcommon/llcommon.cpp b/indra/llcommon/llcommon.cpp
index b938b0e65a..19642b0982 100755
--- a/indra/llcommon/llcommon.cpp
+++ b/indra/llcommon/llcommon.cpp
@@ -29,10 +29,14 @@
#include "llmemory.h"
#include "llthread.h"
+#include "lltrace.h"
+#include "lltracethreadrecorder.h"
//static
BOOL LLCommon::sAprInitialized = FALSE;
+static LLTrace::ThreadRecorder* sMasterThreadRecorder = NULL;
+
//static
void LLCommon::initClass()
{
@@ -45,15 +49,19 @@ void LLCommon::initClass()
LLTimer::initClass();
LLThreadSafeRefCount::initThreadSafeRefCount();
assert_main_thread(); // Make sure we record the main thread
-// LLWorkerThread::initClass();
-// LLFrameCallbackManager::initClass();
+ if (!sMasterThreadRecorder)
+ {
+ sMasterThreadRecorder = new LLTrace::ThreadRecorder();
+ LLTrace::set_master_thread_recorder(sMasterThreadRecorder);
+ }
}
//static
void LLCommon::cleanupClass()
{
-// LLFrameCallbackManager::cleanupClass();
-// LLWorkerThread::cleanupClass();
+ delete sMasterThreadRecorder;
+ sMasterThreadRecorder = NULL;
+ LLTrace::set_master_thread_recorder(NULL);
LLThreadSafeRefCount::cleanupThreadSafeRefCount();
LLTimer::cleanupClass();
if (sAprInitialized)
diff --git a/indra/llcommon/llcommonutils.h b/indra/llcommon/llcommonutils.h
index 755dc41fb4..20ada27830 100755
--- a/indra/llcommon/llcommonutils.h
+++ b/indra/llcommon/llcommonutils.h
@@ -27,6 +27,8 @@
#ifndef LL_LLCOMMONUTILS_H
#define LL_LLCOMMONUTILS_H
+#include "lluuid.h"
+
namespace LLCommonUtils
{
/**
diff --git a/indra/llcommon/llcrc.cpp b/indra/llcommon/llcrc.cpp
index e80da0bb0d..626bb1e564 100755
--- a/indra/llcommon/llcrc.cpp
+++ b/indra/llcommon/llcrc.cpp
@@ -162,7 +162,7 @@ void LLCRC::update(const std::string& filename)
{
if (filename.empty())
{
- llerrs << "No filename specified" << llendl;
+ LL_ERRS() << "No filename specified" << LL_ENDL;
return;
}
@@ -185,7 +185,7 @@ void LLCRC::update(const std::string& filename)
if (nread < (size_t) size)
{
- llwarns << "Short read on " << filename << llendl;
+ LL_WARNS() << "Short read on " << filename << LL_ENDL;
}
update(data, nread);
diff --git a/indra/llcommon/llcrc.h b/indra/llcommon/llcrc.h
index 2d291d92a1..3f41b28ffa 100755
--- a/indra/llcommon/llcrc.h
+++ b/indra/llcommon/llcrc.h
@@ -41,7 +41,7 @@
// crc.update(fgetc(fp));
// }
// fclose(fp);
-// llinfos << "File crc: " << crc.getCRC() << llendl;
+// LL_INFOS() << "File crc: " << crc.getCRC() << LL_ENDL;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class LL_COMMON_API LLCRC
diff --git a/indra/llcommon/llcriticaldamp.cpp b/indra/llcommon/llcriticaldamp.cpp
index 49aac9ce75..54be855f67 100755
--- a/indra/llcommon/llcriticaldamp.cpp
+++ b/indra/llcommon/llcriticaldamp.cpp
@@ -27,18 +27,38 @@
#include "linden_common.h"
#include "llcriticaldamp.h"
+#include <algorithm>
//-----------------------------------------------------------------------------
// static members
//-----------------------------------------------------------------------------
-LLFrameTimer LLCriticalDamp::sInternalTimer;
-std::map<F32, F32> LLCriticalDamp::sInterpolants;
-F32 LLCriticalDamp::sTimeDelta;
+LLFrameTimer LLSmoothInterpolation::sInternalTimer;
+std::vector<LLSmoothInterpolation::Interpolant> LLSmoothInterpolation::sInterpolants;
+F32 LLSmoothInterpolation::sTimeDelta;
+
+// helper functors
+struct LLSmoothInterpolation::CompareTimeConstants
+{
+ bool operator()(const F32& a, const LLSmoothInterpolation::Interpolant& b) const
+ {
+ return a < b.mTimeScale;
+ }
+
+ bool operator()(const LLSmoothInterpolation::Interpolant& a, const F32& b) const
+ {
+ return a.mTimeScale < b; // bottom of a is higher than bottom of b
+ }
+
+ bool operator()(const LLSmoothInterpolation::Interpolant& a, const LLSmoothInterpolation::Interpolant& b) const
+ {
+ return a.mTimeScale < b.mTimeScale; // bottom of a is higher than bottom of b
+ }
+};
//-----------------------------------------------------------------------------
-// LLCriticalDamp()
+// LLSmoothInterpolation()
//-----------------------------------------------------------------------------
-LLCriticalDamp::LLCriticalDamp()
+LLSmoothInterpolation::LLSmoothInterpolation()
{
sTimeDelta = 0.f;
}
@@ -47,44 +67,55 @@ LLCriticalDamp::LLCriticalDamp()
//-----------------------------------------------------------------------------
// updateInterpolants()
//-----------------------------------------------------------------------------
-void LLCriticalDamp::updateInterpolants()
+void LLSmoothInterpolation::updateInterpolants()
{
sTimeDelta = sInternalTimer.getElapsedTimeAndResetF32();
- F32 time_constant;
-
- for (std::map<F32, F32>::iterator iter = sInterpolants.begin();
- iter != sInterpolants.end(); iter++)
+ for (S32 i = 0; i < sInterpolants.size(); i++)
{
- time_constant = iter->first;
- F32 new_interpolant = 1.f - pow(2.f, -sTimeDelta / time_constant);
- new_interpolant = llclamp(new_interpolant, 0.f, 1.f);
- sInterpolants[time_constant] = new_interpolant;
+ Interpolant& interp = sInterpolants[i];
+ interp.mInterpolant = calcInterpolant(interp.mTimeScale);
}
}
//-----------------------------------------------------------------------------
// getInterpolant()
//-----------------------------------------------------------------------------
-F32 LLCriticalDamp::getInterpolant(const F32 time_constant, BOOL use_cache)
+F32 LLSmoothInterpolation::getInterpolant(F32SecondsImplicit time_constant, bool use_cache)
{
if (time_constant == 0.f)
{
return 1.f;
}
- if (use_cache && sInterpolants.count(time_constant))
+ if (use_cache)
{
- return sInterpolants[time_constant];
+ interpolant_vec_t::iterator find_it = std::lower_bound(sInterpolants.begin(), sInterpolants.end(), time_constant.value(), CompareTimeConstants());
+ if (find_it != sInterpolants.end() && find_it->mTimeScale == time_constant)
+ {
+ return find_it->mInterpolant;
+ }
+ else
+ {
+ Interpolant interp;
+ interp.mTimeScale = time_constant.value();
+ interp.mInterpolant = calcInterpolant(time_constant.value());
+ sInterpolants.insert(find_it, interp);
+ return interp.mInterpolant;
+ }
}
-
- F32 interpolant = 1.f - pow(2.f, -sTimeDelta / time_constant);
- interpolant = llclamp(interpolant, 0.f, 1.f);
- if (use_cache)
+ else
{
- sInterpolants[time_constant] = interpolant;
+ return calcInterpolant(time_constant.value());
+
}
+}
- return interpolant;
+//-----------------------------------------------------------------------------
+// calcInterpolant()
+//-----------------------------------------------------------------------------
+F32 LLSmoothInterpolation::calcInterpolant(F32 time_constant)
+{
+ return llclamp(1.f - powf(2.f, -sTimeDelta / time_constant), 0.f, 1.f);
}
diff --git a/indra/llcommon/llcriticaldamp.h b/indra/llcommon/llcriticaldamp.h
index 52f052ae25..1fb6a1af29 100755
--- a/indra/llcommon/llcriticaldamp.h
+++ b/indra/llcommon/llcriticaldamp.h
@@ -28,26 +28,46 @@
#ifndef LL_LLCRITICALDAMP_H
#define LL_LLCRITICALDAMP_H
-#include <map>
+#include <vector>
#include "llframetimer.h"
+#include "llunits.h"
-class LL_COMMON_API LLCriticalDamp
+class LL_COMMON_API LLSmoothInterpolation
{
public:
- LLCriticalDamp();
+ LLSmoothInterpolation();
// MANIPULATORS
static void updateInterpolants();
// ACCESSORS
- static F32 getInterpolant(const F32 time_constant, BOOL use_cache = TRUE);
+ static F32 getInterpolant(F32SecondsImplicit time_constant, bool use_cache = true);
-protected:
+ template<typename T>
+ static T lerp(T a, T b, F32SecondsImplicit time_constant, bool use_cache = true)
+ {
+ F32 interpolant = getInterpolant(time_constant, use_cache);
+ return ((a * (1.f - interpolant))
+ + (b * interpolant));
+ }
+
+protected:
+ static F32 calcInterpolant(F32 time_constant);
+
+ struct CompareTimeConstants;
static LLFrameTimer sInternalTimer; // frame timer for calculating deltas
- static std::map<F32, F32> sInterpolants;
+ struct Interpolant
+ {
+ F32 mTimeScale;
+ F32 mInterpolant;
+ };
+ typedef std::vector<Interpolant> interpolant_vec_t;
+ static interpolant_vec_t sInterpolants;
static F32 sTimeDelta;
};
+typedef LLSmoothInterpolation LLCriticalDamp;
+
#endif // LL_LLCRITICALDAMP_H
diff --git a/indra/llcommon/lldarray.h b/indra/llcommon/lldarray.h
deleted file mode 100755
index 131b819c99..0000000000
--- a/indra/llcommon/lldarray.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/**
- * @file lldarray.h
- * @brief Wrapped std::vector for backward compatibility.
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLDARRAY_H
-#define LL_LLDARRAY_H
-
-#include "llerror.h"
-
-#include <vector>
-#include <map>
-
-// class LLDynamicArray<>; // = std::vector + reserves <BlockSize> elements
-// class LLDynamicArrayIndexed<>; // = std::vector + std::map if indices, only supports operator[] and begin(),end()
-
-//--------------------------------------------------------
-// LLDynamicArray declaration
-//--------------------------------------------------------
-// NOTE: BlockSize is used to reserve a minimal initial amount
-template <typename Type, int BlockSize = 32>
-class LLDynamicArray : public std::vector<Type>
-{
-public:
- enum
- {
- OKAY = 0,
- FAIL = -1
- };
-
- LLDynamicArray(S32 size=0) : std::vector<Type>(size) { if (size < BlockSize) std::vector<Type>::reserve(BlockSize); }
-
- void reset() { std::vector<Type>::clear(); }
-
- // ACCESSORS
- const Type& get(S32 index) const { return std::vector<Type>::operator[](index); }
- Type& get(S32 index) { return std::vector<Type>::operator[](index); }
- S32 find(const Type &obj) const;
-
- S32 count() const { return std::vector<Type>::size(); }
- S32 getLength() const { return std::vector<Type>::size(); }
- S32 getMax() const { return std::vector<Type>::capacity(); }
-
- // MANIPULATE
- S32 put(const Type &obj); // add to end of array, returns index
-// Type* reserve(S32 num); // reserve a block of indices in advance
- Type* reserve_block(U32 num); // reserve a block of indices in advance
-
- S32 remove(S32 index); // remove by index, no bounds checking
- S32 removeObj(const Type &obj); // remove by object
- S32 removeLast();
-
- void operator+=(const LLDynamicArray<Type,BlockSize> &other);
-};
-
-//--------------------------------------------------------
-// LLDynamicArray implementation
-//--------------------------------------------------------
-
-template <typename Type,int BlockSize>
-inline S32 LLDynamicArray<Type,BlockSize>::find(const Type &obj) const
-{
- typename std::vector<Type>::const_iterator iter = std::find(this->begin(), this->end(), obj);
- if (iter != this->end())
- {
- return iter - this->begin();
- }
- return FAIL;
-}
-
-
-template <typename Type,int BlockSize>
-inline S32 LLDynamicArray<Type,BlockSize>::remove(S32 i)
-{
- // This is a fast removal by swapping with the last element
- S32 sz = this->size();
- if (i < 0 || i >= sz)
- {
- return FAIL;
- }
- if (i < sz-1)
- {
- this->operator[](i) = this->back();
- }
- this->pop_back();
- return i;
-}
-
-template <typename Type,int BlockSize>
-inline S32 LLDynamicArray<Type,BlockSize>::removeObj(const Type& obj)
-{
- typename std::vector<Type>::iterator iter = std::find(this->begin(), this->end(), obj);
- if (iter != this->end())
- {
- S32 res = iter - this->begin();
- typename std::vector<Type>::iterator last = this->end();
- --last;
- *iter = *last;
- this->pop_back();
- return res;
- }
- return FAIL;
-}
-
-template <typename Type,int BlockSize>
-inline S32 LLDynamicArray<Type,BlockSize>::removeLast()
-{
- if (!this->empty())
- {
- this->pop_back();
- return OKAY;
- }
- return FAIL;
-}
-
-template <typename Type,int BlockSize>
-inline Type* LLDynamicArray<Type,BlockSize>::reserve_block(U32 num)
-{
- U32 sz = this->size();
- this->resize(sz+num);
- return &(this->operator[](sz));
-}
-
-template <typename Type,int BlockSize>
-inline S32 LLDynamicArray<Type,BlockSize>::put(const Type &obj)
-{
- this->push_back(obj);
- return this->size() - 1;
-}
-
-template <typename Type,int BlockSize>
-inline void LLDynamicArray<Type,BlockSize>::operator+=(const LLDynamicArray<Type,BlockSize> &other)
-{
- insert(this->end(), other.begin(), other.end());
-}
-
-//--------------------------------------------------------
-// LLDynamicArrayIndexed declaration
-//--------------------------------------------------------
-
-template <typename Type, typename Key, int BlockSize = 32>
-class LLDynamicArrayIndexed
-{
-public:
- typedef typename std::vector<Type>::iterator iterator;
- typedef typename std::vector<Type>::const_iterator const_iterator;
- typedef typename std::vector<Type>::reverse_iterator reverse_iterator;
- typedef typename std::vector<Type>::const_reverse_iterator const_reverse_iterator;
- typedef typename std::vector<Type>::size_type size_type;
-protected:
- std::vector<Type> mVector;
- std::map<Key, U32> mIndexMap;
-
-public:
- LLDynamicArrayIndexed() { mVector.reserve(BlockSize); }
-
- iterator begin() { return mVector.begin(); }
- const_iterator begin() const { return mVector.begin(); }
- iterator end() { return mVector.end(); }
- const_iterator end() const { return mVector.end(); }
-
- reverse_iterator rbegin() { return mVector.rbegin(); }
- const_reverse_iterator rbegin() const { return mVector.rbegin(); }
- reverse_iterator rend() { return mVector.rend(); }
- const_reverse_iterator rend() const { return mVector.rend(); }
-
- void reset() { mVector.resize(0); mIndexMap.resize(0); }
- bool empty() const { return mVector.empty(); }
- size_type size() const { return mVector.size(); }
-
- Type& operator[](const Key& k)
- {
- typename std::map<Key, U32>::const_iterator iter = mIndexMap.find(k);
- if (iter == mIndexMap.end())
- {
- U32 n = mVector.size();
- mIndexMap[k] = n;
- mVector.push_back(Type());
- llassert(mVector.size() == mIndexMap.size());
- return mVector[n];
- }
- else
- {
- return mVector[iter->second];
- }
- }
-
- const_iterator find(const Key& k) const
- {
- typename std::map<Key, U32>::const_iterator iter = mIndexMap.find(k);
- if(iter == mIndexMap.end())
- {
- return mVector.end();
- }
- else
- {
- return mVector.begin() + iter->second;
- }
- }
-};
-
-#endif
diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp
index 030ef6a3c7..7a2a0869f4 100755
--- a/indra/llcommon/lldate.cpp
+++ b/indra/llcommon/lldate.cpp
@@ -39,6 +39,7 @@
#include "lltimer.h"
#include "llstring.h"
+#include "llfasttimer.h"
static const F64 DATE_EPOCH = 0.0;
@@ -48,25 +49,22 @@ static const F64 LL_APR_USEC_PER_SEC = 1000000.0;
LLDate::LLDate() : mSecondsSinceEpoch(DATE_EPOCH)
-{
-}
+{}
LLDate::LLDate(const LLDate& date) :
mSecondsSinceEpoch(date.mSecondsSinceEpoch)
-{
-}
+{}
-LLDate::LLDate(F64 seconds_since_epoch) :
- mSecondsSinceEpoch(seconds_since_epoch)
-{
-}
+LLDate::LLDate(F64SecondsImplicit seconds_since_epoch) :
+ mSecondsSinceEpoch(seconds_since_epoch.value())
+{}
LLDate::LLDate(const std::string& iso8601_date)
{
if(!fromString(iso8601_date))
{
- llwarns << "date " << iso8601_date << " failed to parse; "
- << "ZEROING IT OUT" << llendl;
+ LL_WARNS() << "date " << iso8601_date << " failed to parse; "
+ << "ZEROING IT OUT" << LL_ENDL;
mSecondsSinceEpoch = DATE_EPOCH;
}
}
@@ -88,11 +86,11 @@ std::string LLDate::asRFC1123() const
return toHTTPDateString (std::string ("%A, %d %b %Y %H:%M:%S GMT"));
}
-LLFastTimer::DeclareTimer FT_DATE_FORMAT("Date Format");
+LLTrace::BlockTimerStatHandle FT_DATE_FORMAT("Date Format");
std::string LLDate::toHTTPDateString (std::string fmt) const
{
- LLFastTimer ft1(FT_DATE_FORMAT);
+ LL_RECORD_BLOCK_TIME(FT_DATE_FORMAT);
time_t locSeconds = (time_t) mSecondsSinceEpoch;
struct tm * gmt = gmtime (&locSeconds);
@@ -101,7 +99,7 @@ std::string LLDate::toHTTPDateString (std::string fmt) const
std::string LLDate::toHTTPDateString (tm * gmt, std::string fmt)
{
- LLFastTimer ft1(FT_DATE_FORMAT);
+ LL_RECORD_BLOCK_TIME(FT_DATE_FORMAT);
// avoid calling setlocale() unnecessarily - it's expensive.
static std::string prev_locale = "";
diff --git a/indra/llcommon/lldate.h b/indra/llcommon/lldate.h
index 7ff8b550ad..be2cd2d051 100755
--- a/indra/llcommon/lldate.h
+++ b/indra/llcommon/lldate.h
@@ -33,6 +33,7 @@
#include <string>
#include "stdtypes.h"
+#include "llunits.h"
/**
* @class LLDate
@@ -56,9 +57,9 @@ public:
/**
* @brief Construct a date from a seconds since epoch value.
*
- * @pararm seconds_since_epoch The number of seconds since UTC epoch.
+ * @param seconds_since_epoch The number of seconds since UTC epoch.
*/
- LLDate(F64 seconds_since_epoch);
+ LLDate(F64SecondsImplicit seconds_since_epoch);
/**
* @brief Construct a date from a string representation
diff --git a/indra/llcommon/lldeadmantimer.cpp b/indra/llcommon/lldeadmantimer.cpp
index 7d9097e344..830443b956 100644
--- a/indra/llcommon/lldeadmantimer.cpp
+++ b/indra/llcommon/lldeadmantimer.cpp
@@ -43,7 +43,7 @@
// true true Not allowed
//
LLDeadmanTimer::LLDeadmanTimer(F64 horizon, bool inc_cpu)
- : mHorizon(time_type(llmax(horizon, F64(0.0)) * gClockFrequency)),
+ : mHorizon(time_type(llmax(horizon, F64(0.0)) * get_timer_info().mClockFrequency)),
mActive(false), // If true, a timer is running.
mDone(false), // If true, timer has completed and can be read (once)
mStarted(U64L(0)),
@@ -144,8 +144,8 @@ bool LLDeadmanTimer::isExpired(time_type now, F64 & started, F64 & stopped, U64
return false;
}
- started = mStarted * gClockFrequencyInv;
- stopped = mStopped * gClockFrequencyInv;
+ started = mStarted * get_timer_info().mClockFrequencyInv;
+ stopped = mStopped * get_timer_info().mClockFrequencyInv;
count = mCount;
mDone = false;
diff --git a/indra/llcommon/lldeleteutils.h b/indra/llcommon/lldeleteutils.h
deleted file mode 100755
index f250dc3028..0000000000
--- a/indra/llcommon/lldeleteutils.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * @file lldeleteutils.h
- * @brief Utility functions to simplify some common pointer-munging idioms.
- *
- * $LicenseInfo:firstyear=2009&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-#ifndef LL_DELETE_UTILS_H
-#define LL_DELETE_UTILS_H
-
-// Simple utility functions to eventually replace the common 2-line
-// idiom scattered throughout the viewer codebase. Note that where
-// possible we would rather be using smart pointers of some sort.
-
-template <class T>
-inline void deleteAndClear(T*& ptr)
-{
- delete ptr;
- ptr = NULL;
-}
-
-template <class T>
-inline void deleteAndClearArray(T*& array_ptr)
-{
- delete[] array_ptr;
- array_ptr = NULL;
-}
-
-#endif
diff --git a/indra/llcommon/lldepthstack.h b/indra/llcommon/lldepthstack.h
index d9db54efc7..b65840d342 100755
--- a/indra/llcommon/lldepthstack.h
+++ b/indra/llcommon/lldepthstack.h
@@ -27,18 +27,19 @@
#ifndef LL_LLDEPTHSTACK_H
#define LL_LLDEPTHSTACK_H
-#include "linked_lists.h"
+#include "llstl.h"
template <class DATA_TYPE> class LLDepthStack
{
private:
- LLLinkedList<DATA_TYPE> mStack;
+ std::deque<DATA_TYPE*> mStack;
U32 mCurrentDepth;
U32 mMaxDepth;
public:
- LLDepthStack() : mCurrentDepth(0), mMaxDepth(0) {}
- ~LLDepthStack() {}
+ LLDepthStack()
+ : mCurrentDepth(0), mMaxDepth(0)
+ {}
void setDepth(U32 depth)
{
@@ -54,24 +55,27 @@ public:
{
if (mCurrentDepth < mMaxDepth)
{
- mStack.addData(data);
+ mStack.push_back(data);
mCurrentDepth++;
}
else
{
// the last item falls off stack and is deleted
- mStack.getLastData();
- mStack.deleteCurrentData();
- mStack.addData(data);
+ if (!mStack.empty())
+ {
+ mStack.pop_front();
+ }
+ mStack.push_back(data);
}
}
DATA_TYPE *pop()
{
- DATA_TYPE *tempp = mStack.getFirstData();
- if (tempp)
+ DATA_TYPE *tempp = NULL;
+ if (!mStack.empty())
{
- mStack.removeCurrentData();
+ tempp = mStack.back();
+ mStack.pop_back();
mCurrentDepth--;
}
return tempp;
@@ -79,20 +83,13 @@ public:
DATA_TYPE *check()
{
- DATA_TYPE *tempp = mStack.getFirstData();
- return tempp;
+ return mStack.empty() ? NULL : mStack.back();
}
-
- void deleteAllData()
- {
- mCurrentDepth = 0;
- mStack.deleteAllData();
- }
-
+
void removeAllNodes()
{
mCurrentDepth = 0;
- mStack.removeAllNodes();
+ mStack.clear();
}
};
diff --git a/indra/llcommon/lldictionary.h b/indra/llcommon/lldictionary.h
index c752859a36..5800ec5e5d 100755
--- a/indra/llcommon/lldictionary.h
+++ b/indra/llcommon/lldictionary.h
@@ -89,7 +89,7 @@ protected:
{
if (lookup(index))
{
- llerrs << "Dictionary entry already added (attempted to add duplicate entry)" << llendl;
+ LL_ERRS() << "Dictionary entry already added (attempted to add duplicate entry)" << LL_ENDL;
}
(*this)[index] = entry;
}
diff --git a/indra/llcommon/lldlinked.h b/indra/llcommon/lldlinked.h
deleted file mode 100755
index 3f7c197be7..0000000000
--- a/indra/llcommon/lldlinked.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * @file lldlinked.h
- * @brief Declaration of the LLDLinked class.
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-#ifndef LL_LLDLINKED_H
-#define LL_LLDLINKED_H
-
-template <class Type> class LLDLinked
-{
- LLDLinked* mNextp;
- LLDLinked* mPrevp;
-public:
-
- Type* getNext() { return (Type*)mNextp; }
- Type* getPrev() { return (Type*)mPrevp; }
- Type* getFirst() { return (Type*)mNextp; }
-
- void init()
- {
- mNextp = mPrevp = NULL;
- }
-
- void unlink()
- {
- if (mPrevp) mPrevp->mNextp = mNextp;
- if (mNextp) mNextp->mPrevp = mPrevp;
- }
-
- LLDLinked() { mNextp = mPrevp = NULL; }
- virtual ~LLDLinked() { unlink(); }
-
- virtual void deleteAll()
- {
- Type *curp = getFirst();
- while(curp)
- {
- Type *nextp = curp->getNext();
- curp->unlink();
- delete curp;
- curp = nextp;
- }
- }
-
- void relink(Type &after)
- {
- LLDLinked *afterp = (LLDLinked*)&after;
- afterp->mPrevp = this;
- mNextp = afterp;
- }
-
- virtual void append(Type& after)
- {
- LLDLinked *afterp = (LLDLinked*)&after;
- afterp->mPrevp = this;
- afterp->mNextp = mNextp;
- if (mNextp) mNextp->mPrevp = afterp;
- mNextp = afterp;
- }
-
- virtual void insert(Type& before)
- {
- LLDLinked *beforep = (LLDLinked*)&before;
- beforep->mNextp = this;
- beforep->mPrevp = mPrevp;
- if (mPrevp) mPrevp->mNextp = beforep;
- mPrevp = beforep;
- }
-
- virtual void put(Type& obj) { append(obj); }
-};
-
-#endif
diff --git a/indra/llcommon/lldqueueptr.h b/indra/llcommon/lldqueueptr.h
deleted file mode 100755
index 9fe08191e1..0000000000
--- a/indra/llcommon/lldqueueptr.h
+++ /dev/null
@@ -1,352 +0,0 @@
-/**
- * @file lldqueueptr.h
- * @brief LLDynamicQueuePtr declaration
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-#ifndef LL_LLDQUEUEPTR_H
-#define LL_LLDQUEUEPTR_H
-
-template <class Type>
-class LLDynamicQueuePtr
-{
-public:
- enum
- {
- OKAY = 0,
- FAIL = -1
- };
-
- LLDynamicQueuePtr(const S32 size=8);
- ~LLDynamicQueuePtr();
-
- void init();
- void destroy();
- void reset();
- void reallocate(U32 newsize);
-
- // ACCESSORS
- const Type& get(const S32 index) const; // no bounds checking
- Type& get(const S32 index); // no bounds checking
- const Type& operator [] (const S32 index) const { return get(index); }
- Type& operator [] (const S32 index) { return get(index); }
- S32 find(const Type &obj) const;
-
- S32 count() const { return (mLastObj >= mFirstObj ? mLastObj - mFirstObj : mLastObj + mMaxObj - mFirstObj); }
- S32 getMax() const { return mMaxObj; }
- S32 getFirst() const { return mFirstObj; }
- S32 getLast () const { return mLastObj; }
-
- // MANIPULATE
- S32 push(const Type &obj); // add to end of Queue, returns index from start
- S32 pull( Type &obj); // pull from Queue, returns index from start
-
- S32 remove (S32 index); // remove by index
- S32 removeObj(const Type &obj); // remove by object
-
-protected:
- S32 mFirstObj, mLastObj, mMaxObj;
- Type* mMemory;
-
-public:
-
- void print()
- {
- /*
- Convert this to llinfos if it's intended to be used - djs 08/30/02
-
- printf("Printing from %d to %d (of %d): ",mFirstObj, mLastObj, mMaxObj);
-
- if (mFirstObj <= mLastObj)
- {
- for (S32 i=mFirstObj;i<mLastObj;i++)
- {
- printf("%d ",mMemory[i]);
- }
- }
- else
- {
- for (S32 i=mFirstObj;i<mMaxObj;i++)
- {
- printf("%d ",mMemory[i]);
- }
- for (i=0;i<mLastObj;i++)
- {
- printf("%d ",mMemory[i]);
- }
- }
- printf("\n");
- */
- }
-
-};
-
-
-//--------------------------------------------------------
-// LLDynamicQueuePtrPtr implementation
-//--------------------------------------------------------
-
-
-template <class Type>
-inline LLDynamicQueuePtr<Type>::LLDynamicQueuePtr(const S32 size)
-{
- init();
- reallocate(size);
-}
-
-template <class Type>
-inline LLDynamicQueuePtr<Type>::~LLDynamicQueuePtr()
-{
- destroy();
-}
-
-template <class Type>
-inline void LLDynamicQueuePtr<Type>::init()
-{
- mFirstObj = 0;
- mLastObj = 0;
- mMaxObj = 0;
- mMemory = NULL;
-}
-
-template <class Type>
-inline void LLDynamicQueuePtr<Type>::reallocate(U32 newsize)
-{
- if (newsize)
- {
- if (mFirstObj > mLastObj && newsize > mMaxObj)
- {
- Type* new_memory = new Type[newsize];
-
- llassert(new_memory);
-
- S32 _count = count();
- S32 i, m = 0;
- for (i=mFirstObj; i < mMaxObj; i++)
- {
- new_memory[m++] = mMemory[i];
- }
- for (i=0; i <=mLastObj; i++)
- {
- new_memory[m++] = mMemory[i];
- }
-
- delete[] mMemory;
- mMemory = new_memory;
-
- mFirstObj = 0;
- mLastObj = _count;
- }
- else
- {
- Type* new_memory = new Type[newsize];
-
- llassert(new_memory);
-
- S32 i, m = 0;
- for (i=0; i < mLastObj; i++)
- {
- new_memory[m++] = mMemory[i];
- }
- delete[] mMemory;
- mMemory = new_memory;
- }
- }
- else if (mMemory)
- {
- delete[] mMemory;
- mMemory = NULL;
- }
-
- mMaxObj = newsize;
-}
-
-template <class Type>
-inline void LLDynamicQueuePtr<Type>::destroy()
-{
- reset();
- delete[] mMemory;
- mMemory = NULL;
-}
-
-
-template <class Type>
-void LLDynamicQueuePtr<Type>::reset()
-{
- for (S32 i=0; i < mMaxObj; i++)
- {
- get(i) = NULL; // unrefs for pointers
- }
-
- mFirstObj = 0;
- mLastObj = 0;
-}
-
-
-template <class Type>
-inline S32 LLDynamicQueuePtr<Type>::find(const Type &obj) const
-{
- S32 i;
- if (mFirstObj <= mLastObj)
- {
- for ( i = mFirstObj; i < mLastObj; i++ )
- {
- if (mMemory[i] == obj)
- {
- return i;
- }
- }
- }
- else
- {
- for ( i = mFirstObj; i < mMaxObj; i++ )
- {
- if (mMemory[i] == obj)
- {
- return i;
- }
- }
- for ( i = 0; i < mLastObj; i++ )
- {
- if (mMemory[i] == obj)
- {
- return i;
- }
- }
- }
-
- return FAIL;
-}
-
-template <class Type>
-inline S32 LLDynamicQueuePtr<Type>::remove(S32 i)
-{
- if (mFirstObj > mLastObj)
- {
- if (i >= mFirstObj && i < mMaxObj)
- {
- while( i > mFirstObj)
- {
- mMemory[i] = mMemory[i-1];
- i--;
- }
- mMemory[mFirstObj] = NULL;
- mFirstObj++;
- if (mFirstObj >= mMaxObj) mFirstObj = 0;
-
- return count();
- }
- else if (i < mLastObj && i >= 0)
- {
- while(i < mLastObj)
- {
- mMemory[i] = mMemory[i+1];
- i++;
- }
- mMemory[mLastObj] = NULL;
- mLastObj--;
- if (mLastObj < 0) mLastObj = mMaxObj-1;
-
- return count();
- }
- }
- else if (i <= mLastObj && i >= mFirstObj)
- {
- while(i < mLastObj)
- {
- mMemory[i] = mMemory[i+1];
- i++;
- }
- mMemory[mLastObj] = NULL;
- mLastObj--;
- if (mLastObj < 0) mLastObj = mMaxObj-1;
-
- return count();
- }
-
-
- return FAIL;
-}
-
-template <class Type>
-inline S32 LLDynamicQueuePtr<Type>::removeObj(const Type& obj)
-{
- S32 ind = find(obj);
- if (ind >= 0)
- {
- return remove(ind);
- }
- return FAIL;
-}
-
-template <class Type>
-inline S32 LLDynamicQueuePtr<Type>::push(const Type &obj)
-{
- if (mMaxObj - count() <= 1)
- {
- reallocate(mMaxObj * 2);
- }
-
- mMemory[mLastObj++] = obj;
-
- if (mLastObj >= mMaxObj)
- {
- mLastObj = 0;
- }
-
- return count();
-}
-
-template <class Type>
-inline S32 LLDynamicQueuePtr<Type>::pull(Type &obj)
-{
- obj = NULL;
-
- if (count() < 1) return -1;
-
- obj = mMemory[mFirstObj];
- mMemory[mFirstObj] = NULL;
-
- mFirstObj++;
-
- if (mFirstObj >= mMaxObj)
- {
- mFirstObj = 0;
- }
-
- return count();
-}
-
-template <class Type>
-inline const Type& LLDynamicQueuePtr<Type>::get(const S32 i) const
-{
- return mMemory[i];
-}
-
-template <class Type>
-inline Type& LLDynamicQueuePtr<Type>::get(const S32 i)
-{
- return mMemory[i];
-}
-
-
-#endif // LL_LLDQUEUEPTR_H
diff --git a/indra/llcommon/llenum.h b/indra/llcommon/llenum.h
deleted file mode 100755
index f57b2bc0b5..0000000000
--- a/indra/llcommon/llenum.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * @file llenum.h
- * @author Tom Yedwab
- * @brief Utility class for storing enum value <-> string lookup.
- *
- * $LicenseInfo:firstyear=2006&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLENUM_H
-#define LL_LLENUM_H
-
-class LLEnum
-{
-public:
- typedef std::pair<const std::string, const U32> enum_t;
- enum
- {
- UNDEFINED = 0xffffffff,
- };
-
- LLEnum(const enum_t values_array[], const U32 length)
- {
- for (U32 i=0; i<length; ++i)
- {
- mEnumMap.insert(values_array[i]);
- if (values_array[i].second >= mEnumArray.size())
- {
- mEnumArray.resize(values_array[i].second+1);
- }
- mEnumArray[values_array[i].second] = values_array[i].first;
- }
- }
-
- U32 operator[](std::string str)
- {
- std::map<const std::string, const U32>::iterator itor;
- itor = mEnumMap.find(str);
- if (itor != mEnumMap.end())
- {
- return itor->second;
- }
- return UNDEFINED;
- }
-
- const std::string operator[](U32 index)
- {
- if (index < mEnumArray.size())
- {
- return mEnumArray[index];
- }
- return "";
- }
-
-private:
- std::map<const std::string, const U32> mEnumMap;
- std::vector<std::string> mEnumArray;
-};
-
-#endif // LL_LLENUM_H
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp
index 853f279c95..22cd861c72 100755
--- a/indra/llcommon/llerror.cpp
+++ b/indra/llcommon/llerror.cpp
@@ -47,11 +47,31 @@
#include "lllivefile.h"
#include "llsd.h"
#include "llsdserialize.h"
+#include "llsingleton.h"
#include "llstl.h"
#include "lltimer.h"
namespace {
-#if !LL_WINDOWS
+#if LL_WINDOWS
+ void debugger_print(const std::string& s)
+ {
+ // Be careful when calling OutputDebugString as it throws DBG_PRINTEXCEPTION_C
+ // which works just fine under the windows debugger, but can cause users who
+ // have enabled SEHOP exception chain validation to crash due to interactions
+ // between the Win 32-bit exception handling and boost coroutine fiber stacks. BUG-2707
+ //
+ if (IsDebuggerPresent())
+ {
+ // Need UTF16 for Unicode OutputDebugString
+ //
+ if (s.size())
+ {
+ OutputDebugString(utf8str_to_utf16str(s).c_str());
+ OutputDebugString(TEXT("\n"));
+ }
+ }
+ }
+#else
class RecordToSyslog : public LLError::Recorder
{
public:
@@ -96,8 +116,9 @@ namespace {
mFile.open(filename, llofstream::out | llofstream::app);
if (!mFile)
{
- llinfos << "Error setting log file to " << filename << llendl;
+ LL_INFOS() << "Error setting log file to " << filename << LL_ENDL;
}
+ mWantsTime = true;
}
~RecordToFile()
@@ -107,14 +128,10 @@ namespace {
bool okay() { return mFile; }
- virtual bool wantsTime() { return true; }
-
virtual void recordMessage(LLError::ELevel level,
const std::string& message)
{
mFile << message << std::endl;
- // mFile.flush();
- // *FIX: should we do this?
}
private:
@@ -125,9 +142,10 @@ namespace {
class RecordToStderr : public LLError::Recorder
{
public:
- RecordToStderr(bool timestamp) : mTimestamp(timestamp), mUseANSI(ANSI_PROBE) { }
-
- virtual bool wantsTime() { return mTimestamp; }
+ RecordToStderr(bool timestamp) : mUseANSI(ANSI_PROBE)
+ {
+ mWantsTime = timestamp;
+ }
virtual void recordMessage(LLError::ELevel level,
const std::string& message)
@@ -158,14 +176,19 @@ namespace {
}
private:
- bool mTimestamp;
- enum ANSIState {ANSI_PROBE, ANSI_YES, ANSI_NO};
- ANSIState mUseANSI;
+ enum ANSIState
+ {
+ ANSI_PROBE,
+ ANSI_YES,
+ ANSI_NO
+ } mUseANSI;
+
void colorANSI(const std::string color)
{
// ANSI color code escape sequence
fprintf(stderr, "\033[%sm", color.c_str() );
};
+
bool checkANSI(void)
{
#if LL_LINUX || LL_DARWIN
@@ -198,10 +221,13 @@ namespace {
class RecordToWinDebug: public LLError::Recorder
{
public:
+ RecordToWinDebug()
+ {}
+
virtual void recordMessage(LLError::ELevel level,
const std::string& message)
{
- LL_WINDOWS_OUTPUT_DEBUG(message);
+ debugger_print(message);
}
};
#endif
@@ -213,7 +239,7 @@ namespace
std::string className(const std::type_info& type)
{
#ifdef __GNUC__
- // GCC: type_info::name() returns a mangled class name, must demangle
+ // GCC: type_info::name() returns a mangled class name,st demangle
static size_t abi_name_len = 100;
static char* abi_name_buf = (char*)malloc(abi_name_len);
@@ -317,44 +343,45 @@ namespace
if (configuration.isUndefined())
{
- llwarns << filename() << " missing, ill-formed,"
+ LL_WARNS() << filename() << " missing, ill-formed,"
" or simply undefined; not changing configuration"
- << llendl;
+ << LL_ENDL;
return false;
}
}
LLError::configure(configuration);
- llinfos << "logging reconfigured from " << filename() << llendl;
+ LL_INFOS() << "logging reconfigured from " << filename() << LL_ENDL;
return true;
}
typedef std::map<std::string, LLError::ELevel> LevelMap;
- typedef std::vector<LLError::Recorder*> Recorders;
+ typedef std::vector<LLError::RecorderPtr> Recorders;
typedef std::vector<LLError::CallSite*> CallSiteVector;
- class Globals
+ class Globals : public LLSingleton<Globals>
{
public:
+ Globals();
+
std::ostringstream messageStream;
bool messageStreamInUse;
void addCallSite(LLError::CallSite&);
void invalidateCallSites();
-
- static Globals& get();
- // return the one instance of the globals
private:
CallSiteVector callSites;
-
- Globals()
- : messageStreamInUse(false)
- { }
-
};
+ Globals::Globals()
+ : messageStream(),
+ messageStreamInUse(false),
+ callSites()
+ {
+ }
+
void Globals::addCallSite(LLError::CallSite& site)
{
callSites.push_back(&site);
@@ -371,114 +398,111 @@ namespace
callSites.clear();
}
-
- Globals& Globals::get()
- {
- /* This pattern, of returning a reference to a static function
- variable, is to ensure that this global is constructed before
- it is used, no matter what the global initialization sequence
- is.
- See C++ FAQ Lite, sections 10.12 through 10.14
- */
- static Globals* globals = new Globals;
- return *globals;
- }
}
namespace LLError
{
- class Settings
+ class SettingsConfig : public LLRefCount
{
+ friend class Settings;
+
public:
- bool printLocation;
+ virtual ~SettingsConfig();
+
+ bool mPrintLocation;
- LLError::ELevel defaultLevel;
+ LLError::ELevel mDefaultLevel;
- LevelMap functionLevelMap;
- LevelMap classLevelMap;
- LevelMap fileLevelMap;
- LevelMap tagLevelMap;
- std::map<std::string, unsigned int> uniqueLogMessages;
+ LevelMap mFunctionLevelMap;
+ LevelMap mClassLevelMap;
+ LevelMap mFileLevelMap;
+ LevelMap mTagLevelMap;
+ std::map<std::string, unsigned int> mUniqueLogMessages;
- LLError::FatalFunction crashFunction;
- LLError::TimeFunction timeFunction;
+ LLError::FatalFunction mCrashFunction;
+ LLError::TimeFunction mTimeFunction;
- Recorders recorders;
- Recorder* fileRecorder;
- Recorder* fixedBufferRecorder;
- std::string fileRecorderFileName;
+ Recorders mRecorders;
+ RecorderPtr mFileRecorder;
+ RecorderPtr mFixedBufferRecorder;
+ std::string mFileRecorderFileName;
- int shouldLogCallCounter;
+ int mShouldLogCallCounter;
- static Settings& get();
+ private:
+ SettingsConfig();
+ };
+
+ typedef LLPointer<SettingsConfig> SettingsConfigPtr;
+
+ class Settings : public LLSingleton<Settings>
+ {
+ public:
+ Settings();
+
+ SettingsConfigPtr getSettingsConfig();
- static void reset();
- static Settings* saveAndReset();
- static void restore(Settings*);
+ void reset();
+ SettingsStoragePtr saveAndReset();
+ void restore(SettingsStoragePtr pSettingsStorage);
private:
- Settings()
- : printLocation(false),
- defaultLevel(LLError::LEVEL_DEBUG),
- crashFunction(),
- timeFunction(NULL),
- fileRecorder(NULL),
- fixedBufferRecorder(NULL),
- shouldLogCallCounter(0)
- { }
-
- ~Settings()
- {
- for_each(recorders.begin(), recorders.end(), DeletePointer());
- recorders.clear();
- }
-
- static Settings*& getPtr();
+ SettingsConfigPtr mSettingsConfig;
};
- Settings& Settings::get()
+ SettingsConfig::SettingsConfig()
+ : LLRefCount(),
+ mPrintLocation(false),
+ mDefaultLevel(LLError::LEVEL_DEBUG),
+ mFunctionLevelMap(),
+ mClassLevelMap(),
+ mFileLevelMap(),
+ mTagLevelMap(),
+ mUniqueLogMessages(),
+ mCrashFunction(NULL),
+ mTimeFunction(NULL),
+ mRecorders(),
+ mFileRecorder(),
+ mFixedBufferRecorder(),
+ mFileRecorderFileName(),
+ mShouldLogCallCounter(0)
{
- Settings* p = getPtr();
- if (!p)
- {
- reset();
- p = getPtr();
- }
- return *p;
}
-
- void Settings::reset()
+
+ SettingsConfig::~SettingsConfig()
+ {
+ mRecorders.clear();
+ }
+
+ Settings::Settings()
+ : LLSingleton<Settings>(),
+ mSettingsConfig(new SettingsConfig())
{
- Globals::get().invalidateCallSites();
-
- Settings*& p = getPtr();
- delete p;
- p = new Settings();
+ }
+
+ SettingsConfigPtr Settings::getSettingsConfig()
+ {
+ return mSettingsConfig;
}
- Settings* Settings::saveAndReset()
+ void Settings::reset()
{
- Globals::get().invalidateCallSites();
-
- Settings*& p = getPtr();
- Settings* originalSettings = p;
- p = new Settings();
- return originalSettings;
+ Globals::getInstance()->invalidateCallSites();
+ mSettingsConfig = new SettingsConfig();
}
- void Settings::restore(Settings* originalSettings)
+ SettingsStoragePtr Settings::saveAndReset()
{
- Globals::get().invalidateCallSites();
-
- Settings*& p = getPtr();
- delete p;
- p = originalSettings;
+ SettingsStoragePtr oldSettingsConfig(mSettingsConfig.get());
+ reset();
+ return oldSettingsConfig;
}
- Settings*& Settings::getPtr()
+ void Settings::restore(SettingsStoragePtr pSettingsStorage)
{
- static Settings* currentSettings = NULL;
- return currentSettings;
+ Globals::getInstance()->invalidateCallSites();
+ SettingsConfigPtr newSettingsConfig(dynamic_cast<SettingsConfig *>(pSettingsStorage.get()));
+ mSettingsConfig = newSettingsConfig;
}
}
@@ -489,18 +513,64 @@ namespace LLError
int line,
const std::type_info& class_info,
const char* function,
- const char* broadTag,
- const char* narrowTag,
- bool printOnce)
- : mLevel(level), mFile(file), mLine(line),
- mClassInfo(class_info), mFunction(function),
- mCached(false), mShouldLog(false),
- mBroadTag(broadTag), mNarrowTag(narrowTag), mPrintOnce(printOnce)
- { }
+ bool printOnce,
+ const char** tags,
+ size_t tag_count)
+ : mLevel(level),
+ mFile(file),
+ mLine(line),
+ mClassInfo(class_info),
+ mFunction(function),
+ mCached(false),
+ mShouldLog(false),
+ mPrintOnce(printOnce),
+ mTags(new const char* [tag_count]),
+ mTagCount(tag_count)
+ {
+ for (int i = 0; i < tag_count; i++)
+ {
+ mTags[i] = tags[i];
+ }
+
+ switch (mLevel)
+ {
+ case LEVEL_DEBUG: mLevelString = "DEBUG:"; break;
+ case LEVEL_INFO: mLevelString = "INFO:"; break;
+ case LEVEL_WARN: mLevelString = "WARNING:"; break;
+ case LEVEL_ERROR: mLevelString = "ERROR:"; break;
+ default: mLevelString = "XXX:"; break;
+ };
+
+ mLocationString = llformat("%s(%d) :", abbreviateFile(mFile).c_str(), mLine);
+#if LL_WINDOWS
+ // DevStudio: __FUNCTION__ already includes the full class name
+#else
+#if LL_LINUX
+ // gross, but typeid comparison seems to always fail here with gcc4.1
+ if (0 != strcmp(mClassInfo.name(), typeid(NoClassInfo).name()))
+#else
+ if (mClassInfo != typeid(NoClassInfo))
+#endif // LL_LINUX
+ {
+ mFunctionString = className(mClassInfo) + "::";
+ }
+#endif
+ mFunctionString += std::string(mFunction) + ":";
+ for (size_t i = 0; i < mTagCount; i++)
+ {
+ mTagString += std::string("#") + mTags[i] + ((i == mTagCount - 1) ? "" : " ");
+ }
+ }
+ CallSite::~CallSite()
+ {
+ delete []mTags;
+ }
void CallSite::invalidate()
- { mCached = false; }
+ {
+ mCached = false;
+ }
}
namespace
@@ -533,7 +603,7 @@ namespace
void commonInit(const std::string& dir, bool log_to_stderr = true)
{
- LLError::Settings::reset();
+ LLError::Settings::getInstance()->reset();
LLError::setDefaultLevel(LLError::LEVEL_INFO);
LLError::setFatalFunction(LLError::crashAndLoop);
@@ -542,11 +612,13 @@ namespace
// log_to_stderr is only false in the unit and integration tests to keep builds quieter
if (log_to_stderr && shouldLogToStderr())
{
- LLError::addRecorder(new RecordToStderr(stderrLogWantsTime()));
+ LLError::RecorderPtr recordToStdErr(new RecordToStderr(stderrLogWantsTime()));
+ LLError::addRecorder(recordToStdErr);
}
#if LL_WINDOWS
- LLError::addRecorder(new RecordToWinDebug);
+ LLError::RecorderPtr recordToWinDebug(new RecordToWinDebug());
+ LLError::addRecorder(recordToWinDebug);
#endif
LogControlFile& e = LogControlFile::fromDirectory(dir);
@@ -574,7 +646,8 @@ namespace LLError
}
commonInit(dir);
#if !LL_WINDOWS
- addRecorder(new RecordToSyslog(identity));
+ LLError::RecorderPtr recordToSyslog(new RecordToSyslog(identity));
+ addRecorder(recordToSyslog);
#endif
}
@@ -585,72 +658,67 @@ namespace LLError
void setPrintLocation(bool print)
{
- Settings& s = Settings::get();
- s.printLocation = print;
+ SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
+ s->mPrintLocation = print;
}
void setFatalFunction(const FatalFunction& f)
{
- Settings& s = Settings::get();
- s.crashFunction = f;
+ SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
+ s->mCrashFunction = f;
}
FatalFunction getFatalFunction()
{
- Settings& s = Settings::get();
- return s.crashFunction;
+ SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
+ return s->mCrashFunction;
}
void setTimeFunction(TimeFunction f)
{
- Settings& s = Settings::get();
- s.timeFunction = f;
+ SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
+ s->mTimeFunction = f;
}
void setDefaultLevel(ELevel level)
{
- Globals& g = Globals::get();
- Settings& s = Settings::get();
- g.invalidateCallSites();
- s.defaultLevel = level;
+ Globals::getInstance()->invalidateCallSites();
+ SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
+ s->mDefaultLevel = level;
}
ELevel getDefaultLevel()
{
- Settings& s = Settings::get();
- return s.defaultLevel;
+ SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
+ return s->mDefaultLevel;
}
void setFunctionLevel(const std::string& function_name, ELevel level)
{
- Globals& g = Globals::get();
- Settings& s = Settings::get();
- g.invalidateCallSites();
- s.functionLevelMap[function_name] = level;
+ Globals::getInstance()->invalidateCallSites();
+ SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
+ s->mFunctionLevelMap[function_name] = level;
}
void setClassLevel(const std::string& class_name, ELevel level)
{
- Globals& g = Globals::get();
- Settings& s = Settings::get();
- g.invalidateCallSites();
- s.classLevelMap[class_name] = level;
+ Globals::getInstance()->invalidateCallSites();
+ SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
+ s->mClassLevelMap[class_name] = level;
}
void setFileLevel(const std::string& file_name, ELevel level)
{
- Globals& g = Globals::get();
- Settings& s = Settings::get();
- g.invalidateCallSites();
- s.fileLevelMap[file_name] = level;
+ Globals::getInstance()->invalidateCallSites();
+ SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
+ s->mFileLevelMap[file_name] = level;
}
void setTagLevel(const std::string& tag_name, ELevel level)
{
- Globals& g = Globals::get();
- Settings& s = Settings::get();
- g.invalidateCallSites();
- s.tagLevelMap[tag_name] = level;
+ Globals::getInstance()->invalidateCallSites();
+ SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
+ s->mTagLevelMap[tag_name] = level;
}
LLError::ELevel decodeLevel(std::string name)
@@ -671,7 +739,7 @@ namespace LLError
LevelMap::const_iterator i = level_names.find(name);
if (i == level_names.end())
{
- llwarns << "unrecognized logging level: '" << name << "'" << llendl;
+ LL_WARNS() << "unrecognized logging level: '" << name << "'" << LL_ENDL;
return LLError::LEVEL_INFO;
}
@@ -694,15 +762,14 @@ namespace LLError
{
void configure(const LLSD& config)
{
- Globals& g = Globals::get();
- Settings& s = Settings::get();
+ Globals::getInstance()->invalidateCallSites();
+ SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
- g.invalidateCallSites();
- s.functionLevelMap.clear();
- s.classLevelMap.clear();
- s.fileLevelMap.clear();
- s.tagLevelMap.clear();
- s.uniqueLogMessages.clear();
+ s->mFunctionLevelMap.clear();
+ s->mClassLevelMap.clear();
+ s->mFileLevelMap.clear();
+ s->mTagLevelMap.clear();
+ s->mUniqueLogMessages.clear();
setPrintLocation(config["print-location"]);
setDefaultLevel(decodeLevel(config["default-level"]));
@@ -715,10 +782,10 @@ namespace LLError
ELevel level = decodeLevel(entry["level"]);
- setLevels(s.functionLevelMap, entry["functions"], level);
- setLevels(s.classLevelMap, entry["classes"], level);
- setLevels(s.fileLevelMap, entry["files"], level);
- setLevels(s.tagLevelMap, entry["tags"], level);
+ setLevels(s->mFunctionLevelMap, entry["functions"], level);
+ setLevels(s->mClassLevelMap, entry["classes"], level);
+ setLevels(s->mFileLevelMap, entry["files"], level);
+ setLevels(s->mTagLevelMap, entry["tags"], level);
}
}
}
@@ -726,35 +793,67 @@ namespace LLError
namespace LLError
{
+ Recorder::Recorder()
+ : mWantsTime(false),
+ mWantsTags(false),
+ mWantsLevel(true),
+ mWantsLocation(false),
+ mWantsFunctionName(true)
+ {
+ }
+
Recorder::~Recorder()
- { }
+ {
+ }
- // virtual
bool Recorder::wantsTime()
- { return false; }
+ {
+ return mWantsTime;
+ }
+ // virtual
+ bool Recorder::wantsTags()
+ {
+ return mWantsTags;
+ }
+ // virtual
+ bool Recorder::wantsLevel()
+ {
+ return mWantsLevel;
+ }
- void addRecorder(Recorder* recorder)
+ // virtual
+ bool Recorder::wantsLocation()
+ {
+ return mWantsLocation;
+ }
+
+ // virtual
+ bool Recorder::wantsFunctionName()
+ {
+ return mWantsFunctionName;
+ }
+
+ void addRecorder(RecorderPtr recorder)
{
- if (recorder == NULL)
+ if (!recorder)
{
return;
}
- Settings& s = Settings::get();
- s.recorders.push_back(recorder);
+ SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
+ s->mRecorders.push_back(recorder);
}
- void removeRecorder(Recorder* recorder)
+ void removeRecorder(RecorderPtr recorder)
{
- if (recorder == NULL)
+ if (!recorder)
{
return;
}
- Settings& s = Settings::get();
- s.recorders.erase(
- std::remove(s.recorders.begin(), s.recorders.end(), recorder),
- s.recorders.end());
+ SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
+ s->mRecorders.erase(std::remove(s->mRecorders.begin(), s->mRecorders.end(), recorder),
+ s->mRecorders.end());
}
}
@@ -762,126 +861,136 @@ namespace LLError
{
void logToFile(const std::string& file_name)
{
- LLError::Settings& s = LLError::Settings::get();
+ SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
- removeRecorder(s.fileRecorder);
- delete s.fileRecorder;
- s.fileRecorder = NULL;
- s.fileRecorderFileName.clear();
+ removeRecorder(s->mFileRecorder);
+ s->mFileRecorder.reset();
+ s->mFileRecorderFileName.clear();
if (file_name.empty())
{
return;
}
- RecordToFile* f = new RecordToFile(file_name);
- if (!f->okay())
+ RecorderPtr recordToFile(new RecordToFile(file_name));
+ if (boost::dynamic_pointer_cast<RecordToFile>(recordToFile)->okay())
{
- delete f;
- return;
+ s->mFileRecorderFileName = file_name;
+ s->mFileRecorder = recordToFile;
+ addRecorder(recordToFile);
}
-
- s.fileRecorderFileName = file_name;
- s.fileRecorder = f;
- addRecorder(f);
}
void logToFixedBuffer(LLLineBuffer* fixedBuffer)
{
- LLError::Settings& s = LLError::Settings::get();
+ SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
- removeRecorder(s.fixedBufferRecorder);
- delete s.fixedBufferRecorder;
- s.fixedBufferRecorder = NULL;
+ removeRecorder(s->mFixedBufferRecorder);
+ s->mFixedBufferRecorder.reset();
if (!fixedBuffer)
{
return;
}
- s.fixedBufferRecorder = new RecordToFixedBuffer(fixedBuffer);
- addRecorder(s.fixedBufferRecorder);
+ RecorderPtr recordToFixedBuffer(new RecordToFixedBuffer(fixedBuffer));
+ s->mFixedBufferRecorder = recordToFixedBuffer;
+ addRecorder(recordToFixedBuffer);
}
std::string logFileName()
{
- LLError::Settings& s = LLError::Settings::get();
- return s.fileRecorderFileName;
+ SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
+ return s->mFileRecorderFileName;
}
}
namespace
{
- void writeToRecorders(LLError::ELevel level, const std::string& message)
+ void writeToRecorders(const LLError::CallSite& site, const std::string& message, bool show_location = true, bool show_time = true, bool show_tags = true, bool show_level = true, bool show_function = true)
{
- LLError::Settings& s = LLError::Settings::get();
+ LLError::ELevel level = site.mLevel;
+ LLError::SettingsConfigPtr s = LLError::Settings::getInstance()->getSettingsConfig();
- std::string messageWithTime;
-
- for (Recorders::const_iterator i = s.recorders.begin();
- i != s.recorders.end();
+ for (Recorders::const_iterator i = s->mRecorders.begin();
+ i != s->mRecorders.end();
++i)
{
- LLError::Recorder* r = *i;
+ LLError::RecorderPtr r = *i;
- if (r->wantsTime() && s.timeFunction != NULL)
+ std::ostringstream message_stream;
+
+ if (show_location && (r->wantsLocation() || level == LLError::LEVEL_ERROR || s->mPrintLocation))
+ {
+ message_stream << site.mLocationString << " ";
+ }
+
+ if (show_time && r->wantsTime() && s->mTimeFunction != NULL)
{
- if (messageWithTime.empty())
+ message_stream << s->mTimeFunction() << " ";
+ }
+
+ if (show_level && r->wantsLevel())
{
- messageWithTime = s.timeFunction() + " " + message;
+ message_stream << site.mLevelString << " ";
}
- r->recordMessage(level, messageWithTime);
+ if (show_tags && r->wantsTags())
+ {
+ message_stream << site.mTagString << " ";
}
- else
+
+ if (show_function && r->wantsFunctionName())
{
- r->recordMessage(level, message);
+ message_stream << site.mFunctionString << " ";
}
+
+ message_stream << message;
+
+ r->recordMessage(level, message_stream.str());
}
}
}
-
-/*
-Recorder formats:
-
-$type = "ERROR" | "WARNING" | "ALERT" | "INFO" | "DEBUG"
-$loc = "$file($line)"
-$msg = "$loc : " if FATAL or printing loc
- "" otherwise
-$msg += "$type: "
-$msg += contents of stringstream
-
-$time = "%Y-%m-%dT%H:%M:%SZ" if UTC
- or "%Y-%m-%dT%H:%M:%S %Z" if local
-
-syslog: "$msg"
-file: "$time $msg\n"
-stderr: "$time $msg\n" except on windows, "$msg\n"
-fixedbuf: "$msg"
-winddebug: "$msg\n"
-
-Note: if FATAL, an additional line gets logged first, with $msg set to
- "$loc : error"
-
-You get:
- llfoo.cpp(42) : error
- llfoo.cpp(42) : ERROR: something
-
-*/
-
namespace {
bool checkLevelMap(const LevelMap& map, const std::string& key,
LLError::ELevel& level)
{
+ bool stop_checking;
LevelMap::const_iterator i = map.find(key);
if (i == map.end())
{
- return false;
+ return stop_checking = false;
}
level = i->second;
- return true;
+ return stop_checking = true;
+ }
+
+ bool checkLevelMap( const LevelMap& map,
+ const char *const * keys,
+ size_t count,
+ LLError::ELevel& level)
+ {
+ bool found_level = false;
+
+ LLError::ELevel tag_level = LLError::LEVEL_NONE;
+
+ for (size_t i = 0; i < count; i++)
+ {
+ LevelMap::const_iterator it = map.find(keys[i]);
+ if (it != map.end())
+ {
+ found_level = true;
+ tag_level = llmin(tag_level, it->second);
+ }
+ }
+
+ if (found_level)
+ {
+ level = tag_level;
+ }
+ return found_level;
}
class LogLock
@@ -945,12 +1054,11 @@ namespace LLError
return false;
}
- Globals& g = Globals::get();
- Settings& s = Settings::get();
+ SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
- s.shouldLogCallCounter += 1;
+ s->mShouldLogCallCounter++;
- std::string class_name = className(site.mClassInfo);
+ const std::string& class_name = className(site.mClassInfo);
std::string function_name = functionName(site.mFunction);
#if LL_LINUX
// gross, but typeid comparison seems to always fail here with gcc4.1
@@ -962,20 +1070,21 @@ namespace LLError
function_name = class_name + "::" + function_name;
}
- ELevel compareLevel = s.defaultLevel;
+ ELevel compareLevel = s->mDefaultLevel;
// The most specific match found will be used as the log level,
// since the computation short circuits.
// So, in increasing order of importance:
- // Default < Broad Tag < File < Class < Function < Narrow Tag
- ((site.mNarrowTag != NULL) ? checkLevelMap(s.tagLevelMap, site.mNarrowTag, compareLevel) : false)
- || checkLevelMap(s.functionLevelMap, function_name, compareLevel)
- || checkLevelMap(s.classLevelMap, class_name, compareLevel)
- || checkLevelMap(s.fileLevelMap, abbreviateFile(site.mFile), compareLevel)
- || ((site.mBroadTag != NULL) ? checkLevelMap(s.tagLevelMap, site.mBroadTag, compareLevel) : false);
+ // Default < Tags < File < Class < Function
+ checkLevelMap(s->mFunctionLevelMap, function_name, compareLevel)
+ || checkLevelMap(s->mClassLevelMap, class_name, compareLevel)
+ || checkLevelMap(s->mFileLevelMap, abbreviateFile(site.mFile), compareLevel)
+ || (site.mTagCount > 0
+ ? checkLevelMap(s->mTagLevelMap, site.mTags, site.mTagCount, compareLevel)
+ : false);
site.mCached = true;
- g.addCallSite(site);
+ Globals::getInstance()->addCallSite(site);
return site.mShouldLog = site.mLevel >= compareLevel;
}
@@ -985,12 +1094,12 @@ namespace LLError
LogLock lock;
if (lock.ok())
{
- Globals& g = Globals::get();
+ Globals* g = Globals::getInstance();
- if (!g.messageStreamInUse)
+ if (!g->messageStreamInUse)
{
- g.messageStreamInUse = true;
- return &g.messageStream;
+ g->messageStreamInUse = true;
+ return &g->messageStream;
}
}
@@ -1015,12 +1124,12 @@ namespace LLError
message[127] = '\0' ;
}
- Globals& g = Globals::get();
- if (out == &g.messageStream)
+ Globals* g = Globals::getInstance();
+ if (out == &g->messageStream)
{
- g.messageStream.clear();
- g.messageStream.str("");
- g.messageStreamInUse = false;
+ g->messageStream.clear();
+ g->messageStream.str("");
+ g->messageStreamInUse = false;
}
else
{
@@ -1037,15 +1146,15 @@ namespace LLError
return;
}
- Globals& g = Globals::get();
- Settings& s = Settings::get();
+ Globals* g = Globals::getInstance();
+ SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
std::string message = out->str();
- if (out == &g.messageStream)
+ if (out == &g->messageStream)
{
- g.messageStream.clear();
- g.messageStream.str("");
- g.messageStreamInUse = false;
+ g->messageStream.clear();
+ g->messageStream.str("");
+ g->messageStreamInUse = false;
}
else
{
@@ -1054,56 +1163,21 @@ namespace LLError
if (site.mLevel == LEVEL_ERROR)
{
- std::ostringstream fatalMessage;
- fatalMessage << abbreviateFile(site.mFile)
- << "(" << site.mLine << ") : error";
-
- writeToRecorders(site.mLevel, fatalMessage.str());
+ writeToRecorders(site, "error", true, true, true, false, false);
}
-
- std::ostringstream prefix;
-
- switch (site.mLevel)
- {
- case LEVEL_DEBUG: prefix << "DEBUG: "; break;
- case LEVEL_INFO: prefix << "INFO: "; break;
- case LEVEL_WARN: prefix << "WARNING: "; break;
- case LEVEL_ERROR: prefix << "ERROR: "; break;
- default: prefix << "XXX: "; break;
- };
-
- if (s.printLocation)
- {
- prefix << abbreviateFile(site.mFile)
- << "(" << site.mLine << ") : ";
- }
-
- #if LL_WINDOWS
- // DevStudio: __FUNCTION__ already includes the full class name
- #else
- #if LL_LINUX
- // gross, but typeid comparison seems to always fail here with gcc4.1
- if (0 != strcmp(site.mClassInfo.name(), typeid(NoClassInfo).name()))
- #else
- if (site.mClassInfo != typeid(NoClassInfo))
- #endif // LL_LINUX
- {
- prefix << className(site.mClassInfo) << "::";
- }
- #endif
- prefix << site.mFunction << ": ";
+ std::ostringstream message_stream;
if (site.mPrintOnce)
{
- std::map<std::string, unsigned int>::iterator messageIter = s.uniqueLogMessages.find(message);
- if (messageIter != s.uniqueLogMessages.end())
+ std::map<std::string, unsigned int>::iterator messageIter = s->mUniqueLogMessages.find(message);
+ if (messageIter != s->mUniqueLogMessages.end())
{
messageIter->second++;
unsigned int num_messages = messageIter->second;
if (num_messages == 10 || num_messages == 50 || (num_messages % 100) == 0)
{
- prefix << "ONCE (" << num_messages << "th time seen): ";
+ message_stream << "ONCE (" << num_messages << "th time seen): ";
}
else
{
@@ -1112,36 +1186,32 @@ namespace LLError
}
else
{
- prefix << "ONCE: ";
- s.uniqueLogMessages[message] = 1;
+ message_stream << "ONCE: ";
+ s->mUniqueLogMessages[message] = 1;
}
}
- prefix << message;
- message = prefix.str();
+ message_stream << message;
- writeToRecorders(site.mLevel, message);
+ writeToRecorders(site, message_stream.str());
- if (site.mLevel == LEVEL_ERROR && s.crashFunction)
+ if (site.mLevel == LEVEL_ERROR && s->mCrashFunction)
{
- s.crashFunction(message);
+ s->mCrashFunction(message_stream.str());
}
}
}
-
-
-
namespace LLError
{
- Settings* saveAndResetSettings()
+ SettingsStoragePtr saveAndResetSettings()
{
- return Settings::saveAndReset();
+ return Settings::getInstance()->saveAndReset();
}
- void restoreSettings(Settings* s)
+ void restoreSettings(SettingsStoragePtr pSettingsStorage)
{
- return Settings::restore(s);
+ return Settings::getInstance()->restore(pSettingsStorage);
}
std::string removePrefix(std::string& s, const std::string& p)
@@ -1187,8 +1257,8 @@ namespace LLError
int shouldLogCallCount()
{
- Settings& s = Settings::get();
- return s.shouldLogCallCounter;
+ SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
+ return s->mShouldLogCallCounter;
}
#if LL_WINDOWS
@@ -1297,15 +1367,9 @@ namespace LLError
#endif
//static
- void LLCallStacks::push(const char* function, const int line)
+ void LLCallStacks::allocateStackBuffer()
{
- CallStacksLogLock lock;
- if (!lock.ok())
- {
- return;
- }
-
- if(!sBuffer)
+ if(sBuffer == NULL)
{
sBuffer = new char*[512] ;
sBuffer[0] = new char[512 * 128] ;
@@ -1315,6 +1379,31 @@ namespace LLError
}
sIndex = 0 ;
}
+ }
+
+ void LLCallStacks::freeStackBuffer()
+ {
+ if(sBuffer != NULL)
+ {
+ delete [] sBuffer[0] ;
+ delete [] sBuffer ;
+ sBuffer = NULL ;
+ }
+ }
+
+ //static
+ void LLCallStacks::push(const char* function, const int line)
+ {
+ CallStacksLogLock lock;
+ if (!lock.ok())
+ {
+ return;
+ }
+
+ if(sBuffer == NULL)
+ {
+ allocateStackBuffer();
+ }
if(sIndex > 511)
{
@@ -1346,15 +1435,9 @@ namespace LLError
return;
}
- if(!sBuffer)
+ if(sBuffer == NULL)
{
- sBuffer = new char*[512] ;
- sBuffer[0] = new char[512 * 128] ;
- for(S32 i = 1 ; i < 512 ; i++)
- {
- sBuffer[i] = sBuffer[i-1] + 128 ;
- }
- sIndex = 0 ;
+ allocateStackBuffer();
}
if(sIndex > 511)
@@ -1376,20 +1459,18 @@ namespace LLError
if(sIndex > 0)
{
- llinfos << " ************* PRINT OUT LL CALL STACKS ************* " << llendl ;
+ LL_INFOS() << " ************* PRINT OUT LL CALL STACKS ************* " << LL_ENDL;
while(sIndex > 0)
{
sIndex-- ;
- llinfos << sBuffer[sIndex] << llendl ;
+ LL_INFOS() << sBuffer[sIndex] << LL_ENDL;
}
- llinfos << " *************** END OF LL CALL STACKS *************** " << llendl ;
+ LL_INFOS() << " *************** END OF LL CALL STACKS *************** " << LL_ENDL;
}
- if(sBuffer)
+ if(sBuffer != NULL)
{
- delete[] sBuffer[0] ;
- delete[] sBuffer ;
- sBuffer = NULL ;
+ freeStackBuffer();
}
}
@@ -1399,26 +1480,10 @@ namespace LLError
sIndex = 0 ;
}
-#if LL_WINDOWS
- void LLOutputDebugUTF8(const std::string& s)
- {
- // Be careful when calling OutputDebugString as it throws DBG_PRINTEXCEPTION_C
- // which works just fine under the windows debugger, but can cause users who
- // have enabled SEHOP exception chain validation to crash due to interactions
- // between the Win 32-bit exception handling and boost coroutine fiber stacks. BUG-2707
- //
- if (IsDebuggerPresent())
- {
- // Need UTF16 for Unicode OutputDebugString
- //
- if (s.size())
- {
- OutputDebugString(utf8str_to_utf16str(s).c_str());
- OutputDebugString(TEXT("\n"));
- }
- }
- }
-#endif
-
+ //static
+ void LLCallStacks::cleanup()
+ {
+ freeStackBuffer();
+ }
}
diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h
index 0b723aeb5d..63040e1772 100755
--- a/indra/llcommon/llerror.h
+++ b/indra/llcommon/llerror.h
@@ -31,9 +31,68 @@
#include <sstream>
#include <typeinfo>
-#include "llerrorlegacy.h"
#include "stdtypes.h"
+#include "llpreprocessor.h"
+#include <boost/static_assert.hpp>
+
+const int LL_ERR_NOERR = 0;
+
+// Define one of these for different error levels in release...
+// #define RELEASE_SHOW_DEBUG // Define this if you want your release builds to show lldebug output.
+#define RELEASE_SHOW_INFO // Define this if you want your release builds to show llinfo output
+#define RELEASE_SHOW_WARN // Define this if you want your release builds to show llwarn output.
+
+#ifdef _DEBUG
+#define SHOW_DEBUG
+#define SHOW_WARN
+#define SHOW_INFO
+#define SHOW_ASSERT
+#else // _DEBUG
+
+#ifdef LL_RELEASE_WITH_DEBUG_INFO
+#define SHOW_ASSERT
+#endif // LL_RELEASE_WITH_DEBUG_INFO
+
+#ifdef RELEASE_SHOW_DEBUG
+#define SHOW_DEBUG
+#endif
+
+#ifdef RELEASE_SHOW_WARN
+#define SHOW_WARN
+#endif
+
+#ifdef RELEASE_SHOW_INFO
+#define SHOW_INFO
+#endif
+
+#ifdef RELEASE_SHOW_ASSERT
+#define SHOW_ASSERT
+#endif
+
+#endif // !_DEBUG
+
+#define llassert_always_msg(func, msg) if (LL_UNLIKELY(!(func))) LL_ERRS() << "ASSERT (" << msg << ")" << LL_ENDL
+
+#define llassert_always(func) llassert_always_msg(func, #func)
+
+#ifdef SHOW_ASSERT
+#define llassert(func) llassert_always_msg(func, #func)
+#define llverify(func) llassert_always_msg(func, #func)
+#else
+#define llassert(func)
+#define llverify(func) do {if (func) {}} while(0)
+#endif
+
+#ifdef LL_WINDOWS
+#define LL_STATIC_ASSERT(func, msg) static_assert(func, msg)
+#define LL_BAD_TEMPLATE_INSTANTIATION(type, msg) static_assert(false, msg)
+#else
+#define LL_STATIC_ASSERT(func, msg) BOOST_STATIC_ASSERT(func)
+#define LL_BAD_TEMPLATE_INSTANTIATION(type, msg) BOOST_STATIC_ASSERT(sizeof(type) != 0 && false);
+#endif
+
+
/** Error Logging Facility
Information for most users:
@@ -121,50 +180,62 @@ namespace LLError
They are not intended for general use.
*/
- class CallSite;
+ struct CallSite;
class LL_COMMON_API Log
{
public:
static bool shouldLog(CallSite&);
static std::ostringstream* out();
- static void flush(std::ostringstream* out, char* message) ;
+ static void flush(std::ostringstream* out, char* message);
static void flush(std::ostringstream*, const CallSite&);
};
- class LL_COMMON_API CallSite
+ struct LL_COMMON_API CallSite
{
// Represents a specific place in the code where a message is logged
// This is public because it is used by the macros below. It is not
// intended for public use.
- public:
- CallSite(ELevel, const char* file, int line,
- const std::type_info& class_info, const char* function, const char* broadTag, const char* narrowTag, bool printOnce);
-
+ CallSite(ELevel level,
+ const char* file,
+ int line,
+ const std::type_info& class_info,
+ const char* function,
+ bool print_once,
+ const char** tags,
+ size_t tag_count);
+
+ ~CallSite();
+
#ifdef LL_LIBRARY_INCLUDE
bool shouldLog();
#else // LL_LIBRARY_INCLUDE
bool shouldLog()
- { return mCached ? mShouldLog : Log::shouldLog(*this); }
+ {
+ return mCached
+ ? mShouldLog
+ : Log::shouldLog(*this);
+ }
// this member function needs to be in-line for efficiency
#endif // LL_LIBRARY_INCLUDE
void invalidate();
- private:
// these describe the call site and never change
const ELevel mLevel;
const char* const mFile;
- const int mLine;
- const std::type_info& mClassInfo;
+ const int mLine;
+ const std::type_info& mClassInfo;
const char* const mFunction;
- const char* const mBroadTag;
- const char* const mNarrowTag;
- const bool mPrintOnce;
-
- // these implement a cache of the call to shouldLog()
- bool mCached;
- bool mShouldLog;
+ const char** mTags;
+ size_t mTagCount;
+ const bool mPrintOnce;
+ const char* mLevelString;
+ std::string mLocationString,
+ mFunctionString,
+ mTagString;
+ bool mCached,
+ mShouldLog;
friend class Log;
};
@@ -190,6 +261,9 @@ namespace LLError
private:
static char** sBuffer ;
static S32 sIndex ;
+
+ static void allocateStackBuffer();
+ static void freeStackBuffer();
public:
static void push(const char* function, const int line) ;
@@ -197,33 +271,25 @@ namespace LLError
static void print() ;
static void clear() ;
static void end(std::ostringstream* _out) ;
+ static void cleanup();
};
-
-#if LL_WINDOWS
- void LLOutputDebugUTF8(const std::string& s);
-#endif
-
}
-#if LL_WINDOWS
- // Macro accepting a std::string for display in windows debugging console
- #define LL_WINDOWS_OUTPUT_DEBUG(a) LLError::LLOutputDebugUTF8(a)
-#else
- #define LL_WINDOWS_OUTPUT_DEBUG(a)
-#endif
-
//this is cheaper than llcallstacks if no need to output other variables to call stacks.
-#define llpushcallstacks LLError::LLCallStacks::push(__FUNCTION__, __LINE__)
-#define llcallstacks \
- {\
+#define LL_PUSH_CALLSTACKS() LLError::LLCallStacks::push(__FUNCTION__, __LINE__)
+
+#define llcallstacks \
+ { \
std::ostringstream* _out = LLError::LLCallStacks::insert(__FUNCTION__, __LINE__) ; \
(*_out)
-#define llcallstacksendl \
- LLError::End(); \
+
+#define llcallstacksendl \
+ LLError::End(); \
LLError::LLCallStacks::end(_out) ; \
}
-#define llclearcallstacks LLError::LLCallStacks::clear()
-#define llprintcallstacks LLError::LLCallStacks::print()
+
+#define LL_CLEAR_CALLSTACKS() LLError::LLCallStacks::clear()
+#define LL_PRINT_CALLSTACKS() LLError::LLCallStacks::print()
/*
Class type information for logging
@@ -237,78 +303,72 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG;
// Outside a class declaration, or in class without LOG_CLASS(), this
// typedef causes the messages to not be associated with any class.
+/////////////////////////////////
+// Error Logging Macros
+// See top of file for common usage.
+/////////////////////////////////
+// this macro uses a one-shot do statement to avoid parsing errors when writing control flow statements
+// without braces:
+// if (condition) LL_INFOS() << "True" << LL_ENDL; else LL_INFOS()() << "False" << LL_ENDL
+#define lllog(level, once, ...) \
+ do { \
+ const char* tags[] = {"", ##__VA_ARGS__}; \
+ ::size_t tag_count = LL_ARRAY_SIZE(tags) - 1; \
+ static LLError::CallSite _site( \
+ level, __FILE__, __LINE__, typeid(_LL_CLASS_TO_LOG), __FUNCTION__, once, &tags[1], tag_count);\
+ if (LL_UNLIKELY(_site.shouldLog())) \
+ { \
+ std::ostringstream* _out = LLError::Log::out(); \
+ (*_out)
+//Use this construct if you need to do computation in the middle of a
+//message:
+//
+// LL_INFOS("AgentGesture") << "the agent " << agend_id;
+// switch (f)
+// {
+// case FOP_SHRUGS: LL_CONT << "shrugs"; break;
+// case FOP_TAPS: LL_CONT << "points at " << who; break;
+// case FOP_SAYS: LL_CONT << "says " << message; break;
+// }
+// LL_CONT << " for " << t << " seconds" << LL_ENDL;
+//
+//Such computation is done iff the message will be logged.
+#define LL_CONT (*_out)
-/*
- Error Logging Macros
- See top of file for common usage.
-*/
-
-#define lllog(level, broadTag, narrowTag, once) \
- do { \
- static LLError::CallSite _site( \
- level, __FILE__, __LINE__, typeid(_LL_CLASS_TO_LOG), __FUNCTION__, broadTag, narrowTag, once);\
- if (LL_UNLIKELY(_site.shouldLog())) \
- { \
- std::ostringstream* _out = LLError::Log::out(); \
- (*_out)
+#define LL_NEWLINE '\n'
-// DEPRECATED: Don't call directly, use LL_ENDL instead, which actually looks like a macro
-#define llendl \
- LLError::End(); \
+#define LL_ENDL \
+ LLError::End(); \
LLError::Log::flush(_out, _site); \
- } \
+ } \
} while(0)
-// DEPRECATED: Use the new macros that allow tags and *look* like macros.
-#define lldebugs lllog(LLError::LEVEL_DEBUG, NULL, NULL, false)
-#define llinfos lllog(LLError::LEVEL_INFO, NULL, NULL, false)
-#define llwarns lllog(LLError::LEVEL_WARN, NULL, NULL, false)
-#define llerrs lllog(LLError::LEVEL_ERROR, NULL, NULL, false)
-#define llcont (*_out)
-
// NEW Macros for debugging, allow the passing of a string tag
-// One Tag
-#define LL_DEBUGS(broadTag) lllog(LLError::LEVEL_DEBUG, broadTag, NULL, false)
-#define LL_INFOS(broadTag) lllog(LLError::LEVEL_INFO, broadTag, NULL, false)
-#define LL_WARNS(broadTag) lllog(LLError::LEVEL_WARN, broadTag, NULL, false)
-#define LL_ERRS(broadTag) lllog(LLError::LEVEL_ERROR, broadTag, NULL, false)
-// Two Tags
-#define LL_DEBUGS2(broadTag, narrowTag) lllog(LLError::LEVEL_DEBUG, broadTag, narrowTag, false)
-#define LL_INFOS2(broadTag, narrowTag) lllog(LLError::LEVEL_INFO, broadTag, narrowTag, false)
-#define LL_WARNS2(broadTag, narrowTag) lllog(LLError::LEVEL_WARN, broadTag, narrowTag, false)
-#define LL_ERRS2(broadTag, narrowTag) lllog(LLError::LEVEL_ERROR, broadTag, narrowTag, false)
+// Pass comma separated list of tags (currently only supports up to 0, 1, or 2)
+#define LL_DEBUGS(...) lllog(LLError::LEVEL_DEBUG, false, ##__VA_ARGS__)
+#define LL_INFOS(...) lllog(LLError::LEVEL_INFO, false, ##__VA_ARGS__)
+#define LL_WARNS(...) lllog(LLError::LEVEL_WARN, false, ##__VA_ARGS__)
+#define LL_ERRS(...) lllog(LLError::LEVEL_ERROR, false, ##__VA_ARGS__)
+// alternative to llassert_always that prints explanatory message
+#define LL_ERRS_IF(exp, ...) if (exp) LL_ERRS(##__VA_ARGS__) << "(" #exp ")"
// Only print the log message once (good for warnings or infos that would otherwise
// spam the log file over and over, such as tighter loops).
-#define LL_DEBUGS_ONCE(broadTag) lllog(LLError::LEVEL_DEBUG, broadTag, NULL, true)
-#define LL_INFOS_ONCE(broadTag) lllog(LLError::LEVEL_INFO, broadTag, NULL, true)
-#define LL_WARNS_ONCE(broadTag) lllog(LLError::LEVEL_WARN, broadTag, NULL, true)
-#define LL_DEBUGS2_ONCE(broadTag, narrowTag) lllog(LLError::LEVEL_DEBUG, broadTag, narrowTag, true)
-#define LL_INFOS2_ONCE(broadTag, narrowTag) lllog(LLError::LEVEL_INFO, broadTag, narrowTag, true)
-#define LL_WARNS2_ONCE(broadTag, narrowTag) lllog(LLError::LEVEL_WARN, broadTag, narrowTag, true)
-
-#define LL_ENDL llendl
-#define LL_CONT (*_out)
+#define LL_DEBUGS_ONCE(...) lllog(LLError::LEVEL_DEBUG, true, ##__VA_ARGS__)
+#define LL_INFOS_ONCE(...) lllog(LLError::LEVEL_INFO, true, ##__VA_ARGS__)
+#define LL_WARNS_ONCE(...) lllog(LLError::LEVEL_WARN, true, ##__VA_ARGS__)
- /*
- Use this construct if you need to do computation in the middle of a
- message:
-
- LL_INFOS("AgentGesture") << "the agent " << agend_id;
- switch (f)
- {
- case FOP_SHRUGS: LL_CONT << "shrugs"; break;
- case FOP_TAPS: LL_CONT << "points at " << who; break;
- case FOP_SAYS: LL_CONT << "says " << message; break;
- }
- LL_CONT << " for " << t << " seconds" << LL_ENDL;
-
- Such computation is done iff the message will be logged.
- */
+// DEPRECATED: Use the new macros that allow tags and *look* like macros.
+#define lldebugs LL_COMPILE_TIME_MESSAGE("Warning: lldebugs deprecated, use LL_DEBUGS() instead") LL_DEBUGS()
+#define llinfos LL_COMPILE_TIME_MESSAGE("Warning: llinfos deprecated, use LL_INFOS() instead") LL_INFOS()
+#define llwarns LL_COMPILE_TIME_MESSAGE("Warning: llwarns deprecated, use LL_WARNS() instead") LL_WARNS()
+#define llerrs LL_COMPILE_TIME_MESSAGE("Warning: llerrs deprecated, use LL_ERRS() instead") LL_ERRS()
+#define llcont LL_COMPILE_TIME_MESSAGE("Warning: llcont deprecated, use LL_CONT instead") LL_CONT
+#define llendl LL_COMPILE_TIME_MESSAGE("Warning: llendl deprecated, use LL_ENDL instead") LL_ENDL
#endif // LL_LLERROR_H
diff --git a/indra/llcommon/llerrorcontrol.h b/indra/llcommon/llerrorcontrol.h
index 480654b1a2..56ac52e5de 100755
--- a/indra/llcommon/llerrorcontrol.h
+++ b/indra/llcommon/llerrorcontrol.h
@@ -29,7 +29,10 @@
#define LL_LLERRORCONTROL_H
#include "llerror.h"
+#include "llpointer.h"
+#include "llrefcount.h"
#include "boost/function.hpp"
+#include "boost/shared_ptr.hpp"
#include <string>
class LLSD;
@@ -136,26 +139,34 @@ namespace LLError
{
// An object that handles the actual output or error messages.
public:
+ Recorder();
virtual ~Recorder();
virtual void recordMessage(LLError::ELevel, const std::string& message) = 0;
// use the level for better display, not for filtering
- virtual bool wantsTime(); // default returns false
- // override and return true if the recorder wants the time string
- // included in the text of the message
+ bool wantsTime();
+ bool wantsTags();
+ bool wantsLevel();
+ bool wantsLocation();
+ bool wantsFunctionName();
+
+ protected:
+ bool mWantsTime,
+ mWantsTags,
+ mWantsLevel,
+ mWantsLocation,
+ mWantsFunctionName;
};
+ typedef boost::shared_ptr<Recorder> RecorderPtr;
+
/**
- * @NOTE: addRecorder() conveys ownership to the underlying Settings
- * object -- when destroyed, it will @em delete the passed Recorder*!
- */
- LL_COMMON_API void addRecorder(Recorder*);
- /**
- * @NOTE: removeRecorder() reclaims ownership of the Recorder*: its
- * lifespan becomes the caller's problem.
+ * @NOTE: addRecorder() and removeRecorder() uses the boost::shared_ptr to allow for shared ownership
+ * while still ensuring that the allocated memory is eventually freed
*/
- LL_COMMON_API void removeRecorder(Recorder*);
+ LL_COMMON_API void addRecorder(RecorderPtr);
+ LL_COMMON_API void removeRecorder(RecorderPtr);
// each error message is passed to each recorder via recordMessage()
LL_COMMON_API void logToFile(const std::string& filename);
@@ -172,9 +183,9 @@ namespace LLError
Utilities for use by the unit tests of LLError itself.
*/
- class Settings;
- LL_COMMON_API Settings* saveAndResetSettings();
- LL_COMMON_API void restoreSettings(Settings *);
+ typedef LLPointer<LLRefCount> SettingsStoragePtr;
+ LL_COMMON_API SettingsStoragePtr saveAndResetSettings();
+ LL_COMMON_API void restoreSettings(SettingsStoragePtr pSettingsStorage);
LL_COMMON_API std::string abbreviateFile(const std::string& filePath);
LL_COMMON_API int shouldLogCallCount();
diff --git a/indra/llcommon/llerrorlegacy.h b/indra/llcommon/llerrorlegacy.h
index 37cee579cd..31dd207008 100755
--- a/indra/llcommon/llerrorlegacy.h
+++ b/indra/llcommon/llerrorlegacy.h
@@ -28,91 +28,5 @@
#ifndef LL_LLERRORLEGACY_H
#define LL_LLERRORLEGACY_H
-#include "llpreprocessor.h"
-
-/*
- LEGACY -- DO NOT USE THIS STUFF ANYMORE
-*/
-
-// Specific error codes
-const int LL_ERR_NOERR = 0;
-const int LL_ERR_ASSET_REQUEST_FAILED = -1;
-//const int LL_ERR_ASSET_REQUEST_INVALID = -2;
-const int LL_ERR_ASSET_REQUEST_NONEXISTENT_FILE = -3;
-const int LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE = -4;
-const int LL_ERR_INSUFFICIENT_PERMISSIONS = -5;
-const int LL_ERR_EOF = -39;
-const int LL_ERR_CANNOT_OPEN_FILE = -42;
-const int LL_ERR_FILE_NOT_FOUND = -43;
-const int LL_ERR_FILE_EMPTY = -44;
-const int LL_ERR_TCP_TIMEOUT = -23016;
-const int LL_ERR_CIRCUIT_GONE = -23017;
-const int LL_ERR_PRICE_MISMATCH = -23018;
-
-
-
-// Define one of these for different error levels in release...
-// #define RELEASE_SHOW_DEBUG // Define this if you want your release builds to show lldebug output.
-#define RELEASE_SHOW_INFO // Define this if you want your release builds to show llinfo output
-#define RELEASE_SHOW_WARN // Define this if you want your release builds to show llwarn output.
-
-
-//////////////////////////////////////////
-//
-// Implementation - ignore
-//
-//
-#ifdef _DEBUG
-#define SHOW_DEBUG
-#define SHOW_WARN
-#define SHOW_INFO
-#define SHOW_ASSERT
-#else // _DEBUG
-
-#ifdef LL_RELEASE_WITH_DEBUG_INFO
-#define SHOW_ASSERT
-#endif // LL_RELEASE_WITH_DEBUG_INFO
-
-#ifdef RELEASE_SHOW_DEBUG
-#define SHOW_DEBUG
-#endif
-
-#ifdef RELEASE_SHOW_WARN
-#define SHOW_WARN
-#endif
-
-#ifdef RELEASE_SHOW_INFO
-#define SHOW_INFO
-#endif
-
-#ifdef RELEASE_SHOW_ASSERT
-#define SHOW_ASSERT
-#endif
-
-#endif // _DEBUG
-
-
-
-#define lldebugst(type) lldebugs
-#define llendflush llendl
-
-
-#define llerror(msg, num) llerrs << "Error # " << num << ": " << msg << llendl;
-
-#define llwarning(msg, num) llwarns << "Warning # " << num << ": " << msg << llendl;
-
-#define llassert_always(func) if (LL_UNLIKELY(!(func))) llerrs << "ASSERT (" << #func << ")" << llendl;
-
-#ifdef SHOW_ASSERT
-#define llassert(func) llassert_always(func)
-#define llverify(func) llassert_always(func)
-#else
-#define llassert(func)
-#define llverify(func) do {if (func) {}} while(0)
-#endif
-
-// handy compile-time assert - enforce those template parameters!
-#define cassert(expn) typedef char __C_ASSERT__[(expn)?1:-1] /* Flawfinder: ignore */
- //XXX: used in two places in llcommon/llskipmap.h
#endif // LL_LLERRORLEGACY_H
diff --git a/indra/llcommon/llerrorthread.cpp b/indra/llcommon/llerrorthread.cpp
index ebfbe19ff7..f6bc68b5c1 100755
--- a/indra/llcommon/llerrorthread.cpp
+++ b/indra/llcommon/llerrorthread.cpp
@@ -65,7 +65,7 @@ void get_child_status(const int waitpid_status, int &process_status, bool &exite
exited = true;
if (do_logging)
{
- llinfos << "get_child_status - Child exited cleanly with return of " << process_status << llendl;
+ LL_INFOS() << "get_child_status - Child exited cleanly with return of " << process_status << LL_ENDL;
}
return;
}
@@ -75,15 +75,15 @@ void get_child_status(const int waitpid_status, int &process_status, bool &exite
exited = true;
if (do_logging)
{
- llinfos << "get_child_status - Child died because of uncaught signal " << process_status << llendl;
+ LL_INFOS() << "get_child_status - Child died because of uncaught signal " << process_status << LL_ENDL;
#ifdef WCOREDUMP
if (WCOREDUMP(waitpid_status))
{
- llinfos << "get_child_status - Child dumped core" << llendl;
+ LL_INFOS() << "get_child_status - Child dumped core" << LL_ENDL;
}
else
{
- llinfos << "get_child_status - Child didn't dump core" << llendl;
+ LL_INFOS() << "get_child_status - Child didn't dump core" << LL_ENDL;
}
#endif
}
@@ -93,7 +93,7 @@ void get_child_status(const int waitpid_status, int &process_status, bool &exite
{
// This is weird. I just dump the waitpid status into the status code,
// not that there's any way of telling what it is...
- llinfos << "get_child_status - Got SIGCHILD but child didn't exit" << llendl;
+ LL_INFOS() << "get_child_status - Got SIGCHILD but child didn't exit" << LL_ENDL;
process_status = waitpid_status;
}
@@ -106,7 +106,7 @@ void LLErrorThread::run()
// This thread sits and waits for the sole purpose
// of waiting for the signal/exception handlers to flag the
// application state as APP_STATUS_ERROR.
- llinfos << "thread_error - Waiting for an error" << llendl;
+ LL_INFOS() << "thread_error - Waiting for an error" << LL_ENDL;
S32 counter = 0;
while (! (LLApp::isError() || LLApp::isStopped()))
@@ -117,17 +117,17 @@ void LLErrorThread::run()
if (LLApp::isError())
{
// The app is in an error state, run the application's error handler.
- //llinfos << "thread_error - An error has occurred, running error callback!" << llendl;
+ //LL_INFOS() << "thread_error - An error has occurred, running error callback!" << LL_ENDL;
// Run the error handling callback
LLApp::runErrorHandler();
}
else
{
// Everything is okay, a clean exit.
- //llinfos << "thread_error - Application exited cleanly" << llendl;
+ //LL_INFOS() << "thread_error - Application exited cleanly" << LL_ENDL;
}
- //llinfos << "thread_error - Exiting" << llendl;
+ //LL_INFOS() << "thread_error - Exiting" << LL_ENDL;
LLApp::sErrorThreadRunning = FALSE;
}
diff --git a/indra/llcommon/llevent.h b/indra/llcommon/llevent.h
index 8cd682b8bf..28ce7de102 100755
--- a/indra/llcommon/llevent.h
+++ b/indra/llcommon/llevent.h
@@ -29,8 +29,8 @@
#define LL_EVENT_H
#include "llsd.h"
+#include "llrefcount.h"
#include "llpointer.h"
-#include "llthread.h"
namespace LLOldEvents
{
diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp
index 0855180dcd..1c928b3db8 100755
--- a/indra/llcommon/llevents.cpp
+++ b/indra/llcommon/llevents.cpp
@@ -41,7 +41,6 @@
#include <algorithm>
// std headers
#include <typeinfo>
-#include <cassert>
#include <cmath>
#include <cctype>
// external library headers
diff --git a/indra/llcommon/llevents.h b/indra/llcommon/llevents.h
index 65b0fef354..0cbd1da32d 100755
--- a/indra/llcommon/llevents.h
+++ b/indra/llcommon/llevents.h
@@ -61,7 +61,7 @@
#include "llsd.h"
#include "llsingleton.h"
#include "lldependencies.h"
-#include "ll_template_cast.h"
+#include "llstl.h"
/*==========================================================================*|
// override this to allow binding free functions with more parameters
diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp
index 58db7d0d17..3d28cd15b0 100755
--- a/indra/llcommon/llfasttimer.cpp
+++ b/indra/llcommon/llfasttimer.cpp
@@ -32,8 +32,13 @@
#include "llsingleton.h"
#include "lltreeiterators.h"
#include "llsdserialize.h"
+#include "llunits.h"
+#include "llsd.h"
+#include "lltracerecording.h"
+#include "lltracethreadrecorder.h"
#include <boost/bind.hpp>
+#include <queue>
#if LL_WINDOWS
@@ -49,140 +54,115 @@
#error "architecture not supported"
#endif
+namespace LLTrace
+{
+
//////////////////////////////////////////////////////////////////////////////
// statics
-S32 LLFastTimer::sCurFrameIndex = -1;
-S32 LLFastTimer::sLastFrameIndex = -1;
-U64 LLFastTimer::sLastFrameTime = LLFastTimer::getCPUClockCount64();
-bool LLFastTimer::sPauseHistory = 0;
-bool LLFastTimer::sResetHistory = 0;
-LLFastTimer::CurTimerData LLFastTimer::sCurTimerData;
-BOOL LLFastTimer::sLog = FALSE;
-std::string LLFastTimer::sLogName = "";
-BOOL LLFastTimer::sMetricLog = FALSE;
-LLMutex* LLFastTimer::sLogLock = NULL;
-std::queue<LLSD> LLFastTimer::sLogQueue;
+bool BlockTimer::sLog = false;
+std::string BlockTimer::sLogName = "";
+bool BlockTimer::sMetricLog = false;
#if LL_LINUX || LL_SOLARIS
-U64 LLFastTimer::sClockResolution = 1000000000; // Nanosecond resolution
+U64 BlockTimer::sClockResolution = 1000000000; // Nanosecond resolution
#else
-U64 LLFastTimer::sClockResolution = 1000000; // Microsecond resolution
+U64 BlockTimer::sClockResolution = 1000000; // Microsecond resolution
#endif
-// FIXME: move these declarations to the relevant modules
-
-// helper functions
-typedef LLTreeDFSPostIter<LLFastTimer::NamedTimer, LLFastTimer::NamedTimer::child_const_iter> timer_tree_bottom_up_iterator_t;
+static LLMutex* sLogLock = NULL;
+static std::queue<LLSD> sLogQueue;
-static timer_tree_bottom_up_iterator_t begin_timer_tree_bottom_up(LLFastTimer::NamedTimer& id)
+block_timer_tree_df_iterator_t begin_block_timer_tree_df(BlockTimerStatHandle& id)
{
- return timer_tree_bottom_up_iterator_t(&id,
- boost::bind(boost::mem_fn(&LLFastTimer::NamedTimer::beginChildren), _1),
- boost::bind(boost::mem_fn(&LLFastTimer::NamedTimer::endChildren), _1));
+ return block_timer_tree_df_iterator_t(&id,
+ boost::bind(boost::mem_fn(&BlockTimerStatHandle::beginChildren), _1),
+ boost::bind(boost::mem_fn(&BlockTimerStatHandle::endChildren), _1));
}
-static timer_tree_bottom_up_iterator_t end_timer_tree_bottom_up()
+block_timer_tree_df_iterator_t end_block_timer_tree_df()
{
- return timer_tree_bottom_up_iterator_t();
+ return block_timer_tree_df_iterator_t();
}
-typedef LLTreeDFSIter<LLFastTimer::NamedTimer, LLFastTimer::NamedTimer::child_const_iter> timer_tree_dfs_iterator_t;
-
+block_timer_tree_df_post_iterator_t begin_block_timer_tree_df_post(BlockTimerStatHandle& id)
+{
+ return block_timer_tree_df_post_iterator_t(&id,
+ boost::bind(boost::mem_fn(&BlockTimerStatHandle::beginChildren), _1),
+ boost::bind(boost::mem_fn(&BlockTimerStatHandle::endChildren), _1));
+}
-static timer_tree_dfs_iterator_t begin_timer_tree(LLFastTimer::NamedTimer& id)
+block_timer_tree_df_post_iterator_t end_block_timer_tree_df_post()
{
- return timer_tree_dfs_iterator_t(&id,
- boost::bind(boost::mem_fn(&LLFastTimer::NamedTimer::beginChildren), _1),
- boost::bind(boost::mem_fn(&LLFastTimer::NamedTimer::endChildren), _1));
+ return block_timer_tree_df_post_iterator_t();
}
-static timer_tree_dfs_iterator_t end_timer_tree()
+block_timer_tree_bf_iterator_t begin_block_timer_tree_bf(BlockTimerStatHandle& id)
{
- return timer_tree_dfs_iterator_t();
+ return block_timer_tree_bf_iterator_t(&id,
+ boost::bind(boost::mem_fn(&BlockTimerStatHandle::beginChildren), _1),
+ boost::bind(boost::mem_fn(&BlockTimerStatHandle::endChildren), _1));
}
-// factory class that creates NamedTimers via static DeclareTimer objects
-class NamedTimerFactory : public LLSingleton<NamedTimerFactory>
-{
-public:
- NamedTimerFactory()
- : mTimerRoot(new LLFastTimer::NamedTimer("root"))
+block_timer_tree_bf_iterator_t end_block_timer_tree_bf()
{
- mRootFrameState.setNamedTimer(mTimerRoot);
- mTimerRoot->setFrameState(&mRootFrameState);
- mTimerRoot->mParent = mTimerRoot;
- mTimerRoot->setCollapsed(false);
- mRootFrameState.mParent = &mRootFrameState;
+ return block_timer_tree_bf_iterator_t();
}
- ~NamedTimerFactory()
+block_timer_tree_df_iterator_t begin_timer_tree(BlockTimerStatHandle& id)
{
- std::for_each(mTimers.begin(), mTimers.end(), DeletePairedPointer());
- mTimers.clear();
-
- delete mTimerRoot;
+ return block_timer_tree_df_iterator_t(&id,
+ boost::bind(boost::mem_fn(&BlockTimerStatHandle::beginChildren), _1),
+ boost::bind(boost::mem_fn(&BlockTimerStatHandle::endChildren), _1));
}
- LLFastTimer::NamedTimer& createNamedTimer(const std::string& name, LLFastTimer::FrameState* state)
+block_timer_tree_df_iterator_t end_timer_tree()
{
- LLFastTimer::NamedTimer* timer = new LLFastTimer::NamedTimer(name);
- timer->setFrameState(state);
- timer->setParent(mTimerRoot);
- mTimers.insert(std::make_pair(name, timer));
+ return block_timer_tree_df_iterator_t();
+}
- return *timer;
- }
- LLFastTimer::NamedTimer* getTimerByName(const std::string& name)
+// sort child timers by name
+struct SortTimerByName
{
- timer_map_t::iterator found_it = mTimers.find(name);
- if (found_it != mTimers.end())
+ bool operator()(const BlockTimerStatHandle* i1, const BlockTimerStatHandle* i2)
{
- return found_it->second;
+ return i1->getName() < i2->getName();
}
- return NULL;
- }
-
- LLFastTimer::NamedTimer* getRootTimer() { return mTimerRoot; }
-
- typedef std::multimap<std::string, LLFastTimer::NamedTimer*> timer_map_t;
- timer_map_t::iterator beginTimers() { return mTimers.begin(); }
- timer_map_t::iterator endTimers() { return mTimers.end(); }
- S32 timerCount() { return mTimers.size(); }
-
-private:
- timer_map_t mTimers;
-
- LLFastTimer::NamedTimer* mTimerRoot;
- LLFastTimer::FrameState mRootFrameState;
};
-LLFastTimer::DeclareTimer::DeclareTimer(const std::string& name, bool open )
-: mTimer(NamedTimerFactory::instance().createNamedTimer(name, &mFrameState))
+static BlockTimerStatHandle sRootTimer("root", NULL);
+BlockTimerStatHandle& BlockTimer::getRootTimeBlock()
{
- mTimer.setCollapsed(!open);
+ return sRootTimer;
+ }
+
+void BlockTimer::pushLog(LLSD log)
+{
+ LLMutexLock lock(sLogLock);
+
+ sLogQueue.push(log);
}
-LLFastTimer::DeclareTimer::DeclareTimer(const std::string& name)
-: mTimer(NamedTimerFactory::instance().createNamedTimer(name, &mFrameState))
+void BlockTimer::setLogLock(LLMutex* lock)
{
+ sLogLock = lock;
}
+
//static
#if (LL_DARWIN || LL_LINUX || LL_SOLARIS) && !(defined(__i386__) || defined(__amd64__))
-U64 LLFastTimer::countsPerSecond() // counts per second for the *32-bit* timer
+U64 BlockTimer::countsPerSecond()
{
- return sClockResolution >> 8;
+ return sClockResolution;
}
#else // windows or x86-mac or x86-linux or x86-solaris
-U64 LLFastTimer::countsPerSecond() // counts per second for the *32-bit* timer
+U64 BlockTimer::countsPerSecond()
{
#if LL_FASTTIMER_USE_RDTSC || !LL_WINDOWS
//getCPUFrequency returns MHz and sCPUClockFrequency wants to be in Hz
- static U64 sCPUClockFrequency = U64(LLProcessorInfo().getCPUFrequency()*1000000.0);
-
- // we drop the low-order byte in our timers, so report a lower frequency
+ static LLUnit<U64, LLUnits::Hertz> sCPUClockFrequency = LLProcessorInfo().getCPUFrequency();
+ return sCPUClockFrequency.value();
#else
// If we're not using RDTSC, each fasttimer tick is just a performance counter tick.
// Not redefining the clock frequency itself (in llprocessor.cpp/calculate_cpu_frequency())
@@ -194,270 +174,211 @@ U64 LLFastTimer::countsPerSecond() // counts per second for the *32-bit* timer
QueryPerformanceFrequency((LARGE_INTEGER*)&sCPUClockFrequency);
firstcall = false;
}
+ return sCPUClockFrequency.value();
#endif
- return sCPUClockFrequency >> 8;
}
#endif
-LLFastTimer::FrameState::FrameState()
-: mActiveCount(0),
- mCalls(0),
- mSelfTimeCounter(0),
- mParent(NULL),
- mLastCaller(NULL),
- mMoveUpTree(false)
+BlockTimerStatHandle::BlockTimerStatHandle(const char* name, const char* description)
+: StatType<TimeBlockAccumulator>(name, description)
{}
-
-LLFastTimer::NamedTimer::NamedTimer(const std::string& name)
-: mName(name),
- mCollapsed(true),
- mParent(NULL),
- mTotalTimeCounter(0),
- mCountAverage(0),
- mCallAverage(0),
- mNeedsSorting(false),
- mFrameState(NULL)
+TimeBlockTreeNode& BlockTimerStatHandle::getTreeNode() const
{
- mCountHistory = new U32[HISTORY_NUM];
- memset(mCountHistory, 0, sizeof(U32) * HISTORY_NUM);
- mCallHistory = new U32[HISTORY_NUM];
- memset(mCallHistory, 0, sizeof(U32) * HISTORY_NUM);
+ TimeBlockTreeNode* nodep = LLTrace::get_thread_recorder()->getTimeBlockTreeNode(getIndex());
+ llassert(nodep);
+ return *nodep;
}
-LLFastTimer::NamedTimer::~NamedTimer()
-{
- delete[] mCountHistory;
- delete[] mCallHistory;
-}
-std::string LLFastTimer::NamedTimer::getToolTip(S32 history_idx)
+void BlockTimer::bootstrapTimerTree()
{
- F64 ms_multiplier = 1000.0 / (F64)LLFastTimer::countsPerSecond();
- if (history_idx < 0)
- {
- // by default, show average number of call
- return llformat("%s (%d ms, %d calls)", getName().c_str(), (S32)(getCountAverage() * ms_multiplier), (S32)getCallAverage());
- }
- else
+ for (BlockTimerStatHandle::instance_tracker_t::instance_iter it = BlockTimerStatHandle::instance_tracker_t::beginInstances(), end_it = BlockTimerStatHandle::instance_tracker_t::endInstances();
+ it != end_it;
+ ++it)
{
- return llformat("%s (%d ms, %d calls)", getName().c_str(), (S32)(getHistoricalCount(history_idx) * ms_multiplier), (S32)getHistoricalCalls(history_idx));
- }
-}
+ BlockTimerStatHandle& timer = static_cast<BlockTimerStatHandle&>(*it);
+ if (&timer == &BlockTimer::getRootTimeBlock()) continue;
-void LLFastTimer::NamedTimer::setParent(NamedTimer* parent)
+ // bootstrap tree construction by attaching to last timer to be on stack
+ // when this timer was called
+ if (timer.getParent() == &BlockTimer::getRootTimeBlock())
{
- llassert_always(parent != this);
- llassert_always(parent != NULL);
+ TimeBlockAccumulator& accumulator = timer.getCurrentAccumulator();
- if (mParent)
+ if (accumulator.mLastCaller)
{
- // subtract our accumulated from previous parent
- for (S32 i = 0; i < HISTORY_NUM; i++)
- {
- mParent->mCountHistory[i] -= mCountHistory[i];
- }
-
- // subtract average timing from previous parent
- mParent->mCountAverage -= mCountAverage;
-
- std::vector<NamedTimer*>& children = mParent->getChildren();
- std::vector<NamedTimer*>::iterator found_it = std::find(children.begin(), children.end(), this);
- if (found_it != children.end())
- {
- children.erase(found_it);
+ timer.setParent(accumulator.mLastCaller);
+ accumulator.mParent = accumulator.mLastCaller;
}
+ // no need to push up tree on first use, flag can be set spuriously
+ accumulator.mMoveUpTree = false;
}
-
- mParent = parent;
- if (parent)
- {
- getFrameState().mParent = &parent->getFrameState();
- parent->getChildren().push_back(this);
- parent->mNeedsSorting = true;
}
}
-S32 LLFastTimer::NamedTimer::getDepth()
+// bump timers up tree if they have been flagged as being in the wrong place
+// do this in a bottom up order to promote descendants first before promoting ancestors
+// this preserves partial order derived from current frame's observations
+void BlockTimer::incrementalUpdateTimerTree()
{
- S32 depth = 0;
- NamedTimer* timerp = mParent;
- while(timerp)
+ for(block_timer_tree_df_post_iterator_t it = begin_block_timer_tree_df_post(BlockTimer::getRootTimeBlock());
+ it != end_block_timer_tree_df_post();
+ ++it)
{
- depth++;
- if (timerp->getParent() == timerp) break;
- timerp = timerp->mParent;
- }
- return depth;
-}
+ BlockTimerStatHandle* timerp = *it;
-// static
-void LLFastTimer::NamedTimer::processTimes()
+ // sort timers by time last called, so call graph makes sense
+ TimeBlockTreeNode& tree_node = timerp->getTreeNode();
+ if (tree_node.mNeedsSorting)
{
- if (sCurFrameIndex < 0) return;
-
- buildHierarchy();
- accumulateTimings();
+ std::sort(tree_node.mChildren.begin(), tree_node.mChildren.end(), SortTimerByName());
}
-// sort child timers by name
-struct SortTimerByName
+ // skip root timer
+ if (timerp != &BlockTimer::getRootTimeBlock())
{
- bool operator()(const LLFastTimer::NamedTimer* i1, const LLFastTimer::NamedTimer* i2)
- {
- return i1->getName() < i2->getName();
- }
-};
+ TimeBlockAccumulator& accumulator = timerp->getCurrentAccumulator();
-//static
-void LLFastTimer::NamedTimer::buildHierarchy()
+ if (accumulator.mMoveUpTree)
{
- if (sCurFrameIndex < 0 ) return;
-
- // set up initial tree
- {
- for (instance_iter it = beginInstances(); it != endInstances(); ++it)
- {
- NamedTimer& timer = *it;
- if (&timer == NamedTimerFactory::instance().getRootTimer()) continue;
-
- // bootstrap tree construction by attaching to last timer to be on stack
- // when this timer was called
- if (timer.getFrameState().mLastCaller && timer.mParent == NamedTimerFactory::instance().getRootTimer())
- {
- timer.setParent(timer.getFrameState().mLastCaller->mTimer);
- // no need to push up tree on first use, flag can be set spuriously
- timer.getFrameState().mMoveUpTree = false;
- }
- }
- }
-
- // bump timers up tree if they've been flagged as being in the wrong place
- // do this in a bottom up order to promote descendants first before promoting ancestors
- // this preserves partial order derived from current frame's observations
- for(timer_tree_bottom_up_iterator_t it = begin_timer_tree_bottom_up(*NamedTimerFactory::instance().getRootTimer());
- it != end_timer_tree_bottom_up();
- ++it)
- {
- NamedTimer* timerp = *it;
- // skip root timer
- if (timerp == NamedTimerFactory::instance().getRootTimer()) continue;
-
- if (timerp->getFrameState().mMoveUpTree)
- {
- // since ancestors have already been visited, reparenting won't affect tree traversal
+ // since ancestors have already been visited, re-parenting won't affect tree traversal
//step up tree, bringing our descendants with us
LL_DEBUGS("FastTimers") << "Moving " << timerp->getName() << " from child of " << timerp->getParent()->getName() <<
" to child of " << timerp->getParent()->getParent()->getName() << LL_ENDL;
timerp->setParent(timerp->getParent()->getParent());
- timerp->getFrameState().mMoveUpTree = false;
+ accumulator.mParent = timerp->getParent();
+ accumulator.mMoveUpTree = false;
// don't bubble up any ancestors until descendants are done bubbling up
+ // as ancestors may call this timer only on certain paths, so we want to resolve
+ // child-most block locations before their parents
it.skipAncestors();
}
}
+ }
+}
- // sort timers by time last called, so call graph makes sense
- for(timer_tree_dfs_iterator_t it = begin_timer_tree(*NamedTimerFactory::instance().getRootTimer());
- it != end_timer_tree();
- ++it)
+
+void BlockTimer::updateTimes()
{
- NamedTimer* timerp = (*it);
- if (timerp->mNeedsSorting)
+ // walk up stack of active timers and accumulate current time while leaving timing structures active
+ BlockTimerStackRecord* stack_record = LLThreadLocalSingletonPointer<BlockTimerStackRecord>::getInstance();
+ if (!stack_record) return;
+
+ U64 cur_time = getCPUClockCount64();
+ BlockTimer* cur_timer = stack_record->mActiveTimer;
+ TimeBlockAccumulator* accumulator = &stack_record->mTimeBlock->getCurrentAccumulator();
+
+ while(cur_timer
+ && cur_timer->mParentTimerData.mActiveTimer != cur_timer) // root defined by parent pointing to self
{
- std::sort(timerp->getChildren().begin(), timerp->getChildren().end(), SortTimerByName());
- }
- timerp->mNeedsSorting = false;
+ U64 cumulative_time_delta = cur_time - cur_timer->mStartTime;
+ cur_timer->mStartTime = cur_time;
+
+ accumulator->mTotalTimeCounter += cumulative_time_delta;
+ accumulator->mSelfTimeCounter += cumulative_time_delta - stack_record->mChildTime;
+ stack_record->mChildTime = 0;
+
+ stack_record = &cur_timer->mParentTimerData;
+ accumulator = &stack_record->mTimeBlock->getCurrentAccumulator();
+ cur_timer = stack_record->mActiveTimer;
+
+ stack_record->mChildTime += cumulative_time_delta;
}
}
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_TIMES("Process FastTimer Times");
+
+// not thread safe, so only call on main thread
//static
-void LLFastTimer::NamedTimer::accumulateTimings()
+void BlockTimer::processTimes()
{
- U32 cur_time = getCPUClockCount32();
+#if LL_TRACE_ENABLED
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_TIMES);
+ get_clock_count(); // good place to calculate clock frequency
- // walk up stack of active timers and accumulate current time while leaving timing structures active
- LLFastTimer* cur_timer = sCurTimerData.mCurTimer;
- // root defined by parent pointing to self
- CurTimerData* cur_data = &sCurTimerData;
- while(cur_timer && cur_timer->mLastTimerData.mCurTimer != cur_timer)
- {
- U32 cumulative_time_delta = cur_time - cur_timer->mStartTime;
- U32 self_time_delta = cumulative_time_delta - cur_data->mChildTime;
- cur_data->mChildTime = 0;
- cur_timer->mFrameState->mSelfTimeCounter += self_time_delta;
- cur_timer->mStartTime = cur_time;
+ // set up initial tree
+ bootstrapTimerTree();
- cur_data = &cur_timer->mLastTimerData;
- cur_data->mChildTime += cumulative_time_delta;
+ incrementalUpdateTimerTree();
- cur_timer = cur_timer->mLastTimerData.mCurTimer;
- }
+ updateTimes();
- // traverse tree in DFS post order, or bottom up
- for(timer_tree_bottom_up_iterator_t it = begin_timer_tree_bottom_up(*NamedTimerFactory::instance().getRootTimer());
- it != end_timer_tree_bottom_up();
+ // reset for next frame
+ for (BlockTimerStatHandle::instance_tracker_t::instance_iter it = BlockTimerStatHandle::instance_tracker_t::beginInstances(),
+ end_it = BlockTimerStatHandle::instance_tracker_t::endInstances();
+ it != end_it;
++it)
{
- NamedTimer* timerp = (*it);
- timerp->mTotalTimeCounter = timerp->getFrameState().mSelfTimeCounter;
- for (child_const_iter child_it = timerp->beginChildren(); child_it != timerp->endChildren(); ++child_it)
+ BlockTimerStatHandle& timer = static_cast<BlockTimerStatHandle&>(*it);
+ TimeBlockAccumulator& accumulator = timer.getCurrentAccumulator();
+
+ accumulator.mLastCaller = NULL;
+ accumulator.mMoveUpTree = false;
+ }
+#endif
+}
+
+std::vector<BlockTimerStatHandle*>::iterator BlockTimerStatHandle::beginChildren()
{
- timerp->mTotalTimeCounter += (*child_it)->mTotalTimeCounter;
+ return getTreeNode().mChildren.begin();
}
- S32 cur_frame = sCurFrameIndex;
- if (cur_frame >= 0)
+std::vector<BlockTimerStatHandle*>::iterator BlockTimerStatHandle::endChildren()
{
- // update timer history
- int hidx = cur_frame % HISTORY_NUM;
+ return getTreeNode().mChildren.end();
+}
- timerp->mCountHistory[hidx] = timerp->mTotalTimeCounter;
- timerp->mCountAverage = ((U64)timerp->mCountAverage * cur_frame + timerp->mTotalTimeCounter) / (cur_frame+1);
- timerp->mCallHistory[hidx] = timerp->getFrameState().mCalls;
- timerp->mCallAverage = ((U64)timerp->mCallAverage * cur_frame + timerp->getFrameState().mCalls) / (cur_frame+1);
- }
+std::vector<BlockTimerStatHandle*>& BlockTimerStatHandle::getChildren()
+{
+ return getTreeNode().mChildren;
}
+
+bool BlockTimerStatHandle::hasChildren()
+{
+ return ! getTreeNode().mChildren.empty();
}
// static
-void LLFastTimer::NamedTimer::resetFrame()
+void BlockTimer::logStats()
{
+ // get ready for next frame
if (sLog)
{ //output current frame counts to performance log
static S32 call_count = 0;
if (call_count % 100 == 0)
{
- LL_DEBUGS("FastTimers") << "countsPerSecond (32 bit): " << countsPerSecond() << LL_ENDL;
- LL_DEBUGS("FastTimers") << "get_clock_count (64 bit): " << get_clock_count() << llendl;
+ LL_DEBUGS("FastTimers") << "countsPerSecond: " << countsPerSecond() << LL_ENDL;
LL_DEBUGS("FastTimers") << "LLProcessorInfo().getCPUFrequency() " << LLProcessorInfo().getCPUFrequency() << LL_ENDL;
LL_DEBUGS("FastTimers") << "getCPUClockCount32() " << getCPUClockCount32() << LL_ENDL;
LL_DEBUGS("FastTimers") << "getCPUClockCount64() " << getCPUClockCount64() << LL_ENDL;
- LL_DEBUGS("FastTimers") << "elapsed sec " << ((F64)getCPUClockCount64())/((F64)LLProcessorInfo().getCPUFrequency()*1000000.0) << LL_ENDL;
+ LL_DEBUGS("FastTimers") << "elapsed sec " << ((F64)getCPUClockCount64() / (F64HertzImplicit)LLProcessorInfo().getCPUFrequency()) << LL_ENDL;
}
call_count++;
- F64 iclock_freq = 1000.0 / countsPerSecond(); // good place to calculate clock frequency
-
- F64 total_time = 0;
+ F64Seconds total_time(0);
LLSD sd;
{
- for (instance_iter it = beginInstances(); it != endInstances(); ++it)
+ for (BlockTimerStatHandle::instance_tracker_t::instance_iter it = BlockTimerStatHandle::instance_tracker_t::beginInstances(),
+ end_it = BlockTimerStatHandle::instance_tracker_t::endInstances();
+ it != end_it;
+ ++it)
{
- NamedTimer& timer = *it;
- FrameState& info = timer.getFrameState();
- sd[timer.getName()]["Time"] = (LLSD::Real) (info.mSelfTimeCounter*iclock_freq);
- sd[timer.getName()]["Calls"] = (LLSD::Integer) info.mCalls;
+ BlockTimerStatHandle& timer = static_cast<BlockTimerStatHandle&>(*it);
+ LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording();
+ sd[timer.getName()]["Time"] = (LLSD::Real) (frame_recording.getLastRecording().getSum(timer).value());
+ sd[timer.getName()]["Calls"] = (LLSD::Integer) (frame_recording.getLastRecording().getSum(timer.callCount()));
// computing total time here because getting the root timer's getCountHistory
// doesn't work correctly on the first frame
- total_time = total_time + info.mSelfTimeCounter * iclock_freq;
+ total_time += frame_recording.getLastRecording().getSum(timer);
}
}
- sd["Total"]["Time"] = (LLSD::Real) total_time;
+ sd["Total"]["Time"] = (LLSD::Real) total_time.value();
sd["Total"]["Calls"] = (LLSD::Integer) 1;
{
@@ -466,168 +387,44 @@ void LLFastTimer::NamedTimer::resetFrame()
}
}
- // reset for next frame
- for (instance_iter it = beginInstances(); it != endInstances(); ++it)
- {
- NamedTimer& timer = *it;
-
- FrameState& info = timer.getFrameState();
- info.mSelfTimeCounter = 0;
- info.mCalls = 0;
- info.mLastCaller = NULL;
- info.mMoveUpTree = false;
- // update parent pointer in timer state struct
- if (timer.mParent)
- {
- info.mParent = &timer.mParent->getFrameState();
- }
- }
-}
-
-//static
-void LLFastTimer::NamedTimer::reset()
-{
- resetFrame(); // reset frame data
-
- // walk up stack of active timers and reset start times to current time
- // effectively zeroing out any accumulated time
- U32 cur_time = getCPUClockCount32();
-
- // root defined by parent pointing to self
- CurTimerData* cur_data = &sCurTimerData;
- LLFastTimer* cur_timer = cur_data->mCurTimer;
- while(cur_timer && cur_timer->mLastTimerData.mCurTimer != cur_timer)
- {
- cur_timer->mStartTime = cur_time;
- cur_data->mChildTime = 0;
-
- cur_data = &cur_timer->mLastTimerData;
- cur_timer = cur_data->mCurTimer;
- }
-
- // reset all history
- {
- for (instance_iter it = beginInstances(); it != endInstances(); ++it)
- {
- NamedTimer& timer = *it;
- if (&timer != NamedTimerFactory::instance().getRootTimer())
- {
- timer.setParent(NamedTimerFactory::instance().getRootTimer());
- }
-
- timer.mCountAverage = 0;
- timer.mCallAverage = 0;
- memset(timer.mCountHistory, 0, sizeof(U32) * HISTORY_NUM);
- memset(timer.mCallHistory, 0, sizeof(U32) * HISTORY_NUM);
- }
- }
-
- sLastFrameIndex = 0;
- sCurFrameIndex = 0;
-}
-
-U32 LLFastTimer::NamedTimer::getHistoricalCount(S32 history_index) const
-{
- S32 history_idx = (getLastFrameIndex() + history_index) % LLFastTimer::NamedTimer::HISTORY_NUM;
- return mCountHistory[history_idx];
-}
-
-U32 LLFastTimer::NamedTimer::getHistoricalCalls(S32 history_index ) const
-{
- S32 history_idx = (getLastFrameIndex() + history_index) % LLFastTimer::NamedTimer::HISTORY_NUM;
- return mCallHistory[history_idx];
-}
-
-LLFastTimer::FrameState& LLFastTimer::NamedTimer::getFrameState() const
-{
- return *mFrameState;
-}
-
-std::vector<LLFastTimer::NamedTimer*>::const_iterator LLFastTimer::NamedTimer::beginChildren()
-{
- return mChildren.begin();
-}
-
-std::vector<LLFastTimer::NamedTimer*>::const_iterator LLFastTimer::NamedTimer::endChildren()
-{
- return mChildren.end();
-}
-
-std::vector<LLFastTimer::NamedTimer*>& LLFastTimer::NamedTimer::getChildren()
-{
- return mChildren;
-}
-
-//static
-LLFastTimer::NamedTimer& LLFastTimer::NamedTimer::getRootNamedTimer()
-{
- return *NamedTimerFactory::instance().getRootTimer();
-}
-
-//static
-void LLFastTimer::nextFrame()
-{
- countsPerSecond(); // good place to calculate clock frequency
- U64 frame_time = getCPUClockCount64();
- if ((frame_time - sLastFrameTime) >> 8 > 0xffffffff)
- {
- llinfos << "Slow frame, fast timers inaccurate" << llendl;
- }
-
- if (!sPauseHistory)
- {
- NamedTimer::processTimes();
- sLastFrameIndex = sCurFrameIndex++;
- }
-
- // get ready for next frame
- NamedTimer::resetFrame();
- sLastFrameTime = frame_time;
}
//static
-void LLFastTimer::dumpCurTimes()
+void BlockTimer::dumpCurTimes()
{
- // accumulate timings, etc.
- NamedTimer::processTimes();
-
- F64 clock_freq = (F64)countsPerSecond();
- F64 iclock_freq = 1000.0 / clock_freq; // clock_ticks -> milliseconds
+ LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording();
+ LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording();
// walk over timers in depth order and output timings
- for(timer_tree_dfs_iterator_t it = begin_timer_tree(*NamedTimerFactory::instance().getRootTimer());
+ for(block_timer_tree_df_iterator_t it = begin_timer_tree(BlockTimer::getRootTimeBlock());
it != end_timer_tree();
++it)
{
- NamedTimer* timerp = (*it);
- F64 total_time_ms = ((F64)timerp->getHistoricalCount(0) * iclock_freq);
+ BlockTimerStatHandle* timerp = (*it);
+ F64Seconds total_time = last_frame_recording.getSum(*timerp);
+ U32 num_calls = last_frame_recording.getSum(timerp->callCount());
+
// Don't bother with really brief times, keep output concise
- if (total_time_ms < 0.1) continue;
+ if (total_time < F32Milliseconds(0.1f)) continue;
std::ostringstream out_str;
- for (S32 i = 0; i < timerp->getDepth(); i++)
+ BlockTimerStatHandle* parent_timerp = timerp;
+ while(parent_timerp && parent_timerp != parent_timerp->getParent())
{
out_str << "\t";
+ parent_timerp = parent_timerp->getParent();
}
-
out_str << timerp->getName() << " "
- << std::setprecision(3) << total_time_ms << " ms, "
- << timerp->getHistoricalCalls(0) << " calls";
+ << std::setprecision(3) << total_time.valueInUnits<LLUnits::Milliseconds>() << " ms, "
+ << num_calls << " calls";
- llinfos << out_str.str() << llendl;
- }
+ LL_INFOS() << out_str.str() << LL_ENDL;
}
-
-//static
-void LLFastTimer::reset()
-{
- NamedTimer::reset();
}
-
//static
-void LLFastTimer::writeLog(std::ostream& os)
+void BlockTimer::writeLog(std::ostream& os)
{
while (!sLogQueue.empty())
{
@@ -638,22 +435,57 @@ void LLFastTimer::writeLog(std::ostream& os)
}
}
-//static
-const LLFastTimer::NamedTimer* LLFastTimer::getTimerByName(const std::string& name)
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// TimeBlockAccumulator
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+TimeBlockAccumulator::TimeBlockAccumulator()
+: mTotalTimeCounter(0),
+ mSelfTimeCounter(0),
+ mCalls(0),
+ mLastCaller(NULL),
+ mActiveCount(0),
+ mMoveUpTree(false),
+ mParent(NULL)
+{}
+
+void TimeBlockAccumulator::addSamples( const TimeBlockAccumulator& other, EBufferAppendType append_type )
{
- return NamedTimerFactory::instance().getTimerByName(name);
+#if LL_TRACE_ENABLED
+ // we can't merge two unrelated time block samples, as that will screw with the nested timings
+ // due to the call hierarchy of each thread
+ llassert(append_type == SEQUENTIAL);
+ mTotalTimeCounter += other.mTotalTimeCounter;
+ mSelfTimeCounter += other.mSelfTimeCounter;
+ mCalls += other.mCalls;
+ mLastCaller = other.mLastCaller;
+ mActiveCount = other.mActiveCount;
+ mMoveUpTree = other.mMoveUpTree;
+ mParent = other.mParent;
+#endif
}
-LLFastTimer::LLFastTimer(LLFastTimer::FrameState* state)
-: mFrameState(state)
+void TimeBlockAccumulator::reset( const TimeBlockAccumulator* other )
+{
+ mCalls = 0;
+ mSelfTimeCounter = 0;
+ mTotalTimeCounter = 0;
+
+ if (other)
{
- U32 start_time = getCPUClockCount32();
- mStartTime = start_time;
- mFrameState->mActiveCount++;
- LLFastTimer::sCurTimerData.mCurTimer = this;
- LLFastTimer::sCurTimerData.mFrameState = mFrameState;
- LLFastTimer::sCurTimerData.mChildTime = 0;
- mLastTimerData = LLFastTimer::sCurTimerData;
+ mLastCaller = other->mLastCaller;
+ mActiveCount = other->mActiveCount;
+ mMoveUpTree = other->mMoveUpTree;
+ mParent = other->mParent;
+ }
+}
+
+F64Seconds BlockTimer::getElapsedTime()
+{
+ U64 total_time = getCPUClockCount64() - mStartTime;
+
+ return F64Seconds((F64)total_time / (F64)BlockTimer::countsPerSecond());
}
+} // namespace LLTrace
diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h
index a99a1d88af..2370253078 100755
--- a/indra/llcommon/llfasttimer.h
+++ b/indra/llcommon/llfasttimer.h
@@ -28,218 +28,30 @@
#define LL_FASTTIMER_H
#include "llinstancetracker.h"
+#include "lltrace.h"
+#include "lltreeiterators.h"
-#define FAST_TIMER_ON 1
-#define DEBUG_FAST_TIMER_THREADS 1
-
-class LLMutex;
-
-#include <queue>
-#include "llsd.h"
-
+#define LL_FAST_TIMER_ON 1
#define LL_FASTTIMER_USE_RDTSC 1
+#define LL_RECORD_BLOCK_TIME(timer_stat) const LLTrace::BlockTimer& LL_GLUE_TOKENS(block_time_recorder, __LINE__)(LLTrace::timeThisBlock(timer_stat)); (void)LL_GLUE_TOKENS(block_time_recorder, __LINE__);
-LL_COMMON_API void assert_main_thread();
-
-class LL_COMMON_API LLFastTimer
+namespace LLTrace
{
-public:
- class NamedTimer;
-
- struct LL_COMMON_API FrameState
- {
- FrameState();
- void setNamedTimer(NamedTimer* timerp) { mTimer = timerp; }
-
- U32 mSelfTimeCounter;
- U32 mCalls;
- FrameState* mParent; // info for caller timer
- FrameState* mLastCaller; // used to bootstrap tree construction
- NamedTimer* mTimer;
- U16 mActiveCount; // number of timers with this ID active on stack
- bool mMoveUpTree; // needs to be moved up the tree of timers at the end of frame
- };
-
- // stores a "named" timer instance to be reused via multiple LLFastTimer stack instances
- class LL_COMMON_API NamedTimer
- : public LLInstanceTracker<NamedTimer>
- {
- friend class DeclareTimer;
- public:
- ~NamedTimer();
-
- enum { HISTORY_NUM = 300 };
-
- const std::string& getName() const { return mName; }
- NamedTimer* getParent() const { return mParent; }
- void setParent(NamedTimer* parent);
- S32 getDepth();
- std::string getToolTip(S32 history_index = -1);
-
- typedef std::vector<NamedTimer*>::const_iterator child_const_iter;
- child_const_iter beginChildren();
- child_const_iter endChildren();
- std::vector<NamedTimer*>& getChildren();
-
- void setCollapsed(bool collapsed) { mCollapsed = collapsed; }
- bool getCollapsed() const { return mCollapsed; }
-
- U32 getCountAverage() const { return mCountAverage; }
- U32 getCallAverage() const { return mCallAverage; }
-
- U32 getHistoricalCount(S32 history_index = 0) const;
- U32 getHistoricalCalls(S32 history_index = 0) const;
-
- static NamedTimer& getRootNamedTimer();
-
- void setFrameState(FrameState* state) { mFrameState = state; state->setNamedTimer(this); }
- FrameState& getFrameState() const;
-
- private:
- friend class LLFastTimer;
- friend class NamedTimerFactory;
-
- //
- // methods
- //
- NamedTimer(const std::string& name);
- // recursive call to gather total time from children
- static void accumulateTimings();
-
- // updates cumulative times and hierarchy,
- // can be called multiple times in a frame, at any point
- static void processTimes();
-
- static void buildHierarchy();
- static void resetFrame();
- static void reset();
-
- //
- // members
- //
- FrameState* mFrameState;
-
- std::string mName;
-
- U32 mTotalTimeCounter;
-
- U32 mCountAverage;
- U32 mCallAverage;
-
- U32* mCountHistory;
- U32* mCallHistory;
-
- // tree structure
- NamedTimer* mParent; // NamedTimer of caller(parent)
- std::vector<NamedTimer*> mChildren;
- bool mCollapsed; // don't show children
- bool mNeedsSorting; // sort children whenever child added
- };
-
- // used to statically declare a new named timer
- class LL_COMMON_API DeclareTimer
- : public LLInstanceTracker< DeclareTimer >
- {
- friend class LLFastTimer;
- public:
-
- DeclareTimer(const std::string& name, bool open);
- DeclareTimer(const std::string& name);
-
- NamedTimer& getNamedTimer() { return mTimer; }
-
- private:
- FrameState mFrameState;
- NamedTimer& mTimer;
- };
-
-public:
- LLFastTimer(LLFastTimer::FrameState* state);
-
- LL_FORCE_INLINE LLFastTimer(LLFastTimer::DeclareTimer& timer)
- : mFrameState(&timer.mFrameState)
- {
-#if FAST_TIMER_ON
- LLFastTimer::FrameState* frame_state = mFrameState;
- mStartTime = getCPUClockCount32();
-
- frame_state->mActiveCount++;
- frame_state->mCalls++;
- // keep current parent as long as it is active when we are
- frame_state->mMoveUpTree |= (frame_state->mParent->mActiveCount == 0);
-
- LLFastTimer::CurTimerData* cur_timer_data = &LLFastTimer::sCurTimerData;
- mLastTimerData = *cur_timer_data;
- cur_timer_data->mCurTimer = this;
- cur_timer_data->mFrameState = frame_state;
- cur_timer_data->mChildTime = 0;
-#endif
-#if DEBUG_FAST_TIMER_THREADS
-#if !LL_RELEASE
- assert_main_thread();
-#endif
-#endif
- }
-
- LL_FORCE_INLINE ~LLFastTimer()
- {
-#if FAST_TIMER_ON
- LLFastTimer::FrameState* frame_state = mFrameState;
- U32 total_time = getCPUClockCount32() - mStartTime;
-
- frame_state->mSelfTimeCounter += total_time - LLFastTimer::sCurTimerData.mChildTime;
- frame_state->mActiveCount--;
-
- // store last caller to bootstrap tree creation
- // do this in the destructor in case of recursion to get topmost caller
- frame_state->mLastCaller = mLastTimerData.mFrameState;
-
- // we are only tracking self time, so subtract our total time delta from parents
- mLastTimerData.mChildTime += total_time;
-
- LLFastTimer::sCurTimerData = mLastTimerData;
-#endif
- }
+// use to create blocktimer rvalue to be captured in a reference so that the BlockTimer lives to the end of the block.
+class BlockTimer timeThisBlock(class BlockTimerStatHandle& timer);
+class BlockTimer
+{
public:
- static LLMutex* sLogLock;
- static std::queue<LLSD> sLogQueue;
- static BOOL sLog;
- static BOOL sMetricLog;
- static std::string sLogName;
- static bool sPauseHistory;
- static bool sResetHistory;
-
- // call this once a frame to reset timers
- static void nextFrame();
+ typedef BlockTimer self_t;
+ typedef class BlockTimerStatHandle DeclareTimer;
- // dumps current cumulative frame stats to log
- // call nextFrame() to reset timers
- static void dumpCurTimes();
+ ~BlockTimer();
- // call this to reset timer hierarchy, averages, etc.
- static void reset();
+ F64Seconds getElapsedTime();
- static U64 countsPerSecond();
- static S32 getLastFrameIndex() { return sLastFrameIndex; }
- static S32 getCurFrameIndex() { return sCurFrameIndex; }
-
- static void writeLog(std::ostream& os);
- static const NamedTimer* getTimerByName(const std::string& name);
-
- struct CurTimerData
- {
- LLFastTimer* mCurTimer;
- FrameState* mFrameState;
- U32 mChildTime;
- };
- static CurTimerData sCurTimerData;
-
-private:
-
-
- //////////////////////////////////////////////////////////////////////////////
+ //////////////////////////////////////////////////////////////////////////////
//
// Important note: These implementations must be FAST!
//
@@ -261,14 +73,14 @@ private:
//#undef _interlockedbittestandset
//#undef _interlockedbittestandreset
- //inline U32 LLFastTimer::getCPUClockCount32()
+ //inline U32 getCPUClockCount32()
//{
// U64 time_stamp = __rdtsc();
// return (U32)(time_stamp >> 8);
//}
//
//// return full timer value, *not* shifted by 8 bits
- //inline U64 LLFastTimer::getCPUClockCount64()
+ //inline U64 getCPUClockCount64()
//{
// return __rdtsc();
//}
@@ -308,7 +120,7 @@ private:
}
#else
- //LL_COMMON_API U64 get_clock_count(); // in lltimer.cpp
+ //U64 get_clock_count(); // in lltimer.cpp
// These use QueryPerformanceCounter, which is arguably fine and also works on AMD architectures.
static U32 getCPUClockCount32()
{
@@ -375,18 +187,160 @@ private:
#endif
- static U64 sClockResolution;
+ static BlockTimerStatHandle& getRootTimeBlock();
+ static void pushLog(LLSD sd);
+ static void setLogLock(class LLMutex* mutex);
+ static void writeLog(std::ostream& os);
+ static void updateTimes();
+
+ static U64 countsPerSecond();
+
+ // updates cumulative times and hierarchy,
+ // can be called multiple times in a frame, at any point
+ static void processTimes();
- static S32 sCurFrameIndex;
- static S32 sLastFrameIndex;
- static U64 sLastFrameTime;
+ static void bootstrapTimerTree();
+ static void incrementalUpdateTimerTree();
- U32 mStartTime;
- LLFastTimer::FrameState* mFrameState;
- LLFastTimer::CurTimerData mLastTimerData;
+ // call this once a frame to periodically log timers
+ static void logStats();
+
+ // dumps current cumulative frame stats to log
+ // call nextFrame() to reset timers
+ static void dumpCurTimes();
+
+private:
+ friend class BlockTimerStatHandle;
+ // FIXME: this friendship exists so that each thread can instantiate a root timer,
+ // which could be a derived class with a public constructor instead, possibly
+ friend class ThreadRecorder;
+ friend BlockTimer timeThisBlock(BlockTimerStatHandle&);
+
+ BlockTimer(BlockTimerStatHandle& timer);
+#if !defined(MSC_VER) || MSC_VER < 1700
+ // Visual Studio 2010 has a bug where capturing an object returned by value
+ // into a local reference requires access to the copy constructor at the call site.
+ // This appears to be fixed in 2012.
+public:
+#endif
+ // no-copy
+ BlockTimer(const BlockTimer& other) {};
+
+private:
+ U64 mStartTime;
+ BlockTimerStackRecord mParentTimerData;
+
+public:
+ // statics
+ static std::string sLogName;
+ static bool sMetricLog,
+ sLog;
+ static U64 sClockResolution;
};
-typedef class LLFastTimer LLFastTimer;
+// this dummy function assists in allocating a block timer with stack-based lifetime.
+// this is done by capturing the return value in a stack-allocated const reference variable.
+// (This is most easily done using the macro LL_RECORD_BLOCK_TIME)
+// Otherwise, it would be possible to store a BlockTimer on the heap, resulting in non-nested lifetimes,
+// which would break the invariants of the timing hierarchy logic
+LL_FORCE_INLINE class BlockTimer timeThisBlock(class BlockTimerStatHandle& timer)
+{
+ return BlockTimer(timer);
+}
+
+// stores a "named" timer instance to be reused via multiple BlockTimer stack instances
+class BlockTimerStatHandle
+: public StatType<TimeBlockAccumulator>
+{
+public:
+ BlockTimerStatHandle(const char* name, const char* description = "");
+
+ TimeBlockTreeNode& getTreeNode() const;
+ BlockTimerStatHandle* getParent() const { return getTreeNode().getParent(); }
+ void setParent(BlockTimerStatHandle* parent) { getTreeNode().setParent(parent); }
+
+ typedef std::vector<BlockTimerStatHandle*>::iterator child_iter;
+ typedef std::vector<BlockTimerStatHandle*>::const_iterator child_const_iter;
+ child_iter beginChildren();
+ child_iter endChildren();
+ bool hasChildren();
+ std::vector<BlockTimerStatHandle*>& getChildren();
+
+ StatType<TimeBlockAccumulator::CallCountFacet>& callCount()
+ {
+ return static_cast<StatType<TimeBlockAccumulator::CallCountFacet>&>(*(StatType<TimeBlockAccumulator>*)this);
+ }
+
+ StatType<TimeBlockAccumulator::SelfTimeFacet>& selfTime()
+ {
+ return static_cast<StatType<TimeBlockAccumulator::SelfTimeFacet>&>(*(StatType<TimeBlockAccumulator>*)this);
+ }
+
+ bool mCollapsed; // don't show children
+};
+
+// iterators and helper functions for walking the call hierarchy of block timers in different ways
+typedef LLTreeDFSIter<BlockTimerStatHandle, BlockTimerStatHandle::child_const_iter> block_timer_tree_df_iterator_t;
+typedef LLTreeDFSPostIter<BlockTimerStatHandle, BlockTimerStatHandle::child_const_iter> block_timer_tree_df_post_iterator_t;
+typedef LLTreeBFSIter<BlockTimerStatHandle, BlockTimerStatHandle::child_const_iter> block_timer_tree_bf_iterator_t;
+
+block_timer_tree_df_iterator_t begin_block_timer_tree_df(BlockTimerStatHandle& id);
+block_timer_tree_df_iterator_t end_block_timer_tree_df();
+block_timer_tree_df_post_iterator_t begin_block_timer_tree_df_post(BlockTimerStatHandle& id);
+block_timer_tree_df_post_iterator_t end_block_timer_tree_df_post();
+block_timer_tree_bf_iterator_t begin_block_timer_tree_bf(BlockTimerStatHandle& id);
+block_timer_tree_bf_iterator_t end_block_timer_tree_bf();
+
+LL_FORCE_INLINE BlockTimer::BlockTimer(BlockTimerStatHandle& timer)
+{
+#if LL_FAST_TIMER_ON
+ BlockTimerStackRecord* cur_timer_data = LLThreadLocalSingletonPointer<BlockTimerStackRecord>::getInstance();
+ if (!cur_timer_data) return;
+ TimeBlockAccumulator& accumulator = timer.getCurrentAccumulator();
+ accumulator.mActiveCount++;
+ // keep current parent as long as it is active when we are
+ accumulator.mMoveUpTree |= (accumulator.mParent->getCurrentAccumulator().mActiveCount == 0);
+
+ // store top of stack
+ mParentTimerData = *cur_timer_data;
+ // push new information
+ cur_timer_data->mActiveTimer = this;
+ cur_timer_data->mTimeBlock = &timer;
+ cur_timer_data->mChildTime = 0;
+
+ mStartTime = getCPUClockCount64();
+#endif
+}
+
+LL_FORCE_INLINE BlockTimer::~BlockTimer()
+{
+#if LL_FAST_TIMER_ON
+ U64 total_time = getCPUClockCount64() - mStartTime;
+ BlockTimerStackRecord* cur_timer_data = LLThreadLocalSingletonPointer<BlockTimerStackRecord>::getInstance();
+ if (!cur_timer_data) return;
+
+ TimeBlockAccumulator& accumulator = cur_timer_data->mTimeBlock->getCurrentAccumulator();
+
+ accumulator.mCalls++;
+ accumulator.mTotalTimeCounter += total_time;
+ accumulator.mSelfTimeCounter += total_time - cur_timer_data->mChildTime;
+ accumulator.mActiveCount--;
+
+ // store last caller to bootstrap tree creation
+ // do this in the destructor in case of recursion to get topmost caller
+ accumulator.mLastCaller = mParentTimerData.mTimeBlock;
+
+ // we are only tracking self time, so subtract our total time delta from parents
+ mParentTimerData.mChildTime += total_time;
+
+ //pop stack
+ *cur_timer_data = mParentTimerData;
+#endif
+}
+
+}
+
+typedef LLTrace::BlockTimer LLFastTimer;
#endif // LL_LLFASTTIMER_H
diff --git a/indra/llcommon/llfile.cpp b/indra/llcommon/llfile.cpp
index 761d7f430c..259187c52f 100755
--- a/indra/llcommon/llfile.cpp
+++ b/indra/llcommon/llfile.cpp
@@ -28,7 +28,7 @@
*/
#if LL_WINDOWS
-#include <windows.h>
+#include "llwin32headerslean.h"
#include <stdlib.h> // Windows errno
#else
#include <errno.h>
@@ -469,7 +469,7 @@ llstdio_filebuf::int_type llstdio_filebuf::overflow(llstdio_filebuf::int_type __
_M_set_buffer(0);
__ret = traits_type::not_eof(__c);
}
- }
+ }
else if (_M_buf_size > 1)
{
// Overflow in 'uncommitted' mode: set _M_writing, set
@@ -527,11 +527,11 @@ bool llstdio_filebuf::_convert_to_external(char_type* __ibuf,
if (__r == codecvt_base::ok || __r == codecvt_base::partial)
__blen = __bend - __buf;
else if (__r == codecvt_base::noconv)
- {
+ {
// Same as the always_noconv case above.
__buf = reinterpret_cast<char*>(__ibuf);
__blen = __ilen;
- }
+ }
else
__throw_ios_failure(__N("llstdio_filebuf::_convert_to_external "
"conversion error"));
@@ -674,9 +674,9 @@ llstdio_filebuf::int_type llstdio_filebuf::underflow()
_M_ext_end, _M_ext_next,
this->eback(),
this->eback() + __buflen, __iend);
-}
+ }
if (__r == codecvt_base::noconv)
-{
+ {
size_t __avail = _M_ext_end - _M_ext_buf;
__ilen = std::min(__avail, __buflen);
traits_type::copy(this->eback(),
@@ -837,15 +837,15 @@ std::streamsize llstdio_filebuf::xsputn(char_type* __s, std::streamsize __n)
__ret = fwrite(__buf, 1, __buffill, _M_file.file());
}
if (__ret == __buffill)
- {
+ {
__ret += fwrite(reinterpret_cast<const char*>(__s), 1,
__n, _M_file.file());
- }
+ }
if (__ret == __buffill + __n)
{
_M_set_buffer(0);
_M_writing = true;
-}
+ }
if (__ret > __buffill)
__ret -= __buffill;
else
@@ -879,7 +879,7 @@ llifstream::llifstream() : _M_filebuf(),
#endif
// explicit
-llifstream::llifstream(const std::string& _Filename,
+llifstream::llifstream(const std::string& _Filename,
ios_base::openmode _Mode) : _M_filebuf(),
#if LL_WINDOWS
std::istream(&_M_filebuf)
@@ -908,7 +908,7 @@ llifstream::llifstream(const char* _Filename,
if (_M_filebuf.open(wideName.c_str(), _Mode | ios_base::in) == 0)
{
_Myios::setstate(ios_base::failbit);
-}
+ }
}
#else
std::istream()
@@ -982,8 +982,8 @@ void llifstream::close()
#else
this->setstate(ios_base::failbit);
#endif
- }
}
+}
/************** output file stream ********************************/
@@ -1073,7 +1073,7 @@ void llofstream::open(const char* _Filename, ios_base::openmode _Mode)
#if LL_WINDOWS
llutf16string wideName = utf8str_to_utf16str( _Filename );
if (_M_filebuf.open( wideName.c_str(), _Mode | ios_base::out) == 0)
-{
+ {
_Myios::setstate(ios_base::failbit);
}
else
diff --git a/indra/llcommon/llfindlocale.cpp b/indra/llcommon/llfindlocale.cpp
index cd7c0c7c09..f019bd0c64 100755
--- a/indra/llcommon/llfindlocale.cpp
+++ b/indra/llcommon/llfindlocale.cpp
@@ -33,7 +33,7 @@
#include <ctype.h>
#ifdef WIN32
-#include <windows.h>
+#include "llwin32headers.h"
#include <winnt.h>
#endif
diff --git a/indra/llcommon/llformat.h b/indra/llcommon/llformat.h
index a4ec5e01de..fb8e7cd045 100755
--- a/indra/llcommon/llformat.h
+++ b/indra/llcommon/llformat.h
@@ -29,7 +29,7 @@
#define LL_LLFORMAT_H
// Use as follows:
-// llinfos << llformat("Test:%d (%.2f %.2f)", idx, x, y) << llendl;
+// LL_INFOS() << llformat("Test:%d (%.2f %.2f)", idx, x, y) << LL_ENDL;
//
// *NOTE: buffer limited to 1024, (but vsnprintf prevents overrun)
// should perhaps be replaced with boost::format.
diff --git a/indra/llcommon/llframetimer.cpp b/indra/llcommon/llframetimer.cpp
index ec64195b21..1af2cb8afd 100755
--- a/indra/llcommon/llframetimer.cpp
+++ b/indra/llcommon/llframetimer.cpp
@@ -115,10 +115,10 @@ F64 LLFrameTimer::expiresAt() const
BOOL LLFrameTimer::checkExpirationAndReset(F32 expiration)
{
- //llinfos << "LLFrameTimer::checkExpirationAndReset()" << llendl;
- //llinfos << " mStartTime:" << mStartTime << llendl;
- //llinfos << " sFrameTime:" << sFrameTime << llendl;
- //llinfos << " mExpiry: " << mExpiry << llendl;
+ //LL_INFOS() << "LLFrameTimer::checkExpirationAndReset()" << LL_ENDL;
+ //LL_INFOS() << " mStartTime:" << mStartTime << LL_ENDL;
+ //LL_INFOS() << " sFrameTime:" << sFrameTime << LL_ENDL;
+ //LL_INFOS() << " mExpiry: " << mExpiry << LL_ENDL;
if(hasExpired())
{
diff --git a/indra/llcommon/llframetimer.h b/indra/llcommon/llframetimer.h
index 45754f3785..81bd5da8a3 100755
--- a/indra/llcommon/llframetimer.h
+++ b/indra/llcommon/llframetimer.h
@@ -35,7 +35,6 @@
*/
#include "lltimer.h"
-#include "timing.h"
class LL_COMMON_API LLFrameTimer
{
@@ -44,7 +43,7 @@ public:
// Return the number of seconds since the start of this
// application instance.
- static F64 getElapsedSeconds()
+ static F64SecondsImplicit getElapsedSeconds()
{
// Loses msec precision after ~4.5 hours...
return sFrameTime;
@@ -53,7 +52,7 @@ public:
// Return a low precision usec since epoch
static U64 getTotalTime()
{
- return sTotalTime ? sTotalTime : totalTime();
+ return sTotalTime ? U64MicrosecondsImplicit(sTotalTime) : totalTime();
}
// Return a low precision seconds since epoch
diff --git a/indra/llcommon/llheartbeat.cpp b/indra/llcommon/llheartbeat.cpp
index 18a0c489bd..19b7452748 100755
--- a/indra/llcommon/llheartbeat.cpp
+++ b/indra/llcommon/llheartbeat.cpp
@@ -98,7 +98,7 @@ LLHeartbeat::rawSendWithTimeout(F32 timeout_sec)
mTimeoutTimer.setTimerExpirySec(timeout_sec);
do {
result = rawSend();
- //llinfos << " HEARTSENDc=" << result << llendl;
+ //LL_INFOS() << " HEARTSENDc=" << result << LL_ENDL;
} while (result==1 && !mTimeoutTimer.hasExpired());
return result;
@@ -118,7 +118,7 @@ LLHeartbeat::send(F32 timeout_sec)
// zero-timeout; we don't care too much whether our
// heartbeat was digested.
result = rawSend();
- //llinfos << " HEARTSENDb=" << result << llendl;
+ //LL_INFOS() << " HEARTSENDb=" << result << LL_ENDL;
}
}
@@ -146,14 +146,14 @@ LLHeartbeat::send(F32 timeout_sec)
// It's been ages since we successfully had a heartbeat
// digested by the watchdog. Sit here and spin a while
// in the hope that we can force it through.
- llwarns << "Unable to deliver heartbeat to launcher for " << mPanicTimer.getElapsedTimeF32() << " seconds. Going to try very hard for up to " << mAggressiveHeartbeatMaxBlockingSecs << " seconds." << llendl;
+ LL_WARNS() << "Unable to deliver heartbeat to launcher for " << mPanicTimer.getElapsedTimeF32() << " seconds. Going to try very hard for up to " << mAggressiveHeartbeatMaxBlockingSecs << " seconds." << LL_ENDL;
result = rawSendWithTimeout(mAggressiveHeartbeatMaxBlockingSecs);
if (result == 0) {
total_success = true;
} else {
// we couldn't even force it through. That's bad,
// but we'll try again in a while.
- llwarns << "Could not deliver heartbeat to launcher even after trying very hard for " << mAggressiveHeartbeatMaxBlockingSecs << " seconds." << llendl;
+ LL_WARNS() << "Could not deliver heartbeat to launcher even after trying very hard for " << mAggressiveHeartbeatMaxBlockingSecs << " seconds." << LL_ENDL;
}
// in any case, reset the panic timer.
diff --git a/indra/llcommon/llhttpstatuscodes.h b/indra/llcommon/llhttpstatuscodes.h
deleted file mode 100755
index 0173461dad..0000000000
--- a/indra/llcommon/llhttpstatuscodes.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * @file llhttpstatuscodes.h
- * @brief Constants for HTTP status codes
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_HTTP_STATUS_CODES_H
-#define LL_HTTP_STATUS_CODES_H
-
-#include "stdtypes.h"
-
-// Standard errors from HTTP spec:
-// http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1
-const S32 HTTP_CONTINUE = 100;
-const S32 HTTP_SWITCHING_PROTOCOLS = 101;
-
-// Success
-const S32 HTTP_OK = 200;
-const S32 HTTP_CREATED = 201;
-const S32 HTTP_ACCEPTED = 202;
-const S32 HTTP_NON_AUTHORITATIVE_INFORMATION = 203;
-const S32 HTTP_NO_CONTENT = 204;
-const S32 HTTP_RESET_CONTENT = 205;
-const S32 HTTP_PARTIAL_CONTENT = 206;
-
-// Redirection
-const S32 HTTP_MULTIPLE_CHOICES = 300;
-const S32 HTTP_MOVED_PERMANENTLY = 301;
-const S32 HTTP_FOUND = 302;
-const S32 HTTP_SEE_OTHER = 303;
-const S32 HTTP_NOT_MODIFIED = 304;
-const S32 HTTP_USE_PROXY = 305;
-const S32 HTTP_TEMPORARY_REDIRECT = 307;
-
-// Client Error
-const S32 HTTP_BAD_REQUEST = 400;
-const S32 HTTP_UNAUTHORIZED = 401;
-const S32 HTTP_PAYMENT_REQUIRED = 402;
-const S32 HTTP_FORBIDDEN = 403;
-const S32 HTTP_NOT_FOUND = 404;
-const S32 HTTP_METHOD_NOT_ALLOWED = 405;
-const S32 HTTP_NOT_ACCEPTABLE = 406;
-const S32 HTTP_PROXY_AUTHENTICATION_REQUIRED = 407;
-const S32 HTTP_REQUEST_TIME_OUT = 408;
-const S32 HTTP_CONFLICT = 409;
-const S32 HTTP_GONE = 410;
-const S32 HTTP_LENGTH_REQUIRED = 411;
-const S32 HTTP_PRECONDITION_FAILED = 412;
-const S32 HTTP_REQUEST_ENTITY_TOO_LARGE = 413;
-const S32 HTTP_REQUEST_URI_TOO_LARGE = 414;
-const S32 HTTP_UNSUPPORTED_MEDIA_TYPE = 415;
-const S32 HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
-const S32 HTTP_EXPECTATION_FAILED = 417;
-
-// Server Error
-const S32 HTTP_INTERNAL_SERVER_ERROR = 500;
-const S32 HTTP_NOT_IMPLEMENTED = 501;
-const S32 HTTP_BAD_GATEWAY = 502;
-const S32 HTTP_SERVICE_UNAVAILABLE = 503;
-const S32 HTTP_GATEWAY_TIME_OUT = 504;
-const S32 HTTP_VERSION_NOT_SUPPORTED = 505;
-
-// We combine internal process errors with status codes
-// These status codes should not be sent over the wire
-// and indicate something went wrong internally.
-// If you get these they are not normal.
-const S32 HTTP_INTERNAL_ERROR = 499;
-
-#endif
diff --git a/indra/llcommon/llindexedqueue.h b/indra/llcommon/llindexedqueue.h
deleted file mode 100755
index aa2675d87d..0000000000
--- a/indra/llcommon/llindexedqueue.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/**
- * @file llindexedqueue.h
- * @brief An indexed FIFO queue, where only one element with each key
- * can be in the queue.
- *
- * $LicenseInfo:firstyear=2003&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLINDEXEDQUEUE_H
-#define LL_LLINDEXEDQUEUE_H
-
-// An indexed FIFO queue, where only one element with each key can be in the queue.
-// This is ONLY used in the interest list, you'll probably want to review this code
-// carefully if you want to use it elsewhere - Doug
-
-template <typename Type>
-class LLIndexedQueue
-{
-protected:
- typedef std::deque<Type> type_deque;
- type_deque mQueue;
- std::set<Type> mKeySet;
-
-public:
- LLIndexedQueue() {}
-
- // move_if_there is an O(n) operation
- bool push_back(const Type &value, bool move_if_there = false)
- {
- if (mKeySet.find(value) != mKeySet.end())
- {
- // Already on the queue
- if (move_if_there)
- {
- // Remove the existing entry.
- typename type_deque::iterator it;
- for (it = mQueue.begin(); it != mQueue.end(); ++it)
- {
- if (*it == value)
- {
- break;
- }
- }
-
- // This HAS to succeed, otherwise there's a serious bug in the keyset implementation
- // (although this isn't thread safe, at all)
-
- mQueue.erase(it);
- }
- else
- {
- // We're not moving it, leave it alone
- return false;
- }
- }
- else
- {
- // Doesn't exist, add it to the key set
- mKeySet.insert(value);
- }
-
- mQueue.push_back(value);
-
- // We succeeded in adding the new element.
- return true;
- }
-
- bool push_front(const Type &value, bool move_if_there = false)
- {
- if (mKeySet.find(value) != mKeySet.end())
- {
- // Already on the queue
- if (move_if_there)
- {
- // Remove the existing entry.
- typename type_deque::iterator it;
- for (it = mQueue.begin(); it != mQueue.end(); ++it)
- {
- if (*it == value)
- {
- break;
- }
- }
-
- // This HAS to succeed, otherwise there's a serious bug in the keyset implementation
- // (although this isn't thread safe, at all)
-
- mQueue.erase(it);
- }
- else
- {
- // We're not moving it, leave it alone
- return false;
- }
- }
- else
- {
- // Doesn't exist, add it to the key set
- mKeySet.insert(value);
- }
-
- mQueue.push_front(value);
- return true;
- }
-
- void pop()
- {
- Type value = mQueue.front();
- mKeySet.erase(value);
- mQueue.pop_front();
- }
-
- Type &front()
- {
- return mQueue.front();
- }
-
- S32 size() const
- {
- return mQueue.size();
- }
-
- bool empty() const
- {
- return mQueue.empty();
- }
-
- void clear()
- {
- // Clear out all elements on the queue
- mQueue.clear();
- mKeySet.clear();
- }
-};
-
-#endif // LL_LLINDEXEDQUEUE_H
diff --git a/indra/llcommon/llindexedvector.h b/indra/llcommon/llindexedvector.h
new file mode 100755
index 0000000000..68c3821802
--- /dev/null
+++ b/indra/llcommon/llindexedvector.h
@@ -0,0 +1,100 @@
+/**
+ * @file lldarray.h
+ * @brief Wrapped std::vector for backward compatibility.
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLDARRAY_H
+#define LL_LLDARRAY_H
+
+#include "llerror.h"
+
+#include <vector>
+#include <map>
+
+//--------------------------------------------------------
+// LLIndexedVector
+//--------------------------------------------------------
+
+template <typename Type, typename Key, int BlockSize = 32>
+class LLIndexedVector
+{
+public:
+ typedef typename std::vector<Type>::iterator iterator;
+ typedef typename std::vector<Type>::const_iterator const_iterator;
+ typedef typename std::vector<Type>::reverse_iterator reverse_iterator;
+ typedef typename std::vector<Type>::const_reverse_iterator const_reverse_iterator;
+ typedef typename std::vector<Type>::size_type size_type;
+protected:
+ std::vector<Type> mVector;
+ std::map<Key, U32> mIndexMap;
+
+public:
+ LLIndexedVector() { mVector.reserve(BlockSize); }
+
+ iterator begin() { return mVector.begin(); }
+ const_iterator begin() const { return mVector.begin(); }
+ iterator end() { return mVector.end(); }
+ const_iterator end() const { return mVector.end(); }
+
+ reverse_iterator rbegin() { return mVector.rbegin(); }
+ const_reverse_iterator rbegin() const { return mVector.rbegin(); }
+ reverse_iterator rend() { return mVector.rend(); }
+ const_reverse_iterator rend() const { return mVector.rend(); }
+
+ void reset() { mVector.resize(0); mIndexMap.resize(0); }
+ bool empty() const { return mVector.empty(); }
+ size_type size() const { return mVector.size(); }
+
+ Type& operator[](const Key& k)
+ {
+ typename std::map<Key, U32>::const_iterator iter = mIndexMap.find(k);
+ if (iter == mIndexMap.end())
+ {
+ U32 n = mVector.size();
+ mIndexMap[k] = n;
+ mVector.push_back(Type());
+ llassert(mVector.size() == mIndexMap.size());
+ return mVector[n];
+ }
+ else
+ {
+ return mVector[iter->second];
+ }
+ }
+
+ const_iterator find(const Key& k) const
+ {
+ typename std::map<Key, U32>::const_iterator iter = mIndexMap.find(k);
+ if(iter == mIndexMap.end())
+ {
+ return mVector.end();
+ }
+ else
+ {
+ return mVector.begin() + iter->second;
+ }
+ }
+};
+
+#endif
diff --git a/indra/llcommon/llinitparam.cpp b/indra/llcommon/llinitparam.cpp
index 89c831d296..aa2f4eb289 100755
--- a/indra/llcommon/llinitparam.cpp
+++ b/indra/llcommon/llinitparam.cpp
@@ -28,10 +28,17 @@
#include "linden_common.h"
#include "llinitparam.h"
+#include "llformat.h"
namespace LLInitParam
{
+
+ predicate_rule_t default_parse_rules()
+ {
+ return ll_make_predicate(PROVIDED) && !ll_make_predicate(EMPTY);
+ }
+
//
// Param
//
@@ -93,13 +100,13 @@ namespace LLInitParam
void Parser::parserWarning(const std::string& message)
{
if (mParseSilently) return;
- llwarns << message << llendl;
+ LL_WARNS() << message << LL_ENDL;
}
void Parser::parserError(const std::string& message)
{
if (mParseSilently) return;
- llerrs << message << llendl;
+ LL_ERRS() << message << LL_ENDL;
}
@@ -124,7 +131,7 @@ namespace LLInitParam
std::string name(char_name);
if ((size_t)param->mParamHandle > mMaxParamOffset)
{
- llerrs << "Attempted to register param with block defined for parent class, make sure to derive from LLInitParam::Block<YOUR_CLASS, PARAM_BLOCK_BASE_CLASS>" << llendl;
+ LL_ERRS() << "Attempted to register param with block defined for parent class, make sure to derive from LLInitParam::Block<YOUR_CLASS, PARAM_BLOCK_BASE_CLASS>" << LL_ENDL;
}
if (name.empty())
@@ -196,6 +203,9 @@ namespace LLInitParam
bool BaseBlock::validateBlock(bool emit_errors) const
{
+ // only validate block when it hasn't already passed validation with current data
+ if (!mValidated)
+ {
const BlockDescriptor& block_data = mostDerivedBlockDescriptor();
for (BlockDescriptor::param_validation_list_t::const_iterator it = block_data.mValidationList.begin(); it != block_data.mValidationList.end(); ++it)
{
@@ -204,16 +214,23 @@ namespace LLInitParam
{
if (emit_errors)
{
- llwarns << "Invalid param \"" << getParamName(block_data, param) << "\"" << llendl;
+ LL_WARNS() << "Invalid param \"" << getParamName(block_data, param) << "\"" << LL_ENDL;
}
return false;
}
}
- return true;
+ mValidated = true;
+ }
+ return mValidated;
}
- void BaseBlock::serializeBlock(Parser& parser, Parser::name_stack_t& name_stack, const LLInitParam::BaseBlock* diff_block) const
+ bool BaseBlock::serializeBlock(Parser& parser, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const LLInitParam::BaseBlock* diff_block) const
{
+ bool serialized = false;
+ if (!predicate_rule.check(ll_make_predicate(PROVIDED, isProvided())))
+ {
+ return false;
+ }
// named param is one like LLView::Params::follows
// unnamed param is like LLView::Params::rect - implicit
const BlockDescriptor& block_data = mostDerivedBlockDescriptor();
@@ -225,10 +242,10 @@ namespace LLInitParam
param_handle_t param_handle = (*it)->mParamHandle;
const Param* param = getParamFromHandle(param_handle);
ParamDescriptor::serialize_func_t serialize_func = (*it)->mSerializeFunc;
- if (serialize_func)
+ if (serialize_func && predicate_rule.check(ll_make_predicate(PROVIDED, param->anyProvided())))
{
const Param* diff_param = diff_block ? diff_block->getParamFromHandle(param_handle) : NULL;
- serialize_func(*param, parser, name_stack, diff_param);
+ serialized |= serialize_func(*param, parser, name_stack, predicate_rule, diff_param);
}
}
@@ -239,7 +256,7 @@ namespace LLInitParam
param_handle_t param_handle = it->second->mParamHandle;
const Param* param = getParamFromHandle(param_handle);
ParamDescriptor::serialize_func_t serialize_func = it->second->mSerializeFunc;
- if (serialize_func && param->anyProvided())
+ if (serialize_func && predicate_rule.check(ll_make_predicate(PROVIDED, param->anyProvided())))
{
// Ensure this param has not already been serialized
// Prevents <rect> from being serialized as its own tag.
@@ -264,10 +281,17 @@ namespace LLInitParam
name_stack.push_back(std::make_pair(it->first, !duplicate));
const Param* diff_param = diff_block ? diff_block->getParamFromHandle(param_handle) : NULL;
- serialize_func(*param, parser, name_stack, diff_param);
+ serialized |= serialize_func(*param, parser, name_stack, predicate_rule, diff_param);
name_stack.pop_back();
}
}
+
+ if (!serialized && predicate_rule.check(ll_make_predicate(EMPTY)))
+ {
+ serialized |= parser.writeValue(Flag(), name_stack);
+ }
+ // was anything serialized in this block?
+ return serialized;
}
bool BaseBlock::inspectBlock(Parser& parser, Parser::name_stack_t name_stack, S32 min_count, S32 max_count) const
@@ -393,7 +417,7 @@ namespace LLInitParam
// Block<T, Base_Class>
if ((size_t)handle > block_data.mMaxParamOffset)
{
- llerrs << "Attempted to register param with block defined for parent class, make sure to derive from LLInitParam::Block<YOUR_CLASS, PARAM_BLOCK_BASE_CLASS>" << llendl;
+ LL_ERRS() << "Attempted to register param with block defined for parent class, make sure to derive from LLInitParam::Block<YOUR_CLASS, PARAM_BLOCK_BASE_CLASS>" << LL_ENDL;
}
ParamDescriptorPtr param_descriptor = findParamDescriptor(param);
diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h
index 03ab0fb67f..7aa87fcd0e 100755
--- a/indra/llcommon/llinitparam.h
+++ b/indra/llcommon/llinitparam.h
@@ -29,14 +29,17 @@
#define LL_LLPARAM_H
#include <vector>
+#include <list>
#include <boost/function.hpp>
+#include <boost/shared_ptr.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_enum.hpp>
#include <boost/unordered_map.hpp>
-#include <boost/shared_ptr.hpp>
#include "llerror.h"
#include "llstl.h"
+#include "llpredicate.h"
+#include "llsd.h"
namespace LLTypeTags
{
@@ -195,6 +198,8 @@ namespace LLInitParam
return mValue;
}
+ bool isValid() const { return true; }
+
protected:
T mValue;
};
@@ -209,13 +214,11 @@ namespace LLInitParam
typedef T value_t;
ParamValue()
- : T(),
- mValidated(false)
+ : T()
{}
ParamValue(const default_value_t& other)
- : T(other),
- mValidated(false)
+ : T(other)
{}
void setValue(const value_t& val)
@@ -232,9 +235,6 @@ namespace LLInitParam
{
return *this;
}
-
- protected:
- mutable bool mValidated; // lazy validation flag
};
@@ -497,25 +497,25 @@ namespace LLInitParam
virtual ~Parser();
template <typename T> bool readValue(T& param, typename boost::disable_if<boost::is_enum<T> >::type* dummy = 0)
- {
+ {
parser_read_func_map_t::iterator found_it = mParserReadFuncs->find(&typeid(T));
if (found_it != mParserReadFuncs->end())
- {
+ {
return found_it->second(*this, (void*)&param);
- }
-
- return false;
}
-
+
+ return false;
+ }
+
template <typename T> bool readValue(T& param, typename boost::enable_if<boost::is_enum<T> >::type* dummy = 0)
- {
+ {
parser_read_func_map_t::iterator found_it = mParserReadFuncs->find(&typeid(T));
if (found_it != mParserReadFuncs->end())
- {
+ {
return found_it->second(*this, (void*)&param);
- }
+ }
else
- {
+ {
found_it = mParserReadFuncs->find(&typeid(S32));
if (found_it != mParserReadFuncs->end())
{
@@ -523,20 +523,20 @@ namespace LLInitParam
bool parsed = found_it->second(*this, (void*)&int_value);
param = (T)int_value;
return parsed;
- }
}
- return false;
}
+ return false;
+ }
template <typename T> bool writeValue(const T& param, name_stack_t& name_stack)
- {
+ {
parser_write_func_map_t::iterator found_it = mParserWriteFuncs->find(&typeid(T));
if (found_it != mParserWriteFuncs->end())
- {
+ {
return found_it->second(*this, (const void*)&param, name_stack);
- }
- return false;
}
+ return false;
+ }
// dispatch inspection to registered inspection functions, for each parameter in a param block
template <typename T> bool inspectValue(name_stack_t& name_stack, S32 min_count, S32 max_count, const possible_values_t* possible_values)
@@ -579,6 +579,19 @@ namespace LLInitParam
class Param;
+ enum ESerializePredicates
+ {
+ PROVIDED,
+ REQUIRED,
+ VALID,
+ HAS_DEFAULT_VALUE,
+ EMPTY
+ };
+
+ typedef LLPredicate::Rule<ESerializePredicates> predicate_rule_t;
+
+ predicate_rule_t default_parse_rules();
+
// various callbacks and constraints associated with an individual param
struct LL_COMMON_API ParamDescriptor
{
@@ -589,7 +602,7 @@ namespace LLInitParam
typedef bool(*merge_func_t)(Param&, const Param&, bool);
typedef bool(*deserialize_func_t)(Param&, Parser&, Parser::name_stack_range_t&, bool);
- typedef void(*serialize_func_t)(const Param&, Parser&, Parser::name_stack_t&, const Param* diff_param);
+ typedef bool(*serialize_func_t)(const Param&, Parser&, Parser::name_stack_t&, const predicate_rule_t rules, const Param* diff_param);
typedef void(*inspect_func_t)(const Param&, Parser&, Parser::name_stack_t&, S32 min_count, S32 max_count);
typedef bool(*validation_func_t)(const Param*);
@@ -829,12 +842,28 @@ namespace LLInitParam
LOG_CLASS(BaseBlock);
friend class Param;
+ BaseBlock()
+ : mValidated(false),
+ mParamProvided(false)
+ {}
+
virtual ~BaseBlock() {}
bool submitValue(Parser::name_stack_t& name_stack, Parser& p, bool silent=false);
param_handle_t getHandleFromParam(const Param* param) const;
bool validateBlock(bool emit_errors = true) const;
+ bool isProvided() const
+ {
+ return mParamProvided;
+ }
+
+ bool isValid() const
+ {
+ return validateBlock(false);
+ }
+
+
Param* getParamFromHandle(const param_handle_t param_handle)
{
if (param_handle == 0) return NULL;
@@ -852,10 +881,19 @@ namespace LLInitParam
void addSynonym(Param& param, const std::string& synonym);
// Blocks can override this to do custom tracking of changes
- virtual void paramChanged(const Param& changed_param, bool user_provided) {}
+ virtual void paramChanged(const Param& changed_param, bool user_provided)
+ {
+ if (user_provided)
+ {
+ // a child param has been explicitly changed
+ // so *some* aspect of this block is now provided
+ mValidated = false;
+ mParamProvided = true;
+ }
+ }
bool deserializeBlock(Parser& p, Parser::name_stack_range_t& name_stack_range, bool new_name);
- void serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const BaseBlock* diff_block = NULL) const;
+ bool serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const predicate_rule_t rule, const BaseBlock* diff_block = NULL) const;
bool inspectBlock(Parser& p, Parser::name_stack_t name_stack = Parser::name_stack_t(), S32 min_count = 0, S32 max_count = S32_MAX) const;
virtual const BlockDescriptor& mostDerivedBlockDescriptor() const { return getBlockDescriptor(); }
@@ -893,6 +931,9 @@ namespace LLInitParam
return mergeBlock(block_data, source, overwrite);
}
+ mutable bool mValidated; // lazy validation flag
+ bool mParamProvided;
+
private:
const std::string& getParamName(const BlockDescriptor& block_data, const Param* paramp) const;
};
@@ -986,6 +1027,8 @@ namespace LLInitParam
bool isProvided() const { return Param::anyProvided(); }
+ bool isValid() const { return true; }
+
static bool deserializeParam(Param& param, Parser& parser, Parser::name_stack_range_t& name_stack_range, bool new_name)
{
self_t& typed_param = static_cast<self_t&>(param);
@@ -1014,10 +1057,23 @@ namespace LLInitParam
return false;
}
- static void serializeParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, const Param* diff_param)
+ static bool serializeParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const Param* diff_param)
{
+ bool serialized = false;
const self_t& typed_param = static_cast<const self_t&>(param);
- if (!typed_param.isProvided()) return;
+ const self_t* diff_typed_param = static_cast<const self_t*>(diff_param);
+
+ LLPredicate::Value<ESerializePredicates> predicate;
+ if (diff_typed_param && ParamCompare<T>::equals(typed_param.getValue(), diff_typed_param->getValue()))
+ {
+ predicate.set(HAS_DEFAULT_VALUE);
+ }
+
+ predicate.set(VALID, typed_param.isValid());
+ predicate.set(PROVIDED, typed_param.anyProvided());
+ predicate.set(EMPTY, false);
+
+ if (!predicate_rule.check(predicate)) return false;
if (!name_stack.empty())
{
@@ -1030,25 +1086,27 @@ namespace LLInitParam
if (!key.empty())
{
- if (!diff_param || !ParamCompare<std::string>::equals(static_cast<const self_t*>(diff_param)->getValueName(), key))
+ if (!diff_typed_param || !ParamCompare<std::string>::equals(diff_typed_param->getValueName(), key))
{
- parser.writeValue(key, name_stack);
+ serialized = parser.writeValue(key, name_stack);
}
}
// then try to serialize value directly
- else if (!diff_param || !ParamCompare<T>::equals(typed_param.getValue(), static_cast<const self_t*>(diff_param)->getValue()))
+ else if (!diff_typed_param || ParamCompare<T>::equals(typed_param.getValue(), diff_typed_param->getValue()))
{
- if (!parser.writeValue(typed_param.getValue(), name_stack))
+ serialized = parser.writeValue(typed_param.getValue(), name_stack);
+ if (!serialized)
{
std::string calculated_key = typed_param.calcValueName(typed_param.getValue());
if (calculated_key.size()
- && (!diff_param
+ && (!diff_typed_param
|| !ParamCompare<std::string>::equals(static_cast<const self_t*>(diff_param)->getValueName(), calculated_key)))
{
- parser.writeValue(calculated_key, name_stack);
+ serialized = parser.writeValue(calculated_key, name_stack);
}
}
}
+ return serialized;
}
static void inspectParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, S32 min_count, S32 max_count)
@@ -1113,19 +1171,19 @@ namespace LLInitParam
};
// parameter that is a block
- template <typename T, typename NAME_VALUE_LOOKUP>
- class TypedParam<T, NAME_VALUE_LOOKUP, false, IS_A_BLOCK>
+ template <typename BLOCK_T, typename NAME_VALUE_LOOKUP>
+ class TypedParam<BLOCK_T, NAME_VALUE_LOOKUP, false, IS_A_BLOCK>
: public Param,
public NAME_VALUE_LOOKUP::type_value_t
{
protected:
- typedef ParamValue<typename LLTypeTags::Sorted<T>::value_t> param_value_t;
- typedef typename param_value_t::default_value_t default_value_t;
- typedef TypedParam<T, NAME_VALUE_LOOKUP, false, IS_A_BLOCK> self_t;
- typedef typename NAME_VALUE_LOOKUP::type_value_t named_value_t;
+ typedef ParamValue<typename LLTypeTags::Sorted<BLOCK_T>::value_t> param_value_t;
+ typedef typename param_value_t::default_value_t default_value_t;
+ typedef TypedParam<BLOCK_T, NAME_VALUE_LOOKUP, false, IS_A_BLOCK> self_t;
+ typedef typename NAME_VALUE_LOOKUP::type_value_t named_value_t;
public:
using named_value_t::operator();
- typedef typename param_value_t::value_t value_t;
+ typedef typename param_value_t::value_t value_t;
TypedParam(BlockDescriptor& block_descriptor, const char* name, const default_value_t& value, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count)
: Param(block_descriptor.mCurrentBlockPtr),
@@ -1148,11 +1206,11 @@ namespace LLInitParam
if(named_value_t::valueNamesExist()
&& parser.readValue(name)
&& named_value_t::getValueFromName(name, typed_param.getValue()))
- {
- typed_param.setValueName(name);
- typed_param.setProvided();
- return true;
- }
+ {
+ typed_param.setValueName(name);
+ typed_param.setProvided();
+ return true;
+ }
}
if(typed_param.deserializeBlock(parser, name_stack_range, new_name))
@@ -1166,10 +1224,16 @@ namespace LLInitParam
return false;
}
- static void serializeParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, const Param* diff_param)
+ static bool serializeParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const Param* diff_param)
{
const self_t& typed_param = static_cast<const self_t&>(param);
- if (!typed_param.isProvided()) return;
+
+ LLPredicate::Value<ESerializePredicates> predicate;
+
+ predicate.set(VALID, typed_param.isValid());
+ predicate.set(PROVIDED, typed_param.anyProvided());
+
+ if (!predicate_rule.check(predicate)) return false;
if (!name_stack.empty())
{
@@ -1182,12 +1246,15 @@ namespace LLInitParam
if (!diff_param || !ParamCompare<std::string>::equals(static_cast<const self_t*>(diff_param)->getValueName(), key))
{
parser.writeValue(key, name_stack);
+ return true;
}
}
else
{
- typed_param.serializeBlock(parser, name_stack, static_cast<const self_t*>(diff_param));
+ return typed_param.serializeBlock(parser, name_stack, predicate_rule, static_cast<const self_t*>(diff_param));
}
+
+ return false;
}
static void inspectParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, S32 min_count, S32 max_count)
@@ -1209,13 +1276,12 @@ namespace LLInitParam
// *and* the block as a whole validates
bool isProvided() const
{
- // only validate block when it hasn't already passed validation with current data
- if (Param::anyProvided() && !param_value_t::mValidated)
- {
- // a sub-block is "provided" when it has been filled in enough to be valid
- param_value_t::mValidated = param_value_t::validateBlock(false);
- }
- return Param::anyProvided() && param_value_t::mValidated;
+ return Param::anyProvided() && isValid();
+ }
+
+ bool isValid() const
+ {
+ return param_value_t::isValid();
}
// assign block contents to this param-that-is-a-block
@@ -1223,9 +1289,6 @@ namespace LLInitParam
{
setValue(val);
named_value_t::clearValueName();
- // force revalidation of block
- // next call to isProvided() will update provision status based on validity
- param_value_t::mValidated = false;
setProvided(flag_as_provided);
}
@@ -1242,9 +1305,6 @@ namespace LLInitParam
if (user_provided)
{
- // a child param has been explicitly changed
- // so *some* aspect of this block is now provided
- param_value_t::mValidated = false;
setProvided();
named_value_t::clearValueName();
}
@@ -1296,13 +1356,13 @@ namespace LLInitParam
};
// list of non-block parameters
- template <typename VALUE_TYPE, typename NAME_VALUE_LOOKUP>
- class TypedParam<VALUE_TYPE, NAME_VALUE_LOOKUP, true, NOT_BLOCK>
+ template <typename MULTI_VALUE_T, typename NAME_VALUE_LOOKUP>
+ class TypedParam<MULTI_VALUE_T, NAME_VALUE_LOOKUP, true, NOT_BLOCK>
: public Param
{
protected:
- typedef TypedParam<VALUE_TYPE, NAME_VALUE_LOOKUP, true, NOT_BLOCK> self_t;
- typedef ParamValue<typename LLTypeTags::Sorted<VALUE_TYPE>::value_t> param_value_t;
+ typedef TypedParam<MULTI_VALUE_T, NAME_VALUE_LOOKUP, true, NOT_BLOCK> self_t;
+ typedef ParamValue<typename LLTypeTags::Sorted<MULTI_VALUE_T>::value_t> param_value_t;
typedef typename std::vector<typename NAME_VALUE_LOOKUP::type_value_t> container_t;
typedef container_t default_value_t;
typedef typename NAME_VALUE_LOOKUP::type_value_t named_value_t;
@@ -1311,7 +1371,9 @@ namespace LLInitParam
typedef typename param_value_t::value_t value_t;
TypedParam(BlockDescriptor& block_descriptor, const char* name, const default_value_t& value, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count)
- : Param(block_descriptor.mCurrentBlockPtr)
+ : Param(block_descriptor.mCurrentBlockPtr),
+ mMinCount(min_count),
+ mMaxCount(max_count)
{
std::copy(value.begin(), value.end(), std::back_inserter(mValues));
@@ -1322,7 +1384,13 @@ namespace LLInitParam
}
}
- bool isProvided() const { return Param::anyProvided(); }
+ bool isProvided() const { return Param::anyProvided() && isValid(); }
+
+ bool isValid() const
+ {
+ size_t num_elements = numValidElements();
+ return mMinCount < num_elements && num_elements < mMaxCount;
+ }
static bool deserializeParam(Param& param, Parser& parser, Parser::name_stack_range_t& name_stack_range, bool new_name)
{
@@ -1337,7 +1405,7 @@ namespace LLInitParam
}
// no further names in stack, attempt to parse value now
- if (name_stack_range.first == name_stack_range.second)
+ if (new_name_stack_range.first == new_name_stack_range.second)
{
std::string name;
@@ -1359,10 +1427,19 @@ namespace LLInitParam
return false;
}
- static void serializeParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, const Param* diff_param)
+ static bool serializeParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const Param* diff_param)
{
+ bool serialized = false;
const self_t& typed_param = static_cast<const self_t&>(param);
- if (!typed_param.isProvided()) return;
+
+ LLPredicate::Value<ESerializePredicates> predicate;
+
+ predicate.set(REQUIRED, typed_param.mMinCount > 0);
+ predicate.set(VALID, typed_param.isValid());
+ predicate.set(PROVIDED, typed_param.anyProvided());
+ predicate.set(EMPTY, typed_param.mValues.empty());
+
+ if (!predicate_rule.check(predicate)) return false;
for (const_iterator it = typed_param.mValues.begin(), end_it = typed_param.mValues.end();
it != end_it;
@@ -1378,7 +1455,11 @@ namespace LLInitParam
if (!value_written)
{
std::string calculated_key = it->calcValueName(it->getValue());
- if (!parser.writeValue(calculated_key, name_stack))
+ if (parser.writeValue(calculated_key, name_stack))
+ {
+ serialized = true;
+ }
+ else
{
break;
}
@@ -1386,19 +1467,23 @@ namespace LLInitParam
}
else
{
- if(!parser.writeValue(key, name_stack))
+ if(parser.writeValue(key, name_stack))
+ {
+ serialized = true;
+ }
+ else
{
break;
}
}
-
- name_stack.pop_back();
}
+
+ return serialized;
}
static void inspectParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, S32 min_count, S32 max_count)
{
- parser.inspectValue<VALUE_TYPE>(name_stack, min_count, max_count, NULL);
+ parser.inspectValue<MULTI_VALUE_T>(name_stack, min_count, max_count, NULL);
if (named_value_t::getPossibleValues())
{
parser.inspectValue<std::string>(name_stack, min_count, max_count, named_value_t::getPossibleValues());
@@ -1453,7 +1538,7 @@ namespace LLInitParam
bool empty() const { return mValues.empty(); }
size_t size() const { return mValues.size(); }
- U32 numValidElements() const
+ size_t numValidElements() const
{
return mValues.size();
}
@@ -1483,6 +1568,8 @@ namespace LLInitParam
}
container_t mValues;
+ size_t mMinCount,
+ mMaxCount;
private:
void init( BlockDescriptor &block_descriptor, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count, const char* name )
@@ -1500,13 +1587,13 @@ namespace LLInitParam
};
// list of block parameters
- template <typename VALUE_TYPE, typename NAME_VALUE_LOOKUP>
- class TypedParam<VALUE_TYPE, NAME_VALUE_LOOKUP, true, IS_A_BLOCK>
+ template <typename MULTI_BLOCK_T, typename NAME_VALUE_LOOKUP>
+ class TypedParam<MULTI_BLOCK_T, NAME_VALUE_LOOKUP, true, IS_A_BLOCK>
: public Param
{
protected:
- typedef TypedParam<VALUE_TYPE, NAME_VALUE_LOOKUP, true, IS_A_BLOCK> self_t;
- typedef ParamValue<typename LLTypeTags::Sorted<VALUE_TYPE>::value_t> param_value_t;
+ typedef TypedParam<MULTI_BLOCK_T, NAME_VALUE_LOOKUP, true, IS_A_BLOCK> self_t;
+ typedef ParamValue<typename LLTypeTags::Sorted<MULTI_BLOCK_T>::value_t> param_value_t;
typedef typename std::vector<typename NAME_VALUE_LOOKUP::type_value_t> container_t;
typedef typename NAME_VALUE_LOOKUP::type_value_t named_value_t;
typedef container_t default_value_t;
@@ -1516,7 +1603,9 @@ namespace LLInitParam
typedef typename param_value_t::value_t value_t;
TypedParam(BlockDescriptor& block_descriptor, const char* name, const default_value_t& value, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count)
- : Param(block_descriptor.mCurrentBlockPtr)
+ : Param(block_descriptor.mCurrentBlockPtr),
+ mMinCount(min_count),
+ mMaxCount(max_count)
{
std::copy(value.begin(), value.end(), back_inserter(mValues));
@@ -1526,7 +1615,14 @@ namespace LLInitParam
}
}
- bool isProvided() const { return Param::anyProvided(); }
+ bool isProvided() const { return Param::anyProvided() && isValid(); }
+
+ bool isValid() const
+ {
+ size_t num_elements = numValidElements();
+ return mMinCount < num_elements && num_elements < mMaxCount;
+ }
+
static bool deserializeParam(Param& param, Parser& parser, Parser::name_stack_range_t& name_stack_range, bool new_name)
{
@@ -1549,7 +1645,7 @@ namespace LLInitParam
}
param_value_t& value = typed_param.mValues.back();
- if (name_stack_range.first == name_stack_range.second)
+ if (new_name_stack_range.first == new_name_stack_range.second)
{ // try to parse a known named value
std::string name;
@@ -1559,6 +1655,10 @@ namespace LLInitParam
{
typed_param.mValues.back().setValueName(name);
typed_param.setProvided();
+ if (new_array_value)
+ {
+ name_stack_range.first->second = false;
+ }
return true;
}
}
@@ -1583,10 +1683,18 @@ namespace LLInitParam
return false;
}
- static void serializeParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, const Param* diff_param)
+ static bool serializeParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const Param* diff_param)
{
+ bool serialized = false;
const self_t& typed_param = static_cast<const self_t&>(param);
- if (!typed_param.isProvided()) return;
+ LLPredicate::Value<ESerializePredicates> predicate;
+
+ predicate.set(REQUIRED, typed_param.mMinCount > 0);
+ predicate.set(VALID, typed_param.isValid());
+ predicate.set(PROVIDED, typed_param.anyProvided());
+ predicate.set(EMPTY, typed_param.mValues.empty());
+
+ if (!predicate_rule.check(predicate)) return false;
for (const_iterator it = typed_param.mValues.begin(), end_it = typed_param.mValues.end();
it != end_it;
@@ -1597,17 +1705,24 @@ namespace LLInitParam
std::string key = it->getValueName();
if (!key.empty())
{
- parser.writeValue(key, name_stack);
+ serialized |= parser.writeValue(key, name_stack);
}
// Not parsed via named values, write out value directly
- // NOTE: currently we don't worry about removing default values in Multiple
+ // NOTE: currently we don't do diffing of Multiples
else
{
- it->serializeBlock(parser, name_stack, NULL);
+ serialized = it->serializeBlock(parser, name_stack, predicate_rule, NULL);
}
name_stack.pop_back();
}
+
+ if (!serialized && predicate_rule.check(ll_make_predicate(EMPTY)))
+ {
+ serialized |= parser.writeValue(Flag(), name_stack);
+ }
+
+ return serialized;
}
static void inspectParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, S32 min_count, S32 max_count)
@@ -1670,14 +1785,14 @@ namespace LLInitParam
bool empty() const { return mValues.empty(); }
size_t size() const { return mValues.size(); }
- U32 numValidElements() const
+ size_t numValidElements() const
{
- U32 count = 0;
+ size_t count = 0;
for (const_iterator it = mValues.begin(), end_it = mValues.end();
it != end_it;
++it)
{
- if(it->validateBlock(false)) count++;
+ if(it->isValid()) count++;
}
return count;
}
@@ -1709,6 +1824,8 @@ namespace LLInitParam
}
container_t mValues;
+ size_t mMinCount,
+ mMaxCount;
private:
void init( BlockDescriptor &block_descriptor, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count, const char* name )
@@ -2015,7 +2132,7 @@ namespace LLInitParam
static bool validate(const Param* paramp)
{
- U32 num_valid = ((super_t*)paramp)->numValidElements();
+ size_t num_valid = ((super_t*)paramp)->numValidElements();
return RANGE::minCount <= num_valid && num_valid <= RANGE::maxCount;
}
};
@@ -2158,13 +2275,11 @@ namespace LLInitParam
typedef T default_value_t;
ParamValue()
- : mValue(),
- mValidated(false)
+ : mValue()
{}
ParamValue(const default_value_t& value)
- : mValue(value),
- mValidated(false)
+ : mValue(value)
{}
void setValue(const value_t& val)
@@ -2191,18 +2306,18 @@ namespace LLInitParam
return mValue.deserializeBlock(p, name_stack_range, new_name);
}
- void serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const self_t* diff_block = NULL) const
+ bool serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const self_t* diff_block = NULL) const
{
const BaseBlock* base_block = diff_block
? &(diff_block->mValue)
: NULL;
- mValue.serializeBlock(p, name_stack, base_block);
+ return mValue.serializeBlock(p, name_stack, predicate_rule, base_block);
}
bool inspectBlock(Parser& p, Parser::name_stack_t name_stack = Parser::name_stack_t(), S32 min_count = 0, S32 max_count = S32_MAX) const
- {
+ {
return mValue.inspectBlock(p, name_stack, min_count, max_count);
- }
+ }
bool mergeBlockParam(bool source_provided, bool dst_provided, BlockDescriptor& block_data, const self_t& source, bool overwrite)
{
@@ -2212,9 +2327,7 @@ namespace LLInitParam
// clear away what is there and take the new stuff as a whole
resetToDefault();
return mValue.mergeBlock(block_data, source.getValue(), overwrite);
- }
-
-
+ }
return mValue.mergeBlock(block_data, source.getValue(), overwrite);
}
@@ -2223,14 +2336,17 @@ namespace LLInitParam
return mValue.validateBlock(emit_errors);
}
+ bool isValid() const
+ {
+ return validateBlock(false);
+ }
+
static BlockDescriptor& getBlockDescriptor()
{
return value_t::getBlockDescriptor();
}
- mutable bool mValidated; // lazy validation flag
-
private:
void resetToDefault()
{
@@ -2251,15 +2367,13 @@ namespace LLInitParam
typedef T default_value_t;
ParamValue()
- : mValue(),
- mValidated(false)
+ : mValue()
{
mCurParam = getBlockDescriptor().mAllParams.begin();
}
ParamValue(const default_value_t& value)
- : mValue(value),
- mValidated(false)
+ : mValue(value)
{
mCurParam = getBlockDescriptor().mAllParams.begin();
}
@@ -2284,7 +2398,7 @@ namespace LLInitParam
if (new_name)
{
mCurParam = getBlockDescriptor().mAllParams.begin();
- }
+ }
if (name_stack_range.first == name_stack_range.second
&& mCurParam != getBlockDescriptor().mAllParams.end())
{
@@ -2296,7 +2410,7 @@ namespace LLInitParam
if (deserialize_func
&& paramp
&& deserialize_func(*paramp, p, name_stack_range, new_name))
- {
+ {
++mCurParam;
return true;
}
@@ -2304,19 +2418,19 @@ namespace LLInitParam
{
return false;
}
- }
+ }
else
{
return mValue.deserializeBlock(p, name_stack_range, new_name);
}
}
- void serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const self_t* diff_block = NULL) const
+ bool serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const self_t* diff_block = NULL) const
{
const BaseBlock* base_block = diff_block
? &(diff_block->mValue)
: NULL;
- mValue.serializeBlock(p, name_stack, base_block);
+ return mValue.serializeBlock(p, name_stack, predicate_rule, base_block);
}
bool inspectBlock(Parser& p, Parser::name_stack_t name_stack = Parser::name_stack_t(), S32 min_count = 0, S32 max_count = S32_MAX) const
@@ -2334,13 +2448,16 @@ namespace LLInitParam
return mValue.validateBlock(emit_errors);
}
+ bool isValid() const
+ {
+ return validateBlock(false);
+ }
+
static BlockDescriptor& getBlockDescriptor()
{
return value_t::getBlockDescriptor();
}
- mutable bool mValidated; // lazy validation flag
-
private:
BlockDescriptor::all_params_list_t::iterator mCurParam;
@@ -2358,16 +2475,14 @@ namespace LLInitParam
typedef T default_value_t;
ParamValue()
- : T(),
- mValidated(false)
+ : T()
{}
ParamValue(const default_value_t& value)
- : T(value.getValue()),
- mValidated(false)
+ : T(value.getValue())
{}
- mutable bool mValidated; // lazy validation flag
+ bool isValid() const { return true; }
};
template<typename T, typename BLOCK_T>
@@ -2380,18 +2495,15 @@ namespace LLInitParam
typedef LazyValue<T> default_value_t;
ParamValue()
- : mValue(),
- mValidated(false)
+ : mValue()
{}
ParamValue(const default_value_t& other)
- : mValue(other),
- mValidated(false)
+ : mValue(other)
{}
ParamValue(const T& value)
- : mValue(value),
- mValidated(false)
+ : mValue(value)
{}
void setValue(const value_t& val)
@@ -2414,14 +2526,14 @@ namespace LLInitParam
return mValue.get().deserializeBlock(p, name_stack_range, new_name);
}
- void serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const self_t* diff_block = NULL) const
+ bool serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const self_t* diff_block = NULL) const
{
- if (mValue.empty()) return;
+ if (mValue.empty()) return false;
const BaseBlock* base_block = (diff_block && !diff_block->mValue.empty())
? &(diff_block->mValue.get().getValue())
: NULL;
- mValue.get().serializeBlock(p, name_stack, base_block);
+ return mValue.get().serializeBlock(p, name_stack, predicate_rule, base_block);
}
bool inspectBlock(Parser& p, Parser::name_stack_t name_stack = Parser::name_stack_t(), S32 min_count = 0, S32 max_count = S32_MAX) const
@@ -2433,26 +2545,29 @@ namespace LLInitParam
{
return source.mValue.empty() || mValue.get().mergeBlock(block_data, source.getValue(), overwrite);
}
-
+
bool validateBlock(bool emit_errors = true) const
{
return mValue.empty() || mValue.get().validateBlock(emit_errors);
}
+ bool isValid() const
+ {
+ return validateBlock(false);
+ }
+
static BlockDescriptor& getBlockDescriptor()
{
return value_t::getBlockDescriptor();
}
- mutable bool mValidated; // lazy validation flag
-
private:
LazyValue<T> mValue;
};
template<typename T, typename BLOCK_T>
class ParamValue <BaseBlock::Lazy<T, NOT_BLOCK>, BLOCK_T>
- {
+ {
typedef ParamValue <BaseBlock::Lazy<T, NOT_BLOCK>, BLOCK_T> self_t;
public:
@@ -2460,18 +2575,15 @@ namespace LLInitParam
typedef LazyValue<T> default_value_t;
ParamValue()
- : mValue(),
- mValidated(false)
+ : mValue()
{}
ParamValue(const default_value_t& other)
- : mValue(other),
- mValidated(false)
+ : mValue(other)
{}
ParamValue(const T& value)
- : mValue(value),
- mValidated(false)
+ : mValue(value)
{}
void setValue(const value_t& val)
@@ -2489,7 +2601,10 @@ namespace LLInitParam
return mValue.get().getValue();
}
- mutable bool mValidated; // lazy validation flag
+ bool isValid() const
+ {
+ return true;
+ }
private:
LazyValue<T> mValue;
@@ -2504,12 +2619,10 @@ namespace LLInitParam
typedef LLSD default_value_t;
ParamValue()
- : mValidated(false)
{}
ParamValue(const default_value_t& other)
- : mValue(other),
- mValidated(false)
+ : mValue(other)
{}
void setValue(const value_t& val) { mValue = val; }
@@ -2519,16 +2632,13 @@ namespace LLInitParam
// block param interface
LL_COMMON_API bool deserializeBlock(Parser& p, Parser::name_stack_range_t& name_stack_range, bool new_name);
- LL_COMMON_API void serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const BaseBlock* diff_block = NULL) const;
+ LL_COMMON_API bool serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const BaseBlock* diff_block = NULL) const;
bool inspectBlock(Parser& p, Parser::name_stack_t name_stack = Parser::name_stack_t(), S32 min_count = 0, S32 max_count = S32_MAX) const
{
//TODO: implement LLSD params as schema type Any
return true;
}
- protected:
- mutable bool mValidated; // lazy validation flag
-
private:
static void serializeElement(Parser& p, const LLSD& sd, Parser::name_stack_t& name_stack);
@@ -2547,18 +2657,17 @@ namespace LLInitParam
BLOCK_AUTHORITATIVE // mValue is derived from the block parameters, which are authoritative
} EValueAge;
- typedef ParamValue<T> derived_t;
- typedef CustomParamValue<T> self_t;
- typedef Block<derived_t> block_t;
+ typedef TypeValues<T> derived_t;
+ typedef CustomParamValue<T> self_t;
+ typedef Block<ParamValue<T> > block_t;
typedef T default_value_t;
- typedef T value_t;
+ typedef T value_t;
typedef void baseblock_base_class_t;
CustomParamValue(const default_value_t& value = T())
: mValue(value),
- mValueAge(VALUE_AUTHORITATIVE),
- mValidated(false)
+ mValueAge(VALUE_AUTHORITATIVE)
{}
bool deserializeBlock(Parser& parser, Parser::name_stack_range_t& name_stack_range, bool new_name)
@@ -2580,16 +2689,30 @@ namespace LLInitParam
return typed_param.BaseBlock::deserializeBlock(parser, name_stack_range, new_name);
}
- void serializeBlock(Parser& parser, Parser::name_stack_t& name_stack, const BaseBlock* diff_block = NULL) const
+ bool serializeBlock(Parser& parser, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const BaseBlock* diff_block = NULL) const
{
const derived_t& typed_param = static_cast<const derived_t&>(*this);
const derived_t* diff_param = static_cast<const derived_t*>(diff_block);
+ //std::string key = typed_param.getValueName();
+
+ //// first try to write out name of name/value pair
+ //if (!key.empty())
+ //{
+ // if (!diff_param || !ParamCompare<std::string>::equals(diff_param->getValueName(), key))
+ // {
+ // return parser.writeValue(key, name_stack);
+ // }
+ //}
// then try to serialize value directly
if (!diff_param || !ParamCompare<T>::equals(typed_param.getValue(), diff_param->getValue()))
{
- if (!parser.writeValue(typed_param.getValue(), name_stack))
+ if (parser.writeValue(typed_param.getValue(), name_stack))
+ {
+ return true;
+ }
+ else
{
//RN: *always* serialize provided components of BlockValue (don't pass diff_param on),
// since these tend to be viewed as the constructor arguments for the value T. It seems
@@ -2606,14 +2729,15 @@ namespace LLInitParam
// and serialize those params
derived_t copy(typed_param);
copy.updateBlockFromValue(true);
- copy.block_t::serializeBlock(parser, name_stack, NULL);
+ return copy.block_t::serializeBlock(parser, name_stack, predicate_rule, NULL);
}
else
{
- block_t::serializeBlock(parser, name_stack, NULL);
+ return block_t::serializeBlock(parser, name_stack, predicate_rule, NULL);
}
}
}
+ return false;
}
bool validateBlock(bool emit_errors = true) const
@@ -2705,8 +2829,6 @@ namespace LLInitParam
return block_t::mergeBlock(block_data, source, overwrite);
}
- mutable bool mValidated; // lazy validation flag
-
private:
mutable T mValue;
mutable EValueAge mValueAge;
diff --git a/indra/llcommon/llinstancetracker.cpp b/indra/llcommon/llinstancetracker.cpp
index 64a313b5ff..11fc53f8c8 100755
--- a/indra/llcommon/llinstancetracker.cpp
+++ b/indra/llcommon/llinstancetracker.cpp
@@ -27,8 +27,26 @@
#include "linden_common.h"
// associated header
#include "llinstancetracker.h"
+#include "llapr.h"
+
// STL headers
// std headers
// external library headers
// other Linden headers
+void LLInstanceTrackerBase::StaticBase::incrementDepth()
+{
+ apr_atomic_inc32(&sIterationNestDepth);
+}
+
+void LLInstanceTrackerBase::StaticBase::decrementDepth()
+{
+ llassert(sIterationNestDepth);
+ apr_atomic_dec32(&sIterationNestDepth);
+}
+
+U32 LLInstanceTrackerBase::StaticBase::getDepth()
+{
+ apr_uint32_t data = apr_atomic_read32(&sIterationNestDepth);
+ return data;
+}
diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h
index 55187d8325..9783644e66 100755
--- a/indra/llcommon/llinstancetracker.h
+++ b/indra/llcommon/llinstancetracker.h
@@ -31,10 +31,7 @@
#include <map>
#include <typeinfo>
-#include "string_table.h"
-#include <boost/utility.hpp>
-#include <boost/function.hpp>
-#include <boost/bind.hpp>
+#include "llstringtable.h"
#include <boost/iterator/transform_iterator.hpp>
#include <boost/iterator/indirect_iterator.hpp>
@@ -46,8 +43,6 @@
class LL_COMMON_API LLInstanceTrackerBase
{
protected:
-
-
/// It's not essential to derive your STATICDATA (for use with
/// getStatic()) from StaticBase; it's just that both known
/// implementations do.
@@ -56,31 +51,39 @@ protected:
StaticBase():
sIterationNestDepth(0)
{}
- S32 sIterationNestDepth;
+
+ void incrementDepth();
+ void decrementDepth();
+ U32 getDepth();
+ private:
+ U32 sIterationNestDepth;
};
};
LL_COMMON_API void assert_main_thread();
+enum EInstanceTrackerAllowKeyCollisions
+{
+ LLInstanceTrackerErrorOnCollision,
+ LLInstanceTrackerReplaceOnCollision
+};
+
/// This mix-in class adds support for tracking all instances of the specified class parameter T
/// The (optional) key associates a value of type KEY with a given instance of T, for quick lookup
/// If KEY is not provided, then instances are stored in a simple set
-/// @NOTE: see explicit specialization below for default KEY==T* case
-template<typename T, typename KEY = T*>
+/// @NOTE: see explicit specialization below for default KEY==void case
+/// @NOTE: this class is not thread-safe unless used as read-only
+template<typename T, typename KEY = void, EInstanceTrackerAllowKeyCollisions KEY_COLLISION_BEHAVIOR = LLInstanceTrackerErrorOnCollision>
class LLInstanceTracker : public LLInstanceTrackerBase
{
typedef LLInstanceTracker<T, KEY> self_t;
- typedef typename std::map<KEY, T*> InstanceMap;
+ typedef typename std::multimap<KEY, T*> InstanceMap;
struct StaticData: public StaticBase
{
InstanceMap sMap;
};
static StaticData& getStatic() { static StaticData sData; return sData;}
- static InstanceMap& getMap_()
- {
- // assert_main_thread(); fwiw this class is not thread safe, and it used by multiple threads. Bad things happen.
- return getStatic().sMap;
- }
+ static InstanceMap& getMap_() { return getStatic().sMap; }
public:
class instance_iter : public boost::iterator_facade<instance_iter, T, boost::forward_traversal_tag>
@@ -91,12 +94,12 @@ public:
instance_iter(const typename InstanceMap::iterator& it)
: mIterator(it)
{
- ++getStatic().sIterationNestDepth;
+ getStatic().incrementDepth();
}
~instance_iter()
{
- --getStatic().sIterationNestDepth;
+ getStatic().decrementDepth();
}
@@ -123,20 +126,20 @@ public:
typedef boost::iterator_facade<key_iter, KEY, boost::forward_traversal_tag> super_t;
key_iter(typename InstanceMap::iterator it)
- : mIterator(it)
+ : mIterator(it)
{
- ++getStatic().sIterationNestDepth;
+ getStatic().incrementDepth();
}
key_iter(const key_iter& other)
- : mIterator(other.mIterator)
+ : mIterator(other.mIterator)
{
- ++getStatic().sIterationNestDepth;
+ getStatic().incrementDepth();
}
~key_iter()
{
- --getStatic().sIterationNestDepth;
+ getStatic().decrementDepth();
}
@@ -174,7 +177,10 @@ public:
return instance_iter(getMap_().end());
}
- static S32 instanceCount() { return getMap_().size(); }
+ static S32 instanceCount()
+ {
+ return getMap_().size();
+ }
static key_iter beginKeys()
{
@@ -186,7 +192,7 @@ public:
}
protected:
- LLInstanceTracker(KEY key)
+ LLInstanceTracker(const KEY& key)
{
// make sure static data outlives all instances
getStatic();
@@ -195,7 +201,7 @@ protected:
virtual ~LLInstanceTracker()
{
// it's unsafe to delete instances of this type while all instances are being iterated over.
- llassert_always(getStatic().sIterationNestDepth == 0);
+ llassert_always(getStatic().getDepth() == 0);
remove_();
}
virtual void setKey(KEY key) { remove_(); add_(key); }
@@ -205,17 +211,44 @@ private:
LLInstanceTracker( const LLInstanceTracker& );
const LLInstanceTracker& operator=( const LLInstanceTracker& );
- void add_(KEY key)
+ void add_(const KEY& key)
{
mInstanceKey = key;
- getMap_()[key] = static_cast<T*>(this);
+ InstanceMap& map = getMap_();
+ typename InstanceMap::iterator insertion_point_it = map.lower_bound(key);
+ if (insertion_point_it != map.end()
+ && insertion_point_it->first == key)
+ { // found existing entry with that key
+ switch(KEY_COLLISION_BEHAVIOR)
+ {
+ case LLInstanceTrackerErrorOnCollision:
+ {
+ // use assert here instead of LL_ERRS(), otherwise the error will be ignored since this call is made during global object initialization
+ llassert_always_msg(false, "Instance with this same key already exists!");
+ break;
+ }
+ case LLInstanceTrackerReplaceOnCollision:
+ {
+ // replace pointer, but leave key (should have compared equal anyway)
+ insertion_point_it->second = static_cast<T*>(this);
+ break;
+ }
+ default:
+ break;
+ }
+ }
+ else
+ { // new key
+ map.insert(insertion_point_it, std::make_pair(key, static_cast<T*>(this)));
+ }
}
void remove_()
{
- typename InstanceMap::iterator iter = getMap_().find(mInstanceKey);
- if (iter != getMap_().end())
+ InstanceMap& map = getMap_();
+ typename InstanceMap::iterator iter = map.find(mInstanceKey);
+ if (iter != map.end())
{
- getMap_().erase(iter);
+ map.erase(iter);
}
}
@@ -223,12 +256,12 @@ private:
KEY mInstanceKey;
};
-/// explicit specialization for default case where KEY is T*
+/// explicit specialization for default case where KEY is void
/// use a simple std::set<T*>
-template<typename T>
-class LLInstanceTracker<T, T*> : public LLInstanceTrackerBase
+template<typename T, EInstanceTrackerAllowKeyCollisions KEY_COLLISION_BEHAVIOR>
+class LLInstanceTracker<T, void, KEY_COLLISION_BEHAVIOR> : public LLInstanceTrackerBase
{
- typedef LLInstanceTracker<T, T*> self_t;
+ typedef LLInstanceTracker<T, void> self_t;
typedef typename std::set<T*> InstanceSet;
struct StaticData: public StaticBase
{
@@ -261,18 +294,18 @@ public:
instance_iter(const typename InstanceSet::iterator& it)
: mIterator(it)
{
- ++getStatic().sIterationNestDepth;
+ getStatic().incrementDepth();
}
instance_iter(const instance_iter& other)
: mIterator(other.mIterator)
{
- ++getStatic().sIterationNestDepth;
+ getStatic().incrementDepth();
}
~instance_iter()
{
- --getStatic().sIterationNestDepth;
+ getStatic().decrementDepth();
}
private:
@@ -305,7 +338,7 @@ protected:
virtual ~LLInstanceTracker()
{
// it's unsafe to delete instances of this type while all instances are being iterated over.
- llassert_always(getStatic().sIterationNestDepth == 0);
+ llassert_always(getStatic().getDepth() == 0);
getSet_().erase(static_cast<T*>(this));
}
diff --git a/indra/llcommon/lllazy.cpp b/indra/llcommon/lllazy.cpp
deleted file mode 100755
index 29fa040387..0000000000
--- a/indra/llcommon/lllazy.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * @file lllazy.cpp
- * @author Nat Goodspeed
- * @date 2009-01-28
- * @brief Implementation for lllazy.
- *
- * $LicenseInfo:firstyear=2009&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-// Precompiled header
-#include "linden_common.h"
-// associated header
-#include "lllazy.h"
-// STL headers
-// std headers
-// external library headers
-// other Linden headers
-
-// lllazy.h is presently header-only. This file exists only because our CMake
-// test macro ADD_BUILD_TEST requires it.
-int dummy = 0;
diff --git a/indra/llcommon/lllazy.h b/indra/llcommon/lllazy.h
deleted file mode 100755
index 5f3bbce79e..0000000000
--- a/indra/llcommon/lllazy.h
+++ /dev/null
@@ -1,399 +0,0 @@
-/**
- * @file lllazy.h
- * @author Nat Goodspeed
- * @date 2009-01-22
- * @brief Lazy instantiation of specified type. Useful in conjunction with
- * Michael Feathers's "Extract and Override Getter" ("Working
- * Effectively with Legacy Code", p. 352).
- *
- * Quoting his synopsis of steps on p.355:
- *
- * 1. Identify the object you need a getter for.
- * 2. Extract all of the logic needed to create the object into a getter.
- * 3. Replace all uses of the object with calls to the getter, and initialize
- * the reference that holds the object to null in all constructors.
- * 4. Add the first-time logic to the getter so that the object is constructed
- * and assigned to the reference whenever the reference is null.
- * 5. Subclass the class and override the getter to provide an alternative
- * object for testing.
- *
- * It's the second half of bullet 3 (3b, as it were) that bothers me. I find
- * it all too easy to imagine adding pointer initializers to all but one
- * constructor... the one not exercised by my tests. That suggested using
- * (e.g.) boost::scoped_ptr<MyObject> so you don't have to worry about
- * destroying it either.
- *
- * However, introducing additional machinery allows us to encapsulate bullet 4
- * as well.
- *
- * $LicenseInfo:firstyear=2009&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#if ! defined(LL_LLLAZY_H)
-#define LL_LLLAZY_H
-
-#include <boost/function.hpp>
-#include <boost/scoped_ptr.hpp>
-#include <boost/lambda/construct.hpp>
-#include <stdexcept>
-
-/// LLLazyCommon simply factors out of LLLazy<T> things that don't depend on
-/// its template parameter.
-class LLLazyCommon
-{
-public:
- /**
- * This exception is thrown if you try to replace an LLLazy<T>'s factory
- * (or T* instance) after it already has an instance in hand. Since T
- * might well be stateful, we can't know the effect of silently discarding
- * and replacing an existing instance, so we disallow it. This facility is
- * intended for testing, and in a test scenario we can definitely control
- * that.
- */
- struct InstanceChange: public std::runtime_error
- {
- InstanceChange(const std::string& what): std::runtime_error(what) {}
- };
-
-protected:
- /**
- * InstanceChange might be appropriate in a couple of different LLLazy<T>
- * methods. Factor out the common logic.
- */
- template <typename PTR>
- static void ensureNoInstance(const PTR& ptr)
- {
- if (ptr)
- {
- // Too late: we've already instantiated the lazy object. We don't
- // know whether it's stateful or not, so it's not safe to discard
- // the existing instance in favor of a replacement.
- throw InstanceChange("Too late to replace LLLazy instance");
- }
- }
-};
-
-/**
- * LLLazy<T> is useful when you have an outer class Outer that you're trying
- * to bring under unit test, that contains a data member difficult to
- * instantiate in a test harness. Typically the data member's class Inner has
- * many thorny dependencies. Feathers generally advocates "Extract and
- * Override Factory Method" (p. 350). But in C++, you can't call a derived
- * class override of a virtual method from the derived class constructor,
- * which limits applicability of "Extract and Override Factory Method." For
- * such cases Feathers presents "Extract and Override Getter" (p. 352).
- *
- * So we'll assume that your class Outer contains a member like this:
- * @code
- * Inner mInner;
- * @endcode
- *
- * LLLazy<Inner> can be used to replace this member. You can directly declare:
- * @code
- * LLLazy<Inner> mInner;
- * @endcode
- * and change references to mInner accordingly.
- *
- * (Alternatively, you can add a base class of the form
- * <tt>LLLazyBase<Inner></tt>. This is discussed further in the LLLazyBase<T>
- * documentation.)
- *
- * LLLazy<T> binds a <tt>boost::scoped_ptr<T></tt> and a factory functor
- * returning T*. You can either bind that functor explicitly or let it default
- * to the expression <tt>new T()</tt>.
- *
- * As long as LLLazy<T> remains unreferenced, its T remains uninstantiated.
- * The first time you use get(), <tt>operator*()</tt> or <tt>operator->()</tt>
- * it will instantiate its T and thereafter behave like a pointer to it.
- *
- * Thus, any existing reference to <tt>mInner.member</tt> should be replaced
- * with <tt>mInner->member</tt>. Any simple reference to @c mInner should be
- * replaced by <tt>*mInner</tt>.
- *
- * (If the original declaration was a pointer initialized in Outer's
- * constructor, e.g. <tt>Inner* mInner</tt>, so much the better. In that case
- * you should be able to drop in <tt>LLLazy<Inner></tt> without much change.)
- *
- * The support for "Extract and Override Getter" lies in the fact that you can
- * replace the factory functor -- or provide an explicit T*. Presumably this
- * is most useful from a test subclass -- which suggests that your @c mInner
- * member should be @c protected.
- *
- * Note that <tt>boost::lambda::new_ptr<T>()</tt> makes a dandy factory
- * functor, for either the set() method or LLLazy<T>'s constructor. If your T
- * requires constructor arguments, use an expression more like
- * <tt>boost::lambda::bind(boost::lambda::new_ptr<T>(), arg1, arg2, ...)</tt>.
- *
- * Of course the point of replacing the functor is to substitute a class that,
- * though referenced as Inner*, is not an Inner; presumably this is a testing
- * subclass of Inner (e.g. TestInner). Thus your test subclass TestOuter for
- * the containing class Outer will contain something like this:
- * @code
- * class TestOuter: public Outer
- * {
- * public:
- * TestOuter()
- * {
- * // mInner must be 'protected' rather than 'private'
- * mInner.set(boost::lambda::new_ptr<TestInner>());
- * }
- * ...
- * };
- * @endcode
- */
-template <typename T>
-class LLLazy: public LLLazyCommon
-{
-public:
- /// Any nullary functor returning T* will work as a Factory
- typedef boost::function<T* ()> Factory;
-
- /// The default LLLazy constructor uses <tt>new T()</tt> as its Factory
- LLLazy():
- mFactory(boost::lambda::new_ptr<T>())
- {}
-
- /// Bind an explicit Factory functor
- LLLazy(const Factory& factory):
- mFactory(factory)
- {}
-
- /// Reference T, instantiating it if this is the first access
- const T& get() const
- {
- if (! mInstance)
- {
- // use the bound Factory functor
- mInstance.reset(mFactory());
- }
- return *mInstance;
- }
-
- /// non-const get()
- T& get()
- {
- return const_cast<T&>(const_cast<const LLLazy<T>*>(this)->get());
- }
-
- /// operator*() is equivalent to get()
- const T& operator*() const { return get(); }
- /// operator*() is equivalent to get()
- T& operator*() { return get(); }
-
- /**
- * operator->() must return (something resembling) T*. It's tempting to
- * return the underlying boost::scoped_ptr<T>, but that would require
- * breaking out the lazy-instantiation logic from get() into a common
- * private method. Assume the pointer used for operator->() access is very
- * short-lived.
- */
- const T* operator->() const { return &get(); }
- /// non-const operator->()
- T* operator->() { return &get(); }
-
- /// set(Factory). This will throw InstanceChange if mInstance has already
- /// been set.
- void set(const Factory& factory)
- {
- ensureNoInstance(mInstance);
- mFactory = factory;
- }
-
- /// set(T*). This will throw InstanceChange if mInstance has already been
- /// set.
- void set(T* instance)
- {
- ensureNoInstance(mInstance);
- mInstance.reset(instance);
- }
-
-private:
- Factory mFactory;
- // Consider an LLLazy<T> member of a class we're accessing by const
- // reference. We want to allow even const methods to touch the LLLazy<T>
- // member. Hence the actual pointer must be mutable because such access
- // might assign it.
- mutable boost::scoped_ptr<T> mInstance;
-};
-
-#if (! defined(__GNUC__)) || (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ > 3)
-// Not gcc at all, or a gcc more recent than gcc 3.3
-#define GCC33 0
-#else
-#define GCC33 1
-#endif
-
-/**
- * LLLazyBase<T> wraps LLLazy<T>, giving you an alternative way to replace
- * <tt>Inner mInner;</tt>. Instead of coding <tt>LLLazy<Inner> mInner</tt>,
- * you can add LLLazyBase<Inner> to your Outer class's bases, e.g.:
- * @code
- * class Outer: public LLLazyBase<Inner>
- * {
- * ...
- * };
- * @endcode
- *
- * This gives you @c public get() and @c protected set() methods without
- * having to make your LLLazy<Inner> member @c protected. The tradeoff is that
- * you must access the wrapped LLLazy<Inner> using get() and set() rather than
- * with <tt>operator*()</tt> or <tt>operator->()</tt>.
- *
- * This mechanism can be used for more than one member, but only if they're of
- * different types. That is, you can replace:
- * @code
- * DifficultClass mDifficult;
- * AwkwardType mAwkward;
- * @endcode
- * with:
- * @code
- * class Outer: public LLLazyBase<DifficultClass>, public LLLazyBase<AwkwardType>
- * {
- * ...
- * };
- * @endcode
- * but for a situation like this:
- * @code
- * DifficultClass mMainDifficult, mAuxDifficult;
- * @endcode
- * you should directly embed LLLazy<DifficultClass> (q.v.).
- *
- * For multiple LLLazyBase bases, e.g. the <tt>LLLazyBase<DifficultClass>,
- * LLLazyBase<AwkwardType></tt> example above, access the relevant get()/set()
- * as (e.g.) <tt>LLLazyBase<DifficultClass>::get()</tt>. (This is why you
- * can't have multiple LLLazyBase<T> of the same T.) For a bit of syntactic
- * sugar, please see getLazy()/setLazy().
- */
-template <typename T>
-class LLLazyBase
-{
-public:
- /// invoke default LLLazy constructor
- LLLazyBase() {}
- /// make wrapped LLLazy bind an explicit Factory
- LLLazyBase(const typename LLLazy<T>::Factory& factory):
- mInstance(factory)
- {}
-
- /// access to LLLazy::get()
- T& get() { return *mInstance; }
- /// access to LLLazy::get()
- const T& get() const { return *mInstance; }
-
-protected:
- // see getLazy()/setLazy()
- #if (! GCC33)
- template <typename T2, class MYCLASS> friend T2& getLazy(MYCLASS* this_);
- template <typename T2, class MYCLASS> friend const T2& getLazy(const MYCLASS* this_);
- #else // gcc 3.3
- template <typename T2, class MYCLASS> friend T2& getLazy(const MYCLASS* this_);
- #endif // gcc 3.3
- template <typename T2, class MYCLASS> friend void setLazy(MYCLASS* this_, T2* instance);
- template <typename T2, class MYCLASS>
- friend void setLazy(MYCLASS* this_, const typename LLLazy<T2>::Factory& factory);
-
- /// access to LLLazy::set(Factory)
- void set(const typename LLLazy<T>::Factory& factory)
- {
- mInstance.set(factory);
- }
-
- /// access to LLLazy::set(T*)
- void set(T* instance)
- {
- mInstance.set(instance);
- }
-
-private:
- LLLazy<T> mInstance;
-};
-
-/**
- * @name getLazy()/setLazy()
- * Suppose you have something like the following:
- * @code
- * class Outer: public LLLazyBase<DifficultClass>, public LLLazyBase<AwkwardType>
- * {
- * ...
- * };
- * @endcode
- *
- * Your methods can reference the @c DifficultClass instance using
- * <tt>LLLazyBase<DifficultClass>::get()</tt>, which is admittedly a bit ugly.
- * Alternatively, you can write <tt>getLazy<DifficultClass>(this)</tt>, which
- * is somewhat more straightforward to read.
- *
- * Similarly,
- * @code
- * LLLazyBase<DifficultClass>::set(new TestDifficultClass());
- * @endcode
- * could instead be written:
- * @code
- * setLazy<DifficultClass>(this, new TestDifficultClass());
- * @endcode
- *
- * @note
- * I wanted to provide getLazy() and setLazy() without explicitly passing @c
- * this. That would imply making them methods on a base class rather than free
- * functions. But if <tt>LLLazyBase<T></tt> derives normally from (say) @c
- * LLLazyGrandBase providing those methods, then unqualified getLazy() would
- * be ambiguous: you'd have to write <tt>LLLazyBase<T>::getLazy<T>()</tt>,
- * which is even uglier than <tt>LLLazyBase<T>::get()</tt>, and therefore
- * pointless. You can make the compiler not care which @c LLLazyGrandBase
- * instance you're talking about by making @c LLLazyGrandBase a @c virtual
- * base class of @c LLLazyBase. But in that case,
- * <tt>LLLazyGrandBase::getLazy<T>()</tt> can't access
- * <tt>LLLazyBase<T>::get()</tt>!
- *
- * We want <tt>getLazy<T>()</tt> to access <tt>LLLazyBase<T>::get()</tt> as if
- * in the lexical context of some subclass method. Ironically, free functions
- * let us do that better than methods on a @c virtual base class -- but that
- * implies passing @c this explicitly. So be it.
- */
-//@{
-#if (! GCC33)
-template <typename T, class MYCLASS>
-T& getLazy(MYCLASS* this_) { return this_->LLLazyBase<T>::get(); }
-template <typename T, class MYCLASS>
-const T& getLazy(const MYCLASS* this_) { return this_->LLLazyBase<T>::get(); }
-#else // gcc 3.3
-// For const-correctness, we really should have two getLazy() variants: one
-// accepting const MYCLASS* and returning const T&, the other accepting
-// non-const MYCLASS* and returning non-const T&. This works fine on the Mac
-// (gcc 4.0.1) and Windows (MSVC 8.0), but fails on our Linux 32-bit Debian
-// Sarge stations (gcc 3.3.5). Since I really don't know how to beat that aging
-// compiler over the head to make it do the right thing, I'm going to have to
-// move forward with the wrong thing: a single getLazy() function that accepts
-// const MYCLASS* and returns non-const T&.
-template <typename T, class MYCLASS>
-T& getLazy(const MYCLASS* this_) { return const_cast<MYCLASS*>(this_)->LLLazyBase<T>::get(); }
-#endif // gcc 3.3
-template <typename T, class MYCLASS>
-void setLazy(MYCLASS* this_, T* instance) { this_->LLLazyBase<T>::set(instance); }
-template <typename T, class MYCLASS>
-void setLazy(MYCLASS* this_, const typename LLLazy<T>::Factory& factory)
-{
- this_->LLLazyBase<T>::set(factory);
-}
-//@}
-
-#endif /* ! defined(LL_LLLAZY_H) */
diff --git a/indra/llcommon/llleap.cpp b/indra/llcommon/llleap.cpp
index 0a57ef1c48..84d2a12f65 100755
--- a/indra/llcommon/llleap.cpp
+++ b/indra/llcommon/llleap.cpp
@@ -394,7 +394,7 @@ public:
LLProcess::WritePipe& childin(mChild->getWritePipe(LLProcess::STDIN));
LLEventPump& mainloop(LLEventPumps::instance().obtain("mainloop"));
LLSD nop;
- F64 until(LLTimer::getElapsedSeconds() + 2);
+ F64 until = (LLTimer::getElapsedSeconds() + 2).value();
while (childin.size() && LLTimer::getElapsedSeconds() < until)
{
mainloop.post(nop);
diff --git a/indra/llcommon/lllinkedqueue.h b/indra/llcommon/lllinkedqueue.h
deleted file mode 100755
index 8336608809..0000000000
--- a/indra/llcommon/lllinkedqueue.h
+++ /dev/null
@@ -1,309 +0,0 @@
-/**
- * @file lllinkedqueue.h
- * @brief Declaration of linked queue classes.
- *
- * $LicenseInfo:firstyear=2003&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLLINKEDQUEUE_H
-#define LL_LLLINKEDQUEUE_H
-
-#include "llerror.h"
-
-// node that actually contains the data
-template <class DATA_TYPE> class LLLinkedQueueNode
-{
-public:
- DATA_TYPE mData;
- LLLinkedQueueNode *mNextp;
- LLLinkedQueueNode *mPrevp;
-
-
-public:
- LLLinkedQueueNode();
- LLLinkedQueueNode(const DATA_TYPE data);
-
- // destructor does not, by default, destroy associated data
- // however, the mDatap must be NULL to ensure that we aren't causing memory leaks
- ~LLLinkedQueueNode();
-};
-
-
-
-template <class DATA_TYPE> class LLLinkedQueue
-{
-
-public:
- LLLinkedQueue();
-
- // destructor destroys list and nodes, but not data in nodes
- ~LLLinkedQueue();
-
- // Puts at end of FIFO
- void push(const DATA_TYPE data);
-
- // Takes off front of FIFO
- BOOL pop(DATA_TYPE &data);
- BOOL peek(DATA_TYPE &data);
-
- void reset();
-
- S32 getLength() const;
-
- BOOL isEmpty() const;
-
- BOOL remove(const DATA_TYPE data);
-
- BOOL checkData(const DATA_TYPE data) const;
-
-private:
- // add node to end of list
- // set mCurrentp to mQueuep
- void addNodeAtEnd(LLLinkedQueueNode<DATA_TYPE> *nodep);
-
-private:
- LLLinkedQueueNode<DATA_TYPE> mHead; // head node
- LLLinkedQueueNode<DATA_TYPE> mTail; // tail node
- S32 mLength;
-};
-
-
-//
-// Nodes
-//
-
-template <class DATA_TYPE>
-LLLinkedQueueNode<DATA_TYPE>::LLLinkedQueueNode() :
- mData(), mNextp(NULL), mPrevp(NULL)
-{ }
-
-template <class DATA_TYPE>
-LLLinkedQueueNode<DATA_TYPE>::LLLinkedQueueNode(const DATA_TYPE data) :
- mData(data), mNextp(NULL), mPrevp(NULL)
-{ }
-
-template <class DATA_TYPE>
-LLLinkedQueueNode<DATA_TYPE>::~LLLinkedQueueNode()
-{ }
-
-
-//
-// Queue itself
-//
-
-template <class DATA_TYPE>
-LLLinkedQueue<DATA_TYPE>::LLLinkedQueue()
-: mHead(),
- mTail(),
- mLength(0)
-{ }
-
-
-// destructor destroys list and nodes, but not data in nodes
-template <class DATA_TYPE>
-LLLinkedQueue<DATA_TYPE>::~LLLinkedQueue()
-{
- reset();
-}
-
-
-// put data into a node and stick it at the end of the list
-template <class DATA_TYPE>
-void LLLinkedQueue<DATA_TYPE>::push(const DATA_TYPE data)
-{
- // make the new node
- LLLinkedQueueNode<DATA_TYPE> *nodep = new LLLinkedQueueNode<DATA_TYPE>(data);
-
- addNodeAtEnd(nodep);
-}
-
-
-// search the list starting at mHead.mNextp and remove the link with mDatap == data
-// set mCurrentp to mQueuep, or NULL if mQueuep points to node with mDatap == data
-// return TRUE if found, FALSE if not found
-template <class DATA_TYPE>
-BOOL LLLinkedQueue<DATA_TYPE>::remove(const DATA_TYPE data)
-{
- BOOL b_found = FALSE;
-
- LLLinkedQueueNode<DATA_TYPE> *currentp = mHead.mNextp;
-
- while (currentp)
- {
- if (currentp->mData == data)
- {
- b_found = TRUE;
-
- // if there is a next one, fix it
- if (currentp->mNextp)
- {
- currentp->mNextp->mPrevp = currentp->mPrevp;
- }
- else // we are at end of list
- {
- mTail.mPrevp = currentp->mPrevp;
- }
-
- // if there is a previous one, fix it
- if (currentp->mPrevp)
- {
- currentp->mPrevp->mNextp = currentp->mNextp;
- }
- else // we are at beginning of list
- {
- mHead.mNextp = currentp->mNextp;
- }
-
- // remove the node
- delete currentp;
- mLength--;
- break;
- }
- currentp = currentp->mNextp;
- }
-
- return b_found;
-}
-
-
-// remove all nodes from the list but do not delete associated data
-template <class DATA_TYPE>
-void LLLinkedQueue<DATA_TYPE>::reset()
-{
- LLLinkedQueueNode<DATA_TYPE> *currentp;
- LLLinkedQueueNode<DATA_TYPE> *nextp;
- currentp = mHead.mNextp;
-
- while (currentp)
- {
- nextp = currentp->mNextp;
- delete currentp;
- currentp = nextp;
- }
-
- // reset mHead and mCurrentp
- mHead.mNextp = NULL;
- mTail.mPrevp = NULL;
- mLength = 0;
-}
-
-template <class DATA_TYPE>
-S32 LLLinkedQueue<DATA_TYPE>::getLength() const
-{
- return mLength;
-}
-
-template <class DATA_TYPE>
-BOOL LLLinkedQueue<DATA_TYPE>::isEmpty() const
-{
- return mLength <= 0;
-}
-
-// check to see if data is in list
-// set mCurrentp and mQueuep to the target of search if found, otherwise set mCurrentp to mQueuep
-// return TRUE if found, FALSE if not found
-template <class DATA_TYPE>
-BOOL LLLinkedQueue<DATA_TYPE>::checkData(const DATA_TYPE data) const
-{
- LLLinkedQueueNode<DATA_TYPE> *currentp = mHead.mNextp;
-
- while (currentp)
- {
- if (currentp->mData == data)
- {
- return TRUE;
- }
- currentp = currentp->mNextp;
- }
- return FALSE;
-}
-
-template <class DATA_TYPE>
-BOOL LLLinkedQueue<DATA_TYPE>::pop(DATA_TYPE &data)
-{
- LLLinkedQueueNode<DATA_TYPE> *currentp;
-
- currentp = mHead.mNextp;
- if (!currentp)
- {
- return FALSE;
- }
-
- mHead.mNextp = currentp->mNextp;
- if (currentp->mNextp)
- {
- currentp->mNextp->mPrevp = currentp->mPrevp;
- }
- else
- {
- mTail.mPrevp = currentp->mPrevp;
- }
-
- data = currentp->mData;
- delete currentp;
- mLength--;
- return TRUE;
-}
-
-template <class DATA_TYPE>
-BOOL LLLinkedQueue<DATA_TYPE>::peek(DATA_TYPE &data)
-{
- LLLinkedQueueNode<DATA_TYPE> *currentp;
-
- currentp = mHead.mNextp;
- if (!currentp)
- {
- return FALSE;
- }
- data = currentp->mData;
- return TRUE;
-}
-
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// private members
-//////////////////////////////////////////////////////////////////////////////////////////
-
-
-// add node to end of list
-// set mCurrentp to mQueuep
-template <class DATA_TYPE>
-void LLLinkedQueue<DATA_TYPE>::addNodeAtEnd(LLLinkedQueueNode<DATA_TYPE> *nodep)
-{
- // add the node to the end of the list
- nodep->mNextp = NULL;
- nodep->mPrevp = mTail.mPrevp;
- mTail.mPrevp = nodep;
-
- // if there's something in the list, fix its back pointer
- if (nodep->mPrevp)
- {
- nodep->mPrevp->mNextp = nodep;
- }
- else // otherwise fix the head node
- {
- mHead.mNextp = nodep;
- }
- mLength++;
-}
-
-#endif
diff --git a/indra/llcommon/llliveappconfig.cpp b/indra/llcommon/llliveappconfig.cpp
index 3a3dfa9f28..7c87c5a1a0 100755
--- a/indra/llcommon/llliveappconfig.cpp
+++ b/indra/llcommon/llliveappconfig.cpp
@@ -47,8 +47,8 @@ LLLiveAppConfig::~LLLiveAppConfig()
// virtual
bool LLLiveAppConfig::loadFile()
{
- llinfos << "LLLiveAppConfig::loadFile(): reading from "
- << filename() << llendl;
+ LL_INFOS() << "LLLiveAppConfig::loadFile(): reading from "
+ << filename() << LL_ENDL;
llifstream file(filename());
LLSD config;
if (file.is_open())
@@ -56,15 +56,15 @@ bool LLLiveAppConfig::loadFile()
LLSDSerialize::fromXML(config, file);
if(!config.isMap())
{
- llwarns << "Live app config not an map in " << filename()
- << " Ignoring the data." << llendl;
+ LL_WARNS() << "Live app config not an map in " << filename()
+ << " Ignoring the data." << LL_ENDL;
return false;
}
file.close();
}
else
{
- llinfos << "Live file " << filename() << " does not exit." << llendl;
+ LL_INFOS() << "Live file " << filename() << " does not exit." << LL_ENDL;
}
// *NOTE: we do not handle the else case here because we would not
// have attempted to load the file unless LLLiveFile had
diff --git a/indra/llcommon/lllocalidhashmap.h b/indra/llcommon/lllocalidhashmap.h
deleted file mode 100755
index 8f4f91a560..0000000000
--- a/indra/llcommon/lllocalidhashmap.h
+++ /dev/null
@@ -1,895 +0,0 @@
-/**
- * @file lllocalidhashmap.h
- * @brief Map specialized for dealing with local ids
- *
- * $LicenseInfo:firstyear=2003&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLLOCALIDHASHMAP_H
-#define LL_LLLOCALIDHASHMAP_H
-
-#include "stdtypes.h"
-#include "llerror.h"
-
-const S32 MAX_ITERS = 4;
-// LocalID hash map
-
-//
-// LLLocalIDHashNode
-//
-
-template <class DATA, int SIZE>
-class LLLocalIDHashNode
-{
-public:
- LLLocalIDHashNode();
-
-public:
- S32 mCount;
- U32 mKey[SIZE];
- DATA mData[SIZE];
- LLLocalIDHashNode<DATA, SIZE> *mNextNodep;
-};
-
-
-//
-// LLLocalIDHashNode implementation
-//
-template <class DATA, int SIZE>
-LLLocalIDHashNode<DATA, SIZE>::LLLocalIDHashNode()
-{
- mCount = 0;
- mNextNodep = NULL;
-}
-
-//
-// LLLocalIDHashMapIter
-//
-template <class DATA_TYPE, int SIZE>
-class LLLocalIDHashMap;
-
-template <class DATA_TYPE, int SIZE>
-class LLLocalIDHashMapIter
-{
-public:
- LLLocalIDHashMapIter(LLLocalIDHashMap<DATA_TYPE, SIZE> *hash_mapp);
- ~LLLocalIDHashMapIter();
-
- void setMap(LLLocalIDHashMap<DATA_TYPE, SIZE> *hash_mapp);
- inline void first();
- inline void next();
- inline DATA_TYPE& current(); // *NOTE: Deprecate? Phoenix 2005-04-15
- inline BOOL done() const;
- inline S32 currentBin() const;
- inline void setBin(S32 bin);
-
- DATA_TYPE& operator*() const
- {
- return mCurHashNodep->mData[mCurHashNodeKey];
- }
- DATA_TYPE* operator->() const
- {
- return &(operator*());
- }
-
- LLLocalIDHashMap<DATA_TYPE, SIZE> *mHashMapp;
- LLLocalIDHashNode<DATA_TYPE, SIZE> *mCurHashNodep;
-
- S32 mCurHashMapNodeNum;
- S32 mCurHashNodeKey;
-
- DATA_TYPE mNull;
-
- S32 mIterID;
-};
-
-
-
-template <class DATA_TYPE, int SIZE>
-class LLLocalIDHashMap
-{
-public:
- friend class LLLocalIDHashMapIter<DATA_TYPE, SIZE>;
-
- LLLocalIDHashMap(); // DO NOT use this unless you explicitly setNull, or the data type constructs a "null"
- // object by default
- // basic constructor including sorter
- LLLocalIDHashMap(const DATA_TYPE &null_data);
- // Hack, this should really be a const ref, but I'm not doing it that way because the sim
- // usually uses pointers.
- ~LLLocalIDHashMap();
-
- inline DATA_TYPE &get(const U32 local_id);
- inline BOOL check(const U32 local_id) const;
- inline DATA_TYPE &set(const U32 local_id, const DATA_TYPE data);
- inline BOOL remove(const U32 local_id);
- void removeAll();
-
- void setNull(const DATA_TYPE data) { mNull = data; }
-
- inline S32 getLength() const; // Warning, NOT O(1!)
-
- void dumpIter();
- void dumpBin(U32 bin);
-
-protected:
- // Only used by the iterator.
- void addIter(LLLocalIDHashMapIter<DATA_TYPE, SIZE> *iter);
- void removeIter(LLLocalIDHashMapIter<DATA_TYPE, SIZE> *iter);
-
- // Remove the item and shift all items afterward down the list,
- // fixing up iterators as we go.
- BOOL removeWithShift(const U32 local_id);
-
-protected:
- LLLocalIDHashNode<DATA_TYPE, SIZE> mNodes[256];
-
- S32 mIterCount;
- LLLocalIDHashMapIter<DATA_TYPE, SIZE> *mIters[MAX_ITERS];
-
- DATA_TYPE mNull;
-};
-
-
-//
-// LLLocalIDHashMap implementation
-//
-
-template <class DATA_TYPE, int SIZE>
-LLLocalIDHashMap<DATA_TYPE, SIZE>::LLLocalIDHashMap()
-: mIterCount(0),
- mNull()
-{
- S32 i;
- for (i = 0; i < MAX_ITERS; i++)
- {
- mIters[i] = NULL;
- }
-}
-
-template <class DATA_TYPE, int SIZE>
-LLLocalIDHashMap<DATA_TYPE, SIZE>::LLLocalIDHashMap(const DATA_TYPE &null_data)
-: mIterCount(0),
- mNull(null_data)
-{
- S32 i;
- for (i = 0; i < MAX_ITERS; i++)
- {
- mIters[i] = NULL;
- }
-}
-
-template <class DATA_TYPE, int SIZE>
-LLLocalIDHashMap<DATA_TYPE, SIZE>::~LLLocalIDHashMap()
-{
- S32 i;
- for (i = 0; i < MAX_ITERS; i++)
- {
- if (mIters[i])
- {
- mIters[i]->mHashMapp = NULL;
- mIterCount--;
- }
- }
- removeAll();
-}
-
-template <class DATA_TYPE, int SIZE>
-void LLLocalIDHashMap<DATA_TYPE, SIZE>::removeAll()
-{
- S32 bin;
- for (bin = 0; bin < 256; bin++)
- {
- LLLocalIDHashNode<DATA_TYPE, SIZE>* nodep = &mNodes[bin];
-
- BOOL first = TRUE;
- do // First node guaranteed to be there
- {
- S32 i;
- const S32 count = nodep->mCount;
-
- // Iterate through all members of this node
- for (i = 0; i < count; i++)
- {
- nodep->mData[i] = mNull;
- }
-
- nodep->mCount = 0;
- // Done with all objects in this node, go to the next.
-
- LLLocalIDHashNode<DATA_TYPE, SIZE>* curp = nodep;
- nodep = nodep->mNextNodep;
-
- // Delete the node if it's not the first node
- if (first)
- {
- first = FALSE;
- curp->mNextNodep = NULL;
- }
- else
- {
- delete curp;
- }
- } while (nodep);
- }
-}
-
-template <class DATA_TYPE, int SIZE>
-void LLLocalIDHashMap<DATA_TYPE, SIZE>::dumpIter()
-{
- std::cout << "Hash map with " << mIterCount << " iterators" << std::endl;
-
- std::cout << "Hash Map Iterators:" << std::endl;
- S32 i;
- for (i = 0; i < MAX_ITERS; i++)
- {
- if (mIters[i])
- {
- llinfos << i << " " << mIters[i]->mCurHashNodep << " " << mIters[i]->mCurHashNodeKey << llendl;
- }
- else
- {
- llinfos << i << "null" << llendl;
- }
- }
-}
-
-template <class DATA_TYPE, int SIZE>
-void LLLocalIDHashMap<DATA_TYPE, SIZE>::dumpBin(U32 bin)
-{
- std::cout << "Dump bin " << bin << std::endl;
-
- LLLocalIDHashNode<DATA_TYPE, SIZE>* nodep = &mNodes[bin];
- S32 node = 0;
- do // First node guaranteed to be there.
- {
- std::cout << "Bin " << bin
- << " node " << node
- << " count " << nodep->mCount
- << " contains " << std::flush;
-
- S32 i;
- for (i = 0; i < nodep->mCount; i++)
- {
- std::cout << nodep->mData[i] << " " << std::flush;
- }
-
- std::cout << std::endl;
-
- nodep = nodep->mNextNodep;
- node++;
- } while (nodep);
-}
-
-template <class DATA_TYPE, int SIZE>
-inline S32 LLLocalIDHashMap<DATA_TYPE, SIZE>::getLength() const
-{
- S32 count = 0;
- S32 bin;
- for (bin = 0; bin < 256; bin++)
- {
- const LLLocalIDHashNode<DATA_TYPE, SIZE>* nodep = &mNodes[bin];
- while (nodep)
- {
- count += nodep->mCount;
- nodep = nodep->mNextNodep;
- }
- }
- return count;
-}
-
-template <class DATA_TYPE, int SIZE>
-inline DATA_TYPE &LLLocalIDHashMap<DATA_TYPE, SIZE>::get(const U32 local_id)
-{
- LLLocalIDHashNode<DATA_TYPE, SIZE>* nodep = &mNodes[local_id & 0xff];
-
- do // First node guaranteed to be there
- {
- S32 i;
- const S32 count = nodep->mCount;
-
- // Iterate through all members of this node
- for (i = 0; i < count; i++)
- {
- if (nodep->mKey[i] == local_id)
- {
- // We found it.
- return nodep->mData[i];
- }
- }
-
- // Done with all objects in this node, go to the next.
- nodep = nodep->mNextNodep;
- } while (nodep);
-
- return mNull;
-}
-
-
-template <class DATA_TYPE, int SIZE>
-inline BOOL LLLocalIDHashMap<DATA_TYPE, SIZE>::check(const U32 local_id) const
-{
- const LLLocalIDHashNode<DATA_TYPE, SIZE>* nodep = &mNodes[local_id & 0xff];
-
- do // First node guaranteed to be there
- {
- S32 i;
- const S32 count = nodep->mCount;
-
- // Iterate through all members of this node
- for (i = 0; i < count; i++)
- {
- if (nodep->mKey[i] == local_id)
- {
- // We found it.
- return TRUE;
- }
- }
-
- // Done with all objects in this node, go to the next.
- nodep = nodep->mNextNodep;
- } while (nodep);
-
- // Didn't find anything
- return FALSE;
-}
-
-
-template <class DATA_TYPE, int SIZE>
-inline DATA_TYPE &LLLocalIDHashMap<DATA_TYPE, SIZE>::set(const U32 local_id, const DATA_TYPE data)
-{
- // Set is just like a normal find, except that if we find a match
- // we replace it with the input value.
- // If we don't find a match, we append to the end of the list.
-
- LLLocalIDHashNode<DATA_TYPE, SIZE>* nodep = &mNodes[local_id & 0xff];
-
- while (1)
- {
- const S32 count = nodep->mCount;
-
- S32 i;
- for (i = 0; i < count; i++)
- {
- if (nodep->mKey[i] == local_id)
- {
- // We found a match for this key, replace the data with
- // the incoming data.
- nodep->mData[i] = data;
- return nodep->mData[i];
- }
- }
- if (!nodep->mNextNodep)
- {
- // We've iterated through all of the keys without finding a match
- if (i < SIZE)
- {
- // There's still some space on this node, append
- // the key and data to it.
- nodep->mKey[i] = local_id;
- nodep->mData[i] = data;
- nodep->mCount++;
-
- return nodep->mData[i];
- }
- else
- {
- // This node is full, append a new node to the end.
- nodep->mNextNodep = new LLLocalIDHashNode<DATA_TYPE, SIZE>;
- nodep->mNextNodep->mKey[0] = local_id;
- nodep->mNextNodep->mData[0] = data;
- nodep->mNextNodep->mCount = 1;
-
- return nodep->mNextNodep->mData[0];
- }
- }
-
- // No match on this node, go to the next
- nodep = nodep->mNextNodep;
- }
-}
-
-
-template <class DATA_TYPE, int SIZE>
-inline BOOL LLLocalIDHashMap<DATA_TYPE, SIZE>::remove(const U32 local_id)
-{
- // Remove is the trickiest operation.
- // What we want to do is swap the last element of the last
- // node if we find the one that we want to remove, but we have
- // to deal with deleting the node from the tail if it's empty, but
- // NOT if it's the only node left.
-
- const S32 node_index = local_id & 0xff;
-
- LLLocalIDHashNode<DATA_TYPE, SIZE>* nodep = &mNodes[node_index];
-
- // A modification of the standard search algorithm.
- do // First node guaranteed to be there
- {
- const S32 count = nodep->mCount;
-
- S32 i;
- for (i = 0; i < count; i++)
- {
- if (nodep->mKey[i] == local_id)
- {
- // If we're removing the item currently pointed to by one
- // or more iterators, we can just swap in the last item
- // and back the iterator(s) up by one.
- // Otherwise, we need to do a slow and safe shift of all
- // items back to one position to fill the hole and fix up
- // all iterators we find.
- BOOL need_shift = FALSE;
- S32 cur_iter;
- if (mIterCount)
- {
- for (cur_iter = 0; cur_iter < MAX_ITERS; cur_iter++)
- {
- if (mIters[cur_iter])
- {
- // We only care if the hash map node is on the one
- // that we're working on. If it's before, we've already
- // traversed it, if it's after, changing the order doesn't
- // matter.
- if (mIters[cur_iter]->mCurHashMapNodeNum == node_index)
- {
- if ((mIters[cur_iter]->mCurHashNodep == nodep)
- && (mIters[cur_iter]->mCurHashNodeKey == i))
- {
- // it's on the one we're deleting, we'll
- // fix the iterator quickly below.
- }
- else
- {
- // We're trying to remove an item on this
- // iterator's chain that this
- // iterator doesn't point to! We need to do
- // the slow remove-and-shift-down case.
- need_shift = TRUE;
- }
- }
- }
- }
- }
-
- // Removing an item that isn't pointed to by all iterators
- if (need_shift)
- {
- return removeWithShift(local_id);
- }
-
- // Fix the iterators that point to this node/i pair, the
- // one we're deleting
- for (cur_iter = 0; cur_iter < MAX_ITERS; cur_iter++)
- {
- if (mIters[cur_iter])
- {
- // We only care if the hash map node is on the one
- // that we're working on. If it's before, we've already
- // traversed it, if it's after, changing the order doesn't
- // matter.
- if (mIters[cur_iter]->mCurHashMapNodeNum == node_index)
- {
- if ((mIters[cur_iter]->mCurHashNodep == nodep)
- && (mIters[cur_iter]->mCurHashNodeKey == i))
- {
- // We can handle the case where we're deleting
- // the element we're on trivially (sort of).
- if (nodep->mCount > 1)
- {
- // If we're not going to delete this node,
- // it's OK.
- mIters[cur_iter]->mCurHashNodeKey--;
- }
- else
- {
- // We're going to delete this node, because this
- // is the last element on it.
-
- // Find the next node, and then back up one.
- mIters[cur_iter]->next();
- mIters[cur_iter]->mCurHashNodeKey--;
- }
- }
- }
- }
- }
-
- // We found the node that we want to remove.
- // Find the last (and next-to-last) node, and the index of the last
- // element. We could conceviably start from the node we're on,
- // but that makes it more complicated, this is easier.
-
- LLLocalIDHashNode<DATA_TYPE, SIZE> *prevp = &mNodes[node_index];
- LLLocalIDHashNode<DATA_TYPE, SIZE> *lastp = prevp;
-
- // Find the last and next-to-last
- while (lastp->mNextNodep)
- {
- prevp = lastp;
- lastp = lastp->mNextNodep;
- }
-
- // First, swap in the last to the current location.
- nodep->mKey[i] = lastp->mKey[lastp->mCount - 1];
- nodep->mData[i] = lastp->mData[lastp->mCount - 1];
-
- // Now, we delete the entry
- lastp->mCount--;
- lastp->mData[lastp->mCount] = mNull;
-
- if (!lastp->mCount)
- {
- // We deleted the last element!
- if (lastp != &mNodes[local_id & 0xff])
- {
- // Only blitz the node if it's not the head
- // Set the previous node to point to NULL, then
- // blitz the empty last node
- prevp->mNextNodep = NULL;
- delete lastp;
- }
- }
-
- return TRUE;
- }
- }
-
- // Iterate to the next node, we've scanned all the entries in this one.
- nodep = nodep->mNextNodep;
- } while (nodep);
-
- return FALSE;
-}
-
-template <class DATA_TYPE, int SIZE>
-BOOL LLLocalIDHashMap<DATA_TYPE, SIZE>::removeWithShift(const U32 local_id)
-{
- const S32 node_index = local_id & 0xFF;
- LLLocalIDHashNode<DATA_TYPE, SIZE>* nodep = &mNodes[node_index];
- LLLocalIDHashNode<DATA_TYPE, SIZE>* prevp = NULL;
- BOOL found = FALSE;
-
- do // First node guaranteed to be there
- {
- const S32 count = nodep->mCount;
- S32 i;
- for (i = 0; i < count; i++)
- {
- if (nodep->mKey[i] == local_id)
- {
- // Found the item. Start shifting items from later
- // in the list over this item.
- found = TRUE;
- }
-
- if (found)
- {
- // If there is an iterator on this node, we need to
- // back it up.
- S32 cur_iter;
- for (cur_iter = 0; cur_iter <MAX_ITERS; cur_iter++)
- {
- LLLocalIDHashMapIter<DATA_TYPE, SIZE>* iter;
- iter = mIters[cur_iter];
- // If an iterator is on this node,i pair, then back it up.
- if (iter
- && iter->mCurHashMapNodeNum == node_index
- && iter->mCurHashNodep == nodep
- && iter->mCurHashNodeKey == i)
- {
- if (i > 0)
- {
- // Don't need to move iterator nodep, since
- // we're in the same node.
- iter->mCurHashNodeKey--;
- }
- else if (prevp)
- {
- // need to go the previous node, last item
- iter->mCurHashNodep = prevp;
- iter->mCurHashNodeKey = prevp->mCount - 1;
- }
- else
- {
- // we're on the first item in the list, but
- // need to go back anyhow.
-
- // BUG: If this deletion empties the list,
- // iter->done() will be wrong until
- // iter->next() is called.
- iter->mCurHashNodeKey = -1;
- }
- }
- }
-
- // Copy data from the next position into this position.
- if (i < count-1)
- {
- // we're not on the last item in the node,
- // so we can copy within the node
- nodep->mKey[i] = nodep->mKey[i+1];
- nodep->mData[i] = nodep->mData[i+1];
- }
- else if (nodep->mNextNodep)
- {
- // we're on the last item in the node,
- // but there's a next node we can copy from
- nodep->mKey[i] = nodep->mNextNodep->mKey[0];
- nodep->mData[i] = nodep->mNextNodep->mData[0];
- }
- else
- {
- // We're on the last position in the list.
- // No one to copy from. Replace with nothing.
- nodep->mKey[i] = 0;
- nodep->mData[i] = mNull;
- }
- }
- }
-
- // Last node in chain, so delete the last node
- if (found
- && !nodep->mNextNodep)
- {
- // delete the last item off the last node
- nodep->mCount--;
-
- if (nodep->mCount == 0)
- {
- // We deleted the last element!
- if (nodep != &mNodes[node_index])
- {
- // Always have a prevp if we're not the head.
- llassert(prevp);
-
- // Only blitz the node if it's not the head
- // Set the previous node to point to NULL, then
- // blitz the empty last node
- prevp->mNextNodep = NULL;
- delete nodep;
- nodep = NULL;
- }
- }
-
- // Deleted last item in chain, so we're done.
- return found;
- }
-
- prevp = nodep;
- nodep = nodep->mNextNodep;
- } while (nodep);
-
- return found;
-}
-
-template <class DATA_TYPE, int SIZE>
-void LLLocalIDHashMap<DATA_TYPE, SIZE>::removeIter(LLLocalIDHashMapIter<DATA_TYPE, SIZE> *iter)
-{
- S32 i;
- for (i = 0; i < MAX_ITERS; i++)
- {
- if (mIters[i] == iter)
- {
- mIters[i] = NULL;
- mIterCount--;
- return;
- }
- }
- llerrs << "Iterator " << iter << " not found for removal in hash map!" << llendl;
-}
-
-template <class DATA_TYPE, int SIZE>
-void LLLocalIDHashMap<DATA_TYPE, SIZE>::addIter(LLLocalIDHashMapIter<DATA_TYPE, SIZE> *iter)
-{
- S32 i;
- for (i = 0; i < MAX_ITERS; i++)
- {
- if (mIters[i] == NULL)
- {
- mIters[i] = iter;
- mIterCount++;
- return;
- }
- }
- llerrs << "More than " << MAX_ITERS << " iterating over a map simultaneously!" << llendl;
-}
-
-
-
-//
-// LLLocalIDHashMapIter Implementation
-//
-template <class DATA_TYPE, int SIZE>
-LLLocalIDHashMapIter<DATA_TYPE, SIZE>::LLLocalIDHashMapIter(LLLocalIDHashMap<DATA_TYPE, SIZE> *hash_mapp)
-{
- mHashMapp = NULL;
- setMap(hash_mapp);
-}
-
-template <class DATA_TYPE, int SIZE>
-LLLocalIDHashMapIter<DATA_TYPE, SIZE>::~LLLocalIDHashMapIter()
-{
- if (mHashMapp)
- {
- mHashMapp->removeIter(this);
- }
-}
-
-template <class DATA_TYPE, int SIZE>
-void LLLocalIDHashMapIter<DATA_TYPE, SIZE>::setMap(LLLocalIDHashMap<DATA_TYPE, SIZE> *hash_mapp)
-{
- if (mHashMapp)
- {
- mHashMapp->removeIter(this);
- }
- mHashMapp = hash_mapp;
- if (mHashMapp)
- {
- mHashMapp->addIter(this);
- }
-
- mCurHashNodep = NULL;
- mCurHashMapNodeNum = -1;
- mCurHashNodeKey = 0;
-}
-
-template <class DATA_TYPE, int SIZE>
-inline void LLLocalIDHashMapIter<DATA_TYPE, SIZE>::first()
-{
- // Iterate through until we find the first non-empty node;
- S32 i;
- for (i = 0; i < 256; i++)
- {
- if (mHashMapp->mNodes[i].mCount)
- {
-
- mCurHashNodep = &mHashMapp->mNodes[i];
- mCurHashMapNodeNum = i;
- mCurHashNodeKey = 0;
- //return mCurHashNodep->mData[0];
- return;
- }
- }
-
- // Completely empty!
- mCurHashNodep = NULL;
- //return mNull;
- return;
-}
-
-template <class DATA_TYPE, int SIZE>
-inline BOOL LLLocalIDHashMapIter<DATA_TYPE, SIZE>::done() const
-{
- return mCurHashNodep ? FALSE : TRUE;
-}
-
-template <class DATA_TYPE, int SIZE>
-inline S32 LLLocalIDHashMapIter<DATA_TYPE, SIZE>::currentBin() const
-{
- if ( (mCurHashMapNodeNum > 255)
- ||(mCurHashMapNodeNum < 0))
- {
- return 0;
- }
- else
- {
- return mCurHashMapNodeNum;
- }
-}
-
-template <class DATA_TYPE, int SIZE>
-inline void LLLocalIDHashMapIter<DATA_TYPE, SIZE>::setBin(S32 bin)
-{
- // Iterate through until we find the first non-empty node;
- S32 i;
- bin = llclamp(bin, 0, 255);
- for (i = bin; i < 256; i++)
- {
- if (mHashMapp->mNodes[i].mCount)
- {
-
- mCurHashNodep = &mHashMapp->mNodes[i];
- mCurHashMapNodeNum = i;
- mCurHashNodeKey = 0;
- return;
- }
- }
- for (i = 0; i < bin; i++)
- {
- if (mHashMapp->mNodes[i].mCount)
- {
-
- mCurHashNodep = &mHashMapp->mNodes[i];
- mCurHashMapNodeNum = i;
- mCurHashNodeKey = 0;
- return;
- }
- }
- // Completely empty!
- mCurHashNodep = NULL;
-}
-
-template <class DATA_TYPE, int SIZE>
-inline DATA_TYPE &LLLocalIDHashMapIter<DATA_TYPE, SIZE>::current()
-{
- if (!mCurHashNodep)
- {
- return mNull;
- }
- return mCurHashNodep->mData[mCurHashNodeKey];
-}
-
-template <class DATA_TYPE, int SIZE>
-inline void LLLocalIDHashMapIter<DATA_TYPE, SIZE>::next()
-{
- // No current entry, this iterator is done
- if (!mCurHashNodep)
- {
- //return mNull;
- return;
- }
-
- // Go to the next element
- mCurHashNodeKey++;
- if (mCurHashNodeKey < mCurHashNodep->mCount)
- {
- // We're not done with this node, return the current element
- //return mCurHashNodep->mData[mCurHashNodeKey];
- return;
- }
-
- // Done with this node, move to the next
- mCurHashNodep = mCurHashNodep->mNextNodep;
- if (mCurHashNodep)
- {
- // Return the first element
- mCurHashNodeKey = 0;
- //return mCurHashNodep->mData[0];
- return;
- }
-
- // Find the next non-empty node (keyed on the first byte)
- mCurHashMapNodeNum++;
-
- S32 i;
- for (i = mCurHashMapNodeNum; i < 256; i++)
- {
- if (mHashMapp->mNodes[i].mCount)
- {
- // We found one that wasn't empty
- mCurHashNodep = &mHashMapp->mNodes[i];
- mCurHashMapNodeNum = i;
- mCurHashNodeKey = 0;
- //return mCurHashNodep->mData[0];
- return;
- }
- }
-
- // OK, we're done, nothing else to iterate
- mCurHashNodep = NULL;
- mHashMapp->mIterCount--; // Decrement since we're safe to do removes now
- //return mNull;
- return;
-}
-
-#endif // LL_LLLOCALIDHASHMAP_H
diff --git a/indra/llcommon/lllog.cpp b/indra/llcommon/lllog.cpp
deleted file mode 100755
index fc4058b5c9..0000000000
--- a/indra/llcommon/lllog.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- * @file lllog.cpp
- * @author Don
- * @date 2007-11-27
- * @brief Class to log messages to syslog for streambase to process.
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "linden_common.h"
-#include "lllog.h"
-
-#include "llapp.h"
-#include "llsd.h"
-#include "llsdserialize.h"
-
-
-class LLLogImpl
-{
-public:
- LLLogImpl(LLApp* app) : mApp(app) {}
- ~LLLogImpl() {}
-
- void log(const std::string &message, LLSD& info);
- bool useLegacyLogMessage(const std::string &message);
-
-private:
- LLApp* mApp;
-};
-
-
-//@brief Function to log a message to syslog for streambase to collect.
-void LLLogImpl::log(const std::string &message, LLSD& info)
-{
- static S32 sequence = 0;
- LLSD log_config = mApp->getOption("log-messages");
- if (log_config.has(message))
- {
- LLSD message_config = log_config[message];
- if (message_config.has("use-syslog"))
- {
- if (! message_config["use-syslog"].asBoolean())
- {
- return;
- }
- }
- }
- llinfos << "LLLOGMESSAGE (" << (sequence++) << ") " << message
- << " " << LLSDNotationStreamer(info) << llendl;
-}
-
-//@brief Function to check if specified legacy log message should be sent.
-bool LLLogImpl::useLegacyLogMessage(const std::string &message)
-{
- LLSD log_config = mApp->getOption("log-messages");
- if (log_config.has(message))
- {
- LLSD message_config = log_config[message];
- if (message_config.has("use-legacy"))
- {
- return message_config["use-legacy"].asBoolean();
- }
- }
- return true;
-}
-
-
-LLLog::LLLog(LLApp* app)
-{
- mImpl = new LLLogImpl(app);
-}
-
-LLLog::~LLLog()
-{
- delete mImpl;
- mImpl = NULL;
-}
-
-void LLLog::log(const std::string &message, LLSD& info)
-{
- if (mImpl) mImpl->log(message, info);
-}
-
-bool LLLog::useLegacyLogMessage(const std::string &message)
-{
- if (mImpl)
- {
- return mImpl->useLegacyLogMessage(message);
- }
- return true;
-}
-
diff --git a/indra/llcommon/llmap.h b/indra/llcommon/llmap.h
deleted file mode 100755
index 6294a15d3b..0000000000
--- a/indra/llcommon/llmap.h
+++ /dev/null
@@ -1,245 +0,0 @@
-/**
- * @file llmap.h
- * @brief LLMap class header file
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLMAP_H
-#define LL_LLMAP_H
-
-// llmap uses the fast stl library code in a manner consistant with LLSkipMap, et. al.
-
-template<class INDEX_TYPE, class MAPPED_TYPE> class LLMap
-{
-private:
- typedef typename std::map<INDEX_TYPE, MAPPED_TYPE> stl_map_t;
- typedef typename stl_map_t::iterator stl_iter_t;
- typedef typename stl_map_t::value_type stl_value_t;
-
- stl_map_t mStlMap;
- stl_iter_t mCurIter; // *iterator = pair<const INDEX_TYPE, MAPPED_TYPE>
- MAPPED_TYPE dummy_data;
- INDEX_TYPE dummy_index;
-
-public:
- LLMap() : mStlMap()
- {
- memset((void*)(&dummy_data), 0x0, sizeof(MAPPED_TYPE));
- memset((void*)(&dummy_index), 0x0, sizeof(INDEX_TYPE));
- mCurIter = mStlMap.begin();
- }
- ~LLMap()
- {
- mStlMap.clear();
- }
-
- // use these functions to itterate through a list
- void resetMap()
- {
- mCurIter = mStlMap.begin();
- }
-
- // get the current data and bump mCurrentp
- // This is kind of screwy since it returns a reference;
- // We have to have a dummy value for when we reach the end
- // or in case we have an empty list. Presumably, this value
- // will initialize to some NULL value that will end the iterator.
- // We really shouldn't be using getNextData() or getNextKey() anyway...
- MAPPED_TYPE &getNextData()
- {
- if (mCurIter == mStlMap.end())
- {
- return dummy_data;
- }
- else
- {
- return (*mCurIter++).second;
- }
- }
-
- const INDEX_TYPE &getNextKey()
- {
- if (mCurIter == mStlMap.end())
- {
- return dummy_index;
- }
- else
- {
- return (*mCurIter++).first;
- }
- }
-
- MAPPED_TYPE &getFirstData()
- {
- resetMap();
- return getNextData();
- }
-
- const INDEX_TYPE &getFirstKey()
- {
- resetMap();
- return getNextKey();
- }
-
- S32 getLength()
- {
- return mStlMap.size();
- }
-
- void addData(const INDEX_TYPE &index, MAPPED_TYPE pointed_to)
- {
- mStlMap.insert(stl_value_t(index, pointed_to));
- }
-
- void addData(const INDEX_TYPE &index)
- {
- mStlMap.insert(stl_value_t(index, dummy_data));
- }
-
- // if index doesn't exist, then insert a new node and return it
- MAPPED_TYPE &getData(const INDEX_TYPE &index)
- {
- std::pair<stl_iter_t, bool> res;
- res = mStlMap.insert(stl_value_t(index, dummy_data));
- return res.first->second;
- }
-
- // if index doesn't exist, then insert a new node, return it, and set b_new_entry to true
- MAPPED_TYPE &getData(const INDEX_TYPE &index, BOOL &b_new_entry)
- {
- std::pair<stl_iter_t, bool> res;
- res = mStlMap.insert(stl_value_t(index, dummy_data));
- b_new_entry = res.second;
- return res.first->second;
- }
-
- // If there, returns the data.
- // If not, returns NULL.
- // Never adds entries to the map.
- MAPPED_TYPE getIfThere(const INDEX_TYPE &index)
- {
- stl_iter_t iter;
- iter = mStlMap.find(index);
- if (iter == mStlMap.end())
- {
- return (MAPPED_TYPE)0;
- }
- else
- {
- return (*iter).second;
- }
- }
-
-
- // if index doesn't exist, then make a new node and return it
- MAPPED_TYPE &operator[](const INDEX_TYPE &index)
- {
- return getData(index);
- }
-
- // do a reverse look-up, return NULL if failed
- INDEX_TYPE reverseLookup(const MAPPED_TYPE data)
- {
- stl_iter_t iter;
- stl_iter_t end_iter;
- iter = mStlMap.begin();
- end_iter = mStlMap.end();
- while (iter != end_iter)
- {
- if ((*iter).second == data)
- return (*iter).first;
- iter++;
- }
- return (INDEX_TYPE)0;
- }
-
- BOOL removeData(const INDEX_TYPE &index)
- {
- mCurIter = mStlMap.find(index);
- if (mCurIter == mStlMap.end())
- {
- return FALSE;
- }
- else
- {
- stl_iter_t iter = mCurIter++; // incrament mCurIter to the next element
- mStlMap.erase(iter);
- return TRUE;
- }
- }
-
- // does this index exist?
- BOOL checkData(const INDEX_TYPE &index)
- {
- stl_iter_t iter;
- iter = mStlMap.find(index);
- if (iter == mStlMap.end())
- {
- return FALSE;
- }
- else
- {
- mCurIter = iter;
- return TRUE;
- }
- }
-
- BOOL deleteData(const INDEX_TYPE &index)
- {
- mCurIter = mStlMap.find(index);
- if (mCurIter == mStlMap.end())
- {
- return FALSE;
- }
- else
- {
- stl_iter_t iter = mCurIter++; // incrament mCurIter to the next element
- delete (*iter).second;
- mStlMap.erase(iter);
- return TRUE;
- }
- }
-
- void deleteAllData()
- {
- stl_iter_t iter;
- stl_iter_t end_iter;
- iter = mStlMap.begin();
- end_iter = mStlMap.end();
- while (iter != end_iter)
- {
- delete (*iter).second;
- iter++;
- }
- mStlMap.clear();
- mCurIter = mStlMap.end();
- }
-
- void removeAllData()
- {
- mStlMap.clear();
- }
-};
-
-
-#endif
diff --git a/indra/llcommon/llmd5.cpp b/indra/llcommon/llmd5.cpp
index 1409c55d1c..ed80af36d8 100755
--- a/indra/llcommon/llmd5.cpp
+++ b/indra/llcommon/llmd5.cpp
@@ -76,7 +76,6 @@ documentation and/or software.
#include "llmd5.h"
-#include <cassert>
#include <iostream> // cerr
// how many bytes to grab at a time when checking files
diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp
index 70ad10ad55..e0b2aa87c2 100755
--- a/indra/llcommon/llmemory.cpp
+++ b/indra/llcommon/llmemory.cpp
@@ -27,12 +27,9 @@
#include "linden_common.h"
-//#if MEM_TRACK_MEM
#include "llthread.h"
-//#endif
#if defined(LL_WINDOWS)
-//# include <windows.h>
# include <psapi.h>
#elif defined(LL_DARWIN)
# include <sys/types.h>
@@ -46,15 +43,18 @@
#include "llsys.h"
#include "llframetimer.h"
+#include "lltrace.h"
//----------------------------------------------------------------------------
//static
char* LLMemory::reserveMem = 0;
-U32 LLMemory::sAvailPhysicalMemInKB = U32_MAX ;
-U32 LLMemory::sMaxPhysicalMemInKB = 0;
-U32 LLMemory::sAllocatedMemInKB = 0;
-U32 LLMemory::sAllocatedPageSizeInKB = 0 ;
-U32 LLMemory::sMaxHeapSizeInKB = U32_MAX ;
+U32Kilobytes LLMemory::sAvailPhysicalMemInKB(U32_MAX);
+U32Kilobytes LLMemory::sMaxPhysicalMemInKB(0);
+static LLTrace::SampleStatHandle<F64Megabytes> sAllocatedMem("allocated_mem", "active memory in use by application");
+static LLTrace::SampleStatHandle<F64Megabytes> sVirtualMem("virtual_mem", "virtual memory assigned to application");
+U32Kilobytes LLMemory::sAllocatedMemInKB(0);
+U32Kilobytes LLMemory::sAllocatedPageSizeInKB(0);
+U32Kilobytes LLMemory::sMaxHeapSizeInKB(U32_MAX);
BOOL LLMemory::sEnableMemoryFailurePrevention = FALSE;
#if __DEBUG_PRIVATE_MEM__
@@ -67,7 +67,7 @@ void ll_assert_aligned_func(uintptr_t ptr,U32 alignment)
// Redundant, place to set breakpoints.
if (ptr%alignment!=0)
{
- llwarns << "alignment check failed" << llendl;
+ LL_WARNS() << "alignment check failed" << LL_ENDL;
}
llassert(ptr%alignment==0);
#endif
@@ -97,9 +97,9 @@ void LLMemory::freeReserve()
}
//static
-void LLMemory::initMaxHeapSizeGB(F32 max_heap_size_gb, BOOL prevent_heap_failure)
+void LLMemory::initMaxHeapSizeGB(F32Gigabytes max_heap_size, BOOL prevent_heap_failure)
{
- sMaxHeapSizeInKB = (U32)(max_heap_size_gb * 1024 * 1024) ;
+ sMaxHeapSizeInKB = max_heap_size;
sEnableMemoryFailurePrevention = prevent_heap_failure ;
}
@@ -112,14 +112,16 @@ void LLMemory::updateMemoryInfo()
if (!GetProcessMemoryInfo(self, &counters, sizeof(counters)))
{
- llwarns << "GetProcessMemoryInfo failed" << llendl;
+ LL_WARNS() << "GetProcessMemoryInfo failed" << LL_ENDL;
return ;
}
- sAllocatedMemInKB = (U32)(counters.WorkingSetSize / 1024) ;
- sAllocatedPageSizeInKB = (U32)(counters.PagefileUsage / 1024) ;
+ sAllocatedMemInKB = (U32Bytes)(counters.WorkingSetSize) ;
+ sample(sAllocatedMem, sAllocatedMemInKB);
+ sAllocatedPageSizeInKB = (U32Bytes)(counters.PagefileUsage) ;
+ sample(sVirtualMem, sAllocatedPageSizeInKB);
- U32 avail_phys, avail_virtual;
+ U32Kilobytes avail_phys, avail_virtual;
LLMemoryInfo::getAvailableMemoryKB(avail_phys, avail_virtual) ;
sMaxPhysicalMemInKB = llmin(avail_phys + sAllocatedMemInKB, sMaxHeapSizeInKB);
@@ -129,13 +131,13 @@ void LLMemory::updateMemoryInfo()
}
else
{
- sAvailPhysicalMemInKB = 0 ;
+ sAvailPhysicalMemInKB = U32Kilobytes(0);
}
#else
//not valid for other systems for now.
- sAllocatedMemInKB = (U32)(LLMemory::getCurrentRSS() / 1024) ;
- sMaxPhysicalMemInKB = U32_MAX ;
- sAvailPhysicalMemInKB = U32_MAX ;
+ sAllocatedMemInKB = (U32Bytes)LLMemory::getCurrentRSS();
+ sMaxPhysicalMemInKB = (U32Bytes)U32_MAX ;
+ sAvailPhysicalMemInKB = (U32Bytes)U32_MAX ;
#endif
return ;
@@ -156,7 +158,7 @@ void* LLMemory::tryToAlloc(void* address, U32 size)
{
if(!VirtualFree(address, 0, MEM_RELEASE))
{
- llerrs << "error happens when free some memory reservation." << llendl ;
+ LL_ERRS() << "error happens when free some memory reservation." << LL_ENDL ;
}
}
return address ;
@@ -174,14 +176,14 @@ void LLMemory::logMemoryInfo(BOOL update)
LLPrivateMemoryPoolManager::getInstance()->updateStatistics() ;
}
- llinfos << "Current allocated physical memory(KB): " << sAllocatedMemInKB << llendl ;
- llinfos << "Current allocated page size (KB): " << sAllocatedPageSizeInKB << llendl ;
- llinfos << "Current availabe physical memory(KB): " << sAvailPhysicalMemInKB << llendl ;
- llinfos << "Current max usable memory(KB): " << sMaxPhysicalMemInKB << llendl ;
+ LL_INFOS() << "Current allocated physical memory(KB): " << sAllocatedMemInKB << LL_ENDL ;
+ LL_INFOS() << "Current allocated page size (KB): " << sAllocatedPageSizeInKB << LL_ENDL ;
+ LL_INFOS() << "Current availabe physical memory(KB): " << sAvailPhysicalMemInKB << LL_ENDL ;
+ LL_INFOS() << "Current max usable memory(KB): " << sMaxPhysicalMemInKB << LL_ENDL ;
- llinfos << "--- private pool information -- " << llendl ;
- llinfos << "Total reserved (KB): " << LLPrivateMemoryPoolManager::getInstance()->mTotalReservedSize / 1024 << llendl ;
- llinfos << "Total allocated (KB): " << LLPrivateMemoryPoolManager::getInstance()->mTotalAllocatedSize / 1024 << llendl ;
+ LL_INFOS() << "--- private pool information -- " << LL_ENDL ;
+ LL_INFOS() << "Total reserved (KB): " << LLPrivateMemoryPoolManager::getInstance()->mTotalReservedSize / 1024 << LL_ENDL ;
+ LL_INFOS() << "Total allocated (KB): " << LLPrivateMemoryPoolManager::getInstance()->mTotalAllocatedSize / 1024 << LL_ENDL ;
}
//return 0: everything is normal;
@@ -190,8 +192,8 @@ void LLMemory::logMemoryInfo(BOOL update)
//static
bool LLMemory::isMemoryPoolLow()
{
- static const U32 LOW_MEMEOY_POOL_THRESHOLD_KB = 64 * 1024 ; //64 MB for emergency use
- const static U32 MAX_SIZE_CHECKED_MEMORY_BLOCK = 64 * 1024 * 1024 ; //64 MB
+ static const U32Megabytes LOW_MEMORY_POOL_THRESHOLD(64);
+ const static U32Megabytes MAX_SIZE_CHECKED_MEMORY_BLOCK(64);
static void* last_reserved_address = NULL ;
if(!sEnableMemoryFailurePrevention)
@@ -199,32 +201,32 @@ bool LLMemory::isMemoryPoolLow()
return false ; //no memory failure prevention.
}
- if(sAvailPhysicalMemInKB < (LOW_MEMEOY_POOL_THRESHOLD_KB >> 2)) //out of physical memory
+ if(sAvailPhysicalMemInKB < (LOW_MEMORY_POOL_THRESHOLD / 4)) //out of physical memory
{
return true ;
}
- if(sAllocatedPageSizeInKB + (LOW_MEMEOY_POOL_THRESHOLD_KB >> 2) > sMaxHeapSizeInKB) //out of virtual address space.
+ if(sAllocatedPageSizeInKB + (LOW_MEMORY_POOL_THRESHOLD / 4) > sMaxHeapSizeInKB) //out of virtual address space.
{
return true ;
}
- bool is_low = (S32)(sAvailPhysicalMemInKB < LOW_MEMEOY_POOL_THRESHOLD_KB ||
- sAllocatedPageSizeInKB + LOW_MEMEOY_POOL_THRESHOLD_KB > sMaxHeapSizeInKB) ;
+ bool is_low = (S32)(sAvailPhysicalMemInKB < LOW_MEMORY_POOL_THRESHOLD
+ || sAllocatedPageSizeInKB + LOW_MEMORY_POOL_THRESHOLD > sMaxHeapSizeInKB) ;
//check the virtual address space fragmentation
if(!is_low)
{
if(!last_reserved_address)
{
- last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK) ;
+ last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK.value()) ;
}
else
{
- last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK) ;
+ last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK.value()) ;
if(!last_reserved_address) //failed, try once more
{
- last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK) ;
+ last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK.value()) ;
}
}
@@ -235,19 +237,19 @@ bool LLMemory::isMemoryPoolLow()
}
//static
-U32 LLMemory::getAvailableMemKB()
+U32Kilobytes LLMemory::getAvailableMemKB()
{
return sAvailPhysicalMemInKB ;
}
//static
-U32 LLMemory::getMaxMemKB()
+U32Kilobytes LLMemory::getMaxMemKB()
{
return sMaxPhysicalMemInKB ;
}
//static
-U32 LLMemory::getAllocatedMemKB()
+U32Kilobytes LLMemory::getAllocatedMemKB()
{
return sAllocatedMemInKB ;
}
@@ -263,7 +265,7 @@ U64 LLMemory::getCurrentRSS()
if (!GetProcessMemoryInfo(self, &counters, sizeof(counters)))
{
- llwarns << "GetProcessMemoryInfo failed" << llendl;
+ LL_WARNS() << "GetProcessMemoryInfo failed" << LL_ENDL;
return 0;
}
@@ -301,7 +303,7 @@ U32 LLMemory::getWorkingSetSize()
// if (sysctl(ctl, 2, &page_size, &size, NULL, 0) == -1)
// {
-// llwarns << "Couldn't get page size" << llendl;
+// LL_WARNS() << "Couldn't get page size" << LL_ENDL;
// return 0;
// } else {
// return page_size;
@@ -320,11 +322,11 @@ U64 LLMemory::getCurrentRSS()
// If we ever wanted it, the process virtual size is also available as:
// virtualSize = basicInfo.virtual_size;
-// llinfos << "resident size is " << residentSize << llendl;
+// LL_INFOS() << "resident size is " << residentSize << LL_ENDL;
}
else
{
- llwarns << "task_info failed" << llendl;
+ LL_WARNS() << "task_info failed" << LL_ENDL;
}
return residentSize;
@@ -345,7 +347,7 @@ U64 LLMemory::getCurrentRSS()
if (fp == NULL)
{
- llwarns << "couldn't open " << statPath << llendl;
+ LL_WARNS() << "couldn't open " << statPath << LL_ENDL;
goto bail;
}
@@ -358,7 +360,7 @@ U64 LLMemory::getCurrentRSS()
&rss);
if (ret != 1)
{
- llwarns << "couldn't parse contents of " << statPath << llendl;
+ LL_WARNS() << "couldn't parse contents of " << statPath << LL_ENDL;
rss = 0;
}
}
@@ -388,12 +390,12 @@ U64 LLMemory::getCurrentRSS()
sprintf(path, "/proc/%d/psinfo", (int)getpid());
int proc_fd = -1;
if((proc_fd = open(path, O_RDONLY)) == -1){
- llwarns << "LLmemory::getCurrentRSS() unable to open " << path << ". Returning 0 RSS!" << llendl;
+ LL_WARNS() << "LLmemory::getCurrentRSS() unable to open " << path << ". Returning 0 RSS!" << LL_ENDL;
return 0;
}
psinfo_t proc_psinfo;
if(read(proc_fd, &proc_psinfo, sizeof(psinfo_t)) != sizeof(psinfo_t)){
- llwarns << "LLmemory::getCurrentRSS() Unable to read from " << path << ". Returning 0 RSS!" << llendl;
+ LL_WARNS() << "LLmemory::getCurrentRSS() Unable to read from " << path << ". Returning 0 RSS!" << LL_ENDL;
close(proc_fd);
return 0;
}
@@ -423,141 +425,6 @@ U32 LLMemory::getWorkingSetSize()
#endif
//--------------------------------------------------------------------------------------------------
-#if MEM_TRACK_MEM
-#include "llframetimer.h"
-
-//static
-LLMemTracker* LLMemTracker::sInstance = NULL ;
-
-LLMemTracker::LLMemTracker()
-{
- mLastAllocatedMem = LLMemory::getWorkingSetSize() ;
- mCapacity = 128 ;
- mCurIndex = 0 ;
- mCounter = 0 ;
- mDrawnIndex = 0 ;
- mPaused = FALSE ;
-
- mMutexp = new LLMutex() ;
- mStringBuffer = new char*[128] ;
- mStringBuffer[0] = new char[mCapacity * 128] ;
- for(S32 i = 1 ; i < mCapacity ; i++)
- {
- mStringBuffer[i] = mStringBuffer[i-1] + 128 ;
- }
-}
-
-LLMemTracker::~LLMemTracker()
-{
- delete[] mStringBuffer[0] ;
- delete[] mStringBuffer;
- delete mMutexp ;
-}
-
-//static
-LLMemTracker* LLMemTracker::getInstance()
-{
- if(!sInstance)
- {
- sInstance = new LLMemTracker() ;
- }
- return sInstance ;
-}
-
-//static
-void LLMemTracker::release()
-{
- if(sInstance)
- {
- delete sInstance ;
- sInstance = NULL ;
- }
-}
-
-//static
-void LLMemTracker::track(const char* function, const int line)
-{
- static const S32 MIN_ALLOCATION = 0 ; //1KB
-
- if(mPaused)
- {
- return ;
- }
-
- U32 allocated_mem = LLMemory::getWorkingSetSize() ;
-
- LLMutexLock lock(mMutexp) ;
-
- S32 delta_mem = allocated_mem - mLastAllocatedMem ;
- mLastAllocatedMem = allocated_mem ;
-
- if(delta_mem <= 0)
- {
- return ; //occupied memory does not grow
- }
-
- if(delta_mem < MIN_ALLOCATION)
- {
- return ;
- }
-
- char* buffer = mStringBuffer[mCurIndex++] ;
- F32 time = (F32)LLFrameTimer::getElapsedSeconds() ;
- S32 hours = (S32)(time / (60*60));
- S32 mins = (S32)((time - hours*(60*60)) / 60);
- S32 secs = (S32)((time - hours*(60*60) - mins*60));
- strcpy(buffer, function) ;
- sprintf(buffer + strlen(function), " line: %d DeltaMem: %d (bytes) Time: %d:%02d:%02d", line, delta_mem, hours,mins,secs) ;
-
- if(mCounter < mCapacity)
- {
- mCounter++ ;
- }
- if(mCurIndex >= mCapacity)
- {
- mCurIndex = 0 ;
- }
-}
-
-
-//static
-void LLMemTracker::preDraw(BOOL pause)
-{
- mMutexp->lock() ;
-
- mPaused = pause ;
- mDrawnIndex = mCurIndex - 1;
- mNumOfDrawn = 0 ;
-}
-
-//static
-void LLMemTracker::postDraw()
-{
- mMutexp->unlock() ;
-}
-
-//static
-const char* LLMemTracker::getNextLine()
-{
- if(mNumOfDrawn >= mCounter)
- {
- return NULL ;
- }
- mNumOfDrawn++;
-
- if(mDrawnIndex < 0)
- {
- mDrawnIndex = mCapacity - 1 ;
- }
-
- return mStringBuffer[mDrawnIndex--] ;
-}
-
-#endif //MEM_TRACK_MEM
-//--------------------------------------------------------------------------------------------------
-
-
-//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
//minimum slot size and minimal slot size interval
const U32 ATOMIC_MEM_SLOT = 16 ; //bytes
@@ -961,7 +828,7 @@ void LLPrivateMemoryPool::LLMemoryChunk::dump()
total_size += blk_list[i]->getBufferSize() ;
if((U32)blk_list[i]->getBuffer() < (U32)blk_list[i-1]->getBuffer() + blk_list[i-1]->getBufferSize())
{
- llerrs << "buffer corrupted." << llendl ;
+ LL_ERRS() << "buffer corrupted." << LL_ENDL ;
}
}
@@ -982,32 +849,32 @@ void LLPrivateMemoryPool::LLMemoryChunk::dump()
}
else
{
- llerrs << "gap happens" << llendl ;
+ LL_ERRS() << "gap happens" << LL_ENDL ;
}
}
#endif
#if 0
- llinfos << "---------------------------" << llendl ;
- llinfos << "Chunk buffer: " << (U32)getBuffer() << " size: " << getBufferSize() << llendl ;
+ LL_INFOS() << "---------------------------" << LL_ENDL ;
+ LL_INFOS() << "Chunk buffer: " << (U32)getBuffer() << " size: " << getBufferSize() << LL_ENDL ;
- llinfos << "available blocks ... " << llendl ;
+ LL_INFOS() << "available blocks ... " << LL_ENDL ;
for(S32 i = 0 ; i < mBlockLevels ; i++)
{
LLMemoryBlock* blk = mAvailBlockList[i] ;
while(blk)
{
- llinfos << "blk buffer " << (U32)blk->getBuffer() << " size: " << blk->getBufferSize() << llendl ;
+ LL_INFOS() << "blk buffer " << (U32)blk->getBuffer() << " size: " << blk->getBufferSize() << LL_ENDL ;
blk = blk->mNext ;
}
}
- llinfos << "free blocks ... " << llendl ;
+ LL_INFOS() << "free blocks ... " << LL_ENDL ;
for(S32 i = 0 ; i < mPartitionLevels ; i++)
{
LLMemoryBlock* blk = mFreeSpaceList[i] ;
while(blk)
{
- llinfos << "blk buffer " << (U32)blk->getBuffer() << " size: " << blk->getBufferSize() << llendl ;
+ LL_INFOS() << "blk buffer " << (U32)blk->getBuffer() << " size: " << blk->getBufferSize() << LL_ENDL ;
blk = blk->mNext ;
}
}
@@ -1403,7 +1270,7 @@ char* LLPrivateMemoryPool::allocate(U32 size)
if(to_log)
{
- llwarns << "The memory pool overflows, now using heap directly!" << llendl ;
+ LL_WARNS() << "The memory pool overflows, now using heap directly!" << LL_ENDL ;
to_log = false ;
}
@@ -1496,7 +1363,7 @@ void LLPrivateMemoryPool::destroyPool()
if(mNumOfChunks > 0)
{
- llwarns << "There is some memory not freed when destroy the memory pool!" << llendl ;
+ LL_WARNS() << "There is some memory not freed when destroy the memory pool!" << LL_ENDL ;
}
mNumOfChunks = 0 ;
@@ -1514,11 +1381,11 @@ bool LLPrivateMemoryPool::checkSize(U32 asked_size)
{
if(mReservedPoolSize + asked_size > mMaxPoolSize)
{
- llinfos << "Max pool size: " << mMaxPoolSize << llendl ;
- llinfos << "Total reserved size: " << mReservedPoolSize + asked_size << llendl ;
- llinfos << "Total_allocated Size: " << getTotalAllocatedSize() << llendl ;
+ LL_INFOS() << "Max pool size: " << mMaxPoolSize << LL_ENDL ;
+ LL_INFOS() << "Total reserved size: " << mReservedPoolSize + asked_size << LL_ENDL ;
+ LL_INFOS() << "Total_allocated Size: " << getTotalAllocatedSize() << LL_ENDL ;
- //llerrs << "The pool is overflowing..." << llendl ;
+ //LL_ERRS() << "The pool is overflowing..." << LL_ENDL ;
return false ;
}
@@ -1731,7 +1598,7 @@ void LLPrivateMemoryPool::removeFromHashTable(LLMemoryChunk* chunk)
void LLPrivateMemoryPool::rehash()
{
- llinfos << "new hash factor: " << mHashFactor << llendl ;
+ LL_INFOS() << "new hash factor: " << mHashFactor << LL_ENDL ;
mChunkHashList.clear() ;
mChunkHashList.resize(mHashFactor) ;
@@ -1811,7 +1678,7 @@ void LLPrivateMemoryPool::LLChunkHashElement::remove(LLPrivateMemoryPool::LLMemo
}
else
{
- llerrs << "This slot does not contain this chunk!" << llendl ;
+ LL_ERRS() << "This slot does not contain this chunk!" << LL_ENDL ;
}
}
@@ -1843,12 +1710,12 @@ LLPrivateMemoryPoolManager::~LLPrivateMemoryPoolManager()
#if __DEBUG_PRIVATE_MEM__
if(!sMemAllocationTracker.empty())
{
- llwarns << "there is potential memory leaking here. The list of not freed memory blocks are from: " <<llendl ;
+ LL_WARNS() << "there is potential memory leaking here. The list of not freed memory blocks are from: " <<LL_ENDL ;
S32 k = 0 ;
for(mem_allocation_info_t::iterator iter = sMemAllocationTracker.begin() ; iter != sMemAllocationTracker.end() ; ++iter)
{
- llinfos << k++ << ", " << (U32)iter->first << " : " << iter->second << llendl ;
+ LL_INFOS() << k++ << ", " << (U32)iter->first << " : " << iter->second << LL_ENDL ;
}
sMemAllocationTracker.clear() ;
}
@@ -2044,7 +1911,7 @@ void LLPrivateMemoryPoolManager::freeMem(LLPrivateMemoryPool* poolp, void* addr
}
else
{
- llerrs << "private pool is used before initialized.!" << llendl ;
+ LL_ERRS() << "private pool is used before initialized.!" << LL_ENDL ;
}
}
}
@@ -2118,7 +1985,7 @@ void LLPrivateMemoryPoolTester::test(U32 min_size, U32 max_size, U32 stride, U32
//allocate space for p ;
if(!(p = ::new char**[times]) || !(*p = ::new char*[times * levels]))
{
- llerrs << "memory initialization for p failed" << llendl ;
+ LL_ERRS() << "memory initialization for p failed" << LL_ENDL ;
}
//init
@@ -2190,8 +2057,8 @@ void LLPrivateMemoryPoolTester::testAndTime(U32 size, U32 times)
{
LLTimer timer ;
- llinfos << " -**********************- " << llendl ;
- llinfos << "test size: " << size << " test times: " << times << llendl ;
+ LL_INFOS() << " -**********************- " << LL_ENDL ;
+ LL_INFOS() << "test size: " << size << " test times: " << times << LL_ENDL ;
timer.reset() ;
char** p = new char*[times] ;
@@ -2203,7 +2070,7 @@ void LLPrivateMemoryPoolTester::testAndTime(U32 size, U32 times)
p[i] = ALLOCATE_MEM(sPool, size) ;
if(!p[i])
{
- llerrs << "allocation failed" << llendl ;
+ LL_ERRS() << "allocation failed" << LL_ENDL ;
}
}
//de-allocation
@@ -2212,7 +2079,7 @@ void LLPrivateMemoryPoolTester::testAndTime(U32 size, U32 times)
FREE_MEM(sPool, p[i]) ;
p[i] = NULL ;
}
- llinfos << "time spent using customized memory pool: " << timer.getElapsedTimeF32() << llendl ;
+ LL_INFOS() << "time spent using customized memory pool: " << timer.getElapsedTimeF32() << LL_ENDL ;
timer.reset() ;
@@ -2223,7 +2090,7 @@ void LLPrivateMemoryPoolTester::testAndTime(U32 size, U32 times)
p[i] = ::new char[size] ;
if(!p[i])
{
- llerrs << "allocation failed" << llendl ;
+ LL_ERRS() << "allocation failed" << LL_ENDL ;
}
}
//de-allocation
@@ -2232,7 +2099,7 @@ void LLPrivateMemoryPoolTester::testAndTime(U32 size, U32 times)
::delete[] p[i] ;
p[i] = NULL ;
}
- llinfos << "time spent using standard allocator/de-allocator: " << timer.getElapsedTimeF32() << llendl ;
+ LL_INFOS() << "time spent using standard allocator/de-allocator: " << timer.getElapsedTimeF32() << LL_ENDL ;
delete[] p;
}
diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h
index 61e30f11cc..7d1d541a4b 100755
--- a/indra/llcommon/llmemory.h
+++ b/indra/llcommon/llmemory.h
@@ -27,15 +27,35 @@
#define LLMEMORY_H
#include "linden_common.h"
+#include "llunits.h"
+#if !LL_WINDOWS
+#include <stdint.h>
+#endif
class LLMutex ;
#if LL_WINDOWS && LL_DEBUG
#define LL_CHECK_MEMORY llassert(_CrtCheckMemory());
#else
-#define LL_CHECK_MEMORY
+#define LL_CHECK_MEMORY
+#endif
+
+
+#if LL_WINDOWS
+#define LL_ALIGN_OF __alignof
+#else
+#define LL_ALIGN_OF __align_of__
+#endif
+
+#if LL_WINDOWS
+#define LL_DEFAULT_HEAP_ALIGN 8
+#elif LL_DARWIN
+#define LL_DEFAULT_HEAP_ALIGN 16
+#elif LL_LINUX
+#define LL_DEFAULT_HEAP_ALIGN 8
#endif
+
LL_COMMON_API void ll_assert_aligned_func(uintptr_t ptr,U32 alignment);
#ifdef SHOW_ASSERT
@@ -74,7 +94,8 @@ template <typename T> T* LL_NEXT_ALIGNED_ADDRESS_64(T* address)
#define LL_ALIGN_16(var) LL_ALIGN_PREFIX(16) var LL_ALIGN_POSTFIX(16)
-inline void* ll_aligned_malloc( size_t size, int align )
+
+inline void* ll_aligned_malloc_fallback( size_t size, int align )
{
#if defined(LL_WINDOWS)
return _aligned_malloc(size, align);
@@ -88,7 +109,7 @@ inline void* ll_aligned_malloc( size_t size, int align )
#endif
}
-inline void ll_aligned_free( void* ptr )
+inline void ll_aligned_free_fallback( void* ptr )
{
#if defined(LL_WINDOWS)
_aligned_free(ptr);
@@ -161,7 +182,7 @@ inline void* ll_aligned_malloc_32(size_t size) // returned hunk MUST be freed wi
#if defined(LL_WINDOWS)
return _aligned_malloc(size, 32);
#elif defined(LL_DARWIN)
- return ll_aligned_malloc( size, 32 );
+ return ll_aligned_malloc_fallback( size, 32 );
#else
void *rtn;
if (LL_LIKELY(0 == posix_memalign(&rtn, 32, size)))
@@ -176,12 +197,54 @@ inline void ll_aligned_free_32(void *p)
#if defined(LL_WINDOWS)
_aligned_free(p);
#elif defined(LL_DARWIN)
- ll_aligned_free( p );
+ ll_aligned_free_fallback( p );
#else
free(p); // posix_memalign() is compatible with heap deallocator
#endif
}
+// general purpose dispatch functions that are forced inline so they can compile down to a single call
+template<size_t ALIGNMENT>
+LL_FORCE_INLINE void* ll_aligned_malloc(size_t size)
+{
+ if (LL_DEFAULT_HEAP_ALIGN % ALIGNMENT == 0)
+ {
+ return malloc(size);
+ }
+ else if (ALIGNMENT == 16)
+ {
+ return ll_aligned_malloc_16(size);
+ }
+ else if (ALIGNMENT == 32)
+ {
+ return ll_aligned_malloc_32(size);
+ }
+ else
+ {
+ return ll_aligned_malloc_fallback(size, ALIGNMENT);
+ }
+}
+
+template<size_t ALIGNMENT>
+LL_FORCE_INLINE void ll_aligned_free(void* ptr)
+{
+ if (ALIGNMENT == LL_DEFAULT_HEAP_ALIGN)
+ {
+ free(ptr);
+ }
+ else if (ALIGNMENT == 16)
+ {
+ ll_aligned_free_16(ptr);
+ }
+ else if (ALIGNMENT == 32)
+ {
+ return ll_aligned_free_32(ptr);
+ }
+ else
+ {
+ return ll_aligned_free_fallback(ptr);
+ }
+}
// Copy words 16-byte blocks from src to dst. Source and destination MUST NOT OVERLAP.
// Source and dest must be 16-byte aligned and size must be multiple of 16.
@@ -194,7 +257,8 @@ inline void ll_memcpy_nonaliased_aligned_16(char* __restrict dst, const char* __
assert((bytes % sizeof(F32))== 0);
ll_assert_aligned(src,16);
ll_assert_aligned(dst,16);
- assert((src < dst) ? ((src + bytes) < dst) : ((dst + bytes) < src));
+
+ assert((src < dst) ? ((src + bytes) <= dst) : ((dst + bytes) <= src));
assert(bytes%16==0);
char* end = dst + bytes;
@@ -269,70 +333,25 @@ public:
static U64 getCurrentRSS();
static U32 getWorkingSetSize();
static void* tryToAlloc(void* address, U32 size);
- static void initMaxHeapSizeGB(F32 max_heap_size_gb, BOOL prevent_heap_failure);
+ static void initMaxHeapSizeGB(F32Gigabytes max_heap_size, BOOL prevent_heap_failure);
static void updateMemoryInfo() ;
static void logMemoryInfo(BOOL update = FALSE);
static bool isMemoryPoolLow();
- static U32 getAvailableMemKB() ;
- static U32 getMaxMemKB() ;
- static U32 getAllocatedMemKB() ;
+ static U32Kilobytes getAvailableMemKB() ;
+ static U32Kilobytes getMaxMemKB() ;
+ static U32Kilobytes getAllocatedMemKB() ;
private:
static char* reserveMem;
- static U32 sAvailPhysicalMemInKB ;
- static U32 sMaxPhysicalMemInKB ;
- static U32 sAllocatedMemInKB;
- static U32 sAllocatedPageSizeInKB ;
+ static U32Kilobytes sAvailPhysicalMemInKB ;
+ static U32Kilobytes sMaxPhysicalMemInKB ;
+ static U32Kilobytes sAllocatedMemInKB;
+ static U32Kilobytes sAllocatedPageSizeInKB ;
- static U32 sMaxHeapSizeInKB;
+ static U32Kilobytes sMaxHeapSizeInKB;
static BOOL sEnableMemoryFailurePrevention;
};
-//----------------------------------------------------------------------------
-#if MEM_TRACK_MEM
-class LLMutex ;
-class LL_COMMON_API LLMemTracker
-{
-private:
- LLMemTracker() ;
- ~LLMemTracker() ;
-
-public:
- static void release() ;
- static LLMemTracker* getInstance() ;
-
- void track(const char* function, const int line) ;
- void preDraw(BOOL pause) ;
- void postDraw() ;
- const char* getNextLine() ;
-
-private:
- static LLMemTracker* sInstance ;
-
- char** mStringBuffer ;
- S32 mCapacity ;
- U32 mLastAllocatedMem ;
- S32 mCurIndex ;
- S32 mCounter;
- S32 mDrawnIndex;
- S32 mNumOfDrawn;
- BOOL mPaused;
- LLMutex* mMutexp ;
-};
-
-#define MEM_TRACK_RELEASE LLMemTracker::release() ;
-#define MEM_TRACK LLMemTracker::getInstance()->track(__FUNCTION__, __LINE__) ;
-
-#else // MEM_TRACK_MEM
-
-#define MEM_TRACK_RELEASE
-#define MEM_TRACK
-
-#endif // MEM_TRACK_MEM
-
-//----------------------------------------------------------------------------
-
-
//
//class LLPrivateMemoryPool defines a private memory pool for an application to use, so the application does not
//need to access the heap directly fro each memory allocation. Throught this, the allocation speed is faster,
diff --git a/indra/llcommon/llmemorystream.cpp b/indra/llcommon/llmemorystream.cpp
index 723d94f025..707ac8fd0f 100755
--- a/indra/llcommon/llmemorystream.cpp
+++ b/indra/llcommon/llmemorystream.cpp
@@ -45,7 +45,7 @@ void LLMemoryStreamBuf::reset(const U8* start, S32 length)
int LLMemoryStreamBuf::underflow()
{
- //lldebugs << "LLMemoryStreamBuf::underflow()" << llendl;
+ //LL_DEBUGS() << "LLMemoryStreamBuf::underflow()" << LL_ENDL;
if(gptr() < egptr())
{
return *gptr();
diff --git a/indra/llcommon/llmetricperformancetester.cpp b/indra/llcommon/llmetricperformancetester.cpp
index 731e58bd20..1fc821d9a9 100755
--- a/indra/llcommon/llmetricperformancetester.cpp
+++ b/indra/llcommon/llmetricperformancetester.cpp
@@ -29,9 +29,9 @@
#include "indra_constants.h"
#include "llerror.h"
#include "llsdserialize.h"
-#include "llstat.h"
#include "lltreeiterators.h"
#include "llmetricperformancetester.h"
+#include "llfasttimer.h"
//----------------------------------------------------------------------------------------------
// LLMetricPerformanceTesterBasic : static methods and testers management
@@ -56,7 +56,7 @@ BOOL LLMetricPerformanceTesterBasic::addTester(LLMetricPerformanceTesterBasic* t
std::string name = tester->getTesterName() ;
if (getTester(name))
{
- llerrs << "Tester name is already used by some other tester : " << name << llendl ;
+ LL_ERRS() << "Tester name is already used by some other tester : " << name << LL_ENDL ;
return FALSE;
}
@@ -91,7 +91,7 @@ LLMetricPerformanceTesterBasic* LLMetricPerformanceTesterBasic::getTester(std::s
// Return TRUE if this metric is requested or if the general default "catch all" metric is requested
BOOL LLMetricPerformanceTesterBasic::isMetricLogRequested(std::string name)
{
- return (LLFastTimer::sMetricLog && ((LLFastTimer::sLogName == name) || (LLFastTimer::sLogName == DEFAULT_METRIC_NAME)));
+ return (LLTrace::BlockTimer::sMetricLog && ((LLTrace::BlockTimer::sLogName == name) || (LLTrace::BlockTimer::sLogName == DEFAULT_METRIC_NAME)));
}
/*static*/
@@ -136,7 +136,7 @@ void LLMetricPerformanceTesterBasic::doAnalysisMetrics(std::string baseline, std
std::ifstream target_is(target.c_str());
if (!base_is.is_open() || !target_is.is_open())
{
- llwarns << "'-analyzeperformance' error : baseline or current target file inexistent" << llendl;
+ LL_WARNS() << "'-analyzeperformance' error : baseline or current target file inexistent" << LL_ENDL;
base_is.close();
target_is.close();
return;
@@ -176,7 +176,7 @@ LLMetricPerformanceTesterBasic::LLMetricPerformanceTesterBasic(std::string name)
{
if (mName == std::string())
{
- llerrs << "LLMetricPerformanceTesterBasic construction invalid : Empty name passed to constructor" << llendl ;
+ LL_ERRS() << "LLMetricPerformanceTesterBasic construction invalid : Empty name passed to constructor" << LL_ENDL ;
}
mValidInstance = LLMetricPerformanceTesterBasic::addTester(this) ;
@@ -194,8 +194,7 @@ void LLMetricPerformanceTesterBasic::preOutputTestResults(LLSD* sd)
void LLMetricPerformanceTesterBasic::postOutputTestResults(LLSD* sd)
{
- LLMutexLock lock(LLFastTimer::sLogLock);
- LLFastTimer::sLogQueue.push((*sd));
+ LLTrace::BlockTimer::pushLog(*sd);
}
void LLMetricPerformanceTesterBasic::outputTestResults()
@@ -242,7 +241,7 @@ void LLMetricPerformanceTesterBasic::analyzePerformance(std::ofstream* os, LLSD*
(F32)((*base)[label][ mMetricStrings[index] ].asReal()), (F32)((*current)[label][ mMetricStrings[index] ].asReal())) ;
break;
default:
- llerrs << "unsupported metric " << mMetricStrings[index] << " LLSD type: " << (S32)(*current)[label][ mMetricStrings[index] ].type() << llendl ;
+ LL_ERRS() << "unsupported metric " << mMetricStrings[index] << " LLSD type: " << (S32)(*current)[label][ mMetricStrings[index] ].type() << LL_ENDL ;
}
}
}
@@ -306,7 +305,7 @@ void LLMetricPerformanceTesterWithSession::analyzePerformance(std::ofstream* os,
if (!mBaseSessionp || !mCurrentSessionp)
{
- llerrs << "Error loading test sessions." << llendl ;
+ LL_ERRS() << "Error loading test sessions." << LL_ENDL ;
}
// Compare
diff --git a/indra/llcommon/llmetrics.cpp b/indra/llcommon/llmetrics.cpp
index 3078139f43..d40afe5160 100755
--- a/indra/llcommon/llmetrics.cpp
+++ b/indra/llcommon/llmetrics.cpp
@@ -65,7 +65,7 @@ void LLMetricsImpl::recordEventDetails(const std::string& location,
metrics["location"] = location;
metrics["stats"] = stats;
- llinfos << "LLMETRICS: " << (LLSDNotationStreamer(metrics)) << llendl;
+ LL_INFOS() << "LLMETRICS: " << (LLSDNotationStreamer(metrics)) << LL_ENDL;
}
// Store this:
@@ -128,7 +128,7 @@ void LLMetricsImpl::printTotals(LLSD metadata)
out_sd["stats"] = stats;
- llinfos << "LLMETRICS: AGGREGATE: " << LLSDOStreamer<LLSDNotationFormatter>(out_sd) << llendl;
+ LL_INFOS() << "LLMETRICS: AGGREGATE: " << LLSDOStreamer<LLSDNotationFormatter>(out_sd) << LL_ENDL;
}
LLMetrics::LLMetrics()
diff --git a/indra/llcommon/llmetrics.h b/indra/llcommon/llmetrics.h
index 4f0ae56338..85a6986049 100755
--- a/indra/llcommon/llmetrics.h
+++ b/indra/llcommon/llmetrics.h
@@ -38,7 +38,7 @@ public:
LLMetrics();
virtual ~LLMetrics();
- // Adds this event to aggregate totals and records details to syslog (llinfos)
+ // Adds this event to aggregate totals and records details to syslog (LL_INFOS())
virtual void recordEventDetails(const std::string& location,
const std::string& mesg,
bool success,
diff --git a/indra/llcommon/llmortician.h b/indra/llcommon/llmortician.h
index 319955ef93..9517e2db5e 100755
--- a/indra/llcommon/llmortician.h
+++ b/indra/llcommon/llmortician.h
@@ -28,6 +28,7 @@
#define LLMORTICIAN_H
#include "stdtypes.h"
+#include <list>
class LL_COMMON_API LLMortician
{
diff --git a/indra/llcommon/llmutex.cpp b/indra/llcommon/llmutex.cpp
new file mode 100644
index 0000000000..9c13ef9e30
--- /dev/null
+++ b/indra/llcommon/llmutex.cpp
@@ -0,0 +1,205 @@
+/**
+ * @file llmutex.cpp
+ *
+ * $LicenseInfo:firstyear=2004&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "linden_common.h"
+#include "llapr.h"
+
+#include "apr_portable.h"
+
+#include "llmutex.h"
+#include "llthread.h"
+
+//============================================================================
+
+LLMutex::LLMutex(apr_pool_t *poolp) :
+ mAPRMutexp(NULL), mCount(0), mLockingThread(NO_THREAD)
+{
+ //if (poolp)
+ //{
+ // mIsLocalPool = FALSE;
+ // mAPRPoolp = poolp;
+ //}
+ //else
+ {
+ mIsLocalPool = TRUE;
+ apr_pool_create(&mAPRPoolp, NULL); // Create a subpool for this thread
+ }
+ apr_thread_mutex_create(&mAPRMutexp, APR_THREAD_MUTEX_UNNESTED, mAPRPoolp);
+}
+
+
+LLMutex::~LLMutex()
+{
+#if MUTEX_DEBUG
+ //bad assertion, the subclass LLSignal might be "locked", and that's OK
+ //llassert_always(!isLocked()); // better not be locked!
+#endif
+ if (ll_apr_is_initialized())
+ {
+ apr_thread_mutex_destroy(mAPRMutexp);
+ if (mIsLocalPool)
+ {
+ apr_pool_destroy(mAPRPoolp);
+ }
+ }
+ mAPRMutexp = NULL;
+}
+
+
+void LLMutex::lock()
+{
+ if(isSelfLocked())
+ { //redundant lock
+ mCount++;
+ return;
+ }
+
+ apr_thread_mutex_lock(mAPRMutexp);
+
+#if MUTEX_DEBUG
+ // Have to have the lock before we can access the debug info
+ U32 id = LLThread::currentID();
+ if (mIsLocked[id] != FALSE)
+ LL_ERRS() << "Already locked in Thread: " << id << LL_ENDL;
+ mIsLocked[id] = TRUE;
+#endif
+
+ mLockingThread = LLThread::currentID();
+}
+
+void LLMutex::unlock()
+{
+ if (mCount > 0)
+ { //not the root unlock
+ mCount--;
+ return;
+ }
+
+#if MUTEX_DEBUG
+ // Access the debug info while we have the lock
+ U32 id = LLThread::currentID();
+ if (mIsLocked[id] != TRUE)
+ LL_ERRS() << "Not locked in Thread: " << id << LL_ENDL;
+ mIsLocked[id] = FALSE;
+#endif
+
+ mLockingThread = NO_THREAD;
+ apr_thread_mutex_unlock(mAPRMutexp);
+}
+
+bool LLMutex::isLocked()
+{
+ apr_status_t status = apr_thread_mutex_trylock(mAPRMutexp);
+ if (APR_STATUS_IS_EBUSY(status))
+ {
+ return true;
+ }
+ else
+ {
+ apr_thread_mutex_unlock(mAPRMutexp);
+ return false;
+ }
+}
+
+bool LLMutex::isSelfLocked()
+{
+ return mLockingThread == LLThread::currentID();
+}
+
+U32 LLMutex::lockingThread() const
+{
+ return mLockingThread;
+}
+
+bool LLMutex::trylock()
+{
+ if(isSelfLocked())
+ { //redundant lock
+ mCount++;
+ return true;
+ }
+
+ apr_status_t status(apr_thread_mutex_trylock(mAPRMutexp));
+ if (APR_STATUS_IS_EBUSY(status))
+ {
+ return false;
+ }
+
+#if MUTEX_DEBUG
+ // Have to have the lock before we can access the debug info
+ U32 id = LLThread::currentID();
+ if (mIsLocked[id] != FALSE)
+ LL_ERRS() << "Already locked in Thread: " << id << LL_ENDL;
+ mIsLocked[id] = TRUE;
+#endif
+
+ mLockingThread = LLThread::currentID();
+ return true;
+}
+
+//============================================================================
+
+LLCondition::LLCondition(apr_pool_t *poolp) :
+ LLMutex(poolp)
+{
+ // base class (LLMutex) has already ensured that mAPRPoolp is set up.
+
+ apr_thread_cond_create(&mAPRCondp, mAPRPoolp);
+}
+
+
+LLCondition::~LLCondition()
+{
+ apr_thread_cond_destroy(mAPRCondp);
+ mAPRCondp = NULL;
+}
+
+
+void LLCondition::wait()
+{
+ if (!isLocked())
+ { //mAPRMutexp MUST be locked before calling apr_thread_cond_wait
+ apr_thread_mutex_lock(mAPRMutexp);
+#if MUTEX_DEBUG
+ // avoid asserts on destruction in non-release builds
+ U32 id = LLThread::currentID();
+ mIsLocked[id] = TRUE;
+#endif
+ }
+ apr_thread_cond_wait(mAPRCondp, mAPRMutexp);
+}
+
+void LLCondition::signal()
+{
+ apr_thread_cond_signal(mAPRCondp);
+}
+
+void LLCondition::broadcast()
+{
+ apr_thread_cond_broadcast(mAPRCondp);
+}
+
+
+//============================================================================
diff --git a/indra/llcommon/llmutex.h b/indra/llcommon/llmutex.h
new file mode 100644
index 0000000000..3659a319a2
--- /dev/null
+++ b/indra/llcommon/llmutex.h
@@ -0,0 +1,141 @@
+/**
+ * @file llmutex.h
+ * @brief Base classes for mutex and condition handling.
+ *
+ * $LicenseInfo:firstyear=2004&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2012, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLMUTEX_H
+#define LL_LLMUTEX_H
+
+#include "stdtypes.h"
+
+//============================================================================
+
+#define MUTEX_DEBUG (LL_DEBUG || LL_RELEASE_WITH_DEBUG_INFO)
+
+struct apr_thread_mutex_t;
+struct apr_pool_t;
+struct apr_thread_cond_t;
+
+class LL_COMMON_API LLMutex
+{
+public:
+ typedef enum
+ {
+ NO_THREAD = 0xFFFFFFFF
+ } e_locking_thread;
+
+ LLMutex(apr_pool_t *apr_poolp = NULL); // NULL pool constructs a new pool for the mutex
+ virtual ~LLMutex();
+
+ void lock(); // blocks
+ bool trylock(); // non-blocking, returns true if lock held.
+ void unlock(); // undefined behavior when called on mutex not being held
+ bool isLocked(); // non-blocking, but does do a lock/unlock so not free
+ bool isSelfLocked(); //return true if locked in a same thread
+ U32 lockingThread() const; //get ID of locking thread
+
+protected:
+ apr_thread_mutex_t *mAPRMutexp;
+ mutable U32 mCount;
+ mutable U32 mLockingThread;
+
+ apr_pool_t *mAPRPoolp;
+ BOOL mIsLocalPool;
+
+#if MUTEX_DEBUG
+ std::map<U32, BOOL> mIsLocked;
+#endif
+};
+
+// Actually a condition/mutex pair (since each condition needs to be associated with a mutex).
+class LL_COMMON_API LLCondition : public LLMutex
+{
+public:
+ LLCondition(apr_pool_t* apr_poolp); // Defaults to global pool, could use the thread pool as well.
+ ~LLCondition();
+
+ void wait(); // blocks
+ void signal();
+ void broadcast();
+
+protected:
+ apr_thread_cond_t* mAPRCondp;
+};
+
+class LLMutexLock
+{
+public:
+ LLMutexLock(LLMutex* mutex)
+ {
+ mMutex = mutex;
+
+ if(mMutex)
+ mMutex->lock();
+ }
+ ~LLMutexLock()
+ {
+ if(mMutex)
+ mMutex->unlock();
+ }
+private:
+ LLMutex* mMutex;
+};
+
+//============================================================================
+
+// Scoped locking class similar in function to LLMutexLock but uses
+// the trylock() method to conditionally acquire lock without
+// blocking. Caller resolves the resulting condition by calling
+// the isLocked() method and either punts or continues as indicated.
+//
+// Mostly of interest to callers needing to avoid stalls who can
+// guarantee another attempt at a later time.
+
+class LLMutexTrylock
+{
+public:
+ LLMutexTrylock(LLMutex* mutex)
+ : mMutex(mutex),
+ mLocked(false)
+ {
+ if (mMutex)
+ mLocked = mMutex->trylock();
+ }
+
+ ~LLMutexTrylock()
+ {
+ if (mMutex && mLocked)
+ mMutex->unlock();
+ }
+
+ bool isLocked() const
+ {
+ return mLocked;
+ }
+
+private:
+ LLMutex* mMutex;
+ bool mLocked;
+};
+#endif // LL_LLTHREAD_H
diff --git a/indra/llcommon/llnametable.h b/indra/llcommon/llnametable.h
index d3283543f3..d3283543f3 100755..100644
--- a/indra/llcommon/llnametable.h
+++ b/indra/llcommon/llnametable.h
diff --git a/indra/llcommon/llpointer.h b/indra/llcommon/llpointer.h
index 88c09c8dca..9a6453ea48 100755
--- a/indra/llcommon/llpointer.h
+++ b/indra/llcommon/llpointer.h
@@ -27,6 +27,7 @@
#define LLPOINTER_H
#include "llerror.h" // *TODO: consider eliminating this
+#include "llmutex.h"
//----------------------------------------------------------------------------
// RefCount objects should generally only be accessed by way of LLPointer<>'s
@@ -97,6 +98,126 @@ public:
LLPointer<Type>& operator =(Type* ptr)
{
+ assign(ptr);
+ return *this;
+ }
+
+ LLPointer<Type>& operator =(const LLPointer<Type>& ptr)
+ {
+ assign(ptr);
+ return *this;
+ }
+
+ // support assignment up the type hierarchy. See Item 45 in Effective C++, 3rd Ed.
+ template<typename Subclass>
+ LLPointer<Type>& operator =(const LLPointer<Subclass>& ptr)
+ {
+ assign(ptr.get());
+ return *this;
+ }
+
+ // Just exchange the pointers, which will not change the reference counts.
+ static void swap(LLPointer<Type>& a, LLPointer<Type>& b)
+ {
+ Type* temp = a.mPointer;
+ a.mPointer = b.mPointer;
+ b.mPointer = temp;
+ }
+
+protected:
+#ifdef LL_LIBRARY_INCLUDE
+ void ref();
+ void unref();
+#else
+
+ void assign(const LLPointer<Type>& ptr)
+ {
+ if( mPointer != ptr.mPointer )
+ {
+ unref();
+ mPointer = ptr.mPointer;
+ ref();
+ }
+ }
+ void ref()
+ {
+ if (mPointer)
+ {
+ mPointer->ref();
+ }
+ }
+
+ void unref()
+ {
+ if (mPointer)
+ {
+ Type *temp = mPointer;
+ mPointer = NULL;
+ temp->unref();
+ if (mPointer != NULL)
+ {
+ LL_WARNS() << "Unreference did assignment to non-NULL because of destructor" << LL_ENDL;
+ unref();
+ }
+ }
+ }
+#endif
+protected:
+ Type* mPointer;
+};
+
+template <class Type> class LLConstPointer
+{
+public:
+ LLConstPointer() :
+ mPointer(NULL)
+ {
+ }
+
+ LLConstPointer(const Type* ptr) :
+ mPointer(ptr)
+ {
+ ref();
+ }
+
+ LLConstPointer(const LLConstPointer<Type>& ptr) :
+ mPointer(ptr.mPointer)
+ {
+ ref();
+ }
+
+ // support conversion up the type hierarchy. See Item 45 in Effective C++, 3rd Ed.
+ template<typename Subclass>
+ LLConstPointer(const LLConstPointer<Subclass>& ptr) :
+ mPointer(ptr.get())
+ {
+ ref();
+ }
+
+ ~LLConstPointer()
+ {
+ unref();
+ }
+
+ const Type* get() const { return mPointer; }
+ const Type* operator->() const { return mPointer; }
+ const Type& operator*() const { return *mPointer; }
+
+ operator BOOL() const { return (mPointer != NULL); }
+ operator bool() const { return (mPointer != NULL); }
+ bool operator!() const { return (mPointer == NULL); }
+ bool isNull() const { return (mPointer == NULL); }
+ bool notNull() const { return (mPointer != NULL); }
+
+ operator const Type*() const { return mPointer; }
+ bool operator !=(const Type* ptr) const { return (mPointer != ptr); }
+ bool operator ==(const Type* ptr) const { return (mPointer == ptr); }
+ bool operator ==(const LLConstPointer<Type>& ptr) const { return (mPointer == ptr.mPointer); }
+ bool operator < (const LLConstPointer<Type>& ptr) const { return (mPointer < ptr.mPointer); }
+ bool operator > (const LLConstPointer<Type>& ptr) const { return (mPointer > ptr.mPointer); }
+
+ LLConstPointer<Type>& operator =(const Type* ptr)
+ {
if( mPointer != ptr )
{
unref();
@@ -107,7 +228,7 @@ public:
return *this;
}
- LLPointer<Type>& operator =(const LLPointer<Type>& ptr)
+ LLConstPointer<Type>& operator =(const LLConstPointer<Type>& ptr)
{
if( mPointer != ptr.mPointer )
{
@@ -120,7 +241,7 @@ public:
// support assignment up the type hierarchy. See Item 45 in Effective C++, 3rd Ed.
template<typename Subclass>
- LLPointer<Type>& operator =(const LLPointer<Subclass>& ptr)
+ LLConstPointer<Type>& operator =(const LLConstPointer<Subclass>& ptr)
{
if( mPointer != ptr.get() )
{
@@ -132,9 +253,9 @@ public:
}
// Just exchange the pointers, which will not change the reference counts.
- static void swap(LLPointer<Type>& a, LLPointer<Type>& b)
+ static void swap(LLConstPointer<Type>& a, LLConstPointer<Type>& b)
{
- Type* temp = a.mPointer;
+ const Type* temp = a.mPointer;
a.mPointer = b.mPointer;
b.mPointer = temp;
}
@@ -156,19 +277,67 @@ protected:
{
if (mPointer)
{
- Type *tempp = mPointer;
+ const Type *tempp = mPointer;
mPointer = NULL;
tempp->unref();
if (mPointer != NULL)
{
- llwarns << "Unreference did assignment to non-NULL because of destructor" << llendl;
+ LL_WARNS() << "Unreference did assignment to non-NULL because of destructor" << LL_ENDL;
unref();
}
}
}
#endif
protected:
- Type* mPointer;
+ const Type* mPointer;
+};
+
+template<typename Type>
+class LLCopyOnWritePointer : public LLPointer<Type>
+{
+public:
+ typedef LLCopyOnWritePointer<Type> self_t;
+ typedef LLPointer<Type> pointer_t;
+
+ LLCopyOnWritePointer()
+ : mStayUnique(false)
+ {}
+
+ LLCopyOnWritePointer(Type* ptr)
+ : LLPointer<Type>(ptr),
+ mStayUnique(false)
+ {}
+
+ LLCopyOnWritePointer(LLPointer<Type>& ptr)
+ : LLPointer<Type>(ptr),
+ mStayUnique(false)
+ {
+ if (ptr.mForceUnique)
+ {
+ makeUnique();
+ }
+ }
+
+ Type* write()
+ {
+ makeUnique();
+ return pointer_t::mPointer;
+ }
+
+ void makeUnique()
+ {
+ if (pointer_t::notNull() && pointer_t::mPointer->getNumRefs() > 1)
+ {
+ *(pointer_t* )(this) = new Type(*pointer_t::mPointer);
+ }
+ }
+
+ const Type* operator->() const { return pointer_t::mPointer; }
+ const Type& operator*() const { return *pointer_t::mPointer; }
+
+ void setStayUnique(bool stay) { makeUnique(); mStayUnique = stay; }
+private:
+ bool mStayUnique;
};
#endif
diff --git a/indra/llui/llfunctorregistry.cpp b/indra/llcommon/llpredicate.cpp
index 8003324973..1278948e24 100755..100644
--- a/indra/llui/llfunctorregistry.cpp
+++ b/indra/llcommon/llpredicate.cpp
@@ -1,7 +1,6 @@
-/**
- * @file llfunctorregistry.cpp
- * @author Kent Quirk
- * @brief Maintains a registry of named callback functors taking a single LLSD parameter
+/**
+ * @file llpredicate.cpp
+ * @brief abstraction for filtering objects by predicates, with arbitrary boolean expressions
*
* $LicenseInfo:firstyear=2008&license=viewerlgpl$
* Second Life Viewer Source Code
@@ -23,11 +22,20 @@
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
- **/
-
+ */
#include "linden_common.h"
-#include "llfunctorregistry.h"
-// This is a default functor always resident in the system.
-// It's used whenever a functor isn't found in the registry, so that
-// we at least log the data relating to the user response.
+#include "llpredicate.h"
+
+namespace LLPredicate
+{
+ const U32 cPredicateFlagsFromEnum[5] =
+ {
+ 0xAAAAaaaa, // 10101010101010101010101010101010
+ 0xCCCCcccc, // 11001100110011001100110011001100
+ 0xF0F0F0F0, // 11110000111100001111000011110000
+ 0xFF00FF00, // 11111111000000001111111100000000
+ 0xFFFF0000 // 11111111111111110000000000000000
+ };
+}
+
diff --git a/indra/llcommon/llpredicate.h b/indra/llcommon/llpredicate.h
new file mode 100644
index 0000000000..a0e970a799
--- /dev/null
+++ b/indra/llcommon/llpredicate.h
@@ -0,0 +1,210 @@
+/**
+ * @file llpredicate.h
+ * @brief abstraction for filtering objects by predicates, with arbitrary boolean expressions
+ *
+ * $LicenseInfo:firstyear=2008&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLPREDICATE_H
+#define LL_LLPREDICATE_H
+
+#include "llerror.h"
+
+namespace LLPredicate
+{
+ template<typename ENUM> class Rule;
+
+ extern const U32 cPredicateFlagsFromEnum[5];
+
+ template<typename ENUM>
+ class Value
+ {
+ public:
+ typedef U32 predicate_flag_t;
+ static const S32 cMaxEnum = 5;
+
+ Value(ENUM e, bool predicate_value = true)
+ : mPredicateFlags(predicate_value ? cPredicateFlagsFromEnum[e] : ~cPredicateFlagsFromEnum[e])
+ {
+ llassert(0 <= e && e < cMaxEnum);
+ }
+
+ Value()
+ : mPredicateFlags(0xFFFFffff)
+ {}
+
+ Value operator!() const
+ {
+ Value new_value;
+ new_value.mPredicateFlags = ~mPredicateFlags;
+ return new_value;
+ }
+
+ Value operator &&(const Value other) const
+ {
+ Value new_value;
+ new_value.mPredicateFlags = mPredicateFlags & other.mPredicateFlags;
+ return new_value;
+ }
+
+ Value operator ||(const Value other) const
+ {
+ Value new_value;
+ new_value.mPredicateFlags = mPredicateFlags | other.mPredicateFlags;
+ return new_value;
+ }
+
+ void set(ENUM e, bool value = true)
+ {
+ llassert(0 <= e && e < cMaxEnum);
+ predicate_flag_t flags_to_modify;
+ predicate_flag_t mask = cPredicateFlagsFromEnum[e];
+ if (value)
+ { // add predicate "e" to flags that don't contain it already
+ flags_to_modify = (mPredicateFlags & ~mask);
+ // clear flags not containing e
+ mPredicateFlags &= mask;
+ // add back flags shifted to contain e
+ mPredicateFlags |= flags_to_modify << (0x1 << e);
+ }
+ else
+ { // remove predicate "e" from flags that contain it
+ flags_to_modify = (mPredicateFlags & mask);
+ // clear flags containing e
+ mPredicateFlags &= ~mask;
+ // add back flags shifted to not contain e
+ mPredicateFlags |= flags_to_modify >> (0x1 << e);
+ }
+ }
+
+ void forget(ENUM e)
+ {
+ set(e, true);
+ U32 flags_with_predicate = mPredicateFlags;
+ set(e, false);
+ // ambiguous value is result of adding and removing predicate at the same time!
+ mPredicateFlags |= flags_with_predicate;
+ }
+
+ bool allSet() const
+ {
+ return mPredicateFlags == ~0;
+ }
+
+ bool noneSet() const
+ {
+ return mPredicateFlags == 0;
+ }
+
+ bool someSet() const
+ {
+ return mPredicateFlags != 0;
+ }
+
+ private:
+ predicate_flag_t mPredicateFlags;
+ };
+
+ template<typename ENUM>
+ class Rule
+ {
+ public:
+ Rule(ENUM value)
+ : mRule(value)
+ {}
+
+ Rule(const Value<ENUM> other)
+ : mRule(other)
+ {}
+
+ Rule()
+ {}
+
+ void require(ENUM e)
+ {
+ mRule.set(e, require);
+ }
+
+ void allow(ENUM e)
+ {
+ mRule.forget(e);
+ }
+
+ bool check(const Value<ENUM> value) const
+ {
+ return (mRule && value).someSet();
+ }
+
+ bool requires(const Value<ENUM> value) const
+ {
+ return (mRule && value).someSet() && (!mRule && value).noneSet();
+ }
+
+ bool isAmbivalent(const Value<ENUM> value) const
+ {
+ return (mRule && value).someSet() && (!mRule && value).someSet();
+ }
+
+ bool acceptsAll() const
+ {
+ return mRule.allSet();
+ }
+
+ bool acceptsNone() const
+ {
+ return mRule.noneSet();
+ }
+
+ Rule operator!() const
+ {
+ Rule new_rule;
+ new_rule.mRule = !mRule;
+ return new_rule;
+ }
+
+ Rule operator &&(const Rule other) const
+ {
+ Rule new_rule;
+ new_rule.mRule = mRule && other.mRule;
+ return new_rule;
+ }
+
+ Rule operator ||(const Rule other) const
+ {
+ Rule new_rule;
+ new_rule.mRule = mRule || other.mRule;
+ return new_rule;
+ }
+
+ private:
+ Value<ENUM> mRule;
+ };
+}
+
+template<typename ENUM>
+LLPredicate::Value<ENUM> ll_make_predicate(ENUM e, bool predicate_value = true)
+{
+ return LLPredicate::Value<ENUM>(e, predicate_value);
+}
+
+
+#endif // LL_LLPREDICATE_H
diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h
index 7fdb537ab5..309165da7f 100755
--- a/indra/llcommon/llpreprocessor.h
+++ b/indra/llcommon/llpreprocessor.h
@@ -181,4 +181,25 @@
# define LL_COMMON_API
#endif // LL_COMMON_LINK_SHARED
+#if LL_WINDOWS
+#define LL_TYPEOF(exp) decltype(exp)
+#elif LL_LINUX
+#define LL_TYPEOF(exp) typeof(exp)
+#elif LL_DARWIN
+#define LL_TYPEOF(exp) typeof(exp)
+#endif
+
+#define LL_TO_STRING_HELPER(x) #x
+#define LL_TO_STRING(x) LL_TO_STRING_HELPER(x)
+#define LL_FILE_LINENO_MSG(msg) __FILE__ "(" LL_TO_STRING(__LINE__) ") : " msg
+#define LL_GLUE_IMPL(x, y) x##y
+#define LL_GLUE_TOKENS(x, y) LL_GLUE_IMPL(x, y)
+
+#if LL_WINDOWS
+#define LL_COMPILE_TIME_MESSAGE(msg) __pragma(message(LL_FILE_LINENO_MSG(msg)))
+#else
+// no way to get gcc 4.2 to print a user-defined diagnostic message only when a macro is used
+#define LL_COMPILE_TIME_MESSAGE(msg)
+#endif
+
#endif // not LL_LINDEN_PREPROCESSOR_H
diff --git a/indra/llcommon/llpriqueuemap.h b/indra/llcommon/llpriqueuemap.h
index da997c7b04..d8d3edd48a 100755
--- a/indra/llcommon/llpriqueuemap.h
+++ b/indra/llcommon/llpriqueuemap.h
@@ -84,7 +84,7 @@ public:
pqm_iter iter = mMap.find(LLPQMKey<DATA_TYPE>(priority, data));
if (iter != mMap.end())
{
- llerrs << "Pushing already existing data onto queue!" << llendl;
+ LL_ERRS() << "Pushing already existing data onto queue!" << LL_ENDL;
}
#endif
mMap.insert(pqm_pair(LLPQMKey<DATA_TYPE>(priority, data), data));
@@ -112,14 +112,14 @@ public:
iter = mMap.find(cur_key);
if (iter == mMap.end())
{
- llwarns << "Data not on priority queue!" << llendl;
+ LL_WARNS() << "Data not on priority queue!" << LL_ENDL;
// OK, try iterating through all of the data and seeing if we just screwed up the priority
// somehow.
for (iter = mMap.begin(); iter != mMap.end(); iter++)
{
if ((*(iter)).second == data)
{
- llerrs << "Data on priority queue but priority not matched!" << llendl;
+ LL_ERRS() << "Data on priority queue but priority not matched!" << LL_ENDL;
}
}
return;
diff --git a/indra/llcommon/llprocess.h b/indra/llcommon/llprocess.h
index d711ce2f74..43ccadc412 100755
--- a/indra/llcommon/llprocess.h
+++ b/indra/llcommon/llprocess.h
@@ -29,6 +29,7 @@
#include "llinitparam.h"
#include "llsdparam.h"
+#include "llwin32headerslean.h"
#include "apr_thread_proc.h"
#include <boost/shared_ptr.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
@@ -38,8 +39,7 @@
#include <stdexcept>
#if LL_WINDOWS
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h> // HANDLE (eye roll)
+#include "llwin32headerslean.h" // for HANDLE
#elif LL_LINUX
#if defined(Status)
#undef Status
diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp
index fd8f603d21..69043dc173 100755
--- a/indra/llcommon/llprocessor.cpp
+++ b/indra/llcommon/llprocessor.cpp
@@ -32,9 +32,7 @@
//#include <memory>
#if LL_WINDOWS
-# define WIN32_LEAN_AND_MEAN
-# include <winsock2.h>
-# include <windows.h>
+# include "llwin32headerslean.h"
# define _interlockedbittestandset _renamed_interlockedbittestandset
# define _interlockedbittestandreset _renamed_interlockedbittestandreset
# include <intrin.h>
@@ -702,7 +700,7 @@ private:
__cpuid(0x1, eax, ebx, ecx, edx);
if(feature_infos[0] != (S32)edx)
{
- llerrs << "machdep.cpu.feature_bits doesn't match expected cpuid result!" << llendl;
+ LL_ERRS() << "machdep.cpu.feature_bits doesn't match expected cpuid result!" << LL_ENDL;
}
#endif // LL_RELEASE_FOR_DOWNLOAD
@@ -877,7 +875,7 @@ LLProcessorInfo::LLProcessorInfo() : mImpl(NULL)
LLProcessorInfo::~LLProcessorInfo() {}
-F64 LLProcessorInfo::getCPUFrequency() const { return mImpl->getCPUFrequency(); }
+F64MegahertzImplicit LLProcessorInfo::getCPUFrequency() const { return mImpl->getCPUFrequency(); }
bool LLProcessorInfo::hasSSE() const { return mImpl->hasSSE(); }
bool LLProcessorInfo::hasSSE2() const { return mImpl->hasSSE2(); }
bool LLProcessorInfo::hasAltivec() const { return mImpl->hasAltivec(); }
diff --git a/indra/llcommon/llprocessor.h b/indra/llcommon/llprocessor.h
index 6364d3c8bb..90e5bc59ee 100755
--- a/indra/llcommon/llprocessor.h
+++ b/indra/llcommon/llprocessor.h
@@ -27,6 +27,8 @@
#ifndef LLPROCESSOR_H
#define LLPROCESSOR_H
+#include "llunits.h"
+
class LLProcessorInfoImpl;
class LL_COMMON_API LLProcessorInfo
@@ -35,7 +37,7 @@ public:
LLProcessorInfo();
~LLProcessorInfo();
- F64 getCPUFrequency() const;
+ F64MegahertzImplicit getCPUFrequency() const;
bool hasSSE() const;
bool hasSSE2() const;
bool hasAltivec() const;
diff --git a/indra/llcommon/llptrskiplist.h b/indra/llcommon/llptrskiplist.h
deleted file mode 100755
index 67c7cde352..0000000000
--- a/indra/llcommon/llptrskiplist.h
+++ /dev/null
@@ -1,724 +0,0 @@
-/**
- * @file llptrskiplist.h
- * @brief Skip list implementation.
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLPTRSKIPLIST_H
-#define LL_LLPTRSKIPLIST_H
-
-#include "llerror.h"
-#include "llrand.h"
-//#include "vmath.h"
-#include "llrand.h"
-
-/////////////////////////////////////////////
-//
-// LLPtrSkipList implementation - skip list for pointers to objects
-//
-
-template <class DATA_TYPE, S32 BINARY_DEPTH = 8>
-class LLPtrSkipList
-{
-public:
- friend class LLPtrSkipNode;
-
- // basic constructor
- LLPtrSkipList();
- // basic constructor including sorter
- LLPtrSkipList(BOOL (*insert_first)(DATA_TYPE *first, DATA_TYPE *second),
- BOOL (*equals)(DATA_TYPE *first, DATA_TYPE *second));
- ~LLPtrSkipList();
-
- inline void setInsertFirst(BOOL (*insert_first)(const DATA_TYPE *first, const DATA_TYPE *second));
- inline void setEquals(BOOL (*equals)(const DATA_TYPE *first, const DATA_TYPE *second));
-
- inline BOOL addData(DATA_TYPE *data);
-
- inline BOOL checkData(const DATA_TYPE *data);
-
- inline S32 getLength(); // returns number of items in the list - NOT constant time!
-
- inline BOOL removeData(const DATA_TYPE *data);
-
- // note that b_sort is ignored
- inline BOOL moveData(const DATA_TYPE *data, LLPtrSkipList *newlist, BOOL b_sort);
-
- inline BOOL moveCurrentData(LLPtrSkipList *newlist, BOOL b_sort);
-
- // resort -- use when the value we're sorting by changes
- /* IW 12/6/02 - This doesn't work!
- Instead, remove the data BEFORE you change it
- Then re-insert it after you change it
- BOOL resortData(DATA_TYPE *data)
- */
-
- // remove all nodes from the list but do not delete data
- inline void removeAllNodes();
-
- inline BOOL deleteData(const DATA_TYPE *data);
-
- // remove all nodes from the list and delete data
- inline void deleteAllData();
-
- // place mCurrentp on first node
- inline void resetList();
-
- // return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
- inline DATA_TYPE *getCurrentData();
-
- // same as getCurrentData() but a more intuitive name for the operation
- inline DATA_TYPE *getNextData();
-
- // remove the Node at mCurentOperatingp
- // leave mCurrentp and mCurentOperatingp on the next entry
- inline void removeCurrentData();
-
- // delete the Node at mCurentOperatingp
- // leave mCurrentp and mCurentOperatingp on the next entry
- inline void deleteCurrentData();
-
- // reset the list and return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
- inline DATA_TYPE *getFirstData();
-
- // TRUE if nodes are not in sorted order
- inline BOOL corrupt();
-
-protected:
- class LLPtrSkipNode
- {
- public:
- LLPtrSkipNode()
- : mData(NULL)
- {
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mForward[i] = NULL;
- }
- }
-
- LLPtrSkipNode(DATA_TYPE *data)
- : mData(data)
- {
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mForward[i] = NULL;
- }
- }
-
- ~LLPtrSkipNode()
- {
- if (mData)
- {
- llerror("Attempting to call LLPtrSkipNode destructor with a non-null mDatap!", 1);
- }
- }
-
- // delete associated data and NULLs out pointer
- void deleteData()
- {
- delete mData;
- mData = NULL;
- }
-
- // NULLs out pointer
- void removeData()
- {
- mData = NULL;
- }
-
- DATA_TYPE *mData;
- LLPtrSkipNode *mForward[BINARY_DEPTH];
- };
-
- static BOOL defaultEquals(const DATA_TYPE *first, const DATA_TYPE *second)
- {
- return first == second;
- }
-
-
- LLPtrSkipNode mHead;
- LLPtrSkipNode *mUpdate[BINARY_DEPTH];
- LLPtrSkipNode *mCurrentp;
- LLPtrSkipNode *mCurrentOperatingp;
- S32 mLevel;
- BOOL (*mInsertFirst)(const DATA_TYPE *first, const DATA_TYPE *second);
- BOOL (*mEquals)(const DATA_TYPE *first, const DATA_TYPE *second);
-};
-
-
-// basic constructor
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::LLPtrSkipList()
- : mInsertFirst(NULL), mEquals(defaultEquals)
-{
- if (BINARY_DEPTH < 2)
- {
- llerrs << "Trying to create skip list with too little depth, "
- "must be 2 or greater" << llendl;
- }
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mUpdate[i] = NULL;
- }
- mLevel = 1;
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
-}
-
-// basic constructor including sorter
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::LLPtrSkipList(BOOL (*insert_first)(DATA_TYPE *first, DATA_TYPE *second),
- BOOL (*equals)(DATA_TYPE *first, DATA_TYPE *second))
- :mInsertFirst(insert_first), mEquals(equals)
-{
- if (BINARY_DEPTH < 2)
- {
- llerrs << "Trying to create skip list with too little depth, "
- "must be 2 or greater" << llendl;
- }
- mLevel = 1;
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mHead.mForward[i] = NULL;
- mUpdate[i] = NULL;
- }
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
-}
-
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::~LLPtrSkipList()
-{
- removeAllNodes();
-}
-
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline void LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::setInsertFirst(BOOL (*insert_first)(const DATA_TYPE *first, const DATA_TYPE *second))
-{
- mInsertFirst = insert_first;
-}
-
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline void LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::setEquals(BOOL (*equals)(const DATA_TYPE *first, const DATA_TYPE *second))
-{
- mEquals = equals;
-}
-
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline BOOL LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::addData(DATA_TYPE *data)
-{
- S32 level;
- LLPtrSkipNode *current = &mHead;
- LLPtrSkipNode *temp;
-
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mData, data)))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mData < data))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
-
-
- // we're now just in front of where we want to be . . . take one step forward
- current = *current->mForward;
-
- // now add the new node
- S32 newlevel;
- for (newlevel = 1; newlevel <= mLevel && newlevel < BINARY_DEPTH; newlevel++)
- {
- if (ll_frand() < 0.5f)
- break;
- }
-
- LLPtrSkipNode *snode = new LLPtrSkipNode(data);
-
- if (newlevel > mLevel)
- {
- mHead.mForward[mLevel] = NULL;
- mUpdate[mLevel] = &mHead;
- mLevel = newlevel;
- }
-
- for (level = 0; level < newlevel; level++)
- {
- snode->mForward[level] = mUpdate[level]->mForward[level];
- mUpdate[level]->mForward[level] = snode;
- }
- return TRUE;
-}
-
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline BOOL LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::checkData(const DATA_TYPE *data)
-{
- S32 level;
- LLPtrSkipNode *current = &mHead;
- LLPtrSkipNode *temp;
-
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mData, data)))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mData < data))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
-
-
- // we're now just in front of where we want to be . . . take one step forward
- current = *current->mForward;
-
- if (current)
- {
- return mEquals(current->mData, data);
- }
- else
- {
- return FALSE;
- }
-}
-
-// returns number of items in the list
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline S32 LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::getLength()
-{
- U32 length = 0;
- for (LLPtrSkipNode* temp = *(mHead.mForward); temp != NULL; temp = temp->mForward[0])
- {
- length++;
- }
- return length;
-}
-
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline BOOL LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::removeData(const DATA_TYPE *data)
-{
- S32 level;
- LLPtrSkipNode *current = &mHead;
- LLPtrSkipNode *temp;
-
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mData, data)))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mData < data))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
-
-
- // we're now just in front of where we want to be . . . take one step forward
- current = *current->mForward;
-
- if (!current)
- {
- // empty list or beyond the end!
- return FALSE;
- }
-
- // is this the one we want?
- if (!mEquals(current->mData, data))
- {
- // nope!
- return FALSE;
- }
- else
- {
- // yes it is! change pointers as required
- for (level = 0; level < mLevel; level++)
- {
- if (mUpdate[level]->mForward[level] != current)
- {
- // cool, we've fixed all the pointers!
- break;
- }
- mUpdate[level]->mForward[level] = current->mForward[level];
- }
-
- // clean up cuurent
- current->removeData();
- delete current;
-
- // clean up mHead
- while ( (mLevel > 1)
- &&(!mHead.mForward[mLevel - 1]))
- {
- mLevel--;
- }
- }
- return TRUE;
-}
-
-// note that b_sort is ignored
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline BOOL LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::moveData(const DATA_TYPE *data, LLPtrSkipList *newlist, BOOL b_sort)
-{
- BOOL removed = removeData(data);
- BOOL added = newlist->addData(data);
- return removed && added;
-}
-
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline BOOL LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::moveCurrentData(LLPtrSkipList *newlist, BOOL b_sort)
-{
- if (mCurrentOperatingp)
- {
- mCurrentp = mCurrentOperatingp->mForward[0];
- BOOL removed = removeData(mCurrentOperatingp);
- BOOL added = newlist->addData(mCurrentOperatingp);
- mCurrentOperatingp = mCurrentp;
- return removed && added;
- }
- return FALSE;
-}
-
-// resort -- use when the value we're sorting by changes
-/* IW 12/6/02 - This doesn't work!
- Instead, remove the data BEFORE you change it
- Then re-insert it after you change it
-BOOL resortData(DATA_TYPE *data)
-{
- removeData(data);
- addData(data);
-}
-*/
-
-// remove all nodes from the list but do not delete data
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline void LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::removeAllNodes()
-{
- LLPtrSkipNode *temp;
- // reset mCurrentp
- mCurrentp = *(mHead.mForward);
-
- while (mCurrentp)
- {
- temp = mCurrentp->mForward[0];
- mCurrentp->removeData();
- delete mCurrentp;
- mCurrentp = temp;
- }
-
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mHead.mForward[i] = NULL;
- mUpdate[i] = NULL;
- }
-
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
-}
-
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline BOOL LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::deleteData(const DATA_TYPE *data)
-{
- S32 level;
- LLPtrSkipNode *current = &mHead;
- LLPtrSkipNode *temp;
-
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mData, data)))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mData < data))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
-
-
- // we're now just in front of where we want to be . . . take one step forward
- current = *current->mForward;
-
- if (!current)
- {
- // empty list or beyond the end!
- return FALSE;
- }
-
- // is this the one we want?
- if (!mEquals(current->mData, data))
- {
- // nope!
- return FALSE;
- }
- else
- {
- // do we need to fix current or currentop?
- if (current == mCurrentp)
- {
- mCurrentp = current->mForward[0];
- }
-
- if (current == mCurrentOperatingp)
- {
- mCurrentOperatingp = current->mForward[0];
- }
-
- // yes it is! change pointers as required
- for (level = 0; level < mLevel; level++)
- {
- if (mUpdate[level]->mForward[level] != current)
- {
- // cool, we've fixed all the pointers!
- break;
- }
- mUpdate[level]->mForward[level] = current->mForward[level];
- }
-
- // clean up cuurent
- current->deleteData();
- delete current;
-
- // clean up mHead
- while ( (mLevel > 1)
- &&(!mHead.mForward[mLevel - 1]))
- {
- mLevel--;
- }
- }
- return TRUE;
-}
-
-// remove all nodes from the list and delete data
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline void LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::deleteAllData()
-{
- LLPtrSkipNode *temp;
- // reset mCurrentp
- mCurrentp = *(mHead.mForward);
-
- while (mCurrentp)
- {
- temp = mCurrentp->mForward[0];
- mCurrentp->deleteData();
- delete mCurrentp;
- mCurrentp = temp;
- }
-
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mHead.mForward[i] = NULL;
- mUpdate[i] = NULL;
- }
-
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
-}
-
-// place mCurrentp on first node
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline void LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::resetList()
-{
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
-}
-
-// return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline DATA_TYPE *LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::getCurrentData()
-{
- if (mCurrentp)
- {
- mCurrentOperatingp = mCurrentp;
- mCurrentp = *mCurrentp->mForward;
- return mCurrentOperatingp->mData;
- }
- else
- {
- //return NULL; // causes compile warning
- return 0; // equivalent, but no warning
- }
-}
-
-// same as getCurrentData() but a more intuitive name for the operation
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline DATA_TYPE *LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::getNextData()
-{
- if (mCurrentp)
- {
- mCurrentOperatingp = mCurrentp;
- mCurrentp = *mCurrentp->mForward;
- return mCurrentOperatingp->mData;
- }
- else
- {
- //return NULL; // causes compile warning
- return 0; // equivalent, but no warning
- }
-}
-
-// remove the Node at mCurentOperatingp
-// leave mCurrentp and mCurentOperatingp on the next entry
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline void LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::removeCurrentData()
-{
- if (mCurrentOperatingp)
- {
- removeData(mCurrentOperatingp->mData);
- }
-}
-
-// delete the Node at mCurentOperatingp
-// leave mCurrentp and mCurentOperatingp on the next entry
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline void LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::deleteCurrentData()
-{
- if (mCurrentOperatingp)
- {
- deleteData(mCurrentOperatingp->mData);
- }
-}
-
-// reset the list and return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline DATA_TYPE *LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::getFirstData()
-{
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
- if (mCurrentp)
- {
- mCurrentOperatingp = mCurrentp;
- mCurrentp = mCurrentp->mForward[0];
- return mCurrentOperatingp->mData;
- }
- else
- {
- //return NULL; // causes compile warning
- return 0; // equivalent, but no warning
- }
-}
-
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline BOOL LLPtrSkipList<DATA_TYPE, BINARY_DEPTH>::corrupt()
-{
- LLPtrSkipNode *previous = mHead.mForward[0];
-
- // Empty lists are not corrupt.
- if (!previous) return FALSE;
-
- LLPtrSkipNode *current = previous->mForward[0];
- while(current)
- {
- if (!mInsertFirst(previous->mData, current->mData))
- {
- // prev shouldn't be in front of cur!
- return TRUE;
- }
- current = current->mForward[0];
- }
- return FALSE;
-}
-
-#endif
diff --git a/indra/llcommon/llptrskipmap.h b/indra/llcommon/llptrskipmap.h
deleted file mode 100755
index 94bc71ec55..0000000000
--- a/indra/llcommon/llptrskipmap.h
+++ /dev/null
@@ -1,1239 +0,0 @@
-/**
- * @file llptrskipmap.h
- * @brief Just like a LLSkipMap, but since it's pointers, you can call
- * deleteAllData
- *
- * $LicenseInfo:firstyear=2003&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-#ifndef LL_LLPTRSKIPMAP_H
-#define LL_LLPTRSKIPMAP_H
-
-#include "llerror.h"
-#include "llrand.h"
-
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH = 8>
-class LLPtrSkipMapNode
-{
-public:
- LLPtrSkipMapNode()
- {
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mForward[i] = NULL;
- }
-
- U8 *zero = (U8 *)&mIndex;
-
- for (i = 0; i < (S32)sizeof(INDEX_T); i++)
- {
- *(zero + i) = 0;
- }
-
- zero = (U8 *)&mData;
-
- for (i = 0; i < (S32)sizeof(DATA_T); i++)
- {
- *(zero + i) = 0;
- }
- }
-
- LLPtrSkipMapNode(const INDEX_T &index)
- : mIndex(index)
- {
-
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mForward[i] = NULL;
- }
-
- U8 *zero = (U8 *)&mData;
-
- for (i = 0; i < (S32)sizeof(DATA_T); i++)
- {
- *(zero + i) = 0;
- }
- }
-
- LLPtrSkipMapNode(const INDEX_T &index, DATA_T datap)
- : mIndex(index)
- {
-
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mForward[i] = NULL;
- }
-
- mData = datap;
- }
-
- ~LLPtrSkipMapNode()
- {
- }
-
- // delete associated data and NULLs out pointer
- void deleteData()
- {
- delete mData;
- mData = 0;
- }
-
- // NULLs out pointer
- void removeData()
- {
- mData = 0;
- }
-
- INDEX_T mIndex;
- DATA_T mData;
- LLPtrSkipMapNode *mForward[BINARY_DEPTH];
-
-private:
- // Disallow copying of LLPtrSkipMapNodes by not implementing these methods.
- LLPtrSkipMapNode(const LLPtrSkipMapNode &);
- LLPtrSkipMapNode &operator=(const LLPtrSkipMapNode &rhs);
-};
-
-//---------------------------------------------------------------------------
-
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH = 8>
-class LLPtrSkipMap
-{
-public:
- typedef BOOL (*compare)(const DATA_T& first, const DATA_T& second);
- typedef compare insert_func;
- typedef compare equals_func;
-
- void init();
-
- // basic constructor
- LLPtrSkipMap();
-
- // basic constructor including sorter
- LLPtrSkipMap(insert_func insert_first, equals_func equals);
-
- ~LLPtrSkipMap();
-
- void setInsertFirst(insert_func insert_first);
- void setEquals(equals_func equals);
-
- DATA_T &addData(const INDEX_T &index, DATA_T datap);
- DATA_T &addData(const INDEX_T &index);
- DATA_T &getData(const INDEX_T &index);
- DATA_T &operator[](const INDEX_T &index);
-
- // If index present, returns data.
- // If index not present, adds <index,NULL> and returns NULL.
- DATA_T &getData(const INDEX_T &index, BOOL &b_new_entry);
-
- // returns data entry before and after index
- BOOL getInterval(const INDEX_T &index, INDEX_T &index_before, INDEX_T &index_after,
- DATA_T &data_before, DATA_T &data_after );
-
- // Returns TRUE if data present in map.
- BOOL checkData(const INDEX_T &index);
-
- // Returns TRUE if key is present in map. This is useful if you
- // are potentially storing NULL pointers in the map
- BOOL checkKey(const INDEX_T &index);
-
- // If there, returns the data.
- // If not, returns NULL.
- // Never adds entries to the map.
- DATA_T getIfThere(const INDEX_T &index);
-
- INDEX_T reverseLookup(const DATA_T datap);
-
- // returns number of items in the list
- S32 getLength(); // WARNING! getLength is O(n), not O(1)!
-
- BOOL removeData(const INDEX_T &index);
- BOOL deleteData(const INDEX_T &index);
-
- // remove all nodes from the list but do not delete data
- void removeAllData();
- void deleteAllData();
-
- // place mCurrentp on first node
- void resetList();
-
- // return the data currently pointed to
- DATA_T getCurrentDataWithoutIncrement();
-
- // return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
- DATA_T getCurrentData();
-
- // same as getCurrentData() but a more intuitive name for the operation
- DATA_T getNextData();
-
- INDEX_T getNextKey();
-
- // return the key currently pointed to
- INDEX_T getCurrentKeyWithoutIncrement();
-
- // remove the Node at mCurentOperatingp
- // leave mCurrentp and mCurentOperatingp on the next entry
- void removeCurrentData();
-
- void deleteCurrentData();
-
- // reset the list and return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
- DATA_T getFirstData();
-
- INDEX_T getFirstKey();
-
- static BOOL defaultEquals(const INDEX_T &first, const INDEX_T &second)
- {
- return first == second;
- }
-
-private:
- // don't generate implicit copy constructor or copy assignment
- LLPtrSkipMap(const LLPtrSkipMap &);
- LLPtrSkipMap &operator=(const LLPtrSkipMap &);
-
-private:
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> mHead;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *mUpdate[BINARY_DEPTH];
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *mCurrentp;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *mCurrentOperatingp;
- S32 mLevel;
- BOOL (*mInsertFirst)(const INDEX_T &first, const INDEX_T &second);
- BOOL (*mEquals)(const INDEX_T &first, const INDEX_T &second);
- S32 mNumberOfSteps;
-};
-
-//////////////////////////////////////////////////
-//
-// LLPtrSkipMap implementation
-//
-//
-
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::LLPtrSkipMap()
- : mInsertFirst(NULL),
- mEquals(defaultEquals),
- mNumberOfSteps(0)
-{
- if (BINARY_DEPTH < 2)
- {
- llerrs << "Trying to create skip list with too little depth, "
- "must be 2 or greater" << llendl;
- }
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mUpdate[i] = NULL;
- }
- mLevel = 1;
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
-}
-
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::LLPtrSkipMap(insert_func insert_first,
- equals_func equals)
-: mInsertFirst(insert_first),
- mEquals(equals),
- mNumberOfSteps(0)
-{
- if (BINARY_DEPTH < 2)
- {
- llerrs << "Trying to create skip list with too little depth, "
- "must be 2 or greater" << llendl;
- }
- mLevel = 1;
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mHead.mForward[i] = NULL;
- mUpdate[i] = NULL;
- }
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
-}
-
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::~LLPtrSkipMap()
-{
- removeAllData();
-}
-
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline void LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::setInsertFirst(insert_func insert_first)
-{
- mInsertFirst = insert_first;
-}
-
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline void LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::setEquals(equals_func equals)
-{
- mEquals = equals;
-}
-
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline DATA_T &LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::addData(const INDEX_T &index, DATA_T datap)
-{
- S32 level;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *current = &mHead;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *temp;
-
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mIndex, index)))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mIndex < index))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
-
- // we're now just in front of where we want to be . . . take one step forward
- current = *current->mForward;
-
- // replace the existing data if a node is already there
- if ( (current)
- &&(mEquals(current->mIndex, index)))
- {
- current->mData = datap;
- return current->mData;
- }
-
- // now add the new node
- S32 newlevel;
- for (newlevel = 1; newlevel <= mLevel && newlevel < BINARY_DEPTH; newlevel++)
- {
- if (ll_frand() < 0.5f)
- {
- break;
- }
- }
-
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *snode
- = new LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH>(index, datap);
-
- if (newlevel > mLevel)
- {
- mHead.mForward[mLevel] = NULL;
- mUpdate[mLevel] = &mHead;
- mLevel = newlevel;
- }
-
- for (level = 0; level < newlevel; level++)
- {
- snode->mForward[level] = mUpdate[level]->mForward[level];
- mUpdate[level]->mForward[level] = snode;
- }
- return snode->mData;
-}
-
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline DATA_T &LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::addData(const INDEX_T &index)
-{
- S32 level;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *current = &mHead;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *temp;
-
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mIndex, index)))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mIndex < index))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
-
- // we're now just in front of where we want to be . . . take one step forward
- current = *current->mForward;
-
- // now add the new node
- S32 newlevel;
- for (newlevel = 1; newlevel <= mLevel && newlevel < BINARY_DEPTH; newlevel++)
- {
- if (ll_frand() < 0.5f)
- break;
- }
-
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *snode
- = new LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH>(index);
-
- if (newlevel > mLevel)
- {
- mHead.mForward[mLevel] = NULL;
- mUpdate[mLevel] = &mHead;
- mLevel = newlevel;
- }
-
- for (level = 0; level < newlevel; level++)
- {
- snode->mForward[level] = mUpdate[level]->mForward[level];
- mUpdate[level]->mForward[level] = snode;
- }
- return snode->mData;
-}
-
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline DATA_T &LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::getData(const INDEX_T &index)
-{
- S32 level;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *current = &mHead;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *temp;
-
- mNumberOfSteps = 0;
-
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mIndex, index)))
- {
- current = temp;
- temp = *(current->mForward + level);
- mNumberOfSteps++;
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mIndex < index))
- {
- current = temp;
- temp = *(current->mForward + level);
- mNumberOfSteps++;
- }
- *(mUpdate + level) = current;
- }
- }
-
- // we're now just in front of where we want to be . . . take one step forward
- current = *current->mForward;
- mNumberOfSteps++;
-
- if ( (current)
- &&(mEquals(current->mIndex, index)))
- {
-
- return current->mData;
- }
-
- // now add the new node
- S32 newlevel;
- for (newlevel = 1; newlevel <= mLevel && newlevel < BINARY_DEPTH; newlevel++)
- {
- if (ll_frand() < 0.5f)
- break;
- }
-
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *snode
- = new LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH>(index);
-
- if (newlevel > mLevel)
- {
- mHead.mForward[mLevel] = NULL;
- mUpdate[mLevel] = &mHead;
- mLevel = newlevel;
- }
-
- for (level = 0; level < newlevel; level++)
- {
- snode->mForward[level] = mUpdate[level]->mForward[level];
- mUpdate[level]->mForward[level] = snode;
- }
-
- return snode->mData;
-}
-
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline BOOL LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::getInterval(const INDEX_T &index,
- INDEX_T &index_before,
- INDEX_T &index_after,
- DATA_T &data_before,
- DATA_T &data_after)
-{
- S32 level;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *current = &mHead;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *temp;
-
- mNumberOfSteps = 0;
-
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mIndex, index)))
- {
- current = temp;
- temp = *(current->mForward + level);
- mNumberOfSteps++;
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mIndex < index))
- {
- current = temp;
- temp = *(current->mForward + level);
- mNumberOfSteps++;
- }
- *(mUpdate + level) = current;
- }
- }
-
- BOOL both_found = TRUE;
-
- if (current != &mHead)
- {
- index_before = current->mIndex;
- data_before = current->mData;
- }
- else
- {
- data_before = 0;
- index_before = 0;
- both_found = FALSE;
- }
-
- // we're now just in front of where we want to be . . . take one step forward
- mNumberOfSteps++;
- current = *current->mForward;
-
- if (current)
- {
- data_after = current->mData;
- index_after = current->mIndex;
- }
- else
- {
- data_after = 0;
- index_after = 0;
- both_found = FALSE;
- }
-
- return both_found;
-}
-
-
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline DATA_T &LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::operator[](const INDEX_T &index)
-{
-
- return getData(index);
-}
-
-// If index present, returns data.
-// If index not present, adds <index,NULL> and returns NULL.
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline DATA_T &LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::getData(const INDEX_T &index, BOOL &b_new_entry)
-{
- S32 level;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *current = &mHead;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *temp;
-
- mNumberOfSteps = 0;
-
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mIndex, index)))
- {
- current = temp;
- temp = *(current->mForward + level);
- mNumberOfSteps++;
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mIndex < index))
- {
- current = temp;
- temp = *(current->mForward + level);
- mNumberOfSteps++;
- }
- *(mUpdate + level) = current;
- }
- }
-
- // we're now just in front of where we want to be . . . take one step forward
- mNumberOfSteps++;
- current = *current->mForward;
-
- if ( (current)
- &&(mEquals(current->mIndex, index)))
- {
-
- return current->mData;
- }
- b_new_entry = TRUE;
- addData(index);
-
- return current->mData;
-}
-
-// Returns TRUE if data present in map.
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline BOOL LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::checkData(const INDEX_T &index)
-{
- S32 level;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *current = &mHead;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *temp;
-
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mIndex, index)))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mIndex < index))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
-
- // we're now just in front of where we want to be . . . take one step forward
- current = *current->mForward;
-
- if (current)
- {
- // Gets rid of some compiler ambiguity for the LLPointer<> templated class.
- if (current->mData)
- {
- return mEquals(current->mIndex, index);
- }
- }
-
- return FALSE;
-}
-
-// Returns TRUE if key is present in map. This is useful if you
-// are potentially storing NULL pointers in the map
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline BOOL LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::checkKey(const INDEX_T &index)
-{
- S32 level;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *current = &mHead;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *temp;
-
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mIndex, index)))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mIndex < index))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
-
- // we're now just in front of where we want to be . . . take one step forward
- current = *current->mForward;
-
- if (current)
- {
- return mEquals(current->mIndex, index);
- }
-
- return FALSE;
-}
-
-// If there, returns the data.
-// If not, returns NULL.
-// Never adds entries to the map.
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline DATA_T LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::getIfThere(const INDEX_T &index)
-{
- S32 level;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *current = &mHead;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *temp;
-
- mNumberOfSteps = 0;
-
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mIndex, index)))
- {
- current = temp;
- temp = *(current->mForward + level);
- mNumberOfSteps++;
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mIndex < index))
- {
- current = temp;
- temp = *(current->mForward + level);
- mNumberOfSteps++;
- }
- *(mUpdate + level) = current;
- }
- }
-
- // we're now just in front of where we want to be . . . take one step forward
- mNumberOfSteps++;
- current = *current->mForward;
-
- if (current)
- {
- if (mEquals(current->mIndex, index))
- {
- return current->mData;
- }
- }
-
- // Avoid Linux compiler warning on returning NULL.
- return (DATA_T)0;
-}
-
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline INDEX_T LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::reverseLookup(const DATA_T datap)
-{
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *current = &mHead;
-
- while (current)
- {
- if (datap == current->mData)
- {
-
- return current->mIndex;
- }
- current = *current->mForward;
- }
-
- // not found! return NULL
- return INDEX_T();
-}
-
-// returns number of items in the list
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline S32 LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::getLength()
-{
- U32 length = 0;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH>* temp;
- for (temp = *(mHead.mForward); temp != NULL; temp = temp->mForward[0])
- {
- length++;
- }
-
- return length;
-}
-
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline BOOL LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::removeData(const INDEX_T &index)
-{
- S32 level;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *current = &mHead;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *temp;
-
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mIndex, index)))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mIndex < index))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
-
- // we're now just in front of where we want to be . . . take one step forward
- current = *current->mForward;
-
- if (!current)
- {
- // empty list or beyond the end!
-
- return FALSE;
- }
-
- // is this the one we want?
- if (!mEquals(current->mIndex, index))
- {
- // nope!
-
- return FALSE;
- }
- else
- {
- // do we need to fix current or currentop?
- if (current == mCurrentp)
- {
- mCurrentp = *current->mForward;
- }
-
- if (current == mCurrentOperatingp)
- {
- mCurrentOperatingp = *current->mForward;
- }
- // yes it is! change pointers as required
- for (level = 0; level < mLevel; level++)
- {
- if (*((*(mUpdate + level))->mForward + level) != current)
- {
- // cool, we've fixed all the pointers!
- break;
- }
- *((*(mUpdate + level))->mForward + level) = *(current->mForward + level);
- }
-
- // clean up cuurent
- current->removeData();
- delete current;
-
- // clean up mHead
- while ( (mLevel > 1)
- &&(!*(mHead.mForward + mLevel - 1)))
- {
- mLevel--;
- }
- }
-
- return TRUE;
-}
-
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline BOOL LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::deleteData(const INDEX_T &index)
-{
- S32 level;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *current = &mHead;
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *temp;
-
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mIndex, index)))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mIndex < index))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
-
- // we're now just in front of where we want to be . . . take one step forward
- current = *current->mForward;
-
- if (!current)
- {
- // empty list or beyond the end!
-
- return FALSE;
- }
-
- // is this the one we want?
- if (!mEquals(current->mIndex, index))
- {
- // nope!
-
- return FALSE;
- }
- else
- {
- // do we need to fix current or currentop?
- if (current == mCurrentp)
- {
- mCurrentp = *current->mForward;
- }
-
- if (current == mCurrentOperatingp)
- {
- mCurrentOperatingp = *current->mForward;
- }
- // yes it is! change pointers as required
- for (level = 0; level < mLevel; level++)
- {
- if (*((*(mUpdate + level))->mForward + level) != current)
- {
- // cool, we've fixed all the pointers!
- break;
- }
- *((*(mUpdate + level))->mForward + level) = *(current->mForward + level);
- }
-
- // clean up cuurent
- current->deleteData();
- delete current;
-
- // clean up mHead
- while ( (mLevel > 1)
- &&(!*(mHead.mForward + mLevel - 1)))
- {
- mLevel--;
- }
- }
-
- return TRUE;
-}
-
-// remove all nodes from the list but do not delete data
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-void LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::removeAllData()
-{
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *temp;
- // reset mCurrentp
- mCurrentp = *(mHead.mForward);
-
- while (mCurrentp)
- {
- temp = mCurrentp->mForward[0];
- mCurrentp->removeData();
- delete mCurrentp;
- mCurrentp = temp;
- }
-
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mHead.mForward[i] = NULL;
- mUpdate[i] = NULL;
- }
-
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
-}
-
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline void LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::deleteAllData()
-{
- LLPtrSkipMapNode<INDEX_T, DATA_T, BINARY_DEPTH> *temp;
- // reset mCurrentp
- mCurrentp = *(mHead.mForward);
-
- while (mCurrentp)
- {
- temp = mCurrentp->mForward[0];
- mCurrentp->deleteData();
- delete mCurrentp;
- mCurrentp = temp;
- }
-
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mHead.mForward[i] = NULL;
- mUpdate[i] = NULL;
- }
-
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
-}
-
-// place mCurrentp on first node
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline void LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::resetList()
-{
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
-}
-
-
-// return the data currently pointed to
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline DATA_T LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::getCurrentDataWithoutIncrement()
-{
- if (mCurrentOperatingp)
- {
- return mCurrentOperatingp->mData;
- }
- else
- {
- //return NULL; // causes warning
- return (DATA_T)0; // equivalent, but no warning
- }
-}
-
-// return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline DATA_T LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::getCurrentData()
-{
- if (mCurrentp)
- {
- mCurrentOperatingp = mCurrentp;
- mCurrentp = mCurrentp->mForward[0];
- return mCurrentOperatingp->mData;
- }
- else
- {
- //return NULL; // causes warning
- return (DATA_T)0; // equivalent, but no warning
- }
-}
-
-// same as getCurrentData() but a more intuitive name for the operation
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline DATA_T LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::getNextData()
-{
- if (mCurrentp)
- {
- mCurrentOperatingp = mCurrentp;
- mCurrentp = mCurrentp->mForward[0];
- return mCurrentOperatingp->mData;
- }
- else
- {
- //return NULL; // causes compile warning
- return (DATA_T)0; // equivalent, but removes warning
- }
-}
-
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline INDEX_T LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::getNextKey()
-{
- if (mCurrentp)
- {
- mCurrentOperatingp = mCurrentp;
- mCurrentp = mCurrentp->mForward[0];
- return mCurrentOperatingp->mIndex;
- }
- else
- {
- return mHead.mIndex;
- }
-}
-
-// return the key currently pointed to
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline INDEX_T LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::getCurrentKeyWithoutIncrement()
-{
- if (mCurrentOperatingp)
- {
- return mCurrentOperatingp->mIndex;
- }
- else
- {
- //return NULL; // causes compile warning
- return (INDEX_T)0; // equivalent, but removes warning
- }
-}
-
-
-// remove the Node at mCurentOperatingp
-// leave mCurrentp and mCurentOperatingp on the next entry
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline void LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::removeCurrentData()
-{
- if (mCurrentOperatingp)
- {
- removeData(mCurrentOperatingp->mIndex);
- }
-}
-
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline void LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::deleteCurrentData()
-{
- if (mCurrentOperatingp)
- {
- deleteData(mCurrentOperatingp->mIndex);
- }
-}
-
-// reset the list and return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline DATA_T LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::getFirstData()
-{
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
- if (mCurrentp)
- {
- mCurrentOperatingp = mCurrentp;
- mCurrentp = mCurrentp->mForward[0];
- return mCurrentOperatingp->mData;
- }
- else
- {
- //return NULL; // causes compile warning
- return (DATA_T)0; // equivalent, but removes warning
- }
-}
-
-template <class INDEX_T, class DATA_T, S32 BINARY_DEPTH>
-inline INDEX_T LLPtrSkipMap<INDEX_T, DATA_T, BINARY_DEPTH>::getFirstKey()
-{
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
- if (mCurrentp)
- {
- mCurrentOperatingp = mCurrentp;
- mCurrentp = mCurrentp->mForward[0];
- return mCurrentOperatingp->mIndex;
- }
- else
- {
- return mHead.mIndex;
- }
-}
-
-#endif
diff --git a/indra/llcommon/llptrto.h b/indra/llcommon/llptrto.h
index 7091d36f6b..4082e30de6 100755
--- a/indra/llcommon/llptrto.h
+++ b/indra/llcommon/llptrto.h
@@ -33,7 +33,6 @@
#include "llpointer.h"
#include "llrefcount.h" // LLRefCount
-#include "llthread.h" // LLThreadSafeRefCount
#include <boost/type_traits/is_base_of.hpp>
#include <boost/type_traits/remove_pointer.hpp>
#include <boost/utility/enable_if.hpp>
diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp
index abf47a0f57..8cef4293cd 100755
--- a/indra/llcommon/llqueuedthread.cpp
+++ b/indra/llcommon/llqueuedthread.cpp
@@ -28,6 +28,7 @@
#include "llstl.h"
#include "lltimer.h" // ms_sleep()
+#include "lltracethreadrecorder.h"
//============================================================================
@@ -80,7 +81,7 @@ void LLQueuedThread::shutdown()
}
if (timeout == 0)
{
- llwarns << "~LLQueuedThread (" << mName << ") timed out!" << llendl;
+ LL_WARNS() << "~LLQueuedThread (" << mName << ") timed out!" << LL_ENDL;
}
}
else
@@ -101,7 +102,7 @@ void LLQueuedThread::shutdown()
}
if (active_count)
{
- llwarns << "~LLQueuedThread() called with active requests: " << active_count << llendl;
+ LL_WARNS() << "~LLQueuedThread() called with active requests: " << active_count << LL_ENDL;
}
}
@@ -134,8 +135,8 @@ S32 LLQueuedThread::updateQueue(F32 max_time_ms)
pending = getPending();
if(pending > 0)
{
- unpause();
- }
+ unpause();
+ }
}
else
{
@@ -198,11 +199,11 @@ void LLQueuedThread::printQueueStats()
if (!mRequestQueue.empty())
{
QueuedRequest *req = *mRequestQueue.begin();
- llinfos << llformat("Pending Requests:%d Current status:%d", mRequestQueue.size(), req->getStatus()) << llendl;
+ LL_INFOS() << llformat("Pending Requests:%d Current status:%d", mRequestQueue.size(), req->getStatus()) << LL_ENDL;
}
else
{
- llinfos << "Queued Thread Idle" << llendl;
+ LL_INFOS() << "Queued Thread Idle" << LL_ENDL;
}
unlockData();
}
@@ -233,7 +234,7 @@ bool LLQueuedThread::addRequest(QueuedRequest* req)
mRequestQueue.insert(req);
mRequestHash.insert(req);
#if _DEBUG
-// llinfos << llformat("LLQueuedThread::Added req [%08d]",handle) << llendl;
+// LL_INFOS() << llformat("LLQueuedThread::Added req [%08d]",handle) << LL_ENDL;
#endif
unlockData();
@@ -245,7 +246,7 @@ bool LLQueuedThread::addRequest(QueuedRequest* req)
// MAIN thread
bool LLQueuedThread::waitForResult(LLQueuedThread::handle_t handle, bool auto_complete)
{
- llassert (handle != nullHandle())
+ llassert (handle != nullHandle());
bool res = false;
bool waspaused = isPaused();
bool done = false;
@@ -364,7 +365,7 @@ bool LLQueuedThread::completeRequest(handle_t handle)
llassert_always(req->getStatus() != STATUS_QUEUED);
llassert_always(req->getStatus() != STATUS_INPROGRESS);
#if _DEBUG
-// llinfos << llformat("LLQueuedThread::Completed req [%08d]",handle) << llendl;
+// LL_INFOS() << llformat("LLQueuedThread::Completed req [%08d]",handle) << LL_ENDL;
#endif
mRequestHash.erase(handle);
req->deleteRequest();
@@ -385,7 +386,7 @@ bool LLQueuedThread::check()
{
if (entry->getHashKey() > mNextHandle)
{
- llerrs << "Hash Error" << llendl;
+ LL_ERRS() << "Hash Error" << LL_ENDL;
return false;
}
entry = entry->getNextEntry();
@@ -403,6 +404,7 @@ S32 LLQueuedThread::processNextRequest()
QueuedRequest *req;
// Get next request from pool
lockData();
+
while(1)
{
req = NULL;
@@ -467,10 +469,11 @@ S32 LLQueuedThread::processNextRequest()
ms_sleep(1); // sleep the thread a little
}
}
+
+ LLTrace::get_thread_recorder()->pushToParent();
}
S32 pending = getPending();
-
return pending;
}
@@ -499,6 +502,7 @@ void LLQueuedThread::run()
if (isQuitting())
{
+ LLTrace::get_thread_recorder()->pushToParent();
endThread();
break;
}
@@ -507,15 +511,16 @@ void LLQueuedThread::run()
threadedUpdate();
- int res = processNextRequest();
- if (res == 0)
+ int pending_work = processNextRequest();
+
+ if (pending_work == 0)
{
mIdleThread = TRUE;
ms_sleep(1);
}
//LLThread::yield(); // thread should yield after each request
}
- llinfos << "LLQueuedThread " << mName << " EXITING." << llendl;
+ LL_INFOS() << "LLQueuedThread " << mName << " EXITING." << LL_ENDL;
}
// virtual
diff --git a/indra/llcommon/llrefcount.cpp b/indra/llcommon/llrefcount.cpp
index e1876599fc..a638df2c7c 100755
--- a/indra/llcommon/llrefcount.cpp
+++ b/indra/llcommon/llrefcount.cpp
@@ -76,7 +76,7 @@ LLRefCount::~LLRefCount()
{
if (mRef != 0)
{
- llerrs << "deleting non-zero reference" << llendl;
+ LL_ERRS() << "deleting non-zero reference" << LL_ENDL;
}
#if LL_REF_COUNT_DEBUG
@@ -95,8 +95,8 @@ void LLRefCount::ref() const
if(mMutexp->isLocked())
{
mCrashAtUnlock = TRUE ;
- llerrs << "the mutex is locked by the thread: " << mLockedThreadID
- << " Current thread: " << LLThread::currentID() << llendl ;
+ LL_ERRS() << "the mutex is locked by the thread: " << mLockedThreadID
+ << " Current thread: " << LLThread::currentID() << LL_ENDL ;
}
mMutexp->lock() ;
@@ -123,8 +123,8 @@ S32 LLRefCount::unref() const
if(mMutexp->isLocked())
{
mCrashAtUnlock = TRUE ;
- llerrs << "the mutex is locked by the thread: " << mLockedThreadID
- << " Current thread: " << LLThread::currentID() << llendl ;
+ LL_ERRS() << "the mutex is locked by the thread: " << mLockedThreadID
+ << " Current thread: " << LLThread::currentID() << LL_ENDL ;
}
mMutexp->lock() ;
diff --git a/indra/llcommon/llrefcount.h b/indra/llcommon/llrefcount.h
index 32ae15435a..72011d04a0 100755
--- a/indra/llcommon/llrefcount.h
+++ b/indra/llcommon/llrefcount.h
@@ -28,6 +28,8 @@
#include <boost/noncopyable.hpp>
#include <boost/intrusive_ptr.hpp>
+#include "llmutex.h"
+#include "llapr.h"
#define LL_REF_COUNT_DEBUG 0
#if LL_REF_COUNT_DEBUG
@@ -61,7 +63,7 @@ public:
inline S32 unref() const
{
llassert(mRef >= 1);
- if (0 == --mRef)
+ if (0 == --mRef)
{
delete this;
return 0;
@@ -87,22 +89,91 @@ private:
#endif
};
+
+//============================================================================
+
+// see llmemory.h for LLPointer<> definition
+
+class LL_COMMON_API LLThreadSafeRefCount
+{
+public:
+ static void initThreadSafeRefCount(); // creates sMutex
+ static void cleanupThreadSafeRefCount(); // destroys sMutex
+
+private:
+ static LLMutex* sMutex;
+
+protected:
+ virtual ~LLThreadSafeRefCount(); // use unref()
+
+public:
+ LLThreadSafeRefCount();
+ LLThreadSafeRefCount(const LLThreadSafeRefCount&);
+ LLThreadSafeRefCount& operator=(const LLThreadSafeRefCount& ref)
+ {
+ mRef = 0;
+ return *this;
+ }
+
+ void ref()
+ {
+ mRef++;
+ }
+
+ void unref()
+ {
+ llassert(mRef >= 1);
+ if ((--mRef) == 0) // See note in llapr.h on atomic decrement operator return value.
+ {
+ // If we hit zero, the caller should be the only smart pointer owning the object and we can delete it.
+ // It is technically possible for a vanilla pointer to mess this up, or another thread to
+ // jump in, find this object, create another smart pointer and end up dangling, but if
+ // the code is that bad and not thread-safe, it's trouble already.
+ delete this;
+ }
+ }
+
+ S32 getNumRefs() const
+ {
+ const S32 currentVal = mRef.CurrentValue();
+ return currentVal;
+ }
+
+private:
+ LLAtomic32< S32 > mRef;
+};
+
/**
* intrusive pointer support
* this allows you to use boost::intrusive_ptr with any LLRefCount-derived type
*/
+/**
+ * intrusive pointer support for LLThreadSafeRefCount
+ * this allows you to use boost::intrusive_ptr with any LLThreadSafeRefCount-derived type
+ */
namespace boost
{
- inline void intrusive_ptr_add_ref(LLRefCount* p)
+ inline void intrusive_ptr_add_ref(LLThreadSafeRefCount* p)
{
p->ref();
}
- inline void intrusive_ptr_release(LLRefCount* p)
+ inline void intrusive_ptr_release(LLThreadSafeRefCount* p)
{
- p->unref();
+ p->unref();
+ }
+
+ inline void intrusive_ptr_add_ref(LLRefCount* p)
+ {
+ p->ref();
+ }
+
+ inline void intrusive_ptr_release(LLRefCount* p)
+ {
+ p->unref();
}
};
+
#endif
diff --git a/indra/llcommon/llregistry.h b/indra/llcommon/llregistry.h
index bb0d60247e..29950c108d 100755
--- a/indra/llcommon/llregistry.h
+++ b/indra/llcommon/llregistry.h
@@ -29,7 +29,6 @@
#include <list>
-#include <boost/type_traits.hpp>
#include "llsingleton.h"
#include "llstl.h"
@@ -47,12 +46,11 @@ template <typename KEY, typename VALUE, typename COMPARATOR = LLRegistryDefaultC
class LLRegistry
{
public:
- typedef LLRegistry<KEY, VALUE, COMPARATOR> registry_t;
- typedef typename boost::add_reference<typename boost::add_const<KEY>::type>::type ref_const_key_t;
- typedef typename boost::add_reference<typename boost::add_const<VALUE>::type>::type ref_const_value_t;
- typedef typename boost::add_reference<VALUE>::type ref_value_t;
- typedef typename boost::add_pointer<typename boost::add_const<VALUE>::type>::type ptr_const_value_t;
- typedef typename boost::add_pointer<VALUE>::type ptr_value_t;
+ typedef LLRegistry<KEY, VALUE, COMPARATOR> registry_t;
+ typedef const KEY& ref_const_key_t;
+ typedef const VALUE& ref_const_value_t;
+ typedef const VALUE* ptr_const_value_t;
+ typedef VALUE* ptr_value_t;
class Registrar
{
@@ -64,7 +62,7 @@ public:
{
if (mMap.insert(std::make_pair(key, value)).second == false)
{
- llwarns << "Tried to register " << key << " but it was already registered!" << llendl;
+ LL_WARNS() << "Tried to register " << key << " but it was already registered!" << LL_ENDL;
return false;
}
return true;
@@ -309,7 +307,7 @@ public:
{
if (singleton_t::instance().exists(key))
{
- llerrs << "Duplicate registry entry under key \"" << key << "\"" << llendl;
+ LL_ERRS() << "Duplicate registry entry under key \"" << key << "\"" << LL_ENDL;
}
singleton_t::instance().mStaticScope->add(key, value);
}
diff --git a/indra/llcommon/llsafehandle.h b/indra/llcommon/llsafehandle.h
index 8d52d9bb15..4226bf04f0 100755
--- a/indra/llcommon/llsafehandle.h
+++ b/indra/llcommon/llsafehandle.h
@@ -134,7 +134,7 @@ protected:
tempp->unref();
if (mPointer != NULL)
{
- llwarns << "Unreference did assignment to non-NULL because of destructor" << llendl;
+ LL_WARNS() << "Unreference did assignment to non-NULL because of destructor" << LL_ENDL;
unref();
}
}
diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp
index f962485284..d8bbb3a74f 100755
--- a/indra/llcommon/llsd.cpp
+++ b/indra/llcommon/llsd.cpp
@@ -126,7 +126,9 @@ public:
virtual UUID asUUID() const { return LLUUID(); }
virtual Date asDate() const { return LLDate(); }
virtual URI asURI() const { return LLURI(); }
- virtual Binary asBinary() const { return std::vector<U8>(); }
+ virtual const Binary& asBinary() const { static const std::vector<U8> empty; return empty; }
+
+ virtual const String& asStringRef() const { static const std::string empty; return empty; }
virtual bool has(const String&) const { return false; }
virtual LLSD get(const String&) const { return LLSD(); }
@@ -270,6 +272,7 @@ namespace
virtual LLSD::Date asDate() const { return LLDate(mValue); }
virtual LLSD::URI asURI() const { return LLURI(mValue); }
virtual int size() const { return mValue.size(); }
+ virtual const LLSD::String& asStringRef() const { return mValue; }
};
LLSD::Integer ImplString::asInteger() const
@@ -348,7 +351,7 @@ namespace
public:
ImplBinary(const LLSD::Binary& v) : Base(v) { }
- virtual LLSD::Binary asBinary() const{ return mValue; }
+ virtual const LLSD::Binary& asBinary() const{ return mValue; }
};
@@ -840,7 +843,9 @@ LLSD::String LLSD::asString() const { return safe(impl).asString(); }
LLSD::UUID LLSD::asUUID() const { return safe(impl).asUUID(); }
LLSD::Date LLSD::asDate() const { return safe(impl).asDate(); }
LLSD::URI LLSD::asURI() const { return safe(impl).asURI(); }
-LLSD::Binary LLSD::asBinary() const { return safe(impl).asBinary(); }
+const LLSD::Binary& LLSD::asBinary() const { return safe(impl).asBinary(); }
+
+const LLSD::String& LLSD::asStringRef() const { return safe(impl).asStringRef(); }
// const char * helpers
LLSD::LLSD(const char* v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); }
diff --git a/indra/llcommon/llsd.h b/indra/llcommon/llsd.h
index deb87d7497..7b9b1285f5 100755
--- a/indra/llcommon/llsd.h
+++ b/indra/llcommon/llsd.h
@@ -249,7 +249,10 @@ public:
UUID asUUID() const;
Date asDate() const;
URI asURI() const;
- Binary asBinary() const;
+ const Binary& asBinary() const;
+
+ // asStringRef on any non-string type will return a ref to an empty string.
+ const String& asStringRef() const;
operator Boolean() const { return asBoolean(); }
operator Integer() const { return asInteger(); }
diff --git a/indra/llcommon/llsdparam.cpp b/indra/llcommon/llsdparam.cpp
index 9f4460a988..2e7b46f885 100755
--- a/indra/llcommon/llsdparam.cpp
+++ b/indra/llcommon/llsdparam.cpp
@@ -30,13 +30,14 @@
// Project includes
#include "llsdparam.h"
#include "llsdutil.h"
+#include "boost/bind.hpp"
static LLInitParam::Parser::parser_read_func_map_t sReadFuncs;
static LLInitParam::Parser::parser_write_func_map_t sWriteFuncs;
static LLInitParam::Parser::parser_inspect_func_map_t sInspectFuncs;
static const LLSD NO_VALUE_MARKER;
-LLFastTimer::DeclareTimer FTM_SD_PARAM_ADAPTOR("LLSD to LLInitParam conversion");
+LLTrace::BlockTimerStatHandle FTM_SD_PARAM_ADAPTOR("LLSD to LLInitParam conversion");
//
// LLParamSDParser
@@ -102,13 +103,13 @@ void LLParamSDParser::readSD(const LLSD& sd, LLInitParam::BaseBlock& block, bool
//readSDValues(sd, block);
}
-void LLParamSDParser::writeSD(LLSD& sd, const LLInitParam::BaseBlock& block)
+void LLParamSDParser::writeSDImpl(LLSD& sd, const LLInitParam::BaseBlock& block, const LLInitParam::predicate_rule_t rules, const LLInitParam::BaseBlock* diff_block)
{
mNameStack.clear();
mWriteRootSD = &sd;
name_stack_t name_stack;
- block.serializeBlock(*this, name_stack);
+ block.serializeBlock(*this, name_stack, rules, diff_block);
}
/*virtual*/ std::string LLParamSDParser::getCurrentElementName()
@@ -299,6 +300,7 @@ void LLParamSDParserUtilities::readSDValues(read_sd_cb_t cb, const LLSD& sd)
LLInitParam::Parser::name_stack_t stack = LLInitParam::Parser::name_stack_t();
readSDValues(cb, sd, stack);
}
+
namespace LLInitParam
{
// LLSD specialization
@@ -329,13 +331,14 @@ namespace LLInitParam
p.writeValue<LLSD::String>(sd.asString(), name_stack);
}
- void ParamValue<LLSD, NOT_BLOCK>::serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const BaseBlock* diff_block) const
+ bool ParamValue<LLSD, NOT_BLOCK>::serializeBlock(Parser& p, Parser::name_stack_t& name_stack_range, const predicate_rule_t predicate_rule, const BaseBlock* diff_block) const
{
// attempt to write LLSD out directly
- if (!p.writeValue<LLSD>(mValue, name_stack))
+ if (!p.writeValue<LLSD>(mValue, name_stack_range))
{
// otherwise read from LLSD value and serialize out to parser (which could be LLSD, XUI, etc)
- LLParamSDParserUtilities::readSDValues(boost::bind(&serializeElement, boost::ref(p), _1, _2), mValue, name_stack);
+ LLParamSDParserUtilities::readSDValues(boost::bind(&serializeElement, boost::ref(p), _1, _2), mValue, name_stack_range);
}
+ return true;
}
}
diff --git a/indra/llcommon/llsdparam.h b/indra/llcommon/llsdparam.h
index 6ef5debd7b..1542f95e68 100755
--- a/indra/llcommon/llsdparam.h
+++ b/indra/llcommon/llsdparam.h
@@ -30,6 +30,7 @@
#include "llinitparam.h"
#include "boost/function.hpp"
+#include "llfasttimer.h"
struct LL_COMMON_API LLParamSDParserUtilities
{
@@ -50,11 +51,28 @@ typedef LLInitParam::Parser parser_t;
public:
LLParamSDParser();
void readSD(const LLSD& sd, LLInitParam::BaseBlock& block, bool silent = false);
- void writeSD(LLSD& sd, const LLInitParam::BaseBlock& block);
+ template<typename BLOCK>
+ void writeSD(LLSD& sd,
+ const BLOCK& block,
+ const LLInitParam::predicate_rule_t rules = LLInitParam::default_parse_rules(),
+ const LLInitParam::BaseBlock* diff_block = NULL)
+ {
+ if (!diff_block
+ && !rules.isAmbivalent(LLInitParam::HAS_DEFAULT_VALUE))
+ {
+ diff_block = &LLInitParam::defaultValue<BLOCK>();
+ }
+ writeSDImpl(sd, block, rules, diff_block);
+ }
/*virtual*/ std::string getCurrentElementName();
private:
+ void writeSDImpl(LLSD& sd,
+ const LLInitParam::BaseBlock& block,
+ const LLInitParam::predicate_rule_t,
+ const LLInitParam::BaseBlock* diff_block);
+
void submit(LLInitParam::BaseBlock& block, const LLSD& sd, LLInitParam::Parser::name_stack_t& name_stack);
template<typename T>
@@ -92,7 +110,7 @@ private:
};
-extern LL_COMMON_API LLFastTimer::DeclareTimer FTM_SD_PARAM_ADAPTOR;
+extern LL_COMMON_API LLTrace::BlockTimerStatHandle FTM_SD_PARAM_ADAPTOR;
template<typename T>
class LLSDParamAdapter : public T
{
@@ -100,7 +118,7 @@ public:
LLSDParamAdapter() {}
LLSDParamAdapter(const LLSD& sd)
{
- LLFastTimer _(FTM_SD_PARAM_ADAPTOR);
+ LL_RECORD_BLOCK_TIME(FTM_SD_PARAM_ADAPTOR);
LLParamSDParser parser;
// don't spam for implicit parsing of LLSD, as we want to allow arbitrary freeform data and ignore most of it
bool parse_silently = true;
diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp
index ad4fce6f35..d49ff0feb5 100755
--- a/indra/llcommon/llsdserialize.cpp
+++ b/indra/llcommon/llsdserialize.cpp
@@ -34,7 +34,7 @@
#include <iostream>
#include "apr_base64.h"
-#ifdef LL_STANDALONE
+#ifdef LL_USESYSTEMLIBS
# include <zlib.h>
#else
# include "zlib/zlib.h" // for davep's dirty little zip functions
@@ -81,7 +81,7 @@ void LLSDSerialize::serialize(const LLSD& sd, std::ostream& str, ELLSD_Serialize
break;
default:
- llwarns << "serialize request for unknown ELLSD_Serialize" << llendl;
+ LL_WARNS() << "serialize request for unknown ELLSD_Serialize" << LL_ENDL;
}
if (f.notNull())
@@ -169,7 +169,7 @@ bool LLSDSerialize::deserialize(LLSD& sd, std::istream& str, S32 max_bytes)
}
else
{
- llwarns << "deserialize request for unknown ELLSD_Serialize" << llendl;
+ LL_WARNS() << "deserialize request for unknown ELLSD_Serialize" << LL_ENDL;
}
if (p.notNull())
@@ -179,7 +179,7 @@ bool LLSDSerialize::deserialize(LLSD& sd, std::istream& str, S32 max_bytes)
}
fail:
- llwarns << "deserialize LLSD parse failure" << llendl;
+ LL_WARNS() << "deserialize LLSD parse failure" << LL_ENDL;
return false;
}
@@ -445,7 +445,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const
}
if(istr.fail())
{
- llinfos << "STREAM FAILURE reading map." << llendl;
+ LL_INFOS() << "STREAM FAILURE reading map." << LL_ENDL;
parse_count = PARSE_FAILURE;
}
break;
@@ -464,7 +464,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const
}
if(istr.fail())
{
- llinfos << "STREAM FAILURE reading array." << llendl;
+ LL_INFOS() << "STREAM FAILURE reading array." << LL_ENDL;
parse_count = PARSE_FAILURE;
}
break;
@@ -500,7 +500,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const
}
if(istr.fail())
{
- llinfos << "STREAM FAILURE reading boolean." << llendl;
+ LL_INFOS() << "STREAM FAILURE reading boolean." << LL_ENDL;
parse_count = PARSE_FAILURE;
}
break;
@@ -526,7 +526,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const
}
if(istr.fail())
{
- llinfos << "STREAM FAILURE reading boolean." << llendl;
+ LL_INFOS() << "STREAM FAILURE reading boolean." << LL_ENDL;
parse_count = PARSE_FAILURE;
}
break;
@@ -539,7 +539,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const
data = integer;
if(istr.fail())
{
- llinfos << "STREAM FAILURE reading integer." << llendl;
+ LL_INFOS() << "STREAM FAILURE reading integer." << LL_ENDL;
parse_count = PARSE_FAILURE;
}
break;
@@ -553,7 +553,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const
data = real;
if(istr.fail())
{
- llinfos << "STREAM FAILURE reading real." << llendl;
+ LL_INFOS() << "STREAM FAILURE reading real." << LL_ENDL;
parse_count = PARSE_FAILURE;
}
break;
@@ -567,7 +567,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const
data = id;
if(istr.fail())
{
- llinfos << "STREAM FAILURE reading uuid." << llendl;
+ LL_INFOS() << "STREAM FAILURE reading uuid." << LL_ENDL;
parse_count = PARSE_FAILURE;
}
break;
@@ -582,7 +582,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const
}
if(istr.fail())
{
- llinfos << "STREAM FAILURE reading string." << llendl;
+ LL_INFOS() << "STREAM FAILURE reading string." << LL_ENDL;
parse_count = PARSE_FAILURE;
}
break;
@@ -604,7 +604,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const
}
if(istr.fail())
{
- llinfos << "STREAM FAILURE reading link." << llendl;
+ LL_INFOS() << "STREAM FAILURE reading link." << LL_ENDL;
parse_count = PARSE_FAILURE;
}
break;
@@ -627,7 +627,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const
}
if(istr.fail())
{
- llinfos << "STREAM FAILURE reading date." << llendl;
+ LL_INFOS() << "STREAM FAILURE reading date." << LL_ENDL;
parse_count = PARSE_FAILURE;
}
break;
@@ -640,15 +640,15 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const
}
if(istr.fail())
{
- llinfos << "STREAM FAILURE reading data." << llendl;
+ LL_INFOS() << "STREAM FAILURE reading data." << LL_ENDL;
parse_count = PARSE_FAILURE;
}
break;
default:
parse_count = PARSE_FAILURE;
- llinfos << "Unrecognized character while parsing: int(" << (int)c
- << ")" << llendl;
+ LL_INFOS() << "Unrecognized character while parsing: int(" << (int)c
+ << ")" << LL_ENDL;
break;
}
if(PARSE_FAILURE == parse_count)
@@ -873,7 +873,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const
{
/**
* Undefined: '!'<br>
- * Boolean: 't' for true 'f' for false<br>
+ * Boolean: '1' for true '0' for false<br>
* Integer: 'i' + 4 bytes network byte order<br>
* Real: 'r' + 8 bytes IEEE double<br>
* UUID: 'u' + 16 byte unsigned integer<br>
@@ -909,7 +909,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const
}
if(istr.fail())
{
- llinfos << "STREAM FAILURE reading binary map." << llendl;
+ LL_INFOS() << "STREAM FAILURE reading binary map." << LL_ENDL;
parse_count = PARSE_FAILURE;
}
break;
@@ -928,7 +928,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const
}
if(istr.fail())
{
- llinfos << "STREAM FAILURE reading binary array." << llendl;
+ LL_INFOS() << "STREAM FAILURE reading binary array." << LL_ENDL;
parse_count = PARSE_FAILURE;
}
break;
@@ -953,7 +953,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const
data = (S32)ntohl(value_nbo);
if(istr.fail())
{
- llinfos << "STREAM FAILURE reading binary integer." << llendl;
+ LL_INFOS() << "STREAM FAILURE reading binary integer." << LL_ENDL;
}
break;
}
@@ -965,7 +965,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const
data = ll_ntohd(real_nbo);
if(istr.fail())
{
- llinfos << "STREAM FAILURE reading binary real." << llendl;
+ LL_INFOS() << "STREAM FAILURE reading binary real." << LL_ENDL;
}
break;
}
@@ -977,7 +977,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const
data = id;
if(istr.fail())
{
- llinfos << "STREAM FAILURE reading binary uuid." << llendl;
+ LL_INFOS() << "STREAM FAILURE reading binary uuid." << LL_ENDL;
}
break;
}
@@ -998,8 +998,8 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const
}
if(istr.fail())
{
- llinfos << "STREAM FAILURE reading binary (notation-style) string."
- << llendl;
+ LL_INFOS() << "STREAM FAILURE reading binary (notation-style) string."
+ << LL_ENDL;
parse_count = PARSE_FAILURE;
}
break;
@@ -1018,7 +1018,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const
}
if(istr.fail())
{
- llinfos << "STREAM FAILURE reading binary string." << llendl;
+ LL_INFOS() << "STREAM FAILURE reading binary string." << LL_ENDL;
parse_count = PARSE_FAILURE;
}
break;
@@ -1037,7 +1037,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const
}
if(istr.fail())
{
- llinfos << "STREAM FAILURE reading binary link." << llendl;
+ LL_INFOS() << "STREAM FAILURE reading binary link." << LL_ENDL;
parse_count = PARSE_FAILURE;
}
break;
@@ -1050,7 +1050,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const
data = LLDate(real);
if(istr.fail())
{
- llinfos << "STREAM FAILURE reading binary date." << llendl;
+ LL_INFOS() << "STREAM FAILURE reading binary date." << LL_ENDL;
parse_count = PARSE_FAILURE;
}
break;
@@ -1079,7 +1079,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const
}
if(istr.fail())
{
- llinfos << "STREAM FAILURE reading binary." << llendl;
+ LL_INFOS() << "STREAM FAILURE reading binary." << LL_ENDL;
parse_count = PARSE_FAILURE;
}
break;
@@ -1087,8 +1087,8 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const
default:
parse_count = PARSE_FAILURE;
- llinfos << "Unrecognized character while parsing: int(" << (int)c
- << ")" << llendl;
+ LL_INFOS() << "Unrecognized character while parsing: int(" << (int)c
+ << ")" << LL_ENDL;
break;
}
if(PARSE_FAILURE == parse_count)
@@ -1261,12 +1261,37 @@ std::string LLSDNotationFormatter::escapeString(const std::string& in)
// virtual
S32 LLSDNotationFormatter::format(const LLSD& data, std::ostream& ostr, U32 options) const
{
+ S32 rv = format_impl(data, ostr, options, 0);
+ return rv;
+}
+
+S32 LLSDNotationFormatter::format_impl(const LLSD& data, std::ostream& ostr, U32 options, U32 level) const
+{
S32 format_count = 1;
+ std::string pre;
+ std::string post;
+
+ if (options & LLSDFormatter::OPTIONS_PRETTY)
+ {
+ for (U32 i = 0; i < level; i++)
+ {
+ pre += " ";
+ }
+ post = "\n";
+ }
+
switch(data.type())
{
case LLSD::TypeMap:
{
+ if (0 != level) ostr << post << pre;
ostr << "{";
+ std::string inner_pre;
+ if (options & LLSDFormatter::OPTIONS_PRETTY)
+ {
+ inner_pre = pre + " ";
+ }
+
bool need_comma = false;
LLSD::map_const_iterator iter = data.beginMap();
LLSD::map_const_iterator end = data.endMap();
@@ -1274,18 +1299,18 @@ S32 LLSDNotationFormatter::format(const LLSD& data, std::ostream& ostr, U32 opti
{
if(need_comma) ostr << ",";
need_comma = true;
- ostr << '\'';
+ ostr << post << inner_pre << '\'';
serialize_string((*iter).first, ostr);
ostr << "':";
- format_count += format((*iter).second, ostr);
+ format_count += format_impl((*iter).second, ostr, options, level + 2);
}
- ostr << "}";
+ ostr << post << pre << "}";
break;
}
case LLSD::TypeArray:
{
- ostr << "[";
+ ostr << post << pre << "[";
bool need_comma = false;
LLSD::array_const_iterator iter = data.beginArray();
LLSD::array_const_iterator end = data.endArray();
@@ -1293,7 +1318,7 @@ S32 LLSDNotationFormatter::format(const LLSD& data, std::ostream& ostr, U32 opti
{
if(need_comma) ostr << ",";
need_comma = true;
- format_count += format(*iter, ostr);
+ format_count += format_impl(*iter, ostr, options, level + 1);
}
ostr << "]";
break;
@@ -1343,7 +1368,7 @@ S32 LLSDNotationFormatter::format(const LLSD& data, std::ostream& ostr, U32 opti
case LLSD::TypeString:
ostr << '\'';
- serialize_string(data.asString(), ostr);
+ serialize_string(data.asStringRef(), ostr);
ostr << '\'';
break;
@@ -1360,9 +1385,26 @@ S32 LLSDNotationFormatter::format(const LLSD& data, std::ostream& ostr, U32 opti
case LLSD::TypeBinary:
{
// *FIX: memory inefficient.
- std::vector<U8> buffer = data.asBinary();
+ const std::vector<U8>& buffer = data.asBinary();
ostr << "b(" << buffer.size() << ")\"";
- if(buffer.size()) ostr.write((const char*)&buffer[0], buffer.size());
+ if(buffer.size())
+ {
+ if (options & LLSDFormatter::OPTIONS_PRETTY_BINARY)
+ {
+ std::ios_base::fmtflags old_flags = ostr.flags();
+ ostr.setf( std::ios::hex, std::ios::basefield );
+ ostr << "0x";
+ for (int i = 0; i < buffer.size(); i++)
+ {
+ ostr << (int) buffer[i];
+ }
+ ostr.flags(old_flags);
+ }
+ else
+ {
+ ostr.write((const char*)&buffer[0], buffer.size());
+ }
+ }
ostr << "\"";
break;
}
@@ -1460,7 +1502,7 @@ S32 LLSDBinaryFormatter::format(const LLSD& data, std::ostream& ostr, U32 option
case LLSD::TypeString:
ostr.put('s');
- formatString(data.asString(), ostr);
+ formatString(data.asStringRef(), ostr);
break;
case LLSD::TypeDate:
@@ -1478,9 +1520,8 @@ S32 LLSDBinaryFormatter::format(const LLSD& data, std::ostream& ostr, U32 option
case LLSD::TypeBinary:
{
- // *FIX: memory inefficient.
ostr.put('b');
- std::vector<U8> buffer = data.asBinary();
+ const std::vector<U8>& buffer = data.asBinary();
U32 size_nbo = htonl(buffer.size());
ostr.write((const char*)(&size_nbo), sizeof(U32));
if(buffer.size()) ostr.write((const char*)&buffer[0], buffer.size());
@@ -2017,7 +2058,7 @@ std::string zip_llsd(LLSD& data)
S32 ret = deflateInit(&strm, Z_BEST_COMPRESSION);
if (ret != Z_OK)
{
- llwarns << "Failed to compress LLSD block." << llendl;
+ LL_WARNS() << "Failed to compress LLSD block." << LL_ENDL;
return std::string();
}
@@ -2044,7 +2085,7 @@ std::string zip_llsd(LLSD& data)
if (strm.avail_out >= CHUNK)
{
free(output);
- llwarns << "Failed to compress LLSD block." << llendl;
+ LL_WARNS() << "Failed to compress LLSD block." << LL_ENDL;
return std::string();
}
@@ -2056,7 +2097,7 @@ std::string zip_llsd(LLSD& data)
else
{
free(output);
- llwarns << "Failed to compress LLSD block." << llendl;
+ LL_WARNS() << "Failed to compress LLSD block." << LL_ENDL;
return std::string();
}
}
@@ -2073,7 +2114,7 @@ std::string zip_llsd(LLSD& data)
LLSD test_sd;
if (!unzip_llsd(test_sd, test, result.size()))
{
- llerrs << "Invalid compression result!" << llendl;
+ LL_ERRS() << "Invalid compression result!" << LL_ENDL;
}
#endif
@@ -2163,7 +2204,7 @@ bool unzip_llsd(LLSD& data, std::istream& is, S32 size)
if (!LLSDSerialize::fromBinary(data, istr, cur_size))
{
- llwarns << "Failed to unzip LLSD block" << llendl;
+ LL_WARNS() << "Failed to unzip LLSD block" << LL_ENDL;
free(result);
return false;
}
diff --git a/indra/llcommon/llsdserialize.h b/indra/llcommon/llsdserialize.h
index e7a5507385..23a0c8cfb1 100755
--- a/indra/llcommon/llsdserialize.h
+++ b/indra/llcommon/llsdserialize.h
@@ -416,7 +416,8 @@ public:
typedef enum e_formatter_options_type
{
OPTIONS_NONE = 0,
- OPTIONS_PRETTY = 1
+ OPTIONS_PRETTY = 1,
+ OPTIONS_PRETTY_BINARY = 2
} EFormatterOptions;
/**
@@ -507,6 +508,17 @@ public:
* @return Returns The number of LLSD objects fomatted out
*/
virtual S32 format(const LLSD& data, std::ostream& ostr, U32 options = LLSDFormatter::OPTIONS_NONE) const;
+
+protected:
+
+ /**
+ * @brief Implementation to format the data. This is called recursively.
+ *
+ * @param data The data to write.
+ * @param ostr The destination stream for the data.
+ * @return Returns The number of LLSD objects fomatted out
+ */
+ S32 format_impl(const LLSD& data, std::ostream& ostr, U32 options, U32 level) const;
};
@@ -634,7 +646,7 @@ protected:
* </code>
*
* *NOTE - formerly this class inherited from its template parameter Formatter,
- * but all insnatiations passed in LLRefCount subclasses. This conflicted with
+ * but all instantiations passed in LLRefCount subclasses. This conflicted with
* the auto allocation intended for this class template (demonstrated in the
* example above). -brad
*/
@@ -720,6 +732,18 @@ public:
LLPointer<LLSDNotationFormatter> f = new LLSDNotationFormatter;
return f->format(sd, str, LLSDFormatter::OPTIONS_NONE);
}
+ static S32 toPrettyNotation(const LLSD& sd, std::ostream& str)
+ {
+ LLPointer<LLSDNotationFormatter> f = new LLSDNotationFormatter;
+ return f->format(sd, str, LLSDFormatter::OPTIONS_PRETTY);
+ }
+ static S32 toPrettyBinaryNotation(const LLSD& sd, std::ostream& str)
+ {
+ LLPointer<LLSDNotationFormatter> f = new LLSDNotationFormatter;
+ return f->format(sd, str,
+ LLSDFormatter::OPTIONS_PRETTY |
+ LLSDFormatter::OPTIONS_PRETTY_BINARY);
+ }
static S32 fromNotation(LLSD& sd, std::istream& str, S32 max_bytes)
{
LLPointer<LLSDNotationParser> p = new LLSDNotationParser;
diff --git a/indra/llcommon/llsdserialize_xml.cpp b/indra/llcommon/llsdserialize_xml.cpp
index 614a2d5636..8d72a1c329 100755
--- a/indra/llcommon/llsdserialize_xml.cpp
+++ b/indra/llcommon/llsdserialize_xml.cpp
@@ -35,7 +35,7 @@
extern "C"
{
-#ifdef LL_STANDALONE
+#ifdef LL_USESYSTEMLIBS
# include <expat.h>
#else
# include "expat/expat.h"
@@ -168,8 +168,8 @@ S32 LLSDXMLFormatter::format_impl(const LLSD& data, std::ostream& ostr, U32 opti
break;
case LLSD::TypeString:
- if(data.asString().empty()) ostr << pre << "<string />" << post;
- else ostr << pre << "<string>" << escapeString(data.asString()) <<"</string>" << post;
+ if(data.asStringRef().empty()) ostr << pre << "<string />" << post;
+ else ostr << pre << "<string>" << escapeString(data.asStringRef()) <<"</string>" << post;
break;
case LLSD::TypeDate:
@@ -182,7 +182,7 @@ S32 LLSDXMLFormatter::format_impl(const LLSD& data, std::ostream& ostr, U32 opti
case LLSD::TypeBinary:
{
- LLSD::Binary buffer = data.asBinary();
+ const LLSD::Binary& buffer = data.asBinary();
if(buffer.empty())
{
ostr << pre << "<binary />" << post;
@@ -375,13 +375,10 @@ S32 LLSDXMLParser::Impl::parse(std::istream& input, LLSD& data)
{
break;
}
+ count = get_till_eol(input, (char *)buffer, BUFFER_SIZE);
+ if (!count)
{
-
- count = get_till_eol(input, (char *)buffer, BUFFER_SIZE);
- if (!count)
- {
- break;
- }
+ break;
}
status = XML_ParseBuffer(mParser, count, false);
@@ -406,7 +403,7 @@ S32 LLSDXMLParser::Impl::parse(std::istream& input, LLSD& data)
}
if (mEmitErrors)
{
- llinfos << "LLSDXMLParser::Impl::parse: XML_STATUS_ERROR parsing:" << (char*) buffer << llendl;
+ LL_INFOS() << "LLSDXMLParser::Impl::parse: XML_STATUS_ERROR parsing:" << (char*) buffer << LL_ENDL;
}
data = LLSD();
return LLSDParser::PARSE_FAILURE;
@@ -487,7 +484,7 @@ S32 LLSDXMLParser::Impl::parseLines(std::istream& input, LLSD& data)
{
if (mEmitErrors)
{
- llinfos << "LLSDXMLParser::Impl::parseLines: XML_STATUS_ERROR" << llendl;
+ LL_INFOS() << "LLSDXMLParser::Impl::parseLines: XML_STATUS_ERROR" << LL_ENDL;
}
return LLSDParser::PARSE_FAILURE;
}
@@ -549,7 +546,7 @@ void LLSDXMLParser::Impl::parsePart(const char* buf, int len)
XML_Status status = XML_Parse(mParser, buf, len, false);
if (status == XML_STATUS_ERROR)
{
- llinfos << "Unexpected XML parsing error at start" << llendl;
+ LL_INFOS() << "Unexpected XML parsing error at start" << LL_ENDL;
}
}
}
diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp
index 803417d368..562fd26658 100755
--- a/indra/llcommon/llsdutil.cpp
+++ b/indra/llcommon/llsdutil.cpp
@@ -182,7 +182,7 @@ char* ll_pretty_print_sd_ptr(const LLSD* sd)
char* ll_pretty_print_sd(const LLSD& sd)
{
- const U32 bufferSize = 10 * 1024;
+ const U32 bufferSize = 100 * 1024;
static char buffer[bufferSize];
std::ostringstream stream;
//stream.rdbuf()->pubsetbuf(buffer, bufferSize);
diff --git a/indra/llcommon/llsdutil.h b/indra/llcommon/llsdutil.h
index 532d3f9341..d0b536c39a 100755
--- a/indra/llcommon/llsdutil.h
+++ b/indra/llcommon/llsdutil.h
@@ -29,7 +29,7 @@
#ifndef LL_LLSDUTIL_H
#define LL_LLSDUTIL_H
-class LLSD;
+#include "llsd.h"
// U32
LL_COMMON_API LLSD ll_sd_from_U32(const U32);
diff --git a/indra/llcommon/llsecondlifeurls.cpp b/indra/llcommon/llsecondlifeurls.cpp
deleted file mode 100755
index 9154e05e43..0000000000
--- a/indra/llcommon/llsecondlifeurls.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/**
- * @file llsecondlifeurls.cpp
- * @brief Urls used in the product
- *
- * $LicenseInfo:firstyear=2005&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "linden_common.h"
-#include "llsecondlifeurls.h"
-/*
-const std::string CREATE_ACCOUNT_URL (
- "http://join.secondlife.com/");
-
-const std::string MANAGE_ACCOUNT (
- "http://secondlife.com/account/"); // *TODO: NOT USED
-
-const std::string AUCTION_URL (
- "http://secondlife.com/auctions/auction-detail.php?id=");
-
-const std::string EVENTS_URL (
- "http://secondlife.com/events/");
-*/
-const std::string TIER_UP_URL (
- "http://secondlife.com/app/landtier"); // *TODO: Translate (simulator)
-
-const std::string DIRECTX_9_URL (
- "http://secondlife.com/support/"); // *TODO: NOT USED
-/*
-const std::string LAND_URL (
- "http://secondlife.com/app/landtier"); // *TODO: NOT USED
-
-const std::string UPGRADE_TO_PREMIUM_URL (
- "http://secondlife.com/app/upgrade/"); // *TODO: NOT USED
-
-const std::string AMD_AGP_URL (
- "http://secondlife.com/support/"); // *TODO: NOT USED
-
-const std::string VIA_URL (
- "http://secondlife.com/support/"); // *TODO: NOT USED
-
-const std::string SUPPORT_URL (
- "http://secondlife.com/support/");
-
-const std::string INTEL_CHIPSET_URL (
- "http://secondlife.com/support/"); // *TODO: NOT USED
-
-const std::string SIS_CHIPSET_URL (
- "http://secondlife.com/support/"); // *TODO: NOT USED
-
-const std::string BLOGS_URL (
- "http://blog.secondlife.com/"); // *TODO: NOT USED
-
-const std::string BUY_CURRENCY_URL (
- "http://secondlife.com/app/currency/");
-
-const std::string LSL_DOC_URL (
- "http://secondlife.com/app/lsldoc/"); // *TODO: NOT USED
-
-const std::string SL_KB_URL (
- "http://secondlife.com/knowledgebase/"); // *TODO: NOT USED
-
-const std::string RELEASE_NOTES_BASE_URL (
- "http://secondlife.com/app/releasenotes/");
-*/
-
diff --git a/indra/llcommon/llsecondlifeurls.h b/indra/llcommon/llsecondlifeurls.h
deleted file mode 100755
index 62f357ffed..0000000000
--- a/indra/llcommon/llsecondlifeurls.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * @file llsecondlifeurls.h
- * @brief Global URLs to pages on our web site
- *
- * $LicenseInfo:firstyear=2004&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLSECONDLIFEURLS_H
-#define LL_LLSECONDLIFEURLS_H
-/*
-// Account registration web page
-LL_COMMON_API extern const std::string CREATE_ACCOUNT_URL;
-
-// Manage Account
-LL_COMMON_API extern const std::string MANAGE_ACCOUNT;
-
-LL_COMMON_API extern const std::string AUCTION_URL;
-
-LL_COMMON_API extern const std::string EVENTS_URL;
-*/
-// Tier up to a new land level.
-LL_COMMON_API extern const std::string TIER_UP_URL;
-
-
-// Tier up to a new land level.
-LL_COMMON_API extern const std::string LAND_URL;
-
-// How to get DirectX 9
-LL_COMMON_API extern const std::string DIRECTX_9_URL;
-
-/*
-// Upgrade from basic membership to premium membership
-LL_COMMON_API extern const std::string UPGRADE_TO_PREMIUM_URL;
-
-
-// Out of date VIA chipset
-LL_COMMON_API extern const std::string VIA_URL;
-
-// Support URL
-LL_COMMON_API extern const std::string SUPPORT_URL;
-
-// Linden Blogs page
-LL_COMMON_API extern const std::string BLOGS_URL;
-
-// Currency page
-LL_COMMON_API extern const std::string BUY_CURRENCY_URL;
-
-// LSL script wiki
-LL_COMMON_API extern const std::string LSL_DOC_URL;
-
-// SL KnowledgeBase page
-LL_COMMON_API extern const std::string SL_KB_URL;
-
-// Release Notes Redirect URL for Server and Viewer
-LL_COMMON_API extern const std::string RELEASE_NOTES_BASE_URL;
-*/
-#endif
diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h
index 40002313f1..6e6291a165 100755
--- a/indra/llcommon/llsingleton.h
+++ b/indra/llcommon/llsingleton.h
@@ -67,6 +67,11 @@ private:
INITIALIZED,
DELETED
} EInitState;
+
+ static DERIVED_TYPE* constructSingleton()
+ {
+ return new DERIVED_TYPE();
+ }
// stores pointer to singleton instance
struct SingletonLifetimeManager
@@ -79,7 +84,7 @@ private:
static void construct()
{
sData.mInitState = CONSTRUCTING;
- sData.mInstance = new DERIVED_TYPE();
+ sData.mInstance = constructSingleton();
sData.mInitState = INITIALIZING;
}
@@ -138,18 +143,21 @@ public:
llassert(false);
return NULL;
case CONSTRUCTING:
- llerrs << "Tried to access singleton " << typeid(DERIVED_TYPE).name() << " from singleton constructor!" << llendl;
+ LL_ERRS() << "Tried to access singleton " << typeid(DERIVED_TYPE).name() << " from singleton constructor!" << LL_ENDL;
return NULL;
case INITIALIZING:
// go ahead and flag ourselves as initialized so we can be reentrant during initialization
sData.mInitState = INITIALIZED;
+ // initialize singleton after constructing it so that it can reference other singletons which in turn depend on it,
+ // thus breaking cyclic dependencies
sData.mInstance->initSingleton();
return sData.mInstance;
case INITIALIZED:
return sData.mInstance;
case DELETED:
- llwarns << "Trying to access deleted singleton " << typeid(DERIVED_TYPE).name() << " creating new instance" << llendl;
+ LL_WARNS() << "Trying to access deleted singleton " << typeid(DERIVED_TYPE).name() << " creating new instance" << LL_ENDL;
SingletonLifetimeManager::construct();
+ // same as first time construction
sData.mInitState = INITIALIZED;
sData.mInstance->initSingleton();
return sData.mInstance;
@@ -190,6 +198,8 @@ private:
struct SingletonData
{
+ // explicitly has a default constructor so that member variables are zero initialized in BSS
+ // and only changed by singleton logic, not constructor running during startup
EInitState mInitState;
DERIVED_TYPE* mInstance;
};
diff --git a/indra/llcommon/llskiplist.h b/indra/llcommon/llskiplist.h
deleted file mode 100755
index ed132381f9..0000000000
--- a/indra/llcommon/llskiplist.h
+++ /dev/null
@@ -1,517 +0,0 @@
-/**
- * @file llskiplist.h
- * @brief skip list implementation
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-#ifndef LL_LLSKIPLIST_H
-#define LL_LLSKIPLIST_H
-
-#include "llrand.h"
-#include "llrand.h"
-
-// NOTA BENE: Insert first needs to be < NOT <=
-// Binary depth must be >= 2
-template <class DATA_TYPE, S32 BINARY_DEPTH = 10>
-class LLSkipList
-{
-public:
- typedef BOOL (*compare)(const DATA_TYPE& first, const DATA_TYPE& second);
- typedef compare insert_func;
- typedef compare equals_func;
-
- void init();
-
- // basic constructor
- LLSkipList();
-
- // basic constructor including sorter
- LLSkipList(insert_func insert_first, equals_func equals);
- ~LLSkipList();
-
- inline void setInsertFirst(insert_func insert_first);
- inline void setEquals(equals_func equals);
-
- inline BOOL addData(const DATA_TYPE& data);
- inline BOOL checkData(const DATA_TYPE& data);
-
- // returns number of items in the list
- inline S32 getLength() const; // NOT a constant time operation, traverses entire list!
-
- inline BOOL moveData(const DATA_TYPE& data, LLSkipList *newlist);
-
- inline BOOL removeData(const DATA_TYPE& data);
-
- // remove all nodes from the list but do not delete data
- inline void removeAllNodes();
-
- // place mCurrentp on first node
- inline void resetList();
-
- // return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
- inline DATA_TYPE getCurrentData();
-
- // same as getCurrentData() but a more intuitive name for the operation
- inline DATA_TYPE getNextData();
-
- // remove the Node at mCurentOperatingp
- // leave mCurrentp and mCurentOperatingp on the next entry
- inline void removeCurrentData();
-
- // reset the list and return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
- inline DATA_TYPE getFirstData();
-
- class LLSkipNode
- {
- public:
- LLSkipNode()
- : mData(0)
- {
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mForward[i] = NULL;
- }
- }
-
- LLSkipNode(DATA_TYPE data)
- : mData(data)
- {
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mForward[i] = NULL;
- }
- }
-
- ~LLSkipNode()
- {
- }
-
- DATA_TYPE mData;
- LLSkipNode *mForward[BINARY_DEPTH];
-
- private:
- // Disallow copying of LLSkipNodes by not implementing these methods.
- LLSkipNode(const LLSkipNode &);
- LLSkipNode &operator=(const LLSkipNode &);
- };
-
- static BOOL defaultEquals(const DATA_TYPE& first, const DATA_TYPE& second)
- {
- return first == second;
- }
-
-private:
- LLSkipNode mHead;
- LLSkipNode *mUpdate[BINARY_DEPTH];
- LLSkipNode *mCurrentp;
- LLSkipNode *mCurrentOperatingp;
- S32 mLevel;
- insert_func mInsertFirst;
- equals_func mEquals;
-
-private:
- // Disallow copying of LLSkipNodes by not implementing these methods.
- LLSkipList(const LLSkipList &);
- LLSkipList &operator=(const LLSkipList &);
-};
-
-
-///////////////////////
-//
-// Implementation
-//
-
-
-// Binary depth must be >= 2
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline void LLSkipList<DATA_TYPE, BINARY_DEPTH>::init()
-{
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mHead.mForward[i] = NULL;
- mUpdate[i] = NULL;
- }
- mLevel = 1;
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
-}
-
-
-// basic constructor
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline LLSkipList<DATA_TYPE, BINARY_DEPTH>::LLSkipList()
-: mInsertFirst(NULL),
- mEquals(defaultEquals)
-{
- init();
-}
-
-// basic constructor including sorter
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline LLSkipList<DATA_TYPE, BINARY_DEPTH>::LLSkipList(insert_func insert,
- equals_func equals)
-: mInsertFirst(insert),
- mEquals(equals)
-{
- init();
-}
-
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline LLSkipList<DATA_TYPE, BINARY_DEPTH>::~LLSkipList()
-{
- removeAllNodes();
-}
-
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline void LLSkipList<DATA_TYPE, BINARY_DEPTH>::setInsertFirst(insert_func insert_first)
-{
- mInsertFirst = insert_first;
-}
-
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline void LLSkipList<DATA_TYPE, BINARY_DEPTH>::setEquals(equals_func equals)
-{
- mEquals = equals;
-}
-
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline BOOL LLSkipList<DATA_TYPE, BINARY_DEPTH>::addData(const DATA_TYPE& data)
-{
- S32 level;
- LLSkipNode *current = &mHead;
- LLSkipNode *temp;
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mData, data)))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mData < data))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
- // we're now just in front of where we want to be . . . take one step forward
- current = *current->mForward;
-
- // now add the new node
- S32 newlevel;
- for (newlevel = 1; newlevel <= mLevel && newlevel < BINARY_DEPTH; newlevel++)
- {
- if (ll_frand() < 0.5f)
- break;
- }
-
- LLSkipNode *snode = new LLSkipNode(data);
-
- if (newlevel > mLevel)
- {
- mHead.mForward[mLevel] = NULL;
- mUpdate[mLevel] = &mHead;
- mLevel = newlevel;
- }
-
- for (level = 0; level < newlevel; level++)
- {
- snode->mForward[level] = mUpdate[level]->mForward[level];
- mUpdate[level]->mForward[level] = snode;
- }
- return TRUE;
-}
-
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline BOOL LLSkipList<DATA_TYPE, BINARY_DEPTH>::checkData(const DATA_TYPE& data)
-{
- S32 level;
- LLSkipNode *current = &mHead;
- LLSkipNode *temp;
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mData, data)))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mData < data))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
- // we're now just in front of where we want to be . . . take one step forward
- current = *current->mForward;
-
-
- if (current)
- {
- return mEquals(current->mData, data);
- }
-
- return FALSE;
-}
-
-// returns number of items in the list
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline S32 LLSkipList<DATA_TYPE, BINARY_DEPTH>::getLength() const
-{
- U32 length = 0;
- for (LLSkipNode* temp = *(mHead.mForward); temp != NULL; temp = temp->mForward[0])
- {
- length++;
- }
- return length;
-}
-
-
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline BOOL LLSkipList<DATA_TYPE, BINARY_DEPTH>::moveData(const DATA_TYPE& data, LLSkipList *newlist)
-{
- BOOL removed = removeData(data);
- BOOL added = newlist->addData(data);
- return removed && added;
-}
-
-
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline BOOL LLSkipList<DATA_TYPE, BINARY_DEPTH>::removeData(const DATA_TYPE& data)
-{
- S32 level;
- LLSkipNode *current = &mHead;
- LLSkipNode *temp;
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mData, data)))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mData < data))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
- // we're now just in front of where we want to be . . . take one step forward
- current = *current->mForward;
-
-
- if (!current)
- {
- // empty list or beyond the end!
- return FALSE;
- }
-
- // is this the one we want?
- if (!mEquals(current->mData, data))
- {
- // nope!
- return FALSE;
- }
- else
- {
- // do we need to fix current or currentop?
- if (current == mCurrentp)
- {
- mCurrentp = current->mForward[0];
- }
-
- if (current == mCurrentOperatingp)
- {
- mCurrentOperatingp = current->mForward[0];
- }
- // yes it is! change pointers as required
- for (level = 0; level < mLevel; level++)
- {
- if (mUpdate[level]->mForward[level] != current)
- {
- // cool, we've fixed all the pointers!
- break;
- }
- mUpdate[level]->mForward[level] = current->mForward[level];
- }
-
- // clean up cuurent
- delete current;
-
- // clean up mHead
- while ( (mLevel > 1)
- &&(!mHead.mForward[mLevel - 1]))
- {
- mLevel--;
- }
- }
- return TRUE;
-}
-
-// remove all nodes from the list but do not delete data
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline void LLSkipList<DATA_TYPE, BINARY_DEPTH>::removeAllNodes()
-{
- LLSkipNode *temp;
- // reset mCurrentp
- mCurrentp = *(mHead.mForward);
-
- while (mCurrentp)
- {
- temp = mCurrentp->mForward[0];
- delete mCurrentp;
- mCurrentp = temp;
- }
-
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mHead.mForward[i] = NULL;
- mUpdate[i] = NULL;
- }
-
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
-}
-
-// place mCurrentp on first node
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline void LLSkipList<DATA_TYPE, BINARY_DEPTH>::resetList()
-{
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
-}
-
-// return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline DATA_TYPE LLSkipList<DATA_TYPE, BINARY_DEPTH>::getCurrentData()
-{
- if (mCurrentp)
- {
- mCurrentOperatingp = mCurrentp;
- mCurrentp = mCurrentp->mForward[0];
- return mCurrentOperatingp->mData;
- }
- else
- {
- //return NULL; // causes compile warning
- return (DATA_TYPE)0; // equivalent, but no warning
- }
-}
-
-// same as getCurrentData() but a more intuitive name for the operation
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline DATA_TYPE LLSkipList<DATA_TYPE, BINARY_DEPTH>::getNextData()
-{
- if (mCurrentp)
- {
- mCurrentOperatingp = mCurrentp;
- mCurrentp = mCurrentp->mForward[0];
- return mCurrentOperatingp->mData;
- }
- else
- {
- //return NULL; // causes compile warning
- return (DATA_TYPE)0; // equivalent, but no warning
- }
-}
-
-// remove the Node at mCurentOperatingp
-// leave mCurrentp and mCurentOperatingp on the next entry
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline void LLSkipList<DATA_TYPE, BINARY_DEPTH>::removeCurrentData()
-{
- if (mCurrentOperatingp)
- {
- removeData(mCurrentOperatingp->mData);
- }
-}
-
-// reset the list and return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
-template <class DATA_TYPE, S32 BINARY_DEPTH>
-inline DATA_TYPE LLSkipList<DATA_TYPE, BINARY_DEPTH>::getFirstData()
-{
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
- if (mCurrentp)
- {
- mCurrentOperatingp = mCurrentp;
- mCurrentp = mCurrentp->mForward[0];
- return mCurrentOperatingp->mData;
- }
- else
- {
- //return NULL; // causes compile warning
- return (DATA_TYPE)0; // equivalent, but no warning
- }
-}
-
-
-#endif
diff --git a/indra/llcommon/llskipmap.h b/indra/llcommon/llskipmap.h
deleted file mode 100755
index 49ff2928d1..0000000000
--- a/indra/llcommon/llskipmap.h
+++ /dev/null
@@ -1,1022 +0,0 @@
-/**
- * @file llskipmap.h
- * @brief Associative container based on the skiplist algorithm.
- *
- * $LicenseInfo:firstyear=2003&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLSKIPMAP_H
-#define LL_LLSKIPMAP_H
-
-#include "llerror.h"
-
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH = 8>
-class LLSkipMap
-{
-public:
- // basic constructor
- LLSkipMap();
-
- // basic constructor including sorter
- LLSkipMap(BOOL (*insert_first)(const INDEX_TYPE &first, const INDEX_TYPE &second),
- BOOL (*equals)(const INDEX_TYPE &first, const INDEX_TYPE &second));
-
- ~LLSkipMap();
-
- void setInsertFirst(BOOL (*insert_first)(const INDEX_TYPE &first, const INDEX_TYPE &second));
- void setEquals(BOOL (*equals)(const INDEX_TYPE &first, const INDEX_TYPE &second));
-
- DATA_TYPE &addData(const INDEX_TYPE &index, DATA_TYPE datap);
- DATA_TYPE &addData(const INDEX_TYPE &index);
- DATA_TYPE &getData(const INDEX_TYPE &index);
- DATA_TYPE &operator[](const INDEX_TYPE &index);
-
- // If index present, returns data.
- // If index not present, adds <index,NULL> and returns NULL.
- DATA_TYPE &getData(const INDEX_TYPE &index, BOOL &b_new_entry);
-
- // Returns TRUE if data present in map.
- BOOL checkData(const INDEX_TYPE &index);
-
- // Returns TRUE if key is present in map. This is useful if you
- // are potentially storing NULL pointers in the map
- BOOL checkKey(const INDEX_TYPE &index);
-
- // If there, returns the data.
- // If not, returns NULL.
- // Never adds entries to the map.
- DATA_TYPE getIfThere(const INDEX_TYPE &index);
-
- INDEX_TYPE reverseLookup(const DATA_TYPE datap);
-
- // returns number of items in the list
- S32 getLength(); // WARNING! getLength is O(n), not O(1)!
-
- BOOL removeData(const INDEX_TYPE &index);
-
- // remove all nodes from the list but do not delete data
- void removeAllData();
-
- // place mCurrentp on first node
- void resetList();
-
- // return the data currently pointed to
- DATA_TYPE getCurrentDataWithoutIncrement();
-
- // return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
- DATA_TYPE getCurrentData();
-
- // same as getCurrentData() but a more intuitive name for the operation
- DATA_TYPE getNextData();
-
- INDEX_TYPE getNextKey();
-
- // return the key currently pointed to
- INDEX_TYPE getCurrentKeyWithoutIncrement();
-
- // The internal iterator is at the end of the list.
- BOOL notDone() const;
-
- // remove the Node at mCurentOperatingp
- // leave mCurrentp and mCurentOperatingp on the next entry
- void removeCurrentData();
-
- void deleteCurrentData();
-
- // reset the list and return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
- DATA_TYPE getFirstData();
-
- INDEX_TYPE getFirstKey();
-
- class LLSkipMapNode
- {
- public:
- LLSkipMapNode()
- {
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mForward[i] = NULL;
- }
-
- U8 *zero = (U8 *)&mIndex;
-
- for (i = 0; i < (S32)sizeof(INDEX_TYPE); i++)
- {
- *(zero + i) = 0;
- }
-
- zero = (U8 *)&mData;
-
- for (i = 0; i < (S32)sizeof(DATA_TYPE); i++)
- {
- *(zero + i) = 0;
- }
- }
-
- LLSkipMapNode(const INDEX_TYPE &index)
- : mIndex(index)
- {
-
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mForward[i] = NULL;
- }
-
- U8 *zero = (U8 *)&mData;
-
- for (i = 0; i < (S32)sizeof(DATA_TYPE); i++)
- {
- *(zero + i) = 0;
- }
- }
-
- LLSkipMapNode(const INDEX_TYPE &index, DATA_TYPE datap)
- : mIndex(index)
- {
-
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mForward[i] = NULL;
- }
-
- mData = datap;
- }
-
- ~LLSkipMapNode()
- {
- }
-
-
- INDEX_TYPE mIndex;
- DATA_TYPE mData;
- LLSkipMapNode *mForward[BINARY_DEPTH];
-
- private:
- // Disallow copying of LLSkipMapNodes by not implementing these methods.
- LLSkipMapNode(const LLSkipMapNode &);
- LLSkipMapNode &operator=(const LLSkipMapNode &rhs);
- };
-
- static BOOL defaultEquals(const INDEX_TYPE &first, const INDEX_TYPE &second)
- {
- return first == second;
- }
-
-private:
- // don't generate implicit copy constructor or copy assignment
- LLSkipMap(const LLSkipMap &);
- LLSkipMap &operator=(const LLSkipMap &);
-
-private:
- LLSkipMapNode mHead;
- LLSkipMapNode *mUpdate[BINARY_DEPTH];
- LLSkipMapNode *mCurrentp;
- LLSkipMapNode *mCurrentOperatingp;
- S32 mLevel;
- BOOL (*mInsertFirst)(const INDEX_TYPE &first, const INDEX_TYPE &second);
- BOOL (*mEquals)(const INDEX_TYPE &first, const INDEX_TYPE &second);
- S32 mNumberOfSteps;
-};
-
-//////////////////////////////////////////////////
-//
-// LLSkipMap implementation
-//
-
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::LLSkipMap()
- : mInsertFirst(NULL),
- mEquals(defaultEquals)
-{
- // Skipmaps must have binary depth of at least 2
- cassert(BINARY_DEPTH >= 2);
-
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mUpdate[i] = NULL;
- }
- mLevel = 1;
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
-}
-
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::LLSkipMap(BOOL (*insert_first)(const INDEX_TYPE &first, const INDEX_TYPE &second),
- BOOL (*equals)(const INDEX_TYPE &first, const INDEX_TYPE &second))
- : mInsertFirst(insert_first),
- mEquals(equals)
-{
- // Skipmaps must have binary depth of at least 2
- cassert(BINARY_DEPTH >= 2);
-
- mLevel = 1;
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mHead.mForward[i] = NULL;
- mUpdate[i] = NULL;
- }
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
-}
-
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::~LLSkipMap()
-{
- removeAllData();
-}
-
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline void LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::setInsertFirst(BOOL (*insert_first)(const INDEX_TYPE &first, const INDEX_TYPE &second))
-{
- mInsertFirst = insert_first;
-}
-
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline void LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::setEquals(BOOL (*equals)(const INDEX_TYPE &first, const INDEX_TYPE &second))
-{
- mEquals = equals;
-}
-
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline DATA_TYPE &LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::addData(const INDEX_TYPE &index, DATA_TYPE datap)
-{
- S32 level;
- LLSkipMapNode *current = &mHead;
- LLSkipMapNode *temp;
-
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mIndex, index)))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mIndex < index))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
-
- // we're now just in front of where we want to be . . . take one step forward
- current = *current->mForward;
-
- // replace the existing data if a node is already there
- if ( (current)
- &&(mEquals(current->mIndex, index)))
- {
- current->mData = datap;
- return current->mData;
- }
-
- // now add the new node
- S32 newlevel;
- for (newlevel = 1; newlevel <= mLevel && newlevel < BINARY_DEPTH; newlevel++)
- {
- if (rand() & 1)
- {
- break;
- }
- }
-
- LLSkipMapNode *snode = new LLSkipMapNode(index, datap);
-
- if (newlevel > mLevel)
- {
- mHead.mForward[mLevel] = NULL;
- mUpdate[mLevel] = &mHead;
- mLevel = newlevel;
- }
-
- for (level = 0; level < newlevel; level++)
- {
- snode->mForward[level] = mUpdate[level]->mForward[level];
- mUpdate[level]->mForward[level] = snode;
- }
- return snode->mData;
-}
-
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline DATA_TYPE &LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::addData(const INDEX_TYPE &index)
-{
- S32 level;
- LLSkipMapNode *current = &mHead;
- LLSkipMapNode *temp;
-
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mIndex, index)))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mIndex < index))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
-
- // we're now just in front of where we want to be . . . take one step forward
- current = *current->mForward;
-
- // now add the new node
- S32 newlevel;
- for (newlevel = 1; newlevel <= mLevel && newlevel < BINARY_DEPTH; newlevel++)
- {
- if (rand() & 1)
- break;
- }
-
- LLSkipMapNode *snode = new LLSkipMapNode(index);
-
- if (newlevel > mLevel)
- {
- mHead.mForward[mLevel] = NULL;
- mUpdate[mLevel] = &mHead;
- mLevel = newlevel;
- }
-
- for (level = 0; level < newlevel; level++)
- {
- snode->mForward[level] = mUpdate[level]->mForward[level];
- mUpdate[level]->mForward[level] = snode;
- }
- return snode->mData;
-}
-
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline DATA_TYPE &LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::getData(const INDEX_TYPE &index)
-{
- S32 level;
- LLSkipMapNode *current = &mHead;
- LLSkipMapNode *temp;
-
- mNumberOfSteps = 0;
-
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mIndex, index)))
- {
- current = temp;
- temp = *(current->mForward + level);
- mNumberOfSteps++;
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mIndex < index))
- {
- current = temp;
- temp = *(current->mForward + level);
- mNumberOfSteps++;
- }
- *(mUpdate + level) = current;
- }
- }
-
- // we're now just in front of where we want to be . . . take one step forward
- current = *current->mForward;
- mNumberOfSteps++;
-
- if ( (current)
- &&(mEquals(current->mIndex, index)))
- {
-
- return current->mData;
- }
-
- // now add the new node
- S32 newlevel;
- for (newlevel = 1; newlevel <= mLevel && newlevel < BINARY_DEPTH; newlevel++)
- {
- if (rand() & 1)
- break;
- }
-
- LLSkipMapNode *snode = new LLSkipMapNode(index);
-
- if (newlevel > mLevel)
- {
- mHead.mForward[mLevel] = NULL;
- mUpdate[mLevel] = &mHead;
- mLevel = newlevel;
- }
-
- for (level = 0; level < newlevel; level++)
- {
- snode->mForward[level] = mUpdate[level]->mForward[level];
- mUpdate[level]->mForward[level] = snode;
- }
-
- return snode->mData;
-}
-
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline DATA_TYPE &LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::operator[](const INDEX_TYPE &index)
-{
-
- return getData(index);
-}
-
-// If index present, returns data.
-// If index not present, adds <index,NULL> and returns NULL.
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline DATA_TYPE &LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::getData(const INDEX_TYPE &index, BOOL &b_new_entry)
-{
- S32 level;
- LLSkipMapNode *current = &mHead;
- LLSkipMapNode *temp;
-
- mNumberOfSteps = 0;
-
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mIndex, index)))
- {
- current = temp;
- temp = *(current->mForward + level);
- mNumberOfSteps++;
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mIndex < index))
- {
- current = temp;
- temp = *(current->mForward + level);
- mNumberOfSteps++;
- }
- *(mUpdate + level) = current;
- }
- }
-
- // we're now just in front of where we want to be . . . take one step forward
- mNumberOfSteps++;
- current = *current->mForward;
-
- if ( (current)
- &&(mEquals(current->mIndex, index)))
- {
-
- return current->mData;
- }
- b_new_entry = TRUE;
- addData(index);
-
- return current->mData;
-}
-
-// Returns TRUE if data present in map.
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline BOOL LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::checkData(const INDEX_TYPE &index)
-{
- S32 level;
- LLSkipMapNode *current = &mHead;
- LLSkipMapNode *temp;
-
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mIndex, index)))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mIndex < index))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
-
- // we're now just in front of where we want to be . . . take one step forward
- current = *current->mForward;
-
- if (current)
- {
- // Gets rid of some compiler ambiguity for the LLPointer<> templated class.
- if (current->mData)
- {
- return mEquals(current->mIndex, index);
- }
- }
-
- return FALSE;
-}
-
-// Returns TRUE if key is present in map. This is useful if you
-// are potentially storing NULL pointers in the map
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline BOOL LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::checkKey(const INDEX_TYPE &index)
-{
- S32 level;
- LLSkipMapNode *current = &mHead;
- LLSkipMapNode *temp;
-
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mIndex, index)))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mIndex < index))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
-
- // we're now just in front of where we want to be . . . take one step forward
- current = *current->mForward;
-
- if (current)
- {
- return mEquals(current->mIndex, index);
- }
-
- return FALSE;
-}
-
-// If there, returns the data.
-// If not, returns NULL.
-// Never adds entries to the map.
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline DATA_TYPE LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::getIfThere(const INDEX_TYPE &index)
-{
- S32 level;
- LLSkipMapNode *current = &mHead;
- LLSkipMapNode *temp;
-
- mNumberOfSteps = 0;
-
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mIndex, index)))
- {
- current = temp;
- temp = *(current->mForward + level);
- mNumberOfSteps++;
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mIndex < index))
- {
- current = temp;
- temp = *(current->mForward + level);
- mNumberOfSteps++;
- }
- *(mUpdate + level) = current;
- }
- }
-
- // we're now just in front of where we want to be . . . take one step forward
- mNumberOfSteps++;
- current = *current->mForward;
-
- if (current)
- {
- if (mEquals(current->mIndex, index))
- {
- return current->mData;
- }
- }
-
- // Avoid Linux compiler warning on returning NULL.
- return DATA_TYPE();
-}
-
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline INDEX_TYPE LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::reverseLookup(const DATA_TYPE datap)
-{
- LLSkipMapNode *current = &mHead;
-
- while (current)
- {
- if (datap == current->mData)
- {
-
- return current->mIndex;
- }
- current = *current->mForward;
- }
-
- // not found! return NULL
- return INDEX_TYPE();
-}
-
-// returns number of items in the list
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline S32 LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::getLength()
-{
- U32 length = 0;
- for (LLSkipMapNode* temp = *(mHead.mForward); temp != NULL; temp = temp->mForward[0])
- {
- length++;
- }
-
- return length;
-}
-
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline BOOL LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::removeData(const INDEX_TYPE &index)
-{
- S32 level;
- LLSkipMapNode *current = &mHead;
- LLSkipMapNode *temp;
-
- // find the pointer one in front of the one we want
- if (mInsertFirst)
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(mInsertFirst(temp->mIndex, index)))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
- else
- {
- for (level = mLevel - 1; level >= 0; level--)
- {
- temp = *(current->mForward + level);
- while ( (temp)
- &&(temp->mIndex < index))
- {
- current = temp;
- temp = *(current->mForward + level);
- }
- *(mUpdate + level) = current;
- }
- }
-
- // we're now just in front of where we want to be . . . take one step forward
- current = *current->mForward;
-
- if (!current)
- {
- // empty list or beyond the end!
-
- return FALSE;
- }
-
- // is this the one we want?
- if (!mEquals(current->mIndex, index))
- {
- // nope!
-
- return FALSE;
- }
- else
- {
- // do we need to fix current or currentop?
- if (current == mCurrentp)
- {
- mCurrentp = *current->mForward;
- }
-
- if (current == mCurrentOperatingp)
- {
- mCurrentOperatingp = *current->mForward;
- }
- // yes it is! change pointers as required
- for (level = 0; level < mLevel; level++)
- {
- if (*((*(mUpdate + level))->mForward + level) != current)
- {
- // cool, we've fixed all the pointers!
- break;
- }
- *((*(mUpdate + level))->mForward + level) = *(current->mForward + level);
- }
-
- delete current;
-
- // clean up mHead
- while ( (mLevel > 1)
- &&(!*(mHead.mForward + mLevel - 1)))
- {
- mLevel--;
- }
- }
-
- return TRUE;
-}
-
-
-// remove all nodes from the list but do not delete data
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-void LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::removeAllData()
-{
- LLSkipMapNode *temp;
- // reset mCurrentp
- mCurrentp = *(mHead.mForward);
-
- while (mCurrentp)
- {
- temp = mCurrentp->mForward[0];
- delete mCurrentp;
- mCurrentp = temp;
- }
-
- S32 i;
- for (i = 0; i < BINARY_DEPTH; i++)
- {
- mHead.mForward[i] = NULL;
- mUpdate[i] = NULL;
- }
-
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
-}
-
-
-// place mCurrentp on first node
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline void LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::resetList()
-{
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
-}
-
-
-// return the data currently pointed to
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline DATA_TYPE LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::getCurrentDataWithoutIncrement()
-{
- if (mCurrentOperatingp)
- {
- return mCurrentOperatingp->mData;
- }
- else
- {
- return DATA_TYPE();
- }
-}
-
-// return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline DATA_TYPE LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::getCurrentData()
-{
- if (mCurrentp)
- {
- mCurrentOperatingp = mCurrentp;
- mCurrentp = mCurrentp->mForward[0];
- return mCurrentOperatingp->mData;
- }
- else
- {
- // Basic types, like int, have default constructors that initialize
- // them to zero. g++ 2.95 supports this. "int()" is zero.
- // This also is nice for LLUUID()
- return DATA_TYPE();
- }
-}
-
-// same as getCurrentData() but a more intuitive name for the operation
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline DATA_TYPE LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::getNextData()
-{
- if (mCurrentp)
- {
- mCurrentOperatingp = mCurrentp;
- mCurrentp = mCurrentp->mForward[0];
- return mCurrentOperatingp->mData;
- }
- else
- {
- // Basic types, like int, have default constructors that initialize
- // them to zero. g++ 2.95 supports this. "int()" is zero.
- // This also is nice for LLUUID()
- return DATA_TYPE();
- }
-}
-
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline INDEX_TYPE LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::getNextKey()
-{
- if (mCurrentp)
- {
- mCurrentOperatingp = mCurrentp;
- mCurrentp = mCurrentp->mForward[0];
- return mCurrentOperatingp->mIndex;
- }
- else
- {
- return mHead.mIndex;
- }
-}
-
-// return the key currently pointed to
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline INDEX_TYPE LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::getCurrentKeyWithoutIncrement()
-{
- if (mCurrentOperatingp)
- {
- return mCurrentOperatingp->mIndex;
- }
- else
- {
- // See comment for getNextData()
- return INDEX_TYPE();
- }
-}
-
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline BOOL LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::notDone() const
-{
- if (mCurrentOperatingp)
- {
- return TRUE;
- }
- else
- {
- return FALSE;
- }
-}
-
-
-// remove the Node at mCurentOperatingp
-// leave mCurrentp and mCurentOperatingp on the next entry
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline void LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::removeCurrentData()
-{
- if (mCurrentOperatingp)
- {
- removeData(mCurrentOperatingp->mIndex);
- }
-}
-
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline void LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::deleteCurrentData()
-{
- if (mCurrentOperatingp)
- {
- deleteData(mCurrentOperatingp->mIndex);
- }
-}
-
-// reset the list and return the data currently pointed to, set mCurentOperatingp to that node and bump mCurrentp
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline DATA_TYPE LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::getFirstData()
-{
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
- if (mCurrentp)
- {
- mCurrentOperatingp = mCurrentp;
- mCurrentp = mCurrentp->mForward[0];
- return mCurrentOperatingp->mData;
- }
- else
- {
- // See comment for getNextData()
- return DATA_TYPE();
- }
-}
-
-template <class INDEX_TYPE, class DATA_TYPE, S32 BINARY_DEPTH>
-inline INDEX_TYPE LLSkipMap<INDEX_TYPE, DATA_TYPE, BINARY_DEPTH>::getFirstKey()
-{
- mCurrentp = *(mHead.mForward);
- mCurrentOperatingp = *(mHead.mForward);
- if (mCurrentp)
- {
- mCurrentOperatingp = mCurrentp;
- mCurrentp = mCurrentp->mForward[0];
- return mCurrentOperatingp->mIndex;
- }
- else
- {
- return mHead.mIndex;
- }
-}
-
-#endif
diff --git a/indra/llcommon/llsortedvector.h b/indra/llcommon/llsortedvector.h
deleted file mode 100755
index 391b82ee44..0000000000
--- a/indra/llcommon/llsortedvector.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/**
- * @file llsortedvector.h
- * @author Nat Goodspeed
- * @date 2012-04-08
- * @brief LLSortedVector class wraps a vector that we maintain in sorted
- * order so we can perform binary-search lookups.
- *
- * $LicenseInfo:firstyear=2012&license=viewerlgpl$
- * Copyright (c) 2012, Linden Research, Inc.
- * $/LicenseInfo$
- */
-
-#if ! defined(LL_LLSORTEDVECTOR_H)
-#define LL_LLSORTEDVECTOR_H
-
-#include <vector>
-#include <algorithm>
-
-/**
- * LLSortedVector contains a std::vector<std::pair> that we keep sorted on the
- * first of the pair. This makes insertion somewhat more expensive than simple
- * std::vector::push_back(), but allows us to use binary search for lookups.
- * It's intended for small aggregates where lookup is far more performance-
- * critical than insertion; in such cases a binary search on a small, sorted
- * std::vector can be more performant than a std::map lookup.
- */
-template <typename KEY, typename VALUE>
-class LLSortedVector
-{
-public:
- typedef LLSortedVector<KEY, VALUE> self;
- typedef KEY key_type;
- typedef VALUE mapped_type;
- typedef std::pair<key_type, mapped_type> value_type;
- typedef std::vector<value_type> PairVector;
- typedef typename PairVector::iterator iterator;
- typedef typename PairVector::const_iterator const_iterator;
-
- /// Empty
- LLSortedVector() {}
-
- /// Fixed initial size
- LLSortedVector(std::size_t size):
- mVector(size)
- {}
-
- /// Bulk load
- template <typename ITER>
- LLSortedVector(ITER begin, ITER end):
- mVector(begin, end)
- {
- // Allow caller to dump in a bunch of (pairs convertible to)
- // value_type if desired, but make sure we sort afterwards.
- std::sort(mVector.begin(), mVector.end());
- }
-
- /// insert(key, value)
- std::pair<iterator, bool> insert(const key_type& key, const mapped_type& value)
- {
- return insert(value_type(key, value));
- }
-
- /// insert(value_type)
- std::pair<iterator, bool> insert(const value_type& pair)
- {
- typedef std::pair<iterator, bool> iterbool;
- iterator found = std::lower_bound(mVector.begin(), mVector.end(), pair,
- less<value_type>());
- // have to check for end() before it's even valid to dereference
- if (found == mVector.end())
- {
- std::size_t index(mVector.size());
- mVector.push_back(pair);
- // don't forget that push_back() invalidates 'found'
- return iterbool(mVector.begin() + index, true);
- }
- if (found->first == pair.first)
- {
- return iterbool(found, false);
- }
- // remember that insert() invalidates 'found' -- save index
- std::size_t index(found - mVector.begin());
- mVector.insert(found, pair);
- // okay, convert from index back to iterator
- return iterbool(mVector.begin() + index, true);
- }
-
- iterator begin() { return mVector.begin(); }
- iterator end() { return mVector.end(); }
- const_iterator begin() const { return mVector.begin(); }
- const_iterator end() const { return mVector.end(); }
-
- bool empty() const { return mVector.empty(); }
- std::size_t size() const { return mVector.size(); }
-
- /// find
- iterator find(const key_type& key)
- {
- iterator found = std::lower_bound(mVector.begin(), mVector.end(),
- value_type(key, mapped_type()),
- less<value_type>());
- if (found == mVector.end() || found->first != key)
- return mVector.end();
- return found;
- }
-
- const_iterator find(const key_type& key) const
- {
- return const_cast<self*>(this)->find(key);
- }
-
-private:
- // Define our own 'less' comparator so we can specialize without messing
- // with std::less.
- template <typename T>
- struct less: public std::less<T> {};
-
- // Specialize 'less' for an LLSortedVector::value_type involving
- // std::type_info*. This is one of LLSortedVector's foremost use cases. We
- // specialize 'less' rather than just defining a specific comparator
- // because LLSortedVector should be usable for other key_types as well.
- template <typename T>
- struct less< std::pair<std::type_info*, T> >:
- public std::binary_function<std::pair<std::type_info*, T>,
- std::pair<std::type_info*, T>,
- bool>
- {
- bool operator()(const std::pair<std::type_info*, T>& lhs,
- const std::pair<std::type_info*, T>& rhs) const
- {
- return lhs.first->before(*rhs.first);
- }
- };
-
- // Same as above, but with const std::type_info*.
- template <typename T>
- struct less< std::pair<const std::type_info*, T> >:
- public std::binary_function<std::pair<const std::type_info*, T>,
- std::pair<const std::type_info*, T>,
- bool>
- {
- bool operator()(const std::pair<const std::type_info*, T>& lhs,
- const std::pair<const std::type_info*, T>& rhs) const
- {
- return lhs.first->before(*rhs.first);
- }
- };
-
- PairVector mVector;
-};
-
-#endif /* ! defined(LL_LLSORTEDVECTOR_H) */
diff --git a/indra/llcommon/llstacktrace.cpp b/indra/llcommon/llstacktrace.cpp
index ccd7ef91c2..e0e9056380 100755
--- a/indra/llcommon/llstacktrace.cpp
+++ b/indra/llcommon/llstacktrace.cpp
@@ -32,7 +32,7 @@
#include <iostream>
#include <sstream>
-#include "windows.h"
+#include "llwin32headerslean.h"
#include "Dbghelp.h"
typedef USHORT NTAPI RtlCaptureStackBackTrace_Function(
diff --git a/indra/llcommon/llstat.cpp b/indra/llcommon/llstat.cpp
deleted file mode 100755
index 3678c8e1c1..0000000000
--- a/indra/llcommon/llstat.cpp
+++ /dev/null
@@ -1,404 +0,0 @@
-/**
- * @file llstat.cpp
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "linden_common.h"
-
-#include "llstat.h"
-#include "lllivefile.h"
-#include "llerrorcontrol.h"
-#include "llframetimer.h"
-#include "timing.h"
-#include "llsd.h"
-#include "llsdserialize.h"
-#include "llstl.h"
-#include "u64.h"
-
-
-// statics
-//------------------------------------------------------------------------
-LLTimer LLStat::sTimer;
-LLFrameTimer LLStat::sFrameTimer;
-
-void LLStat::reset()
-{
- mNumValues = 0;
- mLastValue = 0.f;
- delete[] mBins;
- mBins = new ValueEntry[mNumBins];
- mCurBin = mNumBins-1;
- mNextBin = 0;
-}
-
-LLStat::LLStat(std::string name, S32 num_bins, BOOL use_frame_timer)
-: mUseFrameTimer(use_frame_timer),
- mNumBins(num_bins),
- mName(name),
- mBins(NULL)
-{
- llassert(mNumBins > 0);
- mLastTime = 0.f;
-
- reset();
-
- if (!mName.empty())
- {
- stat_map_t::iterator iter = getStatList().find(mName);
- if (iter != getStatList().end())
- llwarns << "LLStat with duplicate name: " << mName << llendl;
- getStatList().insert(std::make_pair(mName, this));
- }
-}
-
-LLStat::stat_map_t& LLStat::getStatList()
-{
- static LLStat::stat_map_t stat_list;
- return stat_list;
-}
-
-
-LLStat::~LLStat()
-{
- delete[] mBins;
-
- if (!mName.empty())
- {
- // handle multiple entries with the same name
- stat_map_t::iterator iter = getStatList().find(mName);
- while (iter != getStatList().end() && iter->second != this)
- ++iter;
- getStatList().erase(iter);
- }
-}
-
-void LLStat::start()
-{
- if (mUseFrameTimer)
- {
- mBins[mNextBin].mBeginTime = sFrameTimer.getElapsedSeconds();
- }
- else
- {
- mBins[mNextBin].mBeginTime = sTimer.getElapsedTimeF64();
- }
-}
-
-void LLStat::addValue(const F32 value)
-{
- if (mNumValues < mNumBins)
- {
- mNumValues++;
- }
-
- // Increment the bin counters.
- mCurBin++;
- if (mCurBin >= mNumBins)
- {
- mCurBin = 0;
- }
- mNextBin++;
- if (mNextBin >= mNumBins)
- {
- mNextBin = 0;
- }
-
- mBins[mCurBin].mValue = value;
- if (mUseFrameTimer)
- {
- mBins[mCurBin].mTime = sFrameTimer.getElapsedSeconds();
- }
- else
- {
- mBins[mCurBin].mTime = sTimer.getElapsedTimeF64();
- }
- mBins[mCurBin].mDT = (F32)(mBins[mCurBin].mTime - mBins[mCurBin].mBeginTime);
-
- //this value is used to prime the min/max calls
- mLastTime = mBins[mCurBin].mTime;
- mLastValue = value;
-
- // Set the begin time for the next stat segment.
- mBins[mNextBin].mBeginTime = mBins[mCurBin].mTime;
- mBins[mNextBin].mTime = mBins[mCurBin].mTime;
- mBins[mNextBin].mDT = 0.f;
-}
-
-
-F32 LLStat::getMax() const
-{
- S32 i;
- F32 current_max = mLastValue;
- if (mNumBins == 0)
- {
- current_max = 0.f;
- }
- else
- {
- for (i = 0; (i < mNumBins) && (i < mNumValues); i++)
- {
- // Skip the bin we're currently filling.
- if (i == mNextBin)
- {
- continue;
- }
- if (mBins[i].mValue > current_max)
- {
- current_max = mBins[i].mValue;
- }
- }
- }
- return current_max;
-}
-
-F32 LLStat::getMean() const
-{
- S32 i;
- F32 current_mean = 0.f;
- S32 samples = 0;
- for (i = 0; (i < mNumBins) && (i < mNumValues); i++)
- {
- // Skip the bin we're currently filling.
- if (i == mNextBin)
- {
- continue;
- }
- current_mean += mBins[i].mValue;
- samples++;
- }
-
- // There will be a wrap error at 2^32. :)
- if (samples != 0)
- {
- current_mean /= samples;
- }
- else
- {
- current_mean = 0.f;
- }
- return current_mean;
-}
-
-F32 LLStat::getMin() const
-{
- S32 i;
- F32 current_min = mLastValue;
-
- if (mNumBins == 0)
- {
- current_min = 0.f;
- }
- else
- {
- for (i = 0; (i < mNumBins) && (i < mNumValues); i++)
- {
- // Skip the bin we're currently filling.
- if (i == mNextBin)
- {
- continue;
- }
- if (mBins[i].mValue < current_min)
- {
- current_min = mBins[i].mValue;
- }
- }
- }
- return current_min;
-}
-
-F32 LLStat::getPrev(S32 age) const
-{
- S32 bin;
- bin = mCurBin - age;
-
- while (bin < 0)
- {
- bin += mNumBins;
- }
-
- if (bin == mNextBin)
- {
- // Bogus for bin we're currently working on.
- return 0.f;
- }
- return mBins[bin].mValue;
-}
-
-F32 LLStat::getPrevPerSec(S32 age) const
-{
- S32 bin;
- bin = mCurBin - age;
-
- while (bin < 0)
- {
- bin += mNumBins;
- }
-
- if (bin == mNextBin)
- {
- // Bogus for bin we're currently working on.
- return 0.f;
- }
- return mBins[bin].mValue / mBins[bin].mDT;
-}
-
-F32 LLStat::getCurrent() const
-{
- return mBins[mCurBin].mValue;
-}
-
-F32 LLStat::getCurrentPerSec() const
-{
- return mBins[mCurBin].mValue / mBins[mCurBin].mDT;
-}
-
-F32 LLStat::getMeanPerSec() const
-{
- S32 i;
- F32 value = 0.f;
- F32 dt = 0.f;
-
- for (i = 0; (i < mNumBins) && (i < mNumValues); i++)
- {
- // Skip the bin we're currently filling.
- if (i == mNextBin)
- {
- continue;
- }
- value += mBins[i].mValue;
- dt += mBins[i].mDT;
- }
-
- if (dt > 0.f)
- {
- return value/dt;
- }
- else
- {
- return 0.f;
- }
-}
-
-F32 LLStat::getMeanDuration() const
-{
- F32 dur = 0.0f;
- S32 count = 0;
- for (S32 i=0; (i < mNumBins) && (i < mNumValues); i++)
- {
- if (i == mNextBin)
- {
- continue;
- }
- dur += mBins[i].mDT;
- count++;
- }
-
- if (count > 0)
- {
- dur /= F32(count);
- return dur;
- }
- else
- {
- return 0.f;
- }
-}
-
-F32 LLStat::getMaxPerSec() const
-{
- F32 value;
-
- if (mNextBin != 0)
- {
- value = mBins[0].mValue/mBins[0].mDT;
- }
- else if (mNumValues > 0)
- {
- value = mBins[1].mValue/mBins[1].mDT;
- }
- else
- {
- value = 0.f;
- }
-
- for (S32 i = 0; (i < mNumBins) && (i < mNumValues); i++)
- {
- // Skip the bin we're currently filling.
- if (i == mNextBin)
- {
- continue;
- }
- value = llmax(value, mBins[i].mValue/mBins[i].mDT);
- }
- return value;
-}
-
-F32 LLStat::getMinPerSec() const
-{
- S32 i;
- F32 value;
-
- if (mNextBin != 0)
- {
- value = mBins[0].mValue/mBins[0].mDT;
- }
- else if (mNumValues > 0)
- {
- value = mBins[1].mValue/mBins[0].mDT;
- }
- else
- {
- value = 0.f;
- }
-
- for (i = 0; (i < mNumBins) && (i < mNumValues); i++)
- {
- // Skip the bin we're currently filling.
- if (i == mNextBin)
- {
- continue;
- }
- value = llmin(value, mBins[i].mValue/mBins[i].mDT);
- }
- return value;
-}
-
-U32 LLStat::getNumValues() const
-{
- return mNumValues;
-}
-
-S32 LLStat::getNumBins() const
-{
- return mNumBins;
-}
-
-S32 LLStat::getNextBin() const
-{
- return mNextBin;
-}
-
-F64 LLStat::getLastTime() const
-{
- return mLastTime;
-}
diff --git a/indra/llcommon/llstat.h b/indra/llcommon/llstat.h
deleted file mode 100755
index 38377a010b..0000000000
--- a/indra/llcommon/llstat.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/**
- * @file llstat.h
- * @brief Runtime statistics accumulation.
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLSTAT_H
-#define LL_LLSTAT_H
-
-#include <map>
-
-#include "lltimer.h"
-#include "llframetimer.h"
-
-class LLSD;
-
-// ----------------------------------------------------------------------------
-class LL_COMMON_API LLStat
-{
-private:
- typedef std::multimap<std::string, LLStat*> stat_map_t;
-
- static stat_map_t& getStatList();
-
-public:
- LLStat(std::string name = std::string(), S32 num_bins = 32, BOOL use_frame_timer = FALSE);
- ~LLStat();
-
- void start(); // Start the timer for the current "frame", otherwise uses the time tracked from
- // the last addValue
- void reset();
- void addValue(const F32 value = 1.f); // Adds the current value being tracked, and tracks the DT.
- void addValue(const S32 value) { addValue((F32)value); }
- void addValue(const U32 value) { addValue((F32)value); }
-
- S32 getNextBin() const;
-
- F32 getPrev(S32 age) const; // Age is how many "addValues" previously - zero is current
- F32 getPrevPerSec(S32 age) const; // Age is how many "addValues" previously - zero is current
- F32 getCurrent() const;
- F32 getCurrentPerSec() const;
-
- F32 getMin() const;
- F32 getMinPerSec() const;
- F32 getMean() const;
- F32 getMeanPerSec() const;
- F32 getMeanDuration() const;
- F32 getMax() const;
- F32 getMaxPerSec() const;
-
- U32 getNumValues() const;
- S32 getNumBins() const;
-
- F64 getLastTime() const;
-private:
- BOOL mUseFrameTimer;
- U32 mNumValues;
- U32 mNumBins;
- F32 mLastValue;
- F64 mLastTime;
-
- struct ValueEntry
- {
- ValueEntry()
- : mValue(0.f),
- mBeginTime(0.0),
- mTime(0.0),
- mDT(0.f)
- {}
- F32 mValue;
- F64 mBeginTime;
- F64 mTime;
- F32 mDT;
- };
- ValueEntry* mBins;
- S32 mCurBin;
- S32 mNextBin;
-
- std::string mName;
-
- static LLTimer sTimer;
- static LLFrameTimer sFrameTimer;
-
-public:
- static LLStat* getStat(const std::string& name)
- {
- // return the first stat that matches 'name'
- stat_map_t::iterator iter = getStatList().find(name);
- if (iter != getStatList().end())
- return iter->second;
- else
- return NULL;
- }
-};
-
-#endif // LL_STAT_
diff --git a/indra/llcommon/llstatenums.h b/indra/llcommon/llstatenums.h
index 81c4085d16..6515a3e3cb 100755..100644
--- a/indra/llcommon/llstatenums.h
+++ b/indra/llcommon/llstatenums.h
@@ -26,50 +26,6 @@
#ifndef LL_LLSTATENUMS_H
#define LL_LLSTATENUMS_H
-enum
-{
- LL_SIM_STAT_TIME_DILATION = 0,
- LL_SIM_STAT_FPS = 1,
- LL_SIM_STAT_PHYSFPS = 2,
- LL_SIM_STAT_AGENTUPS = 3,
- LL_SIM_STAT_FRAMEMS = 4,
- LL_SIM_STAT_NETMS = 5,
- LL_SIM_STAT_SIMOTHERMS = 6,
- LL_SIM_STAT_SIMPHYSICSMS = 7,
- LL_SIM_STAT_AGENTMS = 8,
- LL_SIM_STAT_IMAGESMS = 9,
- LL_SIM_STAT_SCRIPTMS = 10,
- LL_SIM_STAT_NUMTASKS = 11,
- LL_SIM_STAT_NUMTASKSACTIVE = 12,
- LL_SIM_STAT_NUMAGENTMAIN = 13,
- LL_SIM_STAT_NUMAGENTCHILD = 14,
- LL_SIM_STAT_NUMSCRIPTSACTIVE = 15,
- LL_SIM_STAT_LSLIPS = 16,
- LL_SIM_STAT_INPPS = 17,
- LL_SIM_STAT_OUTPPS = 18,
- LL_SIM_STAT_PENDING_DOWNLOADS = 19,
- LL_SIM_STAT_PENDING_UPLOADS = 20,
- LL_SIM_STAT_VIRTUAL_SIZE_KB = 21,
- LL_SIM_STAT_RESIDENT_SIZE_KB = 22,
- LL_SIM_STAT_PENDING_LOCAL_UPLOADS = 23,
- LL_SIM_STAT_TOTAL_UNACKED_BYTES = 24,
- LL_SIM_STAT_PHYSICS_PINNED_TASKS = 25,
- LL_SIM_STAT_PHYSICS_LOD_TASKS = 26,
- LL_SIM_STAT_SIMPHYSICSSTEPMS = 27,
- LL_SIM_STAT_SIMPHYSICSSHAPEMS = 28,
- LL_SIM_STAT_SIMPHYSICSOTHERMS = 29,
- LL_SIM_STAT_SIMPHYSICSMEMORY = 30,
- LL_SIM_STAT_SCRIPT_EPS = 31,
- LL_SIM_STAT_SIMSPARETIME = 32,
- LL_SIM_STAT_SIMSLEEPTIME = 33,
- LL_SIM_STAT_IOPUMPTIME = 34,
- LL_SIM_STAT_PCTSCRIPTSRUN = 35,
- LL_SIM_STAT_REGION_IDLE = 36, // dataserver only
- LL_SIM_STAT_REGION_IDLE_POSSIBLE = 37, // dataserver only
- LL_SIM_STAT_SIMAISTEPTIMEMS = 38,
- LL_SIM_STAT_SKIPPEDAISILSTEPS_PS = 39,
- LL_SIM_STAT_PCTSTEPPEDCHARACTERS = 40
-};
#endif
diff --git a/indra/llcommon/llstl.h b/indra/llcommon/llstl.h
index 0a39288f5a..02f10fa2ba 100755
--- a/indra/llcommon/llstl.h
+++ b/indra/llcommon/llstl.h
@@ -31,8 +31,8 @@
#include <algorithm>
#include <map>
#include <vector>
+#include <list>
#include <set>
-#include <deque>
#include <typeinfo>
// Use to compare the first element only of a pair
@@ -125,7 +125,7 @@ struct DeletePairedPointerArray
// compiler, the second unary_function template parameter can be set
// to void.
//
-// Here's a snippit showing how you use this object:
+// Here's a snippet showing how you use this object:
//
// typedef std::map<int, widget*> map_type;
// map_type widget_map;
@@ -170,6 +170,49 @@ struct CopyNewPointer
}
};
+template<typename T, typename ALLOC>
+void delete_and_clear(std::list<T*, ALLOC>& list)
+{
+ std::for_each(list.begin(), list.end(), DeletePointer());
+ list.clear();
+}
+
+template<typename T, typename ALLOC>
+void delete_and_clear(std::vector<T*, ALLOC>& vector)
+{
+ std::for_each(vector.begin(), vector.end(), DeletePointer());
+ vector.clear();
+}
+
+template<typename T, typename COMPARE, typename ALLOC>
+void delete_and_clear(std::set<T*, COMPARE, ALLOC>& set)
+{
+ std::for_each(set.begin(), set.end(), DeletePointer());
+ set.clear();
+}
+
+template<typename K, typename V, typename COMPARE, typename ALLOC>
+void delete_and_clear(std::map<K, V*, COMPARE, ALLOC>& map)
+{
+ std::for_each(map.begin(), map.end(), DeletePairedPointer());
+ map.clear();
+}
+
+template<typename T>
+void delete_and_clear(T*& ptr)
+{
+ delete ptr;
+ ptr = NULL;
+}
+
+
+template<typename T>
+void delete_and_clear_array(T*& ptr)
+{
+ delete[] ptr;
+ ptr = NULL;
+}
+
// Simple function to help with finding pointers in maps.
// For example:
// typedef map_t;
@@ -229,7 +272,6 @@ inline T get_if_there(const std::map<K,T>& inmap, const K& key, T default_value)
}
};
-// Useful for replacing the removeObj() functionality of LLDynamicArray
// Example:
// for (std::vector<T>::iterator iter = mList.begin(); iter != mList.end(); )
// {
@@ -238,8 +280,8 @@ inline T get_if_there(const std::map<K,T>& inmap, const K& key, T default_value)
// else
// ++iter;
// }
-template <typename T, typename Iter>
-inline Iter vector_replace_with_last(std::vector<T>& invec, Iter iter)
+template <typename T>
+inline typename std::vector<T>::iterator vector_replace_with_last(std::vector<T>& invec, typename std::vector<T>::iterator iter)
{
typename std::vector<T>::iterator last = invec.end(); --last;
if (iter == invec.end())
@@ -259,7 +301,6 @@ inline Iter vector_replace_with_last(std::vector<T>& invec, Iter iter)
}
};
-// Useful for replacing the removeObj() functionality of LLDynamicArray
// Example:
// vector_replace_with_last(mList, x);
template <typename T>
@@ -522,4 +563,151 @@ namespace std
};
} // std
+
+/**
+ * Implementation for ll_template_cast() (q.v.).
+ *
+ * Default implementation: trying to cast two completely unrelated types
+ * returns 0. Typically you'd specify T and U as pointer types, but in fact T
+ * can be any type that can be initialized with 0.
+ */
+template <typename T, typename U>
+struct ll_template_cast_impl
+{
+ T operator()(U)
+ {
+ return 0;
+ }
+};
+
+/**
+ * ll_template_cast<T>(some_value) is for use in a template function when
+ * some_value might be of arbitrary type, but you want to recognize type T
+ * specially.
+ *
+ * It's designed for use with pointer types. Example:
+ * @code
+ * struct SpecialClass
+ * {
+ * void someMethod(const std::string&) const;
+ * };
+ *
+ * template <class REALCLASS>
+ * void somefunc(const REALCLASS& instance)
+ * {
+ * const SpecialClass* ptr = ll_template_cast<const SpecialClass*>(&instance);
+ * if (ptr)
+ * {
+ * ptr->someMethod("Call method only available on SpecialClass");
+ * }
+ * }
+ * @endcode
+ *
+ * Why is this better than dynamic_cast<>? Because unless OtherClass is
+ * polymorphic, the following won't even compile (gcc 4.0.1):
+ * @code
+ * OtherClass other;
+ * SpecialClass* ptr = dynamic_cast<SpecialClass*>(&other);
+ * @endcode
+ * to say nothing of this:
+ * @code
+ * void function(int);
+ * SpecialClass* ptr = dynamic_cast<SpecialClass*>(&function);
+ * @endcode
+ * ll_template_cast handles these kinds of cases by returning 0.
+ */
+template <typename T, typename U>
+T ll_template_cast(U value)
+{
+ return ll_template_cast_impl<T, U>()(value);
+}
+
+/**
+ * Implementation for ll_template_cast() (q.v.).
+ *
+ * Implementation for identical types: return same value.
+ */
+template <typename T>
+struct ll_template_cast_impl<T, T>
+{
+ T operator()(T value)
+ {
+ return value;
+ }
+};
+
+/**
+ * LL_TEMPLATE_CONVERTIBLE(dest, source) asserts that, for a value @c s of
+ * type @c source, <tt>ll_template_cast<dest>(s)</tt> will return @c s --
+ * presuming that @c source can be converted to @c dest by the normal rules of
+ * C++.
+ *
+ * By default, <tt>ll_template_cast<dest>(s)</tt> will return 0 unless @c s's
+ * type is literally identical to @c dest. (This is because of the
+ * straightforward application of template specialization rules.) That can
+ * lead to surprising results, e.g.:
+ *
+ * @code
+ * Foo myFoo;
+ * const Foo* fooptr = ll_template_cast<const Foo*>(&myFoo);
+ * @endcode
+ *
+ * Here @c fooptr will be 0 because <tt>&myFoo</tt> is of type <tt>Foo*</tt>
+ * -- @em not <tt>const Foo*</tt>. (Declaring <tt>const Foo myFoo;</tt> would
+ * force the compiler to do the right thing.)
+ *
+ * More disappointingly:
+ * @code
+ * struct Base {};
+ * struct Subclass: public Base {};
+ * Subclass object;
+ * Base* ptr = ll_template_cast<Base*>(&object);
+ * @endcode
+ *
+ * Here @c ptr will be 0 because <tt>&object</tt> is of type
+ * <tt>Subclass*</tt> rather than <tt>Base*</tt>. We @em want this cast to
+ * succeed, but without our help ll_template_cast can't recognize it.
+ *
+ * The following would suffice:
+ * @code
+ * LL_TEMPLATE_CONVERTIBLE(Base*, Subclass*);
+ * ...
+ * Base* ptr = ll_template_cast<Base*>(&object);
+ * @endcode
+ *
+ * However, as noted earlier, this is easily fooled:
+ * @code
+ * const Base* ptr = ll_template_cast<const Base*>(&object);
+ * @endcode
+ * would still produce 0 because we haven't yet seen:
+ * @code
+ * LL_TEMPLATE_CONVERTIBLE(const Base*, Subclass*);
+ * @endcode
+ *
+ * @TODO
+ * This macro should use Boost type_traits facilities for stripping and
+ * re-adding @c const and @c volatile qualifiers so that invoking
+ * LL_TEMPLATE_CONVERTIBLE(dest, source) will automatically generate all
+ * permitted permutations. It's really not fair to the coder to require
+ * separate:
+ * @code
+ * LL_TEMPLATE_CONVERTIBLE(Base*, Subclass*);
+ * LL_TEMPLATE_CONVERTIBLE(const Base*, Subclass*);
+ * LL_TEMPLATE_CONVERTIBLE(const Base*, const Subclass*);
+ * @endcode
+ *
+ * (Naturally we omit <tt>LL_TEMPLATE_CONVERTIBLE(Base*, const Subclass*)</tt>
+ * because that's not permitted by normal C++ assignment anyway.)
+ */
+#define LL_TEMPLATE_CONVERTIBLE(DEST, SOURCE) \
+template <> \
+struct ll_template_cast_impl<DEST, SOURCE> \
+{ \
+ DEST operator()(SOURCE wrapper) \
+ { \
+ return wrapper; \
+ } \
+}
+
+
#endif // LL_LLSTL_H
diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp
index 22c8681983..76979f29f6 100755
--- a/indra/llcommon/llstring.cpp
+++ b/indra/llcommon/llstring.cpp
@@ -28,15 +28,15 @@
#include "llstring.h"
#include "llerror.h"
+#include "llfasttimer.h"
+#include "llsd.h"
#if LL_WINDOWS
-#define WIN32_LEAN_AND_MEAN
-#include <winsock2.h>
-#include <windows.h>
+#include "llwin32headerslean.h"
#include <winnls.h> // for WideCharToMultiByte
#endif
-LLFastTimer::DeclareTimer FT_STRING_FORMAT("String Format");
+LLTrace::BlockTimerStatHandle FT_STRING_FORMAT("String Format");
std::string ll_safe_string(const char* in)
@@ -110,7 +110,7 @@ bool _read_file_into_string(std::string& str, const std::string& filename)
llifstream ifs(filename, llifstream::binary);
if (!ifs.is_open())
{
- llinfos << "Unable to open file " << filename << llendl;
+ LL_INFOS() << "Unable to open file " << filename << LL_ENDL;
return false;
}
@@ -188,7 +188,7 @@ S32 wchar_to_utf8chars(llwchar in_char, char* outchars)
}
else
{
- llwarns << "Invalid Unicode character " << cur_char << "!" << llendl;
+ LL_WARNS() << "Invalid Unicode character " << cur_char << "!" << LL_ENDL;
*outchars++ = LL_UNKNOWN_CHAR;
}
return outchars - base;
@@ -1195,7 +1195,7 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token,
template<>
S32 LLStringUtil::format(std::string& s, const format_map_t& substitutions)
{
- LLFastTimer ft(FT_STRING_FORMAT);
+ LL_RECORD_BLOCK_TIME(FT_STRING_FORMAT);
S32 res = 0;
std::string output;
@@ -1268,7 +1268,7 @@ S32 LLStringUtil::format(std::string& s, const format_map_t& substitutions)
template<>
S32 LLStringUtil::format(std::string& s, const LLSD& substitutions)
{
- LLFastTimer ft(FT_STRING_FORMAT);
+ LL_RECORD_BLOCK_TIME(FT_STRING_FORMAT);
S32 res = 0;
if (!substitutions.isMap())
diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h
index 16a19e7021..0177f48bf5 100755
--- a/indra/llcommon/llstring.h
+++ b/indra/llcommon/llstring.h
@@ -29,10 +29,12 @@
#include <string>
#include <cstdio>
-#include <locale>
+//#include <locale>
#include <iomanip>
-#include "llsd.h"
-#include "llfasttimer.h"
+#include <algorithm>
+#include <vector>
+#include <map>
+#include "llformat.h"
#if LL_LINUX || LL_SOLARIS
#include <wctype.h>
@@ -49,6 +51,7 @@
#endif
const char LL_UNKNOWN_CHAR = '?';
+class LLSD;
#if LL_DARWIN || LL_LINUX || LL_SOLARIS
// Template specialization of char_traits for U16s. Only necessary on Mac and Linux (exists on Windows already)
diff --git a/indra/llcommon/llstringtable.cpp b/indra/llcommon/llstringtable.cpp
index 7ad3805351..f288999964 100755
--- a/indra/llcommon/llstringtable.cpp
+++ b/indra/llcommon/llstringtable.cpp
@@ -317,7 +317,7 @@ void LLStringTable::removeString(const char *str)
mUniqueEntries--;
if (mUniqueEntries < 0)
{
- llerror("LLStringTable:removeString trying to remove too many strings!", 0);
+ LL_ERRS() << "LLStringTable:removeString trying to remove too many strings!" << LL_ENDL;
}
delete iter->second;
mStringHash.erase(iter);
@@ -343,7 +343,7 @@ void LLStringTable::removeString(const char *str)
mUniqueEntries--;
if (mUniqueEntries < 0)
{
- llerror("LLStringTable:removeString trying to remove too many strings!", 0);
+ LL_ERRS() << "LLStringTable:removeString trying to remove too many strings!" << LL_ENDL;
}
strlist->remove(entry);
delete entry;
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index e63045659e..06e118aa44 100755
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -33,7 +33,7 @@
#include "llsys.h"
#include <iostream>
-#ifdef LL_STANDALONE
+#ifdef LL_USESYSTEMLIBS
# include <zlib.h>
#else
# include "zlib/zlib.h"
@@ -42,6 +42,7 @@
#include "llprocessor.h"
#include "llerrorcontrol.h"
#include "llevents.h"
+#include "llformat.h"
#include "lltimer.h"
#include "llsdserialize.h"
#include "llsdutil.h"
@@ -58,9 +59,7 @@
using namespace llsd;
#if LL_WINDOWS
-# define WIN32_LEAN_AND_MEAN
-# include <winsock2.h>
-# include <windows.h>
+# include "llwin32headerslean.h"
# include <psapi.h> // GetPerformanceInfo() et al.
#elif LL_DARWIN
# include <errno.h>
@@ -645,7 +644,7 @@ S32 LLOSInfo::getMaxOpenFiles()
}
else
{
- llerrs << "LLOSInfo::getMaxOpenFiles: sysconf error for _SC_OPEN_MAX" << llendl;
+ LL_ERRS() << "LLOSInfo::getMaxOpenFiles: sysconf error for _SC_OPEN_MAX" << LL_ENDL;
}
}
}
@@ -704,12 +703,12 @@ U32 LLOSInfo::getProcessVirtualSizeKB()
sprintf(proc_ps, "/proc/%d/psinfo", (int)getpid());
int proc_fd = -1;
if((proc_fd = open(proc_ps, O_RDONLY)) == -1){
- llwarns << "unable to open " << proc_ps << llendl;
+ LL_WARNS() << "unable to open " << proc_ps << LL_ENDL;
return 0;
}
psinfo_t proc_psinfo;
if(read(proc_fd, &proc_psinfo, sizeof(psinfo_t)) != sizeof(psinfo_t)){
- llwarns << "Unable to read " << proc_ps << llendl;
+ LL_WARNS() << "Unable to read " << proc_ps << LL_ENDL;
close(proc_fd);
return 0;
}
@@ -750,12 +749,12 @@ U32 LLOSInfo::getProcessResidentSizeKB()
sprintf(proc_ps, "/proc/%d/psinfo", (int)getpid());
int proc_fd = -1;
if((proc_fd = open(proc_ps, O_RDONLY)) == -1){
- llwarns << "unable to open " << proc_ps << llendl;
+ LL_WARNS() << "unable to open " << proc_ps << LL_ENDL;
return 0;
}
psinfo_t proc_psinfo;
if(read(proc_fd, &proc_psinfo, sizeof(psinfo_t)) != sizeof(psinfo_t)){
- llwarns << "Unable to read " << proc_ps << llendl;
+ LL_WARNS() << "Unable to read " << proc_ps << LL_ENDL;
close(proc_fd);
return 0;
}
@@ -870,7 +869,7 @@ LLMemoryInfo::LLMemoryInfo()
}
#if LL_WINDOWS
-static U32 LLMemoryAdjustKBResult(U32 inKB)
+static U32Kilobytes LLMemoryAdjustKBResult(U32Kilobytes inKB)
{
// Moved this here from llfloaterabout.cpp
@@ -881,16 +880,16 @@ static U32 LLMemoryAdjustKBResult(U32 inKB)
// returned from the GetMemoryStatusEx function. Here we keep the
// original adjustment from llfoaterabout.cpp until this can be
// fixed somehow.
- inKB += 1024;
+ inKB += U32Megabytes(1);
return inKB;
}
#endif
-U32 LLMemoryInfo::getPhysicalMemoryKB() const
+U32Kilobytes LLMemoryInfo::getPhysicalMemoryKB() const
{
#if LL_WINDOWS
- return LLMemoryAdjustKBResult(mStatsMap["Total Physical KB"].asInteger());
+ return LLMemoryAdjustKBResult(U32Kilobytes(mStatsMap["Total Physical KB"].asInteger()));
#elif LL_DARWIN
// This might work on Linux as well. Someone check...
@@ -900,17 +899,17 @@ U32 LLMemoryInfo::getPhysicalMemoryKB() const
size_t len = sizeof(phys);
sysctl(mib, 2, &phys, &len, NULL, 0);
- return (U32)(phys >> 10);
+ return U64Bytes(phys);
#elif LL_LINUX
U64 phys = 0;
phys = (U64)(getpagesize()) * (U64)(get_phys_pages());
- return (U32)(phys >> 10);
+ return U64Bytes(phys);
#elif LL_SOLARIS
U64 phys = 0;
phys = (U64)(getpagesize()) * (U64)(sysconf(_SC_PHYS_PAGES));
- return (U32)(phys >> 10);
+ return U64Bytes(phys);
#else
return 0;
@@ -918,32 +917,32 @@ U32 LLMemoryInfo::getPhysicalMemoryKB() const
#endif
}
-U32 LLMemoryInfo::getPhysicalMemoryClamped() const
+U32Bytes LLMemoryInfo::getPhysicalMemoryClamped() const
{
// Return the total physical memory in bytes, but clamp it
// to no more than U32_MAX
- U32 phys_kb = getPhysicalMemoryKB();
- if (phys_kb >= 4194304 /* 4GB in KB */)
+ U32Kilobytes phys_kb = getPhysicalMemoryKB();
+ if (phys_kb >= U32Gigabytes(4))
{
- return U32_MAX;
+ return U32Bytes(U32_MAX);
}
else
{
- return phys_kb << 10;
+ return phys_kb;
}
}
//static
-void LLMemoryInfo::getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_virtual_mem_kb)
+void LLMemoryInfo::getAvailableMemoryKB(U32Kilobytes& avail_physical_mem_kb, U32Kilobytes& avail_virtual_mem_kb)
{
#if LL_WINDOWS
// Sigh, this shouldn't be a static method, then we wouldn't have to
// reload this data separately from refresh()
LLSD statsMap(loadStatsMap());
- avail_physical_mem_kb = statsMap["Avail Physical KB"].asInteger();
- avail_virtual_mem_kb = statsMap["Avail Virtual KB"].asInteger();
+ avail_physical_mem_kb = (U32Kilobytes)statsMap["Avail Physical KB"].asInteger();
+ avail_virtual_mem_kb = (U32Kilobytes)statsMap["Avail Virtual KB"].asInteger();
#elif LL_DARWIN
// mStatsMap is derived from vm_stat, look for (e.g.) "kb free":
@@ -960,8 +959,8 @@ void LLMemoryInfo::getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_v
// Pageins: 2097212.
// Pageouts: 41759.
// Object cache: 841598 hits of 7629869 lookups (11% hit rate)
- avail_physical_mem_kb = -1 ;
- avail_virtual_mem_kb = -1 ;
+ avail_physical_mem_kb = (U32Kilobytes)-1 ;
+ avail_virtual_mem_kb = (U32Kilobytes)-1 ;
#elif LL_LINUX
// mStatsMap is derived from MEMINFO_FILE:
@@ -1012,15 +1011,15 @@ void LLMemoryInfo::getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_v
// DirectMap4k: 434168 kB
// DirectMap2M: 477184 kB
// (could also run 'free', but easier to read a file than run a program)
- avail_physical_mem_kb = -1 ;
- avail_virtual_mem_kb = -1 ;
+ avail_physical_mem_kb = (U32Kilobytes)-1 ;
+ avail_virtual_mem_kb = (U32Kilobytes)-1 ;
#else
//do not know how to collect available memory info for other systems.
//leave it blank here for now.
- avail_physical_mem_kb = -1 ;
- avail_virtual_mem_kb = -1 ;
+ avail_physical_mem_kb = (U32Kilobytes)-1 ;
+ avail_virtual_mem_kb = (U32Kilobytes)-1 ;
#endif
}
@@ -1433,9 +1432,14 @@ public:
LL_CONT << "slowest framerate for last " << int(prevSize * MEM_INFO_THROTTLE)
<< " seconds ";
}
+
+ S32 precision = LL_CONT.precision();
+
LL_CONT << std::fixed << std::setprecision(1) << framerate << '\n'
- << LLMemoryInfo() << LL_ENDL;
+ << LLMemoryInfo();
+ LL_CONT.precision(precision);
+ LL_CONT << LL_ENDL;
return false;
}
@@ -1482,7 +1486,7 @@ BOOL gunzip_file(const std::string& srcfile, const std::string& dstfile)
size_t nwrit = fwrite(buffer, sizeof(U8), bytes, dst);
if (nwrit < (size_t) bytes)
{
- llwarns << "Short write on " << tmpfile << ": Wrote " << nwrit << " of " << bytes << " bytes." << llendl;
+ LL_WARNS() << "Short write on " << tmpfile << ": Wrote " << nwrit << " of " << bytes << " bytes." << LL_ENDL;
goto err;
}
} while(gzeof(src) == 0);
@@ -1515,14 +1519,14 @@ BOOL gzip_file(const std::string& srcfile, const std::string& dstfile)
{
if (gzwrite(dst, buffer, bytes) <= 0)
{
- llwarns << "gzwrite failed: " << gzerror(dst, NULL) << llendl;
+ LL_WARNS() << "gzwrite failed: " << gzerror(dst, NULL) << LL_ENDL;
goto err;
}
}
if (ferror(src))
{
- llwarns << "Error reading " << srcfile << llendl;
+ LL_WARNS() << "Error reading " << srcfile << LL_ENDL;
goto err;
}
diff --git a/indra/llcommon/llsys.h b/indra/llcommon/llsys.h
index cfed0fff17..962367f69f 100755
--- a/indra/llcommon/llsys.h
+++ b/indra/llcommon/llsys.h
@@ -33,7 +33,7 @@
// use an LLCPUInfo object:
//
// LLCPUInfo info;
-// llinfos << info << llendl;
+// LL_INFOS() << info << LL_ENDL;
//
#include "llsd.h"
@@ -105,22 +105,22 @@ class LL_COMMON_API LLMemoryInfo
Here's how you use an LLMemoryInfo:
LLMemoryInfo info;
-<br> llinfos << info << llendl;
+<br> LL_INFOS() << info << LL_ENDL;
*/
{
public:
LLMemoryInfo(); ///< Default constructor
void stream(std::ostream& s) const; ///< output text info to s
- U32 getPhysicalMemoryKB() const; ///< Memory size in KiloBytes
+ U32Kilobytes getPhysicalMemoryKB() const;
/*! Memory size in bytes, if total memory is >= 4GB then U32_MAX will
** be returned.
*/
- U32 getPhysicalMemoryClamped() const; ///< Memory size in clamped bytes
+ U32Bytes getPhysicalMemoryClamped() const; ///< Memory size in clamped bytes
//get the available memory infomation in KiloBytes.
- static void getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_virtual_mem_kb);
+ static void getAvailableMemoryKB(U32Kilobytes& avail_physical_mem_kb, U32Kilobytes& avail_virtual_mem_kb);
// Retrieve a map of memory statistics. The keys of the map are platform-
// dependent. The values are in kilobytes to try to avoid integer overflow.
diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp
index e67d1bc57b..51c89e1eaf 100755
--- a/indra/llcommon/llthread.cpp
+++ b/indra/llcommon/llthread.cpp
@@ -29,13 +29,49 @@
#include "apr_portable.h"
#include "llthread.h"
+#include "llmutex.h"
#include "lltimer.h"
+#include "lltrace.h"
+#include "lltracethreadrecorder.h"
#if LL_LINUX || LL_SOLARIS
#include <sched.h>
#endif
+
+#ifdef LL_WINDOWS
+const DWORD MS_VC_EXCEPTION=0x406D1388;
+
+#pragma pack(push,8)
+typedef struct tagTHREADNAME_INFO
+{
+ DWORD dwType; // Must be 0x1000.
+ LPCSTR szName; // Pointer to name (in user addr space).
+ DWORD dwThreadID; // Thread ID (-1=caller thread).
+ DWORD dwFlags; // Reserved for future use, must be zero.
+} THREADNAME_INFO;
+#pragma pack(pop)
+
+void set_thread_name( DWORD dwThreadID, const char* threadName)
+{
+ THREADNAME_INFO info;
+ info.dwType = 0x1000;
+ info.szName = threadName;
+ info.dwThreadID = dwThreadID;
+ info.dwFlags = 0;
+
+ __try
+ {
+ ::RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(DWORD), (DWORD*)&info );
+ }
+ __except(EXCEPTION_CONTINUE_EXECUTION)
+ {
+ }
+}
+#endif
+
+
//----------------------------------------------------------------------------
// Usage:
// void run_func(LLThread* thread)
@@ -56,19 +92,24 @@
//
//----------------------------------------------------------------------------
-#if !LL_DARWIN
-U32 ll_thread_local sThreadID = 0;
+#if LL_DARWIN
+// statically allocated thread local storage not supported in Darwin executable formats
+#elif LL_WINDOWS
+U32 __declspec(thread) sThreadID = 0;
+#elif LL_LINUX
+U32 __thread sThreadID = 0;
#endif
U32 LLThread::sIDIter = 0;
+
LL_COMMON_API void assert_main_thread()
{
static U32 s_thread_id = LLThread::currentID();
if (LLThread::currentID() != s_thread_id)
{
- llwarns << "Illegal execution from thread id " << (S32) LLThread::currentID()
- << " outside main thread " << (S32) s_thread_id << llendl;
+ LL_WARNS() << "Illegal execution from thread id " << (S32) LLThread::currentID()
+ << " outside main thread " << (S32) s_thread_id << LL_ENDL;
}
}
@@ -86,6 +127,13 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap
{
LLThread *threadp = (LLThread *)datap;
+#ifdef LL_WINDOWS
+ set_thread_name(-1, threadp->mName.c_str());
+#endif
+
+ // for now, hard code all LLThreads to report to single master thread recorder, which is known to be running on main thread
+ threadp->mRecorder = new LLTrace::ThreadRecorder(*LLTrace::get_master_thread_recorder());
+
#if !LL_DARWIN
sThreadID = threadp->mID;
#endif
@@ -93,21 +141,26 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap
// Run the user supplied function
threadp->run();
- //llinfos << "LLThread::staticRun() Exiting: " << threadp->mName << llendl;
+ //LL_INFOS() << "LLThread::staticRun() Exiting: " << threadp->mName << LL_ENDL;
+
+ delete threadp->mRecorder;
+ threadp->mRecorder = NULL;
// We're done with the run function, this thread is done executing now.
+ //NB: we are using this flag to sync across threads...we really need memory barriers here
threadp->mStatus = STOPPED;
return NULL;
}
-
LLThread::LLThread(const std::string& name, apr_pool_t *poolp) :
mPaused(FALSE),
mName(name),
mAPRThreadp(NULL),
- mStatus(STOPPED)
+ mStatus(STOPPED),
+ mRecorder(NULL)
{
+
mID = ++sIDIter;
// Thread creation probably CAN be paranoid about APR being initialized, if necessary
@@ -150,10 +203,10 @@ void LLThread::shutdown()
// First, set the flag that indicates that we're ready to die
setQuitting();
- //llinfos << "LLThread::~LLThread() Killing thread " << mName << " Status: " << mStatus << llendl;
+ //LL_INFOS() << "LLThread::~LLThread() Killing thread " << mName << " Status: " << mStatus << LL_ENDL;
// Now wait a bit for the thread to exit
// It's unclear whether I should even bother doing this - this destructor
- // should netver get called unless we're already stopped, really...
+ // should never get called unless we're already stopped, really...
S32 counter = 0;
const S32 MAX_WAIT = 600;
while (counter < MAX_WAIT)
@@ -172,8 +225,10 @@ void LLThread::shutdown()
if (!isStopped())
{
// This thread just wouldn't stop, even though we gave it time
- //llwarns << "LLThread::~LLThread() exiting thread before clean exit!" << llendl;
+ //LL_WARNS() << "LLThread::~LLThread() exiting thread before clean exit!" << LL_ENDL;
// Put a stake in its heart.
+ delete mRecorder;
+
apr_thread_exit(mAPRThreadp, -1);
return;
}
@@ -191,6 +246,14 @@ void LLThread::shutdown()
apr_pool_destroy(mAPRPoolp);
mAPRPoolp = 0;
}
+
+ if (mRecorder)
+ {
+ // missed chance to properly shut down recorder (needs to be done in thread context)
+ // probably due to abnormal thread termination
+ // so just leak it and remove it from parent
+ LLTrace::get_master_thread_recorder()->removeChildRecorder(mRecorder);
+ }
}
@@ -212,9 +275,10 @@ void LLThread::start()
else
{
mStatus = STOPPED;
- llwarns << "failed to start thread " << mName << llendl;
+ LL_WARNS() << "failed to start thread " << mName << LL_ENDL;
ll_apr_warn_status(status);
}
+
}
//============================================================================
@@ -283,7 +347,13 @@ void LLThread::setQuitting()
// static
U32 LLThread::currentID()
{
+#if LL_DARWIN
+ // statically allocated thread local storage not supported in Darwin executable formats
return (U32)apr_os_thread_current();
+#else
+ return sThreadID;
+#endif
+
}
// static
@@ -316,185 +386,6 @@ void LLThread::wakeLocked()
//============================================================================
-LLMutex::LLMutex(apr_pool_t *poolp) :
- mAPRMutexp(NULL), mCount(0), mLockingThread(NO_THREAD)
-{
- //if (poolp)
- //{
- // mIsLocalPool = FALSE;
- // mAPRPoolp = poolp;
- //}
- //else
- {
- mIsLocalPool = TRUE;
- apr_pool_create(&mAPRPoolp, NULL); // Create a subpool for this thread
- }
- apr_thread_mutex_create(&mAPRMutexp, APR_THREAD_MUTEX_UNNESTED, mAPRPoolp);
-}
-
-
-LLMutex::~LLMutex()
-{
-#if MUTEX_DEBUG
- //bad assertion, the subclass LLSignal might be "locked", and that's OK
- //llassert_always(!isLocked()); // better not be locked!
-#endif
- apr_thread_mutex_destroy(mAPRMutexp);
- mAPRMutexp = NULL;
- if (mIsLocalPool)
- {
- apr_pool_destroy(mAPRPoolp);
- }
-}
-
-
-void LLMutex::lock()
-{
- if(isSelfLocked())
- { //redundant lock
- mCount++;
- return;
- }
-
- apr_thread_mutex_lock(mAPRMutexp);
-
-#if MUTEX_DEBUG
- // Have to have the lock before we can access the debug info
- U32 id = LLThread::currentID();
- if (mIsLocked[id] != FALSE)
- llerrs << "Already locked in Thread: " << id << llendl;
- mIsLocked[id] = TRUE;
-#endif
-
-#if LL_DARWIN
- mLockingThread = LLThread::currentID();
-#else
- mLockingThread = sThreadID;
-#endif
-}
-
-bool LLMutex::trylock()
-{
- if(isSelfLocked())
- { //redundant lock
- mCount++;
- return true;
- }
-
- apr_status_t status(apr_thread_mutex_trylock(mAPRMutexp));
- if (APR_STATUS_IS_EBUSY(status))
- {
- return false;
- }
-
-#if MUTEX_DEBUG
- // Have to have the lock before we can access the debug info
- U32 id = LLThread::currentID();
- if (mIsLocked[id] != FALSE)
- llerrs << "Already locked in Thread: " << id << llendl;
- mIsLocked[id] = TRUE;
-#endif
-
-#if LL_DARWIN
- mLockingThread = LLThread::currentID();
-#else
- mLockingThread = sThreadID;
-#endif
- return true;
-}
-
-void LLMutex::unlock()
-{
- if (mCount > 0)
- { //not the root unlock
- mCount--;
- return;
- }
-
-#if MUTEX_DEBUG
- // Access the debug info while we have the lock
- U32 id = LLThread::currentID();
- if (mIsLocked[id] != TRUE)
- llerrs << "Not locked in Thread: " << id << llendl;
- mIsLocked[id] = FALSE;
-#endif
-
- mLockingThread = NO_THREAD;
- apr_thread_mutex_unlock(mAPRMutexp);
-}
-
-bool LLMutex::isLocked()
-{
- apr_status_t status = apr_thread_mutex_trylock(mAPRMutexp);
- if (APR_STATUS_IS_EBUSY(status))
- {
- return true;
- }
- else
- {
- apr_thread_mutex_unlock(mAPRMutexp);
- return false;
- }
-}
-
-bool LLMutex::isSelfLocked()
-{
-#if LL_DARWIN
- return mLockingThread == LLThread::currentID();
-#else
- return mLockingThread == sThreadID;
-#endif
-}
-
-U32 LLMutex::lockingThread() const
-{
- return mLockingThread;
-}
-
-//============================================================================
-
-LLCondition::LLCondition(apr_pool_t *poolp) :
- LLMutex(poolp)
-{
- // base class (LLMutex) has already ensured that mAPRPoolp is set up.
-
- apr_thread_cond_create(&mAPRCondp, mAPRPoolp);
-}
-
-
-LLCondition::~LLCondition()
-{
- apr_thread_cond_destroy(mAPRCondp);
- mAPRCondp = NULL;
-}
-
-
-void LLCondition::wait()
-{
- if (!isLocked())
- { //mAPRMutexp MUST be locked before calling apr_thread_cond_wait
- apr_thread_mutex_lock(mAPRMutexp);
-#if MUTEX_DEBUG
- // avoid asserts on destruction in non-release builds
- U32 id = LLThread::currentID();
- mIsLocked[id] = TRUE;
-#endif
- }
- apr_thread_cond_wait(mAPRCondp, mAPRMutexp);
-}
-
-void LLCondition::signal()
-{
- apr_thread_cond_signal(mAPRCondp);
-}
-
-void LLCondition::broadcast()
-{
- apr_thread_cond_broadcast(mAPRCondp);
-}
-
-//============================================================================
-
//----------------------------------------------------------------------------
//static
@@ -533,11 +424,10 @@ LLThreadSafeRefCount::~LLThreadSafeRefCount()
{
if (mRef != 0)
{
- llerrs << "deleting non-zero reference" << llendl;
+ LL_ERRS() << "deleting non-zero reference" << LL_ENDL;
}
}
-
//============================================================================
LLResponder::~LLResponder()
diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h
index 8c7143304f..6f9ec10fd3 100755
--- a/indra/llcommon/llthread.h
+++ b/indra/llcommon/llthread.h
@@ -31,20 +31,20 @@
#include "llapr.h"
#include "apr_thread_cond.h"
#include "boost/intrusive_ptr.hpp"
+#include "llmutex.h"
+#include "llrefcount.h"
-class LLThread;
-class LLMutex;
-class LLCondition;
+LL_COMMON_API void assert_main_thread();
-#if LL_WINDOWS
-#define ll_thread_local __declspec(thread)
-#else
-#define ll_thread_local __thread
-#endif
+namespace LLTrace
+{
+ class ThreadRecorder;
+}
class LL_COMMON_API LLThread
{
private:
+ friend class LLMutex;
static U32 sIDIter;
public:
@@ -98,11 +98,11 @@ private:
BOOL mPaused;
// static function passed to APR thread creation routine
- static void *APR_THREAD_FUNC staticRun(apr_thread_t *apr_threadp, void *datap);
+ static void *APR_THREAD_FUNC staticRun(struct apr_thread_t *apr_threadp, void *datap);
protected:
std::string mName;
- LLCondition* mRunCondition;
+ class LLCondition* mRunCondition;
LLMutex* mDataLock;
apr_thread_t *mAPRThreadp;
@@ -110,6 +110,7 @@ protected:
BOOL mIsLocalPool;
EThreadStatus mStatus;
U32 mID;
+ LLTrace::ThreadRecorder* mRecorder;
//a local apr_pool for APRFile operations in this thread. If it exists, LLAPRFile::sAPRFilePoolp should not be used.
//Note: this pool is used by APRFile ONLY, do NOT use it for any other purposes.
@@ -140,117 +141,6 @@ protected:
// mDataLock->unlock();
};
-//============================================================================
-
-#define MUTEX_DEBUG (LL_DEBUG || LL_RELEASE_WITH_DEBUG_INFO)
-
-class LL_COMMON_API LLMutex
-{
-public:
- typedef enum
- {
- NO_THREAD = 0xFFFFFFFF
- } e_locking_thread;
-
- LLMutex(apr_pool_t *apr_poolp); // NULL pool constructs a new pool for the mutex
- virtual ~LLMutex();
-
- void lock(); // blocks
- bool trylock(); // non-blocking, returns true if lock held.
- void unlock(); // undefined behavior when called on mutex not being held
- bool isLocked(); // non-blocking, but does do a lock/unlock so not free
- bool isSelfLocked(); //return true if locked in a same thread
- U32 lockingThread() const; //get ID of locking thread
-
-protected:
- apr_thread_mutex_t *mAPRMutexp;
- mutable U32 mCount;
- mutable U32 mLockingThread;
-
- apr_pool_t *mAPRPoolp;
- BOOL mIsLocalPool;
-
-#if MUTEX_DEBUG
- std::map<U32, BOOL> mIsLocked;
-#endif
-};
-
-//============================================================================
-
-// Actually a condition/mutex pair (since each condition needs to be associated with a mutex).
-class LL_COMMON_API LLCondition : public LLMutex
-{
-public:
- LLCondition(apr_pool_t *apr_poolp); // Defaults to global pool, could use the thread pool as well.
- ~LLCondition();
-
- void wait(); // blocks
- void signal();
- void broadcast();
-
-protected:
- apr_thread_cond_t *mAPRCondp;
-};
-
-//============================================================================
-
-class LLMutexLock
-{
-public:
- LLMutexLock(LLMutex* mutex)
- {
- mMutex = mutex;
-
- if(mMutex)
- mMutex->lock();
- }
- ~LLMutexLock()
- {
- if(mMutex)
- mMutex->unlock();
- }
-private:
- LLMutex* mMutex;
-};
-
-//============================================================================
-
-// Scoped locking class similar in function to LLMutexLock but uses
-// the trylock() method to conditionally acquire lock without
-// blocking. Caller resolves the resulting condition by calling
-// the isLocked() method and either punts or continues as indicated.
-//
-// Mostly of interest to callers needing to avoid stalls who can
-// guarantee another attempt at a later time.
-
-class LLMutexTrylock
-{
-public:
- LLMutexTrylock(LLMutex* mutex)
- : mMutex(mutex),
- mLocked(false)
- {
- if (mMutex)
- mLocked = mMutex->trylock();
- }
-
- ~LLMutexTrylock()
- {
- if (mMutex && mLocked)
- mMutex->unlock();
- }
-
- bool isLocked() const
- {
- return mLocked;
- }
-
-private:
- LLMutex* mMutex;
- bool mLocked;
-};
-
-//============================================================================
void LLThread::lockData()
{
@@ -265,76 +155,6 @@ void LLThread::unlockData()
//============================================================================
-// see llmemory.h for LLPointer<> definition
-
-class LL_COMMON_API LLThreadSafeRefCount
-{
-public:
- static void initThreadSafeRefCount(); // creates sMutex
- static void cleanupThreadSafeRefCount(); // destroys sMutex
-
-private:
- static LLMutex* sMutex;
-
-protected:
- virtual ~LLThreadSafeRefCount(); // use unref()
-
-public:
- LLThreadSafeRefCount();
- LLThreadSafeRefCount(const LLThreadSafeRefCount&);
- LLThreadSafeRefCount& operator=(const LLThreadSafeRefCount& ref)
- {
- mRef = 0;
- return *this;
- }
-
- void ref()
- {
- mRef++;
- }
-
- void unref()
- {
- llassert(mRef >= 1);
- if ((--mRef) == 0) // See note in llapr.h on atomic decrement operator return value.
- {
- // If we hit zero, the caller should be the only smart pointer owning the object and we can delete it.
- // It is technically possible for a vanilla pointer to mess this up, or another thread to
- // jump in, find this object, create another smart pointer and end up dangling, but if
- // the code is that bad and not thread-safe, it's trouble already.
- delete this;
- }
- }
-
- S32 getNumRefs() const
- {
- const S32 currentVal = mRef.CurrentValue();
- return currentVal;
- }
-
-private:
- LLAtomic32< S32 > mRef;
-};
-
-
-/**
- * intrusive pointer support for LLThreadSafeRefCount
- * this allows you to use boost::intrusive_ptr with any LLThreadSafeRefCount-derived type
- */
-namespace boost
-{
- inline void intrusive_ptr_add_ref(LLThreadSafeRefCount* p)
- {
- p->ref();
- }
-
- inline void intrusive_ptr_release(LLThreadSafeRefCount* p)
- {
- p->unref();
- }
-};
-//============================================================================
-
// Simple responder for self destructing callbacks
// Pure virtual class
class LL_COMMON_API LLResponder : public LLThreadSafeRefCount
diff --git a/indra/llcommon/llthreadlocalstorage.cpp b/indra/llcommon/llthreadlocalstorage.cpp
new file mode 100644
index 0000000000..8cef05caac
--- /dev/null
+++ b/indra/llcommon/llthreadlocalstorage.cpp
@@ -0,0 +1,119 @@
+/**
+ * @file llthreadlocalstorage.cpp
+ * @author Richard
+ * @date 2013-1-11
+ * @brief implementation of thread local storage utility classes
+ *
+ * $LicenseInfo:firstyear=2013&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "linden_common.h"
+#include "llthreadlocalstorage.h"
+#include "llapr.h"
+
+//
+//LLThreadLocalPointerBase
+//
+bool LLThreadLocalPointerBase::sInitialized = false;
+
+void LLThreadLocalPointerBase::set( void* value )
+{
+ llassert(sInitialized && mThreadKey);
+
+ apr_status_t result = apr_threadkey_private_set((void*)value, mThreadKey);
+ if (result != APR_SUCCESS)
+ {
+ ll_apr_warn_status(result);
+ LL_ERRS() << "Failed to set thread local data" << LL_ENDL;
+ }
+}
+
+void* LLThreadLocalPointerBase::get() const
+{
+ // llassert(sInitialized);
+ void* ptr;
+ apr_status_t result =
+ apr_threadkey_private_get(&ptr, mThreadKey);
+ if (result != APR_SUCCESS)
+ {
+ ll_apr_warn_status(result);
+ LL_ERRS() << "Failed to get thread local data" << LL_ENDL;
+ }
+ return ptr;
+}
+
+
+void LLThreadLocalPointerBase::initStorage( )
+{
+ apr_status_t result = apr_threadkey_private_create(&mThreadKey, NULL, gAPRPoolp);
+ if (result != APR_SUCCESS)
+ {
+ ll_apr_warn_status(result);
+ LL_ERRS() << "Failed to allocate thread local data" << LL_ENDL;
+ }
+}
+
+void LLThreadLocalPointerBase::destroyStorage()
+{
+ if (sInitialized)
+ {
+ if (mThreadKey)
+ {
+ apr_status_t result = apr_threadkey_private_delete(mThreadKey);
+ if (result != APR_SUCCESS)
+ {
+ ll_apr_warn_status(result);
+ LL_ERRS() << "Failed to delete thread local data" << LL_ENDL;
+ }
+ }
+ }
+}
+
+//static
+void LLThreadLocalPointerBase::initAllThreadLocalStorage()
+{
+ if (!sInitialized)
+ {
+ for (LLInstanceTracker<LLThreadLocalPointerBase>::instance_iter it = beginInstances(), end_it = endInstances();
+ it != end_it;
+ ++it)
+ {
+ (*it).initStorage();
+ }
+ sInitialized = true;
+ }
+}
+
+//static
+void LLThreadLocalPointerBase::destroyAllThreadLocalStorage()
+{
+ if (sInitialized)
+ {
+ //for (LLInstanceTracker<LLThreadLocalPointerBase>::instance_iter it = beginInstances(), end_it = endInstances();
+ // it != end_it;
+ // ++it)
+ //{
+ // (*it).destroyStorage();
+ //}
+ sInitialized = false;
+ }
+}
diff --git a/indra/llcommon/llthreadlocalstorage.h b/indra/llcommon/llthreadlocalstorage.h
new file mode 100644
index 0000000000..ec3b52c8cb
--- /dev/null
+++ b/indra/llcommon/llthreadlocalstorage.h
@@ -0,0 +1,185 @@
+/**
+ * @file llthreadlocalstorage.h
+ * @author Richard
+ * @brief Class wrappers for thread local storage
+ *
+ * $LicenseInfo:firstyear=2004&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLTHREADLOCALSTORAGE_H
+#define LL_LLTHREADLOCALSTORAGE_H
+
+#include "llinstancetracker.h"
+
+class LLThreadLocalPointerBase : public LLInstanceTracker<LLThreadLocalPointerBase>
+{
+public:
+ LLThreadLocalPointerBase()
+ : mThreadKey(NULL)
+ {
+ if (sInitialized)
+ {
+ initStorage();
+ }
+ }
+
+ LLThreadLocalPointerBase( const LLThreadLocalPointerBase& other)
+ : mThreadKey(NULL)
+ {
+ if (sInitialized)
+ {
+ initStorage();
+ }
+ }
+
+ ~LLThreadLocalPointerBase()
+ {
+ destroyStorage();
+ }
+
+ static void initAllThreadLocalStorage();
+ static void destroyAllThreadLocalStorage();
+
+protected:
+ void set(void* value);
+
+ void* get() const;
+
+ void initStorage();
+ void destroyStorage();
+
+protected:
+ struct apr_threadkey_t* mThreadKey;
+ static bool sInitialized;
+};
+
+template <typename T>
+class LLThreadLocalPointer : public LLThreadLocalPointerBase
+{
+public:
+
+ LLThreadLocalPointer()
+ {}
+
+ explicit LLThreadLocalPointer(T* value)
+ {
+ set(value);
+ }
+
+
+ LLThreadLocalPointer(const LLThreadLocalPointer<T>& other)
+ : LLThreadLocalPointerBase(other)
+ {
+ set(other.get());
+ }
+
+ LL_FORCE_INLINE T* get() const
+ {
+ return (T*)LLThreadLocalPointerBase::get();
+ }
+
+ T* operator -> () const
+ {
+ return (T*)get();
+ }
+
+ T& operator*() const
+ {
+ return *(T*)get();
+ }
+
+ LLThreadLocalPointer<T>& operator = (T* value)
+ {
+ set((void*)value);
+ return *this;
+ }
+
+ bool operator ==(const T* other) const
+ {
+ if (!sInitialized) return false;
+ return get() == other;
+ }
+
+ bool isNull() const { return !sInitialized || get() == NULL; }
+
+ bool notNull() const { return sInitialized && get() != NULL; }
+};
+
+template<typename DERIVED_TYPE>
+class LLThreadLocalSingletonPointer
+{
+public:
+ LL_FORCE_INLINE static DERIVED_TYPE* getInstance()
+ {
+#if LL_DARWIN
+ createTLSKey();
+ return (DERIVED_TYPE*)pthread_getspecific(sInstanceKey);
+#else
+ return sInstance;
+#endif
+ }
+
+ static void setInstance(DERIVED_TYPE* instance)
+ {
+#if LL_DARWIN
+ createTLSKey();
+ pthread_setspecific(sInstanceKey, (void*)instance);
+#else
+ sInstance = instance;
+#endif
+ }
+
+private:
+
+#if LL_WINDOWS
+ static __declspec(thread) DERIVED_TYPE* sInstance;
+#elif LL_LINUX
+ static __thread DERIVED_TYPE* sInstance;
+#elif LL_DARWIN
+ static void TLSError()
+ {
+ LL_ERRS() << "Could not create thread local storage" << LL_ENDL;
+ }
+ static void createTLSKey()
+ {
+ static S32 key_created = pthread_key_create(&sInstanceKey, NULL);
+ if (key_created != 0)
+ {
+ LL_ERRS() << "Could not create thread local storage" << LL_ENDL;
+ }
+ }
+ static pthread_key_t sInstanceKey;
+#endif
+};
+
+#if LL_WINDOWS
+template<typename DERIVED_TYPE>
+__declspec(thread) DERIVED_TYPE* LLThreadLocalSingletonPointer<DERIVED_TYPE>::sInstance = NULL;
+#elif LL_LINUX
+template<typename DERIVED_TYPE>
+__thread DERIVED_TYPE* LLThreadLocalSingletonPointer<DERIVED_TYPE>::sInstance = NULL;
+#elif LL_DARWIN
+template<typename DERIVED_TYPE>
+pthread_key_t LLThreadLocalSingletonPointer<DERIVED_TYPE>::sInstanceKey;
+#endif
+
+#endif // LL_LLTHREADLOCALSTORAGE_H
diff --git a/indra/llcommon/llthreadsafequeue.cpp b/indra/llcommon/llthreadsafequeue.cpp
index 8a73e632a9..185f0d63fb 100755
--- a/indra/llcommon/llthreadsafequeue.cpp
+++ b/indra/llcommon/llthreadsafequeue.cpp
@@ -54,7 +54,7 @@ LLThreadSafeQueueImplementation::LLThreadSafeQueueImplementation(apr_pool_t * po
LLThreadSafeQueueImplementation::~LLThreadSafeQueueImplementation()
{
if(mQueue != 0) {
- if(apr_queue_size(mQueue) != 0) llwarns <<
+ if(apr_queue_size(mQueue) != 0) LL_WARNS() <<
"terminating queue which still contains " << apr_queue_size(mQueue) <<
" elements;" << "memory will be leaked" << LL_ENDL;
apr_queue_term(mQueue);
diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp
index 9ebc6de7f4..ab105a82e6 100755
--- a/indra/llcommon/lltimer.cpp
+++ b/indra/llcommon/lltimer.cpp
@@ -31,11 +31,9 @@
#include "u64.h"
#if LL_WINDOWS
-# define WIN32_LEAN_AND_MEAN
-# include <winsock2.h>
-# include <windows.h>
+# include "llwin32headerslean.h"
#elif LL_LINUX || LL_SOLARIS || LL_DARWIN
-# include <errno.h>
+# include <errno.h>
# include <sys/time.h>
#else
# error "architecture not supported"
@@ -45,7 +43,6 @@
//
// Locally used constants
//
-const U32 SEC_PER_DAY = 86400;
const F64 SEC_TO_MICROSEC = 1000000.f;
const U64 SEC_TO_MICROSEC_U64 = 1000000;
const F64 USEC_TO_SEC_F64 = 0.000001;
@@ -58,11 +55,6 @@ const F64 USEC_TO_SEC_F64 = 0.000001;
S32 gUTCOffset = 0; // viewer's offset from server UTC, in seconds
LLTimer* LLTimer::sTimer = NULL;
-F64 gClockFrequency = 0.0;
-F64 gClockFrequencyInv = 0.0;
-F64 gClocksToMicroseconds = 0.0;
-U64 gTotalTimeClockCount = 0;
-U64 gLastTotalTimeClockCount = 0;
//
// Forward declarations
@@ -190,7 +182,7 @@ U64 get_clock_count()
return clock_count.QuadPart - offset;
}
-F64 calc_clock_frequency(U32 uiMeasureMSecs)
+F64 calc_clock_frequency()
{
__int64 freq;
QueryPerformanceFrequency((LARGE_INTEGER *) &freq);
@@ -201,7 +193,7 @@ F64 calc_clock_frequency(U32 uiMeasureMSecs)
#if LL_LINUX || LL_DARWIN || LL_SOLARIS
// Both Linux and Mac use gettimeofday for accurate time
-F64 calc_clock_frequency(unsigned int uiMeasureMSecs)
+F64 calc_clock_frequency()
{
return 1000000.0; // microseconds, so 1 MHz.
}
@@ -216,56 +208,68 @@ U64 get_clock_count()
#endif
-void update_clock_frequencies()
+TimerInfo::TimerInfo()
+: mClockFrequency(0.0),
+ mTotalTimeClockCount(0),
+ mLastTotalTimeClockCount(0)
+{}
+
+void TimerInfo::update()
{
- gClockFrequency = calc_clock_frequency(50U);
- gClockFrequencyInv = 1.0/gClockFrequency;
- gClocksToMicroseconds = gClockFrequencyInv * SEC_TO_MICROSEC;
+ mClockFrequency = calc_clock_frequency();
+ mClockFrequencyInv = 1.0/mClockFrequency;
+ mClocksToMicroseconds = mClockFrequencyInv;
}
+TimerInfo& get_timer_info()
+{
+ static TimerInfo sTimerInfo;
+ return sTimerInfo;
+}
///////////////////////////////////////////////////////////////////////////////
// returns a U64 number that represents the number of
-// microseconds since the unix epoch - Jan 1, 1970
-U64 totalTime()
+// microseconds since the Unix epoch - Jan 1, 1970
+U64MicrosecondsImplicit totalTime()
{
U64 current_clock_count = get_clock_count();
- if (!gTotalTimeClockCount)
+ if (!get_timer_info().mTotalTimeClockCount || get_timer_info().mClocksToMicroseconds.value() == 0)
{
- update_clock_frequencies();
- gTotalTimeClockCount = current_clock_count;
+ get_timer_info().update();
+ get_timer_info().mTotalTimeClockCount = current_clock_count;
#if LL_WINDOWS
- // Synch us up with local time (even though we PROBABLY don't need to, this is how it was implemented)
+ // Sync us up with local time (even though we PROBABLY don't need to, this is how it was implemented)
// Unix platforms use gettimeofday so they are synced, although this probably isn't a good assumption to
// make in the future.
- gTotalTimeClockCount = (U64)(time(NULL) * gClockFrequency);
+ get_timer_info().mTotalTimeClockCount = (U64)(time(NULL) * get_timer_info().mClockFrequency);
#endif
// Update the last clock count
- gLastTotalTimeClockCount = current_clock_count;
+ get_timer_info().mLastTotalTimeClockCount = current_clock_count;
}
else
{
- if (current_clock_count >= gLastTotalTimeClockCount)
+ if (current_clock_count >= get_timer_info().mLastTotalTimeClockCount)
{
// No wrapping, we're all okay.
- gTotalTimeClockCount += current_clock_count - gLastTotalTimeClockCount;
+ get_timer_info().mTotalTimeClockCount += current_clock_count - get_timer_info().mLastTotalTimeClockCount;
}
else
{
// We've wrapped. Compensate correctly
- gTotalTimeClockCount += (0xFFFFFFFFFFFFFFFFULL - gLastTotalTimeClockCount) + current_clock_count;
+ get_timer_info().mTotalTimeClockCount += (0xFFFFFFFFFFFFFFFFULL - get_timer_info().mLastTotalTimeClockCount) + current_clock_count;
}
// Update the last clock count
- gLastTotalTimeClockCount = current_clock_count;
+ get_timer_info().mLastTotalTimeClockCount = current_clock_count;
}
// Return the total clock tick count in microseconds.
- return (U64)(gTotalTimeClockCount*gClocksToMicroseconds);
+ U64Microseconds time(get_timer_info().mTotalTimeClockCount*get_timer_info().mClocksToMicroseconds);
+ return time;
}
@@ -273,9 +277,9 @@ U64 totalTime()
LLTimer::LLTimer()
{
- if (!gClockFrequency)
+ if (!get_timer_info().mClockFrequency)
{
- update_clock_frequencies();
+ get_timer_info().update();
}
mStarted = TRUE;
@@ -283,20 +287,32 @@ LLTimer::LLTimer()
}
LLTimer::~LLTimer()
+{}
+
+// static
+void LLTimer::initClass()
+{
+ if (!sTimer) sTimer = new LLTimer;
+}
+
+// static
+void LLTimer::cleanupClass()
{
+ delete sTimer; sTimer = NULL;
}
// static
-U64 LLTimer::getTotalTime()
+U64MicrosecondsImplicit LLTimer::getTotalTime()
{
// simply call into the implementation function.
- return totalTime();
+ U64MicrosecondsImplicit total_time = totalTime();
+ return total_time;
}
// static
-F64 LLTimer::getTotalSeconds()
+F64SecondsImplicit LLTimer::getTotalSeconds()
{
- return U64_to_F64(getTotalTime()) * USEC_TO_SEC_F64;
+ return F64Microseconds(U64_to_F64(getTotalTime()));
}
void LLTimer::reset()
@@ -343,43 +359,43 @@ U64 getElapsedTimeAndUpdate(U64& lastClockCount)
}
-F64 LLTimer::getElapsedTimeF64() const
+F64SecondsImplicit LLTimer::getElapsedTimeF64() const
{
U64 last = mLastClockCount;
- return (F64)getElapsedTimeAndUpdate(last) * gClockFrequencyInv;
+ return (F64)getElapsedTimeAndUpdate(last) * get_timer_info().mClockFrequencyInv;
}
-F32 LLTimer::getElapsedTimeF32() const
+F32SecondsImplicit LLTimer::getElapsedTimeF32() const
{
return (F32)getElapsedTimeF64();
}
-F64 LLTimer::getElapsedTimeAndResetF64()
+F64SecondsImplicit LLTimer::getElapsedTimeAndResetF64()
{
- return (F64)getElapsedTimeAndUpdate(mLastClockCount) * gClockFrequencyInv;
+ return (F64)getElapsedTimeAndUpdate(mLastClockCount) * get_timer_info().mClockFrequencyInv;
}
-F32 LLTimer::getElapsedTimeAndResetF32()
+F32SecondsImplicit LLTimer::getElapsedTimeAndResetF32()
{
return (F32)getElapsedTimeAndResetF64();
}
///////////////////////////////////////////////////////////////////////////////
-void LLTimer::setTimerExpirySec(F32 expiration)
+void LLTimer::setTimerExpirySec(F32SecondsImplicit expiration)
{
mExpirationTicks = get_clock_count()
- + (U64)((F32)(expiration * gClockFrequency));
+ + (U64)((F32)(expiration * get_timer_info().mClockFrequency.value()));
}
-F32 LLTimer::getRemainingTimeF32() const
+F32SecondsImplicit LLTimer::getRemainingTimeF32() const
{
U64 cur_ticks = get_clock_count();
if (cur_ticks > mExpirationTicks)
{
return 0.0f;
}
- return F32((mExpirationTicks - cur_ticks) * gClockFrequencyInv);
+ return F32((mExpirationTicks - cur_ticks) * get_timer_info().mClockFrequencyInv);
}
@@ -392,7 +408,7 @@ BOOL LLTimer::checkExpirationAndReset(F32 expiration)
}
mExpirationTicks = cur_ticks
- + (U64)((F32)(expiration * gClockFrequency));
+ + (U64)((F32)(expiration * get_timer_info().mClockFrequency));
return TRUE;
}
@@ -448,7 +464,7 @@ BOOL LLTimer::knownBadTimer()
{
if (!wcscmp(pci_id, bad_pci_list[check]))
{
-// llwarns << "unreliable PCI chipset found!! " << pci_id << endl;
+// LL_WARNS() << "unreliable PCI chipset found!! " << pci_id << endl;
failed = TRUE;
break;
}
@@ -491,20 +507,20 @@ BOOL is_daylight_savings()
struct tm* utc_to_pacific_time(time_t utc_time, BOOL pacific_daylight_time)
{
- S32 pacific_offset_hours;
+ S32Hours pacific_offset_hours;
if (pacific_daylight_time)
{
- pacific_offset_hours = 7;
+ pacific_offset_hours = S32Hours(7);
}
else
{
- pacific_offset_hours = 8;
+ pacific_offset_hours = S32Hours(8);
}
// We subtract off the PST/PDT offset _before_ getting
// "UTC" time, because this will handle wrapping around
// for 5 AM UTC -> 10 PM PDT of the previous day.
- utc_time -= pacific_offset_hours * MIN_PER_HOUR * SEC_PER_MIN;
+ utc_time -= S32SecondsImplicit(pacific_offset_hours);
// Internal buffer to PST/PDT (see above)
struct tm* internal_time = gmtime(&utc_time);
@@ -521,7 +537,7 @@ struct tm* utc_to_pacific_time(time_t utc_time, BOOL pacific_daylight_time)
}
-void microsecondsToTimecodeString(U64 current_time, std::string& tcstring)
+void microsecondsToTimecodeString(U64MicrosecondsImplicit current_time, std::string& tcstring)
{
U64 hours;
U64 minutes;
@@ -543,9 +559,9 @@ void microsecondsToTimecodeString(U64 current_time, std::string& tcstring)
}
-void secondsToTimecodeString(F32 current_time, std::string& tcstring)
+void secondsToTimecodeString(F32SecondsImplicit current_time, std::string& tcstring)
{
- microsecondsToTimecodeString((U64)((F64)(SEC_TO_MICROSEC*current_time)), tcstring);
+ microsecondsToTimecodeString(current_time, tcstring);
}
diff --git a/indra/llcommon/lltimer.h b/indra/llcommon/lltimer.h
index e73741217c..ec70213447 100755
--- a/indra/llcommon/lltimer.h
+++ b/indra/llcommon/lltimer.h
@@ -37,6 +37,7 @@
#include <string>
#include <list>
// units conversions
+#include "llunits.h"
#ifndef USEC_PER_SEC
const U32 USEC_PER_SEC = 1000000;
#endif
@@ -55,27 +56,34 @@ public:
protected:
U64 mLastClockCount;
U64 mExpirationTicks;
- BOOL mStarted;
+ bool mStarted;
public:
LLTimer();
~LLTimer();
- static void initClass() { if (!sTimer) sTimer = new LLTimer; }
- static void cleanupClass() { delete sTimer; sTimer = NULL; }
+ static void initClass();
+ static void cleanupClass();
// Return a high precision number of seconds since the start of
// this application instance.
- static F64 getElapsedSeconds()
+ static F64SecondsImplicit getElapsedSeconds()
+ {
+ if (sTimer)
{
return sTimer->getElapsedTimeF64();
}
+ else
+ {
+ return 0;
+ }
+ }
// Return a high precision usec since epoch
- static U64 getTotalTime();
+ static U64MicrosecondsImplicit getTotalTime();
// Return a high precision seconds since epoch
- static F64 getTotalSeconds();
+ static F64SecondsImplicit getTotalSeconds();
// MANIPULATORS
@@ -83,21 +91,21 @@ public:
void stop() { mStarted = FALSE; }
void reset(); // Resets the timer
void setLastClockCount(U64 current_count); // Sets the timer so that the next elapsed call will be relative to this time
- void setTimerExpirySec(F32 expiration);
+ void setTimerExpirySec(F32SecondsImplicit expiration);
BOOL checkExpirationAndReset(F32 expiration);
BOOL hasExpired() const;
- F32 getElapsedTimeAndResetF32(); // Returns elapsed time in seconds with reset
- F64 getElapsedTimeAndResetF64();
+ F32SecondsImplicit getElapsedTimeAndResetF32(); // Returns elapsed time in seconds with reset
+ F64SecondsImplicit getElapsedTimeAndResetF64();
- F32 getRemainingTimeF32() const;
+ F32SecondsImplicit getRemainingTimeF32() const;
static BOOL knownBadTimer();
// ACCESSORS
- F32 getElapsedTimeF32() const; // Returns elapsed time in seconds
- F64 getElapsedTimeF64() const; // Returns elapsed time in seconds
+ F32SecondsImplicit getElapsedTimeF32() const; // Returns elapsed time in seconds
+ F64SecondsImplicit getElapsedTimeF64() const; // Returns elapsed time in seconds
- BOOL getStarted() const { return mStarted; }
+ bool getStarted() const { return mStarted; }
static U64 getCurrentClockCount(); // Returns the raw clockticks
@@ -106,9 +114,21 @@ public:
//
// Various functions for initializing/accessing clock and timing stuff. Don't use these without REALLY knowing how they work.
//
+struct TimerInfo
+{
+ TimerInfo();
+ void update();
+
+ F64HertzImplicit mClockFrequency;
+ F64SecondsImplicit mClockFrequencyInv;
+ F64MicrosecondsImplicit mClocksToMicroseconds;
+ U64 mTotalTimeClockCount;
+ U64 mLastTotalTimeClockCount;
+};
+
+TimerInfo& get_timer_info();
+
LL_COMMON_API U64 get_clock_count();
-LL_COMMON_API F64 calc_clock_frequency(U32 msecs);
-LL_COMMON_API void update_clock_frequencies();
// Sleep for milliseconds
LL_COMMON_API void ms_sleep(U32 ms);
@@ -146,13 +166,6 @@ static inline time_t time_max()
}
}
-// These are really statics but they've been global for awhile
-// and they're material to other timing classes. If you are
-// not implementing a timer class, do not use these directly.
-extern LL_COMMON_API F64 gClockFrequency;
-extern LL_COMMON_API F64 gClockFrequencyInv;
-extern LL_COMMON_API F64 gClocksToMicroseconds;
-
// Correction factor used by time_corrected() above.
extern LL_COMMON_API S32 gUTCOffset;
@@ -167,9 +180,9 @@ LL_COMMON_API BOOL is_daylight_savings();
// struct tm* internal_time = utc_to_pacific_time(utc_time, gDaylight);
LL_COMMON_API struct tm* utc_to_pacific_time(time_t utc_time, BOOL pacific_daylight_time);
-LL_COMMON_API void microsecondsToTimecodeString(U64 current_time, std::string& tcstring);
-LL_COMMON_API void secondsToTimecodeString(F32 current_time, std::string& tcstring);
+LL_COMMON_API void microsecondsToTimecodeString(U64MicrosecondsImplicit current_time, std::string& tcstring);
+LL_COMMON_API void secondsToTimecodeString(F32SecondsImplicit current_time, std::string& tcstring);
-U64 LL_COMMON_API totalTime(); // Returns current system time in microseconds
+U64MicrosecondsImplicit LL_COMMON_API totalTime(); // Returns current system time in microseconds
#endif
diff --git a/indra/llcommon/lltrace.cpp b/indra/llcommon/lltrace.cpp
new file mode 100644
index 0000000000..54079a4689
--- /dev/null
+++ b/indra/llcommon/lltrace.cpp
@@ -0,0 +1,86 @@
+/**
+ * @file lltrace.cpp
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2012, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "linden_common.h"
+
+#include "lltrace.h"
+#include "lltracerecording.h"
+#include "lltracethreadrecorder.h"
+#include "llfasttimer.h"
+
+namespace LLTrace
+{
+
+MemStatHandle gTraceMemStat("LLTrace");
+
+StatBase::StatBase( const char* name, const char* description )
+: mName(name),
+ mDescription(description ? description : "")
+{
+#ifndef LL_RELEASE_FOR_DOWNLOAD
+ if (LLTrace::get_thread_recorder().notNull())
+ {
+ LL_ERRS() << "Attempting to declare trace object after program initialization. Trace objects should be statically initialized." << LL_ENDL;
+ }
+#endif
+}
+
+const char* StatBase::getUnitLabel() const
+{
+ return "";
+}
+
+TimeBlockTreeNode::TimeBlockTreeNode()
+: mBlock(NULL),
+ mParent(NULL),
+ mNeedsSorting(false),
+ mCollapsed(true)
+{}
+
+void TimeBlockTreeNode::setParent( BlockTimerStatHandle* parent )
+{
+ llassert_always(parent != mBlock);
+ llassert_always(parent != NULL);
+
+ TimeBlockTreeNode* parent_tree_node = get_thread_recorder()->getTimeBlockTreeNode(parent->getIndex());
+ if (!parent_tree_node) return;
+
+ if (mParent)
+ {
+ std::vector<BlockTimerStatHandle*>& children = mParent->getChildren();
+ std::vector<BlockTimerStatHandle*>::iterator found_it = std::find(children.begin(), children.end(), mBlock);
+ if (found_it != children.end())
+ {
+ children.erase(found_it);
+ }
+ }
+
+ mParent = parent;
+ mBlock->getCurrentAccumulator().mParent = parent;
+ parent_tree_node->mChildren.push_back(mBlock);
+ parent_tree_node->mNeedsSorting = true;
+}
+
+}
diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h
new file mode 100644
index 0000000000..5f1289dad8
--- /dev/null
+++ b/indra/llcommon/lltrace.h
@@ -0,0 +1,492 @@
+/**
+ * @file lltrace.h
+ * @brief Runtime statistics accumulation.
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2012, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLTRACE_H
+#define LL_LLTRACE_H
+
+#include "stdtypes.h"
+#include "llpreprocessor.h"
+
+#include "llmemory.h"
+#include "llrefcount.h"
+#include "lltraceaccumulators.h"
+#include "llthreadlocalstorage.h"
+#include "lltimer.h"
+#include "llpointer.h"
+#include "llunits.h"
+
+#define LL_TRACE_ENABLED 1
+
+namespace LLTrace
+{
+class Recording;
+
+template<typename T>
+T storage_value(T val) { return val; }
+
+template<typename UNIT_TYPE, typename STORAGE_TYPE>
+STORAGE_TYPE storage_value(LLUnit<STORAGE_TYPE, UNIT_TYPE> val) { return val.value(); }
+
+template<typename UNIT_TYPE, typename STORAGE_TYPE>
+STORAGE_TYPE storage_value(LLUnitImplicit<STORAGE_TYPE, UNIT_TYPE> val) { return val.value(); }
+
+class StatBase
+{
+public:
+ StatBase(const char* name, const char* description);
+ virtual ~StatBase() {};
+ virtual const char* getUnitLabel() const;
+
+ const std::string& getName() const { return mName; }
+ const std::string& getDescription() const { return mDescription; }
+
+protected:
+ std::string mName;
+ std::string mDescription;
+};
+
+template<typename ACCUMULATOR>
+class StatType
+: public StatBase,
+ public LLInstanceTracker<StatType<ACCUMULATOR>, std::string>
+{
+public:
+ typedef LLInstanceTracker<StatType<ACCUMULATOR>, std::string> instance_tracker_t;
+ StatType(const char* name, const char* description)
+ : instance_tracker_t(name),
+ StatBase(name, description),
+ mAccumulatorIndex(AccumulatorBuffer<ACCUMULATOR>::getDefaultBuffer()->reserveSlot())
+ {}
+
+ LL_FORCE_INLINE ACCUMULATOR& getCurrentAccumulator() const
+ {
+ ACCUMULATOR* accumulator_storage = LLThreadLocalSingletonPointer<ACCUMULATOR>::getInstance();
+ return accumulator_storage ? accumulator_storage[mAccumulatorIndex] : (*AccumulatorBuffer<ACCUMULATOR>::getDefaultBuffer())[mAccumulatorIndex];
+ }
+
+ size_t getIndex() const { return mAccumulatorIndex; }
+ static size_t getNumIndices() { return AccumulatorBuffer<ACCUMULATOR>::getNumIndices(); }
+
+protected:
+ const size_t mAccumulatorIndex;
+};
+
+
+template<>
+class StatType<TimeBlockAccumulator::CallCountFacet>
+: public StatType<TimeBlockAccumulator>
+{
+public:
+
+ StatType(const char* name, const char* description = "")
+ : StatType<TimeBlockAccumulator>(name, description)
+ {}
+};
+
+template<>
+class StatType<TimeBlockAccumulator::SelfTimeFacet>
+ : public StatType<TimeBlockAccumulator>
+{
+public:
+
+ StatType(const char* name, const char* description = "")
+ : StatType<TimeBlockAccumulator>(name, description)
+ {}
+};
+
+template <typename T = F64>
+class EventStatHandle
+: public StatType<EventAccumulator>
+{
+public:
+ typedef F64 storage_t;
+ typedef StatType<EventAccumulator> stat_t;
+ typedef EventStatHandle<T> self_t;
+
+ EventStatHandle(const char* name, const char* description = NULL)
+ : stat_t(name, description)
+ {}
+
+ /*virtual*/ const char* getUnitLabel() const { return LLGetUnitLabel<T>::getUnitLabel(); }
+
+};
+
+template<typename T, typename VALUE_T>
+void record(EventStatHandle<T>& measurement, VALUE_T value)
+{
+#if LL_TRACE_ENABLED
+ T converted_value(value);
+ measurement.getCurrentAccumulator().record(storage_value(converted_value));
+#endif
+}
+
+template <typename T = F64>
+class SampleStatHandle
+: public StatType<SampleAccumulator>
+{
+public:
+ typedef F64 storage_t;
+ typedef StatType<SampleAccumulator> stat_t;
+ typedef SampleStatHandle<T> self_t;
+
+ SampleStatHandle(const char* name, const char* description = NULL)
+ : stat_t(name, description)
+ {}
+
+ /*virtual*/ const char* getUnitLabel() const { return LLGetUnitLabel<T>::getUnitLabel(); }
+};
+
+template<typename T, typename VALUE_T>
+void sample(SampleStatHandle<T>& measurement, VALUE_T value)
+{
+#if LL_TRACE_ENABLED
+ T converted_value(value);
+ measurement.getCurrentAccumulator().sample(storage_value(converted_value));
+#endif
+}
+
+template <typename T = F64>
+class CountStatHandle
+: public StatType<CountAccumulator>
+{
+public:
+ typedef F64 storage_t;
+ typedef StatType<CountAccumulator> stat_t;
+ typedef CountStatHandle<T> self_t;
+
+ CountStatHandle(const char* name, const char* description = NULL)
+ : stat_t(name, description)
+ {}
+
+ /*virtual*/ const char* getUnitLabel() const { return LLGetUnitLabel<T>::getUnitLabel(); }
+};
+
+template<typename T, typename VALUE_T>
+void add(CountStatHandle<T>& count, VALUE_T value)
+{
+#if LL_TRACE_ENABLED
+ T converted_value(value);
+ count.getCurrentAccumulator().add(storage_value(converted_value));
+#endif
+}
+
+template<>
+class StatType<MemAccumulator::AllocationFacet>
+: public StatType<MemAccumulator>
+{
+public:
+
+ StatType(const char* name, const char* description = "")
+ : StatType<MemAccumulator>(name, description)
+ {}
+};
+
+template<>
+class StatType<MemAccumulator::DeallocationFacet>
+: public StatType<MemAccumulator>
+{
+public:
+
+ StatType(const char* name, const char* description = "")
+ : StatType<MemAccumulator>(name, description)
+ {}
+};
+
+class MemStatHandle : public StatType<MemAccumulator>
+{
+public:
+ typedef StatType<MemAccumulator> stat_t;
+ MemStatHandle(const char* name, const char* description = "")
+ : stat_t(name, description)
+ {
+ mName = name;
+ }
+
+ void setName(const char* name)
+ {
+ mName = name;
+ setKey(name);
+ }
+
+ /*virtual*/ const char* getUnitLabel() const { return "KB"; }
+
+ StatType<MemAccumulator::AllocationFacet>& allocations()
+ {
+ return static_cast<StatType<MemAccumulator::AllocationFacet>&>(*(StatType<MemAccumulator>*)this);
+ }
+
+ StatType<MemAccumulator::DeallocationFacet>& deallocations()
+ {
+ return static_cast<StatType<MemAccumulator::DeallocationFacet>&>(*(StatType<MemAccumulator>*)this);
+ }
+};
+
+
+// measures effective memory footprint of specified type
+// specialize to cover different types
+template<typename T, typename IS_MEM_TRACKABLE = void, typename IS_UNITS = void>
+struct MeasureMem
+{
+ static size_t measureFootprint(const T& value)
+ {
+ return sizeof(T);
+ }
+};
+
+template<typename T, typename IS_BYTES>
+struct MeasureMem<T, typename T::mem_trackable_tag_t, IS_BYTES>
+{
+ static size_t measureFootprint(const T& value)
+ {
+ return sizeof(T) + value.getMemFootprint();
+ }
+};
+
+template<typename T, typename IS_MEM_TRACKABLE>
+struct MeasureMem<T, IS_MEM_TRACKABLE, typename T::is_unit_t>
+{
+ static size_t measureFootprint(const T& value)
+ {
+ return U32Bytes(value).value();
+ }
+};
+
+template<typename T, typename IS_MEM_TRACKABLE, typename IS_BYTES>
+struct MeasureMem<T*, IS_MEM_TRACKABLE, IS_BYTES>
+{
+ static size_t measureFootprint(const T* value)
+ {
+ if (!value)
+ {
+ return 0;
+ }
+ return MeasureMem<T>::measureFootprint(*value);
+ }
+};
+
+template<typename T, typename IS_MEM_TRACKABLE, typename IS_BYTES>
+struct MeasureMem<LLPointer<T>, IS_MEM_TRACKABLE, IS_BYTES>
+{
+ static size_t measureFootprint(const LLPointer<T> value)
+ {
+ if (value.isNull())
+ {
+ return 0;
+ }
+ return MeasureMem<T>::measureFootprint(*value);
+ }
+};
+
+template<typename IS_MEM_TRACKABLE, typename IS_BYTES>
+struct MeasureMem<S32, IS_MEM_TRACKABLE, IS_BYTES>
+{
+ static size_t measureFootprint(S32 value)
+ {
+ return value;
+ }
+};
+
+template<typename IS_MEM_TRACKABLE, typename IS_BYTES>
+struct MeasureMem<U32, IS_MEM_TRACKABLE, IS_BYTES>
+{
+ static size_t measureFootprint(U32 value)
+ {
+ return value;
+ }
+};
+
+template<typename T, typename IS_MEM_TRACKABLE, typename IS_BYTES>
+struct MeasureMem<std::basic_string<T>, IS_MEM_TRACKABLE, IS_BYTES>
+{
+ static size_t measureFootprint(const std::basic_string<T>& value)
+ {
+ return value.capacity() * sizeof(T);
+ }
+};
+
+
+template<typename T>
+inline void claim_alloc(MemStatHandle& measurement, const T& value)
+{
+#if LL_TRACE_ENABLED
+ S32 size = MeasureMem<T>::measureFootprint(value);
+ if(size == 0) return;
+ MemAccumulator& accumulator = measurement.getCurrentAccumulator();
+ accumulator.mSize.sample(accumulator.mSize.hasValue() ? accumulator.mSize.getLastValue() + (F64)size : (F64)size);
+ accumulator.mAllocations.record(size);
+#endif
+}
+
+template<typename T>
+inline void disclaim_alloc(MemStatHandle& measurement, const T& value)
+{
+#if LL_TRACE_ENABLED
+ S32 size = MeasureMem<T>::measureFootprint(value);
+ if(size == 0) return;
+ MemAccumulator& accumulator = measurement.getCurrentAccumulator();
+ accumulator.mSize.sample(accumulator.mSize.hasValue() ? accumulator.mSize.getLastValue() - (F64)size : -(F64)size);
+ accumulator.mDeallocations.add(size);
+#endif
+}
+
+template<typename DERIVED, size_t ALIGNMENT = LL_DEFAULT_HEAP_ALIGN>
+class MemTrackableNonVirtual
+{
+public:
+ typedef void mem_trackable_tag_t;
+
+ MemTrackableNonVirtual(const char* name)
+#if LL_TRACE_ENABLED
+ : mMemFootprint(0)
+#endif
+ {
+#if LL_TRACE_ENABLED
+ static bool name_initialized = false;
+ if (!name_initialized)
+ {
+ name_initialized = true;
+ sMemStat.setName(name);
+ }
+#endif
+ }
+
+#if LL_TRACE_ENABLED
+ ~MemTrackableNonVirtual()
+ {
+ disclaimMem(mMemFootprint);
+ }
+
+ static MemStatHandle& getMemStatHandle()
+ {
+ return sMemStat;
+ }
+
+ S32 getMemFootprint() const { return mMemFootprint; }
+#endif
+
+ void* operator new(size_t size)
+ {
+#if LL_TRACE_ENABLED
+ claim_alloc(sMemStat, size);
+#endif
+ return ll_aligned_malloc<ALIGNMENT>(size);
+ }
+
+ template<int CUSTOM_ALIGNMENT>
+ static void* aligned_new(size_t size)
+ {
+#if LL_TRACE_ENABLED
+ claim_alloc(sMemStat, size);
+#endif
+ return ll_aligned_malloc<CUSTOM_ALIGNMENT>(size);
+ }
+
+ void operator delete(void* ptr, size_t size)
+ {
+#if LL_TRACE_ENABLED
+ disclaim_alloc(sMemStat, size);
+#endif
+ ll_aligned_free<ALIGNMENT>(ptr);
+ }
+
+ template<int CUSTOM_ALIGNMENT>
+ static void aligned_delete(void* ptr, size_t size)
+ {
+#if LL_TRACE_ENABLED
+ disclaim_alloc(sMemStat, size);
+#endif
+ ll_aligned_free<CUSTOM_ALIGNMENT>(ptr);
+ }
+
+ void* operator new [](size_t size)
+ {
+#if LL_TRACE_ENABLED
+ claim_alloc(sMemStat, size);
+#endif
+ return ll_aligned_malloc<ALIGNMENT>(size);
+ }
+
+ void operator delete[](void* ptr, size_t size)
+ {
+#if LL_TRACE_ENABLED
+ disclaim_alloc(sMemStat, size);
+#endif
+ ll_aligned_free<ALIGNMENT>(ptr);
+ }
+
+ // claim memory associated with other objects/data as our own, adding to our calculated footprint
+ template<typename CLAIM_T>
+ void claimMem(const CLAIM_T& value) const
+ {
+#if LL_TRACE_ENABLED
+ S32 size = MeasureMem<CLAIM_T>::measureFootprint(value);
+ claim_alloc(sMemStat, size);
+ mMemFootprint += size;
+#endif
+ }
+
+ // remove memory we had claimed from our calculated footprint
+ template<typename CLAIM_T>
+ void disclaimMem(const CLAIM_T& value) const
+ {
+#if LL_TRACE_ENABLED
+ S32 size = MeasureMem<CLAIM_T>::measureFootprint(value);
+ disclaim_alloc(sMemStat, size);
+ mMemFootprint -= size;
+#endif
+ }
+
+private:
+#if LL_TRACE_ENABLED
+ // use signed values so that we can temporarily go negative
+ // and reconcile in destructor
+ // NB: this assumes that no single class is responsible for > 2GB of allocations
+ mutable S32 mMemFootprint;
+
+ static MemStatHandle sMemStat;
+#endif
+
+};
+
+#if LL_TRACE_ENABLED
+template<typename DERIVED, size_t ALIGNMENT>
+MemStatHandle MemTrackableNonVirtual<DERIVED, ALIGNMENT>::sMemStat(typeid(MemTrackableNonVirtual<DERIVED, ALIGNMENT>).name());
+#endif
+
+template<typename DERIVED, size_t ALIGNMENT = LL_DEFAULT_HEAP_ALIGN>
+class MemTrackable : public MemTrackableNonVirtual<DERIVED, ALIGNMENT>
+{
+public:
+ MemTrackable(const char* name)
+ : MemTrackableNonVirtual<DERIVED, ALIGNMENT>(name)
+ {}
+
+ virtual ~MemTrackable()
+ {}
+};
+}
+
+#endif // LL_LLTRACE_H
diff --git a/indra/llcommon/lltraceaccumulators.cpp b/indra/llcommon/lltraceaccumulators.cpp
new file mode 100644
index 0000000000..385d31edd7
--- /dev/null
+++ b/indra/llcommon/lltraceaccumulators.cpp
@@ -0,0 +1,302 @@
+/**
+ * @file lltracesampler.cpp
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2012, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "linden_common.h"
+
+#include "lltraceaccumulators.h"
+#include "lltrace.h"
+#include "lltracethreadrecorder.h"
+
+namespace LLTrace
+{
+
+extern MemStatHandle gTraceMemStat;
+
+
+///////////////////////////////////////////////////////////////////////
+// AccumulatorBufferGroup
+///////////////////////////////////////////////////////////////////////
+
+AccumulatorBufferGroup::AccumulatorBufferGroup()
+{
+ claim_alloc(gTraceMemStat, mCounts.capacity() * sizeof(CountAccumulator));
+ claim_alloc(gTraceMemStat, mSamples.capacity() * sizeof(SampleAccumulator));
+ claim_alloc(gTraceMemStat, mEvents.capacity() * sizeof(EventAccumulator));
+ claim_alloc(gTraceMemStat, mStackTimers.capacity() * sizeof(TimeBlockAccumulator));
+ claim_alloc(gTraceMemStat, mMemStats.capacity() * sizeof(MemAccumulator));
+}
+
+AccumulatorBufferGroup::AccumulatorBufferGroup(const AccumulatorBufferGroup& other)
+: mCounts(other.mCounts),
+ mSamples(other.mSamples),
+ mEvents(other.mEvents),
+ mStackTimers(other.mStackTimers),
+ mMemStats(other.mMemStats)
+{
+ claim_alloc(gTraceMemStat, mCounts.capacity() * sizeof(CountAccumulator));
+ claim_alloc(gTraceMemStat, mSamples.capacity() * sizeof(SampleAccumulator));
+ claim_alloc(gTraceMemStat, mEvents.capacity() * sizeof(EventAccumulator));
+ claim_alloc(gTraceMemStat, mStackTimers.capacity() * sizeof(TimeBlockAccumulator));
+ claim_alloc(gTraceMemStat, mMemStats.capacity() * sizeof(MemAccumulator));
+}
+
+AccumulatorBufferGroup::~AccumulatorBufferGroup()
+{
+ disclaim_alloc(gTraceMemStat, mCounts.capacity() * sizeof(CountAccumulator));
+ disclaim_alloc(gTraceMemStat, mSamples.capacity() * sizeof(SampleAccumulator));
+ disclaim_alloc(gTraceMemStat, mEvents.capacity() * sizeof(EventAccumulator));
+ disclaim_alloc(gTraceMemStat, mStackTimers.capacity() * sizeof(TimeBlockAccumulator));
+ disclaim_alloc(gTraceMemStat, mMemStats.capacity() * sizeof(MemAccumulator));
+}
+
+void AccumulatorBufferGroup::handOffTo(AccumulatorBufferGroup& other)
+{
+ other.mCounts.reset(&mCounts);
+ other.mSamples.reset(&mSamples);
+ other.mEvents.reset(&mEvents);
+ other.mStackTimers.reset(&mStackTimers);
+ other.mMemStats.reset(&mMemStats);
+}
+
+void AccumulatorBufferGroup::makeCurrent()
+{
+ mCounts.makeCurrent();
+ mSamples.makeCurrent();
+ mEvents.makeCurrent();
+ mStackTimers.makeCurrent();
+ mMemStats.makeCurrent();
+
+ ThreadRecorder* thread_recorder = get_thread_recorder().get();
+ AccumulatorBuffer<TimeBlockAccumulator>& timer_accumulator_buffer = mStackTimers;
+ // update stacktimer parent pointers
+ for (S32 i = 0, end_i = mStackTimers.size(); i < end_i; i++)
+ {
+ TimeBlockTreeNode* tree_node = thread_recorder->getTimeBlockTreeNode(i);
+ if (tree_node)
+ {
+ timer_accumulator_buffer[i].mParent = tree_node->mParent;
+ }
+ }
+}
+
+//static
+void AccumulatorBufferGroup::clearCurrent()
+{
+ AccumulatorBuffer<CountAccumulator>::clearCurrent();
+ AccumulatorBuffer<SampleAccumulator>::clearCurrent();
+ AccumulatorBuffer<EventAccumulator>::clearCurrent();
+ AccumulatorBuffer<TimeBlockAccumulator>::clearCurrent();
+ AccumulatorBuffer<MemAccumulator>::clearCurrent();
+}
+
+bool AccumulatorBufferGroup::isCurrent() const
+{
+ return mCounts.isCurrent();
+}
+
+void AccumulatorBufferGroup::append( const AccumulatorBufferGroup& other )
+{
+ mCounts.addSamples(other.mCounts, SEQUENTIAL);
+ mSamples.addSamples(other.mSamples, SEQUENTIAL);
+ mEvents.addSamples(other.mEvents, SEQUENTIAL);
+ mMemStats.addSamples(other.mMemStats, SEQUENTIAL);
+ mStackTimers.addSamples(other.mStackTimers, SEQUENTIAL);
+}
+
+void AccumulatorBufferGroup::merge( const AccumulatorBufferGroup& other)
+{
+ mCounts.addSamples(other.mCounts, NON_SEQUENTIAL);
+ mSamples.addSamples(other.mSamples, NON_SEQUENTIAL);
+ mEvents.addSamples(other.mEvents, NON_SEQUENTIAL);
+ mMemStats.addSamples(other.mMemStats, NON_SEQUENTIAL);
+ // for now, hold out timers from merge, need to be displayed per thread
+ //mStackTimers.addSamples(other.mStackTimers, NON_SEQUENTIAL);
+}
+
+void AccumulatorBufferGroup::reset(AccumulatorBufferGroup* other)
+{
+ mCounts.reset(other ? &other->mCounts : NULL);
+ mSamples.reset(other ? &other->mSamples : NULL);
+ mEvents.reset(other ? &other->mEvents : NULL);
+ mStackTimers.reset(other ? &other->mStackTimers : NULL);
+ mMemStats.reset(other ? &other->mMemStats : NULL);
+}
+
+void AccumulatorBufferGroup::sync()
+{
+ if (isCurrent())
+ {
+ F64SecondsImplicit time_stamp = LLTimer::getTotalSeconds();
+
+ mSamples.sync(time_stamp);
+ mMemStats.sync(time_stamp);
+ }
+}
+
+F64 SampleAccumulator::mergeSumsOfSquares(const SampleAccumulator& a, const SampleAccumulator& b)
+{
+ const F64 epsilon = 0.0000001;
+
+ if (a.getSamplingTime() > epsilon && b.getSamplingTime() > epsilon)
+ {
+ // combine variance (and hence standard deviation) of 2 different sized sample groups using
+ // the following formula: http://www.mrc-bsu.cam.ac.uk/cochrane/handbook/chapter_7/7_7_3_8_combining_groups.htm
+ F64 n_1 = a.getSamplingTime(),
+ n_2 = b.getSamplingTime();
+ F64 m_1 = a.getMean(),
+ m_2 = b.getMean();
+ F64 v_1 = a.getSumOfSquares() / a.getSamplingTime(),
+ v_2 = b.getSumOfSquares() / b.getSamplingTime();
+ if (n_1 < epsilon)
+ {
+ return b.getSumOfSquares();
+ }
+ else
+ {
+ return a.getSamplingTime()
+ * ((((n_1 - epsilon) * v_1)
+ + ((n_2 - epsilon) * v_2)
+ + (((n_1 * n_2) / (n_1 + n_2))
+ * ((m_1 * m_1) + (m_2 * m_2) - (2.f * m_1 * m_2))))
+ / (n_1 + n_2 - epsilon));
+ }
+ }
+
+ return a.getSumOfSquares();
+}
+
+
+void SampleAccumulator::addSamples( const SampleAccumulator& other, EBufferAppendType append_type )
+{
+ if (append_type == NON_SEQUENTIAL)
+ {
+ return;
+ }
+
+ if (!mHasValue)
+ {
+ *this = other;
+
+ if (append_type == NON_SEQUENTIAL)
+ {
+ // restore own last value state
+ mLastValue = NaN;
+ mHasValue = false;
+ }
+ }
+ else if (other.mHasValue)
+ {
+ mSum += other.mSum;
+
+ if (other.mMin < mMin) { mMin = other.mMin; }
+ if (other.mMax > mMax) { mMax = other.mMax; }
+
+ mSumOfSquares = mergeSumsOfSquares(*this, other);
+
+ if (append_type == SEQUENTIAL)
+ {
+ mLastValue = other.mLastValue;
+ mLastSampleTimeStamp = other.mLastSampleTimeStamp;
+ }
+ }
+}
+
+void SampleAccumulator::reset( const SampleAccumulator* other )
+{
+ mLastValue = other ? other->mLastValue : NaN;
+ mHasValue = other ? other->mHasValue : false;
+ mNumSamples = 0;
+ mSum = 0;
+ mMin = mLastValue;
+ mMax = mLastValue;
+ mMean = mLastValue;
+ llassert(!mHasValue || mMean < 0 || mMean >= 0);
+ mSumOfSquares = 0;
+ mLastSampleTimeStamp = LLTimer::getTotalSeconds();
+ mTotalSamplingTime = 0;
+}
+
+F64 EventAccumulator::mergeSumsOfSquares(const EventAccumulator& a, const EventAccumulator& b)
+{
+ if (a.mNumSamples && b.mNumSamples)
+ {
+ // combine variance (and hence standard deviation) of 2 different sized sample groups using
+ // the following formula: http://www.mrc-bsu.cam.ac.uk/cochrane/handbook/chapter_7/7_7_3_8_combining_groups.htm
+ F64 n_1 = a.mNumSamples,
+ n_2 = b.mNumSamples;
+ F64 m_1 = a.mMean,
+ m_2 = b.mMean;
+ F64 v_1 = a.mSumOfSquares / a.mNumSamples,
+ v_2 = b.mSumOfSquares / b.mNumSamples;
+ return (F64)a.mNumSamples
+ * ((((n_1 - 1.f) * v_1)
+ + ((n_2 - 1.f) * v_2)
+ + (((n_1 * n_2) / (n_1 + n_2))
+ * ((m_1 * m_1) + (m_2 * m_2) - (2.f * m_1 * m_2))))
+ / (n_1 + n_2 - 1.f));
+ }
+
+ return a.mSumOfSquares;
+}
+
+void EventAccumulator::addSamples( const EventAccumulator& other, EBufferAppendType append_type )
+{
+ if (other.mNumSamples)
+ {
+ if (!mNumSamples)
+ {
+ *this = other;
+ }
+ else
+ {
+ mSum += other.mSum;
+
+ // NOTE: both conditions will hold first time through
+ if (other.mMin < mMin) { mMin = other.mMin; }
+ if (other.mMax > mMax) { mMax = other.mMax; }
+
+ mSumOfSquares = mergeSumsOfSquares(*this, other);
+
+ F64 weight = (F64)mNumSamples / (F64)(mNumSamples + other.mNumSamples);
+ mNumSamples += other.mNumSamples;
+ mMean = mMean * weight + other.mMean * (1.f - weight);
+ if (append_type == SEQUENTIAL) mLastValue = other.mLastValue;
+ }
+ }
+}
+
+void EventAccumulator::reset( const EventAccumulator* other )
+{
+ mNumSamples = 0;
+ mSum = 0;
+ mMin = NaN;
+ mMax = NaN;
+ mMean = NaN;
+ mSumOfSquares = 0;
+ mLastValue = other ? other->mLastValue : NaN;
+}
+
+
+}
diff --git a/indra/llcommon/lltraceaccumulators.h b/indra/llcommon/lltraceaccumulators.h
new file mode 100644
index 0000000000..42fad8a793
--- /dev/null
+++ b/indra/llcommon/lltraceaccumulators.h
@@ -0,0 +1,590 @@
+
+/**
+ * @file lltraceaccumulators.h
+ * @brief Storage for accumulating statistics
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2012, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLTRACEACCUMULATORS_H
+#define LL_LLTRACEACCUMULATORS_H
+
+
+#include "stdtypes.h"
+#include "llpreprocessor.h"
+#include "llunits.h"
+#include "lltimer.h"
+#include "llrefcount.h"
+#include "llthreadlocalstorage.h"
+#include "llmemory.h"
+#include <limits>
+
+namespace LLTrace
+{
+ const F64 NaN = std::numeric_limits<double>::quiet_NaN();
+
+ enum EBufferAppendType
+ {
+ SEQUENTIAL,
+ NON_SEQUENTIAL
+ };
+
+ template<typename ACCUMULATOR>
+ class AccumulatorBuffer : public LLRefCount
+ {
+ typedef AccumulatorBuffer<ACCUMULATOR> self_t;
+ static const S32 DEFAULT_ACCUMULATOR_BUFFER_SIZE = 32;
+ private:
+ struct StaticAllocationMarker { };
+
+ AccumulatorBuffer(StaticAllocationMarker m)
+ : mStorageSize(0),
+ mStorage(NULL)
+ {}
+
+ public:
+
+ AccumulatorBuffer(const AccumulatorBuffer& other = *getDefaultBuffer())
+ : mStorageSize(0),
+ mStorage(NULL)
+ {
+ resize(sNextStorageSlot);
+ for (S32 i = 0; i < sNextStorageSlot; i++)
+ {
+ mStorage[i] = other.mStorage[i];
+ }
+ }
+
+ ~AccumulatorBuffer()
+ {
+ if (isCurrent())
+ {
+ LLThreadLocalSingletonPointer<ACCUMULATOR>::setInstance(NULL);
+ }
+ delete[] mStorage;
+ }
+
+ LL_FORCE_INLINE ACCUMULATOR& operator[](size_t index)
+ {
+ return mStorage[index];
+ }
+
+ LL_FORCE_INLINE const ACCUMULATOR& operator[](size_t index) const
+ {
+ return mStorage[index];
+ }
+
+ void addSamples(const AccumulatorBuffer<ACCUMULATOR>& other, EBufferAppendType append_type)
+ {
+ llassert(mStorageSize >= sNextStorageSlot && other.mStorageSize >= sNextStorageSlot);
+ for (size_t i = 0; i < sNextStorageSlot; i++)
+ {
+ mStorage[i].addSamples(other.mStorage[i], append_type);
+ }
+ }
+
+ void copyFrom(const AccumulatorBuffer<ACCUMULATOR>& other)
+ {
+ llassert(mStorageSize >= sNextStorageSlot && other.mStorageSize >= sNextStorageSlot);
+ for (size_t i = 0; i < sNextStorageSlot; i++)
+ {
+ mStorage[i] = other.mStorage[i];
+ }
+ }
+
+ void reset(const AccumulatorBuffer<ACCUMULATOR>* other = NULL)
+ {
+ llassert(mStorageSize >= sNextStorageSlot);
+ for (size_t i = 0; i < sNextStorageSlot; i++)
+ {
+ mStorage[i].reset(other ? &other->mStorage[i] : NULL);
+ }
+ }
+
+ void sync(F64SecondsImplicit time_stamp)
+ {
+ llassert(mStorageSize >= sNextStorageSlot);
+ for (size_t i = 0; i < sNextStorageSlot; i++)
+ {
+ mStorage[i].sync(time_stamp);
+ }
+ }
+
+ void makeCurrent()
+ {
+ LLThreadLocalSingletonPointer<ACCUMULATOR>::setInstance(mStorage);
+ }
+
+ bool isCurrent() const
+ {
+ return LLThreadLocalSingletonPointer<ACCUMULATOR>::getInstance() == mStorage;
+ }
+
+ static void clearCurrent()
+ {
+ LLThreadLocalSingletonPointer<ACCUMULATOR>::setInstance(NULL);
+ }
+
+ // NOTE: this is not thread-safe. We assume that slots are reserved in the main thread before any child threads are spawned
+ size_t reserveSlot()
+ {
+ size_t next_slot = sNextStorageSlot++;
+ if (next_slot >= mStorageSize)
+ {
+ // don't perform doubling, as this should only happen during startup
+ // want to keep a tight bounds as we will have a lot of these buffers
+ resize(mStorageSize + mStorageSize / 2);
+ }
+ llassert(mStorage && next_slot < mStorageSize);
+ return next_slot;
+ }
+
+ void resize(size_t new_size)
+ {
+ if (new_size <= mStorageSize) return;
+
+ ACCUMULATOR* old_storage = mStorage;
+ mStorage = new ACCUMULATOR[new_size];
+ if (old_storage)
+ {
+ for (S32 i = 0; i < mStorageSize; i++)
+ {
+ mStorage[i] = old_storage[i];
+ }
+ }
+ mStorageSize = new_size;
+ delete[] old_storage;
+
+ self_t* default_buffer = getDefaultBuffer();
+ if (this != default_buffer
+ && new_size > default_buffer->size())
+ {
+ //NB: this is not thread safe, but we assume that all resizing occurs during static initialization
+ default_buffer->resize(new_size);
+ }
+ }
+
+ size_t size() const
+ {
+ return getNumIndices();
+ }
+
+ size_t capacity() const
+ {
+ return mStorageSize;
+ }
+
+ static size_t getNumIndices()
+ {
+ return sNextStorageSlot;
+ }
+
+ static self_t* getDefaultBuffer()
+ {
+ static bool sInitialized = false;
+ if (!sInitialized)
+ {
+ // this buffer is allowed to leak so that trace calls from global destructors have somewhere to put their data
+ // so as not to trigger an access violation
+ sDefaultBuffer = new AccumulatorBuffer(StaticAllocationMarker());
+ sInitialized = true;
+ sDefaultBuffer->resize(DEFAULT_ACCUMULATOR_BUFFER_SIZE);
+ }
+ return sDefaultBuffer;
+ }
+
+ private:
+ ACCUMULATOR* mStorage;
+ size_t mStorageSize;
+ static size_t sNextStorageSlot;
+ static self_t* sDefaultBuffer;
+ };
+
+ template<typename ACCUMULATOR> size_t AccumulatorBuffer<ACCUMULATOR>::sNextStorageSlot = 0;
+ template<typename ACCUMULATOR> AccumulatorBuffer<ACCUMULATOR>* AccumulatorBuffer<ACCUMULATOR>::sDefaultBuffer = NULL;
+
+ class EventAccumulator
+ {
+ public:
+ typedef F64 value_t;
+ static F64 getDefaultValue() { return NaN; }
+
+ EventAccumulator()
+ : mSum(0),
+ mMin(NaN),
+ mMax(NaN),
+ mMean(NaN),
+ mSumOfSquares(0),
+ mNumSamples(0),
+ mLastValue(NaN)
+ {}
+
+ void record(F64 value)
+ {
+ if (mNumSamples == 0)
+ {
+ mSum = value;
+ mMean = value;
+ mMin = value;
+ mMax = value;
+ }
+ else
+ {
+ mSum += value;
+ F64 old_mean = mMean;
+ mMean += (value - old_mean) / (F64)mNumSamples;
+ mSumOfSquares += (value - old_mean) * (value - mMean);
+
+ if (value < mMin) { mMin = value; }
+ else if (value > mMax) { mMax = value; }
+ }
+
+ mNumSamples++;
+ mLastValue = value;
+ }
+
+ void addSamples(const EventAccumulator& other, EBufferAppendType append_type);
+ void reset(const EventAccumulator* other);
+ void sync(F64SecondsImplicit) {}
+
+ F64 getSum() const { return mSum; }
+ F32 getMin() const { return mMin; }
+ F32 getMax() const { return mMax; }
+ F64 getLastValue() const { return mLastValue; }
+ F64 getMean() const { return mMean; }
+ F64 getStandardDeviation() const { return sqrtf(mSumOfSquares / mNumSamples); }
+ F64 getSumOfSquares() const { return mSumOfSquares; }
+ S32 getSampleCount() const { return mNumSamples; }
+ bool hasValue() const { return mNumSamples > 0; }
+
+ // helper utility to calculate combined sumofsquares total
+ static F64 mergeSumsOfSquares(const EventAccumulator& a, const EventAccumulator& b);
+
+ private:
+ F64 mSum,
+ mLastValue;
+
+ F64 mMean,
+ mSumOfSquares;
+
+ F32 mMin,
+ mMax;
+
+ S32 mNumSamples;
+ };
+
+
+ class SampleAccumulator
+ {
+ public:
+ typedef F64 value_t;
+ static F64 getDefaultValue() { return NaN; }
+
+ SampleAccumulator()
+ : mSum(0),
+ mMin(NaN),
+ mMax(NaN),
+ mMean(NaN),
+ mSumOfSquares(0),
+ mLastSampleTimeStamp(0),
+ mTotalSamplingTime(0),
+ mNumSamples(0),
+ mLastValue(NaN),
+ mHasValue(false)
+ {}
+
+ void sample(F64 value)
+ {
+ F64SecondsImplicit time_stamp = LLTimer::getTotalSeconds();
+
+ // store effect of last value
+ sync(time_stamp);
+
+ if (!mHasValue)
+ {
+ mHasValue = true;
+
+ mMin = value;
+ mMax = value;
+ mMean = value;
+ mLastSampleTimeStamp = time_stamp;
+ }
+ else
+ {
+ if (value < mMin) { mMin = value; }
+ else if (value > mMax) { mMax = value; }
+ }
+
+ mLastValue = value;
+ mNumSamples++;
+ }
+
+ void addSamples(const SampleAccumulator& other, EBufferAppendType append_type);
+ void reset(const SampleAccumulator* other);
+
+ void sync(F64SecondsImplicit time_stamp)
+ {
+ if (mHasValue && time_stamp != mLastSampleTimeStamp)
+ {
+ F64SecondsImplicit delta_time = time_stamp - mLastSampleTimeStamp;
+ mSum += mLastValue * delta_time;
+ mTotalSamplingTime += delta_time;
+ F64 old_mean = mMean;
+ mMean += (delta_time / mTotalSamplingTime) * (mLastValue - old_mean);
+ mSumOfSquares += delta_time * (mLastValue - old_mean) * (mLastValue - mMean);
+ }
+ mLastSampleTimeStamp = time_stamp;
+ }
+
+ F64 getSum() const { return mSum; }
+ F32 getMin() const { return mMin; }
+ F32 getMax() const { return mMax; }
+ F64 getLastValue() const { return mLastValue; }
+ F64 getMean() const { return mMean; }
+ F64 getStandardDeviation() const { return sqrtf(mSumOfSquares / mTotalSamplingTime); }
+ F64 getSumOfSquares() const { return mSumOfSquares; }
+ F64SecondsImplicit getSamplingTime() const { return mTotalSamplingTime; }
+ S32 getSampleCount() const { return mNumSamples; }
+ bool hasValue() const { return mHasValue; }
+
+ // helper utility to calculate combined sumofsquares total
+ static F64 mergeSumsOfSquares(const SampleAccumulator& a, const SampleAccumulator& b);
+
+ private:
+ F64 mSum,
+ mLastValue;
+
+ F64 mMean,
+ mSumOfSquares;
+
+ F64SecondsImplicit
+ mLastSampleTimeStamp,
+ mTotalSamplingTime;
+
+ F32 mMin,
+ mMax;
+
+ S32 mNumSamples;
+ // distinct from mNumSamples, since we might have inherited a last value from
+ // a previous sampling period
+ bool mHasValue;
+ };
+
+ class CountAccumulator
+ {
+ public:
+ typedef F64 value_t;
+ static F64 getDefaultValue() { return 0; }
+
+ CountAccumulator()
+ : mSum(0),
+ mNumSamples(0)
+ {}
+
+ void add(F64 value)
+ {
+ mNumSamples++;
+ mSum += value;
+ }
+
+ void addSamples(const CountAccumulator& other, EBufferAppendType /*type*/)
+ {
+ mSum += other.mSum;
+ mNumSamples += other.mNumSamples;
+ }
+
+ void reset(const CountAccumulator* other)
+ {
+ mNumSamples = 0;
+ mSum = 0;
+ }
+
+ void sync(F64SecondsImplicit) {}
+
+ F64 getSum() const { return mSum; }
+
+ S32 getSampleCount() const { return mNumSamples; }
+
+ bool hasValue() const { return true; }
+
+ private:
+ F64 mSum;
+
+ S32 mNumSamples;
+ };
+
+ class TimeBlockAccumulator
+ {
+ public:
+ typedef F64Seconds value_t;
+ static F64Seconds getDefaultValue() { return F64Seconds(0); }
+
+ typedef TimeBlockAccumulator self_t;
+
+ // fake classes that allows us to view different facets of underlying statistic
+ struct CallCountFacet
+ {
+ typedef S32 value_t;
+ };
+
+ struct SelfTimeFacet
+ {
+ typedef F64Seconds value_t;
+ };
+
+ // arrays are allocated with 32 byte alignment
+ void *operator new [](size_t size)
+ {
+ return ll_aligned_malloc<32>(size);
+ }
+
+ void operator delete[](void* ptr, size_t size)
+ {
+ ll_aligned_free<32>(ptr);
+ }
+
+ TimeBlockAccumulator();
+ void addSamples(const self_t& other, EBufferAppendType append_type);
+ void reset(const self_t* other);
+ void sync(F64SecondsImplicit) {}
+ bool hasValue() const { return true; }
+
+ //
+ // members
+ //
+ U64 mTotalTimeCounter,
+ mSelfTimeCounter;
+ S32 mCalls;
+ class BlockTimerStatHandle* mParent; // last acknowledged parent of this time block
+ class BlockTimerStatHandle* mLastCaller; // used to bootstrap tree construction
+ U16 mActiveCount; // number of timers with this ID active on stack
+ bool mMoveUpTree; // needs to be moved up the tree of timers at the end of frame
+
+ };
+
+ class BlockTimerStatHandle;
+
+ class TimeBlockTreeNode
+ {
+ public:
+ TimeBlockTreeNode();
+
+ void setParent(BlockTimerStatHandle* parent);
+ BlockTimerStatHandle* getParent() { return mParent; }
+
+ BlockTimerStatHandle* mBlock;
+ BlockTimerStatHandle* mParent;
+ std::vector<BlockTimerStatHandle*> mChildren;
+ bool mCollapsed;
+ bool mNeedsSorting;
+ };
+
+ struct BlockTimerStackRecord
+ {
+ class BlockTimer* mActiveTimer;
+ class BlockTimerStatHandle* mTimeBlock;
+ U64 mChildTime;
+ };
+
+ struct MemAccumulator
+ {
+ typedef F64Bytes value_t;
+ static F64Bytes getDefaultValue() { return F64Bytes(0); }
+
+ typedef MemAccumulator self_t;
+
+ // fake classes that allows us to view different facets of underlying statistic
+ struct AllocationFacet
+ {
+ typedef F64Bytes value_t;
+ static F64Bytes getDefaultValue() { return F64Bytes(0); }
+ };
+
+ struct DeallocationFacet
+ {
+ typedef F64Bytes value_t;
+ static F64Bytes getDefaultValue() { return F64Bytes(0); }
+ };
+
+ void addSamples(const MemAccumulator& other, EBufferAppendType append_type)
+ {
+ mAllocations.addSamples(other.mAllocations, append_type);
+ mDeallocations.addSamples(other.mDeallocations, append_type);
+
+ if (append_type == SEQUENTIAL)
+ {
+ mSize.addSamples(other.mSize, SEQUENTIAL);
+ }
+ else
+ {
+ F64 allocation_delta(other.mAllocations.getSum() - other.mDeallocations.getSum());
+ mSize.sample(mSize.hasValue()
+ ? mSize.getLastValue() + allocation_delta
+ : allocation_delta);
+ }
+ }
+
+ void reset(const MemAccumulator* other)
+ {
+ mSize.reset(other ? &other->mSize : NULL);
+ mAllocations.reset(other ? &other->mAllocations : NULL);
+ mDeallocations.reset(other ? &other->mDeallocations : NULL);
+ }
+
+ void sync(F64SecondsImplicit time_stamp)
+ {
+ mSize.sync(time_stamp);
+ }
+
+ bool hasValue() const { return mSize.hasValue(); }
+
+ SampleAccumulator mSize;
+ EventAccumulator mAllocations;
+ CountAccumulator mDeallocations;
+ };
+
+ struct AccumulatorBufferGroup : public LLRefCount
+ {
+ AccumulatorBufferGroup();
+ AccumulatorBufferGroup(const AccumulatorBufferGroup&);
+ ~AccumulatorBufferGroup();
+
+ void handOffTo(AccumulatorBufferGroup& other);
+ void makeCurrent();
+ bool isCurrent() const;
+ static void clearCurrent();
+
+ void append(const AccumulatorBufferGroup& other);
+ void merge(const AccumulatorBufferGroup& other);
+ void reset(AccumulatorBufferGroup* other = NULL);
+ void sync();
+
+ AccumulatorBuffer<CountAccumulator> mCounts;
+ AccumulatorBuffer<SampleAccumulator> mSamples;
+ AccumulatorBuffer<EventAccumulator> mEvents;
+ AccumulatorBuffer<TimeBlockAccumulator> mStackTimers;
+ AccumulatorBuffer<MemAccumulator> mMemStats;
+ };
+}
+
+#endif // LL_LLTRACEACCUMULATORS_H
+
diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp
new file mode 100644
index 0000000000..0b10438b9f
--- /dev/null
+++ b/indra/llcommon/lltracerecording.cpp
@@ -0,0 +1,1251 @@
+/**
+ * @file lltracesampler.cpp
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2012, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "linden_common.h"
+
+#include "lltracerecording.h"
+
+#include "lltrace.h"
+#include "llfasttimer.h"
+#include "lltracethreadrecorder.h"
+#include "llthread.h"
+
+inline F64 lerp(F64 a, F64 b, F64 u)
+{
+ return a + ((b - a) * u);
+}
+
+namespace LLTrace
+{
+
+extern MemStatHandle gTraceMemStat;
+
+///////////////////////////////////////////////////////////////////////
+// Recording
+///////////////////////////////////////////////////////////////////////
+
+Recording::Recording(EPlayState state)
+: mElapsedSeconds(0),
+ mActiveBuffers(NULL)
+{
+ claim_alloc(gTraceMemStat, this);
+ mBuffers = new AccumulatorBufferGroup();
+ claim_alloc(gTraceMemStat, mBuffers);
+ setPlayState(state);
+}
+
+Recording::Recording( const Recording& other )
+: mActiveBuffers(NULL)
+{
+ claim_alloc(gTraceMemStat, this);
+ *this = other;
+}
+
+Recording& Recording::operator = (const Recording& other)
+{
+ // this will allow us to seamlessly start without affecting any data we've acquired from other
+ setPlayState(PAUSED);
+
+ const_cast<Recording&>(other).update();
+ EPlayState other_play_state = other.getPlayState();
+
+ mBuffers = other.mBuffers;
+
+ // above call will clear mElapsedSeconds as a side effect, so copy it here
+ mElapsedSeconds = other.mElapsedSeconds;
+ mSamplingTimer = other.mSamplingTimer;
+
+ setPlayState(other_play_state);
+
+ return *this;
+}
+
+
+Recording::~Recording()
+{
+ disclaim_alloc(gTraceMemStat, this);
+ disclaim_alloc(gTraceMemStat, mBuffers);
+
+ // allow recording destruction without thread recorder running,
+ // otherwise thread shutdown could crash if a recording outlives the thread recorder
+ // besides, recording construction and destruction is fine without a recorder...just don't attempt to start one
+ if (isStarted() && LLTrace::get_thread_recorder().notNull())
+ {
+ LLTrace::get_thread_recorder()->deactivate(mBuffers.write());
+ }
+}
+
+// brings recording to front of recorder stack, with up to date info
+void Recording::update()
+{
+#if LL_TRACE_ENABLED
+ if (isStarted())
+ {
+ mElapsedSeconds += mSamplingTimer.getElapsedTimeF64();
+
+ // must have
+ llassert(mActiveBuffers != NULL
+ && LLTrace::get_thread_recorder().notNull());
+
+ if(!mActiveBuffers->isCurrent())
+ {
+ AccumulatorBufferGroup* buffers = mBuffers.write();
+ LLTrace::get_thread_recorder()->deactivate(buffers);
+ mActiveBuffers = LLTrace::get_thread_recorder()->activate(buffers);
+ }
+
+ mSamplingTimer.reset();
+ }
+#endif
+}
+
+void Recording::handleReset()
+{
+#if LL_TRACE_ENABLED
+ mBuffers.write()->reset();
+
+ mElapsedSeconds = F64Seconds(0.0);
+ mSamplingTimer.reset();
+#endif
+}
+
+void Recording::handleStart()
+{
+#if LL_TRACE_ENABLED
+ mSamplingTimer.reset();
+ mBuffers.setStayUnique(true);
+ // must have thread recorder running on this thread
+ llassert(LLTrace::get_thread_recorder().notNull());
+ mActiveBuffers = LLTrace::get_thread_recorder()->activate(mBuffers.write());
+#endif
+}
+
+void Recording::handleStop()
+{
+#if LL_TRACE_ENABLED
+ mElapsedSeconds += mSamplingTimer.getElapsedTimeF64();
+ // must have thread recorder running on this thread
+ llassert(LLTrace::get_thread_recorder().notNull());
+ LLTrace::get_thread_recorder()->deactivate(mBuffers.write());
+ mActiveBuffers = NULL;
+ mBuffers.setStayUnique(false);
+#endif
+}
+
+void Recording::handleSplitTo(Recording& other)
+{
+#if LL_TRACE_ENABLED
+ mBuffers.write()->handOffTo(*other.mBuffers.write());
+#endif
+}
+
+void Recording::appendRecording( Recording& other )
+{
+#if LL_TRACE_ENABLED
+ update();
+ other.update();
+ mBuffers.write()->append(*other.mBuffers);
+ mElapsedSeconds += other.mElapsedSeconds;
+#endif
+}
+
+bool Recording::hasValue(const StatType<TimeBlockAccumulator>& stat)
+{
+ update();
+ const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()];
+ const TimeBlockAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mStackTimers[stat.getIndex()] : NULL;
+ return accumulator.hasValue() || (active_accumulator && active_accumulator->hasValue());
+}
+
+F64Seconds Recording::getSum(const StatType<TimeBlockAccumulator>& stat)
+{
+ update();
+ const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()];
+ const TimeBlockAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mStackTimers[stat.getIndex()] : NULL;
+ return F64Seconds((F64)(accumulator.mTotalTimeCounter) + (F64)(active_accumulator ? active_accumulator->mTotalTimeCounter : 0))
+ / (F64)LLTrace::BlockTimer::countsPerSecond();
+}
+
+F64Seconds Recording::getSum(const StatType<TimeBlockAccumulator::SelfTimeFacet>& stat)
+{
+ update();
+ const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()];
+ const TimeBlockAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mStackTimers[stat.getIndex()] : NULL;
+ return F64Seconds(((F64)(accumulator.mSelfTimeCounter) + (F64)(active_accumulator ? active_accumulator->mSelfTimeCounter : 0)) / (F64)LLTrace::BlockTimer::countsPerSecond());
+}
+
+
+S32 Recording::getSum(const StatType<TimeBlockAccumulator::CallCountFacet>& stat)
+{
+ update();
+ const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()];
+ const TimeBlockAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mStackTimers[stat.getIndex()] : NULL;
+ return accumulator.mCalls + (active_accumulator ? active_accumulator->mCalls : 0);
+}
+
+F64Seconds Recording::getPerSec(const StatType<TimeBlockAccumulator>& stat)
+{
+ update();
+ const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()];
+ const TimeBlockAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mStackTimers[stat.getIndex()] : NULL;
+
+ return F64Seconds((F64)(accumulator.mTotalTimeCounter + (active_accumulator ? active_accumulator->mTotalTimeCounter : 0))
+ / ((F64)LLTrace::BlockTimer::countsPerSecond() * mElapsedSeconds.value()));
+}
+
+F64Seconds Recording::getPerSec(const StatType<TimeBlockAccumulator::SelfTimeFacet>& stat)
+{
+ update();
+ const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()];
+ const TimeBlockAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mStackTimers[stat.getIndex()] : NULL;
+
+ return F64Seconds((F64)(accumulator.mSelfTimeCounter + (active_accumulator ? active_accumulator->mSelfTimeCounter : 0))
+ / ((F64)LLTrace::BlockTimer::countsPerSecond() * mElapsedSeconds.value()));
+}
+
+F32 Recording::getPerSec(const StatType<TimeBlockAccumulator::CallCountFacet>& stat)
+{
+ update();
+ const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()];
+ const TimeBlockAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mStackTimers[stat.getIndex()] : NULL;
+ return (F32)(accumulator.mCalls + (active_accumulator ? active_accumulator->mCalls : 0)) / mElapsedSeconds.value();
+}
+
+bool Recording::hasValue(const StatType<MemAccumulator>& stat)
+{
+ update();
+ const MemAccumulator& accumulator = mBuffers->mMemStats[stat.getIndex()];
+ const MemAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mMemStats[stat.getIndex()] : NULL;
+ return accumulator.mSize.hasValue() || (active_accumulator && active_accumulator->mSize.hasValue() ? active_accumulator->mSize.hasValue() : false);
+}
+
+F64Kilobytes Recording::getMin(const StatType<MemAccumulator>& stat)
+{
+ update();
+ const MemAccumulator& accumulator = mBuffers->mMemStats[stat.getIndex()];
+ const MemAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mMemStats[stat.getIndex()] : NULL;
+ return F64Bytes(llmin(accumulator.mSize.getMin(), (active_accumulator && active_accumulator->mSize.hasValue() ? active_accumulator->mSize.getMin() : F32_MAX)));
+}
+
+F64Kilobytes Recording::getMean(const StatType<MemAccumulator>& stat)
+{
+ update();
+ const MemAccumulator& accumulator = mBuffers->mMemStats[stat.getIndex()];
+ const MemAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mMemStats[stat.getIndex()] : NULL;
+
+ if (active_accumulator && active_accumulator->mSize.hasValue())
+ {
+ return F64Bytes(lerp(accumulator.mSize.getMean(), active_accumulator->mSize.getMean(), active_accumulator->mSize.getSampleCount() / (accumulator.mSize.getSampleCount() + active_accumulator->mSize.getSampleCount())));
+ }
+ else
+ {
+ return F64Bytes(accumulator.mSize.getMean());
+ }
+}
+
+F64Kilobytes Recording::getMax(const StatType<MemAccumulator>& stat)
+{
+ update();
+ const MemAccumulator& accumulator = mBuffers->mMemStats[stat.getIndex()];
+ const MemAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mMemStats[stat.getIndex()] : NULL;
+ return F64Bytes(llmax(accumulator.mSize.getMax(), active_accumulator && active_accumulator->mSize.hasValue() ? active_accumulator->mSize.getMax() : F32_MIN));
+}
+
+F64Kilobytes Recording::getStandardDeviation(const StatType<MemAccumulator>& stat)
+{
+ update();
+ const MemAccumulator& accumulator = mBuffers->mMemStats[stat.getIndex()];
+ const MemAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mMemStats[stat.getIndex()] : NULL;
+ if (active_accumulator && active_accumulator->hasValue())
+ {
+ F64 sum_of_squares = SampleAccumulator::mergeSumsOfSquares(accumulator.mSize, active_accumulator->mSize);
+ return F64Bytes(sqrtf(sum_of_squares / (accumulator.mSize.getSamplingTime().value() + active_accumulator->mSize.getSamplingTime().value())));
+ }
+ else
+ {
+ return F64Bytes(accumulator.mSize.getStandardDeviation());
+ }
+}
+
+F64Kilobytes Recording::getLastValue(const StatType<MemAccumulator>& stat)
+{
+ update();
+ const MemAccumulator& accumulator = mBuffers->mMemStats[stat.getIndex()];
+ const MemAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mMemStats[stat.getIndex()] : NULL;
+ return F64Bytes(active_accumulator ? active_accumulator->mSize.getLastValue() : accumulator.mSize.getLastValue());
+}
+
+bool Recording::hasValue(const StatType<MemAccumulator::AllocationFacet>& stat)
+{
+ update();
+ const MemAccumulator& accumulator = mBuffers->mMemStats[stat.getIndex()];
+ const MemAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mMemStats[stat.getIndex()] : NULL;
+ return accumulator.mAllocations.hasValue() || (active_accumulator ? active_accumulator->mAllocations.hasValue() : false);
+}
+
+F64Kilobytes Recording::getSum(const StatType<MemAccumulator::AllocationFacet>& stat)
+{
+ update();
+ const MemAccumulator& accumulator = mBuffers->mMemStats[stat.getIndex()];
+ const MemAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mMemStats[stat.getIndex()] : NULL;
+ return F64Bytes(accumulator.mAllocations.getSum() + (active_accumulator ? active_accumulator->mAllocations.getSum() : 0));
+}
+
+F64Kilobytes Recording::getPerSec(const StatType<MemAccumulator::AllocationFacet>& stat)
+{
+ update();
+ const MemAccumulator& accumulator = mBuffers->mMemStats[stat.getIndex()];
+ const MemAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mMemStats[stat.getIndex()] : NULL;
+ return F64Bytes((accumulator.mAllocations.getSum() + (active_accumulator ? active_accumulator->mAllocations.getSum() : 0)) / mElapsedSeconds.value());
+}
+
+S32 Recording::getSampleCount(const StatType<MemAccumulator::AllocationFacet>& stat)
+{
+ update();
+ const MemAccumulator& accumulator = mBuffers->mMemStats[stat.getIndex()];
+ const MemAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mMemStats[stat.getIndex()] : NULL;
+ return accumulator.mAllocations.getSampleCount() + (active_accumulator ? active_accumulator->mAllocations.getSampleCount() : 0);
+}
+
+bool Recording::hasValue(const StatType<MemAccumulator::DeallocationFacet>& stat)
+{
+ update();
+ const MemAccumulator& accumulator = mBuffers->mMemStats[stat.getIndex()];
+ const MemAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mMemStats[stat.getIndex()] : NULL;
+ return accumulator.mDeallocations.hasValue() || (active_accumulator ? active_accumulator->mDeallocations.hasValue() : false);
+}
+
+
+F64Kilobytes Recording::getSum(const StatType<MemAccumulator::DeallocationFacet>& stat)
+{
+ update();
+ const MemAccumulator& accumulator = mBuffers->mMemStats[stat.getIndex()];
+ const MemAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mMemStats[stat.getIndex()] : NULL;
+ return F64Bytes(accumulator.mDeallocations.getSum() + (active_accumulator ? active_accumulator->mDeallocations.getSum() : 0));
+}
+
+F64Kilobytes Recording::getPerSec(const StatType<MemAccumulator::DeallocationFacet>& stat)
+{
+ update();
+ const MemAccumulator& accumulator = mBuffers->mMemStats[stat.getIndex()];
+ const MemAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mMemStats[stat.getIndex()] : NULL;
+ return F64Bytes((accumulator.mDeallocations.getSum() + (active_accumulator ? active_accumulator->mDeallocations.getSum() : 0)) / mElapsedSeconds.value());
+}
+
+S32 Recording::getSampleCount(const StatType<MemAccumulator::DeallocationFacet>& stat)
+{
+ update();
+ const MemAccumulator& accumulator = mBuffers->mMemStats[stat.getIndex()];
+ const MemAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mMemStats[stat.getIndex()] : NULL;
+ return accumulator.mDeallocations.getSampleCount() + (active_accumulator ? active_accumulator->mDeallocations.getSampleCount() : 0);
+}
+
+bool Recording::hasValue(const StatType<CountAccumulator>& stat)
+{
+ update();
+ const CountAccumulator& accumulator = mBuffers->mCounts[stat.getIndex()];
+ const CountAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mCounts[stat.getIndex()] : NULL;
+ return accumulator.hasValue() || (active_accumulator ? active_accumulator->hasValue() : false);
+}
+
+F64 Recording::getSum(const StatType<CountAccumulator>& stat)
+{
+ update();
+ const CountAccumulator& accumulator = mBuffers->mCounts[stat.getIndex()];
+ const CountAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mCounts[stat.getIndex()] : NULL;
+ return accumulator.getSum() + (active_accumulator ? active_accumulator->getSum() : 0);
+}
+
+F64 Recording::getPerSec( const StatType<CountAccumulator>& stat )
+{
+ update();
+ const CountAccumulator& accumulator = mBuffers->mCounts[stat.getIndex()];
+ const CountAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mCounts[stat.getIndex()] : NULL;
+ F64 sum = accumulator.getSum() + (active_accumulator ? active_accumulator->getSum() : 0);
+ return sum / mElapsedSeconds.value();
+}
+
+S32 Recording::getSampleCount( const StatType<CountAccumulator>& stat )
+{
+ update();
+ const CountAccumulator& accumulator = mBuffers->mCounts[stat.getIndex()];
+ const CountAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mCounts[stat.getIndex()] : NULL;
+ return accumulator.getSampleCount() + (active_accumulator ? active_accumulator->getSampleCount() : 0);
+}
+
+bool Recording::hasValue(const StatType<SampleAccumulator>& stat)
+{
+ update();
+ const SampleAccumulator& accumulator = mBuffers->mSamples[stat.getIndex()];
+ const SampleAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mSamples[stat.getIndex()] : NULL;
+ return accumulator.hasValue() || (active_accumulator && active_accumulator->hasValue());
+}
+
+F64 Recording::getMin( const StatType<SampleAccumulator>& stat )
+{
+ update();
+ const SampleAccumulator& accumulator = mBuffers->mSamples[stat.getIndex()];
+ const SampleAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mSamples[stat.getIndex()] : NULL;
+ return llmin(accumulator.getMin(), active_accumulator && active_accumulator->hasValue() ? active_accumulator->getMin() : F32_MAX);
+}
+
+F64 Recording::getMax( const StatType<SampleAccumulator>& stat )
+{
+ update();
+ const SampleAccumulator& accumulator = mBuffers->mSamples[stat.getIndex()];
+ const SampleAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mSamples[stat.getIndex()] : NULL;
+ return llmax(accumulator.getMax(), active_accumulator && active_accumulator->hasValue() ? active_accumulator->getMax() : F32_MIN);
+}
+
+F64 Recording::getMean( const StatType<SampleAccumulator>& stat )
+{
+ update();
+ const SampleAccumulator& accumulator = mBuffers->mSamples[stat.getIndex()];
+ const SampleAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mSamples[stat.getIndex()] : NULL;
+ if (active_accumulator && active_accumulator->hasValue())
+ {
+ return lerp(accumulator.getMean(), active_accumulator->getMean(), active_accumulator->getSampleCount() / (accumulator.getSampleCount() + active_accumulator->getSampleCount()));
+ }
+ else
+ {
+ return accumulator.getMean();
+ }
+}
+
+F64 Recording::getStandardDeviation( const StatType<SampleAccumulator>& stat )
+{
+ update();
+ const SampleAccumulator& accumulator = mBuffers->mSamples[stat.getIndex()];
+ const SampleAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mSamples[stat.getIndex()] : NULL;
+
+ if (active_accumulator && active_accumulator->hasValue())
+ {
+ F64 sum_of_squares = SampleAccumulator::mergeSumsOfSquares(accumulator, *active_accumulator);
+ return sqrtf(sum_of_squares / (accumulator.getSamplingTime() + active_accumulator->getSamplingTime()));
+ }
+ else
+ {
+ return accumulator.getStandardDeviation();
+ }
+}
+
+F64 Recording::getLastValue( const StatType<SampleAccumulator>& stat )
+{
+ update();
+ const SampleAccumulator& accumulator = mBuffers->mSamples[stat.getIndex()];
+ const SampleAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mSamples[stat.getIndex()] : NULL;
+ return (active_accumulator && active_accumulator->hasValue() ? active_accumulator->getLastValue() : accumulator.getLastValue());
+}
+
+S32 Recording::getSampleCount( const StatType<SampleAccumulator>& stat )
+{
+ update();
+ const SampleAccumulator& accumulator = mBuffers->mSamples[stat.getIndex()];
+ const SampleAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mSamples[stat.getIndex()] : NULL;
+ return accumulator.getSampleCount() + (active_accumulator && active_accumulator->hasValue() ? active_accumulator->getSampleCount() : 0);
+}
+
+bool Recording::hasValue(const StatType<EventAccumulator>& stat)
+{
+ update();
+ const EventAccumulator& accumulator = mBuffers->mEvents[stat.getIndex()];
+ const EventAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mEvents[stat.getIndex()] : NULL;
+ return accumulator.hasValue() || (active_accumulator && active_accumulator->hasValue());
+}
+
+F64 Recording::getSum( const StatType<EventAccumulator>& stat)
+{
+ update();
+ const EventAccumulator& accumulator = mBuffers->mEvents[stat.getIndex()];
+ const EventAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mEvents[stat.getIndex()] : NULL;
+ return (F64)(accumulator.getSum() + (active_accumulator && active_accumulator->hasValue() ? active_accumulator->getSum() : 0));
+}
+
+F64 Recording::getMin( const StatType<EventAccumulator>& stat )
+{
+ update();
+ const EventAccumulator& accumulator = mBuffers->mEvents[stat.getIndex()];
+ const EventAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mEvents[stat.getIndex()] : NULL;
+ return llmin(accumulator.getMin(), active_accumulator && active_accumulator->hasValue() ? active_accumulator->getMin() : F32_MAX);
+}
+
+F64 Recording::getMax( const StatType<EventAccumulator>& stat )
+{
+ update();
+ const EventAccumulator& accumulator = mBuffers->mEvents[stat.getIndex()];
+ const EventAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mEvents[stat.getIndex()] : NULL;
+ return llmax(accumulator.getMax(), active_accumulator && active_accumulator->hasValue() ? active_accumulator->getMax() : F32_MIN);
+}
+
+F64 Recording::getMean( const StatType<EventAccumulator>& stat )
+{
+ update();
+ const EventAccumulator& accumulator = mBuffers->mEvents[stat.getIndex()];
+ const EventAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mEvents[stat.getIndex()] : NULL;
+ if (active_accumulator && active_accumulator->hasValue())
+ {
+ return lerp(accumulator.getMean(), active_accumulator->getMean(), active_accumulator->getSampleCount() / (accumulator.getSampleCount() + active_accumulator->getSampleCount()));
+ }
+ else
+ {
+ return accumulator.getMean();
+ }
+}
+
+F64 Recording::getStandardDeviation( const StatType<EventAccumulator>& stat )
+{
+ update();
+ const EventAccumulator& accumulator = mBuffers->mEvents[stat.getIndex()];
+ const EventAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mEvents[stat.getIndex()] : NULL;
+
+ if (active_accumulator && active_accumulator->hasValue())
+ {
+ F64 sum_of_squares = EventAccumulator::mergeSumsOfSquares(accumulator, *active_accumulator);
+ return sqrtf(sum_of_squares / (accumulator.getSampleCount() + active_accumulator->getSampleCount()));
+ }
+ else
+ {
+ return accumulator.getStandardDeviation();
+ }
+}
+
+F64 Recording::getLastValue( const StatType<EventAccumulator>& stat )
+{
+ update();
+ const EventAccumulator& accumulator = mBuffers->mEvents[stat.getIndex()];
+ const EventAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mEvents[stat.getIndex()] : NULL;
+ return active_accumulator ? active_accumulator->getLastValue() : accumulator.getLastValue();
+}
+
+S32 Recording::getSampleCount( const StatType<EventAccumulator>& stat )
+{
+ update();
+ const EventAccumulator& accumulator = mBuffers->mEvents[stat.getIndex()];
+ const EventAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mEvents[stat.getIndex()] : NULL;
+ return accumulator.getSampleCount() + (active_accumulator ? active_accumulator->getSampleCount() : 0);
+}
+
+///////////////////////////////////////////////////////////////////////
+// PeriodicRecording
+///////////////////////////////////////////////////////////////////////
+
+PeriodicRecording::PeriodicRecording( S32 num_periods, EPlayState state)
+: mAutoResize(num_periods == 0),
+ mCurPeriod(0),
+ mNumRecordedPeriods(0),
+ mRecordingPeriods(num_periods ? num_periods : 1)
+{
+ setPlayState(state);
+ claim_alloc(gTraceMemStat, this);
+}
+
+PeriodicRecording::~PeriodicRecording()
+{
+ disclaim_alloc(gTraceMemStat, this);
+}
+
+void PeriodicRecording::nextPeriod()
+{
+ if (mAutoResize)
+ {
+ mRecordingPeriods.push_back(Recording());
+ }
+
+ Recording& old_recording = getCurRecording();
+ mCurPeriod = (mCurPeriod + 1) % mRecordingPeriods.size();
+ old_recording.splitTo(getCurRecording());
+
+ mNumRecordedPeriods = llmin((S32)mRecordingPeriods.size() - 1, mNumRecordedPeriods + 1);
+}
+
+void PeriodicRecording::appendRecording(Recording& recording)
+{
+ getCurRecording().appendRecording(recording);
+ nextPeriod();
+}
+
+
+void PeriodicRecording::appendPeriodicRecording( PeriodicRecording& other )
+{
+ if (other.mRecordingPeriods.empty()) return;
+
+ getCurRecording().update();
+ other.getCurRecording().update();
+
+ const S32 other_recording_slots = other.mRecordingPeriods.size();
+ const S32 other_num_recordings = other.getNumRecordedPeriods();
+ const S32 other_current_recording_index = other.mCurPeriod;
+ const S32 other_oldest_recording_index = (other_current_recording_index + other_recording_slots - other_num_recordings) % other_recording_slots;
+
+ // append first recording into our current slot
+ getCurRecording().appendRecording(other.mRecordingPeriods[other_oldest_recording_index]);
+
+ // from now on, add new recordings for everything after the first
+ S32 other_index = (other_oldest_recording_index + 1) % other_recording_slots;
+
+ if (mAutoResize)
+ {
+ // push back recordings for everything in the middle
+ S32 other_index = (other_oldest_recording_index + 1) % other_recording_slots;
+ while (other_index != other_current_recording_index)
+ {
+ mRecordingPeriods.push_back(other.mRecordingPeriods[other_index]);
+ other_index = (other_index + 1) % other_recording_slots;
+ }
+
+ // add final recording, if it wasn't already added as the first
+ if (other_num_recordings > 1)
+ {
+ mRecordingPeriods.push_back(other.mRecordingPeriods[other_current_recording_index]);
+ }
+
+ mCurPeriod = mRecordingPeriods.size() - 1;
+ mNumRecordedPeriods = mRecordingPeriods.size() - 1;
+ }
+ else
+ {
+ S32 num_to_copy = llmin((S32)mRecordingPeriods.size(), (S32)other_num_recordings);
+
+ std::vector<Recording>::iterator src_it = other.mRecordingPeriods.begin() + other_index ;
+ std::vector<Recording>::iterator dest_it = mRecordingPeriods.begin() + mCurPeriod;
+
+ // already consumed the first recording from other, so start counting at 1
+ for(S32 i = 1; i < num_to_copy; i++)
+ {
+ *dest_it = *src_it;
+
+ if (++src_it == other.mRecordingPeriods.end())
+ {
+ src_it = other.mRecordingPeriods.begin();
+ }
+
+ if (++dest_it == mRecordingPeriods.end())
+ {
+ dest_it = mRecordingPeriods.begin();
+ }
+ }
+
+ // want argument to % to be positive, otherwise result could be negative and thus out of bounds
+ llassert(num_to_copy >= 1);
+ // advance to last recording period copied, and make that our current period
+ mCurPeriod = (mCurPeriod + num_to_copy - 1) % mRecordingPeriods.size();
+ mNumRecordedPeriods = llmin((S32)mRecordingPeriods.size() - 1, mNumRecordedPeriods + num_to_copy - 1);
+ }
+
+ // end with fresh period, otherwise next appendPeriodicRecording() will merge the first
+ // recording period with the last one appended here
+ nextPeriod();
+ getCurRecording().setPlayState(getPlayState());
+}
+
+F64Seconds PeriodicRecording::getDuration() const
+{
+ F64Seconds duration;
+ S32 num_periods = mRecordingPeriods.size();
+ for (S32 i = 1; i <= num_periods; i++)
+ {
+ S32 index = (mCurPeriod + num_periods - i) % num_periods;
+ duration += mRecordingPeriods[index].getDuration();
+ }
+ return duration;
+}
+
+
+LLTrace::Recording PeriodicRecording::snapshotCurRecording() const
+{
+ Recording recording_copy(getCurRecording());
+ recording_copy.stop();
+ return recording_copy;
+}
+
+
+Recording& PeriodicRecording::getLastRecording()
+{
+ return getPrevRecording(1);
+}
+
+const Recording& PeriodicRecording::getLastRecording() const
+{
+ return getPrevRecording(1);
+}
+
+Recording& PeriodicRecording::getCurRecording()
+{
+ return mRecordingPeriods[mCurPeriod];
+}
+
+const Recording& PeriodicRecording::getCurRecording() const
+{
+ return mRecordingPeriods[mCurPeriod];
+}
+
+Recording& PeriodicRecording::getPrevRecording( S32 offset )
+{
+ S32 num_periods = mRecordingPeriods.size();
+ offset = llclamp(offset, 0, num_periods - 1);
+ return mRecordingPeriods[(mCurPeriod + num_periods - offset) % num_periods];
+}
+
+const Recording& PeriodicRecording::getPrevRecording( S32 offset ) const
+{
+ S32 num_periods = mRecordingPeriods.size();
+ offset = llclamp(offset, 0, num_periods - 1);
+ return mRecordingPeriods[(mCurPeriod + num_periods - offset) % num_periods];
+}
+
+void PeriodicRecording::handleStart()
+{
+ getCurRecording().start();
+}
+
+void PeriodicRecording::handleStop()
+{
+ getCurRecording().pause();
+}
+
+void PeriodicRecording::handleReset()
+{
+ getCurRecording().stop();
+
+ if (mAutoResize)
+ {
+ mRecordingPeriods.clear();
+ mRecordingPeriods.push_back(Recording());
+ }
+ else
+ {
+ for (std::vector<Recording>::iterator it = mRecordingPeriods.begin(), end_it = mRecordingPeriods.end();
+ it != end_it;
+ ++it)
+ {
+ it->reset();
+ }
+ }
+ mCurPeriod = 0;
+ mNumRecordedPeriods = 0;
+ getCurRecording().setPlayState(getPlayState());
+}
+
+void PeriodicRecording::handleSplitTo(PeriodicRecording& other)
+{
+ getCurRecording().splitTo(other.getCurRecording());
+}
+
+F64 PeriodicRecording::getPeriodMin( const StatType<EventAccumulator>& stat, S32 num_periods /*= S32_MAX*/ )
+{
+ num_periods = llmin(num_periods, getNumRecordedPeriods());
+
+ bool has_value = false;
+ F64 min_val = std::numeric_limits<F64>::max();
+ for (S32 i = 1; i <= num_periods; i++)
+ {
+ Recording& recording = getPrevRecording(i);
+ if (recording.hasValue(stat))
+ {
+ min_val = llmin(min_val, recording.getMin(stat));
+ has_value = true;
+ }
+ }
+
+ return has_value
+ ? min_val
+ : NaN;
+}
+
+F64 PeriodicRecording::getPeriodMax( const StatType<EventAccumulator>& stat, S32 num_periods /*= S32_MAX*/ )
+{
+ num_periods = llmin(num_periods, getNumRecordedPeriods());
+
+ bool has_value = false;
+ F64 max_val = std::numeric_limits<F64>::min();
+ for (S32 i = 1; i <= num_periods; i++)
+ {
+ Recording& recording = getPrevRecording(i);
+ if (recording.hasValue(stat))
+ {
+ max_val = llmax(max_val, recording.getMax(stat));
+ has_value = true;
+ }
+ }
+
+ return has_value
+ ? max_val
+ : NaN;
+}
+
+// calculates means using aggregates per period
+F64 PeriodicRecording::getPeriodMean( const StatType<EventAccumulator>& stat, S32 num_periods /*= S32_MAX*/ )
+{
+ num_periods = llmin(num_periods, getNumRecordedPeriods());
+
+ F64 mean = 0;
+ S32 valid_period_count = 0;
+
+ for (S32 i = 1; i <= num_periods; i++)
+ {
+ Recording& recording = getPrevRecording(i);
+ if (recording.hasValue(stat))
+ {
+ mean += recording.getMean(stat);
+ valid_period_count++;
+ }
+ }
+
+ return valid_period_count
+ ? mean / (F64)valid_period_count
+ : NaN;
+}
+
+
+F64 PeriodicRecording::getPeriodStandardDeviation( const StatType<EventAccumulator>& stat, S32 num_periods /*= S32_MAX*/ )
+{
+ num_periods = llmin(num_periods, getNumRecordedPeriods());
+
+ F64 period_mean = getPeriodMean(stat, num_periods);
+ F64 sum_of_squares = 0;
+ S32 valid_period_count = 0;
+
+ for (S32 i = 1; i <= num_periods; i++)
+ {
+ Recording& recording = getPrevRecording(i);
+ if (recording.hasValue(stat))
+ {
+ F64 delta = recording.getMean(stat) - period_mean;
+ sum_of_squares += delta * delta;
+ valid_period_count++;
+ }
+ }
+
+ return valid_period_count
+ ? sqrt((F64)sum_of_squares / (F64)valid_period_count)
+ : NaN;
+}
+
+F64 PeriodicRecording::getPeriodMin( const StatType<SampleAccumulator>& stat, S32 num_periods /*= S32_MAX*/ )
+{
+ num_periods = llmin(num_periods, getNumRecordedPeriods());
+
+ bool has_value = false;
+ F64 min_val = std::numeric_limits<F64>::max();
+ for (S32 i = 1; i <= num_periods; i++)
+ {
+ Recording& recording = getPrevRecording(i);
+ if (recording.hasValue(stat))
+ {
+ min_val = llmin(min_val, recording.getMin(stat));
+ has_value = true;
+ }
+ }
+
+ return has_value
+ ? min_val
+ : NaN;
+}
+
+F64 PeriodicRecording::getPeriodMax(const StatType<SampleAccumulator>& stat, S32 num_periods /*= S32_MAX*/)
+{
+ num_periods = llmin(num_periods, getNumRecordedPeriods());
+
+ bool has_value = false;
+ F64 max_val = std::numeric_limits<F64>::min();
+ for (S32 i = 1; i <= num_periods; i++)
+ {
+ Recording& recording = getPrevRecording(i);
+ if (recording.hasValue(stat))
+ {
+ max_val = llmax(max_val, recording.getMax(stat));
+ has_value = true;
+ }
+ }
+
+ return has_value
+ ? max_val
+ : NaN;
+}
+
+
+F64 PeriodicRecording::getPeriodMean( const StatType<SampleAccumulator>& stat, S32 num_periods /*= S32_MAX*/ )
+{
+ num_periods = llmin(num_periods, getNumRecordedPeriods());
+
+ S32 valid_period_count = 0;
+ F64 mean = 0;
+
+ for (S32 i = 1; i <= num_periods; i++)
+ {
+ Recording& recording = getPrevRecording(i);
+ if (recording.hasValue(stat))
+ {
+ mean += recording.getMean(stat);
+ valid_period_count++;
+ }
+ }
+
+ return valid_period_count
+ ? mean / F64(valid_period_count)
+ : NaN;
+}
+
+F64 PeriodicRecording::getPeriodStandardDeviation( const StatType<SampleAccumulator>& stat, S32 num_periods /*= S32_MAX*/ )
+{
+ num_periods = llmin(num_periods, getNumRecordedPeriods());
+
+ F64 period_mean = getPeriodMean(stat, num_periods);
+ S32 valid_period_count = 0;
+ F64 sum_of_squares = 0;
+
+ for (S32 i = 1; i <= num_periods; i++)
+ {
+ Recording& recording = getPrevRecording(i);
+ if (recording.hasValue(stat))
+ {
+ F64 delta = recording.getMean(stat) - period_mean;
+ sum_of_squares += delta * delta;
+ valid_period_count++;
+ }
+ }
+
+ return valid_period_count
+ ? sqrt(sum_of_squares / (F64)valid_period_count)
+ : NaN;
+}
+
+
+F64Kilobytes PeriodicRecording::getPeriodMin( const StatType<MemAccumulator>& stat, S32 num_periods /*= S32_MAX*/ )
+{
+ num_periods = llmin(num_periods, getNumRecordedPeriods());
+
+ F64Kilobytes min_val(std::numeric_limits<F64>::max());
+ for (S32 i = 1; i <= num_periods; i++)
+ {
+ Recording& recording = getPrevRecording(i);
+ min_val = llmin(min_val, recording.getMin(stat));
+ }
+
+ return min_val;
+}
+
+F64Kilobytes PeriodicRecording::getPeriodMin(const MemStatHandle& stat, S32 num_periods)
+{
+ return getPeriodMin(static_cast<const StatType<MemAccumulator>&>(stat), num_periods);
+}
+
+F64Kilobytes PeriodicRecording::getPeriodMax(const StatType<MemAccumulator>& stat, S32 num_periods /*= S32_MAX*/)
+{
+ num_periods = llmin(num_periods, getNumRecordedPeriods());
+
+ F64Kilobytes max_val(0.0);
+ for (S32 i = 1; i <= num_periods; i++)
+ {
+ Recording& recording = getPrevRecording(i);
+ max_val = llmax(max_val, recording.getMax(stat));
+ }
+
+ return max_val;
+}
+
+F64Kilobytes PeriodicRecording::getPeriodMax(const MemStatHandle& stat, S32 num_periods)
+{
+ return getPeriodMax(static_cast<const StatType<MemAccumulator>&>(stat), num_periods);
+}
+
+F64Kilobytes PeriodicRecording::getPeriodMean( const StatType<MemAccumulator>& stat, S32 num_periods /*= S32_MAX*/ )
+{
+ num_periods = llmin(num_periods, getNumRecordedPeriods());
+
+ F64Kilobytes mean(0);
+
+ for (S32 i = 1; i <= num_periods; i++)
+ {
+ Recording& recording = getPrevRecording(i);
+ mean += recording.getMean(stat);
+ }
+
+ return mean / F64(num_periods);
+}
+
+F64Kilobytes PeriodicRecording::getPeriodMean(const MemStatHandle& stat, S32 num_periods)
+{
+ return getPeriodMean(static_cast<const StatType<MemAccumulator>&>(stat), num_periods);
+}
+
+F64Kilobytes PeriodicRecording::getPeriodStandardDeviation( const StatType<MemAccumulator>& stat, S32 num_periods /*= S32_MAX*/ )
+{
+ num_periods = llmin(num_periods, getNumRecordedPeriods());
+
+ F64Kilobytes period_mean = getPeriodMean(stat, num_periods);
+ S32 valid_period_count = 0;
+ F64 sum_of_squares = 0;
+
+ for (S32 i = 1; i <= num_periods; i++)
+ {
+ Recording& recording = getPrevRecording(i);
+ if (recording.hasValue(stat))
+ {
+ F64Kilobytes delta = recording.getMean(stat) - period_mean;
+ sum_of_squares += delta.value() * delta.value();
+ valid_period_count++;
+ }
+ }
+
+ return F64Kilobytes(valid_period_count
+ ? sqrt(sum_of_squares / (F64)valid_period_count)
+ : NaN);
+}
+
+F64Kilobytes PeriodicRecording::getPeriodStandardDeviation(const MemStatHandle& stat, S32 num_periods)
+{
+ return getPeriodStandardDeviation(static_cast<const StatType<MemAccumulator>&>(stat), num_periods);
+}
+
+///////////////////////////////////////////////////////////////////////
+// ExtendableRecording
+///////////////////////////////////////////////////////////////////////
+
+void ExtendableRecording::extend()
+{
+ // push the data back to accepted recording
+ mAcceptedRecording.appendRecording(mPotentialRecording);
+ // flush data, so we can start from scratch
+ mPotentialRecording.reset();
+}
+
+void ExtendableRecording::handleStart()
+{
+ mPotentialRecording.start();
+}
+
+void ExtendableRecording::handleStop()
+{
+ mPotentialRecording.pause();
+}
+
+void ExtendableRecording::handleReset()
+{
+ mAcceptedRecording.reset();
+ mPotentialRecording.reset();
+}
+
+void ExtendableRecording::handleSplitTo(ExtendableRecording& other)
+{
+ mPotentialRecording.splitTo(other.mPotentialRecording);
+}
+
+
+///////////////////////////////////////////////////////////////////////
+// ExtendablePeriodicRecording
+///////////////////////////////////////////////////////////////////////
+
+
+ExtendablePeriodicRecording::ExtendablePeriodicRecording()
+: mAcceptedRecording(0),
+ mPotentialRecording(0)
+{}
+
+void ExtendablePeriodicRecording::extend()
+{
+ // push the data back to accepted recording
+ mAcceptedRecording.appendPeriodicRecording(mPotentialRecording);
+ // flush data, so we can start from scratch
+ mPotentialRecording.reset();
+}
+
+
+void ExtendablePeriodicRecording::handleStart()
+{
+ mPotentialRecording.start();
+}
+
+void ExtendablePeriodicRecording::handleStop()
+{
+ mPotentialRecording.pause();
+}
+
+void ExtendablePeriodicRecording::handleReset()
+{
+ mAcceptedRecording.reset();
+ mPotentialRecording.reset();
+}
+
+void ExtendablePeriodicRecording::handleSplitTo(ExtendablePeriodicRecording& other)
+{
+ mPotentialRecording.splitTo(other.mPotentialRecording);
+}
+
+
+PeriodicRecording& get_frame_recording()
+{
+ static LLThreadLocalPointer<PeriodicRecording> sRecording(new PeriodicRecording(200, PeriodicRecording::STARTED));
+ return *sRecording;
+}
+
+}
+
+void LLStopWatchControlsMixinCommon::start()
+{
+ switch (mPlayState)
+ {
+ case STOPPED:
+ handleReset();
+ handleStart();
+ mPlayState = STARTED;
+ break;
+ case PAUSED:
+ handleStart();
+ mPlayState = STARTED;
+ break;
+ case STARTED:
+ break;
+ default:
+ llassert(false);
+ break;
+ }
+}
+
+void LLStopWatchControlsMixinCommon::stop()
+{
+ switch (mPlayState)
+ {
+ case STOPPED:
+ break;
+ case PAUSED:
+ mPlayState = STOPPED;
+ break;
+ case STARTED:
+ handleStop();
+ mPlayState = STOPPED;
+ break;
+ default:
+ llassert(false);
+ break;
+ }
+}
+
+void LLStopWatchControlsMixinCommon::pause()
+{
+ switch (mPlayState)
+ {
+ case STOPPED:
+ // stay stopped, don't go to pause
+ break;
+ case PAUSED:
+ break;
+ case STARTED:
+ handleStop();
+ mPlayState = PAUSED;
+ break;
+ default:
+ llassert(false);
+ break;
+ }
+}
+
+void LLStopWatchControlsMixinCommon::unpause()
+{
+ switch (mPlayState)
+ {
+ case STOPPED:
+ // stay stopped, don't start
+ break;
+ case PAUSED:
+ handleStart();
+ mPlayState = STARTED;
+ break;
+ case STARTED:
+ break;
+ default:
+ llassert(false);
+ break;
+ }
+}
+
+void LLStopWatchControlsMixinCommon::resume()
+{
+ switch (mPlayState)
+ {
+ case STOPPED:
+ handleStart();
+ mPlayState = STARTED;
+ break;
+ case PAUSED:
+ handleStart();
+ mPlayState = STARTED;
+ break;
+ case STARTED:
+ break;
+ default:
+ llassert(false);
+ break;
+ }
+}
+
+void LLStopWatchControlsMixinCommon::restart()
+{
+ switch (mPlayState)
+ {
+ case STOPPED:
+ handleReset();
+ handleStart();
+ mPlayState = STARTED;
+ break;
+ case PAUSED:
+ handleReset();
+ handleStart();
+ mPlayState = STARTED;
+ break;
+ case STARTED:
+ handleReset();
+ break;
+ default:
+ llassert(false);
+ break;
+ }
+}
+
+void LLStopWatchControlsMixinCommon::reset()
+{
+ handleReset();
+}
+
+void LLStopWatchControlsMixinCommon::setPlayState( EPlayState state )
+{
+ switch(state)
+ {
+ case STOPPED:
+ stop();
+ break;
+ case PAUSED:
+ pause();
+ break;
+ case STARTED:
+ start();
+ break;
+ default:
+ llassert(false);
+ break;
+ }
+
+ mPlayState = state;
+}
diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h
new file mode 100644
index 0000000000..d0b4a842a6
--- /dev/null
+++ b/indra/llcommon/lltracerecording.h
@@ -0,0 +1,670 @@
+/**
+ * @file lltracerecording.h
+ * @brief Sampling object for collecting runtime statistics originating from lltrace.
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2012, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLTRACERECORDING_H
+#define LL_LLTRACERECORDING_H
+
+#include "stdtypes.h"
+#include "llpreprocessor.h"
+
+#include "lltimer.h"
+#include "lltraceaccumulators.h"
+#include "llpointer.h"
+
+class LLStopWatchControlsMixinCommon
+{
+public:
+ virtual ~LLStopWatchControlsMixinCommon() {}
+
+ enum EPlayState
+ {
+ STOPPED,
+ PAUSED,
+ STARTED
+ };
+
+ void start(); // moves to started state, resetting if stopped
+ void stop(); // moves to stopped state
+ void pause(); // moves to paused state, unless stopped
+ void unpause(); // moves to started state if paused
+ void resume(); // moves to started state, without resetting
+ void restart(); // moves to started state, always resetting
+ void reset(); // resets
+
+ bool isStarted() const { return mPlayState == STARTED; }
+ bool isPaused() const { return mPlayState == PAUSED; }
+ bool isStopped() const { return mPlayState == STOPPED; }
+
+ EPlayState getPlayState() const { return mPlayState; }
+ // force play state to specific value by calling appropriate handle* methods
+ void setPlayState(EPlayState state);
+
+protected:
+ LLStopWatchControlsMixinCommon()
+ : mPlayState(STOPPED)
+ {}
+
+private:
+ // override these methods to provide started/stopped semantics
+
+ // activate behavior (without reset)
+ virtual void handleStart() = 0;
+ // deactivate behavior
+ virtual void handleStop() = 0;
+ // clear accumulated state, may be called while started
+ virtual void handleReset() = 0;
+
+ EPlayState mPlayState;
+};
+
+template<typename DERIVED>
+class LLStopWatchControlsMixin
+: public LLStopWatchControlsMixinCommon
+{
+public:
+
+ typedef LLStopWatchControlsMixin<DERIVED> self_t;
+ virtual void splitTo(DERIVED& other)
+ {
+ EPlayState play_state = getPlayState();
+ stop();
+ other.reset();
+
+ handleSplitTo(other);
+
+ other.setPlayState(play_state);
+ }
+
+ virtual void splitFrom(DERIVED& other)
+ {
+ static_cast<self_t&>(other).handleSplitTo(*static_cast<DERIVED*>(this));
+ }
+private:
+ self_t& operator = (const self_t& other)
+ {
+ // don't do anything, derived class must implement logic
+ }
+
+ // atomically stop this object while starting the other
+ // no data can be missed in between stop and start
+ virtual void handleSplitTo(DERIVED& other) {};
+
+};
+
+namespace LLTrace
+{
+ template<typename T>
+ class StatType;
+
+ template<typename T>
+ class CountStatHandle;
+
+ template<typename T>
+ class SampleStatHandle;
+
+ template<typename T>
+ class EventStatHandle;
+
+ class MemStatHandle;
+
+ template<typename T>
+ struct RelatedTypes
+ {
+ typedef F64 fractional_t;
+ typedef T sum_t;
+ };
+
+ template<typename T, typename UNIT_T>
+ struct RelatedTypes<LLUnit<T, UNIT_T> >
+ {
+ typedef LLUnit<typename RelatedTypes<T>::fractional_t, UNIT_T> fractional_t;
+ typedef LLUnit<typename RelatedTypes<T>::sum_t, UNIT_T> sum_t;
+ };
+
+ template<>
+ struct RelatedTypes<bool>
+ {
+ typedef F64 fractional_t;
+ typedef S32 sum_t;
+ };
+
+ class Recording
+ : public LLStopWatchControlsMixin<Recording>
+ {
+ public:
+ Recording(EPlayState state = LLStopWatchControlsMixinCommon::STOPPED);
+
+ Recording(const Recording& other);
+ ~Recording();
+
+ Recording& operator = (const Recording& other);
+
+ // accumulate data from subsequent, non-overlapping recording
+ void appendRecording(Recording& other);
+
+ // grab latest recorded data
+ void update();
+
+ // ensure that buffers are exclusively owned by this recording
+ void makeUnique() { mBuffers.makeUnique(); }
+
+ // Timer accessors
+ bool hasValue(const StatType<TimeBlockAccumulator>& stat);
+ F64Seconds getSum(const StatType<TimeBlockAccumulator>& stat);
+ F64Seconds getSum(const StatType<TimeBlockAccumulator::SelfTimeFacet>& stat);
+ S32 getSum(const StatType<TimeBlockAccumulator::CallCountFacet>& stat);
+
+ F64Seconds getPerSec(const StatType<TimeBlockAccumulator>& stat);
+ F64Seconds getPerSec(const StatType<TimeBlockAccumulator::SelfTimeFacet>& stat);
+ F32 getPerSec(const StatType<TimeBlockAccumulator::CallCountFacet>& stat);
+
+ // Memory accessors
+ bool hasValue(const StatType<MemAccumulator>& stat);
+ F64Kilobytes getMin(const StatType<MemAccumulator>& stat);
+ F64Kilobytes getMean(const StatType<MemAccumulator>& stat);
+ F64Kilobytes getMax(const StatType<MemAccumulator>& stat);
+ F64Kilobytes getStandardDeviation(const StatType<MemAccumulator>& stat);
+ F64Kilobytes getLastValue(const StatType<MemAccumulator>& stat);
+
+ bool hasValue(const StatType<MemAccumulator::AllocationFacet>& stat);
+ F64Kilobytes getSum(const StatType<MemAccumulator::AllocationFacet>& stat);
+ F64Kilobytes getPerSec(const StatType<MemAccumulator::AllocationFacet>& stat);
+ S32 getSampleCount(const StatType<MemAccumulator::AllocationFacet>& stat);
+
+ bool hasValue(const StatType<MemAccumulator::DeallocationFacet>& stat);
+ F64Kilobytes getSum(const StatType<MemAccumulator::DeallocationFacet>& stat);
+ F64Kilobytes getPerSec(const StatType<MemAccumulator::DeallocationFacet>& stat);
+ S32 getSampleCount(const StatType<MemAccumulator::DeallocationFacet>& stat);
+
+ // CountStatHandle accessors
+ bool hasValue(const StatType<CountAccumulator>& stat);
+ F64 getSum(const StatType<CountAccumulator>& stat);
+ template <typename T>
+ typename RelatedTypes<T>::sum_t getSum(const CountStatHandle<T>& stat)
+ {
+ return (typename RelatedTypes<T>::sum_t)getSum(static_cast<const StatType<CountAccumulator>&> (stat));
+ }
+
+ F64 getPerSec(const StatType<CountAccumulator>& stat);
+ template <typename T>
+ typename RelatedTypes<T>::fractional_t getPerSec(const CountStatHandle<T>& stat)
+ {
+ return (typename RelatedTypes<T>::fractional_t)getPerSec(static_cast<const StatType<CountAccumulator>&> (stat));
+ }
+
+ S32 getSampleCount(const StatType<CountAccumulator>& stat);
+
+
+ // SampleStatHandle accessors
+ bool hasValue(const StatType<SampleAccumulator>& stat);
+
+ F64 getMin(const StatType<SampleAccumulator>& stat);
+ template <typename T>
+ T getMin(const SampleStatHandle<T>& stat)
+ {
+ return (T)getMin(static_cast<const StatType<SampleAccumulator>&> (stat));
+ }
+
+ F64 getMax(const StatType<SampleAccumulator>& stat);
+ template <typename T>
+ T getMax(const SampleStatHandle<T>& stat)
+ {
+ return (T)getMax(static_cast<const StatType<SampleAccumulator>&> (stat));
+ }
+
+ F64 getMean(const StatType<SampleAccumulator>& stat);
+ template <typename T>
+ typename RelatedTypes<T>::fractional_t getMean(SampleStatHandle<T>& stat)
+ {
+ return (typename RelatedTypes<T>::fractional_t)getMean(static_cast<const StatType<SampleAccumulator>&> (stat));
+ }
+
+ F64 getStandardDeviation(const StatType<SampleAccumulator>& stat);
+ template <typename T>
+ typename RelatedTypes<T>::fractional_t getStandardDeviation(const SampleStatHandle<T>& stat)
+ {
+ return (typename RelatedTypes<T>::fractional_t)getStandardDeviation(static_cast<const StatType<SampleAccumulator>&> (stat));
+ }
+
+ F64 getLastValue(const StatType<SampleAccumulator>& stat);
+ template <typename T>
+ T getLastValue(const SampleStatHandle<T>& stat)
+ {
+ return (T)getLastValue(static_cast<const StatType<SampleAccumulator>&> (stat));
+ }
+
+ S32 getSampleCount(const StatType<SampleAccumulator>& stat);
+
+ // EventStatHandle accessors
+ bool hasValue(const StatType<EventAccumulator>& stat);
+
+ F64 getSum(const StatType<EventAccumulator>& stat);
+ template <typename T>
+ typename RelatedTypes<T>::sum_t getSum(const EventStatHandle<T>& stat)
+ {
+ return (typename RelatedTypes<T>::sum_t)getSum(static_cast<const StatType<EventAccumulator>&> (stat));
+ }
+
+ F64 getMin(const StatType<EventAccumulator>& stat);
+ template <typename T>
+ T getMin(const EventStatHandle<T>& stat)
+ {
+ return (T)getMin(static_cast<const StatType<EventAccumulator>&> (stat));
+ }
+
+ F64 getMax(const StatType<EventAccumulator>& stat);
+ template <typename T>
+ T getMax(const EventStatHandle<T>& stat)
+ {
+ return (T)getMax(static_cast<const StatType<EventAccumulator>&> (stat));
+ }
+
+ F64 getMean(const StatType<EventAccumulator>& stat);
+ template <typename T>
+ typename RelatedTypes<T>::fractional_t getMean(EventStatHandle<T>& stat)
+ {
+ return (typename RelatedTypes<T>::fractional_t)getMean(static_cast<const StatType<EventAccumulator>&> (stat));
+ }
+
+ F64 getStandardDeviation(const StatType<EventAccumulator>& stat);
+ template <typename T>
+ typename RelatedTypes<T>::fractional_t getStandardDeviation(const EventStatHandle<T>& stat)
+ {
+ return (typename RelatedTypes<T>::fractional_t)getStandardDeviation(static_cast<const StatType<EventAccumulator>&> (stat));
+ }
+
+ F64 getLastValue(const StatType<EventAccumulator>& stat);
+ template <typename T>
+ T getLastValue(const EventStatHandle<T>& stat)
+ {
+ return (T)getLastValue(static_cast<const StatType<EventAccumulator>&> (stat));
+ }
+
+ S32 getSampleCount(const StatType<EventAccumulator>& stat);
+
+ F64Seconds getDuration() const { return mElapsedSeconds; }
+
+ protected:
+ friend class ThreadRecorder;
+
+ // implementation for LLStopWatchControlsMixin
+ /*virtual*/ void handleStart();
+ /*virtual*/ void handleStop();
+ /*virtual*/ void handleReset();
+ /*virtual*/ void handleSplitTo(Recording& other);
+
+ // returns data for current thread
+ class ThreadRecorder* getThreadRecorder();
+
+ LLTimer mSamplingTimer;
+ F64Seconds mElapsedSeconds;
+ LLCopyOnWritePointer<AccumulatorBufferGroup> mBuffers;
+ AccumulatorBufferGroup* mActiveBuffers;
+
+ };
+
+ class LL_COMMON_API PeriodicRecording
+ : public LLStopWatchControlsMixin<PeriodicRecording>
+ {
+ public:
+ PeriodicRecording(S32 num_periods, EPlayState state = STOPPED);
+ ~PeriodicRecording();
+
+ void nextPeriod();
+ S32 getNumRecordedPeriods()
+ {
+ // current period counts if not active
+ return mNumRecordedPeriods + (isStarted() ? 0 : 1);
+ }
+
+ F64Seconds getDuration() const;
+
+ void appendPeriodicRecording(PeriodicRecording& other);
+ void appendRecording(Recording& recording);
+ Recording& getLastRecording();
+ const Recording& getLastRecording() const;
+ Recording& getCurRecording();
+ const Recording& getCurRecording() const;
+ Recording& getPrevRecording(S32 offset);
+ const Recording& getPrevRecording(S32 offset) const;
+ Recording snapshotCurRecording() const;
+
+ template <typename T>
+ S32 getSampleCount(const StatType<T>& stat, S32 num_periods = S32_MAX)
+ {
+ num_periods = llmin(num_periods, getNumRecordedPeriods());
+
+ S32 num_samples = 0;
+ for (S32 i = 1; i <= num_periods; i++)
+ {
+ Recording& recording = getPrevRecording(i);
+ num_samples += recording.getSampleCount(stat);
+ }
+ return num_samples;
+ }
+
+ //
+ // PERIODIC MIN
+ //
+
+ // catch all for stats that have a defined sum
+ template <typename T>
+ typename T::value_t getPeriodMin(const StatType<T>& stat, S32 num_periods = S32_MAX)
+ {
+ num_periods = llmin(num_periods, getNumRecordedPeriods());
+
+ bool has_value = false;
+ typename T::value_t min_val(std::numeric_limits<typename T::value_t>::max());
+ for (S32 i = 1; i <= num_periods; i++)
+ {
+ Recording& recording = getPrevRecording(i);
+ if (recording.hasValue(stat))
+ {
+ min_val = llmin(min_val, recording.getSum(stat));
+ has_value = true;
+ }
+ }
+
+ return has_value
+ ? min_val
+ : T::getDefaultValue();
+ }
+
+ template<typename T>
+ T getPeriodMin(const CountStatHandle<T>& stat, S32 num_periods = S32_MAX)
+ {
+ return T(getPeriodMin(static_cast<const StatType<CountAccumulator>&>(stat), num_periods));
+ }
+
+ F64 getPeriodMin(const StatType<SampleAccumulator>& stat, S32 num_periods = S32_MAX);
+ template<typename T>
+ T getPeriodMin(const SampleStatHandle<T>& stat, S32 num_periods = S32_MAX)
+ {
+ return T(getPeriodMin(static_cast<const StatType<SampleAccumulator>&>(stat), num_periods));
+ }
+
+ F64 getPeriodMin(const StatType<EventAccumulator>& stat, S32 num_periods = S32_MAX);
+ template<typename T>
+ T getPeriodMin(const EventStatHandle<T>& stat, S32 num_periods = S32_MAX)
+ {
+ return T(getPeriodMin(static_cast<const StatType<EventAccumulator>&>(stat), num_periods));
+ }
+
+ F64Kilobytes getPeriodMin(const StatType<MemAccumulator>& stat, S32 num_periods = S32_MAX);
+ F64Kilobytes getPeriodMin(const MemStatHandle& stat, S32 num_periods = S32_MAX);
+
+ template <typename T>
+ typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMinPerSec(const StatType<T>& stat, S32 num_periods = S32_MAX)
+ {
+ num_periods = llmin(num_periods, getNumRecordedPeriods());
+
+ typename RelatedTypes<typename T::value_t>::fractional_t min_val(std::numeric_limits<F64>::max());
+ for (S32 i = 1; i <= num_periods; i++)
+ {
+ Recording& recording = getPrevRecording(i);
+ min_val = llmin(min_val, recording.getPerSec(stat));
+ }
+ return (typename RelatedTypes<typename T::value_t>::fractional_t) min_val;
+ }
+
+ template<typename T>
+ typename RelatedTypes<T>::fractional_t getPeriodMinPerSec(const CountStatHandle<T>& stat, S32 num_periods = S32_MAX)
+ {
+ return typename RelatedTypes<T>::fractional_t(getPeriodMinPerSec(static_cast<const StatType<CountAccumulator>&>(stat), num_periods));
+ }
+
+ //
+ // PERIODIC MAX
+ //
+
+ // catch all for stats that have a defined sum
+ template <typename T>
+ typename T::value_t getPeriodMax(const StatType<T>& stat, S32 num_periods = S32_MAX)
+ {
+ num_periods = llmin(num_periods, getNumRecordedPeriods());
+
+ bool has_value = false;
+ typename T::value_t max_val(std::numeric_limits<typename T::value_t>::min());
+ for (S32 i = 1; i <= num_periods; i++)
+ {
+ Recording& recording = getPrevRecording(i);
+ if (recording.hasValue(stat))
+ {
+ max_val = llmax(max_val, recording.getSum(stat));
+ has_value = true;
+ }
+ }
+
+ return has_value
+ ? max_val
+ : T::getDefaultValue();
+ }
+
+ template<typename T>
+ T getPeriodMax(const CountStatHandle<T>& stat, S32 num_periods = S32_MAX)
+ {
+ return T(getPeriodMax(static_cast<const StatType<CountAccumulator>&>(stat), num_periods));
+ }
+
+ F64 getPeriodMax(const StatType<SampleAccumulator>& stat, S32 num_periods = S32_MAX);
+ template<typename T>
+ T getPeriodMax(const SampleStatHandle<T>& stat, S32 num_periods = S32_MAX)
+ {
+ return T(getPeriodMax(static_cast<const StatType<SampleAccumulator>&>(stat), num_periods));
+ }
+
+ F64 getPeriodMax(const StatType<EventAccumulator>& stat, S32 num_periods = S32_MAX);
+ template<typename T>
+ T getPeriodMax(const EventStatHandle<T>& stat, S32 num_periods = S32_MAX)
+ {
+ return T(getPeriodMax(static_cast<const StatType<EventAccumulator>&>(stat), num_periods));
+ }
+
+ F64Kilobytes getPeriodMax(const StatType<MemAccumulator>& stat, S32 num_periods = S32_MAX);
+ F64Kilobytes getPeriodMax(const MemStatHandle& stat, S32 num_periods = S32_MAX);
+
+ template <typename T>
+ typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMaxPerSec(const StatType<T>& stat, S32 num_periods = S32_MAX)
+ {
+ num_periods = llmin(num_periods, getNumRecordedPeriods());
+
+ F64 max_val = std::numeric_limits<F64>::min();
+ for (S32 i = 1; i <= num_periods; i++)
+ {
+ Recording& recording = getPrevRecording(i);
+ max_val = llmax(max_val, recording.getPerSec(stat));
+ }
+ return (typename RelatedTypes<typename T::value_t>::fractional_t)max_val;
+ }
+
+ template<typename T>
+ typename RelatedTypes<T>::fractional_t getPeriodMaxPerSec(const CountStatHandle<T>& stat, S32 num_periods = S32_MAX)
+ {
+ return typename RelatedTypes<T>::fractional_t(getPeriodMaxPerSec(static_cast<const StatType<CountAccumulator>&>(stat), num_periods));
+ }
+
+ //
+ // PERIODIC MEAN
+ //
+
+ // catch all for stats that have a defined sum
+ template <typename T>
+ typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMean(const StatType<T >& stat, S32 num_periods = S32_MAX)
+ {
+ num_periods = llmin(num_periods, getNumRecordedPeriods());
+
+ typename RelatedTypes<typename T::value_t>::fractional_t mean(0);
+
+ for (S32 i = 1; i <= num_periods; i++)
+ {
+ Recording& recording = getPrevRecording(i);
+ if (recording.getDuration() > (F32Seconds)0.f)
+ {
+ mean += recording.getSum(stat);
+ }
+ }
+ return (num_periods
+ ? typename RelatedTypes<typename T::value_t>::fractional_t(mean / num_periods)
+ : typename RelatedTypes<typename T::value_t>::fractional_t(NaN));
+ }
+
+ template<typename T>
+ typename RelatedTypes<T>::fractional_t getPeriodMean(const CountStatHandle<T>& stat, S32 num_periods = S32_MAX)
+ {
+ return typename RelatedTypes<T>::fractional_t(getPeriodMean(static_cast<const StatType<CountAccumulator>&>(stat), num_periods));
+ }
+ F64 getPeriodMean(const StatType<SampleAccumulator>& stat, S32 num_periods = S32_MAX);
+ template<typename T>
+ typename RelatedTypes<T>::fractional_t getPeriodMean(const SampleStatHandle<T>& stat, S32 num_periods = S32_MAX)
+ {
+ return typename RelatedTypes<T>::fractional_t(getPeriodMean(static_cast<const StatType<SampleAccumulator>&>(stat), num_periods));
+ }
+
+ F64 getPeriodMean(const StatType<EventAccumulator>& stat, S32 num_periods = S32_MAX);
+ template<typename T>
+ typename RelatedTypes<T>::fractional_t getPeriodMean(const EventStatHandle<T>& stat, S32 num_periods = S32_MAX)
+ {
+ return typename RelatedTypes<T>::fractional_t(getPeriodMean(static_cast<const StatType<EventAccumulator>&>(stat), num_periods));
+ }
+
+ F64Kilobytes getPeriodMean(const StatType<MemAccumulator>& stat, S32 num_periods = S32_MAX);
+ F64Kilobytes getPeriodMean(const MemStatHandle& stat, S32 num_periods = S32_MAX);
+
+ template <typename T>
+ typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMeanPerSec(const StatType<T>& stat, S32 num_periods = S32_MAX)
+ {
+ num_periods = llmin(num_periods, getNumRecordedPeriods());
+
+ typename RelatedTypes<typename T::value_t>::fractional_t mean = 0;
+
+ for (S32 i = 1; i <= num_periods; i++)
+ {
+ Recording& recording = getPrevRecording(i);
+ if (recording.getDuration() > (F32Seconds)0.f)
+ {
+ mean += recording.getPerSec(stat);
+ }
+ }
+
+ return (num_periods
+ ? typename RelatedTypes<typename T::value_t>::fractional_t(mean / num_periods)
+ : typename RelatedTypes<typename T::value_t>::fractional_t(NaN));
+ }
+
+ template<typename T>
+ typename RelatedTypes<T>::fractional_t getPeriodMeanPerSec(const CountStatHandle<T>& stat, S32 num_periods = S32_MAX)
+ {
+ return typename RelatedTypes<T>::fractional_t(getPeriodMeanPerSec(static_cast<const StatType<CountAccumulator>&>(stat), num_periods));
+ }
+
+ //
+ // PERIODIC STANDARD DEVIATION
+ //
+
+ F64 getPeriodStandardDeviation(const StatType<SampleAccumulator>& stat, S32 num_periods = S32_MAX);
+
+ template<typename T>
+ typename RelatedTypes<T>::fractional_t getPeriodStandardDeviation(const SampleStatHandle<T>& stat, S32 num_periods = S32_MAX)
+ {
+ return typename RelatedTypes<T>::fractional_t(getPeriodStandardDeviation(static_cast<const StatType<SampleAccumulator>&>(stat), num_periods));
+ }
+
+ F64 getPeriodStandardDeviation(const StatType<EventAccumulator>& stat, S32 num_periods = S32_MAX);
+ template<typename T>
+ typename RelatedTypes<T>::fractional_t getPeriodStandardDeviation(const EventStatHandle<T>& stat, S32 num_periods = S32_MAX)
+ {
+ return typename RelatedTypes<T>::fractional_t(getPeriodStandardDeviation(static_cast<const StatType<EventAccumulator>&>(stat), num_periods));
+ }
+
+ F64Kilobytes getPeriodStandardDeviation(const StatType<MemAccumulator>& stat, S32 num_periods = S32_MAX);
+ F64Kilobytes getPeriodStandardDeviation(const MemStatHandle& stat, S32 num_periods = S32_MAX);
+
+ private:
+ // implementation for LLStopWatchControlsMixin
+ /*virtual*/ void handleStart();
+ /*virtual*/ void handleStop();
+ /*virtual*/ void handleReset();
+ /*virtual*/ void handleSplitTo(PeriodicRecording& other);
+
+ private:
+ std::vector<Recording> mRecordingPeriods;
+ const bool mAutoResize;
+ S32 mCurPeriod;
+ S32 mNumRecordedPeriods;
+ };
+
+ PeriodicRecording& get_frame_recording();
+
+ class ExtendableRecording
+ : public LLStopWatchControlsMixin<ExtendableRecording>
+ {
+ public:
+ void extend();
+
+ Recording& getAcceptedRecording() { return mAcceptedRecording; }
+ const Recording& getAcceptedRecording() const {return mAcceptedRecording;}
+
+ Recording& getPotentialRecording() { return mPotentialRecording; }
+ const Recording& getPotentialRecording() const { return mPotentialRecording;}
+
+ private:
+ // implementation for LLStopWatchControlsMixin
+ /*virtual*/ void handleStart();
+ /*virtual*/ void handleStop();
+ /*virtual*/ void handleReset();
+ /*virtual*/ void handleSplitTo(ExtendableRecording& other);
+
+ private:
+ Recording mAcceptedRecording;
+ Recording mPotentialRecording;
+ };
+
+ class ExtendablePeriodicRecording
+ : public LLStopWatchControlsMixin<ExtendablePeriodicRecording>
+ {
+ public:
+ ExtendablePeriodicRecording();
+ void extend();
+
+ PeriodicRecording& getResults() { return mAcceptedRecording; }
+ const PeriodicRecording& getResults() const {return mAcceptedRecording;}
+
+ void nextPeriod() { mPotentialRecording.nextPeriod(); }
+
+ private:
+ // implementation for LLStopWatchControlsMixin
+ /*virtual*/ void handleStart();
+ /*virtual*/ void handleStop();
+ /*virtual*/ void handleReset();
+ /*virtual*/ void handleSplitTo(ExtendablePeriodicRecording& other);
+
+ private:
+ PeriodicRecording mAcceptedRecording;
+ PeriodicRecording mPotentialRecording;
+ };
+}
+
+#endif // LL_LLTRACERECORDING_H
diff --git a/indra/llcommon/lltracethreadrecorder.cpp b/indra/llcommon/lltracethreadrecorder.cpp
new file mode 100644
index 0000000000..181fc2f058
--- /dev/null
+++ b/indra/llcommon/lltracethreadrecorder.cpp
@@ -0,0 +1,329 @@
+/**
+ * @file lltracethreadrecorder.cpp
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2012, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "linden_common.h"
+
+#include "lltracethreadrecorder.h"
+#include "llfasttimer.h"
+#include "lltrace.h"
+
+namespace LLTrace
+{
+extern MemStatHandle gTraceMemStat;
+
+static ThreadRecorder* sMasterThreadRecorder = NULL;
+
+///////////////////////////////////////////////////////////////////////
+// ThreadRecorder
+///////////////////////////////////////////////////////////////////////
+
+ThreadRecorder::ThreadRecorder()
+: mParentRecorder(NULL)
+{
+ init();
+}
+
+void ThreadRecorder::init()
+{
+#if LL_TRACE_ENABLED
+ LLThreadLocalSingletonPointer<BlockTimerStackRecord>::setInstance(&mBlockTimerStackRecord);
+ //NB: the ordering of initialization in this function is very fragile due to a large number of implicit dependencies
+ set_thread_recorder(this);
+ BlockTimerStatHandle& root_time_block = BlockTimer::getRootTimeBlock();
+
+ BlockTimerStackRecord* timer_stack = LLThreadLocalSingletonPointer<BlockTimerStackRecord>::getInstance();
+ timer_stack->mTimeBlock = &root_time_block;
+ timer_stack->mActiveTimer = NULL;
+
+ mNumTimeBlockTreeNodes = AccumulatorBuffer<TimeBlockAccumulator>::getDefaultBuffer()->size();
+
+ mTimeBlockTreeNodes = new TimeBlockTreeNode[mNumTimeBlockTreeNodes];
+
+ activate(&mThreadRecordingBuffers);
+
+ // initialize time block parent pointers
+ for (BlockTimerStatHandle::instance_tracker_t::instance_iter it = BlockTimerStatHandle::instance_tracker_t::beginInstances(), end_it = BlockTimerStatHandle::instance_tracker_t::endInstances();
+ it != end_it;
+ ++it)
+ {
+ BlockTimerStatHandle& time_block = static_cast<BlockTimerStatHandle&>(*it);
+ TimeBlockTreeNode& tree_node = mTimeBlockTreeNodes[it->getIndex()];
+ tree_node.mBlock = &time_block;
+ tree_node.mParent = &root_time_block;
+
+ it->getCurrentAccumulator().mParent = &root_time_block;
+ }
+
+ mRootTimer = new BlockTimer(root_time_block);
+ timer_stack->mActiveTimer = mRootTimer;
+
+ BlockTimer::getRootTimeBlock().getCurrentAccumulator().mActiveCount = 1;
+
+ claim_alloc(gTraceMemStat, this);
+ claim_alloc(gTraceMemStat, mRootTimer);
+ claim_alloc(gTraceMemStat, sizeof(TimeBlockTreeNode) * mNumTimeBlockTreeNodes);
+#endif
+}
+
+
+ThreadRecorder::ThreadRecorder( ThreadRecorder& parent )
+: mParentRecorder(&parent)
+{
+ init();
+ mParentRecorder->addChildRecorder(this);
+}
+
+
+ThreadRecorder::~ThreadRecorder()
+{
+#if LL_TRACE_ENABLED
+ LLThreadLocalSingletonPointer<BlockTimerStackRecord>::setInstance(NULL);
+
+ disclaim_alloc(gTraceMemStat, this);
+ disclaim_alloc(gTraceMemStat, sizeof(BlockTimer));
+ disclaim_alloc(gTraceMemStat, sizeof(TimeBlockTreeNode) * mNumTimeBlockTreeNodes);
+
+ deactivate(&mThreadRecordingBuffers);
+
+ delete mRootTimer;
+
+ if (!mActiveRecordings.empty())
+ {
+ std::for_each(mActiveRecordings.begin(), mActiveRecordings.end(), DeletePointer());
+ mActiveRecordings.clear();
+ }
+
+ set_thread_recorder(NULL);
+ delete[] mTimeBlockTreeNodes;
+
+ if (mParentRecorder)
+ {
+ mParentRecorder->removeChildRecorder(this);
+ }
+#endif
+}
+
+TimeBlockTreeNode* ThreadRecorder::getTimeBlockTreeNode( S32 index )
+{
+#if LL_TRACE_ENABLED
+ if (0 <= index && index < mNumTimeBlockTreeNodes)
+ {
+ return &mTimeBlockTreeNodes[index];
+ }
+#endif
+ return NULL;
+}
+
+AccumulatorBufferGroup* ThreadRecorder::activate( AccumulatorBufferGroup* recording)
+{
+#if LL_TRACE_ENABLED
+ ActiveRecording* active_recording = new ActiveRecording(recording);
+ if (!mActiveRecordings.empty())
+ {
+ AccumulatorBufferGroup& prev_active_recording = mActiveRecordings.back()->mPartialRecording;
+ prev_active_recording.sync();
+ BlockTimer::updateTimes();
+ prev_active_recording.handOffTo(active_recording->mPartialRecording);
+ }
+ mActiveRecordings.push_back(active_recording);
+
+ mActiveRecordings.back()->mPartialRecording.makeCurrent();
+ return &active_recording->mPartialRecording;
+#else
+ return NULL;
+#endif
+}
+
+ThreadRecorder::active_recording_list_t::iterator ThreadRecorder::bringUpToDate( AccumulatorBufferGroup* recording )
+{
+#if LL_TRACE_ENABLED
+ if (mActiveRecordings.empty()) return mActiveRecordings.end();
+
+ mActiveRecordings.back()->mPartialRecording.sync();
+ BlockTimer::updateTimes();
+
+ active_recording_list_t::reverse_iterator it, end_it;
+ for (it = mActiveRecordings.rbegin(), end_it = mActiveRecordings.rend();
+ it != end_it;
+ ++it)
+ {
+ ActiveRecording* cur_recording = *it;
+
+ active_recording_list_t::reverse_iterator next_it = it;
+ ++next_it;
+
+ // if we have another recording further down in the stack...
+ if (next_it != mActiveRecordings.rend())
+ {
+ // ...push our gathered data down to it
+ (*next_it)->mPartialRecording.append(cur_recording->mPartialRecording);
+ }
+
+ // copy accumulated measurements into result buffer and clear accumulator (mPartialRecording)
+ cur_recording->movePartialToTarget();
+
+ if (cur_recording->mTargetRecording == recording)
+ {
+ // found the recording, so return it
+ break;
+ }
+ }
+
+ if (it == end_it)
+ {
+ LL_WARNS() << "Recording not active on this thread" << LL_ENDL;
+ }
+
+ return (++it).base();
+#else
+ return ThreadRecorder::active_recording_list_t::iterator();
+#endif
+}
+
+void ThreadRecorder::deactivate( AccumulatorBufferGroup* recording )
+{
+#if LL_TRACE_ENABLED
+ active_recording_list_t::iterator recording_it = bringUpToDate(recording);
+ // this method should only be called on a thread where the recorder is active
+ llassert_always(recording_it != mActiveRecordings.end());
+
+ ActiveRecording* recording_to_remove = *recording_it;
+ bool was_current = recording_to_remove->mPartialRecording.isCurrent();
+ llassert(recording_to_remove->mTargetRecording == recording);
+ mActiveRecordings.erase(recording_it);
+ if (was_current)
+ {
+ if (mActiveRecordings.empty())
+ {
+ AccumulatorBufferGroup::clearCurrent();
+ }
+ else
+ {
+ mActiveRecordings.back()->mPartialRecording.makeCurrent();
+ }
+ }
+ delete recording_to_remove;
+#endif
+}
+
+ThreadRecorder::ActiveRecording::ActiveRecording( AccumulatorBufferGroup* target )
+: mTargetRecording(target)
+{}
+
+void ThreadRecorder::ActiveRecording::movePartialToTarget()
+{
+#if LL_TRACE_ENABLED
+ mTargetRecording->append(mPartialRecording);
+ // reset based on self to keep history
+ mPartialRecording.reset(&mPartialRecording);
+#endif
+}
+
+
+// called by child thread
+void ThreadRecorder::addChildRecorder( class ThreadRecorder* child )
+{
+#if LL_TRACE_ENABLED
+ { LLMutexLock lock(&mChildListMutex);
+ mChildThreadRecorders.push_back(child);
+ }
+#endif
+}
+
+// called by child thread
+void ThreadRecorder::removeChildRecorder( class ThreadRecorder* child )
+{
+#if LL_TRACE_ENABLED
+ { LLMutexLock lock(&mChildListMutex);
+ mChildThreadRecorders.remove(child);
+ }
+#endif
+}
+
+void ThreadRecorder::pushToParent()
+{
+#if LL_TRACE_ENABLED
+ { LLMutexLock lock(&mSharedRecordingMutex);
+ LLTrace::get_thread_recorder()->bringUpToDate(&mThreadRecordingBuffers);
+ mSharedRecordingBuffers.append(mThreadRecordingBuffers);
+ mThreadRecordingBuffers.reset();
+ }
+#endif
+}
+
+
+static LLTrace::BlockTimerStatHandle FTM_PULL_TRACE_DATA_FROM_CHILDREN("Pull child thread trace data");
+
+void ThreadRecorder::pullFromChildren()
+{
+#if LL_TRACE_ENABLED
+ LL_RECORD_BLOCK_TIME(FTM_PULL_TRACE_DATA_FROM_CHILDREN);
+ if (mActiveRecordings.empty()) return;
+
+ { LLMutexLock lock(&mChildListMutex);
+
+ AccumulatorBufferGroup& target_recording_buffers = mActiveRecordings.back()->mPartialRecording;
+ target_recording_buffers.sync();
+ for (child_thread_recorder_list_t::iterator it = mChildThreadRecorders.begin(), end_it = mChildThreadRecorders.end();
+ it != end_it;
+ ++it)
+ { LLMutexLock lock(&(*it)->mSharedRecordingMutex);
+
+ target_recording_buffers.merge((*it)->mSharedRecordingBuffers);
+ (*it)->mSharedRecordingBuffers.reset();
+ }
+ }
+#endif
+}
+
+
+void set_master_thread_recorder( ThreadRecorder* recorder )
+{
+ sMasterThreadRecorder = recorder;
+}
+
+
+ThreadRecorder* get_master_thread_recorder()
+{
+ return sMasterThreadRecorder;
+}
+
+LLThreadLocalPointer<ThreadRecorder>& get_thread_recorder_ptr()
+{
+ static LLThreadLocalPointer<ThreadRecorder> s_thread_recorder;
+ return s_thread_recorder;
+}
+
+const LLThreadLocalPointer<ThreadRecorder>& get_thread_recorder()
+{
+ return get_thread_recorder_ptr();
+}
+
+void set_thread_recorder( ThreadRecorder* recorder )
+{
+ get_thread_recorder_ptr() = recorder;
+}
+
+}
diff --git a/indra/llcommon/lltracethreadrecorder.h b/indra/llcommon/lltracethreadrecorder.h
new file mode 100644
index 0000000000..a797c6687e
--- /dev/null
+++ b/indra/llcommon/lltracethreadrecorder.h
@@ -0,0 +1,102 @@
+/**
+ * @file lltrace.h
+ * @brief Runtime statistics accumulation.
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2012, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLTRACETHREADRECORDER_H
+#define LL_LLTRACETHREADRECORDER_H
+
+#include "stdtypes.h"
+#include "llpreprocessor.h"
+
+#include "llmutex.h"
+#include "lltraceaccumulators.h"
+#include "llthreadlocalstorage.h"
+
+namespace LLTrace
+{
+ class LL_COMMON_API ThreadRecorder
+ {
+ protected:
+ struct ActiveRecording;
+ typedef std::vector<ActiveRecording*> active_recording_list_t;
+ public:
+ ThreadRecorder();
+ explicit ThreadRecorder(ThreadRecorder& parent);
+
+ ~ThreadRecorder();
+
+ AccumulatorBufferGroup* activate(AccumulatorBufferGroup* recording);
+ void deactivate(AccumulatorBufferGroup* recording);
+ active_recording_list_t::iterator bringUpToDate(AccumulatorBufferGroup* recording);
+
+ void addChildRecorder(class ThreadRecorder* child);
+ void removeChildRecorder(class ThreadRecorder* child);
+
+ // call this periodically to gather stats data from child threads
+ void pullFromChildren();
+ void pushToParent();
+
+ TimeBlockTreeNode* getTimeBlockTreeNode(S32 index);
+
+ protected:
+ void init();
+
+ protected:
+ struct ActiveRecording
+ {
+ ActiveRecording(AccumulatorBufferGroup* target);
+
+ AccumulatorBufferGroup* mTargetRecording;
+ AccumulatorBufferGroup mPartialRecording;
+
+ void movePartialToTarget();
+ };
+
+ AccumulatorBufferGroup mThreadRecordingBuffers;
+
+ BlockTimerStackRecord mBlockTimerStackRecord;
+ active_recording_list_t mActiveRecordings;
+
+ class BlockTimer* mRootTimer;
+ TimeBlockTreeNode* mTimeBlockTreeNodes;
+ size_t mNumTimeBlockTreeNodes;
+ typedef std::list<class ThreadRecorder*> child_thread_recorder_list_t;
+
+ child_thread_recorder_list_t mChildThreadRecorders; // list of child thread recorders associated with this master
+ LLMutex mChildListMutex; // protects access to child list
+ LLMutex mSharedRecordingMutex;
+ AccumulatorBufferGroup mSharedRecordingBuffers;
+ ThreadRecorder* mParentRecorder;
+
+ };
+
+ const LLThreadLocalPointer<ThreadRecorder>& get_thread_recorder();
+ void set_thread_recorder(ThreadRecorder*);
+
+ void set_master_thread_recorder(ThreadRecorder*);
+ ThreadRecorder* get_master_thread_recorder();
+}
+
+#endif // LL_LLTRACETHREADRECORDER_H
diff --git a/indra/llcommon/lltypeinfolookup.h b/indra/llcommon/lltypeinfolookup.h
deleted file mode 100755
index 0b6862444e..0000000000
--- a/indra/llcommon/lltypeinfolookup.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- * @file lltypeinfolookup.h
- * @author Nat Goodspeed
- * @date 2012-04-08
- * @brief Template data structure like std::map<std::type_info*, T>
- *
- * $LicenseInfo:firstyear=2012&license=viewerlgpl$
- * Copyright (c) 2012, Linden Research, Inc.
- * $/LicenseInfo$
- */
-
-#if ! defined(LL_LLTYPEINFOLOOKUP_H)
-#define LL_LLTYPEINFOLOOKUP_H
-
-#include <boost/unordered_map.hpp>
-#include <boost/functional/hash.hpp>
-#include <boost/optional.hpp>
-#include <functional> // std::binary_function
-#include <typeinfo>
-
-/**
- * The following helper classes are based on the Boost.Unordered documentation:
- * http://www.boost.org/doc/libs/1_45_0/doc/html/unordered/hash_equality.html
- */
-
-/**
- * Compute hash for a string passed as const char*
- */
-struct const_char_star_hash: public std::unary_function<const char*, std::size_t>
-{
- std::size_t operator()(const char* str) const
- {
- std::size_t seed = 0;
- for ( ; *str; ++str)
- {
- boost::hash_combine(seed, *str);
- }
- return seed;
- }
-};
-
-/**
- * Compute equality for strings passed as const char*
- *
- * I (nat) suspect that this is where the default behavior breaks for the
- * const char* values returned from std::type_info::name(). If you compare the
- * two const char* pointer values, as a naive, unspecialized implementation
- * will surely do, they'll compare unequal.
- */
-struct const_char_star_equal: public std::binary_function<const char*, const char*, bool>
-{
- bool operator()(const char* lhs, const char* rhs) const
- {
- return strcmp(lhs, rhs) == 0;
- }
-};
-
-/**
- * LLTypeInfoLookup is specifically designed for use cases for which you might
- * consider std::map<std::type_info*, VALUE>. We have several such data
- * structures in the viewer. The trouble with them is that at least on Linux,
- * you can't rely on always getting the same std::type_info* for a given type:
- * different load modules will produce different std::type_info*.
- * LLTypeInfoLookup contains a workaround to address this issue.
- *
- * The API deliberately diverges from std::map in several respects:
- * * It avoids iterators, not only begin()/end() but also as return values
- * from insert() and find(). This bypasses transform_iterator overhead.
- * * Since we literally use compile-time types as keys, the essential insert()
- * and find() methods accept the key type as a @em template parameter,
- * accepting and returning value_type as a normal runtime value. This is to
- * permit future optimization (e.g. compile-time type hashing) without
- * changing the API.
- */
-template <typename VALUE>
-class LLTypeInfoLookup
-{
- // Use this for our underlying implementation: lookup by
- // std::type_info::name() string. This is one of the rare cases in which I
- // dare use const char* directly, rather than std::string, because I'm
- // sure that every value returned by std::type_info::name() is static.
- // HOWEVER, specify our own hash + equality functors: naively comparing
- // distinct const char* values won't work.
- typedef boost::unordered_map<const char*, VALUE,
- const_char_star_hash, const_char_star_equal> impl_map_type;
-
-public:
- typedef VALUE value_type;
-
- LLTypeInfoLookup() {}
-
- bool empty() const { return mMap.empty(); }
- std::size_t size() const { return mMap.size(); }
-
- template <typename KEY>
- bool insert(const value_type& value)
- {
- // Obtain and store the std::type_info::name() string as the key.
- // Return just the bool from std::map::insert()'s return pair.
- return mMap.insert(typename impl_map_type::value_type(typeid(KEY).name(), value)).second;
- }
-
- template <typename KEY>
- boost::optional<value_type> find() const
- {
- // Use the std::type_info::name() string as the key.
- typename impl_map_type::const_iterator found = mMap.find(typeid(KEY).name());
- if (found == mMap.end())
- return boost::optional<value_type>();
- return found->second;
- }
-
-private:
- impl_map_type mMap;
-};
-
-#endif /* ! defined(LL_LLTYPEINFOLOOKUP_H) */
diff --git a/indra/llcommon/llunits.h b/indra/llcommon/llunits.h
new file mode 100644
index 0000000000..0fcb8281a0
--- /dev/null
+++ b/indra/llcommon/llunits.h
@@ -0,0 +1,129 @@
+/**
+ * @file llunits.h
+ * @brief Unit definitions
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2012, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLUNITTYPE_H
+#define LL_LLUNITTYPE_H
+
+#include "stdtypes.h"
+#include "llunittype.h"
+
+//
+// Unit declarations
+//
+
+namespace LLUnits
+{
+LL_DECLARE_BASE_UNIT(Bytes, "B");
+// technically, these are kibibytes, mibibytes, etc. but we should stick with commonly accepted terminology
+LL_DECLARE_DERIVED_UNIT(Kilobytes, "KB", Bytes, / 1024);
+LL_DECLARE_DERIVED_UNIT(Megabytes, "MB", Kilobytes, / 1024);
+LL_DECLARE_DERIVED_UNIT(Gigabytes, "GB", Megabytes, / 1024);
+}
+
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Bytes);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Kilobytes);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Megabytes);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Gigabytes);
+
+namespace LLUnits
+{
+// technically, these are kibibits, mibibits, etc. but we should stick with commonly accepted terminology
+LL_DECLARE_DERIVED_UNIT(Bits, "b", Bytes, * 8 );
+LL_DECLARE_DERIVED_UNIT(Kilobits, "Kb", Bits, / 1024);
+LL_DECLARE_DERIVED_UNIT(Megabits, "Mb", Kilobits, / 1024);
+LL_DECLARE_DERIVED_UNIT(Gigabits, "Gb", Megabits, / 1024);
+}
+
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Bits);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Kilobits);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Megabits);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Gigabits);
+
+namespace LLUnits
+{
+LL_DECLARE_BASE_UNIT(Seconds, "s");
+LL_DECLARE_DERIVED_UNIT(Minutes, "min", Seconds, / 60);
+LL_DECLARE_DERIVED_UNIT(Hours, "h", Minutes, / 60);
+LL_DECLARE_DERIVED_UNIT(Days, "d", Hours, / 24);
+LL_DECLARE_DERIVED_UNIT(Milliseconds, "ms", Seconds, * 1000);
+LL_DECLARE_DERIVED_UNIT(Microseconds, "\x09\x3cs", Milliseconds, * 1000);
+LL_DECLARE_DERIVED_UNIT(Nanoseconds, "ns", Microseconds, * 1000);
+}
+
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Seconds);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Minutes);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Hours);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Days);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Milliseconds);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Microseconds);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Nanoseconds);
+
+namespace LLUnits
+{
+LL_DECLARE_BASE_UNIT(Meters, "m");
+LL_DECLARE_DERIVED_UNIT(Kilometers, "km", Meters, / 1000);
+LL_DECLARE_DERIVED_UNIT(Centimeters, "cm", Meters, * 100);
+LL_DECLARE_DERIVED_UNIT(Millimeters, "mm", Meters, * 1000);
+}
+
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Meters);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Kilometers);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Centimeters);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Millimeters);
+
+namespace LLUnits
+{
+// rare units
+LL_DECLARE_BASE_UNIT(Hertz, "Hz");
+LL_DECLARE_DERIVED_UNIT(Kilohertz, "KHz", Hertz, / 1000);
+LL_DECLARE_DERIVED_UNIT(Megahertz, "MHz", Kilohertz, / 1000);
+LL_DECLARE_DERIVED_UNIT(Gigahertz, "GHz", Megahertz, / 1000);
+
+LL_DECLARE_BASE_UNIT(Radians, "rad");
+LL_DECLARE_DERIVED_UNIT(Degrees, "deg", Radians, * 57.29578f);
+
+LL_DECLARE_BASE_UNIT(Percent, "%");
+LL_DECLARE_DERIVED_UNIT(Ratio, "x", Percent, / 100);
+
+LL_DECLARE_BASE_UNIT(Triangles, "tris");
+LL_DECLARE_DERIVED_UNIT(Kilotriangles, "ktris", Triangles, / 1000);
+
+} // namespace LLUnits
+
+// rare units
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Hertz);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Kilohertz);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Megahertz);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Gigahertz);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Radians);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Degrees);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Percent);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Ratio);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Triangles);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Kilotriangles);
+
+
+#endif // LL_LLUNITTYPE_H
diff --git a/indra/llcommon/llunittype.h b/indra/llcommon/llunittype.h
new file mode 100644
index 0000000000..0e05ecd683
--- /dev/null
+++ b/indra/llcommon/llunittype.h
@@ -0,0 +1,836 @@
+/**
+ * @file llunit.h
+ * @brief Unit conversion classes
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2012, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_UNITTYPE_H
+#define LL_UNITTYPE_H
+
+#include "stdtypes.h"
+#include "llpreprocessor.h"
+#include "llerror.h"
+
+//lightweight replacement of type traits for simple type equality check
+template<typename S, typename T>
+struct LLIsSameType
+{
+ static const bool value = false;
+};
+
+template<typename T>
+struct LLIsSameType<T, T>
+{
+ static const bool value = true;
+};
+
+// workaround for decltype() not existing and typeof() not working inline in gcc 4.2
+template<typename S, typename T>
+struct LLResultTypeAdd
+{
+ typedef LL_TYPEOF(S() + T()) type_t;
+};
+
+template<typename S, typename T>
+struct LLResultTypeSubtract
+{
+ typedef LL_TYPEOF(S() - T()) type_t;
+};
+
+template<typename S, typename T>
+struct LLResultTypeMultiply
+{
+ typedef LL_TYPEOF(S() * T()) type_t;
+};
+
+template<typename S, typename T>
+struct LLResultTypeDivide
+{
+ typedef LL_TYPEOF(S() / T(1)) type_t;
+};
+
+template<typename S, typename T>
+struct LLResultTypePromote
+{
+ typedef LL_TYPEOF((true) ? S() : T()) type_t;
+};
+
+template<typename STORAGE_TYPE, typename UNITS>
+struct LLUnit
+{
+ typedef LLUnit<STORAGE_TYPE, UNITS> self_t;
+ typedef STORAGE_TYPE storage_t;
+ typedef void is_unit_t;
+
+ // value initialization
+ LL_FORCE_INLINE explicit LLUnit(storage_t value = storage_t())
+ : mValue(value)
+ {}
+
+ // unit initialization and conversion
+ template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
+ LL_FORCE_INLINE LLUnit(LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other)
+ : mValue(convert(other).mValue)
+ {}
+
+ LL_FORCE_INLINE storage_t value() const
+ {
+ return mValue;
+ }
+
+ LL_FORCE_INLINE void value(storage_t value)
+ {
+ mValue = value;
+ }
+
+ template<typename NEW_UNITS>
+ storage_t valueInUnits()
+ {
+ return LLUnit<storage_t, NEW_UNITS>(*this).value();
+ }
+
+ template<typename NEW_UNITS>
+ void valueInUnits(storage_t value)
+ {
+ *this = LLUnit<storage_t, NEW_UNITS>(value);
+ }
+
+ LL_FORCE_INLINE void operator += (self_t other)
+ {
+ mValue += convert(other).mValue;
+ }
+
+ LL_FORCE_INLINE void operator -= (self_t other)
+ {
+ mValue -= convert(other).mValue;
+ }
+
+ LL_FORCE_INLINE void operator *= (storage_t multiplicand)
+ {
+ mValue *= multiplicand;
+ }
+
+ LL_FORCE_INLINE void operator *= (self_t multiplicand)
+ {
+ // spurious use of dependent type to stop gcc from triggering the static assertion before instantiating the template
+ LL_BAD_TEMPLATE_INSTANTIATION(STORAGE_TYPE, "Multiplication of unit types not supported.");
+ }
+
+ LL_FORCE_INLINE void operator /= (storage_t divisor)
+ {
+ mValue /= divisor;
+ }
+
+ void operator /= (self_t divisor)
+ {
+ // spurious use of dependent type to stop gcc from triggering the static assertion before instantiating the template
+ LL_BAD_TEMPLATE_INSTANTIATION(STORAGE_TYPE, "Illegal in-place division of unit types.");
+ }
+
+ template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
+ LL_FORCE_INLINE bool operator == (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
+ {
+ return mValue == convert(other).value();
+ }
+
+ template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
+ LL_FORCE_INLINE bool operator != (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
+ {
+ return mValue != convert(other).value();
+ }
+
+ template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
+ LL_FORCE_INLINE bool operator < (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
+ {
+ return mValue < convert(other).value();
+ }
+
+ template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
+ LL_FORCE_INLINE bool operator <= (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
+ {
+ return mValue <= convert(other).value();
+ }
+
+ template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
+ LL_FORCE_INLINE bool operator > (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
+ {
+ return mValue > convert(other).value();
+ }
+
+ template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
+ LL_FORCE_INLINE bool operator >= (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
+ {
+ return mValue >= convert(other).value();
+ }
+
+ LL_FORCE_INLINE static self_t convert(self_t v)
+ {
+ return v;
+ }
+
+ template<typename FROM_STORAGE_TYPE>
+ LL_FORCE_INLINE static self_t convert(LLUnit<FROM_STORAGE_TYPE, UNITS> v)
+ {
+ self_t result;
+ result.mValue = (STORAGE_TYPE)v.value();
+ return result;
+ }
+
+ template<typename FROM_UNITS>
+ LL_FORCE_INLINE static self_t convert(LLUnit<STORAGE_TYPE, FROM_UNITS> v)
+ {
+ self_t result;
+ STORAGE_TYPE divisor = ll_convert_units(v, result);
+ result.mValue /= divisor;
+ return result;
+ }
+
+ template<typename FROM_STORAGE_TYPE, typename FROM_UNITS>
+ LL_FORCE_INLINE static self_t convert(LLUnit<FROM_STORAGE_TYPE, FROM_UNITS> v)
+ {
+ typedef typename LLResultTypePromote<FROM_STORAGE_TYPE, STORAGE_TYPE>::type_t result_storage_t;
+ LLUnit<result_storage_t, UNITS> result;
+ result_storage_t divisor = ll_convert_units(v, result);
+ result.value(result.value() / divisor);
+ return self_t(result.value());
+ }
+
+protected:
+ storage_t mValue;
+};
+
+template<typename STORAGE_TYPE, typename UNITS>
+std::ostream& operator <<(std::ostream& s, const LLUnit<STORAGE_TYPE, UNITS>& unit)
+{
+ s << unit.value() << UNITS::getUnitLabel();
+ return s;
+}
+
+template<typename STORAGE_TYPE, typename UNITS>
+std::istream& operator >>(std::istream& s, LLUnit<STORAGE_TYPE, UNITS>& unit)
+{
+ STORAGE_TYPE val;
+ s >> val;
+ unit.value(val);
+ return s;
+}
+
+template<typename STORAGE_TYPE, typename UNITS>
+struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
+{
+ typedef LLUnitImplicit<STORAGE_TYPE, UNITS> self_t;
+ typedef typename LLUnit<STORAGE_TYPE, UNITS>::storage_t storage_t;
+ typedef LLUnit<STORAGE_TYPE, UNITS> base_t;
+
+ LL_FORCE_INLINE LLUnitImplicit(storage_t value = storage_t())
+ : base_t(value)
+ {}
+
+ template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
+ LL_FORCE_INLINE LLUnitImplicit(LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other)
+ : base_t(other)
+ {}
+
+ // unlike LLUnit, LLUnitImplicit is *implicitly* convertable to a POD value (F32, S32, etc)
+ // this allows for interoperability with legacy code
+ LL_FORCE_INLINE operator storage_t() const
+ {
+ return base_t::value();
+ }
+
+ using base_t::operator +=;
+ LL_FORCE_INLINE void operator += (storage_t value)
+ {
+ base_t::mValue += value;
+ }
+
+ // this overload exists to explicitly catch use of another implicit unit
+ // without ambiguity between conversion to storage_t vs conversion to base_t
+ template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
+ LL_FORCE_INLINE void operator += (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other)
+ {
+ base_t::mValue += convert(other).value();
+ }
+
+ using base_t::operator -=;
+ LL_FORCE_INLINE void operator -= (storage_t value)
+ {
+ base_t::mValue -= value;
+ }
+
+ // this overload exists to explicitly catch use of another implicit unit
+ // without ambiguity between conversion to storage_t vs conversion to base_t
+ template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
+ LL_FORCE_INLINE void operator -= (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other)
+ {
+ base_t::mValue -= convert(other).value();
+ }
+
+ template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
+ LL_FORCE_INLINE bool operator == (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
+ {
+ return base_t::mValue == convert(other).value();
+ }
+
+ template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
+ LL_FORCE_INLINE bool operator == (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
+ {
+ return base_t::mValue == convert(other).value();
+ }
+
+ template<typename STORAGE_T>
+ LL_FORCE_INLINE bool operator == (STORAGE_T other) const
+ {
+ return base_t::mValue == other;
+ }
+
+ template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
+ LL_FORCE_INLINE bool operator != (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
+ {
+ return base_t::mValue != convert(other).value();
+ }
+
+ template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
+ LL_FORCE_INLINE bool operator != (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
+ {
+ return base_t::mValue != convert(other).value();
+ }
+
+ template<typename STORAGE_T>
+ LL_FORCE_INLINE bool operator != (STORAGE_T other) const
+ {
+ return base_t::mValue != other;
+ }
+
+ template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
+ LL_FORCE_INLINE bool operator < (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
+ {
+ return base_t::mValue < convert(other).value();
+ }
+
+ template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
+ LL_FORCE_INLINE bool operator < (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
+ {
+ return base_t::mValue < convert(other).value();
+ }
+
+ template<typename STORAGE_T>
+ LL_FORCE_INLINE bool operator < (STORAGE_T other) const
+ {
+ return base_t::mValue < other;
+ }
+
+ template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
+ LL_FORCE_INLINE bool operator <= (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
+ {
+ return base_t::mValue <= convert(other).value();
+ }
+
+ template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
+ LL_FORCE_INLINE bool operator <= (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
+ {
+ return base_t::mValue <= convert(other).value();
+ }
+
+ template<typename STORAGE_T>
+ LL_FORCE_INLINE bool operator <= (STORAGE_T other) const
+ {
+ return base_t::mValue <= other;
+ }
+
+ template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
+ LL_FORCE_INLINE bool operator > (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
+ {
+ return base_t::mValue > convert(other).value();
+ }
+
+ template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
+ LL_FORCE_INLINE bool operator > (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
+ {
+ return base_t::mValue > convert(other).value();
+ }
+
+ template<typename STORAGE_T>
+ LL_FORCE_INLINE bool operator > (STORAGE_T other) const
+ {
+ return base_t::mValue > other;
+ }
+
+ template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
+ LL_FORCE_INLINE bool operator >= (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
+ {
+ return base_t::mValue >= convert(other).value();
+ }
+
+ template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
+ LL_FORCE_INLINE bool operator >= (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
+ {
+ return base_t::mValue >= convert(other).value();
+ }
+
+ template<typename STORAGE_T>
+ LL_FORCE_INLINE bool operator >= (STORAGE_T other) const
+ {
+ return base_t::mValue >= other;
+ }
+};
+
+template<typename STORAGE_TYPE, typename UNITS>
+std::ostream& operator <<(std::ostream& s, const LLUnitImplicit<STORAGE_TYPE, UNITS>& unit)
+{
+ s << unit.value() << UNITS::getUnitLabel();
+ return s;
+}
+
+template<typename STORAGE_TYPE, typename UNITS>
+std::istream& operator >>(std::istream& s, LLUnitImplicit<STORAGE_TYPE, UNITS>& unit)
+{
+ STORAGE_TYPE val;
+ s >> val;
+ unit = val;
+ return s;
+}
+
+template<typename S1, typename T1, typename S2, typename T2>
+LL_FORCE_INLINE S2 ll_convert_units(LLUnit<S1, T1> in, LLUnit<S2, T2>& out)
+{
+ S2 divisor(1);
+
+ LL_STATIC_ASSERT((LLIsSameType<T1, T2>::value
+ || !LLIsSameType<T1, typename T1::base_unit_t>::value
+ || !LLIsSameType<T2, typename T2::base_unit_t>::value),
+ "conversion requires compatible units");
+
+ if (LLIsSameType<T1, T2>::value)
+ {
+ // T1 and T2 same type, just assign
+ out.value((S2)in.value());
+ }
+ else if (T1::sLevel > T2::sLevel)
+ {
+ // reduce T1
+ LLUnit<S2, typename T1::base_unit_t> new_in;
+ divisor *= (S2)ll_convert_units(in, new_in);
+ divisor *= (S2)ll_convert_units(new_in, out);
+ }
+ else
+ {
+ // reduce T2
+ LLUnit<S2, typename T2::base_unit_t> new_out;
+ divisor *= (S2)ll_convert_units(in, new_out);
+ divisor *= (S2)ll_convert_units(new_out, out);
+ }
+ return divisor;
+}
+
+template<typename T>
+struct LLStorageType
+{
+ typedef T type_t;
+};
+
+template<typename STORAGE_TYPE, typename UNITS>
+struct LLStorageType<LLUnit<STORAGE_TYPE, UNITS> >
+{
+ typedef STORAGE_TYPE type_t;
+};
+
+// all of these operators need to perform type promotion on the storage type of the units, so they
+// cannot be expressed as operations on identical types with implicit unit conversion
+// e.g. typeof(S32Bytes(x) + F32Megabytes(y)) <==> F32Bytes
+
+//
+// operator +
+//
+template<typename STORAGE_TYPE1, typename UNITS1, typename STORAGE_TYPE2, typename UNITS2>
+LL_FORCE_INLINE LLUnit<typename LLResultTypeAdd<STORAGE_TYPE1, STORAGE_TYPE2>::type_t, UNITS1> operator + (LLUnit<STORAGE_TYPE1, UNITS1> first, LLUnit<STORAGE_TYPE2, UNITS2> second)
+{
+ LLUnit<typename LLResultTypeAdd<STORAGE_TYPE1, STORAGE_TYPE2>::type_t, UNITS1> result(first);
+ result += second;
+ return result;
+}
+
+template<typename STORAGE_TYPE, typename UNITS, typename UNITLESS>
+LLUnit<STORAGE_TYPE, UNITS> operator + (LLUnit<STORAGE_TYPE, UNITS> first, UNITLESS second)
+{
+ LL_BAD_TEMPLATE_INSTANTIATION(STORAGE_TYPE, "operator + requires compatible unit types");
+ return LLUnit<STORAGE_TYPE, UNITS>(0);
+}
+
+template<typename STORAGE_TYPE, typename UNITS, typename UNITLESS>
+LLUnit<STORAGE_TYPE, UNITS> operator + (UNITLESS first, LLUnit<STORAGE_TYPE, UNITS> second)
+{
+ LL_BAD_TEMPLATE_INSTANTIATION(STORAGE_TYPE, "operator + requires compatible unit types");
+ return LLUnit<STORAGE_TYPE, UNITS>(0);
+}
+
+template<typename STORAGE_TYPE1, typename UNITS1, typename STORAGE_TYPE2, typename UNITS2>
+LL_FORCE_INLINE LLUnitImplicit<typename LLResultTypeAdd<STORAGE_TYPE1, STORAGE_TYPE2>::type_t, UNITS1> operator + (LLUnitImplicit<STORAGE_TYPE1, UNITS1> first, LLUnitImplicit<STORAGE_TYPE2, UNITS2> second)
+{
+ LLUnitImplicit<typename LLResultTypeAdd<STORAGE_TYPE1, STORAGE_TYPE2>::type_t, UNITS1> result(first);
+ result += second;
+ return result;
+}
+
+template<typename STORAGE_TYPE1, typename UNITS1, typename STORAGE_TYPE2, typename UNITS2>
+LL_FORCE_INLINE LLUnitImplicit<typename LLResultTypeAdd<STORAGE_TYPE1, STORAGE_TYPE2>::type_t, UNITS1> operator + (LLUnit<STORAGE_TYPE1, UNITS1> first, LLUnitImplicit<STORAGE_TYPE2, UNITS2> second)
+{
+ LLUnitImplicit<typename LLResultTypeAdd<STORAGE_TYPE1, STORAGE_TYPE2>::type_t, UNITS1> result(first);
+ result += second;
+ return result;
+}
+
+template<typename STORAGE_TYPE1, typename UNITS1, typename STORAGE_TYPE2, typename UNITS2>
+LL_FORCE_INLINE LLUnitImplicit<typename LLResultTypeAdd<STORAGE_TYPE1, STORAGE_TYPE2>::type_t, UNITS1> operator + (LLUnitImplicit<STORAGE_TYPE1, UNITS1> first, LLUnit<STORAGE_TYPE2, UNITS2> second)
+{
+ LLUnitImplicit<typename LLResultTypeAdd<STORAGE_TYPE1, STORAGE_TYPE2>::type_t, UNITS1> result(first);
+ result += LLUnitImplicit<STORAGE_TYPE1, UNITS1>(second);
+ return result;
+}
+
+template<typename STORAGE_TYPE, typename UNITS, typename UNITLESS_TYPE>
+LL_FORCE_INLINE LLUnitImplicit<typename LLResultTypeAdd<STORAGE_TYPE, typename LLStorageType<UNITLESS_TYPE>::type_t>::type_t, UNITS> operator + (LLUnitImplicit<STORAGE_TYPE, UNITS> first, UNITLESS_TYPE second)
+{
+ LLUnitImplicit<typename LLResultTypeAdd<STORAGE_TYPE, typename LLStorageType<UNITLESS_TYPE>::type_t>::type_t, UNITS> result(first);
+ result += second;
+ return result;
+}
+
+template<typename STORAGE_TYPE, typename UNITS, typename UNITLESS_TYPE>
+LL_FORCE_INLINE LLUnitImplicit<typename LLResultTypeAdd<typename LLStorageType<UNITLESS_TYPE>::type_t, STORAGE_TYPE>::
+ type_t, UNITS> operator + (UNITLESS_TYPE first, LLUnitImplicit<STORAGE_TYPE, UNITS> second)
+{
+ LLUnitImplicit<typename LLResultTypeAdd<typename LLStorageType<UNITLESS_TYPE>::type_t, STORAGE_TYPE>::type_t, UNITS> result(first);
+ result += second;
+ return result;
+}
+
+//
+// operator -
+//
+template<typename STORAGE_TYPE1, typename UNITS1, typename STORAGE_TYPE2, typename UNITS2>
+LL_FORCE_INLINE LLUnit<typename LLResultTypeSubtract<STORAGE_TYPE1, STORAGE_TYPE2>::type_t, UNITS1> operator - (LLUnit<STORAGE_TYPE1, UNITS1> first, LLUnit<STORAGE_TYPE2, UNITS2> second)
+{
+ LLUnit<typename LLResultTypeSubtract<STORAGE_TYPE1, STORAGE_TYPE2>::type_t, UNITS1> result(first);
+ result -= second;
+ return result;
+}
+
+template<typename STORAGE_TYPE, typename UNITS, typename UNITLESS>
+LLUnit<STORAGE_TYPE, UNITS> operator - (LLUnit<STORAGE_TYPE, UNITS> first, UNITLESS second)
+{
+ LL_BAD_TEMPLATE_INSTANTIATION(STORAGE_TYPE, "operator - requires compatible unit types");
+ return LLUnit<STORAGE_TYPE, UNITS>(0);
+}
+
+template<typename STORAGE_TYPE, typename UNITS, typename UNITLESS>
+LLUnit<STORAGE_TYPE, UNITS> operator - (UNITLESS first, LLUnit<STORAGE_TYPE, UNITS> second)
+{
+ LL_BAD_TEMPLATE_INSTANTIATION(STORAGE_TYPE, "operator - requires compatible unit types");
+ return LLUnit<STORAGE_TYPE, UNITS>(0);
+}
+
+template<typename STORAGE_TYPE1, typename UNITS1, typename STORAGE_TYPE2, typename UNITS2>
+LL_FORCE_INLINE LLUnitImplicit<typename LLResultTypeSubtract<STORAGE_TYPE1, STORAGE_TYPE2>::type_t, UNITS1> operator - (LLUnitImplicit<STORAGE_TYPE1, UNITS1> first, LLUnitImplicit<STORAGE_TYPE2, UNITS2> second)
+{
+ LLUnitImplicit<typename LLResultTypeSubtract<STORAGE_TYPE1, STORAGE_TYPE2>::type_t, UNITS1> result(first);
+ result -= second;
+ return result;
+}
+
+template<typename STORAGE_TYPE1, typename UNITS1, typename STORAGE_TYPE2, typename UNITS2>
+LL_FORCE_INLINE LLUnitImplicit<typename LLResultTypeSubtract<STORAGE_TYPE1, STORAGE_TYPE2>::type_t, UNITS1> operator - (LLUnit<STORAGE_TYPE1, UNITS1> first, LLUnitImplicit<STORAGE_TYPE2, UNITS2> second)
+{
+ LLUnitImplicit<typename LLResultTypeSubtract<STORAGE_TYPE1, STORAGE_TYPE2>::type_t, UNITS1> result(first);
+ result -= second;
+ return result;
+}
+
+template<typename STORAGE_TYPE1, typename UNITS1, typename STORAGE_TYPE2, typename UNITS2>
+LL_FORCE_INLINE LLUnitImplicit<typename LLResultTypeSubtract<STORAGE_TYPE1, STORAGE_TYPE2>::type_t, UNITS1> operator - (LLUnitImplicit<STORAGE_TYPE1, UNITS1> first, LLUnit<STORAGE_TYPE2, UNITS2> second)
+{
+ LLUnitImplicit<typename LLResultTypeSubtract<STORAGE_TYPE1, STORAGE_TYPE2>::type_t, UNITS1> result(first);
+ result -= LLUnitImplicit<STORAGE_TYPE1, UNITS1>(second);
+ return result;
+}
+
+template<typename STORAGE_TYPE, typename UNITS, typename UNITLESS_TYPE>
+LL_FORCE_INLINE LLUnitImplicit<typename LLResultTypeSubtract<STORAGE_TYPE, typename LLStorageType<UNITLESS_TYPE>::type_t>::type_t, UNITS> operator - (LLUnitImplicit<STORAGE_TYPE, UNITS> first, UNITLESS_TYPE second)
+{
+ LLUnitImplicit<typename LLResultTypeSubtract<STORAGE_TYPE, typename LLStorageType<UNITLESS_TYPE>::type_t>::type_t, UNITS> result(first);
+ result -= second;
+ return result;
+}
+
+template<typename STORAGE_TYPE, typename UNITS, typename UNITLESS_TYPE>
+LL_FORCE_INLINE LLUnitImplicit<typename LLResultTypeSubtract<typename LLStorageType<UNITLESS_TYPE>::type_t, STORAGE_TYPE>::type_t, UNITS> operator - (UNITLESS_TYPE first, LLUnitImplicit<STORAGE_TYPE, UNITS> second)
+{
+ LLUnitImplicit<typename LLResultTypeSubtract<typename LLStorageType<UNITLESS_TYPE>::type_t, STORAGE_TYPE>::type_t, UNITS> result(first);
+ result -= second;
+ return result;
+}
+
+//
+// operator *
+//
+template<typename STORAGE_TYPE1, typename UNITS1, typename STORAGE_TYPE2, typename UNITS2>
+LLUnit<STORAGE_TYPE1, UNITS1> operator * (LLUnit<STORAGE_TYPE1, UNITS1>, LLUnit<STORAGE_TYPE2, UNITS2>)
+{
+ // spurious use of dependent type to stop gcc from triggering the static assertion before instantiating the template
+ LL_BAD_TEMPLATE_INSTANTIATION(STORAGE_TYPE1, "multiplication of unit types results in new unit type - not supported.");
+ return LLUnit<STORAGE_TYPE1, UNITS1>();
+}
+
+template<typename STORAGE_TYPE, typename UNITS, typename UNITLESS_TYPE>
+LL_FORCE_INLINE LLUnit<typename LLResultTypeMultiply<STORAGE_TYPE, typename LLStorageType<UNITLESS_TYPE>::type_t>::type_t, UNITS> operator * (LLUnit<STORAGE_TYPE, UNITS> first, UNITLESS_TYPE second)
+{
+ return LLUnit<typename LLResultTypeMultiply<STORAGE_TYPE, typename LLStorageType<UNITLESS_TYPE>::type_t>::type_t, UNITS>(first.value() * second);
+}
+
+template<typename STORAGE_TYPE, typename UNITS, typename UNITLESS_TYPE>
+LL_FORCE_INLINE LLUnit<typename LLResultTypeMultiply<typename LLStorageType<UNITLESS_TYPE>::type_t, STORAGE_TYPE>::type_t, UNITS> operator * (UNITLESS_TYPE first, LLUnit<STORAGE_TYPE, UNITS> second)
+{
+ return LLUnit<typename LLResultTypeMultiply<typename LLStorageType<UNITLESS_TYPE>::type_t, STORAGE_TYPE>::type_t, UNITS>(first * second.value());
+}
+
+template<typename STORAGE_TYPE1, typename UNITS1, typename STORAGE_TYPE2, typename UNITS2>
+LLUnitImplicit<STORAGE_TYPE1, UNITS1> operator * (LLUnitImplicit<STORAGE_TYPE1, UNITS1>, LLUnitImplicit<STORAGE_TYPE2, UNITS2>)
+{
+ // spurious use of dependent type to stop gcc from triggering the static assertion before instantiating the template
+ LL_BAD_TEMPLATE_INSTANTIATION(STORAGE_TYPE1, "multiplication of unit types results in new unit type - not supported.");
+ return LLUnitImplicit<STORAGE_TYPE1, UNITS1>();
+}
+
+template<typename STORAGE_TYPE, typename UNITS, typename UNITLESS_TYPE>
+LL_FORCE_INLINE LLUnitImplicit<typename LLResultTypeMultiply<STORAGE_TYPE, typename LLStorageType<UNITLESS_TYPE>::type_t>::type_t, UNITS> operator * (LLUnitImplicit<STORAGE_TYPE, UNITS> first, UNITLESS_TYPE second)
+{
+ return LLUnitImplicit<typename LLResultTypeMultiply<STORAGE_TYPE, UNITLESS_TYPE>::type_t, UNITS>(first.value() * second);
+}
+
+template<typename STORAGE_TYPE, typename UNITS, typename UNITLESS_TYPE>
+LL_FORCE_INLINE LLUnitImplicit<typename LLResultTypeMultiply<typename LLStorageType<UNITLESS_TYPE>::type_t, STORAGE_TYPE>::type_t, UNITS> operator * (UNITLESS_TYPE first, LLUnitImplicit<STORAGE_TYPE, UNITS> second)
+{
+ return LLUnitImplicit<typename LLResultTypeMultiply<typename LLStorageType<UNITLESS_TYPE>::type_t, STORAGE_TYPE>::type_t, UNITS>(first * second.value());
+}
+
+
+//
+// operator /
+//
+
+template<typename STORAGE_TYPE, typename UNITS, typename UNITLESS_TYPE>
+LL_FORCE_INLINE LLUnit<typename LLResultTypeDivide<STORAGE_TYPE, typename LLStorageType<UNITLESS_TYPE>::type_t>::type_t, UNITS> operator / (LLUnit<STORAGE_TYPE, UNITS> first, UNITLESS_TYPE second)
+{
+ return LLUnit<typename LLResultTypeDivide<STORAGE_TYPE, typename LLStorageType<UNITLESS_TYPE>::type_t>::type_t, UNITS>(first.value() / second);
+}
+
+template<typename STORAGE_TYPE1, typename UNITS1, typename STORAGE_TYPE2, typename UNITS2>
+LL_FORCE_INLINE typename LLResultTypeDivide<STORAGE_TYPE1, STORAGE_TYPE2>::type_t operator / (LLUnit<STORAGE_TYPE1, UNITS1> first, LLUnit<STORAGE_TYPE2, UNITS2> second)
+{
+ return first.value() / first.convert(second).value();
+}
+
+template<typename STORAGE_TYPE, typename UNITS, typename UNITLESS_TYPE>
+LL_FORCE_INLINE LLUnitImplicit<typename LLResultTypeDivide<STORAGE_TYPE, typename LLStorageType<UNITLESS_TYPE>::type_t>::type_t, UNITS> operator / (LLUnitImplicit<STORAGE_TYPE, UNITS> first, UNITLESS_TYPE second)
+{
+ return LLUnitImplicit<typename LLResultTypeDivide<STORAGE_TYPE, typename LLStorageType<UNITLESS_TYPE>::type_t>::type_t, UNITS>(first.value() / second);
+}
+
+template<typename STORAGE_TYPE1, typename UNITS1, typename STORAGE_TYPE2, typename UNITS2>
+LL_FORCE_INLINE typename LLResultTypeDivide<STORAGE_TYPE1, STORAGE_TYPE2>::type_t operator / (LLUnitImplicit<STORAGE_TYPE1, UNITS1> first, LLUnitImplicit<STORAGE_TYPE2, UNITS2> second)
+{
+ return (typename LLResultTypeDivide<STORAGE_TYPE1, STORAGE_TYPE2>::type_t)(first.value() / first.convert(second).value());
+}
+
+template<typename STORAGE_TYPE1, typename UNITS1, typename STORAGE_TYPE2, typename UNITS2>
+LL_FORCE_INLINE typename LLResultTypeDivide<STORAGE_TYPE1, STORAGE_TYPE2>::type_t operator / (LLUnit<STORAGE_TYPE1, UNITS1> first, LLUnitImplicit<STORAGE_TYPE2, UNITS2> second)
+{
+ return (typename LLResultTypeDivide<STORAGE_TYPE1, STORAGE_TYPE2>::type_t)(first.value() / first.convert(second).value());
+}
+
+template<typename STORAGE_TYPE1, typename UNITS1, typename STORAGE_TYPE2, typename UNITS2>
+LL_FORCE_INLINE typename LLResultTypeDivide<STORAGE_TYPE1, STORAGE_TYPE2>::type_t operator / (LLUnitImplicit<STORAGE_TYPE1, UNITS1> first, LLUnit<STORAGE_TYPE2, UNITS2> second)
+{
+ return (typename LLResultTypeDivide<STORAGE_TYPE1, STORAGE_TYPE2>::type_t)(first.value() / first.convert(second).value());
+}
+
+template<typename T>
+struct LLGetUnitLabel
+{
+ static const char* getUnitLabel() { return ""; }
+};
+
+template<typename T, typename STORAGE_T>
+struct LLGetUnitLabel<LLUnit<STORAGE_T, T> >
+{
+ static const char* getUnitLabel() { return T::getUnitLabel(); }
+};
+
+template<typename T>
+struct LLUnitLinearOps
+{
+ typedef LLUnitLinearOps<T> self_t;
+
+ LLUnitLinearOps(T val)
+ : mValue(val),
+ mDivisor(1)
+ {}
+
+ template<typename OTHER_T>
+ self_t operator * (OTHER_T other)
+ {
+ return mValue * other;
+ }
+
+ template<typename OTHER_T>
+ self_t operator / (OTHER_T other)
+ {
+ mDivisor *= other;
+ return *this;
+ }
+
+ template<typename OTHER_T>
+ self_t operator + (OTHER_T other)
+ {
+ mValue += other * mDivisor;
+ return *this;
+ }
+
+ template<typename OTHER_T>
+ self_t operator - (OTHER_T other)
+ {
+ mValue -= other * mDivisor;
+ return *this;
+ }
+
+ T mValue;
+ T mDivisor;
+};
+
+template<typename T>
+struct LLUnitInverseLinearOps
+{
+ typedef LLUnitInverseLinearOps<T> self_t;
+
+ LLUnitInverseLinearOps(T val)
+ : mValue(val),
+ mDivisor(1),
+ mMultiplicand(1)
+ {}
+
+ template<typename OTHER_T>
+ self_t operator * (OTHER_T other)
+ {
+ mDivisor *= other;
+ return *this;
+ }
+
+ template<typename OTHER_T>
+ self_t operator / (OTHER_T other)
+ {
+ mValue *= other;
+ mMultiplicand *= other;
+ return *this;
+ }
+
+ template<typename OTHER_T>
+ self_t operator + (OTHER_T other)
+ {
+ mValue -= other * mMultiplicand;
+ return *this;
+ }
+
+ template<typename OTHER_T>
+ self_t operator - (OTHER_T other)
+ {
+ mValue += other * mMultiplicand;
+ return *this;
+ }
+
+ T mValue;
+ T mDivisor;
+ T mMultiplicand;
+};
+
+#define LL_DECLARE_BASE_UNIT(base_unit_name, unit_label) \
+struct base_unit_name \
+{ \
+ static const int sLevel = 0; \
+ typedef base_unit_name base_unit_t; \
+ static const char* getUnitLabel() { return unit_label; } \
+ template<typename T> \
+ static LLUnit<T, base_unit_name> fromValue(T value) { return LLUnit<T, base_unit_name>(value); } \
+ template<typename STORAGE_T, typename UNIT_T> \
+ static LLUnit<STORAGE_T, base_unit_name> fromValue(LLUnit<STORAGE_T, UNIT_T> value) \
+ { return LLUnit<STORAGE_T, base_unit_name>(value); } \
+}
+
+
+#define LL_DECLARE_DERIVED_UNIT(unit_name, unit_label, base_unit_name, conversion_operation) \
+struct unit_name \
+{ \
+ static const int sLevel = base_unit_name::sLevel + 1; \
+ typedef base_unit_name base_unit_t; \
+ static const char* getUnitLabel() { return unit_label; } \
+ template<typename T> \
+ static LLUnit<T, unit_name> fromValue(T value) { return LLUnit<T, unit_name>(value); } \
+ template<typename STORAGE_T, typename UNIT_T> \
+ static LLUnit<STORAGE_T, unit_name> fromValue(LLUnit<STORAGE_T, UNIT_T> value) \
+ { return LLUnit<STORAGE_T, unit_name>(value); } \
+}; \
+ \
+template<typename S1, typename S2> \
+LL_FORCE_INLINE S2 ll_convert_units(LLUnit<S1, unit_name> in, LLUnit<S2, base_unit_name>& out) \
+{ \
+ typedef typename LLResultTypePromote<S1, S2>::type_t result_storage_t; \
+ LLUnitInverseLinearOps<result_storage_t> result = \
+ LLUnitInverseLinearOps<result_storage_t>(in.value()) conversion_operation; \
+ out = LLUnit<S2, base_unit_name>((S2)result.mValue); \
+ return result.mDivisor; \
+} \
+ \
+template<typename S1, typename S2> \
+LL_FORCE_INLINE S2 ll_convert_units(LLUnit<S1, base_unit_name> in, LLUnit<S2, unit_name>& out) \
+{ \
+ typedef typename LLResultTypePromote<S1, S2>::type_t result_storage_t; \
+ LLUnitLinearOps<result_storage_t> result = \
+ LLUnitLinearOps<result_storage_t>(in.value()) conversion_operation; \
+ out = LLUnit<S2, unit_name>((S2)result.mValue); \
+ return result.mDivisor; \
+}
+
+#define LL_DECLARE_UNIT_TYPEDEFS(ns, unit_name) \
+ typedef LLUnit<F32, ns::unit_name> F32##unit_name; \
+ typedef LLUnitImplicit<F32, ns::unit_name> F32##unit_name##Implicit;\
+ typedef LLUnit<F64, ns::unit_name> F64##unit_name; \
+ typedef LLUnitImplicit<F64, ns::unit_name> F64##unit_name##Implicit;\
+ typedef LLUnit<S32, ns::unit_name> S32##unit_name; \
+ typedef LLUnitImplicit<S32, ns::unit_name> S32##unit_name##Implicit;\
+ typedef LLUnit<S64, ns::unit_name> S64##unit_name; \
+ typedef LLUnitImplicit<S64, ns::unit_name> S64##unit_name##Implicit;\
+ typedef LLUnit<U32, ns::unit_name> U32##unit_name; \
+ typedef LLUnitImplicit<U32, ns::unit_name> U32##unit_name##Implicit;\
+ typedef LLUnit<U64, ns::unit_name> U64##unit_name; \
+ typedef LLUnitImplicit<U64, ns::unit_name> U64##unit_name##Implicit
+
+#endif //LL_UNITTYPE_H
diff --git a/indra/llcommon/lluri.cpp b/indra/llcommon/lluri.cpp
index 37f5b3d6a3..9f12d49244 100755
--- a/indra/llcommon/lluri.cpp
+++ b/indra/llcommon/lluri.cpp
@@ -359,7 +359,7 @@ LLURI LLURI::buildHTTP(const std::string& prefix,
it != path.endArray();
++it)
{
- lldebugs << "PATH: inserting " << it->asString() << llendl;
+ LL_DEBUGS() << "PATH: inserting " << it->asString() << LL_ENDL;
result.mEscapedPath += "/" + escapePathComponent(it->asString());
}
}
@@ -399,8 +399,8 @@ LLURI LLURI::buildHTTP(const std::string& prefix,
}
else
{
- llwarns << "Valid path arguments to buildHTTP are array, string, or undef, you passed type"
- << path.type() << llendl;
+ LL_WARNS() << "Valid path arguments to buildHTTP are array, string, or undef, you passed type"
+ << path.type() << LL_ENDL;
}
result.mEscapedOpaque = "//" + result.mEscapedAuthority +
result.mEscapedPath;
@@ -584,7 +584,7 @@ LLSD LLURI::queryMap() const
// static
LLSD LLURI::queryMap(std::string escaped_query_string)
{
- lldebugs << "LLURI::queryMap query params: " << escaped_query_string << llendl;
+ LL_DEBUGS() << "LLURI::queryMap query params: " << escaped_query_string << LL_ENDL;
LLSD result = LLSD::emptyArray();
while(!escaped_query_string.empty())
@@ -610,12 +610,12 @@ LLSD LLURI::queryMap(std::string escaped_query_string)
{
std::string key = unescape(tuple.substr(0,key_end));
std::string value = unescape(tuple.substr(key_end+1));
- lldebugs << "inserting key " << key << " value " << value << llendl;
+ LL_DEBUGS() << "inserting key " << key << " value " << value << LL_ENDL;
result[key] = value;
}
else
{
- lldebugs << "inserting key " << unescape(tuple) << " value true" << llendl;
+ LL_DEBUGS() << "inserting key " << unescape(tuple) << " value true" << LL_ENDL;
result[unescape(tuple)] = true;
}
}
diff --git a/indra/llcommon/lluuid.cpp b/indra/llcommon/lluuid.cpp
index 0aaa50d231..e3671047b4 100755
--- a/indra/llcommon/lluuid.cpp
+++ b/indra/llcommon/lluuid.cpp
@@ -27,9 +27,7 @@
// We can't use WIN32_LEAN_AND_MEAN here, needs lots of includes.
#if LL_WINDOWS
-#undef WIN32_LEAN_AND_MEAN
-#include <winsock2.h>
-#include <windows.h>
+#include "llwin32headers.h"
// ugh, this is ugly. We need to straighten out our linking for this library
#pragma comment(lib, "IPHLPAPI.lib")
#include <iphlpapi.h>
@@ -234,7 +232,7 @@ BOOL LLUUID::set(const std::string& in_string, BOOL emit)
{
if(emit)
{
- llwarns << "Warning! Using broken UUID string format" << llendl;
+ LL_WARNS() << "Warning! Using broken UUID string format" << LL_ENDL;
}
broken_format = TRUE;
}
@@ -244,7 +242,7 @@ BOOL LLUUID::set(const std::string& in_string, BOOL emit)
if(emit)
{
//don't spam the logs because a resident can't spell.
- llwarns << "Bad UUID string: " << in_string << llendl;
+ LL_WARNS() << "Bad UUID string: " << in_string << LL_ENDL;
}
setNull();
return FALSE;
@@ -283,7 +281,7 @@ BOOL LLUUID::set(const std::string& in_string, BOOL emit)
{
if(emit)
{
- llwarns << "Invalid UUID string character" << llendl;
+ LL_WARNS() << "Invalid UUID string character" << LL_ENDL;
}
setNull();
return FALSE;
@@ -308,7 +306,7 @@ BOOL LLUUID::set(const std::string& in_string, BOOL emit)
{
if(emit)
{
- llwarns << "Invalid UUID string character" << llendl;
+ LL_WARNS() << "Invalid UUID string character" << LL_ENDL;
}
setNull();
return FALSE;
diff --git a/indra/llcommon/lluuid.h b/indra/llcommon/lluuid.h
index 7889828c85..dd8660a3c8 100755
--- a/indra/llcommon/lluuid.h
+++ b/indra/llcommon/lluuid.h
@@ -28,6 +28,7 @@
#include <iostream>
#include <set>
+#include <vector>
#include "stdtypes.h"
#include "llpreprocessor.h"
@@ -131,10 +132,14 @@ public:
};
typedef std::vector<LLUUID> uuid_vec_t;
-
-
-// Helper structure for ordering lluuids in stl containers.
-// eg: std::map<LLUUID, LLWidget*, lluuid_less> widget_map;
+typedef std::set<LLUUID> uuid_set_t;
+
+// Helper structure for ordering lluuids in stl containers. eg:
+// std::map<LLUUID, LLWidget*, lluuid_less> widget_map;
+//
+// (isn't this the default behavior anyway? I think we could
+// everywhere replace these with uuid_set_t, but someone should
+// verify.)
struct lluuid_less
{
bool operator()(const LLUUID& lhs, const LLUUID& rhs) const
@@ -144,7 +149,6 @@ struct lluuid_less
};
typedef std::set<LLUUID, lluuid_less> uuid_list_t;
-
/*
* Sub-classes for keeping transaction IDs and asset IDs
* straight.
diff --git a/indra/llcommon/lluuidhashmap.h b/indra/llcommon/lluuidhashmap.h
deleted file mode 100755
index e294670030..0000000000
--- a/indra/llcommon/lluuidhashmap.h
+++ /dev/null
@@ -1,583 +0,0 @@
-/**
- * @file lluuidhashmap.h
- * @brief A uuid based hash map.
- *
- * $LicenseInfo:firstyear=2003&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLUUIDHASHMAP_H
-#define LL_LLUUIDHASHMAP_H
-
-#include "stdtypes.h"
-#include "llerror.h"
-#include "lluuid.h"
-
-// UUID hash map
-
- /*
- LLUUIDHashMap<uuid_pair, 32> foo(test_equals);
- LLUUIDHashMapIter<uuid_pair, 32> bar(&foo);
-
- LLDynamicArray<LLUUID> source_ids;
- const S32 COUNT = 100000;
- S32 q;
- for (q = 0; q < COUNT; q++)
- {
- llinfos << "Creating" << llendl;
- LLUUID id;
- id.generate();
- //llinfos << q << ":" << id << llendl;
- uuid_pair pair;
- pair.mUUID = id;
- pair.mValue = q;
- foo.set(id, pair);
- source_ids.put(id);
- //ms_sleep(1);
- }
-
- uuid_pair cur;
- llinfos << "Iterating" << llendl;
- for (cur = bar.first(); !bar.done(); cur = bar.next())
- {
- if (source_ids[cur.mValue] != cur.mUUID)
- {
- llerrs << "Incorrect value iterated!" << llendl;
- }
- //llinfos << cur.mValue << ":" << cur.mUUID << llendl;
- //ms_sleep(1);
- }
-
- llinfos << "Finding" << llendl;
- for (q = 0; q < COUNT; q++)
- {
- cur = foo.get(source_ids[q]);
- if (source_ids[cur.mValue] != cur.mUUID)
- {
- llerrs << "Incorrect value found!" << llendl;
- }
- //llinfos << res.mValue << ":" << res.mUUID << llendl;
- //ms_sleep(1);
- }
-
- llinfos << "Removing" << llendl;
- for (q = 0; q < COUNT/2; q++)
- {
- if (!foo.remove(source_ids[q]))
- {
- llerrs << "Remove failed!" << llendl;
- }
- //ms_sleep(1);
- }
-
- llinfos << "Iterating" << llendl;
- for (cur = bar.first(); !bar.done(); cur = bar.next())
- {
- if (source_ids[cur.mValue] != cur.mUUID)
- {
- llerrs << "Incorrect value found!" << llendl;
- }
- //llinfos << cur.mValue << ":" << cur.mUUID << llendl;
- //ms_sleep(1);
- }
- llinfos << "Done with UUID map test" << llendl;
-
- return 0;
- */
-
-
-//
-// LLUUIDHashNode
-//
-
-template <class DATA, int SIZE>
-class LLUUIDHashNode
-{
-public:
- LLUUIDHashNode();
-
-public:
- S32 mCount;
- U8 mKey[SIZE];
- DATA mData[SIZE];
- LLUUIDHashNode<DATA, SIZE> *mNextNodep;
-};
-
-
-//
-// LLUUIDHashNode implementation
-//
-template <class DATA, int SIZE>
-LLUUIDHashNode<DATA, SIZE>::LLUUIDHashNode()
-{
- mCount = 0;
- mNextNodep = NULL;
-}
-
-
-template <class DATA_TYPE, int SIZE>
-class LLUUIDHashMap
-{
-public:
- // basic constructor including sorter
- LLUUIDHashMap(BOOL (*equals)(const LLUUID &uuid, const DATA_TYPE &data),
- const DATA_TYPE &null_data);
- ~LLUUIDHashMap();
-
- inline DATA_TYPE &get(const LLUUID &uuid);
- inline BOOL check(const LLUUID &uuid) const;
- inline DATA_TYPE &set(const LLUUID &uuid, const DATA_TYPE &type);
- inline BOOL remove(const LLUUID &uuid);
- void removeAll();
-
- inline S32 getLength() const; // Warning, NOT O(1!)
-public:
- BOOL (*mEquals)(const LLUUID &uuid, const DATA_TYPE &data);
- LLUUIDHashNode<DATA_TYPE, SIZE> mNodes[256];
-
- S32 mIterCount;
-protected:
- DATA_TYPE mNull;
-};
-
-
-//
-// LLUUIDHashMap implementation
-//
-
-template <class DATA_TYPE, int SIZE>
-LLUUIDHashMap<DATA_TYPE, SIZE>::LLUUIDHashMap(BOOL (*equals)(const LLUUID &uuid, const DATA_TYPE &data),
- const DATA_TYPE &null_data)
-: mEquals(equals),
- mIterCount(0),
- mNull(null_data)
-{ }
-
-template <class DATA_TYPE, int SIZE>
-LLUUIDHashMap<DATA_TYPE, SIZE>::~LLUUIDHashMap()
-{
- removeAll();
-}
-
-template <class DATA_TYPE, int SIZE>
-void LLUUIDHashMap<DATA_TYPE, SIZE>::removeAll()
-{
- S32 bin;
- for (bin = 0; bin < 256; bin++)
- {
- LLUUIDHashNode<DATA_TYPE, SIZE>* nodep = &mNodes[bin];
-
- BOOL first = TRUE;
- while (nodep)
- {
- S32 i;
- const S32 count = nodep->mCount;
-
- // Iterate through all members of this node
- for (i = 0; i < count; i++)
- {
- nodep->mData[i] = mNull;
- }
-
- nodep->mCount = 0;
- // Done with all objects in this node, go to the next.
-
- LLUUIDHashNode<DATA_TYPE, SIZE>* curp = nodep;
- nodep = nodep->mNextNodep;
-
- // Delete the node if it's not the first node
- if (first)
- {
- first = FALSE;
- curp->mNextNodep = NULL;
- }
- else
- {
- delete curp;
- }
- }
- }
-}
-
-template <class DATA_TYPE, int SIZE>
-inline S32 LLUUIDHashMap<DATA_TYPE, SIZE>::getLength() const
-{
- S32 count = 0;
- S32 bin;
- for (bin = 0; bin < 256; bin++)
- {
- LLUUIDHashNode<DATA_TYPE, SIZE>* nodep = (LLUUIDHashNode<DATA_TYPE, SIZE>*) &mNodes[bin];
- while (nodep)
- {
- count += nodep->mCount;
- nodep = nodep->mNextNodep;
- }
- }
- return count;
-}
-
-template <class DATA_TYPE, int SIZE>
-inline DATA_TYPE &LLUUIDHashMap<DATA_TYPE, SIZE>::get(const LLUUID &uuid)
-{
- LLUUIDHashNode<DATA_TYPE, SIZE>* nodep = &mNodes[uuid.mData[0]];
-
- // Grab the second byte of the UUID, which is the key for the node data
- const S32 second_byte = uuid.mData[1];
- while (nodep)
- {
- S32 i;
- const S32 count = nodep->mCount;
-
- // Iterate through all members of this node
- for (i = 0; i < count; i++)
- {
- if ((nodep->mKey[i] == second_byte) && mEquals(uuid, nodep->mData[i]))
- {
- // The second byte matched, and our equality test passed.
- // We found it.
- return nodep->mData[i];
- }
- }
-
- // Done with all objects in this node, go to the next.
- nodep = nodep->mNextNodep;
- }
- return mNull;
-}
-
-
-template <class DATA_TYPE, int SIZE>
-inline BOOL LLUUIDHashMap<DATA_TYPE, SIZE>::check(const LLUUID &uuid) const
-{
- const LLUUIDHashNode<DATA_TYPE, SIZE>* nodep = &mNodes[uuid.mData[0]];
-
- // Grab the second byte of the UUID, which is the key for the node data
- const S32 second_byte = uuid.mData[1];
- while (nodep)
- {
- S32 i;
- const S32 count = nodep->mCount;
-
- // Iterate through all members of this node
- for (i = 0; i < count; i++)
- {
- if ((nodep->mKey[i] == second_byte) && mEquals(uuid, nodep->mData[i]))
- {
- // The second byte matched, and our equality test passed.
- // We found it.
- return TRUE;
- }
- }
-
- // Done with all objects in this node, go to the next.
- nodep = nodep->mNextNodep;
- }
-
- // Didn't find anything
- return FALSE;
-}
-
-
-template <class DATA_TYPE, int SIZE>
-inline DATA_TYPE &LLUUIDHashMap<DATA_TYPE, SIZE>::set(const LLUUID &uuid, const DATA_TYPE &data)
-{
- // Set is just like a normal find, except that if we find a match
- // we replace it with the input value.
- // If we don't find a match, we append to the end of the list.
-
- LLUUIDHashNode<DATA_TYPE, SIZE>* nodep = &mNodes[uuid.mData[0]];
-
- const S32 second_byte = uuid.mData[1];
- while (1)
- {
- const S32 count = nodep->mCount;
-
- S32 i;
- for (i = 0; i < count; i++)
- {
- if ((nodep->mKey[i] == second_byte) && mEquals(uuid, nodep->mData[i]))
- {
- // We found a match for this key, replace the data with
- // the incoming data.
- nodep->mData[i] = data;
- return nodep->mData[i];
- }
- }
- if (!nodep->mNextNodep)
- {
- // We've iterated through all of the keys without finding a match
- if (i < SIZE)
- {
- // There's still some space on this node, append
- // the key and data to it.
- nodep->mKey[i] = second_byte;
- nodep->mData[i] = data;
- nodep->mCount++;
-
- return nodep->mData[i];
- }
- else
- {
- // This node is full, append a new node to the end.
- nodep->mNextNodep = new LLUUIDHashNode<DATA_TYPE, SIZE>;
- nodep->mNextNodep->mKey[0] = second_byte;
- nodep->mNextNodep->mData[0] = data;
- nodep->mNextNodep->mCount = 1;
-
- return nodep->mNextNodep->mData[0];
- }
- }
-
- // No match on this node, go to the next
- nodep = nodep->mNextNodep;
- }
-}
-
-
-template <class DATA_TYPE, int SIZE>
-inline BOOL LLUUIDHashMap<DATA_TYPE, SIZE>::remove(const LLUUID &uuid)
-{
- if (mIterCount)
- {
- // We don't allow remove when we're iterating, it's bad karma!
- llerrs << "Attempted remove while an outstanding iterator in LLUUIDHashMap!" << llendl;
- }
- // Remove is the trickiest operation.
- // What we want to do is swap the last element of the last
- // node if we find the one that we want to remove, but we have
- // to deal with deleting the node from the tail if it's empty, but
- // NOT if it's the only node left.
-
- LLUUIDHashNode<DATA_TYPE, SIZE> *nodep = &mNodes[uuid.mData[0]];
-
- // Not empty, we need to search through the nodes
- const S32 second_byte = uuid.mData[1];
-
- // A modification of the standard search algorithm.
- while (nodep)
- {
- const S32 count = nodep->mCount;
-
- S32 i;
- for (i = 0; i < count; i++)
- {
- if ((nodep->mKey[i] == second_byte) && mEquals(uuid, nodep->mData[i]))
- {
- // We found the node that we want to remove.
- // Find the last (and next-to-last) node, and the index of the last
- // element. We could conceviably start from the node we're on,
- // but that makes it more complicated, this is easier.
-
- LLUUIDHashNode<DATA_TYPE, SIZE> *prevp = &mNodes[uuid.mData[0]];
- LLUUIDHashNode<DATA_TYPE, SIZE> *lastp = prevp;
-
- // Find the last and next-to-last
- while (lastp->mNextNodep)
- {
- prevp = lastp;
- lastp = lastp->mNextNodep;
- }
-
- // First, swap in the last to the current location.
- nodep->mKey[i] = lastp->mKey[lastp->mCount - 1];
- nodep->mData[i] = lastp->mData[lastp->mCount - 1];
-
- // Now, we delete the entry
- lastp->mCount--;
- lastp->mData[lastp->mCount] = mNull;
-
- if (!lastp->mCount)
- {
- // We deleted the last element!
- if (lastp != &mNodes[uuid.mData[0]])
- {
- // Only blitz the node if it's not the head
- // Set the previous node to point to NULL, then
- // blitz the empty last node
- prevp->mNextNodep = NULL;
- delete lastp;
- }
- }
- return TRUE;
- }
- }
-
- // Iterate to the next node, we've scanned all the entries in this one.
- nodep = nodep->mNextNodep;
- }
- return FALSE;
-}
-
-
-//
-// LLUUIDHashMapIter
-//
-
-template <class DATA_TYPE, int SIZE>
-class LLUUIDHashMapIter
-{
-public:
- LLUUIDHashMapIter(LLUUIDHashMap<DATA_TYPE, SIZE> *hash_mapp);
- ~LLUUIDHashMapIter();
-
-
- inline void reset();
- inline void first();
- inline void next();
- inline BOOL done() const;
-
- DATA_TYPE& operator*() const
- {
- return mCurHashNodep->mData[mCurHashNodeKey];
- }
- DATA_TYPE* operator->() const
- {
- return &(operator*());
- }
-
-protected:
- LLUUIDHashMap<DATA_TYPE, SIZE> *mHashMapp;
- LLUUIDHashNode<DATA_TYPE, SIZE> *mCurHashNodep;
-
- S32 mCurHashMapNodeNum;
- S32 mCurHashNodeKey;
-
- DATA_TYPE mNull;
-};
-
-
-//
-// LLUUIDHashMapIter Implementation
-//
-template <class DATA_TYPE, int SIZE>
-LLUUIDHashMapIter<DATA_TYPE, SIZE>::LLUUIDHashMapIter(LLUUIDHashMap<DATA_TYPE, SIZE> *hash_mapp)
-{
- mHashMapp = hash_mapp;
- mCurHashNodep = NULL;
- mCurHashMapNodeNum = 0;
- mCurHashNodeKey = 0;
-}
-
-template <class DATA_TYPE, int SIZE>
-LLUUIDHashMapIter<DATA_TYPE, SIZE>::~LLUUIDHashMapIter()
-{
- reset();
-}
-
-template <class DATA_TYPE, int SIZE>
-inline void LLUUIDHashMapIter<DATA_TYPE, SIZE>::reset()
-{
- if (mCurHashNodep)
- {
- // We're partway through an iteration, we can clean up now
- mHashMapp->mIterCount--;
- mCurHashNodep = NULL;
- }
-}
-
-template <class DATA_TYPE, int SIZE>
-inline void LLUUIDHashMapIter<DATA_TYPE, SIZE>::first()
-{
- // Iterate through until we find the first non-empty node;
- S32 i;
- for (i = 0; i < 256; i++)
- {
- if (mHashMapp->mNodes[i].mCount)
- {
- if (!mCurHashNodep)
- {
- // Increment, since it's no longer safe for us to do a remove
- mHashMapp->mIterCount++;
- }
-
- mCurHashNodep = &mHashMapp->mNodes[i];
- mCurHashMapNodeNum = i;
- mCurHashNodeKey = 0;
- //return mCurHashNodep->mData[0];
- return;
- }
- }
-
- // Completely empty!
- mCurHashNodep = NULL;
- //return mNull;
- return;
-}
-
-template <class DATA_TYPE, int SIZE>
-inline BOOL LLUUIDHashMapIter<DATA_TYPE, SIZE>::done() const
-{
- return mCurHashNodep ? FALSE : TRUE;
-}
-
-template <class DATA_TYPE, int SIZE>
-inline void LLUUIDHashMapIter<DATA_TYPE, SIZE>::next()
-{
- // No current entry, this iterator is done
- if (!mCurHashNodep)
- {
- //return mNull;
- return;
- }
-
- // Go to the next element
- mCurHashNodeKey++;
- if (mCurHashNodeKey < mCurHashNodep->mCount)
- {
- // We're not done with this node, return the current element
- //return mCurHashNodep->mData[mCurHashNodeKey];
- return;
- }
-
- // Done with this node, move to the next
- mCurHashNodep = mCurHashNodep->mNextNodep;
- if (mCurHashNodep)
- {
- // Return the first element
- mCurHashNodeKey = 0;
- //return mCurHashNodep->mData[0];
- return;
- }
-
- // Find the next non-empty node (keyed on the first byte)
- mCurHashMapNodeNum++;
-
- S32 i;
- for (i = mCurHashMapNodeNum; i < 256; i++)
- {
- if (mHashMapp->mNodes[i].mCount)
- {
- // We found one that wasn't empty
- mCurHashNodep = &mHashMapp->mNodes[i];
- mCurHashMapNodeNum = i;
- mCurHashNodeKey = 0;
- //return mCurHashNodep->mData[0];
- return;
- }
- }
-
- // OK, we're done, nothing else to iterate
- mCurHashNodep = NULL;
- mHashMapp->mIterCount--; // Decrement since we're safe to do removes now
- //return mNull;
-}
-
-#endif // LL_LLUUIDHASHMAP_H
diff --git a/indra/llcommon/llversionserver.h b/indra/llcommon/llwin32headers.h
index ef68a0eaf5..8cfa40ada8 100755..100644
--- a/indra/llcommon/llversionserver.h
+++ b/indra/llcommon/llwin32headers.h
@@ -1,8 +1,8 @@
/**
- * @file llversionserver.h
- * @brief
+ * @file llwin32headers.h
+ * @brief sanitized include of windows header files
*
- * $LicenseInfo:firstyear=2002&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
@@ -24,15 +24,19 @@
* $/LicenseInfo$
*/
-#ifndef LL_LLVERSIONSERVER_H
-#define LL_LLVERSIONSERVER_H
-
-const S32 LL_VERSION_MAJOR = 2;
-const S32 LL_VERSION_MINOR = 1;
-const S32 LL_VERSION_PATCH = 0;
-const S32 LL_VERSION_BUILD = 264760;
-
-const char * const LL_CHANNEL = "Second Life Server";
+#ifndef LL_LLWINDOWS_H
+#define LL_LLWINDOWS_H
+#ifdef LL_WINDOWS
+#ifndef NOMINMAX
+#define NOMINMAX
+#endif
+#undef WIN32_LEAN_AND_MEAN
+#include <winsock2.h>
+#include <windows.h>
+// reset to default, which is lean
+#define WIN32_LEAN_AND_MEAN
+#undef NOMINMAX
+#endif
#endif
diff --git a/indra/llcommon/lldarrayptr.h b/indra/llcommon/llwin32headerslean.h
index c9a0b204d1..314e7a85d1 100755..100644
--- a/indra/llcommon/lldarrayptr.h
+++ b/indra/llcommon/llwin32headerslean.h
@@ -1,6 +1,6 @@
/**
- * @file lldarrayptr.h
- * @brief Wrapped std::vector for backward compatibility.
+ * @file llwin32headerslean.h
+ * @brief sanitized include of windows header files
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
@@ -23,14 +23,18 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-#ifndef LL_LLDARRAYPTR_H
-#define LL_LLDARRAYPTR_H
-#include "lldarray.h"
+#ifndef LL_LLWINDOWS_H
+#define LL_LLWINDOWS_H
-template <class Type, int BlockSize = 32>
-class LLDynamicArrayPtr : public LLDynamicArray<Type, BlockSize>
-{
-};
+#ifdef LL_WINDOWS
+#ifndef NOMINMAX
+#define NOMINMAX
+#endif
+#define WIN32_LEAN_AND_MEAN
+#include <winsock2.h>
+#include <windows.h>
+#undef NOMINMAX
+#endif
-#endif // LL_LLDARRAYPTR_H
+#endif
diff --git a/indra/llcommon/llworkerthread.cpp b/indra/llcommon/llworkerthread.cpp
index 3d05a30ac2..4c197dc1d6 100755
--- a/indra/llcommon/llworkerthread.cpp
+++ b/indra/llcommon/llworkerthread.cpp
@@ -50,8 +50,8 @@ LLWorkerThread::~LLWorkerThread()
// Delete any workers in the delete queue (should be safe - had better be!)
if (!mDeleteList.empty())
{
- llwarns << "Worker Thread: " << mName << " destroyed with " << mDeleteList.size()
- << " entries in delete list." << llendl;
+ LL_WARNS() << "Worker Thread: " << mName << " destroyed with " << mDeleteList.size()
+ << " entries in delete list." << LL_ENDL;
}
delete mDeleteMutex;
@@ -65,8 +65,8 @@ void LLWorkerThread::clearDeleteList()
// Delete any workers in the delete queue (should be safe - had better be!)
if (!mDeleteList.empty())
{
- llwarns << "Worker Thread: " << mName << " destroyed with " << mDeleteList.size()
- << " entries in delete list." << llendl;
+ LL_WARNS() << "Worker Thread: " << mName << " destroyed with " << mDeleteList.size()
+ << " entries in delete list." << LL_ENDL;
mDeleteMutex->lock();
for (delete_list_t::iterator iter = mDeleteList.begin(); iter != mDeleteList.end(); ++iter)
@@ -142,7 +142,7 @@ LLWorkerThread::handle_t LLWorkerThread::addWorkRequest(LLWorkerClass* workercla
bool res = addRequest(req);
if (!res)
{
- llerrs << "add called after LLWorkerThread::cleanupClass()" << llendl;
+ LL_ERRS() << "add called after LLWorkerThread::cleanupClass()" << LL_ENDL;
req->deleteRequest();
handle = nullHandle();
}
@@ -209,7 +209,7 @@ LLWorkerClass::LLWorkerClass(LLWorkerThread* workerthread, const std::string& na
{
if (!mWorkerThread)
{
- llerrs << "LLWorkerClass() called with NULL workerthread: " << name << llendl;
+ LL_ERRS() << "LLWorkerClass() called with NULL workerthread: " << name << LL_ENDL;
}
}
@@ -223,12 +223,12 @@ LLWorkerClass::~LLWorkerClass()
LLWorkerThread::WorkRequest* workreq = (LLWorkerThread::WorkRequest*)mWorkerThread->getRequest(mRequestHandle);
if (!workreq)
{
- llerrs << "LLWorkerClass destroyed with stale work handle" << llendl;
+ LL_ERRS() << "LLWorkerClass destroyed with stale work handle" << LL_ENDL;
}
if (workreq->getStatus() != LLWorkerThread::STATUS_ABORTED &&
workreq->getStatus() != LLWorkerThread::STATUS_COMPLETE)
{
- llerrs << "LLWorkerClass destroyed with active worker! Worker Status: " << workreq->getStatus() << llendl;
+ LL_ERRS() << "LLWorkerClass destroyed with active worker! Worker Status: " << workreq->getStatus() << LL_ENDL;
}
}
}
@@ -238,7 +238,7 @@ void LLWorkerClass::setWorkerThread(LLWorkerThread* workerthread)
mMutex.lock();
if (mRequestHandle != LLWorkerThread::nullHandle())
{
- llerrs << "LLWorkerClass attempt to change WorkerThread with active worker!" << llendl;
+ LL_ERRS() << "LLWorkerClass attempt to change WorkerThread with active worker!" << LL_ENDL;
}
mWorkerThread = workerthread;
mMutex.unlock();
@@ -298,10 +298,10 @@ void LLWorkerClass::addWork(S32 param, U32 priority)
llassert_always(!(mWorkFlags & (WCF_WORKING|WCF_HAVE_WORK)));
if (mRequestHandle != LLWorkerThread::nullHandle())
{
- llerrs << "LLWorkerClass attempt to add work with active worker!" << llendl;
+ LL_ERRS() << "LLWorkerClass attempt to add work with active worker!" << LL_ENDL;
}
#if _DEBUG
-// llinfos << "addWork: " << mWorkerClassName << " Param: " << param << llendl;
+// LL_INFOS() << "addWork: " << mWorkerClassName << " Param: " << param << LL_ENDL;
#endif
startWork(param);
clearFlags(WCF_WORK_FINISHED|WCF_WORK_ABORTED);
@@ -316,7 +316,7 @@ void LLWorkerClass::abortWork(bool autocomplete)
#if _DEBUG
// LLWorkerThread::WorkRequest* workreq = mWorkerThread->getRequest(mRequestHandle);
// if (workreq)
-// llinfos << "abortWork: " << mWorkerClassName << " Param: " << workreq->getParam() << llendl;
+// LL_INFOS() << "abortWork: " << mWorkerClassName << " Param: " << workreq->getParam() << LL_ENDL;
#endif
if (mRequestHandle != LLWorkerThread::nullHandle())
{
diff --git a/indra/llcommon/llworkerthread.h b/indra/llcommon/llworkerthread.h
index be46394d6e..09776816a8 100755
--- a/indra/llcommon/llworkerthread.h
+++ b/indra/llcommon/llworkerthread.h
@@ -26,10 +26,11 @@
#ifndef LL_LLWORKERTHREAD_H
#define LL_LLWORKERTHREAD_H
-#include <queue>
-#include <string>
+#include <list>
#include <map>
+#include <queue>
#include <set>
+#include <string>
#include "llqueuedthread.h"
#include "llapr.h"
diff --git a/indra/llcommon/metaclass.cpp b/indra/llcommon/metaclass.cpp
deleted file mode 100755
index 5e403511cf..0000000000
--- a/indra/llcommon/metaclass.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * @file metaclass.cpp
- * @author Babbage
- * @date 2006-05-15
- * @brief Implementation of LLMetaClass
- *
- * $LicenseInfo:firstyear=2006&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "linden_common.h"
-
-#include "metaclass.h"
-
-#include "metaproperty.h"
-#include "reflective.h"
-
-LLMetaClass::LLMetaClass()
-{
-}
-
-//virtual
-LLMetaClass::~LLMetaClass()
-{
-}
-
-const LLMetaProperty* LLMetaClass::findProperty(const std::string& name) const
-{
- PropertyIterator iter = mProperties.find(name);
- if(iter == mProperties.end())
- {
- return NULL;
- }
- return (*iter).second;
-}
-
-void LLMetaClass::addProperty(const LLMetaProperty* property)
-{
- mProperties.insert(std::make_pair(property->getName(), property));
-}
-
-U32 LLMetaClass::getPropertyCount() const
-{
- return mProperties.size();
-}
-
-LLMetaClass::PropertyIterator LLMetaClass::beginProperties() const
-{
- return mProperties.begin();
-}
-
-LLMetaClass::PropertyIterator LLMetaClass::endProperties() const
-{
- return mProperties.end();
-}
-
-bool LLMetaClass::isInstance(const LLReflective* object) const
-{
- // TODO: Babbage: Search through super classes of objects MetaClass.
- const LLMetaClass* object_meta_class = &(object->getMetaClass());
- return (object_meta_class == this);
-}
-
diff --git a/indra/llcommon/metaclass.h b/indra/llcommon/metaclass.h
deleted file mode 100755
index 626757d58d..0000000000
--- a/indra/llcommon/metaclass.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * @file metaclass.h
- * @author Babbage
- * @date 2006-05-15
- * @brief Reflective meta information describing a class.
- *
- * $LicenseInfo:firstyear=2006&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_METACLASS_H
-#define LL_METACLASS_H
-
-#include <string>
-#include <map>
-
-#include "stdtypes.h"
-
-class LLReflective;
-class LLMetaProperty;
-class LLMetaMethod;
-class LL_COMMON_API LLMetaClass
-{
-public:
-
- LLMetaClass();
- virtual ~LLMetaClass();
-
- // Create instance of this MetaClass. NULL if class is abstract.
- // Gives ownership of returned object.
- // virtual LLReflective* create() const = 0;
-
- // Returns named property or NULL.
- const LLMetaProperty* findProperty(const std::string& name) const;
-
- // Add property to metaclass. Takes ownership of given property.
- void addProperty(const LLMetaProperty* property);
-
- typedef std::map<std::string, const LLMetaProperty*>::const_iterator PropertyIterator;
-
- U32 getPropertyCount() const;
-
- PropertyIterator beginProperties() const;
- PropertyIterator endProperties() const;
-
- // Returns named property or NULL.
- // const LLMetaMethod* findMethod(const std::string& name) const;
-
- // Add method to metaclass. Takes ownership of given method.
- // void addMethod(const LLMetaMethod* method);
-
- // Find MetaClass by name. NULL if name is unknown.
- // static LLMetaClass* findClass(const std::string& name);
-
- // True if object is instance of this meta class.
- bool isInstance(const LLReflective* object) const;
-
-private:
-
- typedef std::map<std::string, const LLMetaProperty*> PropertyMap;
- PropertyMap mProperties;
-};
-
-#endif // LL_METACLASS_H
diff --git a/indra/llcommon/metaclasst.h b/indra/llcommon/metaclasst.h
deleted file mode 100755
index b9a7ae219d..0000000000
--- a/indra/llcommon/metaclasst.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * @file metaclasst.h
- *
- * $LicenseInfo:firstyear=2006&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_METACLASST_H
-#define LL_METACLASST_H
-
-#include "metaclass.h"
-
-template<class TObject>
-class LLMetaClassT : public LLMetaClass
-{
- public:
-
- virtual ~LLMetaClassT() {;}
-
- static const LLMetaClassT& instance()
- {
- static const LLMetaClassT& instance = buildMetaClass();
- return instance;
- }
-
- private:
-
- static const LLMetaClassT& buildMetaClass()
- {
- LLMetaClassT& meta_class = *(new LLMetaClassT());
- reflectProperties(meta_class);
- return meta_class;
- }
-
- LLMetaClassT() {;}
-
- static void reflectProperties(LLMetaClass&)
- {
- }
-};
-
-#endif // LL_METACLASST_H
diff --git a/indra/llcommon/metaproperty.cpp b/indra/llcommon/metaproperty.cpp
deleted file mode 100755
index 98d850bf1e..0000000000
--- a/indra/llcommon/metaproperty.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * @file metaproperty.cpp
- * @author Babbage
- * @date 2006-05-15
- * @brief Implementation of LLMetaProperty.
- *
- * $LicenseInfo:firstyear=2006&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "linden_common.h"
-
-#include "metaproperty.h"
-
-#include "metaclass.h"
-
-LLMetaProperty::LLMetaProperty(const std::string& name, const LLMetaClass& object_class) :
- mName(name), mObjectClass(object_class)
-{
-}
-
-//virtual
-LLMetaProperty::~LLMetaProperty()
-{
-}
-
-const LLMetaClass& LLMetaProperty::getObjectMetaClass() const
-{
- return mObjectClass;
-}
-
-void LLMetaProperty::checkObjectClass(const LLReflective* object) const
-{
- if(! mObjectClass.isInstance(object))
- {
- throw "class cast exception";
- }
-}
diff --git a/indra/llcommon/metaproperty.h b/indra/llcommon/metaproperty.h
deleted file mode 100755
index bd5bb1a30f..0000000000
--- a/indra/llcommon/metaproperty.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * @file metaproperty.h
- * @author Babbage
- * @date 2006-05-15
- * @brief Reflective meta information describing a property of a class.
- *
- * $LicenseInfo:firstyear=2006&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_METAPROPERTY_H
-#define LL_METAPROPERTY_H
-
-#include "stdtypes.h"
-#include "llsd.h"
-#include "reflective.h"
-
-class LLMetaClass;
-class LLReflective;
-class LL_COMMON_API LLMetaProperty
-{
-public:
- LLMetaProperty(const std::string& name, const LLMetaClass& object_class);
- virtual ~LLMetaProperty();
-
- // Get property name.
- const std::string& getName() const {return mName;}
-
- // Get value of this property.
- virtual const LLReflective* get(const LLReflective* object) const = 0;
-
- // Set value of this property.
- // virtual void set(LLReflective* object, const LLReflective* value) = 0;
-
- // Get value of this property as LLSD. Default returns undefined LLSD.
- virtual LLSD getLLSD(const LLReflective* object) const = 0;
-
- // Get the MetaClass of legal values of this property.
- // const LLMetaClass& getValueMetaClass();
-
- // Get the meta class that this property is a member of.
- const LLMetaClass& getObjectMetaClass() const;
-
-protected:
-
- // Check object is instance of object class, throw exception if not.
- void checkObjectClass(const LLReflective* object) const;
-
-private:
-
- std::string mName;
- const LLMetaClass& mObjectClass;
-};
-
-#endif // LL_METAPROPERTY_H
diff --git a/indra/llcommon/metapropertyt.h b/indra/llcommon/metapropertyt.h
deleted file mode 100755
index 7a36c161da..0000000000
--- a/indra/llcommon/metapropertyt.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/**
- * @file metapropertyt.h
- *
- * $LicenseInfo:firstyear=2006&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_METAPROPERTYT_H
-#define LL_METAPROPERTYT_H
-
-#include "llsd.h"
-#include "llstring.h"
-#include "metaclasst.h"
-#include "metaproperty.h"
-#include "reflectivet.h"
-
-template<class TProperty>
-class LLMetaPropertyT : public LLMetaProperty
-{
-public:
-
- virtual ~LLMetaPropertyT() {;}
-
- // Get value of this property. Gives ownership of returned value.
- virtual const LLReflective* get(const LLReflective* object) const
- {
- checkObjectClass(object);
- return getProperty(object);
- }
-
- // Set value of this property.
- /*virtual void set(LLReflective* object, const LLReflective* value)
- {
- // TODO: Babbage: Check types.
- ref(object) = static_cast<const LLReflectiveT<TProperty>* >(value)->getValue();
- }*/
-
- // Get value of this property as LLSD.
- virtual LLSD getLLSD(const LLReflective* object) const
- {
- return LLSD();
- }
-
-protected:
-
- LLMetaPropertyT(const std::string& name, const LLMetaClass& object_class) : LLMetaProperty(name, object_class) {;}
-
- virtual const TProperty* getProperty(const LLReflective* object) const = 0;
-};
-
-template <>
-inline const LLReflective* LLMetaPropertyT<S32>::get(const LLReflective* object) const
-{
- checkObjectClass(object);
- return NULL;
-}
-
-template <>
-inline const LLReflective* LLMetaPropertyT<std::string>::get(const LLReflective* object) const
-{
- checkObjectClass(object);
- return NULL;
-}
-
-template <>
-inline const LLReflective* LLMetaPropertyT<LLUUID>::get(const LLReflective* object) const
-{
- checkObjectClass(object);
- return NULL;
-}
-
-template <>
-inline const LLReflective* LLMetaPropertyT<bool>::get(const LLReflective* object) const
-{
- checkObjectClass(object);
- return NULL;
-}
-
-template <>
-inline LLSD LLMetaPropertyT<S32>::getLLSD(const LLReflective* object) const
-{
- return *(getProperty(object));
-}
-
-template <>
-inline LLSD LLMetaPropertyT<std::string>::getLLSD(const LLReflective* object) const
-{
- return *(getProperty(object));
-}
-
-template <>
-inline LLSD LLMetaPropertyT<LLUUID>::getLLSD(const LLReflective* object) const
-{
- return *(getProperty(object));
-}
-
-template <>
-inline LLSD LLMetaPropertyT<bool>::getLLSD(const LLReflective* object) const
-{
- return *(getProperty(object));
-}
-
-template<class TObject, class TProperty>
-class LLMetaPropertyTT : public LLMetaPropertyT<TProperty>
-{
-public:
-
- LLMetaPropertyTT(const std::string& name, const LLMetaClass& object_class, TProperty (TObject::*property)) :
- LLMetaPropertyT<TProperty>(name, object_class), mProperty(property) {;}
-
-protected:
-
- // Get void* to property.
- virtual const TProperty* getProperty(const LLReflective* object) const
- {
- const TObject* typed_object = static_cast<const TObject*>(object);
- return &(typed_object->*mProperty);
- };
-
-private:
-
- TProperty (TObject::*mProperty);
-};
-
-template<class TObject, class TProperty>
-class LLMetaPropertyPtrTT : public LLMetaPropertyT<TProperty>
-{
-public:
-
- LLMetaPropertyPtrTT(const std::string& name, const LLMetaClass& object_class, TProperty* (TObject::*property)) :
- LLMetaPropertyT<TProperty>(name, object_class), mProperty(property) {;}
-
-protected:
-
- // Get void* to property.
- virtual const TProperty* getProperty(const LLReflective* object) const
- {
- const TObject* typed_object = static_cast<const TObject*>(object);
- return typed_object->*mProperty;
- };
-
-private:
-
- TProperty* (TObject::*mProperty);
-};
-
-// Utility function to simplify the registration of members.
-template<class TObject, class TProperty>
-void reflectProperty(LLMetaClass& meta_class, const std::string& name, TProperty (TObject::*property))
-{
- typedef LLMetaPropertyTT<TObject, TProperty> PropertyType;
- const LLMetaProperty* meta_property = new PropertyType(name, meta_class, property);
- meta_class.addProperty(meta_property);
-}
-
-// Utility function to simplify the registration of ptr properties.
-template<class TObject, class TProperty>
-void reflectPtrProperty(LLMetaClass& meta_class, const std::string& name, TProperty* (TObject::*property))
-{
- typedef LLMetaPropertyPtrTT<TObject, TProperty> PropertyType;
- const LLMetaProperty* meta_property = new PropertyType(name, meta_class, property);
- meta_class.addProperty(meta_property);
-}
-
-#endif // LL_METAPROPERTYT_H
diff --git a/indra/llcommon/reflective.h b/indra/llcommon/reflective.h
deleted file mode 100755
index da5c5a2630..0000000000
--- a/indra/llcommon/reflective.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * @file reflective.h
- * @author Babbage
- * @date 2006-05-15
- * @brief Interface that must be implemented by all reflective classes.
- *
- * $LicenseInfo:firstyear=2006&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_REFLECTIVE_H
-#define LL_REFLECTIVE_H
-
-class LLMetaClass;
-class LL_COMMON_API LLReflective
-{
-public:
- LLReflective();
- virtual ~LLReflective();
-
- virtual const LLMetaClass& getMetaClass() const = 0;
-};
-
-#endif // LL_REFLECTIVE_H
diff --git a/indra/llcommon/roles_constants.h b/indra/llcommon/roles_constants.h
deleted file mode 100755
index effd15ea72..0000000000
--- a/indra/llcommon/roles_constants.h
+++ /dev/null
@@ -1,192 +0,0 @@
-/**
- * @file roles_constants.h
- * @brief General Roles Constants
- *
- * $LicenseInfo:firstyear=2006&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_ROLES_CONSTANTS_H
-#define LL_ROLES_CONSTANTS_H
-
-// This value includes the everyone group.
-const S32 MAX_ROLES = 10;
-
-enum LLRoleMemberChangeType
-{
- RMC_ADD,
- RMC_REMOVE,
- RMC_NONE
-};
-
-enum LLRoleChangeType
-{
- RC_UPDATE_NONE,
- RC_UPDATE_DATA,
- RC_UPDATE_POWERS,
- RC_UPDATE_ALL,
- RC_CREATE,
- RC_DELETE
-};
-
-//
-// Powers
-//
-
-// KNOWN HOLES: use these for any single bit powers you need
-// bit 0x1 << 46
-// bit 0x1 << 49 and above
-
-// These powers were removed to make group roles simpler
-// bit 0x1 << 41 (GP_ACCOUNTING_VIEW)
-// bit 0x1 << 46 (GP_PROPOSAL_VIEW)
-
-const U64 GP_NO_POWERS = 0x0;
-const U64 GP_ALL_POWERS = 0xFFFFFFFFFFFFFFFFLL;
-
-// Membership
-const U64 GP_MEMBER_INVITE = 0x1 << 1; // Invite member
-const U64 GP_MEMBER_EJECT = 0x1 << 2; // Eject member from group
-const U64 GP_MEMBER_OPTIONS = 0x1 << 3; // Toggle "Open enrollment" and change "Signup Fee"
-const U64 GP_MEMBER_VISIBLE_IN_DIR = 0x1LL << 47;
-
-// Roles
-const U64 GP_ROLE_CREATE = 0x1 << 4; // Create new roles
-const U64 GP_ROLE_DELETE = 0x1 << 5; // Delete roles
-const U64 GP_ROLE_PROPERTIES = 0x1 << 6; // Change Role Names, Titles, and Descriptions (Of roles the user is in, only, or any role in group?)
-const U64 GP_ROLE_ASSIGN_MEMBER_LIMITED = 0x1 << 7; // Assign Member to a Role that the assigner is in
-const U64 GP_ROLE_ASSIGN_MEMBER = 0x1 << 8; // Assign Member to Role
-const U64 GP_ROLE_REMOVE_MEMBER = 0x1 << 9; // Remove Member from Role
-const U64 GP_ROLE_CHANGE_ACTIONS = 0x1 << 10; // Change actions a role can perform
-
-// Group Identity
-const U64 GP_GROUP_CHANGE_IDENTITY = 0x1 << 11; // Charter, insignia, 'Show In Group List', 'Publish on the web', 'Mature', all 'Show Member In Group Profile' checkboxes
-
-// Parcel Management
-const U64 GP_LAND_DEED = 0x1 << 12; // Deed Land and Buy Land for Group
-const U64 GP_LAND_RELEASE = 0x1 << 13; // Release Land (to Gov. Linden)
-const U64 GP_LAND_SET_SALE_INFO = 0x1 << 14; // Set for sale info (Toggle "For Sale", Set Price, Set Target, Toggle "Sell objects with the land")
-const U64 GP_LAND_DIVIDE_JOIN = 0x1 << 15; // Divide and Join Parcels
-
-// Parcel Identity
-const U64 GP_LAND_FIND_PLACES = 0x1 << 17; // Toggle "Show in Find Places" and Set Category.
-const U64 GP_LAND_CHANGE_IDENTITY = 0x1 << 18; // Change Parcel Identity: Parcel Name, Parcel Description, Snapshot, 'Publish on the web', and 'Mature' checkbox
-const U64 GP_LAND_SET_LANDING_POINT = 0x1 << 19; // Set Landing Point
-
-// Parcel Settings
-const U64 GP_LAND_CHANGE_MEDIA = 0x1 << 20; // Change Media Settings
-const U64 GP_LAND_EDIT = 0x1 << 21; // Toggle Edit Land
-const U64 GP_LAND_OPTIONS = 0x1 << 22; // Toggle Set Home Point, Fly, Outside Scripts, Create/Edit Objects, Landmark, and Damage checkboxes
-
-// Parcel Powers
-const U64 GP_LAND_ALLOW_EDIT_LAND = 0x1 << 23; // Bypass Edit Land Restriction
-const U64 GP_LAND_ALLOW_FLY = 0x1 << 24; // Bypass Fly Restriction
-const U64 GP_LAND_ALLOW_CREATE = 0x1 << 25; // Bypass Create/Edit Objects Restriction
-const U64 GP_LAND_ALLOW_LANDMARK = 0x1 << 26; // Bypass Landmark Restriction
-const U64 GP_LAND_ALLOW_SET_HOME = 0x1 << 28; // Bypass Set Home Point Restriction
-const U64 GP_LAND_ALLOW_HOLD_EVENT = 0x1LL << 41; // Allowed to hold events on group-owned land
-
-
-// Parcel Access
-const U64 GP_LAND_MANAGE_ALLOWED = 0x1 << 29; // Manage Allowed List
-const U64 GP_LAND_MANAGE_BANNED = 0x1 << 30; // Manage Banned List
-const U64 GP_LAND_MANAGE_PASSES = 0x1LL << 31; // Change Sell Pass Settings
-const U64 GP_LAND_ADMIN = 0x1LL << 32; // Eject and Freeze Users on the land
-
-// Parcel Content
-const U64 GP_LAND_RETURN_GROUP_SET = 0x1LL << 33; // Return objects on parcel that are set to group
-const U64 GP_LAND_RETURN_NON_GROUP = 0x1LL << 34; // Return objects on parcel that are not set to group
-const U64 GP_LAND_RETURN_GROUP_OWNED= 0x1LL << 48; // Return objects on parcel that are owned by the group
-
-// Select a power-bit based on an object's relationship to a parcel.
-const U64 GP_LAND_RETURN = GP_LAND_RETURN_GROUP_OWNED
- | GP_LAND_RETURN_GROUP_SET
- | GP_LAND_RETURN_NON_GROUP;
-
-const U64 GP_LAND_GARDENING = 0x1LL << 35; // Parcel Gardening - plant and move linden trees
-
-// Object Management
-const U64 GP_OBJECT_DEED = 0x1LL << 36; // Deed Object
-const U64 GP_OBJECT_MANIPULATE = 0x1LL << 38; // Manipulate Group Owned Objects (Move, Copy, Mod)
-const U64 GP_OBJECT_SET_SALE = 0x1LL << 39; // Set Group Owned Object for Sale
-
-// Accounting
-const U64 GP_ACCOUNTING_ACCOUNTABLE = 0x1LL << 40; // Pay Group Liabilities and Receive Group Dividends
-
-// Notices
-const U64 GP_NOTICES_SEND = 0x1LL << 42; // Send Notices
-const U64 GP_NOTICES_RECEIVE = 0x1LL << 43; // Receive Notices and View Notice History
-
-// Proposals
-// TODO: _DEPRECATED suffix as part of vote removal - DEV-24856:
-const U64 GP_PROPOSAL_START = 0x1LL << 44; // Start Proposal
-// TODO: _DEPRECATED suffix as part of vote removal - DEV-24856:
-const U64 GP_PROPOSAL_VOTE = 0x1LL << 45; // Vote on Proposal
-
-// Group chat moderation related
-const U64 GP_SESSION_JOIN = 0x1LL << 16; //can join session
-const U64 GP_SESSION_VOICE = 0x1LL << 27; //can hear/talk
-const U64 GP_SESSION_MODERATOR = 0x1LL << 37; //can mute people's session
-
-const U64 GP_DEFAULT_MEMBER = GP_ACCOUNTING_ACCOUNTABLE
- | GP_LAND_ALLOW_SET_HOME
- | GP_NOTICES_RECEIVE
- | GP_SESSION_JOIN
- | GP_SESSION_VOICE
- ;
-
-const U64 GP_DEFAULT_OFFICER = GP_DEFAULT_MEMBER // Superset of GP_DEFAULT_MEMBER
- | GP_GROUP_CHANGE_IDENTITY
- | GP_LAND_ADMIN
- | GP_LAND_ALLOW_EDIT_LAND
- | GP_LAND_ALLOW_FLY
- | GP_LAND_ALLOW_CREATE
- | GP_LAND_ALLOW_LANDMARK
- | GP_LAND_CHANGE_IDENTITY
- | GP_LAND_CHANGE_MEDIA
- | GP_LAND_DEED
- | GP_LAND_DIVIDE_JOIN
- | GP_LAND_EDIT
- | GP_LAND_FIND_PLACES
- | GP_LAND_GARDENING
- | GP_LAND_MANAGE_ALLOWED
- | GP_LAND_MANAGE_BANNED
- | GP_LAND_MANAGE_PASSES
- | GP_LAND_OPTIONS
- | GP_LAND_RELEASE
- | GP_LAND_RETURN_GROUP_OWNED
- | GP_LAND_RETURN_GROUP_SET
- | GP_LAND_RETURN_NON_GROUP
- | GP_LAND_SET_LANDING_POINT
- | GP_LAND_SET_SALE_INFO
- | GP_MEMBER_EJECT
- | GP_MEMBER_INVITE
- | GP_MEMBER_OPTIONS
- | GP_MEMBER_VISIBLE_IN_DIR
- | GP_NOTICES_SEND
- | GP_OBJECT_DEED
- | GP_OBJECT_MANIPULATE
- | GP_OBJECT_SET_SALE
- | GP_ROLE_ASSIGN_MEMBER_LIMITED
- | GP_ROLE_PROPERTIES
- | GP_SESSION_MODERATOR
- ;
-#endif
diff --git a/indra/llcommon/stdenums.h b/indra/llcommon/stdenums.h
deleted file mode 100755
index efcbe76795..0000000000
--- a/indra/llcommon/stdenums.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
- * @file stdenums.h
- * @brief Enumerations for indra.
- *
- * $LicenseInfo:firstyear=2002&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_STDENUMS_H
-#define LL_STDENUMS_H
-
-//----------------------------------------------------------------------------
-// DEPRECATED - create new, more specific files for shared enums/constants
-//----------------------------------------------------------------------------
-
-// this enum is used by the llview.h (viewer) and the llassetstorage.h (viewer and sim)
-enum EDragAndDropType
-{
- DAD_NONE = 0,
- DAD_TEXTURE = 1,
- DAD_SOUND = 2,
- DAD_CALLINGCARD = 3,
- DAD_LANDMARK = 4,
- DAD_SCRIPT = 5,
- DAD_CLOTHING = 6,
- DAD_OBJECT = 7,
- DAD_NOTECARD = 8,
- DAD_CATEGORY = 9,
- DAD_ROOT_CATEGORY = 10,
- DAD_BODYPART = 11,
- DAD_ANIMATION = 12,
- DAD_GESTURE = 13,
- DAD_LINK = 14,
- DAD_MESH = 15,
- DAD_WIDGET = 16,
- DAD_PERSON = 17,
- DAD_COUNT = 18, // number of types in this enum
-};
-
-// Reasons for drags to be denied.
-// ordered by priority for multi-drag
-enum EAcceptance
-{
- ACCEPT_POSTPONED, // we are asynchronously determining acceptance
- ACCEPT_NO, // Uninformative, general purpose denial.
- ACCEPT_NO_LOCKED, // Operation would be valid, but permissions are set to disallow it.
- ACCEPT_YES_COPY_SINGLE, // We'll take a copy of a single item
- ACCEPT_YES_SINGLE, // Accepted. OK to drag and drop single item here.
- ACCEPT_YES_COPY_MULTI, // We'll take a copy of multiple items
- ACCEPT_YES_MULTI // Accepted. OK to drag and drop multiple items here.
-};
-
-// This is used by the DeRezObject message to determine where to put
-// derezed tasks.
-enum EDeRezDestination
-{
- DRD_SAVE_INTO_AGENT_INVENTORY = 0,
- DRD_ACQUIRE_TO_AGENT_INVENTORY = 1, // try to leave copy in world
- DRD_SAVE_INTO_TASK_INVENTORY = 2,
- DRD_ATTACHMENT = 3,
- DRD_TAKE_INTO_AGENT_INVENTORY = 4, // delete from world
- DRD_FORCE_TO_GOD_INVENTORY = 5, // force take copy
- DRD_TRASH = 6,
- DRD_ATTACHMENT_TO_INV = 7,
- DRD_ATTACHMENT_EXISTS = 8,
- DRD_RETURN_TO_OWNER = 9, // back to owner's inventory
- DRD_RETURN_TO_LAST_OWNER = 10, // deeded object back to last owner's inventory
-
- DRD_COUNT = 11
-};
-
-
-// This is used by the return to owner code to determine the reason
-// that this object is being returned.
-enum EReturnReason
-{
- RR_GENERIC = 0,
- RR_SANDBOX = 1,
- RR_PARCEL_OWNER = 2,
- RR_PARCEL_AUTO = 3,
- RR_PARCEL_FULL = 4,
- RR_OFF_WORLD = 5,
-
- RR_COUNT = 6
-};
-
-// This is used for filling in the first byte of the ExtraID field of
-// the ObjectProperties message.
-enum EObjectPropertiesExtraID
-{
- OPEID_NONE = 0,
- OPEID_ASSET_ID = 1,
- OPEID_FROM_TASK_ID = 2,
-
- OPEID_COUNT = 3
-};
-
-enum EAddPosition
-{
- ADD_TOP,
- ADD_BOTTOM,
- ADD_DEFAULT
-};
-
-enum LLGroupChange
-{
- GC_PROPERTIES,
- GC_MEMBER_DATA,
- GC_ROLE_DATA,
- GC_ROLE_MEMBER_DATA,
- GC_TITLES,
- GC_ALL
-};
-
-//----------------------------------------------------------------------------
-// DEPRECATED - create new, more specific files for shared enums/constants
-//----------------------------------------------------------------------------
-
-#endif
diff --git a/indra/llcommon/string_table.h b/indra/llcommon/string_table.h
index fe6416fb50..fe6416fb50 100755..100644
--- a/indra/llcommon/string_table.h
+++ b/indra/llcommon/string_table.h
diff --git a/indra/llcommon/stringize.h b/indra/llcommon/stringize.h
index acae74b584..2df008febb 100755
--- a/indra/llcommon/stringize.h
+++ b/indra/llcommon/stringize.h
@@ -53,7 +53,7 @@ std::basic_string<CHARTYPE> gstringize(const T& item)
*/
inline std::string stringize(const std::wstring& item)
{
- llwarns << "WARNING: Possible narrowing" << llendl;
+ LL_WARNS() << "WARNING: Possible narrowing" << LL_ENDL;
std::string s;
diff --git a/indra/llcommon/tests/bitpack_test.cpp b/indra/llcommon/tests/bitpack_test.cpp
index afc0c18cd0..9bfd567068 100755
--- a/indra/llcommon/tests/bitpack_test.cpp
+++ b/indra/llcommon/tests/bitpack_test.cpp
@@ -28,7 +28,7 @@
#include "linden_common.h"
-#include "../bitpack.h"
+#include "../llbitpack.h"
#include "../test/lltut.h"
diff --git a/indra/llcommon/tests/commonmisc_test.cpp b/indra/llcommon/tests/commonmisc_test.cpp
index b115c153c1..4b3e07fa75 100755
--- a/indra/llcommon/tests/commonmisc_test.cpp
+++ b/indra/llcommon/tests/commonmisc_test.cpp
@@ -339,7 +339,7 @@ namespace tut
/*
if(actual != expected)
{
- llwarns << "iteration " << i << llendl;
+ LL_WARNS() << "iteration " << i << LL_ENDL;
std::ostringstream e_str;
std::string::iterator iter = expected.begin();
std::string::iterator end = expected.end();
@@ -349,8 +349,8 @@ namespace tut
}
e_str << std::endl;
llsd_serialize_string(e_str, expected);
- llwarns << "expected size: " << expected.size() << llendl;
- llwarns << "expected: " << e_str.str() << llendl;
+ LL_WARNS() << "expected size: " << expected.size() << LL_ENDL;
+ LL_WARNS() << "expected: " << e_str.str() << LL_ENDL;
std::ostringstream a_str;
iter = actual.begin();
@@ -361,8 +361,8 @@ namespace tut
}
a_str << std::endl;
llsd_serialize_string(a_str, actual);
- llwarns << "actual size: " << actual.size() << llendl;
- llwarns << "actual: " << a_str.str() << llendl;
+ LL_WARNS() << "actual size: " << actual.size() << LL_ENDL;
+ LL_WARNS() << "actual: " << a_str.str() << LL_ENDL;
}
*/
ensure_equals("string value", actual, expected);
diff --git a/indra/llcommon/tests/lldeadmantimer_test.cpp b/indra/llcommon/tests/lldeadmantimer_test.cpp
index 7fd2dde6e0..23167762c3 100644
--- a/indra/llcommon/tests/lldeadmantimer_test.cpp
+++ b/indra/llcommon/tests/lldeadmantimer_test.cpp
@@ -37,12 +37,12 @@
static LLDeadmanTimer::time_type float_time_to_u64(F64 delta)
{
- return LLDeadmanTimer::time_type(delta * gClockFrequency);
+ return LLDeadmanTimer::time_type(delta * get_timer_info().mClockFrequency);
}
static F64 u64_time_to_float(LLDeadmanTimer::time_type delta)
{
- return delta * gClockFrequencyInv;
+ return delta * get_timer_info().mClockFrequencyInv;
}
@@ -54,7 +54,7 @@ struct deadmantimer_test
deadmantimer_test()
{
// LLTimer internals updating
- update_clock_frequencies();
+ get_timer_info().update();
}
};
diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp
index 279a90e51b..a5aaff10c5 100755
--- a/indra/llcommon/tests/llerror_test.cpp
+++ b/indra/llcommon/tests/llerror_test.cpp
@@ -40,7 +40,7 @@ namespace
{
void test_that_error_h_includes_enough_things_to_compile_a_message()
{
- llinfos << "!" << llendl;
+ LL_INFOS() << "!" << LL_ENDL;
}
}
@@ -55,10 +55,10 @@ namespace tut
class TestRecorder : public LLError::Recorder
{
public:
- TestRecorder() : mWantsTime(false) { }
- ~TestRecorder() { LLError::removeRecorder(this); }
+ TestRecorder() { mWantsTime = false; }
+ virtual ~TestRecorder() { }
- void recordMessage(LLError::ELevel level,
+ virtual void recordMessage(LLError::ELevel level,
const std::string& message)
{
mMessages.push_back(message);
@@ -68,7 +68,6 @@ namespace tut
void clearMessages() { mMessages.clear(); }
void setWantsTime(bool t) { mWantsTime = t; }
- bool wantsTime() { return mWantsTime; }
std::string message(int n)
{
@@ -82,21 +81,15 @@ namespace tut
private:
typedef std::vector<std::string> MessageVector;
MessageVector mMessages;
-
- bool mWantsTime;
};
struct ErrorTestData
{
- // addRecorder() expects to be able to later delete the passed
- // Recorder*. Even though removeRecorder() reclaims ownership, passing
- // a pointer to a data member rather than a heap Recorder subclass
- // instance would just be Wrong.
- TestRecorder* mRecorder;
- LLError::Settings* mPriorErrorSettings;
+ LLError::RecorderPtr mRecorder;
+ LLError::SettingsStoragePtr mPriorErrorSettings;
ErrorTestData():
- mRecorder(new TestRecorder)
+ mRecorder(new TestRecorder())
{
fatalWasCalled = false;
@@ -109,13 +102,32 @@ namespace tut
~ErrorTestData()
{
LLError::removeRecorder(mRecorder);
- delete mRecorder;
LLError::restoreSettings(mPriorErrorSettings);
}
+ int countMessages()
+ {
+ return boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->countMessages();
+ }
+
+ void clearMessages()
+ {
+ boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->clearMessages();
+ }
+
+ void setWantsTime(bool t)
+ {
+ boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->setWantsTime(t);
+ }
+
+ std::string message(int n)
+ {
+ return boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->message(n);
+ }
+
void ensure_message_count(int expectedCount)
{
- ensure_equals("message count", mRecorder->countMessages(), expectedCount);
+ ensure_equals("message count", countMessages(), expectedCount);
}
void ensure_message_contains(int n, const std::string& expectedText)
@@ -123,7 +135,7 @@ namespace tut
std::ostringstream test_name;
test_name << "testing message " << n;
- ensure_contains(test_name.str(), mRecorder->message(n), expectedText);
+ ensure_contains(test_name.str(), message(n), expectedText);
}
void ensure_message_does_not_contain(int n, const std::string& expectedText)
@@ -131,7 +143,7 @@ namespace tut
std::ostringstream test_name;
test_name << "testing message " << n;
- ensure_does_not_contain(test_name.str(), mRecorder->message(n), expectedText);
+ ensure_does_not_contain(test_name.str(), message(n), expectedText);
}
};
@@ -144,8 +156,8 @@ namespace tut
void ErrorTestObject::test<1>()
// basic test of output
{
- llinfos << "test" << llendl;
- llinfos << "bob" << llendl;
+ LL_INFOS() << "test" << LL_ENDL;
+ LL_INFOS() << "bob" << LL_ENDL;
ensure_message_contains(0, "test");
ensure_message_contains(1, "bob");
@@ -156,11 +168,11 @@ namespace
{
void writeSome()
{
- lldebugs << "one" << llendl;
- llinfos << "two" << llendl;
- llwarns << "three" << llendl;
- llerrs << "four" << llendl;
- // fatal messages write out and addtional "error" message
+ LL_DEBUGS() << "one" << LL_ENDL;
+ LL_INFOS() << "two" << LL_ENDL;
+ LL_WARNS() << "three" << LL_ENDL;
+ // fatal messages write out an additional "error" message
+ LL_ERRS() << "four" << LL_ENDL;
}
};
@@ -259,19 +271,20 @@ namespace
std::string writeReturningLocation()
{
- llinfos << "apple" << llendl; int this_line = __LINE__;
+ LL_INFOS() << "apple" << LL_ENDL; int this_line = __LINE__;
return locationString(this_line);
}
- std::string writeReturningLocationAndFunction()
+ void writeReturningLocationAndFunction(std::string& location, std::string& function)
{
- llinfos << "apple" << llendl; int this_line = __LINE__;
- return locationString(this_line) + __FUNCTION__;
+ LL_INFOS() << "apple" << LL_ENDL; int this_line = __LINE__;
+ location = locationString(this_line);
+ function = __FUNCTION__;
}
std::string errorReturningLocation()
{
- llerrs << "die" << llendl; int this_line = __LINE__;
+ LL_ERRS() << "die" << LL_ENDL; int this_line = __LINE__;
return locationString(this_line);
}
}
@@ -306,13 +319,13 @@ namespace tut
std::string logFromGlobal(bool id)
{
- llinfos << (id ? "logFromGlobal: " : "") << "hi" << llendl;
+ LL_INFOS() << (id ? "logFromGlobal: " : "") << "hi" << LL_ENDL;
return "logFromGlobal";
}
static std::string logFromStatic(bool id)
{
- llinfos << (id ? "logFromStatic: " : "") << "hi" << llendl;
+ LL_INFOS() << (id ? "logFromStatic: " : "") << "hi" << LL_ENDL;
return "logFromStatic";
}
@@ -320,7 +333,7 @@ namespace
{
std::string logFromAnon(bool id)
{
- llinfos << (id ? "logFromAnon: " : "") << "hi" << llendl;
+ LL_INFOS() << (id ? "logFromAnon: " : "") << "hi" << LL_ENDL;
return "logFromAnon";
}
}
@@ -328,7 +341,7 @@ namespace
namespace Foo {
std::string logFromNamespace(bool id)
{
- llinfos << (id ? "Foo::logFromNamespace: " : "") << "hi" << llendl;
+ LL_INFOS() << (id ? "Foo::logFromNamespace: " : "") << "hi" << LL_ENDL;
//return "Foo::logFromNamespace";
// there is no standard way to get the namespace name, hence
// we won't be testing for it
@@ -342,12 +355,12 @@ namespace
public:
std::string logFromMember(bool id)
{
- llinfos << (id ? "ClassWithNoLogType::logFromMember: " : "") << "hi" << llendl;
+ LL_INFOS() << (id ? "ClassWithNoLogType::logFromMember: " : "") << "hi" << LL_ENDL;
return "ClassWithNoLogType::logFromMember";
}
static std::string logFromStatic(bool id)
{
- llinfos << (id ? "ClassWithNoLogType::logFromStatic: " : "") << "hi" << llendl;
+ LL_INFOS() << (id ? "ClassWithNoLogType::logFromStatic: " : "") << "hi" << LL_ENDL;
return "ClassWithNoLogType::logFromStatic";
}
};
@@ -357,12 +370,12 @@ namespace
public:
std::string logFromMember(bool id)
{
- llinfos << (id ? "ClassWithLogType::logFromMember: " : "") << "hi" << llendl;
+ LL_INFOS() << (id ? "ClassWithLogType::logFromMember: " : "") << "hi" << LL_ENDL;
return "ClassWithLogType::logFromMember";
}
static std::string logFromStatic(bool id)
{
- llinfos << (id ? "ClassWithLogType::logFromStatic: " : "") << "hi" << llendl;
+ LL_INFOS() << (id ? "ClassWithLogType::logFromStatic: " : "") << "hi" << LL_ENDL;
return "ClassWithLogType::logFromStatic";
}
};
@@ -387,15 +400,15 @@ namespace
}
typedef std::string (*LogFromFunction)(bool);
- void testLogName(tut::TestRecorder* recorder, LogFromFunction f,
+ void testLogName(LLError::RecorderPtr recorder, LogFromFunction f,
const std::string& class_name = "")
{
- recorder->clearMessages();
+ boost::dynamic_pointer_cast<tut::TestRecorder>(recorder)->clearMessages();
std::string name = f(false);
f(true);
- std::string messageWithoutName = recorder->message(0);
- std::string messageWithName = recorder->message(1);
+ std::string messageWithoutName = boost::dynamic_pointer_cast<tut::TestRecorder>(recorder)->message(0);
+ std::string messageWithName = boost::dynamic_pointer_cast<tut::TestRecorder>(recorder)->message(1);
ensure_has(name + " logged without name",
messageWithoutName, name);
@@ -434,19 +447,19 @@ namespace
{
std::string innerLogger()
{
- llinfos << "inside" << llendl;
+ LL_INFOS() << "inside" << LL_ENDL;
return "moo";
}
std::string outerLogger()
{
- llinfos << "outside(" << innerLogger() << ")" << llendl;
+ LL_INFOS() << "outside(" << innerLogger() << ")" << LL_ENDL;
return "bar";
}
void uberLogger()
{
- llinfos << "uber(" << outerLogger() << "," << innerLogger() << ")" << llendl;
+ LL_INFOS() << "uber(" << outerLogger() << "," << innerLogger() << ")" << LL_ENDL;
}
class LogWhileLogging
@@ -454,7 +467,7 @@ namespace
public:
void print(std::ostream& out) const
{
- llinfos << "logging" << llendl;
+ LL_INFOS() << "logging" << LL_ENDL;
out << "baz";
}
};
@@ -465,7 +478,7 @@ namespace
void metaLogger()
{
LogWhileLogging l;
- llinfos << "meta(" << l << ")" << llendl;
+ LL_INFOS() << "meta(" << l << ")" << LL_ENDL;
}
}
@@ -495,7 +508,7 @@ namespace tut
}
template<> template<>
- // special handling of llerrs calls
+ // special handling of LL_ERRS() calls
void ErrorTestObject::test<8>()
{
LLError::setPrintLocation(false);
@@ -518,7 +531,7 @@ namespace
void ufoSighting()
{
- llinfos << "ufo" << llendl;
+ LL_INFOS() << "ufo" << LL_ENDL;
}
}
@@ -530,12 +543,12 @@ namespace tut
{
LLError::setTimeFunction(roswell);
- mRecorder->setWantsTime(false);
+ setWantsTime(false);
ufoSighting();
ensure_message_contains(0, "ufo");
ensure_message_does_not_contain(0, roswell());
- mRecorder->setWantsTime(true);
+ setWantsTime(true);
ufoSighting();
ensure_message_contains(1, "ufo");
ensure_message_contains(1, roswell());
@@ -547,42 +560,47 @@ namespace tut
{
LLError::setPrintLocation(true);
LLError::setTimeFunction(roswell);
- mRecorder->setWantsTime(true);
- std::string locationAndFunction = writeReturningLocationAndFunction();
+ setWantsTime(true);
+ std::string location,
+ function;
+ writeReturningLocationAndFunction(location, function);
- ensure_equals("order is time type location function message",
- mRecorder->message(0),
- roswell() + " INFO: " + locationAndFunction + ": apple");
+ ensure_equals("order is location time type function message",
+ message(0),
+ location + roswell() + " INFO: " + function + ": apple");
}
template<> template<>
// multiple recorders
void ErrorTestObject::test<11>()
{
- TestRecorder* altRecorder(new TestRecorder);
+ LLError::RecorderPtr altRecorder(new TestRecorder());
LLError::addRecorder(altRecorder);
- llinfos << "boo" << llendl;
+ LL_INFOS() << "boo" << LL_ENDL;
ensure_message_contains(0, "boo");
- ensure_equals("alt recorder count", altRecorder->countMessages(), 1);
- ensure_contains("alt recorder message 0", altRecorder->message(0), "boo");
+ ensure_equals("alt recorder count", boost::dynamic_pointer_cast<TestRecorder>(altRecorder)->countMessages(), 1);
+ ensure_contains("alt recorder message 0", boost::dynamic_pointer_cast<TestRecorder>(altRecorder)->message(0), "boo");
LLError::setTimeFunction(roswell);
- TestRecorder* anotherRecorder(new TestRecorder);
- anotherRecorder->setWantsTime(true);
+ LLError::RecorderPtr anotherRecorder(new TestRecorder());
+ boost::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->setWantsTime(true);
LLError::addRecorder(anotherRecorder);
- llinfos << "baz" << llendl;
+ LL_INFOS() << "baz" << LL_ENDL;
std::string when = roswell();
ensure_message_does_not_contain(1, when);
- ensure_equals("alt recorder count", altRecorder->countMessages(), 2);
- ensure_does_not_contain("alt recorder message 1", altRecorder->message(1), when);
- ensure_equals("another recorder count", anotherRecorder->countMessages(), 1);
- ensure_contains("another recorder message 0", anotherRecorder->message(0), when);
+ ensure_equals("alt recorder count", boost::dynamic_pointer_cast<TestRecorder>(altRecorder)->countMessages(), 2);
+ ensure_does_not_contain("alt recorder message 1", boost::dynamic_pointer_cast<TestRecorder>(altRecorder)->message(1), when);
+ ensure_equals("another recorder count", boost::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->countMessages(), 1);
+ ensure_contains("another recorder message 0", boost::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->message(0), when);
+
+ LLError::removeRecorder(altRecorder);
+ LLError::removeRecorder(anotherRecorder);
}
}
@@ -590,10 +608,10 @@ class TestAlpha
{
LOG_CLASS(TestAlpha);
public:
- static void doDebug() { lldebugs << "add dice" << llendl; }
- static void doInfo() { llinfos << "any idea" << llendl; }
- static void doWarn() { llwarns << "aim west" << llendl; }
- static void doError() { llerrs << "ate eels" << llendl; }
+ static void doDebug() { LL_DEBUGS() << "add dice" << LL_ENDL; }
+ static void doInfo() { LL_INFOS() << "any idea" << LL_ENDL; }
+ static void doWarn() { LL_WARNS() << "aim west" << LL_ENDL; }
+ static void doError() { LL_ERRS() << "ate eels" << LL_ENDL; }
static void doAll() { doDebug(); doInfo(); doWarn(); doError(); }
};
@@ -601,10 +619,10 @@ class TestBeta
{
LOG_CLASS(TestBeta);
public:
- static void doDebug() { lldebugs << "bed down" << llendl; }
- static void doInfo() { llinfos << "buy iron" << llendl; }
- static void doWarn() { llwarns << "bad word" << llendl; }
- static void doError() { llerrs << "big easy" << llendl; }
+ static void doDebug() { LL_DEBUGS() << "bed down" << LL_ENDL; }
+ static void doInfo() { LL_INFOS() << "buy iron" << LL_ENDL; }
+ static void doWarn() { LL_WARNS() << "bad word" << LL_ENDL; }
+ static void doError() { LL_ERRS() << "big easy" << LL_ENDL; }
static void doAll() { doDebug(); doInfo(); doWarn(); doError(); }
};
diff --git a/indra/llcommon/tests/lleventcoro_test.cpp b/indra/llcommon/tests/lleventcoro_test.cpp
index 5ebde1a31d..cb5e15eff2 100755
--- a/indra/llcommon/tests/lleventcoro_test.cpp
+++ b/indra/llcommon/tests/lleventcoro_test.cpp
@@ -346,13 +346,13 @@ namespace tut
LLCoroEventPumps waiter;
replyName = waiter.getName0();
errorName = waiter.getName1();
- WrapLL_ERRS capture;
+ WrapLLErrs capture;
try
{
result = waiter.waitWithLog(self);
debug("no exception");
}
- catch (const WrapLL_ERRS::FatalException& e)
+ catch (const WrapLLErrs::FatalException& e)
{
debug(STRINGIZE("exception " << e.what()));
threw = e.what();
@@ -436,7 +436,7 @@ namespace tut
BEGIN
{
LLCoroEventPumps waiter;
- WrapLL_ERRS capture;
+ WrapLLErrs capture;
try
{
result = waiter.postAndWaitWithLog(self,
@@ -444,7 +444,7 @@ namespace tut
immediateAPI.getPump(), "reply", "error");
debug("no exception");
}
- catch (const WrapLL_ERRS::FatalException& e)
+ catch (const WrapLLErrs::FatalException& e)
{
debug(STRINGIZE("exception " << e.what()));
threw = e.what();
diff --git a/indra/llcommon/tests/lleventdispatcher_test.cpp b/indra/llcommon/tests/lleventdispatcher_test.cpp
index 263c9b171f..5a4df81bf1 100755
--- a/indra/llcommon/tests/lleventdispatcher_test.cpp
+++ b/indra/llcommon/tests/lleventdispatcher_test.cpp
@@ -312,7 +312,7 @@ namespace tut
{
struct lleventdispatcher_data
{
- WrapLL_ERRS redirect;
+ WrapLLErrs redirect;
Dispatcher work;
Vars v;
std::string name, desc;
diff --git a/indra/llcommon/tests/lleventfilter_test.cpp b/indra/llcommon/tests/lleventfilter_test.cpp
index ca05ef62a9..2cdfb52f2f 100755
--- a/indra/llcommon/tests/lleventfilter_test.cpp
+++ b/indra/llcommon/tests/lleventfilter_test.cpp
@@ -244,7 +244,7 @@ namespace tut
void filter_object::test<4>()
{
set_test_name("LLEventTimeout::errorAfter()");
- WrapLL_ERRS capture;
+ WrapLLErrs capture;
LLEventPump& driver(pumps.obtain("driver"));
TestEventTimeout filter(driver);
listener0.reset(0);
@@ -274,7 +274,7 @@ namespace tut
{
mainloop.post(17);
}
- catch (const WrapLL_ERRS::FatalException& e)
+ catch (const WrapLLErrs::FatalException& e)
{
threw = e.what();
}
diff --git a/indra/llcommon/tests/llinstancetracker_test.cpp b/indra/llcommon/tests/llinstancetracker_test.cpp
index e769c3e22c..c7d4b8a06b 100755
--- a/indra/llcommon/tests/llinstancetracker_test.cpp
+++ b/indra/llcommon/tests/llinstancetracker_test.cpp
@@ -194,15 +194,15 @@ namespace tut
{
set_test_name("delete Keyed with outstanding instance_iter");
std::string what;
- Keyed* keyed = new Keyed("one");
+ Keyed* keyed = new Keyed("delete Keyed with outstanding instance_iter");
{
- WrapLL_ERRS wrapper;
+ WrapLLErrs wrapper;
Keyed::instance_iter i(Keyed::beginInstances());
try
{
delete keyed;
}
- catch (const WrapLL_ERRS::FatalException& e)
+ catch (const WrapLLErrs::FatalException& e)
{
what = e.what();
}
@@ -215,15 +215,15 @@ namespace tut
{
set_test_name("delete Keyed with outstanding key_iter");
std::string what;
- Keyed* keyed = new Keyed("one");
+ Keyed* keyed = new Keyed("delete Keyed with outstanding key_it");
{
- WrapLL_ERRS wrapper;
+ WrapLLErrs wrapper;
Keyed::key_iter i(Keyed::beginKeys());
try
{
delete keyed;
}
- catch (const WrapLL_ERRS::FatalException& e)
+ catch (const WrapLLErrs::FatalException& e)
{
what = e.what();
}
@@ -238,13 +238,13 @@ namespace tut
std::string what;
Unkeyed* unkeyed = new Unkeyed;
{
- WrapLL_ERRS wrapper;
+ WrapLLErrs wrapper;
Unkeyed::instance_iter i(Unkeyed::beginInstances());
try
{
delete unkeyed;
}
- catch (const WrapLL_ERRS::FatalException& e)
+ catch (const WrapLLErrs::FatalException& e)
{
what = e.what();
}
diff --git a/indra/llcommon/tests/llleap_test.cpp b/indra/llcommon/tests/llleap_test.cpp
index 29060d4ef5..9ea822cb8d 100755
--- a/indra/llcommon/tests/llleap_test.cpp
+++ b/indra/llcommon/tests/llleap_test.cpp
@@ -22,7 +22,6 @@
// other Linden headers
#include "../test/lltut.h"
#include "../test/namedtempfile.h"
-#include "../test/manageapr.h"
#include "../test/catch_and_store_what_in.h"
#include "wrapllerrs.h"
#include "llevents.h"
@@ -33,8 +32,6 @@
using boost::assign::list_of;
-static ManageAPR manager;
-
StringVec sv(const StringVec& listof) { return listof; }
#if defined(LL_WINDOWS)
diff --git a/indra/llcommon/tests/llprocess_test.cpp b/indra/llcommon/tests/llprocess_test.cpp
index 3e68ef068e..e4e766d51b 100755
--- a/indra/llcommon/tests/llprocess_test.cpp
+++ b/indra/llcommon/tests/llprocess_test.cpp
@@ -29,7 +29,6 @@
//#include <boost/lambda/bind.hpp>
// other Linden headers
#include "../test/lltut.h"
-#include "../test/manageapr.h"
#include "../test/namedtempfile.h"
#include "../test/catch_and_store_what_in.h"
#include "stringize.h"
@@ -46,9 +45,12 @@
#endif
//namespace lambda = boost::lambda;
-
-// static instance of this manages APR init/cleanup
-static ManageAPR manager;
+ std::string apr_strerror_helper(apr_status_t rv)
+{
+ char errbuf[256];
+ apr_strerror(rv, errbuf, sizeof(errbuf));
+ return errbuf;
+}
/*****************************************************************************
* Helpers
@@ -60,7 +62,8 @@ static ManageAPR manager;
#define aprchk(expr) aprchk_(#expr, (expr))
static void aprchk_(const char* call, apr_status_t rv, apr_status_t expected=APR_SUCCESS)
{
- tut::ensure_equals(STRINGIZE(call << " => " << rv << ": " << manager.strerror(rv)),
+ tut::ensure_equals(STRINGIZE(call << " => " << rv << ": " << apr_strerror_helper
+ (rv)),
rv, expected);
}
diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp
index 4d436e8897..b5893135ea 100755
--- a/indra/llcommon/tests/llsdserialize_test.cpp
+++ b/indra/llcommon/tests/llsdserialize_test.cpp
@@ -56,12 +56,9 @@ namespace lambda = boost::lambda;
#include "../llformat.h"
#include "../test/lltut.h"
-#include "../test/manageapr.h"
#include "../test/namedtempfile.h"
#include "stringize.h"
-static ManageAPR manager;
-
std::vector<U8> string_to_vector(const std::string& str)
{
return std::vector<U8>(str.begin(), str.end());
@@ -268,7 +265,7 @@ namespace tut
{
std::stringstream stream;
mFormatter->format(v, stream);
- //llinfos << "checkRoundTrip: length " << stream.str().length() << llendl;
+ //LL_INFOS() << "checkRoundTrip: length " << stream.str().length() << LL_ENDL;
LLSD w;
mParser->reset(); // reset() call is needed since test code re-uses mParser
mParser->parse(stream, w, stream.str().size());
@@ -1723,5 +1720,6 @@ namespace tut
"This string\n"
"has several\n"
"lines.");
+
}
}
diff --git a/indra/llcommon/tests/lltrace_test.cpp b/indra/llcommon/tests/lltrace_test.cpp
new file mode 100644
index 0000000000..0a9d85ad00
--- /dev/null
+++ b/indra/llcommon/tests/lltrace_test.cpp
@@ -0,0 +1,142 @@
+/**
+ * @file llsingleton_test.cpp
+ * @date 2011-08-11
+ * @brief Unit test for the LLSingleton class
+ *
+ * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "linden_common.h"
+
+#include "lltrace.h"
+#include "lltracethreadrecorder.h"
+#include "lltracerecording.h"
+#include "../test/lltut.h"
+
+namespace LLUnits
+{
+ // using powers of 2 to allow strict floating point equality
+ LL_DECLARE_BASE_UNIT(Ounces, "oz");
+ LL_DECLARE_DERIVED_UNIT(TallCup, "", Ounces, / 12);
+ LL_DECLARE_DERIVED_UNIT(GrandeCup, "", Ounces, / 16);
+ LL_DECLARE_DERIVED_UNIT(VentiCup, "", Ounces, / 20);
+
+ LL_DECLARE_BASE_UNIT(Grams, "g");
+ LL_DECLARE_DERIVED_UNIT(Milligrams, "mg", Grams, * 1000);
+}
+
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Ounces);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, TallCup);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, GrandeCup);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, VentiCup);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Grams);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Milligrams);
+
+
+namespace tut
+{
+ using namespace LLTrace;
+ struct trace
+ {
+ ThreadRecorder mRecorder;
+ };
+
+ typedef test_group<trace> trace_t;
+ typedef trace_t::object trace_object_t;
+ tut::trace_t tut_singleton("LLTrace");
+
+ static CountStatHandle<S32> sCupsOfCoffeeConsumed("coffeeconsumed", "Delicious cup of dark roast.");
+ static SampleStatHandle<F32Milligrams> sCaffeineLevelStat("caffeinelevel", "Coffee buzz quotient");
+ static EventStatHandle<S32Ounces> sOuncesPerCup("cupsize", "Large, huge, or ginormous");
+
+ static F32 sCaffeineLevel(0.f);
+ const F32Milligrams sCaffeinePerOz(18.f);
+
+ void drink_coffee(S32 num_cups, S32Ounces cup_size)
+ {
+ add(sCupsOfCoffeeConsumed, num_cups);
+ for (S32 i = 0; i < num_cups; i++)
+ {
+ record(sOuncesPerCup, cup_size);
+ }
+
+ sCaffeineLevel += F32Ounces(num_cups * cup_size).value() * sCaffeinePerOz.value();
+ sample(sCaffeineLevelStat, sCaffeineLevel);
+ }
+
+ // basic data collection
+ template<> template<>
+ void trace_object_t::test<1>()
+ {
+ sample(sCaffeineLevelStat, sCaffeineLevel);
+
+ Recording all_day;
+ Recording at_work;
+ Recording after_3pm;
+
+ all_day.start();
+ {
+ // warm up with one grande cup
+ drink_coffee(1, S32TallCup(1));
+
+ // go to work
+ at_work.start();
+ {
+ // drink 3 tall cups, 1 after 3 pm
+ drink_coffee(2, S32GrandeCup(1));
+ after_3pm.start();
+ drink_coffee(1, S32GrandeCup(1));
+ }
+ at_work.stop();
+ drink_coffee(1, S32VentiCup(1));
+ }
+ // don't need to stop recordings to get accurate values out of them
+ //after_3pm.stop();
+ //all_day.stop();
+
+ ensure("count stats are counted when recording is active",
+ at_work.getSum(sCupsOfCoffeeConsumed) == 3
+ && all_day.getSum(sCupsOfCoffeeConsumed) == 5
+ && after_3pm.getSum(sCupsOfCoffeeConsumed) == 2);
+ ensure("measurement sums are counted when recording is active",
+ at_work.getSum(sOuncesPerCup) == S32Ounces(48)
+ && all_day.getSum(sOuncesPerCup) == S32Ounces(80)
+ && after_3pm.getSum(sOuncesPerCup) == S32Ounces(36));
+ ensure("measurement min is specific to when recording is active",
+ at_work.getMin(sOuncesPerCup) == S32GrandeCup(1)
+ && all_day.getMin(sOuncesPerCup) == S32TallCup(1)
+ && after_3pm.getMin(sOuncesPerCup) == S32GrandeCup(1));
+ ensure("measurement max is specific to when recording is active",
+ at_work.getMax(sOuncesPerCup) == S32GrandeCup(1)
+ && all_day.getMax(sOuncesPerCup) == S32VentiCup(1)
+ && after_3pm.getMax(sOuncesPerCup) == S32VentiCup(1));
+ ensure("sample min is specific to when recording is active",
+ at_work.getMin(sCaffeineLevelStat) == sCaffeinePerOz * ((S32Ounces)S32TallCup(1)).value()
+ && all_day.getMin(sCaffeineLevelStat) == F32Milligrams(0.f)
+ && after_3pm.getMin(sCaffeineLevelStat) == sCaffeinePerOz * ((S32Ounces)S32TallCup(1) + (S32Ounces)S32GrandeCup(2)).value());
+ ensure("sample max is specific to when recording is active",
+ at_work.getMax(sCaffeineLevelStat) == sCaffeinePerOz * ((S32Ounces)S32TallCup(1) + (S32Ounces)S32GrandeCup(3)).value()
+ && all_day.getMax(sCaffeineLevelStat) == sCaffeinePerOz * ((S32Ounces)S32TallCup(1) + (S32Ounces)S32GrandeCup(3) + (S32Ounces)S32VentiCup(1)).value()
+ && after_3pm.getMax(sCaffeineLevelStat) == sCaffeinePerOz * ((S32Ounces)S32TallCup(1) + (S32Ounces)S32GrandeCup(3) + (S32Ounces)S32VentiCup(1)).value());
+ }
+
+}
diff --git a/indra/llcommon/tests/llunits_test.cpp b/indra/llcommon/tests/llunits_test.cpp
new file mode 100644
index 0000000000..57cf9810af
--- /dev/null
+++ b/indra/llcommon/tests/llunits_test.cpp
@@ -0,0 +1,388 @@
+/**
+ * @file llsingleton_test.cpp
+ * @date 2011-08-11
+ * @brief Unit test for the LLSingleton class
+ *
+ * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2011, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "linden_common.h"
+
+#include "llunits.h"
+#include "../test/lltut.h"
+
+namespace LLUnits
+{
+ // using powers of 2 to allow strict floating point equality
+ LL_DECLARE_BASE_UNIT(Quatloos, "Quat");
+ LL_DECLARE_DERIVED_UNIT(Latinum, "Lat", Quatloos, / 4);
+ LL_DECLARE_DERIVED_UNIT(Solari, "Sol", Latinum, * 16);
+}
+
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Quatloos);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Latinum);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Solari);
+
+namespace LLUnits
+{
+ LL_DECLARE_BASE_UNIT(Celcius, "c");
+ LL_DECLARE_DERIVED_UNIT(Fahrenheit, "f", Celcius, * 9 / 5 + 32);
+ LL_DECLARE_DERIVED_UNIT(Kelvin, "k", Celcius, + 273.15f);
+}
+
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Celcius);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Fahrenheit);
+LL_DECLARE_UNIT_TYPEDEFS(LLUnits, Kelvin);
+
+
+namespace tut
+{
+ using namespace LLUnits;
+ struct units
+ {
+ };
+
+ typedef test_group<units> units_t;
+ typedef units_t::object units_object_t;
+ tut::units_t tut_singleton("LLUnit");
+
+ // storage type conversions
+ template<> template<>
+ void units_object_t::test<1>()
+ {
+ LLUnit<F32, Quatloos> float_quatloos;
+ ensure("default float unit is zero", float_quatloos == F32Quatloos(0.f));
+
+ LLUnit<F32, Quatloos> float_initialize_quatloos(1);
+ ensure("non-zero initialized unit", float_initialize_quatloos == F32Quatloos(1.f));
+
+ LLUnit<S32, Quatloos> int_quatloos;
+ ensure("default int unit is zero", int_quatloos == S32Quatloos(0));
+
+ int_quatloos = S32Quatloos(42);
+ ensure("int assignment is preserved", int_quatloos == S32Quatloos(42));
+ float_quatloos = int_quatloos;
+ ensure("float assignment from int preserves value", float_quatloos == F32Quatloos(42.f));
+
+ int_quatloos = float_quatloos;
+ ensure("int assignment from float preserves value", int_quatloos == S32Quatloos(42));
+
+ float_quatloos = F32Quatloos(42.1f);
+ int_quatloos = float_quatloos;
+ ensure("int units truncate float units on assignment", int_quatloos == S32Quatloos(42));
+
+ LLUnit<U32, Quatloos> unsigned_int_quatloos(float_quatloos);
+ ensure("unsigned int can be initialized from signed int", unsigned_int_quatloos == S32Quatloos(42));
+
+ S32Solari int_solari(1);
+
+ float_quatloos = int_solari;
+ ensure("fractional units are preserved in conversion from integer to float type", float_quatloos == F32Quatloos(0.25f));
+
+ int_quatloos = S32Quatloos(1);
+ F32Solari float_solari = int_quatloos;
+ ensure("can convert with fractional intermediates from integer to float type", float_solari == F32Solari(4.f));
+ }
+
+ // conversions to/from base unit
+ template<> template<>
+ void units_object_t::test<2>()
+ {
+ LLUnit<F32, Quatloos> quatloos(1.f);
+ LLUnit<F32, Latinum> latinum_bars(quatloos);
+ ensure("conversion between units is automatic via initialization", latinum_bars == F32Latinum(1.f / 4.f));
+
+ latinum_bars = S32Latinum(256);
+ quatloos = latinum_bars;
+ ensure("conversion between units is automatic via assignment, and bidirectional", quatloos == S32Quatloos(1024));
+
+ LLUnit<S32, Quatloos> single_quatloo(1);
+ LLUnit<F32, Latinum> quarter_latinum = single_quatloo;
+ ensure("division of integer unit preserves fractional values when converted to float unit", quarter_latinum == F32Latinum(0.25f));
+ }
+
+ // conversions across non-base units
+ template<> template<>
+ void units_object_t::test<3>()
+ {
+ LLUnit<F32, Quatloos> quatloos(1024);
+ LLUnit<F32, Solari> solari(quatloos);
+ ensure("conversions can work between indirectly related units: Quatloos -> Latinum -> Solari", solari == S32Solari(4096));
+
+ LLUnit<F32, Latinum> latinum_bars = solari;
+ ensure("Non base units can be converted between each other", latinum_bars == S32Latinum(256));
+ }
+
+ // math operations
+ template<> template<>
+ void units_object_t::test<4>()
+ {
+ // exercise math operations
+ LLUnit<F32, Quatloos> quatloos(1.f);
+ quatloos *= 4.f;
+ ensure(quatloos == S32Quatloos(4));
+ quatloos = quatloos * 2;
+ ensure(quatloos == S32Quatloos(8));
+ quatloos = 2.f * quatloos;
+ ensure(quatloos == S32Quatloos(16));
+
+ quatloos += F32Quatloos(4.f);
+ ensure(quatloos == S32Quatloos(20));
+ quatloos += S32Quatloos(4);
+ ensure(quatloos == S32Quatloos(24));
+ quatloos = quatloos + S32Quatloos(4);
+ ensure(quatloos == S32Quatloos(28));
+ quatloos = S32Quatloos(4) + quatloos;
+ ensure(quatloos == S32Quatloos(32));
+ quatloos += quatloos * 3;
+ ensure(quatloos == S32Quatloos(128));
+
+ quatloos -= quatloos / 4 * 3;
+ ensure(quatloos == S32Quatloos(32));
+ quatloos = quatloos - S32Quatloos(8);
+ ensure(quatloos == S32Quatloos(24));
+ quatloos -= S32Quatloos(4);
+ ensure(quatloos == S32Quatloos(20));
+ quatloos -= F32Quatloos(4.f);
+ ensure(quatloos == S32Quatloos(16));
+
+ quatloos /= 2.f;
+ ensure(quatloos == S32Quatloos(8));
+ quatloos = quatloos / 4;
+ ensure(quatloos == S32Quatloos(2));
+
+ F32 ratio = quatloos / LLUnit<F32, Quatloos>(2.f);
+ ensure(ratio == 1);
+ ratio = quatloos / LLUnit<F32, Solari>(8.f);
+ ensure(ratio == 1);
+
+ quatloos += LLUnit<F32, Solari>(8.f);
+ ensure(quatloos == S32Quatloos(4));
+ quatloos -= LLUnit<F32, Latinum>(1.f);
+ ensure(quatloos == S32Quatloos(0));
+ }
+
+ // comparison operators
+ template<> template<>
+ void units_object_t::test<5>()
+ {
+ LLUnit<S32, Quatloos> quatloos(1);
+ ensure("can perform less than comparison against same type", quatloos < S32Quatloos(2));
+ ensure("can perform less than comparison against different storage type", quatloos < F32Quatloos(2.f));
+ ensure("can perform less than comparison against different units", quatloos < S32Latinum(5));
+ ensure("can perform less than comparison against different storage type and units", quatloos < F32Latinum(5.f));
+
+ ensure("can perform greater than comparison against same type", quatloos > S32Quatloos(0));
+ ensure("can perform greater than comparison against different storage type", quatloos > F32Quatloos(0.f));
+ ensure("can perform greater than comparison against different units", quatloos > S32Latinum(0));
+ ensure("can perform greater than comparison against different storage type and units", quatloos > F32Latinum(0.f));
+
+ }
+
+ bool accept_explicit_quatloos(S32Quatloos q)
+ {
+ return true;
+ }
+
+ bool accept_implicit_quatloos(S32Quatloos q)
+ {
+ return true;
+ }
+
+ // signature compatibility
+ template<> template<>
+ void units_object_t::test<6>()
+ {
+ S32Quatloos quatloos(1);
+ ensure("can pass unit values as argument", accept_explicit_quatloos(S32Quatloos(1)));
+ ensure("can pass unit values as argument", accept_explicit_quatloos(quatloos));
+ }
+
+ // implicit units
+ template<> template<>
+ void units_object_t::test<7>()
+ {
+ LLUnit<F32, Quatloos> quatloos;
+ LLUnitImplicit<F32, Quatloos> quatloos_implicit = quatloos + S32Quatloos(1);
+ ensure("can initialize implicit unit from explicit", quatloos_implicit == 1);
+
+ quatloos = quatloos_implicit;
+ ensure("can assign implicit unit to explicit unit", quatloos == S32Quatloos(1));
+ quatloos += quatloos_implicit;
+ ensure("can perform math operation using mixture of implicit and explicit units", quatloos == S32Quatloos(2));
+
+ // math operations on implicits
+ quatloos_implicit = 1;
+ ensure(quatloos_implicit == 1);
+
+ quatloos_implicit += 2;
+ ensure(quatloos_implicit == 3);
+
+ quatloos_implicit *= 2;
+ ensure(quatloos_implicit == 6);
+
+ quatloos_implicit -= 1;
+ ensure(quatloos_implicit == 5);
+
+ quatloos_implicit /= 5;
+ ensure(quatloos_implicit == 1);
+
+ quatloos_implicit = quatloos_implicit + 3 + quatloos_implicit;
+ ensure(quatloos_implicit == 5);
+
+ quatloos_implicit = 10 - quatloos_implicit - 1;
+ ensure(quatloos_implicit == 4);
+
+ quatloos_implicit = 2 * quatloos_implicit * 2;
+ ensure(quatloos_implicit == 16);
+
+ F32 one_half = quatloos_implicit / (quatloos_implicit * 2);
+ ensure(one_half == 0.5f);
+
+ // implicit conversion to POD
+ F32 float_val = quatloos_implicit;
+ ensure("implicit units convert implicitly to regular values", float_val == 16);
+
+ S32 int_val = quatloos_implicit;
+ ensure("implicit units convert implicitly to regular values", int_val == 16);
+
+ // conversion of implicits
+ LLUnitImplicit<F32, Latinum> latinum_implicit(2);
+ ensure("implicit units of different types are comparable", latinum_implicit * 2 == quatloos_implicit);
+
+ quatloos_implicit += F32Quatloos(10);
+ ensure("can add-assign explicit units", quatloos_implicit == 26);
+
+ quatloos_implicit -= F32Quatloos(10);
+ ensure("can subtract-assign explicit units", quatloos_implicit == 16);
+
+ // comparisons
+ ensure("can compare greater than implicit unit", quatloos_implicit > F32QuatloosImplicit(0.f));
+ ensure("can compare greater than non-implicit unit", quatloos_implicit > F32Quatloos(0.f));
+ ensure("can compare greater than or equal to implicit unit", quatloos_implicit >= F32QuatloosImplicit(0.f));
+ ensure("can compare greater than or equal to non-implicit unit", quatloos_implicit >= F32Quatloos(0.f));
+ ensure("can compare less than implicit unit", quatloos_implicit < F32QuatloosImplicit(20.f));
+ ensure("can compare less than non-implicit unit", quatloos_implicit < F32Quatloos(20.f));
+ ensure("can compare less than or equal to implicit unit", quatloos_implicit <= F32QuatloosImplicit(20.f));
+ ensure("can compare less than or equal to non-implicit unit", quatloos_implicit <= F32Quatloos(20.f));
+ }
+
+ // precision tests
+ template<> template<>
+ void units_object_t::test<8>()
+ {
+ U32Bytes max_bytes(U32_MAX);
+ S32Megabytes mega_bytes = max_bytes;
+ ensure("max available precision is used when converting units", mega_bytes == (S32Megabytes)4095);
+
+ mega_bytes = (S32Megabytes)-5 + (U32Megabytes)1;
+ ensure("can mix signed and unsigned in units addition", mega_bytes == (S32Megabytes)-4);
+
+ mega_bytes = (U32Megabytes)5 + (S32Megabytes)-1;
+ ensure("can mix unsigned and signed in units addition", mega_bytes == (S32Megabytes)4);
+ }
+
+ // default units
+ template<> template<>
+ void units_object_t::test<9>()
+ {
+ U32Gigabytes GB(1);
+ U32Megabytes MB(GB);
+ U32Kilobytes KB(GB);
+ U32Bytes B(GB);
+
+ ensure("GB -> MB conversion", MB.value() == 1024);
+ ensure("GB -> KB conversion", KB.value() == 1024 * 1024);
+ ensure("GB -> B conversion", B.value() == 1024 * 1024 * 1024);
+
+ KB = U32Kilobytes(1);
+ U32Kilobits Kb(KB);
+ U32Bits b(KB);
+ ensure("KB -> Kb conversion", Kb.value() == 8);
+ ensure("KB -> b conversion", b.value() == 8 * 1024);
+
+ U32Days days(1);
+ U32Hours hours(days);
+ U32Minutes minutes(days);
+ U32Seconds seconds(days);
+ U32Milliseconds ms(days);
+
+ ensure("days -> hours conversion", hours.value() == 24);
+ ensure("days -> minutes conversion", minutes.value() == 24 * 60);
+ ensure("days -> seconds conversion", seconds.value() == 24 * 60 * 60);
+ ensure("days -> ms conversion", ms.value() == 24 * 60 * 60 * 1000);
+
+ U32Kilometers km(1);
+ U32Meters m(km);
+ U32Centimeters cm(km);
+ U32Millimeters mm(km);
+
+ ensure("km -> m conversion", m.value() == 1000);
+ ensure("km -> cm conversion", cm.value() == 1000 * 100);
+ ensure("km -> mm conversion", mm.value() == 1000 * 1000);
+
+ U32Gigahertz GHz(1);
+ U32Megahertz MHz(GHz);
+ U32Kilohertz KHz(GHz);
+ U32Hertz Hz(GHz);
+
+ ensure("GHz -> MHz conversion", MHz.value() == 1000);
+ ensure("GHz -> KHz conversion", KHz.value() == 1000 * 1000);
+ ensure("GHz -> Hz conversion", Hz.value() == 1000 * 1000 * 1000);
+
+ F32Radians rad(6.2831853071795f);
+ S32Degrees deg(rad);
+ ensure("radians -> degrees conversion", deg.value() == 360);
+
+ F32Percent percent(50);
+ F32Ratio ratio(percent);
+ ensure("percent -> ratio conversion", ratio.value() == 0.5f);
+
+ U32Kilotriangles ktris(1);
+ U32Triangles tris(ktris);
+ ensure("kilotriangles -> triangles conversion", tris.value() == 1000);
+ }
+
+ bool value_near(F32 value, F32 target, F32 threshold)
+ {
+ return fabsf(value - target) < threshold;
+ }
+
+ // linear transforms
+ template<> template<>
+ void units_object_t::test<10>()
+ {
+ F32Celcius float_celcius(100);
+ F32Fahrenheit float_fahrenheit(float_celcius);
+ ensure("floating point celcius -> fahrenheit conversion using linear transform", value_near(float_fahrenheit.value(), 212, 0.1f) );
+
+ float_celcius = float_fahrenheit;
+ ensure("floating point fahrenheit -> celcius conversion using linear transform (round trip)", value_near(float_celcius.value(), 100.f, 0.1f) );
+
+ S32Celcius int_celcius(100);
+ S32Fahrenheit int_fahrenheit(int_celcius);
+ ensure("integer celcius -> fahrenheit conversion using linear transform", int_fahrenheit.value() == 212);
+
+ int_celcius = int_fahrenheit;
+ ensure("integer fahrenheit -> celcius conversion using linear transform (round trip)", int_celcius.value() == 100);
+ }
+}
diff --git a/indra/llcommon/tests/reflection_test.cpp b/indra/llcommon/tests/reflection_test.cpp
deleted file mode 100755
index 8980ebb1f1..0000000000
--- a/indra/llcommon/tests/reflection_test.cpp
+++ /dev/null
@@ -1,220 +0,0 @@
-/**
- * @file reflection_test.cpp
- * @date May 2006
- * @brief Reflection unit tests.
- *
- * $LicenseInfo:firstyear=2006&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "../linden_common.h"
-#include "../reflective.h"
-#include "../metaclasst.h"
-#include "../metapropertyt.h"
-#include "../stdtypes.h"
-
-#include "../test/lltut.h"
-
-namespace tut
-{
- class TestAggregatedData : public LLReflective
- {
- public:
- TestAggregatedData() {;}
- virtual const LLMetaClass& getMetaClass() const;
-
- private:
- };
-
- class TestReflectionData : public LLReflective
- {
- public:
- TestReflectionData() : mInt(42), mString("foo"), mNullPtr(NULL), mPtr(new TestAggregatedData()), mRef(*(new TestAggregatedData)) {;}
- virtual ~TestReflectionData() {delete mPtr;}
- virtual const LLMetaClass& getMetaClass() const;
-
- static U32 getPropertyCount() {return 5;}
-
- private:
-
- friend class LLMetaClassT<TestReflectionData>;
- S32 mInt;
- std::string mString;
- TestAggregatedData* mNullPtr;
- TestAggregatedData* mPtr;
- TestAggregatedData mObj;
- TestAggregatedData& mRef;
- };
-}
-
-template <>
-void LLMetaClassT<tut::TestReflectionData>::reflectProperties(LLMetaClass& meta_class)
-{
- reflectProperty(meta_class, "mInt", &tut::TestReflectionData::mInt);
- reflectProperty(meta_class, "mString", &tut::TestReflectionData::mString);
- reflectPtrProperty(meta_class, "mNullPtr", &tut::TestReflectionData::mNullPtr);
- reflectPtrProperty(meta_class, "mPtr", &tut::TestReflectionData::mPtr);
- reflectProperty(meta_class, "mObj", &tut::TestReflectionData::mObj);
- //reflectProperty(meta_class, "mRef", &tut::TestReflectionData::mRef); // AARGH!
-}
-
-namespace tut
-{
- // virtual
- const LLMetaClass& TestReflectionData::getMetaClass() const
- {
- return LLMetaClassT<TestReflectionData>::instance();
- }
-
- const LLMetaClass& TestAggregatedData::getMetaClass() const
- {
- return LLMetaClassT<TestAggregatedData>::instance();
- }
-}
-
-namespace tut
-{
- typedef tut::test_group<TestReflectionData> TestReflectionGroup;
- typedef TestReflectionGroup::object TestReflectionObject;
- TestReflectionGroup gTestReflectionGroup("reflection");
-
- template<> template<>
- void TestReflectionObject::test<1>()
- {
- // Check properties can be found.
- const LLMetaClass& meta_class = LLMetaClassT<TestReflectionData>::instance();
- const LLMetaProperty* null = NULL;
- ensure_not_equals(meta_class.findProperty("mInt"), null);
- ensure_not_equals(meta_class.findProperty("mString"), null);
- }
-
- template<> template<>
- void TestReflectionObject::test<2>()
- {
- // Check non-existent property cannot be found.
- const LLMetaClass& meta_class = LLMetaClassT<TestReflectionData>::instance();
- const LLMetaProperty* null = NULL;
- ensure_equals(meta_class.findProperty("foo"), null);
- }
-
- template<> template<>
- void TestReflectionObject::test<3>()
- {
- // Check integer property has correct value.
- const LLMetaClass& meta_class = LLMetaClassT<TestReflectionData>::instance();
- ensure_equals(meta_class.findProperty("mInt")->getLLSD(this).asInteger(), 42);
- }
-
- template<> template<>
- void TestReflectionObject::test<4>()
- {
- // Check string property has correct value.
- const LLMetaClass& meta_class = LLMetaClassT<TestReflectionData>::instance();
- ensure_equals(meta_class.findProperty("mString")->getLLSD(this).asString(), std::string("foo"));
- }
-
- template<> template<>
- void TestReflectionObject::test<5>()
- {
- // Check NULL reference property has correct value.
- const LLMetaClass& meta_class = LLMetaClassT<TestReflectionData>::instance();
- const LLReflective* null = NULL;
- ensure_equals(meta_class.findProperty("mNullPtr")->get(this), null);
- }
-
- template<> template<>
- void TestReflectionObject::test<6>()
- {
- // Check reference property has correct value.
- const LLMetaClass& meta_class = LLMetaClassT<TestReflectionData>::instance();
- const LLReflective* null = NULL;
- const LLReflective* ref = meta_class.findProperty("mPtr")->get(this);
- ensure_not_equals(ref, null);
- }
-
- template<> template<>
- void TestReflectionObject::test<7>()
- {
- // Check reflective property has correct value.
- const LLMetaClass& meta_class = LLMetaClassT<TestReflectionData>::instance();
- const LLReflective* null = NULL;
- const LLReflective* ref = meta_class.findProperty("mObj")->get(this);
- ensure_not_equals(ref, null);
- }
-
- template<> template<>
- void TestReflectionObject::test<8>()
- {
- // Check property count.
- const LLMetaClass& meta_class = LLMetaClassT<TestReflectionData>::instance();
- ensure_equals(meta_class.getPropertyCount(), TestReflectionData::getPropertyCount());
- }
-
- template<> template<>
- void TestReflectionObject::test<9>()
- {
- // Check property iteration.
- const LLMetaClass& meta_class = LLMetaClassT<TestReflectionData>::instance();
- U32 count = 0;
- LLMetaClass::PropertyIterator iter;
- for(iter = meta_class.beginProperties(); iter != meta_class.endProperties(); ++iter)
- {
- ++count;
- }
- ensure_equals(count, TestReflectionData::getPropertyCount());
- }
-
- template<> template<>
- void TestReflectionObject::test<10>()
- {
- // Check meta classes of different types do not compare equal.
- const LLMetaClass* reflection_data_meta_class = &(LLMetaClassT<TestReflectionData>::instance());
- const LLMetaClass* aggregated_data_meta_class = &(LLMetaClassT<TestAggregatedData>::instance());
- ensure_not_equals(reflection_data_meta_class, aggregated_data_meta_class);
- }
-
- template<> template<>
- void TestReflectionObject::test<11>()
- {
- // Check class cast checks.
- const LLMetaClass& meta_class = LLMetaClassT<TestReflectionData>::instance();
- TestAggregatedData* aggregated_data = new TestAggregatedData();
- LLMetaClass::PropertyIterator iter;
- U32 exception_count = 0;
- for(iter = meta_class.beginProperties(); iter != meta_class.endProperties(); ++iter)
- {
- try
- {
- const LLMetaProperty* property = (*iter).second;
- const LLReflective* reflective = property->get(aggregated_data); // Wrong reflective type, should throw exception.
-
- // useless op to get rid of compiler warning.
- reflective = reflective;
- }
- catch(...)
- {
- ++exception_count;
- }
- }
- ensure_equals(exception_count, getPropertyCount());
-
- }
-}
diff --git a/indra/llcommon/tests/stringize_test.cpp b/indra/llcommon/tests/stringize_test.cpp
index 3e4ca548e5..2a4ed44a67 100755
--- a/indra/llcommon/tests/stringize_test.cpp
+++ b/indra/llcommon/tests/stringize_test.cpp
@@ -95,7 +95,7 @@ namespace tut
ensure_equals(stringize(f), "3.14159");
ensure_equals(stringize(d), "3.14159");
ensure_equals(stringize(abc), "abc def");
- ensure_equals(stringize(def), "def ghi"); //Will generate llwarns due to narrowing.
+ ensure_equals(stringize(def), "def ghi"); //Will generate LL_WARNS() due to narrowing.
ensure_equals(stringize(llsd), "{'abc':'abc def','d':r3.14159,'i':i34}");
}
diff --git a/indra/llcommon/tests/wrapllerrs.h b/indra/llcommon/tests/wrapllerrs.h
index a4d3a4e026..785197ba11 100755
--- a/indra/llcommon/tests/wrapllerrs.h
+++ b/indra/llcommon/tests/wrapllerrs.h
@@ -38,6 +38,7 @@
#include "stringize.h"
#include <boost/bind.hpp>
#include <boost/noncopyable.hpp>
+#include <boost/shared_ptr.hpp>
#include <list>
#include <string>
#include <stdexcept>
@@ -46,9 +47,9 @@
// replicate, but better to reuse
extern void wouldHaveCrashed(const std::string& message);
-struct WrapLL_ERRS
+struct WrapLLErrs
{
- WrapLL_ERRS():
+ WrapLLErrs():
// Resetting Settings discards the default Recorder that writes to
// stderr. Otherwise, expected llerrs (LL_ERRS) messages clutter the
// console output of successful tests, potentially confusing things.
@@ -57,10 +58,10 @@ struct WrapLL_ERRS
mPriorFatal(LLError::getFatalFunction())
{
// Make LL_ERRS call our own operator() method
- LLError::setFatalFunction(boost::bind(&WrapLL_ERRS::operator(), this, _1));
+ LLError::setFatalFunction(boost::bind(&WrapLLErrs::operator(), this, _1));
}
- ~WrapLL_ERRS()
+ ~WrapLLErrs()
{
LLError::setFatalFunction(mPriorFatal);
LLError::restoreSettings(mPriorErrorSettings);
@@ -81,72 +82,29 @@ struct WrapLL_ERRS
}
std::string error;
- LLError::Settings* mPriorErrorSettings;
+ LLError::SettingsStoragePtr mPriorErrorSettings;
LLError::FatalFunction mPriorFatal;
};
/**
- * LLError::addRecorder() accepts ownership of the passed Recorder* -- it
- * expects to be able to delete it later. CaptureLog isa Recorder whose
- * pointer we want to be able to pass without any ownership implications.
- * For such cases, instantiate a new RecorderProxy(yourRecorder) and pass
- * that. Your heap RecorderProxy might later be deleted, but not yourRecorder.
- */
-class RecorderProxy: public LLError::Recorder
-{
-public:
- RecorderProxy(LLError::Recorder* recorder):
- mRecorder(recorder)
- {}
-
- virtual void recordMessage(LLError::ELevel level, const std::string& message)
- {
- mRecorder->recordMessage(level, message);
- }
-
- virtual bool wantsTime()
- {
- return mRecorder->wantsTime();
- }
-
-private:
- LLError::Recorder* mRecorder;
-};
-
-/**
* Capture log messages. This is adapted (simplified) from the one in
* llerror_test.cpp.
*/
-class CaptureLog : public LLError::Recorder, public boost::noncopyable
+class CaptureLogRecorder : public LLError::Recorder, public boost::noncopyable
{
public:
- CaptureLog(LLError::ELevel level=LLError::LEVEL_DEBUG):
- // Mostly what we're trying to accomplish by saving and resetting
- // LLError::Settings is to bypass the default RecordToStderr and
- // RecordToWinDebug Recorders. As these are visible only inside
- // llerror.cpp, we can't just call LLError::removeRecorder() with
- // each. For certain tests we need to produce, capture and examine
- // DEBUG log messages -- but we don't want to spam the user's console
- // with that output. If it turns out that saveAndResetSettings() has
- // some bad effect, give up and just let the DEBUG level log messages
- // display.
- mOldSettings(LLError::saveAndResetSettings()),
- mProxy(new RecorderProxy(this))
+ CaptureLogRecorder()
+ : LLError::Recorder(),
+ boost::noncopyable(),
+ mMessages()
{
- LLError::setFatalFunction(wouldHaveCrashed);
- LLError::setDefaultLevel(level);
- LLError::addRecorder(mProxy);
}
- ~CaptureLog()
+ virtual ~CaptureLogRecorder()
{
- LLError::removeRecorder(mProxy);
- delete mProxy;
- LLError::restoreSettings(mOldSettings);
}
- void recordMessage(LLError::ELevel level,
- const std::string& message)
+ virtual void recordMessage(LLError::ELevel level, const std::string& message)
{
mMessages.push_back(message);
}
@@ -154,7 +112,7 @@ public:
/// Don't assume the message we want is necessarily the LAST log message
/// emitted by the underlying code; search backwards through all messages
/// for the sought string.
- std::string messageWith(const std::string& search, bool required=true)
+ std::string messageWith(const std::string& search, bool required)
{
for (MessageList::const_reverse_iterator rmi(mMessages.rbegin()), rmend(mMessages.rend());
rmi != rmend; ++rmi)
@@ -187,14 +145,63 @@ public:
return out;
}
+private:
typedef std::list<std::string> MessageList;
MessageList mMessages;
- LLError::Settings* mOldSettings;
- LLError::Recorder* mProxy;
+};
+
+/**
+ * Capture log messages. This is adapted (simplified) from the one in
+ * llerror_test.cpp.
+ */
+class CaptureLog : public boost::noncopyable
+{
+public:
+ CaptureLog(LLError::ELevel level=LLError::LEVEL_DEBUG)
+ // Mostly what we're trying to accomplish by saving and resetting
+ // LLError::Settings is to bypass the default RecordToStderr and
+ // RecordToWinDebug Recorders. As these are visible only inside
+ // llerror.cpp, we can't just call LLError::removeRecorder() with
+ // each. For certain tests we need to produce, capture and examine
+ // DEBUG log messages -- but we don't want to spam the user's console
+ // with that output. If it turns out that saveAndResetSettings() has
+ // some bad effect, give up and just let the DEBUG level log messages
+ // display.
+ : boost::noncopyable(),
+ mOldSettings(LLError::saveAndResetSettings()),
+ mRecorder(new CaptureLogRecorder())
+ {
+ LLError::setFatalFunction(wouldHaveCrashed);
+ LLError::setDefaultLevel(level);
+ LLError::addRecorder(mRecorder);
+ }
+
+ ~CaptureLog()
+ {
+ LLError::removeRecorder(mRecorder);
+ LLError::restoreSettings(mOldSettings);
+ }
+
+ /// Don't assume the message we want is necessarily the LAST log message
+ /// emitted by the underlying code; search backwards through all messages
+ /// for the sought string.
+ std::string messageWith(const std::string& search, bool required=true)
+ {
+ return boost::dynamic_pointer_cast<CaptureLogRecorder>(mRecorder)->messageWith(search, required);
+ }
+
+ std::ostream& streamto(std::ostream& out) const
+ {
+ return boost::dynamic_pointer_cast<CaptureLogRecorder>(mRecorder)->streamto(out);
+ }
+
+private:
+ LLError::SettingsStoragePtr mOldSettings;
+ LLError::RecorderPtr mRecorder;
};
inline
-std::ostream& operator<<(std::ostream& out, const CaptureLog& log)
+std::ostream& operator<<(std::ostream& out, const CaptureLogRecorder& log)
{
return log.streamto(out);
}
diff --git a/indra/llcommon/u64.cpp b/indra/llcommon/u64.cpp
index eea16c5036..02c2c15d26 100755
--- a/indra/llcommon/u64.cpp
+++ b/indra/llcommon/u64.cpp
@@ -36,7 +36,7 @@ U64 str_to_U64(const std::string& str)
if (!aptr)
{
- llwarns << "str_to_U64: Bad string to U64 conversion attempt: format\n" << llendl;
+ LL_WARNS() << "str_to_U64: Bad string to U64 conversion attempt: format\n" << LL_ENDL;
}
else
{
diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt
index 9adfd0ed62..a0b1ea13b1 100755
--- a/indra/llcorehttp/CMakeLists.txt
+++ b/indra/llcorehttp/CMakeLists.txt
@@ -174,7 +174,7 @@ if (LL_TESTS)
# The following come from LLAddBuildTest.cmake's INTEGRATION_TEST_xxxx target.
set_target_properties(http_texture_load
PROPERTIES
- LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS ${TCMALLOC_LINK_FLAGS}"
+ LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:CONSOLE ${TCMALLOC_LINK_FLAGS}"
LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO"
LINK_FLAGS_RELEASE ""
)
diff --git a/indra/llcorehttp/_httplibcurl.cpp b/indra/llcorehttp/_httplibcurl.cpp
index fc257fb0c1..e56bc84174 100755
--- a/indra/llcorehttp/_httplibcurl.cpp
+++ b/indra/llcorehttp/_httplibcurl.cpp
@@ -31,7 +31,7 @@
#include "_httpoprequest.h"
#include "_httppolicy.h"
-#include "llhttpstatuscodes.h"
+#include "llhttpconstants.h"
namespace LLCore
diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp
index 926031501e..43dd069bc6 100755
--- a/indra/llcorehttp/_httpoprequest.cpp
+++ b/indra/llcorehttp/_httpoprequest.cpp
@@ -44,7 +44,7 @@
#include "_httplibcurl.h"
#include "_httpinternal.h"
-#include "llhttpstatuscodes.h"
+#include "llhttpconstants.h"
#include "llproxy.h"
namespace
@@ -531,6 +531,7 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service)
code = curl_easy_setopt(mCurlHandle, CURLOPT_POSTFIELDS, (void *) NULL);
check_curl_easy_code(code, CURLOPT_POSTFIELDS);
mCurlHeaders = curl_slist_append(mCurlHeaders, "Expect:");
+ // *TODO: Should this be 'Keep-Alive' ?
mCurlHeaders = curl_slist_append(mCurlHeaders, "Connection: keep-alive");
mCurlHeaders = curl_slist_append(mCurlHeaders, "Keep-alive: 300");
}
diff --git a/indra/llcorehttp/_refcounted.h b/indra/llcorehttp/_refcounted.h
index 21a916b13b..402e725152 100755
--- a/indra/llcorehttp/_refcounted.h
+++ b/indra/llcorehttp/_refcounted.h
@@ -72,7 +72,7 @@ private:
inline void RefCounted::addRef() const
{
- S32 count(mRefCount++);
+ S32 count(++mRefCount);
llassert_always(count >= 0);
}
@@ -82,7 +82,7 @@ inline void RefCounted::release() const
S32 count(mRefCount);
llassert_always(count != NOT_REF_COUNTED);
llassert_always(count > 0);
- count = mRefCount--;
+ count = --mRefCount;
// clean ourselves up if that was the last reference
if (0 == count)
diff --git a/indra/llcrashlogger/llcrashlock.cpp b/indra/llcrashlogger/llcrashlock.cpp
index c3d2f944fc..7fd7860707 100644
--- a/indra/llcrashlogger/llcrashlock.cpp
+++ b/indra/llcrashlogger/llcrashlock.cpp
@@ -31,7 +31,6 @@
#include "lldir.h"
#include "llsd.h"
#include "llsdserialize.h"
-#include "llnametable.h"
#include "llframetimer.h"
#include <boost/filesystem.hpp>
#include <string>
@@ -40,15 +39,9 @@
#if LL_WINDOWS //For windows platform.
-#include <windows.h>
+#include <llwin32headers.h>
#include <TlHelp32.h>
-namespace {
- inline DWORD getpid() {
- return GetCurrentProcessId();
- }
-}
-
bool LLCrashLock::isProcessAlive(U32 pid, const std::string& pname)
{
std::wstring wpname;
diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp
index 38858a1a91..7a97c16ea7 100755
--- a/indra/llcrashlogger/llcrashlogger.cpp
+++ b/indra/llcrashlogger/llcrashlogger.cpp
@@ -52,17 +52,20 @@ BOOL gSent = false;
class LLCrashLoggerResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(LLCrashLoggerResponder);
public:
LLCrashLoggerResponder()
{
}
- virtual void error(U32 status, const std::string& reason)
+protected:
+ virtual void httpFailure()
{
+ LL_WARNS() << dumpResponse() << LL_ENDL;
gBreak = true;
}
- virtual void result(const LLSD& content)
+ virtual void httpSuccess()
{
gBreak = true;
gSent = true;
@@ -211,8 +214,8 @@ void LLCrashLogger::gatherFiles()
LLCurl::setCAFile(gDirUtilp->getCAFile());
}
- llinfos << "Using log file from debug log " << mFileMap["SecondLifeLog"] << llendl;
- llinfos << "Using settings file from debug log " << mFileMap["SettingsXml"] << llendl;
+ LL_INFOS() << "Using log file from debug log " << mFileMap["SecondLifeLog"] << LL_ENDL;
+ LL_INFOS() << "Using settings file from debug log " << mFileMap["SettingsXml"] << LL_ENDL;
}
else
{
@@ -491,7 +494,7 @@ bool LLCrashLogger::sendCrashLogs()
}
else
{
- llwarns << "Discarding corrupted entry from lock table." << llendl;
+ LL_WARNS() << "Discarding corrupted entry from lock table." << LL_ENDL;
}
}
}
@@ -509,7 +512,7 @@ void LLCrashLogger::updateApplication(const std::string& message)
{
gServicePump->pump();
gServicePump->callback();
- if (!message.empty()) llinfos << message << llendl;
+ if (!message.empty()) LL_INFOS() << message << LL_ENDL;
}
bool LLCrashLogger::init()
@@ -563,13 +566,13 @@ bool LLCrashLogger::init()
"1 = always send crash report, "
"2 = never send crash report)");
- // llinfos << "Loading crash behavior setting" << llendl;
+ // LL_INFOS() << "Loading crash behavior setting" << LL_ENDL;
// mCrashBehavior = loadCrashBehaviorSetting();
// If user doesn't want to send, bail out
if (mCrashBehavior == CRASH_BEHAVIOR_NEVER_SEND)
{
- llinfos << "Crash behavior is never_send, quitting" << llendl;
+ LL_INFOS() << "Crash behavior is never_send, quitting" << LL_ENDL;
return false;
}
diff --git a/indra/llcrashlogger/llcrashlogger.h b/indra/llcrashlogger/llcrashlogger.h
index 78acc63b6a..a06bf1d6ac 100755
--- a/indra/llcrashlogger/llcrashlogger.h
+++ b/indra/llcrashlogger/llcrashlogger.h
@@ -35,6 +35,11 @@
#include "llcontrol.h"
#include "llcrashlock.h"
+// Crash reporter behavior
+const S32 CRASH_BEHAVIOR_ASK = 0;
+const S32 CRASH_BEHAVIOR_ALWAYS_SEND = 1;
+const S32 CRASH_BEHAVIOR_NEVER_SEND = 2;
+
class LLCrashLogger : public LLApp
{
public:
diff --git a/indra/llimage/CMakeLists.txt b/indra/llimage/CMakeLists.txt
index e837b0cac2..293ada7548 100755
--- a/indra/llimage/CMakeLists.txt
+++ b/indra/llimage/CMakeLists.txt
@@ -27,6 +27,7 @@ set(llimage_SOURCE_FILES
llimage.cpp
llimagedimensionsinfo.cpp
llimagedxt.cpp
+ llimagefilter.cpp
llimagej2c.cpp
llimagejpeg.cpp
llimagepng.cpp
@@ -42,6 +43,7 @@ set(llimage_HEADER_FILES
llimagebmp.h
llimagedimensionsinfo.h
llimagedxt.h
+ llimagefilter.h
llimagej2c.h
llimagejpeg.h
llimagepng.h
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index c8a05e1fae..d336eeaabc 100755
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
@@ -26,6 +26,7 @@
#include "linden_common.h"
+#include "llimageworker.h"
#include "llimage.h"
#include "llmath.h"
@@ -37,7 +38,6 @@
#include "llimagejpeg.h"
#include "llimagepng.h"
#include "llimagedxt.h"
-#include "llimageworker.h"
#include "llmemory.h"
//---------------------------------------------------------------------------
@@ -89,15 +89,15 @@ void LLImage::setLastError(const std::string& message)
//---------------------------------------------------------------------------
LLImageBase::LLImageBase()
- : mData(NULL),
- mDataSize(0),
- mWidth(0),
- mHeight(0),
- mComponents(0),
- mBadBufferAllocation(false),
- mAllowOverSize(false)
-{
-}
+: LLTrace::MemTrackable<LLImageBase>("LLImage"),
+ mData(NULL),
+ mDataSize(0),
+ mWidth(0),
+ mHeight(0),
+ mComponents(0),
+ mBadBufferAllocation(false),
+ mAllowOverSize(false)
+{}
// virtual
LLImageBase::~LLImageBase()
@@ -127,12 +127,12 @@ void LLImageBase::destroyPrivatePool()
// virtual
void LLImageBase::dump()
{
- llinfos << "LLImageBase mComponents " << mComponents
+ LL_INFOS() << "LLImageBase mComponents " << mComponents
<< " mData " << mData
<< " mDataSize " << mDataSize
<< " mWidth " << mWidth
<< " mHeight " << mHeight
- << llendl;
+ << LL_ENDL;
}
// virtual
@@ -144,13 +144,13 @@ void LLImageBase::sanityCheck()
|| mComponents > (S8)MAX_IMAGE_COMPONENTS
)
{
- llerrs << "Failed LLImageBase::sanityCheck "
+ LL_ERRS() << "Failed LLImageBase::sanityCheck "
<< "width " << mWidth
<< "height " << mHeight
<< "datasize " << mDataSize
<< "components " << mComponents
<< "data " << mData
- << llendl;
+ << LL_ENDL;
}
}
@@ -158,8 +158,9 @@ void LLImageBase::sanityCheck()
void LLImageBase::deleteData()
{
FREE_MEM(sPrivatePoolp, mData) ;
- mData = NULL;
+ disclaimMem(mDataSize);
mDataSize = 0;
+ mData = NULL;
}
// virtual
@@ -170,7 +171,7 @@ U8* LLImageBase::allocateData(S32 size)
size = mWidth * mHeight * mComponents;
if (size <= 0)
{
- llerrs << llformat("LLImageBase::allocateData called with bad dimensions: %dx%dx%d",mWidth,mHeight,(S32)mComponents) << llendl;
+ LL_ERRS() << llformat("LLImageBase::allocateData called with bad dimensions: %dx%dx%d",mWidth,mHeight,(S32)mComponents) << LL_ENDL;
}
}
@@ -178,14 +179,14 @@ U8* LLImageBase::allocateData(S32 size)
static const U32 MAX_BUFFER_SIZE = 4096 * 4096 * 16 ; //256 MB
if (size < 1 || size > MAX_BUFFER_SIZE)
{
- llinfos << "width: " << mWidth << " height: " << mHeight << " components: " << mComponents << llendl ;
+ LL_INFOS() << "width: " << mWidth << " height: " << mHeight << " components: " << mComponents << LL_ENDL ;
if(mAllowOverSize)
{
- llinfos << "Oversize: " << size << llendl ;
+ LL_INFOS() << "Oversize: " << size << LL_ENDL ;
}
else
{
- llerrs << "LLImageBase::allocateData: bad size: " << size << llendl;
+ LL_ERRS() << "LLImageBase::allocateData: bad size: " << size << LL_ENDL;
}
}
if (!mData || size != mDataSize)
@@ -195,12 +196,13 @@ U8* LLImageBase::allocateData(S32 size)
mData = (U8*)ALLOCATE_MEM(sPrivatePoolp, size);
if (!mData)
{
- llwarns << "Failed to allocate image data size [" << size << "]" << llendl;
+ LL_WARNS() << "Failed to allocate image data size [" << size << "]" << LL_ENDL;
size = 0 ;
mWidth = mHeight = 0 ;
mBadBufferAllocation = true ;
}
mDataSize = size;
+ claimMem(mDataSize);
}
return mData;
@@ -212,7 +214,7 @@ U8* LLImageBase::reallocateData(S32 size)
U8 *new_datap = (U8*)ALLOCATE_MEM(sPrivatePoolp, size);
if (!new_datap)
{
- llwarns << "Out of memory in LLImageBase::reallocateData" << llendl;
+ LL_WARNS() << "Out of memory in LLImageBase::reallocateData" << LL_ENDL;
return 0;
}
if (mData)
@@ -222,7 +224,9 @@ U8* LLImageBase::reallocateData(S32 size)
FREE_MEM(sPrivatePoolp, mData) ;
}
mData = new_datap;
+ disclaimMem(mDataSize);
mDataSize = size;
+ claimMem(mDataSize);
return mData;
}
@@ -230,7 +234,7 @@ const U8* LLImageBase::getData() const
{
if(mBadBufferAllocation)
{
- llerrs << "Bad memory allocation for the image buffer!" << llendl ;
+ LL_ERRS() << "Bad memory allocation for the image buffer!" << LL_ENDL ;
}
return mData;
@@ -240,7 +244,7 @@ U8* LLImageBase::getData()
{
if(mBadBufferAllocation)
{
- llerrs << "Bad memory allocation for the image buffer!" << llendl ;
+ LL_ERRS() << "Bad memory allocation for the image buffer!" << LL_ENDL ;
}
return mData;
@@ -288,7 +292,6 @@ LLImageRaw::LLImageRaw(U16 width, U16 height, S8 components)
LLImageRaw::LLImageRaw(U8 *data, U16 width, U16 height, S8 components, bool no_copy)
: LLImageBase()
{
-
if(no_copy)
{
setDataAndSize(data, width, height, components);
@@ -449,18 +452,8 @@ void LLImageRaw::verticalFlip()
void LLImageRaw::expandToPowerOfTwo(S32 max_dim, BOOL scale_image)
{
// Find new sizes
- S32 new_width = MIN_IMAGE_SIZE;
- S32 new_height = MIN_IMAGE_SIZE;
-
- while( (new_width < getWidth()) && (new_width < max_dim) )
- {
- new_width <<= 1;
- }
-
- while( (new_height < getHeight()) && (new_height < max_dim) )
- {
- new_height <<= 1;
- }
+ S32 new_width = expandDimToPowerOfTwo(getWidth(), max_dim);
+ S32 new_height = expandDimToPowerOfTwo(getHeight(), max_dim);
scale( new_width, new_height, scale_image );
}
@@ -468,55 +461,61 @@ void LLImageRaw::expandToPowerOfTwo(S32 max_dim, BOOL scale_image)
void LLImageRaw::contractToPowerOfTwo(S32 max_dim, BOOL scale_image)
{
// Find new sizes
- S32 new_width = max_dim;
- S32 new_height = max_dim;
-
- while( (new_width > getWidth()) && (new_width > MIN_IMAGE_SIZE) )
- {
- new_width >>= 1;
- }
-
- while( (new_height > getHeight()) && (new_height > MIN_IMAGE_SIZE) )
- {
- new_height >>= 1;
- }
+ S32 new_width = contractDimToPowerOfTwo(getWidth(), MIN_IMAGE_SIZE);
+ S32 new_height = contractDimToPowerOfTwo(getHeight(), MIN_IMAGE_SIZE);
scale( new_width, new_height, scale_image );
}
-void LLImageRaw::biasedScaleToPowerOfTwo(S32 max_dim)
+// static
+S32 LLImageRaw::biasedDimToPowerOfTwo(S32 curr_dim, S32 max_dim)
{
// Strong bias towards rounding down (to save bandwidth)
// No bias would mean THRESHOLD == 1.5f;
- const F32 THRESHOLD = 1.75f;
-
+ const F32 THRESHOLD = 1.75f;
+
// Find new sizes
- S32 larger_w = max_dim; // 2^n >= mWidth
- S32 smaller_w = max_dim; // 2^(n-1) <= mWidth
- while( (smaller_w > getWidth()) && (smaller_w > MIN_IMAGE_SIZE) )
+ S32 larger_dim = max_dim; // 2^n >= curr_dim
+ S32 smaller_dim = max_dim; // 2^(n-1) <= curr_dim
+ while( (smaller_dim > curr_dim) && (smaller_dim > MIN_IMAGE_SIZE) )
{
- larger_w = smaller_w;
- smaller_w >>= 1;
+ larger_dim = smaller_dim;
+ smaller_dim >>= 1;
}
- S32 new_width = ( (F32)getWidth() / smaller_w > THRESHOLD ) ? larger_w : smaller_w;
+ return ( ((F32)curr_dim / (F32)smaller_dim) > THRESHOLD ) ? larger_dim : smaller_dim;
+}
+// static
+S32 LLImageRaw::expandDimToPowerOfTwo(S32 curr_dim, S32 max_dim)
+{
+ S32 new_dim = MIN_IMAGE_SIZE;
+ while( (new_dim < curr_dim) && (new_dim < max_dim) )
+ {
+ new_dim <<= 1;
+ }
+ return new_dim;
+}
- S32 larger_h = max_dim; // 2^m >= mHeight
- S32 smaller_h = max_dim; // 2^(m-1) <= mHeight
- while( (smaller_h > getHeight()) && (smaller_h > MIN_IMAGE_SIZE) )
+// static
+S32 LLImageRaw::contractDimToPowerOfTwo(S32 curr_dim, S32 min_dim)
+{
+ S32 new_dim = MAX_IMAGE_SIZE;
+ while( (new_dim > curr_dim) && (new_dim > min_dim) )
{
- larger_h = smaller_h;
- smaller_h >>= 1;
+ new_dim >>= 1;
}
- S32 new_height = ( (F32)getHeight() / smaller_h > THRESHOLD ) ? larger_h : smaller_h;
+ return new_dim;
+}
+void LLImageRaw::biasedScaleToPowerOfTwo(S32 max_dim)
+{
+ // Find new sizes
+ S32 new_width = biasedDimToPowerOfTwo(getWidth(),max_dim);
+ S32 new_height = biasedDimToPowerOfTwo(getHeight(),max_dim);
scale( new_width, new_height );
}
-
-
-
// Calculates (U8)(255*(a/255.f)*(b/255.f) + 0.5f). Thanks, Jim Blinn!
inline U8 LLImageRaw::fastFractionalMult( U8 a, U8 b )
{
@@ -563,7 +562,7 @@ void LLImageRaw::composite( LLImageRaw* src )
// Src and dst can be any size. Src has 4 components. Dst has 3 components.
void LLImageRaw::compositeScaled4onto3(LLImageRaw* src)
{
- llinfos << "compositeScaled4onto3" << llendl;
+ LL_INFOS() << "compositeScaled4onto3" << LL_ENDL;
LLImageRaw* dst = this; // Just for clarity.
@@ -706,7 +705,7 @@ void LLImageRaw::copy(LLImageRaw* src)
{
if (!src)
{
- llwarns << "LLImageRaw::copy called with a null src pointer" << llendl;
+ LL_WARNS() << "LLImageRaw::copy called with a null src pointer" << LL_ENDL;
return;
}
@@ -1223,8 +1222,8 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip
llifstream ifs(name, llifstream::binary);
if (!ifs.is_open())
{
- // SJB: changed from llinfos to lldebugs to reduce spam
- lldebugs << "Unable to open image file: " << name << llendl;
+ // SJB: changed from LL_INFOS() to LL_DEBUGS() to reduce spam
+ LL_DEBUGS() << "Unable to open image file: " << name << LL_ENDL;
return false;
}
@@ -1238,7 +1237,7 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip
if (!length)
{
- llinfos << "Zero length file file: " << name << llendl;
+ LL_INFOS() << "Zero length file file: " << name << LL_ENDL;
return false;
}
@@ -1274,7 +1273,7 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip
if (!success)
{
deleteData();
- llwarns << "Unable to decode image" << name << llendl;
+ LL_WARNS() << "Unable to decode image" << name << LL_ENDL;
return false;
}
@@ -1379,11 +1378,11 @@ void LLImageFormatted::dump()
{
LLImageBase::dump();
- llinfos << "LLImageFormatted"
+ LL_INFOS() << "LLImageFormatted"
<< " mDecoding " << mDecoding
<< " mCodec " << S32(mCodec)
<< " mDecoded " << mDecoded
- << llendl;
+ << LL_ENDL;
}
//----------------------------------------------------------------------------
@@ -1466,11 +1465,11 @@ void LLImageFormatted::sanityCheck()
if (mCodec >= IMG_CODEC_EOF)
{
- llerrs << "Failed LLImageFormatted::sanityCheck "
+ LL_ERRS() << "Failed LLImageFormatted::sanityCheck "
<< "decoding " << S32(mDecoding)
<< "decoded " << S32(mDecoded)
<< "codec " << S32(mCodec)
- << llendl;
+ << LL_ENDL;
}
}
@@ -1617,7 +1616,10 @@ static void avg4_colors2(const U8* a, const U8* b, const U8* c, const U8* d, U8*
void LLImageBase::setDataAndSize(U8 *data, S32 size)
{
ll_assert_aligned(data, 16);
- mData = data; mDataSize = size;
+ mData = data;
+ disclaimMem(mDataSize);
+ mDataSize = size;
+ claimMem(mDataSize);
}
//static
@@ -1645,7 +1647,7 @@ void LLImageBase::generateMip(const U8* indata, U8* mipdata, S32 width, S32 heig
*(U8*)data = (U8)(((U32)(indata[0]) + indata[1] + indata[in_width] + indata[in_width+1])>>2);
break;
default:
- llerrs << "generateMmip called with bad num channels" << llendl;
+ LL_ERRS() << "generateMmip called with bad num channels" << LL_ENDL;
}
indata += nchannels*2;
data += nchannels;
@@ -1702,17 +1704,17 @@ F32 LLImageBase::calc_download_priority(F32 virtual_size, F32 visible_pixels, S3
bytes_weight *= bytes_weight;
- //llinfos << "VS: " << virtual_size << llendl;
+ //LL_INFOS() << "VS: " << virtual_size << LL_ENDL;
F32 virtual_size_factor = virtual_size / (10.f*10.f);
// The goal is for weighted priority to be <= 0 when we've reached a point where
// we've sent enough data.
- //llinfos << "BytesSent: " << bytes_sent << llendl;
- //llinfos << "BytesWeight: " << bytes_weight << llendl;
- //llinfos << "PreLog: " << bytes_weight * virtual_size_factor << llendl;
+ //LL_INFOS() << "BytesSent: " << bytes_sent << LL_ENDL;
+ //LL_INFOS() << "BytesWeight: " << bytes_weight << LL_ENDL;
+ //LL_INFOS() << "PreLog: " << bytes_weight * virtual_size_factor << LL_ENDL;
w_priority = (F32)log10(bytes_weight * virtual_size_factor);
- //llinfos << "PreScale: " << w_priority << llendl;
+ //LL_INFOS() << "PreScale: " << w_priority << LL_ENDL;
// We don't want to affect how MANY bytes we send based on the visible pixels, but the order
// in which they're sent. We post-multiply so we don't change the zero point.
diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h
index 2277afc585..cd3f76f1fd 100755
--- a/indra/llimage/llimage.h
+++ b/indra/llimage/llimage.h
@@ -29,8 +29,8 @@
#include "lluuid.h"
#include "llstring.h"
-#include "llthread.h"
#include "llpointer.h"
+#include "lltrace.h"
const S32 MIN_IMAGE_MIP = 2; // 4x4, only used for expand/contract power of 2
const S32 MAX_IMAGE_MIP = 11; // 2048x2048
@@ -111,7 +111,9 @@ protected:
//============================================================================
// Image base class
-class LLImageBase : public LLThreadSafeRefCount
+class LLImageBase
+: public LLThreadSafeRefCount,
+ public LLTrace::MemTrackable<LLImageBase>
{
protected:
virtual ~LLImageBase();
@@ -163,6 +165,8 @@ public:
static void destroyPrivatePool() ;
static LLPrivateMemoryPool* getPrivatePool() {return sPrivatePoolp;}
+ //static LLTrace::MemStatHandle sMemStat;
+
private:
U8 *mData;
S32 mDataSize;
@@ -205,6 +209,9 @@ public:
void verticalFlip();
+ static S32 biasedDimToPowerOfTwo(S32 curr_dim, S32 max_dim = MAX_IMAGE_SIZE);
+ static S32 expandDimToPowerOfTwo(S32 curr_dim, S32 max_dim = MAX_IMAGE_SIZE);
+ static S32 contractDimToPowerOfTwo(S32 curr_dim, S32 min_dim = MIN_IMAGE_SIZE);
void expandToPowerOfTwo(S32 max_dim = MAX_IMAGE_SIZE, BOOL scale_image = TRUE);
void contractToPowerOfTwo(S32 max_dim = MAX_IMAGE_SIZE, BOOL scale_image = TRUE);
void biasedScaleToPowerOfTwo(S32 max_dim = MAX_IMAGE_SIZE);
diff --git a/indra/llimage/llimagebmp.cpp b/indra/llimage/llimagebmp.cpp
index 60b1c628d7..8573fe0d91 100755
--- a/indra/llimage/llimagebmp.cpp
+++ b/indra/llimage/llimagebmp.cpp
@@ -321,7 +321,7 @@ BOOL LLImageBMP::updateData()
mColorPalette = new U8[color_palette_size];
if (!mColorPalette)
{
- llerrs << "Out of memory in LLImageBMP::updateData()" << llendl;
+ LL_ERRS() << "Out of memory in LLImageBMP::updateData()" << LL_ENDL;
return FALSE;
}
memcpy( mColorPalette, mdata + FILE_HEADER_SIZE + BITMAP_HEADER_SIZE + extension_size, color_palette_size ); /* Flawfinder: ignore */
@@ -528,7 +528,7 @@ BOOL LLImageBMP::encode(const LLImageRaw* raw_image, F32 encode_time)
if( (2 == src_components) || (4 == src_components) )
{
- llinfos << "Dropping alpha information during BMP encoding" << llendl;
+ LL_INFOS() << "Dropping alpha information during BMP encoding" << LL_ENDL;
}
setSize(raw_image->getWidth(), raw_image->getHeight(), dst_components);
diff --git a/indra/llimage/llimagedimensionsinfo.cpp b/indra/llimage/llimagedimensionsinfo.cpp
index c6bfa50b40..5bf3f29b3c 100755
--- a/indra/llimage/llimagedimensionsinfo.cpp
+++ b/indra/llimage/llimagedimensionsinfo.cpp
@@ -77,7 +77,7 @@ bool LLImageDimensionsInfo::getImageDimensionsBmp()
const S32 DATA_LEN = 26; // BMP header (14) + DIB header size (4) + width (4) + height (4)
if (!checkFileLength(DATA_LEN))
{
- llwarns << "Premature end of file" << llendl;
+ LL_WARNS() << "Premature end of file" << LL_ENDL;
return false;
}
@@ -89,7 +89,7 @@ bool LLImageDimensionsInfo::getImageDimensionsBmp()
// We only support Windows bitmaps (BM), according to LLImageBMP::updateData().
if (signature[0] != 'B' || signature[1] != 'M')
{
- llwarns << "Not a BMP" << llendl;
+ LL_WARNS() << "Not a BMP" << LL_ENDL;
return false;
}
@@ -108,7 +108,7 @@ bool LLImageDimensionsInfo::getImageDimensionsTga()
// Make sure the file is long enough.
if (!checkFileLength(TGA_FILE_HEADER_SIZE + 1 /* width */ + 1 /* height */))
{
- llwarns << "Premature end of file" << llendl;
+ LL_WARNS() << "Premature end of file" << LL_ENDL;
return false;
}
@@ -127,7 +127,7 @@ bool LLImageDimensionsInfo::getImageDimensionsPng()
// Make sure the file is long enough.
if (!checkFileLength(PNG_MAGIC_SIZE + 8 + sizeof(S32) * 2 /* width, height */))
{
- llwarns << "Premature end of file" << llendl;
+ LL_WARNS() << "Premature end of file" << LL_ENDL;
return false;
}
@@ -139,7 +139,7 @@ bool LLImageDimensionsInfo::getImageDimensionsPng()
// Make sure it's a PNG file.
if (memcmp(signature, png_magic, PNG_MAGIC_SIZE) != 0)
{
- llwarns << "Not a PNG" << llendl;
+ LL_WARNS() << "Not a PNG" << LL_ENDL;
return false;
}
@@ -156,7 +156,7 @@ void on_jpeg_error(j_common_ptr cinfo)
{
(void) cinfo;
sJpegErrorEncountered = true;
- llwarns << "Libjpeg has encountered an error!" << llendl;
+ LL_WARNS() << "Libjpeg has encountered an error!" << LL_ENDL;
}
bool LLImageDimensionsInfo::getImageDimensionsJpeg()
@@ -172,17 +172,17 @@ bool LLImageDimensionsInfo::getImageDimensionsJpeg()
/* Make sure this is a JPEG file. */
const size_t JPEG_MAGIC_SIZE = 2;
- const uint8_t jpeg_magic[JPEG_MAGIC_SIZE] = {0xFF, 0xD8};
- uint8_t signature[JPEG_MAGIC_SIZE];
+ const U8 jpeg_magic[JPEG_MAGIC_SIZE] = {0xFF, 0xD8};
+ U8 signature[JPEG_MAGIC_SIZE];
if (fread(signature, sizeof(signature), 1, fp) != 1)
{
- llwarns << "Premature end of file" << llendl;
+ LL_WARNS() << "Premature end of file" << LL_ENDL;
return false;
}
if (memcmp(signature, jpeg_magic, JPEG_MAGIC_SIZE) != 0)
{
- llwarns << "Not a JPEG" << llendl;
+ LL_WARNS() << "Not a JPEG" << LL_ENDL;
return false;
}
fseek(fp, 0, SEEK_SET); // go back to start of the file
diff --git a/indra/llimage/llimagedimensionsinfo.h b/indra/llimage/llimagedimensionsinfo.h
index 382fdb2a0e..8f716c5d02 100755
--- a/indra/llimage/llimagedimensionsinfo.h
+++ b/indra/llimage/llimagedimensionsinfo.h
@@ -27,6 +27,8 @@
#ifndef LL_LLIMAGEDIMENSIONSINFO_H
#define LL_LLIMAGEDIMENSIONSINFO_H
+#include "llapr.h"
+
//-----------------------------------------------------------------------------
// LLImageDimensionsInfo
// helper class to get image dimensions WITHOUT loading image to memore
diff --git a/indra/llimage/llimagedxt.cpp b/indra/llimage/llimagedxt.cpp
index 34c6793522..04e0e752eb 100755
--- a/indra/llimage/llimagedxt.cpp
+++ b/indra/llimage/llimagedxt.cpp
@@ -52,7 +52,7 @@ S32 LLImageDXT::formatBits(EFileFormat format)
case FORMAT_RGB8: return 24;
case FORMAT_RGBA8: return 32;
default:
- llerrs << "LLImageDXT::Unknown format: " << format << llendl;
+ LL_ERRS() << "LLImageDXT::Unknown format: " << format << LL_ENDL;
return 0;
}
};
@@ -82,7 +82,7 @@ S32 LLImageDXT::formatComponents(EFileFormat format)
case FORMAT_RGB8: return 3;
case FORMAT_RGBA8: return 4;
default:
- llerrs << "LLImageDXT::Unknown format: " << format << llendl;
+ LL_ERRS() << "LLImageDXT::Unknown format: " << format << LL_ENDL;
return 0;
}
};
@@ -207,7 +207,7 @@ BOOL LLImageDXT::updateData()
if (data_size < mHeaderSize)
{
- llerrs << "LLImageDXT: not enough data" << llendl;
+ LL_ERRS() << "LLImageDXT: not enough data" << LL_ENDL;
}
S32 ncomponents = formatComponents(mFileFormat);
setSize(width, height, ncomponents);
@@ -224,7 +224,7 @@ S32 LLImageDXT::getMipOffset(S32 discard)
{
if (mFileFormat >= FORMAT_DXT1 && mFileFormat <= FORMAT_DXT5)
{
- llerrs << "getMipOffset called with old (unsupported) format" << llendl;
+ LL_ERRS() << "getMipOffset called with old (unsupported) format" << LL_ENDL;
}
S32 width = getWidth(), height = getHeight();
S32 num_mips = calcNumMips(width, height);
@@ -251,7 +251,7 @@ void LLImageDXT::setFormat()
{
case 3: mFileFormat = FORMAT_DXR1; break;
case 4: mFileFormat = FORMAT_DXR3; break;
- default: llerrs << "LLImageDXT::setFormat called with ncomponents = " << ncomponents << llendl;
+ default: LL_ERRS() << "LLImageDXT::setFormat called with ncomponents = " << ncomponents << LL_ENDL;
}
mHeaderSize = calcHeaderSize();
}
@@ -265,7 +265,7 @@ BOOL LLImageDXT::decode(LLImageRaw* raw_image, F32 time)
if (mFileFormat >= FORMAT_DXT1 && mFileFormat <= FORMAT_DXR5)
{
- llwarns << "Attempt to decode compressed LLImageDXT to Raw (unsupported)" << llendl;
+ LL_WARNS() << "Attempt to decode compressed LLImageDXT to Raw (unsupported)" << LL_ENDL;
return FALSE;
}
@@ -303,7 +303,7 @@ BOOL LLImageDXT::getMipData(LLPointer<LLImageRaw>& raw, S32 discard)
}
else if (discard < mDiscardLevel)
{
- llerrs << "Request for invalid discard level" << llendl;
+ LL_ERRS() << "Request for invalid discard level" << LL_ENDL;
}
U8* data = getData() + getMipOffset(discard);
S32 width = 0;
@@ -331,7 +331,7 @@ BOOL LLImageDXT::encodeDXT(const LLImageRaw* raw_image, F32 time, bool explicit_
format = FORMAT_RGBA8;
break;
default:
- llerrs << "LLImageDXT::encode: Unhandled channel number: " << ncomponents << llendl;
+ LL_ERRS() << "LLImageDXT::encode: Unhandled channel number: " << ncomponents << LL_ENDL;
return 0;
}
@@ -422,7 +422,7 @@ bool LLImageDXT::convertToDXR()
case FORMAT_DXT4: newformat = FORMAT_DXR4; break;
case FORMAT_DXT5: newformat = FORMAT_DXR5; break;
default:
- llwarns << "convertToDXR: can not convert format: " << llformat("0x%08x",getFourCC(mFileFormat)) << llendl;
+ LL_WARNS() << "convertToDXR: can not convert format: " << llformat("0x%08x",getFourCC(mFileFormat)) << LL_ENDL;
return false;
}
mFileFormat = newformat;
@@ -433,7 +433,7 @@ bool LLImageDXT::convertToDXR()
U8* newdata = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), total_bytes);
if (!newdata)
{
- llerrs << "Out of memory in LLImageDXT::convertToDXR()" << llendl;
+ LL_ERRS() << "Out of memory in LLImageDXT::convertToDXR()" << LL_ENDL;
return false;
}
llassert(total_bytes > 0);
@@ -466,7 +466,7 @@ S32 LLImageDXT::calcDataSize(S32 discard_level)
{
if (mFileFormat == FORMAT_UNKNOWN)
{
- llerrs << "calcDataSize called with unloaded LLImageDXT" << llendl;
+ LL_ERRS() << "calcDataSize called with unloaded LLImageDXT" << LL_ENDL;
return 0;
}
if (discard_level < 0)
diff --git a/indra/llimage/llimagefilter.cpp b/indra/llimage/llimagefilter.cpp
new file mode 100755
index 0000000000..3d0c488768
--- /dev/null
+++ b/indra/llimage/llimagefilter.cpp
@@ -0,0 +1,939 @@
+/**
+ * @file llimagefilter.cpp
+ * @brief Simple Image Filtering. See https://wiki.lindenlab.com/wiki/SL_Viewer_Image_Filters for complete documentation.
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2014, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "linden_common.h"
+
+#include "llimagefilter.h"
+
+#include "llmath.h"
+#include "v3color.h"
+#include "v4coloru.h"
+#include "m3math.h"
+#include "v3math.h"
+#include "llsdserialize.h"
+#include "llstring.h"
+
+//---------------------------------------------------------------------------
+// LLImageFilter
+//---------------------------------------------------------------------------
+
+LLImageFilter::LLImageFilter(const std::string& file_path) :
+ mFilterData(LLSD::emptyArray()),
+ mImage(NULL),
+ mHistoRed(NULL),
+ mHistoGreen(NULL),
+ mHistoBlue(NULL),
+ mHistoBrightness(NULL),
+ mStencilBlendMode(STENCIL_BLEND_MODE_BLEND),
+ mStencilShape(STENCIL_SHAPE_UNIFORM),
+ mStencilGamma(1.0),
+ mStencilMin(0.0),
+ mStencilMax(1.0)
+{
+ // Load filter description from file
+ llifstream filter_xml(file_path);
+ if (filter_xml.is_open())
+ {
+ // Load and parse the file
+ LLPointer<LLSDParser> parser = new LLSDXMLParser();
+ parser->parse(filter_xml, mFilterData, LLSDSerialize::SIZE_UNLIMITED);
+ filter_xml.close();
+ }
+}
+
+LLImageFilter::~LLImageFilter()
+{
+ mImage = NULL;
+ ll_aligned_free_16(mHistoRed);
+ ll_aligned_free_16(mHistoGreen);
+ ll_aligned_free_16(mHistoBlue);
+ ll_aligned_free_16(mHistoBrightness);
+}
+
+/*
+ *TODO
+ * Rename stencil to mask
+ * Improve perf: use LUT for alpha blending in uniform case
+ * Add gradient coloring as a filter
+ */
+
+//============================================================================
+// Apply the filter data to the image passed as parameter
+//============================================================================
+
+void LLImageFilter::executeFilter(LLPointer<LLImageRaw> raw_image)
+{
+ mImage = raw_image;
+
+ //std::cout << "Filter : size = " << mFilterData.size() << std::endl;
+ for (S32 i = 0; i < mFilterData.size(); ++i)
+ {
+ std::string filter_name = mFilterData[i][0].asString();
+ // Dump out the filter values (for debug)
+ //std::cout << "Filter : name = " << mFilterData[i][0].asString() << ", params = ";
+ //for (S32 j = 1; j < mFilterData[i].size(); ++j)
+ //{
+ // std::cout << mFilterData[i][j].asString() << ", ";
+ //}
+ //std::cout << std::endl;
+
+ if (filter_name == "stencil")
+ {
+ // Get the shape of the stencil, that is how the procedural alpha is computed geometrically
+ std::string filter_shape = mFilterData[i][1].asString();
+ EStencilShape shape = STENCIL_SHAPE_UNIFORM;
+ if (filter_shape == "uniform")
+ {
+ shape = STENCIL_SHAPE_UNIFORM;
+ }
+ else if (filter_shape == "gradient")
+ {
+ shape = STENCIL_SHAPE_GRADIENT;
+ }
+ else if (filter_shape == "vignette")
+ {
+ shape = STENCIL_SHAPE_VIGNETTE;
+ }
+ else if (filter_shape == "scanlines")
+ {
+ shape = STENCIL_SHAPE_SCAN_LINES;
+ }
+ // Get the blend mode of the stencil, that is how the effect is blended in the background through the stencil
+ std::string filter_mode = mFilterData[i][2].asString();
+ EStencilBlendMode mode = STENCIL_BLEND_MODE_BLEND;
+ if (filter_mode == "blend")
+ {
+ mode = STENCIL_BLEND_MODE_BLEND;
+ }
+ else if (filter_mode == "add")
+ {
+ mode = STENCIL_BLEND_MODE_ADD;
+ }
+ else if (filter_mode == "add_back")
+ {
+ mode = STENCIL_BLEND_MODE_ABACK;
+ }
+ else if (filter_mode == "fade")
+ {
+ mode = STENCIL_BLEND_MODE_FADE;
+ }
+ // Get the float params: mandatory min, max then the optional parameters (4 max)
+ F32 min = (F32)(mFilterData[i][3].asReal());
+ F32 max = (F32)(mFilterData[i][4].asReal());
+ F32 params[4] = {0.0, 0.0, 0.0, 0.0};
+ for (S32 j = 5; (j < mFilterData[i].size()) && (j < 9); j++)
+ {
+ params[j-5] = (F32)(mFilterData[i][j].asReal());
+ }
+ // Set the stencil
+ setStencil(shape,mode,min,max,params);
+ }
+ else if (filter_name == "sepia")
+ {
+ filterSepia();
+ }
+ else if (filter_name == "grayscale")
+ {
+ filterGrayScale();
+ }
+ else if (filter_name == "saturate")
+ {
+ filterSaturate((float)(mFilterData[i][1].asReal()));
+ }
+ else if (filter_name == "rotate")
+ {
+ filterRotate((float)(mFilterData[i][1].asReal()));
+ }
+ else if (filter_name == "gamma")
+ {
+ LLColor3 color((float)(mFilterData[i][2].asReal()),(float)(mFilterData[i][3].asReal()),(float)(mFilterData[i][4].asReal()));
+ filterGamma((float)(mFilterData[i][1].asReal()),color);
+ }
+ else if (filter_name == "colorize")
+ {
+ LLColor3 color((float)(mFilterData[i][1].asReal()),(float)(mFilterData[i][2].asReal()),(float)(mFilterData[i][3].asReal()));
+ LLColor3 alpha((F32)(mFilterData[i][4].asReal()),(float)(mFilterData[i][5].asReal()),(float)(mFilterData[i][6].asReal()));
+ filterColorize(color,alpha);
+ }
+ else if (filter_name == "contrast")
+ {
+ LLColor3 color((float)(mFilterData[i][2].asReal()),(float)(mFilterData[i][3].asReal()),(float)(mFilterData[i][4].asReal()));
+ filterContrast((float)(mFilterData[i][1].asReal()),color);
+ }
+ else if (filter_name == "brighten")
+ {
+ LLColor3 color((float)(mFilterData[i][2].asReal()),(float)(mFilterData[i][3].asReal()),(float)(mFilterData[i][4].asReal()));
+ filterBrightness((float)(mFilterData[i][1].asReal()),color);
+ }
+ else if (filter_name == "darken")
+ {
+ LLColor3 color((float)(mFilterData[i][2].asReal()),(float)(mFilterData[i][3].asReal()),(float)(mFilterData[i][4].asReal()));
+ filterBrightness((float)(-mFilterData[i][1].asReal()),color);
+ }
+ else if (filter_name == "linearize")
+ {
+ LLColor3 color((float)(mFilterData[i][2].asReal()),(float)(mFilterData[i][3].asReal()),(float)(mFilterData[i][4].asReal()));
+ filterLinearize((float)(mFilterData[i][1].asReal()),color);
+ }
+ else if (filter_name == "posterize")
+ {
+ LLColor3 color((float)(mFilterData[i][2].asReal()),(float)(mFilterData[i][3].asReal()),(float)(mFilterData[i][4].asReal()));
+ filterEqualize((S32)(mFilterData[i][1].asReal()),color);
+ }
+ else if (filter_name == "screen")
+ {
+ std::string screen_name = mFilterData[i][1].asString();
+ EScreenMode mode = SCREEN_MODE_2DSINE;
+ if (screen_name == "2Dsine")
+ {
+ mode = SCREEN_MODE_2DSINE;
+ }
+ else if (screen_name == "line")
+ {
+ mode = SCREEN_MODE_LINE;
+ }
+ filterScreen(mode,(F32)(mFilterData[i][2].asReal()),(F32)(mFilterData[i][3].asReal()));
+ }
+ else if (filter_name == "blur")
+ {
+ LLMatrix3 kernel;
+ for (S32 i = 0; i < NUM_VALUES_IN_MAT3; i++)
+ for (S32 j = 0; j < NUM_VALUES_IN_MAT3; j++)
+ kernel.mMatrix[i][j] = 1.0;
+ convolve(kernel,true,false);
+ }
+ else if (filter_name == "sharpen")
+ {
+ LLMatrix3 kernel;
+ for (S32 k = 0; k < NUM_VALUES_IN_MAT3; k++)
+ for (S32 j = 0; j < NUM_VALUES_IN_MAT3; j++)
+ kernel.mMatrix[k][j] = -1.0;
+ kernel.mMatrix[1][1] = 9.0;
+ convolve(kernel,false,false);
+ }
+ else if (filter_name == "gradient")
+ {
+ LLMatrix3 kernel;
+ for (S32 k = 0; k < NUM_VALUES_IN_MAT3; k++)
+ for (S32 j = 0; j < NUM_VALUES_IN_MAT3; j++)
+ kernel.mMatrix[k][j] = -1.0;
+ kernel.mMatrix[1][1] = 8.0;
+ convolve(kernel,false,true);
+ }
+ else if (filter_name == "convolve")
+ {
+ LLMatrix3 kernel;
+ S32 index = 1;
+ bool normalize = (mFilterData[i][index++].asReal() > 0.0);
+ bool abs_value = (mFilterData[i][index++].asReal() > 0.0);
+ for (S32 k = 0; k < NUM_VALUES_IN_MAT3; k++)
+ for (S32 j = 0; j < NUM_VALUES_IN_MAT3; j++)
+ kernel.mMatrix[k][j] = mFilterData[i][index++].asReal();
+ convolve(kernel,normalize,abs_value);
+ }
+ else if (filter_name == "colortransform")
+ {
+ LLMatrix3 transform;
+ S32 index = 1;
+ for (S32 k = 0; k < NUM_VALUES_IN_MAT3; k++)
+ for (S32 j = 0; j < NUM_VALUES_IN_MAT3; j++)
+ transform.mMatrix[k][j] = mFilterData[i][index++].asReal();
+ transform.transpose();
+ colorTransform(transform);
+ }
+ else
+ {
+ llwarns << "Filter unknown, cannot execute filter command : " << filter_name << llendl;
+ }
+ }
+}
+
+//============================================================================
+// Filter Primitives
+//============================================================================
+
+void LLImageFilter::blendStencil(F32 alpha, U8* pixel, U8 red, U8 green, U8 blue)
+{
+ F32 inv_alpha = 1.0 - alpha;
+ switch (mStencilBlendMode)
+ {
+ case STENCIL_BLEND_MODE_BLEND:
+ // Classic blend of incoming color with the background image
+ pixel[VRED] = inv_alpha * pixel[VRED] + alpha * red;
+ pixel[VGREEN] = inv_alpha * pixel[VGREEN] + alpha * green;
+ pixel[VBLUE] = inv_alpha * pixel[VBLUE] + alpha * blue;
+ break;
+ case STENCIL_BLEND_MODE_ADD:
+ // Add incoming color to the background image
+ pixel[VRED] = llclampb(pixel[VRED] + alpha * red);
+ pixel[VGREEN] = llclampb(pixel[VGREEN] + alpha * green);
+ pixel[VBLUE] = llclampb(pixel[VBLUE] + alpha * blue);
+ break;
+ case STENCIL_BLEND_MODE_ABACK:
+ // Add back background image to the incoming color
+ pixel[VRED] = llclampb(inv_alpha * pixel[VRED] + red);
+ pixel[VGREEN] = llclampb(inv_alpha * pixel[VGREEN] + green);
+ pixel[VBLUE] = llclampb(inv_alpha * pixel[VBLUE] + blue);
+ break;
+ case STENCIL_BLEND_MODE_FADE:
+ // Fade incoming color to black
+ pixel[VRED] = alpha * red;
+ pixel[VGREEN] = alpha * green;
+ pixel[VBLUE] = alpha * blue;
+ break;
+ }
+}
+
+void LLImageFilter::colorCorrect(const U8* lut_red, const U8* lut_green, const U8* lut_blue)
+{
+ const S32 components = mImage->getComponents();
+ llassert( components >= 1 && components <= 4 );
+
+ S32 width = mImage->getWidth();
+ S32 height = mImage->getHeight();
+
+ U8* dst_data = mImage->getData();
+ for (S32 j = 0; j < height; j++)
+ {
+ for (S32 i = 0; i < width; i++)
+ {
+ // Blend LUT value
+ blendStencil(getStencilAlpha(i,j), dst_data, lut_red[dst_data[VRED]], lut_green[dst_data[VGREEN]], lut_blue[dst_data[VBLUE]]);
+ dst_data += components;
+ }
+ }
+}
+
+void LLImageFilter::colorTransform(const LLMatrix3 &transform)
+{
+ const S32 components = mImage->getComponents();
+ llassert( components >= 1 && components <= 4 );
+
+ S32 width = mImage->getWidth();
+ S32 height = mImage->getHeight();
+
+ U8* dst_data = mImage->getData();
+ for (S32 j = 0; j < height; j++)
+ {
+ for (S32 i = 0; i < width; i++)
+ {
+ // Compute transform
+ LLVector3 src((F32)(dst_data[VRED]),(F32)(dst_data[VGREEN]),(F32)(dst_data[VBLUE]));
+ LLVector3 dst = src * transform;
+ dst.clamp(0.0f,255.0f);
+
+ // Blend result
+ blendStencil(getStencilAlpha(i,j), dst_data, dst.mV[VRED], dst.mV[VGREEN], dst.mV[VBLUE]);
+ dst_data += components;
+ }
+ }
+}
+
+void LLImageFilter::convolve(const LLMatrix3 &kernel, bool normalize, bool abs_value)
+{
+ const S32 components = mImage->getComponents();
+ llassert( components >= 1 && components <= 4 );
+
+ // Compute normalization factors
+ F32 kernel_min = 0.0;
+ F32 kernel_max = 0.0;
+ for (S32 i = 0; i < NUM_VALUES_IN_MAT3; i++)
+ {
+ for (S32 j = 0; j < NUM_VALUES_IN_MAT3; j++)
+ {
+ if (kernel.mMatrix[i][j] >= 0.0)
+ kernel_max += kernel.mMatrix[i][j];
+ else
+ kernel_min += kernel.mMatrix[i][j];
+ }
+ }
+ if (abs_value)
+ {
+ kernel_max = llabs(kernel_max);
+ kernel_min = llabs(kernel_min);
+ kernel_max = llmax(kernel_max,kernel_min);
+ kernel_min = 0.0;
+ }
+ F32 kernel_range = kernel_max - kernel_min;
+
+ // Allocate temporary buffers and initialize algorithm's data
+ S32 width = mImage->getWidth();
+ S32 height = mImage->getHeight();
+
+ U8* dst_data = mImage->getData();
+
+ S32 buffer_size = width * components;
+ llassert_always(buffer_size > 0);
+ std::vector<U8> even_buffer(buffer_size);
+ std::vector<U8> odd_buffer(buffer_size);
+
+ U8* south_data = dst_data + buffer_size;
+ U8* east_west_data;
+ U8* north_data;
+
+ // Line 0 : we set the line to 0 (debatable)
+ memcpy( &even_buffer[0], dst_data, buffer_size ); /* Flawfinder: ignore */
+ for (S32 i = 0; i < width; i++)
+ {
+ blendStencil(getStencilAlpha(i,0), dst_data, 0, 0, 0);
+ dst_data += components;
+ }
+ south_data += buffer_size;
+
+ // All other lines
+ for (S32 j = 1; j < (height-1); j++)
+ {
+ // We need to buffer 2 lines. We flip north and east-west (current) to avoid moving too much memory around
+ if (j % 2)
+ {
+ memcpy( &odd_buffer[0], dst_data, buffer_size ); /* Flawfinder: ignore */
+ east_west_data = &odd_buffer[0];
+ north_data = &even_buffer[0];
+ }
+ else
+ {
+ memcpy( &even_buffer[0], dst_data, buffer_size ); /* Flawfinder: ignore */
+ east_west_data = &even_buffer[0];
+ north_data = &odd_buffer[0];
+ }
+ // First pixel : set to 0
+ blendStencil(getStencilAlpha(0,j), dst_data, 0, 0, 0);
+ dst_data += components;
+ // Set pointers to kernel
+ U8* NW = north_data;
+ U8* N = NW+components;
+ U8* NE = N+components;
+ U8* W = east_west_data;
+ U8* C = W+components;
+ U8* E = C+components;
+ U8* SW = south_data;
+ U8* S = SW+components;
+ U8* SE = S+components;
+ // All other pixels
+ for (S32 i = 1; i < (width-1); i++)
+ {
+ // Compute convolution
+ LLVector3 dst;
+ dst.mV[VRED] = (kernel.mMatrix[0][0]*NW[VRED] + kernel.mMatrix[0][1]*N[VRED] + kernel.mMatrix[0][2]*NE[VRED] +
+ kernel.mMatrix[1][0]*W[VRED] + kernel.mMatrix[1][1]*C[VRED] + kernel.mMatrix[1][2]*E[VRED] +
+ kernel.mMatrix[2][0]*SW[VRED] + kernel.mMatrix[2][1]*S[VRED] + kernel.mMatrix[2][2]*SE[VRED]);
+ dst.mV[VGREEN] = (kernel.mMatrix[0][0]*NW[VGREEN] + kernel.mMatrix[0][1]*N[VGREEN] + kernel.mMatrix[0][2]*NE[VGREEN] +
+ kernel.mMatrix[1][0]*W[VGREEN] + kernel.mMatrix[1][1]*C[VGREEN] + kernel.mMatrix[1][2]*E[VGREEN] +
+ kernel.mMatrix[2][0]*SW[VGREEN] + kernel.mMatrix[2][1]*S[VGREEN] + kernel.mMatrix[2][2]*SE[VGREEN]);
+ dst.mV[VBLUE] = (kernel.mMatrix[0][0]*NW[VBLUE] + kernel.mMatrix[0][1]*N[VBLUE] + kernel.mMatrix[0][2]*NE[VBLUE] +
+ kernel.mMatrix[1][0]*W[VBLUE] + kernel.mMatrix[1][1]*C[VBLUE] + kernel.mMatrix[1][2]*E[VBLUE] +
+ kernel.mMatrix[2][0]*SW[VBLUE] + kernel.mMatrix[2][1]*S[VBLUE] + kernel.mMatrix[2][2]*SE[VBLUE]);
+ if (abs_value)
+ {
+ dst.mV[VRED] = llabs(dst.mV[VRED]);
+ dst.mV[VGREEN] = llabs(dst.mV[VGREEN]);
+ dst.mV[VBLUE] = llabs(dst.mV[VBLUE]);
+ }
+ if (normalize)
+ {
+ dst.mV[VRED] = (dst.mV[VRED] - kernel_min)/kernel_range;
+ dst.mV[VGREEN] = (dst.mV[VGREEN] - kernel_min)/kernel_range;
+ dst.mV[VBLUE] = (dst.mV[VBLUE] - kernel_min)/kernel_range;
+ }
+ dst.clamp(0.0f,255.0f);
+
+ // Blend result
+ blendStencil(getStencilAlpha(i,j), dst_data, dst.mV[VRED], dst.mV[VGREEN], dst.mV[VBLUE]);
+
+ // Next pixel
+ dst_data += components;
+ NW += components;
+ N += components;
+ NE += components;
+ W += components;
+ C += components;
+ E += components;
+ SW += components;
+ S += components;
+ SE += components;
+ }
+ // Last pixel : set to 0
+ blendStencil(getStencilAlpha(width-1,j), dst_data, 0, 0, 0);
+ dst_data += components;
+ south_data += buffer_size;
+ }
+
+ // Last line
+ for (S32 i = 0; i < width; i++)
+ {
+ blendStencil(getStencilAlpha(i,0), dst_data, 0, 0, 0);
+ dst_data += components;
+ }
+}
+
+void LLImageFilter::filterScreen(EScreenMode mode, const F32 wave_length, const F32 angle)
+{
+ const S32 components = mImage->getComponents();
+ llassert( components >= 1 && components <= 4 );
+
+ S32 width = mImage->getWidth();
+ S32 height = mImage->getHeight();
+
+ F32 wave_length_pixels = wave_length * (F32)(height) / 2.0;
+ F32 sin = sinf(angle*DEG_TO_RAD);
+ F32 cos = cosf(angle*DEG_TO_RAD);
+
+ // Precompute the gamma table : gives us the gray level to use when cutting outside the screen (prevents strong aliasing on the screen)
+ U8 gamma[256];
+ for (S32 i = 0; i < 256; i++)
+ {
+ F32 gamma_i = llclampf((float)(powf((float)(i)/255.0,1.0/4.0)));
+ gamma[i] = (U8)(255.0 * gamma_i);
+ }
+
+ U8* dst_data = mImage->getData();
+ for (S32 j = 0; j < height; j++)
+ {
+ for (S32 i = 0; i < width; i++)
+ {
+ // Compute screen value
+ F32 value = 0.0;
+ F32 di = 0.0;
+ F32 dj = 0.0;
+ switch (mode)
+ {
+ case SCREEN_MODE_2DSINE:
+ di = cos*i + sin*j;
+ dj = -sin*i + cos*j;
+ value = (sinf(2*F_PI*di/wave_length_pixels)*sinf(2*F_PI*dj/wave_length_pixels)+1.0)*255.0/2.0;
+ break;
+ case SCREEN_MODE_LINE:
+ dj = sin*i - cos*j;
+ value = (sinf(2*F_PI*dj/wave_length_pixels)+1.0)*255.0/2.0;
+ break;
+ }
+ U8 dst_value = (dst_data[VRED] >= (U8)(value) ? gamma[dst_data[VRED] - (U8)(value)] : 0);
+
+ // Blend result
+ blendStencil(getStencilAlpha(i,j), dst_data, dst_value, dst_value, dst_value);
+ dst_data += components;
+ }
+ }
+}
+
+//============================================================================
+// Procedural Stencils
+//============================================================================
+void LLImageFilter::setStencil(EStencilShape shape, EStencilBlendMode mode, F32 min, F32 max, F32* params)
+{
+ mStencilShape = shape;
+ mStencilBlendMode = mode;
+ mStencilMin = llmin(llmax(min, -1.0f), 1.0f);
+ mStencilMax = llmin(llmax(max, -1.0f), 1.0f);
+
+ // Each shape will interpret the 4 params differenly.
+ // We compute each systematically, though, clearly, values are meaningless when the shape doesn't correspond to the parameters
+ mStencilCenterX = (S32)(mImage->getWidth() + params[0] * (F32)(mImage->getHeight()))/2;
+ mStencilCenterY = (S32)(mImage->getHeight() + params[1] * (F32)(mImage->getHeight()))/2;
+ mStencilWidth = (S32)(params[2] * (F32)(mImage->getHeight()))/2;
+ mStencilGamma = (params[3] <= 0.0 ? 1.0 : params[3]);
+
+ mStencilWavelength = (params[0] <= 0.0 ? 10.0 : params[0] * (F32)(mImage->getHeight()) / 2.0);
+ mStencilSine = sinf(params[1]*DEG_TO_RAD);
+ mStencilCosine = cosf(params[1]*DEG_TO_RAD);
+
+ mStencilStartX = ((F32)(mImage->getWidth()) + params[0] * (F32)(mImage->getHeight()))/2.0;
+ mStencilStartY = ((F32)(mImage->getHeight()) + params[1] * (F32)(mImage->getHeight()))/2.0;
+ F32 end_x = ((F32)(mImage->getWidth()) + params[2] * (F32)(mImage->getHeight()))/2.0;
+ F32 end_y = ((F32)(mImage->getHeight()) + params[3] * (F32)(mImage->getHeight()))/2.0;
+ mStencilGradX = end_x - mStencilStartX;
+ mStencilGradY = end_y - mStencilStartY;
+ mStencilGradN = mStencilGradX*mStencilGradX + mStencilGradY*mStencilGradY;
+}
+
+F32 LLImageFilter::getStencilAlpha(S32 i, S32 j)
+{
+ F32 alpha = 1.0; // That init actually takes care of the STENCIL_SHAPE_UNIFORM case...
+ if (mStencilShape == STENCIL_SHAPE_VIGNETTE)
+ {
+ // alpha is a modified gaussian value, with a center and fading in a circular pattern toward the edges
+ // The gamma parameter controls the intensity of the drop down from alpha 1.0 (center) to 0.0
+ F32 d_center_square = (i - mStencilCenterX)*(i - mStencilCenterX) + (j - mStencilCenterY)*(j - mStencilCenterY);
+ alpha = powf(F_E, -(powf((d_center_square/(mStencilWidth*mStencilWidth)),mStencilGamma)/2.0f));
+ }
+ else if (mStencilShape == STENCIL_SHAPE_SCAN_LINES)
+ {
+ // alpha varies according to a squared sine function.
+ F32 d = mStencilSine*i - mStencilCosine*j;
+ alpha = (sinf(2*F_PI*d/mStencilWavelength) > 0.0 ? 1.0 : 0.0);
+ }
+ else if (mStencilShape == STENCIL_SHAPE_GRADIENT)
+ {
+ alpha = (((F32)(i) - mStencilStartX)*mStencilGradX + ((F32)(j) - mStencilStartY)*mStencilGradY) / mStencilGradN;
+ alpha = llclampf(alpha);
+ }
+
+ // We rescale alpha between min and max
+ return (mStencilMin + alpha * (mStencilMax - mStencilMin));
+}
+
+//============================================================================
+// Histograms
+//============================================================================
+
+U32* LLImageFilter::getBrightnessHistogram()
+{
+ if (!mHistoBrightness)
+ {
+ computeHistograms();
+ }
+ return mHistoBrightness;
+}
+
+void LLImageFilter::computeHistograms()
+{
+ const S32 components = mImage->getComponents();
+ llassert( components >= 1 && components <= 4 );
+
+ // Allocate memory for the histograms
+ if (!mHistoRed)
+ {
+ mHistoRed = (U32*) ll_aligned_malloc_16(256*sizeof(U32));
+ }
+ if (!mHistoGreen)
+ {
+ mHistoGreen = (U32*) ll_aligned_malloc_16(256*sizeof(U32));
+ }
+ if (!mHistoBlue)
+ {
+ mHistoBlue = (U32*) ll_aligned_malloc_16(256*sizeof(U32));
+ }
+ if (!mHistoBrightness)
+ {
+ mHistoBrightness = (U32*) ll_aligned_malloc_16(256*sizeof(U32));
+ }
+
+ // Initialize them
+ for (S32 i = 0; i < 256; i++)
+ {
+ mHistoRed[i] = 0;
+ mHistoGreen[i] = 0;
+ mHistoBlue[i] = 0;
+ mHistoBrightness[i] = 0;
+ }
+
+ // Compute them
+ S32 pixels = mImage->getWidth() * mImage->getHeight();
+ U8* dst_data = mImage->getData();
+ for (S32 i = 0; i < pixels; i++)
+ {
+ mHistoRed[dst_data[VRED]]++;
+ mHistoGreen[dst_data[VGREEN]]++;
+ mHistoBlue[dst_data[VBLUE]]++;
+ // Note: this is a very simple shorthand for brightness but it's OK for our use
+ S32 brightness = ((S32)(dst_data[VRED]) + (S32)(dst_data[VGREEN]) + (S32)(dst_data[VBLUE])) / 3;
+ mHistoBrightness[brightness]++;
+ // next pixel...
+ dst_data += components;
+ }
+}
+
+//============================================================================
+// Secondary Filters
+//============================================================================
+
+void LLImageFilter::filterGrayScale()
+{
+ LLMatrix3 gray_scale;
+ LLVector3 luminosity(0.2125, 0.7154, 0.0721);
+ gray_scale.setRows(luminosity, luminosity, luminosity);
+ gray_scale.transpose();
+ colorTransform(gray_scale);
+}
+
+void LLImageFilter::filterSepia()
+{
+ LLMatrix3 sepia;
+ sepia.setRows(LLVector3(0.3588, 0.7044, 0.1368),
+ LLVector3(0.2990, 0.5870, 0.1140),
+ LLVector3(0.2392, 0.4696, 0.0912));
+ sepia.transpose();
+ colorTransform(sepia);
+}
+
+void LLImageFilter::filterSaturate(F32 saturation)
+{
+ // Matrix to Lij
+ LLMatrix3 r_a;
+ LLMatrix3 r_b;
+
+ // 45 degre rotation around z
+ r_a.setRows(LLVector3( OO_SQRT2, OO_SQRT2, 0.0),
+ LLVector3(-OO_SQRT2, OO_SQRT2, 0.0),
+ LLVector3( 0.0, 0.0, 1.0));
+ // 54.73 degre rotation around y
+ float oo_sqrt3 = 1.0f / F_SQRT3;
+ float sin_54 = F_SQRT2 * oo_sqrt3;
+ r_b.setRows(LLVector3(oo_sqrt3, 0.0, -sin_54),
+ LLVector3(0.0, 1.0, 0.0),
+ LLVector3(sin_54, 0.0, oo_sqrt3));
+
+ // Coordinate conversion
+ LLMatrix3 Lij = r_b * r_a;
+ LLMatrix3 Lij_inv = Lij;
+ Lij_inv.transpose();
+
+ // Local saturation transform
+ LLMatrix3 s;
+ s.setRows(LLVector3(saturation, 0.0, 0.0),
+ LLVector3(0.0, saturation, 0.0),
+ LLVector3(0.0, 0.0, 1.0));
+
+ // Global saturation transform
+ LLMatrix3 transfo = Lij_inv * s * Lij;
+ colorTransform(transfo);
+}
+
+void LLImageFilter::filterRotate(F32 angle)
+{
+ // Matrix to Lij
+ LLMatrix3 r_a;
+ LLMatrix3 r_b;
+
+ // 45 degre rotation around z
+ r_a.setRows(LLVector3( OO_SQRT2, OO_SQRT2, 0.0),
+ LLVector3(-OO_SQRT2, OO_SQRT2, 0.0),
+ LLVector3( 0.0, 0.0, 1.0));
+ // 54.73 degre rotation around y
+ float oo_sqrt3 = 1.0f / F_SQRT3;
+ float sin_54 = F_SQRT2 * oo_sqrt3;
+ r_b.setRows(LLVector3(oo_sqrt3, 0.0, -sin_54),
+ LLVector3(0.0, 1.0, 0.0),
+ LLVector3(sin_54, 0.0, oo_sqrt3));
+
+ // Coordinate conversion
+ LLMatrix3 Lij = r_b * r_a;
+ LLMatrix3 Lij_inv = Lij;
+ Lij_inv.transpose();
+
+ // Local color rotation transform
+ LLMatrix3 r;
+ angle *= DEG_TO_RAD;
+ r.setRows(LLVector3( cosf(angle), sinf(angle), 0.0),
+ LLVector3(-sinf(angle), cosf(angle), 0.0),
+ LLVector3( 0.0, 0.0, 1.0));
+
+ // Global color rotation transform
+ LLMatrix3 transfo = Lij_inv * r * Lij;
+ colorTransform(transfo);
+}
+
+void LLImageFilter::filterGamma(F32 gamma, const LLColor3& alpha)
+{
+ U8 gamma_red_lut[256];
+ U8 gamma_green_lut[256];
+ U8 gamma_blue_lut[256];
+
+ for (S32 i = 0; i < 256; i++)
+ {
+ F32 gamma_i = llclampf((float)(powf((float)(i)/255.0,1.0/gamma)));
+ // Blend in with alpha values
+ gamma_red_lut[i] = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * 255.0 * gamma_i);
+ gamma_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * 255.0 * gamma_i);
+ gamma_blue_lut[i] = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * 255.0 * gamma_i);
+ }
+
+ colorCorrect(gamma_red_lut,gamma_green_lut,gamma_blue_lut);
+}
+
+void LLImageFilter::filterLinearize(F32 tail, const LLColor3& alpha)
+{
+ // Get the histogram
+ U32* histo = getBrightnessHistogram();
+
+ // Compute cumulated histogram
+ U32 cumulated_histo[256];
+ cumulated_histo[0] = histo[0];
+ for (S32 i = 1; i < 256; i++)
+ {
+ cumulated_histo[i] = cumulated_histo[i-1] + histo[i];
+ }
+
+ // Compute min and max counts minus tail
+ tail = llclampf(tail);
+ S32 total = cumulated_histo[255];
+ S32 min_c = (S32)((F32)(total) * tail);
+ S32 max_c = (S32)((F32)(total) * (1.0 - tail));
+
+ // Find min and max values
+ S32 min_v = 0;
+ while (cumulated_histo[min_v] < min_c)
+ {
+ min_v++;
+ }
+ S32 max_v = 255;
+ while (cumulated_histo[max_v] > max_c)
+ {
+ max_v--;
+ }
+
+ // Compute linear lookup table
+ U8 linear_red_lut[256];
+ U8 linear_green_lut[256];
+ U8 linear_blue_lut[256];
+ if (max_v == min_v)
+ {
+ // Degenerated binary split case
+ for (S32 i = 0; i < 256; i++)
+ {
+ U8 value_i = (i < min_v ? 0 : 255);
+ // Blend in with alpha values
+ linear_red_lut[i] = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
+ linear_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
+ linear_blue_lut[i] = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
+ }
+ }
+ else
+ {
+ // Linearize between min and max
+ F32 slope = 255.0 / (F32)(max_v - min_v);
+ F32 translate = -min_v * slope;
+ for (S32 i = 0; i < 256; i++)
+ {
+ U8 value_i = (U8)(llclampb((S32)(slope*i + translate)));
+ // Blend in with alpha values
+ linear_red_lut[i] = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
+ linear_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
+ linear_blue_lut[i] = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
+ }
+ }
+
+ // Apply lookup table
+ colorCorrect(linear_red_lut,linear_green_lut,linear_blue_lut);
+}
+
+void LLImageFilter::filterEqualize(S32 nb_classes, const LLColor3& alpha)
+{
+ // Regularize the parameter: must be between 2 and 255
+ nb_classes = llmax(nb_classes,2);
+ nb_classes = llclampb(nb_classes);
+
+ // Get the histogram
+ U32* histo = getBrightnessHistogram();
+
+ // Compute cumulated histogram
+ U32 cumulated_histo[256];
+ cumulated_histo[0] = histo[0];
+ for (S32 i = 1; i < 256; i++)
+ {
+ cumulated_histo[i] = cumulated_histo[i-1] + histo[i];
+ }
+
+ // Compute deltas
+ S32 total = cumulated_histo[255];
+ S32 delta_count = total / nb_classes;
+ S32 current_count = delta_count;
+ S32 delta_value = 256 / (nb_classes - 1);
+ S32 current_value = 0;
+
+ // Compute equalized lookup table
+ U8 equalize_red_lut[256];
+ U8 equalize_green_lut[256];
+ U8 equalize_blue_lut[256];
+ for (S32 i = 0; i < 256; i++)
+ {
+ // Blend in current_value with alpha values
+ equalize_red_lut[i] = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * current_value);
+ equalize_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * current_value);
+ equalize_blue_lut[i] = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * current_value);
+ if (cumulated_histo[i] >= current_count)
+ {
+ current_count += delta_count;
+ current_value += delta_value;
+ current_value = llclampb(current_value);
+ }
+ }
+
+ // Apply lookup table
+ colorCorrect(equalize_red_lut,equalize_green_lut,equalize_blue_lut);
+}
+
+void LLImageFilter::filterColorize(const LLColor3& color, const LLColor3& alpha)
+{
+ U8 red_lut[256];
+ U8 green_lut[256];
+ U8 blue_lut[256];
+
+ F32 red_composite = 255.0 * alpha.mV[0] * color.mV[0];
+ F32 green_composite = 255.0 * alpha.mV[1] * color.mV[1];
+ F32 blue_composite = 255.0 * alpha.mV[2] * color.mV[2];
+
+ for (S32 i = 0; i < 256; i++)
+ {
+ red_lut[i] = (U8)(llclampb((S32)((1.0 - alpha.mV[0]) * (F32)(i) + red_composite)));
+ green_lut[i] = (U8)(llclampb((S32)((1.0 - alpha.mV[1]) * (F32)(i) + green_composite)));
+ blue_lut[i] = (U8)(llclampb((S32)((1.0 - alpha.mV[2]) * (F32)(i) + blue_composite)));
+ }
+
+ colorCorrect(red_lut,green_lut,blue_lut);
+}
+
+void LLImageFilter::filterContrast(F32 slope, const LLColor3& alpha)
+{
+ U8 contrast_red_lut[256];
+ U8 contrast_green_lut[256];
+ U8 contrast_blue_lut[256];
+
+ F32 translate = 128.0 * (1.0 - slope);
+
+ for (S32 i = 0; i < 256; i++)
+ {
+ U8 value_i = (U8)(llclampb((S32)(slope*i + translate)));
+ // Blend in with alpha values
+ contrast_red_lut[i] = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
+ contrast_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
+ contrast_blue_lut[i] = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
+ }
+
+ colorCorrect(contrast_red_lut,contrast_green_lut,contrast_blue_lut);
+}
+
+void LLImageFilter::filterBrightness(F32 add, const LLColor3& alpha)
+{
+ U8 brightness_red_lut[256];
+ U8 brightness_green_lut[256];
+ U8 brightness_blue_lut[256];
+
+ S32 add_value = (S32)(add * 255.0);
+
+ for (S32 i = 0; i < 256; i++)
+ {
+ U8 value_i = (U8)(llclampb(i + add_value));
+ // Blend in with alpha values
+ brightness_red_lut[i] = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
+ brightness_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
+ brightness_blue_lut[i] = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
+ }
+
+ colorCorrect(brightness_red_lut,brightness_green_lut,brightness_blue_lut);
+}
+
+//============================================================================
diff --git a/indra/llimage/llimagefilter.h b/indra/llimage/llimagefilter.h
new file mode 100755
index 0000000000..16ec395f76
--- /dev/null
+++ b/indra/llimage/llimagefilter.h
@@ -0,0 +1,137 @@
+/**
+ * @file llimagefilter.h
+ * @brief Simple Image Filtering. See https://wiki.lindenlab.com/wiki/SL_Viewer_Image_Filters for complete documentation.
+ *
+ * $LicenseInfo:firstyear=2000&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2014, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLIMAGEFILTER_H
+#define LL_LLIMAGEFILTER_H
+
+#include "llsd.h"
+#include "llimage.h"
+
+class LLImageRaw;
+class LLColor4U;
+class LLColor3;
+class LLMatrix3;
+
+typedef enum e_stencil_blend_mode
+{
+ STENCIL_BLEND_MODE_BLEND = 0,
+ STENCIL_BLEND_MODE_ADD = 1,
+ STENCIL_BLEND_MODE_ABACK = 2,
+ STENCIL_BLEND_MODE_FADE = 3
+} EStencilBlendMode;
+
+typedef enum e_stencil_shape
+{
+ STENCIL_SHAPE_UNIFORM = 0,
+ STENCIL_SHAPE_GRADIENT = 1,
+ STENCIL_SHAPE_VIGNETTE = 2,
+ STENCIL_SHAPE_SCAN_LINES = 3
+} EStencilShape;
+
+typedef enum e_screen_mode
+{
+ SCREEN_MODE_2DSINE = 0,
+ SCREEN_MODE_LINE = 1
+} EScreenMode;
+
+//============================================================================
+// LLImageFilter
+//============================================================================
+
+class LLImageFilter
+{
+public:
+ LLImageFilter(const std::string& file_path);
+ ~LLImageFilter();
+
+ void executeFilter(LLPointer<LLImageRaw> raw_image);
+
+private:
+ // Filter Operations : Transforms
+ void filterGrayScale(); // Convert to grayscale
+ void filterSepia(); // Convert to sepia
+ void filterSaturate(F32 saturation); // < 1.0 desaturates, > 1.0 saturates
+ void filterRotate(F32 angle); // Rotates hue according to angle, angle in degrees
+
+ // Filter Operations : Color Corrections
+ // When specified, the LLColor3 alpha parameter indicates the intensity of the effect for each color channel
+ // acting in effect as an alpha blending factor different for each channel. For instance (1.0,0.0,0.0) will apply
+ // the effect only to the Red channel. Intermediate values blends the effect with the source color.
+ void filterGamma(F32 gamma, const LLColor3& alpha); // Apply gamma to each channel
+ void filterLinearize(F32 tail, const LLColor3& alpha); // Use histogram to linearize constrast between min and max values minus tail
+ void filterEqualize(S32 nb_classes, const LLColor3& alpha); // Use histogram to equalize constrast between nb_classes throughout the image
+ void filterColorize(const LLColor3& color, const LLColor3& alpha); // Colorize with color and alpha per channel
+ void filterContrast(F32 slope, const LLColor3& alpha); // Change contrast according to slope: > 1.0 more contrast, < 1.0 less contrast
+ void filterBrightness(F32 add, const LLColor3& alpha); // Change brightness according to add: > 0 brighter, < 0 darker
+
+ // Filter Primitives
+ void colorTransform(const LLMatrix3 &transform);
+ void colorCorrect(const U8* lut_red, const U8* lut_green, const U8* lut_blue);
+ void filterScreen(EScreenMode mode, const F32 wave_length, const F32 angle);
+ void blendStencil(F32 alpha, U8* pixel, U8 red, U8 green, U8 blue);
+ void convolve(const LLMatrix3 &kernel, bool normalize, bool abs_value);
+
+ // Procedural Stencils
+ void setStencil(EStencilShape shape, EStencilBlendMode mode, F32 min, F32 max, F32* params);
+ F32 getStencilAlpha(S32 i, S32 j);
+
+ // Histograms
+ U32* getBrightnessHistogram();
+ void computeHistograms();
+
+ LLSD mFilterData;
+ LLPointer<LLImageRaw> mImage;
+
+ // Histograms (if we ever happen to need them)
+ U32 *mHistoRed;
+ U32 *mHistoGreen;
+ U32 *mHistoBlue;
+ U32 *mHistoBrightness;
+
+ // Current Stencil Settings
+ EStencilBlendMode mStencilBlendMode;
+ EStencilShape mStencilShape;
+ F32 mStencilMin;
+ F32 mStencilMax;
+
+ S32 mStencilCenterX;
+ S32 mStencilCenterY;
+ S32 mStencilWidth;
+ F32 mStencilGamma;
+
+ F32 mStencilWavelength;
+ F32 mStencilSine;
+ F32 mStencilCosine;
+
+ F32 mStencilStartX;
+ F32 mStencilStartY;
+ F32 mStencilGradX;
+ F32 mStencilGradY;
+ F32 mStencilGradN;
+};
+
+
+#endif
diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp
index 5412f98ee5..7cd59a2983 100755
--- a/indra/llimage/llimagej2c.cpp
+++ b/indra/llimage/llimagej2c.cpp
@@ -24,11 +24,13 @@
*/
#include "linden_common.h"
+#include "llapr.h"
#include "lldir.h"
#include "llimagej2c.h"
#include "lltimer.h"
#include "llmath.h"
#include "llmemory.h"
+#include "llsd.h"
typedef LLImageJ2CImpl* (*CreateLLImageJ2CFunction)();
typedef void (*DestroyLLImageJ2CFunction)(LLImageJ2CImpl*);
@@ -60,6 +62,7 @@ LLImageJ2C::LLImageJ2C() : LLImageFormatted(IMG_CODEC_J2C),
mAreaUsedForDataSizeCalcs(0)
{
mImpl = fallbackCreateLLImageJ2CImpl();
+ claimMem(mImpl);
// Clear data size table
for( S32 i = 0; i <= MAX_DISCARD_LEVEL; i++)
diff --git a/indra/llimage/llimagejpeg.cpp b/indra/llimage/llimagejpeg.cpp
index b70f84efc8..e419c77ff2 100755
--- a/indra/llimage/llimagejpeg.cpp
+++ b/indra/llimage/llimagejpeg.cpp
@@ -32,8 +32,7 @@
jmp_buf LLImageJPEG::sSetjmpBuffer ;
LLImageJPEG::LLImageJPEG(S32 quality)
- :
- LLImageFormatted(IMG_CODEC_JPEG),
+: LLImageFormatted(IMG_CODEC_JPEG),
mOutputBuffer( NULL ),
mOutputBufferSize( 0 ),
mEncodeQuality( quality ) // on a scale from 1 to 100
@@ -374,7 +373,7 @@ boolean LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo )
U8* new_buffer = new U8[ new_buffer_size ];
if (!new_buffer)
{
- llerrs << "Out of memory in LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo )" << llendl;
+ LL_ERRS() << "Out of memory in LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo )" << LL_ENDL;
return FALSE;
}
memcpy( new_buffer, self->mOutputBuffer, self->mOutputBufferSize ); /* Flawfinder: ignore */
@@ -383,7 +382,9 @@ boolean LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo )
cinfo->dest->next_output_byte = self->mOutputBuffer + self->mOutputBufferSize;
cinfo->dest->free_in_buffer = self->mOutputBufferSize;
+ self->disclaimMem(self->mOutputBufferSize);
self->mOutputBufferSize = new_buffer_size;
+ self->claimMem(new_buffer_size);
return TRUE;
}
@@ -465,7 +466,7 @@ void LLImageJPEG::errorOutputMessage( j_common_ptr cinfo )
LLImage::setLastError(error);
BOOL is_decode = (cinfo->is_decompressor != 0);
- llwarns << "LLImageJPEG " << (is_decode ? "decode " : "encode ") << " failed: " << buffer << llendl;
+ LL_WARNS() << "LLImageJPEG " << (is_decode ? "decode " : "encode ") << " failed: " << buffer << LL_ENDL;
}
BOOL LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time )
@@ -489,7 +490,9 @@ BOOL LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time )
// Allocate a temporary buffer big enough to hold the entire compressed image (and then some)
// (Note: we make it bigger in emptyOutputBuffer() if we need to)
delete[] mOutputBuffer;
+ disclaimMem(mOutputBufferSize);
mOutputBufferSize = getWidth() * getHeight() * getComponents() + 1024;
+ claimMem(mOutputBufferSize);
mOutputBuffer = new U8[ mOutputBufferSize ];
const U8* raw_image_data = NULL;
@@ -526,6 +529,7 @@ BOOL LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time )
jpeg_destroy_compress(&cinfo);
delete[] mOutputBuffer;
mOutputBuffer = NULL;
+ disclaimMem(mOutputBufferSize);
mOutputBufferSize = 0;
return FALSE;
}
@@ -628,6 +632,7 @@ BOOL LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time )
// After finish_compress, we can release the temp output buffer.
delete[] mOutputBuffer;
mOutputBuffer = NULL;
+ disclaimMem(mOutputBufferSize);
mOutputBufferSize = 0;
////////////////////////////////////////
@@ -640,6 +645,7 @@ BOOL LLImageJPEG::encode( const LLImageRaw* raw_image, F32 encode_time )
jpeg_destroy_compress(&cinfo);
delete[] mOutputBuffer;
mOutputBuffer = NULL;
+ disclaimMem(mOutputBufferSize);
mOutputBufferSize = 0;
return FALSE;
}
diff --git a/indra/llimage/llimagejpeg.h b/indra/llimage/llimagejpeg.h
index 7ac7f5d2e0..2142660c81 100755
--- a/indra/llimage/llimagejpeg.h
+++ b/indra/llimage/llimagejpeg.h
@@ -31,8 +31,9 @@
#include "llimage.h"
+#include "llwin32headerslean.h"
extern "C" {
-#ifdef LL_STANDALONE
+#ifdef LL_USESYSTEMLIBS
# include <jpeglib.h>
# include <jerror.h>
#else
diff --git a/indra/llimage/llimagetga.cpp b/indra/llimage/llimagetga.cpp
index 920ae2891f..4eb8dc7440 100755
--- a/indra/llimage/llimagetga.cpp
+++ b/indra/llimage/llimagetga.cpp
@@ -266,7 +266,7 @@ BOOL LLImageTGA::updateData()
mColorMap = new U8[ color_map_bytes ];
if (!mColorMap)
{
- llerrs << "Out of Memory in BOOL LLImageTGA::updateData()" << llendl;
+ LL_ERRS() << "Out of Memory in BOOL LLImageTGA::updateData()" << LL_ENDL;
return FALSE;
}
memcpy( mColorMap, getData() + mDataOffset, color_map_bytes ); /* Flawfinder: ignore */
@@ -1043,7 +1043,7 @@ BOOL LLImageTGA::decodeAndProcess( LLImageRaw* raw_image, F32 domain, F32 weight
// Only works for unflipped monochrome RLE images
if( (getComponents() != 1) || (mImageType != 11) || mOriginTopBit || mOriginRightBit )
{
- llerrs << "LLImageTGA trying to alpha-gradient process an image that's not a standard RLE, one component image" << llendl;
+ LL_ERRS() << "LLImageTGA trying to alpha-gradient process an image that's not a standard RLE, one component image" << LL_ENDL;
return FALSE;
}
@@ -1151,7 +1151,7 @@ bool LLImageTGA::loadFile( const std::string& path )
LLFILE* file = LLFile::fopen(path, "rb"); /* Flawfinder: ignore */
if( !file )
{
- llwarns << "Couldn't open file " << path << llendl;
+ LL_WARNS() << "Couldn't open file " << path << LL_ENDL;
return false;
}
@@ -1167,7 +1167,7 @@ bool LLImageTGA::loadFile( const std::string& path )
if( bytes_read != file_size )
{
deleteData();
- llwarns << "Couldn't read file " << path << llendl;
+ LL_WARNS() << "Couldn't read file " << path << LL_ENDL;
return false;
}
@@ -1175,7 +1175,7 @@ bool LLImageTGA::loadFile( const std::string& path )
if( !updateData() )
{
- llwarns << "Couldn't decode file " << path << llendl;
+ LL_WARNS() << "Couldn't decode file " << path << LL_ENDL;
deleteData();
return false;
}
diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp
index ad2eb0f69c..c8b0e872f6 100755
--- a/indra/llimage/llimageworker.cpp
+++ b/indra/llimage/llimageworker.cpp
@@ -60,7 +60,7 @@ S32 LLImageDecodeThread::update(F32 max_time_ms)
bool res = addRequest(req);
if (!res)
{
- llerrs << "request added after LLLFSThread::cleanupClass()" << llendl;
+ LL_ERRS() << "request added after LLLFSThread::cleanupClass()" << LL_ENDL;
}
}
mCreationList.clear();
diff --git a/indra/llimage/tests/llimageworker_test.cpp b/indra/llimage/tests/llimageworker_test.cpp
index e255d65b43..c030b105fb 100755
--- a/indra/llimage/tests/llimageworker_test.cpp
+++ b/indra/llimage/tests/llimageworker_test.cpp
@@ -31,6 +31,8 @@
#include "../llimageworker.h"
// For timer class
#include "../llcommon/lltimer.h"
+// for lltrace class
+#include "../llcommon/lltrace.h"
// Tut header
#include "../test/lltut.h"
@@ -43,7 +45,8 @@
// * A simulator for a class can be implemented here. Please comment and document thoroughly.
LLImageBase::LLImageBase()
-: mData(NULL),
+: LLTrace::MemTrackable<LLImageBase>("LLImageBase"),
+mData(NULL),
mDataSize(0),
mWidth(0),
mHeight(0),
@@ -110,7 +113,6 @@ namespace tut
{
// Instance to be tested
LLImageDecodeThread* mThread;
-
// Constructor and destructor of the test wrapper
imagedecodethread_test()
{
@@ -136,6 +138,7 @@ namespace tut
imagerequest_test()
{
done = false;
+
mRequest = new LLImageDecodeThread::ImageRequest(0, 0,
LLQueuedThread::PRIORITY_NORMAL, 0, FALSE,
new responder_test(&done));
diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp
index d15824ce5a..e98f677d9b 100755
--- a/indra/llimagej2coj/llimagej2coj.cpp
+++ b/indra/llimagej2coj/llimagej2coj.cpp
@@ -73,21 +73,21 @@ sample error callback expecting a LLFILE* client object
*/
void error_callback(const char* msg, void*)
{
- lldebugs << "LLImageJ2COJ: " << chomp(msg) << llendl;
+ LL_DEBUGS() << "LLImageJ2COJ: " << chomp(msg) << LL_ENDL;
}
/**
sample warning callback expecting a LLFILE* client object
*/
void warning_callback(const char* msg, void*)
{
- lldebugs << "LLImageJ2COJ: " << chomp(msg) << llendl;
+ LL_DEBUGS() << "LLImageJ2COJ: " << chomp(msg) << LL_ENDL;
}
/**
sample debug callback expecting no client object
*/
void info_callback(const char* msg, void*)
{
- lldebugs << "LLImageJ2COJ: " << chomp(msg) << llendl;
+ LL_DEBUGS() << "LLImageJ2COJ: " << chomp(msg) << LL_ENDL;
}
// Divide a by 2 to the power of b and round upwards
@@ -203,7 +203,7 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod
if(image->numcomps <= first_channel)
{
- llwarns << "trying to decode more channels than are present in image: numcomps: " << image->numcomps << " first_channel: " << first_channel << llendl;
+ LL_WARNS() << "trying to decode more channels than are present in image: numcomps: " << image->numcomps << " first_channel: " << first_channel << LL_ENDL;
if (image)
{
opj_image_destroy(image);
@@ -472,7 +472,7 @@ BOOL LLImageJ2COJ::getMetadata(LLImageJ2C &base)
if(!image)
{
- llwarns << "ERROR -> getMetadata: failed to decode image!" << llendl;
+ LL_WARNS() << "ERROR -> getMetadata: failed to decode image!" << LL_ENDL;
return FALSE;
}
diff --git a/indra/llinventory/CMakeLists.txt b/indra/llinventory/CMakeLists.txt
index e45c809e7e..0a1f93bd80 100755
--- a/indra/llinventory/CMakeLists.txt
+++ b/indra/llinventory/CMakeLists.txt
@@ -19,6 +19,7 @@ include_directories(
set(llinventory_SOURCE_FILES
llcategory.cpp
lleconomy.cpp
+ llfoldertype.cpp
llinventory.cpp
llinventorydefines.cpp
llinventorytype.cpp
@@ -36,6 +37,7 @@ set(llinventory_HEADER_FILES
llcategory.h
lleconomy.h
+ llfoldertype.h
llinventory.h
llinventorydefines.h
llinventorytype.h
diff --git a/indra/llinventory/llcategory.h b/indra/llinventory/llcategory.h
index 19ce8fa89b..390a8a1f1e 100755
--- a/indra/llinventory/llcategory.h
+++ b/indra/llinventory/llcategory.h
@@ -43,7 +43,7 @@
// S32 count = LLCategory::none.getSubCategoryCount();
// for(S32 i = 0; i < count; i++)
// {
-// llinfos << none.getSubCategory(i).lookupNmae() << llendl;
+// LL_INFOS() << none.getSubCategory(i).lookupNmae() << LL_ENDL;
// }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/indra/llinventory/lleconomy.cpp b/indra/llinventory/lleconomy.cpp
index d643ea6ed9..e10402196f 100755
--- a/indra/llinventory/lleconomy.cpp
+++ b/indra/llinventory/lleconomy.cpp
@@ -101,7 +101,7 @@ void LLGlobalEconomy::processEconomyData(LLMessageSystem *msg, LLGlobalEconomy*
if (fakeprice_str)
{
S32 fakeprice = (S32)atoi(fakeprice_str);
- llwarns << "LL_FAKE_UPLOAD_PRICE: Faking upload price as L$" << fakeprice << llendl;
+ LL_WARNS() << "LL_FAKE_UPLOAD_PRICE: Faking upload price as L$" << fakeprice << LL_ENDL;
econ_data->setPriceUpload(fakeprice);
}
#endif
@@ -143,19 +143,19 @@ S32 LLGlobalEconomy::calculateLightRent(const LLVector3& object_size) const
void LLGlobalEconomy::print()
{
- llinfos << "Global Economy Settings: " << llendl;
- llinfos << "Object Capacity: " << mObjectCapacity << llendl;
- llinfos << "Object Count: " << mObjectCount << llendl;
- llinfos << "Claim Price Per Object: " << mPriceObjectClaim << llendl;
- llinfos << "Claim Price Per Public Object: " << mPricePublicObjectDecay << llendl;
- llinfos << "Delete Price Per Public Object: " << mPricePublicObjectDelete << llendl;
- llinfos << "Release Price Per Public Object: " << getPricePublicObjectRelease() << llendl;
- llinfos << "Price Per Energy Unit: " << mPriceEnergyUnit << llendl;
- llinfos << "Price Per Upload: " << mPriceUpload << llendl;
- llinfos << "Light Base Price: " << mPriceRentLight << llendl;
- llinfos << "Teleport Min Price: " << mTeleportMinPrice << llendl;
- llinfos << "Teleport Price Exponent: " << mTeleportPriceExponent << llendl;
- llinfos << "Price for group creation: " << mPriceGroupCreate << llendl;
+ LL_INFOS() << "Global Economy Settings: " << LL_ENDL;
+ LL_INFOS() << "Object Capacity: " << mObjectCapacity << LL_ENDL;
+ LL_INFOS() << "Object Count: " << mObjectCount << LL_ENDL;
+ LL_INFOS() << "Claim Price Per Object: " << mPriceObjectClaim << LL_ENDL;
+ LL_INFOS() << "Claim Price Per Public Object: " << mPricePublicObjectDecay << LL_ENDL;
+ LL_INFOS() << "Delete Price Per Public Object: " << mPricePublicObjectDelete << LL_ENDL;
+ LL_INFOS() << "Release Price Per Public Object: " << getPricePublicObjectRelease() << LL_ENDL;
+ LL_INFOS() << "Price Per Energy Unit: " << mPriceEnergyUnit << LL_ENDL;
+ LL_INFOS() << "Price Per Upload: " << mPriceUpload << LL_ENDL;
+ LL_INFOS() << "Light Base Price: " << mPriceRentLight << LL_ENDL;
+ LL_INFOS() << "Teleport Min Price: " << mTeleportMinPrice << LL_ENDL;
+ LL_INFOS() << "Teleport Price Exponent: " << mTeleportPriceExponent << LL_ENDL;
+ LL_INFOS() << "Price for group creation: " << mPriceGroupCreate << LL_ENDL;
}
LLRegionEconomy::LLRegionEconomy()
@@ -209,8 +209,8 @@ void LLRegionEconomy::processEconomyDataRequest(LLMessageSystem *msg, void **use
LLRegionEconomy *this_ptr = (LLRegionEconomy*)user_data;
if (!this_ptr->hasData())
{
- llwarns << "Dropping EconomyDataRequest, because EconomyData message "
- << "has not been processed" << llendl;
+ LL_WARNS() << "Dropping EconomyDataRequest, because EconomyData message "
+ << "has not been processed" << LL_ENDL;
}
msg->newMessageFast(_PREHASH_EconomyData);
@@ -254,12 +254,12 @@ void LLRegionEconomy::print()
{
this->LLGlobalEconomy::print();
- llinfos << "Region Economy Settings: " << llendl;
- llinfos << "Land (square meters): " << mAreaTotal << llendl;
- llinfos << "Owned Land (square meters): " << mAreaOwned << llendl;
- llinfos << "Daily Object Rent: " << mPriceObjectRent << llendl;
- llinfos << "Daily Land Rent (per meter): " << getPriceParcelRent() << llendl;
- llinfos << "Energey Efficiency: " << mEnergyEfficiency << llendl;
+ LL_INFOS() << "Region Economy Settings: " << LL_ENDL;
+ LL_INFOS() << "Land (square meters): " << mAreaTotal << LL_ENDL;
+ LL_INFOS() << "Owned Land (square meters): " << mAreaOwned << LL_ENDL;
+ LL_INFOS() << "Daily Object Rent: " << mPriceObjectRent << LL_ENDL;
+ LL_INFOS() << "Daily Land Rent (per meter): " << getPriceParcelRent() << LL_ENDL;
+ LL_INFOS() << "Energey Efficiency: " << mEnergyEfficiency << LL_ENDL;
}
diff --git a/indra/llinventory/lleconomy.h b/indra/llinventory/lleconomy.h
index eb2ecf71ba..47fcf688a2 100755
--- a/indra/llinventory/lleconomy.h
+++ b/indra/llinventory/lleconomy.h
@@ -27,6 +27,7 @@
#define LL_LLECONOMY_H
#include "llsingleton.h"
+#include <list>
class LLMessageSystem;
class LLVector3;
diff --git a/indra/llcommon/llfoldertype.cpp b/indra/llinventory/llfoldertype.cpp
index 9c38349cf7..23bf6da1f9 100755
--- a/indra/llcommon/llfoldertype.cpp
+++ b/indra/llinventory/llfoldertype.cpp
@@ -92,8 +92,8 @@ LLFolderDictionary::LLFolderDictionary()
addEntry(LLFolderType::FT_MESH, new FolderEntry("mesh", TRUE));
- addEntry(LLFolderType::FT_INBOX, new FolderEntry("inbox", FALSE));
- addEntry(LLFolderType::FT_OUTBOX, new FolderEntry("outbox", FALSE));
+ addEntry(LLFolderType::FT_INBOX, new FolderEntry("inbox", TRUE));
+ addEntry(LLFolderType::FT_OUTBOX, new FolderEntry("outbox", TRUE));
addEntry(LLFolderType::FT_BASIC_ROOT, new FolderEntry("basic_rt", TRUE));
@@ -146,7 +146,7 @@ LLAssetType::EType LLFolderType::folderTypeToAssetType(LLFolderType::EType folde
{
if (LLAssetType::lookup(LLAssetType::EType(folder_type)) == LLAssetType::badLookup())
{
- llwarns << "Converting to unknown asset type " << folder_type << llendl;
+ LL_WARNS() << "Converting to unknown asset type " << folder_type << LL_ENDL;
}
return (LLAssetType::EType)folder_type;
}
@@ -156,7 +156,7 @@ LLFolderType::EType LLFolderType::assetTypeToFolderType(LLAssetType::EType asset
{
if (LLFolderType::lookup(LLFolderType::EType(asset_type)) == LLFolderType::badLookup())
{
- llwarns << "Converting to unknown folder type " << asset_type << llendl;
+ LL_WARNS() << "Converting to unknown folder type " << asset_type << LL_ENDL;
}
return (LLFolderType::EType)asset_type;
}
diff --git a/indra/llcommon/llfoldertype.h b/indra/llinventory/llfoldertype.h
index a0c847914f..a0c847914f 100644..100755
--- a/indra/llcommon/llfoldertype.h
+++ b/indra/llinventory/llfoldertype.h
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp
index 41d58c6deb..11647c5518 100755
--- a/indra/llinventory/llinventory.cpp
+++ b/indra/llinventory/llinventory.cpp
@@ -28,6 +28,7 @@
#include "llinventory.h"
#include "lldbstrings.h"
+#include "llfasttimer.h"
#include "llinventorydefines.h"
#include "llxorcipher.h"
#include "llsd.h"
@@ -50,6 +51,7 @@ static const std::string INV_DESC_LABEL("desc");
static const std::string INV_PERMISSIONS_LABEL("permissions");
static const std::string INV_SHADOW_ID_LABEL("shadow_id");
static const std::string INV_ASSET_ID_LABEL("asset_id");
+static const std::string INV_LINKED_ID_LABEL("linked_id");
static const std::string INV_SALE_INFO_LABEL("sale_info");
static const std::string INV_FLAGS_LABEL("flags");
static const std::string INV_CREATION_DATE_LABEL("created_at");
@@ -71,17 +73,20 @@ const LLUUID MAGIC_ID("3c115e51-04f4-523c-9fa6-98aff1034730");
LLInventoryObject::LLInventoryObject(const LLUUID& uuid,
const LLUUID& parent_uuid,
LLAssetType::EType type,
- const std::string& name) :
+ const std::string& name)
+: LLTrace::MemTrackable<LLInventoryObject>("LLInventoryObject"),
mUUID(uuid),
mParentUUID(parent_uuid),
mType(type),
mName(name),
mCreationDate(0)
{
+ claimMem(mName);
correctInventoryName(mName);
}
-LLInventoryObject::LLInventoryObject() :
+LLInventoryObject::LLInventoryObject()
+: LLTrace::MemTrackable<LLInventoryObject>("LLInventoryObject"),
mType(LLAssetType::AT_NONE),
mCreationDate(0)
{
@@ -96,7 +101,9 @@ void LLInventoryObject::copyObject(const LLInventoryObject* other)
mUUID = other->mUUID;
mParentUUID = other->mParentUUID;
mType = other->mType;
+ disclaimMem(mName);
mName = other->mName;
+ claimMem(mName);
}
const LLUUID& LLInventoryObject::getUUID() const
@@ -149,7 +156,9 @@ void LLInventoryObject::rename(const std::string& n)
correctInventoryName(new_name);
if( !new_name.empty() && new_name != mName )
{
+ disclaimMem(mName);
mName = new_name;
+ claimMem(mName);
}
}
@@ -212,8 +221,8 @@ BOOL LLInventoryObject::importLegacyStream(std::istream& input_stream)
}
else
{
- llwarns << "unknown keyword '" << keyword
- << "' in LLInventoryObject::importLegacyStream() for object " << mUUID << llendl;
+ LL_WARNS() << "unknown keyword '" << keyword
+ << "' in LLInventoryObject::importLegacyStream() for object " << mUUID << LL_ENDL;
}
}
return TRUE;
@@ -249,26 +258,19 @@ BOOL LLInventoryObject::exportLegacyStream(std::ostream& output_stream, BOOL) co
return TRUE;
}
-
-void LLInventoryObject::removeFromServer()
-{
- // don't do nothin'
- llwarns << "LLInventoryObject::removeFromServer() called. Doesn't do anything." << llendl;
-}
-
void LLInventoryObject::updateParentOnServer(BOOL) const
{
// don't do nothin'
- llwarns << "LLInventoryObject::updateParentOnServer() called. Doesn't do anything." << llendl;
+ LL_WARNS() << "LLInventoryObject::updateParentOnServer() called. Doesn't do anything." << LL_ENDL;
}
void LLInventoryObject::updateServer(BOOL) const
{
// don't do nothin'
- llwarns << "LLInventoryObject::updateServer() called. Doesn't do anything." << llendl;
+ LL_WARNS() << "LLInventoryObject::updateServer() called. Doesn't do anything." << LL_ENDL;
}
-inline
+// static
void LLInventoryObject::correctInventoryName(std::string& name)
{
LLStringUtil::replaceNonstandardASCII(name, ' ');
@@ -325,6 +327,8 @@ LLInventoryItem::LLInventoryItem(const LLUUID& uuid,
LLStringUtil::replaceNonstandardASCII(mDescription, ' ');
LLStringUtil::replaceChar(mDescription, '|', ' ');
+ claimMem(mDescription);
+
mPermissions.initMasks(inv_type);
}
@@ -356,7 +360,9 @@ void LLInventoryItem::copyItem(const LLInventoryItem* other)
copyObject(other);
mPermissions = other->mPermissions;
mAssetUUID = other->mAssetUUID;
+ disclaimMem(mDescription);
mDescription = other->mDescription;
+ claimMem(mDescription);
mSaleInfo = other->mSaleInfo;
mInventoryType = other->mInventoryType;
mFlags = other->mFlags;
@@ -403,35 +409,42 @@ U32 LLInventoryItem::getCRC32() const
// *NOTE: We currently do not validate the name or description,
// but if they change in transit, it's no big deal.
U32 crc = mUUID.getCRC32();
- //lldebugs << "1 crc: " << std::hex << crc << std::dec << llendl;
+ //LL_DEBUGS() << "1 crc: " << std::hex << crc << std::dec << LL_ENDL;
crc += mParentUUID.getCRC32();
- //lldebugs << "2 crc: " << std::hex << crc << std::dec << llendl;
+ //LL_DEBUGS() << "2 crc: " << std::hex << crc << std::dec << LL_ENDL;
crc += mPermissions.getCRC32();
- //lldebugs << "3 crc: " << std::hex << crc << std::dec << llendl;
+ //LL_DEBUGS() << "3 crc: " << std::hex << crc << std::dec << LL_ENDL;
crc += mAssetUUID.getCRC32();
- //lldebugs << "4 crc: " << std::hex << crc << std::dec << llendl;
+ //LL_DEBUGS() << "4 crc: " << std::hex << crc << std::dec << LL_ENDL;
crc += mType;
- //lldebugs << "5 crc: " << std::hex << crc << std::dec << llendl;
+ //LL_DEBUGS() << "5 crc: " << std::hex << crc << std::dec << LL_ENDL;
crc += mInventoryType;
- //lldebugs << "6 crc: " << std::hex << crc << std::dec << llendl;
+ //LL_DEBUGS() << "6 crc: " << std::hex << crc << std::dec << LL_ENDL;
crc += mFlags;
- //lldebugs << "7 crc: " << std::hex << crc << std::dec << llendl;
+ //LL_DEBUGS() << "7 crc: " << std::hex << crc << std::dec << LL_ENDL;
crc += mSaleInfo.getCRC32();
- //lldebugs << "8 crc: " << std::hex << crc << std::dec << llendl;
+ //LL_DEBUGS() << "8 crc: " << std::hex << crc << std::dec << LL_ENDL;
crc += (U32)mCreationDate;
- //lldebugs << "9 crc: " << std::hex << crc << std::dec << llendl;
+ //LL_DEBUGS() << "9 crc: " << std::hex << crc << std::dec << LL_ENDL;
return crc;
}
+// static
+void LLInventoryItem::correctInventoryDescription(std::string& desc)
+{
+ LLStringUtil::replaceNonstandardASCII(desc, ' ');
+ LLStringUtil::replaceChar(desc, '|', ' ');
+}
void LLInventoryItem::setDescription(const std::string& d)
{
std::string new_desc(d);
- LLStringUtil::replaceNonstandardASCII(new_desc, ' ');
- LLStringUtil::replaceChar(new_desc, '|', ' ');
+ LLInventoryItem::correctInventoryDescription(new_desc);
if( new_desc != mDescription )
{
+ disclaimMem(mDescription);
mDescription = new_desc;
+ claimMem(mDescription);
}
}
@@ -576,13 +589,13 @@ BOOL LLInventoryItem::unpackMessage(LLMessageSystem* msg, const char* block, S32
#ifdef CRC_CHECK
if(local_crc == remote_crc)
{
- lldebugs << "crc matches" << llendl;
+ LL_DEBUGS() << "crc matches" << LL_ENDL;
return TRUE;
}
else
{
- llwarns << "inventory crc mismatch: local=" << std::hex << local_crc
- << " remote=" << remote_crc << std::dec << llendl;
+ LL_WARNS() << "inventory crc mismatch: local=" << std::hex << local_crc
+ << " remote=" << remote_crc << std::dec << LL_ENDL;
return FALSE;
}
#else
@@ -712,13 +725,15 @@ BOOL LLInventoryItem::importFile(LLFILE* fp)
valuestr[0] = '\000';
}
+ disclaimMem(mDescription);
mDescription.assign(valuestr);
+ claimMem(mDescription);
LLStringUtil::replaceNonstandardASCII(mDescription, ' ');
/* TODO -- ask Ian about this code
const char *donkey = mDescription.c_str();
if (donkey[0] == '|')
{
- llerrs << "Donkey" << llendl;
+ LL_ERRS() << "Donkey" << LL_ENDL;
}
*/
}
@@ -730,8 +745,8 @@ BOOL LLInventoryItem::importFile(LLFILE* fp)
}
else
{
- llwarns << "unknown keyword '" << keyword
- << "' in inventory import of item " << mUUID << llendl;
+ LL_WARNS() << "unknown keyword '" << keyword
+ << "' in inventory import of item " << mUUID << LL_ENDL;
}
}
@@ -741,7 +756,7 @@ BOOL LLInventoryItem::importFile(LLFILE* fp)
if((LLInventoryType::IT_NONE == mInventoryType)
|| !inventory_and_asset_types_match(mInventoryType, mType))
{
- lldebugs << "Resetting inventory type for " << mUUID << llendl;
+ LL_DEBUGS() << "Resetting inventory type for " << mUUID << LL_ENDL;
mInventoryType = LLInventoryType::defaultForAssetType(mType);
}
@@ -918,13 +933,15 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream)
valuestr[0] = '\000';
}
+ disclaimMem(mDescription);
mDescription.assign(valuestr);
LLStringUtil::replaceNonstandardASCII(mDescription, ' ');
+ claimMem(mDescription);
/* TODO -- ask Ian about this code
const char *donkey = mDescription.c_str();
if (donkey[0] == '|')
{
- llerrs << "Donkey" << llendl;
+ LL_ERRS() << "Donkey" << LL_ENDL;
}
*/
}
@@ -936,8 +953,8 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream)
}
else
{
- llwarns << "unknown keyword '" << keyword
- << "' in inventory import of item " << mUUID << llendl;
+ LL_WARNS() << "unknown keyword '" << keyword
+ << "' in inventory import of item " << mUUID << LL_ENDL;
}
}
@@ -947,7 +964,7 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream)
if((LLInventoryType::IT_NONE == mInventoryType)
|| !inventory_and_asset_types_match(mInventoryType, mType))
{
- lldebugs << "Resetting inventory type for " << mUUID << llendl;
+ LL_DEBUGS() << "Resetting inventory type for " << mUUID << LL_ENDL;
mInventoryType = LLInventoryType::defaultForAssetType(mType);
}
@@ -1048,13 +1065,18 @@ void LLInventoryItem::asLLSD( LLSD& sd ) const
sd[INV_CREATION_DATE_LABEL] = (S32) mCreationDate;
}
-LLFastTimer::DeclareTimer FTM_INVENTORY_SD_DESERIALIZE("Inventory SD Deserialize");
+LLTrace::BlockTimerStatHandle FTM_INVENTORY_SD_DESERIALIZE("Inventory SD Deserialize");
-bool LLInventoryItem::fromLLSD(const LLSD& sd)
+bool LLInventoryItem::fromLLSD(const LLSD& sd, bool is_new)
{
- LLFastTimer _(FTM_INVENTORY_SD_DESERIALIZE);
- mInventoryType = LLInventoryType::IT_NONE;
- mAssetUUID.setNull();
+ LL_RECORD_BLOCK_TIME(FTM_INVENTORY_SD_DESERIALIZE);
+ if (is_new)
+ {
+ // If we're adding LLSD to an existing object, need avoid
+ // clobbering these fields.
+ mInventoryType = LLInventoryType::IT_NONE;
+ mAssetUUID.setNull();
+ }
std::string w;
w = INV_ITEM_ID_LABEL;
@@ -1111,6 +1133,11 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd)
{
mAssetUUID = sd[w];
}
+ w = INV_LINKED_ID_LABEL;
+ if (sd.has(w))
+ {
+ mAssetUUID = sd[w];
+ }
w = INV_ASSET_TYPE_LABEL;
if (sd.has(w))
{
@@ -1159,8 +1186,10 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd)
w = INV_DESC_LABEL;
if (sd.has(w))
{
+ disclaimMem(mDescription);
mDescription = sd[w].asString();
LLStringUtil::replaceNonstandardASCII(mDescription, ' ');
+ claimMem(mDescription);
}
w = INV_CREATION_DATE_LABEL;
if (sd.has(w))
@@ -1174,7 +1203,7 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd)
if((LLInventoryType::IT_NONE == mInventoryType)
|| !inventory_and_asset_types_match(mInventoryType, mType))
{
- lldebugs << "Resetting inventory type for " << mUUID << llendl;
+ LL_DEBUGS() << "Resetting inventory type for " << mUUID << LL_ENDL;
mInventoryType = LLInventoryType::defaultForAssetType(mType);
}
@@ -1247,7 +1276,7 @@ void LLInventoryItem::unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size)
if (NULL == bin_bucket)
{
- llerrs << "unpackBinaryBucket failed. bin_bucket is NULL." << llendl;
+ LL_ERRS() << "unpackBinaryBucket failed. bin_bucket is NULL." << LL_ENDL;
return;
}
@@ -1257,7 +1286,7 @@ void LLInventoryItem::unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size)
item_buffer[bin_bucket_size] = '\0';
std::string str(&item_buffer[0]);
- lldebugs << "item buffer: " << str << llendl;
+ LL_DEBUGS() << "item buffer: " << str << LL_ENDL;
// Tokenize the string.
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
@@ -1294,7 +1323,7 @@ void LLInventoryItem::unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size)
perm.init(creator_id, owner_id, last_owner_id, group_id);
perm.initMasks(mask_base, mask_owner, mask_group, mask_every, mask_next);
setPermissions(perm);
- //lldebugs << "perm: " << perm << llendl;
+ //LL_DEBUGS() << "perm: " << perm << LL_ENDL;
LLUUID asset_id((*(iter++)).c_str());
setAssetUUID(asset_id);
@@ -1495,8 +1524,8 @@ BOOL LLInventoryCategory::importFile(LLFILE* fp)
}
else
{
- llwarns << "unknown keyword '" << keyword
- << "' in inventory import category " << mUUID << llendl;
+ LL_WARNS() << "unknown keyword '" << keyword
+ << "' in inventory import category " << mUUID << LL_ENDL;
}
}
return TRUE;
@@ -1574,8 +1603,8 @@ BOOL LLInventoryCategory::importLegacyStream(std::istream& input_stream)
}
else
{
- llwarns << "unknown keyword '" << keyword
- << "' in inventory import category " << mUUID << llendl;
+ LL_WARNS() << "unknown keyword '" << keyword
+ << "' in inventory import category " << mUUID << LL_ENDL;
}
}
return TRUE;
@@ -1606,8 +1635,8 @@ LLSD ll_create_sd_from_inventory_item(LLPointer<LLInventoryItem> item)
if(item.isNull()) return rv;
if (item->getType() == LLAssetType::AT_NONE)
{
- llwarns << "ll_create_sd_from_inventory_item() for item with AT_NONE"
- << llendl;
+ LL_WARNS() << "ll_create_sd_from_inventory_item() for item with AT_NONE"
+ << LL_ENDL;
return rv;
}
rv[INV_ITEM_ID_LABEL] = item->getUUID();
@@ -1632,8 +1661,8 @@ LLSD ll_create_sd_from_inventory_category(LLPointer<LLInventoryCategory> cat)
if(cat.isNull()) return rv;
if (cat->getType() == LLAssetType::AT_NONE)
{
- llwarns << "ll_create_sd_from_inventory_category() for cat with AT_NONE"
- << llendl;
+ LL_WARNS() << "ll_create_sd_from_inventory_category() for cat with AT_NONE"
+ << LL_ENDL;
return rv;
}
rv[INV_FOLDER_ID_LABEL] = cat->getUUID();
diff --git a/indra/llinventory/llinventory.h b/indra/llinventory/llinventory.h
index 99716ed7be..70b200e139 100755
--- a/indra/llinventory/llinventory.h
+++ b/indra/llinventory/llinventory.h
@@ -27,7 +27,6 @@
#ifndef LL_LLINVENTORY_H
#define LL_LLINVENTORY_H
-#include "lldarray.h"
#include "llfoldertype.h"
#include "llinventorytype.h"
#include "llpermissions.h"
@@ -35,6 +34,7 @@
#include "llsaleinfo.h"
#include "llsd.h"
#include "lluuid.h"
+#include "lltrace.h"
class LLMessageSystem;
@@ -44,10 +44,11 @@ class LLMessageSystem;
// Base class for anything in the user's inventory. Handles the common code
// between items and categories.
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-class LLInventoryObject : public LLRefCount
+class LLInventoryObject : public LLRefCount, public LLTrace::MemTrackable<LLInventoryObject>
{
public:
typedef std::list<LLPointer<LLInventoryObject> > object_list_t;
+ typedef std::list<LLConstPointer<LLInventoryObject> > const_object_list_t;
//--------------------------------------------------------------------
// Initialization
@@ -86,22 +87,19 @@ public:
void setType(LLAssetType::EType type);
virtual void setCreationDate(time_t creation_date_utc); // only stored for items
-private:
// in place correction for inventory name string
- void correctInventoryName(std::string& name);
+ static void correctInventoryName(std::string& name);
//--------------------------------------------------------------------
// File Support
// Implemented here so that a minimal information set can be transmitted
// between simulator and viewer.
//--------------------------------------------------------------------
-public:
// virtual BOOL importFile(LLFILE* fp);
virtual BOOL exportFile(LLFILE* fp, BOOL include_asset_key = TRUE) const;
virtual BOOL importLegacyStream(std::istream& input_stream);
virtual BOOL exportLegacyStream(std::ostream& output_stream, BOOL include_asset_key = TRUE) const;
- virtual void removeFromServer();
virtual void updateParentOnServer(BOOL) const;
virtual void updateServer(BOOL) const;
@@ -124,7 +122,7 @@ protected:
class LLInventoryItem : public LLInventoryObject
{
public:
- typedef LLDynamicArray<LLPointer<LLInventoryItem> > item_array_t;
+ typedef std::vector<LLPointer<LLInventoryItem> > item_array_t;
//--------------------------------------------------------------------
// Initialization
@@ -174,6 +172,7 @@ public:
//--------------------------------------------------------------------
public:
void setAssetUUID(const LLUUID& asset_id);
+ static void correctInventoryDescription(std::string& name);
void setDescription(const std::string& new_desc);
void setSaleInfo(const LLSaleInfo& sale_info);
void setPermissions(const LLPermissions& perm);
@@ -212,7 +211,7 @@ public:
void unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size);
LLSD asLLSD() const;
void asLLSD( LLSD& sd ) const;
- bool fromLLSD(const LLSD& sd);
+ bool fromLLSD(const LLSD& sd, bool is_new = true);
//--------------------------------------------------------------------
// Member Variables
@@ -235,7 +234,7 @@ protected:
class LLInventoryCategory : public LLInventoryObject
{
public:
- typedef LLDynamicArray<LLPointer<LLInventoryCategory> > cat_array_t;
+ typedef std::vector<LLPointer<LLInventoryCategory> > cat_array_t;
//--------------------------------------------------------------------
// Initialization
diff --git a/indra/llinventory/lllandmark.cpp b/indra/llinventory/lllandmark.cpp
index 493909cf9c..4c6075d6b5 100755
--- a/indra/llinventory/lllandmark.cpp
+++ b/indra/llinventory/lllandmark.cpp
@@ -128,7 +128,7 @@ LLLandmark* LLLandmark::constructFromString(const char *buffer)
goto error;
}
cur += chars_read;
- // llinfos << "Landmark read: " << pos << llendl;
+ // LL_INFOS() << "Landmark read: " << pos << LL_ENDL;
return new LLLandmark(pos);
}
@@ -155,7 +155,7 @@ LLLandmark* LLLandmark::constructFromString(const char *buffer)
}
error:
- llinfos << "Bad Landmark Asset: bad _DATA_ block." << llendl;
+ LL_INFOS() << "Bad Landmark Asset: bad _DATA_ block." << LL_ENDL;
return NULL;
}
@@ -176,7 +176,7 @@ void LLLandmark::requestRegionHandle(
if(region_id.isNull())
{
// don't bother with checking - it's 0.
- lldebugs << "requestRegionHandle: null" << llendl;
+ LL_DEBUGS() << "requestRegionHandle: null" << LL_ENDL;
if(callback)
{
const U64 U64_ZERO = 0;
@@ -187,7 +187,7 @@ void LLLandmark::requestRegionHandle(
{
if(region_id == mLocalRegion.first)
{
- lldebugs << "requestRegionHandle: local" << llendl;
+ LL_DEBUGS() << "requestRegionHandle: local" << LL_ENDL;
if(callback)
{
callback(region_id, mLocalRegion.second);
@@ -198,14 +198,14 @@ void LLLandmark::requestRegionHandle(
region_map_t::iterator it = mRegions.find(region_id);
if(it == mRegions.end())
{
- lldebugs << "requestRegionHandle: upstream" << llendl;
+ LL_DEBUGS() << "requestRegionHandle: upstream" << LL_ENDL;
if(callback)
{
region_callback_map_t::value_type vt(region_id, callback);
sRegionCallbackMap.insert(vt);
}
- lldebugs << "Landmark requesting information about: "
- << region_id << llendl;
+ LL_DEBUGS() << "Landmark requesting information about: "
+ << region_id << LL_ENDL;
msg->newMessage("RegionHandleRequest");
msg->nextBlock("RequestBlock");
msg->addUUID("RegionID", region_id);
@@ -214,7 +214,7 @@ void LLLandmark::requestRegionHandle(
else if(callback)
{
// we have the answer locally - just call the callack.
- lldebugs << "requestRegionHandle: ready" << llendl;
+ LL_DEBUGS() << "requestRegionHandle: ready" << LL_ENDL;
callback(region_id, (*it).second.mRegionHandle);
}
}
@@ -248,8 +248,8 @@ void LLLandmark::processRegionIDAndHandle(LLMessageSystem* msg, void**)
#if LL_DEBUG
U32 grid_x, grid_y;
grid_from_region_handle(info.mRegionHandle, &grid_x, &grid_y);
- lldebugs << "Landmark got reply for region: " << region_id << " "
- << grid_x << "," << grid_y << llendl;
+ LL_DEBUGS() << "Landmark got reply for region: " << region_id << " "
+ << grid_x << "," << grid_y << LL_ENDL;
#endif
// make all the callbacks here.
diff --git a/indra/llinventory/llnotecard.cpp b/indra/llinventory/llnotecard.cpp
index 69152cefe0..908c647498 100755
--- a/indra/llinventory/llnotecard.cpp
+++ b/indra/llinventory/llnotecard.cpp
@@ -57,33 +57,33 @@ bool LLNotecard::importEmbeddedItemsStream(std::istream& str)
str >> std::ws >> "LLEmbeddedItems version" >> mEmbeddedVersion >> "\n";
if (str.fail())
{
- llwarns << "Invalid Linden text file header" << llendl;
+ LL_WARNS() << "Invalid Linden text file header" << LL_ENDL;
goto import_file_failed;
}
if( 1 != mEmbeddedVersion )
{
- llwarns << "Invalid LLEmbeddedItems version: " << mEmbeddedVersion << llendl;
+ LL_WARNS() << "Invalid LLEmbeddedItems version: " << mEmbeddedVersion << LL_ENDL;
goto import_file_failed;
}
str >> std::ws >> "{\n";
if(str.fail())
{
- llwarns << "Invalid Linden text file format: missing {" << llendl;
+ LL_WARNS() << "Invalid Linden text file format: missing {" << LL_ENDL;
goto import_file_failed;
}
str >> std::ws >> "count " >> count >> "\n";
if(str.fail())
{
- llwarns << "Invalid LLEmbeddedItems count" << llendl;
+ LL_WARNS() << "Invalid LLEmbeddedItems count" << LL_ENDL;
goto import_file_failed;
}
if((count < 0))
{
- llwarns << "Invalid LLEmbeddedItems count value: " << count << llendl;
+ LL_WARNS() << "Invalid LLEmbeddedItems count value: " << count << LL_ENDL;
goto import_file_failed;
}
@@ -92,7 +92,7 @@ bool LLNotecard::importEmbeddedItemsStream(std::istream& str)
str >> std::ws >> "{\n";
if(str.fail())
{
- llwarns << "Invalid LLEmbeddedItems file format: missing {" << llendl;
+ LL_WARNS() << "Invalid LLEmbeddedItems file format: missing {" << LL_ENDL;
goto import_file_failed;
}
@@ -100,21 +100,21 @@ bool LLNotecard::importEmbeddedItemsStream(std::istream& str)
str >> std::ws >> "ext char index " >> index >> "\n";
if(str.fail())
{
- llwarns << "Invalid LLEmbeddedItems file format: missing ext char index" << llendl;
+ LL_WARNS() << "Invalid LLEmbeddedItems file format: missing ext char index" << LL_ENDL;
goto import_file_failed;
}
str >> std::ws >> "inv_item\t0\n";
if(str.fail())
{
- llwarns << "Invalid LLEmbeddedItems file format: missing inv_item" << llendl;
+ LL_WARNS() << "Invalid LLEmbeddedItems file format: missing inv_item" << LL_ENDL;
goto import_file_failed;
}
LLPointer<LLInventoryItem> item = new LLInventoryItem;
if (!item->importLegacyStream(str))
{
- llinfos << "notecard import failed" << llendl;
+ LL_INFOS() << "notecard import failed" << LL_ENDL;
goto import_file_failed;
}
mItems.push_back(item);
@@ -122,7 +122,7 @@ bool LLNotecard::importEmbeddedItemsStream(std::istream& str)
str >> std::ws >> "}\n";
if(str.fail())
{
- llwarns << "Invalid LLEmbeddedItems file format: missing }" << llendl;
+ LL_WARNS() << "Invalid LLEmbeddedItems file format: missing }" << LL_ENDL;
goto import_file_failed;
}
}
@@ -130,7 +130,7 @@ bool LLNotecard::importEmbeddedItemsStream(std::istream& str)
str >> std::ws >> "}\n";
if(str.fail())
{
- llwarns << "Invalid LLEmbeddedItems file format: missing }" << llendl;
+ LL_WARNS() << "Invalid LLEmbeddedItems file format: missing }" << LL_ENDL;
goto import_file_failed;
}
@@ -161,20 +161,20 @@ bool LLNotecard::importStream(std::istream& str)
str >> std::ws >> "Linden text version " >> mVersion >> "\n";
if(str.fail())
{
- llwarns << "Invalid Linden text file header " << llendl;
+ LL_WARNS() << "Invalid Linden text file header " << LL_ENDL;
return FALSE;
}
if( 1 != mVersion && 2 != mVersion)
{
- llwarns << "Invalid Linden text file version: " << mVersion << llendl;
+ LL_WARNS() << "Invalid Linden text file version: " << mVersion << LL_ENDL;
return FALSE;
}
str >> std::ws >> "{\n";
if(str.fail())
{
- llwarns << "Invalid Linden text file format" << llendl;
+ LL_WARNS() << "Invalid Linden text file format" << LL_ENDL;
return FALSE;
}
@@ -187,7 +187,7 @@ bool LLNotecard::importStream(std::istream& str)
str.getline(line_buf, STD_STRING_BUF_SIZE);
if(str.fail())
{
- llwarns << "Invalid Linden text length field" << llendl;
+ LL_WARNS() << "Invalid Linden text length field" << LL_ENDL;
return FALSE;
}
line_buf[STD_STRING_STR_LEN] = '\0';
@@ -195,13 +195,13 @@ bool LLNotecard::importStream(std::istream& str)
S32 text_len = 0;
if( 1 != sscanf(line_buf, "Text length %d", &text_len) )
{
- llwarns << "Invalid Linden text length field" << llendl;
+ LL_WARNS() << "Invalid Linden text length field" << LL_ENDL;
return FALSE;
}
if(text_len > mMaxText || text_len < 0)
{
- llwarns << "Invalid Linden text length: " << text_len << llendl;
+ LL_WARNS() << "Invalid Linden text length: " << text_len << LL_ENDL;
return FALSE;
}
@@ -211,7 +211,7 @@ bool LLNotecard::importStream(std::istream& str)
fullread(str, text, text_len);
if(str.fail())
{
- llwarns << "Invalid Linden text: text shorter than text length: " << text_len << llendl;
+ LL_WARNS() << "Invalid Linden text: text shorter than text length: " << text_len << LL_ENDL;
success = FALSE;
}
text[text_len] = '\0';
diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp
index 5eb5fb442d..b24e14c72b 100755
--- a/indra/llinventory/llparcel.cpp
+++ b/indra/llinventory/llparcel.cpp
@@ -136,7 +136,7 @@ LLParcel::LLParcel(const LLUUID &owner_id,
// virtual
LLParcel::~LLParcel()
{
- // user list cleaned up by LLDynamicArray destructor.
+ // user list cleaned up by std::vector destructor.
}
void LLParcel::init(const LLUUID &owner_id,
@@ -470,8 +470,8 @@ BOOL LLParcel::importAccessEntry(std::istream& input_stream, LLAccessEntry* entr
}
else
{
- llwarns << "Unknown keyword in parcel access entry section: <"
- << keyword << ">" << llendl;
+ LL_WARNS() << "Unknown keyword in parcel access entry section: <"
+ << keyword << ">" << LL_ENDL;
}
}
return input_stream.good();
@@ -793,8 +793,6 @@ BOOL LLParcel::addToAccessList(const LLUUID& agent_id, S32 time)
}
}
- removeFromBanList(agent_id);
-
LLAccessEntry new_entry;
new_entry.mID = agent_id;
new_entry.mTime = time;
@@ -838,8 +836,6 @@ BOOL LLParcel::addToBanList(const LLUUID& agent_id, S32 time)
}
}
- removeFromAccessList(agent_id);
-
LLAccessEntry new_entry;
new_entry.mID = agent_id;
new_entry.mTime = time;
@@ -971,7 +967,7 @@ void LLParcel::startSale(const LLUUID& buyer_id, BOOL is_buyer_group)
mGroupID.setNull();
}
mSaleTimerExpires.start();
- mSaleTimerExpires.setTimerExpirySec(DEFAULT_USEC_SALE_TIMEOUT / SEC_TO_MICROSEC);
+ mSaleTimerExpires.setTimerExpirySec(U64Microseconds(DEFAULT_USEC_SALE_TIMEOUT));
mStatus = OS_LEASE_PENDING;
mClaimDate = time(NULL);
setAuctionID(0);
@@ -1096,9 +1092,9 @@ void LLParcel::clearParcel()
void LLParcel::dump()
{
- llinfos << "parcel " << mLocalID << " area " << mArea << llendl;
- llinfos << " name <" << mName << ">" << llendl;
- llinfos << " desc <" << mDesc << ">" << llendl;
+ LL_INFOS() << "parcel " << mLocalID << " area " << mArea << LL_ENDL;
+ LL_INFOS() << " name <" << mName << ">" << LL_ENDL;
+ LL_INFOS() << " desc <" << mDesc << ">" << LL_ENDL;
}
const std::string& ownership_status_to_string(LLParcel::EOwnershipStatus status)
@@ -1178,7 +1174,7 @@ LLParcel::ECategory category_string_to_category(const std::string& s)
return (LLParcel::ECategory)i;
}
}
- llwarns << "Parcel category outside of possibilities " << s << llendl;
+ LL_WARNS() << "Parcel category outside of possibilities " << s << LL_ENDL;
return LLParcel::C_NONE;
}
diff --git a/indra/llinventory/llpermissions.cpp b/indra/llinventory/llpermissions.cpp
index 7e013de11a..e79b753514 100755
--- a/indra/llinventory/llpermissions.cpp
+++ b/indra/llinventory/llpermissions.cpp
@@ -31,7 +31,6 @@
// library includes
#include "message.h"
-#include "metapropertyt.h"
#include "llsd.h"
///----------------------------------------------------------------------------
@@ -117,7 +116,7 @@ LLUUID LLPermissions::getSafeOwner() const
}
else
{
- llwarns << "LLPermissions::getSafeOwner() called with no valid owner!" << llendl;
+ LL_WARNS() << "LLPermissions::getSafeOwner() called with no valid owner!" << LL_ENDL;
LLUUID unused_uuid;
unused_uuid.generate();
@@ -666,7 +665,7 @@ BOOL LLPermissions::importFile(LLFILE* fp)
}
else
{
- llinfos << "unknown keyword " << keyword << " in permissions import" << llendl;
+ LL_INFOS() << "unknown keyword " << keyword << " in permissions import" << LL_ENDL;
}
}
fix();
@@ -800,7 +799,7 @@ BOOL LLPermissions::importLegacyStream(std::istream& input_stream)
}
else
{
- llinfos << "unknown keyword " << keyword << " in permissions import" << llendl;
+ LL_INFOS() << "unknown keyword " << keyword << " in permissions import" << LL_ENDL;
}
}
fix();
@@ -895,21 +894,6 @@ std::ostream& operator<<(std::ostream &s, const LLPermissions &perm)
return s;
}
-template <>
-void LLMetaClassT<LLPermissions>::reflectProperties(LLMetaClass& meta_class)
-{
- reflectProperty(meta_class, "mCreator", &LLPermissions::mCreator);
- reflectProperty(meta_class, "mOwner", &LLPermissions::mOwner);
- reflectProperty(meta_class, "mGroup", &LLPermissions::mGroup);
- reflectProperty(meta_class, "mIsGroupOwned", &LLPermissions::mIsGroupOwned);
-}
-
-// virtual
-const LLMetaClass& LLPermissions::getMetaClass() const
-{
- return LLMetaClassT<LLPermissions>::instance();
-}
-
///----------------------------------------------------------------------------
/// Class LLAggregatePermissions
///----------------------------------------------------------------------------
@@ -997,8 +981,8 @@ void LLAggregatePermissions::aggregateBit(EPermIndex idx, BOOL allowed)
mBits[idx] = allowed ? AP_ALL : AP_SOME;
break;
default:
- llwarns << "Bad aggregateBit " << (S32)idx << " "
- << (allowed ? "true" : "false") << llendl;
+ LL_WARNS() << "Bad aggregateBit " << (S32)idx << " "
+ << (allowed ? "true" : "false") << LL_ENDL;
break;
}
}
@@ -1042,8 +1026,8 @@ void LLAggregatePermissions::aggregateIndex(EPermIndex idx, U8 bits)
}
break;
default:
- llwarns << "Bad aggregate index " << (S32)idx << " "
- << (S32)bits << llendl;
+ LL_WARNS() << "Bad aggregate index " << (S32)idx << " "
+ << (S32)bits << LL_ENDL;
break;
}
}
diff --git a/indra/llinventory/llpermissions.h b/indra/llinventory/llpermissions.h
index 3ecc922370..89c66f6ebd 100755
--- a/indra/llinventory/llpermissions.h
+++ b/indra/llinventory/llpermissions.h
@@ -31,7 +31,6 @@
#include "llsd.h"
#include "lluuid.h"
#include "llxmlnode.h"
-#include "reflective.h"
#include "llinventorytype.h"
// prototypes
@@ -83,7 +82,7 @@ template<class T> class LLMetaClassT;
// logical consistency.
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-class LLPermissions : public LLReflective
+class LLPermissions
{
private:
LLUUID mCreator; // null if object created by system
@@ -324,9 +323,6 @@ public:
friend std::ostream& operator<<(std::ostream &s, const LLPermissions &perm);
- // Reflection.
- friend class LLMetaClassT<LLPermissions>;
- virtual const LLMetaClass& getMetaClass() const;
};
// Inlines
diff --git a/indra/llinventory/llsaleinfo.cpp b/indra/llinventory/llsaleinfo.cpp
index dd408a8efe..63e34d188e 100755
--- a/indra/llinventory/llsaleinfo.cpp
+++ b/indra/llinventory/llsaleinfo.cpp
@@ -179,14 +179,14 @@ BOOL LLSaleInfo::importFile(LLFILE* fp, BOOL& has_perm_mask, U32& perm_mask)
}
else if (!strcmp("perm_mask", keyword))
{
- //llinfos << "found deprecated keyword perm_mask" << llendl;
+ //LL_INFOS() << "found deprecated keyword perm_mask" << LL_ENDL;
has_perm_mask = TRUE;
sscanf(valuestr, "%x", &perm_mask);
}
else
{
- llwarns << "unknown keyword '" << keyword
- << "' in sale info import" << llendl;
+ LL_WARNS() << "unknown keyword '" << keyword
+ << "' in sale info import" << LL_ENDL;
}
}
return success;
@@ -235,14 +235,14 @@ BOOL LLSaleInfo::importLegacyStream(std::istream& input_stream, BOOL& has_perm_m
}
else if (!strcmp("perm_mask", keyword))
{
- //llinfos << "found deprecated keyword perm_mask" << llendl;
+ //LL_INFOS() << "found deprecated keyword perm_mask" << LL_ENDL;
has_perm_mask = TRUE;
sscanf(valuestr, "%x", &perm_mask);
}
else
{
- llwarns << "unknown keyword '" << keyword
- << "' in sale info import" << llendl;
+ LL_WARNS() << "unknown keyword '" << keyword
+ << "' in sale info import" << LL_ENDL;
}
}
return success;
diff --git a/indra/llinventory/lltransactionflags.cpp b/indra/llinventory/lltransactionflags.cpp
index ee0e6ae26c..e21f29df41 100755
--- a/indra/llinventory/lltransactionflags.cpp
+++ b/indra/llinventory/lltransactionflags.cpp
@@ -92,11 +92,11 @@ std::string build_transfer_message_to_source(
S32 transaction_type,
const std::string& description)
{
- lldebugs << "build_transfer_message_to_source: " << amount << " "
+ LL_DEBUGS() << "build_transfer_message_to_source: " << amount << " "
<< source_id << " " << dest_id << " " << dest_name << " "
<< transaction_type << " "
<< (description.empty() ? "(no desc)" : description)
- << llendl;
+ << LL_ENDL;
if(source_id.isNull())
{
return description;
@@ -144,10 +144,10 @@ std::string build_transfer_message_to_destination(
S32 transaction_type,
const std::string& description)
{
- lldebugs << "build_transfer_message_to_dest: " << amount << " "
+ LL_DEBUGS() << "build_transfer_message_to_dest: " << amount << " "
<< dest_id << " " << source_id << " " << source_name << " "
<< transaction_type << " " << (description.empty() ? "(no desc)" : description)
- << llendl;
+ << LL_ENDL;
if(0 == amount)
{
return std::string();
diff --git a/indra/llinventory/tests/inventorymisc_test.cpp b/indra/llinventory/tests/inventorymisc_test.cpp
index c9af7c4eac..7b15552f24 100755
--- a/indra/llinventory/tests/inventorymisc_test.cpp
+++ b/indra/llinventory/tests/inventorymisc_test.cpp
@@ -153,7 +153,7 @@ namespace tut
{
LLPointer<LLInventoryItem> src = create_random_inventory_item();
LLSD sd = ll_create_sd_from_inventory_item(src);
- //llinfos << "sd: " << *sd << llendl;
+ //LL_INFOS() << "sd: " << *sd << LL_ENDL;
LLPointer<LLInventoryItem> dst = new LLInventoryItem;
bool successful_parse = dst->fromLLSD(sd);
ensure_equals("0.LLInventoryItem::fromLLSD()", successful_parse, true);
@@ -219,7 +219,7 @@ namespace tut
src->setCreationDate(new_creation);
sd = ll_create_sd_from_inventory_item(src);
- //llinfos << "sd: " << *sd << llendl;
+ //LL_INFOS() << "sd: " << *sd << LL_ENDL;
successful_parse = dst->fromLLSD(sd);
ensure_equals("13.item id::getUUID() failed", dst->getUUID(), src->getUUID());
ensure_equals("14.parent::getParentUUID() failed", dst->getParentUUID(), src->getParentUUID());
@@ -323,7 +323,7 @@ namespace tut
LLFILE* fp = LLFile::fopen("linden_file.dat","w+");
if(!fp)
{
- llerrs << "file could not be opened\n" << llendl;
+ LL_ERRS() << "file could not be opened\n" << LL_ENDL;
return;
}
@@ -335,7 +335,7 @@ namespace tut
fp = LLFile::fopen("linden_file.dat","r+");
if(!fp)
{
- llerrs << "file could not be opened\n" << llendl;
+ LL_ERRS() << "file could not be opened\n" << LL_ENDL;
return;
}
@@ -460,7 +460,7 @@ namespace tut
LLFILE* fp = LLFile::fopen("linden_file.dat","w");
if(!fp)
{
- llerrs << "file coudnt be opened\n" << llendl;
+ LL_ERRS() << "file coudnt be opened\n" << LL_ENDL;
return;
}
@@ -472,7 +472,7 @@ namespace tut
fp = LLFile::fopen("linden_file.dat","r");
if(!fp)
{
- llerrs << "file coudnt be opened\n" << llendl;
+ LL_ERRS() << "file coudnt be opened\n" << LL_ENDL;
return;
}
diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp
index 0c0a844b73..6a8959517d 100755
--- a/indra/llkdu/llimagej2ckdu.cpp
+++ b/indra/llkdu/llimagej2ckdu.cpp
@@ -156,22 +156,22 @@ public:
void LLKDUMessageWarning::put_text(const char *s)
{
- llinfos << "KDU Warning: " << s << llendl;
+ LL_INFOS() << "KDU Warning: " << s << LL_ENDL;
}
void LLKDUMessageWarning::put_text(const kdu_uint16 *s)
{
- llinfos << "KDU Warning: " << s << llendl;
+ LL_INFOS() << "KDU Warning: " << s << LL_ENDL;
}
void LLKDUMessageError::put_text(const char *s)
{
- llinfos << "KDU Error: " << s << llendl;
+ LL_INFOS() << "KDU Error: " << s << LL_ENDL;
}
void LLKDUMessageError::put_text(const kdu_uint16 *s)
{
- llinfos << "KDU Error: " << s << llendl;
+ LL_INFOS() << "KDU Error: " << s << LL_ENDL;
}
void LLKDUMessageError::flush(bool end_of_message)
@@ -290,7 +290,7 @@ void LLImageJ2CKDU::setupCodeStream(LLImageJ2C &base, BOOL keep_codestream, ECod
kdu_dims dims2; mCodeStreamp->get_dims(2,dims2);
if ((dims1 != dims) || (dims2 != dims))
{
- llerrs << "Components don't have matching dimensions!" << llendl;
+ LL_ERRS() << "Components don't have matching dimensions!" << LL_ENDL;
}
}
@@ -393,7 +393,7 @@ BOOL LLImageJ2CKDU::initDecode(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco
region_kdu->size.y = region[3] - region[1];
}
int discard = (discard_level != -1 ? discard_level : base.getRawDiscardLevel());
- //llinfos << "Merov debug : initDecode, discard used = " << discard << ", asked = " << discard_level << llendl;
+ //LL_INFOS() << "Merov debug : initDecode, discard used = " << discard << ", asked = " << discard_level << LL_ENDL;
// Apply loading restrictions
mCodeStreamp->apply_input_restrictions( first_channel, max_channel_count, discard, 0, region_kdu);
diff --git a/indra/llkdu/tests/llimagej2ckdu_test.cpp b/indra/llkdu/tests/llimagej2ckdu_test.cpp
index 62c245f125..3f627b65e1 100755
--- a/indra/llkdu/tests/llimagej2ckdu_test.cpp
+++ b/indra/llkdu/tests/llimagej2ckdu_test.cpp
@@ -43,7 +43,9 @@
// End Stubbing
// -------------------------------------------------------------------------------------------
-// Stubb the LL Image Classes
+// Stub the LL Image Classes
+//LLTrace::MemStatHandle LLImageBase::sMemStat("LLImage");
+
LLImageRaw::LLImageRaw() { }
LLImageRaw::~LLImageRaw() { }
U8* LLImageRaw::allocateData(S32 ) { return NULL; }
@@ -52,7 +54,8 @@ U8* LLImageRaw::reallocateData(S32 ) { return NULL; }
BOOL LLImageRaw::resize(U16, U16, S8) { return TRUE; } // this method always returns TRUE...
LLImageBase::LLImageBase()
-: mData(NULL),
+: LLTrace::MemTrackable<LLImageBase>("LLImageBase"),
+mData(NULL),
mDataSize(0),
mWidth(0),
mHeight(0),
diff --git a/indra/llmath/llcalc.cpp b/indra/llmath/llcalc.cpp
index 1b2d609b67..edc6986cc9 100755
--- a/indra/llmath/llcalc.cpp
+++ b/indra/llmath/llcalc.cpp
@@ -141,20 +141,20 @@ bool LLCalc::evalString(const std::string& expression, F32& result)
try
{
info = parse(start, expr_upper.end(), calc, space_p);
- lldebugs << "Math expression: " << expression << " = " << result << llendl;
+ LL_DEBUGS() << "Math expression: " << expression << " = " << result << LL_ENDL;
}
catch(parser_error<std::string, std::string::iterator> &e)
{
mLastErrorPos = e.where - expr_upper.begin();
- llinfos << "Calc parser exception: " << e.descriptor << " at " << mLastErrorPos << " in expression: " << expression << llendl;
+ LL_INFOS() << "Calc parser exception: " << e.descriptor << " at " << mLastErrorPos << " in expression: " << expression << LL_ENDL;
return false;
}
if (!info.full)
{
mLastErrorPos = info.stop - expr_upper.begin();
- llinfos << "Unhandled syntax error at " << mLastErrorPos << " in expression: " << expression << llendl;
+ LL_INFOS() << "Unhandled syntax error at " << mLastErrorPos << " in expression: " << expression << LL_ENDL;
return false;
}
diff --git a/indra/llmath/llcalcparser.h b/indra/llmath/llcalcparser.h
index e0ad270266..faa699ff7b 100755
--- a/indra/llmath/llcalcparser.h
+++ b/indra/llmath/llcalcparser.h
@@ -163,7 +163,7 @@ private:
bool checkNaN(const F32& a) const { return !llisnan(a); }
- //FIX* non ambigious function fix making SIN() work for calc -Cryogenic Blitz
+ //FIX* non ambiguous function fix making SIN() work for calc -Cryogenic Blitz
F32 _sin(const F32& a) const { return sin(DEG_TO_RAD * a); }
F32 _cos(const F32& a) const { return cos(DEG_TO_RAD * a); }
F32 _tan(const F32& a) const { return tan(DEG_TO_RAD * a); }
@@ -176,11 +176,8 @@ private:
F32 _fabs(const F32& a) const { return fabs(a); }
F32 _floor(const F32& a) const { return (F32)llfloor(a); }
F32 _ceil(const F32& a) const { return llceil(a); }
-
F32 _atan2(const F32& a,const F32& b) const { return atan2(a,b); }
-
-
LLCalc::calc_map_t* mConstants;
LLCalc::calc_map_t* mVariables;
// LLCalc::calc_map_t* mUserVariables;
diff --git a/indra/llmath/llcamera.cpp b/indra/llmath/llcamera.cpp
index 33cf185196..ff90532f75 100755
--- a/indra/llmath/llcamera.cpp
+++ b/indra/llmath/llcamera.cpp
@@ -183,8 +183,30 @@ static const LLVector4a sFrustumScaler[] =
LLVector4a( 1, 1, 1) // 8 entries
};
-S32 LLCamera::AABBInFrustum(const LLVector4a &center, const LLVector4a& radius)
+bool LLCamera::isChanged()
{
+ bool changed = false;
+ for (U32 i = 0; i < mPlaneCount; i++)
+ {
+ U8 mask = mPlaneMask[i];
+ if (mask != 0xff && !changed)
+ {
+ changed = !mAgentPlanes[i].equal(mLastAgentPlanes[i]);
+ }
+ mLastAgentPlanes[i].set(mAgentPlanes[i]);
+ }
+
+ return changed;
+}
+
+S32 LLCamera::AABBInFrustum(const LLVector4a &center, const LLVector4a& radius, const LLPlane* planes)
+{
+ if(!planes)
+ {
+ //use agent space
+ planes = mAgentPlanes;
+ }
+
U8 mask = 0;
bool result = false;
LLVector4a rscale, maxp, minp;
@@ -195,7 +217,7 @@ S32 LLCamera::AABBInFrustum(const LLVector4a &center, const LLVector4a& radius)
mask = mPlaneMask[i];
if (mask < PLANE_MASK_NUM)
{
- const LLPlane& p(mAgentPlanes[i]);
+ const LLPlane& p(planes[i]);
p.getAt<3>(d);
rscale.setMul(radius, sFrustumScaler[mask]);
minp.setSub(center, rscale);
@@ -216,9 +238,21 @@ S32 LLCamera::AABBInFrustum(const LLVector4a &center, const LLVector4a& radius)
return result?1:2;
}
+//exactly same as the function AABBInFrustum(...)
+//except uses mRegionPlanes instead of mAgentPlanes.
+S32 LLCamera::AABBInRegionFrustum(const LLVector4a& center, const LLVector4a& radius)
+{
+ return AABBInFrustum(center, radius, mRegionPlanes);
+}
-S32 LLCamera::AABBInFrustumNoFarClip(const LLVector4a& center, const LLVector4a& radius)
+S32 LLCamera::AABBInFrustumNoFarClip(const LLVector4a& center, const LLVector4a& radius, const LLPlane* planes)
{
+ if(!planes)
+ {
+ //use agent space
+ planes = mAgentPlanes;
+ }
+
U8 mask = 0;
bool result = false;
LLVector4a rscale, maxp, minp;
@@ -229,7 +263,7 @@ S32 LLCamera::AABBInFrustumNoFarClip(const LLVector4a& center, const LLVector4a&
mask = mPlaneMask[i];
if ((i != 5) && (mask < PLANE_MASK_NUM))
{
- const LLPlane& p(mAgentPlanes[i]);
+ const LLPlane& p(planes[i]);
p.getAt<3>(d);
rscale.setMul(radius, sFrustumScaler[mask]);
minp.setSub(center, rscale);
@@ -250,6 +284,13 @@ S32 LLCamera::AABBInFrustumNoFarClip(const LLVector4a& center, const LLVector4a&
return result?1:2;
}
+//exactly same as the function AABBInFrustumNoFarClip(...)
+//except uses mRegionPlanes instead of mAgentPlanes.
+S32 LLCamera::AABBInRegionFrustumNoFarClip(const LLVector4a& center, const LLVector4a& radius)
+{
+ return AABBInFrustumNoFarClip(center, radius, mRegionPlanes);
+}
+
int LLCamera::sphereInFrustumQuick(const LLVector3 &sphere_center, const F32 radius)
{
LLVector3 dist = sphere_center-mFrustCenter;
@@ -586,6 +627,47 @@ void LLCamera::calcAgentFrustumPlanes(LLVector3* frust)
}
}
+//calculate regional planes from mAgentPlanes.
+//vector "shift" is the vector of the region origin in the agent space.
+void LLCamera::calcRegionFrustumPlanes(const LLVector3& shift, F32 far_clip_distance)
+{
+ F32 far_w;
+ {
+ LLVector3 p = getOrigin();
+ LLVector3 n(mAgentPlanes[5][0], mAgentPlanes[5][1], mAgentPlanes[5][2]);
+ F32 dd = n * p;
+ if(dd + mAgentPlanes[5][3] < 0) //signed distance
+ {
+ far_w = -far_clip_distance - dd;
+ }
+ else
+ {
+ far_w = far_clip_distance - dd;
+ }
+ far_w += n * shift;
+ }
+
+ F32 d;
+ LLVector3 n;
+ for(S32 i = 0 ; i < 7; i++)
+ {
+ if (mPlaneMask[i] != 0xff)
+ {
+ n.setVec(mAgentPlanes[i][0], mAgentPlanes[i][1], mAgentPlanes[i][2]);
+
+ if(i != 5)
+ {
+ d = mAgentPlanes[i][3] + n * shift;
+ }
+ else
+ {
+ d = far_w;
+ }
+ mRegionPlanes[i].setVec(n, d);
+ }
+ }
+}
+
void LLCamera::calculateFrustumPlanes(F32 left, F32 right, F32 top, F32 bottom)
{
LLVector3 a, b, c;
diff --git a/indra/llmath/llcamera.h b/indra/llmath/llcamera.h
index 1283cfb16b..321b8ddcc4 100755
--- a/indra/llmath/llcamera.h
+++ b/indra/llmath/llcamera.h
@@ -122,6 +122,8 @@ public:
private:
LL_ALIGN_16(LLPlane mAgentPlanes[AGENT_PLANE_USER_CLIP_NUM]); //frustum planes in agent space a la gluUnproject (I'm a bastard, I know) - DaveP
+ LL_ALIGN_16(LLPlane mRegionPlanes[AGENT_PLANE_USER_CLIP_NUM]); //frustum planes in a local region space, derived from mAgentPlanes
+ LL_ALIGN_16(LLPlane mLastAgentPlanes[AGENT_PLANE_USER_CLIP_NUM]);
U8 mPlaneMask[PLANE_MASK_NUM]; // 8 for alignment
F32 mView; // angle between top and bottom frustum planes in radians.
@@ -150,6 +152,7 @@ public:
LLCamera(F32 vertical_fov_rads, F32 aspect_ratio, S32 view_height_in_pixels, F32 near_plane, F32 far_plane);
virtual ~LLCamera();
+ bool isChanged(); //check if mAgentPlanes changed since last frame.
void setUserClipPlane(LLPlane& plane);
void disableUserClipPlane();
@@ -191,6 +194,7 @@ public:
// Return number of bytes copied.
size_t readFrustumFromBuffer(const char *buffer);
void calcAgentFrustumPlanes(LLVector3* frust);
+ void calcRegionFrustumPlanes(const LLVector3& shift, F32 far_clip_distance); //calculate regional planes from mAgentPlanes.
void ignoreAgentFrustumPlane(S32 idx);
// Returns 1 if partly in, 2 if fully in.
@@ -199,8 +203,10 @@ public:
S32 sphereInFrustum(const LLVector3 &center, const F32 radius) const;
S32 pointInFrustum(const LLVector3 &point) const { return sphereInFrustum(point, 0.0f); }
S32 sphereInFrustumFull(const LLVector3 &center, const F32 radius) const { return sphereInFrustum(center, radius); }
- S32 AABBInFrustum(const LLVector4a& center, const LLVector4a& radius);
- S32 AABBInFrustumNoFarClip(const LLVector4a& center, const LLVector4a& radius);
+ S32 AABBInFrustum(const LLVector4a& center, const LLVector4a& radius, const LLPlane* planes = NULL);
+ S32 AABBInRegionFrustum(const LLVector4a& center, const LLVector4a& radius);
+ S32 AABBInFrustumNoFarClip(const LLVector4a& center, const LLVector4a& radius, const LLPlane* planes = NULL);
+ S32 AABBInRegionFrustumNoFarClip(const LLVector4a& center, const LLVector4a& radius);
//does a quick 'n dirty sphere-sphere check
S32 sphereInFrustumQuick(const LLVector3 &sphere_center, const F32 radius);
diff --git a/indra/llmath/llcoordframe.cpp b/indra/llmath/llcoordframe.cpp
index 7dd8e43185..1bf51ca0eb 100755
--- a/indra/llmath/llcoordframe.cpp
+++ b/indra/llmath/llcoordframe.cpp
@@ -59,7 +59,7 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &origin) :
if( !mOrigin.isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL;
}
}
@@ -71,7 +71,7 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &origin, const LLVector3 &direction)
if( !isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL;
}
}
@@ -86,7 +86,7 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &x_axis,
if( !isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL;
}
}
@@ -102,7 +102,7 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &origin,
if( !isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL;
}
}
@@ -117,7 +117,7 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &origin,
if( !isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL;
}
}
@@ -132,7 +132,7 @@ LLCoordFrame::LLCoordFrame(const LLQuaternion &q) :
if( !isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL;
}
}
@@ -147,7 +147,7 @@ LLCoordFrame::LLCoordFrame(const LLVector3 &origin, const LLQuaternion &q) :
if( !isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL;
}
}
@@ -160,7 +160,7 @@ LLCoordFrame::LLCoordFrame(const LLMatrix4 &mat) :
if( !isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL;
}
}
@@ -176,7 +176,7 @@ LLCoordFrame::LLCoordFrame(const F32 *origin, const F32 *rotation) :
if( !isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL;
}
}
*/
@@ -191,7 +191,7 @@ LLCoordFrame::LLCoordFrame(const F32 *origin_and_rotation) :
if( !isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::LLCoordFrame()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::LLCoordFrame()" << LL_ENDL;
}
}
*/
@@ -220,7 +220,7 @@ void LLCoordFrame::setOrigin(F32 x, F32 y, F32 z)
if( !mOrigin.isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::setOrigin()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::setOrigin()" << LL_ENDL;
}
}
@@ -230,7 +230,7 @@ void LLCoordFrame::setOrigin(const LLVector3 &new_origin)
if( !mOrigin.isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::setOrigin()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::setOrigin()" << LL_ENDL;
}
}
@@ -243,7 +243,7 @@ void LLCoordFrame::setOrigin(const F32 *origin)
if( !mOrigin.isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::setOrigin()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::setOrigin()" << LL_ENDL;
}
}
@@ -254,7 +254,7 @@ void LLCoordFrame::setOrigin(const LLCoordFrame &frame)
if( !mOrigin.isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::setOrigin()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::setOrigin()" << LL_ENDL;
}
}
@@ -271,7 +271,7 @@ void LLCoordFrame::setAxes(const LLVector3 &x_axis,
if( !isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::setAxes()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::setAxes()" << LL_ENDL;
}
}
@@ -284,7 +284,7 @@ void LLCoordFrame::setAxes(const LLMatrix3 &rotation_matrix)
if( !isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::setAxes()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::setAxes()" << LL_ENDL;
}
}
@@ -296,7 +296,7 @@ void LLCoordFrame::setAxes(const LLQuaternion &q )
if( !isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::setAxes()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::setAxes()" << LL_ENDL;
}
}
@@ -316,7 +316,7 @@ void LLCoordFrame::setAxes( const F32 *rotation_matrix )
if( !isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::setAxes()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::setAxes()" << LL_ENDL;
}
}
@@ -330,7 +330,7 @@ void LLCoordFrame::setAxes(const LLCoordFrame &frame)
if( !isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::setAxes()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::setAxes()" << LL_ENDL;
}
}
@@ -346,7 +346,7 @@ void LLCoordFrame::translate(F32 x, F32 y, F32 z)
if( !mOrigin.isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::translate()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::translate()" << LL_ENDL;
}
}
@@ -358,7 +358,7 @@ void LLCoordFrame::translate(const LLVector3 &v)
if( !mOrigin.isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::translate()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::translate()" << LL_ENDL;
}
}
@@ -372,7 +372,7 @@ void LLCoordFrame::translate(const F32 *origin)
if( !mOrigin.isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::translate()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::translate()" << LL_ENDL;
}
}
@@ -409,7 +409,7 @@ void LLCoordFrame::rotate(const LLMatrix3 &rotation_matrix)
if( !isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::rotate()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::rotate()" << LL_ENDL;
}
}
@@ -423,7 +423,7 @@ void LLCoordFrame::roll(F32 angle)
if( !mYAxis.isFinite() || !mZAxis.isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::roll()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::roll()" << LL_ENDL;
}
}
@@ -436,7 +436,7 @@ void LLCoordFrame::pitch(F32 angle)
if( !mXAxis.isFinite() || !mZAxis.isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::pitch()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::pitch()" << LL_ENDL;
}
}
@@ -449,7 +449,7 @@ void LLCoordFrame::yaw(F32 angle)
if( !mXAxis.isFinite() || !mYAxis.isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::yaw()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::yaw()" << LL_ENDL;
}
}
@@ -509,7 +509,7 @@ size_t LLCoordFrame::readOrientation(const char *buffer)
if( !isFinite() )
{
reset();
- llwarns << "Non Finite in LLCoordFrame::readOrientation()" << llendl;
+ LL_WARNS() << "Non Finite in LLCoordFrame::readOrientation()" << LL_ENDL;
}
return 12*sizeof(F32);
diff --git a/indra/llmath/llline.cpp b/indra/llmath/llline.cpp
index ef10d1e7fa..f26231840b 100755
--- a/indra/llmath/llline.cpp
+++ b/indra/llmath/llline.cpp
@@ -82,10 +82,10 @@ LLVector3 LLLine::nearestApproach( const LLLine& other_line ) const
if ( one_minus_dir_dot_dir < SOME_VERY_SMALL_NUMBER )
{
#ifdef LL_DEBUG
- llwarns << "LLLine::nearestApproach() was given two very "
+ LL_WARNS() << "LLLine::nearestApproach() was given two very "
<< "nearly parallel lines dir1 = " << mDirection
<< " dir2 = " << other_line.mDirection << " with 1-dot_product = "
- << one_minus_dir_dot_dir << llendl;
+ << one_minus_dir_dot_dir << LL_ENDL;
#endif
// the lines are approximately parallel
// We shouldn't fall in here because this check should have been made
diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h
index b93f89d674..a8b27ad189 100755
--- a/indra/llmath/llmath.h
+++ b/indra/llmath/llmath.h
@@ -1,4 +1,4 @@
-/**
+/**
* @file llmath.h
* @brief Useful math constants and macros.
*
@@ -30,6 +30,7 @@
#include <cmath>
#include <cstdlib>
#include <vector>
+#include <limits>
#include "lldefs.h"
//#include "llstl.h" // *TODO: Remove when LLString is gone
//#include "llstring.h" // *TODO: Remove when LLString is gone
@@ -72,15 +73,21 @@ const F32 F_E = 2.71828182845904523536f;
const F32 F_SQRT2 = 1.4142135623730950488016887242097f;
const F32 F_SQRT3 = 1.73205080756888288657986402541f;
const F32 OO_SQRT2 = 0.7071067811865475244008443621049f;
+const F32 OO_SQRT3 = 0.577350269189625764509f;
const F32 DEG_TO_RAD = 0.017453292519943295769236907684886f;
const F32 RAD_TO_DEG = 57.295779513082320876798154814105f;
const F32 F_APPROXIMATELY_ZERO = 0.00001f;
+const F32 F_LN10 = 2.3025850929940456840179914546844f;
+const F32 OO_LN10 = 0.43429448190325182765112891891661;
const F32 F_LN2 = 0.69314718056f;
const F32 OO_LN2 = 1.4426950408889634073599246810019f;
const F32 F_ALMOST_ZERO = 0.0001f;
const F32 F_ALMOST_ONE = 1.0f - F_ALMOST_ZERO;
+const F32 GIMBAL_THRESHOLD = 0.000436f; // sets the gimballock threshold 0.025 away from +/-90 degrees
+// formula: GIMBAL_THRESHOLD = sin(DEG_TO_RAD * gimbal_threshold_angle);
+
// BUG: Eliminate in favor of F_APPROXIMATELY_ZERO above?
const F32 FP_MAG_THRESHOLD = 0.0000001f;
@@ -111,6 +118,12 @@ inline bool is_approx_zero( F32 f ) { return (-F_APPROXIMATELY_ZERO < f) && (f <
// WARNING: Infinity is comparable with F32_MAX and negative
// infinity is comparable with F32_MIN
+// handles negative and positive zeros
+inline bool is_zero(F32 x)
+{
+ return (*(U32*)(&x) & 0x7fffffff) == 0;
+}
+
inline bool is_approx_equal(F32 x, F32 y)
{
const S32 COMPARE_MANTISSA_UP_TO_BIT = 0x02;
diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h
index 7348904c61..7b5240c651 100755
--- a/indra/llmath/lloctree.h
+++ b/indra/llmath/lloctree.h
@@ -36,6 +36,8 @@
extern U32 gOctreeMaxCapacity;
+extern float gOctreeMinSize;
+
/*#define LL_OCTREE_PARANOIA_CHECK 0
#if LL_DARWIN
#define LL_OCTREE_MAX_CAPACITY 32
@@ -106,6 +108,7 @@ public:
: mParent((oct_node*)parent),
mOctant(octant)
{
+ llassert(size[0] >= gOctreeMinSize*0.5f);
//always keep a NULL terminated list to avoid out of bounds exceptions in debug builds
mData.push_back(NULL);
mDataEnd = &mData[0];
@@ -213,7 +216,7 @@ public:
F32 size = mSize[0];
F32 p_size = size * 2.f;
- return (radius <= 0.001f && size <= 0.001f) ||
+ return (radius <= gOctreeMinSize && size <= gOctreeMinSize) ||
(radius <= p_size && radius > size);
}
@@ -265,12 +268,12 @@ public:
if (child->getOctant() != i)
{
- llerrs << "Invalid child map, bad octant data." << llendl;
+ LL_ERRS() << "Invalid child map, bad octant data." << LL_ENDL;
}
if (getOctant(child->getCenter()) != child->getOctant())
{
- llerrs << "Invalid child octant compared to position data." << llendl;
+ LL_ERRS() << "Invalid child octant compared to position data." << LL_ENDL;
}
}
}
@@ -311,7 +314,7 @@ public:
{
if (data == NULL || data->getBinIndex() != -1)
{
- OCT_ERRS << "!!! INVALID ELEMENT ADDED TO OCTREE BRANCH !!!" << llendl;
+ OCT_ERRS << "!!! INVALID ELEMENT ADDED TO OCTREE BRANCH !!!" << LL_ENDL;
return false;
}
LLOctreeNode<T>* parent = getOctParent();
@@ -319,7 +322,7 @@ public:
//is it here?
if (isInside(data->getPositionGroup()))
{
- if ((getElementCount() < gOctreeMaxCapacity && contains(data->getBinRadius()) ||
+ if (((getElementCount() < gOctreeMaxCapacity || getSize()[0] <= gOctreeMinSize) && contains(data->getBinRadius()) ||
(data->getBinRadius() > getSize()[0] && parent && parent->getElementCount() >= gOctreeMaxCapacity)))
{ //it belongs here
mData.push_back(NULL);
@@ -356,8 +359,9 @@ public:
LLVector4a val;
val.setSub(center, getCenter());
val.setAbs(val);
-
- S32 lt = val.lessThan(LLVector4a::getEpsilon()).getGatheredBits() & 0x7;
+ LLVector4a min_diff(gOctreeMinSize);
+
+ S32 lt = val.lessThan(min_diff).getGatheredBits() & 0x7;
if( lt == 0x7 )
{
@@ -374,7 +378,7 @@ public:
if (getChildCount() == 8)
{
//this really isn't possible, something bad has happened
- OCT_ERRS << "Octree detected floating point error and gave up." << llendl;
+ OCT_ERRS << "Octree detected floating point error and gave up." << LL_ENDL;
return false;
}
@@ -383,12 +387,13 @@ public:
{
if (mChild[i]->getCenter().equals3(center))
{
- OCT_ERRS << "Octree detected duplicate child center and gave up." << llendl;
+ OCT_ERRS << "Octree detected duplicate child center and gave up." << LL_ENDL;
return false;
}
}
#endif
+ llassert(size[0] >= gOctreeMinSize*0.5f);
//make the new kid
child = new LLOctreeNode<T>(center, size, this);
addChild(child);
@@ -399,7 +404,7 @@ public:
else
{
//it's not in here, give it to the root
- OCT_ERRS << "Octree insertion failed, starting over from root!" << llendl;
+ OCT_ERRS << "Octree insertion failed, starting over from root!" << LL_ENDL;
oct_node* node = this;
@@ -483,7 +488,7 @@ public:
}
//node is now root
- llwarns << "!!! OCTREE REMOVING ELEMENT BY ADDRESS, SEVERE PERFORMANCE PENALTY |||" << llendl;
+ LL_WARNS() << "!!! OCTREE REMOVING ELEMENT BY ADDRESS, SEVERE PERFORMANCE PENALTY |||" << LL_ENDL;
node->removeByAddress(data);
llassert(data->getBinIndex() == -1);
return true;
@@ -496,7 +501,7 @@ public:
if (mData[i] == data)
{ //we have data
_remove(data, i);
- llwarns << "FOUND!" << llendl;
+ LL_WARNS() << "FOUND!" << LL_ENDL;
return;
}
}
@@ -524,7 +529,7 @@ public:
mChild[i]->validate();
if (mChild[i]->getParent() != this)
{
- llerrs << "Octree child has invalid parent." << llendl;
+ LL_ERRS() << "Octree child has invalid parent." << LL_ENDL;
}
}
#endif
@@ -550,24 +555,24 @@ public:
if (child->getSize().equals3(getSize()))
{
- OCT_ERRS << "Child size is same as parent size!" << llendl;
+ OCT_ERRS << "Child size is same as parent size!" << LL_ENDL;
}
for (U32 i = 0; i < getChildCount(); i++)
{
if(!mChild[i]->getSize().equals3(child->getSize()))
{
- OCT_ERRS <<"Invalid octree child size." << llendl;
+ OCT_ERRS <<"Invalid octree child size." << LL_ENDL;
}
if (mChild[i]->getCenter().equals3(child->getCenter()))
{
- OCT_ERRS <<"Duplicate octree child position." << llendl;
+ OCT_ERRS <<"Duplicate octree child position." << LL_ENDL;
}
}
if (mChild.size() >= 8)
{
- OCT_ERRS <<"Octree node has too many children... why?" << llendl;
+ OCT_ERRS <<"Octree node has too many children... why?" << LL_ENDL;
}
#endif
@@ -641,7 +646,7 @@ public:
}
}
- OCT_ERRS << "Octree failed to delete requested child." << llendl;
+ OCT_ERRS << "Octree failed to delete requested child." << LL_ENDL;
}
protected:
@@ -724,13 +729,13 @@ public:
{
if (data == NULL)
{
- OCT_ERRS << "!!! INVALID ELEMENT ADDED TO OCTREE ROOT !!!" << llendl;
+ OCT_ERRS << "!!! INVALID ELEMENT ADDED TO OCTREE ROOT !!!" << LL_ENDL;
return false;
}
if (data->getBinRadius() > 4096.0)
{
- OCT_ERRS << "!!! ELEMENT EXCEEDS MAXIMUM SIZE IN OCTREE ROOT !!!" << llendl;
+ OCT_ERRS << "!!! ELEMENT EXCEEDS MAXIMUM SIZE IN OCTREE ROOT !!!" << LL_ENDL;
return false;
}
@@ -746,7 +751,7 @@ public:
if (lt != 0x7)
{
- //OCT_ERRS << "!!! ELEMENT EXCEEDS RANGE OF SPATIAL PARTITION !!!" << llendl;
+ //OCT_ERRS << "!!! ELEMENT EXCEEDS RANGE OF SPATIAL PARTITION !!!" << LL_ENDL;
return false;
}
@@ -796,6 +801,8 @@ public:
this->setSize(size2);
this->updateMinMax();
+ llassert(size[0] >= gOctreeMinSize);
+
//copy our children to a new branch
LLOctreeNode<T>* newnode = new LLOctreeNode<T>(center, size, this);
diff --git a/indra/llmath/llplane.h b/indra/llmath/llplane.h
index 3c32441b11..64a3eed0e5 100755
--- a/indra/llmath/llplane.h
+++ b/indra/llmath/llplane.h
@@ -93,7 +93,13 @@ public:
{
return mV.greaterEqual(LLVector4a::getZero()).getGatheredBits() & LLVector4Logical::MASK_XYZ;
}
-
+
+ //check if two planes are nearly same
+ bool equal(const LLPlane& p) const
+ {
+ return mV.equals4(p.mV);
+ }
+
private:
LLVector4a mV;
} LL_ALIGN_POSTFIX(16);
diff --git a/indra/llmath/llquaternion.cpp b/indra/llmath/llquaternion.cpp
index 7381d5eb99..47374c287f 100755
--- a/indra/llmath/llquaternion.cpp
+++ b/indra/llmath/llquaternion.cpp
@@ -1,4 +1,4 @@
-/**
+/**
* @file llquaternion.cpp
* @brief LLQuaternion class implementation.
*
@@ -58,34 +58,40 @@ LLQuaternion::LLQuaternion(const LLMatrix3 &mat)
LLQuaternion::LLQuaternion(F32 angle, const LLVector4 &vec)
{
- LLVector3 v(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
- v.normalize();
-
- F32 c, s;
- c = cosf(angle*0.5f);
- s = sinf(angle*0.5f);
-
- mQ[VX] = v.mV[VX] * s;
- mQ[VY] = v.mV[VY] * s;
- mQ[VZ] = v.mV[VZ] * s;
- mQ[VW] = c;
- normalize();
+ F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
+ if (mag > FP_MAG_THRESHOLD)
+ {
+ angle *= 0.5;
+ F32 c = cosf(angle);
+ F32 s = sinf(angle) / mag;
+ mQ[VX] = vec.mV[VX] * s;
+ mQ[VY] = vec.mV[VY] * s;
+ mQ[VZ] = vec.mV[VZ] * s;
+ mQ[VW] = c;
+ }
+ else
+ {
+ loadIdentity();
+ }
}
LLQuaternion::LLQuaternion(F32 angle, const LLVector3 &vec)
{
- LLVector3 v(vec);
- v.normalize();
-
- F32 c, s;
- c = cosf(angle*0.5f);
- s = sinf(angle*0.5f);
-
- mQ[VX] = v.mV[VX] * s;
- mQ[VY] = v.mV[VY] * s;
- mQ[VZ] = v.mV[VZ] * s;
- mQ[VW] = c;
- normalize();
+ F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
+ if (mag > FP_MAG_THRESHOLD)
+ {
+ angle *= 0.5;
+ F32 c = cosf(angle);
+ F32 s = sinf(angle) / mag;
+ mQ[VX] = vec.mV[VX] * s;
+ mQ[VY] = vec.mV[VY] * s;
+ mQ[VZ] = vec.mV[VZ] * s;
+ mQ[VW] = c;
+ }
+ else
+ {
+ loadIdentity();
+ }
}
LLQuaternion::LLQuaternion(const LLVector3 &x_axis,
@@ -136,57 +142,61 @@ void LLQuaternion::quantize8(F32 lower, F32 upper)
const LLQuaternion& LLQuaternion::setAngleAxis(F32 angle, F32 x, F32 y, F32 z)
{
- LLVector3 vec(x, y, z);
- vec.normalize();
-
- angle *= 0.5f;
- F32 c, s;
- c = cosf(angle);
- s = sinf(angle);
-
- mQ[VX] = vec.mV[VX]*s;
- mQ[VY] = vec.mV[VY]*s;
- mQ[VZ] = vec.mV[VZ]*s;
- mQ[VW] = c;
-
- normalize();
+ F32 mag = sqrtf(x * x + y * y + z * z);
+ if (mag > FP_MAG_THRESHOLD)
+ {
+ angle *= 0.5;
+ F32 c = cosf(angle);
+ F32 s = sinf(angle) / mag;
+ mQ[VX] = x * s;
+ mQ[VY] = y * s;
+ mQ[VZ] = z * s;
+ mQ[VW] = c;
+ }
+ else
+ {
+ loadIdentity();
+ }
return (*this);
}
const LLQuaternion& LLQuaternion::setAngleAxis(F32 angle, const LLVector3 &vec)
{
- LLVector3 v(vec);
- v.normalize();
-
- angle *= 0.5f;
- F32 c, s;
- c = cosf(angle);
- s = sinf(angle);
-
- mQ[VX] = v.mV[VX]*s;
- mQ[VY] = v.mV[VY]*s;
- mQ[VZ] = v.mV[VZ]*s;
- mQ[VW] = c;
-
- normalize();
+ F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
+ if (mag > FP_MAG_THRESHOLD)
+ {
+ angle *= 0.5;
+ F32 c = cosf(angle);
+ F32 s = sinf(angle) / mag;
+ mQ[VX] = vec.mV[VX] * s;
+ mQ[VY] = vec.mV[VY] * s;
+ mQ[VZ] = vec.mV[VZ] * s;
+ mQ[VW] = c;
+ }
+ else
+ {
+ loadIdentity();
+ }
return (*this);
}
const LLQuaternion& LLQuaternion::setAngleAxis(F32 angle, const LLVector4 &vec)
{
- LLVector3 v(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
- v.normalize();
-
- F32 c, s;
- c = cosf(angle*0.5f);
- s = sinf(angle*0.5f);
-
- mQ[VX] = v.mV[VX]*s;
- mQ[VY] = v.mV[VY]*s;
- mQ[VZ] = v.mV[VZ]*s;
- mQ[VW] = c;
-
- normalize();
+ F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
+ if (mag > FP_MAG_THRESHOLD)
+ {
+ angle *= 0.5;
+ F32 c = cosf(angle);
+ F32 s = sinf(angle) / mag;
+ mQ[VX] = vec.mV[VX] * s;
+ mQ[VY] = vec.mV[VY] * s;
+ mQ[VZ] = vec.mV[VZ] * s;
+ mQ[VW] = c;
+ }
+ else
+ {
+ loadIdentity();
+ }
return (*this);
}
@@ -219,68 +229,80 @@ const LLQuaternion& LLQuaternion::set(const LLMatrix4 &mat)
// deprecated
const LLQuaternion& LLQuaternion::setQuat(F32 angle, F32 x, F32 y, F32 z)
{
- LLVector3 vec(x, y, z);
- vec.normalize();
-
- angle *= 0.5f;
- F32 c, s;
- c = cosf(angle);
- s = sinf(angle);
-
- mQ[VX] = vec.mV[VX]*s;
- mQ[VY] = vec.mV[VY]*s;
- mQ[VZ] = vec.mV[VZ]*s;
- mQ[VW] = c;
-
- normalize();
+ F32 mag = sqrtf(x * x + y * y + z * z);
+ if (mag > FP_MAG_THRESHOLD)
+ {
+ angle *= 0.5;
+ F32 c = cosf(angle);
+ F32 s = sinf(angle) / mag;
+ mQ[VX] = x * s;
+ mQ[VY] = y * s;
+ mQ[VZ] = z * s;
+ mQ[VW] = c;
+ }
+ else
+ {
+ loadIdentity();
+ }
return (*this);
}
// deprecated
const LLQuaternion& LLQuaternion::setQuat(F32 angle, const LLVector3 &vec)
{
- LLVector3 v(vec);
- v.normalize();
-
- angle *= 0.5f;
- F32 c, s;
- c = cosf(angle);
- s = sinf(angle);
-
- mQ[VX] = v.mV[VX]*s;
- mQ[VY] = v.mV[VY]*s;
- mQ[VZ] = v.mV[VZ]*s;
- mQ[VW] = c;
-
- normalize();
+ F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
+ if (mag > FP_MAG_THRESHOLD)
+ {
+ angle *= 0.5;
+ F32 c = cosf(angle);
+ F32 s = sinf(angle) / mag;
+ mQ[VX] = vec.mV[VX] * s;
+ mQ[VY] = vec.mV[VY] * s;
+ mQ[VZ] = vec.mV[VZ] * s;
+ mQ[VW] = c;
+ }
+ else
+ {
+ loadIdentity();
+ }
return (*this);
}
const LLQuaternion& LLQuaternion::setQuat(F32 angle, const LLVector4 &vec)
{
- LLVector3 v(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
- v.normalize();
-
- F32 c, s;
- c = cosf(angle*0.5f);
- s = sinf(angle*0.5f);
-
- mQ[VX] = v.mV[VX]*s;
- mQ[VY] = v.mV[VY]*s;
- mQ[VZ] = v.mV[VZ]*s;
- mQ[VW] = c;
-
- normalize();
+ F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
+ if (mag > FP_MAG_THRESHOLD)
+ {
+ angle *= 0.5;
+ F32 c = cosf(angle);
+ F32 s = sinf(angle) / mag;
+ mQ[VX] = vec.mV[VX] * s;
+ mQ[VY] = vec.mV[VY] * s;
+ mQ[VZ] = vec.mV[VZ] * s;
+ mQ[VW] = c;
+ }
+ else
+ {
+ loadIdentity();
+ }
return (*this);
}
const LLQuaternion& LLQuaternion::setQuat(F32 roll, F32 pitch, F32 yaw)
{
- LLMatrix3 rot_mat(roll, pitch, yaw);
- rot_mat.orthogonalize();
- *this = rot_mat.quaternion();
-
- normalize();
+ roll *= 0.5f;
+ pitch *= 0.5f;
+ yaw *= 0.5f;
+ F32 sinX = sinf(roll);
+ F32 cosX = cosf(roll);
+ F32 sinY = sinf(pitch);
+ F32 cosY = cosf(pitch);
+ F32 sinZ = sinf(yaw);
+ F32 cosZ = cosf(yaw);
+ mQ[VW] = cosX * cosY * cosZ - sinX * sinY * sinZ;
+ mQ[VX] = sinX * cosY * cosZ + cosX * sinY * sinZ;
+ mQ[VY] = cosX * sinY * cosZ - sinX * cosY * sinZ;
+ mQ[VZ] = cosX * cosY * sinZ + sinX * sinY * cosZ;
return (*this);
}
@@ -425,68 +447,44 @@ LLMatrix4 LLQuaternion::getMatrix4(void) const
// calculate the shortest rotation from a to b
void LLQuaternion::shortestArc(const LLVector3 &a, const LLVector3 &b)
{
- // Make a local copy of both vectors.
- LLVector3 vec_a = a;
- LLVector3 vec_b = b;
-
- // Make sure neither vector is zero length. Also normalize
- // the vectors while we are at it.
- F32 vec_a_mag = vec_a.normalize();
- F32 vec_b_mag = vec_b.normalize();
- if (vec_a_mag < F_APPROXIMATELY_ZERO ||
- vec_b_mag < F_APPROXIMATELY_ZERO)
- {
- // Can't calculate a rotation from this.
- // Just return ZERO_ROTATION instead.
- loadIdentity();
- return;
- }
-
- // Create an axis to rotate around, and the cos of the angle to rotate.
- LLVector3 axis = vec_a % vec_b;
- F32 cos_theta = vec_a * vec_b;
-
- // Check the angle between the vectors to see if they are parallel or anti-parallel.
- if (cos_theta > 1.0 - F_APPROXIMATELY_ZERO)
- {
- // a and b are parallel. No rotation is necessary.
- loadIdentity();
- }
- else if (cos_theta < -1.0 + F_APPROXIMATELY_ZERO)
+ F32 ab = a * b; // dotproduct
+ LLVector3 c = a % b; // crossproduct
+ F32 cc = c * c; // squared length of the crossproduct
+ if (ab * ab + cc) // test if the arguments have sufficient magnitude
{
- // a and b are anti-parallel.
- // Rotate 180 degrees around some orthogonal axis.
- // Find the projection of the x-axis onto a, and try
- // using the vector between the projection and the x-axis
- // as the orthogonal axis.
- LLVector3 proj = vec_a.mV[VX] / (vec_a * vec_a) * vec_a;
- LLVector3 ortho_axis(1.f, 0.f, 0.f);
- ortho_axis -= proj;
-
- // Turn this into an orthonormal axis.
- F32 ortho_length = ortho_axis.normalize();
- // If the axis' length is 0, then our guess at an orthogonal axis
- // was wrong (a is parallel to the x-axis).
- if (ortho_length < F_APPROXIMATELY_ZERO)
+ if (cc > 0.0f) // test if the arguments are (anti)parallel
{
- // Use the z-axis instead.
- ortho_axis.setVec(0.f, 0.f, 1.f);
+ F32 s = sqrtf(ab * ab + cc) + ab; // note: don't try to optimize this line
+ F32 m = 1.0f / sqrtf(cc + s * s); // the inverted magnitude of the quaternion
+ mQ[VX] = c.mV[VX] * m;
+ mQ[VY] = c.mV[VY] * m;
+ mQ[VZ] = c.mV[VZ] * m;
+ mQ[VW] = s * m;
+ return;
+ }
+ if (ab < 0.0f) // test if the angle is bigger than PI/2 (anti parallel)
+ {
+ c = a - b; // the arguments are anti-parallel, we have to choose an axis
+ F32 m = sqrtf(c.mV[VX] * c.mV[VX] + c.mV[VY] * c.mV[VY]); // the length projected on the XY-plane
+ if (m > FP_MAG_THRESHOLD)
+ {
+ mQ[VX] = -c.mV[VY] / m; // return the quaternion with the axis in the XY-plane
+ mQ[VY] = c.mV[VX] / m;
+ mQ[VZ] = 0.0f;
+ mQ[VW] = 0.0f;
+ return;
+ }
+ else // the vectors are parallel to the Z-axis
+ {
+ mQ[VX] = 1.0f; // rotate around the X-axis
+ mQ[VY] = 0.0f;
+ mQ[VZ] = 0.0f;
+ mQ[VW] = 0.0f;
+ return;
+ }
}
-
- // Construct a quaternion from this orthonormal axis.
- mQ[VX] = ortho_axis.mV[VX];
- mQ[VY] = ortho_axis.mV[VY];
- mQ[VZ] = ortho_axis.mV[VZ];
- mQ[VW] = 0.f;
- }
- else
- {
- // a and b are NOT parallel or anti-parallel.
- // Return the rotation between these vectors.
- F32 theta = (F32)acos(cos_theta);
-
- setAngleAxis(theta, axis);
}
+ loadIdentity();
}
// constrains rotation to a cone angle specified in radians
@@ -838,79 +836,82 @@ LLQuaternion::Order StringToOrder( const char *str )
void LLQuaternion::getAngleAxis(F32* angle, LLVector3 &vec) const
{
- F32 cos_a = mQ[VW];
- if (cos_a > 1.0f) cos_a = 1.0f;
- if (cos_a < -1.0f) cos_a = -1.0f;
-
- F32 sin_a = (F32) sqrt( 1.0f - cos_a * cos_a );
-
- if ( fabs( sin_a ) < 0.0005f )
- sin_a = 1.0f;
- else
- sin_a = 1.f/sin_a;
-
- F32 temp_angle = 2.0f * (F32) acos( cos_a );
- if (temp_angle > F_PI)
- {
- // The (angle,axis) pair should never have angles outside [PI, -PI]
- // since we want the _shortest_ (angle,axis) solution.
- // Since acos is defined for [0, PI], and we multiply by 2.0, we
- // can push the angle outside the acceptible range.
- // When this happens we set the angle to the other portion of a
- // full 2PI rotation, and negate the axis, which reverses the
- // direction of the rotation (by the right-hand rule).
- *angle = 2.f * F_PI - temp_angle;
- vec.mV[VX] = - mQ[VX] * sin_a;
- vec.mV[VY] = - mQ[VY] * sin_a;
- vec.mV[VZ] = - mQ[VZ] * sin_a;
+ F32 v = sqrtf(mQ[VX] * mQ[VX] + mQ[VY] * mQ[VY] + mQ[VZ] * mQ[VZ]); // length of the vector-component
+ if (v > FP_MAG_THRESHOLD)
+ {
+ F32 oomag = 1.0f / v;
+ F32 w = mQ[VW];
+ if (mQ[VW] < 0.0f)
+ {
+ w = -w; // make VW positive
+ oomag = -oomag; // invert the axis
+ }
+ vec.mV[VX] = mQ[VX] * oomag; // normalize the axis
+ vec.mV[VY] = mQ[VY] * oomag;
+ vec.mV[VZ] = mQ[VZ] * oomag;
+ *angle = 2.0f * atan2f(v, w); // get the angle
}
else
{
- *angle = temp_angle;
- vec.mV[VX] = mQ[VX] * sin_a;
- vec.mV[VY] = mQ[VY] * sin_a;
- vec.mV[VZ] = mQ[VZ] * sin_a;
+ *angle = 0.0f; // no rotation
+ vec.mV[VX] = 0.0f; // around some dummy axis
+ vec.mV[VY] = 0.0f;
+ vec.mV[VZ] = 1.0f;
}
}
-
// quaternion does not need to be normalized
void LLQuaternion::getEulerAngles(F32 *roll, F32 *pitch, F32 *yaw) const
{
- LLMatrix3 rot_mat(*this);
- rot_mat.orthogonalize();
- rot_mat.getEulerAngles(roll, pitch, yaw);
-
-// // NOTE: LLQuaternion's are actually inverted with respect to
-// // the matrices, so this code also assumes inverted quaternions
-// // (-x, -y, -z, w). The result is that roll,pitch,yaw are applied
-// // in reverse order (yaw,pitch,roll).
-// F32 x = -mQ[VX], y = -mQ[VY], z = -mQ[VZ], w = mQ[VW];
-// F64 m20 = 2.0*(x*z-y*w);
-// if (1.0f - fabsf(m20) < F_APPROXIMATELY_ZERO)
-// {
-// *roll = 0.0f;
-// *pitch = (F32)asin(m20);
-// *yaw = (F32)atan2(2.0*(x*y-z*w), 1.0 - 2.0*(x*x+z*z));
-// }
-// else
-// {
-// *roll = (F32)atan2(-2.0*(y*z+x*w), 1.0-2.0*(x*x+y*y));
-// *pitch = (F32)asin(m20);
-// *yaw = (F32)atan2(-2.0*(x*y+z*w), 1.0-2.0*(y*y+z*z));
-// }
+ F32 sx = 2 * (mQ[VX] * mQ[VW] - mQ[VY] * mQ[VZ]); // sine of the roll
+ F32 sy = 2 * (mQ[VY] * mQ[VW] + mQ[VX] * mQ[VZ]); // sine of the pitch
+ F32 ys = mQ[VW] * mQ[VW] - mQ[VY] * mQ[VY]; // intermediate cosine 1
+ F32 xz = mQ[VX] * mQ[VX] - mQ[VZ] * mQ[VZ]; // intermediate cosine 2
+ F32 cx = ys - xz; // cosine of the roll
+ F32 cy = sqrtf(sx * sx + cx * cx); // cosine of the pitch
+ if (cy > GIMBAL_THRESHOLD) // no gimbal lock
+ {
+ *roll = atan2f(sx, cx);
+ *pitch = atan2f(sy, cy);
+ *yaw = atan2f(2 * (mQ[VZ] * mQ[VW] - mQ[VX] * mQ[VY]), ys + xz);
+ }
+ else // gimbal lock
+ {
+ if (sy > 0)
+ {
+ *pitch = F_PI_BY_TWO;
+ *yaw = 2 * atan2f(mQ[VZ] + mQ[VX], mQ[VW] + mQ[VY]);
+ }
+ else
+ {
+ *pitch = -F_PI_BY_TWO;
+ *yaw = 2 * atan2f(mQ[VZ] - mQ[VX], mQ[VW] - mQ[VY]);
+ }
+ *roll = 0;
+ }
}
// Saves space by using the fact that our quaternions are normalized
LLVector3 LLQuaternion::packToVector3() const
{
+ F32 x = mQ[VX];
+ F32 y = mQ[VY];
+ F32 z = mQ[VZ];
+ F32 w = mQ[VW];
+ F32 mag = sqrtf(x * x + y * y + z * z + w * w);
+ if (mag > FP_MAG_THRESHOLD)
+ {
+ x /= mag;
+ y /= mag;
+ z /= mag; // no need to normalize w, it's not used
+ }
if( mQ[VW] >= 0 )
{
- return LLVector3( mQ[VX], mQ[VY], mQ[VZ] );
+ return LLVector3( x, y , z );
}
else
{
- return LLVector3( -mQ[VX], -mQ[VY], -mQ[VZ] );
+ return LLVector3( -x, -y, -z );
}
}
diff --git a/indra/llmath/llquaternion.h b/indra/llmath/llquaternion.h
index ca0dfe206b..e56929ed0f 100755
--- a/indra/llmath/llquaternion.h
+++ b/indra/llmath/llquaternion.h
@@ -1,4 +1,4 @@
-/**
+/**
* @file llquaternion.h
* @brief LLQuaternion class header file.
*
@@ -304,43 +304,29 @@ inline const LLQuaternion& LLQuaternion::setQuat(const F32 *q)
return (*this);
}
-// There may be a cheaper way that avoids the sqrt.
-// Does sin_a = VX*VX + VY*VY + VZ*VZ?
-// Copied from Matrix and Quaternion FAQ 1.12
inline void LLQuaternion::getAngleAxis(F32* angle, F32* x, F32* y, F32* z) const
{
- F32 cos_a = mQ[VW];
- if (cos_a > 1.0f) cos_a = 1.0f;
- if (cos_a < -1.0f) cos_a = -1.0f;
-
- F32 sin_a = (F32) sqrt( 1.0f - cos_a * cos_a );
-
- if ( fabs( sin_a ) < 0.0005f )
- sin_a = 1.0f;
- else
- sin_a = 1.f/sin_a;
-
- F32 temp_angle = 2.0f * (F32) acos( cos_a );
- if (temp_angle > F_PI)
+ F32 v = sqrtf(mQ[VX] * mQ[VX] + mQ[VY] * mQ[VY] + mQ[VZ] * mQ[VZ]); // length of the vector-component
+ if (v > FP_MAG_THRESHOLD)
{
- // The (angle,axis) pair should never have angles outside [PI, -PI]
- // since we want the _shortest_ (angle,axis) solution.
- // Since acos is defined for [0, PI], and we multiply by 2.0, we
- // can push the angle outside the acceptible range.
- // When this happens we set the angle to the other portion of a
- // full 2PI rotation, and negate the axis, which reverses the
- // direction of the rotation (by the right-hand rule).
- *angle = 2.f * F_PI - temp_angle;
- *x = - mQ[VX] * sin_a;
- *y = - mQ[VY] * sin_a;
- *z = - mQ[VZ] * sin_a;
+ F32 oomag = 1.0f / v;
+ F32 w = mQ[VW];
+ if (w < 0.0f)
+ {
+ w = -w; // make VW positive
+ oomag = -oomag; // invert the axis
+ }
+ *x = mQ[VX] * oomag; // normalize the axis
+ *y = mQ[VY] * oomag;
+ *z = mQ[VZ] * oomag;
+ *angle = 2.0f * atan2f(v, w); // get the angle
}
else
{
- *angle = temp_angle;
- *x = mQ[VX] * sin_a;
- *y = mQ[VY] * sin_a;
- *z = mQ[VZ] * sin_a;
+ *angle = 0.0f; // no rotation
+ *x = 0.0f; // around some dummy axis
+ *y = 0.0f;
+ *z = 1.0f;
}
}
diff --git a/indra/llmath/lltreenode.h b/indra/llmath/lltreenode.h
index c66bc26176..0b479c4564 100755
--- a/indra/llmath/lltreenode.h
+++ b/indra/llmath/lltreenode.h
@@ -57,7 +57,14 @@ public:
virtual bool remove(T* data);
virtual void notifyRemoval(T* data);
virtual U32 getListenerCount() { return mListeners.size(); }
- virtual LLTreeListener<T>* getListener(U32 index) const { return mListeners[index]; }
+ virtual LLTreeListener<T>* getListener(U32 index) const
+ {
+ if(index < mListeners.size())
+ {
+ return mListeners[index];
+ }
+ return NULL;
+ }
virtual void addListener(LLTreeListener<T>* listener) { mListeners.push_back(listener); }
protected:
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index cc5742ff7a..d9a68cb577 100755
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -44,7 +44,6 @@
#include "m3math.h"
#include "llmatrix3a.h"
#include "lloctree.h"
-#include "lldarray.h"
#include "llvolume.h"
#include "llvolumeoctree.h"
#include "llstl.h"
@@ -427,7 +426,7 @@ public:
}
else
{
- llerrs << "Empty leaf" << llendl;
+ LL_ERRS() << "Empty leaf" << LL_ENDL;
}
for (S32 i = 0; i < branch->getChildCount(); ++i)
@@ -834,7 +833,7 @@ BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detai
if (detail < MIN_LOD)
{
- llinfos << "Generating profile with LOD < MIN_LOD. CLAMPING" << llendl;
+ LL_INFOS() << "Generating profile with LOD < MIN_LOD. CLAMPING" << LL_ENDL;
detail = MIN_LOD;
}
@@ -850,7 +849,7 @@ BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detai
// Quick validation to eliminate some server crashes.
if (begin > end - 0.01f)
{
- llwarns << "LLProfile::generate() assertion failed (begin >= end)" << llendl;
+ LL_WARNS() << "LLProfile::generate() assertion failed (begin >= end)" << LL_ENDL;
return FALSE;
}
@@ -1071,7 +1070,7 @@ BOOL LLProfile::generate(const LLProfileParams& params, BOOL path_open,F32 detai
}
break;
default:
- llerrs << "Unknown profile: getCurveType()=" << params.getCurveType() << llendl;
+ LL_ERRS() << "Unknown profile: getCurveType()=" << params.getCurveType() << LL_ENDL;
break;
};
@@ -1153,7 +1152,7 @@ BOOL LLProfileParams::importFile(LLFILE *fp)
}
else
{
- llwarns << "unknown keyword " << keyword << " in profile import" << llendl;
+ LL_WARNS() << "unknown keyword " << keyword << " in profile import" << LL_ENDL;
}
}
@@ -1225,7 +1224,7 @@ BOOL LLProfileParams::importLegacyStream(std::istream& input_stream)
}
else
{
- llwarns << "unknown keyword " << keyword << " in profile import" << llendl;
+ LL_WARNS() << "unknown keyword " << keyword << " in profile import" << LL_ENDL;
}
}
@@ -1547,7 +1546,7 @@ BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split,
if (detail < MIN_LOD)
{
- llinfos << "Generating path with LOD < MIN! Clamping to 1" << llendl;
+ LL_INFOS() << "Generating path with LOD < MIN! Clamping to 1" << LL_ENDL;
detail = MIN_LOD;
}
@@ -1649,7 +1648,7 @@ BOOL LLPath::generate(const LLPathParams& params, F32 detail, S32 split,
F32 t = (F32)i * mStep;
mPath[i].mPos.set(0,
lerp(0, -sin(F_PI*params.getTwist()*t)*0.5f,t),
- lerp(-0.5, cos(F_PI*params.getTwist()*t)*0.5f,t));
+ lerp(-0.5f, cos(F_PI*params.getTwist()*t)*0.5f,t));
mPath[i].mScale.set(lerp(1,params.getScale().mV[0],t),
lerp(1,params.getScale().mV[1],t), 0,1);
mPath[i].mTexT = t;
@@ -1809,7 +1808,7 @@ BOOL LLPathParams::importFile(LLFILE *fp)
}
else
{
- llwarns << "unknown keyword " << " in path import" << llendl;
+ LL_WARNS() << "unknown keyword " << " in path import" << LL_ENDL;
}
}
return TRUE;
@@ -1949,7 +1948,7 @@ BOOL LLPathParams::importLegacyStream(std::istream& input_stream)
}
else
{
- llwarns << "unknown keyword " << " in path import" << llendl;
+ LL_WARNS() << "unknown keyword " << " in path import" << LL_ENDL;
}
}
return TRUE;
@@ -2040,7 +2039,7 @@ LLProfile::~LLProfile()
{
if(profile_delete_lock)
{
- llerrs << "LLProfile should not be deleted here!" << llendl ;
+ LL_ERRS() << "LLProfile should not be deleted here!" << LL_ENDL ;
}
}
@@ -2087,6 +2086,7 @@ void LLVolume::resizePath(S32 length)
{
mPathp->resizePath(length);
mVolumeFaces.clear();
+ setDirty();
}
void LLVolume::regen()
@@ -2375,7 +2375,7 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size)
LLSD mdl;
if (!unzip_llsd(mdl, is, size))
{
- LL_DEBUGS("MeshStreaming") << "Failed to unzip LLSD blob for LoD, will probably fetch from sim again." << llendl;
+ LL_DEBUGS("MeshStreaming") << "Failed to unzip LLSD blob for LoD, will probably fetch from sim again." << LL_ENDL;
return false;
}
@@ -2384,7 +2384,7 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size)
if (face_count == 0)
{ //no faces unpacked, treat as failed decode
- llwarns << "found no faces!" << llendl;
+ LL_WARNS() << "found no faces!" << LL_ENDL;
return false;
}
@@ -2417,7 +2417,7 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size)
if (idx.empty() || face.mNumIndices < 3)
{ //why is there an empty index list?
- llwarns <<"Empty face present!" << llendl;
+ LL_WARNS() <<"Empty face present!" << LL_ENDL;
continue;
}
@@ -2564,7 +2564,7 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size)
if (cur_vertex != num_verts || idx != weights.size())
{
- llwarns << "Vertex weight count does not match vertex count!" << llendl;
+ LL_WARNS() << "Vertex weight count does not match vertex count!" << LL_ENDL;
}
}
@@ -2730,7 +2730,7 @@ void LLVolume::createVolumeFaces()
vf.mNumS = face.mCount;
if (vf.mNumS < 0)
{
- llerrs << "Volume face corruption detected." << llendl;
+ LL_ERRS() << "Volume face corruption detected." << LL_ENDL;
}
vf.mBeginT = 0;
@@ -2778,7 +2778,7 @@ void LLVolume::createVolumeFaces()
vf.mNumS = vf.mNumS*2;
if (vf.mNumS < 0)
{
- llerrs << "Volume face corruption detected." << llendl;
+ LL_ERRS() << "Volume face corruption detected." << LL_ENDL;
}
}
}
@@ -3107,7 +3107,7 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components,
// weird crash bug - DEV-11158 - trying to collect more data:
if ((sizeS == 0) || (sizeT == 0))
{
- llwarns << "sculpt bad mesh size " << sizeS << " " << sizeT << llendl;
+ LL_WARNS() << "sculpt bad mesh size " << sizeS << " " << sizeT << LL_ENDL;
}
sNumMeshPoints -= mMesh.size();
@@ -3502,16 +3502,16 @@ bool LLVolumeParams::setType(U8 profile, U8 path)
// Bad profile. Make it square.
profile = LL_PCODE_PROFILE_SQUARE;
result = false;
- llwarns << "LLVolumeParams::setType changing bad profile type (" << profile_type
- << ") to be LL_PCODE_PROFILE_SQUARE" << llendl;
+ LL_WARNS() << "LLVolumeParams::setType changing bad profile type (" << profile_type
+ << ") to be LL_PCODE_PROFILE_SQUARE" << LL_ENDL;
}
else if (hole_type > LL_PCODE_HOLE_MAX)
{
// Bad hole. Make it the same.
profile = profile_type;
result = false;
- llwarns << "LLVolumeParams::setType changing bad hole type (" << hole_type
- << ") to be LL_PCODE_HOLE_SAME" << llendl;
+ LL_WARNS() << "LLVolumeParams::setType changing bad hole type (" << hole_type
+ << ") to be LL_PCODE_HOLE_SAME" << LL_ENDL;
}
if (path_type < LL_PCODE_PATH_MIN ||
@@ -3519,8 +3519,8 @@ bool LLVolumeParams::setType(U8 profile, U8 path)
{
// Bad path. Make it linear.
result = false;
- llwarns << "LLVolumeParams::setType changing bad path (" << path
- << ") to be LL_PCODE_PATH_LINE" << llendl;
+ LL_WARNS() << "LLVolumeParams::setType changing bad path (" << path
+ << ") to be LL_PCODE_PATH_LINE" << LL_ENDL;
path = LL_PCODE_PATH_LINE;
}
@@ -4112,7 +4112,7 @@ BOOL equalTriangle(const S32 *a, const S32 *b)
BOOL LLVolumeParams::importFile(LLFILE *fp)
{
- //llinfos << "importing volume" << llendl;
+ //LL_INFOS() << "importing volume" << LL_ENDL;
const S32 BUFSIZE = 16384;
char buffer[BUFSIZE]; /* Flawfinder: ignore */
// *NOTE: changing the size or type of this buffer will require
@@ -4146,7 +4146,7 @@ BOOL LLVolumeParams::importFile(LLFILE *fp)
}
else
{
- llwarns << "unknown keyword " << keyword << " in volume import" << llendl;
+ LL_WARNS() << "unknown keyword " << keyword << " in volume import" << LL_ENDL;
}
}
@@ -4166,7 +4166,7 @@ BOOL LLVolumeParams::exportFile(LLFILE *fp) const
BOOL LLVolumeParams::importLegacyStream(std::istream& input_stream)
{
- //llinfos << "importing volume" << llendl;
+ //LL_INFOS() << "importing volume" << LL_ENDL;
const S32 BUFSIZE = 16384;
// *NOTE: changing the size or type of this buffer will require
// changing the sscanf below.
@@ -4196,7 +4196,7 @@ BOOL LLVolumeParams::importLegacyStream(std::istream& input_stream)
}
else
{
- llwarns << "unknown keyword " << keyword << " in volume import" << llendl;
+ LL_WARNS() << "unknown keyword " << keyword << " in volume import" << LL_ENDL;
}
}
@@ -4408,7 +4408,7 @@ LLFaceID LLVolume::generateFaceMask()
}
break;
default:
- llerrs << "Unknown profile!" << llendl;
+ LL_ERRS() << "Unknown profile!" << LL_ENDL;
break;
}
@@ -4669,7 +4669,7 @@ LLVolumeFace::~LLVolumeFace()
void LLVolumeFace::freeData()
{
- ll_aligned_free(mPositions);
+ ll_aligned_free<64>(mPositions);
mPositions = NULL;
//normals and texture coordinates are part of the same buffer as mPositions, do not free them separately
@@ -4707,7 +4707,7 @@ BOOL LLVolumeFace::create(LLVolume* volume, BOOL partial_build)
}
else
{
- llerrs << "Unknown/uninitialized face type!" << llendl;
+ LL_ERRS() << "Unknown/uninitialized face type!" << LL_ENDL;
}
return ret ;
@@ -5247,7 +5247,7 @@ void LLVolumeFace::cacheOptimize()
//allocate space for new buffer
S32 num_verts = mNumVertices;
S32 size = ((num_verts*sizeof(LLVector2)) + 0xF) & ~0xF;
- LLVector4a* pos = (LLVector4a*) ll_aligned_malloc(sizeof(LLVector4a)*2*num_verts+size, 64);
+ LLVector4a* pos = (LLVector4a*) ll_aligned_malloc<64>(sizeof(LLVector4a)*2*num_verts+size);
LLVector4a* norm = pos + num_verts;
LLVector2* tc = (LLVector2*) (norm + num_verts);
@@ -5297,7 +5297,7 @@ void LLVolumeFace::cacheOptimize()
mIndices[i] = new_idx[mIndices[i]];
}
- ll_aligned_free(mPositions);
+ ll_aligned_free<64>(mPositions);
// DO NOT free mNormals and mTexCoords as they are part of mPositions buffer
ll_aligned_free_16(mWeights);
ll_aligned_free_16(mTangents);
@@ -5309,7 +5309,7 @@ void LLVolumeFace::cacheOptimize()
mTangents = binorm;
//std::string result = llformat("ACMR pre/post: %.3f/%.3f -- %d triangles %d breaks", pre_acmr, post_acmr, mNumIndices/3, breaks);
- //llinfos << result << llendl;
+ //LL_INFOS() << result << LL_ENDL;
}
@@ -6025,7 +6025,7 @@ void LLVolumeFace::createTangents()
void LLVolumeFace::resizeVertices(S32 num_verts)
{
- ll_aligned_free(mPositions);
+ ll_aligned_free<64>(mPositions);
//DO NOT free mNormals and mTexCoords as they are part of mPositions buffer
ll_aligned_free_16(mTangents);
@@ -6036,7 +6036,7 @@ void LLVolumeFace::resizeVertices(S32 num_verts)
//pad texture coordinate block end to allow for QWORD reads
S32 size = ((num_verts*sizeof(LLVector2)) + 0xF) & ~0xF;
- mPositions = (LLVector4a*) ll_aligned_malloc(sizeof(LLVector4a)*2*num_verts+size, 64);
+ mPositions = (LLVector4a*) ll_aligned_malloc<64>(sizeof(LLVector4a)*2*num_verts+size);
mNormals = mPositions+num_verts;
mTexCoords = (LLVector2*) (mNormals+num_verts);
@@ -6076,7 +6076,7 @@ void LLVolumeFace::pushVertex(const LLVector4a& pos, const LLVector4a& norm, con
LLVector4a* old_buf = mPositions;
- mPositions = (LLVector4a*) ll_aligned_malloc(new_size, 64);
+ mPositions = (LLVector4a*) ll_aligned_malloc<64>(new_size);
mNormals = mPositions+new_verts;
mTexCoords = (LLVector2*) (mNormals+new_verts);
@@ -6092,7 +6092,7 @@ void LLVolumeFace::pushVertex(const LLVector4a& pos, const LLVector4a& norm, con
//just clear tangents
ll_aligned_free_16(mTangents);
mTangents = NULL;
- ll_aligned_free(old_buf);
+ ll_aligned_free<64>(old_buf);
mNumAllocatedVertices = new_verts;
@@ -6177,12 +6177,12 @@ void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& mat_in, LLMat
if (new_count > 65536)
{
- llerrs << "Cannot append face -- 16-bit overflow will occur." << llendl;
+ LL_ERRS() << "Cannot append face -- 16-bit overflow will occur." << LL_ENDL;
}
if (face.mNumVertices == 0)
{
- llerrs << "Cannot append empty face." << llendl;
+ LL_ERRS() << "Cannot append empty face." << LL_ENDL;
}
U32 old_vsize = mNumVertices*16;
@@ -6193,7 +6193,7 @@ void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& mat_in, LLMat
//allocate new buffer space
LLVector4a* old_buf = mPositions;
- mPositions = (LLVector4a*) ll_aligned_malloc(new_size, 64);
+ mPositions = (LLVector4a*) ll_aligned_malloc<64>(new_size);
mNormals = mPositions + new_count;
mTexCoords = (LLVector2*) (mNormals+new_count);
diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h
index 975227ea58..2f38ae7203 100755
--- a/indra/llmath/llvolume.h
+++ b/indra/llmath/llvolume.h
@@ -41,7 +41,6 @@ class LLVolumeFace;
class LLVolume;
class LLVolumeTriangle;
-#include "lldarray.h"
#include "lluuid.h"
#include "v4color.h"
//#include "vmath.h"
diff --git a/indra/llmath/llvolumemgr.cpp b/indra/llmath/llvolumemgr.cpp
index 9083273ee5..3b8f08e0c6 100755
--- a/indra/llmath/llvolumemgr.cpp
+++ b/indra/llmath/llvolumemgr.cpp
@@ -147,7 +147,7 @@ void LLVolumeMgr::unrefVolume(LLVolume *volumep)
volume_lod_group_map_t::iterator iter = mVolumeLODGroups.find(params);
if( iter == mVolumeLODGroups.end() )
{
- llerrs << "Warning! Tried to cleanup unknown volume type! " << *params << llendl;
+ LL_ERRS() << "Warning! Tried to cleanup unknown volume type! " << *params << LL_ENDL;
if (mDataMutex)
{
mDataMutex->unlock();
@@ -207,7 +207,7 @@ void LLVolumeMgr::dump()
{
mDataMutex->unlock();
}
- llinfos << "Average usage of LODs " << avg << llendl;
+ LL_INFOS() << "Average usage of LODs " << avg << LL_ENDL;
}
void LLVolumeMgr::useMutex()
@@ -270,18 +270,18 @@ bool LLVolumeLODGroup::cleanupRefs()
bool res = true;
if (mRefs != 0)
{
- llwarns << "Volume group has remaining refs:" << getNumRefs() << llendl;
+ LL_WARNS() << "Volume group has remaining refs:" << getNumRefs() << LL_ENDL;
mRefs = 0;
for (S32 i = 0; i < NUM_LODS; i++)
{
if (mLODRefs[i] > 0)
{
- llwarns << " LOD " << i << " refs = " << mLODRefs[i] << llendl;
+ LL_WARNS() << " LOD " << i << " refs = " << mLODRefs[i] << LL_ENDL;
mLODRefs[i] = 0;
mVolumeLODs[i] = NULL;
}
}
- llwarns << *getVolumeParams() << llendl;
+ LL_WARNS() << *getVolumeParams() << LL_ENDL;
res = false;
}
return res;
@@ -320,7 +320,7 @@ BOOL LLVolumeLODGroup::derefLOD(LLVolume *volumep)
return TRUE;
}
}
- llerrs << "Deref of non-matching LOD in volume LOD group" << llendl;
+ LL_ERRS() << "Deref of non-matching LOD in volume LOD group" << LL_ENDL;
return FALSE;
}
@@ -393,7 +393,7 @@ F32 LLVolumeLODGroup::dump()
std::string dump_str = llformat("%.3f %d %d %d %d", usage, mAccessCount[0], mAccessCount[1], mAccessCount[2], mAccessCount[3]);
- llinfos << dump_str << llendl;
+ LL_INFOS() << dump_str << LL_ENDL;
return usage;
}
diff --git a/indra/llmath/llvolumeoctree.cpp b/indra/llmath/llvolumeoctree.cpp
index 0728b49c1f..fb232d5f6c 100755
--- a/indra/llmath/llvolumeoctree.cpp
+++ b/indra/llmath/llvolumeoctree.cpp
@@ -237,7 +237,7 @@ void LLVolumeOctreeValidate::visit(const LLOctreeNode<LLVolumeTriangle>* branch)
if (!test_min.equals3(min, 0.001f) ||
!test_max.equals3(max, 0.001f))
{
- llerrs << "Bad bounding box data found." << llendl;
+ LL_ERRS() << "Bad bounding box data found." << LL_ENDL;
}
test_min.sub(LLVector4a(0.001f));
@@ -251,7 +251,7 @@ void LLVolumeOctreeValidate::visit(const LLOctreeNode<LLVolumeTriangle>* branch)
if (child->mExtents[0].lessThan(test_min).areAnySet(LLVector4Logical::MASK_XYZ) ||
child->mExtents[1].greaterThan(test_max).areAnySet(LLVector4Logical::MASK_XYZ))
{
- llerrs << "Child protrudes from bounding box." << llendl;
+ LL_ERRS() << "Child protrudes from bounding box." << LL_ENDL;
}
}
@@ -267,7 +267,7 @@ void LLVolumeOctreeValidate::visit(const LLOctreeNode<LLVolumeTriangle>* branch)
if (tri->mV[i]->greaterThan(test_max).areAnySet(LLVector4Logical::MASK_XYZ) ||
tri->mV[i]->lessThan(test_min).areAnySet(LLVector4Logical::MASK_XYZ))
{
- llerrs << "Triangle protrudes from node." << llendl;
+ LL_ERRS() << "Triangle protrudes from node." << LL_ENDL;
}
}
}
diff --git a/indra/llmath/llvolumeoctree.h b/indra/llmath/llvolumeoctree.h
index 80d6ced36d..13150028d8 100755
--- a/indra/llmath/llvolumeoctree.h
+++ b/indra/llmath/llvolumeoctree.h
@@ -59,7 +59,7 @@ public:
const LLVolumeTriangle& operator=(const LLVolumeTriangle& rhs)
{
- llerrs << "Illegal operation!" << llendl;
+ LL_ERRS() << "Illegal operation!" << LL_ENDL;
return *this;
}
@@ -110,7 +110,7 @@ public:
const LLVolumeOctreeListener& operator=(const LLVolumeOctreeListener& rhs)
{
- llerrs << "Illegal operation!" << llendl;
+ LL_ERRS() << "Illegal operation!" << LL_ENDL;
return *this;
}
diff --git a/indra/llmath/v3dmath.h b/indra/llmath/v3dmath.h
index 578dcdc8ea..4938273d5b 100755
--- a/indra/llmath/v3dmath.h
+++ b/indra/llmath/v3dmath.h
@@ -72,17 +72,22 @@ class LLVector3d
BOOL clamp(const F64 min, const F64 max); // Clamps all values to (min,max), returns TRUE if data changed
BOOL abs(); // sets all values to absolute value of original value (first octant), returns TRUE if changed
- inline const LLVector3d& clearVec(); // Clears LLVector3d to (0, 0, 0, 1)
+ inline const LLVector3d& clear(); // Clears LLVector3d to (0, 0, 0, 1)
+ inline const LLVector3d& clearVec(); // deprecated
inline const LLVector3d& setZero(); // Zero LLVector3d to (0, 0, 0, 0)
inline const LLVector3d& zeroVec(); // deprecated
- inline const LLVector3d& setVec(const F64 x, const F64 y, const F64 z); // Sets LLVector3d to (x, y, z, 1)
- inline const LLVector3d& setVec(const LLVector3d &vec); // Sets LLVector3d to vec
- inline const LLVector3d& setVec(const F64 *vec); // Sets LLVector3d to vec
- inline const LLVector3d& setVec(const LLVector3 &vec);
-
- F64 magVec() const; // Returns magnitude of LLVector3d
- F64 magVecSquared() const; // Returns magnitude squared of LLVector3d
- inline F64 normVec(); // Normalizes and returns the magnitude of LLVector3d
+ inline const LLVector3d& set(const F64 x, const F64 y, const F64 z); // Sets LLVector3d to (x, y, z, 1)
+ inline const LLVector3d& set(const LLVector3d &vec); // Sets LLVector3d to vec
+ inline const LLVector3d& set(const F64 *vec); // Sets LLVector3d to vec
+ inline const LLVector3d& set(const LLVector3 &vec);
+ inline const LLVector3d& setVec(const F64 x, const F64 y, const F64 z); // deprecated
+ inline const LLVector3d& setVec(const LLVector3d &vec); // deprecated
+ inline const LLVector3d& setVec(const F64 *vec); // deprecated
+ inline const LLVector3d& setVec(const LLVector3 &vec); // deprecated
+
+ F64 magVec() const; // deprecated
+ F64 magVecSquared() const; // deprecated
+ inline F64 normVec(); // deprecated
F64 length() const; // Returns magnitude of LLVector3d
F64 lengthSquared() const; // Returns magnitude squared of LLVector3d
@@ -101,25 +106,25 @@ class LLVector3d
F64 operator[](int idx) const { return mdV[idx]; }
F64 &operator[](int idx) { return mdV[idx]; }
- friend LLVector3d operator+(const LLVector3d &a, const LLVector3d &b); // Return vector a + b
- friend LLVector3d operator-(const LLVector3d &a, const LLVector3d &b); // Return vector a minus b
- friend F64 operator*(const LLVector3d &a, const LLVector3d &b); // Return a dot b
- friend LLVector3d operator%(const LLVector3d &a, const LLVector3d &b); // Return a cross b
- friend LLVector3d operator*(const LLVector3d &a, const F64 k); // Return a times scaler k
- friend LLVector3d operator/(const LLVector3d &a, const F64 k); // Return a divided by scaler k
- friend LLVector3d operator*(const F64 k, const LLVector3d &a); // Return a times scaler k
- friend bool operator==(const LLVector3d &a, const LLVector3d &b); // Return a == b
- friend bool operator!=(const LLVector3d &a, const LLVector3d &b); // Return a != b
+ friend LLVector3d operator+(const LLVector3d& a, const LLVector3d& b); // Return vector a + b
+ friend LLVector3d operator-(const LLVector3d& a, const LLVector3d& b); // Return vector a minus b
+ friend F64 operator*(const LLVector3d& a, const LLVector3d& b); // Return a dot b
+ friend LLVector3d operator%(const LLVector3d& a, const LLVector3d& b); // Return a cross b
+ friend LLVector3d operator*(const LLVector3d& a, const F64 k); // Return a times scaler k
+ friend LLVector3d operator/(const LLVector3d& a, const F64 k); // Return a divided by scaler k
+ friend LLVector3d operator*(const F64 k, const LLVector3d& a); // Return a times scaler k
+ friend bool operator==(const LLVector3d& a, const LLVector3d& b); // Return a == b
+ friend bool operator!=(const LLVector3d& a, const LLVector3d& b); // Return a != b
- friend const LLVector3d& operator+=(LLVector3d &a, const LLVector3d &b); // Return vector a + b
- friend const LLVector3d& operator-=(LLVector3d &a, const LLVector3d &b); // Return vector a minus b
- friend const LLVector3d& operator%=(LLVector3d &a, const LLVector3d &b); // Return a cross b
- friend const LLVector3d& operator*=(LLVector3d &a, const F64 k); // Return a times scaler k
- friend const LLVector3d& operator/=(LLVector3d &a, const F64 k); // Return a divided by scaler k
+ friend const LLVector3d& operator+=(LLVector3d& a, const LLVector3d& b); // Return vector a + b
+ friend const LLVector3d& operator-=(LLVector3d& a, const LLVector3d& b); // Return vector a minus b
+ friend const LLVector3d& operator%=(LLVector3d& a, const LLVector3d& b); // Return a cross b
+ friend const LLVector3d& operator*=(LLVector3d& a, const F64 k); // Return a times scaler k
+ friend const LLVector3d& operator/=(LLVector3d& a, const F64 k); // Return a divided by scaler k
- friend LLVector3d operator-(const LLVector3d &a); // Return vector -a
+ friend LLVector3d operator-(const LLVector3d& a); // Return vector -a
- friend std::ostream& operator<<(std::ostream& s, const LLVector3d &a); // Stream a
+ friend std::ostream& operator<<(std::ostream& s, const LLVector3d& a); // Stream a
static BOOL parseVector3d(const std::string& buf, LLVector3d* value);
@@ -127,7 +132,15 @@ class LLVector3d
typedef LLVector3d LLGlobalVec;
-const LLVector3d &LLVector3d::setVec(const LLVector3 &vec)
+inline const LLVector3d &LLVector3d::set(const LLVector3 &vec)
+{
+ mdV[0] = vec.mV[0];
+ mdV[1] = vec.mV[1];
+ mdV[2] = vec.mV[2];
+ return *this;
+}
+
+inline const LLVector3d &LLVector3d::setVec(const LLVector3 &vec)
{
mdV[0] = vec.mV[0];
mdV[1] = vec.mV[1];
@@ -184,6 +197,14 @@ inline BOOL LLVector3d::isFinite() const
// Clear and Assignment Functions
+inline const LLVector3d& LLVector3d::clear(void)
+{
+ mdV[0] = 0.f;
+ mdV[1] = 0.f;
+ mdV[2]= 0.f;
+ return (*this);
+}
+
inline const LLVector3d& LLVector3d::clearVec(void)
{
mdV[0] = 0.f;
@@ -208,6 +229,30 @@ inline const LLVector3d& LLVector3d::zeroVec(void)
return (*this);
}
+inline const LLVector3d& LLVector3d::set(const F64 x, const F64 y, const F64 z)
+{
+ mdV[VX] = x;
+ mdV[VY] = y;
+ mdV[VZ] = z;
+ return (*this);
+}
+
+inline const LLVector3d& LLVector3d::set(const LLVector3d &vec)
+{
+ mdV[0] = vec.mdV[0];
+ mdV[1] = vec.mdV[1];
+ mdV[2] = vec.mdV[2];
+ return (*this);
+}
+
+inline const LLVector3d& LLVector3d::set(const F64 *vec)
+{
+ mdV[0] = vec[0];
+ mdV[1] = vec[1];
+ mdV[2] = vec[2];
+ return (*this);
+}
+
inline const LLVector3d& LLVector3d::setVec(const F64 x, const F64 y, const F64 z)
{
mdV[VX] = x;
@@ -298,59 +343,59 @@ inline F64 LLVector3d::lengthSquared(void) const
return mdV[0]*mdV[0] + mdV[1]*mdV[1] + mdV[2]*mdV[2];
}
-inline LLVector3d operator+(const LLVector3d &a, const LLVector3d &b)
+inline LLVector3d operator+(const LLVector3d& a, const LLVector3d& b)
{
LLVector3d c(a);
return c += b;
}
-inline LLVector3d operator-(const LLVector3d &a, const LLVector3d &b)
+inline LLVector3d operator-(const LLVector3d& a, const LLVector3d& b)
{
LLVector3d c(a);
return c -= b;
}
-inline F64 operator*(const LLVector3d &a, const LLVector3d &b)
+inline F64 operator*(const LLVector3d& a, const LLVector3d& b)
{
return (a.mdV[0]*b.mdV[0] + a.mdV[1]*b.mdV[1] + a.mdV[2]*b.mdV[2]);
}
-inline LLVector3d operator%(const LLVector3d &a, const LLVector3d &b)
+inline LLVector3d operator%(const LLVector3d& a, const LLVector3d& b)
{
return LLVector3d( a.mdV[1]*b.mdV[2] - b.mdV[1]*a.mdV[2], a.mdV[2]*b.mdV[0] - b.mdV[2]*a.mdV[0], a.mdV[0]*b.mdV[1] - b.mdV[0]*a.mdV[1] );
}
-inline LLVector3d operator/(const LLVector3d &a, const F64 k)
+inline LLVector3d operator/(const LLVector3d& a, const F64 k)
{
F64 t = 1.f / k;
return LLVector3d( a.mdV[0] * t, a.mdV[1] * t, a.mdV[2] * t );
}
-inline LLVector3d operator*(const LLVector3d &a, const F64 k)
+inline LLVector3d operator*(const LLVector3d& a, const F64 k)
{
return LLVector3d( a.mdV[0] * k, a.mdV[1] * k, a.mdV[2] * k );
}
-inline LLVector3d operator*(F64 k, const LLVector3d &a)
+inline LLVector3d operator*(F64 k, const LLVector3d& a)
{
return LLVector3d( a.mdV[0] * k, a.mdV[1] * k, a.mdV[2] * k );
}
-inline bool operator==(const LLVector3d &a, const LLVector3d &b)
+inline bool operator==(const LLVector3d& a, const LLVector3d& b)
{
return ( (a.mdV[0] == b.mdV[0])
&&(a.mdV[1] == b.mdV[1])
&&(a.mdV[2] == b.mdV[2]));
}
-inline bool operator!=(const LLVector3d &a, const LLVector3d &b)
+inline bool operator!=(const LLVector3d& a, const LLVector3d& b)
{
return ( (a.mdV[0] != b.mdV[0])
||(a.mdV[1] != b.mdV[1])
||(a.mdV[2] != b.mdV[2]));
}
-inline const LLVector3d& operator+=(LLVector3d &a, const LLVector3d &b)
+inline const LLVector3d& operator+=(LLVector3d& a, const LLVector3d& b)
{
a.mdV[0] += b.mdV[0];
a.mdV[1] += b.mdV[1];
@@ -358,7 +403,7 @@ inline const LLVector3d& operator+=(LLVector3d &a, const LLVector3d &b)
return a;
}
-inline const LLVector3d& operator-=(LLVector3d &a, const LLVector3d &b)
+inline const LLVector3d& operator-=(LLVector3d& a, const LLVector3d& b)
{
a.mdV[0] -= b.mdV[0];
a.mdV[1] -= b.mdV[1];
@@ -366,14 +411,14 @@ inline const LLVector3d& operator-=(LLVector3d &a, const LLVector3d &b)
return a;
}
-inline const LLVector3d& operator%=(LLVector3d &a, const LLVector3d &b)
+inline const LLVector3d& operator%=(LLVector3d& a, const LLVector3d& b)
{
LLVector3d ret( a.mdV[1]*b.mdV[2] - b.mdV[1]*a.mdV[2], a.mdV[2]*b.mdV[0] - b.mdV[2]*a.mdV[0], a.mdV[0]*b.mdV[1] - b.mdV[0]*a.mdV[1]);
a = ret;
return a;
}
-inline const LLVector3d& operator*=(LLVector3d &a, const F64 k)
+inline const LLVector3d& operator*=(LLVector3d& a, const F64 k)
{
a.mdV[0] *= k;
a.mdV[1] *= k;
@@ -381,7 +426,7 @@ inline const LLVector3d& operator*=(LLVector3d &a, const F64 k)
return a;
}
-inline const LLVector3d& operator/=(LLVector3d &a, const F64 k)
+inline const LLVector3d& operator/=(LLVector3d& a, const F64 k)
{
F64 t = 1.f / k;
a.mdV[0] *= t;
@@ -390,12 +435,12 @@ inline const LLVector3d& operator/=(LLVector3d &a, const F64 k)
return a;
}
-inline LLVector3d operator-(const LLVector3d &a)
+inline LLVector3d operator-(const LLVector3d& a)
{
return LLVector3d( -a.mdV[0], -a.mdV[1], -a.mdV[2] );
}
-inline F64 dist_vec(const LLVector3d &a, const LLVector3d &b)
+inline F64 dist_vec(const LLVector3d& a, const LLVector3d& b)
{
F64 x = a.mdV[0] - b.mdV[0];
F64 y = a.mdV[1] - b.mdV[1];
@@ -403,7 +448,7 @@ inline F64 dist_vec(const LLVector3d &a, const LLVector3d &b)
return (F32) sqrt( x*x + y*y + z*z );
}
-inline F64 dist_vec_squared(const LLVector3d &a, const LLVector3d &b)
+inline F64 dist_vec_squared(const LLVector3d& a, const LLVector3d& b)
{
F64 x = a.mdV[0] - b.mdV[0];
F64 y = a.mdV[1] - b.mdV[1];
@@ -411,14 +456,14 @@ inline F64 dist_vec_squared(const LLVector3d &a, const LLVector3d &b)
return x*x + y*y + z*z;
}
-inline F64 dist_vec_squared2D(const LLVector3d &a, const LLVector3d &b)
+inline F64 dist_vec_squared2D(const LLVector3d& a, const LLVector3d& b)
{
F64 x = a.mdV[0] - b.mdV[0];
F64 y = a.mdV[1] - b.mdV[1];
return x*x + y*y;
}
-inline LLVector3d lerp(const LLVector3d &a, const LLVector3d &b, const F64 u)
+inline LLVector3d lerp(const LLVector3d& a, const LLVector3d& b, const F64 u)
{
return LLVector3d(
a.mdV[VX] + (b.mdV[VX] - a.mdV[VX]) * u,
@@ -450,7 +495,7 @@ inline F64 angle_between(const LLVector3d& a, const LLVector3d& b)
return angle;
}
-inline BOOL are_parallel(const LLVector3d &a, const LLVector3d &b, const F64 epsilon)
+inline BOOL are_parallel(const LLVector3d& a, const LLVector3d& b, const F64 epsilon)
{
LLVector3d an = a;
LLVector3d bn = b;
@@ -465,11 +510,22 @@ inline BOOL are_parallel(const LLVector3d &a, const LLVector3d &b, const F64 eps
}
-inline LLVector3d projected_vec(const LLVector3d &a, const LLVector3d &b)
+inline LLVector3d projected_vec(const LLVector3d& a, const LLVector3d& b)
{
LLVector3d project_axis = b;
project_axis.normalize();
return project_axis * (a * project_axis);
}
+inline LLVector3d inverse_projected_vec(const LLVector3d& a, const LLVector3d& b)
+{
+ LLVector3d normalized_a = a;
+ normalized_a.normalize();
+ LLVector3d normalized_b = b;
+ F64 b_length = normalized_b.normalize();
+
+ F64 dot_product = normalized_a * normalized_b;
+ return normalized_a * (b_length / dot_product);
+}
+
#endif // LL_V3DMATH_H
diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h
index 0432aeba4c..f3fbce4843 100755
--- a/indra/llmath/v3math.h
+++ b/indra/llmath/v3math.h
@@ -1,4 +1,4 @@
-/**
+/**
* @file v3math.h
* @brief LLVector3 class header file.
*
@@ -159,6 +159,7 @@ F32 dist_vec(const LLVector3 &a, const LLVector3 &b); // Returns distance betwe
F32 dist_vec_squared(const LLVector3 &a, const LLVector3 &b);// Returns distance squared between a and b
F32 dist_vec_squared2D(const LLVector3 &a, const LLVector3 &b);// Returns distance squared between a and b ignoring Z component
LLVector3 projected_vec(const LLVector3 &a, const LLVector3 &b); // Returns vector a projected on vector b
+LLVector3 inverse_projected_vec(const LLVector3 &a, const LLVector3 &b); // Returns vector a scaled such that projected_vec(inverse_projected_vec(a, b), b) == b;
LLVector3 parallel_component(const LLVector3 &a, const LLVector3 &b); // Returns vector a projected on vector b (same as projected_vec)
LLVector3 orthogonal_component(const LLVector3 &a, const LLVector3 &b); // Returns component of vector a not parallel to vector b (same as projected_vec)
LLVector3 lerp(const LLVector3 &a, const LLVector3 &b, F32 u); // Returns a vector that is a linear interpolation between a and b
@@ -490,9 +491,27 @@ inline F32 dist_vec_squared2D(const LLVector3 &a, const LLVector3 &b)
inline LLVector3 projected_vec(const LLVector3 &a, const LLVector3 &b)
{
- LLVector3 project_axis = b;
- project_axis.normalize();
- return project_axis * (a * project_axis);
+ F32 bb = b * b;
+ if (bb > FP_MAG_THRESHOLD * FP_MAG_THRESHOLD)
+ {
+ return ((a * b) / bb) * b;
+ }
+ else
+ {
+ return b.zero;
+ }
+}
+
+inline LLVector3 inverse_projected_vec(const LLVector3& a, const LLVector3& b)
+{
+ LLVector3 normalized_a = a;
+ normalized_a.normalize();
+ LLVector3 normalized_b = b;
+ F32 b_length = normalized_b.normalize();
+
+ F32 dot_product = normalized_a * normalized_b;
+ //NB: if a _|_ b, then returns an infinite vector
+ return normalized_a * (b_length / dot_product);
}
inline LLVector3 parallel_component(const LLVector3 &a, const LLVector3 &b)
@@ -556,15 +575,13 @@ inline void update_min_max(LLVector3& min, LLVector3& max, const F32* pos)
inline F32 angle_between(const LLVector3& a, const LLVector3& b)
{
- LLVector3 an = a;
- LLVector3 bn = b;
- an.normalize();
- bn.normalize();
- F32 cosine = an * bn;
- F32 angle = (cosine >= 1.0f) ? 0.0f :
- (cosine <= -1.0f) ? F_PI :
- (F32)acos(cosine);
- return angle;
+ F32 ab = a * b; // dotproduct
+ if (ab == -0.0f)
+ {
+ ab = 0.0f; // get rid of negative zero
+ }
+ LLVector3 c = a % b; // crossproduct
+ return atan2f(sqrtf(c * c), ab); // return the angle
}
inline BOOL are_parallel(const LLVector3 &a, const LLVector3 &b, F32 epsilon)
diff --git a/indra/llmath/v4color.cpp b/indra/llmath/v4color.cpp
index 81ac62be56..cd2be7c8fd 100755
--- a/indra/llmath/v4color.cpp
+++ b/indra/llmath/v4color.cpp
@@ -245,7 +245,7 @@ void LLColor4::setValue(const LLSD& sd)
if (out_of_range)
{
- llwarns << "LLSD color value out of range!" << llendl;
+ LL_WARNS() << "LLSD color value out of range!" << LL_ENDL;
}
#else
mV[0] = (F32) sd[0].asReal();
@@ -417,7 +417,7 @@ BOOL LLColor4::parseColor(const std::string& buf, LLColor4* color)
if (token_iter == tokens.end())
{
// This is a malformed vector.
- llwarns << "LLColor4::parseColor() malformed color " << buf << llendl;
+ LL_WARNS() << "LLColor4::parseColor() malformed color " << buf << LL_ENDL;
}
else
{
@@ -704,7 +704,7 @@ BOOL LLColor4::parseColor(const std::string& buf, LLColor4* color)
}
else
{
- llwarns << "invalid color " << color_name << llendl;
+ LL_WARNS() << "invalid color " << color_name << LL_ENDL;
}
}
diff --git a/indra/llmath/v4color.h b/indra/llmath/v4color.h
index 8c8c315808..0d632f59be 100755
--- a/indra/llmath/v4color.h
+++ b/indra/llmath/v4color.h
@@ -49,10 +49,10 @@ class LLColor4
LLColor4(); // Initializes LLColor4 to (0, 0, 0, 1)
LLColor4(F32 r, F32 g, F32 b); // Initializes LLColor4 to (r, g, b, 1)
LLColor4(F32 r, F32 g, F32 b, F32 a); // Initializes LLColor4 to (r. g, b, a)
- LLColor4(U32 clr); // Initializes LLColor4 to (r=clr>>24, etc))
- LLColor4(const F32 *vec); // Initializes LLColor4 to (vec[0]. vec[1], vec[2], vec[3])
LLColor4(const LLColor3 &vec, F32 a = 1.f); // Initializes LLColor4 to (vec, a)
explicit LLColor4(const LLSD& sd);
+ explicit LLColor4(const F32 *vec); // Initializes LLColor4 to (vec[0]. vec[1], vec[2], 1)
+ explicit LLColor4(U32 clr); // Initializes LLColor4 to (r=clr>>24, etc))
explicit LLColor4(const LLColor4U& color4u); // "explicit" to avoid automatic conversion
explicit LLColor4(const LLVector4& vector4); // "explicit" to avoid automatic conversion
diff --git a/indra/llmath/xform.cpp b/indra/llmath/xform.cpp
index b75aec6a27..5d8b93d5e8 100755
--- a/indra/llmath/xform.cpp
+++ b/indra/llmath/xform.cpp
@@ -36,10 +36,10 @@ LLXform::~LLXform()
{
}
-// Link optimization - don't inline these llwarns
+// Link optimization - don't inline these LL_WARNS()
void LLXform::warn(const char* const msg)
{
- llwarns << msg << llendl;
+ LL_WARNS() << msg << LL_ENDL;
}
LLXform* LLXform::getRoot() const
diff --git a/indra/llmath/xform.h b/indra/llmath/xform.h
index 1b50749b3e..54b0f6d9ec 100755
--- a/indra/llmath/xform.h
+++ b/indra/llmath/xform.h
@@ -103,9 +103,9 @@ public:
inline void setRotation(const F32 x, const F32 y, const F32 z, const F32 s);
// Above functions must be inline for speed, but also
- // need to emit warnings. llwarns causes inline LLError::CallSite
+ // need to emit warnings. LL_WARNS() causes inline LLError::CallSite
// static objects that make more work for the linker.
- // Avoid inline llwarns by calling this function.
+ // Avoid inline LL_WARNS() by calling this function.
void warn(const char* const msg);
void setChanged(const U32 bits) { mChanged |= bits; }
diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt
index d193e367eb..8bd134dc84 100755
--- a/indra/llmessage/CMakeLists.txt
+++ b/indra/llmessage/CMakeLists.txt
@@ -27,6 +27,7 @@ set(llmessage_SOURCE_FILES
llares.cpp
llareslistener.cpp
llassetstorage.cpp
+ llavatarname.cpp
llavatarnamecache.cpp
llblowfishcipher.cpp
llbuffer.cpp
@@ -43,6 +44,7 @@ set(llmessage_SOURCE_FILES
llhttpassetstorage.cpp
llhttpclient.cpp
llhttpclientadapter.cpp
+ llhttpconstants.cpp
llhttpnode.cpp
llhttpsender.cpp
llinstantmessage.cpp
@@ -58,7 +60,6 @@ set(llmessage_SOURCE_FILES
llmessagetemplate.cpp
llmessagetemplateparser.cpp
llmessagethrottle.cpp
- llmime.cpp
llnamevalue.cpp
llnullcipher.cpp
llpacketack.cpp
@@ -67,7 +68,6 @@ set(llmessage_SOURCE_FILES
llpartdata.cpp
llproxy.cpp
llpumpio.cpp
- llregionpresenceverifier.cpp
llsdappservices.cpp
llsdhttpserver.cpp
llsdmessage.cpp
@@ -114,6 +114,7 @@ set(llmessage_HEADER_FILES
llares.h
llareslistener.h
llassetstorage.h
+ llavatarname.h
llavatarnamecache.h
llblowfishcipher.h
llbuffer.h
@@ -128,6 +129,7 @@ set(llmessage_HEADER_FILES
lldbstrings.h
lldispatcher.h
lleventflags.h
+ llextendedstatus.h
llfiltersd2xmlrpc.h
llfollowcamparams.h
llhost.h
@@ -135,6 +137,7 @@ set(llmessage_HEADER_FILES
llhttpclient.h
llhttpclientinterface.h
llhttpclientadapter.h
+ llhttpconstants.h
llhttpnode.h
llhttpnodeadapter.h
llhttpsender.h
@@ -153,7 +156,6 @@ set(llmessage_HEADER_FILES
llmessagetemplate.h
llmessagetemplateparser.h
llmessagethrottle.h
- llmime.h
llmsgvariabletype.h
llnamevalue.h
llnullcipher.h
@@ -166,7 +168,6 @@ set(llmessage_HEADER_FILES
llqueryflags.h
llregionflags.h
llregionhandle.h
- llregionpresenceverifier.h
llsdappservices.h
llsdhttpserver.h
llsdmessage.h
@@ -230,17 +231,15 @@ target_link_libraries(
# tests
if (LL_TESTS)
SET(llmessage_TEST_SOURCE_FILES
- # llhttpclientadapter.cpp
- llmime.cpp
llnamevalue.cpp
lltrustedmessageservice.cpp
lltemplatemessagedispatcher.cpp
- llregionpresenceverifier.cpp
)
LL_ADD_PROJECT_UNIT_TESTS(llmessage "${llmessage_TEST_SOURCE_FILES}")
# set(TEST_DEBUG on)
set(test_libs
+ ${CURL_LIBRARIES}
${LLMESSAGE_LIBRARIES}
${WINDOWS_LIBRARIES}
${LLVFS_LIBRARIES}
@@ -267,6 +266,7 @@ if (LL_TESTS)
LL_ADD_INTEGRATION_TEST(llavatarnamecache "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(llhost "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(llhttpclientadapter "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(llpartdata "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(llxfer_file "" "${test_libs}")
endif (LL_TESTS)
diff --git a/indra/llmessage/llares.cpp b/indra/llmessage/llares.cpp
index 7f74247a13..9f90ae1544 100755
--- a/indra/llmessage/llares.cpp
+++ b/indra/llmessage/llares.cpp
@@ -55,13 +55,13 @@ LLAres::HostResponder::~HostResponder()
void LLAres::HostResponder::hostResult(const hostent *ent)
{
- llinfos << "LLAres::HostResponder::hostResult not implemented" << llendl;
+ LL_INFOS() << "LLAres::HostResponder::hostResult not implemented" << LL_ENDL;
}
void LLAres::HostResponder::hostError(int code)
{
- llinfos << "LLAres::HostResponder::hostError " << code << ": "
- << LLAres::strerror(code) << llendl;
+ LL_INFOS() << "LLAres::HostResponder::hostError " << code << ": "
+ << LLAres::strerror(code) << LL_ENDL;
}
LLAres::NameInfoResponder::~NameInfoResponder()
@@ -71,14 +71,14 @@ LLAres::NameInfoResponder::~NameInfoResponder()
void LLAres::NameInfoResponder::nameInfoResult(const char *node,
const char *service)
{
- llinfos << "LLAres::NameInfoResponder::nameInfoResult not implemented"
- << llendl;
+ LL_INFOS() << "LLAres::NameInfoResponder::nameInfoResult not implemented"
+ << LL_ENDL;
}
void LLAres::NameInfoResponder::nameInfoError(int code)
{
- llinfos << "LLAres::NameInfoResponder::nameInfoError " << code << ": "
- << LLAres::strerror(code) << llendl;
+ LL_INFOS() << "LLAres::NameInfoResponder::nameInfoError " << code << ": "
+ << LLAres::strerror(code) << LL_ENDL;
}
LLAres::QueryResponder::~QueryResponder()
@@ -87,14 +87,14 @@ LLAres::QueryResponder::~QueryResponder()
void LLAres::QueryResponder::queryResult(const char *buf, size_t len)
{
- llinfos << "LLAres::QueryResponder::queryResult not implemented"
- << llendl;
+ LL_INFOS() << "LLAres::QueryResponder::queryResult not implemented"
+ << LL_ENDL;
}
void LLAres::QueryResponder::queryError(int code)
{
- llinfos << "LLAres::QueryResponder::queryError " << code << ": "
- << LLAres::strerror(code) << llendl;
+ LL_INFOS() << "LLAres::QueryResponder::queryError " << code << ": "
+ << LLAres::strerror(code) << LL_ENDL;
}
LLAres::LLAres() :
@@ -104,7 +104,7 @@ LLAres::LLAres() :
if (ares_library_init( ARES_LIB_INIT_ALL ) != ARES_SUCCESS ||
ares_init(&chan_) != ARES_SUCCESS)
{
- llwarns << "Could not succesfully initialize ares!" << llendl;
+ LL_WARNS() << "Could not succesfully initialize ares!" << LL_ENDL;
return;
}
@@ -176,7 +176,7 @@ void LLAres::rewriteURI(const std::string &uri, UriRewriteResponder *resp)
return;
}
- //llinfos << "LLAres::rewriteURI (" << uri << ") search: '" << "_" + resp->mUri.scheme() + "._tcp." + resp->mUri.hostName() << "'" << llendl;
+ //LL_INFOS() << "LLAres::rewriteURI (" << uri << ") search: '" << "_" + resp->mUri.scheme() + "._tcp." + resp->mUri.hostName() << "'" << LL_ENDL;
search("_" + resp->mUri.scheme() + "._tcp." + resp->mUri.hostName(), RES_SRV, resp);
@@ -251,8 +251,8 @@ int LLQueryResponder::parseRR(const char *buf, size_t len, const char *&pos,
r = new LLSrvRecord(rrname, rrttl);
break;
default:
- llinfos << "LLQueryResponder::parseRR got unknown RR type " << rrtype
- << llendl;
+ LL_INFOS() << "LLQueryResponder::parseRR got unknown RR type " << rrtype
+ << LL_ENDL;
return ARES_EBADRESP;
}
@@ -333,7 +333,7 @@ void LLQueryResponder::queryResult(const char *buf, size_t len)
mType = (LLResType) t;
break;
default:
- llinfos << "Cannot grok query type " << t << llendl;
+ LL_INFOS() << "Cannot grok query type " << t << LL_ENDL;
ret = ARES_EBADQUERY;
goto bail;
}
@@ -373,7 +373,7 @@ bail:
void LLQueryResponder::querySuccess()
{
- llinfos << "LLQueryResponder::queryResult not implemented" << llendl;
+ LL_INFOS() << "LLQueryResponder::queryResult not implemented" << LL_ENDL;
}
void LLAres::SrvResponder::querySuccess()
@@ -393,23 +393,23 @@ void LLAres::SrvResponder::queryError(int code)
void LLAres::SrvResponder::srvResult(const dns_rrs_t &ents)
{
- llinfos << "LLAres::SrvResponder::srvResult not implemented" << llendl;
+ LL_INFOS() << "LLAres::SrvResponder::srvResult not implemented" << LL_ENDL;
for (size_t i = 0; i < ents.size(); i++)
{
const LLSrvRecord *s = (const LLSrvRecord *) ents[i].get();
- llinfos << "[" << i << "] " << s->host() << ":" << s->port()
+ LL_INFOS() << "[" << i << "] " << s->host() << ":" << s->port()
<< " priority " << s->priority()
<< " weight " << s->weight()
- << llendl;
+ << LL_ENDL;
}
}
void LLAres::SrvResponder::srvError(int code)
{
- llinfos << "LLAres::SrvResponder::srvError " << code << ": "
- << LLAres::strerror(code) << llendl;
+ LL_INFOS() << "LLAres::SrvResponder::srvError " << code << ": "
+ << LLAres::strerror(code) << LL_ENDL;
}
static void nameinfo_callback_1_5(void *arg, int status, int timeouts,
@@ -610,6 +610,15 @@ LLAres *ll_init_ares()
return gAres;
}
+void ll_cleanup_ares()
+{
+ if (gAres != NULL)
+ {
+ delete gAres;
+ gAres = NULL;
+ }
+}
+
LLDnsRecord::LLDnsRecord(LLResType type, const std::string &name,
unsigned ttl)
: LLRefCount(),
@@ -820,11 +829,11 @@ done:
void LLAres::UriRewriteResponder::rewriteResult(
const std::vector<std::string> &uris)
{
- llinfos << "LLAres::UriRewriteResponder::rewriteResult not implemented"
- << llendl;
+ LL_INFOS() << "LLAres::UriRewriteResponder::rewriteResult not implemented"
+ << LL_ENDL;
for (size_t i = 0; i < uris.size(); i++)
{
- llinfos << "[" << i << "] " << uris[i] << llendl;
+ LL_INFOS() << "[" << i << "] " << uris[i] << LL_ENDL;
}
}
diff --git a/indra/llmessage/llares.h b/indra/llmessage/llares.h
index 800781ee88..c727363b60 100755
--- a/indra/llmessage/llares.h
+++ b/indra/llmessage/llares.h
@@ -39,7 +39,7 @@
# pragma warning(pop)
#endif
-#ifdef LL_STANDALONE
+#ifdef LL_USESYSTEMLIBS
# include <ares.h>
#else
# include <ares/ares.h>
@@ -578,5 +578,6 @@ extern LLAres *gAres;
* thread safe.
*/
extern LLAres *ll_init_ares();
+extern void ll_cleanup_ares();
#endif // LL_LLARES_H
diff --git a/indra/llmessage/llareslistener.cpp b/indra/llmessage/llareslistener.cpp
index 0a4effac19..3d65906b98 100755
--- a/indra/llmessage/llareslistener.cpp
+++ b/indra/llmessage/llareslistener.cpp
@@ -99,6 +99,6 @@ void LLAresListener::rewriteURI(const LLSD& data)
}
else
{
- llinfos << "LLAresListener::rewriteURI requested without Ares present. Ignoring: " << data << llendl;
+ LL_INFOS() << "LLAresListener::rewriteURI requested without Ares present. Ignoring: " << data << LL_ENDL;
}
}
diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp
index 9b86daebe5..8ba2535531 100755
--- a/indra/llmessage/llassetstorage.cpp
+++ b/indra/llmessage/llassetstorage.cpp
@@ -50,10 +50,14 @@
#include "lltransfertargetvfile.h" // For debugging
#include "llmetrics.h"
+#include "lltrace.h"
LLAssetStorage *gAssetStorage = NULL;
LLMetrics *LLAssetStorage::metric_recipient = NULL;
+static LLTrace::CountStatHandle<> sFailedDownloadCount("faileddownloads", "Number of times LLAssetStorage::getAssetData() has failed");
+
+
const LLUUID CATEGORIZE_LOST_AND_FOUND_ID(std::string("00000000-0000-0000-0000-000000000010"));
const U64 TOXIC_ASSET_LIFETIME = (120 * 1000000); // microseconds
@@ -149,8 +153,8 @@ void LLAssetInfo::setFromNameValue( const LLNameValue& nv )
setName( buf );
buf.assign( str, pos2, std::string::npos );
setDescription( buf );
- LL_DEBUGS("AssetStorage") << "uuid: " << mUuid << llendl;
- LL_DEBUGS("AssetStorage") << "creator: " << mCreatorID << llendl;
+ LL_DEBUGS("AssetStorage") << "uuid: " << mUuid << LL_ENDL;
+ LL_DEBUGS("AssetStorage") << "creator: " << mCreatorID << LL_ENDL;
}
///----------------------------------------------------------------------------
@@ -190,8 +194,8 @@ LLSD LLAssetRequest::getTerseDetails() const
sd["asset_id"] = getUUID();
sd["type_long"] = LLAssetType::lookupHumanReadable(getType());
sd["type"] = LLAssetType::lookup(getType());
- sd["time"] = mTime;
- time_t timestamp = (time_t) mTime;
+ sd["time"] = mTime.value();
+ time_t timestamp = (time_t) mTime.value();
std::ostringstream time_string;
time_string << ctime(&timestamp);
sd["time_string"] = time_string.str();
@@ -337,7 +341,7 @@ void LLAssetStorage::checkForTimeouts()
void LLAssetStorage::_cleanupRequests(BOOL all, S32 error)
{
- F64 mt_secs = LLMessageSystem::getMessageTimeSeconds();
+ F64Seconds mt_secs = LLMessageSystem::getMessageTimeSeconds();
request_list_t timed_out;
S32 rt;
@@ -356,10 +360,10 @@ void LLAssetStorage::_cleanupRequests(BOOL all, S32 error)
|| ((RT_DOWNLOAD == rt)
&& LL_ASSET_STORAGE_TIMEOUT < (mt_secs - tmp->mTime)))
{
- llwarns << "Asset " << getRequestName((ERequestType)rt) << " request "
+ LL_WARNS() << "Asset " << getRequestName((ERequestType)rt) << " request "
<< (all ? "aborted" : "timed out") << " for "
<< tmp->getUUID() << "."
- << LLAssetType::lookup(tmp->getType()) << llendl;
+ << LLAssetType::lookup(tmp->getType()) << LL_ENDL;
timed_out.push_front(tmp);
iter = requests->erase(curiter);
@@ -401,7 +405,7 @@ bool LLAssetStorage::findInStaticVFSAndInvokeCallback(const LLUUID& uuid, LLAsse
if (user_data)
{
// The *user_data should not be passed without a callback to clean it up.
- llassert(callback != NULL)
+ llassert(callback != NULL);
}
BOOL exists = mStaticVFS->getExists(uuid, type);
@@ -420,8 +424,8 @@ bool LLAssetStorage::findInStaticVFSAndInvokeCallback(const LLUUID& uuid, LLAsse
}
else
{
- llwarns << "Asset vfile " << uuid << ":" << type
- << " found in static cache with bad size " << file.getSize() << ", ignoring" << llendl;
+ LL_WARNS() << "Asset vfile " << uuid << ":" << type
+ << " found in static cache with bad size " << file.getSize() << ", ignoring" << LL_ENDL;
}
}
return false;
@@ -434,22 +438,23 @@ bool LLAssetStorage::findInStaticVFSAndInvokeCallback(const LLUUID& uuid, LLAsse
// IW - uuid is passed by value to avoid side effects, please don't re-add &
void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LLGetAssetCallback callback, void *user_data, BOOL is_priority)
{
- LL_DEBUGS("AssetStorage") << "LLAssetStorage::getAssetData() - " << uuid << "," << LLAssetType::lookup(type) << llendl;
+ LL_DEBUGS("AssetStorage") << "LLAssetStorage::getAssetData() - " << uuid << "," << LLAssetType::lookup(type) << LL_ENDL;
- LL_DEBUGS("AssetStorage") << "ASSET_TRACE requesting " << uuid << " type " << LLAssetType::lookup(type) << llendl;
+ LL_DEBUGS("AssetStorage") << "ASSET_TRACE requesting " << uuid << " type " << LLAssetType::lookup(type) << LL_ENDL;
if (user_data)
{
// The *user_data should not be passed without a callback to clean it up.
- llassert(callback != NULL)
+ llassert(callback != NULL);
}
if (mShutDown)
{
- LL_DEBUGS("AssetStorage") << "ASSET_TRACE cancelled " << uuid << " type " << LLAssetType::lookup(type) << " shutting down" << llendl;
+ LL_DEBUGS("AssetStorage") << "ASSET_TRACE cancelled " << uuid << " type " << LLAssetType::lookup(type) << " shutting down" << LL_ENDL;
if (callback)
{
+ add(sFailedDownloadCount, 1);
callback(mVFS, uuid, type, user_data, LL_ERR_ASSET_REQUEST_FAILED, LL_EXSTAT_NONE);
}
return;
@@ -460,6 +465,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL
// Special case early out for NULL uuid and for shutting down
if (callback)
{
+ add(sFailedDownloadCount, 1);
callback(mVFS, uuid, type, user_data, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE, LL_EXSTAT_NULL_UUID);
}
return;
@@ -468,7 +474,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL
// Try static VFS first.
if (findInStaticVFSAndInvokeCallback(uuid,type,callback,user_data))
{
- LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << uuid << " found in static VFS" << llendl;
+ LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << uuid << " found in static VFS" << LL_ENDL;
return;
}
@@ -486,13 +492,13 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL
callback(mVFS, uuid, type, user_data, LL_ERR_NOERR, LL_EXSTAT_VFS_CACHED);
}
- LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << uuid << " found in VFS" << llendl;
+ LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << uuid << " found in VFS" << LL_ENDL;
}
else
{
if (exists)
{
- llwarns << "Asset vfile " << uuid << ":" << type << " found with bad size " << file.getSize() << ", removing" << llendl;
+ LL_WARNS() << "Asset vfile " << uuid << ":" << type << " found with bad size " << file.getSize() << ", removing" << LL_ENDL;
file.remove();
}
@@ -508,8 +514,8 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL
if (callback == tmp->mDownCallback && user_data == tmp->mUserData)
{
// this is a duplicate from the same subsystem - throw it away
- llwarns << "Discarding duplicate request for asset " << uuid
- << "." << LLAssetType::lookup(type) << llendl;
+ LL_WARNS() << "Discarding duplicate request for asset " << uuid
+ << "." << LLAssetType::lookup(type) << LL_ENDL;
return;
}
@@ -521,7 +527,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL
if (duplicate)
{
LL_DEBUGS("AssetStorage") << "Adding additional non-duplicate request for asset " << uuid
- << "." << LLAssetType::lookup(type) << llendl;
+ << "." << LLAssetType::lookup(type) << LL_ENDL;
}
// This can be overridden by subclasses
@@ -561,7 +567,7 @@ void LLAssetStorage::_queueDataRequest(const LLUUID& uuid, LLAssetType::EType at
tpvf.setAsset(uuid, atype);
tpvf.setCallback(downloadCompleteCallback, req);
- //llinfos << "Starting transfer for " << uuid << llendl;
+ //LL_INFOS() << "Starting transfer for " << uuid << LL_ENDL;
LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(mUpstreamHost, LLTCT_ASSET);
ttcp->requestTransfer(spa, tpvf, 100.f + (is_priority ? 1.f : 0.f));
}
@@ -569,9 +575,10 @@ void LLAssetStorage::_queueDataRequest(const LLUUID& uuid, LLAssetType::EType at
else
{
// uh-oh, we shouldn't have gotten here
- llwarns << "Attempt to move asset data request upstream w/o valid upstream provider" << llendl;
+ LL_WARNS() << "Attempt to move asset data request upstream w/o valid upstream provider" << LL_ENDL;
if (callback)
{
+ add(sFailedDownloadCount, 1);
callback(mVFS, uuid, atype, user_data, LL_ERR_CIRCUIT_GONE, LL_EXSTAT_NO_UPSTREAM);
}
}
@@ -584,20 +591,20 @@ void LLAssetStorage::downloadCompleteCallback(
LLAssetType::EType file_type,
void* user_data, LLExtStat ext_status)
{
- LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << file_id << " downloadCompleteCallback" << llendl;
+ LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << file_id << " downloadCompleteCallback" << LL_ENDL;
LL_DEBUGS("AssetStorage") << "LLAssetStorage::downloadCompleteCallback() for " << file_id
- << "," << LLAssetType::lookup(file_type) << llendl;
+ << "," << LLAssetType::lookup(file_type) << LL_ENDL;
LLAssetRequest* req = (LLAssetRequest*)user_data;
if(!req)
{
- llwarns << "LLAssetStorage::downloadCompleteCallback called without"
- "a valid request." << llendl;
+ LL_WARNS() << "LLAssetStorage::downloadCompleteCallback called without"
+ "a valid request." << LL_ENDL;
return;
}
if (!gAssetStorage)
{
- llwarns << "LLAssetStorage::downloadCompleteCallback called without any asset system, aborting!" << llendl;
+ LL_WARNS() << "LLAssetStorage::downloadCompleteCallback called without any asset system, aborting!" << LL_ENDL;
return;
}
@@ -620,7 +627,7 @@ void LLAssetStorage::downloadCompleteCallback(
LLVFile vfile(gAssetStorage->mVFS, req->getUUID(), req->getType());
if (vfile.getSize() <= 0)
{
- llwarns << "downloadCompleteCallback has non-existent or zero-size asset " << req->getUUID() << llendl;
+ LL_WARNS() << "downloadCompleteCallback has non-existent or zero-size asset " << req->getUUID() << LL_ENDL;
result = LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE;
vfile.remove();
@@ -649,6 +656,10 @@ void LLAssetStorage::downloadCompleteCallback(
LLAssetRequest* tmp = *curiter;
if (tmp->mDownCallback)
{
+ if (result != LL_ERR_NOERR)
+ {
+ add(sFailedDownloadCount, 1);
+ }
tmp->mDownCallback(gAssetStorage->mVFS, req->getUUID(), req->getType(), tmp->mUserData, result, ext_status);
}
delete tmp;
@@ -659,7 +670,7 @@ void LLAssetStorage::getEstateAsset(const LLHost &object_sim, const LLUUID &agen
const LLUUID &asset_id, LLAssetType::EType atype, EstateAssetType etype,
LLGetAssetCallback callback, void *user_data, BOOL is_priority)
{
- lldebugs << "LLAssetStorage::getEstateAsset() - " << asset_id << "," << LLAssetType::lookup(atype) << ", estatetype " << etype << llendl;
+ LL_DEBUGS() << "LLAssetStorage::getEstateAsset() - " << asset_id << "," << LLAssetType::lookup(atype) << ", estatetype " << etype << LL_ENDL;
//
// Probably will get rid of this early out?
@@ -669,6 +680,7 @@ void LLAssetStorage::getEstateAsset(const LLHost &object_sim, const LLUUID &agen
// Special case early out for NULL uuid
if (callback)
{
+ add(sFailedDownloadCount, 1);
callback(mVFS, asset_id, atype, user_data, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE, LL_EXSTAT_NULL_UUID);
}
return;
@@ -698,7 +710,7 @@ void LLAssetStorage::getEstateAsset(const LLHost &object_sim, const LLUUID &agen
{
if (exists)
{
- llwarns << "Asset vfile " << asset_id << ":" << atype << " found with bad size " << file.getSize() << ", removing" << llendl;
+ LL_WARNS() << "Asset vfile " << asset_id << ":" << atype << " found with bad size " << file.getSize() << ", removing" << LL_ENDL;
file.remove();
}
@@ -731,16 +743,17 @@ void LLAssetStorage::getEstateAsset(const LLHost &object_sim, const LLUUID &agen
tpvf.setAsset(asset_id, atype);
tpvf.setCallback(downloadEstateAssetCompleteCallback, req);
- LL_DEBUGS("AssetStorage") << "Starting transfer for " << asset_id << llendl;
+ LL_DEBUGS("AssetStorage") << "Starting transfer for " << asset_id << LL_ENDL;
LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(source_host, LLTCT_ASSET);
ttcp->requestTransfer(spe, tpvf, 100.f + (is_priority ? 1.f : 0.f));
}
else
{
// uh-oh, we shouldn't have gotten here
- llwarns << "Attempt to move asset data request upstream w/o valid upstream provider" << llendl;
+ LL_WARNS() << "Attempt to move asset data request upstream w/o valid upstream provider" << LL_ENDL;
if (callback)
{
+ add(sFailedDownloadCount, 1);
callback(mVFS, asset_id, atype, user_data, LL_ERR_CIRCUIT_GONE, LL_EXSTAT_NO_UPSTREAM);
}
}
@@ -757,14 +770,14 @@ void LLAssetStorage::downloadEstateAssetCompleteCallback(
LLEstateAssetRequest *req = (LLEstateAssetRequest*)user_data;
if(!req)
{
- llwarns << "LLAssetStorage::downloadEstateAssetCompleteCallback called"
- " without a valid request." << llendl;
+ LL_WARNS() << "LLAssetStorage::downloadEstateAssetCompleteCallback called"
+ " without a valid request." << LL_ENDL;
return;
}
if (!gAssetStorage)
{
- llwarns << "LLAssetStorage::downloadEstateAssetCompleteCallback called"
- " without any asset system, aborting!" << llendl;
+ LL_WARNS() << "LLAssetStorage::downloadEstateAssetCompleteCallback called"
+ " without any asset system, aborting!" << LL_ENDL;
return;
}
@@ -776,13 +789,17 @@ void LLAssetStorage::downloadEstateAssetCompleteCallback(
LLVFile vfile(gAssetStorage->mVFS, req->getUUID(), req->getAType());
if (vfile.getSize() <= 0)
{
- llwarns << "downloadCompleteCallback has non-existent or zero-size asset!" << llendl;
+ LL_WARNS() << "downloadCompleteCallback has non-existent or zero-size asset!" << LL_ENDL;
result = LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE;
vfile.remove();
}
}
+ if (result != LL_ERR_NOERR)
+ {
+ add(sFailedDownloadCount, 1);
+ }
req->mDownCallback(gAssetStorage->mVFS, req->getUUID(), req->getAType(), req->mUserData, result, ext_status);
}
@@ -791,7 +808,7 @@ void LLAssetStorage::getInvItemAsset(const LLHost &object_sim, const LLUUID &age
const LLUUID &asset_id, LLAssetType::EType atype,
LLGetAssetCallback callback, void *user_data, BOOL is_priority)
{
- lldebugs << "LLAssetStorage::getInvItemAsset() - " << asset_id << "," << LLAssetType::lookup(atype) << llendl;
+ LL_DEBUGS() << "LLAssetStorage::getInvItemAsset() - " << asset_id << "," << LLAssetType::lookup(atype) << LL_ENDL;
//
// Probably will get rid of this early out?
@@ -822,7 +839,7 @@ void LLAssetStorage::getInvItemAsset(const LLHost &object_sim, const LLUUID &age
size = exists ? file.getSize() : 0;
if(exists && size < 1)
{
- llwarns << "Asset vfile " << asset_id << ":" << atype << " found with bad size " << file.getSize() << ", removing" << llendl;
+ LL_WARNS() << "Asset vfile " << asset_id << ":" << atype << " found with bad size " << file.getSize() << ", removing" << LL_ENDL;
file.remove();
}
@@ -873,16 +890,17 @@ void LLAssetStorage::getInvItemAsset(const LLHost &object_sim, const LLUUID &age
LL_DEBUGS("AssetStorage") << "Starting transfer for inventory asset "
<< item_id << " owned by " << owner_id << "," << task_id
- << llendl;
+ << LL_ENDL;
LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(source_host, LLTCT_ASSET);
ttcp->requestTransfer(spi, tpvf, 100.f + (is_priority ? 1.f : 0.f));
}
else
{
// uh-oh, we shouldn't have gotten here
- llwarns << "Attempt to move asset data request upstream w/o valid upstream provider" << llendl;
+ LL_WARNS() << "Attempt to move asset data request upstream w/o valid upstream provider" << LL_ENDL;
if (callback)
{
+ add(sFailedDownloadCount, 1);
callback(mVFS, asset_id, atype, user_data, LL_ERR_CIRCUIT_GONE, LL_EXSTAT_NO_UPSTREAM);
}
}
@@ -900,13 +918,13 @@ void LLAssetStorage::downloadInvItemCompleteCallback(
LLInvItemRequest *req = (LLInvItemRequest*)user_data;
if(!req)
{
- llwarns << "LLAssetStorage::downloadEstateAssetCompleteCallback called"
- " without a valid request." << llendl;
+ LL_WARNS() << "LLAssetStorage::downloadEstateAssetCompleteCallback called"
+ " without a valid request." << LL_ENDL;
return;
}
if (!gAssetStorage)
{
- llwarns << "LLAssetStorage::downloadCompleteCallback called without any asset system, aborting!" << llendl;
+ LL_WARNS() << "LLAssetStorage::downloadCompleteCallback called without any asset system, aborting!" << LL_ENDL;
return;
}
@@ -918,13 +936,17 @@ void LLAssetStorage::downloadInvItemCompleteCallback(
LLVFile vfile(gAssetStorage->mVFS, req->getUUID(), req->getType());
if (vfile.getSize() <= 0)
{
- llwarns << "downloadCompleteCallback has non-existent or zero-size asset!" << llendl;
+ LL_WARNS() << "downloadCompleteCallback has non-existent or zero-size asset!" << LL_ENDL;
result = LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE;
vfile.remove();
}
}
+ if (result != LL_ERR_NOERR)
+ {
+ add(sFailedDownloadCount, 1);
+ }
req->mDownCallback(gAssetStorage->mVFS, req->getUUID(), req->getType(), req->mUserData, result, ext_status);
}
@@ -937,7 +959,7 @@ void LLAssetStorage::uploadCompleteCallback(const LLUUID& uuid, void *user_data,
{
if (!gAssetStorage)
{
- llwarns << "LLAssetStorage::uploadCompleteCallback has no gAssetStorage!" << llendl;
+ LL_WARNS() << "LLAssetStorage::uploadCompleteCallback has no gAssetStorage!" << LL_ENDL;
return;
}
LLAssetRequest *req = (LLAssetRequest *)user_data;
@@ -945,7 +967,7 @@ void LLAssetStorage::uploadCompleteCallback(const LLUUID& uuid, void *user_data,
if (result)
{
- llwarns << "LLAssetStorage::uploadCompleteCallback " << result << ":" << getErrorString(result) << " trying to upload file to upstream provider" << llendl;
+ LL_WARNS() << "LLAssetStorage::uploadCompleteCallback " << result << ":" << getErrorString(result) << " trying to upload file to upstream provider" << LL_ENDL;
success = FALSE;
}
@@ -1027,7 +1049,7 @@ LLAssetStorage::request_list_t* LLAssetStorage::getRequestList(LLAssetStorage::E
case RT_LOCALUPLOAD:
return &mPendingLocalUploads;
default:
- llwarns << "Unable to find request list for request type '" << rt << "'" << llendl;
+ LL_WARNS() << "Unable to find request list for request type '" << rt << "'" << LL_ENDL;
return NULL;
}
}
@@ -1043,7 +1065,7 @@ const LLAssetStorage::request_list_t* LLAssetStorage::getRequestList(LLAssetStor
case RT_LOCALUPLOAD:
return &mPendingLocalUploads;
default:
- llwarns << "Unable to find request list for request type '" << rt << "'" << llendl;
+ LL_WARNS() << "Unable to find request list for request type '" << rt << "'" << LL_ENDL;
return NULL;
}
}
@@ -1060,7 +1082,7 @@ std::string LLAssetStorage::getRequestName(LLAssetStorage::ERequestType rt)
case RT_LOCALUPLOAD:
return "localupload";
default:
- llwarns << "Unable to find request name for request type '" << rt << "'" << llendl;
+ LL_WARNS() << "Unable to find request name for request type '" << rt << "'" << LL_ENDL;
return "";
}
}
@@ -1213,7 +1235,7 @@ bool LLAssetStorage::deletePendingRequest(LLAssetStorage::ERequestType rt,
{
LL_DEBUGS("AssetStorage") << "Asset " << getRequestName(rt) << " request for "
<< asset_id << "." << LLAssetType::lookup(asset_type)
- << " removed from pending queue." << llendl;
+ << " removed from pending queue." << LL_ENDL;
return true;
}
return false;
@@ -1237,6 +1259,7 @@ bool LLAssetStorage::deletePendingRequestImpl(LLAssetStorage::request_list_t* re
}
if (req->mDownCallback)
{
+ add(sFailedDownloadCount, 1);
req->mDownCallback(mVFS, req->getUUID(), req->getType(), req->mUserData, error, LL_EXSTAT_REQUEST_DROPPED);
}
if (req->mInfoCallback)
@@ -1307,7 +1330,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, vo
user_data == ((LLLegacyAssetRequest *)tmp->mUserData)->mUserData)
{
// this is a duplicate from the same subsystem - throw it away
- LL_DEBUGS("AssetStorage") << "Discarding duplicate request for UUID " << uuid << llendl;
+ LL_DEBUGS("AssetStorage") << "Discarding duplicate request for UUID " << uuid << LL_ENDL;
return;
}
}
@@ -1363,6 +1386,10 @@ void LLAssetStorage::legacyGetDataCallback(LLVFS *vfs, const LLUUID &uuid, LLAss
}
}
+ if (status != LL_ERR_NOERR)
+ {
+ add(sFailedDownloadCount, 1);
+ }
legacy->mDownCallback(filename.c_str(), uuid, legacy->mUserData, status, ext_status);
delete legacy;
}
@@ -1378,9 +1405,9 @@ void LLAssetStorage::storeAssetData(
bool is_priority,
bool store_local,
bool user_waiting,
- F64 timeout)
+ F64Seconds timeout)
{
- llwarns << "storeAssetData: wrong version called" << llendl;
+ LL_WARNS() << "storeAssetData: wrong version called" << LL_ENDL;
// LLAssetStorage metric: Virtual base call
reportMetric( LLUUID::null, asset_type, LLStringUtil::null, LLUUID::null, 0, MR_BAD_FUNCTION, __FILE__, __LINE__, "Illegal call to base: LLAssetStorage::storeAssetData 1" );
}
@@ -1397,9 +1424,9 @@ void LLAssetStorage::storeAssetData(
bool store_local,
const LLUUID& requesting_agent_id,
bool user_waiting,
- F64 timeout)
+ F64Seconds timeout)
{
- llwarns << "storeAssetData: wrong version called" << llendl;
+ LL_WARNS() << "storeAssetData: wrong version called" << LL_ENDL;
// LLAssetStorage metric: Virtual base call
reportMetric( asset_id, asset_type, LLStringUtil::null, requesting_agent_id, 0, MR_BAD_FUNCTION, __FILE__, __LINE__, "Illegal call to base: LLAssetStorage::storeAssetData 2" );
}
@@ -1415,9 +1442,9 @@ void LLAssetStorage::storeAssetData(
bool temp_file,
bool is_priority,
bool user_waiting,
- F64 timeout)
+ F64Seconds timeout)
{
- llwarns << "storeAssetData: wrong version called" << llendl;
+ LL_WARNS() << "storeAssetData: wrong version called" << LL_ENDL;
// LLAssetStorage metric: Virtual base call
reportMetric( asset_id, asset_type, LLStringUtil::null, LLUUID::null, 0, MR_BAD_FUNCTION, __FILE__, __LINE__, "Illegal call to base: LLAssetStorage::storeAssetData 3" );
}
@@ -1433,9 +1460,9 @@ void LLAssetStorage::storeAssetData(
bool temp_file,
bool is_priority,
bool user_waiting,
- F64 timeout)
+ F64Seconds timeout)
{
- llwarns << "storeAssetData: wrong version called" << llendl;
+ LL_WARNS() << "storeAssetData: wrong version called" << LL_ENDL;
// LLAssetStorage metric: Virtual base call
reportMetric( LLUUID::null, asset_type, LLStringUtil::null, LLUUID::null, 0, MR_BAD_FUNCTION, __FILE__, __LINE__, "Illegal call to base: LLAssetStorage::storeAssetData 4" );
}
@@ -1490,7 +1517,7 @@ void LLAssetStorage::reportMetric( const LLUUID& asset_id, const LLAssetType::ET
{
if( !metric_recipient )
{
- LL_DEBUGS("AssetStorage") << "Couldn't store LLAssetStoreage::reportMetric - no metrics_recipient" << llendl;
+ LL_DEBUGS("AssetStorage") << "Couldn't store LLAssetStoreage::reportMetric - no metrics_recipient" << LL_ENDL;
return;
}
diff --git a/indra/llmessage/llassetstorage.h b/indra/llmessage/llassetstorage.h
index 563ff9e077..1bb4acea9e 100755
--- a/indra/llmessage/llassetstorage.h
+++ b/indra/llmessage/llassetstorage.h
@@ -34,11 +34,11 @@
#include "lltimer.h"
#include "llnamevalue.h"
#include "llhost.h"
-#include "stdenums.h" // for EDragAndDropType
#include "lltransfermanager.h" // For LLTSCode enum
#include "llassettype.h"
#include "llstring.h"
#include "llextendedstatus.h"
+#include "llxfer.h"
// Forward declarations
class LLMessageSystem;
@@ -49,7 +49,16 @@ class LLSD;
// anything that takes longer than this to download will abort.
// HTTP Uploads also timeout if they take longer than this.
-const F32 LL_ASSET_STORAGE_TIMEOUT = 5 * 60.0f;
+const F32Minutes LL_ASSET_STORAGE_TIMEOUT(5);
+
+
+// Specific error codes
+const int LL_ERR_ASSET_REQUEST_FAILED = -1;
+//const int LL_ERR_ASSET_REQUEST_INVALID = -2;
+const int LL_ERR_ASSET_REQUEST_NONEXISTENT_FILE = -3;
+const int LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE = -4;
+const int LL_ERR_INSUFFICIENT_PERMISSIONS = -5;
+const int LL_ERR_PRICE_MISMATCH = -23018;
class LLAssetInfo
{
@@ -94,7 +103,7 @@ public:
void setUUID(const LLUUID& id) { mUUID = id; }
void setType(LLAssetType::EType type) { mType = type; }
- void setTimeout (F64 timeout) { mTimeout = timeout; }
+ void setTimeout (F64Seconds timeout) { mTimeout = timeout; }
protected:
LLUUID mUUID;
@@ -110,8 +119,8 @@ public:
BOOL mIsTemp;
BOOL mIsLocal;
BOOL mIsUserWaiting; // We don't want to try forever if a user is waiting for a result.
- F64 mTime; // Message system time
- F64 mTimeout; // Amount of time before timing out.
+ F64Seconds mTime; // Message system time
+ F64Seconds mTimeout; // Amount of time before timing out.
BOOL mIsPriority;
BOOL mDataSentInFirstPacket;
BOOL mDataIsInVFS;
@@ -154,7 +163,7 @@ public:
void *mUserData;
LLHost mHost;
BOOL mIsTemp;
- F64 mTime; // Message system time
+ F64Seconds mTime; // Message system time
BOOL mIsPriority;
BOOL mDataSentInFirstPacket;
BOOL mDataIsInVFS;
@@ -184,7 +193,7 @@ public:
void *mUserData;
LLHost mHost;
BOOL mIsTemp;
- F64 mTime; // Message system time
+ F64Seconds mTime; // Message system time
BOOL mIsPriority;
BOOL mDataSentInFirstPacket;
BOOL mDataIsInVFS;
@@ -270,7 +279,7 @@ public:
bool is_priority = false,
bool store_local = false,
bool user_waiting= false,
- F64 timeout=LL_ASSET_STORAGE_TIMEOUT);
+ F64Seconds timeout=LL_ASSET_STORAGE_TIMEOUT);
/*
* AssetID version
@@ -286,7 +295,7 @@ public:
bool store_local = false,
const LLUUID& requesting_agent_id = LLUUID::null,
bool user_waiting= false,
- F64 timeout=LL_ASSET_STORAGE_TIMEOUT);
+ F64Seconds timeout=LL_ASSET_STORAGE_TIMEOUT);
virtual void checkForTimeouts();
@@ -394,7 +403,7 @@ public:
bool temp_file = false,
bool is_priority = false,
bool user_waiting = false,
- F64 timeout = LL_ASSET_STORAGE_TIMEOUT);
+ F64Seconds timeout = LL_ASSET_STORAGE_TIMEOUT);
/*
* TransactionID version
@@ -408,7 +417,7 @@ public:
bool temp_file = false,
bool is_priority = false,
bool user_waiting = false,
- F64 timeout = LL_ASSET_STORAGE_TIMEOUT);
+ F64Seconds timeout = LL_ASSET_STORAGE_TIMEOUT);
static void legacyGetDataCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType, void *user_data, S32 status, LLExtStat ext_status);
static void legacyStoreDataCallback(const LLUUID &uuid, void *user_data, S32 status, LLExtStat ext_status);
diff --git a/indra/llcommon/llavatarname.cpp b/indra/llmessage/llavatarname.cpp
index d12f157910..d12f157910 100755..100644
--- a/indra/llcommon/llavatarname.cpp
+++ b/indra/llmessage/llavatarname.cpp
diff --git a/indra/llcommon/llavatarname.h b/indra/llmessage/llavatarname.h
index 1cb3ae421f..1cb3ae421f 100755..100644
--- a/indra/llcommon/llavatarname.h
+++ b/indra/llmessage/llavatarname.h
diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp
index 31dd264021..d02a60b7b2 100755
--- a/indra/llmessage/llavatarnamecache.cpp
+++ b/indra/llmessage/llavatarnamecache.cpp
@@ -121,7 +121,7 @@ namespace LLAvatarNameCache
// Erase expired names from cache
void eraseUnrefreshed();
- bool expirationFromCacheControl(LLSD headers, F64 *expires);
+ bool expirationFromCacheControl(const LLSD& headers, F64 *expires);
}
/* Sample response:
@@ -165,33 +165,31 @@ namespace LLAvatarNameCache
class LLAvatarNameResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(LLAvatarNameResponder);
private:
// need to store agent ids that are part of this request in case of
// an error, so we can flag them as unavailable
std::vector<LLUUID> mAgentIDs;
- // Need the headers to look up Expires: and Retry-After:
- LLSD mHeaders;
-
public:
LLAvatarNameResponder(const std::vector<LLUUID>& agent_ids)
- : mAgentIDs(agent_ids),
- mHeaders()
+ : mAgentIDs(agent_ids)
{ }
- /*virtual*/ void completedHeader(U32 status, const std::string& reason,
- const LLSD& headers)
- {
- mHeaders = headers;
- }
-
- /*virtual*/ void result(const LLSD& content)
+protected:
+ /*virtual*/ void httpSuccess()
{
+ const LLSD& content = getContent();
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
// Pull expiration out of headers if available
- F64 expires = LLAvatarNameCache::nameExpirationFromHeaders(mHeaders);
+ F64 expires = LLAvatarNameCache::nameExpirationFromHeaders(getResponseHeaders());
F64 now = LLFrameTimer::getTotalSeconds();
- LLSD agents = content["agents"];
+ const LLSD& agents = content["agents"];
LLSD::array_const_iterator it = agents.beginArray();
for ( ; it != agents.endArray(); ++it)
{
@@ -212,7 +210,7 @@ public:
}
// Same logic as error response case
- LLSD unresolved_agents = content["bad_ids"];
+ const LLSD& unresolved_agents = content["bad_ids"];
S32 num_unresolved = unresolved_agents.size();
if (num_unresolved > 0)
{
@@ -236,14 +234,13 @@ public:
<< LL_ENDL;
}
- /*virtual*/ void error(U32 status, const std::string& reason)
+ /*virtual*/ void httpFailure()
{
// If there's an error, it might be caused by PeopleApi,
// or when loading textures on startup and using a very slow
// network, this query may time out.
// What we should do depends on whether or not we have a cached name
- LL_WARNS("AvNameCache") << "LLAvatarNameResponder::error " << status << " " << reason
- << LL_ENDL;
+ LL_WARNS("AvNameCache") << dumpResponse() << LL_ENDL;
// Add dummy records for any agent IDs in this request that we do not have cached already
std::vector<LLUUID>::const_iterator it = mAgentIDs.begin();
@@ -700,7 +697,7 @@ void LLAvatarNameCache::insert(const LLUUID& agent_id, const LLAvatarName& av_na
sCache[agent_id] = av_name;
}
-F64 LLAvatarNameCache::nameExpirationFromHeaders(LLSD headers)
+F64 LLAvatarNameCache::nameExpirationFromHeaders(const LLSD& headers)
{
F64 expires = 0.0;
if (expirationFromCacheControl(headers, &expires))
@@ -716,17 +713,21 @@ F64 LLAvatarNameCache::nameExpirationFromHeaders(LLSD headers)
}
}
-bool LLAvatarNameCache::expirationFromCacheControl(LLSD headers, F64 *expires)
+bool LLAvatarNameCache::expirationFromCacheControl(const LLSD& headers, F64 *expires)
{
bool fromCacheControl = false;
F64 now = LLFrameTimer::getTotalSeconds();
// Allow the header to override the default
- LLSD cache_control_header = headers["cache-control"];
- if (cache_control_header.isDefined())
+ std::string cache_control;
+ if (headers.has(HTTP_IN_HEADER_CACHE_CONTROL))
+ {
+ cache_control = headers[HTTP_IN_HEADER_CACHE_CONTROL].asString();
+ }
+
+ if (!cache_control.empty())
{
S32 max_age = 0;
- std::string cache_control = cache_control_header.asString();
if (max_age_from_cache_control(cache_control, &max_age))
{
*expires = now + (F64)max_age;
diff --git a/indra/llmessage/llavatarnamecache.h b/indra/llmessage/llavatarnamecache.h
index 3a19cee3ed..ea016b3125 100755
--- a/indra/llmessage/llavatarnamecache.h
+++ b/indra/llmessage/llavatarnamecache.h
@@ -90,7 +90,7 @@ namespace LLAvatarNameCache
// Compute name expiration time from HTTP Cache-Control header,
// or return default value, in seconds from epoch.
- F64 nameExpirationFromHeaders(LLSD headers);
+ F64 nameExpirationFromHeaders(const LLSD& headers);
void addUseDisplayNamesCallback(const use_display_name_signal_t::slot_type& cb);
}
diff --git a/indra/llmessage/llblowfishcipher.cpp b/indra/llmessage/llblowfishcipher.cpp
index 88aaf7c52a..0b5025a422 100755
--- a/indra/llmessage/llblowfishcipher.cpp
+++ b/indra/llmessage/llblowfishcipher.cpp
@@ -70,10 +70,10 @@ U32 LLBlowfishCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len)
int blocksize = EVP_CIPHER_CTX_block_size(&context);
int keylen = EVP_CIPHER_CTX_key_length(&context);
int iv_length = EVP_CIPHER_CTX_iv_length(&context);
- lldebugs << "LLBlowfishCipher blocksize " << blocksize
+ LL_DEBUGS() << "LLBlowfishCipher blocksize " << blocksize
<< " keylen " << keylen
<< " iv_len " << iv_length
- << llendl;
+ << LL_ENDL;
int output_len = 0;
int temp_len = 0;
@@ -83,7 +83,7 @@ U32 LLBlowfishCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len)
src,
src_len))
{
- llwarns << "LLBlowfishCipher::encrypt EVP_EncryptUpdate failure" << llendl;
+ LL_WARNS() << "LLBlowfishCipher::encrypt EVP_EncryptUpdate failure" << LL_ENDL;
goto ERROR;
}
@@ -91,7 +91,7 @@ U32 LLBlowfishCipher::encrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len)
// not an exact multiple of the block size.
if (!EVP_EncryptFinal_ex(&context, (unsigned char*)(dst + output_len), &temp_len))
{
- llwarns << "LLBlowfishCipher::encrypt EVP_EncryptFinal failure" << llendl;
+ LL_WARNS() << "LLBlowfishCipher::encrypt EVP_EncryptFinal failure" << LL_ENDL;
goto ERROR;
}
output_len += temp_len;
@@ -107,7 +107,7 @@ ERROR:
// virtual
U32 LLBlowfishCipher::decrypt(const U8* src, U32 src_len, U8* dst, U32 dst_len)
{
- llerrs << "LLBlowfishCipher decrypt unsupported" << llendl;
+ LL_ERRS() << "LLBlowfishCipher decrypt unsupported" << LL_ENDL;
return 0;
}
diff --git a/indra/llmessage/llbuffer.cpp b/indra/llmessage/llbuffer.cpp
index aaa49d2ed6..d07d9980c3 100755
--- a/indra/llmessage/llbuffer.cpp
+++ b/indra/llmessage/llbuffer.cpp
@@ -32,8 +32,9 @@
#include "llmath.h"
#include "llstl.h"
#include "llthread.h"
+#include <iterator>
-#define ASSERT_LLBUFFERARRAY_MUTEX_LOCKED llassert(!mMutexp || mMutexp->isSelfLocked());
+#define ASSERT_LLBUFFERARRAY_MUTEX_LOCKED() llassert(!mMutexp || mMutexp->isSelfLocked())
/**
* LLSegment
@@ -180,8 +181,8 @@ bool LLHeapBuffer::reclaimSegment(const LLSegment& segment)
}
else if(mReclaimedBytes > mSize)
{
- llwarns << "LLHeapBuffer reclaimed more memory than allocated."
- << " This is probably programmer error." << llendl;
+ LL_WARNS() << "LLHeapBuffer reclaimed more memory than allocated."
+ << " This is probably programmer error." << LL_ENDL;
}
return true;
}
@@ -286,7 +287,7 @@ LLChannelDescriptors LLBufferArray::nextChannel()
//mMutexp should be locked before calling this.
S32 LLBufferArray::capacity() const
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
S32 total = 0;
const_buffer_iterator_t iter = mBuffers.begin();
@@ -314,7 +315,7 @@ bool LLBufferArray::append(S32 channel, const U8* src, S32 len)
//mMutexp should be locked before calling this.
bool LLBufferArray::prepend(S32 channel, const U8* src, S32 len)
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
std::vector<LLSegment> segments;
if(copyIntoBuffers(channel, src, len, segments))
@@ -349,7 +350,7 @@ bool LLBufferArray::insertAfter(
//mMutexp should be locked before calling this.
LLBufferArray::segment_iterator_t LLBufferArray::splitAfter(U8* address)
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
segment_iterator_t end = mSegments.end();
segment_iterator_t it = getSegment(address);
@@ -381,14 +382,14 @@ LLBufferArray::segment_iterator_t LLBufferArray::splitAfter(U8* address)
//mMutexp should be locked before calling this.
LLBufferArray::segment_iterator_t LLBufferArray::beginSegment()
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
return mSegments.begin();
}
//mMutexp should be locked before calling this.
LLBufferArray::segment_iterator_t LLBufferArray::endSegment()
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
return mSegments.end();
}
@@ -397,7 +398,7 @@ LLBufferArray::segment_iterator_t LLBufferArray::constructSegmentAfter(
U8* address,
LLSegment& segment)
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
segment_iterator_t rv = mSegments.begin();
segment_iterator_t end = mSegments.end();
if(!address)
@@ -446,7 +447,7 @@ LLBufferArray::segment_iterator_t LLBufferArray::constructSegmentAfter(
//mMutexp should be locked before calling this.
LLBufferArray::segment_iterator_t LLBufferArray::getSegment(U8* address)
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
segment_iterator_t end = mSegments.end();
if(!address)
{
@@ -468,7 +469,7 @@ LLBufferArray::segment_iterator_t LLBufferArray::getSegment(U8* address)
LLBufferArray::const_segment_iterator_t LLBufferArray::getSegment(
U8* address) const
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
const_segment_iterator_t end = mSegments.end();
if(!address)
{
@@ -623,7 +624,7 @@ U8* LLBufferArray::seek(
U8* start,
S32 delta) const
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
const_segment_iterator_t it;
const_segment_iterator_t end = mSegments.end();
U8* rv = start;
@@ -791,7 +792,7 @@ LLBufferArray::segment_iterator_t LLBufferArray::makeSegment(
S32 channel,
S32 len)
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
// start at the end of the buffers, because it is the most likely
// to have free space.
LLSegment segment;
@@ -829,7 +830,7 @@ LLBufferArray::segment_iterator_t LLBufferArray::makeSegment(
//mMutexp should be locked before calling this.
bool LLBufferArray::eraseSegment(const segment_iterator_t& erase_iter)
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
// Find out which buffer contains the segment, and if it is found,
// ask it to reclaim the memory.
@@ -861,7 +862,7 @@ bool LLBufferArray::copyIntoBuffers(
S32 len,
std::vector<LLSegment>& segments)
{
- ASSERT_LLBUFFERARRAY_MUTEX_LOCKED
+ ASSERT_LLBUFFERARRAY_MUTEX_LOCKED();
if(!src || !len) return false;
S32 copied = 0;
LLSegment segment;
diff --git a/indra/llmessage/llbufferstream.cpp b/indra/llmessage/llbufferstream.cpp
index a51a48edc3..ff1c9993cc 100755
--- a/indra/llmessage/llbufferstream.cpp
+++ b/indra/llmessage/llbufferstream.cpp
@@ -53,7 +53,7 @@ LLBufferStreamBuf::~LLBufferStreamBuf()
// virtual
int LLBufferStreamBuf::underflow()
{
- //lldebugs << "LLBufferStreamBuf::underflow()" << llendl;
+ //LL_DEBUGS() << "LLBufferStreamBuf::underflow()" << LL_ENDL;
if(!mBuffer)
{
return EOF;
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp
index 13d779ff83..4dd8d04656 100755
--- a/indra/llmessage/llcachename.cpp
+++ b/indra/llmessage/llcachename.cpp
@@ -343,7 +343,7 @@ bool LLCacheName::importFile(std::istream& istr)
++count;
}
- llinfos << "LLCacheName loaded " << count << " agent names" << llendl;
+ LL_INFOS() << "LLCacheName loaded " << count << " agent names" << LL_ENDL;
count = 0;
LLSD groups = data[GROUPS];
@@ -364,7 +364,7 @@ bool LLCacheName::importFile(std::istream& istr)
impl.mReverseCache[entry->mGroupName] = id;
++count;
}
- llinfos << "LLCacheName loaded " << count << " group names" << llendl;
+ LL_INFOS() << "LLCacheName loaded " << count << " group names" << LL_ENDL;
return true;
}
@@ -440,7 +440,7 @@ void LLCacheName::localizeCacheName(std::string key, std::string value)
if (key!="" && value!= "" )
sCacheName[key]=value;
else
- llwarns<< " Error localizing cache key " << key << " To "<< value<<llendl;
+ LL_WARNS()<< " Error localizing cache key " << key << " To "<< value<<LL_ENDL;
}
BOOL LLCacheName::getFullName(const LLUUID& id, std::string& fullname)
@@ -467,7 +467,7 @@ BOOL LLCacheName::getGroupName(const LLUUID& id, std::string& group)
// COUNTER-HACK to combat James' HACK in exportFile()...
// this group name was loaded from a name cache that did not
// bother to save the group name ==> we must ask for it
- lldebugs << "LLCacheName queuing HACK group request: " << id << llendl;
+ LL_DEBUGS() << "LLCacheName queuing HACK group request: " << id << LL_ENDL;
entry = NULL;
}
@@ -676,8 +676,8 @@ void LLCacheName::processPending()
if(!impl.mUpstreamHost.isOk())
{
- lldebugs << "LLCacheName::processPending() - bad upstream host."
- << llendl;
+ LL_DEBUGS() << "LLCacheName::processPending() - bad upstream host."
+ << LL_ENDL;
return;
}
@@ -724,33 +724,33 @@ void LLCacheName::dump()
LLCacheNameEntry* entry = iter->second;
if (entry->mIsGroup)
{
- llinfos
+ LL_INFOS()
<< iter->first << " = (group) "
<< entry->mGroupName
<< " @ " << entry->mCreateTime
- << llendl;
+ << LL_ENDL;
}
else
{
- llinfos
+ LL_INFOS()
<< iter->first << " = "
<< buildFullName(entry->mFirstName, entry->mLastName)
<< " @ " << entry->mCreateTime
- << llendl;
+ << LL_ENDL;
}
}
}
void LLCacheName::dumpStats()
{
- llinfos << "Queue sizes: "
+ LL_INFOS() << "Queue sizes: "
<< " Cache=" << impl.mCache.size()
<< " AskName=" << impl.mAskNameQueue.size()
<< " AskGroup=" << impl.mAskGroupQueue.size()
<< " Pending=" << impl.mPendingQueue.size()
<< " Reply=" << impl.mReplyQueue.size()
// << " Observers=" << impl.mSignal.size()
- << llendl;
+ << LL_ENDL;
}
void LLCacheName::clear()
@@ -886,7 +886,7 @@ void LLCacheName::Impl::processUUIDRequest(LLMessageSystem* msg, bool isGroup)
// level, hence having an upstream provider.
if (!mUpstreamHost.isOk())
{
- llwarns << "LLCacheName - got UUID name/group request, but no upstream provider!" << llendl;
+ LL_WARNS() << "LLCacheName - got UUID name/group request, but no upstream provider!" << LL_ENDL;
return;
}
@@ -903,11 +903,11 @@ void LLCacheName::Impl::processUUIDRequest(LLMessageSystem* msg, bool isGroup)
{
if (isGroup != entry->mIsGroup)
{
- llwarns << "LLCacheName - Asked for "
+ LL_WARNS() << "LLCacheName - Asked for "
<< (isGroup ? "group" : "user") << " name, "
<< "but found "
<< (entry->mIsGroup ? "group" : "user")
- << ": " << id << llendl;
+ << ": " << id << LL_ENDL;
}
else
{
diff --git a/indra/llmessage/llcircuit.cpp b/indra/llmessage/llcircuit.cpp
index 0c2d4b823d..5aaada63b1 100755
--- a/indra/llmessage/llcircuit.cpp
+++ b/indra/llmessage/llcircuit.cpp
@@ -60,12 +60,12 @@
const S32 PING_START_BLOCK = 3; // How many pings behind we have to be to consider ourself blocked.
const S32 PING_RELEASE_BLOCK = 2; // How many pings behind we have to be to consider ourself unblocked.
-const F32 TARGET_PERIOD_LENGTH = 5.f; // seconds
-const F32 LL_DUPLICATE_SUPPRESSION_TIMEOUT = 60.f; //seconds - this can be long, as time-based cleanup is
+const F32Seconds TARGET_PERIOD_LENGTH(5.f);
+const F32Seconds LL_DUPLICATE_SUPPRESSION_TIMEOUT(60.f); //this can be long, as time-based cleanup is
// only done when wrapping packetids, now...
LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id,
- const F32 circuit_heartbeat_interval, const F32 circuit_timeout)
+ const F32Seconds circuit_heartbeat_interval, const F32Seconds circuit_timeout)
: mHost (host),
mWrapID(0),
mPacketsOutID(0),
@@ -84,7 +84,7 @@ LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id,
mPingsInTransit(0),
mLastPingID(0),
mPingDelay(INITIAL_PING_VALUE_MSEC),
- mPingDelayAveraged((F32)INITIAL_PING_VALUE_MSEC),
+ mPingDelayAveraged(INITIAL_PING_VALUE_MSEC),
mUnackedPacketCount(0),
mUnackedPacketBytes(0),
mLastPacketInTime(0.0),
@@ -110,13 +110,13 @@ LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id,
{
// Need to guarantee that this time is up to date, we may be creating a circuit even though we haven't been
// running a message system loop.
- F64 mt_sec = LLMessageSystem::getMessageTimeSeconds(TRUE);
+ F64Seconds mt_sec = LLMessageSystem::getMessageTimeSeconds(TRUE);
F32 distribution_offset = ll_frand();
mPingTime = mt_sec;
mLastPingSendTime = mt_sec + mHeartbeatInterval * distribution_offset;
mLastPingReceivedTime = mt_sec;
- mNextPingSendTime = mLastPingSendTime + 0.95*mHeartbeatInterval + ll_frand(0.1f*mHeartbeatInterval);
+ mNextPingSendTime = mLastPingSendTime + 0.95*mHeartbeatInterval + F32Seconds(ll_frand(0.1f*mHeartbeatInterval.value()));
mPeriodTime = mt_sec;
mLocalEndPointID.generate();
@@ -183,7 +183,7 @@ LLCircuitData::~LLCircuitData()
std::ostream_iterator<TPACKETID> append(str, " ");
str << "MSG: -> " << mHost << "\tABORTING RELIABLE:\t";
std::copy(doomed.begin(), doomed.end(), append);
- llinfos << str.str() << llendl;
+ LL_INFOS() << str.str() << LL_ENDL;
}
}
@@ -203,11 +203,11 @@ void LLCircuitData::ackReliablePacket(TPACKETID packet_num)
std::ostringstream str;
str << "MSG: <- " << packetp->mHost << "\tRELIABLE ACKED:\t"
<< packetp->mPacketID;
- llinfos << str.str() << llendl;
+ LL_INFOS() << str.str() << LL_ENDL;
}
if (packetp->mCallback)
{
- if (packetp->mTimeout < 0.f) // negative timeout will always return timeout even for successful ack, for debugging
+ if (packetp->mTimeout < F32Seconds(0.f)) // negative timeout will always return timeout even for successful ack, for debugging
{
packetp->mCallback(packetp->mCallbackData,LL_ERR_TCP_TIMEOUT);
}
@@ -231,17 +231,17 @@ void LLCircuitData::ackReliablePacket(TPACKETID packet_num)
if (iter != mFinalRetryPackets.end())
{
packetp = iter->second;
- // llinfos << "Packet " << packet_num << " removed from the pending list" << llendl;
+ // LL_INFOS() << "Packet " << packet_num << " removed from the pending list" << LL_ENDL;
if(gMessageSystem->mVerboseLog)
{
std::ostringstream str;
str << "MSG: <- " << packetp->mHost << "\tRELIABLE ACKED:\t"
<< packetp->mPacketID;
- llinfos << str.str() << llendl;
+ LL_INFOS() << str.str() << LL_ENDL;
}
if (packetp->mCallback)
{
- if (packetp->mTimeout < 0.f) // negative timeout will always return timeout even for successful ack, for debugging
+ if (packetp->mTimeout < F32Seconds(0.f)) // negative timeout will always return timeout even for successful ack, for debugging
{
packetp->mCallback(packetp->mCallbackData,LL_ERR_TCP_TIMEOUT);
}
@@ -268,7 +268,7 @@ void LLCircuitData::ackReliablePacket(TPACKETID packet_num)
-S32 LLCircuitData::resendUnackedPackets(const F64 now)
+S32 LLCircuitData::resendUnackedPackets(const F64Seconds now)
{
S32 resent_packets = 0;
LLReliablePacket *packetp;
@@ -320,8 +320,8 @@ S32 LLCircuitData::resendUnackedPackets(const F64 now)
if (mUnackedPacketBytes > 256000 && !(getPacketsOut() % 1024))
{
// Warn if we've got a lot of resends waiting.
- llwarns << mHost << " has " << mUnackedPacketBytes
- << " bytes of reliable messages waiting" << llendl;
+ LL_WARNS() << mHost << " has " << mUnackedPacketBytes
+ << " bytes of reliable messages waiting" << LL_ENDL;
}
// Stop resending. There are less than 512000 unacked packets.
break;
@@ -341,7 +341,7 @@ S32 LLCircuitData::resendUnackedPackets(const F64 now)
std::ostringstream str;
str << "MSG: -> " << packetp->mHost
<< "\tRESENDING RELIABLE:\t" << packetp->mPacketID;
- llinfos << str.str() << llendl;
+ LL_INFOS() << str.str() << LL_ENDL;
}
packetp->mBuffer[0] |= LL_RESENT_FLAG; // tag packet id as being a resend
@@ -355,7 +355,7 @@ S32 LLCircuitData::resendUnackedPackets(const F64 now)
// The new method, retry time based on ping
if (packetp->mPingBasedRetry)
{
- packetp->mExpirationTime = now + llmax(LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS, (LL_RELIABLE_TIMEOUT_FACTOR * getPingDelayAveraged()));
+ packetp->mExpirationTime = now + llmax(LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS, F32Seconds(LL_RELIABLE_TIMEOUT_FACTOR * getPingDelayAveraged()));
}
else
{
@@ -390,10 +390,10 @@ S32 LLCircuitData::resendUnackedPackets(const F64 now)
if (now > packetp->mExpirationTime)
{
// fail (too many retries)
- //llinfos << "Packet " << packetp->mPacketID << " removed from the pending list: exceeded retry limit" << llendl;
+ //LL_INFOS() << "Packet " << packetp->mPacketID << " removed from the pending list: exceeded retry limit" << LL_ENDL;
//if (packetp->mMessageName)
//{
- // llinfos << "Packet name " << packetp->mMessageName << llendl;
+ // LL_INFOS() << "Packet name " << packetp->mMessageName << LL_ENDL;
//}
gMessageSystem->mFailedResendPackets++;
@@ -402,7 +402,7 @@ S32 LLCircuitData::resendUnackedPackets(const F64 now)
std::ostringstream str;
str << "MSG: -> " << packetp->mHost << "\tABORTING RELIABLE:\t"
<< packetp->mPacketID;
- llinfos << str.str() << llendl;
+ LL_INFOS() << str.str() << LL_ENDL;
}
if (packetp->mCallback)
@@ -427,10 +427,11 @@ S32 LLCircuitData::resendUnackedPackets(const F64 now)
}
-LLCircuit::LLCircuit(const F32 circuit_heartbeat_interval, const F32 circuit_timeout) : mLastCircuit(NULL),
- mHeartbeatInterval(circuit_heartbeat_interval), mHeartbeatTimeout(circuit_timeout)
-{
-}
+LLCircuit::LLCircuit(const F32Seconds circuit_heartbeat_interval, const F32Seconds circuit_timeout)
+: mLastCircuit(NULL),
+ mHeartbeatInterval(circuit_heartbeat_interval),
+ mHeartbeatTimeout(circuit_timeout)
+{}
LLCircuit::~LLCircuit()
{
@@ -445,7 +446,7 @@ LLCircuit::~LLCircuit()
LLCircuitData *LLCircuit::addCircuitData(const LLHost &host, TPACKETID in_id)
{
// This should really validate if one already exists
- llinfos << "LLCircuit::addCircuitData for " << host << llendl;
+ LL_INFOS() << "LLCircuit::addCircuitData for " << host << LL_ENDL;
LLCircuitData *tempp = new LLCircuitData(host, in_id, mHeartbeatInterval, mHeartbeatTimeout);
mCircuitData.insert(circuit_data_map::value_type(host, tempp));
mPingSet.insert(tempp);
@@ -456,7 +457,7 @@ LLCircuitData *LLCircuit::addCircuitData(const LLHost &host, TPACKETID in_id)
void LLCircuit::removeCircuitData(const LLHost &host)
{
- llinfos << "LLCircuit::removeCircuitData for " << host << llendl;
+ LL_INFOS() << "LLCircuit::removeCircuitData for " << host << LL_ENDL;
mLastCircuit = NULL;
circuit_data_map::iterator it = mCircuitData.find(host);
if(it != mCircuitData.end())
@@ -471,7 +472,7 @@ void LLCircuit::removeCircuitData(const LLHost &host)
}
else
{
- llwarns << "Couldn't find entry for next ping in ping set!" << llendl;
+ LL_WARNS() << "Couldn't find entry for next ping in ping set!" << LL_ENDL;
}
// Clean up from optimization maps
@@ -521,17 +522,17 @@ void LLCircuitData::setAllowTimeout(BOOL allow)
// Reset per-period counters if necessary.
void LLCircuitData::checkPeriodTime()
{
- F64 mt_sec = LLMessageSystem::getMessageTimeSeconds();
- F64 period_length = mt_sec - mPeriodTime;
+ F64Seconds mt_sec = LLMessageSystem::getMessageTimeSeconds();
+ F64Seconds period_length = mt_sec - mPeriodTime;
if ( period_length > TARGET_PERIOD_LENGTH)
{
- F32 bps_in = (F32)(mBytesInThisPeriod * 8.f / period_length);
+ F32 bps_in = F32Bits(mBytesInThisPeriod).value() / period_length.value();
if (bps_in > mPeakBPSIn)
{
mPeakBPSIn = bps_in;
}
- F32 bps_out = (F32)(mBytesOutThisPeriod * 8.f / period_length);
+ F32 bps_out = F32Bits(mBytesOutThisPeriod).value() / period_length.value();
if (bps_out > mPeakBPSOut)
{
mPeakBPSOut = bps_out;
@@ -539,23 +540,23 @@ void LLCircuitData::checkPeriodTime()
mBytesInLastPeriod = mBytesInThisPeriod;
mBytesOutLastPeriod = mBytesOutThisPeriod;
- mBytesInThisPeriod = 0;
- mBytesOutThisPeriod = 0;
- mLastPeriodLength = (F32)period_length;
+ mBytesInThisPeriod = S32Bytes(0);
+ mBytesOutThisPeriod = S32Bytes(0);
+ mLastPeriodLength = period_length;
mPeriodTime = mt_sec;
}
}
-void LLCircuitData::addBytesIn(S32 bytes)
+void LLCircuitData::addBytesIn(S32Bytes bytes)
{
mBytesIn += bytes;
mBytesInThisPeriod += bytes;
}
-void LLCircuitData::addBytesOut(S32 bytes)
+void LLCircuitData::addBytesOut(S32Bytes bytes)
{
mBytesOut += bytes;
mBytesOutThisPeriod += bytes;
@@ -584,7 +585,7 @@ void LLCircuitData::addReliablePacket(S32 mSocket, U8 *buf_ptr, S32 buf_len, LLR
void LLCircuit::resendUnackedPackets(S32& unacked_list_length, S32& unacked_list_size)
{
- F64 now = LLMessageSystem::getMessageTimeSeconds();
+ F64Seconds now = LLMessageSystem::getMessageTimeSeconds();
unacked_list_length = 0;
unacked_list_size = 0;
@@ -719,14 +720,14 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent)
{
std::ostringstream str;
str << "MSG: <- " << mHost << "\tRECOVERING LOST:\t" << id;
- llinfos << str.str() << llendl;
+ LL_INFOS() << str.str() << LL_ENDL;
}
- // llinfos << "removing potential lost: " << id << llendl;
+ // LL_INFOS() << "removing potential lost: " << id << LL_ENDL;
mPotentialLostPackets.erase(id);
}
else if (!receive_resent) // don't freak out over out-of-order reliable resends
{
- U64 time = LLMessageSystem::getMessageTimeUsecs();
+ U64Microseconds time = LLMessageSystem::getMessageTimeUsecs();
TPACKETID index = mPacketsInID;
S32 gap_count = 0;
if ((index < id) && ((id - index) < 16))
@@ -738,10 +739,10 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent)
std::ostringstream str;
str << "MSG: <- " << mHost << "\tPACKET GAP:\t"
<< index;
- llinfos << str.str() << llendl;
+ LL_INFOS() << str.str() << LL_ENDL;
}
-// llinfos << "adding potential lost: " << index << llendl;
+// LL_INFOS() << "adding potential lost: " << index << LL_ENDL;
mPotentialLostPackets[index] = time;
index++;
index = index % LL_MAX_OUT_PACKET_ID;
@@ -750,13 +751,13 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent)
}
else
{
- llinfos << "packet_out_of_order - got packet " << id << " expecting " << index << " from " << mHost << llendl;
+ LL_INFOS() << "packet_out_of_order - got packet " << id << " expecting " << index << " from " << mHost << LL_ENDL;
if(gMessageSystem->mVerboseLog)
{
std::ostringstream str;
str << "MSG: <- " << mHost << "\tPACKET GAP:\t"
<< id << " expected " << index;
- llinfos << str.str() << llendl;
+ LL_INFOS() << str.str() << LL_ENDL;
}
}
@@ -765,11 +766,11 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent)
if (gap_count > 128)
{
- llwarns << "Packet loss gap filler running amok!" << llendl;
+ LL_WARNS() << "Packet loss gap filler running amok!" << LL_ENDL;
}
else if (gap_count > 16)
{
- llwarns << "Sustaining large amounts of packet loss!" << llendl;
+ LL_WARNS() << "Sustaining large amounts of packet loss!" << LL_ENDL;
}
}
@@ -780,7 +781,7 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent)
void LLCircuit::updateWatchDogTimers(LLMessageSystem *msgsys)
{
- F64 cur_time = LLMessageSystem::getMessageTimeSeconds();
+ F64Seconds cur_time = LLMessageSystem::getMessageTimeSeconds();
S32 count = mPingSet.size();
S32 cur = 0;
@@ -818,7 +819,7 @@ void LLCircuit::updateWatchDogTimers(LLMessageSystem *msgsys)
if (cdp->updateWatchDogTimers(msgsys))
{
// Randomize our pings a bit by doing some up to 5% early or late
- F64 dt = 0.95f*mHeartbeatInterval + ll_frand(0.1f*mHeartbeatInterval);
+ F64Seconds dt = 0.95f*mHeartbeatInterval + F32Seconds(ll_frand(0.1f*mHeartbeatInterval.value()));
// Remove it, and reinsert it with the new next ping time.
// Always remove before changing the sorting key.
@@ -846,7 +847,7 @@ void LLCircuit::updateWatchDogTimers(LLMessageSystem *msgsys)
BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys)
{
- F64 cur_time = LLMessageSystem::getMessageTimeSeconds();
+ F64Seconds cur_time = LLMessageSystem::getMessageTimeSeconds();
mLastPingSendTime = cur_time;
if (!checkCircuitTimeout())
@@ -889,8 +890,8 @@ BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys)
wrapped_final = TRUE;
}
- //llinfos << mHost << " - unacked count " << mUnackedPackets.size() << llendl;
- //llinfos << mHost << " - final count " << mFinalRetryPackets.size() << llendl;
+ //LL_INFOS() << mHost << " - unacked count " << mUnackedPackets.size() << LL_ENDL;
+ //LL_INFOS() << mHost << " - final count " << mFinalRetryPackets.size() << LL_ENDL;
if (wrapped != wrapped_final)
{
// One of the "unacked" or "final" lists hasn't wrapped. Whichever one
@@ -900,12 +901,12 @@ BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys)
// Hasn't wrapped, so the one on the
// unacked packet list is older
packet_id = iter->first;
- //llinfos << mHost << ": nowrapped unacked" << llendl;
+ //LL_INFOS() << mHost << ": nowrapped unacked" << LL_ENDL;
}
else
{
packet_id = iter_final->first;
- //llinfos << mHost << ": nowrapped final" << llendl;
+ //LL_INFOS() << mHost << ": nowrapped final" << LL_ENDL;
}
}
else
@@ -917,7 +918,7 @@ BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys)
// Send the ID of the last packet we sent out.
// This will flush all of the destination's
// unacked packets, theoretically.
- //llinfos << mHost << ": No unacked!" << llendl;
+ //LL_INFOS() << mHost << ": No unacked!" << LL_ENDL;
packet_id = getPacketOutID();
}
else
@@ -928,7 +929,7 @@ BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys)
// Unacked list has the lowest so far
packet_id = iter->first;
had_unacked = TRUE;
- //llinfos << mHost << ": Unacked" << llendl;
+ //LL_INFOS() << mHost << ": Unacked" << LL_ENDL;
}
if (iter_final != mFinalRetryPackets.end())
@@ -938,13 +939,13 @@ BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys)
{
// Both had a packet, use the lowest.
packet_id = llmin(packet_id, iter_final->first);
- //llinfos << mHost << ": Min of unacked/final" << llendl;
+ //LL_INFOS() << mHost << ": Min of unacked/final" << LL_ENDL;
}
else
{
// Only the final had a packet, use it.
packet_id = iter_final->first;
- //llinfos << mHost << ": Final!" << llendl;
+ //LL_INFOS() << mHost << ": Final!" << LL_ENDL;
}
}
}
@@ -963,12 +964,12 @@ BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys)
// be considered lost
LLCircuitData::packet_time_map::iterator it;
- U64 timeout = (U64)(1000000.0*llmin(LL_MAX_LOST_TIMEOUT, getPingDelayAveraged() * LL_LOST_TIMEOUT_FACTOR));
+ U64Microseconds timeout = llmin(LL_MAX_LOST_TIMEOUT, F32Seconds(getPingDelayAveraged()) * LL_LOST_TIMEOUT_FACTOR);
- U64 mt_usec = LLMessageSystem::getMessageTimeUsecs();
+ U64Microseconds mt_usec = LLMessageSystem::getMessageTimeUsecs();
for (it = mPotentialLostPackets.begin(); it != mPotentialLostPackets.end(); )
{
- U64 delta_t_usec = mt_usec - (*it).second;
+ U64Microseconds delta_t_usec = mt_usec - (*it).second;
if (delta_t_usec > timeout)
{
// let's call this one a loss!
@@ -979,7 +980,7 @@ BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys)
std::ostringstream str;
str << "MSG: <- " << mHost << "\tLOST PACKET:\t"
<< (*it).first;
- llinfos << str.str() << llendl;
+ LL_INFOS() << str.str() << LL_ENDL;
}
mPotentialLostPackets.erase(it++);
}
@@ -999,8 +1000,8 @@ void LLCircuitData::clearDuplicateList(TPACKETID oldest_id)
// we want to KEEP all x where oldest_id <= x <= last incoming packet, and delete everything else.
- //llinfos << mHost << ": clearing before oldest " << oldest_id << llendl;
- //llinfos << "Recent list before: " << mRecentlyReceivedReliablePackets.size() << llendl;
+ //LL_INFOS() << mHost << ": clearing before oldest " << oldest_id << LL_ENDL;
+ //LL_INFOS() << "Recent list before: " << mRecentlyReceivedReliablePackets.size() << LL_ENDL;
if (oldest_id < mHighestPacketID)
{
// Clean up everything with a packet ID less than oldest_id.
@@ -1014,7 +1015,7 @@ void LLCircuitData::clearDuplicateList(TPACKETID oldest_id)
// Do timeout checks on everything with an ID > mHighestPacketID.
// This should be empty except for wrapping IDs. Thus, this should be
// highly rare.
- U64 mt_usec = LLMessageSystem::getMessageTimeUsecs();
+ U64Microseconds mt_usec = LLMessageSystem::getMessageTimeUsecs();
packet_time_map::iterator pit;
for(pit = mRecentlyReceivedReliablePackets.upper_bound(mHighestPacketID);
@@ -1023,14 +1024,14 @@ void LLCircuitData::clearDuplicateList(TPACKETID oldest_id)
// Validate that the packet ID seems far enough away
if ((pit->first - mHighestPacketID) < 100)
{
- llwarns << "Probably incorrectly timing out non-wrapped packets!" << llendl;
+ LL_WARNS() << "Probably incorrectly timing out non-wrapped packets!" << LL_ENDL;
}
- U64 delta_t_usec = mt_usec - (*pit).second;
- F64 delta_t_sec = delta_t_usec * SEC_PER_USEC;
+ U64Microseconds delta_t_usec = mt_usec - (*pit).second;
+ F64Seconds delta_t_sec = delta_t_usec;
if (delta_t_sec > LL_DUPLICATE_SUPPRESSION_TIMEOUT)
{
// enough time has elapsed we're not likely to get a duplicate on this one
- llinfos << "Clearing " << pit->first << " from recent list" << llendl;
+ LL_INFOS() << "Clearing " << pit->first << " from recent list" << LL_ENDL;
mRecentlyReceivedReliablePackets.erase(pit++);
}
else
@@ -1038,27 +1039,27 @@ void LLCircuitData::clearDuplicateList(TPACKETID oldest_id)
++pit;
}
}
- //llinfos << "Recent list after: " << mRecentlyReceivedReliablePackets.size() << llendl;
+ //LL_INFOS() << "Recent list after: " << mRecentlyReceivedReliablePackets.size() << LL_ENDL;
}
BOOL LLCircuitData::checkCircuitTimeout()
{
- F64 time_since_last_ping = LLMessageSystem::getMessageTimeSeconds() - mLastPingReceivedTime;
+ F64Seconds time_since_last_ping = LLMessageSystem::getMessageTimeSeconds() - mLastPingReceivedTime;
// Nota Bene: This needs to be turned off if you are debugging multiple simulators
if (time_since_last_ping > mHeartbeatTimeout)
{
- llwarns << "LLCircuitData::checkCircuitTimeout for " << mHost << " last ping " << time_since_last_ping << " seconds ago." <<llendl;
+ LL_WARNS() << "LLCircuitData::checkCircuitTimeout for " << mHost << " last ping " << time_since_last_ping << " seconds ago." <<LL_ENDL;
setAlive(FALSE);
if (mTimeoutCallback)
{
- llwarns << "LLCircuitData::checkCircuitTimeout for " << mHost << " calling callback." << llendl;
+ LL_WARNS() << "LLCircuitData::checkCircuitTimeout for " << mHost << " calling callback." << LL_ENDL;
mTimeoutCallback(mHost, mTimeoutUserData);
}
if (!isAlive())
{
// The callback didn't try and resurrect the circuit. We should kill it.
- llwarns << "LLCircuitData::checkCircuitTimeout for " << mHost << " still dead, dropping." << llendl;
+ LL_WARNS() << "LLCircuitData::checkCircuitTimeout for " << mHost << " still dead, dropping." << LL_ENDL;
return FALSE;
}
}
@@ -1121,7 +1122,7 @@ void LLCircuit::sendAcks()
str << "MSG: -> " << cd->mHost << "\tPACKET ACKS:\t";
std::ostream_iterator<TPACKETID> append(str, " ");
std::copy(cd->mAcks.begin(), cd->mAcks.end(), append);
- llinfos << str.str() << llendl;
+ LL_INFOS() << str.str() << LL_ENDL;
}
// empty out the acks list
@@ -1139,40 +1140,40 @@ std::ostream& operator<<(std::ostream& s, LLCircuitData& circuit)
F32 age = circuit.mExistenceTimer.getElapsedTimeF32();
using namespace std;
- s << "Circuit " << circuit.mHost << " ";
- s << circuit.mRemoteID << " ";
- s << (circuit.mbAlive ? "Alive" : "Not Alive") << " ";
- s << (circuit.mbAllowTimeout ? "Timeout Allowed" : "Timeout Not Allowed");
- s << endl;
-
- s << " Packets Lost: " << circuit.mPacketsLost;
- s << " Measured Ping: " << circuit.mPingDelay;
- s << " Averaged Ping: " << circuit.mPingDelayAveraged;
- s << endl;
-
- s << "Global In/Out " << S32(age) << " sec";
- s << " KBytes: " << circuit.mBytesIn / 1024 << "/" << circuit.mBytesOut / 1024;
- s << " Kbps: ";
- s << S32(circuit.mBytesIn * 8.f / circuit.mExistenceTimer.getElapsedTimeF32() / 1024.f);
- s << "/";
- s << S32(circuit.mBytesOut * 8.f / circuit.mExistenceTimer.getElapsedTimeF32() / 1024.f);
- s << " Packets: " << circuit.mPacketsIn << "/" << circuit.mPacketsOut;
- s << endl;
-
- s << "Recent In/Out " << S32(circuit.mLastPeriodLength) << " sec";
- s << " KBytes: ";
- s << circuit.mBytesInLastPeriod / 1024;
- s << "/";
- s << circuit.mBytesOutLastPeriod / 1024;
- s << " Kbps: ";
- s << S32(circuit.mBytesInLastPeriod * 8.f / circuit.mLastPeriodLength / 1024.f);
- s << "/";
- s << S32(circuit.mBytesOutLastPeriod * 8.f / circuit.mLastPeriodLength / 1024.f);
- s << " Peak kbps: ";
- s << S32(circuit.mPeakBPSIn / 1024.f);
- s << "/";
- s << S32(circuit.mPeakBPSOut / 1024.f);
- s << endl;
+ s << "Circuit " << circuit.mHost << " "
+ << circuit.mRemoteID << " "
+ << (circuit.mbAlive ? "Alive" : "Not Alive") << " "
+ << (circuit.mbAllowTimeout ? "Timeout Allowed" : "Timeout Not Allowed")
+ << endl;
+
+ s << " Packets Lost: " << circuit.mPacketsLost
+ << " Measured Ping: " << circuit.mPingDelay
+ << " Averaged Ping: " << circuit.mPingDelayAveraged
+ << endl;
+
+ s << "Global In/Out " << S32(age) << " sec"
+ << " KBytes: " << circuit.mBytesIn.valueInUnits<LLUnits::Kilobytes>() << "/" << circuit.mBytesOut.valueInUnits<LLUnits::Kilobytes>()
+ << " Kbps: "
+ << S32(circuit.mBytesIn.valueInUnits<LLUnits::Kilobits>() / circuit.mExistenceTimer.getElapsedTimeF32().value())
+ << "/"
+ << S32(circuit.mBytesOut.valueInUnits<LLUnits::Kilobits>() / circuit.mExistenceTimer.getElapsedTimeF32().value())
+ << " Packets: " << circuit.mPacketsIn << "/" << circuit.mPacketsOut
+ << endl;
+
+ s << "Recent In/Out " << circuit.mLastPeriodLength
+ << " KBytes: "
+ << circuit.mBytesInLastPeriod.valueInUnits<LLUnits::Kilobytes>()
+ << "/"
+ << circuit.mBytesOutLastPeriod.valueInUnits<LLUnits::Kilobytes>()
+ << " Kbps: "
+ << (S32)(circuit.mBytesInLastPeriod.valueInUnits<LLUnits::Kilobits>() / circuit.mLastPeriodLength.value())
+ << "/"
+ << (S32)(circuit.mBytesOutLastPeriod.valueInUnits<LLUnits::Kilobits>() / circuit.mLastPeriodLength.value())
+ << " Peak kbps: "
+ << S32(circuit.mPeakBPSIn / 1024.f)
+ << "/"
+ << S32(circuit.mPeakBPSOut / 1024.f)
+ << endl;
return s;
}
@@ -1188,7 +1189,7 @@ void LLCircuitData::dumpResendCountAndReset()
{
if (mCurrentResendCount)
{
- llinfos << "Circuit: " << mHost << " resent " << mCurrentResendCount << " packets" << llendl;
+ LL_INFOS() << "Circuit: " << mHost << " resent " << mCurrentResendCount << " packets" << LL_ENDL;
mCurrentResendCount = 0;
}
}
@@ -1256,11 +1257,11 @@ void LLCircuitData::setPacketInID(TPACKETID id)
void LLCircuitData::pingTimerStop(const U8 ping_id)
{
- F64 mt_secs = LLMessageSystem::getMessageTimeSeconds();
+ F64Seconds mt_secs = LLMessageSystem::getMessageTimeSeconds();
// Nota Bene: no averaging of ping times until we get a feel for how this works
- F64 time = mt_secs - mPingTime;
- if (time == 0.0)
+ F64Seconds time = mt_secs - mPingTime;
+ if (time == F32Seconds(0.0))
{
// Ack, we got our ping response on the same frame! Sigh, let's get a real time otherwise
// all of our ping calculations will be skewed.
@@ -1276,7 +1277,7 @@ void LLCircuitData::pingTimerStop(const U8 ping_id)
delta_ping += 256;
}
- U32 msec = (U32) ((delta_ping*mHeartbeatInterval + time) * 1000.f);
+ U32Milliseconds msec = delta_ping*mHeartbeatInterval + time;
setPingDelay(msec);
mPingsInTransit = delta_ping;
@@ -1305,13 +1306,13 @@ U32 LLCircuitData::getPacketsIn() const
}
-S32 LLCircuitData::getBytesIn() const
+S32Bytes LLCircuitData::getBytesIn() const
{
return mBytesIn;
}
-S32 LLCircuitData::getBytesOut() const
+S32Bytes LLCircuitData::getBytesOut() const
{
return mBytesOut;
}
@@ -1353,41 +1354,41 @@ BOOL LLCircuitData::getAllowTimeout() const
}
-U32 LLCircuitData::getPingDelay() const
+U32Milliseconds LLCircuitData::getPingDelay() const
{
return mPingDelay;
}
-F32 LLCircuitData::getPingInTransitTime()
+F32Milliseconds LLCircuitData::getPingInTransitTime()
{
// This may be inaccurate in the case of a circuit that was "dead" and then revived,
// but only until the first round trip ping is sent - djs
- F32 time_since_ping_was_sent = 0;
+ F32Milliseconds time_since_ping_was_sent(0);
if (mPingsInTransit)
{
- time_since_ping_was_sent = (F32)((mPingsInTransit*mHeartbeatInterval - 1)
- + (LLMessageSystem::getMessageTimeSeconds() - mPingTime))*1000.f;
+ time_since_ping_was_sent = ((mPingsInTransit*mHeartbeatInterval - F32Seconds(1))
+ + (LLMessageSystem::getMessageTimeSeconds() - mPingTime));
}
return time_since_ping_was_sent;
}
-void LLCircuitData::setPingDelay(U32 ping)
+void LLCircuitData::setPingDelay(U32Milliseconds ping)
{
mPingDelay = ping;
- mPingDelayAveraged = llmax((F32)ping, getPingDelayAveraged());
+ mPingDelayAveraged = llmax((F32Milliseconds)ping, getPingDelayAveraged());
mPingDelayAveraged = ((1.f - LL_AVERAGED_PING_ALPHA) * mPingDelayAveraged)
- + (LL_AVERAGED_PING_ALPHA * (F32) ping);
+ + (LL_AVERAGED_PING_ALPHA * (F32Milliseconds) ping);
mPingDelayAveraged = llclamp(mPingDelayAveraged,
LL_AVERAGED_PING_MIN,
LL_AVERAGED_PING_MAX);
}
-F32 LLCircuitData::getPingDelayAveraged()
+F32Milliseconds LLCircuitData::getPingDelayAveraged()
{
return llmin(llmax(getPingInTransitTime(), mPingDelayAveraged), LL_AVERAGED_PING_MAX);
}
diff --git a/indra/llmessage/llcircuit.h b/indra/llmessage/llcircuit.h
index 430d6358f7..5b109fc218 100755
--- a/indra/llmessage/llcircuit.h
+++ b/indra/llmessage/llcircuit.h
@@ -34,7 +34,6 @@
#include "llerror.h"
#include "lltimer.h"
-#include "timing.h"
#include "net.h"
#include "llhost.h"
#include "llpacketack.h"
@@ -45,12 +44,14 @@
// Constants
//
const F32 LL_AVERAGED_PING_ALPHA = 0.2f; // relaxation constant on ping running average
-const F32 LL_AVERAGED_PING_MAX = 2000; // msec
-const F32 LL_AVERAGED_PING_MIN = 100; // msec // IW: increased to avoid retransmits when a process is slow
+const F32Milliseconds LL_AVERAGED_PING_MAX(2000);
+const F32Milliseconds LL_AVERAGED_PING_MIN(100); // increased to avoid retransmits when a process is slow
-const U32 INITIAL_PING_VALUE_MSEC = 1000; // initial value for the ping delay, or for ping delay for an unknown circuit
+const U32Milliseconds INITIAL_PING_VALUE_MSEC(1000); // initial value for the ping delay, or for ping delay for an unknown circuit
const TPACKETID LL_MAX_OUT_PACKET_ID = 0x01000000;
+const int LL_ERR_CIRCUIT_GONE = -23017;
+const int LL_ERR_TCP_TIMEOUT = -23016;
// 0 - flags
// [1,4] - packetid
@@ -76,10 +77,10 @@ class LLCircuitData
{
public:
LLCircuitData(const LLHost &host, TPACKETID in_id,
- const F32 circuit_heartbeat_interval, const F32 circuit_timeout);
+ const F32Seconds circuit_heartbeat_interval, const F32Seconds circuit_timeout);
~LLCircuitData();
- S32 resendUnackedPackets(const F64 now);
+ S32 resendUnackedPackets(const F64Seconds now);
void clearDuplicateList(TPACKETID oldest_id);
@@ -105,18 +106,18 @@ public:
// mLocalEndPointID should only ever be setup in the LLCircuitData constructor
const LLUUID& getLocalEndPointID() const { return mLocalEndPointID; }
- U32 getPingDelay() const;
+ U32Milliseconds getPingDelay() const;
S32 getPingsInTransit() const { return mPingsInTransit; }
// ACCESSORS
BOOL isAlive() const;
BOOL isBlocked() const;
BOOL getAllowTimeout() const;
- F32 getPingDelayAveraged();
- F32 getPingInTransitTime();
+ F32Milliseconds getPingDelayAveraged();
+ F32Milliseconds getPingInTransitTime();
U32 getPacketsIn() const;
- S32 getBytesIn() const;
- S32 getBytesOut() const;
+ S32Bytes getBytesIn() const;
+ S32Bytes getBytesOut() const;
U32 getPacketsOut() const;
U32 getPacketsLost() const;
TPACKETID getPacketOutID() const;
@@ -124,10 +125,10 @@ public:
F32 getAgeInSeconds() const;
S32 getUnackedPacketCount() const { return mUnackedPacketCount; }
S32 getUnackedPacketBytes() const { return mUnackedPacketBytes; }
- F64 getNextPingSendTime() const { return mNextPingSendTime; }
+ F64Seconds getNextPingSendTime() const { return mNextPingSendTime; }
U32 getLastPacketGap() const { return mLastPacketGap; }
LLHost getHost() const { return mHost; }
- F64 getLastPacketInTime() const { return mLastPacketInTime; }
+ F64Seconds getLastPacketInTime() const { return mLastPacketInTime; }
LLThrottleGroup &getThrottleGroup() { return mThrottles; }
@@ -163,11 +164,11 @@ protected:
TPACKETID nextPacketOutID();
void setPacketInID(TPACKETID id);
void checkPacketInID(TPACKETID id, BOOL receive_resent);
- void setPingDelay(U32 ping);
+ void setPingDelay(U32Milliseconds ping);
BOOL checkCircuitTimeout(); // Return FALSE if the circuit is dead and should be cleaned up
- void addBytesIn(S32 bytes);
- void addBytesOut(S32 bytes);
+ void addBytesIn(S32Bytes bytes);
+ void addBytesOut(S32Bytes bytes);
U8 nextPingID() { mLastPingID++; return mLastPingID; }
@@ -218,20 +219,20 @@ protected:
BOOL mBlocked; // Blocked is true if the circuit is hosed, i.e. far behind on pings
// Not sure what the difference between this and mLastPingSendTime is
- F64 mPingTime; // Time at which a ping was sent.
+ F64Seconds mPingTime; // Time at which a ping was sent.
- F64 mLastPingSendTime; // Time we last sent a ping
- F64 mLastPingReceivedTime; // Time we last received a ping
- F64 mNextPingSendTime; // Time to try and send the next ping
- S32 mPingsInTransit; // Number of pings in transit
- U8 mLastPingID; // ID of the last ping that we sent out
+ F64Seconds mLastPingSendTime; // Time we last sent a ping
+ F64Seconds mLastPingReceivedTime; // Time we last received a ping
+ F64Seconds mNextPingSendTime; // Time to try and send the next ping
+ S32 mPingsInTransit; // Number of pings in transit
+ U8 mLastPingID; // ID of the last ping that we sent out
// Used for determining the resend time for reliable resends.
- U32 mPingDelay; // raw ping delay
- F32 mPingDelayAveraged; // averaged ping delay (fast attack/slow decay)
+ U32Milliseconds mPingDelay; // raw ping delay
+ F32Milliseconds mPingDelayAveraged; // averaged ping delay (fast attack/slow decay)
- typedef std::map<TPACKETID, U64> packet_time_map;
+ typedef std::map<TPACKETID, U64Microseconds> packet_time_map;
packet_time_map mPotentialLostPackets;
packet_time_map mRecentlyReceivedReliablePackets;
@@ -246,7 +247,7 @@ protected:
S32 mUnackedPacketCount;
S32 mUnackedPacketBytes;
- F64 mLastPacketInTime; // Time of last packet arrival
+ F64Seconds mLastPacketInTime; // Time of last packet arrival
LLUUID mLocalEndPointID;
@@ -258,24 +259,24 @@ protected:
U32 mPacketsOut;
U32 mPacketsIn;
S32 mPacketsLost;
- S32 mBytesIn;
- S32 mBytesOut;
-
- F32 mLastPeriodLength; // seconds
- S32 mBytesInLastPeriod;
- S32 mBytesOutLastPeriod;
- S32 mBytesInThisPeriod;
- S32 mBytesOutThisPeriod;
+ S32Bytes mBytesIn,
+ mBytesOut;
+
+ F32Seconds mLastPeriodLength;
+ S32Bytes mBytesInLastPeriod;
+ S32Bytes mBytesOutLastPeriod;
+ S32Bytes mBytesInThisPeriod;
+ S32Bytes mBytesOutThisPeriod;
F32 mPeakBPSIn; // bits per second, max of all period bps
F32 mPeakBPSOut; // bits per second, max of all period bps
- F64 mPeriodTime;
+ F64Seconds mPeriodTime;
LLTimer mExistenceTimer; // initialized when circuit created, used to track bandwidth numbers
S32 mCurrentResendCount; // Number of resent packets since last spam
U32 mLastPacketGap; // Gap in sequence number of last packet.
- const F32 mHeartbeatInterval;
- const F32 mHeartbeatTimeout;
+ const F32Seconds mHeartbeatInterval;
+ const F32Seconds mHeartbeatTimeout;
};
@@ -285,7 +286,7 @@ class LLCircuit
{
public:
// CREATORS
- LLCircuit(const F32 circuit_heartbeat_interval, const F32 circuit_timeout);
+ LLCircuit(const F32Seconds circuit_heartbeat_interval, const F32Seconds circuit_timeout);
~LLCircuit();
// ACCESSORS
@@ -340,7 +341,7 @@ protected:
mutable LLCircuitData* mLastCircuit;
private:
- const F32 mHeartbeatInterval;
- const F32 mHeartbeatTimeout;
+ const F32Seconds mHeartbeatInterval;
+ const F32Seconds mHeartbeatTimeout;
};
#endif
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 9e68c68858..73df47b933 100755
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -49,6 +49,7 @@
#include "llproxy.h"
#include "llsdserialize.h"
#include "llstl.h"
+#include "llstring.h"
#include "llthread.h"
#include "lltimer.h"
@@ -100,7 +101,7 @@ void check_curl_code(CURLcode code)
{
// linux appears to throw a curl error once per session for a bad initialization
// at a pretty random time (when enabling cookies).
- llinfos << "curl error detected: " << curl_easy_strerror(code) << llendl;
+ LL_WARNS("curl") << "curl error detected: " << curl_easy_strerror(code) << LL_ENDL;
}
}
@@ -110,7 +111,7 @@ void check_curl_multi_code(CURLMcode code)
{
// linux appears to throw a curl error once per session for a bad initialization
// at a pretty random time (when enabling cookies).
- llinfos << "curl multi error detected: " << curl_multi_strerror(code) << llendl;
+ LL_WARNS("curl") << "curl multi error detected: " << curl_multi_strerror(code) << LL_ENDL;
}
}
@@ -135,6 +136,7 @@ std::string LLCurl::getVersionString()
//////////////////////////////////////////////////////////////////////////////
LLCurl::Responder::Responder()
+ : mHTTPMethod(HTTP_INVALID), mStatus(HTTP_INTERNAL_ERROR)
{
}
@@ -144,22 +146,30 @@ LLCurl::Responder::~Responder()
}
// virtual
-void LLCurl::Responder::errorWithContent(
- U32 status,
- const std::string& reason,
- const LLSD&)
+void LLCurl::Responder::httpFailure()
{
- error(status, reason);
+ LL_WARNS("curl") << dumpResponse() << LL_ENDL;
}
-// virtual
-void LLCurl::Responder::error(U32 status, const std::string& reason)
+std::string LLCurl::Responder::dumpResponse() const
{
- llinfos << mURL << " [" << status << "]: " << reason << llendl;
+ std::ostringstream s;
+ s << "[" << httpMethodAsVerb(mHTTPMethod) << ":" << mURL << "] "
+ << "[status:" << mStatus << "] "
+ << "[reason:" << mReason << "] ";
+
+ if (mResponseHeaders.has(HTTP_IN_HEADER_CONTENT_TYPE))
+ {
+ s << "[content-type:" << mResponseHeaders[HTTP_IN_HEADER_CONTENT_TYPE] << "] ";
+ }
+
+ s << "[content:" << mContent << "]";
+
+ return s.str();
}
// virtual
-void LLCurl::Responder::result(const LLSD& content)
+void LLCurl::Responder::httpSuccess()
{
}
@@ -168,44 +178,109 @@ void LLCurl::Responder::setURL(const std::string& url)
mURL = url;
}
+void LLCurl::Responder::successResult(const LLSD& content)
+{
+ setResult(HTTP_OK, "", content);
+ httpSuccess();
+}
+
+void LLCurl::Responder::failureResult(S32 status, const std::string& reason, const LLSD& content /* = LLSD() */)
+{
+ setResult(status, reason, content);
+ httpFailure();
+}
+
+void LLCurl::Responder::completeResult(S32 status, const std::string& reason, const LLSD& content /* = LLSD() */)
+{
+ setResult(status, reason, content);
+ httpCompleted();
+}
+
+void LLCurl::Responder::setResult(S32 status, const std::string& reason, const LLSD& content /* = LLSD() */)
+{
+ mStatus = status;
+ mReason = reason;
+ mContent = content;
+}
+
+void LLCurl::Responder::setHTTPMethod(EHTTPMethod method)
+{
+ mHTTPMethod = method;
+}
+
+void LLCurl::Responder::setResponseHeader(const std::string& header, const std::string& value)
+{
+ mResponseHeaders[header] = value;
+}
+
+const std::string& LLCurl::Responder::getResponseHeader(const std::string& header) const
+{
+ if (mResponseHeaders.has(header))
+ {
+ return mResponseHeaders[header].asStringRef();
+ }
+ static const std::string empty;
+ return empty;
+}
+
+bool LLCurl::Responder::hasResponseHeader(const std::string& header) const
+{
+ if (mResponseHeaders.has(header)) return true;
+ return false;
+}
+
// virtual
void LLCurl::Responder::completedRaw(
- U32 status,
- const std::string& reason,
const LLChannelDescriptors& channels,
const LLIOPipe::buffer_ptr_t& buffer)
{
- LLSD content;
LLBufferStream istr(channels, buffer.get());
- const bool emit_errors = false;
- if (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXML(content, istr, emit_errors))
+ const bool emit_parse_errors = false;
+
+ std::string debug_body("(empty)");
+ bool parsed=true;
+ if (EOF == istr.peek())
+ {
+ parsed=false;
+ }
+ // Try to parse body as llsd, no matter what 'content-type' says.
+ else if (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXML(mContent, istr, emit_parse_errors))
+ {
+ parsed=false;
+ char body[1025];
+ body[1024] = '\0';
+ istr.seekg(0, std::ios::beg);
+ istr.get(body,1024);
+ if (strlen(body) > 0)
+ {
+ mContent = body;
+ debug_body = body;
+ }
+ }
+
+ // Only emit a warning if we failed to parse when 'content-type' == 'application/llsd+xml'
+ if (!parsed && (HTTP_CONTENT_LLSD_XML == getResponseHeader(HTTP_IN_HEADER_CONTENT_TYPE)))
{
- llinfos << "Failed to deserialize LLSD. " << mURL << " [" << status << "]: " << reason << llendl;
- content["reason"] = reason;
+ LL_WARNS() << "Failed to deserialize . " << mURL << " [status:" << mStatus << "] "
+ << "(" << mReason << ") body: " << debug_body << LL_ENDL;
}
- completed(status, reason, content);
+ httpCompleted();
}
// virtual
-void LLCurl::Responder::completed(U32 status, const std::string& reason, const LLSD& content)
+void LLCurl::Responder::httpCompleted()
{
- if (isGoodStatus(status))
+ if (isGoodStatus())
{
- result(content);
+ httpSuccess();
}
else
{
- errorWithContent(status, reason, content);
+ httpFailure();
}
}
-//virtual
-void LLCurl::Responder::completedHeader(U32 status, const std::string& reason, const LLSD& content)
-{
-
-}
-
//////////////////////////////////////////////////////////////////////////////
std::set<CURL*> LLCurl::Easy::sFreeHandles;
@@ -248,7 +323,7 @@ void LLCurl::Easy::releaseEasyHandle(CURL* handle)
if (!handle)
{
return ; //handle allocation failed.
- //llerrs << "handle cannot be NULL!" << llendl;
+ //LL_ERRS() << "handle cannot be NULL!" << LL_ENDL;
}
LLMutexLock lock(sHandleMutexp) ;
@@ -270,8 +345,38 @@ void LLCurl::Easy::releaseEasyHandle(CURL* handle)
}
else
{
- llerrs << "Invalid handle." << llendl;
+ LL_ERRS() << "Invalid handle." << LL_ENDL;
+ }
+}
+
+//static
+void LLCurl::Easy::deleteAllActiveHandles()
+{
+ LLMutexLock lock(sHandleMutexp) ;
+ LL_CHECK_MEMORY
+ for (std::set<CURL*>::iterator activeHandle = sActiveHandles.begin(); activeHandle != sActiveHandles.end(); ++activeHandle)
+ {
+ CURL* curlHandle = *activeHandle;
+ LLCurl::deleteEasyHandle(curlHandle);
+ LL_CHECK_MEMORY
}
+
+ sFreeHandles.clear();
+}
+
+//static
+void LLCurl::Easy::deleteAllFreeHandles()
+{
+ LLMutexLock lock(sHandleMutexp) ;
+ LL_CHECK_MEMORY
+ for (std::set<CURL*>::iterator freeHandle = sFreeHandles.begin(); freeHandle != sFreeHandles.end(); ++freeHandle)
+ {
+ CURL* curlHandle = *freeHandle;
+ LLCurl::deleteEasyHandle(curlHandle);
+ LL_CHECK_MEMORY
+ }
+
+ sFreeHandles.clear();
}
LLCurl::Easy::Easy()
@@ -289,7 +394,8 @@ LLCurl::Easy* LLCurl::Easy::getEasy()
if (!easy->mCurlEasyHandle)
{
// this can happen if we have too many open files (fails in c-ares/ares_init.c)
- llwarns << "allocEasyHandle() returned NULL! Easy handles: " << gCurlEasyCount << " Multi handles: " << gCurlMultiCount << llendl;
+ LL_WARNS("curl") << "allocEasyHandle() returned NULL! Easy handles: "
+ << gCurlEasyCount << " Multi handles: " << gCurlMultiCount << LL_ENDL;
delete easy;
return NULL;
}
@@ -317,10 +423,14 @@ LLCurl::Easy::~Easy()
for_each(mStrings.begin(), mStrings.end(), DeletePointerArray());
LL_CHECK_MEMORY
if (mResponder && LLCurl::sNotQuitting) //aborted
- {
- std::string reason("Request timeout, aborted.") ;
- mResponder->completedRaw(408, //HTTP_REQUEST_TIME_OUT, timeout, abort
- reason, mChannels, mOutput);
+ {
+ // HTTP_REQUEST_TIME_OUT, timeout, abort
+ // *TODO: This looks like improper use of the 408 status code.
+ // See: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.9
+ // This status code should be returned by the *server* when:
+ // "The client did not produce a request within the time that the server was prepared to wait."
+ mResponder->setResult(HTTP_REQUEST_TIME_OUT, "Request timeout, aborted.");
+ mResponder->completedRaw(mChannels, mOutput);
LL_CHECK_MEMORY
}
mResponder = NULL;
@@ -384,9 +494,9 @@ void LLCurl::Easy::getTransferInfo(LLCurl::TransferInfo* info)
check_curl_code(curl_easy_getinfo(mCurlEasyHandle, CURLINFO_SPEED_DOWNLOAD, &info->mSpeedDownload));
}
-U32 LLCurl::Easy::report(CURLcode code)
+S32 LLCurl::Easy::report(CURLcode code)
{
- U32 responseCode = 0;
+ S32 responseCode = 0;
std::string responseReason;
if (code == CURLE_OK)
@@ -396,14 +506,15 @@ U32 LLCurl::Easy::report(CURLcode code)
}
else
{
- responseCode = 499;
+ responseCode = HTTP_INTERNAL_ERROR;
responseReason = strerror(code) + " : " + mErrorBuffer;
setopt(CURLOPT_FRESH_CONNECT, TRUE);
}
if (mResponder)
{
- mResponder->completedRaw(responseCode, responseReason, mChannels, mOutput);
+ mResponder->setResult(responseCode, responseReason);
+ mResponder->completedRaw(mChannels, mOutput);
mResponder = NULL;
}
@@ -440,9 +551,31 @@ void LLCurl::Easy::setoptString(CURLoption option, const std::string& value)
check_curl_code(result);
}
+void LLCurl::Easy::slist_append(const std::string& header, const std::string& value)
+{
+ std::string pair(header);
+ if (value.empty())
+ {
+ pair += ":";
+ }
+ else
+ {
+ pair += ": ";
+ pair += value;
+ }
+ slist_append(pair.c_str());
+}
+
void LLCurl::Easy::slist_append(const char* str)
{
- mHeaders = curl_slist_append(mHeaders, str);
+ if (str)
+ {
+ mHeaders = curl_slist_append(mHeaders, str);
+ if (!mHeaders)
+ {
+ LL_WARNS() << "curl_slist_append() call returned NULL appending " << str << LL_ENDL;
+ }
+ }
}
size_t curlReadCallback(char* data, size_t size, size_t nmemb, void* user_data)
@@ -530,8 +663,9 @@ void LLCurl::Easy::prepRequest(const std::string& url,
if (!post)
{
- slist_append("Connection: keep-alive");
- slist_append("Keep-alive: 300");
+ // *TODO: Should this be set to 'Keep-Alive' ?
+ slist_append(HTTP_OUT_HEADER_CONNECTION, "keep-alive");
+ slist_append(HTTP_OUT_HEADER_KEEP_ALIVE, "300");
// Accept and other headers
for (std::vector<std::string>::const_iterator iter = headers.begin();
iter != headers.end(); ++iter)
@@ -555,7 +689,7 @@ LLCurl::Multi::Multi(F32 idle_time_out)
mCurlMultiHandle = LLCurl::newMultiHandle();
if (!mCurlMultiHandle)
{
- llwarns << "curl_multi_init() returned NULL! Easy handles: " << gCurlEasyCount << " Multi handles: " << gCurlMultiCount << llendl;
+ LL_WARNS() << "curl_multi_init() returned NULL! Easy handles: " << gCurlEasyCount << " Multi handles: " << gCurlMultiCount << LL_ENDL;
mCurlMultiHandle = LLCurl::newMultiHandle();
}
@@ -810,7 +944,7 @@ S32 LLCurl::Multi::process()
++processed;
if (msg->msg == CURLMSG_DONE)
{
- U32 response = 0;
+ S32 response = 0;
Easy* easy = NULL ;
{
@@ -829,9 +963,9 @@ S32 LLCurl::Multi::process()
}
else
{
- response = 499;
- //*TODO: change to llwarns
- llerrs << "cleaned up curl request completed!" << llendl;
+ response = HTTP_INTERNAL_ERROR;
+ //*TODO: change to LL_WARNS()
+ LL_ERRS() << "cleaned up curl request completed!" << LL_ENDL;
}
if (response >= 400)
{
@@ -876,7 +1010,7 @@ bool LLCurl::Multi::addEasy(Easy* easy)
check_curl_multi_code(mcode);
//if (mcode != CURLM_OK)
//{
- // llwarns << "Curl Error: " << curl_multi_strerror(mcode) << llendl;
+ // LL_WARNS() << "Curl Error: " << curl_multi_strerror(mcode) << LL_ENDL;
// return false;
//}
return true;
@@ -993,7 +1127,7 @@ void LLCurlThread::addMulti(LLCurl::Multi* multi)
if (!addRequest(req))
{
- llwarns << "curl request added when the thread is quitted" << llendl;
+ LL_WARNS() << "curl request added when the thread is quitted" << LL_ENDL;
}
}
@@ -1100,7 +1234,7 @@ bool LLCurlRequest::addEasy(LLCurl::Easy* easy)
if (mProcessing)
{
- llerrs << "Posting to a LLCurlRequest instance from within a responder is not allowed (causes DNS timeouts)." << llendl;
+ LL_ERRS() << "Posting to a LLCurlRequest instance from within a responder is not allowed (causes DNS timeouts)." << LL_ENDL;
}
bool res = mActiveMulti->addEasy(easy);
return res;
@@ -1128,13 +1262,13 @@ bool LLCurlRequest::getByteRange(const std::string& url,
easy->setopt(CURLOPT_HTTPGET, 1);
if (length > 0)
{
- std::string range = llformat("Range: bytes=%d-%d", offset,offset+length-1);
- easy->slist_append(range.c_str());
+ std::string range = llformat("bytes=%d-%d", offset,offset+length-1);
+ easy->slist_append(HTTP_OUT_HEADER_RANGE, range);
}
else if (offset > 0)
{
- std::string range = llformat("Range: bytes=%d-", offset);
- easy->slist_append(range.c_str());
+ std::string range = llformat("bytes=%d-", offset);
+ easy->slist_append(HTTP_OUT_HEADER_RANGE, range);
}
easy->setHeaders();
bool res = addEasy(easy);
@@ -1161,10 +1295,10 @@ bool LLCurlRequest::post(const std::string& url,
easy->setopt(CURLOPT_POSTFIELDS, (void*)NULL);
easy->setopt(CURLOPT_POSTFIELDSIZE, bytes);
- easy->slist_append("Content-Type: application/llsd+xml");
+ easy->slist_append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_LLSD_XML);
easy->setHeaders();
- lldebugs << "POSTING: " << bytes << " bytes." << llendl;
+ LL_DEBUGS() << "POSTING: " << bytes << " bytes." << LL_ENDL;
bool res = addEasy(easy);
return res;
}
@@ -1189,10 +1323,10 @@ bool LLCurlRequest::post(const std::string& url,
easy->setopt(CURLOPT_POSTFIELDS, (void*)NULL);
easy->setopt(CURLOPT_POSTFIELDSIZE, bytes);
- easy->slist_append("Content-Type: application/octet-stream");
+ easy->slist_append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_OCTET_STREAM);
easy->setHeaders();
- lldebugs << "POSTING: " << bytes << " bytes." << llendl;
+ LL_DEBUGS() << "POSTING: " << bytes << " bytes." << LL_ENDL;
bool res = addEasy(easy);
return res;
}
@@ -1561,6 +1695,14 @@ void LLCurlEasyRequest::setSSLCtxCallback(curl_ssl_ctx_callback callback, void*
}
}
+void LLCurlEasyRequest::slist_append(const std::string& header, const std::string& value)
+{
+ if (isValid() && mEasy)
+ {
+ mEasy->slist_append(header, value);
+ }
+}
+
void LLCurlEasyRequest::slist_append(const char* str)
{
if (isValid() && mEasy)
@@ -1573,7 +1715,7 @@ void LLCurlEasyRequest::sendRequest(const std::string& url)
{
llassert_always(!mRequestSent);
mRequestSent = true;
- lldebugs << url << llendl;
+ LL_DEBUGS() << url << LL_ENDL;
if (isValid() && mEasy)
{
mEasy->setHeaders();
@@ -1745,17 +1887,14 @@ void LLCurl::cleanupClass()
#endif
LL_CHECK_MEMORY
-
- for (std::set<CURL*>::iterator iter = Easy::sFreeHandles.begin(); iter != Easy::sFreeHandles.end(); ++iter)
- {
- CURL* curl = *iter;
- LLCurl::deleteEasyHandle(curl);
- }
-
+ Easy::deleteAllFreeHandles();
+ LL_CHECK_MEMORY
+ Easy::deleteAllActiveHandles();
LL_CHECK_MEMORY
- Easy::sFreeHandles.clear();
-
+ // Free the template easy handle
+ curl_easy_cleanup(sCurlTemplateStandardHandle);
+ sCurlTemplateStandardHandle = NULL;
LL_CHECK_MEMORY
delete Easy::sHandleMutexp ;
@@ -1781,7 +1920,7 @@ CURLM* LLCurl::newMultiHandle()
if(sTotalHandles + 1 > sMaxHandles)
{
- llwarns << "no more handles available." << llendl ;
+ LL_WARNS() << "no more handles available." << LL_ENDL ;
return NULL ; //failed
}
sTotalHandles++;
@@ -1789,7 +1928,7 @@ CURLM* LLCurl::newMultiHandle()
CURLM* ret = curl_multi_init() ;
if(!ret)
{
- llwarns << "curl_multi_init failed." << llendl ;
+ LL_WARNS() << "curl_multi_init failed." << LL_ENDL ;
}
return ret ;
@@ -1815,7 +1954,7 @@ CURL* LLCurl::newEasyHandle()
if(sTotalHandles + 1 > sMaxHandles)
{
- llwarns << "no more handles available." << llendl ;
+ LL_WARNS() << "no more handles available." << LL_ENDL ;
return NULL ; //failed
}
sTotalHandles++;
@@ -1823,7 +1962,7 @@ CURL* LLCurl::newEasyHandle()
CURL* ret = createStandardCurlHandle();
if(!ret)
{
- llwarns << "failed to create curl handle." << llendl ;
+ LL_WARNS() << "failed to create curl handle." << LL_ENDL ;
}
return ret ;
@@ -1863,7 +2002,7 @@ CURL* LLCurl::createStandardCurlHandle()
sCurlTemplateStandardHandle = curl_easy_init();
if (sCurlTemplateStandardHandle == NULL)
{
- llwarns << "curl error calling curl_easy_init()" << llendl;
+ LL_WARNS() << "curl error calling curl_easy_init()" << LL_ENDL;
}
else
{
diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h
index 90b3f2815d..385d9fffa8 100755
--- a/indra/llmessage/llcurl.h
+++ b/indra/llmessage/llcurl.h
@@ -39,9 +39,9 @@
#include <curl/curl.h> // TODO: remove dependency
#include "llbuffer.h"
+#include "llhttpconstants.h"
#include "lliopipe.h"
#include "llsd.h"
-#include "llthread.h"
#include "llqueuedthread.h"
#include "llframetimer.h"
#include "llpointer.h"
@@ -77,59 +77,92 @@ public:
Responder();
virtual ~Responder();
- /**
- * @brief return true if the status code indicates success.
- */
- static bool isGoodStatus(U32 status)
+ virtual bool followRedir()
{
- return((200 <= status) && (status < 300));
+ return false;
}
-
- virtual void errorWithContent(
- U32 status,
- const std::string& reason,
- const LLSD& content);
- //< called by completed() on bad status
-
- virtual void error(U32 status, const std::string& reason);
- //< called by default error(status, reason, content)
-
- virtual void result(const LLSD& content);
- //< called by completed for good status codes.
+ /**
+ * @brief return true if the status code indicates success.
+ */
+ bool isGoodStatus() const { return isHttpGoodStatus(mStatus); }
+
+ S32 getStatus() const { return mStatus; }
+ const std::string& getReason() const { return mReason; }
+ const LLSD& getContent() const { return mContent; }
+ bool hasResponseHeader(const std::string& header) const;
+ const std::string& getResponseHeader(const std::string& header) const;
+ const LLSD& getResponseHeaders() const { return mResponseHeaders; }
+ const std::string& getURL() const { return mURL; }
+ EHTTPMethod getHTTPMethod() const { return mHTTPMethod; }
+
+ // This formats response information for use in log spam. Includes content spam.
+ std::string dumpResponse() const;
+
+ // Allows direct triggering of success/error with different results.
+ void completeResult(S32 status, const std::string& reason, const LLSD& content = LLSD());
+ void successResult(const LLSD& content);
+ void failureResult(S32 status, const std::string& reason, const LLSD& content = LLSD());
+
+ // The default implementation will try to parse body content as an LLSD, however
+ // it should not spam about parsing failures unless the server sent a
+ // Content-Type: application/llsd+xml header.
virtual void completedRaw(
- U32 status,
- const std::string& reason,
const LLChannelDescriptors& channels,
const LLIOPipe::buffer_ptr_t& buffer);
/**< Override point for clients that may want to use this
class when the response is some other format besides LLSD
*/
+
+
+ // The http* methods are not public since these should be triggered internally
+ // after status, reason, content, etc have been set.
+ // If you need to trigger a completion method, use the *Result methods, above.
+ protected:
+ // These methods are the preferred way to process final results.
+ // By default, when one of these is called the following information will be resolved:
+ // * HTTP status code - getStatus()
+ // * Reason string - getReason()
+ // * Content - getContent()
+ // * Response Headers - getResponseHeaders()
+
+ // By default, httpSuccess is triggered whenever httpCompleted is called with a 2xx status code.
+ virtual void httpSuccess();
+ //< called by completed for good status codes.
+
+ // By default, httpFailure is triggered whenever httpCompleted is called with a non-2xx status code.
+ virtual void httpFailure();
+ //< called by httpCompleted() on bad status
- virtual void completed(
- U32 status,
- const std::string& reason,
- const LLSD& content);
- /**< The default implemetnation calls
+ // httpCompleted does not generally need to be overridden, unless
+ // you don't care about the status code (which determine httpFailure or httpSuccess)
+ // or if you want to re-interpret what a 'good' vs' bad' status code is.
+ virtual void httpCompleted();
+ /**< The default implementation calls
either:
- * result(), or
- * error()
+ * httpSuccess(), or
+ * httpFailure()
*/
-
- // Override to handle parsing of the header only. Note: this is the only place where the contents
- // of the header can be parsed. In the ::completed call above only the body is contained in the LLSD.
- virtual void completedHeader(U32 status, const std::string& reason, const LLSD& content);
-
- // Used internally to set the url for debugging later.
- void setURL(const std::string& url);
- virtual bool followRedir()
- {
- return false;
- }
+ public:
+ void setHTTPMethod(EHTTPMethod method);
+ void setURL(const std::string& url);
+ void setResult(S32 status, const std::string& reason, const LLSD& content = LLSD());
+ void setResponseHeader(const std::string& header, const std::string& value);
private:
+ // These can be accessed by the get* methods. Treated as 'read-only' during completion handlers.
+ EHTTPMethod mHTTPMethod;
std::string mURL;
+ LLSD mResponseHeaders;
+
+ protected:
+ // These should also generally be treated as 'read-only' during completion handlers
+ // and should be accessed by the get* methods. The exception to this rule would
+ // be when overriding the completedRaw method in preparation for calling httpCompleted().
+ S32 mStatus;
+ std::string mReason;
+ LLSD mContent;
};
typedef LLPointer<Responder> ResponderPtr;
@@ -228,10 +261,11 @@ public:
// Copies the string so that it is guaranteed to stick around
void setoptString(CURLoption option, const std::string& value);
+ void slist_append(const std::string& header, const std::string& value);
void slist_append(const char* str);
void setHeaders();
- U32 report(CURLcode);
+ S32 report(CURLcode);
void getTransferInfo(LLCurl::TransferInfo* info);
void prepRequest(const std::string& url, const std::vector<std::string>& headers, LLCurl::ResponderPtr, S32 time_out = 0, bool post = false);
@@ -270,6 +304,9 @@ private:
static std::set<CURL*> sFreeHandles;
static std::set<CURL*> sActiveHandles;
static LLMutex* sHandleMutexp ;
+
+ static void deleteAllActiveHandles();
+ static void deleteAllFreeHandles();
};
class LLCurl::Multi
@@ -487,6 +524,7 @@ public:
void setWriteCallback(curl_write_callback callback, void* userdata);
void setReadCallback(curl_read_callback callback, void* userdata);
void setSSLCtxCallback(curl_ssl_ctx_callback callback, void* userdata);
+ void slist_append(const std::string& header, const std::string& value);
void slist_append(const char* str);
void sendRequest(const std::string& url);
void requestComplete();
diff --git a/indra/llmessage/lldatapacker.cpp b/indra/llmessage/lldatapacker.cpp
index 3385d7c2e2..3510f93805 100755
--- a/indra/llmessage/lldatapacker.cpp
+++ b/indra/llmessage/lldatapacker.cpp
@@ -52,13 +52,13 @@ LLDataPacker::LLDataPacker() : mPassFlags(0), mWriteEnabled(FALSE)
//virtual
void LLDataPacker::reset()
{
- llerrs << "Using unimplemented datapacker reset!" << llendl;
+ LL_ERRS() << "Using unimplemented datapacker reset!" << LL_ENDL;
}
//virtual
void LLDataPacker::dumpBufferToLog()
{
- llerrs << "dumpBufferToLog not implemented for this type!" << llendl;
+ LL_ERRS() << "dumpBufferToLog not implemented for this type!" << LL_ENDL;
}
BOOL LLDataPacker::packFixed(const F32 value, const char *name,
@@ -108,7 +108,7 @@ BOOL LLDataPacker::packFixed(const F32 value, const char *name,
}
else
{
- llerrs << "Using fixed-point packing of " << total_bits << " bits, why?!" << llendl;
+ LL_ERRS() << "Using fixed-point packing of " << total_bits << " bits, why?!" << LL_ENDL;
}
return success;
}
@@ -117,7 +117,7 @@ BOOL LLDataPacker::unpackFixed(F32 &value, const char *name,
const BOOL is_signed, const U32 int_bits, const U32 frac_bits)
{
//BOOL success = TRUE;
- //llinfos << "unpackFixed:" << name << " int:" << int_bits << " frac:" << frac_bits << llendl;
+ //LL_INFOS() << "unpackFixed:" << name << " int:" << int_bits << " frac:" << frac_bits << LL_ENDL;
BOOL ok = FALSE;
S32 unsigned_bits = int_bits + frac_bits;
S32 total_bits = unsigned_bits;
@@ -158,10 +158,10 @@ BOOL LLDataPacker::unpackFixed(F32 &value, const char *name,
else
{
fixed_val = 0;
- llerrs << "Bad bit count: " << total_bits << llendl;
+ LL_ERRS() << "Bad bit count: " << total_bits << LL_ENDL;
}
- //llinfos << "Fixed_val:" << fixed_val << llendl;
+ //LL_INFOS() << "Fixed_val:" << fixed_val << LL_ENDL;
fixed_val /= (F32)(1 << frac_bits);
if (is_signed)
@@ -169,7 +169,7 @@ BOOL LLDataPacker::unpackFixed(F32 &value, const char *name,
fixed_val -= max_val;
}
value = fixed_val;
- //llinfos << "Value: " << value << llendl;
+ //LL_INFOS() << "Value: " << value << LL_ENDL;
return ok;
}
@@ -239,7 +239,7 @@ BOOL LLDataPackerBinaryBuffer::unpackBinaryData(U8 *value, S32 &size, const char
}
else
{
- llwarns << "LLDataPackerBinaryBuffer::unpackBinaryData would unpack invalid data, aborting!" << llendl;
+ LL_WARNS() << "LLDataPackerBinaryBuffer::unpackBinaryData would unpack invalid data, aborting!" << LL_ENDL;
success = FALSE;
}
return success;
@@ -550,7 +550,7 @@ const LLDataPackerBinaryBuffer& LLDataPackerBinaryBuffer::operator=(const LLData
if (a.getBufferSize() > getBufferSize())
{
// We've got problems, ack!
- llerrs << "Trying to do an assignment with not enough room in the target." << llendl;
+ LL_ERRS() << "Trying to do an assignment with not enough room in the target." << LL_ENDL;
}
memcpy(mBufferp, a.mBufferp, a.getBufferSize()); /*Flawfinder: ignore*/
return *this;
@@ -558,7 +558,7 @@ const LLDataPackerBinaryBuffer& LLDataPackerBinaryBuffer::operator=(const LLData
void LLDataPackerBinaryBuffer::dumpBufferToLog()
{
- llwarns << "Binary Buffer Dump, size: " << mBufferSize << llendl;
+ LL_WARNS() << "Binary Buffer Dump, size: " << mBufferSize << LL_ENDL;
char line_buffer[256]; /*Flawfinder: ignore*/
S32 i;
S32 cur_line_pos = 0;
@@ -571,13 +571,13 @@ void LLDataPackerBinaryBuffer::dumpBufferToLog()
if (cur_line_pos >= 16)
{
cur_line_pos = 0;
- llwarns << "Offset:" << std::hex << cur_line*16 << std::dec << " Data:" << line_buffer << llendl;
+ LL_WARNS() << "Offset:" << std::hex << cur_line*16 << std::dec << " Data:" << line_buffer << LL_ENDL;
cur_line++;
}
}
if (cur_line_pos)
{
- llwarns << "Offset:" << std::hex << cur_line*16 << std::dec << " Data:" << line_buffer << llendl;
+ LL_WARNS() << "Offset:" << std::hex << cur_line*16 << std::dec << " Data:" << line_buffer << LL_ENDL;
}
}
@@ -608,7 +608,7 @@ BOOL LLDataPackerAsciiBuffer::packString(const std::string& value, const char *n
{
// *NOTE: I believe we need to mark a failure bit at this point.
numCopied = getBufferSize()-getCurrentSize();
- llwarns << "LLDataPackerAsciiBuffer::packString: string truncated: " << value << llendl;
+ LL_WARNS() << "LLDataPackerAsciiBuffer::packString: string truncated: " << value << LL_ENDL;
}
mCurBufferp += numCopied;
return success;
@@ -647,7 +647,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const ch
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
{
numCopied = getBufferSize()-getCurrentSize();
- llwarns << "LLDataPackerAsciiBuffer::packBinaryData: number truncated: " << size << llendl;
+ LL_WARNS() << "LLDataPackerAsciiBuffer::packBinaryData: number truncated: " << size << LL_ENDL;
}
mCurBufferp += numCopied;
@@ -660,7 +660,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const ch
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
{
numCopied = getBufferSize()-getCurrentSize();
- llwarns << "LLDataPackerAsciiBuffer::packBinaryData: data truncated: " << llendl;
+ LL_WARNS() << "LLDataPackerAsciiBuffer::packBinaryData: data truncated: " << LL_ENDL;
bBufferFull = TRUE;
}
mCurBufferp += numCopied;
@@ -672,7 +672,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryData(const U8 *value, S32 size, const ch
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
{
numCopied = getBufferSize()-getCurrentSize();
- llwarns << "LLDataPackerAsciiBuffer::packBinaryData: newline truncated: " << llendl;
+ LL_WARNS() << "LLDataPackerAsciiBuffer::packBinaryData: newline truncated: " << LL_ENDL;
}
mCurBufferp += numCopied;
}
@@ -734,7 +734,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryDataFixed(const U8 *value, S32 size, con
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
{
numCopied = getBufferSize()-getCurrentSize();
- llwarns << "LLDataPackerAsciiBuffer::packBinaryDataFixed: data truncated: " << llendl;
+ LL_WARNS() << "LLDataPackerAsciiBuffer::packBinaryDataFixed: data truncated: " << LL_ENDL;
bBufferFull = TRUE;
}
mCurBufferp += numCopied;
@@ -746,7 +746,7 @@ BOOL LLDataPackerAsciiBuffer::packBinaryDataFixed(const U8 *value, S32 size, con
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
{
numCopied = getBufferSize()-getCurrentSize();
- llwarns << "LLDataPackerAsciiBuffer::packBinaryDataFixed: newline truncated: " << llendl;
+ LL_WARNS() << "LLDataPackerAsciiBuffer::packBinaryDataFixed: newline truncated: " << LL_ENDL;
}
mCurBufferp += numCopied;
@@ -813,7 +813,7 @@ BOOL LLDataPackerAsciiBuffer::packU8(const U8 value, const char *name)
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
{
numCopied = getBufferSize()-getCurrentSize();
- llwarns << "LLDataPackerAsciiBuffer::packU8: val truncated: " << llendl;
+ LL_WARNS() << "LLDataPackerAsciiBuffer::packU8: val truncated: " << LL_ENDL;
}
mCurBufferp += numCopied;
@@ -860,7 +860,7 @@ BOOL LLDataPackerAsciiBuffer::packU16(const U16 value, const char *name)
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
{
numCopied = getBufferSize()-getCurrentSize();
- llwarns << "LLDataPackerAsciiBuffer::packU16: val truncated: " << llendl;
+ LL_WARNS() << "LLDataPackerAsciiBuffer::packU16: val truncated: " << LL_ENDL;
}
mCurBufferp += numCopied;
@@ -907,7 +907,7 @@ BOOL LLDataPackerAsciiBuffer::packU32(const U32 value, const char *name)
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
{
numCopied = getBufferSize()-getCurrentSize();
- llwarns << "LLDataPackerAsciiBuffer::packU32: val truncated: " << llendl;
+ LL_WARNS() << "LLDataPackerAsciiBuffer::packU32: val truncated: " << LL_ENDL;
}
mCurBufferp += numCopied;
@@ -951,7 +951,7 @@ BOOL LLDataPackerAsciiBuffer::packS32(const S32 value, const char *name)
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
{
numCopied = getBufferSize()-getCurrentSize();
- llwarns << "LLDataPackerAsciiBuffer::packS32: val truncated: " << llendl;
+ LL_WARNS() << "LLDataPackerAsciiBuffer::packS32: val truncated: " << LL_ENDL;
}
mCurBufferp += numCopied;
@@ -995,7 +995,7 @@ BOOL LLDataPackerAsciiBuffer::packF32(const F32 value, const char *name)
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
{
numCopied = getBufferSize()-getCurrentSize();
- llwarns << "LLDataPackerAsciiBuffer::packF32: val truncated: " << llendl;
+ LL_WARNS() << "LLDataPackerAsciiBuffer::packF32: val truncated: " << LL_ENDL;
}
mCurBufferp += numCopied;
@@ -1039,7 +1039,7 @@ BOOL LLDataPackerAsciiBuffer::packColor4(const LLColor4 &value, const char *name
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
{
numCopied = getBufferSize()-getCurrentSize();
- llwarns << "LLDataPackerAsciiBuffer::packColor4: truncated: " << llendl;
+ LL_WARNS() << "LLDataPackerAsciiBuffer::packColor4: truncated: " << LL_ENDL;
}
mCurBufferp += numCopied;
@@ -1082,7 +1082,7 @@ BOOL LLDataPackerAsciiBuffer::packColor4U(const LLColor4U &value, const char *na
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
{
numCopied = getBufferSize()-getCurrentSize();
- llwarns << "LLDataPackerAsciiBuffer::packColor4U: truncated: " << llendl;
+ LL_WARNS() << "LLDataPackerAsciiBuffer::packColor4U: truncated: " << LL_ENDL;
}
mCurBufferp += numCopied;
@@ -1132,7 +1132,7 @@ BOOL LLDataPackerAsciiBuffer::packVector2(const LLVector2 &value, const char *na
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
{
numCopied = getBufferSize()-getCurrentSize();
- llwarns << "LLDataPackerAsciiBuffer::packVector2: truncated: " << llendl;
+ LL_WARNS() << "LLDataPackerAsciiBuffer::packVector2: truncated: " << LL_ENDL;
}
mCurBufferp += numCopied;
@@ -1176,7 +1176,7 @@ BOOL LLDataPackerAsciiBuffer::packVector3(const LLVector3 &value, const char *na
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
{
numCopied = getBufferSize()-getCurrentSize();
- llwarns << "LLDataPackerAsciiBuffer::packVector3: truncated: " << llendl;
+ LL_WARNS() << "LLDataPackerAsciiBuffer::packVector3: truncated: " << LL_ENDL;
}
mCurBufferp += numCopied;
@@ -1219,7 +1219,7 @@ BOOL LLDataPackerAsciiBuffer::packVector4(const LLVector4 &value, const char *na
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
{
numCopied = getBufferSize()-getCurrentSize();
- llwarns << "LLDataPackerAsciiBuffer::packVector4: truncated: " << llendl;
+ LL_WARNS() << "LLDataPackerAsciiBuffer::packVector4: truncated: " << LL_ENDL;
}
mCurBufferp += numCopied;
@@ -1266,7 +1266,7 @@ BOOL LLDataPackerAsciiBuffer::packUUID(const LLUUID &value, const char *name)
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
{
numCopied = getBufferSize()-getCurrentSize();
- llwarns << "LLDataPackerAsciiBuffer::packUUID: truncated: " << llendl;
+ LL_WARNS() << "LLDataPackerAsciiBuffer::packUUID: truncated: " << LL_ENDL;
success = FALSE;
}
mCurBufferp += numCopied;
@@ -1292,7 +1292,7 @@ BOOL LLDataPackerAsciiBuffer::unpackUUID(LLUUID &value, const char *name)
void LLDataPackerAsciiBuffer::dump()
{
- llinfos << "Buffer: " << mBufferp << llendl;
+ LL_INFOS() << "Buffer: " << mBufferp << LL_ENDL;
}
void LLDataPackerAsciiBuffer::writeIndentedName(const char *name)
@@ -1318,7 +1318,7 @@ void LLDataPackerAsciiBuffer::writeIndentedName(const char *name)
if (numCopied < 0 || numCopied > getBufferSize()-getCurrentSize())
{
numCopied = getBufferSize()-getCurrentSize();
- llwarns << "LLDataPackerAsciiBuffer::writeIndentedName: truncated: " << llendl;
+ LL_WARNS() << "LLDataPackerAsciiBuffer::writeIndentedName: truncated: " << LL_ENDL;
}
mCurBufferp += numCopied;
@@ -1347,7 +1347,7 @@ BOOL LLDataPackerAsciiBuffer::getValueStr(const char *name, char *out_value, S32
if (strcmp(keyword, name))
{
- llwarns << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << llendl;
+ LL_WARNS() << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << LL_ENDL;
return FALSE;
}
}
@@ -1904,7 +1904,7 @@ BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 v
fpos_t last_pos;
if (0 != fgetpos(mFP, &last_pos)) // 0==success for fgetpos
{
- llwarns << "Data packer failed to fgetpos" << llendl;
+ LL_WARNS() << "Data packer failed to fgetpos" << LL_ENDL;
return FALSE;
}
@@ -1917,13 +1917,13 @@ BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 v
if (!keyword[0])
{
- llwarns << "Data packer could not get the keyword!" << llendl;
+ LL_WARNS() << "Data packer could not get the keyword!" << LL_ENDL;
fsetpos(mFP, &last_pos);
return FALSE;
}
if (strcmp(keyword, name))
{
- llwarns << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << llendl;
+ LL_WARNS() << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << LL_ENDL;
fsetpos(mFP, &last_pos);
return FALSE;
}
@@ -1941,12 +1941,12 @@ BOOL LLDataPackerAsciiFile::getValueStr(const char *name, char *out_value, S32 v
sscanf(buffer, "%511s %511[^\n]", keyword, value); /* Flawfinder: ignore */
if (!keyword[0])
{
- llwarns << "Data packer could not get the keyword!" << llendl;
+ LL_WARNS() << "Data packer could not get the keyword!" << LL_ENDL;
return FALSE;
}
if (strcmp(keyword, name))
{
- llwarns << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << llendl;
+ LL_WARNS() << "Data packer expecting keyword of type " << name << ", got " << keyword << " instead!" << LL_ENDL;
return FALSE;
}
diff --git a/indra/llmessage/lldatapacker.h b/indra/llmessage/lldatapacker.h
index b0a638c16e..5140f56c01 100755
--- a/indra/llmessage/lldatapacker.h
+++ b/indra/llmessage/lldatapacker.h
@@ -170,6 +170,7 @@ public:
S32 getBufferSize() const { return mBufferSize; }
const U8* getBuffer() const { return mBufferp; }
void reset() { mCurBufferp = mBufferp; mWriteEnabled = (mCurBufferp != NULL); }
+ void shift(S32 offset) { reset(); mCurBufferp += offset;}
void freeBuffer() { delete [] mBufferp; mBufferp = mCurBufferp = NULL; mBufferSize = 0; mWriteEnabled = FALSE; }
void assignBuffer(U8 *bufferp, S32 size)
{
@@ -199,8 +200,8 @@ inline BOOL LLDataPackerBinaryBuffer::verifyLength(const S32 data_size, const ch
{
if (mWriteEnabled && (mCurBufferp - mBufferp) > mBufferSize - data_size)
{
- llwarns << "Buffer overflow in BinaryBuffer length verify, field name " << name << "!" << llendl;
- llwarns << "Current pos: " << (int)(mCurBufferp - mBufferp) << " Buffer size: " << mBufferSize << " Data size: " << data_size << llendl;
+ LL_WARNS() << "Buffer overflow in BinaryBuffer length verify, field name " << name << "!" << LL_ENDL;
+ LL_WARNS() << "Current pos: " << (int)(mCurBufferp - mBufferp) << " Buffer size: " << mBufferSize << " Data size: " << data_size << LL_ENDL;
return FALSE;
}
@@ -320,8 +321,8 @@ inline BOOL LLDataPackerAsciiBuffer::verifyLength(const S32 data_size, const cha
{
if (mWriteEnabled && (mCurBufferp - mBufferp) > mBufferSize - data_size)
{
- llwarns << "Buffer overflow in AsciiBuffer length verify, field name " << name << "!" << llendl;
- llwarns << "Current pos: " << (int)(mCurBufferp - mBufferp) << " Buffer size: " << mBufferSize << " Data size: " << data_size << llendl;
+ LL_WARNS() << "Buffer overflow in AsciiBuffer length verify, field name " << name << "!" << LL_ENDL;
+ LL_WARNS() << "Current pos: " << (int)(mCurBufferp - mBufferp) << " Buffer size: " << mBufferSize << " Data size: " << data_size << LL_ENDL;
return FALSE;
}
diff --git a/indra/llmessage/lldispatcher.cpp b/indra/llmessage/lldispatcher.cpp
index b2dc414a68..c40fe0d389 100755
--- a/indra/llmessage/lldispatcher.cpp
+++ b/indra/llmessage/lldispatcher.cpp
@@ -29,6 +29,7 @@
#include "lldispatcher.h"
#include <algorithm>
+#include <iterator>
#include "llstl.h"
#include "message.h"
@@ -75,7 +76,7 @@ bool LLDispatcher::dispatch(
LLDispatchHandler* func = (*it).second;
return (*func)(this, name, invoice, strings);
}
- llwarns << "Unable to find handler for Generic message: " << name << llendl;
+ LL_WARNS() << "Unable to find handler for Generic message: " << name << LL_ENDL;
return false;
}
diff --git a/indra/llcommon/llextendedstatus.h b/indra/llmessage/llextendedstatus.h
index 8ce173d1ff..8ce173d1ff 100755
--- a/indra/llcommon/llextendedstatus.h
+++ b/indra/llmessage/llextendedstatus.h
diff --git a/indra/llmessage/llfiltersd2xmlrpc.cpp b/indra/llmessage/llfiltersd2xmlrpc.cpp
index e0ca056a5f..d3e195789b 100755
--- a/indra/llmessage/llfiltersd2xmlrpc.cpp
+++ b/indra/llmessage/llfiltersd2xmlrpc.cpp
@@ -80,6 +80,7 @@
#include "llbuffer.h"
#include "llbufferstream.h"
+#include "llfasttimer.h"
#include "llmemorystream.h"
#include "llsd.h"
#include "llsdserialize.h"
@@ -163,12 +164,12 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd)
case LLSD::TypeMap:
{
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(map) BEGIN" << llendl;
+ LL_INFOS() << "streamOut(map) BEGIN" << LL_ENDL;
#endif
ostr << "<struct>";
if(ostr.fail())
{
- llinfos << "STREAM FAILURE writing struct" << llendl;
+ LL_INFOS() << "STREAM FAILURE writing struct" << LL_ENDL;
}
LLSD::map_const_iterator it = sd.beginMap();
LLSD::map_const_iterator end = sd.endMap();
@@ -179,21 +180,21 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd)
streamOut(ostr, (*it).second);
if(ostr.fail())
{
- llinfos << "STREAM FAILURE writing '" << (*it).first
- << "' with sd type " << (*it).second.type() << llendl;
+ LL_INFOS() << "STREAM FAILURE writing '" << (*it).first
+ << "' with sd type " << (*it).second.type() << LL_ENDL;
}
ostr << "</member>";
}
ostr << "</struct>";
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(map) END" << llendl;
+ LL_INFOS() << "streamOut(map) END" << LL_ENDL;
#endif
break;
}
case LLSD::TypeArray:
{
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(array) BEGIN" << llendl;
+ LL_INFOS() << "streamOut(array) BEGIN" << LL_ENDL;
#endif
ostr << "<array><data>";
LLSD::array_const_iterator it = sd.beginArray();
@@ -203,12 +204,12 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd)
streamOut(ostr, *it);
if(ostr.fail())
{
- llinfos << "STREAM FAILURE writing array element sd type "
- << (*it).type() << llendl;
+ LL_INFOS() << "STREAM FAILURE writing array element sd type "
+ << (*it).type() << LL_ENDL;
}
}
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(array) END" << llendl;
+ LL_INFOS() << "streamOut(array) END" << LL_ENDL;
#endif
ostr << "</data></array>";
break;
@@ -217,31 +218,31 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd)
// treat undefined as a bool with a false value.
case LLSD::TypeBoolean:
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(bool)" << llendl;
+ LL_INFOS() << "streamOut(bool)" << LL_ENDL;
#endif
ostr << "<boolean>" << (sd.asBoolean() ? "1" : "0") << "</boolean>";
break;
case LLSD::TypeInteger:
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(int)" << llendl;
+ LL_INFOS() << "streamOut(int)" << LL_ENDL;
#endif
ostr << "<i4>" << sd.asInteger() << "</i4>";
break;
case LLSD::TypeReal:
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(real)" << llendl;
+ LL_INFOS() << "streamOut(real)" << LL_ENDL;
#endif
ostr << "<double>" << sd.asReal() << "</double>";
break;
case LLSD::TypeString:
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(string)" << llendl;
+ LL_INFOS() << "streamOut(string)" << LL_ENDL;
#endif
ostr << "<string>" << xml_escape_string(sd.asString()) << "</string>";
break;
case LLSD::TypeUUID:
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(uuid)" << llendl;
+ LL_INFOS() << "streamOut(uuid)" << LL_ENDL;
#endif
// serialize it as a string
ostr << "<string>" << sd.asString() << "</string>";
@@ -249,7 +250,7 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd)
case LLSD::TypeURI:
{
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(uri)" << llendl;
+ LL_INFOS() << "streamOut(uri)" << LL_ENDL;
#endif
// serialize it as a string
ostr << "<string>" << xml_escape_string(sd.asString()) << "</string>";
@@ -258,7 +259,7 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd)
case LLSD::TypeBinary:
{
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(binary)" << llendl;
+ LL_INFOS() << "streamOut(binary)" << LL_ENDL;
#endif
// this is pretty inefficient, but we'll deal with that
// problem when it becomes one.
@@ -281,15 +282,15 @@ void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd)
}
case LLSD::TypeDate:
#if LL_SPEW_STREAM_OUT_DEBUGGING
- llinfos << "streamOut(date)" << llendl;
+ LL_INFOS() << "streamOut(date)" << LL_ENDL;
#endif
// no need to escape this since it will be alpha-numeric.
ostr << "<dateTime.iso8601>" << sd.asString() << "</dateTime.iso8601>";
break;
default:
// unhandled type
- llwarns << "Unhandled structured data type: " << sd.type()
- << llendl;
+ LL_WARNS() << "Unhandled structured data type: " << sd.type()
+ << LL_ENDL;
break;
}
ostr << "</value>";
@@ -308,7 +309,7 @@ LLFilterSD2XMLRPCResponse::~LLFilterSD2XMLRPCResponse()
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_SD2XMLRPC_RESPONSE("SD2XMLRPC Response");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_SD2XMLRPC_RESPONSE("SD2XMLRPC Response");
// virtual
LLIOPipe::EStatus LLFilterSD2XMLRPCResponse::process_impl(
const LLChannelDescriptors& channels,
@@ -317,7 +318,7 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCResponse::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_PROCESS_SD2XMLRPC_RESPONSE);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_SD2XMLRPC_RESPONSE);
PUMP_DEBUG;
// This pipe does not work if it does not have everyting. This
@@ -360,7 +361,7 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCResponse::process_impl(
}
else
{
- llwarns << "Unable to determine the type of LLSD response." << llendl;
+ LL_WARNS() << "Unable to determine the type of LLSD response." << LL_ENDL;
}
PUMP_DEBUG;
return rv;
@@ -385,7 +386,7 @@ LLFilterSD2XMLRPCRequest::~LLFilterSD2XMLRPCRequest()
{
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_SD2XMLRPC_REQUEST("S22XMLRPC Request");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_SD2XMLRPC_REQUEST("S22XMLRPC Request");
// virtual
LLIOPipe::EStatus LLFilterSD2XMLRPCRequest::process_impl(
@@ -395,14 +396,14 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCRequest::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_PROCESS_SD2XMLRPC_REQUEST);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_SD2XMLRPC_REQUEST);
// This pipe does not work if it does not have everyting. This
// could be addressed by making a stream parser for llsd which
// handled partial information.
PUMP_DEBUG;
if(!eos)
{
- llinfos << "!eos" << llendl;
+ LL_INFOS() << "!eos" << LL_ENDL;
return STATUS_BREAK;
}
@@ -412,7 +413,7 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCRequest::process_impl(
LLSDSerialize::fromNotation(sd, stream, buffer->count(channels.in()));
if(stream.fail())
{
- llinfos << "STREAM FAILURE reading structure data." << llendl;
+ LL_INFOS() << "STREAM FAILURE reading structure data." << LL_ENDL;
}
PUMP_DEBUG;
@@ -434,7 +435,7 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCRequest::process_impl(
}
if(method.empty())
{
- llwarns << "SD -> XML Request no method found." << llendl;
+ LL_WARNS() << "SD -> XML Request no method found." << LL_ENDL;
return STATUS_ERROR;
}
@@ -445,13 +446,13 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCRequest::process_impl(
ostream.precision(DEFAULT_PRECISION);
if(ostream.fail())
{
- llinfos << "STREAM FAILURE setting precision" << llendl;
+ LL_INFOS() << "STREAM FAILURE setting precision" << LL_ENDL;
}
ostream << XML_HEADER << XMLRPC_REQUEST_HEADER_1
<< xml_escape_string(method) << XMLRPC_REQUEST_HEADER_2;
if(ostream.fail())
{
- llinfos << "STREAM FAILURE writing method headers" << llendl;
+ LL_INFOS() << "STREAM FAILURE writing method headers" << LL_ENDL;
}
switch(param_sd.type())
{
@@ -518,7 +519,7 @@ LLIOPipe::EStatus stream_out(std::ostream& ostr, XMLRPC_VALUE value)
break;
}
case xmlrpc_type_boolean:
- //lldebugs << "stream_out() bool" << llendl;
+ //LL_DEBUGS() << "stream_out() bool" << LL_ENDL;
ostr << " " << (XMLRPC_GetValueBoolean(value) ? "true" : "false");
break;
case xmlrpc_type_datetime:
@@ -526,23 +527,23 @@ LLIOPipe::EStatus stream_out(std::ostream& ostr, XMLRPC_VALUE value)
break;
case xmlrpc_type_double:
ostr << " r" << XMLRPC_GetValueDouble(value);
- //lldebugs << "stream_out() double" << XMLRPC_GetValueDouble(value)
- // << llendl;
+ //LL_DEBUGS() << "stream_out() double" << XMLRPC_GetValueDouble(value)
+ // << LL_ENDL;
break;
case xmlrpc_type_int:
ostr << " i" << XMLRPC_GetValueInt(value);
- //lldebugs << "stream_out() integer:" << XMLRPC_GetValueInt(value)
- // << llendl;
+ //LL_DEBUGS() << "stream_out() integer:" << XMLRPC_GetValueInt(value)
+ // << LL_ENDL;
break;
case xmlrpc_type_string:
- //lldebugs << "stream_out() string: " << str << llendl;
+ //LL_DEBUGS() << "stream_out() string: " << str << LL_ENDL;
ostr << " s(" << XMLRPC_GetValueStringLen(value) << ")'"
<< XMLRPC_GetValueString(value) << "'";
break;
case xmlrpc_type_array: // vector
case xmlrpc_type_mixed: // vector
{
- //lldebugs << "stream_out() array" << llendl;
+ //LL_DEBUGS() << "stream_out() array" << LL_ENDL;
ostr << " [";
U32 needs_comma = 0;
XMLRPC_VALUE current = XMLRPC_VectorRewind(value);
@@ -557,7 +558,7 @@ LLIOPipe::EStatus stream_out(std::ostream& ostr, XMLRPC_VALUE value)
}
case xmlrpc_type_struct: // still vector
{
- //lldebugs << "stream_out() struct" << llendl;
+ //LL_DEBUGS() << "stream_out() struct" << LL_ENDL;
ostr << " {";
std::string name;
U32 needs_comma = 0;
@@ -577,7 +578,7 @@ LLIOPipe::EStatus stream_out(std::ostream& ostr, XMLRPC_VALUE value)
case xmlrpc_type_none:
default:
status = LLIOPipe::STATUS_ERROR;
- llwarns << "Found an empty xmlrpc type.." << llendl;
+ LL_WARNS() << "Found an empty xmlrpc type.." << LL_ENDL;
// not much we can do here...
break;
};
@@ -592,7 +593,7 @@ LLFilterXMLRPCResponse2LLSD::~LLFilterXMLRPCResponse2LLSD()
{
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_XMLRPC2LLSD_RESPONSE("XMLRPC2LLSD Response");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_XMLRPC2LLSD_RESPONSE("XMLRPC2LLSD Response");
LLIOPipe::EStatus LLFilterXMLRPCResponse2LLSD::process_impl(
const LLChannelDescriptors& channels,
@@ -601,7 +602,7 @@ LLIOPipe::EStatus LLFilterXMLRPCResponse2LLSD::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_PROCESS_XMLRPC2LLSD_RESPONSE);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_XMLRPC2LLSD_RESPONSE);
PUMP_DEBUG;
if(!eos) return STATUS_BREAK;
@@ -617,7 +618,7 @@ LLIOPipe::EStatus LLFilterXMLRPCResponse2LLSD::process_impl(
buf[bytes] = '\0';
buffer->readAfter(channels.in(), NULL, (U8*)buf, bytes);
- //lldebugs << "xmlrpc response: " << buf << llendl;
+ //LL_DEBUGS() << "xmlrpc response: " << buf << LL_ENDL;
PUMP_DEBUG;
XMLRPC_REQUEST response = XMLRPC_REQUEST_FromXML(
@@ -626,7 +627,7 @@ LLIOPipe::EStatus LLFilterXMLRPCResponse2LLSD::process_impl(
NULL);
if(!response)
{
- llwarns << "XML -> SD Response unable to parse xml." << llendl;
+ LL_WARNS() << "XML -> SD Response unable to parse xml." << LL_ENDL;
delete[] buf;
return STATUS_ERROR;
}
@@ -678,7 +679,7 @@ LLFilterXMLRPCRequest2LLSD::~LLFilterXMLRPCRequest2LLSD()
{
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_XMLRPC2LLSD_REQUEST("XMLRPC2LLSD Request");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_XMLRPC2LLSD_REQUEST("XMLRPC2LLSD Request");
LLIOPipe::EStatus LLFilterXMLRPCRequest2LLSD::process_impl(
const LLChannelDescriptors& channels,
buffer_ptr_t& buffer,
@@ -686,7 +687,7 @@ LLIOPipe::EStatus LLFilterXMLRPCRequest2LLSD::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_PROCESS_XMLRPC2LLSD_REQUEST);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_XMLRPC2LLSD_REQUEST);
PUMP_DEBUG;
if(!eos) return STATUS_BREAK;
if(!buffer) return STATUS_ERROR;
@@ -701,7 +702,7 @@ LLIOPipe::EStatus LLFilterXMLRPCRequest2LLSD::process_impl(
buf[bytes] = '\0';
buffer->readAfter(channels.in(), NULL, (U8*)buf, bytes);
- //lldebugs << "xmlrpc request: " << buf << llendl;
+ //LL_DEBUGS() << "xmlrpc request: " << buf << LL_ENDL;
// Check the value in the buffer. XMLRPC_REQUEST_FromXML will report a error code 4 if
// values that are less than 0x20 are passed to it, except
@@ -728,7 +729,7 @@ LLIOPipe::EStatus LLFilterXMLRPCRequest2LLSD::process_impl(
NULL);
if(!request)
{
- llwarns << "XML -> SD Request process parse error." << llendl;
+ LL_WARNS() << "XML -> SD Request process parse error." << LL_ENDL;
delete[] buf;
return STATUS_ERROR;
}
diff --git a/indra/llmessage/llhost.cpp b/indra/llmessage/llhost.cpp
index 61a84de8e3..63c15f0d5e 100755
--- a/indra/llmessage/llhost.cpp
+++ b/indra/llmessage/llhost.cpp
@@ -84,18 +84,18 @@ std::string LLHost::getHostName() const
hostent* he;
if (INVALID_HOST_IP_ADDRESS == mIP)
{
- llwarns << "LLHost::getHostName() : Invalid IP address" << llendl;
+ LL_WARNS() << "LLHost::getHostName() : Invalid IP address" << LL_ENDL;
return std::string();
}
he = gethostbyaddr((char *)&mIP, sizeof(mIP), AF_INET);
if (!he)
{
#if LL_WINDOWS
- llwarns << "LLHost::getHostName() : Couldn't find host name for address " << mIP << ", Error: "
- << WSAGetLastError() << llendl;
+ LL_WARNS() << "LLHost::getHostName() : Couldn't find host name for address " << mIP << ", Error: "
+ << WSAGetLastError() << LL_ENDL;
#else
- llwarns << "LLHost::getHostName() : Couldn't find host name for address " << mIP << ", Error: "
- << h_errno << llendl;
+ LL_WARNS() << "LLHost::getHostName() : Couldn't find host name for address " << mIP << ", Error: "
+ << h_errno << LL_ENDL;
#endif
return std::string();
}
@@ -136,17 +136,17 @@ BOOL LLHost::setHostByName(const std::string& hostname)
switch(error_number)
{
case TRY_AGAIN: // XXX how to handle this case?
- llwarns << "LLHost::setAddress(): try again" << llendl;
+ LL_WARNS() << "LLHost::setAddress(): try again" << LL_ENDL;
break;
case HOST_NOT_FOUND:
case NO_ADDRESS: // NO_DATA
- llwarns << "LLHost::setAddress(): host not found" << llendl;
+ LL_WARNS() << "LLHost::setAddress(): host not found" << LL_ENDL;
break;
case NO_RECOVERY:
- llwarns << "LLHost::setAddress(): unrecoverable error" << llendl;
+ LL_WARNS() << "LLHost::setAddress(): unrecoverable error" << LL_ENDL;
break;
default:
- llwarns << "LLHost::setAddress(): unknown error - " << error_number << llendl;
+ LL_WARNS() << "LLHost::setAddress(): unknown error - " << error_number << LL_ENDL;
break;
}
return FALSE;
diff --git a/indra/llmessage/llhttpassetstorage.cpp b/indra/llmessage/llhttpassetstorage.cpp
index 7dcf160c9b..a30140e8f3 100755
--- a/indra/llmessage/llhttpassetstorage.cpp
+++ b/indra/llmessage/llhttpassetstorage.cpp
@@ -36,13 +36,16 @@
#include "llproxy.h"
#include "llvfile.h"
#include "llvfs.h"
+#include "llxfer.h"
-#ifdef LL_STANDALONE
+#ifdef LL_USESYSTEMLIBS
# include <zlib.h>
#else
# include "zlib/zlib.h"
#endif
+const char* const LOCAL_ASSET_URL_FORMAT = "http://%s:12041/asset";
+
const U32 MAX_RUNNING_REQUESTS = 1;
const F32 MAX_PROCESSING_TIME = 0.005f;
const S32 CURL_XFER_BUFFER_SIZE = 65536;
@@ -51,13 +54,6 @@ const F32 GET_URL_TO_FILE_TIMEOUT = 1800.0f;
const S32 COMPRESSED_INPUT_BUFFER_SIZE = 4096;
-const S32 HTTP_OK = 200;
-const S32 HTTP_PUT_OK = 201;
-const S32 HTTP_NO_CONTENT = 204;
-const S32 HTTP_MISSING = 404;
-const S32 HTTP_SERVER_BAD_GATEWAY = 502;
-const S32 HTTP_SERVER_TEMP_UNAVAILABLE = 503;
-
/////////////////////////////////////////////////////////////////////////////////
// LLTempAssetData
// An asset not stored on central asset store, but on a simulator node somewhere.
@@ -273,7 +269,7 @@ void LLHTTPAssetRequest::setupCurlHandle()
}
else
{
- llerrs << "LLHTTPAssetRequest::setupCurlHandle - No asset storage associated with this request!" << llendl;
+ LL_ERRS() << "LLHTTPAssetRequest::setupCurlHandle - No asset storage associated with this request!" << LL_ENDL;
}
}
@@ -287,7 +283,7 @@ void LLHTTPAssetRequest::cleanupCurlHandle()
}
else
{
- llerrs << "LLHTTPAssetRequest::~LLHTTPAssetRequest - No asset storage associated with this request!" << llendl;
+ LL_ERRS() << "LLHTTPAssetRequest::~LLHTTPAssetRequest - No asset storage associated with this request!" << LL_ENDL;
}
mCurlHandle = NULL;
}
@@ -309,7 +305,7 @@ void LLHTTPAssetRequest::prepareCompressedUpload()
if (r != Z_OK)
{
- llerrs << "LLHTTPAssetRequest::prepareCompressedUpload defalateInit2() failed" << llendl;
+ LL_ERRS() << "LLHTTPAssetRequest::prepareCompressedUpload defalateInit2() failed" << LL_ENDL;
}
mZInitialized = true;
@@ -324,10 +320,10 @@ void LLHTTPAssetRequest::finishCompressedUpload()
{
if (mZInitialized)
{
- llinfos << "LLHTTPAssetRequest::finishCompressedUpload: "
+ LL_INFOS() << "LLHTTPAssetRequest::finishCompressedUpload: "
<< "read " << mZStream.total_in << " byte asset file, "
<< "uploaded " << mZStream.total_out << " byte compressed asset"
- << llendl;
+ << LL_ENDL;
deflateEnd(&mZStream);
delete[] mZInputBuffer;
@@ -365,8 +361,8 @@ size_t LLHTTPAssetRequest::readCompressedData(void* data, size_t size)
{
if (r < 0)
{
- llwarns << "LLHTTPAssetRequest::readCompressedData: deflate returned error code "
- << (S32) r << llendl;
+ LL_WARNS() << "LLHTTPAssetRequest::readCompressedData: deflate returned error code "
+ << (S32) r << LL_ENDL;
}
break;
}
@@ -453,7 +449,7 @@ void LLHTTPAssetStorage::storeAssetData(
bool store_local,
const LLUUID& requesting_agent_id,
bool user_waiting,
- F64 timeout)
+ F64Seconds timeout)
{
if (mVFS->getExists(uuid, type)) // VFS treats nonexistant and zero-length identically
{
@@ -493,7 +489,7 @@ void LLHTTPAssetStorage::storeAssetData(
}
else
{
- llwarns << "AssetStorage: attempt to upload non-existent vfile " << uuid << ":" << LLAssetType::lookup(type) << llendl;
+ LL_WARNS() << "AssetStorage: attempt to upload non-existent vfile " << uuid << ":" << LLAssetType::lookup(type) << LL_ENDL;
if (callback)
{
// LLAssetStorage metric: Zero size VFS
@@ -513,9 +509,9 @@ void LLHTTPAssetStorage::storeAssetData(
bool temp_file,
bool is_priority,
bool user_waiting,
- F64 timeout)
+ F64Seconds timeout)
{
- llinfos << "LLAssetStorage::storeAssetData (legacy)" << asset_id << ":" << LLAssetType::lookup(asset_type) << llendl;
+ LL_INFOS() << "LLAssetStorage::storeAssetData (legacy)" << asset_id << ":" << LLAssetType::lookup(asset_type) << LL_ENDL;
LLLegacyAssetRequest *legacy = new LLLegacyAssetRequest;
@@ -685,15 +681,15 @@ bool LLHTTPAssetStorage::deletePendingRequest(LLAssetStorage::ERequestType rt,
}
- llinfos << "Asset " << getRequestName(rt) << " request for "
+ LL_INFOS() << "Asset " << getRequestName(rt) << " request for "
<< asset_id << "." << LLAssetType::lookup(asset_type)
<< " removed from curl and placed at the end of the pending queue."
- << llendl;
+ << LL_ENDL;
}
else
{
- llwarns << "Unable to find pending " << getRequestName(rt) << " request for "
- << asset_id << "." << LLAssetType::lookup(asset_type) << llendl;
+ LL_WARNS() << "Unable to find pending " << getRequestName(rt) << " request for "
+ << asset_id << "." << LLAssetType::lookup(asset_type) << LL_ENDL;
}
}
delete req;
@@ -800,7 +796,7 @@ void LLHTTPAssetStorage::checkForTimeouts()
}
else
{
- llinfos << "Requesting " << new_req->mURLBuffer << llendl;
+ LL_INFOS() << "Requesting " << new_req->mURLBuffer << LL_ENDL;
}
}
@@ -864,10 +860,10 @@ void LLHTTPAssetStorage::checkForTimeouts()
// Get the uncompressed file size.
LLVFile file(mVFS,new_req->getUUID(),new_req->getType());
S32 size = file.getSize();
- llinfos << "Requesting PUT " << new_req->mURLBuffer << ", asset size: " << size << " bytes" << llendl;
+ LL_INFOS() << "Requesting PUT " << new_req->mURLBuffer << ", asset size: " << size << " bytes" << LL_ENDL;
if (size == 0)
{
- llwarns << "Rejecting zero size PUT request!" << llendl;
+ LL_WARNS() << "Rejecting zero size PUT request!" << LL_ENDL;
new_req->cleanupCurlHandle();
deletePendingRequest(RT_UPLOAD, new_req->getType(), new_req->getUUID());
}
@@ -913,12 +909,12 @@ void LLHTTPAssetStorage::checkForTimeouts()
// Get the uncompressed file size.
S32 size = file.getSize();
- llinfos << "TAT: LLHTTPAssetStorage::checkForTimeouts() : pending local!"
- << " Requesting PUT " << new_req->mURLBuffer << ", asset size: " << size << " bytes" << llendl;
+ LL_INFOS() << "TAT: LLHTTPAssetStorage::checkForTimeouts() : pending local!"
+ << " Requesting PUT " << new_req->mURLBuffer << ", asset size: " << size << " bytes" << LL_ENDL;
if (size == 0)
{
- llwarns << "Rejecting zero size PUT request!" << llendl;
+ LL_WARNS() << "Rejecting zero size PUT request!" << LL_ENDL;
new_req->cleanupCurlHandle();
deletePendingRequest(RT_UPLOAD, new_req->getType(), new_req->getUUID());
}
@@ -952,10 +948,10 @@ void LLHTTPAssetStorage::checkForTimeouts()
{
if (curl_msg->data.result == CURLE_OK &&
( curl_result == HTTP_OK
- || curl_result == HTTP_PUT_OK
+ || curl_result == HTTP_CREATED
|| curl_result == HTTP_NO_CONTENT))
{
- llinfos << "Success uploading " << req->getUUID() << " to " << req->mURLBuffer << llendl;
+ LL_INFOS() << "Success uploading " << req->getUUID() << " to " << req->mURLBuffer << LL_ENDL;
if (RT_LOCALUPLOAD == req->mRequestType)
{
addTempAssetData(req->getUUID(), req->mRequestingAgentID, mHostName);
@@ -963,11 +959,11 @@ void LLHTTPAssetStorage::checkForTimeouts()
}
else if (curl_msg->data.result == CURLE_COULDNT_CONNECT ||
curl_msg->data.result == CURLE_OPERATION_TIMEOUTED ||
- curl_result == HTTP_SERVER_BAD_GATEWAY ||
- curl_result == HTTP_SERVER_TEMP_UNAVAILABLE)
+ curl_result == HTTP_BAD_GATEWAY ||
+ curl_result == HTTP_SERVICE_UNAVAILABLE)
{
- llwarns << "Re-requesting upload for " << req->getUUID() << ". Received upload error to " << req->mURLBuffer <<
- " with result " << curl_easy_strerror(curl_msg->data.result) << ", http result " << curl_result << llendl;
+ LL_WARNS() << "Re-requesting upload for " << req->getUUID() << ". Received upload error to " << req->mURLBuffer <<
+ " with result " << curl_easy_strerror(curl_msg->data.result) << ", http result " << curl_result << LL_ENDL;
////HACK (probably) I am sick of this getting requeued and driving me mad.
//if (req->mIsUserWaiting)
@@ -977,16 +973,16 @@ void LLHTTPAssetStorage::checkForTimeouts()
}
else
{
- llwarns << "Failure uploading " << req->getUUID() << " to " << req->mURLBuffer <<
- " with result " << curl_easy_strerror(curl_msg->data.result) << ", http result " << curl_result << llendl;
+ LL_WARNS() << "Failure uploading " << req->getUUID() << " to " << req->mURLBuffer <<
+ " with result " << curl_easy_strerror(curl_msg->data.result) << ", http result " << curl_result << LL_ENDL;
xfer_result = LL_ERR_ASSET_REQUEST_FAILED;
}
if (!(curl_msg->data.result == CURLE_COULDNT_CONNECT ||
curl_msg->data.result == CURLE_OPERATION_TIMEOUTED ||
- curl_result == HTTP_SERVER_BAD_GATEWAY ||
- curl_result == HTTP_SERVER_TEMP_UNAVAILABLE))
+ curl_result == HTTP_BAD_GATEWAY ||
+ curl_result == HTTP_SERVICE_UNAVAILABLE))
{
// shared upload finished callback
// in the base class, this is called from processUploadComplete
@@ -1000,7 +996,7 @@ void LLHTTPAssetStorage::checkForTimeouts()
{
if (req->mVFile && req->mVFile->getSize() > 0)
{
- llinfos << "Success downloading " << req->mURLBuffer << ", size " << req->mVFile->getSize() << llendl;
+ LL_INFOS() << "Success downloading " << req->mURLBuffer << ", size " << req->mVFile->getSize() << LL_ENDL;
req->mVFile->rename(req->getUUID(), req->getType());
}
@@ -1008,17 +1004,17 @@ void LLHTTPAssetStorage::checkForTimeouts()
{
// *TODO: if this actually indicates a bad asset on the server
// (not certain at this point), then delete it
- llwarns << "Found " << req->mURLBuffer << " to be zero size" << llendl;
+ LL_WARNS() << "Found " << req->mURLBuffer << " to be zero size" << LL_ENDL;
xfer_result = LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE;
}
}
else
{
// KLW - TAT See if an avatar owns this texture, and if so request re-upload.
- llwarns << "Failure downloading " << req->mURLBuffer <<
- " with result " << curl_easy_strerror(curl_msg->data.result) << ", http result " << curl_result << llendl;
+ LL_WARNS() << "Failure downloading " << req->mURLBuffer <<
+ " with result " << curl_easy_strerror(curl_msg->data.result) << ", http result " << curl_result << LL_ENDL;
- xfer_result = (curl_result == HTTP_MISSING) ? LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE : LL_ERR_ASSET_REQUEST_FAILED;
+ xfer_result = (curl_result == HTTP_NOT_FOUND) ? LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE : LL_ERR_ASSET_REQUEST_FAILED;
if (req->mVFile)
{
@@ -1061,7 +1057,7 @@ void LLHTTPAssetStorage::bumpTimedOutUploads()
{
bool user_waiting=FALSE;
- F64 mt_secs = LLMessageSystem::getMessageTimeSeconds();
+ F64Seconds mt_secs = LLMessageSystem::getMessageTimeSeconds();
if (mPendingUploads.size())
{
@@ -1088,10 +1084,10 @@ void LLHTTPAssetStorage::bumpTimedOutUploads()
if ( req->mTimeout < (mt_secs - req->mTime) )
{
- llwarns << "Asset upload request timed out for "
+ LL_WARNS() << "Asset upload request timed out for "
<< req->getUUID() << "."
<< LLAssetType::lookup(req->getType())
- << ", bumping to the back of the line!" << llendl;
+ << ", bumping to the back of the line!" << LL_ENDL;
deletePendingRequest(RT_UPLOAD, req->getType(), req->getUUID());
}
@@ -1103,7 +1099,7 @@ size_t LLHTTPAssetStorage::curlDownCallback(void *data, size_t size, size_t nmem
{
if (!gAssetStorage)
{
- llwarns << "Missing gAssetStorage, aborting curl download callback!" << llendl;
+ LL_WARNS() << "Missing gAssetStorage, aborting curl download callback!" << LL_ENDL;
return 0;
}
S32 bytes = (S32)(size * nmemb);
@@ -1133,7 +1129,7 @@ size_t LLHTTPAssetStorage::curlUpCallback(void *data, size_t size, size_t nmemb,
{
if (!gAssetStorage)
{
- llwarns << "Missing gAssetStorage, aborting curl download callback!" << llendl;
+ LL_WARNS() << "Missing gAssetStorage, aborting curl download callback!" << LL_ENDL;
return 0;
}
CURL *curl_handle = (CURL *)user_data;
@@ -1168,12 +1164,12 @@ S32 LLHTTPAssetStorage::getURLToFile(const LLUUID& uuid, LLAssetType::EType asse
{
// *NOTE: There is no guarantee that the uuid and the asset_type match
// - not that it matters. - Doug
- lldebugs << "LLHTTPAssetStorage::getURLToFile() - " << url << llendl;
+ LL_DEBUGS() << "LLHTTPAssetStorage::getURLToFile() - " << url << LL_ENDL;
FILE *fp = LLFile::fopen(filename, "wb"); /*Flawfinder: ignore*/
if (! fp)
{
- llwarns << "Failed to open " << filename << " for writing" << llendl;
+ LL_WARNS() << "Failed to open " << filename << " for writing" << LL_ENDL;
return LL_ERR_ASSET_REQUEST_FAILED;
}
@@ -1187,7 +1183,7 @@ S32 LLHTTPAssetStorage::getURLToFile(const LLUUID& uuid, LLAssetType::EType asse
curl_easy_setopt(req.mCurlHandle, CURLOPT_WRITEDATA, req.mCurlHandle);
curl_multi_add_handle(mCurlMultiHandle, req.mCurlHandle);
- llinfos << "Requesting as file " << req.mURLBuffer << llendl;
+ LL_INFOS() << "Requesting as file " << req.mURLBuffer << LL_ENDL;
// braindead curl loop
int queue_length;
@@ -1212,7 +1208,7 @@ S32 LLHTTPAssetStorage::getURLToFile(const LLUUID& uuid, LLAssetType::EType asse
}
else if (timeout.hasExpired())
{
- llwarns << "Request for " << url << " has timed out." << llendl;
+ LL_WARNS() << "Request for " << url << " has timed out." << LL_ENDL;
success = false;
xfer_result = LL_ERR_ASSET_REQUEST_FAILED;
break;
@@ -1230,19 +1226,19 @@ S32 LLHTTPAssetStorage::getURLToFile(const LLUUID& uuid, LLAssetType::EType asse
if (size > 0)
{
// everything seems to be in order
- llinfos << "Success downloading " << req.mURLBuffer << " to file, size " << size << llendl;
+ LL_INFOS() << "Success downloading " << req.mURLBuffer << " to file, size " << size << LL_ENDL;
}
else
{
- llwarns << "Found " << req.mURLBuffer << " to be zero size" << llendl;
+ LL_WARNS() << "Found " << req.mURLBuffer << " to be zero size" << LL_ENDL;
xfer_result = LL_ERR_ASSET_REQUEST_FAILED;
}
}
else
{
- xfer_result = curl_result == HTTP_MISSING ? LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE : LL_ERR_ASSET_REQUEST_FAILED;
- llinfos << "Failure downloading " << req.mURLBuffer <<
- " with result " << curl_easy_strerror(curl_msg->data.result) << ", http result " << curl_result << llendl;
+ xfer_result = curl_result == HTTP_NOT_FOUND ? LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE : LL_ERR_ASSET_REQUEST_FAILED;
+ LL_INFOS() << "Failure downloading " << req.mURLBuffer <<
+ " with result " << curl_easy_strerror(curl_msg->data.result) << ", http result " << curl_result << LL_ENDL;
}
}
@@ -1264,7 +1260,7 @@ size_t LLHTTPAssetStorage::curlFileDownCallback(void *data, size_t size, size_t
if (! req->mFP)
{
- llwarns << "Missing mFP, aborting curl file download callback!" << llendl;
+ LL_WARNS() << "Missing mFP, aborting curl file download callback!" << LL_ENDL;
return 0;
}
@@ -1311,7 +1307,7 @@ void LLHTTPAssetStorage::addRunningRequest(ERequestType rt, LLHTTPAssetRequest*
}
else
{
- llerrs << "LLHTTPAssetStorage::addRunningRequest - Request is not an upload OR download, this is bad!" << llendl;
+ LL_ERRS() << "LLHTTPAssetStorage::addRunningRequest - Request is not an upload OR download, this is bad!" << LL_ENDL;
}
}
@@ -1324,7 +1320,7 @@ void LLHTTPAssetStorage::removeRunningRequest(ERequestType rt, LLHTTPAssetReques
}
else
{
- llerrs << "LLHTTPAssetStorage::removeRunningRequest - Destroyed request is not an upload OR download, this is bad!" << llendl;
+ LL_ERRS() << "LLHTTPAssetStorage::removeRunningRequest - Destroyed request is not an upload OR download, this is bad!" << LL_ENDL;
}
}
@@ -1333,7 +1329,7 @@ void LLHTTPAssetStorage::addTempAssetData(const LLUUID& asset_id, const LLUUID&
{
if (agent_id.isNull() || asset_id.isNull())
{
- llwarns << "TAT: addTempAssetData bad id's asset_id: " << asset_id << " agent_id: " << agent_id << llendl;
+ LL_WARNS() << "TAT: addTempAssetData bad id's asset_id: " << asset_id << " agent_id: " << agent_id << LL_ENDL;
return;
}
@@ -1434,26 +1430,26 @@ void LLHTTPAssetStorage::dumpTempAssetData(const LLUUID& avatar_id) const
if (avatar_id.isNull()
|| avatar_id == temp_asset_data.mAgentID)
{
- llinfos << "TAT: dump agent " << temp_asset_data.mAgentID
+ LL_INFOS() << "TAT: dump agent " << temp_asset_data.mAgentID
<< " texture " << temp_asset_data.mAssetID
<< " host " << temp_asset_data.mHostName
- << llendl;
+ << LL_ENDL;
count++;
}
}
if (avatar_id.isNull())
{
- llinfos << "TAT: dumped " << count << " entries for all avatars" << llendl;
+ LL_INFOS() << "TAT: dumped " << count << " entries for all avatars" << LL_ENDL;
}
else
{
- llinfos << "TAT: dumped " << count << " entries for avatar " << avatar_id << llendl;
+ LL_INFOS() << "TAT: dumped " << count << " entries for avatar " << avatar_id << LL_ENDL;
}
}
void LLHTTPAssetStorage::clearTempAssetData()
{
- llinfos << "TAT: Clearing temp asset data map" << llendl;
+ LL_INFOS() << "TAT: Clearing temp asset data map" << LL_ENDL;
mTempAssets.clear();
}
diff --git a/indra/llmessage/llhttpassetstorage.h b/indra/llmessage/llhttpassetstorage.h
index f743ccf0ac..783e95cac6 100755
--- a/indra/llmessage/llhttpassetstorage.h
+++ b/indra/llmessage/llhttpassetstorage.h
@@ -69,7 +69,7 @@ public:
bool store_local = false,
const LLUUID& requesting_agent_id = LLUUID::null,
bool user_waiting=FALSE,
- F64 timeout=LL_ASSET_STORAGE_TIMEOUT);
+ F64Seconds timeout=LL_ASSET_STORAGE_TIMEOUT);
virtual void storeAssetData(
const std::string& filename,
@@ -80,7 +80,7 @@ public:
bool temp_file,
bool is_priority,
bool user_waiting=FALSE,
- F64 timeout=LL_ASSET_STORAGE_TIMEOUT);
+ F64Seconds timeout=LL_ASSET_STORAGE_TIMEOUT);
virtual LLSD getPendingDetails(ERequestType rt,
LLAssetType::EType asset_type,
diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp
index 11648717ad..200116337d 100755
--- a/indra/llmessage/llhttpclient.cpp
+++ b/indra/llmessage/llhttpclient.cpp
@@ -54,7 +54,7 @@ namespace
{
public:
LLHTTPClientURLAdaptor(LLCurl::ResponderPtr responder)
- : LLURLRequestComplete(), mResponder(responder), mStatus(499),
+ : LLURLRequestComplete(), mResponder(responder), mStatus(HTTP_INTERNAL_ERROR),
mReason("LLURLRequest complete w/no status")
{
}
@@ -63,7 +63,7 @@ namespace
{
}
- virtual void httpStatus(U32 status, const std::string& reason)
+ virtual void httpStatus(S32 status, const std::string& reason)
{
LLURLRequestComplete::httpStatus(status,reason);
@@ -74,30 +74,33 @@ namespace
virtual void complete(const LLChannelDescriptors& channels,
const buffer_ptr_t& buffer)
{
+ // *TODO: Re-interpret mRequestStatus codes?
+ // Would like to detect curl errors, such as
+ // connection errors, write erros, etc.
if (mResponder.get())
{
- // Allow clients to parse headers before we attempt to parse
- // the body and provide completed/result/error calls.
- mResponder->completedHeader(mStatus, mReason, mHeaderOutput);
- mResponder->completedRaw(mStatus, mReason, channels, buffer);
+ mResponder->setResult(mStatus, mReason);
+ mResponder->completedRaw(channels, buffer);
}
}
virtual void header(const std::string& header, const std::string& value)
{
- mHeaderOutput[header] = value;
+ if (mResponder.get())
+ {
+ mResponder->setResponseHeader(header, value);
+ }
}
private:
LLCurl::ResponderPtr mResponder;
- U32 mStatus;
+ S32 mStatus;
std::string mReason;
- LLSD mHeaderOutput;
};
class Injector : public LLIOPipe
{
public:
- virtual const char* contentType() = 0;
+ virtual const std::string& contentType() = 0;
};
class LLSDInjector : public Injector
@@ -106,7 +109,7 @@ namespace
LLSDInjector(const LLSD& sd) : mSD(sd) {}
virtual ~LLSDInjector() {}
- const char* contentType() { return "application/llsd+xml"; }
+ const std::string& contentType() { return HTTP_CONTENT_LLSD_XML; }
virtual EStatus process_impl(const LLChannelDescriptors& channels,
buffer_ptr_t& buffer, bool& eos, LLSD& context, LLPumpIO* pump)
@@ -124,9 +127,9 @@ namespace
{
public:
RawInjector(const U8* data, S32 size) : mData(data), mSize(size) {}
- virtual ~RawInjector() {delete mData;}
+ virtual ~RawInjector() {delete [] mData;}
- const char* contentType() { return "application/octet-stream"; }
+ const std::string& contentType() { return HTTP_CONTENT_OCTET_STREAM; }
virtual EStatus process_impl(const LLChannelDescriptors& channels,
buffer_ptr_t& buffer, bool& eos, LLSD& context, LLPumpIO* pump)
@@ -147,7 +150,7 @@ namespace
FileInjector(const std::string& filename) : mFilename(filename) {}
virtual ~FileInjector() {}
- const char* contentType() { return "application/octet-stream"; }
+ const std::string& contentType() { return HTTP_CONTENT_OCTET_STREAM; }
virtual EStatus process_impl(const LLChannelDescriptors& channels,
buffer_ptr_t& buffer, bool& eos, LLSD& context, LLPumpIO* pump)
@@ -180,7 +183,7 @@ namespace
VFileInjector(const LLUUID& uuid, LLAssetType::EType asset_type) : mUUID(uuid), mAssetType(asset_type) {}
virtual ~VFileInjector() {}
- const char* contentType() { return "application/octet-stream"; }
+ const std::string& contentType() { return HTTP_CONTENT_OCTET_STREAM; }
virtual EStatus process_impl(const LLChannelDescriptors& channels,
buffer_ptr_t& buffer, bool& eos, LLSD& context, LLPumpIO* pump)
@@ -213,7 +216,7 @@ void LLHTTPClient::setCertVerifyCallback(LLURLRequest::SSLCertVerifyCallback cal
static void request(
const std::string& url,
- LLURLRequest::ERequestAction method,
+ EHTTPMethod method,
Injector* body_injector,
LLCurl::ResponderPtr responder,
const F32 timeout = HTTP_REQUEST_EXPIRY_SECS,
@@ -225,7 +228,7 @@ static void request(
{
if (responder)
{
- responder->completed(U32_MAX, "No pump", LLSD());
+ responder->completeResult(HTTP_INTERNAL_ERROR, "No pump");
}
delete body_injector;
return;
@@ -237,90 +240,82 @@ static void request(
{
if (responder)
{
- responder->completed(498, "Internal Error - curl failure", LLSD());
+ responder->completeResult(HTTP_INTERNAL_CURL_ERROR, "Internal Error - curl failure");
}
- delete req ;
+ delete req;
delete body_injector;
- return ;
+ return;
}
req->setSSLVerifyCallback(LLHTTPClient::getCertVerifyCallback(), (void *)req);
-
- lldebugs << LLURLRequest::actionAsVerb(method) << " " << url << " "
- << headers << llendl;
+ LL_DEBUGS("LLHTTPClient") << httpMethodAsVerb(method) << " " << url << " " << headers << LL_ENDL;
// Insert custom headers if the caller sent any
if (headers.isMap())
{
- if (headers.has("Cookie"))
+ if (headers.has(HTTP_OUT_HEADER_COOKIE))
{
req->allowCookies();
}
- LLSD::map_const_iterator iter = headers.beginMap();
- LLSD::map_const_iterator end = headers.endMap();
-
- for (; iter != end; ++iter)
- {
- std::ostringstream header;
- //if the header is "Pragma" with no value
- //the caller intends to force libcurl to drop
- //the Pragma header it so gratuitously inserts
- //Before inserting the header, force libcurl
- //to not use the proxy (read: llurlrequest.cpp)
- static const std::string PRAGMA("Pragma");
- if ((iter->first == PRAGMA) && (iter->second.asString().empty()))
- {
- req->useProxy(false);
- }
- header << iter->first << ": " << iter->second.asString() ;
- lldebugs << "header = " << header.str() << llendl;
- req->addHeader(header.str().c_str());
- }
- }
+ LLSD::map_const_iterator iter = headers.beginMap();
+ LLSD::map_const_iterator end = headers.endMap();
+
+ for (; iter != end; ++iter)
+ {
+ //if the header is "Pragma" with no value
+ //the caller intends to force libcurl to drop
+ //the Pragma header it so gratuitously inserts
+ //Before inserting the header, force libcurl
+ //to not use the proxy (read: llurlrequest.cpp)
+ if ((iter->first == HTTP_OUT_HEADER_PRAGMA) && (iter->second.asString().empty()))
+ {
+ req->useProxy(false);
+ }
+ LL_DEBUGS("LLHTTPClient") << "header = " << iter->first
+ << ": " << iter->second.asString() << LL_ENDL;
+ req->addHeader(iter->first, iter->second.asString());
+ }
+ }
// Check to see if we have already set Accept or not. If no one
// set it, set it to application/llsd+xml since that's what we
// almost always want.
- if( method != LLURLRequest::HTTP_PUT && method != LLURLRequest::HTTP_POST )
+ if( method != HTTP_PUT && method != HTTP_POST )
{
- static const std::string ACCEPT("Accept");
- if(!headers.has(ACCEPT))
+ if(!headers.has(HTTP_OUT_HEADER_ACCEPT))
{
- req->addHeader("Accept: application/llsd+xml");
+ req->addHeader(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_LLSD_XML);
}
}
if (responder)
{
responder->setURL(url);
+ responder->setHTTPMethod(method);
}
req->setCallback(new LLHTTPClientURLAdaptor(responder));
- if (method == LLURLRequest::HTTP_POST && gMessageSystem)
+ if (method == HTTP_POST && gMessageSystem)
{
- req->addHeader(llformat("X-SecondLife-UDP-Listen-Port: %d",
- gMessageSystem->mPort).c_str());
- }
+ req->addHeader("X-SecondLife-UDP-Listen-Port", llformat("%d",
+ gMessageSystem->mPort));
+ }
- if (method == LLURLRequest::HTTP_PUT || method == LLURLRequest::HTTP_POST)
+ if (method == HTTP_PUT || method == HTTP_POST || method == HTTP_PATCH)
{
- static const std::string CONTENT_TYPE("Content-Type");
- if(!headers.has(CONTENT_TYPE))
+ if(!headers.has(HTTP_OUT_HEADER_CONTENT_TYPE))
{
// If the Content-Type header was passed in, it has
// already been added as a header through req->addHeader
// in the loop above. We defer to the caller's wisdom, but
// if they did not specify a Content-Type, then ask the
// injector.
- req->addHeader(
- llformat(
- "Content-Type: %s",
- body_injector->contentType()).c_str());
+ req->addHeader(HTTP_OUT_HEADER_CONTENT_TYPE, body_injector->contentType());
}
- chain.push_back(LLIOPipe::ptr_t(body_injector));
+ chain.push_back(LLIOPipe::ptr_t(body_injector));
}
chain.push_back(LLIOPipe::ptr_t(req));
@@ -342,9 +337,9 @@ void LLHTTPClient::getByteRange(
if(offset > 0 || bytes > 0)
{
std::string range = llformat("bytes=%d-%d", offset, offset+bytes-1);
- headers["Range"] = range;
+ headers[HTTP_OUT_HEADER_RANGE] = range;
}
- request(url,LLURLRequest::HTTP_GET, NULL, responder, timeout, headers, follow_redirects);
+ request(url,HTTP_GET, NULL, responder, timeout, headers, follow_redirects);
}
void LLHTTPClient::head(
@@ -354,18 +349,18 @@ void LLHTTPClient::head(
const F32 timeout,
bool follow_redirects /* = true */)
{
- request(url, LLURLRequest::HTTP_HEAD, NULL, responder, timeout, headers, follow_redirects);
+ request(url, HTTP_HEAD, NULL, responder, timeout, headers, follow_redirects);
}
void LLHTTPClient::get(const std::string& url, ResponderPtr responder, const LLSD& headers, const F32 timeout,
bool follow_redirects /* = true */)
{
- request(url, LLURLRequest::HTTP_GET, NULL, responder, timeout, headers, follow_redirects);
+ request(url, HTTP_GET, NULL, responder, timeout, headers, follow_redirects);
}
void LLHTTPClient::getHeaderOnly(const std::string& url, ResponderPtr responder, const LLSD& headers,
const F32 timeout, bool follow_redirects /* = true */)
{
- request(url, LLURLRequest::HTTP_HEAD, NULL, responder, timeout, headers, follow_redirects);
+ request(url, HTTP_HEAD, NULL, responder, timeout, headers, follow_redirects);
}
void LLHTTPClient::getHeaderOnly(const std::string& url, ResponderPtr responder, const F32 timeout,
bool follow_redirects /* = true */)
@@ -408,7 +403,7 @@ public:
return content;
}
- std::string asString()
+ const std::string& asString()
{
return mBuffer;
}
@@ -437,13 +432,13 @@ private:
*/
static LLSD blocking_request(
const std::string& url,
- LLURLRequest::ERequestAction method,
+ EHTTPMethod method,
const LLSD& body,
const LLSD& headers = LLSD(),
const F32 timeout = 5
)
{
- lldebugs << "blockingRequest of " << url << llendl;
+ LL_DEBUGS() << "blockingRequest of " << url << LL_ENDL;
char curl_error_buffer[CURL_ERROR_SIZE] = "\0";
CURL* curlp = LLCurl::newEasyHandle();
llassert_always(curlp != NULL) ;
@@ -474,17 +469,17 @@ static LLSD blocking_request(
{
std::ostringstream header;
header << iter->first << ": " << iter->second.asString() ;
- lldebugs << "header = " << header.str() << llendl;
+ LL_DEBUGS() << "header = " << header.str() << LL_ENDL;
headers_list = curl_slist_append(headers_list, header.str().c_str());
}
}
// * Setup specific method / "verb" for the URI (currently only GET and POST supported + poppy)
- if (method == LLURLRequest::HTTP_GET)
+ if (method == HTTP_GET)
{
curl_easy_setopt(curlp, CURLOPT_HTTPGET, 1);
}
- else if (method == LLURLRequest::HTTP_POST)
+ else if (method == HTTP_POST)
{
curl_easy_setopt(curlp, CURLOPT_POST, 1);
//serialize to ostr then copy to str - need to because ostr ptr is unstable :(
@@ -493,46 +488,48 @@ static LLSD blocking_request(
body_str = ostr.str();
curl_easy_setopt(curlp, CURLOPT_POSTFIELDS, body_str.c_str());
//copied from PHP libs, correct?
- headers_list = curl_slist_append(headers_list, "Content-Type: application/llsd+xml");
+ headers_list = curl_slist_append(headers_list,
+ llformat("%s: %s", HTTP_OUT_HEADER_CONTENT_TYPE.c_str(), HTTP_CONTENT_LLSD_XML.c_str()).c_str());
// copied from llurlrequest.cpp
// it appears that apache2.2.3 or django in etch is busted. If
// we do not clear the expect header, we get a 500. May be
// limited to django/mod_wsgi.
- headers_list = curl_slist_append(headers_list, "Expect:");
+ headers_list = curl_slist_append(headers_list, llformat("%s:", HTTP_OUT_HEADER_EXPECT.c_str()).c_str());
}
// * Do the action using curl, handle results
- lldebugs << "HTTP body: " << body_str << llendl;
- headers_list = curl_slist_append(headers_list, "Accept: application/llsd+xml");
+ LL_DEBUGS() << "HTTP body: " << body_str << LL_ENDL;
+ headers_list = curl_slist_append(headers_list,
+ llformat("%s: %s", HTTP_OUT_HEADER_ACCEPT.c_str(), HTTP_CONTENT_LLSD_XML.c_str()).c_str());
CURLcode curl_result = curl_easy_setopt(curlp, CURLOPT_HTTPHEADER, headers_list);
if ( curl_result != CURLE_OK )
{
- llinfos << "Curl is hosed - can't add headers" << llendl;
+ LL_INFOS() << "Curl is hosed - can't add headers" << LL_ENDL;
}
LLSD response = LLSD::emptyMap();
S32 curl_success = curl_easy_perform(curlp);
- S32 http_status = 499;
+ S32 http_status = HTTP_INTERNAL_ERROR;
curl_easy_getinfo(curlp, CURLINFO_RESPONSE_CODE, &http_status);
response["status"] = http_status;
// if we get a non-404 and it's not a 200 OR maybe it is but you have error bits,
- if ( http_status != 404 && (http_status != 200 || curl_success != 0) )
+ if ( http_status != HTTP_NOT_FOUND && (http_status != HTTP_OK || curl_success != 0) )
{
// We expect 404s, don't spam for them.
- llwarns << "CURL REQ URL: " << url << llendl;
- llwarns << "CURL REQ METHOD TYPE: " << method << llendl;
- llwarns << "CURL REQ HEADERS: " << headers.asString() << llendl;
- llwarns << "CURL REQ BODY: " << body_str << llendl;
- llwarns << "CURL HTTP_STATUS: " << http_status << llendl;
- llwarns << "CURL ERROR: " << curl_error_buffer << llendl;
- llwarns << "CURL ERROR BODY: " << http_buffer.asString() << llendl;
+ LL_WARNS() << "CURL REQ URL: " << url << LL_ENDL;
+ LL_WARNS() << "CURL REQ METHOD TYPE: " << method << LL_ENDL;
+ LL_WARNS() << "CURL REQ HEADERS: " << headers.asString() << LL_ENDL;
+ LL_WARNS() << "CURL REQ BODY: " << body_str << LL_ENDL;
+ LL_WARNS() << "CURL HTTP_STATUS: " << http_status << LL_ENDL;
+ LL_WARNS() << "CURL ERROR: " << curl_error_buffer << LL_ENDL;
+ LL_WARNS() << "CURL ERROR BODY: " << http_buffer.asString() << LL_ENDL;
response["body"] = http_buffer.asString();
}
else
{
response["body"] = http_buffer.asLLSD();
- lldebugs << "CURL response: " << http_buffer.asString() << llendl;
+ LL_DEBUGS() << "CURL response: " << http_buffer.asString() << LL_ENDL;
}
if(headers_list)
@@ -547,12 +544,12 @@ static LLSD blocking_request(
LLSD LLHTTPClient::blockingGet(const std::string& url)
{
- return blocking_request(url, LLURLRequest::HTTP_GET, LLSD());
+ return blocking_request(url, HTTP_GET, LLSD());
}
LLSD LLHTTPClient::blockingPost(const std::string& url, const LLSD& body)
{
- return blocking_request(url, LLURLRequest::HTTP_POST, body);
+ return blocking_request(url, HTTP_POST, body);
}
void LLHTTPClient::put(
@@ -562,7 +559,17 @@ void LLHTTPClient::put(
const LLSD& headers,
const F32 timeout)
{
- request(url, LLURLRequest::HTTP_PUT, new LLSDInjector(body), responder, timeout, headers);
+ request(url, HTTP_PUT, new LLSDInjector(body), responder, timeout, headers);
+}
+
+void LLHTTPClient::patch(
+ const std::string& url,
+ const LLSD& body,
+ ResponderPtr responder,
+ const LLSD& headers,
+ const F32 timeout)
+{
+ request(url, HTTP_PATCH, new LLSDInjector(body), responder, timeout, headers);
}
void LLHTTPClient::post(
@@ -572,7 +579,7 @@ void LLHTTPClient::post(
const LLSD& headers,
const F32 timeout)
{
- request(url, LLURLRequest::HTTP_POST, new LLSDInjector(body), responder, timeout, headers);
+ request(url, HTTP_POST, new LLSDInjector(body), responder, timeout, headers);
}
void LLHTTPClient::postRaw(
@@ -583,7 +590,7 @@ void LLHTTPClient::postRaw(
const LLSD& headers,
const F32 timeout)
{
- request(url, LLURLRequest::HTTP_POST, new RawInjector(data, size), responder, timeout, headers);
+ request(url, HTTP_POST, new RawInjector(data, size), responder, timeout, headers);
}
void LLHTTPClient::postFile(
@@ -593,7 +600,7 @@ void LLHTTPClient::postFile(
const LLSD& headers,
const F32 timeout)
{
- request(url, LLURLRequest::HTTP_POST, new FileInjector(filename), responder, timeout, headers);
+ request(url, HTTP_POST, new FileInjector(filename), responder, timeout, headers);
}
void LLHTTPClient::postFile(
@@ -604,7 +611,7 @@ void LLHTTPClient::postFile(
const LLSD& headers,
const F32 timeout)
{
- request(url, LLURLRequest::HTTP_POST, new VFileInjector(uuid, asset_type), responder, timeout, headers);
+ request(url, HTTP_POST, new VFileInjector(uuid, asset_type), responder, timeout, headers);
}
// static
@@ -614,7 +621,7 @@ void LLHTTPClient::del(
const LLSD& headers,
const F32 timeout)
{
- request(url, LLURLRequest::HTTP_DELETE, NULL, responder, timeout, headers);
+ request(url, HTTP_DELETE, NULL, responder, timeout, headers);
}
// static
@@ -626,8 +633,21 @@ void LLHTTPClient::move(
const F32 timeout)
{
LLSD headers = hdrs;
- headers["Destination"] = destination;
- request(url, LLURLRequest::HTTP_MOVE, NULL, responder, timeout, headers);
+ headers[HTTP_OUT_HEADER_DESTINATION] = destination;
+ request(url, HTTP_MOVE, NULL, responder, timeout, headers);
+}
+
+// static
+void LLHTTPClient::copy(
+ const std::string& url,
+ const std::string& destination,
+ ResponderPtr responder,
+ const LLSD& hdrs,
+ const F32 timeout)
+{
+ LLSD headers = hdrs;
+ headers[HTTP_OUT_HEADER_DESTINATION] = destination;
+ request(url, HTTP_COPY, NULL, responder, timeout, headers);
}
diff --git a/indra/llmessage/llhttpclient.h b/indra/llmessage/llhttpclient.h
index 5de257a4f6..b18258fd7b 100755
--- a/indra/llmessage/llhttpclient.h
+++ b/indra/llmessage/llhttpclient.h
@@ -79,6 +79,14 @@ public:
ResponderPtr,
const LLSD& headers = LLSD(),
const F32 timeout=HTTP_REQUEST_EXPIRY_SECS);
+
+ static void patch(
+ const std::string& url,
+ const LLSD& body,
+ ResponderPtr,
+ const LLSD& headers = LLSD(),
+ const F32 timeout=HTTP_REQUEST_EXPIRY_SECS);
+
static void getHeaderOnly(const std::string& url, ResponderPtr, const F32 timeout=HTTP_REQUEST_EXPIRY_SECS,
bool follow_redirects = true);
static void getHeaderOnly(const std::string& url, ResponderPtr, const LLSD& headers,
@@ -118,7 +126,7 @@ public:
const LLSD& headers = LLSD(),
const F32 timeout=HTTP_REQUEST_EXPIRY_SECS);
///< sends a DELETE method, but we can't call it delete in c++
-
+
/**
* @brief Send a MOVE webdav method
*
@@ -135,6 +143,22 @@ public:
const LLSD& headers = LLSD(),
const F32 timeout=HTTP_REQUEST_EXPIRY_SECS);
+ /**
+ * @brief Send a COPY webdav method
+ *
+ * @param url The complete serialized (and escaped) url to get.
+ * @param destination The complete serialized destination url.
+ * @param responder The responder that will handle the result.
+ * @param headers A map of key:value headers to pass to the request
+ * @param timeout The number of seconds to give the server to respond.
+ */
+ static void copy(
+ const std::string& url,
+ const std::string& destination,
+ ResponderPtr responder,
+ const LLSD& headers = LLSD(),
+ const F32 timeout=HTTP_REQUEST_EXPIRY_SECS);
+
//@}
/**
diff --git a/indra/llmessage/llhttpclientadapter.cpp b/indra/llmessage/llhttpclientadapter.cpp
index dcd2d79d67..b56a804f94 100755
--- a/indra/llmessage/llhttpclientadapter.cpp
+++ b/indra/llmessage/llhttpclientadapter.cpp
@@ -35,18 +35,18 @@ void LLHTTPClientAdapter::get(const std::string& url, LLCurl::ResponderPtr respo
{
LLSD empty_pragma_header;
// Pragma is required to stop curl adding "no-cache"
- // Space is required to stop llurlrequest from turnning off proxying
- empty_pragma_header["Pragma"] = " ";
+ // Space is required to stop llurlrequest from turning off proxying
+ empty_pragma_header[HTTP_OUT_HEADER_PRAGMA] = " ";
LLHTTPClient::get(url, responder, empty_pragma_header);
}
void LLHTTPClientAdapter::get(const std::string& url, LLCurl::ResponderPtr responder, const LLSD& headers)
{
LLSD empty_pragma_header = headers;
- if (!empty_pragma_header.has("Pragma"))
+ if (!empty_pragma_header.has(HTTP_OUT_HEADER_PRAGMA))
{
- // as above
- empty_pragma_header["Pragma"] = " ";
+ // as above
+ empty_pragma_header[HTTP_OUT_HEADER_PRAGMA] = " ";
}
LLHTTPClient::get(url, responder, empty_pragma_header);
}
@@ -56,3 +56,18 @@ void LLHTTPClientAdapter::put(const std::string& url, const LLSD& body, LLCurl::
LLHTTPClient::put(url, body, responder);
}
+void LLHTTPClientAdapter::put(
+ const std::string& url,
+ const LLSD& body,
+ LLCurl::ResponderPtr responder,
+ const LLSD& headers)
+{
+ LLHTTPClient::put(url, body, responder, headers);
+}
+
+void LLHTTPClientAdapter::del(
+ const std::string& url,
+ LLCurl::ResponderPtr responder)
+{
+ LLHTTPClient::del(url, responder);
+}
diff --git a/indra/llmessage/llhttpclientadapter.h b/indra/llmessage/llhttpclientadapter.h
index aae6426a59..270282c66f 100755
--- a/indra/llmessage/llhttpclientadapter.h
+++ b/indra/llmessage/llhttpclientadapter.h
@@ -37,6 +37,14 @@ public:
virtual void get(const std::string& url, LLCurl::ResponderPtr responder);
virtual void get(const std::string& url, LLCurl::ResponderPtr responder, const LLSD& headers);
virtual void put(const std::string& url, const LLSD& body, LLCurl::ResponderPtr responder);
+ virtual void put(
+ const std::string& url,
+ const LLSD& body,
+ LLCurl::ResponderPtr responder,
+ const LLSD& headers);
+ virtual void del(
+ const std::string& url,
+ LLCurl::ResponderPtr responder);
};
#endif
diff --git a/indra/llmessage/llhttpconstants.cpp b/indra/llmessage/llhttpconstants.cpp
new file mode 100755
index 0000000000..01f4a080b0
--- /dev/null
+++ b/indra/llmessage/llhttpconstants.cpp
@@ -0,0 +1,228 @@
+/**
+ * @file llhttpconstants.cpp
+ * @brief Implementation of the HTTP request / response constant lookups
+ *
+ * $LicenseInfo:firstyear=2013&license=viewerlgpl$
+ *
+ * Copyright (c) 2013, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * Copyright (C) 2013, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "linden_common.h"
+#include "llhttpconstants.h"
+#include "lltimer.h"
+
+// for curl_getdate() (apparently parsing RFC 1123 dates is hard)
+#include <curl/curl.h>
+
+// Outgoing headers. Do *not* use these to check incoming headers.
+// For incoming headers, use the lower-case headers, below.
+const std::string HTTP_OUT_HEADER_ACCEPT("Accept");
+const std::string HTTP_OUT_HEADER_ACCEPT_CHARSET("Accept-Charset");
+const std::string HTTP_OUT_HEADER_ACCEPT_ENCODING("Accept-Encoding");
+const std::string HTTP_OUT_HEADER_ACCEPT_LANGUAGE("Accept-Language");
+const std::string HTTP_OUT_HEADER_ACCEPT_RANGES("Accept-Ranges");
+const std::string HTTP_OUT_HEADER_AGE("Age");
+const std::string HTTP_OUT_HEADER_ALLOW("Allow");
+const std::string HTTP_OUT_HEADER_AUTHORIZATION("Authorization");
+const std::string HTTP_OUT_HEADER_CACHE_CONTROL("Cache-Control");
+const std::string HTTP_OUT_HEADER_CONNECTION("Connection");
+const std::string HTTP_OUT_HEADER_CONTENT_DESCRIPTION("Content-Description");
+const std::string HTTP_OUT_HEADER_CONTENT_ENCODING("Content-Encoding");
+const std::string HTTP_OUT_HEADER_CONTENT_ID("Content-ID");
+const std::string HTTP_OUT_HEADER_CONTENT_LANGUAGE("Content-Language");
+const std::string HTTP_OUT_HEADER_CONTENT_LENGTH("Content-Length");
+const std::string HTTP_OUT_HEADER_CONTENT_LOCATION("Content-Location");
+const std::string HTTP_OUT_HEADER_CONTENT_MD5("Content-MD5");
+const std::string HTTP_OUT_HEADER_CONTENT_RANGE("Content-Range");
+const std::string HTTP_OUT_HEADER_CONTENT_TRANSFER_ENCODING("Content-Transfer-Encoding");
+const std::string HTTP_OUT_HEADER_CONTENT_TYPE("Content-Type");
+const std::string HTTP_OUT_HEADER_COOKIE("Cookie");
+const std::string HTTP_OUT_HEADER_DATE("Date");
+const std::string HTTP_OUT_HEADER_DESTINATION("Destination");
+const std::string HTTP_OUT_HEADER_ETAG("ETag");
+const std::string HTTP_OUT_HEADER_EXPECT("Expect");
+const std::string HTTP_OUT_HEADER_EXPIRES("Expires");
+const std::string HTTP_OUT_HEADER_FROM("From");
+const std::string HTTP_OUT_HEADER_HOST("Host");
+const std::string HTTP_OUT_HEADER_IF_MATCH("If-Match");
+const std::string HTTP_OUT_HEADER_IF_MODIFIED_SINCE("If-Modified-Since");
+const std::string HTTP_OUT_HEADER_IF_NONE_MATCH("If-None-Match");
+const std::string HTTP_OUT_HEADER_IF_RANGE("If-Range");
+const std::string HTTP_OUT_HEADER_IF_UNMODIFIED_SINCE("If-Unmodified-Since");
+const std::string HTTP_OUT_HEADER_KEEP_ALIVE("Keep-Alive");
+const std::string HTTP_OUT_HEADER_LAST_MODIFIED("Last-Modified");
+const std::string HTTP_OUT_HEADER_LOCATION("Location");
+const std::string HTTP_OUT_HEADER_MAX_FORWARDS("Max-Forwards");
+const std::string HTTP_OUT_HEADER_MIME_VERSION("MIME-Version");
+const std::string HTTP_OUT_HEADER_PRAGMA("Pragma");
+const std::string HTTP_OUT_HEADER_PROXY_AUTHENTICATE("Proxy-Authenticate");
+const std::string HTTP_OUT_HEADER_PROXY_AUTHORIZATION("Proxy-Authorization");
+const std::string HTTP_OUT_HEADER_RANGE("Range");
+const std::string HTTP_OUT_HEADER_REFERER("Referer");
+const std::string HTTP_OUT_HEADER_RETRY_AFTER("Retry-After");
+const std::string HTTP_OUT_HEADER_SERVER("Server");
+const std::string HTTP_OUT_HEADER_SET_COOKIE("Set-Cookie");
+const std::string HTTP_OUT_HEADER_TE("TE");
+const std::string HTTP_OUT_HEADER_TRAILER("Trailer");
+const std::string HTTP_OUT_HEADER_TRANSFER_ENCODING("Transfer-Encoding");
+const std::string HTTP_OUT_HEADER_UPGRADE("Upgrade");
+const std::string HTTP_OUT_HEADER_USER_AGENT("User-Agent");
+const std::string HTTP_OUT_HEADER_VARY("Vary");
+const std::string HTTP_OUT_HEADER_VIA("Via");
+const std::string HTTP_OUT_HEADER_WARNING("Warning");
+const std::string HTTP_OUT_HEADER_WWW_AUTHENTICATE("WWW-Authenticate");
+
+// Incoming headers are normalized to lower-case.
+const std::string HTTP_IN_HEADER_ACCEPT_LANGUAGE("accept-language");
+const std::string HTTP_IN_HEADER_CACHE_CONTROL("cache-control");
+const std::string HTTP_IN_HEADER_CONTENT_LENGTH("content-length");
+const std::string HTTP_IN_HEADER_CONTENT_LOCATION("content-location");
+const std::string HTTP_IN_HEADER_CONTENT_TYPE("content-type");
+const std::string HTTP_IN_HEADER_HOST("host");
+const std::string HTTP_IN_HEADER_LOCATION("location");
+const std::string HTTP_IN_HEADER_RETRY_AFTER("retry-after");
+const std::string HTTP_IN_HEADER_SET_COOKIE("set-cookie");
+const std::string HTTP_IN_HEADER_USER_AGENT("user-agent");
+const std::string HTTP_IN_HEADER_X_FORWARDED_FOR("x-forwarded-for");
+
+const std::string HTTP_CONTENT_LLSD_XML("application/llsd+xml");
+const std::string HTTP_CONTENT_OCTET_STREAM("application/octet-stream");
+const std::string HTTP_CONTENT_XML("application/xml");
+const std::string HTTP_CONTENT_JSON("application/json");
+const std::string HTTP_CONTENT_TEXT_HTML("text/html");
+const std::string HTTP_CONTENT_TEXT_HTML_UTF8("text/html; charset=utf-8");
+const std::string HTTP_CONTENT_TEXT_PLAIN_UTF8("text/plain; charset=utf-8");
+const std::string HTTP_CONTENT_TEXT_LLSD("text/llsd");
+const std::string HTTP_CONTENT_TEXT_XML("text/xml");
+const std::string HTTP_CONTENT_TEXT_LSL("text/lsl");
+const std::string HTTP_CONTENT_TEXT_PLAIN("text/plain");
+const std::string HTTP_CONTENT_IMAGE_X_J2C("image/x-j2c");
+const std::string HTTP_CONTENT_IMAGE_J2C("image/j2c");
+const std::string HTTP_CONTENT_IMAGE_JPEG("image/jpeg");
+const std::string HTTP_CONTENT_IMAGE_PNG("image/png");
+const std::string HTTP_CONTENT_IMAGE_BMP("image/bmp");
+
+const std::string HTTP_NO_CACHE("no-cache");
+const std::string HTTP_NO_CACHE_CONTROL("no-cache, max-age=0");
+
+const std::string HTTP_VERB_INVALID("(invalid)");
+const std::string HTTP_VERB_HEAD("HEAD");
+const std::string HTTP_VERB_GET("GET");
+const std::string HTTP_VERB_PUT("PUT");
+const std::string HTTP_VERB_POST("POST");
+const std::string HTTP_VERB_DELETE("DELETE");
+const std::string HTTP_VERB_MOVE("MOVE");
+const std::string HTTP_VERB_OPTIONS("OPTIONS");
+const std::string HTTP_VERB_PATCH("PATCH");
+const std::string HTTP_VERB_COPY("COPY");
+
+const std::string& httpMethodAsVerb(EHTTPMethod method)
+{
+ static const std::string VERBS[] =
+ {
+ HTTP_VERB_INVALID,
+ HTTP_VERB_HEAD,
+ HTTP_VERB_GET,
+ HTTP_VERB_PUT,
+ HTTP_VERB_POST,
+ HTTP_VERB_DELETE,
+ HTTP_VERB_MOVE,
+ HTTP_VERB_OPTIONS,
+ HTTP_VERB_PATCH,
+ HTTP_VERB_COPY
+ };
+ if(((S32)method <=0) || ((S32)method >= HTTP_METHOD_COUNT))
+ {
+ return VERBS[0];
+ }
+ return VERBS[method];
+}
+
+bool isHttpInformationalStatus(S32 status)
+{
+ // Check for status 1xx.
+ return((100 <= status) && (status < 200));
+}
+
+bool isHttpGoodStatus(S32 status)
+{
+ // Check for status 2xx.
+ return((200 <= status) && (status < 300));
+}
+
+bool isHttpRedirectStatus(S32 status)
+{
+ // Check for status 3xx.
+ return((300 <= status) && (status < 400));
+}
+
+bool isHttpClientErrorStatus(S32 status)
+{
+ // Status 499 is sometimes used for re-interpreted status 2xx errors
+ // based on body content. Treat these as potentially retryable 'server' status errors,
+ // since we do not have enough context to know if this will always fail.
+ if (HTTP_INTERNAL_ERROR == status) return false;
+
+ // Check for status 5xx.
+ return((400 <= status) && (status < 500));
+}
+
+bool isHttpServerErrorStatus(S32 status)
+{
+ // Status 499 is sometimes used for re-interpreted status 2xx errors.
+ // Allow retry of these, since we don't have enough information in this
+ // context to know if this will always fail.
+ if (HTTP_INTERNAL_ERROR == status) return true;
+
+ // Check for status 5xx.
+ return((500 <= status) && (status < 600));
+}
+
+// Parses 'Retry-After' header contents and returns seconds until retry should occur.
+bool getSecondsUntilRetryAfter(const std::string& retry_after, F32& seconds_to_wait)
+{
+ // *TODO: This needs testing! Not in use yet.
+ // Examples of Retry-After headers:
+ // Retry-After: Fri, 31 Dec 1999 23:59:59 GMT
+ // Retry-After: 120
+
+ // Check for number of seconds version, first:
+ char* end = 0;
+ // Parse as double
+ double seconds = std::strtod(retry_after.c_str(), &end);
+ if ( end != 0 && *end == 0 )
+ {
+ // Successful parse
+ seconds_to_wait = (F32) seconds;
+ return true;
+ }
+
+ // Parse rfc1123 date.
+ time_t date = curl_getdate(retry_after.c_str(), NULL );
+ if (-1 == date) return false;
+
+ seconds_to_wait = (F64)date - LLTimer::getTotalSeconds();
+
+ return true;
+}
+
diff --git a/indra/llmessage/llhttpconstants.h b/indra/llmessage/llhttpconstants.h
new file mode 100755
index 0000000000..4aa3cc6394
--- /dev/null
+++ b/indra/llmessage/llhttpconstants.h
@@ -0,0 +1,225 @@
+/**
+ * @file llhttpconstants.h
+ * @brief Constants for HTTP requests and responses
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2001-2013, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_HTTP_CONSTANTS_H
+#define LL_HTTP_CONSTANTS_H
+
+#include "stdtypes.h"
+
+/////// HTTP STATUS CODES ///////
+
+// Standard errors from HTTP spec:
+// http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1
+const S32 HTTP_CONTINUE = 100;
+const S32 HTTP_SWITCHING_PROTOCOLS = 101;
+
+// Success
+const S32 HTTP_OK = 200;
+const S32 HTTP_CREATED = 201;
+const S32 HTTP_ACCEPTED = 202;
+const S32 HTTP_NON_AUTHORITATIVE_INFORMATION = 203;
+const S32 HTTP_NO_CONTENT = 204;
+const S32 HTTP_RESET_CONTENT = 205;
+const S32 HTTP_PARTIAL_CONTENT = 206;
+
+// Redirection
+const S32 HTTP_MULTIPLE_CHOICES = 300;
+const S32 HTTP_MOVED_PERMANENTLY = 301;
+const S32 HTTP_FOUND = 302;
+const S32 HTTP_SEE_OTHER = 303;
+const S32 HTTP_NOT_MODIFIED = 304;
+const S32 HTTP_USE_PROXY = 305;
+const S32 HTTP_TEMPORARY_REDIRECT = 307;
+
+// Client Error
+const S32 HTTP_BAD_REQUEST = 400;
+const S32 HTTP_UNAUTHORIZED = 401;
+const S32 HTTP_PAYMENT_REQUIRED = 402;
+const S32 HTTP_FORBIDDEN = 403;
+const S32 HTTP_NOT_FOUND = 404;
+const S32 HTTP_METHOD_NOT_ALLOWED = 405;
+const S32 HTTP_NOT_ACCEPTABLE = 406;
+const S32 HTTP_PROXY_AUTHENTICATION_REQUIRED = 407;
+const S32 HTTP_REQUEST_TIME_OUT = 408;
+const S32 HTTP_CONFLICT = 409;
+const S32 HTTP_GONE = 410;
+const S32 HTTP_LENGTH_REQUIRED = 411;
+const S32 HTTP_PRECONDITION_FAILED = 412;
+const S32 HTTP_REQUEST_ENTITY_TOO_LARGE = 413;
+const S32 HTTP_REQUEST_URI_TOO_LARGE = 414;
+const S32 HTTP_UNSUPPORTED_MEDIA_TYPE = 415;
+const S32 HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
+const S32 HTTP_EXPECTATION_FAILED = 417;
+
+// Server Error
+const S32 HTTP_INTERNAL_SERVER_ERROR = 500;
+const S32 HTTP_NOT_IMPLEMENTED = 501;
+const S32 HTTP_BAD_GATEWAY = 502;
+const S32 HTTP_SERVICE_UNAVAILABLE = 503;
+const S32 HTTP_GATEWAY_TIME_OUT = 504;
+const S32 HTTP_VERSION_NOT_SUPPORTED = 505;
+
+// We combine internal process errors with status codes
+// These status codes should not be sent over the wire
+// and indicate something went wrong internally.
+// If you get these they are not normal.
+const S32 HTTP_INTERNAL_CURL_ERROR = 498;
+const S32 HTTP_INTERNAL_ERROR = 499;
+
+
+////// HTTP Methods //////
+
+extern const std::string HTTP_VERB_INVALID;
+extern const std::string HTTP_VERB_HEAD;
+extern const std::string HTTP_VERB_GET;
+extern const std::string HTTP_VERB_PUT;
+extern const std::string HTTP_VERB_POST;
+extern const std::string HTTP_VERB_DELETE;
+extern const std::string HTTP_VERB_MOVE;
+extern const std::string HTTP_VERB_OPTIONS;
+
+enum EHTTPMethod
+{
+ HTTP_INVALID = 0,
+ HTTP_HEAD,
+ HTTP_GET,
+ HTTP_PUT,
+ HTTP_POST,
+ HTTP_DELETE,
+ HTTP_MOVE, // Caller will need to set 'Destination' header
+ HTTP_OPTIONS,
+ HTTP_PATCH,
+ HTTP_COPY,
+ HTTP_METHOD_COUNT
+};
+
+const std::string& httpMethodAsVerb(EHTTPMethod method);
+bool isHttpInformationalStatus(S32 status);
+bool isHttpGoodStatus(S32 status);
+bool isHttpRedirectStatus(S32 status);
+bool isHttpClientErrorStatus(S32 status);
+bool isHttpServerErrorStatus(S32 status);
+
+// Parses 'Retry-After' header contents and returns seconds until retry should occur.
+bool getSecondsUntilRetryAfter(const std::string& retry_after, F32& seconds_to_wait);
+
+//// HTTP Headers /////
+
+// Outgoing headers. Do *not* use these to check incoming headers.
+// For incoming headers, use the lower-case headers, below.
+extern const std::string HTTP_OUT_HEADER_ACCEPT;
+extern const std::string HTTP_OUT_HEADER_ACCEPT_CHARSET;
+extern const std::string HTTP_OUT_HEADER_ACCEPT_ENCODING;
+extern const std::string HTTP_OUT_HEADER_ACCEPT_LANGUAGE;
+extern const std::string HTTP_OUT_HEADER_ACCEPT_RANGES;
+extern const std::string HTTP_OUT_HEADER_AGE;
+extern const std::string HTTP_OUT_HEADER_ALLOW;
+extern const std::string HTTP_OUT_HEADER_AUTHORIZATION;
+extern const std::string HTTP_OUT_HEADER_CACHE_CONTROL;
+extern const std::string HTTP_OUT_HEADER_CONNECTION;
+extern const std::string HTTP_OUT_HEADER_CONTENT_DESCRIPTION;
+extern const std::string HTTP_OUT_HEADER_CONTENT_ENCODING;
+extern const std::string HTTP_OUT_HEADER_CONTENT_ID;
+extern const std::string HTTP_OUT_HEADER_CONTENT_LANGUAGE;
+extern const std::string HTTP_OUT_HEADER_CONTENT_LENGTH;
+extern const std::string HTTP_OUT_HEADER_CONTENT_LOCATION;
+extern const std::string HTTP_OUT_HEADER_CONTENT_MD5;
+extern const std::string HTTP_OUT_HEADER_CONTENT_RANGE;
+extern const std::string HTTP_OUT_HEADER_CONTENT_TRANSFER_ENCODING;
+extern const std::string HTTP_OUT_HEADER_CONTENT_TYPE;
+extern const std::string HTTP_OUT_HEADER_COOKIE;
+extern const std::string HTTP_OUT_HEADER_DATE;
+extern const std::string HTTP_OUT_HEADER_DESTINATION;
+extern const std::string HTTP_OUT_HEADER_ETAG;
+extern const std::string HTTP_OUT_HEADER_EXPECT;
+extern const std::string HTTP_OUT_HEADER_EXPIRES;
+extern const std::string HTTP_OUT_HEADER_FROM;
+extern const std::string HTTP_OUT_HEADER_HOST;
+extern const std::string HTTP_OUT_HEADER_IF_MATCH;
+extern const std::string HTTP_OUT_HEADER_IF_MODIFIED_SINCE;
+extern const std::string HTTP_OUT_HEADER_IF_NONE_MATCH;
+extern const std::string HTTP_OUT_HEADER_IF_RANGE;
+extern const std::string HTTP_OUT_HEADER_IF_UNMODIFIED_SINCE;
+extern const std::string HTTP_OUT_HEADER_KEEP_ALIVE;
+extern const std::string HTTP_OUT_HEADER_LAST_MODIFIED;
+extern const std::string HTTP_OUT_HEADER_LOCATION;
+extern const std::string HTTP_OUT_HEADER_MAX_FORWARDS;
+extern const std::string HTTP_OUT_HEADER_MIME_VERSION;
+extern const std::string HTTP_OUT_HEADER_PRAGMA;
+extern const std::string HTTP_OUT_HEADER_PROXY_AUTHENTICATE;
+extern const std::string HTTP_OUT_HEADER_PROXY_AUTHORIZATION;
+extern const std::string HTTP_OUT_HEADER_RANGE;
+extern const std::string HTTP_OUT_HEADER_REFERER;
+extern const std::string HTTP_OUT_HEADER_RETRY_AFTER;
+extern const std::string HTTP_OUT_HEADER_SERVER;
+extern const std::string HTTP_OUT_HEADER_SET_COOKIE;
+extern const std::string HTTP_OUT_HEADER_TE;
+extern const std::string HTTP_OUT_HEADER_TRAILER;
+extern const std::string HTTP_OUT_HEADER_TRANSFER_ENCODING;
+extern const std::string HTTP_OUT_HEADER_UPGRADE;
+extern const std::string HTTP_OUT_HEADER_USER_AGENT;
+extern const std::string HTTP_OUT_HEADER_VARY;
+extern const std::string HTTP_OUT_HEADER_VIA;
+extern const std::string HTTP_OUT_HEADER_WARNING;
+extern const std::string HTTP_OUT_HEADER_WWW_AUTHENTICATE;
+
+// Incoming headers are normalized to lower-case.
+extern const std::string HTTP_IN_HEADER_ACCEPT_LANGUAGE;
+extern const std::string HTTP_IN_HEADER_CACHE_CONTROL;
+extern const std::string HTTP_IN_HEADER_CONTENT_LENGTH;
+extern const std::string HTTP_IN_HEADER_CONTENT_LOCATION;
+extern const std::string HTTP_IN_HEADER_CONTENT_TYPE;
+extern const std::string HTTP_IN_HEADER_HOST;
+extern const std::string HTTP_IN_HEADER_LOCATION;
+extern const std::string HTTP_IN_HEADER_RETRY_AFTER;
+extern const std::string HTTP_IN_HEADER_SET_COOKIE;
+extern const std::string HTTP_IN_HEADER_USER_AGENT;
+extern const std::string HTTP_IN_HEADER_X_FORWARDED_FOR;
+
+//// HTTP Content Types ////
+
+extern const std::string HTTP_CONTENT_LLSD_XML;
+extern const std::string HTTP_CONTENT_OCTET_STREAM;
+extern const std::string HTTP_CONTENT_XML;
+extern const std::string HTTP_CONTENT_JSON;
+extern const std::string HTTP_CONTENT_TEXT_HTML;
+extern const std::string HTTP_CONTENT_TEXT_HTML_UTF8;
+extern const std::string HTTP_CONTENT_TEXT_PLAIN_UTF8;
+extern const std::string HTTP_CONTENT_TEXT_LLSD;
+extern const std::string HTTP_CONTENT_TEXT_XML;
+extern const std::string HTTP_CONTENT_TEXT_LSL;
+extern const std::string HTTP_CONTENT_TEXT_PLAIN;
+extern const std::string HTTP_CONTENT_IMAGE_X_J2C;
+extern const std::string HTTP_CONTENT_IMAGE_J2C;
+extern const std::string HTTP_CONTENT_IMAGE_JPEG;
+extern const std::string HTTP_CONTENT_IMAGE_PNG;
+extern const std::string HTTP_CONTENT_IMAGE_BMP;
+
+//// HTTP Cache Settings ////
+extern const std::string HTTP_NO_CACHE;
+extern const std::string HTTP_NO_CACHE_CONTROL;
+
+#endif
diff --git a/indra/llmessage/llhttpnode.cpp b/indra/llmessage/llhttpnode.cpp
index f6ccb5bdda..f235965879 100755
--- a/indra/llmessage/llhttpnode.cpp
+++ b/indra/llmessage/llhttpnode.cpp
@@ -30,9 +30,15 @@
#include <boost/tokenizer.hpp>
#include "llstl.h"
-#include "lliohttpserver.h" // for string constants
+#include "llhttpconstants.h"
-static const std::string CONTEXT_WILDCARD("wildcard");
+const std::string CONTEXT_HEADERS("headers");
+const std::string CONTEXT_PATH("path");
+const std::string CONTEXT_QUERY_STRING("query-string");
+const std::string CONTEXT_REQUEST("request");
+const std::string CONTEXT_RESPONSE("response");
+const std::string CONTEXT_VERB("verb");
+const std::string CONTEXT_WILDCARD("wildcard");
/**
* LLHTTPNode
@@ -172,22 +178,24 @@ LLSD LLHTTPNode::simpleDel(const LLSD&) const
// virtual
void LLHTTPNode::options(ResponsePtr response, const LLSD& context) const
{
- //llinfos << "options context: " << context << llendl;
+ //LL_INFOS() << "options context: " << context << LL_ENDL;
+ LL_DEBUGS("LLHTTPNode") << "context: " << context << LL_ENDL;
// default implementation constructs an url to the documentation.
+ // *TODO: Check for 'Host' header instead of 'host' header?
std::string host(
- context[CONTEXT_REQUEST][CONTEXT_HEADERS]["host"].asString());
+ context[CONTEXT_REQUEST][CONTEXT_HEADERS][HTTP_IN_HEADER_HOST].asString());
if(host.empty())
{
- response->status(400, "Bad Request -- need Host header");
+ response->status(HTTP_BAD_REQUEST, "Bad Request -- need Host header");
return;
}
std::ostringstream ostr;
ostr << "http://" << host << "/web/server/api";
- ostr << context[CONTEXT_REQUEST]["path"].asString();
+ ostr << context[CONTEXT_REQUEST][CONTEXT_PATH].asString();
static const std::string DOC_HEADER("X-Documentation-URL");
response->addHeader(DOC_HEADER, ostr.str());
- response->status(200, "OK");
+ response->status(HTTP_OK, "OK");
}
@@ -238,10 +246,10 @@ const LLHTTPNode* LLHTTPNode::traverse(
LLHTTPNode* child = node->getChild(*iter, context);
if(!child)
{
- lldebugs << "LLHTTPNode::traverse: Couldn't find '" << *iter << "'" << llendl;
+ LL_DEBUGS() << "LLHTTPNode::traverse: Couldn't find '" << *iter << "'" << LL_ENDL;
break;
}
- lldebugs << "LLHTTPNode::traverse: Found '" << *iter << "'" << llendl;
+ LL_DEBUGS() << "LLHTTPNode::traverse: Found '" << *iter << "'" << LL_ENDL;
node = child;
}
@@ -275,8 +283,8 @@ void LLHTTPNode::addNode(const std::string& path, LLHTTPNode* nodeToAdd)
if (iter == end)
{
- llwarns << "LLHTTPNode::addNode: already a node that handles "
- << path << llendl;
+ LL_WARNS() << "LLHTTPNode::addNode: already a node that handles "
+ << path << LL_ENDL;
return;
}
@@ -389,17 +397,17 @@ void LLHTTPNode::Response::statusUnknownError(S32 code)
void LLHTTPNode::Response::notFound(const std::string& message)
{
- status(404, message);
+ status(HTTP_NOT_FOUND, message);
}
void LLHTTPNode::Response::notFound()
{
- status(404, "Not Found");
+ status(HTTP_NOT_FOUND, "Not Found");
}
void LLHTTPNode::Response::methodNotAllowed()
{
- status(405, "Method Not Allowed");
+ status(HTTP_METHOD_NOT_ALLOWED, "Method Not Allowed");
}
void LLHTTPNode::Response::addHeader(
@@ -467,7 +475,7 @@ LLSimpleResponse::~LLSimpleResponse()
void LLSimpleResponse::result(const LLSD& result)
{
- status(200, "OK");
+ status(HTTP_OK, "OK");
}
void LLSimpleResponse::extendedResult(S32 code, const std::string& body, const LLSD& headers)
@@ -475,6 +483,11 @@ void LLSimpleResponse::extendedResult(S32 code, const std::string& body, const L
status(code,body);
}
+void LLSimpleResponse::extendedResult(S32 code, const LLSD& r, const LLSD& headers)
+{
+ status(code,"(LLSD)");
+}
+
void LLSimpleResponse::status(S32 code, const std::string& message)
{
mCode = code;
diff --git a/indra/llmessage/llhttpnode.h b/indra/llmessage/llhttpnode.h
index 148647ddde..1144d88be1 100755
--- a/indra/llmessage/llhttpnode.h
+++ b/indra/llmessage/llhttpnode.h
@@ -31,6 +31,17 @@
#include "llrefcount.h"
#include "llsd.h"
+// common strings use for populating the context. basically 'request',
+// 'wildcard', and 'headers'.
+extern const std::string CONTEXT_HEADERS;
+extern const std::string CONTEXT_PATH;
+extern const std::string CONTEXT_QUERY_STRING;
+extern const std::string CONTEXT_REQUEST;
+extern const std::string CONTEXT_RESPONSE;
+extern const std::string CONTEXT_VERB;
+extern const std::string CONTEXT_WILDCARD;
+
+
class LLChainIOFactory;
/**
@@ -60,6 +71,8 @@ class LLChainIOFactory;
*/
class LLHTTPNode
{
+protected:
+ LOG_CLASS(LLHTTPNode);
public:
LLHTTPNode();
virtual ~LLHTTPNode();
@@ -100,7 +113,12 @@ public:
/**
* @brief return status code and message with headers.
*/
- virtual void extendedResult(S32 code, const std::string& message, const LLSD& headers) = 0;
+ virtual void extendedResult(S32 code, const std::string& message, const LLSD& headers = LLSD()) = 0;
+
+ /**
+ * @brief return status code and LLSD result with headers.
+ */
+ virtual void extendedResult(S32 code, const LLSD& result, const LLSD& headers = LLSD()) = 0;
/**
* @brief return status code and reason string on http header,
@@ -118,7 +136,7 @@ public:
virtual void methodNotAllowed();
/**
- * @breif Add a name: value http header.
+ * @brief Add a name: value http header.
*
* No effort is made to ensure the response is a valid http
* header.
@@ -187,15 +205,15 @@ public:
name, and return true if the name will construct to a valid url.
For convenience, the <code>getChild()</code> method above will
automatically insert the name in
- context["request"]["wildcard"][key] if this method returns true.
+ context[CONTEXT_REQUEST][CONTEXT_WILDCARD][key] if this method returns true.
For example, the node "agent/<agent_id>/detail" will set
- context["request"]["wildcard"]["agent_id"] eqaul to the value
+ context[CONTEXT_REQUEST][CONTEXT_WILDCARD]["agent_id"] eqaul to the value
found during traversal.
*/
const LLHTTPNode* traverse(const std::string& path, LLSD& context) const;
/**< find a node, if any, that can service this path
- set up context["request"] information
+ set up context[CONTEXT_REQUEST] information
*/
//@}
@@ -287,7 +305,7 @@ public:
void result(const LLSD& result);
void extendedResult(S32 code, const std::string& body, const LLSD& headers);
-
+ void extendedResult(S32 code, const LLSD& result, const LLSD& headers);
void status(S32 code, const std::string& message);
void print(std::ostream& out) const;
diff --git a/indra/llmessage/llhttpsender.cpp b/indra/llmessage/llhttpsender.cpp
index d0bd343db6..5363088d79 100755
--- a/indra/llmessage/llhttpsender.cpp
+++ b/indra/llmessage/llhttpsender.cpp
@@ -54,14 +54,14 @@ void LLHTTPSender::send(const LLHost& host, const std::string& name,
// Default implementation inserts sender, message and sends HTTP POST
std::ostringstream stream;
stream << "http://" << host << "/trusted-message/" << name;
- llinfos << "LLHTTPSender::send: POST to " << stream.str() << llendl;
+ LL_INFOS() << "LLHTTPSender::send: POST to " << stream.str() << LL_ENDL;
LLHTTPClient::post(stream.str(), body, response);
}
//static
void LLHTTPSender::setSender(const LLHost& host, LLHTTPSender* sender)
{
- llinfos << "LLHTTPSender::setSender " << host << llendl;
+ LL_INFOS() << "LLHTTPSender::setSender " << host << LL_ENDL;
senderMap[host] = sender;
}
diff --git a/indra/llmessage/llinstantmessage.cpp b/indra/llmessage/llinstantmessage.cpp
index b0275c161b..b7f3e6e4f7 100755
--- a/indra/llmessage/llinstantmessage.cpp
+++ b/indra/llmessage/llinstantmessage.cpp
@@ -111,7 +111,7 @@ LLIMInfo::~LLIMInfo()
void LLIMInfo::packInstantMessage(LLMessageSystem* msg) const
{
- lldebugs << "LLIMInfo::packInstantMessage()" << llendl;
+ LL_DEBUGS() << "LLIMInfo::packInstantMessage()" << LL_ENDL;
msg->newMessageFast(_PREHASH_ImprovedInstantMessage);
packMessageBlock(msg);
}
@@ -161,7 +161,7 @@ void pack_instant_message(
const U8* binary_bucket,
S32 binary_bucket_size)
{
- lldebugs << "pack_instant_message()" << llendl;
+ LL_DEBUGS() << "pack_instant_message()" << LL_ENDL;
msg->newMessageFast(_PREHASH_ImprovedInstantMessage);
pack_instant_message_block(
msg,
@@ -228,7 +228,7 @@ void pack_instant_message_block(
if (num_written < 0 || num_written >= MTUBYTES)
{
num_written = MTUBYTES - 1;
- llwarns << "pack_instant_message_block: message truncated: " << message << llendl;
+ LL_WARNS() << "pack_instant_message_block: message truncated: " << message << LL_ENDL;
}
bytes_left -= num_written;
diff --git a/indra/llmessage/lliobuffer.cpp b/indra/llmessage/lliobuffer.cpp
index ed00e230ac..bbd7b8777d 100755
--- a/indra/llmessage/lliobuffer.cpp
+++ b/indra/llmessage/lliobuffer.cpp
@@ -109,6 +109,6 @@ LLIOPipe::EStatus LLIOBuffer::process_impl(
LLPumpIO* pump)
{
// no-op (I think)
- llwarns << "You are using an LLIOBuffer which is deprecated." << llendl;
+ LL_WARNS() << "You are using an LLIOBuffer which is deprecated." << LL_ENDL;
return STATUS_OK;
}
diff --git a/indra/llmessage/lliohttpserver.cpp b/indra/llmessage/lliohttpserver.cpp
index 1236fc8b71..d9042fa8b0 100755
--- a/indra/llmessage/lliohttpserver.cpp
+++ b/indra/llmessage/lliohttpserver.cpp
@@ -33,6 +33,8 @@
#include "llapr.h"
#include "llbuffer.h"
#include "llbufferstream.h"
+#include "llhttpconstants.h"
+#include "llfasttimer.h"
#include "llhttpnode.h"
#include "lliopipe.h"
#include "lliosocket.h"
@@ -49,15 +51,6 @@
#include <boost/tokenizer.hpp>
static const char HTTP_VERSION_STR[] = "HTTP/1.0";
-const std::string CONTEXT_REQUEST("request");
-const std::string CONTEXT_RESPONSE("response");
-const std::string CONTEXT_VERB("verb");
-const std::string CONTEXT_HEADERS("headers");
-const std::string HTTP_VERB_GET("GET");
-const std::string HTTP_VERB_PUT("PUT");
-const std::string HTTP_VERB_POST("POST");
-const std::string HTTP_VERB_DELETE("DELETE");
-const std::string HTTP_VERB_OPTIONS("OPTIONS");
static LLIOHTTPServer::timing_callback_t sTimingCallback = NULL;
static void* sTimingCallbackData = NULL;
@@ -102,7 +95,7 @@ private:
// from LLHTTPNode::Response
virtual void result(const LLSD&);
virtual void extendedResult(S32 code, const std::string& body, const LLSD& headers);
-
+ virtual void extendedResult(S32 code, const LLSD& body, const LLSD& headers);
virtual void status(S32 code, const std::string& message);
void nullPipe();
@@ -122,7 +115,8 @@ private:
STATE_LOCKED,
STATE_GOOD_RESULT,
STATE_STATUS_RESULT,
- STATE_EXTENDED_RESULT
+ STATE_EXTENDED_RESULT,
+ STATE_EXTENDED_LLSD_RESULT
};
State mState;
@@ -132,17 +126,17 @@ private:
void lockChain(LLPumpIO*);
void unlockChain();
- LLSD mGoodResult;
+ LLSD mResult;
S32 mStatusCode;
std::string mStatusMessage;
LLSD mHeaders;
};
-static LLFastTimer::DeclareTimer FTM_PROCESS_HTTP_PIPE("HTTP Pipe");
-static LLFastTimer::DeclareTimer FTM_PROCESS_HTTP_GET("HTTP Get");
-static LLFastTimer::DeclareTimer FTM_PROCESS_HTTP_PUT("HTTP Put");
-static LLFastTimer::DeclareTimer FTM_PROCESS_HTTP_POST("HTTP Post");
-static LLFastTimer::DeclareTimer FTM_PROCESS_HTTP_DELETE("HTTP Delete");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_HTTP_PIPE("HTTP Pipe");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_HTTP_GET("HTTP Get");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_HTTP_PUT("HTTP Put");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_HTTP_POST("HTTP Post");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_HTTP_DELETE("HTTP Delete");
LLIOPipe::EStatus LLHTTPPipe::process_impl(
const LLChannelDescriptors& channels,
@@ -151,9 +145,9 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_PROCESS_HTTP_PIPE);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_HTTP_PIPE);
PUMP_DEBUG;
- lldebugs << "LLSDHTTPServer::process_impl" << llendl;
+ LL_DEBUGS() << "LLSDHTTPServer::process_impl" << LL_ENDL;
// Once we have all the data, We need to read the sd on
// the the in channel, and respond on the out channel
@@ -180,12 +174,12 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl(
std::string verb = context[CONTEXT_REQUEST][CONTEXT_VERB];
if(verb == HTTP_VERB_GET)
{
- LLFastTimer _(FTM_PROCESS_HTTP_GET);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_HTTP_GET);
mNode.get(LLHTTPNode::ResponsePtr(mResponse), context);
}
else if(verb == HTTP_VERB_PUT)
{
- LLFastTimer _(FTM_PROCESS_HTTP_PUT);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_HTTP_PUT);
LLSD input;
if (mNode.getContentType() == LLHTTPNode::CONTENT_TYPE_LLSD)
{
@@ -193,7 +187,7 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl(
}
else if (mNode.getContentType() == LLHTTPNode::CONTENT_TYPE_TEXT)
{
- std::stringstream strstrm;
+ std::ostringstream strstrm;
strstrm << istr.rdbuf();
input = strstrm.str();
}
@@ -201,7 +195,7 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl(
}
else if(verb == HTTP_VERB_POST)
{
- LLFastTimer _(FTM_PROCESS_HTTP_POST);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_HTTP_POST);
LLSD input;
if (mNode.getContentType() == LLHTTPNode::CONTENT_TYPE_LLSD)
{
@@ -209,7 +203,7 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl(
}
else if (mNode.getContentType() == LLHTTPNode::CONTENT_TYPE_TEXT)
{
- std::stringstream strstrm;
+ std::ostringstream strstrm;
strstrm << istr.rdbuf();
input = strstrm.str();
}
@@ -217,7 +211,7 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl(
}
else if(verb == HTTP_VERB_DELETE)
{
- LLFastTimer _(FTM_PROCESS_HTTP_DELETE);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_HTTP_DELETE);
mNode.del(LLHTTPNode::ResponsePtr(mResponse), context);
}
else if(verb == HTTP_VERB_OPTIONS)
@@ -244,15 +238,15 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl(
// Log all HTTP transactions.
// TODO: Add a way to log these to their own file instead of indra.log
// It is just too spammy to be in indra.log.
- lldebugs << verb << " " << context[CONTEXT_REQUEST]["path"].asString()
+ LL_DEBUGS() << verb << " " << context[CONTEXT_REQUEST][CONTEXT_PATH].asString()
<< " " << mStatusCode << " " << mStatusMessage << " " << delta
- << "s" << llendl;
+ << "s" << LL_ENDL;
// Log Internal Server Errors
- //if(mStatusCode == 500)
+ //if(mStatusCode == HTTP_INTERNAL_SERVER_ERROR)
//{
- // llwarns << "LLHTTPPipe::process_impl:500:Internal Server Error"
- // << llendl;
+ // LL_WARNS() << "LLHTTPPipe::process_impl:500:Internal Server Error"
+ // << LL_ENDL;
//}
}
@@ -271,10 +265,10 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl(
case STATE_GOOD_RESULT:
{
LLSD headers = mHeaders;
- headers["Content-Type"] = "application/llsd+xml";
+ headers[HTTP_OUT_HEADER_CONTENT_TYPE] = HTTP_CONTENT_LLSD_XML;
context[CONTEXT_RESPONSE][CONTEXT_HEADERS] = headers;
LLBufferStream ostr(channels, buffer.get());
- LLSDSerialize::toXML(mGoodResult, ostr);
+ LLSDSerialize::toXML(mResult, ostr);
return STATUS_DONE;
}
@@ -282,7 +276,7 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl(
case STATE_STATUS_RESULT:
{
LLSD headers = mHeaders;
- headers["Content-Type"] = "text/plain";
+ headers[HTTP_OUT_HEADER_CONTENT_TYPE] = HTTP_CONTENT_TEXT_PLAIN;
context[CONTEXT_RESPONSE][CONTEXT_HEADERS] = headers;
context[CONTEXT_RESPONSE]["statusCode"] = mStatusCode;
context[CONTEXT_RESPONSE]["statusMessage"] = mStatusMessage;
@@ -300,9 +294,20 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl(
return STATUS_DONE;
}
+ case STATE_EXTENDED_LLSD_RESULT:
+ {
+ LLSD headers = mHeaders;
+ headers[HTTP_OUT_HEADER_CONTENT_TYPE] = HTTP_CONTENT_LLSD_XML;
+ context[CONTEXT_RESPONSE][CONTEXT_HEADERS] = headers;
+ context[CONTEXT_RESPONSE]["statusCode"] = mStatusCode;
+ LLBufferStream ostr(channels, buffer.get());
+ LLSDSerialize::toXML(mResult, ostr);
+
+ return STATUS_DONE;
+ }
default:
- llwarns << "LLHTTPPipe::process_impl: unexpected state "
- << mState << llendl;
+ LL_WARNS() << "LLHTTPPipe::process_impl: unexpected state "
+ << mState << LL_ENDL;
return STATUS_BREAK;
}
@@ -331,23 +336,39 @@ void LLHTTPPipe::Response::result(const LLSD& r)
{
if(! mPipe)
{
- llwarns << "LLHTTPPipe::Response::result: NULL pipe" << llendl;
+ LL_WARNS() << "LLHTTPPipe::Response::result: NULL pipe" << LL_ENDL;
return;
}
- mPipe->mStatusCode = 200;
+ mPipe->mStatusCode = HTTP_OK;
mPipe->mStatusMessage = "OK";
- mPipe->mGoodResult = r;
+ mPipe->mResult = r;
mPipe->mState = STATE_GOOD_RESULT;
mPipe->mHeaders = mHeaders;
- mPipe->unlockChain();
+ mPipe->unlockChain();
+}
+
+void LLHTTPPipe::Response::extendedResult(S32 code, const LLSD& r, const LLSD& headers)
+{
+ if(! mPipe)
+ {
+ LL_WARNS() << "LLHTTPPipe::Response::extendedResult: NULL pipe" << LL_ENDL;
+ return;
+ }
+
+ mPipe->mStatusCode = code;
+ mPipe->mStatusMessage = "(LLSD)";
+ mPipe->mResult = r;
+ mPipe->mHeaders = headers;
+ mPipe->mState = STATE_EXTENDED_LLSD_RESULT;
+ mPipe->unlockChain();
}
void LLHTTPPipe::Response::extendedResult(S32 code, const std::string& body, const LLSD& headers)
{
if(! mPipe)
{
- llwarns << "LLHTTPPipe::Response::status: NULL pipe" << llendl;
+ LL_WARNS() << "LLHTTPPipe::Response::status: NULL pipe" << LL_ENDL;
return;
}
@@ -363,7 +384,7 @@ void LLHTTPPipe::Response::status(S32 code, const std::string& message)
{
if(! mPipe)
{
- llwarns << "LLHTTPPipe::Response::status: NULL pipe" << llendl;
+ LL_WARNS() << "LLHTTPPipe::Response::status: NULL pipe" << LL_ENDL;
return;
}
@@ -434,7 +455,7 @@ protected:
* LLHTTPResponseHeader
*/
-static LLFastTimer::DeclareTimer FTM_PROCESS_HTTP_HEADER("HTTP Header");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_HTTP_HEADER("HTTP Header");
// virtual
LLIOPipe::EStatus LLHTTPResponseHeader::process_impl(
@@ -444,7 +465,7 @@ LLIOPipe::EStatus LLHTTPResponseHeader::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_PROCESS_HTTP_HEADER);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_HTTP_HEADER);
PUMP_DEBUG;
if(eos)
{
@@ -454,9 +475,9 @@ LLIOPipe::EStatus LLHTTPResponseHeader::process_impl(
std::string message = context[CONTEXT_RESPONSE]["statusMessage"];
int code = context[CONTEXT_RESPONSE]["statusCode"];
- if (code < 200)
+ if (code < HTTP_OK)
{
- code = 200;
+ code = HTTP_OK;
message = "OK";
}
@@ -465,7 +486,7 @@ LLIOPipe::EStatus LLHTTPResponseHeader::process_impl(
S32 content_length = buffer->countAfter(channels.in(), NULL);
if(0 < content_length)
{
- ostr << "Content-Length: " << content_length << "\r\n";
+ ostr << HTTP_OUT_HEADER_CONTENT_LENGTH << ": " << content_length << "\r\n";
}
// *NOTE: This guard can go away once the LLSD static map
// iterator is available. Phoenix. 2008-05-09
@@ -594,7 +615,7 @@ LLHTTPResponder::LLHTTPResponder(const LLHTTPNode& tree, const LLSD& ctx) :
// virtual
LLHTTPResponder::~LLHTTPResponder()
{
- //lldebugs << "destroying LLHTTPResponder" << llendl;
+ //LL_DEBUGS() << "destroying LLHTTPResponder" << LL_ENDL;
}
bool LLHTTPResponder::readHeaderLine(
@@ -611,7 +632,7 @@ bool LLHTTPResponder::readHeaderLine(
{
if(len)
{
- lldebugs << "readLine failed - too long maybe?" << llendl;
+ LL_DEBUGS() << "readLine failed - too long maybe?" << LL_ENDL;
markBad(channels, buffer);
}
return false;
@@ -634,7 +655,7 @@ void LLHTTPResponder::markBad(
<< "</body>\n</html>\n";
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_HTTP_RESPONDER("HTTP Responder");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_HTTP_RESPONDER("HTTP Responder");
// virtual
LLIOPipe::EStatus LLHTTPResponder::process_impl(
@@ -644,7 +665,7 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_PROCESS_HTTP_RESPONDER);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_HTTP_RESPONDER);
PUMP_DEBUG;
LLIOPipe::EStatus status = STATUS_OK;
@@ -667,8 +688,8 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl(
{
memcpy(buf, (*seg_iter).data(), (*seg_iter).size()); /*Flawfinder: ignore*/
buf[(*seg_iter).size()] = '\0';
- llinfos << (*seg_iter).getChannel() << ": " << buf
- << llendl;
+ LL_INFOS() << (*seg_iter).getChannel() << ": " << buf
+ << LL_ENDL;
++seg_iter;
}
}
@@ -694,10 +715,10 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl(
header >> mAbsPathAndQuery;
header >> mVersion;
- lldebugs << "http request: "
+ LL_DEBUGS() << "http request: "
<< mVerb
<< " " << mAbsPathAndQuery
- << " " << mVersion << llendl;
+ << " " << mVersion << LL_ENDL;
std::string::size_type delimiter
= mAbsPathAndQuery.find('?');
@@ -727,7 +748,7 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl(
{
read_next_line = false;
parse_all = false;
- lldebugs << "unknown http verb: " << mVerb << llendl;
+ LL_DEBUGS() << "unknown http verb: " << mVerb << LL_ENDL;
markBad(channels, buffer);
}
}
@@ -762,7 +783,7 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl(
if(NULL == pos_colon)
{
keep_parsing = false;
- lldebugs << "bad header: " << buf << llendl;
+ LL_DEBUGS() << "bad header: " << buf << LL_ENDL;
markBad(channels, buffer);
break;
}
@@ -771,9 +792,9 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl(
std::string name(buf, pos_colon - buf);
std::string value(pos_colon + 2);
LLStringUtil::toLower(name);
- if("content-length" == name)
+ if(HTTP_IN_HEADER_CONTENT_LENGTH == name)
{
- lldebugs << "Content-Length: " << value << llendl;
+ LL_DEBUGS() << "Content-Length: " << value << LL_ENDL;
mContentLength = atoi(value.c_str());
}
else
@@ -810,8 +831,8 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl(
const LLHTTPNode* node = mRootNode.traverse(mPath, context);
if(node)
{
- //llinfos << "LLHTTPResponder::process_impl found node for "
- // << mAbsPathAndQuery << llendl;
+ //LL_INFOS() << "LLHTTPResponder::process_impl found node for "
+ // << mAbsPathAndQuery << LL_ENDL;
// Copy everything after mLast read to the out.
LLBufferArray::segment_iterator_t seg_iter;
@@ -831,8 +852,8 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl(
{
memcpy(buf, (*seg_iter).data(), (*seg_iter).size()); /*Flawfinder: ignore*/
buf[(*seg_iter).size()] = '\0';
- llinfos << (*seg_iter).getChannel() << ": " << buf
- << llendl;
+ LL_INFOS() << (*seg_iter).getChannel() << ": " << buf
+ << LL_ENDL;
++seg_iter;
}
#endif
@@ -846,19 +867,19 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl(
// HTTP headers.
LLPumpIO::chain_t chain;
chain.push_back(LLIOPipe::ptr_t(new LLIOFlush));
- context[CONTEXT_REQUEST]["path"] = mPath;
- context[CONTEXT_REQUEST]["query-string"] = mQuery;
- context[CONTEXT_REQUEST]["remote-host"]
- = mBuildContext["remote-host"];
- context[CONTEXT_REQUEST]["remote-port"]
- = mBuildContext["remote-port"];
+ context[CONTEXT_REQUEST][CONTEXT_PATH] = mPath;
+ context[CONTEXT_REQUEST][CONTEXT_QUERY_STRING] = mQuery;
+ context[CONTEXT_REQUEST][CONTEXT_REMOTE_HOST]
+ = mBuildContext[CONTEXT_REMOTE_HOST];
+ context[CONTEXT_REQUEST][CONTEXT_REMOTE_PORT]
+ = mBuildContext[CONTEXT_REMOTE_PORT];
context[CONTEXT_REQUEST][CONTEXT_HEADERS] = mHeaders;
const LLChainIOFactory* protocolHandler
= node->getProtocolHandler();
if (protocolHandler)
{
- lldebugs << "HTTP context: " << context << llendl;
+ LL_DEBUGS() << "HTTP context: " << context << LL_ENDL;
protocolHandler->build(chain, context);
}
else
@@ -917,8 +938,8 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl(
}
else
{
- llwarns << "LLHTTPResponder::process_impl didn't find a node for "
- << mAbsPathAndQuery << llendl;
+ LL_WARNS() << "LLHTTPResponder::process_impl didn't find a node for "
+ << mAbsPathAndQuery << LL_ENDL;
LLBufferStream str(channels, buffer.get());
mState = STATE_SHORT_CIRCUIT;
str << HTTP_VERSION_STR << " 404 Not Found\r\n\r\n<html>\n"
@@ -971,7 +992,7 @@ LLHTTPNode& LLIOHTTPServer::create(
port);
if(!socket)
{
- llerrs << "Unable to initialize socket" << llendl;
+ LL_ERRS() << "Unable to initialize socket" << LL_ENDL;
}
LLHTTPResponseFactory* factory = new LLHTTPResponseFactory;
diff --git a/indra/llmessage/lliohttpserver.h b/indra/llmessage/lliohttpserver.h
index 5c1b0531ff..a23eafe58a 100755
--- a/indra/llmessage/lliohttpserver.h
+++ b/indra/llmessage/lliohttpserver.h
@@ -33,18 +33,6 @@
class LLPumpIO;
-// common strings use for populating the context. bascally 'request',
-// 'wildcard', and 'headers'.
-extern const std::string CONTEXT_REQUEST;
-extern const std::string CONTEXT_RESPONSE;
-extern const std::string CONTEXT_VERB;
-extern const std::string CONTEXT_HEADERS;
-extern const std::string HTTP_VERB_GET;
-extern const std::string HTTP_VERB_PUT;
-extern const std::string HTTP_VERB_POST;
-extern const std::string HTTP_VERB_DELETE;
-extern const std::string HTTP_VERB_OPTIONS;
-
class LLIOHTTPServer
{
public:
diff --git a/indra/llmessage/lliopipe.cpp b/indra/llmessage/lliopipe.cpp
index 8f827f7a30..4676a9a8f0 100755
--- a/indra/llmessage/lliopipe.cpp
+++ b/indra/llmessage/lliopipe.cpp
@@ -72,7 +72,7 @@ LLIOPipe::LLIOPipe() :
LLIOPipe::~LLIOPipe()
{
- //lldebugs << "destroying LLIOPipe" << llendl;
+ //LL_DEBUGS() << "destroying LLIOPipe" << LL_ENDL;
}
//virtual
diff --git a/indra/llmessage/lliopipe.h b/indra/llmessage/lliopipe.h
index cbd17b5a3d..9a0a427efd 100755
--- a/indra/llmessage/lliopipe.h
+++ b/indra/llmessage/lliopipe.h
@@ -31,6 +31,7 @@
#include <boost/intrusive_ptr.hpp>
#include <boost/shared_ptr.hpp>
+#include "llwin32headerslean.h"
#include "apr_poll.h"
#include "llsd.h"
diff --git a/indra/llmessage/lliosocket.cpp b/indra/llmessage/lliosocket.cpp
index 2043bae5e7..b7460df508 100755
--- a/indra/llmessage/lliosocket.cpp
+++ b/indra/llmessage/lliosocket.cpp
@@ -32,6 +32,7 @@
#include "llapr.h"
#include "llbuffer.h"
+#include "llfasttimer.h"
#include "llhost.h"
#include "llpumpio.h"
@@ -39,6 +40,9 @@
// constants
//
+const std::string CONTEXT_REMOTE_HOST("remote-host");
+const std::string CONTEXT_REMOTE_PORT("remote-port");
+
static const S32 LL_DEFAULT_LISTEN_BACKLOG = 10;
static const S32 LL_SEND_BUFFER_SIZE = 40000;
static const S32 LL_RECV_BUFFER_SIZE = 40000;
@@ -73,7 +77,7 @@ void ll_debug_socket(const char* msg, apr_socket_t* apr_sock)
#if LL_DEBUG_SOCKET_FILE_DESCRIPTORS
if(!apr_sock)
{
- lldebugs << "Socket -- " << (msg?msg:"") << ": no socket." << llendl;
+ LL_DEBUGS() << "Socket -- " << (msg?msg:"") << ": no socket." << LL_ENDL;
return;
}
// *TODO: Why doesn't this work?
@@ -81,13 +85,13 @@ void ll_debug_socket(const char* msg, apr_socket_t* apr_sock)
int os_sock;
if(APR_SUCCESS == apr_os_sock_get(&os_sock, apr_sock))
{
- lldebugs << "Socket -- " << (msg?msg:"") << " on fd " << os_sock
- << " at " << apr_sock << llendl;
+ LL_DEBUGS() << "Socket -- " << (msg?msg:"") << " on fd " << os_sock
+ << " at " << apr_sock << LL_ENDL;
}
else
{
- lldebugs << "Socket -- " << (msg?msg:"") << " no fd "
- << " at " << apr_sock << llendl;
+ LL_DEBUGS() << "Socket -- " << (msg?msg:"") << " no fd "
+ << " at " << apr_sock << LL_ENDL;
}
#endif
}
@@ -165,13 +169,13 @@ LLSocket::ptr_t LLSocket::create(apr_pool_t* pool, EType type, U16 port)
rv.reset();
return rv;
}
- lldebugs << "Bound " << ((DATAGRAM_UDP == type) ? "udp" : "tcp")
- << " socket to port: " << sa->port << llendl;
+ LL_DEBUGS() << "Bound " << ((DATAGRAM_UDP == type) ? "udp" : "tcp")
+ << " socket to port: " << sa->port << LL_ENDL;
if(STREAM_TCP == type)
{
// If it's a stream based socket, we need to tell the OS
// to keep a queue of incoming connections for ACCEPT.
- lldebugs << "Setting listen state for socket." << llendl;
+ LL_DEBUGS() << "Setting listen state for socket." << LL_ENDL;
status = apr_socket_listen(
socket,
LL_DEFAULT_LISTEN_BACKLOG);
@@ -290,10 +294,10 @@ LLIOSocketReader::LLIOSocketReader(LLSocket::ptr_t socket) :
LLIOSocketReader::~LLIOSocketReader()
{
- //lldebugs << "Destroying LLIOSocketReader" << llendl;
+ //LL_DEBUGS() << "Destroying LLIOSocketReader" << LL_ENDL;
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_SOCKET_READER("Socket Reader");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_SOCKET_READER("Socket Reader");
// virtual
LLIOPipe::EStatus LLIOSocketReader::process_impl(
@@ -303,7 +307,7 @@ LLIOPipe::EStatus LLIOSocketReader::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_PROCESS_SOCKET_READER);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_SOCKET_READER);
PUMP_DEBUG;
if(!mSource) return STATUS_PRECONDITION_NOT_MET;
if(!mInitialized)
@@ -315,8 +319,8 @@ LLIOPipe::EStatus LLIOSocketReader::process_impl(
if(pump)
{
PUMP_DEBUG;
- lldebugs << "Initializing poll descriptor for LLIOSocketReader."
- << llendl;
+ LL_DEBUGS() << "Initializing poll descriptor for LLIOSocketReader."
+ << LL_ENDL;
apr_pollfd_t poll_fd;
poll_fd.p = NULL;
poll_fd.desc_type = APR_POLL_SOCKET;
@@ -343,7 +347,7 @@ LLIOPipe::EStatus LLIOSocketReader::process_impl(
status = apr_socket_recv(mSource->getSocket(), read_buf, &len);
buffer->append(channels.out(), (U8*)read_buf, len);
} while((APR_SUCCESS == status) && (READ_BUFFER_SIZE == len));
- lldebugs << "socket read status: " << status << llendl;
+ LL_DEBUGS() << "socket read status: " << status << LL_ENDL;
LLIOPipe::EStatus rv = STATUS_OK;
PUMP_DEBUG;
@@ -390,10 +394,10 @@ LLIOSocketWriter::LLIOSocketWriter(LLSocket::ptr_t socket) :
LLIOSocketWriter::~LLIOSocketWriter()
{
- //lldebugs << "Destroying LLIOSocketWriter" << llendl;
+ //LL_DEBUGS() << "Destroying LLIOSocketWriter" << LL_ENDL;
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_SOCKET_WRITER("Socket Writer");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_SOCKET_WRITER("Socket Writer");
// virtual
LLIOPipe::EStatus LLIOSocketWriter::process_impl(
const LLChannelDescriptors& channels,
@@ -402,7 +406,7 @@ LLIOPipe::EStatus LLIOSocketWriter::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_PROCESS_SOCKET_WRITER);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_SOCKET_WRITER);
PUMP_DEBUG;
if(!mDestination) return STATUS_PRECONDITION_NOT_MET;
if(!mInitialized)
@@ -414,8 +418,8 @@ LLIOPipe::EStatus LLIOSocketWriter::process_impl(
if(pump)
{
PUMP_DEBUG;
- lldebugs << "Initializing poll descriptor for LLIOSocketWriter."
- << llendl;
+ LL_DEBUGS() << "Initializing poll descriptor for LLIOSocketWriter."
+ << LL_ENDL;
apr_pollfd_t poll_fd;
poll_fd.p = NULL;
poll_fd.desc_type = APR_POLL_SOCKET;
@@ -541,7 +545,7 @@ LLIOServerSocket::LLIOServerSocket(
LLIOServerSocket::~LLIOServerSocket()
{
- //lldebugs << "Destroying LLIOServerSocket" << llendl;
+ //LL_DEBUGS() << "Destroying LLIOServerSocket" << LL_ENDL;
}
void LLIOServerSocket::setResponseTimeout(F32 timeout_secs)
@@ -549,7 +553,7 @@ void LLIOServerSocket::setResponseTimeout(F32 timeout_secs)
mResponseTimeout = timeout_secs;
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_SERVER_SOCKET("Server Socket");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_SERVER_SOCKET("Server Socket");
// virtual
LLIOPipe::EStatus LLIOServerSocket::process_impl(
const LLChannelDescriptors& channels,
@@ -558,11 +562,11 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_PROCESS_SERVER_SOCKET);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_SERVER_SOCKET);
PUMP_DEBUG;
if(!pump)
{
- llwarns << "Need a pump for server socket." << llendl;
+ LL_WARNS() << "Need a pump for server socket." << LL_ENDL;
return STATUS_ERROR;
}
if(!mInitialized)
@@ -571,8 +575,8 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl(
// This segment sets up the pump so that we do not call
// process again until we have an incoming read, aka connect()
// from a remote host.
- lldebugs << "Initializing poll descriptor for LLIOServerSocket."
- << llendl;
+ LL_DEBUGS() << "Initializing poll descriptor for LLIOServerSocket."
+ << LL_ENDL;
apr_pollfd_t poll_fd;
poll_fd.p = NULL;
poll_fd.desc_type = APR_POLL_SOCKET;
@@ -587,7 +591,7 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl(
// we are initialized, and told to process, so we must have a
// socket waiting for a connection.
- lldebugs << "accepting socket" << llendl;
+ LL_DEBUGS() << "accepting socket" << LL_ENDL;
PUMP_DEBUG;
apr_pool_t* new_pool = NULL;
@@ -619,8 +623,8 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl(
apr_sockaddr_ip_get(&remote_host_string, remote_addr);
LLSD context;
- context["remote-host"] = remote_host_string;
- context["remote-port"] = remote_addr->port;
+ context[CONTEXT_REMOTE_HOST] = remote_host_string;
+ context[CONTEXT_REMOTE_PORT] = remote_addr->port;
LLPumpIO::chain_t chain;
chain.push_back(LLIOPipe::ptr_t(new LLIOSocketReader(llsocket)));
@@ -632,12 +636,12 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl(
}
else
{
- llwarns << "Unable to build reactor to socket." << llendl;
+ LL_WARNS() << "Unable to build reactor to socket." << LL_ENDL;
}
}
else
{
- llwarns << "Unable to create linden socket." << llendl;
+ LL_WARNS() << "Unable to create linden socket." << LL_ENDL;
}
PUMP_DEBUG;
@@ -677,7 +681,7 @@ LLIODataSocket::LLIODataSocket(
if(ll_apr_warn_status(status)) return;
if(sa->port)
{
- lldebugs << "Bound datagram socket to port: " << sa->port << llendl;
+ LL_DEBUGS() << "Bound datagram socket to port: " << sa->port << LL_ENDL;
mPort = sa->port;
}
else
diff --git a/indra/llmessage/lliosocket.h b/indra/llmessage/lliosocket.h
index be0f7dfcc6..f840f0275c 100755
--- a/indra/llmessage/lliosocket.h
+++ b/indra/llmessage/lliosocket.h
@@ -38,10 +38,14 @@
*/
#include "lliopipe.h"
+#include "llwin32headerslean.h"
#include "apr_pools.h"
#include "apr_network_io.h"
#include "llchainio.h"
+extern const std::string CONTEXT_REMOTE_HOST;
+extern const std::string CONTEXT_REMOTE_PORT;
+
class LLHost;
/**
diff --git a/indra/llmessage/llioutil.cpp b/indra/llmessage/llioutil.cpp
index 8c50fd5069..b8443c0600 100755
--- a/indra/llmessage/llioutil.cpp
+++ b/indra/llmessage/llioutil.cpp
@@ -28,6 +28,7 @@
#include "linden_common.h"
#include "llioutil.h"
+#include "llfasttimer.h"
/**
* LLIOFlush
@@ -44,7 +45,7 @@ LLIOPipe::EStatus LLIOFlush::process_impl(
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_SLEEP("IO Sleep");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_SLEEP("IO Sleep");
/**
* @class LLIOSleep
*/
@@ -55,7 +56,7 @@ LLIOPipe::EStatus LLIOSleep::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_PROCESS_SLEEP);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_SLEEP);
if(mSeconds > 0.0)
{
if(pump) pump->sleepChain(mSeconds);
@@ -65,7 +66,7 @@ LLIOPipe::EStatus LLIOSleep::process_impl(
return STATUS_DONE;
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_ADD_CHAIN("Add Chain");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_ADD_CHAIN("Add Chain");
/**
* @class LLIOAddChain
*/
@@ -76,7 +77,7 @@ LLIOPipe::EStatus LLIOAddChain::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_PROCESS_ADD_CHAIN);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_ADD_CHAIN);
pump->addChain(mChain, mTimeout);
return STATUS_DONE;
}
diff --git a/indra/llmessage/llmail.cpp b/indra/llmessage/llmail.cpp
index 08b31e9c7a..134154aa6c 100755
--- a/indra/llmessage/llmail.cpp
+++ b/indra/llmessage/llmail.cpp
@@ -29,12 +29,7 @@
#include "llmail.h"
// APR on Windows needs full windows headers
-#ifdef LL_WINDOWS
-# undef WIN32_LEAN_AND_MEAN
-# include <winsock2.h>
-# include <windows.h>
-#endif
-
+#include "llwin32headers.h"
#include <string>
#include <sstream>
@@ -199,16 +194,16 @@ std::string LLMail::buildSMTPTransaction(
{
if(!from_address || !to_address)
{
- llinfos << "send_mail build_smtp_transaction reject: missing to and/or"
- << " from address." << llendl;
+ LL_INFOS() << "send_mail build_smtp_transaction reject: missing to and/or"
+ << " from address." << LL_ENDL;
return std::string();
}
if(!valid_subject_chars(subject))
{
- llinfos << "send_mail build_smtp_transaction reject: bad subject header: "
+ LL_INFOS() << "send_mail build_smtp_transaction reject: bad subject header: "
<< "to=<" << to_address
<< ">, from=<" << from_address << ">"
- << llendl;
+ << LL_ENDL;
return std::string();
}
std::ostringstream from_fmt;
@@ -265,8 +260,8 @@ bool LLMail::send(
{
if(!from_address || !to_address)
{
- llinfos << "send_mail reject: missing to and/or from address."
- << llendl;
+ LL_INFOS() << "send_mail reject: missing to and/or from address."
+ << LL_ENDL;
return false;
}
@@ -303,26 +298,26 @@ bool LLMail::send(
if(!gMailEnabled)
{
- llinfos << "send_mail reject: mail system is disabled: to=<"
+ LL_INFOS() << "send_mail reject: mail system is disabled: to=<"
<< to_address << ">, from=<" << from_address
- << ">" << llendl;
+ << ">" << LL_ENDL;
// Any future interface to SMTP should return this as an
// error. --mark
return true;
}
if(!gSockAddr)
{
- llwarns << "send_mail reject: mail system not initialized: to=<"
+ LL_WARNS() << "send_mail reject: mail system not initialized: to=<"
<< to_address << ">, from=<" << from_address
- << ">" << llendl;
+ << ">" << LL_ENDL;
return false;
}
if(!connect_smtp())
{
- llwarns << "send_mail reject: SMTP connect failure: to=<"
+ LL_WARNS() << "send_mail reject: SMTP connect failure: to=<"
<< to_address << ">, from=<" << from_address
- << ">" << llendl;
+ << ">" << LL_ENDL;
return false;
}
@@ -338,27 +333,27 @@ bool LLMail::send(
disconnect_smtp();
if(ll_apr_warn_status(status))
{
- llwarns << "send_mail socket failure: unable to write "
+ LL_WARNS() << "send_mail socket failure: unable to write "
<< "to=<" << to_address
<< ">, from=<" << from_address << ">"
<< ", bytes=" << original_size
- << ", sent=" << send_size << llendl;
+ << ", sent=" << send_size << LL_ENDL;
return false;
}
if(send_size >= LL_MAX_KNOWN_GOOD_MAIL_SIZE)
{
- llwarns << "send_mail message has been shown to fail in testing "
+ LL_WARNS() << "send_mail message has been shown to fail in testing "
<< "when sending messages larger than " << LL_MAX_KNOWN_GOOD_MAIL_SIZE
- << " bytes. The next log about success is potentially a lie." << llendl;
+ << " bytes. The next log about success is potentially a lie." << LL_ENDL;
}
- lldebugs << "send_mail success: "
+ LL_DEBUGS() << "send_mail success: "
<< "to=<" << to_address
<< ">, from=<" << from_address << ">"
<< ", bytes=" << original_size
- << ", sent=" << send_size << llendl;
+ << ", sent=" << send_size << LL_ENDL;
#if LL_LOG_ENTIRE_MAIL_MESSAGE_ON_SEND
- llinfos << rfc2822_msg.str() << llendl;
+ LL_INFOS() << rfc2822_msg.str() << LL_ENDL;
#endif
return true;
}
diff --git a/indra/llmessage/llmessageconfig.cpp b/indra/llmessage/llmessageconfig.cpp
index 539efc65f8..f8b2c8f5a6 100755
--- a/indra/llmessage/llmessageconfig.cpp
+++ b/indra/llmessage/llmessageconfig.cpp
@@ -145,9 +145,9 @@ void LLMessageConfigFile::loadMessages(const LLSD& data)
std::ostringstream out;
LLSDXMLFormatter *formatter = new LLSDXMLFormatter;
formatter->format(mMessages, out);
- llinfos << "loading ... " << out.str()
+ LL_INFOS() << "loading ... " << out.str()
<< " LLMessageConfigFile::loadMessages loaded "
- << mMessages.size() << " messages" << llendl;
+ << mMessages.size() << " messages" << LL_ENDL;
#endif
}
@@ -182,7 +182,7 @@ void LLMessageConfigFile::loadMessageBans(const LLSD& data)
bool LLMessageConfigFile::isCapBanned(const std::string& cap_name) const
{
- lldebugs << "mCapBans is " << LLSDNotationStreamer(mCapBans) << llendl;
+ LL_DEBUGS() << "mCapBans is " << LLSDNotationStreamer(mCapBans) << LL_ENDL;
return mCapBans[cap_name];
}
@@ -268,7 +268,7 @@ bool LLMessageConfig::isValidMessage(const std::string& msg_name)
{
if (sServerName.empty())
{
- llerrs << "LLMessageConfig::initClass() not called" << llendl;
+ LL_ERRS() << "LLMessageConfig::initClass() not called" << LL_ENDL;
}
LLMessageConfigFile& file = LLMessageConfigFile::instance();
return file.mMessages.has(msg_name);
@@ -294,8 +294,8 @@ LLSD LLMessageConfig::getConfigForMessage(const std::string& msg_name)
{
if (sServerName.empty())
{
- llerrs << "LLMessageConfig::isMessageTrusted(name) before"
- << " LLMessageConfig::initClass()" << llendl;
+ LL_ERRS() << "LLMessageConfig::isMessageTrusted(name) before"
+ << " LLMessageConfig::initClass()" << LL_ENDL;
}
LLMessageConfigFile& file = LLMessageConfigFile::instance();
// LLSD for the CamelCase message name
diff --git a/indra/llmessage/llmessagetemplate.cpp b/indra/llmessage/llmessagetemplate.cpp
index d64123ad62..c4c7e66703 100755
--- a/indra/llmessage/llmessagetemplate.cpp
+++ b/indra/llmessage/llmessagetemplate.cpp
@@ -39,8 +39,8 @@ void LLMsgVarData::addData(const void *data, S32 size, EMsgVariableType type, S3
{
if (mType != type)
{
- llwarns << "Type mismatch in LLMsgVarData::addData for " << mName
- << llendl;
+ LL_WARNS() << "Type mismatch in LLMsgVarData::addData for " << mName
+ << LL_ENDL;
}
}
if(size)
@@ -181,12 +181,12 @@ void LLMessageTemplate::banUdp()
};
if (mDeprecation != MD_DEPRECATED)
{
- llinfos << "Setting " << mName << " to UDPBlackListed was " << deprecation[mDeprecation] << llendl;
+ LL_INFOS() << "Setting " << mName << " to UDPBlackListed was " << deprecation[mDeprecation] << LL_ENDL;
mDeprecation = MD_UDPBLACKLISTED;
}
else
{
- llinfos << mName << " is already more deprecated than UDPBlackListed" << llendl;
+ LL_INFOS() << mName << " is already more deprecated than UDPBlackListed" << LL_ENDL;
}
}
diff --git a/indra/llmessage/llmessagetemplate.h b/indra/llmessage/llmessagetemplate.h
index 005a49cedf..a44e16fc3a 100755
--- a/indra/llmessage/llmessagetemplate.h
+++ b/indra/llmessage/llmessagetemplate.h
@@ -27,9 +27,9 @@
#ifndef LL_LLMESSAGETEMPLATE_H
#define LL_LLMESSAGETEMPLATE_H
-#include "lldarray.h"
#include "message.h" // TODO: babbage: Remove...
#include "llstl.h"
+#include "llindexedvector.h"
class LLMsgVarData
{
@@ -102,7 +102,7 @@ public:
}
S32 mBlockNumber;
- typedef LLDynamicArrayIndexed<LLMsgVarData, const char *, 8> msg_var_data_map_t;
+ typedef LLIndexedVector<LLMsgVarData, const char *, 8> msg_var_data_map_t;
msg_var_data_map_t mMemberVarData;
char *mName;
S32 mTotalSize;
@@ -194,7 +194,7 @@ public:
LLMessageVariable** varp = &mMemberVariables[name];
if (*varp != NULL)
{
- llerrs << name << " has already been used as a variable name!" << llendl;
+ LL_ERRS() << name << " has already been used as a variable name!" << LL_ENDL;
}
*varp = new LLMessageVariable(name, type, size);
if (((*varp)->getType() != MVT_VARIABLE)
@@ -226,7 +226,7 @@ public:
friend std::ostream& operator<<(std::ostream& s, LLMessageBlock &msg);
- typedef LLDynamicArrayIndexed<LLMessageVariable*, const char *, 8> message_variable_map_t;
+ typedef LLIndexedVector<LLMessageVariable*, const char *, 8> message_variable_map_t;
message_variable_map_t mMemberVariables;
char *mName;
EMsgBlockType mType;
@@ -302,8 +302,8 @@ public:
LLMessageBlock** member_blockp = &mMemberBlocks[blockp->mName];
if (*member_blockp != NULL)
{
- llerrs << "Block " << blockp->mName
- << "has already been used as a block name!" << llendl;
+ LL_ERRS() << "Block " << blockp->mName
+ << "has already been used as a block name!" << LL_ENDL;
}
*member_blockp = blockp;
if ( (mTotalSize != -1)
@@ -392,7 +392,7 @@ public:
}
public:
- typedef LLDynamicArrayIndexed<LLMessageBlock*, char*, 8> message_block_map_t;
+ typedef LLIndexedVector<LLMessageBlock*, char*, 8> message_block_map_t;
message_block_map_t mMemberBlocks;
char *mName;
EMsgFrequency mFrequency;
diff --git a/indra/llmessage/llmessagetemplateparser.cpp b/indra/llmessage/llmessagetemplateparser.cpp
index b0f19df47c..1f7c09dbe5 100755
--- a/indra/llmessage/llmessagetemplateparser.cpp
+++ b/indra/llmessage/llmessagetemplateparser.cpp
@@ -165,13 +165,13 @@ BOOL b_check_token(const char *token, const char *regexp)
if (current_checker == -1)
{
- llerrs << "Invalid regular expression value!" << llendl;
+ LL_ERRS() << "Invalid regular expression value!" << LL_ENDL;
return FALSE;
}
if (current_checker == 9999)
{
- llerrs << "Regular expression can't start with *!" << llendl;
+ LL_ERRS() << "Regular expression can't start with *!" << LL_ENDL;
return FALSE;
}
@@ -179,7 +179,7 @@ BOOL b_check_token(const char *token, const char *regexp)
{
if (current_checker == -1)
{
- llerrs << "Input exceeds regular expression!\nDid you forget a *?" << llendl;
+ LL_ERRS() << "Input exceeds regular expression!\nDid you forget a *?" << LL_ENDL;
return FALSE;
}
@@ -204,7 +204,7 @@ BOOL b_variable_ok(const char *token)
{
if (!b_check_token(token, "fv*"))
{
- llwarns << "Token '" << token << "' isn't a variable!" << llendl;
+ LL_WARNS() << "Token '" << token << "' isn't a variable!" << LL_ENDL;
return FALSE;
}
return TRUE;
@@ -215,7 +215,7 @@ BOOL b_integer_ok(const char *token)
{
if (!b_check_token(token, "sd*"))
{
- llwarns << "Token isn't an integer!" << llendl;
+ LL_WARNS() << "Token isn't an integer!" << LL_ENDL;
return FALSE;
}
return TRUE;
@@ -226,7 +226,7 @@ BOOL b_positive_integer_ok(const char *token)
{
if (!b_check_token(token, "d*"))
{
- llwarns << "Token isn't an integer!" << llendl;
+ LL_WARNS() << "Token isn't an integer!" << LL_ENDL;
return FALSE;
}
return TRUE;
@@ -359,13 +359,13 @@ void LLTemplateTokenizer::error(std::string message) const
{
if(atEOF())
{
- llerrs << "Unexpected end of file: " << message << llendl;
+ LL_ERRS() << "Unexpected end of file: " << message << LL_ENDL;
}
else
{
- llerrs << "Problem parsing message template at line "
+ LL_ERRS() << "Problem parsing message template at line "
<< line() << ", with token '" << get() << "' : "
- << message << llendl;
+ << message << LL_ENDL;
}
}
@@ -383,12 +383,12 @@ LLTemplateParser::LLTemplateParser(LLTemplateTokenizer & tokens):
std::string vers_string = tokens.next();
mVersion = (F32)atof(vers_string.c_str());
- llinfos << "### Message template version " << mVersion << " ###" << llendl;
+ LL_INFOS() << "### Message template version " << mVersion << " ###" << LL_ENDL;
}
else
{
- llerrs << "Version must be first in the message template, found "
- << tokens.next() << llendl;
+ LL_ERRS() << "Version must be first in the message template, found "
+ << tokens.next() << LL_ENDL;
}
while(LLMessageTemplate * templatep = parseMessage(tokens))
@@ -405,8 +405,8 @@ LLTemplateParser::LLTemplateParser(LLTemplateTokenizer & tokens):
if(!tokens.wantEOF())
{
- llerrs << "Expected end of template or a message, instead found: "
- << tokens.next() << " at " << tokens.line() << llendl;
+ LL_ERRS() << "Expected end of template or a message, instead found: "
+ << tokens.next() << " at " << tokens.line() << LL_ENDL;
}
}
@@ -441,7 +441,7 @@ LLMessageTemplate * LLTemplateParser::parseMessage(LLTemplateTokenizer & tokens)
// is name a legit C variable name
if (!b_variable_ok(template_name.c_str()))
{
- llerrs << "Not legit variable name: " << template_name << " at " << tokens.line() << llendl;
+ LL_ERRS() << "Not legit variable name: " << template_name << " at " << tokens.line() << LL_ENDL;
}
// ok, now get Frequency ("High", "Medium", or "Low")
@@ -461,7 +461,7 @@ LLMessageTemplate * LLTemplateParser::parseMessage(LLTemplateTokenizer & tokens)
}
else
{
- llerrs << "Expected frequency, got " << freq_string << " at " << tokens.line() << llendl;
+ LL_ERRS() << "Expected frequency, got " << freq_string << " at " << tokens.line() << LL_ENDL;
}
// TODO more explicit checking here pls
@@ -477,7 +477,7 @@ LLMessageTemplate * LLTemplateParser::parseMessage(LLTemplateTokenizer & tokens)
message_number = (255 << 24) | (255 << 16) | message_number;
break;
default:
- llerrs << "Unknown frequency enum: " << frequency << llendl;
+ LL_ERRS() << "Unknown frequency enum: " << frequency << LL_ENDL;
}
templatep = new LLMessageTemplate(
@@ -497,7 +497,7 @@ LLMessageTemplate * LLTemplateParser::parseMessage(LLTemplateTokenizer & tokens)
}
else
{
- llerrs << "Bad trust " << trust << " at " << tokens.line() << llendl;
+ LL_ERRS() << "Bad trust " << trust << " at " << tokens.line() << LL_ENDL;
}
// get encoding
@@ -512,7 +512,7 @@ LLMessageTemplate * LLTemplateParser::parseMessage(LLTemplateTokenizer & tokens)
}
else
{
- llerrs << "Bad encoding " << encoding << " at " << tokens.line() << llendl;
+ LL_ERRS() << "Bad encoding " << encoding << " at " << tokens.line() << LL_ENDL;
}
// get deprecation
@@ -544,8 +544,8 @@ LLMessageTemplate * LLTemplateParser::parseMessage(LLTemplateTokenizer & tokens)
if(!tokens.want("}"))
{
- llerrs << "Expecting closing } for message " << template_name
- << " at " << tokens.line() << llendl;
+ LL_ERRS() << "Expecting closing } for message " << template_name
+ << " at " << tokens.line() << LL_ENDL;
}
return templatep;
}
@@ -566,8 +566,8 @@ LLMessageBlock * LLTemplateParser::parseBlock(LLTemplateTokenizer & tokens)
// is name a legit C variable name
if (!b_variable_ok(block_name.c_str()))
{
- llerrs << "not a legal block name: " << block_name
- << " at " << tokens.line() << llendl;
+ LL_ERRS() << "not a legal block name: " << block_name
+ << " at " << tokens.line() << LL_ENDL;
}
// now, block type ("Single", "Multiple", or "Variable")
@@ -586,8 +586,8 @@ LLMessageBlock * LLTemplateParser::parseBlock(LLTemplateTokenizer & tokens)
// is it a legal integer
if (!b_positive_integer_ok(repeats.c_str()))
{
- llerrs << "not a legal integer for block multiple count: "
- << repeats << " at " << tokens.line() << llendl;
+ LL_ERRS() << "not a legal integer for block multiple count: "
+ << repeats << " at " << tokens.line() << LL_ENDL;
}
// ok, we can create a block
@@ -602,8 +602,8 @@ LLMessageBlock * LLTemplateParser::parseBlock(LLTemplateTokenizer & tokens)
}
else
{
- llerrs << "bad block type: " << block_type
- << " at " << tokens.line() << llendl;
+ LL_ERRS() << "bad block type: " << block_type
+ << " at " << tokens.line() << LL_ENDL;
}
@@ -617,8 +617,8 @@ LLMessageBlock * LLTemplateParser::parseBlock(LLTemplateTokenizer & tokens)
if(!tokens.want("}"))
{
- llerrs << "Expecting closing } for block " << block_name
- << " at " << tokens.line() << llendl;
+ LL_ERRS() << "Expecting closing } for block " << block_name
+ << " at " << tokens.line() << LL_ENDL;
}
return blockp;
@@ -637,8 +637,8 @@ LLMessageVariable * LLTemplateParser::parseVariable(LLTemplateTokenizer & tokens
if (!b_variable_ok(var_name.c_str()))
{
- llerrs << "Not a legit variable name: " << var_name
- << " at " << tokens.line() << llendl;
+ LL_ERRS() << "Not a legit variable name: " << var_name
+ << " at " << tokens.line() << LL_ENDL;
}
std::string var_type = tokens.next();
@@ -721,8 +721,8 @@ LLMessageVariable * LLTemplateParser::parseVariable(LLTemplateTokenizer & tokens
if (!b_positive_integer_ok(variable_size.c_str()))
{
- llerrs << "not a legal integer variable size: " << variable_size
- << " at " << tokens.line() << llendl;
+ LL_ERRS() << "not a legal integer variable size: " << variable_size
+ << " at " << tokens.line() << LL_ENDL;
}
EMsgVariableType type_enum;
@@ -737,8 +737,8 @@ LLMessageVariable * LLTemplateParser::parseVariable(LLTemplateTokenizer & tokens
else
{
type_enum = MVT_FIXED; // removes a warning
- llerrs << "bad variable type: " << var_type
- << " at " << tokens.line() << llendl;
+ LL_ERRS() << "bad variable type: " << var_type
+ << " at " << tokens.line() << LL_ENDL;
}
varp = new LLMessageVariable(
@@ -748,14 +748,14 @@ LLMessageVariable * LLTemplateParser::parseVariable(LLTemplateTokenizer & tokens
}
else
{
- llerrs << "bad variable type:" << var_type
- << " at " << tokens.line() << llendl;
+ LL_ERRS() << "bad variable type:" << var_type
+ << " at " << tokens.line() << LL_ENDL;
}
if(!tokens.want("}"))
{
- llerrs << "Expecting closing } for variable " << var_name
- << " at " << tokens.line() << llendl;
+ LL_ERRS() << "Expecting closing } for variable " << var_name
+ << " at " << tokens.line() << LL_ENDL;
}
return varp;
}
diff --git a/indra/llmessage/llmime.cpp b/indra/llmessage/llmime.cpp
deleted file mode 100755
index 9d9c4ebd68..0000000000
--- a/indra/llmessage/llmime.cpp
+++ /dev/null
@@ -1,629 +0,0 @@
-/**
- * @file llmime.cpp
- * @author Phoenix
- * @date 2006-12-20
- * @brief Implementation of mime tools.
- *
- * $LicenseInfo:firstyear=2006&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "linden_common.h"
-#include "llmime.h"
-
-#include <vector>
-
-#include "llmemorystream.h"
-
-/**
- * Useful constants.
- */
-// Headers specified in rfc-2045 will be canonicalized below.
-static const std::string CONTENT_LENGTH("Content-Length");
-static const std::string CONTENT_TYPE("Content-Type");
-static const S32 KNOWN_HEADER_COUNT = 6;
-static const std::string KNOWN_HEADER[KNOWN_HEADER_COUNT] =
-{
- CONTENT_LENGTH,
- CONTENT_TYPE,
- std::string("MIME-Version"),
- std::string("Content-Transfer-Encoding"),
- std::string("Content-ID"),
- std::string("Content-Description"),
-};
-
-// parser helpers
-static const std::string MULTIPART("multipart");
-static const std::string BOUNDARY("boundary");
-static const std::string END_OF_CONTENT_PARAMETER("\r\n ;\t");
-static const std::string SEPARATOR_PREFIX("--");
-//static const std::string SEPARATOR_SUFFIX("\r\n");
-
-/*
-Content-Type: multipart/mixed; boundary="segment"
-Content-Length: 24832
-
---segment
-Content-Type: image/j2c
-Content-Length: 23715
-
-<data>
-
---segment
-Content-Type: text/xml; charset=UTF-8
-
-<meta data>
-EOF
-
-*/
-
-/**
- * LLMimeIndex
- */
-
-/**
- * @class LLMimeIndex::Impl
- * @brief Implementation details of the mime index class.
- * @see LLMimeIndex
- */
-class LLMimeIndex::Impl
-{
-public:
- Impl() : mOffset(-1), mUseCount(1)
- {}
- Impl(LLSD headers, S32 offset) :
- mHeaders(headers), mOffset(offset), mUseCount(1)
- {}
-public:
- LLSD mHeaders;
- S32 mOffset;
- S32 mUseCount;
-
- typedef std::vector<LLMimeIndex> sub_part_t;
- sub_part_t mAttachments;
-};
-
-LLSD LLMimeIndex::headers() const
-{
- return mImpl->mHeaders;
-}
-
-S32 LLMimeIndex::offset() const
-{
- return mImpl->mOffset;
-}
-
-S32 LLMimeIndex::contentLength() const
-{
- // Find the content length in the headers.
- S32 length = -1;
- LLSD content_length = mImpl->mHeaders[CONTENT_LENGTH];
- if(content_length.isDefined())
- {
- length = content_length.asInteger();
- }
- return length;
-}
-
-std::string LLMimeIndex::contentType() const
-{
- std::string type;
- LLSD content_type = mImpl->mHeaders[CONTENT_TYPE];
- if(content_type.isDefined())
- {
- type = content_type.asString();
- }
- return type;
-}
-
-bool LLMimeIndex::isMultipart() const
-{
- bool multipart = false;
- LLSD content_type = mImpl->mHeaders[CONTENT_TYPE];
- if(content_type.isDefined())
- {
- std::string type = content_type.asString();
- int comp = type.compare(0, MULTIPART.size(), MULTIPART);
- if(0 == comp)
- {
- multipart = true;
- }
- }
- return multipart;
-}
-
-S32 LLMimeIndex::subPartCount() const
-{
- return mImpl->mAttachments.size();
-}
-
-LLMimeIndex LLMimeIndex::subPart(S32 index) const
-{
- LLMimeIndex part;
- if((index >= 0) && (index < (S32)mImpl->mAttachments.size()))
- {
- part = mImpl->mAttachments[index];
- }
- return part;
-}
-
-LLMimeIndex::LLMimeIndex() : mImpl(new LLMimeIndex::Impl)
-{
-}
-
-LLMimeIndex::LLMimeIndex(LLSD headers, S32 content_offset) :
- mImpl(new LLMimeIndex::Impl(headers, content_offset))
-{
-}
-
-LLMimeIndex::LLMimeIndex(const LLMimeIndex& mime) :
- mImpl(mime.mImpl)
-{
- ++mImpl->mUseCount;
-}
-
-LLMimeIndex::~LLMimeIndex()
-{
- if(0 == --mImpl->mUseCount)
- {
- delete mImpl;
- }
-}
-
-LLMimeIndex& LLMimeIndex::operator=(const LLMimeIndex& mime)
-{
- // Increment use count first so that we handle self assignment
- // automatically.
- ++mime.mImpl->mUseCount;
- if(0 == --mImpl->mUseCount)
- {
- delete mImpl;
- }
- mImpl = mime.mImpl;
- return *this;
-}
-
-bool LLMimeIndex::attachSubPart(LLMimeIndex sub_part)
-{
- // *FIX: Should we check for multi-part?
- if(mImpl->mAttachments.size() < S32_MAX)
- {
- mImpl->mAttachments.push_back(sub_part);
- return true;
- }
- return false;
-}
-
-/**
- * LLMimeParser
- */
-/**
- * @class LLMimeParser::Impl
- * @brief Implementation details of the mime parser class.
- * @see LLMimeParser
- */
-class LLMimeParser::Impl
-{
-public:
- // @brief Constructor.
- Impl();
-
- // @brief Reset this for a new parse.
- void reset();
-
- /**
- * @brief Parse a mime entity to find the index information.
- *
- * This method will scan the istr until a single complete mime
- * entity is read, an EOF, or limit bytes have been scanned. The
- * istr will be modified by this parsing, so pass in a temporary
- * stream or rewind/reset the stream after this call.
- * @param istr An istream which contains a mime entity.
- * @param limit The maximum number of bytes to scan.
- * @param separator The multipart separator if it is known.
- * @param is_subpart Set true if parsing a multipart sub part.
- * @param index[out] The parsed output.
- * @return Returns true if an index was parsed and no errors occurred.
- */
- bool parseIndex(
- std::istream& istr,
- S32 limit,
- const std::string& separator,
- bool is_subpart,
- LLMimeIndex& index);
-
-protected:
- /**
- * @brief parse the headers.
- *
- * At the end of a successful parse, mScanCount will be at the
- * start of the content.
- * @param istr The input stream.
- * @param limit maximum number of bytes to process
- * @param headers[out] A map of the headers found.
- * @return Returns true if the parse was successful.
- */
- bool parseHeaders(std::istream& istr, S32 limit, LLSD& headers);
-
- /**
- * @brief Figure out the separator string from a content type header.
- *
- * @param multipart_content_type The content type value from the headers.
- * @return Returns the separator string.
- */
- std::string findSeparator(std::string multipart_content_type);
-
- /**
- * @brief Scan through istr past the separator.
- *
- * @param istr The input stream.
- * @param limit Maximum number of bytes to scan.
- * @param separator The multipart separator.
- */
- void scanPastSeparator(
- std::istream& istr,
- S32 limit,
- const std::string& separator);
-
- /**
- * @brief Scan through istr past the content of the current mime part.
- *
- * @param istr The input stream.
- * @param limit Maximum number of bytes to scan.
- * @param headers The headers for this mime part.
- * @param separator The multipart separator if known.
- */
- void scanPastContent(
- std::istream& istr,
- S32 limit,
- LLSD headers,
- const std::string separator);
-
- /**
- * @brief Eat CRLF.
- *
- * This method has no concept of the limit, so ensure you have at
- * least 2 characters left to eat before hitting the limit. This
- * method will increment mScanCount as it goes.
- * @param istr The input stream.
- * @return Returns true if CRLF was found and consumed off of istr.
- */
- bool eatCRLF(std::istream& istr);
-
- // @brief Returns true if parsing should continue.
- bool continueParse() const { return (!mError && mContinue); }
-
- // @brief anonymous enumeration for parse buffer size.
- enum
- {
- LINE_BUFFER_LENGTH = 1024
- };
-
-protected:
- S32 mScanCount;
- bool mContinue;
- bool mError;
- char mBuffer[LINE_BUFFER_LENGTH];
-};
-
-LLMimeParser::Impl::Impl()
-{
- reset();
-}
-
-void LLMimeParser::Impl::reset()
-{
- mScanCount = 0;
- mContinue = true;
- mError = false;
- mBuffer[0] = '\0';
-}
-
-bool LLMimeParser::Impl::parseIndex(
- std::istream& istr,
- S32 limit,
- const std::string& separator,
- bool is_subpart,
- LLMimeIndex& index)
-{
- LLSD headers;
- bool parsed_something = false;
- if(parseHeaders(istr, limit, headers))
- {
- parsed_something = true;
- LLMimeIndex mime(headers, mScanCount);
- index = mime;
- if(index.isMultipart())
- {
- // Figure out the separator, scan past it, and recurse.
- std::string ct = headers[CONTENT_TYPE].asString();
- std::string sep = findSeparator(ct);
- scanPastSeparator(istr, limit, sep);
- while(continueParse() && parseIndex(istr, limit, sep, true, mime))
- {
- index.attachSubPart(mime);
- }
- }
- else
- {
- // Scan to the end of content.
- scanPastContent(istr, limit, headers, separator);
- if(is_subpart)
- {
- scanPastSeparator(istr, limit, separator);
- }
- }
- }
- if(mError) return false;
- return parsed_something;
-}
-
-bool LLMimeParser::Impl::parseHeaders(
- std::istream& istr,
- S32 limit,
- LLSD& headers)
-{
- while(continueParse())
- {
- // Get the next line.
- // We subtract 1 from the limit so that we make sure
- // not to read past limit when we get() the newline.
- S32 max_get = llmin((S32)LINE_BUFFER_LENGTH, limit - mScanCount - 1);
- istr.getline(mBuffer, max_get, '\r');
- mScanCount += (S32)istr.gcount();
- int c = istr.get();
- if(EOF == c)
- {
- mContinue = false;
- return false;
- }
- ++mScanCount;
- if(c != '\n')
- {
- mError = true;
- return false;
- }
- if(mScanCount >= limit)
- {
- mContinue = false;
- }
-
- // Check if that's the end of headers.
- if('\0' == mBuffer[0])
- {
- break;
- }
-
- // Split out the name and value.
- // *NOTE: The use of strchr() here is safe since mBuffer is
- // guaranteed to be NULL terminated from the call to getline()
- // above.
- char* colon = strchr(mBuffer, ':');
- if(!colon)
- {
- mError = true;
- return false;
- }
-
- // Cononicalize the name part, and store the name: value in
- // the headers structure. We do this by iterating through
- // 'known' headers and replacing the value found with the
- // correct one.
- // *NOTE: Not so efficient, but iterating through a small
- // subset should not be too much of an issue.
- std::string name(mBuffer, colon++ - mBuffer);
- while(isspace(*colon)) ++colon;
- std::string value(colon);
- for(S32 ii = 0; ii < KNOWN_HEADER_COUNT; ++ii)
- {
- if(0 == LLStringUtil::compareInsensitive(name, KNOWN_HEADER[ii]))
- {
- name = KNOWN_HEADER[ii];
- break;
- }
- }
- headers[name] = value;
- }
- if(headers.isUndefined()) return false;
- return true;
-}
-
-std::string LLMimeParser::Impl::findSeparator(std::string header)
-{
- // 01234567890
- //Content-Type: multipart/mixed; boundary="segment"
- std::string separator;
- std::string::size_type pos = header.find(BOUNDARY);
- if(std::string::npos == pos) return separator;
- pos += BOUNDARY.size() + 1;
- std::string::size_type end;
- if(header[pos] == '"')
- {
- // the boundary is quoted, find the end from pos, and take the
- // substring.
- end = header.find('"', ++pos);
- if(std::string::npos == end)
- {
- // poorly formed boundary.
- mError = true;
- }
- }
- else
- {
- // otherwise, it's every character until a whitespace, end of
- // line, or another parameter begins.
- end = header.find_first_of(END_OF_CONTENT_PARAMETER, pos);
- if(std::string::npos == end)
- {
- // it goes to the end of the string.
- end = header.size();
- }
- }
- if(!mError) separator = header.substr(pos, end - pos);
- return separator;
-}
-
-void LLMimeParser::Impl::scanPastSeparator(
- std::istream& istr,
- S32 limit,
- const std::string& sep)
-{
- std::ostringstream ostr;
- ostr << SEPARATOR_PREFIX << sep;
- std::string separator = ostr.str();
- bool found_separator = false;
- while(!found_separator && continueParse())
- {
- // Subtract 1 from the limit so that we make sure not to read
- // past limit when we get() the newline.
- S32 max_get = llmin((S32)LINE_BUFFER_LENGTH, limit - mScanCount - 1);
- istr.getline(mBuffer, max_get, '\r');
- mScanCount += (S32)istr.gcount();
- if(istr.gcount() >= LINE_BUFFER_LENGTH - 1)
- {
- // that's way too long to be a separator, so ignore it.
- continue;
- }
- int c = istr.get();
- if(EOF == c)
- {
- mContinue = false;
- return;
- }
- ++mScanCount;
- if(c != '\n')
- {
- mError = true;
- return;
- }
- if(mScanCount >= limit)
- {
- mContinue = false;
- }
- if(0 == LLStringUtil::compareStrings(std::string(mBuffer), separator))
- {
- found_separator = true;
- }
- }
-}
-
-void LLMimeParser::Impl::scanPastContent(
- std::istream& istr,
- S32 limit,
- LLSD headers,
- const std::string separator)
-{
- if(headers.has(CONTENT_LENGTH))
- {
- S32 content_length = headers[CONTENT_LENGTH].asInteger();
- // Subtract 2 here for the \r\n after the content.
- S32 max_skip = llmin(content_length, limit - mScanCount - 2);
- istr.ignore(max_skip);
- mScanCount += max_skip;
-
- // *NOTE: Check for hitting the limit and eof here before
- // checking for the trailing EOF, because our mime parser has
- // to gracefully handle incomplete mime entites.
- if((mScanCount >= limit) || istr.eof())
- {
- mContinue = false;
- }
- else if(!eatCRLF(istr))
- {
- mError = true;
- return;
- }
- }
-}
-
-bool LLMimeParser::Impl::eatCRLF(std::istream& istr)
-{
- int c = istr.get();
- ++mScanCount;
- if(c != '\r')
- {
- return false;
- }
- c = istr.get();
- ++mScanCount;
- if(c != '\n')
- {
- return false;
- }
- return true;
-}
-
-
-LLMimeParser::LLMimeParser() : mImpl(* new LLMimeParser::Impl)
-{
-}
-
-LLMimeParser::~LLMimeParser()
-{
- delete & mImpl;
-}
-
-void LLMimeParser::reset()
-{
- mImpl.reset();
-}
-
-bool LLMimeParser::parseIndex(std::istream& istr, LLMimeIndex& index)
-{
- std::string separator;
- return mImpl.parseIndex(istr, S32_MAX, separator, false, index);
-}
-
-bool LLMimeParser::parseIndex(
- const std::vector<U8>& buffer,
- LLMimeIndex& index)
-{
- LLMemoryStream mstr(&buffer[0], buffer.size());
- return parseIndex(mstr, buffer.size() + 1, index);
-}
-
-bool LLMimeParser::parseIndex(
- std::istream& istr,
- S32 limit,
- LLMimeIndex& index)
-{
- std::string separator;
- return mImpl.parseIndex(istr, limit, separator, false, index);
-}
-
-bool LLMimeParser::parseIndex(const U8* buffer, S32 length, LLMimeIndex& index)
-{
- LLMemoryStream mstr(buffer, length);
- return parseIndex(mstr, length + 1, index);
-}
-
-/*
-bool LLMimeParser::verify(std::istream& isr, LLMimeIndex& index) const
-{
- return false;
-}
-
-bool LLMimeParser::verify(U8* buffer, S32 length, LLMimeIndex& index) const
-{
- LLMemoryStream mstr(buffer, length);
- return verify(mstr, index);
-}
-*/
diff --git a/indra/llmessage/llmime.h b/indra/llmessage/llmime.h
deleted file mode 100755
index e6617fb503..0000000000
--- a/indra/llmessage/llmime.h
+++ /dev/null
@@ -1,292 +0,0 @@
-/**
- * @file llmime.h
- * @author Phoenix
- * @date 2006-12-20
- * @brief Declaration of mime tools.
- *
- * $LicenseInfo:firstyear=2006&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLMIME_H
-#define LL_LLMIME_H
-
-#include <string>
-#include "llsd.h"
-
-/**
- * This file declares various tools for parsing and creating MIME
- * objects as described in RFCs 2045, 2046, 2047, 2048, and 2049.
- */
-
-/**
- * @class LLMimeIndex
- * @brief Skeletal information useful for handling mime packages.
- * @see LLMimeParser
- *
- * An instance of this class is the parsed output from a LLMimeParser
- * which then allows for easy access into a data stream to find and
- * get what you want out of it.
- *
- * This class meant as a tool to quickly find what you seek in a
- * parsed mime entity. As such, it does not have useful support for
- * modification of a mime entity and specializes the interface toward
- * querying data from a fixed mime entity. Modifying an instance of
- * LLMimeIndx does not alter a mime entity and changes to a mime
- * entity itself are not propogated into an instance of a LLMimeIndex.
- *
- * Usage:<br>
- * LLMimeIndex mime_index;<br>
- * std::ifstream fstr("package.mime", ios::binary);<br>
- * LLMimeParser parser;<br>
- * if(parser.parseIndex(fstr, mime_index))<br>
- * {<br>
- * std::vector<U8> content;<br>
- * content.resize(mime_index.contentLength());<br>
- * fstr.seekg(mime_index.offset(), ios::beg);<br>
- * // ...do work on fstr and content<br>
- * }<br>
- */
-class LLMimeIndex
-{
-public:
- /* @name Client interface.
- */
- //@{
- /**
- * @brief Get the full parsed headers for this.
- *
- * If there are any headers, it will be a map of header name to
- * the value found on the line. The name is everything before the
- * colon, and the value is the string found after the colon to the
- * end of the line after trimming leading whitespace. So, for
- * example:
- * Content-Type: text/plain
- * would become an entry in the headers of:
- * headers["Content-Type"] == "text/plain"
- *
- * If this instance of an index was generated by the
- * LLMimeParser::parseIndex() call, all header names in rfc2045
- * will be capitalized as in rfc, eg Content-Length and
- * MIME-Version, not content-length and mime-version.
- * @return Returns an LLSD map of header name to value. Returns
- * undef if there are no headers.
- */
- LLSD headers() const;
-
- /**
- * @brief Get the content offset.
- *
- * @return Returns the number of bytes to the start of the data
- * segment from the start of serialized mime entity. Returns -1 if
- * offset is not known.
- */
- S32 offset() const;
-
- /**
- * @brief Get the length of the data segment for this mime part.
- *
- * @return Returns the content length in bytes. Returns -1 if
- * length is not known.
- */
- S32 contentLength() const;
-
- /**
- * @brief Get the mime type associated with this node.
- *
- * @return Returns the mimetype.
- */
- std::string contentType() const;
-
- /**
- * @brief Helper method which simplifies parsing the return from type()
- *
- * @return Returns true if this is a multipart mime, and therefore
- * getting subparts will succeed.
- */
- bool isMultipart() const;
-
- /**
- * @brief Get the number of atachments.
- *
- * @return Returns the number of sub-parts for this.
- */
- S32 subPartCount() const;
-
- /**
- * @brief Get the indicated attachment.
- *
- * @param index Value from 0 to (subPartCount() - 1).
- * @return Returns the indicated sub-part, or an invalid mime
- * index on failure.
- */
- LLMimeIndex subPart(S32 index) const;
- //@}
-
- /* @name Interface for building, testing, and helpers for typical use.
- */
- //@{
- /**
- * @brief Default constructor - creates a useless LLMimeIndex.
- */
- LLMimeIndex();
-
- /**
- * @brief Full constructor.
- *
- * @param headers The complete headers.
- * @param content_offset The number of bytes to the start of the
- * data segment of this mime entity from the start of the stream
- * or buffer.
- */
- LLMimeIndex(LLSD headers, S32 content_offset);
-
- /**
- * @brief Copy constructor.
- *
- * @param mime The other mime object.
- */
- LLMimeIndex(const LLMimeIndex& mime);
-
- // @brief Destructor.
- ~LLMimeIndex();
-
- /*
- * @breif Assignment operator.
- *
- * @param mime The other mime object.
- * @return Returns this after assignment.
- */
- LLMimeIndex& operator=(const LLMimeIndex& mime);
-
- /**
- * @brief Add attachment information as a sub-part to a multipart mime.
- *
- * @param sub_part the part to attach.
- * @return Returns true on success, false on failure.
- */
- bool attachSubPart(LLMimeIndex sub_part);
- //@}
-
-protected:
- // Implementation.
- class Impl;
- Impl* mImpl;
-};
-
-
-/**
- * @class LLMimeParser
- * @brief This class implements a MIME parser and verifier.
- *
- * THOROUGH_DESCRIPTION
- */
-class LLMimeParser
-{
-public:
- // @brief Make a new mime parser.
- LLMimeParser();
-
- // @brief Mime parser Destructor.
- ~LLMimeParser();
-
- // @brief Reset internal state of this parser.
- void reset();
-
-
- /* @name Index generation interface.
- */
- //@{
- /**
- * @brief Parse a stream to find the mime index information.
- *
- * This method will scan the istr until a single complete mime
- * entity is read or EOF. The istr will be modified by this
- * parsing, so pass in a temporary stream or rewind/reset the
- * stream after this call.
- * @param istr An istream which contains a mime entity.
- * @param index[out] The parsed output.
- * @return Returns true if an index was parsed and no errors occurred.
- */
- bool parseIndex(std::istream& istr, LLMimeIndex& index);
-
- /**
- * @brief Parse a vector to find the mime index information.
- *
- * @param buffer A vector with data to parse.
- * @param index[out] The parsed output.
- * @return Returns true if an index was parsed and no errors occurred.
- */
- bool parseIndex(const std::vector<U8>& buffer, LLMimeIndex& index);
-
- /**
- * @brief Parse a stream to find the mime index information.
- *
- * This method will scan the istr until a single complete mime
- * entity is read, an EOF, or limit bytes have been scanned. The
- * istr will be modified by this parsing, so pass in a temporary
- * stream or rewind/reset the stream after this call.
- * @param istr An istream which contains a mime entity.
- * @param limit The maximum number of bytes to scan.
- * @param index[out] The parsed output.
- * @return Returns true if an index was parsed and no errors occurred.
- */
- bool parseIndex(std::istream& istr, S32 limit, LLMimeIndex& index);
-
- /**
- * @brief Parse a memory bufffer to find the mime index information.
- *
- * @param buffer The start of the buffer to parse.
- * @param buffer_length The length of the buffer.
- * @param index[out] The parsed output.
- * @return Returns true if an index was parsed and no errors occurred.
- */
- bool parseIndex(const U8* buffer, S32 buffer_length, LLMimeIndex& index);
- //@}
-
- /**
- * @brief
- *
- * @return
- */
- //bool verify(std::istream& istr, LLMimeIndex& index) const;
-
- /**
- * @brief
- *
- * @return
- */
- //bool verify(U8* buffer, S32 buffer_length, LLMimeIndex& index) const;
-
-protected:
- // Implementation.
- class Impl;
- Impl& mImpl;
-
-private:
- // @brief Not implemneted to prevent copy consturction.
- LLMimeParser(const LLMimeParser& parser);
-
- // @brief Not implemneted to prevent assignment.
- LLMimeParser& operator=(const LLMimeParser& mime);
-};
-
-#endif // LL_LLMIME_H
diff --git a/indra/llmessage/llnamevalue.cpp b/indra/llmessage/llnamevalue.cpp
index d799403029..c51883ee3d 100755
--- a/indra/llmessage/llnamevalue.cpp
+++ b/indra/llmessage/llnamevalue.cpp
@@ -33,7 +33,7 @@
#include "u64.h"
#include "llstring.h"
-#include "string_table.h"
+#include "llstringtable.h"
// Anonymous enumeration to provide constants in this file.
// *NOTE: These values may be used in sscanf statements below as their
@@ -209,7 +209,7 @@ void LLNameValue::init(const char *name, const char *data, const char *type, con
}
else
{
- llwarns << "Unknown name value type string " << mStringType << " for " << mName << llendl;
+ LL_WARNS() << "Unknown name value type string " << mStringType << " for " << mName << LL_ENDL;
mType = NVT_NULL;
}
@@ -261,8 +261,8 @@ void LLNameValue::init(const char *name, const char *data, const char *type, con
}
else
{
- llwarns << "LLNameValue::init() - unknown sendto field "
- << nvsendto << " for NV " << mName << llendl;
+ LL_WARNS() << "LLNameValue::init() - unknown sendto field "
+ << nvsendto << " for NV " << mName << LL_ENDL;
mSendto = NVS_NULL;
mStringSendto = mNVNameTable->addString("S");
}
@@ -332,7 +332,7 @@ LLNameValue::LLNameValue(const char *name, const char *type, const char *nvclass
else
{
mType = NVT_NULL;
- llinfos << "Unknown name-value type " << mStringType << llendl;
+ LL_INFOS() << "Unknown name-value type " << mStringType << LL_ENDL;
}
// Nota Bene: Whatever global structure manages this should have these in the name table already!
@@ -580,7 +580,7 @@ char *LLNameValue::getString()
}
else
{
- llerrs << mName << " not a string!" << llendl;
+ LL_ERRS() << mName << " not a string!" << LL_ENDL;
return NULL;
}
}
@@ -593,7 +593,7 @@ const char *LLNameValue::getAsset() const
}
else
{
- llerrs << mName << " not an asset!" << llendl;
+ LL_ERRS() << mName << " not an asset!" << LL_ENDL;
return NULL;
}
}
@@ -606,7 +606,7 @@ F32 *LLNameValue::getF32()
}
else
{
- llerrs << mName << " not a F32!" << llendl;
+ LL_ERRS() << mName << " not a F32!" << LL_ENDL;
return NULL;
}
}
@@ -619,7 +619,7 @@ S32 *LLNameValue::getS32()
}
else
{
- llerrs << mName << " not a S32!" << llendl;
+ LL_ERRS() << mName << " not a S32!" << LL_ENDL;
return NULL;
}
}
@@ -632,7 +632,7 @@ U32 *LLNameValue::getU32()
}
else
{
- llerrs << mName << " not a U32!" << llendl;
+ LL_ERRS() << mName << " not a U32!" << LL_ENDL;
return NULL;
}
}
@@ -645,7 +645,7 @@ U64 *LLNameValue::getU64()
}
else
{
- llerrs << mName << " not a U64!" << llendl;
+ LL_ERRS() << mName << " not a U64!" << LL_ENDL;
return NULL;
}
}
@@ -658,7 +658,7 @@ void LLNameValue::getVec3(LLVector3 &vec)
}
else
{
- llerrs << mName << " not a Vec3!" << llendl;
+ LL_ERRS() << mName << " not a Vec3!" << LL_ENDL;
}
}
@@ -670,7 +670,7 @@ LLVector3 *LLNameValue::getVec3()
}
else
{
- llerrs << mName << " not a Vec3!" << llendl;
+ LL_ERRS() << mName << " not a Vec3!" << LL_ENDL;
return NULL;
}
}
@@ -726,7 +726,7 @@ LLNameValue &LLNameValue::operator=(const LLNameValue &a)
*mNameValueReference.u64 = *a.mNameValueReference.u64;
break;
default:
- llerrs << "Unknown Name value type " << (U32)a.mType << llendl;
+ LL_ERRS() << "Unknown Name value type " << (U32)a.mType << LL_ENDL;
break;
}
@@ -865,7 +865,7 @@ void LLNameValue::setU32(const U32 a)
*mNameValueReference.f32 = (F32)a;
break;
default:
- llerrs << "NameValue: Trying to set U32 into a " << mStringType << ", unknown conversion" << llendl;
+ LL_ERRS() << "NameValue: Trying to set U32 into a " << mStringType << ", unknown conversion" << LL_ENDL;
break;
}
return;
@@ -883,7 +883,7 @@ void LLNameValue::setVec3(const LLVector3 &a)
*mNameValueReference.vec3 = a;
break;
default:
- llerrs << "NameValue: Trying to set LLVector3 into a " << mStringType << ", unknown conversion" << llendl;
+ LL_ERRS() << "NameValue: Trying to set LLVector3 into a " << mStringType << ", unknown conversion" << LL_ENDL;
break;
}
return;
@@ -895,7 +895,7 @@ std::string LLNameValue::printNameValue() const
std::string buffer;
buffer = llformat("%s %s %s %s ", mName, mStringType, mStringClass, mStringSendto);
buffer += printData();
-// llinfos << "Name Value Length: " << buffer.size() + 1 << llendl;
+// LL_INFOS() << "Name Value Length: " << buffer.size() + 1 << LL_ENDL;
return buffer;
}
@@ -928,7 +928,7 @@ std::string LLNameValue::printData() const
buffer = llformat( "%f, %f, %f", mNameValueReference.vec3->mV[VX], mNameValueReference.vec3->mV[VY], mNameValueReference.vec3->mV[VZ]);
break;
default:
- llerrs << "Trying to print unknown NameValue type " << mStringType << llendl;
+ LL_ERRS() << "Trying to print unknown NameValue type " << mStringType << LL_ENDL;
break;
}
return buffer;
@@ -962,7 +962,7 @@ std::ostream& operator<<(std::ostream& s, const LLNameValue &a)
s << *(a.mNameValueReference.vec3);
break;
default:
- llerrs << "Trying to print unknown NameValue type " << a.mStringType << llendl;
+ LL_ERRS() << "Trying to print unknown NameValue type " << a.mStringType << LL_ENDL;
break;
}
return s;
diff --git a/indra/llmessage/llnamevalue.h b/indra/llmessage/llnamevalue.h
index 273de475f8..f8b556b5fe 100755
--- a/indra/llmessage/llnamevalue.h
+++ b/indra/llmessage/llnamevalue.h
@@ -41,7 +41,7 @@
// SitObject STRING
// SitPosition VEC3
-#include "string_table.h"
+#include "llstringtable.h"
#include "llmath.h"
#include "v3math.h"
#include "lldbstrings.h"
diff --git a/indra/llmessage/llpacketack.cpp b/indra/llmessage/llpacketack.cpp
index f08d3404ea..c3c022c297 100755
--- a/indra/llmessage/llpacketack.cpp
+++ b/indra/llmessage/llpacketack.cpp
@@ -50,7 +50,7 @@ LLReliablePacket::LLReliablePacket(
mHost = params->mHost;
mRetries = params->mRetries;
mPingBasedRetry = params->mPingBasedRetry;
- mTimeout = params->mTimeout;
+ mTimeout = F32Seconds(params->mTimeout);
mCallback = params->mCallback;
mCallbackData = params->mCallbackData;
mMessageName = params->mMessageName;
@@ -59,13 +59,13 @@ LLReliablePacket::LLReliablePacket(
{
mRetries = 0;
mPingBasedRetry = TRUE;
- mTimeout = 0.f;
+ mTimeout = F32Seconds(0.f);
mCallback = NULL;
mCallbackData = NULL;
mMessageName = NULL;
}
- mExpirationTime = (F64)((S64)totalTime())/1000000.0 + mTimeout;
+ mExpirationTime = (F64Seconds)totalTime() + mTimeout;
mPacketID = ntohl(*((U32*)(&buf_ptr[PHL_PACKET_ID])));
mSocket = socket;
diff --git a/indra/llmessage/llpacketack.h b/indra/llmessage/llpacketack.h
index 2ef3c48e44..f0ed923f19 100755
--- a/indra/llmessage/llpacketack.h
+++ b/indra/llmessage/llpacketack.h
@@ -28,6 +28,7 @@
#define LL_LLPACKETACK_H
#include "llhost.h"
+#include "llunits.h"
class LLReliablePacketParams
{
@@ -35,7 +36,7 @@ public:
LLHost mHost;
S32 mRetries;
BOOL mPingBasedRetry;
- F32 mTimeout;
+ F32Seconds mTimeout;
void (*mCallback)(void **,S32);
void** mCallbackData;
char* mMessageName;
@@ -53,7 +54,7 @@ public:
mHost.invalidate();
mRetries = 0;
mPingBasedRetry = TRUE;
- mTimeout = 0.f;
+ mTimeout = F32Seconds(0.f);
mCallback = NULL;
mCallbackData = NULL;
mMessageName = NULL;
@@ -63,7 +64,7 @@ public:
const LLHost& host,
S32 retries,
BOOL ping_based_retry,
- F32 timeout,
+ F32Seconds timeout,
void (*callback)(void**,S32),
void** callback_data, char* name)
{
@@ -98,7 +99,7 @@ protected:
LLHost mHost;
S32 mRetries;
BOOL mPingBasedRetry;
- F32 mTimeout;
+ F32Seconds mTimeout;
void (*mCallback)(void**,S32);
void** mCallbackData;
char* mMessageName;
@@ -108,7 +109,7 @@ protected:
TPACKETID mPacketID;
- F64 mExpirationTime;
+ F64Seconds mExpirationTime;
};
#endif
diff --git a/indra/llmessage/llpacketbuffer.cpp b/indra/llmessage/llpacketbuffer.cpp
index e69631eb3b..ccf991b1a7 100755
--- a/indra/llmessage/llpacketbuffer.cpp
+++ b/indra/llmessage/llpacketbuffer.cpp
@@ -29,7 +29,7 @@
#include "llpacketbuffer.h"
#include "net.h"
-#include "timing.h"
+#include "lltimer.h"
#include "llhost.h"
///////////////////////////////////////////////////////////
@@ -41,7 +41,7 @@ LLPacketBuffer::LLPacketBuffer(const LLHost &host, const char *datap, const S32
if (size > NET_BUFFER_SIZE)
{
- llerrs << "Sending packet > " << NET_BUFFER_SIZE << " of size " << size << llendl;
+ LL_ERRS() << "Sending packet > " << NET_BUFFER_SIZE << " of size " << size << LL_ENDL;
}
else
{
diff --git a/indra/llmessage/llpacketring.cpp b/indra/llmessage/llpacketring.cpp
index fc6e9c5193..687212ea10 100755
--- a/indra/llmessage/llpacketring.cpp
+++ b/indra/llmessage/llpacketring.cpp
@@ -41,7 +41,6 @@
#include "llproxy.h"
#include "llrand.h"
#include "message.h"
-#include "timing.h"
#include "u64.h"
///////////////////////////////////////////////////////////
@@ -196,7 +195,7 @@ S32 LLPacketRing::receivePacket (S32 socket, char *datap)
if (mInBufferLength + packetp->getSize() > mMaxBufferLength)
{
// Toss it.
- llwarns << "Throwing away packet, overflowing buffer" << llendl;
+ LL_WARNS() << "Throwing away packet, overflowing buffer" << LL_ENDL;
delete packetp;
packetp = NULL;
}
@@ -324,7 +323,7 @@ BOOL LLPacketRing::sendPacket(int h_socket, char * send_buffer, S32 buf_size, LL
{
// Nuke this packet, we overflowed the buffer.
// Toss it.
- llwarns << "Throwing away outbound packet, overflowing buffer" << llendl;
+ LL_WARNS() << "Throwing away outbound packet, overflowing buffer" << LL_ENDL;
}
else
{
@@ -332,7 +331,7 @@ BOOL LLPacketRing::sendPacket(int h_socket, char * send_buffer, S32 buf_size, LL
if ((mOutBufferLength > 4192) && queue_timer.getElapsedTimeF32() > 1.f)
{
// Add it to the queue
- llinfos << "Outbound packet queue " << mOutBufferLength << " bytes" << llendl;
+ LL_INFOS() << "Outbound packet queue " << mOutBufferLength << " bytes" << LL_ENDL;
queue_timer.reset();
}
packetp = new LLPacketBuffer(host, send_buffer, buf_size);
diff --git a/indra/llmessage/llproxy.cpp b/indra/llmessage/llproxy.cpp
index 9988fcd9c0..9b8d19cc3e 100755
--- a/indra/llmessage/llproxy.cpp
+++ b/indra/llmessage/llproxy.cpp
@@ -57,13 +57,15 @@ LLProxy::LLProxy():
mAuthMethodSelected(METHOD_NOAUTH),
mSocksUsername(),
mSocksPassword()
-{
-}
+{}
LLProxy::~LLProxy()
{
- stopSOCKSProxy();
- disableHTTPProxy();
+ if (ll_apr_is_initialized())
+ {
+ stopSOCKSProxy();
+ disableHTTPProxy();
+ }
}
/**
diff --git a/indra/llmessage/llpumpio.cpp b/indra/llmessage/llpumpio.cpp
index 0623e99f0a..506ccc98a4 100755
--- a/indra/llmessage/llpumpio.cpp
+++ b/indra/llmessage/llpumpio.cpp
@@ -34,6 +34,7 @@
#include "apr_poll.h"
#include "llapr.h"
+#include "llfasttimer.h"
#include "llstl.h"
// These should not be enabled in production, but they can be
@@ -81,7 +82,7 @@ void ll_debug_poll_fd(const char* msg, const apr_pollfd_t* poll)
#if LL_DEBUG_POLL_FILE_DESCRIPTORS
if(!poll)
{
- lldebugs << "Poll -- " << (msg?msg:"") << ": no pollfd." << llendl;
+ LL_DEBUGS() << "Poll -- " << (msg?msg:"") << ": no pollfd." << LL_ENDL;
return;
}
if(poll->desc.s)
@@ -89,13 +90,13 @@ void ll_debug_poll_fd(const char* msg, const apr_pollfd_t* poll)
apr_os_sock_t os_sock;
if(APR_SUCCESS == apr_os_sock_get(&os_sock, poll->desc.s))
{
- lldebugs << "Poll -- " << (msg?msg:"") << " on fd " << os_sock
- << " at " << poll->desc.s << llendl;
+ LL_DEBUGS() << "Poll -- " << (msg?msg:"") << " on fd " << os_sock
+ << " at " << poll->desc.s << LL_ENDL;
}
else
{
- lldebugs << "Poll -- " << (msg?msg:"") << " no fd "
- << " at " << poll->desc.s << llendl;
+ LL_DEBUGS() << "Poll -- " << (msg?msg:"") << " no fd "
+ << " at " << poll->desc.s << LL_ENDL;
}
}
else if(poll->desc.f)
@@ -103,18 +104,18 @@ void ll_debug_poll_fd(const char* msg, const apr_pollfd_t* poll)
apr_os_file_t os_file;
if(APR_SUCCESS == apr_os_file_get(&os_file, poll->desc.f))
{
- lldebugs << "Poll -- " << (msg?msg:"") << " on fd " << os_file
- << " at " << poll->desc.f << llendl;
+ LL_DEBUGS() << "Poll -- " << (msg?msg:"") << " on fd " << os_file
+ << " at " << poll->desc.f << LL_ENDL;
}
else
{
- lldebugs << "Poll -- " << (msg?msg:"") << " no fd "
- << " at " << poll->desc.f << llendl;
+ LL_DEBUGS() << "Poll -- " << (msg?msg:"") << " no fd "
+ << " at " << poll->desc.f << LL_ENDL;
}
}
else
{
- lldebugs << "Poll -- " << (msg?msg:"") << ": no descriptor." << llendl;
+ LL_DEBUGS() << "Poll -- " << (msg?msg:"") << ": no descriptor." << LL_ENDL;
}
#endif
}
@@ -203,10 +204,10 @@ bool LLPumpIO::addChain(const chain_t& chain, F32 timeout, bool has_curl_request
info.mData->setThreaded(has_curl_request);
LLLinkInfo link;
#if LL_DEBUG_PIPE_TYPE_IN_PUMP
- lldebugs << "LLPumpIO::addChain() " << chain[0] << " '"
- << typeid(*(chain[0])).name() << "'" << llendl;
+ LL_DEBUGS() << "LLPumpIO::addChain() " << chain[0] << " '"
+ << typeid(*(chain[0])).name() << "'" << LL_ENDL;
#else
- lldebugs << "LLPumpIO::addChain() " << chain[0] <<llendl;
+ LL_DEBUGS() << "LLPumpIO::addChain() " << chain[0] <<LL_ENDL;
#endif
chain_t::const_iterator it = chain.begin();
chain_t::const_iterator end = chain.end();
@@ -237,10 +238,10 @@ bool LLPumpIO::addChain(
LLScopedLock lock(mChainsMutex);
#endif
#if LL_DEBUG_PIPE_TYPE_IN_PUMP
- lldebugs << "LLPumpIO::addChain() " << links[0].mPipe << " '"
- << typeid(*(links[0].mPipe)).name() << "'" << llendl;
+ LL_DEBUGS() << "LLPumpIO::addChain() " << links[0].mPipe << " '"
+ << typeid(*(links[0].mPipe)).name() << "'" << LL_ENDL;
#else
- lldebugs << "LLPumpIO::addChain() " << links[0].mPipe << llendl;
+ LL_DEBUGS() << "LLPumpIO::addChain() " << links[0].mPipe << LL_ENDL;
#endif
LLChainInfo info;
info.setTimeoutSeconds(timeout);
@@ -306,12 +307,12 @@ bool LLPumpIO::setConditional(LLIOPipe* pipe, const apr_pollfd_t* poll)
if(!pipe) return false;
ll_debug_poll_fd("Set conditional", poll);
- lldebugs << "Setting conditionals (" << (poll ? events_2_string(poll->reqevents) :"null")
+ LL_DEBUGS() << "Setting conditionals (" << (poll ? events_2_string(poll->reqevents) :"null")
<< ") "
#if LL_DEBUG_PIPE_TYPE_IN_PUMP
<< "on pipe " << typeid(*pipe).name()
#endif
- << " at " << pipe << llendl;
+ << " at " << pipe << LL_ENDL;
// remove any matching poll file descriptors for this pipe.
LLIOPipe::ptr_t pipe_ptr(pipe);
@@ -430,8 +431,8 @@ void LLPumpIO::pump()
pump(DEFAULT_POLL_TIMEOUT);
}
-static LLFastTimer::DeclareTimer FTM_PUMP_IO("Pump IO");
-static LLFastTimer::DeclareTimer FTM_PUMP_POLL("Pump Poll");
+static LLTrace::BlockTimerStatHandle FTM_PUMP_IO("Pump IO");
+static LLTrace::BlockTimerStatHandle FTM_PUMP_POLL("Pump Poll");
LLPumpIO::current_chain_t LLPumpIO::removeRunningChain(LLPumpIO::current_chain_t& run_chain)
{
@@ -445,8 +446,8 @@ LLPumpIO::current_chain_t LLPumpIO::removeRunningChain(LLPumpIO::current_chain_t
//timeout is in microseconds
void LLPumpIO::pump(const S32& poll_timeout)
{
- LLFastTimer t1(FTM_PUMP_IO);
- //llinfos << "LLPumpIO::pump()" << llendl;
+ LL_RECORD_BLOCK_TIME(FTM_PUMP_IO);
+ //LL_INFOS() << "LLPumpIO::pump()" << LL_ENDL;
// Run any pending runners.
mRunner.run();
@@ -474,7 +475,7 @@ void LLPumpIO::pump(const S32& poll_timeout)
if(!mPendingChains.empty())
{
PUMP_DEBUG;
- //lldebugs << "Pushing " << mPendingChains.size() << "." << llendl;
+ //LL_DEBUGS() << "Pushing " << mPendingChains.size() << "." << LL_ENDL;
std::copy(
mPendingChains.begin(),
mPendingChains.end(),
@@ -522,11 +523,11 @@ void LLPumpIO::pump(const S32& poll_timeout)
if(mPollset)
{
PUMP_DEBUG;
- //llinfos << "polling" << llendl;
+ //LL_INFOS() << "polling" << LL_ENDL;
S32 count = 0;
S32 client_id = 0;
{
- LLFastTimer _(FTM_PUMP_POLL);
+ LL_RECORD_BLOCK_TIME(FTM_PUMP_POLL);
apr_pollset_poll(mPollset, poll_timeout, &count, &poll_fd);
}
PUMP_DEBUG;
@@ -544,7 +545,7 @@ void LLPumpIO::pump(const S32& poll_timeout)
signal_client_t::iterator not_signalled = signalled_client.end();
// Process everything as appropriate
- //lldebugs << "Running chain count: " << mRunningChains.size() << llendl;
+ //LL_DEBUGS() << "Running chain count: " << mRunningChains.size() << LL_ENDL;
running_chains_t::iterator run_chain = mRunningChains.begin();
bool process_this_chain = false;
while( run_chain != mRunningChains.end() )
@@ -564,9 +565,9 @@ void LLPumpIO::pump(const S32& poll_timeout)
&& (*run_chain).mTimer.hasExpired())
{
PUMP_DEBUG;
- llinfos << "Error handler forgot to reset timeout. "
+ LL_INFOS() << "Error handler forgot to reset timeout. "
<< "Resetting to " << DEFAULT_CHAIN_EXPIRY_SECS
- << " seconds." << llendl;
+ << " seconds." << LL_ENDL;
(*run_chain).setTimeoutSeconds(DEFAULT_CHAIN_EXPIRY_SECS);
}
}
@@ -576,15 +577,15 @@ void LLPumpIO::pump(const S32& poll_timeout)
// it timed out and no one handled it, so we need to
// retire the chain
#if LL_DEBUG_PIPE_TYPE_IN_PUMP
- lldebugs << "Removing chain "
+ LL_DEBUGS() << "Removing chain "
<< (*run_chain).mChainLinks[0].mPipe
<< " '"
<< typeid(*((*run_chain).mChainLinks[0].mPipe)).name()
- << "' because it timed out." << llendl;
+ << "' because it timed out." << LL_ENDL;
#else
-// lldebugs << "Removing chain "
+// LL_DEBUGS() << "Removing chain "
// << (*run_chain).mChainLinks[0].mPipe
-// << " because we reached the end." << llendl;
+// << " because we reached the end." << LL_ENDL;
#endif
run_chain = removeRunningChain(run_chain);
continue;
@@ -609,12 +610,12 @@ void LLPumpIO::pump(const S32& poll_timeout)
{
// if there are no conditionals, just process this chain.
process_this_chain = true;
- //lldebugs << "no conditionals - processing" << llendl;
+ //LL_DEBUGS() << "no conditionals - processing" << LL_ENDL;
}
else
{
PUMP_DEBUG;
- //lldebugs << "checking conditionals" << llendl;
+ //LL_DEBUGS() << "checking conditionals" << LL_ENDL;
// Check if this run chain was signalled. If any file
// descriptor is ready for something, then go ahead and
// process this chian.
@@ -654,7 +655,7 @@ void LLPumpIO::pump(const S32& poll_timeout)
error_status = LLIOPipe::STATUS_ERROR;
if(handleChainError(*run_chain, error_status)) break;
ll_debug_poll_fd("Removing pipe", poll);
- llwarns << "Removing pipe "
+ LL_WARNS() << "Removing pipe "
<< (*run_chain).mChainLinks[0].mPipe
<< " '"
#if LL_DEBUG_PIPE_TYPE_IN_PUMP
@@ -663,7 +664,7 @@ void LLPumpIO::pump(const S32& poll_timeout)
#endif
<< "' because: "
<< events_2_string(poll->rtnevents)
- << llendl;
+ << LL_ENDL;
(*run_chain).mHead = (*run_chain).mChainLinks.end();
break;
}
@@ -691,13 +692,13 @@ void LLPumpIO::pump(const S32& poll_timeout)
if((*run_chain).mHead == (*run_chain).mChainLinks.end())
{
#if LL_DEBUG_PIPE_TYPE_IN_PUMP
- lldebugs << "Removing chain " << (*run_chain).mChainLinks[0].mPipe
+ LL_DEBUGS() << "Removing chain " << (*run_chain).mChainLinks[0].mPipe
<< " '"
<< typeid(*((*run_chain).mChainLinks[0].mPipe)).name()
- << "' because we reached the end." << llendl;
+ << "' because we reached the end." << LL_ENDL;
#else
-// lldebugs << "Removing chain " << (*run_chain).mChainLinks[0].mPipe
-// << " because we reached the end." << llendl;
+// LL_DEBUGS() << "Removing chain " << (*run_chain).mChainLinks[0].mPipe
+// << " because we reached the end." << LL_ENDL;
#endif
PUMP_DEBUG;
@@ -773,11 +774,11 @@ bool LLPumpIO::respond(
return true;
}
-static LLFastTimer::DeclareTimer FTM_PUMP_CALLBACK_CHAIN("Chain");
+static LLTrace::BlockTimerStatHandle FTM_PUMP_CALLBACK_CHAIN("Chain");
void LLPumpIO::callback()
{
- //llinfos << "LLPumpIO::callback()" << llendl;
+ //LL_INFOS() << "LLPumpIO::callback()" << LL_ENDL;
if(true)
{
#if LL_THREADS_APR
@@ -795,7 +796,7 @@ void LLPumpIO::callback()
callbacks_t::iterator end = mCallbacks.end();
for(; it != end; ++it)
{
- LLFastTimer t(FTM_PUMP_CALLBACK_CHAIN);
+ LL_RECORD_BLOCK_TIME(FTM_PUMP_CALLBACK_CHAIN);
// it's always the first and last time for respone chains
(*it).mHead = (*it).mChainLinks.begin();
(*it).mInit = true;
@@ -846,7 +847,7 @@ void LLPumpIO::cleanup()
mCallbackMutex = NULL;
if(mPollset)
{
-// lldebugs << "cleaning up pollset" << llendl;
+// LL_DEBUGS() << "cleaning up pollset" << LL_ENDL;
apr_pollset_destroy(mPollset);
mPollset = NULL;
}
@@ -860,10 +861,10 @@ void LLPumpIO::cleanup()
void LLPumpIO::rebuildPollset()
{
-// lldebugs << "LLPumpIO::rebuildPollset()" << llendl;
+// LL_DEBUGS() << "LLPumpIO::rebuildPollset()" << LL_ENDL;
if(mPollset)
{
- //lldebugs << "destroying pollset" << llendl;
+ //LL_DEBUGS() << "destroying pollset" << LL_ENDL;
apr_pollset_destroy(mPollset);
mPollset = NULL;
}
@@ -874,7 +875,7 @@ void LLPumpIO::rebuildPollset()
{
size += (*run_it).mDescriptors.size();
}
- //lldebugs << "found " << size << " descriptors." << llendl;
+ //LL_DEBUGS() << "found " << size << " descriptors." << LL_ENDL;
if(size)
{
// Recycle the memory pool
@@ -921,10 +922,10 @@ void LLPumpIO::processChain(LLChainInfo& chain)
{
#if LL_DEBUG_PROCESS_LINK
#if LL_DEBUG_PIPE_TYPE_IN_PUMP
- llinfos << "Processing " << typeid(*((*it).mPipe)).name() << "."
- << llendl;
+ LL_INFOS() << "Processing " << typeid(*((*it).mPipe)).name() << "."
+ << LL_ENDL;
#else
- llinfos << "Processing link " << (*it).mPipe << "." << llendl;
+ LL_INFOS() << "Processing link " << (*it).mPipe << "." << LL_ENDL;
#endif
#endif
#if LL_DEBUG_SPEW_BUFFER_CHANNEL_IN
@@ -941,15 +942,15 @@ void LLPumpIO::processChain(LLChainInfo& chain)
(U8*)buf,
bytes);
buf[bytes] = '\0';
- llinfos << "CHANNEL IN(" << (*it).mChannels.in() << "): "
- << buf << llendl;
+ LL_INFOS() << "CHANNEL IN(" << (*it).mChannels.in() << "): "
+ << buf << LL_ENDL;
delete[] buf;
buf = NULL;
}
else
{
- llinfos << "CHANNEL IN(" << (*it).mChannels.in()<< "): (null)"
- << llendl;
+ LL_INFOS() << "CHANNEL IN(" << (*it).mChannels.in()<< "): (null)"
+ << LL_ENDL;
}
}
#endif
@@ -974,15 +975,15 @@ void LLPumpIO::processChain(LLChainInfo& chain)
(U8*)buf,
bytes);
buf[bytes] = '\0';
- llinfos << "CHANNEL OUT(" << (*it).mChannels.out()<< "): "
- << buf << llendl;
+ LL_INFOS() << "CHANNEL OUT(" << (*it).mChannels.out()<< "): "
+ << buf << LL_ENDL;
delete[] buf;
buf = NULL;
}
else
{
- llinfos << "CHANNEL OUT(" << (*it).mChannels.out()<< "): (null)"
- << llendl;
+ LL_INFOS() << "CHANNEL OUT(" << (*it).mChannels.out()<< "): (null)"
+ << LL_ENDL;
}
}
#endif
@@ -992,11 +993,11 @@ void LLPumpIO::processChain(LLChainInfo& chain)
// below.
if(LLIOPipe::isSuccess(status))
{
- llinfos << "Pipe returned: '"
+ LL_INFOS() << "Pipe returned: '"
#if LL_DEBUG_PIPE_TYPE_IN_PUMP
<< typeid(*((*it).mPipe)).name() << "':'"
#endif
- << LLIOPipe::lookupStatusString(status) << "'" << llendl;
+ << LLIOPipe::lookupStatusString(status) << "'" << LL_ENDL;
}
#endif
@@ -1036,12 +1037,12 @@ void LLPumpIO::processChain(LLChainInfo& chain)
PUMP_DEBUG;
if(LLIOPipe::isError(status))
{
- llinfos << "Pump generated pipe err: '"
+ LL_INFOS() << "Pump generated pipe err: '"
#if LL_DEBUG_PIPE_TYPE_IN_PUMP
<< typeid(*((*it).mPipe)).name() << "':'"
#endif
<< LLIOPipe::lookupStatusString(status)
- << "'" << llendl;
+ << "'" << LL_ENDL;
#if LL_DEBUG_SPEW_BUFFER_CHANNEL_IN_ON_ERROR
if(chain.mData)
{
@@ -1058,18 +1059,18 @@ void LLPumpIO::processChain(LLChainInfo& chain)
(U8*)buf,
bytes);
buf[bytes] = '\0';
- llinfos << "Input After Error: " << buf << llendl;
+ LL_INFOS() << "Input After Error: " << buf << LL_ENDL;
delete[] buf;
buf = NULL;
}
else
{
- llinfos << "Input After Error: (null)" << llendl;
+ LL_INFOS() << "Input After Error: (null)" << LL_ENDL;
}
}
else
{
- llinfos << "Input After Error: (null)" << llendl;
+ LL_INFOS() << "Input After Error: (null)" << LL_ENDL;
}
#endif
keep_going = false;
@@ -1081,8 +1082,8 @@ void LLPumpIO::processChain(LLChainInfo& chain)
}
else
{
- llinfos << "Unhandled status code: " << status << ":"
- << LLIOPipe::lookupStatusString(status) << llendl;
+ LL_INFOS() << "Unhandled status code: " << status << ":"
+ << LLIOPipe::lookupStatusString(status) << LL_ENDL;
}
break;
}
@@ -1129,8 +1130,8 @@ bool LLPumpIO::handleChainError(
do
{
#if LL_DEBUG_PIPE_TYPE_IN_PUMP
- lldebugs << "Passing error to " << typeid(*((*rit).mPipe)).name()
- << "." << llendl;
+ LL_DEBUGS() << "Passing error to " << typeid(*((*rit).mPipe)).name()
+ << "." << LL_ENDL;
#endif
error = (*rit).mPipe->handleError(error, this);
switch(error)
@@ -1144,8 +1145,8 @@ bool LLPumpIO::handleChainError(
case LLIOPipe::STATUS_BREAK:
case LLIOPipe::STATUS_NEED_PROCESS:
#if LL_DEBUG_PIPE_TYPE_IN_PUMP
- lldebugs << "Pipe " << typeid(*((*rit).mPipe)).name()
- << " returned code to stop error handler." << llendl;
+ LL_DEBUGS() << "Pipe " << typeid(*((*rit).mPipe)).name()
+ << " returned code to stop error handler." << LL_ENDL;
#endif
keep_going = false;
break;
@@ -1155,8 +1156,8 @@ bool LLPumpIO::handleChainError(
default:
if(LLIOPipe::isSuccess(error))
{
- llinfos << "Unhandled status code: " << error << ":"
- << LLIOPipe::lookupStatusString(error) << llendl;
+ LL_INFOS() << "Unhandled status code: " << error << ":"
+ << LLIOPipe::lookupStatusString(error) << LL_ENDL;
error = LLIOPipe::STATUS_ERROR;
keep_going = false;
}
diff --git a/indra/llmessage/llregionflags.h b/indra/llmessage/llregionflags.h
index 1cf940918b..40d7b04a90 100755
--- a/indra/llmessage/llregionflags.h
+++ b/indra/llmessage/llregionflags.h
@@ -76,6 +76,8 @@ const U64 REGION_FLAGS_DENY_ANONYMOUS = (1 << 23);
const U64 REGION_FLAGS_ALLOW_PARCEL_CHANGES = (1 << 26);
+const U64 REGION_FLAGS_BLOCK_FLYOVER = (1 << 27);
+
const U64 REGION_FLAGS_ALLOW_VOICE = (1 << 28);
const U64 REGION_FLAGS_BLOCK_PARCEL_SEARCH = (1 << 29);
diff --git a/indra/llmessage/llregionhandle.h b/indra/llmessage/llregionhandle.h
index c77794e4b8..e3ddd46acd 100755
--- a/indra/llmessage/llregionhandle.h
+++ b/indra/llmessage/llregionhandle.h
@@ -68,7 +68,7 @@ inline BOOL to_region_handle(const F32 x_pos, const F32 y_pos, U64 *region_handl
U32 x_int, y_int;
if (x_pos < 0.f)
{
-// llwarns << "to_region_handle:Clamping negative x position " << x_pos << " to zero!" << llendl;
+// LL_WARNS() << "to_region_handle:Clamping negative x position " << x_pos << " to zero!" << LL_ENDL;
return FALSE;
}
else
@@ -77,7 +77,7 @@ inline BOOL to_region_handle(const F32 x_pos, const F32 y_pos, U64 *region_handl
}
if (y_pos < 0.f)
{
-// llwarns << "to_region_handle:Clamping negative y position " << y_pos << " to zero!" << llendl;
+// LL_WARNS() << "to_region_handle:Clamping negative y position " << y_pos << " to zero!" << LL_ENDL;
return FALSE;
}
else
diff --git a/indra/llmessage/llregionpresenceverifier.cpp b/indra/llmessage/llregionpresenceverifier.cpp
deleted file mode 100755
index 932cbf375e..0000000000
--- a/indra/llmessage/llregionpresenceverifier.cpp
+++ /dev/null
@@ -1,153 +0,0 @@
-/**
- * @file llregionpresenceverifier.cpp
- * @brief
- *
- * $LicenseInfo:firstyear=2008&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "linden_common.h"
-
-#include "llregionpresenceverifier.h"
-#include "llhttpclientinterface.h"
-#include <sstream>
-#include "net.h"
-#include "message.h"
-
-namespace boost
-{
- void intrusive_ptr_add_ref(LLRegionPresenceVerifier::Response* p)
- {
- ++p->mReferenceCount;
- }
-
- void intrusive_ptr_release(LLRegionPresenceVerifier::Response* p)
- {
- if(p && 0 == --p->mReferenceCount)
- {
- delete p;
- }
- }
-};
-
-LLRegionPresenceVerifier::Response::~Response()
-{
-}
-
-LLRegionPresenceVerifier::RegionResponder::RegionResponder(const std::string&
- uri,
- ResponsePtr data,
- S32 retry_count) :
- mUri(uri),
- mSharedData(data),
- mRetryCount(retry_count)
-{
-}
-
-//virtual
-LLRegionPresenceVerifier::RegionResponder::~RegionResponder()
-{
-}
-
-void LLRegionPresenceVerifier::RegionResponder::result(const LLSD& content)
-{
- std::string host = content["private_host"].asString();
- U32 port = content["private_port"].asInteger();
- LLHost destination(host, port);
- LLUUID id = content["region_id"];
-
- lldebugs << "Verifying " << destination.getString() << " is region " << id << llendl;
-
- std::stringstream uri;
- uri << "http://" << destination.getString() << "/state/basic/";
- mSharedData->getHttpClient().get(
- uri.str(),
- new VerifiedDestinationResponder(mUri, mSharedData, content, mRetryCount));
-}
-
-void LLRegionPresenceVerifier::RegionResponder::error(U32 status,
- const std::string& reason)
-{
- // TODO: babbage: distinguish between region presence service and
- // region verification errors?
- mSharedData->onRegionVerificationFailed();
-}
-
-LLRegionPresenceVerifier::VerifiedDestinationResponder::VerifiedDestinationResponder(const std::string& uri, ResponsePtr data, const LLSD& content,
- S32 retry_count):
- mUri(uri),
- mSharedData(data),
- mContent(content),
- mRetryCount(retry_count)
-{
-}
-
-//virtual
-LLRegionPresenceVerifier::VerifiedDestinationResponder::~VerifiedDestinationResponder()
-{
-}
-
-void LLRegionPresenceVerifier::VerifiedDestinationResponder::result(const LLSD& content)
-{
- LLUUID actual_region_id = content["region_id"];
- LLUUID expected_region_id = mContent["region_id"];
-
- lldebugs << "Actual region: " << content << llendl;
- lldebugs << "Expected region: " << mContent << llendl;
-
- if (mSharedData->checkValidity(content) &&
- (actual_region_id == expected_region_id))
- {
- mSharedData->onRegionVerified(mContent);
- }
- else if (mRetryCount > 0)
- {
- retry();
- }
- else
- {
- llwarns << "Simulator verification failed. Region: " << mUri << llendl;
- mSharedData->onRegionVerificationFailed();
- }
-}
-
-void LLRegionPresenceVerifier::VerifiedDestinationResponder::retry()
-{
- LLSD headers;
- headers["Cache-Control"] = "no-cache, max-age=0";
- llinfos << "Requesting region information, get uncached for region "
- << mUri << llendl;
- --mRetryCount;
- mSharedData->getHttpClient().get(mUri, new RegionResponder(mUri, mSharedData, mRetryCount), headers);
-}
-
-void LLRegionPresenceVerifier::VerifiedDestinationResponder::error(U32 status, const std::string& reason)
-{
- if(mRetryCount > 0)
- {
- retry();
- }
- else
- {
- llwarns << "Failed to contact simulator for verification. Region: " << mUri << llendl;
- mSharedData->onRegionVerificationFailed();
- }
-}
diff --git a/indra/llmessage/llregionpresenceverifier.h b/indra/llmessage/llregionpresenceverifier.h
deleted file mode 100755
index 5e8251e519..0000000000
--- a/indra/llmessage/llregionpresenceverifier.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * @file llregionpresenceverifier.cpp
- * @brief
- *
- * $LicenseInfo:firstyear=2008&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-/* Macro Definitions */
-#ifndef LL_LLREGIONPRESENCEVERIFIER_H
-#define LL_LLREGIONPRESENCEVERIFIER_H
-
-#include "llhttpclient.h"
-#include <string>
-#include "llsd.h"
-#include <boost/intrusive_ptr.hpp>
-
-class LLHTTPClientInterface;
-
-class LLRegionPresenceVerifier
-{
-public:
- class Response
- {
- public:
- virtual ~Response() = 0;
-
- virtual bool checkValidity(const LLSD& content) const = 0;
- virtual void onRegionVerified(const LLSD& region_details) = 0;
- virtual void onRegionVerificationFailed() = 0;
-
- virtual LLHTTPClientInterface& getHttpClient() = 0;
-
- public: /* but not really -- don't touch this */
- U32 mReferenceCount;
- };
-
- typedef boost::intrusive_ptr<Response> ResponsePtr;
-
- class RegionResponder : public LLHTTPClient::Responder
- {
- public:
- RegionResponder(const std::string& uri, ResponsePtr data,
- S32 retry_count);
- virtual ~RegionResponder();
- virtual void result(const LLSD& content);
- virtual void error(U32 status, const std::string& reason);
-
- private:
- ResponsePtr mSharedData;
- std::string mUri;
- S32 mRetryCount;
- };
-
- class VerifiedDestinationResponder : public LLHTTPClient::Responder
- {
- public:
- VerifiedDestinationResponder(const std::string& uri, ResponsePtr data,
- const LLSD& content, S32 retry_count);
- virtual ~VerifiedDestinationResponder();
- virtual void result(const LLSD& content);
-
- virtual void error(U32 status, const std::string& reason);
-
- private:
- void retry();
- ResponsePtr mSharedData;
- LLSD mContent;
- std::string mUri;
- S32 mRetryCount;
- };
-};
-
-namespace boost
-{
- void intrusive_ptr_add_ref(LLRegionPresenceVerifier::Response* p);
- void intrusive_ptr_release(LLRegionPresenceVerifier::Response* p);
-};
-
-#endif //LL_LLREGIONPRESENCEVERIFIER_H
diff --git a/indra/llmessage/llsdappservices.cpp b/indra/llmessage/llsdappservices.cpp
index 8bab91b0c0..4ca45267bd 100755
--- a/indra/llmessage/llsdappservices.cpp
+++ b/indra/llmessage/llsdappservices.cpp
@@ -119,9 +119,9 @@ public:
virtual bool validate(const std::string& name, LLSD& context) const
{
- //llinfos << "validate: " << name << ", "
- // << LLSDOStreamer<LLSDNotationFormatter>(context) << llendl;
- if((std::string("PUT") == context["request"]["verb"].asString()) && !name.empty())
+ //LL_INFOS() << "validate: " << name << ", "
+ // << LLSDOStreamer<LLSDNotationFormatter>(context) << LL_ENDL;
+ if((std::string("PUT") == context[CONTEXT_REQUEST][CONTEXT_VERB].asString()) && !name.empty())
{
return true;
}
@@ -139,7 +139,7 @@ public:
LLHTTPNode::ResponsePtr response,
const LLSD& context) const
{
- std::string name = context["request"]["wildcard"]["option-name"];
+ std::string name = context[CONTEXT_REQUEST][CONTEXT_WILDCARD]["option-name"];
LLSD options = LLApp::instance()->getOptionData(
LLApp::PRIORITY_RUNTIME_OVERRIDE);
response->result(options[name]);
@@ -150,7 +150,7 @@ public:
const LLSD& context,
const LLSD& input) const
{
- std::string name = context["request"]["wildcard"]["option-name"];
+ std::string name = context[CONTEXT_REQUEST][CONTEXT_WILDCARD]["option-name"];
LLSD options = LLApp::instance()->getOptionData(
LLApp::PRIORITY_RUNTIME_OVERRIDE);
options[name] = input;
@@ -164,7 +164,7 @@ public:
LLHTTPNode::ResponsePtr response,
const LLSD& context) const
{
- std::string name = context["request"]["wildcard"]["option-name"];
+ std::string name = context[CONTEXT_REQUEST][CONTEXT_WILDCARD]["option-name"];
LLSD options = LLApp::instance()->getOptionData(
LLApp::PRIORITY_RUNTIME_OVERRIDE);
options.erase(name);
@@ -257,8 +257,8 @@ public:
virtual bool validate(const std::string& name, LLSD& context) const
{
- llinfos << "LLHTTPLiveConfigSingleService::validate(" << name
- << ")" << llendl;
+ LL_INFOS() << "LLHTTPLiveConfigSingleService::validate(" << name
+ << ")" << LL_ENDL;
LLSD option = LLApp::instance()->getOption(name);
if(option.isDefined()) return true;
else return false;
@@ -268,7 +268,7 @@ public:
LLHTTPNode::ResponsePtr response,
const LLSD& context) const
{
- std::string name = context["request"]["wildcard"]["option-name"];
+ std::string name = context[CONTEXT_REQUEST][CONTEXT_WILDCARD]["option-name"];
response->result(LLApp::instance()->getOption(name));
}
};
diff --git a/indra/llmessage/llsdhttpserver.cpp b/indra/llmessage/llsdhttpserver.cpp
index 5c8fc7b2bb..8ac6b3cb12 100755
--- a/indra/llmessage/llsdhttpserver.cpp
+++ b/indra/llmessage/llsdhttpserver.cpp
@@ -109,7 +109,7 @@ public:
virtual void get(ResponsePtr response, const LLSD& context) const
{
- const LLSD& remainder = context["request"]["remainder"];
+ const LLSD& remainder = context[CONTEXT_REQUEST]["remainder"];
if (remainder.size() > 0)
{
diff --git a/indra/llmessage/llsdmessage.cpp b/indra/llmessage/llsdmessage.cpp
index 1c93c12d99..61fcc5dd2f 100755
--- a/indra/llmessage/llsdmessage.cpp
+++ b/indra/llmessage/llsdmessage.cpp
@@ -92,14 +92,14 @@ bool LLSDMessage::httpListener(const LLSD& request)
return false;
}
-void LLSDMessage::EventResponder::result(const LLSD& data)
+void LLSDMessage::EventResponder::httpSuccess()
{
// If our caller passed an empty replyPump name, they're not
// listening: this is a fire-and-forget message. Don't bother posting
// to the pump whose name is "".
if (! mReplyPump.empty())
{
- LLSD response(data);
+ LLSD response(getContent());
mReqID.stamp(response);
mPumps.obtain(mReplyPump).post(response);
}
@@ -111,7 +111,7 @@ void LLSDMessage::EventResponder::result(const LLSD& data)
}
}
-void LLSDMessage::EventResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+void LLSDMessage::EventResponder::httpFailure()
{
// If our caller passed an empty errorPump name, they're not
// listening: "default error handling is acceptable." Only post to an
@@ -121,19 +121,17 @@ void LLSDMessage::EventResponder::errorWithContent(U32 status, const std::string
LLSD info(mReqID.makeResponse());
info["target"] = mTarget;
info["message"] = mMessage;
- info["status"] = LLSD::Integer(status);
- info["reason"] = reason;
- info["content"] = content;
+ info["status"] = getStatus();
+ info["reason"] = getReason();
+ info["content"] = getContent();
mPumps.obtain(mErrorPump).post(info);
}
else // default error handling
{
- // convention seems to be to use llinfos, but that seems a bit casual?
+ // convention seems to be to use LL_INFOS(), but that seems a bit casual?
LL_WARNS("LLSDMessage::EventResponder")
<< "'" << mMessage << "' to '" << mTarget
- << "' failed with code " << status << ": " << reason << '\n'
- << ll_pretty_print_sd(content)
- << LL_ENDL;
+ << "' failed " << dumpResponse() << LL_ENDL;
}
}
@@ -151,11 +149,11 @@ bool LLSDMessage::ResponderAdapter::listener(const LLSD& payload, bool success)
{
if (success)
{
- mResponder->result(payload);
+ mResponder->successResult(payload);
}
else
{
- mResponder->errorWithContent(payload["status"].asInteger(), payload["reason"], payload["content"]);
+ mResponder->failureResult(payload["status"].asInteger(), payload["reason"], payload["content"]);
}
/*---------------- MUST BE LAST STATEMENT BEFORE RETURN ----------------*/
diff --git a/indra/llmessage/llsdmessage.h b/indra/llmessage/llsdmessage.h
index 0d34847ff2..e5d532d6a4 100755
--- a/indra/llmessage/llsdmessage.h
+++ b/indra/llmessage/llsdmessage.h
@@ -123,6 +123,7 @@ private:
/// LLCapabilityListener. Others should use higher-level APIs.
class EventResponder: public LLHTTPClient::Responder
{
+ LOG_CLASS(EventResponder);
public:
/**
* LLHTTPClient::Responder that dispatches via named LLEventPump instances.
@@ -149,8 +150,9 @@ private:
mErrorPump(errorPump)
{}
- virtual void result(const LLSD& data);
- virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content);
+ protected:
+ virtual void httpSuccess();
+ virtual void httpFailure();
private:
LLEventPumps& mPumps;
diff --git a/indra/llmessage/llsdmessagebuilder.cpp b/indra/llmessage/llsdmessagebuilder.cpp
index 615221e0ad..49456c71ed 100755
--- a/indra/llmessage/llsdmessagebuilder.cpp
+++ b/indra/llmessage/llsdmessagebuilder.cpp
@@ -91,7 +91,7 @@ void LLSDMessageBuilder::nextBlock(const char* blockname)
}
else
{
- llerrs << "existing block not array" << llendl;
+ LL_ERRS() << "existing block not array" << LL_ENDL;
}
}
@@ -380,7 +380,7 @@ void LLSDMessageBuilder::copyFromMessageData(const LLMsgData& data)
break;
default:
- llwarns << "Unknown type in conversion of message to LLSD" << llendl;
+ LL_WARNS() << "Unknown type in conversion of message to LLSD" << LL_ENDL;
break;
}
}
@@ -391,7 +391,7 @@ void LLSDMessageBuilder::copyFromMessageData(const LLMsgData& data)
void LLSDMessageBuilder::copyFromLLSD(const LLSD& msg)
{
mCurrentMessage = msg;
- lldebugs << LLSDNotationStreamer(mCurrentMessage) << llendl;
+ LL_DEBUGS() << LLSDNotationStreamer(mCurrentMessage) << LL_ENDL;
}
const LLSD& LLSDMessageBuilder::getMessage() const
diff --git a/indra/llmessage/llsdmessagereader.cpp b/indra/llmessage/llsdmessagereader.cpp
index a6fccd2a56..b729ebafa9 100755
--- a/indra/llmessage/llsdmessagereader.cpp
+++ b/indra/llmessage/llsdmessagereader.cpp
@@ -53,16 +53,16 @@ LLSDMessageReader::~LLSDMessageReader()
LLSD getLLSD(const LLSD& input, const char* block, const char* var, S32 blocknum)
{
- // babbage: log error to llerrs if variable not found to mimic
+ // babbage: log error to LL_ERRS() if variable not found to mimic
// LLTemplateMessageReader::getData behaviour
if(NULL == block)
{
- llerrs << "NULL block name" << llendl;
+ LL_ERRS() << "NULL block name" << LL_ENDL;
return LLSD();
}
if(NULL == var)
{
- llerrs << "NULL var name" << llendl;
+ LL_ERRS() << "NULL var name" << LL_ENDL;
return LLSD();
}
if(! input[block].isArray())
@@ -70,7 +70,7 @@ LLSD getLLSD(const LLSD& input, const char* block, const char* var, S32 blocknum
// NOTE: babbage: need to return default for missing blocks to allow
// backwards/forwards compatibility - handlers must cope with default
// values.
- llwarns << "block " << block << " not found" << llendl;
+ LL_WARNS() << "block " << block << " not found" << LL_ENDL;
return LLSD();
}
@@ -80,7 +80,7 @@ LLSD getLLSD(const LLSD& input, const char* block, const char* var, S32 blocknum
// NOTE: babbage: need to return default for missing vars to allow
// backwards/forwards compatibility - handlers must cope with default
// values.
- llwarns << "var " << var << " not found" << llendl;
+ LL_WARNS() << "var " << var << " not found" << LL_ENDL;
}
return result;
}
@@ -238,7 +238,7 @@ void LLSDMessageReader::getString(const char *block, const char *var,
{
if(buffer_size <= 0)
{
- llwarns << "buffer_size <= 0" << llendl;
+ LL_WARNS() << "buffer_size <= 0" << LL_ENDL;
return;
}
std::string data = getLLSD(mMessage, block, var, blocknum);
diff --git a/indra/llmessage/llsdrpcclient.cpp b/indra/llmessage/llsdrpcclient.cpp
index fcda0e81a3..eb773ceb3a 100755
--- a/indra/llmessage/llsdrpcclient.cpp
+++ b/indra/llmessage/llsdrpcclient.cpp
@@ -30,6 +30,7 @@
#include "llsdrpcclient.h"
#include "llbufferstream.h"
+#include "llfasttimer.h"
#include "llfiltersd2xmlrpc.h"
#include "llpumpio.h"
#include "llsd.h"
@@ -78,7 +79,7 @@ bool LLSDRPCResponse::extractResponse(const LLSD& sd)
return rv;
}
-static LLFastTimer::DeclareTimer FTM_SDRPC_RESPONSE("SDRPC Response");
+static LLTrace::BlockTimerStatHandle FTM_SDRPC_RESPONSE("SDRPC Response");
// virtual
LLIOPipe::EStatus LLSDRPCResponse::process_impl(
@@ -88,7 +89,7 @@ LLIOPipe::EStatus LLSDRPCResponse::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_SDRPC_RESPONSE);
+ LL_RECORD_BLOCK_TIME(FTM_SDRPC_RESPONSE);
PUMP_DEBUG;
if(mIsError)
{
@@ -128,8 +129,8 @@ bool LLSDRPCClient::call(
LLSDRPCResponse* response,
EPassBackQueue queue)
{
- //llinfos << "RPC: " << uri << "." << method << "(" << *parameter << ")"
- // << llendl;
+ //LL_INFOS() << "RPC: " << uri << "." << method << "(" << *parameter << ")"
+ // << LL_ENDL;
if(method.empty() || !response)
{
return false;
@@ -154,8 +155,8 @@ bool LLSDRPCClient::call(
LLSDRPCResponse* response,
EPassBackQueue queue)
{
- //llinfos << "RPC: " << uri << "." << method << "(" << parameter << ")"
- // << llendl;
+ //LL_INFOS() << "RPC: " << uri << "." << method << "(" << parameter << ")"
+ // << LL_ENDL;
if(method.empty() || parameter.empty() || !response)
{
return false;
@@ -172,7 +173,7 @@ bool LLSDRPCClient::call(
return true;
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_SDRPC_CLIENT("SDRPC Client");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_SDRPC_CLIENT("SDRPC Client");
// virtual
LLIOPipe::EStatus LLSDRPCClient::process_impl(
@@ -182,7 +183,7 @@ LLIOPipe::EStatus LLSDRPCClient::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_PROCESS_SDRPC_CLIENT);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_SDRPC_CLIENT);
PUMP_DEBUG;
if((STATE_NONE == mState) || (!pump))
{
@@ -195,7 +196,7 @@ LLIOPipe::EStatus LLSDRPCClient::process_impl(
case STATE_READY:
{
PUMP_DEBUG;
-// lldebugs << "LLSDRPCClient::process_impl STATE_READY" << llendl;
+// LL_DEBUGS() << "LLSDRPCClient::process_impl STATE_READY" << LL_ENDL;
buffer->append(
channels.out(),
(U8*)mRequest.c_str(),
@@ -208,8 +209,8 @@ LLIOPipe::EStatus LLSDRPCClient::process_impl(
{
PUMP_DEBUG;
// The input channel has the sd response in it.
- //lldebugs << "LLSDRPCClient::process_impl STATE_WAITING_FOR_RESPONSE"
- // << llendl;
+ //LL_DEBUGS() << "LLSDRPCClient::process_impl STATE_WAITING_FOR_RESPONSE"
+ // << LL_ENDL;
LLBufferStream resp(channels, buffer.get());
LLSD sd;
LLSDSerialize::fromNotation(sd, resp, buffer->count(channels.in()));
@@ -236,7 +237,7 @@ LLIOPipe::EStatus LLSDRPCClient::process_impl(
case STATE_DONE:
default:
PUMP_DEBUG;
- llinfos << "invalid state to process" << llendl;
+ LL_INFOS() << "invalid state to process" << LL_ENDL;
rv = STATUS_ERROR;
break;
}
diff --git a/indra/llmessage/llsdrpcclient.h b/indra/llmessage/llsdrpcclient.h
index 0cecf4f688..c4e0333ca3 100755
--- a/indra/llmessage/llsdrpcclient.h
+++ b/indra/llmessage/llsdrpcclient.h
@@ -239,11 +239,11 @@ public:
LLSDRPCClientFactory(const std::string& fixed_url) : mURL(fixed_url) {}
virtual bool build(LLPumpIO::chain_t& chain, LLSD context) const
{
- lldebugs << "LLSDRPCClientFactory::build" << llendl;
- LLURLRequest* http(new LLURLRequest(LLURLRequest::HTTP_POST));
+ LL_DEBUGS() << "LLSDRPCClientFactory::build" << LL_ENDL;
+ LLURLRequest* http(new LLURLRequest(HTTP_POST));
if(!http->isValid())
{
- llwarns << "Creating LLURLRequest failed." << llendl ;
+ LL_WARNS() << "Creating LLURLRequest failed." << LL_ENDL ;
delete http;
return false;
}
@@ -251,7 +251,7 @@ public:
LLIOPipe::ptr_t service(new Client);
chain.push_back(service);
LLIOPipe::ptr_t http_pipe(http);
- http->addHeader("Content-Type: text/llsd");
+ http->addHeader(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_TEXT_LLSD);
if(mURL.empty())
{
chain.push_back(LLIOPipe::ptr_t(new LLContextURLExtractor(http)));
@@ -289,19 +289,19 @@ public:
LLXMLSDRPCClientFactory(const std::string& fixed_url) : mURL(fixed_url) {}
virtual bool build(LLPumpIO::chain_t& chain, LLSD context) const
{
- lldebugs << "LLXMLSDRPCClientFactory::build" << llendl;
+ LL_DEBUGS() << "LLXMLSDRPCClientFactory::build" << LL_ENDL;
- LLURLRequest* http(new LLURLRequest(LLURLRequest::HTTP_POST));
+ LLURLRequest* http(new LLURLRequest(HTTP_POST));
if(!http->isValid())
{
- llwarns << "Creating LLURLRequest failed." << llendl ;
+ LL_WARNS() << "Creating LLURLRequest failed." << LL_ENDL ;
delete http;
return false ;
}
LLIOPipe::ptr_t service(new Client);
chain.push_back(service);
LLIOPipe::ptr_t http_pipe(http);
- http->addHeader("Content-Type: text/xml");
+ http->addHeader(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_TEXT_XML);
if(mURL.empty())
{
chain.push_back(LLIOPipe::ptr_t(new LLContextURLExtractor(http)));
diff --git a/indra/llmessage/llsdrpcserver.cpp b/indra/llmessage/llsdrpcserver.cpp
index f26ee52f71..c3ed19889e 100755
--- a/indra/llmessage/llsdrpcserver.cpp
+++ b/indra/llmessage/llsdrpcserver.cpp
@@ -31,6 +31,7 @@
#include "llbuffer.h"
#include "llbufferstream.h"
+#include "llfasttimer.h"
#include "llpumpio.h"
#include "llsdserialize.h"
#include "llstl.h"
@@ -94,7 +95,7 @@ void LLSDRPCServer::clearLock()
}
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_SDRPC_SERVER("SDRPC Server");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_SDRPC_SERVER("SDRPC Server");
// virtual
LLIOPipe::EStatus LLSDRPCServer::process_impl(
@@ -104,9 +105,9 @@ LLIOPipe::EStatus LLSDRPCServer::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_PROCESS_SDRPC_SERVER);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_SDRPC_SERVER);
PUMP_DEBUG;
-// lldebugs << "LLSDRPCServer::process_impl" << llendl;
+// LL_DEBUGS() << "LLSDRPCServer::process_impl" << LL_ENDL;
// Once we have all the data, We need to read the sd on
// the the in channel, and respond on the out channel
if(!eos) return STATUS_BREAK;
@@ -131,10 +132,10 @@ LLIOPipe::EStatus LLSDRPCServer::process_impl(
return STATUS_DONE;
case STATE_DONE:
-// lldebugs << "STATE_DONE" << llendl;
+// LL_DEBUGS() << "STATE_DONE" << LL_ENDL;
break;
case STATE_CALLBACK:
-// lldebugs << "STATE_CALLBACK" << llendl;
+// LL_DEBUGS() << "STATE_CALLBACK" << LL_ENDL;
PUMP_DEBUG;
method_name = mRequest[LLSDRPC_METHOD_SD_NAME].asString();
if(!method_name.empty() && mRequest.has(LLSDRPC_PARAMETER_SD_NAME))
@@ -168,7 +169,7 @@ LLIOPipe::EStatus LLSDRPCServer::process_impl(
mState = STATE_DONE;
break;
case STATE_NONE:
-// lldebugs << "STATE_NONE" << llendl;
+// LL_DEBUGS() << "STATE_NONE" << LL_ENDL;
default:
{
// First time we got here - process the SD request, and call
@@ -316,7 +317,7 @@ void LLSDRPCServer::buildFault(
{
LLBufferStream ostr(channels, data);
ostr << FAULT_PART_1 << code << FAULT_PART_2 << msg << FAULT_PART_3;
- llinfos << "LLSDRPCServer::buildFault: " << code << ", " << msg << llendl;
+ LL_INFOS() << "LLSDRPCServer::buildFault: " << code << ", " << msg << LL_ENDL;
}
// static
@@ -333,6 +334,6 @@ void LLSDRPCServer::buildResponse(
std::ostringstream debug_ostr;
debug_ostr << "LLSDRPCServer::buildResponse: ";
LLSDSerialize::toNotation(response, debug_ostr);
- llinfos << debug_ostr.str() << llendl;
+ LL_INFOS() << debug_ostr.str() << LL_ENDL;
#endif
}
diff --git a/indra/llmessage/llsdrpcserver.h b/indra/llmessage/llsdrpcserver.h
index 9e56e4ea46..415bd31c26 100755
--- a/indra/llmessage/llsdrpcserver.h
+++ b/indra/llmessage/llsdrpcserver.h
@@ -323,7 +323,7 @@ class LLSDRPCServerFactory : public LLChainIOFactory
public:
virtual bool build(LLPumpIO::chain_t& chain, LLSD context) const
{
- lldebugs << "LLXMLSDRPCServerFactory::build" << llendl;
+ LL_DEBUGS() << "LLXMLSDRPCServerFactory::build" << LL_ENDL;
chain.push_back(LLIOPipe::ptr_t(new Server));
return true;
}
@@ -341,7 +341,7 @@ class LLXMLRPCServerFactory : public LLChainIOFactory
public:
virtual bool build(LLPumpIO::chain_t& chain, LLSD context) const
{
- lldebugs << "LLXMLSDRPCServerFactory::build" << llendl;
+ LL_DEBUGS() << "LLXMLSDRPCServerFactory::build" << LL_ENDL;
chain.push_back(LLIOPipe::ptr_t(new LLFilterXMLRPCRequest2LLSD));
chain.push_back(LLIOPipe::ptr_t(new Server));
chain.push_back(LLIOPipe::ptr_t(new LLFilterSD2XMLRPCResponse));
diff --git a/indra/llmessage/llservice.cpp b/indra/llmessage/llservice.cpp
index dbec92c221..ddcc13d969 100755
--- a/indra/llmessage/llservice.cpp
+++ b/indra/llmessage/llservice.cpp
@@ -41,7 +41,7 @@ LLService::~LLService()
// static
bool LLService::registerCreator(const std::string& name, creator_t fn)
{
- llinfos << "LLService::registerCreator(" << name << ")" << llendl;
+ LL_INFOS() << "LLService::registerCreator(" << name << ")" << LL_ENDL;
if(name.empty())
{
return false;
@@ -64,7 +64,7 @@ LLIOPipe* LLService::activate(
{
if(name.empty())
{
- llinfos << "LLService::activate - no service specified." << llendl;
+ LL_INFOS() << "LLService::activate - no service specified." << LL_ENDL;
return NULL;
}
creators_t::iterator it = sCreatorFunctors.find(name);
@@ -79,15 +79,15 @@ LLIOPipe* LLService::activate(
{
// empty out the chain, because failed service creation
// should just discard this stuff.
- llwarns << "LLService::activate - unable to build chain: " << name
- << llendl;
+ LL_WARNS() << "LLService::activate - unable to build chain: " << name
+ << LL_ENDL;
chain.clear();
}
}
else
{
- llwarns << "LLService::activate - unable find factory: " << name
- << llendl;
+ LL_WARNS() << "LLService::activate - unable find factory: " << name
+ << LL_ENDL;
}
return rv;
}
diff --git a/indra/llmessage/llservicebuilder.cpp b/indra/llmessage/llservicebuilder.cpp
index b9aef3d0ba..392e7f1091 100755
--- a/indra/llmessage/llservicebuilder.cpp
+++ b/indra/llmessage/llservicebuilder.cpp
@@ -50,11 +50,11 @@ void LLServiceBuilder::loadServiceDefinitionsFromFile(
std::string service_name = (*array_itr)["name"].asString();
createServiceDefinition(service_name, service_llsd);
}
- llinfos << "loaded config file: " << service_filename << llendl;
+ LL_INFOS() << "loaded config file: " << service_filename << LL_ENDL;
}
else
{
- llwarns << "unable to find config file: " << service_filename << llendl;
+ LL_WARNS() << "unable to find config file: " << service_filename << LL_ENDL;
}
}
@@ -119,7 +119,7 @@ std::string LLServiceBuilder::buildServiceURI(const std::string& service_name) c
}
else
{
- llwarns << "Cannot find service " << service_name << llendl;
+ LL_WARNS() << "Cannot find service " << service_name << LL_ENDL;
}
return service_url.str();
}
@@ -204,9 +204,9 @@ std::string russ_format(const std::string& format_str, const LLSD& context)
}
else
{
- llwarns << "Unknown key: " << key << " in option map: "
+ LL_WARNS() << "Unknown key: " << key << " in option map: "
<< LLSDOStreamer<LLSDNotationFormatter>(context)
- << llendl;
+ << LL_ENDL;
keep_looping = false;
}
break;
@@ -220,8 +220,8 @@ std::string russ_format(const std::string& format_str, const LLSD& context)
}
break;
default:
- llinfos << "Unknown directive: " << *(deepest_node + 1)
- << llendl;
+ LL_INFOS() << "Unknown directive: " << *(deepest_node + 1)
+ << LL_ENDL;
keep_looping = false;
break;
}
@@ -229,8 +229,8 @@ std::string russ_format(const std::string& format_str, const LLSD& context)
}
if (service_url.find('{') != std::string::npos)
{
- llwarns << "Constructed a likely bogus service URL: " << service_url
- << llendl;
+ LL_WARNS() << "Constructed a likely bogus service URL: " << service_url
+ << LL_ENDL;
}
return service_url;
}
diff --git a/indra/llmessage/lltemplatemessagebuilder.cpp b/indra/llmessage/lltemplatemessagebuilder.cpp
index 9e8eb48460..8d7c4c0282 100755
--- a/indra/llmessage/lltemplatemessagebuilder.cpp
+++ b/indra/llmessage/lltemplatemessagebuilder.cpp
@@ -81,7 +81,7 @@ void LLTemplateMessageBuilder::newMessage(const char *name)
if (msg_template->getDeprecation() != MD_NOTDEPRECATED)
{
- llwarns << "Sending deprecated message " << namep << llendl;
+ LL_WARNS() << "Sending deprecated message " << namep << LL_ENDL;
}
LLMessageTemplate::message_block_map_t::const_iterator iter;
@@ -96,7 +96,7 @@ void LLTemplateMessageBuilder::newMessage(const char *name)
}
else
{
- llerrs << "newMessage - Message " << name << " not registered" << llendl;
+ LL_ERRS() << "newMessage - Message " << name << " not registered" << LL_ENDL;
}
}
@@ -125,7 +125,7 @@ void LLTemplateMessageBuilder::nextBlock(const char* blockname)
if (!mCurrentSMessageTemplate)
{
- llerrs << "newMessage not called prior to setBlock" << llendl;
+ LL_ERRS() << "newMessage not called prior to setBlock" << LL_ENDL;
return;
}
@@ -133,8 +133,8 @@ void LLTemplateMessageBuilder::nextBlock(const char* blockname)
const LLMessageBlock* template_data = mCurrentSMessageTemplate->getBlock(bnamep);
if (!template_data)
{
- llerrs << "LLTemplateMessageBuilder::nextBlock " << bnamep
- << " not a block in " << mCurrentSMessageTemplate->mName << llendl;
+ LL_ERRS() << "LLTemplateMessageBuilder::nextBlock " << bnamep
+ << " not a block in " << mCurrentSMessageTemplate->mName << LL_ENDL;
return;
}
@@ -164,8 +164,8 @@ void LLTemplateMessageBuilder::nextBlock(const char* blockname)
// if the block is type MBT_SINGLE this is bad!
if (template_data->mType == MBT_SINGLE)
{
- llerrs << "LLTemplateMessageBuilder::nextBlock called multiple times"
- << " for " << bnamep << " but is type MBT_SINGLE" << llendl;
+ LL_ERRS() << "LLTemplateMessageBuilder::nextBlock called multiple times"
+ << " for " << bnamep << " but is type MBT_SINGLE" << LL_ENDL;
return;
}
@@ -175,10 +175,10 @@ void LLTemplateMessageBuilder::nextBlock(const char* blockname)
if ( (template_data->mType == MBT_MULTIPLE)
&&(mCurrentSDataBlock->mBlockNumber == template_data->mNumber))
{
- llerrs << "LLTemplateMessageBuilder::nextBlock called "
+ LL_ERRS() << "LLTemplateMessageBuilder::nextBlock called "
<< mCurrentSDataBlock->mBlockNumber << " times for " << bnamep
<< " exceeding " << template_data->mNumber
- << " specified in type MBT_MULTIPLE." << llendl;
+ << " specified in type MBT_MULTIPLE." << LL_ENDL;
return;
}
@@ -191,8 +191,8 @@ void LLTemplateMessageBuilder::nextBlock(const char* blockname)
if (block_data->mBlockNumber > MAX_BLOCKS)
{
- llerrs << "Trying to pack too many blocks into MBT_VARIABLE type "
- << "(limited to " << MAX_BLOCKS << ")" << llendl;
+ LL_ERRS() << "Trying to pack too many blocks into MBT_VARIABLE type "
+ << "(limited to " << MAX_BLOCKS << ")" << LL_ENDL;
}
// create new name
@@ -263,11 +263,11 @@ BOOL LLTemplateMessageBuilder::removeLastBlock()
if (num_blocks <= 1)
{
// we just blew away the last one, so return FALSE
- llwarns << "not blowing away the only block of message "
+ LL_WARNS() << "not blowing away the only block of message "
<< mCurrentSMessageName
<< ". Block: " << block_name
<< ". Number: " << num_blocks
- << llendl;
+ << LL_ENDL;
return FALSE;
}
else
@@ -290,14 +290,14 @@ void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EM
// do we have a current message?
if (!mCurrentSMessageTemplate)
{
- llerrs << "newMessage not called prior to addData" << llendl;
+ LL_ERRS() << "newMessage not called prior to addData" << LL_ENDL;
return;
}
// do we have a current block?
if (!mCurrentSDataBlock)
{
- llerrs << "setBlock not called prior to addData" << llendl;
+ LL_ERRS() << "setBlock not called prior to addData" << LL_ENDL;
return;
}
@@ -305,7 +305,7 @@ void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EM
const LLMessageVariable* var_data = mCurrentSMessageTemplate->getBlock(mCurrentSBlockName)->getVariable(vnamep);
if (!var_data || !var_data->getName())
{
- llerrs << vnamep << " not a variable in block " << mCurrentSBlockName << " of " << mCurrentSMessageTemplate->mName << llendl;
+ LL_ERRS() << vnamep << " not a variable in block " << mCurrentSBlockName << " of " << mCurrentSMessageTemplate->mName << LL_ENDL;
return;
}
@@ -316,9 +316,9 @@ void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EM
if ((var_data->getSize() == 1) &&
(size > 255))
{
- llwarns << "Field " << varname << " is a Variable 1 but program "
+ LL_WARNS() << "Field " << varname << " is a Variable 1 but program "
<< "attempted to stuff more than 255 bytes in "
- << "(" << size << "). Clamping size and truncating data." << llendl;
+ << "(" << size << "). Clamping size and truncating data." << LL_ENDL;
size = 255;
char *truncate = (char *)data;
truncate[254] = 0; // array size is 255 but the last element index is 254
@@ -332,8 +332,8 @@ void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EM
{
if (size != var_data->getSize())
{
- llerrs << varname << " is type MVT_FIXED but request size " << size << " doesn't match template size "
- << var_data->getSize() << llendl;
+ LL_ERRS() << varname << " is type MVT_FIXED but request size " << size << " doesn't match template size "
+ << var_data->getSize() << LL_ENDL;
return;
}
// alright, smash it in
@@ -350,14 +350,14 @@ void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EM
// do we have a current message?
if (!mCurrentSMessageTemplate)
{
- llerrs << "newMessage not called prior to addData" << llendl;
+ LL_ERRS() << "newMessage not called prior to addData" << LL_ENDL;
return;
}
// do we have a current block?
if (!mCurrentSDataBlock)
{
- llerrs << "setBlock not called prior to addData" << llendl;
+ LL_ERRS() << "setBlock not called prior to addData" << LL_ENDL;
return;
}
@@ -365,7 +365,7 @@ void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EM
const LLMessageVariable* var_data = mCurrentSMessageTemplate->getBlock(mCurrentSBlockName)->getVariable(vnamep);
if (!var_data->getName())
{
- llerrs << vnamep << " not a variable in block " << mCurrentSBlockName << " of " << mCurrentSMessageTemplate->mName << llendl;
+ LL_ERRS() << vnamep << " not a variable in block " << mCurrentSBlockName << " of " << mCurrentSMessageTemplate->mName << LL_ENDL;
return;
}
@@ -373,7 +373,7 @@ void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EM
if (var_data->getType() == MVT_VARIABLE)
{
// nope
- llerrs << vnamep << " is type MVT_VARIABLE. Call using addData(name, data, size)" << llendl;
+ LL_ERRS() << vnamep << " is type MVT_VARIABLE. Call using addData(name, data, size)" << LL_ENDL;
return;
}
else
@@ -643,8 +643,8 @@ static S32 buildBlock(U8* buffer, S32 buffer_size, const LLMessageBlock* templat
// Just reporting error is likely not enough. Need
// to check how to abort or error out gracefully
// from this function. XXXTBD
- llerrs << "buildBlock failed. Message excedding "
- << "sendBuffersize." << llendl;
+ LL_ERRS() << "buildBlock failed. Message excedding "
+ << "sendBuffersize." << LL_ENDL;
}
}
else if (template_data->mType == MBT_MULTIPLE)
@@ -652,10 +652,10 @@ static S32 buildBlock(U8* buffer, S32 buffer_size, const LLMessageBlock* templat
if (block_count != template_data->mNumber)
{
// nope! need to fill it in all the way!
- llerrs << "Block " << mbci->mName
+ LL_ERRS() << "Block " << mbci->mName
<< " is type MBT_MULTIPLE but only has data for "
<< block_count << " out of its "
- << template_data->mNumber << " blocks" << llendl;
+ << template_data->mNumber << " blocks" << LL_ENDL;
}
}
@@ -669,10 +669,10 @@ static S32 buildBlock(U8* buffer, S32 buffer_size, const LLMessageBlock* templat
if (mvci.getSize() == -1)
{
// oops, this variable wasn't ever set!
- llerrs << "The variable " << mvci.getName() << " in block "
+ LL_ERRS() << "The variable " << mvci.getName() << " in block "
<< mbci->mName << " of message "
<< template_data->mName
- << " wasn't set prior to buildMessage call" << llendl;
+ << " wasn't set prior to buildMessage call" << LL_ENDL;
}
else
{
@@ -699,7 +699,7 @@ static S32 buildBlock(U8* buffer, S32 buffer_size, const LLMessageBlock* templat
htonmemcpy(&buffer[result], &size, MVT_S32, 4);
break;
default:
- llerrs << "Attempting to build variable field with unknown size of " << size << llendl;
+ LL_ERRS() << "Attempting to build variable field with unknown size of " << size << LL_ENDL;
break;
}
result += mvci.getDataSize();
@@ -721,11 +721,11 @@ static S32 buildBlock(U8* buffer, S32 buffer_size, const LLMessageBlock* templat
// Just reporting error is likely not
// enough. Need to check how to abort or error
// out gracefully from this function. XXXTBD
- llerrs << "buildBlock failed. "
+ LL_ERRS() << "buildBlock failed. "
<< "Attempted to pack "
<< (result + mvci.getSize())
<< " bytes into a buffer with size "
- << buffer_size << "." << llendl;
+ << buffer_size << "." << LL_ENDL;
}
}
}
@@ -760,7 +760,7 @@ U32 LLTemplateMessageBuilder::buildMessage(
// do we have a current message?
if (!mCurrentSMessageTemplate)
{
- llerrs << "newMessage not called prior to buildMessage" << llendl;
+ LL_ERRS() << "newMessage not called prior to buildMessage" << LL_ENDL;
return 0;
}
@@ -809,7 +809,7 @@ U32 LLTemplateMessageBuilder::buildMessage(
}
else
{
- llerrs << "unexpected message frequency in buildMessage" << llendl;
+ LL_ERRS() << "unexpected message frequency in buildMessage" << LL_ENDL;
return 0;
}
diff --git a/indra/llmessage/lltemplatemessagereader.cpp b/indra/llmessage/lltemplatemessagereader.cpp
index 94bc7cb045..406afadd2f 100755
--- a/indra/llmessage/lltemplatemessagereader.cpp
+++ b/indra/llmessage/lltemplatemessagereader.cpp
@@ -68,13 +68,13 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname
// is there a message ready to go?
if (mReceiveSize == -1)
{
- llerrs << "No message waiting for decode 2!" << llendl;
+ LL_ERRS() << "No message waiting for decode 2!" << LL_ENDL;
return;
}
if (!mCurrentRMessageData)
{
- llerrs << "Invalid mCurrentMessageData in getData!" << llendl;
+ LL_ERRS() << "Invalid mCurrentMessageData in getData!" << LL_ENDL;
return;
}
@@ -85,8 +85,8 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname
if (iter == mCurrentRMessageData->mMemberBlocks.end())
{
- llerrs << "Block " << blockname << " #" << blocknum
- << " not in message " << mCurrentRMessageData->mName << llendl;
+ LL_ERRS() << "Block " << blockname << " #" << blocknum
+ << " not in message " << mCurrentRMessageData->mName << LL_ENDL;
return;
}
@@ -95,8 +95,8 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname
if (var_data_map.find(vnamep) == var_data_map.end())
{
- llerrs << "Variable "<< vnamep << " not in message "
- << mCurrentRMessageData->mName<< " block " << bnamep << llendl;
+ LL_ERRS() << "Variable "<< vnamep << " not in message "
+ << mCurrentRMessageData->mName<< " block " << bnamep << LL_ENDL;
return;
}
@@ -104,11 +104,11 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname
if (size && size != vardata.getSize())
{
- llerrs << "Msg " << mCurrentRMessageData->mName
+ LL_ERRS() << "Msg " << mCurrentRMessageData->mName
<< " variable " << vnamep
<< " is size " << vardata.getSize()
<< " but copying into buffer of size " << size
- << llendl;
+ << LL_ENDL;
return;
}
@@ -138,11 +138,11 @@ void LLTemplateMessageReader::getData(const char *blockname, const char *varname
}
else
{
- llwarns << "Msg " << mCurrentRMessageData->mName
+ LL_WARNS() << "Msg " << mCurrentRMessageData->mName
<< " variable " << vnamep
<< " is size " << vardata.getSize()
<< " but truncated to max size of " << max_size
- << llendl;
+ << LL_ENDL;
memcpy(datap, vardata.getData(), max_size);
}
@@ -153,13 +153,13 @@ S32 LLTemplateMessageReader::getNumberOfBlocks(const char *blockname)
// is there a message ready to go?
if (mReceiveSize == -1)
{
- llerrs << "No message waiting for decode 3!" << llendl;
+ LL_ERRS() << "No message waiting for decode 3!" << LL_ENDL;
return -1;
}
if (!mCurrentRMessageData)
{
- llerrs << "Invalid mCurrentRMessageData in getData!" << llendl;
+ LL_ERRS() << "Invalid mCurrentRMessageData in getData!" << LL_ENDL;
return -1;
}
@@ -180,13 +180,13 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, const char *varname)
// is there a message ready to go?
if (mReceiveSize == -1)
{ // This is a serious error - crash
- llerrs << "No message waiting for decode 4!" << llendl;
+ LL_ERRS() << "No message waiting for decode 4!" << LL_ENDL;
return LL_MESSAGE_ERROR;
}
if (!mCurrentRMessageData)
{ // This is a serious error - crash
- llerrs << "Invalid mCurrentRMessageData in getData!" << llendl;
+ LL_ERRS() << "Invalid mCurrentRMessageData in getData!" << LL_ENDL;
return LL_MESSAGE_ERROR;
}
@@ -196,8 +196,8 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, const char *varname)
if (iter == mCurrentRMessageData->mMemberBlocks.end())
{ // don't crash
- llinfos << "Block " << bnamep << " not in message "
- << mCurrentRMessageData->mName << llendl;
+ LL_INFOS() << "Block " << bnamep << " not in message "
+ << mCurrentRMessageData->mName << LL_ENDL;
return LL_BLOCK_NOT_IN_MESSAGE;
}
@@ -208,15 +208,15 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, const char *varname)
if (!vardata.getName())
{ // don't crash
- llinfos << "Variable " << varname << " not in message "
- << mCurrentRMessageData->mName << " block " << bnamep << llendl;
+ LL_INFOS() << "Variable " << varname << " not in message "
+ << mCurrentRMessageData->mName << " block " << bnamep << LL_ENDL;
return LL_VARIABLE_NOT_IN_BLOCK;
}
if (mCurrentRMessageTemplate->mMemberBlocks[bnamep]->mType != MBT_SINGLE)
{ // This is a serious error - crash
- llerrs << "Block " << bnamep << " isn't type MBT_SINGLE,"
- " use getSize with blocknum argument!" << llendl;
+ LL_ERRS() << "Block " << bnamep << " isn't type MBT_SINGLE,"
+ " use getSize with blocknum argument!" << LL_ENDL;
return LL_MESSAGE_ERROR;
}
@@ -228,13 +228,13 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, S32 blocknum, const
// is there a message ready to go?
if (mReceiveSize == -1)
{ // This is a serious error - crash
- llerrs << "No message waiting for decode 5!" << llendl;
+ LL_ERRS() << "No message waiting for decode 5!" << LL_ENDL;
return LL_MESSAGE_ERROR;
}
if (!mCurrentRMessageData)
{ // This is a serious error - crash
- llerrs << "Invalid mCurrentRMessageData in getData!" << llendl;
+ LL_ERRS() << "Invalid mCurrentRMessageData in getData!" << LL_ENDL;
return LL_MESSAGE_ERROR;
}
@@ -245,8 +245,8 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, S32 blocknum, const
if (iter == mCurrentRMessageData->mMemberBlocks.end())
{ // don't crash
- llinfos << "Block " << bnamep << " not in message "
- << mCurrentRMessageData->mName << llendl;
+ LL_INFOS() << "Block " << bnamep << " not in message "
+ << mCurrentRMessageData->mName << LL_ENDL;
return LL_BLOCK_NOT_IN_MESSAGE;
}
@@ -255,8 +255,8 @@ S32 LLTemplateMessageReader::getSize(const char *blockname, S32 blocknum, const
if (!vardata.getName())
{ // don't crash
- llinfos << "Variable " << vnamep << " not in message "
- << mCurrentRMessageData->mName << " block " << bnamep << llendl;
+ LL_INFOS() << "Variable " << vnamep << " not in message "
+ << mCurrentRMessageData->mName << " block " << bnamep << LL_ENDL;
return LL_VARIABLE_NOT_IN_BLOCK;
}
@@ -328,8 +328,8 @@ void LLTemplateMessageReader::getF32(const char *block, const char *var,
if( !llfinite( d ) )
{
- llwarns << "non-finite in getF32Fast " << block << " " << var
- << llendl;
+ LL_WARNS() << "non-finite in getF32Fast " << block << " " << var
+ << LL_ENDL;
d = 0;
}
}
@@ -341,8 +341,8 @@ void LLTemplateMessageReader::getF64(const char *block, const char *var,
if( !llfinite( d ) )
{
- llwarns << "non-finite in getF64Fast " << block << " " << var
- << llendl;
+ LL_WARNS() << "non-finite in getF64Fast " << block << " " << var
+ << LL_ENDL;
d = 0;
}
}
@@ -354,8 +354,8 @@ void LLTemplateMessageReader::getVector3(const char *block, const char *var,
if( !v.isFinite() )
{
- llwarns << "non-finite in getVector3Fast " << block << " "
- << var << llendl;
+ LL_WARNS() << "non-finite in getVector3Fast " << block << " "
+ << var << LL_ENDL;
v.zeroVec();
}
}
@@ -367,8 +367,8 @@ void LLTemplateMessageReader::getVector4(const char *block, const char *var,
if( !v.isFinite() )
{
- llwarns << "non-finite in getVector4Fast " << block << " "
- << var << llendl;
+ LL_WARNS() << "non-finite in getVector4Fast " << block << " "
+ << var << LL_ENDL;
v.zeroVec();
}
}
@@ -380,8 +380,8 @@ void LLTemplateMessageReader::getVector3d(const char *block, const char *var,
if( !v.isFinite() )
{
- llwarns << "non-finite in getVector3dFast " << block << " "
- << var << llendl;
+ LL_WARNS() << "non-finite in getVector3dFast " << block << " "
+ << var << LL_ENDL;
v.zeroVec();
}
@@ -398,8 +398,8 @@ void LLTemplateMessageReader::getQuat(const char *block, const char *var,
}
else
{
- llwarns << "non-finite in getQuatFast " << block << " " << var
- << llendl;
+ LL_WARNS() << "non-finite in getQuatFast " << block << " " << var
+ << LL_ENDL;
q.loadIdentity();
}
}
@@ -452,7 +452,7 @@ BOOL LLTemplateMessageReader::decodeTemplate(
// is there a message ready to go?
if (buffer_size <= 0)
{
- llwarns << "No message waiting for decode!" << llendl;
+ LL_WARNS() << "No message waiting for decode!" << LL_ENDL;
return(FALSE);
}
@@ -487,8 +487,8 @@ BOOL LLTemplateMessageReader::decodeTemplate(
}
else // bogus packet received (too short)
{
- llwarns << "Packet with unusable length received (too short): "
- << buffer_size << llendl;
+ LL_WARNS() << "Packet with unusable length received (too short): "
+ << buffer_size << LL_ENDL;
return(FALSE);
}
@@ -499,8 +499,8 @@ BOOL LLTemplateMessageReader::decodeTemplate(
}
else
{
- llwarns << "Message #" << std::hex << num << std::dec
- << " received but not registered!" << llendl;
+ LL_WARNS() << "Message #" << std::hex << num << std::dec
+ << " received but not registered!" << LL_ENDL;
gMessageSystem->callExceptionFunc(MX_UNREGISTERED_MESSAGE);
return(FALSE);
}
@@ -511,23 +511,23 @@ BOOL LLTemplateMessageReader::decodeTemplate(
void LLTemplateMessageReader::logRanOffEndOfPacket( const LLHost& host, const S32 where, const S32 wanted )
{
// we've run off the end of the packet!
- llwarns << "Ran off end of packet " << mCurrentRMessageTemplate->mName
+ LL_WARNS() << "Ran off end of packet " << mCurrentRMessageTemplate->mName
// << " with id " << mCurrentRecvPacketID
<< " from " << host
<< " trying to read " << wanted
<< " bytes at position " << where
<< " going past packet end at " << mReceiveSize
- << llendl;
+ << LL_ENDL;
if(gMessageSystem->mVerboseLog)
{
- llinfos << "MSG: -> " << host << "\tREAD PAST END:\t"
+ LL_INFOS() << "MSG: -> " << host << "\tREAD PAST END:\t"
// << mCurrentRecvPacketID << " "
- << getMessageName() << llendl;
+ << getMessageName() << LL_ENDL;
}
gMessageSystem->callExceptionFunc(MX_RAN_OFF_END_OF_PACKET);
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_MESSAGES("Process Messages");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_MESSAGES("Process Messages");
// decode a given message
BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender )
@@ -588,7 +588,7 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender
}
else
{
- llerrs << "Unknown block type" << llendl;
+ LL_ERRS() << "Unknown block type" << LL_ENDL;
return FALSE;
}
@@ -655,7 +655,7 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender
htonmemcpy(&tsize, &buffer[decode_pos], MVT_U32, 4);
break;
default:
- llerrs << "Attempting to read variable field with unknown size of " << data_size << llendl;
+ LL_ERRS() << "Attempting to read variable field with unknown size of " << data_size << LL_ENDL;
break;
}
}
@@ -694,7 +694,7 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender
if (mCurrentRMessageData->mMemberBlocks.empty()
&& !mCurrentRMessageTemplate->mMemberBlocks.empty())
{
- lldebugs << "Empty message '" << mCurrentRMessageTemplate->mName << "' (no blocks)" << llendl;
+ LL_DEBUGS() << "Empty message '" << mCurrentRMessageTemplate->mName << "' (no blocks)" << LL_ENDL;
return FALSE;
}
@@ -707,10 +707,10 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender
}
{
- LLFastTimer t(FTM_PROCESS_MESSAGES);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_MESSAGES);
if( !mCurrentRMessageTemplate->callHandlerFunc(gMessageSystem) )
{
- llwarns << "Message from " << sender << " with no handler function received: " << mCurrentRMessageTemplate->mName << llendl;
+ LL_WARNS() << "Message from " << sender << " with no handler function received: " << mCurrentRMessageTemplate->mName << LL_ENDL;
}
}
@@ -740,9 +740,9 @@ BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender
if(decode_time > LLMessageReader::getTimeDecodesSpamThreshold())
{
- lldebugs << "--------- Message " << mCurrentRMessageTemplate->mName << " decode took " << decode_time << " seconds. (" <<
+ LL_DEBUGS() << "--------- Message " << mCurrentRMessageTemplate->mName << " decode took " << decode_time << " seconds. (" <<
mCurrentRMessageTemplate->mMaxDecodeTimePerMsg << " max, " <<
- (mCurrentRMessageTemplate->mTotalDecodeTime / mCurrentRMessageTemplate->mTotalDecoded) << " avg)" << llendl;
+ (mCurrentRMessageTemplate->mTotalDecodeTime / mCurrentRMessageTemplate->mTotalDecoded) << " avg)" << LL_ENDL;
}
}
}
@@ -760,9 +760,9 @@ BOOL LLTemplateMessageReader::validateMessage(const U8* buffer,
if(valid)
{
mCurrentRMessageTemplate->mReceiveCount++;
- //lldebugs << "MessageRecvd:"
+ //LL_DEBUGS() << "MessageRecvd:"
// << mCurrentRMessageTemplate->mName
- // << " from " << sender << llendl;
+ // << " from " << sender << LL_ENDL;
}
if (valid && isBanned(trusted))
@@ -772,15 +772,15 @@ BOOL LLTemplateMessageReader::validateMessage(const U8* buffer,
<< getMessageName()
<< " from "
<< ((trusted) ? "trusted " : "untrusted ")
- << sender << llendl;
+ << sender << LL_ENDL;
valid = FALSE;
}
if(valid && isUdpBanned())
{
- llwarns << "Received UDP black listed message "
+ LL_WARNS() << "Received UDP black listed message "
<< getMessageName()
- << " from " << sender << llendl;
+ << " from " << sender << LL_ENDL;
valid = FALSE;
}
return valid;
diff --git a/indra/llmessage/llthrottle.cpp b/indra/llmessage/llthrottle.cpp
index 64ebd51fec..e484bd258d 100755
--- a/indra/llmessage/llthrottle.cpp
+++ b/indra/llmessage/llthrottle.cpp
@@ -53,8 +53,8 @@ F32 LLThrottle::getAvailable()
{
// use a temporary bits_available
// since we don't want to change mBitsAvailable every time
- F32 elapsed_time = (F32)(LLMessageSystem::getMessageTimeSeconds() - mLastSendTime);
- return mAvailable + (mRate * elapsed_time);
+ F32Seconds elapsed_time = LLMessageSystem::getMessageTimeSeconds() - mLastSendTime;
+ return mAvailable + (mRate * elapsed_time.value());
}
BOOL LLThrottle::checkOverflow(const F32 amount)
@@ -65,8 +65,8 @@ BOOL LLThrottle::checkOverflow(const F32 amount)
// use a temporary bits_available
// since we don't want to change mBitsAvailable every time
- F32 elapsed_time = (F32)(LLMessageSystem::getMessageTimeSeconds() - mLastSendTime);
- F32 amount_available = mAvailable + (mRate * elapsed_time);
+ F32Seconds elapsed_time = LLMessageSystem::getMessageTimeSeconds() - mLastSendTime;
+ F32 amount_available = mAvailable + (mRate * elapsed_time.value());
if ((amount_available >= lookahead_amount) || (amount_available > amount))
{
@@ -80,17 +80,17 @@ BOOL LLThrottle::checkOverflow(const F32 amount)
BOOL LLThrottle::throttleOverflow(const F32 amount)
{
- F32 elapsed_time;
+ F32Seconds elapsed_time;
F32 lookahead_amount;
BOOL retval = TRUE;
lookahead_amount = mRate * mLookaheadSecs;
- F64 mt_sec = LLMessageSystem::getMessageTimeSeconds();
- elapsed_time = (F32)(mt_sec - mLastSendTime);
+ F64Seconds mt_sec = LLMessageSystem::getMessageTimeSeconds();
+ elapsed_time = mt_sec - mLastSendTime;
mLastSendTime = mt_sec;
- mAvailable += mRate * elapsed_time;
+ mAvailable += mRate * elapsed_time.value();
if (mAvailable >= lookahead_amount)
{
@@ -222,7 +222,7 @@ void LLThrottleGroup::unpackThrottle(LLDataPacker &dp)
// into NOT resetting the system.
void LLThrottleGroup::resetDynamicAdjust()
{
- F64 mt_sec = LLMessageSystem::getMessageTimeSeconds();
+ F64Seconds mt_sec = LLMessageSystem::getMessageTimeSeconds();
S32 i;
for (i = 0; i < TC_EOF; i++)
{
@@ -269,8 +269,8 @@ S32 LLThrottleGroup::getAvailable(S32 throttle_cat)
// use a temporary bits_available
// since we don't want to change mBitsAvailable every time
- F32 elapsed_time = (F32)(LLMessageSystem::getMessageTimeSeconds() - mLastSendTime[throttle_cat]);
- F32 bits_available = mBitsAvailable[throttle_cat] + (category_bps * elapsed_time);
+ F32Seconds elapsed_time = LLMessageSystem::getMessageTimeSeconds() - mLastSendTime[throttle_cat];
+ F32 bits_available = mBitsAvailable[throttle_cat] + (category_bps * elapsed_time.value());
if (bits_available >= lookahead_bits)
{
@@ -294,8 +294,8 @@ BOOL LLThrottleGroup::checkOverflow(S32 throttle_cat, F32 bits)
// use a temporary bits_available
// since we don't want to change mBitsAvailable every time
- F32 elapsed_time = (F32)(LLMessageSystem::getMessageTimeSeconds() - mLastSendTime[throttle_cat]);
- F32 bits_available = mBitsAvailable[throttle_cat] + (category_bps * elapsed_time);
+ F32Seconds elapsed_time = LLMessageSystem::getMessageTimeSeconds() - mLastSendTime[throttle_cat];
+ F32 bits_available = mBitsAvailable[throttle_cat] + (category_bps * elapsed_time.value());
if (bits_available >= lookahead_bits)
{
@@ -315,7 +315,7 @@ BOOL LLThrottleGroup::checkOverflow(S32 throttle_cat, F32 bits)
BOOL LLThrottleGroup::throttleOverflow(S32 throttle_cat, F32 bits)
{
- F32 elapsed_time;
+ F32Seconds elapsed_time;
F32 category_bps;
F32 lookahead_bits;
BOOL retval = TRUE;
@@ -323,10 +323,10 @@ BOOL LLThrottleGroup::throttleOverflow(S32 throttle_cat, F32 bits)
category_bps = mCurrentBPS[throttle_cat];
lookahead_bits = category_bps * THROTTLE_LOOKAHEAD_TIME;
- F64 mt_sec = LLMessageSystem::getMessageTimeSeconds();
- elapsed_time = (F32)(mt_sec - mLastSendTime[throttle_cat]);
+ F64Seconds mt_sec = LLMessageSystem::getMessageTimeSeconds();
+ elapsed_time = mt_sec - mLastSendTime[throttle_cat];
mLastSendTime[throttle_cat] = mt_sec;
- mBitsAvailable[throttle_cat] += category_bps * elapsed_time;
+ mBitsAvailable[throttle_cat] += category_bps * elapsed_time.value();
if (mBitsAvailable[throttle_cat] >= lookahead_bits)
{
@@ -356,7 +356,7 @@ BOOL LLThrottleGroup::throttleOverflow(S32 throttle_cat, F32 bits)
BOOL LLThrottleGroup::dynamicAdjust()
{
- const F32 DYNAMIC_ADJUST_TIME = 1.0f; // seconds
+ const F32Seconds DYNAMIC_ADJUST_TIME(1.0f);
const F32 CURRENT_PERIOD_WEIGHT = .25f; // how much weight to give to last period while determining BPS utilization
const F32 BUSY_PERCENT = 0.75f; // if use more than this fraction of BPS, you are busy
const F32 IDLE_PERCENT = 0.70f; // if use less than this fraction, you are "idle"
@@ -365,7 +365,7 @@ BOOL LLThrottleGroup::dynamicAdjust()
S32 i;
- F64 mt_sec = LLMessageSystem::getMessageTimeSeconds();
+ F64Seconds mt_sec = LLMessageSystem::getMessageTimeSeconds();
// Only dynamically adjust every few seconds
if ((mt_sec - mDynamicAdjustTime) < DYNAMIC_ADJUST_TIME)
@@ -405,7 +405,7 @@ BOOL LLThrottleGroup::dynamicAdjust()
for (i = 0; i < TC_EOF; i++)
{
// Is this a busy channel?
- if (mBitsSentHistory[i] >= BUSY_PERCENT * DYNAMIC_ADJUST_TIME * mCurrentBPS[i])
+ if (mBitsSentHistory[i] >= BUSY_PERCENT * DYNAMIC_ADJUST_TIME.value() * mCurrentBPS[i])
{
// this channel is busy
channels_busy = TRUE;
@@ -418,7 +418,7 @@ BOOL LLThrottleGroup::dynamicAdjust()
}
// Is this an idle channel?
- if ((mBitsSentHistory[i] < IDLE_PERCENT * DYNAMIC_ADJUST_TIME * mCurrentBPS[i]) &&
+ if ((mBitsSentHistory[i] < IDLE_PERCENT * DYNAMIC_ADJUST_TIME.value() * mCurrentBPS[i]) &&
(mBitsAvailable[i] > 0))
{
channel_idle[i] = TRUE;
@@ -440,8 +440,8 @@ BOOL LLThrottleGroup::dynamicAdjust()
//if (total)
//{
- // llinfos << i << ": B" << channel_busy[i] << " I" << channel_idle[i] << " N" << channel_over_nominal[i];
- // llcont << " Nom: " << mNominalBPS[i] << " Cur: " << mCurrentBPS[i] << " BS: " << mBitsSentHistory[i] << llendl;
+ // LL_INFOS() << i << ": B" << channel_busy[i] << " I" << channel_idle[i] << " N" << channel_over_nominal[i];
+ // LL_CONT << " Nom: " << mNominalBPS[i] << " Cur: " << mCurrentBPS[i] << " BS: " << mBitsSentHistory[i] << LL_ENDL;
//}
}
@@ -462,7 +462,7 @@ BOOL LLThrottleGroup::dynamicAdjust()
// Therefore it's a candidate to give up some bandwidth.
// Figure out how much bandwidth it has been using, and how
// much is available to steal.
- used_bps = mBitsSentHistory[i] / DYNAMIC_ADJUST_TIME;
+ used_bps = mBitsSentHistory[i] / DYNAMIC_ADJUST_TIME.value();
// CRO make sure to keep a minimum amount of throttle available
// CRO NB: channels set to < MINIMUM_BPS will never give up bps,
@@ -482,7 +482,7 @@ BOOL LLThrottleGroup::dynamicAdjust()
avail_bps = mCurrentBPS[i] - used_bps;
}
- //llinfos << i << " avail " << avail_bps << llendl;
+ //LL_INFOS() << i << " avail " << avail_bps << LL_ENDL;
// Historically, a channel could have used more than its current share,
// even if it's idle right now.
@@ -499,7 +499,7 @@ BOOL LLThrottleGroup::dynamicAdjust()
}
}
- //llinfos << "Pool BPS: " << pool_bps << llendl;
+ //LL_INFOS() << "Pool BPS: " << pool_bps << LL_ENDL;
// Now redistribute the bandwidth to busy channels.
F32 unused_bps = 0.f;
@@ -508,7 +508,7 @@ BOOL LLThrottleGroup::dynamicAdjust()
if (channel_busy[i])
{
F32 add_amount = pool_bps * (mNominalBPS[i] / busy_nominal_sum);
- //llinfos << "Busy " << i << " gets " << pool_bps << llendl;
+ //LL_INFOS() << "Busy " << i << " gets " << pool_bps << LL_ENDL;
mCurrentBPS[i] += add_amount;
// CRO: make sure this doesn't get too huge
diff --git a/indra/llmessage/llthrottle.h b/indra/llmessage/llthrottle.h
index ed0aeb4602..e43e54f61b 100755
--- a/indra/llmessage/llthrottle.h
+++ b/indra/llmessage/llthrottle.h
@@ -50,7 +50,7 @@ private:
F32 mLookaheadSecs; // Seconds to look ahead, maximum
F32 mRate; // BPS available, dynamically adjusted
F32 mAvailable; // Bits available to send right now on each channel
- F64 mLastSendTime; // Time since last send on this channel
+ F64Seconds mLastSendTime; // Time since last send on this channel
};
typedef enum e_throttle_categories
@@ -93,8 +93,8 @@ protected:
F32 mBitsSentThisPeriod[TC_EOF]; // Sent in this dynamic allocation period
F32 mBitsSentHistory[TC_EOF]; // Sent before this dynamic allocation period, adjusted to one period length
- F64 mLastSendTime[TC_EOF]; // Time since last send on this channel
- F64 mDynamicAdjustTime; // Only dynamic adjust every 2 seconds or so.
+ F64Seconds mLastSendTime[TC_EOF]; // Time since last send on this channel
+ F64Seconds mDynamicAdjustTime; // Only dynamic adjust every 2 seconds or so.
};
diff --git a/indra/llmessage/lltransfermanager.cpp b/indra/llmessage/lltransfermanager.cpp
index 38b743fb75..ec7b21d8b6 100755
--- a/indra/llmessage/lltransfermanager.cpp
+++ b/indra/llmessage/lltransfermanager.cpp
@@ -64,7 +64,7 @@ LLTransferManager::~LLTransferManager()
{
if (mValid)
{
- llwarns << "LLTransferManager::~LLTransferManager - Should have been cleaned up by message system shutdown process" << llendl;
+ LL_WARNS() << "LLTransferManager::~LLTransferManager - Should have been cleaned up by message system shutdown process" << LL_ENDL;
cleanup();
}
}
@@ -74,7 +74,7 @@ void LLTransferManager::init()
{
if (mValid)
{
- llerrs << "Double initializing LLTransferManager!" << llendl;
+ LL_ERRS() << "Double initializing LLTransferManager!" << LL_ENDL;
}
mValid = TRUE;
@@ -122,7 +122,7 @@ void LLTransferManager::cleanupConnection(const LLHost &host)
{
// This can happen legitimately if we've never done a transfer, and we're
// cleaning up a circuit.
- //llwarns << "Cleaning up nonexistent transfer connection to " << host << llendl;
+ //LL_WARNS() << "Cleaning up nonexistent transfer connection to " << host << LL_ENDL;
return;
}
LLTransferConnection *connp = iter->second;
@@ -203,7 +203,7 @@ LLTransferSource *LLTransferManager::findTransferSource(const LLUUID &transfer_i
//static
void LLTransferManager::processTransferRequest(LLMessageSystem *msgp, void **)
{
- //llinfos << "LLTransferManager::processTransferRequest" << llendl;
+ //LL_INFOS() << "LLTransferManager::processTransferRequest" << LL_ENDL;
LLUUID transfer_id;
LLTransferSourceType source_type;
@@ -219,33 +219,33 @@ void LLTransferManager::processTransferRequest(LLMessageSystem *msgp, void **)
if (!tscp)
{
- llwarns << "Source channel not found" << llendl;
+ LL_WARNS() << "Source channel not found" << LL_ENDL;
return;
}
if (tscp->findTransferSource(transfer_id))
{
- llwarns << "Duplicate request for transfer " << transfer_id << ", aborting!" << llendl;
+ LL_WARNS() << "Duplicate request for transfer " << transfer_id << ", aborting!" << LL_ENDL;
return;
}
S32 size = msgp->getSize("TransferInfo", "Params");
if(size > MAX_PARAMS_SIZE)
{
- llwarns << "LLTransferManager::processTransferRequest params too big."
- << llendl;
+ LL_WARNS() << "LLTransferManager::processTransferRequest params too big."
+ << LL_ENDL;
return;
}
- //llinfos << transfer_id << ":" << source_type << ":" << channel_type << ":" << priority << llendl;
+ //LL_INFOS() << transfer_id << ":" << source_type << ":" << channel_type << ":" << priority << LL_ENDL;
LLTransferSource* tsp = LLTransferSource::createSource(
source_type,
transfer_id,
priority);
if(!tsp)
{
- llwarns << "LLTransferManager::processTransferRequest couldn't create"
- << " transfer source!" << llendl;
+ LL_WARNS() << "LLTransferManager::processTransferRequest couldn't create"
+ << " transfer source!" << LL_ENDL;
return;
}
U8 tmp[MAX_PARAMS_SIZE];
@@ -258,8 +258,8 @@ void LLTransferManager::processTransferRequest(LLMessageSystem *msgp, void **)
// This should only happen if the data is corrupt or
// incorrectly packed.
// *NOTE: We may want to call abortTransfer().
- llwarns << "LLTransferManager::processTransferRequest: bad parameters."
- << llendl;
+ LL_WARNS() << "LLTransferManager::processTransferRequest: bad parameters."
+ << LL_ENDL;
delete tsp;
return;
}
@@ -272,7 +272,7 @@ void LLTransferManager::processTransferRequest(LLMessageSystem *msgp, void **)
//static
void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **)
{
- //llinfos << "LLTransferManager::processTransferInfo" << llendl;
+ //LL_INFOS() << "LLTransferManager::processTransferInfo" << LL_ENDL;
LLUUID transfer_id;
LLTransferTargetType target_type;
@@ -286,11 +286,11 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **)
msgp->getS32("TransferInfo", "Status", (S32 &)status);
msgp->getS32("TransferInfo", "Size", size);
- //llinfos << transfer_id << ":" << target_type<< ":" << channel_type << llendl;
+ //LL_INFOS() << transfer_id << ":" << target_type<< ":" << channel_type << LL_ENDL;
LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(msgp->getSender(), channel_type);
if (!ttcp)
{
- llwarns << "Target channel not found" << llendl;
+ LL_WARNS() << "Target channel not found" << LL_ENDL;
// Should send a message to abort the transfer.
return;
}
@@ -298,7 +298,7 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **)
LLTransferTarget *ttp = ttcp->findTransferTarget(transfer_id);
if (!ttp)
{
- llwarns << "TransferInfo for unknown transfer! Not able to handle this yet!" << llendl;
+ LL_WARNS() << "TransferInfo for unknown transfer! Not able to handle this yet!" << LL_ENDL;
// This could happen if we're doing a push transfer, although to avoid confusion,
// maybe it should be a different message.
return;
@@ -306,7 +306,7 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **)
if (status != LLTS_OK)
{
- llwarns << transfer_id << ": Non-ok status, cleaning up" << llendl;
+ LL_WARNS() << transfer_id << ": Non-ok status, cleaning up" << LL_ENDL;
ttp->completionCallback(status);
// Clean up the transfer.
ttcp->deleteTransfer(ttp);
@@ -317,8 +317,8 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **)
S32 params_size = msgp->getSize("TransferInfo", "Params");
if(params_size > MAX_PARAMS_SIZE)
{
- llwarns << "LLTransferManager::processTransferInfo params too big."
- << llendl;
+ LL_WARNS() << "LLTransferManager::processTransferInfo params too big."
+ << LL_ENDL;
return;
}
else if(params_size > 0)
@@ -330,15 +330,15 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **)
{
// This should only happen if the data is corrupt or
// incorrectly packed.
- llwarns << "LLTransferManager::processTransferRequest: bad params."
- << llendl;
+ LL_WARNS() << "LLTransferManager::processTransferRequest: bad params."
+ << LL_ENDL;
ttp->abortTransfer();
ttcp->deleteTransfer(ttp);
return;
}
}
- //llinfos << "Receiving " << transfer_id << ", size " << size << " bytes" << llendl;
+ //LL_INFOS() << "Receiving " << transfer_id << ", size " << size << " bytes" << LL_ENDL;
ttp->setSize(size);
ttp->setGotInfo(TRUE);
@@ -358,7 +358,7 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **)
{
// Perhaps this stuff should be inside a method in LLTransferPacket?
// I'm too lazy to do it now, though.
-// llinfos << "Playing back delayed packet " << packet_id << llendl;
+// LL_INFOS() << "Playing back delayed packet " << packet_id << LL_ENDL;
LLTransferPacket *packetp = ttp->mDelayedPacketMap[packet_id];
// This is somewhat inefficient, but avoids us having to duplicate
@@ -392,11 +392,11 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **)
{
if (status != LLTS_DONE)
{
- llwarns << "LLTransferManager::processTransferInfo Error in playback!" << llendl;
+ LL_WARNS() << "LLTransferManager::processTransferInfo Error in playback!" << LL_ENDL;
}
else
{
- llinfos << "LLTransferManager::processTransferInfo replay FINISHED for " << transfer_id << llendl;
+ LL_INFOS() << "LLTransferManager::processTransferInfo replay FINISHED for " << transfer_id << LL_ENDL;
}
// This transfer is done, either via error or not.
ttp->completionCallback(status);
@@ -410,7 +410,7 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **)
//static
void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **)
{
- //llinfos << "LLTransferManager::processTransferPacket" << llendl;
+ //LL_INFOS() << "LLTransferManager::processTransferPacket" << LL_ENDL;
LLUUID transfer_id;
LLTransferChannelType channel_type;
@@ -423,20 +423,20 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **)
msgp->getS32("TransferData", "Status", (S32 &)status);
// Find the transfer associated with this packet.
- //llinfos << transfer_id << ":" << channel_type << llendl;
+ //LL_INFOS() << transfer_id << ":" << channel_type << LL_ENDL;
LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(msgp->getSender(), channel_type);
if (!ttcp)
{
- llwarns << "Target channel not found" << llendl;
+ LL_WARNS() << "Target channel not found" << LL_ENDL;
return;
}
LLTransferTarget *ttp = ttcp->findTransferTarget(transfer_id);
if (!ttp)
{
- llwarns << "Didn't find matching transfer for " << transfer_id
+ LL_WARNS() << "Didn't find matching transfer for " << transfer_id
<< " processing packet " << packet_id
- << " from " << msgp->getSender() << llendl;
+ << " from " << msgp->getSender() << LL_ENDL;
return;
}
@@ -455,7 +455,7 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **)
if ((size < 0) || (size > MAX_PACKET_DATA_SIZE))
{
- llwarns << "Invalid transfer packet size " << size << llendl;
+ LL_WARNS() << "Invalid transfer packet size " << size << LL_ENDL;
return;
}
@@ -472,8 +472,8 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **)
if(!ttp->addDelayedPacket(packet_id, status, tmp_data, size))
{
// Whoops - failed to add a delayed packet for some reason.
- llwarns << "Too many delayed packets processing transfer "
- << transfer_id << " from " << msgp->getSender() << llendl;
+ LL_WARNS() << "Too many delayed packets processing transfer "
+ << transfer_id << " from " << msgp->getSender() << LL_ENDL;
ttp->abortTransfer();
ttcp->deleteTransfer(ttp);
return;
@@ -483,15 +483,15 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **)
const S32 LL_TRANSFER_WARN_GAP = 10;
if(!ttp->gotInfo())
{
- llwarns << "Got data packet before information in transfer "
+ LL_WARNS() << "Got data packet before information in transfer "
<< transfer_id << " from " << msgp->getSender()
- << ", got " << packet_id << llendl;
+ << ", got " << packet_id << LL_ENDL;
}
else if((packet_id - ttp->getNextPacketID()) > LL_TRANSFER_WARN_GAP)
{
- llwarns << "Out of order packet in transfer " << transfer_id
+ LL_WARNS() << "Out of order packet in transfer " << transfer_id
<< " from " << msgp->getSender() << ", got " << packet_id
- << " expecting " << ttp->getNextPacketID() << llendl;
+ << " expecting " << ttp->getNextPacketID() << LL_ENDL;
}
#endif
return;
@@ -516,11 +516,11 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **)
{
if (status != LLTS_DONE)
{
- llwarns << "LLTransferManager::processTransferPacket Error in transfer!" << llendl;
+ LL_WARNS() << "LLTransferManager::processTransferPacket Error in transfer!" << LL_ENDL;
}
else
{
-// llinfos << "LLTransferManager::processTransferPacket done for " << transfer_id << llendl;
+// LL_INFOS() << "LLTransferManager::processTransferPacket done for " << transfer_id << LL_ENDL;
}
// This transfer is done, either via error or not.
ttp->completionCallback(status);
@@ -534,7 +534,7 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **)
{
// Perhaps this stuff should be inside a method in LLTransferPacket?
// I'm too lazy to do it now, though.
-// llinfos << "Playing back delayed packet " << packet_id << llendl;
+// LL_INFOS() << "Playing back delayed packet " << packet_id << LL_ENDL;
LLTransferPacket *packetp = ttp->mDelayedPacketMap[packet_id];
// This is somewhat inefficient, but avoids us having to duplicate
@@ -564,7 +564,7 @@ void LLTransferManager::processTransferPacket(LLMessageSystem *msgp, void **)
//static
void LLTransferManager::processTransferAbort(LLMessageSystem *msgp, void **)
{
- //llinfos << "LLTransferManager::processTransferPacket" << llendl;
+ //LL_INFOS() << "LLTransferManager::processTransferPacket" << LL_ENDL;
LLUUID transfer_id;
LLTransferChannelType channel_type;
@@ -598,7 +598,7 @@ void LLTransferManager::processTransferAbort(LLMessageSystem *msgp, void **)
}
}
- llwarns << "Couldn't find transfer " << transfer_id << " to abort!" << llendl;
+ LL_WARNS() << "Couldn't find transfer " << transfer_id << " to abort!" << LL_ENDL;
}
@@ -612,14 +612,14 @@ void LLTransferManager::reliablePacketCallback(void **user_data, S32 result)
LLTransferSource *tsp = gTransferManager.findTransferSource(*transfer_idp);
if (tsp)
{
- llwarns << "Aborting reliable transfer " << *transfer_idp << " due to failed reliable resends!" << llendl;
+ LL_WARNS() << "Aborting reliable transfer " << *transfer_idp << " due to failed reliable resends!" << LL_ENDL;
LLTransferSourceChannel *tscp = tsp->mChannelp;
tsp->abortTransfer();
tscp->deleteTransfer(tsp);
}
else
{
- llwarns << "Aborting reliable transfer " << *transfer_idp << " but can't find the LLTransferSource object" << llendl;
+ LL_WARNS() << "Aborting reliable transfer " << *transfer_idp << " but can't find the LLTransferSource object" << LL_ENDL;
}
}
delete transfer_idp;
@@ -763,7 +763,7 @@ void LLTransferSourceChannel::updateTransfers()
// We DON'T want to send any packets if they're blocked, they'll just end up
// piling up on the other end.
- //llwarns << "Blocking transfers due to blocked circuit for " << getHost() << llendl;
+ //LL_WARNS() << "Blocking transfers due to blocked circuit for " << getHost() << LL_ENDL;
return;
}
@@ -781,7 +781,7 @@ void LLTransferSourceChannel::updateTransfers()
BOOL done = FALSE;
for (iter = mTransferSources.mMap.begin(); (iter != mTransferSources.mMap.end()) && !done;)
{
- //llinfos << "LLTransferSourceChannel::updateTransfers()" << llendl;
+ //LL_INFOS() << "LLTransferSourceChannel::updateTransfers()" << LL_ENDL;
// Do stuff.
next = iter;
next++;
@@ -820,7 +820,7 @@ void LLTransferSourceChannel::updateTransfers()
gMessageSystem->addS32("Status", status);
gMessageSystem->addBinaryData("Data", datap, data_size);
sent_bytes = gMessageSystem->getCurrentSendTotal();
- gMessageSystem->sendReliable(getHost(), LL_DEFAULT_RELIABLE_RETRIES, TRUE, 0.f,
+ gMessageSystem->sendReliable(getHost(), LL_DEFAULT_RELIABLE_RETRIES, TRUE, F32Seconds(0.f),
LLTransferManager::reliablePacketCallback, (void**)cb_uuid);
// Do bookkeeping for the throttle
@@ -853,11 +853,11 @@ void LLTransferSourceChannel::updateTransfers()
// We're OK, don't need to do anything. Keep sending data.
break;
case LLTS_ERROR:
- llwarns << "Error in transfer dataCallback!" << llendl;
+ LL_WARNS() << "Error in transfer dataCallback!" << LL_ENDL;
// fall through
case LLTS_DONE:
// We need to clean up this transfer source.
- //llinfos << "LLTransferSourceChannel::updateTransfers() " << tsp->getID() << " done" << llendl;
+ //LL_INFOS() << "LLTransferSourceChannel::updateTransfers() " << tsp->getID() << " done" << LL_ENDL;
tsp->completionCallback(status);
delete tsp;
@@ -865,7 +865,7 @@ void LLTransferSourceChannel::updateTransfers()
iter = next;
break;
default:
- llerrs << "Unknown transfer error code!" << llendl;
+ LL_ERRS() << "Unknown transfer error code!" << LL_ENDL;
}
// At this point, we should do priority adjustment (since some transfers like
@@ -912,10 +912,10 @@ void LLTransferSourceChannel::deleteTransfer(LLTransferSource *tsp)
}
}
- llwarns << "Unable to find transfer source id "
+ LL_WARNS() << "Unable to find transfer source id "
<< tsp->getID()
<< " to delete!"
- << llendl;
+ << LL_ENDL;
}
}
@@ -956,7 +956,7 @@ void LLTransferTargetChannel::requestTransfer(
source_params.getType());
if (!ttp)
{
- llwarns << "LLTransferManager::requestTransfer aborting due to target creation failure!" << llendl;
+ LL_WARNS() << "LLTransferManager::requestTransfer aborting due to target creation failure!" << LL_ENDL;
return;
}
@@ -1032,10 +1032,10 @@ void LLTransferTargetChannel::deleteTransfer(LLTransferTarget *ttp)
}
}
- llwarns << "Unable to find transfer target id "
+ LL_WARNS() << "Unable to find transfer target id "
<< ttp->getID()
<< " to delete!"
- << llendl;
+ << LL_ENDL;
}
}
@@ -1097,7 +1097,7 @@ void LLTransferSource::sendTransferStatus(LLTSCode status)
void LLTransferSource::abortTransfer()
{
// Send a message down, call the completion callback
- llinfos << "LLTransferSource::Aborting transfer " << getID() << " to " << mChannelp->getHost() << llendl;
+ LL_INFOS() << "LLTransferSource::Aborting transfer " << getID() << " to " << mChannelp->getHost() << LL_ENDL;
gMessageSystem->newMessage("TransferAbort");
gMessageSystem->nextBlock("TransferInfo");
gMessageSystem->addUUID("TransferID", getID());
@@ -1115,7 +1115,7 @@ void LLTransferSource::registerSourceType(const LLTransferSourceType stype, LLTr
{
// Disallow changing what class handles a source type
// Unclear when you would want to do this, and whether it would work.
- llerrs << "Reregistering source type " << stype << llendl;
+ LL_ERRS() << "Reregistering source type " << stype << LL_ENDL;
}
else
{
@@ -1143,7 +1143,7 @@ LLTransferSource *LLTransferSource::createSource(const LLTransferSourceType styp
if (!sSourceCreateMap.count(stype))
{
// Use the callback to create the source type if it's not there.
- llwarns << "Unknown transfer source type: " << stype << llendl;
+ LL_WARNS() << "Unknown transfer source type: " << stype << LL_ENDL;
return NULL;
}
return (sSourceCreateMap[stype])(id, priority);
@@ -1230,7 +1230,7 @@ LLTransferTarget::~LLTransferTarget()
void LLTransferTarget::abortTransfer()
{
// Send a message up, call the completion callback
- llinfos << "LLTransferTarget::Aborting transfer " << getID() << " from " << mChannelp->getHost() << llendl;
+ LL_INFOS() << "LLTransferTarget::Aborting transfer " << getID() << " from " << mChannelp->getHost() << LL_ENDL;
gMessageSystem->newMessage("TransferAbort");
gMessageSystem->nextBlock("TransferInfo");
gMessageSystem->addUUID("TransferID", getID());
@@ -1260,9 +1260,13 @@ bool LLTransferTarget::addDelayedPacket(
size);
#ifdef _DEBUG
- if (mDelayedPacketMap.find(packet_id) != mDelayedPacketMap.end())
+ transfer_packet_map::iterator iter = mDelayedPacketMap.find(packet_id);
+ if (iter != mDelayedPacketMap.end())
{
- llerrs << "Packet ALREADY in delayed packet map!" << llendl;
+ if (!(iter->second->mSize == size) && !(iter->second->mDatap == datap))
+ {
+ LL_ERRS() << "Packet ALREADY in delayed packet map!" << LL_ENDL;
+ }
}
#endif
@@ -1283,7 +1287,7 @@ LLTransferTarget* LLTransferTarget::createTarget(
case LLTTT_VFILE:
return new LLTransferTargetVFile(id, source_type);
default:
- llwarns << "Unknown transfer target type: " << type << llendl;
+ LL_WARNS() << "Unknown transfer target type: " << type << LL_ENDL;
return NULL;
}
}
@@ -1318,7 +1322,7 @@ void LLTransferSourceParamsInvItem::setAsset(const LLUUID &asset_id, const LLAss
void LLTransferSourceParamsInvItem::packParams(LLDataPacker &dp) const
{
- lldebugs << "LLTransferSourceParamsInvItem::packParams()" << llendl;
+ LL_DEBUGS() << "LLTransferSourceParamsInvItem::packParams()" << LL_ENDL;
dp.packUUID(mAgentID, "AgentID");
dp.packUUID(mSessionID, "SessionID");
dp.packUUID(mOwnerID, "OwnerID");
diff --git a/indra/llmessage/lltransfersourceasset.cpp b/indra/llmessage/lltransfersourceasset.cpp
index 8537773a3f..80ed3340c6 100755
--- a/indra/llmessage/lltransfersourceasset.cpp
+++ b/indra/llmessage/lltransfersourceasset.cpp
@@ -66,18 +66,18 @@ void LLTransferSourceAsset::initTransfer()
}
else
{
- llwarns << "Attempted to request blocked asset "
+ LL_WARNS() << "Attempted to request blocked asset "
<< mParams.getAssetID() << ":"
<< LLAssetType::lookupHumanReadable(mParams.getAssetType())
- << llendl;
+ << LL_ENDL;
sendTransferStatus(LLTS_ERROR);
}
}
else
{
- llwarns << "Attempted to request asset " << mParams.getAssetID()
+ LL_WARNS() << "Attempted to request asset " << mParams.getAssetID()
<< ":" << LLAssetType::lookupHumanReadable(mParams.getAssetType())
- << " without an asset system!" << llendl;
+ << " without an asset system!" << LL_ENDL;
sendTransferStatus(LLTS_ERROR);
}
}
@@ -93,7 +93,7 @@ LLTSCode LLTransferSourceAsset::dataCallback(const S32 packet_id,
S32 &returned_bytes,
BOOL &delete_returned)
{
- //llinfos << "LLTransferSourceAsset::dataCallback" << llendl;
+ //LL_INFOS() << "LLTransferSourceAsset::dataCallback" << LL_ENDL;
if (!mGotResponse)
{
return LLTS_SKIP;
@@ -109,14 +109,14 @@ LLTSCode LLTransferSourceAsset::dataCallback(const S32 packet_id,
if (packet_id != mLastPacketID + 1)
{
- llerrs << "Can't handle out of order file transfer yet!" << llendl;
+ LL_ERRS() << "Can't handle out of order file transfer yet!" << LL_ENDL;
}
// grab a buffer from the right place in the file
if (!vf.seek(mCurPos, 0))
{
- llwarns << "LLTransferSourceAsset Can't seek to " << mCurPos << " length " << vf.getSize() << llendl;
- llwarns << "While sending " << mParams.getAssetID() << llendl;
+ LL_WARNS() << "LLTransferSourceAsset Can't seek to " << mCurPos << " length " << vf.getSize() << LL_ENDL;
+ LL_WARNS() << "While sending " << mParams.getAssetID() << LL_ENDL;
return LLTS_ERROR;
}
@@ -160,13 +160,13 @@ void LLTransferSourceAsset::completionCallback(const LLTSCode status)
void LLTransferSourceAsset::packParams(LLDataPacker& dp) const
{
- //llinfos << "LLTransferSourceAsset::packParams" << llendl;
+ //LL_INFOS() << "LLTransferSourceAsset::packParams" << LL_ENDL;
mParams.packParams(dp);
}
BOOL LLTransferSourceAsset::unpackParams(LLDataPacker &dp)
{
- //llinfos << "LLTransferSourceAsset::unpackParams" << llendl;
+ //LL_INFOS() << "LLTransferSourceAsset::unpackParams" << LL_ENDL;
return mParams.unpackParams(dp);
}
@@ -183,13 +183,13 @@ void LLTransferSourceAsset::responderCallback(LLVFS *vfs, const LLUUID& uuid, LL
if (!tsap)
{
- llinfos << "Aborting transfer " << transfer_id << " callback, transfer source went away" << llendl;
+ LL_INFOS() << "Aborting transfer " << transfer_id << " callback, transfer source went away" << LL_ENDL;
return;
}
if (result)
{
- llinfos << "AssetStorage: Error " << gAssetStorage->getErrorString(result) << " downloading uuid " << uuid << llendl;
+ LL_INFOS() << "AssetStorage: Error " << gAssetStorage->getErrorString(result) << " downloading uuid " << uuid << LL_ENDL;
}
LLTSCode status;
diff --git a/indra/llmessage/lltransfersourcefile.cpp b/indra/llmessage/lltransfersourcefile.cpp
index 43c9448fba..1f284a158d 100755
--- a/indra/llmessage/lltransfersourcefile.cpp
+++ b/indra/llmessage/lltransfersourcefile.cpp
@@ -43,7 +43,7 @@ LLTransferSourceFile::~LLTransferSourceFile()
{
if (mFP)
{
- llerrs << "Destructor called without the completion callback being called!" << llendl;
+ LL_ERRS() << "Destructor called without the completion callback being called!" << LL_ENDL;
}
}
@@ -56,7 +56,7 @@ void LLTransferSourceFile::initTransfer()
|| (filename == "..")
|| (filename.find(delimiter[0]) != std::string::npos))
{
- llwarns << "Attempting to transfer file " << filename << " with path delimiter, aborting!" << llendl;
+ LL_WARNS() << "Attempting to transfer file " << filename << " with path delimiter, aborting!" << LL_ENDL;
sendTransferStatus(LLTS_ERROR);
return;
@@ -88,17 +88,17 @@ LLTSCode LLTransferSourceFile::dataCallback(const S32 packet_id,
S32 &returned_bytes,
BOOL &delete_returned)
{
- //llinfos << "LLTransferSourceFile::dataCallback" << llendl;
+ //LL_INFOS() << "LLTransferSourceFile::dataCallback" << LL_ENDL;
if (!mFP)
{
- llerrs << "Data callback without file set!" << llendl;
+ LL_ERRS() << "Data callback without file set!" << LL_ENDL;
return LLTS_ERROR;
}
if (packet_id != mLastPacketID + 1)
{
- llerrs << "Can't handle out of order file transfer yet!" << llendl;
+ LL_ERRS() << "Can't handle out of order file transfer yet!" << LL_ENDL;
}
// Grab up until the max number of bytes from the file.
@@ -137,13 +137,13 @@ void LLTransferSourceFile::completionCallback(const LLTSCode status)
void LLTransferSourceFile::packParams(LLDataPacker& dp) const
{
- //llinfos << "LLTransferSourceFile::packParams" << llendl;
+ //LL_INFOS() << "LLTransferSourceFile::packParams" << LL_ENDL;
mParams.packParams(dp);
}
BOOL LLTransferSourceFile::unpackParams(LLDataPacker &dp)
{
- //llinfos << "LLTransferSourceFile::unpackParams" << llendl;
+ //LL_INFOS() << "LLTransferSourceFile::unpackParams" << LL_ENDL;
return mParams.unpackParams(dp);
}
@@ -169,6 +169,6 @@ BOOL LLTransferSourceParamsFile::unpackParams(LLDataPacker &dp)
dp.unpackU8(delete_flag, "Delete");
mDeleteOnCompletion = delete_flag;
- llinfos << "Unpacked filename: " << mFilename << llendl;
+ LL_INFOS() << "Unpacked filename: " << mFilename << LL_ENDL;
return TRUE;
}
diff --git a/indra/llmessage/lltransfertargetfile.cpp b/indra/llmessage/lltransfertargetfile.cpp
index 560fc8b6e4..ca0318a2d6 100755
--- a/indra/llmessage/lltransfertargetfile.cpp
+++ b/indra/llmessage/lltransfertargetfile.cpp
@@ -44,7 +44,7 @@ LLTransferTargetFile::~LLTransferTargetFile()
{
if (mFP)
{
- llerrs << "LLTransferTargetFile::~LLTransferTargetFile - Should have been cleaned up in completion callback" << llendl;
+ LL_ERRS() << "LLTransferTargetFile::~LLTransferTargetFile - Should have been cleaned up in completion callback" << LL_ENDL;
fclose(mFP);
mFP = NULL;
}
@@ -61,7 +61,7 @@ void LLTransferTargetFile::applyParams(const LLTransferTargetParams &params)
{
if (params.getType() != mType)
{
- llwarns << "Target parameter type doesn't match!" << llendl;
+ LL_WARNS() << "Target parameter type doesn't match!" << LL_ENDL;
return;
}
@@ -70,8 +70,8 @@ void LLTransferTargetFile::applyParams(const LLTransferTargetParams &params)
LLTSCode LLTransferTargetFile::dataCallback(const S32 packet_id, U8 *in_datap, const S32 in_size)
{
- //llinfos << "LLTransferTargetFile::dataCallback" << llendl;
- //llinfos << "Packet: " << packet_id << llendl;
+ //LL_INFOS() << "LLTransferTargetFile::dataCallback" << LL_ENDL;
+ //LL_INFOS() << "Packet: " << packet_id << LL_ENDL;
if (!mFP)
{
@@ -79,7 +79,7 @@ LLTSCode LLTransferTargetFile::dataCallback(const S32 packet_id, U8 *in_datap, c
if (!mFP)
{
- llwarns << "Failure opening " << mParams.mFilename << " for write by LLTransferTargetFile" << llendl;
+ LL_WARNS() << "Failure opening " << mParams.mFilename << " for write by LLTransferTargetFile" << LL_ENDL;
return LLTS_ERROR;
}
}
@@ -91,7 +91,7 @@ LLTSCode LLTransferTargetFile::dataCallback(const S32 packet_id, U8 *in_datap, c
S32 count = (S32)fwrite(in_datap, 1, in_size, mFP);
if (count != in_size)
{
- llwarns << "Failure in LLTransferTargetFile::dataCallback!" << llendl;
+ LL_WARNS() << "Failure in LLTransferTargetFile::dataCallback!" << LL_ENDL;
return LLTS_ERROR;
}
return LLTS_OK;
@@ -99,7 +99,7 @@ LLTSCode LLTransferTargetFile::dataCallback(const S32 packet_id, U8 *in_datap, c
void LLTransferTargetFile::completionCallback(const LLTSCode status)
{
- llinfos << "LLTransferTargetFile::completionCallback" << llendl;
+ LL_INFOS() << "LLTransferTargetFile::completionCallback" << LL_ENDL;
if (mFP)
{
fclose(mFP);
@@ -113,7 +113,7 @@ void LLTransferTargetFile::completionCallback(const LLTSCode status)
case LLTS_ABORT:
case LLTS_ERROR:
// We're aborting this transfer, we don't want to keep this file.
- llwarns << "Aborting file transfer for " << mParams.mFilename << llendl;
+ LL_WARNS() << "Aborting file transfer for " << mParams.mFilename << LL_ENDL;
if (mFP)
{
// Only need to remove file if we successfully opened it.
diff --git a/indra/llmessage/lltransfertargetvfile.cpp b/indra/llmessage/lltransfertargetvfile.cpp
index c78d9288b6..3c234b9726 100755
--- a/indra/llmessage/lltransfertargetvfile.cpp
+++ b/indra/llmessage/lltransfertargetvfile.cpp
@@ -115,7 +115,7 @@ void LLTransferTargetVFile::applyParams(const LLTransferTargetParams &params)
{
if (params.getType() != mType)
{
- llwarns << "Target parameter type doesn't match!" << llendl;
+ LL_WARNS() << "Target parameter type doesn't match!" << LL_ENDL;
return;
}
@@ -125,8 +125,8 @@ void LLTransferTargetVFile::applyParams(const LLTransferTargetParams &params)
LLTSCode LLTransferTargetVFile::dataCallback(const S32 packet_id, U8 *in_datap, const S32 in_size)
{
- //llinfos << "LLTransferTargetFile::dataCallback" << llendl;
- //llinfos << "Packet: " << packet_id << llendl;
+ //LL_INFOS() << "LLTransferTargetFile::dataCallback" << LL_ENDL;
+ //LL_INFOS() << "Packet: " << packet_id << LL_ENDL;
LLVFile vf(gAssetStorage->mVFS, mTempID, mParams.getAssetType(), LLVFile::APPEND);
if (mNeedsCreate)
@@ -142,7 +142,7 @@ LLTSCode LLTransferTargetVFile::dataCallback(const S32 packet_id, U8 *in_datap,
if (!vf.write(in_datap, in_size))
{
- llwarns << "Failure in LLTransferTargetVFile::dataCallback!" << llendl;
+ LL_WARNS() << "Failure in LLTransferTargetVFile::dataCallback!" << LL_ENDL;
return LLTS_ERROR;
}
return LLTS_OK;
@@ -151,11 +151,11 @@ LLTSCode LLTransferTargetVFile::dataCallback(const S32 packet_id, U8 *in_datap,
void LLTransferTargetVFile::completionCallback(const LLTSCode status)
{
- //llinfos << "LLTransferTargetVFile::completionCallback" << llendl;
+ //LL_INFOS() << "LLTransferTargetVFile::completionCallback" << LL_ENDL;
if (!gAssetStorage)
{
- llwarns << "Aborting vfile transfer after asset storage shut down!" << llendl;
+ LL_WARNS() << "Aborting vfile transfer after asset storage shut down!" << LL_ENDL;
return;
}
@@ -169,14 +169,14 @@ void LLTransferTargetVFile::completionCallback(const LLTSCode status)
LLVFile file(gAssetStorage->mVFS, mTempID, mParams.getAssetType(), LLVFile::WRITE);
if (!file.rename(mParams.getAssetID(), mParams.getAssetType()))
{
- llerrs << "LLTransferTargetVFile: rename failed" << llendl;
+ LL_ERRS() << "LLTransferTargetVFile: rename failed" << LL_ENDL;
}
}
err_code = LL_ERR_NOERR;
- lldebugs << "LLTransferTargetVFile::completionCallback for "
+ LL_DEBUGS() << "LLTransferTargetVFile::completionCallback for "
<< mParams.getAssetID() << ","
<< LLAssetType::lookup(mParams.getAssetType())
- << " with temp id " << mTempID << llendl;
+ << " with temp id " << mTempID << LL_ENDL;
break;
case LLTS_ERROR:
case LLTS_ABORT:
@@ -184,7 +184,7 @@ void LLTransferTargetVFile::completionCallback(const LLTSCode status)
default:
{
// We're aborting this transfer, we don't want to keep this file.
- llwarns << "Aborting vfile transfer for " << mParams.getAssetID() << llendl;
+ LL_WARNS() << "Aborting vfile transfer for " << mParams.getAssetID() << LL_ENDL;
LLVFile vf(gAssetStorage->mVFS, mTempID, mParams.getAssetType(), LLVFile::APPEND);
vf.remove();
}
diff --git a/indra/llmessage/lltrustedmessageservice.cpp b/indra/llmessage/lltrustedmessageservice.cpp
index fea7fc72c4..5bd1112cfe 100755
--- a/indra/llmessage/lltrustedmessageservice.cpp
+++ b/indra/llmessage/lltrustedmessageservice.cpp
@@ -42,9 +42,9 @@ void LLTrustedMessageService::post(LLHTTPNode::ResponsePtr response,
const LLSD& context,
const LLSD& input) const
{
- std::string name = context["request"]["wildcard"]["message-name"];
- std::string senderIP = context["request"]["remote-host"];
- std::string senderPort = context["request"]["headers"]
+ std::string name = context[CONTEXT_REQUEST][CONTEXT_WILDCARD]["message-name"];
+ std::string senderIP = context[CONTEXT_REQUEST][CONTEXT_REMOTE_HOST];
+ std::string senderPort = context[CONTEXT_REQUEST][CONTEXT_HEADERS]
["x-secondlife-udp-listen-port"];
LLSD message_data;
@@ -63,21 +63,21 @@ void LLTrustedMessageService::post(LLHTTPNode::ResponsePtr response,
{
LL_WARNS("Messaging") << "trusted message POST to /trusted-message/"
<< name << " from unknown or untrusted sender "
- << sender << llendl;
- response->status(403, "Unknown or untrusted sender");
+ << sender << LL_ENDL;
+ response->status(HTTP_FORBIDDEN, "Unknown or untrusted sender");
}
else
{
gMessageSystem->receivedMessageFromTrustedSender();
if (input.has("binary-template-data"))
{
- llinfos << "Dispatching template: " << input << llendl;
+ LL_INFOS() << "Dispatching template: " << input << LL_ENDL;
// try and send this message using udp dispatch
LLMessageSystem::dispatchTemplate(name, message_data, response);
}
else
{
- llinfos << "Dispatching without template: " << input << llendl;
+ LL_INFOS() << "Dispatching without template: " << input << LL_ENDL;
LLMessageSystem::dispatch(name, message_data, response);
}
}
diff --git a/indra/llmessage/lltrustedmessageservice.h b/indra/llmessage/lltrustedmessageservice.h
index 688937ac2c..12a37bb535 100755
--- a/indra/llmessage/lltrustedmessageservice.h
+++ b/indra/llmessage/lltrustedmessageservice.h
@@ -30,6 +30,10 @@
#include "linden_common.h"
#include "llhttpnode.h"
+// These are defined in lliosocket.h/lliosocket.cpp
+extern const std::string CONTEXT_REMOTE_HOST;
+extern const std::string CONTEXT_REMOTE_PORT;
+
class LLSD;
class LLTrustedMessageService
diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp
index 683065357d..1294379eca 100755
--- a/indra/llmessage/llurlrequest.cpp
+++ b/indra/llmessage/llurlrequest.cpp
@@ -33,6 +33,7 @@
#include <openssl/x509_vfy.h>
#include <openssl/ssl.h>
#include "llcurl.h"
+#include "llfasttimer.h"
#include "llioutil.h"
#include "llproxy.h"
#include "llpumpio.h"
@@ -40,7 +41,6 @@
#include "llstring.h"
#include "apr_env.h"
#include "llapr.h"
-static const U32 HTTP_STATUS_PIPE_ERROR = 499;
/**
* String constants
@@ -48,11 +48,12 @@ static const U32 HTTP_STATUS_PIPE_ERROR = 499;
const std::string CONTEXT_DEST_URI_SD_LABEL("dest_uri");
const std::string CONTEXT_TRANSFERED_BYTES("transfered_bytes");
+// These are defined in llhttpnode.h/llhttpnode.cpp
+extern const std::string CONTEXT_REQUEST;
+extern const std::string CONTEXT_RESPONSE;
static size_t headerCallback(void* data, size_t size, size_t nmemb, void* user);
-
-
/**
* class LLURLRequestDetail
*/
@@ -130,27 +131,8 @@ CURLcode LLURLRequest::_sslCtxCallback(CURL * curl, void *sslctx, void *param)
* class LLURLRequest
*/
-// static
-std::string LLURLRequest::actionAsVerb(LLURLRequest::ERequestAction action)
-{
- static const std::string VERBS[] =
- {
- "(invalid)",
- "HEAD",
- "GET",
- "PUT",
- "POST",
- "DELETE",
- "MOVE"
- };
- if(((S32)action <=0) || ((S32)action >= REQUEST_ACTION_COUNT))
- {
- return VERBS[0];
- }
- return VERBS[action];
-}
-LLURLRequest::LLURLRequest(LLURLRequest::ERequestAction action, bool follow_redirects /* = true */) :
+LLURLRequest::LLURLRequest(EHTTPMethod action, bool follow_redirects /* = true */) :
mAction(action),
mFollowRedirects(follow_redirects)
{
@@ -158,7 +140,7 @@ LLURLRequest::LLURLRequest(LLURLRequest::ERequestAction action, bool follow_redi
}
LLURLRequest::LLURLRequest(
- LLURLRequest::ERequestAction action,
+ EHTTPMethod action,
const std::string& url,
bool follow_redirects /* = true */) :
mAction(action),
@@ -179,16 +161,21 @@ void LLURLRequest::setURL(const std::string& url)
mDetail->mURL = url;
if (url.empty())
{
- llwarns << "empty URL specified" << llendl;
+ LL_WARNS() << "empty URL specified" << LL_ENDL;
}
}
-std::string LLURLRequest::getURL() const
+const std::string& LLURLRequest::getURL() const
{
return mDetail->mURL;
}
-void LLURLRequest::addHeader(const char* header)
+void LLURLRequest::addHeader(const std::string& header, const std::string& value /* = "" */)
+{
+ mDetail->mCurlRequest->slist_append(header, value);
+}
+
+void LLURLRequest::addHeaderRaw(const char* header)
{
mDetail->mCurlRequest->slist_append(header);
}
@@ -232,7 +219,7 @@ void LLURLRequest::useProxy(bool use_proxy)
}
- lldebugs << "use_proxy = " << (use_proxy?'Y':'N') << ", env_proxy = " << (env_proxy ? env_proxy : "(null)") << llendl;
+ LL_DEBUGS() << "use_proxy = " << (use_proxy?'Y':'N') << ", env_proxy = " << (env_proxy ? env_proxy : "(null)") << LL_ENDL;
if (env_proxy && use_proxy)
{
@@ -275,7 +262,7 @@ LLIOPipe::EStatus LLURLRequest::handleError(
LLURLRequestComplete* complete = NULL;
complete = (LLURLRequestComplete*)mCompletionCallback.get();
complete->httpStatus(
- HTTP_STATUS_PIPE_ERROR,
+ HTTP_INTERNAL_ERROR,
LLIOPipe::lookupStatusString(status));
complete->responseStatus(status);
pump->respond(complete);
@@ -284,9 +271,11 @@ LLIOPipe::EStatus LLURLRequest::handleError(
return status;
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_URL_REQUEST("URL Request");
-static LLFastTimer::DeclareTimer FTM_PROCESS_URL_REQUEST_GET_RESULT("Get Result");
-static LLFastTimer::DeclareTimer FTM_URL_PERFORM("Perform");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_URL_REQUEST("URL Request");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_URL_REQUEST_GET_RESULT("Get Result");
+static LLTrace::BlockTimerStatHandle FTM_URL_PERFORM("Perform");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_URL_PUMP_RESPOND("Pump Respond");
+static LLTrace::BlockTimerStatHandle FTM_URL_ADJUST_TIMEOUT("Adjust Timeout");
// virtual
LLIOPipe::EStatus LLURLRequest::process_impl(
@@ -296,9 +285,9 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_PROCESS_URL_REQUEST);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_URL_REQUEST);
PUMP_DEBUG;
- //llinfos << "LLURLRequest::process_impl()" << llendl;
+ //LL_INFOS() << "LLURLRequest::process_impl()" << LL_ENDL;
if (!buffer) return STATUS_ERROR;
// we're still waiting or prcessing, check how many
@@ -306,8 +295,7 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
const S32 MIN_ACCUMULATION = 100000;
if(pump && (mDetail->mByteAccumulator > MIN_ACCUMULATION))
{
- static LLFastTimer::DeclareTimer FTM_URL_ADJUST_TIMEOUT("Adjust Timeout");
- LLFastTimer t(FTM_URL_ADJUST_TIMEOUT);
+ LL_RECORD_BLOCK_TIME(FTM_URL_ADJUST_TIMEOUT);
// This is a pretty sloppy calculation, but this
// tries to make the gross assumption that if data
// is coming in at 56kb/s, then this transfer will
@@ -317,11 +305,11 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
const F32 TIMEOUT_ADJUSTMENT = 2.0f;
mDetail->mByteAccumulator = 0;
pump->adjustTimeoutSeconds(TIMEOUT_ADJUSTMENT);
- lldebugs << "LLURLRequest adjustTimeoutSeconds for request: " << mDetail->mURL << llendl;
- if (mState == STATE_INITIALIZED)
- {
- llinfos << "LLURLRequest adjustTimeoutSeconds called during upload" << llendl;
- }
+ LL_DEBUGS() << "LLURLRequest adjustTimeoutSeconds for request: " << mDetail->mURL << LL_ENDL;
+ if (mState == STATE_INITIALIZED)
+ {
+ LL_INFOS() << "LLURLRequest adjustTimeoutSeconds called during upload" << LL_ENDL;
+ }
}
switch(mState)
@@ -356,7 +344,7 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
PUMP_DEBUG;
LLIOPipe::EStatus status = STATUS_BREAK;
{
- LLFastTimer t(FTM_URL_PERFORM);
+ LL_RECORD_BLOCK_TIME(FTM_URL_PERFORM);
if(!mDetail->mCurlRequest->wait())
{
return status ;
@@ -370,7 +358,7 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
bool newmsg = false;
{
- LLFastTimer t(FTM_PROCESS_URL_REQUEST_GET_RESULT);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_URL_REQUEST_GET_RESULT);
newmsg = mDetail->mCurlRequest->getResult(&result);
}
@@ -384,7 +372,7 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
mState = STATE_HAVE_RESPONSE;
context[CONTEXT_REQUEST][CONTEXT_TRANSFERED_BYTES] = mRequestTransferedBytes;
context[CONTEXT_RESPONSE][CONTEXT_TRANSFERED_BYTES] = mResponseTransferedBytes;
- lldebugs << this << "Setting context to " << context << llendl;
+ LL_DEBUGS() << this << "Setting context to " << context << LL_ENDL;
switch(result)
{
case CURLE_OK:
@@ -405,9 +393,8 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
link.mChannels = LLBufferArray::makeChannelConsumer(
channels);
chain.push_back(link);
- static LLFastTimer::DeclareTimer FTM_PROCESS_URL_PUMP_RESPOND("Pump Respond");
{
- LLFastTimer t(FTM_PROCESS_URL_PUMP_RESPOND);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_URL_PUMP_RESPOND);
pump->respond(chain, buffer, context);
}
mCompletionCallback = NULL;
@@ -419,12 +406,12 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
keep_looping = false;
break;
default: // CURLE_URL_MALFORMAT
- llwarns << "URLRequest Error: " << result
+ LL_WARNS() << "URLRequest Error: " << result
<< ", "
<< LLCurl::strerror(result)
<< ", "
<< (mDetail->mURL.empty() ? "<EMPTY URL>" : mDetail->mURL)
- << llendl;
+ << LL_ENDL;
status = STATUS_ERROR;
keep_looping = false;
break;
@@ -439,14 +426,14 @@ LLIOPipe::EStatus LLURLRequest::process_impl(
eos = true;
context[CONTEXT_REQUEST][CONTEXT_TRANSFERED_BYTES] = mRequestTransferedBytes;
context[CONTEXT_RESPONSE][CONTEXT_TRANSFERED_BYTES] = mResponseTransferedBytes;
- lldebugs << this << "Setting context to " << context << llendl;
+ LL_DEBUGS() << this << "Setting context to " << context << LL_ENDL;
return STATUS_DONE;
default:
PUMP_DEBUG;
context[CONTEXT_REQUEST][CONTEXT_TRANSFERED_BYTES] = mRequestTransferedBytes;
context[CONTEXT_RESPONSE][CONTEXT_TRANSFERED_BYTES] = mResponseTransferedBytes;
- lldebugs << this << "Setting context to " << context << llendl;
+ LL_DEBUGS() << this << "Setting context to " << context << LL_ENDL;
return STATUS_ERROR;
}
}
@@ -468,10 +455,10 @@ void LLURLRequest::initialize()
mResponseTransferedBytes = 0;
}
-static LLFastTimer::DeclareTimer FTM_URL_REQUEST_CONFIGURE("URL Configure");
+static LLTrace::BlockTimerStatHandle FTM_URL_REQUEST_CONFIGURE("URL Configure");
bool LLURLRequest::configure()
{
- LLFastTimer t(FTM_URL_REQUEST_CONFIGURE);
+ LL_RECORD_BLOCK_TIME(FTM_URL_REQUEST_CONFIGURE);
bool rv = false;
S32 bytes = mDetail->mResponseBuffer->countAfter(
@@ -503,21 +490,32 @@ bool LLURLRequest::configure()
case HTTP_PUT:
// Disable the expect http 1.1 extension. POST and PUT default
// to turning this on, and I am not too sure what it means.
- addHeader("Expect:");
+ addHeader(HTTP_OUT_HEADER_EXPECT);
mDetail->mCurlRequest->setopt(CURLOPT_UPLOAD, 1);
mDetail->mCurlRequest->setopt(CURLOPT_INFILESIZE, bytes);
rv = true;
break;
+ case HTTP_PATCH:
+ // Disable the expect http 1.1 extension. POST and PUT default
+ // to turning this on, and I am not too sure what it means.
+ addHeader(HTTP_OUT_HEADER_EXPECT);
+
+ mDetail->mCurlRequest->setopt(CURLOPT_UPLOAD, 1);
+ mDetail->mCurlRequest->setopt(CURLOPT_INFILESIZE, bytes);
+ mDetail->mCurlRequest->setoptString(CURLOPT_CUSTOMREQUEST, "PATCH");
+ rv = true;
+ break;
+
case HTTP_POST:
// Disable the expect http 1.1 extension. POST and PUT default
// to turning this on, and I am not too sure what it means.
- addHeader("Expect:");
+ addHeader(HTTP_OUT_HEADER_EXPECT);
// Disable the content type http header.
// *FIX: what should it be?
- addHeader("Content-Type:");
+ addHeader(HTTP_OUT_HEADER_CONTENT_TYPE);
// Set the handle for an http post
mDetail->mCurlRequest->setPost(NULL, bytes);
@@ -528,20 +526,26 @@ bool LLURLRequest::configure()
break;
case HTTP_DELETE:
- // Set the handle for an http post
+ // Set the handle for an http delete
mDetail->mCurlRequest->setoptString(CURLOPT_CUSTOMREQUEST, "DELETE");
rv = true;
break;
+ case HTTP_COPY:
+ // Set the handle for an http copy
+ mDetail->mCurlRequest->setoptString(CURLOPT_CUSTOMREQUEST, "COPY");
+ rv = true;
+ break;
+
case HTTP_MOVE:
- // Set the handle for an http post
+ // Set the handle for an http move
mDetail->mCurlRequest->setoptString(CURLOPT_CUSTOMREQUEST, "MOVE");
// *NOTE: should we check for the Destination header?
rv = true;
break;
default:
- llwarns << "Unhandled URLRequest action: " << mAction << llendl;
+ LL_WARNS() << "Unhandled URLRequest action: " << mAction << LL_ENDL;
break;
}
if(rv)
@@ -647,7 +651,7 @@ static size_t headerCallback(void* data, size_t size, size_t nmemb, void* user)
S32 status_code = atoi(status.c_str());
if (status_code > 0)
{
- complete->httpStatus((U32)status_code, reason);
+ complete->httpStatus(status_code, reason);
return header_len;
}
}
@@ -669,14 +673,14 @@ static size_t headerCallback(void* data, size_t size, size_t nmemb, void* user)
LLStringUtil::trim(header);
if (!header.empty())
{
- llwarns << "Unable to parse header: " << header << llendl;
+ LL_WARNS() << "Unable to parse header: " << header << LL_ENDL;
}
}
return header_len;
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_URL_EXTRACTOR("URL Extractor");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_URL_EXTRACTOR("URL Extractor");
/**
* LLContextURLExtractor
*/
@@ -688,7 +692,7 @@ LLIOPipe::EStatus LLContextURLExtractor::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_PROCESS_URL_EXTRACTOR);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_URL_EXTRACTOR);
PUMP_DEBUG;
// The destination host is in the context.
if(context.isUndefined() || !mRequest)
@@ -747,15 +751,15 @@ void LLURLRequestComplete::complete(const LLChannelDescriptors& channels,
void LLURLRequestComplete::response(const LLChannelDescriptors& channels,
const buffer_ptr_t& buffer)
{
- llwarns << "LLURLRequestComplete::response default implementation called"
- << llendl;
+ LL_WARNS() << "LLURLRequestComplete::response default implementation called"
+ << LL_ENDL;
}
//virtual
void LLURLRequestComplete::noResponse()
{
- llwarns << "LLURLRequestComplete::noResponse default implementation called"
- << llendl;
+ LL_WARNS() << "LLURLRequestComplete::noResponse default implementation called"
+ << LL_ENDL;
}
void LLURLRequestComplete::responseStatus(LLIOPipe::EStatus status)
@@ -763,7 +767,7 @@ void LLURLRequestComplete::responseStatus(LLIOPipe::EStatus status)
mRequestStatus = status;
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_URL_COMPLETE("URL Complete");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_URL_COMPLETE("URL Complete");
// virtual
LLIOPipe::EStatus LLURLRequestComplete::process_impl(
const LLChannelDescriptors& channels,
@@ -772,7 +776,7 @@ LLIOPipe::EStatus LLURLRequestComplete::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_PROCESS_URL_COMPLETE);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_URL_COMPLETE);
PUMP_DEBUG;
complete(channels, buffer);
return STATUS_OK;
diff --git a/indra/llmessage/llurlrequest.h b/indra/llmessage/llurlrequest.h
index 20d6e30d17..88fccd4bf6 100755
--- a/indra/llmessage/llurlrequest.h
+++ b/indra/llmessage/llurlrequest.h
@@ -42,9 +42,10 @@
#include "llcurl.h"
-extern const std::string CONTEXT_REQUEST;
+/**
+ * External constants
+ */
extern const std::string CONTEXT_DEST_URI_SD_LABEL;
-extern const std::string CONTEXT_RESPONSE;
extern const std::string CONTEXT_TRANSFERED_BYTES;
class LLURLRequestDetail;
@@ -68,42 +69,22 @@ class LLURLRequest : public LLIOPipe
{
LOG_CLASS(LLURLRequest);
public:
-
typedef int (* SSLCertVerifyCallback)(X509_STORE_CTX *ctx, void *param);
- /**
- * @brief This enumeration is for specifying the type of request.
- */
- enum ERequestAction
- {
- INVALID,
- HTTP_HEAD,
- HTTP_GET,
- HTTP_PUT,
- HTTP_POST,
- HTTP_DELETE,
- HTTP_MOVE, // Caller will need to set 'Destination' header
- REQUEST_ACTION_COUNT
- };
-
- /**
- * @brief Turn the requst action into an http verb.
- */
- static std::string actionAsVerb(ERequestAction action);
/**
* @brief Constructor.
*
- * @param action One of the ERequestAction enumerations.
+ * @param action One of the EHTTPMethod enumerations.
*/
- LLURLRequest(ERequestAction action, bool follow_redirects = true);
+ LLURLRequest(EHTTPMethod action, bool follow_redirects = true);
/**
* @brief Constructor.
*
- * @param action One of the ERequestAction enumerations.
+ * @param action One of the EHTTPMethod enumerations.
* @param url The url of the request. It should already be encoded.
*/
- LLURLRequest(ERequestAction action, const std::string& url, bool follow_redirects = true);
+ LLURLRequest(EHTTPMethod action, const std::string& url, bool follow_redirects = true);
/**
* @brief Destructor.
@@ -123,17 +104,17 @@ public:
*
*/
void setURL(const std::string& url);
- std::string getURL() const;
+ const std::string& getURL() const;
/**
* @brief Add a header to the http post.
*
- * The header must be correctly formatted for HTTP requests. This
- * provides a raw interface if you know what kind of request you
+ * This provides a raw interface if you know what kind of request you
* will be making during construction of this instance. All
* required headers will be automatically constructed, so this is
* usually useful for encoding parameters.
*/
- void addHeader(const char* header);
+ void addHeader(const std::string& header, const std::string& value = "");
+ void addHeaderRaw(const char* header);
/**
* @brief Check remote server certificate signed by a known root CA.
@@ -218,7 +199,7 @@ protected:
STATE_HAVE_RESPONSE,
};
EState mState;
- ERequestAction mAction;
+ EHTTPMethod mAction;
bool mFollowRedirects;
LLURLRequestDetail* mDetail;
LLIOPipe::ptr_t mCompletionCallback;
@@ -316,7 +297,7 @@ public:
// May be called more than once, particularly for redirects and proxy madness.
// Ex. a 200 for a connection to https through a proxy, followed by the "real" status
// a 3xx for a redirect followed by a "real" status, or more redirects.
- virtual void httpStatus(U32 status, const std::string& reason) { }
+ virtual void httpStatus(S32 status, const std::string& reason) { }
virtual void complete(
const LLChannelDescriptors& channels,
@@ -369,15 +350,8 @@ protected:
//@}
// value to note if we actually got the response. This value
- // depends on correct useage from the LLURLRequest instance.
+ // depends on correct usage from the LLURLRequest instance.
EStatus mRequestStatus;
};
-
-
-/**
- * External constants
- */
-extern const std::string CONTEXT_DEST_URI_SD_LABEL;
-
#endif // LL_LLURLREQUEST_H
diff --git a/indra/llmessage/lluseroperation.cpp b/indra/llmessage/lluseroperation.cpp
index a4a68d0c81..c506af19ce 100755
--- a/indra/llmessage/lluseroperation.cpp
+++ b/indra/llmessage/lluseroperation.cpp
@@ -100,7 +100,7 @@ LLUserOperationMgr::~LLUserOperationMgr()
{
if (mUserOperationList.size() > 0)
{
- llwarns << "Exiting with user operations pending." << llendl;
+ LL_WARNS() << "Exiting with user operations pending." << LL_ENDL;
}
}
@@ -109,7 +109,7 @@ void LLUserOperationMgr::addOperation(LLUserOperation* op)
{
if(!op)
{
- llwarns << "Tried to add null op" << llendl;
+ LL_WARNS() << "Tried to add null op" << LL_ENDL;
return;
}
LLUUID id = op->getTransactionID();
@@ -160,7 +160,7 @@ void LLUserOperationMgr::deleteExpiredOperations()
op = (*it).second;
if(op && op->isExpired())
{
- lldebugs << "expiring: " << (*it).first << llendl;
+ LL_DEBUGS() << "expiring: " << (*it).first << LL_ENDL;
op->expire();
mUserOperationList.erase(it++);
delete op;
diff --git a/indra/llmessage/llxfer.cpp b/indra/llmessage/llxfer.cpp
index f8c55d52ad..4aba5cae72 100755
--- a/indra/llmessage/llxfer.cpp
+++ b/indra/llmessage/llxfer.cpp
@@ -99,7 +99,7 @@ void LLXfer::cleanup ()
S32 LLXfer::startSend (U64 xfer_id, const LLHost &remote_host)
{
- llwarns << "undifferentiated LLXfer::startSend for " << getFileName() << llendl;
+ LL_WARNS() << "undifferentiated LLXfer::startSend for " << getFileName() << LL_ENDL;
return (-1);
}
@@ -115,8 +115,8 @@ void LLXfer::setXferSize (S32 xfer_size)
S32 LLXfer::startDownload()
{
- llwarns << "undifferentiated LLXfer::startDownload for " << getFileName()
- << llendl;
+ LL_WARNS() << "undifferentiated LLXfer::startDownload for " << getFileName()
+ << LL_ENDL;
return (-1);
}
@@ -140,7 +140,7 @@ S32 LLXfer::receiveData (char *datap, S32 data_size)
}
else
{
- llerrs << "NULL data passed in receiveData" << llendl;
+ LL_ERRS() << "NULL data passed in receiveData" << LL_ENDL;
}
}
@@ -163,7 +163,7 @@ S32 LLXfer::flush()
S32 LLXfer::suck(S32 start_position)
{
- llwarns << "Attempted to send a packet outside the buffer bounds in LLXfer::suck()" << llendl;
+ LL_WARNS() << "Attempted to send a packet outside the buffer bounds in LLXfer::suck()" << LL_ENDL;
return (-1);
}
@@ -196,7 +196,7 @@ void LLXfer::sendPacket(S32 packet_num)
if (fdata_size < 0)
{
- llwarns << "negative data size in xfer send, aborting" << llendl;
+ LL_WARNS() << "negative data size in xfer send, aborting" << LL_ENDL;
abort(LL_ERR_EOF);
return;
}
@@ -289,13 +289,13 @@ S32 LLXfer::processEOF()
if (LL_ERR_NOERR == mCallbackResult)
{
- llinfos << "xfer from " << mRemoteHost << " complete: " << getFileName()
- << llendl;
+ LL_INFOS() << "xfer from " << mRemoteHost << " complete: " << getFileName()
+ << LL_ENDL;
}
else
{
- llinfos << "xfer from " << mRemoteHost << " failed, code "
- << mCallbackResult << ": " << getFileName() << llendl;
+ LL_INFOS() << "xfer from " << mRemoteHost << " failed, code "
+ << mCallbackResult << ": " << getFileName() << LL_ENDL;
}
if (mCallback)
@@ -323,8 +323,8 @@ void LLXfer::abort (S32 result_code)
{
mCallbackResult = result_code;
- llinfos << "Aborting xfer from " << mRemoteHost << " named " << getFileName()
- << " - error: " << result_code << llendl;
+ LL_INFOS() << "Aborting xfer from " << mRemoteHost << " named " << getFileName()
+ << " - error: " << result_code << LL_ENDL;
gMessageSystem->newMessageFast(_PREHASH_AbortXfer);
gMessageSystem->nextBlockFast(_PREHASH_XferID);
diff --git a/indra/llmessage/llxfer.h b/indra/llmessage/llxfer.h
index f9348eb11f..edf5eeb82d 100755
--- a/indra/llmessage/llxfer.h
+++ b/indra/llmessage/llxfer.h
@@ -32,6 +32,10 @@
#include "llextendedstatus.h"
const S32 LL_XFER_LARGE_PAYLOAD = 7680;
+const S32 LL_ERR_FILE_EMPTY = -44;
+const int LL_ERR_FILE_NOT_FOUND = -43;
+const int LL_ERR_CANNOT_OPEN_FILE = -42;
+const int LL_ERR_EOF = -39;
typedef enum ELLXferStatus {
e_LL_XFER_UNINITIALIZED,
diff --git a/indra/llmessage/llxfer_file.cpp b/indra/llmessage/llxfer_file.cpp
index 9e02af2c3e..257a13f277 100755
--- a/indra/llmessage/llxfer_file.cpp
+++ b/indra/llmessage/llxfer_file.cpp
@@ -102,12 +102,12 @@ void LLXfer_File::cleanup ()
if (mDeleteLocalOnCompletion)
{
- lldebugs << "Removing file: " << mLocalFilename << llendl;
+ LL_DEBUGS() << "Removing file: " << mLocalFilename << LL_ENDL;
LLFile::remove(mLocalFilename);
}
else
{
- lldebugs << "Keeping local file: " << mLocalFilename << llendl;
+ LL_DEBUGS() << "Keeping local file: " << mLocalFilename << LL_ENDL;
}
LLXfer::cleanup();
@@ -139,7 +139,7 @@ S32 LLXfer_File::initializeRequest(U64 xfer_id,
mCallbackDataHandle = user_data;
mCallbackResult = LL_ERR_NOERR;
- llinfos << "Requesting xfer from " << remote_host << " for file: " << mLocalFilename << llendl;
+ LL_INFOS() << "Requesting xfer from " << remote_host << " for file: " << mLocalFilename << LL_ENDL;
if (mBuffer)
{
@@ -182,7 +182,7 @@ S32 LLXfer_File::startDownload()
}
else
{
- llwarns << "Couldn't create file to be received!" << llendl;
+ LL_WARNS() << "Couldn't create file to be received!" << LL_ENDL;
retval = -1;
}
@@ -223,7 +223,7 @@ S32 LLXfer_File::startSend (U64 xfer_id, const LLHost &remote_host)
}
else
{
- llinfos << "Warning: " << mLocalFilename << " not found." << llendl;
+ LL_INFOS() << "Warning: " << mLocalFilename << " not found." << LL_ENDL;
return (LL_ERR_FILE_NOT_FOUND);
}
@@ -279,7 +279,7 @@ S32 LLXfer_File::flush()
{
if (mFp)
{
- llerrs << "Overwriting open file pointer!" << llendl;
+ LL_ERRS() << "Overwriting open file pointer!" << LL_ENDL;
}
mFp = LLFile::fopen(mTempFilename,"a+b"); /* Flawfinder : ignore */
@@ -287,10 +287,10 @@ S32 LLXfer_File::flush()
{
if (fwrite(mBuffer,1,mBufferLength,mFp) != mBufferLength)
{
- llwarns << "Short write" << llendl;
+ LL_WARNS() << "Short write" << LL_ENDL;
}
-// llinfos << "******* wrote " << mBufferLength << " bytes of file xfer" << llendl;
+// LL_INFOS() << "******* wrote " << mBufferLength << " bytes of file xfer" << LL_ENDL;
fclose(mFp);
mFp = NULL;
@@ -298,7 +298,7 @@ S32 LLXfer_File::flush()
}
else
{
- llwarns << "LLXfer_File::flush() unable to open " << mTempFilename << " for writing!" << llendl;
+ LL_WARNS() << "LLXfer_File::flush() unable to open " << mTempFilename << " for writing!" << LL_ENDL;
retval = LL_ERR_CANNOT_OPEN_FILE;
}
}
@@ -329,37 +329,37 @@ S32 LLXfer_File::processEOF()
{
#if !LL_WINDOWS
S32 error_number = errno;
- llinfos << "Rename failure (" << error_number << ") - "
- << mTempFilename << " to " << mLocalFilename << llendl;
+ LL_INFOS() << "Rename failure (" << error_number << ") - "
+ << mTempFilename << " to " << mLocalFilename << LL_ENDL;
if(EXDEV == error_number)
{
if(copy_file(mTempFilename, mLocalFilename) == 0)
{
- llinfos << "Rename across mounts; copying+unlinking the file instead." << llendl;
+ LL_INFOS() << "Rename across mounts; copying+unlinking the file instead." << LL_ENDL;
unlink(mTempFilename.c_str());
}
else
{
- llwarns << "Copy failure - " << mTempFilename << " to "
- << mLocalFilename << llendl;
+ LL_WARNS() << "Copy failure - " << mTempFilename << " to "
+ << mLocalFilename << LL_ENDL;
}
}
else
{
//LLFILE* fp = LLFile::fopen(mTempFilename, "r");
- //llwarns << "File " << mTempFilename << " does "
- // << (!fp ? "not" : "" ) << " exit." << llendl;
+ //LL_WARNS() << "File " << mTempFilename << " does "
+ // << (!fp ? "not" : "" ) << " exit." << LL_ENDL;
//if(fp) fclose(fp);
//fp = LLFile::fopen(mLocalFilename, "r");
- //llwarns << "File " << mLocalFilename << " does "
- // << (!fp ? "not" : "" ) << " exit." << llendl;
+ //LL_WARNS() << "File " << mLocalFilename << " does "
+ // << (!fp ? "not" : "" ) << " exit." << LL_ENDL;
//if(fp) fclose(fp);
- llwarns << "Rename fatally failed, can only handle EXDEV ("
- << EXDEV << ")" << llendl;
+ LL_WARNS() << "Rename fatally failed, can only handle EXDEV ("
+ << EXDEV << ")" << LL_ENDL;
}
#else
- llwarns << "Rename failure - " << mTempFilename << " to "
- << mLocalFilename << llendl;
+ LL_WARNS() << "Rename failure - " << mTempFilename << " to "
+ << mLocalFilename << LL_ENDL;
#endif
}
}
diff --git a/indra/llmessage/llxfer_mem.cpp b/indra/llmessage/llxfer_mem.cpp
index 4c7e83c33d..3bea08f2e5 100755
--- a/indra/llmessage/llxfer_mem.cpp
+++ b/indra/llmessage/llxfer_mem.cpp
@@ -130,7 +130,7 @@ S32 LLXfer_Mem::processEOF()
mStatus = e_LL_XFER_COMPLETE;
- llinfos << "xfer complete: " << getFileName() << llendl;
+ LL_INFOS() << "xfer complete: " << getFileName() << LL_ENDL;
if (mCallback)
{
@@ -164,7 +164,7 @@ S32 LLXfer_Mem::initializeRequest(U64 xfer_id,
mRemotePath = remote_path;
mDeleteRemoteOnCompletion = delete_remote_on_completion;
- llinfos << "Requesting file: " << remote_filename << llendl;
+ LL_INFOS() << "Requesting file: " << remote_filename << LL_ENDL;
delete [] mBuffer;
mBuffer = NULL;
diff --git a/indra/llmessage/llxfer_vfile.cpp b/indra/llmessage/llxfer_vfile.cpp
index 751a69518c..4a378d1d34 100755
--- a/indra/llmessage/llxfer_vfile.cpp
+++ b/indra/llmessage/llxfer_vfile.cpp
@@ -118,7 +118,7 @@ S32 LLXfer_VFile::initializeRequest(U64 xfer_id,
mName = llformat("VFile %s:%s", id_string.c_str(), LLAssetType::lookup(mType));
- llinfos << "Requesting " << mName << llendl;
+ LL_INFOS() << "Requesting " << mName << LL_ENDL;
if (mBuffer)
{
@@ -236,8 +236,8 @@ S32 LLXfer_VFile::suck(S32 start_position)
// grab a buffer from the right place in the file
if (! mVFile->seek(start_position, 0))
{
- llwarns << "VFile Xfer Can't seek to position " << start_position << ", file length " << mVFile->getSize() << llendl;
- llwarns << "While sending file " << mLocalID << llendl;
+ LL_WARNS() << "VFile Xfer Can't seek to position " << start_position << ", file length " << mVFile->getSize() << LL_ENDL;
+ LL_WARNS() << "While sending file " << mLocalID << LL_ENDL;
return -1;
}
@@ -291,7 +291,7 @@ S32 LLXfer_VFile::processEOF()
LLVFile file(mVFS, mTempID, mType, LLVFile::WRITE);
if (! file.rename(mLocalID, mType))
{
- llinfos << "copy from temp file failed: unable to rename to " << mLocalID << llendl;
+ LL_INFOS() << "copy from temp file failed: unable to rename to " << mLocalID << LL_ENDL;
}
}
diff --git a/indra/llmessage/llxfermanager.cpp b/indra/llmessage/llxfermanager.cpp
index 00b9d81611..b518dd1b72 100755
--- a/indra/llmessage/llxfermanager.cpp
+++ b/indra/llmessage/llxfermanager.cpp
@@ -196,13 +196,13 @@ void LLXferManager::printHostStatus()
LLHostStatus *host_statusp = NULL;
if (!mOutgoingHosts.empty())
{
- llinfos << "Outgoing Xfers:" << llendl;
+ LL_INFOS() << "Outgoing Xfers:" << LL_ENDL;
for (status_list_t::iterator iter = mOutgoingHosts.begin();
iter != mOutgoingHosts.end(); ++iter)
{
host_statusp = *iter;
- llinfos << " " << host_statusp->mHost << " active: " << host_statusp->mNumActive << " pending: " << host_statusp->mNumPending << llendl;
+ LL_INFOS() << " " << host_statusp->mHost << " active: " << host_statusp->mNumActive << " pending: " << host_statusp->mNumPending << LL_ENDL;
}
}
}
@@ -392,7 +392,7 @@ U64 LLXferManager::registerXfer(const void *datap, const S32 length)
}
else
{
- llerrs << "Xfer allocation error" << llendl;
+ LL_ERRS() << "Xfer allocation error" << LL_ENDL;
xfer_id = 0;
}
@@ -455,7 +455,7 @@ void LLXferManager::requestFile(const std::string& local_filename,
}
else
{
- llerrs << "Xfer allocation error" << llendl;
+ LL_ERRS() << "Xfer allocation error" << LL_ENDL;
}
}
@@ -483,7 +483,7 @@ void LLXferManager::requestFile(const std::string& remote_filename,
}
else
{
- llerrs << "Xfer allocation error" << llendl;
+ LL_ERRS() << "Xfer allocation error" << LL_ENDL;
}
}
@@ -528,7 +528,7 @@ void LLXferManager::requestVFile(const LLUUID& local_id,
}
else
{
- llerrs << "Xfer allocation error" << llendl;
+ LL_ERRS() << "Xfer allocation error" << LL_ENDL;
}
}
@@ -570,7 +570,7 @@ void LLXferManager::requestXfer(
}
else
{
- llerrs << "Xfer allcoation error" << llendl;
+ LL_ERRS() << "Xfer allcoation error" << LL_ENDL;
}
}
@@ -589,7 +589,7 @@ void LLXferManager::requestXfer(U64 xfer_id, const LLHost &remote_host, BOOL del
}
else
{
- llerrs << "Xfer allcoation error" << llendl;
+ LL_ERRS() << "Xfer allcoation error" << LL_ENDL;
}
}
*/
@@ -616,9 +616,9 @@ void LLXferManager::processReceiveData (LLMessageSystem *mesgsys, void ** /*user
if (!xferp)
{
char U64_BUF[MAX_STRING]; /* Flawfinder : ignore */
- llwarns << "received xfer data from " << mesgsys->getSender()
+ LL_WARNS() << "received xfer data from " << mesgsys->getSender()
<< " for non-existent xfer id: "
- << U64_to_str(id, U64_BUF, sizeof(U64_BUF)) << llendl;
+ << U64_to_str(id, U64_BUF, sizeof(U64_BUF)) << LL_ENDL;
return;
}
@@ -629,11 +629,11 @@ void LLXferManager::processReceiveData (LLMessageSystem *mesgsys, void ** /*user
// confirm it if it was a resend of the last one, since the confirmation might have gotten dropped
if (decodePacketNum(packetnum) == (xferp->mPacketNum - 1))
{
- llinfos << "Reconfirming xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " packet " << packetnum << llendl; sendConfirmPacket(mesgsys, id, decodePacketNum(packetnum), mesgsys->getSender());
+ LL_INFOS() << "Reconfirming xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " packet " << packetnum << LL_ENDL; sendConfirmPacket(mesgsys, id, decodePacketNum(packetnum), mesgsys->getSender());
}
else
{
- llinfos << "Ignoring xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " recv'd packet " << packetnum << "; expecting " << xferp->mPacketNum << llendl;
+ LL_INFOS() << "Ignoring xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " recv'd packet " << packetnum << "; expecting " << xferp->mPacketNum << LL_ENDL;
}
return;
}
@@ -677,7 +677,7 @@ void LLXferManager::processReceiveData (LLMessageSystem *mesgsys, void ** /*user
ack_info.mID = id;
ack_info.mPacketNum = decodePacketNum(packetnum);
ack_info.mRemoteHost = mesgsys->getSender();
- mXferAckQueue.push(ack_info);
+ mXferAckQueue.push_back(ack_info);
}
if (isLastPacket(packetnum))
@@ -802,8 +802,8 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user
mesgsys->getU64Fast(_PREHASH_XferID, _PREHASH_ID, id);
char U64_BUF[MAX_STRING]; /* Flawfinder : ignore */
- llinfos << "xfer request id: " << U64_to_str(id, U64_BUF, sizeof(U64_BUF))
- << " to " << mesgsys->getSender() << llendl;
+ LL_INFOS() << "xfer request id: " << U64_to_str(id, U64_BUF, sizeof(U64_BUF))
+ << " to " << mesgsys->getSender() << LL_ENDL;
mesgsys->getStringFast(_PREHASH_XferID, _PREHASH_Filename, local_filename);
@@ -823,16 +823,16 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user
{
if(NULL == LLAssetType::lookup(type))
{
- llwarns << "Invalid type for xfer request: " << uuid << ":"
- << type_s16 << " to " << mesgsys->getSender() << llendl;
+ LL_WARNS() << "Invalid type for xfer request: " << uuid << ":"
+ << type_s16 << " to " << mesgsys->getSender() << LL_ENDL;
return;
}
- llinfos << "starting vfile transfer: " << uuid << "," << LLAssetType::lookup(type) << " to " << mesgsys->getSender() << llendl;
+ LL_INFOS() << "starting vfile transfer: " << uuid << "," << LLAssetType::lookup(type) << " to " << mesgsys->getSender() << LL_ENDL;
if (! mVFS)
{
- llwarns << "Attempt to send VFile w/o available VFS" << llendl;
+ LL_WARNS() << "Attempt to send VFile w/o available VFS" << LL_ENDL;
return;
}
@@ -845,7 +845,7 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user
}
else
{
- llerrs << "Xfer allcoation error" << llendl;
+ LL_ERRS() << "Xfer allcoation error" << LL_ENDL;
}
}
else if (!local_filename.empty())
@@ -868,7 +868,7 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user
case LL_PATH_NONE:
if(!validateFileForTransfer(local_filename))
{
- llwarns << "SECURITY: Unapproved filename '" << local_filename << llendl;
+ LL_WARNS() << "SECURITY: Unapproved filename '" << local_filename << LL_ENDL;
return;
}
break;
@@ -876,13 +876,13 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user
case LL_PATH_CACHE:
if(!verify_cache_filename(local_filename))
{
- llwarns << "SECURITY: Illegal cache filename '" << local_filename << llendl;
+ LL_WARNS() << "SECURITY: Illegal cache filename '" << local_filename << LL_ENDL;
return;
}
break;
default:
- llwarns << "SECURITY: Restricted file dir enum: " << (U32)local_path << llendl;
+ LL_WARNS() << "SECURITY: Restricted file dir enum: " << (U32)local_path << LL_ENDL;
return;
}
@@ -897,7 +897,7 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user
{
expanded_filename = local_filename;
}
- llinfos << "starting file transfer: " << expanded_filename << " to " << mesgsys->getSender() << llendl;
+ LL_INFOS() << "starting file transfer: " << expanded_filename << " to " << mesgsys->getSender() << LL_ENDL;
BOOL delete_local_on_completion = FALSE;
mesgsys->getBOOL("XferID", "DeleteOnCompletion", delete_local_on_completion);
@@ -913,15 +913,15 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user
}
else
{
- llerrs << "Xfer allcoation error" << llendl;
+ LL_ERRS() << "Xfer allcoation error" << LL_ENDL;
}
}
else
{
char U64_BUF[MAX_STRING]; /* Flawfinder : ignore */
- llinfos << "starting memory transfer: "
+ LL_INFOS() << "starting memory transfer: "
<< U64_to_str(id, U64_BUF, sizeof(U64_BUF)) << " to "
- << mesgsys->getSender() << llendl;
+ << mesgsys->getSender() << LL_ENDL;
xferp = findXfer(id, mSendList);
@@ -931,7 +931,7 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user
}
else
{
- llinfos << "Warning: " << U64_BUF << " not found." << llendl;
+ LL_INFOS() << "Warning: " << U64_BUF << " not found." << LL_ENDL;
result = LL_ERR_FILE_NOT_FOUND;
}
}
@@ -945,7 +945,7 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user
}
else // can happen with a memory transfer not found
{
- llinfos << "Aborting xfer to " << mesgsys->getSender() << " with error: " << result << llendl;
+ LL_INFOS() << "Aborting xfer to " << mesgsys->getSender() << " with error: " << result << LL_ENDL;
mesgsys->newMessageFast(_PREHASH_AbortXfer);
mesgsys->nextBlockFast(_PREHASH_XferID);
@@ -959,18 +959,18 @@ void LLXferManager::processFileRequest (LLMessageSystem *mesgsys, void ** /*user
{
xferp->sendNextPacket();
changeNumActiveXfers(xferp->mRemoteHost,1);
-// llinfos << "***STARTING XFER IMMEDIATELY***" << llendl;
+// LL_INFOS() << "***STARTING XFER IMMEDIATELY***" << LL_ENDL;
}
else
{
if(xferp)
{
- llinfos << " queueing xfer request, " << numPendingXfers(xferp->mRemoteHost) << " ahead of this one" << llendl;
+ LL_INFOS() << " queueing xfer request, " << numPendingXfers(xferp->mRemoteHost) << " ahead of this one" << LL_ENDL;
}
else
{
- llwarns << "LLXferManager::processFileRequest() - no xfer found!"
- << llendl;
+ LL_WARNS() << "LLXferManager::processFileRequest() - no xfer found!"
+ << LL_ENDL;
}
}
}
@@ -1016,7 +1016,7 @@ void LLXferManager::retransmitUnackedPackets ()
// if the circuit dies, abort
if (! gMessageSystem->mCircuitInfo.isCircuitAlive( xferp->mRemoteHost ))
{
- llinfos << "Xfer found in progress on dead circuit, aborting" << llendl;
+ LL_INFOS() << "Xfer found in progress on dead circuit, aborting" << LL_ENDL;
xferp->mCallbackResult = LL_ERR_CIRCUIT_GONE;
xferp->processEOF();
delp = xferp;
@@ -1038,7 +1038,7 @@ void LLXferManager::retransmitUnackedPackets ()
{
if (xferp->mRetries > LL_PACKET_RETRY_LIMIT)
{
- llinfos << "dropping xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " packet retransmit limit exceeded, xfer dropped" << llendl;
+ LL_INFOS() << "dropping xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " packet retransmit limit exceeded, xfer dropped" << LL_ENDL;
xferp->abort(LL_ERR_TCP_TIMEOUT);
delp = xferp;
xferp = xferp->mNext;
@@ -1046,14 +1046,14 @@ void LLXferManager::retransmitUnackedPackets ()
}
else
{
- llinfos << "resending xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " packet unconfirmed after: "<< et << " sec, packet " << xferp->mPacketNum << llendl;
+ LL_INFOS() << "resending xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << " packet unconfirmed after: "<< et << " sec, packet " << xferp->mPacketNum << LL_ENDL;
xferp->resendLastPacket();
xferp = xferp->mNext;
}
}
else if ((xferp->mStatus == e_LL_XFER_REGISTERED) && ( (et = xferp->ACKTimer.getElapsedTimeF32()) > LL_XFER_REGISTRATION_TIMEOUT))
{
- llinfos << "registered xfer never requested, xfer dropped" << llendl;
+ LL_INFOS() << "registered xfer never requested, xfer dropped" << LL_ENDL;
xferp->abort(LL_ERR_TCP_TIMEOUT);
delp = xferp;
xferp = xferp->mNext;
@@ -1061,17 +1061,17 @@ void LLXferManager::retransmitUnackedPackets ()
}
else if (xferp->mStatus == e_LL_XFER_ABORTED)
{
- llwarns << "Removing aborted xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << llendl;
+ LL_WARNS() << "Removing aborted xfer " << xferp->mRemoteHost << ":" << xferp->getFileName() << LL_ENDL;
delp = xferp;
xferp = xferp->mNext;
removeXfer(delp,&mSendList);
}
else if (xferp->mStatus == e_LL_XFER_PENDING)
{
-// llinfos << "*** numActiveXfers = " << numActiveXfers(xferp->mRemoteHost) << " mMaxOutgoingXfersPerCircuit = " << mMaxOutgoingXfersPerCircuit << llendl;
+// LL_INFOS() << "*** numActiveXfers = " << numActiveXfers(xferp->mRemoteHost) << " mMaxOutgoingXfersPerCircuit = " << mMaxOutgoingXfersPerCircuit << LL_ENDL;
if (numActiveXfers(xferp->mRemoteHost) < mMaxOutgoingXfersPerCircuit)
{
-// llinfos << "bumping pending xfer to active" << llendl;
+// LL_INFOS() << "bumping pending xfer to active" << LL_ENDL;
xferp->sendNextPacket();
changeNumActiveXfers(xferp->mRemoteHost,1);
}
@@ -1088,16 +1088,16 @@ void LLXferManager::retransmitUnackedPackets ()
// so we don't blow through bandwidth.
//
- while (mXferAckQueue.getLength())
+ while (mXferAckQueue.size())
{
if (mAckThrottle.checkOverflow(1000.0f*8.0f))
{
break;
}
- //llinfos << "Confirm packet queue length:" << mXferAckQueue.getLength() << llendl;
- LLXferAckInfo ack_info;
- mXferAckQueue.pop(ack_info);
- //llinfos << "Sending confirm packet" << llendl;
+ //LL_INFOS() << "Confirm packet queue length:" << mXferAckQueue.size() << LL_ENDL;
+ LLXferAckInfo ack_info = mXferAckQueue.front();
+ mXferAckQueue.pop_front();
+ //LL_INFOS() << "Sending confirm packet" << LL_ENDL;
sendConfirmPacket(gMessageSystem, ack_info.mID, ack_info.mPacketNum, ack_info.mRemoteHost);
mAckThrottle.throttleOverflow(1000.f*8.f); // Assume 1000 bytes/packet
}
@@ -1156,9 +1156,9 @@ void LLXferManager::startPendingDownloads()
S32 start_count = mMaxIncomingXfers - download_count;
- lldebugs << "LLXferManager::startPendingDownloads() - XFER_IN_PROGRESS: "
+ LL_DEBUGS() << "LLXferManager::startPendingDownloads() - XFER_IN_PROGRESS: "
<< download_count << " XFER_PENDING: " << pending_count
- << " startring " << llmin(start_count, pending_count) << llendl;
+ << " startring " << llmin(start_count, pending_count) << LL_ENDL;
if((start_count > 0) && (pending_count > 0))
{
diff --git a/indra/llmessage/llxfermanager.h b/indra/llmessage/llxfermanager.h
index b84bccb5b7..b3d110e7a1 100755
--- a/indra/llmessage/llxfermanager.h
+++ b/indra/llmessage/llxfermanager.h
@@ -41,7 +41,7 @@ class LLVFS;
#include "message.h"
#include "llassetstorage.h"
#include "lldir.h"
-#include "lllinkedqueue.h"
+#include <deque>
#include "llthrottle.h"
class LLHostStatus
@@ -80,7 +80,7 @@ class LLXferManager
S32 mMaxIncomingXfers;
BOOL mUseAckThrottling; // Use ack throttling to cap file xfer bandwidth
- LLLinkedQueue<LLXferAckInfo> mXferAckQueue;
+ std::deque<LLXferAckInfo> mXferAckQueue;
LLThrottle mAckThrottle;
public:
diff --git a/indra/llmessage/machine.cpp b/indra/llmessage/machine.cpp
index 8d2f512037..1e9c9c3c9a 100755
--- a/indra/llmessage/machine.cpp
+++ b/indra/llmessage/machine.cpp
@@ -33,7 +33,7 @@ void LLMachine::setMachinePort(S32 port)
{
if (port < 0)
{
- llinfos << "Can't assign a negative number to LLMachine::mPort" << llendl;
+ LL_INFOS() << "Can't assign a negative number to LLMachine::mPort" << LL_ENDL;
mHost.setPort(0);
}
else
@@ -46,7 +46,7 @@ void LLMachine::setControlPort( S32 port )
{
if (port < 0)
{
- llinfos << "Can't assign a negative number to LLMachine::mControlPort" << llendl;
+ LL_INFOS() << "Can't assign a negative number to LLMachine::mControlPort" << LL_ENDL;
mControlPort = 0;
}
else
diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp
index c3642ccbe8..cc2d5d66ad 100755
--- a/indra/llmessage/message.cpp
+++ b/indra/llmessage/message.cpp
@@ -47,10 +47,8 @@
// linden library headers
#include "indra_constants.h"
-#include "lldarray.h"
#include "lldir.h"
#include "llerror.h"
-#include "llerrorlegacy.h"
#include "llfasttimer.h"
#include "llhttpclient.h"
#include "llhttpnodeadapter.h"
@@ -73,7 +71,6 @@
#include "lltransfermanager.h"
#include "lluuid.h"
#include "llxfermanager.h"
-#include "timing.h"
#include "llquaternion.h"
#include "u64.h"
#include "v3dmath.h"
@@ -83,7 +80,7 @@
// Constants
//const char* MESSAGE_LOG_FILENAME = "message.log";
-static const F32 CIRCUIT_DUMP_TIMEOUT = 30.f;
+static const F32Seconds CIRCUIT_DUMP_TIMEOUT(30.f);
static const S32 TRUST_TIME_WINDOW = 3;
// *NOTE: This needs to be moved into a seperate file so that it never gets
@@ -113,20 +110,20 @@ namespace
{
}
- virtual void error(U32 status, const std::string& reason)
+ protected:
+ virtual void httpFailure()
{
// don't spam when agent communication disconnected already
- if (status != 410)
+ if (HTTP_GONE != getStatus())
{
- LL_WARNS("Messaging") << "error status " << status
- << " for message " << mMessageName
- << " reason " << reason << llendl;
+ LL_WARNS("Messaging") << "error for message " << mMessageName
+ << " " << dumpResponse() << LL_ENDL;
}
// TODO: Map status in to useful error code.
if(NULL != mCallback) mCallback(mCallbackData, LL_ERR_TCP_TIMEOUT);
}
- virtual void result(const LLSD& content)
+ virtual void httpSuccess()
{
if(NULL != mCallback) mCallback(mCallbackData, LL_ERR_NOERR);
}
@@ -152,10 +149,10 @@ class LLMessageHandlerBridge : public LLHTTPNode
void LLMessageHandlerBridge::post(LLHTTPNode::ResponsePtr response,
const LLSD& context, const LLSD& input) const
{
- std::string name = context["request"]["wildcard"]["message-name"];
+ std::string name = context[CONTEXT_REQUEST][CONTEXT_WILDCARD]["message-name"];
char* namePtr = LLMessageStringTable::getInstance()->getString(name.c_str());
- lldebugs << "Setting mLastSender " << input["sender"].asString() << llendl;
+ LL_DEBUGS() << "Setting mLastSender " << input["sender"].asString() << LL_ENDL;
gMessageSystem->mLastSender = LLHost(input["sender"].asString());
gMessageSystem->mPacketsIn += 1;
gMessageSystem->mLLSDMessageReader->setMessage(namePtr, input["body"]);
@@ -241,7 +238,7 @@ LLMessageSystem::LLMessageSystem(const std::string& filename, U32 port,
S32 version_patch,
bool failure_is_fatal,
const F32 circuit_heartbeat_interval, const F32 circuit_timeout) :
- mCircuitInfo(circuit_heartbeat_interval, circuit_timeout),
+ mCircuitInfo(F32Seconds(circuit_heartbeat_interval), F32Seconds(circuit_timeout)),
mLastMessageFromTrustedMessageService(false)
{
init();
@@ -262,7 +259,7 @@ LLMessageSystem::LLMessageSystem(const std::string& filename, U32 port,
mSendPacketFailureCount = 0;
- mCircuitPrintFreq = 60.f; // seconds
+ mCircuitPrintFreq = F32Seconds(60.f);
loadTemplateFile(filename, failure_is_fatal);
@@ -284,14 +281,14 @@ LLMessageSystem::LLMessageSystem(const std::string& filename, U32 port,
mbError = TRUE;
mErrorCode = error;
}
-// LL_DEBUGS("Messaging") << << "*** port: " << mPort << llendl;
+// LL_DEBUGS("Messaging") << << "*** port: " << mPort << LL_ENDL;
//
// Create the data structure that we can poll on
//
if (!gAPRPoolp)
{
- LL_ERRS("Messaging") << "No APR pool before message system initialization!" << llendl;
+ LL_ERRS("Messaging") << "No APR pool before message system initialization!" << LL_ENDL;
ll_init_apr();
}
apr_socket_t *aprSocketp = NULL;
@@ -306,20 +303,20 @@ LLMessageSystem::LLMessageSystem(const std::string& filename, U32 port,
mPollInfop->mPollFD.desc.s = aprSocketp;
mPollInfop->mPollFD.client_data = NULL;
- F64 mt_sec = getMessageTimeSeconds();
+ F64Seconds mt_sec = getMessageTimeSeconds();
mResendDumpTime = mt_sec;
mMessageCountTime = mt_sec;
mCircuitPrintTime = mt_sec;
- mCurrentMessageTimeSeconds = mt_sec;
+ mCurrentMessageTime = F64Seconds(mt_sec);
// Constants for dumping output based on message processing time/count
mNumMessageCounts = 0;
mMaxMessageCounts = 200; // >= 0 means dump warnings
- mMaxMessageTime = 1.f;
+ mMaxMessageTime = F32Seconds(1.f);
mTrueReceiveSize = 0;
- mReceiveTime = 0.f;
+ mReceiveTime = F32Seconds(0.f);
}
@@ -329,7 +326,7 @@ void LLMessageSystem::loadTemplateFile(const std::string& filename, bool failure
{
if(filename.empty())
{
- LL_ERRS("Messaging") << "No template filename specified" << llendl;
+ LL_ERRS("Messaging") << "No template filename specified" << LL_ENDL;
mbError = TRUE;
return;
}
@@ -338,9 +335,9 @@ void LLMessageSystem::loadTemplateFile(const std::string& filename, bool failure
if(!_read_file_into_string(template_body, filename))
{
if (failure_is_fatal) {
- LL_ERRS("Messaging") << "Failed to open template: " << filename << llendl;
+ LL_ERRS("Messaging") << "Failed to open template: " << filename << LL_ENDL;
} else {
- LL_WARNS("Messaging") << "Failed to open template: " << filename << llendl;
+ LL_WARNS("Messaging") << "Failed to open template: " << filename << LL_ENDL;
}
mbError = TRUE;
return;
@@ -534,7 +531,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
{
// This is the first message being handled after a resetReceiveCounts,
// we must be starting the message processing loop. Reset the timers.
- mCurrentMessageTimeSeconds = totalTime() * SEC_PER_USEC;
+ mCurrentMessageTime = totalTime();
mMessageCountTime = getMessageTimeSeconds();
}
@@ -566,7 +563,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
// Ones that are non-zero but below the minimum packet size are worrisome.
if (receive_size > 0)
{
- LL_WARNS("Messaging") << "Invalid (too short) packet discarded " << receive_size << llendl;
+ LL_WARNS("Messaging") << "Invalid (too short) packet discarded " << receive_size << LL_ENDL;
callExceptionFunc(MX_PACKET_TOO_SHORT);
}
// no data in packet receive buffer
@@ -592,7 +589,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
// the next one
LL_WARNS("Messaging") << "Malformed packet received. Packet size "
<< receive_size << " with invalid no. of acks " << acks
- << llendl;
+ << LL_ENDL;
valid_packet = FALSE;
continue;
}
@@ -620,7 +617,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
memcpy(&mem_id, &mTrueReceiveBuffer[true_rcv_size], /* Flawfinder: ignore*/
sizeof(TPACKETID));
packet_id = ntohl(mem_id);
- //LL_INFOS("Messaging") << "got ack: " << packet_id << llendl;
+ //LL_INFOS("Messaging") << "got ack: " << packet_id << LL_ENDL;
cdp->ackReliablePacket(packet_id);
}
if (!cdp->getUnackedPacketCount())
@@ -652,14 +649,14 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
// LL_WARNS("Messaging") << "DISCARDED PACKET HOST MISMATCH! HOST: "
// << host << " CIRCUIT: "
// << mCircuitInfo.mCurrentCircuit->mHost
- // << llendl;
+ // << LL_ENDL;
//}
// ***************************************
//mCircuitInfo.mCurrentCircuit->mAcks.put(mCurrentRecvPacketID);
cdp->collectRAck(mCurrentRecvPacketID);
}
- LL_DEBUGS("Messaging") << "Discarding duplicate resend from " << host << llendl;
+ LL_DEBUGS("Messaging") << "Discarding duplicate resend from " << host << LL_ENDL;
if(mVerboseLog)
{
std::ostringstream str;
@@ -671,7 +668,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
<< " resent "
<< ((acks > 0) ? "acks" : "")
<< " DISCARD DUPLICATE";
- LL_INFOS("Messaging") << str.str() << llendl;
+ LL_INFOS("Messaging") << str.str() << LL_ENDL;
}
mPacketsIn++;
valid_packet = FALSE;
@@ -750,7 +747,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
{
if (mbProtected && (!cdp))
{
- LL_WARNS("Messaging") << "Invalid Packet from invalid circuit " << host << llendl;
+ LL_WARNS("Messaging") << "Invalid Packet from invalid circuit " << host << LL_ENDL;
mOffCircuitPackets++;
}
else
@@ -761,7 +758,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )
}
} while (!valid_packet && receive_size > 0);
- F64 mt_sec = getMessageTimeSeconds();
+ F64Seconds mt_sec = getMessageTimeSeconds();
// Check to see if we need to print debug info
if ((mt_sec - mCircuitPrintTime) > mCircuitPrintFreq)
{
@@ -792,7 +789,7 @@ S32 LLMessageSystem::getReceiveBytes() const
void LLMessageSystem::processAcks()
{
- F64 mt_sec = getMessageTimeSeconds();
+ F64Seconds mt_sec = getMessageTimeSeconds();
{
gTransferManager.updateTransfers();
@@ -820,7 +817,7 @@ void LLMessageSystem::processAcks()
if (!mDenyTrustedCircuitSet.empty())
{
- LL_INFOS("Messaging") << "Sending queued DenyTrustedCircuit messages." << llendl;
+ LL_INFOS("Messaging") << "Sending queued DenyTrustedCircuit messages." << LL_ENDL;
for (host_set_t::iterator hostit = mDenyTrustedCircuitSet.begin(); hostit != mDenyTrustedCircuitSet.end(); ++hostit)
{
reallySendDenyTrustedCircuit(*hostit);
@@ -836,10 +833,10 @@ void LLMessageSystem::processAcks()
}
}
- if (mMaxMessageTime >= 0.f)
+ if (mMaxMessageTime >= F32Seconds(0.f))
{
// This is one of the only places where we're required to get REAL message system time.
- mReceiveTime = (F32)(getMessageTimeSeconds(TRUE) - mMessageCountTime);
+ mReceiveTime = getMessageTimeSeconds(TRUE) - mMessageCountTime;
if (mReceiveTime > mMaxMessageTime)
{
dump = TRUE;
@@ -894,7 +891,7 @@ LLSD LLMessageSystem::getBuiltMessageLLSD() const
else
{
// TODO: implement as below?
- llerrs << "Message not built as LLSD." << llendl;
+ LL_ERRS() << "Message not built as LLSD." << LL_ENDL;
}
return result;
}
@@ -1013,13 +1010,13 @@ S32 LLMessageSystem::sendReliable(const LLHost &host)
S32 LLMessageSystem::sendSemiReliable(const LLHost &host, void (*callback)(void **,S32), void ** callback_data)
{
- F32 timeout;
+ F32Seconds timeout;
LLCircuitData *cdp = mCircuitInfo.findCircuit(host);
if (cdp)
{
timeout = llmax(LL_MINIMUM_SEMIRELIABLE_TIMEOUT_SECONDS,
- LL_SEMIRELIABLE_TIMEOUT_FACTOR * cdp->getPingDelayAveraged());
+ F32Seconds(LL_SEMIRELIABLE_TIMEOUT_FACTOR * cdp->getPingDelayAveraged()));
}
else
{
@@ -1035,7 +1032,7 @@ S32 LLMessageSystem::sendSemiReliable(const LLHost &host, void (*callback)(void
S32 LLMessageSystem::sendReliable( const LLHost &host,
S32 retries,
BOOL ping_based_timeout,
- F32 timeout,
+ F32Seconds timeout,
void (*callback)(void **,S32),
void ** callback_data)
{
@@ -1044,11 +1041,11 @@ S32 LLMessageSystem::sendReliable( const LLHost &host,
LLCircuitData *cdp = mCircuitInfo.findCircuit(host);
if (cdp)
{
- timeout = llmax(LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS, LL_RELIABLE_TIMEOUT_FACTOR * cdp->getPingDelayAveraged());
+ timeout = llmax(LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS, F32Seconds(LL_RELIABLE_TIMEOUT_FACTOR * cdp->getPingDelayAveraged()));
}
else
{
- timeout = llmax(LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS, LL_RELIABLE_TIMEOUT_FACTOR * LL_AVERAGED_PING_MAX);
+ timeout = llmax(LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS, F32Seconds(LL_RELIABLE_TIMEOUT_FACTOR * LL_AVERAGED_PING_MAX));
}
}
@@ -1080,7 +1077,7 @@ void LLMessageSystem::forwardReliable(const U32 circuit_code)
S32 LLMessageSystem::forwardReliable( const LLHost &host,
S32 retries,
BOOL ping_based_timeout,
- F32 timeout,
+ F32Seconds timeout,
void (*callback)(void **,S32),
void ** callback_data)
{
@@ -1090,13 +1087,13 @@ S32 LLMessageSystem::forwardReliable( const LLHost &host,
S32 LLMessageSystem::flushSemiReliable(const LLHost &host, void (*callback)(void **,S32), void ** callback_data)
{
- F32 timeout;
+ F32Seconds timeout;
LLCircuitData *cdp = mCircuitInfo.findCircuit(host);
if (cdp)
{
timeout = llmax(LL_MINIMUM_SEMIRELIABLE_TIMEOUT_SECONDS,
- LL_SEMIRELIABLE_TIMEOUT_FACTOR * cdp->getPingDelayAveraged());
+ F32Seconds(LL_SEMIRELIABLE_TIMEOUT_FACTOR * cdp->getPingDelayAveraged()));
}
else
{
@@ -1147,7 +1144,7 @@ LLHTTPClient::ResponderPtr LLMessageSystem::createResponder(const std::string& n
// explicitly sent as reliable, so they don't have a callback
// LL_WARNS("Messaging") << "LLMessageSystem::sendMessage: Sending unreliable "
// << mMessageBuilder->getMessageName() << " message via HTTP"
-// << llendl;
+// << LL_ENDL;
return new LLFnPtrResponder(
NULL,
NULL,
@@ -1156,7 +1153,7 @@ LLHTTPClient::ResponderPtr LLMessageSystem::createResponder(const std::string& n
}
// This can be called from signal handlers,
-// so should should not use llinfos.
+// so should should not use LL_INFOS().
S32 LLMessageSystem::sendMessage(const LLHost &host)
{
if (! mMessageBuilder->isBuilt())
@@ -1183,11 +1180,11 @@ S32 LLMessageSystem::sendMessage(const LLHost &host)
if(mVerboseLog)
{
LL_INFOS_ONCE("Messaging") << "MSG: -> " << host << "\tUNKNOWN CIRCUIT:\t"
- << mMessageBuilder->getMessageName() << llendl;
+ << mMessageBuilder->getMessageName() << LL_ENDL;
}
LL_WARNS_ONCE("Messaging") << "sendMessage - Trying to send "
<< mMessageBuilder->getMessageName() << " on unknown circuit "
- << host << llendl;
+ << host << LL_ENDL;
return 0;
}
else
@@ -1206,11 +1203,11 @@ S32 LLMessageSystem::sendMessage(const LLHost &host)
if(mVerboseLog)
{
LL_INFOS("Messaging") << "MSG: -> " << host << "\tDEAD CIRCUIT\t\t"
- << mMessageBuilder->getMessageName() << llendl;
+ << mMessageBuilder->getMessageName() << LL_ENDL;
}
LL_WARNS("Messaging") << "sendMessage - Trying to send message "
<< mMessageBuilder->getMessageName() << " to dead circuit "
- << host << llendl;
+ << host << LL_ENDL;
return 0;
}
}
@@ -1255,7 +1252,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host)
LL_WARNS("Messaging") << "sendMessage - Trying to send "
<< ((buffer_length > 4000) ? "EXTRA " : "")
<< "BIG message " << mMessageBuilder->getMessageName() << " - "
- << buffer_length << llendl;
+ << buffer_length << LL_ENDL;
}
}
if (mSendReliable)
@@ -1317,7 +1314,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host)
// append_acout_count is incorrect or that
// MAX_BUFFER_SIZE has fallen below MTU which is bad
// and probably programmer error.
- LL_ERRS("Messaging") << "Buffer packing failed due to size.." << llendl;
+ LL_ERRS("Messaging") << "Buffer packing failed due to size.." << LL_ENDL;
}
}
@@ -1340,7 +1337,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host)
else
{
// mCircuitInfo already points to the correct circuit data
- cdp->addBytesOut( buffer_length );
+ cdp->addBytesOut( (S32Bytes)buffer_length );
}
if(mVerboseLog)
@@ -1358,7 +1355,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host)
std::ostream_iterator<TPACKETID> append(str, " ");
std::copy(acks.begin(), acks.end(), append);
}
- LL_INFOS("Messaging") << str.str() << llendl;
+ LL_INFOS("Messaging") << str.str() << LL_ENDL;
}
@@ -1382,7 +1379,7 @@ void LLMessageSystem::logMsgFromInvalidCircuit( const LLHost& host, BOOL recv_re
<< nullToEmpty(mMessageReader->getMessageName())
<< (recv_reliable ? " reliable" : "")
<< " REJECTED";
- LL_INFOS("Messaging") << str.str() << llendl;
+ LL_INFOS("Messaging") << str.str() << LL_ENDL;
}
// nope!
// cout << "Rejecting unexpected message " << mCurrentMessageTemplate->mName << " from " << hex << ip << " , " << dec << port << endl;
@@ -1390,7 +1387,7 @@ void LLMessageSystem::logMsgFromInvalidCircuit( const LLHost& host, BOOL recv_re
// Keep track of rejected messages as well
if (mNumMessageCounts >= MAX_MESSAGE_COUNT_NUM)
{
- LL_WARNS("Messaging") << "Got more than " << MAX_MESSAGE_COUNT_NUM << " packets without clearing counts" << llendl;
+ LL_WARNS("Messaging") << "Got more than " << MAX_MESSAGE_COUNT_NUM << " packets without clearing counts" << LL_ENDL;
}
else
{
@@ -1409,7 +1406,7 @@ S32 LLMessageSystem::sendMessage(
{
if (!(host.isOk()))
{
- LL_WARNS("Messaging") << "trying to send message to invalid host" << llendl;
+ LL_WARNS("Messaging") << "trying to send message to invalid host" << LL_ENDL;
return 0;
}
@@ -1427,14 +1424,14 @@ void LLMessageSystem::logTrustedMsgFromUntrustedCircuit( const LLHost& host )
LL_WARNS("Messaging") << "Received trusted message on untrusted circuit. "
<< "Will reply with deny. "
<< "Message: " << nullToEmpty(mMessageReader->getMessageName())
- << " Host: " << host << llendl;
+ << " Host: " << host << LL_ENDL;
}
if (mNumMessageCounts >= MAX_MESSAGE_COUNT_NUM)
{
LL_WARNS("Messaging") << "got more than " << MAX_MESSAGE_COUNT_NUM
<< " packets without clearing counts"
- << llendl;
+ << LL_ENDL;
}
else
{
@@ -1452,7 +1449,7 @@ void LLMessageSystem::logValidMsg(LLCircuitData *cdp, const LLHost& host, BOOL r
{
if (mNumMessageCounts >= MAX_MESSAGE_COUNT_NUM)
{
- LL_WARNS("Messaging") << "Got more than " << MAX_MESSAGE_COUNT_NUM << " packets without clearing counts" << llendl;
+ LL_WARNS("Messaging") << "Got more than " << MAX_MESSAGE_COUNT_NUM << " packets without clearing counts" << LL_ENDL;
}
else
{
@@ -1467,7 +1464,7 @@ void LLMessageSystem::logValidMsg(LLCircuitData *cdp, const LLHost& host, BOOL r
{
// update circuit packet ID tracking (missing/out of order packets)
cdp->checkPacketInID( mCurrentRecvPacketID, recv_resent );
- cdp->addBytesIn( mTrueReceiveSize );
+ cdp->addBytesIn( (S32Bytes)mTrueReceiveSize );
}
if(mVerboseLog)
@@ -1481,7 +1478,7 @@ void LLMessageSystem::logValidMsg(LLCircuitData *cdp, const LLHost& host, BOOL r
<< (recv_reliable ? " reliable" : "")
<< (recv_resent ? " resent" : "")
<< (recv_acks ? " acks" : "");
- LL_INFOS("Messaging") << str.str() << llendl;
+ LL_INFOS("Messaging") << str.str() << LL_ENDL;
}
}
@@ -1491,54 +1488,54 @@ void LLMessageSystem::sanityCheck()
// if (!mCurrentRMessageData)
// {
-// LL_ERRS("Messaging") << "mCurrentRMessageData is NULL" << llendl;
+// LL_ERRS("Messaging") << "mCurrentRMessageData is NULL" << LL_ENDL;
// }
// if (!mCurrentRMessageTemplate)
// {
-// LL_ERRS("Messaging") << "mCurrentRMessageTemplate is NULL" << llendl;
+// LL_ERRS("Messaging") << "mCurrentRMessageTemplate is NULL" << LL_ENDL;
// }
// if (!mCurrentRTemplateBlock)
// {
-// LL_ERRS("Messaging") << "mCurrentRTemplateBlock is NULL" << llendl;
+// LL_ERRS("Messaging") << "mCurrentRTemplateBlock is NULL" << LL_ENDL;
// }
// if (!mCurrentRDataBlock)
// {
-// LL_ERRS("Messaging") << "mCurrentRDataBlock is NULL" << llendl;
+// LL_ERRS("Messaging") << "mCurrentRDataBlock is NULL" << LL_ENDL;
// }
// if (!mCurrentSMessageData)
// {
-// LL_ERRS("Messaging") << "mCurrentSMessageData is NULL" << llendl;
+// LL_ERRS("Messaging") << "mCurrentSMessageData is NULL" << LL_ENDL;
// }
// if (!mCurrentSMessageTemplate)
// {
-// LL_ERRS("Messaging") << "mCurrentSMessageTemplate is NULL" << llendl;
+// LL_ERRS("Messaging") << "mCurrentSMessageTemplate is NULL" << LL_ENDL;
// }
// if (!mCurrentSTemplateBlock)
// {
-// LL_ERRS("Messaging") << "mCurrentSTemplateBlock is NULL" << llendl;
+// LL_ERRS("Messaging") << "mCurrentSTemplateBlock is NULL" << LL_ENDL;
// }
// if (!mCurrentSDataBlock)
// {
-// LL_ERRS("Messaging") << "mCurrentSDataBlock is NULL" << llendl;
+// LL_ERRS("Messaging") << "mCurrentSDataBlock is NULL" << LL_ENDL;
// }
}
void LLMessageSystem::showCircuitInfo()
{
- LL_INFOS("Messaging") << mCircuitInfo << llendl;
+ LL_INFOS("Messaging") << mCircuitInfo << LL_ENDL;
}
void LLMessageSystem::dumpCircuitInfo()
{
- lldebugst(LLERR_CIRCUIT_INFO) << mCircuitInfo << llendl;
+ LL_DEBUGS("Messaging") << mCircuitInfo << LL_ENDL;
}
/* virtual */
@@ -1582,7 +1579,7 @@ void LLMessageSystem::enableCircuit(const LLHost &host, BOOL trusted)
void LLMessageSystem::disableCircuit(const LLHost &host)
{
- LL_INFOS("Messaging") << "LLMessageSystem::disableCircuit for " << host << llendl;
+ LL_INFOS("Messaging") << "LLMessageSystem::disableCircuit for " << host << LL_ENDL;
U32 code = gMessageSystem->findCircuitCode( host );
// Don't need to do this, as we're removing the circuit info anyway - djs 01/28/03
@@ -1595,7 +1592,7 @@ void LLMessageSystem::disableCircuit(const LLHost &host)
code_session_map_t::iterator it = mCircuitCodes.find(code);
if(it != mCircuitCodes.end())
{
- LL_INFOS("Messaging") << "Circuit " << code << " removed from list" << llendl;
+ LL_INFOS("Messaging") << "Circuit " << code << " removed from list" << LL_ENDL;
//mCircuitCodes.removeData(code);
mCircuitCodes.erase(it);
}
@@ -1611,7 +1608,7 @@ void LLMessageSystem::disableCircuit(const LLHost &host)
U32 old_port = (U32)(ip_port & (U64)0xFFFFFFFF);
U32 old_ip = (U32)(ip_port >> 32);
- LL_INFOS("Messaging") << "Host " << LLHost(old_ip, old_port) << " circuit " << code << " removed from lookup table" << llendl;
+ LL_INFOS("Messaging") << "Host " << LLHost(old_ip, old_port) << " circuit " << code << " removed from lookup table" << LL_ENDL;
gMessageSystem->mIPPortToCircuitCode.erase(ip_port);
}
mCircuitInfo.removeCircuitData(host);
@@ -1621,7 +1618,7 @@ void LLMessageSystem::disableCircuit(const LLHost &host)
// Sigh, since we can open circuits which don't have circuit
// codes, it's possible for this to happen...
- LL_WARNS("Messaging") << "Couldn't find circuit code for " << host << llendl;
+ LL_WARNS("Messaging") << "Couldn't find circuit code for " << host << LL_ENDL;
}
}
@@ -1652,7 +1649,7 @@ BOOL LLMessageSystem::checkCircuitBlocked(const U32 circuit)
if (!host.isOk())
{
- LL_DEBUGS("Messaging") << "checkCircuitBlocked: Unknown circuit " << circuit << llendl;
+ LL_DEBUGS("Messaging") << "checkCircuitBlocked: Unknown circuit " << circuit << LL_ENDL;
return TRUE;
}
@@ -1663,7 +1660,7 @@ BOOL LLMessageSystem::checkCircuitBlocked(const U32 circuit)
}
else
{
- LL_INFOS("Messaging") << "checkCircuitBlocked(circuit): Unknown host - " << host << llendl;
+ LL_INFOS("Messaging") << "checkCircuitBlocked(circuit): Unknown host - " << host << LL_ENDL;
return FALSE;
}
}
@@ -1674,7 +1671,7 @@ BOOL LLMessageSystem::checkCircuitAlive(const U32 circuit)
if (!host.isOk())
{
- LL_DEBUGS("Messaging") << "checkCircuitAlive: Unknown circuit " << circuit << llendl;
+ LL_DEBUGS("Messaging") << "checkCircuitAlive: Unknown circuit " << circuit << LL_ENDL;
return FALSE;
}
@@ -1685,7 +1682,7 @@ BOOL LLMessageSystem::checkCircuitAlive(const U32 circuit)
}
else
{
- LL_INFOS("Messaging") << "checkCircuitAlive(circuit): Unknown host - " << host << llendl;
+ LL_INFOS("Messaging") << "checkCircuitAlive(circuit): Unknown host - " << host << LL_ENDL;
return FALSE;
}
}
@@ -1699,7 +1696,7 @@ BOOL LLMessageSystem::checkCircuitAlive(const LLHost &host)
}
else
{
- LL_DEBUGS("Messaging") << "checkCircuitAlive(host): Unknown host - " << host << llendl;
+ LL_DEBUGS("Messaging") << "checkCircuitAlive(host): Unknown host - " << host << LL_ENDL;
return FALSE;
}
}
@@ -1734,7 +1731,7 @@ LLHost LLMessageSystem::findHost(const U32 circuit_code)
void LLMessageSystem::setMaxMessageTime(const F32 seconds)
{
- mMaxMessageTime = seconds;
+ mMaxMessageTime = F32Seconds(seconds);
}
void LLMessageSystem::setMaxMessageCounts(const S32 num)
@@ -1851,18 +1848,18 @@ void LLMessageSystem::processAssignCircuitCode(LLMessageSystem* msg, void**)
{
LL_WARNS("Messaging") << "AssignCircuitCode, bad session id. Expecting "
<< msg->getMySessionID() << " but got " << session_id
- << llendl;
+ << LL_ENDL;
return;
}
U32 code;
msg->getU32Fast(_PREHASH_CircuitCode, _PREHASH_Code, code);
if (!code)
{
- LL_ERRS("Messaging") << "Assigning circuit code of zero!" << llendl;
+ LL_ERRS("Messaging") << "Assigning circuit code of zero!" << LL_ENDL;
}
msg->mOurCircuitCode = code;
- LL_INFOS("Messaging") << "Circuit code " << code << " assigned." << llendl;
+ LL_INFOS("Messaging") << "Circuit code " << code << " assigned." << LL_ENDL;
}
*/
@@ -1886,20 +1883,20 @@ bool LLMessageSystem::addCircuitCode(U32 code, const LLUUID& session_id)
{
if(!code)
{
- LL_WARNS("Messaging") << "addCircuitCode: zero circuit code" << llendl;
+ LL_WARNS("Messaging") << "addCircuitCode: zero circuit code" << LL_ENDL;
return false;
}
code_session_map_t::iterator it = mCircuitCodes.find(code);
if(it == mCircuitCodes.end())
{
- LL_INFOS("Messaging") << "New circuit code " << code << " added" << llendl;
+ LL_INFOS("Messaging") << "New circuit code " << code << " added" << LL_ENDL;
//msg->mCircuitCodes[circuit_code] = circuit_code;
mCircuitCodes.insert(code_session_map_t::value_type(code, session_id));
}
else
{
- LL_INFOS("Messaging") << "Duplicate circuit code " << code << " added" << llendl;
+ LL_INFOS("Messaging") << "Duplicate circuit code " << code << " added" << LL_ENDL;
}
return true;
}
@@ -1933,7 +1930,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg,
// Whoah, abort! We don't know anything about this circuit code.
LL_WARNS("Messaging") << "UseCircuitCode for " << circuit_code_in
<< " received without AddCircuitCode message - aborting"
- << llendl;
+ << LL_ENDL;
return;
}
@@ -1945,7 +1942,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg,
{
LL_WARNS("Messaging") << "UseCircuitCode unmatched session id. Got "
<< session_id << " but expected " << (*it).second
- << llendl;
+ << LL_ENDL;
return;
}
@@ -1958,7 +1955,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg,
if ((ip_port_old == ip_port_in) && (circuit_code_old == circuit_code_in))
{
// Current information is the same as incoming info, ignore
- LL_INFOS("Messaging") << "Got duplicate UseCircuitCode for circuit " << circuit_code_in << " to " << msg->getSender() << llendl;
+ LL_INFOS("Messaging") << "Got duplicate UseCircuitCode for circuit " << circuit_code_in << " to " << msg->getSender() << LL_ENDL;
return;
}
@@ -1968,27 +1965,27 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg,
msg->mIPPortToCircuitCode.erase(ip_port_old);
U32 old_port = (U32)(ip_port_old & (U64)0xFFFFFFFF);
U32 old_ip = (U32)(ip_port_old >> 32);
- LL_INFOS("Messaging") << "Removing derelict lookup entry for circuit " << circuit_code_old << " to " << LLHost(old_ip, old_port) << llendl;
+ LL_INFOS("Messaging") << "Removing derelict lookup entry for circuit " << circuit_code_old << " to " << LLHost(old_ip, old_port) << LL_ENDL;
}
if (circuit_code_old)
{
LLHost cur_host(ip, port);
- LL_WARNS("Messaging") << "Disabling existing circuit for " << cur_host << llendl;
+ LL_WARNS("Messaging") << "Disabling existing circuit for " << cur_host << LL_ENDL;
msg->disableCircuit(cur_host);
if (circuit_code_old == circuit_code_in)
{
- LL_WARNS("Messaging") << "Asymmetrical circuit to ip/port lookup!" << llendl;
- LL_WARNS("Messaging") << "Multiple circuit codes for " << cur_host << " probably!" << llendl;
- LL_WARNS("Messaging") << "Permanently disabling circuit" << llendl;
+ LL_WARNS("Messaging") << "Asymmetrical circuit to ip/port lookup!" << LL_ENDL;
+ LL_WARNS("Messaging") << "Multiple circuit codes for " << cur_host << " probably!" << LL_ENDL;
+ LL_WARNS("Messaging") << "Permanently disabling circuit" << LL_ENDL;
return;
}
else
{
LL_WARNS("Messaging") << "Circuit code changed for " << msg->getSender()
<< " from " << circuit_code_old << " to "
- << circuit_code_in << llendl;
+ << circuit_code_in << LL_ENDL;
}
}
@@ -2030,7 +2027,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg,
LL_INFOS("Messaging") << "Circuit code " << circuit_code_in << " from "
<< msg->getSender() << " for agent " << id << " in session "
- << session_id << llendl;
+ << session_id << LL_ENDL;
const LLUseCircuitCodeResponder* responder =
(const LLUseCircuitCodeResponder*) user;
@@ -2041,7 +2038,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg,
}
else
{
- LL_WARNS("Messaging") << "Got zero circuit code in use_circuit_code" << llendl;
+ LL_WARNS("Messaging") << "Got zero circuit code in use_circuit_code" << LL_ENDL;
}
}
@@ -2063,7 +2060,7 @@ void LLMessageSystem::processError(LLMessageSystem* msg, void**)
LL_WARNS("Messaging") << "Message error from " << msg->getSender() << " - "
<< error_code << " " << error_token << " " << error_id << " \""
- << error_system << "\" \"" << error_message << "\"" << llendl;
+ << error_system << "\" \"" << error_message << "\"" << LL_ENDL;
}
@@ -2099,7 +2096,7 @@ void LLMessageSystem::dispatch(
gMessageSystem->mMessageTemplates.end()) &&
!LLMessageConfig::isValidMessage(msg_name))
{
- LL_WARNS("Messaging") << "Ignoring unknown message " << msg_name << llendl;
+ LL_WARNS("Messaging") << "Ignoring unknown message " << msg_name << LL_ENDL;
responsep->notFound("Invalid message name");
return;
}
@@ -2110,12 +2107,12 @@ void LLMessageSystem::dispatch(
if (!handler)
{
LL_WARNS("Messaging") << "LLMessageService::dispatch > no handler for "
- << path << llendl;
+ << path << LL_ENDL;
return;
}
// enable this for output of message names
- //LL_INFOS("Messaging") << "< \"" << msg_name << "\"" << llendl;
- //lldebugs << "data: " << LLSDNotationStreamer(message) << llendl;
+ //LL_INFOS("Messaging") << "< \"" << msg_name << "\"" << LL_ENDL;
+ //LL_DEBUGS() << "data: " << LLSDNotationStreamer(message) << LL_ENDL;
handler->post(responsep, context, message);
}
@@ -2233,7 +2230,7 @@ S32 LLMessageSystem::sendError(
else
{
LL_WARNS("Messaging") << "Data and message were too large -- data removed."
- << llendl;
+ << LL_ENDL;
addBinaryData("Data", NULL, 0);
}
return sendReliable(host);
@@ -2253,7 +2250,7 @@ void process_packet_ack(LLMessageSystem *msgsystem, void** /*user_data*/)
for (S32 i = 0; i < ack_count; i++)
{
msgsystem->getU32Fast(_PREHASH_Packets, _PREHASH_ID, packet_id, i);
-// LL_DEBUGS("Messaging") << "ack recvd' from " << host << " for packet " << (TPACKETID)packet_id << llendl;
+// LL_DEBUGS("Messaging") << "ack recvd' from " << host << " for packet " << (TPACKETID)packet_id << LL_ENDL;
cdp->ackReliablePacket(packet_id);
}
if (!cdp->getUnackedPacketCount())
@@ -2274,12 +2271,12 @@ void process_log_messages(LLMessageSystem* msg, void**)
if (log_message)
{
- LL_INFOS("Messaging") << "Starting logging via message" << llendl;
+ LL_INFOS("Messaging") << "Starting logging via message" << LL_ENDL;
msg->startLogging();
}
else
{
- LL_INFOS("Messaging") << "Stopping logging via message" << llendl;
+ LL_INFOS("Messaging") << "Stopping logging via message" << LL_ENDL;
msg->stopLogging();
}
}*/
@@ -2299,7 +2296,7 @@ void process_create_trusted_circuit(LLMessageSystem *msg, void **)
if (!cdp)
{
LL_WARNS("Messaging") << "Attempt to create trusted circuit without circuit data: "
- << msg->getSender() << llendl;
+ << msg->getSender() << LL_ENDL;
return;
}
@@ -2318,13 +2315,13 @@ void process_create_trusted_circuit(LLMessageSystem *msg, void **)
if( msg->getBlockUntrustedInterface() )
{
LL_WARNS("Messaging") << "Ignoring CreateTrustedCircuit on public interface from host: "
- << msg->getSender() << llendl;
+ << msg->getSender() << LL_ENDL;
return;
}
else
{
LL_WARNS("Messaging") << "Processing CreateTrustedCircuit on public interface from host: "
- << msg->getSender() << llendl;
+ << msg->getSender() << LL_ENDL;
}
}
@@ -2340,7 +2337,7 @@ void process_create_trusted_circuit(LLMessageSystem *msg, void **)
if(msg->isMatchingDigestForWindowAndUUIDs(their_digest, TRUST_TIME_WINDOW, local_id, remote_id))
{
cdp->setTrusted(TRUE);
- LL_INFOS("Messaging") << "Trusted digest from " << msg->getSender() << llendl;
+ LL_INFOS("Messaging") << "Trusted digest from " << msg->getSender() << LL_ENDL;
return;
}
else if (cdp->getTrusted())
@@ -2350,13 +2347,13 @@ void process_create_trusted_circuit(LLMessageSystem *msg, void **)
// the message system is being slow. Don't bother sending the deny, as it may continually
// ping-pong back and forth on a very hosed circuit.
LL_WARNS("Messaging") << "Ignoring bad digest from known trusted circuit: " << their_digest
- << " host: " << msg->getSender() << llendl;
+ << " host: " << msg->getSender() << LL_ENDL;
return;
}
else
{
LL_WARNS("Messaging") << "Bad digest from known circuit: " << their_digest
- << " host: " << msg->getSender() << llendl;
+ << " host: " << msg->getSender() << LL_ENDL;
msg->sendDenyTrustedCircuit(msg->getSender());
return;
}
@@ -2392,13 +2389,13 @@ void process_deny_trusted_circuit(LLMessageSystem *msg, void **)
if( msg->getBlockUntrustedInterface() )
{
LL_WARNS("Messaging") << "Ignoring DenyTrustedCircuit on public interface from host: "
- << msg->getSender() << llendl;
+ << msg->getSender() << LL_ENDL;
return;
}
else
{
LL_WARNS("Messaging") << "Processing DenyTrustedCircuit on public interface from host: "
- << msg->getSender() << llendl;
+ << msg->getSender() << LL_ENDL;
}
}
@@ -2411,7 +2408,7 @@ void process_deny_trusted_circuit(LLMessageSystem *msg, void **)
// *TODO: probably should keep a count of number of resends
// per circuit, and stop resending after a while.
LL_INFOS("Messaging") << "Got DenyTrustedCircuit. Sending CreateTrustedCircuit to "
- << msg->getSender() << llendl;
+ << msg->getSender() << LL_ENDL;
msg->sendCreateTrustedCircuit(msg->getSender(), local_id, remote_id);
}
@@ -2527,11 +2524,11 @@ bool start_messaging_system(
if (gMessageSystem->mMessageFileVersionNumber != gPrehashVersionNumber)
{
LL_INFOS("AppInit") << "Message template version does not match prehash version number" << LL_ENDL;
- LL_INFOS("AppInit") << "Run simulator with -prehash command line option to rebuild prehash data" << llendl;
+ LL_INFOS("AppInit") << "Run simulator with -prehash command line option to rebuild prehash data" << LL_ENDL;
}
else
{
- LL_DEBUGS("AppInit") << "Message template version matches prehash version number" << llendl;
+ LL_DEBUGS("AppInit") << "Message template version matches prehash version number" << LL_ENDL;
}
}
@@ -2577,7 +2574,7 @@ void LLMessageSystem::startLogging()
str << "\t<-\tincoming message" <<std::endl;
str << "\t->\toutgoing message" << std::endl;
str << " <> host size zero id name";
- LL_INFOS("Messaging") << str.str() << llendl;
+ LL_INFOS("Messaging") << str.str() << LL_ENDL;
}
void LLMessageSystem::stopLogging()
@@ -2585,7 +2582,7 @@ void LLMessageSystem::stopLogging()
if(mVerboseLog)
{
mVerboseLog = FALSE;
- LL_INFOS("Messaging") << "END MESSAGE LOG" << llendl;
+ LL_INFOS("Messaging") << "END MESSAGE LOG" << LL_ENDL;
}
}
@@ -2693,7 +2690,7 @@ void end_messaging_system(bool print_summary)
{
std::ostringstream str;
gMessageSystem->summarizeLogs(str);
- LL_INFOS("Messaging") << str.str().c_str() << llendl;
+ LL_INFOS("Messaging") << str.str().c_str() << LL_ENDL;
}
delete gMessageSystem;
@@ -2746,7 +2743,7 @@ void LLMessageSystem::dumpReceiveCounts()
if(mNumMessageCounts > 0)
{
- LL_DEBUGS("Messaging") << "Dump: " << mNumMessageCounts << " messages processed in " << mReceiveTime << " seconds" << llendl;
+ LL_DEBUGS("Messaging") << "Dump: " << mNumMessageCounts << " messages processed in " << mReceiveTime << " seconds" << LL_ENDL;
for (message_template_name_map_t::const_iterator iter = mMessageTemplates.begin(),
end = mMessageTemplates.end();
iter != end; iter++)
@@ -2755,7 +2752,7 @@ void LLMessageSystem::dumpReceiveCounts()
if (mt->mReceiveCount > 0)
{
LL_INFOS("Messaging") << "Num: " << std::setw(3) << mt->mReceiveCount << " Bytes: " << std::setw(6) << mt->mReceiveBytes
- << " Invalid: " << std::setw(3) << mt->mReceiveInvalid << " " << mt->mName << " " << llround(100 * mt->mDecodeTimeThisFrame / mReceiveTime) << "%" << llendl;
+ << " Invalid: " << std::setw(3) << mt->mReceiveInvalid << " " << mt->mName << " " << llround(100 * mt->mDecodeTimeThisFrame / mReceiveTime.value()) << "%" << LL_ENDL;
}
}
}
@@ -2872,7 +2869,7 @@ S32 LLMessageSystem::zeroCodeExpand(U8** data, S32* data_size)
if ((*data_size ) < LL_MINIMUM_VALID_PACKET_SIZE)
{
LL_WARNS("Messaging") << "zeroCodeExpand() called with data_size of " << *data_size
- << llendl;
+ << LL_ENDL;
}
mTotalBytesIn += *data_size;
@@ -2911,7 +2908,7 @@ S32 LLMessageSystem::zeroCodeExpand(U8** data, S32* data_size)
{
if (outptr > (&mEncodedRecvBuffer[MAX_BUFFER_SIZE-1]))
{
- LL_WARNS("Messaging") << "attempt to write past reasonable encoded buffer size 1" << llendl;
+ LL_WARNS("Messaging") << "attempt to write past reasonable encoded buffer size 1" << LL_ENDL;
callExceptionFunc(MX_WROTE_PAST_BUFFER_SIZE);
outptr = mEncodedRecvBuffer;
break;
@@ -2923,7 +2920,7 @@ S32 LLMessageSystem::zeroCodeExpand(U8** data, S32* data_size)
*outptr++ = *inptr++;
if (outptr > (&mEncodedRecvBuffer[MAX_BUFFER_SIZE-256]))
{
- LL_WARNS("Messaging") << "attempt to write past reasonable encoded buffer size 2" << llendl;
+ LL_WARNS("Messaging") << "attempt to write past reasonable encoded buffer size 2" << LL_ENDL;
callExceptionFunc(MX_WROTE_PAST_BUFFER_SIZE);
outptr = mEncodedRecvBuffer;
count = -1;
@@ -2942,7 +2939,7 @@ S32 LLMessageSystem::zeroCodeExpand(U8** data, S32* data_size)
{
if (outptr > (&mEncodedRecvBuffer[MAX_BUFFER_SIZE-(*inptr)]))
{
- LL_WARNS("Messaging") << "attempt to write past reasonable encoded buffer size 3" << llendl;
+ LL_WARNS("Messaging") << "attempt to write past reasonable encoded buffer size 3" << LL_ENDL;
callExceptionFunc(MX_WROTE_PAST_BUFFER_SIZE);
outptr = mEncodedRecvBuffer;
}
@@ -2966,7 +2963,7 @@ void LLMessageSystem::addTemplate(LLMessageTemplate *templatep)
if (mMessageTemplates.count(templatep->mName) > 0)
{
LL_ERRS("Messaging") << templatep->mName << " already used as a template name!"
- << llendl;
+ << LL_ENDL;
}
mMessageTemplates[templatep->mName] = templatep;
mMessageNumbers[templatep->mMessageNumber] = templatep;
@@ -2982,7 +2979,7 @@ void LLMessageSystem::setHandlerFuncFast(const char *name, void (*handler_func)(
}
else
{
- LL_ERRS("Messaging") << name << " is not a known message name!" << llendl;
+ LL_ERRS("Messaging") << name << " is not a known message name!" << LL_ENDL;
}
}
@@ -2995,7 +2992,7 @@ bool LLMessageSystem::callHandler(const char *name,
if(iter == mMessageTemplates.end())
{
LL_WARNS("Messaging") << "LLMessageSystem::callHandler: unknown message "
- << name << llendl;
+ << name << LL_ENDL;
return false;
}
@@ -3006,7 +3003,7 @@ bool LLMessageSystem::callHandler(const char *name,
<< name
<< " from "
<< (trustedSource ? "trusted " : "untrusted ")
- << "source" << llendl;
+ << "source" << LL_ENDL;
return false;
}
@@ -3042,7 +3039,7 @@ BOOL LLMessageSystem::callExceptionFunc(EMessageException exception)
if (!ex_cb)
{
- LL_WARNS("Messaging") << "LLMessageSystem::callExceptionFunc: bad message exception callback." << llendl;
+ LL_WARNS("Messaging") << "LLMessageSystem::callExceptionFunc: bad message exception callback." << LL_ENDL;
return FALSE;
}
@@ -3153,7 +3150,7 @@ bool LLMessageSystem::generateDigestForWindowAndUUIDs(char* digest, const S32 wi
std::string shared_secret = get_shared_secret();
if(shared_secret.empty())
{
- LL_ERRS("Messaging") << "Trying to generate complex digest on a machine without a shared secret!" << llendl;
+ LL_ERRS("Messaging") << "Trying to generate complex digest on a machine without a shared secret!" << LL_ENDL;
}
U32 now = (U32)time(NULL);
@@ -3172,7 +3169,7 @@ bool LLMessageSystem::isMatchingDigestForWindowAndUUIDs(const char* digest, cons
std::string shared_secret = get_shared_secret();
if(shared_secret.empty())
{
- LL_ERRS("Messaging") << "Trying to compare complex digests on a machine without a shared secret!" << llendl;
+ LL_ERRS("Messaging") << "Trying to compare complex digests on a machine without a shared secret!" << LL_ENDL;
}
char our_digest[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */
@@ -3219,7 +3216,7 @@ bool LLMessageSystem::generateDigestForWindow(char* digest, const S32 window) co
std::string shared_secret = get_shared_secret();
if(shared_secret.empty())
{
- LL_ERRS("Messaging") << "Trying to generate simple digest on a machine without a shared secret!" << llendl;
+ LL_ERRS("Messaging") << "Trying to generate simple digest on a machine without a shared secret!" << LL_ENDL;
}
U32 now = (U32)time(NULL);
@@ -3238,7 +3235,7 @@ bool LLMessageSystem::isMatchingDigestForWindow(const char* digest, S32 const wi
std::string shared_secret = get_shared_secret();
if(shared_secret.empty())
{
- LL_ERRS("Messaging") << "Trying to compare simple digests on a machine without a shared secret!" << llendl;
+ LL_ERRS("Messaging") << "Trying to compare simple digests on a machine without a shared secret!" << LL_ENDL;
}
char our_digest[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */
@@ -3272,12 +3269,12 @@ void LLMessageSystem::sendCreateTrustedCircuit(const LLHost &host, const LLUUID
char digest[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */
if (id1.isNull())
{
- LL_WARNS("Messaging") << "Can't send CreateTrustedCircuit to " << host << " because we don't have the local end point ID" << llendl;
+ LL_WARNS("Messaging") << "Can't send CreateTrustedCircuit to " << host << " because we don't have the local end point ID" << LL_ENDL;
return;
}
if (id2.isNull())
{
- LL_WARNS("Messaging") << "Can't send CreateTrustedCircuit to " << host << " because we don't have the remote end point ID" << llendl;
+ LL_WARNS("Messaging") << "Can't send CreateTrustedCircuit to " << host << " because we don't have the remote end point ID" << LL_ENDL;
return;
}
generateDigestForWindowAndUUIDs(digest, TRUST_TIME_WINDOW, id1, id2);
@@ -3285,7 +3282,7 @@ void LLMessageSystem::sendCreateTrustedCircuit(const LLHost &host, const LLUUID
nextBlockFast(_PREHASH_DataBlock);
addUUIDFast(_PREHASH_EndPointID, id1);
addBinaryDataFast(_PREHASH_Digest, digest, MD5HEX_STR_BYTES);
- LL_INFOS("Messaging") << "xmitting digest: " << digest << " Host: " << host << llendl;
+ LL_INFOS("Messaging") << "xmitting digest: " << digest << " Host: " << host << LL_ENDL;
sendMessage(host);
}
@@ -3299,10 +3296,10 @@ void LLMessageSystem::reallySendDenyTrustedCircuit(const LLHost &host)
LLCircuitData *cdp = mCircuitInfo.findCircuit(host);
if (!cdp)
{
- LL_WARNS("Messaging") << "Not sending DenyTrustedCircuit to host without a circuit." << llendl;
+ LL_WARNS("Messaging") << "Not sending DenyTrustedCircuit to host without a circuit." << LL_ENDL;
return;
}
- LL_INFOS("Messaging") << "Sending DenyTrustedCircuit to " << host << llendl;
+ LL_INFOS("Messaging") << "Sending DenyTrustedCircuit to " << host << LL_ENDL;
newMessageFast(_PREHASH_DenyTrustedCircuit);
nextBlockFast(_PREHASH_DataBlock);
addUUIDFast(_PREHASH_EndPointID, cdp->getLocalEndPointID());
@@ -3323,7 +3320,7 @@ void LLMessageSystem::establishBidirectionalTrust(const LLHost &host, S64 frame_
std::string shared_secret = get_shared_secret();
if(shared_secret.empty())
{
- LL_ERRS("Messaging") << "Trying to establish bidirectional trust on a machine without a shared secret!" << llendl;
+ LL_ERRS("Messaging") << "Trying to establish bidirectional trust on a machine without a shared secret!" << LL_ENDL;
}
LLTimer timeout;
@@ -3375,8 +3372,8 @@ void LLMessageSystem::establishBidirectionalTrust(const LLHost &host, S64 frame_
void LLMessageSystem::dumpPacketToLog()
{
- LL_WARNS("Messaging") << "Packet Dump from:" << mPacketRing.getLastSender() << llendl;
- LL_WARNS("Messaging") << "Packet Size:" << mTrueReceiveSize << llendl;
+ LL_WARNS("Messaging") << "Packet Dump from:" << mPacketRing.getLastSender() << LL_ENDL;
+ LL_WARNS("Messaging") << "Packet Size:" << mTrueReceiveSize << LL_ENDL;
char line_buffer[256]; /* Flawfinder: ignore */
S32 i;
S32 cur_line_pos = 0;
@@ -3391,27 +3388,27 @@ void LLMessageSystem::dumpPacketToLog()
if (cur_line_pos >= 16)
{
cur_line_pos = 0;
- LL_WARNS("Messaging") << "PD:" << cur_line << "PD:" << line_buffer << llendl;
+ LL_WARNS("Messaging") << "PD:" << cur_line << "PD:" << line_buffer << LL_ENDL;
cur_line++;
}
}
if (cur_line_pos)
{
- LL_WARNS("Messaging") << "PD:" << cur_line << "PD:" << line_buffer << llendl;
+ LL_WARNS("Messaging") << "PD:" << cur_line << "PD:" << line_buffer << LL_ENDL;
}
}
//static
-U64 LLMessageSystem::getMessageTimeUsecs(const BOOL update)
+U64Microseconds LLMessageSystem::getMessageTimeUsecs(const BOOL update)
{
if (gMessageSystem)
{
if (update)
{
- gMessageSystem->mCurrentMessageTimeSeconds = totalTime()*SEC_PER_USEC;
+ gMessageSystem->mCurrentMessageTime = totalTime();
}
- return (U64)(gMessageSystem->mCurrentMessageTimeSeconds * USEC_PER_SEC);
+ return gMessageSystem->mCurrentMessageTime;
}
else
{
@@ -3420,19 +3417,19 @@ U64 LLMessageSystem::getMessageTimeUsecs(const BOOL update)
}
//static
-F64 LLMessageSystem::getMessageTimeSeconds(const BOOL update)
+F64Seconds LLMessageSystem::getMessageTimeSeconds(const BOOL update)
{
if (gMessageSystem)
{
if (update)
{
- gMessageSystem->mCurrentMessageTimeSeconds = totalTime()*SEC_PER_USEC;
+ gMessageSystem->mCurrentMessageTime = totalTime();
}
- return gMessageSystem->mCurrentMessageTimeSeconds;
+ return gMessageSystem->mCurrentMessageTime;
}
else
{
- return totalTime()*SEC_PER_USEC;
+ return F64Seconds(totalTime());
}
}
@@ -3941,7 +3938,7 @@ void LLMessageSystem::getStringFast(const char *block, const char *var,
{
if(buffer_size <= 0)
{
- LL_WARNS("Messaging") << "buffer_size <= 0" << llendl;
+ LL_WARNS("Messaging") << "buffer_size <= 0" << LL_ENDL;
}
mMessageReader->getString(block, var, buffer_size, s, blocknum);
}
@@ -4050,7 +4047,7 @@ void LLMessageSystem::banUdpMessage(const std::string& name)
}
else
{
- llwarns << "Attempted to ban an unknown message: " << name << "." << llendl;
+ LL_WARNS() << "Attempted to ban an unknown message: " << name << "." << LL_ENDL;
}
}
const LLHost& LLMessageSystem::getSender() const
diff --git a/indra/llmessage/message.h b/indra/llmessage/message.h
index 1589ea29c1..da06b64506 100755
--- a/indra/llmessage/message.h
+++ b/indra/llmessage/message.h
@@ -45,14 +45,14 @@
#include "llerror.h"
#include "net.h"
-#include "string_table.h"
+#include "llstringtable.h"
#include "llcircuit.h"
#include "lltimer.h"
#include "llpacketring.h"
#include "llhost.h"
-#include "llhttpclient.h"
+#include "llcurl.h"
#include "llhttpnode.h"
-#include "llpacketack.h"
+//#include "llpacketack.h"
#include "llsingleton.h"
#include "message_prehash.h"
#include "llstl.h"
@@ -142,23 +142,18 @@ enum EPacketHeaderLayout
const S32 LL_DEFAULT_RELIABLE_RETRIES = 3;
-const F32 LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS = 1.f;
-const F32 LL_MINIMUM_SEMIRELIABLE_TIMEOUT_SECONDS = 1.f;
-const F32 LL_PING_BASED_TIMEOUT_DUMMY = 0.0f;
-
-// *NOTE: Maybe these factors shouldn't include the msec to sec conversion
-// implicitly.
-// However, all units should be MKS.
-const F32 LL_SEMIRELIABLE_TIMEOUT_FACTOR = 5.f / 1000.f; // factor * averaged ping
-const F32 LL_RELIABLE_TIMEOUT_FACTOR = 5.f / 1000.f; // factor * averaged ping
-const F32 LL_FILE_XFER_TIMEOUT_FACTOR = 5.f / 1000.f; // factor * averaged ping
-const F32 LL_LOST_TIMEOUT_FACTOR = 16.f / 1000.f; // factor * averaged ping for marking packets "Lost"
-const F32 LL_MAX_LOST_TIMEOUT = 5.f; // Maximum amount of time before considering something "lost"
+const F32Seconds LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS(1.f);
+const F32Seconds LL_MINIMUM_SEMIRELIABLE_TIMEOUT_SECONDS(1.f);
+const F32Seconds LL_PING_BASED_TIMEOUT_DUMMY(0.0f);
+
+const F32 LL_SEMIRELIABLE_TIMEOUT_FACTOR = 5.f; // averaged ping
+const F32 LL_RELIABLE_TIMEOUT_FACTOR = 5.f; // averaged ping
+const F32 LL_LOST_TIMEOUT_FACTOR = 16.f; // averaged ping for marking packets "Lost"
+const F32Seconds LL_MAX_LOST_TIMEOUT(5.f); // Maximum amount of time before considering something "lost"
const S32 MAX_MESSAGE_COUNT_NUM = 1024;
// Forward declarations
-class LLCircuit;
class LLVector3;
class LLVector4;
class LLVector3d;
@@ -214,19 +209,19 @@ class LLMessageSystem : public LLMessageSenderInterface
public:
LLPacketRing mPacketRing;
- LLReliablePacketParams mReliablePacketParams;
+ LLReliablePacketParams mReliablePacketParams;
// Set this flag to TRUE when you want *very* verbose logs.
- BOOL mVerboseLog;
+ BOOL mVerboseLog;
- F32 mMessageFileVersionNumber;
+ F32 mMessageFileVersionNumber;
typedef std::map<const char *, LLMessageTemplate*> message_template_name_map_t;
typedef std::map<U32, LLMessageTemplate*> message_template_number_map_t;
private:
message_template_name_map_t mMessageTemplates;
- message_template_number_map_t mMessageNumbers;
+ message_template_number_map_t mMessageNumbers;
public:
S32 mSystemVersionMajor;
@@ -235,7 +230,7 @@ public:
S32 mSystemVersionServer;
U32 mVersionFlags;
- BOOL mbProtected;
+ BOOL mbProtected;
U32 mNumberHighFreqMessages;
U32 mNumberMediumFreqMessages;
@@ -255,11 +250,11 @@ public:
U32 mReliablePacketsIn; // total reliable packets in
U32 mReliablePacketsOut; // total reliable packets out
- U32 mDroppedPackets; // total dropped packets in
- U32 mResentPackets; // total resent packets out
- U32 mFailedResendPackets; // total resend failure packets out
- U32 mOffCircuitPackets; // total # of off-circuit packets rejected
- U32 mInvalidOnCircuitPackets; // total # of on-circuit but invalid packets rejected
+ U32 mDroppedPackets; // total dropped packets in
+ U32 mResentPackets; // total resent packets out
+ U32 mFailedResendPackets; // total resend failure packets out
+ U32 mOffCircuitPackets; // total # of off-circuit packets rejected
+ U32 mInvalidOnCircuitPackets; // total # of on-circuit but invalid packets rejected
S64 mUncompressedBytesIn; // total uncompressed size of compressed packets in
S64 mUncompressedBytesOut; // total uncompressed size of compressed packets out
@@ -268,14 +263,14 @@ public:
S64 mTotalBytesIn; // total size of all uncompressed packets in
S64 mTotalBytesOut; // total size of all uncompressed packets out
- BOOL mSendReliable; // does the outgoing message require a pos ack?
+ BOOL mSendReliable; // does the outgoing message require a pos ack?
- LLCircuit mCircuitInfo;
- F64 mCircuitPrintTime; // used to print circuit debug info every couple minutes
- F32 mCircuitPrintFreq; // seconds
+ LLCircuit mCircuitInfo;
+ F64Seconds mCircuitPrintTime; // used to print circuit debug info every couple minutes
+ F32Seconds mCircuitPrintFreq;
- std::map<U64, U32> mIPPortToCircuitCode;
- std::map<U32, U64> mCircuitCodeToIPPort;
+ std::map<U64, U32> mIPPortToCircuitCode;
+ std::map<U32, U64> mCircuitCodeToIPPort;
U32 mOurCircuitCode;
S32 mSendPacketFailureCount;
S32 mUnackedListDepth;
@@ -470,7 +465,7 @@ public:
S32 sendReliable( const LLHost &host,
S32 retries,
BOOL ping_based_retries,
- F32 timeout,
+ F32Seconds timeout,
void (*callback)(void **,S32),
void ** callback_data);
@@ -490,11 +485,11 @@ public:
const LLHost &host,
S32 retries,
BOOL ping_based_timeout,
- F32 timeout,
+ F32Seconds timeout,
void (*callback)(void **,S32),
void ** callback_data);
- LLHTTPClient::ResponderPtr createResponder(const std::string& name);
+ LLCurl::ResponderPtr createResponder(const std::string& name);
S32 sendMessage(const LLHost &host);
S32 sendMessage(const U32 circuit);
private:
@@ -657,8 +652,8 @@ public:
S32 getSize(const char *blockname, S32 blocknum, const char *varname) const;
void resetReceiveCounts(); // resets receive counts for all message types to 0
- void dumpReceiveCounts(); // dumps receive count for each message type to llinfos
- void dumpCircuitInfo(); // Circuit information to llinfos
+ void dumpReceiveCounts(); // dumps receive count for each message type to LL_INFOS()
+ void dumpCircuitInfo(); // Circuit information to LL_INFOS()
BOOL isClear() const; // returns mbSClear;
S32 flush(const LLHost &host);
@@ -684,8 +679,8 @@ public:
void setMaxMessageTime(const F32 seconds); // Max time to process messages before warning and dumping (neg to disable)
void setMaxMessageCounts(const S32 num); // Max number of messages before dumping (neg to disable)
- static U64 getMessageTimeUsecs(const BOOL update = FALSE); // Get the current message system time in microseconds
- static F64 getMessageTimeSeconds(const BOOL update = FALSE); // Get the current message system time in seconds
+ static U64Microseconds getMessageTimeUsecs(const BOOL update = FALSE); // Get the current message system time in microseconds
+ static F64Seconds getMessageTimeSeconds(const BOOL update = FALSE); // Get the current message system time in seconds
static void setTimeDecodes(BOOL b);
static void setTimeDecodesSpamThreshold(F32 seconds);
@@ -784,16 +779,16 @@ private:
BOOL mbError;
S32 mErrorCode;
- F64 mResendDumpTime; // The last time we dumped resends
+ F64Seconds mResendDumpTime; // The last time we dumped resends
LLMessageCountInfo mMessageCountList[MAX_MESSAGE_COUNT_NUM];
S32 mNumMessageCounts;
- F32 mReceiveTime;
- F32 mMaxMessageTime; // Max number of seconds for processing messages
+ F32Seconds mReceiveTime;
+ F32Seconds mMaxMessageTime; // Max number of seconds for processing messages
S32 mMaxMessageCounts; // Max number of messages to process before dumping.
- F64 mMessageCountTime;
+ F64Seconds mMessageCountTime;
- F64 mCurrentMessageTimeSeconds; // The current "message system time" (updated the first call to checkMessages after a resetReceiveCount
+ F64Seconds mCurrentMessageTime; // The current "message system time" (updated the first call to checkMessages after a resetReceiveCount
// message system exceptions
typedef std::pair<msg_exception_callback, void*> exception_t;
@@ -888,7 +883,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type,
case MVT_S16:
if (n != 2)
{
- llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl;
+ LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL;
}
#ifdef LL_BIG_ENDIAN
*(s + 1) = *(ct);
@@ -903,7 +898,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type,
case MVT_F32:
if (n != 4)
{
- llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl;
+ LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL;
}
#ifdef LL_BIG_ENDIAN
*(s + 3) = *(ct);
@@ -920,7 +915,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type,
case MVT_F64:
if (n != 8)
{
- llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl;
+ LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL;
}
#ifdef LL_BIG_ENDIAN
*(s + 7) = *(ct);
@@ -940,7 +935,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type,
case MVT_LLQuaternion: // We only send x, y, z and infer w (we set x, y, z to ensure that w >= 0)
if (n != 12)
{
- llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl;
+ LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL;
}
#ifdef LL_BIG_ENDIAN
htonmemcpy(s + 8, ct + 8, MVT_F32, 4);
@@ -953,7 +948,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type,
case MVT_LLVector3d:
if (n != 24)
{
- llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl;
+ LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL;
}
#ifdef LL_BIG_ENDIAN
htonmemcpy(s + 16, ct + 16, MVT_F64, 8);
@@ -966,7 +961,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type,
case MVT_LLVector4:
if (n != 16)
{
- llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl;
+ LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL;
}
#ifdef LL_BIG_ENDIAN
htonmemcpy(s + 12, ct + 12, MVT_F32, 4);
@@ -980,7 +975,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type,
case MVT_U16Vec3:
if (n != 6)
{
- llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl;
+ LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL;
}
#ifdef LL_BIG_ENDIAN
htonmemcpy(s + 4, ct + 4, MVT_U16, 2);
@@ -993,7 +988,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type,
case MVT_U16Quat:
if (n != 8)
{
- llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl;
+ LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL;
}
#ifdef LL_BIG_ENDIAN
htonmemcpy(s + 6, ct + 6, MVT_U16, 2);
@@ -1007,7 +1002,7 @@ static inline void *htonmemcpy(void *vs, const void *vct, EMsgVariableType type,
case MVT_S16Array:
if (n % 2)
{
- llerrs << "Size argument passed to htonmemcpy doesn't match swizzle type size" << llendl;
+ LL_ERRS() << "Size argument passed to htonmemcpy doesn't match swizzle type size" << LL_ENDL;
}
#ifdef LL_BIG_ENDIAN
length = n % 2;
diff --git a/indra/llmessage/message_string_table.cpp b/indra/llmessage/message_string_table.cpp
index dd063fcb83..e4f5fb3a38 100755
--- a/indra/llmessage/message_string_table.cpp
+++ b/indra/llmessage/message_string_table.cpp
@@ -80,10 +80,10 @@ char* LLMessageStringTable::getString(const char *str)
if (mUsed >= MESSAGE_NUMBER_OF_HASH_BUCKETS - 1)
{
U32 i;
- llinfos << "Dumping string table before crashing on HashTable full!" << llendl;
+ LL_INFOS() << "Dumping string table before crashing on HashTable full!" << LL_ENDL;
for (i = 0; i < MESSAGE_NUMBER_OF_HASH_BUCKETS; i++)
{
- llinfos << "Entry #" << i << ": " << mString[i] << llendl;
+ LL_INFOS() << "Entry #" << i << ": " << mString[i] << LL_ENDL;
}
}
return mString[hash_value];
diff --git a/indra/llmessage/net.cpp b/indra/llmessage/net.cpp
index 85aef5da00..523bcbb60d 100755
--- a/indra/llmessage/net.cpp
+++ b/indra/llmessage/net.cpp
@@ -26,15 +26,13 @@
#include "linden_common.h"
-#include "net.h"
+//#include "net.h"
// system library includes
#include <stdexcept>
#if LL_WINDOWS
- #define WIN32_LEAN_AND_MEAN
- #include <winsock2.h>
- #include <windows.h>
+#include "llwin32headerslean.h"
#else
#include <sys/types.h>
#include <sys/socket.h>
@@ -175,7 +173,7 @@ U32 ip_string_to_u32(const char* ip_string)
if (ip == INADDR_NONE
&& strncmp(ip_string, BROADCAST_ADDRESS_STRING, MAXADDRSTR) != 0)
{
- llwarns << "ip_string_to_u32() failed, Error: Invalid IP string '" << ip_string << "'" << llendl;
+ LL_WARNS() << "ip_string_to_u32() failed, Error: Invalid IP string '" << ip_string << "'" << LL_ENDL;
return INVALID_HOST_IP_ADDRESS;
}
return ip;
@@ -334,7 +332,7 @@ S32 receive_packet(int hSocket, char * receiveBuffer)
return 0;
if (WSAECONNRESET == WSAGetLastError())
return 0;
- llinfos << "receivePacket() failed, Error: " << WSAGetLastError() << llendl;
+ LL_INFOS() << "receivePacket() failed, Error: " << WSAGetLastError() << LL_ENDL;
}
return nRet;
@@ -368,8 +366,8 @@ BOOL send_packet(int hSocket, const char *sendBuffer, int size, U32 recipient, i
{
return TRUE;
}
- llinfos << "sendto() failed to " << u32_to_ip_string(recipient) << ":" << nPort
- << ", Error " << last_error << llendl;
+ LL_INFOS() << "sendto() failed to " << u32_to_ip_string(recipient) << ":" << nPort
+ << ", Error " << last_error << LL_ENDL;
}
}
} while ( (nRet == SOCKET_ERROR)
@@ -397,7 +395,7 @@ S32 start_net(S32& socket_out, int& nPort)
hSocket = socket(AF_INET, SOCK_DGRAM, 0);
if (hSocket < 0)
{
- llwarns << "socket() failed" << llendl;
+ LL_WARNS() << "socket() failed" << LL_ENDL;
return 1;
}
@@ -408,21 +406,21 @@ S32 start_net(S32& socket_out, int& nPort)
stLclAddr.sin_family = AF_INET;
stLclAddr.sin_addr.s_addr = htonl(INADDR_ANY);
stLclAddr.sin_port = htons(0);
- llinfos << "attempting to connect on OS assigned port" << llendl;
+ LL_INFOS() << "attempting to connect on OS assigned port" << LL_ENDL;
nRet = bind(hSocket, (struct sockaddr*) &stLclAddr, sizeof(stLclAddr));
if (nRet < 0)
{
- llwarns << "Failed to bind on an OS assigned port error: "
- << nRet << llendl;
+ LL_WARNS() << "Failed to bind on an OS assigned port error: "
+ << nRet << LL_ENDL;
}
else
{
sockaddr_in socket_info;
socklen_t len = sizeof(sockaddr_in);
int err = getsockname(hSocket, (sockaddr*)&socket_info, &len);
- llinfos << "Get socket returned: " << err << " length " << len << llendl;
+ LL_INFOS() << "Get socket returned: " << err << " length " << len << LL_ENDL;
nPort = ntohs(socket_info.sin_port);
- llinfos << "Assigned port: " << nPort << llendl;
+ LL_INFOS() << "Assigned port: " << nPort << LL_ENDL;
}
}
@@ -433,7 +431,7 @@ S32 start_net(S32& socket_out, int& nPort)
stLclAddr.sin_addr.s_addr = htonl(INADDR_ANY);
stLclAddr.sin_port = htons(nPort);
U32 attempt_port = nPort;
- llinfos << "attempting to connect on port " << attempt_port << llendl;
+ LL_INFOS() << "attempting to connect on port " << attempt_port << LL_ENDL;
nRet = bind(hSocket, (struct sockaddr*) &stLclAddr, sizeof(stLclAddr));
if (nRet < 0)
@@ -447,7 +445,7 @@ S32 start_net(S32& socket_out, int& nPort)
attempt_port++)
{
stLclAddr.sin_port = htons(attempt_port);
- llinfos << "trying port " << attempt_port << llendl;
+ LL_INFOS() << "trying port " << attempt_port << LL_ENDL;
nRet = bind(hSocket, (struct sockaddr*) &stLclAddr, sizeof(stLclAddr));
if (!((nRet < 0) && (errno == EADDRINUSE)))
{
@@ -456,7 +454,7 @@ S32 start_net(S32& socket_out, int& nPort)
}
if (nRet < 0)
{
- llwarns << "startNet() : Couldn't find available network port." << llendl;
+ LL_WARNS() << "startNet() : Couldn't find available network port." << LL_ENDL;
// Fail gracefully in release.
return 3;
}
@@ -464,12 +462,12 @@ S32 start_net(S32& socket_out, int& nPort)
// Some other socket error
else
{
- llwarns << llformat ("bind() port: %d failed, Err: %s\n", nPort, strerror(errno)) << llendl;
+ LL_WARNS() << llformat ("bind() port: %d failed, Err: %s\n", nPort, strerror(errno)) << LL_ENDL;
// Fail gracefully in release.
return 4;
}
}
- llinfos << "connected on port " << attempt_port << llendl;
+ LL_INFOS() << "connected on port " << attempt_port << LL_ENDL;
nPort = attempt_port;
}
// Set socket to be non-blocking
@@ -478,18 +476,18 @@ S32 start_net(S32& socket_out, int& nPort)
nRet = setsockopt(hSocket, SOL_SOCKET, SO_RCVBUF, (char *)&rec_size, buff_size);
if (nRet)
{
- llinfos << "Can't set receive size!" << llendl;
+ LL_INFOS() << "Can't set receive size!" << LL_ENDL;
}
nRet = setsockopt(hSocket, SOL_SOCKET, SO_SNDBUF, (char *)&snd_size, buff_size);
if (nRet)
{
- llinfos << "Can't set send size!" << llendl;
+ LL_INFOS() << "Can't set send size!" << LL_ENDL;
}
getsockopt(hSocket, SOL_SOCKET, SO_RCVBUF, (char *)&rec_size, &buff_size);
getsockopt(hSocket, SOL_SOCKET, SO_SNDBUF, (char *)&snd_size, &buff_size);
- llinfos << "startNet - receive buffer size : " << rec_size << llendl;
- llinfos << "startNet - send buffer size : " << snd_size << llendl;
+ LL_INFOS() << "startNet - receive buffer size : " << rec_size << LL_ENDL;
+ LL_INFOS() << "startNet - send buffer size : " << snd_size << LL_ENDL;
#if LL_LINUX
// Turn on recipient address tracking
@@ -497,11 +495,11 @@ S32 start_net(S32& socket_out, int& nPort)
int use_pktinfo = 1;
if( setsockopt( hSocket, SOL_IP, IP_PKTINFO, &use_pktinfo, sizeof(use_pktinfo) ) == -1 )
{
- llwarns << "No IP_PKTINFO available" << llendl;
+ LL_WARNS() << "No IP_PKTINFO available" << LL_ENDL;
}
else
{
- llinfos << "IP_PKKTINFO enabled" << llendl;
+ LL_INFOS() << "IP_PKKTINFO enabled" << LL_ENDL;
}
}
#endif
@@ -595,7 +593,7 @@ int receive_packet(int hSocket, char * receiveBuffer)
}
// Uncomment for testing if/when implementing for Mac or Windows:
- // llinfos << "Received datagram to in addr " << u32_to_ip_string(get_receiving_interface_ip()) << llendl;
+ // LL_INFOS() << "Received datagram to in addr " << u32_to_ip_string(get_receiving_interface_ip()) << LL_ENDL;
return nRet;
}
@@ -629,22 +627,22 @@ BOOL send_packet(int hSocket, const char * sendBuffer, int size, U32 recipient,
if (errno == EAGAIN)
{
// say nothing, just repeat send
- llinfos << "sendto() reported buffer full, resending (attempt " << send_attempts << ")" << llendl;
- llinfos << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << llendl;
+ LL_INFOS() << "sendto() reported buffer full, resending (attempt " << send_attempts << ")" << LL_ENDL;
+ LL_INFOS() << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << LL_ENDL;
resend = TRUE;
}
else if (errno == ECONNREFUSED)
{
// response to ICMP connection refused message on earlier send
- llinfos << "sendto() reported connection refused, resending (attempt " << send_attempts << ")" << llendl;
- llinfos << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << llendl;
+ LL_INFOS() << "sendto() reported connection refused, resending (attempt " << send_attempts << ")" << LL_ENDL;
+ LL_INFOS() << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << LL_ENDL;
resend = TRUE;
}
else
{
// some other error
- llinfos << "sendto() failed: " << errno << ", " << strerror(errno) << llendl;
- llinfos << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << llendl;
+ LL_INFOS() << "sendto() failed: " << errno << ", " << strerror(errno) << LL_ENDL;
+ LL_INFOS() << inet_ntoa(stDstAddr.sin_addr) << ":" << nPort << LL_ENDL;
resend = FALSE;
}
}
@@ -653,7 +651,7 @@ BOOL send_packet(int hSocket, const char * sendBuffer, int size, U32 recipient,
if (send_attempts >= 3)
{
- llinfos << "sendPacket() bailed out of send!" << llendl;
+ LL_INFOS() << "sendPacket() bailed out of send!" << LL_ENDL;
return FALSE;
}
diff --git a/indra/llmessage/net.h b/indra/llmessage/net.h
index 0f2437479d..beb67bae4e 100755
--- a/indra/llmessage/net.h
+++ b/indra/llmessage/net.h
@@ -67,5 +67,8 @@ const S32 ETHERNET_MTU_BYTES = 1500;
const S32 MTUBITS = MTUBYTES*8;
const S32 MTUU32S = MTUBITS/32;
+// For automatic port discovery when running multiple viewers on one host
+const U32 PORT_DISCOVERY_RANGE_MIN = 13000;
+const U32 PORT_DISCOVERY_RANGE_MAX = PORT_DISCOVERY_RANGE_MIN + 50;
#endif
diff --git a/indra/llmessage/partsyspacket.cpp b/indra/llmessage/partsyspacket.cpp
index ad21614258..d87de38aa5 100755
--- a/indra/llmessage/partsyspacket.cpp
+++ b/indra/llmessage/partsyspacket.cpp
@@ -28,7 +28,7 @@
#include "linden_common.h"
#include "partsyspacket.h"
-#include "imageids.h"
+#include "indra_constants.h"
// this function is global
void gSetInitDataDefaults(LLPartInitData *setMe)
@@ -1272,7 +1272,7 @@ BOOL LLPartSysCompressedPacket::fromUnsignedBytes(U8 *in, U32 bytesUsed)
}
else
{
- llerrs << "NULL input data or number of bytes exceed mData size" << llendl;
+ LL_ERRS() << "NULL input data or number of bytes exceed mData size" << LL_ENDL;
return FALSE;
}
}
diff --git a/indra/llmessage/patch_code.cpp b/indra/llmessage/patch_code.cpp
index e5d7f19448..32f8d80782 100755
--- a/indra/llmessage/patch_code.cpp
+++ b/indra/llmessage/patch_code.cpp
@@ -31,7 +31,7 @@
#include "v3math.h"
#include "patch_dct.h"
#include "patch_code.h"
-#include "bitpack.h"
+#include "llbitpack.h"
U32 gPatchSize, gWordBits;
@@ -88,7 +88,7 @@ void code_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, S32 *patch)
if ( (wbits > 17)
||(wbits < 2))
{
- llerrs << "Bits needed per word in code_patch_header out of legal range. Adjust compression quatization." << llendl;
+ LL_ERRS() << "Bits needed per word in code_patch_header out of legal range. Adjust compression quatization." << LL_ENDL;
}
ph->quant_wbits |= (wbits - 2);
@@ -135,7 +135,7 @@ void code_patch(LLBitPack &bitpack, S32 *patch, S32 postquant)
if ( (postquant > patch_size*patch_size)
||(postquant < 0))
{
- llerrs << "Bad postquant in code_patch!" << llendl;
+ LL_ERRS() << "Bad postquant in code_patch!" << LL_ENDL;
}
if (postquant)
diff --git a/indra/llmessage/tests/llareslistener_test.cpp b/indra/llmessage/tests/llareslistener_test.cpp
index 60c91e12cf..c04696c86b 100755
--- a/indra/llmessage/tests/llareslistener_test.cpp
+++ b/indra/llmessage/tests/llareslistener_test.cpp
@@ -135,7 +135,7 @@ namespace tut
void object::test<2>()
{
set_test_name("bad op");
- WrapLL_ERRS capture;
+ WrapLLErrs capture;
LLSD request;
request["op"] = "foo";
std::string threw;
@@ -143,7 +143,7 @@ namespace tut
{
LLEventPumps::instance().obtain("LLAres").post(request);
}
- catch (const WrapLL_ERRS::FatalException& e)
+ catch (const WrapLLErrs::FatalException& e)
{
threw = e.what();
}
@@ -154,7 +154,7 @@ namespace tut
void object::test<3>()
{
set_test_name("bad rewriteURI request");
- WrapLL_ERRS capture;
+ WrapLLErrs capture;
LLSD request;
request["op"] = "rewriteURI";
std::string threw;
@@ -162,7 +162,7 @@ namespace tut
{
LLEventPumps::instance().obtain("LLAres").post(request);
}
- catch (const WrapLL_ERRS::FatalException& e)
+ catch (const WrapLLErrs::FatalException& e)
{
threw = e.what();
}
@@ -175,7 +175,7 @@ namespace tut
void object::test<4>()
{
set_test_name("bad rewriteURI request");
- WrapLL_ERRS capture;
+ WrapLLErrs capture;
LLSD request;
request["op"] = "rewriteURI";
request["reply"] = "nonexistent";
@@ -184,7 +184,7 @@ namespace tut
{
LLEventPumps::instance().obtain("LLAres").post(request);
}
- catch (const WrapLL_ERRS::FatalException& e)
+ catch (const WrapLLErrs::FatalException& e)
{
threw = e.what();
}
@@ -197,7 +197,7 @@ namespace tut
void object::test<5>()
{
set_test_name("bad rewriteURI request");
- WrapLL_ERRS capture;
+ WrapLLErrs capture;
LLSD request;
request["op"] = "rewriteURI";
request["uri"] = "foo.bar.com";
@@ -206,7 +206,7 @@ namespace tut
{
LLEventPumps::instance().obtain("LLAres").post(request);
}
- catch (const WrapLL_ERRS::FatalException& e)
+ catch (const WrapLLErrs::FatalException& e)
{
threw = e.what();
}
diff --git a/indra/llmessage/tests/llcurl_stub.cpp b/indra/llmessage/tests/llcurl_stub.cpp
index 9b298d0c04..b7fdf4f437 100755
--- a/indra/llmessage/tests/llcurl_stub.cpp
+++ b/indra/llmessage/tests/llcurl_stub.cpp
@@ -24,55 +24,76 @@
* $/LicenseInfo$
*/
+#ifndef LL_CURL_STUB_CPP
+#define LL_CURL_STUB_CPP
+
+
#include "linden_common.h"
#include "llcurl.h"
+#include "llhttpconstants.cpp"
LLCurl::Responder::Responder()
{
}
-void LLCurl::Responder::completed(U32 status, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const &reason,
- LLSD const& mContent)
+void LLCurl::Responder::httpCompleted()
{
- if (isGoodStatus(status))
+ if (isGoodStatus())
{
- result(mContent);
+ httpSuccess();
}
else
{
- errorWithContent(status, reason, mContent);
+ httpFailure();
}
}
-void LLCurl::Responder::completedHeader(unsigned,
- std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&,
- LLSD const&)
+void LLCurl::Responder::completedRaw(LLChannelDescriptors const&,
+ boost::shared_ptr<LLBufferArray> const&)
{
}
-void LLCurl::Responder::completedRaw(unsigned,
- std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&,
- LLChannelDescriptors const&,
- boost::shared_ptr<LLBufferArray> const&)
+void LLCurl::Responder::httpFailure()
{
}
-void LLCurl::Responder::errorWithContent(unsigned,
- std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&,
- LLSD const&)
+LLCurl::Responder::~Responder ()
{
}
-LLCurl::Responder::~Responder ()
+void LLCurl::Responder::httpSuccess()
+{
+}
+
+std::string LLCurl::Responder::dumpResponse() const
+{
+ return "dumpResponse()";
+}
+
+void LLCurl::Responder::successResult(const LLSD& content)
{
+ setResult(HTTP_OK, "", content);
+ httpSuccess();
}
-void LLCurl::Responder::error(unsigned,
- std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
+void LLCurl::Responder::failureResult(S32 status, const std::string& reason, const LLSD& content)
+{
+ setResult(status, reason, content);
+ httpFailure();
+}
+
+
+void LLCurl::Responder::completeResult(S32 status, const std::string& reason, const LLSD& content)
{
+ setResult(status, reason, content);
+ httpCompleted();
}
-void LLCurl::Responder::result(LLSD const&)
+void LLCurl::Responder::setResult(S32 status, const std::string& reason, const LLSD& content /* = LLSD() */)
{
+ mStatus = status;
+ mReason = reason;
+ mContent = content;
}
+#endif
diff --git a/indra/llmessage/tests/llhttpclient_test.cpp b/indra/llmessage/tests/llhttpclient_test.cpp
index 559001d079..a32bfa59ce 100755
--- a/indra/llmessage/tests/llhttpclient_test.cpp
+++ b/indra/llmessage/tests/llhttpclient_test.cpp
@@ -40,8 +40,6 @@
#include "llproxy.h"
#include "llpumpio.h"
-#include "llsdhttpserver.h"
-#include "lliohttpserver.h"
#include "lliosocket.h"
#include "stringize.h"
@@ -101,7 +99,7 @@ namespace tut
if (mSawError)
{
std::string msg =
- llformat("error() called when not expected, status %d",
+ llformat("httpFailure() called when not expected, status %d",
mStatus);
fail(msg);
}
@@ -111,7 +109,7 @@ namespace tut
{
if (!mSawError)
{
- fail("error() wasn't called");
+ fail("httpFailure() wasn't called");
}
}
@@ -153,33 +151,26 @@ namespace tut
mClient.mResultDeleted = true;
}
- virtual void error(U32 status, const std::string& reason)
+ protected:
+ virtual void httpFailure()
{
mClient.mSawError = true;
- mClient.mStatus = status;
- mClient.mReason = reason;
+ mClient.mStatus = getStatus();
+ mClient.mReason = getReason();
}
- virtual void result(const LLSD& content)
+ virtual void httpSuccess()
{
- mClient.mResult = content;
+ mClient.mResult = getContent();
}
- virtual void completed(
- U32 status, const std::string& reason,
- const LLSD& content)
+ virtual void httpCompleted()
{
- LLHTTPClient::Responder::completed(status, reason, content);
-
+ LLHTTPClient::Responder::httpCompleted();
+
mClient.mSawCompleted = true;
- }
-
- virtual void completedHeader(
- U32 status, const std::string& reason,
- const LLSD& content)
- {
- mClient.mHeader = content;
mClient.mSawCompletedHeader = true;
+ mClient.mHeader = getResponseHeaders();
}
private:
diff --git a/indra/llmessage/tests/llhttpclientadapter_test.cpp b/indra/llmessage/tests/llhttpclientadapter_test.cpp
index 13ce0a0edd..e9ce116bb3 100755
--- a/indra/llmessage/tests/llhttpclientadapter_test.cpp
+++ b/indra/llmessage/tests/llhttpclientadapter_test.cpp
@@ -1,6 +1,6 @@
/**
- * @file
- * @brief
+ * @file llhttpclientadapter_test.cpp
+ * @brief Tests for LLHTTPClientAdapter
*
* $LicenseInfo:firstyear=2008&license=viewerlgpl$
* Second Life Viewer Source Code
@@ -33,8 +33,8 @@
float const HTTP_REQUEST_EXPIRY_SECS = 1.0F;
std::vector<std::string> get_urls;
-std::vector<boost::intrusive_ptr<LLCurl::Responder> > get_responders;
-void LLHTTPClient::get(const std::string& url, boost::intrusive_ptr<LLCurl::Responder> responder, const LLSD& headers, const F32 timeout)
+std::vector< LLCurl::ResponderPtr > get_responders;
+void LLHTTPClient::get(const std::string& url, LLCurl::ResponderPtr responder, const LLSD& headers, const F32 timeout, bool follow_redirects)
{
get_urls.push_back(url);
get_responders.push_back(responder);
@@ -42,16 +42,30 @@ void LLHTTPClient::get(const std::string& url, boost::intrusive_ptr<LLCurl::Resp
std::vector<std::string> put_urls;
std::vector<LLSD> put_body;
-std::vector<boost::intrusive_ptr<LLCurl::Responder> > put_responders;
+std::vector<LLSD> put_headers;
+std::vector<LLCurl::ResponderPtr> put_responders;
-void LLHTTPClient::put(const std::string& url, const LLSD& body, boost::intrusive_ptr<LLCurl::Responder> responder, const LLSD& headers, const F32 timeout)
+void LLHTTPClient::put(const std::string& url, const LLSD& body, LLCurl::ResponderPtr responder, const LLSD& headers, const F32 timeout)
{
put_urls.push_back(url);
put_responders.push_back(responder);
put_body.push_back(body);
+ put_headers.push_back(headers);
}
+std::vector<std::string> delete_urls;
+std::vector<LLCurl::ResponderPtr> delete_responders;
+
+void LLHTTPClient::del(
+ const std::string& url,
+ LLCurl::ResponderPtr responder,
+ const LLSD& headers,
+ const F32 timeout)
+{
+ delete_urls.push_back(url);
+ delete_responders.push_back(responder);
+}
namespace tut
{
@@ -64,6 +78,9 @@ namespace tut
put_urls.clear();
put_responders.clear();
put_body.clear();
+ put_headers.clear();
+ delete_urls.clear();
+ delete_responders.clear();
}
};
@@ -73,7 +90,7 @@ namespace tut
namespace
{
- tut::factory tf("LLHTTPClientAdapterData test");
+ tut::factory tf("LLHTTPClientAdapterData");
}
namespace tut
@@ -91,7 +108,7 @@ namespace tut
{
LLHTTPClientAdapter adapter;
- boost::intrusive_ptr<LLCurl::Responder> responder = new LLCurl::Responder();
+ LLCurl::ResponderPtr responder = new LLCurl::Responder();
adapter.get("Made up URL", responder);
ensure_equals(get_urls.size(), 1);
@@ -103,7 +120,7 @@ namespace tut
void object::test<3>()
{
LLHTTPClientAdapter adapter;
- boost::intrusive_ptr<LLCurl::Responder> responder = new LLCurl::Responder();
+ LLCurl::ResponderPtr responder = new LLCurl::Responder();
adapter.get("Made up URL", responder);
@@ -117,7 +134,7 @@ namespace tut
{
LLHTTPClientAdapter adapter;
- boost::intrusive_ptr<LLCurl::Responder> responder = new LLCurl::Responder();
+ LLCurl::ResponderPtr responder = new LLCurl::Responder();
LLSD body;
body["TestBody"] = "Foobar";
@@ -133,7 +150,7 @@ namespace tut
{
LLHTTPClientAdapter adapter;
- boost::intrusive_ptr<LLCurl::Responder> responder = new LLCurl::Responder();
+ LLCurl::ResponderPtr responder = new LLCurl::Responder();
LLSD body;
body["TestBody"] = "Foobar";
@@ -150,7 +167,7 @@ namespace tut
{
LLHTTPClientAdapter adapter;
- boost::intrusive_ptr<LLCurl::Responder> responder = new LLCurl::Responder();
+ LLCurl::ResponderPtr responder = new LLCurl::Responder();
LLSD body;
body["TestBody"] = "Foobar";
@@ -160,5 +177,45 @@ namespace tut
ensure_equals(put_body.size(), 1);
ensure_equals(put_body[0]["TestBody"].asString(), "Foobar");
}
+
+ // Ensure that headers are passed through put properly
+ template<> template<>
+ void object::test<7>()
+ {
+ LLHTTPClientAdapter adapter;
+
+ LLCurl::ResponderPtr responder = new LLCurl::Responder();
+
+ LLSD body = LLSD::emptyMap();
+ body["TestBody"] = "Foobar";
+
+ LLSD headers = LLSD::emptyMap();
+ headers["booger"] = "omg";
+
+ adapter.put("Made up URL", body, responder, headers);
+
+ ensure_equals("Header count", put_headers.size(), 1);
+ ensure_equals(
+ "First header",
+ put_headers[0]["booger"].asString(),
+ "omg");
+ }
+
+ // Ensure that del() passes appropriate arguments to the LLHTTPClient
+ template<> template<>
+ void object::test<8>()
+ {
+ LLHTTPClientAdapter adapter;
+
+ LLCurl::ResponderPtr responder = new LLCurl::Responder();
+
+ adapter.del("Made up URL", responder);
+
+ ensure_equals("URL count", delete_urls.size(), 1);
+ ensure_equals("Received URL", delete_urls[0], "Made up URL");
+
+ ensure_equals("Responder count", delete_responders.size(), 1);
+ //ensure_equals("Responder", delete_responders[0], responder);
+ }
}
diff --git a/indra/llmessage/tests/llhttpnode_stub.cpp b/indra/llmessage/tests/llhttpnode_stub.cpp
new file mode 100755
index 0000000000..479a256bdd
--- /dev/null
+++ b/indra/llmessage/tests/llhttpnode_stub.cpp
@@ -0,0 +1,107 @@
+/**
+ * @file llhttpnode_stub.cpp
+ * @brief STUB Implementation of classes for generic HTTP/LSL/REST handling.
+ *
+ * $LicenseInfo:firstyear=2006&license=viewerlgpl$
+ *
+ * Second Life Viewer Source Code
+ * Copyright (c) 2006-2009, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "linden_common.h"
+#include "llhttpnode.h"
+
+const std::string CONTEXT_VERB("verb");
+const std::string CONTEXT_REQUEST("request");
+const std::string CONTEXT_WILDCARD("wildcard");
+const std::string CONTEXT_PATH("path");
+const std::string CONTEXT_QUERY_STRING("query-string");
+const std::string CONTEXT_REMOTE_HOST("remote-host");
+const std::string CONTEXT_REMOTE_PORT("remote-port");
+const std::string CONTEXT_HEADERS("headers");
+const std::string CONTEXT_RESPONSE("response");
+
+/**
+ * LLHTTPNode
+ */
+class LLHTTPNode::Impl
+{
+ // dummy
+};
+
+LLHTTPNode::LLHTTPNode(): impl(*new Impl) {}
+LLHTTPNode::~LLHTTPNode() {}
+LLSD LLHTTPNode::simpleGet() const { return LLSD(); }
+LLSD LLHTTPNode::simplePut(const LLSD& input) const { return LLSD(); }
+LLSD LLHTTPNode::simplePost(const LLSD& input) const { return LLSD(); }
+LLSD LLHTTPNode::simpleDel(const LLSD&) const { return LLSD(); }
+void LLHTTPNode::get(LLHTTPNode::ResponsePtr response, const LLSD& context) const {}
+void LLHTTPNode::put(LLHTTPNode::ResponsePtr response, const LLSD& context, const LLSD& input) const {}
+void LLHTTPNode::post(LLHTTPNode::ResponsePtr response, const LLSD& context, const LLSD& input) const {}
+void LLHTTPNode::del(LLHTTPNode::ResponsePtr response, const LLSD& context) const {}
+void LLHTTPNode::options(ResponsePtr response, const LLSD& context) const {}
+LLHTTPNode* LLHTTPNode::getChild(const std::string& name, LLSD& context) const { return NULL; }
+bool LLHTTPNode::handles(const LLSD& remainder, LLSD& context) const { return false; }
+bool LLHTTPNode::validate(const std::string& name, LLSD& context) const { return false; }
+const LLHTTPNode* LLHTTPNode::traverse(const std::string& path, LLSD& context) const { return NULL; }
+void LLHTTPNode::addNode(const std::string& path, LLHTTPNode* nodeToAdd) { }
+LLSD LLHTTPNode::allNodePaths() const { return LLSD(); }
+const LLHTTPNode* LLHTTPNode::rootNode() const { return NULL; }
+const LLHTTPNode* LLHTTPNode::findNode(const std::string& name) const { return NULL; }
+
+LLHTTPNode::Response::~Response(){}
+void LLHTTPNode::Response::notFound(const std::string& message)
+{
+ status(404, message);
+}
+void LLHTTPNode::Response::notFound()
+{
+ status(404, "Not Found");
+}
+void LLHTTPNode::Response::methodNotAllowed()
+{
+ status(405, "Method Not Allowed");
+}
+void LLHTTPNode::Response::statusUnknownError(S32 code)
+{
+ status(code, "Unknown Error");
+}
+
+void LLHTTPNode::Response::status(S32 code, const std::string& message)
+{
+}
+
+void LLHTTPNode::Response::addHeader(const std::string& name,const std::string& value)
+{
+ mHeaders[name] = value;
+}
+void LLHTTPNode::describe(Description& desc) const { }
+
+
+const LLChainIOFactory* LLHTTPNode::getProtocolHandler() const { return NULL; }
+
+
+LLHTTPRegistrar::NodeFactory::~NodeFactory() { }
+
+void LLHTTPRegistrar::registerFactory(
+ const std::string& path, NodeFactory& factory) {}
+void LLHTTPRegistrar::buildAllServices(LLHTTPNode& root) {}
+
+
diff --git a/indra/llmessage/tests/llmime_test.cpp b/indra/llmessage/tests/llmime_test.cpp
deleted file mode 100755
index aed5c4589c..0000000000
--- a/indra/llmessage/tests/llmime_test.cpp
+++ /dev/null
@@ -1,445 +0,0 @@
-/**
- * @file llmime_test.cpp
- * @author Phoenix
- * @date 2006-12-24
- * @brief BRIEF_DESC of llmime_test.cpp
- *
- * $LicenseInfo:firstyear=2006&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "linden_common.h"
-
-#include "llsdserialize.h"
-
-#include "../llmime.h"
-
-#include "../test/lltut.h"
-
-namespace tut
-{
- struct mime_index
- {
- };
- typedef test_group<mime_index> mime_index_t;
- typedef mime_index_t::object mime_index_object_t;
- tut::mime_index_t tut_mime_index("LLMime");
-
- template<> template<>
- void mime_index_object_t::test<1>()
- {
- LLMimeIndex mime;
- ensure("no headers", mime.headers().isUndefined());
- ensure_equals("invalid offset", mime.offset(), -1);
- ensure_equals("invalid content length", mime.contentLength(), -1);
- ensure("no content type", mime.contentType().empty());
- ensure("not multipart", !mime.isMultipart());
- ensure_equals("no attachments", mime.subPartCount(), 0);
- }
-
- template<> template<>
- void mime_index_object_t::test<2>()
- {
- const S32 CONTENT_LENGTH = 6000;
- const S32 CONTENT_OFFSET = 100;
- const std::string CONTENT_TYPE = std::string("image/j2c");
- LLSD headers;
- headers["Content-Length"] = CONTENT_LENGTH;
- headers["Content-Type"] = CONTENT_TYPE;
- LLMimeIndex mime(headers, CONTENT_OFFSET);
- ensure("headers are map", mime.headers().isMap());
- ensure_equals("offset", mime.offset(), CONTENT_OFFSET);
- ensure_equals("content length", mime.contentLength(), CONTENT_LENGTH);
- ensure_equals("type is image/j2c", mime.contentType(), CONTENT_TYPE);
- ensure("not multipart", !mime.isMultipart());
- ensure_equals("no attachments", mime.subPartCount(), 0);
- }
-
- template<> template<>
- void mime_index_object_t::test<3>()
- {
- const S32 MULTI_CONTENT_LENGTH = 8000;
- const S32 MULTI_CONTENT_OFFSET = 100;
- const std::string MULTI_CONTENT_TYPE = std::string("multipart/mixed");
- LLSD headers;
- headers["Content-Length"] = MULTI_CONTENT_LENGTH;
- headers["Content-Type"] = MULTI_CONTENT_TYPE;
- LLMimeIndex mime(headers, MULTI_CONTENT_OFFSET);
- llinfos << "headers: " << LLSDOStreamer<LLSDNotationFormatter>(headers)
- << llendl;
-
-
- const S32 META_CONTENT_LENGTH = 700;
- const S32 META_CONTENT_OFFSET = 69;
- const std::string META_CONTENT_TYPE = std::string(
- "text/llsd+xml");
- headers = LLSD::emptyMap();
- headers["Content-Length"] = META_CONTENT_LENGTH;
- headers["Content-Type"] = META_CONTENT_TYPE;
- LLMimeIndex meta(headers, META_CONTENT_OFFSET);
- mime.attachSubPart(meta);
-
- const S32 IMAGE_CONTENT_LENGTH = 6000;
- const S32 IMAGE_CONTENT_OFFSET = 200;
- const std::string IMAGE_CONTENT_TYPE = std::string("image/j2c");
- headers = LLSD::emptyMap();
- headers["Content-Length"] = IMAGE_CONTENT_LENGTH;
- headers["Content-Type"] = IMAGE_CONTENT_TYPE;
- LLMimeIndex image(headers, IMAGE_CONTENT_OFFSET);
- mime.attachSubPart(image);
-
- // make sure we have a valid multi-part
- ensure("is multipart", mime.isMultipart());
- ensure_equals("multi offset", mime.offset(), MULTI_CONTENT_OFFSET);
- ensure_equals(
- "multi content length",
- mime.contentLength(),
- MULTI_CONTENT_LENGTH);
- ensure_equals("two attachments", mime.subPartCount(), 2);
-
- // make sure ranged gets do the right thing with out of bounds
- // sub-parts.
- LLMimeIndex invalid_child(mime.subPart(-1));
- ensure("no headers", invalid_child.headers().isUndefined());
- ensure_equals("invalid offset", invalid_child.offset(), -1);
- ensure_equals(
- "invalid content length", invalid_child.contentLength(), -1);
- ensure("no content type", invalid_child.contentType().empty());
- ensure("not multipart", !invalid_child.isMultipart());
- ensure_equals("no attachments", invalid_child.subPartCount(), 0);
-
- invalid_child = mime.subPart(2);
- ensure("no headers", invalid_child.headers().isUndefined());
- ensure_equals("invalid offset", invalid_child.offset(), -1);
- ensure_equals(
- "invalid content length", invalid_child.contentLength(), -1);
- ensure("no content type", invalid_child.contentType().empty());
- ensure("not multipart", !invalid_child.isMultipart());
- ensure_equals("no attachments", invalid_child.subPartCount(), 0);
- }
-
- template<> template<>
- void mime_index_object_t::test<4>()
- {
- const S32 MULTI_CONTENT_LENGTH = 8000;
- const S32 MULTI_CONTENT_OFFSET = 100;
- const std::string MULTI_CONTENT_TYPE = std::string("multipart/mixed");
- LLSD headers;
- headers["Content-Length"] = MULTI_CONTENT_LENGTH;
- headers["Content-Type"] = MULTI_CONTENT_TYPE;
- LLMimeIndex mime(headers, MULTI_CONTENT_OFFSET);
-
- const S32 META_CONTENT_LENGTH = 700;
- const S32 META_CONTENT_OFFSET = 69;
- const std::string META_CONTENT_TYPE = std::string(
- "application/llsd+xml");
- headers = LLSD::emptyMap();
- headers["Content-Length"] = META_CONTENT_LENGTH;
- headers["Content-Type"] = META_CONTENT_TYPE;
- LLMimeIndex meta(headers, META_CONTENT_OFFSET);
- mime.attachSubPart(meta);
-
- const S32 IMAGE_CONTENT_LENGTH = 6000;
- const S32 IMAGE_CONTENT_OFFSET = 200;
- const std::string IMAGE_CONTENT_TYPE = std::string("image/j2c");
- headers = LLSD::emptyMap();
- headers["Content-Length"] = IMAGE_CONTENT_LENGTH;
- headers["Content-Type"] = IMAGE_CONTENT_TYPE;
- LLMimeIndex image(headers, IMAGE_CONTENT_OFFSET);
- mime.attachSubPart(image);
-
- // check what we have
- ensure("is multipart", mime.isMultipart());
- ensure_equals("multi offset", mime.offset(), MULTI_CONTENT_OFFSET);
- ensure_equals(
- "multi content length",
- mime.contentLength(),
- MULTI_CONTENT_LENGTH);
- ensure_equals("two attachments", mime.subPartCount(), 2);
-
- LLMimeIndex actual_meta = mime.subPart(0);
- ensure_equals(
- "meta type", actual_meta.contentType(), META_CONTENT_TYPE);
- ensure_equals(
- "meta offset", actual_meta.offset(), META_CONTENT_OFFSET);
- ensure_equals(
- "meta content length",
- actual_meta.contentLength(),
- META_CONTENT_LENGTH);
-
- LLMimeIndex actual_image = mime.subPart(1);
- ensure_equals(
- "image type", actual_image.contentType(), IMAGE_CONTENT_TYPE);
- ensure_equals(
- "image offset", actual_image.offset(), IMAGE_CONTENT_OFFSET);
- ensure_equals(
- "image content length",
- actual_image.contentLength(),
- IMAGE_CONTENT_LENGTH);
- }
-
-/*
- template<> template<>
- void mime_index_object_t::test<5>()
- {
- }
- template<> template<>
- void mime_index_object_t::test<6>()
- {
- }
- template<> template<>
- void mime_index_object_t::test<7>()
- {
- }
- template<> template<>
- void mime_index_object_t::test<8>()
- {
- }
- template<> template<>
- void mime_index_object_t::test<>()
- {
- }
-*/
-}
-
-
-namespace tut
-{
- struct mime_parse
- {
- };
- typedef test_group<mime_parse> mime_parse_t;
- typedef mime_parse_t::object mime_parse_object_t;
- tut::mime_parse_t tut_mime_parse("LLMimeParse");
-
- template<> template<>
- void mime_parse_object_t::test<1>()
- {
- // parse one mime object
- const std::string SERIALIZED_MIME("Content-Length: 200\r\nContent-Type: text/plain\r\n\r\naaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccc\r\n");
- std::stringstream istr;
- istr.str(SERIALIZED_MIME);
- LLMimeIndex mime;
- LLMimeParser parser;
- bool ok = parser.parseIndex(istr, mime);
- ensure("Parse successful.", ok);
- ensure_equals("content type", mime.contentType(), "text/plain");
- ensure_equals("content length", mime.contentLength(), 200);
- ensure_equals("offset", mime.offset(), 49);
- }
-
- template<> template<>
- void mime_parse_object_t::test<2>()
- {
- // make sure we only parse one.
- const std::string SERIALIZED_MIME("Content-Length: 200\r\nContent-Type: text/plain\r\n\r\naaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccc\r\n\r\nContent-Length: 200\r\nContent-Type: text/plain\r\n\r\naaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccc\r\n\r\n");
- std::stringstream istr;
- istr.str(SERIALIZED_MIME);
- LLMimeIndex mime;
- LLMimeParser parser;
- bool ok = parser.parseIndex(istr, mime);
- ensure("Parse successful.", ok);
- ensure("not multipart.", !mime.isMultipart());
- ensure_equals("content type", mime.contentType(), "text/plain");
- ensure_equals("content length", mime.contentLength(), 200);
- ensure_equals("offset", mime.offset(), 49);
- }
-
- template<> template<>
- void mime_parse_object_t::test<3>()
- {
- // test multi-part and lack of content length for some of it.
- /*
-Content-Type: multipart/mixed; boundary="segment"rnContent-Length: 148rnrn--segmentrnContent-Type: text/plainrnrnsome datarnrn--segmentrnContent-Type: text/xml; charset=UTF-8rnContent-Length: 22rnrn<llsd><undef /></llsd>rnrn
- */
- const std::string SERIALIZED_MIME("Content-Type: multipart/mixed; boundary=\"segment\"\r\nContent-Length: 150\r\n\r\n--segment\r\nContent-Type: text/plain\r\n\r\nsome data\r\n\r\n--segment\r\nContent-Type: text/xml; charset=UTF-8\r\nContent-Length: 22\r\n\r\n<llsd><undef /></llsd>\r\n\r\n");
- std::stringstream istr;
- istr.str(SERIALIZED_MIME);
- LLMimeIndex mime;
- LLMimeParser parser;
- bool ok = parser.parseIndex(istr, mime);
- ensure("Parse successful.", ok);
- ensure("is multipart.", mime.isMultipart());
- ensure_equals("sub-part count", mime.subPartCount(), 2);
- ensure_equals("content length", mime.contentLength(), 150);
- ensure_equals("data offset for multipart", mime.offset(), 74);
-
- LLMimeIndex mime_plain(mime.subPart(0));
- ensure_equals(
- "first part type",
- mime_plain.contentType(),
- "text/plain");
- ensure_equals(
- "first part content length not known.",
- mime_plain.contentLength(),
- -1);
- ensure_equals("first part offset", mime_plain.offset(), 113);
-
- LLMimeIndex mime_xml(mime.subPart(1));
- ensure_equals(
- "second part type",
- mime_xml.contentType(),
- "text/xml; charset=UTF-8");
- ensure_equals(
- "second part content length",
- mime_xml.contentLength(),
- 22);
- ensure_equals("second part offset", mime_xml.offset(), 198);
- }
-
- template<> template<>
- void mime_parse_object_t::test<4>()
- {
- // test multi-part, unquoted separator, and premature eof conditions
- /*
-Content-Type: multipart/mixed; boundary=segmentrnContent-Length: 220rnrn--segmentrnContent-Type: text/plainrnContent-Length: 55rnrnhow are you today?rnI do not know. I guess I am:n'fine'rnrn--segmentrnContent-Type: text/xml; charset=UTF-8rnContent-Length: 22rnrn<llsd><undef /></llsd>rnrn */
- const std::string SERIALIZED_MIME("Content-Type: multipart/mixed; boundary=segment\r\nContent-Length: 220\r\n\r\n--segment\r\nContent-Type: text/plain\r\nContent-Length: 55\r\n\r\nhow are you today?\r\nI do not know. I guess I am:\n'fine'\r\n\r\n--segment\r\nContent-Type: text/xml; charset=UTF-8\r\nContent-Length: 22\r\n\r\n<llsd><undef /></llsd>\r\n\r\n");
- std::stringstream istr;
- istr.str(SERIALIZED_MIME);
- LLMimeIndex mime;
- LLMimeParser parser;
- bool ok = parser.parseIndex(istr, mime);
- ensure("Parse successful.", ok);
- ensure("is multipart.", mime.isMultipart());
- ensure_equals("sub-part count", mime.subPartCount(), 2);
- ensure_equals("content length", mime.contentLength(), 220);
- ensure_equals("data offset for multipart", mime.offset(), 72);
-
- LLMimeIndex mime_plain(mime.subPart(0));
- ensure_equals(
- "first part type",
- mime_plain.contentType(),
- "text/plain");
- ensure_equals(
- "first part content length",
- mime_plain.contentLength(),
- 55);
- ensure_equals("first part offset", mime_plain.offset(), 131);
-
- LLMimeIndex mime_xml(mime.subPart(1));
- ensure_equals(
- "second part type",
- mime_xml.contentType(),
- "text/xml; charset=UTF-8");
- ensure_equals(
- "second part content length",
- mime_xml.contentLength(),
- 22);
- ensure_equals("second part offset", mime_xml.offset(), 262);
- }
-
- template<> template<>
- void mime_parse_object_t::test<5>()
- {
- // test multi-part with multiple params
- const std::string SERIALIZED_MIME("Content-Type: multipart/mixed; boundary=segment; comment=\"testing multiple params.\"\r\nContent-Length: 220\r\n\r\n--segment\r\nContent-Type: text/plain\r\nContent-Length: 55\r\n\r\nhow are you today?\r\nI do not know. I guess I am:\n'fine'\r\n\r\n--segment\r\nContent-Type: text/xml; charset=UTF-8\r\nContent-Length: 22\r\n\r\n<llsd><undef /></llsd>\r\n\r\n");
- std::stringstream istr;
- istr.str(SERIALIZED_MIME);
- LLMimeIndex mime;
- LLMimeParser parser;
- bool ok = parser.parseIndex(istr, mime);
- ensure("Parse successful.", ok);
- ensure("is multipart.", mime.isMultipart());
- ensure_equals("sub-part count", mime.subPartCount(), 2);
- ensure_equals("content length", mime.contentLength(), 220);
-
- LLMimeIndex mime_plain(mime.subPart(0));
- ensure_equals(
- "first part type",
- mime_plain.contentType(),
- "text/plain");
- ensure_equals(
- "first part content length",
- mime_plain.contentLength(),
- 55);
-
- LLMimeIndex mime_xml(mime.subPart(1));
- ensure_equals(
- "second part type",
- mime_xml.contentType(),
- "text/xml; charset=UTF-8");
- ensure_equals(
- "second part content length",
- mime_xml.contentLength(),
- 22);
- }
-
- template<> template<>
- void mime_parse_object_t::test<6>()
- {
- // test multi-part with no specified boundary and eof
-/*
-Content-Type: multipart/relatedrnContent-Length: 220rnrn--rnContent-Type: text/plainrnContent-Length: 55rnrnhow are you today?rnI do not know. I guess I am:n'fine'rnrn--rnContent-Type: text/xml; charset=UTF-8rnContent-Length: 22rnrn<llsd><undef /></llsd>rnrn
-*/
- const std::string SERIALIZED_MIME("Content-Type: multipart/related\r\nContent-Length: 500\r\n\r\n--\r\nContent-Type: text/plain\r\nContent-Length: 55\r\n\r\nhow are you today?\r\nI do not know. I guess I am:\n'fine'\r\n\r\n--\r\nContent-Type: text/xml; charset=UTF-8\r\nContent-Length: 22\r\n\r\n<llsd><undef /></llsd>\r\n\r\n");
- std::stringstream istr;
- istr.str(SERIALIZED_MIME);
- LLMimeIndex mime;
- LLMimeParser parser;
- bool ok = parser.parseIndex(istr, mime);
- ensure("Parse successful.", ok);
- ensure("is multipart.", mime.isMultipart());
- ensure_equals("sub-part count", mime.subPartCount(), 2);
- ensure_equals("content length", mime.contentLength(), 500);
- ensure_equals("data offset for multipart", mime.offset(), 56);
-
- LLMimeIndex mime_plain(mime.subPart(0));
- ensure_equals(
- "first part type",
- mime_plain.contentType(),
- "text/plain");
- ensure_equals(
- "first part content length",
- mime_plain.contentLength(),
- 55);
- ensure_equals("first part offset", mime_plain.offset(), 108);
-
- LLMimeIndex mime_xml(mime.subPart(1));
- ensure_equals(
- "second part type",
- mime_xml.contentType(),
- "text/xml; charset=UTF-8");
- ensure_equals(
- "second part content length",
- mime_xml.contentLength(),
- 22);
- ensure_equals("second part offset", mime_xml.offset(), 232);
- }
-
-/*
- template<> template<>
- void mime_parse_object_t::test<>()
- {
- }
- template<> template<>
- void mime_parse_object_t::test<>()
- {
- }
- template<> template<>
- void mime_parse_object_t::test<>()
- {
- }
- template<> template<>
- void mime_parse_object_t::test<>()
- {
- }
-*/
-}
diff --git a/indra/llmessage/tests/llregionpresenceverifier_test.cpp b/indra/llmessage/tests/llregionpresenceverifier_test.cpp
deleted file mode 100755
index 5b89f2a8c6..0000000000
--- a/indra/llmessage/tests/llregionpresenceverifier_test.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * @file
- * @brief
- *
- * $LicenseInfo:firstyear=2008&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "linden_common.h"
-
-#include "../test/lltut.h"
-#include "llregionpresenceverifier.h"
-#include "llcurl_stub.cpp"
-#include "llhost.cpp"
-#include "net.cpp"
-#include "lltesthttpclientadapter.cpp"
-
-class LLTestResponse : public LLRegionPresenceVerifier::Response
-{
-public:
-
- virtual bool checkValidity(const LLSD& content) const
- {
- return true;
- }
-
- virtual void onRegionVerified(const LLSD& region_details)
- {
- }
-
- virtual void onRegionVerificationFailed()
- {
- }
-
- virtual LLHTTPClientInterface& getHttpClient()
- {
- return mHttpInterface;
- }
-
- LLTestHTTPClientAdapter mHttpInterface;
-};
-
-namespace tut
-{
- struct LLRegionPresenceVerifierData
- {
- LLRegionPresenceVerifierData() :
- mResponse(new LLTestResponse()),
- mResponder("", LLRegionPresenceVerifier::ResponsePtr(mResponse),
- LLSD(), 3)
- {
- }
-
- LLTestResponse* mResponse;
- LLRegionPresenceVerifier::VerifiedDestinationResponder mResponder;
- };
-
- typedef test_group<LLRegionPresenceVerifierData> factory;
- typedef factory::object object;
-}
-
-namespace
-{
- tut::factory tf("LLRegionPresenceVerifier");
-}
-
-namespace tut
-{
- // Test that VerifiedDestinationResponder does retry
- // on error when shouldRetry returns true.
- template<> template<>
- void object::test<1>()
- {
- mResponder.error(500, "Internal server error");
- ensure_equals(mResponse->mHttpInterface.mGetUrl.size(), 1);
- }
-
- // Test that VerifiedDestinationResponder only retries
- // on error until shouldRetry returns false.
- template<> template<>
- void object::test<2>()
- {
- mResponder.error(500, "Internal server error");
- mResponder.error(500, "Internal server error");
- mResponder.error(500, "Internal server error");
- mResponder.error(500, "Internal server error");
- ensure_equals(mResponse->mHttpInterface.mGetUrl.size(), 3);
- }
-}
-
diff --git a/indra/llmessage/tests/lltrustedmessageservice_test.cpp b/indra/llmessage/tests/lltrustedmessageservice_test.cpp
index b287a29841..55748ad27e 100755
--- a/indra/llmessage/tests/lltrustedmessageservice_test.cpp
+++ b/indra/llmessage/tests/lltrustedmessageservice_test.cpp
@@ -32,6 +32,7 @@
#include "message.h"
#include "llmessageconfig.h"
+#include "llhttpnode_stub.cpp"
LLMessageSystem* gMessageSystem = NULL;
diff --git a/indra/llplugin/llplugincookiestore.cpp b/indra/llplugin/llplugincookiestore.cpp
index 9f4d65e723..a5d717389d 100755
--- a/indra/llplugin/llplugincookiestore.cpp
+++ b/indra/llplugin/llplugincookiestore.cpp
@@ -27,6 +27,7 @@
*/
#include "linden_common.h"
+#include "llstl.h"
#include "indra_constants.h"
#include "llplugincookiestore.h"
@@ -405,7 +406,7 @@ void LLPluginCookieStore::writeChangedCookies(std::ostream& s, bool clear_change
{
if(mHasChangedCookies)
{
- lldebugs << "returning changed cookies: " << llendl;
+ LL_DEBUGS() << "returning changed cookies: " << LL_ENDL;
cookie_map_t::iterator iter;
for(iter = mCookies.begin(); iter != mCookies.end(); )
{
@@ -417,7 +418,7 @@ void LLPluginCookieStore::writeChangedCookies(std::ostream& s, bool clear_change
{
s << iter->second->getCookie() << "\n";
- lldebugs << " " << iter->second->getCookie() << llendl;
+ LL_DEBUGS() << " " << iter->second->getCookie() << LL_ENDL;
// If requested, clear the changed mark
if(clear_changed)
@@ -654,12 +655,8 @@ void LLPluginCookieStore::setOneCookie(const std::string &s, std::string::size_t
void LLPluginCookieStore::clearCookies()
{
- while(!mCookies.empty())
- {
- cookie_map_t::iterator iter = mCookies.begin();
- delete iter->second;
- mCookies.erase(iter);
- }
+ std::for_each(mCookies.begin(), mCookies.end(), DeletePairedPointer());
+ mCookies.clear();
}
void LLPluginCookieStore::removeCookie(const std::string &key)
diff --git a/indra/llplugin/llpluginmessagepipe.cpp b/indra/llplugin/llpluginmessagepipe.cpp
index 091e93ea4b..7e2bf90ad1 100755
--- a/indra/llplugin/llpluginmessagepipe.cpp
+++ b/indra/llplugin/llpluginmessagepipe.cpp
@@ -215,7 +215,7 @@ bool LLPluginMessagePipe::pumpOutput()
else if(APR_STATUS_IS_EOF(status))
{
// This is what we normally expect when a plugin exits.
- llinfos << "Got EOF from plugin socket. " << llendl;
+ LL_INFOS() << "Got EOF from plugin socket. " << LL_ENDL;
if(mOwner)
{
diff --git a/indra/llplugin/llpluginprocesschild.h b/indra/llplugin/llpluginprocesschild.h
index a9d6794e40..531422e792 100755
--- a/indra/llplugin/llpluginprocesschild.h
+++ b/indra/llplugin/llpluginprocesschild.h
@@ -29,6 +29,7 @@
#ifndef LL_LLPLUGINPROCESSCHILD_H
#define LL_LLPLUGINPROCESSCHILD_H
+#include <queue>
#include "llpluginmessage.h"
#include "llpluginmessagepipe.h"
#include "llplugininstance.h"
diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp
index a4da7674d5..b5a2588e1e 100755
--- a/indra/llplugin/llpluginprocessparent.cpp
+++ b/indra/llplugin/llpluginprocessparent.cpp
@@ -131,6 +131,8 @@ LLPluginProcessParent::~LLPluginProcessParent()
{
// destroy the shared memory region
iter->second->destroy();
+ delete iter->second;
+ iter->second = NULL;
// and remove it from our map
mSharedMemoryRegions.erase(iter);
@@ -185,7 +187,7 @@ bool LLPluginProcessParent::accept()
if(status == APR_SUCCESS)
{
-// llinfos << "SUCCESS" << llendl;
+// LL_INFOS() << "SUCCESS" << LL_ENDL;
// Success. Create a message pipe on the new socket
// we MUST create a new pool for the LLSocket, since it will take ownership of it and delete it in its destructor!
@@ -199,14 +201,14 @@ bool LLPluginProcessParent::accept()
}
else if(APR_STATUS_IS_EAGAIN(status))
{
-// llinfos << "EAGAIN" << llendl;
+// LL_INFOS() << "EAGAIN" << LL_ENDL;
// No incoming connections. This is not an error.
status = APR_SUCCESS;
}
else
{
-// llinfos << "Error:" << llendl;
+// LL_INFOS() << "Error:" << LL_ENDL;
ll_apr_warn_status(status);
// Some other error.
@@ -960,6 +962,8 @@ void LLPluginProcessParent::receiveMessage(const LLPluginMessage &message)
{
// destroy the shared memory region
iter->second->destroy();
+ delete iter->second;
+ iter->second = NULL;
// and remove it from our map
mSharedMemoryRegions.erase(iter);
diff --git a/indra/llplugin/llpluginprocessparent.h b/indra/llplugin/llpluginprocessparent.h
index 990fc5cbae..24be7eb148 100755
--- a/indra/llplugin/llpluginprocessparent.h
+++ b/indra/llplugin/llpluginprocessparent.h
@@ -29,6 +29,8 @@
#ifndef LL_LLPLUGINPROCESSPARENT_H
#define LL_LLPLUGINPROCESSPARENT_H
+#include <queue>
+
#include "llapr.h"
#include "llprocess.h"
#include "llpluginmessage.h"
diff --git a/indra/llplugin/tests/llplugincookiestore_test.cpp b/indra/llplugin/tests/llplugincookiestore_test.cpp
index aefa1ca144..c2cb236cba 100755
--- a/indra/llplugin/tests/llplugincookiestore_test.cpp
+++ b/indra/llplugin/tests/llplugincookiestore_test.cpp
@@ -27,6 +27,7 @@
*/
#include "linden_common.h"
+#include <list>
#include "../test/lltut.h"
#include "../llplugincookiestore.h"
diff --git a/indra/llprimitive/CMakeLists.txt b/indra/llprimitive/CMakeLists.txt
index 0dd13916bf..d1475cf734 100755
--- a/indra/llprimitive/CMakeLists.txt
+++ b/indra/llprimitive/CMakeLists.txt
@@ -35,7 +35,6 @@ set(llprimitive_SOURCE_FILES
lltextureentry.cpp
lltreeparams.cpp
llvolumemessage.cpp
- llvolumexml.cpp
material_codes.cpp
)
@@ -43,6 +42,7 @@ set(llprimitive_HEADER_FILES
CMakeLists.txt
legacy_object_types.h
+ lllslconstants.h
llmaterial.h
llmaterialid.h
llmaterialtable.h
@@ -55,7 +55,6 @@ set(llprimitive_HEADER_FILES
lltreeparams.h
lltree_common.h
llvolumemessage.h
- llvolumexml.h
material_codes.h
object_flags.h
)
diff --git a/indra/llcommon/lllslconstants.h b/indra/llprimitive/lllslconstants.h
index 926ce32d75..926ce32d75 100755..100644
--- a/indra/llcommon/lllslconstants.h
+++ b/indra/llprimitive/lllslconstants.h
diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp
index cf4c645cfd..7f3c8da434 100644
--- a/indra/llprimitive/llmaterial.cpp
+++ b/indra/llprimitive/llmaterial.cpp
@@ -69,7 +69,7 @@ template<typename T> T getMaterialField(const LLSD& data, const std::string& fie
{
return (T)data[field];
}
- llerrs << "Missing or mistyped field '" << field << "' in material definition" << llendl;
+ LL_ERRS() << "Missing or mistyped field '" << field << "' in material definition" << LL_ENDL;
return (T)LLSD();
}
@@ -80,7 +80,7 @@ template<> LLUUID getMaterialField(const LLSD& data, const std::string& field, c
{
return data[field].asUUID();
}
- llerrs << "Missing or mistyped field '" << field << "' in material definition" << llendl;
+ LL_ERRS() << "Missing or mistyped field '" << field << "' in material definition" << LL_ENDL;
return LLUUID::null;
}
diff --git a/indra/llprimitive/llmaterialid.h b/indra/llprimitive/llmaterialid.h
index 0a95204085..b4c82d3b7b 100644
--- a/indra/llprimitive/llmaterialid.h
+++ b/indra/llprimitive/llmaterialid.h
@@ -30,6 +30,7 @@
#define MATERIAL_ID_SIZE 16
#include <string>
+#include "llsd.h"
class LLMaterialID
{
diff --git a/indra/llprimitive/llmaterialtable.cpp b/indra/llprimitive/llmaterialtable.cpp
index b4539ebee9..37c718b4c6 100755
--- a/indra/llprimitive/llmaterialtable.cpp
+++ b/indra/llprimitive/llmaterialtable.cpp
@@ -27,10 +27,10 @@
#include "linden_common.h"
#include "llmaterialtable.h"
+#include "indra_constants.h"
#include "llstl.h"
#include "material_codes.h"
#include "sound_ids.h"
-#include "imageids.h"
LLMaterialTable LLMaterialTable::basic(1);
@@ -547,14 +547,14 @@ LLUUID LLMaterialTable::getCollisionSoundUUID(U8 mcode, U8 mcode2)
mcode &= LL_MCODE_MASK;
mcode2 &= LL_MCODE_MASK;
- //llinfos << "code 1: " << ((U32) mcode) << " code 2:" << ((U32) mcode2) << llendl;
+ //LL_INFOS() << "code 1: " << ((U32) mcode) << " code 2:" << ((U32) mcode2) << LL_ENDL;
if (mCollisionSoundMatrix && (mcode < LL_MCODE_END) && (mcode2 < LL_MCODE_END))
{
return(mCollisionSoundMatrix[mcode * LL_MCODE_END + mcode2]);
}
else
{
- //llinfos << "Null Sound" << llendl;
+ //LL_INFOS() << "Null Sound" << LL_ENDL;
return(SND_NULL);
}
}
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index 34e0483a83..b4963225dc 100755
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -44,7 +44,7 @@
#pragma warning (default : 4264)
#endif
-#ifdef LL_STANDALONE
+#ifdef LL_USESYSTEMLIBS
# include <zlib.h>
#else
# include "zlib/zlib.h"
@@ -166,10 +166,15 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
if ( !get_dom_sources(inputs, pos_offset, tc_offset, norm_offset, idx_stride, pos_source, tc_source, norm_source) || !pos_source )
{
- llwarns << "Could not find dom sources for basic geo data; invalid model." << llendl;
+ LL_WARNS() << "Could not find dom sources for basic geo data; invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
+ if (!pos_source)
+ {
+ llwarns << "Unable to process mesh without position data; invalid model; invalid model." << llendl;
+ return LLModel::BAD_ELEMENT;
+ }
domPRef p = tri->getP();
domListOfUInts& idx = p->getValue();
@@ -179,19 +184,22 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
domListOfFloats& tc = tc_source ? tc_source->getFloat_array()->getValue() : dummy ;
domListOfFloats& n = norm_source ? norm_source->getFloat_array()->getValue() : dummy ;
- if (pos_source)
- {
- face.mExtents[0].set(v[0], v[1], v[2]);
- face.mExtents[1].set(v[0], v[1], v[2]);
- }
-
LLVolumeFace::VertexMapData::PointMap point_map;
-
+
U32 index_count = idx.getCount();
U32 vertex_count = pos_source ? v.getCount() : 0;
U32 tc_count = tc_source ? tc.getCount() : 0;
U32 norm_count = norm_source ? n.getCount() : 0;
+ if ((vertex_count == 0) || (tc_count == 0))
+ {
+ llwarns << "Unable to process mesh with empty position array; invalid model." << llendl;
+ return LLModel::BAD_ELEMENT;
+ }
+
+ face.mExtents[0].set(v[0], v[1], v[2]);
+ face.mExtents[1].set(v[0], v[1], v[2]);
+
for (U32 i = 0; i < index_count; i += idx_stride)
{
LLVolumeFace::VertexData cv;
@@ -202,7 +210,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
if (((i + pos_offset) > index_count)
|| ((idx[i+pos_offset]*3+2) > vertex_count))
{
- llwarns << "Out of range index data; invalid model." << llendl;
+ LL_WARNS() << "Out of range index data; invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
@@ -212,7 +220,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
if (!cv.getPosition().isFinite3())
{
- llwarns << "Nan positional data, invalid model." << llendl;
+ LL_WARNS() << "Nan positional data, invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
}
@@ -225,7 +233,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
if (((i + tc_offset) > index_count)
|| ((idx[i+tc_offset]*2+1) > tc_count))
{
- llwarns << "Out of range TC indices." << llendl;
+ LL_WARNS() << "Out of range TC indices." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
@@ -234,7 +242,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
if (!cv.mTexCoord.isFinite())
{
- llwarns << "Found NaN while loading tex coords from DAE-Model, invalid model." << llendl;
+ LL_WARNS() << "Found NaN while loading tex coords from DAE-Model, invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
}
@@ -246,7 +254,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
if (((i + norm_offset) > index_count)
|| ((idx[i+norm_offset]*3+2) > norm_count))
{
- llwarns << "Found out of range norm indices, invalid model." << llendl;
+ LL_WARNS() << "Found out of range norm indices, invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
@@ -256,7 +264,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
if (!cv.getNormal().isFinite3())
{
- llwarns << "Found NaN while loading normals from DAE-Model, invalid model." << llendl;
+ LL_WARNS() << "Found NaN while loading normals from DAE-Model, invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
}
@@ -285,7 +293,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
verts.push_back(cv);
if (verts.size() >= 65535)
{
- //llerrs << "Attempted to write model exceeding 16-bit index buffer limitation." << llendl;
+ //LL_ERRS() << "Attempted to write model exceeding 16-bit index buffer limitation." << LL_ENDL;
return LLModel::VERTEX_NUMBER_OVERFLOW ;
}
U16 index = (U16) (verts.size()-1);
@@ -385,7 +393,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac
if (!get_dom_sources(inputs, pos_offset, tc_offset, norm_offset, idx_stride, pos_source, tc_source, norm_source))
{
- llwarns << "Could not get DOM sources for basic geo data, invalid model." << llendl;
+ LL_WARNS() << "Could not get DOM sources for basic geo data, invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
@@ -439,7 +447,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac
if (((cur_idx + pos_offset) > index_count)
|| ((idx[cur_idx+pos_offset]*3+2) > vertex_count))
{
- llwarns << "Out of range position indices, invalid model." << llendl;
+ LL_WARNS() << "Out of range position indices, invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
@@ -449,7 +457,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac
if (!cv.getPosition().isFinite3())
{
- llwarns << "Found NaN while loading positions from DAE-Model, invalid model." << llendl;
+ LL_WARNS() << "Found NaN while loading positions from DAE-Model, invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
@@ -462,7 +470,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac
if (((cur_idx + tc_offset) > index_count)
|| ((idx[cur_idx+tc_offset]*2+1) > tc_count))
{
- llwarns << "Out of range TC indices, invalid model." << llendl;
+ LL_WARNS() << "Out of range TC indices, invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
@@ -471,7 +479,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac
if (!cv.mTexCoord.isFinite())
{
- llwarns << "Found NaN while loading tex coords from DAE-Model, invalid model." << llendl;
+ LL_WARNS() << "Found NaN while loading tex coords from DAE-Model, invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
}
@@ -483,7 +491,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac
if (((cur_idx + norm_offset) > index_count)
|| ((idx[cur_idx+norm_offset]*3+2) > norm_count))
{
- llwarns << "Out of range norm indices, invalid model." << llendl;
+ LL_WARNS() << "Out of range norm indices, invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
@@ -493,7 +501,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac
if (!cv.getNormal().isFinite3())
{
- llwarns << "Found NaN while loading normals from DAE-Model, invalid model." << llendl;
+ LL_WARNS() << "Found NaN while loading normals from DAE-Model, invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
}
@@ -541,7 +549,7 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac
verts.push_back(cv);
if (verts.size() >= 65535)
{
- //llerrs << "Attempted to write model exceeding 16-bit index buffer limitation." << llendl;
+ //LL_ERRS() << "Attempted to write model exceeding 16-bit index buffer limitation." << LL_ENDL;
return LLModel::VERTEX_NUMBER_OVERFLOW ;
}
U16 index = (U16) (verts.size()-1);
@@ -662,7 +670,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac
domVertices* vertices = (domVertices*) elem.cast();
if (!vertices)
{
- llwarns << "Could not find vertex source, invalid model." << llendl;
+ LL_WARNS() << "Could not find vertex source, invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
domInputLocal_Array& v_inp = vertices->getInput_array();
@@ -676,7 +684,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac
domSource* src = (domSource*) elem.cast();
if (!src)
{
- llwarns << "Could not find DOM source, invalid model." << llendl;
+ LL_WARNS() << "Could not find DOM source, invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
v = &(src->getFloat_array()->getValue());
@@ -692,7 +700,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac
domSource* src = (domSource*) elem.cast();
if (!src)
{
- llwarns << "Could not find DOM source, invalid model." << llendl;
+ LL_WARNS() << "Could not find DOM source, invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
n = &(src->getFloat_array()->getValue());
@@ -705,7 +713,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac
domSource* src = (domSource*) elem.cast();
if (!src)
{
- llwarns << "Could not find DOM source, invalid model." << llendl;
+ LL_WARNS() << "Could not find DOM source, invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
t = &(src->getFloat_array()->getValue());
@@ -743,7 +751,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac
if (!vert.getPosition().isFinite3())
{
- llwarns << "Found NaN while loading position data from DAE-Model, invalid model." << llendl;
+ LL_WARNS() << "Found NaN while loading position data from DAE-Model, invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
}
@@ -761,7 +769,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac
if (!vert.getNormal().isFinite3())
{
- llwarns << "Found NaN while loading normals from DAE-Model, invalid model." << llendl;
+ LL_WARNS() << "Found NaN while loading normals from DAE-Model, invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
}
@@ -780,7 +788,7 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector<LLVolumeFace>& fac
if (!vert.mTexCoord.isFinite())
{
- llwarns << "Found NaN while loading tex coords from DAE-Model, invalid model." << llendl;
+ LL_WARNS() << "Found NaN while loading tex coords from DAE-Model, invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
}
@@ -879,12 +887,12 @@ std::string LLModel::getStatusString(U32 status)
{
if(status_strings[status] == std::string())
{
- llerrs << "No valid status string for this status: " << (U32)status << llendl ;
+ LL_ERRS() << "No valid status string for this status: " << (U32)status << LL_ENDL ;
}
return status_strings[status] ;
}
- llerrs << "Invalid model status: " << (U32)status << llendl ;
+ LL_ERRS() << "Invalid model status: " << (U32)status << LL_ENDL ;
return std::string() ;
}
@@ -960,7 +968,7 @@ BOOL LLModel::createVolumeFacesFromDomMesh(domMesh* mesh)
}
else
{
- llwarns << "no mesh found" << llendl;
+ LL_WARNS() << "no mesh found" << LL_ENDL;
}
return FALSE;
@@ -1256,14 +1264,14 @@ void LLModel::addFace(const LLVolumeFace& face)
{
if (face.mNumVertices == 0)
{
- llerrs << "Cannot add empty face." << llendl;
+ LL_ERRS() << "Cannot add empty face." << LL_ENDL;
}
mVolumeFaces.push_back(face);
if (mVolumeFaces.size() > MAX_MODEL_FACES)
{
- llerrs << "Model prims cannot have more than " << MAX_MODEL_FACES << " faces!" << llendl;
+ LL_ERRS() << "Model prims cannot have more than " << MAX_MODEL_FACES << " faces!" << LL_ENDL;
}
}
@@ -1285,7 +1293,7 @@ void LLModel::generateNormals(F32 angle_cutoff)
if (vol_face.mNumIndices > 65535)
{
- llwarns << "Too many vertices for normal generation to work." << llendl;
+ LL_WARNS() << "Too many vertices for normal generation to work." << LL_ENDL;
continue;
}
@@ -1885,7 +1893,7 @@ LLModel::weight_list& LLModel::getJointInfluences(const LLVector3& pos)
{
if ((iter->first - pos).magVec() > 0.1f)
{
- llerrs << "Couldn't find weight list." << llendl;
+ LL_ERRS() << "Couldn't find weight list." << LL_ENDL;
}
return iter->second;
@@ -1990,7 +1998,7 @@ bool LLModel::loadModel(std::istream& is)
{
if (!LLSDSerialize::fromBinary(header, is, 1024*1024*1024))
{
- llwarns << "Mesh header parse error. Not a valid mesh asset!" << llendl;
+ LL_WARNS() << "Mesh header parse error. Not a valid mesh asset!" << LL_ENDL;
return false;
}
}
@@ -2020,7 +2028,7 @@ bool LLModel::loadModel(std::istream& is)
if (header[nm[lod]]["offset"].asInteger() == -1 ||
header[nm[lod]]["size"].asInteger() == 0 )
{ //cannot load requested LOD
- llwarns << "LoD data is invalid!" << llendl;
+ LL_WARNS() << "LoD data is invalid!" << LL_ENDL;
return false;
}
@@ -2083,7 +2091,7 @@ bool LLModel::loadModel(std::istream& is)
}
else
{
- llwarns << "unpackVolumeFaces failed!" << llendl;
+ LL_WARNS() << "unpackVolumeFaces failed!" << LL_ENDL;
}
return false;
@@ -2101,7 +2109,7 @@ bool LLModel::isMaterialListSubset( LLModel* ref )
for (U32 dst = 0; dst < refCnt; ++dst)
{
- //llinfos<<mMaterialList[src]<<" "<<ref->mMaterialList[dst]<<llendl;
+ //LL_INFOS()<<mMaterialList[src]<<" "<<ref->mMaterialList[dst]<<LL_ENDL;
foundRef = mMaterialList[src] == ref->mMaterialList[dst];
if ( foundRef )
@@ -2146,7 +2154,7 @@ bool LLModel::matchMaterialOrder(LLModel* ref, int& refFaceCnt, int& modelFaceCn
bool isASubset = isMaterialListSubset( ref );
if ( !isASubset )
{
- llinfos<<"Material of model is not a subset of reference."<<llendl;
+ LL_INFOS()<<"Material of model is not a subset of reference."<<LL_ENDL;
return false;
}
@@ -2597,7 +2605,7 @@ LLSD LLModel::Decomposition::asLLSD() const
if (vert_idx > p.size())
{
- llerrs << "Index out of bounds" << llendl;
+ LL_ERRS() << "Index out of bounds" << LL_ENDL;
}
}
}
@@ -2617,7 +2625,7 @@ void LLModel::Decomposition::merge(const LLModel::Decomposition* rhs)
if (mMeshID != rhs->mMeshID)
{
- llerrs << "Attempted to merge with decomposition of some other mesh." << llendl;
+ LL_ERRS() << "Attempted to merge with decomposition of some other mesh." << LL_ENDL;
}
if (mBaseHull.empty())
diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp
index 2fa77177f5..a505ea04a7 100755
--- a/indra/llprimitive/llprimitive.cpp
+++ b/indra/llprimitive/llprimitive.cpp
@@ -38,7 +38,6 @@
#include "lldatapacker.h"
#include "llsdutil_math.h"
#include "llprimtexturelist.h"
-#include "imageids.h"
#include "llmaterialid.h"
/**
@@ -127,7 +126,7 @@ void LLPrimitive::setVolumeManager( LLVolumeMgr* volume_manager )
{
if ( !volume_manager || sVolumeManager )
{
- llerrs << "LLPrimitive::sVolumeManager attempting to be set to NULL or it already has been set." << llendl;
+ LL_ERRS() << "LLPrimitive::sVolumeManager attempting to be set to NULL or it already has been set." << LL_ENDL;
}
sVolumeManager = volume_manager;
}
@@ -198,7 +197,7 @@ LLPrimitive *LLPrimitive::createPrimitive(LLPCode p_code)
}
else
{
- llerrs << "primitive allocation failed" << llendl;
+ LL_ERRS() << "primitive allocation failed" << LL_ENDL;
}
return retval;
@@ -484,7 +483,7 @@ LLPCode LLPrimitive::legacyToPCode(const U8 legacy)
pcode = LL_PCODE_TREE_NEW;
break;
default:
- llwarns << "Unknown legacy code " << legacy << " [" << (S32)legacy << "]!" << llendl;
+ LL_WARNS() << "Unknown legacy code " << legacy << " [" << (S32)legacy << "]!" << LL_ENDL;
}
return pcode;
@@ -579,7 +578,7 @@ U8 LLPrimitive::pCodeToLegacy(const LLPCode pcode)
legacy = TREE_NEW;
break;
default:
- llwarns << "Unknown pcode " << (S32)pcode << ":" << pcode << "!" << llendl;
+ LL_WARNS() << "Unknown pcode " << (S32)pcode << ":" << pcode << "!" << LL_ENDL;
return 0;
}
return legacy;
@@ -587,7 +586,7 @@ U8 LLPrimitive::pCodeToLegacy(const LLPCode pcode)
// static
-// Don't crash or llerrs here! This function is used for debug strings.
+// Don't crash or LL_ERRS() here! This function is used for debug strings.
std::string LLPrimitive::pCodeToString(const LLPCode pcode)
{
std::string pcode_string;
@@ -666,7 +665,7 @@ std::string LLPrimitive::pCodeToString(const LLPCode pcode)
}
else
{
- llwarns << "Unknown base mask for pcode: " << base_code << llendl;
+ LL_WARNS() << "Unknown base mask for pcode: " << base_code << LL_ENDL;
}
U8 mask_code = pcode & (~LL_PCODE_BASE_MASK);
@@ -702,7 +701,7 @@ void LLPrimitive::copyTEs(const LLPrimitive *primitivep)
U32 i;
if (primitivep->getExpectedNumTEs() != getExpectedNumTEs())
{
- llwarns << "Primitives don't have same expected number of TE's" << llendl;
+ LL_WARNS() << "Primitives don't have same expected number of TE's" << LL_ENDL;
}
U32 num_tes = llmin(primitivep->getExpectedNumTEs(), getExpectedNumTEs());
if (mTextureList.size() < getExpectedNumTEs())
@@ -804,7 +803,7 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai
{
S32 te_index = face_index_from_id(cur_mask, old_faces);
old_tes.copyTexture(face_bit, *(getTE(te_index)));
- //llinfos << face_bit << ":" << te_index << ":" << old_tes[face_bit].getID() << llendl;
+ //LL_INFOS() << face_bit << ":" << te_index << ":" << old_tes[face_bit].getID() << LL_ENDL;
}
}
@@ -824,7 +823,7 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai
if (mVolumep->getNumFaces() == 0 && new_face_mask != 0)
{
- llwarns << "Object with 0 faces found...INCORRECT!" << llendl;
+ LL_WARNS() << "Object with 0 faces found...INCORRECT!" << LL_ENDL;
setNumTEs(mVolumep->getNumFaces());
return TRUE;
}
@@ -882,7 +881,7 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai
}
if (i == 4)
{
- llwarns << "No path end or outer face in volume!" << llendl;
+ LL_WARNS() << "No path end or outer face in volume!" << LL_ENDL;
}
continue;
}
@@ -918,7 +917,7 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai
}
if (i == 4)
{
- llwarns << "No path end or outer face in volume!" << llendl;
+ LL_WARNS() << "No path end or outer face in volume!" << LL_ENDL;
}
continue;
}
@@ -944,8 +943,8 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai
}
if (-1 == min_outer_bit)
{
- llinfos << (LLVolume *)mVolumep << llendl;
- llwarns << "Bad! No outer faces, impossible!" << llendl;
+ LL_INFOS() << (LLVolume *)mVolumep << LL_ENDL;
+ LL_WARNS() << "Bad! No outer faces, impossible!" << LL_ENDL;
}
face_mapping[face_bit] = min_outer_bit;
}
@@ -964,7 +963,7 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai
{
if (-1 == face_mapping[face_bit])
{
- llwarns << "No mapping from old face to new face!" << llendl;
+ LL_WARNS() << "No mapping from old face to new face!" << LL_ENDL;
}
S32 te_num = face_index_from_id(cur_mask, mVolumep->getProfile().mFaces);
@@ -1422,7 +1421,7 @@ S32 LLPrimitive::unpackTEMessage(LLDataPacker &dp)
if (!dp.unpackBinaryData(packed_buffer, size, "TextureEntry"))
{
retval = TEM_INVALID;
- llwarns << "Bad texture entry block! Abort!" << llendl;
+ LL_WARNS() << "Bad texture entry block! Abort!" << LL_ENDL;
return retval;
}
diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h
index 47a21beaaf..cdb3f273c2 100755
--- a/indra/llprimitive/llprimitive.h
+++ b/indra/llprimitive/llprimitive.h
@@ -540,7 +540,7 @@ void LLPrimitive::setPosition(const F32 x, const F32 y, const F32 z)
}
else
{
- llerrs << "Non Finite in LLPrimitive::setPosition(x,y,z) for " << pCodeToString(mPrimitiveCode) << llendl;
+ LL_ERRS() << "Non Finite in LLPrimitive::setPosition(x,y,z) for " << pCodeToString(mPrimitiveCode) << LL_ENDL;
}
}
@@ -553,7 +553,7 @@ void LLPrimitive::setPosition(const LLVector3& pos)
}
else
{
- llerrs << "Non Finite in LLPrimitive::setPosition(LLVector3) for " << pCodeToString(mPrimitiveCode) << llendl;
+ LL_ERRS() << "Non Finite in LLPrimitive::setPosition(LLVector3) for " << pCodeToString(mPrimitiveCode) << LL_ENDL;
}
}
@@ -565,7 +565,7 @@ void LLPrimitive::setAngularVelocity(const LLVector3& avel)
}
else
{
- llerror("Non Finite in LLPrimitive::setAngularVelocity", 0);
+ LL_ERRS() << "Non Finite in LLPrimitive::setAngularVelocity" << LL_ENDL;
}
}
@@ -577,7 +577,7 @@ void LLPrimitive::setAngularVelocity(const F32 x, const F32 y, const F32 z)
}
else
{
- llerror("Non Finite in LLPrimitive::setAngularVelocity", 0);
+ LL_ERRS() << "Non Finite in LLPrimitive::setAngularVelocity" << LL_ENDL;
}
}
@@ -589,7 +589,7 @@ void LLPrimitive::setVelocity(const LLVector3& vel)
}
else
{
- llerrs << "Non Finite in LLPrimitive::setVelocity(LLVector3) for " << pCodeToString(mPrimitiveCode) << llendl;
+ LL_ERRS() << "Non Finite in LLPrimitive::setVelocity(LLVector3) for " << pCodeToString(mPrimitiveCode) << LL_ENDL;
}
}
@@ -601,7 +601,7 @@ void LLPrimitive::setVelocity(const F32 x, const F32 y, const F32 z)
}
else
{
- llerrs << "Non Finite in LLPrimitive::setVelocity(F32,F32,F32) for " << pCodeToString(mPrimitiveCode) << llendl;
+ LL_ERRS() << "Non Finite in LLPrimitive::setVelocity(F32,F32,F32) for " << pCodeToString(mPrimitiveCode) << LL_ENDL;
}
}
@@ -613,7 +613,7 @@ void LLPrimitive::setVelocityX(const F32 x)
}
else
{
- llerror("Non Finite in LLPrimitive::setVelocityX", 0);
+ LL_ERRS() << "Non Finite in LLPrimitive::setVelocityX" << LL_ENDL;
}
}
@@ -625,7 +625,7 @@ void LLPrimitive::setVelocityY(const F32 y)
}
else
{
- llerror("Non Finite in LLPrimitive::setVelocityY", 0);
+ LL_ERRS() << "Non Finite in LLPrimitive::setVelocityY" << LL_ENDL;
}
}
@@ -637,7 +637,7 @@ void LLPrimitive::setVelocityZ(const F32 z)
}
else
{
- llerror("Non Finite in LLPrimitive::setVelocityZ", 0);
+ LL_ERRS() << "Non Finite in LLPrimitive::setVelocityZ" << LL_ENDL;
}
}
@@ -649,7 +649,7 @@ void LLPrimitive::addVelocity(const LLVector3& vel)
}
else
{
- llerror("Non Finite in LLPrimitive::addVelocity", 0);
+ LL_ERRS() << "Non Finite in LLPrimitive::addVelocity" << LL_ENDL;
}
}
@@ -661,7 +661,7 @@ void LLPrimitive::setAcceleration(const LLVector3& accel)
}
else
{
- llerrs << "Non Finite in LLPrimitive::setAcceleration(LLVector3) for " << pCodeToString(mPrimitiveCode) << llendl;
+ LL_ERRS() << "Non Finite in LLPrimitive::setAcceleration(LLVector3) for " << pCodeToString(mPrimitiveCode) << LL_ENDL;
}
}
@@ -673,7 +673,7 @@ void LLPrimitive::setAcceleration(const F32 x, const F32 y, const F32 z)
}
else
{
- llerrs << "Non Finite in LLPrimitive::setAcceleration(F32,F32,F32) for " << pCodeToString(mPrimitiveCode) << llendl;
+ LL_ERRS() << "Non Finite in LLPrimitive::setAcceleration(F32,F32,F32) for " << pCodeToString(mPrimitiveCode) << LL_ENDL;
}
}
#endif // CHECK_FOR_FINITE
diff --git a/indra/llprimitive/llprimlinkinfo.h b/indra/llprimitive/llprimlinkinfo.h
index 82c50cfe2f..bee25975f1 100755
--- a/indra/llprimitive/llprimlinkinfo.h
+++ b/indra/llprimitive/llprimlinkinfo.h
@@ -274,28 +274,28 @@ S32 LLPrimLinkInfo< DATA_TYPE >::merge(LLPrimLinkInfo& other_info)
// other_info.computeBoundingSphere();
// if ( other_radius != other_info.mBoundingSphere.getRadius() )
// {
-// llinfos << "Other bounding sphere changed!!" << llendl;
+// LL_INFOS() << "Other bounding sphere changed!!" << LL_ENDL;
// }
// F32 this_radius = mBoundingSphere.getRadius();
// computeBoundingSphere();
// if ( this_radius != mBoundingSphere.getRadius() )
// {
-// llinfos << "This bounding sphere changed!!" << llendl;
+// LL_INFOS() << "This bounding sphere changed!!" << LL_ENDL;
// }
F32 max_span = get_max_linkable_span(mBoundingSphere, other_info.mBoundingSphere);
// F32 center_dist = (mBoundingSphere.getCenter() - other_info.mBoundingSphere.getCenter()).length();
- // llinfos << "objects are " << center_dist << "m apart" << llendl;
+ // LL_INFOS() << "objects are " << center_dist << "m apart" << LL_ENDL;
F32 span = get_span(mBoundingSphere, other_info.mBoundingSphere);
F32 span_limit = max_span + (2.f * other_info.mBoundingSphere.getRadius());
if (span > span_limit)
{
// there is no way any piece of other_info could link with this one
- // llinfos << "span too large: " << span << " vs. " << span_limit << llendl;
+ // LL_INFOS() << "span too large: " << span << " vs. " << span_limit << LL_ENDL;
return 0;
}
diff --git a/indra/llprimitive/llprimtexturelist.cpp b/indra/llprimitive/llprimtexturelist.cpp
index 537e7a6695..dfae9699ec 100755
--- a/indra/llprimitive/llprimtexturelist.cpp
+++ b/indra/llprimitive/llprimtexturelist.cpp
@@ -130,7 +130,7 @@ S32 LLPrimTextureList::copyTexture(const U8 index, const LLTextureEntry& te)
if (S32(index) >= mEntryList.size())
{
S32 current_size = mEntryList.size();
- llwarns << "ignore copy of index = " << S32(index) << " into texture entry list of size = " << current_size << llendl;
+ LL_WARNS() << "ignore copy of index = " << S32(index) << " into texture entry list of size = " << current_size << LL_ENDL;
return TEM_CHANGE_NONE;
}
diff --git a/indra/llprimitive/lltextureanim.cpp b/indra/llprimitive/lltextureanim.cpp
index 185a3f69c0..031a315d62 100755
--- a/indra/llprimitive/lltextureanim.cpp
+++ b/indra/llprimitive/lltextureanim.cpp
@@ -125,7 +125,7 @@ void LLTextureAnim::unpackTAMessage(LLMessageSystem *mesgsys, const S32 block_nu
{
if (size)
{
- llwarns << "Bad size " << size << " for TA block, ignoring." << llendl;
+ LL_WARNS() << "Bad size " << size << " for TA block, ignoring." << LL_ENDL;
}
mMode = 0;
return;
@@ -160,7 +160,7 @@ void LLTextureAnim::unpackTAMessage(LLDataPacker &dp)
{
if (size)
{
- llwarns << "Bad size " << size << " for TA block, ignoring." << llendl;
+ LL_WARNS() << "Bad size " << size << " for TA block, ignoring." << LL_ENDL;
}
mMode = 0;
return;
diff --git a/indra/llprimitive/lltextureentry.cpp b/indra/llprimitive/lltextureentry.cpp
index 0db75a0e82..284dfc15f4 100755
--- a/indra/llprimitive/lltextureentry.cpp
+++ b/indra/llprimitive/lltextureentry.cpp
@@ -271,8 +271,8 @@ bool LLTextureEntry::fromLLSD(const LLSD& sd)
w = TEXTURE_MEDIA_DATA_KEY;
if (hasMedia() != sd.has(w))
{
- llwarns << "LLTextureEntry::fromLLSD: media_flags (" << hasMedia() <<
- ") does not match presence of media_data (" << sd.has(w) << "). Fixing." << llendl;
+ LL_WARNS() << "LLTextureEntry::fromLLSD: media_flags (" << hasMedia() <<
+ ") does not match presence of media_data (" << sd.has(w) << "). Fixing." << LL_ENDL;
}
updateMediaData(sd[w]);
diff --git a/indra/llprimitive/lltreeparams.cpp b/indra/llprimitive/lltreeparams.cpp
index 842d848217..19a6db20ae 100755
--- a/indra/llprimitive/lltreeparams.cpp
+++ b/indra/llprimitive/lltreeparams.cpp
@@ -40,7 +40,7 @@
LLTreeParams::LLTreeParams()
{
-// llinfos << "TREE PARAMS INITIALIZED" << llendl;
+// LL_INFOS() << "TREE PARAMS INITIALIZED" << LL_ENDL;
// init to basic something or other...
mShape = SR_TEND_FLAME;
mLevels = 1;
diff --git a/indra/llprimitive/llvolumemessage.cpp b/indra/llprimitive/llvolumemessage.cpp
index 58b23bebd2..a2c2666146 100755
--- a/indra/llprimitive/llvolumemessage.cpp
+++ b/indra/llprimitive/llvolumemessage.cpp
@@ -109,8 +109,8 @@ bool LLVolumeMessage::unpackProfileParams(
temp_f32 = temp_u16 * CUT_QUANTA;
if (temp_f32 > 1.f)
{
- llwarns << "Profile begin out of range: " << temp_f32
- << ". Clamping to 0.0." << llendl;
+ LL_WARNS() << "Profile begin out of range: " << temp_f32
+ << ". Clamping to 0.0." << LL_ENDL;
temp_f32 = 0.f;
ok = false;
}
@@ -120,8 +120,8 @@ bool LLVolumeMessage::unpackProfileParams(
temp_f32 = temp_u16 * CUT_QUANTA;
if (temp_f32 > 1.f)
{
- llwarns << "Profile end out of range: " << 1.f - temp_f32
- << ". Clamping to 1.0." << llendl;
+ LL_WARNS() << "Profile end out of range: " << 1.f - temp_f32
+ << ". Clamping to 1.0." << LL_ENDL;
temp_f32 = 1.f;
ok = false;
}
@@ -131,19 +131,19 @@ bool LLVolumeMessage::unpackProfileParams(
temp_f32 = temp_u16 * HOLLOW_QUANTA;
if (temp_f32 > 1.f)
{
- llwarns << "Profile hollow out of range: " << temp_f32
- << ". Clamping to 0.0." << llendl;
+ LL_WARNS() << "Profile hollow out of range: " << temp_f32
+ << ". Clamping to 0.0." << LL_ENDL;
temp_f32 = 0.f;
ok = false;
}
params->setHollow(temp_f32);
/*
- llinfos << "Unpacking Profile Block " << block_num << llendl;
- llinfos << "Curve: " << (U32)getCurve() << llendl;
- llinfos << "Begin: " << getBegin() << llendl;
- llinfos << "End: " << getEnd() << llendl;
- llinfos << "Hollow: " << getHollow() << llendl;
+ LL_INFOS() << "Unpacking Profile Block " << block_num << LL_ENDL;
+ LL_INFOS() << "Curve: " << (U32)getCurve() << LL_ENDL;
+ LL_INFOS() << "Begin: " << getBegin() << LL_ENDL;
+ LL_INFOS() << "End: " << getEnd() << LL_ENDL;
+ LL_INFOS() << "Hollow: " << getHollow() << LL_ENDL;
*/
return ok;
@@ -165,8 +165,8 @@ bool LLVolumeMessage::unpackProfileParams(
temp_f32 = temp_u16 * CUT_QUANTA;
if (temp_f32 > 1.f)
{
- llwarns << "Profile begin out of range: " << temp_f32 << llendl;
- llwarns << "Clamping to 0.0" << llendl;
+ LL_WARNS() << "Profile begin out of range: " << temp_f32 << LL_ENDL;
+ LL_WARNS() << "Clamping to 0.0" << LL_ENDL;
temp_f32 = 0.f;
ok = false;
}
@@ -176,8 +176,8 @@ bool LLVolumeMessage::unpackProfileParams(
temp_f32 = temp_u16 * CUT_QUANTA;
if (temp_f32 > 1.f)
{
- llwarns << "Profile end out of range: " << 1.f - temp_f32 << llendl;
- llwarns << "Clamping to 1.0" << llendl;
+ LL_WARNS() << "Profile end out of range: " << 1.f - temp_f32 << LL_ENDL;
+ LL_WARNS() << "Clamping to 1.0" << LL_ENDL;
temp_f32 = 1.f;
ok = false;
}
@@ -187,8 +187,8 @@ bool LLVolumeMessage::unpackProfileParams(
temp_f32 = temp_u16 * HOLLOW_QUANTA;
if (temp_f32 > 1.f)
{
- llwarns << "Profile hollow out of range: " << temp_f32 << llendl;
- llwarns << "Clamping to 0.0" << llendl;
+ LL_WARNS() << "Profile hollow out of range: " << temp_f32 << LL_ENDL;
+ LL_WARNS() << "Clamping to 0.0" << LL_ENDL;
temp_f32 = 0.f;
ok = false;
}
@@ -379,12 +379,12 @@ bool LLVolumeMessage::unpackPathParams(
params->setSkew((F32)(skew * SCALE_QUANTA));
/*
- llinfos << "Unpacking Path Block " << block_num << llendl;
- llinfos << "Curve: " << (U32)params->getCurve() << llendl;
- llinfos << "Begin: " << params->getBegin() << llendl;
- llinfos << "End: " << params->getEnd() << llendl;
- llinfos << "Scale: " << params->getScale() << llendl;
- llinfos << "Twist: " << params->getTwist() << llendl;
+ LL_INFOS() << "Unpacking Path Block " << block_num << LL_ENDL;
+ LL_INFOS() << "Curve: " << (U32)params->getCurve() << LL_ENDL;
+ LL_INFOS() << "Begin: " << params->getBegin() << LL_ENDL;
+ LL_INFOS() << "End: " << params->getEnd() << LL_ENDL;
+ LL_INFOS() << "Scale: " << params->getScale() << LL_ENDL;
+ LL_INFOS() << "Twist: " << params->getTwist() << LL_ENDL;
*/
return true;
@@ -480,16 +480,16 @@ bool LLVolumeMessage::constrainVolumeParams(LLVolumeParams& params)
bad |= params.setSkew(params.getPathParams().getSkew()) ? 0 : 0x800;
if(bad)
{
- llwarns << "LLVolumeMessage::constrainVolumeParams() - "
+ LL_WARNS() << "LLVolumeMessage::constrainVolumeParams() - "
<< "forced to constrain incoming volume params: "
- << llformat("0x%04x",bad) << llendl;
+ << llformat("0x%04x",bad) << LL_ENDL;
}
return bad ? false : true;
}
bool LLVolumeMessage::packVolumeParams(const LLVolumeParams* params, LLMessageSystem *mesgsys)
{
- // llinfos << "pack volume" << llendl;
+ // LL_INFOS() << "pack volume" << LL_ENDL;
if (params)
{
packPathParams(&params->getPathParams(), mesgsys);
@@ -505,7 +505,7 @@ bool LLVolumeMessage::packVolumeParams(const LLVolumeParams* params, LLMessageSy
bool LLVolumeMessage::packVolumeParams(const LLVolumeParams* params, LLDataPacker &dp)
{
- // llinfos << "pack volume" << llendl;
+ // LL_INFOS() << "pack volume" << LL_ENDL;
if (params)
{
packPathParams(&params->getPathParams(), dp);
diff --git a/indra/llprimitive/llvolumexml.cpp b/indra/llprimitive/llvolumexml.cpp
deleted file mode 100755
index bf2297a029..0000000000
--- a/indra/llprimitive/llvolumexml.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * @file llvolumexml.cpp
- * @brief LLVolumeXml base class
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "linden_common.h"
-
-#include "llvolumexml.h"
-
-//============================================================================
-
-// LLVolumeXml is just a wrapper class; all members are static
-
-//============================================================================
-
-LLPointer<LLXMLNode> LLVolumeXml::exportProfileParams(const LLProfileParams* params)
-{
- LLPointer<LLXMLNode> ret = new LLXMLNode("profile", FALSE);
-
- ret->createChild("curve_type", TRUE)->setByteValue(1, &params->getCurveType());
- ret->createChild("interval", FALSE)->setFloatValue(2, &params->getBegin());
- ret->createChild("hollow", FALSE)->setFloatValue(1, &params->getHollow());
-
- return ret;
-}
-
-
-LLPointer<LLXMLNode> LLVolumeXml::exportPathParams(const LLPathParams* params)
-{
- LLPointer<LLXMLNode> ret = new LLXMLNode("path", FALSE);
- ret->createChild("curve_type", TRUE)->setByteValue(1, &params->getCurveType());
- ret->createChild("interval", FALSE)->setFloatValue(2, &params->getBegin());
- ret->createChild("scale", FALSE)->setFloatValue(2, params->getScale().mV);
- ret->createChild("shear", FALSE)->setFloatValue(2, params->getShear().mV);
- ret->createChild("twist_interval", FALSE)->setFloatValue(2, &params->getTwistBegin());
- ret->createChild("radius_offset", FALSE)->setFloatValue(1, &params->getRadiusOffset());
- ret->createChild("taper", FALSE)->setFloatValue(2, params->getTaper().mV);
- ret->createChild("revolutions", FALSE)->setFloatValue(1, &params->getRevolutions());
- ret->createChild("skew", FALSE)->setFloatValue(1, &params->getSkew());
-
- return ret;
-}
-
-
-LLPointer<LLXMLNode> LLVolumeXml::exportVolumeParams(const LLVolumeParams* params)
-{
- LLPointer<LLXMLNode> ret = new LLXMLNode("shape", FALSE);
-
- LLPointer<LLXMLNode> node ;
- node = exportPathParams(&params->getPathParams()) ;
- node->setParent(ret);
- node = exportProfileParams(&params->getProfileParams()) ;
- node->setParent(ret);
-
- return ret;
-}
-
diff --git a/indra/llprimitive/llvolumexml.h b/indra/llprimitive/llvolumexml.h
deleted file mode 100755
index 9d4d989475..0000000000
--- a/indra/llprimitive/llvolumexml.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * @file llvolumexml.h
- * @brief LLVolumeXml base class
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLVOLUMEXML_H
-#define LL_LLVOLUMEXML_H
-
-#include "llvolume.h"
-#include "llxmlnode.h"
-
-// wrapper class for some volume/message functions
-class LLVolumeXml
-{
-public:
- static LLPointer<LLXMLNode> exportProfileParams(const LLProfileParams* params);
-
- static LLPointer<LLXMLNode> exportPathParams(const LLPathParams* params);
-
- static LLPointer<LLXMLNode> exportVolumeParams(const LLVolumeParams* params);
-};
-
-#endif // LL_LLVOLUMEXML_H
-
diff --git a/indra/llprimitive/tests/llmediaentry_test.cpp b/indra/llprimitive/tests/llmediaentry_test.cpp
index 16e5f894e2..b072ce3964 100755
--- a/indra/llprimitive/tests/llmediaentry_test.cpp
+++ b/indra/llprimitive/tests/llmediaentry_test.cpp
@@ -39,7 +39,7 @@
#include "llsdserialize.h"
#include "../llmediaentry.h"
-#include "lllslconstants.h"
+#include "indra_constants.h"
#define DEFAULT_MEDIA_ENTRY "<llsd>\n\
<map>\n\
diff --git a/indra/llrender/llcubemap.cpp b/indra/llrender/llcubemap.cpp
index 45a3b18179..af4e3fdda0 100755
--- a/indra/llrender/llcubemap.cpp
+++ b/indra/llrender/llcubemap.cpp
@@ -100,7 +100,7 @@ void LLCubeMap::initGL()
}
else
{
- llwarns << "Using cube map without extension!" << llendl;
+ LL_WARNS() << "Using cube map without extension!" << LL_ENDL;
}
}
diff --git a/indra/llrender/llfontbitmapcache.cpp b/indra/llrender/llfontbitmapcache.cpp
index c985f6b959..f128636ab2 100755
--- a/indra/llrender/llfontbitmapcache.cpp
+++ b/indra/llrender/llfontbitmapcache.cpp
@@ -29,7 +29,8 @@
#include "llgl.h"
#include "llfontbitmapcache.h"
-LLFontBitmapCache::LLFontBitmapCache():
+LLFontBitmapCache::LLFontBitmapCache()
+: LLTrace::MemTrackable<LLFontBitmapCache>("LLFontBitmapCache"),
mNumComponents(0),
mBitmapWidth(0),
mBitmapHeight(0),
@@ -81,6 +82,7 @@ BOOL LLFontBitmapCache::nextOpenPos(S32 width, S32 &pos_x, S32 &pos_y, S32& bitm
{
// We're out of space in the current image, or no image
// has been allocated yet. Make a new one.
+
mImageRawVec.push_back(new LLImageRaw);
mBitmapNum = mImageRawVec.size()-1;
LLImageRaw *image_raw = getImageRaw(mBitmapNum);
@@ -122,6 +124,9 @@ BOOL LLFontBitmapCache::nextOpenPos(S32 width, S32 &pos_x, S32 &pos_y, S32& bitm
image_gl->createGLTexture(0, image_raw);
gGL.getTexUnit(0)->bind(image_gl);
image_gl->setFilteringOption(LLTexUnit::TFO_POINT); // was setMipFilterNearest(TRUE, TRUE);
+
+ claimMem(image_raw);
+ claimMem(image_gl);
}
else
{
@@ -151,7 +156,20 @@ void LLFontBitmapCache::destroyGL()
void LLFontBitmapCache::reset()
{
+ for (std::vector<LLPointer<LLImageRaw> >::iterator it = mImageRawVec.begin(), end_it = mImageRawVec.end();
+ it != end_it;
+ ++it)
+ {
+ disclaimMem(**it);
+ }
mImageRawVec.clear();
+
+ for (std::vector<LLPointer<LLImageGL> >::iterator it = mImageGLVec.begin(), end_it = mImageGLVec.end();
+ it != end_it;
+ ++it)
+ {
+ disclaimMem(**it);
+ }
mImageGLVec.clear();
mBitmapWidth = 0;
diff --git a/indra/llrender/llfontbitmapcache.h b/indra/llrender/llfontbitmapcache.h
index c93b0c7320..75df3a94a7 100755
--- a/indra/llrender/llfontbitmapcache.h
+++ b/indra/llrender/llfontbitmapcache.h
@@ -28,10 +28,11 @@
#define LL_LLFONTBITMAPCACHE_H
#include <vector>
+#include "lltrace.h"
// Maintain a collection of bitmaps containing rendered glyphs.
// Generalizes the single-bitmap logic from LLFontFreetype and LLFontGL.
-class LLFontBitmapCache: public LLRefCount
+class LLFontBitmapCache : public LLTrace::MemTrackable<LLFontBitmapCache>
{
public:
LLFontBitmapCache();
diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp
index 84c782e958..25b1c533c1 100755
--- a/indra/llrender/llfontfreetype.cpp
+++ b/indra/llrender/llfontfreetype.cpp
@@ -75,7 +75,7 @@ LLFontManager::LLFontManager()
if (error)
{
// Clean up freetype libs.
- llerrs << "Freetype initialization failure!" << llendl;
+ LL_ERRS() << "Freetype initialization failure!" << LL_ENDL;
FT_Done_FreeType(gFTLibrary);
}
}
@@ -101,7 +101,8 @@ LLFontGlyphInfo::LLFontGlyphInfo(U32 index)
}
LLFontFreetype::LLFontFreetype()
-: mFontBitmapCachep(new LLFontBitmapCache),
+: LLTrace::MemTrackable<LLFontFreetype>("LLFontFreetype"),
+ mFontBitmapCachep(new LLFontBitmapCache),
mValid(FALSE),
mAscender(0.f),
mDescender(0.f),
@@ -127,7 +128,7 @@ LLFontFreetype::~LLFontFreetype()
std::for_each(mCharGlyphInfoMap.begin(), mCharGlyphInfoMap.end(), DeletePairedPointer());
mCharGlyphInfoMap.clear();
- // mFontBitmapCachep will be cleaned up by LLPointer destructor.
+ delete mFontBitmapCachep;
// mFallbackFonts cleaned up by LLPointer destructor
}
@@ -187,10 +188,12 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v
S32 max_char_height = llround(0.5f + (y_max - y_min));
mFontBitmapCachep->init(components, max_char_width, max_char_height);
+ claimMem(mFontBitmapCachep);
+
if (!mFTFace->charmap)
{
- //llinfos << " no unicode encoding, set whatever encoding there is..." << llendl;
+ //LL_INFOS() << " no unicode encoding, set whatever encoding there is..." << LL_ENDL;
FT_Set_Charmap(mFTFace, mFTFace->charmaps[0]);
}
@@ -201,6 +204,7 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v
}
mName = filename;
+ claimMem(mName);
mPointSize = point_size;
mStyle = LLFontGL::NORMAL;
@@ -322,7 +326,7 @@ LLFontGlyphInfo* LLFontFreetype::addGlyph(llwchar wch) const
return FALSE;
llassert(!mIsFallback);
- //lldebugs << "Adding new glyph for " << wch << " to font" << llendl;
+ //LL_DEBUGS() << "Adding new glyph for " << wch << " to font" << LL_ENDL;
FT_UInt glyph_index;
@@ -330,7 +334,7 @@ LLFontGlyphInfo* LLFontFreetype::addGlyph(llwchar wch) const
glyph_index = FT_Get_Char_Index(mFTFace, wch);
if (glyph_index == 0)
{
- //llinfos << "Trying to add glyph from fallback font!" << llendl;
+ //LL_INFOS() << "Trying to add glyph from fallback font!" << LL_ENDL;
font_vector_t::const_iterator iter;
for(iter = mFallbackFonts.begin(); iter != mFallbackFonts.end(); iter++)
{
@@ -477,6 +481,7 @@ void LLFontFreetype::insertGlyphInfo(llwchar wch, LLFontGlyphInfo* gi) const
}
else
{
+ claimMem(gi);
mCharGlyphInfoMap[wch] = gi;
}
}
@@ -502,7 +507,7 @@ void LLFontFreetype::reset(F32 vert_dpi, F32 horz_dpi)
// This is the head of the list - need to rebuild ourself and all fallbacks.
if (mFallbackFonts.empty())
{
- llwarns << "LLFontGL::reset(), no fallback fonts present" << llendl;
+ LL_WARNS() << "LLFontGL::reset(), no fallback fonts present" << LL_ENDL;
}
else
{
@@ -518,8 +523,15 @@ void LLFontFreetype::reset(F32 vert_dpi, F32 horz_dpi)
void LLFontFreetype::resetBitmapCache()
{
- for_each(mCharGlyphInfoMap.begin(), mCharGlyphInfoMap.end(), DeletePairedPointer());
+ for (char_glyph_info_map_t::iterator it = mCharGlyphInfoMap.begin(), end_it = mCharGlyphInfoMap.end();
+ it != end_it;
+ ++it)
+ {
+ disclaimMem(it->second);
+ delete it->second;
+ }
mCharGlyphInfoMap.clear();
+ disclaimMem(mFontBitmapCachep);
mFontBitmapCachep->reset();
// Adding default glyph is skipped for fallback fonts here as well as in loadFace().
@@ -541,7 +553,7 @@ const std::string &LLFontFreetype::getName() const
return mName;
}
-const LLPointer<LLFontBitmapCache> LLFontFreetype::getFontBitmapCache() const
+const LLFontBitmapCache* LLFontFreetype::getFontBitmapCache() const
{
return mFontBitmapCachep;
}
diff --git a/indra/llrender/llfontfreetype.h b/indra/llrender/llfontfreetype.h
index f1b23f22d5..2963fbd43d 100755
--- a/indra/llrender/llfontfreetype.h
+++ b/indra/llrender/llfontfreetype.h
@@ -74,7 +74,7 @@ struct LLFontGlyphInfo
extern LLFontManager *gFontManagerp;
-class LLFontFreetype : public LLRefCount
+class LLFontFreetype : public LLRefCount, public LLTrace::MemTrackable<LLFontFreetype>
{
public:
LLFontFreetype();
@@ -134,7 +134,7 @@ public:
const std::string& getName() const;
- const LLPointer<LLFontBitmapCache> getFontBitmapCache() const;
+ const LLFontBitmapCache* getFontBitmapCache() const;
void setStyle(U8 style);
U8 getStyle() const;
@@ -167,7 +167,7 @@ private:
typedef boost::unordered_map<llwchar, LLFontGlyphInfo*> char_glyph_info_map_t;
mutable char_glyph_info_map_t mCharGlyphInfoMap; // Information about glyph location in bitmap
- mutable LLPointer<LLFontBitmapCache> mFontBitmapCachep;
+ mutable LLFontBitmapCache* mFontBitmapCachep;
mutable S32 mRenderGlyphCount;
mutable S32 mAddGlyphCount;
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index c4f36cabd0..1d181b476a 100755
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -29,6 +29,7 @@
#include "llfontgl.h"
// Linden library includes
+#include "llfasttimer.h"
#include "llfontfreetype.h"
#include "llfontbitmapcache.h"
#include "llfontregistry.h"
@@ -97,7 +98,7 @@ BOOL LLFontGL::loadFace(const std::string& filename, F32 point_size, F32 vert_dp
return mFontFreetype->loadFace(filename, point_size, vert_dpi, horz_dpi, components, is_fallback);
}
-static LLFastTimer::DeclareTimer FTM_RENDER_FONTS("Fonts");
+static LLTrace::BlockTimerStatHandle FTM_RENDER_FONTS("Fonts");
S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, const LLRect& rect, const LLColor4 &color, HAlign halign, VAlign valign, U8 style,
ShadowType shadow, S32 max_chars, F32* right_x, BOOL use_ellipses) const
@@ -128,7 +129,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, const LLRect& rect
S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, const LLColor4 &color, HAlign halign, VAlign valign, U8 style,
ShadowType shadow, S32 max_chars, S32 max_pixels, F32* right_x, BOOL use_ellipses) const
{
- LLFastTimer _(FTM_RENDER_FONTS);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_FONTS);
if(!sDisplayFont) //do not display texts
{
@@ -275,7 +276,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
}
if (!fgi)
{
- llerrs << "Missing Glyph Info" << llendl;
+ LL_ERRS() << "Missing Glyph Info" << LL_ENDL;
break;
}
// Per-glyph bitmap texture.
@@ -1069,7 +1070,7 @@ std::string LLFontGL::getFontPathSystem()
system_root = getenv("SystemRoot"); /* Flawfinder: ignore */
if (!system_root)
{
- llwarns << "SystemRoot not found, attempting to load fonts from default path." << llendl;
+ LL_WARNS() << "SystemRoot not found, attempting to load fonts from default path." << LL_ENDL;
}
#endif
@@ -1114,12 +1115,12 @@ std::string LLFontGL::getFontPathLocal()
LLFontGL::LLFontGL(const LLFontGL &source)
{
- llerrs << "Not implemented!" << llendl;
+ LL_ERRS() << "Not implemented!" << LL_ENDL;
}
LLFontGL &LLFontGL::operator=(const LLFontGL &source)
{
- llerrs << "Not implemented" << llendl;
+ LL_ERRS() << "Not implemented" << LL_ENDL;
return *this;
}
diff --git a/indra/llrender/llfontregistry.cpp b/indra/llrender/llfontregistry.cpp
index f5ca8d5b04..d003687415 100755
--- a/indra/llrender/llfontregistry.cpp
+++ b/indra/llrender/llfontregistry.cpp
@@ -34,13 +34,15 @@
#include "llcontrol.h"
#include "lldir.h"
#include "llwindow.h"
+#include "llxmlnode.h"
extern LLControlGroup gSavedSettings;
using std::string;
using std::map;
-bool fontDescInitFromXML(LLXMLNodePtr node, LLFontDescriptor& desc);
+bool font_desc_init_from_xml(LLXMLNodePtr node, LLFontDescriptor& desc);
+bool init_from_xml(LLFontRegistry* registry, LLXMLNodePtr node);
LLFontDescriptor::LLFontDescriptor():
mStyle(0)
@@ -198,7 +200,7 @@ bool LLFontRegistry::parseFontInfo(const std::string& xml_filename)
if ( root.isNull() || ! root->hasName( "fonts" ) )
{
- llwarns << "Bad font info file: " << *path_it << llendl;
+ LL_WARNS() << "Bad font info file: " << *path_it << LL_ENDL;
continue;
}
@@ -207,7 +209,7 @@ bool LLFontRegistry::parseFontInfo(const std::string& xml_filename)
if (root->hasName("fonts"))
{
// Expect a collection of children consisting of "font" or "font_size" entries
- bool init_succ = initFromXML(root);
+ bool init_succ = init_from_xml(this, root);
success = success || init_succ;
}
}
@@ -230,7 +232,7 @@ std::string currentOsName()
#endif
}
-bool fontDescInitFromXML(LLXMLNodePtr node, LLFontDescriptor& desc)
+bool font_desc_init_from_xml(LLXMLNodePtr node, LLFontDescriptor& desc)
{
if (node->hasName("font"))
{
@@ -263,14 +265,14 @@ bool fontDescInitFromXML(LLXMLNodePtr node, LLFontDescriptor& desc)
{
if (child_name == currentOsName())
{
- fontDescInitFromXML(child, desc);
+ font_desc_init_from_xml(child, desc);
}
}
}
return true;
}
-bool LLFontRegistry::initFromXML(LLXMLNodePtr node)
+bool init_from_xml(LLFontRegistry* registry, LLXMLNodePtr node)
{
LLXMLNodePtr child;
@@ -281,17 +283,17 @@ bool LLFontRegistry::initFromXML(LLXMLNodePtr node)
if (child->hasName("font"))
{
LLFontDescriptor desc;
- bool font_succ = fontDescInitFromXML(child, desc);
+ bool font_succ = font_desc_init_from_xml(child, desc);
LLFontDescriptor norm_desc = desc.normalize();
if (font_succ)
{
// if this is the first time we've seen this font name,
// create a new template map entry for it.
- const LLFontDescriptor *match_desc = getMatchingFontDesc(desc);
+ const LLFontDescriptor *match_desc = registry->getMatchingFontDesc(desc);
if (match_desc == NULL)
{
// Create a new entry (with no corresponding font).
- mFontMap[norm_desc] = NULL;
+ registry->mFontMap[norm_desc] = NULL;
}
// otherwise, find the existing entry and combine data.
else
@@ -306,8 +308,8 @@ bool LLFontRegistry::initFromXML(LLXMLNodePtr node)
desc.getFileNames().end());
LLFontDescriptor new_desc = *match_desc;
new_desc.getFileNames() = match_file_names;
- mFontMap.erase(*match_desc);
- mFontMap[new_desc] = NULL;
+ registry->mFontMap.erase(*match_desc);
+ registry->mFontMap[new_desc] = NULL;
}
}
}
@@ -318,7 +320,7 @@ bool LLFontRegistry::initFromXML(LLXMLNodePtr node)
if (child->getAttributeString("name",size_name) &&
child->getAttributeF32("size",size_value))
{
- mFontSizes[size_name] = size_value;
+ registry->mFontSizes[size_name] = size_value;
}
}
@@ -351,10 +353,10 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc)
bool found_size = nameToSize(norm_desc.getSize(),point_size);
if (!found_size)
{
- llwarns << "createFont unrecognized size " << norm_desc.getSize() << llendl;
+ LL_WARNS() << "createFont unrecognized size " << norm_desc.getSize() << LL_ENDL;
return NULL;
}
- llinfos << "createFont " << norm_desc.getName() << " size " << norm_desc.getSize() << " style " << ((S32) norm_desc.getStyle()) << llendl;
+ LL_INFOS() << "createFont " << norm_desc.getName() << " size " << norm_desc.getSize() << " style " << ((S32) norm_desc.getStyle()) << LL_ENDL;
F32 fallback_scale = 1.0;
// Find corresponding font template (based on same descriptor with no size specified)
@@ -363,8 +365,8 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc)
const LLFontDescriptor *match_desc = getClosestFontTemplate(template_desc);
if (!match_desc)
{
- llwarns << "createFont failed, no template found for "
- << norm_desc.getName() << " style [" << ((S32)norm_desc.getStyle()) << "]" << llendl;
+ LL_WARNS() << "createFont failed, no template found for "
+ << norm_desc.getName() << " style [" << ((S32)norm_desc.getStyle()) << "]" << LL_ENDL;
return NULL;
}
@@ -377,7 +379,7 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc)
// This may not be the best solution, but it at least prevents a crash.
if (it != mFontMap.end() && it->second != NULL)
{
- llinfos << "-- matching font exists: " << nearest_exact_desc.getName() << " size " << nearest_exact_desc.getSize() << " style " << ((S32) nearest_exact_desc.getStyle()) << llendl;
+ LL_INFOS() << "-- matching font exists: " << nearest_exact_desc.getName() << " size " << nearest_exact_desc.getSize() << " style " << ((S32) nearest_exact_desc.getStyle()) << LL_ENDL;
// copying underlying Freetype font, and storing in LLFontGL with requested font descriptor
LLFontGL *font = new LLFontGL;
@@ -410,7 +412,7 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc)
// Load fonts based on names.
if (file_names.empty())
{
- llwarns << "createFont failed, no file names specified" << llendl;
+ LL_WARNS() << "createFont failed, no file names specified" << LL_ENDL;
return NULL;
}
@@ -478,7 +480,7 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc)
}
else
{
- llwarns << "createFont failed in some way" << llendl;
+ LL_WARNS() << "createFont failed in some way" << LL_ENDL;
}
mFontMap[desc] = result;
@@ -531,9 +533,9 @@ LLFontGL *LLFontRegistry::getFont(const LLFontDescriptor& desc)
LLFontGL *fontp = createFont(desc);
if (!fontp)
{
- llwarns << "getFont failed, name " << desc.getName()
+ LL_WARNS() << "getFont failed, name " << desc.getName()
<<" style=[" << ((S32) desc.getStyle()) << "]"
- << " size=[" << desc.getSize() << "]" << llendl;
+ << " size=[" << desc.getSize() << "]" << LL_ENDL;
}
return fontp;
}
@@ -636,28 +638,28 @@ const LLFontDescriptor *LLFontRegistry::getClosestFontTemplate(const LLFontDescr
void LLFontRegistry::dump()
{
- llinfos << "LLFontRegistry dump: " << llendl;
+ LL_INFOS() << "LLFontRegistry dump: " << LL_ENDL;
for (font_size_map_t::iterator size_it = mFontSizes.begin();
size_it != mFontSizes.end();
++size_it)
{
- llinfos << "Size: " << size_it->first << " => " << size_it->second << llendl;
+ LL_INFOS() << "Size: " << size_it->first << " => " << size_it->second << LL_ENDL;
}
for (font_reg_map_t::iterator font_it = mFontMap.begin();
font_it != mFontMap.end();
++font_it)
{
const LLFontDescriptor& desc = font_it->first;
- llinfos << "Font: name=" << desc.getName()
+ LL_INFOS() << "Font: name=" << desc.getName()
<< " style=[" << ((S32)desc.getStyle()) << "]"
<< " size=[" << desc.getSize() << "]"
<< " fileNames="
- << llendl;
+ << LL_ENDL;
for (string_vec_t::const_iterator file_it=desc.getFileNames().begin();
file_it != desc.getFileNames().end();
++file_it)
{
- llinfos << " file: " << *file_it <<llendl;
+ LL_INFOS() << " file: " << *file_it <<LL_ENDL;
}
}
}
diff --git a/indra/llrender/llfontregistry.h b/indra/llrender/llfontregistry.h
index 059248fbbd..177eb6c8a5 100755
--- a/indra/llrender/llfontregistry.h
+++ b/indra/llrender/llfontregistry.h
@@ -28,7 +28,7 @@
#ifndef LL_LLFONTREGISTRY_H
#define LL_LLFONTREGISTRY_H
-#include "llxmlnode.h"
+#include "llpointer.h"
class LLFontGL;
@@ -65,6 +65,7 @@ private:
class LLFontRegistry
{
public:
+ friend bool init_from_xml(LLFontRegistry*, LLPointer<class LLXMLNode>);
// create_gl_textures - set to false for test apps with no OpenGL window,
// such as llui_libtest
LLFontRegistry(bool create_gl_textures);
@@ -72,7 +73,6 @@ public:
// Load standard font info from XML file(s).
bool parseFontInfo(const std::string& xml_filename);
- bool initFromXML(LLXMLNodePtr node);
// Clear cached glyphs for all fonts.
void reset();
@@ -94,6 +94,7 @@ public:
const string_vec_t& getUltimateFallbackList() const;
private:
+ LLFontRegistry(const LLFontRegistry& other); // no-copy
LLFontGL *createFont(const LLFontDescriptor& desc);
typedef std::map<LLFontDescriptor,LLFontGL*> font_reg_map_t;
typedef std::map<std::string,F32> font_size_map_t;
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index acfb3c085a..e24d3bb5ba 100755
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -85,20 +85,20 @@ void APIENTRY gl_debug_callback(GLenum source,
{
if (severity == GL_DEBUG_SEVERITY_HIGH_ARB)
{
- llwarns << "----- GL ERROR --------" << llendl;
+ LL_WARNS() << "----- GL ERROR --------" << LL_ENDL;
}
else
{
- llwarns << "----- GL WARNING -------" << llendl;
+ LL_WARNS() << "----- GL WARNING -------" << LL_ENDL;
}
- llwarns << "Type: " << std::hex << type << llendl;
- llwarns << "ID: " << std::hex << id << llendl;
- llwarns << "Severity: " << std::hex << severity << llendl;
- llwarns << "Message: " << message << llendl;
- llwarns << "-----------------------" << llendl;
+ LL_WARNS() << "Type: " << std::hex << type << LL_ENDL;
+ LL_WARNS() << "ID: " << std::hex << id << LL_ENDL;
+ LL_WARNS() << "Severity: " << std::hex << severity << LL_ENDL;
+ LL_WARNS() << "Message: " << message << LL_ENDL;
+ LL_WARNS() << "-----------------------" << LL_ENDL;
if (severity == GL_DEBUG_SEVERITY_HIGH_ARB)
{
- llerrs << "Halting on GL Error" << llendl;
+ LL_ERRS() << "Halting on GL Error" << LL_ENDL;
}
}
}
@@ -546,7 +546,7 @@ bool LLGLManager::initGL()
{
std::string ext((const char*) glGetStringi(GL_EXTENSIONS, i));
str << ext << " ";
- LL_DEBUGS("GLExtensions") << ext << llendl;
+ LL_DEBUGS("GLExtensions") << ext << LL_ENDL;
}
{
@@ -610,6 +610,7 @@ bool LLGLManager::initGL()
if (mGLVendor.substr(0,4) == "ATI ")
{
mGLVendorShort = "ATI";
+ // *TODO: Fix this?
mIsATI = TRUE;
#if LL_WINDOWS && !LL_MESA_HEADLESS
@@ -1015,7 +1016,7 @@ void LLGLManager::initExtensions()
#endif
#if LL_LINUX || LL_SOLARIS
- llinfos << "initExtensions() checking shell variables to adjust features..." << llendl;
+ LL_INFOS() << "initExtensions() checking shell variables to adjust features..." << LL_ENDL;
// Our extension support for the Linux Client is very young with some
// potential driver gotchas, so offer a semi-secret way to turn it off.
if (getenv("LL_GL_NOEXT"))
@@ -1209,7 +1210,7 @@ void LLGLManager::initExtensions()
}
if (mHasFramebufferObject)
{
- llinfos << "initExtensions() FramebufferObject-related procs..." << llendl;
+ LL_INFOS() << "initExtensions() FramebufferObject-related procs..." << LL_ENDL;
glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC) GLH_EXT_GET_PROC_ADDRESS("glIsRenderbuffer");
glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC) GLH_EXT_GET_PROC_ADDRESS("glBindRenderbuffer");
glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC) GLH_EXT_GET_PROC_ADDRESS("glDeleteRenderbuffers");
@@ -1278,7 +1279,7 @@ void LLGLManager::initExtensions()
if (mHasOcclusionQuery)
{
- llinfos << "initExtensions() OcclusionQuery-related procs..." << llendl;
+ LL_INFOS() << "initExtensions() OcclusionQuery-related procs..." << LL_ENDL;
glGenQueriesARB = (PFNGLGENQUERIESARBPROC)GLH_EXT_GET_PROC_ADDRESS("glGenQueriesARB");
glDeleteQueriesARB = (PFNGLDELETEQUERIESARBPROC)GLH_EXT_GET_PROC_ADDRESS("glDeleteQueriesARB");
glIsQueryARB = (PFNGLISQUERYARBPROC)GLH_EXT_GET_PROC_ADDRESS("glIsQueryARB");
@@ -1290,14 +1291,14 @@ void LLGLManager::initExtensions()
}
if (mHasTimerQuery)
{
- llinfos << "initExtensions() TimerQuery-related procs..." << llendl;
+ LL_INFOS() << "initExtensions() TimerQuery-related procs..." << LL_ENDL;
glQueryCounter = (PFNGLQUERYCOUNTERPROC) GLH_EXT_GET_PROC_ADDRESS("glQueryCounter");
glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC) GLH_EXT_GET_PROC_ADDRESS("glGetQueryObjecti64v");
glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC) GLH_EXT_GET_PROC_ADDRESS("glGetQueryObjectui64v");
}
if (mHasPointParameters)
{
- llinfos << "initExtensions() PointParameters-related procs..." << llendl;
+ LL_INFOS() << "initExtensions() PointParameters-related procs..." << LL_ENDL;
glPointParameterfARB = (PFNGLPOINTPARAMETERFARBPROC)GLH_EXT_GET_PROC_ADDRESS("glPointParameterfARB");
glPointParameterfvARB = (PFNGLPOINTPARAMETERFVARBPROC)GLH_EXT_GET_PROC_ADDRESS("glPointParameterfvARB");
}
@@ -1345,7 +1346,7 @@ void LLGLManager::initExtensions()
}
if (mHasVertexShader)
{
- llinfos << "initExtensions() VertexShader-related procs..." << llendl;
+ LL_INFOS() << "initExtensions() VertexShader-related procs..." << LL_ENDL;
glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC) GLH_EXT_GET_PROC_ADDRESS("glGetAttribLocationARB");
glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC) GLH_EXT_GET_PROC_ADDRESS("glBindAttribLocationARB");
glGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC) GLH_EXT_GET_PROC_ADDRESS("glGetActiveAttribARB");
@@ -1446,13 +1447,13 @@ void log_glerror()
GLubyte const * gl_error_msg = gluErrorString(error);
if (NULL != gl_error_msg)
{
- llwarns << "GL Error: " << error << " GL Error String: " << gl_error_msg << llendl ;
+ LL_WARNS() << "GL Error: " << error << " GL Error String: " << gl_error_msg << LL_ENDL ;
}
else
{
// gluErrorString returns NULL for some extensions' error codes.
// you'll probably have to grep for the number in glext.h.
- llwarns << "GL Error: UNKNOWN 0x" << std::hex << error << std::dec << llendl;
+ LL_WARNS() << "GL Error: UNKNOWN 0x" << std::hex << error << std::dec << LL_ENDL;
}
error = glGetError();
}
@@ -1500,7 +1501,7 @@ void do_assert_glerror()
}
else
{
- llerrs << "One or more unhandled GL errors." << llendl;
+ LL_ERRS() << "One or more unhandled GL errors." << LL_ENDL;
}
}
}
@@ -1509,7 +1510,7 @@ void assert_glerror()
{
/* if (!gGLActive)
{
- //llwarns << "GL used while not active!" << llendl;
+ //LL_WARNS() << "GL used while not active!" << LL_ENDL;
if (gDebugSession)
{
@@ -1798,7 +1799,7 @@ void LLGLState::checkTextureChannels(const std::string& msg)
if (tex != 0)
{
error = TRUE;
- LL_WARNS("RenderState") << "Texture channel " << i << " still has texture " << tex << " bound." << llendl;
+ LL_WARNS("RenderState") << "Texture channel " << i << " still has texture " << tex << " bound." << LL_ENDL;
if (gDebugSession)
{
@@ -1842,7 +1843,7 @@ void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask)
if (active_texture != GL_TEXTURE0_ARB)
{
- llwarns << "Client active texture corrupted: " << active_texture << llendl;
+ LL_WARNS() << "Client active texture corrupted: " << active_texture << LL_ENDL;
if (gDebugSession)
{
gFailLog << "Client active texture corrupted: " << active_texture << std::endl;
@@ -1853,7 +1854,7 @@ void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask)
/*glGetIntegerv(GL_ACTIVE_TEXTURE_ARB, &active_texture);
if (active_texture != GL_TEXTURE0_ARB)
{
- llwarns << "Active texture corrupted: " << active_texture << llendl;
+ LL_WARNS() << "Active texture corrupted: " << active_texture << LL_ENDL;
if (gDebugSession)
{
gFailLog << "Active texture corrupted: " << active_texture << std::endl;
@@ -2350,11 +2351,11 @@ void LLGLNamePool::release(GLuint name)
}
else
{
- llerrs << "Attempted to release a pooled name that is not in use!" << llendl;
+ LL_ERRS() << "Attempted to release a pooled name that is not in use!" << LL_ENDL;
}
}
}
- llerrs << "Attempted to release a non pooled name!" << llendl;
+ LL_ERRS() << "Attempted to release a non pooled name!" << LL_ENDL;
#else
releaseName(name);
#endif
diff --git a/indra/llrender/llgldbg.cpp b/indra/llrender/llgldbg.cpp
index 4b68194db3..0f1d4ae742 100755
--- a/indra/llrender/llgldbg.cpp
+++ b/indra/llrender/llgldbg.cpp
@@ -112,112 +112,112 @@ void llgl_dump()
F32 fv[16];
GLboolean b;
- llinfos << "==========================" << llendl;
- llinfos << "OpenGL State" << llendl;
- llinfos << "==========================" << llendl;
+ LL_INFOS() << "==========================" << LL_ENDL;
+ LL_INFOS() << "OpenGL State" << LL_ENDL;
+ LL_INFOS() << "==========================" << LL_ENDL;
- llinfos << "-----------------------------------" << llendl;
- llinfos << "Current Values" << llendl;
- llinfos << "-----------------------------------" << llendl;
+ LL_INFOS() << "-----------------------------------" << LL_ENDL;
+ LL_INFOS() << "Current Values" << LL_ENDL;
+ LL_INFOS() << "-----------------------------------" << LL_ENDL;
glGetFloatv(GL_CURRENT_COLOR, fv);
- llinfos << "GL_CURRENT_COLOR : " << fv4(fv) << llendl;
+ LL_INFOS() << "GL_CURRENT_COLOR : " << fv4(fv) << LL_ENDL;
glGetFloatv(GL_CURRENT_NORMAL, fv);
- llinfos << "GL_CURRENT_NORMAL : " << fv3(fv) << llendl;
+ LL_INFOS() << "GL_CURRENT_NORMAL : " << fv3(fv) << LL_ENDL;
- llinfos << "-----------------------------------" << llendl;
- llinfos << "Lighting" << llendl;
- llinfos << "-----------------------------------" << llendl;
+ LL_INFOS() << "-----------------------------------" << LL_ENDL;
+ LL_INFOS() << "Lighting" << LL_ENDL;
+ LL_INFOS() << "-----------------------------------" << LL_ENDL;
- llinfos << "GL_LIGHTING : " << boolstr(glIsEnabled(GL_LIGHTING)) << llendl;
+ LL_INFOS() << "GL_LIGHTING : " << boolstr(glIsEnabled(GL_LIGHTING)) << LL_ENDL;
- llinfos << "GL_COLOR_MATERIAL : " << boolstr(glIsEnabled(GL_COLOR_MATERIAL)) << llendl;
+ LL_INFOS() << "GL_COLOR_MATERIAL : " << boolstr(glIsEnabled(GL_COLOR_MATERIAL)) << LL_ENDL;
glGetIntegerv(GL_COLOR_MATERIAL_PARAMETER, (GLint*)&i);
- llinfos << "GL_COLOR_MATERIAL_PARAMETER: " << cmstr(i) << llendl;
+ LL_INFOS() << "GL_COLOR_MATERIAL_PARAMETER: " << cmstr(i) << LL_ENDL;
glGetIntegerv(GL_COLOR_MATERIAL_FACE, (GLint*)&i);
- llinfos << "GL_COLOR_MATERIAL_FACE : " << facestr(i) << llendl;
+ LL_INFOS() << "GL_COLOR_MATERIAL_FACE : " << facestr(i) << LL_ENDL;
fv[0] = fv[1] = fv[2] = fv[3] = 12345.6789f;
glGetMaterialfv(GL_FRONT, GL_AMBIENT, fv);
- llinfos << "GL_AMBIENT material : " << fv4(fv) << llendl;
+ LL_INFOS() << "GL_AMBIENT material : " << fv4(fv) << LL_ENDL;
fv[0] = fv[1] = fv[2] = fv[3] = 12345.6789f;
glGetMaterialfv(GL_FRONT, GL_DIFFUSE, fv);
- llinfos << "GL_DIFFUSE material : " << fv4(fv) << llendl;
+ LL_INFOS() << "GL_DIFFUSE material : " << fv4(fv) << LL_ENDL;
fv[0] = fv[1] = fv[2] = fv[3] = 12345.6789f;
glGetMaterialfv(GL_FRONT, GL_SPECULAR, fv);
- llinfos << "GL_SPECULAR material : " << fv4(fv) << llendl;
+ LL_INFOS() << "GL_SPECULAR material : " << fv4(fv) << LL_ENDL;
fv[0] = fv[1] = fv[2] = fv[3] = 12345.6789f;
glGetMaterialfv(GL_FRONT, GL_EMISSION, fv);
- llinfos << "GL_EMISSION material : " << fv4(fv) << llendl;
+ LL_INFOS() << "GL_EMISSION material : " << fv4(fv) << LL_ENDL;
fv[0] = fv[1] = fv[2] = fv[3] = 12345.6789f;
glGetMaterialfv(GL_FRONT, GL_SHININESS, fv);
- llinfos << "GL_SHININESS material : " << fv1(fv) << llendl;
+ LL_INFOS() << "GL_SHININESS material : " << fv1(fv) << LL_ENDL;
fv[0] = fv[1] = fv[2] = fv[3] = 12345.6789f;
glGetFloatv(GL_LIGHT_MODEL_AMBIENT, fv);
- llinfos << "GL_LIGHT_MODEL_AMBIENT : " << fv4(fv) << llendl;
+ LL_INFOS() << "GL_LIGHT_MODEL_AMBIENT : " << fv4(fv) << LL_ENDL;
glGetBooleanv(GL_LIGHT_MODEL_LOCAL_VIEWER, &b);
- llinfos << "GL_LIGHT_MODEL_LOCAL_VIEWER: " << boolstr(b) << llendl;
+ LL_INFOS() << "GL_LIGHT_MODEL_LOCAL_VIEWER: " << boolstr(b) << LL_ENDL;
glGetBooleanv(GL_LIGHT_MODEL_TWO_SIDE, &b);
- llinfos << "GL_LIGHT_MODEL_TWO_SIDE : " << boolstr(b) << llendl;
+ LL_INFOS() << "GL_LIGHT_MODEL_TWO_SIDE : " << boolstr(b) << LL_ENDL;
for (int l=0; l<8; l++)
{
b = glIsEnabled(GL_LIGHT0+l);
- llinfos << "GL_LIGHT" << l << " : " << boolstr(b) << llendl;
+ LL_INFOS() << "GL_LIGHT" << l << " : " << boolstr(b) << LL_ENDL;
if (!b)
continue;
glGetLightfv(GL_LIGHT0+l, GL_AMBIENT, fv);
- llinfos << " GL_AMBIENT light : " << fv4(fv) << llendl;
+ LL_INFOS() << " GL_AMBIENT light : " << fv4(fv) << LL_ENDL;
glGetLightfv(GL_LIGHT0+l, GL_DIFFUSE, fv);
- llinfos << " GL_DIFFUSE light : " << fv4(fv) << llendl;
+ LL_INFOS() << " GL_DIFFUSE light : " << fv4(fv) << LL_ENDL;
glGetLightfv(GL_LIGHT0+l, GL_SPECULAR, fv);
- llinfos << " GL_SPECULAR light : " << fv4(fv) << llendl;
+ LL_INFOS() << " GL_SPECULAR light : " << fv4(fv) << LL_ENDL;
glGetLightfv(GL_LIGHT0+l, GL_POSITION, fv);
- llinfos << " GL_POSITION light : " << fv4(fv) << llendl;
+ LL_INFOS() << " GL_POSITION light : " << fv4(fv) << LL_ENDL;
glGetLightfv(GL_LIGHT0+l, GL_CONSTANT_ATTENUATION, fv);
- llinfos << " GL_CONSTANT_ATTENUATION : " << fv1(fv) << llendl;
+ LL_INFOS() << " GL_CONSTANT_ATTENUATION : " << fv1(fv) << LL_ENDL;
glGetLightfv(GL_LIGHT0+l, GL_QUADRATIC_ATTENUATION, fv);
- llinfos << " GL_QUADRATIC_ATTENUATION : " << fv1(fv) << llendl;
+ LL_INFOS() << " GL_QUADRATIC_ATTENUATION : " << fv1(fv) << LL_ENDL;
glGetLightfv(GL_LIGHT0+l, GL_SPOT_DIRECTION, fv);
- llinfos << " GL_SPOT_DIRECTION : " << fv4(fv) << llendl;
+ LL_INFOS() << " GL_SPOT_DIRECTION : " << fv4(fv) << LL_ENDL;
glGetLightfv(GL_LIGHT0+l, GL_SPOT_EXPONENT, fv);
- llinfos << " GL_SPOT_EXPONENT : " << fv1(fv) << llendl;
+ LL_INFOS() << " GL_SPOT_EXPONENT : " << fv1(fv) << LL_ENDL;
glGetLightfv(GL_LIGHT0+l, GL_SPOT_CUTOFF, fv);
- llinfos << " GL_SPOT_CUTOFF : " << fv1(fv) << llendl;
+ LL_INFOS() << " GL_SPOT_CUTOFF : " << fv1(fv) << LL_ENDL;
}
- llinfos << "-----------------------------------" << llendl;
- llinfos << "Pixel Operations" << llendl;
- llinfos << "-----------------------------------" << llendl;
+ LL_INFOS() << "-----------------------------------" << LL_ENDL;
+ LL_INFOS() << "Pixel Operations" << LL_ENDL;
+ LL_INFOS() << "-----------------------------------" << LL_ENDL;
- llinfos << "GL_ALPHA_TEST : " << boolstr(glIsEnabled(GL_ALPHA_TEST)) << llendl;
- llinfos << "GL_DEPTH_TEST : " << boolstr(glIsEnabled(GL_DEPTH_TEST)) << llendl;
+ LL_INFOS() << "GL_ALPHA_TEST : " << boolstr(glIsEnabled(GL_ALPHA_TEST)) << LL_ENDL;
+ LL_INFOS() << "GL_DEPTH_TEST : " << boolstr(glIsEnabled(GL_DEPTH_TEST)) << LL_ENDL;
glGetBooleanv(GL_DEPTH_WRITEMASK, &b);
- llinfos << "GL_DEPTH_WRITEMASK : " << boolstr(b) << llendl;
+ LL_INFOS() << "GL_DEPTH_WRITEMASK : " << boolstr(b) << LL_ENDL;
- llinfos << "GL_BLEND : " << boolstr(glIsEnabled(GL_BLEND)) << llendl;
- llinfos << "GL_DITHER : " << boolstr(glIsEnabled(GL_DITHER)) << llendl;
+ LL_INFOS() << "GL_BLEND : " << boolstr(glIsEnabled(GL_BLEND)) << LL_ENDL;
+ LL_INFOS() << "GL_DITHER : " << boolstr(glIsEnabled(GL_DITHER)) << LL_ENDL;
}
// End
diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h
index 5a80a8faa4..a95872e883 100755
--- a/indra/llrender/llglheaders.h
+++ b/indra/llrender/llglheaders.h
@@ -551,9 +551,7 @@ extern PFNGLBINDBUFFERBASEPROC glBindBufferBase;
// LL_WINDOWS
// windows gl headers depend on things like APIENTRY, so include windows.
-#define WIN32_LEAN_AND_MEAN
-#include <winsock2.h>
-#include <windows.h>
+#include "llwin32headerslean.h"
//----------------------------------------------------------------------------
#include <GL/gl.h>
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index 1c50a51d02..9fae63385d 100755
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -137,10 +137,10 @@ void LLGLSLShader::finishProfile()
(*iter)->dumpStats();
}
- llinfos << "-----------------------------------" << llendl;
- llinfos << "Total rendering time: " << llformat("%.4f ms", sTotalTimeElapsed/1000000.f) << llendl;
- llinfos << "Total samples drawn: " << llformat("%.4f million", sTotalSamplesDrawn/1000000.f) << llendl;
- llinfos << "Total triangles drawn: " << llformat("%.3f million", sTotalTrianglesDrawn/1000000.f) << llendl;
+ LL_INFOS() << "-----------------------------------" << LL_ENDL;
+ LL_INFOS() << "Total rendering time: " << llformat("%.4f ms", sTotalTimeElapsed/1000000.f) << LL_ENDL;
+ LL_INFOS() << "Total samples drawn: " << llformat("%.4f million", sTotalSamplesDrawn/1000000.f) << LL_ENDL;
+ LL_INFOS() << "Total triangles drawn: " << llformat("%.3f million", sTotalTrianglesDrawn/1000000.f) << LL_ENDL;
}
void LLGLSLShader::clearStats()
@@ -158,11 +158,11 @@ void LLGLSLShader::dumpStats()
{
if (mDrawCalls > 0)
{
- llinfos << "=============================================" << llendl;
- llinfos << mName << llendl;
+ LL_INFOS() << "=============================================" << LL_ENDL;
+ LL_INFOS() << mName << LL_ENDL;
for (U32 i = 0; i < mShaderFiles.size(); ++i)
{
- llinfos << mShaderFiles[i].first << llendl;
+ LL_INFOS() << mShaderFiles[i].first << LL_ENDL;
}
for (U32 i = 0; i < mTexture.size(); ++i)
{
@@ -171,10 +171,10 @@ void LLGLSLShader::dumpStats()
if (idx >= 0)
{
GLint uniform_idx = getUniformLocation(i);
- llinfos << mUniformNameMap[uniform_idx] << " - " << std::hex << mTextureMagFilter[i] << "/" << mTextureMinFilter[i] << std::dec << llendl;
+ LL_INFOS() << mUniformNameMap[uniform_idx] << " - " << std::hex << mTextureMagFilter[i] << "/" << mTextureMinFilter[i] << std::dec << LL_ENDL;
}
}
- llinfos << "=============================================" << llendl;
+ LL_INFOS() << "=============================================" << LL_ENDL;
F32 ms = mTimeElapsed/1000000.f;
F32 seconds = ms/1000.f;
@@ -190,10 +190,10 @@ void LLGLSLShader::dumpStats()
F32 pct_calls = (F32) mDrawCalls/(F32)sTotalDrawCalls*100.f;
U32 avg_batch = mTrianglesDrawn/mDrawCalls;
- llinfos << "Triangles Drawn: " << mTrianglesDrawn << " " << llformat("(%.2f pct of total, %.3f million/sec)", pct_tris, tris_sec ) << llendl;
- llinfos << "Draw Calls: " << mDrawCalls << " " << llformat("(%.2f pct of total, avg %d tris/call)", pct_calls, avg_batch) << llendl;
- llinfos << "SamplesDrawn: " << mSamplesDrawn << " " << llformat("(%.2f pct of total, %.3f billion/sec)", pct_samples, samples_sec) << llendl;
- llinfos << "Time Elapsed: " << mTimeElapsed << " " << llformat("(%.2f pct of total, %.5f ms)\n", (F32) ((F64)mTimeElapsed/(F64)sTotalTimeElapsed)*100.f, ms) << llendl;
+ LL_INFOS() << "Triangles Drawn: " << mTrianglesDrawn << " " << llformat("(%.2f pct of total, %.3f million/sec)", pct_tris, tris_sec ) << LL_ENDL;
+ LL_INFOS() << "Draw Calls: " << mDrawCalls << " " << llformat("(%.2f pct of total, avg %d tris/call)", pct_calls, avg_batch) << LL_ENDL;
+ LL_INFOS() << "SamplesDrawn: " << mSamplesDrawn << " " << llformat("(%.2f pct of total, %.3f billion/sec)", pct_samples, samples_sec) << LL_ENDL;
+ LL_INFOS() << "Time Elapsed: " << mTimeElapsed << " " << llformat("(%.2f pct of total, %.5f ms)\n", (F32) ((F64)mTimeElapsed/(F64)sTotalTimeElapsed)*100.f, ms) << LL_ENDL;
}
}
@@ -711,7 +711,7 @@ BOOL LLGLSLShader::mapUniforms(const vector<LLStaticHashedString> * uniforms)
unbind();
- LL_DEBUGS("ShaderLoading") << "Total Uniform Size: " << mTotalUniformSize << llendl;
+ LL_DEBUGS("ShaderLoading") << "Total Uniform Size: " << mTotalUniformSize << LL_ENDL;
return res;
}
@@ -864,7 +864,7 @@ S32 LLGLSLShader::disableTexture(S32 uniform, LLTexUnit::eTextureType mode)
}
else
{
- llerrs << "Texture channel " << index << " texture type corrupted." << llendl;
+ LL_ERRS() << "Texture channel " << index << " texture type corrupted." << LL_ENDL;
}
}
gGL.getTexUnit(index)->disable();
@@ -1164,7 +1164,7 @@ GLint LLGLSLShader::getUniformLocation(const LLStaticHashedString& uniform)
stop_glerror();
if (iter->second != glGetUniformLocationARB(mProgramObject, uniform.String().c_str()))
{
- llerrs << "Uniform does not match." << llendl;
+ LL_ERRS() << "Uniform does not match." << LL_ENDL;
}
stop_glerror();
}
diff --git a/indra/llrender/llgltexture.cpp b/indra/llrender/llgltexture.cpp
index d06ed5e57b..56e263c5f1 100644
--- a/indra/llrender/llgltexture.cpp
+++ b/indra/llrender/llgltexture.cpp
@@ -294,7 +294,7 @@ LLTexUnit::eTextureAddressMode LLGLTexture::getAddressMode(void) const
return mGLTexturep->getAddressMode() ;
}
-S32 LLGLTexture::getTextureMemory() const
+S32Bytes LLGLTexture::getTextureMemory() const
{
llassert(mGLTexturep.notNull()) ;
diff --git a/indra/llrender/llgltexture.h b/indra/llrender/llgltexture.h
index e69b322d60..45592ee077 100644
--- a/indra/llrender/llgltexture.h
+++ b/indra/llrender/llgltexture.h
@@ -101,7 +101,7 @@ public:
LLGLTexture(const LLImageRaw* raw, BOOL usemipmaps) ;
LLGLTexture(const U32 width, const U32 height, const U8 components, BOOL usemipmaps) ;
- virtual void dump(); // debug info to llinfos
+ virtual void dump(); // debug info to LL_INFOS()
virtual const LLUUID& getID() const = 0;
@@ -138,7 +138,7 @@ public:
S32 getDiscardLevel() const;
S8 getComponents() const;
BOOL getBoundRecently() const;
- S32 getTextureMemory() const ;
+ S32Bytes getTextureMemory() const ;
LLGLenum getPrimaryFormat() const;
BOOL getIsAlphaMask() const ;
LLTexUnit::eTextureType getTarget(void) const ;
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index ab875141c5..ebed454271 100755
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -32,6 +32,7 @@
#include "llimagegl.h"
#include "llerror.h"
+#include "llfasttimer.h"
#include "llimage.h"
#include "llmath.h"
@@ -50,9 +51,9 @@ U32 wpo2(U32 i);
U32 LLImageGL::sUniqueCount = 0;
U32 LLImageGL::sBindCount = 0;
-S32 LLImageGL::sGlobalTextureMemoryInBytes = 0;
-S32 LLImageGL::sBoundTextureMemoryInBytes = 0;
-S32 LLImageGL::sCurBoundTextureMemory = 0;
+S32Bytes LLImageGL::sGlobalTextureMemory(0);
+S32Bytes LLImageGL::sBoundTextureMemory(0);
+S32Bytes LLImageGL::sCurBoundTextureMemory(0);
S32 LLImageGL::sCount = 0;
BOOL LLImageGL::sGlobalUseAnisotropic = FALSE;
@@ -114,7 +115,7 @@ void LLImageGL::checkTexSize(bool forced) const
BOOL error = FALSE;
if (texname != mTexName)
{
- llinfos << "Bound: " << texname << " Should bind: " << mTexName << " Default: " << LLImageGL::sDefaultGLTexture->getTexName() << llendl;
+ LL_INFOS() << "Bound: " << texname << " Should bind: " << mTexName << " Default: " << LLImageGL::sDefaultGLTexture->getTexName() << LL_ENDL;
error = TRUE;
if (gDebugSession)
@@ -123,7 +124,7 @@ void LLImageGL::checkTexSize(bool forced) const
}
else
{
- llerrs << "Invalid texture bound!" << llendl;
+ LL_ERRS() << "Invalid texture bound!" << LL_ENDL;
}
}
stop_glerror() ;
@@ -147,8 +148,8 @@ void LLImageGL::checkTexSize(bool forced) const
}
else
{
- llerrs << "wrong texture size and discard level: width: " <<
- mWidth << " Height: " << mHeight << " Current Level: " << (S32)mCurrentDiscardLevel << llendl ;
+ LL_ERRS() << "wrong texture size and discard level: width: " <<
+ mWidth << " Height: " << mHeight << " Current Level: " << (S32)mCurrentDiscardLevel << LL_ENDL ;
}
}
@@ -197,7 +198,7 @@ S32 LLImageGL::dataFormatBits(S32 dataformat)
case GL_RGBA: return 32;
case GL_BGRA: return 32; // Used for QuickTime media textures on the Mac
default:
- llerrs << "LLImageGL::Unknown format: " << dataformat << llendl;
+ LL_ERRS() << "LLImageGL::Unknown format: " << dataformat << LL_ENDL;
return 0;
}
}
@@ -232,28 +233,28 @@ S32 LLImageGL::dataFormatComponents(S32 dataformat)
case GL_RGBA: return 4;
case GL_BGRA: return 4; // Used for QuickTime media textures on the Mac
default:
- llerrs << "LLImageGL::Unknown format: " << dataformat << llendl;
+ LL_ERRS() << "LLImageGL::Unknown format: " << dataformat << LL_ENDL;
return 0;
}
}
//----------------------------------------------------------------------------
-static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_STATS("Image Stats");
+static LLTrace::BlockTimerStatHandle FTM_IMAGE_UPDATE_STATS("Image Stats");
// static
void LLImageGL::updateStats(F32 current_time)
{
- LLFastTimer t(FTM_IMAGE_UPDATE_STATS);
+ LL_RECORD_BLOCK_TIME(FTM_IMAGE_UPDATE_STATS);
sLastFrameTime = current_time;
- sBoundTextureMemoryInBytes = sCurBoundTextureMemory;
- sCurBoundTextureMemory = 0;
+ sBoundTextureMemory = sCurBoundTextureMemory;
+ sCurBoundTextureMemory = S32Bytes(0);
}
//static
-S32 LLImageGL::updateBoundTexMem(const S32 mem, const S32 ncomponents, S32 category)
+S32 LLImageGL::updateBoundTexMem(const S32Bytes mem, const S32 ncomponents, S32 category)
{
LLImageGL::sCurBoundTextureMemory += mem ;
- return LLImageGL::sCurBoundTextureMemory;
+ return LLImageGL::sCurBoundTextureMemory.value();
}
//----------------------------------------------------------------------------
@@ -276,8 +277,10 @@ void LLImageGL::destroyGL(BOOL save_state)
if (save_state && glimage->isGLTextureCreated() && glimage->mComponents)
{
glimage->mSaveData = new LLImageRaw;
+ glimage->claimMem(glimage->mSaveData);
if(!glimage->readBackRaw(glimage->mCurrentDiscardLevel, glimage->mSaveData, false)) //necessary, keep it.
{
+ glimage->disclaimMem(glimage->mSaveData);
glimage->mSaveData = NULL ;
}
}
@@ -298,7 +301,7 @@ void LLImageGL::restoreGL()
LLImageGL* glimage = *iter;
if(glimage->getTexName())
{
- llerrs << "tex name is not 0." << llendl ;
+ LL_ERRS() << "tex name is not 0." << LL_ENDL ;
}
if (glimage->mSaveData.notNull())
{
@@ -351,7 +354,8 @@ BOOL LLImageGL::create(LLPointer<LLImageGL>& dest, const LLImageRaw* imageraw, B
//----------------------------------------------------------------------------
LLImageGL::LLImageGL(BOOL usemipmaps)
- : mSaveData(0)
+: LLTrace::MemTrackable<LLImageGL>("LLImageGL"),
+ mSaveData(0)
{
init(usemipmaps);
setSize(0, 0, 0);
@@ -360,7 +364,8 @@ LLImageGL::LLImageGL(BOOL usemipmaps)
}
LLImageGL::LLImageGL(U32 width, U32 height, U8 components, BOOL usemipmaps)
- : mSaveData(0)
+: LLTrace::MemTrackable<LLImageGL>("LLImageGL"),
+ mSaveData(0)
{
llassert( components <= 4 );
init(usemipmaps);
@@ -370,7 +375,8 @@ LLImageGL::LLImageGL(U32 width, U32 height, U8 components, BOOL usemipmaps)
}
LLImageGL::LLImageGL(const LLImageRaw* imageraw, BOOL usemipmaps)
- : mSaveData(0)
+: LLTrace::MemTrackable<LLImageGL>("LLImageGL"),
+ mSaveData(0)
{
init(usemipmaps);
setSize(0, 0, 0);
@@ -384,8 +390,7 @@ LLImageGL::~LLImageGL()
{
LLImageGL::cleanup();
sImageList.erase(this);
- delete [] mPickMask;
- mPickMask = NULL;
+ freePickMask();
sCount--;
}
@@ -395,7 +400,7 @@ void LLImageGL::init(BOOL usemipmaps)
// so that it is obvious by visual inspection if we forgot to
// init a field.
- mTextureMemory = 0;
+ mTextureMemory = (S32Bytes)0;
mLastBindTime = 0.f;
mPickMask = NULL;
@@ -454,6 +459,8 @@ void LLImageGL::cleanup()
{
destroyGLTexture();
}
+ freePickMask();
+
mSaveData = NULL; // deletes data
}
@@ -487,19 +494,17 @@ void LLImageGL::setSize(S32 width, S32 height, S32 ncomponents, S32 discard_leve
// Check if dimensions are a power of two!
if (!checkSize(width,height))
{
- llerrs << llformat("Texture has non power of two dimension: %dx%d",width,height) << llendl;
+ LL_ERRS() << llformat("Texture has non power of two dimension: %dx%d",width,height) << LL_ENDL;
}
if (mTexName)
{
-// llwarns << "Setting Size of LLImageGL with existing mTexName = " << mTexName << llendl;
+// LL_WARNS() << "Setting Size of LLImageGL with existing mTexName = " << mTexName << LL_ENDL;
destroyGLTexture();
}
// pickmask validity depends on old image size, delete it
- delete [] mPickMask;
- mPickMask = NULL;
- mPickMaskWidth = mPickMaskHeight = 0;
+ freePickMask();
mWidth = width;
mHeight = height;
@@ -531,7 +536,7 @@ void LLImageGL::setSize(S32 width, S32 height, S32 ncomponents, S32 discard_leve
// virtual
void LLImageGL::dump()
{
- llinfos << "mMaxDiscardLevel " << S32(mMaxDiscardLevel)
+ LL_INFOS() << "mMaxDiscardLevel " << S32(mMaxDiscardLevel)
<< " mLastBindTime " << mLastBindTime
<< " mTarget " << S32(mTarget)
<< " mBindTarget " << S32(mBindTarget)
@@ -546,12 +551,12 @@ void LLImageGL::dump()
#if DEBUG_MISS
<< " mMissed " << mMissed
#endif
- << llendl;
+ << LL_ENDL;
- llinfos << " mTextureMemory " << mTextureMemory
+ LL_INFOS() << " mTextureMemory " << mTextureMemory
<< " mTexNames " << mTexName
<< " mIsResident " << S32(mIsResident)
- << llendl;
+ << LL_ENDL;
}
//----------------------------------------------------------------------------
@@ -560,7 +565,7 @@ void LLImageGL::forceUpdateBindStats(void) const
mLastBindTime = sLastFrameTime;
}
-BOOL LLImageGL::updateBindStats(S32 tex_mem) const
+BOOL LLImageGL::updateBindStats(S32Bytes tex_mem) const
{
if (mTexName != 0)
{
@@ -613,10 +618,10 @@ void LLImageGL::setImage(const LLImageRaw* imageraw)
setImage(rawdata, FALSE);
}
-static LLFastTimer::DeclareTimer FTM_SET_IMAGE("setImage");
+static LLTrace::BlockTimerStatHandle FTM_SET_IMAGE("setImage");
void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
{
- LLFastTimer t(FTM_SET_IMAGE);
+ LL_RECORD_BLOCK_TIME(FTM_SET_IMAGE);
bool is_compressed = false;
if (mFormatPrimary >= GL_COMPRESSED_RGBA_S3TC_DXT1_EXT && mFormatPrimary <= GL_COMPRESSED_RGBA_S3TC_DXT5_EXT)
{
@@ -668,7 +673,7 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
}
else
{
-// LLFastTimer t2(FTM_TEMP4);
+// LL_RECORD_BLOCK_TIME(FTM_TEMP4);
if(mFormatSwapBytes)
{
@@ -700,7 +705,7 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
{
stop_glerror();
{
-// LLFastTimer t2(FTM_TEMP4);
+// LL_RECORD_BLOCK_TIME(FTM_TEMP4);
if(mFormatSwapBytes)
{
@@ -797,7 +802,7 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
llassert(w > 0 && h > 0 && cur_mip_data);
(void)cur_mip_data;
{
-// LLFastTimer t1(FTM_TEMP4);
+// LL_RECORD_BLOCK_TIME(FTM_TEMP4);
if(mFormatSwapBytes)
{
glPixelStorei(GL_UNPACK_SWAP_BYTES, 1);
@@ -838,7 +843,7 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
}
else
{
- llerrs << "Compressed Image has mipmaps but data does not (can not auto generate compressed mips)" << llendl;
+ LL_ERRS() << "Compressed Image has mipmaps but data does not (can not auto generate compressed mips)" << LL_ENDL;
}
}
else
@@ -887,7 +892,7 @@ BOOL LLImageGL::preAddToAtlas(S32 discard_level, const LLImageRaw* raw_image)
if (gGLManager.mIsDisabled)
{
- llwarns << "Trying to create a texture while GL is disabled!" << llendl;
+ LL_WARNS() << "Trying to create a texture while GL is disabled!" << LL_ENDL;
return FALSE;
}
llassert(gGLManager.mInited);
@@ -933,7 +938,7 @@ BOOL LLImageGL::preAddToAtlas(S32 discard_level, const LLImageRaw* raw_image)
mFormatType = GL_UNSIGNED_BYTE;
break;
default:
- llerrs << "Bad number of components for texture: " << (U32)getComponents() << llendl;
+ LL_ERRS() << "Bad number of components for texture: " << (U32)getComponents() << LL_ENDL;
}
}
@@ -977,13 +982,13 @@ BOOL LLImageGL::setSubImage(const U8* datap, S32 data_width, S32 data_height, S3
if (mTexName == 0)
{
// *TODO: Re-enable warning? Ran into thread locking issues? DK 2011-02-18
- //llwarns << "Setting subimage on image without GL texture" << llendl;
+ //LL_WARNS() << "Setting subimage on image without GL texture" << LL_ENDL;
return FALSE;
}
if (datap == NULL)
{
// *TODO: Re-enable warning? Ran into thread locking issues? DK 2011-02-18
- //llwarns << "Setting subimage on image with NULL datap" << llendl;
+ //LL_WARNS() << "Setting subimage on image with NULL datap" << LL_ENDL;
return FALSE;
}
@@ -997,7 +1002,7 @@ BOOL LLImageGL::setSubImage(const U8* datap, S32 data_width, S32 data_height, S3
if (mUseMipMaps)
{
dump();
- llerrs << "setSubImage called with mipmapped image (not supported)" << llendl;
+ LL_ERRS() << "setSubImage called with mipmapped image (not supported)" << LL_ENDL;
}
llassert_always(mCurrentDiscardLevel == 0);
llassert_always(x_pos >= 0 && y_pos >= 0);
@@ -1006,28 +1011,28 @@ BOOL LLImageGL::setSubImage(const U8* datap, S32 data_width, S32 data_height, S3
(y_pos + height) > getHeight())
{
dump();
- llerrs << "Subimage not wholly in target image!"
+ LL_ERRS() << "Subimage not wholly in target image!"
<< " x_pos " << x_pos
<< " y_pos " << y_pos
<< " width " << width
<< " height " << height
<< " getWidth() " << getWidth()
<< " getHeight() " << getHeight()
- << llendl;
+ << LL_ENDL;
}
if ((x_pos + width) > data_width ||
(y_pos + height) > data_height)
{
dump();
- llerrs << "Subimage not wholly in source image!"
+ LL_ERRS() << "Subimage not wholly in source image!"
<< " x_pos " << x_pos
<< " y_pos " << y_pos
<< " width " << width
<< " height " << height
<< " source_width " << data_width
<< " source_height " << data_height
- << llendl;
+ << LL_ENDL;
}
@@ -1043,7 +1048,7 @@ BOOL LLImageGL::setSubImage(const U8* datap, S32 data_width, S32 data_height, S3
datap += (y_pos * data_width + x_pos) * getComponents();
// Update the GL texture
BOOL res = gGL.getTexUnit(0)->bindManual(mBindTarget, mTexName);
- if (!res) llerrs << "LLImageGL::setSubImage(): bindTexture failed" << llendl;
+ if (!res) LL_ERRS() << "LLImageGL::setSubImage(): bindTexture failed" << LL_ENDL;
stop_glerror();
glTexSubImage2D(mTarget, 0, x_pos, y_pos,
@@ -1086,10 +1091,10 @@ BOOL LLImageGL::setSubImageFromFrameBuffer(S32 fb_x, S32 fb_y, S32 x_pos, S32 y_
}
// static
-static LLFastTimer::DeclareTimer FTM_GENERATE_TEXTURES("generate textures");
+static LLTrace::BlockTimerStatHandle FTM_GENERATE_TEXTURES("generate textures");
void LLImageGL::generateTextures(S32 numTextures, U32 *textures)
{
- LLFastTimer t(FTM_GENERATE_TEXTURES);
+ LL_RECORD_BLOCK_TIME(FTM_GENERATE_TEXTURES);
glGenTextures(numTextures, textures);
}
@@ -1103,10 +1108,10 @@ void LLImageGL::deleteTextures(S32 numTextures, U32 *textures)
}
// static
-static LLFastTimer::DeclareTimer FTM_SET_MANUAL_IMAGE("setManualImage");
+static LLTrace::BlockTimerStatHandle FTM_SET_MANUAL_IMAGE("setManualImage");
void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 width, S32 height, U32 pixformat, U32 pixtype, const void *pixels, bool allow_compression)
{
- LLFastTimer t(FTM_SET_MANUAL_IMAGE);
+ LL_RECORD_BLOCK_TIME(FTM_SET_MANUAL_IMAGE);
bool use_scratch = false;
U32* scratch = NULL;
if (LLRender::sGLCoreProfile)
@@ -1193,7 +1198,7 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt
intformat = GL_COMPRESSED_ALPHA;
break;
default:
- llwarns << "Could not compress format: " << std::hex << intformat << llendl;
+ LL_WARNS() << "Could not compress format: " << std::hex << intformat << LL_ENDL;
break;
}
}
@@ -1210,13 +1215,13 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt
//create an empty GL texture: just create a texture name
//the texture is assiciate with some image by calling glTexImage outside LLImageGL
-static LLFastTimer::DeclareTimer FTM_CREATE_GL_TEXTURE1("createGLTexture()");
+static LLTrace::BlockTimerStatHandle FTM_CREATE_GL_TEXTURE1("createGLTexture()");
BOOL LLImageGL::createGLTexture()
{
- LLFastTimer t(FTM_CREATE_GL_TEXTURE1);
+ LL_RECORD_BLOCK_TIME(FTM_CREATE_GL_TEXTURE1);
if (gGLManager.mIsDisabled)
{
- llwarns << "Trying to create a texture while GL is disabled!" << llendl;
+ LL_WARNS() << "Trying to create a texture while GL is disabled!" << LL_ENDL;
return FALSE;
}
@@ -1235,19 +1240,19 @@ BOOL LLImageGL::createGLTexture()
stop_glerror();
if (!mTexName)
{
- llerrs << "LLImageGL::createGLTexture failed to make an empty texture" << llendl;
+ LL_ERRS() << "LLImageGL::createGLTexture failed to make an empty texture" << LL_ENDL;
}
return TRUE ;
}
-static LLFastTimer::DeclareTimer FTM_CREATE_GL_TEXTURE2("createGLTexture(raw)");
+static LLTrace::BlockTimerStatHandle FTM_CREATE_GL_TEXTURE2("createGLTexture(raw)");
BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S32 usename/*=0*/, BOOL to_create, S32 category)
{
- LLFastTimer t(FTM_CREATE_GL_TEXTURE2);
+ LL_RECORD_BLOCK_TIME(FTM_CREATE_GL_TEXTURE2);
if (gGLManager.mIsDisabled)
{
- llwarns << "Trying to create a texture while GL is disabled!" << llendl;
+ LL_WARNS() << "Trying to create a texture while GL is disabled!" << LL_ENDL;
return FALSE;
}
@@ -1297,7 +1302,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S
mFormatType = GL_UNSIGNED_BYTE;
break;
default:
- llerrs << "Bad number of components for texture: " << (U32)getComponents() << llendl;
+ LL_ERRS() << "Bad number of components for texture: " << (U32)getComponents() << LL_ENDL;
}
calcAlphaChannelOffsetAndStride() ;
@@ -1316,10 +1321,10 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S
return createGLTexture(discard_level, rawdata, FALSE, usename);
}
-static LLFastTimer::DeclareTimer FTM_CREATE_GL_TEXTURE3("createGLTexture3(data)");
+static LLTrace::BlockTimerStatHandle FTM_CREATE_GL_TEXTURE3("createGLTexture3(data)");
BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_hasmips, S32 usename)
{
- LLFastTimer t(FTM_CREATE_GL_TEXTURE3);
+ LL_RECORD_BLOCK_TIME(FTM_CREATE_GL_TEXTURE3);
llassert(data_in);
stop_glerror();
@@ -1359,7 +1364,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_
}
if (!mTexName)
{
- llerrs << "LLImageGL::createGLTexture failed to make texture" << llendl;
+ LL_ERRS() << "LLImageGL::createGLTexture failed to make texture" << LL_ENDL;
}
if (mUseMipMaps)
@@ -1389,15 +1394,17 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_
if (old_name != 0)
{
- sGlobalTextureMemoryInBytes -= mTextureMemory;
+ sGlobalTextureMemory -= mTextureMemory;
LLImageGL::deleteTextures(1, &old_name);
stop_glerror();
}
- mTextureMemory = getMipBytes(discard_level);
- sGlobalTextureMemoryInBytes += mTextureMemory;
+ disclaimMem(mTextureMemory);
+ mTextureMemory = (S32Bytes)getMipBytes(discard_level);
+ claimMem(mTextureMemory);
+ sGlobalTextureMemory += mTextureMemory;
mTexelsInGLTexture = getWidth() * getHeight() ;
// mark this as bound at this point, so we don't throw it out immediately
@@ -1408,7 +1415,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_
BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compressed_ok) const
{
llassert_always(sAllowReadBackRaw) ;
- //llerrs << "should not call this function!" << llendl ;
+ //LL_ERRS() << "should not call this function!" << LL_ENDL ;
if (discard_level < 0)
{
@@ -1446,15 +1453,15 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre
}
if(width < glwidth)
{
- llwarns << "texture size is smaller than it should be." << llendl ;
- llwarns << "width: " << width << " glwidth: " << glwidth << " mWidth: " << mWidth <<
- " mCurrentDiscardLevel: " << (S32)mCurrentDiscardLevel << " discard_level: " << (S32)discard_level << llendl ;
+ LL_WARNS() << "texture size is smaller than it should be." << LL_ENDL ;
+ LL_WARNS() << "width: " << width << " glwidth: " << glwidth << " mWidth: " << mWidth <<
+ " mCurrentDiscardLevel: " << (S32)mCurrentDiscardLevel << " discard_level: " << (S32)discard_level << LL_ENDL ;
return FALSE ;
}
if (width <= 0 || width > 2048 || height <= 0 || height > 2048 || ncomponents < 1 || ncomponents > 4)
{
- llerrs << llformat("LLImageGL::readBackRaw: bogus params: %d x %d x %d",width,height,ncomponents) << llendl;
+ LL_ERRS() << llformat("LLImageGL::readBackRaw: bogus params: %d x %d x %d",width,height,ncomponents) << LL_ENDL;
}
LLGLint is_compressed = 0;
@@ -1467,7 +1474,7 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre
GLenum error ;
while((error = glGetError()) != GL_NO_ERROR)
{
- llwarns << "GL Error happens before reading back texture. Error code: " << error << llendl ;
+ LL_WARNS() << "GL Error happens before reading back texture. Error code: " << error << LL_ENDL ;
}
//-----------------------------------------------------------------------------------------------
@@ -1477,8 +1484,8 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre
glGetTexLevelParameteriv(mTarget, gl_discard, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, (GLint*)&glbytes);
if(!imageraw->allocateDataSize(width, height, ncomponents, glbytes))
{
- llwarns << "Memory allocation failed for reading back texture. Size is: " << glbytes << llendl ;
- llwarns << "width: " << width << "height: " << height << "components: " << ncomponents << llendl ;
+ LL_WARNS() << "Memory allocation failed for reading back texture. Size is: " << glbytes << LL_ENDL ;
+ LL_WARNS() << "width: " << width << "height: " << height << "components: " << ncomponents << LL_ENDL ;
return FALSE ;
}
@@ -1489,8 +1496,8 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre
{
if(!imageraw->allocateDataSize(width, height, ncomponents))
{
- llwarns << "Memory allocation failed for reading back texture." << llendl ;
- llwarns << "width: " << width << "height: " << height << "components: " << ncomponents << llendl ;
+ LL_WARNS() << "Memory allocation failed for reading back texture." << LL_ENDL ;
+ LL_WARNS() << "width: " << width << "height: " << height << "components: " << ncomponents << LL_ENDL ;
return FALSE ;
}
@@ -1501,12 +1508,12 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre
//-----------------------------------------------------------------------------------------------
if((error = glGetError()) != GL_NO_ERROR)
{
- llwarns << "GL Error happens after reading back texture. Error code: " << error << llendl ;
+ LL_WARNS() << "GL Error happens after reading back texture. Error code: " << error << LL_ENDL ;
imageraw->deleteData() ;
while((error = glGetError()) != GL_NO_ERROR)
{
- llwarns << "GL Error happens after reading back texture. Error code: " << error << llendl ;
+ LL_WARNS() << "GL Error happens after reading back texture. Error code: " << error << LL_ENDL ;
}
return FALSE ;
@@ -1530,10 +1537,11 @@ void LLImageGL::destroyGLTexture()
{
if (mTexName != 0)
{
- if(mTextureMemory)
+ if(mTextureMemory != S32Bytes(0))
{
- sGlobalTextureMemoryInBytes -= mTextureMemory;
- mTextureMemory = 0;
+ sGlobalTextureMemory -= mTextureMemory;
+ disclaimMem(mTextureMemory);
+ mTextureMemory = (S32Bytes)0;
}
LLImageGL::deleteTextures(1, &mTexName);
@@ -1766,7 +1774,7 @@ void LLImageGL::calcAlphaChannelOffsetAndStride()
mAlphaOffset < 0 || //unsupported type
(mFormatPrimary == GL_BGRA_EXT && mFormatType != GL_UNSIGNED_BYTE)) //unknown situation
{
- llwarns << "Cannot analyze alpha for image with format type " << std::hex << mFormatType << std::dec << llendl;
+ LL_WARNS() << "Cannot analyze alpha for image with format type " << std::hex << mFormatType << std::dec << LL_ENDL;
mNeedsAlphaAndPickMask = FALSE ;
mIsMask = FALSE;
@@ -1875,6 +1883,37 @@ void LLImageGL::analyzeAlpha(const void* data_in, U32 w, U32 h)
}
//----------------------------------------------------------------------------
+U32 LLImageGL::createPickMask(S32 pWidth, S32 pHeight)
+{
+ U32 pick_width = pWidth/2 + 1;
+ U32 pick_height = pHeight/2 + 1;
+
+ U32 size = pick_width * pick_height;
+ size = (size + 7) / 8; // pixelcount-to-bits
+ mPickMask = new U8[size];
+ claimMem(size);
+ mPickMaskWidth = pick_width - 1;
+ mPickMaskHeight = pick_height - 1;
+
+ memset(mPickMask, 0, sizeof(U8) * size);
+
+ return size;
+}
+
+//----------------------------------------------------------------------------
+void LLImageGL::freePickMask()
+{
+ // pickmask validity depends on old image size, delete it
+ if (mPickMask != NULL)
+ {
+ disclaimMem((mPickMaskWidth * mPickMaskHeight + 7) / 8);
+ delete [] mPickMask;
+ }
+ mPickMask = NULL;
+ mPickMaskWidth = mPickMaskHeight = 0;
+}
+
+//----------------------------------------------------------------------------
void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in)
{
if(!mNeedsAlphaAndPickMask)
@@ -1882,9 +1921,7 @@ void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in)
return ;
}
- delete [] mPickMask;
- mPickMask = NULL;
- mPickMaskWidth = mPickMaskHeight = 0;
+ freePickMask();
if (mFormatType != GL_UNSIGNED_BYTE ||
mFormatPrimary != GL_RGBA)
@@ -1893,16 +1930,11 @@ void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in)
return;
}
- U32 pick_width = width/2 + 1;
- U32 pick_height = height/2 + 1;
-
- U32 size = pick_width * pick_height;
- size = (size + 7) / 8; // pixelcount-to-bits
- mPickMask = new U8[size];
- mPickMaskWidth = pick_width - 1;
- mPickMaskHeight = pick_height - 1;
-
- memset(mPickMask, 0, sizeof(U8) * size);
+#ifdef SHOW_ASSERT
+ const U32 pickSize = createPickMask(width, height);
+#else // SHOW_ASSERT
+ createPickMask(width, height);
+#endif // SHOW_ASSERT
U32 pick_bit = 0;
@@ -1916,7 +1948,7 @@ void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in)
{
U32 pick_idx = pick_bit/8;
U32 pick_offset = pick_bit%8;
- llassert(pick_idx < size);
+ llassert(pick_idx < pickSize);
mPickMask[pick_idx] |= 1 << pick_offset;
}
diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h
index 0c62dd0d33..21982eab1d 100755
--- a/indra/llrender/llimagegl.h
+++ b/indra/llrender/llimagegl.h
@@ -34,6 +34,7 @@
#include "llpointer.h"
#include "llrefcount.h"
#include "v2math.h"
+#include "llunits.h"
#include "llrender.h"
class LLTextureAtlas ;
@@ -41,7 +42,7 @@ class LLTextureAtlas ;
#define MEGA_BYTES_TO_BYTES(x) ((x) << 20)
//============================================================================
-class LLImageGL : public LLRefCount
+class LLImageGL : public LLRefCount, public LLTrace::MemTrackable<LLImageGL>
{
friend class LLTexUnit;
public:
@@ -55,7 +56,7 @@ public:
static S32 dataFormatBytes(S32 dataformat, S32 width, S32 height);
static S32 dataFormatComponents(S32 dataformat);
- BOOL updateBindStats(S32 tex_mem) const ;
+ BOOL updateBindStats(S32Bytes tex_mem) const ;
F32 getTimePassedSinceLastBound();
void forceUpdateBindStats(void) const;
@@ -68,7 +69,7 @@ public:
static void dirtyTexOptions();
// Sometimes called externally for textures not using LLImageGL (should go away...)
- static S32 updateBoundTexMem(const S32 mem, const S32 ncomponents, S32 category) ;
+ static S32 updateBoundTexMem(const S32Bytes mem, const S32 ncomponents, S32 category) ;
static bool checkSize(S32 width, S32 height);
@@ -91,7 +92,7 @@ protected:
void calcAlphaChannelOffsetAndStride();
public:
- virtual void dump(); // debugging info to llinfos
+ virtual void dump(); // debugging info to LL_INFOS()
void setSize(S32 width, S32 height, S32 ncomponents, S32 discard_level = -1);
void setComponents(S32 ncomponents) { mComponents = (S8)ncomponents ;}
@@ -181,10 +182,13 @@ public:
public:
// Various GL/Rendering options
- S32 mTextureMemory;
+ S32Bytes mTextureMemory;
mutable F32 mLastBindTime; // last time this was bound, by discard level
private:
+ U32 createPickMask(S32 pWidth, S32 pHeight);
+ void freePickMask();
+
LLPointer<LLImageRaw> mSaveData; // used for destroyGL/restoreGL
U8* mPickMask; //downsampled bitmap approximation of alpha channel. NULL if no alpha channel
U16 mPickMaskWidth;
@@ -238,9 +242,9 @@ public:
static F32 sLastFrameTime;
// Global memory statistics
- static S32 sGlobalTextureMemoryInBytes; // Tracks main memory texmem
- static S32 sBoundTextureMemoryInBytes; // Tracks bound texmem for last completed frame
- static S32 sCurBoundTextureMemory; // Tracks bound texmem for current frame
+ static S32Bytes sGlobalTextureMemory; // Tracks main memory texmem
+ static S32Bytes sBoundTextureMemory; // Tracks bound texmem for last completed frame
+ static S32Bytes sCurBoundTextureMemory; // Tracks bound texmem for current frame
static U32 sBindCount; // Tracks number of texture binds for current frame
static U32 sUniqueCount; // Tracks number of unique texture binds for current frame
static BOOL sGlobalUseAnisotropic;
diff --git a/indra/llrender/llpostprocess.cpp b/indra/llrender/llpostprocess.cpp
index 4c36185b08..a95bb7027b 100755
--- a/indra/llrender/llpostprocess.cpp
+++ b/indra/llrender/llpostprocess.cpp
@@ -73,7 +73,7 @@ LLPostProcess::LLPostProcess(void) :
/* Do nothing. Needs to be updated to use our current shader system, and to work with the move into llrender.
std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", XML_FILENAME));
- LL_DEBUGS2("AppInit", "Shaders") << "Loading PostProcess Effects settings from " << pathName << LL_ENDL;
+ LL_DEBUGS("AppInit", "Shaders") << "Loading PostProcess Effects settings from " << pathName << LL_ENDL;
llifstream effectsXML(pathName);
@@ -160,7 +160,7 @@ void LLPostProcess::saveEffect(std::string const & effectName)
mAllEffects[effectName] = tweaks;
std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", XML_FILENAME));
- //llinfos << "Saving PostProcess Effects settings to " << pathName << llendl;
+ //LL_INFOS() << "Saving PostProcess Effects settings to " << pathName << LL_ENDL;
llofstream effectsXML(pathName);
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index b481cf7095..388d3a4f1a 100755
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -266,7 +266,7 @@ bool LLTexUnit::bind(LLTexture* texture, bool for_rendering, bool forceBind)
}
else
{
- llwarns << "NULL LLTexUnit::bind texture" << llendl;
+ LL_WARNS() << "NULL LLTexUnit::bind texture" << LL_ENDL;
return false;
}
}
@@ -285,7 +285,7 @@ bool LLTexUnit::bind(LLImageGL* texture, bool for_rendering, bool forceBind)
if(!texture)
{
- llwarns << "NULL LLTexUnit::bind texture" << llendl;
+ LL_WARNS() << "NULL LLTexUnit::bind texture" << LL_ENDL;
return false;
}
@@ -335,7 +335,7 @@ bool LLTexUnit::bind(LLCubeMap* cubeMap)
if (cubeMap == NULL)
{
- llwarns << "NULL LLTexUnit::bind cubemap" << llendl;
+ LL_WARNS() << "NULL LLTexUnit::bind cubemap" << LL_ENDL;
return false;
}
@@ -359,7 +359,7 @@ bool LLTexUnit::bind(LLCubeMap* cubeMap)
}
else
{
- llwarns << "Using cube map without extension!" << llendl;
+ LL_WARNS() << "Using cube map without extension!" << LL_ENDL;
return false;
}
}
@@ -377,7 +377,7 @@ bool LLTexUnit::bind(LLRenderTarget* renderTarget, bool bindDepth)
{
if (renderTarget->hasStencil())
{
- llerrs << "Cannot bind a render buffer for sampling. Allocate render target without a stencil buffer if sampling of depth buffer is required." << llendl;
+ LL_ERRS() << "Cannot bind a render buffer for sampling. Allocate render target without a stencil buffer if sampling of depth buffer is required." << LL_ENDL;
}
bindManual(renderTarget->getUsage(), renderTarget->getDepth());
@@ -503,7 +503,7 @@ void LLTexUnit::setTextureFilteringOption(LLTexUnit::eTextureFilterOptions optio
{
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &gGL.mMaxAnisotropy);
- llinfos << "gGL.mMaxAnisotropy: " << gGL.mMaxAnisotropy << llendl ;
+ LL_INFOS() << "gGL.mMaxAnisotropy: " << gGL.mMaxAnisotropy << LL_ENDL ;
gGL.mMaxAnisotropy = llmax(1.f, gGL.mMaxAnisotropy) ;
}
glTexParameterf(sGLTextureType[mCurrTexType], GL_TEXTURE_MAX_ANISOTROPY_EXT, gGL.mMaxAnisotropy);
@@ -557,7 +557,7 @@ void LLTexUnit::setTextureBlendType(eTextureBlendType type)
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
break;
default:
- llerrs << "Unknown Texture Blend Type: " << type << llendl;
+ LL_ERRS() << "Unknown Texture Blend Type: " << type << LL_ENDL;
break;
}
setColorScale(scale_amount);
@@ -597,7 +597,7 @@ GLint LLTexUnit::getTextureSource(eTextureBlendSrc src)
return GL_CONSTANT_ARB;
default:
- llwarns << "Unknown eTextureBlendSrc: " << src << ". Using Vertex Color instead." << llendl;
+ LL_WARNS() << "Unknown eTextureBlendSrc: " << src << ". Using Vertex Color instead." << LL_ENDL;
return GL_PRIMARY_COLOR_ARB;
}
}
@@ -635,7 +635,7 @@ GLint LLTexUnit::getTextureSourceType(eTextureBlendSrc src, bool isAlpha)
return GL_ONE_MINUS_SRC_ALPHA;
default:
- llwarns << "Unknown eTextureBlendSrc: " << src << ". Using Source Color or Alpha instead." << llendl;
+ LL_WARNS() << "Unknown eTextureBlendSrc: " << src << ". Using Source Color or Alpha instead." << LL_ENDL;
return (isAlpha) ? GL_SRC_ALPHA: GL_SRC_COLOR;
}
}
@@ -776,7 +776,7 @@ void LLTexUnit::setTextureCombiner(eTextureBlendOp op, eTextureBlendSrc src1, eT
break;
default:
- llwarns << "Unknown eTextureBlendOp: " << op << ". Setting op to replace." << llendl;
+ LL_WARNS() << "Unknown eTextureBlendOp: " << op << ". Setting op to replace." << LL_ENDL;
// Slightly special syntax (no second sources), just set all and return.
glTexEnvi(GL_TEXTURE_ENV, comb_enum, GL_REPLACE);
glTexEnvi(GL_TEXTURE_ENV, src0_enum, source1);
@@ -824,7 +824,7 @@ void LLTexUnit::debugTextureUnit(void)
if ((GL_TEXTURE0_ARB + mIndex) != activeTexture)
{
U32 set_unit = (activeTexture - GL_TEXTURE0_ARB);
- llwarns << "Incorrect Texture Unit! Expected: " << set_unit << " Actual: " << mIndex << llendl;
+ LL_WARNS() << "Incorrect Texture Unit! Expected: " << set_unit << " Actual: " << mIndex << LL_ENDL;
}
}
@@ -1403,7 +1403,7 @@ void LLRender::pushMatrix()
}
else
{
- llwarns << "Matrix stack overflow." << llendl;
+ LL_WARNS() << "Matrix stack overflow." << LL_ENDL;
}
}
}
@@ -1419,7 +1419,7 @@ void LLRender::popMatrix()
}
else
{
- llwarns << "Matrix stack underflow." << llendl;
+ LL_WARNS() << "Matrix stack underflow." << LL_ENDL;
}
}
}
@@ -1492,7 +1492,7 @@ void LLRender::translateUI(F32 x, F32 y, F32 z)
{
if (mUIOffset.empty())
{
- llerrs << "Need to push a UI translation frame before offsetting" << llendl;
+ LL_ERRS() << "Need to push a UI translation frame before offsetting" << LL_ENDL;
}
mUIOffset.back().mV[0] += x;
@@ -1504,7 +1504,7 @@ void LLRender::scaleUI(F32 x, F32 y, F32 z)
{
if (mUIScale.empty())
{
- llerrs << "Need to push a UI transformation frame before scaling." << llendl;
+ LL_ERRS() << "Need to push a UI transformation frame before scaling." << LL_ENDL;
}
mUIScale.back().scaleVec(LLVector3(x,y,z));
@@ -1535,7 +1535,7 @@ void LLRender::popUIMatrix()
{
if (mUIOffset.empty())
{
- llerrs << "UI offset stack blown." << llendl;
+ LL_ERRS() << "UI offset stack blown." << LL_ENDL;
}
mUIOffset.pop_back();
mUIScale.pop_back();
@@ -1564,7 +1564,7 @@ void LLRender::loadUIIdentity()
{
if (mUIOffset.empty())
{
- llerrs << "Need to push UI translation frame before clearing offset." << llendl;
+ LL_ERRS() << "Need to push UI translation frame before clearing offset." << LL_ENDL;
}
mUIOffset.back().setVec(0,0,0);
mUIScale.back().setVec(1,1,1);
@@ -1622,7 +1622,7 @@ void LLRender::setSceneBlendType(eBlendType type)
blendFunc(BF_ONE, BF_ZERO);
break;
default:
- llerrs << "Unknown Scene Blend Type: " << type << llendl;
+ LL_ERRS() << "Unknown Scene Blend Type: " << type << LL_ENDL;
break;
}
}
@@ -1663,7 +1663,7 @@ void LLRender::setAlphaRejectSettings(eCompareFunc func, F32 value)
if (cur_func != sGLCompareFunc[func])
{
- llerrs << "Alpha test function corrupted!" << llendl;
+ LL_ERRS() << "Alpha test function corrupted!" << LL_ENDL;
}
F32 ref = 0.f;
@@ -1671,7 +1671,7 @@ void LLRender::setAlphaRejectSettings(eCompareFunc func, F32 value)
if (ref != value)
{
- llerrs << "Alpha test value corrupted!" << llendl;
+ LL_ERRS() << "Alpha test value corrupted!" << LL_ENDL;
}
}
}
@@ -1701,7 +1701,7 @@ void LLRender::blendFunc(eBlendFactor color_sfactor, eBlendFactor color_dfactor,
llassert(alpha_dfactor < BF_UNDEF);
if (!gGLManager.mHasBlendFuncSeparate)
{
- LL_WARNS_ONCE("render") << "no glBlendFuncSeparateEXT(), using color-only blend func" << llendl;
+ LL_WARNS_ONCE("render") << "no glBlendFuncSeparateEXT(), using color-only blend func" << LL_ENDL;
blendFunc(color_sfactor, color_dfactor);
return;
}
@@ -1726,7 +1726,7 @@ LLTexUnit* LLRender::getTexUnit(U32 index)
}
else
{
- lldebugs << "Non-existing texture unit layer requested: " << index << llendl;
+ LL_DEBUGS() << "Non-existing texture unit layer requested: " << index << LL_ENDL;
return mDummyTexUnit;
}
}
@@ -1762,7 +1762,7 @@ bool LLRender::verifyTexUnitActive(U32 unitToVerify)
}
else
{
- llwarns << "TexUnit currently active: " << mCurrTextureUnitIndex << " (expecting " << unitToVerify << ")" << llendl;
+ LL_WARNS() << "TexUnit currently active: " << mCurrTextureUnitIndex << " (expecting " << unitToVerify << ")" << LL_ENDL;
return false;
}
}
@@ -1793,7 +1793,7 @@ void LLRender::begin(const GLuint& mode)
}
else if (mCount != 0)
{
- llerrs << "gGL.begin() called redundantly." << llendl;
+ LL_ERRS() << "gGL.begin() called redundantly." << LL_ENDL;
}
mMode = mode;
@@ -1805,7 +1805,7 @@ void LLRender::end()
if (mCount == 0)
{
return;
- //IMM_ERRS << "GL begin and end called with no vertices specified." << llendl;
+ //IMM_ERRS << "GL begin and end called with no vertices specified." << LL_ENDL;
}
if ((mMode != LLRender::QUADS &&
@@ -1824,22 +1824,22 @@ void LLRender::flush()
#if 0
if (!glIsEnabled(GL_VERTEX_ARRAY))
{
- llerrs << "foo 1" << llendl;
+ LL_ERRS() << "foo 1" << LL_ENDL;
}
if (!glIsEnabled(GL_COLOR_ARRAY))
{
- llerrs << "foo 2" << llendl;
+ LL_ERRS() << "foo 2" << LL_ENDL;
}
if (!glIsEnabled(GL_TEXTURE_COORD_ARRAY))
{
- llerrs << "foo 3" << llendl;
+ LL_ERRS() << "foo 3" << LL_ENDL;
}
if (glIsEnabled(GL_NORMAL_ARRAY))
{
- llerrs << "foo 7" << llendl;
+ LL_ERRS() << "foo 7" << LL_ENDL;
}
GLvoid* pointer;
@@ -1847,19 +1847,19 @@ void LLRender::flush()
glGetPointerv(GL_VERTEX_ARRAY_POINTER, &pointer);
if (pointer != &(mBuffer[0].v))
{
- llerrs << "foo 4" << llendl;
+ LL_ERRS() << "foo 4" << LL_ENDL;
}
glGetPointerv(GL_COLOR_ARRAY_POINTER, &pointer);
if (pointer != &(mBuffer[0].c))
{
- llerrs << "foo 5" << llendl;
+ LL_ERRS() << "foo 5" << LL_ENDL;
}
glGetPointerv(GL_TEXTURE_COORD_ARRAY_POINTER, &pointer);
if (pointer != &(mBuffer[0].uv))
{
- llerrs << "foo 6" << llendl;
+ LL_ERRS() << "foo 6" << LL_ENDL;
}
#endif
@@ -1877,7 +1877,7 @@ void LLRender::flush()
if (mCount%4 != 0)
{
count -= (mCount % 4);
- llwarns << "Incomplete quad requested." << llendl;
+ LL_WARNS() << "Incomplete quad requested." << LL_ENDL;
}
}
@@ -1886,7 +1886,7 @@ void LLRender::flush()
if (mCount%3 != 0)
{
count -= (mCount % 3);
- llwarns << "Incomplete triangle requested." << llendl;
+ LL_WARNS() << "Incomplete triangle requested." << LL_ENDL;
}
}
@@ -1895,7 +1895,7 @@ void LLRender::flush()
if (mCount%2 != 0)
{
count -= (mCount % 2);
- llwarns << "Incomplete line requested." << llendl;
+ LL_WARNS() << "Incomplete line requested." << LL_ENDL;
}
}
@@ -1945,7 +1945,7 @@ void LLRender::vertex3f(const GLfloat& x, const GLfloat& y, const GLfloat& z)
if (mCount > 4094)
{
- // llwarns << "GL immediate mode overflow. Some geometry not drawn." << llendl;
+ // LL_WARNS() << "GL immediate mode overflow. Some geometry not drawn." << LL_ENDL;
return;
}
@@ -1988,7 +1988,7 @@ void LLRender::vertexBatchPreTransformed(LLVector3* verts, S32 vert_count)
{
if (mCount + vert_count > 4094)
{
- // llwarns << "GL immediate mode overflow. Some geometry not drawn." << llendl;
+ // LL_WARNS() << "GL immediate mode overflow. Some geometry not drawn." << LL_ENDL;
return;
}
@@ -2045,7 +2045,7 @@ void LLRender::vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, S32 v
{
if (mCount + vert_count > 4094)
{
- // llwarns << "GL immediate mode overflow. Some geometry not drawn." << llendl;
+ // LL_WARNS() << "GL immediate mode overflow. Some geometry not drawn." << LL_ENDL;
return;
}
@@ -2103,7 +2103,7 @@ void LLRender::vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, LLCol
{
if (mCount + vert_count > 4094)
{
- // llwarns << "GL immediate mode overflow. Some geometry not drawn." << llendl;
+ // LL_WARNS() << "GL immediate mode overflow. Some geometry not drawn." << LL_ENDL;
return;
}
diff --git a/indra/llrender/llrender2dutils.cpp b/indra/llrender/llrender2dutils.cpp
index d3cfbaf03a..df5d79a436 100644
--- a/indra/llrender/llrender2dutils.cpp
+++ b/indra/llrender/llrender2dutils.cpp
@@ -35,6 +35,7 @@
#include "llrect.h"
#include "llgl.h"
#include "lltexture.h"
+#include "llfasttimer.h"
// Project includes
#include "llrender2dutils.h"
@@ -347,27 +348,32 @@ void gl_draw_image( S32 x, S32 y, LLTexture* image, const LLColor4& color, const
{
if (NULL == image)
{
- llwarns << "image == NULL; aborting function" << llendl;
+ LL_WARNS() << "image == NULL; aborting function" << LL_ENDL;
return;
}
gl_draw_scaled_rotated_image( x, y, image->getWidth(0), image->getHeight(0), 0.f, image, color, uv_rect );
}
+void gl_draw_scaled_target(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* target, const LLColor4& color, const LLRectf& uv_rect)
+{
+ gl_draw_scaled_rotated_image(x, y, width, height, 0.f, NULL, color, uv_rect, target);
+}
+
void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color, const LLRectf& uv_rect)
{
if (NULL == image)
{
- llwarns << "image == NULL; aborting function" << llendl;
+ LL_WARNS() << "image == NULL; aborting function" << LL_ENDL;
return;
}
gl_draw_scaled_rotated_image( x, y, width, height, 0.f, image, color, uv_rect );
}
-void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLTexture* image, const LLColor4& color, BOOL solid_color, const LLRectf& uv_rect)
+void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLTexture* image, const LLColor4& color, BOOL solid_color, const LLRectf& uv_rect, bool scale_inner)
{
if (NULL == image)
{
- llwarns << "image == NULL; aborting function" << llendl;
+ LL_WARNS() << "image == NULL; aborting function" << LL_ENDL;
return;
}
@@ -376,250 +382,273 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border
F32 border_height_fraction = (F32)border_height / (F32)image->getHeight(0);
LLRectf scale_rect(border_width_fraction, 1.f - border_height_fraction, 1.f - border_width_fraction, border_height_fraction);
- gl_draw_scaled_image_with_border(x, y, width, height, image, color, solid_color, uv_rect, scale_rect);
+ gl_draw_scaled_image_with_border(x, y, width, height, image, color, solid_color, uv_rect, scale_rect, scale_inner);
}
-void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color, BOOL solid_color, const LLRectf& uv_outer_rect, const LLRectf& center_rect)
+void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color, BOOL solid_color, const LLRectf& uv_outer_rect, const LLRectf& center_rect, bool scale_inner)
{
stop_glerror();
if (NULL == image)
{
- llwarns << "image == NULL; aborting function" << llendl;
+ LL_WARNS() << "image == NULL; aborting function" << LL_ENDL;
return;
}
- // add in offset of current image to current UI translation
- const LLVector3 ui_scale = gGL.getUIScale();
- const LLVector3 ui_translation = (gGL.getUITranslation() + LLVector3(x, y, 0.f)).scaledVec(ui_scale);
-
- F32 uv_width = uv_outer_rect.getWidth();
- F32 uv_height = uv_outer_rect.getHeight();
-
- // shrink scaling region to be proportional to clipped image region
- LLRectf uv_center_rect(
- uv_outer_rect.mLeft + (center_rect.mLeft * uv_width),
- uv_outer_rect.mBottom + (center_rect.mTop * uv_height),
- uv_outer_rect.mLeft + (center_rect.mRight * uv_width),
- uv_outer_rect.mBottom + (center_rect.mBottom * uv_height));
-
- F32 image_width = image->getWidth(0);
- F32 image_height = image->getHeight(0);
+ if (solid_color)
+ {
+ if (LLGLSLShader::sNoFixedFunction)
+ {
+ gSolidColorProgram.bind();
+ }
+ else
+ {
+ gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR);
+ gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA);
+ }
+ }
- S32 image_natural_width = llround(image_width * uv_width);
- S32 image_natural_height = llround(image_height * uv_height);
+ if (center_rect.mLeft == 0.f
+ && center_rect.mRight == 1.f
+ && center_rect.mBottom == 0.f
+ && center_rect.mTop == 1.f)
+ {
+ gl_draw_scaled_image(x, y, width, height, image, color, uv_outer_rect);
+ }
+ else
+ {
+ // add in offset of current image to current UI translation
+ const LLVector3 ui_scale = gGL.getUIScale();
+ const LLVector3 ui_translation = (gGL.getUITranslation() + LLVector3(x, y, 0.f)).scaledVec(ui_scale);
- LLRectf draw_center_rect( uv_center_rect.mLeft * image_width,
- uv_center_rect.mTop * image_height,
- uv_center_rect.mRight * image_width,
- uv_center_rect.mBottom * image_height);
+ F32 uv_width = uv_outer_rect.getWidth();
+ F32 uv_height = uv_outer_rect.getHeight();
- { // scale fixed region of image to drawn region
- draw_center_rect.mRight += width - image_natural_width;
- draw_center_rect.mTop += height - image_natural_height;
+ // shrink scaling region to be proportional to clipped image region
+ LLRectf uv_center_rect( uv_outer_rect.mLeft + (center_rect.mLeft * uv_width),
+ uv_outer_rect.mBottom + (center_rect.mTop * uv_height),
+ uv_outer_rect.mLeft + (center_rect.mRight * uv_width),
+ uv_outer_rect.mBottom + (center_rect.mBottom * uv_height));
- F32 border_shrink_width = llmax(0.f, draw_center_rect.mLeft - draw_center_rect.mRight);
- F32 border_shrink_height = llmax(0.f, draw_center_rect.mBottom - draw_center_rect.mTop);
+ F32 image_width = image->getWidth(0);
+ F32 image_height = image->getHeight(0);
- F32 shrink_width_ratio = center_rect.getWidth() == 1.f ? 0.f : border_shrink_width / ((F32)image_natural_width * (1.f - center_rect.getWidth()));
- F32 shrink_height_ratio = center_rect.getHeight() == 1.f ? 0.f : border_shrink_height / ((F32)image_natural_height * (1.f - center_rect.getHeight()));
+ S32 image_natural_width = llround(image_width * uv_width);
+ S32 image_natural_height = llround(image_height * uv_height);
- F32 shrink_scale = 1.f - llmax(shrink_width_ratio, shrink_height_ratio);
+ LLRectf draw_center_rect( uv_center_rect.mLeft * image_width,
+ uv_center_rect.mTop * image_height,
+ uv_center_rect.mRight * image_width,
+ uv_center_rect.mBottom * image_height);
+
+ if (scale_inner)
+ {
+ // scale center region of image to drawn region
+ draw_center_rect.mRight += width - image_natural_width;
+ draw_center_rect.mTop += height - image_natural_height;
- draw_center_rect.mLeft = llround(ui_translation.mV[VX] + (F32)draw_center_rect.mLeft * shrink_scale * ui_scale.mV[VX]);
- draw_center_rect.mTop = llround(ui_translation.mV[VY] + lerp((F32)height, (F32)draw_center_rect.mTop, shrink_scale) * ui_scale.mV[VY]);
- draw_center_rect.mRight = llround(ui_translation.mV[VX] + lerp((F32)width, (F32)draw_center_rect.mRight, shrink_scale) * ui_scale.mV[VX]);
- draw_center_rect.mBottom = llround(ui_translation.mV[VY] + (F32)draw_center_rect.mBottom * shrink_scale * ui_scale.mV[VY]);
- }
+ const F32 border_shrink_width = llmax(0.f, draw_center_rect.mLeft - draw_center_rect.mRight);
+ const F32 border_shrink_height = llmax(0.f, draw_center_rect.mBottom - draw_center_rect.mTop);
- LLRectf draw_outer_rect(ui_translation.mV[VX],
- ui_translation.mV[VY] + height * ui_scale.mV[VY],
- ui_translation.mV[VX] + width * ui_scale.mV[VX],
- ui_translation.mV[VY]);
+ const F32 shrink_width_ratio = center_rect.getWidth() == 1.f ? 0.f : border_shrink_width / ((F32)image_natural_width * (1.f - center_rect.getWidth()));
+ const F32 shrink_height_ratio = center_rect.getHeight() == 1.f ? 0.f : border_shrink_height / ((F32)image_natural_height * (1.f - center_rect.getHeight()));
- LLGLSUIDefault gls_ui;
-
- if (solid_color)
- {
- if (LLGLSLShader::sNoFixedFunction)
- {
- gSolidColorProgram.bind();
+ const F32 border_shrink_scale = 1.f - llmax(shrink_width_ratio, shrink_height_ratio);
+ draw_center_rect.mLeft *= border_shrink_scale;
+ draw_center_rect.mTop = lerp((F32)height, (F32)draw_center_rect.mTop, border_shrink_scale);
+ draw_center_rect.mRight = lerp((F32)width, (F32)draw_center_rect.mRight, border_shrink_scale);
+ draw_center_rect.mBottom *= border_shrink_scale;
}
else
{
- gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR);
- gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA);
+ // keep center region of image at fixed scale, but in same relative position
+ F32 scale_factor = llmin((F32)width / draw_center_rect.getWidth(), (F32)height / draw_center_rect.getHeight(), 1.f);
+ F32 scaled_width = draw_center_rect.getWidth() * scale_factor;
+ F32 scaled_height = draw_center_rect.getHeight() * scale_factor;
+ draw_center_rect.setCenterAndSize(uv_center_rect.getCenterX() * width, uv_center_rect.getCenterY() * height, scaled_width, scaled_height);
}
- }
- gGL.getTexUnit(0)->bind(image, true);
+ draw_center_rect.mLeft = llround(ui_translation.mV[VX] + (F32)draw_center_rect.mLeft * ui_scale.mV[VX]);
+ draw_center_rect.mTop = llround(ui_translation.mV[VY] + (F32)draw_center_rect.mTop * ui_scale.mV[VY]);
+ draw_center_rect.mRight = llround(ui_translation.mV[VX] + (F32)draw_center_rect.mRight * ui_scale.mV[VX]);
+ draw_center_rect.mBottom = llround(ui_translation.mV[VY] + (F32)draw_center_rect.mBottom * ui_scale.mV[VY]);
- gGL.color4fv(color.mV);
+ LLRectf draw_outer_rect(ui_translation.mV[VX],
+ ui_translation.mV[VY] + height * ui_scale.mV[VY],
+ ui_translation.mV[VX] + width * ui_scale.mV[VX],
+ ui_translation.mV[VY]);
+
+ LLGLSUIDefault gls_ui;
+
+ gGL.getTexUnit(0)->bind(image, true);
+
+ gGL.color4fv(color.mV);
- const S32 NUM_VERTICES = 9 * 4; // 9 quads
- LLVector2 uv[NUM_VERTICES];
- LLVector3 pos[NUM_VERTICES];
+ const S32 NUM_VERTICES = 9 * 4; // 9 quads
+ LLVector2 uv[NUM_VERTICES];
+ LLVector3 pos[NUM_VERTICES];
- S32 index = 0;
+ S32 index = 0;
- gGL.begin(LLRender::QUADS);
- {
- // draw bottom left
- uv[index] = LLVector2(uv_outer_rect.mLeft, uv_outer_rect.mBottom);
- pos[index] = LLVector3(draw_outer_rect.mLeft, draw_outer_rect.mBottom, 0.f);
- index++;
+ gGL.begin(LLRender::QUADS);
+ {
+ // draw bottom left
+ uv[index] = LLVector2(uv_outer_rect.mLeft, uv_outer_rect.mBottom);
+ pos[index] = LLVector3(draw_outer_rect.mLeft, draw_outer_rect.mBottom, 0.f);
+ index++;
- uv[index] = LLVector2(uv_center_rect.mLeft, uv_outer_rect.mBottom);
- pos[index] = LLVector3(draw_center_rect.mLeft, draw_outer_rect.mBottom, 0.f);
- index++;
+ uv[index] = LLVector2(uv_center_rect.mLeft, uv_outer_rect.mBottom);
+ pos[index] = LLVector3(draw_center_rect.mLeft, draw_outer_rect.mBottom, 0.f);
+ index++;
- uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mBottom);
- pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mBottom, 0.f);
- index++;
+ uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mBottom);
+ pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mBottom, 0.f);
+ index++;
- uv[index] = LLVector2(uv_outer_rect.mLeft, uv_center_rect.mBottom);
- pos[index] = LLVector3(draw_outer_rect.mLeft, draw_center_rect.mBottom, 0.f);
- index++;
+ uv[index] = LLVector2(uv_outer_rect.mLeft, uv_center_rect.mBottom);
+ pos[index] = LLVector3(draw_outer_rect.mLeft, draw_center_rect.mBottom, 0.f);
+ index++;
- // draw bottom middle
- uv[index] = LLVector2(uv_center_rect.mLeft, uv_outer_rect.mBottom);
- pos[index] = LLVector3(draw_center_rect.mLeft, draw_outer_rect.mBottom, 0.f);
- index++;
+ // draw bottom middle
+ uv[index] = LLVector2(uv_center_rect.mLeft, uv_outer_rect.mBottom);
+ pos[index] = LLVector3(draw_center_rect.mLeft, draw_outer_rect.mBottom, 0.f);
+ index++;
- uv[index] = LLVector2(uv_center_rect.mRight, uv_outer_rect.mBottom);
- pos[index] = LLVector3(draw_center_rect.mRight, draw_outer_rect.mBottom, 0.f);
- index++;
+ uv[index] = LLVector2(uv_center_rect.mRight, uv_outer_rect.mBottom);
+ pos[index] = LLVector3(draw_center_rect.mRight, draw_outer_rect.mBottom, 0.f);
+ index++;
- uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mBottom);
- pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mBottom, 0.f);
- index++;
+ uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mBottom);
+ pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mBottom, 0.f);
+ index++;
- uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mBottom);
- pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mBottom, 0.f);
- index++;
+ uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mBottom);
+ pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mBottom, 0.f);
+ index++;
- // draw bottom right
- uv[index] = LLVector2(uv_center_rect.mRight, uv_outer_rect.mBottom);
- pos[index] = LLVector3(draw_center_rect.mRight, draw_outer_rect.mBottom, 0.f);
- index++;
+ // draw bottom right
+ uv[index] = LLVector2(uv_center_rect.mRight, uv_outer_rect.mBottom);
+ pos[index] = LLVector3(draw_center_rect.mRight, draw_outer_rect.mBottom, 0.f);
+ index++;
- uv[index] = LLVector2(uv_outer_rect.mRight, uv_outer_rect.mBottom);
- pos[index] = LLVector3(draw_outer_rect.mRight, draw_outer_rect.mBottom, 0.f);
- index++;
+ uv[index] = LLVector2(uv_outer_rect.mRight, uv_outer_rect.mBottom);
+ pos[index] = LLVector3(draw_outer_rect.mRight, draw_outer_rect.mBottom, 0.f);
+ index++;
- uv[index] = LLVector2(uv_outer_rect.mRight, uv_center_rect.mBottom);
- pos[index] = LLVector3(draw_outer_rect.mRight, draw_center_rect.mBottom, 0.f);
- index++;
+ uv[index] = LLVector2(uv_outer_rect.mRight, uv_center_rect.mBottom);
+ pos[index] = LLVector3(draw_outer_rect.mRight, draw_center_rect.mBottom, 0.f);
+ index++;
- uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mBottom);
- pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mBottom, 0.f);
- index++;
+ uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mBottom);
+ pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mBottom, 0.f);
+ index++;
- // draw left
- uv[index] = LLVector2(uv_outer_rect.mLeft, uv_center_rect.mBottom);
- pos[index] = LLVector3(draw_outer_rect.mLeft, draw_center_rect.mBottom, 0.f);
- index++;
+ // draw left
+ uv[index] = LLVector2(uv_outer_rect.mLeft, uv_center_rect.mBottom);
+ pos[index] = LLVector3(draw_outer_rect.mLeft, draw_center_rect.mBottom, 0.f);
+ index++;
- uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mBottom);
- pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mBottom, 0.f);
- index++;
+ uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mBottom);
+ pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mBottom, 0.f);
+ index++;
- uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mTop);
- pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mTop, 0.f);
- index++;
+ uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mTop);
+ pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mTop, 0.f);
+ index++;
- uv[index] = LLVector2(uv_outer_rect.mLeft, uv_center_rect.mTop);
- pos[index] = LLVector3(draw_outer_rect.mLeft, draw_center_rect.mTop, 0.f);
- index++;
+ uv[index] = LLVector2(uv_outer_rect.mLeft, uv_center_rect.mTop);
+ pos[index] = LLVector3(draw_outer_rect.mLeft, draw_center_rect.mTop, 0.f);
+ index++;
- // draw middle
- uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mBottom);
- pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mBottom, 0.f);
- index++;
+ // draw middle
+ uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mBottom);
+ pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mBottom, 0.f);
+ index++;
- uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mBottom);
- pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mBottom, 0.f);
- index++;
+ uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mBottom);
+ pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mBottom, 0.f);
+ index++;
- uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mTop);
- pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mTop, 0.f);
- index++;
+ uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mTop);
+ pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mTop, 0.f);
+ index++;
- uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mTop);
- pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mTop, 0.f);
- index++;
+ uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mTop);
+ pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mTop, 0.f);
+ index++;
- // draw right
- uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mBottom);
- pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mBottom, 0.f);
- index++;
+ // draw right
+ uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mBottom);
+ pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mBottom, 0.f);
+ index++;
- uv[index] = LLVector2(uv_outer_rect.mRight, uv_center_rect.mBottom);
- pos[index] = LLVector3(draw_outer_rect.mRight, draw_center_rect.mBottom, 0.f);
- index++;
+ uv[index] = LLVector2(uv_outer_rect.mRight, uv_center_rect.mBottom);
+ pos[index] = LLVector3(draw_outer_rect.mRight, draw_center_rect.mBottom, 0.f);
+ index++;
- uv[index] = LLVector2(uv_outer_rect.mRight, uv_center_rect.mTop);
- pos[index] = LLVector3(draw_outer_rect.mRight, draw_center_rect.mTop, 0.f);
- index++;
+ uv[index] = LLVector2(uv_outer_rect.mRight, uv_center_rect.mTop);
+ pos[index] = LLVector3(draw_outer_rect.mRight, draw_center_rect.mTop, 0.f);
+ index++;
- uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mTop);
- pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mTop, 0.f);
- index++;
+ uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mTop);
+ pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mTop, 0.f);
+ index++;
- // draw top left
- uv[index] = LLVector2(uv_outer_rect.mLeft, uv_center_rect.mTop);
- pos[index] = LLVector3(draw_outer_rect.mLeft, draw_center_rect.mTop, 0.f);
- index++;
+ // draw top left
+ uv[index] = LLVector2(uv_outer_rect.mLeft, uv_center_rect.mTop);
+ pos[index] = LLVector3(draw_outer_rect.mLeft, draw_center_rect.mTop, 0.f);
+ index++;
- uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mTop);
- pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mTop, 0.f);
- index++;
+ uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mTop);
+ pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mTop, 0.f);
+ index++;
- uv[index] = LLVector2(uv_center_rect.mLeft, uv_outer_rect.mTop);
- pos[index] = LLVector3(draw_center_rect.mLeft, draw_outer_rect.mTop, 0.f);
- index++;
+ uv[index] = LLVector2(uv_center_rect.mLeft, uv_outer_rect.mTop);
+ pos[index] = LLVector3(draw_center_rect.mLeft, draw_outer_rect.mTop, 0.f);
+ index++;
- uv[index] = LLVector2(uv_outer_rect.mLeft, uv_outer_rect.mTop);
- pos[index] = LLVector3(draw_outer_rect.mLeft, draw_outer_rect.mTop, 0.f);
- index++;
+ uv[index] = LLVector2(uv_outer_rect.mLeft, uv_outer_rect.mTop);
+ pos[index] = LLVector3(draw_outer_rect.mLeft, draw_outer_rect.mTop, 0.f);
+ index++;
- // draw top middle
- uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mTop);
- pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mTop, 0.f);
- index++;
+ // draw top middle
+ uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mTop);
+ pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mTop, 0.f);
+ index++;
- uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mTop);
- pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mTop, 0.f);
- index++;
+ uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mTop);
+ pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mTop, 0.f);
+ index++;
- uv[index] = LLVector2(uv_center_rect.mRight, uv_outer_rect.mTop);
- pos[index] = LLVector3(draw_center_rect.mRight, draw_outer_rect.mTop, 0.f);
- index++;
+ uv[index] = LLVector2(uv_center_rect.mRight, uv_outer_rect.mTop);
+ pos[index] = LLVector3(draw_center_rect.mRight, draw_outer_rect.mTop, 0.f);
+ index++;
- uv[index] = LLVector2(uv_center_rect.mLeft, uv_outer_rect.mTop);
- pos[index] = LLVector3(draw_center_rect.mLeft, draw_outer_rect.mTop, 0.f);
- index++;
+ uv[index] = LLVector2(uv_center_rect.mLeft, uv_outer_rect.mTop);
+ pos[index] = LLVector3(draw_center_rect.mLeft, draw_outer_rect.mTop, 0.f);
+ index++;
- // draw top right
- uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mTop);
- pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mTop, 0.f);
- index++;
+ // draw top right
+ uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mTop);
+ pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mTop, 0.f);
+ index++;
- uv[index] = LLVector2(uv_outer_rect.mRight, uv_center_rect.mTop);
- pos[index] = LLVector3(draw_outer_rect.mRight, draw_center_rect.mTop, 0.f);
- index++;
+ uv[index] = LLVector2(uv_outer_rect.mRight, uv_center_rect.mTop);
+ pos[index] = LLVector3(draw_outer_rect.mRight, draw_center_rect.mTop, 0.f);
+ index++;
- uv[index] = LLVector2(uv_outer_rect.mRight, uv_outer_rect.mTop);
- pos[index] = LLVector3(draw_outer_rect.mRight, draw_outer_rect.mTop, 0.f);
- index++;
+ uv[index] = LLVector2(uv_outer_rect.mRight, uv_outer_rect.mTop);
+ pos[index] = LLVector3(draw_outer_rect.mRight, draw_outer_rect.mTop, 0.f);
+ index++;
- uv[index] = LLVector2(uv_center_rect.mRight, uv_outer_rect.mTop);
- pos[index] = LLVector3(draw_center_rect.mRight, draw_outer_rect.mTop, 0.f);
- index++;
+ uv[index] = LLVector2(uv_center_rect.mRight, uv_outer_rect.mTop);
+ pos[index] = LLVector3(draw_center_rect.mRight, draw_outer_rect.mTop, 0.f);
+ index++;
- gGL.vertexBatchPreTransformed(pos, uv, NUM_VERTICES);
+ gGL.vertexBatchPreTransformed(pos, uv, NUM_VERTICES);
+ }
+ gGL.end();
}
- gGL.end();
if (solid_color)
{
@@ -639,18 +668,24 @@ void gl_draw_rotated_image(S32 x, S32 y, F32 degrees, LLTexture* image, const LL
gl_draw_scaled_rotated_image( x, y, image->getWidth(0), image->getHeight(0), degrees, image, color, uv_rect );
}
-void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees, LLTexture* image, const LLColor4& color, const LLRectf& uv_rect)
+void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees, LLTexture* image, const LLColor4& color, const LLRectf& uv_rect, LLRenderTarget* target)
{
- if (NULL == image)
+ if (!image && !target)
{
- llwarns << "image == NULL; aborting function" << llendl;
+ LL_WARNS() << "image == NULL; aborting function" << LL_ENDL;
return;
}
LLGLSUIDefault gls_ui;
-
- gGL.getTexUnit(0)->bind(image, true);
+ if(image != NULL)
+ {
+ gGL.getTexUnit(0)->bind(image, true);
+ }
+ else
+ {
+ gGL.getTexUnit(0)->bind(target);
+ }
gGL.color4fv(color.mV);
@@ -695,18 +730,25 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre
{
gGL.pushUIMatrix();
gGL.translateUI((F32)x, (F32)y, 0.f);
-
+
F32 offset_x = F32(width/2);
F32 offset_y = F32(height/2);
gGL.translateUI(offset_x, offset_y, 0.f);
LLMatrix3 quat(0.f, 0.f, degrees*DEG_TO_RAD);
-
- gGL.getTexUnit(0)->bind(image, true);
+
+ if(image != NULL)
+ {
+ gGL.getTexUnit(0)->bind(image, true);
+ }
+ else
+ {
+ gGL.getTexUnit(0)->bind(target);
+ }
gGL.color4fv(color.mV);
-
+
gGL.begin(LLRender::QUADS);
{
LLVector3 v;
@@ -732,7 +774,6 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre
}
}
-
void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LLColor4& color, F32 phase )
{
phase = fmod(phase, 1.f);
@@ -1044,6 +1085,8 @@ void gl_rect_2d_simple( S32 width, S32 height )
gGL.end();
}
+static LLTrace::BlockTimerStatHandle FTM_RENDER_SEGMENTED_RECT ("Render segmented rectangle");
+
void gl_segmented_rect_2d_tex(const S32 left,
const S32 top,
const S32 right,
@@ -1053,6 +1096,8 @@ void gl_segmented_rect_2d_tex(const S32 left,
const S32 border_size,
const U32 edges)
{
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_SEGMENTED_RECT);
+
S32 width = llabs(right - left);
S32 height = llabs(top - bottom);
@@ -1202,18 +1247,19 @@ void gl_segmented_rect_2d_tex(const S32 left,
gGL.popUIMatrix();
}
-//FIXME: rewrite to use scissor?
-void gl_segmented_rect_2d_fragment_tex(const S32 left,
- const S32 top,
- const S32 right,
- const S32 bottom,
- const S32 texture_width,
- const S32 texture_height,
- const S32 border_size,
- const F32 start_fragment,
- const F32 end_fragment,
- const U32 edges)
+void gl_segmented_rect_2d_fragment_tex(const LLRect& rect,
+ const S32 texture_width,
+ const S32 texture_height,
+ const S32 border_size,
+ const F32 start_fragment,
+ const F32 end_fragment,
+ const U32 edges)
{
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_SEGMENTED_RECT);
+ const S32 left = rect.mLeft;
+ const S32 right = rect.mRight;
+ const S32 top = rect.mTop;
+ const S32 bottom = rect.mBottom;
S32 width = llabs(right - left);
S32 height = llabs(top - bottom);
@@ -1251,9 +1297,9 @@ void gl_segmented_rect_2d_fragment_tex(const S32 left,
{
if (start_fragment < middle_start)
{
- u_min = (start_fragment / middle_start) * border_uv_scale.mV[VX];
+ u_min = (start_fragment / middle_start) * border_uv_scale.mV[VX];
u_max = llmin(end_fragment / middle_start, 1.f) * border_uv_scale.mV[VX];
- x_min = (start_fragment / middle_start) * border_width_left;
+ x_min = (start_fragment / middle_start) * border_width_left;
x_max = llmin(end_fragment / middle_start, 1.f) * border_width_left;
// draw bottom left
@@ -1281,7 +1327,7 @@ void gl_segmented_rect_2d_fragment_tex(const S32 left,
gGL.texCoord2f(u_min, 1.f - border_uv_scale.mV[VY]);
gGL.vertex2fv((x_min + height_vec - border_height_top).mV);
-
+
// draw top left
gGL.texCoord2f(u_min, 1.f - border_uv_scale.mV[VY]);
gGL.vertex2fv((x_min + height_vec - border_height_top).mV);
@@ -1343,10 +1389,10 @@ void gl_segmented_rect_2d_fragment_tex(const S32 left,
if (end_fragment > middle_end)
{
- u_min = (1.f - llmax(0.f, ((start_fragment - middle_end) / middle_start))) * border_uv_scale.mV[VX];
- u_max = (1.f - ((end_fragment - middle_end) / middle_start)) * border_uv_scale.mV[VX];
- x_min = width_vec - ((1.f - llmax(0.f, ((start_fragment - middle_end) / middle_start))) * border_width_right);
- x_max = width_vec - ((1.f - ((end_fragment - middle_end) / middle_start)) * border_width_right);
+ u_min = 1.f - ((1.f - llmax(0.f, (start_fragment - middle_end) / middle_start)) * border_uv_scale.mV[VX]);
+ u_max = 1.f - ((1.f - ((end_fragment - middle_end) / middle_start)) * border_uv_scale.mV[VX]);
+ x_min = width_vec - ((1.f - llmax(0.f, (start_fragment - middle_end) / middle_start)) * border_width_right);
+ x_max = width_vec - ((1.f - ((end_fragment - middle_end) / middle_start)) * border_width_right);
// draw bottom right
gGL.texCoord2f(u_min, 0.f);
@@ -1396,6 +1442,8 @@ void gl_segmented_rect_2d_fragment_tex(const S32 left,
void gl_segmented_rect_3d_tex(const LLRectf& clip_rect, const LLRectf& center_uv_rect, const LLRectf& center_draw_rect,
const LLVector3& width_vec, const LLVector3& height_vec)
{
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_SEGMENTED_RECT);
+
gGL.begin(LLRender::QUADS);
{
// draw bottom left
diff --git a/indra/llrender/llrender2dutils.h b/indra/llrender/llrender2dutils.h
index 4884422c58..cce3b4ed51 100644
--- a/indra/llrender/llrender2dutils.h
+++ b/indra/llrender/llrender2dutils.h
@@ -71,11 +71,12 @@ void gl_washer_2d(F32 outer_radius, F32 inner_radius, S32 steps, const LLColor4&
void gl_washer_segment_2d(F32 outer_radius, F32 inner_radius, F32 start_radians, F32 end_radians, S32 steps, const LLColor4& inner_color, const LLColor4& outer_color);
void gl_draw_image(S32 x, S32 y, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
+void gl_draw_scaled_target(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* target, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_scaled_image(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
void gl_draw_rotated_image(S32 x, S32 y, F32 degrees, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
-void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees,LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
-void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLTexture* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
-void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f), const LLRectf& scale_rect = LLRectf(0.f, 1.f, 1.f, 0.f));
+void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degrees, LLTexture* image, const LLColor4& color = UI_VERTEX_COLOR, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f), LLRenderTarget* target = NULL);
+void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLTexture* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f), bool scale_inner = true);
+void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f), const LLRectf& scale_rect = LLRectf(0.f, 1.f, 1.f, 0.f), bool scale_inner = true);
void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LLColor4& color, F32 phase = 0.f );
@@ -105,7 +106,7 @@ typedef enum e_rounded_edge
void gl_segmented_rect_2d_tex(const S32 left, const S32 top, const S32 right, const S32 bottom, const S32 texture_width, const S32 texture_height, const S32 border_size, const U32 edges = ROUNDED_RECT_ALL);
-void gl_segmented_rect_2d_fragment_tex(const S32 left, const S32 top, const S32 right, const S32 bottom, const S32 texture_width, const S32 texture_height, const S32 border_size, const F32 start_fragment, const F32 end_fragment, const U32 edges = ROUNDED_RECT_ALL);
+void gl_segmented_rect_2d_fragment_tex(const LLRect& rect, const S32 texture_width, const S32 texture_height, const S32 border_size, const F32 start_fragment, const F32 end_fragment, const U32 edges = ROUNDED_RECT_ALL);
void gl_segmented_rect_3d_tex(const LLRectf& clip_rect, const LLRectf& center_uv_rect, const LLRectf& center_draw_rect, const LLVector3& width_vec, const LLVector3& height_vec);
inline void gl_rect_2d( const LLRect& rect, BOOL filled )
diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp
index fe8110904d..955ea450c1 100755
--- a/indra/llrender/llrendertarget.cpp
+++ b/indra/llrender/llrendertarget.cpp
@@ -43,7 +43,7 @@ void check_framebuffer_status()
case GL_FRAMEBUFFER_COMPLETE:
break;
default:
- llwarns << "check_framebuffer_status failed -- " << std::hex << status << llendl;
+ LL_WARNS() << "check_framebuffer_status failed -- " << std::hex << status << LL_ENDL;
ll_fail("check_framebuffer_status failed");
break;
}
@@ -139,7 +139,7 @@ bool LLRenderTarget::allocate(U32 resx, U32 resy, U32 color_fmt, bool depth, boo
{
if (!allocateDepth())
{
- llwarns << "Failed to allocate depth buffer for render target." << llendl;
+ LL_WARNS() << "Failed to allocate depth buffer for render target." << LL_ENDL;
return false;
}
}
@@ -181,13 +181,13 @@ bool LLRenderTarget::addColorAttachment(U32 color_fmt)
if( offset >= 4 )
{
- llwarns << "Too many color attachments" << llendl;
+ LL_WARNS() << "Too many color attachments" << LL_ENDL;
llassert( offset < 4 );
return false;
}
if( offset > 0 && (mFBO == 0 || !gGLManager.mHasDrawBuffers) )
{
- llwarns << "FBO not used or no drawbuffers available; mFBO=" << (U32)mFBO << " gGLManager.mHasDrawBuffers=" << (U32)gGLManager.mHasDrawBuffers << llendl;
+ LL_WARNS() << "FBO not used or no drawbuffers available; mFBO=" << (U32)mFBO << " gGLManager.mHasDrawBuffers=" << (U32)gGLManager.mHasDrawBuffers << LL_ENDL;
llassert( mFBO != 0 );
llassert( gGLManager.mHasDrawBuffers );
return false;
@@ -205,7 +205,7 @@ bool LLRenderTarget::addColorAttachment(U32 color_fmt)
LLImageGL::setManualImage(LLTexUnit::getInternalType(mUsage), 0, color_fmt, mResX, mResY, GL_RGBA, GL_UNSIGNED_BYTE, NULL, false);
if (glGetError() != GL_NO_ERROR)
{
- llwarns << "Could not allocate color buffer for render target." << llendl;
+ LL_WARNS() << "Could not allocate color buffer for render target." << LL_ENDL;
return false;
}
}
@@ -294,7 +294,7 @@ bool LLRenderTarget::allocateDepth()
if (glGetError() != GL_NO_ERROR)
{
- llwarns << "Unable to allocate depth buffer for render target." << llendl;
+ LL_WARNS() << "Unable to allocate depth buffer for render target." << LL_ENDL;
return false;
}
@@ -305,17 +305,17 @@ void LLRenderTarget::shareDepthBuffer(LLRenderTarget& target)
{
if (!mFBO || !target.mFBO)
{
- llerrs << "Cannot share depth buffer between non FBO render targets." << llendl;
+ LL_ERRS() << "Cannot share depth buffer between non FBO render targets." << LL_ENDL;
}
if (target.mDepth)
{
- llerrs << "Attempting to override existing depth buffer. Detach existing buffer first." << llendl;
+ LL_ERRS() << "Attempting to override existing depth buffer. Detach existing buffer first." << LL_ENDL;
}
if (target.mUseDepth)
{
- llerrs << "Attempting to override existing shared depth buffer. Detach existing buffer first." << llendl;
+ LL_ERRS() << "Attempting to override existing shared depth buffer. Detach existing buffer first." << LL_ENDL;
}
if (mDepth)
@@ -486,7 +486,7 @@ U32 LLRenderTarget::getTexture(U32 attachment) const
{
if (attachment > mTex.size()-1)
{
- llerrs << "Invalid attachment index." << llendl;
+ LL_ERRS() << "Invalid attachment index." << LL_ENDL;
}
if (mTex.empty())
{
@@ -560,7 +560,7 @@ void LLRenderTarget::copyContents(LLRenderTarget& source, S32 srcX0, S32 srcY0,
gGL.flush();
if (!source.mFBO || !mFBO)
{
- llwarns << "Cannot copy framebuffer contents for non FBO render targets." << llendl;
+ LL_WARNS() << "Cannot copy framebuffer contents for non FBO render targets." << LL_ENDL;
return;
}
@@ -603,7 +603,7 @@ void LLRenderTarget::copyContentsToFramebuffer(LLRenderTarget& source, S32 srcX0
{
if (!source.mFBO)
{
- llwarns << "Cannot copy framebuffer contents for non FBO render targets." << llendl;
+ LL_WARNS() << "Cannot copy framebuffer contents for non FBO render targets." << LL_ENDL;
return;
}
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 6e04fc82df..95a2c8b589 100755
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -600,7 +600,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
{
//should NEVER get here -- if major version is 1 and minor version is less than 10,
// viewer should never attempt to use shaders, continuing will result in undefined behavior
- llerrs << "Unsupported GLSL Version." << llendl;
+ LL_ERRS() << "Unsupported GLSL Version." << LL_ENDL;
}
if (minor_version <= 19)
@@ -767,7 +767,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
else
{ //should never get here. Indexed texture rendering requires GLSL 1.30 or later
// (for passing integers between vertex and fragment shaders)
- llerrs << "Indexed texture rendering requires GLSL 1.30 or later." << llendl;
+ LL_ERRS() << "Indexed texture rendering requires GLSL 1.30 or later." << LL_ENDL;
}
}
else
@@ -840,13 +840,13 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
if (i % 128 == 0)
{ //dump every 128 lines
- LL_WARNS("ShaderLoading") << "\n" << ostr.str() << llendl;
+ LL_WARNS("ShaderLoading") << "\n" << ostr.str() << LL_ENDL;
ostr = std::stringstream();
}
}
- LL_WARNS("ShaderLoading") << "\n" << ostr.str() << llendl;
+ LL_WARNS("ShaderLoading") << "\n" << ostr.str() << LL_ENDL;
#else
std::string str;
@@ -855,7 +855,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
if (i % 128 == 0)
{
- LL_WARNS("ShaderLoading") << str << llendl;
+ LL_WARNS("ShaderLoading") << str << LL_ENDL;
str = "";
}
}
@@ -1205,7 +1205,7 @@ void LLShaderMgr::initAttribsAndUniforms()
{
if (dupe_check.find(mReservedUniforms[i]) != dupe_check.end())
{
- llerrs << "Duplicate reserved uniform name found: " << mReservedUniforms[i] << llendl;
+ LL_ERRS() << "Duplicate reserved uniform name found: " << mReservedUniforms[i] << LL_ENDL;
}
dupe_check.insert(mReservedUniforms[i]);
}
diff --git a/indra/llrender/lltexture.h b/indra/llrender/lltexture.h
index 093bac20d1..9fca8b8cd3 100755
--- a/indra/llrender/lltexture.h
+++ b/indra/llrender/lltexture.h
@@ -33,6 +33,8 @@
#define LL_TEXTURE_H
#include "llrefcount.h"
+#include "lltrace.h"
+
class LLImageGL ;
class LLTexUnit ;
class LLFontGL ;
@@ -40,7 +42,7 @@ class LLFontGL ;
//
//this is an abstract class as the parent for the class LLGLTexture
//
-class LLTexture : public virtual LLRefCount
+class LLTexture : public virtual LLRefCount, public LLTrace::MemTrackable<LLTexture>
{
friend class LLTexUnit ;
friend class LLFontGL ;
@@ -49,7 +51,9 @@ protected:
virtual ~LLTexture();
public:
- LLTexture(){}
+ LLTexture()
+ : LLTrace::MemTrackable<LLTexture>("LLTexture")
+ {}
//
//interfaces to access LLGLTexture
@@ -57,10 +61,12 @@ public:
virtual S8 getType() const = 0 ;
virtual void setKnownDrawSize(S32 width, S32 height) = 0 ;
virtual bool bindDefaultImage(const S32 stage = 0) = 0 ;
+ virtual bool bindDebugImage(const S32 stage = 0) = 0;
virtual void forceImmediateUpdate() = 0 ;
virtual void setActive() = 0 ;
virtual S32 getWidth(S32 discard_level = -1) const = 0 ;
virtual S32 getHeight(S32 discard_level = -1) const = 0 ;
+ virtual bool isActiveFetching() = 0;
private:
//note: do not make this function public.
diff --git a/indra/llrender/lluiimage.cpp b/indra/llrender/lluiimage.cpp
index b954b66350..6f1fae92cd 100644
--- a/indra/llrender/lluiimage.cpp
+++ b/indra/llrender/lluiimage.cpp
@@ -38,11 +38,9 @@ LLUIImage::LLUIImage(const std::string& name, LLPointer<LLTexture> image)
mImage(image),
mScaleRegion(0.f, 1.f, 1.f, 0.f),
mClipRegion(0.f, 1.f, 1.f, 0.f),
- mUniformScaling(TRUE),
- mNoClip(TRUE),
- mImageLoaded(NULL)
-{
-}
+ mImageLoaded(NULL),
+ mScaleStyle(SCALE_INNER)
+{}
LLUIImage::~LLUIImage()
{
@@ -52,44 +50,35 @@ LLUIImage::~LLUIImage()
void LLUIImage::setClipRegion(const LLRectf& region)
{
mClipRegion = region;
- mNoClip = mClipRegion.mLeft == 0.f
- && mClipRegion.mRight == 1.f
- && mClipRegion.mBottom == 0.f
- && mClipRegion.mTop == 1.f;
}
void LLUIImage::setScaleRegion(const LLRectf& region)
{
mScaleRegion = region;
- mUniformScaling = mScaleRegion.mLeft == 0.f
- && mScaleRegion.mRight == 1.f
- && mScaleRegion.mBottom == 0.f
- && mScaleRegion.mTop == 1.f;
+}
+
+void LLUIImage::setScaleStyle(LLUIImage::EScaleStyle style)
+{
+ mScaleStyle = style;
}
//TODO: move drawing implementation inside class
void LLUIImage::draw(S32 x, S32 y, const LLColor4& color) const
{
- gl_draw_scaled_image(x, y, getWidth(), getHeight(), mImage, color, mClipRegion);
+ draw(x, y, getWidth(), getHeight(), color);
}
void LLUIImage::draw(S32 x, S32 y, S32 width, S32 height, const LLColor4& color) const
{
- if (mUniformScaling)
- {
- gl_draw_scaled_image(x, y, width, height, mImage, color, mClipRegion);
- }
- else
- {
- gl_draw_scaled_image_with_border(
- x, y,
- width, height,
- mImage,
- color,
- FALSE,
- mClipRegion,
- mScaleRegion);
- }
+ gl_draw_scaled_image_with_border(
+ x, y,
+ width, height,
+ mImage,
+ color,
+ FALSE,
+ mClipRegion,
+ mScaleRegion,
+ mScaleStyle == SCALE_INNER);
}
void LLUIImage::drawSolid(S32 x, S32 y, S32 width, S32 height, const LLColor4& color) const
@@ -101,7 +90,8 @@ void LLUIImage::drawSolid(S32 x, S32 y, S32 width, S32 height, const LLColor4& c
color,
TRUE,
mClipRegion,
- mScaleRegion);
+ mScaleRegion,
+ mScaleStyle == SCALE_INNER);
}
void LLUIImage::drawBorder(S32 x, S32 y, S32 width, S32 height, const LLColor4& color, S32 border_width) const
diff --git a/indra/llrender/lluiimage.h b/indra/llrender/lluiimage.h
index 7817ba1c7b..6f47385eb0 100644
--- a/indra/llrender/lluiimage.h
+++ b/indra/llrender/lluiimage.h
@@ -42,6 +42,12 @@ extern const LLColor4 UI_VERTEX_COLOR;
class LLUIImage : public LLRefCount
{
public:
+ enum EScaleStyle
+ {
+ SCALE_INNER,
+ SCALE_OUTER
+ };
+
typedef boost::signals2::signal<void (void)> image_loaded_signal_t;
LLUIImage(const std::string& name, LLPointer<LLTexture> image);
@@ -49,6 +55,7 @@ public:
void setClipRegion(const LLRectf& region);
void setScaleRegion(const LLRectf& region);
+ void setScaleStyle(EScaleStyle style);
LLPointer<LLTexture> getImage() { return mImage; }
const LLPointer<LLTexture>& getImage() const { return mImage; }
@@ -83,12 +90,11 @@ public:
protected:
image_loaded_signal_t* mImageLoaded;
- std::string mName;
- LLRectf mScaleRegion;
- LLRectf mClipRegion;
- LLPointer<LLTexture> mImage;
- BOOL mUniformScaling;
- BOOL mNoClip;
+ std::string mName;
+ LLRectf mScaleRegion;
+ LLRectf mClipRegion;
+ LLPointer<LLTexture> mImage;
+ EScaleStyle mScaleStyle;
};
namespace LLInitParam
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index e6f20cd40e..d06564df36 100755
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -26,7 +26,7 @@
#include "linden_common.h"
-#include <boost/static_assert.hpp>
+#include "llfasttimer.h"
#include "llsys.h"
#include "llvertexbuffer.h"
// #include "llrender.h"
@@ -190,7 +190,7 @@ volatile U8* LLVBOPool::allocate(U32& name, U32 size, bool for_seed)
glBufferDataARB(mType, size, 0, mUsage);
if (mUsage != GL_DYNAMIC_COPY_ARB)
{ //data will be provided by application
- ret = (U8*) ll_aligned_malloc(size, 64);
+ ret = (U8*) ll_aligned_malloc<64>(size);
}
}
else
@@ -244,7 +244,7 @@ void LLVBOPool::release(U32 name, volatile U8* buffer, U32 size)
llassert(vbo_block_size(size) == size);
deleteBuffer(name);
- ll_aligned_free((U8*) buffer);
+ ll_aligned_free_fallback((U8*) buffer);
if (mType == GL_ARRAY_BUFFER_ARB)
{
@@ -298,7 +298,7 @@ void LLVBOPool::cleanup()
if (r.mClientData)
{
- ll_aligned_free((void*) r.mClientData);
+ ll_aligned_free<64>((void*) r.mClientData);
}
l.pop_front();
@@ -484,7 +484,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
}
else
{
- llerrs << "Bad client state! " << array[i] << " disabled." << llendl;
+ LL_ERRS() << "Bad client state! " << array[i] << " disabled." << LL_ENDL;
}
}
}
@@ -503,7 +503,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
}
else
{
- llerrs << "Bad client state! " << array[i] << " enabled." << llendl;
+ LL_ERRS() << "Bad client state! " << array[i] << " enabled." << LL_ENDL;
}
}
}
@@ -557,10 +557,10 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
}
//static
-static LLFastTimer::DeclareTimer FTM_VB_DRAW_ARRAYS("drawArrays");
+static LLTrace::BlockTimerStatHandle FTM_VB_DRAW_ARRAYS("drawArrays");
void LLVertexBuffer::drawArrays(U32 mode, const std::vector<LLVector3>& pos, const std::vector<LLVector3>& norm)
{
- LLFastTimer t(FTM_VB_DRAW_ARRAYS);
+ LL_RECORD_BLOCK_TIME(FTM_VB_DRAW_ARRAYS);
llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
gGL.syncMatrices();
@@ -571,13 +571,13 @@ void LLVertexBuffer::drawArrays(U32 mode, const std::vector<LLVector3>& pos, con
if( count == 0 )
{
- llwarns << "Called drawArrays with 0 vertices" << llendl;
+ LL_WARNS() << "Called drawArrays with 0 vertices" << LL_ENDL;
return;
}
if( norm.size() < pos.size() )
{
- llwarns << "Called drawArrays with #" << norm.size() << " normals and #" << pos.size() << " vertices" << llendl;
+ LL_WARNS() << "Called drawArrays with #" << norm.size() << " normals and #" << pos.size() << " vertices" << LL_ENDL;
return;
}
@@ -654,7 +654,7 @@ void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of
if (start >= (U32) mNumVerts ||
end >= (U32) mNumVerts)
{
- llerrs << "Bad vertex buffer draw range: [" << start << ", " << end << "] vs " << mNumVerts << llendl;
+ LL_ERRS() << "Bad vertex buffer draw range: [" << start << ", " << end << "] vs " << mNumVerts << LL_ENDL;
}
llassert(mNumIndices >= 0);
@@ -662,7 +662,7 @@ void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of
if (indices_offset >= (U32) mNumIndices ||
indices_offset + count > (U32) mNumIndices)
{
- llerrs << "Bad index buffer draw range: [" << indices_offset << ", " << indices_offset+count << "]" << llendl;
+ LL_ERRS() << "Bad index buffer draw range: [" << indices_offset << ", " << indices_offset+count << "]" << LL_ENDL;
}
if (gDebugGL && !useVBOs())
@@ -672,7 +672,7 @@ void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of
{
if (idx[i] < start || idx[i] > end)
{
- llerrs << "Index out of range: " << idx[i] << " not in [" << start << ", " << end << "]" << llendl;
+ LL_ERRS() << "Index out of range: " << idx[i] << " not in [" << start << ", " << end << "]" << LL_ENDL;
}
}
@@ -690,7 +690,7 @@ void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of
S32 idx = (S32) (v[i][3]+0.25f);
if (idx < 0 || idx >= shader->mFeatures.mIndexedTextureChannels)
{
- llerrs << "Bad texture index found in vertex data stream." << llendl;
+ LL_ERRS() << "Bad texture index found in vertex data stream." << LL_ENDL;
}
}
}
@@ -710,19 +710,19 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi
{
if (mGLArray != sGLRenderArray)
{
- llerrs << "Wrong vertex array bound." << llendl;
+ LL_ERRS() << "Wrong vertex array bound." << LL_ENDL;
}
}
else
{
if (mGLIndices != sGLRenderIndices)
{
- llerrs << "Wrong index buffer bound." << llendl;
+ LL_ERRS() << "Wrong index buffer bound." << LL_ENDL;
}
if (mGLBuffer != sGLRenderBuffer)
{
- llerrs << "Wrong vertex buffer bound." << llendl;
+ LL_ERRS() << "Wrong vertex buffer bound." << LL_ENDL;
}
}
@@ -733,13 +733,13 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi
if (elem != mGLIndices)
{
- llerrs << "Wrong index buffer bound!" << llendl;
+ LL_ERRS() << "Wrong index buffer bound!" << LL_ENDL;
}
}
if (mode >= LLRender::NUM_MODES)
{
- llerrs << "Invalid draw mode: " << mode << llendl;
+ LL_ERRS() << "Invalid draw mode: " << mode << LL_ENDL;
return;
}
@@ -767,32 +767,32 @@ void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
if (indices_offset >= (U32) mNumIndices ||
indices_offset + count > (U32) mNumIndices)
{
- llerrs << "Bad index buffer draw range: [" << indices_offset << ", " << indices_offset+count << "]" << llendl;
+ LL_ERRS() << "Bad index buffer draw range: [" << indices_offset << ", " << indices_offset+count << "]" << LL_ENDL;
}
if (mGLArray)
{
if (mGLArray != sGLRenderArray)
{
- llerrs << "Wrong vertex array bound." << llendl;
+ LL_ERRS() << "Wrong vertex array bound." << LL_ENDL;
}
}
else
{
if (mGLIndices != sGLRenderIndices)
{
- llerrs << "Wrong index buffer bound." << llendl;
+ LL_ERRS() << "Wrong index buffer bound." << LL_ENDL;
}
if (mGLBuffer != sGLRenderBuffer)
{
- llerrs << "Wrong vertex buffer bound." << llendl;
+ LL_ERRS() << "Wrong vertex buffer bound." << LL_ENDL;
}
}
if (mode >= LLRender::NUM_MODES)
{
- llerrs << "Invalid draw mode: " << mode << llendl;
+ LL_ERRS() << "Invalid draw mode: " << mode << LL_ENDL;
return;
}
@@ -805,7 +805,7 @@ void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
placeFence();
}
-static LLFastTimer::DeclareTimer FTM_GL_DRAW_ARRAYS("GL draw arrays");
+static LLTrace::BlockTimerStatHandle FTM_GL_DRAW_ARRAYS("GL draw arrays");
void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const
{
llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
@@ -816,37 +816,37 @@ void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const
if (first >= (U32) mNumVerts ||
first + count > (U32) mNumVerts)
{
- llerrs << "Bad vertex buffer draw range: [" << first << ", " << first+count << "]" << llendl;
+ LL_ERRS() << "Bad vertex buffer draw range: [" << first << ", " << first+count << "]" << LL_ENDL;
}
if (mGLArray)
{
if (mGLArray != sGLRenderArray)
{
- llerrs << "Wrong vertex array bound." << llendl;
+ LL_ERRS() << "Wrong vertex array bound." << LL_ENDL;
}
}
else
{
if (mGLBuffer != sGLRenderBuffer || useVBOs() != sVBOActive)
{
- llerrs << "Wrong vertex buffer bound." << llendl;
+ LL_ERRS() << "Wrong vertex buffer bound." << LL_ENDL;
}
}
if (mode >= LLRender::NUM_MODES)
{
- llerrs << "Invalid draw mode: " << mode << llendl;
+ LL_ERRS() << "Invalid draw mode: " << mode << LL_ENDL;
return;
}
{
- LLFastTimer t2(FTM_GL_DRAW_ARRAYS);
- stop_glerror();
+ LL_RECORD_BLOCK_TIME(FTM_GL_DRAW_ARRAYS);
+ stop_glerror();
LLGLSLShader::startProfile();
- glDrawArrays(sGLMode[mode], first, count);
+ glDrawArrays(sGLMode[mode], first, count);
LLGLSLShader::stopProfile(count, mode);
- }
+ }
stop_glerror();
placeFence();
@@ -956,7 +956,8 @@ S32 LLVertexBuffer::determineUsage(S32 usage)
return ret_usage;
}
-LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
+LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage)
+: LLTrace::MemTrackable<LLVertexBuffer>("LLVertexBuffer"),
LLRefCount(),
mNumVerts(0),
@@ -1093,7 +1094,9 @@ void LLVertexBuffer::waitFence() const
void LLVertexBuffer::genBuffer(U32 size)
{
+ disclaimMem(mSize);
mSize = vbo_block_size(size);
+ claimMem(mSize);
if (mUsage == GL_STREAM_DRAW_ARB)
{
@@ -1187,7 +1190,9 @@ void LLVertexBuffer::createGLBuffer(U32 size)
static int gl_buffer_idx = 0;
mGLBuffer = ++gl_buffer_idx;
mMappedData = (U8*)ALLOCATE_MEM(sPrivatePoolp, size);
+ disclaimMem(mSize);
mSize = size;
+ claimMem(mSize);
}
}
@@ -1271,7 +1276,7 @@ void LLVertexBuffer::updateNumVerts(S32 nverts)
if (nverts > 65536)
{
- llwarns << "Vertex buffer overflow!" << llendl;
+ LL_WARNS() << "Vertex buffer overflow!" << LL_ENDL;
nverts = 65536;
}
@@ -1310,7 +1315,7 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
if (nverts < 0 || nindices < 0 ||
nverts > 65536)
{
- llerrs << "Bad vertex buffer allocation: " << nverts << " : " << nindices << llendl;
+ LL_ERRS() << "Bad vertex buffer allocation: " << nverts << " : " << nindices << LL_ENDL;
}
updateNumVerts(nverts);
@@ -1331,7 +1336,7 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
}
}
-static LLFastTimer::DeclareTimer FTM_SETUP_VERTEX_ARRAY("Setup VAO");
+static LLTrace::BlockTimerStatHandle FTM_SETUP_VERTEX_ARRAY("Setup VAO");
void LLVertexBuffer::setupVertexArray()
{
@@ -1340,7 +1345,7 @@ void LLVertexBuffer::setupVertexArray()
return;
}
- LLFastTimer t(FTM_SETUP_VERTEX_ARRAY);
+ LL_RECORD_BLOCK_TIME(FTM_SETUP_VERTEX_ARRAY);
#if GL_ARB_vertex_array_object
glBindVertexArray(mGLArray);
#endif
@@ -1495,8 +1500,8 @@ bool expand_region(LLVertexBuffer::MappedRegion& region, S32 index, S32 count)
return true;
}
-static LLFastTimer::DeclareTimer FTM_VBO_MAP_BUFFER_RANGE("VBO Map Range");
-static LLFastTimer::DeclareTimer FTM_VBO_MAP_BUFFER("VBO Map");
+static LLTrace::BlockTimerStatHandle FTM_VBO_MAP_BUFFER_RANGE("VBO Map Range");
+static LLTrace::BlockTimerStatHandle FTM_VBO_MAP_BUFFER("VBO Map");
// Map for data access
volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_range)
@@ -1504,11 +1509,11 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo
bindGLBuffer(true);
if (mFinal)
{
- llerrs << "LLVertexBuffer::mapVeretxBuffer() called on a finalized buffer." << llendl;
+ LL_ERRS() << "LLVertexBuffer::mapVeretxBuffer() called on a finalized buffer." << LL_ENDL;
}
if (!useVBOs() && !mMappedData && !mMappedIndexData)
{
- llerrs << "LLVertexBuffer::mapVertexBuffer() called on unallocated buffer." << llendl;
+ LL_ERRS() << "LLVertexBuffer::mapVertexBuffer() called on unallocated buffer." << LL_ENDL;
}
if (useVBOs())
@@ -1545,7 +1550,7 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo
if (mVertexLocked && map_range)
{
- llerrs << "Attempted to map a specific range of a buffer that was already mapped." << llendl;
+ LL_ERRS() << "Attempted to map a specific range of a buffer that was already mapped." << LL_ENDL;
}
if (!mVertexLocked)
@@ -1567,7 +1572,7 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo
if (map_range)
{
#ifdef GL_ARB_map_buffer_range
- LLFastTimer t(FTM_VBO_MAP_BUFFER_RANGE);
+ LL_RECORD_BLOCK_TIME(FTM_VBO_MAP_BUFFER_RANGE);
S32 offset = mOffsets[type] + sTypeSize[type]*index;
S32 length = (sTypeSize[type]*count+0xF) & ~0xF;
src = (U8*) glMapBufferRange(GL_ARRAY_BUFFER_ARB, offset, length,
@@ -1587,11 +1592,11 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo
if (size < mSize)
{
- llerrs << "Invalid buffer size." << llendl;
+ LL_ERRS() << "Invalid buffer size." << LL_ENDL;
}
}
- LLFastTimer t(FTM_VBO_MAP_BUFFER);
+ LL_RECORD_BLOCK_TIME(FTM_VBO_MAP_BUFFER);
src = (U8*) glMapBufferRange(GL_ARRAY_BUFFER_ARB, 0, mSize,
GL_MAP_WRITE_BIT |
GL_MAP_FLUSH_EXPLICIT_BIT);
@@ -1638,25 +1643,25 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo
{
//--------------------
//print out more debug info before crash
- llinfos << "vertex buffer size: (num verts : num indices) = " << getNumVerts() << " : " << getNumIndices() << llendl;
+ LL_INFOS() << "vertex buffer size: (num verts : num indices) = " << getNumVerts() << " : " << getNumIndices() << LL_ENDL;
GLint size;
glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SIZE_ARB, &size);
- llinfos << "GL_ARRAY_BUFFER_ARB size is " << size << llendl;
+ LL_INFOS() << "GL_ARRAY_BUFFER_ARB size is " << size << LL_ENDL;
//--------------------
GLint buff;
glGetIntegerv(GL_ARRAY_BUFFER_BINDING_ARB, &buff);
if ((GLuint)buff != mGLBuffer)
{
- llerrs << "Invalid GL vertex buffer bound: " << buff << llendl;
+ LL_ERRS() << "Invalid GL vertex buffer bound: " << buff << LL_ENDL;
}
- llerrs << "glMapBuffer returned NULL (no vertex data)" << llendl;
+ LL_ERRS() << "glMapBuffer returned NULL (no vertex data)" << LL_ENDL;
}
else
{
- llerrs << "memory allocation for vertex data failed." << llendl;
+ LL_ERRS() << "memory allocation for vertex data failed." << LL_ENDL;
}
}
}
@@ -1677,19 +1682,19 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo
}
-static LLFastTimer::DeclareTimer FTM_VBO_MAP_INDEX_RANGE("IBO Map Range");
-static LLFastTimer::DeclareTimer FTM_VBO_MAP_INDEX("IBO Map");
+static LLTrace::BlockTimerStatHandle FTM_VBO_MAP_INDEX_RANGE("IBO Map Range");
+static LLTrace::BlockTimerStatHandle FTM_VBO_MAP_INDEX("IBO Map");
volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range)
{
bindGLIndices(true);
if (mFinal)
{
- llerrs << "LLVertexBuffer::mapIndexBuffer() called on a finalized buffer." << llendl;
+ LL_ERRS() << "LLVertexBuffer::mapIndexBuffer() called on a finalized buffer." << LL_ENDL;
}
if (!useVBOs() && !mMappedData && !mMappedIndexData)
{
- llerrs << "LLVertexBuffer::mapIndexBuffer() called on unallocated buffer." << llendl;
+ LL_ERRS() << "LLVertexBuffer::mapIndexBuffer() called on unallocated buffer." << LL_ENDL;
}
if (useVBOs())
@@ -1723,7 +1728,7 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range
if (mIndexLocked && map_range)
{
- llerrs << "Attempted to map a specific range of a buffer that was already mapped." << llendl;
+ LL_ERRS() << "Attempted to map a specific range of a buffer that was already mapped." << LL_ENDL;
}
if (!mIndexLocked)
@@ -1739,7 +1744,7 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range
if (elem != mGLIndices)
{
- llerrs << "Wrong index buffer bound!" << llendl;
+ LL_ERRS() << "Wrong index buffer bound!" << LL_ENDL;
}
}
@@ -1756,7 +1761,7 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range
if (map_range)
{
#ifdef GL_ARB_map_buffer_range
- LLFastTimer t(FTM_VBO_MAP_INDEX_RANGE);
+ LL_RECORD_BLOCK_TIME(FTM_VBO_MAP_INDEX_RANGE);
S32 offset = sizeof(U16)*index;
S32 length = sizeof(U16)*count;
src = (U8*) glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length,
@@ -1768,7 +1773,7 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range
else
{
#ifdef GL_ARB_map_buffer_range
- LLFastTimer t(FTM_VBO_MAP_INDEX);
+ LL_RECORD_BLOCK_TIME(FTM_VBO_MAP_INDEX);
src = (U8*) glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER_ARB, 0, sizeof(U16)*mNumIndices,
GL_MAP_WRITE_BIT |
GL_MAP_FLUSH_EXPLICIT_BIT);
@@ -1792,7 +1797,7 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range
}
else
{
- LLFastTimer t(FTM_VBO_MAP_INDEX);
+ LL_RECORD_BLOCK_TIME(FTM_VBO_MAP_INDEX);
map_range = false;
src = (U8*) glMapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
}
@@ -1817,14 +1822,14 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range
glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &buff);
if ((GLuint)buff != mGLIndices)
{
- llerrs << "Invalid GL index buffer bound: " << buff << llendl;
+ LL_ERRS() << "Invalid GL index buffer bound: " << buff << LL_ENDL;
}
- llerrs << "glMapBuffer returned NULL (no index data)" << llendl;
+ LL_ERRS() << "glMapBuffer returned NULL (no index data)" << LL_ENDL;
}
else
{
- llerrs << "memory allocation for Index data failed. " << llendl;
+ LL_ERRS() << "memory allocation for Index data failed. " << LL_ENDL;
}
}
}
@@ -1843,12 +1848,12 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range
}
}
-static LLFastTimer::DeclareTimer FTM_VBO_UNMAP("VBO Unmap");
-static LLFastTimer::DeclareTimer FTM_VBO_FLUSH_RANGE("Flush VBO Range");
+static LLTrace::BlockTimerStatHandle FTM_VBO_UNMAP("VBO Unmap");
+static LLTrace::BlockTimerStatHandle FTM_VBO_FLUSH_RANGE("Flush VBO Range");
-static LLFastTimer::DeclareTimer FTM_IBO_UNMAP("IBO Unmap");
-static LLFastTimer::DeclareTimer FTM_IBO_FLUSH_RANGE("Flush IBO Range");
+static LLTrace::BlockTimerStatHandle FTM_IBO_UNMAP("IBO Unmap");
+static LLTrace::BlockTimerStatHandle FTM_IBO_FLUSH_RANGE("Flush IBO Range");
void LLVertexBuffer::unmapBuffer()
{
@@ -1861,7 +1866,7 @@ void LLVertexBuffer::unmapBuffer()
if (mMappedData && mVertexLocked)
{
- LLFastTimer t(FTM_VBO_UNMAP);
+ LL_RECORD_BLOCK_TIME(FTM_VBO_UNMAP);
bindGLBuffer(true);
updated_all = mIndexLocked; //both vertex and index buffers done updating
@@ -1902,7 +1907,7 @@ void LLVertexBuffer::unmapBuffer()
S32 length = sTypeSize[region.mType]*region.mCount;
if (gGLManager.mHasMapBufferRange)
{
- LLFastTimer t(FTM_VBO_FLUSH_RANGE);
+ LL_RECORD_BLOCK_TIME(FTM_VBO_FLUSH_RANGE);
#ifdef GL_ARB_map_buffer_range
glFlushMappedBufferRange(GL_ARRAY_BUFFER_ARB, offset, length);
#endif
@@ -1932,7 +1937,7 @@ void LLVertexBuffer::unmapBuffer()
if (mMappedIndexData && mIndexLocked)
{
- LLFastTimer t(FTM_IBO_UNMAP);
+ LL_RECORD_BLOCK_TIME(FTM_IBO_UNMAP);
bindGLIndices();
if(!mMappable)
{
@@ -1969,7 +1974,7 @@ void LLVertexBuffer::unmapBuffer()
S32 length = sizeof(U16)*region.mCount;
if (gGLManager.mHasMapBufferRange)
{
- LLFastTimer t(FTM_IBO_FLUSH_RANGE);
+ LL_RECORD_BLOCK_TIME(FTM_IBO_FLUSH_RANGE);
#ifdef GL_ARB_map_buffer_range
glFlushMappedBufferRange(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length);
#endif
@@ -2020,7 +2025,7 @@ template <class T,S32 type> struct VertexBufferStrider
if (ptr == NULL)
{
- llwarns << "mapIndexBuffer failed!" << llendl;
+ LL_WARNS() << "mapIndexBuffer failed!" << LL_ENDL;
return false;
}
@@ -2036,7 +2041,7 @@ template <class T,S32 type> struct VertexBufferStrider
if (ptr == NULL)
{
- llwarns << "mapVertexBuffer failed!" << llendl;
+ LL_WARNS() << "mapVertexBuffer failed!" << LL_ENDL;
return false;
}
@@ -2046,7 +2051,7 @@ template <class T,S32 type> struct VertexBufferStrider
}
else
{
- llerrs << "VertexBufferStrider could not find valid vertex data." << llendl;
+ LL_ERRS() << "VertexBufferStrider could not find valid vertex data." << LL_ENDL;
}
return false;
}
@@ -2113,13 +2118,13 @@ bool LLVertexBuffer::getClothWeightStrider(LLStrider<LLVector4>& strider, S32 in
//----------------------------------------------------------------------------
-static LLFastTimer::DeclareTimer FTM_BIND_GL_ARRAY("Bind Array");
+static LLTrace::BlockTimerStatHandle FTM_BIND_GL_ARRAY("Bind Array");
bool LLVertexBuffer::bindGLArray()
{
if (mGLArray && sGLRenderArray != mGLArray)
{
{
- LLFastTimer t(FTM_BIND_GL_ARRAY);
+ LL_RECORD_BLOCK_TIME(FTM_BIND_GL_ARRAY);
#if GL_ARB_vertex_array_object
glBindVertexArray(mGLArray);
#endif
@@ -2136,7 +2141,7 @@ bool LLVertexBuffer::bindGLArray()
return false;
}
-static LLFastTimer::DeclareTimer FTM_BIND_GL_BUFFER("Bind Buffer");
+static LLTrace::BlockTimerStatHandle FTM_BIND_GL_BUFFER("Bind Buffer");
bool LLVertexBuffer::bindGLBuffer(bool force_bind)
{
@@ -2146,7 +2151,7 @@ bool LLVertexBuffer::bindGLBuffer(bool force_bind)
if (useVBOs() && (force_bind || (mGLBuffer && (mGLBuffer != sGLRenderBuffer || !sVBOActive))))
{
- //LLFastTimer t(FTM_BIND_GL_BUFFER); <-- this timer is showing up as a hotspot (irony)
+ //LL_RECORD_BLOCK_TIME(FTM_BIND_GL_BUFFER);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, mGLBuffer);
sGLRenderBuffer = mGLBuffer;
@@ -2161,7 +2166,7 @@ bool LLVertexBuffer::bindGLBuffer(bool force_bind)
return ret;
}
-static LLFastTimer::DeclareTimer FTM_BIND_GL_INDICES("Bind Indices");
+static LLTrace::BlockTimerStatHandle FTM_BIND_GL_INDICES("Bind Indices");
bool LLVertexBuffer::bindGLIndices(bool force_bind)
{
@@ -2170,10 +2175,10 @@ bool LLVertexBuffer::bindGLIndices(bool force_bind)
bool ret = false;
if (useVBOs() && (force_bind || (mGLIndices && (mGLIndices != sGLRenderIndices || !sIBOActive))))
{
- LLFastTimer t(FTM_BIND_GL_INDICES);
+ LL_RECORD_BLOCK_TIME(FTM_BIND_GL_INDICES);
/*if (sMapped)
{
- llerrs << "VBO bound while another VBO mapped!" << llendl;
+ LL_ERRS() << "VBO bound while another VBO mapped!" << LL_ENDL;
}*/
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mGLIndices);
sGLRenderIndices = mGLIndices;
@@ -2225,7 +2230,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
U32 required = 1 << i;
if ((data_mask & required) == 0)
{
- llwarns << "Missing attribute: " << LLShaderMgr::instance()->mReservedAttribs[i] << llendl;
+ LL_WARNS() << "Missing attribute: " << LLShaderMgr::instance()->mReservedAttribs[i] << LL_ENDL;
}
required_mask |= required;
@@ -2243,29 +2248,29 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
U32 unsatisfied_flag = unsatisfied_mask & (1 << i);
switch (unsatisfied_flag)
{
- case MAP_VERTEX: llinfos << "Missing vert pos" << llendl; break;
- case MAP_NORMAL: llinfos << "Missing normals" << llendl; break;
- case MAP_TEXCOORD0: llinfos << "Missing TC 0" << llendl; break;
- case MAP_TEXCOORD1: llinfos << "Missing TC 1" << llendl; break;
- case MAP_TEXCOORD2: llinfos << "Missing TC 2" << llendl; break;
- case MAP_TEXCOORD3: llinfos << "Missing TC 3" << llendl; break;
- case MAP_COLOR: llinfos << "Missing vert color" << llendl; break;
- case MAP_EMISSIVE: llinfos << "Missing emissive" << llendl; break;
- case MAP_TANGENT: llinfos << "Missing tangent" << llendl; break;
- case MAP_WEIGHT: llinfos << "Missing weight" << llendl; break;
- case MAP_WEIGHT4: llinfos << "Missing weightx4" << llendl; break;
- case MAP_CLOTHWEIGHT: llinfos << "Missing clothweight" << llendl; break;
- case MAP_TEXTURE_INDEX: llinfos << "Missing tex index" << llendl; break;
- default: llinfos << "Missing who effin knows: " << unsatisfied_flag << llendl;
+ case MAP_VERTEX: LL_INFOS() << "Missing vert pos" << LL_ENDL; break;
+ case MAP_NORMAL: LL_INFOS() << "Missing normals" << LL_ENDL; break;
+ case MAP_TEXCOORD0: LL_INFOS() << "Missing TC 0" << LL_ENDL; break;
+ case MAP_TEXCOORD1: LL_INFOS() << "Missing TC 1" << LL_ENDL; break;
+ case MAP_TEXCOORD2: LL_INFOS() << "Missing TC 2" << LL_ENDL; break;
+ case MAP_TEXCOORD3: LL_INFOS() << "Missing TC 3" << LL_ENDL; break;
+ case MAP_COLOR: LL_INFOS() << "Missing vert color" << LL_ENDL; break;
+ case MAP_EMISSIVE: LL_INFOS() << "Missing emissive" << LL_ENDL; break;
+ case MAP_TANGENT: LL_INFOS() << "Missing tangent" << LL_ENDL; break;
+ case MAP_WEIGHT: LL_INFOS() << "Missing weight" << LL_ENDL; break;
+ case MAP_WEIGHT4: LL_INFOS() << "Missing weightx4" << LL_ENDL; break;
+ case MAP_CLOTHWEIGHT: LL_INFOS() << "Missing clothweight" << LL_ENDL; break;
+ case MAP_TEXTURE_INDEX: LL_INFOS() << "Missing tex index" << LL_ENDL; break;
+ default: LL_INFOS() << "Missing who effin knows: " << unsatisfied_flag << LL_ENDL;
}
}
if (unsatisfied_mask & (1 << TYPE_INDEX))
{
- llinfos << "Missing indices" << llendl;
+ LL_INFOS() << "Missing indices" << LL_ENDL;
}
- llerrs << "Shader consumption mismatches data provision." << llendl;
+ LL_ERRS() << "Shader consumption mismatches data provision." << LL_ENDL;
}
}
}
@@ -2297,7 +2302,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
}
else
{
- llerrs << "Invalid GL vertex buffer bound: " << buff << llendl;
+ LL_ERRS() << "Invalid GL vertex buffer bound: " << buff << LL_ENDL;
}
}
@@ -2312,7 +2317,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
}
else
{
- llerrs << "Invalid GL index buffer bound: " << buff << llendl;
+ LL_ERRS() << "Invalid GL index buffer bound: " << buff << LL_ENDL;
}
}
}
@@ -2388,10 +2393,10 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask)
U32 mask = 1 << i;
if (mask & data_mask && !(mask & mTypeMask))
{ //bit set in data_mask, but not set in mTypeMask
- llwarns << "Missing required component " << vb_type_name[i] << llendl;
+ LL_WARNS() << "Missing required component " << vb_type_name[i] << LL_ENDL;
}
}
- llerrs << "LLVertexBuffer::setupVertexBuffer missing required components for supplied data mask." << llendl;
+ LL_ERRS() << "LLVertexBuffer::setupVertexBuffer missing required components for supplied data mask." << LL_ENDL;
}
if (LLGLSLShader::sNoFixedFunction)
diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h
index 619a0cec46..c05fd01595 100755
--- a/indra/llrender/llvertexbuffer.h
+++ b/indra/llrender/llvertexbuffer.h
@@ -34,6 +34,7 @@
#include "v4coloru.h"
#include "llstrider.h"
#include "llrender.h"
+#include "lltrace.h"
#include <set>
#include <vector>
#include <list>
@@ -94,7 +95,7 @@ public:
//============================================================================
// base class
class LLPrivateMemoryPool;
-class LLVertexBuffer : public LLRefCount
+class LLVertexBuffer : public LLRefCount, public LLTrace::MemTrackable<LLVertexBuffer>
{
public:
class MappedRegion
@@ -109,14 +110,15 @@ public:
};
LLVertexBuffer(const LLVertexBuffer& rhs)
- : mUsage(rhs.mUsage)
+ : LLTrace::MemTrackable<LLVertexBuffer>("LLVertexBuffer"),
+ mUsage(rhs.mUsage)
{
*this = rhs;
}
const LLVertexBuffer& operator=(const LLVertexBuffer& rhs)
{
- llerrs << "Illegal operation!" << llendl;
+ LL_ERRS() << "Illegal operation!" << LL_ENDL;
return *this;
}
diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt
index 589ceac501..52738aeb6f 100755
--- a/indra/llui/CMakeLists.txt
+++ b/indra/llui/CMakeLists.txt
@@ -61,7 +61,6 @@ set(llui_SOURCE_FILES
llfolderview.cpp
llfolderviewitem.cpp
llfolderviewmodel.cpp
- llfunctorregistry.cpp
lliconctrl.cpp
llkeywords.cpp
lllayoutstack.cpp
@@ -145,6 +144,7 @@ set(llui_HEADER_FILES
llbutton.h
llcallbackmap.h
llchatentry.h
+ llchat.h
llcheckboxctrl.h
llclipboard.h
llcombobox.h
@@ -286,7 +286,9 @@ if(LL_TESTS)
include(LLAddBuildTest)
SET(llui_TEST_SOURCE_FILES
llurlmatch.cpp
- llurlentry.cpp
)
LL_ADD_PROJECT_UNIT_TESTS(llui "${llui_TEST_SOURCE_FILES}")
+ # INTEGRATION TESTS
+ set(test_libs llui llmessage llcommon ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES})
+ LL_ADD_INTEGRATION_TEST(llurlentry llurlentry.cpp "${test_libs}")
endif(LL_TESTS)
diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp
index d636161baf..b787794b95 100755
--- a/indra/llui/llaccordionctrl.cpp
+++ b/indra/llui/llaccordionctrl.cpp
@@ -69,7 +69,7 @@ LLAccordionCtrl::LLAccordionCtrl(const Params& params):LLPanel(params)
mSingleExpansion = params.single_expansion;
if(mFitParent && !mSingleExpansion)
{
- llinfos << "fit_parent works best when combined with single_expansion" << llendl;
+ LL_INFOS() << "fit_parent works best when combined with single_expansion" << LL_ENDL;
}
}
@@ -845,7 +845,7 @@ void LLAccordionCtrl::sort()
{
if (!mTabComparator)
{
- llwarns << "No comparator specified for sorting accordion tabs." << llendl;
+ LL_WARNS() << "No comparator specified for sorting accordion tabs." << LL_ENDL;
return;
}
diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp
index 43462bd244..53720a6044 100755
--- a/indra/llui/llaccordionctrltab.cpp
+++ b/indra/llui/llaccordionctrltab.cpp
@@ -444,9 +444,9 @@ void LLAccordionCtrlTab::changeOpenClose(bool is_open)
}
}
-void LLAccordionCtrlTab::handleVisibilityChange(BOOL new_visibility)
+void LLAccordionCtrlTab::onVisibilityChange(BOOL new_visibility)
{
- LLUICtrl::handleVisibilityChange(new_visibility);
+ LLUICtrl::onVisibilityChange(new_visibility);
notifyParent(LLSD().with("child_visibility_change", new_visibility));
}
diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h
index dddaa581e6..7a78700e0f 100755
--- a/indra/llui/llaccordionctrltab.h
+++ b/indra/llui/llaccordionctrltab.h
@@ -158,7 +158,7 @@ public:
/**
* Raises notifyParent event with "child_visibility_change" = new_visibility
*/
- void handleVisibilityChange(BOOL new_visibility);
+ void onVisibilityChange(BOOL new_visibility);
// Changes expand/collapse state and triggers expand/collapse callbacks
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
diff --git a/indra/llui/llbadge.cpp b/indra/llui/llbadge.cpp
index 8ede4e3468..30cb18812b 100755
--- a/indra/llui/llbadge.cpp
+++ b/indra/llui/llbadge.cpp
@@ -105,7 +105,7 @@ LLBadge::LLBadge(const LLBadge::Params& p)
{
if (mImage.isNull())
{
- llwarns << "Badge: " << getName() << " with no image!" << llendl;
+ LL_WARNS() << "Badge: " << getName() << " with no image!" << LL_ENDL;
}
if (p.location_offset_hcenter.isProvided())
@@ -335,7 +335,7 @@ void LLBadge::draw()
}
else
{
- lldebugs << "No image for badge " << getName() << " on owner " << owner_view->getName() << llendl;
+ LL_DEBUGS() << "No image for badge " << getName() << " on owner " << owner_view->getName() << LL_ENDL;
renderBadgeBackground(badge_center_x, badge_center_y,
badge_width, badge_height,
diff --git a/indra/llui/llbadgeowner.cpp b/indra/llui/llbadgeowner.cpp
index 1860a05edd..55e64bb940 100755
--- a/indra/llui/llbadgeowner.cpp
+++ b/indra/llui/llbadgeowner.cpp
@@ -35,8 +35,9 @@
//
LLBadgeOwner::LLBadgeOwner(LLHandle< LLView > viewHandle)
- : mBadge(NULL)
- , mBadgeOwnerView(viewHandle)
+ : mHasBadgeHolderParent(false),
+ mBadge(NULL),
+ mBadgeOwnerView(viewHandle)
{
}
@@ -45,31 +46,12 @@ void LLBadgeOwner::initBadgeParams(const LLBadge::Params& p)
if (!p.equals(LLUICtrlFactory::getDefaultParams<LLBadge>()))
{
mBadge = createBadge(p);
- }
-}
-
-void LLBadgeOwner::setBadgeLabel(const LLStringExplicit& label)
-{
- if (mBadge == NULL)
- {
- mBadge = createBadge(LLUICtrlFactory::getDefaultParams<LLBadge>());
-
- addBadgeToParentPanel();
- }
-
- if (mBadge)
- {
- mBadge->setLabel(label);
-
- //
- // Push the badge to the front so it renders on top
- //
-
- LLView * parent = mBadge->getParent();
+ mHasBadgeHolderParent = false;
- if (parent)
+ LLView * owner_view = mBadgeOwnerView.get();
+ if (owner_view)
{
- parent->sendChildToFront(mBadge);
+ mBadge->addToView(owner_view);
}
}
}
@@ -82,10 +64,8 @@ void LLBadgeOwner::setBadgeVisibility(bool visible)
}
}
-bool LLBadgeOwner::addBadgeToParentPanel()
+void LLBadgeOwner::addBadgeToParentHolder()
{
- bool badge_added = false;
-
LLView * owner_view = mBadgeOwnerView.get();
if (mBadge && owner_view)
@@ -110,16 +90,9 @@ bool LLBadgeOwner::addBadgeToParentPanel()
if (badge_holder)
{
- badge_added = badge_holder->addBadge(mBadge);
- }
- else
- {
- // Badge parent is fallback badge owner if no valid holder exists in the hierarchy
- badge_added = mBadge->addToView(owner_view);
+ mHasBadgeHolderParent = badge_holder->addBadge(mBadge);
}
}
-
- return badge_added;
}
LLBadge* LLBadgeOwner::createBadge(const LLBadge::Params& p)
diff --git a/indra/llui/llbadgeowner.h b/indra/llui/llbadgeowner.h
index 8d03e30645..53c2de95c8 100755
--- a/indra/llui/llbadgeowner.h
+++ b/indra/llui/llbadgeowner.h
@@ -41,11 +41,9 @@ public:
LLBadgeOwner(LLHandle< LLView > viewHandle);
void initBadgeParams(const LLBadge::Params& p);
- bool addBadgeToParentPanel();
+ void addBadgeToParentHolder();
- bool badgeHasParent() const { return (mBadge && mBadge->getParent()); }
-
- void setBadgeLabel(const LLStringExplicit& label);
+ bool hasBadgeHolderParent() const { return mHasBadgeHolderParent; };
void setBadgeVisibility(bool visible);
private:
@@ -53,7 +51,7 @@ private:
LLBadge* createBadge(const LLBadge::Params& p);
private:
-
+ bool mHasBadgeHolderParent;
LLBadge* mBadge;
LLHandle< LLView > mBadgeOwnerView;
};
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 3cfe5ac57f..ce8383857c 100755
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -253,7 +253,7 @@ LLButton::LLButton(const LLButton::Params& p)
if (mImageUnselected.isNull())
{
- llwarns << "Button: " << getName() << " with no image!" << llendl;
+ LL_WARNS() << "Button: " << getName() << " with no image!" << LL_ENDL;
}
if (p.click_callback.isProvided())
@@ -384,7 +384,7 @@ BOOL LLButton::postBuild()
{
autoResize();
- addBadgeToParentPanel();
+ addBadgeToParentHolder();
return LLUICtrl::postBuild();
}
@@ -595,7 +595,7 @@ BOOL LLButton::handleHover(S32 x, S32 y, MASK mask)
// We only handle the click if the click both started and ended within us
getWindow()->setCursor(UI_CURSOR_ARROW);
- lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by " << getName() << LL_ENDL;
}
return TRUE;
}
@@ -782,12 +782,12 @@ void LLButton::draw()
if (use_glow_effect)
{
mCurGlowStrength = lerp(mCurGlowStrength,
- mFlashing ? (mFlashingTimer->isCurrentlyHighlighted() || !mFlashingTimer->isFlashingInProgress() || mNeedsHighlight? 1.0 : 0.0) : mHoverGlowStrength,
- LLCriticalDamp::getInterpolant(0.05f));
+ mFlashing ? (mFlashingTimer->isCurrentlyHighlighted() || !mFlashingTimer->isFlashingInProgress() || mNeedsHighlight? 1.f : 0.f) : mHoverGlowStrength,
+ LLSmoothInterpolation::getInterpolant(0.05f));
}
else
{
- mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLCriticalDamp::getInterpolant(0.05f));
+ mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLSmoothInterpolation::getInterpolant(0.05f));
}
// Draw button image, if available.
@@ -820,7 +820,7 @@ void LLButton::draw()
else
{
// no image
- lldebugs << "No image for button " << getName() << llendl;
+ LL_DEBUGS() << "No image for button " << getName() << LL_ENDL;
// draw it in pink so we can find it
gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4::pink1 % alpha, FALSE);
}
@@ -1044,7 +1044,7 @@ void LLButton::setImageUnselected(LLPointer<LLUIImage> image)
mImageUnselected = image;
if (mImageUnselected.isNull())
{
- llwarns << "Setting default button image for: " << getName() << " to NULL" << llendl;
+ LL_WARNS() << "Setting default button image for: " << getName() << " to NULL" << LL_ENDL;
}
}
diff --git a/indra/llcommon/llchat.h b/indra/llui/llchat.h
index f5b242fdfc..f5b242fdfc 100755
--- a/indra/llcommon/llchat.h
+++ b/indra/llui/llchat.h
diff --git a/indra/llui/llchatentry.cpp b/indra/llui/llchatentry.cpp
index c04b70eb64..dac001afab 100755
--- a/indra/llui/llchatentry.cpp
+++ b/indra/llui/llchatentry.cpp
@@ -51,6 +51,7 @@ LLChatEntry::LLChatEntry(const Params& p)
mCurrentHistoryLine = mLineHistory.begin();
mAutoIndent = false;
+ keepSelectionOnReturn(true);
}
LLChatEntry::~LLChatEntry()
@@ -179,15 +180,6 @@ BOOL LLChatEntry::handleSpecialKey(const KEY key, const MASK mask)
{
BOOL handled = FALSE;
- // In the case of a chat entry, pressing RETURN when something is selected
- // should NOT erase the selection (unlike a notecard, for example)
- if (key == KEY_RETURN)
- {
- endOfDoc();
- startSelection();
- endSelection();
- }
-
LLTextEditor::handleSpecialKey(key, mask);
switch(key)
diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp
index 14173fdbb0..1d18cb2bb0 100755
--- a/indra/llui/llclipboard.cpp
+++ b/indra/llui/llclipboard.cpp
@@ -88,6 +88,7 @@ bool LLClipboard::pasteFromClipboard(std::vector<LLUUID>& inv_objects) const
{
bool res = false;
S32 count = mObjects.size();
+ inv_objects.reserve(inv_objects.size() + count);
if (count > 0)
{
res = true;
diff --git a/indra/llui/llclipboard.h b/indra/llui/llclipboard.h
index fd2e7610df..58d80e2687 100755
--- a/indra/llui/llclipboard.h
+++ b/indra/llui/llclipboard.h
@@ -31,7 +31,6 @@
#include "llstring.h"
#include "lluuid.h"
-#include "stdenums.h"
#include "llsingleton.h"
#include "llassettype.h"
#include "llinventory.h"
diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp
index 625fb8e870..74ef8dd0c3 100755
--- a/indra/llui/llcommandmanager.cpp
+++ b/indra/llui/llcommandmanager.cpp
@@ -137,7 +137,7 @@ void LLCommandManager::addCommand(LLCommand * command)
mCommandIndices[command_id.uuid()] = mCommands.size();
mCommands.push_back(command);
- lldebugs << "Successfully added command: " << command->name() << llendl;
+ LL_DEBUGS() << "Successfully added command: " << command->name() << LL_ENDL;
}
//static
@@ -153,13 +153,13 @@ bool LLCommandManager::load()
if (!parser.readXUI(commands_file, commandsParams))
{
- llerrs << "Unable to load xml file: " << commands_file << llendl;
+ LL_ERRS() << "Unable to load xml file: " << commands_file << LL_ENDL;
return false;
}
if (!commandsParams.validateBlock())
{
- llerrs << "Invalid commands file: " << commands_file << llendl;
+ LL_ERRS() << "Invalid commands file: " << commands_file << LL_ENDL;
return false;
}
diff --git a/indra/llui/llcontainerview.cpp b/indra/llui/llcontainerview.cpp
index e08ccb0b78..727fbe850e 100755
--- a/indra/llui/llcontainerview.cpp
+++ b/indra/llui/llcontainerview.cpp
@@ -49,7 +49,6 @@ LLContainerView::LLContainerView(const LLContainerView::Params& p)
mLabel(p.label),
mDisplayChildren(p.display_children)
{
- mCollapsible = TRUE;
mScrollContainer = NULL;
}
@@ -75,6 +74,11 @@ bool LLContainerView::addChild(LLView* child, S32 tab_group)
return res;
}
+BOOL LLContainerView::handleDoubleClick(S32 x, S32 y, MASK mask)
+{
+ return handleMouseDown(x, y, mask);
+}
+
BOOL LLContainerView::handleMouseDown(S32 x, S32 y, MASK mask)
{
BOOL handled = FALSE;
@@ -84,7 +88,7 @@ BOOL LLContainerView::handleMouseDown(S32 x, S32 y, MASK mask)
}
if (!handled)
{
- if( mCollapsible && mShowLabel && (y >= getRect().getHeight() - 10) )
+ if( mShowLabel && (y >= getRect().getHeight() - 10) )
{
setDisplayChildren(!mDisplayChildren);
reshape(getRect().getWidth(), getRect().getHeight(), FALSE);
@@ -163,7 +167,7 @@ void LLContainerView::arrange(S32 width, S32 height, BOOL called_from_parent)
//LLView *childp;
// These will be used for the children
- left = 4;
+ left = 10;
top = getRect().getHeight() - 4;
right = width - 2;
bottom = top;
@@ -184,7 +188,7 @@ void LLContainerView::arrange(S32 width, S32 height, BOOL called_from_parent)
LLView *childp = *child_iter;
if (!childp->getVisible())
{
- llwarns << "Incorrect visibility!" << llendl;
+ LL_WARNS() << "Incorrect visibility!" << LL_ENDL;
}
LLRect child_rect = childp->getRequiredRect();
child_height += child_rect.getHeight();
diff --git a/indra/llui/llcontainerview.h b/indra/llui/llcontainerview.h
index e81600fd6c..ac92b19977 100755
--- a/indra/llui/llcontainerview.h
+++ b/indra/llui/llcontainerview.h
@@ -66,6 +66,7 @@ public:
/*virtual*/ BOOL postBuild();
/*virtual*/ bool addChild(LLView* view, S32 tab_group = 0);
+ /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
/*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask);
/*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask);
@@ -87,8 +88,5 @@ public:
protected:
BOOL mDisplayChildren;
std::string mLabel;
-public:
- BOOL mCollapsible;
-
};
#endif // LL_CONTAINERVIEW_
diff --git a/indra/llui/llctrlselectioninterface.h b/indra/llui/llctrlselectioninterface.h
index 2cdcbd88fe..a7b089c8f9 100755
--- a/indra/llui/llctrlselectioninterface.h
+++ b/indra/llui/llctrlselectioninterface.h
@@ -28,8 +28,8 @@
#define LLCTRLSELECTIONINTERFACE_H
#include "stdtypes.h"
-#include "stdenums.h"
#include "llstring.h"
+#include "llui.h"
class LLSD;
class LLUUID;
diff --git a/indra/llui/lldraghandle.cpp b/indra/llui/lldraghandle.cpp
index 304d21d0df..7c6559eddb 100755
--- a/indra/llui/lldraghandle.cpp
+++ b/indra/llui/lldraghandle.cpp
@@ -366,13 +366,13 @@ BOOL LLDragHandle::handleHover(S32 x, S32 y, MASK mask)
mDragLastScreenY += delta_y;
getWindow()->setCursor(UI_CURSOR_ARROW);
- lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" <<llendl;
+ LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" <<LL_ENDL;
handled = TRUE;
}
else
{
getWindow()->setCursor(UI_CURSOR_ARROW);
- lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << LL_ENDL;
handled = TRUE;
}
diff --git a/indra/llui/llflashtimer.cpp b/indra/llui/llflashtimer.cpp
index e49628acd5..6d9c429b08 100755
--- a/indra/llui/llflashtimer.cpp
+++ b/indra/llui/llflashtimer.cpp
@@ -23,29 +23,27 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-#include "../newview/llviewerprecompiledheaders.h"
-
#include "llflashtimer.h"
-#include "../newview/llviewercontrol.h"
#include "lleventtimer.h"
+#include "llui.h"
LLFlashTimer::LLFlashTimer(callback_t cb, S32 count, F32 period)
- : LLEventTimer(period)
- , mCallback(cb)
- , mCurrentTickCount(0)
- , mIsFlashingInProgress(false)
- , mIsCurrentlyHighlighted(false)
- , mUnset(false)
+: LLEventTimer(period),
+ mCallback(cb),
+ mCurrentTickCount(0),
+ mIsFlashingInProgress(false),
+ mIsCurrentlyHighlighted(false),
+ mUnset(false)
{
mEventTimer.stop();
// By default use settings from settings.xml to be able change them via Debug settings. See EXT-5973.
// Due to Timer is implemented as derived class from EventTimer it is impossible to change period
// in runtime. So, both settings are made as required restart.
- mFlashCount = 2 * ((count > 0) ? count : gSavedSettings.getS32("FlashCount"));
+ mFlashCount = 2 * ((count > 0) ? count : LLUI::sSettingGroups["config"]->getS32("FlashCount"));
if (mPeriod <= 0)
{
- mPeriod = gSavedSettings.getF32("FlashPeriod");
+ mPeriod = LLUI::sSettingGroups["config"]->getF32("FlashPeriod");
}
}
diff --git a/indra/llui/llflashtimer.h b/indra/llui/llflashtimer.h
index c60f99a8ea..db8d49f009 100755
--- a/indra/llui/llflashtimer.h
+++ b/indra/llui/llflashtimer.h
@@ -28,6 +28,7 @@
#define LL_FLASHTIMER_H
#include "lleventtimer.h"
+#include "boost/function.hpp"
class LLFlashTimer : public LLEventTimer
{
diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp
index 97a52fada4..299f5e42d4 100755
--- a/indra/llui/llflatlistview.cpp
+++ b/indra/llui/llflatlistview.cpp
@@ -347,7 +347,7 @@ void LLFlatListView::sort()
{
if (!mItemComparator)
{
- llwarns << "No comparator specified for sorting FlatListView items." << llendl;
+ LL_WARNS() << "No comparator specified for sorting FlatListView items." << LL_ENDL;
return;
}
@@ -520,7 +520,7 @@ void LLFlatListView::onItemMouseClick(item_pair_t* item_pair, MASK mask)
if (!item_pair->first)
{
- llwarning("Attempt to selet an item pair containing null panel item", 0);
+ LL_WARNS() << "Attempt to selet an item pair containing null panel item" << LL_ENDL;
return;
}
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index c462b2aa52..3dbc9a5902 100755
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -133,7 +133,7 @@ bool LLFloater::KeyCompare::compare(const LLSD& a, const LLSD& b)
{
if (a.type() != b.type())
{
- //llerrs << "Mismatched LLSD types: (" << a << ") mismatches (" << b << ")" << llendl;
+ //LL_ERRS() << "Mismatched LLSD types: (" << a << ") mismatches (" << b << ")" << LL_ENDL;
return false;
}
else if (a.isUndefined())
@@ -586,7 +586,7 @@ LLControlGroup* LLFloater::getControlGroup()
void LLFloater::setVisible( BOOL visible )
{
- LLPanel::setVisible(visible); // calls handleVisibilityChange()
+ LLPanel::setVisible(visible); // calls onVisibilityChange()
if( visible && mFirstLook )
{
mFirstLook = FALSE;
@@ -629,24 +629,24 @@ void LLFloater::setIsSingleInstance(BOOL is_single_instance)
// virtual
-void LLFloater::handleVisibilityChange ( BOOL new_visibility )
+void LLFloater::onVisibilityChange ( BOOL new_visibility )
{
if (new_visibility)
{
if (getHost())
getHost()->setFloaterFlashing(this, FALSE);
}
- LLPanel::handleVisibilityChange ( new_visibility );
+ LLPanel::onVisibilityChange ( new_visibility );
}
void LLFloater::openFloater(const LLSD& key)
{
- llinfos << "Opening floater " << getName() << " full path: " << getPathname() << llendl;
+ LL_INFOS() << "Opening floater " << getName() << " full path: " << getPathname() << LL_ENDL;
LLViewerEventRecorder::instance().logVisibilityChange( getPathname(), getName(), true,"floater"); // Last param is event subtype or empty string
mKey = key; // in case we need to open ourselves again
-
+
if (getSoundFlags() != SILENT
// don't play open sound for hosted (tabbed) windows
&& !getHost()
@@ -697,7 +697,7 @@ void LLFloater::openFloater(const LLSD& key)
void LLFloater::closeFloater(bool app_quitting)
{
- llinfos << "Closing floater " << getName() << llendl;
+ LL_INFOS() << "Closing floater " << getName() << LL_ENDL;
LLViewerEventRecorder::instance().logVisibilityChange( getPathname(), getName(), false,"floater"); // Last param is event subtype or empty string
if (app_quitting)
{
@@ -795,7 +795,7 @@ void LLFloater::closeFloater(bool app_quitting)
}
else
{
- setVisible(FALSE); // hide before destroying (so handleVisibilityChange() gets called)
+ setVisible(FALSE); // hide before destroying (so onVisibilityChange() gets called)
if (!mReuseInstance)
{
destroy();
@@ -1094,7 +1094,7 @@ BOOL LLFloater::canSnapTo(const LLView* other_view)
{
if (NULL == other_view)
{
- llwarns << "other_view is NULL" << llendl;
+ LL_WARNS() << "other_view is NULL" << LL_ENDL;
return FALSE;
}
@@ -1153,11 +1153,11 @@ void LLFloater::handleReshape(const LLRect& new_rect, bool by_user)
{
setDocked( false, false);
}
- storeRectControl();
- mPositioning = LLFloaterEnums::POSITIONING_RELATIVE;
- LLRect screen_rect = calcScreenRect();
- mPosition = LLCoordGL(screen_rect.getCenterX(), screen_rect.getCenterY()).convert();
- }
+ storeRectControl();
+ mPositioning = LLFloaterEnums::POSITIONING_RELATIVE;
+ LLRect screen_rect = calcScreenRect();
+ mPosition = LLCoordGL(screen_rect.getCenterX(), screen_rect.getCenterY()).convert();
+ }
// gather all snapped dependents
for(handle_set_iter_t dependent_it = mDependents.begin();
@@ -1553,7 +1553,7 @@ BOOL LLFloater::handleScrollWheel(S32 x, S32 y, S32 clicks)
// virtual
BOOL LLFloater::handleMouseUp(S32 x, S32 y, MASK mask)
{
- lldebugs << "LLFloater::handleMouseUp calling LLPanel (really LLView)'s handleMouseUp (first initialized xui to: " << getPathname() << " )" << llendl;
+ LL_DEBUGS() << "LLFloater::handleMouseUp calling LLPanel (really LLView)'s handleMouseUp (first initialized xui to: " << getPathname() << " )" << LL_ENDL;
BOOL handled = LLPanel::handleMouseUp(x,y,mask); // Not implemented in LLPanel so this actually calls LLView
if (handled) {
LLViewerEventRecorder::instance().updateMouseEventInfo(x,y,-55,-55,getPathname());
@@ -1634,7 +1634,7 @@ void LLFloater::bringToFront( S32 x, S32 y )
// virtual
-void LLFloater::setVisibleAndFrontmost(BOOL take_focus, const LLSD& key)
+void LLFloater::setVisibleAndFrontmost(BOOL take_focus,const LLSD& key)
{
LLMultiFloater* hostp = getHost();
if (hostp)
@@ -2955,13 +2955,6 @@ void LLFloaterView::syncFloaterTabOrder()
}
}
}
-
- // sync draw order to tab order
- for ( child_list_const_reverse_iter_t child_it = getChildList()->rbegin(); child_it != getChildList()->rend(); ++child_it)
- {
- LLFloater* floaterp = (LLFloater*)*child_it;
- moveChildToFrontOfTabGroup(floaterp);
- }
}
LLFloater* LLFloaterView::getParentFloater(LLView* viewp) const
@@ -3045,7 +3038,7 @@ void LLFloaterView::setToolbarRect(LLToolBarEnums::EToolBarLocation tb, const LL
mToolbarRightRect = toolbar_rect;
break;
default:
- llwarns << "setToolbarRect() passed odd toolbar number " << (S32) tb << llendl;
+ LL_WARNS() << "setToolbarRect() passed odd toolbar number " << (S32) tb << LL_ENDL;
break;
}
}
@@ -3183,8 +3176,8 @@ boost::signals2::connection LLFloater::setCloseCallback( const commit_signal_t::
return mCloseSignal.connect(cb);
}
-LLFastTimer::DeclareTimer POST_BUILD("Floater Post Build");
-static LLFastTimer::DeclareTimer FTM_EXTERNAL_FLOATER_LOAD("Load Extern Floater Reference");
+LLTrace::BlockTimerStatHandle POST_BUILD("Floater Post Build");
+static LLTrace::BlockTimerStatHandle FTM_EXTERNAL_FLOATER_LOAD("Load Extern Floater Reference");
bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::string& filename, LLXMLNodePtr output_node)
{
@@ -3208,16 +3201,16 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::str
parser.readXUI(node, output_params, LLUICtrlFactory::getInstance()->getCurFileName());
setupParamsForExport(output_params, parent);
output_node->setName(node->getName()->mString);
- parser.writeXUI(output_node, output_params, &default_params);
+ parser.writeXUI(output_node, output_params, LLInitParam::default_parse_rules(), &default_params);
return TRUE;
}
LLUICtrlFactory::instance().pushFileName(xml_filename);
- LLFastTimer _(FTM_EXTERNAL_FLOATER_LOAD);
+ LL_RECORD_BLOCK_TIME(FTM_EXTERNAL_FLOATER_LOAD);
if (!LLUICtrlFactory::getLayeredXMLNode(xml_filename, referenced_xml))
{
- llwarns << "Couldn't parse panel from: " << xml_filename << llendl;
+ LL_WARNS() << "Couldn't parse panel from: " << xml_filename << LL_ENDL;
return FALSE;
}
@@ -3238,9 +3231,8 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::str
{
Params output_params(params);
setupParamsForExport(output_params, parent);
- Params default_params(LLUICtrlFactory::getDefaultParams<LLFloater>());
output_node->setName(node->getName()->mString);
- parser.writeXUI(output_node, output_params, &default_params);
+ parser.writeXUI(output_node, output_params, LLInitParam::default_parse_rules(), &default_params);
}
// Default floater position to top-left corner of screen
@@ -3292,14 +3284,14 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::str
BOOL result;
{
- LLFastTimer ft(POST_BUILD);
+ LL_RECORD_BLOCK_TIME(POST_BUILD);
result = postBuild();
}
if (!result)
{
- llerrs << "Failed to construct floater " << getName() << llendl;
+ LL_ERRS() << "Failed to construct floater " << getName() << LL_ENDL;
}
applyRectControl(); // If we have a saved rect control, apply it
@@ -3340,29 +3332,29 @@ bool LLFloater::isVisible(const LLFloater* floater)
return floater && floater->getVisible();
}
-static LLFastTimer::DeclareTimer FTM_BUILD_FLOATERS("Build Floaters");
+static LLTrace::BlockTimerStatHandle FTM_BUILD_FLOATERS("Build Floaters");
bool LLFloater::buildFromFile(const std::string& filename)
{
- LLFastTimer timer(FTM_BUILD_FLOATERS);
+ LL_RECORD_BLOCK_TIME(FTM_BUILD_FLOATERS);
LLXMLNodePtr root;
if (!LLUICtrlFactory::getLayeredXMLNode(filename, root))
{
- llwarns << "Couldn't find (or parse) floater from: " << filename << llendl;
+ LL_WARNS() << "Couldn't find (or parse) floater from: " << filename << LL_ENDL;
return false;
}
// root must be called floater
if( !(root->hasName("floater") || root->hasName("multi_floater")) )
{
- llwarns << "Root node should be named floater in: " << filename << llendl;
+ LL_WARNS() << "Root node should be named floater in: " << filename << LL_ENDL;
return false;
}
bool res = true;
- lldebugs << "Building floater " << filename << llendl;
+ LL_DEBUGS() << "Building floater " << filename << LL_ENDL;
LLUICtrlFactory::instance().pushFileName(filename);
{
if (!getFactoryMap().empty())
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 12eb3cdbfa..ef7c6180d2 100755
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -308,10 +308,10 @@ public:
virtual BOOL canClose() { return TRUE; }
/*virtual*/ void setVisible(BOOL visible); // do not override
- /*virtual*/ void handleVisibilityChange ( BOOL new_visibility ); // do not override
+ /*virtual*/ void onVisibilityChange ( BOOL new_visibility ); // do not override
void setFrontmost(BOOL take_focus = TRUE);
- virtual void setVisibleAndFrontmost(BOOL take_focus=TRUE, const LLSD& key = LLSD());
+ virtual void setVisibleAndFrontmost(BOOL take_focus=TRUE, const LLSD& key = LLSD());
// Defaults to false.
virtual BOOL canSaveAs() const { return FALSE; }
diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp
index b1b75776a7..9ef290abc0 100755
--- a/indra/llui/llfloaterreg.cpp
+++ b/indra/llui/llfloaterreg.cpp
@@ -151,13 +151,13 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key)
res = build_func(key);
if (!res)
{
- llwarns << "Failed to build floater type: '" << name << "'." << llendl;
+ LL_WARNS() << "Failed to build floater type: '" << name << "'." << LL_ENDL;
return NULL;
}
bool success = res->buildFromFile(xui_file);
if (!success)
{
- llwarns << "Failed to build floater type: '" << name << "'." << llendl;
+ LL_WARNS() << "Failed to build floater type: '" << name << "'." << LL_ENDL;
return NULL;
}
@@ -179,7 +179,7 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key)
}
if (!res)
{
- llwarns << "Floater type: '" << name << "' not registered." << llendl;
+ LL_WARNS() << "Floater type: '" << name << "' not registered." << LL_ENDL;
}
}
return res;
@@ -475,7 +475,7 @@ void LLFloaterReg::toggleInstanceOrBringToFront(const LLSD& sdname, const LLSD&
if (!instance)
{
- lldebugs << "Unable to get instance of floater '" << name << "'" << llendl;
+ LL_DEBUGS() << "Unable to get instance of floater '" << name << "'" << LL_ENDL;
return;
}
diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h
index a1e1f8a988..e3b17dcb4f 100755
--- a/indra/llui/llfloaterreg.h
+++ b/indra/llui/llfloaterreg.h
@@ -30,6 +30,7 @@
#include "llrect.h"
#include "llsd.h"
+#include <list>
#include <boost/function.hpp>
//*******************************************************
diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp
index f03c8d444b..547f0bd398 100755
--- a/indra/llui/llfocusmgr.cpp
+++ b/indra/llui/llfocusmgr.cpp
@@ -358,11 +358,11 @@ void LLFocusMgr::setMouseCapture( LLMouseHandler* new_captor )
{
if (new_captor)
{
- llinfos << "New mouse captor: " << new_captor->getName() << llendl;
+ LL_INFOS() << "New mouse captor: " << new_captor->getName() << LL_ENDL;
}
else
{
- llinfos << "New mouse captor: NULL" << llendl;
+ LL_INFOS() << "New mouse captor: NULL" << LL_ENDL;
}
}
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index 704e03a605..474b545f00 100755
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -173,6 +173,7 @@ LLFolderView::LLFolderView(const Params& p)
mShowItemLinkOverlays(p.show_item_link_overlays),
mViewModel(p.view_model)
{
+ claimMem(mViewModel);
LLPanel* panel = p.parent_panel;
mParentPanel = panel->getHandle();
mViewModel->setFolderView(this);
@@ -226,10 +227,11 @@ LLFolderView::LLFolderView(const Params& p)
mStatusTextBox = LLUICtrlFactory::create<LLTextBox> (text_p);
mStatusTextBox->setFollowsLeft();
mStatusTextBox->setFollowsTop();
- //addChild(mStatusTextBox);
+ addChild(mStatusTextBox);
// make the popup menu available
+ llassert(LLMenuGL::sMenuContainer != NULL);
LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>(p.options_menu, LLMenuGL::sMenuContainer, LLMenuHolderGL::child_registry_t::instance());
if (!menu)
{
@@ -256,8 +258,6 @@ LLFolderView::~LLFolderView( void )
mRenamer = NULL;
mStatusTextBox = NULL;
- mAutoOpenItems.removeAllNodes();
-
if (mPopupMenuHandle.get()) mPopupMenuHandle.get()->die();
mAutoOpenItems.removeAllNodes();
@@ -321,12 +321,11 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height )
return llround(mTargetHeight);
}
-static LLFastTimer::DeclareTimer FTM_FILTER("Filter Folder View");
+static LLTrace::BlockTimerStatHandle FTM_FILTER("Filter Folder View");
void LLFolderView::filter( LLFolderViewFilter& filter )
{
- // Entry point of inventory filtering (CHUI-849)
- LLFastTimer t2(FTM_FILTER);
+ LL_RECORD_BLOCK_TIME(FTM_FILTER);
filter.resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32(mParentPanel.get()->getVisible() ? "FilterItemsMaxTimePerFrameVisible" : "FilterItemsMaxTimePerFrameUnvisible"), 1, 100));
// Note: we filter the model, not the view
@@ -486,10 +485,10 @@ BOOL LLFolderView::changeSelection(LLFolderViewItem* selection, BOOL selected)
return rv;
}
-static LLFastTimer::DeclareTimer FTM_SANITIZE_SELECTION("Sanitize Selection");
+static LLTrace::BlockTimerStatHandle FTM_SANITIZE_SELECTION("Sanitize Selection");
void LLFolderView::sanitizeSelection()
{
- LLFastTimer _(FTM_SANITIZE_SELECTION);
+ LL_RECORD_BLOCK_TIME(FTM_SANITIZE_SELECTION);
// store off current item in case it is automatically deselected
// and we want to preserve context
LLFolderViewItem* original_selected_item = getCurSelectedItem();
@@ -631,6 +630,8 @@ bool LLFolderView::startDrag()
void LLFolderView::commitRename( const LLSD& data )
{
finishRenamingItem();
+ arrange( NULL, NULL );
+
}
void LLFolderView::draw()
@@ -703,8 +704,9 @@ void LLFolderView::finishRenamingItem( void )
closeRenamer();
+ // This is moved to an inventory observer in llinventorybridge.cpp, to handle updating after operation completed in AISv3 (SH-4611).
// List is re-sorted alphabetically, so scroll to make sure the selected item is visible.
- scrollToShowSelection();
+ //scrollToShowSelection();
}
void LLFolderView::closeRenamer( void )
@@ -740,7 +742,7 @@ void LLFolderView::removeSelectedItems()
}
else
{
- llinfos << "Cannot delete " << item->getName() << llendl;
+ LL_INFOS() << "Cannot delete " << item->getName() << LL_ENDL;
return;
}
}
@@ -766,20 +768,21 @@ void LLFolderView::removeSelectedItems()
}
else if (count > 1)
{
- LLDynamicArray<LLFolderViewModelItem*> listeners;
+ std::vector<LLFolderViewModelItem*> listeners;
LLFolderViewModelItem* listener;
setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, mParentPanel.get()->hasFocus());
+ listeners.reserve(count);
for(S32 i = 0; i < count; ++i)
{
listener = items[i]->getViewModelItem();
- if(listener && (listeners.find(listener) == LLDynamicArray<LLFolderViewModelItem*>::FAIL))
+ if(listener && (std::find(listeners.begin(), listeners.end(), listener) == listeners.end()))
{
- listeners.put(listener);
+ listeners.push_back(listener);
}
}
- listener = static_cast<LLFolderViewModelItem*>(listeners.get(0));
+ listener = static_cast<LLFolderViewModelItem*>(listeners.at(0));
if(listener)
{
listener->removeBatch(listeners);
@@ -1127,18 +1130,18 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
if((mSelectedItems.size() > 0) && mScrollContainer)
{
LLFolderViewItem* last_selected = getCurSelectedItem();
+ BOOL shift_select = mask & MASK_SHIFT;
+ // don't shift select down to children of folders (they are implicitly selected through parent)
+ LLFolderViewItem* next = last_selected->getNextOpenNode(!shift_select);
- if (!mKeyboardSelection)
+ if (!mKeyboardSelection || (!shift_select && (!next || next == last_selected)))
{
setSelection(last_selected, FALSE, TRUE);
mKeyboardSelection = TRUE;
}
- LLFolderViewItem* next = NULL;
- if (mask & MASK_SHIFT)
+ if (shift_select)
{
- // don't shift select down to children of folders (they are implicitly selected through parent)
- next = last_selected->getNextOpenNode(FALSE);
if (next)
{
if (next->isSelected())
@@ -1155,7 +1158,6 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
}
else
{
- next = last_selected->getNextOpenNode();
if( next )
{
if (next == last_selected)
@@ -1191,18 +1193,18 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
if((mSelectedItems.size() > 0) && mScrollContainer)
{
LLFolderViewItem* last_selected = mSelectedItems.back();
+ BOOL shift_select = mask & MASK_SHIFT;
+ // don't shift select down to children of folders (they are implicitly selected through parent)
+ LLFolderViewItem* prev = last_selected->getPreviousOpenNode(!shift_select);
- if (!mKeyboardSelection)
+ if (!mKeyboardSelection || (!shift_select && prev == this))
{
setSelection(last_selected, FALSE, TRUE);
mKeyboardSelection = TRUE;
}
- LLFolderViewItem* prev = NULL;
- if (mask & MASK_SHIFT)
+ if (shift_select)
{
- // don't shift select down to children of folders (they are implicitly selected through parent)
- prev = last_selected->getPreviousOpenNode(FALSE);
if (prev)
{
if (prev->isSelected())
@@ -1219,7 +1221,6 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
}
else
{
- prev = last_selected->getPreviousOpenNode();
if( prev )
{
if (prev == this)
@@ -1286,7 +1287,7 @@ BOOL LLFolderView::handleUnicodeCharHere(llwchar uni_char)
if (uni_char > 0x7f)
{
- llwarns << "LLFolderView::handleUnicodeCharHere - Don't handle non-ascii yet, aborting" << llendl;
+ LL_WARNS() << "LLFolderView::handleUnicodeCharHere - Don't handle non-ascii yet, aborting" << LL_ENDL;
return FALSE;
}
@@ -1370,7 +1371,8 @@ BOOL LLFolderView::search(LLFolderViewItem* first_item, const std::string &searc
}
}
- const std::string current_item_label(search_item->getViewModelItem()->getSearchableName());
+ std::string current_item_label(search_item->getViewModelItem()->getSearchableName());
+ LLStringUtil::toUpper(current_item_label);
S32 search_string_length = llmin(upper_case_string.size(), current_item_label.size());
if (!current_item_label.compare(0, search_string_length, upper_case_string))
{
@@ -1582,7 +1584,7 @@ BOOL LLFolderView::getShowSelectionContext()
return FALSE;
}
-void LLFolderView::setShowSingleSelection(BOOL show)
+void LLFolderView::setShowSingleSelection(bool show)
{
if (show != mShowSingleSelection)
{
@@ -1591,15 +1593,15 @@ void LLFolderView::setShowSingleSelection(BOOL show)
}
}
-static LLFastTimer::DeclareTimer FTM_AUTO_SELECT("Open and Select");
-static LLFastTimer::DeclareTimer FTM_INVENTORY("Inventory");
+static LLTrace::BlockTimerStatHandle FTM_AUTO_SELECT("Open and Select");
+static LLTrace::BlockTimerStatHandle FTM_INVENTORY("Inventory");
// Main idle routine
void LLFolderView::update()
{
// If this is associated with the user's inventory, don't do anything
// until that inventory is loaded up.
- LLFastTimer t2(FTM_INVENTORY);
+ LL_RECORD_BLOCK_TIME(FTM_INVENTORY);
// If there's no model, the view is in suspended state (being deleted) and shouldn't be updated
if (getFolderViewModel() == NULL)
@@ -1607,25 +1609,27 @@ void LLFolderView::update()
return;
}
- if (getFolderViewModel()->getFilter().isModified() && getFolderViewModel()->getFilter().isNotDefault())
+ LLFolderViewFilter& filter_object = getFolderViewModel()->getFilter();
+
+ if (filter_object.isModified() && filter_object.isNotDefault())
{
mNeedsAutoSelect = TRUE;
}
// Filter to determine visibility before arranging
- filter(getFolderViewModel()->getFilter());
+ filter(filter_object);
// Clear the modified setting on the filter only if the filter finished after running the filter process
// Note: if the filter count has timed out, that means the filter halted before completing the entire set of items
- if (getFolderViewModel()->getFilter().isModified() && (!getFolderViewModel()->getFilter().isTimedOut()))
+ if (filter_object.isModified() && (!filter_object.isTimedOut()))
{
- getFolderViewModel()->getFilter().clearModified();
+ filter_object.clearModified();
}
// automatically show matching items, and select first one if we had a selection
if (mNeedsAutoSelect)
{
- LLFastTimer t3(FTM_AUTO_SELECT);
+ LL_RECORD_BLOCK_TIME(FTM_AUTO_SELECT);
// select new item only if a filtered item not currently selected
LLFolderViewItem* selected_itemp = mSelectedItems.empty() ? NULL : mSelectedItems.back();
if (!mAutoSelectOverride && (!selected_itemp || !selected_itemp->getViewModelItem()->potentiallyVisible()))
@@ -1638,7 +1642,7 @@ void LLFolderView::update()
// Open filtered folders for folder views with mAutoSelectOverride=TRUE.
// Used by LLPlacesFolderView.
- if (getFolderViewModel()->getFilter().showAllResults())
+ if (filter_object.showAllResults())
{
// these are named variables to get around gcc not binding non-const references to rvalues
// and functor application is inherently non-const to allow for stateful functors
@@ -1758,14 +1762,14 @@ void LLFolderView::update()
void LLFolderView::dumpSelectionInformation()
{
- llinfos << "LLFolderView::dumpSelectionInformation()" << llendl;
- llinfos << "****************************************" << llendl;
+ LL_INFOS() << "LLFolderView::dumpSelectionInformation()" << LL_NEWLINE
+ << "****************************************" << LL_ENDL;
selected_items_t::iterator item_it;
for (item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it)
{
- llinfos << " " << (*item_it)->getName() << llendl;
+ LL_INFOS() << " " << (*item_it)->getName() << LL_ENDL;
}
- llinfos << "****************************************" << llendl;
+ LL_INFOS() << "****************************************" << LL_ENDL;
}
void LLFolderView::updateRenamerPosition()
diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h
index 5b83049e5c..08e0a6220a 100755
--- a/indra/llui/llfolderview.h
+++ b/indra/llui/llfolderview.h
@@ -39,7 +39,6 @@
#include "lluictrl.h"
#include "v4color.h"
-#include "stdenums.h"
#include "lldepthstack.h"
#include "lleditmenuhandler.h"
#include "llfontgl.h"
@@ -209,9 +208,9 @@ public:
LLRect getVisibleRect();
BOOL search(LLFolderViewItem* first_item, const std::string &search_string, BOOL backward);
- void setShowSelectionContext(BOOL show) { mShowSelectionContext = show; }
+ void setShowSelectionContext(bool show) { mShowSelectionContext = show; }
BOOL getShowSelectionContext();
- void setShowSingleSelection(BOOL show);
+ void setShowSingleSelection(bool show);
BOOL getShowSingleSelection() { return mShowSingleSelection; }
F32 getSelectionFadeElapsedTime() { return mMultiSelectionFadeTimer.getElapsedTimeF32(); }
bool getUseEllipses() { return mUseEllipses; }
@@ -236,7 +235,7 @@ public:
virtual S32 notify(const LLSD& info) ;
bool useLabelSuffix() { return mUseLabelSuffix; }
- void updateMenu();
+ virtual void updateMenu();
// Note: We may eventually have to move that method up the hierarchy to LLFolderViewItem.
LLHandle<LLFolderView> getHandle() const { return getDerivedHandle<LLFolderView>(); }
@@ -264,31 +263,32 @@ protected:
LLHandle<LLView> mPopupMenuHandle;
selected_items_t mSelectedItems;
- BOOL mKeyboardSelection;
- BOOL mAllowMultiSelect;
- BOOL mShowEmptyMessage;
- BOOL mShowFolderHierarchy;
+ bool mKeyboardSelection,
+ mAllowMultiSelect,
+ mShowEmptyMessage,
+ mShowFolderHierarchy,
+ mNeedsScroll,
+ mPinningSelectedItem,
+ mNeedsAutoSelect,
+ mAutoSelectOverride,
+ mNeedsAutoRename,
+ mUseLabelSuffix,
+ mDragAndDropThisFrame,
+ mShowItemLinkOverlays,
+ mShowSelectionContext,
+ mShowSingleSelection;
// Renaming variables and methods
LLFolderViewItem* mRenameItem; // The item currently being renamed
LLLineEditor* mRenamer;
- BOOL mNeedsScroll;
- BOOL mPinningSelectedItem;
LLRect mScrollConstraintRect;
- BOOL mNeedsAutoSelect;
- BOOL mAutoSelectOverride;
- BOOL mNeedsAutoRename;
- bool mUseLabelSuffix;
- bool mShowItemLinkOverlays;
LLDepthStack<LLFolderViewFolder> mAutoOpenItems;
LLFolderViewFolder* mAutoOpenCandidate;
LLFrameTimer mAutoOpenTimer;
LLFrameTimer mSearchTimer;
std::string mSearchString;
- BOOL mShowSelectionContext;
- BOOL mShowSingleSelection;
LLFrameTimer mMultiSelectionFadeTimer;
S32 mArrangeGeneration;
@@ -296,7 +296,6 @@ protected:
signal_t mReshapeSignal;
S32 mSignalSelectCallback;
S32 mMinWidth;
- BOOL mDragAndDropThisFrame;
LLHandle<LLPanel> mParentPanel;
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index aa2343226c..7c88f8fb9b 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -256,6 +256,24 @@ BOOL LLFolderViewItem::passedFilter(S32 filter_generation)
return getViewModelItem()->passedFilter(filter_generation);
}
+BOOL LLFolderViewItem::isPotentiallyVisible(S32 filter_generation)
+{
+ // Item should be visible if:
+ // 1. item passed current filter
+ // 2. item was updated (gen < 0) but has descendants that passed filter
+ // 3. item was recently updated and was visible before update
+
+ LLFolderViewModelItem* model = getViewModelItem();
+ if (model->getLastFilterGeneration() < 0 && !getFolderViewModel()->getFilter().isModified())
+ {
+ return model->descendantsPassedFilter(filter_generation) || getVisible();
+ }
+ else
+ {
+ return model->passedFilter(filter_generation);
+ }
+}
+
void LLFolderViewItem::refresh()
{
LLFolderViewModelItem& vmi = *getViewModelItem();
@@ -495,7 +513,7 @@ BOOL LLFolderViewItem::handleMouseDown( S32 x, S32 y, MASK mask )
// No handler needed for focus lost since this class has no
// state that depends on it.
gFocusMgr.setMouseCapture( this );
-
+
if (!mIsSelected)
{
if(mask & MASK_CONTROL)
@@ -642,7 +660,7 @@ BOOL LLFolderViewItem::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
}
if (handled)
{
- lldebugst(LLERR_USER_INPUT) << "dragAndDrop handled by LLFolderViewItem" << llendl;
+ LL_DEBUGS("UserInput") << "dragAndDrop handled by LLFolderViewItem" << LL_ENDL;
}
return handled;
@@ -655,7 +673,7 @@ void LLFolderViewItem::drawOpenFolderArrow(const Params& default_params, const L
//
const S32 TOP_PAD = default_params.item_top_pad;
- if (hasVisibleChildren() || getViewModelItem()->hasChildren())
+ if (hasVisibleChildren())
{
LLUIImage* arrow_image = default_params.folder_arrow_image;
gl_draw_scaled_rotated_image(
@@ -712,7 +730,7 @@ void LLFolderViewItem::drawHighlight(const BOOL showContent, const BOOL hasKeybo
bg_color.mV[VALPHA] = clamp_rescale(fade_time, 0.f, 0.4f, 0.f, bg_color.mV[VALPHA]);
}
gl_rect_2d(FOCUS_LEFT,
- focus_top,
+ focus_top,
getRect().getWidth() - 2,
focus_bottom,
bg_color, hasKeyboardFocus);
@@ -866,7 +884,7 @@ void LLFolderViewItem::draw()
LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW,
S32_MAX, S32_MAX, &right_x, FALSE );
}
-
+
//--------------------------------------------------------------------------------//
// Highlight string match
//
@@ -888,7 +906,7 @@ const LLFolderViewModelInterface* LLFolderViewItem::getFolderViewModel( void ) c
{
return getRoot()->getFolderViewModel();
}
-
+
LLFolderViewModelInterface* LLFolderViewItem::getFolderViewModel( void )
{
return getRoot()->getFolderViewModel();
@@ -925,11 +943,11 @@ void LLFolderViewFolder::updateLabelRotation()
}
else if (isOpen())
{
- mControlLabelRotation = lerp(mControlLabelRotation, -90.f, LLCriticalDamp::getInterpolant(0.04f));
+ mControlLabelRotation = lerp(mControlLabelRotation, -90.f, LLSmoothInterpolation::getInterpolant(0.04f));
}
else
{
- mControlLabelRotation = lerp(mControlLabelRotation, 0.f, LLCriticalDamp::getInterpolant(0.025f));
+ mControlLabelRotation = lerp(mControlLabelRotation, 0.f, LLSmoothInterpolation::getInterpolant(0.025f));
}
}
@@ -952,7 +970,7 @@ void LLFolderViewFolder::addToFolder(LLFolderViewFolder* folder)
: 0;
}
-static LLFastTimer::DeclareTimer FTM_ARRANGE("Arrange");
+static LLTrace::BlockTimerStatHandle FTM_ARRANGE("Arrange");
// Make everything right and in the right place ready for drawing (CHUI-849)
// * Sort everything correctly if necessary
@@ -967,8 +985,8 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
// Note that we sort from the root (CHUI-849)
getRoot()->getFolderViewModel()->sort(this);
- LLFastTimer t2(FTM_ARRANGE);
-
+ LL_RECORD_BLOCK_TIME(FTM_ARRANGE);
+
// evaluate mHasVisibleChildren
mHasVisibleChildren = false;
if (getViewModelItem()->descendantsPassedFilter())
@@ -979,7 +997,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
for (items_t::iterator iit = mItems.begin(); iit != mItems.end(); ++iit)
{
LLFolderViewItem* itemp = (*iit);
- found = itemp->passedFilter();
+ found = itemp->isPotentiallyVisible();
if (found)
break;
}
@@ -989,7 +1007,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
for (folders_t::iterator fit = mFolders.begin(); fit != mFolders.end(); ++fit)
{
LLFolderViewFolder* folderp = (*fit);
- found = folderp->passedFilter();
+ found = folderp->isPotentiallyVisible();
if (found)
break;
}
@@ -1022,7 +1040,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
for(folders_t::iterator fit = mFolders.begin(); fit != mFolders.end(); ++fit)
{
LLFolderViewFolder* folderp = (*fit);
- folderp->setVisible(folderp->passedFilter()); // passed filter or has descendants that passed filter
+ folderp->setVisible(folderp->isPotentiallyVisible());
if (folderp->getVisible())
{
@@ -1041,7 +1059,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
iit != mItems.end(); ++iit)
{
LLFolderViewItem* itemp = (*iit);
- itemp->setVisible(itemp->passedFilter());
+ itemp->setVisible(itemp->isPotentiallyVisible());
if (itemp->getVisible())
{
@@ -1073,7 +1091,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
// animate current height towards target height
if (llabs(mCurHeight - mTargetHeight) > 1.f)
{
- mCurHeight = lerp(mCurHeight, mTargetHeight, LLCriticalDamp::getInterpolant(isOpen() ? FOLDER_OPEN_TIME_CONSTANT : FOLDER_CLOSE_TIME_CONSTANT));
+ mCurHeight = lerp(mCurHeight, mTargetHeight, LLSmoothInterpolation::getInterpolant(isOpen() ? FOLDER_OPEN_TIME_CONSTANT : FOLDER_CLOSE_TIME_CONSTANT));
requestArrange();
@@ -1594,7 +1612,7 @@ void LLFolderViewFolder::addItem(LLFolderViewItem* item)
item->setVisible(FALSE);
addChild(item);
-
+
// When the model is already hooked into a hierarchy (i.e. has a parent), do not reparent it
// Note: this happens when models are created before views or shared between views
if (!item->getViewModelItem()->hasParent())
@@ -1767,7 +1785,7 @@ BOOL LLFolderViewFolder::handleDragAndDrop(S32 x, S32 y, MASK mask,
{
handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
- lldebugst(LLERR_USER_INPUT) << "dragAndDrop handled by LLFolderViewFolder" << llendl;
+ LL_DEBUGS("UserInput") << "dragAndDrop handled by LLFolderViewFolder" << LL_ENDL;
}
return TRUE;
diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h
index a9b0201236..0cd20a0f2d 100644
--- a/indra/llui/llfolderviewitem.h
+++ b/indra/llui/llfolderviewitem.h
@@ -254,6 +254,7 @@ public:
S32 getIndentation() { return mIndentation; }
virtual BOOL passedFilter(S32 filter_generation = -1);
+ virtual BOOL isPotentiallyVisible(S32 filter_generation = -1);
// refresh information from the object being viewed.
virtual void refresh();
diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h
index b1bcc8bbb4..8d98363c5f 100755
--- a/indra/llui/llfolderviewmodel.h
+++ b/indra/llui/llfolderviewmodel.h
@@ -108,9 +108,13 @@ public:
virtual S32 getFirstRequiredGeneration() const = 0;
};
-class LLFolderViewModelInterface
+class LLFolderViewModelInterface : public LLTrace::MemTrackable<LLFolderViewModelInterface>
{
public:
+ LLFolderViewModelInterface()
+ : LLTrace::MemTrackable<LLFolderViewModelInterface>("LLFolderViewModelInterface")
+ {}
+
virtual ~LLFolderViewModelInterface() {}
virtual void requestSortAll() = 0;
@@ -128,10 +132,13 @@ public:
// This is an abstract base class that users of the folderview classes
// would use to bridge the folder view with the underlying data
-class LLFolderViewModelItem : public LLRefCount
+class LLFolderViewModelItem : public LLRefCount, public LLTrace::MemTrackable<LLFolderViewModelItem>
{
public:
- LLFolderViewModelItem() { }
+ LLFolderViewModelItem()
+ : LLTrace::MemTrackable<LLFolderViewModelItem>("LLFolderViewModelItem")
+ {}
+
virtual ~LLFolderViewModelItem() { }
virtual void update() {} //called when drawing
@@ -336,18 +343,18 @@ protected:
virtual void setParent(LLFolderViewModelItem* parent) { mParent = parent; }
virtual bool hasParent() { return mParent != NULL; }
- S32 mSortVersion;
- bool mPassedFilter;
- bool mPassedFolderFilter;
- std::string::size_type mStringMatchOffsetFilter;
- std::string::size_type mStringFilterSize;
+ S32 mSortVersion;
+ bool mPassedFilter;
+ bool mPassedFolderFilter;
+ std::string::size_type mStringMatchOffsetFilter;
+ std::string::size_type mStringFilterSize;
- S32 mLastFilterGeneration;
- S32 mLastFolderFilterGeneration;
- S32 mMostFilteredDescendantGeneration;
+ S32 mLastFilterGeneration,
+ mLastFolderFilterGeneration,
+ mMostFilteredDescendantGeneration;
- child_list_t mChildren;
- LLFolderViewModelItem* mParent;
+ child_list_t mChildren;
+ LLFolderViewModelItem* mParent;
LLFolderViewModelInterface& mRootViewModel;
void setFolderViewItem(LLFolderViewItem* folder_view_item) { mFolderViewItem = folder_view_item;}
@@ -386,27 +393,36 @@ template <typename SORT_TYPE, typename ITEM_TYPE, typename FOLDER_TYPE, typename
class LLFolderViewModel : public LLFolderViewModelCommon
{
public:
- LLFolderViewModel(){}
- virtual ~LLFolderViewModel() {}
-
typedef SORT_TYPE SortType;
typedef ITEM_TYPE ItemType;
typedef FOLDER_TYPE FolderType;
typedef FILTER_TYPE FilterType;
- virtual SortType& getSorter() { return mSorter; }
- virtual const SortType& getSorter() const { return mSorter; }
- virtual void setSorter(const SortType& sorter) { mSorter = sorter; requestSortAll(); }
+ LLFolderViewModel(SortType* sorter, FilterType* filter)
+ : mSorter(sorter),
+ mFilter(filter)
+ {}
- virtual FilterType& getFilter() { return mFilter; }
- virtual const FilterType& getFilter() const { return mFilter; }
- virtual void setFilter(const FilterType& filter) { mFilter = filter; }
+ virtual ~LLFolderViewModel()
+ {
+ delete mSorter;
+ mSorter = NULL;
+ delete mFilter;
+ mFilter = NULL;
+ }
+
+ virtual SortType& getSorter() { return *mSorter; }
+ virtual const SortType& getSorter() const { return *mSorter; }
+ virtual void setSorter(const SortType& sorter) { mSorter = new SortType(sorter); requestSortAll(); }
+
+ virtual FilterType& getFilter() { return *mFilter; }
+ virtual const FilterType& getFilter() const { return *mFilter; }
+ virtual void setFilter(const FilterType& filter) { mFilter = new FilterType(filter); }
// By default, we assume the content is available. If a network fetch mechanism is implemented for the model,
// this method needs to be overloaded and return the relevant fetch status.
virtual bool contentsReady() { return true; }
-
struct ViewModelCompare
{
ViewModelCompare(const SortType& sorter)
@@ -438,8 +454,8 @@ public:
}
protected:
- SortType mSorter;
- FilterType mFilter;
+ SortType* mSorter;
+ FilterType* mFilter;
};
#endif // LLFOLDERVIEWMODEL_H
diff --git a/indra/llui/llfunctorregistry.h b/indra/llui/llfunctorregistry.h
index beac212441..f5364f4863 100755
--- a/indra/llui/llfunctorregistry.h
+++ b/indra/llui/llfunctorregistry.h
@@ -75,7 +75,7 @@ public:
}
else
{
- llerrs << "attempt to store duplicate name '" << name << "' in LLFunctorRegistry. NOT ADDED." << llendl;
+ LL_ERRS() << "attempt to store duplicate name '" << name << "' in LLFunctorRegistry. NOT ADDED." << LL_ENDL;
retval = false;
}
@@ -86,7 +86,7 @@ public:
{
if (mMap.count(name) == 0)
{
- llwarns << "trying to remove '" << name << "' from LLFunctorRegistry but it's not there." << llendl;
+ LL_WARNS() << "trying to remove '" << name << "' from LLFunctorRegistry but it's not there." << LL_ENDL;
return false;
}
mMap.erase(name);
@@ -101,7 +101,7 @@ public:
}
else
{
- lldebugs << "tried to find '" << name << "' in LLFunctorRegistry, but it wasn't there." << llendl;
+ LL_DEBUGS() << "tried to find '" << name << "' in LLFunctorRegistry, but it wasn't there." << LL_ENDL;
return mMap[LOGFUNCTOR];
}
}
@@ -113,7 +113,7 @@ private:
static void log_functor(const LLSD& notification, const LLSD& payload)
{
- lldebugs << "log_functor called with payload: " << payload << llendl;
+ LL_DEBUGS() << "log_functor called with payload: " << payload << LL_ENDL;
}
static void do_nothing(const LLSD& notification, const LLSD& payload)
diff --git a/indra/llui/lliconctrl.cpp b/indra/llui/lliconctrl.cpp
index 30b79b4d20..58b66f60ca 100755
--- a/indra/llui/lliconctrl.cpp
+++ b/indra/llui/lliconctrl.cpp
@@ -42,7 +42,9 @@ LLIconCtrl::Params::Params()
: image("image_name"),
color("color"),
use_draw_context_alpha("use_draw_context_alpha", true),
- scale_image("scale_image")
+ scale_image("scale_image"),
+ min_width("min_width", 0),
+ min_height("min_height", 0)
{}
LLIconCtrl::LLIconCtrl(const LLIconCtrl::Params& p)
@@ -51,8 +53,8 @@ LLIconCtrl::LLIconCtrl(const LLIconCtrl::Params& p)
mImagep(p.image),
mUseDrawContextAlpha(p.use_draw_context_alpha),
mPriority(0),
- mDrawWidth(0),
- mDrawHeight(0)
+ mMinWidth(p.min_width),
+ mMinHeight(p.min_height)
{
if (mImagep.notNull())
{
@@ -97,7 +99,13 @@ void LLIconCtrl::setValue(const LLSD& value )
mImagep = LLUI::getUIImage(tvalue.asString(), mPriority);
}
- setIconImageDrawSize();
+ if(mImagep.notNull()
+ && mImagep->getImage().notNull()
+ && mMinWidth
+ && mMinHeight)
+ {
+ mImagep->getImage()->setKnownDrawSize(llmax(mMinWidth, mImagep->getWidth()), llmax(mMinHeight, mImagep->getHeight()));
+ }
}
std::string LLIconCtrl::getImageName() const
@@ -108,14 +116,4 @@ std::string LLIconCtrl::getImageName() const
return std::string();
}
-void LLIconCtrl::setIconImageDrawSize()
-{
- if(mImagep.notNull() && mDrawWidth && mDrawHeight)
- {
- if(mImagep->getImage().notNull())
- {
- mImagep->getImage()->setKnownDrawSize(mDrawWidth, mDrawHeight) ;
- }
- }
-}
diff --git a/indra/llui/lliconctrl.h b/indra/llui/lliconctrl.h
index efa0925a4a..8b1092df46 100755
--- a/indra/llui/lliconctrl.h
+++ b/indra/llui/lliconctrl.h
@@ -31,7 +31,6 @@
#include "v4color.h"
#include "lluictrl.h"
#include "lluiimage.h"
-#include "stdenums.h"
class LLTextBox;
class LLUICtrlFactory;
@@ -50,7 +49,10 @@ public:
Optional<LLUIImage*> image;
Optional<LLUIColor> color;
Optional<bool> use_draw_context_alpha;
+ Optional<S32> min_width,
+ min_height;
Ignored scale_image;
+
Params();
};
protected:
@@ -72,15 +74,12 @@ public:
void setImage(LLPointer<LLUIImage> image) { mImagep = image; }
const LLPointer<LLUIImage> getImage() { return mImagep; }
-private:
- void setIconImageDrawSize() ;
-
protected:
S32 mPriority;
//the output size of the icon image if set.
- S32 mDrawWidth ;
- S32 mDrawHeight ;
+ S32 mMinWidth,
+ mMinHeight;
// If set to true (default), use the draw context transparency.
// If false, will use transparency returned by getCurrentTransparency(). See STORM-698.
diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp
index 39153977bf..75773d7dfd 100755
--- a/indra/llui/llkeywords.cpp
+++ b/indra/llui/llkeywords.cpp
@@ -1,25 +1,25 @@
-/**
+/**
* @file llkeywords.cpp
* @brief Keyword list for LSL
*
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -30,49 +30,48 @@
#include <fstream>
#include "llkeywords.h"
+#include "llsdserialize.h"
#include "lltexteditor.h"
#include "llstl.h"
-#include <boost/tokenizer.hpp>
-
-const U32 KEYWORD_FILE_CURRENT_VERSION = 2;
-inline BOOL LLKeywordToken::isHead(const llwchar* s) const
+inline bool LLKeywordToken::isHead(const llwchar* s) const
{
// strncmp is much faster than string compare
- BOOL res = TRUE;
+ bool res = true;
const llwchar* t = mToken.c_str();
S32 len = mToken.size();
for (S32 i=0; i<len; i++)
{
if (s[i] != t[i])
{
- res = FALSE;
+ res = false;
break;
}
}
return res;
}
-LLKeywords::LLKeywords() : mLoaded(FALSE)
-{
-}
-
-inline BOOL LLKeywordToken::isTail(const llwchar* s) const
+inline bool LLKeywordToken::isTail(const llwchar* s) const
{
- BOOL res = TRUE;
+ bool res = true;
const llwchar* t = mDelimiter.c_str();
S32 len = mDelimiter.size();
for (S32 i=0; i<len; i++)
{
if (s[i] != t[i])
{
- res = FALSE;
+ res = false;
break;
}
}
return res;
}
+LLKeywords::LLKeywords()
+: mLoaded(false)
+{
+}
+
LLKeywords::~LLKeywords()
{
std::for_each(mWordTokenMap.begin(), mWordTokenMap.end(), DeletePairedPointer());
@@ -83,180 +82,307 @@ LLKeywords::~LLKeywords()
mDelimiterTokenList.clear();
}
-BOOL LLKeywords::loadFromFile( const std::string& filename )
+// Add the token as described
+void LLKeywords::addToken(LLKeywordToken::ETokenType type,
+ const std::string& key_in,
+ const LLColor4& color,
+ const std::string& tool_tip_in,
+ const std::string& delimiter_in)
{
- mLoaded = FALSE;
-
- ////////////////////////////////////////////////////////////
- // File header
-
- const S32 BUFFER_SIZE = 1024;
- char buffer[BUFFER_SIZE]; /* Flawfinder: ignore */
-
- llifstream file;
- file.open(filename); /* Flawfinder: ignore */
- if( file.fail() )
+ std::string tip_text = tool_tip_in;
+ LLStringUtil::replaceString(tip_text, "\\n", "\n" );
+ LLStringUtil::replaceString(tip_text, "\t", " " );
+ if (tip_text.empty())
{
- llinfos << "LLKeywords::loadFromFile() Unable to open file: " << filename << llendl;
- return mLoaded;
+ tip_text = "[no info]";
}
+ LLWString tool_tip = utf8str_to_wstring(tip_text);
- // Identifying string
- file >> buffer;
- if( strcmp( buffer, "llkeywords" ) )
- {
- llinfos << filename << " does not appear to be a keyword file" << llendl;
- return mLoaded;
- }
-
- // Check file version
- file >> buffer;
- U32 version_num;
- file >> version_num;
- if( strcmp(buffer, "version") || version_num != (U32)KEYWORD_FILE_CURRENT_VERSION )
+ LLWString key = utf8str_to_wstring(key_in);
+ LLWString delimiter = utf8str_to_wstring(delimiter_in);
+ switch(type)
{
- llinfos << filename << " does not appear to be a version " << KEYWORD_FILE_CURRENT_VERSION << " keyword file" << llendl;
- return mLoaded;
- }
+ case LLKeywordToken::TT_CONSTANT:
+ case LLKeywordToken::TT_CONTROL:
+ case LLKeywordToken::TT_EVENT:
+ case LLKeywordToken::TT_FUNCTION:
+ case LLKeywordToken::TT_LABEL:
+ case LLKeywordToken::TT_SECTION:
+ case LLKeywordToken::TT_TYPE:
+ case LLKeywordToken::TT_WORD:
+ mWordTokenMap[key] = new LLKeywordToken(type, color, key, tool_tip, LLWStringUtil::null);
+ break;
- // start of line (SOL)
- std::string SOL_COMMENT("#");
- std::string SOL_WORD("[word ");
- std::string SOL_LINE("[line ");
- std::string SOL_ONE_SIDED_DELIMITER("[one_sided_delimiter ");
- std::string SOL_TWO_SIDED_DELIMITER("[two_sided_delimiter ");
- std::string SOL_DOUBLE_QUOTATION_MARKS("[double_quotation_marks ");
+ case LLKeywordToken::TT_LINE:
+ mLineTokenList.push_front(new LLKeywordToken(type, color, key, tool_tip, LLWStringUtil::null));
+ break;
- LLColor3 cur_color( 1, 0, 0 );
- LLKeywordToken::TOKEN_TYPE cur_type = LLKeywordToken::WORD;
+ case LLKeywordToken::TT_TWO_SIDED_DELIMITER:
+ case LLKeywordToken::TT_DOUBLE_QUOTATION_MARKS:
+ case LLKeywordToken::TT_ONE_SIDED_DELIMITER:
+ mDelimiterTokenList.push_front(new LLKeywordToken(type, color, key, tool_tip, delimiter));
+ break;
- while (!file.eof())
- {
- buffer[0] = 0;
- file.getline( buffer, BUFFER_SIZE );
- std::string line(buffer);
- if( line.find(SOL_COMMENT) == 0 )
- {
- continue;
- }
- else if( line.find(SOL_WORD) == 0 )
- {
- cur_color = readColor( line.substr(SOL_WORD.size()) );
- cur_type = LLKeywordToken::WORD;
- continue;
- }
- else if( line.find(SOL_LINE) == 0 )
- {
- cur_color = readColor( line.substr(SOL_LINE.size()) );
- cur_type = LLKeywordToken::LINE;
- continue;
- }
- else if( line.find(SOL_TWO_SIDED_DELIMITER) == 0 )
- {
- cur_color = readColor( line.substr(SOL_TWO_SIDED_DELIMITER.size()) );
- cur_type = LLKeywordToken::TWO_SIDED_DELIMITER;
- continue;
- }
- else if( line.find(SOL_DOUBLE_QUOTATION_MARKS) == 0 )
- {
- cur_color = readColor( line.substr(SOL_DOUBLE_QUOTATION_MARKS.size()) );
- cur_type = LLKeywordToken::DOUBLE_QUOTATION_MARKS;
- continue;
- }
- else if( line.find(SOL_ONE_SIDED_DELIMITER) == 0 )
- {
- cur_color = readColor( line.substr(SOL_ONE_SIDED_DELIMITER.size()) );
- cur_type = LLKeywordToken::ONE_SIDED_DELIMITER;
- continue;
- }
+ default:
+ llassert(0);
+ }
+}
- std::string token_buffer( line );
- LLStringUtil::trim(token_buffer);
-
- typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
- boost::char_separator<char> sep_word("", " \t");
- tokenizer word_tokens(token_buffer, sep_word);
- tokenizer::iterator token_word_iter = word_tokens.begin();
+std::string LLKeywords::getArguments(LLSD& arguments)
+{
+ std::string argString = "";
- if( !token_buffer.empty() && token_word_iter != word_tokens.end() )
+ if (arguments.isArray())
+ {
+ U32 argsCount = arguments.size();
+ LLSD::array_iterator arrayIt = arguments.beginArray();
+ for ( ; arrayIt != arguments.endArray(); ++arrayIt)
{
- // first word is the keyword or a left delimiter
- std::string keyword = (*token_word_iter);
- LLStringUtil::trim(keyword);
-
- // second word may be a right delimiter
- std::string delimiter;
- if (cur_type == LLKeywordToken::TWO_SIDED_DELIMITER)
+ LLSD& args = (*arrayIt);
+ if (args.isMap())
{
- while (delimiter.length() == 0 && ++token_word_iter != word_tokens.end())
+ LLSD::map_iterator argsIt = args.beginMap();
+ for ( ; argsIt != args.endMap(); ++argsIt)
{
- delimiter = *token_word_iter;
- LLStringUtil::trim(delimiter);
+ argString += argsIt->second.get("type").asString() + " " + argsIt->first;
+ if (argsCount-- > 1)
+ {
+ argString += ", ";
+ }
}
}
- else if (cur_type == LLKeywordToken::DOUBLE_QUOTATION_MARKS)
+ else
{
- // Closing delimiter is identical to the opening one.
- delimiter = keyword;
+ LL_WARNS("SyntaxLSL") << "Argument array comtains a non-map element!" << LL_ENDL;
}
+ }
+ }
+ else if (!arguments.isUndefined())
+ {
+ LL_WARNS("SyntaxLSL") << "Not an array! Invalid arguments LLSD passed to function." << arguments << LL_ENDL;
+ }
+ return argString;
+}
- // following words are tooltip
- std::string tool_tip;
- while (++token_word_iter != word_tokens.end())
- {
- tool_tip += (*token_word_iter);
- }
- LLStringUtil::trim(tool_tip);
-
- if( !tool_tip.empty() )
+std::string LLKeywords::getAttribute(const std::string& key)
+{
+ attribute_iterator_t it = mAttributes.find(key);
+ return (it != mAttributes.end()) ? it->second : "";
+}
+
+LLColor4 LLKeywords::getColorGroup(const std::string& key_in)
+{
+ std::string color_group = "ScriptText";
+ if (key_in == "functions")
+ {
+ color_group = "SyntaxLslFunction";
+ }
+ else if (key_in == "controls")
+ {
+ color_group = "SyntaxLslControlFlow";
+ }
+ else if (key_in == "events")
+ {
+ color_group = "SyntaxLslEvent";
+ }
+ else if (key_in == "types")
+ {
+ color_group = "SyntaxLslDataType";
+ }
+ else if (key_in == "misc-flow-label")
+ {
+ color_group = "SyntaxLslControlFlow";
+ }
+ else if (key_in =="deprecated")
+ {
+ color_group = "SyntaxLslDeprecated";
+ }
+ else if (key_in =="god-mode")
+ {
+ color_group = "SyntaxLslGodMode";
+ }
+ else if (key_in == "constants"
+ || key_in == "constants-integer"
+ || key_in == "constants-float"
+ || key_in == "constants-string"
+ || key_in == "constants-key"
+ || key_in == "constants-rotation"
+ || key_in == "constants-vector")
+ {
+ color_group = "SyntaxLslConstant";
+ }
+ else
+ {
+ LL_WARNS("SyntaxLSL") << "Color key '" << key_in << "' not recognized." << LL_ENDL;
+ }
+
+ return LLUIColorTable::instance().getColor(color_group);
+}
+
+void LLKeywords::initialize(LLSD SyntaxXML)
+{
+ mSyntax = SyntaxXML;
+ mLoaded = true;
+}
+
+void LLKeywords::processTokens()
+{
+ if (!mLoaded)
+ {
+ return;
+ }
+
+ // Add 'standard' stuff: Quotes, Comments, Strings, Labels, etc. before processing the LLSD
+ std::string delimiter;
+ addToken(LLKeywordToken::TT_LABEL, "@", getColorGroup("misc-flow-label"), "Label\nTarget for jump statement", delimiter );
+ addToken(LLKeywordToken::TT_ONE_SIDED_DELIMITER, "//", LLUIColorTable::instance().getColor("SyntaxLslComment"), "Comment (single-line)\nNon-functional commentary or disabled code", delimiter );
+ addToken(LLKeywordToken::TT_TWO_SIDED_DELIMITER, "/*", LLUIColorTable::instance().getColor("SyntaxLslComment"), "Comment (multi-line)\nNon-functional commentary or disabled code", "*/" );
+ addToken(LLKeywordToken::TT_DOUBLE_QUOTATION_MARKS, "\"", LLUIColorTable::instance().getColor("SyntaxLslStringLiteral"), "String literal", "\"" );
+
+ LLSD::map_iterator itr = mSyntax.beginMap();
+ for ( ; itr != mSyntax.endMap(); ++itr)
+ {
+ if (itr->first == "llsd-lsl-syntax-version")
+ {
+ // Skip over version key.
+ }
+ else
+ {
+ if (itr->second.isMap())
{
- // Replace : with \n for multi-line tool tips.
- LLStringUtil::replaceChar( tool_tip, ':', '\n' );
- addToken(cur_type, keyword, cur_color, tool_tip, delimiter );
+ processTokensGroup(itr->second, itr->first);
}
else
{
- addToken(cur_type, keyword, cur_color, LLStringUtil::null, delimiter );
+ LL_WARNS("LSL-Tokens-Processing") << "Map for " + itr->first + " entries is missing! Ignoring." << LL_ENDL;
}
}
}
-
- file.close();
-
- mLoaded = TRUE;
- return mLoaded;
+ LL_INFOS("SyntaxLSL") << "Finished processing tokens." << LL_ENDL;
}
-// Add the token as described
-void LLKeywords::addToken(LLKeywordToken::TOKEN_TYPE type,
- const std::string& key_in,
- const LLColor3& color,
- const std::string& tool_tip_in,
- const std::string& delimiter_in)
+void LLKeywords::processTokensGroup(const LLSD& tokens, const std::string& group)
{
- LLWString key = utf8str_to_wstring(key_in);
- LLWString tool_tip = utf8str_to_wstring(tool_tip_in);
- LLWString delimiter = utf8str_to_wstring(delimiter_in);
- switch(type)
+ LLColor4 color;
+ LLColor4 color_group;
+ LLColor4 color_deprecated = getColorGroup("deprecated");
+ LLColor4 color_god_mode = getColorGroup("god-mode");
+
+ LLKeywordToken::ETokenType token_type = LLKeywordToken::TT_UNKNOWN;
+ // If a new token type is added here, it must also be added to the 'addToken' method
+ if (group == "constants")
{
- case LLKeywordToken::WORD:
- mWordTokenMap[key] = new LLKeywordToken(type, color, key, tool_tip, LLWStringUtil::null);
- break;
+ token_type = LLKeywordToken::TT_CONSTANT;
+ }
+ else if (group == "controls")
+ {
+ token_type = LLKeywordToken::TT_CONTROL;
+ }
+ else if (group == "events")
+ {
+ token_type = LLKeywordToken::TT_EVENT;
+ }
+ else if (group == "functions")
+ {
+ token_type = LLKeywordToken::TT_FUNCTION;
+ }
+ else if (group == "label")
+ {
+ token_type = LLKeywordToken::TT_LABEL;
+ }
+ else if (group == "types")
+ {
+ token_type = LLKeywordToken::TT_TYPE;
+ }
- case LLKeywordToken::LINE:
- mLineTokenList.push_front(new LLKeywordToken(type, color, key, tool_tip, LLWStringUtil::null));
- break;
+ color_group = getColorGroup(group);
+ LL_INFOS("SyntaxLSL") << "Group: '" << group << "', using color: '" << color_group << "'" << LL_ENDL;
- case LLKeywordToken::TWO_SIDED_DELIMITER:
- case LLKeywordToken::DOUBLE_QUOTATION_MARKS:
- case LLKeywordToken::ONE_SIDED_DELIMITER:
- mDelimiterTokenList.push_front(new LLKeywordToken(type, color, key, tool_tip, delimiter));
- break;
+ if (tokens.isMap())
+ {
+ LLSD::map_const_iterator outer_itr = tokens.beginMap();
+ for ( ; outer_itr != tokens.endMap(); ++outer_itr )
+ {
+ if (outer_itr->second.isMap())
+ {
+ mAttributes.clear();
+ LLSD arguments = LLSD();
+ LLSD::map_const_iterator inner_itr = outer_itr->second.beginMap();
+ for ( ; inner_itr != outer_itr->second.endMap(); ++inner_itr )
+ {
+ if (inner_itr->first == "arguments")
+ {
+ if (inner_itr->second.isArray())
+ {
+ arguments = inner_itr->second;
+ }
+ }
+ else if (!inner_itr->second.isMap() && !inner_itr->second.isArray())
+ {
+ mAttributes[inner_itr->first] = inner_itr->second.asString();
+ }
+ else
+ {
+ LL_WARNS("SyntaxLSL") << "Not a valid attribute: " << inner_itr->first << LL_ENDL;
+ }
+ }
- default:
- llassert(0);
+ std::string tooltip = "";
+ switch (token_type)
+ {
+ case LLKeywordToken::TT_CONSTANT:
+ color_group = getColorGroup(group + "-" + getAttribute("type"));
+ tooltip = "Type: " + getAttribute("type") + ", Value: " + getAttribute("value");
+ break;
+ case LLKeywordToken::TT_EVENT:
+ tooltip = outer_itr->first + "(" + getArguments(arguments) + ")";
+ break;
+ case LLKeywordToken::TT_FUNCTION:
+ tooltip = getAttribute("return") + " " + outer_itr->first + "(" + getArguments(arguments) + ");";
+ tooltip.append("\nEnergy: ");
+ tooltip.append(getAttribute("energy").empty() ? "0.0" : getAttribute("energy"));
+ if (!getAttribute("sleep").empty())
+ {
+ tooltip += ", Sleep: " + getAttribute("sleep");
+ }
+ default:
+ break;
+ }
+
+ if (!getAttribute("tooltip").empty())
+ {
+ if (!tooltip.empty())
+ {
+ tooltip.append("\n");
+ }
+ tooltip.append(getAttribute("tooltip"));
+ }
+
+ color = getAttribute("deprecated") == "true" ? color_deprecated : color_group;
+
+ if (getAttribute("god-mode") == "true")
+ {
+ color = color_god_mode;
+ }
+
+ addToken(token_type, outer_itr->first, color, tooltip);
+ }
+ }
+ }
+ else if (tokens.isArray()) // Currently nothing should need this, but it's here for completeness
+ {
+ LL_INFOS("SyntaxLSL") << "Curious, shouldn't be an array here; adding all using color " << color << LL_ENDL;
+ for (S32 count = 0; count < tokens.size(); ++count)
+ {
+ addToken(token_type, tokens[count], color, "");
+ }
+ }
+ else
+ {
+ LL_WARNS("SyntaxLSL") << "Invalid map/array passed: '" << tokens << "'" << LL_ENDL;
}
}
+
LLKeywords::WStringMapIndex::WStringMapIndex(const WStringMapIndex& other)
{
if(other.mOwner)
@@ -276,15 +402,19 @@ LLKeywords::WStringMapIndex::WStringMapIndex(const LLWString& str)
copyData(str.data(), str.size());
}
-LLKeywords::WStringMapIndex::WStringMapIndex(const llwchar *start, size_t length):
-mData(start), mLength(length), mOwner(false)
+LLKeywords::WStringMapIndex::WStringMapIndex(const llwchar *start, size_t length)
+: mData(start)
+, mLength(length)
+, mOwner(false)
{
}
LLKeywords::WStringMapIndex::~WStringMapIndex()
{
- if(mOwner)
+ if (mOwner)
+ {
delete[] mData;
+ }
}
void LLKeywords::WStringMapIndex::copyData(const llwchar *start, size_t length)
@@ -301,13 +431,13 @@ bool LLKeywords::WStringMapIndex::operator<(const LLKeywords::WStringMapIndex &o
{
// NOTE: Since this is only used to organize a std::map, it doesn't matter if it uses correct collate order or not.
// The comparison only needs to strictly order all possible strings, and be stable.
-
+
bool result = false;
const llwchar* self_iter = mData;
const llwchar* self_end = mData + mLength;
const llwchar* other_iter = other.mData;
const llwchar* other_end = other.mData + other.mLength;
-
+
while(true)
{
if(other_iter >= other_end)
@@ -322,7 +452,7 @@ bool LLKeywords::WStringMapIndex::operator<(const LLKeywords::WStringMapIndex &o
{
// self is shorter than other.
result = true;
- break;
+ break;
}
else if(*self_iter != *other_iter)
{
@@ -334,39 +464,27 @@ bool LLKeywords::WStringMapIndex::operator<(const LLKeywords::WStringMapIndex &o
self_iter++;
other_iter++;
}
-
- return result;
-}
-LLColor3 LLKeywords::readColor( const std::string& s )
-{
- F32 r, g, b;
- r = g = b = 0.0f;
- S32 values_read = sscanf(s.c_str(), "%f, %f, %f]", &r, &g, &b );
- if( values_read != 3 )
- {
- llinfos << " poorly formed color in keyword file" << llendl;
- }
- return LLColor3( r, g, b );
+ return result;
}
-LLFastTimer::DeclareTimer FTM_SYNTAX_COLORING("Syntax Coloring");
+LLTrace::BlockTimerStatHandle FTM_SYNTAX_COLORING("Syntax Coloring");
// Walk through a string, applying the rules specified by the keyword token list and
// create a list of color segments.
void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLWString& wtext, const LLColor4 &defaultColor, LLTextEditor& editor)
{
- LLFastTimer ft(FTM_SYNTAX_COLORING);
+ LL_RECORD_BLOCK_TIME(FTM_SYNTAX_COLORING);
seg_list->clear();
if( wtext.empty() )
{
return;
}
-
+
S32 text_len = wtext.size() + 1;
- seg_list->push_back( new LLNormalTextSegment( defaultColor, 0, text_len, editor ) );
+ seg_list->push_back( new LLNormalTextSegment( defaultColor, 0, text_len, editor ) );
const llwchar* base = wtext.c_str();
const llwchar* cur = base;
@@ -396,7 +514,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
continue;
}
- // cur is now at the first non-whitespace character of a new line
+ // cur is now at the first non-whitespace character of a new line
// Line start tokens
{
@@ -414,7 +532,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
cur++;
}
S32 seg_end = cur - base;
-
+
//create segments from seg_start to seg_end
insertSegments(wtext, *seg_list,cur_token, text_len, seg_start, seg_end, defaultColor, editor);
line_done = TRUE; // to break out of second loop.
@@ -459,14 +577,14 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
seg_start = cur - base;
cur += cur_delimiter->getLengthHead();
-
- LLKeywordToken::TOKEN_TYPE type = cur_delimiter->getType();
- if( type == LLKeywordToken::TWO_SIDED_DELIMITER || type == LLKeywordToken::DOUBLE_QUOTATION_MARKS )
+
+ LLKeywordToken::ETokenType type = cur_delimiter->getType();
+ if( type == LLKeywordToken::TT_TWO_SIDED_DELIMITER || type == LLKeywordToken::TT_DOUBLE_QUOTATION_MARKS )
{
while( *cur && !cur_delimiter->isTail(cur))
{
// Check for an escape sequence.
- if (type == LLKeywordToken::DOUBLE_QUOTATION_MARKS && *cur == '\\')
+ if (type == LLKeywordToken::TT_DOUBLE_QUOTATION_MARKS && *cur == '\\')
{
// Count the number of backslashes.
S32 num_backslashes = 0;
@@ -513,7 +631,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
}
else
{
- llassert( cur_delimiter->getType() == LLKeywordToken::ONE_SIDED_DELIMITER );
+ llassert( cur_delimiter->getType() == LLKeywordToken::TT_ONE_SIDED_DELIMITER );
// Left side is the delimiter. Right side is eol or eof.
while( *cur && ('\n' != *cur) )
{
@@ -559,7 +677,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
insertSegments(wtext, *seg_list,cur_token, text_len, seg_start, seg_end, defaultColor, editor);
}
- cur += seg_len;
+ cur += seg_len;
continue;
}
}
@@ -575,7 +693,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
void LLKeywords::insertSegments(const LLWString& wtext, std::vector<LLTextSegmentPtr>& seg_list, LLKeywordToken* cur_token, S32 text_len, S32 seg_start, S32 seg_end, const LLColor4 &defaultColor, LLTextEditor& editor )
{
std::string::size_type pos = wtext.find('\n',seg_start);
-
+
while (pos!=-1 && pos < (std::string::size_type)seg_end)
{
if (pos!=seg_start)
@@ -654,7 +772,7 @@ void LLKeywords::dump()
void LLKeywordToken::dump()
{
- llinfos << "[" <<
+ llinfos << "[" <<
mColor.mV[VX] << ", " <<
mColor.mV[VY] << ", " <<
mColor.mV[VZ] << "] [" <<
diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h
index ac34015393..18e2ed06c5 100755
--- a/indra/llui/llkeywords.h
+++ b/indra/llui/llkeywords.h
@@ -1,25 +1,25 @@
-/**
+/**
* @file llkeywords.h
* @brief Keyword list for LSL
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -28,8 +28,10 @@
#define LL_LLKEYWORDS_H
+#include "lldir.h"
#include "llstring.h"
#include "v3color.h"
+#include "v4color.h"
#include <map>
#include <list>
#include <deque>
@@ -41,26 +43,35 @@ typedef LLPointer<LLTextSegment> LLTextSegmentPtr;
class LLKeywordToken
{
public:
- /**
+ /**
* @brief Types of tokens/delimters being parsed.
*
* @desc Tokens/delimiters that need to be identified/highlighted. All are terminated if an EOF is encountered.
- * - WORD are keywords in the normal sense, i.e. constants, events, etc.
- * - LINE are for entire lines (currently only flow control labels use this).
- * - ONE_SIDED_DELIMITER are for open-ended delimiters which are terminated by EOL.
- * - TWO_SIDED_DELIMITER are for delimiters that end with a different delimiter than they open with.
- * - DOUBLE_QUOTATION_MARKS are for delimiting areas using the same delimiter to open and close.
+ * - TT_WORD are keywords in the normal sense, i.e. constants, events, etc.
+ * - TT_LINE are for entire lines (currently only flow control labels use this).
+ * - TT_ONE_SIDED_DELIMITER are for open-ended delimiters which are terminated by EOL.
+ * - TT_TWO_SIDED_DELIMITER are for delimiters that end with a different delimiter than they open with.
+ * - TT_DOUBLE_QUOTATION_MARKS are for delimiting areas using the same delimiter to open and close.
*/
- enum TOKEN_TYPE
+ typedef enum e_token_type
{
- WORD,
- LINE,
- TWO_SIDED_DELIMITER,
- ONE_SIDED_DELIMITER,
- DOUBLE_QUOTATION_MARKS
- };
-
- LLKeywordToken( TOKEN_TYPE type, const LLColor3& color, const LLWString& token, const LLWString& tool_tip, const LLWString& delimiter )
+ TT_UNKNOWN,
+ TT_WORD,
+ TT_LINE,
+ TT_TWO_SIDED_DELIMITER,
+ TT_ONE_SIDED_DELIMITER,
+ TT_DOUBLE_QUOTATION_MARKS,
+ // Following constants are more specific versions of the preceding ones
+ TT_CONSTANT, // WORD
+ TT_CONTROL, // WORD
+ TT_EVENT, // WORD
+ TT_FUNCTION, // WORD
+ TT_LABEL, // LINE
+ TT_SECTION, // WORD
+ TT_TYPE // WORD
+ } ETokenType;
+
+ LLKeywordToken( ETokenType type, const LLColor4& color, const LLWString& token, const LLWString& tool_tip, const LLWString& delimiter )
:
mType( type ),
mToken( token ),
@@ -72,11 +83,11 @@ public:
S32 getLengthHead() const { return mToken.size(); }
S32 getLengthTail() const { return mDelimiter.size(); }
- BOOL isHead(const llwchar* s) const;
- BOOL isTail(const llwchar* s) const;
+ bool isHead(const llwchar* s) const;
+ bool isTail(const llwchar* s) const;
const LLWString& getToken() const { return mToken; }
- const LLColor3& getColor() const { return mColor; }
- TOKEN_TYPE getType() const { return mType; }
+ const LLColor4& getColor() const { return mColor; }
+ ETokenType getType() const { return mType; }
const LLWString& getToolTip() const { return mToolTip; }
const LLWString& getDelimiter() const { return mDelimiter; }
@@ -85,9 +96,9 @@ public:
#endif
private:
- TOKEN_TYPE mType;
+ ETokenType mType;
LLWString mToken;
- LLColor3 mColor;
+ LLColor4 mColor;
LLWString mToolTip;
LLWString mDelimiter;
};
@@ -98,18 +109,24 @@ public:
LLKeywords();
~LLKeywords();
- BOOL loadFromFile(const std::string& filename);
- BOOL isLoaded() const { return mLoaded; }
+ void clearLoaded() { mLoaded = false; }
+ LLColor4 getColorGroup(const std::string& key_in);
+ bool isLoaded() const { return mLoaded; }
- void findSegments(std::vector<LLTextSegmentPtr> *seg_list, const LLWString& text, const LLColor4 &defaultColor, class LLTextEditor& editor );
+ void findSegments(std::vector<LLTextSegmentPtr> *seg_list,
+ const LLWString& text,
+ const LLColor4 &defaultColor,
+ class LLTextEditor& editor);
+ void initialize(LLSD SyntaxXML);
+ void processTokens();
// Add the token as described
- void addToken(LLKeywordToken::TOKEN_TYPE type,
+ void addToken(LLKeywordToken::ETokenType type,
const std::string& key,
- const LLColor3& color,
+ const LLColor4& color,
const std::string& tool_tip = LLStringUtil::null,
const std::string& delimiter = LLStringUtil::null);
-
+
// This class is here as a performance optimization.
// The word token map used to be defined as std::map<LLWString, LLKeywordToken*>.
// This worked, but caused a performance bottleneck due to memory allocation and string copies
@@ -133,6 +150,9 @@ public:
const llwchar *mData;
size_t mLength;
bool mOwner;
+
+
+ LLColor4 mColor;
};
typedef std::map<WStringMapIndex, LLKeywordToken*> word_token_map_t;
@@ -140,20 +160,43 @@ public:
keyword_iterator_t begin() const { return mWordTokenMap.begin(); }
keyword_iterator_t end() const { return mWordTokenMap.end(); }
+ typedef std::map<WStringMapIndex, LLColor4> group_color_map_t;
+ typedef group_color_map_t::const_iterator color_iterator_t;
+ group_color_map_t mColorGroupMap;
+
#ifdef _DEBUG
void dump();
#endif
-private:
- LLColor3 readColor(const std::string& s);
- void insertSegment(std::vector<LLTextSegmentPtr>& seg_list, LLTextSegmentPtr new_segment, S32 text_len, const LLColor4 &defaultColor, class LLTextEditor& editor);
- void insertSegments(const LLWString& wtext, std::vector<LLTextSegmentPtr>& seg_list, LLKeywordToken* token, S32 text_len, S32 seg_start, S32 seg_end, const LLColor4 &defaultColor, LLTextEditor& editor);
-
- BOOL mLoaded;
+protected:
+ void processTokensGroup(const LLSD& Tokens, const std::string& Group);
+ void insertSegment(std::vector<LLTextSegmentPtr>& seg_list,
+ LLTextSegmentPtr new_segment,
+ S32 text_len,
+ const LLColor4 &defaultColor,
+ class LLTextEditor& editor);
+ void insertSegments(const LLWString& wtext,
+ std::vector<LLTextSegmentPtr>& seg_list,
+ LLKeywordToken* token,
+ S32 text_len,
+ S32 seg_start,
+ S32 seg_end,
+ const LLColor4 &defaultColor,
+ LLTextEditor& editor);
+
+ bool mLoaded;
+ LLSD mSyntax;
word_token_map_t mWordTokenMap;
typedef std::deque<LLKeywordToken*> token_list_t;
token_list_t mLineTokenList;
token_list_t mDelimiterTokenList;
+
+ typedef std::map<std::string, std::string> element_attributes_t;
+ typedef element_attributes_t::const_iterator attribute_iterator_t;
+ element_attributes_t mAttributes;
+ std::string getAttribute(const std::string& key);
+
+ std::string getArguments(LLSD& arguments);
};
#endif // LL_LLKEYWORDS_H
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index c89c0203b4..c59286fc60 100755
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -33,6 +33,7 @@
#include "lllocalcliprect.h"
#include "llpanel.h"
#include "llcriticaldamp.h"
+#include "lliconctrl.h"
#include "boost/foreach.hpp"
static const F32 MIN_FRACTIONAL_SIZE = 0.00001f;
@@ -41,12 +42,6 @@ static const F32 MAX_FRACTIONAL_SIZE = 1.f;
static LLDefaultChildRegistry::Register<LLLayoutStack> register_layout_stack("layout_stack");
static LLLayoutStack::LayoutStackRegistry::Register<LLLayoutPanel> register_layout_panel("layout_panel");
-void LLLayoutStack::OrientationNames::declareValues()
-{
- declare("horizontal", HORIZONTAL);
- declare("vertical", VERTICAL);
-}
-
//
// LLLayoutPanel
//
@@ -140,7 +135,7 @@ S32 LLLayoutPanel::getVisibleDim() const
+ (((F32)mTargetDim - min_dim) * (1.f - mCollapseAmt))));
}
-void LLLayoutPanel::setOrientation( LLLayoutStack::ELayoutOrientation orientation )
+void LLLayoutPanel::setOrientation( LLView::EOrientation orientation )
{
mOrientation = orientation;
S32 layout_dim = llround((F32)((mOrientation == LLLayoutStack::HORIZONTAL)
@@ -274,25 +269,9 @@ void LLLayoutStack::draw()
// only force drawing invisible children if visible amount is non-zero
drawChild(panelp, 0, 0, !clip_rect.isEmpty());
}
- }
-
- const LLView::child_list_t * child_listp = getChildList();
- BOOST_FOREACH(LLView * childp, * child_listp)
- {
- LLResizeBar * resize_barp = dynamic_cast<LLResizeBar*>(childp);
- if (resize_barp && resize_barp->isShowDragHandle() && resize_barp->getVisible() && resize_barp->getRect().isValid())
+ if (panelp->getResizeBar()->getVisible())
{
- LLRect screen_rect = resize_barp->calcScreenRect();
- if (LLUI::getRootView()->getLocalRect().overlaps(screen_rect) && LLUI::sDirtyRect.overlaps(screen_rect))
- {
- LLUI::pushMatrix();
- {
- const LLRect& rb_rect(resize_barp->getRect());
- LLUI::translate(rb_rect.mLeft, rb_rect.mBottom);
- resize_barp->draw();
- }
- LLUI::popMatrix();
- }
+ drawChild(panelp->getResizeBar());
}
}
}
@@ -355,11 +334,36 @@ void LLLayoutStack::collapsePanel(LLPanel* panel, BOOL collapsed)
mNeedsLayout = true;
}
-static LLFastTimer::DeclareTimer FTM_UPDATE_LAYOUT("Update LayoutStacks");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_LAYOUT("Update LayoutStacks");
+
+class LLImagePanel : public LLPanel
+{
+public:
+ struct Params : public LLInitParam::Block<Params, LLPanel::Params>
+ {
+ Optional<bool> horizontal;
+ Params() : horizontal("horizontal", false) {}
+ };
+ LLImagePanel(const Params& p) : LLPanel(p), mHorizontal(p.horizontal) {}
+ virtual ~LLImagePanel() {}
+
+ void draw()
+ {
+ const LLRect& parent_rect = getParent()->getRect();
+ const LLRect& rect = getRect();
+ LLRect clip_rect( -rect.mLeft, parent_rect.getHeight() - rect.mBottom - 2
+ , parent_rect.getWidth() - rect.mLeft - (mHorizontal ? 2 : 0), -rect.mBottom);
+ LLLocalClipRect clip(clip_rect);
+ LLPanel::draw();
+ }
+
+private:
+ bool mHorizontal;
+};
void LLLayoutStack::updateLayout()
{
- LLFastTimer ft(FTM_UPDATE_LAYOUT);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_LAYOUT);
if (!mNeedsLayout) return;
@@ -441,8 +445,6 @@ void LLLayoutStack::updateLayout()
}
LLRect resize_bar_rect(panel_rect);
- LLResizeBar * resize_barp = panelp->getResizeBar();
- bool show_drag_handle = resize_barp->isShowDragHandle();
F32 panel_spacing = (F32)mPanelSpacing * panelp->getVisibleAmount();
F32 panel_visible_dim = panelp->getVisibleDim();
S32 panel_spacing_round = (S32)(llround(panel_spacing));
@@ -451,7 +453,7 @@ void LLLayoutStack::updateLayout()
{
cur_pos += panel_visible_dim + panel_spacing;
- if (show_drag_handle && panel_spacing_round > mDragHandleThickness)
+ if (mShowDragHandle && panel_spacing_round > mDragHandleThickness)
{
resize_bar_rect.mLeft = panel_rect.mRight + mDragHandleShift;
resize_bar_rect.mRight = resize_bar_rect.mLeft + mDragHandleThickness;
@@ -462,7 +464,7 @@ void LLLayoutStack::updateLayout()
resize_bar_rect.mRight = panel_rect.mRight + panel_spacing_round + mResizeBarOverlap;
}
- if (show_drag_handle)
+ if (mShowDragHandle)
{
resize_bar_rect.mBottom += mDragHandleSecondIndent;
resize_bar_rect.mTop -= mDragHandleFirstIndent;
@@ -473,7 +475,7 @@ void LLLayoutStack::updateLayout()
{
cur_pos -= panel_visible_dim + panel_spacing;
- if (show_drag_handle && panel_spacing_round > mDragHandleThickness)
+ if (mShowDragHandle && panel_spacing_round > mDragHandleThickness)
{
resize_bar_rect.mTop = panel_rect.mBottom - mDragHandleShift;
resize_bar_rect.mBottom = resize_bar_rect.mTop - mDragHandleThickness;
@@ -484,7 +486,7 @@ void LLLayoutStack::updateLayout()
resize_bar_rect.mBottom = panel_rect.mBottom - panel_spacing_round - mResizeBarOverlap;
}
- if (show_drag_handle)
+ if (mShowDragHandle)
{
resize_bar_rect.mLeft += mDragHandleFirstIndent;
resize_bar_rect.mRight -= mDragHandleSecondIndent;
@@ -547,9 +549,69 @@ void LLLayoutStack::createResizeBar(LLLayoutPanel* panelp)
resize_params.min_size(lp->getRelevantMinDim());
resize_params.side((mOrientation == HORIZONTAL) ? LLResizeBar::RIGHT : LLResizeBar::BOTTOM);
resize_params.snapping_enabled(false);
- resize_params.show_drag_handle(mShowDragHandle);
LLResizeBar* resize_bar = LLUICtrlFactory::create<LLResizeBar>(resize_params);
lp->mResizeBar = resize_bar;
+
+ if (mShowDragHandle)
+ {
+ LLPanel::Params resize_bar_bg_panel_p;
+ resize_bar_bg_panel_p.name = "resize_handle_bg_panel";
+ resize_bar_bg_panel_p.rect = lp->mResizeBar->getLocalRect();
+ resize_bar_bg_panel_p.follows.flags = FOLLOWS_ALL;
+ resize_bar_bg_panel_p.tab_stop = false;
+ resize_bar_bg_panel_p.background_visible = true;
+ resize_bar_bg_panel_p.bg_alpha_color = LLUIColorTable::instance().getColor("ResizebarBody");
+ resize_bar_bg_panel_p.has_border = true;
+ resize_bar_bg_panel_p.border.border_thickness = 1;
+ resize_bar_bg_panel_p.border.highlight_light_color = LLUIColorTable::instance().getColor("ResizebarBorderLight");
+ resize_bar_bg_panel_p.border.shadow_dark_color = LLUIColorTable::instance().getColor("ResizebarBorderDark");
+
+ LLPanel* resize_bar_bg_panel = LLUICtrlFactory::create<LLPanel>(resize_bar_bg_panel_p);
+
+ LLIconCtrl::Params icon_p;
+ icon_p.name = "resize_handle_image";
+ icon_p.rect = lp->mResizeBar->getLocalRect();
+ icon_p.follows.flags = FOLLOWS_ALL;
+ icon_p.image = LLUI::getUIImage(mOrientation == HORIZONTAL ? "Vertical Drag Handle" : "Horizontal Drag Handle");
+ resize_bar_bg_panel->addChild(LLUICtrlFactory::create<LLIconCtrl>(icon_p));
+
+ lp->mResizeBar->addChild(resize_bar_bg_panel);
+ }
+
+ /*if (mShowDragHandle)
+ {
+ LLViewBorder::Params border_params;
+ border_params.border_thickness = 1;
+ border_params.highlight_light_color = LLUIColorTable::instance().getColor("ResizebarBorderLight");
+ border_params.shadow_dark_color = LLUIColorTable::instance().getColor("ResizebarBorderDark");
+
+ addBorder(border_params);
+ setBorderVisible(TRUE);
+
+ LLImagePanel::Params image_panel;
+ mDragHandleImage = LLUI::getUIImage(LLResizeBar::RIGHT == mSide ? "Vertical Drag Handle" : "Horizontal Drag Handle");
+ image_panel.bg_alpha_image = mDragHandleImage;
+ image_panel.background_visible = true;
+ image_panel.horizontal = (LLResizeBar::BOTTOM == mSide);
+ mImagePanel = LLUICtrlFactory::create<LLImagePanel>(image_panel);
+ setImagePanel(mImagePanel);
+ }*/
+
+ //if (mShowDragHandle)
+ //{
+ // setBackgroundVisible(TRUE);
+ // setTransparentColor(LLUIColorTable::instance().getColor("ResizebarBody"));
+ //}
+
+ /*if (mShowDragHandle)
+ {
+ S32 image_width = mDragHandleImage->getTextureWidth();
+ S32 image_height = mDragHandleImage->getTextureHeight();
+ const LLRect& panel_rect = getRect();
+ S32 image_left = (panel_rect.getWidth() - image_width) / 2 - 1;
+ S32 image_bottom = (panel_rect.getHeight() - image_height) / 2;
+ mImagePanel->setRect(LLRect(image_left, image_bottom + image_height, image_left + image_width, image_bottom));
+ }*/
LLView::addChild(resize_bar, 0);
}
}
@@ -655,7 +717,7 @@ bool LLLayoutStack::animatePanels()
{
if (!mAnimatedThisFrame)
{
- panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(mOpenTimeConstant));
+ panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 1.f, LLSmoothInterpolation::getInterpolant(mOpenTimeConstant));
if (panelp->mVisibleAmt > 0.99f)
{
panelp->mVisibleAmt = 1.f;
@@ -680,7 +742,7 @@ bool LLLayoutStack::animatePanels()
{
if (!mAnimatedThisFrame)
{
- panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant));
+ panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 0.f, LLSmoothInterpolation::getInterpolant(mCloseTimeConstant));
if (panelp->mVisibleAmt < 0.001f)
{
panelp->mVisibleAmt = 0.f;
@@ -707,7 +769,7 @@ bool LLLayoutStack::animatePanels()
{
if (!mAnimatedThisFrame)
{
- panelp->mCollapseAmt = lerp(panelp->mCollapseAmt, collapse_state, LLCriticalDamp::getInterpolant(mCloseTimeConstant));
+ panelp->mCollapseAmt = lerp(panelp->mCollapseAmt, collapse_state, LLSmoothInterpolation::getInterpolant(mCloseTimeConstant));
}
if (llabs(panelp->mCollapseAmt - collapse_state) < 0.001f)
diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index add43fa741..a245ebe1b9 100755
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -39,24 +39,12 @@ class LLLayoutStack : public LLView, public LLInstanceTracker<LLLayoutStack>
{
public:
- typedef enum e_layout_orientation
- {
- HORIZONTAL,
- VERTICAL
- } ELayoutOrientation;
-
- struct OrientationNames
- : public LLInitParam::TypeValuesHelper<ELayoutOrientation, OrientationNames>
- {
- static void declareValues();
- };
-
struct LayoutStackRegistry : public LLChildRegistry<LayoutStackRegistry>
{};
struct Params : public LLInitParam::Block<Params, LLView::Params>
{
- Mandatory<ELayoutOrientation, OrientationNames> orientation;
+ Mandatory<EOrientation> orientation;
Optional<S32> border_size;
Optional<bool> animate,
clip;
@@ -79,7 +67,7 @@ public:
/*virtual*/ void draw();
/*virtual*/ void removeChild(LLView*);
/*virtual*/ BOOL postBuild();
- /*virtual*/ bool addChild(LLView* child, S32 tab_groupdatefractuiona = 0);
+ /*virtual*/ bool addChild(LLView* child, S32 tab_group = 0);
/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
@@ -111,7 +99,7 @@ private:
bool animatePanels();
void createResizeBar(LLLayoutPanel* panel);
- const ELayoutOrientation mOrientation;
+ const EOrientation mOrientation;
typedef std::vector<LLLayoutPanel*> e_panel_list_t;
e_panel_list_t mPanels;
@@ -194,7 +182,7 @@ public:
bool isCollapsed() const { return mCollapsed;}
- void setOrientation(LLLayoutStack::ELayoutOrientation orientation);
+ void setOrientation(LLView::EOrientation orientation);
void storeOriginalDim();
void setIgnoreReshape(bool ignore) { mIgnoreReshape = ignore; }
@@ -213,7 +201,7 @@ protected:
F32 mFractionalSize;
S32 mTargetDim;
bool mIgnoreReshape;
- LLLayoutStack::ELayoutOrientation mOrientation;
+ LLView::EOrientation mOrientation;
class LLResizeBar* mResizeBar;
};
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index 5478e85e13..45f4272aa7 100755
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -192,6 +192,7 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p)
setPrevalidateInput(p.prevalidate_input_callback());
setPrevalidate(p.prevalidate_callback());
+ llassert(LLMenuGL::sMenuContainer != NULL);
LLContextMenu* menu = LLUICtrlFactory::instance().createFromFile<LLContextMenu>
("menu_text_editor.xml",
LLMenuGL::sMenuContainer,
@@ -253,6 +254,7 @@ void LLLineEditor::onCommit()
setControlValue(getValue());
LLUICtrl::onCommit();
+ resetDirty();
// Selection on commit needs to be turned off when evaluating maths
// expressions, to allow indication of the error position
@@ -785,7 +787,7 @@ BOOL LLLineEditor::handleMouseDown(S32 x, S32 y, MASK mask)
BOOL LLLineEditor::handleMiddleMouseDown(S32 x, S32 y, MASK mask)
{
- // llinfos << "MiddleMouseDown" << llendl;
+ // LL_INFOS() << "MiddleMouseDown" << LL_ENDL;
setFocus( TRUE );
if( canPastePrimary() )
{
@@ -855,14 +857,14 @@ BOOL LLLineEditor::handleHover(S32 x, S32 y, MASK mask)
mKeystrokeTimer.reset();
getWindow()->setCursor(UI_CURSOR_IBEAM);
- lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << LL_ENDL;
handled = TRUE;
}
if( !handled )
{
getWindow()->setCursor(UI_CURSOR_IBEAM);
- lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << LL_ENDL;
handled = TRUE;
}
@@ -1347,7 +1349,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask)
case KEY_BACKSPACE:
if (!mReadOnly)
{
- //llinfos << "Handling backspace" << llendl;
+ //LL_INFOS() << "Handling backspace" << LL_ENDL;
if( hasSelection() )
{
deleteSelection();
@@ -2379,7 +2381,7 @@ void LLLineEditor::resetPreedit()
{
if (hasPreeditString())
{
- llwarns << "Preedit and selection!" << llendl;
+ LL_WARNS() << "Preedit and selection!" << LL_ENDL;
deselect();
}
else
@@ -2543,7 +2545,7 @@ void LLLineEditor::markAsPreedit(S32 position, S32 length)
setCursor(position);
if (hasPreeditString())
{
- llwarns << "markAsPreedit invoked when hasPreeditString is true." << llendl;
+ LL_WARNS() << "markAsPreedit invoked when hasPreeditString is true." << LL_ENDL;
}
mPreeditWString.assign( LLWString( mText.getWString(), position, length ) );
if (length > 0)
diff --git a/indra/llui/llmenubutton.cpp b/indra/llui/llmenubutton.cpp
index 746ade4648..303afcda15 100755
--- a/indra/llui/llmenubutton.cpp
+++ b/indra/llui/llmenubutton.cpp
@@ -93,10 +93,11 @@ void LLMenuButton::setMenu(const std::string& menu_filename, EMenuPosition posit
return;
}
+ llassert(LLMenuGL::sMenuContainer != NULL);
LLToggleableMenu* menu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>(menu_filename, LLMenuGL::sMenuContainer, LLMenuHolderGL::child_registry_t::instance());
if (!menu)
{
- llwarns << "Error loading menu_button menu" << llendl;
+ LL_WARNS() << "Error loading menu_button menu" << LL_ENDL;
return;
}
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 6a57158eaa..604dc92789 100755
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -63,6 +63,7 @@
// static
LLMenuHolderGL *LLMenuGL::sMenuContainer = NULL;
+view_listener_t::listener_map_t view_listener_t::sListeners;
S32 MENU_BAR_HEIGHT = 0;
S32 MENU_BAR_WIDTH = 0;
@@ -280,7 +281,7 @@ BOOL LLMenuItemGL::addToAcceleratorList(std::list <LLKeyBinding*> *listp)
// warning.append("\n ");
// warning.append(mLabel);
- // llwarns << warning << llendl;
+ // LL_WARNS() << warning << LL_ENDL;
// LLAlertDialog::modalAlert(warning);
return FALSE;
}
@@ -549,13 +550,13 @@ BOOL LLMenuItemGL::setLabelArg( const std::string& key, const LLStringExplicit&
return TRUE;
}
-void LLMenuItemGL::handleVisibilityChange(BOOL new_visibility)
+void LLMenuItemGL::onVisibilityChange(BOOL new_visibility)
{
if (getMenu())
{
getMenu()->needsArrange();
}
- LLView::handleVisibilityChange(new_visibility);
+ LLView::onVisibilityChange(new_visibility);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1154,13 +1155,13 @@ void LLMenuItemBranchGL::updateBranchParent(LLView* parentp)
}
}
-void LLMenuItemBranchGL::handleVisibilityChange( BOOL new_visibility )
+void LLMenuItemBranchGL::onVisibilityChange( BOOL new_visibility )
{
if (new_visibility == FALSE && getBranch() && !getBranch()->getTornOff())
{
getBranch()->setVisible(FALSE);
}
- LLMenuItemGL::handleVisibilityChange(new_visibility);
+ LLMenuItemGL::onVisibilityChange(new_visibility);
}
BOOL LLMenuItemBranchGL::handleKeyHere( KEY key, MASK mask )
@@ -1822,7 +1823,7 @@ bool LLMenuGL::addContextChild(LLView* view, S32 tab_group)
{
return appendMenu(menup);
}
-
+
return false;
}
@@ -2003,7 +2004,7 @@ bool LLMenuGL::scrollItems(EScrollingDirection direction)
break;
}
default:
- llwarns << "Unknown scrolling direction: " << direction << llendl;
+ LL_WARNS() << "Unknown scrolling direction: " << direction << LL_ENDL;
}
mNeedsArrange = TRUE;
@@ -2603,8 +2604,8 @@ BOOL LLMenuGL::appendMenu( LLMenuGL* menu )
{
if( menu == this )
{
- llerrs << "** Attempt to attach menu to itself. This is certainly "
- << "a logic error." << llendl;
+ LL_ERRS() << "** Attempt to attach menu to itself. This is certainly "
+ << "a logic error." << LL_ENDL;
}
BOOL success = TRUE;
@@ -2632,7 +2633,7 @@ BOOL LLMenuGL::appendContextSubMenu(LLMenuGL *menu)
{
if (menu == this)
{
- llerrs << "Can't attach a context menu to itself" << llendl;
+ LL_ERRS() << "Can't attach a context menu to itself" << LL_ENDL;
}
LLContextMenuBranch *item;
@@ -3163,7 +3164,7 @@ LLMenuGL* LLMenuGL::findChildMenuByName(const std::string& name, BOOL recurse) c
return menup;
}
}
- llwarns << "Child Menu " << name << " not found in menu " << getName() << llendl;
+ LL_WARNS() << "Child Menu " << name << " not found in menu " << getName() << LL_ENDL;
return NULL;
}
@@ -3474,8 +3475,8 @@ BOOL LLMenuBarGL::appendMenu( LLMenuGL* menu )
{
if( menu == this )
{
- llerrs << "** Attempt to attach menu to itself. This is certainly "
- << "a logic error." << llendl;
+ LL_ERRS() << "** Attempt to attach menu to itself. This is certainly "
+ << "a logic error." << LL_ENDL;
}
BOOL success = TRUE;
@@ -3804,7 +3805,7 @@ void LLTearOffMenu::draw()
if (getRect().getHeight() != mTargetHeight)
{
// animate towards target height
- reshape(getRect().getWidth(), llceil(lerp((F32)getRect().getHeight(), mTargetHeight, LLCriticalDamp::getInterpolant(0.05f))));
+ reshape(getRect().getWidth(), llceil(lerp((F32)getRect().getHeight(), mTargetHeight, LLSmoothInterpolation::getInterpolant(0.05f))));
}
LLFloater::draw();
}
diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h
index 51df5df1f8..ae9b169691 100755
--- a/indra/llui/llmenugl.h
+++ b/indra/llui/llmenugl.h
@@ -82,7 +82,7 @@ protected:
friend class LLUICtrlFactory;
public:
// LLView overrides
- /*virtual*/ void handleVisibilityChange(BOOL new_visibility);
+ /*virtual*/ void onVisibilityChange(BOOL new_visibility);
/*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
/*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
/*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask);
@@ -637,7 +637,7 @@ public:
virtual void updateBranchParent( LLView* parentp );
// LLView Functionality
- virtual void handleVisibilityChange( BOOL curVisibilityIn );
+ virtual void onVisibilityChange( BOOL curVisibilityIn );
virtual void draw();
@@ -895,7 +895,8 @@ class view_listener_t : public boost::signals2::trackable
{
public:
virtual bool handleEvent(const LLSD& userdata) = 0;
- virtual ~view_listener_t() {}
+ view_listener_t() { sListeners.insert(this); }
+ virtual ~view_listener_t() { sListeners.erase(this); }
static void addEnable(view_listener_t* listener, const std::string& name)
{
@@ -913,6 +914,20 @@ public:
addEnable(listener, name);
addCommit(listener, name);
}
+
+ static void cleanup()
+ {
+ listener_vector_t listeners(sListeners.begin(), sListeners.end());
+ sListeners.clear();
+
+ std::for_each(listeners.begin(), listeners.end(), DeletePointer());
+ listeners.clear();
+ }
+
+private:
+ typedef std::set<view_listener_t*> listener_map_t;
+ typedef std::vector<view_listener_t*> listener_vector_t;
+ static listener_map_t sListeners;
};
#endif // LL_LLMENUGL_H
diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp
index 4d6e189b92..33e66add18 100755
--- a/indra/llui/llmodaldialog.cpp
+++ b/indra/llui/llmodaldialog.cpp
@@ -65,7 +65,7 @@ LLModalDialog::~LLModalDialog()
std::list<LLModalDialog*>::iterator iter = std::find(sModalStack.begin(), sModalStack.end(), this);
if (iter != sModalStack.end())
{
- llerrs << "Attempt to delete dialog while still in sModalStack!" << llendl;
+ LL_ERRS() << "Attempt to delete dialog while still in sModalStack!" << LL_ENDL;
}
}
@@ -126,7 +126,7 @@ void LLModalDialog::stopModal()
}
else
{
- llwarns << "LLModalDialog::stopModal not in list!" << llendl;
+ LL_WARNS() << "LLModalDialog::stopModal not in list!" << LL_ENDL;
}
}
if (!sModalStack.empty())
@@ -195,7 +195,7 @@ BOOL LLModalDialog::handleHover(S32 x, S32 y, MASK mask)
if( childrenHandleHover(x, y, mask) == NULL )
{
getWindow()->setCursor(UI_CURSOR_ARROW);
- lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by " << getName() << LL_ENDL;
}
LLView* popup_menu = LLMenuGL::sMenuContainer->getVisibleMenu();
@@ -331,7 +331,7 @@ void LLModalDialog::shutdownModals()
// app, we shouldn't have to care WHAT's open. Put differently, if a modal
// dialog is so crucial that we can't let the user terminate until s/he
// addresses it, we should reject a termination request. The current state
- // of affairs is that we accept it, but then produce an llerrs popup that
+ // of affairs is that we accept it, but then produce an LL_ERRS() popup that
// simply makes our software look unreliable.
sModalStack.clear();
}
diff --git a/indra/llui/llmultifloater.cpp b/indra/llui/llmultifloater.cpp
index 179b251cdb..d1a597511e 100755
--- a/indra/llui/llmultifloater.cpp
+++ b/indra/llui/llmultifloater.cpp
@@ -67,14 +67,13 @@ void LLMultiFloater::buildTabContainer()
}
}
-void LLMultiFloater::onOpen(const LLSD& key)
+void LLMultiFloater::onClose(bool app_quitting)
{
-// if (mTabContainer->getTabCount() <= 0)
-// {
-// // for now, don't allow multifloaters
-// // without any child floaters
-// closeFloater();
-// }
+ if(isMinimized())
+ {
+ setMinimized(FALSE);
+ }
+ LLFloater::onClose(app_quitting);
}
void LLMultiFloater::draw()
@@ -159,7 +158,7 @@ void LLMultiFloater::addFloater(LLFloater* floaterp, BOOL select_added_floater,
if (!mTabContainer)
{
- llerrs << "Tab Container used without having been initialized." << llendl;
+ LL_ERRS() << "Tab Container used without having been initialized." << LL_ENDL;
return;
}
diff --git a/indra/llui/llmultifloater.h b/indra/llui/llmultifloater.h
index d992212650..c106a62527 100755
--- a/indra/llui/llmultifloater.h
+++ b/indra/llui/llmultifloater.h
@@ -44,7 +44,7 @@ public:
void buildTabContainer();
virtual BOOL postBuild();
- /*virtual*/ void onOpen(const LLSD& key);
+ /*virtual*/ void onClose(bool app_quitting);
virtual void draw();
virtual void setVisible(BOOL visible);
/*virtual*/ BOOL handleKeyHere(KEY key, MASK mask);
@@ -100,6 +100,3 @@ private:
};
#endif // LL_MULTI_FLOATER_H
-
-
-
diff --git a/indra/llui/llmultislider.cpp b/indra/llui/llmultislider.cpp
index 70bcfb5b4f..0aa3e17075 100755
--- a/indra/llui/llmultislider.cpp
+++ b/indra/llui/llmultislider.cpp
@@ -301,7 +301,7 @@ bool LLMultiSlider::findUnusedValue(F32& initVal)
// stop if it's filled
if(initVal == mInitialValue && !firstTry) {
- llwarns << "Whoa! Too many multi slider elements to add one to" << llendl;
+ LL_WARNS() << "Whoa! Too many multi slider elements to add one to" << LL_ENDL;
return false;
}
@@ -356,12 +356,12 @@ BOOL LLMultiSlider::handleHover(S32 x, S32 y, MASK mask)
onCommit();
getWindow()->setCursor(UI_CURSOR_ARROW);
- lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << LL_ENDL;
}
else
{
getWindow()->setCursor(UI_CURSOR_ARROW);
- lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << LL_ENDL;
}
return TRUE;
}
diff --git a/indra/llui/llmultisliderctrl.cpp b/indra/llui/llmultisliderctrl.cpp
index 91e5b6b9de..c460a08afc 100755
--- a/indra/llui/llmultisliderctrl.cpp
+++ b/indra/llui/llmultisliderctrl.cpp
@@ -450,7 +450,7 @@ void LLMultiSliderCtrl::setPrecision(S32 precision)
{
if (precision < 0 || precision > 10)
{
- llerrs << "LLMultiSliderCtrl::setPrecision - precision out of range" << llendl;
+ LL_ERRS() << "LLMultiSliderCtrl::setPrecision - precision out of range" << LL_ENDL;
return;
}
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 5c288c3f03..de14391d1f 100755
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -246,7 +246,7 @@ LLNotificationForm::LLNotificationForm(const LLSD& sd)
}
else
{
- llwarns << "Invalid form data " << sd << llendl;
+ LL_WARNS() << "Invalid form data " << sd << LL_ENDL;
mFormData = LLSD::emptyArray();
}
}
@@ -438,11 +438,11 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par
mUniqueContext.push_back(context.value);
}
- lldebugs << "notification \"" << mName << "\": tag count is " << p.tags.size() << llendl;
+ LL_DEBUGS() << "notification \"" << mName << "\": tag count is " << p.tags.size() << LL_ENDL;
BOOST_FOREACH(const LLNotificationTemplate::Tag& tag, p.tags)
{
- lldebugs << " tag \"" << std::string(tag.value) << "\"" << llendl;
+ LL_DEBUGS() << " tag \"" << std::string(tag.value) << "\"" << LL_ENDL;
mTags.push_back(tag.value);
}
@@ -516,7 +516,7 @@ LLNotification::LLNotification(const LLSDParamAdapter<Params>& p) :
LLSD LLNotification::asLLSD(bool excludeTemplateElements)
-{
+{
LLParamSDParser parser;
Params p;
@@ -544,12 +544,12 @@ LLSD LLNotification::asLLSD(bool excludeTemplateElements)
mForm->getElements(dynamicElements, templateForm->getNumElements());
p.form_elements = dynamicElements;
}
-
+
if(mResponder)
{
p.functor.responder_sd = mResponder->asLLSD();
}
-
+
if(!mResponseFunctorName.empty())
{
p.functor.name = mResponseFunctorName;
@@ -1189,6 +1189,7 @@ void LLNotificationChannel::connectToChannel( const std::string& channel_name )
}
else
{
+ mParents.push_back(channel_name);
LLNotificationChannelPtr p = LLNotifications::instance().getChannel(channel_name);
p->connectChanged(boost::bind(&LLNotificationChannelBase::updateItem, this, _1));
}
@@ -1208,6 +1209,9 @@ LLNotifications::LLNotifications()
{
mListener.reset(new LLNotificationsListener(*this));
LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Notification.Show", boost::bind(&LLNotifications::addFromCallback, this, _2));
+
+ // touch the instance tracker for notification channels, so that it will still be around in our destructor
+ LLInstanceTracker<LLNotificationChannel, std::string>::instanceCount();
}
void LLNotifications::clear()
@@ -1407,7 +1411,7 @@ void LLNotifications::forceResponse(const LLNotification::Params& params, S32 op
if (selected_item.isUndefined())
{
- llwarns << "Invalid option" << option << " for notification " << (std::string)params.name << llendl;
+ LL_WARNS() << "Invalid option" << option << " for notification " << (std::string)params.name << LL_ENDL;
return;
}
response[selected_item["name"].asString()] = true;
@@ -1441,12 +1445,12 @@ void replaceSubstitutionStrings(LLXMLNodePtr node, StringMap& replacements)
if (found != replacements.end())
{
replacement = found->second;
- lldebugs << "replaceSubstitutionStrings: value: \"" << value << "\" repl: \"" << replacement << "\"." << llendl;
+ LL_DEBUGS() << "replaceSubstitutionStrings: value: \"" << value << "\" repl: \"" << replacement << "\"." << LL_ENDL;
it->second->setValue(replacement);
}
else
{
- llwarns << "replaceSubstitutionStrings FAILURE: could not find replacement \"" << value << "\"." << llendl;
+ LL_WARNS() << "replaceSubstitutionStrings FAILURE: could not find replacement \"" << value << "\"." << LL_ENDL;
}
}
}
@@ -1485,7 +1489,7 @@ void addPathIfExists(const std::string& new_path, std::vector<std::string>& path
bool LLNotifications::loadTemplates()
{
- llinfos << "Reading notifications template" << llendl;
+ LL_INFOS() << "Reading notifications template" << LL_ENDL;
// Passing findSkinnedFilenames(constraint=LLDir::ALL_SKINS) makes it
// output all relevant pathnames instead of just the ones from the most
// specific skin.
@@ -1498,7 +1502,7 @@ bool LLNotifications::loadTemplates()
if (!success || root.isNull() || !root->hasName( "notifications" ))
{
- llerrs << "Problem reading XML from UI Notifications file: " << base_filename << llendl;
+ LL_ERRS() << "Problem reading XML from UI Notifications file: " << base_filename << LL_ENDL;
return false;
}
@@ -1508,7 +1512,7 @@ bool LLNotifications::loadTemplates()
if(!params.validateBlock())
{
- llerrs << "Problem reading XUI from UI Notifications file: " << base_filename << llendl;
+ LL_ERRS() << "Problem reading XUI from UI Notifications file: " << base_filename << LL_ENDL;
return false;
}
@@ -1556,7 +1560,7 @@ bool LLNotifications::loadTemplates()
mTemplates[notification.name] = LLNotificationTemplatePtr(new LLNotificationTemplate(notification));
}
- llinfos << "...done" << llendl;
+ LL_INFOS() << "...done" << LL_ENDL;
return true;
}
@@ -1574,7 +1578,7 @@ bool LLNotifications::loadVisibilityRules()
if(!params.validateBlock())
{
- llerrs << "Problem reading UI Notification Visibility Rules file: " << full_filename << llendl;
+ LL_ERRS() << "Problem reading UI Notification Visibility Rules file: " << full_filename << LL_ENDL;
return false;
}
@@ -1639,7 +1643,7 @@ void LLNotifications::add(const LLNotificationPtr pNotif)
LLNotificationSet::iterator it=mItems.find(pNotif);
if (it != mItems.end())
{
- llerrs << "Notification added a second time to the master notification channel." << llendl;
+ LL_ERRS() << "Notification added a second time to the master notification channel." << LL_ENDL;
}
updateItem(LLSD().with("sigtype", "add").with("id", pNotif->id()), pNotif);
@@ -1697,7 +1701,7 @@ LLNotificationPtr LLNotifications::find(LLUUID uuid)
LLNotificationSet::iterator it=mItems.find(target);
if (it == mItems.end())
{
- LL_DEBUGS("Notifications") << "Tried to dereference uuid '" << uuid << "' as a notification key but didn't find it." << llendl;
+ LL_DEBUGS("Notifications") << "Tried to dereference uuid '" << uuid << "' as a notification key but didn't find it." << LL_ENDL;
return LLNotificationPtr((LLNotification*)NULL);
}
else
@@ -1748,13 +1752,13 @@ bool LLNotifications::isVisibleByRules(LLNotificationPtr n)
for(it = mVisibilityRules.begin(); it != mVisibilityRules.end(); it++)
{
// An empty type/tag/name string will match any notification, so only do the comparison when the string is non-empty in the rule.
- lldebugs
+ LL_DEBUGS()
<< "notification \"" << n->getName() << "\" "
<< "testing against " << ((*it)->mVisible?"show":"hide") << " rule, "
<< "name = \"" << (*it)->mName << "\" "
<< "tag = \"" << (*it)->mTag << "\" "
<< "type = \"" << (*it)->mType << "\" "
- << llendl;
+ << LL_ENDL;
if(!(*it)->mType.empty())
{
@@ -1793,7 +1797,7 @@ bool LLNotifications::isVisibleByRules(LLNotificationPtr n)
if((*it)->mResponse.empty())
{
// Response property is empty. Cancel this notification.
- lldebugs << "cancelling notification " << n->getName() << llendl;
+ LL_DEBUGS() << "cancelling notification " << n->getName() << LL_ENDL;
cancel(n);
}
@@ -1804,7 +1808,7 @@ bool LLNotifications::isVisibleByRules(LLNotificationPtr n)
// TODO: verify that the response template has an item with the correct name
response[(*it)->mResponse] = true;
- lldebugs << "responding to notification " << n->getName() << " with response = " << response << llendl;
+ LL_DEBUGS() << "responding to notification " << n->getName() << " with response = " << response << LL_ENDL;
n->respond(response);
}
@@ -1816,7 +1820,7 @@ bool LLNotifications::isVisibleByRules(LLNotificationPtr n)
break;
}
- lldebugs << "allowing notification " << n->getName() << llendl;
+ LL_DEBUGS() << "allowing notification " << n->getName() << LL_ENDL;
return true;
}
@@ -1877,7 +1881,7 @@ void LLPostponedNotification::onAvatarNameCache(const LLUUID& agent_id,
// from PE merge - we should figure out if this is the right thing to do
if (name.empty())
{
- llwarns << "Empty name received for Id: " << agent_id << llendl;
+ LL_WARNS() << "Empty name received for Id: " << agent_id << LL_ENDL;
name = SYSTEM_FROM;
}
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index 6ac4a98806..3cf432f330 100755
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -88,10 +88,12 @@
#include <boost/enable_shared_from_this.hpp>
#include <boost/type_traits.hpp>
#include <boost/signals2.hpp>
+#include <boost/range.hpp>
#include "llevents.h"
#include "llfunctorregistry.h"
#include "llinitparam.h"
+#include "llinstancetracker.h"
#include "llmortician.h"
#include "llnotificationptr.h"
#include "llpointer.h"
@@ -839,6 +841,11 @@ public:
typedef LLNotificationSet::iterator Iterator;
std::string getName() const { return mName; }
+ typedef std::vector<std::string>::const_iterator parents_iter;
+ boost::iterator_range<parents_iter> getParents() const
+ {
+ return boost::iterator_range<parents_iter>(mParents);
+ }
void connectToChannel(const std::string& channel_name);
@@ -848,12 +855,12 @@ public:
Iterator begin();
Iterator end();
size_t size();
-
+
std::string summarize();
private:
std::string mName;
- std::string mParent;
+ std::vector<std::string> mParents;
};
// An interface class to provide a clean linker seam to the LLNotifications class.
@@ -1067,15 +1074,13 @@ class LLPersistentNotificationChannel : public LLNotificationChannel
public:
LLPersistentNotificationChannel()
: LLNotificationChannel("Persistent", "Visible", &notificationFilter)
- {
- }
+ {}
typedef std::vector<LLNotificationPtr> history_list_t;
history_list_t::iterator beginHistory() { sortHistory(); return mHistory.begin(); }
history_list_t::iterator endHistory() { return mHistory.end(); }
private:
-
struct sortByTime
{
S32 operator ()(const LLNotificationPtr& a, const LLNotificationPtr& b)
@@ -1089,7 +1094,6 @@ private:
std::sort(mHistory.begin(), mHistory.end(), sortByTime());
}
-
// The channel gets all persistent notifications except those that have been canceled
static bool notificationFilter(LLNotificationPtr pNotification)
{
diff --git a/indra/llui/llnotificationslistener.cpp b/indra/llui/llnotificationslistener.cpp
index 9e8e943ee6..b6a32a0e78 100644
--- a/indra/llui/llnotificationslistener.cpp
+++ b/indra/llui/llnotificationslistener.cpp
@@ -32,6 +32,7 @@
#include "llnotificationtemplate.h"
#include "llsd.h"
#include "llui.h"
+#include <boost/foreach.hpp>
LLNotificationsListener::LLNotificationsListener(LLNotifications & notifications) :
LLEventAPI("LLNotifications",
@@ -42,11 +43,10 @@ LLNotificationsListener::LLNotificationsListener(LLNotifications & notifications
"Add a notification with specified [\"name\"], [\"substitutions\"] and [\"payload\"].\n"
"If optional [\"reply\"] specified, arrange to send user response on that LLEventPump.",
&LLNotificationsListener::requestAdd);
- /* add("listChannels",
+ add("listChannels",
"Post to [\"reply\"] a map of info on existing channels",
&LLNotificationsListener::listChannels,
LLSD().with("reply", LLSD()));
- */
add("listChannelNotifications",
"Post to [\"reply\"] an array of info on notifications in channel [\"channel\"]",
&LLNotificationsListener::listChannelNotifications,
@@ -117,26 +117,27 @@ void LLNotificationsListener::NotificationResponder(const std::string& reply_pum
reponse_event["response"] = response;
LLEventPumps::getInstance()->obtain(reply_pump).post(reponse_event);
}
-/*
+
void LLNotificationsListener::listChannels(const LLSD& params) const
{
LLReqID reqID(params);
LLSD response(reqID.makeResponse());
- for (LLNotifications::
-
-
-
- for (LLNotifications::ChannelMap::const_iterator cmi(mNotifications.mChannels.begin()),
- cmend(mNotifications.mChannels.end());
+ for (LLNotificationChannel::instance_iter cmi(LLNotificationChannel::beginInstances()),
+ cmend(LLNotificationChannel::endInstances());
cmi != cmend; ++cmi)
{
- LLSD channelInfo;
- channelInfo["parent"] = cmi->second->getParentChannelName();
- response[cmi->first] = channelInfo;
+ LLSD channelInfo, parents;
+ BOOST_FOREACH(const std::string& parent, cmi->getParents())
+ {
+ parents.append(parent);
+ }
+ channelInfo["parents"] = parents;
+ channelInfo["parent"] = parents.size()? parents[0] : "";
+ response[cmi->getName()] = channelInfo;
}
LLEventPumps::instance().obtain(params["reply"]).post(response);
}
-*/
+
void LLNotificationsListener::listChannelNotifications(const LLSD& params) const
{
LLReqID reqID(params);
diff --git a/indra/llui/llnotificationsutil.h b/indra/llui/llnotificationsutil.h
index 4093324d0c..9f29087b4a 100755
--- a/indra/llui/llnotificationsutil.h
+++ b/indra/llui/llnotificationsutil.h
@@ -30,6 +30,7 @@
// to avoid including the heavyweight llnotifications.h
#include "llnotificationptr.h"
+#include "lluuid.h"
#include <boost/function.hpp>
diff --git a/indra/llui/llnotificationtemplate.h b/indra/llui/llnotificationtemplate.h
index 18a82190b5..0315ddbea8 100755
--- a/indra/llui/llnotificationtemplate.h
+++ b/indra/llui/llnotificationtemplate.h
@@ -28,32 +28,9 @@
#ifndef LL_LLNOTIFICATION_TEMPLATE_H
#define LL_LLNOTIFICATION_TEMPLATE_H
-//#include <string>
-//#include <list>
-//#include <vector>
-//#include <map>
-//#include <set>
-//#include <iomanip>
-//#include <sstream>
-//
-//#include <boost/utility.hpp>
-//#include <boost/shared_ptr.hpp>
-//#include <boost/enable_shared_from_this.hpp>
-//#include <boost/type_traits.hpp>
-//
-//// we want to minimize external dependencies, but this one is important
-//#include "llsd.h"
-//
-//// and we need this to manage the notification callbacks
-//#include "llevents.h"
-//#include "llfunctorregistry.h"
-//#include "llpointer.h"
#include "llinitparam.h"
-//#include "llnotificationptr.h"
-//#include "llcachename.h"
#include "llnotifications.h"
-
typedef boost::shared_ptr<LLNotificationForm> LLNotificationFormPtr;
// This is the class of object read from the XML file (notifications.xml,
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index 67472ad166..ee90574161 100755
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -38,10 +38,8 @@
#include "lldir.h"
#include "lltimer.h"
-#include "llaccordionctrltab.h"
#include "llbutton.h"
#include "llmenugl.h"
-//#include "llstatusbar.h"
#include "llui.h"
#include "llkeyboard.h"
#include "lllineeditor.h"
@@ -50,7 +48,6 @@
#include "lluictrl.h"
#include "lluictrlfactory.h"
#include "llviewborder.h"
-#include "lltabcontainer.h"
static LLDefaultChildRegistry::Register<LLPanel> r1("panel", &LLPanel::fromXML);
LLPanel::factory_stack_t LLPanel::sFactoryStack;
@@ -166,8 +163,8 @@ void LLPanel::removeBorder()
// virtual
void LLPanel::clearCtrls()
{
- LLView::ctrl_list_t ctrls = getCtrlList();
- for (LLView::ctrl_list_t::iterator ctrl_it = ctrls.begin(); ctrl_it != ctrls.end(); ++ctrl_it)
+ LLPanel::ctrl_list_t ctrls = getCtrlList();
+ for (LLPanel::ctrl_list_t::iterator ctrl_it = ctrls.begin(); ctrl_it != ctrls.end(); ++ctrl_it)
{
LLUICtrl* ctrl = *ctrl_it;
ctrl->setFocus( FALSE );
@@ -178,14 +175,29 @@ void LLPanel::clearCtrls()
void LLPanel::setCtrlsEnabled( BOOL b )
{
- LLView::ctrl_list_t ctrls = getCtrlList();
- for (LLView::ctrl_list_t::iterator ctrl_it = ctrls.begin(); ctrl_it != ctrls.end(); ++ctrl_it)
+ LLPanel::ctrl_list_t ctrls = getCtrlList();
+ for (LLPanel::ctrl_list_t::iterator ctrl_it = ctrls.begin(); ctrl_it != ctrls.end(); ++ctrl_it)
{
LLUICtrl* ctrl = *ctrl_it;
ctrl->setEnabled( b );
}
}
+LLPanel::ctrl_list_t LLPanel::getCtrlList() const
+{
+ ctrl_list_t controls;
+ for(child_list_t::const_iterator it = getChildList()->begin(), end_it = getChildList()->end(); it != end_it; ++it)
+ {
+ LLView* viewp = *it;
+ if(viewp->isCtrl())
+ {
+ controls.push_back(static_cast<LLUICtrl*>(viewp));
+ }
+ }
+ return controls;
+}
+
+
void LLPanel::draw()
{
F32 alpha = getDrawContext().mAlpha;
@@ -342,9 +354,9 @@ BOOL LLPanel::handleKeyHere( KEY key, MASK mask )
return handled;
}
-void LLPanel::handleVisibilityChange ( BOOL new_visibility )
+void LLPanel::onVisibilityChange ( BOOL new_visibility )
{
- LLUICtrl::handleVisibilityChange ( new_visibility );
+ LLUICtrl::onVisibilityChange ( new_visibility );
if (mVisibleSignal)
(*mVisibleSignal)(this, LLSD(new_visibility) ); // Pass BOOL as LLSD
}
@@ -372,7 +384,7 @@ void LLPanel::setBorderVisible(BOOL b)
}
}
-LLFastTimer::DeclareTimer FTM_PANEL_CONSTRUCTION("Panel Construction");
+LLTrace::BlockTimerStatHandle FTM_PANEL_CONSTRUCTION("Panel Construction");
LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_node)
{
@@ -384,14 +396,14 @@ LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_
LLPanel* panelp = NULL;
- { LLFastTimer _(FTM_PANEL_CONSTRUCTION);
+ { LL_RECORD_BLOCK_TIME(FTM_PANEL_CONSTRUCTION);
if(!class_attr.empty())
{
panelp = LLRegisterPanelClass::instance().createPanelClass(class_attr);
if (!panelp)
{
- llwarns << "Panel class \"" << class_attr << "\" not registered." << llendl;
+ LL_WARNS() << "Panel class \"" << class_attr << "\" not registered." << LL_ENDL;
}
}
@@ -488,15 +500,15 @@ void LLPanel::initFromParams(const LLPanel::Params& p)
setAcceptsBadge(p.accepts_badge);
}
-static LLFastTimer::DeclareTimer FTM_PANEL_SETUP("Panel Setup");
-static LLFastTimer::DeclareTimer FTM_EXTERNAL_PANEL_LOAD("Load Extern Panel Reference");
-static LLFastTimer::DeclareTimer FTM_PANEL_POSTBUILD("Panel PostBuild");
+static LLTrace::BlockTimerStatHandle FTM_PANEL_SETUP("Panel Setup");
+static LLTrace::BlockTimerStatHandle FTM_EXTERNAL_PANEL_LOAD("Load Extern Panel Reference");
+static LLTrace::BlockTimerStatHandle FTM_PANEL_POSTBUILD("Panel PostBuild");
BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node, const LLPanel::Params& default_params)
{
Params params(default_params);
{
- LLFastTimer timer(FTM_PANEL_SETUP);
+ LL_RECORD_BLOCK_TIME(FTM_PANEL_SETUP);
LLXMLNodePtr referenced_xml;
std::string xml_filename = mXMLFilename;
@@ -520,16 +532,16 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu
Params output_params(params);
setupParamsForExport(output_params, parent);
output_node->setName(node->getName()->mString);
- parser.writeXUI(output_node, output_params, &default_params);
+ parser.writeXUI(output_node, output_params, LLInitParam::default_parse_rules(), &default_params);
return TRUE;
}
LLUICtrlFactory::instance().pushFileName(xml_filename);
- LLFastTimer timer(FTM_EXTERNAL_PANEL_LOAD);
+ LL_RECORD_BLOCK_TIME(FTM_EXTERNAL_PANEL_LOAD);
if (!LLUICtrlFactory::getLayeredXMLNode(xml_filename, referenced_xml))
{
- llwarns << "Couldn't parse panel from: " << xml_filename << llendl;
+ LL_WARNS() << "Couldn't parse panel from: " << xml_filename << LL_ENDL;
return FALSE;
}
@@ -551,13 +563,13 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu
Params output_params(params);
setupParamsForExport(output_params, parent);
output_node->setName(node->getName()->mString);
- parser.writeXUI(output_node, output_params, &default_params);
+ parser.writeXUI(output_node, output_params, LLInitParam::default_parse_rules(), &default_params);
}
params.from_xui = true;
applyXUILayout(params, parent);
{
- LLFastTimer timer(FTM_PANEL_CONSTRUCTION);
+ LL_RECORD_BLOCK_TIME(FTM_PANEL_CONSTRUCTION);
initFromParams(params);
}
@@ -574,7 +586,7 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu
}
{
- LLFastTimer timer(FTM_PANEL_POSTBUILD);
+ LL_RECORD_BLOCK_TIME(FTM_PANEL_POSTBUILD);
postBuild();
}
}
@@ -599,11 +611,11 @@ std::string LLPanel::getString(const std::string& name, const LLStringUtil::form
std::string err_str("Failed to find string " + name + " in panel " + getName()); //*TODO: Translate
if(LLUI::sSettingGroups["config"]->getBOOL("QAMode"))
{
- llerrs << err_str << llendl;
+ LL_ERRS() << err_str << LL_ENDL;
}
else
{
- llwarns << err_str << llendl;
+ LL_WARNS() << err_str << LL_ENDL;
}
return LLStringUtil::null;
}
@@ -618,11 +630,11 @@ std::string LLPanel::getString(const std::string& name) const
std::string err_str("Failed to find string " + name + " in panel " + getName()); //*TODO: Translate
if(LLUI::sSettingGroups["config"]->getBOOL("QAMode"))
{
- llerrs << err_str << llendl;
+ LL_ERRS() << err_str << LL_ENDL;
}
else
{
- llwarns << err_str << llendl;
+ LL_WARNS() << err_str << LL_ENDL;
}
return LLStringUtil::null;
}
@@ -637,16 +649,6 @@ void LLPanel::childSetVisible(const std::string& id, bool visible)
}
}
-bool LLPanel::childIsVisible(const std::string& id) const
-{
- LLView* child = findChild<LLView>(id);
- if (child)
- {
- return (bool)child->getVisible();
- }
- return false;
-}
-
void LLPanel::childSetEnabled(const std::string& id, bool enabled)
{
LLView* child = findChild<LLView>(id);
@@ -656,55 +658,6 @@ void LLPanel::childSetEnabled(const std::string& id, bool enabled)
}
}
-void LLPanel::childSetTentative(const std::string& id, bool tentative)
-{
- LLUICtrl* child = findChild<LLUICtrl>(id);
- if (child)
- {
- child->setTentative(tentative);
- }
-}
-
-bool LLPanel::childIsEnabled(const std::string& id) const
-{
- LLView* child = findChild<LLView>(id);
- if (child)
- {
- return (bool)child->getEnabled();
- }
- return false;
-}
-
-
-void LLPanel::childSetToolTip(const std::string& id, const std::string& msg)
-{
- LLView* child = findChild<LLView>(id);
- if (child)
- {
- child->setToolTip(msg);
- }
-}
-
-void LLPanel::childSetRect(const std::string& id, const LLRect& rect)
-{
- LLView* child = findChild<LLView>(id);
- if (child)
- {
- child->setRect(rect);
- }
-}
-
-bool LLPanel::childGetRect(const std::string& id, LLRect& rect) const
-{
- LLView* child = findChild<LLView>(id);
- if (child)
- {
- rect = child->getRect();
- return true;
- }
- return false;
-}
-
void LLPanel::childSetFocus(const std::string& id, BOOL focus)
{
LLUICtrl* child = findChild<LLUICtrl>(id);
@@ -740,15 +693,6 @@ void LLPanel::childSetCommitCallback(const std::string& id, boost::function<void
}
}
-void LLPanel::childSetValidate(const std::string& id, boost::function<bool (const LLSD& data)> cb)
-{
- LLUICtrl* child = findChild<LLUICtrl>(id);
- if (child)
- {
- child->setValidateBeforeCommit(cb);
- }
-}
-
void LLPanel::childSetColor(const std::string& id, const LLColor4& color)
{
LLUICtrl* child = findChild<LLUICtrl>(id);
@@ -828,95 +772,6 @@ BOOL LLPanel::childSetLabelArg(const std::string& id, const std::string& key, co
return FALSE;
}
-BOOL LLPanel::childSetToolTipArg(const std::string& id, const std::string& key, const LLStringExplicit& text)
-{
- LLView* child = findChild<LLView>(id);
- if (child)
- {
- return child->setToolTipArg(key, text);
- }
- return FALSE;
-}
-
-void LLPanel::childShowTab(const std::string& id, const std::string& tabname, bool visible)
-{
- LLTabContainer* child = findChild<LLTabContainer>(id);
- if (child)
- {
- child->selectTabByName(tabname);
- }
-}
-
-LLPanel *LLPanel::childGetVisibleTab(const std::string& id) const
-{
- LLTabContainer* child = findChild<LLTabContainer>(id);
- if (child)
- {
- return child->getCurrentPanel();
- }
- return NULL;
-}
-
-LLPanel* LLPanel::childGetVisibleTabWithHelp()
-{
- LLView *child;
-
- bfs_tree_iterator_t it = beginTreeBFS();
- // skip ourselves
- ++it;
- for (; it != endTreeBFS(); ++it)
- {
- child = *it;
- LLPanel *curTabPanel = NULL;
-
- // do we have a tab container?
- LLTabContainer *tab = dynamic_cast<LLTabContainer *>(child);
- if (tab && tab->getVisible())
- {
- curTabPanel = tab->getCurrentPanel();
- }
-
- // do we have an accordion tab?
- LLAccordionCtrlTab* accordion = dynamic_cast<LLAccordionCtrlTab *>(child);
- if (accordion && accordion->getDisplayChildren())
- {
- curTabPanel = dynamic_cast<LLPanel *>(accordion->getAccordionView());
- }
-
- // if we found a valid tab, does it have a help topic?
- if (curTabPanel && !curTabPanel->getHelpTopic().empty())
- {
- return curTabPanel;
- }
- }
-
- // couldn't find any active tabs with a help topic string
- return NULL;
-}
-
-
-LLPanel *LLPanel::childGetVisiblePanelWithHelp()
-{
- LLView *child;
-
- bfs_tree_iterator_t it = beginTreeBFS();
- // skip ourselves
- ++it;
- for (; it != endTreeBFS(); ++it)
- {
- child = *it;
- // do we have a panel with a help topic?
- LLPanel *panel = dynamic_cast<LLPanel *>(child);
- if (panel && panel->isInVisibleChain() && !panel->getHelpTopic().empty())
- {
- return panel;
- }
- }
-
- // couldn't find any active panels with a help topic string
- return NULL;
-}
-
void LLPanel::childSetAction(const std::string& id, const commit_signal_t::slot_type& function)
{
LLButton* button = findChild<LLButton>(id);
@@ -935,24 +790,6 @@ void LLPanel::childSetAction(const std::string& id, boost::function<void(void*)>
}
}
-void LLPanel::childSetActionTextbox(const std::string& id, boost::function<void(void*)> function, void* value)
-{
- LLTextBox* textbox = findChild<LLTextBox>(id);
- if (textbox)
- {
- textbox->setClickedCallback(boost::bind(function, value));
- }
-}
-
-void LLPanel::childSetControlName(const std::string& id, const std::string& control_name)
-{
- LLUICtrl* view = findChild<LLUICtrl>(id);
- if (view)
- {
- view->setControlName(control_name, NULL);
- }
-}
-
boost::signals2::connection LLPanel::setVisibleCallback( const commit_signal_t::slot_type& cb )
{
if (!mVisibleSignal)
@@ -963,31 +800,31 @@ boost::signals2::connection LLPanel::setVisibleCallback( const commit_signal_t::
return mVisibleSignal->connect(cb);
}
-static LLFastTimer::DeclareTimer FTM_BUILD_PANELS("Build Panels");
+static LLTrace::BlockTimerStatHandle FTM_BUILD_PANELS("Build Panels");
//-----------------------------------------------------------------------------
// buildPanel()
//-----------------------------------------------------------------------------
BOOL LLPanel::buildFromFile(const std::string& filename, const LLPanel::Params& default_params)
{
- LLFastTimer timer(FTM_BUILD_PANELS);
+ LL_RECORD_BLOCK_TIME(FTM_BUILD_PANELS);
BOOL didPost = FALSE;
LLXMLNodePtr root;
if (!LLUICtrlFactory::getLayeredXMLNode(filename, root))
{
- llwarns << "Couldn't parse panel from: " << filename << llendl;
+ LL_WARNS() << "Couldn't parse panel from: " << filename << LL_ENDL;
return didPost;
}
// root must be called panel
if( !root->hasName("panel" ) )
{
- llwarns << "Root node should be named panel in : " << filename << llendl;
+ LL_WARNS() << "Root node should be named panel in : " << filename << LL_ENDL;
return didPost;
}
- lldebugs << "Building panel " << filename << llendl;
+ LL_DEBUGS() << "Building panel " << filename << LL_ENDL;
LLUICtrlFactory::instance().pushFileName(filename);
{
diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h
index 17b9b91ba7..c2185f24de 100755
--- a/indra/llui/llpanel.h
+++ b/indra/llui/llpanel.h
@@ -105,6 +105,8 @@ protected:
LLPanel(const LLPanel::Params& params = getDefaultParams());
public:
+ typedef std::vector<class LLUICtrl *> ctrl_list_t;
+
BOOL buildFromFile(const std::string &filename, const LLPanel::Params& default_params = getDefaultParams());
static LLPanel* createFactoryPanel(const std::string& name);
@@ -115,7 +117,7 @@ public:
/*virtual*/ BOOL isPanel() const;
/*virtual*/ void draw();
/*virtual*/ BOOL handleKeyHere( KEY key, MASK mask );
- /*virtual*/ void handleVisibilityChange ( BOOL new_visibility );
+ /*virtual*/ void onVisibilityChange ( BOOL new_visibility );
// From LLFocusableElement
/*virtual*/ void setFocus( BOOL b );
@@ -154,6 +156,7 @@ public:
std::string getHelpTopic() const { return mHelpTopic; }
void setCtrlsEnabled(BOOL b);
+ ctrl_list_t getCtrlList() const;
LLHandle<LLPanel> getHandle() const { return getDerivedHandle<LLPanel>(); }
@@ -174,19 +177,10 @@ public:
// LLView
void childSetVisible(const std::string& name, bool visible);
- void childShow(const std::string& name) { childSetVisible(name, true); }
- void childHide(const std::string& name) { childSetVisible(name, false); }
- bool childIsVisible(const std::string& id) const;
- void childSetTentative(const std::string& name, bool tentative);
void childSetEnabled(const std::string& name, bool enabled);
void childEnable(const std::string& name) { childSetEnabled(name, true); }
void childDisable(const std::string& name) { childSetEnabled(name, false); };
- bool childIsEnabled(const std::string& id) const;
-
- void childSetToolTip(const std::string& id, const std::string& msg);
- void childSetRect(const std::string& id, const LLRect &rect);
- bool childGetRect(const std::string& id, LLRect& rect) const;
// LLUICtrl
void childSetFocus(const std::string& id, BOOL focus = TRUE);
@@ -197,9 +191,6 @@ public:
// which takes a generic slot. Or use mCommitCallbackRegistrar.add() with
// a named callback and reference it in XML.
void childSetCommitCallback(const std::string& id, boost::function<void (LLUICtrl*,void*)> cb, void* data);
-
- void childSetValidate(const std::string& id, boost::function<bool (const LLSD& data)> cb );
-
void childSetColor(const std::string& id, const LLColor4& color);
LLCtrlSelectionInterface* childGetSelectionInterface(const std::string& id) const;
@@ -214,34 +205,11 @@ public:
// Not implemented for all types, defaults to noop, returns FALSE if not applicaple
BOOL childSetTextArg(const std::string& id, const std::string& key, const LLStringExplicit& text);
BOOL childSetLabelArg(const std::string& id, const std::string& key, const LLStringExplicit& text);
- BOOL childSetToolTipArg(const std::string& id, const std::string& key, const LLStringExplicit& text);
- // LLTabContainer
- void childShowTab(const std::string& id, const std::string& tabname, bool visible = true);
- LLPanel *childGetVisibleTab(const std::string& id) const;
-
- // Find a child with a nonempty Help topic
- LLPanel *childGetVisibleTabWithHelp();
- LLPanel *childGetVisiblePanelWithHelp();
-
- // LLTextBox/LLTextEditor/LLLineEditor
- void childSetText(const std::string& id, const LLStringExplicit& text) { childSetValue(id, LLSD(text)); }
-
- // *NOTE: Does not return text from <string> tags, use getString()
- std::string childGetText(const std::string& id) const { return childGetValue(id).asString(); }
-
- // LLLineEditor
- void childSetPrevalidate(const std::string& id, bool (*func)(const LLWString &) );
-
// LLButton
void childSetAction(const std::string& id, boost::function<void(void*)> function, void* value);
void childSetAction(const std::string& id, const commit_signal_t::slot_type& function);
- // LLTextBox
- void childSetActionTextbox(const std::string& id, boost::function<void(void*)> function, void* value = NULL);
-
- void childSetControlName(const std::string& id, const std::string& control_name);
-
static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node = NULL);
//call onOpen to let panel know when it's about to be shown or activated
diff --git a/indra/llui/llradiogroup.cpp b/indra/llui/llradiogroup.cpp
index 95a7d09382..b53bb16d97 100755
--- a/indra/llui/llradiogroup.cpp
+++ b/indra/llui/llradiogroup.cpp
@@ -289,7 +289,7 @@ BOOL LLRadioGroup::handleMouseDown(S32 x, S32 y, MASK mask)
void LLRadioGroup::onClickButton(LLUICtrl* ctrl)
{
- // llinfos << "LLRadioGroup::onClickButton" << llendl;
+ // LL_INFOS() << "LLRadioGroup::onClickButton" << LL_ENDL;
LLRadioCtrl* clicked_radio = dynamic_cast<LLRadioCtrl*>(ctrl);
if (!clicked_radio)
return;
@@ -319,7 +319,7 @@ void LLRadioGroup::onClickButton(LLUICtrl* ctrl)
index++;
}
- llwarns << "LLRadioGroup::onClickButton - clicked button that isn't a child" << llendl;
+ LL_WARNS() << "LLRadioGroup::onClickButton - clicked button that isn't a child" << LL_ENDL;
}
void LLRadioGroup::setValue( const LLSD& value )
diff --git a/indra/llui/llresizebar.cpp b/indra/llui/llresizebar.cpp
index e67b22c977..115c4e23be 100755
--- a/indra/llui/llresizebar.cpp
+++ b/indra/llui/llresizebar.cpp
@@ -35,46 +35,18 @@
#include "llfocusmgr.h"
#include "llwindow.h"
-class LLImagePanel : public LLPanel
-{
-public:
- struct Params : public LLInitParam::Block<Params, LLPanel::Params>
- {
- Optional<bool> horizontal;
- Params() : horizontal("horizontal", false) {}
- };
- LLImagePanel(const Params& p) : LLPanel(p), mHorizontal(p.horizontal) {}
- virtual ~LLImagePanel() {}
-
- void draw()
- {
- const LLRect& parent_rect = getParent()->getRect();
- const LLRect& rect = getRect();
- LLRect clip_rect( -rect.mLeft, parent_rect.getHeight() - rect.mBottom - 2
- , parent_rect.getWidth() - rect.mLeft - (mHorizontal ? 2 : 0), -rect.mBottom);
- LLLocalClipRect clip(clip_rect);
- LLPanel::draw();
- }
-
-private:
- bool mHorizontal;
-};
-
-static LLDefaultChildRegistry::Register<LLImagePanel> t1("resize_bar_image_panel");
-
LLResizeBar::Params::Params()
: max_size("max_size", S32_MAX),
snapping_enabled("snapping_enabled", true),
resizing_view("resizing_view"),
side("side"),
- allow_double_click_snapping("allow_double_click_snapping", true),
- show_drag_handle("show_drag_handle", false)
+ allow_double_click_snapping("allow_double_click_snapping", true)
{
name = "resize_bar";
}
LLResizeBar::LLResizeBar(const LLResizeBar::Params& p)
-: LLPanel(p),
+: LLView(p),
mDragLastScreenX( 0 ),
mDragLastScreenY( 0 ),
mLastMouseScreenX( 0 ),
@@ -86,7 +58,6 @@ LLResizeBar::LLResizeBar(const LLResizeBar::Params& p)
mAllowDoubleClickSnapping(p.allow_double_click_snapping),
mResizingView(p.resizing_view),
mResizeListener(NULL),
- mShowDragHandle(p.show_drag_handle),
mImagePanel(NULL)
{
setFollowsNone();
@@ -116,36 +87,6 @@ LLResizeBar::LLResizeBar(const LLResizeBar::Params& p)
default:
break;
}
-
- if (mShowDragHandle)
- {
- LLViewBorder::Params border_params;
- border_params.border_thickness = 1;
- border_params.highlight_light_color = LLUIColorTable::instance().getColor("ResizebarBorderLight");
- border_params.shadow_dark_color = LLUIColorTable::instance().getColor("ResizebarBorderDark");
-
- addBorder(border_params);
- setBorderVisible(TRUE);
-
- LLImagePanel::Params image_panel;
- mDragHandleImage = LLUI::getUIImage(LLResizeBar::RIGHT == mSide ? "Vertical Drag Handle" : "Horizontal Drag Handle");
- image_panel.bg_alpha_image = mDragHandleImage;
- image_panel.background_visible = true;
- image_panel.horizontal = (LLResizeBar::BOTTOM == mSide);
- mImagePanel = LLUICtrlFactory::create<LLImagePanel>(image_panel);
- setImagePanel(mImagePanel);
- }
-}
-
-BOOL LLResizeBar::postBuild()
-{
- if (mShowDragHandle)
- {
- setBackgroundVisible(TRUE);
- setTransparentColor(LLUIColorTable::instance().getColor("ResizebarBody"));
- }
-
- return LLPanel::postBuild();
}
BOOL LLResizeBar::handleMouseDown(S32 x, S32 y, MASK mask)
@@ -433,18 +374,3 @@ LLPanel * LLResizeBar::getImagePanel() const
{
return getChildCount() > 0 ? (LLPanel *)getChildList()->back() : NULL;
}
-
-void LLResizeBar::draw()
-{
- if (mShowDragHandle)
- {
- S32 image_width = mDragHandleImage->getTextureWidth();
- S32 image_height = mDragHandleImage->getTextureHeight();
- const LLRect& panel_rect = getRect();
- S32 image_left = (panel_rect.getWidth() - image_width) / 2 - 1;
- S32 image_bottom = (panel_rect.getHeight() - image_height) / 2;
- mImagePanel->setRect(LLRect(image_left, image_bottom + image_height, image_left + image_width, image_bottom));
- }
-
- LLPanel::draw();
-}
diff --git a/indra/llui/llresizebar.h b/indra/llui/llresizebar.h
index bcf8ea0b40..20a2406484 100755
--- a/indra/llui/llresizebar.h
+++ b/indra/llui/llresizebar.h
@@ -27,14 +27,14 @@
#ifndef LL_RESIZEBAR_H
#define LL_RESIZEBAR_H
-#include "llpanel.h"
+#include "llview.h"
-class LLResizeBar : public LLPanel
+class LLResizeBar : public LLView
{
public:
enum Side { LEFT, TOP, RIGHT, BOTTOM };
- struct Params : public LLInitParam::Block<Params, LLPanel::Params>
+ struct Params : public LLInitParam::Block<Params, LLView::Params>
{
Mandatory<LLView*> resizing_view;
Mandatory<Side> side;
@@ -43,7 +43,6 @@ public:
Optional<S32> max_size;
Optional<bool> snapping_enabled;
Optional<bool> allow_double_click_snapping;
- Optional<bool> show_drag_handle;
Params();
};
@@ -52,10 +51,8 @@ protected:
LLResizeBar(const LLResizeBar::Params& p);
friend class LLUICtrlFactory;
- /*virtual*/ BOOL postBuild();
public:
- virtual void draw();
virtual BOOL handleHover(S32 x, S32 y, MASK mask);
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
@@ -66,7 +63,6 @@ public:
void setAllowDoubleClickSnapping(BOOL allow) { mAllowDoubleClickSnapping = allow; }
bool canResize() { return getEnabled() && mMaxSize > mMinSize; }
void setResizeListener(boost::function<void(void*)> listener) {mResizeListener = listener;}
- BOOL isShowDragHandle() const { return mShowDragHandle; }
void setImagePanel(LLPanel * panelp);
LLPanel * getImagePanel() const;
@@ -79,9 +75,8 @@ private:
S32 mMinSize;
S32 mMaxSize;
const Side mSide;
- BOOL mSnappingEnabled;
- BOOL mAllowDoubleClickSnapping;
- BOOL mShowDragHandle;
+ bool mSnappingEnabled,
+ mAllowDoubleClickSnapping;
LLView* mResizingView;
boost::function<void(void*)> mResizeListener;
LLPointer<LLUIImage> mDragHandleImage;
diff --git a/indra/llui/llresmgr.cpp b/indra/llui/llresmgr.cpp
index 820e7cb26a..6e924c1f19 100755
--- a/indra/llui/llresmgr.cpp
+++ b/indra/llui/llresmgr.cpp
@@ -45,33 +45,6 @@ LLResMgr::LLResMgr()
void LLResMgr::setLocale( LLLOCALE_ID locale_id )
{
mLocale = locale_id;
-
- //RN: for now, use normal 'C' locale for everything but specific UI input/output routines
-// switch( locale_id )
-// {
-// case LLLOCALE_USA:
-//#if LL_WINDOWS
-// // Windows doesn't use ISO country codes.
-// llinfos << "Setting locale to " << setlocale( LC_ALL, "english-usa" ) << llendl;
-//#else
-// // posix version should work everywhere else.
-// llinfos << "Setting locale to " << setlocale( LC_ALL, "en_US" ) << llendl;
-//#endif
-// break;
-// case LLLOCALE_UK:
-//#if LL_WINDOWS
-// // Windows doesn't use ISO country codes.
-// llinfos << "Setting locale to " << setlocale( LC_ALL, "english-uk" ) << llendl;
-//#else
-// // posix version should work everywhere else.
-// llinfos << "Setting locale to " << setlocale( LC_ALL, "en_GB" ) << llendl;
-//#endif
-// break;
-// default:
-// llassert(0);
-// setLocale(LLLOCALE_USA);
-// break;
-// }
}
char LLResMgr::getDecimalPoint() const
@@ -342,7 +315,7 @@ LLLocale::LLLocale(const std::string& locale_string)
}
//else
//{
- // llinfos << "Set locale to " << new_locale_string << llendl;
+ // LL_INFOS() << "Set locale to " << new_locale_string << LL_ENDL;
//}
}
diff --git a/indra/llui/llrngwriter.cpp b/indra/llui/llrngwriter.cpp
index 5e6840d7df..cd9fe3610e 100755
--- a/indra/llui/llrngwriter.cpp
+++ b/indra/llui/llrngwriter.cpp
@@ -29,6 +29,7 @@
#include "llrngwriter.h"
#include "lluicolor.h"
#include "lluictrlfactory.h"
+#include "boost/bind.hpp"
static LLInitParam::Parser::parser_read_func_map_t sReadFuncs;
static LLInitParam::Parser::parser_write_func_map_t sWriteFuncs;
diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp
index 13887cbe73..76134144a0 100755
--- a/indra/llui/llscrollbar.cpp
+++ b/indra/llui/llscrollbar.cpp
@@ -381,7 +381,7 @@ BOOL LLScrollbar::handleHover(S32 x, S32 y, MASK mask)
}
getWindow()->setCursor(UI_CURSOR_ARROW);
- lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << LL_ENDL;
handled = TRUE;
}
else
@@ -393,7 +393,7 @@ BOOL LLScrollbar::handleHover(S32 x, S32 y, MASK mask)
if( !handled )
{
getWindow()->setCursor(UI_CURSOR_ARROW);
- lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << LL_ENDL;
handled = TRUE;
}
@@ -493,11 +493,11 @@ void LLScrollbar::draw()
BOOL hovered = getEnabled() && !other_captor && (hasMouseCapture() || mThumbRect.pointInRect(local_mouse_x, local_mouse_y));
if (hovered)
{
- mCurGlowStrength = lerp(mCurGlowStrength, mHoverGlowStrength, LLCriticalDamp::getInterpolant(0.05f));
+ mCurGlowStrength = lerp(mCurGlowStrength, mHoverGlowStrength, LLSmoothInterpolation::getInterpolant(0.05f));
}
else
{
- mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLCriticalDamp::getInterpolant(0.05f));
+ mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLSmoothInterpolation::getInterpolant(0.05f));
}
// Draw background and thumb.
diff --git a/indra/llui/llscrollbar.h b/indra/llui/llscrollbar.h
index 21fd2d631e..e2bf52c14b 100755
--- a/indra/llui/llscrollbar.h
+++ b/indra/llui/llscrollbar.h
@@ -40,13 +40,11 @@ class LLScrollbar
{
public:
- enum ORIENTATION { HORIZONTAL, VERTICAL };
-
typedef boost::function<void (S32, LLScrollbar*)> callback_t;
struct Params
: public LLInitParam::Block<Params, LLUICtrl::Params>
{
- Mandatory<ORIENTATION> orientation;
+ Mandatory<EOrientation> orientation;
Mandatory<S32> doc_size;
Mandatory<S32> doc_pos;
Mandatory<S32> page_size;
@@ -124,7 +122,7 @@ public:
void onLineUpBtnPressed(const LLSD& data);
void onLineDownBtnPressed(const LLSD& data);
-
+
S32 getThickness() const { return mThickness; }
void setThickness(S32 thickness);
@@ -134,7 +132,7 @@ private:
callback_t mChangeCallback;
- const ORIENTATION mOrientation;
+ const EOrientation mOrientation;
S32 mDocSize; // Size of the document that the scrollbar is modeling. Units depend on the user. 0 <= mDocSize.
S32 mDocPos; // Position within the doc that the scrollbar is modeling, in "lines" (user size)
S32 mPageSize; // Maximum number of lines that can be seen at one time.
diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp
index 238eae21c2..8c506d76bb 100755
--- a/indra/llui/llscrollcontainer.cpp
+++ b/indra/llui/llscrollcontainer.cpp
@@ -144,7 +144,7 @@ LLScrollContainer::~LLScrollContainer( void )
{
// mScrolledView and mScrollbar are child views, so the LLView
// destructor takes care of memory deallocation.
- for( S32 i = 0; i < SCROLLBAR_COUNT; i++ )
+ for( S32 i = 0; i < ORIENTATION_COUNT; i++ )
{
mScrollbar[i] = NULL;
}
@@ -155,7 +155,6 @@ LLScrollContainer::~LLScrollContainer( void )
// virtual
void LLScrollContainer::scrollHorizontal( S32 new_pos )
{
- //llinfos << "LLScrollContainer::scrollHorizontal()" << llendl;
if( mScrolledView )
{
LLRect doc_rect = mScrolledView->getRect();
@@ -167,7 +166,6 @@ void LLScrollContainer::scrollHorizontal( S32 new_pos )
// virtual
void LLScrollContainer::scrollVertical( S32 new_pos )
{
- // llinfos << "LLScrollContainer::scrollVertical() " << new_pos << llendl;
if( mScrolledView )
{
LLRect doc_rect = mScrolledView->getRect();
@@ -215,7 +213,7 @@ BOOL LLScrollContainer::handleKeyHere(KEY key, MASK mask)
{
return TRUE;
}
- for( S32 i = 0; i < SCROLLBAR_COUNT; i++ )
+ for( S32 i = 0; i < ORIENTATION_COUNT; i++ )
{
if( mScrollbar[i]->handleKeyHere(key, mask) )
{
@@ -645,7 +643,7 @@ void LLScrollContainer::scrollToShowRect(const LLRect& rect, const LLRect& const
{
if (!mScrolledView)
{
- llwarns << "LLScrollContainer::scrollToShowRect with no view!" << llendl;
+ LL_WARNS() << "LLScrollContainer::scrollToShowRect with no view!" << LL_ENDL;
return;
}
diff --git a/indra/llui/llscrollcontainer.h b/indra/llui/llscrollcontainer.h
index 4eb43539b8..f64cf43a8e 100755
--- a/indra/llui/llscrollcontainer.h
+++ b/indra/llui/llscrollcontainer.h
@@ -31,7 +31,6 @@
#ifndef LL_V4COLOR_H
#include "v4color.h"
#endif
-#include "stdenums.h"
#include "llcoord.h"
#include "llscrollbar.h"
@@ -56,7 +55,6 @@ class LLScrollContainer : public LLUICtrl
public:
// Note: vertical comes before horizontal because vertical
// scrollbars have priority for mouse and keyboard events.
- enum SCROLL_ORIENTATION { VERTICAL, HORIZONTAL, SCROLLBAR_COUNT };
struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
{
@@ -130,7 +128,7 @@ private:
void updateScroll();
void calcVisibleSize( S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const;
- LLScrollbar* mScrollbar[SCROLLBAR_COUNT];
+ LLScrollbar* mScrollbar[ORIENTATION_COUNT];
S32 mSize;
BOOL mIsOpaque;
LLUIColor mBackgroundColor;
diff --git a/indra/llui/llscrollingpanellist.cpp b/indra/llui/llscrollingpanellist.cpp
index 9b65c2b79d..b6f2eb8ba2 100755
--- a/indra/llui/llscrollingpanellist.cpp
+++ b/indra/llui/llscrollingpanellist.cpp
@@ -111,7 +111,7 @@ void LLScrollingPanelList::removePanel( U32 panel_index )
{
if ( mPanelList.empty() || panel_index >= mPanelList.size() )
{
- llwarns << "Panel index " << panel_index << " is out of range!" << llendl;
+ LL_WARNS() << "Panel index " << panel_index << " is out of range!" << LL_ENDL;
return;
}
else
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index d4bbea0f8e..5f72ee3ac6 100755
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -1449,7 +1449,7 @@ void LLScrollListCtrl::drawItems()
LLColor4 highlight_color = LLColor4::white;
static LLUICachedControl<F32> type_ahead_timeout ("TypeAheadTimeout", 0);
- highlight_color.mV[VALPHA] = clamp_rescale(mSearchTimer.getElapsedTimeF32(), type_ahead_timeout * 0.7f, type_ahead_timeout, 0.4f, 0.f);
+ highlight_color.mV[VALPHA] = clamp_rescale(mSearchTimer.getElapsedTimeF32(), type_ahead_timeout * 0.7f, type_ahead_timeout(), 0.4f, 0.f);
S32 first_line = mScrollLines;
S32 last_line = llmin((S32)mItemList.size() - 1, mScrollLines + getLinesPerPage());
@@ -1470,8 +1470,6 @@ void LLScrollListCtrl::drawItems()
mLineHeight );
item->setRect(item_rect);
- //llinfos << item_rect.getWidth() << llendl;
-
max_columns = llmax(max_columns, item->getNumColumns());
LLColor4 fg_color;
@@ -1817,6 +1815,7 @@ BOOL LLScrollListCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
// create the context menu from the XUI file and display it
std::string menu_name = is_group ? "menu_url_group.xml" : "menu_url_agent.xml";
delete mPopupMenu;
+ llassert(LLMenuGL::sMenuContainer != NULL);
mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>(
menu_name, LLMenuGL::sMenuContainer, LLMenuHolderGL::child_registry_t::instance());
if (mPopupMenu)
@@ -2844,10 +2843,10 @@ LLScrollListColumn* LLScrollListCtrl::getColumn(const std::string& name)
return NULL;
}
-LLFastTimer::DeclareTimer FTM_ADD_SCROLLLIST_ELEMENT("Add Scroll List Item");
+LLTrace::BlockTimerStatHandle FTM_ADD_SCROLLLIST_ELEMENT("Add Scroll List Item");
LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& element, EAddPosition pos, void* userdata)
{
- LLFastTimer _(FTM_ADD_SCROLLLIST_ELEMENT);
+ LL_RECORD_BLOCK_TIME(FTM_ADD_SCROLLLIST_ELEMENT);
LLScrollListItem::Params item_params;
LLParamSDParser parser;
parser.readSD(element, item_params);
@@ -2857,14 +2856,14 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& element, EAddPosition
LLScrollListItem* LLScrollListCtrl::addRow(const LLScrollListItem::Params& item_p, EAddPosition pos)
{
- LLFastTimer _(FTM_ADD_SCROLLLIST_ELEMENT);
+ LL_RECORD_BLOCK_TIME(FTM_ADD_SCROLLLIST_ELEMENT);
LLScrollListItem *new_item = new LLScrollListItem(item_p);
return addRow(new_item, item_p, pos);
}
LLScrollListItem* LLScrollListCtrl::addRow(LLScrollListItem *new_item, const LLScrollListItem::Params& item_p, EAddPosition pos)
{
- LLFastTimer _(FTM_ADD_SCROLLLIST_ELEMENT);
+ LL_RECORD_BLOCK_TIME(FTM_ADD_SCROLLLIST_ELEMENT);
if (!item_p.validateBlock() || !new_item) return NULL;
new_item->setNumColumns(mColumns.size());
diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h
index c61e281a31..6325a79cd5 100755
--- a/indra/llui/llscrolllistctrl.h
+++ b/indra/llui/llscrolllistctrl.h
@@ -34,7 +34,6 @@
#include "lluictrl.h"
#include "llctrlselectioninterface.h"
-//#include "lldarray.h"
#include "llfontgl.h"
#include "llui.h"
#include "llstring.h" // LLWString
diff --git a/indra/llui/llscrolllistitem.cpp b/indra/llui/llscrolllistitem.cpp
index cc7f42e49a..df22c88afb 100755
--- a/indra/llui/llscrolllistitem.cpp
+++ b/indra/llui/llscrolllistitem.cpp
@@ -83,7 +83,7 @@ void LLScrollListItem::setColumn( S32 column, LLScrollListCell *cell )
}
else
{
- llerrs << "LLScrollListItem::setColumn: bad column: " << column << llendl;
+ LL_ERRS() << "LLScrollListItem::setColumn: bad column: " << column << LL_ENDL;
}
}
diff --git a/indra/llui/llslider.cpp b/indra/llui/llslider.cpp
index db72234f94..ebbb951ee6 100755
--- a/indra/llui/llslider.cpp
+++ b/indra/llui/llslider.cpp
@@ -188,12 +188,12 @@ BOOL LLSlider::handleHover(S32 x, S32 y, MASK mask)
setValueAndCommit(t * (mMaxValue - mMinValue) + mMinValue );
}
getWindow()->setCursor(UI_CURSOR_ARROW);
- lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << LL_ENDL;
}
else
{
getWindow()->setCursor(UI_CURSOR_ARROW);
- lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (inactive)" << LL_ENDL;
}
return TRUE;
}
diff --git a/indra/llui/llslider.h b/indra/llui/llslider.h
index 700c17ea3e..3b492d8182 100755
--- a/indra/llui/llslider.h
+++ b/indra/llui/llslider.h
@@ -34,8 +34,6 @@
class LLSlider : public LLF32UICtrl
{
public:
- enum ORIENTATION { HORIZONTAL, VERTICAL };
-
struct Params : public LLInitParam::Block<Params, LLF32UICtrl::Params>
{
Optional<std::string> orientation;
@@ -98,7 +96,7 @@ private:
LLPointer<LLUIImage> mTrackHighlightHorizontalImage;
LLPointer<LLUIImage> mTrackHighlightVerticalImage;
- const ORIENTATION mOrientation;
+ const EOrientation mOrientation;
LLRect mThumbRect;
LLUIColor mTrackColor;
diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp
index 583ed1ed2e..62c5ecb8f1 100755
--- a/indra/llui/llsliderctrl.cpp
+++ b/indra/llui/llsliderctrl.cpp
@@ -403,7 +403,7 @@ void LLSliderCtrl::setPrecision(S32 precision)
{
if (precision < 0 || precision > 10)
{
- llerrs << "LLSliderCtrl::setPrecision - precision out of range" << llendl;
+ LL_ERRS() << "LLSliderCtrl::setPrecision - precision out of range" << LL_ENDL;
return;
}
diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp
index 8a728df2e7..ebdbdf59c0 100755
--- a/indra/llui/llspinctrl.cpp
+++ b/indra/llui/llspinctrl.cpp
@@ -384,7 +384,7 @@ void LLSpinCtrl::setPrecision(S32 precision)
{
if (precision < 0 || precision > 10)
{
- llerrs << "LLSpinCtrl::setPrecision - precision out of range" << llendl;
+ LL_ERRS() << "LLSpinCtrl::setPrecision - precision out of range" << LL_ENDL;
return;
}
@@ -400,7 +400,7 @@ void LLSpinCtrl::setLabel(const LLStringExplicit& label)
}
else
{
- llwarns << "Attempting to set label on LLSpinCtrl constructed without one " << getName() << llendl;
+ LL_WARNS() << "Attempting to set label on LLSpinCtrl constructed without one " << getName() << LL_ENDL;
}
updateLabelColor();
}
diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp
index 04cce7878e..1bd2bc06f4 100755
--- a/indra/llui/llstatbar.cpp
+++ b/indra/llui/llstatbar.cpp
@@ -34,234 +34,560 @@
#include "llgl.h"
#include "llfontgl.h"
-#include "llstat.h"
#include "lluictrlfactory.h"
+#include "lltracerecording.h"
+#include "llcriticaldamp.h"
+#include "lltooltip.h"
+#include "lllocalcliprect.h"
+#include <iostream>
+
+// rate at which to update display of value that is rapidly changing
+const F32 MEAN_VALUE_UPDATE_TIME = 1.f / 4.f;
+// time between value changes that qualifies as a "rapid change"
+const F32Seconds RAPID_CHANGE_THRESHOLD(0.2f);
+// maximum number of rapid changes in RAPID_CHANGE_WINDOW before switching over to displaying the mean
+// instead of latest value
+const S32 MAX_RAPID_CHANGES_PER_SEC = 10;
+// period of time over which to measure rapid changes
+const F32Seconds RAPID_CHANGE_WINDOW(1.f);
+
+F32 calc_tick_value(F32 min, F32 max)
+{
+ F32 range = max - min;
+ const S32 DIVISORS[] = {6, 8, 10, 4, 5};
+ // try storing
+ S32 best_decimal_digit_count = S32_MAX;
+ S32 best_divisor = 10;
+ for (U32 divisor_idx = 0; divisor_idx < LL_ARRAY_SIZE(DIVISORS); divisor_idx++)
+ {
+ S32 divisor = DIVISORS[divisor_idx];
+ F32 possible_tick_value = range / divisor;
+ S32 num_whole_digits = llceil(logf(llabs(min + possible_tick_value)) * OO_LN10);
+ for (S32 digit_count = -(num_whole_digits - 1); digit_count < 6; digit_count++)
+ {
+ F32 test_tick_value = min + (possible_tick_value * pow(10.0, digit_count));
-///////////////////////////////////////////////////////////////////////////////////
+ if (is_approx_equal((F32)(S32)test_tick_value, test_tick_value))
+ {
+ if (digit_count < best_decimal_digit_count)
+ {
+ best_decimal_digit_count = digit_count;
+ best_divisor = divisor;
+ }
+ break;
+ }
+ }
+ }
-LLStatBar::LLStatBar(const Params& p)
- : LLView(p),
- mLabel(p.label),
- mUnitLabel(p.unit_label),
- mMinBar(p.bar_min),
- mMaxBar(p.bar_max),
- mStatp(LLStat::getStat(p.stat)),
- mTickSpacing(p.tick_spacing),
- mLabelSpacing(p.label_spacing),
- mPrecision(p.precision),
- mUpdatesPerSec(p.update_rate),
- mPerSec(p.show_per_sec),
- mDisplayBar(p.show_bar),
- mDisplayHistory(p.show_history),
- mDisplayMean(p.show_mean)
-{
+ return is_approx_equal(range, 0.f) ? 0.f : range / best_divisor;
}
-BOOL LLStatBar::handleMouseDown(S32 x, S32 y, MASK mask)
+void calc_auto_scale_range(F32& min, F32& max, F32& tick)
{
- if (mDisplayBar)
+ min = llmin(0.f, min, max);
+ max = llmax(0.f, min, max);
+
+ const F32 RANGES[] = {0.f, 1.f, 1.5f, 2.f, 3.f, 5.f, 10.f};
+ const F32 TICKS[] = {0.f, 0.25f, 0.5f, 1.f, 1.f, 1.f, 2.f };
+
+ const S32 num_digits_max = is_approx_equal(llabs(max), 0.f)
+ ? S32_MIN + 1
+ : llceil(logf(llabs(max)) * OO_LN10);
+ const S32 num_digits_min = is_approx_equal(llabs(min), 0.f)
+ ? S32_MIN + 1
+ : llceil(logf(llabs(min)) * OO_LN10);
+
+ const S32 num_digits = llmax(num_digits_max, num_digits_min);
+ const F32 power_of_10 = pow(10.0, num_digits - 1);
+ const F32 starting_max = power_of_10 * ((max < 0.f) ? -1 : 1);
+ const F32 starting_min = power_of_10 * ((min < 0.f) ? -1 : 1);
+
+ F32 cur_max = starting_max;
+ F32 cur_min = starting_min;
+ F32 out_max = max;
+ F32 out_min = min;
+
+ F32 cur_tick_min = 0.f;
+ F32 cur_tick_max = 0.f;
+
+ for (S32 range_idx = 0; range_idx < LL_ARRAY_SIZE(RANGES); range_idx++)
{
- if (mDisplayHistory)
+ cur_max = starting_max * RANGES[range_idx];
+ cur_min = starting_min * RANGES[range_idx];
+
+ if (min > 0.f && cur_min <= min)
{
- mDisplayBar = FALSE;
- mDisplayHistory = FALSE;
+ out_min = cur_min;
+ cur_tick_min = TICKS[range_idx];
}
- else
+ if (max < 0.f && cur_max >= max)
{
- mDisplayHistory = TRUE;
+ out_max = cur_max;
+ cur_tick_max = TICKS[range_idx];
}
}
- else
+
+ cur_max = starting_max;
+ cur_min = starting_min;
+ for (S32 range_idx = LL_ARRAY_SIZE(RANGES) - 1; range_idx >= 0; range_idx--)
{
- mDisplayBar = TRUE;
+ cur_max = starting_max * RANGES[range_idx];
+ cur_min = starting_min * RANGES[range_idx];
+
+ if (min < 0.f && cur_min <= min)
+ {
+ out_min = cur_min;
+ cur_tick_min = TICKS[range_idx];
+ }
+ if (max > 0.f && cur_max >= max)
+ {
+ out_max = cur_max;
+ cur_tick_max = TICKS[range_idx];
+ }
}
- LLView* parent = getParent();
- parent->reshape(parent->getRect().getWidth(), parent->getRect().getHeight(), FALSE);
+ tick = power_of_10 * llmax(cur_tick_min, cur_tick_max);
+ min = out_min;
+ max = out_max;
+}
- return FALSE;
+LLStatBar::Params::Params()
+: label("label"),
+ unit_label("unit_label"),
+ bar_min("bar_min", 0.f),
+ bar_max("bar_max", 0.f),
+ tick_spacing("tick_spacing", 0.f),
+ decimal_digits("decimal_digits", 3),
+ show_bar("show_bar", false),
+ show_history("show_history", false),
+ scale_range("scale_range", true),
+ num_frames("num_frames", 200),
+ num_frames_short("num_frames_short", 20),
+ max_height("max_height", 100),
+ stat("stat"),
+ orientation("orientation", VERTICAL)
+{
+ changeDefault(follows.flags, FOLLOWS_TOP | FOLLOWS_LEFT);
}
-void LLStatBar::draw()
+///////////////////////////////////////////////////////////////////////////////////
+
+LLStatBar::LLStatBar(const Params& p)
+: LLView(p),
+ mLabel(p.label),
+ mUnitLabel(p.unit_label),
+ mTargetMinBar(llmin(p.bar_min, p.bar_max)),
+ mTargetMaxBar(llmax(p.bar_max, p.bar_min)),
+ mCurMaxBar(p.bar_max),
+ mCurMinBar(0),
+ mDecimalDigits(p.decimal_digits),
+ mNumHistoryFrames(p.num_frames),
+ mNumShortHistoryFrames(p.num_frames_short),
+ mMaxHeight(p.max_height),
+ mDisplayBar(p.show_bar),
+ mDisplayHistory(p.show_history),
+ mOrientation(p.orientation),
+ mAutoScaleMax(!p.bar_max.isProvided()),
+ mAutoScaleMin(!p.bar_min.isProvided()),
+ mTickSpacing(p.tick_spacing),
+ mLastDisplayValue(0.f),
+ mStatType(STAT_NONE)
{
- if (!mStatp)
- {
-// llinfos << "No stats for statistics bar!" << llendl;
- return;
- }
+ mFloatingTargetMinBar = mTargetMinBar;
+ mFloatingTargetMaxBar = mTargetMaxBar;
- // Get the values.
- F32 current, min, max, mean;
- if (mPerSec)
+ mStat.valid = NULL;
+ // tick value will be automatically calculated later
+ if (!p.tick_spacing.isProvided() && p.bar_min.isProvided() && p.bar_max.isProvided())
{
- current = mStatp->getCurrentPerSec();
- min = mStatp->getMinPerSec();
- max = mStatp->getMaxPerSec();
- mean = mStatp->getMeanPerSec();
+ mTickSpacing = calc_tick_value(mTargetMinBar, mTargetMaxBar);
}
- else
+
+ setStat(p.stat);
+}
+
+BOOL LLStatBar::handleHover(S32 x, S32 y, MASK mask)
+{
+ switch(mStatType)
{
- current = mStatp->getCurrent();
- min = mStatp->getMin();
- max = mStatp->getMax();
- mean = mStatp->getMean();
+ case STAT_COUNT:
+ LLToolTipMgr::instance().show(LLToolTip::Params().message(mStat.countStatp->getDescription()).sticky_rect(calcScreenRect()));
+ break;
+ case STAT_EVENT:
+ LLToolTipMgr::instance().show(LLToolTip::Params().message(mStat.eventStatp->getDescription()).sticky_rect(calcScreenRect()));
+ break;
+ case STAT_SAMPLE:
+ LLToolTipMgr::instance().show(LLToolTip::Params().message(mStat.sampleStatp->getDescription()).sticky_rect(calcScreenRect()));
+ break;
+ case STAT_MEM:
+ LLToolTipMgr::instance().show(LLToolTip::Params().message(mStat.memStatp->getDescription()).sticky_rect(calcScreenRect()));
+ break;
+ default:
+ break;
}
+ return TRUE;
+}
-
- if ((mUpdatesPerSec == 0.f) || (mUpdateTimer.getElapsedTimeF32() > 1.f/mUpdatesPerSec) || (mValue == 0.f))
+BOOL LLStatBar::handleMouseDown(S32 x, S32 y, MASK mask)
+{
+ BOOL handled = LLView::handleMouseDown(x, y, mask);
+ if (!handled)
{
- if (mDisplayMean)
+ if (mDisplayBar)
{
- mValue = mean;
+ if (mDisplayHistory || mOrientation == HORIZONTAL)
+ {
+ mDisplayBar = FALSE;
+ mDisplayHistory = FALSE;
+ }
+ else
+ {
+ mDisplayHistory = TRUE;
+ }
}
else
{
- mValue = current;
+ mDisplayBar = TRUE;
+ if (mOrientation == HORIZONTAL)
+ {
+ mDisplayHistory = TRUE;
+ }
}
- mUpdateTimer.reset();
+ LLView* parent = getParent();
+ parent->reshape(parent->getRect().getWidth(), parent->getRect().getHeight(), FALSE);
}
+ return TRUE;
+}
- S32 width = getRect().getWidth() - 40;
- S32 max_width = width;
- S32 bar_top = getRect().getHeight() - 15; // 16 pixels from top.
- S32 bar_height = bar_top - 20;
- S32 tick_height = 4;
- S32 tick_width = 1;
- S32 left, top, right, bottom;
+template<typename T>
+S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const T& stat, const F32Seconds time_period)
+{
+ F32Seconds elapsed_time,
+ time_since_value_changed;
+ S32 num_rapid_changes = 0;
+ const F32Seconds RAPID_CHANGE_THRESHOLD = F32Seconds(0.3f);
+ F64 last_value = periodic_recording.getPrevRecording(1).getLastValue(stat);
- F32 value_scale = max_width/(mMaxBar - mMinBar);
+ for (S32 i = 2; i < periodic_recording.getNumRecordedPeriods(); i++)
+ {
+ LLTrace::Recording& recording = periodic_recording.getPrevRecording(i);
+ F64 cur_value = recording.getLastValue(stat);
- LLFontGL::getFontMonospace()->renderUTF8(mLabel, 0, 0, getRect().getHeight(), LLColor4(1.f, 1.f, 1.f, 1.f),
- LLFontGL::LEFT, LLFontGL::TOP);
+ if (last_value != cur_value)
+ {
+ if (time_since_value_changed < RAPID_CHANGE_THRESHOLD) num_rapid_changes++;
+ time_since_value_changed = (F32Seconds)0;
+ }
+ last_value = cur_value;
+
+ elapsed_time += recording.getDuration();
+ if (elapsed_time > time_period) break;
+ }
- std::string value_format;
- std::string value_str;
- if (!mUnitLabel.empty())
+ return num_rapid_changes;
+}
+
+void LLStatBar::draw()
+{
+ LLLocalClipRect _(getLocalRect());
+
+ LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording();
+ LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording();
+
+ std::string unit_label;
+ F32 current = 0,
+ min = 0,
+ max = 0,
+ mean = 0,
+ display_value = 0;
+ S32 num_frames = mDisplayHistory
+ ? mNumHistoryFrames
+ : mNumShortHistoryFrames;
+ S32 num_rapid_changes = 0;
+ S32 decimal_digits = mDecimalDigits;
+
+ switch(mStatType)
{
- value_format = llformat( "%%.%df%%s", mPrecision);
- value_str = llformat( value_format.c_str(), mValue, mUnitLabel.c_str());
+ case STAT_COUNT:
+ {
+ const LLTrace::StatType<LLTrace::CountAccumulator>& count_stat = *mStat.countStatp;
+
+ unit_label = std::string(count_stat.getUnitLabel()) + "/s";
+ current = last_frame_recording.getPerSec(count_stat);
+ min = frame_recording.getPeriodMinPerSec(count_stat, num_frames);
+ max = frame_recording.getPeriodMaxPerSec(count_stat, num_frames);
+ mean = frame_recording.getPeriodMeanPerSec(count_stat, num_frames);
+ display_value = mean;
+ }
+ break;
+ case STAT_EVENT:
+ {
+ const LLTrace::StatType<LLTrace::EventAccumulator>& event_stat = *mStat.eventStatp;
+
+ unit_label = mUnitLabel.empty() ? event_stat.getUnitLabel() : mUnitLabel;
+ current = last_frame_recording.getLastValue(event_stat);
+ min = frame_recording.getPeriodMin(event_stat, num_frames);
+ max = frame_recording.getPeriodMax(event_stat, num_frames);
+ mean = frame_recording.getPeriodMean(event_stat, num_frames);
+ display_value = mean;
+ }
+ break;
+ case STAT_SAMPLE:
+ {
+ const LLTrace::StatType<LLTrace::SampleAccumulator>& sample_stat = *mStat.sampleStatp;
+
+ unit_label = mUnitLabel.empty() ? sample_stat.getUnitLabel() : mUnitLabel;
+ current = last_frame_recording.getLastValue(sample_stat);
+ min = frame_recording.getPeriodMin(sample_stat, num_frames);
+ max = frame_recording.getPeriodMax(sample_stat, num_frames);
+ mean = frame_recording.getPeriodMean(sample_stat, num_frames);
+ num_rapid_changes = calc_num_rapid_changes(frame_recording, sample_stat, RAPID_CHANGE_WINDOW);
+
+ if (num_rapid_changes / RAPID_CHANGE_WINDOW.value() > MAX_RAPID_CHANGES_PER_SEC)
+ {
+ display_value = mean;
+ }
+ else
+ {
+ display_value = current;
+ // always display current value, don't rate limit
+ mLastDisplayValue = current;
+ if (is_approx_equal((F32)(S32)display_value, display_value))
+ {
+ decimal_digits = 0;
+ }
+ }
+ }
+ break;
+ case STAT_MEM:
+ {
+ const LLTrace::StatType<LLTrace::MemAccumulator>& mem_stat = *mStat.memStatp;
+
+ unit_label = mUnitLabel.empty() ? mem_stat.getUnitLabel() : mUnitLabel;
+ current = last_frame_recording.getLastValue(mem_stat).value();
+ min = frame_recording.getPeriodMin(mem_stat, num_frames).value();
+ max = frame_recording.getPeriodMax(mem_stat, num_frames).value();
+ mean = frame_recording.getPeriodMean(mem_stat, num_frames).value();
+ display_value = current;
+ }
+ break;
+ default:
+ break;
}
- else
+
+ LLRect bar_rect;
+ if (mOrientation == HORIZONTAL)
{
- value_format = llformat( "%%.%df", mPrecision);
- value_str = llformat( value_format.c_str(), mValue);
+ bar_rect.mTop = llmax(5, getRect().getHeight() - 15);
+ bar_rect.mLeft = 0;
+ bar_rect.mRight = getRect().getWidth() - 40;
+ bar_rect.mBottom = llmin(bar_rect.mTop - 5, 0);
+ }
+ else // VERTICAL
+ {
+ bar_rect.mTop = llmax(5, getRect().getHeight() - 15);
+ bar_rect.mLeft = 0;
+ bar_rect.mRight = getRect().getWidth();
+ bar_rect.mBottom = llmin(bar_rect.mTop - 5, 20);
}
- // Draw the value.
- LLFontGL::getFontMonospace()->renderUTF8(value_str, 0, width, getRect().getHeight(),
- LLColor4(1.f, 1.f, 1.f, 0.5f),
- LLFontGL::RIGHT, LLFontGL::TOP);
+ mCurMaxBar = LLSmoothInterpolation::lerp(mCurMaxBar, mTargetMaxBar, 0.05f);
+ mCurMinBar = LLSmoothInterpolation::lerp(mCurMinBar, mTargetMinBar, 0.05f);
- value_format = llformat( "%%.%df", mPrecision);
- if (mDisplayBar)
+ // rate limited updates
+ if (mLastDisplayValueTimer.getElapsedTimeF32() < MEAN_VALUE_UPDATE_TIME)
{
- std::string tick_label;
+ display_value = mLastDisplayValue;
+ }
+ else
+ {
+ mLastDisplayValueTimer.reset();
+ }
+ drawLabelAndValue(display_value, unit_label, bar_rect, decimal_digits);
+ mLastDisplayValue = display_value;
+ if (mDisplayBar && mStat.valid)
+ {
// Draw the tick marks.
- F32 tick_value;
- top = bar_top;
- bottom = bar_top - bar_height - tick_height/2;
-
LLGLSUIDefault gls_ui;
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
- for (tick_value = mMinBar; tick_value <= mMaxBar; tick_value += mTickSpacing)
+ F32 value_scale;
+ if (mCurMaxBar == mCurMinBar)
{
- left = llfloor((tick_value - mMinBar)*value_scale);
- right = left + tick_width;
- gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 1.f, 1.f, 0.1f));
+ value_scale = 0.f;
}
-
- // Draw the tick labels (and big ticks).
- bottom = bar_top - bar_height - tick_height;
- for (tick_value = mMinBar; tick_value <= mMaxBar; tick_value += mLabelSpacing)
+ else
{
- left = llfloor((tick_value - mMinBar)*value_scale);
- right = left + tick_width;
- gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 1.f, 1.f, 0.25f));
-
- tick_label = llformat( value_format.c_str(), tick_value);
- // draw labels for the tick marks
- LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, left - 1, bar_top - bar_height - tick_height,
- LLColor4(1.f, 1.f, 1.f, 0.5f),
- LLFontGL::LEFT, LLFontGL::TOP);
+ value_scale = (mOrientation == HORIZONTAL)
+ ? (bar_rect.getHeight())/(mCurMaxBar - mCurMinBar)
+ : (bar_rect.getWidth())/(mCurMaxBar - mCurMinBar);
}
- // Now, draw the bars
- top = bar_top;
- bottom = bar_top - bar_height;
+ drawTicks(min, max, value_scale, bar_rect);
// draw background bar.
- left = 0;
- right = width;
- gl_rect_2d(left, top, right, bottom, LLColor4(0.f, 0.f, 0.f, 0.25f));
+ gl_rect_2d(bar_rect.mLeft, bar_rect.mTop, bar_rect.mRight, bar_rect.mBottom, LLColor4(0.f, 0.f, 0.f, 0.25f));
- if (mStatp->getNumValues() == 0)
+ // draw values
+ if (!llisnan(display_value) && frame_recording.getNumRecordedPeriods() != 0)
{
- // No data, don't draw anything...
- return;
- }
- // draw min and max
- left = (S32) ((min - mMinBar) * value_scale);
+ // draw min and max
+ S32 begin = (S32) ((min - mCurMinBar) * value_scale);
- if (left < 0)
- {
- left = 0;
- llwarns << "Min:" << min << llendl;
- }
+ if (begin < 0)
+ {
+ begin = 0;
+ }
- right = (S32) ((max - mMinBar) * value_scale);
- gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 0.f, 0.f, 0.25f));
+ S32 end = (S32) ((max - mCurMinBar) * value_scale);
+ if (mOrientation == HORIZONTAL)
+ {
+ gl_rect_2d(bar_rect.mLeft, end, bar_rect.mRight, begin, LLColor4(1.f, 0.f, 0.f, 0.25f));
+ }
+ else // VERTICAL
+ {
+ gl_rect_2d(begin, bar_rect.mTop, end, bar_rect.mBottom, LLColor4(1.f, 0.f, 0.f, 0.25f));
+ }
- S32 num_values = mStatp->getNumValues() - 1;
- if (mDisplayHistory)
- {
- S32 i;
- for (i = 0; i < num_values; i++)
+ F32 span = (mOrientation == HORIZONTAL)
+ ? (bar_rect.getWidth())
+ : (bar_rect.getHeight());
+
+ if (mDisplayHistory && mStat.valid)
{
- if (i == mStatp->getNextBin())
+ const S32 num_values = frame_recording.getNumRecordedPeriods() - 1;
+ F32 min_value = 0.f,
+ max_value = 0.f;
+
+ gGL.color4f(1.f, 0.f, 0.f, 1.f);
+ gGL.begin( LLRender::QUADS );
+ const S32 max_frame = llmin(num_frames, num_values);
+ U32 num_samples = 0;
+ for (S32 i = 1; i <= max_frame; i++)
{
- continue;
+ F32 offset = ((F32)i / (F32)num_frames) * span;
+ LLTrace::Recording& recording = frame_recording.getPrevRecording(i);
+
+ switch(mStatType)
+ {
+ case STAT_COUNT:
+ min_value = recording.getPerSec(*mStat.countStatp);
+ max_value = min_value;
+ num_samples = recording.getSampleCount(*mStat.countStatp);
+ break;
+ case STAT_EVENT:
+ min_value = recording.getMin(*mStat.eventStatp);
+ max_value = recording.getMax(*mStat.eventStatp);
+ num_samples = recording.getSampleCount(*mStat.eventStatp);
+ break;
+ case STAT_SAMPLE:
+ min_value = recording.getMin(*mStat.sampleStatp);
+ max_value = recording.getMax(*mStat.sampleStatp);
+ num_samples = recording.getSampleCount(*mStat.sampleStatp);
+ break;
+ case STAT_MEM:
+ min_value = recording.getMin(*mStat.memStatp).value();
+ max_value = recording.getMax(*mStat.memStatp).value();
+ num_samples = 1;
+ break;
+ default:
+ break;
+ }
+
+ if (!num_samples) continue;
+
+ F32 min = (min_value - mCurMinBar) * value_scale;
+ F32 max = llmax(min + 1, (max_value - mCurMinBar) * value_scale);
+ if (mOrientation == HORIZONTAL)
+ {
+ gGL.vertex2f((F32)bar_rect.mRight - offset, max);
+ gGL.vertex2f((F32)bar_rect.mRight - offset, min);
+ gGL.vertex2f((F32)bar_rect.mRight - offset - 1, min);
+ gGL.vertex2f((F32)bar_rect.mRight - offset - 1, max);
+ }
+ else
+ {
+ gGL.vertex2f(min, (F32)bar_rect.mBottom + offset + 1);
+ gGL.vertex2f(min, (F32)bar_rect.mBottom + offset);
+ gGL.vertex2f(max, (F32)bar_rect.mBottom + offset);
+ gGL.vertex2f(max, (F32)bar_rect.mBottom + offset + 1 );
+ }
}
- if (mPerSec)
+ gGL.end();
+ }
+ else
+ {
+ S32 begin = (S32) ((current - mCurMinBar) * value_scale) - 1;
+ S32 end = (S32) ((current - mCurMinBar) * value_scale) + 1;
+ // draw current
+ if (mOrientation == HORIZONTAL)
{
- left = (S32)((mStatp->getPrevPerSec(i) - mMinBar) * value_scale);
- right = (S32)((mStatp->getPrevPerSec(i) - mMinBar) * value_scale) + 1;
- gl_rect_2d(left, bottom+i+1, right, bottom+i, LLColor4(1.f, 0.f, 0.f, 1.f));
+ gl_rect_2d(bar_rect.mLeft, end, bar_rect.mRight, begin, LLColor4(1.f, 0.f, 0.f, 1.f));
}
else
{
- left = (S32)((mStatp->getPrev(i) - mMinBar) * value_scale);
- right = (S32)((mStatp->getPrev(i) - mMinBar) * value_scale) + 1;
- gl_rect_2d(left, bottom+i+1, right, bottom+i, LLColor4(1.f, 0.f, 0.f, 1.f));
+ gl_rect_2d(begin, bar_rect.mTop, end, bar_rect.mBottom, LLColor4(1.f, 0.f, 0.f, 1.f));
}
}
- }
- else
- {
- // draw current
- left = (S32) ((current - mMinBar) * value_scale) - 1;
- right = (S32) ((current - mMinBar) * value_scale) + 1;
- gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 0.f, 0.f, 1.f));
- }
- // draw mean bar
- top = bar_top + 2;
- bottom = bar_top - bar_height - 2;
- left = (S32) ((mean - mMinBar) * value_scale) - 1;
- right = (S32) ((mean - mMinBar) * value_scale) + 1;
- gl_rect_2d(left, top, right, bottom, LLColor4(0.f, 1.f, 0.f, 1.f));
+ // draw mean bar
+ {
+ const S32 begin = (S32) ((mean - mCurMinBar) * value_scale) - 1;
+ const S32 end = (S32) ((mean - mCurMinBar) * value_scale) + 1;
+ if (mOrientation == HORIZONTAL)
+ {
+ gl_rect_2d(bar_rect.mLeft - 2, begin, bar_rect.mRight + 2, end, LLColor4(0.f, 1.f, 0.f, 1.f));
+ }
+ else
+ {
+ gl_rect_2d(begin, bar_rect.mTop + 2, end, bar_rect.mBottom - 2, LLColor4(0.f, 1.f, 0.f, 1.f));
+ }
+ }
+ }
}
LLView::draw();
}
-void LLStatBar::setRange(F32 bar_min, F32 bar_max, F32 tick_spacing, F32 label_spacing)
+void LLStatBar::setStat(const std::string& stat_name)
+{
+ using namespace LLTrace;
+ const StatType<CountAccumulator>* count_stat;
+ const StatType<EventAccumulator>* event_stat;
+ const StatType<SampleAccumulator>* sample_stat;
+ const StatType<MemAccumulator>* mem_stat;
+
+ if ((count_stat = StatType<CountAccumulator>::getInstance(stat_name)))
+ {
+ mStat.countStatp = count_stat;
+ mStatType = STAT_COUNT;
+ }
+ else if ((event_stat = StatType<EventAccumulator>::getInstance(stat_name)))
+ {
+ mStat.eventStatp = event_stat;
+ mStatType = STAT_EVENT;
+ }
+ else if ((sample_stat = StatType<SampleAccumulator>::getInstance(stat_name)))
+ {
+ mStat.sampleStatp = sample_stat;
+ mStatType = STAT_SAMPLE;
+ }
+ else if ((mem_stat = StatType<MemAccumulator>::getInstance(stat_name)))
+ {
+ mStat.memStatp = mem_stat;
+ mStatType = STAT_MEM;
+ }
+}
+
+
+void LLStatBar::setRange(F32 bar_min, F32 bar_max)
{
- mMinBar = bar_min;
- mMaxBar = bar_max;
- mTickSpacing = tick_spacing;
- mLabelSpacing = label_spacing;
+ mTargetMinBar = llmin(bar_min, bar_max);
+ mTargetMaxBar = llmax(bar_min, bar_max);
+ mFloatingTargetMinBar = mTargetMinBar;
+ mFloatingTargetMaxBar = mTargetMaxBar;
+ mTickSpacing = calc_tick_value(mTargetMinBar, mTargetMaxBar);
}
LLRect LLStatBar::getRequiredRect()
@@ -272,7 +598,7 @@ LLRect LLStatBar::getRequiredRect()
{
if (mDisplayHistory)
{
- rect.mTop = 35 + mStatp->getNumBins();
+ rect.mTop = mMaxHeight;
}
else
{
@@ -285,3 +611,122 @@ LLRect LLStatBar::getRequiredRect()
}
return rect;
}
+
+void LLStatBar::drawLabelAndValue( F32 value, std::string &label, LLRect &bar_rect, S32 decimal_digits )
+{
+ LLFontGL::getFontMonospace()->renderUTF8(mLabel, 0, 0, getRect().getHeight(), LLColor4(1.f, 1.f, 1.f, 1.f),
+ LLFontGL::LEFT, LLFontGL::TOP);
+
+ std::string value_str = !llisnan(value)
+ ? llformat("%10.*f %s", decimal_digits, value, label.c_str())
+ : "n/a";
+
+ // Draw the current value.
+ if (mOrientation == HORIZONTAL)
+ {
+ LLFontGL::getFontMonospace()->renderUTF8(value_str, 0, bar_rect.mRight, getRect().getHeight(),
+ LLColor4(1.f, 1.f, 1.f, 0.5f),
+ LLFontGL::RIGHT, LLFontGL::TOP);
+ }
+ else
+ {
+ LLFontGL::getFontMonospace()->renderUTF8(value_str, 0, bar_rect.mRight, getRect().getHeight(),
+ LLColor4(1.f, 1.f, 1.f, 0.5f),
+ LLFontGL::RIGHT, LLFontGL::TOP);
+ }
+}
+
+void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect )
+{
+ if (mAutoScaleMax || mAutoScaleMin)
+ {
+ F32 u = LLSmoothInterpolation::getInterpolant(10.f);
+ mFloatingTargetMinBar = llmin(min, lerp(mFloatingTargetMinBar, min, u));
+ mFloatingTargetMaxBar = llmax(max, lerp(mFloatingTargetMaxBar, max, u));
+ F32 range_min = mAutoScaleMin ? mFloatingTargetMinBar : mTargetMinBar;
+ F32 range_max = mAutoScaleMax ? mFloatingTargetMaxBar : mTargetMaxBar;
+ F32 tick_value = 0.f;
+ calc_auto_scale_range(range_min, range_max, tick_value);
+ if (mAutoScaleMin) { mTargetMinBar = range_min; }
+ if (mAutoScaleMax) { mTargetMaxBar = range_max; }
+ if (mAutoScaleMin && mAutoScaleMax)
+ {
+ mTickSpacing = tick_value;
+ }
+ else
+ {
+ mTickSpacing = calc_tick_value(mTargetMinBar, mTargetMaxBar);
+ }
+ }
+
+ // start counting from actual min, not current, animating min, so that ticks don't float between numbers
+ // ensure ticks always hit 0
+ S32 last_tick = S32_MIN;
+ S32 last_label = S32_MIN;
+ if (mTickSpacing > 0.f && value_scale > 0.f)
+ {
+ const S32 MIN_TICK_SPACING = mOrientation == HORIZONTAL ? 20 : 30;
+ const S32 MIN_LABEL_SPACING = mOrientation == HORIZONTAL ? 30 : 60;
+ const S32 TICK_LENGTH = 4;
+ const S32 TICK_WIDTH = 1;
+
+ F32 start = mCurMinBar < 0.f
+ ? llceil(-mCurMinBar / mTickSpacing) * -mTickSpacing
+ : 0.f;
+ for (F32 tick_value = start; ;tick_value += mTickSpacing)
+ {
+ // clamp to S32_MAX / 2 to avoid floating point to integer overflow resulting in S32_MIN
+ const S32 tick_begin = llfloor(llmin((F32)(S32_MAX / 2), (tick_value - mCurMinBar)*value_scale));
+ const S32 tick_end = tick_begin + TICK_WIDTH;
+ if (tick_begin < last_tick + MIN_TICK_SPACING)
+ {
+ continue;
+ }
+ last_tick = tick_begin;
+
+ S32 decimal_digits = mDecimalDigits;
+ if (is_approx_equal((F32)(S32)tick_value, tick_value))
+ {
+ decimal_digits = 0;
+ }
+ std::string tick_label = llformat("%.*f", decimal_digits, tick_value);
+ S32 tick_label_width = LLFontGL::getFontMonospace()->getWidth(tick_label);
+ if (mOrientation == HORIZONTAL)
+ {
+ if (tick_begin > last_label + MIN_LABEL_SPACING)
+ {
+ gl_rect_2d(bar_rect.mLeft, tick_end, bar_rect.mRight - TICK_LENGTH, tick_begin, LLColor4(1.f, 1.f, 1.f, 0.25f));
+ LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, bar_rect.mRight, tick_begin,
+ LLColor4(1.f, 1.f, 1.f, 0.5f),
+ LLFontGL::LEFT, LLFontGL::VCENTER);
+ last_label = tick_begin;
+ }
+ else
+ {
+ gl_rect_2d(bar_rect.mLeft, tick_end, bar_rect.mRight - TICK_LENGTH/2, tick_begin, LLColor4(1.f, 1.f, 1.f, 0.1f));
+ }
+ }
+ else
+ {
+ if (tick_begin > last_label + MIN_LABEL_SPACING)
+ {
+ gl_rect_2d(tick_begin, bar_rect.mTop, tick_end, bar_rect.mBottom - TICK_LENGTH, LLColor4(1.f, 1.f, 1.f, 0.25f));
+ S32 label_pos = tick_begin - llround((F32)tick_label_width * ((F32)tick_begin / (F32)bar_rect.getWidth()));
+ LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, label_pos, bar_rect.mBottom - TICK_LENGTH,
+ LLColor4(1.f, 1.f, 1.f, 0.5f),
+ LLFontGL::LEFT, LLFontGL::TOP);
+ last_label = label_pos;
+ }
+ else
+ {
+ gl_rect_2d(tick_begin, bar_rect.mTop, tick_end, bar_rect.mBottom - TICK_LENGTH/2, LLColor4(1.f, 1.f, 1.f, 0.1f));
+ }
+ }
+ // always draw one tick value past tick_end, so we can see part of the text, if possible
+ if (tick_value > mCurMaxBar)
+ {
+ break;
+ }
+ }
+ }
+}
diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h
index 513fff3234..89d7ff24ed 100755
--- a/indra/llui/llstatbar.h
+++ b/indra/llui/llstatbar.h
@@ -29,74 +29,92 @@
#include "llview.h"
#include "llframetimer.h"
-
-class LLStat;
+#include "lltracerecording.h"
class LLStatBar : public LLView
{
public:
+
struct Params : public LLInitParam::Block<Params, LLView::Params>
{
- Optional<std::string> label;
- Optional<std::string> unit_label;
- Optional<F32> bar_min;
- Optional<F32> bar_max;
- Optional<F32> tick_spacing;
- Optional<F32> label_spacing;
- Optional<U32> precision;
- Optional<F32> update_rate;
- Optional<bool> show_per_sec;
- Optional<bool> show_bar;
- Optional<bool> show_history;
- Optional<bool> show_mean;
- Optional<std::string> stat;
- Params()
- : label("label"),
- unit_label("unit_label"),
- bar_min("bar_min", 0.0f),
- bar_max("bar_max", 50.0f),
- tick_spacing("tick_spacing", 10.0f),
- label_spacing("label_spacing", 10.0f),
- precision("precision", 0),
- update_rate("update_rate", 5.0f),
- show_per_sec("show_per_sec", TRUE),
- show_bar("show_bar", TRUE),
- show_history("show_history", FALSE),
- show_mean("show_mean", TRUE),
- stat("stat")
- {
- changeDefault(follows.flags, FOLLOWS_TOP | FOLLOWS_LEFT);
- }
+ Optional<std::string> label,
+ unit_label;
+
+ Optional<F32> bar_min,
+ bar_max,
+ tick_spacing;
+
+ Optional<bool> show_bar,
+ show_history,
+ scale_range;
+
+ Optional<S32> decimal_digits,
+ num_frames,
+ num_frames_short,
+ max_height;
+ Optional<std::string> stat;
+ Optional<EOrientation> orientation;
+
+ Params();
};
LLStatBar(const Params&);
virtual void draw();
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
+ virtual BOOL handleHover(S32 x, S32 y, MASK mask);
+
+ void setStat(const std::string& stat_name);
- void setStat(LLStat* stat) { mStatp = stat; }
- void setRange(F32 bar_min, F32 bar_max, F32 tick_spacing, F32 label_spacing);
- void getRange(F32& bar_min, F32& bar_max) { bar_min = mMinBar; bar_max = mMaxBar; }
+ void setRange(F32 bar_min, F32 bar_max);
+ void getRange(F32& bar_min, F32& bar_max) { bar_min = mTargetMinBar; bar_max = mTargetMaxBar; }
/*virtual*/ LLRect getRequiredRect(); // Return the height of this object, given the set options.
private:
- F32 mMinBar;
- F32 mMaxBar;
- F32 mTickSpacing;
- F32 mLabelSpacing;
- U32 mPrecision;
- F32 mUpdatesPerSec;
- BOOL mPerSec; // Use the per sec stats.
- BOOL mDisplayBar; // Display the bar graph.
- BOOL mDisplayHistory;
- BOOL mDisplayMean; // If true, display mean, if false, display current value
-
- LLStat* mStatp;
-
- LLFrameTimer mUpdateTimer;
- LLUIString mLabel;
- std::string mUnitLabel;
- F32 mValue;
+ void drawLabelAndValue( F32 mean, std::string &unit_label, LLRect &bar_rect, S32 decimal_digits );
+ void drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect );
+
+ F32 mTargetMinBar,
+ mTargetMaxBar,
+ mFloatingTargetMinBar,
+ mFloatingTargetMaxBar,
+ mCurMaxBar,
+ mCurMinBar,
+ mLabelSpacing,
+ mTickSpacing;
+ S32 mDecimalDigits,
+ mNumHistoryFrames,
+ mNumShortHistoryFrames;
+ S32 mMaxHeight;
+ EOrientation mOrientation;
+ F32 mLastDisplayValue;
+ LLFrameTimer mLastDisplayValueTimer;
+
+ enum
+ {
+ STAT_NONE,
+ STAT_COUNT,
+ STAT_EVENT,
+ STAT_SAMPLE,
+ STAT_MEM
+ } mStatType;
+
+ union
+ {
+ void* valid;
+ const LLTrace::StatType<LLTrace::CountAccumulator>* countStatp;
+ const LLTrace::StatType<LLTrace::EventAccumulator>* eventStatp;
+ const LLTrace::StatType<LLTrace::SampleAccumulator>* sampleStatp;
+ const LLTrace::StatType<LLTrace::MemAccumulator>* memStatp;
+ } mStat;
+
+ LLUIString mLabel;
+ std::string mUnitLabel;
+
+ bool mDisplayBar, // Display the bar graph.
+ mDisplayHistory,
+ mAutoScaleMax,
+ mAutoScaleMin;
};
#endif
diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp
index e44887ebf0..98962aff9a 100755
--- a/indra/llui/llstatgraph.cpp
+++ b/indra/llui/llstatgraph.cpp
@@ -32,48 +32,52 @@
#include "llmath.h"
#include "llui.h"
-#include "llstat.h"
#include "llgl.h"
#include "llglheaders.h"
+#include "lltracerecording.h"
+#include "lltracethreadrecorder.h"
//#include "llviewercontrol.h"
///////////////////////////////////////////////////////////////////////////////////
-LLStatGraph::LLStatGraph(const LLView::Params& p)
-: LLView(p)
+LLStatGraph::LLStatGraph(const Params& p)
+: LLView(p),
+ mMin(p.min),
+ mMax(p.max),
+ mPerSec(p.per_sec),
+ mPrecision(p.precision),
+ mValue(p.value),
+ mUnits(p.units),
+ mNewStatFloatp(p.stat.count_stat_float)
{
- mStatp = NULL;
setToolTip(p.name());
- mNumThresholds = 3;
- mThresholdColors[0] = LLColor4(0.f, 1.f, 0.f, 1.f);
- mThresholdColors[1] = LLColor4(1.f, 1.f, 0.f, 1.f);
- mThresholdColors[2] = LLColor4(1.f, 0.f, 0.f, 1.f);
- mThresholdColors[3] = LLColor4(1.f, 0.f, 0.f, 1.f);
- mThresholds[0] = 50.f;
- mThresholds[1] = 75.f;
- mThresholds[2] = 100.f;
- mMin = 0.f;
- mMax = 125.f;
- mPerSec = TRUE;
- mValue = 0.f;
- mPrecision = 0;
+
+ for(LLInitParam::ParamIterator<ThresholdParams>::const_iterator it = p.thresholds.threshold.begin(), end_it = p.thresholds.threshold.end();
+ it != end_it;
+ ++it)
+ {
+ mThresholds.push_back(Threshold(it->value(), it->color));
+ }
}
void LLStatGraph::draw()
{
F32 range, frac;
range = mMax - mMin;
- if (mStatp)
+ if (mNewStatFloatp)
{
+ LLTrace::Recording& recording = LLTrace::get_frame_recording().getLastRecording();
+
if (mPerSec)
{
- mValue = mStatp->getMeanPerSec();
+ mValue = recording.getPerSec(*mNewStatFloatp);
}
else
{
- mValue = mStatp->getMean();
+ mValue = recording.getSum(*mNewStatFloatp);
}
}
+
frac = (mValue - mMin) / range;
frac = llmax(0.f, frac);
frac = llmin(1.f, frac);
@@ -91,19 +95,13 @@ void LLStatGraph::draw()
LLColor4 color;
- S32 i;
- for (i = 0; i < mNumThresholds - 1; i++)
+ threshold_vec_t::iterator it = std::lower_bound(mThresholds.begin(), mThresholds.end(), Threshold(mValue / mMax, LLUIColor()));
+
+ if (it != mThresholds.begin())
{
- if (mThresholds[i] > mValue)
- {
- break;
- }
+ it--;
}
- //gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0,
- // LLUIColorTable::instance().getColor("ColorDropShadow"),
- // (S32) gSavedSettings.getF32("DropShadowFloater") );
-
color = LLUIColorTable::instance().getColor( "MenuDefaultBgColor" );
gGL.color4fv(color.mV);
gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, TRUE);
@@ -111,16 +109,11 @@ void LLStatGraph::draw()
gGL.color4fv(LLColor4::black.mV);
gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, FALSE);
- color = mThresholdColors[i];
+ color = it->mColor;
gGL.color4fv(color.mV);
gl_rect_2d(1, llround(frac*getRect().getHeight()), getRect().getWidth() - 1, 0, TRUE);
}
-void LLStatGraph::setValue(const LLSD& value)
-{
- mValue = (F32)value.asReal();
-}
-
void LLStatGraph::setMin(const F32 min)
{
mMin = min;
@@ -131,27 +124,3 @@ void LLStatGraph::setMax(const F32 max)
mMax = max;
}
-void LLStatGraph::setStat(LLStat *statp)
-{
- mStatp = statp;
-}
-
-void LLStatGraph::setLabel(const std::string& label)
-{
- mLabel = label;
-}
-
-void LLStatGraph::setUnits(const std::string& units)
-{
- mUnits = units;
-}
-
-void LLStatGraph::setPrecision(const S32 precision)
-{
- mPrecision = precision;
-}
-
-void LLStatGraph::setThreshold(const S32 i, F32 value)
-{
- mThresholds[i] = value;
-}
diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h
index 757525e232..f381e92a4d 100755
--- a/indra/llui/llstatgraph.h
+++ b/indra/llui/llstatgraph.h
@@ -30,29 +30,84 @@
#include "llview.h"
#include "llframetimer.h"
#include "v4color.h"
-
-class LLStat;
+#include "lltrace.h"
class LLStatGraph : public LLView
{
public:
- LLStatGraph(const LLView::Params&);
+ struct ThresholdParams : public LLInitParam::Block<ThresholdParams>
+ {
+ Mandatory<F32> value;
+ Optional<LLUIColor> color;
- virtual void draw();
+ ThresholdParams()
+ : value("value"),
+ color("color", LLColor4::white)
+ {}
+ };
+
+ struct Thresholds : public LLInitParam::Block<Thresholds>
+ {
+ Multiple<ThresholdParams> threshold;
+
+ Thresholds()
+ : threshold("threshold")
+ {}
+ };
+
+ struct StatParams : public LLInitParam::ChoiceBlock<StatParams>
+ {
+ Alternative<LLTrace::StatType<LLTrace::CountAccumulator>* > count_stat_float;
+ Alternative<LLTrace::StatType<LLTrace::EventAccumulator>* > event_stat_float;
+ Alternative<LLTrace::StatType<LLTrace::SampleAccumulator>* > sample_stat_float;
+ };
+
+ struct Params : public LLInitParam::Block<Params, LLView::Params>
+ {
+ Mandatory<StatParams> stat;
+ Optional<std::string> label,
+ units;
+ Optional<S32> precision;
+ Optional<F32> min,
+ max;
+ Optional<bool> per_sec;
+ Optional<F32> value;
+
+ Optional<Thresholds> thresholds;
+
+ Params()
+ : stat("stat"),
+ label("label"),
+ units("units"),
+ precision("precision", 0),
+ min("min", 0.f),
+ max("max", 125.f),
+ per_sec("per_sec", true),
+ value("value", 0.f),
+ thresholds("thresholds")
+ {
+ Thresholds _thresholds;
+ _thresholds.threshold.add(ThresholdParams().value(0.f).color(LLColor4::green))
+ .add(ThresholdParams().value(0.33f).color(LLColor4::yellow))
+ .add(ThresholdParams().value(0.5f).color(LLColor4::red))
+ .add(ThresholdParams().value(0.75f).color(LLColor4::red));
+ thresholds = _thresholds;
+ }
+ };
+ LLStatGraph(const Params&);
- void setLabel(const std::string& label);
- void setUnits(const std::string& units);
- void setPrecision(const S32 precision);
- void setStat(LLStat *statp);
- void setThreshold(const S32 i, F32 value);
void setMin(const F32 min);
void setMax(const F32 max);
+ virtual void draw();
+
/*virtual*/ void setValue(const LLSD& value);
- LLStat *mStatp;
- BOOL mPerSec;
private:
+ LLTrace::StatType<LLTrace::CountAccumulator>* mNewStatFloatp;
+
+ BOOL mPerSec;
+
F32 mValue;
F32 mMin;
@@ -62,9 +117,25 @@ private:
std::string mUnits;
S32 mPrecision; // Num of digits of precision after dot
- S32 mNumThresholds;
- F32 mThresholds[4];
- LLColor4 mThresholdColors[4];
+ struct Threshold
+ {
+ Threshold(F32 value, const LLUIColor& color)
+ : mValue(value),
+ mColor(color)
+ {}
+
+ F32 mValue;
+ LLUIColor mColor;
+ bool operator <(const Threshold& other)
+ {
+ return mValue < other.mValue;
+ }
+ };
+ typedef std::vector<Threshold> threshold_vec_t;
+ threshold_vec_t mThresholds;
+ //S32 mNumThresholds;
+ //F32 mThresholds[4];
+ //LLColor4 mThresholdColors[4];
};
#endif // LL_LLSTATGRAPH_H
diff --git a/indra/llui/llstatview.h b/indra/llui/llstatview.h
index 5abdc42448..bc78d3b5fd 100755
--- a/indra/llui/llstatview.h
+++ b/indra/llui/llstatview.h
@@ -46,7 +46,8 @@ public:
Params()
: setting("setting")
{
- changeDefault(follows.flags, FOLLOWS_TOP | FOLLOWS_LEFT);
+ changeDefault(follows.flags, FOLLOWS_TOP | FOLLOWS_LEFT | FOLLOWS_RIGHT);
+ changeDefault(show_label, true);
}
};
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index 2b9286f663..6f858cdeb3 100755
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -407,7 +407,7 @@ void LLTabContainer::draw()
}
}
- setScrollPosPixels((S32)lerp((F32)getScrollPosPixels(), (F32)target_pixel_scroll, LLCriticalDamp::getInterpolant(0.08f)));
+ setScrollPosPixels((S32)lerp((F32)getScrollPosPixels(), (F32)target_pixel_scroll, LLSmoothInterpolation::getInterpolant(0.08f)));
BOOL has_scroll_arrows = !getTabsHidden() && ((mMaxScrollPos > 0) || (mScrollPosPixels > 0));
if (!mIsVertical)
@@ -1140,6 +1140,17 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel)
addChild( btn, 0 );
}
}
+ else
+ {
+ if (textbox)
+ {
+ LLUICtrl::addChild(textbox, 0);
+ }
+ if (btn)
+ {
+ LLUICtrl::addChild(btn, 0);
+ }
+ }
if (child)
{
@@ -1585,7 +1596,7 @@ BOOL LLTabContainer::selectTabByName(const std::string& name)
LLPanel* panel = getPanelByName(name);
if (!panel)
{
- llwarns << "LLTabContainer::selectTabByName(" << name << ") failed" << llendl;
+ LL_WARNS() << "LLTabContainer::selectTabByName(" << name << ") failed" << LL_ENDL;
return FALSE;
}
@@ -1636,16 +1647,26 @@ void LLTabContainer::setTabImage(LLPanel* child, LLIconCtrl* icon)
{
LLTabTuple* tuple = getTabByPanel(child);
LLCustomButtonIconCtrl* button;
+ bool hasButton = false;
if(tuple)
{
button = dynamic_cast<LLCustomButtonIconCtrl*>(tuple->mButton);
if(button)
{
+ hasButton = true;
button->setIcon(icon);
reshapeTuple(tuple);
}
}
+
+ if (!hasButton && (icon != NULL))
+ {
+ // It was assumed that the tab's button would take ownership of the icon pointer.
+ // But since the tab did not have a button, kill the icon to prevent the memory
+ // leak.
+ icon->die();
+ }
}
void LLTabContainer::reshapeTuple(LLTabTuple* tuple)
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 4144a42fd6..9b125a85b9 100755
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -70,43 +70,36 @@ bool LLTextBase::compare_segment_end::operator()(const LLTextSegmentPtr& a, cons
// helper functors
-struct LLTextBase::compare_bottom
+bool LLTextBase::compare_bottom::operator()(const S32& a, const LLTextBase::line_info& b) const
{
- bool operator()(const S32& a, const LLTextBase::line_info& b) const
- {
- return a > b.mRect.mBottom; // bottom of a is higher than bottom of b
- }
-
- bool operator()(const LLTextBase::line_info& a, const S32& b) const
- {
- return a.mRect.mBottom > b; // bottom of a is higher than bottom of b
- }
+ return a > b.mRect.mBottom; // bottom of a is higher than bottom of b
+}
- bool operator()(const LLTextBase::line_info& a, const LLTextBase::line_info& b) const
- {
- return a.mRect.mBottom > b.mRect.mBottom; // bottom of a is higher than bottom of b
- }
+bool LLTextBase::compare_bottom::operator()(const LLTextBase::line_info& a, const S32& b) const
+{
+ return a.mRect.mBottom > b; // bottom of a is higher than bottom of b
+}
-};
+bool LLTextBase::compare_bottom::operator()(const LLTextBase::line_info& a, const LLTextBase::line_info& b) const
+{
+ return a.mRect.mBottom > b.mRect.mBottom; // bottom of a is higher than bottom of b
+}
// helper functors
-struct LLTextBase::compare_top
+bool LLTextBase::compare_top::operator()(const S32& a, const LLTextBase::line_info& b) const
{
- bool operator()(const S32& a, const LLTextBase::line_info& b) const
- {
- return a > b.mRect.mTop; // top of a is higher than top of b
- }
+ return a > b.mRect.mTop; // top of a is higher than top of b
+}
- bool operator()(const LLTextBase::line_info& a, const S32& b) const
- {
- return a.mRect.mTop > b; // top of a is higher than top of b
- }
+bool LLTextBase::compare_top::operator()(const LLTextBase::line_info& a, const S32& b) const
+{
+ return a.mRect.mTop > b; // top of a is higher than top of b
+}
- bool operator()(const LLTextBase::line_info& a, const LLTextBase::line_info& b) const
- {
- return a.mRect.mTop > b.mRect.mTop; // top of a is higher than top of b
- }
-};
+bool LLTextBase::compare_top::operator()(const LLTextBase::line_info& a, const LLTextBase::line_info& b) const
+{
+ return a.mRect.mTop > b.mRect.mTop; // top of a is higher than top of b
+}
struct LLTextBase::line_end_compare
{
@@ -573,7 +566,8 @@ void LLTextBase::drawText()
if ( (getSpellCheck()) && (getWText().length() > 2) )
{
// Calculate start and end indices for the spell checking range
- S32 start = line_start, end = getLineEnd(last_line);
+ S32 start = line_start;
+ S32 end = getLineEnd(last_line);
if ( (mSpellCheckStart != start) || (mSpellCheckEnd != end) )
{
@@ -691,7 +685,7 @@ void LLTextBase::drawText()
seg_iter++;
if (seg_iter == mSegments.end())
{
- llwarns << "Ran off the segmentation end!" << llendl;
+ LL_WARNS() << "Ran off the segmentation end!" << LL_ENDL;
return;
}
@@ -1261,13 +1255,13 @@ void LLTextBase::setReadOnlyColor(const LLColor4 &c)
}
//virtual
-void LLTextBase::handleVisibilityChange( BOOL new_visibility )
+void LLTextBase::onVisibilityChange( BOOL new_visibility )
{
if(!new_visibility && mPopupMenu)
{
mPopupMenu->hide();
}
- LLUICtrl::handleVisibilityChange(new_visibility);
+ LLUICtrl::onVisibilityChange(new_visibility);
}
//virtual
@@ -1313,13 +1307,14 @@ void LLTextBase::replaceWithSuggestion(U32 index)
if ( (it->first <= (U32)mCursorPos) && (it->second >= (U32)mCursorPos) )
{
deselect();
-
- // Delete the misspelled word
- removeStringNoUndo(it->first, it->second - it->first);
-
// Insert the suggestion in its place
LLWString suggestion = utf8str_to_wstring(mSuggestionList[index]);
insertStringNoUndo(it->first, utf8str_to_wstring(mSuggestionList[index]));
+
+ // Delete the misspelled word
+ removeStringNoUndo(it->first + (S32)suggestion.length(), it->second - it->first);
+
+
setCursorPos(it->first + (S32)suggestion.length());
break;
@@ -1438,10 +1433,10 @@ S32 LLTextBase::getLeftOffset(S32 width)
}
-static LLFastTimer::DeclareTimer FTM_TEXT_REFLOW ("Text Reflow");
+static LLTrace::BlockTimerStatHandle FTM_TEXT_REFLOW ("Text Reflow");
void LLTextBase::reflow()
{
- LLFastTimer ft(FTM_TEXT_REFLOW);
+ LL_RECORD_BLOCK_TIME(FTM_TEXT_REFLOW);
updateSegments();
@@ -1483,7 +1478,7 @@ void LLTextBase::reflow()
// use an even number of iterations to avoid user visible oscillation of the layout
if(++reflow_count > 2)
{
- lldebugs << "Breaking out of reflow due to possible infinite loop in " << getName() << llendl;
+ LL_DEBUGS() << "Breaking out of reflow due to possible infinite loop in " << getName() << LL_ENDL;
break;
}
@@ -1780,10 +1775,10 @@ void LLTextBase::removeDocumentChild(LLView* view)
}
-static LLFastTimer::DeclareTimer FTM_UPDATE_TEXT_SEGMENTS("Update Text Segments");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_TEXT_SEGMENTS("Update Text Segments");
void LLTextBase::updateSegments()
{
- LLFastTimer ft(FTM_UPDATE_TEXT_SEGMENTS);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_TEXT_SEGMENTS);
createDefaultSegment();
}
@@ -1872,7 +1867,6 @@ LLTextBase::segment_set_t::iterator LLTextBase::getSegIterContaining(S32 index)
// when there are no segments, we return the end iterator, which must be checked by caller
if (mSegments.size() <= 1) { return mSegments.begin(); }
- //FIXME: avoid operator new somehow (without running into refcount problems)
index_segment->setStart(index);
index_segment->setEnd(index);
segment_set_t::iterator it = mSegments.upper_bound(index_segment);
@@ -1955,6 +1949,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url)
// create and return the context menu from the XUI file
delete mPopupMenu;
+ llassert(LLMenuGL::sMenuContainer != NULL);
mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>(xui_file, LLMenuGL::sMenuContainer,
LLMenuHolderGL::child_registry_t::instance());
if (mIsFriendSignal)
@@ -2022,7 +2017,7 @@ static LLUIImagePtr image_from_icon_name(const std::string& icon_name)
}
}
-static LLFastTimer::DeclareTimer FTM_PARSE_HTML("Parse HTML");
+static LLTrace::BlockTimerStatHandle FTM_PARSE_HTML("Parse HTML");
void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Params& input_params)
{
@@ -2032,12 +2027,12 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para
S32 part = (S32)LLTextParser::WHOLE;
if (mParseHTML && !style_params.is_link) // Don't search for URLs inside a link segment (STORM-358).
{
- LLFastTimer _(FTM_PARSE_HTML);
+ LL_RECORD_BLOCK_TIME(FTM_PARSE_HTML);
S32 start=0,end=0;
LLUrlMatch match;
std::string text = new_text;
while ( LLUrlRegistry::instance().findUrl(text, match,
- boost::bind(&LLTextBase::replaceUrl, this, _1, _2, _3)) )
+ boost::bind(&LLTextBase::replaceUrl, this, _1, _2, _3),isContentTrusted()))
{
start = match.getStart();
end = match.getEnd()+1;
@@ -2074,7 +2069,7 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para
}
}
- LLTextUtil::processUrlMatch(&match,this);
+ LLTextUtil::processUrlMatch(&match,this,isContentTrusted());
// move on to the rest of the text after the Url
if (end < (S32)text.length())
@@ -2099,11 +2094,11 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para
}
}
-static LLFastTimer::DeclareTimer FTM_APPEND_TEXT("Append Text");
+static LLTrace::BlockTimerStatHandle FTM_APPEND_TEXT("Append Text");
void LLTextBase::appendText(const std::string &new_text, bool prepend_newline, const LLStyle::Params& input_params)
{
- LLFastTimer _(FTM_APPEND_TEXT);
+ LL_RECORD_BLOCK_TIME(FTM_APPEND_TEXT);
if (new_text.empty())
return;
@@ -2152,7 +2147,7 @@ void LLTextBase::setFont(const LLFontGL* font)
void LLTextBase::needsReflow(S32 index)
{
- lldebugs << "reflow on object " << (void*)this << " index = " << mReflowIndex << ", new index = " << index << llendl;
+ LL_DEBUGS() << "reflow on object " << (void*)this << " index = " << mReflowIndex << ", new index = " << index << LL_ENDL;
mReflowIndex = llmin(mReflowIndex, index);
}
@@ -2386,7 +2381,7 @@ S32 LLTextBase::getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round,
// binary search for line that starts before local_y
line_list_t::const_iterator line_iter = std::lower_bound(mLineInfoList.begin(), mLineInfoList.end(), doc_y, compare_bottom());
- if (line_iter == mLineInfoList.end())
+ if (!mLineInfoList.size() || line_iter == mLineInfoList.end())
{
return getLength(); // past the end
}
@@ -2478,7 +2473,6 @@ LLRect LLTextBase::getDocRectFromDocIndex(S32 pos) const
// clamp pos to valid values
pos = llclamp(pos, 0, mLineInfoList.back().mDocIndexEnd - 1);
- // find line that contains cursor
line_list_t::const_iterator line_iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), pos, line_end_compare());
doc_rect.mLeft = line_iter->mRect.mLeft;
@@ -2654,6 +2648,12 @@ void LLTextBase::changeLine( S32 delta )
LLRect visible_region = getVisibleDocumentRect();
S32 new_cursor_pos = getDocIndexFromLocalCoord(mDesiredXPixel,
mLineInfoList[new_line].mRect.mBottom + mVisibleTextRect.mBottom - visible_region.mBottom, TRUE);
+ S32 actual_line = getLineNumFromDocIndex(new_cursor_pos);
+ if (actual_line != new_line)
+ {
+ // line edge, correcting position by 1 to move onto proper line
+ new_cursor_pos += new_line - actual_line;
+ }
setCursorPos(new_cursor_pos, true);
}
}
@@ -3199,7 +3199,7 @@ void LLNormalTextSegment::setToolTip(const std::string& tooltip)
// we cannot replace a keyword tooltip that's loaded from a file
if (mToken)
{
- llwarns << "LLTextSegment::setToolTip: cannot replace keyword tooltip." << llendl;
+ LL_WARNS() << "LLTextSegment::setToolTip: cannot replace keyword tooltip." << LL_ENDL;
return;
}
mTooltip = tooltip;
@@ -3255,14 +3255,14 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin
if(getLength() < segment_offset + mStart)
{
- llinfos << "getLength() < segment_offset + mStart\t getLength()\t" << getLength() << "\tsegment_offset:\t"
- << segment_offset << "\tmStart:\t" << mStart << "\tsegments\t" << mEditor.mSegments.size() << "\tmax_chars\t" << max_chars << llendl;
+ LL_INFOS() << "getLength() < segment_offset + mStart\t getLength()\t" << getLength() << "\tsegment_offset:\t"
+ << segment_offset << "\tmStart:\t" << mStart << "\tsegments\t" << mEditor.mSegments.size() << "\tmax_chars\t" << max_chars << LL_ENDL;
}
if( (offsetLength + 1) < max_chars)
{
- llinfos << "offsetString.length() + 1 < max_chars\t max_chars:\t" << max_chars << "\toffsetLength:\t" << offsetLength << " getLength() : "
- << getLength() << "\tsegment_offset:\t" << segment_offset << "\tmStart:\t" << mStart << "\tsegments\t" << mEditor.mSegments.size() << llendl;
+ LL_INFOS() << "offsetString.length() + 1 < max_chars\t max_chars:\t" << max_chars << "\toffsetString.length():\t" << offsetLength << " getLength() : "
+ << getLength() << "\tsegment_offset:\t" << segment_offset << "\tmStart:\t" << mStart << "\tsegments\t" << mEditor.mSegments.size() << LL_ENDL;
}
S32 num_chars = mStyle->getFont()->maxDrawableChars( text.c_str() + (segment_offset + mStart),
@@ -3292,13 +3292,13 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin
void LLNormalTextSegment::dump() const
{
- llinfos << "Segment [" <<
+ LL_INFOS() << "Segment [" <<
// mColor.mV[VX] << ", " <<
// mColor.mV[VY] << ", " <<
// mColor.mV[VZ] << "]\t[" <<
mStart << ", " <<
getEnd() << "]" <<
- llendl;
+ LL_ENDL;
}
/*virtual*/
diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h
index 3603f55c3f..738b4d5b8e 100755
--- a/indra/llui/lltextbase.h
+++ b/indra/llui/lltextbase.h
@@ -51,10 +51,15 @@ class LLUrlMatch;
/// includes a start/end offset from the start of the string, a
/// style to render with, an optional tooltip, etc.
///
-class LLTextSegment : public LLRefCount, public LLMouseHandler
+class LLTextSegment
+: public LLRefCount,
+ public LLMouseHandler
{
public:
- LLTextSegment(S32 start, S32 end) : mStart(start), mEnd(end){};
+ LLTextSegment(S32 start, S32 end)
+ : mStart(start),
+ mEnd(end)
+ {}
virtual ~LLTextSegment();
virtual bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const;
@@ -92,10 +97,10 @@ public:
/*virtual*/ void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const;
/*virtual*/ BOOL hasMouseCapture();
- S32 getStart() const { return mStart; }
- void setStart(S32 start) { mStart = start; }
- S32 getEnd() const { return mEnd; }
- void setEnd( S32 end ) { mEnd = end; }
+ S32 getStart() const { return mStart; }
+ void setStart(S32 start) { mStart = start; }
+ S32 getEnd() const { return mEnd; }
+ void setEnd( S32 end ) { mEnd = end; }
protected:
S32 mStart;
@@ -328,7 +333,7 @@ public:
/*virtual*/ BOOL acceptsTextInput() const { return !mReadOnly; }
/*virtual*/ void setColor( const LLColor4& c );
virtual void setReadOnlyColor(const LLColor4 &c);
- virtual void handleVisibilityChange( BOOL new_visibility );
+ virtual void onVisibilityChange( BOOL new_visibility );
/*virtual*/ void setValue(const LLSD& value );
/*virtual*/ LLTextViewModel* getViewModel() const;
@@ -362,7 +367,9 @@ public:
bool getWordWrap() { return mWordWrap; }
bool getUseEllipses() { return mUseEllipses; }
bool truncate(); // returns true of truncation occurred
+
bool isContentTrusted() {return mTrustedContent;}
+ void setContentTrusted(bool trusted_content) { mTrustedContent = trusted_content; }
// TODO: move into LLTextSegment?
void createUrlContextMenu(S32 x, S32 y, const std::string &url); // create a popup context menu for the given Url
@@ -444,9 +451,31 @@ public:
LLScrollContainer* getScrollContainer() const { return mScroller; }
protected:
+ // protected member variables
+ // List of offsets and segment index of the start of each line. Always has at least one node (0).
+ struct line_info
+ {
+ line_info(S32 index_start, S32 index_end, LLRect rect, S32 line_num);
+ S32 mDocIndexStart;
+ S32 mDocIndexEnd;
+ LLRect mRect;
+ S32 mLineNum; // actual line count (ignoring soft newlines due to word wrap)
+ };
+ typedef std::vector<line_info> line_list_t;
+
// helper structs
- struct compare_bottom;
- struct compare_top;
+ struct compare_bottom
+ {
+ bool operator()(const S32& a, const line_info& b) const;
+ bool operator()(const line_info& a, const S32& b) const;
+ bool operator()(const line_info& a, const line_info& b) const;
+ };
+ struct compare_top
+ {
+ bool operator()(const S32& a, const line_info& b) const;
+ bool operator()(const line_info& a, const S32& b) const;
+ bool operator()(const line_info& a, const line_info& b) const;
+ };
struct line_end_compare;
typedef std::vector<LLTextSegmentPtr> segment_vec_t;
@@ -494,18 +523,6 @@ protected:
};
typedef std::multiset<LLTextSegmentPtr, compare_segment_end> segment_set_t;
- // protected member variables
- // List of offsets and segment index of the start of each line. Always has at least one node (0).
- struct line_info
- {
- line_info(S32 index_start, S32 index_end, LLRect rect, S32 line_num);
- S32 mDocIndexStart;
- S32 mDocIndexEnd;
- LLRect mRect;
- S32 mLineNum; // actual line count (ignoring soft newlines due to word wrap)
- };
- typedef std::vector<line_info> line_list_t;
-
// member functions
LLTextBase(const Params &p);
virtual ~LLTextBase();
@@ -515,7 +532,7 @@ protected:
virtual bool useLabel() const;
// draw methods
- void drawSelectionBackground(); // draws the black box behind the selected text
+ virtual void drawSelectionBackground(); // draws the black box behind the selected text
void drawCursor();
void drawText();
@@ -608,7 +625,7 @@ protected:
S32 mSelectionStart;
S32 mSelectionEnd;
LLTimer mTripleClickTimer;
-
+
BOOL mIsSelecting; // Are we in the middle of a drag-select?
// spell checking
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 02c81c0744..cf5fdef539 100755
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -75,8 +75,6 @@ template class LLTextEditor* LLView::getChild<class LLTextEditor>(
//
// Constants
//
-const S32 UI_TEXTEDITOR_LINE_NUMBER_MARGIN = 32;
-const S32 UI_TEXTEDITOR_LINE_NUMBER_DIGITS = 4;
const S32 SPACES_PER_TAB = 4;
const F32 SPELLCHECK_DELAY = 0.5f; // delay between the last keypress and spell checking the word the cursor is on
@@ -236,7 +234,6 @@ LLTextEditor::Params::Params()
prevalidate_callback("prevalidate_callback"),
embedded_items("embedded_items", false),
ignore_tab("ignore_tab", true),
- show_line_numbers("show_line_numbers", false),
auto_indent("auto_indent", true),
default_color("default_color"),
commit_on_focus_lost("commit_on_focus_lost", false),
@@ -252,8 +249,7 @@ LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) :
mBaseDocIsPristine(TRUE),
mPristineCmd( NULL ),
mLastCmd( NULL ),
- mDefaultColor( p.default_color() ),
- mShowLineNumbers ( p.show_line_numbers ),
+ mDefaultColor( p.default_color() ),
mAutoIndent(p.auto_indent),
mCommitOnFocusLost( p.commit_on_focus_lost),
mAllowEmbeddedItems( p.embedded_items ),
@@ -264,7 +260,8 @@ LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) :
mContextMenu(NULL),
mShowContextMenu(p.show_context_menu),
mEnableTooltipPaste(p.enable_tooltip_paste),
- mPassDelete(FALSE)
+ mPassDelete(FALSE),
+ mKeepSelectionOnReturn(false)
{
mSourceID.generate();
@@ -277,14 +274,7 @@ LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) :
params.visible = p.border_visible;
mBorder = LLUICtrlFactory::create<LLViewBorder> (params);
addChild( mBorder );
-
setText(p.default_text());
-
- if (mShowLineNumbers)
- {
- mHPad += UI_TEXTEDITOR_LINE_NUMBER_MARGIN;
- updateRects();
- }
mParseOnTheFly = TRUE;
}
@@ -792,7 +782,7 @@ BOOL LLTextEditor::handleHover(S32 x, S32 y, MASK mask)
setCursorAtLocalPos( clamped_x, clamped_y, true );
mSelectionEnd = mCursorPos;
}
- lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by " << getName() << " (active)" << LL_ENDL;
getWindow()->setCursor(UI_CURSOR_IBEAM);
handled = TRUE;
}
@@ -1136,7 +1126,6 @@ void LLTextEditor::addChar(llwchar wc)
}
}
-
void LLTextEditor::addLineBreakChar(BOOL group_together)
{
if( !getEnabled() )
@@ -1664,7 +1653,7 @@ BOOL LLTextEditor::handleSpecialKey(const KEY key, const MASK mask)
case KEY_RETURN:
if (mask == MASK_NONE)
{
- if( hasSelection() )
+ if( hasSelection() && !mKeepSelectionOnReturn )
{
deleteSelection(FALSE);
}
@@ -2031,6 +2020,7 @@ void LLTextEditor::showContextMenu(S32 x, S32 y)
{
if (!mContextMenu)
{
+ llassert(LLMenuGL::sMenuContainer != NULL);
mContextMenu = LLUICtrlFactory::instance().createFromFile<LLContextMenu>("menu_text_editor.xml",
LLMenuGL::sMenuContainer,
LLMenuHolderGL::child_registry_t::instance());
@@ -2196,69 +2186,6 @@ void LLTextEditor::drawPreeditMarker()
}
}
-
-void LLTextEditor::drawLineNumbers()
-{
- LLGLSUIDefault gls_ui;
- LLRect scrolled_view_rect = getVisibleDocumentRect();
- LLRect content_rect = getVisibleTextRect();
- LLLocalClipRect clip(content_rect);
- S32 first_line = getFirstVisibleLine();
- S32 num_lines = getLineCount();
- if (first_line >= num_lines)
- {
- return;
- }
-
- S32 cursor_line = mLineInfoList[getLineNumFromDocIndex(mCursorPos)].mLineNum;
-
- if (mShowLineNumbers)
- {
- S32 left = 0;
- S32 top = getRect().getHeight();
- S32 bottom = 0;
-
- gl_rect_2d(left, top, UI_TEXTEDITOR_LINE_NUMBER_MARGIN, bottom, mReadOnlyBgColor.get() ); // line number area always read-only
- gl_rect_2d(UI_TEXTEDITOR_LINE_NUMBER_MARGIN, top, UI_TEXTEDITOR_LINE_NUMBER_MARGIN-1, bottom, LLColor4::grey3); // separator
-
- S32 last_line_num = -1;
-
- for (S32 cur_line = first_line; cur_line < num_lines; cur_line++)
- {
- line_info& line = mLineInfoList[cur_line];
-
- if ((line.mRect.mTop - scrolled_view_rect.mBottom) < mVisibleTextRect.mBottom)
- {
- break;
- }
-
- S32 line_bottom = line.mRect.mBottom - scrolled_view_rect.mBottom + mVisibleTextRect.mBottom;
- // draw the line numbers
- if(line.mLineNum != last_line_num && line.mRect.mTop <= scrolled_view_rect.mTop)
- {
- const LLFontGL *num_font = LLFontGL::getFontMonospace();
- const LLWString ltext = utf8str_to_wstring(llformat("%d", line.mLineNum ));
- BOOL is_cur_line = cursor_line == line.mLineNum;
- const U8 style = is_cur_line ? LLFontGL::BOLD : LLFontGL::NORMAL;
- const LLColor4 fg_color = is_cur_line ? mCursorColor : mReadOnlyFgColor;
- num_font->render(
- ltext, // string to draw
- 0, // begin offset
- UI_TEXTEDITOR_LINE_NUMBER_MARGIN - 2, // x
- line_bottom, // y
- fg_color,
- LLFontGL::RIGHT, // horizontal alignment
- LLFontGL::BOTTOM, // vertical alignment
- style,
- LLFontGL::NO_SHADOW,
- S32_MAX, // max chars
- UI_TEXTEDITOR_LINE_NUMBER_MARGIN - 2); // max pixels
- last_line_num = line.mLineNum;
- }
- }
- }
-}
-
void LLTextEditor::draw()
{
{
@@ -2270,7 +2197,6 @@ void LLTextEditor::draw()
}
LLTextBase::draw();
- drawLineNumbers();
drawPreeditMarker();
@@ -2338,7 +2264,8 @@ void LLTextEditor::autoIndent()
S32 i;
LLWString text = getWText();
- while( ' ' == text[line_start] )
+ S32 offset = getLineOffsetFromDocIndex(mCursorPos);
+ while(( ' ' == text[line_start] ) && (space_count < offset))
{
space_count++;
line_start++;
@@ -2511,53 +2438,6 @@ BOOL LLTextEditor::tryToRevertToPristineState()
return isPristine(); // TRUE => success
}
-
-static LLFastTimer::DeclareTimer FTM_SYNTAX_HIGHLIGHTING("Syntax Highlighting");
-void LLTextEditor::loadKeywords(const std::string& filename,
- const std::vector<std::string>& funcs,
- const std::vector<std::string>& tooltips,
- const LLColor3& color)
-{
- LLFastTimer ft(FTM_SYNTAX_HIGHLIGHTING);
- if(mKeywords.loadFromFile(filename))
- {
- S32 count = llmin(funcs.size(), tooltips.size());
- for(S32 i = 0; i < count; i++)
- {
- std::string name = utf8str_trim(funcs[i]);
- mKeywords.addToken(LLKeywordToken::WORD, name, color, tooltips[i] );
- }
- segment_vec_t segment_list;
- mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this);
-
- mSegments.clear();
- segment_set_t::iterator insert_it = mSegments.begin();
- for (segment_vec_t::iterator list_it = segment_list.begin(); list_it != segment_list.end(); ++list_it)
- {
- insert_it = mSegments.insert(insert_it, *list_it);
- }
- }
-}
-
-void LLTextEditor::updateSegments()
-{
- if (mReflowIndex < S32_MAX && mKeywords.isLoaded() && mParseOnTheFly)
- {
- LLFastTimer ft(FTM_SYNTAX_HIGHLIGHTING);
- // HACK: No non-ascii keywords for now
- segment_vec_t segment_list;
- mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this);
-
- clearSegments();
- for (segment_vec_t::iterator list_it = segment_list.begin(); list_it != segment_list.end(); ++list_it)
- {
- insertSegment(*list_it);
- }
- }
-
- LLTextBase::updateSegments();
-}
-
void LLTextEditor::updateLinkSegments()
{
LLWString wtext = getWText();
@@ -2614,20 +2494,20 @@ BOOL LLTextEditor::importBuffer(const char* buffer, S32 length )
instream.getline(tbuf, MAX_STRING);
if( 1 != sscanf(tbuf, "Linden text version %d", &version) )
{
- llwarns << "Invalid Linden text file header " << llendl;
+ LL_WARNS() << "Invalid Linden text file header " << LL_ENDL;
return FALSE;
}
if( 1 != version )
{
- llwarns << "Invalid Linden text file version: " << version << llendl;
+ LL_WARNS() << "Invalid Linden text file version: " << version << LL_ENDL;
return FALSE;
}
instream.getline(tbuf, MAX_STRING);
if( 0 != sscanf(tbuf, "{") )
{
- llwarns << "Invalid Linden text file format" << llendl;
+ LL_WARNS() << "Invalid Linden text file format" << LL_ENDL;
return FALSE;
}
@@ -2635,13 +2515,13 @@ BOOL LLTextEditor::importBuffer(const char* buffer, S32 length )
instream.getline(tbuf, MAX_STRING);
if( 1 != sscanf(tbuf, "Text length %d", &text_len) )
{
- llwarns << "Invalid Linden text length field" << llendl;
+ LL_WARNS() << "Invalid Linden text length field" << LL_ENDL;
return FALSE;
}
if( text_len > mMaxTextByteLength )
{
- llwarns << "Invalid Linden text length: " << text_len << llendl;
+ LL_WARNS() << "Invalid Linden text length: " << text_len << LL_ENDL;
return FALSE;
}
@@ -2650,21 +2530,21 @@ BOOL LLTextEditor::importBuffer(const char* buffer, S32 length )
char* text = new char[ text_len + 1];
if (text == NULL)
{
- llerrs << "Memory allocation failure." << llendl;
+ LL_ERRS() << "Memory allocation failure." << LL_ENDL;
return FALSE;
}
instream.get(text, text_len + 1, '\0');
text[text_len] = '\0';
if( text_len != (S32)strlen(text) )/* Flawfinder: ignore */
{
- llwarns << llformat("Invalid text length: %d != %d ",strlen(text),text_len) << llendl;/* Flawfinder: ignore */
+ LL_WARNS() << llformat("Invalid text length: %d != %d ",strlen(text),text_len) << LL_ENDL;/* Flawfinder: ignore */
success = FALSE;
}
instream.getline(tbuf, MAX_STRING);
if( success && (0 != sscanf(tbuf, "}")) )
{
- llwarns << "Invalid Linden text file format: missing terminal }" << llendl;
+ LL_WARNS() << "Invalid Linden text file format: missing terminal }" << LL_ENDL;
success = FALSE;
}
@@ -2727,7 +2607,7 @@ void LLTextEditor::resetPreedit()
{
if (hasPreeditString())
{
- llwarns << "Preedit and selection!" << llendl;
+ LL_WARNS() << "Preedit and selection!" << LL_ENDL;
deselect();
}
else
@@ -2737,6 +2617,12 @@ void LLTextEditor::resetPreedit()
}
if (hasPreeditString())
{
+ if (hasSelection())
+ {
+ LL_WARNS() << "Preedit and selection!" << LL_ENDL;
+ deselect();
+ }
+
setCursorPos(mPreeditPositions.front());
removeStringNoUndo(mCursorPos, mPreeditPositions.back() - mCursorPos);
insertStringNoUndo(mCursorPos, mPreeditOverwrittenWString);
@@ -2926,7 +2812,7 @@ void LLTextEditor::markAsPreedit(S32 position, S32 length)
setCursorPos(position);
if (hasPreeditString())
{
- llwarns << "markAsPreedit invoked when hasPreeditString is true." << llendl;
+ LL_WARNS() << "markAsPreedit invoked when hasPreeditString is true." << LL_ENDL;
}
mPreeditWString = LLWString( getWText(), position, length );
if (length > 0)
diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h
index d3b7bc0eb7..f6bdf917b4 100755
--- a/indra/llui/lltexteditor.h
+++ b/indra/llui/lltexteditor.h
@@ -1,25 +1,25 @@
-/**
+/**
* @file lltexteditor.h
* @brief LLTextEditor base class
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -30,12 +30,9 @@
#define LL_LLTEXTEDITOR_H
#include "llrect.h"
-#include "llkeywords.h"
#include "llframetimer.h"
-#include "lldarray.h"
#include "llstyle.h"
#include "lleditmenuhandler.h"
-#include "lldarray.h"
#include "llviewborder.h" // for params
#include "lltextbase.h"
#include "lltextvalidate.h"
@@ -45,7 +42,6 @@
class LLFontGL;
class LLScrollbar;
-class LLKeywordToken;
class TextCmd;
class LLUICtrlFactory;
class LLScrollContainer;
@@ -62,7 +58,6 @@ public:
Optional<bool> embedded_items,
ignore_tab,
- show_line_numbers,
commit_on_focus_lost,
show_context_menu,
enable_tooltip_paste,
@@ -133,7 +128,7 @@ public:
virtual BOOL canCopy() const;
virtual void paste();
virtual BOOL canPaste() const;
-
+
virtual void updatePrimary();
virtual void copyPrimary();
virtual void pastePrimary();
@@ -151,7 +146,7 @@ public:
void selectNext(const std::string& search_text_in, BOOL case_insensitive, BOOL wrap = TRUE);
BOOL replaceText(const std::string& search_text, const std::string& replace_text, BOOL case_insensitive, BOOL wrap = TRUE);
void replaceTextAll(const std::string& search_text, const std::string& replace_text, BOOL case_insensitive);
-
+
// Undo/redo stack
void blockUndo();
@@ -188,13 +183,6 @@ public:
void getCurrentLineAndColumn( S32* line, S32* col, BOOL include_wordwrap );
- void loadKeywords(const std::string& filename,
- const std::vector<std::string>& funcs,
- const std::vector<std::string>& tooltips,
- const LLColor3& func_color);
- LLKeywords::keyword_iterator_t keywordsBegin() { return mKeywords.begin(); }
- LLKeywords::keyword_iterator_t keywordsEnd() { return mKeywords.end(); }
-
// Hacky methods to make it into a word-wrapping, potentially scrolling,
// read-only text box.
void setCommitOnFocusLost(BOOL b) { mCommitOnFocusLost = b; }
@@ -206,7 +194,7 @@ public:
const LLUUID& getSourceID() const { return mSourceID; }
const LLTextSegmentPtr getPreviousSegment() const;
- void getSelectedSegments(segment_vec_t& segments) const;
+ void getSelectedSegments(segment_vec_t& segments) const;
void setShowContextMenu(bool show) { mShowContextMenu = show; }
bool getShowContextMenu() const { return mShowContextMenu; }
@@ -218,7 +206,7 @@ protected:
void drawPreeditMarker();
void assignEmbedded(const std::string &s);
-
+
void removeCharOrTab();
void indentSelectedLines( S32 spaces );
@@ -237,12 +225,12 @@ protected:
S32 nextWordPos(S32 cursorPos) const;
void autoIndent();
-
+
void findEmbeddedItemSegments(S32 start, S32 end);
void getSegmentsInRange(segment_vec_t& segments, S32 start, S32 end, bool include_partial) const;
virtual llwchar pasteEmbeddedItem(llwchar ext_char) { return ext_char; }
-
+
// Here's the method that takes and applies text commands.
S32 execute(TextCmd* cmd);
@@ -256,7 +244,7 @@ protected:
S32 removeChar(S32 pos);
S32 insert(S32 pos, const LLWString &wstr, bool group_with_next_op, LLTextSegmentPtr segment);
S32 remove(S32 pos, S32 length, bool group_with_next_op);
-
+
void focusLostHelper();
void updateAllowingLanguageInput();
BOOL hasPreeditString() const;
@@ -274,14 +262,14 @@ protected:
//
// Protected data
//
- // Probably deserves serious thought to hiding as many of these
+ // Probably deserves serious thought to hiding as many of these
// as possible behind protected accessor methods.
//
// Use these to determine if a click on an embedded item is a drag or not.
S32 mMouseDownX;
S32 mMouseDownY;
-
+
LLWString mPreeditWString;
LLWString mPreeditOverwrittenWString;
std::vector<S32> mPreeditPositions;
@@ -290,11 +278,12 @@ protected:
protected:
LLUIColor mDefaultColor;
- BOOL mShowLineNumbers;
bool mAutoIndent;
+ bool mParseOnTheFly;
- /*virtual*/ void updateSegments();
void updateLinkSegments();
+ void keepSelectionOnReturn(bool keep) { mKeepSelectionOnReturn = keep; }
+ class LLViewBorder* mBorder;
private:
//
@@ -304,23 +293,14 @@ private:
void cleanStringForPaste(LLWString & clean_string);
void pasteTextWithLinebreaks(LLWString & clean_string);
- void drawLineNumbers();
-
void onKeyStroke();
- //
- // Data
- //
- LLKeywords mKeywords;
-
// Concrete TextCmd sub-classes used by the LLTextEditor base class
class TextCmdInsert;
class TextCmdAddChar;
class TextCmdOverwriteChar;
class TextCmdRemove;
- class LLViewBorder* mBorder;
-
BOOL mBaseDocIsPristine;
TextCmd* mPristineCmd;
@@ -335,9 +315,9 @@ private:
BOOL mAllowEmbeddedItems;
bool mShowContextMenu;
- bool mParseOnTheFly;
bool mEnableTooltipPaste;
bool mPassDelete;
+ bool mKeepSelectionOnReturn; // disabling of removing selected text after pressing of Enter
LLUUID mSourceID;
@@ -355,4 +335,4 @@ extern template class LLTextEditor* LLView::getChild<class LLTextEditor>(
const std::string& name, BOOL recurse) const;
#endif
-#endif // LL_TEXTEDITOR_
+#endif // LL_TEXTEDITOR_H
diff --git a/indra/llui/lltextparser.cpp b/indra/llui/lltextparser.cpp
index 8a85f99e0c..0b36241da0 100755
--- a/indra/llui/lltextparser.cpp
+++ b/indra/llui/lltextparser.cpp
@@ -228,7 +228,7 @@ bool LLTextParser::saveToDisk(LLSD highlights)
std::string filename=getFileName();
if (filename.empty())
{
- llwarns << "LLTextParser::saveToDisk() no valid user directory." << llendl;
+ LL_WARNS() << "LLTextParser::saveToDisk() no valid user directory." << LL_ENDL;
return FALSE;
}
llofstream file;
diff --git a/indra/llui/lltextutil.cpp b/indra/llui/lltextutil.cpp
index 4df2c3363f..fff04b34f2 100755
--- a/indra/llui/lltextutil.cpp
+++ b/indra/llui/lltextutil.cpp
@@ -72,7 +72,7 @@ const std::string& LLTextUtil::formatPhoneNumber(const std::string& phone_str)
return formatted_phone_str;
}
-bool LLTextUtil::processUrlMatch(LLUrlMatch* match,LLTextBase* text_base)
+bool LLTextUtil::processUrlMatch(LLUrlMatch* match,LLTextBase* text_base, bool is_content_trusted)
{
if (match == 0 || text_base == 0)
return false;
@@ -85,7 +85,7 @@ bool LLTextUtil::processUrlMatch(LLUrlMatch* match,LLTextBase* text_base)
}
// output an optional icon before the Url
- if (!match->getIcon().empty() )
+ if (is_content_trusted && !match->getIcon().empty() )
{
LLUIImagePtr image = LLUI::getUIImage(match->getIcon());
if (image)
diff --git a/indra/llui/lltextutil.h b/indra/llui/lltextutil.h
index bf7dbb58ce..798f14d086 100755
--- a/indra/llui/lltextutil.h
+++ b/indra/llui/lltextutil.h
@@ -64,7 +64,7 @@ namespace LLTextUtil
*/
const std::string& formatPhoneNumber(const std::string& phone_str);
- bool processUrlMatch(LLUrlMatch* match,LLTextBase* text_base);
+ bool processUrlMatch(LLUrlMatch* match,LLTextBase* text_base, bool is_content_trusted);
class TextHelpers
{
diff --git a/indra/llui/lltoggleablemenu.cpp b/indra/llui/lltoggleablemenu.cpp
index 00d52fe10d..ccb92ffbb2 100755
--- a/indra/llui/lltoggleablemenu.cpp
+++ b/indra/llui/lltoggleablemenu.cpp
@@ -52,7 +52,7 @@ boost::signals2::connection LLToggleableMenu::setVisibilityChangeCallback(const
}
// virtual
-void LLToggleableMenu::handleVisibilityChange (BOOL curVisibilityIn)
+void LLToggleableMenu::onVisibilityChange (BOOL curVisibilityIn)
{
S32 x,y;
LLUI::getMousePositionLocal(LLUI::getRootView(), &x, &y);
diff --git a/indra/llui/lltoggleablemenu.h b/indra/llui/lltoggleablemenu.h
index dfe70cbf54..55a6483021 100755
--- a/indra/llui/lltoggleablemenu.h
+++ b/indra/llui/lltoggleablemenu.h
@@ -45,7 +45,7 @@ public:
boost::signals2::connection setVisibilityChangeCallback( const commit_signal_t::slot_type& cb );
- virtual void handleVisibilityChange (BOOL curVisibilityIn);
+ virtual void onVisibilityChange (BOOL curVisibilityIn);
virtual bool addChild (LLView* view, S32 tab_group = 0);
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index ee82e0403b..abc2b6e9ca 100755
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -42,9 +42,9 @@
namespace LLToolBarEnums
{
- LLLayoutStack::ELayoutOrientation getOrientation(SideType sideType)
+ LLView::EOrientation getOrientation(SideType sideType)
{
- LLLayoutStack::ELayoutOrientation orientation = LLLayoutStack::HORIZONTAL;
+ LLView::EOrientation orientation = LLLayoutStack::HORIZONTAL;
if ((sideType == SIDE_LEFT) || (sideType == SIDE_RIGHT))
{
@@ -148,6 +148,7 @@ void LLToolBar::createContextMenu()
enable_reg.add("Toolbars.CheckSetting", boost::bind(&LLToolBar::isSettingChecked, this, _2));
// Create the context menu
+ llassert(LLMenuGL::sMenuContainer != NULL);
LLContextMenu* menu = LLUICtrlFactory::instance().createFromFile<LLContextMenu>("menu_toolbars.xml", LLMenuGL::sMenuContainer, LLMenuHolderGL::child_registry_t::instance());
if (menu)
@@ -158,7 +159,7 @@ void LLToolBar::createContextMenu()
}
else
{
- llwarns << "Unable to load toolbars context menu." << llendl;
+ LL_WARNS() << "Unable to load toolbars context menu." << LL_ENDL;
}
}
@@ -174,7 +175,7 @@ void LLToolBar::initFromParams(const LLToolBar::Params& p)
// Initialize the base object
LLUICtrl::initFromParams(p);
- LLLayoutStack::ELayoutOrientation orientation = getOrientation(p.side);
+ LLView::EOrientation orientation = getOrientation(p.side);
LLLayoutStack::Params centering_stack_p;
centering_stack_p.name = "centering_stack";
@@ -527,7 +528,7 @@ int LLToolBar::getRankFromPosition(S32 x, S32 y)
int rank = 0;
// Convert the toolbar coord into button panel coords
- LLLayoutStack::ELayoutOrientation orientation = getOrientation(mSideType);
+ LLView::EOrientation orientation = getOrientation(mSideType);
S32 button_panel_x = 0;
S32 button_panel_y = 0;
localPointToOtherView(x, y, &button_panel_x, &button_panel_y, mButtonPanel);
@@ -646,7 +647,7 @@ void LLToolBar::updateLayoutAsNeeded()
{
if (!mNeedsLayout) return;
- LLLayoutStack::ELayoutOrientation orientation = getOrientation(mSideType);
+ LLView::EOrientation orientation = getOrientation(mSideType);
// our terminology for orientation-agnostic layout is such that
// length refers to a distance in the direction we stack the buttons
@@ -1065,7 +1066,7 @@ BOOL LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
mDragRank = getRankFromPosition(x, y);
// Don't DaD if we're dragging a command on itself
mDragAndDropTarget = ((orig_rank != RANK_NONE) && ((mDragRank == orig_rank) || ((mDragRank-1) == orig_rank)) ? false : true);
- //llinfos << "Merov debug : DaD, rank = " << mDragRank << ", dragged uui = " << inv_item->getUUID() << llendl;
+ //LL_INFOS() << "Merov debug : DaD, rank = " << mDragRank << ", dragged uui = " << inv_item->getUUID() << LL_ENDL;
/* Do the following if you want to animate the button itself
LLCommandId dragged_command(inv_item->getUUID());
removeCommand(dragged_command);
diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h
index 9e17eaed8b..370941c787 100755
--- a/indra/llui/lltoolbar.h
+++ b/indra/llui/lltoolbar.h
@@ -138,7 +138,7 @@ namespace LLToolBarEnums
TOOLBAR_LAST = TOOLBAR_BOTTOM,
};
- LLLayoutStack::ELayoutOrientation getOrientation(SideType sideType);
+ LLView::EOrientation getOrientation(SideType sideType);
}
// NOTE: This needs to occur before Param block declaration for proper compilation.
@@ -167,7 +167,6 @@ public:
class LLCenterLayoutPanel : public LLLayoutPanel
{
public:
- typedef struct LLLayoutPanel::Params Params;
typedef boost::function<void(LLToolBarEnums::EToolBarLocation tb, const LLRect& rect)> reshape_callback_t;
virtual ~LLCenterLayoutPanel() {}
diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp
index f52a3b3323..7f2224870d 100755
--- a/indra/llui/lltooltip.cpp
+++ b/indra/llui/lltooltip.cpp
@@ -476,12 +476,16 @@ void LLToolTipMgr::show(const std::string& msg)
void LLToolTipMgr::show(const LLToolTip::Params& params)
{
+ if (!params.styled_message.isProvided()
+ && (!params.message.isProvided() || params.message().empty())
+ && !params.image.isProvided()) return;
+
// fill in default tooltip params from tool_tip.xml
LLToolTip::Params params_with_defaults(params);
params_with_defaults.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLToolTip>());
if (!params_with_defaults.validateBlock())
{
- llwarns << "Could not display tooltip!" << llendl;
+ LL_WARNS() << "Could not display tooltip!" << LL_ENDL;
return;
}
diff --git a/indra/llui/lltrans.cpp b/indra/llui/lltrans.cpp
index 5388069c24..4d4ff4236d 100755
--- a/indra/llui/lltrans.cpp
+++ b/indra/llui/lltrans.cpp
@@ -63,8 +63,8 @@ bool LLTrans::parseStrings(LLXMLNodePtr &root, const std::set<std::string>& defa
std::string xml_filename = "(strings file)";
if (!root->hasName("strings"))
{
- llerrs << "Invalid root node name in " << xml_filename
- << ": was " << root->getName() << ", expected \"strings\"" << llendl;
+ LL_ERRS() << "Invalid root node name in " << xml_filename
+ << ": was " << root->getName() << ", expected \"strings\"" << LL_ENDL;
}
StringTable string_table;
@@ -73,7 +73,7 @@ bool LLTrans::parseStrings(LLXMLNodePtr &root, const std::set<std::string>& defa
if (!string_table.validateBlock())
{
- llerrs << "Problem reading strings: " << xml_filename << llendl;
+ LL_ERRS() << "Problem reading strings: " << xml_filename << LL_ENDL;
return false;
}
@@ -107,8 +107,8 @@ bool LLTrans::parseLanguageStrings(LLXMLNodePtr &root)
std::string xml_filename = "(language strings file)";
if (!root->hasName("strings"))
{
- llerrs << "Invalid root node name in " << xml_filename
- << ": was " << root->getName() << ", expected \"strings\"" << llendl;
+ LL_ERRS() << "Invalid root node name in " << xml_filename
+ << ": was " << root->getName() << ", expected \"strings\"" << LL_ENDL;
}
StringTable string_table;
@@ -117,7 +117,7 @@ bool LLTrans::parseLanguageStrings(LLXMLNodePtr &root)
if (!string_table.validateBlock())
{
- llerrs << "Problem reading strings: " << xml_filename << llendl;
+ LL_ERRS() << "Problem reading strings: " << xml_filename << LL_ENDL;
return false;
}
@@ -135,14 +135,14 @@ bool LLTrans::parseLanguageStrings(LLXMLNodePtr &root)
-static LLFastTimer::DeclareTimer FTM_GET_TRANS("Translate string");
+static LLTrace::BlockTimerStatHandle FTM_GET_TRANS("Translate string");
//static
std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& msg_args)
{
// Don't care about time as much as call count. Make sure we're not
// calling LLTrans::getString() in an inner loop. JC
- LLFastTimer timer(FTM_GET_TRANS);
+ LL_RECORD_BLOCK_TIME(FTM_GET_TRANS);
template_map_t::iterator iter = sStringTemplates.find(xml_desc);
if (iter != sStringTemplates.end())
@@ -166,7 +166,7 @@ std::string LLTrans::getString(const std::string &xml_desc, const LLSD& msg_args
{
// Don't care about time as much as call count. Make sure we're not
// calling LLTrans::getString() in an inner loop. JC
- LLFastTimer timer(FTM_GET_TRANS);
+ LL_RECORD_BLOCK_TIME(FTM_GET_TRANS);
template_map_t::iterator iter = sStringTemplates.find(xml_desc);
if (iter != sStringTemplates.end())
@@ -185,7 +185,7 @@ std::string LLTrans::getString(const std::string &xml_desc, const LLSD& msg_args
//static
bool LLTrans::findString(std::string &result, const std::string &xml_desc, const LLStringUtil::format_map_t& msg_args)
{
- LLFastTimer timer(FTM_GET_TRANS);
+ LL_RECORD_BLOCK_TIME(FTM_GET_TRANS);
template_map_t::iterator iter = sStringTemplates.find(xml_desc);
if (iter != sStringTemplates.end())
@@ -207,7 +207,7 @@ bool LLTrans::findString(std::string &result, const std::string &xml_desc, const
//static
bool LLTrans::findString(std::string &result, const std::string &xml_desc, const LLSD& msg_args)
{
- LLFastTimer timer(FTM_GET_TRANS);
+ LL_RECORD_BLOCK_TIME(FTM_GET_TRANS);
template_map_t::iterator iter = sStringTemplates.find(xml_desc);
if (iter != sStringTemplates.end())
diff --git a/indra/llui/lltrans.h b/indra/llui/lltrans.h
index 128b51d383..a47ce94f08 100755
--- a/indra/llui/lltrans.h
+++ b/indra/llui/lltrans.h
@@ -28,6 +28,7 @@
#define LL_TRANS_H
#include <map>
+#include <set>
#include "llpointer.h"
#include "llstring.h"
diff --git a/indra/llui/lltransutil.cpp b/indra/llui/lltransutil.cpp
index 80d079cbc8..220cee4c90 100755
--- a/indra/llui/lltransutil.cpp
+++ b/indra/llui/lltransutil.cpp
@@ -44,7 +44,7 @@ bool LLTransUtil::parseStrings(const std::string& xml_filename, const std::set<s
bool success = LLUICtrlFactory::getLayeredXMLNode(xml_filename, root, LLDir::ALL_SKINS);
if (!success)
{
- llerrs << "Couldn't load string table " << xml_filename << llendl;
+ LL_ERRS() << "Couldn't load string table " << xml_filename << LL_ENDL;
return false;
}
@@ -59,7 +59,7 @@ bool LLTransUtil::parseLanguageStrings(const std::string& xml_filename)
if (!success)
{
- llerrs << "Couldn't load localization table " << xml_filename << llendl;
+ LL_ERRS() << "Couldn't load localization table " << xml_filename << LL_ENDL;
return false;
}
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 0ddb149738..1f570edd88 100755
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -107,7 +107,7 @@ LLUUID find_ui_sound(const char * namep)
LLUUID uuid = LLUUID(NULL);
if (!LLUI::sSettingGroups["config"]->controlExists(name))
{
- llwarns << "tried to make UI sound for unknown sound name: " << name << llendl;
+ LL_WARNS() << "tried to make UI sound for unknown sound name: " << name << LL_ENDL;
}
else
{
@@ -118,19 +118,19 @@ LLUUID find_ui_sound(const char * namep)
{
if (LLUI::sSettingGroups["config"]->getBOOL("UISndDebugSpamToggle"))
{
- llinfos << "UI sound name: " << name << " triggered but silent (null uuid)" << llendl;
+ LL_INFOS() << "UI sound name: " << name << " triggered but silent (null uuid)" << LL_ENDL;
}
}
else
{
- llwarns << "UI sound named: " << name << " does not translate to a valid uuid" << llendl;
+ LL_WARNS() << "UI sound named: " << name << " does not translate to a valid uuid" << LL_ENDL;
}
}
else if (LLUI::sAudioCallback != NULL)
{
if (LLUI::sSettingGroups["config"]->getBOOL("UISndDebugSpamToggle"))
{
- llinfos << "UI sound name: " << name << llendl;
+ LL_INFOS() << "UI sound name: " << name << LL_ENDL;
}
}
}
@@ -170,7 +170,7 @@ void LLUI::initClass(const settings_map_t& settings,
(get_ptr_in_map(sSettingGroups, std::string("floater")) == NULL) ||
(get_ptr_in_map(sSettingGroups, std::string("ignores")) == NULL))
{
- llerrs << "Failure to initialize configuration groups" << llendl;
+ LL_ERRS() << "Failure to initialize configuration groups" << LL_ENDL;
}
sAudioCallback = audio_callback;
diff --git a/indra/llui/llui.h b/indra/llui/llui.h
index 0bc4424a8c..c727f75c4f 100755
--- a/indra/llui/llui.h
+++ b/indra/llui/llui.h
@@ -29,9 +29,11 @@
#define LL_LLUI_H
#include "llrect.h"
+#include "llcoord.h"
#include "llcontrol.h"
#include "llcoord.h"
-#include "v2math.h"
+#include "llcontrol.h"
+#include "llglslshader.h"
#include "llinitparam.h"
#include "llregistry.h"
#include "llrender2dutils.h"
@@ -40,8 +42,8 @@
#include "lluicolortable.h"
#include "lluiimage.h"
#include <boost/signals2.hpp>
-#include "lllazyvalue.h"
#include "llframetimer.h"
+#include "v2math.h"
#include <limits>
// for initparam specialization
@@ -53,6 +55,53 @@ class LLWindow;
class LLView;
class LLHelp;
+
+// this enum is used by the llview.h (viewer) and the llassetstorage.h (viewer and sim)
+enum EDragAndDropType
+{
+ DAD_NONE = 0,
+ DAD_TEXTURE = 1,
+ DAD_SOUND = 2,
+ DAD_CALLINGCARD = 3,
+ DAD_LANDMARK = 4,
+ DAD_SCRIPT = 5,
+ DAD_CLOTHING = 6,
+ DAD_OBJECT = 7,
+ DAD_NOTECARD = 8,
+ DAD_CATEGORY = 9,
+ DAD_ROOT_CATEGORY = 10,
+ DAD_BODYPART = 11,
+ DAD_ANIMATION = 12,
+ DAD_GESTURE = 13,
+ DAD_LINK = 14,
+ DAD_MESH = 15,
+ DAD_WIDGET = 16,
+ DAD_PERSON = 17,
+ DAD_COUNT = 18, // number of types in this enum
+};
+
+// Reasons for drags to be denied.
+// ordered by priority for multi-drag
+enum EAcceptance
+{
+ ACCEPT_POSTPONED, // we are asynchronously determining acceptance
+ ACCEPT_NO, // Uninformative, general purpose denial.
+ ACCEPT_NO_CUSTOM, // Denial with custom message.
+ ACCEPT_NO_LOCKED, // Operation would be valid, but permissions are set to disallow it.
+ ACCEPT_YES_COPY_SINGLE, // We'll take a copy of a single item
+ ACCEPT_YES_SINGLE, // Accepted. OK to drag and drop single item here.
+ ACCEPT_YES_COPY_MULTI, // We'll take a copy of multiple items
+ ACCEPT_YES_MULTI // Accepted. OK to drag and drop multiple items here.
+};
+
+enum EAddPosition
+{
+ ADD_TOP,
+ ADD_BOTTOM,
+ ADD_DEFAULT
+};
+
+
void make_ui_sound(const char* name);
void make_ui_sound_deferred(const char * name);
@@ -123,7 +172,7 @@ public:
{
if (mMin > mMax)
{
- llwarns << "Bad interval range (" << mMin << ", " << mMax << ")" << llendl;
+ LL_WARNS() << "Bad interval range (" << mMin << ", " << mMax << ")" << LL_ENDL;
// since max is usually the most dangerous one to ignore (buffer overflow, etc), prefer it
// in the case of a malformed range
mMin = mMax;
@@ -362,7 +411,7 @@ private:
static void initClass()
{
- llerrs << "No static initClass() method defined for " << typeid(T).name() << llendl;
+ LL_ERRS() << "No static initClass() method defined for " << typeid(T).name() << LL_ENDL;
}
};
@@ -377,7 +426,7 @@ private:
static void destroyClass()
{
- llerrs << "No static destroyClass() method defined for " << typeid(T).name() << llendl;
+ LL_ERRS() << "No static destroyClass() method defined for " << typeid(T).name() << LL_ENDL;
}
};
diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp
index ffeff15968..244f0c6f00 100755
--- a/indra/llui/lluicolortable.cpp
+++ b/indra/llui/lluicolortable.cpp
@@ -117,7 +117,7 @@ void LLUIColorTable::insertFromParams(const Params& p, string_color_map_t& table
unresolved_refs.erase(iter->second);
}
- llwarns << warning + ending_ref << llendl;
+ LL_WARNS() << warning + ending_ref << LL_ENDL;
break;
}
@@ -156,7 +156,7 @@ void LLUIColorTable::insertFromParams(const Params& p, string_color_map_t& table
iter != visited_refs.end();
++iter)
{
- llwarns << iter->first << " references a non-existent color" << llendl;
+ LL_WARNS() << iter->first << " references a non-existent color" << LL_ENDL;
unresolved_refs.erase(iter->second);
}
@@ -293,13 +293,13 @@ bool LLUIColorTable::loadFromFilename(const std::string& filename, string_color_
if(!LLXMLNode::parseFile(filename, root, NULL))
{
- llwarns << "Unable to parse color file " << filename << llendl;
+ LL_WARNS() << "Unable to parse color file " << filename << LL_ENDL;
return false;
}
if(!root->hasName("colors"))
{
- llwarns << filename << " is not a valid color definition file" << llendl;
+ LL_WARNS() << filename << " is not a valid color definition file" << LL_ENDL;
return false;
}
@@ -313,7 +313,7 @@ bool LLUIColorTable::loadFromFilename(const std::string& filename, string_color_
}
else
{
- llwarns << filename << " failed to load" << llendl;
+ LL_WARNS() << filename << " failed to load" << LL_ENDL;
return false;
}
diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp
index 1722bf27bd..df74e113e9 100755
--- a/indra/llui/lluictrl.cpp
+++ b/indra/llui/lluictrl.cpp
@@ -33,6 +33,8 @@
#include "llfocusmgr.h"
#include "llpanel.h"
#include "lluictrlfactory.h"
+#include "lltabcontainer.h"
+#include "llaccordionctrltab.h"
static LLDefaultChildRegistry::Register<LLUICtrl> r("ui_ctrl");
@@ -118,6 +120,7 @@ LLUICtrl::LLUICtrl(const LLUICtrl::Params& p, const LLViewModelPtr& viewmodel)
mDoubleClickSignal(NULL),
mTransparencyType(TT_DEFAULT)
{
+ claimMem(viewmodel.get());
}
void LLUICtrl::initFromParams(const Params& p)
@@ -211,7 +214,7 @@ LLUICtrl::~LLUICtrl()
if( gFocusMgr.getTopCtrl() == this )
{
- llwarns << "UI Control holding top ctrl deleted: " << getName() << ". Top view removed." << llendl;
+ LL_WARNS() << "UI Control holding top ctrl deleted: " << getName() << ". Top view removed." << LL_ENDL;
gFocusMgr.removeTopCtrlWithoutCallback( this );
}
@@ -257,7 +260,7 @@ LLUICtrl::commit_signal_t::slot_type LLUICtrl::initCommitCallback(const CommitCa
}
else if (!function_name.empty())
{
- llwarns << "No callback found for: '" << function_name << "' in control: " << getName() << llendl;
+ LL_WARNS() << "No callback found for: '" << function_name << "' in control: " << getName() << LL_ENDL;
}
}
return default_commit_handler;
@@ -309,7 +312,7 @@ void LLUICtrl::onMouseLeave(S32 x, S32 y, MASK mask)
BOOL LLUICtrl::handleMouseDown(S32 x, S32 y, MASK mask)
{
- lldebugs << "LLUICtrl::handleMouseDown calling LLView)'s handleMouseUp (first initialized xui to: " << getPathname() << " )" << llendl;
+ LL_DEBUGS() << "LLUICtrl::handleMouseDown calling LLView)'s handleMouseUp (first initialized xui to: " << getPathname() << " )" << LL_ENDL;
BOOL handled = LLView::handleMouseDown(x,y,mask);
@@ -317,7 +320,7 @@ BOOL LLUICtrl::handleMouseDown(S32 x, S32 y, MASK mask)
{
(*mMouseDownSignal)(this,x,y,mask);
}
- lldebugs << "LLUICtrl::handleMousedown - handled is returning as: " << handled << " " << llendl;
+ LL_DEBUGS() << "LLUICtrl::handleMousedown - handled is returning as: " << handled << " " << LL_ENDL;
if (handled) {
LLViewerEventRecorder::instance().updateMouseEventInfo(x,y,-56,-56,getPathname());
@@ -329,7 +332,7 @@ BOOL LLUICtrl::handleMouseDown(S32 x, S32 y, MASK mask)
BOOL LLUICtrl::handleMouseUp(S32 x, S32 y, MASK mask)
{
- lldebugs << "LLUICtrl::handleMouseUp calling LLView)'s handleMouseUp (first initialized xui to: " << getPathname() << " )" << llendl;
+ LL_DEBUGS() << "LLUICtrl::handleMouseUp calling LLView)'s handleMouseUp (first initialized xui to: " << getPathname() << " )" << LL_ENDL;
BOOL handled = LLView::handleMouseUp(x,y,mask);
if (handled) {
@@ -340,7 +343,7 @@ BOOL LLUICtrl::handleMouseUp(S32 x, S32 y, MASK mask)
(*mMouseUpSignal)(this,x,y,mask);
}
- lldebugs << "LLUICtrl::handleMouseUp - handled for xui " << getPathname() << " - is returning as: " << handled << " " << llendl;
+ LL_DEBUGS() << "LLUICtrl::handleMouseUp - handled for xui " << getPathname() << " - is returning as: " << handled << " " << LL_ENDL;
return handled;
}
@@ -469,7 +472,7 @@ void LLUICtrl::setControlVariable(LLControlVariable* control)
if (mControlVariable)
{
//RN: this will happen in practice, should we try to avoid it?
- //llwarns << "setControlName called twice on same control!" << llendl;
+ //LL_WARNS() << "setControlName called twice on same control!" << LL_ENDL;
mControlConnection.disconnect(); // disconnect current signal
mControlVariable = NULL;
}
@@ -719,54 +722,19 @@ BOOL LLUICtrl::getIsChrome() const
}
}
-// this comparator uses the crazy disambiguating logic of LLCompareByTabOrder,
-// but to switch up the order so that children that have the default tab group come first
-// and those that are prior to the default tab group come last
-class CompareByDefaultTabGroup: public LLCompareByTabOrder
-{
-public:
- CompareByDefaultTabGroup(const LLView::child_tab_order_t& order, S32 default_tab_group):
- LLCompareByTabOrder(order),
- mDefaultTabGroup(default_tab_group) {}
-private:
- /*virtual*/ bool compareTabOrders(const LLView::tab_order_t & a, const LLView::tab_order_t & b) const
- {
- S32 ag = a.first; // tab group for a
- S32 bg = b.first; // tab group for b
- // these two ifs have the effect of moving elements prior to the default tab group to the end of the list
- // (still sorted relative to each other, though)
- if(ag < mDefaultTabGroup && bg >= mDefaultTabGroup) return false;
- if(bg < mDefaultTabGroup && ag >= mDefaultTabGroup) return true;
- return a < b; // sort correctly if they're both on the same side of the default tab group
- }
- S32 mDefaultTabGroup;
-};
-// Sorter for plugging into the query.
-// I'd have defined it local to the one method that uses it but that broke the VS 05 compiler. -MG
-class LLUICtrl::DefaultTabGroupFirstSorter : public LLQuerySorter, public LLSingleton<DefaultTabGroupFirstSorter>
-{
-public:
- /*virtual*/ void operator() (LLView * parent, viewList_t &children) const
- {
- children.sort(CompareByDefaultTabGroup(parent->getCtrlOrder(), parent->getDefaultTabGroup()));
- }
-};
-
-LLFastTimer::DeclareTimer FTM_FOCUS_FIRST_ITEM("Focus First Item");
+LLTrace::BlockTimerStatHandle FTM_FOCUS_FIRST_ITEM("Focus First Item");
BOOL LLUICtrl::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash)
{
- LLFastTimer _(FTM_FOCUS_FIRST_ITEM);
+ LL_RECORD_BLOCK_TIME(FTM_FOCUS_FIRST_ITEM);
// try to select default tab group child
- LLCtrlQuery query = getTabOrderQuery();
- // sort things such that the default tab group is at the front
- query.setSorter(DefaultTabGroupFirstSorter::getInstance());
+ LLViewQuery query = getTabOrderQuery();
child_list_t result = query(this);
if(result.size() > 0)
{
- LLUICtrl * ctrl = static_cast<LLUICtrl*>(result.front());
+ LLUICtrl * ctrl = static_cast<LLUICtrl*>(result.back());
if(!ctrl->hasFocus())
{
ctrl->setFocus(TRUE);
@@ -781,17 +749,20 @@ BOOL LLUICtrl::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash)
// search for text field first
if(prefer_text_fields)
{
- LLCtrlQuery query = getTabOrderQuery();
+ LLViewQuery query = getTabOrderQuery();
query.addPreFilter(LLUICtrl::LLTextInputFilter::getInstance());
child_list_t result = query(this);
if(result.size() > 0)
{
- LLUICtrl * ctrl = static_cast<LLUICtrl*>(result.front());
+ LLUICtrl * ctrl = static_cast<LLUICtrl*>(result.back());
if(!ctrl->hasFocus())
{
ctrl->setFocus(TRUE);
ctrl->onTabInto();
- gFocusMgr.triggerFocusFlash();
+ if(focus_flash)
+ {
+ gFocusMgr.triggerFocusFlash();
+ }
}
return TRUE;
}
@@ -800,58 +771,26 @@ BOOL LLUICtrl::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash)
result = getTabOrderQuery().run(this);
if(result.size() > 0)
{
- LLUICtrl * ctrl = static_cast<LLUICtrl*>(result.front());
+ LLUICtrl * ctrl = static_cast<LLUICtrl*>(result.back());
if(!ctrl->hasFocus())
{
ctrl->setFocus(TRUE);
ctrl->onTabInto();
- gFocusMgr.triggerFocusFlash();
- }
- return TRUE;
- }
- return FALSE;
-}
-
-BOOL LLUICtrl::focusLastItem(BOOL prefer_text_fields)
-{
- // search for text field first
- if(prefer_text_fields)
- {
- LLCtrlQuery query = getTabOrderQuery();
- query.addPreFilter(LLUICtrl::LLTextInputFilter::getInstance());
- child_list_t result = query(this);
- if(result.size() > 0)
- {
- LLUICtrl * ctrl = static_cast<LLUICtrl*>(result.back());
- if(!ctrl->hasFocus())
+ if(focus_flash)
{
- ctrl->setFocus(TRUE);
- ctrl->onTabInto();
gFocusMgr.triggerFocusFlash();
}
- return TRUE;
- }
- }
- // no text field found, or we don't care about text fields
- child_list_t result = getTabOrderQuery().run(this);
- if(result.size() > 0)
- {
- LLUICtrl * ctrl = static_cast<LLUICtrl*>(result.back());
- if(!ctrl->hasFocus())
- {
- ctrl->setFocus(TRUE);
- ctrl->onTabInto();
- gFocusMgr.triggerFocusFlash();
}
return TRUE;
}
return FALSE;
}
+
BOOL LLUICtrl::focusNextItem(BOOL text_fields_only)
{
// this assumes that this method is called on the focus root.
- LLCtrlQuery query = getTabOrderQuery();
+ LLViewQuery query = getTabOrderQuery();
static LLUICachedControl<bool> tab_to_text_fields_only ("TabToTextFieldsOnly", false);
if(text_fields_only || tab_to_text_fields_only)
{
@@ -864,7 +803,7 @@ BOOL LLUICtrl::focusNextItem(BOOL text_fields_only)
BOOL LLUICtrl::focusPrevItem(BOOL text_fields_only)
{
// this assumes that this method is called on the focus root.
- LLCtrlQuery query = getTabOrderQuery();
+ LLViewQuery query = getTabOrderQuery();
static LLUICachedControl<bool> tab_to_text_fields_only ("TabToTextFieldsOnly", false);
if(text_fields_only || tab_to_text_fields_only)
{
@@ -921,8 +860,26 @@ bool LLUICtrl::findHelpTopic(std::string& help_topic_out)
if (panel)
{
+
+ LLView *child;
+ LLPanel *subpanel = NULL;
+
// does the panel have a sub-panel with a help topic?
- LLPanel *subpanel = panel->childGetVisiblePanelWithHelp();
+ bfs_tree_iterator_t it = beginTreeBFS();
+ // skip ourselves
+ ++it;
+ for (; it != endTreeBFS(); ++it)
+ {
+ child = *it;
+ // do we have a panel with a help topic?
+ LLPanel *panel = dynamic_cast<LLPanel *>(child);
+ if (panel && panel->isInVisibleChain() && !panel->getHelpTopic().empty())
+ {
+ subpanel = panel;
+ break;
+ }
+ }
+
if (subpanel)
{
help_topic_out = subpanel->getHelpTopic();
@@ -930,10 +887,41 @@ bool LLUICtrl::findHelpTopic(std::string& help_topic_out)
}
// does the panel have an active tab with a help topic?
- LLPanel *tab = panel->childGetVisibleTabWithHelp();
- if (tab)
+ LLPanel *tab_panel = NULL;
+
+ it = beginTreeBFS();
+ // skip ourselves
+ ++it;
+ for (; it != endTreeBFS(); ++it)
+ {
+ child = *it;
+ LLPanel *curTabPanel = NULL;
+
+ // do we have a tab container?
+ LLTabContainer *tab = dynamic_cast<LLTabContainer *>(child);
+ if (tab && tab->getVisible())
+ {
+ curTabPanel = tab->getCurrentPanel();
+ }
+
+ // do we have an accordion tab?
+ LLAccordionCtrlTab* accordion = dynamic_cast<LLAccordionCtrlTab *>(child);
+ if (accordion && accordion->getDisplayChildren())
+ {
+ curTabPanel = dynamic_cast<LLPanel *>(accordion->getAccordionView());
+ }
+
+ // if we found a valid tab, does it have a help topic?
+ if (curTabPanel && !curTabPanel->getHelpTopic().empty())
+ {
+ tab_panel = curTabPanel;
+ break;
+ }
+ }
+
+ if (tab_panel)
{
- help_topic_out = tab->getHelpTopic();
+ help_topic_out = tab_panel->getHelpTopic();
return true; // success (tab)
}
@@ -959,6 +947,8 @@ boost::signals2::connection LLUICtrl::setCommitCallback( boost::function<void (L
boost::signals2::connection LLUICtrl::setValidateBeforeCommit( boost::function<bool (const LLSD& data)> cb )
{
if (!mValidateSignal) mValidateSignal = new enable_signal_t();
+ claimMem(mValidateSignal);
+
return mValidateSignal->connect(boost::bind(cb, _2));
}
@@ -1022,54 +1012,72 @@ boost::signals2::connection LLUICtrl::setValidateCallback(const EnableCallbackPa
boost::signals2::connection LLUICtrl::setCommitCallback( const commit_signal_t::slot_type& cb )
{
if (!mCommitSignal) mCommitSignal = new commit_signal_t();
+ claimMem(mCommitSignal);
+
return mCommitSignal->connect(cb);
}
boost::signals2::connection LLUICtrl::setValidateCallback( const enable_signal_t::slot_type& cb )
{
if (!mValidateSignal) mValidateSignal = new enable_signal_t();
+ claimMem(mValidateSignal);
+
return mValidateSignal->connect(cb);
}
boost::signals2::connection LLUICtrl::setMouseEnterCallback( const commit_signal_t::slot_type& cb )
{
if (!mMouseEnterSignal) mMouseEnterSignal = new commit_signal_t();
+ claimMem(mMouseEnterSignal);
+
return mMouseEnterSignal->connect(cb);
}
boost::signals2::connection LLUICtrl::setMouseLeaveCallback( const commit_signal_t::slot_type& cb )
{
if (!mMouseLeaveSignal) mMouseLeaveSignal = new commit_signal_t();
+ claimMem(mMouseLeaveSignal);
+
return mMouseLeaveSignal->connect(cb);
}
boost::signals2::connection LLUICtrl::setMouseDownCallback( const mouse_signal_t::slot_type& cb )
{
if (!mMouseDownSignal) mMouseDownSignal = new mouse_signal_t();
+ claimMem(mMouseDownSignal);
+
return mMouseDownSignal->connect(cb);
}
boost::signals2::connection LLUICtrl::setMouseUpCallback( const mouse_signal_t::slot_type& cb )
{
if (!mMouseUpSignal) mMouseUpSignal = new mouse_signal_t();
+ claimMem(mMouseUpSignal);
+
return mMouseUpSignal->connect(cb);
}
boost::signals2::connection LLUICtrl::setRightMouseDownCallback( const mouse_signal_t::slot_type& cb )
{
if (!mRightMouseDownSignal) mRightMouseDownSignal = new mouse_signal_t();
+ claimMem(mRightMouseDownSignal);
+
return mRightMouseDownSignal->connect(cb);
}
boost::signals2::connection LLUICtrl::setRightMouseUpCallback( const mouse_signal_t::slot_type& cb )
{
if (!mRightMouseUpSignal) mRightMouseUpSignal = new mouse_signal_t();
+ claimMem(mRightMouseUpSignal);
+
return mRightMouseUpSignal->connect(cb);
}
boost::signals2::connection LLUICtrl::setDoubleClickCallback( const mouse_signal_t::slot_type& cb )
{
if (!mDoubleClickSignal) mDoubleClickSignal = new mouse_signal_t();
+ claimMem(mDoubleClickSignal);
+
return mDoubleClickSignal->connect(cb);
}
diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h
index fb2196bb16..99553ee0d2 100755
--- a/indra/llui/lluictrl.h
+++ b/indra/llui/lluictrl.h
@@ -220,7 +220,6 @@ public:
BOOL focusNextItem(BOOL text_entry_only);
BOOL focusPrevItem(BOOL text_entry_only);
BOOL focusFirstItem(BOOL prefer_text_fields = FALSE, BOOL focus_flash = TRUE );
- BOOL focusLastItem(BOOL prefer_text_fields = FALSE);
// Non Virtuals
LLHandle<LLUICtrl> getHandle() const { return getDerivedHandle<LLUICtrl>(); }
@@ -315,8 +314,6 @@ private:
BOOL mTentative;
ETypeTransparency mTransparencyType;
-
- class DefaultTabGroupFirstSorter;
};
// Build time optimization, generate once in .cpp file
diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp
index 60fee47ae0..4cc7da1267 100755
--- a/indra/llui/lluictrlfactory.cpp
+++ b/indra/llui/lluictrlfactory.cpp
@@ -44,9 +44,9 @@
// this library includes
#include "llpanel.h"
-LLFastTimer::DeclareTimer FTM_WIDGET_CONSTRUCTION("Widget Construction");
-LLFastTimer::DeclareTimer FTM_INIT_FROM_PARAMS("Widget InitFromParams");
-LLFastTimer::DeclareTimer FTM_WIDGET_SETUP("Widget Setup");
+LLTrace::BlockTimerStatHandle FTM_WIDGET_CONSTRUCTION("Widget Construction");
+LLTrace::BlockTimerStatHandle FTM_INIT_FROM_PARAMS("Widget InitFromParams");
+LLTrace::BlockTimerStatHandle FTM_WIDGET_SETUP("Widget Setup");
//-----------------------------------------------------------------------------
@@ -105,12 +105,12 @@ void LLUICtrlFactory::loadWidgetTemplate(const std::string& widget_tag, LLInitPa
}
}
-static LLFastTimer::DeclareTimer FTM_CREATE_CHILDREN("Create XUI Children");
+static LLTrace::BlockTimerStatHandle FTM_CREATE_CHILDREN("Create XUI Children");
//static
void LLUICtrlFactory::createChildren(LLView* viewp, LLXMLNodePtr node, const widget_registry_t& registry, LLXMLNodePtr output_node)
{
- LLFastTimer ft(FTM_CREATE_CHILDREN);
+ LL_RECORD_BLOCK_TIME(FTM_CREATE_CHILDREN);
if (node.isNull()) return;
for (LLXMLNodePtr child_node = node->getFirstChild(); child_node.notNull(); child_node = child_node->getNextSibling())
@@ -131,11 +131,11 @@ void LLUICtrlFactory::createChildren(LLView* viewp, LLXMLNodePtr node, const wid
// for the child widget
// You might need to add something like:
// static ParentWidgetRegistry::Register<ChildWidgetType> register("child_widget_name");
- llwarns << child_name << " is not a valid child of " << node->getName()->mString << llendl;
+ LL_WARNS() << child_name << " is not a valid child of " << node->getName()->mString << LL_ENDL;
}
else
{
- llwarns << "Could not create widget named " << child_node->getName()->mString << llendl;
+ LL_WARNS() << "Could not create widget named " << child_node->getName()->mString << LL_ENDL;
}
}
@@ -147,14 +147,14 @@ void LLUICtrlFactory::createChildren(LLView* viewp, LLXMLNodePtr node, const wid
}
-static LLFastTimer::DeclareTimer FTM_XML_PARSE("XML Reading/Parsing");
+static LLTrace::BlockTimerStatHandle FTM_XML_PARSE("XML Reading/Parsing");
//-----------------------------------------------------------------------------
// getLayeredXMLNode()
//-----------------------------------------------------------------------------
bool LLUICtrlFactory::getLayeredXMLNode(const std::string &xui_filename, LLXMLNodePtr& root,
LLDir::ESkinConstraint constraint)
{
- LLFastTimer timer(FTM_XML_PARSE);
+ LL_RECORD_BLOCK_TIME(FTM_XML_PARSE);
std::vector<std::string> paths =
gDirUtilp->findSkinnedFilenames(LLDir::XUI, xui_filename, constraint);
@@ -179,11 +179,11 @@ S32 LLUICtrlFactory::saveToXML(LLView* viewp, const std::string& filename)
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-static LLFastTimer::DeclareTimer FTM_CREATE_FROM_XML("Create child widget");
+static LLTrace::BlockTimerStatHandle FTM_CREATE_FROM_XML("Create child widget");
LLView *LLUICtrlFactory::createFromXML(LLXMLNodePtr node, LLView* parent, const std::string& filename, const widget_registry_t& registry, LLXMLNodePtr output_node)
{
- LLFastTimer timer(FTM_CREATE_FROM_XML);
+ LL_RECORD_BLOCK_TIME(FTM_CREATE_FROM_XML);
std::string ctrl_type = node->getName()->mString;
LLStringUtil::toLower(ctrl_type);
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index 876bb5ef46..a5796c8af2 100755
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -74,9 +74,9 @@ class LLWidgetNameRegistry
//: public LLRegistrySingleton<const std::type_info*, empty_param_block_func_t, LLDefaultParamBlockRegistry>
//{};
-extern LLFastTimer::DeclareTimer FTM_WIDGET_SETUP;
-extern LLFastTimer::DeclareTimer FTM_WIDGET_CONSTRUCTION;
-extern LLFastTimer::DeclareTimer FTM_INIT_FROM_PARAMS;
+extern LLTrace::BlockTimerStatHandle FTM_WIDGET_SETUP;
+extern LLTrace::BlockTimerStatHandle FTM_WIDGET_CONSTRUCTION;
+extern LLTrace::BlockTimerStatHandle FTM_INIT_FROM_PARAMS;
// Build time optimization, generate this once in .cpp file
#ifndef LLUICTRLFACTORY_CPP
@@ -170,8 +170,8 @@ public:
LLXMLNodePtr root_node;
if (!LLUICtrlFactory::getLayeredXMLNode(filename, root_node))
- {
- llwarns << "Couldn't parse XUI file: " << instance().getCurFileName() << llendl;
+ {
+ LL_WARNS() << "Couldn't parse XUI file: " << instance().getCurFileName() << LL_ENDL;
goto fail;
}
@@ -182,7 +182,7 @@ public:
// not of right type, so delete it
if (!widget)
{
- llwarns << "Widget in " << filename << " was of type " << typeid(view).name() << " instead of expected type " << typeid(T).name() << llendl;
+ LL_WARNS() << "Widget in " << filename << " was of type " << typeid(view).name() << " instead of expected type " << typeid(T).name() << LL_ENDL;
delete view;
view = NULL;
}
@@ -225,14 +225,14 @@ private:
if (!params.validateBlock())
{
- llwarns << getInstance()->getCurFileName() << ": Invalid parameter block for " << typeid(T).name() << llendl;
+ LL_WARNS() << getInstance()->getCurFileName() << ": Invalid parameter block for " << typeid(T).name() << LL_ENDL;
//return NULL;
}
- { LLFastTimer _(FTM_WIDGET_CONSTRUCTION);
+ { LL_RECORD_BLOCK_TIME(FTM_WIDGET_CONSTRUCTION);
widget = new T(params);
}
- { LLFastTimer _(FTM_INIT_FROM_PARAMS);
+ { LL_RECORD_BLOCK_TIME(FTM_INIT_FROM_PARAMS);
widget->initFromParams(params);
}
@@ -247,7 +247,7 @@ private:
template<typename T>
static T* defaultBuilder(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node)
{
- LLFastTimer timer(FTM_WIDGET_SETUP);
+ LL_RECORD_BLOCK_TIME(FTM_WIDGET_SETUP);
typename T::Params params(getDefaultParams<T>());
@@ -259,10 +259,8 @@ private:
// We always want to output top-left coordinates
typename T::Params output_params(params);
T::setupParamsForExport(output_params, parent);
- // Export only the differences between this any default params
- typename T::Params default_params(getDefaultParams<T>());
copyName(node, output_node);
- parser.writeXUI(output_node, output_params, &default_params);
+ parser.writeXUI(output_node, output_params, LLInitParam::default_parse_rules(), &getDefaultParams<T>());
}
// Apply layout transformations, usually munging rect
diff --git a/indra/llui/lluistring.cpp b/indra/llui/lluistring.cpp
index c4e073ccdb..98d0c215e6 100755
--- a/indra/llui/lluistring.cpp
+++ b/indra/llui/lluistring.cpp
@@ -26,10 +26,12 @@
#include "linden_common.h"
#include "lluistring.h"
+
+#include "llfasttimer.h"
#include "llsd.h"
#include "lltrans.h"
-LLFastTimer::DeclareTimer FTM_UI_STRING("UI String");
+LLTrace::BlockTimerStatHandle FTM_UI_STRING("UI String");
LLUIString::LLUIString(const std::string& instring, const LLStringUtil::format_map_t& args)
@@ -54,7 +56,7 @@ void LLUIString::setArgList(const LLStringUtil::format_map_t& args)
void LLUIString::setArgs(const LLSD& sd)
{
- LLFastTimer timer(FTM_UI_STRING);
+ LL_RECORD_BLOCK_TIME(FTM_UI_STRING);
if (!sd.isMap()) return;
for(LLSD::map_const_iterator sd_it = sd.beginMap();
@@ -117,7 +119,7 @@ void LLUIString::updateResult() const
{
mNeedsResult = false;
- LLFastTimer timer(FTM_UI_STRING);
+ LL_RECORD_BLOCK_TIME(FTM_UI_STRING);
// optimize for empty strings (don't attempt string replacement)
if (mOrig.empty())
diff --git a/indra/llui/lluistring.h b/indra/llui/lluistring.h
index cb40c85582..07e02de6d8 100755
--- a/indra/llui/lluistring.h
+++ b/indra/llui/lluistring.h
@@ -42,12 +42,12 @@
// LLUIString mMessage("Welcome [USERNAME] to [SECONDLIFE]!");
// mMessage.setArg("[USERNAME]", "Steve");
// mMessage.setArg("[SECONDLIFE]", "Second Life");
-// llinfos << mMessage.getString() << llendl; // outputs "Welcome Steve to Second Life"
+// LL_INFOS() << mMessage.getString() << LL_ENDL; // outputs "Welcome Steve to Second Life"
// mMessage.setArg("[USERNAME]", "Joe");
-// llinfos << mMessage.getString() << llendl; // outputs "Welcome Joe to Second Life"
+// LL_INFOS() << mMessage.getString() << LL_ENDL; // outputs "Welcome Joe to Second Life"
// mMessage = "Bienvenido a la [SECONDLIFE] [USERNAME]"
// mMessage.setArg("[SECONDLIFE]", "Segunda Vida");
-// llinfos << mMessage.getString() << llendl; // outputs "Bienvenido a la Segunda Vida Joe"
+// LL_INFOS() << mMessage.getString() << LL_ENDL; // outputs "Bienvenido a la Segunda Vida Joe"
// Implementation Notes:
// Attempting to have operator[](const std::string& s) return mArgs[s] fails because we have
diff --git a/indra/llui/llundo.cpp b/indra/llui/llundo.cpp
index 06b0514223..7c4c183a30 100755
--- a/indra/llui/llundo.cpp
+++ b/indra/llui/llundo.cpp
@@ -51,7 +51,7 @@ LLUndoBuffer::LLUndoBuffer( LLUndoAction (*create_func()), S32 initial_count )
mActions[i] = create_func();
if (!mActions[i])
{
- llerrs << "Unable to create action for undo buffer" << llendl;
+ LL_ERRS() << "Unable to create action for undo buffer" << LL_ENDL;
}
}
}
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index 840f67968d..6f3122e7a1 100755
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -789,7 +789,7 @@ std::string LLUrlEntryParcel::getLabel(const std::string &url, const LLUrlLabelC
if (path_parts < 3) // no parcel id
{
- llwarns << "Failed to parse url [" << url << "]" << llendl;
+ LL_WARNS() << "Failed to parse url [" << url << "]" << LL_ENDL;
return url;
}
@@ -929,7 +929,7 @@ std::string LLUrlEntryRegion::getLabel(const std::string &url, const LLUrlLabelC
if (path_parts < 3) // no region name
{
- llwarns << "Failed to parse url [" << url << "]" << llendl;
+ LL_WARNS() << "Failed to parse url [" << url << "]" << LL_ENDL;
return url;
}
diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h
index 8c6c32178a..d4684e2e1e 100755
--- a/indra/llui/llurlentry.h
+++ b/indra/llui/llurlentry.h
@@ -32,6 +32,7 @@
#include "lluicolor.h"
#include "llstyle.h"
+#include "llavatarname.h"
#include "llhost.h" // for resolving parcel name by parcel id
#include <boost/signals2.hpp>
diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp
index 523ee5d78c..bccc646821 100755
--- a/indra/llui/llurlregistry.cpp
+++ b/indra/llui/llurlregistry.cpp
@@ -41,7 +41,8 @@ LLUrlRegistry::LLUrlRegistry()
// Urls are matched in the order that they were registered
registerUrl(new LLUrlEntryNoLink());
- registerUrl(new LLUrlEntryIcon());
+ mUrlEntryIcon = new LLUrlEntryIcon();
+ registerUrl(mUrlEntryIcon);
registerUrl(new LLUrlEntrySLURL());
registerUrl(new LLUrlEntryHTTP());
registerUrl(new LLUrlEntryHTTPLabel());
@@ -145,7 +146,7 @@ static bool stringHasUrl(const std::string &text)
text.find("<icon") != std::string::npos);
}
-bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LLUrlLabelCallback &cb)
+bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LLUrlLabelCallback &cb, bool is_content_trusted)
{
// avoid costly regexes if there is clearly no URL in the text
if (! stringHasUrl(text))
@@ -160,6 +161,12 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL
std::vector<LLUrlEntryBase *>::iterator it;
for (it = mUrlEntry.begin(); it != mUrlEntry.end(); ++it)
{
+ //Skip for url entry icon if content is not trusted
+ if(!is_content_trusted && (mUrlEntryIcon == *it))
+ {
+ continue;
+ }
+
LLUrlEntryBase *url_entry = *it;
U32 start = 0, end = 0;
diff --git a/indra/llui/llurlregistry.h b/indra/llui/llurlregistry.h
index da16171a97..6270df1bbb 100755
--- a/indra/llui/llurlregistry.h
+++ b/indra/llui/llurlregistry.h
@@ -73,7 +73,8 @@ public:
/// get the next Url in an input string, starting at a given character offset
/// your callback is invoked if the matched Url's label changes in the future
bool findUrl(const std::string &text, LLUrlMatch &match,
- const LLUrlLabelCallback &cb = &LLUrlRegistryNullCallback);
+ const LLUrlLabelCallback &cb = &LLUrlRegistryNullCallback,
+ bool is_content_trusted = false);
/// a slightly less efficient version of findUrl for wide strings
bool findUrl(const LLWString &text, LLUrlMatch &match,
@@ -92,6 +93,7 @@ private:
friend class LLSingleton<LLUrlRegistry>;
std::vector<LLUrlEntryBase *> mUrlEntry;
+ LLUrlEntryBase* mUrlEntryIcon;
};
#endif
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 5ee2169b66..77c8878f4b 100755
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -30,7 +30,6 @@
#define LLVIEW_CPP
#include "llview.h"
-#include <cassert>
#include <sstream>
#include <boost/tokenizer.hpp>
#include <boost/foreach.hpp>
@@ -87,6 +86,16 @@ template class LLView* LLView::getChild<class LLView>(
static LLDefaultChildRegistry::Register<LLView> r("view");
+namespace LLInitParam
+{
+ void TypeValues<LLView::EOrientation>::declareValues()
+ {
+ declare("horizontal", LLView::HORIZONTAL);
+ declare("vertical", LLView::VERTICAL);
+ }
+}
+
+
LLView::Follows::Follows()
: string(""),
flags("flags", FOLLOWS_LEFT | FOLLOWS_TOP)
@@ -124,7 +133,8 @@ LLView::Params::Params()
}
LLView::LLView(const LLView::Params& p)
-: mVisible(p.visible),
+: LLTrace::MemTrackable<LLView>("LLView"),
+ mVisible(p.visible),
mInDraw(false),
mName(p.name),
mParentView(NULL),
@@ -132,7 +142,6 @@ LLView::LLView(const LLView::Params& p)
mFromXUI(p.from_xui),
mIsFocusRoot(p.focus_root),
mLastVisible(FALSE),
- mNextInsertionOrdinal(0),
mHoverCursor(getCursorFromString(p.hover_cursor)),
mEnabled(p.enabled),
mMouseOpaque(p.mouse_opaque),
@@ -151,10 +160,10 @@ LLView::LLView(const LLView::Params& p)
LLView::~LLView()
{
dirtyRect();
- //llinfos << "Deleting view " << mName << ":" << (void*) this << llendl;
+ //LL_INFOS() << "Deleting view " << mName << ":" << (void*) this << LL_ENDL;
if (LLView::sIsDrawing)
{
- lldebugs << "Deleting view " << mName << " during UI draw() phase" << llendl;
+ LL_DEBUGS() << "Deleting view " << mName << " during UI draw() phase" << LL_ENDL;
}
// llassert(LLView::sIsDrawing == FALSE);
@@ -162,7 +171,7 @@ LLView::~LLView()
if( hasMouseCapture() )
{
- //llwarns << "View holding mouse capture deleted: " << getName() << ". Mouse capture removed." << llendl;
+ //LL_WARNS() << "View holding mouse capture deleted: " << getName() << ". Mouse capture removed." << LL_ENDL;
gFocusMgr.removeMouseCaptureWithoutCallback( this );
}
@@ -267,22 +276,6 @@ void LLView::sendChildToBack(LLView* child)
}
}
-void LLView::moveChildToFrontOfTabGroup(LLUICtrl* child)
-{
- if(mCtrlOrder.find(child) != mCtrlOrder.end())
- {
- mCtrlOrder[child].second = -1 * mNextInsertionOrdinal++;
- }
-}
-
-void LLView::moveChildToBackOfTabGroup(LLUICtrl* child)
-{
- if(mCtrlOrder.find(child) != mCtrlOrder.end())
- {
- mCtrlOrder[child].second = mNextInsertionOrdinal++;
- }
-}
-
// virtual
bool LLView::addChild(LLView* child, S32 tab_group)
{
@@ -290,9 +283,10 @@ bool LLView::addChild(LLView* child, S32 tab_group)
{
return false;
}
- if (mParentView == child)
+
+ if (this == child)
{
- llerrs << "Adding view " << child->getName() << " as child of itself" << llendl;
+ LL_ERRS() << "Adding view " << child->getName() << " as child of itself" << LL_ENDL;
}
// remove from current parent
@@ -304,14 +298,10 @@ bool LLView::addChild(LLView* child, S32 tab_group)
// add to front of child list, as normal
mChildList.push_front(child);
- // add to ctrl list if is LLUICtrl
- if (child->isCtrl())
+ // add to tab order list
+ if (tab_group != 0)
{
- LLUICtrl* ctrl = static_cast<LLUICtrl*>(child);
- mCtrlOrder.insert(tab_order_pair_t(ctrl,
- tab_order_t(tab_group, mNextInsertionOrdinal)));
-
- mNextInsertionOrdinal++;
+ mTabOrder.insert(tab_order_pair_t(child, tab_group));
}
child->mParentView = this;
@@ -342,69 +332,19 @@ void LLView::removeChild(LLView* child)
llassert(child->mInDraw == false);
mChildList.remove( child );
child->mParentView = NULL;
- if (child->isCtrl())
+ child_tab_order_t::iterator found = mTabOrder.find(child);
+ if(found != mTabOrder.end())
{
- child_tab_order_t::iterator found = mCtrlOrder.find(static_cast<LLUICtrl*>(child));
- if(found != mCtrlOrder.end())
- {
- mCtrlOrder.erase(found);
- }
+ mTabOrder.erase(found);
}
}
else
{
- llwarns << "\"" << child->getName() << "\" is not a child of " << getName() << llendl;
+ LL_WARNS() << "\"" << child->getName() << "\" is not a child of " << getName() << LL_ENDL;
}
updateBoundingRect();
}
-LLView::ctrl_list_t LLView::getCtrlList() const
-{
- ctrl_list_t controls;
- BOOST_FOREACH(LLView* viewp, mChildList)
- {
- if(viewp->isCtrl())
- {
- controls.push_back(static_cast<LLUICtrl*>(viewp));
- }
- }
- return controls;
-}
-
-LLView::ctrl_list_t LLView::getCtrlListSorted() const
-{
- ctrl_list_t controls = getCtrlList();
- std::sort(controls.begin(), controls.end(), LLCompareByTabOrder(mCtrlOrder));
- return controls;
-}
-
-
-// This method compares two LLViews by the tab order specified in the comparator object. The
-// code for this is a little convoluted because each argument can have four states:
-// 1) not a control, 2) a control but not in the tab order, 3) a control in the tab order, 4) null
-bool LLCompareByTabOrder::operator() (const LLView* const a, const LLView* const b) const
-{
- S32 a_score = 0, b_score = 0;
- if(a) a_score--;
- if(b) b_score--;
- if(a && a->isCtrl()) a_score--;
- if(b && b->isCtrl()) b_score--;
- if(a_score == -2 && b_score == -2)
- {
- const LLUICtrl * const a_ctrl = static_cast<const LLUICtrl*>(a);
- const LLUICtrl * const b_ctrl = static_cast<const LLUICtrl*>(b);
- LLView::child_tab_order_const_iter_t a_found = mTabOrder.find(a_ctrl), b_found = mTabOrder.find(b_ctrl);
- if(a_found != mTabOrder.end()) a_score--;
- if(b_found != mTabOrder.end()) b_score--;
- if(a_score == -3 && b_score == -3)
- {
- // whew! Once we're in here, they're both in the tab order, and we can compare based on that
- return compareTabOrders(a_found->second, b_found->second);
- }
- }
- return (a_score == b_score) ? a < b : a_score < b_score;
-}
-
BOOL LLView::isInVisibleChain() const
{
BOOL visible = TRUE;
@@ -528,9 +468,9 @@ BOOL LLView::focusPrevRoot()
// static
BOOL LLView::focusNext(LLView::child_list_t & result)
{
- LLView::child_list_iter_t focused = result.end();
- for(LLView::child_list_iter_t iter = result.begin();
- iter != result.end();
+ LLView::child_list_reverse_iter_t focused = result.rend();
+ for(LLView::child_list_reverse_iter_t iter = result.rbegin();
+ iter != result.rend();
++iter)
{
if(gFocusMgr.childHasKeyboardFocus(*iter))
@@ -539,14 +479,14 @@ BOOL LLView::focusNext(LLView::child_list_t & result)
break;
}
}
- LLView::child_list_iter_t next = focused;
- next = (next == result.end()) ? result.begin() : ++next;
+ LLView::child_list_reverse_iter_t next = focused;
+ next = (next == result.rend()) ? result.rbegin() : ++next;
while(next != focused)
{
// wrap around to beginning if necessary
- if(next == result.end())
+ if(next == result.rend())
{
- next = result.begin();
+ next = result.rbegin();
}
if((*next)->isCtrl())
{
@@ -564,9 +504,9 @@ BOOL LLView::focusNext(LLView::child_list_t & result)
// static
BOOL LLView::focusPrev(LLView::child_list_t & result)
{
- LLView::child_list_reverse_iter_t focused = result.rend();
- for(LLView::child_list_reverse_iter_t iter = result.rbegin();
- iter != result.rend();
+ LLView::child_list_iter_t focused = result.end();
+ for(LLView::child_list_iter_t iter = result.begin();
+ iter != result.end();
++iter)
{
if(gFocusMgr.childHasKeyboardFocus(*iter))
@@ -575,14 +515,14 @@ BOOL LLView::focusPrev(LLView::child_list_t & result)
break;
}
}
- LLView::child_list_reverse_iter_t next = focused;
- next = (next == result.rend()) ? result.rbegin() : ++next;
+ LLView::child_list_iter_t next = focused;
+ next = (next == result.end()) ? result.begin() : ++next;
while(next != focused)
{
// wrap around to beginning if necessary
- if(next == result.rend())
+ if(next == result.end())
{
- next = result.rbegin();
+ next = result.begin();
}
if((*next)->isCtrl())
{
@@ -606,7 +546,7 @@ BOOL LLView::focusPrev(LLView::child_list_t & result)
void LLView::deleteAllChildren()
{
// clear out the control ordering
- mCtrlOrder.clear();
+ mTabOrder.clear();
while (!mChildList.empty())
{
@@ -635,14 +575,14 @@ void LLView::setVisible(BOOL visible)
{
// tell all children of this view that the visibility may have changed
dirtyRect();
- handleVisibilityChange( visible );
+ onVisibilityChange( visible );
}
updateBoundingRect();
}
}
// virtual
-void LLView::handleVisibilityChange ( BOOL new_visibility )
+void LLView::onVisibilityChange ( BOOL new_visibility )
{
BOOL old_visibility;
BOOL log_visibility_change = LLViewerEventRecorder::instance().getLoggingStatus();
@@ -653,23 +593,24 @@ void LLView::handleVisibilityChange ( BOOL new_visibility )
if(log_visibility_change)
{
- if (old_visibility!=new_visibility)
- {
- LLViewerEventRecorder::instance().logVisibilityChange( viewp->getPathname(), viewp->getName(), new_visibility,"widget");
- }
+ if (old_visibility!=new_visibility)
+ {
+ LLViewerEventRecorder::instance().logVisibilityChange( viewp->getPathname(), viewp->getName(), new_visibility,"widget");
+ }
}
if (old_visibility)
{
- viewp->handleVisibilityChange ( new_visibility );
+ viewp->onVisibilityChange ( new_visibility );
}
if(log_visibility_change)
{
// Consider changing returns to confirm success and know which widget grabbed it
- // For now assume success and log at highest xui possible
+ // For now assume success and log at highest xui possible
// NOTE we log actual state - which may differ if it somehow failed to set visibility
- lldebugs << "LLView::handleVisibilityChange - now: " << getVisible() << " xui: " << viewp->getPathname() << " name: " << viewp->getName() << llendl;
+ LL_DEBUGS() << "LLView::handleVisibilityChange - now: " << getVisible() << " xui: " << viewp->getPathname() << " name: " << viewp->getName() << LL_ENDL;
+
}
}
}
@@ -699,12 +640,12 @@ BOOL LLView::handleHover(S32 x, S32 y, MASK mask)
void LLView::onMouseEnter(S32 x, S32 y, MASK mask)
{
- //llinfos << "Mouse entered " << getName() << llendl;
+ //LL_INFOS() << "Mouse entered " << getName() << LL_ENDL;
}
void LLView::onMouseLeave(S32 x, S32 y, MASK mask)
{
- //llinfos << "Mouse left " << getName() << llendl;
+ //LL_INFOS() << "Mouse left " << getName() << LL_ENDL;
}
bool LLView::visibleAndContains(S32 local_x, S32 local_y)
@@ -740,7 +681,7 @@ LLView* LLView::childrenHandleCharEvent(const std::string& desc, const METHOD& m
{
if (LLView::sDebugKeys)
{
- llinfos << desc << " handled by " << viewp->getName() << llendl;
+ LL_INFOS() << desc << " handled by " << viewp->getName() << LL_ENDL;
}
return viewp;
}
@@ -766,8 +707,8 @@ LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDA
if ((viewp->*method)( local_x, local_y, extra )
|| (allow_mouse_block && viewp->blockMouseEvent( local_x, local_y )))
{
- lldebugs << "LLView::childrenHandleMouseEvent calling updatemouseeventinfo - local_x|global x "<< local_x << " " << x << "local/global y " << local_y << " " << y << llendl;
- lldebugs << "LLView::childrenHandleMouseEvent getPathname for viewp result: " << viewp->getPathname() << "for this view: " << getPathname() << llendl;
+ LL_DEBUGS() << "LLView::childrenHandleMouseEvent calling updatemouseeventinfo - local_x|global x "<< local_x << " " << x << "local/global y " << local_y << " " << y << LL_ENDL;
+ LL_DEBUGS() << "LLView::childrenHandleMouseEvent getPathname for viewp result: " << viewp->getPathname() << "for this view: " << getPathname() << LL_ENDL;
LLViewerEventRecorder::instance().updateMouseEventInfo(x,y,-55,-55,getPathname());
@@ -944,7 +885,7 @@ BOOL LLView::handleKey(KEY key, MASK mask, BOOL called_from_parent)
handled = handleKeyHere( key, mask );
if (handled)
{
- llwarns << "Key handled by " << getName() << llendl;
+ LL_WARNS() << "Key handled by " << getName() << LL_ENDL;
}
}
}
@@ -981,7 +922,7 @@ BOOL LLView::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent)
handled = handleUnicodeCharHere(uni_char);
if (handled && LLView::sDebugKeys)
{
- llinfos << "Unicode key handled by " << getName() << llendl;
+ LL_INFOS() << "Unicode key handled by " << getName() << LL_ENDL;
}
}
}
@@ -1163,7 +1104,7 @@ void LLView::drawChildren()
// Check for bogus rectangle
if (!getRect().isValid())
{
- llwarns << "Bogus rectangle for " << getName() << " with " << mRect << llendl;
+ LL_WARNS() << "Bogus rectangle for " << getName() << " with " << mRect << LL_ENDL;
}
}
}
@@ -1316,56 +1257,56 @@ void LLView::reshape(S32 width, S32 height, BOOL called_from_parent)
{
if (viewp != NULL)
{
- LLRect child_rect( viewp->mRect );
+ LLRect child_rect( viewp->mRect );
- if (viewp->followsRight() && viewp->followsLeft())
- {
- child_rect.mRight += delta_width;
- }
- else if (viewp->followsRight())
- {
- child_rect.mLeft += delta_width;
- child_rect.mRight += delta_width;
- }
- else if (viewp->followsLeft())
- {
- // left is 0, don't need to adjust coords
- }
- else
- {
- // BUG what to do when we don't follow anyone?
- // for now, same as followsLeft
- }
+ if (viewp->followsRight() && viewp->followsLeft())
+ {
+ child_rect.mRight += delta_width;
+ }
+ else if (viewp->followsRight())
+ {
+ child_rect.mLeft += delta_width;
+ child_rect.mRight += delta_width;
+ }
+ else if (viewp->followsLeft())
+ {
+ // left is 0, don't need to adjust coords
+ }
+ else
+ {
+ // BUG what to do when we don't follow anyone?
+ // for now, same as followsLeft
+ }
- if (viewp->followsTop() && viewp->followsBottom())
- {
- child_rect.mTop += delta_height;
- }
- else if (viewp->followsTop())
- {
- child_rect.mTop += delta_height;
- child_rect.mBottom += delta_height;
- }
- else if (viewp->followsBottom())
- {
- // bottom is 0, so don't need to adjust coords
- }
- else
- {
- // BUG what to do when we don't follow?
- // for now, same as bottom
- }
+ if (viewp->followsTop() && viewp->followsBottom())
+ {
+ child_rect.mTop += delta_height;
+ }
+ else if (viewp->followsTop())
+ {
+ child_rect.mTop += delta_height;
+ child_rect.mBottom += delta_height;
+ }
+ else if (viewp->followsBottom())
+ {
+ // bottom is 0, so don't need to adjust coords
+ }
+ else
+ {
+ // BUG what to do when we don't follow?
+ // for now, same as bottom
+ }
- S32 delta_x = child_rect.mLeft - viewp->getRect().mLeft;
- S32 delta_y = child_rect.mBottom - viewp->getRect().mBottom;
- viewp->translate( delta_x, delta_y );
- if (child_rect.getWidth() != viewp->getRect().getWidth() || child_rect.getHeight() != viewp->getRect().getHeight())
- {
- viewp->reshape(child_rect.getWidth(), child_rect.getHeight());
- }
+ S32 delta_x = child_rect.mLeft - viewp->getRect().mLeft;
+ S32 delta_y = child_rect.mBottom - viewp->getRect().mBottom;
+ viewp->translate( delta_x, delta_y );
+ if (child_rect.getWidth() != viewp->getRect().getWidth() || child_rect.getHeight() != viewp->getRect().getHeight())
+ {
+ viewp->reshape(child_rect.getWidth(), child_rect.getHeight());
}
}
}
+ }
if (!called_from_parent)
{
@@ -1540,11 +1481,11 @@ LLView* LLView::getChildView(const std::string& name, BOOL recurse) const
return getChild<LLView>(name, recurse);
}
-static LLFastTimer::DeclareTimer FTM_FIND_VIEWS("Find Widgets");
+static LLTrace::BlockTimerStatHandle FTM_FIND_VIEWS("Find Widgets");
LLView* LLView::findChildView(const std::string& name, BOOL recurse) const
{
- LLFastTimer ft(FTM_FIND_VIEWS);
+ LL_RECORD_BLOCK_TIME(FTM_FIND_VIEWS);
//richard: should we allow empty names?
//if(name.empty())
// return NULL;
@@ -1859,15 +1800,63 @@ BOOL LLView::localRectToOtherView( const LLRect& local, LLRect* other, const LLV
return FALSE;
}
+
+class CompareByTabOrder
+{
+public:
+ CompareByTabOrder(const LLView::child_tab_order_t& order, S32 default_tab_group = 0)
+ : mTabOrder(order),
+ mDefaultTabGroup(default_tab_group)
+ {}
+ virtual ~CompareByTabOrder() {}
+
+ // This method compares two LLViews by the tab order specified in the comparator object. The
+ // code for this is a little convoluted because each argument can have four states:
+ // 1) not a control, 2) a control but not in the tab order, 3) a control in the tab order, 4) null
+ bool operator() (const LLView* const a, const LLView* const b) const
+ {
+ S32 a_group = 0, b_group = 0;
+ if(!a) return false;
+ if(!b) return true;
+
+ LLView::child_tab_order_const_iter_t a_found = mTabOrder.find(a), b_found = mTabOrder.find(b);
+ if(a_found != mTabOrder.end())
+ {
+ a_group = a_found->second;
+ }
+ if(b_found != mTabOrder.end())
+ {
+ b_group = b_found->second;
+ }
+
+ if(a_group < mDefaultTabGroup && b_group >= mDefaultTabGroup) return true;
+ if(b_group < mDefaultTabGroup && a_group >= mDefaultTabGroup) return false;
+ return a_group > b_group; // sort correctly if they're both on the same side of the default tab groupreturn a > b;
+ }
+private:
+ // ok to store a reference, as this should only be allocated on stack during view query operations
+ const LLView::child_tab_order_t& mTabOrder;
+ const S32 mDefaultTabGroup;
+};
+
+class SortByTabOrder : public LLQuerySorter, public LLSingleton<SortByTabOrder>
+{
+ /*virtual*/ void sort(LLView * parent, LLView::child_list_t &children) const
+ {
+ children.sort(CompareByTabOrder(parent->getTabOrder(), parent->getDefaultTabGroup()));
+ }
+};
+
// static
-const LLCtrlQuery & LLView::getTabOrderQuery()
+const LLViewQuery & LLView::getTabOrderQuery()
{
- static LLCtrlQuery query;
+ static LLViewQuery query;
if(query.getPreFilters().size() == 0) {
query.addPreFilter(LLVisibleFilter::getInstance());
query.addPreFilter(LLEnabledFilter::getInstance());
query.addPreFilter(LLTabStopFilter::getInstance());
query.addPostFilter(LLLeavesFilter::getInstance());
+ query.setSorter(SortByTabOrder::getInstance());
}
return query;
}
@@ -1882,9 +1871,9 @@ class LLFocusRootsFilter : public LLQueryFilter, public LLSingleton<LLFocusRoots
};
// static
-const LLCtrlQuery & LLView::getFocusRootsQuery()
+const LLViewQuery & LLView::getFocusRootsQuery()
{
- static LLCtrlQuery query;
+ static LLViewQuery query;
if(query.getPreFilters().size() == 0) {
query.addPreFilter(LLVisibleFilter::getInstance());
query.addPreFilter(LLEnabledFilter::getInstance());
@@ -2036,7 +2025,7 @@ LLView* LLView::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESna
}
break;
default:
- llerrs << "Invalid snap edge" << llendl;
+ LL_ERRS() << "Invalid snap edge" << LL_ENDL;
}
}
@@ -2138,7 +2127,7 @@ LLView* LLView::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESna
}
break;
default:
- llerrs << "Invalid snap edge" << llendl;
+ LL_ERRS() << "Invalid snap edge" << LL_ENDL;
}
}
}
@@ -2465,7 +2454,7 @@ static S32 invert_vertical(S32 y, LLView* parent)
}
else
{
- llwarns << "Attempting to convert layout to top-left with no parent" << llendl;
+ LL_WARNS() << "Attempting to convert layout to top-left with no parent" << LL_ENDL;
return y;
}
}
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 15b85a6418..7861c8f729 100755
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -42,7 +42,6 @@
#include "llui.h"
#include "lluistring.h"
#include "llviewquery.h"
-#include "stdenums.h"
#include "lluistring.h"
#include "llcursortypes.h"
#include "lluictrlfactory.h"
@@ -67,6 +66,7 @@ const BOOL NOT_MOUSE_OPAQUE = FALSE;
const U32 GL_NAME_UI_RESERVED = 2;
+
// maintains render state during traversal of UI tree
class LLViewDrawContext
{
@@ -100,9 +100,13 @@ class LLView
: public LLMouseHandler, // handles mouse events
public LLFocusableElement, // handles keyboard events
public LLMortician, // lazy deletion
- public LLHandleProvider<LLView> // passes out weak references to self
+ public LLHandleProvider<LLView>, // passes out weak references to self
+ public LLTrace::MemTrackable<LLView> // track memory usage
{
public:
+
+ enum EOrientation { HORIZONTAL, VERTICAL, ORIENTATION_COUNT };
+
struct Follows : public LLInitParam::ChoiceBlock<Follows>
{
Alternative<std::string> string;
@@ -163,7 +167,7 @@ protected:
private:
// widgets in general are not copyable
- LLView(const LLView& other) {};
+ LLView(const LLView& other);
public:
//#if LL_DEBUG
static BOOL sIsDrawing;
@@ -196,12 +200,9 @@ public:
typedef child_list_t::reverse_iterator child_list_reverse_iter_t;
typedef child_list_t::const_reverse_iterator child_list_const_reverse_iter_t;
- typedef std::vector<class LLUICtrl *> ctrl_list_t;
-
- typedef std::pair<S32, S32> tab_order_t;
- typedef std::pair<LLUICtrl *, tab_order_t> tab_order_pair_t;
+ typedef std::pair<LLView *, S32> tab_order_pair_t;
// this structure primarily sorts by the tab group, secondarily by the insertion ordinal (lastly by the value of the pointer)
- typedef std::map<const LLUICtrl*, tab_order_t> child_tab_order_t;
+ typedef std::map<const LLView*, S32> child_tab_order_t;
typedef child_tab_order_t::iterator child_tab_order_iter_t;
typedef child_tab_order_t::const_iterator child_tab_order_const_iter_t;
typedef child_tab_order_t::reverse_iterator child_tab_order_reverse_iter_t;
@@ -247,8 +248,6 @@ public:
void sendChildToFront(LLView* child);
void sendChildToBack(LLView* child);
- void moveChildToFrontOfTabGroup(LLUICtrl* child);
- void moveChildToBackOfTabGroup(LLUICtrl* child);
virtual bool addChild(LLView* view, S32 tab_group = 0);
@@ -260,9 +259,7 @@ public:
virtual BOOL postBuild() { return TRUE; }
- const child_tab_order_t& getCtrlOrder() const { return mCtrlOrder; }
- ctrl_list_t getCtrlList() const;
- ctrl_list_t getCtrlListSorted() const;
+ const child_tab_order_t& getTabOrder() const { return mTabOrder; }
void setDefaultTabGroup(S32 d) { mDefaultTabGroup = d; }
S32 getDefaultTabGroup() const { return mDefaultTabGroup; }
@@ -303,7 +300,7 @@ public:
virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text );
- virtual void handleVisibilityChange ( BOOL new_visibility );
+ virtual void onVisibilityChange ( BOOL new_visibility );
void pushVisible(BOOL visible) { mLastVisible = mVisible; setVisible(visible); }
void popVisible() { setVisible(mLastVisible); }
@@ -496,9 +493,9 @@ public:
static BOOL focusPrev(LLView::child_list_t & result);
// returns query for iterating over controls in tab order
- static const LLCtrlQuery & getTabOrderQuery();
+ static const LLViewQuery & getTabOrderQuery();
// return query for iterating over focus roots in tab order
- static const LLCtrlQuery & getFocusRootsQuery();
+ static const LLViewQuery & getFocusRootsQuery();
static LLWindow* getWindow(void) { return LLUI::sWindow; }
@@ -592,7 +589,7 @@ private:
U32 mReshapeFlags;
- child_tab_order_t mCtrlOrder;
+ child_tab_order_t mTabOrder;
S32 mDefaultTabGroup;
S32 mLastTabGroup;
@@ -609,8 +606,6 @@ private:
BOOL mLastVisible;
- S32 mNextInsertionOrdinal;
-
bool mInDraw;
static LLWindow* sWindow; // All root views must know about their window.
@@ -673,17 +668,14 @@ public:
static BOOL sForceReshape;
};
-class LLCompareByTabOrder
+namespace LLInitParam
{
-public:
- LLCompareByTabOrder(const LLView::child_tab_order_t& order) : mTabOrder(order) {}
- virtual ~LLCompareByTabOrder() {}
- bool operator() (const LLView* const a, const LLView* const b) const;
-private:
- virtual bool compareTabOrders(const LLView::tab_order_t & a, const LLView::tab_order_t & b) const { return a < b; }
- // ok to store a reference, as this should only be allocated on stack during view query operations
- const LLView::child_tab_order_t& mTabOrder;
+template<>
+struct TypeValues<LLView::EOrientation> : public LLInitParam::TypeValuesHelper<LLView::EOrientation>
+{
+ static void declareValues();
};
+}
template <class T> T* LLView::getChild(const std::string& name, BOOL recurse) const
{
@@ -694,7 +686,7 @@ template <class T> T* LLView::getChild(const std::string& name, BOOL recurse) co
// did we find *something* with that name?
if (child)
{
- llwarns << "Found child named \"" << name << "\" but of wrong type " << typeid(*child).name() << ", expecting " << typeid(T*).name() << llendl;
+ LL_WARNS() << "Found child named \"" << name << "\" but of wrong type " << typeid(*child).name() << ", expecting " << typeid(T*).name() << LL_ENDL;
}
result = getDefaultWidget<T>(name);
if (!result)
@@ -706,11 +698,11 @@ template <class T> T* LLView::getChild(const std::string& name, BOOL recurse) co
// *NOTE: You cannot call mFoo = getChild<LLFoo>("bar")
// in a floater or panel constructor. The widgets will not
// be ready. Instead, put it in postBuild().
- llwarns << "Making dummy " << typeid(T).name() << " named \"" << name << "\" in " << getName() << llendl;
+ LL_WARNS() << "Making dummy " << typeid(T).name() << " named \"" << name << "\" in " << getName() << LL_ENDL;
}
else
{
- llwarns << "Failed to create dummy " << typeid(T).name() << llendl;
+ LL_WARNS() << "Failed to create dummy " << typeid(T).name() << LL_ENDL;
return NULL;
}
diff --git a/indra/llui/llviewereventrecorder.cpp b/indra/llui/llviewereventrecorder.cpp
index 546a0f5866..c5a4354f32 100644
--- a/indra/llui/llviewereventrecorder.cpp
+++ b/indra/llui/llviewereventrecorder.cpp
@@ -53,14 +53,14 @@ void LLViewerEventRecorder::setEventLoggingOn() {
mLog.open(mLogFilename, llofstream::out);
}
logEvents=true;
- lldebugs << "LLViewerEventRecorder::setEventLoggingOn event logging turned on" << llendl;
+ LL_DEBUGS() << "LLViewerEventRecorder::setEventLoggingOn event logging turned on" << LL_ENDL;
}
void LLViewerEventRecorder::setEventLoggingOff() {
logEvents=false;
mLog.flush();
mLog.close();
- lldebugs << "LLViewerEventRecorder::setEventLoggingOff event logging turned off" << llendl;
+ LL_DEBUGS() << "LLViewerEventRecorder::setEventLoggingOff event logging turned off" << LL_ENDL;
}
@@ -101,10 +101,10 @@ void LLViewerEventRecorder::updateMouseEventInfo(S32 local_x, S32 local_y, S32 g
LLView * target_view = LLUI::resolvePath(LLUI::getRootView(), xui);
if (! target_view) {
- lldebugs << "LLViewerEventRecorder::updateMouseEventInfo - xui path on file at moment is NOT valid - so DO NOT record these local coords" << llendl;
+ LL_DEBUGS() << "LLViewerEventRecorder::updateMouseEventInfo - xui path on file at moment is NOT valid - so DO NOT record these local coords" << LL_ENDL;
return;
}
- lldebugs << "LLViewerEventRecorder::updateMouseEventInfo b4 updatemouseeventinfo - local_x|global x "<< this->local_x << " " << this->global_x << "local/global y " << this->local_y << " " << this->global_y << " mname: " << mName << " xui: " << xui << llendl;
+ LL_DEBUGS() << "LLViewerEventRecorder::updateMouseEventInfo b4 updatemouseeventinfo - local_x|global x "<< this->local_x << " " << this->global_x << "local/global y " << this->local_y << " " << this->global_y << " mname: " << mName << " xui: " << xui << LL_ENDL;
if (this->local_x < 1 && this->local_y<1 && local_x && local_y) {
@@ -121,7 +121,7 @@ void LLViewerEventRecorder::updateMouseEventInfo(S32 local_x, S32 local_y, S32 g
xui = mName; // TODO review confirm we never call with partial path - also cAN REMOVE CHECK FOR "" - ON OTHER HAND IT'S PRETTY HARMLESS
}
- lldebugs << "LLViewerEventRecorder::updateMouseEventInfo after updatemouseeventinfo - local_x|global x "<< this->local_x << " " << this->global_x << "local/global y " << this->local_y << " " << this->global_y << " mname: " << mName << " xui: " << xui << llendl;
+ LL_DEBUGS() << "LLViewerEventRecorder::updateMouseEventInfo after updatemouseeventinfo - local_x|global x "<< this->local_x << " " << this->global_x << "local/global y " << this->local_y << " " << this->global_y << " mname: " << mName << " xui: " << xui << LL_ENDL;
}
void LLViewerEventRecorder::logVisibilityChange(std::string xui, std::string name, BOOL visibility, std::string event_subtype) {
@@ -158,10 +158,10 @@ std::string LLViewerEventRecorder::get_xui() {
}
void LLViewerEventRecorder::update_xui(std::string xui) {
if (xui!="" && this->xui=="" ) {
- lldebugs << "LLViewerEventRecorder::update_xui to " << xui << llendl;
+ LL_DEBUGS() << "LLViewerEventRecorder::update_xui to " << xui << LL_ENDL;
this->xui=xui;
} else {
- lldebugs << "LLViewerEventRecorder::update_xui called with empty string" << llendl;
+ LL_DEBUGS() << "LLViewerEventRecorder::update_xui called with empty string" << LL_ENDL;
}
}
@@ -200,11 +200,11 @@ void LLViewerEventRecorder::logKeyEvent(KEY key, MASK mask) {
// (maybe it should) - instead it has a convenience method that generates the keydown and keyup events
// Here we will use "type" as our event type
- lldebugs << "LLVIewerEventRecorder::logKeyEvent Serialized LLSD for event " << event.asString() << "\n" << llendl;
+ LL_DEBUGS() << "LLVIewerEventRecorder::logKeyEvent Serialized LLSD for event " << event.asString() << "\n" << LL_ENDL;
- //lldebugs << "[VITA] key_name: " << LLKeyboard::stringFromKey(key) << "mask: "<< mask << "handled by " << getName() << llendl;
- lldebugs << "LLVIewerEventRecorder::logKeyEvent key_name: " << LLKeyboard::stringFromKey(key) << "mask: "<< mask << llendl;
+ //LL_DEBUGS() << "[VITA] key_name: " << LLKeyboard::stringFromKey(key) << "mask: "<< mask << "handled by " << getName() << LL_ENDL;
+ LL_DEBUGS() << "LLVIewerEventRecorder::logKeyEvent key_name: " << LLKeyboard::stringFromKey(key) << "mask: "<< mask << LL_ENDL;
recordEvent(event);
@@ -218,14 +218,14 @@ void LLViewerEventRecorder::playbackRecording() {
// ivita sets this on startup, it also sends commands to the viewer to make start, stop, and playback menu items visible in viewer
LeapCommand =LLUI::sSettingGroups["config"]->getLLSD("LeapPlaybackEventsCommand");
- lldebugs << "[VITA] launching playback - leap command is: " << LLSDXMLStreamer(LeapCommand) << llendl;
+ LL_DEBUGS() << "[VITA] launching playback - leap command is: " << LLSDXMLStreamer(LeapCommand) << LL_ENDL;
LLLeap::create("", LeapCommand, false); // exception=false
}
void LLViewerEventRecorder::recordEvent(LLSD event) {
- lldebugs << "LLViewerEventRecorder::recordEvent event written to log: " << LLSDXMLStreamer(event) << llendl;
+ LL_DEBUGS() << "LLViewerEventRecorder::recordEvent event written to log: " << LLSDXMLStreamer(event) << LL_ENDL;
mLog << event << std::endl;
}
@@ -243,7 +243,7 @@ void LLViewerEventRecorder::logKeyUnicodeEvent(llwchar uni_char) {
// keycode...or
// char
- lldebugs << "Wrapped in conversion to wstring " << wstring_to_utf8str(LLWString( 1, uni_char)) << "\n" << llendl;
+ LL_DEBUGS() << "Wrapped in conversion to wstring " << wstring_to_utf8str(LLWString( 1, uni_char)) << "\n" << LL_ENDL;
event.insert("char",
LLSD( wstring_to_utf8str(LLWString( 1,uni_char)) )
@@ -257,8 +257,8 @@ void LLViewerEventRecorder::logKeyUnicodeEvent(llwchar uni_char) {
event.insert("event",LLSD("keyDown"));
- lldebugs << "[VITA] unicode key: " << uni_char << llendl;
- lldebugs << "[VITA] dumpxml " << LLSDXMLStreamer(event) << "\n" << llendl;
+ LL_DEBUGS() << "[VITA] unicode key: " << uni_char << LL_ENDL;
+ LL_DEBUGS() << "[VITA] dumpxml " << LLSDXMLStreamer(event) << "\n" << LL_ENDL;
recordEvent(event);
diff --git a/indra/llui/llviewmodel.cpp b/indra/llui/llviewmodel.cpp
index a9f8acc440..282addf692 100755
--- a/indra/llui/llviewmodel.cpp
+++ b/indra/llui/llviewmodel.cpp
@@ -37,13 +37,15 @@
///
LLViewModel::LLViewModel()
- : mDirty(false)
+: LLTrace::MemTrackable<LLViewModel>("LLViewModel"),
+ mDirty(false)
{
}
/// Instantiate an LLViewModel with an existing data value
LLViewModel::LLViewModel(const LLSD& value)
- : mDirty(false)
+: LLTrace::MemTrackable<LLViewModel>("LLViewModel"),
+ mDirty(false)
{
setValue(value);
}
@@ -79,8 +81,16 @@ LLTextViewModel::LLTextViewModel(const LLSD& value)
/// Update the stored value
void LLTextViewModel::setValue(const LLSD& value)
{
+ // approximate LLSD storage usage
+ disclaimMem(mDisplay.size());
LLViewModel::setValue(value);
+ disclaimMem(mDisplay);
mDisplay = utf8str_to_wstring(value.asString());
+
+ claimMem(mDisplay);
+ // approximate LLSD storage usage
+ claimMem(mDisplay.size());
+
// mDisplay and mValue agree
mUpdateFromDisplay = false;
}
@@ -91,7 +101,11 @@ void LLTextViewModel::setDisplay(const LLWString& value)
// and do the utf8str_to_wstring() to get the corresponding mDisplay
// value. But a text editor might want to edit the display string
// directly, then convert back to UTF8 on commit.
+ disclaimMem(mDisplay.size());
+ disclaimMem(mDisplay);
mDisplay = value;
+ claimMem(mDisplay);
+ claimMem(mDisplay.size());
mDirty = true;
// Don't immediately convert to UTF8 -- do it lazily -- we expect many
// more setDisplay() calls than getValue() calls. Just flag that it needs
diff --git a/indra/llui/llviewmodel.h b/indra/llui/llviewmodel.h
index ef2e314799..49d7c322a3 100755
--- a/indra/llui/llviewmodel.h
+++ b/indra/llui/llviewmodel.h
@@ -37,8 +37,9 @@
#include "llpointer.h"
#include "llsd.h"
#include "llrefcount.h"
-#include "stdenums.h"
#include "llstring.h"
+#include "lltrace.h"
+#include "llui.h"
#include <string>
class LLScrollListItem;
@@ -60,7 +61,9 @@ typedef LLPointer<LLListViewModel> LLListViewModelPtr;
* LLViewModel data. This way, the LLViewModel is quietly deleted when the
* last referencing widget is destroyed.
*/
-class LLViewModel: public LLRefCount
+class LLViewModel
+: public LLRefCount,
+ public LLTrace::MemTrackable<LLViewModel>
{
public:
LLViewModel();
diff --git a/indra/llui/llviewquery.cpp b/indra/llui/llviewquery.cpp
index d0b78ba186..66262609ae 100755
--- a/indra/llui/llviewquery.cpp
+++ b/indra/llui/llviewquery.cpp
@@ -30,7 +30,7 @@
#include "lluictrl.h"
#include "llviewquery.h"
-void LLQuerySorter::operator() (LLView * parent, viewList_t &children) const {}
+void LLQuerySorter::sort(LLView * parent, viewList_t &children) const {}
filterResult_t LLLeavesFilter::operator() (const LLView* const view, const viewList_t & children) const
{
@@ -89,8 +89,8 @@ viewList_t LLViewQuery::run(LLView* view) const
if (pre.first)
{
post = runFilters(view, filtered_children, mPostFilters);
- }
}
+ }
if(pre.first && post.first)
{
@@ -105,12 +105,12 @@ viewList_t LLViewQuery::run(LLView* view) const
return result;
}
-void LLViewQuery::filterChildren(LLView * view, viewList_t & filtered_children) const
+void LLViewQuery::filterChildren(LLView* parent_view, viewList_t & filtered_children) const
{
- LLView::child_list_t views(*(view->getChildList()));
+ LLView::child_list_t views(*(parent_view->getChildList()));
if (mSorterp)
{
- (*mSorterp)(view, views); // sort the children per the sorter
+ mSorterp->sort(parent_view, views); // sort the children per the sorter
}
for(LLView::child_list_iter_t iter = views.begin();
iter != views.end();
@@ -134,18 +134,3 @@ filterResult_t LLViewQuery::runFilters(LLView * view, const viewList_t children,
}
return result;
}
-
-class SortByTabOrder : public LLQuerySorter, public LLSingleton<SortByTabOrder>
-{
- /*virtual*/ void operator() (LLView * parent, LLView::child_list_t &children) const
- {
- children.sort(LLCompareByTabOrder(parent->getCtrlOrder()));
- }
-};
-
-LLCtrlQuery::LLCtrlQuery() :
- LLViewQuery()
-{
- setSorter(SortByTabOrder::getInstance());
-}
-
diff --git a/indra/llui/llviewquery.h b/indra/llui/llviewquery.h
index 210f95162a..9044c4ff29 100755
--- a/indra/llui/llviewquery.h
+++ b/indra/llui/llviewquery.h
@@ -49,7 +49,7 @@ class LLQuerySorter
{
public:
virtual ~LLQuerySorter() {};
- virtual void operator() (LLView * parent, viewList_t &children) const;
+ virtual void sort(LLView * parent, viewList_t &children) const;
};
class LLLeavesFilter : public LLQueryFilter, public LLSingleton<LLLeavesFilter>
@@ -127,10 +127,5 @@ private:
const LLQuerySorter* mSorterp;
};
-class LLCtrlQuery : public LLViewQuery
-{
-public:
- LLCtrlQuery();
-};
#endif // LL_LLVIEWQUERY_H
diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp
index 6322da9123..37d88cb9f9 100755
--- a/indra/llui/llxuiparser.cpp
+++ b/indra/llui/llxuiparser.cpp
@@ -29,8 +29,8 @@
#include "llxuiparser.h"
#include "llxmlnode.h"
-
-#ifdef LL_STANDALONE
+#include "llfasttimer.h"
+#ifdef LL_USESYSTEMLIBS
#include <expat.h>
#else
#include "expat/expat.h"
@@ -38,6 +38,7 @@
#include <fstream>
#include <boost/tokenizer.hpp>
+#include <boost/bind.hpp>
//#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/classic_core.hpp>
@@ -334,6 +335,8 @@ LLXSDWriter::LLXSDWriter()
registerInspectFunc<LLSD>(boost::bind(&LLXSDWriter::writeAttribute, this, "xs:string", _1, _2, _3, _4));
}
+LLXSDWriter::~LLXSDWriter() {}
+
void LLXSDWriter::writeXSD(const std::string& type_name, LLXMLNodePtr node, const LLInitParam::BaseBlock& block, const std::string& xml_namespace)
{
Schema schema(xml_namespace);
@@ -674,12 +677,12 @@ LLXUIParser::LLXUIParser()
}
}
-static LLFastTimer::DeclareTimer FTM_PARSE_XUI("XUI Parsing");
+static LLTrace::BlockTimerStatHandle FTM_PARSE_XUI("XUI Parsing");
const LLXMLNodePtr DUMMY_NODE = new LLXMLNode();
void LLXUIParser::readXUI(LLXMLNodePtr node, LLInitParam::BaseBlock& block, const std::string& filename, bool silent)
{
- LLFastTimer timer(FTM_PARSE_XUI);
+ LL_RECORD_BLOCK_TIME(FTM_PARSE_XUI);
mNameStack.clear();
mRootNodeName = node->getName()->mString;
mCurFileName = filename;
@@ -858,11 +861,11 @@ bool LLXUIParser::readAttributes(LLXMLNodePtr nodep, LLInitParam::BaseBlock& blo
return any_parsed;
}
-void LLXUIParser::writeXUI(LLXMLNodePtr node, const LLInitParam::BaseBlock &block, const LLInitParam::BaseBlock* diff_block)
+void LLXUIParser::writeXUIImpl(LLXMLNodePtr node, const LLInitParam::BaseBlock &block, const LLInitParam::predicate_rule_t rules, const LLInitParam::BaseBlock* diff_block)
{
mWriteRootNode = node;
name_stack_t name_stack = Parser::name_stack_t();
- block.serializeBlock(*this, name_stack, diff_block);
+ block.serializeBlock(*this, name_stack, rules, diff_block);
mOutNodes.clear();
}
@@ -1310,7 +1313,7 @@ void LLXUIParser::parserWarning(const std::string& message)
{
#ifdef LL_WINDOWS
// use Visual Studio friendly formatting of output message for easy access to originating xml
- LL_WINDOWS_OUTPUT_DEBUG(llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str()));
+ LL_INFOS() << llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str()) << LL_ENDL;
#else
Parser::parserWarning(message);
#endif
@@ -1319,8 +1322,8 @@ void LLXUIParser::parserWarning(const std::string& message)
void LLXUIParser::parserError(const std::string& message)
{
#ifdef LL_WINDOWS
- // use Visual Studio friendly formatting of output message for easy access to originating xml
- LL_WINDOWS_OUTPUT_DEBUG(llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str()));
+ // use Visual Studio friendly formatting of output message for easy access to originating xml
+ LL_INFOS() << llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str()) << LL_ENDL;
#else
Parser::parserError(message);
#endif
@@ -1391,7 +1394,7 @@ LLSimpleXUIParser::~LLSimpleXUIParser()
bool LLSimpleXUIParser::readXUI(const std::string& filename, LLInitParam::BaseBlock& block, bool silent)
{
- LLFastTimer timer(FTM_PARSE_XUI);
+ LL_RECORD_BLOCK_TIME(FTM_PARSE_XUI);
mParser = XML_ParserCreate(NULL);
XML_SetUserData(mParser, this);
@@ -1638,7 +1641,7 @@ void LLSimpleXUIParser::parserWarning(const std::string& message)
{
#ifdef LL_WINDOWS
// use Visual Studio friendly formatting of output message for easy access to originating xml
- LL_WINDOWS_OUTPUT_DEBUG(llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()));
+ LL_INFOS() << llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()) << LL_ENDL;
#else
Parser::parserWarning(message);
#endif
@@ -1648,7 +1651,7 @@ void LLSimpleXUIParser::parserError(const std::string& message)
{
#ifdef LL_WINDOWS
// use Visual Studio friendly formatting of output message for easy access to originating xml
- LL_WINDOWS_OUTPUT_DEBUG(llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()));
+ LL_INFOS() << llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()) << LL_ENDL;
#else
Parser::parserError(message);
#endif
diff --git a/indra/llui/llxuiparser.h b/indra/llui/llxuiparser.h
index e48663e5cc..ad2a39cab7 100755
--- a/indra/llui/llxuiparser.h
+++ b/indra/llui/llxuiparser.h
@@ -29,21 +29,15 @@
#include "llinitparam.h"
#include "llregistry.h"
-#include "llpointer.h"
+#include "llxmlnode.h"
#include <boost/function.hpp>
#include <iosfwd>
#include <stack>
#include <set>
-
-
class LLView;
-
-typedef LLPointer<class LLXMLNode> LLXMLNodePtr;
-
-
// lookup widget type by name
class LLWidgetTypeRegistry
: public LLRegistrySingleton<std::string, const std::type_info*, LLWidgetTypeRegistry>
@@ -59,8 +53,6 @@ class LLChildRegistryRegistry
: public LLRegistrySingleton<const std::type_info*, widget_registry_t, LLChildRegistryRegistry>
{};
-
-
class LLXSDWriter : public LLInitParam::Parser
{
LOG_CLASS(LLXSDWriter);
@@ -70,6 +62,7 @@ public:
/*virtual*/ std::string getCurrentElementName() { return LLStringUtil::null; }
LLXSDWriter();
+ ~LLXSDWriter();
protected:
void writeAttribute(const std::string& type, const Parser::name_stack_t&, S32 min_count, S32 max_count, const std::vector<std::string>* possible_values);
@@ -109,9 +102,26 @@ public:
/*virtual*/ void parserError(const std::string& message);
void readXUI(LLXMLNodePtr node, LLInitParam::BaseBlock& block, const std::string& filename = LLStringUtil::null, bool silent=false);
- void writeXUI(LLXMLNodePtr node, const LLInitParam::BaseBlock& block, const LLInitParam::BaseBlock* diff_block = NULL);
+ template<typename BLOCK>
+ void writeXUI(LLXMLNodePtr node,
+ const BLOCK& block,
+ const LLInitParam::predicate_rule_t rules = LLInitParam::default_parse_rules(),
+ const LLInitParam::BaseBlock* diff_block = NULL)
+ {
+ if (!diff_block
+ && !rules.isAmbivalent(LLInitParam::HAS_DEFAULT_VALUE))
+ {
+ diff_block = &LLInitParam::defaultValue<BLOCK>();
+ }
+ writeXUIImpl(node, block, rules, diff_block);
+ }
private:
+ LLXUIParser(const LLXUIParser& other); // no-copy
+ void writeXUIImpl(LLXMLNodePtr node,
+ const LLInitParam::BaseBlock& block,
+ const LLInitParam::predicate_rule_t rules,
+ const LLInitParam::BaseBlock* diff_block);
bool readXUIImpl(LLXMLNodePtr node, LLInitParam::BaseBlock& block);
bool readAttributes(LLXMLNodePtr nodep, LLInitParam::BaseBlock& block);
diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp
index 0d65c3f8c3..5f4fb8f4a0 100755
--- a/indra/llvfs/lldir.cpp
+++ b/indra/llvfs/lldir.cpp
@@ -137,7 +137,7 @@ S32 LLDir::deleteFilesInDir(const std::string &dirname, const std::string &mask)
// File masks starting with "/" will match nothing, so we consider them invalid.
if (LLStringUtil::startsWith(mask, getDirDelimiter()))
{
- llwarns << "Invalid file mask: " << mask << llendl;
+ LL_WARNS() << "Invalid file mask: " << mask << LL_ENDL;
llassert(!"Invalid file mask");
}
@@ -160,12 +160,12 @@ S32 LLDir::deleteFilesInDir(const std::string &dirname, const std::string &mask)
{
retry_count++;
result = errno;
- llwarns << "Problem removing " << fullpath << " - errorcode: "
- << result << " attempt " << retry_count << llendl;
+ LL_WARNS() << "Problem removing " << fullpath << " - errorcode: "
+ << result << " attempt " << retry_count << LL_ENDL;
if(retry_count >= 5)
{
- llwarns << "Failed to remove " << fullpath << llendl ;
+ LL_WARNS() << "Failed to remove " << fullpath << LL_ENDL ;
return count ;
}
@@ -175,7 +175,7 @@ S32 LLDir::deleteFilesInDir(const std::string &dirname, const std::string &mask)
{
if (retry_count)
{
- llwarns << "Successfully removed " << fullpath << llendl;
+ LL_WARNS() << "Successfully removed " << fullpath << LL_ENDL;
}
break;
}
@@ -208,7 +208,7 @@ U32 LLDir::deleteDirAndContents(const std::string& dir_name)
}
catch (boost::filesystem::filesystem_error &er)
{
- llwarns << "Failed to delete " << dir_name << " with error " << er.code().message() << llendl;
+ LL_WARNS() << "Failed to delete " << dir_name << " with error " << er.code().message() << LL_ENDL;
}
return num_deleted;
}
@@ -293,7 +293,7 @@ const std::string &LLDir::getLindenUserDir() const
{
if (mLindenUserDir.empty())
{
- lldebugs << "getLindenUserDir() called early, we don't have the user name yet - returning empty string to caller" << llendl;
+ LL_DEBUGS() << "getLindenUserDir() called early, we don't have the user name yet - returning empty string to caller" << LL_ENDL;
}
return mLindenUserDir;
@@ -575,9 +575,9 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string& subd
if (prefix.empty())
{
- llwarns << ELLPathToString(location)
+ LL_WARNS() << ELLPathToString(location)
<< ", '" << subdir1 << "', '" << subdir2 << "', '" << in_filename
- << "': prefix is empty, possible bad filename" << llendl;
+ << "': prefix is empty, possible bad filename" << LL_ENDL;
}
std::string expanded_filename = add(add(prefix, subdir1), subdir2);
@@ -886,7 +886,7 @@ void LLDir::setLindenUserDir(const std::string &username)
}
else
{
- llerrs << "NULL name for LLDir::setLindenUserDir" << llendl;
+ LL_ERRS() << "NULL name for LLDir::setLindenUserDir" << LL_ENDL;
}
dumpCurrentDirectories();
@@ -900,7 +900,7 @@ void LLDir::setChatLogsDir(const std::string &path)
}
else
{
- llwarns << "Invalid name for LLDir::setChatLogsDir" << llendl;
+ LL_WARNS() << "Invalid name for LLDir::setChatLogsDir" << LL_ENDL;
}
}
@@ -925,7 +925,7 @@ void LLDir::setPerAccountChatLogsDir(const std::string &username)
}
else
{
- llerrs << "NULL name for LLDir::setPerAccountChatLogsDir" << llendl;
+ LL_ERRS() << "NULL name for LLDir::setPerAccountChatLogsDir" << LL_ENDL;
}
}
@@ -1010,22 +1010,22 @@ bool LLDir::setCacheDir(const std::string &path)
void LLDir::dumpCurrentDirectories()
{
- LL_DEBUGS2("AppInit","Directories") << "Current Directories:" << LL_ENDL;
-
- LL_DEBUGS2("AppInit","Directories") << " CurPath: " << getCurPath() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " AppName: " << getAppName() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " ExecutableFilename: " << getExecutableFilename() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " ExecutableDir: " << getExecutableDir() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " ExecutablePathAndName: " << getExecutablePathAndName() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " WorkingDir: " << getWorkingDir() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " AppRODataDir: " << getAppRODataDir() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " OSUserDir: " << getOSUserDir() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " OSUserAppDir: " << getOSUserAppDir() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " LindenUserDir: " << getLindenUserDir() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " TempDir: " << getTempDir() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " CAFile: " << getCAFile() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " SkinBaseDir: " << getSkinBaseDir() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " SkinDir: " << getSkinDir() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << "Current Directories:" << LL_ENDL;
+
+ LL_DEBUGS("AppInit","Directories") << " CurPath: " << getCurPath() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " AppName: " << getAppName() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " ExecutableFilename: " << getExecutableFilename() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " ExecutableDir: " << getExecutableDir() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " ExecutablePathAndName: " << getExecutablePathAndName() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " WorkingDir: " << getWorkingDir() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " AppRODataDir: " << getAppRODataDir() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " OSUserDir: " << getOSUserDir() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " OSUserAppDir: " << getOSUserAppDir() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " LindenUserDir: " << getLindenUserDir() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " TempDir: " << getTempDir() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " CAFile: " << getCAFile() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " SkinBaseDir: " << getSkinBaseDir() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " SkinDir: " << getSkinDir() << LL_ENDL;
}
std::string LLDir::add(const std::string& path, const std::string& name) const
@@ -1095,13 +1095,13 @@ void dir_exists_or_crash(const std::string &dir_name)
{
if(0 != LLFile::mkdir(dir_name, 0700)) // octal
{
- llerrs << "Unable to create directory: " << dir_name << llendl;
+ LL_ERRS() << "Unable to create directory: " << dir_name << LL_ENDL;
}
}
else
{
- llerrs << "Unable to stat: " << dir_name << " errno = " << stat_rv
- << llendl;
+ LL_ERRS() << "Unable to stat: " << dir_name << " errno = " << stat_rv
+ << LL_ENDL;
}
}
else
@@ -1109,7 +1109,7 @@ void dir_exists_or_crash(const std::string &dir_name)
// data_dir exists, make sure it's a directory.
if(!S_ISDIR(dir_stat.st_mode))
{
- llerrs << "Data directory collision: " << dir_name << llendl;
+ LL_ERRS() << "Data directory collision: " << dir_name << LL_ENDL;
}
}
#endif
diff --git a/indra/llvfs/lldir_linux.cpp b/indra/llvfs/lldir_linux.cpp
index 4edd078640..7a4034c228 100755
--- a/indra/llvfs/lldir_linux.cpp
+++ b/indra/llvfs/lldir_linux.cpp
@@ -49,7 +49,7 @@ static std::string getCurrentUserHome(char* fallback)
}
else
{
- llinfos << "Couldn't detect home directory from passwd - trying $HOME" << llendl;
+ LL_INFOS() << "Couldn't detect home directory from passwd - trying $HOME" << LL_ENDL;
const char *const home_env = getenv("HOME"); /* Flawfinder: ignore */
if (home_env)
{
@@ -57,7 +57,7 @@ static std::string getCurrentUserHome(char* fallback)
}
else
{
- llwarns << "Couldn't detect home directory! Falling back to " << fallback << llendl;
+ LL_WARNS() << "Couldn't detect home directory! Falling back to " << fallback << LL_ENDL;
}
}
@@ -76,11 +76,11 @@ LLDir_Linux::LLDir_Linux()
if (getcwd(tmp_str, LL_MAX_PATH) == NULL)
{
strcpy(tmp_str, "/tmp");
- llwarns << "Could not get current directory; changing to "
- << tmp_str << llendl;
+ LL_WARNS() << "Could not get current directory; changing to "
+ << tmp_str << LL_ENDL;
if (chdir(tmp_str) == -1)
{
- llerrs << "Could not change directory to " << tmp_str << llendl;
+ LL_ERRS() << "Could not change directory to " << tmp_str << LL_ENDL;
}
}
@@ -98,8 +98,8 @@ LLDir_Linux::LLDir_Linux()
{
// ...we're in a dev checkout
mSkinBaseDir = mExecutableDir.substr(0, build_dir_pos) + "/indra/newview/skins";
- llinfos << "Running in dev checkout with mSkinBaseDir "
- << mSkinBaseDir << llendl;
+ LL_INFOS() << "Running in dev checkout with mSkinBaseDir "
+ << mSkinBaseDir << LL_ENDL;
}
else
{
@@ -187,8 +187,8 @@ void LLDir_Linux::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create app user dir " << mOSUserAppDir << llendl;
- llwarns << "Default to base dir" << mOSUserDir << llendl;
+ LL_WARNS() << "Couldn't create app user dir " << mOSUserAppDir << LL_ENDL;
+ LL_WARNS() << "Default to base dir" << mOSUserDir << LL_ENDL;
mOSUserAppDir = mOSUserDir;
}
}
@@ -198,7 +198,7 @@ void LLDir_Linux::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create LL_PATH_LOGS dir " << getExpandedFilename(LL_PATH_LOGS,"") << llendl;
+ LL_WARNS() << "Couldn't create LL_PATH_LOGS dir " << getExpandedFilename(LL_PATH_LOGS,"") << LL_ENDL;
}
}
@@ -207,7 +207,7 @@ void LLDir_Linux::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create LL_PATH_USER_SETTINGS dir " << getExpandedFilename(LL_PATH_USER_SETTINGS,"") << llendl;
+ LL_WARNS() << "Couldn't create LL_PATH_USER_SETTINGS dir " << getExpandedFilename(LL_PATH_USER_SETTINGS,"") << LL_ENDL;
}
}
@@ -216,7 +216,7 @@ void LLDir_Linux::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create LL_PATH_CACHE dir " << getExpandedFilename(LL_PATH_CACHE,"") << llendl;
+ LL_WARNS() << "Couldn't create LL_PATH_CACHE dir " << getExpandedFilename(LL_PATH_CACHE,"") << LL_ENDL;
}
}
@@ -247,7 +247,7 @@ std::string LLDir_Linux::getCurPath()
char tmp_str[LL_MAX_PATH]; /* Flawfinder: ignore */
if (getcwd(tmp_str, LL_MAX_PATH) == NULL)
{
- llwarns << "Could not get current directory" << llendl;
+ LL_WARNS() << "Could not get current directory" << LL_ENDL;
tmp_str[0] = '\0';
}
return tmp_str;
diff --git a/indra/llvfs/lldir_mac.cpp b/indra/llvfs/lldir_mac.cpp
index 2f47ab3507..4038c92465 100755
--- a/indra/llvfs/lldir_mac.cpp
+++ b/indra/llvfs/lldir_mac.cpp
@@ -100,8 +100,8 @@ LLDir_Mac::LLDir_Mac()
// ...we're in a dev checkout
mSkinBaseDir = mExecutableDir.substr(0, build_dir_pos)
+ "/indra/newview/skins";
- llinfos << "Running in dev checkout with mSkinBaseDir "
- << mSkinBaseDir << llendl;
+ LL_INFOS() << "Running in dev checkout with mSkinBaseDir "
+ << mSkinBaseDir << LL_ENDL;
}
else
{
diff --git a/indra/llvfs/lldir_solaris.cpp b/indra/llvfs/lldir_solaris.cpp
index a97d72d539..b43b2f27ce 100755
--- a/indra/llvfs/lldir_solaris.cpp
+++ b/indra/llvfs/lldir_solaris.cpp
@@ -52,7 +52,7 @@ static std::string getCurrentUserHome(char* fallback)
}
else
{
- llinfos << "Couldn't detect home directory from passwd - trying $HOME" << llendl;
+ LL_INFOS() << "Couldn't detect home directory from passwd - trying $HOME" << LL_ENDL;
const char *const home_env = getenv("HOME"); /* Flawfinder: ignore */
if (home_env)
{
@@ -60,7 +60,7 @@ static std::string getCurrentUserHome(char* fallback)
}
else
{
- llwarns << "Couldn't detect home directory! Falling back to " << fallback << llendl;
+ LL_WARNS() << "Couldn't detect home directory! Falling back to " << fallback << LL_ENDL;
}
}
@@ -79,11 +79,11 @@ LLDir_Solaris::LLDir_Solaris()
if (getcwd(tmp_str, LL_MAX_PATH) == NULL)
{
strcpy(tmp_str, "/tmp");
- llwarns << "Could not get current directory; changing to "
- << tmp_str << llendl;
+ LL_WARNS() << "Could not get current directory; changing to "
+ << tmp_str << LL_ENDL;
if (chdir(tmp_str) == -1)
{
- llerrs << "Could not change directory to " << tmp_str << llendl;
+ LL_ERRS() << "Could not change directory to " << tmp_str << LL_ENDL;
}
}
@@ -101,12 +101,12 @@ LLDir_Solaris::LLDir_Solaris()
sprintf(path, "/proc/%d/psinfo", (int)getpid());
int proc_fd = -1;
if((proc_fd = open(path, O_RDONLY)) == -1){
- llwarns << "unable to open " << path << llendl;
+ LL_WARNS() << "unable to open " << path << LL_ENDL;
return;
}
psinfo_t proc_psinfo;
if(read(proc_fd, &proc_psinfo, sizeof(psinfo_t)) != sizeof(psinfo_t)){
- llwarns << "Unable to read " << path << llendl;
+ LL_WARNS() << "Unable to read " << path << LL_ENDL;
close(proc_fd);
return;
}
@@ -114,13 +114,13 @@ LLDir_Solaris::LLDir_Solaris()
close(proc_fd);
mExecutableFilename = strdup(proc_psinfo.pr_fname);
- llinfos << "mExecutableFilename = [" << mExecutableFilename << "]" << llendl;
+ LL_INFOS() << "mExecutableFilename = [" << mExecutableFilename << "]" << LL_ENDL;
sprintf(path, "/proc/%d/path/a.out", (int)getpid());
char execpath[LL_MAX_PATH];
if(readlink(path, execpath, LL_MAX_PATH) == -1){
- llwarns << "Unable to read link from " << path << llendl;
+ LL_WARNS() << "Unable to read link from " << path << LL_ENDL;
return;
}
@@ -130,7 +130,7 @@ LLDir_Solaris::LLDir_Solaris()
*p = NULL;
mExecutablePathAndName = strdup(execpath);
- llinfos << "mExecutablePathAndName = [" << mExecutablePathAndName << "]" << llendl;
+ LL_INFOS() << "mExecutablePathAndName = [" << mExecutablePathAndName << "]" << LL_ENDL;
//NOTE: Why force people to cd into the package directory?
// Look for SECONDLIFE env variable and use it, if set.
@@ -151,7 +151,7 @@ LLDir_Solaris::LLDir_Solaris()
*s = (char)NULL;
mExecutableDir = strdup(execpath);
- llinfos << "mExecutableDir = [" << mExecutableDir << "]" << llendl;
+ LL_INFOS() << "mExecutableDir = [" << mExecutableDir << "]" << LL_ENDL;
}
}
@@ -205,8 +205,8 @@ void LLDir_Solaris::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create app user dir " << mOSUserAppDir << llendl;
- llwarns << "Default to base dir" << mOSUserDir << llendl;
+ LL_WARNS() << "Couldn't create app user dir " << mOSUserAppDir << LL_ENDL;
+ LL_WARNS() << "Default to base dir" << mOSUserDir << LL_ENDL;
mOSUserAppDir = mOSUserDir;
}
}
@@ -216,7 +216,7 @@ void LLDir_Solaris::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create LL_PATH_LOGS dir " << getExpandedFilename(LL_PATH_LOGS,"") << llendl;
+ LL_WARNS() << "Couldn't create LL_PATH_LOGS dir " << getExpandedFilename(LL_PATH_LOGS,"") << LL_ENDL;
}
}
@@ -225,7 +225,7 @@ void LLDir_Solaris::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create LL_PATH_USER_SETTINGS dir " << getExpandedFilename(LL_PATH_USER_SETTINGS,"") << llendl;
+ LL_WARNS() << "Couldn't create LL_PATH_USER_SETTINGS dir " << getExpandedFilename(LL_PATH_USER_SETTINGS,"") << LL_ENDL;
}
}
@@ -234,7 +234,7 @@ void LLDir_Solaris::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create LL_PATH_CACHE dir " << getExpandedFilename(LL_PATH_CACHE,"") << llendl;
+ LL_WARNS() << "Couldn't create LL_PATH_CACHE dir " << getExpandedFilename(LL_PATH_CACHE,"") << LL_ENDL;
}
}
@@ -265,7 +265,7 @@ std::string LLDir_Solaris::getCurPath()
char tmp_str[LL_MAX_PATH]; /* Flawfinder: ignore */
if (getcwd(tmp_str, LL_MAX_PATH) == NULL)
{
- llwarns << "Could not get current directory" << llendl;
+ LL_WARNS() << "Could not get current directory" << LL_ENDL;
tmp_str[0] = '\0';
}
return tmp_str;
diff --git a/indra/llvfs/lldir_win32.cpp b/indra/llvfs/lldir_win32.cpp
index 6184095957..ebc8fdca33 100755
--- a/indra/llvfs/lldir_win32.cpp
+++ b/indra/llvfs/lldir_win32.cpp
@@ -131,7 +131,7 @@ LLDir_Win32::LLDir_Win32()
mAppRODataDir = mExecutableDir;
}
-// llinfos << "mAppRODataDir = " << mAppRODataDir << llendl;
+// LL_INFOS() << "mAppRODataDir = " << mAppRODataDir << LL_ENDL;
mSkinBaseDir = mAppRODataDir + mDirDelimiter + "skins";
@@ -144,7 +144,7 @@ LLDir_Win32::LLDir_Win32()
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create LL_PATH_CACHE dir " << mDefaultCacheDir << llendl;
+ LL_WARNS() << "Couldn't create LL_PATH_CACHE dir " << mDefaultCacheDir << LL_ENDL;
}
}
@@ -176,8 +176,8 @@ void LLDir_Win32::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create app user dir " << mOSUserAppDir << llendl;
- llwarns << "Default to base dir" << mOSUserDir << llendl;
+ LL_WARNS() << "Couldn't create app user dir " << mOSUserAppDir << LL_ENDL;
+ LL_WARNS() << "Default to base dir" << mOSUserDir << LL_ENDL;
mOSUserAppDir = mOSUserDir;
}
}
@@ -188,7 +188,7 @@ void LLDir_Win32::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create LL_PATH_LOGS dir " << getExpandedFilename(LL_PATH_LOGS,"") << llendl;
+ LL_WARNS() << "Couldn't create LL_PATH_LOGS dir " << getExpandedFilename(LL_PATH_LOGS,"") << LL_ENDL;
}
}
@@ -197,7 +197,7 @@ void LLDir_Win32::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create LL_PATH_USER_SETTINGS dir " << getExpandedFilename(LL_PATH_USER_SETTINGS,"") << llendl;
+ LL_WARNS() << "Couldn't create LL_PATH_USER_SETTINGS dir " << getExpandedFilename(LL_PATH_USER_SETTINGS,"") << LL_ENDL;
}
}
@@ -206,7 +206,7 @@ void LLDir_Win32::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create LL_PATH_CACHE dir " << getExpandedFilename(LL_PATH_CACHE,"") << llendl;
+ LL_WARNS() << "Couldn't create LL_PATH_CACHE dir " << getExpandedFilename(LL_PATH_CACHE,"") << LL_ENDL;
}
}
diff --git a/indra/llvfs/lldirguard.h b/indra/llvfs/lldirguard.h
index 4330095ad0..37b9e9b83e 100755
--- a/indra/llvfs/lldirguard.h
+++ b/indra/llvfs/lldirguard.h
@@ -48,7 +48,7 @@ public:
// Dir has changed
std::string mOrigDirUtf8 = utf16str_to_utf8str(llutf16string(mOrigDir));
std::string mFinalDirUtf8 = utf16str_to_utf8str(llutf16string(mFinalDir));
- llinfos << "Resetting working dir from " << mFinalDirUtf8 << " to " << mOrigDirUtf8 << llendl;
+ LL_INFOS() << "Resetting working dir from " << mFinalDirUtf8 << " to " << mOrigDirUtf8 << LL_ENDL;
SetCurrentDirectory(mOrigDir);
}
}
diff --git a/indra/llvfs/lldiriterator.cpp b/indra/llvfs/lldiriterator.cpp
index 229608231c..a9d96c9807 100755
--- a/indra/llvfs/lldiriterator.cpp
+++ b/indra/llvfs/lldiriterator.cpp
@@ -62,13 +62,13 @@ LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask)
}
catch (const fs::filesystem_error& e)
{
- llwarns << e.what() << llendl;
+ LL_WARNS() << e.what() << LL_ENDL;
return;
}
if (!is_dir)
{
- llwarns << "Invalid path: \"" << dir_path.string() << "\"" << llendl;
+ LL_WARNS() << "Invalid path: \"" << dir_path.string() << "\"" << LL_ENDL;
return;
}
@@ -79,7 +79,7 @@ LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask)
}
catch (const fs::filesystem_error& e)
{
- llwarns << e.what() << llendl;
+ LL_WARNS() << e.what() << LL_ENDL;
return;
}
@@ -95,8 +95,8 @@ LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask)
}
catch (boost::regex_error& e)
{
- llwarns << "\"" << exp << "\" is not a valid regular expression: "
- << e.what() << llendl;
+ LL_WARNS() << "\"" << exp << "\" is not a valid regular expression: "
+ << e.what() << LL_ENDL;
return;
}
@@ -113,7 +113,7 @@ bool LLDirIterator::Impl::next(std::string &fname)
if (!mIsValid)
{
- llwarns << "The iterator is not correctly initialized." << llendl;
+ LL_WARNS() << "The iterator is not correctly initialized." << LL_ENDL;
return false;
}
@@ -137,7 +137,7 @@ bool LLDirIterator::Impl::next(std::string &fname)
}
catch (const fs::filesystem_error& e)
{
- llwarns << e.what() << llendl;
+ LL_WARNS() << e.what() << LL_ENDL;
}
return found;
@@ -185,7 +185,7 @@ std::string glob_to_regex(const std::string& glob)
case '}':
if (!braces)
{
- llerrs << "glob_to_regex: Closing brace without an equivalent opening brace: " << glob << llendl;
+ LL_ERRS() << "glob_to_regex: Closing brace without an equivalent opening brace: " << glob << LL_ENDL;
}
regex+=')';
@@ -216,7 +216,7 @@ std::string glob_to_regex(const std::string& glob)
if (braces)
{
- llerrs << "glob_to_regex: Unterminated brace expression: " << glob << llendl;
+ LL_ERRS() << "glob_to_regex: Unterminated brace expression: " << glob << LL_ENDL;
}
return regex;
diff --git a/indra/llvfs/lllfsthread.cpp b/indra/llvfs/lllfsthread.cpp
index 073b1af2a1..2fd2614cce 100755
--- a/indra/llvfs/lllfsthread.cpp
+++ b/indra/llvfs/lllfsthread.cpp
@@ -97,7 +97,7 @@ LLLFSThread::handle_t LLLFSThread::read(const std::string& filename, /* Flawfind
bool res = addRequest(req);
if (!res)
{
- llerrs << "LLLFSThread::read called after LLLFSThread::cleanupClass()" << llendl;
+ LL_ERRS() << "LLLFSThread::read called after LLLFSThread::cleanupClass()" << LL_ENDL;
}
return handle;
@@ -119,7 +119,7 @@ LLLFSThread::handle_t LLLFSThread::write(const std::string& filename,
bool res = addRequest(req);
if (!res)
{
- llerrs << "LLLFSThread::read called after LLLFSThread::cleanupClass()" << llendl;
+ LL_ERRS() << "LLLFSThread::read called after LLLFSThread::cleanupClass()" << LL_ENDL;
}
return handle;
@@ -144,7 +144,7 @@ LLLFSThread::Request::Request(LLLFSThread* thread,
{
if (numbytes <= 0)
{
- llwarns << "LLLFSThread: Request with numbytes = " << numbytes << llendl;
+ LL_WARNS() << "LLLFSThread: Request with numbytes = " << numbytes << LL_ENDL;
}
}
@@ -166,7 +166,7 @@ void LLLFSThread::Request::deleteRequest()
{
if (getStatus() == STATUS_QUEUED)
{
- llerrs << "Attempt to delete a queued LLLFSThread::Request!" << llendl;
+ LL_ERRS() << "Attempt to delete a queued LLLFSThread::Request!" << LL_ENDL;
}
if (mResponder.notNull())
{
@@ -186,7 +186,7 @@ bool LLLFSThread::Request::processRequest()
infile.open(mFileName, LL_APR_RB, mThread->getLocalAPRFilePool());
if (!infile.getFileHandle())
{
- llwarns << "LLLFS: Unable to read file: " << mFileName << llendl;
+ LL_WARNS() << "LLLFS: Unable to read file: " << mFileName << LL_ENDL;
mBytesRead = 0; // fail
return true;
}
@@ -198,7 +198,7 @@ bool LLLFSThread::Request::processRequest()
llassert_always(off >= 0);
mBytesRead = infile.read(mBuffer, mBytes );
complete = true;
-// llinfos << "LLLFSThread::READ:" << mFileName << " Bytes: " << mBytesRead << llendl;
+// LL_INFOS() << "LLLFSThread::READ:" << mFileName << " Bytes: " << mBytesRead << LL_ENDL;
}
else if (mOperation == FILE_WRITE)
{
@@ -209,7 +209,7 @@ bool LLLFSThread::Request::processRequest()
outfile.open(mFileName, flags, mThread->getLocalAPRFilePool());
if (!outfile.getFileHandle())
{
- llwarns << "LLLFS: Unable to write file: " << mFileName << llendl;
+ LL_WARNS() << "LLLFS: Unable to write file: " << mFileName << LL_ENDL;
mBytesRead = 0; // fail
return true;
}
@@ -218,18 +218,18 @@ bool LLLFSThread::Request::processRequest()
S32 seek = outfile.seek(APR_SET, mOffset);
if (seek < 0)
{
- llwarns << "LLLFS: Unable to write file (seek failed): " << mFileName << llendl;
+ LL_WARNS() << "LLLFS: Unable to write file (seek failed): " << mFileName << LL_ENDL;
mBytesRead = 0; // fail
return true;
}
}
mBytesRead = outfile.write(mBuffer, mBytes );
complete = true;
-// llinfos << "LLLFSThread::WRITE:" << mFileName << " Bytes: " << mBytesRead << "/" << mBytes << " Offset:" << mOffset << llendl;
+// LL_INFOS() << "LLLFSThread::WRITE:" << mFileName << " Bytes: " << mBytesRead << "/" << mBytes << " Offset:" << mOffset << LL_ENDL;
}
else
{
- llerrs << "LLLFSThread::unknown operation: " << (S32)mOperation << llendl;
+ LL_ERRS() << "LLLFSThread::unknown operation: " << (S32)mOperation << LL_ENDL;
}
return complete;
}
diff --git a/indra/llvfs/llpidlock.cpp b/indra/llvfs/llpidlock.cpp
index b5fd3673a6..e64368e8d7 100755..100644
--- a/indra/llvfs/llpidlock.cpp
+++ b/indra/llvfs/llpidlock.cpp
@@ -38,12 +38,6 @@
#include <windows.h>
-namespace {
- inline DWORD getpid() {
- return GetCurrentProcessId();
- }
-}
-
bool isProcessAlive(U32 pid)
{
return (bool) GetProcessVersion((DWORD)pid);
@@ -105,7 +99,7 @@ void LLPidLockFile::writeLockFile(LLSD pids)
if (!LLSDSerialize::toXML(pids,ofile))
{
- llwarns << "Unable to write concurrent save lock file." << llendl;
+ LL_WARNS() << "Unable to write concurrent save lock file." << LL_ENDL;
}
ofile.close();
}
diff --git a/indra/llvfs/llpidlock.h b/indra/llvfs/llpidlock.h
index 334f26bb29..334f26bb29 100755..100644
--- a/indra/llvfs/llpidlock.h
+++ b/indra/llvfs/llpidlock.h
diff --git a/indra/llvfs/llvfile.cpp b/indra/llvfs/llvfile.cpp
index 306d7d8ec7..b8588e99f4 100755
--- a/indra/llvfs/llvfile.cpp
+++ b/indra/llvfs/llvfile.cpp
@@ -30,16 +30,17 @@
#include "llerror.h"
#include "llthread.h"
-#include "llstat.h"
-#include "llvfs.h"
+#include "lltimer.h"
+#include "llfasttimer.h"
#include "llmemory.h"
+#include "llvfs.h"
const S32 LLVFile::READ = 0x00000001;
const S32 LLVFile::WRITE = 0x00000002;
const S32 LLVFile::READ_WRITE = 0x00000003; // LLVFile::READ & LLVFile::WRITE
const S32 LLVFile::APPEND = 0x00000006; // 0x00000004 & LLVFile::WRITE
-static LLFastTimer::DeclareTimer FTM_VFILE_WAIT("VFile Wait");
+static LLTrace::BlockTimerStatHandle FTM_VFILE_WAIT("VFile Wait");
//----------------------------------------------------------------------------
LLVFSThread* LLVFile::sVFSThread = NULL;
@@ -72,7 +73,7 @@ LLVFile::~LLVFile()
{
if (!(mMode & LLVFile::WRITE))
{
- //llwarns << "Destroying LLVFile with pending async read/write, aborting..." << llendl;
+ //LL_WARNS() << "Destroying LLVFile with pending async read/write, aborting..." << LL_ENDL;
sVFSThread->setFlags(mHandle, LLVFSThread::FLAG_AUTO_COMPLETE | LLVFSThread::FLAG_ABORT);
}
else // WRITE
@@ -88,13 +89,13 @@ BOOL LLVFile::read(U8 *buffer, S32 bytes, BOOL async, F32 priority)
{
if (! (mMode & READ))
{
- llwarns << "Attempt to read from file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << llendl;
+ LL_WARNS() << "Attempt to read from file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << LL_ENDL;
return FALSE;
}
if (mHandle != LLVFSThread::nullHandle())
{
- llwarns << "Attempt to read from vfile object " << mFileID << " with pending async operation" << llendl;
+ LL_WARNS() << "Attempt to read from vfile object " << mFileID << " with pending async operation" << LL_ENDL;
return FALSE;
}
mPriority = priority;
@@ -104,7 +105,7 @@ BOOL LLVFile::read(U8 *buffer, S32 bytes, BOOL async, F32 priority)
// We can't do a read while there are pending async writes
waitForLock(VFSLOCK_APPEND);
- // *FIX: (???)
+ // *FIX: (?)
if (async)
{
mHandle = sVFSThread->read(mVFS, mFileID, mFileType, buffer, mPosition, bytes, threadPri());
@@ -135,13 +136,13 @@ U8* LLVFile::readFile(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, S
data = NULL;
}
else
- {
- data = (U8*) ll_aligned_malloc_16(file_size);
+ {
+ data = (U8*) ll_aligned_malloc<16>(file_size);
file.read(data, file_size); /* Flawfinder: ignore */
if (file.getLastBytesRead() != (S32)file_size)
{
- ll_aligned_free(data);
+ ll_aligned_free<16>(data);
data = NULL;
file_size = 0;
}
@@ -198,11 +199,11 @@ BOOL LLVFile::write(const U8 *buffer, S32 bytes)
{
if (! (mMode & WRITE))
{
- llwarns << "Attempt to write to file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << llendl;
+ LL_WARNS() << "Attempt to write to file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << LL_ENDL;
}
if (mHandle != LLVFSThread::nullHandle())
{
- llerrs << "Attempt to write to vfile object " << mFileID << " with pending async operation" << llendl;
+ LL_ERRS() << "Attempt to write to vfile object " << mFileID << " with pending async operation" << LL_ENDL;
return FALSE;
}
BOOL success = TRUE;
@@ -232,7 +233,7 @@ BOOL LLVFile::write(const U8 *buffer, S32 bytes)
if (wrote < bytes)
{
- llwarns << "Tried to write " << bytes << " bytes, actually wrote " << wrote << llendl;
+ LL_WARNS() << "Tried to write " << bytes << " bytes, actually wrote " << wrote << LL_ENDL;
success = FALSE;
}
@@ -252,7 +253,7 @@ BOOL LLVFile::seek(S32 offset, S32 origin)
{
if (mMode == APPEND)
{
- llwarns << "Attempt to seek on append-only file" << llendl;
+ LL_WARNS() << "Attempt to seek on append-only file" << LL_ENDL;
return FALSE;
}
@@ -267,14 +268,14 @@ BOOL LLVFile::seek(S32 offset, S32 origin)
if (new_pos > size)
{
- llwarns << "Attempt to seek past end of file" << llendl;
+ LL_WARNS() << "Attempt to seek past end of file" << LL_ENDL;
mPosition = size;
return FALSE;
}
else if (new_pos < 0)
{
- llwarns << "Attempt to seek past beginning of file" << llendl;
+ LL_WARNS() << "Attempt to seek past beginning of file" << LL_ENDL;
mPosition = 0;
return FALSE;
@@ -308,20 +309,20 @@ BOOL LLVFile::setMaxSize(S32 size)
{
if (! (mMode & WRITE))
{
- llwarns << "Attempt to change size of file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << llendl;
+ LL_WARNS() << "Attempt to change size of file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << LL_ENDL;
return FALSE;
}
if (!mVFS->checkAvailable(size))
{
- //LLFastTimer t(FTM_VFILE_WAIT);
+ //LL_RECORD_BLOCK_TIME(FTM_VFILE_WAIT);
S32 count = 0;
while (sVFSThread->getPending() > 1000)
{
if (count % 100 == 0)
{
- llinfos << "VFS catching up... Pending: " << sVFSThread->getPending() << llendl;
+ LL_INFOS() << "VFS catching up... Pending: " << sVFSThread->getPending() << LL_ENDL;
}
if (sVFSThread->isPaused())
{
@@ -337,14 +338,14 @@ BOOL LLVFile::rename(const LLUUID &new_id, const LLAssetType::EType new_type)
{
if (! (mMode & WRITE))
{
- llwarns << "Attempt to rename file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << llendl;
+ LL_WARNS() << "Attempt to rename file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << LL_ENDL;
return FALSE;
}
if (mHandle != LLVFSThread::nullHandle())
{
- llwarns << "Renaming file with pending async read" << llendl;
+ LL_WARNS() << "Renaming file with pending async read" << LL_ENDL;
}
waitForLock(VFSLOCK_READ);
@@ -364,18 +365,18 @@ BOOL LLVFile::rename(const LLUUID &new_id, const LLAssetType::EType new_type)
BOOL LLVFile::remove()
{
-// llinfos << "Removing file " << mFileID << llendl;
+// LL_INFOS() << "Removing file " << mFileID << LL_ENDL;
if (! (mMode & WRITE))
{
// Leaving paranoia warning just because this should be a very infrequent
// operation.
- llwarns << "Remove file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << llendl;
+ LL_WARNS() << "Remove file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << LL_ENDL;
}
if (mHandle != LLVFSThread::nullHandle())
{
- llwarns << "Removing file with pending async read" << llendl;
+ LL_WARNS() << "Removing file with pending async read" << LL_ENDL;
}
// why not seek back to the beginning of the file too?
@@ -423,7 +424,7 @@ bool LLVFile::isLocked(EVFSLock lock)
void LLVFile::waitForLock(EVFSLock lock)
{
- //LLFastTimer t(FTM_VFILE_WAIT);
+ //LL_RECORD_BLOCK_TIME(FTM_VFILE_WAIT);
// spin until the lock clears
while (isLocked(lock))
{
diff --git a/indra/llvfs/llvfs.cpp b/indra/llvfs/llvfs.cpp
index 7b589f5b96..1cc0e819db 100755
--- a/indra/llvfs/llvfs.cpp
+++ b/indra/llvfs/llvfs.cpp
@@ -638,7 +638,7 @@ void LLVFS::presizeDataFile(const U32 size)
{
if (!mDataFP)
{
- llerrs << "LLVFS::presizeDataFile() with no data file open" << llendl;
+ LL_ERRS() << "LLVFS::presizeDataFile() with no data file open" << LL_ENDL;
return;
}
@@ -653,11 +653,11 @@ void LLVFS::presizeDataFile(const U32 size)
if (tmp)
{
- llinfos << "Pre-sized VFS data file to " << ftell(mDataFP) << " bytes" << llendl;
+ LL_INFOS() << "Pre-sized VFS data file to " << ftell(mDataFP) << " bytes" << LL_ENDL;
}
else
{
- llwarns << "Failed to pre-size VFS data file" << llendl;
+ LL_WARNS() << "Failed to pre-size VFS data file" << LL_ENDL;
}
}
@@ -667,7 +667,7 @@ BOOL LLVFS::getExists(const LLUUID &file_id, const LLAssetType::EType file_type)
if (!isValid())
{
- llerrs << "Attempting to use invalid VFS!" << llendl;
+ LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
}
lockData();
@@ -693,7 +693,7 @@ S32 LLVFS::getSize(const LLUUID &file_id, const LLAssetType::EType file_type)
if (!isValid())
{
- llerrs << "Attempting to use invalid VFS!" << llendl;
+ LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
}
@@ -720,7 +720,7 @@ S32 LLVFS::getMaxSize(const LLUUID &file_id, const LLAssetType::EType file_type
if (!isValid())
{
- llerrs << "Attempting to use invalid VFS!" << llendl;
+ LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
}
lockData();
@@ -756,15 +756,15 @@ BOOL LLVFS::setMaxSize(const LLUUID &file_id, const LLAssetType::EType file_type
{
if (!isValid())
{
- llerrs << "Attempting to use invalid VFS!" << llendl;
+ LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
}
if (mReadOnly)
{
- llerrs << "Attempt to write to read-only VFS" << llendl;
+ LL_ERRS() << "Attempt to write to read-only VFS" << LL_ENDL;
}
if (max_size <= 0)
{
- llwarns << "VFS: Attempt to assign size " << max_size << " to vfile " << file_id << llendl;
+ LL_WARNS() << "VFS: Attempt to assign size " << max_size << " to vfile " << file_id << LL_ENDL;
return FALSE;
}
@@ -811,7 +811,7 @@ BOOL LLVFS::setMaxSize(const LLUUID &file_id, const LLAssetType::EType file_type
if (block->mLength < block->mSize)
{
// JC: Was a warning, but Ian says it's bad.
- llerrs << "Truncating virtual file " << file_id << " to " << block->mLength << " bytes" << llendl;
+ LL_ERRS() << "Truncating virtual file " << file_id << " to " << block->mLength << " bytes" << LL_ENDL;
block->mSize = block->mLength;
}
@@ -879,10 +879,10 @@ BOOL LLVFS::setMaxSize(const LLUUID &file_id, const LLAssetType::EType file_type
fseek(mDataFP, new_data_location, SEEK_SET);
if (fwrite(&buffer[0], block->mSize, 1, mDataFP) != 1)
{
- llwarns << "Short write" << llendl;
+ LL_WARNS() << "Short write" << LL_ENDL;
}
} else {
- llwarns << "Short read" << llendl;
+ LL_WARNS() << "Short read" << LL_ENDL;
}
}
}
@@ -899,7 +899,7 @@ BOOL LLVFS::setMaxSize(const LLUUID &file_id, const LLAssetType::EType file_type
}
else
{
- llwarns << "VFS: No space (" << max_size << ") to resize existing vfile " << file_id << llendl;
+ LL_WARNS() << "VFS: No space (" << max_size << ") to resize existing vfile " << file_id << LL_ENDL;
//dumpMap();
unlockData();
dumpStatistics();
@@ -935,7 +935,7 @@ BOOL LLVFS::setMaxSize(const LLUUID &file_id, const LLAssetType::EType file_type
}
else
{
- llwarns << "VFS: No space (" << max_size << ") for new virtual file " << file_id << llendl;
+ LL_WARNS() << "VFS: No space (" << max_size << ") for new virtual file " << file_id << LL_ENDL;
//dumpMap();
unlockData();
dumpStatistics();
@@ -954,11 +954,11 @@ void LLVFS::renameFile(const LLUUID &file_id, const LLAssetType::EType file_type
{
if (!isValid())
{
- llerrs << "Attempting to use invalid VFS!" << llendl;
+ LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
}
if (mReadOnly)
{
- llerrs << "Attempt to write to read-only VFS" << llendl;
+ LL_ERRS() << "Attempt to write to read-only VFS" << LL_ENDL;
}
lockData();
@@ -990,7 +990,7 @@ void LLVFS::renameFile(const LLUUID &file_id, const LLAssetType::EType file_type
{
if(dest_block->mLocks[i])
{
- llerrs << "Renaming VFS block to a locked file." << llendl;
+ LL_ERRS() << "Renaming VFS block to a locked file." << LL_ENDL;
}
dest_block->mLocks[i] = src_block->mLocks[i];
}
@@ -1010,7 +1010,7 @@ void LLVFS::renameFile(const LLUUID &file_id, const LLAssetType::EType file_type
}
else
{
- llwarns << "VFS: Attempt to rename nonexistent vfile " << file_id << ":" << file_type << llendl;
+ LL_WARNS() << "VFS: Attempt to rename nonexistent vfile " << file_id << ":" << file_type << LL_ENDL;
}
unlockData();
}
@@ -1042,11 +1042,11 @@ void LLVFS::removeFile(const LLUUID &file_id, const LLAssetType::EType file_type
{
if (!isValid())
{
- llerrs << "Attempting to use invalid VFS!" << llendl;
+ LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
}
if (mReadOnly)
{
- llerrs << "Attempt to write to read-only VFS" << llendl;
+ LL_ERRS() << "Attempt to write to read-only VFS" << LL_ENDL;
}
lockData();
@@ -1060,7 +1060,7 @@ void LLVFS::removeFile(const LLUUID &file_id, const LLAssetType::EType file_type
}
else
{
- llwarns << "VFS: attempting to remove nonexistent file " << file_id << " type " << file_type << llendl;
+ LL_WARNS() << "VFS: attempting to remove nonexistent file " << file_id << " type " << file_type << LL_ENDL;
}
unlockData();
@@ -1073,7 +1073,7 @@ S32 LLVFS::getData(const LLUUID &file_id, const LLAssetType::EType file_type, U8
if (!isValid())
{
- llerrs << "Attempting to use invalid VFS!" << llendl;
+ LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
}
llassert(location >= 0);
llassert(length >= 0);
@@ -1092,7 +1092,7 @@ S32 LLVFS::getData(const LLUUID &file_id, const LLAssetType::EType file_type, U8
if (location > block->mSize)
{
- llwarns << "VFS: Attempt to read location " << location << " in file " << file_id << " of length " << block->mSize << llendl;
+ LL_WARNS() << "VFS: Attempt to read location " << location << " in file " << file_id << " of length " << block->mSize << LL_ENDL;
}
else
{
@@ -1120,11 +1120,11 @@ S32 LLVFS::storeData(const LLUUID &file_id, const LLAssetType::EType file_type,
{
if (!isValid())
{
- llerrs << "Attempting to use invalid VFS!" << llendl;
+ LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
}
if (mReadOnly)
{
- llerrs << "Attempt to write to read-only VFS" << llendl;
+ LL_ERRS() << "Attempt to write to read-only VFS" << LL_ENDL;
}
llassert(length > 0);
@@ -1149,22 +1149,22 @@ S32 LLVFS::storeData(const LLUUID &file_id, const LLAssetType::EType file_type,
if (block->mLength == BLOCK_LENGTH_INVALID)
{
// Block was removed, ignore write
- llwarns << "VFS: Attempt to write to invalid block"
+ LL_WARNS() << "VFS: Attempt to write to invalid block"
<< " in file " << file_id
<< " location: " << in_loc
<< " bytes: " << length
- << llendl;
+ << LL_ENDL;
unlockData();
return length;
}
else if (location > block->mLength)
{
- llwarns << "VFS: Attempt to write to location " << location
+ LL_WARNS() << "VFS: Attempt to write to location " << location
<< " in file " << file_id
<< " type " << S32(file_type)
<< " of size " << block->mSize
<< " block length " << block->mLength
- << llendl;
+ << LL_ENDL;
unlockData();
return length;
}
@@ -1172,7 +1172,7 @@ S32 LLVFS::storeData(const LLUUID &file_id, const LLAssetType::EType file_type,
{
if (length > block->mLength - location )
{
- llwarns << "VFS: Truncating write to virtual file " << file_id << " type " << S32(file_type) << llendl;
+ LL_WARNS() << "VFS: Truncating write to virtual file " << file_id << " type " << S32(file_type) << LL_ENDL;
length = block->mLength - location;
}
U32 file_location = location + block->mLocation;
@@ -1181,7 +1181,7 @@ S32 LLVFS::storeData(const LLUUID &file_id, const LLAssetType::EType file_type,
S32 write_len = (S32)fwrite(buffer, 1, length, mDataFP);
if (write_len != length)
{
- llwarns << llformat("VFS Write Error: %d != %d",write_len,length) << llendl;
+ LL_WARNS() << llformat("VFS Write Error: %d != %d",write_len,length) << LL_ENDL;
}
// fflush(mDataFP);
@@ -1244,7 +1244,7 @@ void LLVFS::decLock(const LLUUID &file_id, const LLAssetType::EType file_type, E
}
else
{
- llwarns << "VFS: Decrementing zero-value lock " << lock << llendl;
+ LL_WARNS() << "VFS: Decrementing zero-value lock " << lock << LL_ENDL;
}
mLockCounts[lock]--;
}
@@ -1296,7 +1296,7 @@ void LLVFS::eraseBlockLength(LLVFSBlock *block)
}
if(!found_block)
{
- llerrs << "eraseBlock could not find block" << llendl;
+ LL_ERRS() << "eraseBlock could not find block" << LL_ENDL;
}
}
@@ -1319,7 +1319,7 @@ void LLVFS::addFreeBlock(LLVFSBlock *block)
size_t dbgcount = mFreeBlocksByLocation.count(block->mLocation);
if(dbgcount > 0)
{
- llerrs << "addFreeBlock called with block already in list" << llendl;
+ LL_ERRS() << "addFreeBlock called with block already in list" << LL_ENDL;
}
#endif
@@ -1348,7 +1348,7 @@ void LLVFS::addFreeBlock(LLVFSBlock *block)
if (merge_prev && merge_next)
{
- // llinfos << "VFS merge BOTH" << llendl;
+ // LL_INFOS() << "VFS merge BOTH" << LL_ENDL;
// Previous block is changing length (a lot), so only need to update length map.
// Next block is going away completely. JC
eraseBlockLength(prev_block);
@@ -1362,7 +1362,7 @@ void LLVFS::addFreeBlock(LLVFSBlock *block)
}
else if (merge_prev)
{
- // llinfos << "VFS merge previous" << llendl;
+ // LL_INFOS() << "VFS merge previous" << LL_ENDL;
// Previous block is maintaining location, only changing length,
// therefore only need to update the length map. JC
eraseBlockLength(prev_block);
@@ -1373,7 +1373,7 @@ void LLVFS::addFreeBlock(LLVFSBlock *block)
}
else if (merge_next)
{
- // llinfos << "VFS merge next" << llendl;
+ // LL_INFOS() << "VFS merge next" << LL_ENDL;
// Next block is changing both location and length,
// so both free lists must update. JC
eraseBlock(next_block);
@@ -1400,7 +1400,7 @@ void LLVFS::addFreeBlock(LLVFSBlock *block)
//{
// if (!isValid())
// {
-// llerrs << "Attempting to use invalid VFS!" << llendl;
+// LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
// }
// // TODO: could we optimize this with hints from the calling code?
// blocks_location_map_t::iterator iter = mFreeBlocksByLocation.begin();
@@ -1459,11 +1459,11 @@ void LLVFS::sync(LLVFSFileBlock *block, BOOL remove)
{
if (!isValid())
{
- llerrs << "Attempting to use invalid VFS!" << llendl;
+ LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
}
if (mReadOnly)
{
- llwarns << "Attempt to sync read-only VFS" << llendl;
+ LL_WARNS() << "Attempt to sync read-only VFS" << LL_ENDL;
return;
}
if (block->mLength == BLOCK_LENGTH_INVALID)
@@ -1473,7 +1473,7 @@ void LLVFS::sync(LLVFSFileBlock *block, BOOL remove)
}
if (block->mLength == 0)
{
- llerrs << "VFS syncing zero-length block" << llendl;
+ LL_ERRS() << "VFS syncing zero-length block" << LL_ENDL;
}
BOOL set_index_to_end = FALSE;
@@ -1525,7 +1525,7 @@ void LLVFS::sync(LLVFSFileBlock *block, BOOL remove)
if (fwrite(buffer, LLVFSFileBlock::SERIAL_SIZE, 1, mIndexFP) != 1)
{
- llwarns << "Short write" << llendl;
+ LL_WARNS() << "Short write" << LL_ENDL;
}
// *NOTE: Why was this commented out?
@@ -1541,7 +1541,7 @@ LLVFSBlock *LLVFS::findFreeBlock(S32 size, LLVFSFileBlock *immune)
{
if (!isValid())
{
- llerrs << "Attempting to use invalid VFS!" << llendl;
+ LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
}
LLVFSBlock *block = NULL;
@@ -1586,7 +1586,7 @@ LLVFSBlock *LLVFS::findFreeBlock(S32 size, LLVFSFileBlock *immune)
if (lru_list.size() == 0)
{
// No more files to delete, and still not enough room!
- llwarns << "VFS: Can't make " << size << " bytes of free space in VFS, giving up" << llendl;
+ LL_WARNS() << "VFS: Can't make " << size << " bytes of free space in VFS, giving up" << LL_ENDL;
break;
}
@@ -1597,7 +1597,7 @@ LLVFSBlock *LLVFS::findFreeBlock(S32 size, LLVFSFileBlock *immune)
{
// ditch this file and look again for a free block - should find it
// TODO: it'll be faster just to assign the free block and break
- llinfos << "LRU: Removing " << file_block->mFileID << ":" << file_block->mFileType << llendl;
+ LL_INFOS() << "LRU: Removing " << file_block->mFileID << ":" << file_block->mFileType << LL_ENDL;
lru_list.erase(it);
removeFileBlock(file_block);
file_block = NULL;
@@ -1605,7 +1605,7 @@ LLVFSBlock *LLVFS::findFreeBlock(S32 size, LLVFSFileBlock *immune)
}
- llinfos << "VFS: LRU: Aggressive: " << (S32)lru_list.size() << " files remain" << llendl;
+ LL_INFOS() << "VFS: LRU: Aggressive: " << (S32)lru_list.size() << " files remain" << LL_ENDL;
dumpLockCounts();
// Now it's time to aggressively make more space
@@ -1620,7 +1620,7 @@ LLVFSBlock *LLVFS::findFreeBlock(S32 size, LLVFSFileBlock *immune)
file_block = *it;
// TODO: it would be great to be able to batch all these sync() calls
- // llinfos << "LRU2: Removing " << file_block->mFileID << ":" << file_block->mFileType << " last accessed" << file_block->mAccessTime << llendl;
+ // LL_INFOS() << "LRU2: Removing " << file_block->mFileID << ":" << file_block->mFileType << " last accessed" << file_block->mAccessTime << LL_ENDL;
cleaned_up += file_block->mLength;
lru_list.erase(it++);
@@ -1634,7 +1634,7 @@ LLVFSBlock *LLVFS::findFreeBlock(S32 size, LLVFSFileBlock *immune)
F32 time = timer.getElapsedTimeF32();
if (time > 0.5f)
{
- llwarns << "VFS: Spent " << time << " seconds in findFreeBlock!" << llendl;
+ LL_WARNS() << "VFS: Spent " << time << " seconds in findFreeBlock!" << LL_ENDL;
}
return block;
@@ -1648,7 +1648,7 @@ void LLVFS::pokeFiles()
{
if (!isValid())
{
- llerrs << "Attempting to use invalid VFS!" << llendl;
+ LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
}
U32 word;
@@ -1660,7 +1660,7 @@ void LLVFS::pokeFiles()
fseek(mDataFP, 0, SEEK_SET);
if (fwrite(&word, sizeof(word), 1, mDataFP) != 1)
{
- llwarns << "Could not write to data file" << llendl;
+ LL_WARNS() << "Could not write to data file" << LL_ENDL;
}
fflush(mDataFP);
}
@@ -1671,7 +1671,7 @@ void LLVFS::pokeFiles()
fseek(mIndexFP, 0, SEEK_SET);
if (fwrite(&word, sizeof(word), 1, mIndexFP) != 1)
{
- llwarns << "Could not write to index file" << llendl;
+ LL_WARNS() << "Could not write to index file" << LL_ENDL;
}
fflush(mIndexFP);
}
@@ -1680,20 +1680,20 @@ void LLVFS::pokeFiles()
void LLVFS::dumpMap()
{
- llinfos << "Files:" << llendl;
+ LL_INFOS() << "Files:" << LL_ENDL;
for (fileblock_map::iterator it = mFileBlocks.begin(); it != mFileBlocks.end(); ++it)
{
LLVFSFileBlock *file_block = (*it).second;
- llinfos << "Location: " << file_block->mLocation << "\tLength: " << file_block->mLength << "\t" << file_block->mFileID << "\t" << file_block->mFileType << llendl;
+ LL_INFOS() << "Location: " << file_block->mLocation << "\tLength: " << file_block->mLength << "\t" << file_block->mFileID << "\t" << file_block->mFileType << LL_ENDL;
}
- llinfos << "Free Blocks:" << llendl;
+ LL_INFOS() << "Free Blocks:" << LL_ENDL;
for (blocks_location_map_t::iterator iter = mFreeBlocksByLocation.begin(),
end = mFreeBlocksByLocation.end();
iter != end; iter++)
{
LLVFSBlock *free_block = iter->second;
- llinfos << "Location: " << free_block->mLocation << "\tLength: " << free_block->mLength << llendl;
+ LL_INFOS() << "Location: " << free_block->mLocation << "\tLength: " << free_block->mLength << LL_ENDL;
}
}
@@ -1717,7 +1717,7 @@ void LLVFS::audit()
if (fread(&buffer[0], 1, index_size, mIndexFP) != index_size)
{
- llwarns << "Index truncated" << llendl;
+ LL_WARNS() << "Index truncated" << LL_ENDL;
vfs_corrupt = TRUE;
}
@@ -1746,7 +1746,7 @@ void LLVFS::audit()
{
if (mFileBlocks.find(*block) == mFileBlocks.end())
{
- llwarns << "VFile " << block->mFileID << ":" << block->mFileType << " on disk, not in memory, loc " << block->mIndexLocation << llendl;
+ LL_WARNS() << "VFile " << block->mFileID << ":" << block->mFileType << " on disk, not in memory, loc " << block->mIndexLocation << LL_ENDL;
}
else if (found_files.find(*block) != found_files.end())
{
@@ -1758,22 +1758,22 @@ void LLVFS::audit()
mIndexFP = NULL;
unlockAndClose(mDataFP);
mDataFP = NULL;
- llwarns << "VFS: Original block index " << block->mIndexLocation
+ LL_WARNS() << "VFS: Original block index " << block->mIndexLocation
<< " location " << block->mLocation
<< " length " << block->mLength
<< " size " << block->mSize
<< " id " << block->mFileID
<< " type " << block->mFileType
- << llendl;
- llwarns << "VFS: Duplicate block index " << dupe->mIndexLocation
+ << LL_ENDL;
+ LL_WARNS() << "VFS: Duplicate block index " << dupe->mIndexLocation
<< " location " << dupe->mLocation
<< " length " << dupe->mLength
<< " size " << dupe->mSize
<< " id " << dupe->mFileID
<< " type " << dupe->mFileType
- << llendl;
- llwarns << "VFS: Index size " << index_size << llendl;
- llwarns << "VFS: INDEX CORRUPT" << llendl;
+ << LL_ENDL;
+ LL_WARNS() << "VFS: Index size " << index_size << LL_ENDL;
+ LL_WARNS() << "VFS: INDEX CORRUPT" << LL_ENDL;
vfs_corrupt = TRUE;
break;
}
@@ -1786,7 +1786,7 @@ void LLVFS::audit()
{
if (block->mLength)
{
- llwarns << "VFile " << block->mFileID << ":" << block->mFileType << " corrupt on disk" << llendl;
+ LL_WARNS() << "VFile " << block->mFileID << ":" << block->mFileType << " corrupt on disk" << LL_ENDL;
}
// else this is just a hole
}
@@ -1802,19 +1802,19 @@ void LLVFS::audit()
{
if (! found_files.count(*block))
{
- llwarns << "VFile " << block->mFileID << ":" << block->mFileType << " in memory, not on disk, loc " << block->mIndexLocation<< llendl;
+ LL_WARNS() << "VFile " << block->mFileID << ":" << block->mFileType << " in memory, not on disk, loc " << block->mIndexLocation<< LL_ENDL;
fseek(mIndexFP, block->mIndexLocation, SEEK_SET);
U8 buf[LLVFSFileBlock::SERIAL_SIZE];
if (fread(buf, LLVFSFileBlock::SERIAL_SIZE, 1, mIndexFP) != 1)
{
- llwarns << "VFile " << block->mFileID
- << " gave short read" << llendl;
+ LL_WARNS() << "VFile " << block->mFileID
+ << " gave short read" << LL_ENDL;
}
LLVFSFileBlock disk_block;
disk_block.deserialize(buf, block->mIndexLocation);
- llwarns << "Instead found " << disk_block.mFileID << ":" << block->mFileType << llendl;
+ LL_WARNS() << "Instead found " << disk_block.mFileID << ":" << block->mFileType << LL_ENDL;
}
else
{
@@ -1828,10 +1828,10 @@ void LLVFS::audit()
iter != found_files.end(); iter++)
{
LLVFSFileBlock* block = iter->second;
- llwarns << "VFile " << block->mFileID << ":" << block->mFileType << " szie:" << block->mSize << " leftover" << llendl;
+ LL_WARNS() << "VFile " << block->mFileID << ":" << block->mFileType << " szie:" << block->mSize << " leftover" << LL_ENDL;
}
- llinfos << "VFS: audit OK" << llendl;
+ LL_INFOS() << "VFS: audit OK" << LL_ENDL;
// mutex released by LLMutexLock() destructor.
}
@@ -1859,12 +1859,12 @@ void LLVFS::checkMem()
S32 index_loc = *iter;
if (index_loc == block->mIndexLocation)
{
- llwarns << "VFile block " << block->mFileID << ":" << block->mFileType << " is marked as a hole" << llendl;
+ LL_WARNS() << "VFile block " << block->mFileID << ":" << block->mFileType << " is marked as a hole" << LL_ENDL;
}
}
}
- llinfos << "VFS: mem check OK" << llendl;
+ LL_INFOS() << "VFS: mem check OK" << LL_ENDL;
unlockData();
}
@@ -1874,7 +1874,7 @@ void LLVFS::dumpLockCounts()
S32 i;
for (i = 0; i < VFSLOCK_COUNT; i++)
{
- llinfos << "LockType: " << i << ": " << mLockCounts[i] << llendl;
+ LL_INFOS() << "LockType: " << i << ": " << mLockCounts[i] << LL_ENDL;
}
}
@@ -1899,7 +1899,7 @@ void LLVFS::dumpStatistics()
}
else if (file_block->mLength <= 0)
{
- llinfos << "Bad file block at: " << file_block->mLocation << "\tLength: " << file_block->mLength << "\t" << file_block->mFileID << "\t" << file_block->mFileType << llendl;
+ LL_INFOS() << "Bad file block at: " << file_block->mLocation << "\tLength: " << file_block->mLength << "\t" << file_block->mFileID << "\t" << file_block->mFileType << LL_ENDL;
size_counts[file_block->mLength]++;
location_counts[file_block->mLocation]++;
}
@@ -1921,13 +1921,13 @@ void LLVFS::dumpStatistics()
{
S32 size = it->first;
S32 size_count = it->second;
- llinfos << "Bad files size " << size << " count " << size_count << llendl;
+ LL_INFOS() << "Bad files size " << size << " count " << size_count << LL_ENDL;
}
for (std::map<U32,S32>::iterator it = location_counts.begin(); it != location_counts.end(); ++it)
{
U32 location = it->first;
S32 location_count = it->second;
- llinfos << "Bad files location " << location << " count " << location_count << llendl;
+ LL_INFOS() << "Bad files location " << location << " count " << location_count << LL_ENDL;
}
// Investigate free list.
@@ -1941,14 +1941,14 @@ void LLVFS::dumpStatistics()
LLVFSBlock *free_block = iter->second;
if (free_block->mLength <= 0)
{
- llinfos << "Bad free block at: " << free_block->mLocation << "\tLength: " << free_block->mLength << llendl;
+ LL_INFOS() << "Bad free block at: " << free_block->mLocation << "\tLength: " << free_block->mLength << LL_ENDL;
}
else
{
- llinfos << "Block: " << free_block->mLocation
+ LL_INFOS() << "Block: " << free_block->mLocation
<< "\tLength: " << free_block->mLength
<< "\tEnd: " << free_block->mLocation + free_block->mLength
- << llendl;
+ << LL_ENDL;
total_free_size += free_block->mLength;
}
@@ -1963,38 +1963,38 @@ void LLVFS::dumpStatistics()
// Dump histogram of free block sizes
for (std::map<S32,S32>::iterator it = free_length_counts.begin(); it != free_length_counts.end(); ++it)
{
- llinfos << "Free length " << it->first << " count " << it->second << llendl;
+ LL_INFOS() << "Free length " << it->first << " count " << it->second << LL_ENDL;
}
- llinfos << "Invalid blocks: " << invalid_file_count << llendl;
- llinfos << "File blocks: " << mFileBlocks.size() << llendl;
+ LL_INFOS() << "Invalid blocks: " << invalid_file_count << LL_ENDL;
+ LL_INFOS() << "File blocks: " << mFileBlocks.size() << LL_ENDL;
S32 length_list_count = (S32)mFreeBlocksByLength.size();
S32 location_list_count = (S32)mFreeBlocksByLocation.size();
if (length_list_count == location_list_count)
{
- llinfos << "Free list lengths match, free blocks: " << location_list_count << llendl;
+ LL_INFOS() << "Free list lengths match, free blocks: " << location_list_count << LL_ENDL;
}
else
{
- llwarns << "Free list lengths do not match!" << llendl;
- llwarns << "By length: " << length_list_count << llendl;
- llwarns << "By location: " << location_list_count << llendl;
+ LL_WARNS() << "Free list lengths do not match!" << LL_ENDL;
+ LL_WARNS() << "By length: " << length_list_count << LL_ENDL;
+ LL_WARNS() << "By location: " << location_list_count << LL_ENDL;
}
- llinfos << "Max file: " << max_file_size/1024 << "K" << llendl;
- llinfos << "Max free: " << max_free_size/1024 << "K" << llendl;
- llinfos << "Total file size: " << total_file_size/1024 << "K" << llendl;
- llinfos << "Total free size: " << total_free_size/1024 << "K" << llendl;
- llinfos << "Sum: " << (total_file_size + total_free_size) << " bytes" << llendl;
- llinfos << llformat("%.0f%% full",((F32)(total_file_size)/(F32)(total_file_size+total_free_size))*100.f) << llendl;
+ LL_INFOS() << "Max file: " << max_file_size/1024 << "K" << LL_ENDL;
+ LL_INFOS() << "Max free: " << max_free_size/1024 << "K" << LL_ENDL;
+ LL_INFOS() << "Total file size: " << total_file_size/1024 << "K" << LL_ENDL;
+ LL_INFOS() << "Total free size: " << total_free_size/1024 << "K" << LL_ENDL;
+ LL_INFOS() << "Sum: " << (total_file_size + total_free_size) << " bytes" << LL_ENDL;
+ LL_INFOS() << llformat("%.0f%% full",((F32)(total_file_size)/(F32)(total_file_size+total_free_size))*100.f) << LL_ENDL;
- llinfos << " " << llendl;
+ LL_INFOS() << " " << LL_ENDL;
for (std::map<LLAssetType::EType, std::pair<S32,S32> >::iterator iter = filetype_counts.begin();
iter != filetype_counts.end(); ++iter)
{
- llinfos << "Type: " << LLAssetType::getDesc(iter->first)
+ LL_INFOS() << "Type: " << LLAssetType::getDesc(iter->first)
<< " Count: " << iter->second.first
- << " Bytes: " << (iter->second.second>>20) << " MB" << llendl;
+ << " Bytes: " << (iter->second.second>>20) << " MB" << LL_ENDL;
}
// Look for potential merges
@@ -2009,7 +2009,7 @@ void LLVFS::dumpStatistics()
LLVFSBlock *second_block = iter->second;
if (first_block->mLocation + first_block->mLength == second_block->mLocation)
{
- llinfos << "Potential merge at " << first_block->mLocation << llendl;
+ LL_INFOS() << "Potential merge at " << first_block->mLocation << LL_ENDL;
}
first_block = second_block;
}
@@ -2064,10 +2064,10 @@ void LLVFS::listFiles()
{
LLUUID id = file_spec.mFileID;
std::string extension = get_extension(file_spec.mFileType);
- llinfos << " File: " << id
+ LL_INFOS() << " File: " << id
<< " Type: " << LLAssetType::getDesc(file_spec.mFileType)
<< " Size: " << size
- << llendl;
+ << LL_ENDL;
}
}
@@ -2098,7 +2098,7 @@ void LLVFS::dumpFiles()
std::string extension = get_extension(type);
std::string filename = id.asString() + extension;
- llinfos << " Writing " << filename << llendl;
+ LL_INFOS() << " Writing " << filename << LL_ENDL;
LLAPRFile outfile;
outfile.open(filename, LL_APR_WB);
@@ -2111,7 +2111,7 @@ void LLVFS::dumpFiles()
unlockData();
- llinfos << "Extracted " << files_extracted << " files out of " << mFileBlocks.size() << llendl;
+ LL_INFOS() << "Extracted " << files_extracted << " files out of " << mFileBlocks.size() << LL_ENDL;
}
//============================================================================
diff --git a/indra/llvfs/llvfs.h b/indra/llvfs/llvfs.h
index 63f0f28933..39f31a221b 100755
--- a/indra/llvfs/llvfs.h
+++ b/indra/llvfs/llvfs.h
@@ -29,7 +29,6 @@
#include <deque>
#include "lluuid.h"
-#include "linked_lists.h"
#include "llassettype.h"
#include "llthread.h"
diff --git a/indra/llvfs/llvfsthread.cpp b/indra/llvfs/llvfsthread.cpp
index a57e2b15ab..8cd85929e2 100755
--- a/indra/llvfs/llvfsthread.cpp
+++ b/indra/llvfs/llvfsthread.cpp
@@ -88,7 +88,7 @@ LLVFSThread::handle_t LLVFSThread::read(LLVFS* vfs, const LLUUID &file_id, const
bool res = addRequest(req);
if (!res)
{
- llerrs << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << llendl;
+ LL_ERRS() << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << LL_ENDL;
req->deleteRequest();
handle = nullHandle();
}
@@ -107,7 +107,7 @@ S32 LLVFSThread::readImmediate(LLVFS* vfs, const LLUUID &file_id, const LLAssetT
S32 res = addRequest(req) ? 1 : 0;
if (res == 0)
{
- llerrs << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << llendl;
+ LL_ERRS() << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << LL_ENDL;
req->deleteRequest();
}
else
@@ -130,7 +130,7 @@ LLVFSThread::handle_t LLVFSThread::write(LLVFS* vfs, const LLUUID &file_id, cons
bool res = addRequest(req);
if (!res)
{
- llerrs << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << llendl;
+ LL_ERRS() << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << LL_ENDL;
req->deleteRequest();
handle = nullHandle();
}
@@ -149,7 +149,7 @@ S32 LLVFSThread::writeImmediate(LLVFS* vfs, const LLUUID &file_id, const LLAsset
S32 res = addRequest(req) ? 1 : 0;
if (res == 0)
{
- llerrs << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << llendl;
+ LL_ERRS() << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << LL_ENDL;
req->deleteRequest();
}
else
@@ -175,7 +175,7 @@ S32 LLVFSThread::writeImmediate(LLVFS* vfs, const LLUUID &file_id, const LLAsset
// bool res = addRequest(req);
// if (!res)
// {
-// llerrs << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << llendl;
+// LL_ERRS() << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << LL_ENDL;
// req->deleteRequest();
// handle = nullHandle();
// }
@@ -203,17 +203,17 @@ LLVFSThread::Request::Request(handle_t handle, U32 priority, U32 flags,
if (numbytes <= 0 && mOperation != FILE_RENAME)
{
- llwarns << "LLVFSThread: Request with numbytes = " << numbytes
+ LL_WARNS() << "LLVFSThread: Request with numbytes = " << numbytes
<< " operation = " << op
<< " offset " << offset
- << " file_type " << file_type << llendl;
+ << " file_type " << file_type << LL_ENDL;
}
if (mOperation == FILE_WRITE)
{
S32 blocksize = mVFS->getMaxSize(mFileID, mFileType);
if (blocksize < 0)
{
- llwarns << "VFS write to temporary block (shouldn't happen)" << llendl;
+ LL_WARNS() << "VFS write to temporary block (shouldn't happen)" << LL_ENDL;
}
mVFS->incLock(mFileID, mFileType, VFSLOCK_APPEND);
}
@@ -248,7 +248,7 @@ void LLVFSThread::Request::deleteRequest()
{
if (getStatus() == STATUS_QUEUED)
{
- llerrs << "Attempt to delete a queued LLVFSThread::Request!" << llendl;
+ LL_ERRS() << "Attempt to delete a queued LLVFSThread::Request!" << LL_ENDL;
}
if (mOperation == FILE_WRITE)
{
@@ -273,13 +273,13 @@ bool LLVFSThread::Request::processRequest()
llassert(mOffset >= 0);
mBytesRead = mVFS->getData(mFileID, mFileType, mBuffer, mOffset, mBytes);
complete = true;
- //llinfos << llformat("LLVFSThread::READ '%s': %d bytes arg:%d",getFilename(),mBytesRead) << llendl;
+ //LL_INFOS() << llformat("LLVFSThread::READ '%s': %d bytes arg:%d",getFilename(),mBytesRead) << LL_ENDL;
}
else if (mOperation == FILE_WRITE)
{
mBytesRead = mVFS->storeData(mFileID, mFileType, mBuffer, mOffset, mBytes);
complete = true;
- //llinfos << llformat("LLVFSThread::WRITE '%s': %d bytes arg:%d",getFilename(),mBytesRead) << llendl;
+ //LL_INFOS() << llformat("LLVFSThread::WRITE '%s': %d bytes arg:%d",getFilename(),mBytesRead) << LL_ENDL;
}
else if (mOperation == FILE_RENAME)
{
@@ -288,11 +288,11 @@ bool LLVFSThread::Request::processRequest()
mVFS->renameFile(mFileID, mFileType, *new_idp, new_type);
mFileID = *new_idp;
complete = true;
- //llinfos << llformat("LLVFSThread::RENAME '%s': %d bytes arg:%d",getFilename(),mBytesRead) << llendl;
+ //LL_INFOS() << llformat("LLVFSThread::RENAME '%s': %d bytes arg:%d",getFilename(),mBytesRead) << LL_ENDL;
}
else
{
- llerrs << llformat("LLVFSThread::unknown operation: %d", mOperation) << llendl;
+ LL_ERRS() << llformat("LLVFSThread::unknown operation: %d", mOperation) << LL_ENDL;
}
return complete;
}
diff --git a/indra/llvfs/tests/lldiriterator_test.cpp b/indra/llvfs/tests/lldiriterator_test.cpp
index 505d86faa7..a65e3dada5 100755
--- a/indra/llvfs/tests/lldiriterator_test.cpp
+++ b/indra/llvfs/tests/lldiriterator_test.cpp
@@ -51,9 +51,9 @@ namespace tut
void test_chop_662(void)
{
// Check a selection of bad group names from the crash reports
- LLDirIterator iter(".","+bad-group-name]+??-??.*");
- LLDirIterator iter1(".","))--@---bad-group-name2((??-??.*\\.txt");
- LLDirIterator iter2(".","__^v--x)Cuide d sua vida(x--v^__??-??.*");
+ LLDirIterator iter(".","+bad-group-name]+?\?-??.*");
+ LLDirIterator iter1(".","))--@---bad-group-name2((?\?-??.*\\.txt");
+ LLDirIterator iter2(".","__^v--x)Cuide d sua vida(x--v^__?\?-??.*");
}
template<> template<>
diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt
index aec6d7af4a..0743fd899f 100755
--- a/indra/llwindow/CMakeLists.txt
+++ b/indra/llwindow/CMakeLists.txt
@@ -38,6 +38,7 @@ include_directories(SYSTEM
)
set(llwindow_SOURCE_FILES
+ llcursortypes.cpp
llkeyboard.cpp
llkeyboardheadless.cpp
llwindowheadless.cpp
@@ -48,6 +49,7 @@ set(llwindow_SOURCE_FILES
set(llwindow_HEADER_FILES
CMakeLists.txt
+ llcursortypes.h
llkeyboard.h
llkeyboardheadless.h
llwindowheadless.h
diff --git a/indra/llcommon/llcursortypes.cpp b/indra/llwindow/llcursortypes.cpp
index ec60097195..ec60097195 100755
--- a/indra/llcommon/llcursortypes.cpp
+++ b/indra/llwindow/llcursortypes.cpp
diff --git a/indra/llcommon/llcursortypes.h b/indra/llwindow/llcursortypes.h
index cb6d6636a0..cb6d6636a0 100755
--- a/indra/llcommon/llcursortypes.h
+++ b/indra/llwindow/llcursortypes.h
diff --git a/indra/llwindow/lldragdropwin32.cpp b/indra/llwindow/lldragdropwin32.cpp
index 15acddd987..d00d9ab47e 100755
--- a/indra/llwindow/lldragdropwin32.cpp
+++ b/indra/llwindow/lldragdropwin32.cpp
@@ -242,11 +242,11 @@ class LLDragDropWin32Target:
LLCoordWindow cursor_coord_window( pt_client.x, pt_client.y );
LLCoordGL gl_coord(cursor_coord_window.convert());
- llinfos << "### (Drop) URL is: " << mDropUrl << llendl;
- llinfos << "### raw coords are: " << pt.x << " x " << pt.y << llendl;
- llinfos << "### client coords are: " << pt_client.x << " x " << pt_client.y << llendl;
- llinfos << "### GL coords are: " << gl_coord.mX << " x " << gl_coord.mY << llendl;
- llinfos << llendl;
+ LL_INFOS() << "### (Drop) URL is: " << mDropUrl << LL_ENDL;
+ LL_INFOS() << "### raw coords are: " << pt.x << " x " << pt.y << LL_ENDL;
+ LL_INFOS() << "### client coords are: " << pt_client.x << " x " << pt_client.y << LL_ENDL;
+ LL_INFOS() << "### GL coords are: " << gl_coord.mX << " x " << gl_coord.mY << LL_ENDL;
+ LL_INFOS() << LL_ENDL;
// no keyboard modifier option yet but we could one day
MASK mask = gKeyboard->currentMask( TRUE );
diff --git a/indra/llwindow/lldragdropwin32.h b/indra/llwindow/lldragdropwin32.h
index a6824f3e90..4673242cba 100755
--- a/indra/llwindow/lldragdropwin32.h
+++ b/indra/llwindow/lldragdropwin32.h
@@ -31,7 +31,7 @@
#ifndef LL_LLDRAGDROP32_H
#define LL_LLDRAGDROP32_H
-#include <windows.h>
+#include "llwin32headerslean.h"
#include <ole2.h>
class LLDragDropWin32
@@ -54,7 +54,7 @@ class LLDragDropWin32
#ifndef LL_LLDRAGDROP32_H
#define LL_LLDRAGDROP32_H
-#include <windows.h>
+#include "llwin32headerslean.h"
#include <ole2.h>
// impostor class that does nothing
diff --git a/indra/llwindow/lldxhardware.cpp b/indra/llwindow/lldxhardware.cpp
index b0f4bc5503..e7afef63f8 100755
--- a/indra/llwindow/lldxhardware.cpp
+++ b/indra/llwindow/lldxhardware.cpp
@@ -34,9 +34,12 @@
#include <dxdiag.h>
#undef INITGUID
+#include <wbemidl.h>
+
#include <boost/tokenizer.hpp>
#include "lldxhardware.h"
+
#include "llerror.h"
#include "llstring.h"
@@ -53,11 +56,160 @@ LLDXHardware gDXHardware;
#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } }
#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } }
-std::string get_string(IDxDiagContainer *containerp, WCHAR *wszPropName)
+typedef BOOL ( WINAPI* PfnCoSetProxyBlanket )( IUnknown* pProxy, DWORD dwAuthnSvc, DWORD dwAuthzSvc,
+ OLECHAR* pServerPrincName, DWORD dwAuthnLevel, DWORD dwImpLevel,
+ RPC_AUTH_IDENTITY_HANDLE pAuthInfo, DWORD dwCapabilities );
+
+HRESULT GetVideoMemoryViaWMI( WCHAR* strInputDeviceID, DWORD* pdwAdapterRam )
{
HRESULT hr;
+ bool bGotMemory = false;
+ HRESULT hrCoInitialize = S_OK;
+ IWbemLocator* pIWbemLocator = nullptr;
+ IWbemServices* pIWbemServices = nullptr;
+ BSTR pNamespace = nullptr;
+
+ *pdwAdapterRam = 0;
+ hrCoInitialize = CoInitialize( 0 );
+
+ hr = CoCreateInstance( CLSID_WbemLocator,
+ nullptr,
+ CLSCTX_INPROC_SERVER,
+ IID_IWbemLocator,
+ ( LPVOID* )&pIWbemLocator );
+#ifdef PRINTF_DEBUGGING
+ if( FAILED( hr ) ) wprintf( L"WMI: CoCreateInstance failed: 0x%0.8x\n", hr );
+#endif
+
+ if( SUCCEEDED( hr ) && pIWbemLocator )
+ {
+ // Using the locator, connect to WMI in the given namespace.
+ pNamespace = SysAllocString( L"\\\\.\\root\\cimv2" );
+
+ hr = pIWbemLocator->ConnectServer( pNamespace, nullptr, nullptr, 0L,
+ 0L, nullptr, nullptr, &pIWbemServices );
+#ifdef PRINTF_DEBUGGING
+ if( FAILED( hr ) ) wprintf( L"WMI: pIWbemLocator->ConnectServer failed: 0x%0.8x\n", hr );
+#endif
+ if( SUCCEEDED( hr ) && pIWbemServices != 0 )
+ {
+ HINSTANCE hinstOle32 = nullptr;
+
+ hinstOle32 = LoadLibraryW( L"ole32.dll" );
+ if( hinstOle32 )
+ {
+ PfnCoSetProxyBlanket pfnCoSetProxyBlanket = nullptr;
+
+ pfnCoSetProxyBlanket = ( PfnCoSetProxyBlanket )GetProcAddress( hinstOle32, "CoSetProxyBlanket" );
+ if( pfnCoSetProxyBlanket != 0 )
+ {
+ // Switch security level to IMPERSONATE.
+ pfnCoSetProxyBlanket( pIWbemServices, RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, nullptr,
+ RPC_C_AUTHN_LEVEL_CALL, RPC_C_IMP_LEVEL_IMPERSONATE, nullptr, 0 );
+ }
+
+ FreeLibrary( hinstOle32 );
+ }
+
+ IEnumWbemClassObject* pEnumVideoControllers = nullptr;
+ BSTR pClassName = nullptr;
+
+ pClassName = SysAllocString( L"Win32_VideoController" );
+
+ hr = pIWbemServices->CreateInstanceEnum( pClassName, 0,
+ nullptr, &pEnumVideoControllers );
+#ifdef PRINTF_DEBUGGING
+ if( FAILED( hr ) ) wprintf( L"WMI: pIWbemServices->CreateInstanceEnum failed: 0x%0.8x\n", hr );
+#endif
+
+ if( SUCCEEDED( hr ) && pEnumVideoControllers )
+ {
+ IWbemClassObject* pVideoControllers[10] = {0};
+ DWORD uReturned = 0;
+ BSTR pPropName = nullptr;
+
+ // Get the first one in the list
+ pEnumVideoControllers->Reset();
+ hr = pEnumVideoControllers->Next( 5000, // timeout in 5 seconds
+ 10, // return the first 10
+ pVideoControllers,
+ &uReturned );
+#ifdef PRINTF_DEBUGGING
+ if( FAILED( hr ) ) wprintf( L"WMI: pEnumVideoControllers->Next failed: 0x%0.8x\n", hr );
+ if( uReturned == 0 ) wprintf( L"WMI: pEnumVideoControllers uReturned == 0\n" );
+#endif
+
+ VARIANT var;
+ if( SUCCEEDED( hr ) )
+ {
+ bool bFound = false;
+ for( UINT iController = 0; iController < uReturned; iController++ )
+ {
+ if ( !pVideoControllers[iController] )
+ continue;
+
+ pPropName = SysAllocString( L"PNPDeviceID" );
+ hr = pVideoControllers[iController]->Get( pPropName, 0L, &var, nullptr, nullptr );
+#ifdef PRINTF_DEBUGGING
+ if( FAILED( hr ) )
+ wprintf( L"WMI: pVideoControllers[iController]->Get PNPDeviceID failed: 0x%0.8x\n", hr );
+#endif
+ if( SUCCEEDED( hr ) )
+ {
+ if( wcsstr( var.bstrVal, strInputDeviceID ) != 0 )
+ bFound = true;
+ }
+ VariantClear( &var );
+ if( pPropName ) SysFreeString( pPropName );
+
+ if( bFound )
+ {
+ pPropName = SysAllocString( L"AdapterRAM" );
+ hr = pVideoControllers[iController]->Get( pPropName, 0L, &var, nullptr, nullptr );
+#ifdef PRINTF_DEBUGGING
+ if( FAILED( hr ) )
+ wprintf( L"WMI: pVideoControllers[iController]->Get AdapterRAM failed: 0x%0.8x\n",
+ hr );
+#endif
+ if( SUCCEEDED( hr ) )
+ {
+ bGotMemory = true;
+ *pdwAdapterRam = var.ulVal;
+ }
+ VariantClear( &var );
+ if( pPropName ) SysFreeString( pPropName );
+ break;
+ }
+ SAFE_RELEASE( pVideoControllers[iController] );
+ }
+ }
+ }
+
+ if( pClassName )
+ SysFreeString( pClassName );
+ SAFE_RELEASE( pEnumVideoControllers );
+ }
+
+ if( pNamespace )
+ SysFreeString( pNamespace );
+ SAFE_RELEASE( pIWbemServices );
+ }
+
+ SAFE_RELEASE( pIWbemLocator );
+
+ if( SUCCEEDED( hrCoInitialize ) )
+ CoUninitialize();
+
+ if( bGotMemory )
+ return S_OK;
+ else
+ return E_FAIL;
+}
+
+void get_wstring(IDxDiagContainer* containerp, WCHAR* wszPropName, WCHAR* wszPropValue, int outputSize)
+{
+ HRESULT hr;
VARIANT var;
- WCHAR wszPropValue[256];
VariantInit( &var );
hr = containerp->GetProp(wszPropName, &var );
@@ -76,13 +228,19 @@ std::string get_string(IDxDiagContainer *containerp, WCHAR *wszPropName)
wcscpy( wszPropValue, (var.boolVal) ? L"true" : L"false" ); /* Flawfinder: ignore */
break;
case VT_BSTR:
- wcsncpy( wszPropValue, var.bstrVal, 255 ); /* Flawfinder: ignore */
- wszPropValue[255] = 0;
+ wcsncpy( wszPropValue, var.bstrVal, outputSize-1 ); /* Flawfinder: ignore */
+ wszPropValue[outputSize-1] = 0;
break;
}
}
// Clear the variant (this is needed to free BSTR memory)
VariantClear( &var );
+}
+
+std::string get_string(IDxDiagContainer *containerp, WCHAR *wszPropName)
+{
+ WCHAR wszPropValue[256];
+ get_wstring(containerp, wszPropName, wszPropValue, 256);
return utf16str_to_utf8str(wszPropValue);
}
@@ -120,7 +278,7 @@ BOOL LLVersion::set(const std::string &version_string)
}
if (count < 4)
{
- //llwarns << "Potentially bogus version string!" << version_string << llendl;
+ //LL_WARNS() << "Potentially bogus version string!" << version_string << LL_ENDL;
for (i = 0; i < 4; i++)
{
mFields[i] = 0;
@@ -160,10 +318,10 @@ std::string LLDXDriverFile::dump()
gWriteDebug(mDateString.c_str());
gWriteDebug("\n");
}
- llinfos << mFilepath << llendl;
- llinfos << mName << llendl;
- llinfos << mVersionString << llendl;
- llinfos << mDateString << llendl;
+ LL_INFOS() << mFilepath << LL_ENDL;
+ LL_INFOS() << mName << LL_ENDL;
+ LL_INFOS() << mVersionString << LL_ENDL;
+ LL_INFOS() << mDateString << LL_ENDL;
return "";
}
@@ -186,11 +344,11 @@ std::string LLDXDevice::dump()
gWriteDebug(mPCIString.c_str());
gWriteDebug("\n");
}
- llinfos << llendl;
- llinfos << "DeviceName:" << mName << llendl;
- llinfos << "PCIString:" << mPCIString << llendl;
- llinfos << "Drivers" << llendl;
- llinfos << "-------" << llendl;
+ LL_INFOS() << LL_ENDL;
+ LL_INFOS() << "DeviceName:" << mName << LL_ENDL;
+ LL_INFOS() << "PCIString:" << mPCIString << LL_ENDL;
+ LL_INFOS() << "Drivers" << LL_ENDL;
+ LL_INFOS() << "-------" << LL_ENDL;
for (driver_file_map_t::iterator iter = mDriverFiles.begin(),
end = mDriverFiles.end();
iter != end; iter++)
@@ -361,8 +519,18 @@ BOOL LLDXHardware::getInfo(BOOL vram_only)
goto LCleanup;
}
- // Get the English VRAM string
+ DWORD vram = 0;
+
+ WCHAR deviceID[512];
+
+ get_wstring(device_containerp, L"szDeviceID", deviceID, 512);
+
+ if (SUCCEEDED(GetVideoMemoryViaWMI(deviceID, &vram)))
{
+ mVRAM = vram/(1024*1024);
+ }
+ else
+ { // Get the English VRAM string
std::string ram_str = get_string(device_containerp, L"szDisplayMemoryEnglish");
// We don't need the device any more
@@ -551,7 +719,7 @@ LLSD LLDXHardware::getDisplayInfo()
IDxDiagContainer *driver_containerp = NULL;
// CoCreate a IDxDiagProvider*
- llinfos << "CoCreateInstance IID_IDxDiagProvider" << llendl;
+ LL_INFOS() << "CoCreateInstance IID_IDxDiagProvider" << LL_ENDL;
hr = CoCreateInstance(CLSID_DxDiagProvider,
NULL,
CLSCTX_INPROC_SERVER,
@@ -560,7 +728,7 @@ LLSD LLDXHardware::getDisplayInfo()
if (FAILED(hr))
{
- llwarns << "No DXDiag provider found! DirectX 9 not installed!" << llendl;
+ LL_WARNS() << "No DXDiag provider found! DirectX 9 not installed!" << LL_ENDL;
gWriteDebug("No DXDiag provider found! DirectX 9 not installed!\n");
goto LCleanup;
}
@@ -578,14 +746,14 @@ LLSD LLDXHardware::getDisplayInfo()
dx_diag_init_params.bAllowWHQLChecks = TRUE;
dx_diag_init_params.pReserved = NULL;
- llinfos << "dx_diag_providerp->Initialize" << llendl;
+ LL_INFOS() << "dx_diag_providerp->Initialize" << LL_ENDL;
hr = dx_diag_providerp->Initialize(&dx_diag_init_params);
if(FAILED(hr))
{
goto LCleanup;
}
- llinfos << "dx_diag_providerp->GetRootContainer" << llendl;
+ LL_INFOS() << "dx_diag_providerp->GetRootContainer" << LL_ENDL;
hr = dx_diag_providerp->GetRootContainer( &dx_diag_rootp );
if(FAILED(hr) || !dx_diag_rootp)
{
@@ -595,7 +763,7 @@ LLSD LLDXHardware::getDisplayInfo()
HRESULT hr;
// Get display driver information
- llinfos << "dx_diag_rootp->GetChildContainer" << llendl;
+ LL_INFOS() << "dx_diag_rootp->GetChildContainer" << LL_ENDL;
hr = dx_diag_rootp->GetChildContainer(L"DxDiag_DisplayDevices", &devices_containerp);
if(FAILED(hr) || !devices_containerp)
{
@@ -603,7 +771,7 @@ LLSD LLDXHardware::getDisplayInfo()
}
// Get device 0
- llinfos << "devices_containerp->GetChildContainer" << llendl;
+ LL_INFOS() << "devices_containerp->GetChildContainer" << LL_ENDL;
hr = devices_containerp->GetChildContainer(L"0", &device_containerp);
if(FAILED(hr) || !device_containerp)
{
diff --git a/indra/llwindow/llkeyboard.cpp b/indra/llwindow/llkeyboard.cpp
index 8b356ba138..f6f6c3931c 100755
--- a/indra/llwindow/llkeyboard.cpp
+++ b/indra/llwindow/llkeyboard.cpp
@@ -187,7 +187,7 @@ BOOL LLKeyboard::translateKey(const U16 os_key, KEY *out_key)
iter = mTranslateKeyMap.find(os_key);
if (iter == mTranslateKeyMap.end())
{
- //llwarns << "Unknown virtual key " << os_key << llendl;
+ //LL_WARNS() << "Unknown virtual key " << os_key << LL_ENDL;
*out_key = 0;
return FALSE;
}
@@ -258,7 +258,7 @@ BOOL LLKeyboard::handleTranslatedKeyUp(KEY translated_key, U32 translated_mask)
handled = mCallbacks->handleTranslatedKeyUp(translated_key, translated_mask);
}
- lldebugst(LLERR_USER_INPUT) << "keyup -" << translated_key << "-" << llendl;
+ LL_DEBUGS("UserInput") << "keyup -" << translated_key << "-" << LL_ENDL;
return handled;
}
@@ -321,7 +321,7 @@ BOOL LLKeyboard::keyFromString(const std::string& str, KEY *key)
*key = res;
return TRUE;
}
- llwarns << "keyFromString failed: " << str << llendl;
+ LL_WARNS() << "keyFromString failed: " << str << LL_ENDL;
return FALSE;
}
@@ -363,7 +363,7 @@ std::string LLKeyboard::stringFromAccelerator( MASK accel_mask, KEY key )
if( trans == NULL )
{
- llerrs << "No mKeyStringTranslator" << llendl;
+ LL_ERRS() << "No mKeyStringTranslator" << LL_ENDL;
return res;
}
diff --git a/indra/llwindow/llkeyboard.h b/indra/llwindow/llkeyboard.h
index 92449c123f..6f2dc87317 100755
--- a/indra/llwindow/llkeyboard.h
+++ b/indra/llwindow/llkeyboard.h
@@ -28,8 +28,9 @@
#define LL_LLKEYBOARD_H
#include <map>
+#include <boost/function.hpp>
-#include "string_table.h"
+#include "llstringtable.h"
#include "lltimer.h"
#include "indra_constants.h"
diff --git a/indra/llwindow/llkeyboardwin32.cpp b/indra/llwindow/llkeyboardwin32.cpp
index be3fe5deb0..dc40dcdde0 100755
--- a/indra/llwindow/llkeyboardwin32.cpp
+++ b/indra/llwindow/llkeyboardwin32.cpp
@@ -28,10 +28,7 @@
#include "linden_common.h"
-#define WIN32_LEAN_AND_MEAN
-#include <winsock2.h>
-#include <windows.h>
-
+#include "llwin32headerslean.h"
#include "llkeyboardwin32.h"
#include "llwindowcallbacks.h"
@@ -269,7 +266,7 @@ void LLKeyboardWin32::scanKeyboard()
// keydown in highest bit
if (!pending_key_events && !(GetAsyncKeyState(virtual_key) & 0x8000))
{
- //llinfos << "Key up event missed, resetting" << llendl;
+ //LL_INFOS() << "Key up event missed, resetting" << LL_ENDL;
mKeyLevel[key] = FALSE;
}
}
diff --git a/indra/llwindow/llmousehandler.cpp b/indra/llwindow/llmousehandler.cpp
index 8695e92f77..bea66e763c 100755
--- a/indra/llwindow/llmousehandler.cpp
+++ b/indra/llwindow/llmousehandler.cpp
@@ -39,7 +39,7 @@ BOOL LLMouseHandler::handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType cli
case CLICK_MIDDLE: handled = handleMiddleMouseDown(x, y, mask); break;
case CLICK_DOUBLELEFT: handled = handleDoubleClick(x, y, mask); break;
default:
- llwarns << "Unhandled enum." << llendl;
+ LL_WARNS() << "Unhandled enum." << LL_ENDL;
}
}
else
@@ -51,7 +51,7 @@ BOOL LLMouseHandler::handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType cli
case CLICK_MIDDLE: handled = handleMiddleMouseUp(x, y, mask); break;
case CLICK_DOUBLELEFT: handled = handleDoubleClick(x, y, mask); break;
default:
- llwarns << "Unhandled enum." << llendl;
+ LL_WARNS() << "Unhandled enum." << LL_ENDL;
}
}
return handled;
diff --git a/indra/llwindow/llopenglview-objc.h b/indra/llwindow/llopenglview-objc.h
index 1e0e47cd02..072d40f739 100644
--- a/indra/llwindow/llopenglview-objc.h
+++ b/indra/llwindow/llopenglview-objc.h
@@ -42,6 +42,7 @@
unsigned int mMarkedTextLength;
bool mMarkedTextAllowed;
bool mSimulatedRightClick;
+ bool mOldResize;
}
- (id) initWithSamples:(NSUInteger)samples;
- (id) initWithSamples:(NSUInteger)samples andVsync:(BOOL)vsync;
@@ -49,6 +50,8 @@
- (void)commitCurrentPreedit;
+- (void) setOldResize:(bool)oldresize;
+
// rebuildContext
// Destroys and recreates a context with the view's internal format set via setPixelFormat;
// Use this in event of needing to rebuild a context for whatever reason, without needing to assign a new pixel format.
@@ -76,6 +79,7 @@
@interface LLNonInlineTextView : NSTextView
{
LLOpenGLView *glview;
+ unichar mKeyPressed;
}
- (void) setGLView:(LLOpenGLView*)view;
diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm
index 9155e59a1d..ff312945b6 100644
--- a/indra/llwindow/llopenglview-objc.mm
+++ b/indra/llwindow/llopenglview-objc.mm
@@ -94,8 +94,11 @@ attributedStringInfo getSegments(NSAttributedString *str)
// Force a high quality update after live resizing
- (void) viewDidEndLiveResize
{
- NSSize size = [self frame].size;
- callResize(size.width, size.height);
+ if (mOldResize) //Maint-3135
+ {
+ NSSize size = [self frame].size;
+ callResize(size.width, size.height);
+ }
}
- (unsigned long)getVramSize
@@ -124,10 +127,18 @@ attributedStringInfo getSegments(NSAttributedString *str)
object:[self window]];
}
+- (void)setOldResize:(bool)oldresize
+{
+ mOldResize = oldresize;
+}
+
- (void)windowResized:(NSNotification *)notification;
{
- //NSSize size = [self frame].size;
- //callResize(size.width, size.height);
+ if (!mOldResize) //Maint-3288
+ {
+ NSSize size = [self frame].size;
+ callResize(size.width, size.height);
+ }
}
- (void)dealloc
@@ -204,6 +215,8 @@ attributedStringInfo getSegments(NSAttributedString *str)
[glContext setValues:(const GLint*)0 forParameter:NSOpenGLCPSwapInterval];
}
+ mOldResize = false;
+
return self;
}
@@ -257,14 +270,14 @@ attributedStringInfo getSegments(NSAttributedString *str)
!([theEvent modifierFlags] & NSFunctionKeyMask) &&
!([theEvent modifierFlags] & NSHelpKeyMask))
{
- callRightMouseDown(mMousePos, mModifiers);
+ callRightMouseDown(mMousePos, [theEvent modifierFlags]);
mSimulatedRightClick = true;
} else {
if ([theEvent clickCount] >= 2)
{
- callDoubleClick(mMousePos, mModifiers);
+ callDoubleClick(mMousePos, [theEvent modifierFlags]);
} else if ([theEvent clickCount] == 1) {
- callLeftMouseDown(mMousePos, mModifiers);
+ callLeftMouseDown(mMousePos, [theEvent modifierFlags]);
}
}
}
@@ -273,21 +286,21 @@ attributedStringInfo getSegments(NSAttributedString *str)
{
if (mSimulatedRightClick)
{
- callRightMouseUp(mMousePos, mModifiers);
+ callRightMouseUp(mMousePos, [theEvent modifierFlags]);
mSimulatedRightClick = false;
} else {
- callLeftMouseUp(mMousePos, mModifiers);
+ callLeftMouseUp(mMousePos, [theEvent modifierFlags]);
}
}
- (void) rightMouseDown:(NSEvent *)theEvent
{
- callRightMouseDown(mMousePos, mModifiers);
+ callRightMouseDown(mMousePos, [theEvent modifierFlags]);
}
- (void) rightMouseUp:(NSEvent *)theEvent
{
- callRightMouseUp(mMousePos, mModifiers);
+ callRightMouseUp(mMousePos, [theEvent modifierFlags]);
}
- (void)mouseMoved:(NSEvent *)theEvent
@@ -328,12 +341,12 @@ attributedStringInfo getSegments(NSAttributedString *str)
- (void) otherMouseDown:(NSEvent *)theEvent
{
- callMiddleMouseDown(mMousePos, mModifiers);
+ callMiddleMouseDown(mMousePos, [theEvent modifierFlags]);
}
- (void) otherMouseUp:(NSEvent *)theEvent
{
- callMiddleMouseUp(mMousePos, mModifiers);
+ callMiddleMouseUp(mMousePos, [theEvent modifierFlags]);
}
- (void) otherMouseDragged:(NSEvent *)theEvent
@@ -353,22 +366,27 @@ attributedStringInfo getSegments(NSAttributedString *str)
- (void) keyUp:(NSEvent *)theEvent
{
- callKeyUp([theEvent keyCode], mModifiers);
+ callKeyUp([theEvent keyCode], [theEvent modifierFlags]);
}
- (void) keyDown:(NSEvent *)theEvent
{
uint keycode = [theEvent keyCode];
+ // We must not depend on flagsChange event to detect modifier flags changed,
+ // must depend on the modifire flags in the event parameter.
+ // Because flagsChange event handler misses event when other window is activated,
+ // e.g. OS Window for upload something or Input Window...
+ // mModifiers instance variable is for insertText: or insertText:replacementRange: (by Pell Smit)
+ mModifiers = [theEvent modifierFlags];
bool acceptsText = mHasMarkedText ? false : callKeyDown(keycode, mModifiers);
+ unichar ch;
if (acceptsText &&
!mMarkedTextAllowed &&
+ !(mModifiers & (NSControlKeyMask | NSCommandKeyMask)) && // commands don't invoke InputWindow
![(LLAppDelegate*)[NSApp delegate] romanScript] &&
- [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSDeleteCharacter &&
- [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSBackspaceCharacter &&
- [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSDownArrowFunctionKey &&
- [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSUpArrowFunctionKey &&
- [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSLeftArrowFunctionKey &&
- [[theEvent charactersIgnoringModifiers] characterAtIndex:0] != NSRightArrowFunctionKey)
+ (ch = [[theEvent charactersIgnoringModifiers] characterAtIndex:0]) > ' ' &&
+ ch != NSDeleteCharacter &&
+ (ch < 0xF700 || ch > 0xF8FF)) // 0xF700-0xF8FF: reserved for function keys on the keyboard(from NSEvent.h)
{
[(LLAppDelegate*)[NSApp delegate] showInputWindow:true withEvent:theEvent];
} else
@@ -385,9 +403,35 @@ attributedStringInfo getSegments(NSAttributedString *str)
}
}
-- (void)flagsChanged:(NSEvent *)theEvent {
+- (void)flagsChanged:(NSEvent *)theEvent
+{
mModifiers = [theEvent modifierFlags];
callModifier([theEvent modifierFlags]);
+
+ NSInteger mask = 0;
+ switch([theEvent keyCode])
+ {
+ case 56:
+ mask = NSShiftKeyMask;
+ break;
+ case 58:
+ mask = NSAlternateKeyMask;
+ break;
+ case 59:
+ mask = NSControlKeyMask;
+ break;
+ default:
+ return;
+ }
+
+ if (mModifiers & mask)
+ {
+ callKeyDown([theEvent keyCode], 0);
+ }
+ else
+ {
+ callKeyUp([theEvent keyCode], 0);
+ }
}
- (BOOL) acceptsFirstResponder
@@ -459,31 +503,58 @@ attributedStringInfo getSegments(NSAttributedString *str)
- (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange
{
- if ([aString class] == NSClassFromString(@"NSConcreteMutableAttributedString"))
+ // Apple says aString can be either an NSString or NSAttributedString instance.
+ // But actually it's NSConcreteMutableAttributedString or __NSCFConstantString.
+ // I observed aString was __NSCFConstantString only aString was null string(zero length).
+ // Apple also says when aString is an NSString object,
+ // the receiver is expected to render the marked text with distinguishing appearance.
+ // So I tried to make attributedStringInfo, but it won't be used... (Pell Smit)
+
+ if (mMarkedTextAllowed)
{
- if (mMarkedTextAllowed)
+ unsigned int selected[2] = {
+ selectedRange.location,
+ selectedRange.length
+ };
+
+ unsigned int replacement[2] = {
+ replacementRange.location,
+ replacementRange.length
+ };
+
+ int string_length = [aString length];
+ unichar text[string_length];
+ attributedStringInfo segments;
+ // I used 'respondsToSelector:@selector(string)'
+ // to judge aString is an attributed string or not.
+ if ([aString respondsToSelector:@selector(string)])
+ {
+ // aString is attibuted
+ [[aString string] getCharacters:text range:NSMakeRange(0, string_length)];
+ segments = getSegments((NSAttributedString *)aString);
+ }
+ else
+ {
+ // aString is not attributed
+ [aString getCharacters:text range:NSMakeRange(0, string_length)];
+ segments.seg_lengths.push_back(string_length);
+ segments.seg_standouts.push_back(true);
+ }
+ setMarkedText(text, selected, replacement, string_length, segments);
+ if (string_length > 0)
{
- unsigned int selected[2] = {
- selectedRange.location,
- selectedRange.length
- };
-
- unsigned int replacement[2] = {
- replacementRange.location,
- replacementRange.length
- };
-
- unichar text[[aString length]];
- [[aString mutableString] getCharacters:text range:NSMakeRange(0, [aString length])];
- attributedStringInfo segments = getSegments((NSAttributedString *)aString);
- setMarkedText(text, selected, replacement, [aString length], segments);
mHasMarkedText = TRUE;
- mMarkedTextLength = [aString length];
- } else {
- if (mHasMarkedText)
- {
- [self unmarkText];
- }
+ mMarkedTextLength = string_length;
+ }
+ else
+ {
+ // we must clear the marked text when aString is null.
+ [self unmarkText];
+ }
+ } else {
+ if (mHasMarkedText)
+ {
+ [self unmarkText];
}
}
}
@@ -602,37 +673,63 @@ attributedStringInfo getSegments(NSAttributedString *str)
@implementation LLNonInlineTextView
+/* Input Window is a legacy of 20 century, so we want to remove related classes.
+ But unfortunately, Viwer web browser has no support for modern inline input,
+ we need to leave these classes...
+ We will be back to get rid of Input Window after fixing viewer web browser.
+
+ How Input Window should work:
+ 1) Input Window must not be empty.
+ It must close when it become empty result of edithing.
+ 2) Input Window must not close when it still has input data.
+ It must keep open user types next char before commit. by Pell Smit
+*/
+
- (void) setGLView:(LLOpenGLView *)view
{
glview = view;
}
-- (void) insertText:(id)insertString
+- (void)keyDown:(NSEvent *)theEvent
{
- [[self inputContext] discardMarkedText];
- [self setString:@""];
- [_window orderOut:_window];
- [self insertText:insertString replacementRange:NSMakeRange(0, [insertString length])];
+ // mKeyPressed is used later to determine whethere Input Window should close or not
+ mKeyPressed = [[theEvent charactersIgnoringModifiers] characterAtIndex:0];
+ // setMarkedText and insertText is called indirectly from inside keyDown: method
+ [super keyDown:theEvent];
}
-- (void) insertText:(id)aString replacementRange:(NSRange)replacementRange
+// setMarkedText: is called for incomplete input(on the way to conversion).
+- (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange
{
- [glview insertText:aString replacementRange:replacementRange];
+ [super setMarkedText:aString selectedRange:selectedRange replacementRange:replacementRange];
+ if ([aString length] == 0) // this means Input Widow becomes empty
+ {
+ [_window orderOut:_window]; // Close this to avoid empty Input Window
+ }
}
-- (void) insertNewline:(id)sender
+// insertText: is called for inserting commited text.
+// There are two ways to be called here:
+// a) explicitly commited (must close)
+// In case of user typed commit key(usually return key) or delete key or something
+// b) automatically commited (must not close)
+// In case of user typed next letter after conversion
+- (void) insertText:(id)aString replacementRange:(NSRange)replacementRange
{
- [[self textStorage] setValue:@""];
- [[self inputContext] discardMarkedText];
+ [[self inputContext] discardMarkedText];
[self setString:@""];
-}
-
-- (void)doCommandBySelector:(SEL)aSelector
-{
- if (aSelector == @selector(insertNewline:))
- {
- [self insertNewline:self];
- }
+ [glview insertText:aString replacementRange:replacementRange];
+ if (mKeyPressed == NSEnterCharacter ||
+ mKeyPressed == NSBackspaceCharacter ||
+ mKeyPressed == NSTabCharacter ||
+ mKeyPressed == NSNewlineCharacter ||
+ mKeyPressed == NSCarriageReturnCharacter ||
+ mKeyPressed == NSDeleteCharacter ||
+ (mKeyPressed >= 0xF700 && mKeyPressed <= 0xF8FF))
+ {
+ // this is case a) of above comment
+ [_window orderOut:_window]; // to avoid empty Input Window
+ }
}
@end
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index 93b9d36939..5720660034 100755
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -39,7 +39,6 @@
#include "llerror.h"
#include "llkeyboard.h"
-#include "linked_lists.h"
#include "llwindowcallbacks.h"
@@ -72,8 +71,8 @@ S32 OSMessageBox(const std::string& text, const std::string& caption, U32 type)
}
S32 result = 0;
-#if LL_MESA_HEADLESS // !!! *FIX: (???)
- llwarns << "OSMessageBox: " << text << llendl;
+#if LL_MESA_HEADLESS // !!! *FIX: (?)
+ LL_WARNS() << "OSMessageBox: " << text << LL_ENDL;
return OSBTN_OK;
#elif LL_WINDOWS
result = OSMessageBoxWin32(text, caption, type);
@@ -324,7 +323,7 @@ bool LLSplashScreen::isVisible()
// static
LLSplashScreen *LLSplashScreen::create()
{
-#if LL_MESA_HEADLESS || LL_SDL // !!! *FIX: (???)
+#if LL_MESA_HEADLESS || LL_SDL // !!! *FIX: (?)
return 0;
#elif LL_WINDOWS
return new LLSplashScreenWin32;
@@ -423,7 +422,7 @@ LLWindow* LLWindowManager::createWindow(
if (FALSE == new_window->isValid())
{
delete new_window;
- llwarns << "LLWindowManager::create() : Error creating window." << llendl;
+ LL_WARNS() << "LLWindowManager::create() : Error creating window." << LL_ENDL;
return NULL;
}
sWindowList.insert(new_window);
@@ -434,8 +433,8 @@ BOOL LLWindowManager::destroyWindow(LLWindow* window)
{
if (sWindowList.find(window) == sWindowList.end())
{
- llerrs << "LLWindowManager::destroyWindow() : Window pointer not valid, this window doesn't exist!"
- << llendl;
+ LL_ERRS() << "LLWindowManager::destroyWindow() : Window pointer not valid, this window doesn't exist!"
+ << LL_ENDL;
return FALSE;
}
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index 78186004b8..0a30f4c807 100755
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -31,6 +31,7 @@
#include "llcoord.h"
#include "llstring.h"
#include "llcursortypes.h"
+#include "llinstancetracker.h"
#include "llsd.h"
class LLSplashScreen;
@@ -123,7 +124,7 @@ public:
virtual void swapBuffers() = 0;
virtual void bringToFront() = 0;
virtual void focusClient() { }; // this may not have meaning or be required on other platforms, therefore, it's not abstract
-
+ virtual void setOldResize(bool oldresize) { };
// handy coordinate space conversion routines
// NB: screen to window and vice verse won't work on width/height coordinate pairs,
// as the conversion must take into account left AND right border widths, etc.
diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h
index 81b25601a9..d64525fbdd 100755
--- a/indra/llwindow/llwindowmacosx-objc.h
+++ b/indra/llwindow/llwindowmacosx-objc.h
@@ -74,6 +74,7 @@ void showNSCursor();
void hideNSCursorTillMove(bool hide);
void requestUserAttention();
long showAlert(std::string title, std::string text, int type);
+void setResizeMode(bool oldresize, void* glview);
NSWindowRef createNSWindow(int x, int y, int width, int height);
diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm
index 0768d0352e..1a21bf8430 100755
--- a/indra/llwindow/llwindowmacosx-objc.mm
+++ b/indra/llwindow/llwindowmacosx-objc.mm
@@ -91,7 +91,7 @@ const unsigned short *copyFromPBoard()
NSArray *objToPaste = [pboard readObjectsForClasses:classArray options:[NSDictionary dictionary]];
str = [objToPaste objectAtIndex:0];
}
- unichar* temp = (unichar*)calloc([str length], sizeof(unichar));
+ unichar* temp = (unichar*)calloc([str length]+1, sizeof(unichar));
[str getCharacters:temp];
[pool release];
return temp;
@@ -222,6 +222,11 @@ GLViewRef createOpenGLView(NSWindowRef window, unsigned int samples, bool vsync)
return glview;
}
+void setResizeMode(bool oldresize, void* glview)
+{
+ [(LLOpenGLView *)glview setOldResize:oldresize];
+}
+
void glSwapBuffers(void* context)
{
[(NSOpenGLContext*)context flushBuffer];
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index 11c0b51086..75900c3cb4 100755
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -39,6 +39,7 @@
#include "indra_constants.h"
#include <OpenGL/OpenGL.h>
+#include <Carbon/Carbon.h>
#include <CoreServices/CoreServices.h>
extern BOOL gDebugWindowProc;
@@ -785,7 +786,7 @@ BOOL LLWindowMacOSX::getPosition(LLCoordScreen *position)
}
else
{
- llerrs << "LLWindowMacOSX::getPosition(): no window and not fullscreen!" << llendl;
+ LL_ERRS() << "LLWindowMacOSX::getPosition(): no window and not fullscreen!" << LL_ENDL;
}
return (err == noErr);
@@ -811,7 +812,7 @@ BOOL LLWindowMacOSX::getSize(LLCoordScreen *size)
}
else
{
- llerrs << "LLWindowMacOSX::getPosition(): no window and not fullscreen!" << llendl;
+ LL_ERRS() << "LLWindowMacOSX::getPosition(): no window and not fullscreen!" << LL_ENDL;
}
return (err == noErr);
@@ -837,7 +838,7 @@ BOOL LLWindowMacOSX::getSize(LLCoordWindow *size)
}
else
{
- llerrs << "LLWindowMacOSX::getPosition(): no window and not fullscreen!" << llendl;
+ LL_ERRS() << "LLWindowMacOSX::getPosition(): no window and not fullscreen!" << LL_ENDL;
}
return (err == noErr);
@@ -998,11 +999,11 @@ void LLWindowMacOSX::setMouseClipping( BOOL b )
if(b)
{
- // llinfos << "setMouseClipping(TRUE)" << llendl;
+ // LL_INFOS() << "setMouseClipping(TRUE)" << LL_ENDL;
}
else
{
- // llinfos << "setMouseClipping(FALSE)" << llendl;
+ // LL_INFOS() << "setMouseClipping(FALSE)" << LL_ENDL;
}
adjustCursorDecouple();
@@ -1020,7 +1021,7 @@ BOOL LLWindowMacOSX::setCursorPosition(const LLCoordWindow position)
CGPoint newPosition;
- // llinfos << "setCursorPosition(" << screen_pos.mX << ", " << screen_pos.mY << ")" << llendl;
+ // LL_INFOS() << "setCursorPosition(" << screen_pos.mX << ", " << screen_pos.mY << ")" << LL_ENDL;
newPosition.x = screen_pos.mX;
newPosition.y = screen_pos.mY;
@@ -1082,7 +1083,7 @@ void LLWindowMacOSX::adjustCursorDecouple(bool warpingMouse)
// The cursor should be decoupled. Make sure it is.
if(!mCursorDecoupled)
{
- // llinfos << "adjustCursorDecouple: decoupling cursor" << llendl;
+ // LL_INFOS() << "adjustCursorDecouple: decoupling cursor" << LL_ENDL;
CGAssociateMouseAndMouseCursorPosition(false);
mCursorDecoupled = true;
mCursorIgnoreNextDelta = TRUE;
@@ -1094,7 +1095,7 @@ void LLWindowMacOSX::adjustCursorDecouple(bool warpingMouse)
// The cursor should not be decoupled. Make sure it isn't.
if(mCursorDecoupled)
{
- // llinfos << "adjustCursorDecouple: recoupling cursor" << llendl;
+ // LL_INFOS() << "adjustCursorDecouple: recoupling cursor" << LL_ENDL;
CGAssociateMouseAndMouseCursorPosition(true);
mCursorDecoupled = false;
}
@@ -1359,7 +1360,7 @@ const char* cursorIDToName(int id)
case UI_CURSOR_TOOLNO: return "UI_CURSOR_NO";
}
- llerrs << "cursorIDToName: unknown cursor id" << id << llendl;
+ LL_ERRS() << "cursorIDToName: unknown cursor id" << id << LL_ENDL;
return "UI_CURSOR_ARROW";
}
@@ -1542,14 +1543,14 @@ void LLWindowMacOSX::hideCursor()
{
if(!mCursorHidden)
{
- // llinfos << "hideCursor: hiding" << llendl;
+ // LL_INFOS() << "hideCursor: hiding" << LL_ENDL;
mCursorHidden = TRUE;
mHideCursorPermanent = TRUE;
hideNSCursor();
}
else
{
- // llinfos << "hideCursor: already hidden" << llendl;
+ // LL_INFOS() << "hideCursor: already hidden" << LL_ENDL;
}
adjustCursorDecouple();
@@ -1559,14 +1560,14 @@ void LLWindowMacOSX::showCursor()
{
if(mCursorHidden)
{
- // llinfos << "showCursor: showing" << llendl;
+ // LL_INFOS() << "showCursor: showing" << LL_ENDL;
mCursorHidden = FALSE;
mHideCursorPermanent = FALSE;
showNSCursor();
}
else
{
- // llinfos << "showCursor: already visible" << llendl;
+ // LL_INFOS() << "showCursor: already visible" << LL_ENDL;
}
adjustCursorDecouple();
@@ -1651,14 +1652,14 @@ void LLWindowMacOSX::spawnWebBrowser(const std::string& escaped_url, bool async)
if (!found)
{
- llwarns << "spawn_web_browser called for url with protocol not on whitelist: " << escaped_url << llendl;
+ LL_WARNS() << "spawn_web_browser called for url with protocol not on whitelist: " << escaped_url << LL_ENDL;
return;
}
S32 result = 0;
CFURLRef urlRef = NULL;
- llinfos << "Opening URL " << escaped_url << llendl;
+ LL_INFOS() << "Opening URL " << escaped_url << LL_ENDL;
CFStringRef stringRef = CFStringCreateWithCString(NULL, escaped_url.c_str(), kCFStringEncodingUTF8);
if (stringRef)
@@ -1678,14 +1679,14 @@ void LLWindowMacOSX::spawnWebBrowser(const std::string& escaped_url, bool async)
if (result != noErr)
{
- llinfos << "Error " << result << " on open." << llendl;
+ LL_INFOS() << "Error " << result << " on open." << LL_ENDL;
}
CFRelease(urlRef);
}
else
{
- llinfos << "Error: couldn't create URL." << llendl;
+ LL_INFOS() << "Error: couldn't create URL." << LL_ENDL;
}
}
@@ -1738,21 +1739,39 @@ LLSD LLWindowMacOSX::getNativeKeyData()
}
#endif
- lldebugs << "native key data is: " << result << llendl;
+ LL_DEBUGS() << "native key data is: " << result << LL_ENDL;
return result;
}
-
BOOL LLWindowMacOSX::dialogColorPicker( F32 *r, F32 *g, F32 *b)
{
- // Is this even used anywhere? Do we really need an OS color picker?
BOOL retval = FALSE;
- //S32 error = 0;
+ OSErr error = noErr;
+ NColorPickerInfo info;
+
+ memset(&info, 0, sizeof(info));
+ info.theColor.color.rgb.red = (UInt16)(*r * 65535.f);
+ info.theColor.color.rgb.green = (UInt16)(*g * 65535.f);
+ info.theColor.color.rgb.blue = (UInt16)(*b * 65535.f);
+ info.placeWhere = kCenterOnMainScreen;
+
+ error = NPickColor(&info);
+
+ if (error == noErr)
+ {
+ retval = info.newColorChosen;
+ if (info.newColorChosen)
+ {
+ *r = ((float) info.theColor.color.rgb.red) / 65535.0;
+ *g = ((float) info.theColor.color.rgb.green) / 65535.0;
+ *b = ((float) info.theColor.color.rgb.blue) / 65535.0;
+ }
+ }
+
return (retval);
}
-
void *LLWindowMacOSX::getPlatformWindow()
{
// NOTE: this will be NULL in fullscreen mode. Plan accordingly.
@@ -1786,8 +1805,6 @@ static long getDictLong (CFDictionaryRef refDict, CFStringRef key)
void LLWindowMacOSX::allowLanguageTextInput(LLPreeditor *preeditor, BOOL b)
{
- allowDirectMarkedTextInput(b, mGLView);
-
if (preeditor != mPreeditor && !b)
{
// This condition may occur by a call to
@@ -1817,6 +1834,7 @@ void LLWindowMacOSX::allowLanguageTextInput(LLPreeditor *preeditor, BOOL b)
return;
}
mLanguageTextInputAllowed = b;
+ allowDirectMarkedTextInput(b, mGLView); // mLanguageTextInputAllowed and mMarkedTextAllowed should be updated at once (by Pell Smit
}
void LLWindowMacOSX::interruptLanguageTextInput()
@@ -1849,7 +1867,7 @@ S16 LLWindowMacOSX::dragTrackingHandler(DragTrackingMessage message, WindowRef t
S16 result = 0;
LLWindowMacOSX *self = (LLWindowMacOSX*)handlerRefCon;
- lldebugs << "drag tracking handler, message = " << message << llendl;
+ LL_DEBUGS() << "drag tracking handler, message = " << message << LL_ENDL;
switch(message)
{
diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h
index 6a6b39e674..825fd05c5f 100755
--- a/indra/llwindow/llwindowmacosx.h
+++ b/indra/llwindow/llwindowmacosx.h
@@ -152,7 +152,10 @@ protected:
BOOL resetDisplayResolution();
BOOL shouldPostQuit() { return mPostQuit; }
-
+
+ //Satisfy MAINT-3135 and MAINT-3288 with a flag.
+ /*virtual */ void setOldResize(bool oldresize) {setResizeMode(oldresize, mGLView); }
+
protected:
//
diff --git a/indra/llwindow/llwindowmesaheadless.cpp b/indra/llwindow/llwindowmesaheadless.cpp
index 11c22ac94e..4b01f7a979 100755
--- a/indra/llwindow/llwindowmesaheadless.cpp
+++ b/indra/llwindow/llwindowmesaheadless.cpp
@@ -46,7 +46,7 @@ LLWindowMesaHeadless::LLWindowMesaHeadless(LLWindowCallbacks* callbacks,
{
if (use_gl)
{
- llinfos << "MESA Init" << llendl;
+ LL_INFOS() << "MESA Init" << LL_ENDL;
mMesaContext = OSMesaCreateContextExt( GL_RGBA, 32, 0, 0, NULL );
/* Allocate the image buffer */
@@ -58,7 +58,7 @@ LLWindowMesaHeadless::LLWindowMesaHeadless(LLWindowCallbacks* callbacks,
/* Bind the buffer to the context and make it current */
if (!OSMesaMakeCurrent( mMesaContext, mMesaBuffer, MESA_CHANNEL_TYPE, width, height ))
{
- llerrs << "MESA: OSMesaMakeCurrent failed!" << llendl;
+ LL_ERRS() << "MESA: OSMesaMakeCurrent failed!" << LL_ENDL;
}
llverify(gGLManager.initGL());
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index 205466e936..c20e639fc7 100755
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -109,7 +109,7 @@ bool LLWindowSDL::ll_try_gtk_init(void)
if (!done_setlocale)
{
- llinfos << "Starting GTK Initialization." << llendl;
+ LL_INFOS() << "Starting GTK Initialization." << LL_ENDL;
maybe_lock_display();
gtk_disable_setlocale();
maybe_unlock_display();
@@ -124,20 +124,20 @@ bool LLWindowSDL::ll_try_gtk_init(void)
gtk_is_good = gtk_init_check(NULL, NULL);
maybe_unlock_display();
if (!gtk_is_good)
- llwarns << "GTK Initialization failed." << llendl;
+ LL_WARNS() << "GTK Initialization failed." << LL_ENDL;
}
if (gtk_is_good && !done_gtk_diag)
{
- llinfos << "GTK Initialized." << llendl;
- llinfos << "- Compiled against GTK version "
+ LL_INFOS() << "GTK Initialized." << LL_ENDL;
+ LL_INFOS() << "- Compiled against GTK version "
<< GTK_MAJOR_VERSION << "."
<< GTK_MINOR_VERSION << "."
- << GTK_MICRO_VERSION << llendl;
- llinfos << "- Running against GTK version "
+ << GTK_MICRO_VERSION << LL_ENDL;
+ LL_INFOS() << "- Running against GTK version "
<< gtk_major_version << "."
<< gtk_minor_version << "."
- << gtk_micro_version << llendl;
+ << gtk_micro_version << LL_ENDL;
maybe_lock_display();
const gchar* gtk_warning = gtk_check_version(
GTK_MAJOR_VERSION,
@@ -146,11 +146,11 @@ bool LLWindowSDL::ll_try_gtk_init(void)
maybe_unlock_display();
if (gtk_warning)
{
- llwarns << "- GTK COMPATIBILITY WARNING: " <<
- gtk_warning << llendl;
+ LL_WARNS() << "- GTK COMPATIBILITY WARNING: " <<
+ gtk_warning << LL_ENDL;
gtk_is_good = FALSE;
} else {
- llinfos << "- GTK version is good." << llendl;
+ LL_INFOS() << "- GTK version is good." << LL_ENDL;
}
done_gtk_diag = TRUE;
@@ -223,7 +223,7 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks,
mOriginalAspectRatio = 1024.0 / 768.0;
if (title.empty())
- mWindowTitle = "SDL Window"; // *FIX: (???)
+ mWindowTitle = "SDL Window"; // *FIX: (?)
else
mWindowTitle = title;
@@ -278,7 +278,7 @@ static int x11_detect_VRAM_kb_fp(FILE *fp, const char *prefix_str)
char line_buf[line_buf_size];
while (fgets(line_buf, line_buf_size, fp))
{
- //lldebugs << "XLOG: " << line_buf << llendl;
+ //LL_DEBUGS() << "XLOG: " << line_buf << LL_ENDL;
// Why the ad-hoc parser instead of using a regex? Our
// favourite regex implementation - libboost_regex - is
@@ -353,8 +353,8 @@ static int x11_detect_VRAM_kb()
fp = fopen(fname.c_str(), "r");
if (fp)
{
- llinfos << "Looking in " << fname
- << " for VRAM info..." << llendl;
+ LL_INFOS() << "Looking in " << fname
+ << " for VRAM info..." << LL_ENDL;
rtn = x11_detect_VRAM_kb_fp(fp, ": VideoRAM: ");
fclose(fp);
if (0 == rtn)
@@ -378,8 +378,8 @@ static int x11_detect_VRAM_kb()
}
else
{
- llinfos << "Could not open " << fname
- << " - skipped." << llendl;
+ LL_INFOS() << "Could not open " << fname
+ << " - skipped." << LL_ENDL;
// Try old XFree86 log otherwise
fname = x_log_location;
fname += "XFree86.";
@@ -388,8 +388,8 @@ static int x11_detect_VRAM_kb()
fp = fopen(fname.c_str(), "r");
if (fp)
{
- llinfos << "Looking in " << fname
- << " for VRAM info..." << llendl;
+ LL_INFOS() << "Looking in " << fname
+ << " for VRAM info..." << LL_ENDL;
rtn = x11_detect_VRAM_kb_fp(fp, ": VideoRAM: ");
fclose(fp);
if (0 == rtn)
@@ -404,8 +404,8 @@ static int x11_detect_VRAM_kb()
}
else
{
- llinfos << "Could not open " << fname
- << " - skipped." << llendl;
+ LL_INFOS() << "Could not open " << fname
+ << " - skipped." << LL_ENDL;
}
}
return rtn;
@@ -417,8 +417,8 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
{
//bool glneedsinit = false;
- llinfos << "createContext, fullscreen=" << fullscreen <<
- " size=" << width << "x" << height << llendl;
+ LL_INFOS() << "createContext, fullscreen=" << fullscreen <<
+ " size=" << width << "x" << height << LL_ENDL;
// captures don't survive contexts
mGrabbyKeyFlags = 0;
@@ -426,28 +426,28 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
if (SDL_Init(SDL_INIT_VIDEO) < 0)
{
- llinfos << "sdl_init() failed! " << SDL_GetError() << llendl;
+ LL_INFOS() << "sdl_init() failed! " << SDL_GetError() << LL_ENDL;
setupFailure("sdl_init() failure, window creation error", "error", OSMB_OK);
return false;
}
SDL_version c_sdl_version;
SDL_VERSION(&c_sdl_version);
- llinfos << "Compiled against SDL "
+ LL_INFOS() << "Compiled against SDL "
<< int(c_sdl_version.major) << "."
<< int(c_sdl_version.minor) << "."
- << int(c_sdl_version.patch) << llendl;
+ << int(c_sdl_version.patch) << LL_ENDL;
const SDL_version *r_sdl_version;
r_sdl_version = SDL_Linked_Version();
- llinfos << " Running against SDL "
+ LL_INFOS() << " Running against SDL "
<< int(r_sdl_version->major) << "."
<< int(r_sdl_version->minor) << "."
- << int(r_sdl_version->patch) << llendl;
+ << int(r_sdl_version->patch) << LL_ENDL;
const SDL_VideoInfo *video_info = SDL_GetVideoInfo( );
if (!video_info)
{
- llinfos << "SDL_GetVideoInfo() failed! " << SDL_GetError() << llendl;
+ LL_INFOS() << "SDL_GetVideoInfo() failed! " << SDL_GetError() << LL_ENDL;
setupFailure("SDL_GetVideoInfo() failed, Window creation error", "Error", OSMB_OK);
return FALSE;
}
@@ -455,7 +455,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
if (video_info->current_h > 0)
{
mOriginalAspectRatio = (float)video_info->current_w / (float)video_info->current_h;
- llinfos << "Original aspect ratio was " << video_info->current_w << ":" << video_info->current_h << "=" << mOriginalAspectRatio << llendl;
+ LL_INFOS() << "Original aspect ratio was " << video_info->current_w << ":" << video_info->current_h << "=" << mOriginalAspectRatio << LL_ENDL;
}
SDL_EnableUNICODE(1);
@@ -525,7 +525,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
if (mFullscreen)
{
- llinfos << "createContext: setting up fullscreen " << width << "x" << height << llendl;
+ LL_INFOS() << "createContext: setting up fullscreen " << width << "x" << height << LL_ENDL;
// If the requested width or height is 0, find the best default for the monitor.
if((width == 0) || (height == 0))
@@ -543,18 +543,18 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
U32 closestWidth = 0;
int i;
- llinfos << "createContext: searching for a display mode, original aspect is " << mOriginalAspectRatio << llendl;
+ LL_INFOS() << "createContext: searching for a display mode, original aspect is " << mOriginalAspectRatio << LL_ENDL;
for(i=0; i < resolutionCount; i++)
{
F32 aspect = (F32)resolutionList[i].mWidth / (F32)resolutionList[i].mHeight;
- llinfos << "createContext: width " << resolutionList[i].mWidth << " height " << resolutionList[i].mHeight << " aspect " << aspect << llendl;
+ LL_INFOS() << "createContext: width " << resolutionList[i].mWidth << " height " << resolutionList[i].mHeight << " aspect " << aspect << LL_ENDL;
if( (resolutionList[i].mHeight >= 700) && (resolutionList[i].mHeight <= 800) &&
(fabs(aspect - mOriginalAspectRatio) < fabs(closestAspect - mOriginalAspectRatio)))
{
- llinfos << " (new closest mode) " << llendl;
+ LL_INFOS() << " (new closest mode) " << LL_ENDL;
// This is the closest mode we've seen yet.
closestWidth = resolutionList[i].mWidth;
@@ -590,15 +590,15 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
mFullscreenBits = mWindow->format->BitsPerPixel;
mFullscreenRefresh = -1;
- llinfos << "Running at " << mFullscreenWidth
+ LL_INFOS() << "Running at " << mFullscreenWidth
<< "x" << mFullscreenHeight
<< "x" << mFullscreenBits
<< " @ " << mFullscreenRefresh
- << llendl;
+ << LL_ENDL;
}
else
{
- llwarns << "createContext: fullscreen creation failure. SDL: " << SDL_GetError() << llendl;
+ LL_WARNS() << "createContext: fullscreen creation failure. SDL: " << SDL_GetError() << LL_ENDL;
// No fullscreen support
mFullscreen = FALSE;
mFullscreenWidth = -1;
@@ -618,7 +618,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
if (height == 0)
width = 768;
- llinfos << "createContext: creating window " << width << "x" << height << "x" << bits << llendl;
+ LL_INFOS() << "createContext: creating window " << width << "x" << height << "x" << bits << LL_ENDL;
mWindow = SDL_SetVideoMode(width, height, bits, sdlflags);
if (!mWindow && bits > 16)
{
@@ -628,13 +628,13 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
if (!mWindow)
{
- llwarns << "createContext: window creation failure. SDL: " << SDL_GetError() << llendl;
+ LL_WARNS() << "createContext: window creation failure. SDL: " << SDL_GetError() << LL_ENDL;
setupFailure("Window creation error", "Error", OSMB_OK);
return FALSE;
}
} else if (!mFullscreen && (mWindow != NULL))
{
- llinfos << "createContext: SKIPPING - !fullscreen, but +mWindow " << width << "x" << height << "x" << bits << llendl;
+ LL_INFOS() << "createContext: SKIPPING - !fullscreen, but +mWindow " << width << "x" << height << "x" << bits << LL_ENDL;
}
// Detect video memory size.
@@ -642,7 +642,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
gGLManager.mVRAM = x11_detect_VRAM_kb() / 1024;
if (gGLManager.mVRAM != 0)
{
- llinfos << "X11 log-parser detected " << gGLManager.mVRAM << "MB VRAM." << llendl;
+ LL_INFOS() << "X11 log-parser detected " << gGLManager.mVRAM << "MB VRAM." << LL_ENDL;
} else
# endif // LL_X11
{
@@ -652,7 +652,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
gGLManager.mVRAM = video_info->video_mem / 1024;
if (gGLManager.mVRAM != 0)
{
- llinfos << "SDL detected " << gGLManager.mVRAM << "MB VRAM." << llendl;
+ LL_INFOS() << "SDL detected " << gGLManager.mVRAM << "MB VRAM." << LL_ENDL;
}
}
// If VRAM is not detected, that is handled later
@@ -670,13 +670,13 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
glGetIntegerv(GL_DEPTH_BITS, &depthBits);
glGetIntegerv(GL_STENCIL_BITS, &stencilBits);
- llinfos << "GL buffer:" << llendl;
- llinfos << " Red Bits " << S32(redBits) << llendl;
- llinfos << " Green Bits " << S32(greenBits) << llendl;
- llinfos << " Blue Bits " << S32(blueBits) << llendl;
- llinfos << " Alpha Bits " << S32(alphaBits) << llendl;
- llinfos << " Depth Bits " << S32(depthBits) << llendl;
- llinfos << " Stencil Bits " << S32(stencilBits) << llendl;
+ LL_INFOS() << "GL buffer:" << LL_ENDL;
+ LL_INFOS() << " Red Bits " << S32(redBits) << LL_ENDL;
+ LL_INFOS() << " Green Bits " << S32(greenBits) << LL_ENDL;
+ LL_INFOS() << " Blue Bits " << S32(blueBits) << LL_ENDL;
+ LL_INFOS() << " Alpha Bits " << S32(alphaBits) << LL_ENDL;
+ LL_INFOS() << " Depth Bits " << S32(depthBits) << LL_ENDL;
+ LL_INFOS() << " Stencil Bits " << S32(stencilBits) << LL_ENDL;
GLint colorBits = redBits + greenBits + blueBits + alphaBits;
// fixme: actually, it's REALLY important for picking that we get at
@@ -741,14 +741,14 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
}
else
{
- llwarns << "We're not running under X11? Wild."
- << llendl;
+ LL_WARNS() << "We're not running under X11? Wild."
+ << LL_ENDL;
}
}
else
{
- llwarns << "We're not running under any known WM. Wild."
- << llendl;
+ LL_WARNS() << "We're not running under any known WM. Wild."
+ << LL_ENDL;
}
#endif // LL_X11
@@ -759,7 +759,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
// We need to do this here, once video is init'd
if (-1 == SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY,
SDL_DEFAULT_REPEAT_INTERVAL))
- llwarns << "Couldn't enable key-repeat: " << SDL_GetError() <<llendl;
+ LL_WARNS() << "Couldn't enable key-repeat: " << SDL_GetError() <<LL_ENDL;
// Don't need to get the current gamma, since there's a call that restores it to the system defaults.
return TRUE;
@@ -772,7 +772,7 @@ BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL
const BOOL needsRebuild = TRUE; // Just nuke the context and start over.
BOOL result = true;
- llinfos << "switchContext, fullscreen=" << fullscreen << llendl;
+ LL_INFOS() << "switchContext, fullscreen=" << fullscreen << LL_ENDL;
stop_glerror();
if(needsRebuild)
{
@@ -795,7 +795,7 @@ BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL
void LLWindowSDL::destroyContext()
{
- llinfos << "destroyContext begins" << llendl;
+ LL_INFOS() << "destroyContext begins" << LL_ENDL;
#if LL_X11
mSDL_Display = NULL;
@@ -805,9 +805,9 @@ void LLWindowSDL::destroyContext()
#endif // LL_X11
// Clean up remaining GL state before blowing away window
- llinfos << "shutdownGL begins" << llendl;
+ LL_INFOS() << "shutdownGL begins" << LL_ENDL;
gGLManager.shutdownGL();
- llinfos << "SDL_QuitSS/VID begins" << llendl;
+ LL_INFOS() << "SDL_QuitSS/VID begins" << LL_ENDL;
SDL_QuitSubSystem(SDL_INIT_VIDEO); // *FIX: this might be risky...
mWindow = NULL;
@@ -956,7 +956,7 @@ BOOL LLWindowSDL::setPosition(const LLCoordScreen position)
{
if(mWindow)
{
- // *FIX: (???)
+ // *FIX: (?)
//MacMoveWindow(mWindow, position.mX, position.mY, false);
}
@@ -1081,12 +1081,12 @@ BOOL LLWindowSDL::setCursorPosition(const LLCoordWindow position)
return FALSE;
}
- //llinfos << "setCursorPosition(" << screen_pos.mX << ", " << screen_pos.mY << ")" << llendl;
+ //LL_INFOS() << "setCursorPosition(" << screen_pos.mX << ", " << screen_pos.mY << ")" << LL_ENDL;
// do the actual forced cursor move.
SDL_WarpMouse(screen_pos.mX, screen_pos.mY);
- //llinfos << llformat("llcw %d,%d -> scr %d,%d", position.mX, position.mY, screen_pos.mX, screen_pos.mY) << llendl;
+ //LL_INFOS() << llformat("llcw %d,%d -> scr %d,%d", position.mX, position.mY, screen_pos.mX, screen_pos.mY) << LL_ENDL;
return result;
}
@@ -1171,7 +1171,7 @@ void LLWindowSDL::beforeDialog()
running_x11 = (mSDL_XWindowID != None);
#endif //LL_X11
- llinfos << "LLWindowSDL::beforeDialog()" << llendl;
+ LL_INFOS() << "LLWindowSDL::beforeDialog()" << LL_ENDL;
if (SDLReallyCaptureInput(FALSE)) // must ungrab input so popup works!
{
@@ -1214,7 +1214,7 @@ void LLWindowSDL::afterDialog()
running_x11 = (mSDL_XWindowID != None);
#endif //LL_X11
- llinfos << "LLWindowSDL::afterDialog()" << llendl;
+ LL_INFOS() << "LLWindowSDL::afterDialog()" << LL_ENDL;
maybe_unlock_display();
@@ -1238,7 +1238,7 @@ void LLWindowSDL::x11_set_urgent(BOOL urgent)
{
XWMHints *wm_hints;
- llinfos << "X11 hint for urgency, " << urgent << llendl;
+ LL_INFOS() << "X11 hint for urgency, " << urgent << LL_ENDL;
maybe_lock_display();
wm_hints = XGetWMHints(mSDL_Display, mSDL_XWindowID);
@@ -1261,9 +1261,9 @@ void LLWindowSDL::x11_set_urgent(BOOL urgent)
void LLWindowSDL::flashIcon(F32 seconds)
{
#if !LL_X11
- llinfos << "Stub LLWindowSDL::flashIcon(" << seconds << ")" << llendl;
+ LL_INFOS() << "Stub LLWindowSDL::flashIcon(" << seconds << ")" << LL_ENDL;
#else
- llinfos << "X11 LLWindowSDL::flashIcon(" << seconds << ")" << llendl;
+ LL_INFOS() << "X11 LLWindowSDL::flashIcon(" << seconds << ")" << LL_ENDL;
F32 remaining_time = mFlashTimer.getRemainingTimeF32();
if (remaining_time < seconds)
@@ -1530,7 +1530,7 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture)
if (mReallyCapturedCount < 0) // yuck, imbalance.
{
mReallyCapturedCount = 0;
- llwarns << "ReallyCapture count was < 0" << llendl;
+ LL_WARNS() << "ReallyCapture count was < 0" << LL_ENDL;
}
if (!mFullscreen) /* only bother if we're windowed anyway */
@@ -1550,7 +1550,7 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture)
int result;
if (wantmode == SDL_GRAB_ON)
{
- //llinfos << "X11 POINTER GRABBY" << llendl;
+ //LL_INFOS() << "X11 POINTER GRABBY" << LL_ENDL;
//newmode = SDL_WM_GrabInput(wantmode);
maybe_lock_display();
result = XGrabPointer(mSDL_Display, mSDL_XWindowID,
@@ -1564,7 +1564,7 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture)
newmode = SDL_GRAB_OFF;
} else if (wantmode == SDL_GRAB_OFF)
{
- //llinfos << "X11 POINTER UNGRABBY" << llendl;
+ //LL_INFOS() << "X11 POINTER UNGRABBY" << LL_ENDL;
newmode = SDL_GRAB_OFF;
//newmode = SDL_WM_GrabInput(SDL_GRAB_OFF);
@@ -1625,7 +1625,7 @@ U32 LLWindowSDL::SDLCheckGrabbyKeys(SDLKey keysym, BOOL gain)
else
mGrabbyKeyFlags &= ~mask;
- //llinfos << "mGrabbyKeyFlags=" << mGrabbyKeyFlags << llendl;
+ //LL_INFOS() << "mGrabbyKeyFlags=" << mGrabbyKeyFlags << LL_ENDL;
/* 0 means we don't need to mousegrab, otherwise grab. */
return mGrabbyKeyFlags;
@@ -1655,7 +1655,7 @@ void check_vm_bloat()
res = getdelim(&ptr, &dummy, ' ', fp);
if (-1 == res)
{
- llwarns << "Unable to parse " << STATS_FILE << llendl;
+ LL_WARNS() << "Unable to parse " << STATS_FILE << LL_ENDL;
goto finally;
}
free(ptr);
@@ -1666,7 +1666,7 @@ void check_vm_bloat()
llassert(ptr);
if (-1 == res)
{
- llwarns << "Unable to parse " << STATS_FILE << llendl;
+ LL_WARNS() << "Unable to parse " << STATS_FILE << LL_ENDL;
goto finally;
}
this_vm_size = atoll(ptr);
@@ -1677,25 +1677,25 @@ void check_vm_bloat()
llassert(ptr);
if (-1 == res)
{
- llwarns << "Unable to parse " << STATS_FILE << llendl;
+ LL_WARNS() << "Unable to parse " << STATS_FILE << LL_ENDL;
goto finally;
}
this_rss_size = getpagesize() * atoll(ptr);
free(ptr);
ptr = NULL;
- llinfos << "VM SIZE IS NOW " << (this_vm_size/(1024*1024)) << " MB, RSS SIZE IS NOW " << (this_rss_size/(1024*1024)) << " MB" << llendl;
+ LL_INFOS() << "VM SIZE IS NOW " << (this_vm_size/(1024*1024)) << " MB, RSS SIZE IS NOW " << (this_rss_size/(1024*1024)) << " MB" << LL_ENDL;
if (llabs(last_vm_size - this_vm_size) >
significant_vm_difference)
{
if (this_vm_size > last_vm_size)
{
- llwarns << "VM size grew by " << (this_vm_size - last_vm_size)/(1024*1024) << " MB in last frame" << llendl;
+ LL_WARNS() << "VM size grew by " << (this_vm_size - last_vm_size)/(1024*1024) << " MB in last frame" << LL_ENDL;
}
else
{
- llinfos << "VM size shrank by " << (last_vm_size - this_vm_size)/(1024*1024) << " MB in last frame" << llendl;
+ LL_INFOS() << "VM size shrank by " << (last_vm_size - this_vm_size)/(1024*1024) << " MB in last frame" << LL_ENDL;
}
}
@@ -1704,11 +1704,11 @@ void check_vm_bloat()
{
if (this_rss_size > last_rss_size)
{
- llwarns << "RSS size grew by " << (this_rss_size - last_rss_size)/(1024*1024) << " MB in last frame" << llendl;
+ LL_WARNS() << "RSS size grew by " << (this_rss_size - last_rss_size)/(1024*1024) << " MB in last frame" << LL_ENDL;
}
else
{
- llinfos << "RSS size shrank by " << (last_rss_size - this_rss_size)/(1024*1024) << " MB in last frame" << llendl;
+ LL_INFOS() << "RSS size shrank by " << (last_rss_size - this_rss_size)/(1024*1024) << " MB in last frame" << LL_ENDL;
}
}
@@ -1905,8 +1905,8 @@ void LLWindowSDL::gatherInput()
case SDL_VIDEORESIZE: // *FIX: handle this?
{
- llinfos << "Handling a resize event: " << event.resize.w <<
- "x" << event.resize.h << llendl;
+ LL_INFOS() << "Handling a resize event: " << event.resize.w <<
+ "x" << event.resize.h << LL_ENDL;
S32 width = llmax(event.resize.w, (S32)mMinWindowWidth);
S32 height = llmax(event.resize.h, (S32)mMinWindowHeight);
@@ -1916,7 +1916,7 @@ void LLWindowSDL::gatherInput()
if (!mWindow)
{
// *FIX: More informative dialog?
- llinfos << "Could not recreate context after resize! Quitting..." << llendl;
+ LL_INFOS() << "Could not recreate context after resize! Quitting..." << LL_ENDL;
if(mCallbacks->handleCloseRequest(this))
{
// Get the app to initiate cleanup.
@@ -1957,11 +1957,11 @@ void LLWindowSDL::gatherInput()
mIsMinimized = (!event.active.gain);
mCallbacks->handleActivate(this, !mIsMinimized);
- llinfos << "SDL deiconification state switched to " << BOOL(event.active.gain) << llendl;
+ LL_INFOS() << "SDL deiconification state switched to " << BOOL(event.active.gain) << LL_ENDL;
}
else
{
- llinfos << "Ignored bogus redundant SDL deiconification state switch to " << BOOL(event.active.gain) << llendl;
+ LL_INFOS() << "Ignored bogus redundant SDL deiconification state switch to " << BOOL(event.active.gain) << LL_ENDL;
}
}
break;
@@ -1975,7 +1975,7 @@ void LLWindowSDL::gatherInput()
}
break;
default:
- //llinfos << "Unhandled SDL event type " << event.type << llendl;
+ //LL_INFOS() << "Unhandled SDL event type " << event.type << LL_ENDL;
break;
}
}
@@ -2003,8 +2003,8 @@ static SDL_Cursor *makeSDLCursorFromBMP(const char *filename, int hotx, int hoty
if (bmpsurface && bmpsurface->w%8==0)
{
SDL_Surface *cursurface;
- lldebugs << "Loaded cursor file " << filename << " "
- << bmpsurface->w << "x" << bmpsurface->h << llendl;
+ LL_DEBUGS() << "Loaded cursor file " << filename << " "
+ << bmpsurface->w << "x" << bmpsurface->h << LL_ENDL;
cursurface = SDL_CreateRGBSurface (SDL_SWSURFACE,
bmpsurface->w,
bmpsurface->h,
@@ -2056,12 +2056,12 @@ static SDL_Cursor *makeSDLCursorFromBMP(const char *filename, int hotx, int hoty
delete[] cursor_data;
delete[] cursor_mask;
} else {
- llwarns << "CURSOR BLIT FAILURE, cursurface: " << cursurface << llendl;
+ LL_WARNS() << "CURSOR BLIT FAILURE, cursurface: " << cursurface << LL_ENDL;
}
SDL_FreeSurface(cursurface);
SDL_FreeSurface(bmpsurface);
} else {
- llwarns << "CURSOR LOAD FAILURE " << filename << llendl;
+ LL_WARNS() << "CURSOR LOAD FAILURE " << filename << LL_ENDL;
}
return sdlcursor;
@@ -2087,7 +2087,7 @@ void LLWindowSDL::updateCursor()
if (sdlcursor)
SDL_SetCursor(sdlcursor);
} else {
- llwarns << "Tried to set invalid cursor number " << mNextCursor << llendl;
+ LL_WARNS() << "Tried to set invalid cursor number " << mNextCursor << LL_ENDL;
}
mCurrentCursor = mNextCursor;
}
@@ -2149,7 +2149,7 @@ void LLWindowSDL::initCursors()
mSDLCursors[UI_CURSOR_TOOLNO] = makeSDLCursorFromBMP("llno.BMP",8,8);
if (getenv("LL_ATI_MOUSE_CURSOR_BUG") != NULL) {
- llinfos << "Disabling cursor updating due to LL_ATI_MOUSE_CURSOR_BUG" << llendl;
+ LL_INFOS() << "Disabling cursor updating due to LL_ATI_MOUSE_CURSOR_BUG" << LL_ENDL;
ATIbug = true;
}
}
@@ -2170,7 +2170,7 @@ void LLWindowSDL::quitCursors()
} else {
// SDL doesn't refcount cursors, so if the window has
// already been destroyed then the cursors have gone with it.
- llinfos << "Skipping quitCursors: mWindow already gone." << llendl;
+ LL_INFOS() << "Skipping quitCursors: mWindow already gone." << LL_ENDL;
for (i=0; i<UI_CURSOR_COUNT; ++i)
mSDLCursors[i] = NULL;
}
@@ -2181,31 +2181,31 @@ void LLWindowSDL::captureMouse()
// SDL already enforces the semantics that captureMouse is
// used for, i.e. that we continue to get mouse events as long
// as a button is down regardless of whether we left the
- // window, and in a less obnoxious way than SDL_WM_GrabInput
+ // window, and in a less obnoxious way than SDL_WM_GrabInput
// which would confine the cursor to the window too.
- lldebugs << "LLWindowSDL::captureMouse" << llendl;
+ LL_DEBUGS() << "LLWindowSDL::captureMouse" << LL_ENDL;
}
void LLWindowSDL::releaseMouse()
{
// see LWindowSDL::captureMouse()
- lldebugs << "LLWindowSDL::releaseMouse" << llendl;
+ LL_DEBUGS() << "LLWindowSDL::releaseMouse" << LL_ENDL;
}
void LLWindowSDL::hideCursor()
{
if(!mCursorHidden)
{
- // llinfos << "hideCursor: hiding" << llendl;
+ // LL_INFOS() << "hideCursor: hiding" << LL_ENDL;
mCursorHidden = TRUE;
mHideCursorPermanent = TRUE;
SDL_ShowCursor(0);
}
else
{
- // llinfos << "hideCursor: already hidden" << llendl;
+ // LL_INFOS() << "hideCursor: already hidden" << LL_ENDL;
}
}
@@ -2213,14 +2213,14 @@ void LLWindowSDL::showCursor()
{
if(mCursorHidden)
{
- // llinfos << "showCursor: showing" << llendl;
+ // LL_INFOS() << "showCursor: showing" << LL_ENDL;
mCursorHidden = FALSE;
mHideCursorPermanent = FALSE;
SDL_ShowCursor(1);
}
else
{
- // llinfos << "showCursor: already visible" << llendl;
+ // LL_INFOS() << "showCursor: already visible" << LL_ENDL;
}
}
@@ -2291,7 +2291,7 @@ S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 typ
{
GtkWidget *win = NULL;
- llinfos << "Creating a dialog because we're in windowed mode and GTK is happy." << llendl;
+ LL_INFOS() << "Creating a dialog because we're in windowed mode and GTK is happy." << LL_ENDL;
GtkDialogFlags flags = GTK_DIALOG_MODAL;
GtkMessageType messagetype;
@@ -2350,7 +2350,7 @@ S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 typ
gtk_widget_show_all (win);
gtk_main();
- //llinfos << "response: " << response << llendl;
+ //LL_INFOS() << "response: " << response << LL_ENDL;
switch (response)
{
case GTK_RESPONSE_OK: rtn = OSBTN_OK; break;
@@ -2366,8 +2366,8 @@ S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 typ
}
else
{
- llinfos << "MSGBOX: " << caption << ": " << text << llendl;
- llinfos << "Skipping dialog because we're in fullscreen mode or GTK is not happy." << llendl;
+ LL_INFOS() << "MSGBOX: " << caption << ": " << text << LL_ENDL;
+ LL_INFOS() << "Skipping dialog because we're in fullscreen mode or GTK is not happy." << LL_ENDL;
rtn = OSBTN_OK;
}
@@ -2493,7 +2493,7 @@ BOOL LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b)
#else
S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 type)
{
- llinfos << "MSGBOX: " << caption << ": " << text << llendl;
+ LL_INFOS() << "MSGBOX: " << caption << ": " << text << LL_ENDL;
return 0;
}
@@ -2521,7 +2521,7 @@ void exec_cmd(const std::string& cmd, const std::string& arg)
// end ourself by running the command
execv(cmd.c_str(), argv); /* Flawfinder: ignore */
// if execv returns at all, there was a problem.
- llwarns << "execv failure when trying to start " << cmd << llendl;
+ LL_WARNS() << "execv failure when trying to start " << cmd << LL_ENDL;
_exit(1); // _exit because we don't want atexit() clean-up!
} else {
if (pid > 0)
@@ -2530,7 +2530,7 @@ void exec_cmd(const std::string& cmd, const std::string& arg)
int childExitStatus;
waitpid(pid, &childExitStatus, 0);
} else {
- llwarns << "fork failure." << llendl;
+ LL_WARNS() << "fork failure." << LL_ENDL;
}
}
}
@@ -2553,11 +2553,11 @@ void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async)
if (!found)
{
- llwarns << "spawn_web_browser called for url with protocol not on whitelist: " << escaped_url << llendl;
+ LL_WARNS() << "spawn_web_browser called for url with protocol not on whitelist: " << escaped_url << LL_ENDL;
return;
}
- llinfos << "spawn_web_browser: " << escaped_url << llendl;
+ LL_INFOS() << "spawn_web_browser: " << escaped_url << LL_ENDL;
#if LL_LINUX || LL_SOLARIS
# if LL_X11
@@ -2580,7 +2580,7 @@ void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async)
exec_cmd(cmd, arg);
#endif // LL_LINUX || LL_SOLARIS
- llinfos << "spawn_web_browser returning." << llendl;
+ LL_INFOS() << "spawn_web_browser returning." << LL_ENDL;
}
@@ -2615,7 +2615,7 @@ void LLWindowSDL::bringToFront()
{
// This is currently used when we are 'launched' to a specific
// map position externally.
- llinfos << "bringToFront" << llendl;
+ LL_INFOS() << "bringToFront" << LL_ENDL;
#if LL_X11
if (mSDL_Display && !mFullscreen)
{
@@ -2650,7 +2650,7 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList()
FcFontSet *fs = NULL;
FcPattern *sortpat = NULL;
- llinfos << "Getting system font list from FontConfig..." << llendl;
+ LL_INFOS() << "Getting system font list from FontConfig..." << LL_ENDL;
// If the user has a system-wide language preference, then favor
// fonts from that language group. This doesn't affect the types
@@ -2667,9 +2667,9 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList()
LL_INFOS("AppInit") << "Location " << locale->country << LL_ENDL;
LL_INFOS("AppInit") << "Variant " << locale->variant << LL_ENDL;
- llinfos << "Preferring fonts of language: "
+ LL_INFOS() << "Preferring fonts of language: "
<< locale->lang
- << llendl;
+ << LL_ENDL;
sort_order = "lang=" + std::string(locale->lang) + ":"
+ sort_order;
}
@@ -2678,7 +2678,7 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList()
if (!FcInit())
{
- llwarns << "FontConfig failed to initialize." << llendl;
+ LL_WARNS() << "FontConfig failed to initialize." << LL_ENDL;
rtns.push_back(final_fallback);
return rtns;
}
@@ -2715,14 +2715,14 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList()
FcFontSetDestroy (fs);
}
- lldebugs << "Using font list: " << llendl;
+ LL_DEBUGS() << "Using font list: " << LL_ENDL;
for (std::vector<std::string>::iterator it = rtns.begin();
it != rtns.end();
++it)
{
- lldebugs << " file: " << *it << llendl;
+ LL_DEBUGS() << " file: " << *it << LL_ENDL;
}
- llinfos << "Using " << rtns.size() << "/" << found_font_count << " system fonts." << llendl;
+ LL_INFOS() << "Using " << rtns.size() << "/" << found_font_count << " system fonts." << LL_ENDL;
rtns.push_back(final_fallback);
return rtns;
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 30f5526500..cd2be87fad 100755
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -38,6 +38,7 @@
// Linden library includes
#include "llerror.h"
+#include "llfasttimer.h"
#include "llgl.h"
#include "llstring.h"
#include "lldir.h"
@@ -85,6 +86,18 @@ void show_window_creation_error(const std::string& title)
LL_WARNS("Window") << title << LL_ENDL;
}
+HGLRC SafeCreateContext(HDC hdc)
+{
+ __try
+ {
+ return wglCreateContext(hdc);
+ }
+ __except(EXCEPTION_EXECUTE_HANDLER)
+ {
+ return NULL;
+ }
+}
+
//static
BOOL LLWindowWin32::sIsClassRegistered = FALSE;
@@ -202,7 +215,7 @@ LLWinImm::LLWinImm() : mHImmDll(NULL)
// the case, since it is very unusual; these APIs are available from
// the beginning, and all versions of IMM32.DLL should have them all.
// Unfortunately, this code may be executed before initialization of
- // the logging channel (llwarns), and we can't do it here... Yes, this
+ // the logging channel (LL_WARNS()), and we can't do it here... Yes, this
// is one of disadvantages to use static constraction to DLL loading.
FreeLibrary(mHImmDll);
mHImmDll = NULL;
@@ -656,7 +669,7 @@ LLWindowWin32::~LLWindowWin32()
delete [] mSupportedResolutions;
mSupportedResolutions = NULL;
- delete mWindowClassName;
+ delete [] mWindowClassName;
mWindowClassName = NULL;
}
@@ -1056,7 +1069,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
mhInstance,
NULL);
- LL_INFOS("Window") << "window is created." << llendl ;
+ LL_INFOS("Window") << "window is created." << LL_ENDL ;
//-----------------------------------------------------------------------
// Create GL drawing context
@@ -1089,7 +1102,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
return FALSE;
}
- LL_INFOS("Window") << "Device context retrieved." << llendl ;
+ LL_INFOS("Window") << "Device context retrieved." << LL_ENDL ;
if (!(pixel_format = ChoosePixelFormat(mhDC, &pfd)))
{
@@ -1099,7 +1112,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
return FALSE;
}
- LL_INFOS("Window") << "Pixel format chosen." << llendl ;
+ LL_INFOS("Window") << "Pixel format chosen." << LL_ENDL ;
// Verify what pixel format we actually received.
if (!DescribePixelFormat(mhDC, pixel_format, sizeof(PIXELFORMATDESCRIPTOR),
@@ -1112,35 +1125,35 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
}
// (EXP-1765) dump pixel data to see if there is a pattern that leads to unreproducible crash
- LL_INFOS("Window") << "--- begin pixel format dump ---" << llendl ;
- LL_INFOS("Window") << "pixel_format is " << pixel_format << llendl ;
- LL_INFOS("Window") << "pfd.nSize: " << pfd.nSize << llendl ;
- LL_INFOS("Window") << "pfd.nVersion: " << pfd.nVersion << llendl ;
- LL_INFOS("Window") << "pfd.dwFlags: 0x" << std::hex << pfd.dwFlags << std::dec << llendl ;
- LL_INFOS("Window") << "pfd.iPixelType: " << (int)pfd.iPixelType << llendl ;
- LL_INFOS("Window") << "pfd.cColorBits: " << (int)pfd.cColorBits << llendl ;
- LL_INFOS("Window") << "pfd.cRedBits: " << (int)pfd.cRedBits << llendl ;
- LL_INFOS("Window") << "pfd.cRedShift: " << (int)pfd.cRedShift << llendl ;
- LL_INFOS("Window") << "pfd.cGreenBits: " << (int)pfd.cGreenBits << llendl ;
- LL_INFOS("Window") << "pfd.cGreenShift: " << (int)pfd.cGreenShift << llendl ;
- LL_INFOS("Window") << "pfd.cBlueBits: " << (int)pfd.cBlueBits << llendl ;
- LL_INFOS("Window") << "pfd.cBlueShift: " << (int)pfd.cBlueShift << llendl ;
- LL_INFOS("Window") << "pfd.cAlphaBits: " << (int)pfd.cAlphaBits << llendl ;
- LL_INFOS("Window") << "pfd.cAlphaShift: " << (int)pfd.cAlphaShift << llendl ;
- LL_INFOS("Window") << "pfd.cAccumBits: " << (int)pfd.cAccumBits << llendl ;
- LL_INFOS("Window") << "pfd.cAccumRedBits: " << (int)pfd.cAccumRedBits << llendl ;
- LL_INFOS("Window") << "pfd.cAccumGreenBits: " << (int)pfd.cAccumGreenBits << llendl ;
- LL_INFOS("Window") << "pfd.cAccumBlueBits: " << (int)pfd.cAccumBlueBits << llendl ;
- LL_INFOS("Window") << "pfd.cAccumAlphaBits: " << (int)pfd.cAccumAlphaBits << llendl ;
- LL_INFOS("Window") << "pfd.cDepthBits: " << (int)pfd.cDepthBits << llendl ;
- LL_INFOS("Window") << "pfd.cStencilBits: " << (int)pfd.cStencilBits << llendl ;
- LL_INFOS("Window") << "pfd.cAuxBuffers: " << (int)pfd.cAuxBuffers << llendl ;
- LL_INFOS("Window") << "pfd.iLayerType: " << (int)pfd.iLayerType << llendl ;
- LL_INFOS("Window") << "pfd.bReserved: " << (int)pfd.bReserved << llendl ;
- LL_INFOS("Window") << "pfd.dwLayerMask: " << pfd.dwLayerMask << llendl ;
- LL_INFOS("Window") << "pfd.dwVisibleMask: " << pfd.dwVisibleMask << llendl ;
- LL_INFOS("Window") << "pfd.dwDamageMask: " << pfd.dwDamageMask << llendl ;
- LL_INFOS("Window") << "--- end pixel format dump ---" << llendl ;
+ LL_INFOS("Window") << "--- begin pixel format dump ---" << LL_ENDL ;
+ LL_INFOS("Window") << "pixel_format is " << pixel_format << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.nSize: " << pfd.nSize << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.nVersion: " << pfd.nVersion << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.dwFlags: 0x" << std::hex << pfd.dwFlags << std::dec << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.iPixelType: " << (int)pfd.iPixelType << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cColorBits: " << (int)pfd.cColorBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cRedBits: " << (int)pfd.cRedBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cRedShift: " << (int)pfd.cRedShift << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cGreenBits: " << (int)pfd.cGreenBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cGreenShift: " << (int)pfd.cGreenShift << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cBlueBits: " << (int)pfd.cBlueBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cBlueShift: " << (int)pfd.cBlueShift << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAlphaBits: " << (int)pfd.cAlphaBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAlphaShift: " << (int)pfd.cAlphaShift << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAccumBits: " << (int)pfd.cAccumBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAccumRedBits: " << (int)pfd.cAccumRedBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAccumGreenBits: " << (int)pfd.cAccumGreenBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAccumBlueBits: " << (int)pfd.cAccumBlueBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAccumAlphaBits: " << (int)pfd.cAccumAlphaBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cDepthBits: " << (int)pfd.cDepthBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cStencilBits: " << (int)pfd.cStencilBits << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.cAuxBuffers: " << (int)pfd.cAuxBuffers << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.iLayerType: " << (int)pfd.iLayerType << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.bReserved: " << (int)pfd.bReserved << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.dwLayerMask: " << pfd.dwLayerMask << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.dwVisibleMask: " << pfd.dwVisibleMask << LL_ENDL ;
+ LL_INFOS("Window") << "pfd.dwDamageMask: " << pfd.dwDamageMask << LL_ENDL ;
+ LL_INFOS("Window") << "--- end pixel format dump ---" << LL_ENDL ;
if (pfd.cColorBits < 32)
{
@@ -1166,14 +1179,15 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
return FALSE;
}
- if (!(mhRC = wglCreateContext(mhDC)))
+
+ if (!(mhRC = SafeCreateContext(mhDC)))
{
close();
OSMessageBox(mCallbacks->translateString("MBGLContextErr"),
mCallbacks->translateString("MBError"), OSMB_OK);
return FALSE;
}
-
+
if (!wglMakeCurrent(mhDC, mhRC))
{
close();
@@ -1182,7 +1196,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
return FALSE;
}
- LL_INFOS("Window") << "Drawing context is created." << llendl ;
+ LL_INFOS("Window") << "Drawing context is created." << LL_ENDL ;
gGLManager.initWGL();
@@ -1239,7 +1253,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
while(!result && mFSAASamples > 0)
{
- llwarns << "FSAASamples: " << mFSAASamples << " not supported." << llendl ;
+ LL_WARNS() << "FSAASamples: " << mFSAASamples << " not supported." << LL_ENDL ;
mFSAASamples /= 2 ; //try to decrease sample pixel number until to disable anti-aliasing
if(mFSAASamples < 2)
@@ -1261,13 +1275,13 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
if(result)
{
- llwarns << "Only support FSAASamples: " << mFSAASamples << llendl ;
+ LL_WARNS() << "Only support FSAASamples: " << mFSAASamples << LL_ENDL ;
}
}
if (!result)
{
- llwarns << "mFSAASamples: " << mFSAASamples << llendl ;
+ LL_WARNS() << "mFSAASamples: " << mFSAASamples << LL_ENDL ;
close();
show_window_creation_error("Error after wglChoosePixelFormatARB 32-bit");
@@ -1320,7 +1334,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
LL_INFOS("Window") << "Choosing pixel formats: " << num_formats << " pixel formats returned" << LL_ENDL;
}
- LL_INFOS("Window") << "pixel formats done." << llendl ;
+ LL_INFOS("Window") << "pixel formats done." << LL_ENDL ;
S32 swap_method = 0;
S32 cur_format = num_formats-1;
@@ -1370,7 +1384,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
mhInstance,
NULL);
- LL_INFOS("Window") << "recreate window done." << llendl ;
+ LL_INFOS("Window") << "recreate window done." << LL_ENDL ;
if (!(mhDC = GetDC(mWindowHandle)))
{
@@ -1479,8 +1493,8 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
}
else
{
- llinfos << "Created OpenGL " << llformat("%d.%d", attribs[1], attribs[3]) <<
- (LLRender::sGLCoreProfile ? " core" : " compatibility") << " context." << llendl;
+ LL_INFOS() << "Created OpenGL " << llformat("%d.%d", attribs[1], attribs[3]) <<
+ (LLRender::sGLCoreProfile ? " core" : " compatibility") << " context." << LL_ENDL;
done = true;
if (LLRender::sGLCoreProfile)
@@ -1822,8 +1836,8 @@ void LLWindowWin32::gatherInput()
mMousePositionModified = FALSE;
}
-static LLFastTimer::DeclareTimer FTM_KEYHANDLER("Handle Keyboard");
-static LLFastTimer::DeclareTimer FTM_MOUSEHANDLER("Handle Mouse");
+static LLTrace::BlockTimerStatHandle FTM_KEYHANDLER("Handle Keyboard");
+static LLTrace::BlockTimerStatHandle FTM_MOUSEHANDLER("Handle Mouse");
LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_param, LPARAM l_param)
{
@@ -1831,6 +1845,10 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
// This helps prevent avatar walking after maximizing the window by double-clicking the title bar.
static bool sHandleLeftMouseUp = true;
+ // Ignore the double click received right after activating app.
+ // This is to avoid triggering double click teleport after returning focus (see MAINT-3786).
+ static bool sHandleDoubleClick = true;
+
LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLong(h_wnd, GWL_USERDATA);
@@ -1877,8 +1895,8 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_DEVICECHANGE");
if (gDebugWindowProc)
{
- llinfos << " WM_DEVICECHANGE: wParam=" << w_param
- << "; lParam=" << l_param << llendl;
+ LL_INFOS() << " WM_DEVICECHANGE: wParam=" << w_param
+ << "; lParam=" << l_param << LL_ENDL;
}
if (w_param == DBT_DEVNODES_CHANGED || w_param == DBT_DEVICEARRIVAL)
{
@@ -1958,6 +1976,11 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
}
}
+ if (!activating)
+ {
+ sHandleDoubleClick = false;
+ }
+
window_imp->mCallbacks->handleActivateApp(window_imp, activating);
break;
@@ -2069,7 +2092,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mKeyVirtualKey = w_param;
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_KEYUP");
- LLFastTimer t2(FTM_KEYHANDLER);
+ LL_RECORD_BLOCK_TIME(FTM_KEYHANDLER);
if (gDebugWindowProc)
{
@@ -2089,7 +2112,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_SETCONTEXT");
if (gDebugWindowProc)
{
- llinfos << "WM_IME_SETCONTEXT" << llendl;
+ LL_INFOS() << "WM_IME_SETCONTEXT" << LL_ENDL;
}
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
@@ -2102,7 +2125,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_STARTCOMPOSITION");
if (gDebugWindowProc)
{
- llinfos << "WM_IME_STARTCOMPOSITION" << llendl;
+ LL_INFOS() << "WM_IME_STARTCOMPOSITION" << LL_ENDL;
}
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
@@ -2115,7 +2138,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_ENDCOMPOSITION");
if (gDebugWindowProc)
{
- llinfos << "WM_IME_ENDCOMPOSITION" << llendl;
+ LL_INFOS() << "WM_IME_ENDCOMPOSITION" << LL_ENDL;
}
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
@@ -2127,7 +2150,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_COMPOSITION");
if (gDebugWindowProc)
{
- llinfos << "WM_IME_COMPOSITION" << llendl;
+ LL_INFOS() << "WM_IME_COMPOSITION" << LL_ENDL;
}
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
@@ -2140,7 +2163,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_REQUEST");
if (gDebugWindowProc)
{
- llinfos << "WM_IME_REQUEST" << llendl;
+ LL_INFOS() << "WM_IME_REQUEST" << LL_ENDL;
}
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
@@ -2182,13 +2205,14 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_NCLBUTTONDOWN");
// A click in a non-client area, e.g. title bar or window border.
sHandleLeftMouseUp = false;
+ sHandleDoubleClick = true;
}
break;
case WM_LBUTTONDOWN:
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_LBUTTONDOWN");
- LLFastTimer t2(FTM_MOUSEHANDLER);
+ LL_RECORD_BLOCK_TIME(FTM_MOUSEHANDLER);
sHandleLeftMouseUp = true;
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
@@ -2226,6 +2250,13 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
//case WM_RBUTTONDBLCLK:
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_LBUTTONDBLCLK");
+
+ if (!sHandleDoubleClick)
+ {
+ sHandleDoubleClick = true;
+ break;
+ }
+
// Because we move the cursor position in the app, we need to query
// to find out where the cursor at the time the event is handled.
// If we don't do this, many clicks could get buffered up, and if the
@@ -2254,7 +2285,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_LBUTTONUP:
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_LBUTTONUP");
- LLFastTimer t2(FTM_MOUSEHANDLER);
+ LL_RECORD_BLOCK_TIME(FTM_MOUSEHANDLER);
if (!sHandleLeftMouseUp)
{
@@ -2295,7 +2326,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_RBUTTONDOWN:
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_RBUTTONDOWN");
- LLFastTimer t2(FTM_MOUSEHANDLER);
+ LL_RECORD_BLOCK_TIME(FTM_MOUSEHANDLER);
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
window_imp->interruptLanguageTextInput();
@@ -2329,7 +2360,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_RBUTTONUP:
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_RBUTTONUP");
- LLFastTimer t2(FTM_MOUSEHANDLER);
+ LL_RECORD_BLOCK_TIME(FTM_MOUSEHANDLER);
// Because we move the cursor position in the app, we need to query
// to find out where the cursor at the time the event is handled.
// If we don't do this, many clicks could get buffered up, and if the
@@ -2359,7 +2390,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
// case WM_MBUTTONDBLCLK:
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_MBUTTONDOWN");
- LLFastTimer t2(FTM_MOUSEHANDLER);
+ LL_RECORD_BLOCK_TIME(FTM_MOUSEHANDLER);
if (LLWinImm::isAvailable() && window_imp->mPreeditor)
{
window_imp->interruptLanguageTextInput();
@@ -2393,7 +2424,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
case WM_MBUTTONUP:
{
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_MBUTTONUP");
- LLFastTimer t2(FTM_MOUSEHANDLER);
+ LL_RECORD_BLOCK_TIME(FTM_MOUSEHANDLER);
// Because we move the cursor position in the llviewer app, we need to query
// to find out where the cursor at the time the event is handled.
// If we don't do this, many clicks could get buffered up, and if the
diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h
index 54c9ac4d4d..169d264808 100755
--- a/indra/llwindow/llwindowwin32.h
+++ b/indra/llwindow/llwindowwin32.h
@@ -28,9 +28,7 @@
#define LL_LLWINDOWWIN32_H
// Limit Windows API to small and manageable set.
-#define WIN32_LEAN_AND_MEAN
-#include <winsock2.h>
-#include <windows.h>
+#include "llwin32headerslean.h"
#include "llwindow.h"
#include "llwindowcallbacks.h"
diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp
index 97fad7feb0..598a802d67 100755
--- a/indra/llxml/llcontrol.cpp
+++ b/indra/llxml/llcontrol.cpp
@@ -141,7 +141,7 @@ LLControlVariable::LLControlVariable(const std::string& name, eControlType type,
{
if ((persist != PERSIST_NO) && mComment.empty())
{
- llerrs << "Must supply a comment for control " << mName << llendl;
+ LL_ERRS() << "Must supply a comment for control " << mName << LL_ENDL;
}
//Push back versus setValue'ing here, since we don't want to call a signal yet
mValues.push_back(initial);
@@ -612,7 +612,7 @@ void LLControlGroup::setUntypedValue(const std::string& name, const LLSD& val)
}
else
{
- CONTROL_ERRS << "Invalid control " << name << llendl;
+ CONTROL_ERRS << "Invalid control " << name << LL_ENDL;
}
}
@@ -914,9 +914,9 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v
}
else
{
- llerrs << "Mismatched type of control variable '"
+ LL_ERRS() << "Mismatched type of control variable '"
<< name << "' found while loading '"
- << filename << "'." << llendl;
+ << filename << "'." << LL_ENDL;
}
}
else if(existing_control->isPersisted())
@@ -1170,7 +1170,7 @@ bool convert_from_llsd<bool>(const LLSD& sd, eControlType type, const std::strin
return sd.asBoolean();
else
{
- CONTROL_ERRS << "Invalid BOOL value for " << control_name << ": " << sd << llendl;
+ CONTROL_ERRS << "Invalid BOOL value for " << control_name << ": " << sd << LL_ENDL;
return FALSE;
}
}
@@ -1182,7 +1182,7 @@ S32 convert_from_llsd<S32>(const LLSD& sd, eControlType type, const std::string&
return sd.asInteger();
else
{
- CONTROL_ERRS << "Invalid S32 value for " << control_name << ": " << sd << llendl;
+ CONTROL_ERRS << "Invalid S32 value for " << control_name << ": " << sd << LL_ENDL;
return 0;
}
}
@@ -1194,7 +1194,7 @@ U32 convert_from_llsd<U32>(const LLSD& sd, eControlType type, const std::string&
return sd.asInteger();
else
{
- CONTROL_ERRS << "Invalid U32 value for " << control_name << ": " << sd << llendl;
+ CONTROL_ERRS << "Invalid U32 value for " << control_name << ": " << sd << LL_ENDL;
return 0;
}
}
@@ -1206,7 +1206,7 @@ F32 convert_from_llsd<F32>(const LLSD& sd, eControlType type, const std::string&
return (F32) sd.asReal();
else
{
- CONTROL_ERRS << "Invalid F32 value for " << control_name << ": " << sd << llendl;
+ CONTROL_ERRS << "Invalid F32 value for " << control_name << ": " << sd << LL_ENDL;
return 0.0f;
}
}
@@ -1218,7 +1218,7 @@ std::string convert_from_llsd<std::string>(const LLSD& sd, eControlType type, co
return sd.asString();
else
{
- CONTROL_ERRS << "Invalid string value for " << control_name << ": " << sd << llendl;
+ CONTROL_ERRS << "Invalid string value for " << control_name << ": " << sd << LL_ENDL;
return LLStringUtil::null;
}
}
@@ -1236,7 +1236,7 @@ LLVector3 convert_from_llsd<LLVector3>(const LLSD& sd, eControlType type, const
return (LLVector3)sd;
else
{
- CONTROL_ERRS << "Invalid LLVector3 value for " << control_name << ": " << sd << llendl;
+ CONTROL_ERRS << "Invalid LLVector3 value for " << control_name << ": " << sd << LL_ENDL;
return LLVector3::zero;
}
}
@@ -1248,7 +1248,7 @@ LLVector3d convert_from_llsd<LLVector3d>(const LLSD& sd, eControlType type, cons
return (LLVector3d)sd;
else
{
- CONTROL_ERRS << "Invalid LLVector3d value for " << control_name << ": " << sd << llendl;
+ CONTROL_ERRS << "Invalid LLVector3d value for " << control_name << ": " << sd << LL_ENDL;
return LLVector3d::zero;
}
}
@@ -1260,7 +1260,7 @@ LLRect convert_from_llsd<LLRect>(const LLSD& sd, eControlType type, const std::s
return LLRect(sd);
else
{
- CONTROL_ERRS << "Invalid rect value for " << control_name << ": " << sd << llendl;
+ CONTROL_ERRS << "Invalid rect value for " << control_name << ": " << sd << LL_ENDL;
return LLRect::null;
}
}
@@ -1293,7 +1293,7 @@ LLColor4 convert_from_llsd<LLColor4>(const LLSD& sd, eControlType type, const st
}
else
{
- CONTROL_ERRS << "Control " << control_name << " not a color" << llendl;
+ CONTROL_ERRS << "Control " << control_name << " not a color" << LL_ENDL;
return LLColor4::white;
}
}
@@ -1305,7 +1305,7 @@ LLColor3 convert_from_llsd<LLColor3>(const LLSD& sd, eControlType type, const st
return sd;
else
{
- CONTROL_ERRS << "Invalid LLColor3 value for " << control_name << ": " << sd << llendl;
+ CONTROL_ERRS << "Invalid LLColor3 value for " << control_name << ": " << sd << LL_ENDL;
return LLColor3::white;
}
}
@@ -1340,13 +1340,13 @@ static LLCachedControl<std::string> test_BrowserHomePage("BrowserHomePage", "hah
void test_cached_control()
{
-#define TEST_LLCC(T, V) if((T)mySetting_##T != V) llerrs << "Fail "#T << llendl
+#define TEST_LLCC(T, V) if((T)mySetting_##T != V) LL_ERRS() << "Fail "#T << LL_ENDL
TEST_LLCC(U32, 666);
TEST_LLCC(S32, (S32)-666);
TEST_LLCC(F32, (F32)-666.666);
TEST_LLCC(bool, true);
TEST_LLCC(BOOL, FALSE);
- if((std::string)mySetting_string != "Default String Value") llerrs << "Fail string" << llendl;
+ if((std::string)mySetting_string != "Default String Value") LL_ERRS() << "Fail string" << LL_ENDL;
TEST_LLCC(LLVector3, LLVector3(1.0f, 2.0f, 3.0f));
TEST_LLCC(LLVector3d, LLVector3d(6.0f, 5.0f, 4.0f));
TEST_LLCC(LLRect, LLRect(0, 0, 100, 500));
@@ -1355,7 +1355,7 @@ void test_cached_control()
TEST_LLCC(LLColor4U, LLColor4U(255, 200, 100, 255));
//There's no LLSD comparsion for LLCC yet. TEST_LLCC(LLSD, test_llsd);
- if((std::string)test_BrowserHomePage != "http://www.secondlife.com") llerrs << "Fail BrowserHomePage" << llendl;
+ if((std::string)test_BrowserHomePage != "http://www.secondlife.com") LL_ERRS() << "Fail BrowserHomePage" << LL_ENDL;
}
#endif // TEST_CACHED_CONTROL
diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h
index f46d21408b..04575d81e0 100755
--- a/indra/llxml/llcontrol.h
+++ b/indra/llxml/llcontrol.h
@@ -29,8 +29,6 @@
#include "llboost.h"
#include "llevent.h"
-#include "llnametable.h"
-#include "llmap.h"
#include "llstring.h"
#include "llrect.h"
#include "llrefcount.h"
@@ -166,7 +164,7 @@ typedef LLPointer<LLControlVariable> LLControlVariablePtr;
template <class T>
eControlType get_control_type()
{
- llwarns << "Usupported control type: " << typeid(T).name() << "." << llendl;
+ LL_WARNS() << "Usupported control type: " << typeid(T).name() << "." << LL_ENDL;
return TYPE_COUNT;
}
@@ -258,7 +256,7 @@ public:
}
else
{
- llwarns << "Control " << name << " not found." << llendl;
+ LL_WARNS() << "Control " << name << " not found." << LL_ENDL;
return T();
}
return convert_from_llsd<T>(value, type, name);
@@ -289,7 +287,7 @@ public:
}
else
{
- llwarns << "Invalid control " << name << llendl;
+ LL_WARNS() << "Invalid control " << name << LL_ENDL;
}
}
@@ -325,7 +323,7 @@ public:
{
if(!declareTypedControl(group, name, default_value, comment))
{
- llerrs << "The control could not be created!!!" << llendl;
+ LL_ERRS() << "The control could not be created!!!" << LL_ENDL;
}
}
@@ -338,7 +336,7 @@ public:
{
if(!group.controlExists(name))
{
- llerrs << "Control named " << name << "not found." << llendl;
+ LL_ERRS() << "Control named " << name << "not found." << LL_ENDL;
}
bindToControl(group, name);
@@ -397,7 +395,6 @@ class LLCachedControl
public:
LLCachedControl(LLControlGroup& group,
const std::string& name,
-
const T& default_value,
const std::string& comment = "Declared In Code")
{
@@ -408,6 +405,16 @@ public:
}
}
+ LLCachedControl(LLControlGroup& group,
+ const std::string& name)
+ {
+ mCachedControlPtr = LLControlCache<T>::getInstance(name);
+ if (mCachedControlPtr.isNull())
+ {
+ mCachedControlPtr = new LLControlCache<T>(group, name);
+ }
+ }
+
operator const T&() const { return mCachedControlPtr->getValue(); }
operator boost::function<const T&()> () const { return boost::function<const T&()>(*this); }
const T& operator()() { return mCachedControlPtr->getValue(); }
diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp
index 7aa2ce9606..cb99496ef1 100755
--- a/indra/llxml/llxmlnode.cpp
+++ b/indra/llxml/llxmlnode.cpp
@@ -388,7 +388,7 @@ void XMLCALL StartXMLNode(void *userData,
if (NULL == parent)
{
- llwarns << "parent (userData) is NULL; aborting function" << llendl;
+ LL_WARNS() << "parent (userData) is NULL; aborting function" << LL_ENDL;
return;
}
@@ -576,7 +576,7 @@ bool LLXMLNode::updateNode(
if (!node || !update_node)
{
- llwarns << "Node invalid" << llendl;
+ LL_WARNS() << "Node invalid" << LL_ENDL;
return FALSE;
}
@@ -700,10 +700,10 @@ bool LLXMLNode::parseBuffer(
// Do the parsing
if (XML_Parse(my_parser, (const char *)buffer, length, TRUE) != XML_STATUS_OK)
{
- llwarns << "Error parsing xml error code: "
+ LL_WARNS() << "Error parsing xml error code: "
<< XML_ErrorString(XML_GetErrorCode(my_parser))
<< " on line " << XML_GetCurrentLineNumber(my_parser)
- << llendl;
+ << LL_ENDL;
}
// Deinit
@@ -711,8 +711,8 @@ bool LLXMLNode::parseBuffer(
if (!file_node->mChildren || file_node->mChildren->map.size() != 1)
{
- llwarns << "Parse failure - wrong number of top-level nodes xml."
- << llendl;
+ LL_WARNS() << "Parse failure - wrong number of top-level nodes xml."
+ << LL_ENDL;
node = NULL ;
return false;
}
@@ -755,10 +755,10 @@ bool LLXMLNode::parseStream(
if (XML_Parse(my_parser, (const char *)buffer, count, !str.good()) != XML_STATUS_OK)
{
- llwarns << "Error parsing xml error code: "
+ LL_WARNS() << "Error parsing xml error code: "
<< XML_ErrorString(XML_GetErrorCode(my_parser))
<< " on lne " << XML_GetCurrentLineNumber(my_parser)
- << llendl;
+ << LL_ENDL;
break;
}
}
@@ -770,8 +770,8 @@ bool LLXMLNode::parseStream(
if (!file_node->mChildren || file_node->mChildren->map.size() != 1)
{
- llwarns << "Parse failure - wrong number of top-level nodes xml."
- << llendl;
+ LL_WARNS() << "Parse failure - wrong number of top-level nodes xml."
+ << LL_ENDL;
node = NULL;
return false;
}
@@ -839,7 +839,7 @@ bool LLXMLNode::getLayeredXMLNode(LLXMLNodePtr& root,
if (!LLXMLNode::parseFile(filename, root, NULL))
{
- llwarns << "Problem reading UI description file: " << filename << llendl;
+ LL_WARNS() << "Problem reading UI description file: " << filename << LL_ENDL;
return false;
}
@@ -859,7 +859,7 @@ bool LLXMLNode::getLayeredXMLNode(LLXMLNodePtr& root,
if (!LLXMLNode::parseFile(layer_filename, updateRoot, NULL))
{
- llwarns << "Problem reading localized UI description file: " << layer_filename << llendl;
+ LL_WARNS() << "Problem reading localized UI description file: " << layer_filename << LL_ENDL;
return false;
}
@@ -898,7 +898,7 @@ void LLXMLNode::writeToFile(LLFILE *out_file, const std::string& indent, bool us
size_t written = fwrite(outstring.c_str(), 1, outstring.length(), out_file);
if (written != outstring.length())
{
- llwarns << "Short write" << llendl;
+ LL_WARNS() << "Short write" << LL_ENDL;
}
}
@@ -1735,9 +1735,9 @@ U32 LLXMLNode::getBoolValue(U32 expected_length, BOOL *array)
#if LL_DEBUG
if (ret_length != expected_length)
{
- lldebugs << "LLXMLNode::getBoolValue() failed for node named '"
+ LL_DEBUGS() << "LLXMLNode::getBoolValue() failed for node named '"
<< mName->mString << "' -- expected " << expected_length << " but "
- << "only found " << ret_length << llendl;
+ << "only found " << ret_length << LL_ENDL;
}
#endif
return ret_length;
@@ -1756,8 +1756,8 @@ U32 LLXMLNode::getByteValue(U32 expected_length, U8 *array, Encoding encoding)
if (mLength > 0 && mLength != expected_length)
{
- llwarns << "XMLNode::getByteValue asked for " << expected_length
- << " elements, while node has " << mLength << llendl;
+ LL_WARNS() << "XMLNode::getByteValue asked for " << expected_length
+ << " elements, while node has " << mLength << LL_ENDL;
return 0;
}
@@ -1780,7 +1780,7 @@ U32 LLXMLNode::getByteValue(U32 expected_length, U8 *array, Encoding encoding)
}
if (value > 255 || is_negative)
{
- llwarns << "getByteValue: Value outside of valid range." << llendl;
+ LL_WARNS() << "getByteValue: Value outside of valid range." << LL_ENDL;
break;
}
array[i] = U8(value);
@@ -1788,9 +1788,9 @@ U32 LLXMLNode::getByteValue(U32 expected_length, U8 *array, Encoding encoding)
#if LL_DEBUG
if (i != expected_length)
{
- lldebugs << "LLXMLNode::getByteValue() failed for node named '"
+ LL_DEBUGS() << "LLXMLNode::getByteValue() failed for node named '"
<< mName->mString << "' -- expected " << expected_length << " but "
- << "only found " << i << llendl;
+ << "only found " << i << LL_ENDL;
}
#endif
return i;
@@ -1808,8 +1808,8 @@ U32 LLXMLNode::getIntValue(U32 expected_length, S32 *array, Encoding encoding)
if (mLength > 0 && mLength != expected_length)
{
- llwarns << "XMLNode::getIntValue asked for " << expected_length
- << " elements, while node has " << mLength << llendl;
+ LL_WARNS() << "XMLNode::getIntValue asked for " << expected_length
+ << " elements, while node has " << mLength << LL_ENDL;
return 0;
}
@@ -1832,7 +1832,7 @@ U32 LLXMLNode::getIntValue(U32 expected_length, S32 *array, Encoding encoding)
}
if (value > 0x7fffffff)
{
- llwarns << "getIntValue: Value outside of valid range." << llendl;
+ LL_WARNS() << "getIntValue: Value outside of valid range." << LL_ENDL;
break;
}
array[i] = S32(value) * (is_negative?-1:1);
@@ -1841,9 +1841,9 @@ U32 LLXMLNode::getIntValue(U32 expected_length, S32 *array, Encoding encoding)
#if LL_DEBUG
if (i != expected_length)
{
- lldebugs << "LLXMLNode::getIntValue() failed for node named '"
+ LL_DEBUGS() << "LLXMLNode::getIntValue() failed for node named '"
<< mName->mString << "' -- expected " << expected_length << " but "
- << "only found " << i << llendl;
+ << "only found " << i << LL_ENDL;
}
#endif
return i;
@@ -1861,8 +1861,8 @@ U32 LLXMLNode::getUnsignedValue(U32 expected_length, U32 *array, Encoding encodi
if (mLength > 0 && mLength != expected_length)
{
- llwarns << "XMLNode::getUnsignedValue asked for " << expected_length
- << " elements, while node has " << mLength << llendl;
+ LL_WARNS() << "XMLNode::getUnsignedValue asked for " << expected_length
+ << " elements, while node has " << mLength << LL_ENDL;
return 0;
}
@@ -1886,7 +1886,7 @@ U32 LLXMLNode::getUnsignedValue(U32 expected_length, U32 *array, Encoding encodi
}
if (is_negative || value > 0xffffffff)
{
- llwarns << "getUnsignedValue: Value outside of valid range." << llendl;
+ LL_WARNS() << "getUnsignedValue: Value outside of valid range." << LL_ENDL;
break;
}
array[i] = U32(value);
@@ -1895,9 +1895,9 @@ U32 LLXMLNode::getUnsignedValue(U32 expected_length, U32 *array, Encoding encodi
#if LL_DEBUG
if (i != expected_length)
{
- lldebugs << "LLXMLNode::getUnsignedValue() failed for node named '"
+ LL_DEBUGS() << "LLXMLNode::getUnsignedValue() failed for node named '"
<< mName->mString << "' -- expected " << expected_length << " but "
- << "only found " << i << llendl;
+ << "only found " << i << LL_ENDL;
}
#endif
@@ -1916,7 +1916,7 @@ U32 LLXMLNode::getLongValue(U32 expected_length, U64 *array, Encoding encoding)
if (mLength > 0 && mLength != expected_length)
{
- llwarns << "XMLNode::getLongValue asked for " << expected_length << " elements, while node has " << mLength << llendl;
+ LL_WARNS() << "XMLNode::getLongValue asked for " << expected_length << " elements, while node has " << mLength << LL_ENDL;
return 0;
}
@@ -1940,7 +1940,7 @@ U32 LLXMLNode::getLongValue(U32 expected_length, U64 *array, Encoding encoding)
}
if (is_negative)
{
- llwarns << "getLongValue: Value outside of valid range." << llendl;
+ LL_WARNS() << "getLongValue: Value outside of valid range." << LL_ENDL;
break;
}
array[i] = value;
@@ -1949,9 +1949,9 @@ U32 LLXMLNode::getLongValue(U32 expected_length, U64 *array, Encoding encoding)
#if LL_DEBUG
if (i != expected_length)
{
- lldebugs << "LLXMLNode::getLongValue() failed for node named '"
+ LL_DEBUGS() << "LLXMLNode::getLongValue() failed for node named '"
<< mName->mString << "' -- expected " << expected_length << " but "
- << "only found " << i << llendl;
+ << "only found " << i << LL_ENDL;
}
#endif
@@ -1970,7 +1970,7 @@ U32 LLXMLNode::getFloatValue(U32 expected_length, F32 *array, Encoding encoding)
if (mLength > 0 && mLength != expected_length)
{
- llwarns << "XMLNode::getFloatValue asked for " << expected_length << " elements, while node has " << mLength << llendl;
+ LL_WARNS() << "XMLNode::getFloatValue asked for " << expected_length << " elements, while node has " << mLength << LL_ENDL;
return 0;
}
@@ -1995,9 +1995,9 @@ U32 LLXMLNode::getFloatValue(U32 expected_length, F32 *array, Encoding encoding)
#if LL_DEBUG
if (i != expected_length)
{
- lldebugs << "LLXMLNode::getFloatValue() failed for node named '"
+ LL_DEBUGS() << "LLXMLNode::getFloatValue() failed for node named '"
<< mName->mString << "' -- expected " << expected_length << " but "
- << "only found " << i << llendl;
+ << "only found " << i << LL_ENDL;
}
#endif
return i;
@@ -2015,7 +2015,7 @@ U32 LLXMLNode::getDoubleValue(U32 expected_length, F64 *array, Encoding encoding
if (mLength > 0 && mLength != expected_length)
{
- llwarns << "XMLNode::getDoubleValue asked for " << expected_length << " elements, while node has " << mLength << llendl;
+ LL_WARNS() << "XMLNode::getDoubleValue asked for " << expected_length << " elements, while node has " << mLength << LL_ENDL;
return 0;
}
@@ -2040,9 +2040,9 @@ U32 LLXMLNode::getDoubleValue(U32 expected_length, F64 *array, Encoding encoding
#if LL_DEBUG
if (i != expected_length)
{
- lldebugs << "LLXMLNode::getDoubleValue() failed for node named '"
+ LL_DEBUGS() << "LLXMLNode::getDoubleValue() failed for node named '"
<< mName->mString << "' -- expected " << expected_length << " but "
- << "only found " << i << llendl;
+ << "only found " << i << LL_ENDL;
}
#endif
return i;
@@ -2056,7 +2056,7 @@ U32 LLXMLNode::getStringValue(U32 expected_length, std::string *array)
if (mLength > 0 && mLength != expected_length)
{
- llwarns << "XMLNode::getStringValue asked for " << expected_length << " elements, while node has " << mLength << llendl;
+ LL_WARNS() << "XMLNode::getStringValue asked for " << expected_length << " elements, while node has " << mLength << LL_ENDL;
return 0;
}
@@ -2088,9 +2088,9 @@ U32 LLXMLNode::getStringValue(U32 expected_length, std::string *array)
#if LL_DEBUG
if (num_returned_strings != expected_length)
{
- lldebugs << "LLXMLNode::getStringValue() failed for node named '"
+ LL_DEBUGS() << "LLXMLNode::getStringValue() failed for node named '"
<< mName->mString << "' -- expected " << expected_length << " but "
- << "only found " << num_returned_strings << llendl;
+ << "only found " << num_returned_strings << LL_ENDL;
}
#endif
@@ -2133,9 +2133,9 @@ U32 LLXMLNode::getUUIDValue(U32 expected_length, LLUUID *array)
#if LL_DEBUG
if (i != expected_length)
{
- lldebugs << "LLXMLNode::getUUIDValue() failed for node named '"
+ LL_DEBUGS() << "LLXMLNode::getUUIDValue() failed for node named '"
<< mName->mString << "' -- expected " << expected_length << " but "
- << "only found " << i << llendl;
+ << "only found " << i << LL_ENDL;
}
#endif
return i;
@@ -2164,11 +2164,11 @@ U32 LLXMLNode::getNodeRefValue(U32 expected_length, LLXMLNode **array)
root->findID(string_array[strnum], node_list);
if (node_list.empty())
{
- llwarns << "XML: Could not find node ID: " << string_array[strnum] << llendl;
+ LL_WARNS() << "XML: Could not find node ID: " << string_array[strnum] << LL_ENDL;
}
else if (node_list.size() > 1)
{
- llwarns << "XML: Node ID not unique: " << string_array[strnum] << llendl;
+ LL_WARNS() << "XML: Node ID not unique: " << string_array[strnum] << LL_ENDL;
}
else
{
diff --git a/indra/llxml/llxmlnode.h b/indra/llxml/llxmlnode.h
index ec486d7957..0b8da5dc5d 100755
--- a/indra/llxml/llxmlnode.h
+++ b/indra/llxml/llxmlnode.h
@@ -30,7 +30,7 @@
#ifndef XML_STATIC
#define XML_STATIC
#endif
-#ifdef LL_STANDALONE
+#ifdef LL_USESYSTEMLIBS
#include <expat.h>
#else
#include "expat/expat.h"
@@ -38,17 +38,16 @@
#include <map>
#include "indra_constants.h"
+#include "llrefcount.h"
#include "llpointer.h"
-#include "llthread.h" // LLThreadSafeRefCount
#include "llstring.h"
#include "llstringtable.h"
#include "llfile.h"
-
+#include "lluuid.h"
class LLVector3;
class LLVector3d;
class LLQuaternion;
-class LLUUID;
class LLColor4;
class LLColor4U;
diff --git a/indra/llxml/llxmlparser.cpp b/indra/llxml/llxmlparser.cpp
index 7db4a90b57..1bdc283f67 100755
--- a/indra/llxml/llxmlparser.cpp
+++ b/indra/llxml/llxmlparser.cpp
@@ -121,7 +121,7 @@ exit_label:
if( !success )
{
- llwarns << mAuxErrorString << llendl;
+ LL_WARNS() << mAuxErrorString << LL_ENDL;
}
return success;
diff --git a/indra/llxml/llxmlparser.h b/indra/llxml/llxmlparser.h
index e0f8b69452..a5b210404f 100755
--- a/indra/llxml/llxmlparser.h
+++ b/indra/llxml/llxmlparser.h
@@ -30,7 +30,7 @@
#ifndef XML_STATIC
#define XML_STATIC
#endif
-#ifdef LL_STANDALONE
+#ifdef LL_USESYSTEMLIBS
#include <expat.h>
#else
#include "expat/expat.h"
diff --git a/indra/llxml/llxmltree.cpp b/indra/llxml/llxmltree.cpp
index f2386700a1..ca98953f92 100755
--- a/indra/llxml/llxmltree.cpp
+++ b/indra/llxml/llxmltree.cpp
@@ -72,7 +72,7 @@ BOOL LLXmlTree::parseFile(const std::string &path, BOOL keep_contents)
{
S32 line_number = parser.getCurrentLineNumber();
const char* error = parser.getErrorString();
- llwarns << "LLXmlTree parse failed. Line " << line_number << ": " << error << llendl;
+ LL_WARNS() << "LLXmlTree parse failed. Line " << line_number << ": " << error << LL_ENDL;
}
return success;
}
@@ -118,19 +118,19 @@ LLXmlTreeNode::~LLXmlTreeNode()
void LLXmlTreeNode::dump( const std::string& prefix )
{
- llinfos << prefix << mName ;
+ LL_INFOS() << prefix << mName ;
if( !mContents.empty() )
{
- llcont << " contents = \"" << mContents << "\"";
+ LL_CONT << " contents = \"" << mContents << "\"";
}
attribute_map_t::iterator iter;
for (iter=mAttributes.begin(); iter != mAttributes.end(); iter++)
{
LLStdStringHandle key = iter->first;
const std::string* value = iter->second;
- llcont << prefix << " " << key << "=" << (value->empty() ? "NULL" : *value);
+ LL_CONT << prefix << " " << key << "=" << (value->empty() ? "NULL" : *value);
}
- llcont << llendl;
+ LL_CONT << LL_ENDL;
}
BOOL LLXmlTreeNode::hasAttribute(const std::string& name)
@@ -551,12 +551,12 @@ void LLXmlTreeParser::startElement(const char* name, const char **atts)
{
if( mDump )
{
- llinfos << tabs() << "startElement " << name << llendl;
+ LL_INFOS() << tabs() << "startElement " << name << LL_ENDL;
S32 i = 0;
while( atts[i] && atts[i+1] )
{
- llinfos << tabs() << "attribute: " << atts[i] << "=" << atts[i+1] << llendl;
+ LL_INFOS() << tabs() << "attribute: " << atts[i] << "=" << atts[i+1] << LL_ENDL;
i += 2;
}
}
@@ -593,7 +593,7 @@ void LLXmlTreeParser::endElement(const char* name)
{
if( mDump )
{
- llinfos << tabs() << "endElement " << name << llendl;
+ LL_INFOS() << tabs() << "endElement " << name << LL_ENDL;
}
if( !mCurrent->mContents.empty() )
@@ -611,7 +611,7 @@ void LLXmlTreeParser::characterData(const char *s, int len)
if (s) str = std::string(s, len);
if( mDump )
{
- llinfos << tabs() << "CharacterData " << str << llendl;
+ LL_INFOS() << tabs() << "CharacterData " << str << LL_ENDL;
}
if (mKeepContents)
@@ -624,7 +624,7 @@ void LLXmlTreeParser::processingInstruction(const char *target, const char *data
{
if( mDump )
{
- llinfos << tabs() << "processingInstruction " << data << llendl;
+ LL_INFOS() << tabs() << "processingInstruction " << data << LL_ENDL;
}
}
@@ -632,7 +632,7 @@ void LLXmlTreeParser::comment(const char *data)
{
if( mDump )
{
- llinfos << tabs() << "comment " << data << llendl;
+ LL_INFOS() << tabs() << "comment " << data << LL_ENDL;
}
}
@@ -640,7 +640,7 @@ void LLXmlTreeParser::startCdataSection()
{
if( mDump )
{
- llinfos << tabs() << "startCdataSection" << llendl;
+ LL_INFOS() << tabs() << "startCdataSection" << LL_ENDL;
}
}
@@ -648,7 +648,7 @@ void LLXmlTreeParser::endCdataSection()
{
if( mDump )
{
- llinfos << tabs() << "endCdataSection" << llendl;
+ LL_INFOS() << tabs() << "endCdataSection" << LL_ENDL;
}
}
@@ -658,7 +658,7 @@ void LLXmlTreeParser::defaultData(const char *s, int len)
{
std::string str;
if (s) str = std::string(s, len);
- llinfos << tabs() << "defaultData " << str << llendl;
+ LL_INFOS() << tabs() << "defaultData " << str << LL_ENDL;
}
}
@@ -671,12 +671,12 @@ void LLXmlTreeParser::unparsedEntityDecl(
{
if( mDump )
{
- llinfos << tabs() << "unparsed entity:" << llendl;
- llinfos << tabs() << " entityName " << entity_name << llendl;
- llinfos << tabs() << " base " << base << llendl;
- llinfos << tabs() << " systemId " << system_id << llendl;
- llinfos << tabs() << " publicId " << public_id << llendl;
- llinfos << tabs() << " notationName " << notation_name<< llendl;
+ LL_INFOS() << tabs() << "unparsed entity:" << LL_ENDL;
+ LL_INFOS() << tabs() << " entityName " << entity_name << LL_ENDL;
+ LL_INFOS() << tabs() << " base " << base << LL_ENDL;
+ LL_INFOS() << tabs() << " systemId " << system_id << LL_ENDL;
+ LL_INFOS() << tabs() << " publicId " << public_id << LL_ENDL;
+ LL_INFOS() << tabs() << " notationName " << notation_name<< LL_ENDL;
}
}
diff --git a/indra/llxml/llxmltree.h b/indra/llxml/llxmltree.h
index bdcb56f1f3..a82fee0416 100755
--- a/indra/llxml/llxmltree.h
+++ b/indra/llxml/llxmltree.h
@@ -32,7 +32,7 @@
#include <list>
#include "llstring.h"
#include "llxmlparser.h"
-#include "string_table.h"
+#include "llstringtable.h"
class LLColor4;
class LLColor4U;
@@ -227,7 +227,7 @@ protected:
LLXmlTree* mTree;
LLXmlTreeNode* mRoot;
LLXmlTreeNode* mCurrent;
- BOOL mDump; // Dump parse tree to llinfos as it is read.
+ BOOL mDump; // Dump parse tree to LL_INFOS() as it is read.
BOOL mKeepContents;
};
diff --git a/indra/lscript/lscript_compile/indra.l b/indra/lscript/lscript_compile/indra.l
index 88dfc2e9f3..7772c95609 100755
--- a/indra/lscript/lscript_compile/indra.l
+++ b/indra/lscript/lscript_compile/indra.l
@@ -25,7 +25,6 @@ FS (f|F)
#include "indra.y.hpp"
#include "lltimer.h"
#include "indra_constants.h"
-#include "llagentconstants.h"
#include "lllslconstants.h"
#include "lluuid.h"
#include "llassetstorage.h"
@@ -648,7 +647,8 @@ int yyerror(const char *fmt, ...);
"REGION_FLAG_SANDBOX" { count(); yylval.ival = REGION_FLAGS_SANDBOX; return(INTEGER_CONSTANT); }
"REGION_FLAG_DISABLE_COLLISIONS" { count(); yylval.ival = REGION_FLAGS_SKIP_COLLISIONS; return(INTEGER_CONSTANT); }
"REGION_FLAG_DISABLE_PHYSICS" { count(); yylval.ival = REGION_FLAGS_SKIP_PHYSICS; return(INTEGER_CONSTANT); }
-"REGION_FLAG_BLOCK_FLY" { count(); yylval.ival = REGION_FLAGS_BLOCK_FLY; return(INTEGER_CONSTANT); }
+"REGION_FLAG_BLOCK_FLY" { count(); yylval.ival = REGION_FLAGS_BLOCK_FLY; return(INTEGER_CONSTANT); }
+"REGION_FLAG_BLOCK_FLYOVER" { count(); yylval.ival = REGION_FLAGS_BLOCK_FLYOVER; return(INTEGER_CONSTANT); }
"REGION_FLAG_ALLOW_DIRECT_TELEPORT" { count(); yylval.ival = REGION_FLAGS_ALLOW_DIRECT_TELEPORT; return(INTEGER_CONSTANT); }
"REGION_FLAG_RESTRICT_PUSHOBJECT" { count(); yylval.ival = REGION_FLAGS_RESTRICT_PUSHOBJECT; return(INTEGER_CONSTANT); }
diff --git a/indra/lscript/lscript_compile/lscript_bytecode.cpp b/indra/lscript/lscript_compile/lscript_bytecode.cpp
index 95b2f35a94..667e5dafc1 100755
--- a/indra/lscript/lscript_compile/lscript_bytecode.cpp
+++ b/indra/lscript/lscript_compile/lscript_bytecode.cpp
@@ -40,8 +40,8 @@ LLScriptJumpTable::LLScriptJumpTable()
LLScriptJumpTable::~LLScriptJumpTable()
{
- mLabelMap.deleteAllData();
- mJumpMap.deleteAllData();
+ delete_and_clear(mLabelMap);
+ delete_and_clear(mJumpMap);
}
void LLScriptJumpTable::addLabel(char *name, S32 offset)
@@ -203,17 +203,14 @@ void LLScriptByteCodeChunk::addJump(char *name)
void LLScriptByteCodeChunk::connectJumps()
{
- char *jump;
- S32 offset, jumppos;
-
if (mJumpTable)
{
- for (jump = mJumpTable->mJumpMap.getFirstKey();
- jump;
- jump = mJumpTable->mJumpMap.getNextKey())
+ for(std::map<char *, S32 *>::iterator it = mJumpTable->mJumpMap.begin(), end_it = mJumpTable->mJumpMap.end();
+ it != end_it;
+ ++it)
{
- jumppos = *mJumpTable->mJumpMap[jump];
- offset = *mJumpTable->mLabelMap[jump] - jumppos;
+ S32 jumppos = *it->second;
+ S32 offset = *mJumpTable->mLabelMap[it->first] - jumppos;
jumppos = jumppos - 4;
integer2bytestream(mCodeChunk, jumppos, offset);
}
@@ -308,7 +305,7 @@ void LLScriptScriptCodeChunk::build(LLFILE *efp, LLFILE *bcfp)
if (fwrite(mCompleteCode, 1, mTotalSize, bcfp) != (size_t)mTotalSize)
{
- llwarns << "Short write" << llendl;
+ LL_WARNS() << "Short write" << LL_ENDL;
}
}
else
diff --git a/indra/lscript/lscript_compile/lscript_bytecode.h b/indra/lscript/lscript_compile/lscript_bytecode.h
index 0933c78b6f..1908bebcb9 100755
--- a/indra/lscript/lscript_compile/lscript_bytecode.h
+++ b/indra/lscript/lscript_compile/lscript_bytecode.h
@@ -29,6 +29,7 @@
#include "lscript_byteconvert.h"
#include "lscript_scope.h"
+#include <map>
class LLScriptJumpTable
{
@@ -39,8 +40,8 @@ public:
void addLabel(char *name, S32 offset);
void addJump(char *name, S32 offset);
- LLMap<char *, S32 *> mLabelMap;
- LLMap<char *, S32 *> mJumpMap;
+ std::map<char *, S32 *> mLabelMap;
+ std::map<char *, S32 *> mJumpMap;
};
class LLScriptByteCodeChunk
diff --git a/indra/lscript/lscript_compile/lscript_scope.h b/indra/lscript/lscript_compile/lscript_scope.h
index 5b2a73ad92..ffff91c81b 100755
--- a/indra/lscript/lscript_compile/lscript_scope.h
+++ b/indra/lscript/lscript_compile/lscript_scope.h
@@ -27,8 +27,8 @@
#ifndef LL_LSCRIPT_SCOPE_H
#define LL_LSCRIPT_SCOPE_H
-#include "string_table.h"
-#include "llmap.h"
+#include <map>
+#include "llstringtable.h"
#include "lscript_byteformat.h"
typedef enum e_lscript_identifier_type
@@ -301,13 +301,13 @@ public:
~LLScriptScope()
{
- mEntryMap.deleteAllData();
+ delete_and_clear(mEntryMap);
}
LLScriptScopeEntry *addEntry(const char *identifier, LSCRIPTIdentifierType idtype, LSCRIPTType type)
{
const char *name = mSTable->addString(identifier);
- if (!mEntryMap.checkData(name))
+ if (mEntryMap.find(name) == mEntryMap.end())
{
if (idtype == LIT_FUNCTION)
mEntryMap[name] = new LLScriptScopeEntry(name, idtype, type, mFunctionCount++);
@@ -324,18 +324,10 @@ public:
}
}
- BOOL checkEntry(const char *identifier)
+ bool checkEntry(const char *identifier)
{
const char *name = mSTable->addString(identifier);
- if (mEntryMap.checkData(name))
- {
- return TRUE;
- }
- else
- {
- // identifier already exists at this scope
- return FALSE;
- }
+ return mEntryMap.find(name) != mEntryMap.end();
}
LLScriptScopeEntry *findEntry(const char *identifier)
@@ -345,10 +337,11 @@ public:
while (scope)
{
- if (scope->mEntryMap.checkData(name))
+ entry_map_t::iterator found_it = mEntryMap.find(name);
+ if (found_it != mEntryMap.end())
{
// cool, we found it at this scope
- return scope->mEntryMap[name];
+ return found_it->second;
}
scope = scope->mParentScope;
}
@@ -362,24 +355,25 @@ public:
while (scope)
{
- if (scope->mEntryMap.checkData(name))
+ entry_map_t::iterator found_it = scope->mEntryMap.find(name);
+ if (found_it != scope->mEntryMap.end())
{
// need to check type, and if type is function we need to check both types
if (idtype == LIT_FUNCTION)
{
- if (scope->mEntryMap[name]->mIDType == LIT_FUNCTION)
+ if (found_it->second->mIDType == LIT_FUNCTION)
{
- return scope->mEntryMap[name];
+ return (found_it->second);
}
- else if (scope->mEntryMap[name]->mIDType == LIT_LIBRARY_FUNCTION)
+ else if (found_it->second->mIDType == LIT_LIBRARY_FUNCTION)
{
- return scope->mEntryMap[name];
+ return (found_it->second);
}
}
- else if (scope->mEntryMap[name]->mIDType == idtype)
+ else if (found_it->second->mIDType == idtype)
{
// cool, we found it at this scope
- return scope->mEntryMap[name];
+ return (found_it->second);
}
}
scope = scope->mParentScope;
@@ -392,11 +386,12 @@ public:
mParentScope = scope;
}
- LLMap<const char *, LLScriptScopeEntry *> mEntryMap;
- LLScriptScope *mParentScope;
- LLStringTable *mSTable;
- S32 mFunctionCount;
- S32 mStateCount;
+ typedef std::map<const char *, LLScriptScopeEntry *> entry_map_t;
+ entry_map_t mEntryMap;
+ LLScriptScope* mParentScope;
+ LLStringTable* mSTable;
+ S32 mFunctionCount;
+ S32 mStateCount;
};
extern LLStringTable *gScopeStringTable;
diff --git a/indra/lscript/lscript_compile/lscript_tree.h b/indra/lscript/lscript_compile/lscript_tree.h
index bf29f44518..047c220b17 100755
--- a/indra/lscript/lscript_compile/lscript_tree.h
+++ b/indra/lscript/lscript_compile/lscript_tree.h
@@ -29,7 +29,6 @@
#include "v3math.h"
#include "llquaternion.h"
-#include "linked_lists.h"
#include "lscript_error.h"
#include "lscript_typecheck.h"
#include "lscript_byteformat.h"
@@ -2304,20 +2303,20 @@ public:
LLScriptAllocationManager() {}
~LLScriptAllocationManager()
{
- mAllocationList.deleteAllData();
+ deleteAllocations();
}
void addAllocation(LLScriptFilePosition *ptr)
{
- mAllocationList.addData(ptr);
+ mAllocationList.push_front(ptr);
}
void deleteAllocations()
{
- mAllocationList.deleteAllData();
+ delete_and_clear(mAllocationList);
}
- LLLinkedList<LLScriptFilePosition> mAllocationList;
+ std::list<LLScriptFilePosition*> mAllocationList;
};
extern LLScriptAllocationManager *gAllocationManager;
diff --git a/indra/lscript/lscript_execute.h b/indra/lscript/lscript_execute.h
index fc491ead0f..576c2ca2b7 100755
--- a/indra/lscript/lscript_execute.h
+++ b/indra/lscript/lscript_execute.h
@@ -27,9 +27,10 @@
#ifndef LL_LSCRIPT_EXECUTE_H
#define LL_LSCRIPT_EXECUTE_H
+#include "stdtypes.h"
#include "lscript_byteconvert.h"
-#include "linked_lists.h"
#include "lscript_library.h"
+#include "llstl.h"
class LLTimer;
@@ -262,7 +263,7 @@ public:
S32 i, number = bytestream2integer(src, offset);
for (i = 0; i < number; i++)
{
- mEventDataList.addData(new LLScriptDataCollection(src, offset));
+ mEventDataList.push_front(new LLScriptDataCollection(src, offset));
}
}
@@ -271,32 +272,32 @@ public:
S32 i, number = bytestream2integer(src, offset);
for (i = 0; i < number; i++)
{
- mEventDataList.addData(new LLScriptDataCollection(src, offset));
+ mEventDataList.push_front(new LLScriptDataCollection(src, offset));
}
}
~LLScriptEventData()
{
- mEventDataList.deleteAllData();
+ delete_and_clear(mEventDataList);
}
void addEventData(LLScriptDataCollection *data)
{
- if (mEventDataList.getLength() < MAX_EVENTS_IN_QUEUE)
- mEventDataList.addDataAtEnd(data);
+ if (mEventDataList.size() < MAX_EVENTS_IN_QUEUE)
+ mEventDataList.push_back(data);
else
delete data;
}
LLScriptDataCollection *getNextEvent(LSCRIPTStateEventType type)
{
- LLScriptDataCollection *temp;
- for (temp = mEventDataList.getFirstData();
- temp;
- temp = mEventDataList.getNextData())
+ for (std::list<LLScriptDataCollection*>::iterator it = mEventDataList.begin(), end_it = mEventDataList.end();
+ it != end_it;
+ ++it)
{
+ LLScriptDataCollection* temp = *it;
if (temp->mType == type)
{
- mEventDataList.removeCurrentData();
+ mEventDataList.erase(it);
return temp;
}
}
@@ -305,24 +306,24 @@ public:
LLScriptDataCollection *getNextEvent()
{
LLScriptDataCollection *temp;
- temp = mEventDataList.getFirstData();
+ temp = mEventDataList.front();
if (temp)
{
- mEventDataList.removeCurrentData();
+ mEventDataList.pop_front();
return temp;
}
return NULL;
}
void removeEventType(LSCRIPTStateEventType type)
{
- LLScriptDataCollection *temp;
- for (temp = mEventDataList.getFirstData();
- temp;
- temp = mEventDataList.getNextData())
+ for (std::list<LLScriptDataCollection*>::iterator it = mEventDataList.begin(), end_it = mEventDataList.end();
+ it != end_it;
+ ++it)
{
- if (temp->mType == type)
+ if ((*it)->mType == type)
{
- mEventDataList.deleteCurrentData();
+ delete *it;
+ mEventDataList.erase(it);
}
}
}
@@ -332,12 +333,11 @@ public:
S32 size = 0;
// number in linked list
size += 4;
- LLScriptDataCollection *temp;
- for (temp = mEventDataList.getFirstData();
- temp;
- temp = mEventDataList.getNextData())
+ for (std::list<LLScriptDataCollection*>::iterator it = mEventDataList.begin(), end_it = mEventDataList.end();
+ it != end_it;
+ ++it)
{
- size += temp->getSavedSize();
+ size += (*it)->getSavedSize();
}
return size;
}
@@ -346,19 +346,18 @@ public:
{
S32 offset = 0;
// number in linked list
- S32 number = mEventDataList.getLength();
+ S32 number = mEventDataList.size();
integer2bytestream(dest, offset, number);
- LLScriptDataCollection *temp;
- for (temp = mEventDataList.getFirstData();
- temp;
- temp = mEventDataList.getNextData())
+ for (std::list<LLScriptDataCollection*>::iterator it = mEventDataList.begin(), end_it = mEventDataList.end();
+ it != end_it;
+ ++it)
{
- offset += temp->write2bytestream(dest + offset);
+ offset += (*it)->write2bytestream(dest + offset);
}
return offset;
}
- LLLinkedList<LLScriptDataCollection> mEventDataList;
+ std::list<LLScriptDataCollection*> mEventDataList;
};
class LLScriptExecute
@@ -474,9 +473,9 @@ public:
virtual ~LLScriptExecuteLSL2();
virtual S32 getVersion() const {return get_register(mBuffer, LREG_VN);}
- virtual void deleteAllEvents() {mEventData.mEventDataList.deleteAllData();}
+ virtual void deleteAllEvents() {delete_and_clear(mEventData.mEventDataList);}
virtual void addEvent(LLScriptDataCollection* event);
- virtual U32 getEventCount() {return mEventData.mEventDataList.getLength();}
+ virtual U32 getEventCount() {return mEventData.mEventDataList.size();}
virtual void removeEventType(LSCRIPTStateEventType event_type);
virtual S32 getFaults() {return get_register(mBuffer, LREG_FR);}
virtual void setFault(LSCRIPTRunTimeFaults fault) {set_fault(mBuffer, fault);}
diff --git a/indra/lscript/lscript_execute/llscriptresourceconsumer.cpp b/indra/lscript/lscript_execute/llscriptresourceconsumer.cpp
index 55d47b6de2..0ce5eb7dab 100755
--- a/indra/lscript/lscript_execute/llscriptresourceconsumer.cpp
+++ b/indra/lscript/lscript_execute/llscriptresourceconsumer.cpp
@@ -56,7 +56,7 @@ bool LLScriptResourceConsumer::switchScriptResourcePools(LLScriptResourcePool& n
{
if (&new_pool == &LLScriptResourcePool::null)
{
- llwarns << "New pool is null" << llendl;
+ LL_WARNS() << "New pool is null" << LL_ENDL;
}
if (isInPool(new_pool))
diff --git a/indra/lscript/lscript_execute/lscript_execute.cpp b/indra/lscript/lscript_execute/lscript_execute.cpp
index b12d2e4a16..5eb7ffc5a9 100755
--- a/indra/lscript/lscript_execute/lscript_execute.cpp
+++ b/indra/lscript/lscript_execute/lscript_execute.cpp
@@ -35,7 +35,6 @@
#include "lscript_library.h"
#include "lscript_heapruntime.h"
#include "lscript_alloc.h"
-#include "llstat.h"
// Static
@@ -77,7 +76,7 @@ LLScriptExecuteLSL2::LLScriptExecuteLSL2(LLFILE *fp)
S32 pos = 0;
if (fread(&sizearray, 1, 4, fp) != 4)
{
- llwarns << "Short read" << llendl;
+ LL_WARNS() << "Short read" << LL_ENDL;
filesize = 0;
} else {
filesize = bytestream2integer(sizearray, pos);
@@ -86,7 +85,7 @@ LLScriptExecuteLSL2::LLScriptExecuteLSL2(LLFILE *fp)
fseek(fp, 0, SEEK_SET);
if (fread(mBuffer, 1, filesize, fp) != filesize)
{
- llwarns << "Short read" << llendl;
+ LL_WARNS() << "Short read" << LL_ENDL;
}
fclose(fp);
@@ -290,7 +289,7 @@ void LLScriptExecuteLSL2::init()
void LLScriptExecuteLSL2::recordBoundaryError( const LLUUID &id )
{
set_fault(mBuffer, LSRF_BOUND_CHECK_ERROR);
- llwarns << "Script boundary error for ID " << id << llendl;
+ LL_WARNS() << "Script boundary error for ID " << id << LL_ENDL;
}
@@ -418,10 +417,13 @@ void LLScriptExecuteLSL2::callEventHandler(LSCRIPTStateEventType event, const LL
void LLScriptExecuteLSL2::callQueuedEventHandler(LSCRIPTStateEventType event, const LLUUID &id, F32 time_slice)
{
S32 major_version = getMajorVersion();
- LLScriptDataCollection* eventdata;
- for (eventdata = mEventData.mEventDataList.getFirstData(); eventdata; eventdata = mEventData.mEventDataList.getNextData())
+ for (std::list<LLScriptDataCollection*>::iterator it = mEventData.mEventDataList.begin(), end_it = mEventData.mEventDataList.end();
+ it != end_it;
+ ++it)
{
+ LLScriptDataCollection* eventdata = *it;
+
if (eventdata->mType == event)
{
// push a zero to be popped
@@ -459,7 +461,8 @@ void LLScriptExecuteLSL2::callQueuedEventHandler(LSCRIPTStateEventType event, co
S32 opcode_start = get_state_event_opcoode_start(mBuffer, current_state, event);
set_ip(mBuffer, opcode_start);
- mEventData.mEventDataList.deleteCurrentData();
+ delete *it;
+ mEventData.mEventDataList.erase(it);
break;
}
}
@@ -514,7 +517,7 @@ void LLScriptExecuteLSL2::callNextQueuedEventHandler(U64 event_register, const L
}
else
{
- llwarns << "Somehow got an event that we're not registered for!" << llendl;
+ LL_WARNS() << "Somehow got an event that we're not registered for!" << LL_ENDL;
}
delete eventdata;
}
@@ -622,7 +625,7 @@ S32 LLScriptExecuteLSL2::writeState(U8 **dest, U32 header_size, U32 footer_size)
// registers
integer2bytestream(*dest, dest_offset, registers_size);
- // llinfos << "Writing CE: " << getCurrentEvents() << llendl;
+ // LL_INFOS() << "Writing CE: " << getCurrentEvents() << LL_ENDL;
bytestream2bytestream(*dest, dest_offset, mBuffer, src_offset, registers_size);
// heap
@@ -674,11 +677,11 @@ S32 LLScriptExecuteLSL2::readState(U8 *src)
// copy data into register area
bytestream2bytestream(mBuffer, dest_offset, src, src_offset, size);
-// llinfos << "Read CE: " << getCurrentEvents() << llendl;
+// LL_INFOS() << "Read CE: " << getCurrentEvents() << LL_ENDL;
if (get_register(mBuffer, LREG_TM) != TOP_OF_MEMORY)
{
- llwarns << "Invalid state. Top of memory register does not match"
- << " constant." << llendl;
+ LL_WARNS() << "Invalid state. Top of memory register does not match"
+ << " constant." << LL_ENDL;
reset_hp_to_safe_spot(mBuffer);
return -1;
}
@@ -4021,7 +4024,7 @@ void lscript_run(const std::string& filename, BOOL b_debug)
if (filename.empty())
{
- llerrs << "filename is NULL" << llendl;
+ LL_ERRS() << "filename is NULL" << LL_ENDL;
// Just reporting error is likely not enough. Need
// to check how to abort or error out gracefully
// from this function. XXXTBD
@@ -4046,8 +4049,8 @@ void lscript_run(const std::string& filename, BOOL b_debug)
F32 time = timer.getElapsedTimeF32();
F32 ips = execute->mInstructionCount / time;
- llinfos << execute->mInstructionCount << " instructions in " << time << " seconds" << llendl;
- llinfos << ips/1000 << "K instructions per second" << llendl;
+ LL_INFOS() << execute->mInstructionCount << " instructions in " << time << " seconds" << LL_ENDL;
+ LL_INFOS() << ips/1000 << "K instructions per second" << LL_ENDL;
printf("ip: 0x%X\n", get_register(execute->mBuffer, LREG_IP));
printf("sp: 0x%X\n", get_register(execute->mBuffer, LREG_SP));
printf("bp: 0x%X\n", get_register(execute->mBuffer, LREG_BP));
diff --git a/indra/lscript/lscript_execute/lscript_readlso.cpp b/indra/lscript/lscript_execute/lscript_readlso.cpp
index 6384a57100..7ec56c2409 100755
--- a/indra/lscript/lscript_execute/lscript_readlso.cpp
+++ b/indra/lscript/lscript_execute/lscript_readlso.cpp
@@ -37,7 +37,7 @@ LLScriptLSOParse::LLScriptLSOParse(LLFILE *fp)
S32 pos = 0;
if (fread(&sizearray, 1, 4, fp) != 4)
{
- llwarns << "Short read" << llendl;
+ LL_WARNS() << "Short read" << LL_ENDL;
filesize = 0;
} else {
filesize = bytestream2integer(sizearray, pos);
@@ -46,7 +46,7 @@ LLScriptLSOParse::LLScriptLSOParse(LLFILE *fp)
fseek(fp, 0, SEEK_SET);
if (fread(mRawData, 1, filesize, fp) != filesize)
{
- llwarns << "Short read" << llendl;
+ LL_WARNS() << "Short read" << LL_ENDL;
}
initOpCodePrinting();
diff --git a/indra/lscript/lscript_execute/lscript_readlso.h b/indra/lscript/lscript_execute/lscript_readlso.h
index a545a9daf8..f3b2b66746 100755
--- a/indra/lscript/lscript_execute/lscript_readlso.h
+++ b/indra/lscript/lscript_execute/lscript_readlso.h
@@ -28,7 +28,6 @@
#define LL_LSCRIPT_READLSO_H
#include "lscript_byteconvert.h"
-#include "linked_lists.h"
// list of op code print functions
void print_noop(LLFILE *fp, U8 *buffer, S32 &offset, S32 tabs);
diff --git a/indra/lscript/lscript_library.h b/indra/lscript/lscript_library.h
index 89a473a627..f3dbb09196 100755
--- a/indra/lscript/lscript_library.h
+++ b/indra/lscript/lscript_library.h
@@ -240,7 +240,7 @@ public:
mKey = new char[strlen(data.mKey) + 1]; /* Flawfinder: ignore */
if (mKey == NULL)
{
- llerrs << "Memory Allocation Failed" << llendl;
+ LL_ERRS() << "Memory Allocation Failed" << LL_ENDL;
return;
}
strcpy(mKey, data.mKey); /* Flawfinder: ignore */
@@ -250,7 +250,7 @@ public:
mString = new char[strlen(data.mString) + 1]; /* Flawfinder: ignore */
if (mString == NULL)
{
- llerrs << "Memory Allocation Failed" << llendl;
+ LL_ERRS() << "Memory Allocation Failed" << LL_ENDL;
return;
}
strcpy(mString, data.mString); /* Flawfinder: ignore */
@@ -275,7 +275,7 @@ public:
mKey = new char[strlen(temp) + 1]; /* Flawfinder: ignore */
if (mKey == NULL)
{
- llerrs << "Memory Allocation Failed" << llendl;
+ LL_ERRS() << "Memory Allocation Failed" << LL_ENDL;
return;
}
strcpy(mKey, temp); /* Flawfinder: ignore */
@@ -287,7 +287,7 @@ public:
mString = new char[strlen(temp) + 1]; /* Flawfinder: ignore */
if (mString == NULL)
{
- llerrs << "Memory Allocation Failed" << llendl;
+ LL_ERRS() << "Memory Allocation Failed" << LL_ENDL;
return;
}
strcpy(mString, temp); /* Flawfinder: ignore */
@@ -324,7 +324,7 @@ public:
mKey = new char[strlen(temp) + 1]; /* Flawfinder: ignore */
if (mKey == NULL)
{
- llerrs << "Memory Allocation Failed" << llendl;
+ LL_ERRS() << "Memory Allocation Failed" << LL_ENDL;
return;
}
strcpy(mKey, temp); /* Flawfinder: ignore */
@@ -336,7 +336,7 @@ public:
mString = new char[strlen(temp) + 1]; /* Flawfinder: ignore */
if (mString == NULL)
{
- llerrs << "Memory Allocation Failed" << llendl;
+ LL_ERRS() << "Memory Allocation Failed" << LL_ENDL;
return;
}
strcpy(mString, temp); /* Flawfinder: ignore */
@@ -364,7 +364,7 @@ public:
mString = new char[strlen(src) + 1]; /* Flawfinder: ignore */
if (mString == NULL)
{
- llerrs << "Memory Allocation Failed" << llendl;
+ LL_ERRS() << "Memory Allocation Failed" << LL_ENDL;
return;
}
strcpy(mString, src); /* Flawfinder: ignore */
@@ -398,7 +398,7 @@ public:
mString = new char[strlen(string) + 1]; /* Flawfinder: ignore */
if (mString == NULL)
{
- llerrs << "Memory Allocation Failed" << llendl;
+ LL_ERRS() << "Memory Allocation Failed" << LL_ENDL;
return;
}
strcpy(mString, string); /* Flawfinder: ignore */
diff --git a/indra/lscript/lscript_library/lscript_alloc.cpp b/indra/lscript/lscript_library/lscript_alloc.cpp
index 92b1ab70fb..62ba029e8a 100755
--- a/indra/lscript/lscript_library/lscript_alloc.cpp
+++ b/indra/lscript/lscript_library/lscript_alloc.cpp
@@ -435,7 +435,7 @@ S32 lsa_create_data_block(U8 **buffer, LLScriptLibData *data, S32 base_offset)
U8 *tbuff = new U8[size + listsize];
if (tbuff == NULL)
{
- llerrs << "Memory Allocation Failed" << llendl;
+ LL_ERRS() << "Memory Allocation Failed" << LL_ENDL;
}
memcpy(tbuff, *buffer, size); /*Flawfinder: ignore*/
memcpy(tbuff + size, listbuf, listsize); /*Flawfinder: ignore*/
diff --git a/indra/lscript/lscript_library/lscript_library.cpp b/indra/lscript/lscript_library/lscript_library.cpp
index 7ffe53a307..84ce94eead 100755
--- a/indra/lscript/lscript_library/lscript_library.cpp
+++ b/indra/lscript/lscript_library/lscript_library.cpp
@@ -498,7 +498,7 @@ void LLScriptLibrary::assignExec(const char *name, void (*exec_func)(LLScriptLib
}
}
- llerrs << "Unknown LSL function in assignExec: " << name << llendl;
+ LL_ERRS() << "Unknown LSL function in assignExec: " << name << LL_ENDL;
}
void LLScriptLibData::print(std::ostream &s, BOOL b_prepend_comma)
diff --git a/indra/mac_crash_logger/mac_crash_logger.cpp b/indra/mac_crash_logger/mac_crash_logger.cpp
index 2c83f3439d..d6b913829e 100755
--- a/indra/mac_crash_logger/mac_crash_logger.cpp
+++ b/indra/mac_crash_logger/mac_crash_logger.cpp
@@ -46,7 +46,7 @@ int main(int argc, char **argv)
if (! app.init())
{
- llwarns << "Unable to initialize application." << llendl;
+ LL_WARNS() << "Unable to initialize application." << LL_ENDL;
return 1;
}
if (app.getCrashBehavior() != CRASH_BEHAVIOR_ALWAYS_SEND)
@@ -56,7 +56,7 @@ int main(int argc, char **argv)
app.mainLoop();
app.cleanup();
- llinfos << "Crash reporter finished normally." << llendl;
+ LL_INFOS() << "Crash reporter finished normally." << LL_ENDL;
return 0;
}
diff --git a/indra/mac_updater/mac_updater.cpp b/indra/mac_updater/mac_updater.cpp
deleted file mode 100644
index f533d47b18..0000000000
--- a/indra/mac_updater/mac_updater.cpp
+++ /dev/null
@@ -1,1266 +0,0 @@
-/**
- * @file mac_updater.cpp
- * @brief
- *
- * $LicenseInfo:firstyear=2006&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "linden_common.h"
-
-#include <boost/format.hpp>
-
-#include <libgen.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include <curl/curl.h>
-#include <pthread.h>
-
-#include "llerror.h"
-#include "lltimer.h"
-#include "lldir.h"
-#include "llfile.h"
-
-#include "llstring.h"
-
-#include <Carbon/Carbon.h>
-
-#include "llerrorcontrol.h"
-
-#if LL_DARWIN
-// FSPathMakeRef, FSObjectCopy, deprecations...
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#endif
-
-enum
-{
- kEventClassCustom = 'Cust',
- kEventCustomProgress = 'Prog',
- kEventParamCustomCurValue = 'Cur ',
- kEventParamCustomMaxValue = 'Max ',
- kEventParamCustomText = 'Text',
- kEventCustomDone = 'Done',
-};
-
-WindowRef gWindow = NULL;
-EventHandlerRef gEventHandler = NULL;
-OSStatus gFailure = noErr;
-Boolean gCancelled = false;
-
-const char *gUpdateURL;
-const char *gProductName;
-const char *gBundleID;
-const char *gDmgFile;
-const char *gMarkerPath;
-
-void *updatethreadproc(void*);
-
-pthread_t updatethread;
-
-OSStatus setProgress(int cur, int max)
-{
- OSStatus err;
- ControlRef progressBar = NULL;
- ControlID id;
-
- id.signature = 'prog';
- id.id = 0;
-
- err = GetControlByID(gWindow, &id, &progressBar);
- if(err == noErr)
- {
- Boolean indeterminate;
-
- if(max == 0)
- {
- indeterminate = true;
- err = SetControlData(progressBar, kControlEntireControl, kControlProgressBarIndeterminateTag, sizeof(Boolean), (Ptr)&indeterminate);
- }
- else
- {
- double percentage = (double)cur / (double)max;
- SetControlMinimum(progressBar, 0);
- SetControlMaximum(progressBar, 100);
- SetControlValue(progressBar, (SInt16)(percentage * 100));
-
- indeterminate = false;
- err = SetControlData(progressBar, kControlEntireControl, kControlProgressBarIndeterminateTag, sizeof(Boolean), (Ptr)&indeterminate);
-
- Draw1Control(progressBar);
- }
- }
-
- return(err);
-}
-
-OSStatus setProgressText(CFStringRef text)
-{
- OSStatus err;
- ControlRef progressText = NULL;
- ControlID id;
-
- id.signature = 'what';
- id.id = 0;
-
- err = GetControlByID(gWindow, &id, &progressText);
- if(err == noErr)
- {
- err = SetControlData(progressText, kControlEntireControl, kControlStaticTextCFStringTag, sizeof(CFStringRef), (Ptr)&text);
- Draw1Control(progressText);
- }
-
- return(err);
-}
-
-OSStatus sendProgress(long cur, long max, CFStringRef text = NULL)
-{
- OSStatus result;
- EventRef evt;
-
- result = CreateEvent(
- NULL,
- kEventClassCustom,
- kEventCustomProgress,
- 0,
- kEventAttributeNone,
- &evt);
-
- // This event needs to be targeted at the window so it goes to the window's handler.
- if(result == noErr)
- {
- EventTargetRef target = GetWindowEventTarget(gWindow);
- result = SetEventParameter (
- evt,
- kEventParamPostTarget,
- typeEventTargetRef,
- sizeof(target),
- &target);
- }
-
- if(result == noErr)
- {
- result = SetEventParameter (
- evt,
- kEventParamCustomCurValue,
- typeLongInteger,
- sizeof(cur),
- &cur);
- }
-
- if(result == noErr)
- {
- result = SetEventParameter (
- evt,
- kEventParamCustomMaxValue,
- typeLongInteger,
- sizeof(max),
- &max);
- }
-
- if(result == noErr)
- {
- if(text != NULL)
- {
- result = SetEventParameter (
- evt,
- kEventParamCustomText,
- typeCFStringRef,
- sizeof(text),
- &text);
- }
- }
-
- if(result == noErr)
- {
- // Send the event
- PostEventToQueue(
- GetMainEventQueue(),
- evt,
- kEventPriorityStandard);
-
- }
-
- return(result);
-}
-
-OSStatus sendDone(void)
-{
- OSStatus result;
- EventRef evt;
-
- result = CreateEvent(
- NULL,
- kEventClassCustom,
- kEventCustomDone,
- 0,
- kEventAttributeNone,
- &evt);
-
- // This event needs to be targeted at the window so it goes to the window's handler.
- if(result == noErr)
- {
- EventTargetRef target = GetWindowEventTarget(gWindow);
- result = SetEventParameter (
- evt,
- kEventParamPostTarget,
- typeEventTargetRef,
- sizeof(target),
- &target);
- }
-
- if(result == noErr)
- {
- // Send the event
- PostEventToQueue(
- GetMainEventQueue(),
- evt,
- kEventPriorityStandard);
-
- }
-
- return(result);
-}
-
-OSStatus dialogHandler(EventHandlerCallRef handler, EventRef event, void *userdata)
-{
- OSStatus result = eventNotHandledErr;
- OSStatus err;
- UInt32 evtClass = GetEventClass(event);
- UInt32 evtKind = GetEventKind(event);
-
- if((evtClass == kEventClassCommand) && (evtKind == kEventCommandProcess))
- {
- HICommand cmd;
- err = GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL, sizeof(cmd), NULL, &cmd);
-
- if(err == noErr)
- {
- switch(cmd.commandID)
- {
- case kHICommandCancel:
- gCancelled = true;
-// QuitAppModalLoopForWindow(gWindow);
- result = noErr;
- break;
- }
- }
- }
- else if((evtClass == kEventClassCustom) && (evtKind == kEventCustomProgress))
- {
- // Request to update the progress dialog
- long cur = 0;
- long max = 0;
- CFStringRef text = NULL;
- (void) GetEventParameter(event, kEventParamCustomCurValue, typeLongInteger, NULL, sizeof(cur), NULL, &cur);
- (void) GetEventParameter(event, kEventParamCustomMaxValue, typeLongInteger, NULL, sizeof(max), NULL, &max);
- (void) GetEventParameter(event, kEventParamCustomText, typeCFStringRef, NULL, sizeof(text), NULL, &text);
-
- err = setProgress(cur, max);
- if(err == noErr)
- {
- if(text != NULL)
- {
- setProgressText(text);
- }
- }
-
- result = noErr;
- }
- else if((evtClass == kEventClassCustom) && (evtKind == kEventCustomDone))
- {
- // We're done. Exit the modal loop.
- QuitAppModalLoopForWindow(gWindow);
- result = noErr;
- }
-
- return(result);
-}
-
-#if 0
-size_t curl_download_callback(void *data, size_t size, size_t nmemb,
- void *user_data)
-{
- S32 bytes = size * nmemb;
- char *cdata = (char *) data;
- for (int i =0; i < bytes; i += 1)
- {
- gServerResponse.append(cdata[i]);
- }
- return bytes;
-}
-#endif
-
-int curl_progress_callback_func(void *clientp,
- double dltotal,
- double dlnow,
- double ultotal,
- double ulnow)
-{
- int max = (int)(dltotal / 1024.0);
- int cur = (int)(dlnow / 1024.0);
- sendProgress(cur, max);
-
- if(gCancelled)
- return(1);
-
- return(0);
-}
-
-int parse_args(int argc, char **argv)
-{
- int j;
-
- for (j = 1; j < argc; j++)
- {
- if ((!strcmp(argv[j], "-url")) && (++j < argc))
- {
- gUpdateURL = argv[j];
- }
- else if ((!strcmp(argv[j], "-name")) && (++j < argc))
- {
- gProductName = argv[j];
- }
- else if ((!strcmp(argv[j], "-bundleid")) && (++j < argc))
- {
- gBundleID = argv[j];
- }
- else if ((!strcmp(argv[j], "-dmg")) && (++j < argc))
- {
- gDmgFile = argv[j];
- }
- else if ((!strcmp(argv[j], "-marker")) && (++j < argc))
- {
- gMarkerPath = argv[j];;
- }
- }
-
- return 0;
-}
-
-int main(int argc, char **argv)
-{
- // We assume that all the logs we're looking for reside on the current drive
- gDirUtilp->initAppDirs("SecondLife");
-
- LLError::initForApplication( gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, ""));
-
- // Rename current log file to ".old"
- std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "updater.log.old");
- std::string log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "updater.log");
- LLFile::rename(log_file.c_str(), old_log_file.c_str());
-
- // Set the log file to updater.log
- LLError::logToFile(log_file);
-
- /////////////////////////////////////////
- //
- // Process command line arguments
- //
- gUpdateURL = NULL;
- gProductName = NULL;
- gBundleID = NULL;
- gDmgFile = NULL;
- gMarkerPath = NULL;
- parse_args(argc, argv);
- if ((gUpdateURL == NULL) && (gDmgFile == NULL))
- {
- llinfos << "Usage: mac_updater -url <url> | -dmg <dmg file> [-name <product_name>] [-program <program_name>]" << llendl;
- exit(1);
- }
- else
- {
- llinfos << "Update url is: " << gUpdateURL << llendl;
- if (gProductName)
- {
- llinfos << "Product name is: " << gProductName << llendl;
- }
- else
- {
- gProductName = "Second Life";
- }
- if (gBundleID)
- {
- llinfos << "Bundle ID is: " << gBundleID << llendl;
- }
- else
- {
- gBundleID = "com.secondlife.indra.viewer";
- }
- }
-
- llinfos << "Starting " << gProductName << " Updater" << llendl;
-
- // Real UI...
- OSStatus err;
- IBNibRef nib = NULL;
-
- err = CreateNibReference(CFSTR("AutoUpdater"), &nib);
-
- char windowTitle[MAX_PATH]; /* Flawfinder: ignore */
- snprintf(windowTitle, sizeof(windowTitle), "%s Updater", gProductName);
- CFStringRef windowTitleRef = NULL;
- windowTitleRef = CFStringCreateWithCString(NULL, windowTitle, kCFStringEncodingUTF8);
-
- if(err == noErr)
- {
- err = CreateWindowFromNib(nib, CFSTR("Updater"), &gWindow);
- }
-
- if (err == noErr)
- {
- err = SetWindowTitleWithCFString(gWindow, windowTitleRef);
- }
- CFRelease(windowTitleRef);
-
- if(err == noErr)
- {
- // Set up an event handler for the window.
- EventTypeSpec handlerEvents[] =
- {
- { kEventClassCommand, kEventCommandProcess },
- { kEventClassCustom, kEventCustomProgress },
- { kEventClassCustom, kEventCustomDone }
- };
- InstallStandardEventHandler(GetWindowEventTarget(gWindow));
- InstallWindowEventHandler(
- gWindow,
- NewEventHandlerUPP(dialogHandler),
- GetEventTypeCount (handlerEvents),
- handlerEvents,
- 0,
- &gEventHandler);
- }
-
- if(err == noErr)
- {
- ShowWindow(gWindow);
- SelectWindow(gWindow);
- }
-
- if(err == noErr)
- {
- pthread_create(&updatethread,
- NULL,
- &updatethreadproc,
- NULL);
-
- }
-
- if(err == noErr)
- {
- RunAppModalLoopForWindow(gWindow);
- }
-
- void *threadresult;
-
- pthread_join(updatethread, &threadresult);
-
- if(!gCancelled && (gFailure != noErr))
- {
- // Something went wrong. Since we always just tell the user to download a new version, we don't really care what.
- AlertStdCFStringAlertParamRec params;
- SInt16 retval_mac = 1;
- DialogRef alert = NULL;
- OSStatus err;
-
- params.version = kStdCFStringAlertVersionOne;
- params.movable = false;
- params.helpButton = false;
- params.defaultText = (CFStringRef)kAlertDefaultOKText;
- params.cancelText = 0;
- params.otherText = 0;
- params.defaultButton = 1;
- params.cancelButton = 0;
- params.position = kWindowDefaultPosition;
- params.flags = 0;
-
- err = CreateStandardAlert(
- kAlertStopAlert,
- CFSTR("Error"),
- CFSTR("An error occurred while updating Second Life. Please download the latest version from www.secondlife.com."),
- &params,
- &alert);
-
- if(err == noErr)
- {
- err = RunStandardAlert(
- alert,
- NULL,
- &retval_mac);
- }
-
- if(gMarkerPath != 0)
- {
- // Create a install fail marker that can be used by the viewer to
- // detect install problems.
- std::ofstream stream(gMarkerPath);
- if(stream) stream << -1;
- }
- exit(-1);
- } else {
- exit(0);
- }
-
- if(gWindow != NULL)
- {
- DisposeWindow(gWindow);
- }
-
- if(nib != NULL)
- {
- DisposeNibReference(nib);
- }
-
- return 0;
-}
-
-bool isDirWritable(FSRef &dir)
-{
- bool result = false;
-
- // Test for a writable directory by creating a directory, then deleting it again.
- // This is kinda lame, but will pretty much always give the right answer.
-
- OSStatus err = noErr;
- char temp[PATH_MAX] = ""; /* Flawfinder: ignore */
-
- err = FSRefMakePath(&dir, (UInt8*)temp, sizeof(temp));
-
- if(err == noErr)
- {
- strncat(temp, "/.test_XXXXXX", (sizeof(temp) - strlen(temp)) - 1);
-
- if(mkdtemp(temp) != NULL)
- {
- // We were able to make the directory. This means the directory is writable.
- result = true;
-
- // Clean up.
- rmdir(temp);
- }
- }
-
-#if 0
- // This seemed like a good idea, but won't tell us if we're on a volume mounted read-only.
- UInt8 perm;
- err = FSGetUserPrivilegesPermissions(&targetParentRef, &perm, NULL);
- if(err == noErr)
- {
- if(perm & kioACUserNoMakeChangesMask)
- {
- // Parent directory isn't writable.
- llinfos << "Target parent directory not writable." << llendl;
- err = -1;
- replacingTarget = false;
- }
- }
-#endif
-
- return result;
-}
-
-static std::string HFSUniStr255_to_utf8str(const HFSUniStr255* src)
-{
- llutf16string string16((U16*)&(src->unicode), src->length);
- std::string result = utf16str_to_utf8str(string16);
- return result;
-}
-
-int restoreObject(const char* aside, const char* target, const char* path, const char* object)
-{
- char source[PATH_MAX] = ""; /* Flawfinder: ignore */
- char dest[PATH_MAX] = ""; /* Flawfinder: ignore */
- snprintf(source, sizeof(source), "%s/%s/%s", aside, path, object);
- snprintf(dest, sizeof(dest), "%s/%s", target, path);
- FSRef sourceRef;
- FSRef destRef;
- OSStatus err;
- err = FSPathMakeRef((UInt8 *)source, &sourceRef, NULL);
- if(err != noErr) return false;
- err = FSPathMakeRef((UInt8 *)dest, &destRef, NULL);
- if(err != noErr) return false;
-
- llinfos << "Copying " << source << " to " << dest << llendl;
-
- err = FSCopyObjectSync(
- &sourceRef,
- &destRef,
- NULL,
- NULL,
- kFSFileOperationOverwrite);
-
- if(err != noErr) return false;
- return true;
-}
-
-// Replace any mention of "Second Life" with the product name.
-void filterFile(const char* filename)
-{
- char temp[PATH_MAX] = ""; /* Flawfinder: ignore */
- // First copy the target's version, so we can run it through sed.
- snprintf(temp, sizeof(temp), "cp '%s' '%s.tmp'", filename, filename);
- system(temp); /* Flawfinder: ignore */
-
- // Now run it through sed.
- snprintf(temp, sizeof(temp),
- "sed 's/Second Life/%s/g' '%s.tmp' > '%s'", gProductName, filename, filename);
- system(temp); /* Flawfinder: ignore */
-}
-
-static bool isFSRefViewerBundle(FSRef *targetRef)
-{
- bool result = false;
- CFURLRef targetURL = NULL;
- CFBundleRef targetBundle = NULL;
- CFStringRef targetBundleID = NULL;
- CFStringRef sourceBundleID = NULL;
-
- targetURL = CFURLCreateFromFSRef(NULL, targetRef);
-
- if(targetURL == NULL)
- {
- llinfos << "Error creating target URL." << llendl;
- }
- else
- {
- targetBundle = CFBundleCreate(NULL, targetURL);
- }
-
- if(targetBundle == NULL)
- {
- llinfos << "Failed to create target bundle." << llendl;
- }
- else
- {
- targetBundleID = CFBundleGetIdentifier(targetBundle);
- }
-
- if(targetBundleID == NULL)
- {
- llinfos << "Couldn't retrieve target bundle ID." << llendl;
- }
- else
- {
- sourceBundleID = CFStringCreateWithCString(NULL, gBundleID, kCFStringEncodingUTF8);
- if(CFStringCompare(sourceBundleID, targetBundleID, 0) == kCFCompareEqualTo)
- {
- // This is the bundle we're looking for.
- result = true;
- }
- else
- {
- llinfos << "Target bundle ID mismatch." << llendl;
- }
- }
-
- // Don't release targetBundleID -- since we don't retain it, it's released when targetBundle is released.
- if(targetURL != NULL)
- CFRelease(targetURL);
- if(targetBundle != NULL)
- CFRelease(targetBundle);
-
- return result;
-}
-
-// Search through the directory specified by 'parent' for an item that appears to be a Second Life viewer.
-static OSErr findAppBundleOnDiskImage(FSRef *parent, FSRef *app)
-{
- FSIterator iterator;
- bool found = false;
-
- OSErr err = FSOpenIterator( parent, kFSIterateFlat, &iterator );
- if(!err)
- {
- do
- {
- ItemCount actualObjects = 0;
- Boolean containerChanged = false;
- FSCatalogInfo info;
- FSRef ref;
- HFSUniStr255 unicodeName;
- err = FSGetCatalogInfoBulk(
- iterator,
- 1,
- &actualObjects,
- &containerChanged,
- kFSCatInfoNodeFlags,
- &info,
- &ref,
- NULL,
- &unicodeName );
-
- if(actualObjects == 0)
- break;
-
- if(!err)
- {
- // Call succeeded and not done with the iteration.
- std::string name = HFSUniStr255_to_utf8str(&unicodeName);
-
- llinfos << "Considering \"" << name << "\"" << llendl;
-
- if(info.nodeFlags & kFSNodeIsDirectoryMask)
- {
- // This is a directory. See if it's a .app
- if(name.find(".app") != std::string::npos)
- {
- // Looks promising. Check to see if it has the right bundle identifier.
- if(isFSRefViewerBundle(&ref))
- {
- llinfos << name << " is the one" << llendl;
- // This is the one. Return it.
- *app = ref;
- found = true;
- break;
- } else {
- llinfos << name << " is not the bundle we are looking for; move along" << llendl;
- }
-
- }
- }
- }
- }
- while(!err);
-
- llinfos << "closing the iterator" << llendl;
-
- FSCloseIterator(iterator);
-
- llinfos << "closed" << llendl;
- }
-
- if(!err && !found)
- err = fnfErr;
-
- return err;
-}
-
-void *updatethreadproc(void*)
-{
- char tempDir[PATH_MAX] = ""; /* Flawfinder: ignore */
- FSRef tempDirRef;
- char temp[PATH_MAX] = ""; /* Flawfinder: ignore */
- // *NOTE: This buffer length is used in a scanf() below.
- char deviceNode[1024] = ""; /* Flawfinder: ignore */
- LLFILE *downloadFile = NULL;
- OSStatus err;
- ProcessSerialNumber psn;
- char target[PATH_MAX] = ""; /* Flawfinder: ignore */
- FSRef targetRef;
- FSRef targetParentRef;
- FSVolumeRefNum targetVol;
- FSRef trashFolderRef;
- Boolean replacingTarget = false;
-
- memset(&tempDirRef, 0, sizeof(tempDirRef));
- memset(&targetRef, 0, sizeof(targetRef));
- memset(&targetParentRef, 0, sizeof(targetParentRef));
-
- try
- {
- // Attempt to get a reference to the Second Life application bundle containing this updater.
- // Any failures during this process will cause us to default to updating /Applications/Second Life.app
- {
- FSRef myBundle;
-
- err = GetCurrentProcess(&psn);
- if(err == noErr)
- {
- err = GetProcessBundleLocation(&psn, &myBundle);
- }
-
- if(err == noErr)
- {
- // Sanity check: Make sure the name of the item referenced by targetRef is "Second Life.app".
- FSRefMakePath(&myBundle, (UInt8*)target, sizeof(target));
-
- llinfos << "Updater bundle location: " << target << llendl;
- }
-
- // Our bundle should be in Second Life.app/Contents/Resources/AutoUpdater.app
- // so we need to go up 3 levels to get the path to the main application bundle.
- if(err == noErr)
- {
- err = FSGetCatalogInfo(&myBundle, kFSCatInfoNone, NULL, NULL, NULL, &targetRef);
- }
- if(err == noErr)
- {
- err = FSGetCatalogInfo(&targetRef, kFSCatInfoNone, NULL, NULL, NULL, &targetRef);
- }
- if(err == noErr)
- {
- err = FSGetCatalogInfo(&targetRef, kFSCatInfoNone, NULL, NULL, NULL, &targetRef);
- }
-
- // And once more to get the parent of the target
- if(err == noErr)
- {
- err = FSGetCatalogInfo(&targetRef, kFSCatInfoNone, NULL, NULL, NULL, &targetParentRef);
- }
-
- if(err == noErr)
- {
- FSRefMakePath(&targetRef, (UInt8*)target, sizeof(target));
- llinfos << "Path to target: " << target << llendl;
- }
-
- // Sanity check: make sure the target is a bundle with the right identifier
- if(err == noErr)
- {
- // Assume the worst...
- err = -1;
-
- if(isFSRefViewerBundle(&targetRef))
- {
- // This is the bundle we're looking for.
- err = noErr;
- replacingTarget = true;
- }
- }
-
- // Make sure the target's parent directory is writable.
- if(err == noErr)
- {
- if(!isDirWritable(targetParentRef))
- {
- // Parent directory isn't writable.
- llinfos << "Target parent directory not writable." << llendl;
- err = -1;
- replacingTarget = false;
- }
- }
-
- if(err != noErr)
- {
- Boolean isDirectory;
- llinfos << "Target search failed, defaulting to /Applications/" << gProductName << ".app." << llendl;
-
- // Set up the parent directory
- err = FSPathMakeRef((UInt8*)"/Applications", &targetParentRef, &isDirectory);
- if((err != noErr) || (!isDirectory))
- {
- // We're so hosed.
- llinfos << "Applications directory not found, giving up." << llendl;
- throw 0;
- }
-
- snprintf(target, sizeof(target), "/Applications/%s.app", gProductName);
-
- memset(&targetRef, 0, sizeof(targetRef));
- err = FSPathMakeRef((UInt8*)target, &targetRef, NULL);
- if(err == fnfErr)
- {
- // This is fine, just means we're not replacing anything.
- err = noErr;
- replacingTarget = false;
- }
- else
- {
- replacingTarget = true;
- }
-
- // Make sure the target's parent directory is writable.
- if(err == noErr)
- {
- if(!isDirWritable(targetParentRef))
- {
- // Parent directory isn't writable.
- llinfos << "Target parent directory not writable." << llendl;
- err = -1;
- replacingTarget = false;
- }
- }
-
- }
-
- // If we haven't fixed all problems by this point, just bail.
- if(err != noErr)
- {
- llinfos << "Unable to pick a target, giving up." << llendl;
- throw 0;
- }
- }
-
- // Find the volID of the volume the target resides on
- {
- FSCatalogInfo info;
- err = FSGetCatalogInfo(
- &targetParentRef,
- kFSCatInfoVolume,
- &info,
- NULL,
- NULL,
- NULL);
-
- if(err != noErr)
- throw 0;
-
- targetVol = info.volume;
- }
-
- // Find the temporary items and trash folders on that volume.
- err = FSFindFolder(
- targetVol,
- kTrashFolderType,
- true,
- &trashFolderRef);
-
- if(err != noErr)
- throw 0;
-
-#if 0 // *HACK for DEV-11935 see below for details.
-
- FSRef tempFolderRef;
-
- err = FSFindFolder(
- targetVol,
- kTemporaryFolderType,
- true,
- &tempFolderRef);
-
- if(err != noErr)
- throw 0;
-
- err = FSRefMakePath(&tempFolderRef, (UInt8*)temp, sizeof(temp));
-
- if(err != noErr)
- throw 0;
-
-#else
-
- // *HACK for DEV-11935 the above kTemporaryFolderType query was giving
- // back results with path names that seem to be too long to be used as
- // mount points. I suspect this incompatibility was introduced in the
- // Leopard 10.5.2 update, but I have not verified this.
- char const HARDCODED_TMP[] = "/tmp";
- strncpy(temp, HARDCODED_TMP, sizeof(HARDCODED_TMP));
-
-#endif // 0 *HACK for DEV-11935
-
- // Skip downloading the file if the dmg was passed on the command line.
- std::string dmgName;
- if(gDmgFile != NULL) {
- dmgName = basename((char *)gDmgFile);
- char * dmgDir = dirname((char *)gDmgFile);
- strncpy(tempDir, dmgDir, sizeof(tempDir));
- err = FSPathMakeRef((UInt8*)tempDir, &tempDirRef, NULL);
- if(err != noErr) throw 0;
- chdir(tempDir);
- goto begin_install;
- } else {
- // Continue on to download file.
- dmgName = "SecondLife.dmg";
- }
-
-
- strncat(temp, "/SecondLifeUpdate_XXXXXX", (sizeof(temp) - strlen(temp)) - 1);
- if(mkdtemp(temp) == NULL)
- {
- throw 0;
- }
-
- strncpy(tempDir, temp, sizeof(tempDir));
- temp[sizeof(tempDir) - 1] = '\0';
-
- llinfos << "tempDir is " << tempDir << llendl;
-
- err = FSPathMakeRef((UInt8*)tempDir, &tempDirRef, NULL);
-
- if(err != noErr)
- throw 0;
-
- chdir(tempDir);
-
- snprintf(temp, sizeof(temp), "SecondLife.dmg");
-
- downloadFile = LLFile::fopen(temp, "wb"); /* Flawfinder: ignore */
- if(downloadFile == NULL)
- {
- throw 0;
- }
-
- {
- CURL *curl = curl_easy_init();
-
- curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
- // curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &curl_download_callback);
- curl_easy_setopt(curl, CURLOPT_FILE, downloadFile);
- curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
- curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, &curl_progress_callback_func);
- curl_easy_setopt(curl, CURLOPT_URL, gUpdateURL);
- curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
-
- sendProgress(0, 1, CFSTR("Downloading..."));
-
- CURLcode result = curl_easy_perform(curl);
-
- curl_easy_cleanup(curl);
-
- if(gCancelled)
- {
- llinfos << "User cancel, bailing out."<< llendl;
- throw 0;
- }
-
- if(result != CURLE_OK)
- {
- llinfos << "Error " << result << " while downloading disk image."<< llendl;
- throw 0;
- }
-
- fclose(downloadFile);
- downloadFile = NULL;
- }
-
- begin_install:
- sendProgress(0, 0, CFSTR("Mounting image..."));
- LLFile::mkdir("mnt", 0700);
-
- // NOTE: we could add -private at the end of this command line to keep the image from showing up in the Finder,
- // but if our cleanup fails, this makes it much harder for the user to unmount the image.
- std::string mountOutput;
- boost::format cmdFormat("hdiutil attach %s -mountpoint mnt");
- cmdFormat % dmgName;
- FILE* mounter = popen(cmdFormat.str().c_str(), "r"); /* Flawfinder: ignore */
-
- if(mounter == NULL)
- {
- llinfos << "Failed to mount disk image, exiting."<< llendl;
- throw 0;
- }
-
- // We need to scan the output from hdiutil to find the device node it uses to attach the disk image.
- // If we don't have this information, we can't detach it later.
- while(mounter != NULL)
- {
- size_t len = fread(temp, 1, sizeof(temp)-1, mounter);
- temp[len] = 0;
- mountOutput.append(temp);
- if(len < sizeof(temp)-1)
- {
- // End of file or error.
- int result = pclose(mounter);
- if(result != 0)
- {
- // NOTE: We used to abort here, but pclose() started returning
- // -1, possibly when the size of the DMG passed a certain point
- llinfos << "Unexpected result closing pipe: " << result << llendl;
- }
- mounter = NULL;
- }
- }
-
- if(!mountOutput.empty())
- {
- const char *s = mountOutput.c_str();
- const char *prefix = "/dev/";
- char *sub = strstr(s, prefix);
-
- if(sub != NULL)
- {
- sub += strlen(prefix); /* Flawfinder: ignore */
- sscanf(sub, "%1023s", deviceNode); /* Flawfinder: ignore */
- }
- }
-
- if(deviceNode[0] != 0)
- {
- llinfos << "Disk image attached on /dev/" << deviceNode << llendl;
- }
- else
- {
- llinfos << "Disk image device node not found!" << llendl;
- throw 0;
- }
-
- // Get an FSRef to the new application on the disk image
- FSRef sourceRef;
- FSRef mountRef;
- snprintf(temp, sizeof(temp), "%s/mnt", tempDir);
-
- llinfos << "Disk image mount point is: " << temp << llendl;
-
- err = FSPathMakeRef((UInt8 *)temp, &mountRef, NULL);
- if(err != noErr)
- {
- llinfos << "Couldn't make FSRef to disk image mount point." << llendl;
- throw 0;
- }
-
- sendProgress(0, 0, CFSTR("Searching for the app bundle..."));
- err = findAppBundleOnDiskImage(&mountRef, &sourceRef);
- if(err != noErr)
- {
- llinfos << "Couldn't find application bundle on mounted disk image." << llendl;
- throw 0;
- }
- else
- {
- llinfos << "found the bundle." << llendl;
- }
-
- sendProgress(0, 0, CFSTR("Preparing to copy files..."));
-
- FSRef asideRef;
- char aside[MAX_PATH]; /* Flawfinder: ignore */
-
- // this will hold the name of the destination target
- CFStringRef appNameRef;
-
- if(replacingTarget)
- {
- // Get the name of the target we're replacing
- HFSUniStr255 appNameUniStr;
- err = FSGetCatalogInfo(&targetRef, 0, NULL, &appNameUniStr, NULL, NULL);
- if(err != noErr)
- throw 0;
- appNameRef = FSCreateStringFromHFSUniStr(NULL, &appNameUniStr);
-
- // Move aside old version (into work directory)
- err = FSMoveObject(&targetRef, &tempDirRef, &asideRef);
- if(err != noErr)
- {
- llwarns << "failed to move aside old version (error code " <<
- err << ")" << llendl;
- throw 0;
- }
-
- // Grab the path for later use.
- err = FSRefMakePath(&asideRef, (UInt8*)aside, sizeof(aside));
- }
- else
- {
- // Construct the name of the target based on the product name
- char appName[MAX_PATH]; /* Flawfinder: ignore */
- snprintf(appName, sizeof(appName), "%s.app", gProductName);
- appNameRef = CFStringCreateWithCString(NULL, appName, kCFStringEncodingUTF8);
- }
-
- sendProgress(0, 0, CFSTR("Copying files..."));
-
- llinfos << "Starting copy..." << llendl;
-
- // Copy the new version from the disk image to the target location.
- err = FSCopyObjectSync(
- &sourceRef,
- &targetParentRef,
- appNameRef,
- &targetRef,
- kFSFileOperationDefaultOptions);
-
- // Grab the path for later use.
- err = FSRefMakePath(&targetRef, (UInt8*)target, sizeof(target));
- if(err != noErr)
- throw 0;
-
- llinfos << "Copy complete. Target = " << target << llendl;
-
- if(err != noErr)
- {
- // Something went wrong during the copy. Attempt to put the old version back and bail.
- (void)FSDeleteObject(&targetRef);
- if(replacingTarget)
- {
- (void)FSMoveObject(&asideRef, &targetParentRef, NULL);
- }
- throw 0;
- }
- else
- {
- // The update has succeeded. Clear the cache directory.
-
- sendProgress(0, 0, CFSTR("Clearing cache..."));
-
- llinfos << "Clearing cache..." << llendl;
-
- gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,""), "*.*");
-
- llinfos << "Clear complete." << llendl;
-
- }
- }
- catch(...)
- {
- if(!gCancelled)
- if(gFailure == noErr)
- gFailure = -1;
- }
-
- // Failures from here on out are all non-fatal and not reported.
- sendProgress(0, 3, CFSTR("Cleaning up..."));
-
- // Close disk image file if necessary
- if(downloadFile != NULL)
- {
- llinfos << "Closing download file." << llendl;
-
- fclose(downloadFile);
- downloadFile = NULL;
- }
-
- sendProgress(1, 3);
- // Unmount image
- if(deviceNode[0] != 0)
- {
- llinfos << "Detaching disk image." << llendl;
-
- snprintf(temp, sizeof(temp), "hdiutil detach '%s'", deviceNode);
- system(temp); /* Flawfinder: ignore */
- }
-
- sendProgress(2, 3);
-
- // Move work directory to the trash
- if(tempDir[0] != 0)
- {
- llinfos << "Moving work directory to the trash." << llendl;
-
- FSRef trashRef;
- OSStatus err = FSMoveObjectToTrashSync(&tempDirRef, &trashRef, 0);
- if(err != noErr) {
- llwarns << "failed to move files to trash, (error code " <<
- err << ")" << llendl;
- }
- }
-
- if(!gCancelled && !gFailure && (target[0] != 0))
- {
- llinfos << "Touching application bundle." << llendl;
-
- snprintf(temp, sizeof(temp), "touch '%s'", target);
- system(temp); /* Flawfinder: ignore */
-
- llinfos << "Launching updated application." << llendl;
-
- snprintf(temp, sizeof(temp), "open '%s'", target);
- system(temp); /* Flawfinder: ignore */
- }
-
- sendDone();
-
- return(NULL);
-}
-
-#if LL_DARWIN
-#pragma GCC diagnostic warning "-Wdeprecated-declarations"
-#endif
diff --git a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp
index 2dd97a9ba7..ff1ed8bfbc 100755
--- a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp
+++ b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp
@@ -29,25 +29,28 @@
#include "linden_common.h"
#include "llgl.h"
-
+
#include "llplugininstance.h"
#include "llpluginmessage.h"
#include "llpluginmessageclasses.h"
#include "media_plugin_base.h"
-
+
#if LL_QUICKTIME_ENABLED
-
+
#if defined(LL_DARWIN)
- #include <QuickTime/QuickTime.h>
+#include <QuickTime/QuickTime.h>
#elif defined(LL_WINDOWS)
- #include "MacTypes.h"
- #include "QTML.h"
- #include "Movies.h"
- #include "QDoffscreen.h"
- #include "FixMath.h"
- #include "QTLoadLibraryUtils.h"
+#include "llwin32headers.h"
+#include "MacTypes.h"
+#include "QTML.h"
+#include "Movies.h"
+#include "QDoffscreen.h"
+#include "FixMath.h"
+#include "QTLoadLibraryUtils.h"
#endif
+
+
// TODO: Make sure that the only symbol exported from this library is LLPluginInitEntryPoint
////////////////////////////////////////////////////////////////////////////////
//
diff --git a/indra/media_plugins/webkit/CMakeLists.txt b/indra/media_plugins/webkit/CMakeLists.txt
index 0c1c3d800e..5a8fe90bdd 100755
--- a/indra/media_plugins/webkit/CMakeLists.txt
+++ b/indra/media_plugins/webkit/CMakeLists.txt
@@ -121,12 +121,12 @@ if (DARWIN)
)
# copy the webkit dylib to the build directory
- add_custom_command(
- TARGET media_plugin_webkit POST_BUILD
-# OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/libllqtwebkit.dylib
- COMMAND ${CMAKE_COMMAND} -E copy ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/
- DEPENDS media_plugin_webkit ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib
- )
+# add_custom_command(
+# TARGET media_plugin_webkit POST_BUILD
+# # OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/libllqtwebkit.dylib
+# COMMAND ${CMAKE_COMMAND} -E copy ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/
+# DEPENDS media_plugin_webkit ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib
+# )
endif (DARWIN)
diff --git a/indra/media_plugins/webkit/mac_volume_catcher.cpp b/indra/media_plugins/webkit/mac_volume_catcher.cpp
index cc94556413..73e5bf3da3 100755
--- a/indra/media_plugins/webkit/mac_volume_catcher.cpp
+++ b/indra/media_plugins/webkit/mac_volume_catcher.cpp
@@ -37,6 +37,7 @@
#include <QuickTime/QuickTime.h>
#include <AudioUnit/AudioUnit.h>
+#include <list>
#if LL_DARWIN
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp
index 1812abd7d5..3edeef51e3 100755
--- a/indra/media_plugins/webkit/media_plugin_webkit.cpp
+++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp
@@ -220,7 +220,7 @@ private:
char cwd[ FILENAME_MAX ]; // I *think* this is defined on all platforms we use
if (NULL == getcwd( cwd, FILENAME_MAX - 1 ))
{
- llwarns << "Couldn't get cwd - probably too long - failing to init." << llendl;
+ LL_WARNS() << "Couldn't get cwd - probably too long - failing to init." << LL_ENDL;
return false;
}
std::string application_dir = std::string( cwd );
@@ -380,13 +380,13 @@ private:
url << std::setfill('0') << std::setw(2) << std::hex << int(mBackgroundB * 255.0f);
url << "%22%3E%3C/body%3E%3C/html%3E";
- //lldebugs << "data url is: " << url.str() << llendl;
+ //LL_DEBUGS() << "data url is: " << url.str() << LL_ENDL;
// always display loading overlay now
#if LLQTWEBKIT_API_VERSION >= 16
LLQtWebKit::getInstance()->enableLoadingOverlay(mBrowserWindowId, true);
#else
- llwarns << "Ignoring enableLoadingOverlay() call (llqtwebkit version is too old)." << llendl;
+ LL_WARNS() << "Ignoring enableLoadingOverlay() call (llqtwebkit version is too old)." << LL_ENDL;
#endif
str.clear();
str << "Loading overlay enabled = " << mEnableMediaPluginDebugging << " for mBrowserWindowId = " << mBrowserWindowId;
@@ -426,7 +426,7 @@ private:
break;
default:
- llwarns << "Unknown cursor ID: " << (int)llqt_cursor << llendl;
+ LL_WARNS() << "Unknown cursor ID: " << (int)llqt_cursor << LL_ENDL;
break;
}
@@ -1326,7 +1326,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
F32 factor = (F32)message_in.getValueReal("factor");
LLQtWebKit::getInstance()->setPageZoomFactor(factor);
#else
- llwarns << "Ignoring setPageZoomFactor message (llqtwebkit version is too old)." << llendl;
+ LL_WARNS() << "Ignoring setPageZoomFactor message (llqtwebkit version is too old)." << LL_ENDL;
#endif
}
else if(message_name == "clear_cache")
@@ -1405,7 +1405,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
bool val = message_in.getValueBoolean("show");
LLQtWebKit::getInstance()->showWebInspector( val );
#else
- llwarns << "Ignoring showWebInspector message (llqtwebkit version is too old)." << llendl;
+ LL_WARNS() << "Ignoring showWebInspector message (llqtwebkit version is too old)." << LL_ENDL;
#endif
}
else if(message_name == "ignore_ssl_cert_errors")
@@ -1413,7 +1413,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
#if LLQTWEBKIT_API_VERSION >= 3
LLQtWebKit::getInstance()->setIgnoreSSLCertErrors( message_in.getValueBoolean("ignore") );
#else
- llwarns << "Ignoring ignore_ssl_cert_errors message (llqtwebkit version is too old)." << llendl;
+ LL_WARNS() << "Ignoring ignore_ssl_cert_errors message (llqtwebkit version is too old)." << LL_ENDL;
#endif
}
else if(message_name == "add_certificate_file_path")
@@ -1421,7 +1421,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
#if LLQTWEBKIT_API_VERSION >= 6
LLQtWebKit::getInstance()->setCAFile( message_in.getValue("path") );
#else
- llwarns << "Ignoring add_certificate_file_path message (llqtwebkit version is too old)." << llendl;
+ LL_WARNS() << "Ignoring add_certificate_file_path message (llqtwebkit version is too old)." << LL_ENDL;
#endif
}
else if(message_name == "init_history")
diff --git a/indra/media_plugins/winmmshim/winmm_shim.cpp b/indra/media_plugins/winmmshim/winmm_shim.cpp
index 49a1c9dba3..78f7a9b0da 100755
--- a/indra/media_plugins/winmmshim/winmm_shim.cpp
+++ b/indra/media_plugins/winmmshim/winmm_shim.cpp
@@ -39,7 +39,7 @@ BOOL APIENTRY DllMain( HMODULE hModule,
LPVOID lpReserved
)
{
- if (DLL_PROCESS_ATTACH == ul_reason_for_call)
+ if (ul_reason_for_call == DLL_PROCESS_ATTACH)
{
InitializeCriticalSection(&sCriticalSection);
}
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 0bf0152b30..e8f4144e70 100755
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -47,6 +47,8 @@ include(VisualLeakDetector)
include(GLOD)
include(CMakeCopyIfDifferent)
include(LLAppearance)
+include(PNG)
+include(ZLIB)
if (NOT HAVOK_TPV)
# When using HAVOK_TPV, the library is precompiled, so no need for this
@@ -99,6 +101,7 @@ include_directories(SYSTEM
set(viewer_SOURCE_FILES
groupchatlistener.cpp
llaccountingcostmanager.cpp
+ llaisapi.cpp
llagent.cpp
llagentaccess.cpp
llagentcamera.cpp
@@ -109,7 +112,6 @@ set(viewer_SOURCE_FILES
llagentpilot.cpp
llagentui.cpp
llagentwearables.cpp
- llagentwearablesfetch.cpp
llanimstatelabels.cpp
llappcorehttp.cpp
llappearancemgr.cpp
@@ -199,6 +201,7 @@ set(viewer_SOURCE_FILES
llfilteredwearablelist.cpp
llfirstuse.cpp
llflexibleobject.cpp
+ llflickrconnect.cpp
llfloaterabout.cpp
llfloaterbvhpreview.cpp
llfloaterauction.cpp
@@ -207,6 +210,7 @@ set(viewer_SOURCE_FILES
llfloateravatarpicker.cpp
llfloateravatartextures.cpp
llfloaterbeacons.cpp
+ llfloaterbigpreview.cpp
llfloaterbuildoptions.cpp
llfloaterbulkpermission.cpp
llfloaterbump.cpp
@@ -228,10 +232,13 @@ set(viewer_SOURCE_FILES
llfloatereditwater.cpp
llfloaterenvironmentsettings.cpp
llfloaterevent.cpp
+ llfloaterfacebook.cpp
+ llfloaterflickr.cpp
llfloaterfonttest.cpp
llfloatergesture.cpp
llfloatergodtools.cpp
llfloatergotoline.cpp
+ llfloatergroupbulkban.cpp
llfloatergroupinvite.cpp
llfloatergroups.cpp
llfloaterhandler.cpp
@@ -239,6 +246,9 @@ set(viewer_SOURCE_FILES
llfloaterhelpbrowser.cpp
llfloaterhud.cpp
llfloaterimagepreview.cpp
+ llfloaterimsessiontab.cpp
+ llfloaterimsession.cpp
+ llfloaterimcontainer.cpp
llfloaterinspect.cpp
llfloaterinventory.cpp
llfloaterjoystick.cpp
@@ -268,14 +278,15 @@ set(viewer_SOURCE_FILES
llfloaterregioninfo.cpp
llfloaterreporter.cpp
llfloaterregionrestarting.cpp
+ llfloatersceneloadstats.cpp
llfloaterscriptdebug.cpp
+ llfloaterscriptedprefs.cpp
llfloaterscriptlimits.cpp
llfloatersearch.cpp
llfloatersellland.cpp
llfloatersettingsdebug.cpp
llfloatersidepanelcontainer.cpp
llfloatersnapshot.cpp
- llfloatersocial.cpp
llfloatersounddevices.cpp
llfloaterspellchecksettings.cpp
llfloatertelehub.cpp
@@ -287,6 +298,7 @@ set(viewer_SOURCE_FILES
llfloatertos.cpp
llfloatertoybox.cpp
llfloatertranslationsettings.cpp
+ llfloatertwitter.cpp
llfloateruipreview.cpp
llfloaterurlentry.cpp
llfloatervoiceeffect.cpp
@@ -310,6 +322,7 @@ set(viewer_SOURCE_FILES
llhasheduniqueid.cpp
llhints.cpp
llhomelocationresponder.cpp
+ llhttpretrypolicy.cpp
llhudeffect.cpp
llhudeffectbeam.cpp
llhudeffectlookat.cpp
@@ -323,9 +336,7 @@ set(viewer_SOURCE_FILES
llhudrender.cpp
llhudtext.cpp
llhudview.cpp
- llfloaterimsessiontab.cpp
- llfloaterimsession.cpp
- llfloaterimcontainer.cpp
+ llimagefiltersmanager.cpp
llimhandler.cpp
llimview.cpp
llinspect.cpp
@@ -403,6 +414,8 @@ set(viewer_SOURCE_FILES
llpanelface.cpp
llpanelgenerictip.cpp
llpanelgroup.cpp
+ llpanelgroupbulk.cpp
+ llpanelgroupbulkban.cpp
llpanelgroupgeneral.cpp
llpanelgroupinvite.cpp
llpanelgrouplandmoney.cpp
@@ -492,8 +505,10 @@ set(viewer_SOURCE_FILES
llremoteparcelrequest.cpp
llsavedsettingsglue.cpp
llsaveoutfitcombobtn.cpp
+ llscenemonitor.cpp
llsceneview.cpp
llscreenchannel.cpp
+ llscripteditor.cpp
llscriptfloater.cpp
llscrollingpanelparam.cpp
llscrollingpanelparambase.cpp
@@ -523,6 +538,7 @@ set(viewer_SOURCE_FILES
llstylemap.cpp
llsurface.cpp
llsurfacepatch.cpp
+ llsyntaxid.cpp
llsyswellitem.cpp
llsyswellwindow.cpp
llteleporthistory.cpp
@@ -568,6 +584,7 @@ set(viewer_SOURCE_FILES
lltransientdockablefloater.cpp
lltransientfloatermgr.cpp
lltranslate.cpp
+ lltwitterconnect.cpp
lluilistener.cpp
lluploaddialog.cpp
lluploadfloaterobservers.cpp
@@ -614,6 +631,7 @@ set(viewer_SOURCE_FILES
llviewernetwork.cpp
llviewerobject.cpp
llviewerobjectlist.cpp
+ llvieweroctree.cpp
llviewerparcelmedia.cpp
llviewerparcelmediaautoplay.cpp
llviewerparcelmgr.cpp
@@ -660,7 +678,6 @@ set(viewer_SOURCE_FILES
llwearablelist.cpp
llweb.cpp
llwebprofile.cpp
- llwebsharing.cpp
llwind.cpp
llwindowlistener.cpp
llwlanimator.cpp
@@ -686,7 +703,9 @@ set(viewer_HEADER_FILES
CMakeLists.txt
ViewerInstall.cmake
groupchatlistener.h
+ llaccountingcost.h
llaccountingcostmanager.h
+ llaisapi.h
llagent.h
llagentaccess.h
llagentcamera.h
@@ -697,7 +716,6 @@ set(viewer_HEADER_FILES
llagentpilot.h
llagentui.h
llagentwearables.h
- llagentwearablesfetch.h
llanimstatelabels.h
llappcorehttp.h
llappearance.h
@@ -788,6 +806,7 @@ set(viewer_HEADER_FILES
llfilteredwearablelist.h
llfirstuse.h
llflexibleobject.h
+ llflickrconnect.h
llfloaterabout.h
llfloaterbvhpreview.h
llfloaterauction.h
@@ -796,6 +815,7 @@ set(viewer_HEADER_FILES
llfloateravatarpicker.h
llfloateravatartextures.h
llfloaterbeacons.h
+ llfloaterbigpreview.h
llfloaterbuildoptions.h
llfloaterbulkpermission.h
llfloaterbump.h
@@ -817,10 +837,13 @@ set(viewer_HEADER_FILES
llfloatereditwater.h
llfloaterenvironmentsettings.h
llfloaterevent.h
+ llfloaterfacebook.h
+ llfloaterflickr.h
llfloaterfonttest.h
llfloatergesture.h
llfloatergodtools.h
llfloatergotoline.h
+ llfloatergroupbulkban.h
llfloatergroupinvite.h
llfloatergroups.h
llfloaterhandler.h
@@ -828,6 +851,12 @@ set(viewer_HEADER_FILES
llfloaterhelpbrowser.h
llfloaterhud.h
llfloaterimagepreview.h
+ llfloaterimnearbychat.h
+ llfloaterimnearbychathandler.h
+ llfloaterimnearbychatlistener.h
+ llfloaterimsessiontab.h
+ llfloaterimsession.h
+ llfloaterimcontainer.h
llfloaterinspect.h
llfloaterinventory.h
llfloaterjoystick.h
@@ -857,14 +886,15 @@ set(viewer_HEADER_FILES
llfloaterregioninfo.h
llfloaterreporter.h
llfloaterregionrestarting.h
+ llfloatersceneloadstats.h
llfloaterscriptdebug.h
+ llfloaterscriptedprefs.h
llfloaterscriptlimits.h
llfloatersearch.h
llfloatersellland.h
llfloatersettingsdebug.h
llfloatersidepanelcontainer.h
llfloatersnapshot.h
- llfloatersocial.h
llfloatersounddevices.h
llfloaterspellchecksettings.h
llfloatertelehub.h
@@ -876,6 +906,7 @@ set(viewer_HEADER_FILES
llfloatertos.h
llfloatertoybox.h
llfloatertranslationsettings.h
+ llfloatertwitter.h
llfloateruipreview.h
llfloaterurlentry.h
llfloatervoiceeffect.h
@@ -897,6 +928,7 @@ set(viewer_HEADER_FILES
llgroupmgr.h
llhasheduniqueid.h
llhints.h
+ llhttpretrypolicy.h
llhomelocationresponder.h
llhudeffect.h
llhudeffectbeam.h
@@ -911,9 +943,7 @@ set(viewer_HEADER_FILES
llhudrender.h
llhudtext.h
llhudview.h
- llfloaterimsessiontab.h
- llfloaterimsession.h
- llfloaterimcontainer.h
+ llimagefiltersmanager.h
llimview.h
llinspect.h
llinspectavatar.h
@@ -965,9 +995,6 @@ set(viewer_HEADER_FILES
llnameeditor.h
llnamelistctrl.h
llnavigationbar.h
- llfloaterimnearbychat.h
- llfloaterimnearbychathandler.h
- llfloaterimnearbychatlistener.h
llnetmap.h
llnotificationhandler.h
llnotificationmanager.h
@@ -985,6 +1012,9 @@ set(viewer_HEADER_FILES
llpanelface.h
llpanelgenerictip.h
llpanelgroup.h
+ llpanelgroupbulk.h
+ llpanelgroupbulkimpl.h
+ llpanelgroupbulkban.h
llpanelgroupgeneral.h
llpanelgroupinvite.h
llpanelgrouplandmoney.h
@@ -1071,8 +1101,10 @@ set(viewer_HEADER_FILES
llrootview.h
llsavedsettingsglue.h
llsaveoutfitcombobtn.h
+ llscenemonitor.h
llsceneview.h
llscreenchannel.h
+ llscripteditor.h
llscriptfloater.h
llscrollingpanelparam.h
llscrollingpanelparambase.h
@@ -1101,6 +1133,7 @@ set(viewer_HEADER_FILES
llstylemap.h
llsurface.h
llsurfacepatch.h
+ llsyntaxid.h
llsyswellitem.h
llsyswellwindow.h
lltable.h
@@ -1147,6 +1180,7 @@ set(viewer_HEADER_FILES
lltransientdockablefloater.h
lltransientfloatermgr.h
lltranslate.h
+ lltwitterconnect.h
lluiconstants.h
lluilistener.h
lluploaddialog.h
@@ -1193,6 +1227,7 @@ set(viewer_HEADER_FILES
llviewernetwork.h
llviewerobject.h
llviewerobjectlist.h
+ llvieweroctree.h
llviewerparcelmedia.h
llviewerparcelmediaautoplay.h
llviewerparcelmgr.h
@@ -1229,7 +1264,6 @@ set(viewer_HEADER_FILES
llvosky.h
llvosurfacepatch.h
llvotree.h
- llvotreenew.h
llvovolume.h
llvowater.h
llvowlsky.h
@@ -1240,7 +1274,6 @@ set(viewer_HEADER_FILES
llwearablelist.h
llweb.h
llwebprofile.h
- llwebsharing.h
llwind.h
llwindowlistener.h
llwlanimator.h
@@ -1258,6 +1291,7 @@ set(viewer_HEADER_FILES
macmain.h
noise.h
pipeline.h
+ roles_constants.h
VertexCache.h
VorbisFramework.h
)
@@ -1457,9 +1491,9 @@ if (WINDOWS)
SOURCE_GROUP("Resource Files" FILES ${viewer_RESOURCE_FILES})
- if (NOT STANDALONE)
+ if (NOT USESYSTEMLIBS)
list(APPEND viewer_SOURCE_FILES ${viewer_RESOURCE_FILES})
- endif (NOT STANDALONE)
+ endif (NOT USESYSTEMLIBS)
find_library(DINPUT_LIBRARY dinput8 ${DIRECTX_LIBRARY_DIR})
find_library(DXGUID_LIBRARY dxguid ${DIRECTX_LIBRARY_DIR})
@@ -1534,7 +1568,7 @@ set(viewer_APPSETTINGS_FILES
app_settings/high_graphics.xml
app_settings/ignorable_dialogs.xml
app_settings/keys.xml
- app_settings/keywords.ini
+ app_settings/keywords_lsl_default.xml
app_settings/logcontrol.xml
app_settings/low_graphics.xml
app_settings/mid_graphics.xml
@@ -1570,9 +1604,9 @@ source_group("Character File" FILES ${viewer_CHARACTER_FILES})
set_source_files_properties(${viewer_CHARACTER_FILES}
PROPERTIES HEADER_FILE_ONLY TRUE)
-if (NOT STANDALONE)
+if (NOT USESYSTEMLIBS)
list(APPEND viewer_SOURCE_FILES ${viewer_CHARACTER_FILES})
-endif (NOT STANDALONE)
+endif (NOT USESYSTEMLIBS)
if (WINDOWS)
file(GLOB viewer_INSTALLER_FILES installers/windows/*.nsi)
@@ -1735,7 +1769,6 @@ if (WINDOWS)
media_plugin_webkit
winmm_shim
windows-crash-logger
- windows-updater
)
if (FMODEX)
@@ -1781,7 +1814,6 @@ if (WINDOWS)
add_dependencies(${VIEWER_BINARY_NAME}
SLPlugin
- windows-updater
windows-crash-logger
)
@@ -1854,20 +1886,44 @@ elseif (DARWIN)
LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -dead_strip -Xlinker -map -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME}.MAP"
)
else (WINDOWS)
- # Linux
+ # Linux
set_target_properties(${VIEWER_BINARY_NAME}
PROPERTIES
LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Wl,--Map=${VIEWER_BINARY_NAME}.MAP"
)
endif (WINDOWS)
-# *NOTE - this list is very sensitive to ordering, test carefully on all
+# *NOTE: - this list is very sensitive to ordering, test carefully on all
# platforms if you change the releative order of the entries here.
# In particular, cmake 2.6.4 (when buidling with linux/makefile generators)
# appears to sometimes de-duplicate redundantly listed dependencies improperly.
# To work around this, higher level modules should be listed before the modules
# that they depend upon. -brad
+#
+# *NOTE: On mixing system shared libraries and updated static archives.
+# We use a number of libraries that have an existence as system libraries,
+# internal-use libraries and applications libraries. The most-referenced
+# one of these being libz where you can find four or more versions in play
+# at once. On Linux, libz can be found at link and run time via a number
+# of paths:
+#
+# => -lfreetype
+# => libz.so.1 (on install machine, not build)
+# => -lSDL
+# => libz.so.1 (on install machine, not build)
+# => -lgdk-x11-2.0
+# => libz.so.1
+# => -lz
+#
+# We generally want the newest version of the library to provide all symbol
+# resolution. To that end, when using static archives, the *_PRELOAD_ARCHIVES
+# variables, PNG_PRELOAD_ARCHIVES and ZLIB_PRELOAD_ARCHIVES, get the archives
+# dumped into the target binary and runtime lookup will find the most
+# modern version.
+
target_link_libraries(${VIEWER_BINARY_NAME}
+ ${PNG_PRELOAD_ARCHIVES}
+ ${ZLIB_PRELOAD_ARCHIVES}
${UPDATER_LIBRARIES}
${GOOGLE_PERFTOOLS_LIBRARIES}
${LLAUDIO_LIBRARIES}
@@ -1894,6 +1950,7 @@ target_link_libraries(${VIEWER_BINARY_NAME}
${BOOST_PROGRAM_OPTIONS_LIBRARY}
${BOOST_REGEX_LIBRARY}
${BOOST_CONTEXT_LIBRARY}
+ ${BOOST_COROUTINE_LIBRARY}
${DBUSGLIB_LIBRARIES}
${OPENGL_LIBRARIES}
${FMODWRAPPER_LIBRARY} # must come after LLAudio
@@ -2039,7 +2096,7 @@ if (DARWIN)
)
add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit mac-crash-logger)
-
+
if (ENABLE_SIGNING)
set(SIGNING_SETTING "--signature=${SIGNING_IDENTITY}")
else (ENABLE_SIGNING)
@@ -2163,10 +2220,21 @@ if (LL_TESTS)
#llviewertexturelist.cpp
)
+ set(test_libs
+ ${JSONCPP_LIBRARIES}
+ ${CURL_LIBRARIES}
+ )
+
set_source_files_properties(
lltranslate.cpp
PROPERTIES
- LL_TEST_ADDITIONAL_LIBRARIES "${JSONCPP_LIBRARIES}"
+ LL_TEST_ADDITIONAL_LIBRARIES "${test_libs}"
+ )
+
+ set_source_files_properties(
+ llmediadataclient.cpp
+ PROPERTIES
+ LL_TEST_ADDITIONAL_LIBRARIES "${CURL_LIBRARIES}"
)
set_source_files_properties(
@@ -2247,6 +2315,7 @@ if (LL_TESTS)
set(test_libs
${LLMESSAGE_LIBRARIES}
+ ${LLCOREHTTP_LIBRARIES}
${WINDOWS_LIBRARIES}
${LLVFS_LIBRARIES}
${LLMATH_LIBRARIES}
@@ -2282,16 +2351,13 @@ if (LL_TESTS)
"${test_libs}"
)
- LL_ADD_INTEGRATION_TEST(llsimplestat
- ""
- "${test_libs}"
- )
-
LL_ADD_INTEGRATION_TEST(llviewerassetstats
llviewerassetstats.cpp
"${test_libs}"
)
+ LL_ADD_INTEGRATION_TEST(llhttpretrypolicy "llhttpretrypolicy.cpp" "${test_libs}")
+
#ADD_VIEWER_BUILD_TEST(llmemoryview viewer)
#ADD_VIEWER_BUILD_TEST(llagentaccess viewer)
#ADD_VIEWER_BUILD_TEST(lltextureinfo viewer)
diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib
index 8b99b5a770..c4ddca50dc 100644
--- a/indra/newview/SecondLife.nib
+++ b/indra/newview/SecondLife.nib
Binary files differ
diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib
index 370df6bf5f..ef25c648a7 100644
--- a/indra/newview/SecondLife.xib
+++ b/indra/newview/SecondLife.xib
@@ -120,7 +120,7 @@
</object>
<object class="NSMenuItem" id="755159360">
<reference key="NSMenu" ref="110575045"/>
- <string key="NSTitle">Hide NewApplication</string>
+ <string key="NSTitle">Hide Second Life</string>
<string key="NSKeyEquiv">h</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt
index d2577d9756..972d41a5f5 100644
--- a/indra/newview/VIEWER_VERSION.txt
+++ b/indra/newview/VIEWER_VERSION.txt
@@ -1 +1 @@
-3.7.7
+3.7.18
diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml
index 60c942094a..7b329e2092 100755
--- a/indra/newview/app_settings/commands.xml
+++ b/indra/newview/app_settings/commands.xml
@@ -216,15 +216,35 @@
is_running_function="Floater.IsOpen"
is_running_parameters="snapshot"
/>
- <command name="social"
+ <command name="facebook"
available_in_toybox="true"
- icon="Command_Social_Icon"
- label_ref="Command_Social_Label"
- tooltip_ref="Command_Social_Tooltip"
+ icon="Command_Facebook_Icon"
+ label_ref="Command_Facebook_Label"
+ tooltip_ref="Command_Facebook_Tooltip"
execute_function="Floater.ToggleOrBringToFront"
- execute_parameters="social"
+ execute_parameters="facebook"
is_running_function="Floater.IsOpen"
- is_running_parameters="social"
+ is_running_parameters="facebook"
+ />
+ <command name="flickr"
+ available_in_toybox="true"
+ icon="Command_Flickr_Icon"
+ label_ref="Command_Flickr_Label"
+ tooltip_ref="Command_Flickr_Tooltip"
+ execute_function="Floater.ToggleOrBringToFront"
+ execute_parameters="flickr"
+ is_running_function="Floater.IsOpen"
+ is_running_parameters="flickr"
+ />
+ <command name="twitter"
+ available_in_toybox="true"
+ icon="Command_Twitter_Icon"
+ label_ref="Command_Twitter_Label"
+ tooltip_ref="Command_Twitter_Tooltip"
+ execute_function="Floater.ToggleOrBringToFront"
+ execute_parameters="twitter"
+ is_running_function="Floater.IsOpen"
+ is_running_parameters="twitter"
/>
<command name="speak"
available_in_toybox="true"
diff --git a/indra/newview/app_settings/filters/Autocontrast.xml b/indra/newview/app_settings/filters/Autocontrast.xml
new file mode 100755
index 0000000000..ec3d7561bd
--- /dev/null
+++ b/indra/newview/app_settings/filters/Autocontrast.xml
@@ -0,0 +1,11 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.01</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/newview/app_settings/filters/BlackAndWhite.xml b/indra/newview/app_settings/filters/BlackAndWhite.xml
new file mode 100644
index 0000000000..7894628d29
--- /dev/null
+++ b/indra/newview/app_settings/filters/BlackAndWhite.xml
@@ -0,0 +1,7 @@
+<llsd>
+ <array>
+ <array>
+ <string>grayscale</string>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/newview/app_settings/filters/Colors1970.xml b/indra/newview/app_settings/filters/Colors1970.xml
new file mode 100644
index 0000000000..730d907fa7
--- /dev/null
+++ b/indra/newview/app_settings/filters/Colors1970.xml
@@ -0,0 +1,47 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>contrast</string>
+ <real>0.8</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.3</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>blend</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>10.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.1</real>
+ <real>0.1</real>
+ <real>0.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/newview/app_settings/filters/Intense.xml b/indra/newview/app_settings/filters/Intense.xml
new file mode 100644
index 0000000000..b77f07a037
--- /dev/null
+++ b/indra/newview/app_settings/filters/Intense.xml
@@ -0,0 +1,8 @@
+<llsd>
+ <array>
+ <array>
+ <string>saturate</string>
+ <real>3.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/newview/app_settings/filters/LensFlare.xml b/indra/newview/app_settings/filters/LensFlare.xml
new file mode 100644
index 0000000000..e9aef6eea4
--- /dev/null
+++ b/indra/newview/app_settings/filters/LensFlare.xml
@@ -0,0 +1,131 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.01</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>gradient</string>
+ <string>add</string>
+ <real>0.5</real>
+ <real>0.0</real>
+ <real>-1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>-1.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.1</real>
+ <real>0.1</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>add</string>
+ <real>0.0</real>
+ <real>0.5</real>
+ <real>-1.0</real>
+ <real>1.0</real>
+ <real>1.5</real>
+ <real>5.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.6</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>add</string>
+ <real>0.0</real>
+ <real>0.5</real>
+ <real>-1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>5.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.6</real>
+ <real>0.6</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>add</string>
+ <real>0.0</real>
+ <real>0.5</real>
+ <real>0.5</real>
+ <real>-0.5</real>
+ <real>0.10</real>
+ <real>20.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.7</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>add</string>
+ <real>0.0</real>
+ <real>0.5</real>
+ <real>0.6</real>
+ <real>-0.6</real>
+ <real>0.05</real>
+ <real>20.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.7</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>add</string>
+ <real>0.0</real>
+ <real>0.5</real>
+ <real>0.4</real>
+ <real>-0.4</real>
+ <real>0.025</real>
+ <real>20.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>0.7</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/newview/app_settings/filters/Miniature.xml b/indra/newview/app_settings/filters/Miniature.xml
new file mode 100755
index 0000000000..9aa8a87c6f
--- /dev/null
+++ b/indra/newview/app_settings/filters/Miniature.xml
@@ -0,0 +1,118 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.02</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>contrast</string>
+ <real>1.02</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>saturate</string>
+ <real>1.2</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>blend</string>
+ <real>0.0</real>
+ <real>0.25</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>0.25</real>
+ <real>2.0</real>
+ </array>
+ <array>
+ <string>sharpen</string>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>gradient</string>
+ <string>blend</string>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>-1.0</real>
+ <real>0.0</real>
+ <real>-0.25</real>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>gradient</string>
+ <string>blend</string>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.25</real>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ </array>
+</llsd> \ No newline at end of file
diff --git a/indra/newview/app_settings/filters/Newspaper.xml b/indra/newview/app_settings/filters/Newspaper.xml
new file mode 100755
index 0000000000..6cfe319281
--- /dev/null
+++ b/indra/newview/app_settings/filters/Newspaper.xml
@@ -0,0 +1,20 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>grayscale</string>
+ </array>
+ <array>
+ <string>screen</string>
+ <string>2Dsine</string>
+ <real>0.02</real>
+ <real>0.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/newview/app_settings/filters/Sepia.xml b/indra/newview/app_settings/filters/Sepia.xml
new file mode 100644
index 0000000000..81d7caf0eb
--- /dev/null
+++ b/indra/newview/app_settings/filters/Sepia.xml
@@ -0,0 +1,7 @@
+<llsd>
+ <array>
+ <array>
+ <string>sepia</string>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/newview/app_settings/filters/Spotlight.xml b/indra/newview/app_settings/filters/Spotlight.xml
new file mode 100644
index 0000000000..0e2e0ad68c
--- /dev/null
+++ b/indra/newview/app_settings/filters/Spotlight.xml
@@ -0,0 +1,47 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>add</string>
+ <real>0.0</real>
+ <real>0.4</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>2.0</real>
+ </array>
+ <array>
+ <string>contrast</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>add</string>
+ <real>-0.8</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>2.0</real>
+ </array>
+ <array>
+ <string>contrast</string>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/newview/app_settings/filters/Toycamera.xml b/indra/newview/app_settings/filters/Toycamera.xml
new file mode 100755
index 0000000000..4e76f6b2fb
--- /dev/null
+++ b/indra/newview/app_settings/filters/Toycamera.xml
@@ -0,0 +1,46 @@
+<llsd>
+ <array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>fade</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>1.2</real>
+ <real>3.0</real>
+ </array>
+ <array>
+ <string>linearize</string>
+ <real>0.05</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>grayscale</string>
+ </array>
+ <array>
+ <string>contrast</string>
+ <real>1.1</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>vignette</string>
+ <string>blend</string>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>0.5</real>
+ <real>2.0</real>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ </array>
+</llsd> \ No newline at end of file
diff --git a/indra/newview/app_settings/filters/Video.xml b/indra/newview/app_settings/filters/Video.xml
new file mode 100755
index 0000000000..fe17f3950a
--- /dev/null
+++ b/indra/newview/app_settings/filters/Video.xml
@@ -0,0 +1,44 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>darken</string>
+ <real>0.15</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>stencil</string>
+ <string>uniform</string>
+ <string>add</string>
+ <real>0.0</real>
+ <real>0.5</real>
+ </array>
+ <array>
+ <string>screen</string>
+ <string>line</string>
+ <real>0.02</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>gamma</string>
+ <real>0.25</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ <array>
+ <string>blur</string>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/newview/app_settings/keys.xml b/indra/newview/app_settings/keys.xml
index 6e3673e7d9..a8037fec05 100755
--- a/indra/newview/app_settings/keys.xml
+++ b/indra/newview/app_settings/keys.xml
@@ -293,11 +293,24 @@
<!--these are for passing controls when sitting on vehicles-->
<binding key="A" mask="SHIFT" command="slide_left"/>
<binding key="D" mask="SHIFT" command="slide_right"/>
+ <binding key="W" mask="SHIFT" command="move_forward_sitting"/>
+ <binding key="S" mask="SHIFT" command="move_backward_sitting"/>
+ <binding key="E" mask="SHIFT" command="spin_over_sitting"/>
+ <binding key="C" mask="SHIFT" command="spin_under_sitting"/>
+
<binding key="LEFT" mask="SHIFT" command="slide_left"/>
<binding key="RIGHT" mask="SHIFT" command="slide_right"/>
+ <binding key="UP" mask="SHIFT" command="move_forward_sitting"/>
+ <binding key="DOWN" mask="SHIFT" command="move_backward_sitting"/>
+ <binding key="PGUP" mask="SHIFT" command="spin_over_sitting"/>
+ <binding key="PGDN" mask="SHIFT" command="spin_under_sitting"/>
<binding key="PAD_LEFT" mask="SHIFT" command="slide_left"/>
<binding key="PAD_RIGHT" mask="SHIFT" command="slide_right"/>
+ <binding key="PAD_UP" mask="SHIFT" command="move_forward_sitting"/>
+ <binding key="PAD_DOWN" mask="SHIFT" command="move_backward_sitting"/>
+ <binding key="PAD_PGUP" mask="SHIFT" command="spin_over_sitting"/>
+ <binding key="PAD_PGDN" mask="SHIFT" command="spin_under_sitting"/>
<binding key="PAD_ENTER" mask="SHIFT" command="start_chat"/>
<binding key="PAD_DIVIDE" mask="SHIFT" command="start_gesture"/>
diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini
index ad843bca14..4972472f67 100755
--- a/indra/newview/app_settings/keywords.ini
+++ b/indra/newview/app_settings/keywords.ini
@@ -526,6 +526,7 @@ REGION_FLAG_SANDBOX Used with llGetRegionFlags to find if a region is a sand
REGION_FLAG_DISABLE_COLLISIONS Used with llGetRegionFlags to find if a region has disabled collisions
REGION_FLAG_DISABLE_PHYSICS Used with llGetRegionFlags to find if a region has disabled physics
REGION_FLAG_BLOCK_FLY Used with llGetRegionFlags to find if a region blocks flying
+REGION_FLAG_BLOCK_FLYOVER Used with llGetRegionFlags to find if a region enforces higher altitude parcel access rules
REGION_FLAG_ALLOW_DIRECT_TELEPORT Used with llGetRegionFlags to find if a region allows direct teleports
REGION_FLAG_RESTRICT_PUSHOBJECT Used with llGetRegionFlags to find if a region restricts llPushObject() calls
@@ -627,22 +628,22 @@ RCERR_CAST_TIME_EXCEEDED TODO: add documentation
RCERR_SIM_PERF_LOW TODO: add documentation
RCERR_UNKNOWN TODO: add documentation
-ESTATE_ACCESS_ALLOWED_AGENT_ADD TODO: add documentation
-ESTATE_ACCESS_ALLOWED_AGENT_REMOVE TODO: add documentation
-ESTATE_ACCESS_ALLOWED_GROUP_ADD TODO: add documentation
-ESTATE_ACCESS_ALLOWED_GROUP_REMOVE TODO: add documentation
-ESTATE_ACCESS_BANNED_AGENT_ADD TODO: add documentation
-ESTATE_ACCESS_BANNED_AGENT_REMOVE TODO: add documentation
+ESTATE_ACCESS_ALLOWED_AGENT_ADD Passed to llManageEstateAccess to add the agent to this estate's Allowed Residents list
+ESTATE_ACCESS_ALLOWED_AGENT_REMOVE Passed to llManageEstateAccess to remove the agent from this estate's Allowed Residents list
+ESTATE_ACCESS_ALLOWED_GROUP_ADD Passed to llManageEstateAccess to add the group to this estate's Allowed groups list
+ESTATE_ACCESS_ALLOWED_GROUP_REMOVE Passed to llManageEstateAccess to remove the group from this estate's Allowed groups list
+ESTATE_ACCESS_BANNED_AGENT_ADD Passed to llManageEstateAccess to add the agent to this estate's Banned residents list
+ESTATE_ACCESS_BANNED_AGENT_REMOVE Passed to llManageEstateAccess to remove the agent from this estate's Banned residents list
DENSITY TODO: add documentation
FRICTION TODO: add documentation
RESTITUTION TODO: add documentation
GRAVITY_MULTIPLIER TODO: add documentation
-KFM_COMMAND TODO: add documentation
-KFM_CMD_PLAY TODO: add documentation
-KFM_CMD_STOP TODO: add documentation
-KFM_CMD_PAUSE TODO: add documentation
+KFM_COMMAND Command used in the options parameter of llSetKeyframedMotion, followed by one of: KFM_CMD_STOP, KFM_CMD_PLAY, KFM_CMD_PAUSE to play, stop or pause the motion
+KFM_CMD_PLAY Command used in the options parameter llSetKeyframedMotion. Resumes the animation previously stopped by KFM_CMD_STOP or KFM_CMD_PAUSE
+KFM_CMD_STOP Command used in the options parameter llSetKeyframedMotion. Stops the animation and resets it at the start of motion
+KFM_CMD_PAUSE Command used in the options parameter llSetKeyframedMotion. Stops the animation but doesn t reset it at the start of motion.
KFM_CMD_SET_MODE TODO: add documentation
KFM_MODE TODO: add documentation
KFM_FORWARD TODO: add documentation
@@ -656,18 +657,18 @@ KFM_TRANSLATION TODO: add documentation
CHARACTER_CMD_STOP TODO: add documentation
CHARACTER_CMD_JUMP TODO: add documentation
-CHARACTER_DESIRED_SPEED TODO: add documentation
-CHARACTER_RADIUS TODO: add documentation
-CHARACTER_LENGTH TODO: add documentation
-CHARACTER_ORIENTATION TODO: add documentation
-CHARACTER_AVOIDANCE_MODE TODO: add documentation
+CHARACTER_DESIRED_SPEED Constant used to indicate that the following argument is the desired speed for a Pathfinding character.
+CHARACTER_RADIUS Constant used to indicate that the following argument is the radius of the capsule for a Pathfinding character.
+CHARACTER_LENGTH Constant used to indicate that the following argument is the length of the capsule for a Pathfinding character.
+CHARACTER_ORIENTATION Constant used to indicate that the following argument is the orientation of the capsule for a Pathfinding character.
+CHARACTER_AVOIDANCE_MODE Allows you to specify that a character should not try to avoid other characters, should not try to avoid dynamic obstacles, or both. Is combined with a mask bit flags
PURSUIT_OFFSET TODO: add documentation
REQUIRE_LINE_OF_SIGHT TODO: add documentation
PURSUIT_FUZZ_FACTOR TODO: add documentation
PURSUIT_INTERCEPT TODO: add documentation
FORCE_DIRECT_PATH TODO: add documentation
-VERTICAL TODO: add documentation
-HORIZONTAL TODO: add documentation
+VERTICAL Constant to indicate that the orientation of the capsule for a Pathfinding character is vertical.
+HORIZONTAL Constant to indicate that the orientation of the capsule for a Pathfinding character is horizontal.
AVOID_CHARACTERS TODO: add documentation
AVOID_DYNAMIC_OBSTACLES TODO: add documentation
@@ -682,12 +683,12 @@ PU_FAILURE_UNREACHABLE Goal is no longer reachable for some reason - e
PU_GOAL_REACHED Character has reached the goal and will stop or choose a new goal (if wandering).
PU_SLOWDOWN_DISTANCE_REACHED Character is near current goal.
-CHARACTER_TYPE TODO: add documentation
-CHARACTER_TYPE_A TODO: add documentation
-CHARACTER_TYPE_B TODO: add documentation
-CHARACTER_TYPE_C TODO: add documentation
-CHARACTER_TYPE_D TODO: add documentation
-CHARACTER_TYPE_NONE TODO: add documentation
+CHARACTER_TYPE Specifies which walkability coefficient will be used by this character. Used in combination with one of the character type flags.
+CHARACTER_TYPE_A Used for character types that you prefer move in a way consistent with humanoids.
+CHARACTER_TYPE_B Used for character types that you prefer move in a way consistent with wild animals or off road vehicles.
+CHARACTER_TYPE_C Used for mechanical character types or road going vehicles.
+CHARACTER_TYPE_D Used for character types that are not consistent with the A, B, or C type.
+CHARACTER_TYPE_NONE Used to set no specific character type.
TRAVERSAL_TYPE TODO: add documentation
TRAVERSAL_TYPE_SLOW TODO: add documentation
diff --git a/indra/newview/app_settings/keywords_lsl_default.xml b/indra/newview/app_settings/keywords_lsl_default.xml
new file mode 100755
index 0000000000..37dd2db93f
--- /dev/null
+++ b/indra/newview/app_settings/keywords_lsl_default.xml
@@ -0,0 +1,18289 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<llsd>
+ <map>
+ <key>controls</key>
+ <map>
+ <key>do</key>
+ <map>
+ <key>tooltip</key>
+ <string>do / while loop\ndo {\n...\n} while (&lt;condition&gt;);</string>
+ </map>
+ <key>else</key>
+ <map>
+ <key>tooltip</key>
+ <string>if / else block\nif (&lt;condition&gt;) {\n...\n[} else [if (&lt;condition&gt;) {\n...]]\n}</string>
+ </map>
+ <key>for</key>
+ <map>
+ <key>tooltip</key>
+ <string>for loop\nfor (&lt;initializer&gt;; &lt;condition&gt;; &lt;post-iteration-statement&gt;)\n{ ...\n}</string>
+ </map>
+ <key>if</key>
+ <map>
+ <key>tooltip</key>
+ <string>if / else block\nif (&lt;condition&gt;) {\n...\n[} else [if (&lt;condition&gt;) {\n...]]\n}</string>
+ </map>
+ <key>jump</key>
+ <map>
+ <key>tooltip</key>
+ <string>jump statement\njump &lt;label&gt;</string>
+ </map>
+ <key>return</key>
+ <map>
+ <key>tooltip</key>
+ <string>Leave current event or function.\nreturn [&lt;variable&gt;];\nOptionally pass back a variable's value, from a function.</string>
+ </map>
+ <key>state</key>
+ <map>
+ <key>tooltip</key>
+ <string>state &lt;target&gt;\nIf the target state is not the same as the current one, change to the target state.</string>
+ </map>
+ <key>while</key>
+ <map>
+ <key>tooltip</key>
+ <string>while loop\nwhile (&lt;condition&gt;) {\n,,,\n}</string>
+ </map>
+ </map>
+ <key>types</key>
+ <map>
+ <key>float</key>
+ <map>
+ <key>tooltip</key>
+ <string>32 bit floating point value.\nThe range is 1.175494351E-38 to 3.402823466E+38.</string>
+ </map>
+ <key>integer</key>
+ <map>
+ <key>tooltip</key>
+ <string>32 bit integer value.\n−2,147,483,648 and +2,147,483,647 (that is 0x80000000 to 0x7FFFFFFF in hex).</string>
+ </map>
+ <key>key</key>
+ <map>
+ <key>tooltip</key>
+ <string>A 128 bit unique identifier (UUID).\nThe key is represented as hexidecimal characters (A-F and 0-9), grouped into sections (8,4,4,4,12 characters) and separated by hyphens (for a total of 36 characters). e.g. "A822FF2B-FF02-461D-B45D-DCD10A2DE0C2".</string>
+ </map>
+ <key>list</key>
+ <map>
+ <key>tooltip</key>
+ <string>A collection of other data types.\nLists are signified by square brackets surrounding their elements; the elements inside are separated by commas. e.g. [0, 1, 2, 3, 4] or ["Yes", "No", "Perhaps"].</string>
+ </map>
+ <key>quaternion</key>
+ <map>
+ <key>tooltip</key>
+ <string>The quaternion type is a left over from way back when LSL was created. It was later renamed to &lt;rotation&gt; to make it more user friendly, but it appears someone forgot to remove it ;-)</string>
+ </map>
+ <key>rotation</key>
+ <map>
+ <key>tooltip</key>
+ <string>The rotation type is one of several ways to represent an orientation in 3D.\nIt is a mathematical object called a quaternion. You can think of a quaternion as four numbers (x, y, z, w), three of which represent the direction an object is facing and a fourth that represents the object's banking left or right around that direction.</string>
+ </map>
+ <key>string</key>
+ <map>
+ <key>tooltip</key>
+ <string>Text data.\nThe editor accepts UTF-8 encoded text.</string>
+ </map>
+ <key>vector</key>
+ <map>
+ <key>tooltip</key>
+ <string>A vector is a data type that contains a set of three float values.\nVectors are used to represent colors (RGB), positions, and directions/velocities.</string>
+ </map>
+ </map>
+ <key>constants</key>
+ <map>
+ <key>ACTIVE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x2</string>
+ <key>tooltip</key>
+ <string>Objects in world that are running a script or currently physically moving.</string>
+ </map>
+ <key>AGENT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x1</string>
+ <key>tooltip</key>
+ <string>Objects in world that are agents.</string>
+ </map>
+ <key>AGENT_ALWAYS_RUN</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x1000</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>AGENT_ATTACHMENTS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x2</string>
+ <key>tooltip</key>
+ <string>The agent has attachments.</string>
+ </map>
+ <key>AGENT_AUTOPILOT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x2000</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>AGENT_AWAY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x40</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>AGENT_BUSY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x800</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>AGENT_BY_LEGACY_NAME</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x1</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>AGENT_BY_USERNAME</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x10</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>AGENT_CROUCHING</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x400</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>AGENT_FLYING</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x1</string>
+ <key>tooltip</key>
+ <string>The agent is flying.</string>
+ </map>
+ <key>AGENT_IN_AIR</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x100</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>AGENT_LIST_PARCEL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>Agents on the same parcel where the script is running.</string>
+ </map>
+ <key>AGENT_LIST_PARCEL_OWNER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string>Agents on any parcel in the region where the parcel owner is the same as the owner of the parcel under the scripted object.</string>
+ </map>
+ <key>AGENT_LIST_REGION</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string>All agents in the region.</string>
+ </map>
+ <key>AGENT_MOUSELOOK</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x8</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>AGENT_ON_OBJECT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x20</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>AGENT_SCRIPTED</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x4</string>
+ <key>tooltip</key>
+ <string>The agent has scripted attachments.</string>
+ </map>
+ <key>AGENT_SITTING</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x10</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>AGENT_TYPING</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x200</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>AGENT_WALKING</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x80</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>ALL_SIDES</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>-1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>ANIM_ON</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x1</string>
+ <key>tooltip</key>
+ <string>Texture animation is on.</string>
+ </map>
+ <key>ATTACH_AVATAR_CENTER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>40</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's geometric centre.</string>
+ </map>
+ <key>ATTACH_BACK</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>9</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's back.</string>
+ </map>
+ <key>ATTACH_BELLY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>28</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's belly.</string>
+ </map>
+ <key>ATTACH_CHEST</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's chest.</string>
+ </map>
+ <key>ATTACH_CHIN</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>12</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's chin.</string>
+ </map>
+ <key>ATTACH_HEAD</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's head.</string>
+ </map>
+ <key>ATTACH_HUD_BOTTOM</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>37</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>ATTACH_HUD_BOTTOM_LEFT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>36</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>ATTACH_HUD_BOTTOM_RIGHT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>38</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>ATTACH_HUD_CENTER_1</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>35</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>ATTACH_HUD_CENTER_2</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>31</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>ATTACH_HUD_TOP_CENTER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>33</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>ATTACH_HUD_TOP_LEFT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>34</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>ATTACH_HUD_TOP_RIGHT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>32</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>ATTACH_LEAR</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>13</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's left ear.</string>
+ </map>
+ <key>ATTACH_LEFT_PEC</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>29</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's left pectoral.</string>
+ </map>
+ <key>ATTACH_LEYE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>15</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's left eye.</string>
+ </map>
+ <key>ATTACH_LFOOT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>7</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's left foot.</string>
+ </map>
+ <key>ATTACH_LHAND</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's left hand.</string>
+ </map>
+ <key>ATTACH_LHIP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>25</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's left hip.</string>
+ </map>
+ <key>ATTACH_LLARM</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>21</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's left lower arm.</string>
+ </map>
+ <key>ATTACH_LLLEG</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>27</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's lower left leg.</string>
+ </map>
+ <key>ATTACH_LPEC</key>
+ <map>
+ <key>deprecated</key>
+ <boolean>true</boolean>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>30</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's right pectoral. (Deprecated, use ATTACH_RIGHT_PEC)</string>
+ </map>
+ <key>ATTACH_LSHOULDER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's left shoulder.</string>
+ </map>
+ <key>ATTACH_LUARM</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>20</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's left upper arm.</string>
+ </map>
+ <key>ATTACH_LULEG</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>27</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's lower upper leg.</string>
+ </map>
+ <key>ATTACH_MOUTH</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>11</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's mouth.</string>
+ </map>
+ <key>ATTACH_NECK</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>39</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's neck.</string>
+ </map>
+ <key>ATTACH_NOSE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>17</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's nose.</string>
+ </map>
+ <key>ATTACH_PELVIS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>10</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's pelvis.</string>
+ </map>
+ <key>ATTACH_REAR</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>14</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's right ear.</string>
+ </map>
+ <key>ATTACH_REYE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>16</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's right eye.</string>
+ </map>
+ <key>ATTACH_RFOOT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>8</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's right foot.</string>
+ </map>
+ <key>ATTACH_RHAND</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>6</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's right hand.</string>
+ </map>
+ <key>ATTACH_RHIP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>22</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's right hip.</string>
+ </map>
+ <key>ATTACH_RIGHT_PEC</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>30</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's right pectoral.</string>
+ </map>
+ <key>ATTACH_RLARM</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>19</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's right lower arm.</string>
+ </map>
+ <key>ATTACH_RLLEG</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>24</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's right lower leg.</string>
+ </map>
+ <key>ATTACH_RPEC</key>
+ <map>
+ <key>deprecated</key>
+ <boolean>true</boolean>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>29</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's left pectoral. (deprecated, use ATTACH_LEFT_PEC)</string>
+ </map>
+ <key>ATTACH_RSHOULDER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's right shoulder.</string>
+ </map>
+ <key>ATTACH_RUARM</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>18</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's right upper arm.</string>
+ </map>
+ <key>ATTACH_RULEG</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>23</integer>
+ <key>tooltip</key>
+ <string>Attach to the avatar's right upper leg.</string>
+ </map>
+ <key>AVOID_CHARACTERS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>AVOID_DYNAMIC_OBSTACLES</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>AVOID_NONE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CAMERA_ACTIVE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>12</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CAMERA_BEHINDNESS_ANGLE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>8</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CAMERA_BEHINDNESS_LAG</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>9</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CAMERA_DISTANCE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>7</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CAMERA_FOCUS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>17</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CAMERA_FOCUS_LAG</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>6</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CAMERA_FOCUS_LOCKED</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>22</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CAMERA_FOCUS_OFFSET</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CAMERA_FOCUS_THRESHOLD</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>11</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CAMERA_PITCH</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CAMERA_POSITION</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>13</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CAMERA_POSITION_LAG</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>6</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CAMERA_POSITION_LOCKED</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>22</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CAMERA_POSITION_THRESHOLD</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>10</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CHANGED_ALLOWED_DROP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x40</string>
+ <key>tooltip</key>
+ <string>The object inventory has changed because an item was added through the llAllowInventoryDrop interface.</string>
+ </map>
+ <key>CHANGED_COLOR</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x2</string>
+ <key>tooltip</key>
+ <string>The object color has changed.</string>
+ </map>
+ <key>CHANGED_INVENTORY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x1</string>
+ <key>tooltip</key>
+ <string>The object inventory has changed.</string>
+ </map>
+ <key>CHANGED_LINK</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x20</string>
+ <key>tooltip</key>
+ <string>The object has linked or its links were broken.</string>
+ </map>
+ <key>CHANGED_MEDIA</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2048</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CHANGED_OWNER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x80</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CHANGED_REGION</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x100</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CHANGED_REGION_START</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x400</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CHANGED_SCALE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x8</string>
+ <key>tooltip</key>
+ <string>The object scale (size) has changed.</string>
+ </map>
+ <key>CHANGED_SHAPE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x4</string>
+ <key>tooltip</key>
+ <string>The object base shape has changed, e.g., a box to a cylinder.</string>
+ </map>
+ <key>CHANGED_TELEPORT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x200</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CHANGED_TEXTURE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x10</string>
+ <key>tooltip</key>
+ <string>The texture offset, scale rotation, or simply the object texture has changed.</string>
+ </map>
+ <key>CHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>14</integer>
+ <key>tooltip</key>
+ <string>If set to false, character will not attempt to catch up on lost time when pathfinding performance is low, potentially providing more reliable movement (albeit while potentially appearing to be more stuttery). Default is true to match pre-existing behavior.</string>
+ </map>
+ <key>CHARACTER_AVOIDANCE_MODE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string>Allows you to specify that a character should not try to avoid other characters, should not try to avoid dynamic obstacles (relatively fast moving objects and avatars), or both.</string>
+ </map>
+ <key>CHARACTER_CMD_JUMP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x01</string>
+ <key>tooltip</key>
+ <string>Makes the character jump. Requires an additional parameter, the height to jump, between 0.1m and 2.0m. This must be provided as the first element of the llExecCharacterCmd option list.</string>
+ </map>
+ <key>CHARACTER_CMD_SMOOTH_STOP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CHARACTER_CMD_STOP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x00</string>
+ <key>tooltip</key>
+ <string>Stops any current pathfinding operation.</string>
+ </map>
+ <key>CHARACTER_DESIRED_SPEED</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>Speed of pursuit in meters per second.</string>
+ </map>
+ <key>CHARACTER_DESIRED_TURN_SPEED</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>12</integer>
+ <key>tooltip</key>
+ <string>The character's maximum speed while turning about the Z axis. - Note that this is only loosely enforced.</string>
+ </map>
+ <key>CHARACTER_LENGTH</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string>Set collision capsule length - cannot be less than two times the radius.</string>
+ </map>
+ <key>CHARACTER_MAX_ACCEL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>8</integer>
+ <key>tooltip</key>
+ <string>The character's maximum acceleration rate.</string>
+ </map>
+ <key>CHARACTER_MAX_DECEL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>9</integer>
+ <key>tooltip</key>
+ <string>The character's maximum deceleration rate.</string>
+ </map>
+ <key>CHARACTER_MAX_SPEED</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>13</integer>
+ <key>tooltip</key>
+ <string>The character's maximum speed.</string>
+ </map>
+ <key>CHARACTER_MAX_TURN_RADIUS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>10</integer>
+ <key>tooltip</key>
+ <string>The character's turn radius when travelling at CHARACTER_MAX_TURN_SPEED.</string>
+ </map>
+ <key>CHARACTER_ORIENTATION</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string>Valid options are: VERTICAL, HORIZONTAL.</string>
+ </map>
+ <key>CHARACTER_RADIUS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string>Set collision capsule radius.</string>
+ </map>
+ <key>CHARACTER_STAY_WITHIN_PARCEL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>15</integer>
+ <key>tooltip</key>
+ <string>Determines whether a character can leave its starting parcel.\nTakes a boolean parameter. If TRUE, the character cannot voluntarilly leave the parcel, but can return to it.</string>
+ </map>
+ <key>CHARACTER_TYPE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>6</integer>
+ <key>tooltip</key>
+ <string>Specifies which walk-ability coefficient will be used by this character.</string>
+ </map>
+ <key>CHARACTER_TYPE_A</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CHARACTER_TYPE_B</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CHARACTER_TYPE_C</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CHARACTER_TYPE_D</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CHARACTER_TYPE_NONE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>CLICK_ACTION_BUY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string>When the prim is clicked, the buy dialog is opened.</string>
+ </map>
+ <key>CLICK_ACTION_NONE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string>Performs the default action: when the prim is clicked, touch events are triggered.</string>
+ </map>
+ <key>CLICK_ACTION_OPEN</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string>When the prim is clicked, the object inventory dialog is opened.</string>
+ </map>
+ <key>CLICK_ACTION_OPEN_MEDIA</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>6</integer>
+ <key>tooltip</key>
+ <string>When the prim is touched, the web media dialog is opened.</string>
+ </map>
+ <key>CLICK_ACTION_PAY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string>When the prim is clicked, the pay dialog is opened.</string>
+ </map>
+ <key>CLICK_ACTION_PLAY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string>When the prim is clicked, html-on-a-prim is enabled?</string>
+ </map>
+ <key>CLICK_ACTION_SIT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>When the prim is clicked, the avatar sits upon it.</string>
+ </map>
+ <key>CLICK_ACTION_TOUCH</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string>When the prim is clicked, touch events are triggered.</string>
+ </map>
+ <key>CONTENT_TYPE_ATOM</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string>"application/atom+xml"</string>
+ </map>
+ <key>CONTENT_TYPE_FORM</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>7</integer>
+ <key>tooltip</key>
+ <string>"application/x-www-form-urlencoded"</string>
+ </map>
+ <key>CONTENT_TYPE_HTML</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>"text/html", only valid for embedded browsers on content owned by the person viewing. Falls back to "text/plain" otherwise.</string>
+ </map>
+ <key>CONTENT_TYPE_JSON</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string>"application/json"</string>
+ </map>
+ <key>CONTENT_TYPE_LLSD</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>6</integer>
+ <key>tooltip</key>
+ <string>"application/llsd+xml"</string>
+ </map>
+ <key>CONTENT_TYPE_RSS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>8</integer>
+ <key>tooltip</key>
+ <string>"application/rss+xml"</string>
+ </map>
+ <key>CONTENT_TYPE_TEXT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string>"text/plain"</string>
+ </map>
+ <key>CONTENT_TYPE_XHTML</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string>"application/xhtml+xml"</string>
+ </map>
+ <key>CONTENT_TYPE_XML</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string>"application/xml"</string>
+ </map>
+ <key>CONTROL_BACK</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x2</string>
+ <key>tooltip</key>
+ <string>Test for the avatar move back control.</string>
+ </map>
+ <key>CONTROL_DOWN</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x20</string>
+ <key>tooltip</key>
+ <string>Test for the avatar move down control.</string>
+ </map>
+ <key>CONTROL_FWD</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x1</string>
+ <key>tooltip</key>
+ <string>Test for the avatar move forward control.</string>
+ </map>
+ <key>CONTROL_LBUTTON</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x10000000</string>
+ <key>tooltip</key>
+ <string>Test for the avatar left button control.</string>
+ </map>
+ <key>CONTROL_LEFT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x4</string>
+ <key>tooltip</key>
+ <string>Test for the avatar move left control.</string>
+ </map>
+ <key>CONTROL_ML_LBUTTON</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x40000000</string>
+ <key>tooltip</key>
+ <string>Test for the avatar left button control while in mouse look.</string>
+ </map>
+ <key>CONTROL_RIGHT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x8</string>
+ <key>tooltip</key>
+ <string>Test for the avatar move right control.</string>
+ </map>
+ <key>CONTROL_ROT_LEFT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x100</string>
+ <key>tooltip</key>
+ <string>Test for the avatar rotate left control.</string>
+ </map>
+ <key>CONTROL_ROT_RIGHT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x200</string>
+ <key>tooltip</key>
+ <string>Test for the avatar rotate right control.</string>
+ </map>
+ <key>CONTROL_UP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x10</string>
+ <key>tooltip</key>
+ <string>Test for the avatar move up control.</string>
+ </map>
+ <key>DATA_BORN</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string>The date the agent was born, returned in ISO 8601 format of YYYY-MM-DD.</string>
+ </map>
+ <key>DATA_NAME</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string>The name of the agent.</string>
+ </map>
+ <key>DATA_ONLINE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>TRUE for online, FALSE for offline.</string>
+ </map>
+ <key>DATA_PAYINFO</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>8</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>DATA_RATING</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string>Returns the agent ratings as a comma separated string of six integers. They are:
+ 1) Positive rated behaviour
+ 2) Negative rated behaviour
+ 3) Positive rated appearance
+ 4) Negative rated appearance
+ 5) Positive rated building
+ 6) Negative rated building</string>
+ </map>
+ <key>DATA_SIM_POS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>DATA_SIM_RATING</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>7</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>DATA_SIM_STATUS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>6</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>DEBUG_CHANNEL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2147483647</integer>
+ <key>tooltip</key>
+ <string>DEBUG_CHANNEL is an integer constant that, when passed to llSay, llWhisper, or llShout as a channel parameter, will print text to the Script Warning/Error Window.</string>
+ </map>
+ <key>DEG_TO_RAD</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>value</key>
+ <real>0.01745329</real>
+ <key>tooltip</key>
+ <string>0.01745329 - Number of radians per degree.
+ You can use this to convert degrees to radians by multiplying the degrees by this number.</string>
+ </map>
+ <key>DENSITY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>Used with llSetPhysicsMaterial to enable the density value. Must be between 1.0 and 22587.0 (in Kg/m^3 -- see if you can figure out what 22587 represents)</string>
+ </map>
+ <key>EOF</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>value</key>
+ <string>0x0A0x0A0x0A</string>
+ <key>tooltip</key>
+ <string>Indicates the last line of a notecard was read.</string>
+ </map>
+ <key>ERR_GENERIC</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>-1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>ERR_MALFORMED_PARAMS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>-3</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>ERR_PARCEL_PERMISSIONS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>-2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>ERR_RUNTIME_PERMISSIONS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>-4</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>ERR_THROTTLED</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>-5</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>ESTATE_ACCESS_ALLOWED_AGENT_ADD</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string>Add the agent to this estate's Allowed Residents list.</string>
+ </map>
+ <key>ESTATE_ACCESS_ALLOWED_AGENT_REMOVE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>8</integer>
+ <key>tooltip</key>
+ <string>Remove the agent from this estate's Allowed Residents list.</string>
+ </map>
+ <key>ESTATE_ACCESS_ALLOWED_GROUP_ADD</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>16</integer>
+ <key>tooltip</key>
+ <string>Add the group to this estate's Allowed groups list.</string>
+ </map>
+ <key>ESTATE_ACCESS_ALLOWED_GROUP_REMOVE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>32</integer>
+ <key>tooltip</key>
+ <string>Remove the group from this estate's Allowed groups list.</string>
+ </map>
+ <key>ESTATE_ACCESS_BANNED_AGENT_ADD</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>64</integer>
+ <key>tooltip</key>
+ <string>Add the agent to this estate's Banned residents list.</string>
+ </map>
+ <key>ESTATE_ACCESS_BANNED_AGENT_REMOVE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>128</integer>
+ <key>tooltip</key>
+ <string>Remove the agent from this estate's Banned residents list.</string>
+ </map>
+ <key>FALSE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string>An integer constant for boolean comparisons. Has the value '0'.</string>
+ </map>
+ <key>FORCE_DIRECT_PATH</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>Makes character navigate in a straight line toward position. May be set to TRUE or FALSE.</string>
+ </map>
+ <key>FRICTION</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string>Used with llSetPhysicsMaterial to enable the friction value. Must be between 0.0 and 255.0</string>
+ </map>
+ <key>GCNP_RADIUS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>GCNP_STATIC</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>GRAVITY_MULTIPLIER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>8</integer>
+ <key>tooltip</key>
+ <string>Used with llSetPhysicsMaterial to enable the gravity multiplier value. Must be between -1.0 and +28.0</string>
+ </map>
+ <key>HORIZONTAL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>HTTP_BODY_MAXLENGTH</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>HTTP_BODY_TRUNCATED</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>HTTP_CUSTOM_HEADER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string>Add an extra custom HTTP header to the request. The first string is the name of the parameter to change, e.g. "Pragma", and the second string is the value, e.g. "no-cache". Up to 8 custom headers may be configured per request. Note that certain headers, such as the default headers, are blocked for security reasons.</string>
+ </map>
+ <key>HTTP_METHOD</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>HTTP_MIMETYPE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>HTTP_PRAGMA_NO_CACHE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>6</integer>
+ <key>tooltip</key>
+ <string>Allows enabling/disbling of the "Pragma: no-cache" header.\nUsage: [HTTP_PRAGMA_NO_CACHE, integer SendHeader]. When SendHeader is TRUE, the "Pragma: no-cache" header is sent by the script. This matches the default behavior. When SendHeader is FALSE, no "Pragma" header is sent by the script.</string>
+ </map>
+ <key>HTTP_VERBOSE_THROTTLE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>HTTP_VERIFY_CERT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>INVENTORY_ALL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>-1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>INVENTORY_ANIMATION</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>20</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>INVENTORY_BODYPART</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>13</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>INVENTORY_CLOTHING</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>INVENTORY_GESTURE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>21</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>INVENTORY_LANDMARK</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>INVENTORY_NONE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>-1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>INVENTORY_NOTECARD</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>7</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>INVENTORY_OBJECT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>6</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>INVENTORY_SCRIPT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>10</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>INVENTORY_SOUND</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>INVENTORY_TEXTURE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>JSON_APPEND</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>-1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>JSON_ARRAY</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>value</key>
+ <string>U+FDD2</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>JSON_DELETE</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>value</key>
+ <string>U+FDD8</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>JSON_FALSE</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>value</key>
+ <string>U+FDD7</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>JSON_INVALID</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>value</key>
+ <string>U+FDD0</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>JSON_NULL</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>value</key>
+ <string>U+FDD5</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>JSON_NUMBER</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>value</key>
+ <string>U+FDD3</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>JSON_OBJECT</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>value</key>
+ <string>U+FDD1</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>JSON_STRING</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>value</key>
+ <string>U+FDD4</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>JSON_TRUE</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>value</key>
+ <string>U+FDD6</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>KFM_CMD_PAUSE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string>For use with KFM_COMMAND.</string>
+ </map>
+ <key>KFM_CMD_PLAY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string>For use with KFM_COMMAND.</string>
+ </map>
+ <key>KFM_CMD_STOP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>For use with KFM_COMMAND.</string>
+ </map>
+ <key>KFM_COMMAND</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>KFM_DATA</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>KFM_FORWARD</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string>For use with KFM_MODE.</string>
+ </map>
+ <key>KFM_LOOP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>For use with KFM_MODE.</string>
+ </map>
+ <key>KFM_MODE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>KFM_PING_PONG</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string>For use with KFM_MODE.</string>
+ </map>
+ <key>KFM_REVERSE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string>For use with KFM_MODE.</string>
+ </map>
+ <key>KFM_ROTATION</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>For use with KFM_DATA.</string>
+ </map>
+ <key>KFM_TRANSLATION</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string>For use with KFM_DATA.</string>
+ </map>
+ <key>LAND_LARGE_BRUSH</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string>Use a large brush size.\nNOTE: This value is incorrect, a large brush should be 2.</string>
+ </map>
+ <key>LAND_LEVEL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string>Action to level the land.</string>
+ </map>
+ <key>LAND_LOWER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string>Action to lower the land.</string>
+ </map>
+ <key>LAND_MEDIUM_BRUSH</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string>Use a medium brush size.\nNOTE: This value is incorrect, a medium brush should be 1.</string>
+ </map>
+ <key>LAND_NOISE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>LAND_RAISE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>Action to raise the land.</string>
+ </map>
+ <key>LAND_REVERT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>LAND_SMALL_BRUSH</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>Use a small brush size.\nNOTE: This value is incorrect, a small brush should be 0.</string>
+ </map>
+ <key>LAND_SMOOTH</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>LINK_ALL_CHILDREN</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>-3</integer>
+ <key>tooltip</key>
+ <string>This targets every object except the root in the linked set.</string>
+ </map>
+ <key>LINK_ALL_OTHERS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>-2</integer>
+ <key>tooltip</key>
+ <string>This targets every object in the linked set except the object with the script.</string>
+ </map>
+ <key>LINK_ROOT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>This targets the root of the linked set.</string>
+ </map>
+ <key>LINK_SET</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>-1</integer>
+ <key>tooltip</key>
+ <string>This targets every object in the linked set.</string>
+ </map>
+ <key>LINK_THIS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>-4</integer>
+ <key>tooltip</key>
+ <string>The link number of the prim containing the script.</string>
+ </map>
+ <key>LIST_STAT_GEOMETRIC_MEAN</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>9</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>LIST_STAT_MAX</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>LIST_STAT_MEAN</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>LIST_STAT_MEDIAN</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>LIST_STAT_MIN</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>LIST_STAT_NUM_COUNT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>8</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>LIST_STAT_RANGE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>LIST_STAT_STD_DEV</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>LIST_STAT_SUM</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>6</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>LIST_STAT_SUM_SQUARES</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>7</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>LOOP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x2</string>
+ <key>tooltip</key>
+ <string>Loop the texture animation.</string>
+ </map>
+ <key>MASK_BASE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>MASK_EVERYONE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>MASK_GROUP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>MASK_NEXT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>MASK_OWNER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>NULL_KEY</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>value</key>
+ <uuid>00000000-0000-0000-0000-000000000000</uuid>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>OBJECT_ATTACHED_POINT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>19</integer>
+ <key>tooltip</key>
+ <string>Gets the attachment point to which the object is attached.\nReturns 0 if the object is not an attachment (or is an avatar, etc).</string>
+ </map>
+ <key>OBJECT_CHARACTER_TIME</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>17</integer>
+ <key>tooltip</key>
+ <string>Units in seconds</string>
+ </map>
+ <key>OBJECT_CREATOR</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>8</integer>
+ <key>tooltip</key>
+ <string>Gets the object's creator key. If id is an avatar, a NULL_KEY is returned.</string>
+ </map>
+ <key>OBJECT_DESC</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string>Gets the object's description. If id is an avatar, an empty string is returned.</string>
+ </map>
+ <key>OBJECT_GROUP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>7</integer>
+ <key>tooltip</key>
+ <string>Gets the prims's group key. If id is an avatar, a NULL_KEY is returned.</string>
+ </map>
+ <key>OBJECT_NAME</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>Gets the object's name.</string>
+ </map>
+ <key>OBJECT_OWNER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>6</integer>
+ <key>tooltip</key>
+ <string>Gets an object's owner's key. If id is group owned, a NULL_KEY is returned.</string>
+ </map>
+ <key>OBJECT_PATHFINDING_TYPE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>20</integer>
+ <key>tooltip</key>
+ <string>Returns the pathfinding setting of any object in the region. It returns an integer matching one of the OPT_* constants.</string>
+ </map>
+ <key>OBJECT_PHANTOM</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>22</integer>
+ <key>tooltip</key>
+ <string>Returns boolean, detailing if phantom is enabled or disabled on the object.\nIf id is an avatar or attachment, 0 is returned.</string>
+ </map>
+ <key>OBJECT_PHYSICS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>21</integer>
+ <key>tooltip</key>
+ <string>Returns boolean, detailing if physics is enabled or disabled on the object.\nIf id is an avatar or attachment, 0 is returned.</string>
+ </map>
+ <key>OBJECT_PHYSICS_COST</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>16</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>OBJECT_POS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string>Gets the object's position in region coordinates.</string>
+ </map>
+ <key>OBJECT_PRIM_EQUIVALENCE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>13</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>OBJECT_RENDER_WEIGHT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>24</integer>
+ <key>tooltip</key>
+ <string>This is a flag used with llGetObjectDetails to get the Avatar_Rendering_Cost of an avatar, based on values reported by nearby viewers.\nIf no data is available, -1 is returned.\nThe maximum render weight stored by the simulator is 500000. When called against an object, 0 is returned.</string>
+ </map>
+ <key>OBJECT_RETURN_PARCEL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>OBJECT_RETURN_PARCEL_OWNER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>OBJECT_RETURN_REGION</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>OBJECT_ROOT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>18</integer>
+ <key>tooltip</key>
+ <string>Gets the id of the root prim of the object requested.\nIf id is an avatar, return the id of the root prim of the linkset the avatar is sitting on (or the avatar's own id if the avatar is not sitting on an object within the region).</string>
+ </map>
+ <key>OBJECT_ROT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string>Gets the object's rotation.</string>
+ </map>
+ <key>OBJECT_RUNNING_SCRIPT_COUNT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>9</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>OBJECT_SCRIPT_MEMORY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>11</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>OBJECT_SCRIPT_TIME</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>12</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>OBJECT_SERVER_COST</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>14</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>OBJECT_STREAMING_COST</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>15</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>OBJECT_TEMP_ON_REZ</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>23</integer>
+ <key>tooltip</key>
+ <string>Returns boolean, detailing if temporary is enabled or disabled on the object.</string>
+ </map>
+ <key>OBJECT_TOTAL_SCRIPT_COUNT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>10</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>OBJECT_UNKNOWN_DETAIL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>-1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>OBJECT_VELOCITY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string>Gets the object's velocity.</string>
+ </map>
+ <key>OPT_AVATAR</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>Returned for avatars.</string>
+ </map>
+ <key>OPT_CHARACTER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string>Returned for pathfinding characters.</string>
+ </map>
+ <key>OPT_EXCLUSION_VOLUME</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>6</integer>
+ <key>tooltip</key>
+ <string>Returned for exclusion volumes.</string>
+ </map>
+ <key>OPT_LEGACY_LINKSET</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string>Returned for movable obstacles, movable phantoms, physical, and volumedetect objects.</string>
+ </map>
+ <key>OPT_MATERIAL_VOLUME</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string>Returned for material volumes.</string>
+ </map>
+ <key>OPT_OTHER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>-1</integer>
+ <key>tooltip</key>
+ <string>Returned for attachments, Linden trees, and grass.</string>
+ </map>
+ <key>OPT_STATIC_OBSTACLE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string>Returned for static obstacles.</string>
+ </map>
+ <key>OPT_WALKABLE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string>Returned for walkable objects.</string>
+ </map>
+ <key>PARCEL_COUNT_GROUP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_COUNT_OTHER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_COUNT_OWNER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_COUNT_SELECTED</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_COUNT_TEMP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_COUNT_TOTAL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_DETAILS_AREA</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string>The parcel's area, in square meters. (5 chars.).</string>
+ </map>
+ <key>PARCEL_DETAILS_DESC</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>The description of the parcel. (127 chars).</string>
+ </map>
+ <key>PARCEL_DETAILS_GROUP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string>The parcel group's key. (36 chars.).</string>
+ </map>
+ <key>PARCEL_DETAILS_ID</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string>The parcel's key. (36 chars.).</string>
+ </map>
+ <key>PARCEL_DETAILS_NAME</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string>The name of the parcel. (63 chars.).</string>
+ </map>
+ <key>PARCEL_DETAILS_OWNER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string>The parcel owner's key. (36 chars.).</string>
+ </map>
+ <key>PARCEL_DETAILS_SEE_AVATARS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>6</integer>
+ <key>tooltip</key>
+ <string>The parcel's avatar visibility setting. (1 char.).</string>
+ </map>
+ <key>PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x08000000</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x4000000</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_FLAG_ALLOW_CREATE_OBJECTS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x40</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_FLAG_ALLOW_DAMAGE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x20</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_FLAG_ALLOW_FLY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x1</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x10000000</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_FLAG_ALLOW_GROUP_SCRIPTS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x2000000</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_FLAG_ALLOW_LANDMARK</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x8</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_FLAG_ALLOW_SCRIPTS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x2</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_FLAG_ALLOW_TERRAFORM</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x10</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_FLAG_LOCAL_SOUND_ONLY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x8000</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_FLAG_RESTRICT_PUSHOBJECT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x200000</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_FLAG_USE_ACCESS_GROUP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x100</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_FLAG_USE_ACCESS_LIST</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x200</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_FLAG_USE_BAN_LIST</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x400</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_FLAG_USE_LAND_PASS_LIST</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x800</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_MEDIA_COMMAND_AGENT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>7</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_MEDIA_COMMAND_AUTO_ALIGN</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>9</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_MEDIA_COMMAND_DESC</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>12</integer>
+ <key>tooltip</key>
+ <string>Use this to get or set the parcel media description.</string>
+ </map>
+ <key>PARCEL_MEDIA_COMMAND_LOOP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_MEDIA_COMMAND_LOOP_SET</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>13</integer>
+ <key>tooltip</key>
+ <string>Used to get or set the parcel's media looping variable.</string>
+ </map>
+ <key>PARCEL_MEDIA_COMMAND_PAUSE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_MEDIA_COMMAND_PLAY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_MEDIA_COMMAND_SIZE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>11</integer>
+ <key>tooltip</key>
+ <string>Use this to get or set the parcel media pixel resolution.</string>
+ </map>
+ <key>PARCEL_MEDIA_COMMAND_STOP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_MEDIA_COMMAND_TEXTURE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_MEDIA_COMMAND_TIME</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>6</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_MEDIA_COMMAND_TYPE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>10</integer>
+ <key>tooltip</key>
+ <string>Use this to get or set the parcel media MIME type (e.g. "text/html").</string>
+ </map>
+ <key>PARCEL_MEDIA_COMMAND_UNLOAD</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>8</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PARCEL_MEDIA_COMMAND_URL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PASSIVE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x4</string>
+ <key>tooltip</key>
+ <string>Static in-world objects.</string>
+ </map>
+ <key>PATROL_PAUSE_AT_WAYPOINTS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PAY_DEFAULT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>-2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PAY_HIDE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>-1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PAYMENT_INFO_ON_FILE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PAYMENT_INFO_USED</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PERM_ALL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x7FFFFFFF</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PERM_COPY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x8000</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PERM_MODIFY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x4000</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PERM_MOVE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x80000</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PERM_TRANSFER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x2000</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PERMISSION_ATTACH</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x20</string>
+ <key>tooltip</key>
+ <string>If this permission is enabled, the object can successfully call llAttachToAvatar to attach to the given avatar.</string>
+ </map>
+ <key>PERMISSION_CHANGE_JOINTS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x100</string>
+ <key>tooltip</key>
+ <string>(not yet implemented)</string>
+ </map>
+ <key>PERMISSION_CHANGE_LINKS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x80</string>
+ <key>tooltip</key>
+ <string>If this permission is enabled, the object can successfully call llCreateLink, llBreakLink, and llBreakAllLinks to change links to other objects.</string>
+ </map>
+ <key>PERMISSION_CHANGE_PERMISSIONS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x200</string>
+ <key>tooltip</key>
+ <string>(not yet implemented)</string>
+ </map>
+ <key>PERMISSION_CONTROL_CAMERA</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x800</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PERMISSION_DEBIT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x2</string>
+ <key>tooltip</key>
+ <string>If this permission is enabled, the object can successfully call llGiveMoney or llTransferLindenDollars to debit the owners account.</string>
+ </map>
+ <key>PERMISSION_OVERRIDE_ANIMATIONS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x8000</string>
+ <key>tooltip</key>
+ <string>Permission to override default animations.</string>
+ </map>
+ <key>PERMISSION_RELEASE_OWNERSHIP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x40</string>
+ <key>tooltip</key>
+ <string>(not yet implemented)</string>
+ </map>
+ <key>PERMISSION_REMAP_CONTROLS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x8</string>
+ <key>tooltip</key>
+ <string>(not yet implemented)</string>
+ </map>
+ <key>PERMISSION_RETURN_OBJECTS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>65536</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PERMISSION_SILENT_ESTATE_MANAGEMENT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x4000</string>
+ <key>tooltip</key>
+ <string>A script with this permission does not notify the object owner when it modifies estate access rules via llManageEstateAccess.</string>
+ </map>
+ <key>PERMISSION_TAKE_CONTROLS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x4</string>
+ <key>tooltip</key>
+ <string>If this permission enabled, the object can successfully call the llTakeControls libray call.</string>
+ </map>
+ <key>PERMISSION_TELEPORT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x1000</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PERMISSION_TRACK_CAMERA</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x400</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PERMISSION_TRIGGER_ANIMATION</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x10</string>
+ <key>tooltip</key>
+ <string>If this permission is enabled, the object can successfully call llStartAnimation for the avatar that owns this.</string>
+ </map>
+ <key>PI</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>value</key>
+ <real>3.14159265</real>
+ <key>tooltip</key>
+ <string>3.14159265 - The number of radians in a semi-circle.</string>
+ </map>
+ <key>PI_BY_TWO</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>value</key>
+ <real>1.57079633</real>
+ <key>tooltip</key>
+ <string>1.57079633 - The number of radians in a quarter circle.</string>
+ </map>
+ <key>PING_PONG</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x8</string>
+ <key>tooltip</key>
+ <string>Play animation going forwards, then backwards.</string>
+ </map>
+ <key>PRIM_BUMP_BARK</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_BUMP_BLOBS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>12</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_BUMP_BRICKS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_BUMP_BRIGHT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_BUMP_CHECKER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>6</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_BUMP_CONCRETE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>7</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_BUMP_DARK</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_BUMP_DISKS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>10</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_BUMP_GRAVEL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>11</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_BUMP_LARGETILE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>14</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_BUMP_NONE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_BUMP_SHINY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>19</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_BUMP_SIDING</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>13</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_BUMP_STONE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>9</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_BUMP_STUCCO</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>15</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_BUMP_SUCTION</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>16</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_BUMP_TILE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>8</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_BUMP_WEAVE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>17</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_BUMP_WOOD</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_CAST_SHADOWS</key>
+ <map>
+ <key>deprecated</key>
+ <boolean>true</boolean>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>24</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_COLOR</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>18</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_DESC</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>28</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_FLEXIBLE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>21</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_FULLBRIGHT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>20</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_GLOW</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>25</integer>
+ <key>tooltip</key>
+ <string>PRIM_GLOW is used to get or set the glow status of the face.</string>
+ </map>
+ <key>PRIM_HOLE_CIRCLE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x10</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_HOLE_DEFAULT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x00</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_HOLE_SQUARE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x20</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_HOLE_TRIANGLE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x30</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_LINK_TARGET</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>34</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_MATERIAL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_MATERIAL_FLESH</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_MATERIAL_GLASS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_MATERIAL_LIGHT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>7</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_MATERIAL_METAL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_MATERIAL_PLASTIC</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_MATERIAL_RUBBER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>6</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_MATERIAL_STONE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_MATERIAL_WOOD</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_MEDIA_ALT_IMAGE_ENABLE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string>Boolean. Gets/Sets the default image state (the image that the user sees before a piece of media is active) for the chosen face. The default image is specified by Second Life's server for that media type.</string>
+ </map>
+ <key>PRIM_MEDIA_AUTO_LOOP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string>Boolean. Gets/Sets whether auto-looping is enabled.</string>
+ </map>
+ <key>PRIM_MEDIA_AUTO_PLAY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string>Boolean. Gets/Sets whether the media auto-plays when a Resident can view it.</string>
+ </map>
+ <key>PRIM_MEDIA_AUTO_SCALE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>6</integer>
+ <key>tooltip</key>
+ <string>Boolean. Gets/Sets whether auto-scaling is enabled. Auto-scaling forces the media to the full size of the texture.</string>
+ </map>
+ <key>PRIM_MEDIA_AUTO_ZOOM</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>7</integer>
+ <key>tooltip</key>
+ <string>Boolean. Gets/Sets whether clicking the media triggers auto-zoom and auto-focus on the media.</string>
+ </map>
+ <key>PRIM_MEDIA_CONTROLS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>Integer. Gets/Sets the style of controls. Can be either PRIM_MEDIA_CONTROLS_STANDARD or PRIM_MEDIA_CONTROLS_MINI.</string>
+ </map>
+ <key>PRIM_MEDIA_CONTROLS_MINI</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>Mini web navigation controls; does not include an address bar.</string>
+ </map>
+ <key>PRIM_MEDIA_CONTROLS_STANDARD</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string>Standard web navigation controls.</string>
+ </map>
+ <key>PRIM_MEDIA_CURRENT_URL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string>String. Gets/Sets the current url displayed on the chosen face. Changing this URL causes navigation. 1024 characters Maximum.</string>
+ </map>
+ <key>PRIM_MEDIA_FIRST_CLICK_INTERACT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>8</integer>
+ <key>tooltip</key>
+ <string>Boolean. Gets/Sets whether the first click interaction is enabled.</string>
+ </map>
+ <key>PRIM_MEDIA_HEIGHT_PIXELS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>10</integer>
+ <key>tooltip</key>
+ <string>Integer. Gets/Sets the height of the media in pixels.</string>
+ </map>
+ <key>PRIM_MEDIA_HOME_URL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string>String. Gets/Sets the home URL for the chosen face. 1024 characters maximum.</string>
+ </map>
+ <key>PRIM_MEDIA_MAX_HEIGHT_PIXELS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2048</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_MEDIA_MAX_URL_LENGTH</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1024</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_MEDIA_MAX_WHITELIST_COUNT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>64</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_MEDIA_MAX_WHITELIST_SIZE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1024</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_MEDIA_MAX_WIDTH_PIXELS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2048</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_MEDIA_PARAM_MAX</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>14</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_MEDIA_PERM_ANYONE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_MEDIA_PERM_GROUP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_MEDIA_PERM_NONE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_MEDIA_PERM_OWNER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_MEDIA_PERMS_CONTROL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>14</integer>
+ <key>tooltip</key>
+ <string>Integer. Gets/Sets the permissions mask that control who can see the media control bar above the object:: PRIM_MEDIA_PERM_ANYONE, PRIM_MEDIA_PERM_GROUP, PRIM_MEDIA_PERM_NONE, PRIM_MEDIA_PERM_OWNER</string>
+ </map>
+ <key>PRIM_MEDIA_PERMS_INTERACT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>13</integer>
+ <key>tooltip</key>
+ <string>Integer. Gets/Sets the permissions mask that control who can interact with the object: PRIM_MEDIA_PERM_ANYONE, PRIM_MEDIA_PERM_GROUP, PRIM_MEDIA_PERM_NONE, PRIM_MEDIA_PERM_OWNER</string>
+ </map>
+ <key>PRIM_MEDIA_WHITELIST</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>12</integer>
+ <key>tooltip</key>
+ <string>String. Gets/Sets the white-list as a string of escaped, comma-separated URLs. This string can hold up to 64 URLs or 1024 characters, whichever comes first.</string>
+ </map>
+ <key>PRIM_MEDIA_WHITELIST_ENABLE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>11</integer>
+ <key>tooltip</key>
+ <string>Boolean. Gets/Sets whether navigation is restricted to URLs in PRIM_MEDIA_WHITELIST.</string>
+ </map>
+ <key>PRIM_MEDIA_WIDTH_PIXELS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>9</integer>
+ <key>tooltip</key>
+ <string>Integer. Gets/Sets the width of the media in pixels.</string>
+ </map>
+ <key>PRIM_NAME</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>27</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_OMEGA</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>32</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_PHANTOM</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_PHYSICS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_PHYSICS_SHAPE_CONVEX</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string>Use the convex hull of the prim shape for physics (this is the default for mesh objects).</string>
+ </map>
+ <key>PRIM_PHYSICS_SHAPE_NONE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>Ignore this prim in the physics shape. NB: This cannot be applied to the root prim.</string>
+ </map>
+ <key>PRIM_PHYSICS_SHAPE_PRIM</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string>Use the normal prim shape for physics (this is the default for all non-mesh objects).</string>
+ </map>
+ <key>PRIM_PHYSICS_SHAPE_TYPE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>30</integer>
+ <key>tooltip</key>
+ <string>Allows you to set the physics shape type of a prim via lsl. Permitted values are:
+ PRIM_PHYSICS_SHAPE_NONE, PRIM_PHYSICS_SHAPE_PRIM, PRIM_PHYSICS_SHAPE_CONVEX</string>
+ </map>
+ <key>PRIM_POINT_LIGHT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>23</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_POS_LOCAL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>33</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_POSITION</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>6</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_ROT_LOCAL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>29</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_ROTATION</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>8</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_SCULPT_FLAG_INVERT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>64</integer>
+ <key>tooltip</key>
+ <string>Render inside out (inverts the normals).</string>
+ </map>
+ <key>PRIM_SCULPT_FLAG_MIRROR</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>128</integer>
+ <key>tooltip</key>
+ <string>Render an X axis mirror of the sculpty.</string>
+ </map>
+ <key>PRIM_SCULPT_TYPE_CYLINDER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_SCULPT_TYPE_MASK</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>7</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_SCULPT_TYPE_PLANE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_SCULPT_TYPE_SPHERE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_SCULPT_TYPE_TORUS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_SHINY_HIGH</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_SHINY_LOW</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_SHINY_MEDIUM</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_SHINY_NONE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_SIZE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>7</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_SLICE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>35</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_TEMP_ON_REZ</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_TEXGEN</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>22</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_TEXGEN_DEFAULT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_TEXGEN_PLANAR</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_TEXT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>26</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_TEXTURE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>17</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_TYPE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>9</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_TYPE_BOX</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_TYPE_CYLINDER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_TYPE_PRISM</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_TYPE_RING</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>6</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_TYPE_SCULPT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>7</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_TYPE_SPHERE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_TYPE_TORUS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PRIM_TYPE_TUBE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PROFILE_NONE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string>Disables profiling</string>
+ </map>
+ <key>PROFILE_SCRIPT_MEMORY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>Enables memory profiling</string>
+ </map>
+ <key>PSYS_PART_BF_DEST_COLOR</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PSYS_PART_BF_ONE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PSYS_PART_BF_ONE_MINUS_DEST_COLOR</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PSYS_PART_BF_SOURCE_ALPHA</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>7</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PSYS_PART_BF_SOURCE_COLOR</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PSYS_PART_BF_ZERO</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PSYS_PART_BLEND_FUNC_DEST</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>25</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PSYS_PART_BLEND_FUNC_SOURCE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>24</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PSYS_PART_BOUNCE_MASK</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x4</string>
+ <key>tooltip</key>
+ <string>Particles bounce off of a plane at the objects Z height.</string>
+ </map>
+ <key>PSYS_PART_EMISSIVE_MASK</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x100</string>
+ <key>tooltip</key>
+ <string>The particle glows.</string>
+ </map>
+ <key>PSYS_PART_END_ALPHA</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string>A float which determines the ending alpha of the object.</string>
+ </map>
+ <key>PSYS_PART_END_COLOR</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string>A vector &lt;r, g, b&gt; which determines the ending color of the object.</string>
+ </map>
+ <key>PSYS_PART_END_GLOW</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>27</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PSYS_PART_END_SCALE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>6</integer>
+ <key>tooltip</key>
+ <string>A vector &lt;sx, sy, z&gt;, which is the ending size of the particle billboard in meters (z is ignored).</string>
+ </map>
+ <key>PSYS_PART_FLAGS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string>Each particle that is emitted by the particle system is simulated based on the following flags. To use multiple flags, bitwise or (|) them together.</string>
+ </map>
+ <key>PSYS_PART_FOLLOW_SRC_MASK</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x10</string>
+ <key>tooltip</key>
+ <string>The particle position is relative to the source objects position.</string>
+ </map>
+ <key>PSYS_PART_FOLLOW_VELOCITY_MASK</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x20</string>
+ <key>tooltip</key>
+ <string>The particle orientation is rotated so the vertical axis faces towards the particle velocity.</string>
+ </map>
+ <key>PSYS_PART_INTERP_COLOR_MASK</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x1</string>
+ <key>tooltip</key>
+ <string>Interpolate both the color and alpha from the start value to the end value.</string>
+ </map>
+ <key>PSYS_PART_INTERP_SCALE_MASK</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x2</string>
+ <key>tooltip</key>
+ <string>Interpolate the particle scale from the start value to the end value.</string>
+ </map>
+ <key>PSYS_PART_MAX_AGE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>19</integer>
+ <key>tooltip</key>
+ <string>Age in seconds of a particle at which it dies.</string>
+ </map>
+ <key>PSYS_PART_RIBBON_MASK</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x400</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PSYS_PART_START_ALPHA</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string>A float which determines the starting alpha of the object.</string>
+ </map>
+ <key>PSYS_PART_START_COLOR</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>A vector &lt;r.r, g.g, b.b&gt; which determines the starting color of the object.</string>
+ </map>
+ <key>PSYS_PART_START_GLOW</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>26</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PSYS_PART_START_SCALE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string>A vector &lt;sx, sy, z&gt;, which is the starting size of the particle billboard in meters (z is ignored).</string>
+ </map>
+ <key>PSYS_PART_TARGET_LINEAR_MASK</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x80</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PSYS_PART_TARGET_POS_MASK</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x40</string>
+ <key>tooltip</key>
+ <string>The particle heads towards the location of the target object as defined by PSYS_SRC_TARGET_KEY.</string>
+ </map>
+ <key>PSYS_PART_WIND_MASK</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x8</string>
+ <key>tooltip</key>
+ <string>Particles have their velocity damped towards the wind velocity.</string>
+ </map>
+ <key>PSYS_SRC_ACCEL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>8</integer>
+ <key>tooltip</key>
+ <string>A vector &lt;x, y, z&gt; which is the acceleration to apply on particles.</string>
+ </map>
+ <key>PSYS_SRC_ANGLE_BEGIN</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>22</integer>
+ <key>tooltip</key>
+ <string>Area in radians specifying where particles will NOT be created (for ANGLE patterns)</string>
+ </map>
+ <key>PSYS_SRC_ANGLE_END</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>23</integer>
+ <key>tooltip</key>
+ <string>Area in radians filled with particles (for ANGLE patterns) (if lower than PSYS_SRC_ANGLE_BEGIN, acts as PSYS_SRC_ANGLE_BEGIN itself, and PSYS_SRC_ANGLE_BEGIN acts as PSYS_SRC_ANGLE_END).</string>
+ </map>
+ <key>PSYS_SRC_BURST_PART_COUNT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>15</integer>
+ <key>tooltip</key>
+ <string>How many particles to release in a burst.</string>
+ </map>
+ <key>PSYS_SRC_BURST_RADIUS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>16</integer>
+ <key>tooltip</key>
+ <string>What distance from the center of the object to create the particles.</string>
+ </map>
+ <key>PSYS_SRC_BURST_RATE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>13</integer>
+ <key>tooltip</key>
+ <string>How often to release a particle burst (float seconds).</string>
+ </map>
+ <key>PSYS_SRC_BURST_SPEED_MAX</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>18</integer>
+ <key>tooltip</key>
+ <string>Maximum speed that a particle should be moving.</string>
+ </map>
+ <key>PSYS_SRC_BURST_SPEED_MIN</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>17</integer>
+ <key>tooltip</key>
+ <string>Minimum speed that a particle should be moving.</string>
+ </map>
+ <key>PSYS_SRC_INNERANGLE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>10</integer>
+ <key>tooltip</key>
+ <string>Specifies the inner angle of the arc created by the PSYS_SRC_PATTERN_ANGLE or PSYS_SRC_PATTERN_ANGLE_CONE source pattern.
+ The area specified will NOT have particles in it.</string>
+ </map>
+ <key>PSYS_SRC_MAX_AGE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>19</integer>
+ <key>tooltip</key>
+ <string>How long this particle system should last, 0.0 means forever.</string>
+ </map>
+ <key>PSYS_SRC_OMEGA</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>21</integer>
+ <key>tooltip</key>
+ <string>Sets the angular velocity to rotate the axis that SRC_PATTERN_ANGLE and SRC_PATTERN_ANGLE_CONE use.</string>
+ </map>
+ <key>PSYS_SRC_OUTERANGLE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>11</integer>
+ <key>tooltip</key>
+ <string>Specifies the outer angle of the arc created by the PSYS_SRC_PATTERN_ANGLE or PSYS_SRC_PATTERN_ANGLE_CONE source pattern.
+ The area between the outer and inner angle will be filled with particles.</string>
+ </map>
+ <key>PSYS_SRC_PATTERN</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>9</integer>
+ <key>tooltip</key>
+ <string>The pattern which is used to generate particles.
+ Use one of the following values: PSYS_SRC_PATTERN Values.</string>
+ </map>
+ <key>PSYS_SRC_PATTERN_ANGLE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x04</string>
+ <key>tooltip</key>
+ <string>Shoot particles across a 2 dimensional area defined by the arc created from PSYS_SRC_OUTERANGLE. There will be an open area defined by PSYS_SRC_INNERANGLE within the larger arc.</string>
+ </map>
+ <key>PSYS_SRC_PATTERN_ANGLE_CONE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x08</string>
+ <key>tooltip</key>
+ <string>Shoot particles out in a 3 dimensional cone with an outer arc of PSYS_SRC_OUTERANGLE and an inner open area defined by PSYS_SRC_INNERANGLE.</string>
+ </map>
+ <key>PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x10</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PSYS_SRC_PATTERN_DROP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x01</string>
+ <key>tooltip</key>
+ <string>Drop particles at the source position.</string>
+ </map>
+ <key>PSYS_SRC_PATTERN_EXPLODE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x02</string>
+ <key>tooltip</key>
+ <string>Shoot particles out in all directions, using the burst parameters.</string>
+ </map>
+ <key>PSYS_SRC_TARGET_KEY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>20</integer>
+ <key>tooltip</key>
+ <string>The key of a target object to move towards if PSYS_PART_TARGET_POS_MASK is enabled.</string>
+ </map>
+ <key>PSYS_SRC_TEXTURE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>12</integer>
+ <key>tooltip</key>
+ <string>An asset name for the texture to use for the particles.</string>
+ </map>
+ <key>PU_EVADE_HIDDEN</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x07</string>
+ <key>tooltip</key>
+ <string>Triggered when an llEvade character thinks it has hidden from its pursuer.</string>
+ </map>
+ <key>PU_EVADE_SPOTTED</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x08</string>
+ <key>tooltip</key>
+ <string>Triggered when an llEvade character switches from hiding to running</string>
+ </map>
+ <key>PU_FAILURE_DYNAMIC_PATHFINDING_DISABLED</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>10</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PU_FAILURE_INVALID_GOAL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x03</string>
+ <key>tooltip</key>
+ <string>Goal is not on the navigation-mesh and cannot be reached.</string>
+ </map>
+ <key>PU_FAILURE_INVALID_START</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x02</string>
+ <key>tooltip</key>
+ <string>Character cannot navigate from the current location - e.g., the character is off the navmesh or too high above it.</string>
+ </map>
+ <key>PU_FAILURE_NO_NAVMESH</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x09</string>
+ <key>tooltip</key>
+ <string>This is a fatal error reported to a character when there is no navmesh for the region. This usually indicates a server failure and users should file a bug report and include the time and region in which they received this message.</string>
+ </map>
+ <key>PU_FAILURE_NO_VALID_DESTINATION</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x06</string>
+ <key>tooltip</key>
+ <string>There is no good place for the character to go - e.g., it is patrolling and all the patrol points are now unreachable.</string>
+ </map>
+ <key>PU_FAILURE_OTHER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1000000</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PU_FAILURE_PARCEL_UNREACHABLE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>11</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PU_FAILURE_TARGET_GONE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x05</string>
+ <key>tooltip</key>
+ <string>Target (for llPursue or llEvade) can no longer be tracked - e.g., it left the region or is an avatar that is now more than about 30m outside the region.</string>
+ </map>
+ <key>PU_FAILURE_UNREACHABLE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x04</string>
+ <key>tooltip</key>
+ <string>Goal is no longer reachable for some reason - e.g., an obstacle blocks the path.</string>
+ </map>
+ <key>PU_GOAL_REACHED</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x01</string>
+ <key>tooltip</key>
+ <string>Character has reached the goal and will stop or choose a new goal (if wandering).</string>
+ </map>
+ <key>PU_SLOWDOWN_DISTANCE_REACHED</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x00</string>
+ <key>tooltip</key>
+ <string>Character is near current goal.</string>
+ </map>
+ <key>PUBLIC_CHANNEL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string>PUBLIC_CHANNEL is an integer constant that, when passed to llSay, llWhisper, or llShout as a channel parameter, will print text to the publicly heard chat channel.</string>
+ </map>
+ <key>PURSUIT_FUZZ_FACTOR</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string>Selects a random destination near the offset.</string>
+ </map>
+ <key>PURSUIT_GOAL_TOLERANCE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>PURSUIT_INTERCEPT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string>Define whether the character attempts to predict the target's location.</string>
+ </map>
+ <key>PURSUIT_OFFSET</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>Go to a position offset from the target.</string>
+ </map>
+ <key>RAD_TO_DEG</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>value</key>
+ <real>57.2957795</real>
+ <key>tooltip</key>
+ <string>57.2957795 - Number of degrees per radian. You can use this number to convert radians to degrees by multiplying the radians by this number.</string>
+ </map>
+ <key>RC_DATA_FLAGS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>RC_DETECT_PHANTOM</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>RC_GET_LINK_NUM</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>RC_GET_NORMAL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>RC_GET_ROOT_KEY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>RC_MAX_HITS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>RC_REJECT_AGENTS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>RC_REJECT_LAND</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>8</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>RC_REJECT_NONPHYSICAL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>RC_REJECT_PHYSICAL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>RC_REJECT_TYPES</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>RCERR_CAST_TIME_EXCEEDED</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>-3</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>RCERR_SIM_PERF_LOW</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>-2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>RCERR_UNKNOWN</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>-1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>REGION_FLAG_ALLOW_DAMAGE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x1</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>REGION_FLAG_ALLOW_DIRECT_TELEPORT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x100000</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>REGION_FLAG_BLOCK_FLY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x80000</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>REGION_FLAG_BLOCK_TERRAFORM</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x40</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>REGION_FLAG_DISABLE_COLLISIONS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x1000</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>REGION_FLAG_DISABLE_PHYSICS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x4000</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>REGION_FLAG_FIXED_SUN</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x10</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>REGION_FLAG_RESTRICT_PUSHOBJECT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x400000</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>REGION_FLAG_SANDBOX</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x100</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>REMOTE_DATA_CHANNEL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>REMOTE_DATA_REPLY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>REMOTE_DATA_REQUEST</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>REQUIRE_LINE_OF_SIGHT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string>Define whether the character needs a line-of-sight to give chase.</string>
+ </map>
+ <key>RESTITUTION</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string>Used with llSetPhysicsMaterial to enable the density value. Must be between 0.0 and 1.0</string>
+ </map>
+ <key>REVERSE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x4</string>
+ <key>tooltip</key>
+ <string>Play animation in reverse direction.</string>
+ </map>
+ <key>ROTATE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x20</string>
+ <key>tooltip</key>
+ <string>Animate texture rotation.</string>
+ </map>
+ <key>SCALE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x40</string>
+ <key>tooltip</key>
+ <string>Animate the texture scale.</string>
+ </map>
+ <key>SCRIPTED</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x8</string>
+ <key>tooltip</key>
+ <string>Scripted in-world objects.</string>
+ </map>
+ <key>SIM_STAT_PCT_CHARS_STEPPED</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string>Returns the % of pathfinding characters skipped each frame, averaged over the last minute.\nThe returned value corresponds to the "Characters Updated" stat in the viewer's Statistics Bar.</string>
+ </map>
+ <key>SMOOTH</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x10</string>
+ <key>tooltip</key>
+ <string>Slide in the X direction, instead of playing separate frames.</string>
+ </map>
+ <key>SQRT2</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>value</key>
+ <real>1.41421356</real>
+ <key>tooltip</key>
+ <string>1.41421356 - The square root of 2.</string>
+ </map>
+ <key>STATUS_BLOCK_GRAB</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>64</integer>
+ <key>tooltip</key>
+ <string>Controls whether the object can be grabbed.\nA grab is the default action when in third person, and is available as the hand tool in build mode. This is useful for physical objects that you don't want other people to be able to trivially disturb. The default is FALSE</string>
+ </map>
+ <key>STATUS_BLOCK_GRAB_OBJECT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1024</integer>
+ <key>tooltip</key>
+ <string>Prevent click-and-drag movement on all prims in the object.</string>
+ </map>
+ <key>STATUS_BOUNDS_ERROR</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1002</integer>
+ <key>tooltip</key>
+ <string>Argument(s) passed to function had a bounds error.</string>
+ </map>
+ <key>STATUS_CAST_SHADOWS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x200</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>STATUS_DIE_AT_EDGE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x80</string>
+ <key>tooltip</key>
+ <string>Controls whether the object is returned to the owners inventory if it wanders off the edge of the world.\nIt is useful to set this status TRUE for things like bullets or rockets. The default is TRUE</string>
+ </map>
+ <key>STATUS_INTERNAL_ERROR</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1999</integer>
+ <key>tooltip</key>
+ <string>An internal error occurred.</string>
+ </map>
+ <key>STATUS_MALFORMED_PARAMS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1000</integer>
+ <key>tooltip</key>
+ <string>Function was called with malformed parameters.</string>
+ </map>
+ <key>STATUS_NOT_FOUND</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1003</integer>
+ <key>tooltip</key>
+ <string>Object or other item was not found.</string>
+ </map>
+ <key>STATUS_NOT_SUPPORTED</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1004</integer>
+ <key>tooltip</key>
+ <string>Feature not supported.</string>
+ </map>
+ <key>STATUS_OK</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string>Result of function call was a success.</string>
+ </map>
+ <key>STATUS_PHANTOM</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x10</string>
+ <key>tooltip</key>
+ <string>Controls/indicates whether the object collides or not.\nSetting the value to TRUE makes the object non-colliding with all objects. It is a good idea to use this for most objects that move or rotate, but are non-physical. It is also useful for simulating volumetric lighting. The default is FALSE.</string>
+ </map>
+ <key>STATUS_PHYSICS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x1</string>
+ <key>tooltip</key>
+ <string>Controls/indicates whether the object moves physically.\nThis controls the same flag that the UI check-box for Physical controls. The default is FALSE.</string>
+ </map>
+ <key>STATUS_RETURN_AT_EDGE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x100</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>STATUS_ROTATE_X</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x2</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>STATUS_ROTATE_Y</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x4</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>STATUS_ROTATE_Z</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x8</string>
+ <key>tooltip</key>
+ <string>Controls/indicates whether the object can physically rotate around
+ the specific axis or not. This flag has no meaning
+ for non-physical objects. Set the value to FALSE
+ if you want to disable rotation around that axis. The
+ default is TRUE for a physical object.
+ A useful example to think about when visualizing
+ the effect is a sit-and-spin device. They spin around the
+ Z axis (up) but not around the X or Y axis.</string>
+ </map>
+ <key>STATUS_SANDBOX</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x20</string>
+ <key>tooltip</key>
+ <string>Controls/indicates whether the object can cross region boundaries
+ and move more than 20 meters from its creation
+ point. The default if FALSE.</string>
+ </map>
+ <key>STATUS_TYPE_MISMATCH</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1001</integer>
+ <key>tooltip</key>
+ <string>Argument(s) passed to function had a type mismatch.</string>
+ </map>
+ <key>STATUS_WHITELIST_FAILED</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2001</integer>
+ <key>tooltip</key>
+ <string>Whitelist Failed.</string>
+ </map>
+ <key>STRING_TRIM</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x03</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>STRING_TRIM_HEAD</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x01</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>STRING_TRIM_TAIL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x02</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>TEXTURE_BLANK</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>value</key>
+ <uuid>5748decc-f629-461c-9a36-a35a221fe21f</uuid>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>TEXTURE_DEFAULT</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>value</key>
+ <uuid>89556747-24cb-43ed-920b-47caed15465f</uuid>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>TEXTURE_MEDIA</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>value</key>
+ <uuid>8b5fec65-8d8d-9dc5-cda8-8fdf2716e361</uuid>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>TEXTURE_PLYWOOD</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>value</key>
+ <uuid>89556747-24cb-43ed-920b-47caed15465f</uuid>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>TEXTURE_TRANSPARENT</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>value</key>
+ <uuid>8dcd4a48-2d37-4909-9f78-f7a9eb4ef903</uuid>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>TOUCH_INVALID_FACE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0xFFFFFFFF</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>TOUCH_INVALID_TEXCOORD</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>value</key>
+ <string>&lt;-1.0, -1.0, 0.0&gt;</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>TOUCH_INVALID_VECTOR</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>value</key>
+ <string>&lt;0.0, 0.0, 0.0&gt;</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>TRAVERSAL_TYPE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>7</integer>
+ <key>tooltip</key>
+ <string>One of TRAVERSAL_TYPE_FAST, TRAVERSAL_TYPE_SLOW, and TRAVERSAL_TYPE_NONE.</string>
+ </map>
+ <key>TRAVERSAL_TYPE_FAST</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>TRAVERSAL_TYPE_NONE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>TRAVERSAL_TYPE_SLOW</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>TRUE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>An integer constant for boolean comparisons. Has the value '1'.</string>
+ </map>
+ <key>TWO_PI</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>value</key>
+ <real>6.28318530</real>
+ <key>tooltip</key>
+ <string>6.28318530 - The radians of a circle.</string>
+ </map>
+ <key>TYPE_FLOAT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string>The list entry is a float.</string>
+ </map>
+ <key>TYPE_INTEGER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>The list entry is an integer.</string>
+ </map>
+ <key>TYPE_INVALID</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string>The list entry is invalid.</string>
+ </map>
+ <key>TYPE_KEY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string>The list entry is a key.</string>
+ </map>
+ <key>TYPE_ROTATION</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>6</integer>
+ <key>tooltip</key>
+ <string>The list entry is a rotation.</string>
+ </map>
+ <key>TYPE_STRING</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string>The list entry is a string.</string>
+ </map>
+ <key>TYPE_VECTOR</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string>The list entry is a vector.</string>
+ </map>
+ <key>URL_REQUEST_DENIED</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>value</key>
+ <string>URL_REQUEST_DENIED</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>URL_REQUEST_GRANTED</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>value</key>
+ <string>URL_REQUEST_GRANTED</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>32</integer>
+ <key>tooltip</key>
+ <string>A slider between minimum (0.0) and maximum (1.0) deflection of angular orientation. That is, its a simple scalar for modulating the strength of angular deflection such that the vehicles preferred axis of motion points toward its real velocity.</string>
+ </map>
+ <key>VEHICLE_ANGULAR_DEFLECTION_TIMESCALE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>33</integer>
+ <key>tooltip</key>
+ <string>The time-scale for exponential success of linear deflection deflection. Its another way to specify the strength of the vehicles tendency to reorient itself so that its preferred axis of motion agrees with its true velocity.</string>
+ </map>
+ <key>VEHICLE_ANGULAR_FRICTION_TIMESCALE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>17</integer>
+ <key>tooltip</key>
+ <string>A vector of timescales for exponential decay of the vehicles angular velocity about its preferred axes of motion (at, left, up).
+ Range = [0.07, inf) seconds for each element of the vector.</string>
+ </map>
+ <key>VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>35</integer>
+ <key>tooltip</key>
+ <string>The timescale for exponential decay of the angular motors magnitude.</string>
+ </map>
+ <key>VEHICLE_ANGULAR_MOTOR_DIRECTION</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>19</integer>
+ <key>tooltip</key>
+ <string>The direction and magnitude (in preferred frame) of the vehicles angular motor.The vehicle will accelerate (or decelerate if necessary) to match its velocity to its motor.</string>
+ </map>
+ <key>VEHICLE_ANGULAR_MOTOR_TIMESCALE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>34</integer>
+ <key>tooltip</key>
+ <string>The timescale for exponential approach to full angular motor velocity.</string>
+ </map>
+ <key>VEHICLE_BANKING_EFFICIENCY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>38</integer>
+ <key>tooltip</key>
+ <string>A slider between anti (-1.0), none (0.0), and maxmum (1.0) banking strength.</string>
+ </map>
+ <key>VEHICLE_BANKING_MIX</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>39</integer>
+ <key>tooltip</key>
+ <string>A slider between static (0.0) and dynamic (1.0) banking. "Static" means the banking scales only with the angle of roll, whereas "dynamic" is a term that also scales with the vehicles linear speed.</string>
+ </map>
+ <key>VEHICLE_BANKING_TIMESCALE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>40</integer>
+ <key>tooltip</key>
+ <string>The timescale for banking to exponentially approach its maximum effect. This is another way to scale the strength of the banking effect, however it affects the term that is proportional to the difference between what the banking behavior is trying to do, and what the vehicle is actually doing.</string>
+ </map>
+ <key>VEHICLE_BUOYANCY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>27</integer>
+ <key>tooltip</key>
+ <string>A slider between minimum (0.0) and maximum anti-gravity (1.0).</string>
+ </map>
+ <key>VEHICLE_FLAG_CAMERA_DECOUPLED</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x200</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x10</string>
+ <key>tooltip</key>
+ <string>Hover at global height.</string>
+ </map>
+ <key>VEHICLE_FLAG_HOVER_TERRAIN_ONLY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x8</string>
+ <key>tooltip</key>
+ <string>Ignore water height when hovering.</string>
+ </map>
+ <key>VEHICLE_FLAG_HOVER_UP_ONLY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x20</string>
+ <key>tooltip</key>
+ <string>Hover does not push down. Use this flag for hovering vehicles that should be able to jump above their hover height.</string>
+ </map>
+ <key>VEHICLE_FLAG_HOVER_WATER_ONLY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x4</string>
+ <key>tooltip</key>
+ <string>Ignore terrain height when hovering.</string>
+ </map>
+ <key>VEHICLE_FLAG_LIMIT_MOTOR_UP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x40</string>
+ <key>tooltip</key>
+ <string>Prevents ground vehicles from motoring into the sky.</string>
+ </map>
+ <key>VEHICLE_FLAG_LIMIT_ROLL_ONLY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x2</string>
+ <key>tooltip</key>
+ <string>For vehicles with vertical attractor that want to be able to climb/dive, for instance, aeroplanes that want to use the banking feature.</string>
+ </map>
+ <key>VEHICLE_FLAG_MOUSELOOK_BANK</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x100</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>VEHICLE_FLAG_MOUSELOOK_STEER</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x80</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>VEHICLE_FLAG_NO_DEFLECTION_UP</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x1</string>
+ <key>tooltip</key>
+ <string>This flag prevents linear deflection parallel to world z-axis. This is useful for preventing ground vehicles with large linear deflection, like bumper cars, from climbing their linear deflection into the sky.</string>
+ </map>
+ <key>VEHICLE_FLAG_NO_FLY_UP</key>
+ <map>
+ <key>deprecated</key>
+ <boolean>true</boolean>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <string>0x1</string>
+ <key>tooltip</key>
+ <string>Old, changed to VEHICLE_FLAG_NO_DEFLECTION_UP</string>
+ </map>
+ <key>VEHICLE_HOVER_EFFICIENCY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>25</integer>
+ <key>tooltip</key>
+ <string>A slider between minimum (0.0 = bouncy) and maximum (1.0 = fast as possible) damped motion of the hover behavior. </string>
+ </map>
+ <key>VEHICLE_HOVER_HEIGHT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>24</integer>
+ <key>tooltip</key>
+ <string>The height (above the terrain or water, or global) at which the vehicle will try to hover.</string>
+ </map>
+ <key>VEHICLE_HOVER_TIMESCALE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>26</integer>
+ <key>tooltip</key>
+ <string>Period of time (in seconds) for the vehicle to achieve its hover height.</string>
+ </map>
+ <key>VEHICLE_LINEAR_DEFLECTION_EFFICIENCY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>28</integer>
+ <key>tooltip</key>
+ <string>A slider between minimum (0.0) and maximum (1.0) deflection of linear velocity. That is, its a simple scalar for modulating the strength of linear deflection.</string>
+ </map>
+ <key>VEHICLE_LINEAR_DEFLECTION_TIMESCALE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>29</integer>
+ <key>tooltip</key>
+ <string>The timescale for exponential success of linear deflection deflection. It is another way to specify how much time it takes for the vehicles linear velocity to be redirected to its preferred axis of motion.</string>
+ </map>
+ <key>VEHICLE_LINEAR_FRICTION_TIMESCALE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>16</integer>
+ <key>tooltip</key>
+ <string>A vector of timescales for exponential decay of the vehicles linear velocity along its preferred axes of motion (at, left, up).
+ Range = [0.07, inf) seconds for each element of the vector.</string>
+ </map>
+ <key>VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>35</integer>
+ <key>tooltip</key>
+ <string>The timescale for exponential decay of the linear motors magnitude.</string>
+ </map>
+ <key>VEHICLE_LINEAR_MOTOR_DIRECTION</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>18</integer>
+ <key>tooltip</key>
+ <string>The direction and magnitude (in preferred frame) of the vehicles linear motor. The vehicle will accelerate (or decelerate if necessary) to match its velocity to its motor.
+ Range of magnitude = [0, 30] meters/second.</string>
+ </map>
+ <key>VEHICLE_LINEAR_MOTOR_OFFSET</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>20</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>VEHICLE_LINEAR_MOTOR_TIMESCALE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>30</integer>
+ <key>tooltip</key>
+ <string>The timescale for exponential approach to full linear motor velocity.</string>
+ </map>
+ <key>VEHICLE_REFERENCE_FRAME</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>44</integer>
+ <key>tooltip</key>
+ <string>A rotation of the vehicles preferred axes of motion and orientation (at, left, up) with respect to the vehicles local frame (x, y, z).</string>
+ </map>
+ <key>VEHICLE_TYPE_AIRPLANE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>4</integer>
+ <key>tooltip</key>
+ <string>Uses linear deflection for lift, no hover, and banking to turn.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_AIRPLANE</string>
+ </map>
+ <key>VEHICLE_TYPE_BALLOON</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>5</integer>
+ <key>tooltip</key>
+ <string>Hover, and friction, but no deflection.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_BALLOON</string>
+ </map>
+ <key>VEHICLE_TYPE_BOAT</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>3</integer>
+ <key>tooltip</key>
+ <string>Hovers over water with lots of friction and some anglar deflection.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_BOAT</string>
+ </map>
+ <key>VEHICLE_TYPE_CAR</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>2</integer>
+ <key>tooltip</key>
+ <string>Another vehicle that bounces along the ground but needs the motors to be driven from external controls or timer events.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_CAR</string>
+ </map>
+ <key>VEHICLE_TYPE_NONE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>VEHICLE_TYPE_SLED</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>1</integer>
+ <key>tooltip</key>
+ <string>Simple vehicle that bumps along the ground, and likes to move along its local x-axis.\nSee http://wiki.secondlife.com/wiki/VEHICLE_TYPE_SLED</string>
+ </map>
+ <key>VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>36</integer>
+ <key>tooltip</key>
+ <string>A slider between minimum (0.0 = wobbly) and maximum (1.0 = firm as possible) stability of the vehicle to keep itself upright.</string>
+ </map>
+ <key>VEHICLE_VERTICAL_ATTRACTION_TIMESCALE</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>37</integer>
+ <key>tooltip</key>
+ <string>The period of wobble, or timescale for exponential approach, of the vehicle to rotate such that its preferred "up" axis is oriented along the worlds "up" axis.</string>
+ </map>
+ <key>VERTICAL</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>WANDER_PAUSE_AT_WAYPOINTS</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>value</key>
+ <integer>0</integer>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>ZERO_ROTATION</key>
+ <map>
+ <key>type</key>
+ <string>rotation</string>
+ <key>value</key>
+ <string>&lt;0.0, 0.0, 0.0, 1.0&gt;</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>ZERO_VECTOR</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>value</key>
+ <string>&lt;0.0, 0.0, 0.0&gt;</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>default</key>
+ <map>
+ <key>tooltip</key>
+ <string>All scripts must have a default state, which is the first state entered when the script starts.\nIf another state is defined before the default state, the compiler will report a syntax error.</string>
+ </map>
+ </map>
+ <key>events</key>
+ <map>
+ <key>at_rot_target</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>TargetNumber</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>TargetRotation</key>
+ <map>
+ <key>type</key>
+ <string>rotation</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>CurrentRotation</key>
+ <map>
+ <key>type</key>
+ <string>rotation</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This event is triggered when a script comes within a defined angle of a target rotation. The range and rotation, are set by a call to llRotTarget.</string>
+ </map>
+ <key>at_target</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>TargetNumber</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>TargetPosition</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>CurrentPosition</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This event is triggered when the scripted object comes within a defined range of the target position, defined by the llTarget function call.</string>
+ </map>
+ <key>attach</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This event is triggered whenever an object is attached or detached from an avatar. If it is attached, the key of the avatar it is attached to is passed in, otherwise NULL_KEY is.</string>
+ </map>
+ <key>changed</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Changed</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Triggered when various events change the object. The change argument will be a bit-field of CHANGED_* constants.</string>
+ </map>
+ <key>collision</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>NumberOfCollisions</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This event is raised while another object, or avatar, is colliding with the object the script is attached to.
+ The number of detected objects is passed to the script. Information on those objects may be gathered via the llDetected* functions.</string>
+ </map>
+ <key>collision_end</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>NumberOfCollisions</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This event is raised when another object, or avatar, stops colliding with the object the script is attached to.
+ The number of detected objects is passed to the script. Information on those objects may be gathered via the llDetected* library functions.</string>
+ </map>
+ <key>collision_start</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>NumberOfCollisions</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This event is raised when another object, or avatar, starts colliding with the object the script is attached to.
+ The number of detected objects is passed to the script. Information on those objects may be gathered via the llDetected* library functions.</string>
+ </map>
+ <key>control</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Levels</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Edges</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Once a script has the ability to grab control inputs from the avatar, this event will be used to pass the commands into the script.
+ The levels and edges are bit-fields of control constants.</string>
+ </map>
+ <key>dataserver</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>RequestID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Data</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This event is triggered when the requested data is returned to the script.
+ Data may be requested by the llRequestAgentData, llRequestInventoryData, and llGetNotecardLine function calls, for example.</string>
+ </map>
+ <key>email</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Time</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Address</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Subject</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Body</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>NumberRemaining</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This event is triggered when an email sent to this script arrives.
+ The number remaining tells how many more emails are known to be still pending.</string>
+ </map>
+ <key>http_request</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>HTTPRequestID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>HTTPMethod</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Body</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Triggered when task receives an HTTP request.</string>
+ </map>
+ <key>http_response</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>HTTPRequestID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Status</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Metadata</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Body</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This event handler is invoked when an HTTP response is received for a pending llHTTPRequest request or if a pending request fails or times out.</string>
+ </map>
+ <key>land_collision</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Position</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This event is raised when the object the script is attached to is colliding with the ground.</string>
+ </map>
+ <key>land_collision_end</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Position</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This event is raised when the object the script is attached to stops colliding with the ground.</string>
+ </map>
+ <key>land_collision_start</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Position</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This event is raised when the object the script is attached to begins to collide with the ground.</string>
+ </map>
+ <key>link_message</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>SendersLink</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Value</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>ID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Triggered when object receives a link message via llMessageLinked function call.</string>
+ </map>
+ <key>listen</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Channel</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Name</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>ID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This event is raised whenever a chat message matching the constraints set in the llListen command is received. The name and ID of the speaker, as well as the message, are passed in as parameters.
+ Channel 0 is the public chat channel that all avatars see as chat text. Channels 1 through 2,147,483,648 are private channels that are not sent to avatars but other scripts can listen on those channels.</string>
+ </map>
+ <key>money</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Payer</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Amount</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This event is triggered when a resident has given an amount of Linden dollars to the object.</string>
+ </map>
+ <key>moving_end</key>
+ <map>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Triggered whenever an object with this script stops moving.</string>
+ </map>
+ <key>moving_start</key>
+ <map>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Triggered whenever an object with this script starts moving.</string>
+ </map>
+ <key>no_sensor</key>
+ <map>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>This event is raised when sensors are active, via the llSensor function call, but are not sensing anything.</string>
+ </map>
+ <key>not_at_rot_target</key>
+ <map>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>When a target is set via the llRotTarget function call, but the script is outside the specified angle this event is raised.</string>
+ </map>
+ <key>not_at_target</key>
+ <map>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>When a target is set via the llTarget library call, but the script is outside the specified range this event is raised.</string>
+ </map>
+ <key>object_rez</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>RezzedObjectsID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Triggered when an object rezzes another object from its inventory via the llRezObject, or similar, functions. The id is the globally unique key for the object rezzed.</string>
+ </map>
+ <key>on_rez</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>StartParameter</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Triggered whenever an object is rezzed from inventory or by another object. The start parameter is passed in from the llRezObject call, or zero if from inventory.</string>
+ </map>
+ <key>path_update</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Type</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Reserved</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This event is called to inform the script of changes within the object's path-finding status.</string>
+ </map>
+ <key>remote_data</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>EventType</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>ChannelID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>MessageID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Sender</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Data</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Data</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Triggered by various XML-RPC calls with event_type specifying the type of data.</string>
+ </map>
+ <key>run_time_permissions</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>PermissionFlags</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Scripts need permission from either the owner or the avatar they wish to act on before they may perform certain functions, such as debiting money from their owners account, triggering an animation on an avatar, or capturing control inputs. The llRequestPermissions library function is used to request these permissions and the various permissions integer constants can be supplied.
+ The integer returned to this event handler contains the current set of permissions flags, so if permissions equal 0 then no permissions are set.</string>
+ </map>
+ <key>sensor</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>NumberDetected</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This event is raised whenever objects matching the constraints of the llSensor command are detected.
+ The number of detected objects is passed to the script in the parameter. Information on those objects may be gathered via the llDetected* functions.</string>
+ </map>
+ <key>state_entry</key>
+ <map>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>The state_entry event occurs whenever a new state is entered, including at program start, and is always the first event handled.</string>
+ </map>
+ <key>state_exit</key>
+ <map>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>The state_exit event occurs whenever the state command is used to transition to another state. It is handled before the new states state_entry event.</string>
+ </map>
+ <key>timer</key>
+ <map>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>This event is raised at regular intervals set by the llSetTimerEvent library function.</string>
+ </map>
+ <key>touch</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>NumberOfTouches</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This event is raised while a user is touching the object the script is attached to.
+ The number of touching objects is passed to the script in the parameter.
+ Information on those objects may be gathered via the llDetected* library functions.</string>
+ </map>
+ <key>touch_end</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>NumberOfTouches</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This event is raised when a user stops touching the object the script is attached to. The number of touches is passed to the script in the parameter.
+ Information on those objects may be gathered via the llDetected* library functions.</string>
+ </map>
+ <key>touch_start</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>NumberOfTouches</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This event is raised when a user first touches the object the script is attached to. The number of touches is passed to the script in the parameter.
+ Information on those objects may be gathered via the llDetected() library functions.</string>
+ </map>
+ <key>transaction_result</key>
+ <map>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>RequestID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Success</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Message</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Triggered by llTransferMoney() function.</string>
+ </map>
+ </map>
+ <key>functions</key>
+ <map>
+ <key>llAbs</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Value</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>An integer value.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the absolute (positive) version of Value.</string>
+ </map>
+ <key>llAcos</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Value</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>A floating-point value.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the arc-cosine of Value, in radians.</string>
+ </map>
+ <key>llAddToLandBanList</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string>Agent UUID to add to ban-list.</string>
+ </map>
+ </map>
+ <map>
+ <key>Hours</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>Period, in hours, to ban the avatar for.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Add avatar ID to the parcel ban list for the specified number of Hours.\nA value of 0 for Hours will add the agent indefinitely.\nThe smallest value that Hours will accept is 0.01; anything smaller will be seen as 0.\nWhen values that small are used, it seems the function bans in approximately 30 second increments (Probably 36 second increments, as 0.01 of an hour is 36 seconds).\nResidents teleporting to a parcel where they are banned will be redirected to a neighbouring parcel.</string>
+ </map>
+ <key>llAddToLandPassList</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.1</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string>Agent UUID to add to pass-list.</string>
+ </map>
+ </map>
+ <map>
+ <key>Hours</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>Period, in hours, to allow the avatar for.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Add avatar ID to the land pass list, for a duration of Hours.</string>
+ </map>
+ <key>llAdjustSoundVolume</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.1</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Volume</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>The volume to set.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Adjusts the volume (0.0 - 1.0) of the currently playing attached sound.\nThis function has no effect on sounds started with llTriggerSound.</string>
+ </map>
+ <key>llAllowInventoryDrop</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Flag</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Boolean, If TRUE allows anyone to drop inventory on prim, FALSE revokes.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>If Flag == TRUE, users without object modify permissions can still drop inventory items into the object.</string>
+ </map>
+ <key>llAngleBetween</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Rot1</key>
+ <map>
+ <key>type</key>
+ <string>rotation</string>
+ <key>tooltip</key>
+ <string>First rotation.</string>
+ </map>
+ </map>
+ <map>
+ <key>Rot2</key>
+ <map>
+ <key>type</key>
+ <string>rotation</string>
+ <key>tooltip</key>
+ <string>Second rotation.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the angle, in radians, between rotations Rot1 and Rot2.</string>
+ </map>
+ <key>llApplyImpulse</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Force</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Amount of impulse force to apply.</string>
+ </map>
+ </map>
+ <map>
+ <key>Local</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Boolean, if TRUE, force is treated as a local directional vector instead of region directional vector.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Applies impulse to the object.\nIf Local == TRUE, apply the Force in local coordinates; otherwise, apply the Force in global coordinates.\nThis function only works on physical objects.</string>
+ </map>
+ <key>llApplyRotationalImpulse</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Force</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Amount of impulse force to apply.</string>
+ </map>
+ </map>
+ <map>
+ <key>Local</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Boolean, if TRUE, uses local axis, if FALSE, uses region axis.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Applies rotational impulse to the object.\nIf Local == TRUE, apply the Force in local coordinates; otherwise, apply the Force in global coordinates.\nThis function only works on physical objects.</string>
+ </map>
+ <key>llAsin</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Value</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>A floating-point value.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the arc-sine, in radians, of Value.</string>
+ </map>
+ <key>llAtan2</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>y</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>A floating-point value.</string>
+ </map>
+ </map>
+ <map>
+ <key>x</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>A floating-point value.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the arc-tangent2 of y, x.</string>
+ </map>
+ <key>llAttachToAvatar</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AttachmentPoint</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Attach to avatar at point AttachmentPoint.\nRequires the PERMISSION_ATTACH runtime permission.</string>
+ </map>
+ <key>llAttachToAvatarTemp</key>
+ <map>
+ <key>energy</key>
+ <real>0</real>
+ <key>sleep</key>
+ <real>0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AttachPoint</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Valid attachment point or ATTACH_* constant.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Follows the same convention as llAttachToAvatar, with the exception that the object will not create new inventory for the user, and will disappear on detach or disconnect.</string>
+ </map>
+ <key>llAvatarOnLinkSitTarget</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>LinkNumber</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Link number (0: unlinked, 1: root prim, &gt;1: child prims) or a LINK_* flag.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>If an avatar is sitting on the link's sit target, return the avatar's key, NULL_KEY otherwise.\nReturns a key that is the UUID of the user seated on the specified link's prim.</string>
+ </map>
+ <key>llAvatarOnSitTarget</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>If an avatar is seated on the sit target, returns the avatar's key, otherwise NULL_KEY.\nThis only will detect avatars sitting on sit targets defined with llSitTarget.</string>
+ </map>
+ <key>llAxes2Rot</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>rotation</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Forward</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Forward/Back part of rotation.</string>
+ </map>
+ </map>
+ <map>
+ <key>Left</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Left/Right part of rotation.</string>
+ </map>
+ </map>
+ <map>
+ <key>Up</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Up/Down part of rotation.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the rotation represented by coordinate axes Forward, Left, and Up.</string>
+ </map>
+ <key>llAxisAngle2Rot</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>rotation</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Axis</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Axis.</string>
+ </map>
+ </map>
+ <map>
+ <key>Angle</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>Angle in radians.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the rotation that is a generated Angle about Axis.</string>
+ </map>
+ <key>llBase64ToInteger</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns an integer that is the Text, Base64 decoded as a big endian integer.\nReturns zero if Text is longer then 8 characters. If Text contains fewer then 6 characters, the return value is unpredictable.</string>
+ </map>
+ <key>llBase64ToString</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Converts a Base64 string to a conventional string.\nIf the conversion creates any unprintable characters, they are converted to question marks.</string>
+ </map>
+ <key>llBreakAllLinks</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>De-links all prims in the link set (requires permission PERMISSION_CHANGE_LINKS be set).</string>
+ </map>
+ <key>llBreakLink</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>LinkNumber</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>De-links the prim with the given link number (requires permission PERMISSION_CHANGE_LINKS be set).</string>
+ </map>
+ <key>llCastRay</key>
+ <map>
+ <key>energy</key>
+ <real/>
+ <key>sleep</key>
+ <real/>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Start</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>End</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Options</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Casts a ray into the physics world from 'start' to 'end' and returns data according to details in Options.\nReports collision data for intersections with objects.\nReturn value: [UUID_1, {link_number_1}, hit_position_1, {hit_normal_1}, UUID_2, {link_number_2}, hit_position_2, {hit_normal_2}, ... , status_code] where {} indicates optional data.</string>
+ </map>
+ <key>llCeil</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Value</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns smallest integer value &gt;= Value.</string>
+ </map>
+ <key>llClearCameraParams</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Resets all camera parameters to default values and turns off scripted camera control.</string>
+ </map>
+ <key>llClearLinkMedia</key>
+ <map>
+ <key>energy</key>
+ <real>0.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Link</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Clears (deletes) the media and all parameters from the given Face on the linked prim.\nReturns an integer that is a STATUS_* flag, which details the success/failure of the operation.</string>
+ </map>
+ <key>llClearPrimMedia</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.1</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Number of side to clear.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Clears (deletes) the media and all parameters from the given Face.\nReturns an integer that is a STATUS_* flag which details the success/failure of the operation.</string>
+ </map>
+ <key>llCloseRemoteDataChannel</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>1.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ChannelID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Closes the specified XML-RPC channel.</string>
+ </map>
+ <key>llCloud</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Offset</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the cloud density at the object's position + Offset.</string>
+ </map>
+ <key>llCollisionFilter</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ObjectName</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>ObjectID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Accept</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>If TRUE, only accept collisions with ObjectName name AND ObjectID (either is optional), otherwise with objects not ObjectName AND ObjectID.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Specify an empty string or NULL_KEY for Accept, to not filter on the corresponding parameter.</string>
+ </map>
+ <key>llCollisionSound</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ImpactSound</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>ImpactVolume</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Suppress default collision sounds, replace default impact sounds with ImpactSound.\nThe ImpactSound must be in the object inventory.\nSupply an empty string to suppress collision sounds.</string>
+ </map>
+ <key>llCollisionSprite</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ImpactSprite</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Suppress default collision sprites, replace default impact sprite with ImpactSprite; found in the object inventory (empty string to just suppress).</string>
+ </map>
+ <key>llCos</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Theta</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the cosine of Theta (Theta in radians).</string>
+ </map>
+ <key>llCreateCharacter</key>
+ <map>
+ <key>energy</key>
+ <real/>
+ <key>sleep</key>
+ <real/>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Options</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Convert link-set to AI/Physics character.\nCreates a path-finding entity, known as a "character", from the object containing the script. Required to activate use of path-finding functions.\nOptions is a list of key/value pairs.</string>
+ </map>
+ <key>llCreateLink</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>1.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>TargetPrim</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string>Object UUID that is in the same region.</string>
+ </map>
+ </map>
+ <map>
+ <key>Parent</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>If FALSE, then TargetPrim becomes the root. If TRUE, then the script's object becomes the root.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Attempt to link the object the script is in, to target (requires permission PERMISSION_CHANGE_LINKS be set).\nRequires permission PERMISSION_CHANGE_LINKS be set.</string>
+ </map>
+ <key>llCSV2List</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Create a list from a string of comma separated values specified in Text.</string>
+ </map>
+ <key>llDeleteCharacter</key>
+ <map>
+ <key>energy</key>
+ <real/>
+ <key>sleep</key>
+ <real/>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Convert link-set from AI/Physics character to Physics object.\nConvert the current link-set back to a standard object, removing all path-finding properties.</string>
+ </map>
+ <key>llDeleteSubList</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Source</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Start</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>End</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Removes the slice from start to end and returns the remainder of the list.\nRemove a slice from the list and return the remainder, start and end are inclusive.\nUsing negative numbers for start and/or end causes the index to count backwards from the length of the list, so 0, -1 would delete the entire list.\nIf Start is larger than End the list deleted is the exclusion of the entries; so 6, 4 would delete the entire list except for the 5th. list entry.</string>
+ </map>
+ <key>llDeleteSubString</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Source</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Start</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>End</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Removes the indicated sub-string and returns the result.\nStart and End are inclusive.\nUsing negative numbers for Start and/or End causes the index to count backwards from the length of the string, so 0, -1 would delete the entire string.\nIf Start is larger than End, the sub-string is the exclusion of the entries; so 6, 4 would delete the entire string except for the 5th. character.</string>
+ </map>
+ <key>llDetachFromAvatar</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Remove the object containing the script from the avatar.</string>
+ </map>
+ <key>llDetectedGrab</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Number</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the grab offset of a user touching the object.\nReturns &lt;0.0, 0.0, 0.0&gt; if Number is not a valid object.</string>
+ </map>
+ <key>llDetectedGroup</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Number</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns TRUE if detected object or agent Number has the same user group active as this object.\nIt will return FALSE if the object or agent is in the group, but the group is not active.</string>
+ </map>
+ <key>llDetectedKey</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Number</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the key of detected object or avatar number.\nReturns NULL_KEY if Number is not a valid index.</string>
+ </map>
+ <key>llDetectedLinkNumber</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Number</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the link position of the triggered event for touches and collisions only.\n0 for a non-linked object, 1 for the root of a linked object, 2 for the first child, etc.</string>
+ </map>
+ <key>llDetectedName</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Number</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the name of detected object or avatar number.\nReturns the name of detected object number.\nReturns empty string if Number is not a valid index.</string>
+ </map>
+ <key>llDetectedOwner</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Number</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the key of detected object's owner.\nReturns invalid key if Number is not a valid index.</string>
+ </map>
+ <key>llDetectedPos</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Number</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the position of detected object or avatar number.\nReturns &lt;0.0, 0.0, 0.0&gt; if Number is not a valid index.</string>
+ </map>
+ <key>llDetectedRot</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>rotation</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Number</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the rotation of detected object or avatar number.\nReturns &lt;0.0, 0.0, 0.0, 1.0&gt; if Number is not a valid offset.</string>
+ </map>
+ <key>llDetectedTouchBinormal</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Index</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Index of detection information</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the surface bi-normal for a triggered touch event.\nReturns a vector that is the surface bi-normal (tangent to the surface) where the touch event was triggered.</string>
+ </map>
+ <key>llDetectedTouchFace</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Index</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Index of detection information</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the index of the face where the avatar clicked in a triggered touch event.</string>
+ </map>
+ <key>llDetectedTouchNormal</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Index</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Index of detection information</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the surface normal for a triggered touch event.\nReturns a vector that is the surface normal (perpendicular to the surface) where the touch event was triggered.</string>
+ </map>
+ <key>llDetectedTouchPos</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Index</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Index of detected information</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the position, in region coordinates, where the object was touched in a triggered touch event.\nUnless it is a HUD, in which case it returns the position relative to the attach point.</string>
+ </map>
+ <key>llDetectedTouchST</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Index</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Index of detection information</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a vector that is the surface coordinates where the prim was touched.\nThe X and Y vector positions contain the horizontal (S) and vertical (T) face coordinates respectively.\nEach component is in the interval [0.0, 1.0].\nTOUCH_INVALID_TEXCOORD is returned if the surface coordinates cannot be determined (e.g. when the viewer does not support this function).</string>
+ </map>
+ <key>llDetectedTouchUV</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Index</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Index of detection information</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a vector that is the texture coordinates for where the prim was touched.\nThe X and Y vector positions contain the U and V face coordinates respectively.\nTOUCH_INVALID_TEXCOORD is returned if the touch UV coordinates cannot be determined (e.g. when the viewer does not support this function).</string>
+ </map>
+ <key>llDetectedType</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Number</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the type (AGENT, ACTIVE, PASSIVE, SCRIPTED) of detected object.\nReturns 0 if number is not a valid index.\nNote that number is a bit-field, so comparisons need to be a bitwise checked. e.g.:\ninteger iType = llDetectedType(0);\n{\n // ...do stuff with the agent\n}</string>
+ </map>
+ <key>llDetectedVel</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Number</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the velocity of the detected object Number.\nReturns&lt;0.0, 0.0, 0.0&gt; if Number is not a valid offset.</string>
+ </map>
+ <key>llDialog</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.1</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Buttons</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Channel</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Shows a dialog box on the avatar's screen with the message.\n
+ Up to 12 strings in the list form buttons.\n
+ If a button is clicked, the name is chatted on Channel.\nOpens a "notify box" in the given avatars screen displaying the message.\n
+ Up to twelve buttons can be specified in a list of strings. When the user clicks a button, the name of the button is said on the specified channel.\n
+ Channels work just like llSay(), so channel 0 can be heard by everyone.\n
+ The chat originates at the object's position, not the avatar's position, even though it is said as the avatar (uses avatar's UUID and Name etc.).\n
+ Examples:\n
+ llDialog(who, "Are you a boy or a girl?", [ "Boy", "Girl" ], -4913);\n
+ llDialog(who, "This shows only an OK button.", [], -192);\n
+ llDialog(who, "This chats so you can 'hear' it.", ["Hooray"], 0);</string>
+ </map>
+ <key>llDie</key>
+ <map>
+ <key>energy</key>
+ <real>0.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Delete the object which holds the script.</string>
+ </map>
+ <key>llDumpList2String</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Source</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Separator</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the list as a single string, using Separator between the entries.\nWrite the list out as a single string, using Separator between values.</string>
+ </map>
+ <key>llEdgeOfWorld</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Position</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Direction</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Checks to see whether the border hit by Direction from Position is the edge of the world (has no neighboring region).\nReturns TRUE if the line along Direction from Position hits the edge of the world in the current simulator, returns FALSE if that edge crosses into another simulator.</string>
+ </map>
+ <key>llEjectFromLand</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Ejects AvatarID from land that you own.\nEjects AvatarID from land that the object owner (group or resident) owns.</string>
+ </map>
+ <key>llEmail</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>20.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Address</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Subject</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sends email to Address with Subject and Message.\nSends an email to Address with Subject and Message.</string>
+ </map>
+ <key>llEscapeURL</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>URL</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns an escaped/encoded version of url, replacing spaces with %20 etc.\nReturns the string that is the URL-escaped version of URL (replacing spaces with %20, etc.).\n
+ This function returns the UTF-8 encoded escape codes for selected characters.</string>
+ </map>
+ <key>llEuler2Rot</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>rotation</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Vector</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the rotation representation of the Euler angles.\nReturns the rotation represented by the Euler Angle.</string>
+ </map>
+ <key>llEvade</key>
+ <map>
+ <key>energy</key>
+ <real/>
+ <key>sleep</key>
+ <real/>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>TargetID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string>Agent or object to evade.</string>
+ </map>
+ </map>
+ <map>
+ <key>Options</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>No options yet.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Evade a specified target.\nCharacters will (roughly) try to hide from their pursuers if there is a good hiding spot along their fleeing path. Hiding means no direct line of sight from the head of the character (centre of the top of its physics bounding box) to the head of its pursuer and no direct path between the two on the navigation-mesh.</string>
+ </map>
+ <key>llExecCharacterCmd</key>
+ <map>
+ <key>energy</key>
+ <real/>
+ <key>sleep</key>
+ <real/>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Command</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Command to send.</string>
+ </map>
+ </map>
+ <map>
+ <key>Options</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>Height for CHARACTER_CMD_JUMP.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Execute a character command.\nSend a command to the path system.\nCurrently only supports stopping the current path-finding operation or causing the character to jump.</string>
+ </map>
+ <key>llFabs</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Value</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the positive version of Value.\nReturns the absolute value of Value.</string>
+ </map>
+ <key>llFleeFrom</key>
+ <map>
+ <key>energy</key>
+ <real/>
+ <key>sleep</key>
+ <real/>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Source</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Global coordinate from which to flee.</string>
+ </map>
+ </map>
+ <map>
+ <key>Distance</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>Distance in meters to flee from the source.</string>
+ </map>
+ </map>
+ <map>
+ <key>Options</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>No options available at this time.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Flee from a point.\nDirects a character (llCreateCharacter) to keep away from a defined position in the region or adjacent regions.</string>
+ </map>
+ <key>llFloor</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Value</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns largest integer value &lt;= Value.</string>
+ </map>
+ <key>llForceMouselook</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Enable</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Boolean, if TRUE when an avatar sits on the prim, the avatar will be forced into mouse-look mode.\nFALSE is the default setting and will undo a previously set TRUE or do nothing.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>If Enable is TRUE any avatar that sits on this object is forced into mouse-look mode.\nAfter calling this function with Enable set to TRUE, any agent sitting down on the prim will be forced into mouse-look.\nJust like llSitTarget, this changes a permanent property of the prim (not the object) and needs to be reset by calling this function with Enable set to FALSE in order to disable it.</string>
+ </map>
+ <key>llFrand</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Magnitude</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a pseudo random number in the range [0, Magnitude] or [Magnitude, 0].\nReturns a pseudo-random number between [0, Magnitude].</string>
+ </map>
+ <key>llGenerateKey</key>
+ <map>
+ <key>energy</key>
+ <real>0</real>
+ <key>sleep</key>
+ <real>0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Generates a key (SHA-1 hash) using UUID generation to create a unique key.\nAs the UUID produced is versioned, it should never return a value of NULL_KEY.\nThe specific UUID version is an implementation detail that has changed in the past and may change again in the future. Do not depend upon the UUID that is returned to be version 5 SHA-1 hash.</string>
+ </map>
+ <key>llGetAccel</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the acceleration of the object relative to the region's axes.\nGets the acceleration of the object.</string>
+ </map>
+ <key>llGetAgentInfo</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns an integer bit-field containing the agent information about id.\n
+ Returns AGENT_FLYING, AGENT_ATTACHMENTS, AGENT_SCRIPTED, AGENT_SITTING, AGENT_ON_OBJECT, AGENT_MOUSELOOK, AGENT_AWAY, AGENT_BUSY, AGENT_TYPING, AGENT_CROUCHING, AGENT_ALWAYS_RUN, AGENT_WALKING and/or AGENT_IN_AIR.\nReturns information about the given agent ID as a bit-field of agent info constants.</string>
+ </map>
+ <key>llGetAgentLanguage</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the language code of the preferred interface language of the avatar.\nReturns a string that is the language code of the preferred interface language of the resident.</string>
+ </map>
+ <key>llGetAgentList</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Scope</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>The scope (region, parcel, parcel same owner) to return agents for.</string>
+ </map>
+ </map>
+ <map>
+ <key>Options</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>List of options to apply. Current unused.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Requests a list of agents currently in the region, limited by the scope parameter.\nReturns a list [key UUID-0, key UUID-1, ..., key UUID-n] or [string error_msg] - returns avatar keys for all agents in the region limited to the area(s) specified by scope</string>
+ </map>
+ <key>llGetAgentSize</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>If the avatar is in the same region, returns the size of the bounding box of the requested avatar by id, otherwise returns ZERO_VECTOR.\nIf the agent is in the same region as the object, returns the size of the avatar.</string>
+ </map>
+ <key>llGetAlpha</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the alpha value of Face.\nReturns the 'alpha' of the given face. If face is ALL_SIDES the value returned is the mean average of all faces.</string>
+ </map>
+ <key>llGetAndResetTime</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the script time in seconds and then resets the script timer to zero.\nGets the time in seconds since starting and resets the time to zero.</string>
+ </map>
+ <key>llGetAnimation</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the name of the currently playing locomotion animation for the avatar id.\nReturns the currently playing animation for the specified avatar ID.</string>
+ </map>
+ <key>llGetAnimationList</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a list of keys of playing animations for an avatar.\nReturns a list of keys of all playing animations for the specified avatar ID.</string>
+ </map>
+ <key>llGetAnimationOverride</key>
+ <map>
+ <key>energy</key>
+ <real>0</real>
+ <key>sleep</key>
+ <real>0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AnimationState</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a string that is the name of the animation that is used for the specified animation state\nTo use this function the script must obtain either the PERMISSION_OVERRIDE_ANIMATIONS or PERMISSION_TRIGGER_ANIMATION permission (automatically granted to attached objects).</string>
+ </map>
+ <key>llGetAttached</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the object's attachment point, or 0 if not attached.\nReturns the object attachment point, or 0 if not attached.</string>
+ </map>
+ <key>llGetBoundingBox</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the bounding box around the object (including any linked prims) relative to its root prim, as a list in the format [ (vector) min_corner, (vector) max_corner ].</string>
+ </map>
+ <key>llGetCameraPos</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the current camera position for the agent the task has permissions for.\nReturns the position of the camera, of the user that granted the script PERMISSION_TRACK_CAMERA. If no user has granted the permission, it returns ZERO_VECTOR.</string>
+ </map>
+ <key>llGetCameraRot</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>rotation</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the current camera orientation for the agent the task has permissions for. If no user has granted the PERMISSION_TRACK_CAMERA permission, returns ZERO_ROTATION.</string>
+ </map>
+ <key>llGetCenterOfMass</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the prim's centre of mass (unless called from the root prim, where it returns the object's centre of mass).</string>
+ </map>
+ <key>llGetClosestNavPoint</key>
+ <map>
+ <key>energy</key>
+ <real/>
+ <key>sleep</key>
+ <real/>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Point</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>A point in region-local space.</string>
+ </map>
+ </map>
+ <map>
+ <key>Options</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>No options at this time.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Get the closest navigable point to the point provided.\nThe function accepts a point in region-local space (like all the other path-finding methods) and returns either an empty list or a list containing a single vector which is the closest point on the navigation-mesh to the point provided.</string>
+ </map>
+ <key>llGetColor</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the color on Face.\nReturns the color of Face as a vector of red, green, and blue values between 0 and 1. If face is ALL_SIDES the color returned is the mean average of each channel.</string>
+ </map>
+ <key>llGetCreator</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns a key for the creator of the prim.\nReturns the key of the object's original creator. Similar to llGetOwner.</string>
+ </map>
+ <key>llGetDate</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the current date in the UTC time zone in the format YYYY-MM-DD.\nReturns the current UTC date as YYYY-MM-DD.</string>
+ </map>
+ <key>llGetDisplayName</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string>Avatar UUID that is in the same region, or is otherwise known to the region.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the display name of an avatar, if the avatar is connected to the current region, or if the name has been cached. Otherwise, returns an empty string. Use llRequestDisplayName if the avatar may be absent from the region.</string>
+ </map>
+ <key>llGetEnergy</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns how much energy is in the object as a percentage of maximum.</string>
+ </map>
+ <key>llGetEnv</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>DataRequest</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string>The type of data to request. Any other string will cause an empty string to be returned.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a string with the requested data about the region.</string>
+ </map>
+ <key>llGetForce</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the force (if the script is physical).\nReturns the current force if the script is physical.</string>
+ </map>
+ <key>llGetFreeMemory</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the number of free bytes of memory the script can use.\nReturns the available free space for the current script. This is inaccurate with LSO.</string>
+ </map>
+ <key>llGetFreeURLs</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the number of available URLs for the current script.\nReturns an integer that is the number of available URLs.</string>
+ </map>
+ <key>llGetGeometricCenter</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the vector that is the geometric center of the object relative to the root prim.</string>
+ </map>
+ <key>llGetGMTclock</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the time in seconds since midnight GMT.\nGets the time in seconds since midnight in GMT/UTC.</string>
+ </map>
+ <key>llGetHTTPHeader</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>HTTPRequestID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string>A valid HTTP request key</string>
+ </map>
+ </map>
+ <map>
+ <key>Header</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string>Header value name</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the value for header for request_id.\nReturns a string that is the value of the Header for HTTPRequestID.</string>
+ </map>
+ <key>llGetInventoryCreator</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>InventoryItem</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a key for the creator of the inventory item.\nThis function returns the UUID of the creator of item. If item is not found in inventory, the object says "No item named 'name'".</string>
+ </map>
+ <key>llGetInventoryKey</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>InventoryItem</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the key that is the UUID of the inventory named.\nReturns the key of the inventory named.</string>
+ </map>
+ <key>llGetInventoryName</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>InventoryType</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Inventory item type</string>
+ </map>
+ </map>
+ <map>
+ <key>Index</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Index number of inventory item.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the name of the inventory item of a given type, specified by index number.\nUse the inventory constants INVENTORY_* to specify the type.</string>
+ </map>
+ <key>llGetInventoryNumber</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>InventoryType</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Inventory item type</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the quantity of items of a given type (INVENTORY_* flag) in the prim's inventory.\nUse the inventory constants INVENTORY_* to specify the type.</string>
+ </map>
+ <key>llGetInventoryPermMask</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>InventoryItem</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string>Inventory item name.</string>
+ </map>
+ </map>
+ <map>
+ <key>BitMask</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>MASK_BASE, MASK_OWNER, MASK_GROUP, MASK_EVERYONE or MASK_NEXT</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the requested permission mask for the inventory item.\nReturns the requested permission mask for the inventory item defined by InventoryItem. If item is not in the object's inventory, llGetInventoryPermMask returns FALSE and causes the object to say "No item named '&lt;item&gt;'", where "&lt;item&gt;" is item.</string>
+ </map>
+ <key>llGetInventoryType</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>InventoryItem</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the type of the named inventory item.\nLike all inventory functions, llGetInventoryType is case-sensitive.</string>
+ </map>
+ <key>llGetKey</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the key of the prim the script is attached to.\nGet the key for the object which has this script.</string>
+ </map>
+ <key>llGetLandOwnerAt</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Position</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the key of the land owner, returns NULL_KEY if public.\nReturns the key of the land owner at Position, or NULL_KEY if public.</string>
+ </map>
+ <key>llGetLinkKey</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>LinkNumber</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the key of the linked prim LinkNumber.\nReturns the key of LinkNumber in the link set.</string>
+ </map>
+ <key>llGetLinkMedia</key>
+ <map>
+ <key>energy</key>
+ <real>0.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>LinkNumber</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Link number (0: unlinked, 1: root prim, &gt;1: child prims) or a LINK_* flag</string>
+ </map>
+ </map>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>The prim's side number</string>
+ </map>
+ </map>
+ <map>
+ <key>Parameters</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>A list of PRIM_* property constants to return values of.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Get the media parameters for a particular face on linked prim, given the desired list of parameter names. Returns a list of values in the order requested. Returns an empty list if no media exists on the face.</string>
+ </map>
+ <key>llGetLinkName</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>LinkNumber</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the name of LinkNumber in a link set.\nReturns the name of LinkNumber the link set.</string>
+ </map>
+ <key>llGetLinkNumber</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the link number of the prim containing the script (0 means not linked, 1 the prim is the root, 2 the prim is the first child, etc.).\nReturns the link number of the prim containing the script. 0 means no link, 1 the root, 2 for first child, etc.</string>
+ </map>
+ <key>llGetLinkNumberOfSides</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>LinkNumber</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Link number (0: unlinked, 1: root prim, &gt;1: child prims) or a LINK_* flag.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the number of sides of the specified linked prim.\nReturns an integer that is the number of faces (or sides) of the prim link.</string>
+ </map>
+ <key>llGetLinkPrimitiveParams</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>LinkNumber</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Link number (0: unlinked, 1: root prim, &gt;1: child prims) or a LINK_* flag.</string>
+ </map>
+ </map>
+ <map>
+ <key>Parameters</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>PRIM_* flags.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the list of primitive attributes requested in the Parameters list for LinkNumber.\nPRIM_* flags can be broken into three categories, face flags, prim flags, and object flags.\n* Supplying a prim or object flag will return that flags attributes.\n* Face flags require the user to also supply a face index parameter.</string>
+ </map>
+ <key>llGetListEntryType</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ListVariable</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Index</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the type of the index entry in the list (TYPE_INTEGER, TYPE_FLOAT, TYPE_STRING, TYPE_KEY, TYPE_VECTOR, TYPE_ROTATION, or TYPE_INVALID if index is off list).\nReturns the type of the variable at Index in ListVariable.</string>
+ </map>
+ <key>llGetListLength</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ListVariable</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the number of elements in the list.\nReturns the number of elements in ListVariable.</string>
+ </map>
+ <key>llGetLocalPos</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the position relative to the root.\nReturns the local position of a child object relative to the root.</string>
+ </map>
+ <key>llGetLocalRot</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>rotation</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the rotation local to the root.\nReturns the local rotation of a child object relative to the root.</string>
+ </map>
+ <key>llGetMass</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the mass of object that the script is attached to.\nReturns the scripted object's mass. When called from a script in a link-set, the parent will return the sum of the link-set weights, while a child will return just its own mass. When called from a script inside an attachment, this function will return the mass of the avatar it's attached to, not its own.</string>
+ </map>
+ <key>llGetMassMKS</key>
+ <map>
+ <key>energy</key>
+ <real/>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Acts as llGetMass(), except that the units of the value returned are Kg.</string>
+ </map>
+ <key>llGetMaxScaleFactor</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns a float that is the largest scaling factor that can be used with llScaleByFactor to resize the object. This maximum is determined by the Linkability Rules and prim scale limits.</string>
+ </map>
+ <key>llGetMemoryLimit</key>
+ <map>
+ <key>energy</key>
+ <real/>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Get the maximum memory a script can use, in bytes.</string>
+ </map>
+ <key>llGetMinScaleFactor</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns a float that is the smallest scaling factor that can be used with llScaleByFactor to resize the object. This minimum is determined by the prim scale limits.</string>
+ </map>
+ <key>llGetNextEmail</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Address</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Subject</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Fetch the next queued email with that matches the given address and/or subject, via the email event.\nIf the parameters are blank, they are not used for filtering.</string>
+ </map>
+ <key>llGetNotecardLine</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.1</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>NotecardName</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>LineNumber</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns LineNumber from NotecardName via the dataserver event. The line index starts at zero.\nIf the requested line is passed the end of the note-card the dataserver event will return the constant EOF string.\nThe key returned by this function is a unique identifier which will be supplied to the dataserver event in the requested parameter.</string>
+ </map>
+ <key>llGetNumberOfNotecardLines</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.1</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>NotecardName</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the number of lines contained within a notecard via the dataserver event.\nThe key returned by this function is a query ID for identifying the dataserver reply.</string>
+ </map>
+ <key>llGetNumberOfPrims</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the number of prims in a link set the script is attached to.\nReturns the number of prims in (and avatars seated on) the object the script is in.</string>
+ </map>
+ <key>llGetNumberOfSides</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the number of faces (or sides) of the prim.\nReturns the number of sides of the prim which has the script.</string>
+ </map>
+ <key>llGetObjectDesc</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the description of the prim the script is attached to.\nReturns the description of the scripted object/prim. You can set the description using llSetObjectDesc.</string>
+ </map>
+ <key>llGetObjectDetails</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string>Prim or avatar UUID that is in the same region.</string>
+ </map>
+ </map>
+ <map>
+ <key>Parameters</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>List of OBJECT_* flags.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a list of object details specified in the Parameters list for the object or avatar in the region with key ID.\nParameters are specified by the OBJECT_* constants.</string>
+ </map>
+ <key>llGetObjectMass</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the mass of the avatar or object in the region.\nGets the mass of the object or avatar corresponding to ID.</string>
+ </map>
+ <key>llGetObjectName</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the name of the prim which the script is attached to.\nReturns the name of the prim (not object) which contains the script.</string>
+ </map>
+ <key>llGetObjectPermMask</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Category</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Category is one of MASK_BASE, MASK_OWNER, MASK_GROUP, MASK_EVERYONE, or MASK_NEXT</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the permission mask of the requested category for the object.</string>
+ </map>
+ <key>llGetObjectPrimCount</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ObjectID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the total number of prims for an object in the region.\nReturns the prim count for any object id in the same region.</string>
+ </map>
+ <key>llGetOmega</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the rotation velocity in radians per second.\nReturns a vector that is the rotation velocity of the object in radians per second.</string>
+ </map>
+ <key>llGetOwner</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the object owner's UUID.\nReturns the key for the owner of the object.</string>
+ </map>
+ <key>llGetOwnerKey</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ObjectID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the owner of ObjectID.\nReturns the key for the owner of object ObjectID.</string>
+ </map>
+ <key>llGetParcelDetails</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Position</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Location within the region.</string>
+ </map>
+ </map>
+ <map>
+ <key>ParcelDetails</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>List of details requested for the specified parcel location.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a list of parcel details specified in the ParcelDetails list for the parcel at Position.\nParameters is one or more of: PARCEL_DETAILS_NAME, _DESC, _OWNER, _GROUP, _AREA, _ID, _SEE_AVATARS.\nReturns a list that is the parcel details specified in ParcelDetails (in the same order) for the parcel at Position.</string>
+ </map>
+ <key>llGetParcelFlags</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Position</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a mask of the parcel flags (PARCEL_FLAG_*) for the parcel that includes the point Position.\nReturns a bit-field specifying the parcel flags (PARCEL_FLAG_*) for the parcel at Position.</string>
+ </map>
+ <key>llGetParcelMaxPrims</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Position</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Region coordinates (z is ignored) of parcel.</string>
+ </map>
+ </map>
+ <map>
+ <key>SimWide</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Boolean. If FALSE then the return is the maximum prims supported by the parcel. If TRUE then it is the combined number of prims on all parcels in the region owned by the specified parcel's owner.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the maximum number of prims allowed on the parcel at Position for a given scope.\nThe scope may be set to an individual parcel or the combined resources of all parcels with the same ownership in the region.</string>
+ </map>
+ <key>llGetParcelMusicURL</key>
+ <map>
+ <key>energy</key>
+ <real/>
+ <key>sleep</key>
+ <real/>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Gets the streaming audio URL for the parcel object is on.\nThe object owner, avatar or group, must also be the land owner.</string>
+ </map>
+ <key>llGetParcelPrimCount</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Position</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Region coordinates of parcel to query.</string>
+ </map>
+ </map>
+ <map>
+ <key>Category</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>A PARCEL_COUNT_* flag.</string>
+ </map>
+ </map>
+ <map>
+ <key>SimWide</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Boolean. If FALSE then the return is the maximum prims supported by the parcel. If TRUE then it is the combined number of prims on all parcels in the region owned by the specified parcel's owner.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the number of prims on the parcel at Position of the given category.\nCategories: PARCEL_COUNT_TOTAL, _OWNER, _GROUP, _OTHER, _SELECTED, _TEMP.\nReturns the number of prims used on the parcel at Position which are in Category.\nIf SimWide is TRUE, it returns the total number of objects for all parcels with matching ownership in the category specified.\nIf SimWide is FALSE, it returns the number of objects on this specific parcel in the category specified</string>
+ </map>
+ <key>llGetParcelPrimOwners</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>2.0</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Position</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a list of up to 100 residents who own objects on the parcel at Position, with per-owner land impact totals.\nRequires owner-like permissions for the parcel, and for the script owner to be present in the region.\nThe list is formatted as [ key agentKey1, integer agentLI1, key agentKey2, integer agentLI2, ... ], sorted by agent key.\nThe integers are the combined land impacts of the objects owned by the corresponding agents.</string>
+ </map>
+ <key>llGetPermissions</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns an integer bitmask of the permissions that have been granted to the script. Individual permissions can be determined using a bit-wise "and" operation against the PERMISSION_* constants</string>
+ </map>
+ <key>llGetPermissionsKey</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the key of the avatar that last granted or declined permissions to the script.\nReturns NULL_KEY if permissions were never granted or declined.</string>
+ </map>
+ <key>llGetPhysicsMaterial</key>
+ <map>
+ <key>energy</key>
+ <real/>
+ <key>sleep</key>
+ <real/>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns a list of the form [float gravity_multiplier, float restitution, float friction, float density].</string>
+ </map>
+ <key>llGetPos</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the position of the task in region coordinates.\nReturns the vector position of the task in region coordinates.</string>
+ </map>
+ <key>llGetPrimitiveParams</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.2</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Parameters</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>PRIM_* flags and face parameters</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the primitive parameters specified in the parameters list.\nReturns primitive parameters specified in the Parameters list.</string>
+ </map>
+ <key>llGetPrimMediaParams</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.1</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>face number</string>
+ </map>
+ </map>
+ <map>
+ <key>Parameters</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>One or more PRIM_MEDIA_* flags</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the media parameters for a particular face on an object, given the desired list of parameter names, in the order requested. Returns an empty list if no media exists on the face.</string>
+ </map>
+ <key>llGetRegionAgentCount</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the number of avatars in the region.\nReturns an integer that is the number of avatars in the region.</string>
+ </map>
+ <key>llGetRegionCorner</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns a vector, in meters, that is the global location of the south-west corner of the region which the object is in.\nReturns the Region-Corner of the simulator containing the task. The region-corner is a vector (values in meters) representing distance from the first region.</string>
+ </map>
+ <key>llGetRegionFlags</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the region flags (REGION_FLAG_*) for the region the object is in.\nReturns a bit-field specifying the region flags (REGION_FLAG_*) for the region the object is in.</string>
+ </map>
+ <key>llGetRegionFPS</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the mean region frames per second.</string>
+ </map>
+ <key>llGetRegionName</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the current region name.</string>
+ </map>
+ <key>llGetRegionTimeDilation</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the current time dilation as a float between 0.0 (full dilation) and 1.0 (no dilation).\nReturns the current time dilation as a float between 0.0 and 1.0.</string>
+ </map>
+ <key>llGetRootPosition</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the position (in region coordinates) of the root prim of the object which the script is attached to.\nThis is used to allow a child prim to determine where the root is.</string>
+ </map>
+ <key>llGetRootRotation</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>rotation</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the rotation (relative to the region) of the root prim of the object which the script is attached to.\nGets the global rotation of the root object of the object script is attached to.</string>
+ </map>
+ <key>llGetRot</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>rotation</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the rotation relative to the region's axes.\nReturns the rotation.</string>
+ </map>
+ <key>llGetScale</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the scale of the prim.\nReturns a vector that is the scale (dimensions) of the prim.</string>
+ </map>
+ <key>llGetScriptName</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the name of the script that this function is used in.\nReturns the name of this script.</string>
+ </map>
+ <key>llGetScriptState</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ScriptName</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns TRUE if the script named is running.\nReturns TRUE if ScriptName is running.</string>
+ </map>
+ <key>llGetSimStats</key>
+ <map>
+ <key>energy</key>
+ <real>0</real>
+ <key>sleep</key>
+ <real>0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>StatType</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Statistic type. Currently only SIM_STAT_PCT_CHARS_STEPPED is supported.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a float that is the requested statistic.</string>
+ </map>
+ <key>llGetSimulatorHostname</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>10.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the host-name of the machine which the script is running on.\nFor example, "sim225.agni.lindenlab.com".</string>
+ </map>
+ <key>llGetSPMaxMemory</key>
+ <map>
+ <key>energy</key>
+ <real/>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the maximum used memory for the current script. Only valid after using PROFILE_SCRIPT_MEMORY. Non-mono scripts always use 16k.\nReturns the integer of the most bytes used while llScriptProfiler was last active.</string>
+ </map>
+ <key>llGetStartParameter</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns an integer that is the script rez parameter.\nIf the object was rezzed by an agent, this function returns 0.</string>
+ </map>
+ <key>llGetStaticPath</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Start</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Starting position.</string>
+ </map>
+ </map>
+ <map>
+ <key>End</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Ending position.</string>
+ </map>
+ </map>
+ <map>
+ <key>Radius</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>Radius of the character that the path is for, between 0.125m and 5.0m.</string>
+ </map>
+ </map>
+ <map>
+ <key>Parameters</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>Currently only accepts the parameter CHARACTER_TYPE; the options are identical to those used for llCreateCharacter. The default value is CHARACTER_TYPE_NONE.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ <key>llGetStatus</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>StatusFlag</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>A STATUS_* flag</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns boolean value of the specified status (e.g. STATUS_PHANTOM) of the object the script is attached to.</string>
+ </map>
+ <key>llGetSubString</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>String</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Start</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>End</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a sub-string from String, in a range specified by the Start and End indicies (inclusive).\nUsing negative numbers for Start and/or End causes the index to count backwards from the length of the string, so 0, -1 would capture the entire string.\nIf Start is greater than End, the sub string is the exclusion of the entries.</string>
+ </map>
+ <key>llGetSunDirection</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns a normalized vector of the direction of the sun in the region.\nReturns the sun's direction on the simulator.</string>
+ </map>
+ <key>llGetTexture</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a string that is the texture on face (the inventory name if it is a texture in the prim's inventory, otherwise the key).\nReturns the texture of a face, if it is found in object inventory, its key otherwise.</string>
+ </map>
+ <key>llGetTextureOffset</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the texture offset of face in the x and y components of a vector.</string>
+ </map>
+ <key>llGetTextureRot</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the texture rotation of side.</string>
+ </map>
+ <key>llGetTextureScale</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the texture scale of side in the x and y components of a vector.\nReturns the texture scale of a side in the x and y components of a vector.</string>
+ </map>
+ <key>llGetTime</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the time in seconds since the last region reset, script reset, or call to either llResetTime or llGetAndResetTime.</string>
+ </map>
+ <key>llGetTimeOfDay</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the time in seconds since Second Life midnight or since region up-time, whichever is smaller.\nThe Second Life day cycle is 4 hours.</string>
+ </map>
+ <key>llGetTimestamp</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns a time-stamp (UTC time zone) in the format: YYYY-MM-DDThh:mm:ss.ff..fZ.</string>
+ </map>
+ <key>llGetTorque</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the torque (if the script is physical).\nReturns a vector that is the torque (if the script is physical).</string>
+ </map>
+ <key>llGetUnixTime</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC from the system clock.</string>
+ </map>
+ <key>llGetUsedMemory</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the current used memory for the current script. Non-mono scripts always use 16K.\nReturns the integer of the number of bytes of memory currently in use by the script. Non-mono scripts always use 16K.</string>
+ </map>
+ <key>llGetUsername</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the username of an avatar, if the avatar is connected to the current region, or if the name has been cached. Otherwise, returns an empty string. Use llRequestUsername if the avatar may be absent from the region.</string>
+ </map>
+ <key>llGetVel</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the velocity of the object.\nReturns a vector that is the velocity of the object.</string>
+ </map>
+ <key>llGetWallclock</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the time in seconds since midnight California Pacific time (PST/PDT).\nReturns the time in seconds since simulator's time-zone midnight (Pacific Time).</string>
+ </map>
+ <key>llGiveInventory</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>TargetID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>InventoryItem</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Give InventoryItem to destination represented by TargetID, as permitted by the permissions system.\nTargetID may be any agent or an object in the same region.</string>
+ </map>
+ <key>llGiveInventoryList</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>3.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>TargetID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>FolderName</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>InventoryItems</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Give InventoryItems to destination (represented by TargetID) as a new folder of items, as permitted by the permissions system.\nTargetID may be any agent or an object in the same region. If TargetID is an object, the items are passed directly to the object inventory (no folder is created).</string>
+ </map>
+ <key>llGiveMoney</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Amount</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Transfers Amount of L$ from script owner to AvatarID.\nThis call will silently fail if PERMISSION_DEBIT has not been granted.</string>
+ </map>
+ <key>llGodLikeRezObject</key>
+ <map>
+ <key>god-mode</key>
+ <boolean>true</boolean>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>InventoryItemID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Position</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Rez directly off of a UUID if owner has dog-bit set.</string>
+ </map>
+ <key>llGround</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Offset</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the ground height at the object position + offset.\nReturns the ground height at the object's position + Offset.</string>
+ </map>
+ <key>llGroundContour</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Offset</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the ground contour direction below the object position + Offset.\nReturns the ground contour at the object's position + Offset.</string>
+ </map>
+ <key>llGroundNormal</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Offset</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the ground normal below the object position + offset.\nReturns the ground contour at the object's position + Offset.</string>
+ </map>
+ <key>llGroundRepel</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Height</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>Distance above the ground.</string>
+ </map>
+ </map>
+ <map>
+ <key>Water</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Boolean, if TRUE then hover above water too.</string>
+ </map>
+ </map>
+ <map>
+ <key>Tau</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>Seconds to critically damp in.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Critically damps to height if within height * 0.5 of level (either above ground level or above the higher of land and water if water == TRUE).\nCritically damps to fHeight if within fHeight * 0.5 of ground or water level.\n
+ The height is above ground level if iWater is FALSE or above the higher of land and water if iWater is TRUE.\n
+ Do not use with vehicles. Only works in physics-enabled objects.</string>
+ </map>
+ <key>llGroundSlope</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Offset</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the ground slope below the object position + Offset.\nReturns the ground slope at the object position + Offset.</string>
+ </map>
+ <key>llHTTPRequest</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>URL</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string>A valid HTTP/HTTPS URL.</string>
+ </map>
+ </map>
+ <map>
+ <key>Parameters</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>Configuration parameters, specified as HTTP_* flag-value pairs.</string>
+ </map>
+ </map>
+ <map>
+ <key>Body</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string>Contents of the request.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sends an HTTP request to the specified URL with the Body of the request and Parameters.\nReturns a key that is a handle identifying the HTTP request made.</string>
+ </map>
+ <key>llHTTPResponse</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>HTTPRequestID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string>A valid HTTP request key.</string>
+ </map>
+ </map>
+ <map>
+ <key>Status</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>HTTP Status (200, 400, 404, etc.).</string>
+ </map>
+ </map>
+ <map>
+ <key>Body</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string>Contents of the response.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Responds to an incoming HTTP request which was triggerd by an http_request event within the script. HTTPRequestID specifies the request to respond to (this ID is supplied in the http_request event handler). Status and Body specify the status code and message to respond with.</string>
+ </map>
+ <key>llInsertString</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>TargetVariable</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Position</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>SourceVariable</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Inserts SourceVariable into TargetVariable at Position, and returns the result.\nInserts SourceVariable into TargetVariable at Position and returns the result. Note this does not alter TargetVariable.</string>
+ </map>
+ <key>llInstantMessage</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>2.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>IMs Text to the user identified.\nSend Text to the user as an instant message.</string>
+ </map>
+ <key>llIntegerToBase64</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Value</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a string that is a Base64 big endian encode of Value.\nEncodes the Value as an 8-character Base64 string.</string>
+ </map>
+ <key>llJson2List</key>
+ <map>
+ <key>energy</key>
+ <real>0.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>JSON</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Converts the top level of the JSON string to a list.</string>
+ </map>
+ <key>llJsonGetValue</key>
+ <map>
+ <key>energy</key>
+ <real>0.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>JSON</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Specifiers</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Gets the value indicated by Specifiers from the JSON string.</string>
+ </map>
+ <key>llJsonSetValue</key>
+ <map>
+ <key>energy</key>
+ <real>0.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>JSON</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Specifiers</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Value</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a new JSON string that is the JSON given with the Value indicated by Specifiers set to Value.</string>
+ </map>
+ <key>llJsonValueType</key>
+ <map>
+ <key>energy</key>
+ <real>0.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>JSON</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Specifiers</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the type constant (JSON_*) for the value in JSON indicated by Specifiers.</string>
+ </map>
+ <key>llKey2Name</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string>Avatar or rezzed prim UUID.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the name of the prim or avatar specified by ID. The ID must be a valid rezzed prim or avatar key in the current simulator, otherwise an empty string is returned.\nFor avatars, the returned name is the legacy name</string>
+ </map>
+ <key>llLinkParticleSystem</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>LinkNumber</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Link number (0: unlinked, 1: root prim, &gt;1: child prims) or a LINK_* flag</string>
+ </map>
+ </map>
+ <map>
+ <key>Rules</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Particle system rules list in the format [ rule1, data1, rule2, data2 . . . ruleN, dataN ]</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Creates a particle system in prim LinkNumber based on Rules. An empty list removes a particle system from object.\nList format is [ rule-1, data-1, rule-2, data-2 ... rule-n, data-n ].\nThis is identical to llParticleSystem except that it applies to a specified linked prim and not just the prim the script is in.</string>
+ </map>
+ <key>llLinkSitTarget</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>LinkNumber</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Link number (0: unlinked, 1: root prim, &gt;1: child prims) or a LINK_* flag of the prim.</string>
+ </map>
+ </map>
+ <map>
+ <key>Offset</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Position for the sit target, relative to the prim's position.</string>
+ </map>
+ </map>
+ <map>
+ <key>Rotation</key>
+ <map>
+ <key>type</key>
+ <string>rotation</string>
+ <key>tooltip</key>
+ <string>Rotation (relative to the prim's rotation) for the avatar.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Set the sit location for the linked prim(s). If Offset == &lt;0,0,0&gt; clear it.\nSet the sit location for the linked prim(s). The sit location is relative to the prim's position and rotation.</string>
+ </map>
+ <key>llList2CSV</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ListVariable</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Creates a string of comma separated values from the list.\nCreate a string of comma separated values from the specified list.</string>
+ </map>
+ <key>llList2Float</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ListVariable</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Index</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Copies the float at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to a float, then zero is returned.</string>
+ </map>
+ <key>llList2Integer</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ListVariable</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Index</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Copies the integer at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to an integer, then zero is returned.</string>
+ </map>
+ <key>llList2Json</key>
+ <map>
+ <key>energy</key>
+ <real>0</real>
+ <key>sleep</key>
+ <real>0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>JsonType</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string>Type is JSON_ARRAY or JSON_OBJECT.</string>
+ </map>
+ </map>
+ <map>
+ <key>Values</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>List of values to convert.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Converts either a strided list of key:value pairs to a JSON_OBJECT, or a list of values to a JSON_ARRAY.</string>
+ </map>
+ <key>llList2Key</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ListVariable</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Index</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Copies the key at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to a key, then null string is returned.</string>
+ </map>
+ <key>llList2List</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ListVariable</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Start</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>End</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a subset of entries from ListVariable, in a range specified by the Start and End indicies (inclusive).\nUsing negative numbers for Start and/or End causes the index to count backwards from the length of the string, so 0, -1 would capture the entire string.\nIf Start is greater than End, the sub string is the exclusion of the entries.</string>
+ </map>
+ <key>llList2ListStrided</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ListVariable</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Start</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>End</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Stride</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Copies the strided slice of the list from Start to End.\nReturns a copy of the strided slice of the specified list from Start to End.</string>
+ </map>
+ <key>llList2Rot</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>rotation</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ListVariable</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Index</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Copies the rotation at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to rotation, thenZERO_ROTATION is returned.</string>
+ </map>
+ <key>llList2String</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ListVariable</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Index</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Copies the string at Index in the list.\nReturns the value at Index in the specified list as a string. If Index describes a location not in the list then null string is returned.</string>
+ </map>
+ <key>llList2Vector</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ListVariable</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Index</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Copies the vector at Index in the list.\nReturns the value at Index in the specified list. If Index describes a location not in the list, or the value cannot be type-cast to a vector, then ZERO_VECTOR is returned.</string>
+ </map>
+ <key>llListen</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Channel</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>SpeakersName</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>SpeakersID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Creates a listen callback for Text on Channel from SpeakersName and SpeakersID (SpeakersName, SpeakersID, and/or Text can be empty) and returns an identifier that can be used to deactivate or remove the listen.\nNon-empty values for SpeakersName, SpeakersID, and Text will filter the results accordingly, while empty strings and NULL_KEY will not filter the results, for string and key parameters respectively.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts.</string>
+ </map>
+ <key>llListenControl</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ChannelHandle</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Active</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Makes a listen event callback active or inactive. Pass in the value returned from llListen to the iChannelHandle parameter to specify which listener you are controlling.\nUse boolean values to specify Active</string>
+ </map>
+ <key>llListenRemove</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ChannelHandle</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Removes a listen event callback. Pass in the value returned from llListen to the iChannelHandle parameter to specify which listener to remove.</string>
+ </map>
+ <key>llListFindList</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ListVariable</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Find</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the index of the first instance of Find in ListVariable. Returns -1 if not found.\nReturns the position of the first instance of the Find list in the ListVariable. Returns -1 if not found.</string>
+ </map>
+ <key>llListInsertList</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Target</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>ListVariable</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Position</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a list that contains all the elements from Target but with the elements from ListVariable inserted at Position start.\nReturns a new list, created by inserting ListVariable into the Target list at Position. Note this does not alter the Target.</string>
+ </map>
+ <key>llListRandomize</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ListVariable</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Stride</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a version of the input ListVariable which has been randomized by blocks of size Stride.\nIf the remainder from the length of the list, divided by the stride is non-zero, this function does not randomize the list.</string>
+ </map>
+ <key>llListReplaceList</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Target</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>ListVariable</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Start</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>End</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a list that is Target with Start through End removed and ListVariable inserted at Start.\nReturns a list replacing the slice of the Target list from Start to End with the specified ListVariable. Start and End are inclusive, so 0, 1 would replace the first two entries and 0, 0 would replace only the first list entry.</string>
+ </map>
+ <key>llListSort</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ListVariable</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>List to sort.</string>
+ </map>
+ </map>
+ <map>
+ <key>Stride</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Stride length.</string>
+ </map>
+ </map>
+ <map>
+ <key>Ascending</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Boolean. TRUE = result in ascending order, FALSE = result in descending order.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the specified list, sorted into blocks of stride in ascending order (if Ascending is TRUE, otherwise descending). Note that sort only works if the first entry of each block is the same datatype.</string>
+ </map>
+ <key>llListStatistics</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Operation</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>One of LIST_STAT_* values</string>
+ </map>
+ </map>
+ <map>
+ <key>ListVariable</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>Variable to analyze.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Performs a statistical aggregate function, specified by a LIST_STAT_* constant, on ListVariables.\nThis function allows a script to perform a statistical operation as defined by operation on a list composed of integers and floats.</string>
+ </map>
+ <key>llLoadURL</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.1</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>URL</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Shows dialog to avatar AvatarID offering to load web page at URL. If user clicks yes, launches their web browser.\nllLoadURL displays a dialogue box to the user, offering to load the specified web page using the default web browser.</string>
+ </map>
+ <key>llLog</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Value</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the natural logarithm of Value. Returns zero if Value &lt;= 0.\nReturns the base e (natural) logarithm of the specified Value.</string>
+ </map>
+ <key>llLog10</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Value</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the base 10 logarithm of Value. Returns zero if Value &lt;= 0.\nReturns the base 10 (common) logarithm of the specified Value.</string>
+ </map>
+ <key>llLookAt</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Target</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Strength</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Damping</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Cause object name to point its forward axis towards Target, at a force controlled by Strength and Damping.\nGood Strength values are around half the mass of the object and good Damping values are less than 1/10th of the Strength.\nAsymmetrical shapes require smaller Damping. A Strength of 0.0 cancels the look at.</string>
+ </map>
+ <key>llLoopSound</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Sound</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Volume</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Plays specified Sound, looping indefinitely, at Volume (0.0 - 1.0).\nOnly one sound may be attached to an object at a time.\nA second call to llLoopSound with the same key will not restart the sound, but the new volume will be used. This allows control over the volume of already playing sounds.\nSetting the volume to 0 is not the same as calling llStopSound; a sound with 0 volume will continue to loop.\nTo restart the sound from the beginning, call llStopSound before calling llLoopSound again.</string>
+ </map>
+ <key>llLoopSoundMaster</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Sound</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Volume</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Plays attached Sound, looping at volume (0.0 - 1.0), and declares it a sync master.\nBehaviour is identical to llLoopSound, with the addition of marking the source as a "Sync Master", causing "Slave" sounds to sync to it. If there are multiple masters within a viewers interest area, the most audible one (a function of both distance and volume) will win out as the master.\nThe use of multiple masters within a small area is unlikely to produce the desired effect.</string>
+ </map>
+ <key>llLoopSoundSlave</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Sound</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Volume</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Plays attached sound looping at volume (0.0 - 1.0), synced to most audible sync master.\nBehaviour is identical to llLoopSound, unless there is a "Sync Master" present.\nIf a Sync Master is already playing the Slave sound will begin playing from the same point the master is in its loop synchronizing the loop points of both sounds.\nIf a Sync Master is started when the Slave is already playing, the Slave will skip to the correct position to sync with the Master.</string>
+ </map>
+ <key>llMakeExplosion</key>
+ <map>
+ <key>deprecated</key>
+ <boolean>true</boolean>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.1</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Particles</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Scale</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Velocity</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Lifetime</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Arc</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Texture</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Offset</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Make a round explosion of particles. Deprecated: Use llParticleSystem instead.\nMake a round explosion of particles using texture from the objects inventory. Deprecated: Use llParticleSystem instead.</string>
+ </map>
+ <key>llMakeFire</key>
+ <map>
+ <key>deprecated</key>
+ <boolean>true</boolean>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.1</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Particles</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Scale</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Velocity</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Lifetime</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Arc</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Texture</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Offset</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Make fire like particles. Deprecated: Use llParticleSystem instead.\nMake fire particles using texture from the objects inventory. Deprecated: Use llParticleSystem instead.</string>
+ </map>
+ <key>llMakeFountain</key>
+ <map>
+ <key>deprecated</key>
+ <boolean>true</boolean>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.1</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Particles</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Scale</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Velocity</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Lifetime</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Arc</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Texture</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Offset</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Make a fountain of particles. Deprecated: Use llParticleSystem instead.\nMake a fountain of particles using texture from the objects inventory. Deprecated: Use llParticleSystem instead.</string>
+ </map>
+ <key>llMakeSmoke</key>
+ <map>
+ <key>deprecated</key>
+ <boolean>true</boolean>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.1</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Particles</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Scale</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Velocity</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Lifetime</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Arc</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Texture</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Offset</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Make smoke like particles. Deprecated: Use llParticleSystem instead.\nMake smoky particles using texture from the objects inventory. Deprecated: Use llParticleSystem instead.</string>
+ </map>
+ <key>llManageEstateAccess</key>
+ <map>
+ <key>energy</key>
+ <real/>
+ <key>sleep</key>
+ <real/>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Action</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>One of the ESTATE_ACCESS_ALLOWED_* actions.</string>
+ </map>
+ </map>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string>UUID of the avatar or group to act upon.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Adds or removes agents from the estate's agent access or ban lists, or groups to the estate's group access list. Action is one of the ESTATE_ACCESS_ALLOWED_* operations to perform.\nReturns an integer representing a boolean, TRUE if the call was successful; FALSE if throttled, invalid action, invalid or null id or object owner is not allowed to manage the estate.\nThe object owner is notified of any changes, unless PERMISSION_SILENT_ESTATE_MANAGEMENT has been granted to the script.</string>
+ </map>
+ <key>llMapDestination</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>1.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>RegionName</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Position</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Direction</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Opens world map for avatar who touched is is wearing the script, centred on RegionName with Position highlighted. Only works for scripts attached to avatar, or during touch events.\nDirection currently has no effect.</string>
+ </map>
+ <key>llMD5String</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Nonce</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a string of 32 hex characters that is an RSA Data Security Inc., MD5 Message-Digest Algorithm of Text with Nonce used as the salt.\nReturns a 32-character hex string. (128-bit in binary.)</string>
+ </map>
+ <key>llMessageLinked</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>LinkNumber</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Number</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>ID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sends Number, Text, and ID to members of the link set identified by LinkNumber.\nLinkNumber is either a linked number (available through llGetLinkNumber) or a LINK_* constant.</string>
+ </map>
+ <key>llMinEventDelay</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Delay</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Set the minimum time between events being handled.</string>
+ </map>
+ <key>llModifyLand</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Action</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>LAND_LEVEL, LAND_RAISE, LAND_LOWER, LAND_SMOOTH, LAND_NOISE or LAND_REVERT</string>
+ </map>
+ </map>
+ <map>
+ <key>Area</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>0, 1, 2 (2m x 2m, 4m x 4m, or 8m x 8m)</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Modify land with action (LAND_LEVEL, LAND_RAISE, LAND_LOWER, LAND_SMOOTH, LAND_NOISE, LAND_REVERT) on size (0, 1, 2, corresponding to 2m x 2m, 4m x 4m, 8m x 8m).</string>
+ </map>
+ <key>llModPow</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>1.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Value</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Power</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Modulus</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a Value raised to the Power, mod Modulus. ((a**b)%c) b is capped at 0xFFFF (16 bits).\nReturns (Value ^ Power) % Modulus. (Value raised to the Power, Modulus). Value is capped at 0xFFFF (16 bits).</string>
+ </map>
+ <key>llMoveToTarget</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Target</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Tau</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Critically damp to Target in Tau seconds (if the script is physical).\nCritically damp to position target in tau-seconds if the script is physical. Good tau-values are greater than 0.2. A tau of 0.0 stops the critical damping.</string>
+ </map>
+ <key>llNavigateTo</key>
+ <map>
+ <key>energy</key>
+ <real/>
+ <key>sleep</key>
+ <real/>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Location</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Region coordinates for the character to navigate to.</string>
+ </map>
+ </map>
+ <map>
+ <key>Options</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>List of parameters to control the type of path-finding used. Currently only FORCE_DIRECT_PATH supported.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Navigate to destination.\nDirects an object to travel to a defined position in the region or adjacent regions.</string>
+ </map>
+ <key>llOffsetTexture</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.2</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>OffsetS</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>OffsetT</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the texture S and T offsets for the chosen Face.\nIf Face is ALL_SIDES this function sets the texture offsets for all faces.</string>
+ </map>
+ <key>llOpenRemoteDataChannel</key>
+ <map>
+ <key>deprecated</key>
+ <boolean>true</boolean>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>1.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Requests a channel to listen for XML-RPC calls. (Deprecated: XML-RPC should not be used. Use http-in instead.)\nWill trigger a remote_data event with type = REMOTE_DATA_CHANNEL and a channel ID (key) once it is available.\nThis channel ID must be referenced in the XML-RPC call to the script (from the internet) -- so the key must somehow get to the external XML-RPC client.</string>
+ </map>
+ <key>llOverMyLand</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns TRUE if id ID over land owned by the script owner, otherwise FALSE.\nReturns TRUE if key ID is over land owned by the object owner, FALSE otherwise.</string>
+ </map>
+ <key>llOwnerSay</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>says Text to owner only (if owner is in region).\nSays Text to the owner of the object running the script, if the owner has been within the object's simulator since logging into Second Life, regardless of where they may be in-world.</string>
+ </map>
+ <key>llParcelMediaCommandList</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>2.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>CommandList</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>A list of PARCEL_MEDIA_COMMAND_* flags and their parameters </string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Controls the playback of multimedia resources on a parcel or for an agent, via one or more PARCEL_MEDIA_COMMAND_* arguments specified in CommandList.</string>
+ </map>
+ <key>llParcelMediaQuery</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>2.0</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>QueryList</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Queries the media properties of the parcel containing the script, via one or more PARCEL_MEDIA_COMMAND_* arguments specified in CommandList.\nThis function will only work if the script is contained within an object owned by the land-owner (or if the land is owned by a group, only if the object has been deeded to the group).</string>
+ </map>
+ <key>llParseString2List</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Separators</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Spacers</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Converts Text into a list, discarding Separators, keeping Spacers (Separators and Spacers must be lists of strings, maximum of 8 each).\nSeparators and Spacers are lists of strings with a maximum of 8 entries each.</string>
+ </map>
+ <key>llParseStringKeepNulls</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>list</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Separators</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Spacers</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Breaks Text into a list, discarding separators, keeping spacers, keeping any null values generated. (separators and spacers must be lists of strings, maximum of 8 each).\nllParseStringKeepNulls works almost exactly like llParseString2List, except that if a null is found it will add a null-string instead of discarding it like llParseString2List does.</string>
+ </map>
+ <key>llParticleSystem</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Parameters</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Creates a particle system in the prim the script is attached to, based on Parameters. An empty list removes a particle system from object.\nList format is [ rule-1, data-1, rule-2, data-2 ... rule-n, data-n ].</string>
+ </map>
+ <key>llPassCollisions</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Pass</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Boolean, if TRUE, collisions are passed from children on to parents.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Configures how collision events are passed to scripts in the linkset.\nIf Pass == TRUE, collisions involving collision-handling scripted child prims are also passed on to the root prim. If Pass == FALSE (default behavior), such collisions will only trigger events in the affected child prim.</string>
+ </map>
+ <key>llPassTouches</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Pass</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Boolean, if TRUE, touches are passed from children on to parents.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Configures how touch events are passed to scripts in the linkset.\nIf Pass == TRUE, touches involving touch-handling scripted child prims are also passed on to the root prim. If Pass == FALSE (default behavior), such touches will only trigger events in the affected child prim.</string>
+ </map>
+ <key>llPatrolPoints</key>
+ <map>
+ <key>energy</key>
+ <real/>
+ <key>sleep</key>
+ <real/>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Points</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>A list of vectors for the character to travel through sequentially. The list must contain at least two entries.</string>
+ </map>
+ </map>
+ <map>
+ <key>Options</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>No options available at this time.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Patrol a list of points.\nSets the points for a character (llCreateCharacter) to patrol along.</string>
+ </map>
+ <key>llPlaySound</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Sound</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Volume</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Plays Sound once, at Volume (0.0 - 1.0) and attached to the object.\nOnly one sound may be attached to an object at a time, and attaching a new sound or calling llStopSound will stop the previously attached sound.\nA second call to llPlaySound with the same sound will not restart the sound, but the new volume will be used, which allows control over the volume of already playing sounds.\nTo restart the sound from the beginning, call llStopSound before calling llPlaySound again.</string>
+ </map>
+ <key>llPlaySoundSlave</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Sound</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Volume</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Plays attached Sound once, at Volume (0.0 - 1.0), synced to next loop of most audible sync master.\nBehaviour is identical to llPlaySound, unless there is a "Sync Master" present. If a Sync Master is already playing, the Slave sound will not be played until the Master hits its loop point and returns to the beginning.\nllPlaySoundSlave will play the sound exactly once; if it is desired to have the sound play every time the Master loops, either use llLoopSoundSlave with extra silence padded on the end of the sound or ensure that llPlaySoundSlave is called at least once per loop of the Master.</string>
+ </map>
+ <key>llPow</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Value</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Exponent</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the Value raised to the power Exponent, or returns 0 and triggers Math Error for imaginary results.\nReturns the Value raised to the Exponent.</string>
+ </map>
+ <key>llPreloadSound</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>1.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Sound</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Causes nearby viewers to preload the Sound from the object's inventory.\nThis is intended to prevent delays in starting new sounds when called upon.</string>
+ </map>
+ <key>llPursue</key>
+ <map>
+ <key>energy</key>
+ <real/>
+ <key>sleep</key>
+ <real/>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>TargetID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string>Agent or object to pursue.</string>
+ </map>
+ </map>
+ <map>
+ <key>Options</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>Parameters for pursuit.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Chase after a target.\nCauses the character (llCharacter) to pursue the target defined by TargetID.</string>
+ </map>
+ <key>llPushObject</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ObjectID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Impulse</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>AngularImpulse</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Local</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Applies Impulse and AngularImpulse to ObjectID.\nApplies the supplied impulse and angular impulse to the object specified.</string>
+ </map>
+ <key>llRefreshPrimURL</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>20.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Reloads the web page shown on the sides of the object.</string>
+ </map>
+ <key>llRegionSay</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Channel</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Any integer value except zero.</string>
+ </map>
+ </map>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Message to be transmitted.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Broadcasts Text to entire region on Channel (except for channel 0).</string>
+ </map>
+ <key>llRegionSayTo</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>TargetID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string>Avatar or object to say to.</string>
+ </map>
+ </map>
+ <map>
+ <key>Channel</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Output channel, any integer value.</string>
+ </map>
+ </map>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string>Message to be transmitted.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Says Text, on Channel, to avatar or object indicated by TargetID (if within region).\nIf TargetID is an avatar and Channel is nonzero, Text can be heard by any attachment on the avatar.</string>
+ </map>
+ <key>llReleaseCamera</key>
+ <map>
+ <key>deprecated</key>
+ <boolean>true</boolean>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Return camera to agent.\nDeprecated: Use llClearCameraParams instead.</string>
+ </map>
+ <key>llReleaseControls</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Stop taking inputs.\nStop taking inputs from the avatar.</string>
+ </map>
+ <key>llReleaseURL</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>URL</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string>URL to release.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Releases the specified URL, which was previously obtained using llRequestURL. Once released, the URL will no longer be usable.</string>
+ </map>
+ <key>llRemoteDataReply</key>
+ <map>
+ <key>deprecated</key>
+ <boolean>true</boolean>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>3.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ChannelID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>MessageID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>sData</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string>String data to send</string>
+ </map>
+ </map>
+ <map>
+ <key>iData</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Integer data to send</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Send an XML-RPC reply to MessageID on ChannelID with payload of string sData and integer iData. Deprecated: Use HTTP functions/events instead.\nThe size of sData is limited to 254 characters.</string>
+ </map>
+ <key>llRemoteDataSetRegion</key>
+ <map>
+ <key>deprecated</key>
+ <boolean>true</boolean>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Deprecated: Use HTTP functions/events instead.\nIf an object using remote data channels changes regions, you must call this function to re-register the remote data channels.\nYou do not need to make this call if you don't change regions.</string>
+ </map>
+ <key>llRemoteLoadScriptPin</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>3.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ObjectID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string>Target prim to attempt copying into.</string>
+ </map>
+ </map>
+ <map>
+ <key>ScriptName</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string>Name of the script in current inventory to copy.</string>
+ </map>
+ </map>
+ <map>
+ <key>PIN</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Integer set on target prim as a Personal Information Number code.</string>
+ </map>
+ </map>
+ <map>
+ <key>Running</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>If the script should be set running in the target prim.</string>
+ </map>
+ </map>
+ <map>
+ <key>StartParameter</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Integer. Parameter passed to the script if set to be running.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>If the owner of the object containing this script can modify the object identified by the specified object key, and if the PIN matches the PIN previously set using llSetRemoteScriptAccessPin (on the target prim), then the script will be copied into target. Running is a boolean specifying whether the script should be enabled once copied into the target object.</string>
+ </map>
+ <key>llRemoveFromLandBanList</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Remove avatar from the land ban list.\nRemove specified avatar from the land parcel ban list.</string>
+ </map>
+ <key>llRemoveFromLandPassList</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Remove avatar from the land pass list.\nRemove specified avatar from the land parcel pass list.</string>
+ </map>
+ <key>llRemoveInventory</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>InventoryItem</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Remove the named inventory item.\nRemove the named inventory item from the object inventory.</string>
+ </map>
+ <key>llRemoveVehicleFlags</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Vehiclelags</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Removes the enabled bits in 'flags'.\nSets the vehicle flags to FALSE. Valid parameters can be found in the vehicle flags constants section.</string>
+ </map>
+ <key>llRequestAgentData</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.1</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Data</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Requests data about AvatarID. When data is available the dataserver event will be raised.\nThis function requests data about an avatar. If and when the information is collected, the dataserver event is triggered with the key returned from this function passed in the requested parameter. See the agent data constants (DATA_*) for details about valid values of data and what each will return in the dataserver event.</string>
+ </map>
+ <key>llRequestDisplayName</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string>Avatar UUID</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Requests the display name of the agent. When the display name is available the dataserver event will be raised.\nThe avatar identified does not need to be in the same region or online at the time of the request.\nReturns a key that is used to identify the dataserver event when it is raised.</string>
+ </map>
+ <key>llRequestInventoryData</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>1.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>InventoryItem</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Requests data for the named InventoryItem.\nWhen data is available, the dataserver event will be raised with the key returned from this function in the requested parameter.\nThe only request currently implemented is to request data from landmarks, where the data returned is in the form "&lt;float, float, float&gt;" which can be cast to a vector. This position is in region local coordinates.</string>
+ </map>
+ <key>llRequestPermissions</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>PermissionMask</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Ask AvatarID to allow the script to perform certain actions, specified in the PermissionMask bitmask. PermissionMask should be one or more PERMISSION_* constants. Multiple permissions can be requested simultaneously by ORing the constants together. Many of the permissions requests can only go to object owner.\nThis call will not stop script execution. If the avatar grants the requested permissions, the run_time_permissions event will be called.</string>
+ </map>
+ <key>llRequestSecureURL</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Requests one HTTPS:// (SSL) URL for use by this object. The http_request event is triggered with results.\nReturns a key that is the handle used for identifying the request in the http_request event.</string>
+ </map>
+ <key>llRequestSimulatorData</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>1.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>RegionName</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Data</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Requests the specified Data about RegionName. When the specified data is available, the dataserver event is raised.\nData should use one of the DATA_SIM_* constants.\nReturns a dataserver query ID and triggers the dataserver event when data is found.</string>
+ </map>
+ <key>llRequestURL</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Requests one HTTP:// URL for use by this script. The http_request event is triggered with the result of the request.\nReturns a key that is the handle used for identifying the result in the http_request event.</string>
+ </map>
+ <key>llRequestUsername</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Requests single-word user-name of an avatar. When data is available the dataserver event will be raised.\nRequests the user-name of the identified agent. When the user-name is available the dataserver event is raised.\nThe agent identified does not need to be in the same region or online at the time of the request.\nReturns a key that is used to identify the dataserver event when it is raised.</string>
+ </map>
+ <key>llResetAnimationOverride</key>
+ <map>
+ <key>energy</key>
+ <real>0</real>
+ <key>sleep</key>
+ <real>0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AnimationState</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Resets the animation of the specified animation state to the default value.\nIf animation state equals "ALL", then all animation states are reset.</string>
+ </map>
+ <key>llResetLandBanList</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Removes all residents from the land ban list.</string>
+ </map>
+ <key>llResetLandPassList</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Removes all residents from the land access/pass list.</string>
+ </map>
+ <key>llResetOtherScript</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ScriptName</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Resets the named script.</string>
+ </map>
+ <key>llResetScript</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Resets the script.</string>
+ </map>
+ <key>llResetTime</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Sets the time to zero.\nSets the internal timer to zero.</string>
+ </map>
+ <key>llReturnObjectsByID</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ObjectIDs</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>List of object UUIDs to be returned.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Return objects using their UUIDs.\nRequires the PERMISSION_RETURN_OBJECTS permission and that the script owner owns the parcel the returned objects are in, or is an estate manager or region owner.</string>
+ </map>
+ <key>llReturnObjectsByOwner</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string>Object owner's UUID.</string>
+ </map>
+ </map>
+ <map>
+ <key>Scope</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Return objects based upon their owner and a scope of parcel, parcel owner, or region.\nRequires the PERMISSION_RETURN_OBJECTS permission and that the script owner owns the parcel the returned objects are in, or is an estate manager or region owner.</string>
+ </map>
+ <key>llRezAtRoot</key>
+ <map>
+ <key>energy</key>
+ <real>200.0</real>
+ <key>sleep</key>
+ <real>0.1</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>InventoryItem</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Position</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Velocity</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Rotation</key>
+ <map>
+ <key>type</key>
+ <string>rotation</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>StartParameter</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Instantiate owner's InventoryItem at Position with Velocity, Rotation and with StartParameter. The last selected root object's location will be set to Position.\nCreates object's inventory item at the given Position, with Velocity, Rotation, and StartParameter.</string>
+ </map>
+ <key>llRezObject</key>
+ <map>
+ <key>energy</key>
+ <real>200</real>
+ <key>sleep</key>
+ <real>0.1</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>InventoryItem</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Position</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Velocity</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Rotation</key>
+ <map>
+ <key>type</key>
+ <string>rotation</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>StartParameter</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Instantiate owners InventoryItem at Position with Velocity, Rotation and with start StartParameter.\nCreates object's inventory item at Position with Velocity and Rotation supplied. The StartParameter value will be available to the newly created object in the on_rez event or through the llGetStartParameter function.\nThe Velocity parameter is ignored if the rezzed object is not physical.</string>
+ </map>
+ <key>llRot2Angle</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Rotation</key>
+ <map>
+ <key>type</key>
+ <string>rotation</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the rotation angle represented by Rotation.\nReturns the angle represented by the Rotation.</string>
+ </map>
+ <key>llRot2Axis</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Rotation</key>
+ <map>
+ <key>type</key>
+ <string>rotation</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the rotation axis represented by Rotation.\nReturns the axis represented by the Rotation.</string>
+ </map>
+ <key>llRot2Euler</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Rotation</key>
+ <map>
+ <key>type</key>
+ <string>rotation</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the Euler representation (roll, pitch, yaw) of Rotation.\nReturns the Euler Angle representation of the Rotation.</string>
+ </map>
+ <key>llRot2Fwd</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Rotation</key>
+ <map>
+ <key>type</key>
+ <string>rotation</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the forward vector defined by Rotation.\nReturns the forward axis represented by the Rotation.</string>
+ </map>
+ <key>llRot2Left</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Rotation</key>
+ <map>
+ <key>type</key>
+ <string>rotation</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the left vector defined by Rotation.\nReturns the left axis represented by the Rotation.</string>
+ </map>
+ <key>llRot2Up</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Rotation</key>
+ <map>
+ <key>type</key>
+ <string>rotation</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the up vector defined by Rotation.\nReturns the up axis represented by the Rotation.</string>
+ </map>
+ <key>llRotateTexture</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.2</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Radians</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the texture rotation for the specified Face to angle Radians.\nIf Face is ALL_SIDES, rotates the texture of all sides.</string>
+ </map>
+ <key>llRotBetween</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>rotation</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Vector1</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Vector2</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the rotation to rotate Vector1 to Vector2.\nReturns the rotation needed to rotate Vector1 to Vector2.</string>
+ </map>
+ <key>llRotLookAt</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Rotation</key>
+ <map>
+ <key>type</key>
+ <string>rotation</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Strength</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Damping</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Cause object to rotate to Rotation, with a force function defined by Strength and Damping parameters. Good strength values are around half the mass of the object and good damping values are less than 1/10th of the strength.\nAsymmetrical shapes require smaller damping.\nA strength of 0.0 cancels the look at.</string>
+ </map>
+ <key>llRotTarget</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Rotation</key>
+ <map>
+ <key>type</key>
+ <string>rotation</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>LeeWay</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Set rotations with error of LeeWay radians as a rotational target, and return an ID for the rotational target.\nThe returned number is a handle that can be used in at_rot_target and llRotTargetRemove.</string>
+ </map>
+ <key>llRotTargetRemove</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Handle</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Removes rotational target number.\nRemove rotational target indicated by the handle.</string>
+ </map>
+ <key>llRound</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Value</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns Value rounded to the nearest integer.\nReturns the Value rounded to the nearest integer.</string>
+ </map>
+ <key>llSameGroup</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns TRUE if avatar ID is in the same region and has the same active group, otherwise FALSE.\nReturns TRUE if the object or agent identified is in the same simulator and has the same active group as this object. Otherwise, returns FALSE.</string>
+ </map>
+ <key>llSay</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Channel</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Channel to use to say text on.</string>
+ </map>
+ </map>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string>Text to say.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Says Text on Channel.\nThis chat method has a range of 20m radius.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts.</string>
+ </map>
+ <key>llScaleByFactor</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ScalingFactor</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>The multiplier to be used with the prim sizes and their local positions.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Attempts to resize the entire object by ScalingFactor, maintaining the size-position ratios of the prims.\n\nResizing is subject to prim scale limits and linkability limits. This function can not resize the object if the linkset is physical, a pathfinding character, in a keyframed motion, or if resizing would cause the parcel to overflow.\nReturns a boolean (an integer) TRUE if it succeeds, FALSE if it fails.</string>
+ </map>
+ <key>llScaleTexture</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.2</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Horizontal</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Vertical</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the diffuse texture Horizontal and Vertical repeats on Face of the prim the script is attached to.\nIf Face == ALL_SIDES, all sides are set in one call.\nNegative values for horizontal and vertical will flip the texture.</string>
+ </map>
+ <key>llScriptDanger</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Position</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns TRUE if Position is over public land, sandbox land, land that doesn't allow everyone to edit and build, or land that doesn't allow outside scripts.\nReturns true if the position is over public land, land that doesn't allow everyone to edit and build, or land that doesn't allow outside scripts.</string>
+ </map>
+ <key>llScriptProfiler</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>State</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>PROFILE_NONE or PROFILE_SCRIPT_MEMORY flags to control the state.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Enables or disables script profiling options. Currently only supports PROFILE_SCRIPT_MEMORY (Mono only) and PROFILE_NONE.\nMay significantly reduce script performance.</string>
+ </map>
+ <key>llSendRemoteData</key>
+ <map>
+ <key>deprecated</key>
+ <boolean>true</boolean>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>3.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ChannelID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Destination</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Value</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Deprecated: use HTTP functions and events instead.\nSends an XML-RPC request to Destination through ChannelID with payload of ChannelID (in a string), integer Value and string Text.\nReturns a key that is the message_id for the resulting remote_data events.</string>
+ </map>
+ <key>llSensor</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Name</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string>Object or avatar name.</string>
+ </map>
+ </map>
+ <map>
+ <key>ID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string>Object or avatar UUID.</string>
+ </map>
+ </map>
+ <map>
+ <key>Type</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Bit-field mask of AGENT, AGENT_BY_LEGACY_NAME, AGENT_BY_USERNAME, ACTIVE, PASSIVE, and/or SCRIPTED</string>
+ </map>
+ </map>
+ <map>
+ <key>Range</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>Distance to scan. 0.0 - 96.0m.</string>
+ </map>
+ </map>
+ <map>
+ <key>Arc</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>Angle, in radians, from the local x-axis of the prim to scan.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Performs a single scan for Name and ID with Type (AGENT, ACTIVE, PASSIVE, and/or SCRIPTED) within Range meters and Arc radians of forward vector.\nSpecifying a blank Name, 0 Type, or NULL_KEY ID will prevent filtering results based on that parameter. A range of 0.0 does not perform a scan.\nResults are returned in the sensor and no_sensor events.</string>
+ </map>
+ <key>llSensorRemove</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>removes sensor.\nRemoves the sensor set by llSensorRepeat.</string>
+ </map>
+ <key>llSensorRepeat</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Name</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string>Object or avatar name.</string>
+ </map>
+ </map>
+ <map>
+ <key>ID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string>Object or avatar UUID.</string>
+ </map>
+ </map>
+ <map>
+ <key>Type</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Bit-field mask of AGENT, AGENT_BY_LEGACY_NAME, AGENT_BY_USERNAME, ACTIVE, PASSIVE, and/or SCRIPTED</string>
+ </map>
+ </map>
+ <map>
+ <key>Range</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>Distance to scan. 0.0 - 96.0m.</string>
+ </map>
+ </map>
+ <map>
+ <key>Arc</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>Angle, in radians, from the local x-axis of the prim to scan.</string>
+ </map>
+ </map>
+ <map>
+ <key>Rate</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>Period, in seconds, between scans.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Initiates a periodic scan every Rate seconds, for Name and ID with Type (AGENT, ACTIVE, PASSIVE, and/or SCRIPTED) within Range meters and Arc radians of forward vector.\nSpecifying a blank Name, 0 Type, or NULL_KEY ID will prevent filtering results based on that parameter. A range of 0.0 does not perform a scan.\nResults are returned in the sensor and no_sensor events.</string>
+ </map>
+ <key>llSetAlpha</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Opacity</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the alpha (opacity) of Face.\nSets the alpha (opacity) value for Face. If Face is ALL_SIDES, sets the alpha for all faces. The alpha value is interpreted as an opacity percentage (1.0 is fully opaque, and 0.2 is mostly transparent). This function will clamp alpha values less than 0.1 to 0.1 and greater than 1.0 to 1.</string>
+ </map>
+ <key>llSetAngularVelocity</key>
+ <map>
+ <key>energy</key>
+ <real/>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AngVel</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>The angular velocity to set the object to.</string>
+ </map>
+ </map>
+ <map>
+ <key>Local</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>If TRUE, the AngVel is treated as a local directional vector instead of a regional directional vector.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets an object's angular velocity to AngVel, in local coordinates if Local == TRUE (if the script is physical).\nHas no effect on non-physical objects.</string>
+ </map>
+ <key>llSetAnimationOverride</key>
+ <map>
+ <key>energy</key>
+ <real>0</real>
+ <key>sleep</key>
+ <real>0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AnimationState</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>AnimationName</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the animation (in object inventory) that will play for the given animation state.\nTo use this function the script must obtain the PERMISSION_OVERRIDE_ANIMATIONS permission.</string>
+ </map>
+ <key>llSetBuoyancy</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Buoyancy</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Set the tasks buoyancy (0 is none, &lt; 1.0 sinks, 1.0 floats, &gt; 1.0 rises).\nSet the object buoyancy. A value of 0 is none, less than 1.0 sinks, 1.0 floats, and greater than 1.0 rises.</string>
+ </map>
+ <key>llSetCameraAtOffset</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Offset</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the camera used in this object, at offset, if an avatar sits on it.\nSets the offset that an avatar's camera will be moved to if the avatar sits on the object.</string>
+ </map>
+ <key>llSetCameraEyeOffset</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Offset</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the camera eye offset used in this object if an avatar sits on it.</string>
+ </map>
+ <key>llSetCameraParams</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Parameters</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets multiple camera parameters at once. List format is [ rule-1, data-1, rule-2, data-2 . . . rule-n, data-n ].</string>
+ </map>
+ <key>llSetClickAction</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Action</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>A CLICK_ACTION_* flag</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the action performed when a prim is clicked upon.</string>
+ </map>
+ <key>llSetColor</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Color</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the color, for the face.\nSets the color of the side specified. If Face is ALL_SIDES, sets the color on all faces.</string>
+ </map>
+ <key>llSetContentType</key>
+ <map>
+ <key>energy</key>
+ <real/>
+ <key>sleep</key>
+ <real/>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>HTTPRequestID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string>A valid http_request() key</string>
+ </map>
+ </map>
+ <map>
+ <key>ContentType</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Media type to use with any following llHTTPResponse(HTTPRequestID, ...)</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Set the media type of an LSL HTTP server response to ContentType.\nHTTPRequestID must be a valid http_request ID. ContentType must be one of the CONTENT_TYPE_* constants.</string>
+ </map>
+ <key>llSetDamage</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Damage</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the amount of damage that will be done to an avatar that this task hits. Task will be killed.\nSets the amount of damage that will be done to an avatar that this object hits. This object will be destroyed on damaging an avatar, and no collision event is triggered.</string>
+ </map>
+ <key>llSetForce</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Force</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Directional force.</string>
+ </map>
+ </map>
+ <map>
+ <key>Local</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Boolean, if TRUE uses local axis, if FALSE uses region axis.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets Force on object, in object-local coordinates if Local == TRUE (otherwise, the region reference frame is used).\nOnly works on physical objects.</string>
+ </map>
+ <key>llSetForceAndTorque</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Force</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Directional force.</string>
+ </map>
+ </map>
+ <map>
+ <key>Torque</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Torque force.</string>
+ </map>
+ </map>
+ <map>
+ <key>Local</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Boolean, if TRUE uses local axis, if FALSE uses region axis.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the Force and Torque of object, in object-local coordinates if Local == TRUE (otherwise, the region reference frame is used).\nOnly works on physical objects.</string>
+ </map>
+ <key>llSetHoverHeight</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Height</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>Distance above the ground.</string>
+ </map>
+ </map>
+ <map>
+ <key>Water</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Boolean, if TRUE then hover above water too.</string>
+ </map>
+ </map>
+ <map>
+ <key>Tau</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>Seconds to critically damp in.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Critically damps a physical object to a Height (either above ground level or above the higher of land and water if water == TRUE).\nDo not use with vehicles. Use llStopHover to stop hovering.</string>
+ </map>
+ <key>llSetInventoryPermMask</key>
+ <map>
+ <key>god-mode</key>
+ <boolean>true</boolean>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>InventoryItem</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string>An item in the prim's inventory</string>
+ </map>
+ </map>
+ <map>
+ <key>PermissionFlag</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>MASK_* flag</string>
+ </map>
+ </map>
+ <map>
+ <key>PermissionMask</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Permission bit-field (PERM_* flags)</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the given permission mask to the new value on the inventory item.</string>
+ </map>
+ <key>llSetKeyframedMotion</key>
+ <map>
+ <key>energy</key>
+ <real/>
+ <key>sleep</key>
+ <real/>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Keyframes</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>Strided keyframe list of the form: position, orientation, time. Each keyframe is interpreted relative to the previous transform of the object.</string>
+ </map>
+ </map>
+ <map>
+ <key>Options</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Requests that a non-physical object be key-framed according to key-frame list.\nSpecify a list of times, positions, and orientations to be followed by an object. The object will be smoothly moved between key-frames by the simulator. Collisions with other non-physical or key-framed objects will be ignored (no script events will fire and collision processing will not occur). Collisions with physical objects will be computed and reported, but the key-framed object will be unaffected by those collisions.\nKeyframes is a strided list containing positional, rotational, and time data for each step in the motion. Options is a list containing optional arguments and parameters (specified by KFM_* constants).</string>
+ </map>
+ <key>llSetLinkAlpha</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>LinkNumber</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Opacity</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>If a prim exists in the link chain at LinkNumber, set Face to Opacity.\nSets the Face, on the linked prim specified, to the Opacity.</string>
+ </map>
+ <key>llSetLinkCamera</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>LinkNumber</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Prim link number (0: unlinked, 1: root prim, &gt;1: child prims) or a LINK_* flag</string>
+ </map>
+ </map>
+ <map>
+ <key>EyeOffset</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Offset, relative to the object's centre and expressed in local coordinates, that the camera looks from.</string>
+ </map>
+ </map>
+ <map>
+ <key>LookOffset</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Offset, relative to the object's centre and expressed in local coordinates, that the camera looks toward.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the camera eye offset, and the offset that camera is looking at, for avatars that sit on the linked prim.</string>
+ </map>
+ <key>llSetLinkColor</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>LinkNumber</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Link number (0: unlinked, 1: root prim, &gt;1: child prims) or a LINK_* flag.</string>
+ </map>
+ </map>
+ <map>
+ <key>Color</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Color in RGB &lt;R.R, G.G, B.B&gt;</string>
+ </map>
+ </map>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Side number or ALL_SIDES.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>If a task exists in the link chain at LinkNumber, set the Face to color.\nSets the color of the linked child's side, specified by LinkNumber.</string>
+ </map>
+ <key>llSetLinkMedia</key>
+ <map>
+ <key>energy</key>
+ <real>0.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Link</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Link number (0: unlinked, 1: root prim, &gt;1: child prims).</string>
+ </map>
+ </map>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Face number.</string>
+ </map>
+ </map>
+ <map>
+ <key>Parameters</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>A set of name/value pairs (in no particular order)</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Set the media parameters for a particular face on linked prim, specified by Link. Returns an integer that is a STATUS_* flag which details the success/failure of the operation(s).\nMediaParameters is a set of name/value pairs in no particular order. Parameters not specified are unchanged, or if new media is added then set to the default specified.</string>
+ </map>
+ <key>llSetLinkPrimitiveParams</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.2</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>LinkNumber</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Link number (0: unlinked, 1: root prim, &gt;1: child prims) or a LINK_* flag</string>
+ </map>
+ </map>
+ <map>
+ <key>Parameters</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Set primitive parameters for LinkNumber based on Parameters.\nSets the parameters (or properties) of any linked prim in one step.</string>
+ </map>
+ <key>llSetLinkPrimitiveParamsFast</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>LinkNumber</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Link number (0: unlinked, 1: root prim, &gt;1: child prims) or a LINK_* flag</string>
+ </map>
+ </map>
+ <map>
+ <key>Parameters</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Set primitive parameters for LinkNumber based on Parameters, without a delay.\nSet parameters for link number, from the list of Parameters, with no built-in script sleep. This function is identical to llSetLinkPrimitiveParams, except without the delay.</string>
+ </map>
+ <key>llSetLinkTexture</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.2</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>LinkNumber</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Texture</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the Texture of Face on a linked prim, specified by LinkNumber. Texture may be a UUID or name of a texture in prim inventory.</string>
+ </map>
+ <key>llSetLinkTextureAnim</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>LinkNumber</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Link number (0: unlinked, 1: root prim, &gt;1: child prims) or a LINK_* flag to effect</string>
+ </map>
+ </map>
+ <map>
+ <key>Mode</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Bitmask of animation options.</string>
+ </map>
+ </map>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Specifies which object face to animate or ALL_SIDES.</string>
+ </map>
+ </map>
+ <map>
+ <key>SizeX</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Horizontal frames (ignored for ROTATE and SCALE).</string>
+ </map>
+ </map>
+ <map>
+ <key>SizeY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Vertical frames (ignored for ROTATE and SCALE).</string>
+ </map>
+ </map>
+ <map>
+ <key>Start</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>Start position/frame number (or radians for ROTATE).</string>
+ </map>
+ </map>
+ <map>
+ <key>Length</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>Specifies the animation duration, in frames (or radians for ROTATE).</string>
+ </map>
+ </map>
+ <map>
+ <key>Rate</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>Specifies the animation playback rate, in frames per second (must be greater than zero).</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Animates a texture on the prim specified by LinkNumber, by setting the texture scale and offset.\nMode is a bitmask of animation options.\nFace specifies which object face to animate.\nSizeX and SizeY specify the number of horizontal and vertical frames.Start specifes the animation start point.\nLength specifies the animation duration.\nRate specifies the animation playback rate.</string>
+ </map>
+ <key>llSetLocalRot</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.2</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Rotation</key>
+ <map>
+ <key>type</key>
+ <string>rotation</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the rotation of a child prim relative to the root prim.</string>
+ </map>
+ <key>llSetMemoryLimit</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Limit</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>The amount to reserve, which must be less than the allowed maximum (currently 64KB) and not already have been exceeded.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Requests Limit bytes to be reserved for this script.\nReturns TRUE or FALSE indicating whether the limit was set successfully.\nThis function has no effect if the script is running in the LSO VM.</string>
+ </map>
+ <key>llSetObjectDesc</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Description</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the description of the prim to Description.\nThe description field is limited to 127 characters.</string>
+ </map>
+ <key>llSetObjectName</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Name</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the prim's name to Name.</string>
+ </map>
+ <key>llSetObjectPermMask</key>
+ <map>
+ <key>god-mode</key>
+ <boolean>true</boolean>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>PermissionFlag</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>MASK_* flag</string>
+ </map>
+ </map>
+ <map>
+ <key>PermissionMask</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Permission bit-field (PERM_* flags)</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the specified PermissionFlag permission to the value specified by PermissionMask on the object the script is attached to.</string>
+ </map>
+ <key>llSetParcelMusicURL</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>2.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>URL</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the streaming audio URL for the parcel the object is on.\nThe object must be owned by the owner of the parcel; if the parcel is group owned the object must be owned by that group.</string>
+ </map>
+ <key>llSetPayPrice</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Price</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>The default price shown in the textu input field.</string>
+ </map>
+ </map>
+ <map>
+ <key>QuickButtons</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>Specifies the 4 payment values shown in the payment dialog's buttons (or PAY_HIDE).</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the default amount when someone chooses to pay this object.\nPrice is the default price shown in the textu input field. QuickButtons specifies the 4 payment values shown in the payment dialog's buttons.\nInput field and buttons may be hidden with PAY_HIDE constant, and may be set to their default values using PAY_DEFAULT.</string>
+ </map>
+ <key>llSetPhysicsMaterial</key>
+ <map>
+ <key>energy</key>
+ <real/>
+ <key>sleep</key>
+ <real/>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>MaterialBits</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>A bitmask specifying which of the parameters in the other arguments should be applied to the object.</string>
+ </map>
+ </map>
+ <map>
+ <key>GravityMultiplier</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Restitution</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Friction</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Density</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the selected parameters of the object's physics behavior.\nMaterialBits is a bitmask specifying which of the parameters in the other arguments should be applied to the object. GravityMultiplier, Restitution, Friction, and Density are the possible parameters to manipulate.</string>
+ </map>
+ <key>llSetPos</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.2</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Position</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Region coordinates to move to (within 10m).</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>If the object is not physical, this function sets the position of the prim.\nIf the script is in a child prim, Position is treated as root relative and the link-set is adjusted.\nIf the prim is the root prim, the entire object is moved (up to 10m) to Position in region coordinates.</string>
+ </map>
+ <key>llSetPrimitiveParams</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.2</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Parameters</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>A list of changes.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This function changes the many properties (or "parameters") of a prim in one operation. Parameters is a list of changes.</string>
+ </map>
+ <key>llSetPrimMediaParams</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>1.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Face number</string>
+ </map>
+ </map>
+ <map>
+ <key>MediaParameters</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>A set of name/value pairs (in no particular order)</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the MediaParameters for a particular Face on the prim. Returns an integer that is a STATUS_* flag which details the success/failure of the operation(s).\nMediaParameters is a set of name/value pairs in no particular order. Parameters not specified are unchanged, or if new media is added then set to the default specified.</string>
+ </map>
+ <key>llSetPrimURL</key>
+ <map>
+ <key>deprecated</key>
+ <boolean>true</boolean>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>20.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>URL</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Deprecated: Use llSetPrimMediaParams instead.</string>
+ </map>
+ <key>llSetRegionPos</key>
+ <map>
+ <key>energy</key>
+ <real>0.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Position</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Vector. The location to move to, in region coordinates.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Attempts to move the object so that the root prim is within 0.1m of Position.\nReturns an integer boolean, TRUE if the object is successfully placed within 0.1 m of Position, FALSE otherwise.\nPosition may be any location within the region or up to 10m across a region border.\nIf the position is below ground, it will be set to the ground level at that x,y location.</string>
+ </map>
+ <key>llSetRemoteScriptAccessPin</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.2</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>PIN</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>If PIN is set to a non-zero number, the task will accept remote script loads via llRemoteLoadScriptPin() if it passes in the correct PIN. Othersise, llRemoteLoadScriptPin() is ignored.</string>
+ </map>
+ <key>llSetRot</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.2</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Rotation</key>
+ <map>
+ <key>type</key>
+ <string>rotation</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>If the object is not physical, this function sets the rotation of the prim.\nIf the script is in a child prim, Rotation is treated as root relative and the link-set is adjusted.\nIf the prim is the root prim, the entire object is rotated to Rotation in the global reference frame.</string>
+ </map>
+ <key>llSetScale</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Scale</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the prim's scale (size) to Scale.</string>
+ </map>
+ <key>llSetScriptState</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ScriptName</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Running</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Enable or disable the script Running state of Script in the prim.</string>
+ </map>
+ <key>llSetSitText</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Displays Text rather than 'Sit' in the viewer's context menu.</string>
+ </map>
+ <key>llSetSoundQueueing</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>QueueEnable</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Boolean, sound queuing: TRUE enables, FALSE disables (default).</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets whether successive calls to llPlaySound, llLoopSound, etc., (attached sounds) interrupt the currently playing sound.\nThe default for objects is FALSE. Setting this value to TRUE will make the sound wait until the current playing sound reaches its end. The queue is one level deep.</string>
+ </map>
+ <key>llSetSoundRadius</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Radius</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>Maximum distance that sounds can be heard.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Limits radius for audibility of scripted sounds (both attached and triggered) to distance Radius.</string>
+ </map>
+ <key>llSetStatus</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Status</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Value</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets object status specified in Status bitmask (e.g. STATUS_PHYSICS|STATUS_PHANTOM) to boolean Value.\nFor a full list of STATUS_* constants, see wiki documentation.</string>
+ </map>
+ <key>llSetText</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Color</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Opacity</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Causes Text to float above the prim, using the specified Color and Opacity.</string>
+ </map>
+ <key>llSetTexture</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.2</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Texture</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Applies Texture to Face of prim.\nTexture may be a UUID or name of a texture in prim inventory.\nIf Face is ALL_SIDES, set the texture on all faces.</string>
+ </map>
+ <key>llSetTextureAnim</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Mode</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Mask of Mode flags.</string>
+ </map>
+ </map>
+ <map>
+ <key>Face</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Face number or ALL_SIDES.</string>
+ </map>
+ </map>
+ <map>
+ <key>SizeX</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Horizontal frames (ignored for ROTATE and SCALE).</string>
+ </map>
+ </map>
+ <map>
+ <key>SizeY</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Vertical frames (ignored for ROTATE and SCALE).</string>
+ </map>
+ </map>
+ <map>
+ <key>Start</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>Start position/frame number (or radians for ROTATE).</string>
+ </map>
+ </map>
+ <map>
+ <key>Length</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>number of frames to display (or radians for ROTATE).</string>
+ </map>
+ </map>
+ <map>
+ <key>Rate</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string>Frames per second (must not greater than zero).</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Animates a texture by setting the texture scale and offset.\nMode is a bitmask of animation options.\nFace specifies which object face to animate.\nSizeX and SizeY specify the number of horizontal and vertical frames.Start specifes the animation start point.\nLength specifies the animation duration.\nRate specifies the animation playback rate.</string>
+ </map>
+ <key>llSetTimerEvent</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Rate</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Causes the timer event to be triggered every Rate seconds.\n Passing in 0.0 stops further timer events.</string>
+ </map>
+ <key>llSetTorque</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Torque</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Torque force.</string>
+ </map>
+ </map>
+ <map>
+ <key>Local</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Boolean, if TRUE uses local axis, if FALSE uses region axis.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets the Torque acting on the script's object, in object-local coordinates if Local == TRUE (otherwise, the region reference frame is used).\nOnly works on physical objects.</string>
+ </map>
+ <key>llSetTouchText</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Displays Text in the viewer context menu that acts on a touch.</string>
+ </map>
+ <key>llSetVehicleFlags</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Flags</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Enables the vehicle flags specified in the Flags bitmask.\nValid parameters can be found in the wiki documentation.</string>
+ </map>
+ <key>llSetVehicleFloatParam</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ParameterName</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>ParameterValue</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets a vehicle float parameter.\nValid parameters can be found in the wiki documentation.</string>
+ </map>
+ <key>llSetVehicleRotationParam</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ParameterName</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>ParameterValue</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets a vehicle rotation parameter.\nValid parameters can be found in the wiki documentation.</string>
+ </map>
+ <key>llSetVehicleType</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Type</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Activates the vehicle action on the object with vehicle preset Type.\nValid Types and an explanation of their characteristics can be found in wiki documentation.</string>
+ </map>
+ <key>llSetVehicleVectorParam</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>ParameterName</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>ParameterValue</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Sets a vehicle vector parameter.\nValid parameters can be found in the wiki documentation.</string>
+ </map>
+ <key>llSetVelocity</key>
+ <map>
+ <key>energy</key>
+ <real/>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Velocity</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>The velocity to apply.</string>
+ </map>
+ </map>
+ <map>
+ <key>Local</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>If TRUE, the Velocity is treated as a local directional vector instead of a regional directional vector.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>If the object is physics-enabled, sets the object's linear velocity to Velocity.\nIf Local==TRUE, Velocity is treated as a local directional vector; otherwise, Velocity is treated as a global directional vector.</string>
+ </map>
+ <key>llSHA1String</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a string of 40 hex characters that is the SHA1 security Hash of Text.</string>
+ </map>
+ <key>llShout</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Channel</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Shouts Text on Channel.\nThis chat method has a range of 100m radius.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts.</string>
+ </map>
+ <key>llSin</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Theta</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the sine of Theta (Theta in radians).</string>
+ </map>
+ <key>llSitTarget</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Offset</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Rotation</key>
+ <map>
+ <key>type</key>
+ <string>rotation</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Set the sit location for this object. If offset == ZERO_VECTOR, clears the sit target.</string>
+ </map>
+ <key>llSleep</key>
+ <map>
+ <key>energy</key>
+ <real>0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Time</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Put script to sleep for Time seconds.</string>
+ </map>
+ <key>llSound</key>
+ <map>
+ <key>deprecated</key>
+ <boolean>true</boolean>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Sound</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Volume</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Queue</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Loop</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Deprecated: Use llPlaySound instead.\nPlays Sound at Volume and specifies whether the sound should loop and/or be enqueued.</string>
+ </map>
+ <key>llSoundPreload</key>
+ <map>
+ <key>deprecated</key>
+ <boolean>true</boolean>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Sound</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Deprecated: Use llPreloadSound instead.\nPreloads a sound on viewers within range.</string>
+ </map>
+ <key>llSqrt</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Value</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the square root of Value.\nTriggers a math runtime error for imaginary results (if Value &lt; 0.0).</string>
+ </map>
+ <key>llStartAnimation</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Animation</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This function plays the specified animation from playing on the avatar who received the script's most recent permissions request.\nAnimation may be an animation in task inventory or a built-in animation.\nRequires PERMISSION_TRIGGER_ANIMATION.</string>
+ </map>
+ <key>llStopAnimation</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Animation</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This function stops the specified animation on the avatar who received the script's most recent permissions request.\nAnimation may be an animation in task inventory, a built-in animation, or the uuid of an animation.\nRequires PERMISSION_TRIGGER_ANIMATION.</string>
+ </map>
+ <key>llStopHover</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Stop hovering to a height (due to llSetHoverHeight()).</string>
+ </map>
+ <key>llStopLookAt</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Stop causing object to point at a target (due to llLookAt() or llRotLookAt()).</string>
+ </map>
+ <key>llStopMoveToTarget</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Stops critically damped motion (due to llMoveToTarget()).</string>
+ </map>
+ <key>llStopSound</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Stops playback of the currently attached sound.</string>
+ </map>
+ <key>llStringLength</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns an integer that is the number of characters in Text (not counting the null).</string>
+ </map>
+ <key>llStringToBase64</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the string Base64 representation of the input string.</string>
+ </map>
+ <key>llStringTrim</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string>String to trim</string>
+ </map>
+ </map>
+ <map>
+ <key>TrimType</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>STRING_TRIM_HEAD, STRING_TRIM_TAIL, or STRING_TRIM.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Outputs a string, eliminating white-space from the start and/or end of the input string Text.\nValid options for TrimType:\nSTRING_TRIM_HEAD: trim all leading spaces in Text\nSTRING_TRIM_TAIL: trim all trailing spaces in Text\nSTRING_TRIM: trim all leading and trailing spaces in Text.</string>
+ </map>
+ <key>llSubStringIndex</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Sequence</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns an integer that is the index in Text where string pattern Sequence first appears. Returns -1 if not found.</string>
+ </map>
+ <key>llTakeCamera</key>
+ <map>
+ <key>deprecated</key>
+ <boolean>true</boolean>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Deprecated: Use llSetCameraParams instead.</string>
+ </map>
+ <key>llTakeControls</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Controls</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Bit-field of CONTROL_* flags.</string>
+ </map>
+ </map>
+ <map>
+ <key>Accept</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Boolean, determines whether control events are generated.</string>
+ </map>
+ </map>
+ <map>
+ <key>PassOn</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>Boolean, determines whether controls are disabled.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Take controls from the agent the script has permissions for.\nIf (Accept == (Controls &amp; input)), send input to the script. PassOn determines whether Controls also perform their normal functions.\nRequires the PERMISSION_TAKE_CONTROLS permission to run.</string>
+ </map>
+ <key>llTan</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Theta</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the tangent of Theta (Theta in radians).</string>
+ </map>
+ <key>llTarget</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>integer</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Position</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Range</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>This function is to have the script know when it has reached a position.\nIt registers a Position with a Range that triggers at_target and not_at_target events continuously until unregistered.</string>
+ </map>
+ <key>llTargetOmega</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Axis</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>SpinRate</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Gain</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Attempt to spin at SpinRate with strength Gain on Axis.\nA spin rate of 0.0 cancels the spin. This function always works in object-local coordinates.</string>
+ </map>
+ <key>llTargetRemove</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Target</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Removes positional target Handle registered with llTarget.</string>
+ </map>
+ <key>llTeleportAgent</key>
+ <map>
+ <key>energy</key>
+ <real>0</real>
+ <key>sleep</key>
+ <real>0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string>UUID of avatar.</string>
+ </map>
+ </map>
+ <map>
+ <key>LandmarkName</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string>Name of landmark (in object contents), or empty string, to use.</string>
+ </map>
+ </map>
+ <map>
+ <key>Position</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>If no landmark was provided, the position within the current region to teleport the avatar to.</string>
+ </map>
+ </map>
+ <map>
+ <key>LookAtPoint</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>The position within the target region that the avatar should be turned to face upon arrival.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Requests a teleport of avatar to a landmark stored in the object's inventory. If no landmark is provided (an empty string), the avatar is teleported to the location position in the current region. In either case, the avatar is turned to face the position given by look_at in local coordinates.\nRequires the PERMISSION_TELEPORT permission. This function can only teleport the owner of the object.</string>
+ </map>
+ <key>llTeleportAgentGlobalCoords</key>
+ <map>
+ <key>energy</key>
+ <real>0</real>
+ <key>sleep</key>
+ <real>0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string>UUID of avatar.</string>
+ </map>
+ </map>
+ <map>
+ <key>GlobalPosition</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Global coordinates of the destination region. Can be retrieved by using llRequestSimulatorData(region_name, DATA_SIM_POS).</string>
+ </map>
+ </map>
+ <map>
+ <key>RegionPosition</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>The position within the target region to teleport the avatar to, if no landmark was provided.</string>
+ </map>
+ </map>
+ <map>
+ <key>LookAtPoint</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>The position within the target region that the avatar should be turned to face upon arrival.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Teleports an agent to the RegionPosition local coordinates within a region which is specified by the GlobalPosition global coordinates. The agent lands facing the position defined by LookAtPoint local coordinates.\nRequires the PERMISSION_TELEPORT permission. This function can only teleport the owner of the object.</string>
+ </map>
+ <key>llTeleportAgentHome</key>
+ <map>
+ <key>energy</key>
+ <real>100.0</real>
+ <key>sleep</key>
+ <real>5.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Teleport agent over the owner's land to agent's home location.</string>
+ </map>
+ <key>llTextBox</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>1.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Channel</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Opens a dialog for the specified avatar with message Text, which contains a text box for input. Any text that is entered is said on the specified Channel (as if by the avatar) when the "OK" button is clicked.</string>
+ </map>
+ <key>llToLower</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a string that is Text with all lower-case characters.</string>
+ </map>
+ <key>llToUpper</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns a string that is Text with all upper-case characters.</string>
+ </map>
+ <key>llTransferLindenDollars</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>key</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Amount</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Transfer Amount of linden dollars (L$) from script owner to AvatarID. Returns a key to a corresponding transaction_result event for the success of the transfer.\nAttempts to send the amount of money to the specified avatar, and trigger a transaction_result event identified by the returned key.</string>
+ </map>
+ <key>llTriggerSound</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Sound</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Volume</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Plays Sound at Volume (0.0 - 1.0), centered at but not attached to object.\nThere is no limit to the number of triggered sounds which can be generated by an object, and calling llTriggerSound does not affect the attached sounds created by llPlaySound and llLoopSound. This is very useful for things like collision noises, explosions, etc. There is no way to stop or alter the volume of a sound triggered by this function.</string>
+ </map>
+ <key>llTriggerSoundLimited</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Sound</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Volume</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>TNE</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>BSW</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Plays Sound at Volume (0.0 - 1.0), centered at but not attached to object, limited to axis-aligned bounding box defined by vectors top-north-east (TNE) and bottom-south-west (BSW).\nThere is no limit to the number of triggered sounds which can be generated by an object, and calling llTriggerSound does not affect the attached sounds created by llPlaySound and llLoopSound. This is very useful for things like collision noises, explosions, etc. There is no way to stop or alter the volume of a sound triggered by this function.</string>
+ </map>
+ <key>llUnescapeURL</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>URL</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the string that is the URL unescaped, replacing "%20" with spaces, etc., version of URL.\nThis function can output raw UTF-8 strings.</string>
+ </map>
+ <key>llUnSit</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>AvatarID</key>
+ <map>
+ <key>type</key>
+ <string>key</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>If agent identified by AvatarID is sitting on the object the script is attached to or is over land owned by the objects owner, the agent is forced to stand up.</string>
+ </map>
+ <key>llUpdateCharacter</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Options</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>Character configuration options. Takes the same constants as llCreateCharacter().</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Updates settings for a pathfinding character.</string>
+ </map>
+ <key>llVecDist</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Location1</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Location2</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the distance between Location1 and Location2.</string>
+ </map>
+ <key>llVecMag</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Vector</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the magnitude of the vector.</string>
+ </map>
+ <key>llVecNorm</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Vector</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns normalized vector.</string>
+ </map>
+ <key>llVolumeDetect</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>DetectEnabled</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string>TRUE enables, FALSE disables.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>If DetectEnabled = TRUE, object becomes phantom but triggers collision_start and collision_end events when other objects start and stop interpenetrating.\nIf another object (including avatars) interpenetrates it, it will get a collision_start event.\nWhen an object stops interpenetrating, a collision_end event is generated. While the other is inter-penetrating, collision events are NOT generated.</string>
+ </map>
+ <key>llWanderWithin</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Origin</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Central point to wander about.</string>
+ </map>
+ </map>
+ <map>
+ <key>Area</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string>Half-extents of an area the character may wander within. (i.e., it can wander from the specified origin by up to +/-Distance.x in x, +/-Distance.y in y, etc.)</string>
+ </map>
+ </map>
+ <map>
+ <key>Options</key>
+ <map>
+ <key>type</key>
+ <string>list</string>
+ <key>tooltip</key>
+ <string>No options available at this time.</string>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Wander within a specified volume.\nSets a character to wander about a central spot within a specified area.</string>
+ </map>
+ <key>llWater</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Offset</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the water height below the object position + Offset.</string>
+ </map>
+ <key>llWhisper</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>void</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Channel</key>
+ <map>
+ <key>type</key>
+ <string>integer</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Text</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Whispers Text on Channel.\nThis chat method has a range of 10m radius.\nPUBLIC_CHANNEL is the public chat channel that all avatars see as chat text. DEBUG_CHANNEL is the script debug channel, and is also visible to nearby avatars. All other channels are are not sent to avatars, but may be used to communicate with scripts.</string>
+ </map>
+ <key>llWind</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>vector</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Offset</key>
+ <map>
+ <key>type</key>
+ <string>vector</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Returns the wind velocity at the object position + Offset.</string>
+ </map>
+ <key>llXorBase64</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Text1</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Text2</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Performs an exclusive OR on two Base64 strings and returns a Base64 string. Text2 repeats if it is shorter than Text1.</string>
+ </map>
+ <key>llXorBase64Strings</key>
+ <map>
+ <key>deprecated</key>
+ <boolean>true</boolean>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.3</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Text1</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Text2</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Deprecated: Please use llXorBase64 instead.\nIncorrectly performs an exclusive OR on two Base64 strings and returns a Base64 string. Text2 repeats if it is shorter than Text1.\nRetained for backwards compatibility.</string>
+ </map>
+ <key>llXorBase64StringsCorrect</key>
+ <map>
+ <key>deprecated</key>
+ <boolean>true</boolean>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>string</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Text1</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ <map>
+ <key>Text2</key>
+ <map>
+ <key>type</key>
+ <string>string</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Deprecated: Please use llXorBase64 instead.\nCorrectly (unless nulls are present) performs an exclusive OR on two Base64 strings and returns a Base64 string.\nText2 repeats if it is shorter than Text1.</string>
+ </map>
+ <key>llGetMinScaleFactor</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the smallest multiplicative uniform scale factor that can be successfully applied (via llScaleByFactor()) to the object without violating prim size or linkability rules.</string>
+ </map>
+ <key>llGetMaxScaleFactor</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <undef/>
+ <key>tooltip</key>
+ <string>Returns the largest multiplicative uniform scale factor that can be successfully applied (via llScaleByFactor()) to the object without violating prim size or linkability rules.</string>
+ </map>
+ <key>llScaleByFactor</key>
+ <map>
+ <key>energy</key>
+ <real>10.0</real>
+ <key>sleep</key>
+ <real>0.0</real>
+ <key>return</key>
+ <string>float</string>
+ <key>arguments</key>
+ <array>
+ <map>
+ <key>Factor</key>
+ <map>
+ <key>type</key>
+ <string>float</string>
+ <key>tooltip</key>
+ <string/>
+ </map>
+ </map>
+ </array>
+ <key>tooltip</key>
+ <string>Tries to uniformly scale the object by a multiplicative factor. Returns TRUE on success or FALSE on failure.</string>
+ </map>
+ </map>
+ <key>llsd-lsl-syntax-version</key>
+ <integer>2</integer>
+ </map>
+</llsd>
diff --git a/indra/newview/app_settings/llsd-lsl-syntax.rng b/indra/newview/app_settings/llsd-lsl-syntax.rng
new file mode 100755
index 0000000000..aa92364ec1
--- /dev/null
+++ b/indra/newview/app_settings/llsd-lsl-syntax.rng
@@ -0,0 +1,390 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar
+ xmlns="http://relaxng.org/ns/structure/1.0"
+ xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
+ datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+ <start>
+ <element name="llsd">
+ <element name="map">
+ <group>
+ <element name="key">
+ <value>constants</value>
+ </element>
+ <element name="map">
+ <oneOrMore>
+ <group>
+ <ref name="keyString"/>
+ <element name="map">
+ <ref name="Deprecated" />
+ <ref name="constantTypeValue" />
+ <ref name="Tooltip" />
+ </element>
+ </group>
+ </oneOrMore>
+ </element>
+ </group>
+
+ <group>
+ <element name="key">
+ <value>controls</value>
+ </element>
+ <element name="map">
+ <oneOrMore>
+ <group>
+ <ref name="keyString"/>
+ <ref name="mapTooltip"/>
+ </group>
+ </oneOrMore>
+ </element>
+ </group>
+
+ <group>
+ <element name="key">
+ <value>events</value>
+ </element>
+ <element name="map">
+ <oneOrMore>
+ <group>
+ <ref name="keyString"/>
+ <element name="map">
+ <ref name="Deprecated" />
+ <ref name="Arguments"/>
+ <ref name="Tooltip"/>
+ </element>
+ </group>
+ </oneOrMore>
+ </element>
+ </group>
+
+ <group>
+ <element name="key">
+ <value>functions</value>
+ </element>
+ <element name="map">
+ <oneOrMore>
+ <group>
+ <ref name="keyString"/>
+ <element name="map">
+ <ref name="Arguments"/>
+ <ref name="Deprecated" />
+ <element name="key">
+ <value>energy</value>
+ </element>
+ <ref name="float"/>
+ <optional>
+ <group>
+ <element name="key">
+ <value>god-mode</value>
+ </element>
+ <element name="boolean">
+ <data type="boolean"/>
+ </element>
+ </group>
+ </optional>
+ <ref name="Return"/>
+ <element name="key">
+ <value>sleep</value>
+ </element>
+ <ref name="float"/>
+ <ref name="Tooltip"/>
+ </element>
+ </group>
+ </oneOrMore>
+ </element>
+ </group>
+
+ <group>
+ <element name="key">
+ <value>llsd-lsl-syntax-version</value>
+ </element>
+ <element name="integer">
+ <data type="integer" />
+ </element>
+ </group>
+
+ <group>
+ <element name="key">
+ <value>types</value>
+ </element>
+ <element name="map">
+ <oneOrMore>
+ <group>
+ <ref name="keyString"/>
+ <ref name="mapTooltip"/>
+ </group>
+ </oneOrMore>
+ </element>
+ </group>
+ </element>
+ </element>
+ </start>
+
+ <define name="Deprecated">
+ <optional>
+ <group>
+ <element name="key">
+ <value>deprecated</value>
+ </element>
+ <element name="boolean">
+ <data type="boolean"/>
+ </element>
+ </group>
+ </optional>
+ </define>
+
+ <define name="keyName">
+ <element name="key"><value>name</value></element>
+ <element name="string"><data type="string" /></element>
+ </define>
+
+
+ <define name="keyString">
+ <element name="key"><data type="string"/></element>
+ </define>
+
+ <define name="keyType">
+ <element name="key"><value>type</value></element>
+ </define>
+
+ <define name="typeList">
+ <ref name="keyType" />
+ <element name="string">
+ <choice>
+ <value>float</value>
+ <value>integer</value>
+ <value>key</value>
+ <value>list</value>
+ <value>rotation</value>
+ <value>string</value>
+ <value>vector</value>
+ </choice>
+ </element>
+ </define>
+
+ <define name="keyValue">
+ <element name="key"><value>value</value></element>
+ </define>
+
+ <define name="constantTypeValue">
+ <choice>
+ <group>
+ <ref name="keyType"/>
+ <element name="string"><value>float</value></element>
+ <ref name="keyValue"/>
+ <element name="real"><data type="float"/></element>
+ </group>
+ <group>
+ <ref name="keyType"/>
+ <element name="string"><value>integer</value></element>
+ <ref name="keyValue"/>
+ <choice>
+ <element name="integer"><data type="integer"/></element>
+ <element name="integer"><data type="string"><param name="pattern">0x[0-9A-Fa-f]+</param></data></element>
+ </choice>
+ </group>
+ <group>
+ <ref name="keyType"/>
+ <element name="string"><value>key</value></element>
+ <ref name="keyValue"/>
+ <element name="uuid"><data type="string"><param name="pattern">[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}</param></data></element>
+ </group>
+ <group>
+ <ref name="keyType"/>
+ <element name="string"><value>rotation</value></element>
+ <ref name="keyValue"/>
+ <element name="array">
+ <element name="map">
+ <element name="key">
+ <value>x</value>
+ </element>
+ <ref name="realFromMinusOneToOne"/>
+ </element>
+ <element name="map">
+ <element name="key">
+ <value>y</value>
+ </element>
+ <ref name="realFromMinusOneToOne"/>
+ </element>
+ <element name="map">
+ <element name="key">
+ <value>z</value>
+ </element>
+ <ref name="realFromMinusOneToOne"/>
+ </element>
+ <element name="map">
+ <element name="key"><value>w</value></element>
+ <ref name="realFromMinusOneToOne"/>
+ </element>
+ </element>
+ </group>
+ <group>
+ <ref name="keyType"/>
+ <element name="string"><value>string</value></element>
+ <ref name="keyValue"/>
+ <element name="string">
+ <data type="string"/>
+ </element>
+ </group>
+ <group>
+ <ref name="keyType"/>
+ <element name="string">
+ <value>vector</value>
+ </element>
+ <ref name="keyValue"/>
+ <element name="array">
+ <ref name="vector"/>
+ </element>
+ </group>
+ </choice>
+ </define>
+
+ <define name="nameType">
+ <ref name="keyName" />
+ <ref name="keyType" />
+ </define>
+
+ <define name="realFromMinusOneToOne">
+ <element name="real">
+ <data type="float">
+ <param name="pattern">([\-+]|)(1|0)\.\d+</param>
+ </data>
+ </element>
+ </define>
+
+ <define name="float">
+ <choice>
+ <element name="real">
+ <data type="float"/>
+ </element>
+ <element name="real">
+ <empty/>
+ </element>
+ </choice>
+ </define>
+
+ <define name="vector">
+ <element name="map">
+ <element name="key">
+ <value>x</value>
+ </element>
+ <ref name="realFromMinusOneToOne"/>
+ </element>
+ <element name="map">
+ <element name="key">
+ <value>y</value>
+ </element>
+ <ref name="realFromMinusOneToOne"/>
+ </element>
+ <element name="map">
+ <element name="key">
+ <value>z</value>
+ </element>
+ <ref name="realFromMinusOneToOne"/>
+ </element>
+ </define>
+
+ <define name="mapTooltip">
+ <element name="map">
+ <ref name="Tooltip" />
+ </element>
+ </define>
+
+ <define name="Tooltip">
+ <element name="key">
+ <value>tooltip</value>
+ </element>
+ <element name="string">
+ <data type="string" />
+ </element>
+ </define>
+
+ <define name="Arguments">
+ <element name="key"><value>arguments</value></element>
+ <choice>
+ <element name="array">
+ <oneOrMore>
+ <element name="map">
+ <element name="key"><data type="string"><param name="pattern">[A-Z][A-Za-z0-9_]*|[a-z]</param></data></element>
+ <element name="map">
+ <!--ref name="keyName" /-->
+ <ref name="Tooltip" />
+ <ref name="typeList" />
+ </element>
+ </element>
+ </oneOrMore>
+ <!--choice>
+ <oneOrMore>
+ <element name="map">
+ <ref name="Argument"/>
+ </element>
+ </oneOrMore>
+ <element name="undef">
+ <empty/>
+ </element>
+ </choice-->
+ </element>
+ <element name="undef"><empty/></element>
+ </choice>
+ </define>
+
+ <define name="Argument">
+ <ref name="keyType"/>
+ <choice>
+ <element name="string">
+ <value>float</value>
+ </element>
+ <element name="string">
+ <value>integer</value>
+ </element>
+ <element name="string">
+ <value>key</value>
+ </element>
+ <element name="string">
+ <value>list</value>
+ </element>
+ <element name="string">
+ <value>rotation</value>
+ </element>
+ <element name="string">
+ <value>string</value>
+ </element>
+ <element name="string">
+ <value>vector</value>
+ </element>
+ </choice>
+ <ref name="Tooltip"/>
+ </define>
+
+ <define name="Return">
+ <element name="key">
+ <value>return</value>
+ </element>
+ <choice>
+ <element name="string">
+ <value>float</value>
+ </element>
+ <element name="string">
+ <value>integer</value>
+ </element>
+ <element name="string">
+ <value>key</value>
+ </element>
+ <element name="string">
+ <value>list</value>
+ </element>
+ <element name="string">
+ <value>rotation</value>
+ </element>
+ <element name="string">
+ <value>string</value>
+ </element>
+ <element name="string">
+ <value>vector</value>
+ </element>
+ <element name="string">
+ <value>void</value>
+ </element>
+ </choice>
+ </define>
+
+</grammar> \ No newline at end of file
diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml
index 92a241857e..15cb5bc0eb 100755
--- a/indra/newview/app_settings/logcontrol.xml
+++ b/indra/newview/app_settings/logcontrol.xml
@@ -43,6 +43,8 @@
<key>tags</key>
<array>
<!-- sample entry for debugging specific items
+ <string>Inventory</string>
+ <string>SceneLoadTiming</string>
<string>Avatar</string>
<string>Voice</string>
-->
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index de11309394..22d64d4d14 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -80,7 +80,7 @@
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
- <integer>0</integer>
+ <integer>1</integer>
</map>
<key>AgentPause</key>
<map>
@@ -731,7 +731,6 @@
<key>Value</key>
<integer>0</integer>
</map>
-
<key>BackgroundYieldTime</key>
<map>
<key>Comment</key>
@@ -1434,6 +1433,17 @@
<real>0.0</real>
</array>
</map>
+ <key>RestoreCameraPosOnLogin</key>
+ <map>
+ <key>Comment</key>
+ <string>Reset camera position to location at logout</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>CameraPositionSmoothing</key>
<map>
<key>Comment</key>
@@ -2972,6 +2982,17 @@
<key>Value</key>
<string>Female Shape &amp; Outfit</string>
</map>
+ <key>DefaultLoginLocation</key>
+ <map>
+ <key>Comment</key>
+ <string>Startup destination default (if not specified on command line)</string>
+ <key>Persist</key>
+ <integer>0</integer>
+ <key>Type</key>
+ <string>String</string>
+ <key>Value</key>
+ <string/>
+ </map>
<key>DefaultMaleAvatar</key>
<map>
<key>Comment</key>
@@ -3533,17 +3554,6 @@
<key>Value</key>
<string>http://events.secondlife.com/viewer/embed/event/</string>
</map>
- <key>EveryoneCopy</key>
- <map>
- <key>Comment</key>
- <string>Everyone can copy the newly created objects</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>0</integer>
- </map>
<key>FastCacheFetchEnabled</key>
<map>
<key>Comment</key>
@@ -4171,6 +4181,17 @@
<key>Value</key>
<integer>255</integer>
</map>
+ <key>ForceLoginURL</key>
+ <map>
+ <key>Comment</key>
+ <string>Force a specified URL for login page content - used if exists</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>String</string>
+ <key>Value</key>
+ <string></string>
+ </map>
<key>ForceShowGrid</key>
<map>
<key>Comment</key>
@@ -5304,6 +5325,18 @@
<key>Value</key>
<integer>1</integer>
</map>
+ <key>LoginContentVersion</key>
+ <map>
+ <key>Comment</key>
+ <string>Version of login page web based content to display</string>
+ <key>Persist</key>
+ <integer>0</integer>
+ <key>Type</key>
+ <string>String</string>
+ <key>Value</key>
+ <string>2</string>
+ </map>
+
<key>LoginSRVTimeout</key>
<map>
<key>Comment</key>
@@ -6116,7 +6149,7 @@
<key>Type</key>
<string>F32</string>
<key>Value</key>
- <real>600.0</real>
+ <real>30.0</real>
</map>
<key>MemoryPrivatePoolEnabled</key>
<map>
@@ -6437,38 +6470,27 @@
<key>Value</key>
<integer>130</integer>
</map>
- <key>NextOwnerCopy</key>
- <map>
- <key>Comment</key>
- <string>Newly created objects can be copied by next owner</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>0</integer>
- </map>
- <key>NextOwnerModify</key>
+ <key>NewObjectCreationThrottle</key>
<map>
<key>Comment</key>
- <string>Newly created objects can be modified by next owner</string>
+ <string>maximum number of new objects created per frame, -1 to disable this throttle</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
- <string>Boolean</string>
+ <string>S32</string>
<key>Value</key>
- <integer>0</integer>
+ <integer>200</integer>
</map>
- <key>NextOwnerTransfer</key>
+ <key>NewObjectCreationThrottleDelayTime</key>
<map>
<key>Comment</key>
- <string>Newly created objects can be resold or given away by next owner</string>
+ <string>time in seconds NewObjectCreationThrottle to take effect after the progress screen is lifted</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
- <string>Boolean</string>
+ <string>F32</string>
<key>Value</key>
- <integer>1</integer>
+ <real>2.0</real>
</map>
<key>NewCacheLocation</key>
<map>
@@ -6536,6 +6558,17 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>NonvisibleObjectsInMemoryTime</key>
+ <map>
+ <key>Comment</key>
+ <string>Number of frames non-visible objects stay in memory before being removed. 0 means never to remove.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>U32</string>
+ <key>Value</key>
+ <integer>300</integer>
+ </map>
<key>NoPreload</key>
<map>
<key>Comment</key>
@@ -6856,6 +6889,17 @@
<key>Value</key>
<integer>1</integer>
</map>
+ <key>RequestFullRegionCache</key>
+ <map>
+ <key>Comment</key>
+ <string>If set, ask sim to send full region object cache. Needs to restart viewer.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
<key>OpenDebugStatAdvanced</key>
<map>
<key>Comment</key>
@@ -7058,7 +7102,6 @@
<real>0.75</real>
</array>
</map>
-
<key>ParcelMediaAutoPlayEnable</key>
<map>
<key>Comment</key>
@@ -7425,6 +7468,17 @@
<key>Value</key>
<real>6.0</real>
</map>
+ <key>ClothingLoadingDelay</key>
+ <map>
+ <key>Comment</key>
+ <string>Time to wait for avatar appearance to resolve before showing world (seconds)</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>10.0</real>
+ </map>
<key>PreferredMaturity</key>
<map>
<key>Comment</key>
@@ -7980,7 +8034,6 @@
<key>Value</key>
<integer>1</integer>
</map>
-
<key>OctreeMaxNodeCapacity</key>
<map>
<key>Comment</key>
@@ -7993,6 +8046,18 @@
<integer>128</integer>
</map>
+ <key>OctreeMinimumNodeSize</key>
+ <map>
+ <key>Comment</key>
+ <string>Minimum size of any octree node</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>0.01</real>
+ </map>
+
<key>OctreeStaticObjectSizeFactor</key>
<map>
<key>Comment</key>
@@ -8919,7 +8984,7 @@
<key>Type</key>
<string>F32</string>
<key>Value</key>
- <real>384</real>
+ <real>368.0</real>
</map>
<key>RenderDeferred</key>
@@ -10200,6 +10265,105 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>SceneLoadFrontPixelThreshold</key>
+ <map>
+ <key>Comment</key>
+ <string>in pixels, all objects in view frustum whose screen area is greater than this threshold will be loaded</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>100.0</real>
+ </map>
+ <key>SceneLoadHighMemoryBound</key>
+ <map>
+ <key>Comment</key>
+ <string>in MB, when total memory usage above this threshold, minimum invisible objects are kept in memory </string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>U32</string>
+ <key>Value</key>
+ <real>1024</real>
+ </map>
+ <key>SceneLoadLowMemoryBound</key>
+ <map>
+ <key>Comment</key>
+ <string>in MB, when total memory usage above this threshold, start to reduce invisible objects kept in memory </string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>U32</string>
+ <key>Value</key>
+ <real>750</real>
+ </map>
+ <key>SceneLoadMinRadius</key>
+ <map>
+ <key>Comment</key>
+ <string>in meters, all objects (visible or invisible) within this radius will remain loaded in memory</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>32.0</real>
+ </map>
+ <key>SceneLoadRearMaxRadiusFraction</key>
+ <map>
+ <key>Comment</key>
+ <string>a percentage of draw distance beyond which all objects outside of view frustum will be unloaded, regardless of pixel threshold</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>75.0</real>
+ </map>
+ <key>SceneLoadRearPixelThreshold</key>
+ <map>
+ <key>Comment</key>
+ <string>in pixels, all objects out of view frustum whose screen area is greater than this threshold will remain loaded</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>400.0</real>
+ </map>
+ <key>SceneLoadingMonitorEnabled</key>
+ <map>
+ <key>Comment</key>
+ <string>Enabled scene loading monitor if set</string>
+ <key>Persist</key>
+ <integer>0</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>SceneLoadingMonitorSampleTime</key>
+ <map>
+ <key>Comment</key>
+ <string>Time between screen samples when monitor scene load (seconds)</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>0.25</real>
+ </map>
+ <key>SceneLoadingMonitorPixelDiffThreshold</key>
+ <map>
+ <key>Comment</key>
+ <string>Amount of pixels changed required to consider the scene as still loading (square root of fraction of pixels on screen)</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>0.02</real>
+ </map>
<key>ScriptHelpFollowsCursor</key>
<map>
<key>Comment</key>
@@ -10343,17 +10507,6 @@
<key>Value</key>
<integer>0</integer>
</map>
- <key>ShareWithGroup</key>
- <map>
- <key>Comment</key>
- <string>Newly created objects are shared with the currently active group</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>0</integer>
- </map>
<key>ShowAdvancedGraphicsSettings</key>
<map>
<key>Comment</key>
@@ -11344,28 +11497,6 @@
<key>Value</key>
<integer>75</integer>
</map>
- <key>SnapshotSharingEnabled</key>
- <map>
- <key>Comment</key>
- <string>Enable uploading of snapshots to a web service.</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>0</integer>
- </map>
- <key>SnapshotConfigURL</key>
- <map>
- <key>Comment</key>
- <string>URL to fetch Snapshot Sharing configuration data from.</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>String</string>
- <key>Value</key>
- <string>http://photos.apps.staging.avatarsunited.com/viewer_config</string>
- </map>
<key>SpeedTest</key>
<map>
<key>Comment</key>
@@ -11597,6 +11728,17 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>TextureFetchFakeFailureRate</key>
+ <map>
+ <key>Comment</key>
+ <string>Simulate HTTP fetch failures for some server bake textures.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <integer>0.0</integer>
+ </map>
<key>TextureFetchSource</key>
<map>
<key>Comment</key>
@@ -11938,50 +12080,6 @@
<key>Value</key>
<integer>1</integer>
</map>
- <key>UIAvatariconctrlSymbolHPad</key>
- <map>
- <key>Comment</key>
- <string>UI Avatar Icon Control Symbol Horizontal Pad</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>S32</string>
- <key>Value</key>
- <real>2</real>
- </map>
- <key>UIAvatariconctrlSymbolVPad</key>
- <map>
- <key>Comment</key>
- <string>UI Avatar Icon Control Symbol Vertical Pad</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>S32</string>
- <key>Value</key>
- <real>2</real>
- </map>
- <key>UIAvatariconctrlSymbolSize</key>
- <map>
- <key>Comment</key>
- <string>UI Avatar Icon Control Symbol Size</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>S32</string>
- <key>Value</key>
- <real>5</real>
- </map>
- <key>UIAvatariconctrlSymbolPosition</key>
- <map>
- <key>Comment</key>
- <string>UI Avatar Icon Control Symbol Position (TopLeft|TopRight|BottomLeft|BottomRight)</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>String</string>
- <key>Value</key>
- <string>BottomRight</string>
- </map>
<key>UIButtonOrigHPad</key>
<map>
<key>Comment</key>
@@ -13126,7 +13224,7 @@
<key>Value</key>
<string>Default</string>
</map>
- <key>UseExternalBrowser</key>
+ <key>UseExternalBrowser</key> <!-- deprecated (see MAINT-4127) -->
<map>
<key>Comment</key>
<string>Use default browser when opening web pages instead of in-world browser.</string>
@@ -13137,6 +13235,17 @@
<key>Value</key>
<boolean>1</boolean>
</map>
+ <key>PreferredBrowserBehavior</key>
+ <map>
+ <key>Comment</key>
+ <string>Use system browser for any links (0), use builtin browser for SL links and system one for others (1) or use builtin browser only (2).</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>U32</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
<key>UseFreezeFrame</key>
<map>
<key>Comment</key>
@@ -13159,6 +13268,17 @@
<key>Value</key>
<integer>1</integer>
</map>
+ <key>UseObjectCacheOcclusion</key>
+ <map>
+ <key>Comment</key>
+ <string>Enable object cache level object culling based on occlusion (coverage) by other objects</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
<key>RenderSynchronousOcclusion</key>
<map>
<key>Comment</key>
@@ -13184,7 +13304,7 @@
<key>SocialPhotoResolution</key>
<map>
<key>Comment</key>
- <string>Default resolution when sharing photo using the social floater</string>
+ <string>Default resolution when sharing photo using the social floaters</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@@ -14116,6 +14236,17 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>LeaveMouselook</key>
+ <map>
+ <key>Comment</key>
+ <string>Exit Mouselook mode via S or Down Arrow keys while sitting </string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>TextureLoggingThreshold</key>
<map>
<key>Comment</key>
@@ -14605,6 +14736,347 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>ObjectsNextOwnerCopy</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly created objects can be copied by next owner</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>ObjectsNextOwnerModify</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly created objects can be modified by next owner</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>ObjectsNextOwnerTransfer</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly created objects can be resold or given away by next owner</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>ObjectsEveryoneCopy</key>
+ <map>
+ <key>Comment</key>
+ <string>Everyone can copy the newly created object</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>ObjectsShareWithGroup</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly created objects are shared with the currently active group</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>UploadsNextOwnerCopy</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly uploaded items can be copied by next owner</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>UploadsNextOwnerModify</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly uploaded items can be modified by next owner</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>UploadsNextOwnerTransfer</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly uploaded items can be resold or given away by next owner</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>UploadsEveryoneCopy</key>
+ <map>
+ <key>Comment</key>
+ <string>Everyone can copy the newly uploaded item</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>UploadsShareWithGroup</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly uploaded items are shared with the currently active group</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>ScriptsNextOwnerCopy</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly created scripts can be copied by next owner</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>ScriptsNextOwnerModify</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly created scripts can be modified by next owner</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>ScriptsNextOwnerTransfer</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly created scripts can be resold or given away by next owner</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>ScriptsEveryoneCopy</key>
+ <map>
+ <key>Comment</key>
+ <string>Everyone can copy the newly created script</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>ScriptsShareWithGroup</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly created scripts are shared with the currently active group</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>NotecardsNextOwnerCopy</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly created notecards can be copied by next owner</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>NotecardsNextOwnerModify</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly created notecards can be modified by next owner</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>NotecardsNextOwnerTransfer</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly created notecards can be resold or given away by next owner</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>NotecardsEveryoneCopy</key>
+ <map>
+ <key>Comment</key>
+ <string>Everyone can copy the newly created notecard</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>NotecardsShareWithGroup</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly created notecards are shared with the currently active group</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>GesturesNextOwnerCopy</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly created gestures can be copied by next owner</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>GesturesNextOwnerModify</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly created gestures can be modified by next owner</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>GesturesNextOwnerTransfer</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly created gestures can be resold or given away by next owner</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>GesturesEveryoneCopy</key>
+ <map>
+ <key>Comment</key>
+ <string>Everyone can copy the newly created gesture</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>GesturesShareWithGroup</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly created gestures are shared with the currently active group</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>WearablesNextOwnerCopy</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly created clothing or body part can be copied by next owner</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>WearablesNextOwnerModify</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly created clothing or body part can be modified by next owner</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>WearablesNextOwnerTransfer</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly created clothing or body part can be resold or given away by next owner</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>WearablesEveryoneCopy</key>
+ <map>
+ <key>Comment</key>
+ <string>Everyone can copy the newly created clothing or body part</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>WearablesShareWithGroup</key>
+ <map>
+ <key>Comment</key>
+ <string>Newly created clothing or body part is shared with the currently active group</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>DefaultUploadPermissionsConverted</key>
+ <map>
+ <key>Comment</key>
+ <string>Default upload permissions have been converted to default creation permissions</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>PathfindingRetrieveNeighboringRegion</key>
<map>
<key>Comment</key>
@@ -14936,6 +15408,28 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>TeleportArrivalDelay</key>
+ <map>
+ <key>Comment</key>
+ <string>Time to wait before displaying world during teleport (seconds)</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>2</real>
+ </map>
+ <key>TeleportLocalDelay</key>
+ <map>
+ <key>Comment</key>
+ <string>Delay to prevent teleports after starting an in-sim teleport. (seconds)</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>1</real>
+ </map>
<key>FMODExProfilerEnable</key>
<map>
<key>Comment</key>
@@ -14980,7 +15474,6 @@
<key>Value</key>
<integer>0</integer>
</map>
-
<key>VersionChannelName</key>
<map>
<key>Comment</key>
@@ -14992,6 +15485,73 @@
<key>Value</key>
<string />
</map>
+ <key>WearFolderLimit</key>
+ <map>
+ <key>Comment</key>
+ <string>Limits number of items in the folder that can be replaced/added to current outfit</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>U32</string>
+ <key>Value</key>
+ <integer>125</integer>
+ </map>
+ <key>EveryoneCopy</key>
+ <map>
+ <key>Comment</key>
+ <string>(obsolete) Everyone can copy the newly created objects</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>NextOwnerCopy</key>
+ <map>
+ <key>Comment</key>
+ <string>(obsolete) Newly created objects can be copied by next owner</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>NextOwnerModify</key>
+ <map>
+ <key>Comment</key>
+ <string>(obsolete) Newly created objects can be modified by next owner</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>NextOwnerTransfer</key>
+ <map>
+ <key>Comment</key>
+ <string>(obsolete) Newly created objects can be resold or given away by next owner</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>ShareWithGroup</key>
+ <map>
+ <key>Comment</key>
+ <string>(obsolete) Newly created objects are shared with the currently active group</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+
</map>
</llsd>
diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml
index 500151c935..fc6f1f6395 100755
--- a/indra/newview/app_settings/settings_per_account.xml
+++ b/indra/newview/app_settings/settings_per_account.xml
@@ -312,7 +312,7 @@
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
- <integer>0</integer>
+ <integer>1</integer>
</map>
<!-- End of back compatibility settings -->
</map>
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl
index a74290bfcd..2487110624 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl
@@ -40,7 +40,7 @@ mat4 getObjectSkinnedTransform();
void main()
{
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
-
+
mat4 mat = getObjectSkinnedTransform();
mat = modelview_matrix * mat;
diff --git a/indra/llcommon/timing.h b/indra/newview/app_settings/shaders/class1/interface/onetexturefilterF.glsl
index c408d4c446..f1400c9b44 100755..100644
--- a/indra/llcommon/timing.h
+++ b/indra/newview/app_settings/shaders/class1/interface/onetexturefilterF.glsl
@@ -1,10 +1,9 @@
/**
- * @file timing.h
- * @brief Cross-platform routines for doing timing.
+ * @file onetexturefilterF.glsl
*
- * $LicenseInfo:firstyear=2000&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
+ * Copyright (C) 2007, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -24,19 +23,27 @@
* $/LicenseInfo$
*/
-#ifndef LL_TIMING_H
-#define LL_TIMING_H
-
-
-#if LL_LINUX || LL_DARWIN || LL_SOLARIS
-#include <sys/time.h>
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor
#endif
+uniform sampler2D tex0;
+uniform float tolerance;
-const F32 SEC_TO_MICROSEC = 1000000.f;
-const U64 SEC_TO_MICROSEC_U64 = 1000000;
-const U32 SEC_PER_DAY = 86400;
+VARYING vec2 vary_texcoord0;
-// functionality has been moved lltimer.{cpp,h}. This file will be deprecated in the future.
-
-#endif
+void main()
+{
+ frag_color = texture2D(tex0, vary_texcoord0.xy);
+
+ if(frag_color[0] + frag_color[1] + frag_color[2] < tolerance)
+ {
+ discard;
+ }
+ else
+ {
+ frag_color[3] = 0.95f;
+ }
+}
diff --git a/indra/llcommon/reflective.cpp b/indra/newview/app_settings/shaders/class1/interface/onetexturefilterV.glsl
index 2cc0e7e1f2..a33ef7e92c 100755..100644
--- a/indra/llcommon/reflective.cpp
+++ b/indra/newview/app_settings/shaders/class1/interface/onetexturefilterV.glsl
@@ -1,12 +1,9 @@
/**
- * @file reflective.cpp
- * @author Babbage
- * @date 2006-05-15
- * @brief Implementation of LLReflective.
+ * @file onetexturefilterV.glsl
*
- * $LicenseInfo:firstyear=2006&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
+ * Copyright (C) 2007, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -25,16 +22,17 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
-#include "linden_common.h"
-#include "reflective.h"
+uniform mat4 modelview_projection_matrix;
-LLReflective::LLReflective()
-{
-}
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
-//virtual
-LLReflective::~LLReflective()
+VARYING vec2 vary_texcoord0;
+
+void main()
{
+ gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+ vary_texcoord0 = texcoord0;
}
+
diff --git a/indra/llcommon/lllog.h b/indra/newview/app_settings/shaders/class1/interface/twotexturecompareF.glsl
index 7964412e83..6eeb2596b2 100755..100644
--- a/indra/llcommon/lllog.h
+++ b/indra/newview/app_settings/shaders/class1/interface/twotexturecompareF.glsl
@@ -1,12 +1,9 @@
-/**
- * @file lllog.h
- * @author Don
- * @date 2007-11-27
- * @brief Class to log messages to syslog for streambase to process.
+/**
+ * @file twotexturecompareF.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
+ * Copyright (C) 2007, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -26,27 +23,36 @@
* $/LicenseInfo$
*/
-#ifndef LL_LLLOG_H
-#define LL_LLLOG_H
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 frag_color;
+#else
+#define frag_color gl_FragColor
+#endif
-#include <string>
+uniform sampler2D tex0;
+uniform sampler2D tex1;
+uniform sampler2D dither_tex;
+uniform float dither_scale;
+uniform float dither_scale_s;
+uniform float dither_scale_t;
-class LLLogImpl;
-class LLApp;
-class LLSD;
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
-class LL_COMMON_API LLLog
+void main()
{
-public:
- LLLog(LLApp* app);
- virtual ~LLLog();
-
- virtual void log(const std::string &message, LLSD& info);
- virtual bool useLegacyLogMessage(const std::string &message);
-
-private:
- LLLogImpl* mImpl;
-};
-
-#endif /* LL_LLLOG_H */
-
+ frag_color = abs(texture2D(tex0, vary_texcoord0.xy) - texture2D(tex1, vary_texcoord0.xy));
+
+ vec2 dither_coord;
+ dither_coord[0] = vary_texcoord0[0] * dither_scale_s;
+ dither_coord[1] = vary_texcoord0[1] * dither_scale_t;
+ vec4 dither_vec = texture(dither_tex, dither_coord.xy);
+
+ for(int i = 0; i < 3; i++)
+ {
+ if(frag_color[i] < dither_vec[i] * dither_scale)
+ {
+ frag_color[i] = 0.f;
+ }
+ }
+}
diff --git a/indra/llcommon/lloptioninterface.cpp b/indra/newview/app_settings/shaders/class1/interface/twotexturecompareV.glsl
index 23fae76dc0..67c6674f0c 100755..100644
--- a/indra/llcommon/lloptioninterface.cpp
+++ b/indra/newview/app_settings/shaders/class1/interface/twotexturecompareV.glsl
@@ -1,10 +1,9 @@
/**
- * @file lloptioninterface.cpp
- * @brief
+ * @file twotexturecompareV.glsl
*
- * $LicenseInfo:firstyear=2009&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
+ * Copyright (C) 2007, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -23,11 +22,20 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
+
+uniform mat4 modelview_projection_matrix;
-#include "lloptioninterface.h"
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+ATTRIBUTE vec2 texcoord1;
+VARYING vec2 vary_texcoord0;
+VARYING vec2 vary_texcoord1;
-LLOptionInterface::~LLOptionInterface()
+void main()
{
-
+ gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+ vary_texcoord0 = texcoord0;
+ vary_texcoord1 = texcoord1;
}
+
diff --git a/indra/newview/app_settings/toolbars.xml b/indra/newview/app_settings/toolbars.xml
index 86f9912815..d61aee9a14 100755
--- a/indra/newview/app_settings/toolbars.xml
+++ b/indra/newview/app_settings/toolbars.xml
@@ -6,7 +6,6 @@
<command name="speak"/>
<command name="destinations"/>
<command name="people"/>
- <command name="social"/>
<command name="profile"/>
<command name="move"/>
<command name="view"/>
@@ -22,5 +21,6 @@
<command name="voice"/>
<command name="minimap"/>
<command name="snapshot"/>
+ <command name="facebook"/>
</left_toolbar>
</toolbars>
diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml
index 5268498d56..9ec6428ee6 100755
--- a/indra/newview/character/avatar_lad.xml
+++ b/indra/newview/character/avatar_lad.xml
@@ -3825,7 +3825,7 @@
<volume_morph
name="BELLY"
scale="0.075 0.04 0.03"
- pos="0.07 0 -0.02"/>
+ pos="0.07 0 -0.07"/>
<volume_morph
name="PELVIS"
scale="0.075 0.04 0.03"
@@ -4269,7 +4269,7 @@
label_min="Big Pectorals"
label_max="Sunken Chest"
value_default="0"
- value_min="-1.0"
+ value_min="-0.5"
value_max="1.1"
camera_elevation=".3"
camera_distance="1.2">
@@ -4480,7 +4480,7 @@
group="1"
sex="female"
name="Breast_Physics_UpDown_Driven"
- wearable="shape"
+ wearable="physics"
edit_group="driven"
value_default="0"
value_min="-3"
@@ -4502,7 +4502,7 @@
group="1"
sex="female"
name="Breast_Physics_InOut_Driven"
- wearable="shape"
+ wearable="physics"
edit_group="driven"
value_default="0"
value_min="-1.25"
@@ -4524,7 +4524,6 @@
group="1"
name="Belly_Physics_Torso_UpDown_Driven"
wearable="physics"
- cross_wearable="true"
edit_group="driven"
value_default="0"
value_min="-1"
@@ -4542,7 +4541,6 @@
group="1"
name="Breast_Physics_LeftRight_Driven"
wearable="physics"
- cross_wearable="true"
edit_group="driven"
value_default="0"
value_min="-2"
@@ -7716,7 +7714,7 @@ render_pass="bump">
<param
id="868"
- group="0"
+ group="3"
wearable="shirt"
edit_group="shirt"
edit_group_order="8"
@@ -8839,7 +8837,7 @@ render_pass="bump">
<param
id="869"
- group="0"
+ group="3"
wearable="pants"
edit_group="pants"
edit_group_order="6"
@@ -9760,7 +9758,7 @@ render_pass="bump">
<param
id="163"
- group="0"
+ group="3"
wearable="skin"
edit_group="skin_facedetail"
edit_group_order="3"
@@ -11819,7 +11817,7 @@ render_pass="bump">
<param
id="877"
- group="0"
+ group="3"
name="Jacket Wrinkles"
label="Jacket Wrinkles"
wearable="jacket"
diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt
index a2d68eb550..628a96e988 100755
--- a/indra/newview/featuretable_mac.txt
+++ b/indra/newview/featuretable_mac.txt
@@ -1,4 +1,4 @@
-version 36
+version 37
// The version number above should be implemented IF AND ONLY IF some
// change has been made that is sufficiently important to justify
// resetting the graphics preferences of all users to the recommended
@@ -60,7 +60,7 @@ WindLightUseAtmosShaders 1 1
WLSkyDetail 1 128
Disregard128DefaultDrawDistance 1 1
Disregard96DefaultDrawDistance 1 1
-RenderTextureMemoryMultiple 1 0.5
+RenderTextureMemoryMultiple 1 1
RenderCompressTextures 1 1
RenderShaderLightingMaxLevel 1 3
RenderDeferred 1 1
@@ -522,7 +522,7 @@ list ATI_Mobility_Radeon_9600
Disregard96DefaultDrawDistance 1 0
list NVIDIA_GeForce_8600
-RenderTextureMemoryMultiple 1 0.375
+RenderTextureMemoryMultiple 1 1
RenderUseImpostors 0 0
UseOcclusion 0 0
diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt
index 8efc4ee87d..badbe486b9 100755
--- a/indra/newview/gpu_table.txt
+++ b/indra/newview/gpu_table.txt
@@ -327,7 +327,8 @@ Intel HD Graphics 4600 .*Intel.*HD Graphics 46.* 3 1 0 4.2
Intel HD Graphics 4000 .*Intel.*HD Graphics 4.* 3 1 1 4.2
Intel Intel Iris Pro Graphics 5200 .*Intel.*Iris Pro Graphics 52.* 4 1 0 4
Intel Intel Iris Graphics 5100 .*Intel.*Iris Graphics 51.* 4 1 0 4
-Intel Intel Iris OpenGL Engine .*Intel.*Iris (Pro )*OpenGL.* 4 1 0 4
+Intel Intel Iris OpenGL Engine .*Intel.*Iris OpenGL.* 4 1 0 4
+Intel Intel Iris Pro OpenGL Engine .*Intel.*Iris Pro OpenGL.* 5 1 0 4
Intel HD Graphics 5000 .*Intel.*HD Graphics 5.* 4 1 0 4
Intel HD Graphics .*Intel.*HD Graphics.* 2 1 1 4
Intel Mobile 4 Series .*Intel.*Mobile.* 4 Series.* 0 1 1 2.1
diff --git a/indra/newview/icons/beta/secondlife_128.png b/indra/newview/icons/beta/secondlife_128.png
index fa42aa764b..af5ae63335 100755
--- a/indra/newview/icons/beta/secondlife_128.png
+++ b/indra/newview/icons/beta/secondlife_128.png
Binary files differ
diff --git a/indra/newview/icons/beta/secondlife_16.png b/indra/newview/icons/beta/secondlife_16.png
index ff648cf3fc..9e6305d98f 100755
--- a/indra/newview/icons/beta/secondlife_16.png
+++ b/indra/newview/icons/beta/secondlife_16.png
Binary files differ
diff --git a/indra/newview/icons/beta/secondlife_256.png b/indra/newview/icons/beta/secondlife_256.png
index 245e2c3e9f..b0814fc180 100755
--- a/indra/newview/icons/beta/secondlife_256.png
+++ b/indra/newview/icons/beta/secondlife_256.png
Binary files differ
diff --git a/indra/newview/icons/beta/secondlife_32.png b/indra/newview/icons/beta/secondlife_32.png
index fd7f46bf4d..a00b3cf53c 100755
--- a/indra/newview/icons/beta/secondlife_32.png
+++ b/indra/newview/icons/beta/secondlife_32.png
Binary files differ
diff --git a/indra/newview/icons/beta/secondlife_48.png b/indra/newview/icons/beta/secondlife_48.png
index cc3a795e2b..551587b1cd 100755
--- a/indra/newview/icons/beta/secondlife_48.png
+++ b/indra/newview/icons/beta/secondlife_48.png
Binary files differ
diff --git a/indra/newview/icons/beta/secondlife_512.png b/indra/newview/icons/beta/secondlife_512.png
index a959bd9a9e..99226de74e 100755
--- a/indra/newview/icons/beta/secondlife_512.png
+++ b/indra/newview/icons/beta/secondlife_512.png
Binary files differ
diff --git a/indra/newview/icons/project/secondlife_128.png b/indra/newview/icons/project/secondlife_128.png
index d67b8228f9..b1b4997306 100755
--- a/indra/newview/icons/project/secondlife_128.png
+++ b/indra/newview/icons/project/secondlife_128.png
Binary files differ
diff --git a/indra/newview/icons/project/secondlife_16.png b/indra/newview/icons/project/secondlife_16.png
index 91493a033c..7d3d74b534 100755
--- a/indra/newview/icons/project/secondlife_16.png
+++ b/indra/newview/icons/project/secondlife_16.png
Binary files differ
diff --git a/indra/newview/icons/project/secondlife_256.png b/indra/newview/icons/project/secondlife_256.png
index cccfaf7cba..88ad959275 100755
--- a/indra/newview/icons/project/secondlife_256.png
+++ b/indra/newview/icons/project/secondlife_256.png
Binary files differ
diff --git a/indra/newview/icons/project/secondlife_32.png b/indra/newview/icons/project/secondlife_32.png
index ad7b33f789..e55f75e1dd 100755
--- a/indra/newview/icons/project/secondlife_32.png
+++ b/indra/newview/icons/project/secondlife_32.png
Binary files differ
diff --git a/indra/newview/icons/project/secondlife_48.png b/indra/newview/icons/project/secondlife_48.png
index 104a931fbc..c29703e164 100755
--- a/indra/newview/icons/project/secondlife_48.png
+++ b/indra/newview/icons/project/secondlife_48.png
Binary files differ
diff --git a/indra/newview/icons/project/secondlife_512.png b/indra/newview/icons/project/secondlife_512.png
index 74e2fa9bc6..4fa3474d70 100755
--- a/indra/newview/icons/project/secondlife_512.png
+++ b/indra/newview/icons/project/secondlife_512.png
Binary files differ
diff --git a/indra/newview/icons/release/secondlife_128.png b/indra/newview/icons/release/secondlife_128.png
index bcf94dcae8..4c9544f498 100755
--- a/indra/newview/icons/release/secondlife_128.png
+++ b/indra/newview/icons/release/secondlife_128.png
Binary files differ
diff --git a/indra/newview/icons/release/secondlife_16.png b/indra/newview/icons/release/secondlife_16.png
index 90311ea8b0..bb3168b8be 100755
--- a/indra/newview/icons/release/secondlife_16.png
+++ b/indra/newview/icons/release/secondlife_16.png
Binary files differ
diff --git a/indra/newview/icons/release/secondlife_256.png b/indra/newview/icons/release/secondlife_256.png
index a89fb4c74f..bece338a90 100755
--- a/indra/newview/icons/release/secondlife_256.png
+++ b/indra/newview/icons/release/secondlife_256.png
Binary files differ
diff --git a/indra/newview/icons/release/secondlife_32.png b/indra/newview/icons/release/secondlife_32.png
index 530e8fc80c..736359c147 100755
--- a/indra/newview/icons/release/secondlife_32.png
+++ b/indra/newview/icons/release/secondlife_32.png
Binary files differ
diff --git a/indra/newview/icons/release/secondlife_48.png b/indra/newview/icons/release/secondlife_48.png
index cb33c51f8a..07d39ae585 100755
--- a/indra/newview/icons/release/secondlife_48.png
+++ b/indra/newview/icons/release/secondlife_48.png
Binary files differ
diff --git a/indra/newview/icons/release/secondlife_512.png b/indra/newview/icons/release/secondlife_512.png
index f291e60586..53d1643f45 100755
--- a/indra/newview/icons/release/secondlife_512.png
+++ b/indra/newview/icons/release/secondlife_512.png
Binary files differ
diff --git a/indra/newview/icons/test/secondlife_128.png b/indra/newview/icons/test/secondlife_128.png
index 019f65db28..486772b6d3 100755
--- a/indra/newview/icons/test/secondlife_128.png
+++ b/indra/newview/icons/test/secondlife_128.png
Binary files differ
diff --git a/indra/newview/icons/test/secondlife_16.png b/indra/newview/icons/test/secondlife_16.png
index 91493a033c..7d3d74b534 100755
--- a/indra/newview/icons/test/secondlife_16.png
+++ b/indra/newview/icons/test/secondlife_16.png
Binary files differ
diff --git a/indra/newview/icons/test/secondlife_256.png b/indra/newview/icons/test/secondlife_256.png
index f402424c51..56c781788d 100755
--- a/indra/newview/icons/test/secondlife_256.png
+++ b/indra/newview/icons/test/secondlife_256.png
Binary files differ
diff --git a/indra/newview/icons/test/secondlife_32.png b/indra/newview/icons/test/secondlife_32.png
index 80d6efe13d..476029db61 100755
--- a/indra/newview/icons/test/secondlife_32.png
+++ b/indra/newview/icons/test/secondlife_32.png
Binary files differ
diff --git a/indra/newview/icons/test/secondlife_48.png b/indra/newview/icons/test/secondlife_48.png
index bba938feba..d7de7849f9 100755
--- a/indra/newview/icons/test/secondlife_48.png
+++ b/indra/newview/icons/test/secondlife_48.png
Binary files differ
diff --git a/indra/newview/icons/test/secondlife_512.png b/indra/newview/icons/test/secondlife_512.png
index 10ff65312b..a4b1e4974c 100755
--- a/indra/newview/icons/test/secondlife_512.png
+++ b/indra/newview/icons/test/secondlife_512.png
Binary files differ
diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi
index c4f503ef4e..65581a6781 100755
--- a/indra/newview/installers/windows/installer_template.nsi
+++ b/indra/newview/installers/windows/installer_template.nsi
@@ -106,6 +106,7 @@ Var COMMANDLINE ; command line passed to this installer, set in .onInit
Var SHORTCUT_LANG_PARAM ; "--set InstallLanguage de", passes language to viewer
Var SKIP_DIALOGS ; set from command line in .onInit. autoinstall
; GUI and the defaults.
+Var SKIP_AUTORUN ; skip automatic launch of viewer after install
Var DO_UNINSTALL_V2 ; If non-null, path to a previous Viewer 2 installation that will be uninstalled.
;;; Function definitions should go before file includes, because calls to
@@ -116,30 +117,18 @@ Var DO_UNINSTALL_V2 ; If non-null, path to a previous Viewer 2 installation
!include "FileFunc.nsh" ; For GetParameters, GetOptions
!insertmacro GetParameters
!insertmacro GetOptions
+!include WinVer.nsh ; For OS and SP detection
+!include x64.nsh ; For 64bit OS detection
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; After install completes, launch app
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function .onInstSuccess
+Call CheckWindowsServPack ; Warn if not on the latest SP before asking to launch.
Push $R0 # Option value, unused
-
- StrCmp $SKIP_DIALOGS "true" label_launch
-
- ${GetOptions} $COMMANDLINE "/AUTOSTART" $R0
- # If parameter was there (no error) just launch
- # Otherwise ask
- IfErrors label_ask_launch label_launch
-
-label_ask_launch:
- # Don't launch by default when silent
- IfSilent label_no_launch
- MessageBox MB_YESNO $(InstSuccesssQuestion) \
- IDYES label_launch IDNO label_no_launch
-
-label_launch:
+ StrCmp $SKIP_AUTORUN "true" +2;
# Assumes SetOutPath $INSTDIR
Exec '"$INSTDIR\$INSTEXE" $SHORTCUT_LANG_PARAM'
-label_no_launch:
Pop $R0
FunctionEnd
@@ -152,26 +141,67 @@ Function dirPre
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; Make sure we're not on Windows 98 / ME
+; Make sure this computer meets the minimum system requirements.
+; Currently: Windows 32bit XP SP3, 64bit XP SP2 and Server 2003 SP2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function CheckWindowsVersion
- DetailPrint "Checking Windows version..."
- Call GetWindowsVersion
- Pop $R0
- ; Just get first two characters, ignore 4.0 part of "NT 4.0"
- StrCpy $R0 $R0 2
- ; Blacklist certain OS versions
- StrCmp $R0 "95" win_ver_bad
- StrCmp $R0 "98" win_ver_bad
- StrCmp $R0 "ME" win_ver_bad
- StrCmp $R0 "NT" win_ver_bad
- Return
-win_ver_bad:
- StrCmp $SKIP_DIALOGS "true" +2 ; If skip_dialogs is set just install
- MessageBox MB_YESNO $(CheckWindowsVersionMB) IDNO win_ver_abort
- Return
-win_ver_abort:
- Quit
+ ${If} ${AtMostWin2000}
+ MessageBox MB_OK $(CheckWindowsVersionMB)
+ Quit
+ ${EndIf}
+
+ ${If} ${IsWinXP}
+ ${AndIfNot} ${RunningX64}
+ ${AndIfNot} ${IsServicePack} 3
+ MessageBox MB_OK $(CheckWindowsVersionMB)
+ Quit
+ ${EndIf}
+
+ ${If} ${IsWinXP}
+ ${AndIf} ${RunningX64}
+ ${AndIfNot} ${IsServicePack} 2
+ MessageBox MB_OK $(CheckWindowsVersionMB)
+ Quit
+ ${EndIf}
+
+ ${If} ${IsWin2003}
+ ${AndIfNot} ${IsServicePack} 2
+ MessageBox MB_OK $(CheckWindowsVersionMB)
+ Quit
+ ${EndIf}
+FunctionEnd
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;Recommend Upgrading Service Pack
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+Function CheckWindowsServPack
+ ${If} ${IsWinVista}
+ ${AndIfNot} ${IsServicePack} 2
+ MessageBox MB_OK $(CheckWindowsServPackMB)
+ DetailPrint $(UseLatestServPackDP)
+ Return
+ ${EndIf}
+
+ ${If} ${IsWin2008}
+ ${AndIfNot} ${IsServicePack} 2
+ MessageBox MB_OK $(CheckWindowsServPackMB)
+ DetailPrint $(UseLatestServPackDP)
+ Return
+ ${EndIf}
+
+ ${If} ${IsWin7}
+ ${AndIfNot} ${IsServicePack} 1
+ MessageBox MB_OK $(CheckWindowsServPackMB)
+ DetailPrint $(UseLatestServPackDP)
+ Return
+ ${EndIf}
+
+ ${If} ${IsWin2008R2}
+ ${AndIfNot} ${IsServicePack} 1
+ MessageBox MB_OK $(CheckWindowsServPackMB)
+ DetailPrint $(UseLatestServPackDP)
+ Return
+ ${EndIf}
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -222,17 +252,13 @@ FunctionEnd
; Checks for CPU valid (must have SSE2 support)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function CheckCPUFlags
- Call GetWindowsVersion
- Pop $R0
- StrCmp $R0 "2000" OK_SSE ; sse check not available on win2k.
-
Push $1
System::Call 'kernel32::IsProcessorFeaturePresent(i) i(10) .r1'
- IntCmp $1 1 OK_SSE
- MessageBox MB_OKCANCEL $(MissingSSE2) /SD IDOK IDOK OK_SSE
+ IntCmp $1 1 OK_SSE2
+ MessageBox MB_OKCANCEL $(MissingSSE2) /SD IDOK IDOK OK_SSE2
Quit
- OK_SSE:
+ OK_SSE2:
Pop $1
Return
FunctionEnd
@@ -768,103 +794,13 @@ Call un.ProgramFiles
SectionEnd ; end of uninstall section
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; (From the NSIS documentation, JC)
-; GetWindowsVersion
-;
-; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/
-; Updated by Joost Verburg
-;
-; Returns on top of stack
-;
-; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003)
-; or
-; '' (Unknown Windows Version)
-;
-; Usage:
-; Call GetWindowsVersion
-; Pop $R0
-; ; at this point $R0 is "NT 4.0" or whatnot
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-Function GetWindowsVersion
-
- Push $R0
- Push $R1
-
- ReadRegStr $R0 HKLM \
- "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
-
- IfErrors 0 lbl_winnt
-
- ; we are not NT
- ReadRegStr $R0 HKLM \
- "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
-
- StrCpy $R1 $R0 1
- StrCmp $R1 '4' 0 lbl_error
-
- StrCpy $R1 $R0 3
-
- StrCmp $R1 '4.0' lbl_win32_95
- StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98
-
- lbl_win32_95:
- StrCpy $R0 '95'
- Goto lbl_done
-
- lbl_win32_98:
- StrCpy $R0 '98'
- Goto lbl_done
-
- lbl_win32_ME:
- StrCpy $R0 'ME'
- Goto lbl_done
-
- lbl_winnt:
-
- StrCpy $R1 $R0 1
-
- StrCmp $R1 '3' lbl_winnt_x
- StrCmp $R1 '4' lbl_winnt_x
-
- StrCpy $R1 $R0 3
-
- StrCmp $R1 '5.0' lbl_winnt_2000
- StrCmp $R1 '5.1' lbl_winnt_XP
- StrCmp $R1 '5.2' lbl_winnt_2003 lbl_error
-
- lbl_winnt_x:
- StrCpy $R0 "NT $R0" 6
- Goto lbl_done
-
- lbl_winnt_2000:
- Strcpy $R0 '2000'
- Goto lbl_done
-
- lbl_winnt_XP:
- Strcpy $R0 'XP'
- Goto lbl_done
-
- lbl_winnt_2003:
- Strcpy $R0 '2003'
- Goto lbl_done
-
- lbl_error:
- Strcpy $R0 ''
- lbl_done:
-
- Pop $R1
- Exch $R0
-
-FunctionEnd
-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Note: to add new languages, add a language file include to the list
;; at the top of this file, add an entry to the menu and then add an
;; entry to the language ID selector below
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function .onInit
+Call CheckWindowsVersion ; Don't install On unsupported systems
Push $0
${GetParameters} $COMMANDLINE ; get our command line
@@ -872,7 +808,12 @@ Function .onInit
IfErrors +2 0 ; If error jump past setting SKIP_DIALOGS
StrCpy $SKIP_DIALOGS "true"
+ ${GetOptions} $COMMANDLINE "/SKIP_AUTORUN" $0
+ IfErrors +2 0 ; If error jump past setting SKIP_AUTORUN
+ StrCpy $SKIP_AUTORUN "true"
+
${GetOptions} $COMMANDLINE "/LANGID=" $0 ; /LANGID=1033 implies US English
+
; If no language (error), then proceed
IfErrors lbl_configure_default_lang
; No error means we got a language, so use it
@@ -933,13 +874,12 @@ StrCpy $INSTPROG "${INSTNAME}"
StrCpy $INSTEXE "${INSTEXE}"
StrCpy $INSTSHORTCUT "${SHORTCUT}"
-Call CheckWindowsVersion ; warn if on Windows 98/ME
-Call CheckCPUFlags ; Make sure we have SSE2 support
+Call CheckCPUFlags ; Make sure we have SSE2 support
Call CheckIfAdministrator ; Make sure the user can install/uninstall
Call CheckIfAlreadyCurrent ; Make sure that we haven't already installed this version
Call CloseSecondLife ; Make sure we're not running
Call CheckNetworkConnection ; ping secondlife.com
-Call CheckWillUninstallV2 ; See if a V2 install exists and will be removed.
+Call CheckWillUninstallV2 ; See if a V2 install exists and will be removed.
Call CheckOldExeName ; Clean up a previous version of the exe
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/indra/newview/installers/windows/lang_da.nsi b/indra/newview/installers/windows/lang_da.nsi
index 0c832e8ba9..2352649b4b 100755
--- a/indra/newview/installers/windows/lang_da.nsi
+++ b/indra/newview/installers/windows/lang_da.nsi
Binary files differ
diff --git a/indra/newview/installers/windows/lang_de.nsi b/indra/newview/installers/windows/lang_de.nsi
index b717a4d3a5..397262afe1 100755
--- a/indra/newview/installers/windows/lang_de.nsi
+++ b/indra/newview/installers/windows/lang_de.nsi
Binary files differ
diff --git a/indra/newview/installers/windows/lang_en-us.nsi b/indra/newview/installers/windows/lang_en-us.nsi
index da0d7f54d2..df0d55d9e0 100755
--- a/indra/newview/installers/windows/lang_en-us.nsi
+++ b/indra/newview/installers/windows/lang_en-us.nsi
Binary files differ
diff --git a/indra/newview/installers/windows/lang_es.nsi b/indra/newview/installers/windows/lang_es.nsi
index c6a7f38f3f..32967a0dfa 100755
--- a/indra/newview/installers/windows/lang_es.nsi
+++ b/indra/newview/installers/windows/lang_es.nsi
Binary files differ
diff --git a/indra/newview/installers/windows/lang_fr.nsi b/indra/newview/installers/windows/lang_fr.nsi
index 008c240ed7..7c75e25360 100755
--- a/indra/newview/installers/windows/lang_fr.nsi
+++ b/indra/newview/installers/windows/lang_fr.nsi
Binary files differ
diff --git a/indra/newview/installers/windows/lang_it.nsi b/indra/newview/installers/windows/lang_it.nsi
index eccd965a92..ce66b61f9f 100755
--- a/indra/newview/installers/windows/lang_it.nsi
+++ b/indra/newview/installers/windows/lang_it.nsi
Binary files differ
diff --git a/indra/newview/installers/windows/lang_ja.nsi b/indra/newview/installers/windows/lang_ja.nsi
index f564291f7d..e68830123a 100755
--- a/indra/newview/installers/windows/lang_ja.nsi
+++ b/indra/newview/installers/windows/lang_ja.nsi
Binary files differ
diff --git a/indra/newview/installers/windows/lang_pl.nsi b/indra/newview/installers/windows/lang_pl.nsi
index 191bae4755..7883819190 100755
--- a/indra/newview/installers/windows/lang_pl.nsi
+++ b/indra/newview/installers/windows/lang_pl.nsi
Binary files differ
diff --git a/indra/newview/installers/windows/lang_pt-br.nsi b/indra/newview/installers/windows/lang_pt-br.nsi
index da56a3c336..eb3fb2386c 100755
--- a/indra/newview/installers/windows/lang_pt-br.nsi
+++ b/indra/newview/installers/windows/lang_pt-br.nsi
Binary files differ
diff --git a/indra/newview/installers/windows/lang_ru.nsi b/indra/newview/installers/windows/lang_ru.nsi
index de7affe08a..3b0042fbf5 100755
--- a/indra/newview/installers/windows/lang_ru.nsi
+++ b/indra/newview/installers/windows/lang_ru.nsi
Binary files differ
diff --git a/indra/newview/installers/windows/lang_tr.nsi b/indra/newview/installers/windows/lang_tr.nsi
index 5e7e3d797b..b9be1eab08 100755
--- a/indra/newview/installers/windows/lang_tr.nsi
+++ b/indra/newview/installers/windows/lang_tr.nsi
Binary files differ
diff --git a/indra/newview/installers/windows/lang_zh.nsi b/indra/newview/installers/windows/lang_zh.nsi
index ecf1185fbb..3c6f6fd289 100755
--- a/indra/newview/installers/windows/lang_zh.nsi
+++ b/indra/newview/installers/windows/lang_zh.nsi
Binary files differ
diff --git a/indra/llcommon/llstack.h b/indra/newview/llaccountingcost.h
index 315de6ba2d..bc770fe1d2 100755
--- a/indra/llcommon/llstack.h
+++ b/indra/newview/llaccountingcost.h
@@ -1,10 +1,10 @@
/**
- * @file llstack.h
- * @brief LLStack template class
+ * @file llaccountingcost.h
+ * @
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
+ * Copyright (C) 2011, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -24,25 +24,32 @@
* $/LicenseInfo$
*/
-#ifndef LL_LLSTACK_H
-#define LL_LLSTACK_H
+#ifndef LL_ACCOUNTINGQUOTA_H
+#define LL_ACCOUNTINGQUOTA_H
-#include "linked_lists.h"
-
-template <class DATA_TYPE> class LLStack
+//SelectionQuota atm does not require a id
+struct SelectionCost
{
-private:
- LLLinkedList<DATA_TYPE> mStack;
-
-public:
- LLStack() {}
- ~LLStack() {}
-
- void push(DATA_TYPE *data) { mStack.addData(data); }
- DATA_TYPE *pop() { DATA_TYPE *tempp = mStack.getFirstData(); mStack.removeCurrentData(); return tempp; }
- void deleteAllData() { mStack.deleteAllData(); }
- void removeAllNodes() { mStack.removeAllNodes(); }
+ SelectionCost( /*LLTransactionID transactionId, */ F32 physicsCost, F32 networkCost, F32 simulationCost )
+ //: mTransactionId( transactionId)
+ : mPhysicsCost( physicsCost )
+ , mNetworkCost( networkCost )
+ , mSimulationCost( simulationCost )
+ {
+ }
+ SelectionCost()
+ : mPhysicsCost( 0.0f )
+ , mNetworkCost( 0.0f )
+ , mSimulationCost( 0.0f )
+ {}
+
+ F32 mPhysicsCost, mNetworkCost, mSimulationCost;
+ //LLTransactionID mTransactionId;
};
+typedef enum { Roots = 0 , Prims } eSelectionType;
+
#endif
+
+
diff --git a/indra/newview/llaccountingcostmanager.cpp b/indra/newview/llaccountingcostmanager.cpp
index 7662a9689d..a42286a9e4 100755
--- a/indra/newview/llaccountingcostmanager.cpp
+++ b/indra/newview/llaccountingcostmanager.cpp
@@ -36,6 +36,7 @@ LLAccountingCostManager::LLAccountingCostManager()
//===============================================================================
class LLAccountingCostResponder : public LLCurl::Responder
{
+ LOG_CLASS(LLAccountingCostResponder);
public:
LLAccountingCostResponder( const LLSD& objectIDs, const LLHandle<LLAccountingCostObserver>& observer_handle )
: mObjectIDs( objectIDs ),
@@ -56,24 +57,27 @@ public:
}
}
- void errorWithContent( U32 statusNum, const std::string& reason, const LLSD& content )
+protected:
+ void httpFailure()
{
- llwarns << "Transport error [status:" << statusNum << "]: " << content <<llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
clearPendingRequests();
LLAccountingCostObserver* observer = mObserverHandle.get();
if (observer && observer->getTransactionID() == mTransactionID)
{
- observer->setErrorStatus(statusNum, reason);
+ observer->setErrorStatus(getStatus(), getReason());
}
}
- void result( const LLSD& content )
+ void httpSuccess()
{
+ const LLSD& content = getContent();
//Check for error
if ( !content.isMap() || content.has("error") )
{
- llwarns << "Error on fetched data"<< llendl;
+ failureResult(HTTP_INTERNAL_ERROR, "Error on fetched data", content);
+ return;
}
else if (content.has("selected"))
{
@@ -148,7 +152,7 @@ void LLAccountingCostManager::fetchCosts( eSelectionType selectionType,
}
else
{
- llinfos<<"Invalid selection type "<<llendl;
+ LL_INFOS()<<"Invalid selection type "<<LL_ENDL;
mObjectList.clear();
mPendingObjectQuota.clear();
return;
@@ -163,7 +167,7 @@ void LLAccountingCostManager::fetchCosts( eSelectionType selectionType,
else
{
//url was empty - warn & continue
- llwarns<<"Supplied url is empty "<<llendl;
+ LL_WARNS()<<"Supplied url is empty "<<LL_ENDL;
mObjectList.clear();
mPendingObjectQuota.clear();
}
diff --git a/indra/newview/llaccountingcostmanager.h b/indra/newview/llaccountingcostmanager.h
index 0bca1f54ef..3ade34c81d 100755
--- a/indra/newview/llaccountingcostmanager.h
+++ b/indra/newview/llaccountingcostmanager.h
@@ -38,7 +38,7 @@ public:
LLAccountingCostObserver() { mObserverHandle.bind(this); }
virtual ~LLAccountingCostObserver() {}
virtual void onWeightsUpdate(const SelectionCost& selection_cost) = 0;
- virtual void setErrorStatus(U32 status, const std::string& reason) = 0;
+ virtual void setErrorStatus(S32 status, const std::string& reason) = 0;
const LLHandle<LLAccountingCostObserver>& getObserverHandle() const { return mObserverHandle; }
const LLUUID& getTransactionID() { return mTransactionID; }
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index f150ceda67..e5a90e8a28 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -47,6 +47,7 @@
#include "llfirstuse.h"
#include "llfloatercamera.h"
#include "llfloaterimcontainer.h"
+#include "llfloaterperms.h"
#include "llfloaterreg.h"
#include "llfloatertools.h"
#include "llgroupactions.h"
@@ -406,7 +407,7 @@ LLAgent::LLAgent() :
mNextFidgetTime(0.f),
mCurrentFidget(0),
mFirstLogin(FALSE),
- mGenderChosen(FALSE),
+ mOutfitChosen(FALSE),
mVoiceConnected(false),
@@ -755,7 +756,7 @@ void LLAgent::setFlying(BOOL fly)
}
if( !was_flying )
{
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_FLY_COUNT);
+ add(LLStatViewer::FLY, 1);
}
setControlFlags(AGENT_CONTROL_FLY);
}
@@ -809,30 +810,6 @@ void LLAgent::standUp()
setControlFlags(AGENT_CONTROL_STAND_UP);
}
-
-void LLAgent::handleServerBakeRegionTransition(const LLUUID& region_id)
-{
- llinfos << "called" << llendl;
-
-
- // Old-style appearance entering a server-bake region.
- if (isAgentAvatarValid() &&
- !gAgentAvatarp->isUsingServerBakes() &&
- (mRegionp->getCentralBakeVersion()>0))
- {
- llinfos << "update requested due to region transition" << llendl;
- LLAppearanceMgr::instance().requestServerAppearanceUpdate();
- }
- // new-style appearance entering a non-bake region,
- // need to check for existence of the baking service.
- else if (isAgentAvatarValid() &&
- gAgentAvatarp->isUsingServerBakes() &&
- mRegionp->getCentralBakeVersion()==0)
- {
- gAgentAvatarp->checkForUnsupportedServerBakeAppearance();
- }
-}
-
void LLAgent::changeParcels()
{
LL_DEBUGS("AgentLocation") << "Calling ParcelChanged callbacks" << LL_ENDL;
@@ -850,13 +827,10 @@ boost::signals2::connection LLAgent::addParcelChangedCallback(parcel_changed_cal
//-----------------------------------------------------------------------------
void LLAgent::setRegion(LLViewerRegion *regionp)
{
- bool notifyRegionChange;
-
llassert(regionp);
if (mRegionp != regionp)
{
- notifyRegionChange = true;
-
+
std::string ip = regionp->getHost().getString();
LL_INFOS("AgentLocation") << "Moving agent into region: " << regionp->getName()
<< " located at " << ip << LL_ENDL;
@@ -908,10 +882,7 @@ void LLAgent::setRegion(LLViewerRegion *regionp)
// Pass new region along to metrics components that care about this level of detail.
LLAppViewer::metricsUpdateRegion(regionp->getHandle());
}
- else
- {
- notifyRegionChange = false;
- }
+
mRegionp = regionp;
// TODO - most of what follows probably should be moved into callbacks
@@ -934,24 +905,8 @@ void LLAgent::setRegion(LLViewerRegion *regionp)
LLFloaterMove::sUpdateFlyingStatus();
- // If the newly entered region is using server bakes, and our
- // current appearance is non-baked, request appearance update from
- // server.
- if (mRegionp->capabilitiesReceived())
- {
- handleServerBakeRegionTransition(mRegionp->getRegionID());
- }
- else
- {
- // Need to handle via callback after caps arrive.
- mRegionp->setCapabilitiesReceivedCallback(boost::bind(&LLAgent::handleServerBakeRegionTransition,this,_1));
- }
-
- if (notifyRegionChange)
- {
- LL_DEBUGS("AgentLocation") << "Calling RegionChanged callbacks" << LL_ENDL;
- mRegionChangedSignal();
- }
+ LL_DEBUGS("AgentLocation") << "Calling RegionChanged callbacks" << LL_ENDL;
+ mRegionChangedSignal();
}
@@ -1011,12 +966,12 @@ void LLAgent::sendMessage()
{
if (gDisconnected)
{
- llwarns << "Trying to send message when disconnected!" << llendl;
+ LL_WARNS() << "Trying to send message when disconnected!" << LL_ENDL;
return;
}
if (!mRegionp)
{
- llerrs << "No region for agent yet!" << llendl;
+ LL_ERRS() << "No region for agent yet!" << LL_ENDL;
return;
}
gMessageSystem->sendMessage(mRegionp->getHost());
@@ -1030,12 +985,12 @@ void LLAgent::sendReliableMessage()
{
if (gDisconnected)
{
- lldebugs << "Trying to send message when disconnected!" << llendl;
+ LL_DEBUGS() << "Trying to send message when disconnected!" << LL_ENDL;
return;
}
if (!mRegionp)
{
- lldebugs << "LLAgent::sendReliableMessage No region for agent yet, not sending message!" << llendl;
+ LL_DEBUGS() << "LLAgent::sendReliableMessage No region for agent yet, not sending message!" << LL_ENDL;
return;
}
gMessageSystem->sendReliable(mRegionp->getHost());
@@ -1064,7 +1019,7 @@ void LLAgent::setPositionAgent(const LLVector3 &pos_agent)
{
if (!pos_agent.isFinite())
{
- llerrs << "setPositionAgent is not a number" << llendl;
+ LL_ERRS() << "setPositionAgent is not a number" << LL_ENDL;
}
if (isAgentAvatarValid() && gAgentAvatarp->getParent())
@@ -1196,7 +1151,7 @@ void LLAgent::resetAxes(const LLVector3 &look_at)
LLVector3 cross(look_at % skyward);
if (cross.isNull())
{
- llinfos << "LLAgent::resetAxes cross-product is zero" << llendl;
+ LL_INFOS() << "LLAgent::resetAxes cross-product is zero" << LL_ENDL;
return;
}
@@ -1466,6 +1421,7 @@ void LLAgent::setDoNotDisturb(bool pIsDoNotDisturb)
{
LLDoNotDisturbNotificationStorage::getInstance()->updateNotifications();
}
+ gIMMgr->updateDNDMessageStatus();
}
//-----------------------------------------------------------------------------
@@ -1917,7 +1873,7 @@ BOOL LLAgent::needsRenderAvatar()
return FALSE;
}
- return mShowAvatar && mGenderChosen;
+ return mShowAvatar && mOutfitChosen;
}
// TRUE if we need to render your own avatar's head.
@@ -2073,7 +2029,7 @@ void LLAgent::endAnimationUpdateUI()
im_box->getDetachedConversationFloaters(conversations);
BOOST_FOREACH(LLFloater* conversation, conversations)
{
- llinfos << "skip_list.insert(session_floater): " << conversation->getTitle() << llendl;
+ LL_INFOS() << "skip_list.insert(session_floater): " << conversation->getTitle() << LL_ENDL;
skip_list.insert(conversation);
}
@@ -2336,7 +2292,7 @@ void LLAgent::setStartPosition( U32 location_id )
object = gObjectList.findObject(gAgentID);
if (! object)
{
- llinfos << "setStartPosition - Can't find agent viewerobject id " << gAgentID << llendl;
+ LL_INFOS() << "setStartPosition - Can't find agent viewerobject id " << gAgentID << LL_ENDL;
return;
}
// we've got the viewer object
@@ -2437,7 +2393,7 @@ void LLAgent::requestStopMotion( LLMotion* motion )
// if motion is not looping, it could have stopped by running out of time
// so we need to tell the server this
-// llinfos << "Sending stop for motion " << motion->getName() << llendl;
+// LL_INFOS() << "Sending stop for motion " << motion->getName() << LL_ENDL;
sendAnimationRequest( anim_state, ANIM_REQUEST_STOP );
}
@@ -2565,17 +2521,19 @@ int LLAgent::convertTextToMaturity(char text)
class LLMaturityPreferencesResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(LLMaturityPreferencesResponder);
public:
LLMaturityPreferencesResponder(LLAgent *pAgent, U8 pPreferredMaturity, U8 pPreviousMaturity);
virtual ~LLMaturityPreferencesResponder();
- virtual void result(const LLSD &pContent);
- virtual void errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& pContent);
+protected:
+ virtual void httpSuccess();
+ virtual void httpFailure();
protected:
private:
- U8 parseMaturityFromServerResponse(const LLSD &pContent);
+ U8 parseMaturityFromServerResponse(const LLSD &pContent) const;
LLAgent *mAgent;
U8 mPreferredMaturity;
@@ -2594,39 +2552,43 @@ LLMaturityPreferencesResponder::~LLMaturityPreferencesResponder()
{
}
-void LLMaturityPreferencesResponder::result(const LLSD &pContent)
+void LLMaturityPreferencesResponder::httpSuccess()
{
- U8 actualMaturity = parseMaturityFromServerResponse(pContent);
+ U8 actualMaturity = parseMaturityFromServerResponse(getContent());
if (actualMaturity != mPreferredMaturity)
{
- llwarns << "while attempting to change maturity preference from '" << LLViewerRegion::accessToString(mPreviousMaturity)
- << "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) << "', the server responded with '"
- << LLViewerRegion::accessToString(actualMaturity) << "' [value:" << static_cast<U32>(actualMaturity) << ", llsd:"
- << pContent << "]" << llendl;
+ LL_WARNS() << "while attempting to change maturity preference from '"
+ << LLViewerRegion::accessToString(mPreviousMaturity)
+ << "' to '" << LLViewerRegion::accessToString(mPreferredMaturity)
+ << "', the server responded with '"
+ << LLViewerRegion::accessToString(actualMaturity)
+ << "' [value:" << static_cast<U32>(actualMaturity)
+ << "], " << dumpResponse() << LL_ENDL;
}
mAgent->handlePreferredMaturityResult(actualMaturity);
}
-void LLMaturityPreferencesResponder::errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& pContent)
+void LLMaturityPreferencesResponder::httpFailure()
{
- llwarns << "while attempting to change maturity preference from '" << LLViewerRegion::accessToString(mPreviousMaturity)
- << "' to '" << LLViewerRegion::accessToString(mPreferredMaturity) << "', we got an error with [status:"
- << pStatus << "]: " << (pContent.isDefined() ? pContent : LLSD(pReason)) << llendl;
+ LL_WARNS() << "while attempting to change maturity preference from '"
+ << LLViewerRegion::accessToString(mPreviousMaturity)
+ << "' to '" << LLViewerRegion::accessToString(mPreferredMaturity)
+ << "', " << dumpResponse() << LL_ENDL;
mAgent->handlePreferredMaturityError();
}
-U8 LLMaturityPreferencesResponder::parseMaturityFromServerResponse(const LLSD &pContent)
+U8 LLMaturityPreferencesResponder::parseMaturityFromServerResponse(const LLSD &pContent) const
{
U8 maturity = SIM_ACCESS_MIN;
- llassert(!pContent.isUndefined());
+ llassert(pContent.isDefined());
llassert(pContent.isMap());
llassert(pContent.has("access_prefs"));
llassert(pContent.get("access_prefs").isMap());
llassert(pContent.get("access_prefs").has("max"));
llassert(pContent.get("access_prefs").get("max").isString());
- if (!pContent.isUndefined() && pContent.isMap() && pContent.has("access_prefs")
+ if (pContent.isDefined() && pContent.isMap() && pContent.has("access_prefs")
&& pContent.get("access_prefs").isMap() && pContent.get("access_prefs").has("max")
&& pContent.get("access_prefs").get("max").isString())
{
@@ -2661,8 +2623,8 @@ void LLAgent::handlePreferredMaturityResult(U8 pServerMaturity)
// server by re-sending our last known request. Cap the re-tries at 3 just to be safe.
else if (++mMaturityPreferenceNumRetries <= 3)
{
- llinfos << "Retrying attempt #" << mMaturityPreferenceNumRetries << " to set viewer preferred maturity to '"
- << LLViewerRegion::accessToString(mLastKnownRequestMaturity) << "'" << llendl;
+ LL_INFOS() << "Retrying attempt #" << mMaturityPreferenceNumRetries << " to set viewer preferred maturity to '"
+ << LLViewerRegion::accessToString(mLastKnownRequestMaturity) << "'" << LL_ENDL;
sendMaturityPreferenceToServer(mLastKnownRequestMaturity);
}
// Else, the viewer is style out of sync with the server after 3 retries, so inform the user
@@ -2689,8 +2651,8 @@ void LLAgent::handlePreferredMaturityError()
// the server, but not quite sure why we are
if (mLastKnownRequestMaturity == mLastKnownResponseMaturity)
{
- llwarns << "Got an error but maturity preference '" << LLViewerRegion::accessToString(mLastKnownRequestMaturity)
- << "' seems to be in sync with the server" << llendl;
+ LL_WARNS() << "Got an error but maturity preference '" << LLViewerRegion::accessToString(mLastKnownRequestMaturity)
+ << "' seems to be in sync with the server" << LL_ENDL;
reportPreferredMaturitySuccess();
}
// Else, the more likely case is that the last request does not match the last response,
@@ -2744,7 +2706,7 @@ void LLAgent::reportPreferredMaturityError()
{
bool tmpIsDoSendMaturityPreferenceToServer = mIsDoSendMaturityPreferenceToServer;
mIsDoSendMaturityPreferenceToServer = false;
- llinfos << "Setting viewer preferred maturity to '" << LLViewerRegion::accessToString(mLastKnownResponseMaturity) << "'" << llendl;
+ LL_INFOS() << "Setting viewer preferred maturity to '" << LLViewerRegion::accessToString(mLastKnownResponseMaturity) << "'" << LL_ENDL;
gSavedSettings.setU32("PreferredMaturity", static_cast<U32>(mLastKnownResponseMaturity));
mIsDoSendMaturityPreferenceToServer = tmpIsDoSendMaturityPreferenceToServer;
}
@@ -2772,7 +2734,7 @@ void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity)
// If we don't have a region, report it as an error
if (getRegion() == NULL)
{
- responderPtr->errorWithContent(0U, "region is not defined", LLSD());
+ responderPtr->failureResult(0U, "region is not defined", LLSD());
}
else
{
@@ -2782,7 +2744,7 @@ void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity)
// If the capability is not defined, report it as an error
if (url.empty())
{
- responderPtr->errorWithContent(0U,
+ responderPtr->failureResult(0U,
"capability 'UpdateAgentInformation' is not defined for region", LLSD());
}
else
@@ -2793,8 +2755,8 @@ void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity)
LLSD body = LLSD::emptyMap();
body["access_prefs"] = access_prefs;
- llinfos << "Sending viewer preferred maturity to '" << LLViewerRegion::accessToString(pPreferredMaturity)
- << "' via capability to: " << url << llendl;
+ LL_INFOS() << "Sending viewer preferred maturity to '" << LLViewerRegion::accessToString(pPreferredMaturity)
+ << "' via capability to: " << url << LL_ENDL;
LLSD headers;
LLHTTPClient::post(url, body, responderPtr, headers, 30.0f);
}
@@ -2869,10 +2831,10 @@ BOOL LLAgent::isInGroup(const LLUUID& group_id, BOOL ignore_god_mode /* FALSE */
if (!ignore_god_mode && isGodlike())
return true;
- S32 count = mGroups.count();
- for(S32 i = 0; i < count; ++i)
+ U32 count = mGroups.size();
+ for(U32 i = 0; i < count; ++i)
{
- if(mGroups.get(i).mID == group_id)
+ if(mGroups[i].mID == group_id)
{
return TRUE;
}
@@ -2889,12 +2851,12 @@ BOOL LLAgent::hasPowerInGroup(const LLUUID& group_id, U64 power) const
// GP_NO_POWERS can also mean no power is enough to grant an ability.
if (GP_NO_POWERS == power) return FALSE;
- S32 count = mGroups.count();
- for(S32 i = 0; i < count; ++i)
+ U32 count = mGroups.size();
+ for(U32 i = 0; i < count; ++i)
{
- if(mGroups.get(i).mID == group_id)
+ if(mGroups[i].mID == group_id)
{
- return (BOOL)((mGroups.get(i).mPowers & power) > 0);
+ return (BOOL)((mGroups[i].mPowers & power) > 0);
}
}
return FALSE;
@@ -2910,12 +2872,12 @@ U64 LLAgent::getPowerInGroup(const LLUUID& group_id) const
if (isGodlike())
return GP_ALL_POWERS;
- S32 count = mGroups.count();
- for(S32 i = 0; i < count; ++i)
+ U32 count = mGroups.size();
+ for(U32 i = 0; i < count; ++i)
{
- if(mGroups.get(i).mID == group_id)
+ if(mGroups[i].mID == group_id)
{
- return (mGroups.get(i).mPowers);
+ return (mGroups[i].mPowers);
}
}
@@ -2924,12 +2886,12 @@ U64 LLAgent::getPowerInGroup(const LLUUID& group_id) const
BOOL LLAgent::getGroupData(const LLUUID& group_id, LLGroupData& data) const
{
- S32 count = mGroups.count();
+ S32 count = mGroups.size();
for(S32 i = 0; i < count; ++i)
{
- if(mGroups.get(i).mID == group_id)
+ if(mGroups[i].mID == group_id)
{
- data = mGroups.get(i);
+ data = mGroups[i];
return TRUE;
}
}
@@ -2938,12 +2900,12 @@ BOOL LLAgent::getGroupData(const LLUUID& group_id, LLGroupData& data) const
S32 LLAgent::getGroupContribution(const LLUUID& group_id) const
{
- S32 count = mGroups.count();
+ S32 count = mGroups.size();
for(S32 i = 0; i < count; ++i)
{
- if(mGroups.get(i).mID == group_id)
+ if(mGroups[i].mID == group_id)
{
- S32 contribution = mGroups.get(i).mContribution;
+ S32 contribution = mGroups[i].mContribution;
return contribution;
}
}
@@ -2952,12 +2914,12 @@ S32 LLAgent::getGroupContribution(const LLUUID& group_id) const
BOOL LLAgent::setGroupContribution(const LLUUID& group_id, S32 contribution)
{
- S32 count = mGroups.count();
+ S32 count = mGroups.size();
for(S32 i = 0; i < count; ++i)
{
- if(mGroups.get(i).mID == group_id)
+ if(mGroups[i].mID == group_id)
{
- mGroups.get(i).mContribution = contribution;
+ mGroups[i].mContribution = contribution;
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("SetGroupContribution");
msg->nextBlock("AgentData");
@@ -2975,13 +2937,13 @@ BOOL LLAgent::setGroupContribution(const LLUUID& group_id, S32 contribution)
BOOL LLAgent::setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOOL list_in_profile)
{
- S32 count = mGroups.count();
+ S32 count = mGroups.size();
for(S32 i = 0; i < count; ++i)
{
- if(mGroups.get(i).mID == group_id)
+ if(mGroups[i].mID == group_id)
{
- mGroups.get(i).mAcceptNotices = accept_notices;
- mGroups.get(i).mListInProfile = list_in_profile;
+ mGroups[i].mAcceptNotices = accept_notices;
+ mGroups[i].mListInProfile = list_in_profile;
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("SetGroupAcceptNotices");
msg->nextBlock("AgentData");
@@ -3001,7 +2963,7 @@ BOOL LLAgent::setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOO
BOOL LLAgent::canJoinGroups() const
{
- return mGroups.count() < gMaxAgentGroups;
+ return (S32)mGroups.size() < gMaxAgentGroups;
}
LLQuaternion LLAgent::getHeadRotation()
@@ -3030,7 +2992,7 @@ LLQuaternion LLAgent::getHeadRotation()
return rot;
}
-void LLAgent::sendAnimationRequests(LLDynamicArray<LLUUID> &anim_ids, EAnimRequest request)
+void LLAgent::sendAnimationRequests(const std::vector<LLUUID> &anim_ids, EAnimRequest request)
{
if (gAgentID.isNull())
{
@@ -3045,7 +3007,7 @@ void LLAgent::sendAnimationRequests(LLDynamicArray<LLUUID> &anim_ids, EAnimReque
msg->addUUIDFast(_PREHASH_AgentID, getID());
msg->addUUIDFast(_PREHASH_SessionID, getSessionID());
- for (S32 i = 0; i < anim_ids.count(); i++)
+ for (S32 i = 0; i < anim_ids.size(); i++)
{
if (anim_ids[i].isNull())
{
@@ -3282,7 +3244,7 @@ void LLAgent::processAgentDropGroup(LLMessageSystem *msg, void **)
if (agent_id != gAgentID)
{
- llwarns << "processAgentDropGroup for agent other than me" << llendl;
+ LL_WARNS() << "processAgentDropGroup for agent other than me" << LL_ENDL;
return;
}
@@ -3292,10 +3254,10 @@ void LLAgent::processAgentDropGroup(LLMessageSystem *msg, void **)
// Remove the group if it already exists remove it and add the new data to pick up changes.
LLGroupData gd;
gd.mID = group_id;
- S32 index = gAgent.mGroups.find(gd);
- if (index != -1)
+ std::vector<LLGroupData>::iterator found_it = std::find(gAgent.mGroups.begin(), gAgent.mGroups.end(), gd);
+ if (found_it != gAgent.mGroups.end())
{
- gAgent.mGroups.remove(index);
+ gAgent.mGroups.erase(found_it);
if (gAgent.getGroupID() == group_id)
{
gAgent.mGroupID.setNull();
@@ -3313,7 +3275,7 @@ void LLAgent::processAgentDropGroup(LLMessageSystem *msg, void **)
}
else
{
- llwarns << "processAgentDropGroup, agent is not part of group " << group_id << llendl;
+ LL_WARNS() << "processAgentDropGroup, agent is not part of group " << group_id << LL_ENDL;
}
}
@@ -3330,8 +3292,7 @@ class LLAgentDropGroupViewerNode : public LLHTTPNode
!input.has("body") )
{
//what to do with badly formed message?
- response->statusUnknownError(400);
- response->result(LLSD("Invalid message parameters"));
+ response->extendedResult(HTTP_BAD_REQUEST, LLSD("Invalid message parameters"));
}
LLSD body = input["body"];
@@ -3346,7 +3307,7 @@ class LLAgentDropGroupViewerNode : public LLHTTPNode
body["AgentData"].isArray() &&
body["AgentData"][0].isMap() )
{
- llinfos << "VALID DROP GROUP" << llendl;
+ LL_INFOS() << "VALID DROP GROUP" << LL_ENDL;
//there is only one set of data in the AgentData block
LLSD agent_data = body["AgentData"][0];
@@ -3358,8 +3319,8 @@ class LLAgentDropGroupViewerNode : public LLHTTPNode
if (agent_id != gAgentID)
{
- llwarns
- << "AgentDropGroup for agent other than me" << llendl;
+ LL_WARNS()
+ << "AgentDropGroup for agent other than me" << LL_ENDL;
response->notFound();
return;
@@ -3369,10 +3330,10 @@ class LLAgentDropGroupViewerNode : public LLHTTPNode
// and add the new data to pick up changes.
LLGroupData gd;
gd.mID = group_id;
- S32 index = gAgent.mGroups.find(gd);
- if (index != -1)
+ std::vector<LLGroupData>::iterator found_it = std::find(gAgent.mGroups.begin(), gAgent.mGroups.end(), gd);
+ if (found_it != gAgent.mGroups.end())
{
- gAgent.mGroups.remove(index);
+ gAgent.mGroups.erase(found_it);
if (gAgent.getGroupID() == group_id)
{
gAgent.mGroupID.setNull();
@@ -3390,9 +3351,9 @@ class LLAgentDropGroupViewerNode : public LLHTTPNode
}
else
{
- llwarns
+ LL_WARNS()
<< "AgentDropGroup, agent is not part of group "
- << group_id << llendl;
+ << group_id << LL_ENDL;
}
response->result(LLSD());
@@ -3400,8 +3361,7 @@ class LLAgentDropGroupViewerNode : public LLHTTPNode
else
{
//what to do with badly formed message?
- response->statusUnknownError(400);
- response->result(LLSD("Invalid message parameters"));
+ response->extendedResult(HTTP_BAD_REQUEST, LLSD("Invalid message parameters"));
}
}
};
@@ -3419,13 +3379,12 @@ void LLAgent::processAgentGroupDataUpdate(LLMessageSystem *msg, void **)
if (agent_id != gAgentID)
{
- llwarns << "processAgentGroupDataUpdate for agent other than me" << llendl;
+ LL_WARNS() << "processAgentGroupDataUpdate for agent other than me" << LL_ENDL;
return;
}
S32 count = msg->getNumberOfBlocksFast(_PREHASH_GroupData);
LLGroupData group;
- S32 index = -1;
bool need_floater_update = false;
for(S32 i = 0; i < count; ++i)
{
@@ -3440,12 +3399,12 @@ void LLAgent::processAgentGroupDataUpdate(LLMessageSystem *msg, void **)
{
need_floater_update = true;
// Remove the group if it already exists remove it and add the new data to pick up changes.
- index = gAgent.mGroups.find(group);
- if (index != -1)
+ std::vector<LLGroupData>::iterator found_it = std::find(gAgent.mGroups.begin(), gAgent.mGroups.end(), group);
+ if (found_it != gAgent.mGroups.end())
{
- gAgent.mGroups.remove(index);
+ gAgent.mGroups.erase(found_it);
}
- gAgent.mGroups.put(group);
+ gAgent.mGroups.push_back(group);
}
if (need_floater_update)
{
@@ -3469,7 +3428,7 @@ class LLAgentGroupDataUpdateViewerNode : public LLHTTPNode
if (agent_id != gAgentID)
{
- llwarns << "processAgentGroupDataUpdate for agent other than me" << llendl;
+ LL_WARNS() << "processAgentGroupDataUpdate for agent other than me" << LL_ENDL;
return;
}
@@ -3484,7 +3443,6 @@ class LLAgentGroupDataUpdateViewerNode : public LLHTTPNode
{
LLGroupData group;
- S32 index = -1;
bool need_floater_update = false;
group.mID = (*iter_group)["GroupID"].asUUID();
@@ -3501,12 +3459,12 @@ class LLAgentGroupDataUpdateViewerNode : public LLHTTPNode
{
need_floater_update = true;
// Remove the group if it already exists remove it and add the new data to pick up changes.
- index = gAgent.mGroups.find(group);
- if (index != -1)
+ std::vector<LLGroupData>::iterator found_it = std::find(gAgent.mGroups.begin(), gAgent.mGroups.end(), group);
+ if (found_it != gAgent.mGroups.end())
{
- gAgent.mGroups.remove(index);
+ gAgent.mGroups.erase(found_it);
}
- gAgent.mGroups.put(group);
+ gAgent.mGroups.push_back(group);
}
if (need_floater_update)
{
@@ -3528,7 +3486,7 @@ void LLAgent::processAgentDataUpdate(LLMessageSystem *msg, void **)
if (agent_id != gAgentID)
{
- llwarns << "processAgentDataUpdate for agent other than me" << llendl;
+ LL_WARNS() << "processAgentDataUpdate for agent other than me" << LL_ENDL;
return;
}
@@ -3685,82 +3643,6 @@ void LLAgent::processControlRelease(LLMessageSystem *msg, void **)
}
*/
-//static
-void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void **user_data)
-{
- gAgentQueryManager.mNumPendingQueries--;
- if (gAgentQueryManager.mNumPendingQueries == 0)
- {
- selfStopPhase("fetch_texture_cache_entries");
- }
-
- if (!isAgentAvatarValid() || gAgentAvatarp->isDead())
- {
- llwarns << "No avatar for user in cached texture update!" << llendl;
- return;
- }
-
- if (isAgentAvatarValid() && gAgentAvatarp->isEditingAppearance())
- {
- // ignore baked textures when in customize mode
- return;
- }
-
- S32 query_id;
- mesgsys->getS32Fast(_PREHASH_AgentData, _PREHASH_SerialNum, query_id);
-
- S32 num_texture_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_WearableData);
-
-
- S32 num_results = 0;
- for (S32 texture_block = 0; texture_block < num_texture_blocks; texture_block++)
- {
- LLUUID texture_id;
- U8 texture_index;
-
- mesgsys->getUUIDFast(_PREHASH_WearableData, _PREHASH_TextureID, texture_id, texture_block);
- mesgsys->getU8Fast(_PREHASH_WearableData, _PREHASH_TextureIndex, texture_index, texture_block);
-
-
- if ((S32)texture_index < TEX_NUM_INDICES )
- {
- const LLAvatarAppearanceDictionary::TextureEntry *texture_entry = LLAvatarAppearanceDictionary::instance().getTexture((ETextureIndex)texture_index);
- if (texture_entry)
- {
- EBakedTextureIndex baked_index = texture_entry->mBakedTextureIndex;
-
- if (gAgentQueryManager.mActiveCacheQueries[baked_index] == query_id)
- {
- if (texture_id.notNull())
- {
- //llinfos << "Received cached texture " << (U32)texture_index << ": " << texture_id << llendl;
- gAgentAvatarp->setCachedBakedTexture((ETextureIndex)texture_index, texture_id);
- //gAgentAvatarp->setTETexture( LLVOAvatar::sBakedTextureIndices[texture_index], texture_id );
- gAgentQueryManager.mActiveCacheQueries[baked_index] = 0;
- num_results++;
- }
- else
- {
- // no cache of this bake. request upload.
- gAgentAvatarp->invalidateComposite(gAgentAvatarp->getLayerSet(baked_index),TRUE);
- }
- }
- }
- }
- }
- llinfos << "Received cached texture response for " << num_results << " textures." << llendl;
- gAgentAvatarp->outputRezTiming("Fetched agent wearables textures from cache. Will now load them");
-
- gAgentAvatarp->updateMeshTextures();
-
- if (gAgentQueryManager.mNumPendingQueries == 0)
- {
- // RN: not sure why composites are disabled at this point
- gAgentAvatarp->setCompositeUpdatesEnabled(TRUE);
- gAgent.sendAgentSetAppearance();
- }
-}
-
BOOL LLAgent::anyControlGrabbed() const
{
for (U32 i = 0; i < TOTAL_CONTROLS; i++)
@@ -3826,10 +3708,16 @@ bool LLAgent::teleportCore(bool is_local)
{
if ((TELEPORT_NONE != mTeleportState) && (mTeleportState != TELEPORT_PENDING))
{
- llwarns << "Attempt to teleport when already teleporting." << llendl;
+ LL_WARNS() << "Attempt to teleport when already teleporting." << LL_ENDL;
return false;
}
+ // force stand up and stop a sitting animation (if any), see MAINT-3969
+ if (isAgentAvatarValid() && gAgentAvatarp->getParent() && gAgentAvatarp->isSitting())
+ {
+ gAgentAvatarp->getOffObject();
+ }
+
#if 0
// This should not exist. It has been added, removed, added, and now removed again.
// This change needs to come from the simulator. Otherwise, the agent ends up out of
@@ -3880,7 +3768,7 @@ bool LLAgent::teleportCore(bool is_local)
gAgentCamera.resetView(FALSE);
// local logic
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TELEPORT_COUNT);
+ add(LLStatViewer::TELEPORT, 1);
if (is_local)
{
gAgent.setTeleportState( LLAgent::TELEPORT_LOCAL );
@@ -3892,6 +3780,7 @@ bool LLAgent::teleportCore(bool is_local)
//release geometry from old location
gPipeline.resetVertexBuffers();
+ LLSpatialPartition::sTeleportRequested = TRUE;
}
make_ui_sound("UISndTeleportOut");
@@ -4004,7 +3893,7 @@ void LLAgent::teleportRequest(
bool look_at_from_camera)
{
LLViewerRegion* regionp = getRegion();
- bool is_local = (region_handle == to_region_handle(getPositionGlobal()));
+ bool is_local = (region_handle == regionp->getHandle());
if(regionp && teleportCore(is_local))
{
LL_INFOS("") << "TeleportLocationRequest: '" << region_handle << "':"
@@ -4104,6 +3993,7 @@ void LLAgent::teleportCancel()
}
clearTeleportRequest();
gAgent.setTeleportState( LLAgent::TELEPORT_NONE );
+ gPipeline.resetVertexBuffers();
}
@@ -4136,7 +4026,7 @@ void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global)
else if(regionp &&
teleportCore(regionp->getHandle() == to_region_handle_global((F32)pos_global.mdV[VX], (F32)pos_global.mdV[VY])))
{
- llwarns << "Using deprecated teleportlocationrequest." << llendl;
+ LL_WARNS() << "Using deprecated teleportlocationrequest." << LL_ENDL;
// send the message
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_TeleportLocationRequest);
@@ -4170,7 +4060,12 @@ void LLAgent::teleportViaLocationLookAt(const LLVector3d& pos_global)
void LLAgent::doTeleportViaLocationLookAt(const LLVector3d& pos_global)
{
mbTeleportKeepsLookAt = true;
- gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE); // detach camera form avatar, so it keeps direction
+
+ if(!gAgentCamera.isfollowCamLocked())
+ {
+ gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE); // detach camera form avatar, so it keeps direction
+ }
+
U64 region_handle = to_region_handle(pos_global);
LLVector3 pos_local = (LLVector3)(pos_global - from_region_handle(region_handle));
teleportRequest(region_handle, pos_local, getTeleportKeepsLookAt());
@@ -4197,7 +4092,7 @@ void LLAgent::setTeleportState(ETeleportState state)
case TELEPORT_ARRIVING:
// First two position updates after a teleport tend to be weird
- LLViewerStats::getInstance()->mAgentPositionSnaps.mCountOfNextUpdatesToIgnore = 2;
+ //LLViewerStats::getInstance()->mAgentPositionSnaps.mCountOfNextUpdatesToIgnore = 2;
// Let the interested parties know we've teleported.
LLViewerParcelMgr::getInstance()->onTeleportFinished(false, getPositionGlobal());
@@ -4214,7 +4109,7 @@ void LLAgent::stopCurrentAnimations()
// avatar, propagating this change back to the server.
if (isAgentAvatarValid())
{
- LLDynamicArray<LLUUID> anim_ids;
+ std::vector<LLUUID> anim_ids;
for ( LLVOAvatar::AnimIterator anim_it =
gAgentAvatarp->mPlayingAnimations.begin();
@@ -4310,11 +4205,12 @@ void LLAgent::fidget()
void LLAgent::stopFidget()
{
- LLDynamicArray<LLUUID> anims;
- anims.put(ANIM_AGENT_STAND_1);
- anims.put(ANIM_AGENT_STAND_2);
- anims.put(ANIM_AGENT_STAND_3);
- anims.put(ANIM_AGENT_STAND_4);
+ std::vector<LLUUID> anims;
+ anims.reserve(4);
+ anims.push_back(ANIM_AGENT_STAND_1);
+ anims.push_back(ANIM_AGENT_STAND_2);
+ anims.push_back(ANIM_AGENT_STAND_3);
+ anims.push_back(ANIM_AGENT_STAND_4);
gAgent.sendAnimationRequests(anims, ANIM_REQUEST_STOP);
}
@@ -4350,192 +4246,6 @@ void LLAgent::requestLeaveGodMode()
sendReliableMessage();
}
-// For debugging, trace agent state at times appearance message are sent out.
-void LLAgent::dumpSentAppearance(const std::string& dump_prefix)
-{
- std::string outfilename = get_sequential_numbered_file_name(dump_prefix,".xml");
-
- LLAPRFile outfile;
- std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename);
- outfile.open(fullpath, LL_APR_WB );
- apr_file_t* file = outfile.getFileHandle();
- if (!file)
- {
- return;
- }
- else
- {
- LL_DEBUGS("Avatar") << "dumping sent appearance message to " << fullpath << llendl;
- }
-
- LLVisualParam* appearance_version_param = gAgentAvatarp->getVisualParam(11000);
- if (appearance_version_param)
- {
- F32 value = appearance_version_param->getWeight();
- dump_visual_param(file, appearance_version_param, value);
- }
- for (LLAvatarAppearanceDictionary::Textures::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getTextures().begin();
- iter != LLAvatarAppearanceDictionary::getInstance()->getTextures().end();
- ++iter)
- {
- const ETextureIndex index = iter->first;
- const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter->second;
- if (texture_dict->mIsBakedTexture)
- {
- LLTextureEntry* entry = gAgentAvatarp->getTE((U8) index);
- const LLUUID& uuid = entry->getID();
- apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", index, uuid.asString().c_str());
- }
- }
-}
-
-//-----------------------------------------------------------------------------
-// sendAgentSetAppearance()
-//-----------------------------------------------------------------------------
-void LLAgent::sendAgentSetAppearance()
-{
- if (gAgentQueryManager.mNumPendingQueries > 0)
- {
- return;
- }
-
- if (!isAgentAvatarValid() || (getRegion() && getRegion()->getCentralBakeVersion())) return;
-
- // At this point we have a complete appearance to send and are in a non-baking region.
- // DRANO FIXME
- //gAgentAvatarp->setIsUsingServerBakes(FALSE);
- S32 sb_count, host_count, both_count, neither_count;
- gAgentAvatarp->bakedTextureOriginCounts(sb_count, host_count, both_count, neither_count);
- if (both_count != 0 || neither_count != 0)
- {
- llwarns << "bad bake texture state " << sb_count << "," << host_count << "," << both_count << "," << neither_count << llendl;
- }
- if (sb_count != 0 && host_count == 0)
- {
- gAgentAvatarp->setIsUsingServerBakes(true);
- }
- else if (sb_count == 0 && host_count != 0)
- {
- gAgentAvatarp->setIsUsingServerBakes(false);
- }
- else if (sb_count + host_count > 0)
- {
- llwarns << "unclear baked texture state, not sending appearance" << llendl;
- return;
- }
-
-
- LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "TAT: Sent AgentSetAppearance: " << gAgentAvatarp->getBakedStatusForPrintout() << LL_ENDL;
- //dumpAvatarTEs( "sendAgentSetAppearance()" );
-
- LLMessageSystem* msg = gMessageSystem;
- msg->newMessageFast(_PREHASH_AgentSetAppearance);
- msg->nextBlockFast(_PREHASH_AgentData);
- msg->addUUIDFast(_PREHASH_AgentID, getID());
- msg->addUUIDFast(_PREHASH_SessionID, getSessionID());
-
- // correct for the collision tolerance (to make it look like the
- // agent is actually walking on the ground/object)
- // NOTE -- when we start correcting all of the other Havok geometry
- // to compensate for the COLLISION_TOLERANCE ugliness we will have
- // to tweak this number again
- const LLVector3 body_size = gAgentAvatarp->mBodySize + gAgentAvatarp->mAvatarOffset;
- msg->addVector3Fast(_PREHASH_Size, body_size);
-
- // To guard against out of order packets
- // Note: always start by sending 1. This resets the server's count. 0 on the server means "uninitialized"
- mAppearanceSerialNum++;
- msg->addU32Fast(_PREHASH_SerialNum, mAppearanceSerialNum );
-
- // is texture data current relative to wearables?
- // KLW - TAT this will probably need to check the local queue.
- BOOL textures_current = gAgentAvatarp->areTexturesCurrent();
-
- for(U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++ )
- {
- const ETextureIndex texture_index = LLAvatarAppearanceDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)baked_index);
-
- // if we're not wearing a skirt, we don't need the texture to be baked
- if (texture_index == TEX_SKIRT_BAKED && !gAgentAvatarp->isWearingWearableType(LLWearableType::WT_SKIRT))
- {
- continue;
- }
-
- // IMG_DEFAULT_AVATAR means not baked. 0 index should be ignored for baked textures
- if (!gAgentAvatarp->isTextureDefined(texture_index, 0))
- {
- LL_DEBUGS("Avatar") << "texture not current for baked " << (S32)baked_index << " local " << (S32)texture_index << llendl;
- textures_current = FALSE;
- break;
- }
- }
-
- // only update cache entries if we have all our baked textures
-
- // FIXME DRANO need additional check for not in appearance editing
- // mode, if still using local composites need to set using local
- // composites to false, and update mesh textures.
- if (textures_current)
- {
- bool enable_verbose_dumps = gSavedSettings.getBOOL("DebugAvatarAppearanceMessage");
- std::string dump_prefix = gAgentAvatarp->getFullname() + "_sent_appearance";
- if (enable_verbose_dumps)
- {
- dumpSentAppearance(dump_prefix);
- }
- LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "TAT: Sending cached texture data" << LL_ENDL;
- for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++)
- {
- BOOL generate_valid_hash = TRUE;
- if (isAgentAvatarValid() && !gAgentAvatarp->isBakedTextureFinal((LLAvatarAppearanceDefines::EBakedTextureIndex)baked_index))
- {
- generate_valid_hash = FALSE;
- LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "Not caching baked texture upload for " << (U32)baked_index << " due to being uploaded at low resolution." << LL_ENDL;
- }
-
- const LLUUID hash = gAgentWearables.computeBakedTextureHash((EBakedTextureIndex) baked_index, generate_valid_hash);
- if (hash.notNull())
- {
- ETextureIndex texture_index = LLAvatarAppearanceDictionary::bakedToLocalTextureIndex((EBakedTextureIndex) baked_index);
- msg->nextBlockFast(_PREHASH_WearableData);
- msg->addUUIDFast(_PREHASH_CacheID, hash);
- msg->addU8Fast(_PREHASH_TextureIndex, (U8)texture_index);
- }
- }
- msg->nextBlockFast(_PREHASH_ObjectData);
- gAgentAvatarp->sendAppearanceMessage( gMessageSystem );
- }
- else
- {
- // If the textures aren't baked, send NULL for texture IDs
- // This means the baked texture IDs on the server will be untouched.
- // Once all textures are baked, another AvatarAppearance message will be sent to update the TEs
- msg->nextBlockFast(_PREHASH_ObjectData);
- gMessageSystem->addBinaryDataFast(_PREHASH_TextureEntry, NULL, 0);
- }
-
-
- S32 transmitted_params = 0;
- for (LLViewerVisualParam* param = (LLViewerVisualParam*)gAgentAvatarp->getFirstVisualParam();
- param;
- param = (LLViewerVisualParam*)gAgentAvatarp->getNextVisualParam())
- {
- if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) // do not transmit params of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT
- {
- msg->nextBlockFast(_PREHASH_VisualParam );
-
- // We don't send the param ids. Instead, we assume that the receiver has the same params in the same sequence.
- const F32 param_value = param->getWeight();
- const U8 new_weight = F32_to_U8(param_value, param->getMinWeight(), param->getMaxWeight());
- msg->addU8Fast(_PREHASH_ParamValue, new_weight );
- transmitted_params++;
- }
- }
-
-// llinfos << "Avatar XML num VisualParams transmitted = " << transmitted_params << llendl;
- sendReliableMessage();
-}
-
void LLAgent::sendAgentDataUpdateRequest()
{
gMessageSystem->newMessageFast(_PREHASH_AgentDataUpdateRequest);
@@ -4573,8 +4283,8 @@ void LLAgent::parseTeleportMessages(const std::string& xml_filename)
if (!success || !root || !root->hasName( "teleport_messages" ))
{
- llerrs << "Problem reading teleport string XML file: "
- << xml_filename << llendl;
+ LL_ERRS() << "Problem reading teleport string XML file: "
+ << xml_filename << LL_ENDL;
return;
}
@@ -4638,11 +4348,11 @@ void LLAgent::sendAgentUpdateUserInfo(bool im_via_email, const std::string& dire
// static
void LLAgent::dumpGroupInfo()
{
- llinfos << "group " << gAgent.mGroupName << llendl;
- llinfos << "ID " << gAgent.mGroupID << llendl;
- llinfos << "powers " << gAgent.mGroupPowers << llendl;
- llinfos << "title " << gAgent.mGroupTitle << llendl;
- //llinfos << "insig " << gAgent.mGroupInsigniaID << llendl;
+ LL_INFOS() << "group " << gAgent.mGroupName << LL_ENDL;
+ LL_INFOS() << "ID " << gAgent.mGroupID << LL_ENDL;
+ LL_INFOS() << "powers " << gAgent.mGroupPowers << LL_ENDL;
+ LL_INFOS() << "title " << gAgent.mGroupTitle << LL_ENDL;
+ //LL_INFOS() << "insig " << gAgent.mGroupInsigniaID << LL_ENDL;
}
// Draw a representation of current autopilot target
@@ -4678,23 +4388,6 @@ void LLAgent::renderAutoPilotTarget()
/********************************************************************************/
-LLAgentQueryManager gAgentQueryManager;
-
-LLAgentQueryManager::LLAgentQueryManager() :
- mWearablesCacheQueryID(0),
- mNumPendingQueries(0),
- mUpdateSerialNum(0)
-{
- for (U32 i = 0; i < BAKED_NUM_INDICES; i++)
- {
- mActiveCacheQueries[i] = 0;
- }
-}
-
-LLAgentQueryManager::~LLAgentQueryManager()
-{
-}
-
//-----------------------------------------------------------------------------
// LLTeleportRequest
//-----------------------------------------------------------------------------
diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h
index 0766407494..a2e9cedd88 100755
--- a/indra/newview/llagent.h
+++ b/indra/newview/llagent.h
@@ -29,12 +29,12 @@
#include "indra_constants.h"
#include "llevent.h" // LLObservable base class
-#include "llagentconstants.h"
#include "llagentdata.h" // gAgentID, gAgentSessionID
#include "llcharacter.h"
#include "llcoordframe.h" // for mFrameAgent
#include "llavatarappearancedefines.h"
#include "llpermissionsflags.h"
+#include "v3dmath.h"
#include <boost/function.hpp>
#include <boost/shared_ptr.hpp>
@@ -161,12 +161,13 @@ public:
// Gender
//--------------------------------------------------------------------
public:
- // On the very first login, gender isn't chosen until the user clicks
- // in a dialog. We don't render the avatar until they choose.
- BOOL isGenderChosen() const { return mGenderChosen; }
- void setGenderChosen(BOOL b) { mGenderChosen = b; }
+ // On the very first login, outfit needs to be chosen by some
+ // mechanism, usually by loading the requested initial outfit. We
+ // don't render the avatar until the choice is made.
+ BOOL isOutfitChosen() const { return mOutfitChosen; }
+ void setOutfitChosen(BOOL b) { mOutfitChosen = b; }
private:
- BOOL mGenderChosen;
+ BOOL mOutfitChosen;
/** Identity
** **
@@ -247,7 +248,7 @@ private:
//--------------------------------------------------------------------
// Region
//--------------------------------------------------------------------
- public:
+public:
void setRegion(LLViewerRegion *regionp);
LLViewerRegion *getRegion() const;
LLHost getRegionHost() const;
@@ -276,7 +277,7 @@ private:
boost::signals2::connection addRegionChangedCallback(const region_changed_signal_t::slot_type& cb);
void removeRegionChangedCallback(boost::signals2::connection callback);
- private:
+private:
LLViewerRegion *mRegionp;
region_changed_signal_t mRegionChangedSignal;
@@ -290,6 +291,7 @@ public:
const LLVector3d &getLastPositionGlobal() const { return mLastPositionGlobal; }
void setLastPositionGlobal(const LLVector3d &pos) { mLastPositionGlobal = pos; }
+
private:
std::set<U64> mRegionsVisited; // Stat - what distinct regions has the avatar been to?
F64 mDistanceTraveled; // Stat - how far has the avatar moved?
@@ -468,7 +470,7 @@ public:
void stopCurrentAnimations();
void requestStopMotion(LLMotion* motion);
void onAnimStop(const LLUUID& id);
- void sendAnimationRequests(LLDynamicArray<LLUUID> &anim_ids, EAnimRequest request);
+ void sendAnimationRequests(const std::vector<LLUUID> &anim_ids, EAnimRequest request);
void sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request);
void sendAnimationStateReset();
void sendRevokePermissions(const LLUUID & target, U32 permissions);
@@ -651,7 +653,6 @@ private:
void handleTeleportFinished();
void handleTeleportFailed();
- void handleServerBakeRegionTransition(const LLUUID& region_id);
//--------------------------------------------------------------------
// Teleport State
@@ -841,7 +842,7 @@ protected:
// Only used for building titles.
BOOL isGroupMember() const { return !mGroupID.isNull(); }
public:
- LLDynamicArray<LLGroupData> mGroups;
+ std::vector<LLGroupData> mGroups;
//--------------------------------------------------------------------
// Group Title
@@ -887,8 +888,6 @@ private:
public:
void sendMessage(); // Send message to this agent's region
void sendReliableMessage();
- void dumpSentAppearance(const std::string& dump_prefix);
- void sendAgentSetAppearance();
void sendAgentDataUpdateRequest();
void sendAgentUserInfoRequest();
// IM to Email and Online visibility
@@ -902,7 +901,6 @@ public:
static void processAgentGroupDataUpdate(LLMessageSystem *msg, void **);
static void processAgentDropGroup(LLMessageSystem *msg, void **);
static void processScriptControlChange(LLMessageSystem *msg, void **);
- static void processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void **user_data);
/** Messaging
** **
@@ -931,24 +929,4 @@ inline bool operator==(const LLGroupData &a, const LLGroupData &b)
return (a.mID == b.mID);
}
-class LLAgentQueryManager
-{
- friend class LLAgent;
- friend class LLAgentWearables;
-
-public:
- LLAgentQueryManager();
- virtual ~LLAgentQueryManager();
-
- BOOL hasNoPendingQueries() const { return getNumPendingQueries() == 0; }
- S32 getNumPendingQueries() const { return mNumPendingQueries; }
-private:
- S32 mNumPendingQueries;
- S32 mWearablesCacheQueryID;
- U32 mUpdateSerialNum;
- S32 mActiveCacheQueries[LLAvatarAppearanceDefines::BAKED_NUM_INDICES];
-};
-
-extern LLAgentQueryManager gAgentQueryManager;
-
#endif
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp
index 488a134aa2..2356a84688 100755
--- a/indra/newview/llagentcamera.cpp
+++ b/indra/newview/llagentcamera.cpp
@@ -337,7 +337,7 @@ void LLAgentCamera::resetView(BOOL reset_camera, BOOL change_camera)
LLVector3 agent_at_axis = gAgent.getAtAxis();
agent_at_axis -= projected_vec(agent_at_axis, gAgent.getReferenceUpVector());
agent_at_axis.normalize();
- gAgent.resetAxes(lerp(gAgent.getAtAxis(), agent_at_axis, LLCriticalDamp::getInterpolant(0.3f)));
+ gAgent.resetAxes(lerp(gAgent.getAtAxis(), agent_at_axis, LLSmoothInterpolation::getInterpolant(0.3f)));
}
setFocusOnAvatar(TRUE, ANIMATE);
@@ -563,10 +563,10 @@ BOOL LLAgentCamera::calcCameraMinDistance(F32 &obj_min_distance)
if (mFocusObject->mDrawable.isNull())
{
#ifdef LL_RELEASE_FOR_DOWNLOAD
- llwarns << "Focus object with no drawable!" << llendl;
+ LL_WARNS() << "Focus object with no drawable!" << LL_ENDL;
#else
mFocusObject->dump();
- llerrs << "Focus object with no drawable!" << llendl;
+ LL_ERRS() << "Focus object with no drawable!" << LL_ENDL;
#endif
obj_min_distance = 0.f;
return TRUE;
@@ -913,6 +913,8 @@ void LLAgentCamera::cameraZoomIn(const F32 fraction)
F32 max_distance = llmin(mDrawDistance - DIST_FUDGE,
LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE );
+ max_distance = llmin(max_distance, current_distance * 4.f); //Scaled max relative to current distance. MAINT-3154
+
if (new_distance > max_distance)
{
new_distance = max_distance;
@@ -1070,8 +1072,8 @@ void LLAgentCamera::updateLookAt(const S32 mouse_x, const S32 mouse_y)
LLQuaternion av_inv_rot = ~gAgentAvatarp->mRoot->getWorldRotation();
LLVector3 root_at = LLVector3::x_axis * gAgentAvatarp->mRoot->getWorldRotation();
- if ((gViewerWindow->getMouseVelocityStat()->getCurrent() < 0.01f) &&
- (root_at * last_at_axis > 0.95f))
+ if (LLTrace::get_frame_recording().getLastRecording().getLastValue(*gViewerWindow->getMouseVelocityStat()) < 0.01f
+ && (root_at * last_at_axis > 0.95f))
{
LLVector3 vel = gAgentAvatarp->getVelocity();
if (vel.magVecSquared() > 4.f)
@@ -1126,13 +1128,14 @@ void LLAgentCamera::updateLookAt(const S32 mouse_x, const S32 mouse_y)
}
}
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_CAMERA("Camera");
+
//-----------------------------------------------------------------------------
// updateCamera()
//-----------------------------------------------------------------------------
void LLAgentCamera::updateCamera()
{
- static LLFastTimer::DeclareTimer ftm("Camera");
- LLFastTimer t(ftm);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_CAMERA);
// - changed camera_skyward to the new global "mCameraUpVector"
mCameraUpVector = LLVector3::z_axis;
@@ -1234,7 +1237,7 @@ void LLAgentCamera::updateCamera()
gAgentCamera.clearPanKeys();
// lerp camera focus offset
- mCameraFocusOffset = lerp(mCameraFocusOffset, mCameraFocusOffsetTarget, LLCriticalDamp::getInterpolant(CAMERA_FOCUS_HALF_LIFE));
+ mCameraFocusOffset = lerp(mCameraFocusOffset, mCameraFocusOffsetTarget, LLSmoothInterpolation::getInterpolant(CAMERA_FOCUS_HALF_LIFE));
if ( mCameraMode == CAMERA_MODE_FOLLOW )
{
@@ -1352,7 +1355,7 @@ void LLAgentCamera::updateCamera()
{
const F32 SMOOTHING_HALF_LIFE = 0.02f;
- F32 smoothing = LLCriticalDamp::getInterpolant(gSavedSettings.getF32("CameraPositionSmoothing") * SMOOTHING_HALF_LIFE, FALSE);
+ F32 smoothing = LLSmoothInterpolation::getInterpolant(gSavedSettings.getF32("CameraPositionSmoothing") * SMOOTHING_HALF_LIFE, FALSE);
if (!mFocusObject) // we differentiate on avatar mode
{
@@ -1382,9 +1385,9 @@ void LLAgentCamera::updateCamera()
}
- mCameraCurrentFOVZoomFactor = lerp(mCameraCurrentFOVZoomFactor, mCameraFOVZoomFactor, LLCriticalDamp::getInterpolant(FOV_ZOOM_HALF_LIFE));
+ mCameraCurrentFOVZoomFactor = lerp(mCameraCurrentFOVZoomFactor, mCameraFOVZoomFactor, LLSmoothInterpolation::getInterpolant(FOV_ZOOM_HALF_LIFE));
-// llinfos << "Current FOV Zoom: " << mCameraCurrentFOVZoomFactor << " Target FOV Zoom: " << mCameraFOVZoomFactor << " Object penetration: " << mFocusObjectDist << llendl;
+// LL_INFOS() << "Current FOV Zoom: " << mCameraCurrentFOVZoomFactor << " Target FOV Zoom: " << mCameraFOVZoomFactor << " Object penetration: " << mFocusObjectDist << LL_ENDL;
LLVector3 focus_agent = gAgent.getPosAgentFromGlobal(mFocusGlobal);
@@ -1688,7 +1691,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
{
if (!isAgentAvatarValid() || gAgentAvatarp->mDrawable.isNull())
{
- llwarns << "Null avatar drawable!" << llendl;
+ LL_WARNS() << "Null avatar drawable!" << LL_ENDL;
return LLVector3d::zero;
}
head_offset.clearVec();
@@ -1796,7 +1799,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
if (mTargetCameraDistance != mCurrentCameraDistance)
{
- F32 camera_lerp_amt = LLCriticalDamp::getInterpolant(CAMERA_ZOOM_HALF_LIFE);
+ F32 camera_lerp_amt = LLSmoothInterpolation::getInterpolant(CAMERA_ZOOM_HALF_LIFE);
mCurrentCameraDistance = lerp(mCurrentCameraDistance, mTargetCameraDistance, camera_lerp_amt);
}
@@ -1813,7 +1816,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
if (isAgentAvatarValid())
{
LLVector3d camera_lag_d;
- F32 lag_interp = LLCriticalDamp::getInterpolant(CAMERA_LAG_HALF_LIFE);
+ F32 lag_interp = LLSmoothInterpolation::getInterpolant(CAMERA_LAG_HALF_LIFE);
LLVector3 target_lag;
LLVector3 vel = gAgent.getVelocity();
@@ -1858,7 +1861,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
}
else
{
- mCameraLag = lerp(mCameraLag, LLVector3::zero, LLCriticalDamp::getInterpolant(0.15f));
+ mCameraLag = lerp(mCameraLag, LLVector3::zero, LLSmoothInterpolation::getInterpolant(0.15f));
}
camera_lag_d.setVec(mCameraLag);
@@ -2267,22 +2270,22 @@ void LLAgentCamera::changeCameraToCustomizeAvatar()
gFocusMgr.setKeyboardFocus( NULL );
gFocusMgr.setMouseCapture( NULL );
- // Remove any pitch or rotation from the avatar
- LLVector3 at = gAgent.getAtAxis();
- at.mV[VZ] = 0.f;
- at.normalize();
- gAgent.resetAxes(at);
+ // Remove any pitch or rotation from the avatar
+ LLVector3 at = gAgent.getAtAxis();
+ at.mV[VZ] = 0.f;
+ at.normalize();
+ gAgent.resetAxes(at);
- gAgent.sendAnimationRequest(ANIM_AGENT_CUSTOMIZE, ANIM_REQUEST_START);
- gAgent.setCustomAnim(TRUE);
- gAgentAvatarp->startMotion(ANIM_AGENT_CUSTOMIZE);
- LLMotion* turn_motion = gAgentAvatarp->findMotion(ANIM_AGENT_CUSTOMIZE);
+ gAgent.sendAnimationRequest(ANIM_AGENT_CUSTOMIZE, ANIM_REQUEST_START);
+ gAgent.setCustomAnim(TRUE);
+ gAgentAvatarp->startMotion(ANIM_AGENT_CUSTOMIZE);
+ LLMotion* turn_motion = gAgentAvatarp->findMotion(ANIM_AGENT_CUSTOMIZE);
- if (turn_motion)
- {
- // delay camera animation long enough to play through turn animation
- setAnimationDuration(turn_motion->getDuration() + CUSTOMIZE_AVATAR_CAMERA_ANIM_SLOP);
- }
+ if (turn_motion)
+ {
+ // delay camera animation long enough to play through turn animation
+ setAnimationDuration(turn_motion->getDuration() + CUSTOMIZE_AVATAR_CAMERA_ANIM_SLOP);
+ }
}
LLVector3 agent_at = gAgent.getAtAxis();
@@ -2718,6 +2721,11 @@ void LLAgentCamera::lookAtLastChat()
}
}
+bool LLAgentCamera::isfollowCamLocked()
+{
+ return mFollowCam.getPositionLocked();
+}
+
BOOL LLAgentCamera::setPointAt(EPointAtType target_type, LLViewerObject *object, LLVector3 position)
{
// disallow pointing at attachments and avatars
diff --git a/indra/newview/llagentcamera.h b/indra/newview/llagentcamera.h
index 00fa6ea189..4d0f9a80de 100755
--- a/indra/newview/llagentcamera.h
+++ b/indra/newview/llagentcamera.h
@@ -155,6 +155,7 @@ private:
//--------------------------------------------------------------------
public:
void setUsingFollowCam(bool using_follow_cam);
+ bool isfollowCamLocked();
private:
LLFollowCam mFollowCam; // Ventrella
diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp
index a4c0b056ac..7887184a11 100755
--- a/indra/newview/llagentlistener.cpp
+++ b/indra/newview/llagentlistener.cpp
@@ -193,8 +193,8 @@ void LLAgentListener::requestSit(LLSD const & event_data) const
}
else
{
- llwarns << "LLAgent requestSit could not find the sit target: "
- << event_data << llendl;
+ LL_WARNS() << "LLAgent requestSit could not find the sit target: "
+ << event_data << LL_ENDL;
}
}
@@ -276,8 +276,8 @@ void LLAgentListener::requestTouch(LLSD const & event_data) const
}
else
{
- llwarns << "LLAgent requestTouch could not find the touch target "
- << event_data["obj_uuid"].asUUID() << llendl;
+ LL_WARNS() << "LLAgent requestTouch could not find the touch target "
+ << event_data["obj_uuid"].asUUID() << LL_ENDL;
}
}
@@ -504,7 +504,7 @@ void LLAgentListener::lookAt(LLSD const & event_data) const
void LLAgentListener::getGroups(const LLSD& event) const
{
LLSD reply(LLSD::emptyArray());
- for (LLDynamicArray<LLGroupData>::const_iterator
+ for (std::vector<LLGroupData>::const_iterator
gi(mAgent.mGroups.begin()), gend(mAgent.mGroups.end());
gi != gend; ++gi)
{
diff --git a/indra/newview/llagentpicksinfo.cpp b/indra/newview/llagentpicksinfo.cpp
index 192ed141c7..799060eeab 100755
--- a/indra/newview/llagentpicksinfo.cpp
+++ b/indra/newview/llagentpicksinfo.cpp
@@ -28,9 +28,11 @@
#include "llagentpicksinfo.h"
#include "llagent.h"
-#include "llavatarconstants.h"
#include "llavatarpropertiesprocessor.h"
+const S32 MAX_AVATAR_PICKS = 10;
+
+
class LLAgentPicksInfo::LLAgentPicksObserver : public LLAvatarPropertiesObserver
{
public:
@@ -117,7 +119,7 @@ void LLAgentPicksInfo::onServerRespond(LLAvatarPicks* picks)
{
if(!picks)
{
- llerrs << "Unexpected value" << llendl;
+ LL_ERRS() << "Unexpected value" << LL_ENDL;
return;
}
diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp
index c7872fc5f6..44589f0d57 100755
--- a/indra/newview/llagentpilot.cpp
+++ b/indra/newview/llagentpilot.cpp
@@ -72,7 +72,7 @@ void LLAgentPilot::load()
}
else
{
- lldebugs << "no autopilot file found" << llendl;
+ LL_DEBUGS() << "no autopilot file found" << LL_ENDL;
return;
}
}
@@ -88,20 +88,21 @@ void LLAgentPilot::loadTxt(const std::string& filename)
if (!file)
{
- lldebugs << "Couldn't open " << filename
- << ", aborting agentpilot load!" << llendl;
+ LL_DEBUGS() << "Couldn't open " << filename
+ << ", aborting agentpilot load!" << LL_ENDL;
return;
}
else
{
- llinfos << "Opening pilot file " << filename << llendl;
+ LL_INFOS() << "Opening pilot file " << filename << LL_ENDL;
}
- mActions.reset();
+ mActions.clear();
S32 num_actions;
file >> num_actions;
+ mActions.reserve(num_actions);
for (S32 i = 0; i < num_actions; i++)
{
S32 action_type;
@@ -109,7 +110,7 @@ void LLAgentPilot::loadTxt(const std::string& filename)
file >> new_action.mTime >> action_type;
file >> new_action.mTarget.mdV[VX] >> new_action.mTarget.mdV[VY] >> new_action.mTarget.mdV[VZ];
new_action.mType = (EActionType)action_type;
- mActions.put(new_action);
+ mActions.push_back(new_action);
}
mOverrideCamera = false;
@@ -128,16 +129,16 @@ void LLAgentPilot::loadXML(const std::string& filename)
if (!file)
{
- lldebugs << "Couldn't open " << filename
- << ", aborting agentpilot load!" << llendl;
+ LL_DEBUGS() << "Couldn't open " << filename
+ << ", aborting agentpilot load!" << LL_ENDL;
return;
}
else
{
- llinfos << "Opening pilot file " << filename << llendl;
+ LL_INFOS() << "Opening pilot file " << filename << LL_ENDL;
}
- mActions.reset();
+ mActions.clear();
LLSD record;
while (!file.eof() && LLSDParser::PARSE_FAILURE != LLSDSerialize::fromXML(record, file))
{
@@ -150,7 +151,7 @@ void LLAgentPilot::loadXML(const std::string& filename)
action.mCameraXAxis = ll_vector3_from_sd(record["camera_xaxis"]);
action.mCameraYAxis = ll_vector3_from_sd(record["camera_yaxis"]);
action.mCameraZAxis = ll_vector3_from_sd(record["camera_zaxis"]);
- mActions.put(action);
+ mActions.push_back(action);
}
mOverrideCamera = true;
file.close();
@@ -171,13 +172,13 @@ void LLAgentPilot::saveTxt(const std::string& filename)
if (!file)
{
- llinfos << "Couldn't open " << filename << ", aborting agentpilot save!" << llendl;
+ LL_INFOS() << "Couldn't open " << filename << ", aborting agentpilot save!" << LL_ENDL;
}
- file << mActions.count() << '\n';
+ file << mActions.size() << '\n';
S32 i;
- for (i = 0; i < mActions.count(); i++)
+ for (i = 0; i < mActions.size(); i++)
{
file << mActions[i].mTime << "\t" << mActions[i].mType << "\t";
file << std::setprecision(32) << mActions[i].mTarget.mdV[VX] << "\t" << mActions[i].mTarget.mdV[VY] << "\t" << mActions[i].mTarget.mdV[VZ];
@@ -194,11 +195,11 @@ void LLAgentPilot::saveXML(const std::string& filename)
if (!file)
{
- llinfos << "Couldn't open " << filename << ", aborting agentpilot save!" << llendl;
+ LL_INFOS() << "Couldn't open " << filename << ", aborting agentpilot save!" << LL_ENDL;
}
S32 i;
- for (i = 0; i < mActions.count(); i++)
+ for (i = 0; i < mActions.size(); i++)
{
Action& action = mActions[i];
LLSD record;
@@ -217,7 +218,7 @@ void LLAgentPilot::saveXML(const std::string& filename)
void LLAgentPilot::startRecord()
{
- mActions.reset();
+ mActions.clear();
mTimer.reset();
addAction(STRAIGHT);
mRecording = TRUE;
@@ -232,7 +233,7 @@ void LLAgentPilot::stopRecord()
void LLAgentPilot::addAction(enum EActionType action_type)
{
- llinfos << "Adding waypoint: " << gAgent.getPositionGlobal() << llendl;
+ LL_INFOS() << "Adding waypoint: " << gAgent.getPositionGlobal() << LL_ENDL;
Action action;
action.mType = action_type;
action.mTarget = gAgent.getPositionGlobal();
@@ -244,7 +245,7 @@ void LLAgentPilot::addAction(enum EActionType action_type)
action.mCameraYAxis = cam->getYAxis();
action.mCameraZAxis = cam->getZAxis();
mLastRecordTime = (F32)action.mTime;
- mActions.put(action);
+ mActions.push_back(action);
}
void LLAgentPilot::startPlayback()
@@ -255,16 +256,16 @@ void LLAgentPilot::startPlayback()
mCurrentAction = 0;
mTimer.reset();
- if (mActions.count())
+ if (mActions.size())
{
- llinfos << "Starting playback, moving to waypoint 0" << llendl;
+ LL_INFOS() << "Starting playback, moving to waypoint 0" << LL_ENDL;
gAgent.startAutoPilotGlobal(mActions[0].mTarget);
moveCamera();
mStarted = FALSE;
}
else
{
- llinfos << "No autopilot data, cancelling!" << llendl;
+ LL_INFOS() << "No autopilot data, cancelling!" << LL_ENDL;
mPlaying = FALSE;
}
}
@@ -291,7 +292,7 @@ void LLAgentPilot::moveCamera()
if (!getOverrideCamera())
return;
- if (mCurrentAction<mActions.count())
+ if (mCurrentAction<mActions.size())
{
S32 start_index = llmax(mCurrentAction-1,0);
S32 end_index = mCurrentAction;
@@ -305,7 +306,7 @@ void LLAgentPilot::moveCamera()
if ((t<0.0)||(t>1.0))
{
- llwarns << "mCurrentAction is invalid, t = " << t << llendl;
+ LL_WARNS() << "mCurrentAction is invalid, t = " << t << LL_ENDL;
return;
}
@@ -331,7 +332,7 @@ void LLAgentPilot::updateTarget()
{
if (mPlaying)
{
- if (mCurrentAction < mActions.count())
+ if (mCurrentAction < mActions.size())
{
if (0 == mCurrentAction)
{
@@ -344,7 +345,7 @@ void LLAgentPilot::updateTarget()
{
if (!mStarted)
{
- llinfos << "At start, beginning playback" << llendl;
+ LL_INFOS() << "At start, beginning playback" << LL_ENDL;
mTimer.reset();
mStarted = TRUE;
}
@@ -355,7 +356,7 @@ void LLAgentPilot::updateTarget()
//gAgent.stopAutoPilot();
mCurrentAction++;
- if (mCurrentAction < mActions.count())
+ if (mCurrentAction < mActions.size())
{
gAgent.startAutoPilotGlobal(mActions[mCurrentAction].mTarget);
moveCamera();
@@ -368,17 +369,17 @@ void LLAgentPilot::updateTarget()
{
if ((mNumRuns < 0) || (mNumRuns > 0))
{
- llinfos << "Looping, restarting playback" << llendl;
+ LL_INFOS() << "Looping, restarting playback" << LL_ENDL;
startPlayback();
}
else if (mQuitAfterRuns)
{
- llinfos << "Done with all runs, quitting viewer!" << llendl;
+ LL_INFOS() << "Done with all runs, quitting viewer!" << LL_ENDL;
LLAppViewer::instance()->forceQuit();
}
else
{
- llinfos << "Done with all runs, disabling pilot" << llendl;
+ LL_INFOS() << "Done with all runs, disabling pilot" << LL_ENDL;
stopPlayback();
}
}
diff --git a/indra/newview/llagentpilot.h b/indra/newview/llagentpilot.h
index dd1709ec0c..f6b6376086 100755
--- a/indra/newview/llagentpilot.h
+++ b/indra/newview/llagentpilot.h
@@ -30,7 +30,6 @@
#include "stdtypes.h"
#include "lltimer.h"
#include "v3dmath.h"
-#include "lldarray.h"
// Class that drives the agent around according to a "script".
@@ -113,7 +112,7 @@ private:
LLVector3 mCameraZAxis;
};
- LLDynamicArray<Action> mActions;
+ std::vector<Action> mActions;
LLTimer mTimer;
};
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index fa810aac76..49fedb8df8 100755
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -30,7 +30,6 @@
#include "llaccordionctrltab.h"
#include "llagent.h"
#include "llagentcamera.h"
-#include "llagentwearablesfetch.h"
#include "llappearancemgr.h"
#include "llcallbacklist.h"
#include "llfloatersidepanelcontainer.h"
@@ -39,6 +38,7 @@
#include "llinventoryfunctions.h"
#include "llinventoryobserver.h"
#include "llinventorypanel.h"
+#include "lllocaltextureobject.h"
#include "llmd5.h"
#include "llnotificationsutil.h"
#include "lloutfitobserver.h"
@@ -49,6 +49,7 @@
#include "llvoavatarself.h"
#include "llviewerwearable.h"
#include "llwearablelist.h"
+#include "llfloaterperms.h"
#include <boost/scoped_ptr.hpp>
@@ -62,15 +63,48 @@ using namespace LLAvatarAppearanceDefines;
// Callback to wear and start editing an item that has just been created.
void wear_and_edit_cb(const LLUUID& inv_item)
- {
- if (inv_item.isNull()) return;
+{
+ if (inv_item.isNull()) return;
+
+ LLViewerInventoryItem* item = gInventory.getItem(inv_item);
+ if (!item) return;
- // Request editing the item after it gets worn.
- gAgentWearables.requestEditingWearable(inv_item);
+ LLPermissions perm = item->getPermissions();
+ perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Wearables"));
+ perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Wearables"));
+ perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Wearables"));
+ item->setPermissions(perm);
+
+ item->updateServer(FALSE);
+ gInventory.updateItem(item);
+ gInventory.notifyObservers();
+
+ // Request editing the item after it gets worn.
+ gAgentWearables.requestEditingWearable(inv_item);
+
+ // Wear it.
+ LLAppearanceMgr::instance().wearItemOnAvatar(inv_item,true);
+}
- // Wear it.
- LLAppearanceMgr::instance().wearItemOnAvatar(inv_item);
+void wear_cb(const LLUUID& inv_item)
+{
+ if (!inv_item.isNull())
+ {
+ LLViewerInventoryItem* item = gInventory.getItem(inv_item);
+ if (item)
+ {
+ LLPermissions perm = item->getPermissions();
+ perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Wearables"));
+ perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Wearables"));
+ perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Wearables"));
+ item->setPermissions(perm);
+
+ item->updateServer(FALSE);
+ gInventory.updateItem(item);
+ gInventory.notifyObservers();
+ }
}
+}
///////////////////////////////////////////////////////////////////////////////
@@ -90,49 +124,42 @@ void checkWearableAgainstInventory(LLViewerWearable *wearable)
{
if (!item->isWearableType())
{
- llwarns << "wearable associated with non-wearable item" << llendl;
+ LL_WARNS() << "wearable associated with non-wearable item" << LL_ENDL;
}
if (item->getWearableType() != wearable->getType())
{
- llwarns << "type mismatch: wearable " << wearable->getName()
+ LL_WARNS() << "type mismatch: wearable " << wearable->getName()
<< " has type " << wearable->getType()
<< " but inventory item " << item->getName()
- << " has type " << item->getWearableType() << llendl;
+ << " has type " << item->getWearableType() << LL_ENDL;
}
}
else
{
- llwarns << "wearable inventory item not found" << wearable->getName()
- << " itemID " << wearable->getItemID().asString() << llendl;
+ LL_WARNS() << "wearable inventory item not found" << wearable->getName()
+ << " itemID " << wearable->getItemID().asString() << LL_ENDL;
}
}
void LLAgentWearables::dump()
{
- llinfos << "LLAgentWearablesDump" << llendl;
+ LL_INFOS() << "LLAgentWearablesDump" << LL_ENDL;
for (S32 i = 0; i < LLWearableType::WT_COUNT; i++)
{
U32 count = getWearableCount((LLWearableType::EType)i);
- llinfos << "Type: " << i << " count " << count << llendl;
+ LL_INFOS() << "Type: " << i << " count " << count << LL_ENDL;
for (U32 j=0; j<count; j++)
{
LLViewerWearable* wearable = getViewerWearable((LLWearableType::EType)i,j);
if (wearable == NULL)
{
- llinfos << " " << j << " NULL wearable" << llendl;
+ LL_INFOS() << " " << j << " NULL wearable" << LL_ENDL;
}
- llinfos << " " << j << " Name " << wearable->getName()
- << " description " << wearable->getDescription() << llendl;
+ LL_INFOS() << " " << j << " Name " << wearable->getName()
+ << " description " << wearable->getDescription() << LL_ENDL;
}
}
- llinfos << "Total items awaiting wearable update " << mItemsAwaitingWearableUpdate.size() << llendl;
- for (std::set<LLUUID>::iterator it = mItemsAwaitingWearableUpdate.begin();
- it != mItemsAwaitingWearableUpdate.end();
- ++it)
- {
- llinfos << (*it).asString() << llendl;
- }
}
struct LLAgentDumper
@@ -140,15 +167,15 @@ struct LLAgentDumper
LLAgentDumper(std::string name):
mName(name)
{
- llinfos << llendl;
- llinfos << "LLAgentDumper " << mName << llendl;
+ LL_INFOS() << LL_ENDL;
+ LL_INFOS() << "LLAgentDumper " << mName << LL_ENDL;
gAgentWearables.dump();
}
~LLAgentDumper()
{
- llinfos << llendl;
- llinfos << "~LLAgentDumper " << mName << llendl;
+ LL_INFOS() << LL_ENDL;
+ LL_INFOS() << "~LLAgentDumper " << mName << LL_ENDL;
gAgentWearables.dump();
}
@@ -180,36 +207,22 @@ void LLAgentWearables::initClass()
}
void LLAgentWearables::setAvatarObject(LLVOAvatarSelf *avatar)
-{
+{
llassert(avatar);
- avatar->outputRezTiming("Sending wearables request");
- sendAgentWearablesRequest();
setAvatarAppearance(avatar);
}
-// wearables
-LLAgentWearables::createStandardWearablesAllDoneCallback::~createStandardWearablesAllDoneCallback()
-{
- llinfos << "destructor - all done?" << llendl;
- gAgentWearables.createStandardWearablesAllDone();
-}
-
-LLAgentWearables::sendAgentWearablesUpdateCallback::~sendAgentWearablesUpdateCallback()
-{
- gAgentWearables.sendAgentWearablesUpdate();
-}
-
/**
* @brief Construct a callback for dealing with the wearables.
*
* Would like to pass the agent in here, but we can't safely
* count on it being around later. Just use gAgent directly.
- * @param cb callback to execute on completion (??? unused ???)
+ * @param cb callback to execute on completion (? unused ?)
* @param type Type for the wearable in the agent
* @param wearable The wearable data.
* @param todo Bitmask of actions to take on completion.
*/
-LLAgentWearables::addWearableToAgentInventoryCallback::addWearableToAgentInventoryCallback(
+LLAgentWearables::AddWearableToAgentInventoryCallback::AddWearableToAgentInventoryCallback(
LLPointer<LLRefCount> cb, LLWearableType::EType type, U32 index, LLViewerWearable* wearable, U32 todo, const std::string description) :
mType(type),
mIndex(index),
@@ -218,45 +231,27 @@ LLAgentWearables::addWearableToAgentInventoryCallback::addWearableToAgentInvento
mCB(cb),
mDescription(description)
{
- llinfos << "constructor" << llendl;
+ LL_INFOS() << "constructor" << LL_ENDL;
}
-void LLAgentWearables::addWearableToAgentInventoryCallback::fire(const LLUUID& inv_item)
+void LLAgentWearables::AddWearableToAgentInventoryCallback::fire(const LLUUID& inv_item)
{
- if (mTodo & CALL_CREATESTANDARDDONE)
- {
- llinfos << "callback fired, inv_item " << inv_item.asString() << llendl;
- }
-
if (inv_item.isNull())
return;
gAgentWearables.addWearabletoAgentInventoryDone(mType, mIndex, inv_item, mWearable);
- if (mTodo & CALL_UPDATE)
- {
- gAgentWearables.sendAgentWearablesUpdate();
- }
- if (mTodo & CALL_RECOVERDONE)
- {
- LLAppearanceMgr::instance().addCOFItemLink(inv_item,false);
- gAgentWearables.recoverMissingWearableDone();
- }
/*
* Do this for every one in the loop
*/
- if (mTodo & CALL_CREATESTANDARDDONE)
- {
- LLAppearanceMgr::instance().addCOFItemLink(inv_item,false);
- gAgentWearables.createStandardWearablesDone(mType, mIndex);
- }
if (mTodo & CALL_MAKENEWOUTFITDONE)
{
gAgentWearables.makeNewOutfitDone(mType, mIndex);
}
if (mTodo & CALL_WEARITEM)
{
- LLAppearanceMgr::instance().addCOFItemLink(inv_item, true, NULL, mDescription);
+ LLAppearanceMgr::instance().addCOFItemLink(inv_item,
+ new LLUpdateAppearanceAndEditWearableOnDestroy(inv_item), mDescription);
}
}
@@ -265,7 +260,7 @@ void LLAgentWearables::addWearabletoAgentInventoryDone(const LLWearableType::ETy
const LLUUID& item_id,
LLViewerWearable* wearable)
{
- llinfos << "type " << type << " index " << index << " item " << item_id.asString() << llendl;
+ LL_INFOS() << "type " << type << " index " << index << " item " << item_id.asString() << LL_ENDL;
if (item_id.isNull())
return;
@@ -303,81 +298,7 @@ void LLAgentWearables::addWearabletoAgentInventoryDone(const LLWearableType::ETy
gInventory.notifyObservers();
}
-void LLAgentWearables::sendAgentWearablesUpdate()
-{
- // First make sure that we have inventory items for each wearable
- for (S32 type=0; type < LLWearableType::WT_COUNT; ++type)
- {
- for (U32 index=0; index < getWearableCount((LLWearableType::EType)type); ++index)
- {
- LLViewerWearable* wearable = getViewerWearable((LLWearableType::EType)type,index);
- if (wearable)
- {
- if (wearable->getItemID().isNull())
- {
- LLPointer<LLInventoryCallback> cb =
- new addWearableToAgentInventoryCallback(
- LLPointer<LLRefCount>(NULL),
- (LLWearableType::EType)type,
- index,
- wearable,
- addWearableToAgentInventoryCallback::CALL_NONE);
- addWearableToAgentInventory(cb, wearable);
- }
- else
- {
- gInventory.addChangedMask(LLInventoryObserver::LABEL,
- wearable->getItemID());
- }
- }
- }
- }
-
- // Then make sure the inventory is in sync with the avatar.
- gInventory.notifyObservers();
-
- // Send the AgentIsNowWearing
- gMessageSystem->newMessageFast(_PREHASH_AgentIsNowWearing);
-
- gMessageSystem->nextBlockFast(_PREHASH_AgentData);
- gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
- gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
-
- lldebugs << "sendAgentWearablesUpdate()" << llendl;
- // MULTI-WEARABLE: DEPRECATED: HACK: index to 0- server database tables don't support concept of multiwearables.
- for (S32 type=0; type < LLWearableType::WT_COUNT; ++type)
- {
- gMessageSystem->nextBlockFast(_PREHASH_WearableData);
-
- U8 type_u8 = (U8)type;
- gMessageSystem->addU8Fast(_PREHASH_WearableType, type_u8);
-
- LLViewerWearable* wearable = getViewerWearable((LLWearableType::EType)type, 0);
- if (wearable)
- {
- //llinfos << "Sending wearable " << wearable->getName() << llendl;
- LLUUID item_id = wearable->getItemID();
- const LLViewerInventoryItem *item = gInventory.getItem(item_id);
- if (item && item->getIsLinkType())
- {
- // Get the itemID that this item points to. i.e. make sure
- // we are storing baseitems, not their links, in the database.
- item_id = item->getLinkedUUID();
- }
- gMessageSystem->addUUIDFast(_PREHASH_ItemID, item_id);
- }
- else
- {
- //llinfos << "Not wearing wearable type " << LLWearableType::getTypeName((LLWearableType::EType)i) << llendl;
- gMessageSystem->addUUIDFast(_PREHASH_ItemID, LLUUID::null);
- }
-
- lldebugs << " " << LLWearableType::getTypeLabel((LLWearableType::EType)type) << ": " << (wearable ? wearable->getAssetID() : LLUUID::null) << llendl;
- }
- gAgent.sendReliableMessage();
-}
-
-void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 index, BOOL send_update,
+void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 index,
const std::string new_name)
{
LLViewerWearable* old_wearable = getViewerWearable(type, index);
@@ -401,7 +322,7 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32
std::string item_name = item->getName();
if (name_changed)
{
- llinfos << "saveWearable changing name from " << item->getName() << " to " << new_name << llendl;
+ LL_INFOS() << "saveWearable changing name from " << item->getName() << " to " << new_name << LL_ENDL;
item_name = new_name;
}
// Update existing inventory item
@@ -418,23 +339,14 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32
item->getFlags(),
item->getCreationDate());
template_item->setTransactionID(new_wearable->getTransactionID());
- template_item->updateServer(FALSE);
- gInventory.updateItem(template_item);
- if (name_changed)
- {
- gInventory.notifyObservers();
- }
+ update_inventory_item(template_item, gAgentAvatarp->mEndCustomizeCallback);
}
else
{
// Add a new inventory item (shouldn't ever happen here)
- U32 todo = addWearableToAgentInventoryCallback::CALL_NONE;
- if (send_update)
- {
- todo |= addWearableToAgentInventoryCallback::CALL_UPDATE;
- }
+ U32 todo = AddWearableToAgentInventoryCallback::CALL_NONE;
LLPointer<LLInventoryCallback> cb =
- new addWearableToAgentInventoryCallback(
+ new AddWearableToAgentInventoryCallback(
LLPointer<LLRefCount>(NULL),
type,
index,
@@ -444,12 +356,7 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32
return;
}
- gAgentAvatarp->wearableUpdated( type, TRUE );
-
- if (send_update)
- {
- sendAgentWearablesUpdate();
- }
+ gAgentAvatarp->wearableUpdated(type);
}
}
@@ -461,20 +368,20 @@ void LLAgentWearables::saveWearableAs(const LLWearableType::EType type,
{
if (!isWearableCopyable(type, index))
{
- llwarns << "LLAgent::saveWearableAs() not copyable." << llendl;
+ LL_WARNS() << "LLAgent::saveWearableAs() not copyable." << LL_ENDL;
return;
}
LLViewerWearable* old_wearable = getViewerWearable(type, index);
if (!old_wearable)
{
- llwarns << "LLAgent::saveWearableAs() no old wearable." << llendl;
+ LL_WARNS() << "LLAgent::saveWearableAs() no old wearable." << LL_ENDL;
return;
}
LLInventoryItem* item = gInventory.getItem(getWearableItemID(type,index));
if (!item)
{
- llwarns << "LLAgent::saveWearableAs() no inventory item." << llendl;
+ LL_WARNS() << "LLAgent::saveWearableAs() no inventory item." << LL_ENDL;
return;
}
std::string trunc_name(new_name);
@@ -482,13 +389,14 @@ void LLAgentWearables::saveWearableAs(const LLWearableType::EType type,
LLViewerWearable* new_wearable = LLWearableList::instance().createCopy(
old_wearable,
trunc_name);
+
LLPointer<LLInventoryCallback> cb =
- new addWearableToAgentInventoryCallback(
+ new AddWearableToAgentInventoryCallback(
LLPointer<LLRefCount>(NULL),
type,
index,
new_wearable,
- addWearableToAgentInventoryCallback::CALL_WEARITEM,
+ AddWearableToAgentInventoryCallback::CALL_WEARITEM,
description
);
LLUUID category_id;
@@ -525,8 +433,6 @@ void LLAgentWearables::revertWearable(const LLWearableType::EType type, const U3
{
wearable->revertValues();
}
-
- gAgent.sendAgentSetAppearance();
}
void LLAgentWearables::saveAllWearables()
@@ -539,9 +445,8 @@ void LLAgentWearables::saveAllWearables()
for (S32 i=0; i < LLWearableType::WT_COUNT; i++)
{
for (U32 j=0; j < getWearableCount((LLWearableType::EType)i); j++)
- saveWearable((LLWearableType::EType)i, j, FALSE);
+ saveWearable((LLWearableType::EType)i, j);
}
- sendAgentWearablesUpdate();
}
// Called when the user changes the name of a wearable inventory item that is currently being worn.
@@ -570,7 +475,6 @@ void LLAgentWearables::setWearableName(const LLUUID& item_id, const std::string&
old_wearable->setName(old_name);
setWearable((LLWearableType::EType)i,j,new_wearable);
- sendAgentWearablesUpdate();
break;
}
}
@@ -691,22 +595,13 @@ LLViewerWearable* LLAgentWearables::getWearableFromAssetID(const LLUUID& asset_i
return NULL;
}
-void LLAgentWearables::sendAgentWearablesRequest()
-{
- gMessageSystem->newMessageFast(_PREHASH_AgentWearablesRequest);
- gMessageSystem->nextBlockFast(_PREHASH_AgentData);
- gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
- gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
- gAgent.sendReliableMessage();
-}
-
LLViewerWearable* LLAgentWearables::getViewerWearable(const LLWearableType::EType type, U32 index /*= 0*/)
{
return dynamic_cast<LLViewerWearable*> (getWearable(type, index));
}
const LLViewerWearable* LLAgentWearables::getViewerWearable(const LLWearableType::EType type, U32 index /*= 0*/) const
- {
+{
return dynamic_cast<const LLViewerWearable*> (getWearable(type, index));
}
@@ -714,49 +609,38 @@ const LLViewerWearable* LLAgentWearables::getViewerWearable(const LLWearableType
BOOL LLAgentWearables::selfHasWearable(LLWearableType::EType type)
{
return (gAgentWearables.getWearableCount(type) > 0);
- }
-
+}
+
// virtual
void LLAgentWearables::wearableUpdated(LLWearable *wearable, BOOL removed)
- {
+{
if (isAgentAvatarValid())
{
- const BOOL upload_result = removed;
- gAgentAvatarp->wearableUpdated(wearable->getType(), upload_result);
-}
+ gAgentAvatarp->wearableUpdated(wearable->getType());
+ }
LLWearableData::wearableUpdated(wearable, removed);
if (!removed)
-{
+ {
LLViewerWearable* viewer_wearable = dynamic_cast<LLViewerWearable*>(wearable);
viewer_wearable->refreshName();
- // Hack pt 2. If the wearable we just loaded has definition version 24,
- // then force a re-save of this wearable after slamming the version number to 22.
- // This number was incorrectly incremented for internal builds before release, and
- // this fix will ensure that the affected wearables are re-saved with the right version number.
- // the versions themselves are compatible. This code can be removed before release.
- if( wearable->getDefinitionVersion() == 24 )
- {
- wearable->setDefinitionVersion(22);
- U32 index = getWearableIndex(wearable);
- llinfos << "forcing wearable type " << wearable->getType() << " to version 22 from 24" << llendl;
- saveWearable(wearable->getType(),index,TRUE);
- }
+ // Hack pt 2. If the wearable we just loaded has definition version 24,
+ // then force a re-save of this wearable after slamming the version number to 22.
+ // This number was incorrectly incremented for internal builds before release, and
+ // this fix will ensure that the affected wearables are re-saved with the right version number.
+ // the versions themselves are compatible. This code can be removed before release.
+ if( wearable->getDefinitionVersion() == 24 )
+ {
+ wearable->setDefinitionVersion(22);
+ U32 index = getWearableIndex(wearable);
+ LL_INFOS() << "forcing wearable type " << wearable->getType() << " to version 22 from 24" << LL_ENDL;
+ saveWearable(wearable->getType(),index);
+ }
checkWearableAgainstInventory(viewer_wearable);
-}
-}
-
-BOOL LLAgentWearables::itemUpdatePending(const LLUUID& item_id) const
-{
- return mItemsAwaitingWearableUpdate.find(item_id) != mItemsAwaitingWearableUpdate.end();
-}
-
-U32 LLAgentWearables::itemUpdatePendingCount() const
-{
- return mItemsAwaitingWearableUpdate.size();
+ }
}
const LLUUID LLAgentWearables::getWearableItemID(LLWearableType::EType type, U32 index) const
@@ -782,163 +666,12 @@ BOOL LLAgentWearables::isWearingItem(const LLUUID& item_id) const
return getWearableFromItemID(item_id) != NULL;
}
-// MULTI-WEARABLE: DEPRECATED (see backwards compatibility)
-// static
-// ! BACKWARDS COMPATIBILITY ! When we stop supporting viewer1.23, we can assume
-// that viewers have a Current Outfit Folder and won't need this message, and thus
-// we can remove/ignore this whole function. EXCEPT gAgentWearables.notifyLoadingStarted
-void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgsys, void** user_data)
-{
- // We should only receive this message a single time. Ignore subsequent AgentWearablesUpdates
- // that may result from AgentWearablesRequest having been sent more than once.
- if (mInitialWearablesUpdateReceived)
- return;
-
- if (isAgentAvatarValid())
- {
- gAgentAvatarp->startPhase("process_initial_wearables_update");
- gAgentAvatarp->outputRezTiming("Received initial wearables update");
- }
-
- // notify subscribers that wearables started loading. See EXT-7777
- // *TODO: find more proper place to not be called from deprecated method.
- // Seems such place is found: LLInitialWearablesFetch::processContents()
- gAgentWearables.notifyLoadingStarted();
-
- mInitialWearablesUpdateReceived = true;
-
- LLUUID agent_id;
- gMessageSystem->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id);
-
- if (isAgentAvatarValid() && (agent_id == gAgentAvatarp->getID()))
- {
- gMessageSystem->getU32Fast(_PREHASH_AgentData, _PREHASH_SerialNum, gAgentQueryManager.mUpdateSerialNum);
-
- const S32 NUM_BODY_PARTS = 4;
- S32 num_wearables = gMessageSystem->getNumberOfBlocksFast(_PREHASH_WearableData);
- if (num_wearables < NUM_BODY_PARTS)
- {
- // Transitional state. Avatars should always have at least their body parts (hair, eyes, shape and skin).
- // The fact that they don't have any here (only a dummy is sent) implies that either:
- // 1. This account existed before we had wearables
- // 2. The database has gotten messed up
- // 3. This is the account's first login (i.e. the wearables haven't been generated yet).
- return;
- }
-
- // Get the UUID of the current outfit folder (will be created if it doesn't exist)
- const LLUUID current_outfit_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT);
- LLInitialWearablesFetch* outfit = new LLInitialWearablesFetch(current_outfit_id);
-
- //lldebugs << "processAgentInitialWearablesUpdate()" << llendl;
- // Add wearables
- // MULTI-WEARABLE: DEPRECATED: Message only supports one wearable per type, will be ignored in future.
- gAgentWearables.mItemsAwaitingWearableUpdate.clear();
- for (S32 i=0; i < num_wearables; i++)
- {
- // Parse initial wearables data from message system
- U8 type_u8 = 0;
- gMessageSystem->getU8Fast(_PREHASH_WearableData, _PREHASH_WearableType, type_u8, i);
- if (type_u8 >= LLWearableType::WT_COUNT)
- {
- continue;
- }
- const LLWearableType::EType type = (LLWearableType::EType) type_u8;
-
- LLUUID item_id;
- gMessageSystem->getUUIDFast(_PREHASH_WearableData, _PREHASH_ItemID, item_id, i);
-
- LLUUID asset_id;
- gMessageSystem->getUUIDFast(_PREHASH_WearableData, _PREHASH_AssetID, asset_id, i);
- if (asset_id.isNull())
- {
- LLViewerWearable::removeFromAvatar(type, FALSE);
- }
- else
- {
- LLAssetType::EType asset_type = LLWearableType::getAssetType(type);
- if (asset_type == LLAssetType::AT_NONE)
- {
- continue;
- }
-
- // MULTI-WEARABLE: DEPRECATED: this message only supports one wearable per type. Should be ignored in future versions
-
- // Store initial wearables data until we know whether we have the current outfit folder or need to use the data.
- LLInitialWearablesFetch::InitialWearableData wearable_data(type, item_id, asset_id);
- outfit->add(wearable_data);
- }
-
- lldebugs << " " << LLWearableType::getTypeLabel(type) << llendl;
- }
-
- // Get the complete information on the items in the inventory and set up an observer
- // that will trigger when the complete information is fetched.
- outfit->startFetch();
- if(outfit->isFinished())
- {
- // everything is already here - call done.
- outfit->done();
- }
- else
- {
- // it's all on it's way - add an observer, and the inventory
- // will call done for us when everything is here.
- gInventory.addObserver(outfit);
- }
-
- }
-}
-
-// Normally, all wearables referred to "AgentWearablesUpdate" will correspond to actual assets in the
-// database. If for some reason, we can't load one of those assets, we can try to reconstruct it so that
-// the user isn't left without a shape, for example. (We can do that only after the inventory has loaded.)
-void LLAgentWearables::recoverMissingWearable(const LLWearableType::EType type, U32 index)
-{
- // Try to recover by replacing missing wearable with a new one.
- LLNotificationsUtil::add("ReplacedMissingWearable");
- lldebugs << "Wearable " << LLWearableType::getTypeLabel(type) << " could not be downloaded. Replaced inventory item with default wearable." << llendl;
- LLViewerWearable* new_wearable = LLWearableList::instance().createNewWearable(type, gAgentAvatarp);
-
- setWearable(type,index,new_wearable);
- //new_wearable->writeToAvatar(TRUE);
-
- // Add a new one in the lost and found folder.
- // (We used to overwrite the "not found" one, but that could potentially
- // destory content.) JC
- const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND);
- LLPointer<LLInventoryCallback> cb =
- new addWearableToAgentInventoryCallback(
- LLPointer<LLRefCount>(NULL),
- type,
- index,
- new_wearable,
- addWearableToAgentInventoryCallback::CALL_RECOVERDONE);
- addWearableToAgentInventory(cb, new_wearable, lost_and_found_id, TRUE);
-}
-
-void LLAgentWearables::recoverMissingWearableDone()
-{
- // Have all the wearables that the avatar was wearing at log-in arrived or been fabricated?
- updateWearablesLoaded();
- if (areWearablesLoaded())
- {
- // Make sure that the server's idea of the avatar's wearables actually match the wearables.
- gAgent.sendAgentSetAppearance();
- }
- else
- {
- gInventory.addChangedMask(LLInventoryObserver::LABEL, LLUUID::null);
- gInventory.notifyObservers();
- }
-}
-
void LLAgentWearables::addLocalTextureObject(const LLWearableType::EType wearable_type, const LLAvatarAppearanceDefines::ETextureIndex texture_type, U32 wearable_index)
{
LLViewerWearable* wearable = getViewerWearable((LLWearableType::EType)wearable_type, wearable_index);
if (!wearable)
{
- llerrs << "Tried to add local texture object to invalid wearable with type " << wearable_type << " and index " << wearable_index << llendl;
+ LL_ERRS() << "Tried to add local texture object to invalid wearable with type " << wearable_type << " and index " << wearable_index << LL_ENDL;
return;
}
LLLocalTextureObject lto;
@@ -951,28 +684,28 @@ public:
OnWearableItemCreatedCB():
mWearablesAwaitingItems(LLWearableType::WT_COUNT,NULL)
{
- llinfos << "created callback" << llendl;
+ LL_INFOS() << "created callback" << LL_ENDL;
}
/* virtual */ void fire(const LLUUID& inv_item)
{
- llinfos << "One item created " << inv_item.asString() << llendl;
- LLViewerInventoryItem *item = gInventory.getItem(inv_item);
- mItemsToLink.put(item);
+ LL_INFOS() << "One item created " << inv_item.asString() << LL_ENDL;
+ LLConstPointer<LLInventoryObject> item = gInventory.getItem(inv_item);
+ mItemsToLink.push_back(item);
updatePendingWearable(inv_item);
}
~OnWearableItemCreatedCB()
{
- llinfos << "All items created" << llendl;
+ LL_INFOS() << "All items created" << LL_ENDL;
LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy;
- LLAppearanceMgr::instance().linkAll(LLAppearanceMgr::instance().getCOF(),
- mItemsToLink,
- link_waiter);
+ link_inventory_array(LLAppearanceMgr::instance().getCOF(),
+ mItemsToLink,
+ link_waiter);
}
void addPendingWearable(LLViewerWearable *wearable)
{
if (!wearable)
{
- llwarns << "no wearable" << llendl;
+ LL_WARNS() << "no wearable" << LL_ENDL;
return;
}
LLWearableType::EType type = wearable->getType();
@@ -982,7 +715,7 @@ public:
}
else
{
- llwarns << "invalid type " << type << llendl;
+ LL_WARNS() << "invalid type " << type << LL_ENDL;
}
}
void updatePendingWearable(const LLUUID& inv_item)
@@ -990,12 +723,12 @@ public:
LLViewerInventoryItem *item = gInventory.getItem(inv_item);
if (!item)
{
- llwarns << "no item found" << llendl;
+ LL_WARNS() << "no item found" << LL_ENDL;
return;
}
if (!item->isWearableType())
{
- llwarns << "non-wearable item found" << llendl;
+ LL_WARNS() << "non-wearable item found" << LL_ENDL;
return;
}
if (item && item->isWearableType())
@@ -1009,19 +742,19 @@ public:
}
else
{
- llwarns << "invalid wearable type " << type << llendl;
+ LL_WARNS() << "invalid wearable type " << type << LL_ENDL;
}
}
}
private:
- LLInventoryModel::item_array_t mItemsToLink;
+ LLInventoryObject::const_object_list_t mItemsToLink;
std::vector<LLViewerWearable*> mWearablesAwaitingItems;
};
void LLAgentWearables::createStandardWearables()
{
- llwarns << "Creating standard wearables" << llendl;
+ LL_WARNS() << "Creating standard wearables" << LL_ENDL;
if (!isAgentAvatarValid()) return;
@@ -1067,28 +800,38 @@ void LLAgentWearables::createStandardWearables()
}
}
-void LLAgentWearables::createStandardWearablesDone(S32 type, U32 index)
+// We no longer need this message in the current viewer, but send
+// it for now to maintain compatibility with release viewers. Can
+// remove this function once the SH-3455 changesets are universally deployed.
+void LLAgentWearables::sendDummyAgentWearablesUpdate()
{
- llinfos << "type " << type << " index " << index << llendl;
+ LL_DEBUGS("Avatar") << "sendAgentWearablesUpdate()" << LL_ENDL;
- if (!isAgentAvatarValid()) return;
- gAgentAvatarp->updateVisualParams();
-}
+ // Send the AgentIsNowWearing
+ gMessageSystem->newMessageFast(_PREHASH_AgentIsNowWearing);
+
+ gMessageSystem->nextBlockFast(_PREHASH_AgentData);
+ gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
+ gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
-void LLAgentWearables::createStandardWearablesAllDone()
-{
- // ... because sendAgentWearablesUpdate will notify inventory
- // observers.
- llinfos << "all done?" << llendl;
+ // Send 4 standardized nonsense item ids (same as returned by the modified sim, not that it especially matters).
+ gMessageSystem->nextBlockFast(_PREHASH_WearableData);
+ gMessageSystem->addU8Fast(_PREHASH_WearableType, U8(1));
+ gMessageSystem->addUUIDFast(_PREHASH_ItemID, LLUUID("db5a4e5f-9da3-44c8-992d-1181c5795498"));
- mWearablesLoaded = TRUE;
- checkWearablesLoaded();
- notifyLoadingFinished();
-
- updateServer();
+ gMessageSystem->nextBlockFast(_PREHASH_WearableData);
+ gMessageSystem->addU8Fast(_PREHASH_WearableType, U8(2));
+ gMessageSystem->addUUIDFast(_PREHASH_ItemID, LLUUID("6969c7cc-f72f-4a76-a19b-c293cce8ce4f"));
+
+ gMessageSystem->nextBlockFast(_PREHASH_WearableData);
+ gMessageSystem->addU8Fast(_PREHASH_WearableType, U8(3));
+ gMessageSystem->addUUIDFast(_PREHASH_ItemID, LLUUID("7999702b-b291-48f9-8903-c91dfb828408"));
- // Treat this as the first texture entry message, if none received yet
- gAgentAvatarp->onFirstTEMessageReceived();
+ gMessageSystem->nextBlockFast(_PREHASH_WearableData);
+ gMessageSystem->addU8Fast(_PREHASH_WearableType, U8(4));
+ gMessageSystem->addUUIDFast(_PREHASH_ItemID, LLUUID("566cb59e-ef60-41d7-bfa6-e0f293fbea40"));
+
+ gAgent.sendReliableMessage();
}
void LLAgentWearables::makeNewOutfitDone(S32 type, U32 index)
@@ -1204,11 +947,10 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo
for (S32 i=max_entry; i>=0; i--)
{
LLViewerWearable* old_wearable = getViewerWearable(type,i);
- //queryWearableCache(); // moved below
if (old_wearable)
{
popWearable(old_wearable);
- old_wearable->removeFromAvatar(TRUE);
+ old_wearable->removeFromAvatar();
}
}
clearWearableType(type);
@@ -1216,48 +958,100 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo
else
{
LLViewerWearable* old_wearable = getViewerWearable(type, index);
- //queryWearableCache(); // moved below
if (old_wearable)
{
popWearable(old_wearable);
- old_wearable->removeFromAvatar(TRUE);
+ old_wearable->removeFromAvatar();
}
}
- queryWearableCache();
-
- // Update the server
- updateServer();
gInventory.notifyObservers();
}
// Assumes existing wearables are not dirty.
void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& items,
- const LLDynamicArray< LLViewerWearable* >& wearables,
- BOOL remove)
+ const std::vector< LLViewerWearable* >& wearables)
{
- llinfos << "setWearableOutfit() start" << llendl;
+ LL_INFOS() << "setWearableOutfit() start" << LL_ENDL;
+
+ S32 count = wearables.size();
+ llassert(items.size() == count);
+ // Check for whether outfit already matches the one requested
+ S32 matched = 0, mismatched = 0;
+ const S32 arr_size = LLWearableType::WT_COUNT;
+ S32 type_counts[arr_size];
+ std::fill(type_counts,type_counts+arr_size,0);
+ for (S32 i = 0; i < count; i++)
+ {
+ LLViewerWearable* new_wearable = wearables[i];
+ LLPointer<LLInventoryItem> new_item = items[i];
+
+ const LLWearableType::EType type = new_wearable->getType();
+ if (type < 0 || type>=LLWearableType::WT_COUNT)
+ {
+ LL_WARNS() << "invalid type " << type << LL_ENDL;
+ mismatched++;
+ continue;
+ }
+ S32 index = type_counts[type];
+ type_counts[type]++;
+
+ LLViewerWearable *curr_wearable = dynamic_cast<LLViewerWearable*>(getWearable(type,index));
+ if (!new_wearable || !curr_wearable ||
+ new_wearable->getAssetID() != curr_wearable->getAssetID())
+ {
+ LL_DEBUGS("Avatar") << "mismatch, type " << type << " index " << index
+ << " names " << (curr_wearable ? curr_wearable->getName() : "NONE") << ","
+ << " names " << (new_wearable ? new_wearable->getName() : "NONE") << LL_ENDL;
+ mismatched++;
+ continue;
+ }
+
+ if (curr_wearable->getName() != new_item->getName() ||
+ curr_wearable->getItemID() != new_item->getUUID())
+ {
+ LL_DEBUGS("Avatar") << "mismatch on name or inventory id, names "
+ << curr_wearable->getName() << " vs " << new_item->getName()
+ << " item ids " << curr_wearable->getItemID() << " vs " << new_item->getUUID()
+ << LL_ENDL;
+ mismatched++;
+ continue;
+ }
+ // If we got here, everything matches.
+ matched++;
+ }
+ LL_DEBUGS("Avatar") << "matched " << matched << " mismatched " << mismatched << LL_ENDL;
+ for (S32 j=0; j<LLWearableType::WT_COUNT; j++)
+ {
+ LLWearableType::EType type = (LLWearableType::EType) j;
+ if (getWearableCount(type) != type_counts[j])
+ {
+ LL_DEBUGS("Avatar") << "count mismatch for type " << j << " current " << getWearableCount(j) << " requested " << type_counts[j] << LL_ENDL;
+ mismatched++;
+ }
+ }
+ if (mismatched == 0)
+ {
+ LL_DEBUGS("Avatar") << "no changes, bailing out" << LL_ENDL;
+ mCOFChangeInProgress = false;
+ return;
+ }
+
+
// TODO: Removed check for ensuring that teens don't remove undershirt and underwear. Handle later
- if (remove)
+ // note: shirt is the first non-body part wearable item. Update if wearable order changes.
+ // This loop should remove all clothing, but not any body parts
+ for (S32 j = 0; j < (S32)LLWearableType::WT_COUNT; j++)
{
- // note: shirt is the first non-body part wearable item. Update if wearable order changes.
- // This loop should remove all clothing, but not any body parts
- for (S32 type = 0; type < (S32)LLWearableType::WT_COUNT; type++)
+ if (LLWearableType::getAssetType((LLWearableType::EType)j) == LLAssetType::AT_CLOTHING)
{
- if (LLWearableType::getAssetType((LLWearableType::EType)type) == LLAssetType::AT_CLOTHING)
- {
- removeWearable((LLWearableType::EType)type, true, 0);
- }
+ removeWearable((LLWearableType::EType)j, true, 0);
}
}
- S32 count = wearables.count();
- llassert(items.count() == count);
-
- S32 i;
- for (i = 0; i < count; i++)
+ for (S32 i = 0; i < count; i++)
{
LLViewerWearable* new_wearable = wearables[i];
LLPointer<LLInventoryItem> new_item = items[i];
@@ -1304,14 +1098,12 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
// Start rendering & update the server
mWearablesLoaded = TRUE;
- checkWearablesLoaded();
+
notifyLoadingFinished();
- queryWearableCache();
- updateServer();
gAgentAvatarp->dumpAvatarTEs("setWearableOutfit");
- lldebugs << "setWearableOutfit() end" << llendl;
+ LL_DEBUGS("Avatar") << "setWearableOutfit() end" << LL_ENDL;
}
@@ -1321,7 +1113,7 @@ void LLAgentWearables::setWearableItem(LLInventoryItem* new_item, LLViewerWearab
//LLAgentDumper dumper("setWearableItem");
if (isWearingItem(new_item->getUUID()))
{
- llwarns << "wearable " << new_item->getUUID() << " is already worn" << llendl;
+ LL_WARNS() << "wearable " << new_item->getUUID() << " is already worn" << LL_ENDL;
return;
}
@@ -1338,7 +1130,7 @@ void LLAgentWearables::setWearableItem(LLInventoryItem* new_item, LLViewerWearab
if ((old_wearable->getAssetID() == new_wearable->getAssetID()) &&
(old_item_id == new_item->getUUID()))
{
- lldebugs << "No change to wearable asset and item: " << LLWearableType::getTypeName(type) << llendl;
+ LL_DEBUGS() << "No change to wearable asset and item: " << LLWearableType::getTypeName(type) << LL_ENDL;
return;
}
@@ -1402,8 +1194,8 @@ void LLAgentWearables::setWearableFinal(LLInventoryItem* new_item, LLViewerWeara
new_wearable->setItemID(new_item->getUUID());
const bool trigger_updated = false;
pushWearable(type, new_wearable, trigger_updated);
- llinfos << "Added additional wearable for type " << type
- << " size is now " << getWearableCount(type) << llendl;
+ LL_INFOS() << "Added additional wearable for type " << type
+ << " size is now " << getWearableCount(type) << LL_ENDL;
checkWearableAgainstInventory(new_wearable);
}
else
@@ -1425,84 +1217,11 @@ void LLAgentWearables::setWearableFinal(LLInventoryItem* new_item, LLViewerWeara
gInventory.addChangedMask(LLInventoryObserver::LABEL, old_item_id);
gInventory.notifyObservers();
}
- llinfos << "Replaced current element 0 for type " << type
- << " size is now " << getWearableCount(type) << llendl;
- }
-
- //llinfos << "LLVOAvatar::setWearableItem()" << llendl;
- queryWearableCache();
- //new_wearable->writeToAvatar(TRUE);
-
- updateServer();
-}
-
-void LLAgentWearables::queryWearableCache()
-{
- if (!areWearablesLoaded() || (gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion()))
- {
- return;
- }
-
- // Look up affected baked textures.
- // If they exist:
- // disallow updates for affected layersets (until dataserver responds with cache request.)
- // If cache miss, turn updates back on and invalidate composite.
- // If cache hit, modify baked texture entries.
- //
- // Cache requests contain list of hashes for each baked texture entry.
- // Response is list of valid baked texture assets. (same message)
-
- gMessageSystem->newMessageFast(_PREHASH_AgentCachedTexture);
- gMessageSystem->nextBlockFast(_PREHASH_AgentData);
- gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
- gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
- gMessageSystem->addS32Fast(_PREHASH_SerialNum, gAgentQueryManager.mWearablesCacheQueryID);
-
- S32 num_queries = 0;
- for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++)
- {
- LLUUID hash_id = computeBakedTextureHash((EBakedTextureIndex) baked_index);
- if (hash_id.notNull())
- {
- num_queries++;
- // *NOTE: make sure at least one request gets packed
-
- ETextureIndex te_index = LLAvatarAppearanceDictionary::bakedToLocalTextureIndex((EBakedTextureIndex)baked_index);
-
- //llinfos << "Requesting texture for hash " << hash << " in baked texture slot " << baked_index << llendl;
- gMessageSystem->nextBlockFast(_PREHASH_WearableData);
- gMessageSystem->addUUIDFast(_PREHASH_ID, hash_id);
- gMessageSystem->addU8Fast(_PREHASH_TextureIndex, (U8)te_index);
- }
-
- gAgentQueryManager.mActiveCacheQueries[baked_index] = gAgentQueryManager.mWearablesCacheQueryID;
- }
- //VWR-22113: gAgent.getRegion() can return null if invalid, seen here on logout
- if(gAgent.getRegion())
- {
- if (isAgentAvatarValid())
- {
- selfStartPhase("fetch_texture_cache_entries");
- gAgentAvatarp->outputRezTiming("Fetching textures from cache");
- }
-
- LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "Requesting texture cache entry for " << num_queries << " baked textures" << LL_ENDL;
- gMessageSystem->sendReliable(gAgent.getRegion()->getHost());
- gAgentQueryManager.mNumPendingQueries++;
- gAgentQueryManager.mWearablesCacheQueryID++;
+ LL_INFOS() << "Replaced current element 0 for type " << type
+ << " size is now " << getWearableCount(type) << LL_ENDL;
}
}
-// virtual
-void LLAgentWearables::invalidateBakedTextureHash(LLMD5& hash) const
-{
- // Add some garbage into the hash so that it becomes invalid.
- if (isAgentAvatarValid())
- {
- hash.update((const unsigned char*)gAgentAvatarp->getID().mData, UUID_BYTES);
- }
- }
-
// User has picked "remove from avatar" from a menu.
// static
void LLAgentWearables::userRemoveWearable(const LLWearableType::EType &type, const U32 &index)
@@ -1537,10 +1256,10 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj
std::set<LLUUID> requested_item_ids;
std::set<LLUUID> current_item_ids;
- for (S32 i=0; i<obj_item_array.count(); i++)
+ for (S32 i=0; i<obj_item_array.size(); i++)
{
const LLUUID & requested_id = obj_item_array[i].get()->getLinkedUUID();
- //llinfos << "Requested attachment id " << requested_id << llendl;
+ //LL_INFOS() << "Requested attachment id " << requested_id << LL_ENDL;
requested_item_ids.insert(requested_id);
}
@@ -1573,12 +1292,12 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj
if (remove_attachment)
{
- // llinfos << "found object to remove, id " << objectp->getID() << ", item " << objectp->getAttachmentItemID() << llendl;
+ // LL_INFOS() << "found object to remove, id " << objectp->getID() << ", item " << objectp->getAttachmentItemID() << LL_ENDL;
objects_to_remove.push_back(objectp);
}
else
{
- // llinfos << "found object to keep, id " << objectp->getID() << ", item " << objectp->getAttachmentItemID() << llendl;
+ // LL_INFOS() << "found object to keep, id " << objectp->getID() << ", item " << objectp->getAttachmentItemID() << LL_ENDL;
current_item_ids.insert(object_item_id);
}
}
@@ -1603,7 +1322,7 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj
}
// S32 remove_count = objects_to_remove.size();
// S32 add_count = items_to_add.size();
- // llinfos << "remove " << remove_count << " add " << add_count << llendl;
+ // LL_INFOS() << "remove " << remove_count << " add " << add_count << LL_ENDL;
// Remove everything in objects_to_remove
userRemoveMultipleAttachments(objects_to_remove);
@@ -1638,7 +1357,7 @@ void LLAgentWearables::userRemoveMultipleAttachments(llvo_vec_t& objects_to_remo
void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_array_t& obj_item_array)
{
// Build a compound message to send all the objects that need to be rezzed.
- S32 obj_count = obj_item_array.count();
+ S32 obj_count = obj_item_array.size();
// Limit number of packets to send
const S32 MAX_PACKETS_TO_SEND = 10;
@@ -1669,7 +1388,7 @@ void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_arra
msg->addBOOLFast(_PREHASH_FirstDetachAll, false );
}
- const LLInventoryItem* item = obj_item_array.get(i).get();
+ const LLInventoryItem* item = obj_item_array.at(i).get();
msg->nextBlockFast(_PREHASH_ObjectData );
msg->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID());
msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner());
@@ -1686,17 +1405,6 @@ void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_arra
}
}
-void LLAgentWearables::checkWearablesLoaded() const
-{
-#ifdef SHOW_ASSERT
- U32 item_pend_count = itemUpdatePendingCount();
- if (mWearablesLoaded)
- {
- llassert(item_pend_count==0);
- }
-#endif
-}
-
// Returns false if the given wearable is already topmost/bottommost
// (depending on closer_to_body parameter).
bool LLAgentWearables::canMoveWearable(const LLUUID& item_id, bool closer_to_body) const
@@ -1713,20 +1421,9 @@ bool LLAgentWearables::canMoveWearable(const LLUUID& item_id, bool closer_to_bod
BOOL LLAgentWearables::areWearablesLoaded() const
{
- checkWearablesLoaded();
return mWearablesLoaded;
}
-// MULTI-WEARABLE: DEPRECATED: item pending count relies on old messages that don't support multi-wearables. do not trust to be accurate
-void LLAgentWearables::updateWearablesLoaded()
-{
- mWearablesLoaded = (itemUpdatePendingCount()==0);
- if (mWearablesLoaded)
- {
- notifyLoadingFinished();
- }
-}
-
bool LLAgentWearables::canWearableBeRemoved(const LLViewerWearable* wearable) const
{
if (!wearable) return false;
@@ -1736,7 +1433,7 @@ bool LLAgentWearables::canWearableBeRemoved(const LLViewerWearable* wearable) co
return !(((type == LLWearableType::WT_SHAPE) || (type == LLWearableType::WT_SKIN) || (type == LLWearableType::WT_HAIR) || (type == LLWearableType::WT_EYES))
&& (getWearableCount(type) <= 1) );
}
-void LLAgentWearables::animateAllWearableParams(F32 delta, BOOL upload_bake)
+void LLAgentWearables::animateAllWearableParams(F32 delta)
{
for( S32 type = 0; type < LLWearableType::WT_COUNT; ++type )
{
@@ -1746,7 +1443,7 @@ void LLAgentWearables::animateAllWearableParams(F32 delta, BOOL upload_bake)
llassert(wearable);
if (wearable)
{
- wearable->animateParams(delta, upload_bake);
+ wearable->animateParams(delta);
}
}
}
@@ -1804,7 +1501,16 @@ void LLAgentWearables::createWearable(LLWearableType::EType type, bool wear, con
LLViewerWearable* wearable = LLWearableList::instance().createNewWearable(type, gAgentAvatarp);
LLAssetType::EType asset_type = wearable->getAssetType();
LLInventoryType::EType inv_type = LLInventoryType::IT_WEARABLE;
- LLPointer<LLInventoryCallback> cb = wear ? new LLBoostFuncInventoryCallback(wear_and_edit_cb) : NULL;
+ LLPointer<LLInventoryCallback> cb;
+ if(wear)
+ {
+ cb = new LLBoostFuncInventoryCallback(wear_and_edit_cb);
+ }
+ else
+ {
+ cb = new LLBoostFuncInventoryCallback(wear_cb);
+ }
+
LLUUID folder_id;
if (parent_id.notNull())
@@ -1817,10 +1523,15 @@ void LLAgentWearables::createWearable(LLWearableType::EType type, bool wear, con
folder_id = gInventory.findCategoryUUIDForType(folder_type);
}
- create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
- folder_id, wearable->getTransactionID(), wearable->getName(),
- wearable->getDescription(), asset_type, inv_type, wearable->getType(),
- wearable->getPermissions().getMaskNextOwner(),
+ create_inventory_item(gAgent.getID(),
+ gAgent.getSessionID(),
+ folder_id,
+ wearable->getTransactionID(),
+ wearable->getName(),
+ wearable->getDescription(),
+ asset_type, inv_type,
+ wearable->getType(),
+ LLFloaterPerms::getNextOwnerPerms("Wearables"),
cb);
}
@@ -1830,20 +1541,20 @@ void LLAgentWearables::editWearable(const LLUUID& item_id)
LLViewerInventoryItem* item = gInventory.getLinkedItem(item_id);
if (!item)
{
- llwarns << "Failed to get linked item" << llendl;
+ LL_WARNS() << "Failed to get linked item" << LL_ENDL;
return;
}
LLViewerWearable* wearable = gAgentWearables.getWearableFromItemID(item_id);
if (!wearable)
{
- llwarns << "Cannot get wearable" << llendl;
+ LL_WARNS() << "Cannot get wearable" << LL_ENDL;
return;
}
if (!gAgentWearables.isWearableModifiable(item->getUUID()))
{
- llwarns << "Cannot modify wearable" << llendl;
+ LL_WARNS() << "Cannot modify wearable" << LL_ENDL;
return;
}
@@ -1869,30 +1580,6 @@ void LLAgentWearables::editWearableIfRequested(const LLUUID& item_id)
}
}
-void LLAgentWearables::updateServer()
-{
- sendAgentWearablesUpdate();
- gAgent.sendAgentSetAppearance();
-}
-
-void LLAgentWearables::populateMyOutfitsFolder(void)
-{
- llinfos << "starting outfit population" << llendl;
-
- const LLUUID& my_outfits_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS);
- LLLibraryOutfitsFetch* outfits = new LLLibraryOutfitsFetch(my_outfits_id);
- outfits->mMyOutfitsID = my_outfits_id;
-
- // Get the complete information on the items in the inventory and
- // setup an observer that will wait for that to happen.
- gInventory.addObserver(outfits);
- outfits->startFetch();
- if (outfits->isFinished())
- {
- outfits->done();
- }
-}
-
boost::signals2::connection LLAgentWearables::addLoadingStartedCallback(loading_started_callback_t cb)
{
return mLoadingStartedSignal.connect(cb);
@@ -1911,6 +1598,7 @@ bool LLAgentWearables::changeInProgress() const
void LLAgentWearables::notifyLoadingStarted()
{
mCOFChangeInProgress = true;
+ mCOFChangeTimer.reset();
mLoadingStartedSignal();
}
diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h
index 5be4648636..cdb1bdbe05 100755
--- a/indra/newview/llagentwearables.h
+++ b/indra/newview/llagentwearables.h
@@ -42,7 +42,6 @@
class LLInventoryItem;
class LLVOAvatarSelf;
class LLViewerWearable;
-class LLInitialWearablesFetch;
class LLViewerObject;
class LLAgentWearables : public LLInitClass<LLAgentWearables>, public LLWearableData
@@ -51,7 +50,6 @@ class LLAgentWearables : public LLInitClass<LLAgentWearables>, public LLWearable
// Constructors / destructors / Initializers
//--------------------------------------------------------------------
public:
- friend class LLInitialWearablesFetch;
LLAgentWearables();
virtual ~LLAgentWearables();
@@ -62,9 +60,6 @@ public:
// LLInitClass interface
static void initClass();
-protected:
- void createStandardWearablesDone(S32 type, U32 index/* = 0*/);
- void createStandardWearablesAllDone();
//--------------------------------------------------------------------
// Queries
@@ -77,6 +72,7 @@ public:
BOOL isWearableCopyable(LLWearableType::EType type, U32 index /*= 0*/) const;
BOOL areWearablesLoaded() const;
bool isCOFChangeInProgress() const { return mCOFChangeInProgress; }
+ F32 getCOFChangeTime() const { return mCOFChangeTimer.getElapsedTimeF32(); }
void updateWearablesLoaded();
void checkWearablesLoaded() const;
bool canMoveWearable(const LLUUID& item_id, bool closer_to_body) const;
@@ -84,7 +80,7 @@ public:
// Note: False for shape, skin, eyes, and hair, unless you have MORE than 1.
bool canWearableBeRemoved(const LLViewerWearable* wearable) const;
- void animateAllWearableParams(F32 delta, BOOL upload_bake);
+ void animateAllWearableParams(F32 delta);
//--------------------------------------------------------------------
// Accessors
@@ -107,7 +103,7 @@ private:
/*virtual*/void wearableUpdated(LLWearable *wearable, BOOL removed);
public:
void setWearableItem(LLInventoryItem* new_item, LLViewerWearable* wearable, bool do_append = false);
- void setWearableOutfit(const LLInventoryItem::item_array_t& items, const LLDynamicArray< LLViewerWearable* >& wearables, BOOL remove);
+ void setWearableOutfit(const LLInventoryItem::item_array_t& items, const std::vector< LLViewerWearable* >& wearables);
void setWearableName(const LLUUID& item_id, const std::string& new_name);
// *TODO: Move this into llappearance/LLWearableData ?
void addLocalTextureObject(const LLWearableType::EType wearable_type, const LLAvatarAppearanceDefines::ETextureIndex texture_type, U32 wearable_index);
@@ -151,31 +147,10 @@ private:
void removeWearableFinal(const LLWearableType::EType type, bool do_remove_all /*= false*/, U32 index /*= 0*/);
protected:
static bool onRemoveWearableDialog(const LLSD& notification, const LLSD& response);
-
- //--------------------------------------------------------------------
- // Server Communication
- //--------------------------------------------------------------------
-public:
- // Processes the initial wearables update message (if necessary, since the outfit folder makes it redundant)
- static void processAgentInitialWearablesUpdate(LLMessageSystem* mesgsys, void** user_data);
-
-protected:
- /*virtual*/ void invalidateBakedTextureHash(LLMD5& hash) const;
- void sendAgentWearablesUpdate();
- void sendAgentWearablesRequest();
- void queryWearableCache();
- void updateServer();
- static void onInitialWearableAssetArrived(LLViewerWearable* wearable, void* userdata);
//--------------------------------------------------------------------
// Outfits
//--------------------------------------------------------------------
-public:
-
- // Should only be called if we *know* we've never done so before, since users may
- // not want the Library outfits to stay in their quick outfit selector and can delete them.
- void populateMyOutfitsFolder();
-
private:
void makeNewOutfitDone(S32 type, U32 index);
@@ -184,11 +159,16 @@ private:
//--------------------------------------------------------------------
public:
void saveWearableAs(const LLWearableType::EType type, const U32 index, const std::string& new_name, const std::string& description, BOOL save_in_lost_and_found);
- void saveWearable(const LLWearableType::EType type, const U32 index, BOOL send_update = TRUE,
+ void saveWearable(const LLWearableType::EType type, const U32 index,
const std::string new_name = "");
void saveAllWearables();
void revertWearable(const LLWearableType::EType type, const U32 index);
+ // We no longer need this message in the current viewer, but send
+ // it for now to maintain compatibility with release viewers. Can
+ // remove this function once the SH-3455 changesets are universally deployed.
+ void sendDummyAgentWearablesUpdate();
+
//--------------------------------------------------------------------
// Static UI hooks
//--------------------------------------------------------------------
@@ -202,9 +182,6 @@ public:
static void userRemoveMultipleAttachments(llvo_vec_t& llvo_array);
static void userAttachMultipleAttachments(LLInventoryModel::item_array_t& obj_item_array);
- BOOL itemUpdatePending(const LLUUID& item_id) const;
- U32 itemUpdatePendingCount() const;
-
//--------------------------------------------------------------------
// Signals
//--------------------------------------------------------------------
@@ -231,29 +208,18 @@ private:
private:
static BOOL mInitialWearablesUpdateReceived;
BOOL mWearablesLoaded;
- std::set<LLUUID> mItemsAwaitingWearableUpdate;
/**
* True if agent's outfit is being changed now.
*/
BOOL mCOFChangeInProgress;
+ LLTimer mCOFChangeTimer;
//--------------------------------------------------------------------------------
// Support classes
//--------------------------------------------------------------------------------
private:
- class createStandardWearablesAllDoneCallback : public LLRefCount
- {
- protected:
- ~createStandardWearablesAllDoneCallback();
- };
- class sendAgentWearablesUpdateCallback : public LLRefCount
- {
- protected:
- ~sendAgentWearablesUpdateCallback();
- };
-
- class addWearableToAgentInventoryCallback : public LLInventoryCallback
+ class AddWearableToAgentInventoryCallback : public LLInventoryCallback
{
public:
enum ETodo
@@ -266,7 +232,7 @@ private:
CALL_WEARITEM = 16
};
- addWearableToAgentInventoryCallback(LLPointer<LLRefCount> cb,
+ AddWearableToAgentInventoryCallback(LLPointer<LLRefCount> cb,
LLWearableType::EType type,
U32 index,
LLViewerWearable* wearable,
diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp
deleted file mode 100755
index 8b6b6db525..0000000000
--- a/indra/newview/llagentwearablesfetch.cpp
+++ /dev/null
@@ -1,600 +0,0 @@
-/**
- * @file llagentwearablesfetch.cpp
- * @brief LLAgentWearblesFetch class implementation
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "llviewerprecompiledheaders.h"
-#include "llagentwearablesfetch.h"
-
-#include "llagent.h"
-#include "llagentwearables.h"
-#include "llappearancemgr.h"
-#include "llinventoryfunctions.h"
-#include "llstartup.h"
-#include "llvoavatarself.h"
-
-
-void order_my_outfits_cb()
- {
- if (!LLApp::isRunning())
- {
- llwarns << "called during shutdown, skipping" << llendl;
- return;
- }
-
- const LLUUID& my_outfits_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS);
- if (my_outfits_id.isNull()) return;
-
- LLInventoryModel::cat_array_t* cats;
- LLInventoryModel::item_array_t* items;
- gInventory.getDirectDescendentsOf(my_outfits_id, cats, items);
- if (!cats) return;
-
- //My Outfits should at least contain saved initial outfit and one another outfit
- if (cats->size() < 2)
- {
- llwarning("My Outfits category was not populated properly", 0);
- return;
- }
-
- llinfos << "Starting updating My Outfits with wearables ordering information" << llendl;
-
- for (LLInventoryModel::cat_array_t::iterator outfit_iter = cats->begin();
- outfit_iter != cats->end(); ++outfit_iter)
- {
- const LLUUID& cat_id = (*outfit_iter)->getUUID();
- if (cat_id.isNull()) continue;
-
- // saved initial outfit already contains wearables ordering information
- if (cat_id == LLAppearanceMgr::getInstance()->getBaseOutfitUUID()) continue;
-
- LLAppearanceMgr::getInstance()->updateClothingOrderingInfo(cat_id);
- }
-
- llinfos << "Finished updating My Outfits with wearables ordering information" << llendl;
- }
-
-LLInitialWearablesFetch::LLInitialWearablesFetch(const LLUUID& cof_id) :
- LLInventoryFetchDescendentsObserver(cof_id)
-{
- if (isAgentAvatarValid())
- {
- gAgentAvatarp->startPhase("initial_wearables_fetch");
- gAgentAvatarp->outputRezTiming("Initial wearables fetch started");
- }
-}
-
-LLInitialWearablesFetch::~LLInitialWearablesFetch()
-{
-}
-
-// virtual
-void LLInitialWearablesFetch::done()
-{
- // Delay processing the actual results of this so it's not handled within
- // gInventory.notifyObservers. The results will be handled in the next
- // idle tick instead.
- gInventory.removeObserver(this);
- doOnIdleOneTime(boost::bind(&LLInitialWearablesFetch::processContents,this));
- if (isAgentAvatarValid())
- {
- gAgentAvatarp->stopPhase("initial_wearables_fetch");
- gAgentAvatarp->outputRezTiming("Initial wearables fetch done");
- }
-}
-
-void LLInitialWearablesFetch::add(InitialWearableData &data)
-
-{
- mAgentInitialWearables.push_back(data);
-}
-
-void LLInitialWearablesFetch::processContents()
-{
- if(!gAgentAvatarp) //no need to process wearables if the agent avatar is deleted.
- {
- delete this;
- return ;
- }
-
- // Fetch the wearable items from the Current Outfit Folder
- LLInventoryModel::cat_array_t cat_array;
- LLInventoryModel::item_array_t wearable_array;
- LLFindWearables is_wearable;
- llassert_always(mComplete.size() != 0);
- gInventory.collectDescendentsIf(mComplete.front(), cat_array, wearable_array,
- LLInventoryModel::EXCLUDE_TRASH, is_wearable);
-
- LLAppearanceMgr::instance().setAttachmentInvLinkEnable(true);
- if (wearable_array.count() > 0)
- {
- gAgentWearables.notifyLoadingStarted();
- LLAppearanceMgr::instance().updateAppearanceFromCOF();
- }
- else
- {
- // if we're constructing the COF from the wearables message, we don't have a proper outfit link
- LLAppearanceMgr::instance().setOutfitDirty(true);
- processWearablesMessage();
- }
- delete this;
-}
-
-class LLFetchAndLinkObserver: public LLInventoryFetchItemsObserver
-{
-public:
- LLFetchAndLinkObserver(uuid_vec_t& ids):
- LLInventoryFetchItemsObserver(ids)
- {
- }
- ~LLFetchAndLinkObserver()
- {
- }
- virtual void done()
- {
- gInventory.removeObserver(this);
-
- // Link to all fetched items in COF.
- LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy;
- for (uuid_vec_t::iterator it = mIDs.begin();
- it != mIDs.end();
- ++it)
- {
- LLUUID id = *it;
- LLViewerInventoryItem *item = gInventory.getItem(*it);
- if (!item)
- {
- llwarns << "fetch failed!" << llendl;
- continue;
- }
-
- link_inventory_item(gAgent.getID(),
- item->getLinkedUUID(),
- LLAppearanceMgr::instance().getCOF(),
- item->getName(),
- item->getDescription(),
- LLAssetType::AT_LINK,
- link_waiter);
- }
- }
-};
-
-void LLInitialWearablesFetch::processWearablesMessage()
-{
- if (!mAgentInitialWearables.empty()) // We have an empty current outfit folder, use the message data instead.
- {
- const LLUUID current_outfit_id = LLAppearanceMgr::instance().getCOF();
- uuid_vec_t ids;
- for (U8 i = 0; i < mAgentInitialWearables.size(); ++i)
- {
- // Populate the current outfit folder with links to the wearables passed in the message
- InitialWearableData *wearable_data = new InitialWearableData(mAgentInitialWearables[i]); // This will be deleted in the callback.
-
- if (wearable_data->mAssetID.notNull())
- {
- ids.push_back(wearable_data->mItemID);
- }
- else
- {
- llinfos << "Invalid wearable, type " << wearable_data->mType << " itemID "
- << wearable_data->mItemID << " assetID " << wearable_data->mAssetID << llendl;
- delete wearable_data;
- }
- }
-
- // Add all current attachments to the requested items as well.
- if (isAgentAvatarValid())
- {
- for (LLVOAvatar::attachment_map_t::const_iterator iter = gAgentAvatarp->mAttachmentPoints.begin();
- iter != gAgentAvatarp->mAttachmentPoints.end(); ++iter)
- {
- LLViewerJointAttachment* attachment = iter->second;
- if (!attachment) continue;
- for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
- attachment_iter != attachment->mAttachedObjects.end();
- ++attachment_iter)
- {
- LLViewerObject* attached_object = (*attachment_iter);
- if (!attached_object) continue;
- const LLUUID& item_id = attached_object->getAttachmentItemID();
- if (item_id.isNull()) continue;
- ids.push_back(item_id);
- }
- }
- }
-
- // Need to fetch the inventory items for ids, then create links to them after they arrive.
- LLFetchAndLinkObserver *fetcher = new LLFetchAndLinkObserver(ids);
- fetcher->startFetch();
- // If no items to be fetched, done will never be triggered.
- // TODO: Change LLInventoryFetchItemsObserver::fetchItems to trigger done() on this condition.
- if (fetcher->isFinished())
- {
- fetcher->done();
- }
- else
- {
- gInventory.addObserver(fetcher);
- }
- }
- else
- {
- LL_WARNS("Wearables") << "No current outfit folder items found and no initial wearables fallback message received." << LL_ENDL;
- }
-}
-
-LLLibraryOutfitsFetch::LLLibraryOutfitsFetch(const LLUUID& my_outfits_id) :
- LLInventoryFetchDescendentsObserver(my_outfits_id),
- mCurrFetchStep(LOFS_FOLDER),
- mOutfitsPopulated(false)
-{
- llinfos << "created" << llendl;
-
- mMyOutfitsID = LLUUID::null;
- mClothingID = LLUUID::null;
- mLibraryClothingID = LLUUID::null;
- mImportedClothingID = LLUUID::null;
- mImportedClothingName = "Imported Library Clothing";
-}
-
-LLLibraryOutfitsFetch::~LLLibraryOutfitsFetch()
-{
- llinfos << "destroyed" << llendl;
-}
-
-void LLLibraryOutfitsFetch::done()
-{
- llinfos << "start" << llendl;
-
- // Delay this until idle() routine, since it's a heavy operation and
- // we also can't have it run within notifyObservers.
- doOnIdleOneTime(boost::bind(&LLLibraryOutfitsFetch::doneIdle,this));
- gInventory.removeObserver(this); // Prevent doOnIdleOneTime from being added twice.
-}
-
-void LLLibraryOutfitsFetch::doneIdle()
-{
- llinfos << "start" << llendl;
-
- gInventory.addObserver(this); // Add this back in since it was taken out during ::done()
-
- switch (mCurrFetchStep)
- {
- case LOFS_FOLDER:
- folderDone();
- mCurrFetchStep = LOFS_OUTFITS;
- break;
- case LOFS_OUTFITS:
- outfitsDone();
- mCurrFetchStep = LOFS_LIBRARY;
- break;
- case LOFS_LIBRARY:
- libraryDone();
- mCurrFetchStep = LOFS_IMPORTED;
- break;
- case LOFS_IMPORTED:
- importedFolderDone();
- mCurrFetchStep = LOFS_CONTENTS;
- break;
- case LOFS_CONTENTS:
- contentsDone();
- break;
- default:
- llwarns << "Got invalid state for outfit fetch: " << mCurrFetchStep << llendl;
- mOutfitsPopulated = TRUE;
- break;
- }
-
- // We're completely done. Cleanup.
- if (mOutfitsPopulated)
- {
- gInventory.removeObserver(this);
- delete this;
- return;
- }
-}
-
-void LLLibraryOutfitsFetch::folderDone()
-{
- llinfos << "start" << llendl;
-
- LLInventoryModel::cat_array_t cat_array;
- LLInventoryModel::item_array_t wearable_array;
- gInventory.collectDescendents(mMyOutfitsID, cat_array, wearable_array,
- LLInventoryModel::EXCLUDE_TRASH);
-
- // Early out if we already have items in My Outfits
- // except the case when My Outfits contains just initial outfit
- if (cat_array.count() > 1)
- {
- mOutfitsPopulated = true;
- return;
- }
-
- mClothingID = gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
- mLibraryClothingID = gInventory.findLibraryCategoryUUIDForType(LLFolderType::FT_CLOTHING, false);
-
- // If Library->Clothing->Initial Outfits exists, use that.
- LLNameCategoryCollector matchFolderFunctor("Initial Outfits");
- cat_array.clear();
- gInventory.collectDescendentsIf(mLibraryClothingID,
- cat_array, wearable_array,
- LLInventoryModel::EXCLUDE_TRASH,
- matchFolderFunctor);
- if (cat_array.count() > 0)
- {
- const LLViewerInventoryCategory *cat = cat_array.get(0);
- mLibraryClothingID = cat->getUUID();
- }
-
- mComplete.clear();
-
- // Get the complete information on the items in the inventory.
- uuid_vec_t folders;
- folders.push_back(mClothingID);
- folders.push_back(mLibraryClothingID);
- setFetchIDs(folders);
- startFetch();
- if (isFinished())
- {
- done();
- }
-}
-
-void LLLibraryOutfitsFetch::outfitsDone()
-{
- llinfos << "start" << llendl;
-
- LLInventoryModel::cat_array_t cat_array;
- LLInventoryModel::item_array_t wearable_array;
- uuid_vec_t folders;
-
- // Collect the contents of the Library's Clothing folder
- gInventory.collectDescendents(mLibraryClothingID, cat_array, wearable_array,
- LLInventoryModel::EXCLUDE_TRASH);
-
- llassert(cat_array.count() > 0);
- for (LLInventoryModel::cat_array_t::const_iterator iter = cat_array.begin();
- iter != cat_array.end();
- ++iter)
- {
- const LLViewerInventoryCategory *cat = iter->get();
-
- // Get the names and id's of every outfit in the library, skip "Ruth"
- // because it's a low quality legacy outfit
- if (cat->getName() != "Ruth")
- {
- // Get the name of every outfit in the library
- folders.push_back(cat->getUUID());
- mLibraryClothingFolders.push_back(cat->getUUID());
- }
- }
- cat_array.clear();
- wearable_array.clear();
-
- // Check if you already have an "Imported Library Clothing" folder
- LLNameCategoryCollector matchFolderFunctor(mImportedClothingName);
- gInventory.collectDescendentsIf(mClothingID,
- cat_array, wearable_array,
- LLInventoryModel::EXCLUDE_TRASH,
- matchFolderFunctor);
- if (cat_array.size() > 0)
- {
- const LLViewerInventoryCategory *cat = cat_array.get(0);
- mImportedClothingID = cat->getUUID();
- }
-
- mComplete.clear();
- setFetchIDs(folders);
- startFetch();
- if (isFinished())
- {
- done();
- }
-}
-
-class LLLibraryOutfitsCopyDone: public LLInventoryCallback
-{
-public:
- LLLibraryOutfitsCopyDone(LLLibraryOutfitsFetch * fetcher):
- mFireCount(0), mLibraryOutfitsFetcher(fetcher)
- {
- }
-
- virtual ~LLLibraryOutfitsCopyDone()
- {
- if (!LLApp::isExiting() && mLibraryOutfitsFetcher)
- {
- gInventory.addObserver(mLibraryOutfitsFetcher);
- mLibraryOutfitsFetcher->done();
- }
- }
-
- /* virtual */ void fire(const LLUUID& inv_item)
- {
- mFireCount++;
- }
-private:
- U32 mFireCount;
- LLLibraryOutfitsFetch * mLibraryOutfitsFetcher;
-};
-
-// Copy the clothing folders from the library into the imported clothing folder
-void LLLibraryOutfitsFetch::libraryDone()
-{
- llinfos << "start" << llendl;
-
- if (mImportedClothingID != LLUUID::null)
- {
- // Skip straight to fetching the contents of the imported folder
- importedFolderFetch();
- return;
- }
-
- // Remove observer; next autopopulation step will be triggered externally by LLLibraryOutfitsCopyDone.
- gInventory.removeObserver(this);
-
- LLPointer<LLInventoryCallback> copy_waiter = new LLLibraryOutfitsCopyDone(this);
- mImportedClothingID = gInventory.createNewCategory(mClothingID,
- LLFolderType::FT_NONE,
- mImportedClothingName);
- // Copy each folder from library into clothing unless it already exists.
- for (uuid_vec_t::const_iterator iter = mLibraryClothingFolders.begin();
- iter != mLibraryClothingFolders.end();
- ++iter)
- {
- const LLUUID& src_folder_id = (*iter); // Library clothing folder ID
- const LLViewerInventoryCategory *cat = gInventory.getCategory(src_folder_id);
- if (!cat)
- {
- llwarns << "Library folder import for uuid:" << src_folder_id << " failed to find folder." << llendl;
- continue;
- }
-
- if (!LLAppearanceMgr::getInstance()->getCanMakeFolderIntoOutfit(src_folder_id))
- {
- llinfos << "Skipping non-outfit folder name:" << cat->getName() << llendl;
- continue;
- }
-
- // Don't copy the category if it already exists.
- LLNameCategoryCollector matchFolderFunctor(cat->getName());
- LLInventoryModel::cat_array_t cat_array;
- LLInventoryModel::item_array_t wearable_array;
- gInventory.collectDescendentsIf(mImportedClothingID,
- cat_array, wearable_array,
- LLInventoryModel::EXCLUDE_TRASH,
- matchFolderFunctor);
- if (cat_array.size() > 0)
- {
- continue;
- }
-
- LLUUID dst_folder_id = gInventory.createNewCategory(mImportedClothingID,
- LLFolderType::FT_NONE,
- cat->getName());
- LLAppearanceMgr::getInstance()->shallowCopyCategoryContents(src_folder_id, dst_folder_id, copy_waiter);
- }
-}
-
-void LLLibraryOutfitsFetch::importedFolderFetch()
-{
- llinfos << "start" << llendl;
-
- // Fetch the contents of the Imported Clothing Folder
- uuid_vec_t folders;
- folders.push_back(mImportedClothingID);
-
- mComplete.clear();
- setFetchIDs(folders);
- startFetch();
- if (isFinished())
- {
- done();
- }
-}
-
-void LLLibraryOutfitsFetch::importedFolderDone()
-{
- llinfos << "start" << llendl;
-
- LLInventoryModel::cat_array_t cat_array;
- LLInventoryModel::item_array_t wearable_array;
- uuid_vec_t folders;
-
- // Collect the contents of the Imported Clothing folder
- gInventory.collectDescendents(mImportedClothingID, cat_array, wearable_array,
- LLInventoryModel::EXCLUDE_TRASH);
-
- for (LLInventoryModel::cat_array_t::const_iterator iter = cat_array.begin();
- iter != cat_array.end();
- ++iter)
- {
- const LLViewerInventoryCategory *cat = iter->get();
-
- // Get the name of every imported outfit
- folders.push_back(cat->getUUID());
- mImportedClothingFolders.push_back(cat->getUUID());
- }
-
- mComplete.clear();
- setFetchIDs(folders);
- startFetch();
- if (isFinished())
- {
- done();
- }
-}
-
-void LLLibraryOutfitsFetch::contentsDone()
-{
- llinfos << "start" << llendl;
-
- LLInventoryModel::cat_array_t cat_array;
- LLInventoryModel::item_array_t wearable_array;
-
- LLPointer<LLInventoryCallback> order_myoutfits_on_destroy = new LLBoostFuncInventoryCallback(no_op_inventory_func, order_my_outfits_cb);
-
- for (uuid_vec_t::const_iterator folder_iter = mImportedClothingFolders.begin();
- folder_iter != mImportedClothingFolders.end();
- ++folder_iter)
- {
- const LLUUID &folder_id = (*folder_iter);
- const LLViewerInventoryCategory *cat = gInventory.getCategory(folder_id);
- if (!cat)
- {
- llwarns << "Library folder import for uuid:" << folder_id << " failed to find folder." << llendl;
- continue;
- }
-
- //initial outfit should be already in My Outfits
- if (cat->getName() == LLStartUp::getInitialOutfitName()) continue;
-
- // First, make a folder in the My Outfits directory.
- LLUUID new_outfit_folder_id = gInventory.createNewCategory(mMyOutfitsID, LLFolderType::FT_OUTFIT, cat->getName());
-
- cat_array.clear();
- wearable_array.clear();
- // Collect the contents of each imported clothing folder, so we can create new outfit links for it
- gInventory.collectDescendents(folder_id, cat_array, wearable_array,
- LLInventoryModel::EXCLUDE_TRASH);
-
- for (LLInventoryModel::item_array_t::const_iterator wearable_iter = wearable_array.begin();
- wearable_iter != wearable_array.end();
- ++wearable_iter)
- {
- const LLViewerInventoryItem *item = wearable_iter->get();
- link_inventory_item(gAgent.getID(),
- item->getLinkedUUID(),
- new_outfit_folder_id,
- item->getName(),
- item->getDescription(),
- LLAssetType::AT_LINK,
- order_myoutfits_on_destroy);
- }
- }
-
- mOutfitsPopulated = true;
-}
-
diff --git a/indra/newview/llagentwearablesfetch.h b/indra/newview/llagentwearablesfetch.h
deleted file mode 100755
index bedc445c0e..0000000000
--- a/indra/newview/llagentwearablesfetch.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/**
- * @file llagentwearablesinitialfetch.h
- * @brief LLAgentWearablesInitialFetch class header file
- *
- * $LicenseInfo:firstyear=2000&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLAGENTWEARABLESINITIALFETCH_H
-#define LL_LLAGENTWEARABLESINITIALFETCH_H
-
-#include "llinventoryobserver.h"
-#include "llwearabletype.h"
-#include "lluuid.h"
-
-//--------------------------------------------------------------------
-// InitialWearablesFetch
-//
-// This grabs contents from the COF and processes them.
-// The processing is handled in idle(), i.e. outside of done(),
-// to avoid gInventory.notifyObservers recursion.
-//--------------------------------------------------------------------
-class LLInitialWearablesFetch : public LLInventoryFetchDescendentsObserver
-{
- LOG_CLASS(LLInitialWearablesFetch);
-
-public:
- LLInitialWearablesFetch(const LLUUID& cof_id);
- ~LLInitialWearablesFetch();
- virtual void done();
-
- struct InitialWearableData
- {
- LLWearableType::EType mType;
- LLUUID mItemID;
- LLUUID mAssetID;
- InitialWearableData(LLWearableType::EType type, LLUUID& itemID, LLUUID& assetID) :
- mType(type),
- mItemID(itemID),
- mAssetID(assetID)
- {}
- };
-
- void add(InitialWearableData &data);
-
-protected:
- void processWearablesMessage();
- void processContents();
-
-private:
- typedef std::vector<InitialWearableData> initial_wearable_data_vec_t;
- initial_wearable_data_vec_t mAgentInitialWearables; // Wearables from the old agent wearables msg
-};
-
-//--------------------------------------------------------------------
-// InitialWearablesFetch
-//
-// This grabs outfits from the Library and copies those over to the user's
-// outfits folder, typically during first-ever login.
-//--------------------------------------------------------------------
-class LLLibraryOutfitsFetch : public LLInventoryFetchDescendentsObserver
-{
-public:
- enum ELibraryOutfitFetchStep
- {
- LOFS_FOLDER = 0,
- LOFS_OUTFITS,
- LOFS_LIBRARY,
- LOFS_IMPORTED,
- LOFS_CONTENTS
- };
-
- LLLibraryOutfitsFetch(const LLUUID& my_outfits_id);
- ~LLLibraryOutfitsFetch();
-
- virtual void done();
- void doneIdle();
- LLUUID mMyOutfitsID;
- void importedFolderFetch();
-protected:
- void folderDone();
- void outfitsDone();
- void libraryDone();
- void importedFolderDone();
- void contentsDone();
- enum ELibraryOutfitFetchStep mCurrFetchStep;
- uuid_vec_t mLibraryClothingFolders;
- uuid_vec_t mImportedClothingFolders;
- bool mOutfitsPopulated;
- LLUUID mClothingID;
- LLUUID mLibraryClothingID;
- LLUUID mImportedClothingID;
- std::string mImportedClothingName;
-};
-
-#endif // LL_AGENTWEARABLESINITIALFETCH_H
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp
new file mode 100755
index 0000000000..96de15bf75
--- /dev/null
+++ b/indra/newview/llaisapi.cpp
@@ -0,0 +1,888 @@
+/**
+ * @file llaisapi.cpp
+ * @brief classes and functions for interfacing with the v3+ ais inventory service.
+ *
+ * $LicenseInfo:firstyear=2013&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2013, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ *
+ */
+
+#include "llviewerprecompiledheaders.h"
+#include "llaisapi.h"
+
+#include "llagent.h"
+#include "llcallbacklist.h"
+#include "llinventorymodel.h"
+#include "llsdutil.h"
+#include "llviewerregion.h"
+#include "llinventoryobserver.h"
+
+///----------------------------------------------------------------------------
+/// Classes for AISv3 support.
+///----------------------------------------------------------------------------
+
+// AISCommand - base class for retry-able HTTP requests using the AISv3 cap.
+AISCommand::AISCommand(LLPointer<LLInventoryCallback> callback):
+ mCommandFunc(NULL),
+ mCallback(callback)
+{
+ mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10);
+}
+
+bool AISCommand::run_command()
+{
+ if (NULL == mCommandFunc)
+ {
+ // This may happen if a command failed to initiate itself.
+ LL_WARNS("Inventory") << "AIS command attempted with null command function" << LL_ENDL;
+ return false;
+ }
+ else
+ {
+ mCommandFunc();
+ return true;
+ }
+}
+
+void AISCommand::setCommandFunc(command_func_type command_func)
+{
+ mCommandFunc = command_func;
+}
+
+// virtual
+bool AISCommand::getResponseUUID(const LLSD& content, LLUUID& id)
+{
+ return false;
+}
+
+/* virtual */
+void AISCommand::httpSuccess()
+{
+ // Command func holds a reference to self, need to release it
+ // after a success or final failure.
+ setCommandFunc(no_op);
+
+ const LLSD& content = getContent();
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
+ mRetryPolicy->onSuccess();
+
+ gInventory.onAISUpdateReceived("AISCommand", content);
+
+ if (mCallback)
+ {
+ LLUUID id; // will default to null if parse fails.
+ getResponseUUID(content,id);
+ mCallback->fire(id);
+ }
+}
+
+/*virtual*/
+void AISCommand::httpFailure()
+{
+ LL_WARNS("Inventory") << dumpResponse() << LL_ENDL;
+ S32 status = getStatus();
+ const LLSD& headers = getResponseHeaders();
+ mRetryPolicy->onFailure(status, headers);
+ F32 seconds_to_wait;
+ if (mRetryPolicy->shouldRetry(seconds_to_wait))
+ {
+ doAfterInterval(boost::bind(&AISCommand::run_command,this),seconds_to_wait);
+ }
+ else
+ {
+ // Command func holds a reference to self, need to release it
+ // after a success or final failure.
+ // *TODO: Notify user? This seems bad.
+ setCommandFunc(no_op);
+ }
+}
+
+//static
+bool AISCommand::isAPIAvailable()
+{
+ if (gAgent.getRegion())
+ {
+ return gAgent.getRegion()->isCapabilityAvailable("InventoryAPIv3");
+ }
+ return false;
+}
+
+//static
+bool AISCommand::getInvCap(std::string& cap)
+{
+ if (gAgent.getRegion())
+ {
+ cap = gAgent.getRegion()->getCapability("InventoryAPIv3");
+ }
+ if (!cap.empty())
+ {
+ return true;
+ }
+ return false;
+}
+
+//static
+bool AISCommand::getLibCap(std::string& cap)
+{
+ if (gAgent.getRegion())
+ {
+ cap = gAgent.getRegion()->getCapability("LibraryAPIv3");
+ }
+ if (!cap.empty())
+ {
+ return true;
+ }
+ return false;
+}
+
+//static
+void AISCommand::getCapabilityNames(LLSD& capabilityNames)
+{
+ capabilityNames.append("InventoryAPIv3");
+ capabilityNames.append("LibraryAPIv3");
+}
+
+RemoveItemCommand::RemoveItemCommand(const LLUUID& item_id,
+ LLPointer<LLInventoryCallback> callback):
+ AISCommand(callback)
+{
+ std::string cap;
+ if (!getInvCap(cap))
+ {
+ LL_WARNS() << "No cap found" << LL_ENDL;
+ return;
+ }
+ std::string url = cap + std::string("/item/") + item_id.asString();
+ LL_DEBUGS("Inventory") << "url: " << url << LL_ENDL;
+ LLHTTPClient::ResponderPtr responder = this;
+ LLSD headers;
+ F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
+ command_func_type cmd = boost::bind(&LLHTTPClient::del, url, responder, headers, timeout);
+ setCommandFunc(cmd);
+}
+
+RemoveCategoryCommand::RemoveCategoryCommand(const LLUUID& item_id,
+ LLPointer<LLInventoryCallback> callback):
+ AISCommand(callback)
+{
+ std::string cap;
+ if (!getInvCap(cap))
+ {
+ LL_WARNS() << "No cap found" << LL_ENDL;
+ return;
+ }
+ std::string url = cap + std::string("/category/") + item_id.asString();
+ LL_DEBUGS("Inventory") << "url: " << url << LL_ENDL;
+ LLHTTPClient::ResponderPtr responder = this;
+ LLSD headers;
+ F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
+ command_func_type cmd = boost::bind(&LLHTTPClient::del, url, responder, headers, timeout);
+ setCommandFunc(cmd);
+}
+
+PurgeDescendentsCommand::PurgeDescendentsCommand(const LLUUID& item_id,
+ LLPointer<LLInventoryCallback> callback):
+ AISCommand(callback)
+{
+ std::string cap;
+ if (!getInvCap(cap))
+ {
+ LL_WARNS() << "No cap found" << LL_ENDL;
+ return;
+ }
+ std::string url = cap + std::string("/category/") + item_id.asString() + "/children";
+ LL_DEBUGS("Inventory") << "url: " << url << LL_ENDL;
+ LLCurl::ResponderPtr responder = this;
+ LLSD headers;
+ F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
+ command_func_type cmd = boost::bind(&LLHTTPClient::del, url, responder, headers, timeout);
+ setCommandFunc(cmd);
+}
+
+UpdateItemCommand::UpdateItemCommand(const LLUUID& item_id,
+ const LLSD& updates,
+ LLPointer<LLInventoryCallback> callback):
+ mUpdates(updates),
+ AISCommand(callback)
+{
+ std::string cap;
+ if (!getInvCap(cap))
+ {
+ LL_WARNS() << "No cap found" << LL_ENDL;
+ return;
+ }
+ std::string url = cap + std::string("/item/") + item_id.asString();
+ LL_DEBUGS("Inventory") << "url: " << url << LL_ENDL;
+ LL_DEBUGS("Inventory") << "request: " << ll_pretty_print_sd(mUpdates) << LL_ENDL;
+ LLCurl::ResponderPtr responder = this;
+ LLSD headers;
+ headers["Content-Type"] = "application/llsd+xml";
+ F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
+ command_func_type cmd = boost::bind(&LLHTTPClient::patch, url, mUpdates, responder, headers, timeout);
+ setCommandFunc(cmd);
+}
+
+UpdateCategoryCommand::UpdateCategoryCommand(const LLUUID& cat_id,
+ const LLSD& updates,
+ LLPointer<LLInventoryCallback> callback):
+ mUpdates(updates),
+ AISCommand(callback)
+{
+ std::string cap;
+ if (!getInvCap(cap))
+ {
+ LL_WARNS() << "No cap found" << LL_ENDL;
+ return;
+ }
+ std::string url = cap + std::string("/category/") + cat_id.asString();
+ LL_DEBUGS("Inventory") << "url: " << url << LL_ENDL;
+ LLCurl::ResponderPtr responder = this;
+ LLSD headers;
+ headers["Content-Type"] = "application/llsd+xml";
+ F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
+ command_func_type cmd = boost::bind(&LLHTTPClient::patch, url, mUpdates, responder, headers, timeout);
+ setCommandFunc(cmd);
+}
+
+CreateInventoryCommand::CreateInventoryCommand(const LLUUID& parent_id,
+ const LLSD& new_inventory,
+ LLPointer<LLInventoryCallback> callback):
+ mNewInventory(new_inventory),
+ AISCommand(callback)
+{
+ std::string cap;
+ if (!getInvCap(cap))
+ {
+ LL_WARNS() << "No cap found" << LL_ENDL;
+ return;
+ }
+ LLUUID tid;
+ tid.generate();
+ std::string url = cap + std::string("/category/") + parent_id.asString() + "?tid=" + tid.asString();
+ LL_DEBUGS("Inventory") << "url: " << url << LL_ENDL;
+ LLCurl::ResponderPtr responder = this;
+ LLSD headers;
+ headers["Content-Type"] = "application/llsd+xml";
+ F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
+ command_func_type cmd = boost::bind(&LLHTTPClient::post, url, mNewInventory, responder, headers, timeout);
+ setCommandFunc(cmd);
+}
+
+SlamFolderCommand::SlamFolderCommand(const LLUUID& folder_id, const LLSD& contents, LLPointer<LLInventoryCallback> callback):
+ mContents(contents),
+ AISCommand(callback)
+{
+ std::string cap;
+ if (!getInvCap(cap))
+ {
+ LL_WARNS() << "No cap found" << LL_ENDL;
+ return;
+ }
+ LLUUID tid;
+ tid.generate();
+ std::string url = cap + std::string("/category/") + folder_id.asString() + "/links?tid=" + tid.asString();
+ LL_INFOS() << url << LL_ENDL;
+ LLCurl::ResponderPtr responder = this;
+ LLSD headers;
+ headers["Content-Type"] = "application/llsd+xml";
+ F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
+ command_func_type cmd = boost::bind(&LLHTTPClient::put, url, mContents, responder, headers, timeout);
+ setCommandFunc(cmd);
+}
+
+CopyLibraryCategoryCommand::CopyLibraryCategoryCommand(const LLUUID& source_id,
+ const LLUUID& dest_id,
+ LLPointer<LLInventoryCallback> callback):
+ AISCommand(callback)
+{
+ std::string cap;
+ if (!getLibCap(cap))
+ {
+ LL_WARNS() << "No cap found" << LL_ENDL;
+ return;
+ }
+ LL_DEBUGS("Inventory") << "Copying library category: " << source_id << " => " << dest_id << LL_ENDL;
+ LLUUID tid;
+ tid.generate();
+ std::string url = cap + std::string("/category/") + source_id.asString() + "?tid=" + tid.asString();
+ LL_INFOS() << url << LL_ENDL;
+ LLCurl::ResponderPtr responder = this;
+ LLSD headers;
+ F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
+ command_func_type cmd = boost::bind(&LLHTTPClient::copy, url, dest_id.asString(), responder, headers, timeout);
+ setCommandFunc(cmd);
+}
+
+bool CopyLibraryCategoryCommand::getResponseUUID(const LLSD& content, LLUUID& id)
+{
+ if (content.has("category_id"))
+ {
+ id = content["category_id"];
+ return true;
+ }
+ return false;
+}
+
+AISUpdate::AISUpdate(const LLSD& update)
+{
+ parseUpdate(update);
+}
+
+void AISUpdate::clearParseResults()
+{
+ mCatDescendentDeltas.clear();
+ mCatDescendentsKnown.clear();
+ mCatVersionsUpdated.clear();
+ mItemsCreated.clear();
+ mItemsUpdated.clear();
+ mCategoriesCreated.clear();
+ mCategoriesUpdated.clear();
+ mObjectsDeletedIds.clear();
+ mItemIds.clear();
+ mCategoryIds.clear();
+}
+
+void AISUpdate::parseUpdate(const LLSD& update)
+{
+ clearParseResults();
+ parseMeta(update);
+ parseContent(update);
+}
+
+void AISUpdate::parseMeta(const LLSD& update)
+{
+ // parse _categories_removed -> mObjectsDeletedIds
+ uuid_list_t cat_ids;
+ parseUUIDArray(update,"_categories_removed",cat_ids);
+ for (uuid_list_t::const_iterator it = cat_ids.begin();
+ it != cat_ids.end(); ++it)
+ {
+ LLViewerInventoryCategory *cat = gInventory.getCategory(*it);
+ if(cat)
+ {
+ mCatDescendentDeltas[cat->getParentUUID()]--;
+ mObjectsDeletedIds.insert(*it);
+ }
+ else
+ {
+ LL_WARNS("Inventory") << "removed category not found " << *it << LL_ENDL;
+ }
+ }
+
+ // parse _categories_items_removed -> mObjectsDeletedIds
+ uuid_list_t item_ids;
+ parseUUIDArray(update,"_category_items_removed",item_ids);
+ parseUUIDArray(update,"_removed_items",item_ids);
+ for (uuid_list_t::const_iterator it = item_ids.begin();
+ it != item_ids.end(); ++it)
+ {
+ LLViewerInventoryItem *item = gInventory.getItem(*it);
+ if(item)
+ {
+ mCatDescendentDeltas[item->getParentUUID()]--;
+ mObjectsDeletedIds.insert(*it);
+ }
+ else
+ {
+ LL_WARNS("Inventory") << "removed item not found " << *it << LL_ENDL;
+ }
+ }
+
+ // parse _broken_links_removed -> mObjectsDeletedIds
+ uuid_list_t broken_link_ids;
+ parseUUIDArray(update,"_broken_links_removed",broken_link_ids);
+ for (uuid_list_t::const_iterator it = broken_link_ids.begin();
+ it != broken_link_ids.end(); ++it)
+ {
+ LLViewerInventoryItem *item = gInventory.getItem(*it);
+ if(item)
+ {
+ mCatDescendentDeltas[item->getParentUUID()]--;
+ mObjectsDeletedIds.insert(*it);
+ }
+ else
+ {
+ LL_WARNS("Inventory") << "broken link not found " << *it << LL_ENDL;
+ }
+ }
+
+ // parse _created_items
+ parseUUIDArray(update,"_created_items",mItemIds);
+
+ // parse _created_categories
+ parseUUIDArray(update,"_created_categories",mCategoryIds);
+
+ // Parse updated category versions.
+ const std::string& ucv = "_updated_category_versions";
+ if (update.has(ucv))
+ {
+ for(LLSD::map_const_iterator it = update[ucv].beginMap(),
+ end = update[ucv].endMap();
+ it != end; ++it)
+ {
+ const LLUUID id((*it).first);
+ S32 version = (*it).second.asInteger();
+ mCatVersionsUpdated[id] = version;
+ }
+ }
+}
+
+void AISUpdate::parseContent(const LLSD& update)
+{
+ if (update.has("linked_id"))
+ {
+ parseLink(update);
+ }
+ else if (update.has("item_id"))
+ {
+ parseItem(update);
+ }
+
+ if (update.has("category_id"))
+ {
+ parseCategory(update);
+ }
+ else
+ {
+ if (update.has("_embedded"))
+ {
+ parseEmbedded(update["_embedded"]);
+ }
+ }
+}
+
+void AISUpdate::parseItem(const LLSD& item_map)
+{
+ LLUUID item_id = item_map["item_id"].asUUID();
+ LLPointer<LLViewerInventoryItem> new_item(new LLViewerInventoryItem);
+ LLViewerInventoryItem *curr_item = gInventory.getItem(item_id);
+ if (curr_item)
+ {
+ // Default to current values where not provided.
+ new_item->copyViewerItem(curr_item);
+ }
+ BOOL rv = new_item->unpackMessage(item_map);
+ if (rv)
+ {
+ if (curr_item)
+ {
+ mItemsUpdated[item_id] = new_item;
+ // This statement is here to cause a new entry with 0
+ // delta to be created if it does not already exist;
+ // otherwise has no effect.
+ mCatDescendentDeltas[new_item->getParentUUID()];
+ }
+ else
+ {
+ mItemsCreated[item_id] = new_item;
+ mCatDescendentDeltas[new_item->getParentUUID()]++;
+ }
+ }
+ else
+ {
+ // *TODO: Wow, harsh. Should we just complain and get out?
+ LL_ERRS() << "unpack failed" << LL_ENDL;
+ }
+}
+
+void AISUpdate::parseLink(const LLSD& link_map)
+{
+ LLUUID item_id = link_map["item_id"].asUUID();
+ LLPointer<LLViewerInventoryItem> new_link(new LLViewerInventoryItem);
+ LLViewerInventoryItem *curr_link = gInventory.getItem(item_id);
+ if (curr_link)
+ {
+ // Default to current values where not provided.
+ new_link->copyViewerItem(curr_link);
+ }
+ BOOL rv = new_link->unpackMessage(link_map);
+ if (rv)
+ {
+ const LLUUID& parent_id = new_link->getParentUUID();
+ if (curr_link)
+ {
+ mItemsUpdated[item_id] = new_link;
+ // This statement is here to cause a new entry with 0
+ // delta to be created if it does not already exist;
+ // otherwise has no effect.
+ mCatDescendentDeltas[parent_id];
+ }
+ else
+ {
+ LLPermissions default_perms;
+ default_perms.init(gAgent.getID(),gAgent.getID(),LLUUID::null,LLUUID::null);
+ default_perms.initMasks(PERM_NONE,PERM_NONE,PERM_NONE,PERM_NONE,PERM_NONE);
+ new_link->setPermissions(default_perms);
+ LLSaleInfo default_sale_info;
+ new_link->setSaleInfo(default_sale_info);
+ //LL_DEBUGS("Inventory") << "creating link from llsd: " << ll_pretty_print_sd(link_map) << LL_ENDL;
+ mItemsCreated[item_id] = new_link;
+ mCatDescendentDeltas[parent_id]++;
+ }
+ }
+ else
+ {
+ // *TODO: Wow, harsh. Should we just complain and get out?
+ LL_ERRS() << "unpack failed" << LL_ENDL;
+ }
+}
+
+
+void AISUpdate::parseCategory(const LLSD& category_map)
+{
+ LLUUID category_id = category_map["category_id"].asUUID();
+
+ // Check descendent count first, as it may be needed
+ // to populate newly created categories
+ if (category_map.has("_embedded"))
+ {
+ parseDescendentCount(category_id, category_map["_embedded"]);
+ }
+
+ LLPointer<LLViewerInventoryCategory> new_cat(new LLViewerInventoryCategory(category_id));
+ LLViewerInventoryCategory *curr_cat = gInventory.getCategory(category_id);
+ if (curr_cat)
+ {
+ // Default to current values where not provided.
+ new_cat->copyViewerCategory(curr_cat);
+ }
+ BOOL rv = new_cat->unpackMessage(category_map);
+ // *NOTE: unpackMessage does not unpack version or descendent count.
+ //if (category_map.has("version"))
+ //{
+ // mCatVersionsUpdated[category_id] = category_map["version"].asInteger();
+ //}
+ if (rv)
+ {
+ if (curr_cat)
+ {
+ mCategoriesUpdated[category_id] = new_cat;
+ // This statement is here to cause a new entry with 0
+ // delta to be created if it does not already exist;
+ // otherwise has no effect.
+ mCatDescendentDeltas[new_cat->getParentUUID()];
+ // Capture update for the category itself as well.
+ mCatDescendentDeltas[category_id];
+ }
+ else
+ {
+ // Set version/descendents for newly created categories.
+ if (category_map.has("version"))
+ {
+ S32 version = category_map["version"].asInteger();
+ LL_DEBUGS("Inventory") << "Setting version to " << version
+ << " for new category " << category_id << LL_ENDL;
+ new_cat->setVersion(version);
+ }
+ uuid_int_map_t::const_iterator lookup_it = mCatDescendentsKnown.find(category_id);
+ if (mCatDescendentsKnown.end() != lookup_it)
+ {
+ S32 descendent_count = lookup_it->second;
+ LL_DEBUGS("Inventory") << "Setting descendents count to " << descendent_count
+ << " for new category " << category_id << LL_ENDL;
+ new_cat->setDescendentCount(descendent_count);
+ }
+ mCategoriesCreated[category_id] = new_cat;
+ mCatDescendentDeltas[new_cat->getParentUUID()]++;
+ }
+ }
+ else
+ {
+ // *TODO: Wow, harsh. Should we just complain and get out?
+ LL_ERRS() << "unpack failed" << LL_ENDL;
+ }
+
+ // Check for more embedded content.
+ if (category_map.has("_embedded"))
+ {
+ parseEmbedded(category_map["_embedded"]);
+ }
+}
+
+void AISUpdate::parseDescendentCount(const LLUUID& category_id, const LLSD& embedded)
+{
+ // We can only determine true descendent count if this contains all descendent types.
+ if (embedded.has("categories") &&
+ embedded.has("links") &&
+ embedded.has("items"))
+ {
+ mCatDescendentsKnown[category_id] = embedded["categories"].size();
+ mCatDescendentsKnown[category_id] += embedded["links"].size();
+ mCatDescendentsKnown[category_id] += embedded["items"].size();
+ }
+}
+
+void AISUpdate::parseEmbedded(const LLSD& embedded)
+{
+ if (embedded.has("links")) // _embedded in a category
+ {
+ parseEmbeddedLinks(embedded["links"]);
+ }
+ if (embedded.has("items")) // _embedded in a category
+ {
+ parseEmbeddedItems(embedded["items"]);
+ }
+ if (embedded.has("item")) // _embedded in a link
+ {
+ parseEmbeddedItem(embedded["item"]);
+ }
+ if (embedded.has("categories")) // _embedded in a category
+ {
+ parseEmbeddedCategories(embedded["categories"]);
+ }
+ if (embedded.has("category")) // _embedded in a link
+ {
+ parseEmbeddedCategory(embedded["category"]);
+ }
+}
+
+void AISUpdate::parseUUIDArray(const LLSD& content, const std::string& name, uuid_list_t& ids)
+{
+ if (content.has(name))
+ {
+ for(LLSD::array_const_iterator it = content[name].beginArray(),
+ end = content[name].endArray();
+ it != end; ++it)
+ {
+ ids.insert((*it).asUUID());
+ }
+ }
+}
+
+void AISUpdate::parseEmbeddedLinks(const LLSD& links)
+{
+ for(LLSD::map_const_iterator linkit = links.beginMap(),
+ linkend = links.endMap();
+ linkit != linkend; ++linkit)
+ {
+ const LLUUID link_id((*linkit).first);
+ const LLSD& link_map = (*linkit).second;
+ if (mItemIds.end() == mItemIds.find(link_id))
+ {
+ LL_DEBUGS("Inventory") << "Ignoring link not in items list " << link_id << LL_ENDL;
+ }
+ else
+ {
+ parseLink(link_map);
+ }
+ }
+}
+
+void AISUpdate::parseEmbeddedItem(const LLSD& item)
+{
+ // a single item (_embedded in a link)
+ if (item.has("item_id"))
+ {
+ if (mItemIds.end() != mItemIds.find(item["item_id"].asUUID()))
+ {
+ parseItem(item);
+ }
+ }
+}
+
+void AISUpdate::parseEmbeddedItems(const LLSD& items)
+{
+ // a map of items (_embedded in a category)
+ for(LLSD::map_const_iterator itemit = items.beginMap(),
+ itemend = items.endMap();
+ itemit != itemend; ++itemit)
+ {
+ const LLUUID item_id((*itemit).first);
+ const LLSD& item_map = (*itemit).second;
+ if (mItemIds.end() == mItemIds.find(item_id))
+ {
+ LL_DEBUGS("Inventory") << "Ignoring item not in items list " << item_id << LL_ENDL;
+ }
+ else
+ {
+ parseItem(item_map);
+ }
+ }
+}
+
+void AISUpdate::parseEmbeddedCategory(const LLSD& category)
+{
+ // a single category (_embedded in a link)
+ if (category.has("category_id"))
+ {
+ if (mCategoryIds.end() != mCategoryIds.find(category["category_id"].asUUID()))
+ {
+ parseCategory(category);
+ }
+ }
+}
+
+void AISUpdate::parseEmbeddedCategories(const LLSD& categories)
+{
+ // a map of categories (_embedded in a category)
+ for(LLSD::map_const_iterator categoryit = categories.beginMap(),
+ categoryend = categories.endMap();
+ categoryit != categoryend; ++categoryit)
+ {
+ const LLUUID category_id((*categoryit).first);
+ const LLSD& category_map = (*categoryit).second;
+ if (mCategoryIds.end() == mCategoryIds.find(category_id))
+ {
+ LL_DEBUGS("Inventory") << "Ignoring category not in categories list " << category_id << LL_ENDL;
+ }
+ else
+ {
+ parseCategory(category_map);
+ }
+ }
+}
+
+void AISUpdate::doUpdate()
+{
+ // Do version/descendent accounting.
+ for (std::map<LLUUID,S32>::const_iterator catit = mCatDescendentDeltas.begin();
+ catit != mCatDescendentDeltas.end(); ++catit)
+ {
+ LL_DEBUGS("Inventory") << "descendent accounting for " << catit->first << LL_ENDL;
+
+ const LLUUID cat_id(catit->first);
+ // Don't account for update if we just created this category.
+ if (mCategoriesCreated.find(cat_id) != mCategoriesCreated.end())
+ {
+ LL_DEBUGS("Inventory") << "Skipping version increment for new category " << cat_id << LL_ENDL;
+ continue;
+ }
+
+ // Don't account for update unless AIS told us it updated that category.
+ if (mCatVersionsUpdated.find(cat_id) == mCatVersionsUpdated.end())
+ {
+ LL_DEBUGS("Inventory") << "Skipping version increment for non-updated category " << cat_id << LL_ENDL;
+ continue;
+ }
+
+ // If we have a known descendent count, set that now.
+ LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
+ if (cat)
+ {
+ S32 descendent_delta = catit->second;
+ S32 old_count = cat->getDescendentCount();
+ LL_DEBUGS("Inventory") << "Updating descendent count for "
+ << cat->getName() << " " << cat_id
+ << " with delta " << descendent_delta << " from "
+ << old_count << " to " << (old_count+descendent_delta) << LL_ENDL;
+ LLInventoryModel::LLCategoryUpdate up(cat_id, descendent_delta);
+ gInventory.accountForUpdate(up);
+ }
+ else
+ {
+ LL_DEBUGS("Inventory") << "Skipping version accounting for unknown category " << cat_id << LL_ENDL;
+ }
+ }
+
+ // CREATE CATEGORIES
+ for (deferred_category_map_t::const_iterator create_it = mCategoriesCreated.begin();
+ create_it != mCategoriesCreated.end(); ++create_it)
+ {
+ LLUUID category_id(create_it->first);
+ LLPointer<LLViewerInventoryCategory> new_category = create_it->second;
+
+ gInventory.updateCategory(new_category, LLInventoryObserver::CREATE);
+ LL_DEBUGS("Inventory") << "created category " << category_id << LL_ENDL;
+ }
+
+ // UPDATE CATEGORIES
+ for (deferred_category_map_t::const_iterator update_it = mCategoriesUpdated.begin();
+ update_it != mCategoriesUpdated.end(); ++update_it)
+ {
+ LLUUID category_id(update_it->first);
+ LLPointer<LLViewerInventoryCategory> new_category = update_it->second;
+ // Since this is a copy of the category *before* the accounting update, above,
+ // we need to transfer back the updated version/descendent count.
+ LLViewerInventoryCategory* curr_cat = gInventory.getCategory(new_category->getUUID());
+ if (!curr_cat)
+ {
+ LL_WARNS("Inventory") << "Failed to update unknown category " << new_category->getUUID() << LL_ENDL;
+ }
+ else
+ {
+ new_category->setVersion(curr_cat->getVersion());
+ new_category->setDescendentCount(curr_cat->getDescendentCount());
+ gInventory.updateCategory(new_category);
+ LL_DEBUGS("Inventory") << "updated category " << new_category->getName() << " " << category_id << LL_ENDL;
+ }
+ }
+
+ // CREATE ITEMS
+ for (deferred_item_map_t::const_iterator create_it = mItemsCreated.begin();
+ create_it != mItemsCreated.end(); ++create_it)
+ {
+ LLUUID item_id(create_it->first);
+ LLPointer<LLViewerInventoryItem> new_item = create_it->second;
+
+ // FIXME risky function since it calls updateServer() in some
+ // cases. Maybe break out the update/create cases, in which
+ // case this is create.
+ LL_DEBUGS("Inventory") << "created item " << item_id << LL_ENDL;
+ gInventory.updateItem(new_item, LLInventoryObserver::CREATE);
+ }
+
+ // UPDATE ITEMS
+ for (deferred_item_map_t::const_iterator update_it = mItemsUpdated.begin();
+ update_it != mItemsUpdated.end(); ++update_it)
+ {
+ LLUUID item_id(update_it->first);
+ LLPointer<LLViewerInventoryItem> new_item = update_it->second;
+ // FIXME risky function since it calls updateServer() in some
+ // cases. Maybe break out the update/create cases, in which
+ // case this is update.
+ LL_DEBUGS("Inventory") << "updated item " << item_id << LL_ENDL;
+ //LL_DEBUGS("Inventory") << ll_pretty_print_sd(new_item->asLLSD()) << LL_ENDL;
+ gInventory.updateItem(new_item);
+ }
+
+ // DELETE OBJECTS
+ for (uuid_list_t::const_iterator del_it = mObjectsDeletedIds.begin();
+ del_it != mObjectsDeletedIds.end(); ++del_it)
+ {
+ LL_DEBUGS("Inventory") << "deleted item " << *del_it << LL_ENDL;
+ gInventory.onObjectDeletedFromServer(*del_it, false, false, false);
+ }
+
+ // TODO - how can we use this version info? Need to be sure all
+ // changes are going through AIS first, or at least through
+ // something with a reliable responder.
+ for (uuid_int_map_t::iterator ucv_it = mCatVersionsUpdated.begin();
+ ucv_it != mCatVersionsUpdated.end(); ++ucv_it)
+ {
+ const LLUUID id = ucv_it->first;
+ S32 version = ucv_it->second;
+ LLViewerInventoryCategory *cat = gInventory.getCategory(id);
+ LL_DEBUGS("Inventory") << "cat version update " << cat->getName() << " to version " << cat->getVersion() << LL_ENDL;
+ if (cat->getVersion() != version)
+ {
+ LL_WARNS() << "Possible version mismatch for category " << cat->getName()
+ << ", viewer version " << cat->getVersion()
+ << " server version " << version << LL_ENDL;
+ }
+ }
+
+ gInventory.notifyObservers();
+}
+
diff --git a/indra/newview/llaisapi.h b/indra/newview/llaisapi.h
new file mode 100755
index 0000000000..5a2ec94af9
--- /dev/null
+++ b/indra/newview/llaisapi.h
@@ -0,0 +1,183 @@
+/**
+ * @file llaisapi.h
+ * @brief classes and functions for interfacing with the v3+ ais inventory service.
+ *
+ * $LicenseInfo:firstyear=2013&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2013, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLAISAPI_H
+#define LL_LLAISAPI_H
+
+#include "lluuid.h"
+#include <map>
+#include <set>
+#include <string>
+#include "llcurl.h"
+#include "llhttpclient.h"
+#include "llhttpretrypolicy.h"
+#include "llviewerinventory.h"
+
+class AISCommand: public LLHTTPClient::Responder
+{
+public:
+ typedef boost::function<void()> command_func_type;
+
+ AISCommand(LLPointer<LLInventoryCallback> callback);
+
+ virtual ~AISCommand() {}
+
+ bool run_command();
+
+ void setCommandFunc(command_func_type command_func);
+
+ // Need to do command-specific parsing to get an id here, for
+ // LLInventoryCallback::fire(). May or may not need to bother,
+ // since most LLInventoryCallbacks do their work in the
+ // destructor.
+
+ /* virtual */ void httpSuccess();
+ /* virtual */ void httpFailure();
+
+ static bool isAPIAvailable();
+ static bool getInvCap(std::string& cap);
+ static bool getLibCap(std::string& cap);
+ static void getCapabilityNames(LLSD& capabilityNames);
+
+protected:
+ virtual bool getResponseUUID(const LLSD& content, LLUUID& id);
+
+private:
+ command_func_type mCommandFunc;
+ LLPointer<LLHTTPRetryPolicy> mRetryPolicy;
+ LLPointer<LLInventoryCallback> mCallback;
+};
+
+class RemoveItemCommand: public AISCommand
+{
+public:
+ RemoveItemCommand(const LLUUID& item_id,
+ LLPointer<LLInventoryCallback> callback);
+};
+
+class RemoveCategoryCommand: public AISCommand
+{
+public:
+ RemoveCategoryCommand(const LLUUID& item_id,
+ LLPointer<LLInventoryCallback> callback);
+};
+
+class PurgeDescendentsCommand: public AISCommand
+{
+public:
+ PurgeDescendentsCommand(const LLUUID& item_id,
+ LLPointer<LLInventoryCallback> callback);
+};
+
+class UpdateItemCommand: public AISCommand
+{
+public:
+ UpdateItemCommand(const LLUUID& item_id,
+ const LLSD& updates,
+ LLPointer<LLInventoryCallback> callback);
+private:
+ LLSD mUpdates;
+};
+
+class UpdateCategoryCommand: public AISCommand
+{
+public:
+ UpdateCategoryCommand(const LLUUID& cat_id,
+ const LLSD& updates,
+ LLPointer<LLInventoryCallback> callback);
+private:
+ LLSD mUpdates;
+};
+
+class SlamFolderCommand: public AISCommand
+{
+public:
+ SlamFolderCommand(const LLUUID& folder_id, const LLSD& contents, LLPointer<LLInventoryCallback> callback);
+
+private:
+ LLSD mContents;
+};
+
+class CopyLibraryCategoryCommand: public AISCommand
+{
+public:
+ CopyLibraryCategoryCommand(const LLUUID& source_id, const LLUUID& dest_id, LLPointer<LLInventoryCallback> callback);
+
+protected:
+ /* virtual */ bool getResponseUUID(const LLSD& content, LLUUID& id);
+};
+
+class CreateInventoryCommand: public AISCommand
+{
+public:
+ CreateInventoryCommand(const LLUUID& parent_id, const LLSD& new_inventory, LLPointer<LLInventoryCallback> callback);
+
+private:
+ LLSD mNewInventory;
+};
+
+class AISUpdate
+{
+public:
+ AISUpdate(const LLSD& update);
+ void parseUpdate(const LLSD& update);
+ void parseMeta(const LLSD& update);
+ void parseContent(const LLSD& update);
+ void parseUUIDArray(const LLSD& content, const std::string& name, uuid_list_t& ids);
+ void parseLink(const LLSD& link_map);
+ void parseItem(const LLSD& link_map);
+ void parseCategory(const LLSD& link_map);
+ void parseDescendentCount(const LLUUID& category_id, const LLSD& embedded);
+ void parseEmbedded(const LLSD& embedded);
+ void parseEmbeddedLinks(const LLSD& links);
+ void parseEmbeddedItems(const LLSD& items);
+ void parseEmbeddedCategories(const LLSD& categories);
+ void parseEmbeddedItem(const LLSD& item);
+ void parseEmbeddedCategory(const LLSD& category);
+ void doUpdate();
+private:
+ void clearParseResults();
+
+ typedef std::map<LLUUID,S32> uuid_int_map_t;
+ uuid_int_map_t mCatDescendentDeltas;
+ uuid_int_map_t mCatDescendentsKnown;
+ uuid_int_map_t mCatVersionsUpdated;
+
+ typedef std::map<LLUUID,LLPointer<LLViewerInventoryItem> > deferred_item_map_t;
+ deferred_item_map_t mItemsCreated;
+ deferred_item_map_t mItemsUpdated;
+ typedef std::map<LLUUID,LLPointer<LLViewerInventoryCategory> > deferred_category_map_t;
+ deferred_category_map_t mCategoriesCreated;
+ deferred_category_map_t mCategoriesUpdated;
+
+ // These keep track of uuid's mentioned in meta values.
+ // Useful for filtering out which content we are interested in.
+ uuid_list_t mObjectsDeletedIds;
+ uuid_list_t mItemIds;
+ uuid_list_t mCategoryIds;
+};
+
+#endif
diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm
index 988058aad3..aad5dbae7d 100644
--- a/indra/newview/llappdelegate-objc.mm
+++ b/indra/newview/llappdelegate-objc.mm
@@ -84,7 +84,7 @@
callWindowUnfocus();
}
-- (NSApplicationDelegateReply) applicationShouldTerminate:(NSApplication *)sender
+- (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication *)sender
{
if (!runMainLoop())
{
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index da1609297e..29534a4382 100755
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -52,6 +52,8 @@
#include "llwearablelist.h"
#include "llsdutil.h"
#include "llsdserialize.h"
+#include "llhttpretrypolicy.h"
+#include "llaisapi.h"
#if LL_MSVC
// disable boost::lexical_cast warning
@@ -148,16 +150,16 @@ LLUUID findDescendentCategoryIDByName(const LLUUID& parent_id, const std::string
item_array,
LLInventoryModel::EXCLUDE_TRASH,
has_name);
- if (0 == cat_array.count())
+ if (0 == cat_array.size())
return LLUUID();
else
{
- LLViewerInventoryCategory *cat = cat_array.get(0);
+ LLViewerInventoryCategory *cat = cat_array.at(0);
if (cat)
return cat->getUUID();
else
{
- llwarns << "null cat" << llendl;
+ LL_WARNS() << "null cat" << LL_ENDL;
return LLUUID();
}
}
@@ -196,7 +198,7 @@ public:
LLEventTimer(5.0)
{
if (!mTrackingPhase.empty())
- {
+ {
selfStartPhase(mTrackingPhase);
}
}
@@ -212,23 +214,22 @@ public:
addItem(item->getUUID());
}
}
-
+
// Request or re-request operation for specified item.
void addItem(const LLUUID& item_id)
{
- LL_DEBUGS("Avatar") << "item_id " << item_id << llendl;
-
+ LL_DEBUGS("Avatar") << "item_id " << item_id << LL_ENDL;
if (!requestOperation(item_id))
{
- LL_DEBUGS("Avatar") << "item_id " << item_id << " requestOperation false, skipping" << llendl;
+ LL_DEBUGS("Avatar") << "item_id " << item_id << " requestOperation false, skipping" << LL_ENDL;
return;
- }
+ }
mPendingRequests++;
// On a re-request, this will reset the timer.
mWaitTimes[item_id] = LLTimer();
if (mRetryCounts.find(item_id) == mRetryCounts.end())
- {
+ {
mRetryCounts[item_id] = 0;
}
else
@@ -242,21 +243,21 @@ public:
void onOp(const LLUUID& src_id, const LLUUID& dst_id, LLTimer timestamp)
{
if (ll_frand() < gSavedSettings.getF32("InventoryDebugSimulateLateOpRate"))
- {
- llwarns << "Simulating late operation by punting handling to later" << llendl;
+ {
+ LL_WARNS() << "Simulating late operation by punting handling to later" << LL_ENDL;
doAfterInterval(boost::bind(&LLCallAfterInventoryBatchMgr::onOp,this,src_id,dst_id,timestamp),
mRetryAfter);
return;
}
mPendingRequests--;
F32 elapsed = timestamp.getElapsedTimeF32();
- LL_DEBUGS("Avatar") << "op done, src_id " << src_id << " dst_id " << dst_id << " after " << elapsed << " seconds" << llendl;
+ LL_DEBUGS("Avatar") << "op done, src_id " << src_id << " dst_id " << dst_id << " after " << elapsed << " seconds" << LL_ENDL;
if (mWaitTimes.find(src_id) == mWaitTimes.end())
{
// No longer waiting for this item - either serviced
// already or gave up after too many retries.
- llwarns << "duplicate or late operation, src_id " << src_id << "dst_id " << dst_id
- << " elapsed " << elapsed << " after end " << (S32) mCompletionOrFailureCalled << llendl;
+ LL_WARNS() << "duplicate or late operation, src_id " << src_id << "dst_id " << dst_id
+ << " elapsed " << elapsed << " after end " << (S32) mCompletionOrFailureCalled << LL_ENDL;
}
mTimeStats.push(elapsed);
mWaitTimes.erase(src_id);
@@ -265,12 +266,12 @@ public:
onCompletionOrFailure();
}
}
-
+
void onCompletionOrFailure()
{
assert (!mCompletionOrFailureCalled);
mCompletionOrFailureCalled = true;
-
+
// Will never call onCompletion() if any item has been flagged as
// a failure - otherwise could wind up with corrupted
// outfit, involuntary nudity, etc.
@@ -288,19 +289,19 @@ public:
onFailure();
}
}
-
+
void onFailure()
{
- llinfos << "failed" << llendl;
+ LL_INFOS() << "failed" << LL_ENDL;
mOnFailureFunc();
}
void onCompletion()
{
- llinfos << "done" << llendl;
+ LL_INFOS() << "done" << LL_ENDL;
mOnCompletionFunc();
}
-
+
// virtual
// Will be deleted after returning true - only safe to do this if all callbacks have fired.
BOOL tick()
@@ -313,31 +314,31 @@ public:
// been serviced, since it will result in this object being
// deleted.
bool all_done = (mPendingRequests==0);
-
+
if (!mWaitTimes.empty())
{
- llwarns << "still waiting on " << mWaitTimes.size() << " items" << llendl;
+ LL_WARNS() << "still waiting on " << mWaitTimes.size() << " items" << LL_ENDL;
for (std::map<LLUUID,LLTimer>::iterator it = mWaitTimes.begin();
it != mWaitTimes.end();)
{
// Use a copy of iterator because it may be erased/invalidated.
std::map<LLUUID,LLTimer>::iterator curr_it = it;
++it;
-
+
F32 time_waited = curr_it->second.getElapsedTimeF32();
S32 retries = mRetryCounts[curr_it->first];
if (time_waited > mRetryAfter)
{
if (retries < mMaxRetries)
- {
+ {
LL_DEBUGS("Avatar") << "Waited " << time_waited <<
- " for " << curr_it->first << ", retrying" << llendl;
+ " for " << curr_it->first << ", retrying" << LL_ENDL;
mRetryCount++;
addItem(curr_it->first);
- }
- else
- {
- llwarns << "Giving up on " << curr_it->first << " after too many retries" << llendl;
+ }
+ else
+ {
+ LL_WARNS() << "Giving up on " << curr_it->first << " after too many retries" << LL_ENDL;
mWaitTimes.erase(curr_it);
mFailCount++;
}
@@ -347,23 +348,23 @@ public:
onCompletionOrFailure();
}
+ }
}
- }
return all_done;
}
void reportStats()
{
- LL_DEBUGS("Avatar") << "Phase: " << mTrackingPhase << llendl;
- LL_DEBUGS("Avatar") << "mFailCount: " << mFailCount << llendl;
- LL_DEBUGS("Avatar") << "mRetryCount: " << mRetryCount << llendl;
- LL_DEBUGS("Avatar") << "Times: n " << mTimeStats.getCount() << " min " << mTimeStats.getMinValue() << " max " << mTimeStats.getMaxValue() << llendl;
- LL_DEBUGS("Avatar") << "Mean " << mTimeStats.getMean() << " stddev " << mTimeStats.getStdDev() << llendl;
+ LL_DEBUGS("Avatar") << "Phase: " << mTrackingPhase << LL_ENDL;
+ LL_DEBUGS("Avatar") << "mFailCount: " << mFailCount << LL_ENDL;
+ LL_DEBUGS("Avatar") << "mRetryCount: " << mRetryCount << LL_ENDL;
+ LL_DEBUGS("Avatar") << "Times: n " << mTimeStats.getCount() << " min " << mTimeStats.getMinValue() << " max " << mTimeStats.getMaxValue() << LL_ENDL;
+ LL_DEBUGS("Avatar") << "Mean " << mTimeStats.getMean() << " stddev " << mTimeStats.getStdDev() << LL_ENDL;
}
-
+
virtual ~LLCallAfterInventoryBatchMgr()
{
- LL_DEBUGS("Avatar") << "deleting" << llendl;
+ LL_DEBUGS("Avatar") << "deleting" << LL_ENDL;
}
protected:
@@ -396,16 +397,22 @@ public:
LLCallAfterInventoryBatchMgr(dst_cat_id, phase_name, on_completion_func, on_failure_func, retry_after, max_retries)
{
addItems(src_items);
+ sInstanceCount++;
}
+ ~LLCallAfterInventoryCopyMgr()
+ {
+ sInstanceCount--;
+ }
+
virtual bool requestOperation(const LLUUID& item_id)
- {
+ {
LLViewerInventoryItem *item = gInventory.getItem(item_id);
llassert(item);
- LL_DEBUGS("Avatar") << "copying item " << item_id << llendl;
+ LL_DEBUGS("Avatar") << "copying item " << item_id << LL_ENDL;
if (ll_frand() < gSavedSettings.getF32("InventoryDebugSimulateOpFailureRate"))
{
- LL_DEBUGS("Avatar") << "simulating failure by not sending request for item " << item_id << llendl;
+ LL_DEBUGS("Avatar") << "simulating failure by not sending request for item " << item_id << LL_ENDL;
return true;
}
copy_inventory_item(
@@ -418,95 +425,86 @@ public:
);
return true;
}
+
+ static S32 getInstanceCount() { return sInstanceCount; }
+
+private:
+ static S32 sInstanceCount;
};
-class LLCallAfterInventoryLinkMgr: public LLCallAfterInventoryBatchMgr
+S32 LLCallAfterInventoryCopyMgr::sInstanceCount = 0;
+
+class LLWearCategoryAfterCopy: public LLInventoryCallback
{
public:
- LLCallAfterInventoryLinkMgr(LLInventoryModel::item_array_t& src_items,
- const LLUUID& dst_cat_id,
- const std::string& phase_name,
- nullary_func_t on_completion_func,
- nullary_func_t on_failure_func = no_op,
- F32 retry_after = DEFAULT_RETRY_AFTER_INTERVAL,
- S32 max_retries = DEFAULT_MAX_RETRIES
- ):
- LLCallAfterInventoryBatchMgr(dst_cat_id, phase_name, on_completion_func, on_failure_func, retry_after, max_retries)
+ LLWearCategoryAfterCopy(bool append):
+ mAppend(append)
+ {}
+
+ // virtual
+ void fire(const LLUUID& id)
{
- addItems(src_items);
+ // Wear the inventory category.
+ LLInventoryCategory* cat = gInventory.getCategory(id);
+ LLAppearanceMgr::instance().wearInventoryCategoryOnAvatar(cat, mAppend);
}
-
- virtual bool requestOperation(const LLUUID& item_id)
- {
- bool request_sent = false;
- LLViewerInventoryItem *item = gInventory.getItem(item_id);
- if (item)
- {
- if (item->getParentUUID() == mDstCatID)
- {
- LL_DEBUGS("Avatar") << "item " << item_id << " name " << item->getName() << " is already a child of " << mDstCatID << llendl;
- return false;
- }
- LL_DEBUGS("Avatar") << "linking item " << item_id << " name " << item->getName() << " to " << mDstCatID << llendl;
- // create an inventory item link.
- if (ll_frand() < gSavedSettings.getF32("InventoryDebugSimulateOpFailureRate"))
- {
- LL_DEBUGS("Avatar") << "simulating failure by not sending request for item " << item_id << llendl;
- return true;
- }
- link_inventory_item(gAgent.getID(),
- item->getLinkedUUID(),
- mDstCatID,
- item->getName(),
- item->getActualDescription(),
- LLAssetType::AT_LINK,
- new LLBoostFuncInventoryCallback(
- boost::bind(&LLCallAfterInventoryBatchMgr::onOp,this,item_id,_1,LLTimer())));
- return true;
- }
- else
- {
- // create a base outfit link if appropriate.
- LLViewerInventoryCategory *catp = gInventory.getCategory(item_id);
- if (!catp)
- {
- llwarns << "link request failed, id not found as inventory item or category " << item_id << llendl;
- return false;
- }
- const LLUUID cof = LLAppearanceMgr::instance().getCOF();
- std::string new_outfit_name = "";
- LLAppearanceMgr::instance().purgeBaseOutfitLink(cof);
+private:
+ bool mAppend;
+};
- if (catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT)
+class LLTrackPhaseWrapper : public LLInventoryCallback
+{
+public:
+ LLTrackPhaseWrapper(const std::string& phase_name, LLPointer<LLInventoryCallback> cb = NULL):
+ mTrackingPhase(phase_name),
+ mCB(cb)
{
- if (ll_frand() < gSavedSettings.getF32("InventoryDebugSimulateOpFailureRate"))
+ selfStartPhase(mTrackingPhase);
+ }
+
+ // virtual
+ void fire(const LLUUID& id)
+ {
+ if (mCB)
{
- LL_DEBUGS("Avatar") << "simulating failure by not sending request for item " << item_id << llendl;
- return true;
- }
- LL_DEBUGS("Avatar") << "linking folder " << item_id << " name " << catp->getName() << " to cof " << cof << llendl;
- link_inventory_item(gAgent.getID(), item_id, cof, catp->getName(), "",
- LLAssetType::AT_LINK_FOLDER,
- new LLBoostFuncInventoryCallback(
- boost::bind(&LLCallAfterInventoryBatchMgr::onOp,this,item_id,_1,LLTimer())));
- new_outfit_name = catp->getName();
- request_sent = true;
- }
-
- LLAppearanceMgr::instance().updatePanelOutfitName(new_outfit_name);
+ mCB->fire(id);
}
- return request_sent;
}
+
+ // virtual
+ ~LLTrackPhaseWrapper()
+ {
+ selfStopPhase(mTrackingPhase);
+ }
+
+protected:
+ std::string mTrackingPhase;
+ LLPointer<LLInventoryCallback> mCB;
};
-LLUpdateAppearanceOnDestroy::LLUpdateAppearanceOnDestroy(bool update_base_outfit_ordering):
+LLUpdateAppearanceOnDestroy::LLUpdateAppearanceOnDestroy(bool enforce_item_restrictions,
+ bool enforce_ordering,
+ nullary_func_t post_update_func
+ ):
mFireCount(0),
- mUpdateBaseOrder(update_base_outfit_ordering)
+ mEnforceItemRestrictions(enforce_item_restrictions),
+ mEnforceOrdering(enforce_ordering),
+ mPostUpdateFunc(post_update_func)
{
selfStartPhase("update_appearance_on_destroy");
}
+void LLUpdateAppearanceOnDestroy::fire(const LLUUID& inv_item)
+{
+ LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(inv_item);
+ const std::string item_name = item ? item->getName() : "ITEM NOT FOUND";
+#ifndef LL_RELEASE_FOR_DOWNLOAD
+ LL_DEBUGS("Avatar") << self_av_string() << "callback fired [ name:" << item_name << " UUID:" << inv_item << " count:" << mFireCount << " ] " << LL_ENDL;
+#endif
+ mFireCount++;
+}
+
LLUpdateAppearanceOnDestroy::~LLUpdateAppearanceOnDestroy()
{
if (!LLApp::isExiting())
@@ -516,20 +514,46 @@ LLUpdateAppearanceOnDestroy::~LLUpdateAppearanceOnDestroy()
selfStopPhase("update_appearance_on_destroy");
- LLAppearanceMgr::instance().updateAppearanceFromCOF(mUpdateBaseOrder);
+ LLAppearanceMgr::instance().updateAppearanceFromCOF(mEnforceItemRestrictions,
+ mEnforceOrdering,
+ mPostUpdateFunc);
}
}
-void LLUpdateAppearanceOnDestroy::fire(const LLUUID& inv_item)
+LLUpdateAppearanceAndEditWearableOnDestroy::LLUpdateAppearanceAndEditWearableOnDestroy(const LLUUID& item_id):
+ mItemID(item_id)
{
- LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(inv_item);
- const std::string item_name = item ? item->getName() : "ITEM NOT FOUND";
-#ifndef LL_RELEASE_FOR_DOWNLOAD
- LL_DEBUGS("Avatar") << self_av_string() << "callback fired [ name:" << item_name << " UUID:" << inv_item << " count:" << mFireCount << " ] " << LL_ENDL;
-#endif
- mFireCount++;
}
+void edit_wearable_and_customize_avatar(LLUUID item_id)
+{
+ // Start editing the item if previously requested.
+ gAgentWearables.editWearableIfRequested(item_id);
+
+ // TODO: camera mode may not be changed if a debug setting is tweaked
+ if( gAgentCamera.cameraCustomizeAvatar() )
+ {
+ // If we're in appearance editing mode, the current tab may need to be refreshed
+ LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>(
+ LLFloaterSidePanelContainer::getPanel("appearance"));
+ if (panel)
+ {
+ panel->showDefaultSubpart();
+ }
+ }
+}
+
+LLUpdateAppearanceAndEditWearableOnDestroy::~LLUpdateAppearanceAndEditWearableOnDestroy()
+{
+ if (!LLApp::isExiting())
+ {
+ LLAppearanceMgr::instance().updateAppearanceFromCOF(
+ true,true,
+ boost::bind(edit_wearable_and_customize_avatar, mItemID));
+ }
+}
+
+
struct LLFoundData
{
LLFoundData() :
@@ -593,6 +617,8 @@ public:
bool isMostRecent();
void handleLateArrivals();
void resetTime(F32 timeout);
+ static S32 countActive() { return sActiveHoldingPatterns.size(); }
+ S32 index() { return mIndex; }
private:
found_list_t mFoundList;
@@ -606,12 +632,15 @@ private:
bool mFired;
typedef std::set<LLWearableHoldingPattern*> type_set_hp;
static type_set_hp sActiveHoldingPatterns;
+ static S32 sNextIndex;
+ S32 mIndex;
bool mIsMostRecent;
std::set<LLViewerWearable*> mLateArrivals;
bool mIsAllComplete;
};
LLWearableHoldingPattern::type_set_hp LLWearableHoldingPattern::sActiveHoldingPatterns;
+S32 LLWearableHoldingPattern::sNextIndex = 0;
LLWearableHoldingPattern::LLWearableHoldingPattern():
mResolved(0),
@@ -619,13 +648,13 @@ LLWearableHoldingPattern::LLWearableHoldingPattern():
mIsMostRecent(true),
mIsAllComplete(false)
{
- if (sActiveHoldingPatterns.size()>0)
+ if (countActive()>0)
{
- llinfos << "Creating LLWearableHoldingPattern when "
- << sActiveHoldingPatterns.size()
- << " other attempts are active."
- << " Flagging others as invalid."
- << llendl;
+ LL_INFOS() << "Creating LLWearableHoldingPattern when "
+ << countActive()
+ << " other attempts are active."
+ << " Flagging others as invalid."
+ << LL_ENDL;
for (type_set_hp::iterator it = sActiveHoldingPatterns.begin();
it != sActiveHoldingPatterns.end();
++it)
@@ -634,7 +663,9 @@ LLWearableHoldingPattern::LLWearableHoldingPattern():
}
}
+ mIndex = sNextIndex++;
sActiveHoldingPatterns.insert(this);
+ LL_DEBUGS("Avatar") << "HP " << index() << " created" << LL_ENDL;
selfStartPhase("holding_pattern");
}
@@ -645,6 +676,7 @@ LLWearableHoldingPattern::~LLWearableHoldingPattern()
{
selfStopPhase("holding_pattern");
}
+ LL_DEBUGS("Avatar") << "HP " << index() << " deleted" << LL_ENDL;
}
bool LLWearableHoldingPattern::isMostRecent()
@@ -692,7 +724,7 @@ void LLWearableHoldingPattern::checkMissingWearables()
if (!isMostRecent())
{
// runway why don't we actually skip here?
- llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl;
+ LL_WARNS() << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << LL_ENDL;
}
std::vector<S32> found_by_type(LLWearableType::WT_COUNT,0);
@@ -710,7 +742,7 @@ void LLWearableHoldingPattern::checkMissingWearables()
{
if (requested_by_type[type] > found_by_type[type])
{
- llwarns << self_av_string() << "got fewer wearables than requested, type " << type << ": requested " << requested_by_type[type] << ", found " << found_by_type[type] << llendl;
+ LL_WARNS() << self_av_string() << "got fewer wearables than requested, type " << type << ": requested " << requested_by_type[type] << ", found " << found_by_type[type] << LL_ENDL;
}
if (found_by_type[type] > 0)
continue;
@@ -727,13 +759,16 @@ void LLWearableHoldingPattern::checkMissingWearables()
mTypesToRecover.insert(type);
mTypesToLink.insert(type);
recoverMissingWearable((LLWearableType::EType)type);
- llwarns << self_av_string() << "need to replace " << type << llendl;
+ LL_WARNS() << self_av_string() << "need to replace " << type << LL_ENDL;
}
}
resetTime(60.0F);
- selfStartPhase("get_missing_wearables");
+ if (isMostRecent())
+ {
+ selfStartPhase("get_missing_wearables_2");
+ }
if (!pollMissingWearables())
{
doOnIdleRepeating(boost::bind(&LLWearableHoldingPattern::pollMissingWearables,this));
@@ -750,13 +785,13 @@ void LLWearableHoldingPattern::onAllComplete()
if (!isMostRecent())
{
// runway need to skip here?
- llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl;
+ LL_WARNS() << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << LL_ENDL;
}
// Activate all gestures in this folder
- if (mGestItems.count() > 0)
+ if (mGestItems.size() > 0)
{
- LL_DEBUGS("Avatar") << self_av_string() << "Activating " << mGestItems.count() << " gestures" << LL_ENDL;
+ LL_DEBUGS("Avatar") << self_av_string() << "Activating " << mGestItems.size() << " gestures" << LL_ENDL;
LLGestureMgr::instance().activateGestures(mGestItems);
@@ -773,13 +808,13 @@ void LLWearableHoldingPattern::onAllComplete()
}
// Update wearables.
- LL_INFOS("Avatar") << self_av_string() << "Updating agent wearables with " << mResolved << " wearable items " << LL_ENDL;
- LLAppearanceMgr::instance().updateAgentWearables(this, false);
+ LL_INFOS("Avatar") << self_av_string() << "HP " << index() << " updating agent wearables with " << mResolved << " wearable items " << LL_ENDL;
+ LLAppearanceMgr::instance().updateAgentWearables(this);
// Update attachments to match those requested.
if (isAgentAvatarValid())
{
- LL_DEBUGS("Avatar") << self_av_string() << "Updating " << mObjItems.count() << " attachments" << LL_ENDL;
+ LL_DEBUGS("Avatar") << self_av_string() << "Updating " << mObjItems.size() << " attachments" << LL_ENDL;
LLAgentWearables::userUpdateAttachments(mObjItems);
}
@@ -797,12 +832,15 @@ void LLWearableHoldingPattern::onAllComplete()
void LLWearableHoldingPattern::onFetchCompletion()
{
- selfStopPhase("get_wearables");
+ if (isMostRecent())
+ {
+ selfStopPhase("get_wearables_2");
+ }
if (!isMostRecent())
{
// runway skip here?
- llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl;
+ LL_WARNS() << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << LL_ENDL;
}
checkMissingWearables();
@@ -814,7 +852,7 @@ bool LLWearableHoldingPattern::pollFetchCompletion()
if (!isMostRecent())
{
// runway skip here?
- llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl;
+ LL_WARNS() << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << LL_ENDL;
}
bool completed = isFetchCompleted();
@@ -823,14 +861,14 @@ bool LLWearableHoldingPattern::pollFetchCompletion()
if (done)
{
- LL_INFOS("Avatar") << self_av_string() << "polling, done status: " << completed << " timed out " << timed_out
+ LL_INFOS("Avatar") << self_av_string() << "HP " << index() << " polling, done status: " << completed << " timed out " << timed_out
<< " elapsed " << mWaitTime.getElapsedTimeF32() << LL_ENDL;
mFired = true;
if (timed_out)
{
- llwarns << self_av_string() << "Exceeded max wait time for wearables, updating appearance based on what has arrived" << llendl;
+ LL_WARNS() << self_av_string() << "Exceeded max wait time for wearables, updating appearance based on what has arrived" << LL_ENDL;
}
onFetchCompletion();
@@ -841,82 +879,77 @@ bool LLWearableHoldingPattern::pollFetchCompletion()
void recovered_item_link_cb(const LLUUID& item_id, LLWearableType::EType type, LLViewerWearable *wearable, LLWearableHoldingPattern* holder)
{
if (!holder->isMostRecent())
- {
- llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl;
- // runway skip here?
- }
+ {
+ LL_WARNS() << "HP " << holder->index() << " skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << LL_ENDL;
+ // runway skip here?
+ }
- llinfos << "Recovered item link for type " << type << llendl;
+ LL_INFOS() << "HP " << holder->index() << " recovered item link for type " << type << LL_ENDL;
holder->eraseTypeToLink(type);
- // Add wearable to FoundData for actual wearing
- LLViewerInventoryItem *item = gInventory.getItem(item_id);
- LLViewerInventoryItem *linked_item = item ? item->getLinkedItem() : NULL;
+ // Add wearable to FoundData for actual wearing
+ LLViewerInventoryItem *item = gInventory.getItem(item_id);
+ LLViewerInventoryItem *linked_item = item ? item->getLinkedItem() : NULL;
- if (linked_item)
- {
- gInventory.addChangedMask(LLInventoryObserver::LABEL, linked_item->getUUID());
+ if (linked_item)
+ {
+ gInventory.addChangedMask(LLInventoryObserver::LABEL, linked_item->getUUID());
- if (item)
- {
- LLFoundData found(linked_item->getUUID(),
- linked_item->getAssetUUID(),
- linked_item->getName(),
- linked_item->getType(),
- linked_item->isWearableType() ? linked_item->getWearableType() : LLWearableType::WT_INVALID,
- true // is replacement
- );
+ if (item)
+ {
+ LLFoundData found(linked_item->getUUID(),
+ linked_item->getAssetUUID(),
+ linked_item->getName(),
+ linked_item->getType(),
+ linked_item->isWearableType() ? linked_item->getWearableType() : LLWearableType::WT_INVALID,
+ true // is replacement
+ );
found.mWearable = wearable;
holder->getFoundList().push_front(found);
- }
- else
- {
- llwarns << self_av_string() << "inventory item not found for recovered wearable" << llendl;
- }
}
else
{
- llwarns << self_av_string() << "inventory link not found for recovered wearable" << llendl;
+ LL_WARNS() << self_av_string() << "inventory link not found for recovered wearable" << LL_ENDL;
}
}
+ else
+ {
+ LL_WARNS() << self_av_string() << "HP " << holder->index() << " inventory link not found for recovered wearable" << LL_ENDL;
+ }
+}
void recovered_item_cb(const LLUUID& item_id, LLWearableType::EType type, LLViewerWearable *wearable, LLWearableHoldingPattern* holder)
{
if (!holder->isMostRecent())
- {
- // runway skip here?
- llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl;
- }
+ {
+ // runway skip here?
+ LL_WARNS() << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << LL_ENDL;
+ }
LL_DEBUGS("Avatar") << self_av_string() << "Recovered item for type " << type << LL_ENDL;
- LLViewerInventoryItem *itemp = gInventory.getItem(item_id);
+ LLConstPointer<LLInventoryObject> itemp = gInventory.getItem(item_id);
wearable->setItemID(item_id);
- LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(recovered_item_link_cb,_1,type,wearable,holder));
holder->eraseTypeToRecover(type);
- llassert(itemp);
- if (itemp)
- {
- link_inventory_item( gAgent.getID(),
- item_id,
- LLAppearanceMgr::instance().getCOF(),
- itemp->getName(),
- itemp->getDescription(),
- LLAssetType::AT_LINK,
- cb);
- }
+ llassert(itemp);
+ if (itemp)
+ {
+ LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(recovered_item_link_cb,_1,type,wearable,holder));
+
+ link_inventory_object(LLAppearanceMgr::instance().getCOF(), itemp, cb);
}
+}
void LLWearableHoldingPattern::recoverMissingWearable(LLWearableType::EType type)
{
if (!isMostRecent())
{
// runway skip here?
- llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl;
+ LL_WARNS() << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << LL_ENDL;
}
// Try to recover by replacing missing wearable with a new one.
LLNotificationsUtil::add("ReplacedMissingWearable");
- lldebugs << "Wearable " << LLWearableType::getTypeLabel(type)
- << " could not be downloaded. Replaced inventory item with default wearable." << llendl;
+ LL_DEBUGS() << "Wearable " << LLWearableType::getTypeLabel(type)
+ << " could not be downloaded. Replaced inventory item with default wearable." << LL_ENDL;
LLViewerWearable* wearable = LLWearableList::instance().createNewWearable(type, gAgentAvatarp);
// Add a new one in the lost and found folder.
@@ -949,7 +982,7 @@ void LLWearableHoldingPattern::clearCOFLinksForMissingWearables()
if ((data.mWearableType < LLWearableType::WT_COUNT) && (!data.mWearable))
{
// Wearable link that was never resolved; remove links to it from COF
- LL_INFOS("Avatar") << self_av_string() << "removing link for unresolved item " << data.mItemID.asString() << LL_ENDL;
+ LL_INFOS("Avatar") << self_av_string() << "HP " << index() << " removing link for unresolved item " << data.mItemID.asString() << LL_ENDL;
LLAppearanceMgr::instance().removeCOFItemLinks(data.mItemID);
}
}
@@ -960,7 +993,7 @@ bool LLWearableHoldingPattern::pollMissingWearables()
if (!isMostRecent())
{
// runway skip here?
- llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl;
+ LL_WARNS() << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << LL_ENDL;
}
bool timed_out = isTimedOut();
@@ -969,7 +1002,7 @@ bool LLWearableHoldingPattern::pollMissingWearables()
if (!done)
{
- LL_INFOS("Avatar") << self_av_string() << "polling missing wearables, waiting for items " << mTypesToRecover.size()
+ LL_INFOS("Avatar") << self_av_string() << "HP " << index() << " polling missing wearables, waiting for items " << mTypesToRecover.size()
<< " links " << mTypesToLink.size()
<< " wearables, timed out " << timed_out
<< " elapsed " << mWaitTime.getElapsedTimeF32()
@@ -978,7 +1011,10 @@ bool LLWearableHoldingPattern::pollMissingWearables()
if (done)
{
- selfStopPhase("get_missing_wearables");
+ if (isMostRecent())
+ {
+ selfStopPhase("get_missing_wearables_2");
+ }
gAgentAvatarp->debugWearablesLoaded();
@@ -1009,14 +1045,14 @@ void LLWearableHoldingPattern::handleLateArrivals()
}
if (!isMostRecent())
{
- llwarns << self_av_string() << "Late arrivals not handled - outfit change no longer valid" << llendl;
+ LL_WARNS() << self_av_string() << "Late arrivals not handled - outfit change no longer valid" << LL_ENDL;
}
if (!mIsAllComplete)
{
- llwarns << self_av_string() << "Late arrivals not handled - in middle of missing wearables processing" << llendl;
+ LL_WARNS() << self_av_string() << "Late arrivals not handled - in middle of missing wearables processing" << LL_ENDL;
}
- LL_INFOS("Avatar") << self_av_string() << "Need to handle " << mLateArrivals.size() << " late arriving wearables" << LL_ENDL;
+ LL_INFOS("Avatar") << self_av_string() << "HP " << index() << " need to handle " << mLateArrivals.size() << " late arriving wearables" << LL_ENDL;
// Update mFoundList using late-arriving wearables.
std::set<LLWearableType::EType> replaced_types;
@@ -1079,7 +1115,7 @@ void LLWearableHoldingPattern::handleLateArrivals()
mLateArrivals.clear();
// Update appearance based on mFoundList
- LLAppearanceMgr::instance().updateAgentWearables(this, false);
+ LLAppearanceMgr::instance().updateAgentWearables(this);
}
void LLWearableHoldingPattern::resetTime(F32 timeout)
@@ -1092,19 +1128,19 @@ void LLWearableHoldingPattern::onWearableAssetFetch(LLViewerWearable *wearable)
{
if (!isMostRecent())
{
- llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl;
+ LL_WARNS() << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << LL_ENDL;
}
mResolved += 1; // just counting callbacks, not successes.
- LL_DEBUGS("Avatar") << self_av_string() << "resolved " << mResolved << "/" << getFoundList().size() << LL_ENDL;
+ LL_DEBUGS("Avatar") << self_av_string() << "HP " << index() << " resolved " << mResolved << "/" << getFoundList().size() << LL_ENDL;
if (!wearable)
{
- llwarns << self_av_string() << "no wearable found" << llendl;
+ LL_WARNS() << self_av_string() << "no wearable found" << LL_ENDL;
}
if (mFired)
{
- llwarns << self_av_string() << "called after holder fired" << llendl;
+ LL_WARNS() << self_av_string() << "called after holder fired" << LL_ENDL;
if (wearable)
{
mLateArrivals.insert(wearable);
@@ -1130,7 +1166,7 @@ void LLWearableHoldingPattern::onWearableAssetFetch(LLViewerWearable *wearable)
// Failing this means inventory or asset server are corrupted in a way we don't handle.
if ((data.mWearableType >= LLWearableType::WT_COUNT) || (wearable->getType() != data.mWearableType))
{
- llwarns << self_av_string() << "recovered wearable but type invalid. inventory wearable type: " << data.mWearableType << " asset wearable type: " << wearable->getType() << llendl;
+ LL_WARNS() << self_av_string() << "recovered wearable but type invalid. inventory wearable type: " << data.mWearableType << " asset wearable type: " << wearable->getType() << LL_ENDL;
break;
}
@@ -1155,9 +1191,9 @@ static void removeDuplicateItems(LLInventoryModel::item_array_t& items)
// encountered, so we actually keep the *last* of each duplicate
// item. This is needed to give the right priority when adding
// duplicate items to an existing outfit.
- for (S32 i=items.count()-1; i>=0; i--)
+ for (S32 i=items.size()-1; i>=0; i--)
{
- LLViewerInventoryItem *item = items.get(i);
+ LLViewerInventoryItem *item = items.at(i);
LLUUID item_id = item->getLinkedUUID();
if (items_seen.find(item_id)!=items_seen.end())
continue;
@@ -1168,7 +1204,7 @@ static void removeDuplicateItems(LLInventoryModel::item_array_t& items)
it != tmp_list.end();
++it)
{
- new_items.put(*it);
+ new_items.push_back(*it);
}
items = new_items;
}
@@ -1203,8 +1239,7 @@ const LLViewerInventoryItem* LLAppearanceMgr::getBaseOutfitLink()
cat_array,
item_array,
false,
- is_category,
- false);
+ is_category);
for (LLInventoryModel::item_array_t::const_iterator iter = item_array.begin();
iter != item_array.end();
iter++)
@@ -1251,7 +1286,7 @@ const LLUUID LLAppearanceMgr::getBaseOutfitUUID()
if (outfit_cat->getPreferredType() != LLFolderType::FT_OUTFIT)
{
- llwarns << "Expected outfit type:" << LLFolderType::FT_OUTFIT << " but got type:" << outfit_cat->getType() << " for folder name:" << outfit_cat->getName() << llendl;
+ LL_WARNS() << "Expected outfit type:" << LLFolderType::FT_OUTFIT << " but got type:" << outfit_cat->getType() << " for folder name:" << outfit_cat->getName() << LL_ENDL;
return LLUUID::null;
}
@@ -1270,8 +1305,12 @@ void wear_on_avatar_cb(const LLUUID& inv_item, bool do_replace = false)
}
}
-bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_update, bool replace, LLPointer<LLInventoryCallback> cb)
+bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear,
+ bool do_update,
+ bool replace,
+ LLPointer<LLInventoryCallback> cb)
{
+
if (item_id_to_wear.isNull()) return false;
// *TODO: issue with multi-wearable should be fixed:
@@ -1290,7 +1329,7 @@ bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_up
if (gInventory.isObjectDescendentOf(item_to_wear->getUUID(), gInventory.getLibraryRootFolderID()))
{
LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(wear_on_avatar_cb,_1,replace));
- copy_inventory_item(gAgent.getID(), item_to_wear->getPermissions().getOwner(), item_to_wear->getUUID(), LLUUID::null, std::string(),cb);
+ copy_inventory_item(gAgent.getID(), item_to_wear->getPermissions().getOwner(), item_to_wear->getUUID(), LLUUID::null, std::string(), cb);
return false;
}
else if (!gInventory.isObjectDescendentOf(item_to_wear->getUUID(), gInventory.getRootFolderID()))
@@ -1302,38 +1341,51 @@ bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_up
LLNotificationsUtil::add("CannotWearTrash");
return false;
}
- else if (gInventory.isObjectDescendentOf(item_to_wear->getUUID(), LLAppearanceMgr::instance().getCOF())) // EXT-84911
+ else if (isLinkedInCOF(item_to_wear->getUUID())) // EXT-84911
{
return false;
}
switch (item_to_wear->getType())
{
- case LLAssetType::AT_CLOTHING:
+ case LLAssetType::AT_CLOTHING:
if (gAgentWearables.areWearablesLoaded())
{
+ if (!cb && do_update)
+ {
+ cb = new LLUpdateAppearanceAndEditWearableOnDestroy(item_id_to_wear);
+ }
S32 wearable_count = gAgentWearables.getWearableCount(item_to_wear->getWearableType());
if ((replace && wearable_count != 0) ||
(wearable_count >= LLAgentWearables::MAX_CLOTHING_PER_TYPE) )
{
- removeCOFItemLinks(gAgentWearables.getWearableItemID(item_to_wear->getWearableType(), wearable_count-1));
+ LLUUID item_id = gAgentWearables.getWearableItemID(item_to_wear->getWearableType(),
+ wearable_count-1);
+ removeCOFItemLinks(item_id, cb);
}
- addCOFItemLink(item_to_wear, do_update, cb);
+
+ addCOFItemLink(item_to_wear, cb);
}
break;
- case LLAssetType::AT_BODYPART:
+
+ case LLAssetType::AT_BODYPART:
// TODO: investigate wearables may not be loaded at this point EXT-8231
// Remove the existing wearables of the same type.
// Remove existing body parts anyway because we must not be able to wear e.g. two skins.
removeCOFLinksOfType(item_to_wear->getWearableType());
-
- addCOFItemLink(item_to_wear, do_update, cb);
+ if (!cb && do_update)
+ {
+ cb = new LLUpdateAppearanceAndEditWearableOnDestroy(item_id_to_wear);
+ }
+ addCOFItemLink(item_to_wear, cb);
break;
- case LLAssetType::AT_OBJECT:
+
+ case LLAssetType::AT_OBJECT:
rez_attachment(item_to_wear, NULL, replace);
break;
- default: return false;;
+
+ default: return false;;
}
return true;
@@ -1431,6 +1483,18 @@ void LLAppearanceMgr::takeOffOutfit(const LLUUID& cat_id)
uuids_to_remove.push_back(item->getUUID());
}
removeItemsFromAvatar(uuids_to_remove);
+
+ // deactivate all gestures in the outfit folder
+ LLInventoryModel::item_array_t gest_items;
+ getDescendentsOfAssetType(cat_id, gest_items, LLAssetType::AT_GESTURE);
+ for(S32 i = 0; i < gest_items.size(); ++i)
+ {
+ LLViewerInventoryItem *gest_item = gest_items[i];
+ if ( LLGestureMgr::instance().isGestureActive( gest_item->getLinkedUUID()) )
+ {
+ LLGestureMgr::instance().deactivateGesture( gest_item->getLinkedUUID() );
+ }
+ }
}
// Create a copy of src_id + contents as a subfolder of dst_id.
@@ -1440,10 +1504,10 @@ void LLAppearanceMgr::shallowCopyCategory(const LLUUID& src_id, const LLUUID& ds
LLInventoryCategory *src_cat = gInventory.getCategory(src_id);
if (!src_cat)
{
- llwarns << "folder not found for src " << src_id.asString() << llendl;
+ LL_WARNS() << "folder not found for src " << src_id.asString() << LL_ENDL;
return;
}
- llinfos << "starting, src_id " << src_id << " name " << src_cat->getName() << " dst_id " << dst_id << llendl;
+ LL_INFOS() << "starting, src_id " << src_id << " name " << src_cat->getName() << " dst_id " << dst_id << LL_ENDL;
LLUUID parent_id = dst_id;
if(parent_id.isNull())
{
@@ -1457,6 +1521,58 @@ void LLAppearanceMgr::shallowCopyCategory(const LLUUID& src_id, const LLUUID& ds
gInventory.notifyObservers();
}
+void LLAppearanceMgr::slamCategoryLinks(const LLUUID& src_id, const LLUUID& dst_id,
+ bool include_folder_links, LLPointer<LLInventoryCallback> cb)
+{
+ LLInventoryModel::cat_array_t* cats;
+ LLInventoryModel::item_array_t* items;
+ LLSD contents = LLSD::emptyArray();
+ gInventory.getDirectDescendentsOf(src_id, cats, items);
+ LL_INFOS() << "copying " << items->size() << " items" << LL_ENDL;
+ for (LLInventoryModel::item_array_t::const_iterator iter = items->begin();
+ iter != items->end();
+ ++iter)
+ {
+ const LLViewerInventoryItem* item = (*iter);
+ switch (item->getActualType())
+ {
+ case LLAssetType::AT_LINK:
+ {
+ LL_DEBUGS("Avatar") << "linking inventory item " << item->getName() << LL_ENDL;
+ //getActualDescription() is used for a new description
+ //to propagate ordering information saved in descriptions of links
+ LLSD item_contents;
+ item_contents["name"] = item->getName();
+ item_contents["desc"] = item->getActualDescription();
+ item_contents["linked_id"] = item->getLinkedUUID();
+ item_contents["type"] = LLAssetType::AT_LINK;
+ contents.append(item_contents);
+ break;
+ }
+ case LLAssetType::AT_LINK_FOLDER:
+ {
+ LLViewerInventoryCategory *catp = item->getLinkedCategory();
+ if (catp && include_folder_links)
+ {
+ LL_DEBUGS("Avatar") << "linking inventory folder " << item->getName() << LL_ENDL;
+ LLSD base_contents;
+ base_contents["name"] = catp->getName();
+ base_contents["desc"] = ""; // categories don't have descriptions.
+ base_contents["linked_id"] = catp->getLinkedUUID();
+ base_contents["type"] = LLAssetType::AT_LINK_FOLDER;
+ contents.append(base_contents);
+ }
+ break;
+ }
+ default:
+ {
+ // Linux refuses to compile unless all possible enums are handled. Really, Linux?
+ break;
+ }
+ }
+ }
+ slam_inventory_folder(dst_id, contents, cb);
+}
// Copy contents of src_id to dst_id.
void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LLUUID& dst_id,
LLPointer<LLInventoryCallback> cb)
@@ -1464,7 +1580,8 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL
LLInventoryModel::cat_array_t* cats;
LLInventoryModel::item_array_t* items;
gInventory.getDirectDescendentsOf(src_id, cats, items);
- llinfos << "copying " << items->count() << " items" << llendl;
+ LL_INFOS() << "copying " << items->size() << " items" << LL_ENDL;
+ LLInventoryObject::const_object_list_t link_array;
for (LLInventoryModel::item_array_t::const_iterator iter = items->begin();
iter != items->end();
++iter)
@@ -1474,14 +1591,8 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL
{
case LLAssetType::AT_LINK:
{
- //getActualDescription() is used for a new description
- //to propagate ordering information saved in descriptions of links
- link_inventory_item(gAgent.getID(),
- item->getLinkedUUID(),
- dst_id,
- item->getName(),
- item->getActualDescription(),
- LLAssetType::AT_LINK, cb);
+ LL_DEBUGS("Avatar") << "linking inventory item " << item->getName() << LL_ENDL;
+ link_array.push_back(LLConstPointer<LLInventoryObject>(item));
break;
}
case LLAssetType::AT_LINK_FOLDER:
@@ -1490,12 +1601,8 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL
// Skip copying outfit links.
if (catp && catp->getPreferredType() != LLFolderType::FT_OUTFIT)
{
- link_inventory_item(gAgent.getID(),
- item->getLinkedUUID(),
- dst_id,
- item->getName(),
- item->getDescription(),
- LLAssetType::AT_LINK_FOLDER, cb);
+ LL_DEBUGS("Avatar") << "linking inventory folder " << item->getName() << LL_ENDL;
+ link_array.push_back(LLConstPointer<LLInventoryObject>(item));
}
break;
}
@@ -1504,7 +1611,7 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL
case LLAssetType::AT_BODYPART:
case LLAssetType::AT_GESTURE:
{
- llinfos << "copying inventory item " << item->getName() << llendl;
+ LL_DEBUGS("Avatar") << "copying inventory item " << item->getName() << LL_ENDL;
copy_inventory_item(gAgent.getID(),
item->getPermissions().getOwner(),
item->getUUID(),
@@ -1518,6 +1625,10 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL
break;
}
}
+ if (!link_array.empty())
+ {
+ link_inventory_array(dst_id, link_array, cb);
+ }
}
BOOL LLAppearanceMgr::getCanMakeFolderIntoOutfit(const LLUUID& folder_id)
@@ -1582,15 +1693,13 @@ bool LLAppearanceMgr::getCanRemoveOutfit(const LLUUID& outfit_cat_id)
// static
bool LLAppearanceMgr::getCanRemoveFromCOF(const LLUUID& outfit_cat_id)
{
- LLInventoryModel::cat_array_t cats;
- LLInventoryModel::item_array_t items;
+ if (gAgentWearables.isCOFChangeInProgress())
+ {
+ return false;
+ }
+
LLFindWearablesEx is_worn(/*is_worn=*/ true, /*include_body_parts=*/ false);
- gInventory.collectDescendentsIf(outfit_cat_id,
- cats,
- items,
- LLInventoryModel::EXCLUDE_TRASH,
- is_worn);
- return items.size() > 0;
+ return gInventory.hasMatchingDirectDescendent(outfit_cat_id, is_worn);
}
// static
@@ -1609,6 +1718,7 @@ bool LLAppearanceMgr::getCanAddToCOF(const LLUUID& outfit_cat_id)
items,
LLInventoryModel::EXCLUDE_TRASH,
not_worn);
+
return items.size() > 0;
}
@@ -1635,60 +1745,29 @@ bool LLAppearanceMgr::getCanReplaceCOF(const LLUUID& outfit_cat_id)
items,
LLInventoryModel::EXCLUDE_TRASH,
is_worn);
+
return items.size() > 0;
}
-void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category)
+void LLAppearanceMgr::purgeBaseOutfitLink(const LLUUID& category, LLPointer<LLInventoryCallback> cb)
{
LLInventoryModel::cat_array_t cats;
LLInventoryModel::item_array_t items;
gInventory.collectDescendents(category, cats, items,
LLInventoryModel::EXCLUDE_TRASH);
- for (S32 i = 0; i < items.count(); ++i)
+ for (S32 i = 0; i < items.size(); ++i)
{
- LLViewerInventoryItem *item = items.get(i);
+ LLViewerInventoryItem *item = items.at(i);
if (item->getActualType() != LLAssetType::AT_LINK_FOLDER)
continue;
- if (item->getIsLinkType())
+ LLViewerInventoryCategory* catp = item->getLinkedCategory();
+ if(catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT)
{
- LLViewerInventoryCategory* catp = item->getLinkedCategory();
- if(catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT)
- {
- gInventory.purgeObject(item->getUUID());
- }
+ remove_inventory_item(item->getUUID(), cb);
}
}
}
-void LLAppearanceMgr::purgeCategory(const LLUUID& category, bool keep_outfit_links, LLInventoryModel::item_array_t* keep_items)
-{
- LLInventoryModel::cat_array_t cats;
- LLInventoryModel::item_array_t items;
- gInventory.collectDescendents(category, cats, items,
- LLInventoryModel::EXCLUDE_TRASH);
- for (S32 i = 0; i < items.count(); ++i)
- {
- LLViewerInventoryItem *item = items.get(i);
- if (keep_outfit_links && (item->getActualType() == LLAssetType::AT_LINK_FOLDER))
- continue;
- if (item->getIsLinkType())
- {
-#if 0
- if (keep_items && keep_items->find(item) != LLInventoryModel::item_array_t::FAIL)
- {
- llinfos << "preserved item" << llendl;
- }
- else
- {
- gInventory.purgeObject(item->getUUID());
- }
-#else
- gInventory.purgeObject(item->getUUID());
- }
-#endif
- }
-}
-
// Keep the last N wearables of each type. For viewer 2.0, N is 1 for
// both body parts and clothing items.
void LLAppearanceMgr::filterWearableItems(
@@ -1713,33 +1792,14 @@ void LLAppearanceMgr::filterWearableItems(
}
}
-// Create links to all listed items.
-void LLAppearanceMgr::linkAll(const LLUUID& cat_uuid,
- LLInventoryModel::item_array_t& items,
- LLPointer<LLInventoryCallback> cb)
-{
- for (S32 i=0; i<items.count(); i++)
- {
- const LLInventoryItem* item = items.get(i).get();
- link_inventory_item(gAgent.getID(),
- item->getLinkedUUID(),
- cat_uuid,
- item->getName(),
- item->getActualDescription(),
- LLAssetType::AT_LINK,
- cb);
-
- const LLViewerInventoryCategory *cat = gInventory.getCategory(cat_uuid);
- const std::string cat_name = cat ? cat->getName() : "CAT NOT FOUND";
-#ifndef LL_RELEASE_FOR_DOWNLOAD
- LL_DEBUGS("Avatar") << self_av_string() << "Linking Item [ name:" << item->getName() << " UUID:" << item->getUUID() << " ] to Category [ name:" << cat_name << " UUID:" << cat_uuid << " ] " << LL_ENDL;
-#endif
- }
-}
-
void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append)
{
LLViewerInventoryCategory *pcat = gInventory.getCategory(category);
+ if (!pcat)
+ {
+ LL_WARNS() << "no category found for id " << category << LL_ENDL;
+ return;
+ }
LL_INFOS("Avatar") << self_av_string() << "starting, cat '" << (pcat ? pcat->getName() : "[UNKNOWN]") << "'" << LL_ENDL;
const LLUUID cof = getCOF();
@@ -1748,10 +1808,10 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append)
if (!append)
{
LLInventoryModel::item_array_t gest_items;
- getDescendentsOfAssetType(cof, gest_items, LLAssetType::AT_GESTURE, false);
- for(S32 i = 0; i < gest_items.count(); ++i)
+ getDescendentsOfAssetType(cof, gest_items, LLAssetType::AT_GESTURE);
+ for(S32 i = 0; i < gest_items.size(); ++i)
{
- LLViewerInventoryItem *gest_item = gest_items.get(i);
+ LLViewerInventoryItem *gest_item = gest_items.at(i);
if ( LLGestureMgr::instance().isGestureActive( gest_item->getLinkedUUID()) )
{
LLGestureMgr::instance().deactivateGesture( gest_item->getLinkedUUID() );
@@ -1765,8 +1825,8 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append)
// required parts are missing.
// Preserve body parts from COF if appending.
LLInventoryModel::item_array_t body_items;
- getDescendentsOfAssetType(cof, body_items, LLAssetType::AT_BODYPART, false);
- getDescendentsOfAssetType(category, body_items, LLAssetType::AT_BODYPART, false);
+ getDescendentsOfAssetType(cof, body_items, LLAssetType::AT_BODYPART);
+ getDescendentsOfAssetType(category, body_items, LLAssetType::AT_BODYPART);
if (append)
reverse(body_items.begin(), body_items.end());
// Reduce body items to max of one per type.
@@ -1776,8 +1836,8 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append)
// - Wearables: include COF contents only if appending.
LLInventoryModel::item_array_t wear_items;
if (append)
- getDescendentsOfAssetType(cof, wear_items, LLAssetType::AT_CLOTHING, false);
- getDescendentsOfAssetType(category, wear_items, LLAssetType::AT_CLOTHING, false);
+ getDescendentsOfAssetType(cof, wear_items, LLAssetType::AT_CLOTHING);
+ getDescendentsOfAssetType(category, wear_items, LLAssetType::AT_CLOTHING);
// Reduce wearables to max of one per type.
removeDuplicateItems(wear_items);
filterWearableItems(wear_items, LLAgentWearables::MAX_CLOTHING_PER_TYPE);
@@ -1785,41 +1845,74 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append)
// - Attachments: include COF contents only if appending.
LLInventoryModel::item_array_t obj_items;
if (append)
- getDescendentsOfAssetType(cof, obj_items, LLAssetType::AT_OBJECT, false);
- getDescendentsOfAssetType(category, obj_items, LLAssetType::AT_OBJECT, false);
+ getDescendentsOfAssetType(cof, obj_items, LLAssetType::AT_OBJECT);
+ getDescendentsOfAssetType(category, obj_items, LLAssetType::AT_OBJECT);
removeDuplicateItems(obj_items);
// - Gestures: include COF contents only if appending.
LLInventoryModel::item_array_t gest_items;
if (append)
- getDescendentsOfAssetType(cof, gest_items, LLAssetType::AT_GESTURE, false);
- getDescendentsOfAssetType(category, gest_items, LLAssetType::AT_GESTURE, false);
+ getDescendentsOfAssetType(cof, gest_items, LLAssetType::AT_GESTURE);
+ getDescendentsOfAssetType(category, gest_items, LLAssetType::AT_GESTURE);
removeDuplicateItems(gest_items);
// Create links to new COF contents.
LLInventoryModel::item_array_t all_items;
- all_items += body_items;
- all_items += wear_items;
- all_items += obj_items;
- all_items += gest_items;
+ std::copy(body_items.begin(), body_items.end(), std::back_inserter(all_items));
+ std::copy(wear_items.begin(), wear_items.end(), std::back_inserter(all_items));
+ std::copy(obj_items.begin(), obj_items.end(), std::back_inserter(all_items));
+ std::copy(gest_items.begin(), gest_items.end(), std::back_inserter(all_items));
+
+ // Find any wearables that need description set to enforce ordering.
+ desc_map_t desc_map;
+ getWearableOrderingDescUpdates(wear_items, desc_map);
// Will link all the above items.
- LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy;
- linkAll(cof,all_items,link_waiter);
+ // link_waiter enforce flags are false because we've already fixed everything up in updateCOF().
+ LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy(false,false);
+ LLSD contents = LLSD::emptyArray();
- // Add link to outfit if category is an outfit.
- if (!append)
+ for (LLInventoryModel::item_array_t::const_iterator it = all_items.begin();
+ it != all_items.end(); ++it)
{
- createBaseOutfitLink(category, link_waiter);
- }
+ LLSD item_contents;
+ LLInventoryItem *item = *it;
- // Remove current COF contents. Have to do this after creating
- // the link_waiter so links can be followed for any items that get
- // carried over (e.g. keeping old shape if the new outfit does not
- // contain one)
- bool keep_outfit_links = append;
- purgeCategory(cof, keep_outfit_links, &all_items);
- gInventory.notifyObservers();
+ std::string desc;
+ desc_map_t::const_iterator desc_iter = desc_map.find(item->getUUID());
+ if (desc_iter != desc_map.end())
+ {
+ desc = desc_iter->second;
+ LL_DEBUGS("Avatar") << item->getName() << " overriding desc to: " << desc
+ << " (was: " << item->getActualDescription() << ")" << LL_ENDL;
+ }
+ else
+ {
+ desc = item->getActualDescription();
+ }
+
+ item_contents["name"] = item->getName();
+ item_contents["desc"] = desc;
+ item_contents["linked_id"] = item->getLinkedUUID();
+ item_contents["type"] = LLAssetType::AT_LINK;
+ contents.append(item_contents);
+ }
+ const LLUUID& base_id = append ? getBaseOutfitUUID() : category;
+ LLViewerInventoryCategory *base_cat = gInventory.getCategory(base_id);
+ if (base_cat)
+ {
+ LLSD base_contents;
+ base_contents["name"] = base_cat->getName();
+ base_contents["desc"] = "";
+ base_contents["linked_id"] = base_cat->getLinkedUUID();
+ base_contents["type"] = LLAssetType::AT_LINK_FOLDER;
+ contents.append(base_contents);
+ }
+ if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"))
+ {
+ dump_sequential_xml(gAgentAvatarp->getFullname() + "_slam_request", contents);
+ }
+ slam_inventory_folder(getCOF(), contents, link_waiter);
LL_DEBUGS("Avatar") << self_av_string() << "waiting for LLUpdateAppearanceOnDestroy" << LL_ENDL;
}
@@ -1840,23 +1933,23 @@ void LLAppearanceMgr::createBaseOutfitLink(const LLUUID& category, LLPointer<LLI
LLViewerInventoryCategory* catp = gInventory.getCategory(category);
std::string new_outfit_name = "";
- purgeBaseOutfitLink(cof);
+ purgeBaseOutfitLink(cof, link_waiter);
if (catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT)
{
- link_inventory_item(gAgent.getID(), category, cof, catp->getName(), "",
- LLAssetType::AT_LINK_FOLDER, link_waiter);
+ link_inventory_object(cof, catp, link_waiter);
new_outfit_name = catp->getName();
}
updatePanelOutfitName(new_outfit_name);
}
-void LLAppearanceMgr::updateAgentWearables(LLWearableHoldingPattern* holder, bool append)
+void LLAppearanceMgr::updateAgentWearables(LLWearableHoldingPattern* holder)
{
- lldebugs << "updateAgentWearables()" << llendl;
+ LL_DEBUGS("Avatar") << "updateAgentWearables()" << LL_ENDL;
LLInventoryItem::item_array_t items;
- LLDynamicArray< LLViewerWearable* > wearables;
+ std::vector< LLViewerWearable* > wearables;
+ wearables.reserve(32);
// For each wearable type, find the wearables of that type.
for( S32 i = 0; i < LLWearableType::WT_COUNT; i++ )
@@ -1871,19 +1964,24 @@ void LLAppearanceMgr::updateAgentWearables(LLWearableHoldingPattern* holder, boo
LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(data.mItemID);
if( item && (item->getAssetUUID() == wearable->getAssetID()) )
{
- items.put(item);
- wearables.put(wearable);
+ items.push_back(item);
+ wearables.push_back(wearable);
}
}
}
}
- if(wearables.count() > 0)
+ if(wearables.size() > 0)
{
- gAgentWearables.setWearableOutfit(items, wearables, !append);
+ gAgentWearables.setWearableOutfit(items, wearables);
}
}
+S32 LLAppearanceMgr::countActiveHoldingPatterns()
+{
+ return LLWearableHoldingPattern::countActive();
+}
+
static void remove_non_link_items(LLInventoryModel::item_array_t &items)
{
LLInventoryModel::item_array_t pruned_items;
@@ -1905,7 +2003,7 @@ bool sort_by_actual_description(const LLInventoryItem* item1, const LLInventoryI
{
if (!item1 || !item2)
{
- llwarning("either item1 or item2 is NULL", 0);
+ LL_WARNS() << "either item1 or item2 is NULL" << LL_ENDL;
return true;
}
@@ -1922,7 +2020,7 @@ void item_array_diff(LLInventoryModel::item_array_t& full_list,
++it)
{
LLViewerInventoryItem *item = *it;
- if (keep_list.find(item) < 0) // Why on earth does LLDynamicArray need to redefine find()?
+ if (std::find(keep_list.begin(), keep_list.end(), item) == keep_list.end())
{
kill_list.push_back(item);
}
@@ -1932,12 +2030,12 @@ void item_array_diff(LLInventoryModel::item_array_t& full_list,
S32 LLAppearanceMgr::findExcessOrDuplicateItems(const LLUUID& cat_id,
LLAssetType::EType type,
S32 max_items,
- LLInventoryModel::item_array_t& items_to_kill)
+ LLInventoryObject::object_list_t& items_to_kill)
{
S32 to_kill_count = 0;
LLInventoryModel::item_array_t items;
- getDescendentsOfAssetType(cat_id, items, type, false);
+ getDescendentsOfAssetType(cat_id, items, type);
LLInventoryModel::item_array_t curr_items = items;
removeDuplicateItems(items);
if (max_items > 0)
@@ -1950,60 +2048,83 @@ S32 LLAppearanceMgr::findExcessOrDuplicateItems(const LLUUID& cat_id,
it != kill_items.end();
++it)
{
- items_to_kill.push_back(*it);
+ items_to_kill.push_back(LLPointer<LLInventoryObject>(*it));
to_kill_count++;
}
return to_kill_count;
}
-
-void LLAppearanceMgr::enforceItemRestrictions()
-{
- S32 purge_count = 0;
- LLInventoryModel::item_array_t items_to_kill;
- purge_count += findExcessOrDuplicateItems(getCOF(),LLAssetType::AT_BODYPART,
- 1, items_to_kill);
- purge_count += findExcessOrDuplicateItems(getCOF(),LLAssetType::AT_CLOTHING,
- LLAgentWearables::MAX_CLOTHING_PER_TYPE, items_to_kill);
- purge_count += findExcessOrDuplicateItems(getCOF(),LLAssetType::AT_OBJECT,
- -1, items_to_kill);
+void LLAppearanceMgr::findAllExcessOrDuplicateItems(const LLUUID& cat_id,
+ LLInventoryObject::object_list_t& items_to_kill)
+{
+ findExcessOrDuplicateItems(cat_id,LLAssetType::AT_BODYPART,
+ 1, items_to_kill);
+ findExcessOrDuplicateItems(cat_id,LLAssetType::AT_CLOTHING,
+ LLAgentWearables::MAX_CLOTHING_PER_TYPE, items_to_kill);
+ findExcessOrDuplicateItems(cat_id,LLAssetType::AT_OBJECT,
+ -1, items_to_kill);
+}
+void LLAppearanceMgr::enforceCOFItemRestrictions(LLPointer<LLInventoryCallback> cb)
+{
+ LLInventoryObject::object_list_t items_to_kill;
+ findAllExcessOrDuplicateItems(getCOF(), items_to_kill);
if (items_to_kill.size()>0)
{
- for (LLInventoryModel::item_array_t::iterator it = items_to_kill.begin();
- it != items_to_kill.end();
- ++it)
- {
- LLViewerInventoryItem *item = *it;
- LL_DEBUGS("Avatar") << self_av_string() << "purging duplicate or excess item " << item->getName() << LL_ENDL;
- gInventory.purgeObject(item->getUUID());
- }
- gInventory.notifyObservers();
+ // Remove duplicate or excess wearables. Should normally be enforced at the UI level, but
+ // this should catch anything that gets through.
+ remove_inventory_items(items_to_kill, cb);
}
}
-void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering)
+void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions,
+ bool enforce_ordering,
+ nullary_func_t post_update_func)
{
if (mIsInUpdateAppearanceFromCOF)
{
- llwarns << "Called updateAppearanceFromCOF inside updateAppearanceFromCOF, skipping" << llendl;
+ LL_WARNS() << "Called updateAppearanceFromCOF inside updateAppearanceFromCOF, skipping" << LL_ENDL;
return;
}
- BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF);
- selfStartPhase("update_appearance_from_cof");
-
LL_DEBUGS("Avatar") << self_av_string() << "starting" << LL_ENDL;
- //checking integrity of the COF in terms of ordering of wearables,
- //checking and updating links' descriptions of wearables in the COF (before analyzed for "dirty" state)
- updateClothingOrderingInfo(LLUUID::null, update_base_outfit_ordering);
+ if (enforce_item_restrictions)
+ {
+ // The point here is just to call
+ // updateAppearanceFromCOF() again after excess items
+ // have been removed. That time we will set
+ // enforce_item_restrictions to false so we don't get
+ // caught in a perpetual loop.
+ LLPointer<LLInventoryCallback> cb(
+ new LLUpdateAppearanceOnDestroy(false, enforce_ordering, post_update_func));
+ enforceCOFItemRestrictions(cb);
+ return;
+ }
+
+ if (enforce_ordering)
+ {
+ //checking integrity of the COF in terms of ordering of wearables,
+ //checking and updating links' descriptions of wearables in the COF (before analyzed for "dirty" state)
+
+ // As with enforce_item_restrictions handling above, we want
+ // to wait for the update callbacks, then (finally!) call
+ // updateAppearanceFromCOF() with no additional COF munging needed.
+ LLPointer<LLInventoryCallback> cb(
+ new LLUpdateAppearanceOnDestroy(false, false, post_update_func));
+ updateClothingOrderingInfo(LLUUID::null, cb);
+ return;
+ }
+
+ if (!validateClothingOrderingInfo())
+ {
+ LL_WARNS() << "Clothing ordering error" << LL_ENDL;
+ }
+
+ BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF);
+ selfStartPhase("update_appearance_from_cof");
- // Remove duplicate or excess wearables. Should normally be enforced at the UI level, but
- // this should catch anything that gets through.
- enforceItemRestrictions();
-
// update dirty flag to see if the state of the COF matches
// the saved outfit stored as a folder link
updateIsDirty();
@@ -2013,21 +2134,15 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering)
{
requestServerAppearanceUpdate();
}
- // DRANO really should wait for the appearance message to set this.
- // verify that deleting this line doesn't break anything.
- //gAgentAvatarp->setIsUsingServerBakes(gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion());
-
- //dumpCat(getCOF(),"COF, start");
- bool follow_folder_links = false;
LLUUID current_outfit_id = getCOF();
// Find all the wearables that are in the COF's subtree.
- lldebugs << "LLAppearanceMgr::updateFromCOF()" << llendl;
+ LL_DEBUGS() << "LLAppearanceMgr::updateFromCOF()" << LL_ENDL;
LLInventoryModel::item_array_t wear_items;
LLInventoryModel::item_array_t obj_items;
LLInventoryModel::item_array_t gest_items;
- getUserDescendents(current_outfit_id, wear_items, obj_items, gest_items, follow_folder_links);
+ getUserDescendents(current_outfit_id, wear_items, obj_items, gest_items);
// Get rid of non-links in case somehow the COF was corrupted.
remove_non_link_items(wear_items);
remove_non_link_items(obj_items);
@@ -2036,7 +2151,14 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering)
dumpItemArray(wear_items,"asset_dump: wear_item");
dumpItemArray(obj_items,"asset_dump: obj_item");
- if(!wear_items.count())
+ LLViewerInventoryCategory *cof = gInventory.getCategory(current_outfit_id);
+ if (!gInventory.isCategoryComplete(current_outfit_id))
+ {
+ LL_WARNS() << "COF info is not complete. Version " << cof->getVersion()
+ << " descendent_count " << cof->getDescendentCount()
+ << " viewer desc count " << cof->getViewerDescendentCount() << LL_ENDL;
+ }
+ if(!wear_items.size())
{
LLNotificationsUtil::add("CouldNotPutOnOutfit");
return;
@@ -2046,6 +2168,8 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering)
sortItemsByActualDescription(wear_items);
+ LL_DEBUGS("Avatar") << "HP block starts" << LL_ENDL;
+ LLTimer hp_block_timer;
LLWearableHoldingPattern* holder = new LLWearableHoldingPattern;
holder->setObjItems(obj_items);
@@ -2056,9 +2180,9 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering)
// callback will be called (and this object deleted)
// before the final getNextData().
- for(S32 i = 0; i < wear_items.count(); ++i)
+ for(S32 i = 0; i < wear_items.size(); ++i)
{
- LLViewerInventoryItem *item = wear_items.get(i);
+ LLViewerInventoryItem *item = wear_items.at(i);
LLViewerInventoryItem *linked_item = item ? item->getLinkedItem() : NULL;
// Fault injection: use debug setting to test asset
@@ -2086,23 +2210,23 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering)
{
if (!item)
{
- llwarns << "Attempt to wear a null item " << llendl;
+ LL_WARNS() << "Attempt to wear a null item " << LL_ENDL;
}
else if (!linked_item)
{
- llwarns << "Attempt to wear a broken link [ name:" << item->getName() << " ] " << llendl;
+ LL_WARNS() << "Attempt to wear a broken link [ name:" << item->getName() << " ] " << LL_ENDL;
}
}
}
- selfStartPhase("get_wearables");
+ selfStartPhase("get_wearables_2");
for (LLWearableHoldingPattern::found_list_t::iterator it = holder->getFoundList().begin();
it != holder->getFoundList().end(); ++it)
{
LLFoundData& found = *it;
- lldebugs << self_av_string() << "waiting for onWearableAssetFetch callback, asset " << found.mAssetID.asString() << llendl;
+ LL_DEBUGS() << self_av_string() << "waiting for onWearableAssetFetch callback, asset " << found.mAssetID.asString() << LL_ENDL;
// Fetch the wearables about to be worn.
LLWearableList::instance().getAsset(found.mAssetID,
@@ -2119,12 +2243,14 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering)
{
doOnIdleRepeating(boost::bind(&LLWearableHoldingPattern::pollFetchCompletion,holder));
}
+ post_update_func();
+
+ LL_DEBUGS("Avatar") << "HP block ends, elapsed " << hp_block_timer.getElapsedTimeF32() << LL_ENDL;
}
void LLAppearanceMgr::getDescendentsOfAssetType(const LLUUID& category,
LLInventoryModel::item_array_t& items,
- LLAssetType::EType type,
- bool follow_folder_links)
+ LLAssetType::EType type)
{
LLInventoryModel::cat_array_t cats;
LLIsType is_of_type(type);
@@ -2132,15 +2258,13 @@ void LLAppearanceMgr::getDescendentsOfAssetType(const LLUUID& category,
cats,
items,
LLInventoryModel::EXCLUDE_TRASH,
- is_of_type,
- follow_folder_links);
+ is_of_type);
}
void LLAppearanceMgr::getUserDescendents(const LLUUID& category,
LLInventoryModel::item_array_t& wear_items,
LLInventoryModel::item_array_t& obj_items,
- LLInventoryModel::item_array_t& gest_items,
- bool follow_folder_links)
+ LLInventoryModel::item_array_t& gest_items)
{
LLInventoryModel::cat_array_t wear_cats;
LLFindWearables is_wearable;
@@ -2148,8 +2272,7 @@ void LLAppearanceMgr::getUserDescendents(const LLUUID& category,
wear_cats,
wear_items,
LLInventoryModel::EXCLUDE_TRASH,
- is_wearable,
- follow_folder_links);
+ is_wearable);
LLInventoryModel::cat_array_t obj_cats;
LLIsType is_object( LLAssetType::AT_OBJECT );
@@ -2157,8 +2280,7 @@ void LLAppearanceMgr::getUserDescendents(const LLUUID& category,
obj_cats,
obj_items,
LLInventoryModel::EXCLUDE_TRASH,
- is_object,
- follow_folder_links);
+ is_object);
// Find all gestures in this folder
LLInventoryModel::cat_array_t gest_cats;
@@ -2167,8 +2289,7 @@ void LLAppearanceMgr::getUserDescendents(const LLUUID& category,
gest_cats,
gest_items,
LLInventoryModel::EXCLUDE_TRASH,
- is_gesture,
- follow_folder_links);
+ is_gesture);
}
void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool copy, bool append)
@@ -2183,10 +2304,36 @@ void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool
LL_INFOS("Avatar") << self_av_string() << "wearInventoryCategory( " << category->getName()
<< " )" << LL_ENDL;
- selfStartPhase("wear_inventory_category_fetch");
- callAfterCategoryFetch(category->getUUID(),boost::bind(&LLAppearanceMgr::wearCategoryFinal,
- &LLAppearanceMgr::instance(),
- category->getUUID(), copy, append));
+ // If we are copying from library, attempt to use AIS to copy the category.
+ bool ais_ran=false;
+ if (copy && AISCommand::isAPIAvailable())
+ {
+ LLUUID parent_id;
+ parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
+ if (parent_id.isNull())
+ {
+ parent_id = gInventory.getRootFolderID();
+ }
+
+ LLPointer<LLInventoryCallback> copy_cb = new LLWearCategoryAfterCopy(append);
+ LLPointer<LLInventoryCallback> track_cb = new LLTrackPhaseWrapper(
+ std::string("wear_inventory_category_callback"), copy_cb);
+ LLPointer<AISCommand> cmd_ptr = new CopyLibraryCategoryCommand(category->getUUID(), parent_id, track_cb);
+ ais_ran=cmd_ptr->run_command();
+ }
+
+ if (!ais_ran)
+ {
+ selfStartPhase("wear_inventory_category_fetch");
+ callAfterCategoryFetch(category->getUUID(),boost::bind(&LLAppearanceMgr::wearCategoryFinal,
+ &LLAppearanceMgr::instance(),
+ category->getUUID(), copy, append));
+ }
+}
+
+S32 LLAppearanceMgr::getActiveCopyOperations() const
+{
+ return LLCallAfterInventoryCopyMgr::getInstanceCount();
}
void LLAppearanceMgr::wearCategoryFinal(LLUUID& cat_id, bool copy_items, bool append)
@@ -2267,7 +2414,7 @@ void LLAppearanceMgr::wearInventoryCategoryOnAvatar( LLInventoryCategory* catego
// Avoid unintentionally overwriting old wearables. We have to do
// this up front to avoid having to deal with the case of multiple
// wearables being dirty.
- if(!category) return;
+ if (!category) return;
if ( !LLInventoryCallbackManager::is_instantiated() )
{
@@ -2287,6 +2434,7 @@ void LLAppearanceMgr::wearInventoryCategoryOnAvatar( LLInventoryCategory* catego
LLAppearanceMgr::changeOutfit(TRUE, category->getUUID(), append);
}
+// FIXME do we really want to search entire inventory for matching name?
void LLAppearanceMgr::wearOutfitByName(const std::string& name)
{
LL_INFOS("Avatar") << self_av_string() << "Wearing category " << name << LL_ENDL;
@@ -2301,10 +2449,10 @@ void LLAppearanceMgr::wearOutfitByName(const std::string& name)
has_name);
bool copy_items = false;
LLInventoryCategory* cat = NULL;
- if (cat_array.count() > 0)
+ if (cat_array.size() > 0)
{
// Just wear the first one that matches
- cat = cat_array.get(0);
+ cat = cat_array.at(0);
}
else
{
@@ -2313,9 +2461,9 @@ void LLAppearanceMgr::wearOutfitByName(const std::string& name)
item_array,
LLInventoryModel::EXCLUDE_TRASH,
has_name);
- if(cat_array.count() > 0)
+ if(cat_array.size() > 0)
{
- cat = cat_array.get(0);
+ cat = cat_array.at(0);
copy_items = true;
}
}
@@ -2326,8 +2474,8 @@ void LLAppearanceMgr::wearOutfitByName(const std::string& name)
}
else
{
- llwarns << "Couldn't find outfit " <<name<< " in wearOutfitByName()"
- << llendl;
+ LL_WARNS() << "Couldn't find outfit " <<name<< " in wearOutfitByName()"
+ << LL_ENDL;
}
}
@@ -2340,9 +2488,8 @@ bool areMatchingWearables(const LLViewerInventoryItem *a, const LLViewerInventor
class LLDeferredCOFLinkObserver: public LLInventoryObserver
{
public:
- LLDeferredCOFLinkObserver(const LLUUID& item_id, bool do_update, LLPointer<LLInventoryCallback> cb = NULL, std::string description = ""):
+ LLDeferredCOFLinkObserver(const LLUUID& item_id, LLPointer<LLInventoryCallback> cb, const std::string& description):
mItemID(item_id),
- mDoUpdate(do_update),
mCallback(cb),
mDescription(description)
{
@@ -2358,14 +2505,13 @@ public:
if (item)
{
gInventory.removeObserver(this);
- LLAppearanceMgr::instance().addCOFItemLink(item,mDoUpdate,mCallback);
+ LLAppearanceMgr::instance().addCOFItemLink(item, mCallback, mDescription);
delete this;
}
}
private:
const LLUUID mItemID;
- bool mDoUpdate;
std::string mDescription;
LLPointer<LLInventoryCallback> mCallback;
};
@@ -2373,46 +2519,30 @@ private:
// BAP - note that this runs asynchronously if the item is not already loaded from inventory.
// Dangerous if caller assumes link will exist after calling the function.
-void LLAppearanceMgr::addCOFItemLink(const LLUUID &item_id, bool do_update, LLPointer<LLInventoryCallback> cb, const std::string description)
+void LLAppearanceMgr::addCOFItemLink(const LLUUID &item_id,
+ LLPointer<LLInventoryCallback> cb,
+ const std::string description)
{
const LLInventoryItem *item = gInventory.getItem(item_id);
if (!item)
{
- LLDeferredCOFLinkObserver *observer = new LLDeferredCOFLinkObserver(item_id, do_update, cb, description);
+ LLDeferredCOFLinkObserver *observer = new LLDeferredCOFLinkObserver(item_id, cb, description);
gInventory.addObserver(observer);
}
else
{
- addCOFItemLink(item, do_update, cb, description);
+ addCOFItemLink(item, cb, description);
}
}
-void modified_cof_cb(const LLUUID& inv_item)
-{
- LLAppearanceMgr::instance().updateAppearanceFromCOF();
-
- // Start editing the item if previously requested.
- gAgentWearables.editWearableIfRequested(inv_item);
-
- // TODO: camera mode may not be changed if a debug setting is tweaked
- if( gAgentCamera.cameraCustomizeAvatar() )
- {
- // If we're in appearance editing mode, the current tab may need to be refreshed
- LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>(LLFloaterSidePanelContainer::getPanel("appearance"));
- if (panel)
- {
- panel->showDefaultSubpart();
- }
- }
-}
-
-void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, bool do_update, LLPointer<LLInventoryCallback> cb, const std::string description)
-{
- std::string link_description = description;
+void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item,
+ LLPointer<LLInventoryCallback> cb,
+ const std::string description)
+{
const LLViewerInventoryItem *vitem = dynamic_cast<const LLViewerInventoryItem*>(item);
if (!vitem)
{
- llwarns << "not an llviewerinventoryitem, failed" << llendl;
+ LL_WARNS() << "not an llviewerinventoryitem, failed" << LL_ENDL;
return;
}
@@ -2426,10 +2556,10 @@ void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, bool do_update
LLInventoryModel::EXCLUDE_TRASH);
bool linked_already = false;
U32 count = 0;
- for (S32 i=0; i<item_array.count(); i++)
+ for (S32 i=0; i<item_array.size(); i++)
{
// Are these links to the same object?
- const LLViewerInventoryItem* inv_item = item_array.get(i).get();
+ const LLViewerInventoryItem* inv_item = item_array.at(i).get();
const LLWearableType::EType wearable_type = inv_item->getWearableType();
const bool is_body_part = (wearable_type == LLWearableType::WT_SHAPE)
@@ -2448,43 +2578,23 @@ void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, bool do_update
++count;
if (is_body_part && inv_item->getIsLinkType() && (vitem->getWearableType() == wearable_type))
{
- gInventory.purgeObject(inv_item->getUUID());
+ remove_inventory_item(inv_item->getUUID(), cb);
}
else if (count >= LLAgentWearables::MAX_CLOTHING_PER_TYPE)
{
// MULTI-WEARABLES: make sure we don't go over MAX_CLOTHING_PER_TYPE
- gInventory.purgeObject(inv_item->getUUID());
+ remove_inventory_item(inv_item->getUUID(), cb);
}
}
}
- if (linked_already)
+ if (!linked_already)
{
- if (do_update)
- {
- LLAppearanceMgr::updateAppearanceFromCOF();
- }
- return;
- }
- else
- {
- if(do_update && cb.isNull())
- {
- cb = new LLBoostFuncInventoryCallback(modified_cof_cb);
- }
- if (vitem->getIsLinkType())
- {
- link_description = vitem->getActualDescription();
- }
- link_inventory_item( gAgent.getID(),
- vitem->getLinkedUUID(),
- getCOF(),
- vitem->getName(),
- link_description,
- LLAssetType::AT_LINK,
- cb);
+ LLViewerInventoryItem *copy_item = new LLViewerInventoryItem;
+ copy_item->copyViewerItem(vitem);
+ copy_item->setDescription(description);
+ link_inventory_object(getCOF(), copy_item, cb);
}
- return;
}
LLInventoryModel::item_array_t LLAppearanceMgr::findCOFItemLinks(const LLUUID& item_id)
@@ -2502,18 +2612,24 @@ LLInventoryModel::item_array_t LLAppearanceMgr::findCOFItemLinks(const LLUUID& i
cat_array,
item_array,
LLInventoryModel::EXCLUDE_TRASH);
- for (S32 i=0; i<item_array.count(); i++)
+ for (S32 i=0; i<item_array.size(); i++)
{
- const LLViewerInventoryItem* inv_item = item_array.get(i).get();
+ const LLViewerInventoryItem* inv_item = item_array.at(i).get();
if (inv_item->getLinkedUUID() == vitem->getLinkedUUID())
{
- result.put(item_array.get(i));
+ result.push_back(item_array.at(i));
}
}
}
return result;
}
+bool LLAppearanceMgr::isLinkedInCOF(const LLUUID& item_id)
+{
+ LLInventoryModel::item_array_t links = LLAppearanceMgr::instance().findCOFItemLinks(item_id);
+ return links.size() > 0;
+}
+
void LLAppearanceMgr::removeAllClothesFromAvatar()
{
// Fetch worn clothes (i.e. the ones in COF).
@@ -2524,8 +2640,7 @@ void LLAppearanceMgr::removeAllClothesFromAvatar()
dummy,
clothing_items,
LLInventoryModel::EXCLUDE_TRASH,
- is_clothing,
- false);
+ is_clothing);
uuid_vec_t item_ids;
for (LLInventoryModel::item_array_t::iterator it = clothing_items.begin();
it != clothing_items.end(); ++it)
@@ -2569,7 +2684,7 @@ void LLAppearanceMgr::removeAllAttachmentsFromAvatar()
removeItemsFromAvatar(ids_to_remove);
}
-void LLAppearanceMgr::removeCOFItemLinks(const LLUUID& item_id)
+void LLAppearanceMgr::removeCOFItemLinks(const LLUUID& item_id, LLPointer<LLInventoryCallback> cb)
{
gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id);
@@ -2579,17 +2694,17 @@ void LLAppearanceMgr::removeCOFItemLinks(const LLUUID& item_id)
cat_array,
item_array,
LLInventoryModel::EXCLUDE_TRASH);
- for (S32 i=0; i<item_array.count(); i++)
+ for (S32 i=0; i<item_array.size(); i++)
{
- const LLInventoryItem* item = item_array.get(i).get();
+ const LLInventoryItem* item = item_array.at(i).get();
if (item->getIsLinkType() && item->getLinkedUUID() == item_id)
{
- gInventory.purgeObject(item->getUUID());
+ remove_inventory_item(item->getUUID(), cb);
}
}
}
-void LLAppearanceMgr::removeCOFLinksOfType(LLWearableType::EType type)
+void LLAppearanceMgr::removeCOFLinksOfType(LLWearableType::EType type, LLPointer<LLInventoryCallback> cb)
{
LLFindWearablesOfType filter_wearables_of_type(type);
LLInventoryModel::cat_array_t cats;
@@ -2602,7 +2717,7 @@ void LLAppearanceMgr::removeCOFLinksOfType(LLWearableType::EType type)
const LLViewerInventoryItem* item = *it;
if (item->getIsLinkType()) // we must operate on links only
{
- gInventory.purgeObject(item->getUUID());
+ remove_inventory_item(item->getUUID(), cb);
}
}
}
@@ -2611,7 +2726,7 @@ bool sort_by_linked_uuid(const LLViewerInventoryItem* item1, const LLViewerInven
{
if (!item1 || !item2)
{
- llwarning("item1, item2 cannot be null, something is very wrong", 0);
+ LL_WARNS() << "item1, item2 cannot be null, something is very wrong" << LL_ENDL;
return true;
}
@@ -2641,7 +2756,7 @@ void LLAppearanceMgr::updateIsDirty()
if (base_outfit.notNull())
{
- LLIsOfAssetType collector = LLIsOfAssetType(LLAssetType::AT_LINK);
+ LLIsValidItemLink collector;
LLInventoryModel::cat_array_t cof_cats;
LLInventoryModel::item_array_t cof_items;
@@ -2653,8 +2768,9 @@ void LLAppearanceMgr::updateIsDirty()
gInventory.collectDescendentsIf(base_outfit, outfit_cats, outfit_items,
LLInventoryModel::EXCLUDE_TRASH, collector);
- if(outfit_items.count() != cof_items.count())
+ if(outfit_items.size() != cof_items.size())
{
+ LL_DEBUGS("Avatar") << "item count different - base " << outfit_items.size() << " cof " << cof_items.size() << LL_ENDL;
// Current outfit folder should have one more item than the outfit folder.
// this one item is the link back to the outfit folder itself.
mOutfitIsDirty = true;
@@ -2667,18 +2783,37 @@ void LLAppearanceMgr::updateIsDirty()
for (U32 i = 0; i < cof_items.size(); ++i)
{
- LLViewerInventoryItem *item1 = cof_items.get(i);
- LLViewerInventoryItem *item2 = outfit_items.get(i);
+ LLViewerInventoryItem *item1 = cof_items.at(i);
+ LLViewerInventoryItem *item2 = outfit_items.at(i);
if (item1->getLinkedUUID() != item2->getLinkedUUID() ||
item1->getName() != item2->getName() ||
item1->getActualDescription() != item2->getActualDescription())
{
+ if (item1->getLinkedUUID() != item2->getLinkedUUID())
+ {
+ LL_DEBUGS("Avatar") << "link id different " << LL_ENDL;
+ }
+ else
+ {
+ if (item1->getName() != item2->getName())
+ {
+ LL_DEBUGS("Avatar") << "name different " << item1->getName() << " " << item2->getName() << LL_ENDL;
+ }
+ if (item1->getActualDescription() != item2->getActualDescription())
+ {
+ LL_DEBUGS("Avatar") << "desc different " << item1->getActualDescription()
+ << " " << item2->getActualDescription()
+ << " names " << item1->getName() << " " << item2->getName() << LL_ENDL;
+ }
+ }
mOutfitIsDirty = true;
return;
}
}
}
+ llassert(!mOutfitIsDirty);
+ LL_DEBUGS("Avatar") << "clean" << LL_ENDL;
}
// *HACK: Must match name in Library or agent inventory
@@ -2698,7 +2833,7 @@ void LLAppearanceMgr::copyLibraryGestures()
gInventory.findLibraryCategoryUUIDForType(LLFolderType::FT_GESTURE,false);
if (lib_gesture_cat_id.isNull())
{
- llwarns << "Unable to copy gestures, source category not found" << llendl;
+ LL_WARNS() << "Unable to copy gestures, source category not found" << LL_ENDL;
}
LLUUID dst_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_GESTURE);
@@ -2747,7 +2882,7 @@ void LLAppearanceMgr::copyLibraryGestures()
LLUUID cat_id = findDescendentCategoryIDByName(lib_gesture_cat_id,folder_name);
if (cat_id.isNull())
{
- llwarns << self_av_string() << "failed to find gesture folder for " << folder_name << llendl;
+ LL_WARNS() << self_av_string() << "failed to find gesture folder for " << folder_name << LL_ENDL;
}
else
{
@@ -2760,23 +2895,6 @@ void LLAppearanceMgr::copyLibraryGestures()
}
}
-void LLAppearanceMgr::autopopulateOutfits()
-{
- // If this is the very first time the user has logged into viewer2+ (from a legacy viewer, or new account)
- // then auto-populate outfits from the library into the My Outfits folder.
-
- LL_INFOS("Avatar") << self_av_string() << "avatar fully visible" << LL_ENDL;
-
- static bool check_populate_my_outfits = true;
- if (check_populate_my_outfits &&
- (LLInventoryModel::getIsFirstTimeInViewer2()
- || gSavedSettings.getBOOL("MyOutfitsAutofill")))
- {
- gAgentWearables.populateMyOutfitsFolder();
- }
- check_populate_my_outfits = false;
-}
-
// Handler for anything that's deferred until avatar de-clouds.
void LLAppearanceMgr::onFirstFullyVisible()
{
@@ -2784,10 +2902,6 @@ void LLAppearanceMgr::onFirstFullyVisible()
gAgentAvatarp->reportAvatarRezTime();
gAgentAvatarp->debugAvatarVisible();
- // The auto-populate is failing at the point of generating outfits
- // folders, so don't do the library copy until that is resolved.
- // autopopulateOutfits();
-
// If this is the first time we've ever logged in,
// then copy default gestures from the library.
if (gAgent.isFirstLogin()) {
@@ -2802,9 +2916,27 @@ void appearance_mgr_update_dirty_state()
if (LLAppearanceMgr::instanceExists())
{
LLAppearanceMgr::getInstance()->updateIsDirty();
+ LLAppearanceMgr::getInstance()->setOutfitLocked(false);
+ gAgentWearables.notifyLoadingFinished();
}
}
+void update_base_outfit_after_ordering()
+{
+ LLAppearanceMgr& app_mgr = LLAppearanceMgr::instance();
+
+ LLPointer<LLInventoryCallback> dirty_state_updater =
+ new LLBoostFuncInventoryCallback(no_op_inventory_func, appearance_mgr_update_dirty_state);
+
+ //COF contains only links so we copy to the Base Outfit only links
+ const LLUUID base_outfit_id = app_mgr.getBaseOutfitUUID();
+ bool copy_folder_links = false;
+ app_mgr.slamCategoryLinks(app_mgr.getCOF(), base_outfit_id, copy_folder_links, dirty_state_updater);
+
+}
+
+// Save COF changes - update the contents of the current base outfit
+// to match the current COF. Fails if no current base outfit is set.
bool LLAppearanceMgr::updateBaseOutfit()
{
if (isOutfitLocked())
@@ -2813,23 +2945,20 @@ bool LLAppearanceMgr::updateBaseOutfit()
llassert(!isOutfitLocked());
return false;
}
+
setOutfitLocked(true);
gAgentWearables.notifyLoadingStarted();
const LLUUID base_outfit_id = getBaseOutfitUUID();
if (base_outfit_id.isNull()) return false;
+ LL_DEBUGS("Avatar") << "saving cof to base outfit " << base_outfit_id << LL_ENDL;
- updateClothingOrderingInfo();
-
- // in a Base Outfit we do not remove items, only links
- purgeCategory(base_outfit_id, false);
-
- LLPointer<LLInventoryCallback> dirty_state_updater =
- new LLBoostFuncInventoryCallback(no_op_inventory_func, appearance_mgr_update_dirty_state);
-
- //COF contains only links so we copy to the Base Outfit only links
- shallowCopyCategoryContents(getCOF(), base_outfit_id, dirty_state_updater);
+ LLPointer<LLInventoryCallback> cb =
+ new LLBoostFuncInventoryCallback(no_op_inventory_func, update_base_outfit_after_ordering);
+ // Really shouldn't be needed unless there's a race condition -
+ // updateAppearanceFromCOF() already calls updateClothingOrderingInfo.
+ updateClothingOrderingInfo(LLUUID::null, cb);
return true;
}
@@ -2839,12 +2968,12 @@ void LLAppearanceMgr::divvyWearablesByType(const LLInventoryModel::item_array_t&
items_by_type.resize(LLWearableType::WT_COUNT);
if (items.empty()) return;
- for (S32 i=0; i<items.count(); i++)
+ for (S32 i=0; i<items.size(); i++)
{
- LLViewerInventoryItem *item = items.get(i);
+ LLViewerInventoryItem *item = items.at(i);
if (!item)
{
- LL_WARNS("Appearance") << "NULL item found" << llendl;
+ LL_WARNS("Appearance") << "NULL item found" << LL_ENDL;
continue;
}
// Ignore non-wearables.
@@ -2877,12 +3006,6 @@ struct WearablesOrderComparator
bool operator()(const LLInventoryItem* item1, const LLInventoryItem* item2)
{
- if (!item1 || !item2)
- {
- llwarning("either item1 or item2 is NULL", 0);
- return true;
- }
-
const std::string& desc1 = item1->getActualDescription();
const std::string& desc2 = item2->getActualDescription();
@@ -2896,260 +3019,373 @@ struct WearablesOrderComparator
//items with ordering information but not for the associated wearables type
if (!item1_valid && item2_valid)
return false;
+ else if (item1_valid && !item2_valid)
+ return true;
- return true;
+ return item1->getName() < item2->getName();
}
U32 mControlSize;
};
-void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, bool update_base_outfit_ordering)
+void LLAppearanceMgr::getWearableOrderingDescUpdates(LLInventoryModel::item_array_t& wear_items,
+ desc_map_t& desc_map)
{
- if (cat_id.isNull())
- {
- cat_id = getCOF();
- if (update_base_outfit_ordering)
- {
- const LLUUID base_outfit_id = getBaseOutfitUUID();
- if (base_outfit_id.notNull())
- {
- updateClothingOrderingInfo(base_outfit_id,false);
- }
- }
- }
-
- // COF is processed if cat_id is not specified
- LLInventoryModel::item_array_t wear_items;
- getDescendentsOfAssetType(cat_id, wear_items, LLAssetType::AT_CLOTHING, false);
-
wearables_by_type_t items_by_type(LLWearableType::WT_COUNT);
divvyWearablesByType(wear_items, items_by_type);
- bool inventory_changed = false;
for (U32 type = LLWearableType::WT_SHIRT; type < LLWearableType::WT_COUNT; type++)
{
-
U32 size = items_by_type[type].size();
if (!size) continue;
-
+
//sinking down invalid items which need reordering
std::sort(items_by_type[type].begin(), items_by_type[type].end(), WearablesOrderComparator((LLWearableType::EType) type));
-
+
//requesting updates only for those links which don't have "valid" descriptions
for (U32 i = 0; i < size; i++)
{
LLViewerInventoryItem* item = items_by_type[type][i];
if (!item) continue;
-
+
std::string new_order_str = build_order_string((LLWearableType::EType)type, i);
if (new_order_str == item->getActualDescription()) continue;
-
- item->setDescription(new_order_str);
- item->setComplete(TRUE);
- item->updateServer(FALSE);
- gInventory.updateItem(item);
- inventory_changed = true;
+ desc_map[item->getUUID()] = new_order_str;
}
}
-
- //*TODO do we really need to notify observers?
- if (inventory_changed) gInventory.notifyObservers();
}
-// This is intended for use with HTTP Clients/Responders, but is not
-// specifically coupled with those classes.
-class LLHTTPRetryPolicy: public LLThreadSafeRefCount
+bool LLAppearanceMgr::validateClothingOrderingInfo(LLUUID cat_id)
{
-public:
- LLHTTPRetryPolicy() {}
- virtual ~LLHTTPRetryPolicy() {}
- virtual bool shouldRetry(U32 status, F32& seconds_to_wait) = 0;
-};
+ // COF is processed if cat_id is not specified
+ if (cat_id.isNull())
+ {
+ cat_id = getCOF();
+ }
-// Example of simplest possible policy, not necessarily recommended.
-class LLAlwaysRetryImmediatelyPolicy: public LLHTTPRetryPolicy
-{
-public:
- LLAlwaysRetryImmediatelyPolicy() {}
- bool shouldRetry(U32 status, F32& seconds_to_wait)
+ LLInventoryModel::item_array_t wear_items;
+ getDescendentsOfAssetType(cat_id, wear_items, LLAssetType::AT_CLOTHING);
+
+ // Identify items for which desc needs to change.
+ desc_map_t desc_map;
+ getWearableOrderingDescUpdates(wear_items, desc_map);
+
+ for (desc_map_t::const_iterator it = desc_map.begin();
+ it != desc_map.end(); ++it)
{
- seconds_to_wait = 0.0;
- return true;
+ const LLUUID& item_id = it->first;
+ const std::string& new_order_str = it->second;
+ LLViewerInventoryItem *item = gInventory.getItem(item_id);
+ LL_WARNS() << "Order validation fails: " << item->getName()
+ << " needs to update desc to: " << new_order_str
+ << " (from: " << item->getActualDescription() << ")" << LL_ENDL;
}
-};
+
+ return desc_map.size() == 0;
+}
-// Very general policy with geometric back-off after failures,
-// up to a maximum delay, and maximum number of retries.
-class LLAdaptiveRetryPolicy: public LLHTTPRetryPolicy
+void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id,
+ LLPointer<LLInventoryCallback> cb)
{
-public:
- LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 backoff_factor, U32 max_retries):
- mMinDelay(min_delay),
- mMaxDelay(max_delay),
- mBackoffFactor(backoff_factor),
- mMaxRetries(max_retries),
- mDelay(min_delay),
- mRetryCount(0)
+ // COF is processed if cat_id is not specified
+ if (cat_id.isNull())
{
+ cat_id = getCOF();
}
- bool shouldRetry(U32 status, F32& seconds_to_wait)
+ LLInventoryModel::item_array_t wear_items;
+ getDescendentsOfAssetType(cat_id, wear_items, LLAssetType::AT_CLOTHING);
+
+ // Identify items for which desc needs to change.
+ desc_map_t desc_map;
+ getWearableOrderingDescUpdates(wear_items, desc_map);
+
+ for (desc_map_t::const_iterator it = desc_map.begin();
+ it != desc_map.end(); ++it)
{
- seconds_to_wait = mDelay;
- mDelay = llclamp(mDelay*mBackoffFactor,mMinDelay,mMaxDelay);
- mRetryCount++;
- return (mRetryCount<=mMaxRetries);
+ LLSD updates;
+ const LLUUID& item_id = it->first;
+ const std::string& new_order_str = it->second;
+ LLViewerInventoryItem *item = gInventory.getItem(item_id);
+ LL_DEBUGS("Avatar") << item->getName() << " updating desc to: " << new_order_str
+ << " (was: " << item->getActualDescription() << ")" << LL_ENDL;
+ updates["desc"] = new_order_str;
+ update_inventory_item(item_id,updates,cb);
}
+
+}
+
+class RequestAgentUpdateAppearanceResponder: public LLHTTPClient::Responder
+{
+ LOG_CLASS(RequestAgentUpdateAppearanceResponder);
+
+ friend class LLAppearanceMgr;
+
+public:
+ RequestAgentUpdateAppearanceResponder();
+
+ virtual ~RequestAgentUpdateAppearanceResponder();
private:
- F32 mMinDelay; // delay never less than this value
- F32 mMaxDelay; // delay never exceeds this value
- F32 mBackoffFactor; // delay increases by this factor after each retry, up to mMaxDelay.
- U32 mMaxRetries; // maximum number of times shouldRetry will return true.
- F32 mDelay; // current delay.
- U32 mRetryCount; // number of times shouldRetry has been called.
+ // Called when sendServerAppearanceUpdate called. May or may not
+ // trigger a request depending on various bits of state.
+ void onRequestRequested();
+
+ // Post the actual appearance request to cap.
+ void sendRequest();
+
+ void debugCOF(const LLSD& content);
+
+protected:
+ // Successful completion.
+ /* virtual */ void httpSuccess();
+
+ // Error
+ /*virtual*/ void httpFailure();
+
+ void onFailure();
+ void onSuccess();
+
+ S32 mInFlightCounter;
+ LLTimer mInFlightTimer;
+ LLPointer<LLHTTPRetryPolicy> mRetryPolicy;
};
-class RequestAgentUpdateAppearanceResponder: public LLHTTPClient::Responder
+RequestAgentUpdateAppearanceResponder::RequestAgentUpdateAppearanceResponder()
{
-public:
- RequestAgentUpdateAppearanceResponder()
+ bool retry_on_4xx = true;
+ mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10, retry_on_4xx);
+ mInFlightCounter = 0;
+}
+
+RequestAgentUpdateAppearanceResponder::~RequestAgentUpdateAppearanceResponder()
+{
+}
+
+void RequestAgentUpdateAppearanceResponder::onRequestRequested()
+{
+ // If we have already received an update for this or higher cof version, ignore.
+ S32 cof_version = LLAppearanceMgr::instance().getCOFVersion();
+ S32 last_rcv = gAgentAvatarp->mLastUpdateReceivedCOFVersion;
+ S32 last_req = gAgentAvatarp->mLastUpdateRequestCOFVersion;
+ LL_DEBUGS("Avatar") << "cof_version " << cof_version
+ << " last_rcv " << last_rcv
+ << " last_req " << last_req
+ << " in flight " << mInFlightCounter << LL_ENDL;
+ if ((mInFlightCounter>0) && (mInFlightTimer.hasExpired()))
{
- mRetryPolicy = new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10);
+ LL_WARNS("Avatar") << "in flight timer expired, resetting " << LL_ENDL;
+ mInFlightCounter = 0;
+ }
+ if (cof_version < last_rcv)
+ {
+ LL_DEBUGS("Avatar") << "Have already received update for cof version " << last_rcv
+ << " will not request for " << cof_version << LL_ENDL;
+ return;
+ }
+ if (mInFlightCounter>0 && last_req >= cof_version)
+ {
+ LL_DEBUGS("Avatar") << "Request already in flight for cof version " << last_req
+ << " will not request for " << cof_version << LL_ENDL;
+ return;
}
- virtual ~RequestAgentUpdateAppearanceResponder()
+ // Actually send the request.
+ LL_DEBUGS("Avatar") << "Will send request for cof_version " << cof_version << LL_ENDL;
+ mRetryPolicy->reset();
+ sendRequest();
+}
+
+void RequestAgentUpdateAppearanceResponder::sendRequest()
+{
+ if (gAgentAvatarp->isEditingAppearance())
{
+ // don't send out appearance updates if in appearance editing mode
+ return;
}
- // Successful completion.
- /* virtual */ void result(const LLSD& content)
+ if (!gAgent.getRegion())
+ {
+ LL_WARNS() << "Region not set, cannot request server appearance update" << LL_ENDL;
+ return;
+ }
+ if (gAgent.getRegion()->getCentralBakeVersion()==0)
+ {
+ LL_WARNS() << "Region does not support baking" << LL_ENDL;
+ }
+ std::string url = gAgent.getRegion()->getCapability("UpdateAvatarAppearance");
+ if (url.empty())
+ {
+ LL_WARNS() << "No cap for UpdateAvatarAppearance." << LL_ENDL;
+ return;
+ }
+
+ LLSD body;
+ S32 cof_version = LLAppearanceMgr::instance().getCOFVersion();
+ if (gSavedSettings.getBOOL("DebugAvatarExperimentalServerAppearanceUpdate"))
+ {
+ body = LLAppearanceMgr::instance().dumpCOF();
+ }
+ else
+ {
+ body["cof_version"] = cof_version;
+ if (gSavedSettings.getBOOL("DebugForceAppearanceRequestFailure"))
+ {
+ body["cof_version"] = cof_version+999;
+ }
+ }
+ LL_DEBUGS("Avatar") << "request url " << url << " my_cof_version " << cof_version << LL_ENDL;
+
+ mInFlightCounter++;
+ mInFlightTimer.setTimerExpirySec(60.0);
+ LLHTTPClient::post(url, body, this);
+ llassert(cof_version >= gAgentAvatarp->mLastUpdateRequestCOFVersion);
+ gAgentAvatarp->mLastUpdateRequestCOFVersion = cof_version;
+}
+
+void RequestAgentUpdateAppearanceResponder::debugCOF(const LLSD& content)
+{
+ LL_INFOS("Avatar") << "AIS COF, version received: " << content["expected"].asInteger()
+ << " ================================= " << LL_ENDL;
+ std::set<LLUUID> ais_items, local_items;
+ const LLSD& cof_raw = content["cof_raw"];
+ for (LLSD::array_const_iterator it = cof_raw.beginArray();
+ it != cof_raw.endArray(); ++it)
{
- LL_DEBUGS("Avatar") << "content: " << ll_pretty_print_sd(content) << LL_ENDL;
- if (content["success"].asBoolean())
+ const LLSD& item = *it;
+ if (item["parent_id"].asUUID() == LLAppearanceMgr::instance().getCOF())
{
- LL_DEBUGS("Avatar") << "OK" << LL_ENDL;
- if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"))
+ ais_items.insert(item["item_id"].asUUID());
+ if (item["type"].asInteger() == 24) // link
{
- dumpContents(gAgentAvatarp->getFullname() + "_appearance_request_ok", content);
+ LL_INFOS("Avatar") << "AIS Link: item_id: " << item["item_id"].asUUID()
+ << " linked_item_id: " << item["asset_id"].asUUID()
+ << " name: " << item["name"].asString()
+ << LL_ENDL;
+ }
+ else if (item["type"].asInteger() == 25) // folder link
+ {
+ LL_INFOS("Avatar") << "AIS Folder link: item_id: " << item["item_id"].asUUID()
+ << " linked_item_id: " << item["asset_id"].asUUID()
+ << " name: " << item["name"].asString()
+ << LL_ENDL;
+ }
+ else
+ {
+ LL_INFOS("Avatar") << "AIS Other: item_id: " << item["item_id"].asUUID()
+ << " linked_item_id: " << item["asset_id"].asUUID()
+ << " name: " << item["name"].asString()
+ << " type: " << item["type"].asInteger()
+ << LL_ENDL;
}
}
- else
+ }
+ LL_INFOS("Avatar") << LL_ENDL;
+ LL_INFOS("Avatar") << "Local COF, version requested: " << content["observed"].asInteger()
+ << " ================================= " << LL_ENDL;
+ LLInventoryModel::cat_array_t cat_array;
+ LLInventoryModel::item_array_t item_array;
+ gInventory.collectDescendents(LLAppearanceMgr::instance().getCOF(),
+ cat_array,item_array,LLInventoryModel::EXCLUDE_TRASH);
+ for (S32 i=0; i<item_array.size(); i++)
+ {
+ const LLViewerInventoryItem* inv_item = item_array.at(i).get();
+ local_items.insert(inv_item->getUUID());
+ LL_INFOS("Avatar") << "LOCAL: item_id: " << inv_item->getUUID()
+ << " linked_item_id: " << inv_item->getLinkedUUID()
+ << " name: " << inv_item->getName()
+ << " parent: " << inv_item->getParentUUID()
+ << LL_ENDL;
+ }
+ LL_INFOS("Avatar") << " ================================= " << LL_ENDL;
+ S32 local_only = 0, ais_only = 0;
+ for (std::set<LLUUID>::iterator it = local_items.begin(); it != local_items.end(); ++it)
+ {
+ if (ais_items.find(*it) == ais_items.end())
{
- onFailure(200);
+ LL_INFOS("Avatar") << "LOCAL ONLY: " << *it << LL_ENDL;
+ local_only++;
}
}
-
- // Error
- /*virtual*/ void errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+ for (std::set<LLUUID>::iterator it = ais_items.begin(); it != ais_items.end(); ++it)
{
- llwarns << "appearance update request failed, status: " << status << " reason: " << reason << " code: " << content["code"].asInteger() << " error: \"" << content["error"].asString() << "\"" << llendl;
- if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"))
+ if (local_items.find(*it) == local_items.end())
{
- dumpContents(gAgentAvatarp->getFullname() + "_appearance_request_error", content);
- debugCOF(content);
-
+ LL_INFOS("Avatar") << "AIS ONLY: " << *it << LL_ENDL;
+ ais_only++;
}
- onFailure(status);
- }
+ }
+ if (local_only==0 && ais_only==0)
+ {
+ LL_INFOS("Avatar") << "COF contents identical, only version numbers differ (req "
+ << content["observed"].asInteger()
+ << " rcv " << content["expected"].asInteger()
+ << ")" << LL_ENDL;
+ }
+}
- void onFailure(U32 status)
+/* virtual */ void RequestAgentUpdateAppearanceResponder::httpSuccess()
+{
+ const LLSD& content = getContent();
+ if (!content.isMap())
{
- F32 seconds_to_wait;
- if (mRetryPolicy->shouldRetry(status,seconds_to_wait))
- {
- llinfos << "retrying" << llendl;
- doAfterInterval(boost::bind(&LLAppearanceMgr::requestServerAppearanceUpdate,
- LLAppearanceMgr::getInstance(),
- LLCurl::ResponderPtr(this)),
- seconds_to_wait);
- }
- else
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
+ if (content["success"].asBoolean())
+ {
+ LL_DEBUGS("Avatar") << "succeeded" << LL_ENDL;
+ if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"))
{
- llwarns << "giving up after too many retries" << llendl;
+ dump_sequential_xml(gAgentAvatarp->getFullname() + "_appearance_request_ok", content);
}
- }
- void dumpContents(const std::string outprefix, const LLSD& content)
+ onSuccess();
+ }
+ else
{
- std::string outfilename = get_sequential_numbered_file_name(outprefix,".xml");
- std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename);
- std::ofstream ofs(fullpath.c_str(), std::ios_base::out);
- ofs << LLSDOStreamer<LLSDXMLFormatter>(content, LLSDFormatter::OPTIONS_PRETTY);
- LL_DEBUGS("Avatar") << "results saved to: " << fullpath << LL_ENDL;
+ failureResult(HTTP_INTERNAL_ERROR, "Non-success response", content);
}
+}
- void debugCOF(const LLSD& content)
+void RequestAgentUpdateAppearanceResponder::onSuccess()
+{
+ mInFlightCounter = llmax(mInFlightCounter-1,0);
+}
+
+/*virtual*/ void RequestAgentUpdateAppearanceResponder::httpFailure()
+{
+ LL_WARNS("Avatar") << "appearance update request failed, status "
+ << getStatus() << " reason " << getReason() << LL_ENDL;
+
+ if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"))
{
- LL_DEBUGS("Avatar") << "AIS COF, version found: " << content["expected"].asInteger() << llendl;
- std::set<LLUUID> ais_items, local_items;
- const LLSD& cof_raw = content["cof_raw"];
- for (LLSD::array_const_iterator it = cof_raw.beginArray();
- it != cof_raw.endArray(); ++it)
- {
- const LLSD& item = *it;
- if (item["parent_id"].asUUID() == LLAppearanceMgr::instance().getCOF())
- {
- ais_items.insert(item["item_id"].asUUID());
- if (item["type"].asInteger() == 24) // link
- {
- LL_DEBUGS("Avatar") << "Link: item_id: " << item["item_id"].asUUID()
- << " linked_item_id: " << item["asset_id"].asUUID()
- << " name: " << item["name"].asString()
- << llendl;
- }
- else if (item["type"].asInteger() == 25) // folder link
- {
- LL_DEBUGS("Avatar") << "Folder link: item_id: " << item["item_id"].asUUID()
- << " linked_item_id: " << item["asset_id"].asUUID()
- << " name: " << item["name"].asString()
- << llendl;
-
- }
- else
- {
- LL_DEBUGS("Avatar") << "Other: item_id: " << item["item_id"].asUUID()
- << " linked_item_id: " << item["asset_id"].asUUID()
- << " name: " << item["name"].asString()
- << llendl;
- }
- }
- }
- LL_DEBUGS("Avatar") << llendl;
- LL_DEBUGS("Avatar") << "Local COF, version requested: " << content["observed"].asInteger() << llendl;
- LLInventoryModel::cat_array_t cat_array;
- LLInventoryModel::item_array_t item_array;
- gInventory.collectDescendents(LLAppearanceMgr::instance().getCOF(),
- cat_array,item_array,LLInventoryModel::EXCLUDE_TRASH);
- for (S32 i=0; i<item_array.count(); i++)
- {
- const LLViewerInventoryItem* inv_item = item_array.get(i).get();
- local_items.insert(inv_item->getUUID());
- LL_DEBUGS("Avatar") << "item_id: " << inv_item->getUUID()
- << " linked_item_id: " << inv_item->getLinkedUUID()
- << " name: " << inv_item->getName()
- << llendl;
- }
- LL_DEBUGS("Avatar") << llendl;
- for (std::set<LLUUID>::iterator it = local_items.begin(); it != local_items.end(); ++it)
- {
- if (ais_items.find(*it) == ais_items.end())
- {
- LL_DEBUGS("Avatar") << "LOCAL ONLY: " << *it << llendl;
- }
- }
- for (std::set<LLUUID>::iterator it = ais_items.begin(); it != ais_items.end(); ++it)
- {
- if (local_items.find(*it) == local_items.end())
- {
- LL_DEBUGS("Avatar") << "AIS ONLY: " << *it << llendl;
- }
- }
+ const LLSD& content = getContent();
+ dump_sequential_xml(gAgentAvatarp->getFullname() + "_appearance_request_error", content);
+ debugCOF(content);
}
+ onFailure();
+}
+
+void RequestAgentUpdateAppearanceResponder::onFailure()
+{
+ mInFlightCounter = llmax(mInFlightCounter-1,0);
+
+ F32 seconds_to_wait;
+ mRetryPolicy->onFailure(getStatus(), getResponseHeaders());
+ if (mRetryPolicy->shouldRetry(seconds_to_wait))
+ {
+ LL_INFOS() << "retrying" << LL_ENDL;
+ doAfterInterval(boost::bind(&RequestAgentUpdateAppearanceResponder::sendRequest,this),
+ seconds_to_wait);
+ }
+ else
+ {
+ LL_WARNS() << "giving up after too many retries" << LL_ENDL;
+ }
+}
- LLPointer<LLHTTPRetryPolicy> mRetryPolicy;
-};
LLSD LLAppearanceMgr::dumpCOF() const
{
@@ -3159,9 +3395,9 @@ LLSD LLAppearanceMgr::dumpCOF() const
LLInventoryModel::cat_array_t cat_array;
LLInventoryModel::item_array_t item_array;
gInventory.collectDescendents(getCOF(),cat_array,item_array,LLInventoryModel::EXCLUDE_TRASH);
- for (S32 i=0; i<item_array.count(); i++)
+ for (S32 i=0; i<item_array.size(); i++)
{
- const LLViewerInventoryItem* inv_item = item_array.get(i).get();
+ const LLViewerInventoryItem* inv_item = item_array.at(i).get();
LLSD item;
LLUUID item_id(inv_item->getUUID());
md5.update((unsigned char*)item_id.mData, 16);
@@ -3177,17 +3413,17 @@ LLSD LLAppearanceMgr::dumpCOF() const
const LLViewerInventoryItem* linked_item = inv_item->getLinkedItem();
if (NULL == linked_item)
{
- llwarns << "Broken link for item '" << inv_item->getName()
+ LL_WARNS() << "Broken link for item '" << inv_item->getName()
<< "' (" << inv_item->getUUID()
- << ") during requestServerAppearanceUpdate" << llendl;
+ << ") during requestServerAppearanceUpdate" << LL_ENDL;
continue;
}
// Some assets may be 'hidden' and show up as null in the viewer.
//if (linked_item->getAssetUUID().isNull())
//{
- // llwarns << "Broken link (null asset) for item '" << inv_item->getName()
+ // LL_WARNS() << "Broken link (null asset) for item '" << inv_item->getName()
// << "' (" << inv_item->getUUID()
- // << ") during requestServerAppearanceUpdate" << llendl;
+ // << ") during requestServerAppearanceUpdate" << LL_ENDL;
// continue;
//}
LLUUID linked_asset_id(linked_item->getAssetUUID());
@@ -3197,10 +3433,10 @@ LLSD LLAppearanceMgr::dumpCOF() const
}
else if (LLAssetType::AT_LINK_FOLDER != inv_item->getActualType())
{
- llwarns << "Non-link item '" << inv_item->getName()
+ LL_WARNS() << "Non-link item '" << inv_item->getName()
<< "' (" << inv_item->getUUID()
<< ") type " << (S32) inv_item->getActualType()
- << " during requestServerAppearanceUpdate" << llendl;
+ << " during requestServerAppearanceUpdate" << LL_ENDL;
continue;
}
links.append(item);
@@ -3214,58 +3450,14 @@ LLSD LLAppearanceMgr::dumpCOF() const
return result;
}
-void LLAppearanceMgr::requestServerAppearanceUpdate(LLCurl::ResponderPtr responder_ptr)
+void LLAppearanceMgr::requestServerAppearanceUpdate()
{
- if (gAgentAvatarp->isEditingAppearance())
- {
- // don't send out appearance updates if in appearance editing mode
- return;
- }
-
- if (!gAgent.getRegion())
- {
- llwarns << "Region not set, cannot request server appearance update" << llendl;
- return;
- }
- if (gAgent.getRegion()->getCentralBakeVersion()==0)
- {
- llwarns << "Region does not support baking" << llendl;
- }
- std::string url = gAgent.getRegion()->getCapability("UpdateAvatarAppearance");
- if (url.empty())
- {
- llwarns << "No cap for UpdateAvatarAppearance." << llendl;
- return;
- }
-
- LLSD body;
- S32 cof_version = getCOFVersion();
- if (gSavedSettings.getBOOL("DebugAvatarExperimentalServerAppearanceUpdate"))
- {
- body = dumpCOF();
- }
- else
- {
- body["cof_version"] = cof_version;
- if (gSavedSettings.getBOOL("DebugForceAppearanceRequestFailure"))
- {
- body["cof_version"] = cof_version+999;
- }
- }
- LL_DEBUGS("Avatar") << "request url " << url << " my_cof_version " << cof_version << llendl;
-
- //LLCurl::ResponderPtr responder_ptr;
- if (!responder_ptr.get())
- {
- responder_ptr = new RequestAgentUpdateAppearanceResponder;
- }
- LLHTTPClient::post(url, body, responder_ptr);
- llassert(cof_version >= gAgentAvatarp->mLastUpdateRequestCOFVersion);
- gAgentAvatarp->mLastUpdateRequestCOFVersion = cof_version;
+ mAppearanceResponder->onRequestRequested();
}
class LLIncrementCofVersionResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(LLIncrementCofVersionResponder);
public:
LLIncrementCofVersionResponder() : LLHTTPClient::Responder()
{
@@ -3276,24 +3468,33 @@ public:
{
}
- virtual void result(const LLSD &pContent)
+protected:
+ virtual void httpSuccess()
{
- llinfos << "Successfully incremented agent's COF." << llendl;
- S32 new_version = pContent["category"]["version"].asInteger();
+ LL_INFOS() << "Successfully incremented agent's COF." << LL_ENDL;
+ const LLSD& content = getContent();
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
+ S32 new_version = content["category"]["version"].asInteger();
// cof_version should have increased
llassert(new_version > gAgentAvatarp->mLastUpdateRequestCOFVersion);
gAgentAvatarp->mLastUpdateRequestCOFVersion = new_version;
}
- virtual void errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& content)
+
+ virtual void httpFailure()
{
- llwarns << "While attempting to increment the agent's cof we got an error with [status:"
- << pStatus << "]: " << content << llendl;
+ LL_WARNS("Avatar") << "While attempting to increment the agent's cof we got an error "
+ << dumpResponse() << LL_ENDL;
F32 seconds_to_wait;
- if (mRetryPolicy->shouldRetry(pStatus,seconds_to_wait))
+ mRetryPolicy->onFailure(getStatus(), getResponseHeaders());
+ if (mRetryPolicy->shouldRetry(seconds_to_wait))
{
- llinfos << "retrying" << llendl;
+ LL_INFOS() << "retrying" << LL_ENDL;
doAfterInterval(boost::bind(&LLAppearanceMgr::incrementCofVersion,
LLAppearanceMgr::getInstance(),
LLHTTPClient::ResponderPtr(this)),
@@ -3301,10 +3502,11 @@ public:
}
else
{
- llwarns << "giving up after too many retries" << llendl;
+ LL_WARNS() << "giving up after too many retries" << LL_ENDL;
}
}
+private:
LLPointer<LLHTTPRetryPolicy> mRetryPolicy;
};
@@ -3313,19 +3515,19 @@ void LLAppearanceMgr::incrementCofVersion(LLHTTPClient::ResponderPtr responder_p
// If we don't have a region, report it as an error
if (gAgent.getRegion() == NULL)
{
- llwarns << "Region not set, cannot request cof_version increment" << llendl;
+ LL_WARNS() << "Region not set, cannot request cof_version increment" << LL_ENDL;
return;
}
std::string url = gAgent.getRegion()->getCapability("IncrementCofVersion");
if (url.empty())
{
- llwarns << "No cap for IncrementCofVersion." << llendl;
+ LL_WARNS() << "No cap for IncrementCofVersion." << LL_ENDL;
return;
}
- llinfos << "Requesting cof_version be incremented via capability to: "
- << url << llendl;
+ LL_INFOS() << "Requesting cof_version be incremented via capability to: "
+ << url << LL_ENDL;
LLSD headers;
LLSD body = LLSD::emptyMap();
@@ -3337,6 +3539,15 @@ void LLAppearanceMgr::incrementCofVersion(LLHTTPClient::ResponderPtr responder_p
LLHTTPClient::get(url, body, responder_ptr, headers, 30.0f);
}
+U32 LLAppearanceMgr::getNumAttachmentsInCOF()
+{
+ const LLUUID cof = getCOF();
+ LLInventoryModel::item_array_t obj_items;
+ getDescendentsOfAssetType(cof, obj_items, LLAssetType::AT_OBJECT);
+ return obj_items.size();
+}
+
+
std::string LLAppearanceMgr::getAppearanceServiceURL() const
{
if (gSavedSettings.getString("DebugAvatarAppearanceServiceURLOverride").empty())
@@ -3347,57 +3558,91 @@ std::string LLAppearanceMgr::getAppearanceServiceURL() const
}
void show_created_outfit(LLUUID& folder_id, bool show_panel = true)
+{
+ if (!LLApp::isRunning())
{
- if (!LLApp::isRunning())
- {
- llwarns << "called during shutdown, skipping" << llendl;
- return;
- }
-
- LLSD key;
-
+ LL_WARNS() << "called during shutdown, skipping" << LL_ENDL;
+ return;
+ }
+
+ LL_DEBUGS("Avatar") << "called" << LL_ENDL;
+ LLSD key;
+
//EXT-7727. For new accounts inventory callback is created during login process
// and may be processed after login process is finished
if (show_panel)
- {
- LLFloaterSidePanelContainer::showPanel("appearance", "panel_outfits_inventory", key);
-
- }
- LLOutfitsList *outfits_list =
- dynamic_cast<LLOutfitsList*>(LLFloaterSidePanelContainer::getPanel("appearance", "outfitslist_tab"));
- if (outfits_list)
- {
+ {
+ LL_DEBUGS("Avatar") << "showing panel" << LL_ENDL;
+ LLFloaterSidePanelContainer::showPanel("appearance", "panel_outfits_inventory", key);
+
+ }
+ LLOutfitsList *outfits_list =
+ dynamic_cast<LLOutfitsList*>(LLFloaterSidePanelContainer::getPanel("appearance", "outfitslist_tab"));
+ if (outfits_list)
+ {
outfits_list->setSelectedOutfitByUUID(folder_id);
- }
-
- LLAppearanceMgr::getInstance()->updateIsDirty();
- gAgentWearables.notifyLoadingFinished(); // New outfit is saved.
- LLAppearanceMgr::getInstance()->updatePanelOutfitName("");
}
+
+ LLAppearanceMgr::getInstance()->updateIsDirty();
+ gAgentWearables.notifyLoadingFinished(); // New outfit is saved.
+ LLAppearanceMgr::getInstance()->updatePanelOutfitName("");
+
+ // For SSB, need to update appearance after we add a base outfit
+ // link, since, the COF version has changed. There is a race
+ // condition in initial outfit setup which can lead to rez
+ // failures - SH-3860.
+ LL_DEBUGS("Avatar") << "requesting appearance update after createBaseOutfitLink" << LL_ENDL;
+ LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy;
+ LLAppearanceMgr::getInstance()->createBaseOutfitLink(folder_id, cb);
+}
-LLUUID LLAppearanceMgr::makeNewOutfitLinks(const std::string& new_folder_name, bool show_panel)
+void LLAppearanceMgr::onOutfitFolderCreated(const LLUUID& folder_id, bool show_panel)
{
- if (!isAgentAvatarValid()) return LLUUID::null;
-
- gAgentWearables.notifyLoadingStarted();
+ LLPointer<LLInventoryCallback> cb =
+ new LLBoostFuncInventoryCallback(no_op_inventory_func,
+ boost::bind(&LLAppearanceMgr::onOutfitFolderCreatedAndClothingOrdered,this,folder_id,show_panel));
+ updateClothingOrderingInfo(LLUUID::null, cb);
+}
- // First, make a folder in the My Outfits directory.
- const LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS);
- LLUUID folder_id = gInventory.createNewCategory(
- parent_id,
- LLFolderType::FT_OUTFIT,
- new_folder_name);
+void LLAppearanceMgr::onOutfitFolderCreatedAndClothingOrdered(const LLUUID& folder_id, bool show_panel)
+{
+ LLPointer<LLInventoryCallback> cb =
+ new LLBoostFuncInventoryCallback(no_op_inventory_func,
+ boost::bind(show_created_outfit,folder_id,show_panel));
+ bool copy_folder_links = false;
+ slamCategoryLinks(getCOF(), folder_id, copy_folder_links, cb);
+}
- updateClothingOrderingInfo();
+void LLAppearanceMgr::makeNewOutfitLinks(const std::string& new_folder_name, bool show_panel)
+{
+ if (!isAgentAvatarValid()) return;
- LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(no_op_inventory_func,
- boost::bind(show_created_outfit,folder_id,show_panel));
- shallowCopyCategoryContents(getCOF(),folder_id, cb);
- createBaseOutfitLink(folder_id, cb);
+ LL_DEBUGS("Avatar") << "creating new outfit" << LL_ENDL;
- dumpCat(folder_id,"COF, new outfit");
+ gAgentWearables.notifyLoadingStarted();
- return folder_id;
+ // First, make a folder in the My Outfits directory.
+ const LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS);
+ if (AISCommand::isAPIAvailable())
+ {
+ // cap-based category creation was buggy until recently. use
+ // existence of AIS as an indicator the fix is present. Does
+ // not actually use AIS to create the category.
+ inventory_func_type func = boost::bind(&LLAppearanceMgr::onOutfitFolderCreated,this,_1,show_panel);
+ LLUUID folder_id = gInventory.createNewCategory(
+ parent_id,
+ LLFolderType::FT_OUTFIT,
+ new_folder_name,
+ func);
+ }
+ else
+ {
+ LLUUID folder_id = gInventory.createNewCategory(
+ parent_id,
+ LLFolderType::FT_OUTFIT,
+ new_folder_name);
+ onOutfitFolderCreated(folder_id, show_panel);
+ }
}
void LLAppearanceMgr::wearBaseOutfit()
@@ -3412,24 +3657,25 @@ void LLAppearanceMgr::removeItemsFromAvatar(const uuid_vec_t& ids_to_remove)
{
if (ids_to_remove.empty())
{
- llwarns << "called with empty list, nothing to do" << llendl;
+ LL_WARNS() << "called with empty list, nothing to do" << LL_ENDL;
+ return;
}
+ LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy;
for (uuid_vec_t::const_iterator it = ids_to_remove.begin(); it != ids_to_remove.end(); ++it)
{
const LLUUID& id_to_remove = *it;
const LLUUID& linked_item_id = gInventory.getLinkedItemID(id_to_remove);
- removeCOFItemLinks(linked_item_id);
+ removeCOFItemLinks(linked_item_id, cb);
addDoomedTempAttachment(linked_item_id);
}
- updateAppearanceFromCOF();
}
void LLAppearanceMgr::removeItemFromAvatar(const LLUUID& id_to_remove)
{
LLUUID linked_item_id = gInventory.getLinkedItemID(id_to_remove);
- removeCOFItemLinks(linked_item_id);
+ LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy;
+ removeCOFItemLinks(linked_item_id, cb);
addDoomedTempAttachment(linked_item_id);
- updateAppearanceFromCOF();
}
@@ -3442,7 +3688,7 @@ void LLAppearanceMgr::addDoomedTempAttachment(const LLUUID& id_to_remove)
{ // If this is a temp attachment and we want to remove it, record the ID
// so it will be deleted when attachments are synced up with COF
mDoomedTempAttachmentIDs.insert(id_to_remove);
- //llinfos << "Will remove temp attachment id " << id_to_remove << llendl;
+ //LL_INFOS() << "Will remove temp attachment id " << id_to_remove << LL_ENDL;
}
}
@@ -3489,7 +3735,12 @@ bool LLAppearanceMgr::moveWearable(LLViewerInventoryItem* item, bool closer_to_b
swap_item->setDescription(item->getActualDescription());
item->setDescription(tmp);
+ // LL_DEBUGS("Inventory") << "swap, item "
+ // << ll_pretty_print_sd(item->asLLSD())
+ // << " swap_item "
+ // << ll_pretty_print_sd(swap_item->asLLSD()) << LL_ENDL;
+ // FIXME switch to use AISv3 where supported.
//items need to be updated on a dataserver
item->setComplete(TRUE);
item->updateServer(FALSE);
@@ -3503,7 +3754,7 @@ bool LLAppearanceMgr::moveWearable(LLViewerInventoryItem* item, bool closer_to_b
bool result = false;
if (result = gAgentWearables.moveWearable(item, closer_to_body))
{
- gAgentAvatarp->wearableUpdated(item->getWearableType(), FALSE);
+ gAgentAvatarp->wearableUpdated(item->getWearableType());
}
setOutfitDirty(true);
@@ -3531,26 +3782,26 @@ void LLAppearanceMgr::dumpCat(const LLUUID& cat_id, const std::string& msg)
gInventory.collectDescendents(cat_id, cats, items, LLInventoryModel::EXCLUDE_TRASH);
#ifdef DUMP_CAT_VERBOSE
- llinfos << llendl;
- llinfos << str << llendl;
+ LL_INFOS() << LL_ENDL;
+ LL_INFOS() << str << LL_ENDL;
S32 hitcount = 0;
- for(S32 i=0; i<items.count(); i++)
+ for(S32 i=0; i<items.size(); i++)
{
LLViewerInventoryItem *item = items.get(i);
if (item)
hitcount++;
- llinfos << i <<" "<< item->getName() <<llendl;
+ LL_INFOS() << i <<" "<< item->getName() <<LL_ENDL;
}
#endif
- llinfos << msg << " count " << items.count() << llendl;
+ LL_INFOS() << msg << " count " << items.size() << LL_ENDL;
}
void LLAppearanceMgr::dumpItemArray(const LLInventoryModel::item_array_t& items,
const std::string& msg)
{
- for (S32 i=0; i<items.count(); i++)
+ for (S32 i=0; i<items.size(); i++)
{
- LLViewerInventoryItem *item = items.get(i);
+ LLViewerInventoryItem *item = items.at(i);
LLViewerInventoryItem *linked_item = item ? item->getLinkedItem() : NULL;
LLUUID asset_id;
if (linked_item)
@@ -3565,7 +3816,8 @@ LLAppearanceMgr::LLAppearanceMgr():
mAttachmentInvLinkEnabled(false),
mOutfitIsDirty(false),
mOutfitLocked(false),
- mIsInUpdateAppearanceFromCOF(false)
+ mIsInUpdateAppearanceFromCOF(false),
+ mAppearanceResponder(new RequestAgentUpdateAppearanceResponder)
{
LLOutfitObserver& outfit_observer = LLOutfitObserver::instance();
@@ -3585,13 +3837,13 @@ LLAppearanceMgr::~LLAppearanceMgr()
void LLAppearanceMgr::setAttachmentInvLinkEnable(bool val)
{
- LL_DEBUGS("Avatar") << "setAttachmentInvLinkEnable => " << (int) val << llendl;
+ LL_DEBUGS("Avatar") << "setAttachmentInvLinkEnable => " << (int) val << LL_ENDL;
mAttachmentInvLinkEnabled = val;
}
void dumpAttachmentSet(const std::set<LLUUID>& atts, const std::string& msg)
{
- llinfos << msg << llendl;
+ LL_INFOS() << msg << LL_ENDL;
for (std::set<LLUUID>::const_iterator it = atts.begin();
it != atts.end();
++it)
@@ -3599,11 +3851,11 @@ void dumpAttachmentSet(const std::set<LLUUID>& atts, const std::string& msg)
LLUUID item_id = *it;
LLViewerInventoryItem *item = gInventory.getItem(item_id);
if (item)
- llinfos << "atts " << item->getName() << llendl;
+ LL_INFOS() << "atts " << item->getName() << LL_ENDL;
else
- llinfos << "atts " << "UNKNOWN[" << item_id.asString() << "]" << llendl;
+ LL_INFOS() << "atts " << "UNKNOWN[" << item_id.asString() << "]" << LL_ENDL;
}
- llinfos << llendl;
+ LL_INFOS() << LL_ENDL;
}
void LLAppearanceMgr::registerAttachment(const LLUUID& item_id)
@@ -3615,11 +3867,15 @@ void LLAppearanceMgr::registerAttachment(const LLUUID& item_id)
// we have to pass do_update = true to call LLAppearanceMgr::updateAppearanceFromCOF.
// it will trigger gAgentWariables.notifyLoadingFinished()
// But it is not acceptable solution. See EXT-7777
- LLAppearanceMgr::addCOFItemLink(item_id, false); // Add COF link for item.
+ if (!isLinkedInCOF(item_id))
+ {
+ LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy();
+ LLAppearanceMgr::addCOFItemLink(item_id, cb); // Add COF link for item.
+ }
}
else
{
- //llinfos << "no link changes, inv link not enabled" << llendl;
+ //LL_INFOS() << "no link changes, inv link not enabled" << LL_ENDL;
}
}
@@ -3633,28 +3889,27 @@ void LLAppearanceMgr::unregisterAttachment(const LLUUID& item_id)
}
else
{
- //llinfos << "no link changes, inv link not enabled" << llendl;
+ //LL_INFOS() << "no link changes, inv link not enabled" << LL_ENDL;
}
}
BOOL LLAppearanceMgr::getIsInCOF(const LLUUID& obj_id) const
{
- return gInventory.isObjectDescendentOf(obj_id, getCOF());
+ const LLUUID& cof = getCOF();
+ if (obj_id == cof)
+ return TRUE;
+ const LLInventoryObject* obj = gInventory.getObject(obj_id);
+ if (obj && obj->getParentUUID() == cof)
+ return TRUE;
+ return FALSE;
}
// static
bool LLAppearanceMgr::isLinkInCOF(const LLUUID& obj_id)
{
- LLInventoryModel::cat_array_t cats;
- LLInventoryModel::item_array_t items;
- LLLinkedItemIDMatches find_links(gInventory.getLinkedItemID(obj_id));
- gInventory.collectDescendentsIf(LLAppearanceMgr::instance().getCOF(),
- cats,
- items,
- LLInventoryModel::EXCLUDE_TRASH,
- find_links);
-
- return !items.empty();
+ const LLUUID& target_id = gInventory.getLinkedItemID(obj_id);
+ LLLinkedItemIDMatches find_links(target_id);
+ return gInventory.hasMatchingDirectDescendent(LLAppearanceMgr::instance().getCOF(), find_links);
}
BOOL LLAppearanceMgr::getIsProtectedCOFItem(const LLUUID& obj_id) const
@@ -3671,18 +3926,6 @@ BOOL LLAppearanceMgr::getIsProtectedCOFItem(const LLUUID& obj_id) const
// For now, don't allow direct deletion from the COF. Instead, force users
// to choose "Detach" or "Take Off".
return TRUE;
- /*
- const LLInventoryObject *obj = gInventory.getObject(obj_id);
- if (!obj) return FALSE;
-
- // Can't delete bodyparts, since this would be equivalent to removing the item.
- if (obj->getType() == LLAssetType::AT_BODYPART) return TRUE;
-
- // Can't delete the folder link, since this is saved for bookkeeping.
- if (obj->getActualType() == LLAssetType::AT_LINK_FOLDER) return TRUE;
-
- return FALSE;
- */
}
class CallAfterCategoryFetchStage2: public LLInventoryFetchItemsObserver
@@ -3699,8 +3942,8 @@ public:
}
virtual void done()
{
- llinfos << this << " done with incomplete " << mIncomplete.size()
- << " complete " << mComplete.size() << " calling callable" << llendl;
+ LL_INFOS() << this << " done with incomplete " << mIncomplete.size()
+ << " complete " << mComplete.size() << " calling callable" << LL_ENDL;
gInventory.removeObserver(this);
doOnIdleOneTime(mCallable);
@@ -3732,11 +3975,11 @@ public:
cat_array,
item_array,
LLInventoryModel::EXCLUDE_TRASH);
- S32 count = item_array.count();
+ S32 count = item_array.size();
if(!count)
{
- llwarns << "Nothing fetched in category " << mComplete.front()
- << llendl;
+ LL_WARNS() << "Nothing fetched in category " << mComplete.front()
+ << LL_ENDL;
gInventory.removeObserver(this);
doOnIdleOneTime(mCallable);
@@ -3744,11 +3987,11 @@ public:
return;
}
- llinfos << "stage1 got " << item_array.count() << " items, passing to stage2 " << llendl;
+ LL_INFOS() << "stage1 got " << item_array.size() << " items, passing to stage2 " << LL_ENDL;
uuid_vec_t ids;
for(S32 i = 0; i < count; ++i)
{
- ids.push_back(item_array.get(i)->getUUID());
+ ids.push_back(item_array.at(i)->getUUID());
}
gInventory.removeObserver(this);
@@ -3823,7 +4066,7 @@ public:
LLAppearanceMgr::getInstance()->wearInventoryCategory(category, true, false);
// *TODOw: This may not be necessary if initial outfit is chosen already -- josh
- gAgent.setGenderChosen(TRUE);
+ gAgent.setOutfitChosen(TRUE);
}
// release avatar picker keyboard focus
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index 5ec80f1cf0..7742a19c07 100755
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -34,10 +34,12 @@
#include "llinventorymodel.h"
#include "llinventoryobserver.h"
#include "llviewerinventory.h"
+#include "llhttpclient.h"
class LLWearableHoldingPattern;
class LLInventoryCallback;
class LLOutfitUnLockTimer;
+class RequestAgentUpdateAppearanceResponder;
class LLAppearanceMgr: public LLSingleton<LLAppearanceMgr>
{
@@ -49,7 +51,9 @@ class LLAppearanceMgr: public LLSingleton<LLAppearanceMgr>
public:
typedef std::vector<LLInventoryModel::item_array_t> wearables_by_type_t;
- void updateAppearanceFromCOF(bool update_base_outfit_ordering = false);
+ void updateAppearanceFromCOF(bool enforce_item_restrictions = true,
+ bool enforce_ordering = true,
+ nullary_func_t post_update_func = no_op);
bool needToSaveCOF();
void updateCOF(const LLUUID& category, bool append = false);
void wearInventoryCategory(LLInventoryCategory* category, bool copy, bool append);
@@ -64,9 +68,18 @@ public:
S32 findExcessOrDuplicateItems(const LLUUID& cat_id,
LLAssetType::EType type,
S32 max_items,
- LLInventoryModel::item_array_t& items_to_kill);
- void enforceItemRestrictions();
-
+ LLInventoryObject::object_list_t& items_to_kill);
+ void findAllExcessOrDuplicateItems(const LLUUID& cat_id,
+ LLInventoryObject::object_list_t& items_to_kill);
+ void enforceCOFItemRestrictions(LLPointer<LLInventoryCallback> cb);
+
+ S32 getActiveCopyOperations() const;
+
+ // Replace category contents with copied links via the slam_inventory_folder
+ // command (single inventory operation where supported)
+ void slamCategoryLinks(const LLUUID& src_id, const LLUUID& dst_id,
+ bool include_folder_links, LLPointer<LLInventoryCallback> cb);
+
// Copy all items and the src category itself.
void shallowCopyCategory(const LLUUID& src_id, const LLUUID& dst_id,
LLPointer<LLInventoryCallback> cb);
@@ -105,15 +118,18 @@ public:
const LLUUID getBaseOutfitUUID();
// Wear/attach an item (from a user's inventory) on the agent
- bool wearItemOnAvatar(const LLUUID& item_to_wear, bool do_update = true, bool replace = false, LLPointer<LLInventoryCallback> cb = NULL);
+ bool wearItemOnAvatar(const LLUUID& item_to_wear, bool do_update, bool replace = false,
+ LLPointer<LLInventoryCallback> cb = NULL);
// Update the displayed outfit name in UI.
void updatePanelOutfitName(const std::string& name);
- void purgeBaseOutfitLink(const LLUUID& category);
+ void purgeBaseOutfitLink(const LLUUID& category, LLPointer<LLInventoryCallback> cb = NULL);
void createBaseOutfitLink(const LLUUID& category, LLPointer<LLInventoryCallback> link_waiter);
- void updateAgentWearables(LLWearableHoldingPattern* holder, bool append);
+ void updateAgentWearables(LLWearableHoldingPattern* holder);
+
+ S32 countActiveHoldingPatterns();
// For debugging - could be moved elsewhere.
void dumpCat(const LLUUID& cat_id, const std::string& msg);
@@ -124,21 +140,17 @@ public:
void registerAttachment(const LLUUID& item_id);
void setAttachmentInvLinkEnable(bool val);
- // utility function for bulk linking.
- void linkAll(const LLUUID& category,
- LLInventoryModel::item_array_t& items,
- LLPointer<LLInventoryCallback> cb);
-
// Add COF link to individual item.
- void addCOFItemLink(const LLUUID& item_id, bool do_update = true, LLPointer<LLInventoryCallback> cb = NULL, const std::string description = "");
- void addCOFItemLink(const LLInventoryItem *item, bool do_update = true, LLPointer<LLInventoryCallback> cb = NULL, const std::string description = "");
+ void addCOFItemLink(const LLUUID& item_id, LLPointer<LLInventoryCallback> cb = NULL, const std::string description = "");
+ void addCOFItemLink(const LLInventoryItem *item, LLPointer<LLInventoryCallback> cb = NULL, const std::string description = "");
// Find COF entries referencing the given item.
LLInventoryModel::item_array_t findCOFItemLinks(const LLUUID& item_id);
+ bool isLinkedInCOF(const LLUUID& item_id);
// Remove COF entries
- void removeCOFItemLinks(const LLUUID& item_id);
- void removeCOFLinksOfType(LLWearableType::EType type);
+ void removeCOFItemLinks(const LLUUID& item_id, LLPointer<LLInventoryCallback> cb = NULL);
+ void removeCOFLinksOfType(LLWearableType::EType type, LLPointer<LLInventoryCallback> cb = NULL);
void removeAllClothesFromAvatar();
void removeAllAttachmentsFromAvatar();
@@ -155,12 +167,11 @@ public:
// should only be necessary to do on initial login.
void updateIsDirty();
+ void setOutfitLocked(bool locked);
+
// Called when self avatar is first fully visible.
void onFirstFullyVisible();
- // Create initial outfits from library.
- void autopopulateOutfits();
-
// Copy initial gestures from library.
void copyLibraryGestures();
@@ -175,7 +186,10 @@ public:
void removeItemFromAvatar(const LLUUID& item_id);
- LLUUID makeNewOutfitLinks(const std::string& new_folder_name,bool show_panel = true);
+ void onOutfitFolderCreated(const LLUUID& folder_id, bool show_panel);
+ void onOutfitFolderCreatedAndClothingOrdered(const LLUUID& folder_id, bool show_panel);
+
+ void makeNewOutfitLinks(const std::string& new_folder_name,bool show_panel = true);
bool moveWearable(LLViewerInventoryItem* item, bool closer_to_body);
@@ -184,18 +198,27 @@ public:
//Divvy items into arrays by wearable type
static void divvyWearablesByType(const LLInventoryModel::item_array_t& items, wearables_by_type_t& items_by_type);
+ typedef std::map<LLUUID,std::string> desc_map_t;
+
+ void getWearableOrderingDescUpdates(LLInventoryModel::item_array_t& wear_items, desc_map_t& desc_map);
+
//Check ordering information on wearables stored in links' descriptions and update if it is invalid
// COF is processed if cat_id is not specified
- void updateClothingOrderingInfo(LLUUID cat_id = LLUUID::null, bool update_base_outfit_ordering = false);
+ bool validateClothingOrderingInfo(LLUUID cat_id = LLUUID::null);
+
+ void updateClothingOrderingInfo(LLUUID cat_id = LLUUID::null,
+ LLPointer<LLInventoryCallback> cb = NULL);
bool isOutfitLocked() { return mOutfitLocked; }
bool isInUpdateAppearanceFromCOF() { return mIsInUpdateAppearanceFromCOF; }
- void requestServerAppearanceUpdate(LLCurl::ResponderPtr responder_ptr = NULL);
+ void requestServerAppearanceUpdate();
void incrementCofVersion(LLHTTPClient::ResponderPtr responder_ptr = NULL);
+ U32 getNumAttachmentsInCOF();
+
// *HACK Remove this after server side texture baking is deployed on all sims.
void incrementCofVersionLegacy();
@@ -216,24 +239,21 @@ private:
void getDescendentsOfAssetType(const LLUUID& category,
LLInventoryModel::item_array_t& items,
- LLAssetType::EType type,
- bool follow_folder_links);
+ LLAssetType::EType type);
void getUserDescendents(const LLUUID& category,
LLInventoryModel::item_array_t& wear_items,
LLInventoryModel::item_array_t& obj_items,
- LLInventoryModel::item_array_t& gest_items,
- bool follow_folder_links);
+ LLInventoryModel::item_array_t& gest_items);
- void purgeCategory(const LLUUID& category, bool keep_outfit_links, LLInventoryModel::item_array_t* keep_items = NULL);
static void onOutfitRename(const LLSD& notification, const LLSD& response);
- void setOutfitLocked(bool locked);
-
bool mAttachmentInvLinkEnabled;
bool mOutfitIsDirty;
bool mIsInUpdateAppearanceFromCOF; // to detect recursive calls.
+ LLPointer<RequestAgentUpdateAppearanceResponder> mAppearanceResponder;
+
/**
* Lock for blocking operations on outfit until server reply or timeout exceed
* to avoid unsynchronized outfit state or performing duplicate operations.
@@ -265,17 +285,31 @@ public:
class LLUpdateAppearanceOnDestroy: public LLInventoryCallback
{
public:
- LLUpdateAppearanceOnDestroy(bool update_base_outfit_ordering = false);
+ LLUpdateAppearanceOnDestroy(bool enforce_item_restrictions = true,
+ bool enforce_ordering = true,
+ nullary_func_t post_update_func = no_op);
virtual ~LLUpdateAppearanceOnDestroy();
/* virtual */ void fire(const LLUUID& inv_item);
private:
U32 mFireCount;
- bool mUpdateBaseOrder;
+ bool mEnforceItemRestrictions;
+ bool mEnforceOrdering;
+ nullary_func_t mPostUpdateFunc;
};
+class LLUpdateAppearanceAndEditWearableOnDestroy: public LLInventoryCallback
+{
+public:
+ LLUpdateAppearanceAndEditWearableOnDestroy(const LLUUID& item_id);
+
+ /* virtual */ void fire(const LLUUID& item_id) {}
-#define SUPPORT_ENSEMBLES 0
+ ~LLUpdateAppearanceAndEditWearableOnDestroy();
+
+private:
+ LLUUID mItemID;
+};
LLUUID findDescendentCategoryIDByName(const LLUUID& parent_id,const std::string& name);
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 413a0abf47..3a5008507a 100755
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -63,7 +63,8 @@
#include "llconversationlog.h"
#include "lldxhardware.h"
#include "lltexturestats.h"
-#include "lltexturestats.h"
+#include "lltrace.h"
+#include "lltracethreadrecorder.h"
#include "llviewerwindow.h"
#include "llviewerdisplay.h"
#include "llviewermedia.h"
@@ -94,11 +95,12 @@
#include "llvocache.h"
#include "llvopartgroup.h"
#include "llweb.h"
-#include "llsecondlifeurls.h"
#include "llupdaterservice.h"
#include "llfloatertexturefetchdebugger.h"
#include "llspellcheck.h"
+#include "llscenemonitor.h"
#include "llavatarrenderinfoaccountant.h"
+#include "lllocalbitmaps.h"
// Linden library includes
#include "llavatarnamecache.h"
@@ -299,12 +301,12 @@ U32 gFrameCount = 0;
U32 gForegroundFrameCount = 0; // number of frames that app window was in foreground
LLPumpIO* gServicePump = NULL;
-U64 gFrameTime = 0;
-F32 gFrameTimeSeconds = 0.f;
-F32 gFrameIntervalSeconds = 0.f;
+U64MicrosecondsImplicit gFrameTime = 0;
+F32SecondsImplicit gFrameTimeSeconds = 0.f;
+F32SecondsImplicit gFrameIntervalSeconds = 0.f;
F32 gFPSClamped = 10.f; // Pretend we start at target rate.
F32 gFrameDTClamped = 0.f; // Time between adjacent checks to network for packets
-U64 gStartTime = 0; // gStartTime is "private", used only to calculate gFrameTimeSeconds
+U64MicrosecondsImplicit gStartTime = 0; // gStartTime is "private", used only to calculate gFrameTimeSeconds
U32 gFrameStalls = 0;
const F64 FRAME_STALL_THRESHOLD = 1.0;
@@ -330,7 +332,7 @@ BOOL gUseWireframe = FALSE;
LLVFS* gStaticVFS = NULL;
LLMemoryInfo gSysMemory;
-U64 gMemoryAllocated = 0; // updated in display_stats() in llviewerdisplay.cpp
+U64Bytes gMemoryAllocated(0); // updated in display_stats() in llviewerdisplay.cpp
std::string gLastVersionChannel;
@@ -632,7 +634,7 @@ public:
while (!LLAppViewer::instance()->isQuitting())
{
- LLFastTimer::writeLog(os);
+ LLTrace::BlockTimer::writeLog(os);
os.flush();
ms_sleep(32);
}
@@ -665,8 +667,13 @@ LLTextureCache* LLAppViewer::sTextureCache = NULL;
LLImageDecodeThread* LLAppViewer::sImageDecodeThread = NULL;
LLTextureFetch* LLAppViewer::sTextureFetch = NULL;
-LLAppViewer::LLAppViewer() :
- mMarkerFile(),
+std::string getRuntime()
+{
+ return llformat("%.4f", (F32)LLTimer::getElapsedSeconds().value());
+}
+
+LLAppViewer::LLAppViewer()
+: mMarkerFile(),
mLogoutMarkerFile(),
mReportedCrash(false),
mNumSessions(0),
@@ -688,7 +695,7 @@ LLAppViewer::LLAppViewer() :
{
if(NULL != sInstance)
{
- llerrs << "Oh no! An instance of LLAppViewer already exists! LLAppViewer is sort of like a singleton." << llendl;
+ LL_ERRS() << "Oh no! An instance of LLAppViewer already exists! LLAppViewer is sort of like a singleton." << LL_ENDL;
}
mDumpPath ="";
@@ -745,9 +752,6 @@ bool LLAppViewer::init()
//
// Start of the application
//
- LLFastTimer::reset();
-
-
#ifdef LL_DARWIN
mMainLoopInitialized = false;
#endif
@@ -1064,9 +1068,8 @@ bool LLAppViewer::init()
// get RAM data from XML
std::stringstream minRAMString(LLNotifications::instance().getGlobalString("UnsupportedRAMAmount"));
- U64 minRAM = 0;
+ U64Bytes minRAM;
minRAMString >> minRAM;
- minRAM = minRAM * 1024 * 1024;
if(!LLFeatureManager::getInstance()->isGPUSupported() && LLFeatureManager::getInstance()->getGPUClass() != GPU_CLASS_UNKNOWN)
{
@@ -1220,7 +1223,7 @@ void LLAppViewer::initMaxHeapSize()
//currently SL is built under 32-bit setting, we set its max heap size no more than 1.6 GB.
//F32 max_heap_size_gb = llmin(1.6f, (F32)gSavedSettings.getF32("MaxHeapSize")) ;
- F32 max_heap_size_gb = gSavedSettings.getF32("MaxHeapSize") ;
+ F32Gigabytes max_heap_size_gb = (F32Gigabytes)gSavedSettings.getF32("MaxHeapSize") ;
BOOL enable_mem_failure_prevention = (BOOL)gSavedSettings.getBOOL("MemoryFailurePreventionEnabled") ;
LLMemory::initMaxHeapSizeGB(max_heap_size_gb, enable_mem_failure_prevention) ;
@@ -1243,8 +1246,8 @@ void LLAppViewer::checkMemory()
}
mMemCheckTimer.reset() ;
- //update the availability of memory
- LLMemory::updateMemoryInfo() ;
+ //update the availability of memory
+ LLMemory::updateMemoryInfo() ;
bool is_low = LLMemory::isMemoryPoolLow() ;
@@ -1256,24 +1259,25 @@ void LLAppViewer::checkMemory()
}
}
-static LLFastTimer::DeclareTimer FTM_MESSAGES("System Messages");
-static LLFastTimer::DeclareTimer FTM_SLEEP("Sleep");
-static LLFastTimer::DeclareTimer FTM_YIELD("Yield");
-
-static LLFastTimer::DeclareTimer FTM_TEXTURE_CACHE("Texture Cache");
-static LLFastTimer::DeclareTimer FTM_DECODE("Image Decode");
-static LLFastTimer::DeclareTimer FTM_VFS("VFS Thread");
-static LLFastTimer::DeclareTimer FTM_LFS("LFS Thread");
-static LLFastTimer::DeclareTimer FTM_PAUSE_THREADS("Pause Threads");
-static LLFastTimer::DeclareTimer FTM_IDLE("Idle");
-static LLFastTimer::DeclareTimer FTM_PUMP("Pump");
-static LLFastTimer::DeclareTimer FTM_PUMP_ARES("Ares");
-static LLFastTimer::DeclareTimer FTM_PUMP_SERVICE("Service");
-static LLFastTimer::DeclareTimer FTM_SERVICE_CALLBACK("Callback");
-static LLFastTimer::DeclareTimer FTM_AGENT_AUTOPILOT("Autopilot");
-static LLFastTimer::DeclareTimer FTM_AGENT_UPDATE("Update");
-
-LLFastTimer::DeclareTimer FTM_FRAME("Frame", true);
+static LLTrace::BlockTimerStatHandle FTM_MESSAGES("System Messages");
+static LLTrace::BlockTimerStatHandle FTM_SLEEP("Sleep");
+static LLTrace::BlockTimerStatHandle FTM_YIELD("Yield");
+
+static LLTrace::BlockTimerStatHandle FTM_TEXTURE_CACHE("Texture Cache");
+static LLTrace::BlockTimerStatHandle FTM_DECODE("Image Decode");
+static LLTrace::BlockTimerStatHandle FTM_VFS("VFS Thread");
+static LLTrace::BlockTimerStatHandle FTM_LFS("LFS Thread");
+static LLTrace::BlockTimerStatHandle FTM_PAUSE_THREADS("Pause Threads");
+static LLTrace::BlockTimerStatHandle FTM_IDLE("Idle");
+static LLTrace::BlockTimerStatHandle FTM_PUMP("Pump");
+static LLTrace::BlockTimerStatHandle FTM_PUMP_ARES("Ares");
+static LLTrace::BlockTimerStatHandle FTM_PUMP_SERVICE("Service");
+static LLTrace::BlockTimerStatHandle FTM_SERVICE_CALLBACK("Callback");
+static LLTrace::BlockTimerStatHandle FTM_AGENT_AUTOPILOT("Autopilot");
+static LLTrace::BlockTimerStatHandle FTM_AGENT_UPDATE("Update");
+
+// externally visible timers
+LLTrace::BlockTimerStatHandle FTM_FRAME("Frame");
bool LLAppViewer::mainLoop()
{
@@ -1281,6 +1285,7 @@ bool LLAppViewer::mainLoop()
if (!mMainLoopInitialized)
#endif
{
+ LL_INFOS() << "Entering main_loop" << LL_ENDL;
mMainloopTimeout = new LLWatchdogTimeout();
//-------------------------------------------
@@ -1329,11 +1334,15 @@ bool LLAppViewer::mainLoop()
while (!LLApp::isExiting())
#endif
{
- LLFastTimer _(FTM_FRAME);
- LLFastTimer::nextFrame();
+ LL_RECORD_BLOCK_TIME(FTM_FRAME);
+ LLTrace::BlockTimer::processTimes();
+ LLTrace::get_frame_recording().nextPeriod();
+ LLTrace::BlockTimer::logStats();
+
+ LLTrace::get_thread_recorder()->pullFromChildren();
//clear call stack records
- llclearcallstacks;
+ LL_CLEAR_CALLSTACKS();
//check memory availability information
checkMemory() ;
@@ -1344,7 +1353,7 @@ bool LLAppViewer::mainLoop()
if (gViewerWindow)
{
- LLFastTimer t2(FTM_MESSAGES);
+ LL_RECORD_BLOCK_TIME(FTM_MESSAGES);
gViewerWindow->getWindow()->processMiscNativeEvents();
}
@@ -1352,10 +1361,10 @@ bool LLAppViewer::mainLoop()
if (gViewerWindow)
{
- LLFastTimer t2(FTM_MESSAGES);
+ LL_RECORD_BLOCK_TIME(FTM_MESSAGES);
if (!restoreErrorTrap())
{
- llwarns << " Someone took over my signal/exception handler (post messagehandling)!" << llendl;
+ LL_WARNS() << " Someone took over my signal/exception handler (post messagehandling)!" << LL_ENDL;
}
gViewerWindow->getWindow()->gatherInput();
@@ -1402,24 +1411,24 @@ bool LLAppViewer::mainLoop()
{
pauseMainloopTimeout(); // *TODO: Remove. Messages shouldn't be stalling for 20+ seconds!
- LLFastTimer t3(FTM_IDLE);
+ LL_RECORD_BLOCK_TIME(FTM_IDLE);
idle();
if (gAres != NULL && gAres->isInitialized())
{
pingMainloopTimeout("Main:ServicePump");
- LLFastTimer t4(FTM_PUMP);
+ LL_RECORD_BLOCK_TIME(FTM_PUMP);
{
- LLFastTimer t(FTM_PUMP_ARES);
+ LL_RECORD_BLOCK_TIME(FTM_PUMP_ARES);
gAres->process();
}
{
- LLFastTimer t(FTM_PUMP_SERVICE);
+ LL_RECORD_BLOCK_TIME(FTM_PUMP_SERVICE);
// this pump is necessary to make the login screen show up
gServicePump->pump();
{
- LLFastTimer t(FTM_SERVICE_CALLBACK);
+ LL_RECORD_BLOCK_TIME(FTM_SERVICE_CALLBACK);
gServicePump->callback();
}
}
@@ -1447,7 +1456,6 @@ bool LLAppViewer::mainLoop()
LLFloaterSnapshot::update(); // take snapshots
gGLActive = FALSE;
}
-
}
pingMainloopTimeout("Main:Sleep");
@@ -1456,12 +1464,12 @@ bool LLAppViewer::mainLoop()
// Sleep and run background threads
{
- LLFastTimer t2(FTM_SLEEP);
+ LL_RECORD_BLOCK_TIME(FTM_SLEEP);
// yield some time to the os based on command line option
if(mYieldTime >= 0)
{
- LLFastTimer t(FTM_YIELD);
+ LL_RECORD_BLOCK_TIME(FTM_YIELD);
ms_sleep(mYieldTime);
}
@@ -1490,11 +1498,11 @@ bool LLAppViewer::mainLoop()
if (mPeriodicSlowFrame
&& (gFrameCount % 10 == 0))
{
- llinfos << "Periodic slow frame - sleeping 500 ms" << llendl;
+ LL_INFOS() << "Periodic slow frame - sleeping 500 ms" << LL_ENDL;
ms_sleep(500);
}
- const F64 max_idle_time = llmin(.005*10.0*gFrameTimeSeconds, 0.005); // 5 ms a second
+ const F64Milliseconds max_idle_time = llmin(.005f*10.f*(F32Milliseconds)gFrameTimeSeconds, F32Milliseconds(5)); // 5 ms a second
idleTimer.reset();
S32 total_work_pending = 0;
S32 total_io_pending = 0;
@@ -1502,27 +1510,16 @@ bool LLAppViewer::mainLoop()
{
S32 work_pending = 0;
S32 io_pending = 0;
- F32 max_time = llmin(gFrameIntervalSeconds*10.f, 1.f);
+ F32 max_time = llmin(gFrameIntervalSeconds.value() *10.f, 1.f);
- {
- LLFastTimer ftm(FTM_TEXTURE_CACHE);
- work_pending += LLAppViewer::getTextureCache()->update(max_time); // unpauses the texture cache thread
- }
- {
- LLFastTimer ftm(FTM_DECODE);
- work_pending += LLAppViewer::getImageDecodeThread()->update(max_time); // unpauses the image thread
- }
- {
- LLFastTimer ftm(FTM_DECODE);
- work_pending += LLAppViewer::getTextureFetch()->update(max_time); // unpauses the texture fetch thread
- }
+ work_pending += updateTextureThreads(max_time);
{
- LLFastTimer ftm(FTM_VFS);
+ LL_RECORD_BLOCK_TIME(FTM_VFS);
io_pending += LLVFSThread::updateClass(1);
}
{
- LLFastTimer ftm(FTM_LFS);
+ LL_RECORD_BLOCK_TIME(FTM_LFS);
io_pending += LLLFSThread::updateClass(1);
}
@@ -1591,14 +1588,14 @@ bool LLAppViewer::mainLoop()
if(mem_leak_instance)
{
mem_leak_instance->stop() ;
- llwarns << "Bad memory allocation in LLAppViewer::mainLoop()!" << llendl ;
+ LL_WARNS() << "Bad memory allocation in LLAppViewer::mainLoop()!" << LL_ENDL ;
}
else
{
//output possible call stacks to log file.
LLError::LLCallStacks::print() ;
- llerrs << "Bad memory allocation in LLAppViewer::mainLoop()!" << llendl ;
+ LL_ERRS() << "Bad memory allocation in LLAppViewer::mainLoop()!" << LL_ENDL ;
}
}
}
@@ -1614,7 +1611,7 @@ bool LLAppViewer::mainLoop()
}
catch(std::bad_alloc)
{
- llwarns << "Bad memory allocation when saveFinalSnapshot() is called!" << llendl ;
+ LL_WARNS() << "Bad memory allocation when saveFinalSnapshot() is called!" << LL_ENDL ;
//stop memory leaking simulation
LLFloaterMemLeak* mem_leak_instance =
@@ -1630,12 +1627,30 @@ bool LLAppViewer::mainLoop()
destroyMainloopTimeout();
- llinfos << "Exiting main_loop" << llendflush;
+ LL_INFOS() << "Exiting main_loop" << LL_ENDL;
}
return LLApp::isExiting();
}
+S32 LLAppViewer::updateTextureThreads(F32 max_time)
+{
+ S32 work_pending = 0;
+ {
+ LL_RECORD_BLOCK_TIME(FTM_TEXTURE_CACHE);
+ work_pending += LLAppViewer::getTextureCache()->update(max_time); // unpauses the texture cache thread
+ }
+ {
+ LL_RECORD_BLOCK_TIME(FTM_DECODE);
+ work_pending += LLAppViewer::getImageDecodeThread()->update(max_time); // unpauses the image thread
+ }
+ {
+ LL_RECORD_BLOCK_TIME(FTM_DECODE);
+ work_pending += LLAppViewer::getTextureFetch()->update(max_time); // unpauses the texture fetch thread
+ }
+ return work_pending;
+}
+
void LLAppViewer::flushVFSIO()
{
while (1)
@@ -1646,7 +1661,7 @@ void LLAppViewer::flushVFSIO()
{
break;
}
- llinfos << "Waiting for pending IO to finish: " << pending << llendflush;
+ LL_INFOS() << "Waiting for pending IO to finish: " << pending << LL_ENDL;
ms_sleep(100);
}
}
@@ -1661,12 +1676,15 @@ bool LLAppViewer::cleanup()
// workaround for DEV-35406 crash on shutdown
LLEventPumps::instance().reset();
+ //dump scene loading monitor results
+ LLSceneMonitor::instance().dumpToFile(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "scene_monitor_results.csv"));
+
if (LLFastTimerView::sAnalyzePerformance)
{
- llinfos << "Analyzing performance" << llendl;
- std::string baseline_name = LLFastTimer::sLogName + "_baseline.slp";
- std::string current_name = LLFastTimer::sLogName + ".slp";
- std::string report_name = LLFastTimer::sLogName + "_report.csv";
+ LL_INFOS() << "Analyzing performance" << LL_ENDL;
+ std::string baseline_name = LLTrace::BlockTimer::sLogName + "_baseline.slp";
+ std::string current_name = LLTrace::BlockTimer::sLogName + ".slp";
+ std::string report_name = LLTrace::BlockTimer::sLogName + "_report.csv";
LLFastTimerView::doAnalysis(
gDirUtilp->getExpandedFilename(LL_PATH_LOGS, baseline_name),
@@ -1709,7 +1727,7 @@ bool LLAppViewer::cleanup()
disconnectViewer();
- llinfos << "Viewer disconnected" << llendflush;
+ LL_INFOS() << "Viewer disconnected" << LL_ENDL;
display_cleanup();
@@ -1717,7 +1735,7 @@ bool LLAppViewer::cleanup()
LLError::logToFixedBuffer(NULL);
- llinfos << "Cleaning Up" << llendflush;
+ LL_INFOS() << "Cleaning Up" << LL_ENDL;
// shut down mesh streamer
gMeshRepo.shutdown();
@@ -1732,7 +1750,7 @@ bool LLAppViewer::cleanup()
LLHUDObject::updateAll();
LLHUDManager::getInstance()->cleanupEffects();
LLHUDObject::cleanupHUDObjects();
- llinfos << "HUD Objects cleaned up" << llendflush;
+ LL_INFOS() << "HUD Objects cleaned up" << LL_ENDL;
}
LLKeyframeDataCache::clear();
@@ -1741,7 +1759,9 @@ bool LLAppViewer::cleanup()
#if 0 // this seems to get us stuck in an infinite loop...
gTransferManager.cleanup();
#endif
-
+
+ LLLocalBitmapMgr::cleanupClass();
+
// Note: this is where gWorldMap used to be deleted.
// Note: this is where gHUDManager used to be deleted.
@@ -1763,7 +1783,7 @@ bool LLAppViewer::cleanup()
LLCalc::cleanUp();
- llinfos << "Global stuff deleted" << llendflush;
+ LL_INFOS() << "Global stuff deleted" << LL_ENDL;
if (gAudiop)
{
@@ -1774,7 +1794,7 @@ bool LLAppViewer::cleanup()
gAudiop->setStreamingAudioImpl(NULL);
// shut down the audio subsystem
- gAudiop->shutdown();
+ gAudiop->shutdown();
delete gAudiop;
gAudiop = NULL;
@@ -1787,7 +1807,7 @@ bool LLAppViewer::cleanup()
// such that we can suck rectangle information out of
// it.
cleanupSavedSettings();
- llinfos << "Settings patched up" << llendflush;
+ LL_INFOS() << "Settings patched up" << LL_ENDL;
// delete some of the files left around in the cache.
removeCacheFiles("*.wav");
@@ -1798,29 +1818,29 @@ bool LLAppViewer::cleanup()
removeCacheFiles("*.bodypart");
removeCacheFiles("*.clothing");
- llinfos << "Cache files removed" << llendflush;
+ LL_INFOS() << "Cache files removed" << LL_ENDL;
// Wait for any pending VFS IO
flushVFSIO();
- llinfos << "Shutting down Views" << llendflush;
+ LL_INFOS() << "Shutting down Views" << LL_ENDL;
// Destroy the UI
if( gViewerWindow)
gViewerWindow->shutdownViews();
- llinfos << "Cleaning up Inventory" << llendflush;
+ LL_INFOS() << "Cleaning up Inventory" << LL_ENDL;
// Cleanup Inventory after the UI since it will delete any remaining observers
// (Deleted observers should have already removed themselves)
gInventory.cleanupInventory();
- llinfos << "Cleaning up Selections" << llendflush;
+ LL_INFOS() << "Cleaning up Selections" << LL_ENDL;
// Clean up selection managers after UI is destroyed, as UI may be observing them.
// Clean up before GL is shut down because we might be holding on to objects with texture references
LLSelectMgr::cleanupGlobals();
- llinfos << "Shutting down OpenGL" << llendflush;
+ LL_INFOS() << "Shutting down OpenGL" << LL_ENDL;
// Shut down OpenGL
if( gViewerWindow)
@@ -1832,10 +1852,10 @@ bool LLAppViewer::cleanup()
// Therefore must do this before destroying the message system.
delete gViewerWindow;
gViewerWindow = NULL;
- llinfos << "ViewerWindow deleted" << llendflush;
+ LL_INFOS() << "ViewerWindow deleted" << LL_ENDL;
}
- llinfos << "Cleaning up Keyboard & Joystick" << llendflush;
+ LL_INFOS() << "Cleaning up Keyboard & Joystick" << LL_ENDL;
// viewer UI relies on keyboard so keep it aound until viewer UI isa gone
delete gKeyboard;
@@ -1844,7 +1864,7 @@ bool LLAppViewer::cleanup()
// Turn off Space Navigator and similar devices
LLViewerJoystick::getInstance()->terminate();
- llinfos << "Cleaning up Objects" << llendflush;
+ LL_INFOS() << "Cleaning up Objects" << LL_ENDL;
LLViewerObject::cleanupVOClasses();
@@ -1866,11 +1886,11 @@ bool LLAppViewer::cleanup()
LLVolumeMgr* volume_manager = LLPrimitive::getVolumeManager();
if (!volume_manager->cleanup())
{
- llwarns << "Remaining references in the volume manager!" << llendflush;
+ LL_WARNS() << "Remaining references in the volume manager!" << LL_ENDL;
}
LLPrimitive::cleanupVolumeManager();
- llinfos << "Additional Cleanup..." << llendflush;
+ LL_INFOS() << "Additional Cleanup..." << LL_ENDL;
LLViewerParcelMgr::cleanupGlobals();
@@ -1891,10 +1911,10 @@ bool LLAppViewer::cleanup()
// Also after shutting down the messaging system since it has VFS dependencies
//
- llinfos << "Cleaning up VFS" << llendflush;
+ LL_INFOS() << "Cleaning up VFS" << LL_ENDL;
LLVFile::cleanupClass();
- llinfos << "Saving Data" << llendflush;
+ LL_INFOS() << "Saving Data" << LL_ENDL;
// Store the time of our current logoff
gSavedPerAccountSettings.setU32("LastLogoff", time_corrected());
@@ -1909,19 +1929,19 @@ bool LLAppViewer::cleanup()
// *FIX:Mani This should get really saved in a "logoff" mode.
if (gSavedSettings.getString("PerAccountSettingsFile").empty())
{
- llinfos << "Not saving per-account settings; don't know the account name yet." << llendl;
+ LL_INFOS() << "Not saving per-account settings; don't know the account name yet." << LL_ENDL;
}
// Only save per account settings if the previous login succeeded, otherwise
// we might end up with a cleared out settings file in case a previous login
// failed after loading per account settings.
else if (!mSavePerAccountSettings)
{
- llinfos << "Not saving per-account settings; last login was not successful." << llendl;
+ LL_INFOS() << "Not saving per-account settings; last login was not successful." << LL_ENDL;
}
else
{
gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE);
- llinfos << "Saved settings" << llendflush;
+ LL_INFOS() << "Saved settings" << LL_ENDL;
}
std::string warnings_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFilename("Default", "Warnings"));
@@ -1938,7 +1958,7 @@ bool LLAppViewer::cleanup()
if (mPurgeOnExit)
{
- llinfos << "Purging all cache files on exit" << llendflush;
+ LL_INFOS() << "Purging all cache files on exit" << LL_ENDL;
gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,""), "*.*");
}
@@ -1953,7 +1973,7 @@ bool LLAppViewer::cleanup()
// Stop the plugin read thread if it's running.
LLPluginProcessParent::setUseReadThread(false);
- llinfos << "Shutting down Threads" << llendflush;
+ LL_INFOS() << "Shutting down Threads" << LL_ENDL;
// Let threads finish
LLTimer idleTimer;
@@ -1975,7 +1995,7 @@ bool LLAppViewer::cleanup()
}
else if(idle_time >= max_idle_time)
{
- llwarns << "Quitting with pending background tasks." << llendl;
+ LL_WARNS() << "Quitting with pending background tasks." << LL_ENDL;
break;
}
}
@@ -1991,7 +2011,7 @@ bool LLAppViewer::cleanup()
sTextureFetch->shutDownTextureCacheThread() ;
sTextureFetch->shutDownImageDecodeThread() ;
- llinfos << "Shutting down message system" << llendflush;
+ LL_INFOS() << "Shutting down message system" << LL_ENDL;
end_messaging_system();
// *NOTE:Mani - The following call is not thread safe.
@@ -2002,6 +2022,9 @@ bool LLAppViewer::cleanup()
// Non-LLCurl libcurl library
mAppCoreHttp.cleanup();
+ // NOTE The following call is not thread safe.
+ ll_cleanup_ares();
+
LLFilePickerThread::cleanupClass();
//MUST happen AFTER LLCurl::cleanupClass
@@ -2016,11 +2039,11 @@ bool LLAppViewer::cleanup()
if (LLFastTimerView::sAnalyzePerformance)
{
- llinfos << "Analyzing performance" << llendl;
+ LL_INFOS() << "Analyzing performance" << LL_ENDL;
- std::string baseline_name = LLFastTimer::sLogName + "_baseline.slp";
- std::string current_name = LLFastTimer::sLogName + ".slp";
- std::string report_name = LLFastTimer::sLogName + "_report.csv";
+ std::string baseline_name = LLTrace::BlockTimer::sLogName + "_baseline.slp";
+ std::string current_name = LLTrace::BlockTimer::sLogName + ".slp";
+ std::string report_name = LLTrace::BlockTimer::sLogName + "_report.csv";
LLFastTimerView::doAnalysis(
gDirUtilp->getExpandedFilename(LL_PATH_LOGS, baseline_name),
@@ -2030,7 +2053,7 @@ bool LLAppViewer::cleanup()
LLMetricPerformanceTesterBasic::cleanClass() ;
- llinfos << "Cleaning up Media and Textures" << llendflush;
+ LL_INFOS() << "Cleaning up Media and Textures" << LL_ENDL;
//Note:
//LLViewerMedia::cleanupClass() has to be put before gTextureList.shutdown()
@@ -2046,14 +2069,14 @@ bool LLAppViewer::cleanup()
LLLFSThread::cleanupClass();
#ifndef LL_RELEASE_FOR_DOWNLOAD
- llinfos << "Auditing VFS" << llendl;
+ LL_INFOS() << "Auditing VFS" << LL_ENDL;
if(gVFS)
{
gVFS->audit();
}
#endif
- llinfos << "Misc Cleanup" << llendflush;
+ LL_INFOS() << "Misc Cleanup" << LL_ENDL;
// For safety, the LLVFS has to be deleted *after* LLVFSThread. This should be cleaned up.
// (LLVFS doesn't know about LLVFSThread so can't kill pending requests) -Steve
@@ -2073,7 +2096,7 @@ bool LLAppViewer::cleanup()
// is at the right resolution before we launch IE.
if (!gLaunchFileOnQuit.empty())
{
- llinfos << "Launch file on quit." << llendflush;
+ LL_INFOS() << "Launch file on quit." << LL_ENDL;
#if LL_WINDOWS
// Indicate an application is starting.
SetCursor(LoadCursor(NULL, IDC_WAIT));
@@ -2083,9 +2106,9 @@ bool LLAppViewer::cleanup()
ms_sleep(1000);
LLWeb::loadURLExternal( gLaunchFileOnQuit, false );
- llinfos << "File launched." << llendflush;
+ LL_INFOS() << "File launched." << LL_ENDL;
}
- llinfos << "Cleaning up LLProxy." << llendl;
+ LL_INFOS() << "Cleaning up LLProxy." << LL_ENDL;
LLProxy::cleanupClass();
LLWearableType::cleanupClass();
@@ -2097,11 +2120,11 @@ bool LLAppViewer::cleanup()
ll_close_fail_log();
+ LLError::LLCallStacks::cleanup();
+
removeMarkerFiles();
- MEM_TRACK_RELEASE
-
- llinfos << "Goodbye!" << llendflush;
+ LL_INFOS() << "Goodbye!" << LL_ENDL;
removeDumpDir();
@@ -2109,7 +2132,7 @@ bool LLAppViewer::cleanup()
return true;
}
-// A callback for llerrs to call during the watchdog error.
+// A callback for LL_ERRS() to call during the watchdog error.
void watchdog_llerrs_callback(const std::string &error_string)
{
gLLErrorActivated = true;
@@ -2125,16 +2148,12 @@ void watchdog_llerrs_callback(const std::string &error_string)
void watchdog_killer_callback()
{
LLError::setFatalFunction(watchdog_llerrs_callback);
- llerrs << "Watchdog killer event" << llendl;
+ LL_ERRS() << "Watchdog killer event" << LL_ENDL;
}
bool LLAppViewer::initThreads()
{
-#if MEM_TRACK_MEM
- static const bool enable_threads = false;
-#else
static const bool enable_threads = true;
-#endif
LLImage::initClass(gSavedSettings.getBOOL("TextureNewByteRange"),gSavedSettings.getS32("TextureReverseByteRange"));
@@ -2149,10 +2168,10 @@ bool LLAppViewer::initThreads()
enable_threads && true,
app_metrics_qa_mode);
- if (LLFastTimer::sLog || LLFastTimer::sMetricLog)
+ if (LLTrace::BlockTimer::sLog || LLTrace::BlockTimer::sMetricLog)
{
- LLFastTimer::sLogLock = new LLMutex(NULL);
- mFastTimerLogThread = new LLFastTimerLogThread(LLFastTimer::sLogName);
+ LLTrace::BlockTimer::setLogLock(new LLMutex(NULL));
+ mFastTimerLogThread = new LLFastTimerLogThread(LLTrace::BlockTimer::sLogName);
mFastTimerLogThread->start();
}
@@ -2185,6 +2204,7 @@ void LLAppViewer::initLoggingAndGetLastDuration()
LLError::initForApplication(
gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, ""));
LLError::setFatalFunction(errorCallback);
+ //LLError::setTimeFunction(getRuntime);
// Remove the last ".old" log file.
std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,
@@ -2253,7 +2273,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key,
{
if (!mSettingsLocationList)
{
- llerrs << "Invalid settings location list" << llendl;
+ LL_ERRS() << "Invalid settings location list" << LL_ENDL;
}
BOOST_FOREACH(const SettingsGroup& group, mSettingsLocationList->groups)
@@ -2264,7 +2284,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key,
ELLPath path_index = (ELLPath)group.path_index();
if(path_index <= LL_PATH_NONE || path_index >= LL_PATH_LAST)
{
- llerrs << "Out of range path index in app_settings/settings_files.xml" << llendl;
+ LL_ERRS() << "Out of range path index in app_settings/settings_files.xml" << LL_ENDL;
return false;
}
@@ -2311,7 +2331,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key,
{ // failed to load
if(file.required)
{
- llerrs << "Error: Cannot load required settings file from: " << full_settings_path << llendl;
+ LL_ERRS() << "Error: Cannot load required settings file from: " << full_settings_path << LL_ENDL;
return false;
}
else
@@ -2358,9 +2378,9 @@ namespace
{
void handleCommandLineError(LLControlGroupCLP& clp)
{
- llwarns << "Error parsing command line options. Command Line options ignored." << llendl;
+ LL_WARNS() << "Error parsing command line options. Command Line options ignored." << LL_ENDL;
- llinfos << "Command line usage:\n" << clp << llendl;
+ LL_INFOS() << "Command line usage:\n" << clp << LL_ENDL;
OSMessageBox(STRINGIZE(LLTrans::getString("MBCmdLineError") << clp.getErrorMessage()),
LLStringUtil::null,
@@ -2376,7 +2396,7 @@ bool LLAppViewer::initConfiguration()
BOOL success = LLXMLNode::parseFile(settings_file_list, root, NULL);
if (!success)
{
- llerrs << "Cannot load default configuration file " << settings_file_list << llendl;
+ LL_ERRS() << "Cannot load default configuration file " << settings_file_list << LL_ENDL;
}
mSettingsLocationList = new SettingsFiles();
@@ -2386,7 +2406,7 @@ bool LLAppViewer::initConfiguration()
if (!mSettingsLocationList->validateBlock())
{
- llerrs << "Invalid settings file list " << settings_file_list << llendl;
+ LL_ERRS() << "Invalid settings file list " << settings_file_list << LL_ENDL;
}
// The settings and command line parsing have a fragile
@@ -2522,7 +2542,7 @@ bool LLAppViewer::initConfiguration()
// ASAP or we might miss init issue etc.
if(gSavedSettings.getBOOL("DisableCrashLogger"))
{
- llwarns << "Crashes will be handled by system, stack trace logs and crash logger are both disabled" << llendl;
+ LL_WARNS() << "Crashes will be handled by system, stack trace logs and crash logger are both disabled" << LL_ENDL;
LLAppViewer::instance()->disableCrashlogger();
}
@@ -2537,7 +2557,7 @@ bool LLAppViewer::initConfiguration()
{
std::ostringstream msg;
msg << LLTrans::getString("MBCmdLineUsg") << "\n" << clp;
- llinfos << msg.str() << llendl;
+ LL_INFOS() << msg.str() << LL_ENDL;
OSMessageBox(
msg.str().c_str(),
@@ -2552,7 +2572,7 @@ bool LLAppViewer::initConfiguration()
const LLCommandLineParser::token_vector_t& set_values = clp.getOption("set");
if(0x1 & set_values.size())
{
- llwarns << "Invalid '--set' parameter count." << llendl;
+ LL_WARNS() << "Invalid '--set' parameter count." << LL_ENDL;
}
else
{
@@ -2571,13 +2591,13 @@ bool LLAppViewer::initConfiguration()
{
group_part = name.substr(0, pos);
name_part = name.substr(pos+1);
- llinfos << "Setting " << group_part << "." << name_part << " to " << value << llendl;
+ LL_INFOS() << "Setting " << group_part << "." << name_part << " to " << value << LL_ENDL;
LLControlGroup* g = LLControlGroup::getInstance(group_part);
if (g) control = g->getControl(name_part);
}
else
{
- llinfos << "Setting Global." << name << " to " << value << llendl;
+ LL_INFOS() << "Setting Global." << name << " to " << value << LL_ENDL;
control = gSavedSettings.getControl(name);
}
@@ -2587,7 +2607,7 @@ bool LLAppViewer::initConfiguration()
}
else
{
- llwarns << "Failed --set " << name << ": setting name unknown." << llendl;
+ LL_WARNS() << "Failed --set " << name << ": setting name unknown." << LL_ENDL;
}
}
}
@@ -2608,19 +2628,19 @@ bool LLAppViewer::initConfiguration()
if (gSavedSettings.getBOOL("LogPerformance"))
{
- LLFastTimer::sLog = TRUE;
- LLFastTimer::sLogName = std::string("performance");
+ LLTrace::BlockTimer::sLog = true;
+ LLTrace::BlockTimer::sLogName = std::string("performance");
}
std::string test_name(gSavedSettings.getString("LogMetrics"));
if (! test_name.empty())
{
- LLFastTimer::sMetricLog = TRUE ;
+ LLTrace::BlockTimer::sMetricLog = TRUE;
// '--logmetrics' is specified with a named test metric argument so the data gathering is done only on that test
// In the absence of argument, every metric would be gathered (makes for a rather slow run and hard to decipher report...)
- llinfos << "'--logmetrics' argument : " << test_name << llendl;
- LLFastTimer::sLogName = test_name;
- }
+ LL_INFOS() << "'--logmetrics' argument : " << test_name << LL_ENDL;
+ LLTrace::BlockTimer::sLogName = test_name;
+ }
if (clp.hasOption("graphicslevel"))
{
@@ -2667,11 +2687,27 @@ bool LLAppViewer::initConfiguration()
// What can happen is that someone can use IE (or potentially
// other browsers) and do the rough equivalent of command
// injection and steal passwords. Phoenix. SL-55321
+
+ std::string starting_location;
+
+ std::string cmd_line_login_location(gSavedSettings.getString("CmdLineLoginLocation"));
+ if(! cmd_line_login_location.empty())
+ {
+ starting_location = cmd_line_login_location;
+ }
+ else
+ {
+ std::string default_login_location(gSavedSettings.getString("DefaultLoginLocation"));
+ if (! default_login_location.empty())
+ {
+ starting_location = default_login_location;
+ }
+ }
+
LLSLURL start_slurl;
- std::string CmdLineLoginLocation(gSavedSettings.getString("CmdLineLoginLocation"));
- if(! CmdLineLoginLocation.empty())
+ if (! starting_location.empty())
{
- start_slurl = CmdLineLoginLocation;
+ start_slurl = starting_location;
LLStartUp::setStartSLURL(start_slurl);
if(start_slurl.getType() == LLSLURL::LOCATION)
{
@@ -2688,7 +2724,7 @@ bool LLAppViewer::initConfiguration()
(gSavedSettings.getBOOL("SLURLPassToOtherInstance")))
{
if (sendURLToOtherInstance(start_slurl.getSLURLString()))
- {
+ {
// successfully handed off URL to existing instance, exit
return false;
}
@@ -2880,10 +2916,10 @@ namespace {
void apply_update_callback(LLSD const & notification, LLSD const & response)
{
- lldebugs << "LLUpdate user response: " << response << llendl;
+ LL_DEBUGS() << "LLUpdate user response: " << response << LL_ENDL;
if(response["OK_okcancelbuttons"].asBoolean())
{
- llinfos << "LLUpdate restarting viewer" << llendl;
+ LL_INFOS() << "LLUpdate restarting viewer" << LL_ENDL;
static const bool install_if_ready = true;
// *HACK - this lets us launch the installer immediately for now
LLUpdaterService().startChecking(install_if_ready);
@@ -2892,7 +2928,7 @@ namespace {
void apply_update_ok_callback(LLSD const & notification, LLSD const & response)
{
- llinfos << "LLUpdate restarting viewer" << llendl;
+ LL_INFOS() << "LLUpdate restarting viewer" << LL_ENDL;
static const bool install_if_ready = true;
// *HACK - this lets us launch the installer immediately for now
LLUpdaterService().startChecking(install_if_ready);
@@ -3100,8 +3136,7 @@ bool LLAppViewer::meetsRequirementsForMaximizedStart()
{
bool maximizedOk = (LLFeatureManager::getInstance()->getGPUClass() >= GPU_CLASS_2);
- const U32 one_gigabyte_kb = 1024 * 1024;
- maximizedOk &= (gSysMemory.getPhysicalMemoryKB() >= one_gigabyte_kb);
+ maximizedOk &= (gSysMemory.getPhysicalMemoryKB() >= U32Gigabytes(1));
return maximizedOk;
}
@@ -3154,6 +3189,14 @@ bool LLAppViewer::initWindow()
LLNotificationsUI::LLNotificationManager::getInstance();
+
+#ifdef LL_DARWIN
+ //Satisfy both MAINT-3135 (OSX 10.6 and earlier) MAINT-3288 (OSX 10.7 and later)
+ if (getOSInfo().mMajorVer == 10 && getOSInfo().mMinorVer < 7)
+ if ( getOSInfo().mMinorVer == 6 && getOSInfo().mBuild < 8 )
+ gViewerWindow->getWindow()->setOldResize(true);
+#endif
+
if (gSavedSettings.getBOOL("WindowMaximized"))
{
gViewerWindow->getWindow()->maximize();
@@ -3215,6 +3258,7 @@ bool LLAppViewer::initWindow()
//gViewerWindow->getWindow()->show();
LL_INFOS("AppInit") << "Window initialization done." << LL_ENDL;
+
return true;
}
@@ -3226,7 +3270,7 @@ void LLAppViewer::writeDebugInfo(bool isStatic)
? getStaticDebugFile()
: getDynamicDebugFile() );
- llinfos << "Opening debug file " << *debug_filename << llendl;
+ LL_INFOS() << "Opening debug file " << *debug_filename << LL_ENDL;
llofstream out_file(*debug_filename);
isStatic ? LLSDSerialize::toPrettyXML(gDebugInfo, out_file)
@@ -3290,7 +3334,7 @@ LLSD LLAppViewer::getViewerInfo() const
// CPU
info["CPU"] = gSysCPU.getCPUString();
- info["MEMORY_MB"] = LLSD::Integer(gSysMemory.getPhysicalMemoryKB() / 1024);
+ info["MEMORY_MB"] = LLSD::Integer(gSysMemory.getPhysicalMemoryKB().valueInUnits<LLUnits::Megabytes>());
// Moved hack adjustment to Windows memory size into llsys.cpp
info["OS_VERSION"] = LLAppViewer::instance()->getOSInfo().getOSString();
info["GRAPHICS_CARD_VENDOR"] = (const char*)(glGetString(GL_VENDOR));
@@ -3324,10 +3368,11 @@ LLSD LLAppViewer::getViewerInfo() const
// TODO: Implement media plugin version query
info["QT_WEBKIT_VERSION"] = "4.7.1 (version number hard-coded)";
- if (gPacketsIn > 0)
+ S32 packets_in = LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_IN);
+ if (packets_in > 0)
{
- info["PACKETS_LOST"] = LLViewerStats::getInstance()->mPacketsLostStat.getCurrent();
- info["PACKETS_IN"] = F32(gPacketsIn);
+ info["PACKETS_LOST"] = LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_LOST);
+ info["PACKETS_IN"] = packets_in;
info["PACKETS_PCT"] = 100.f*info["PACKETS_LOST"].asReal() / info["PACKETS_IN"].asReal();
}
@@ -3337,6 +3382,10 @@ LLSD LLAppViewer::getViewerInfo() const
{
info["SERVER_RELEASE_NOTES_URL"] = LLTrans::getString("RetrievingData");
}
+ else
+ {
+ info["SERVER_RELEASE_NOTES_URL"] = LLTrans::getString("NotConnected");
+ }
}
else if (LLStringUtil::startsWith(mServerReleaseNotesURL, "http")) // it's an URL
{
@@ -3486,8 +3535,8 @@ void LLAppViewer::writeSystemInfo()
gDebugInfo["CPUInfo"]["CPUSSE"] = gSysCPU.hasSSE();
gDebugInfo["CPUInfo"]["CPUSSE2"] = gSysCPU.hasSSE2();
- gDebugInfo["RAMInfo"]["Physical"] = (LLSD::Integer)(gSysMemory.getPhysicalMemoryKB());
- gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer)(gMemoryAllocated>>10); // MB -> KB
+ gDebugInfo["RAMInfo"]["Physical"] = (LLSD::Integer)(gSysMemory.getPhysicalMemoryKB().value());
+ gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer)(gMemoryAllocated.valueInUnits<LLUnits::Kilobytes>());
gDebugInfo["OSInfo"] = getOSInfo().getOSStringSimple();
// The user is not logged on yet, but record the current grid choice login url
@@ -3584,9 +3633,9 @@ void getFileList()
void LLAppViewer::handleViewerCrash()
{
- llinfos << "Handle viewer crash entry." << llendl;
+ LL_INFOS() << "Handle viewer crash entry." << LL_ENDL;
- llinfos << "Last render pool type: " << LLPipeline::sCurRenderPoolType << llendl ;
+ LL_INFOS() << "Last render pool type: " << LLPipeline::sCurRenderPoolType << LL_ENDL ;
LLMemory::logMemoryInfo(true) ;
@@ -3714,7 +3763,7 @@ void LLAppViewer::handleViewerCrash()
llofstream file(filename, llofstream::binary);
if(file.good())
{
- llinfos << "Handle viewer crash generating stats log." << llendl;
+ LL_INFOS() << "Handle viewer crash generating stats log." << LL_ENDL;
gMessageSystem->summarizeLogs(file);
file.close();
}
@@ -3990,7 +4039,7 @@ void LLAppViewer::fastQuit(S32 error_code)
void LLAppViewer::requestQuit()
{
- llinfos << "requestQuit" << llendl;
+ LL_INFOS() << "requestQuit" << LL_ENDL;
LLViewerRegion* region = gAgent.getRegion();
@@ -4075,7 +4124,7 @@ static bool finish_early_exit(const LLSD& notification, const LLSD& response)
void LLAppViewer::earlyExit(const std::string& name, const LLSD& substitutions)
{
- llwarns << "app_early_exit: " << name << llendl;
+ LL_WARNS() << "app_early_exit: " << name << LL_ENDL;
gDoDisconnect = TRUE;
LLNotificationsUtil::add(name, substitutions, LLSD(), finish_early_exit);
}
@@ -4083,14 +4132,14 @@ void LLAppViewer::earlyExit(const std::string& name, const LLSD& substitutions)
// case where we need the viewer to exit without any need for notifications
void LLAppViewer::earlyExitNoNotify()
{
- llwarns << "app_early_exit with no notification: " << llendl;
+ LL_WARNS() << "app_early_exit with no notification: " << LL_ENDL;
gDoDisconnect = TRUE;
finish_early_exit( LLSD(), LLSD() );
}
void LLAppViewer::abortQuit()
{
- llinfos << "abortQuit()" << llendl;
+ LL_INFOS() << "abortQuit()" << LL_ENDL;
mQuitRequested = false;
}
@@ -4122,7 +4171,7 @@ void LLAppViewer::migrateCacheDirectory()
if (gDirUtilp->fileExists(old_cache_dir))
{
- llinfos << "Migrating cache from " << old_cache_dir << " to " << new_cache_dir << llendl;
+ LL_INFOS() << "Migrating cache from " << old_cache_dir << " to " << new_cache_dir << LL_ENDL;
// Migrate inventory cache to avoid pain to inventory database after mass update
S32 file_count = 0;
@@ -4140,7 +4189,7 @@ void LLAppViewer::migrateCacheDirectory()
file_count++;
}
}
- llinfos << "Moved " << file_count << " files" << llendl;
+ LL_INFOS() << "Moved " << file_count << " files" << LL_ENDL;
// Nuke the old cache
gDirUtilp->setCacheDir(old_cache_dir);
@@ -4157,7 +4206,7 @@ void LLAppViewer::migrateCacheDirectory()
#endif
if (LLFile::rmdir(old_cache_dir) != 0)
{
- llwarns << "could not delete old cache directory " << old_cache_dir << llendl;
+ LL_WARNS() << "could not delete old cache directory " << old_cache_dir << LL_ENDL;
}
}
}
@@ -4166,10 +4215,10 @@ void LLAppViewer::migrateCacheDirectory()
void dumpVFSCaches()
{
- llinfos << "======= Static VFS ========" << llendl;
+ LL_INFOS() << "======= Static VFS ========" << LL_ENDL;
gStaticVFS->listFiles();
#if LL_WINDOWS
- llinfos << "======= Dumping static VFS to StaticVFSDump ========" << llendl;
+ LL_INFOS() << "======= Dumping static VFS to StaticVFSDump ========" << LL_ENDL;
WCHAR w_str[MAX_PATH];
GetCurrentDirectory(MAX_PATH, w_str);
S32 res = LLFile::mkdir("StaticVFSDump");
@@ -4177,7 +4226,7 @@ void dumpVFSCaches()
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create dir StaticVFSDump" << llendl;
+ LL_WARNS() << "Couldn't create dir StaticVFSDump" << LL_ENDL;
}
}
SetCurrentDirectory(utf8str_to_utf16str("StaticVFSDump").c_str());
@@ -4185,16 +4234,16 @@ void dumpVFSCaches()
SetCurrentDirectory(w_str);
#endif
- llinfos << "========= Dynamic VFS ====" << llendl;
+ LL_INFOS() << "========= Dynamic VFS ====" << LL_ENDL;
gVFS->listFiles();
#if LL_WINDOWS
- llinfos << "========= Dumping dynamic VFS to VFSDump ====" << llendl;
+ LL_INFOS() << "========= Dumping dynamic VFS to VFSDump ====" << LL_ENDL;
res = LLFile::mkdir("VFSDump");
if (res == -1)
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create dir VFSDump" << llendl;
+ LL_WARNS() << "Couldn't create dir VFSDump" << LL_ENDL;
}
}
SetCurrentDirectory(utf8str_to_utf16str("VFSDump").c_str());
@@ -4372,7 +4421,7 @@ bool LLAppViewer::initCache()
{
sscanf(found_file.substr(start_pos+1).c_str(), "%d", &old_salt);
}
- LL_DEBUGS("AppCache") << "Default vfs data file not present, found: " << old_vfs_data_file << " Old salt: " << old_salt << llendl;
+ LL_DEBUGS("AppCache") << "Default vfs data file not present, found: " << old_vfs_data_file << " Old salt: " << old_salt << LL_ENDL;
}
}
@@ -4474,6 +4523,14 @@ void LLAppViewer::purgeCache()
gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""), "*.*");
}
+//purge cache immediately, do not wait until the next login.
+void LLAppViewer::purgeCacheImmediate()
+{
+ LL_INFOS("AppCache") << "Purging Object Cache and Texture Cache immediately..." << LL_ENDL;
+ LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE, false);
+ LLVOCache::getInstance()->removeCache(LL_PATH_CACHE, true);
+}
+
std::string LLAppViewer::getSecondLifeTitle() const
{
return LLTrans::getString("APP_NAME");
@@ -4646,18 +4703,20 @@ public:
}
};
-static LLFastTimer::DeclareTimer FTM_AUDIO_UPDATE("Update Audio");
-static LLFastTimer::DeclareTimer FTM_CLEANUP("Cleanup");
-static LLFastTimer::DeclareTimer FTM_CLEANUP_DRAWABLES("Drawables");
-static LLFastTimer::DeclareTimer FTM_CLEANUP_OBJECTS("Objects");
-static LLFastTimer::DeclareTimer FTM_IDLE_CB("Idle Callbacks");
-static LLFastTimer::DeclareTimer FTM_LOD_UPDATE("Update LOD");
-static LLFastTimer::DeclareTimer FTM_OBJECTLIST_UPDATE("Update Objectlist");
-static LLFastTimer::DeclareTimer FTM_REGION_UPDATE("Update Region");
-static LLFastTimer::DeclareTimer FTM_WORLD_UPDATE("Update World");
-static LLFastTimer::DeclareTimer FTM_NETWORK("Network");
-static LLFastTimer::DeclareTimer FTM_AGENT_NETWORK("Agent Network");
-static LLFastTimer::DeclareTimer FTM_VLMANAGER("VL Manager");
+static LLTrace::BlockTimerStatHandle FTM_AUDIO_UPDATE("Update Audio");
+static LLTrace::BlockTimerStatHandle FTM_CLEANUP("Cleanup");
+static LLTrace::BlockTimerStatHandle FTM_CLEANUP_DRAWABLES("Drawables");
+static LLTrace::BlockTimerStatHandle FTM_CLEANUP_OBJECTS("Objects");
+static LLTrace::BlockTimerStatHandle FTM_IDLE_CB("Idle Callbacks");
+static LLTrace::BlockTimerStatHandle FTM_LOD_UPDATE("Update LOD");
+static LLTrace::BlockTimerStatHandle FTM_OBJECTLIST_UPDATE("Update Objectlist");
+static LLTrace::BlockTimerStatHandle FTM_REGION_UPDATE("Update Region");
+static LLTrace::BlockTimerStatHandle FTM_WORLD_UPDATE("Update World");
+static LLTrace::BlockTimerStatHandle FTM_NETWORK("Network");
+static LLTrace::BlockTimerStatHandle FTM_AGENT_NETWORK("Agent Network");
+static LLTrace::BlockTimerStatHandle FTM_VLMANAGER("VL Manager");
+static LLTrace::BlockTimerStatHandle FTM_AGENT_POSITION("Agent Position");
+static LLTrace::BlockTimerStatHandle FTM_HUD_EFFECTS("HUD Effects");
///////////////////////////////////////////////////////
// idle()
@@ -4676,7 +4735,7 @@ void LLAppViewer::idle()
LLFrameTimer::updateFrameCount();
LLEventTimer::updateClass();
LLNotificationsUI::LLToast::updateClass();
- LLCriticalDamp::updateInterpolants();
+ LLSmoothInterpolation::updateInterpolants();
LLMortician::updateClass();
LLFilePickerThread::clearDead(); //calls LLFilePickerThread::notify()
@@ -4701,6 +4760,7 @@ void LLAppViewer::idle()
{
if (gRenderStartTime.getElapsedTimeF32() > qas)
{
+ LL_INFOS() << "Quitting after " << qas << " seconds. See setting \"QuitAfterSeconds\"." << LL_ENDL;
LLAppViewer::instance()->forceQuit();
}
}
@@ -4730,9 +4790,9 @@ void LLAppViewer::idle()
if (!gDisconnected)
{
- LLFastTimer t(FTM_NETWORK);
+ LL_RECORD_BLOCK_TIME(FTM_NETWORK);
// Update spaceserver timeinfo
- LLWorld::getInstance()->setSpaceTimeUSec(LLWorld::getInstance()->getSpaceTimeUSec() + (U32)(dt_raw * SEC_TO_MICROSEC));
+ LLWorld::getInstance()->setSpaceTimeUSec(LLWorld::getInstance()->getSpaceTimeUSec() + LLUnits::Seconds::fromValue(dt_raw));
//////////////////////////////////////
@@ -4746,7 +4806,7 @@ void LLAppViewer::idle()
}
{
- LLFastTimer t(FTM_AGENT_AUTOPILOT);
+ LL_RECORD_BLOCK_TIME(FTM_AGENT_AUTOPILOT);
// Handle automatic walking towards points
gAgentPilot.updateTarget();
gAgent.autoPilot(&yaw);
@@ -4761,7 +4821,7 @@ void LLAppViewer::idle()
if (flags_changed || (agent_update_time > (1.0f / (F32) AGENT_UPDATES_PER_SECOND)))
{
- LLFastTimer t(FTM_AGENT_UPDATE);
+ LL_RECORD_BLOCK_TIME(FTM_AGENT_UPDATE);
// Send avatar and camera info
last_control_flags = gAgent.getControlFlags();
send_agent_update(TRUE);
@@ -4781,10 +4841,10 @@ void LLAppViewer::idle()
static LLFrameStatsTimer viewer_stats_timer(SEND_STATS_PERIOD);
// Update session stats every large chunk of time
- // *FIX: (???) SAMANTHA
+ // *FIX: (?) SAMANTHA
if (viewer_stats_timer.getElapsedTimeF32() >= SEND_STATS_PERIOD && !gDisconnected)
{
- llinfos << "Transmitting sessions stats" << llendl;
+ LL_INFOS() << "Transmitting sessions stats" << LL_ENDL;
send_stats();
viewer_stats_timer.reset();
}
@@ -4796,25 +4856,21 @@ void LLAppViewer::idle()
object_debug_timer.reset();
if (gObjectList.mNumDeadObjectUpdates)
{
- llinfos << "Dead object updates: " << gObjectList.mNumDeadObjectUpdates << llendl;
+ LL_INFOS() << "Dead object updates: " << gObjectList.mNumDeadObjectUpdates << LL_ENDL;
gObjectList.mNumDeadObjectUpdates = 0;
}
if (gObjectList.mNumUnknownUpdates)
{
- llinfos << "Unknown object updates: " << gObjectList.mNumUnknownUpdates << llendl;
+ LL_INFOS() << "Unknown object updates: " << gObjectList.mNumUnknownUpdates << LL_ENDL;
gObjectList.mNumUnknownUpdates = 0;
}
- // ViewerMetrics FPS piggy-backing on the debug timer.
- // The 5-second interval is nice for this purpose. If the object debug
- // bit moves or is disabled, please give this a suitable home.
- LLViewerAssetStatsFF::record_fps_main(gFPSClamped);
}
}
if (!gDisconnected)
{
- LLFastTimer t(FTM_NETWORK);
+ LL_RECORD_BLOCK_TIME(FTM_NETWORK);
////////////////////////////////////////////////
//
@@ -4842,7 +4898,7 @@ void LLAppViewer::idle()
//
{
-// LLFastTimer t(FTM_IDLE_CB);
+// LL_RECORD_BLOCK_TIME(FTM_IDLE_CB);
// Do event notifications if necessary. Yes, we may want to move this elsewhere.
gEventNotifier.update();
@@ -4889,15 +4945,14 @@ void LLAppViewer::idle()
{
// Handle pending gesture processing
- static LLFastTimer::DeclareTimer ftm("Agent Position");
- LLFastTimer t(ftm);
+ LL_RECORD_BLOCK_TIME(FTM_AGENT_POSITION);
LLGestureMgr::instance().update();
gAgent.updateAgentPosition(gFrameDTClamped, yaw, current_mouse.mX, current_mouse.mY);
}
{
- LLFastTimer t(FTM_OBJECTLIST_UPDATE);
+ LL_RECORD_BLOCK_TIME(FTM_OBJECTLIST_UPDATE);
if (!(logoutRequestSent() && hasSavedFinalSnapshot()))
{
@@ -4912,13 +4967,13 @@ void LLAppViewer::idle()
//
{
- LLFastTimer t(FTM_CLEANUP);
+ LL_RECORD_BLOCK_TIME(FTM_CLEANUP);
{
- LLFastTimer t(FTM_CLEANUP_OBJECTS);
+ LL_RECORD_BLOCK_TIME(FTM_CLEANUP_OBJECTS);
gObjectList.cleanDeadObjects();
}
{
- LLFastTimer t(FTM_CLEANUP_DRAWABLES);
+ LL_RECORD_BLOCK_TIME(FTM_CLEANUP_DRAWABLES);
LLDrawable::cleanupDeadDrawables();
}
}
@@ -4937,8 +4992,7 @@ void LLAppViewer::idle()
//
{
- static LLFastTimer::DeclareTimer ftm("HUD Effects");
- LLFastTimer t(ftm);
+ LL_RECORD_BLOCK_TIME(FTM_HUD_EFFECTS);
LLSelectMgr::getInstance()->updateEffects();
LLHUDManager::getInstance()->cleanupEffects();
LLHUDManager::getInstance()->sendEffects();
@@ -4950,7 +5004,7 @@ void LLAppViewer::idle()
//
{
- LLFastTimer t(FTM_NETWORK);
+ LL_RECORD_BLOCK_TIME(FTM_NETWORK);
gVLManager.unpackData();
}
@@ -4962,7 +5016,7 @@ void LLAppViewer::idle()
LLWorld::getInstance()->updateVisibilities();
{
const F32 max_region_update_time = .001f; // 1ms
- LLFastTimer t(FTM_REGION_UPDATE);
+ LL_RECORD_BLOCK_TIME(FTM_REGION_UPDATE);
LLWorld::getInstance()->updateRegions(max_region_update_time);
}
@@ -4999,7 +5053,7 @@ void LLAppViewer::idle()
// Here, particles are updated and drawables are moved.
//
- LLFastTimer t(FTM_WORLD_UPDATE);
+ LL_RECORD_BLOCK_TIME(FTM_WORLD_UPDATE);
gPipeline.updateMove();
LLWorld::getInstance()->updateParticles();
@@ -5031,7 +5085,7 @@ void LLAppViewer::idle()
// objects and camera should be in sync, do LOD calculations now
{
- LLFastTimer t(FTM_LOD_UPDATE);
+ LL_RECORD_BLOCK_TIME(FTM_LOD_UPDATE);
gObjectList.updateApparentAngles(gAgent);
}
@@ -5039,7 +5093,7 @@ void LLAppViewer::idle()
LLAvatarRenderInfoAccountant::idle();
{
- LLFastTimer t(FTM_AUDIO_UPDATE);
+ LL_RECORD_BLOCK_TIME(FTM_AUDIO_UPDATE);
if (gAudiop)
{
@@ -5264,12 +5318,12 @@ void LLAppViewer::idleNameCache()
static F32 CheckMessagesMaxTime = CHECK_MESSAGES_DEFAULT_MAX_TIME;
#endif
-static LLFastTimer::DeclareTimer FTM_IDLE_NETWORK("Idle Network");
-static LLFastTimer::DeclareTimer FTM_MESSAGE_ACKS("Message Acks");
-static LLFastTimer::DeclareTimer FTM_RETRANSMIT("Retransmit");
-static LLFastTimer::DeclareTimer FTM_TIMEOUT_CHECK("Timeout Check");
-static LLFastTimer::DeclareTimer FTM_DYNAMIC_THROTTLE("Dynamic Throttle");
-static LLFastTimer::DeclareTimer FTM_CHECK_REGION_CIRCUIT("Check Region Circuit");
+static LLTrace::BlockTimerStatHandle FTM_IDLE_NETWORK("Idle Network");
+static LLTrace::BlockTimerStatHandle FTM_MESSAGE_ACKS("Message Acks");
+static LLTrace::BlockTimerStatHandle FTM_RETRANSMIT("Retransmit");
+static LLTrace::BlockTimerStatHandle FTM_TIMEOUT_CHECK("Timeout Check");
+static LLTrace::BlockTimerStatHandle FTM_DYNAMIC_THROTTLE("Dynamic Throttle");
+static LLTrace::BlockTimerStatHandle FTM_CHECK_REGION_CIRCUIT("Check Region Circuit");
void LLAppViewer::idleNetwork()
{
@@ -5280,7 +5334,7 @@ void LLAppViewer::idleNetwork()
if (!gSavedSettings.getBOOL("SpeedTest"))
{
- LLFastTimer t(FTM_IDLE_NETWORK); // decode
+ LL_RECORD_BLOCK_TIME(FTM_IDLE_NETWORK); // decode
LLTimer check_message_timer;
// Read all available packets from network
@@ -5342,16 +5396,16 @@ void LLAppViewer::idleNetwork()
if( remaining_possible_decodes <= 0 )
{
- llinfos << "Maxed out number of messages per frame at " << MESSAGE_MAX_PER_FRAME << llendl;
+ LL_INFOS() << "Maxed out number of messages per frame at " << MESSAGE_MAX_PER_FRAME << LL_ENDL;
}
if (gPrintMessagesThisFrame)
{
- llinfos << "Decoded " << total_decoded << " msgs this frame!" << llendl;
+ LL_INFOS() << "Decoded " << total_decoded << " msgs this frame!" << LL_ENDL;
gPrintMessagesThisFrame = FALSE;
}
}
- LLViewerStats::getInstance()->mNumNewObjectsStat.addValue(gObjectList.mNumNewObjects);
+ add(LLStatViewer::NUM_NEW_OBJECTS, gObjectList.mNumNewObjects);
// Retransmit unacknowledged packets.
gXferManager->retransmitUnackedPackets();
@@ -5386,7 +5440,7 @@ void LLAppViewer::disconnectViewer()
//
// Save snapshot for next time, if we made it through initialization
- llinfos << "Disconnecting viewer!" << llendl;
+ LL_INFOS() << "Disconnecting viewer!" << LL_ENDL;
// Dump our frame statistics
@@ -5430,6 +5484,7 @@ void LLAppViewer::disconnectViewer()
{
LLWorld::getInstance()->destroyClass();
}
+ LLVOCache::deleteSingleton();
// call all self-registered classes
LLDestroyClassList::instance().fireCallbacks();
@@ -5444,12 +5499,12 @@ void LLAppViewer::disconnectViewer()
void LLAppViewer::forceErrorLLError()
{
- llerrs << "This is a deliberate llerror" << llendl;
+ LL_ERRS() << "This is a deliberate llerror" << LL_ENDL;
}
void LLAppViewer::forceErrorBreakpoint()
{
- llwarns << "Forcing a deliberate breakpoint" << llendl;
+ LL_WARNS() << "Forcing a deliberate breakpoint" << LL_ENDL;
#ifdef LL_WINDOWS
DebugBreak();
#endif
@@ -5458,7 +5513,7 @@ void LLAppViewer::forceErrorBreakpoint()
void LLAppViewer::forceErrorBadMemoryAccess()
{
- llwarns << "Forcing a deliberate bad memory access" << llendl;
+ LL_WARNS() << "Forcing a deliberate bad memory access" << LL_ENDL;
S32* crash = NULL;
*crash = 0xDEADBEEF;
return;
@@ -5466,7 +5521,7 @@ void LLAppViewer::forceErrorBadMemoryAccess()
void LLAppViewer::forceErrorInfiniteLoop()
{
- llwarns << "Forcing a deliberate infinite loop" << llendl;
+ LL_WARNS() << "Forcing a deliberate infinite loop" << LL_ENDL;
while(true)
{
;
@@ -5476,14 +5531,14 @@ void LLAppViewer::forceErrorInfiniteLoop()
void LLAppViewer::forceErrorSoftwareException()
{
- llwarns << "Forcing a deliberate exception" << llendl;
+ LL_WARNS() << "Forcing a deliberate exception" << LL_ENDL;
// *FIX: Any way to insure it won't be handled?
throw;
}
void LLAppViewer::forceErrorDriverCrash()
{
- llwarns << "Forcing a deliberate driver crash" << llendl;
+ LL_WARNS() << "Forcing a deliberate driver crash" << LL_ENDL;
glDeleteTextures(1, NULL);
}
@@ -5531,7 +5586,7 @@ void LLAppViewer::pingMainloopTimeout(const std::string& state, F32 secs)
{
// if(!restoreErrorTrap())
// {
-// llwarns << "!!!!!!!!!!!!! Its an error trap!!!!" << state << llendl;
+// LL_WARNS() << "!!!!!!!!!!!!! Its an error trap!!!!" << state << LL_ENDL;
// }
if(mMainloopTimeout)
@@ -5590,13 +5645,13 @@ void LLAppViewer::handleLoginComplete()
writeDebugInfo();
// we logged in successfully, so save settings on logout
- llinfos << "Login successful, per account settings will be saved on log out." << llendl;
+ LL_INFOS() << "Login successful, per account settings will be saved on log out." << LL_ENDL;
mSavePerAccountSettings=true;
}
void LLAppViewer::launchUpdater()
{
- LLSD query_map = LLSD::emptyMap();
+ LLSD query_map = LLSD::emptyMap();
query_map["os"] = gPlatform;
// *TODO change userserver to be grid on both viewer and sim, since
@@ -5693,7 +5748,7 @@ void LLAppViewer::launchUpdater()
// Although we already have the full set of paths with the filename
// appended, the linux-updater.bin command-line switches require us to
// snip the filename OFF and pass it as a separate switch argument. :-P
- llinfos << "Got a XUI path: " << this_skin_path << llendl;
+ LL_INFOS() << "Got a XUI path: " << this_skin_path << LL_ENDL;
xml_search_paths.append(delim);
xml_search_paths.append(gDirUtilp->getDirName(this_skin_path));
delim = ",";
@@ -5715,9 +5770,9 @@ void LLAppViewer::launchUpdater()
GError *error = NULL;
if (!g_spawn_command_line_async(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str(), &error))
{
- llerrs << "Failed to launch updater: "
+ LL_ERRS() << "Failed to launch updater: "
<< error->message
- << llendl;
+ << LL_ENDL;
}
if (error) {
g_error_free(error);
@@ -5758,17 +5813,7 @@ void LLAppViewer::metricsUpdateRegion(U64 region_handle)
{
if (0 != region_handle)
{
- LLViewerAssetStatsFF::set_region_main(region_handle);
- if (LLAppViewer::sTextureFetch)
- {
- // Send a region update message into 'thread1' to get the new region.
- LLAppViewer::sTextureFetch->commandSetRegion(region_handle);
- }
- else
- {
- // No 'thread1', a.k.a. TextureFetch, so update directly
- LLViewerAssetStatsFF::set_region_thread1(region_handle);
- }
+ LLViewerAssetStatsFF::set_region(region_handle);
}
}
@@ -5779,7 +5824,7 @@ void LLAppViewer::metricsUpdateRegion(U64 region_handle)
*/
void LLAppViewer::metricsSend(bool enable_reporting)
{
- if (! gViewerAssetStatsMain)
+ if (! gViewerAssetStats)
return;
if (LLAppViewer::sTextureFetch)
@@ -5792,8 +5837,9 @@ void LLAppViewer::metricsSend(bool enable_reporting)
// Make a copy of the main stats to send into another thread.
// Receiving thread takes ownership.
- LLViewerAssetStats * main_stats(new LLViewerAssetStats(*gViewerAssetStatsMain));
-
+ LLViewerAssetStats * main_stats(new LLViewerAssetStats(*gViewerAssetStats));
+ main_stats->stop();
+
// Send a report request into 'thread1' to get the rest of the data
// and provide some additional parameters while here.
LLAppViewer::sTextureFetch->commandSendMetrics(caps_url,
@@ -5811,6 +5857,6 @@ void LLAppViewer::metricsSend(bool enable_reporting)
// Reset even if we can't report. Rather than gather up a huge chunk of
// data, we'll keep to our sampling interval and retain the data
// resolution in time.
- gViewerAssetStatsMain->reset();
+ gViewerAssetStats->restart();
}
diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h
index 25b5c90bb0..e0f3f326c7 100755
--- a/indra/newview/llappviewer.h
+++ b/indra/newview/llappviewer.h
@@ -32,7 +32,6 @@
#include "llsys.h" // for LLOSInfo
#include "lltimer.h"
#include "llappcorehttp.h"
-#include <boost/optional.hpp>
class LLCommandLineParser;
class LLFrameTimer;
@@ -44,7 +43,7 @@ class LLWatchdogTimeout;
class LLUpdaterService;
class LLViewerJoystick;
-extern LLFastTimer::DeclareTimer FTM_FRAME;
+extern LLTrace::BlockTimerStatHandle FTM_FRAME;
class LLAppViewer : public LLApp
{
@@ -176,6 +175,8 @@ public:
void addOnIdleCallback(const boost::function<void()>& cb); // add a callback to fire (once) when idle
void purgeCache(); // Clear the local cache.
+ void purgeCacheImmediate(); //clear local cache immediately.
+ S32 updateTextureThreads(F32 max_time);
// mute/unmute the system's master audio
virtual void setMasterSystemAudioMute(bool mute);
@@ -279,7 +280,7 @@ private:
LLWatchdogTimeout* mMainloopTimeout;
// For performance and metric gathering
- LLThread* mFastTimerLogThread;
+ class LLThread* mFastTimerLogThread;
// for tracking viewer<->region circuit death
bool mAgentRegionLastAlive;
@@ -342,12 +343,12 @@ extern U32 gForegroundFrameCount;
extern LLPumpIO* gServicePump;
-extern U64 gFrameTime; // The timestamp of the most-recently-processed frame
-extern F32 gFrameTimeSeconds; // Loses msec precision after ~4.5 hours...
-extern F32 gFrameIntervalSeconds; // Elapsed time between current and previous gFrameTimeSeconds
+extern U64MicrosecondsImplicit gStartTime;
+extern U64MicrosecondsImplicit gFrameTime; // The timestamp of the most-recently-processed frame
+extern F32SecondsImplicit gFrameTimeSeconds; // Loses msec precision after ~4.5 hours...
+extern F32SecondsImplicit gFrameIntervalSeconds; // Elapsed time between current and previous gFrameTimeSeconds
extern F32 gFPSClamped; // Frames per second, smoothed, weighted toward last frame
extern F32 gFrameDTClamped;
-extern U64 gStartTime;
extern U32 gFrameStalls;
extern LLTimer gRenderStartTime;
@@ -375,7 +376,7 @@ class LLVFS;
extern LLVFS *gStaticVFS;
extern LLMemoryInfo gSysMemory;
-extern U64 gMemoryAllocated;
+extern U64Bytes gMemoryAllocated;
extern std::string gLastVersionChannel;
diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp
index 11fcf0018e..f5742b29cf 100755
--- a/indra/newview/llappviewerlinux.cpp
+++ b/indra/newview/llappviewerlinux.cpp
@@ -90,7 +90,7 @@ int main( int argc, char **argv )
bool ok = viewer_app_ptr->init();
if(!ok)
{
- llwarns << "Application init failed." << llendl;
+ LL_WARNS() << "Application init failed." << LL_ENDL;
return -1;
}
@@ -220,7 +220,7 @@ void viewerappapi_init(ViewerAppAPI *server)
}
else
{
- llwarns << "Unable to register service name: " << error->message << llendl;
+ LL_WARNS() << "Unable to register service name: " << error->message << LL_ENDL;
}
g_object_unref(serverproxy);
@@ -239,7 +239,7 @@ gboolean viewer_app_api_GoSLURL(ViewerAppAPI *obj, gchar *slurl, gboolean **succ
{
bool success = false;
- llinfos << "Was asked to go to slurl: " << slurl << llendl;
+ LL_INFOS() << "Was asked to go to slurl: " << slurl << LL_ENDL;
std::string url = slurl;
LLMediaCtrl* web = NULL;
@@ -305,14 +305,14 @@ bool LLAppViewerLinux::sendURLToOtherInstance(const std::string& url)
}
else
{
- llinfos << "Call-out to other instance failed (perhaps not running): " << error->message << llendl;
+ LL_INFOS() << "Call-out to other instance failed (perhaps not running): " << error->message << LL_ENDL;
}
g_object_unref(G_OBJECT(remote_object));
}
else
{
- llwarns << "Couldn't connect to session bus: " << error->message << llendl;
+ LL_WARNS() << "Couldn't connect to session bus: " << error->message << LL_ENDL;
}
if (error)
@@ -368,7 +368,7 @@ void LLAppViewerLinux::initCrashReporting(bool reportFreeze)
if (pid == 0)
{ // child
execv(cmd.c_str(), (char* const*) cmdargv); /* Flawfinder: ignore */
- llwarns << "execv failure when trying to start " << cmd << llendl;
+ LL_WARNS() << "execv failure when trying to start " << cmd << LL_ENDL;
_exit(1); // avoid atexit()
}
else
@@ -383,7 +383,7 @@ void LLAppViewerLinux::initCrashReporting(bool reportFreeze)
}
else
{
- llwarns << "fork failure." << llendl;
+ LL_WARNS() << "fork failure." << LL_ENDL;
}
}
// Sometimes signals don't seem to quit the viewer. Also, we may
diff --git a/indra/newview/llappviewerlinux_api_dbus.cpp b/indra/newview/llappviewerlinux_api_dbus.cpp
index 32e7e0a83d..6ac30bd9b8 100755
--- a/indra/newview/llappviewerlinux_api_dbus.cpp
+++ b/indra/newview/llappviewerlinux_api_dbus.cpp
@@ -35,9 +35,9 @@ extern "C" {
#include "apr_dso.h"
}
-#define DEBUGMSG(...) do { lldebugs << llformat(__VA_ARGS__) << llendl; } while(0)
-#define INFOMSG(...) do { llinfos << llformat(__VA_ARGS__) << llendl; } while(0)
-#define WARNMSG(...) do { llwarns << llformat(__VA_ARGS__) << llendl; } while(0)
+#define DEBUGMSG(...) do { LL_DEBUGS() << llformat(__VA_ARGS__) << LL_ENDL; } while(0)
+#define INFOMSG(...) do { LL_INFOS() << llformat(__VA_ARGS__) << LL_ENDL; } while(0)
+#define WARNMSG(...) do { LL_WARNS() << llformat(__VA_ARGS__) << LL_ENDL; } while(0)
#define LL_DBUS_SYM(REQUIRED, DBUSSYM, RTN, ...) RTN (*ll##DBUSSYM)(__VA_ARGS__) = NULL
#include "llappviewerlinux_api_dbus_syms_raw.inc"
diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp
index c6d45cf4d6..c792eb8813 100755
--- a/indra/newview/llappviewermacosx.cpp
+++ b/indra/newview/llappviewermacosx.cpp
@@ -98,9 +98,9 @@ bool initViewer()
// Set the working dir to <bundle>/Contents/Resources
if (chdir(gDirUtilp->getAppRODataDir().c_str()) == -1)
{
- llwarns << "Could not change directory to "
- << gDirUtilp->getAppRODataDir() << ": " << strerror(errno)
- << llendl;
+ LL_WARNS() << "Could not change directory to "
+ << gDirUtilp->getAppRODataDir() << ": " << strerror(errno)
+ << LL_ENDL;
}
gViewerAppPtr = new LLAppViewerMacOSX();
@@ -114,7 +114,7 @@ bool initViewer()
bool ok = gViewerAppPtr->init();
if(!ok)
{
- llwarns << "Application init failed." << llendl;
+ LL_WARNS() << "Application init failed." << LL_ENDL;
}
return ok;
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index 5585bd914c..57fb84bbf1 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -29,11 +29,12 @@
#ifdef INCLUDE_VLD
#include "vld.h"
#endif
+#include "llwin32headers.h"
-#include "llappviewerwin32.h"
+#include "llwindowwin32.h" // *FIX: for setting gIconResource.
+#include "llappviewerwin32.h"
-#include "llwindowwin32.h" // *FIX: for setting gIconResource.
#include "llgl.h"
#include "res/resource.h" // *FIX: for setting gIconResource.
@@ -52,7 +53,6 @@
#include <stdlib.h>
#include "llweb.h"
-#include "llsecondlifeurls.h"
#include "llviewernetwork.h"
#include "llmd5.h"
@@ -88,7 +88,7 @@ static void exceptionTerminateHandler()
LONG WINAPI catchallCrashHandler(EXCEPTION_POINTERS * /*ExceptionInfo*/)
{
- llwarns << "Hit last ditch-effort attempt to catch crash." << llendl;
+ LL_WARNS() << "Hit last ditch-effort attempt to catch crash." << LL_ENDL;
exceptionTerminateHandler();
return 0;
}
@@ -100,7 +100,7 @@ LONG WINAPI catchallCrashHandler(EXCEPTION_POINTERS * /*ExceptionInfo*/)
extern "C" {
void _wassert(const wchar_t * _Message, const wchar_t *_File, unsigned _Line)
{
- llerrs << _Message << llendl;
+ LL_ERRS() << _Message << LL_ENDL;
}
}
#endif
@@ -116,7 +116,7 @@ void nvapi_error(NvAPI_Status status)
{
NvAPI_ShortString szDesc = {0};
NvAPI_GetErrorMessage(status, szDesc);
- llwarns << szDesc << llendl;
+ LL_WARNS() << szDesc << LL_ENDL;
//should always trigger when asserts are enabled
//llassert(status == NVAPI_OK);
@@ -278,7 +278,7 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
bool ok = viewer_app_ptr->init();
if(!ok)
{
- llwarns << "Application init failed." << llendl;
+ LL_WARNS() << "Application init failed." << LL_ENDL;
return -1;
}
@@ -306,12 +306,12 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
// Have to wait until after logging is initialized to display LFH info
if (num_heaps > 0)
{
- llinfos << "Attempted to enable LFH for " << num_heaps << " heaps." << llendl;
+ LL_INFOS() << "Attempted to enable LFH for " << num_heaps << " heaps." << LL_ENDL;
for(S32 i = 0; i < num_heaps; i++)
{
if (heap_enable_lfh_error[i])
{
- llinfos << " Failed to enable LFH for heap: " << i << " Error: " << heap_enable_lfh_error[i] << llendl;
+ LL_INFOS() << " Failed to enable LFH for heap: " << i << " Error: " << heap_enable_lfh_error[i] << LL_ENDL;
}
}
}
@@ -330,14 +330,14 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
// app cleanup if there was a problem.
//
#if WINDOWS_CRT_MEM_CHECKS
- llinfos << "CRT Checking memory:" << llendflush;
+ LL_INFOS() << "CRT Checking memory:" << LL_ENDL;
if (!_CrtCheckMemory())
{
- llwarns << "_CrtCheckMemory() failed at prior to cleanup!" << llendflush;
+ LL_WARNS() << "_CrtCheckMemory() failed at prior to cleanup!" << LL_ENDL;
}
else
{
- llinfos << " No corruption detected." << llendflush;
+ LL_INFOS() << " No corruption detected." << LL_ENDL;
}
#endif
@@ -346,14 +346,14 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
viewer_app_ptr->cleanup();
#if WINDOWS_CRT_MEM_CHECKS
- llinfos << "CRT Checking memory:" << llendflush;
+ LL_INFOS() << "CRT Checking memory:" << LL_ENDL;
if (!_CrtCheckMemory())
{
- llwarns << "_CrtCheckMemory() failed after cleanup!" << llendflush;
+ LL_WARNS() << "_CrtCheckMemory() failed after cleanup!" << LL_ENDL;
}
else
{
- llinfos << " No corruption detected." << llendflush;
+ LL_INFOS() << " No corruption detected." << LL_ENDL;
}
#endif
@@ -424,11 +424,11 @@ void LLAppViewerWin32::disableWinErrorReporting()
if( 0 == pAddERExcludedApplicationA( executable_name ) )
{
U32 error_code = GetLastError();
- llinfos << "AddERExcludedApplication() failed with error code " << error_code << llendl;
+ LL_INFOS() << "AddERExcludedApplication() failed with error code " << error_code << LL_ENDL;
}
else
{
- llinfos << "AddERExcludedApplication() success for " << executable_name << llendl;
+ LL_INFOS() << "AddERExcludedApplication() success for " << executable_name << LL_ENDL;
}
}
FreeLibrary( fault_rep_dll_handle );
@@ -438,7 +438,7 @@ void LLAppViewerWin32::disableWinErrorReporting()
const S32 MAX_CONSOLE_LINES = 500;
-void create_console()
+static bool create_console()
{
int h_con_handle;
long l_std_handle;
@@ -447,7 +447,7 @@ void create_console()
FILE *fp;
// allocate a console for this app
- AllocConsole();
+ const bool isConsoleAllocated = AllocConsole();
// set the screen buffer to be big enough to let us scroll text
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &coninfo);
@@ -459,7 +459,7 @@ void create_console()
h_con_handle = _open_osfhandle(l_std_handle, _O_TEXT);
if (h_con_handle == -1)
{
- llwarns << "create_console() failed to open stdout handle" << llendl;
+ LL_WARNS() << "create_console() failed to open stdout handle" << LL_ENDL;
}
else
{
@@ -473,7 +473,7 @@ void create_console()
h_con_handle = _open_osfhandle(l_std_handle, _O_TEXT);
if (h_con_handle == -1)
{
- llwarns << "create_console() failed to open stdin handle" << llendl;
+ LL_WARNS() << "create_console() failed to open stdin handle" << LL_ENDL;
}
else
{
@@ -487,7 +487,7 @@ void create_console()
h_con_handle = _open_osfhandle(l_std_handle, _O_TEXT);
if (h_con_handle == -1)
{
- llwarns << "create_console() failed to open stderr handle" << llendl;
+ LL_WARNS() << "create_console() failed to open stderr handle" << LL_ENDL;
}
else
{
@@ -495,10 +495,13 @@ void create_console()
*stderr = *fp;
setvbuf( stderr, NULL, _IONBF, 0 );
}
+
+ return isConsoleAllocated;
}
LLAppViewerWin32::LLAppViewerWin32(const char* cmd_line) :
- mCmdLine(cmd_line)
+ mCmdLine(cmd_line),
+ mIsConsoleAllocated(false)
{
}
@@ -514,7 +517,7 @@ bool LLAppViewerWin32::init()
// (Don't send our data to Microsoft--at least until we are Logo approved and have a way
// of getting the data back from them.)
//
- // llinfos << "Turning off Windows error reporting." << llendl;
+ // LL_INFOS() << "Turning off Windows error reporting." << LL_ENDL;
disableWinErrorReporting();
#ifndef LL_RELEASE_FOR_DOWNLOAD
@@ -542,6 +545,16 @@ bool LLAppViewerWin32::cleanup()
gDXHardware.cleanup();
+#ifndef LL_RELEASE_FOR_DOWNLOAD
+ LLWinDebug::instance().cleanup();
+#endif
+
+ if (mIsConsoleAllocated)
+ {
+ FreeConsole();
+ mIsConsoleAllocated = false;
+ }
+
return result;
}
@@ -553,7 +566,7 @@ void LLAppViewerWin32::initLoggingAndGetLastDuration()
void LLAppViewerWin32::initConsole()
{
// pop up debug console
- create_console();
+ mIsConsoleAllocated = create_console();
return LLAppViewer::initConsole();
}
@@ -603,7 +616,7 @@ bool LLAppViewerWin32::initHardwareTest()
if (OSBTN_NO== button)
{
LL_INFOS("AppInit") << "User quitting after failed DirectX 9 detection" << LL_ENDL;
- LLWeb::loadURLExternal(DIRECTX_9_URL, false);
+ LLWeb::loadURLExternal("http://secondlife.com/support/", false);
return false;
}
gWarningSettings.setBOOL("AboutDirectX9", FALSE);
@@ -734,7 +747,7 @@ bool LLAppViewerWin32::sendURLToOtherInstance(const std::string& url)
if (other_window != NULL)
{
- lldebugs << "Found other window with the name '" << getWindowTitle() << "'" << llendl;
+ LL_DEBUGS() << "Found other window with the name '" << getWindowTitle() << "'" << LL_ENDL;
COPYDATASTRUCT cds;
const S32 SLURL_MESSAGE_TYPE = 0;
cds.dwData = SLURL_MESSAGE_TYPE;
@@ -742,8 +755,8 @@ bool LLAppViewerWin32::sendURLToOtherInstance(const std::string& url)
cds.lpData = (void*)url.c_str();
LRESULT msg_result = SendMessage(other_window, WM_COPYDATA, NULL, (LPARAM)&cds);
- lldebugs << "SendMessage(WM_COPYDATA) to other window '"
- << getWindowTitle() << "' returned " << msg_result << llendl;
+ LL_DEBUGS() << "SendMessage(WM_COPYDATA) to other window '"
+ << getWindowTitle() << "' returned " << msg_result << LL_ENDL;
return true;
}
return false;
@@ -775,7 +788,7 @@ std::string LLAppViewerWin32::generateSerialNumber()
}
else
{
- llwarns << "GetVolumeInformation failed" << llendl;
+ LL_WARNS() << "GetVolumeInformation failed" << LL_ENDL;
}
return serial_md5;
}
diff --git a/indra/newview/llappviewerwin32.h b/indra/newview/llappviewerwin32.h
index fb37df1a2f..59d1ddaa3d 100644
--- a/indra/newview/llappviewerwin32.h
+++ b/indra/newview/llappviewerwin32.h
@@ -61,7 +61,8 @@ protected:
private:
void disableWinErrorReporting();
- std::string mCmdLine;
+ std::string mCmdLine;
+ bool mIsConsoleAllocated;
};
#endif // LL_LLAPPVIEWERWIN32_H
diff --git a/indra/newview/llassetuploadqueue.cpp b/indra/newview/llassetuploadqueue.cpp
index 4bdb690225..8833c57948 100755
--- a/indra/newview/llassetuploadqueue.cpp
+++ b/indra/newview/llassetuploadqueue.cpp
@@ -36,6 +36,7 @@
class LLAssetUploadChainResponder : public LLUpdateTaskInventoryResponder
{
+ LOG_CLASS(LLAssetUploadChainResponder);
public:
LLAssetUploadChainResponder(const LLSD& post_data,
@@ -51,58 +52,60 @@ public:
mDataSize(data_size),
mScriptName(script_name)
{
- }
+ }
virtual ~LLAssetUploadChainResponder()
- {
- if(mSupplier)
- {
- LLAssetUploadQueue *queue = mSupplier->get();
- if (queue)
- {
- // Give ownership of supplier back to queue.
- queue->mSupplier = mSupplier;
- mSupplier = NULL;
- }
- }
- delete mSupplier;
+ {
+ if(mSupplier)
+ {
+ LLAssetUploadQueue *queue = mSupplier->get();
+ if (queue)
+ {
+ // Give ownership of supplier back to queue.
+ queue->mSupplier = mSupplier;
+ mSupplier = NULL;
+ }
+ }
+ delete mSupplier;
delete mData;
- }
+ }
- virtual void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content)
- {
- llwarns << "LLAssetUploadChainResponder Error [status:"
- << statusNum << "]: " << content << llendl;
- LLUpdateTaskInventoryResponder::errorWithContent(statusNum, reason, content);
- LLAssetUploadQueue *queue = mSupplier->get();
- if (queue)
+protected:
+ virtual void httpFailure()
+ {
+ // Parent class will spam the failure.
+ //LL_WARNS() << dumpResponse() << LL_ENDL;
+ LLUpdateTaskInventoryResponder::httpFailure();
+ LLAssetUploadQueue *queue = mSupplier->get();
+ if (queue)
+ {
+ queue->request(&mSupplier);
+ }
+ }
+
+ virtual void httpSuccess()
+ {
+ LLUpdateTaskInventoryResponder::httpSuccess();
+ LLAssetUploadQueue *queue = mSupplier->get();
+ if (queue)
{
- queue->request(&mSupplier);
- }
- }
-
- virtual void result(const LLSD& content)
- {
- LLUpdateTaskInventoryResponder::result(content);
- LLAssetUploadQueue *queue = mSupplier->get();
- if (queue)
- {
- // Responder is reused across 2 phase upload,
- // so only start next upload after 2nd phase complete.
- std::string state = content["state"];
- if(state == "complete")
- {
- queue->request(&mSupplier);
- }
- }
- }
+ // Responder is reused across 2 phase upload,
+ // so only start next upload after 2nd phase complete.
+ const std::string& state = getContent()["state"].asStringRef();
+ if(state == "complete")
+ {
+ queue->request(&mSupplier);
+ }
+ }
+ }
+public:
virtual void uploadUpload(const LLSD& content)
{
std::string uploader = content["uploader"];
mSupplier->log(std::string("Compiling " + mScriptName).c_str());
- llinfos << "Compiling " << llendl;
+ LL_INFOS() << "Compiling " << LL_ENDL;
// postRaw takes ownership of mData and will delete it.
LLHTTPClient::postRaw(uploader, mData, mDataSize, this);
@@ -116,7 +119,7 @@ public:
if (content["compiled"])
{
mSupplier->log("Compilation succeeded");
- llinfos << "Compiled!" << llendl;
+ LL_INFOS() << "Compiled!" << LL_ENDL;
}
else
{
@@ -127,7 +130,7 @@ public:
std::string str = line->asString();
str.erase(std::remove(str.begin(), str.end(), '\n'), str.end());
mSupplier->log(str);
- llinfos << content["errors"] << llendl;
+ LL_INFOS() << content["errors"] << LL_ENDL;
}
}
LLUpdateTaskInventoryResponder::uploadComplete(content);
diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp
index 2564802387..a98ff64d0a 100755
--- a/indra/newview/llassetuploadresponders.cpp
+++ b/indra/newview/llassetuploadresponders.cpp
@@ -135,7 +135,7 @@ void on_new_single_inventory_upload_complete(
inventory_item_flags = (U32) server_response["inventory_flags"].asInteger();
if (inventory_item_flags != 0)
{
- llinfos << "inventory_item_flags " << inventory_item_flags << llendl;
+ LL_INFOS() << "inventory_item_flags " << inventory_item_flags << LL_ENDL;
}
}
S32 creation_date_now = time_corrected();
@@ -173,7 +173,7 @@ void on_new_single_inventory_upload_complete(
}
else
{
- llwarns << "Can't find a folder to put it in" << llendl;
+ LL_WARNS() << "Can't find a folder to put it in" << LL_ENDL;
}
// remove the "Uploading..." message
@@ -197,7 +197,7 @@ LLAssetUploadResponder::LLAssetUploadResponder(const LLSD &post_data,
{
if (!gVFS->getExists(vfile_id, asset_type))
{
- llwarns << "LLAssetUploadResponder called with nonexistant vfile_id" << llendl;
+ LL_WARNS() << "LLAssetUploadResponder called with nonexistant vfile_id" << LL_ENDL;
mVFileID.setNull();
mAssetType = LLAssetType::AT_NONE;
return;
@@ -225,37 +225,41 @@ LLAssetUploadResponder::~LLAssetUploadResponder()
}
// virtual
-void LLAssetUploadResponder::errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content)
+void LLAssetUploadResponder::httpFailure()
{
- llinfos << "LLAssetUploadResponder::error [status:"
- << statusNum << "]: " << content << llendl;
+ // *TODO: Add adaptive retry policy?
+ LL_WARNS() << dumpResponse() << LL_ENDL;
LLSD args;
- switch(statusNum)
+ if (isHttpClientErrorStatus(getStatus()))
{
- case 400:
- args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName);
- args["REASON"] = "Error in upload request. Please visit "
- "http://secondlife.com/support for help fixing this problem.";
- LLNotificationsUtil::add("CannotUploadReason", args);
- break;
- case 500:
- default:
- args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName);
- args["REASON"] = "The server is experiencing unexpected "
- "difficulties.";
- LLNotificationsUtil::add("CannotUploadReason", args);
- break;
+ args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName);
+ args["REASON"] = "Error in upload request. Please visit "
+ "http://secondlife.com/support for help fixing this problem.";
+ LLNotificationsUtil::add("CannotUploadReason", args);
+ }
+ else
+ {
+ args["FILE"] = (mFileName.empty() ? mVFileID.asString() : mFileName);
+ args["REASON"] = "The server is experiencing unexpected "
+ "difficulties.";
+ LLNotificationsUtil::add("CannotUploadReason", args);
}
LLUploadDialog::modalUploadFinished();
LLFilePicker::instance().reset(); // unlock file picker when bulk upload fails
}
//virtual
-void LLAssetUploadResponder::result(const LLSD& content)
+void LLAssetUploadResponder::httpSuccess()
{
- lldebugs << "LLAssetUploadResponder::result from capabilities" << llendl;
+ const LLSD& content = getContent();
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
+ LL_DEBUGS() << "LLAssetUploadResponder::result from capabilities" << LL_ENDL;
- std::string state = content["state"];
+ const std::string& state = content["state"].asStringRef();
if (state == "upload")
{
@@ -267,7 +271,7 @@ void LLAssetUploadResponder::result(const LLSD& content)
if (mFileName.empty())
{
// rename the file in the VFS to the actual asset id
- // llinfos << "Changing uploaded asset UUID to " << content["new_asset"].asUUID() << llendl;
+ // LL_INFOS() << "Changing uploaded asset UUID to " << content["new_asset"].asUUID() << LL_ENDL;
gVFS->renameFile(mVFileID, mAssetType, content["new_asset"].asUUID(), mAssetType);
}
uploadComplete(content);
@@ -280,7 +284,7 @@ void LLAssetUploadResponder::result(const LLSD& content)
void LLAssetUploadResponder::uploadUpload(const LLSD& content)
{
- std::string uploader = content["uploader"];
+ const std::string& uploader = content["uploader"].asStringRef();
if (mFileName.empty())
{
LLHTTPClient::postFile(uploader, mVFileID, mAssetType, this);
@@ -293,6 +297,7 @@ void LLAssetUploadResponder::uploadUpload(const LLSD& content)
void LLAssetUploadResponder::uploadFailure(const LLSD& content)
{
+ LL_WARNS() << dumpResponse() << LL_ENDL;
// remove the "Uploading..." message
LLUploadDialog::modalUploadFinished();
LLFloater* floater_snapshot = LLFloaterReg::findInstance("snapshot");
@@ -301,7 +306,7 @@ void LLAssetUploadResponder::uploadFailure(const LLSD& content)
floater_snapshot->notify(LLSD().with("set-finished", LLSD().with("ok", false).with("msg", "inventory")));
}
- std::string reason = content["state"];
+ const std::string& reason = content["state"].asStringRef();
// deal with L$ errors
if (reason == "insufficient funds")
{
@@ -340,9 +345,9 @@ LLNewAgentInventoryResponder::LLNewAgentInventoryResponder(
}
// virtual
-void LLNewAgentInventoryResponder::errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content)
+void LLNewAgentInventoryResponder::httpFailure()
{
- LLAssetUploadResponder::errorWithContent(statusNum, reason, content);
+ LLAssetUploadResponder::httpFailure();
//LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, LLUUID(), FALSE);
}
@@ -358,11 +363,11 @@ void LLNewAgentInventoryResponder::uploadFailure(const LLSD& content)
//virtual
void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content)
{
- lldebugs << "LLNewAgentInventoryResponder::result from capabilities" << llendl;
+ LL_DEBUGS() << "LLNewAgentInventoryResponder::result from capabilities" << LL_ENDL;
//std::ostringstream llsdxml;
//LLSDSerialize::toXML(content, llsdxml);
- //llinfos << "upload complete content:\n " << llsdxml.str() << llendl;
+ //LL_INFOS() << "upload complete content:\n " << llsdxml.str() << LL_ENDL;
LLAssetType::EType asset_type = LLAssetType::lookup(mPostData["asset_type"].asString());
LLInventoryType::EType inventory_type = LLInventoryType::lookup(mPostData["inventory_type"].asString());
@@ -445,58 +450,6 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content)
//LLImportColladaAssetCache::getInstance()->assetUploaded(mVFileID, content["new_asset"], TRUE);
}
-LLSendTexLayerResponder::LLSendTexLayerResponder(const LLSD& post_data,
- const LLUUID& vfile_id,
- LLAssetType::EType asset_type,
- LLBakedUploadData * baked_upload_data) :
- LLAssetUploadResponder(post_data, vfile_id, asset_type),
- mBakedUploadData(baked_upload_data)
-{
-}
-
-LLSendTexLayerResponder::~LLSendTexLayerResponder()
-{
- // mBakedUploadData is normally deleted by calls to LLViewerTexLayerSetBuffer::onTextureUploadComplete() below
- if (mBakedUploadData)
- { // ...but delete it in the case where uploadComplete() is never called
- delete mBakedUploadData;
- mBakedUploadData = NULL;
- }
-}
-
-
-// Baked texture upload completed
-void LLSendTexLayerResponder::uploadComplete(const LLSD& content)
-{
- LLUUID item_id = mPostData["item_id"];
-
- std::string result = content["state"];
- LLUUID new_id = content["new_asset"];
-
- llinfos << "result: " << result << " new_id: " << new_id << llendl;
- if (result == "complete"
- && mBakedUploadData != NULL)
- { // Invoke
- LLViewerTexLayerSetBuffer::onTextureUploadComplete(new_id, (void*) mBakedUploadData, 0, LL_EXSTAT_NONE);
- mBakedUploadData = NULL; // deleted in onTextureUploadComplete()
- }
- else
- { // Invoke the original callback with an error result
- LLViewerTexLayerSetBuffer::onTextureUploadComplete(new_id, (void*) mBakedUploadData, -1, LL_EXSTAT_NONE);
- mBakedUploadData = NULL; // deleted in onTextureUploadComplete()
- }
-}
-
-void LLSendTexLayerResponder::errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content)
-{
- llinfos << "LLSendTexLayerResponder error [status:"
- << statusNum << "]: " << content << llendl;
-
- // Invoke the original callback with an error result
- LLViewerTexLayerSetBuffer::onTextureUploadComplete(LLUUID(), (void*) mBakedUploadData, -1, LL_EXSTAT_NONE);
- mBakedUploadData = NULL; // deleted in onTextureUploadComplete()
-}
-
LLUpdateAgentInventoryResponder::LLUpdateAgentInventoryResponder(
const LLSD& post_data,
const LLUUID& vfile_id,
@@ -516,14 +469,14 @@ LLUpdateAgentInventoryResponder::LLUpdateAgentInventoryResponder(
//virtual
void LLUpdateAgentInventoryResponder::uploadComplete(const LLSD& content)
{
- llinfos << "LLUpdateAgentInventoryResponder::result from capabilities" << llendl;
+ LL_INFOS() << "LLUpdateAgentInventoryResponder::result from capabilities" << LL_ENDL;
LLUUID item_id = mPostData["item_id"];
LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(item_id);
if(!item)
{
- llwarns << "Inventory item for " << mVFileID
- << " is no longer in agent inventory." << llendl;
+ LL_WARNS() << "Inventory item for " << mVFileID
+ << " is no longer in agent inventory." << LL_ENDL;
return;
}
@@ -533,8 +486,8 @@ void LLUpdateAgentInventoryResponder::uploadComplete(const LLSD& content)
gInventory.updateItem(new_item);
gInventory.notifyObservers();
- llinfos << "Inventory item " << item->getName() << " saved into "
- << content["new_asset"].asString() << llendl;
+ LL_INFOS() << "Inventory item " << item->getName() << " saved into "
+ << content["new_asset"].asString() << LL_ENDL;
LLInventoryType::EType inventory_type = new_item->getInventoryType();
switch(inventory_type)
@@ -630,7 +583,7 @@ LLUpdateTaskInventoryResponder::LLUpdateTaskInventoryResponder(const LLSD& post_
//virtual
void LLUpdateTaskInventoryResponder::uploadComplete(const LLSD& content)
{
- llinfos << "LLUpdateTaskInventoryResponder::result from capabilities" << llendl;
+ LL_INFOS() << "LLUpdateTaskInventoryResponder::result from capabilities" << LL_ENDL;
LLUUID item_id = mPostData["item_id"];
LLUUID task_id = mPostData["task_id"];
@@ -711,9 +664,9 @@ public:
{
if (!gVFS->getExists(vfile_id, asset_type))
{
- llwarns
+ LL_WARNS()
<< "LLAssetUploadResponder called with nonexistant "
- << "vfile_id " << vfile_id << llendl;
+ << "vfile_id " << vfile_id << LL_ENDL;
mVFileID.setNull();
mAssetType = LLAssetType::AT_NONE;
}
@@ -1009,19 +962,14 @@ LLNewAgentInventoryVariablePriceResponder::~LLNewAgentInventoryVariablePriceResp
delete mImpl;
}
-void LLNewAgentInventoryVariablePriceResponder::errorWithContent(
- U32 statusNum,
- const std::string& reason,
- const LLSD& content)
+void LLNewAgentInventoryVariablePriceResponder::httpFailure()
{
- lldebugs
- << "LLNewAgentInventoryVariablePrice::error " << statusNum
- << " reason: " << reason << llendl;
+ const LLSD& content = getContent();
+ LL_WARNS("Upload") << dumpResponse() << LL_ENDL;
- if ( content.has("error") )
+ static const std::string _ERROR = "error";
+ if ( content.has(_ERROR) )
{
- static const std::string _ERROR = "error";
-
mImpl->onTransportError(content[_ERROR]);
}
else
@@ -1030,8 +978,14 @@ void LLNewAgentInventoryVariablePriceResponder::errorWithContent(
}
}
-void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content)
+void LLNewAgentInventoryVariablePriceResponder::httpSuccess()
{
+ const LLSD& content = getContent();
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
// Parse out application level errors and the appropriate
// responses for them
static const std::string _ERROR = "error";
@@ -1047,6 +1001,7 @@ void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content)
// Check for application level errors
if ( content.has(_ERROR) )
{
+ LL_WARNS("Upload") << dumpResponse() << LL_ENDL;
onApplicationLevelError(content[_ERROR]);
return;
}
@@ -1060,7 +1015,7 @@ void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content)
if (mImpl->getFilename().empty())
{
// rename the file in the VFS to the actual asset id
- // llinfos << "Changing uploaded asset UUID to " << content["new_asset"].asUUID() << llendl;
+ // LL_INFOS() << "Changing uploaded asset UUID to " << content["new_asset"].asUUID() << LL_ENDL;
gVFS->renameFile(
mImpl->getVFileID(),
asset_type,
@@ -1090,6 +1045,7 @@ void LLNewAgentInventoryVariablePriceResponder::result(const LLSD& content)
}
else
{
+ LL_WARNS("Upload") << dumpResponse() << LL_ENDL;
onApplicationLevelError("");
}
}
diff --git a/indra/newview/llassetuploadresponders.h b/indra/newview/llassetuploadresponders.h
index a6d1016136..7fbebc7481 100755
--- a/indra/newview/llassetuploadresponders.h
+++ b/indra/newview/llassetuploadresponders.h
@@ -33,6 +33,8 @@
// via capabilities
class LLAssetUploadResponder : public LLHTTPClient::Responder
{
+protected:
+ LOG_CLASS(LLAssetUploadResponder);
public:
LLAssetUploadResponder(const LLSD& post_data,
const LLUUID& vfile_id,
@@ -42,8 +44,11 @@ public:
LLAssetType::EType asset_type);
~LLAssetUploadResponder();
- virtual void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content);
- virtual void result(const LLSD& content);
+protected:
+ virtual void httpFailure();
+ virtual void httpSuccess();
+
+public:
virtual void uploadUpload(const LLSD& content);
virtual void uploadComplete(const LLSD& content);
virtual void uploadFailure(const LLSD& content);
@@ -58,6 +63,7 @@ protected:
// TODO*: Remove this once deprecated
class LLNewAgentInventoryResponder : public LLAssetUploadResponder
{
+ LOG_CLASS(LLNewAgentInventoryResponder);
public:
LLNewAgentInventoryResponder(
const LLSD& post_data,
@@ -67,9 +73,10 @@ public:
const LLSD& post_data,
const std::string& file_name,
LLAssetType::EType asset_type);
- virtual void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content);
virtual void uploadComplete(const LLSD& content);
virtual void uploadFailure(const LLSD& content);
+protected:
+ virtual void httpFailure();
};
// A base class which goes through and performs some default
@@ -79,6 +86,7 @@ public:
class LLNewAgentInventoryVariablePriceResponder :
public LLHTTPClient::Responder
{
+ LOG_CLASS(LLNewAgentInventoryVariablePriceResponder);
public:
LLNewAgentInventoryVariablePriceResponder(
const LLUUID& vfile_id,
@@ -91,12 +99,11 @@ public:
const LLSD& inventory_info);
virtual ~LLNewAgentInventoryVariablePriceResponder();
- void errorWithContent(
- U32 statusNum,
- const std::string& reason,
- const LLSD& content);
- void result(const LLSD& content);
+private:
+ /* virtual */ void httpFailure();
+ /* virtual */ void httpSuccess();
+public:
virtual void onApplicationLevelError(
const LLSD& error);
virtual void showConfirmationDialog(
@@ -109,24 +116,6 @@ private:
Impl* mImpl;
};
-struct LLBakedUploadData;
-class LLSendTexLayerResponder : public LLAssetUploadResponder
-{
- LOG_CLASS(LLSendTexLayerResponder);
-public:
- LLSendTexLayerResponder(const LLSD& post_data,
- const LLUUID& vfile_id,
- LLAssetType::EType asset_type,
- LLBakedUploadData * baked_upload_data);
-
- ~LLSendTexLayerResponder();
-
- virtual void uploadComplete(const LLSD& content);
- virtual void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content);
-
- LLBakedUploadData * mBakedUploadData;
-};
-
class LLUpdateAgentInventoryResponder : public LLAssetUploadResponder
{
public:
diff --git a/indra/newview/llattachmentsmgr.cpp b/indra/newview/llattachmentsmgr.cpp
index ea0b8f00a4..256980eb04 100755
--- a/indra/newview/llattachmentsmgr.cpp
+++ b/indra/newview/llattachmentsmgr.cpp
@@ -110,7 +110,7 @@ void LLAttachmentsMgr::onIdle()
LLViewerInventoryItem* item = gInventory.getItem(attachment.mItemID);
if (!item)
{
- llinfos << "Attempted to add non-existant item ID:" << attachment.mItemID << llendl;
+ LL_INFOS() << "Attempted to add non-existant item ID:" << attachment.mItemID << LL_ENDL;
continue;
}
S32 attachment_pt = attachment.mAttachmentPt;
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 307e72fe18..8235b13118 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -33,7 +33,6 @@
#include "llavatarnamecache.h" // IDEVO
#include "llsd.h"
-#include "lldarray.h"
#include "llnotifications.h"
#include "llnotificationsutil.h"
#include "roles_constants.h" // for GP_MEMBER_INVITE
@@ -76,6 +75,12 @@
#include "llavatarname.h"
#include "llagentui.h"
+// Flags for kick message
+const U32 KICK_FLAGS_DEFAULT = 0x0;
+const U32 KICK_FLAGS_FREEZE = 1 << 0;
+const U32 KICK_FLAGS_UNFREEZE = 1 << 1;
+
+
// static
void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name)
{
@@ -138,7 +143,7 @@ void LLAvatarActions::removeFriendsDialog(const uuid_vec_t& ids)
LLAvatarName av_name;
if(LLAvatarNameCache::get(agent_id, &av_name))
{
- args["NAME"] = av_name.getDisplayName();
+ args["NAME"] = av_name.getCompleteName();
}
msgType = "RemoveFromFriends";
@@ -166,7 +171,7 @@ void LLAvatarActions::offerTeleport(const LLUUID& invitee)
if (invitee.isNull())
return;
- LLDynamicArray<LLUUID> ids;
+ std::vector<LLUUID> ids;
ids.push_back(invitee);
offerTeleport(ids);
}
@@ -244,8 +249,9 @@ void LLAvatarActions::startAdhocCall(const uuid_vec_t& ids, const LLUUID& floate
return;
}
- // convert vector into LLDynamicArray for addSession
- LLDynamicArray<LLUUID> id_array;
+ // convert vector into std::vector for addSession
+ std::vector<LLUUID> id_array;
+ id_array.reserve(ids.size());
for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it)
{
id_array.push_back(*it);
@@ -290,7 +296,9 @@ bool LLAvatarActions::canCall()
void LLAvatarActions::startConference(const uuid_vec_t& ids, const LLUUID& floater_id)
{
// *HACK: Copy into dynamic array
- LLDynamicArray<LLUUID> id_array;
+ std::vector<LLUUID> id_array;
+
+ id_array.reserve(ids.size());
for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it)
{
id_array.push_back(*it);
@@ -373,7 +381,7 @@ void LLAvatarActions::showOnMap(const LLUUID& id)
}
gFloaterWorldMap->trackAvatar(id, av_name.getDisplayName());
- LLFloaterReg::showInstance("world_map");
+ LLFloaterReg::showInstance("world_map", "center");
}
// static
@@ -525,6 +533,14 @@ void LLAvatarActions::share(const LLUUID& id)
{
// we should always get here, but check to verify anyways
LLIMModel::getInstance()->addMessage(session_id, SYSTEM_FROM, LLUUID::null, LLTrans::getString("share_alert"), false);
+
+ LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::findConversation(session_id);
+ if (session_floater && session_floater->isMinimized())
+ {
+ session_floater->setMinimized(false);
+ }
+ LLFloaterIMContainer *im_container = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container");
+ im_container->selectConversationPair(session_id, true);
}
}
@@ -1043,7 +1059,7 @@ bool LLAvatarActions::handleRemove(const LLSD& notification, const LLSD& respons
case 1: // NO
default:
- llinfos << "No removal performed." << llendl;
+ LL_INFOS() << "No removal performed." << LL_ENDL;
break;
}
}
diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h
index 403414558e..85813f2152 100755
--- a/indra/newview/llavataractions.h
+++ b/indra/newview/llavataractions.h
@@ -27,7 +27,6 @@
#ifndef LL_LLAVATARACTIONS_H
#define LL_LLAVATARACTIONS_H
-#include "lldarray.h"
#include "llsd.h"
#include "lluuid.h"
diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp
index f34ad23769..746b541f9d 100755
--- a/indra/newview/llavatariconctrl.cpp
+++ b/indra/newview/llavatariconctrl.cpp
@@ -32,7 +32,6 @@
// viewer includes
#include "llagent.h"
-#include "llavatarconstants.h"
#include "llcallingcard.h" // for LLAvatarTracker
#include "llavataractions.h"
#include "llmenugl.h"
@@ -50,6 +49,18 @@
static LLDefaultChildRegistry::Register<LLAvatarIconCtrl> r("avatar_icon");
+namespace LLInitParam
+{
+ void TypeValues<LLAvatarIconCtrlEnums::ESymbolPos>::declareValues()
+ {
+ declare("BottomLeft", LLAvatarIconCtrlEnums::BOTTOM_LEFT);
+ declare("BottomRight", LLAvatarIconCtrlEnums::BOTTOM_RIGHT);
+ declare("TopLeft", LLAvatarIconCtrlEnums::TOP_LEFT);
+ declare("TopRight", LLAvatarIconCtrlEnums::TOP_RIGHT);
+ }
+}
+
+
bool LLAvatarIconIDCache::LLAvatarIconIDCacheItem::expired()
{
const F64 SEC_PER_DAY_PLUS_HOUR = (24.0 + 1.0) * 60.0 * 60.0;
@@ -61,7 +72,7 @@ bool LLAvatarIconIDCache::LLAvatarIconIDCacheItem::expired()
void LLAvatarIconIDCache::load ()
{
- llinfos << "Loading avatar icon id cache." << llendl;
+ LL_INFOS() << "Loading avatar icon id cache." << LL_ENDL;
// build filename for each user
std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, mFilename);
@@ -106,7 +117,7 @@ void LLAvatarIconIDCache::save ()
llofstream file (resolved_filename);
if (!file.is_open())
{
- llwarns << "can't open avatar icons cache file\"" << mFilename << "\" for writing" << llendl;
+ LL_WARNS() << "can't open avatar icons cache file\"" << mFilename << "\" for writing" << LL_ENDL;
return;
}
@@ -146,52 +157,63 @@ void LLAvatarIconIDCache::remove (const LLUUID& avatar_id)
LLAvatarIconCtrl::Params::Params()
: avatar_id("avatar_id"),
draw_tooltip("draw_tooltip", true),
- default_icon_name("default_icon_name")
+ default_icon_name("default_icon_name"),
+ symbol_hpad("symbol_hpad"),
+ symbol_vpad("symbol_vpad"),
+ symbol_size("symbol_size", 1),
+ symbol_pos("symbol_pos", LLAvatarIconCtrlEnums::BOTTOM_RIGHT)
{
+ changeDefault(min_width, 32);
+ changeDefault(min_height, 32);
}
LLAvatarIconCtrl::LLAvatarIconCtrl(const LLAvatarIconCtrl::Params& p)
- : LLIconCtrl(p),
+: LLIconCtrl(p),
LLAvatarPropertiesObserver(),
mAvatarId(),
mFullName(),
mDrawTooltip(p.draw_tooltip),
mDefaultIconName(p.default_icon_name),
- mAvatarNameCacheConnection()
+ mAvatarNameCacheConnection(),
+ mSymbolHpad(p.symbol_hpad),
+ mSymbolVpad(p.symbol_vpad),
+ mSymbolSize(p.symbol_size),
+ mSymbolPos(p.symbol_pos)
{
mPriority = LLViewerFetchedTexture::BOOST_ICON;
LLRect rect = p.rect;
- mDrawWidth = llmax(32, rect.getWidth()) ;
- mDrawHeight = llmax(32, rect.getHeight()) ;
-
- static LLUICachedControl<S32> llavatariconctrl_symbol_hpad("UIAvatariconctrlSymbolHPad", 2);
- static LLUICachedControl<S32> llavatariconctrl_symbol_vpad("UIAvatariconctrlSymbolVPad", 2);
- static LLUICachedControl<S32> llavatariconctrl_symbol_size("UIAvatariconctrlSymbolSize", 5);
- static LLUICachedControl<std::string> llavatariconctrl_symbol_pos("UIAvatariconctrlSymbolPosition", "BottomRight");
// BottomRight is the default position
- S32 left = rect.getWidth() - llavatariconctrl_symbol_size - llavatariconctrl_symbol_hpad;
- S32 bottom = llavatariconctrl_symbol_vpad;
+ S32 left = rect.getWidth() - mSymbolSize - mSymbolHpad;
+ S32 bottom = mSymbolVpad;
- if ("BottomLeft" == (std::string)llavatariconctrl_symbol_pos)
+ switch(mSymbolPos)
+ {
+ case LLAvatarIconCtrlEnums::BOTTOM_LEFT:
{
- left = llavatariconctrl_symbol_hpad;
- bottom = llavatariconctrl_symbol_vpad;
+ left = mSymbolHpad;
+ bottom = mSymbolVpad;
}
- else if ("TopLeft" == (std::string)llavatariconctrl_symbol_pos)
+
+ case LLAvatarIconCtrlEnums::TOP_LEFT:
{
- left = llavatariconctrl_symbol_hpad;
- bottom = rect.getHeight() - llavatariconctrl_symbol_size - llavatariconctrl_symbol_vpad;
+ left = mSymbolHpad;
+ bottom = rect.getHeight() - mSymbolSize - mSymbolVpad;
}
- else if ("TopRight" == (std::string)llavatariconctrl_symbol_pos)
+
+ case LLAvatarIconCtrlEnums::TOP_RIGHT:
{
- left = rect.getWidth() - llavatariconctrl_symbol_size - llavatariconctrl_symbol_hpad;
- bottom = rect.getHeight() - llavatariconctrl_symbol_size - llavatariconctrl_symbol_vpad;
+ left = rect.getWidth() - mSymbolSize - mSymbolHpad;
+ bottom = rect.getHeight() - mSymbolSize - mSymbolVpad;
}
- rect.setOriginAndSize(left, bottom, llavatariconctrl_symbol_size, llavatariconctrl_symbol_size);
+ case LLAvatarIconCtrlEnums::BOTTOM_RIGHT:
+ // fallthrough, is default
+ default:
+ rect.setOriginAndSize(left, bottom, mSymbolSize, mSymbolSize);
+ }
if (p.avatar_id.isProvided())
{
diff --git a/indra/newview/llavatariconctrl.h b/indra/newview/llavatariconctrl.h
index 4929efb7d0..5b5720f4ac 100755
--- a/indra/newview/llavatariconctrl.h
+++ b/indra/newview/llavatariconctrl.h
@@ -29,7 +29,7 @@
#include <boost/signals2.hpp>
-#include "../llui/lliconctrl.h"
+#include "lliconctrl.h"
#include "llavatarpropertiesprocessor.h"
#include "llviewermenu.h"
@@ -41,14 +41,14 @@ public:
struct LLAvatarIconIDCacheItem
{
LLUUID icon_id;
- LLDate cached_time;
+ LLDate cached_time;
bool expired();
};
- LLAvatarIconIDCache():mFilename("avatar_icons_cache.txt")
- {
- }
+ LLAvatarIconIDCache()
+ : mFilename("avatar_icons_cache.txt")
+ {}
void load ();
void save ();
@@ -64,15 +64,41 @@ protected:
std::map<LLUUID,LLAvatarIconIDCacheItem> mCache;//we cache only LLUID and time
};
+namespace LLAvatarIconCtrlEnums
+{
+ enum ESymbolPos
+ {
+ BOTTOM_LEFT,
+ BOTTOM_RIGHT,
+ TOP_LEFT,
+ TOP_RIGHT
+ };
+}
+
+
+namespace LLInitParam
+{
+ template<>
+ struct TypeValues<LLAvatarIconCtrlEnums::ESymbolPos> : public TypeValuesHelper<LLAvatarIconCtrlEnums::ESymbolPos>
+ {
+ static void declareValues();
+ };
+}
+
class LLAvatarIconCtrl
: public LLIconCtrl, public LLAvatarPropertiesObserver
{
public:
struct Params : public LLInitParam::Block<Params, LLIconCtrl::Params>
{
- Optional <LLUUID> avatar_id;
- Optional <bool> draw_tooltip;
- Optional <std::string> default_icon_name;
+ Optional<LLUUID> avatar_id;
+ Optional<bool> draw_tooltip;
+ Optional<std::string> default_icon_name;
+ Optional<S32> symbol_hpad,
+ symbol_vpad,
+ symbol_size;
+ Optional<LLAvatarIconCtrlEnums::ESymbolPos> symbol_pos;
+
Params();
};
@@ -98,6 +124,10 @@ protected:
std::string mFullName;
bool mDrawTooltip;
std::string mDefaultIconName;
+ S32 mSymbolHpad,
+ mSymbolVpad,
+ mSymbolSize;
+ LLAvatarIconCtrlEnums::ESymbolPos mSymbolPos;
bool updateFromCache();
diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp
index 9f02f301a1..8846d1317d 100755
--- a/indra/newview/llavatarlist.cpp
+++ b/indra/newview/llavatarlist.cpp
@@ -586,7 +586,7 @@ bool LLAvatarItemComparator::compare(const LLPanel* item1, const LLPanel* item2)
if (!avatar_item1 || !avatar_item2)
{
- llerror("item1 and item2 cannot be null", 0);
+ LL_ERRS() << "item1 and item2 cannot be null" << LL_ENDL;
return true;
}
diff --git a/indra/newview/llavatarpropertiesprocessor.cpp b/indra/newview/llavatarpropertiesprocessor.cpp
index 706bc42ea0..856eb3414e 100755
--- a/indra/newview/llavatarpropertiesprocessor.cpp
+++ b/indra/newview/llavatarpropertiesprocessor.cpp
@@ -36,7 +36,6 @@
#include "llstartup.h"
// Linden library includes
-#include "llavatarconstants.h" // AVATAR_TRANSACTED, etc.
#include "lldate.h"
#include "lltrans.h"
#include "llui.h" // LLUI::getLanguage()
@@ -171,11 +170,11 @@ void LLAvatarPropertiesProcessor::sendAvatarPropertiesUpdate(const LLAvatarData*
{
if (!gAgent.isInitialized() || (gAgent.getID() == LLUUID::null))
{
- llwarns << "Sending avatarinfo update DENIED - invalid agent" << llendl;
+ LL_WARNS() << "Sending avatarinfo update DENIED - invalid agent" << LL_ENDL;
return;
}
- llinfos << "Sending avatarinfo update" << llendl;
+ LL_INFOS() << "Sending avatarinfo update" << LL_ENDL;
// This value is required by sendAvatarPropertiesUpdate method.
//A profile should never be mature. (From the original code)
diff --git a/indra/newview/llavatarpropertiesprocessor.h b/indra/newview/llavatarpropertiesprocessor.h
index fdb88a41a1..1dcd2c9b90 100755
--- a/indra/newview/llavatarpropertiesprocessor.h
+++ b/indra/newview/llavatarpropertiesprocessor.h
@@ -33,6 +33,14 @@
#include <list>
#include <map>
+// For Flags in AvatarPropertiesReply
+const U32 AVATAR_ALLOW_PUBLISH = 0x1 << 0; // whether profile is externally visible or not
+const U32 AVATAR_MATURE_PUBLISH = 0x1 << 1; // profile is "mature"
+const U32 AVATAR_IDENTIFIED = 0x1 << 2; // whether avatar has provided payment info
+const U32 AVATAR_TRANSACTED = 0x1 << 3; // whether avatar has actively used payment info
+const U32 AVATAR_ONLINE = 0x1 << 4; // the online status of this avatar, if known.
+const U32 AVATAR_AGEVERIFIED = 0x1 << 5; // whether avatar has been age-verified
+
/*
*TODO Vadim: This needs some refactoring:
- Remove EAvatarProcessorType in favor of separate observers, derived from a common parent (to get rid of void*).
diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp
index d6a72b0c05..38e153137c 100644
--- a/indra/newview/llavatarrenderinfoaccountant.cpp
+++ b/indra/newview/llavatarrenderinfoaccountant.cpp
@@ -70,18 +70,18 @@ public:
LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
if (regionp)
{
- llwarns << "HTTP error result for avatar weight GET: " << statusNum
+ LL_WARNS() << "HTTP error result for avatar weight GET: " << statusNum
<< ", " << reason
<< " returned by region " << regionp->getName()
- << llendl;
+ << LL_ENDL;
}
else
{
- llwarns << "Avatar render weight GET error recieved but region not found for "
+ LL_WARNS() << "Avatar render weight GET error recieved but region not found for "
<< mRegionHandle
<< ", error " << statusNum
<< ", " << reason
- << llendl;
+ << LL_ENDL;
}
}
@@ -93,7 +93,7 @@ public:
{
if (LLAvatarRenderInfoAccountant::logRenderInfo())
{
- llinfos << "LRI: Result for avatar weights request for region " << regionp->getName() << ":" << llendl;
+ LL_INFOS() << "LRI: Result for avatar weights request for region " << regionp->getName() << ":" << LL_ENDL;
}
if (content.isMap())
@@ -116,8 +116,8 @@ public:
if (LLAvatarRenderInfoAccountant::logRenderInfo())
{
- llinfos << "LRI: Agent " << target_agent_id
- << ": " << agent_info_map << llendl;
+ LL_INFOS() << "LRI: Agent " << target_agent_id
+ << ": " << agent_info_map << LL_ENDL;
}
if (agent_info_map.has(KEY_WEIGHT))
@@ -132,18 +132,18 @@ public:
else if (content.has(KEY_ERROR))
{
const LLSD & error = content[KEY_ERROR];
- llwarns << "Avatar render info GET error: "
+ LL_WARNS() << "Avatar render info GET error: "
<< error[KEY_IDENTIFIER]
<< ": " << error[KEY_MESSAGE]
<< " from region " << regionp->getName()
- << llendl;
+ << LL_ENDL;
}
}
}
else
{
- llinfos << "Avatar render weight info recieved but region not found for "
- << mRegionHandle << llendl;
+ LL_INFOS() << "Avatar render weight info recieved but region not found for "
+ << mRegionHandle << LL_ENDL;
}
}
@@ -165,18 +165,18 @@ public:
LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
if (regionp)
{
- llwarns << "HTTP error result for avatar weight POST: " << statusNum
+ LL_WARNS() << "HTTP error result for avatar weight POST: " << statusNum
<< ", " << reason
<< " returned by region " << regionp->getName()
- << llendl;
+ << LL_ENDL;
}
else
{
- llwarns << "Avatar render weight POST error recieved but region not found for "
+ LL_WARNS() << "Avatar render weight POST error recieved but region not found for "
<< mRegionHandle
<< ", error " << statusNum
<< ", " << reason
- << llendl;
+ << LL_ENDL;
}
}
@@ -187,8 +187,8 @@ public:
{
if (LLAvatarRenderInfoAccountant::logRenderInfo())
{
- llinfos << "LRI: Result for avatar weights POST for region " << regionp->getName()
- << ": " << content << llendl;
+ LL_INFOS() << "LRI: Result for avatar weights POST for region " << regionp->getName()
+ << ": " << content << LL_ENDL;
}
if (content.isMap())
@@ -196,18 +196,18 @@ public:
if (content.has(KEY_ERROR))
{
const LLSD & error = content[KEY_ERROR];
- llwarns << "Avatar render info POST error: "
+ LL_WARNS() << "Avatar render info POST error: "
<< error[KEY_IDENTIFIER]
<< ": " << error[KEY_MESSAGE]
<< " from region " << regionp->getName()
- << llendl;
+ << LL_ENDL;
}
}
}
else
{
- llinfos << "Avatar render weight POST result recieved but region not found for "
- << mRegionHandle << llendl;
+ LL_INFOS() << "Avatar render weight POST result recieved but region not found for "
+ << mRegionHandle << LL_ENDL;
}
}
@@ -225,10 +225,10 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio
{
if (logRenderInfo())
{
- llinfos << "LRI: Sending avatar render info to region "
+ LL_INFOS() << "LRI: Sending avatar render info to region "
<< regionp->getName()
<< " from " << url
- << llendl;
+ << LL_ENDL;
}
// Build the render info to POST to the region
@@ -254,11 +254,11 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio
if (logRenderInfo())
{
- llinfos << "LRI: Sending avatar render info for " << avatar->getID()
- << ": " << info << llendl;
- llinfos << "LRI: other info geometry " << avatar->getAttachmentGeometryBytes()
+ LL_INFOS() << "LRI: Sending avatar render info for " << avatar->getID()
+ << ": " << info << LL_ENDL;
+ LL_INFOS() << "LRI: other info geometry " << avatar->getAttachmentGeometryBytes()
<< ", area " << avatar->getAttachmentSurfaceArea()
- << llendl;
+ << LL_ENDL;
}
}
}
@@ -285,10 +285,10 @@ void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regi
{
if (logRenderInfo())
{
- llinfos << "LRI: Requesting avatar render info for region "
+ LL_INFOS() << "LRI: Requesting avatar render info for region "
<< regionp->getName()
<< " from " << url
- << llendl;
+ << LL_ENDL;
}
// First send a request to get the latest data
@@ -310,8 +310,8 @@ void LLAvatarRenderInfoAccountant::idle()
if (logRenderInfo())
{
- llinfos << "LRI: Scanning all regions and checking for render info updates"
- << llendl;
+ LL_INFOS() << "LRI: Scanning all regions and checking for render info updates"
+ << LL_ENDL;
}
// Check all regions and see if it's time to fetch/send data
@@ -375,9 +375,9 @@ void LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer(const LLUUID& reg
{
if (logRenderInfo())
{
- llinfos << "LRI: Viewer has new region capabilities, clearing global render info timer"
+ LL_INFOS() << "LRI: Viewer has new region capabilities, clearing global render info timer"
<< " and timer for region " << region_id
- << llendl;
+ << LL_ENDL;
}
// Reset the global timer so it will scan regions immediately
diff --git a/indra/newview/llblocklist.cpp b/indra/newview/llblocklist.cpp
index 3849fbeb54..1c68fabf8b 100755
--- a/indra/newview/llblocklist.cpp
+++ b/indra/newview/llblocklist.cpp
@@ -324,7 +324,7 @@ bool LLBlockListItemComparator::compare(const LLPanel* item1, const LLPanel* ite
if (!blocked_item1 || !blocked_item2)
{
- llerror("blocked_item1 and blocked_item2 cannot be null", 0);
+ LL_ERRS() << "blocked_item1 and blocked_item2 cannot be null" << LL_ENDL;
return true;
}
diff --git a/indra/newview/llbreastmotion.cpp b/indra/newview/llbreastmotion.cpp
index 9a8cd5ceae..3a88bab3b3 100755
--- a/indra/newview/llbreastmotion.cpp
+++ b/indra/newview/llbreastmotion.cpp
@@ -340,8 +340,7 @@ BOOL LLBreastMotion::onUpdate(F32 time, U8* joint_mask)
if (mBreastParamsDriven[i])
{
mCharacter->setVisualParamWeight(mBreastParamsDriven[i],
- new_local_pt[i],
- FALSE);
+ new_local_pt[i]);
}
}
diff --git a/indra/newview/llbuycurrencyhtml.cpp b/indra/newview/llbuycurrencyhtml.cpp
index 459123a5d8..1c69dadb12 100755
--- a/indra/newview/llbuycurrencyhtml.cpp
+++ b/indra/newview/llbuycurrencyhtml.cpp
@@ -148,7 +148,7 @@ void LLBuyCurrencyHTML::showDialog( bool specific_sum_requested, const std::stri
}
else
{
- llwarns << "Buy Currency (HTML) Floater not found" << llendl;
+ LL_WARNS() << "Buy Currency (HTML) Floater not found" << LL_ENDL;
};
}
diff --git a/indra/newview/llcallbacklist.cpp b/indra/newview/llcallbacklist.cpp
index 79ec43dfe9..59ecbdd0ea 100755
--- a/indra/newview/llcallbacklist.cpp
+++ b/indra/newview/llcallbacklist.cpp
@@ -56,7 +56,7 @@ void LLCallbackList::addFunction( callback_t func, void *data)
{
if (!func)
{
- llerrs << "LLCallbackList::addFunction - function is NULL" << llendl;
+ LL_ERRS() << "LLCallbackList::addFunction - function is NULL" << LL_ENDL;
return;
}
@@ -234,14 +234,14 @@ void doPeriodically(bool_func_t callable, F32 seconds)
void test1(void *data)
{
S32 *s32_data = (S32 *)data;
- llinfos << "testfunc1 " << *s32_data << llendl;
+ LL_INFOS() << "testfunc1 " << *s32_data << LL_ENDL;
}
void test2(void *data)
{
S32 *s32_data = (S32 *)data;
- llinfos << "testfunc2 " << *s32_data << llendl;
+ LL_INFOS() << "testfunc2 " << *s32_data << LL_ENDL;
}
@@ -252,54 +252,54 @@ LLCallbackList::test()
S32 b = 2;
LLCallbackList *list = new LLCallbackList;
- llinfos << "Testing LLCallbackList" << llendl;
+ LL_INFOS() << "Testing LLCallbackList" << LL_ENDL;
if (!list->deleteFunction(NULL))
{
- llinfos << "passed 1" << llendl;
+ LL_INFOS() << "passed 1" << LL_ENDL;
}
else
{
- llinfos << "error, removed function from empty list" << llendl;
+ LL_INFOS() << "error, removed function from empty list" << LL_ENDL;
}
- // llinfos << "This should crash" << llendl;
+ // LL_INFOS() << "This should crash" << LL_ENDL;
// list->addFunction(NULL);
list->addFunction(&test1, &a);
list->addFunction(&test1, &a);
- llinfos << "Expect: test1 1, test1 1" << llendl;
+ LL_INFOS() << "Expect: test1 1, test1 1" << LL_ENDL;
list->callFunctions();
list->addFunction(&test1, &b);
list->addFunction(&test2, &b);
- llinfos << "Expect: test1 1, test1 1, test1 2, test2 2" << llendl;
+ LL_INFOS() << "Expect: test1 1, test1 1, test1 2, test2 2" << LL_ENDL;
list->callFunctions();
if (list->deleteFunction(&test1, &b))
{
- llinfos << "passed 3" << llendl;
+ LL_INFOS() << "passed 3" << LL_ENDL;
}
else
{
- llinfos << "error removing function" << llendl;
+ LL_INFOS() << "error removing function" << LL_ENDL;
}
- llinfos << "Expect: test1 1, test1 1, test2 2" << llendl;
+ LL_INFOS() << "Expect: test1 1, test1 1, test2 2" << LL_ENDL;
list->callFunctions();
list->deleteAllFunctions();
- llinfos << "Expect nothing" << llendl;
+ LL_INFOS() << "Expect nothing" << LL_ENDL;
list->callFunctions();
- llinfos << "nothing :-)" << llendl;
+ LL_INFOS() << "nothing :-)" << LL_ENDL;
delete list;
- llinfos << "test complete" << llendl;
+ LL_INFOS() << "test complete" << LL_ENDL;
}
#endif // _DEBUG
diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp
index 91741c2a77..afbb73ee08 100755
--- a/indra/newview/llcallingcard.cpp
+++ b/indra/newview/llcallingcard.cpp
@@ -32,13 +32,10 @@
#include "llcallingcard.h"
-#include <vector>
#include <algorithm>
-//#include <iterator>
#include "indra_constants.h"
-#include "llavatarnamecache.h"
-#include "llcachename.h"
+//#include "llcachename.h"
#include "llstl.h"
#include "lltimer.h"
#include "lluuid.h"
@@ -46,19 +43,14 @@
#include "llagent.h"
#include "llavatarnamecache.h"
-#include "llbutton.h"
#include "llinventoryobserver.h"
#include "llinventorymodel.h"
#include "llnotifications.h"
-#include "llnotificationsutil.h"
-#include "llresmgr.h"
#include "llslurl.h"
#include "llimview.h"
#include "lltrans.h"
#include "llviewercontrol.h"
-#include "llviewernetwork.h"
#include "llviewerobjectlist.h"
-#include "llviewerwindow.h"
#include "llvoavatar.h"
#include "llavataractions.h"
@@ -105,8 +97,6 @@ static void on_avatar_name_cache_notify(const LLUUID& agent_id,
LLAvatarTracker::LLAvatarTracker() :
mTrackingData(NULL),
mTrackedAgentValid(false),
- //mInventory(NULL),
- //mInventoryObserver(NULL),
mModifyMask(0x0)
{
}
@@ -265,21 +255,21 @@ S32 LLAvatarTracker::addBuddyList(const LLAvatarTracker::buddy_map_t& buds)
// IDEVO: is this necessary? name is unused?
gCacheName->getFullName(agent_id, full_name);
addChangedMask(LLFriendObserver::ADD, agent_id);
- lldebugs << "Added buddy " << agent_id
+ LL_DEBUGS() << "Added buddy " << agent_id
<< ", " << (mBuddyInfo[agent_id]->isOnline() ? "Online" : "Offline")
<< ", TO: " << mBuddyInfo[agent_id]->getRightsGrantedTo()
<< ", FROM: " << mBuddyInfo[agent_id]->getRightsGrantedFrom()
- << llendl;
+ << LL_ENDL;
}
else
{
LLRelationship* e_r = (*existing_buddy).second;
LLRelationship* n_r = (*itr).second;
- llwarns << "!! Add buddy for existing buddy: " << agent_id
+ LL_WARNS() << "!! Add buddy for existing buddy: " << agent_id
<< " [" << (e_r->isOnline() ? "Online" : "Offline") << "->" << (n_r->isOnline() ? "Online" : "Offline")
<< ", " << e_r->getRightsGrantedTo() << "->" << n_r->getRightsGrantedTo()
<< ", " << e_r->getRightsGrantedTo() << "->" << n_r->getRightsGrantedTo()
- << "]" << llendl;
+ << "]" << LL_ENDL;
}
}
notifyObservers();
@@ -300,7 +290,7 @@ void LLAvatarTracker::copyBuddyList(buddy_map_t& buddies) const
void LLAvatarTracker::terminateBuddy(const LLUUID& id)
{
- lldebugs << "LLAvatarTracker::terminateBuddy()" << llendl;
+ LL_DEBUGS() << "LLAvatarTracker::terminateBuddy()" << LL_ENDL;
LLRelationship* buddy = get_ptr_in_map(mBuddyInfo, id);
if(!buddy) return;
mBuddyInfo.erase(id);
@@ -338,12 +328,12 @@ void LLAvatarTracker::setBuddyOnline(const LLUUID& id, bool is_online)
{
info->online(is_online);
addChangedMask(LLFriendObserver::ONLINE, id);
- lldebugs << "Set buddy " << id << (is_online ? " Online" : " Offline") << llendl;
+ LL_DEBUGS() << "Set buddy " << id << (is_online ? " Online" : " Offline") << LL_ENDL;
}
else
{
- llwarns << "!! No buddy info found for " << id
- << ", setting to " << (is_online ? "Online" : "Offline") << llendl;
+ LL_WARNS() << "!! No buddy info found for " << id
+ << ", setting to " << (is_online ? "Online" : "Offline") << LL_ENDL;
}
}
@@ -390,7 +380,7 @@ void LLAvatarTracker::empower(const LLUUID& id, bool grant)
void LLAvatarTracker::empowerList(const buddy_map_t& list, bool grant)
{
- llwarns << "LLAvatarTracker::empowerList() not implemented." << llendl;
+ LL_WARNS() << "LLAvatarTracker::empowerList() not implemented." << LL_ENDL;
/*
LLMessageSystem* msg = gMessageSystem;
const char* message_name;
@@ -602,14 +592,14 @@ void LLAvatarTracker::agentFound(const LLUUID& prey,
// static
void LLAvatarTracker::processOnlineNotification(LLMessageSystem* msg, void**)
{
- lldebugs << "LLAvatarTracker::processOnlineNotification()" << llendl;
+ LL_DEBUGS() << "LLAvatarTracker::processOnlineNotification()" << LL_ENDL;
instance().processNotify(msg, true);
}
// static
void LLAvatarTracker::processOfflineNotification(LLMessageSystem* msg, void**)
{
- lldebugs << "LLAvatarTracker::processOfflineNotification()" << llendl;
+ LL_DEBUGS() << "LLAvatarTracker::processOfflineNotification()" << LL_ENDL;
instance().processNotify(msg, false);
}
@@ -643,11 +633,11 @@ void LLAvatarTracker::processChange(LLMessageSystem* msg)
payload["from_id"] = agent_id;
if(LLRelationship::GRANT_MODIFY_OBJECTS & new_rights)
{
- LLNotificationsUtil::add("GrantedModifyRights",args, payload);
+ LLNotifications::instance().add("GrantedModifyRights",args, payload);
}
else
{
- LLNotificationsUtil::add("RevokedModifyRights",args, payload);
+ LLNotifications::instance().add("RevokedModifyRights",args, payload);
}
}
(mBuddyInfo[agent_id])->setRightsFrom(new_rights);
@@ -661,7 +651,7 @@ void LLAvatarTracker::processChange(LLMessageSystem* msg)
void LLAvatarTracker::processChangeUserRights(LLMessageSystem* msg, void**)
{
- lldebugs << "LLAvatarTracker::processChangeUserRights()" << llendl;
+ LL_DEBUGS() << "LLAvatarTracker::processChangeUserRights()" << LL_ENDL;
instance().processChange(msg);
}
@@ -670,7 +660,7 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online)
S32 count = msg->getNumberOfBlocksFast(_PREHASH_AgentBlock);
BOOL chat_notify = gSavedSettings.getBOOL("ChatOnlineNotification");
- lldebugs << "Received " << count << " online notifications **** " << llendl;
+ LL_DEBUGS() << "Received " << count << " online notifications **** " << LL_ENDL;
if(count > 0)
{
LLUUID agent_id;
@@ -692,8 +682,8 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online)
}
else
{
- llwarns << "Received online notification for unknown buddy: "
- << agent_id << " is " << (online ? "ONLINE" : "OFFLINE") << llendl;
+ LL_WARNS() << "Received online notification for unknown buddy: "
+ << agent_id << " is " << (online ? "ONLINE" : "OFFLINE") << LL_ENDL;
}
if(tracking_id == agent_id)
@@ -731,7 +721,7 @@ static void on_avatar_name_cache_notify(const LLUUID& agent_id,
if (online)
{
notification =
- LLNotificationsUtil::add("FriendOnlineOffline",
+ LLNotifications::instance().add("FriendOnlineOffline",
args,
payload.with("respond_on_mousedown", TRUE),
boost::bind(&LLAvatarActions::startIM, agent_id));
@@ -739,7 +729,7 @@ static void on_avatar_name_cache_notify(const LLUUID& agent_id,
else
{
notification =
- LLNotificationsUtil::add("FriendOnlineOffline", args, payload);
+ LLNotifications::instance().add("FriendOnlineOffline", args, payload);
}
// If there's an open IM session with this agent, send a notification there too.
@@ -805,8 +795,8 @@ void LLTrackingData::agentFound(const LLUUID& prey,
{
if(prey != mAvatarID)
{
- llwarns << "LLTrackingData::agentFound() - found " << prey
- << " but looking for " << mAvatarID << llendl;
+ LL_WARNS() << "LLTrackingData::agentFound() - found " << prey
+ << " but looking for " << mAvatarID << LL_ENDL;
}
mHaveInfo = true;
mAgentGone.setTimerExpirySec(OFFLINE_SECONDS);
diff --git a/indra/newview/llcaphttpsender.cpp b/indra/newview/llcaphttpsender.cpp
index 16bb48da93..b2524d14f8 100755
--- a/indra/newview/llcaphttpsender.cpp
+++ b/indra/newview/llcaphttpsender.cpp
@@ -40,8 +40,8 @@ void LLCapHTTPSender::send(const LLHost& host, const std::string& message,
const LLSD& body,
LLHTTPClient::ResponderPtr response) const
{
- llinfos << "LLCapHTTPSender::send: message " << message
- << " to host " << host << llendl;
+ LL_INFOS() << "LLCapHTTPSender::send: message " << message
+ << " to host " << host << LL_ENDL;
LLSD llsd;
llsd["message"] = message;
llsd["body"] = body;
diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp
index fa23251d95..b0537a83f1 100755
--- a/indra/newview/llchannelmanager.cpp
+++ b/indra/newview/llchannelmanager.cpp
@@ -50,7 +50,7 @@ LLChannelManager::LLChannelManager()
if(!gViewerWindow)
{
- llerrs << "LLChannelManager::LLChannelManager() - viwer window is not initialized yet" << llendl;
+ LL_ERRS() << "LLChannelManager::LLChannelManager() - viwer window is not initialized yet" << LL_ENDL;
}
}
@@ -113,33 +113,29 @@ void LLChannelManager::onLoginCompleted()
}
else
{
- // TODO: Seems this code leads to MAINT-3536 new crash in XML_ParserFree.
- // Need to investigate this and fix possible problems with notifications in startup time
- // Viewer can normally receive and show of postponed notifications about purchasing in marketplace on startup time.
- // Other types of postponed notifications did not tested.
- //// create a channel for the StartUp Toast
- //LLScreenChannelBase::Params p;
- //p.id = LLUUID(gSavedSettings.getString("StartUpChannelUUID"));
- //p.channel_align = CA_RIGHT;
- //mStartUpChannel = createChannel(p);
-
- //if(!mStartUpChannel)
- //{
- // onStartUpToastClose();
- //}
- //else
- //{
- // gViewerWindow->getRootView()->addChild(mStartUpChannel);
-
- // // init channel's position and size
- // S32 channel_right_bound = gViewerWindow->getWorldViewRectScaled().mRight - gSavedSettings.getS32("NotificationChannelRightMargin");
- // S32 channel_width = gSavedSettings.getS32("NotifyBoxWidth");
- // mStartUpChannel->init(channel_right_bound - channel_width, channel_right_bound);
- // mStartUpChannel->setMouseDownCallback(boost::bind(&LLNotificationWellWindow::onStartUpToastClick, LLNotificationWellWindow::getInstance(), _2, _3, _4));
-
- // mStartUpChannel->setCommitCallback(boost::bind(&LLChannelManager::onStartUpToastClose, this));
- // mStartUpChannel->createStartUpToast(away_notifications, gSavedSettings.getS32("StartUpToastLifeTime"));
- //}
+ // create a channel for the StartUp Toast
+ LLScreenChannelBase::Params p;
+ p.id = LLUUID(gSavedSettings.getString("StartUpChannelUUID"));
+ p.channel_align = CA_RIGHT;
+ mStartUpChannel = createChannel(p);
+
+ if(!mStartUpChannel)
+ {
+ onStartUpToastClose();
+ }
+ else
+ {
+ gViewerWindow->getRootView()->addChild(mStartUpChannel);
+
+ // init channel's position and size
+ S32 channel_right_bound = gViewerWindow->getWorldViewRectScaled().mRight - gSavedSettings.getS32("NotificationChannelRightMargin");
+ S32 channel_width = gSavedSettings.getS32("NotifyBoxWidth");
+ mStartUpChannel->init(channel_right_bound - channel_width, channel_right_bound);
+ mStartUpChannel->setMouseDownCallback(boost::bind(&LLNotificationWellWindow::onStartUpToastClick, LLNotificationWellWindow::getInstance(), _2, _3, _4));
+
+ mStartUpChannel->setCommitCallback(boost::bind(&LLChannelManager::onStartUpToastClose, this));
+ mStartUpChannel->createStartUpToast(away_notifications, gSavedSettings.getS32("StartUpToastLifeTime"));
+ }
}
LLPersistentNotificationStorage::getInstance()->loadNotifications();
@@ -251,7 +247,7 @@ LLNotificationsUI::LLScreenChannel* LLChannelManager::getNotificationScreenChann
if (channel == NULL)
{
- llwarns << "Can't find screen channel by NotificationChannelUUID" << llendl;
+ LL_WARNS() << "Can't find screen channel by NotificationChannelUUID" << LL_ENDL;
llassert(!"Can't find screen channel by NotificationChannelUUID");
}
diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp
index b3bc0ba966..00fa6dd979 100755
--- a/indra/newview/llchatbar.cpp
+++ b/indra/newview/llchatbar.cpp
@@ -28,7 +28,6 @@
#include "llchatbar.h"
-#include "imageids.h"
#include "llfontgl.h"
#include "llrect.h"
#include "llerror.h"
@@ -522,10 +521,10 @@ void LLChatBar::onInputEditorKeystroke( LLLineEditor* caller, void* userdata )
}
}
- //llinfos << "GESTUREDEBUG " << trigger
+ //LL_INFOS() << "GESTUREDEBUG " << trigger
// << " len " << length
// << " outlen " << out_str.getLength()
- // << llendl;
+ // << LL_ENDL;
}
}
@@ -589,22 +588,22 @@ void LLChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL
{
if (type == CHAT_TYPE_WHISPER)
{
- lldebugs << "You whisper " << utf8_text << llendl;
+ LL_DEBUGS() << "You whisper " << utf8_text << LL_ENDL;
gAgent.sendAnimationRequest(ANIM_AGENT_WHISPER, ANIM_REQUEST_START);
}
else if (type == CHAT_TYPE_NORMAL)
{
- lldebugs << "You say " << utf8_text << llendl;
+ LL_DEBUGS() << "You say " << utf8_text << LL_ENDL;
gAgent.sendAnimationRequest(ANIM_AGENT_TALK, ANIM_REQUEST_START);
}
else if (type == CHAT_TYPE_SHOUT)
{
- lldebugs << "You shout " << utf8_text << llendl;
+ LL_DEBUGS() << "You shout " << utf8_text << LL_ENDL;
gAgent.sendAnimationRequest(ANIM_AGENT_SHOUT, ANIM_REQUEST_START);
}
else
{
- llinfos << "send_chat_from_viewer() - invalid volume" << llendl;
+ LL_INFOS() << "send_chat_from_viewer() - invalid volume" << LL_ENDL;
return;
}
}
@@ -612,30 +611,12 @@ void LLChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL
{
if (type != CHAT_TYPE_START && type != CHAT_TYPE_STOP)
{
- lldebugs << "Channel chat: " << utf8_text << llendl;
+ LL_DEBUGS() << "Channel chat: " << utf8_text << LL_ENDL;
}
}
send_chat_from_viewer(utf8_out_text, type, channel);
}
-/*
-void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 channel)
-{
- LLMessageSystem* msg = gMessageSystem;
- msg->newMessageFast(_PREHASH_ChatFromViewer);
- msg->nextBlockFast(_PREHASH_AgentData);
- msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
- msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
- msg->nextBlockFast(_PREHASH_ChatData);
- msg->addStringFast(_PREHASH_Message, utf8_out_text);
- msg->addU8Fast(_PREHASH_Type, type);
- msg->addS32("Channel", channel);
-
- gAgent.sendReliableMessage();
-
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_CHAT_COUNT);
-}
-*/
void LLChatBar::onCommitGesture(LLUICtrl* ctrl)
{
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index abeaf958eb..84b9ac756a 100755
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -107,6 +107,7 @@ class LLChatHistoryHeader: public LLPanel
public:
LLChatHistoryHeader()
: LLPanel(),
+ mInfoCtrl(NULL),
mPopupMenuHandleAvatar(),
mPopupMenuHandleObject(),
mAvatarID(),
@@ -129,9 +130,6 @@ public:
~LLChatHistoryHeader()
{
- // Detach the info button so that it doesn't get destroyed (EXT-8463).
- hideInfoCtrl();
-
if (mAvatarNameCacheConnection.connected())
{
mAvatarNameCacheConnection.disconnect();
@@ -292,6 +290,11 @@ public:
mUserNameTextBox = getChild<LLTextBox>("user_name");
mTimeBoxTextBox = getChild<LLTextBox>("time_box");
+ mInfoCtrl = LLUICtrlFactory::getInstance()->createFromFile<LLUICtrl>("inspector_info_ctrl.xml", this, LLPanel::child_registry_t::instance());
+ llassert(mInfoCtrl != NULL);
+ mInfoCtrl->setCommitCallback(boost::bind(&LLChatHistoryHeader::onClickInfoCtrl, mInfoCtrl));
+ mInfoCtrl->setVisible(FALSE);
+
return LLPanel::postBuild();
}
@@ -589,39 +592,19 @@ protected:
void showInfoCtrl()
{
- if (mAvatarID.isNull() || mFrom.empty() || CHAT_SOURCE_SYSTEM == mSourceType) return;
-
- if (!sInfoCtrl)
- {
- // *TODO: Delete the button at exit.
- sInfoCtrl = LLUICtrlFactory::createFromFile<LLUICtrl>("inspector_info_ctrl.xml", NULL, LLPanel::child_registry_t::instance());
- if (sInfoCtrl)
- {
- sInfoCtrl->setCommitCallback(boost::bind(&LLChatHistoryHeader::onClickInfoCtrl, sInfoCtrl));
- }
- }
-
- if (!sInfoCtrl)
+ const bool isVisible = !mAvatarID.isNull() && !mFrom.empty() && CHAT_SOURCE_SYSTEM != mSourceType;
+ if (isVisible)
{
- llassert(sInfoCtrl != NULL);
- return;
+ const LLRect sticky_rect = mUserNameTextBox->getRect();
+ S32 icon_x = llmin(sticky_rect.mLeft + mUserNameTextBox->getTextBoundingRect().getWidth() + 7, sticky_rect.mRight - 3);
+ mInfoCtrl->setOrigin(icon_x, sticky_rect.getCenterY() - mInfoCtrl->getRect().getHeight() / 2 ) ;
}
-
- LLTextBox* name = getChild<LLTextBox>("user_name");
- LLRect sticky_rect = name->getRect();
- S32 icon_x = llmin(sticky_rect.mLeft + name->getTextBoundingRect().getWidth() + 7, sticky_rect.mRight - 3);
- sInfoCtrl->setOrigin(icon_x, sticky_rect.getCenterY() - sInfoCtrl->getRect().getHeight() / 2 ) ;
- addChild(sInfoCtrl);
+ mInfoCtrl->setVisible(isVisible);
}
void hideInfoCtrl()
{
- if (!sInfoCtrl) return;
-
- if (sInfoCtrl->getParent() == this)
- {
- removeChild(sInfoCtrl);
- }
+ mInfoCtrl->setVisible(FALSE);
}
private:
@@ -692,7 +675,7 @@ protected:
LLHandle<LLView> mPopupMenuHandleAvatar;
LLHandle<LLView> mPopupMenuHandleObject;
- static LLUICtrl* sInfoCtrl;
+ LLUICtrl* mInfoCtrl;
LLUUID mAvatarID;
LLSD mObjectData;
@@ -709,8 +692,6 @@ private:
boost::signals2::connection mAvatarNameCacheConnection;
};
-LLUICtrl* LLChatHistoryHeader::sInfoCtrl = NULL;
-
LLChatHistory::LLChatHistory(const LLChatHistory::Params& p)
: LLUICtrl(p),
mMessageHeaderFilename(p.message_header),
@@ -839,11 +820,11 @@ void LLChatHistory::clear()
mLastFromID = LLUUID::null;
}
-static LLFastTimer::DeclareTimer FTM_APPEND_MESSAGE("Append Chat Message");
+static LLTrace::BlockTimerStatHandle FTM_APPEND_MESSAGE("Append Chat Message");
void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LLStyle::Params& input_append_params)
{
- LLFastTimer _(FTM_APPEND_MESSAGE);
+ LL_RECORD_BLOCK_TIME(FTM_APPEND_MESSAGE);
bool use_plain_text_chat_history = args["use_plain_text_chat_history"].asBoolean();
bool square_brackets = false; // square brackets necessary for a system messages
diff --git a/indra/newview/llchathistory.h b/indra/newview/llchathistory.h
index bb6d4fb59c..44736a0489 100755
--- a/indra/newview/llchathistory.h
+++ b/indra/newview/llchathistory.h
@@ -93,14 +93,15 @@ class LLChatHistory : public LLUICtrl
* @return pointer to LLView separator object.
*/
LLView* getSeparator();
+
+ void onClickMoreText();
+
+ private:
/**
* Builds a message header.
* @return pointer to LLView header object.
*/
LLView* getHeader(const LLChat& chat,const LLStyle::Params& style_params, const LLSD& args);
-
- void onClickMoreText();
-
public:
~LLChatHistory();
LLSD getValue() const;
diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp
index fd4f17b694..cfc62c07b6 100755
--- a/indra/newview/llchatitemscontainerctrl.cpp
+++ b/indra/newview/llchatitemscontainerctrl.cpp
@@ -29,7 +29,6 @@
#include "llchatitemscontainerctrl.h"
#include "lltextbox.h"
-#include "llchatmsgbox.h"
#include "llavatariconctrl.h"
#include "llcommandhandler.h"
#include "llfloaterreg.h"
@@ -130,7 +129,6 @@ void LLFloaterIMNearbyChatToastPanel::addMessage(LLSD& notification)
{
std::string messageText = notification["message"].asString(); // UTF-8 line of text
- LLChatMsgBox* msg_text = getChild<LLChatMsgBox>("msg_text", false);
std::string color_name = notification["text_color"].asString();
@@ -171,7 +169,7 @@ void LLFloaterIMNearbyChatToastPanel::addMessage(LLSD& notification)
{
style_params.font.style = "ITALIC";
}
- msg_text->appendText(messageText, TRUE, style_params);
+ mMsgText->appendText(messageText, TRUE, style_params);
}
snapToMessageHeight();
@@ -204,9 +202,10 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification)
case 2: messageFont = LLFontGL::getFontSansSerifBig(); break;
}
- LLChatMsgBox* msg_text = getChild<LLChatMsgBox>("msg_text", false);
+ mMsgText = getChild<LLChatMsgBox>("msg_text", false);
+ mMsgText->setContentTrusted(false);
- msg_text->setText(std::string(""));
+ mMsgText->setText(std::string(""));
if ( notification["chat_style"].asInteger() != CHAT_STYLE_IRC )
{
@@ -232,12 +231,12 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification)
style_params_name.link_href = notification["sender_slurl"].asString();
style_params_name.is_link = true;
- msg_text->appendText(str_sender, FALSE, style_params_name);
+ mMsgText->appendText(str_sender, FALSE, style_params_name);
}
else
{
- msg_text->appendText(str_sender, false);
+ mMsgText->appendText(str_sender, false);
}
}
@@ -264,7 +263,7 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification)
{
style_params.font.style = "ITALIC";
}
- msg_text->appendText(messageText, FALSE, style_params);
+ mMsgText->appendText(messageText, FALSE, style_params);
}
@@ -275,8 +274,7 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification)
void LLFloaterIMNearbyChatToastPanel::snapToMessageHeight ()
{
- LLChatMsgBox* text_box = getChild<LLChatMsgBox>("msg_text", false);
- S32 new_height = llmax (text_box->getTextPixelHeight() + 2*text_box->getVPad() + 2*msg_height_pad, 25);
+ S32 new_height = llmax (mMsgText->getTextPixelHeight() + 2*mMsgText->getVPad() + 2*msg_height_pad, 25);
LLRect panel_rect = getRect();
@@ -312,14 +310,13 @@ BOOL LLFloaterIMNearbyChatToastPanel::handleMouseUp (S32 x, S32 y, MASK mask)
return LLPanel::handleMouseUp(x,y,mask);
*/
- LLChatMsgBox* text_box = getChild<LLChatMsgBox>("msg_text", false);
- S32 local_x = x - text_box->getRect().mLeft;
- S32 local_y = y - text_box->getRect().mBottom;
+ S32 local_x = x - mMsgText->getRect().mLeft;
+ S32 local_y = y - mMsgText->getRect().mBottom;
//if text_box process mouse up (ussually this is click on url) - we didn't show nearby_chat.
- if (text_box->pointInView(local_x, local_y) )
+ if (mMsgText->pointInView(local_x, local_y) )
{
- if (text_box->handleMouseUp(local_x,local_y,mask) == TRUE)
+ if (mMsgText->handleMouseUp(local_x,local_y,mask) == TRUE)
return TRUE;
else
{
diff --git a/indra/newview/llchatitemscontainerctrl.h b/indra/newview/llchatitemscontainerctrl.h
index 54b6499d52..f66670ec8c 100755
--- a/indra/newview/llchatitemscontainerctrl.h
+++ b/indra/newview/llchatitemscontainerctrl.h
@@ -28,6 +28,7 @@
#define LL_LLCHATITEMSCONTAINERCTRL_H_
#include "llchat.h"
+#include "llchatmsgbox.h"
#include "llpanel.h"
#include "llscrollbar.h"
#include "llviewerchat.h"
@@ -85,6 +86,7 @@ private:
LLUUID mFromID; // agent id or object id
std::string mFromName;
EChatSourceType mSourceType;
+ LLChatMsgBox* mMsgText;
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index 131aea9da3..c0823182c0 100755
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -192,7 +192,7 @@ void LLNotificationChiclet::createMenu()
{
if(mContextMenu)
{
- llwarns << "Menu already exists" << llendl;
+ LL_WARNS() << "Menu already exists" << LL_ENDL;
return;
}
@@ -204,6 +204,7 @@ void LLNotificationChiclet::createMenu()
enable_registrar.add("NotificationWellChicletMenu.EnableItem",
boost::bind(&LLNotificationChiclet::enableMenuItem, this, _2));
+ llassert(LLMenuGL::sMenuContainer != NULL);
mContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>
("menu_notification_well_button.xml",
LLMenuGL::sMenuContainer,
@@ -379,7 +380,7 @@ bool LLIMChiclet::canCreateMenu()
{
if(mPopupMenu)
{
- llwarns << "Menu already exists" << llendl;
+ LL_WARNS() << "Menu already exists" << LL_ENDL;
return false;
}
if(getSessionId().isNull())
@@ -725,7 +726,7 @@ void LLChicletPanel::setChicletToggleState(const LLUUID& session_id, bool toggle
{
if(session_id.isNull())
{
- llwarns << "Null Session ID" << llendl;
+ LL_WARNS() << "Null Session ID" << LL_ENDL;
}
// toggle off all chiclets, except specified
diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h
index efaf03384a..d5e3a55fdf 100755
--- a/indra/newview/llchiclet.h
+++ b/indra/newview/llchiclet.h
@@ -825,13 +825,13 @@ T* LLChicletPanel::createChiclet(const LLUUID& session_id, S32 index)
T* chiclet = LLUICtrlFactory::create<T>(params);
if(!chiclet)
{
- llwarns << "Could not create chiclet" << llendl;
+ LL_WARNS() << "Could not create chiclet" << LL_ENDL;
return NULL;
}
if(!addChiclet(chiclet, index))
{
delete chiclet;
- llwarns << "Could not add chiclet to chiclet panel" << llendl;
+ LL_WARNS() << "Could not add chiclet to chiclet panel" << LL_ENDL;
return NULL;
}
@@ -871,7 +871,7 @@ T* LLChicletPanel::findChiclet(const LLUUID& im_session_id)
T* result = dynamic_cast<T*>(chiclet);
if(!result)
{
- llwarns << "Found chiclet but of wrong type " << llendl;
+ LL_WARNS() << "Found chiclet but of wrong type " << LL_ENDL;
continue;
}
return result;
@@ -891,7 +891,7 @@ template<class T> T* LLChicletPanel::getChiclet(S32 index)
T*result = dynamic_cast<T*>(chiclet);
if(!result && chiclet)
{
- llwarns << "Found chiclet but of wrong type " << llendl;
+ LL_WARNS() << "Found chiclet but of wrong type " << LL_ENDL;
}
return result;
}
diff --git a/indra/newview/llchicletbar.cpp b/indra/newview/llchicletbar.cpp
index a51c844775..28e367fbe1 100755
--- a/indra/newview/llchicletbar.cpp
+++ b/indra/newview/llchicletbar.cpp
@@ -90,16 +90,16 @@ void LLChicletBar::log(LLView* panel, const std::string& descr)
void LLChicletBar::reshape(S32 width, S32 height, BOOL called_from_parent)
{
static S32 debug_calling_number = 0;
- lldebugs << "**************************************** " << ++debug_calling_number << llendl;
+ LL_DEBUGS() << "**************************************** " << ++debug_calling_number << LL_ENDL;
S32 current_width = getRect().getWidth();
S32 delta_width = width - current_width;
- lldebugs << "Reshaping: "
+ LL_DEBUGS() << "Reshaping: "
<< ", width: " << width
<< ", cur width: " << current_width
<< ", delta_width: " << delta_width
<< ", called_from_parent: " << called_from_parent
- << llendl;
+ << LL_ENDL;
if (mChicletPanel) log(mChicletPanel, "before");
@@ -155,7 +155,7 @@ void LLChicletBar::reshape(S32 width, S32 height, BOOL called_from_parent)
if (should_be_reshaped)
{
- lldebugs << "Reshape all children with width: " << width << llendl;
+ LL_DEBUGS() << "Reshape all children with width: " << width << LL_ENDL;
LLPanel::reshape(width, height, called_from_parent);
}
@@ -174,23 +174,23 @@ S32 LLChicletBar::processWidthDecreased(S32 delta_width)
// we have some space to decrease chiclet panel
S32 shrink_by = llmin(-delta_width, chiclet_panel_shrink_headroom);
- lldebugs << "delta_width: " << delta_width
+ LL_DEBUGS() << "delta_width: " << delta_width
<< ", panel_delta_min: " << chiclet_panel_shrink_headroom
<< ", shrink_by: " << shrink_by
- << llendl;
+ << LL_ENDL;
// is chiclet panel wide enough to process resizing?
delta_width += chiclet_panel_shrink_headroom;
still_should_be_processed = delta_width < 0;
- lldebugs << "Shrinking chiclet panel by " << shrink_by << " px" << llendl;
+ LL_DEBUGS() << "Shrinking chiclet panel by " << shrink_by << " px" << LL_ENDL;
mChicletPanel->getParent()->reshape(mChicletPanel->getParent()->getRect().getWidth() - shrink_by, mChicletPanel->getParent()->getRect().getHeight());
log(mChicletPanel, "after processing panel decreasing via chiclet panel");
- lldebugs << "RS_CHICLET_PANEL"
+ LL_DEBUGS() << "RS_CHICLET_PANEL"
<< ", delta_width: " << delta_width
- << llendl;
+ << LL_ENDL;
}
S32 extra_shrink_width = 0;
@@ -198,8 +198,8 @@ S32 LLChicletBar::processWidthDecreased(S32 delta_width)
if (still_should_be_processed)
{
extra_shrink_width = -delta_width;
- llwarns << "There is no enough width to reshape all children: "
- << extra_shrink_width << llendl;
+ LL_WARNS() << "There is no enough width to reshape all children: "
+ << extra_shrink_width << LL_ENDL;
}
return extra_shrink_width;
diff --git a/indra/newview/llclassifiedstatsresponder.cpp b/indra/newview/llclassifiedstatsresponder.cpp
index e3cd83e174..f1ef8e9a03 100755
--- a/indra/newview/llclassifiedstatsresponder.cpp
+++ b/indra/newview/llclassifiedstatsresponder.cpp
@@ -38,14 +38,18 @@
#include "message.h"
LLClassifiedStatsResponder::LLClassifiedStatsResponder(LLUUID classified_id)
-:
-mClassifiedID(classified_id)
-{
-}
+: mClassifiedID(classified_id)
+{}
/*virtual*/
-void LLClassifiedStatsResponder::result(const LLSD& content)
+void LLClassifiedStatsResponder::httpSuccess()
{
+ const LLSD& content = getContent();
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
S32 teleport = content["teleport_clicks"].asInteger();
S32 map = content["map_clicks"].asInteger();
S32 profile = content["profile_clicks"].asInteger();
@@ -53,16 +57,16 @@ void LLClassifiedStatsResponder::result(const LLSD& content)
S32 search_map = content["search_map_clicks"].asInteger();
S32 search_profile = content["search_profile_clicks"].asInteger();
- LLPanelClassifiedInfo::setClickThrough(
- mClassifiedID,
- teleport + search_teleport,
- map + search_map,
- profile + search_profile,
- true);
+ LLPanelClassifiedInfo::setClickThrough( mClassifiedID,
+ teleport + search_teleport,
+ map + search_map,
+ profile + search_profile,
+ true);
}
/*virtual*/
-void LLClassifiedStatsResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+void LLClassifiedStatsResponder::httpFailure()
{
- llinfos << "LLClassifiedStatsResponder::error [status:" << status << "]: " << content << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
}
+
diff --git a/indra/newview/llclassifiedstatsresponder.h b/indra/newview/llclassifiedstatsresponder.h
index 06dcb62fd0..efa4d82411 100755
--- a/indra/newview/llclassifiedstatsresponder.h
+++ b/indra/newview/llclassifiedstatsresponder.h
@@ -33,13 +33,15 @@
class LLClassifiedStatsResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(LLClassifiedStatsResponder);
public:
LLClassifiedStatsResponder(LLUUID classified_id);
+
+protected:
//If we get back a normal response, handle it here
- virtual void result(const LLSD& content);
+ virtual void httpSuccess();
//If we get back an error (not found, etc...), handle it here
-
- virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content);
+ virtual void httpFailure();
protected:
LLUUID mClassifiedID;
diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp
index e200e0ee9e..8ce5aca909 100755
--- a/indra/newview/llcofwearables.cpp
+++ b/indra/newview/llcofwearables.cpp
@@ -382,14 +382,14 @@ void LLCOFWearables::refresh()
const LLUUID cof_id = LLAppearanceMgr::instance().getCOF();
if (cof_id.isNull())
{
- llwarns << "COF ID cannot be NULL" << llendl;
+ LL_WARNS() << "COF ID cannot be NULL" << LL_ENDL;
return;
}
LLViewerInventoryCategory* catp = gInventory.getCategory(cof_id);
if (!catp)
{
- llwarns << "COF category cannot be NULL" << llendl;
+ LL_WARNS() << "COF category cannot be NULL" << LL_ENDL;
return;
}
@@ -477,7 +477,7 @@ void LLCOFWearables::populateAttachmentsAndBodypartsLists(const LLInventoryModel
{
for (U32 i = 0; i < cof_items.size(); ++i)
{
- LLViewerInventoryItem* item = cof_items.get(i);
+ LLViewerInventoryItem* item = cof_items.at(i);
if (!item) continue;
const LLAssetType::EType item_type = item->getType();
diff --git a/indra/newview/llcolorswatch.cpp b/indra/newview/llcolorswatch.cpp
index f1f7da5fd1..a03178adf6 100755
--- a/indra/newview/llcolorswatch.cpp
+++ b/indra/newview/llcolorswatch.cpp
@@ -37,13 +37,11 @@
#include "llui.h"
#include "llrender.h"
#include "lluiconstants.h"
-#include "llviewercontrol.h"
#include "llbutton.h"
-#include "lltextbox.h"
#include "llfloatercolorpicker.h"
#include "llviewborder.h"
-#include "llviewertexturelist.h"
#include "llfocusmgr.h"
+#include "lltextbox.h"
static LLDefaultChildRegistry::Register<LLColorSwatchCtrl> r("color_swatch");
@@ -239,16 +237,9 @@ void LLColorSwatchCtrl::draw()
}
else
{
- if (!mFallbackImageName.empty())
+ if (mFallbackImage.notNull())
{
- LLPointer<LLViewerFetchedTexture> fallback_image = LLViewerTextureManager::getFetchedTextureFromFile(mFallbackImageName, FTT_LOCAL_FILE, TRUE,
- LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
- if( fallback_image->getComponents() == 4 )
- {
- gl_rect_2d_checkerboard( interior );
- }
- gl_draw_scaled_image( interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), fallback_image, LLColor4::white % alpha);
- fallback_image->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) );
+ mFallbackImage->draw(interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), LLColor4::white % alpha);
}
else
{
diff --git a/indra/newview/llcolorswatch.h b/indra/newview/llcolorswatch.h
index 5bdd1712d2..380fdccfa3 100755
--- a/indra/newview/llcolorswatch.h
+++ b/indra/newview/llcolorswatch.h
@@ -30,16 +30,13 @@
#include "lluictrl.h"
#include "v4color.h"
#include "llfloater.h"
-#include "llviewertexture.h"
#include "lltextbox.h"
//
// Classes
//
class LLColor4;
-class LLTextBox;
class LLFloaterColorPicker;
-class LLViewerTexture;
class LLColorSwatchCtrl
: public LLUICtrl
@@ -59,6 +56,7 @@ public:
Optional<LLUIImage*> alpha_background_image;
Optional<commit_callback_t> cancel_callback;
Optional<commit_callback_t> select_callback;
+ Optional<commit_callback_t> preview_callback;
Optional<LLUIColor> border_color;
Optional<S32> label_width;
Optional<S32> label_height;
@@ -87,7 +85,8 @@ public:
void setCanApplyImmediately(BOOL apply) { mCanApplyImmediately = apply; }
void setOnCancelCallback(commit_callback_t cb) { mOnCancelCallback = cb; }
void setOnSelectCallback(commit_callback_t cb) { mOnSelectCallback = cb; }
- void setFallbackImageName(const std::string& name) { mFallbackImageName = name; }
+ void setPreviewCallback(commit_callback_t cb) { mPreviewCallback = cb; }
+ void setFallbackImage(LLPointer<LLUIImage> image) { mFallbackImage = image; }
void showPicker(BOOL take_focus);
@@ -103,20 +102,21 @@ public:
void closeFloaterColorPicker();
protected:
- BOOL mValid;
- LLColor4 mColor;
- LLUIColor mBorderColor;
- LLTextBox* mCaption;
- LLHandle<LLFloater> mPickerHandle;
- LLViewBorder* mBorder;
- BOOL mCanApplyImmediately;
- commit_callback_t mOnCancelCallback;
- commit_callback_t mOnSelectCallback;
- S32 mLabelWidth;
- S32 mLabelHeight;
+ bool mValid;
+ LLColor4 mColor;
+ LLUIColor mBorderColor;
+ LLTextBox* mCaption;
+ LLHandle<LLFloater> mPickerHandle;
+ class LLViewBorder* mBorder;
+ bool mCanApplyImmediately;
+ commit_callback_t mOnCancelCallback,
+ mOnSelectCallback;
+ commit_callback_t mPreviewCallback;
+ S32 mLabelWidth,
+ mLabelHeight;
LLPointer<LLUIImage> mAlphaGradientImage;
- std::string mFallbackImageName;
+ LLPointer<LLUIImage> mFallbackImage;
};
#endif // LL_LLBUTTON_H
diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp
index a6384ded12..06164e9597 100755
--- a/indra/newview/llcommandlineparser.cpp
+++ b/indra/newview/llcommandlineparser.cpp
@@ -302,13 +302,13 @@ bool LLCommandLineParser::parseAndStoreResults(po::command_line_parser& clp)
}
catch(po::error& e)
{
- llwarns << "Caught Error:" << e.what() << llendl;
+ LL_WARNS() << "Caught Error:" << e.what() << LL_ENDL;
mErrorMsg = e.what();
return false;
}
catch(LLCLPError& e)
{
- llwarns << "Caught Error:" << e.what() << llendl;
+ LL_WARNS() << "Caught Error:" << e.what() << LL_ENDL;
mErrorMsg = e.what();
return false;
}
@@ -348,7 +348,7 @@ bool LLCommandLineParser::parseAndStoreResults(po::command_line_parser& clp)
<< last_option << " "
<< last_value;
- llwarns << msg.str() << llendl;
+ LL_WARNS() << msg.str() << LL_ENDL;
mErrorMsg = msg.str();
return false;
}
@@ -412,7 +412,7 @@ bool LLCommandLineParser::notify()
}
catch (const LLCLPError& e)
{
- llwarns << "Caught Error: " << e.what() << llendl;
+ LL_WARNS() << "Caught Error: " << e.what() << LL_ENDL;
mErrorMsg = e.what();
return false;
}
@@ -430,7 +430,7 @@ void LLCommandLineParser::printOptions() const
{
oss << t_itr->c_str() << " ";
}
- llinfos << oss.str() << llendl;
+ LL_INFOS() << oss.str() << LL_ENDL;
}
}
@@ -470,8 +470,8 @@ onevalue(const std::string& option,
}
else if (value.size() > 1)
{
- llwarns << "Ignoring extra tokens specified for --"
- << option << "." << llendl;
+ LL_WARNS() << "Ignoring extra tokens specified for --"
+ << option << "." << LL_ENDL;
}
return value[0];
}
@@ -609,8 +609,8 @@ void setControlValueCB(const LLCommandLineParser::token_vector_t& value,
// This isn't anything a user can affect -- it's a misconfiguration on
// the part of the coder. Rub the coder's nose in the problem right
// away so even preliminary testing will surface it.
- llerrs << "Command Line option --" << option
- << " maps to unknown setting!" << llendl;
+ LL_ERRS() << "Command Line option --" << option
+ << " maps to unknown setting!" << LL_ENDL;
}
}
} // anonymous namespace
@@ -681,8 +681,8 @@ void LLControlGroupCLP::configure(const std::string& config_filename, LLControlG
std::set<std::string>::const_iterator found = unmapped_options.find(long_name);
if (found == unmapped_options.end())
{
- llerrs << "New command-line option " << long_name
- << " should map-to a variable in settings.xml" << llendl;
+ LL_ERRS() << "New command-line option " << long_name
+ << " should map-to a variable in settings.xml" << LL_ENDL;
}
}
else // option specifies map-to
@@ -690,15 +690,15 @@ void LLControlGroupCLP::configure(const std::string& config_filename, LLControlG
std::string controlName = option_params["map-to"].asString();
if (! controlGroup)
{
- llerrs << "Must pass gSavedSettings to LLControlGroupCLP::configure() for "
- << long_name << " (map-to " << controlName << ")" << llendl;
+ LL_ERRS() << "Must pass gSavedSettings to LLControlGroupCLP::configure() for "
+ << long_name << " (map-to " << controlName << ")" << LL_ENDL;
}
LLControlVariable* ctrl = controlGroup->getControl(controlName);
if (! ctrl)
{
- llerrs << "Option " << long_name << " specifies map-to " << controlName
- << " which does not exist" << llendl;
+ LL_ERRS() << "Option " << long_name << " specifies map-to " << controlName
+ << " which does not exist" << LL_ENDL;
}
callback = boost::bind(setControlValueCB, _1, long_name, ctrl);
diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp
index 4588424474..b0916d769a 100755
--- a/indra/newview/llcompilequeue.cpp
+++ b/indra/newview/llcompilequeue.cpp
@@ -45,7 +45,6 @@
#include "llviewerobject.h"
#include "llviewerobjectlist.h"
#include "llviewerregion.h"
-#include "lscript_rt_interface.h"
#include "llviewercontrol.h"
#include "llviewerobject.h"
#include "llviewerregion.h"
@@ -112,8 +111,8 @@ void LLFloaterScriptQueue::inventoryChanged(LLViewerObject* viewer_object,
S32,
void* q_id)
{
- llinfos << "LLFloaterScriptQueue::inventoryChanged() for object "
- << viewer_object->getID() << llendl;
+ LL_INFOS() << "LLFloaterScriptQueue::inventoryChanged() for object "
+ << viewer_object->getID() << LL_ENDL;
//Remove this listener from the object since its
//listener callback is now being executed.
@@ -138,8 +137,8 @@ void LLFloaterScriptQueue::inventoryChanged(LLViewerObject* viewer_object,
// something went wrong...
// note that we're not working on this one, and move onto the
// next object in the list.
- llwarns << "No inventory for " << mCurrentObjectID
- << llendl;
+ LL_WARNS() << "No inventory for " << mCurrentObjectID
+ << LL_ENDL;
nextObject();
}
}
@@ -154,7 +153,7 @@ void LLFloaterScriptQueue::onCloseBtn(void* user_data)
void LLFloaterScriptQueue::addObject(const LLUUID& id)
{
- mObjectIDs.put(id);
+ mObjectIDs.push_back(id);
}
BOOL LLFloaterScriptQueue::start()
@@ -163,7 +162,7 @@ BOOL LLFloaterScriptQueue::start()
LLStringUtil::format_map_t args;
args["[START]"] = mStartString;
- args["[COUNT]"] = llformat ("%d", mObjectIDs.count());
+ args["[COUNT]"] = llformat ("%d", mObjectIDs.size());
buffer = getString ("Starting", args);
getChild<LLScrollListCtrl>("queue output")->addSimpleElement(buffer, ADD_BOTTOM);
@@ -173,29 +172,29 @@ BOOL LLFloaterScriptQueue::start()
BOOL LLFloaterScriptQueue::isDone() const
{
- return (mCurrentObjectID.isNull() && (mObjectIDs.count() == 0));
+ return (mCurrentObjectID.isNull() && (mObjectIDs.size() == 0));
}
// go to the next object. If no objects left, it falls out silently
// and waits to be killed by the window being closed.
BOOL LLFloaterScriptQueue::nextObject()
{
- S32 count;
+ U32 count;
BOOL successful_start = FALSE;
do
{
- count = mObjectIDs.count();
- llinfos << "LLFloaterScriptQueue::nextObject() - " << count
- << " objects left to process." << llendl;
+ count = mObjectIDs.size();
+ LL_INFOS() << "LLFloaterScriptQueue::nextObject() - " << count
+ << " objects left to process." << LL_ENDL;
mCurrentObjectID.setNull();
if(count > 0)
{
successful_start = popNext();
}
- llinfos << "LLFloaterScriptQueue::nextObject() "
+ LL_INFOS() << "LLFloaterScriptQueue::nextObject() "
<< (successful_start ? "successful" : "unsuccessful")
- << llendl;
- } while((mObjectIDs.count() > 0) && !successful_start);
+ << LL_ENDL;
+ } while((mObjectIDs.size() > 0) && !successful_start);
if(isDone() && !mDone)
{
mDone = true;
@@ -212,18 +211,18 @@ BOOL LLFloaterScriptQueue::popNext()
// get the first element off of the container, and attempt to get
// the inventory.
BOOL rv = FALSE;
- S32 count = mObjectIDs.count();
+ S32 count = mObjectIDs.size();
if(mCurrentObjectID.isNull() && (count > 0))
{
- mCurrentObjectID = mObjectIDs.get(0);
- llinfos << "LLFloaterScriptQueue::popNext() - mCurrentID: "
- << mCurrentObjectID << llendl;
- mObjectIDs.remove(0);
+ mCurrentObjectID = mObjectIDs.at(0);
+ LL_INFOS() << "LLFloaterScriptQueue::popNext() - mCurrentID: "
+ << mCurrentObjectID << LL_ENDL;
+ mObjectIDs.erase(mObjectIDs.begin());
LLViewerObject* obj = gObjectList.findObject(mCurrentObjectID);
if(obj)
{
- llinfos << "LLFloaterScriptQueue::popNext() requesting inv for "
- << mCurrentObjectID << llendl;
+ LL_INFOS() << "LLFloaterScriptQueue::popNext() requesting inv for "
+ << mCurrentObjectID << LL_ENDL;
LLUUID* id = new LLUUID(getKey().asUUID());
registerVOInventoryListener(obj,id);
requestVOInventory();
@@ -306,7 +305,7 @@ void LLFloaterCompileQueue::handleInventory(LLViewerObject *viewer_object,
item->getPermissions().allowCopyBy(gAgent.getID(), gAgent.getGroupID()) )
{
LLPointer<LLViewerInventoryItem> script = new LLViewerInventoryItem(item);
- mCurrentScripts.put(script);
+ mCurrentScripts.push_back(script);
asset_item_map.insert(std::make_pair(item->getAssetUUID(), item));
}
}
@@ -329,7 +328,7 @@ void LLFloaterCompileQueue::handleInventory(LLViewerObject *viewer_object,
viewer_object->getID(),
itemp->getUUID());
- //llinfos << "ITEM NAME 2: " << names.get(i) << llendl;
+ //LL_INFOS() << "ITEM NAME 2: " << names.get(i) << LL_ENDL;
gAssetStorage->getInvItemAsset(viewer_object->getRegion()->getHost(),
gAgent.getID(),
gAgent.getSessionID(),
@@ -350,7 +349,7 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id,
LLAssetType::EType type,
void* user_data, S32 status, LLExtStat ext_status)
{
- llinfos << "LLFloaterCompileQueue::scriptArrived()" << llendl;
+ LL_INFOS() << "LLFloaterCompileQueue::scriptArrived()" << LL_ENDL;
LLScriptQueueData* data = (LLScriptQueueData*)user_data;
if(!data)
{
@@ -361,7 +360,7 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id,
std::string buffer;
if(queue && (0 == status))
{
- //llinfos << "ITEM NAME 3: " << data->mScriptName << llendl;
+ //LL_INFOS() << "ITEM NAME 3: " << data->mScriptName << LL_ENDL;
// Dump this into a file on the local disk so we can compile it.
std::string filename;
@@ -388,44 +387,12 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id,
}
else
{
- // It's now in the file, now compile it.
- buffer = LLTrans::getString("CompileQueueDownloadedCompiling") + (": ") + data->mScriptName;
-
- // Write script to local file for compilation.
- LLFILE *fp = LLFile::fopen(filename, "wb"); /*Flawfinder: ignore*/
- if (fp)
- {
- const S32 buf_size = 65536;
- U8 copy_buf[buf_size];
-
- while (file.read(copy_buf, buf_size)) /*Flawfinder: ignore*/
- {
- if (fwrite(copy_buf, file.getLastBytesRead(), 1, fp) < 1)
- {
- // return a bad file error if we can't write the whole thing
- status = LL_ERR_CANNOT_OPEN_FILE;
- }
- }
-
- fclose(fp);
- }
- else
- {
- llerrs << "Unable to find object to compile" << llendl;
- }
-
- // TODO: babbage: No compile if no cap.
- queue->compile(filename, data->mItemId);
-
- // Delete it after we're done compiling?
- LLFile::remove(filename);
+ buffer = LLTrans::getString("CompileQueueServiceUnavailable") + (": ") + data->mScriptName;
}
}
}
else
{
- LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED );
-
if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status )
{
LLSD args;
@@ -447,7 +414,7 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id,
buffer = LLTrans::getString("CompileQueueUnknownFailure") + (" ") + data->mScriptName;
}
- llwarns << "Problem downloading script asset." << llendl;
+ LL_WARNS() << "Problem downloading script asset." << LL_ENDL;
if(queue) queue->removeItemByItemID(data->mItemId);
}
if(queue && (buffer.size() > 0))
@@ -457,138 +424,6 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id,
delete data;
}
-// static
-void LLFloaterCompileQueue::onSaveTextComplete(const LLUUID& asset_id, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed)
-{
- llinfos << "LLFloaterCompileQueue::onSaveTextComplete()" << llendl;
- if (status)
- {
- llwarns << "Unable to save text for script." << llendl;
- LLSD args;
- args["REASON"] = std::string(LLAssetStorage::getErrorString(status));
- LLNotificationsUtil::add("CompileQueueSaveText", args);
- }
-}
-
-// static
-void LLFloaterCompileQueue::onSaveBytecodeComplete(const LLUUID& asset_id, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed)
-{
- llinfos << "LLFloaterCompileQueue::onSaveBytecodeComplete()" << llendl;
- LLCompileQueueData* data = (LLCompileQueueData*)user_data;
- LLFloaterCompileQueue* queue = LLFloaterReg::findTypedInstance<LLFloaterCompileQueue>("compile_queue", data->mQueueID);
- if(queue && (0 == status) && data)
- {
- queue->saveItemByItemID(data->mItemId);
- queue->removeItemByItemID(data->mItemId);
- }
- else
- {
- llwarns << "Unable to save bytecode for script." << llendl;
- LLSD args;
- args["REASON"] = std::string(LLAssetStorage::getErrorString(status));
- LLNotificationsUtil::add("CompileQueueSaveBytecode", args);
- }
- delete data;
- data = NULL;
-}
-
-// compile the file given and save it out.
-void LLFloaterCompileQueue::compile(const std::string& filename,
- const LLUUID& item_id)
-{
- LLUUID new_asset_id;
- LLTransactionID tid;
- tid.generate();
- new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
-
- std::string uuid_string;
- new_asset_id.toString(uuid_string);
- std::string dst_filename;
- dst_filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string) + ".lso";
- std::string err_filename;
- err_filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,uuid_string) + ".out";
-
- gAssetStorage->storeAssetData(filename, tid,
- LLAssetType::AT_LSL_TEXT,
- &onSaveTextComplete, NULL, FALSE);
-
- const BOOL compile_to_mono = FALSE;
- if(!lscript_compile(filename.c_str(), dst_filename.c_str(),
- err_filename.c_str(), compile_to_mono,
- uuid_string.c_str(), gAgent.isGodlike()))
- {
- llwarns << "compile failed" << llendl;
- removeItemByItemID(item_id);
- }
- else
- {
- llinfos << "compile successful." << llendl;
-
- // Save LSL bytecode
- LLCompileQueueData* data = new LLCompileQueueData(getKey().asUUID(), item_id);
- gAssetStorage->storeAssetData(dst_filename, new_asset_id,
- LLAssetType::AT_LSL_BYTECODE,
- &LLFloaterCompileQueue::onSaveBytecodeComplete,
- (void*)data, FALSE);
- }
-}
-
-void LLFloaterCompileQueue::removeItemByItemID(const LLUUID& asset_id)
-{
- llinfos << "LLFloaterCompileQueue::removeItemByAssetID()" << llendl;
- for(S32 i = 0; i < mCurrentScripts.count(); )
- {
- if(asset_id == mCurrentScripts.get(i)->getUUID())
- {
- mCurrentScripts.remove(i);
- }
- else
- {
- ++i;
- }
- }
- if(mCurrentScripts.count() == 0)
- {
- nextObject();
- }
-}
-
-const LLInventoryItem* LLFloaterCompileQueue::findItemByItemID(const LLUUID& asset_id) const
-{
- LLInventoryItem* result = NULL;
- S32 count = mCurrentScripts.count();
- for(S32 i = 0; i < count; ++i)
- {
- if(asset_id == mCurrentScripts.get(i)->getUUID())
- {
- result = mCurrentScripts.get(i);
- }
- }
- return result;
-}
-
-void LLFloaterCompileQueue::saveItemByItemID(const LLUUID& asset_id)
-{
- llinfos << "LLFloaterCompileQueue::saveItemByAssetID()" << llendl;
- LLViewerObject* viewer_object = gObjectList.findObject(mCurrentObjectID);
- if(viewer_object)
- {
- S32 count = mCurrentScripts.count();
- for(S32 i = 0; i < count; ++i)
- {
- if(asset_id == mCurrentScripts.get(i)->getUUID())
- {
- // *FIX: this auto-resets active to TRUE. That might
- // be a bad idea.
- viewer_object->saveScript(mCurrentScripts.get(i), TRUE, false);
- }
- }
- }
- else
- {
- llwarns << "Unable to finish save!" << llendl;
- }
-}
///----------------------------------------------------------------------------
/// Class LLFloaterResetQueue
@@ -610,8 +445,7 @@ void LLFloaterResetQueue::handleInventory(LLViewerObject* viewer_obj,
{
// find all of the lsl, leaving off duplicates. We'll remove
// all matching asset uuids on compilation success.
- LLDynamicArray<const char*> names;
-
+
LLInventoryObject::object_list_t::const_iterator it = inv->begin();
LLInventoryObject::object_list_t::const_iterator end = inv->end();
for ( ; it != end; ++it)
@@ -662,8 +496,6 @@ void LLFloaterRunQueue::handleInventory(LLViewerObject* viewer_obj,
{
// find all of the lsl, leaving off duplicates. We'll remove
// all matching asset uuids on compilation success.
- LLDynamicArray<const char*> names;
-
LLInventoryObject::object_list_t::const_iterator it = inv->begin();
LLInventoryObject::object_list_t::const_iterator end = inv->end();
for ( ; it != end; ++it)
@@ -712,13 +544,31 @@ LLFloaterNotRunQueue::~LLFloaterNotRunQueue()
{
}
+void LLFloaterCompileQueue::removeItemByItemID(const LLUUID& asset_id)
+{
+ LL_INFOS() << "LLFloaterCompileQueue::removeItemByAssetID()" << LL_ENDL;
+ for(S32 i = 0; i < mCurrentScripts.size(); )
+ {
+ if(asset_id == mCurrentScripts.at(i)->getUUID())
+ {
+ vector_replace_with_last(mCurrentScripts, mCurrentScripts.begin() + i);
+ }
+ else
+ {
+ ++i;
+ }
+ }
+ if(mCurrentScripts.empty())
+ {
+ nextObject();
+ }
+}
+
void LLFloaterNotRunQueue::handleInventory(LLViewerObject* viewer_obj,
LLInventoryObject::object_list_t* inv)
{
// find all of the lsl, leaving off duplicates. We'll remove
// all matching asset uuids on compilation success.
- LLDynamicArray<const char*> names;
-
LLInventoryObject::object_list_t::const_iterator it = inv->begin();
LLInventoryObject::object_list_t::const_iterator end = inv->end();
for ( ; it != end; ++it)
diff --git a/indra/newview/llcompilequeue.h b/indra/newview/llcompilequeue.h
index 4ddab29d00..28f4625de8 100755
--- a/indra/newview/llcompilequeue.h
+++ b/indra/newview/llcompilequeue.h
@@ -27,11 +27,9 @@
#ifndef LL_LLCOMPILEQUEUE_H
#define LL_LLCOMPILEQUEUE_H
-#include "lldarray.h"
#include "llinventory.h"
#include "llviewerobject.h"
#include "llvoinventorylistener.h"
-#include "llmap.h"
#include "lluuid.h"
#include "llfloater.h"
@@ -96,7 +94,7 @@ protected:
LLButton* mCloseBtn;
// Object Queue
- LLDynamicArray<LLUUID> mObjectIDs;
+ std::vector<LLUUID> mObjectIDs;
LLUUID mCurrentObjectID;
bool mDone;
@@ -146,24 +144,6 @@ protected:
LLAssetType::EType type,
void* user_data, S32 status, LLExtStat ext_status);
- static void onSaveTextComplete(const LLUUID& asset_id, void* user_data, S32 status, LLExtStat ext_status);
-
- static void onSaveBytecodeComplete(const LLUUID& asset_id,
- void* user_data,
- S32 status, LLExtStat ext_status);
-
- // compile the file given and save it out.
- void compile(const std::string& filename, const LLUUID& asset_id);
-
- // remove any object in mScriptScripts with the matching uuid.
- void removeItemByAssetID(const LLUUID& asset_id);
-
- // save the items indicated by the item id.
- void saveItemByItemID(const LLUUID& item_id);
-
- // find InventoryItem given item id.
- const LLInventoryItem* findItemByItemID(const LLUUID& item_id) const;
-
protected:
LLViewerInventoryItem::item_array_t mCurrentScripts;
diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp
index 7883e4cb89..05c7e6caa5 100755
--- a/indra/newview/llconversationlog.cpp
+++ b/indra/newview/llconversationlog.cpp
@@ -35,23 +35,18 @@
#include <boost/foreach.hpp>
#include "boost/lexical_cast.hpp"
-const int CONVERSATION_LIFETIME = 30; // lifetime of LLConversation is 30 days by spec
-
-struct ConversationParams
-{
- ConversationParams(time_t time)
- : mTime(time),
- mTimestamp(LLConversation::createTimestamp(time))
- {}
-
- time_t mTime;
- std::string mTimestamp;
- SessionType mConversationType;
- std::string mConversationName;
- std::string mHistoryFileName;
- LLUUID mSessionID;
- LLUUID mParticipantID;
- bool mHasOfflineIMs;
+const S32Days CONVERSATION_LIFETIME = (S32Days)30; // lifetime of LLConversation is 30 days by spec
+
+struct ConversationParams : public LLInitParam::Block<ConversationParams>
+{
+ Mandatory<U64Seconds > time;
+ Mandatory<std::string> timestamp;
+ Mandatory<SessionType> conversation_type;
+ Mandatory<std::string> conversation_name,
+ history_filename;
+ Mandatory<LLUUID> session_id,
+ participant_id;
+ Mandatory<bool> has_offline_ims;
};
/************************************************************************/
@@ -59,14 +54,14 @@ struct ConversationParams
/************************************************************************/
LLConversation::LLConversation(const ConversationParams& params)
-: mTime(params.mTime),
- mTimestamp(params.mTimestamp),
- mConversationType(params.mConversationType),
- mConversationName(params.mConversationName),
- mHistoryFileName(params.mHistoryFileName),
- mSessionID(params.mSessionID),
- mParticipantID(params.mParticipantID),
- mHasOfflineIMs(params.mHasOfflineIMs)
+: mTime(params.time),
+ mTimestamp(params.timestamp.isProvided() ? params.timestamp : createTimestamp(params.time)),
+ mConversationType(params.conversation_type),
+ mConversationName(params.conversation_name),
+ mHistoryFileName(params.history_filename),
+ mSessionID(params.session_id),
+ mParticipantID(params.participant_id),
+ mHasOfflineIMs(params.has_offline_ims)
{
setListenIMFloaterOpened();
}
@@ -77,7 +72,7 @@ LLConversation::LLConversation(const LLIMModel::LLIMSession& session)
mConversationType(session.mSessionType),
mConversationName(session.mName),
mHistoryFileName(session.mHistoryFileName),
- mSessionID(session.isOutgoingAdHoc() ? session.generateOutgouigAdHocHash() : session.mSessionID),
+ mSessionID(session.isOutgoingAdHoc() ? session.generateOutgoingAdHocHash() : session.mSessionID),
mParticipantID(session.mOtherParticipantID),
mHasOfflineIMs(session.mHasOfflineMessage)
{
@@ -105,7 +100,7 @@ LLConversation::~LLConversation()
void LLConversation::updateTimestamp()
{
- mTime = time_corrected();
+ mTime = (U64Seconds)time_corrected();
mTimestamp = createTimestamp(mTime);
}
@@ -118,11 +113,11 @@ void LLConversation::onIMFloaterShown(const LLUUID& session_id)
}
// static
-const std::string LLConversation::createTimestamp(const time_t& utc_time)
+const std::string LLConversation::createTimestamp(const U64Seconds& utc_time)
{
std::string timeStr;
LLSD substitution;
- substitution["datetime"] = (S32) utc_time;
+ substitution["datetime"] = (S32)utc_time.value();
timeStr = "["+LLTrans::getString ("TimeMonth")+"]/["
+LLTrans::getString ("TimeDay")+"]/["
@@ -135,10 +130,10 @@ const std::string LLConversation::createTimestamp(const time_t& utc_time)
return timeStr;
}
-bool LLConversation::isOlderThan(U32 days) const
+bool LLConversation::isOlderThan(U32Days days) const
{
- time_t now = time_corrected();
- U32 age = (U32)((now - mTime) / SEC_PER_DAY); // age of conversation in days
+ U64Seconds now(time_corrected());
+ U32Days age = now - mTime;
return age > days;
}
@@ -318,7 +313,7 @@ LLConversation* LLConversationLog::findConversation(const LLIMModel::LLIMSession
{
if (session)
{
- const LLUUID session_id = session->isOutgoingAdHoc() ? session->generateOutgouigAdHocHash() : session->mSessionID;
+ const LLUUID session_id = session->isOutgoingAdHoc() ? session->generateOutgoingAdHocHash() : session->mSessionID;
conversations_vec_t::iterator conv_it = mConversations.begin();
for(; conv_it != mConversations.end(); ++conv_it)
@@ -460,14 +455,14 @@ bool LLConversationLog::saveToFile(const std::string& filename)
{
if (!filename.size())
{
- llwarns << "Call log list filename is empty!" << llendl;
+ LL_WARNS() << "Call log list filename is empty!" << LL_ENDL;
return false;
}
LLFILE* fp = LLFile::fopen(filename, "wb");
if (!fp)
{
- llwarns << "Couldn't open call log list" << filename << llendl;
+ LL_WARNS() << "Couldn't open call log list" << filename << LL_ENDL;
return false;
}
@@ -485,7 +480,7 @@ bool LLConversationLog::saveToFile(const std::string& filename)
// [1343222639] 2 0 0 Ad-hoc Conference| c3g67c89-c479-4c97-b21d-32869bcfe8rc 68f1c33e-4135-3e3e-a897-8c9b23115c09 Ad-hoc Conference hash597394a0-9982-766d-27b8-c75560213b9a|
fprintf(fp, "[%lld] %d %d %d %s| %s %s %s|\n",
- (S64)conv_it->getTime(),
+ (S64)conv_it->getTime().value(),
(S32)conv_it->getConversationType(),
(S32)0,
(S32)conv_it->hasOfflineMessages(),
@@ -501,14 +496,14 @@ bool LLConversationLog::loadFromFile(const std::string& filename)
{
if(!filename.size())
{
- llwarns << "Call log list filename is empty!" << llendl;
+ LL_WARNS() << "Call log list filename is empty!" << LL_ENDL;
return false;
}
LLFILE* fp = LLFile::fopen(filename, "rb");
if (!fp)
{
- llwarns << "Couldn't open call log list" << filename << llendl;
+ LL_WARNS() << "Couldn't open call log list" << filename << LL_ENDL;
return false;
}
@@ -539,13 +534,14 @@ bool LLConversationLog::loadFromFile(const std::string& filename)
conv_id_buffer,
history_file_name);
- ConversationParams params((time_t)time);
- params.mConversationType = (SessionType)stype;
- params.mHasOfflineIMs = has_offline_ims;
- params.mConversationName = std::string(conv_name_buffer);
- params.mParticipantID = LLUUID(part_id_buffer);
- params.mSessionID = LLUUID(conv_id_buffer);
- params.mHistoryFileName = std::string(history_file_name);
+ ConversationParams params;
+ params.time(LLUnits::Seconds::fromValue(time))
+ .conversation_type((SessionType)stype)
+ .has_offline_ims(has_offline_ims)
+ .conversation_name(conv_name_buffer)
+ .participant_id(LLUUID(part_id_buffer))
+ .session_id(LLUUID(conv_id_buffer))
+ .history_filename(history_file_name);
LLConversation conversation(params);
diff --git a/indra/newview/llconversationlog.h b/indra/newview/llconversationlog.h
index 265b1f0ef0..b38d472156 100755
--- a/indra/newview/llconversationlog.h
+++ b/indra/newview/llconversationlog.h
@@ -55,12 +55,13 @@ public:
const LLUUID& getSessionID() const { return mSessionID; }
const LLUUID& getParticipantID() const { return mParticipantID; }
const std::string& getTimestamp() const { return mTimestamp; }
- const time_t& getTime() const { return mTime; }
+ const U64Seconds&
+ getTime() const { return mTime; }
bool hasOfflineMessages() const { return mHasOfflineIMs; }
void setConversationName(std::string conv_name) { mConversationName = conv_name; }
void setOfflineMessages(bool new_messages) { mHasOfflineIMs = new_messages; }
- bool isOlderThan(U32 days) const;
+ bool isOlderThan(U32Days days) const;
/*
* updates last interaction time
@@ -75,7 +76,7 @@ public:
/*
* returns string representation(in form of: mm/dd/yyyy hh:mm) of time when conversation was started
*/
- static const std::string createTimestamp(const time_t& utc_time);
+ static const std::string createTimestamp(const U64Seconds& utc_time);
private:
@@ -87,7 +88,7 @@ private:
boost::signals2::connection mIMFloaterShowedConnection;
- time_t mTime; // last interaction time
+ U64Seconds mTime; // last interaction time
SessionType mConversationType;
std::string mConversationName;
std::string mHistoryFileName;
diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp
index 44212298cf..ffc235bdbf 100755
--- a/indra/newview/llconversationloglist.cpp
+++ b/indra/newview/llconversationloglist.cpp
@@ -494,7 +494,7 @@ bool LLConversationLogListItemComparator::compare(const LLPanel* item1, const LL
if (!conversation_item1 || !conversation_item2)
{
- llerror("conversation_item1 and conversation_item2 cannot be null", 0);
+ LL_ERRS() << "conversation_item1 and conversation_item2 cannot be null" << LL_ENDL;
return true;
}
@@ -522,8 +522,8 @@ bool LLConversationLogListNameComparator::doCompare(const LLConversationLogListI
bool LLConversationLogListDateComparator::doCompare(const LLConversationLogListItem* conversation1, const LLConversationLogListItem* conversation2) const
{
- time_t date1 = conversation1->getConversation()->getTime();
- time_t date2 = conversation2->getConversation()->getTime();
+ U64Seconds date1 = conversation1->getConversation()->getTime();
+ U64Seconds date2 = conversation2->getConversation()->getTime();
const LLUUID& id1 = conversation1->getConversation()->getParticipantID();
const LLUUID& id2 = conversation2->getConversation()->getParticipantID();
diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp
index affa24f78c..6e32ce60ec 100755
--- a/indra/newview/llconversationmodel.cpp
+++ b/indra/newview/llconversationmodel.cpp
@@ -51,6 +51,7 @@ LLConversationItem::LLConversationItem(std::string display_name, const LLUUID& u
mConvType(CONV_UNKNOWN),
mLastActiveTime(0.0),
mDisplayModeratorOptions(false),
+ mDisplayGroupBanOptions(false),
mAvatarNameCacheConnection()
{
}
@@ -63,6 +64,7 @@ LLConversationItem::LLConversationItem(const LLUUID& uuid, LLFolderViewModelInte
mConvType(CONV_UNKNOWN),
mLastActiveTime(0.0),
mDisplayModeratorOptions(false),
+ mDisplayGroupBanOptions(false),
mAvatarNameCacheConnection()
{
}
@@ -75,6 +77,7 @@ LLConversationItem::LLConversationItem(LLFolderViewModelInterface& root_view_mod
mConvType(CONV_UNKNOWN),
mLastActiveTime(0.0),
mDisplayModeratorOptions(false),
+ mDisplayGroupBanOptions(false),
mAvatarNameCacheConnection()
{
}
@@ -159,6 +162,12 @@ void LLConversationItem::buildParticipantMenuOptions(menuentry_vec_t& items, U32
items.push_back(std::string("ModerateVoiceMute"));
items.push_back(std::string("ModerateVoiceUnmute"));
}
+
+ if ((getType() != CONV_SESSION_1_ON_1) && mDisplayGroupBanOptions)
+ {
+ items.push_back(std::string("Group Ban Separator"));
+ items.push_back(std::string("BanMember"));
+ }
}
}
@@ -361,7 +370,7 @@ void LLConversationItemSession::setDistance(const LLUUID& participant_id, F64 di
void LLConversationItemSession::buildContextMenu(LLMenuGL& menu, U32 flags)
{
- lldebugs << "LLConversationItemParticipant::buildContextMenu()" << llendl;
+ LL_DEBUGS() << "LLConversationItemParticipant::buildContextMenu()" << LL_ENDL;
menuentry_vec_t items;
menuentry_vec_t disabled_items;
if((flags & ITEM_IN_MULTI_SELECTION) && (this->getType() != CONV_SESSION_NEARBY))
@@ -439,7 +448,7 @@ const bool LLConversationItemSession::getTime(F64& time) const
void LLConversationItemSession::dumpDebugData(bool dump_children)
{
// Session info
- llinfos << "Merov debug : session " << this << ", uuid = " << mUUID << ", name = " << mName << ", is loaded = " << mIsLoaded << llendl;
+ LL_INFOS() << "Merov debug : session " << this << ", uuid = " << mUUID << ", name = " << mName << ", is loaded = " << mIsLoaded << LL_ENDL;
// Children info
if (dump_children)
{
@@ -557,7 +566,7 @@ LLConversationItemSession* LLConversationItemParticipant::getParentSession()
void LLConversationItemParticipant::dumpDebugData()
{
- llinfos << "Merov debug : participant, uuid = " << mUUID << ", name = " << mName << ", display name = " << mDisplayName << ", muted = " << isVoiceMuted() << ", moderator = " << mIsModerator << llendl;
+ LL_INFOS() << "Merov debug : participant, uuid = " << mUUID << ", name = " << mName << ", display name = " << mDisplayName << ", muted = " << isVoiceMuted() << ", moderator = " << mIsModerator << LL_ENDL;
}
void LLConversationItemParticipant::setDisplayModeratorRole(bool displayRole)
diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h
index d8cdcdfc97..56e1a26709 100644
--- a/indra/newview/llconversationmodel.h
+++ b/indra/newview/llconversationmodel.h
@@ -143,6 +143,7 @@ protected:
bool mNeedsRefresh; // Flag signaling to the view that something changed for this item
F64 mLastActiveTime;
bool mDisplayModeratorOptions;
+ bool mDisplayGroupBanOptions;
boost::signals2::connection mAvatarNameCacheConnection;
};
@@ -206,6 +207,7 @@ public:
void dumpDebugData();
void setModeratorOptionsVisible(bool visible) { mDisplayModeratorOptions = visible; }
void setDisplayModeratorRole(bool displayRole);
+ void setGroupBanVisible(bool visible) { mDisplayGroupBanOptions = visible; }
private:
void onAvatarNameCache(const LLAvatarName& av_name); // callback used by fetchAvatarName
@@ -291,6 +293,9 @@ class LLConversationViewModel
{
public:
typedef LLFolderViewModel<LLConversationSort, LLConversationItem, LLConversationItem, LLConversationFilter> base_t;
+ LLConversationViewModel()
+ : base_t(new LLConversationSort(), new LLConversationFilter())
+ {}
void sort(LLFolderViewFolder* folder);
bool contentsReady() { return true; } // *TODO : we need to check that participants names are available somewhat
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index 90800fee58..4250aeacd6 100644
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -127,10 +127,11 @@ void LLConversationViewSession::setHighlightState(bool hihglight_state)
void LLConversationViewSession::startFlashing()
{
- LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container");
-
// Need to start flashing only when "Conversations" is opened or brought on top
- if (isInVisibleChain() && !im_box->isMinimized() && mFlashStateOn && !mFlashStarted)
+ if (isInVisibleChain()
+ && mFlashStateOn
+ && !mFlashStarted
+ && ! LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container")->isMinimized() )
{
mFlashStarted = true;
mFlashTimer->startFlashing();
diff --git a/indra/newview/lldaycyclemanager.cpp b/indra/newview/lldaycyclemanager.cpp
index 8af2f4ea33..131675310e 100755
--- a/indra/newview/lldaycyclemanager.cpp
+++ b/indra/newview/lldaycyclemanager.cpp
@@ -193,7 +193,7 @@ bool LLDayCycleManager::loadPreset(const std::string& path)
LLSD data = LLWLDayCycle::loadDayCycleFromPath(path);
if (data.isUndefined())
{
- llwarns << "Error loading day cycle from " << path << llendl;
+ LL_WARNS() << "Error loading day cycle from " << path << LL_ENDL;
return false;
}
diff --git a/indra/newview/lldebugmessagebox.cpp b/indra/newview/lldebugmessagebox.cpp
index 9ad812ab1e..c8b9b1ac63 100755
--- a/indra/newview/lldebugmessagebox.cpp
+++ b/indra/newview/lldebugmessagebox.cpp
@@ -112,7 +112,7 @@ LLDebugVarMessageBox::LLDebugVarMessageBox(const std::string& title, EDebugVarTy
addChild(mSlider3);
break;
default:
- llwarns << "Unhandled var type " << var_type << llendl;
+ LL_WARNS() << "Unhandled var type " << var_type << LL_ENDL;
break;
}
@@ -234,7 +234,7 @@ void LLDebugVarMessageBox::sliderChanged(const LLSD& data)
break;
}
default:
- llwarns << "Unhandled var type " << mVarType << llendl;
+ LL_WARNS() << "Unhandled var type " << mVarType << LL_ENDL;
break;
}
}
@@ -263,7 +263,7 @@ void LLDebugVarMessageBox::draw()
break;
}
default:
- llwarns << "Unhandled var type " << mVarType << llendl;
+ LL_WARNS() << "Unhandled var type " << mVarType << LL_ENDL;
break;
}
mText->setText(text);
diff --git a/indra/newview/lldebugmessagebox.h b/indra/newview/lldebugmessagebox.h
index 211af9e074..87a0910662 100755
--- a/indra/newview/lldebugmessagebox.h
+++ b/indra/newview/lldebugmessagebox.h
@@ -28,7 +28,6 @@
#ifndef LL_LLDEBUGMESSAGEBOX_H
#define LL_LLDEBUGMESSAGEBOX_H
-#include "lldarray.h"
#include "llfloater.h"
#include "v3math.h"
#include "lltextbox.h"
diff --git a/indra/newview/lldebugview.cpp b/indra/newview/lldebugview.cpp
index aeecf054b8..dc1c085c88 100755
--- a/indra/newview/lldebugview.cpp
+++ b/indra/newview/lldebugview.cpp
@@ -33,14 +33,13 @@
#include "llconsole.h"
#include "lltextureview.h"
#include "llresmgr.h"
-#include "imageids.h"
#include "llviewercontrol.h"
#include "llviewerwindow.h"
#include "llappviewer.h"
#include "llsceneview.h"
#include "llviewertexture.h"
#include "llfloaterreg.h"
-
+#include "llscenemonitor.h"
//
// Globals
//
@@ -55,7 +54,6 @@ static LLDefaultChildRegistry::Register<LLDebugView> r("debug_view");
LLDebugView::LLDebugView(const LLDebugView::Params& p)
: LLView(p),
mFastTimerView(NULL),
- mMemoryView(NULL),
mDebugConsolep(NULL),
mFloaterSnapRegion(NULL)
{}
@@ -66,6 +64,7 @@ LLDebugView::~LLDebugView()
gDebugView = NULL;
gTextureView = NULL;
gSceneView = NULL;
+ gSceneMonitorView = NULL;
}
void LLDebugView::init()
@@ -90,7 +89,7 @@ void LLDebugView::init()
r.setLeftTopAndSize(25, rect.getHeight() - 50, (S32) (gViewerWindow->getWindowRectScaled().getWidth() * 0.75f),
(S32) (gViewerWindow->getWindowRectScaled().getHeight() * 0.75f));
- mFastTimerView = dynamic_cast<LLFastTimerView*>(LLFloaterReg::getInstance("fast_timers"));
+ mFastTimerView = dynamic_cast<LLFastTimerView*>(LLFloaterReg::getInstance("block_timers"));
gSceneView = new LLSceneView(r);
gSceneView->setFollowsTop();
@@ -99,6 +98,13 @@ void LLDebugView::init()
addChild(gSceneView);
gSceneView->setRect(rect);
+ gSceneMonitorView = new LLSceneMonitorView(r);
+ gSceneMonitorView->setFollowsTop();
+ gSceneMonitorView->setFollowsLeft();
+ gSceneMonitorView->setVisible(FALSE);
+ addChild(gSceneMonitorView);
+ gSceneMonitorView->setRect(rect);
+
r.setLeftTopAndSize(25, rect.getHeight() - 50, (S32) (gViewerWindow->getWindowRectScaled().getWidth() * 0.75f),
(S32) (gViewerWindow->getWindowRectScaled().getHeight() * 0.75f));
diff --git a/indra/newview/lldebugview.h b/indra/newview/lldebugview.h
index 5aec77ad62..a6490c876c 100755
--- a/indra/newview/lldebugview.h
+++ b/indra/newview/lldebugview.h
@@ -36,7 +36,6 @@
class LLButton;
class LLStatusPanel;
class LLFastTimerView;
-class LLMemoryView;
class LLConsole;
class LLTextureView;
class LLFloaterStats;
@@ -61,7 +60,6 @@ public:
void setStatsVisible(BOOL visible);
LLFastTimerView* mFastTimerView;
- LLMemoryView* mMemoryView;
LLConsole* mDebugConsolep;
LLView* mFloaterSnapRegion;
};
diff --git a/indra/newview/lldeferredsounds.cpp b/indra/newview/lldeferredsounds.cpp
index 9416e7cd29..e1613e4719 100755
--- a/indra/newview/lldeferredsounds.cpp
+++ b/indra/newview/lldeferredsounds.cpp
@@ -39,7 +39,10 @@ void LLDeferredSounds::playdeferredSounds()
{
while(soundVector.size())
{
- gAudiop->triggerSound(soundVector.back());
+ if (gAudiop)
+ {
+ gAudiop->triggerSound(soundVector.back());
+ }
soundVector.pop_back();
}
}
diff --git a/indra/newview/lldirpicker.cpp b/indra/newview/lldirpicker.cpp
index 4c4424edc4..5c4f0f4d5d 100755
--- a/indra/newview/lldirpicker.cpp
+++ b/indra/newview/lldirpicker.cpp
@@ -27,7 +27,6 @@
#include "llviewerprecompiledheaders.h"
#include "lldirpicker.h"
-//#include "llviewermessage.h"
#include "llworld.h"
#include "llviewerwindow.h"
#include "llkeyboard.h"
@@ -36,6 +35,7 @@
#include "lltrans.h"
#include "llwindow.h" // beforeDialog()
#include "llviewercontrol.h"
+#include "llwin32headerslean.h"
#if LL_LINUX || LL_SOLARIS || LL_DARWIN
# include "llfilepicker.h"
diff --git a/indra/newview/lldirpicker.h b/indra/newview/lldirpicker.h
index 9cc62431ef..8656b23afd 100755
--- a/indra/newview/lldirpicker.h
+++ b/indra/newview/lldirpicker.h
@@ -45,11 +45,6 @@
#endif
-// Need commdlg.h for OPENDIRNAMEA
-#ifdef LL_WINDOWS
-#include <commdlg.h>
-#endif
-
class LLFilePicker;
class LLDirPicker
diff --git a/indra/newview/lldonotdisturbnotificationstorage.cpp b/indra/newview/lldonotdisturbnotificationstorage.cpp
index 495cd01349..7836e2cb94 100755
--- a/indra/newview/lldonotdisturbnotificationstorage.cpp
+++ b/indra/newview/lldonotdisturbnotificationstorage.cpp
@@ -97,11 +97,11 @@ void LLDoNotDisturbNotificationStorage::resetDirty()
mDirty = false;
}
-static LLFastTimer::DeclareTimer FTM_SAVE_DND_NOTIFICATIONS("Save DND Notifications");
+static LLTrace::BlockTimerStatHandle FTM_SAVE_DND_NOTIFICATIONS("Save DND Notifications");
void LLDoNotDisturbNotificationStorage::saveNotifications()
{
- LLFastTimer _(FTM_SAVE_DND_NOTIFICATIONS);
+ LL_RECORD_BLOCK_TIME(FTM_SAVE_DND_NOTIFICATIONS);
LLNotificationChannelPtr channelPtr = getCommunicationChannel();
const LLCommunicationChannel *commChannel = dynamic_cast<LLCommunicationChannel*>(channelPtr.get());
@@ -128,11 +128,11 @@ void LLDoNotDisturbNotificationStorage::saveNotifications()
resetDirty();
}
-static LLFastTimer::DeclareTimer FTM_LOAD_DND_NOTIFICATIONS("Load DND Notifications");
+static LLTrace::BlockTimerStatHandle FTM_LOAD_DND_NOTIFICATIONS("Load DND Notifications");
void LLDoNotDisturbNotificationStorage::loadNotifications()
{
- LLFastTimer _(FTM_LOAD_DND_NOTIFICATIONS);
+ LL_RECORD_BLOCK_TIME(FTM_LOAD_DND_NOTIFICATIONS);
LL_INFOS("LLDoNotDisturbNotificationStorage") << "start loading notifications" << LL_ENDL;
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index 9682f38227..c56006d9a3 100755
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -49,13 +49,14 @@
#include "llspatialpartition.h"
#include "llviewerobjectlist.h"
#include "llviewerwindow.h"
+#include "llvocache.h"
const F32 MIN_INTERPOLATE_DISTANCE_SQUARED = 0.001f * 0.001f;
const F32 MAX_INTERPOLATE_DISTANCE_SQUARED = 10.f * 10.f;
const F32 OBJECT_DAMPING_TIME_CONSTANT = 0.06f;
const F32 MIN_SHADOW_CASTER_RADIUS = 2.0f;
-static LLFastTimer::DeclareTimer FTM_CULL_REBOUND("Cull Rebound");
+static LLTrace::BlockTimerStatHandle FTM_CULL_REBOUND("Cull Rebound");
extern bool gShiftFrame;
@@ -75,43 +76,72 @@ extern bool gShiftFrame;
//
// static
-U32 LLDrawable::sCurVisible = 0;
U32 LLDrawable::sNumZombieDrawables = 0;
F32 LLDrawable::sCurPixelAngle = 0;
-LLDynamicArrayPtr<LLPointer<LLDrawable> > LLDrawable::sDeadList;
+std::vector<LLPointer<LLDrawable> > LLDrawable::sDeadList;
#define FORCE_INVISIBLE_AREA 16.f
// static
void LLDrawable::incrementVisible()
{
- sCurVisible++;
+ LLViewerOctreeEntryData::incrementVisible();
sCurPixelAngle = (F32) gViewerWindow->getWindowHeightRaw()/LLViewerCamera::getInstance()->getView();
}
-void LLDrawable::init()
+LLDrawable::LLDrawable(LLViewerObject *vobj, bool new_entry)
+: LLViewerOctreeEntryData(LLViewerOctreeEntry::LLDRAWABLE),
+ LLTrace::MemTrackable<LLDrawable, 16>("LLDrawable"),
+ mVObjp(vobj)
+{
+ init(new_entry);
+}
+
+void LLDrawable::init(bool new_entry)
{
// mXform
mParent = NULL;
mRenderType = 0;
mCurrentScale = LLVector3(1,1,1);
mDistanceWRTCamera = 0.0f;
- mPositionGroup.clear();
- mExtents[0].clear();
- mExtents[1].clear();
-
mState = 0;
- mVObjp = NULL;
+
// mFaces
- mSpatialGroupp = NULL;
- mVisible = sCurVisible - 2;//invisible for the current frame and the last frame.
mRadius = 0.f;
+ mGeneration = -1;
+ mSpatialBridge = NULL;
+
+ LLViewerOctreeEntry* entry = NULL;
+ LLVOCacheEntry* vo_entry = NULL;
+ if(!new_entry && mVObjp && getRegion() != NULL)
+ {
+ vo_entry = getRegion()->getCacheEntryForOctree(mVObjp->getLocalID());
+ if(vo_entry)
+ {
+ entry = vo_entry->getEntry();
+ }
+ }
+ setOctreeEntry(entry);
+ if(vo_entry)
+ {
+ if(!entry)
+ {
+ vo_entry->setOctreeEntry(mEntry);
+ }
+
+ getRegion()->addActiveCacheEntry(vo_entry);
+
+ if(vo_entry->getNumOfChildren() > 0)
+ {
+ getRegion()->addVisibleChildCacheEntry(vo_entry, NULL); //to load all children.
+ }
+
+ llassert(!vo_entry->getGroup()); //not in the object cache octree.
+ }
- mGeneration = -1;
- mBinRadius = 1.f;
- mBinIndex = -1;
+ llassert(!vo_entry || vo_entry->getEntry() == mEntry);
- mSpatialBridge = NULL;
+ initVisible(sCurVisible - 2);//invisible for the current frame and the last frame.
}
// static
@@ -140,7 +170,7 @@ void LLDrawable::destroy()
/* cannot be guaranteed and causes crashes on false alarms
if (LLSpatialGroup::sNoDelete)
{
- llerrs << "Illegal deletion of LLDrawable!" << llendl;
+ LL_ERRS() << "Illegal deletion of LLDrawable!" << LL_ENDL;
}*/
std::for_each(mFaces.begin(), mFaces.end(), DeletePointer());
@@ -149,7 +179,7 @@ void LLDrawable::destroy()
/*if (!(sNumZombieDrawables % 10))
{
- llinfos << "- Zombie drawables: " << sNumZombieDrawables << llendl;
+ LL_INFOS() << "- Zombie drawables: " << sNumZombieDrawables << LL_ENDL;
}*/
}
@@ -158,9 +188,10 @@ void LLDrawable::markDead()
{
if (isDead())
{
- llwarns << "Warning! Marking dead multiple times!" << llendl;
+ LL_WARNS() << "Warning! Marking dead multiple times!" << LL_ENDL;
return;
}
+ setState(DEAD);
if (mSpatialBridge)
{
@@ -171,9 +202,8 @@ void LLDrawable::markDead()
sNumZombieDrawables++;
// We're dead. Free up all of our references to other objects
- setState(DEAD);
cleanupReferences();
-// sDeadList.put(this);
+// sDeadList.push_back(this);
}
LLVOVolume* LLDrawable::getVOVolume() const
@@ -207,16 +237,16 @@ BOOL LLDrawable::isLight() const
}
}
-static LLFastTimer::DeclareTimer FTM_CLEANUP_DRAWABLE("Cleanup Drawable");
-static LLFastTimer::DeclareTimer FTM_DEREF_DRAWABLE("Deref");
-static LLFastTimer::DeclareTimer FTM_DELETE_FACES("Faces");
+static LLTrace::BlockTimerStatHandle FTM_CLEANUP_DRAWABLE("Cleanup Drawable");
+static LLTrace::BlockTimerStatHandle FTM_DEREF_DRAWABLE("Deref");
+static LLTrace::BlockTimerStatHandle FTM_DELETE_FACES("Faces");
void LLDrawable::cleanupReferences()
{
- LLFastTimer t(FTM_CLEANUP_DRAWABLE);
+ LL_RECORD_BLOCK_TIME(FTM_CLEANUP_DRAWABLE);
{
- LLFastTimer t(FTM_DELETE_FACES);
+ LL_RECORD_BLOCK_TIME(FTM_DELETE_FACES);
std::for_each(mFaces.begin(), mFaces.end(), DeletePointer());
mFaces.clear();
}
@@ -225,28 +255,45 @@ void LLDrawable::cleanupReferences()
gPipeline.unlinkDrawable(this);
+ removeFromOctree();
+
{
- LLFastTimer t(FTM_DEREF_DRAWABLE);
+ LL_RECORD_BLOCK_TIME(FTM_DEREF_DRAWABLE);
// Cleanup references to other objects
mVObjp = NULL;
mParent = NULL;
}
}
+void LLDrawable::removeFromOctree()
+{
+ if(!mEntry)
+ {
+ return;
+ }
+
+ mEntry->removeData(this);
+ if(mEntry->hasVOCacheEntry())
+ {
+ getRegion()->removeActiveCacheEntry((LLVOCacheEntry*)mEntry->getVOCacheEntry(), this);
+ }
+ mEntry = NULL;
+}
+
void LLDrawable::cleanupDeadDrawables()
{
/*
S32 i;
- for (i = 0; i < sDeadList.count(); i++)
+ for (i = 0; i < sDeadList.size(); i++)
{
if (sDeadList[i]->getNumRefs() > 1)
{
- llwarns << "Dead drawable has " << sDeadList[i]->getNumRefs() << " remaining refs" << llendl;
+ LL_WARNS() << "Dead drawable has " << sDeadList[i]->getNumRefs() << " remaining refs" << LL_ENDL;
gPipeline.findReferences(sDeadList[i]);
}
}
*/
- sDeadList.reset();
+ sDeadList.clear();
}
S32 LLDrawable::findReferences(LLDrawable *drawablep)
@@ -254,24 +301,24 @@ S32 LLDrawable::findReferences(LLDrawable *drawablep)
S32 count = 0;
if (mParent == drawablep)
{
- llinfos << this << ": parent reference" << llendl;
+ LL_INFOS() << this << ": parent reference" << LL_ENDL;
count++;
}
return count;
}
-static LLFastTimer::DeclareTimer FTM_ALLOCATE_FACE("Allocate Face", true);
+static LLTrace::BlockTimerStatHandle FTM_ALLOCATE_FACE("Allocate Face");
LLFace* LLDrawable::addFace(LLFacePool *poolp, LLViewerTexture *texturep)
{
LLFace *face;
{
- LLFastTimer t(FTM_ALLOCATE_FACE);
+ LL_RECORD_BLOCK_TIME(FTM_ALLOCATE_FACE);
face = new LLFace(this, mVObjp);
}
- if (!face) llerrs << "Allocating new Face: " << mFaces.size() << llendl;
+ if (!face) LL_ERRS() << "Allocating new Face: " << mFaces.size() << LL_ENDL;
if (face)
{
@@ -295,7 +342,7 @@ LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep)
LLFace *face;
{
- LLFastTimer t(FTM_ALLOCATE_FACE);
+ LL_RECORD_BLOCK_TIME(FTM_ALLOCATE_FACE);
face = new LLFace(this, mVObjp);
}
@@ -428,7 +475,7 @@ void LLDrawable::deleteFaces(S32 offset, S32 count)
void LLDrawable::update()
{
- llerrs << "Shouldn't be called!" << llendl;
+ LL_ERRS() << "Shouldn't be called!" << LL_ENDL;
}
@@ -450,7 +497,7 @@ void LLDrawable::makeActive()
pcode == LLViewerObject::LL_VO_GROUND ||
pcode == LLViewerObject::LL_VO_SKY)
{
- llerrs << "Static viewer object has active drawable!" << llendl;
+ LL_ERRS() << "Static viewer object has active drawable!" << LL_ENDL;
}
}
#endif
@@ -488,6 +535,12 @@ void LLDrawable::makeActive()
}
updatePartition();
}
+ else if (!isRoot() && !mParent->isActive()) //this should not happen, but occasionally it does...
+ {
+ mParent->makeActive();
+ //NOTE: linked set will now NEVER become static
+ mParent->setState(LLDrawable::ACTIVE_CHILD);
+ }
llassert(isAvatar() || isRoot() || mParent->isActive());
}
@@ -515,7 +568,7 @@ void LLDrawable::makeStatic(BOOL warning_enabled)
{
if (child_drawable->getParent() != this)
{
- llwarns << "Child drawable has unknown parent." << llendl;
+ LL_WARNS() << "Child drawable has unknown parent." << LL_ENDL;
}
child_drawable->makeStatic(warning_enabled);
}
@@ -569,7 +622,7 @@ F32 LLDrawable::updateXform(BOOL undamped)
if (damped && isVisible())
{
- F32 lerp_amt = llclamp(LLCriticalDamp::getInterpolant(OBJECT_DAMPING_TIME_CONSTANT), 0.f, 1.f);
+ F32 lerp_amt = llclamp(LLSmoothInterpolation::getInterpolant(OBJECT_DAMPING_TIME_CONSTANT), 0.f, 1.f);
LLVector3 new_pos = lerp(old_pos, target_pos, lerp_amt);
dist_squared = dist_vec_squared(new_pos, target_pos);
@@ -690,7 +743,7 @@ BOOL LLDrawable::updateMove()
{
if (isDead())
{
- llwarns << "Update move on dead drawable!" << llendl;
+ LL_WARNS() << "Update move on dead drawable!" << LL_ENDL;
return TRUE;
}
@@ -765,7 +818,7 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update)
{
if (LLViewerCamera::sCurCameraID != LLViewerCamera::CAMERA_WORLD)
{
- llwarns << "Attempted to update distance for non-world camera." << llendl;
+ LL_WARNS() << "Attempted to update distance for non-world camera." << LL_ENDL;
return;
}
@@ -784,7 +837,7 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update)
LLVOVolume* volume = getVOVolume();
if (volume)
{
- if (getSpatialGroup())
+ if (getGroup())
{
pos.set(getPositionGroup().getF32ptr());
}
@@ -830,7 +883,7 @@ void LLDrawable::updateTexture()
{
if (isDead())
{
- llwarns << "Dead drawable updating texture!" << llendl;
+ LL_WARNS() << "Dead drawable updating texture!" << LL_ENDL;
return;
}
@@ -856,7 +909,7 @@ void LLDrawable::shiftPos(const LLVector4a &shift_vector)
{
if (isDead())
{
- llwarns << "Shifting dead drawable" << llendl;
+ LL_WARNS() << "Shifting dead drawable" << LL_ENDL;
return;
}
@@ -902,9 +955,7 @@ void LLDrawable::shiftPos(const LLVector4a &shift_vector)
}
}
- mExtents[0].add(shift_vector);
- mExtents[1].add(shift_vector);
- mPositionGroup.add(shift_vector);
+ shift(shift_vector);
}
else if (mSpatialBridge)
{
@@ -912,9 +963,7 @@ void LLDrawable::shiftPos(const LLVector4a &shift_vector)
}
else if (isAvatar())
{
- mExtents[0].add(shift_vector);
- mExtents[1].add(shift_vector);
- mPositionGroup.add(shift_vector);
+ shift(shift_vector);
}
mVObjp->onShift(shift_vector);
@@ -926,40 +975,24 @@ const LLVector3& LLDrawable::getBounds(LLVector3& min, LLVector3& max) const
return mXform.getPositionW();
}
-const LLVector4a* LLDrawable::getSpatialExtents() const
-{
- return mExtents;
-}
-
-void LLDrawable::setSpatialExtents(const LLVector3& min, const LLVector3& max)
-{
- mExtents[0].load3(min.mV);
- mExtents[1].load3(max.mV);
-}
-
-void LLDrawable::setSpatialExtents(const LLVector4a& min, const LLVector4a& max)
-{
- mExtents[0] = min;
- mExtents[1] = max;
-}
-
-void LLDrawable::setPositionGroup(const LLVector4a& pos)
-{
- mPositionGroup = pos;
-}
-
void LLDrawable::updateSpatialExtents()
{
if (mVObjp)
{
- mVObjp->updateSpatialExtents(mExtents[0], mExtents[1]);
+ const LLVector4a* exts = getSpatialExtents();
+ LLVector4a extents[2];
+ extents[0] = exts[0];
+ extents[1] = exts[1];
+
+ mVObjp->updateSpatialExtents(extents[0], extents[1]);
+ setSpatialExtents(extents[0], extents[1]);
}
updateBinRadius();
if (mSpatialBridge.notNull())
{
- mPositionGroup.splat(0.f);
+ getGroupPosition().splat(0.f);
}
}
@@ -968,11 +1001,11 @@ void LLDrawable::updateBinRadius()
{
if (mVObjp.notNull())
{
- mBinRadius = llmin(mVObjp->getBinRadius(), 256.f);
+ setBinRadius(llmin(mVObjp->getBinRadius(), 256.f));
}
else
{
- mBinRadius = llmin(getRadius()*4.f, 256.f);
+ setBinRadius(llmin(getRadius()*4.f, 256.f));
}
}
@@ -996,7 +1029,7 @@ F32 LLDrawable::getVisibilityRadius() const
{
return llmax(getRadius(), vov->getLightRadius());
} else {
- // llwarns ?
+ // LL_WARNS() ?
}
}
return getRadius();
@@ -1006,26 +1039,52 @@ void LLDrawable::updateUVMinMax()
{
}
-LLSpatialGroup* LLDrawable::getSpatialGroup() const
+//virtual
+bool LLDrawable::isVisible() const
+{
+ if (LLViewerOctreeEntryData::isVisible())
{
- llassert((mSpatialGroupp == NULL) ? getBinIndex() == -1 : getBinIndex() != -1);
- return mSpatialGroupp;
+ return true;
+}
+
+{
+ LLViewerOctreeGroup* group = mEntry->getGroup();
+ if (group && group->isVisible())
+ {
+ LLViewerOctreeEntryData::setVisible();
+ return true;
+ }
+ }
+
+ return false;
}
-void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp)
+//virtual
+bool LLDrawable::isRecentlyVisible() const
{
- //precondition: mSpatialGroupp MUST be null or DEAD or mSpatialGroupp MUST NOT contain this
- llassert(!mSpatialGroupp || mSpatialGroupp->isDead() || !mSpatialGroupp->hasElement(this));
+ //currently visible or visible in the previous frame.
+ bool vis = LLViewerOctreeEntryData::isRecentlyVisible();
- //precondition: groupp MUST be null or groupp MUST contain this
- llassert(!groupp || groupp->hasElement(this));
+ if(!vis)
+ {
+ const U32 MIN_VIS_FRAME_RANGE = 2 ; //two frames:the current one and the last one.
+ vis = (sCurVisible - getVisible() < MIN_VIS_FRAME_RANGE);
+ }
+
+ return vis ;
+}
-/*if (mSpatialGroupp && (groupp != mSpatialGroupp))
+void LLDrawable::setGroup(LLViewerOctreeGroup *groupp)
{
- mSpatialGroupp->setState(LLSpatialGroup::GEOM_DIRTY);
- }*/
+ LLSpatialGroup* cur_groupp = (LLSpatialGroup*)getGroup();
+
+ //precondition: mGroupp MUST be null or DEAD or mGroupp MUST NOT contain this
+ //llassert(!cur_groupp || cur_groupp->isDead() || !cur_groupp->hasElement(this));
- if (mSpatialGroupp != groupp && getVOVolume())
+ //precondition: groupp MUST be null or groupp MUST contain this
+ llassert(!groupp || (LLSpatialGroup*)groupp->hasElement(this));
+
+ if (cur_groupp != groupp && getVOVolume())
{ //NULL out vertex buffer references for volumes on spatial group change to maintain
//requirement that every face vertex buffer is either NULL or points to a vertex buffer
//contained by its drawable's spatial group
@@ -1041,10 +1100,10 @@ void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp)
//postcondition: if next group is NULL, previous group must be dead OR NULL OR binIndex must be -1
//postcondition: if next group is NOT NULL, binIndex must not be -1
- llassert(groupp == NULL ? (mSpatialGroupp == NULL || mSpatialGroupp->isDead()) || getBinIndex() == -1 :
- getBinIndex() != -1);
+ //llassert(groupp == NULL ? (cur_groupp == NULL || cur_groupp->isDead()) || (!getEntry() || getEntry()->getBinIndex() == -1) :
+ // (getEntry() && getEntry()->getBinIndex() != -1));
- mSpatialGroupp = groupp;
+ LLViewerOctreeEntryData::setGroup(groupp);
}
LLSpatialPartition* LLDrawable::getSpatialPartition()
@@ -1063,11 +1122,11 @@ LLSpatialPartition* LLDrawable::getSpatialPartition()
{
if (mVObjp->isHUDAttachment())
{
- setSpatialBridge(new LLHUDBridge(this));
+ setSpatialBridge(new LLHUDBridge(this, getRegion()));
}
else
{
- setSpatialBridge(new LLVolumeBridge(this));
+ setSpatialBridge(new LLVolumeBridge(this, getRegion()));
}
}
return mSpatialBridge->asPartition();
@@ -1086,89 +1145,18 @@ LLSpatialPartition* LLDrawable::getSpatialPartition()
return retval;
}
-const S32 MIN_VIS_FRAME_RANGE = 2 ; //two frames:the current one and the last one.
-//static
-S32 LLDrawable::getMinVisFrameRange()
-{
- return MIN_VIS_FRAME_RANGE ;
-}
-
-BOOL LLDrawable::isRecentlyVisible() const
-{
- //currently visible or visible in the previous frame.
- BOOL vis = isVisible() || (sCurVisible - mVisible < MIN_VIS_FRAME_RANGE) ;
-
- if(!vis)
- {
- LLSpatialGroup* group = getSpatialGroup();
- if (group && group->isRecentlyVisible())
- {
- mVisible = sCurVisible;
- vis = TRUE ;
- }
- }
-
- return vis ;
-}
-
-BOOL LLDrawable::isVisible() const
-{
- if (mVisible == sCurVisible)
- {
- return TRUE;
- }
-
-#if 0
- //disabling this code fixes DEV-20105. Leaving in place in case some other bug pops up as a a result.
- //should be safe to just always ask the spatial group for visibility.
- if (isActive())
- {
- if (isRoot())
- {
- LLSpatialGroup* group = mSpatialBridge.notNull() ? mSpatialBridge->getSpatialGroup() :
- getSpatialGroup();
- if (group && group->isVisible())
- {
- mVisible = sCurVisible;
- return TRUE;
- }
- }
- else
- {
- if (getParent()->isVisible())
- {
- mVisible = sCurVisible;
- return TRUE;
- }
- }
- }
- else
-#endif
- {
- LLSpatialGroup* group = getSpatialGroup();
- if (group && group->isVisible())
- {
- mVisible = sCurVisible;
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
//=======================================
// Spatial Partition Bridging Drawable
//=======================================
-LLSpatialBridge::LLSpatialBridge(LLDrawable* root, BOOL render_by_group, U32 data_mask)
-: LLSpatialPartition(data_mask, render_by_group, GL_STREAM_DRAW_ARB)
+LLSpatialBridge::LLSpatialBridge(LLDrawable* root, BOOL render_by_group, U32 data_mask, LLViewerRegion* regionp) :
+ LLDrawable(root->getVObj(), true),
+ LLSpatialPartition(data_mask, render_by_group, GL_STREAM_DRAW_ARB, regionp)
{
mBridge = this;
mDrawable = root;
root->setSpatialBridge(this);
- mBinIndex = -1;
-
mRenderType = mDrawable->mRenderType;
mDrawableType = mDrawable->mRenderType;
@@ -1189,10 +1177,13 @@ LLSpatialBridge::LLSpatialBridge(LLDrawable* root, BOOL render_by_group, U32 dat
LLSpatialBridge::~LLSpatialBridge()
{
+ if(mEntry)
+ {
LLSpatialGroup* group = getSpatialGroup();
if (group)
{
- group->mSpatialPartition->remove(this, group);
+ group->getSpatialPartition()->remove(this, group);
+ }
}
//delete octree here so listeners will still be able to access bridge specific state
@@ -1210,12 +1201,13 @@ void LLSpatialBridge::updateSpatialExtents()
LLSpatialGroup* root = (LLSpatialGroup*) mOctree->getListener(0);
{
- LLFastTimer ftm(FTM_CULL_REBOUND);
+ LL_RECORD_BLOCK_TIME(FTM_CULL_REBOUND);
root->rebound();
}
+ const LLVector4a* root_bounds = root->getBounds();
LLVector4a offset;
- LLVector4a size = root->mBounds[1];
+ LLVector4a size = root_bounds[1];
//VECTORIZE THIS
LLMatrix4a mat;
@@ -1227,7 +1219,7 @@ void LLSpatialBridge::updateSpatialExtents()
LLVector4a center;
mat.affineTransform(t, center);
- mat.rotate(root->mBounds[0], offset);
+ mat.rotate(root_bounds[0], offset);
center.add(offset);
LLVector4a v[4];
@@ -1249,12 +1241,9 @@ void LLSpatialBridge::updateSpatialExtents()
scale.mul(size);
mat.rotate(scale, v[3]);
-
- LLVector4a& newMin = mExtents[0];
- LLVector4a& newMax = mExtents[1];
-
+ LLVector4a newMin;
+ LLVector4a newMax;
newMin = newMax = center;
-
for (U32 i = 0; i < 4; i++)
{
LLVector4a delta;
@@ -1267,19 +1256,21 @@ void LLSpatialBridge::updateSpatialExtents()
newMin.setMin(newMin, min);
newMax.setMax(newMax, max);
}
+ setSpatialExtents(newMin, newMax);
LLVector4a diagonal;
diagonal.setSub(newMax, newMin);
mRadius = diagonal.getLength3().getF32() * 0.5f;
- mPositionGroup.setAdd(newMin,newMax);
- mPositionGroup.mul(0.5f);
+ LLVector4a& pos = getGroupPosition();
+ pos.setAdd(newMin,newMax);
+ pos.mul(0.5f);
updateBinRadius();
}
void LLSpatialBridge::updateBinRadius()
{
- mBinRadius = llmin( mOctree->getSize()[0]*0.5f, 256.f);
+ setBinRadius(llmin( mOctree->getSize()[0]*0.5f, 256.f));
}
LLCamera LLSpatialBridge::transformCamera(LLCamera& camera)
@@ -1313,7 +1304,7 @@ LLCamera LLSpatialBridge::transformCamera(LLCamera& camera)
void LLDrawable::setVisible(LLCamera& camera, std::vector<LLDrawable*>* results, BOOL for_select)
{
- mVisible = sCurVisible;
+ LLViewerOctreeEntryData::setVisible();
#if 0 && !LL_RELEASE_FOR_DOWNLOAD
//crazy paranoid rules checking
@@ -1323,46 +1314,46 @@ void LLDrawable::setVisible(LLCamera& camera, std::vector<LLDrawable*>* results,
{
if (isActive() && !mParent->isActive())
{
- llerrs << "Active drawable has static parent!" << llendl;
+ LL_ERRS() << "Active drawable has static parent!" << LL_ENDL;
}
if (isStatic() && !mParent->isStatic())
{
- llerrs << "Static drawable has active parent!" << llendl;
+ LL_ERRS() << "Static drawable has active parent!" << LL_ENDL;
}
if (mSpatialBridge)
{
- llerrs << "Child drawable has spatial bridge!" << llendl;
+ LL_ERRS() << "Child drawable has spatial bridge!" << LL_ENDL;
}
}
else if (isActive() && !mSpatialBridge)
{
- llerrs << "Active root drawable has no spatial bridge!" << llendl;
+ LL_ERRS() << "Active root drawable has no spatial bridge!" << LL_ENDL;
}
else if (isStatic() && mSpatialBridge.notNull())
{
- llerrs << "Static drawable has spatial bridge!" << llendl;
+ LL_ERRS() << "Static drawable has spatial bridge!" << LL_ENDL;
}
}
#endif
}
-class LLOctreeMarkNotCulled: public LLOctreeTraveler<LLDrawable>
+class LLOctreeMarkNotCulled: public OctreeTraveler
{
public:
LLCamera* mCamera;
LLOctreeMarkNotCulled(LLCamera* camera_in) : mCamera(camera_in) { }
- virtual void traverse(const LLOctreeNode<LLDrawable>* node)
+ virtual void traverse(const OctreeNode* node)
{
LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0);
group->setVisible();
- LLOctreeTraveler<LLDrawable>::traverse(node);
+ OctreeTraveler::traverse(node);
}
- void visit(const LLOctreeNode<LLDrawable>* branch)
+ void visit(const OctreeNode* branch)
{
gPipeline.markNotCulled((LLSpatialGroup*) branch->getListener(0), *mCamera);
}
@@ -1406,7 +1397,7 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>*
}
if (!group ||
- LLDrawable::getCurrentFrame() - av->mVisible > 1 ||
+ LLDrawable::getCurrentFrame() - av->getVisible() > 1 ||
impostor ||
!loaded)
{
@@ -1420,16 +1411,17 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>*
group->rebound();
LLVector4a center;
- center.setAdd(mExtents[0], mExtents[1]);
+ const LLVector4a* exts = getSpatialExtents();
+ center.setAdd(exts[0], exts[1]);
center.mul(0.5f);
LLVector4a size;
- size.setSub(mExtents[1], mExtents[0]);
+ size.setSub(exts[1], exts[0]);
size.mul(0.5f);
if ((LLPipeline::sShadowRender && camera_in.AABBInFrustum(center, size)) ||
LLPipeline::sImpostorRender ||
(camera_in.AABBInFrustumNoFarClip(center, size) &&
- AABBSphereIntersect(mExtents[0], mExtents[1], camera_in.getOrigin(), camera_in.mFrustumCornerDist)))
+ AABBSphereIntersect(exts[0], exts[1], camera_in.getOrigin(), camera_in.mFrustumCornerDist)))
{
if (!LLPipeline::sImpostorRender &&
!LLPipeline::sShadowRender &&
@@ -1517,7 +1509,7 @@ void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update)
void LLSpatialBridge::makeActive()
{ //it is an error to make a spatial bridge active (it's already active)
- llerrs << "makeActive called on spatial bridge" << llendl;
+ LL_ERRS() << "makeActive called on spatial bridge" << LL_ENDL;
}
void LLSpatialBridge::move(LLDrawable *drawablep, LLSpatialGroup *curp, BOOL immediate)
@@ -1544,9 +1536,7 @@ BOOL LLSpatialBridge::updateMove()
void LLSpatialBridge::shiftPos(const LLVector4a& vec)
{
- mExtents[0].add(vec);
- mExtents[1].add(vec);
- mPositionGroup.add(vec);
+ LLDrawable::shift(vec);
}
void LLSpatialBridge::cleanupReferences()
@@ -1554,11 +1544,8 @@ void LLSpatialBridge::cleanupReferences()
LLDrawable::cleanupReferences();
if (mDrawable)
{
- /*
-
- DON'T DO THIS -- this should happen through octree destruction
+ mDrawable->setGroup(NULL);
- mDrawable->setSpatialGroup(NULL);
if (mDrawable->getVObj())
{
LLViewerObject::const_child_list_t& child_list = mDrawable->getVObj()->getChildren();
@@ -1569,10 +1556,10 @@ void LLSpatialBridge::cleanupReferences()
LLDrawable* drawable = child->mDrawable;
if (drawable)
{
- drawable->setSpatialGroup(NULL);
+ drawable->setGroup(NULL);
+ }
}
}
- }*/
LLDrawable* drawablep = mDrawable;
mDrawable = NULL;
@@ -1641,8 +1628,8 @@ void LLDrawable::updateFaceSize(S32 idx)
}
}
-LLBridgePartition::LLBridgePartition()
-: LLSpatialPartition(0, FALSE, 0)
+LLBridgePartition::LLBridgePartition(LLViewerRegion* regionp)
+: LLSpatialPartition(0, FALSE, 0, regionp)
{
mDrawableType = LLPipeline::RENDER_TYPE_AVATAR;
mPartitionType = LLViewerRegion::PARTITION_BRIDGE;
@@ -1650,8 +1637,8 @@ LLBridgePartition::LLBridgePartition()
mSlopRatio = 0.25f;
}
-LLHUDBridge::LLHUDBridge(LLDrawable* drawablep)
-: LLVolumeBridge(drawablep)
+LLHUDBridge::LLHUDBridge(LLDrawable* drawablep, LLViewerRegion* regionp)
+: LLVolumeBridge(drawablep, regionp)
{
mDrawableType = LLPipeline::RENDER_TYPE_HUD;
mPartitionType = LLViewerRegion::PARTITION_HUD;
diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h
index c3f6d77edc..a3461d4c01 100755
--- a/indra/newview/lldrawable.h
+++ b/indra/newview/lldrawable.h
@@ -38,10 +38,10 @@
#include "llvector4a.h"
#include "llquaternion.h"
#include "xform.h"
-#include "lldarray.h"
#include "llviewerobject.h"
#include "llrect.h"
#include "llappviewer.h" // for gFrameTimeSeconds
+#include "llvieweroctree.h"
class LLCamera;
class LLDrawPool;
@@ -59,33 +59,27 @@ const U32 SILHOUETTE_HIGHLIGHT = 0;
// All data for new renderer goes into this class.
LL_ALIGN_PREFIX(16)
-class LLDrawable : public LLRefCount
+class LLDrawable
+: public LLViewerOctreeEntryData,
+ public LLTrace::MemTrackable<LLDrawable, 16>
{
public:
- LLDrawable(const LLDrawable& rhs)
+ LLDrawable(const LLDrawable& rhs)
+ : LLTrace::MemTrackable<LLDrawable, 16>("LLDrawable"),
+ LLViewerOctreeEntryData(rhs)
{
*this = rhs;
}
const LLDrawable& operator=(const LLDrawable& rhs)
{
- llerrs << "Illegal operation!" << llendl;
+ LL_ERRS() << "Illegal operation!" << LL_ENDL;
return *this;
}
static void initClass();
- void* operator new(size_t size)
- {
- return ll_aligned_malloc_16(size);
- }
-
- void operator delete(void* ptr)
- {
- ll_aligned_free_16(ptr);
- }
-
- LLDrawable() { init(); }
+ LLDrawable(LLViewerObject *vobj, bool new_entry = false);
void markDead(); // Mark this drawable as dead
BOOL isDead() const { return isState(DEAD); }
@@ -93,11 +87,9 @@ public:
BOOL isLight() const;
- BOOL isVisible() const;
- BOOL isRecentlyVisible() const;
virtual void setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* results = NULL, BOOL for_select = FALSE);
-
+ LLSpatialGroup* getSpatialGroup()const {return (LLSpatialGroup*)getGroup();}
LLViewerRegion* getRegion() const { return mVObjp->getRegion(); }
const LLTextureEntry* getTextureEntry(U8 which) const { return mVObjp->getTE(which); }
LLPointer<LLViewerObject>& getVObj() { return mVObjp; }
@@ -110,16 +102,12 @@ public:
const LLVector3& getPosition() const { return mXform.getPosition(); }
const LLVector3& getWorldPosition() const { return mXform.getPositionW(); }
const LLVector3 getPositionAgent() const;
- const LLVector4a& getPositionGroup() const { return mPositionGroup; }
const LLVector3& getScale() const { return mCurrentScale; }
void setScale(const LLVector3& scale) { mCurrentScale = scale; }
const LLQuaternion& getWorldRotation() const { return mXform.getWorldRotation(); }
const LLQuaternion& getRotation() const { return mXform.getRotation(); }
F32 getIntensity() const { return llmin(mXform.getScale().mV[0], 4.f); }
S32 getLOD() const { return mVObjp ? mVObjp->getLOD() : 1; }
- F32 getBinRadius() const { return mBinRadius; }
- S32 getBinIndex() const { return mBinIndex; }
- void setBinIndex(S32 index) const { mBinIndex = index; }
void getMinMax(LLVector3& min,LLVector3& max) const { mXform.getMinMax(min,max); }
LLXformMatrix* getXform() { return &mXform; }
@@ -152,7 +140,7 @@ public:
void setNumFacesFast(const S32 numFaces, LLFacePool *poolp, LLViewerTexture *texturep);
void mergeFaces(LLDrawable* src);
- void init();
+ void init(bool new_entry);
void destroy();
void update();
@@ -183,8 +171,12 @@ public:
BOOL getLit() const { return isState(UNLIT) ? FALSE : TRUE; }
void setLit(BOOL lit) { lit ? clearState(UNLIT) : setState(UNLIT); }
+ bool isVisible() const;
+ bool isRecentlyVisible() const;
+
virtual void cleanupReferences();
+ void setGroup(LLViewerOctreeGroup* group);
void setRadius(const F32 radius);
F32 getRadius() const { return mRadius; }
F32 getVisibilityRadius() const;
@@ -194,11 +186,6 @@ public:
const LLVector3& getBounds(LLVector3& min, LLVector3& max) const;
virtual void updateSpatialExtents();
virtual void updateBinRadius();
- const LLVector4a* getSpatialExtents() const;
- void setSpatialExtents(const LLVector3& min, const LLVector3& max);
- void setSpatialExtents(const LLVector4a& min, const LLVector4a& max);
-
- void setPositionGroup(const LLVector4a& pos);
void setRenderType(S32 type) { mRenderType = type; }
BOOL isRenderType(S32 type) { return mRenderType == type; }
@@ -207,10 +194,13 @@ public:
// Debugging methods
S32 findReferences(LLDrawable *drawablep); // Not const because of @#$! iterators...
- void setSpatialGroup(LLSpatialGroup *groupp);
- LLSpatialGroup *getSpatialGroup() const;
LLSpatialPartition* getSpatialPartition();
+ void removeFromOctree();
+
+ void setSpatialBridge(LLSpatialBridge* bridge) { mSpatialBridge = (LLDrawable*) bridge; }
+ LLSpatialBridge* getSpatialBridge() { return (LLSpatialBridge*) (LLDrawable*) mSpatialBridge; }
+
// Statics
static void incrementVisible();
static void cleanupDeadDrawables();
@@ -294,10 +284,6 @@ public:
ACTIVE_CHILD = 0x40000000,
} EDrawableFlags;
-private: //aligned members
- LL_ALIGN_16(LLVector4a mExtents[2]);
- LL_ALIGN_16(LLVector4a mPositionGroup);
-
public:
LLXformMatrix mXform;
@@ -306,12 +292,6 @@ public:
F32 mDistanceWRTCamera;
- static S32 getCurrentFrame() { return sCurVisible; }
- static S32 getMinVisFrameRange();
-
- void setSpatialBridge(LLSpatialBridge* bridge) { mSpatialBridge = (LLDrawable*) bridge; }
- LLSpatialBridge* getSpatialBridge() { return (LLSpatialBridge*) (LLDrawable*) mSpatialBridge; }
-
static F32 sCurPixelAngle; //current pixels per radian
private:
@@ -321,39 +301,33 @@ private:
S32 mRenderType;
LLPointer<LLViewerObject> mVObjp;
face_list_t mFaces;
- LLSpatialGroup* mSpatialGroupp;
LLPointer<LLDrawable> mSpatialBridge;
- mutable U32 mVisible;
F32 mRadius;
- F32 mBinRadius;
- mutable S32 mBinIndex;
S32 mGeneration;
LLVector3 mCurrentScale;
- static U32 sCurVisible; // Counter for what value of mVisible means currently visible
-
static U32 sNumZombieDrawables;
- static LLDynamicArrayPtr<LLPointer<LLDrawable> > sDeadList;
+ static std::vector<LLPointer<LLDrawable> > sDeadList;
} LL_ALIGN_POSTFIX(16);
inline LLFace* LLDrawable::getFace(const S32 i) const
{
- //switch these asserts to llerrs -- davep
+ //switch these asserts to LL_ERRS() -- davep
//llassert((U32)i < mFaces.size());
//llassert(mFaces[i]);
if ((U32) i >= mFaces.size())
{
- llwarns << "Invalid face index." << llendl;
+ LL_WARNS() << "Invalid face index." << LL_ENDL;
return NULL;
}
if (!mFaces[i])
{
- llwarns << "Null face found." << llendl;
+ LL_WARNS() << "Null face found." << LL_ENDL;
return NULL;
}
diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp
index 714f9a1718..5b151bdcda 100755
--- a/indra/newview/lldrawpool.cpp
+++ b/indra/newview/lldrawpool.cpp
@@ -113,7 +113,7 @@ LLDrawPool *LLDrawPool::createPool(const U32 type, LLViewerTexture *tex0)
poolp = new LLDrawPoolWLSky();
break;
default:
- llerrs << "Unknown draw pool type!" << llendl;
+ LL_ERRS() << "Unknown draw pool type!" << LL_ENDL;
return NULL;
}
@@ -257,7 +257,7 @@ void LLFacePool::destroy()
{
if (!mReferences.empty())
{
- llinfos << mReferences.size() << " references left on deletion of draw pool!" << llendl;
+ LL_INFOS() << mReferences.size() << " references left on deletion of draw pool!" << LL_ENDL;
}
}
@@ -332,7 +332,7 @@ BOOL LLFacePool::verify() const
const LLFace* facep = *iter;
if (facep->getPool() != this)
{
- llinfos << "Face in wrong pool!" << llendl;
+ LL_INFOS() << "Face in wrong pool!" << LL_ENDL;
facep->printDebugInfo();
ok = FALSE;
}
@@ -347,7 +347,7 @@ BOOL LLFacePool::verify() const
void LLFacePool::printDebugInfo() const
{
- llinfos << "Pool " << this << " Type: " << getType() << llendl;
+ LL_INFOS() << "Pool " << this << " Type: " << getType() << LL_ENDL;
}
BOOL LLFacePool::LLOverrideFaceColor::sOverrideFaceColor = FALSE;
@@ -385,9 +385,9 @@ LLRenderPass::~LLRenderPass()
LLDrawPool* LLRenderPass::instancePool()
{
#if LL_RELEASE_FOR_DOWNLOAD
- llwarns << "Attempting to instance a render pass. Invalid operation." << llendl;
+ LL_WARNS() << "Attempting to instance a render pass. Invalid operation." << LL_ENDL;
#else
- llerrs << "Attempting to instance a render pass. Invalid operation." << llendl;
+ LL_ERRS() << "Attempting to instance a render pass. Invalid operation." << LL_ENDL;
#endif
return NULL;
}
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index e27dc279f4..84ead0bdde 100755
--- a/indra/newview/lldrawpoolalpha.cpp
+++ b/indra/newview/lldrawpoolalpha.cpp
@@ -89,7 +89,7 @@ S32 LLDrawPoolAlpha::getNumPostDeferredPasses()
void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_ALPHA);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA);
if (pass == 0)
{
@@ -179,7 +179,7 @@ void LLDrawPoolAlpha::renderPostDeferred(S32 pass)
void LLDrawPoolAlpha::beginRenderPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_ALPHA);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA);
if (LLPipeline::sImpostorRender)
{
@@ -211,7 +211,7 @@ void LLDrawPoolAlpha::beginRenderPass(S32 pass)
void LLDrawPoolAlpha::endRenderPass( S32 pass )
{
- LLFastTimer t(FTM_RENDER_ALPHA);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA);
LLRenderPass::endRenderPass(pass);
if(gPipeline.canUseWindLightShaders())
@@ -222,7 +222,7 @@ void LLDrawPoolAlpha::endRenderPass( S32 pass )
void LLDrawPoolAlpha::render(S32 pass)
{
- LLFastTimer t(FTM_RENDER_ALPHA);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA);
LLGLSPipelineAlpha gls_pipeline_alpha;
@@ -336,7 +336,7 @@ void LLDrawPoolAlpha::renderAlphaHighlight(U32 mask)
for (LLCullResult::sg_iterator i = gPipeline.beginAlphaGroups(); i != gPipeline.endAlphaGroups(); ++i)
{
LLSpatialGroup* group = *i;
- if (group->mSpatialPartition->mRenderByGroup &&
+ if (group->getSpatialPartition()->mRenderByGroup &&
!group->isDead())
{
LLSpatialGroup::drawmap_elem_t& draw_info = group->mDrawMap[LLRenderPass::PASS_ALPHA];
@@ -363,6 +363,9 @@ void LLDrawPoolAlpha::renderAlphaHighlight(U32 mask)
}
}
+static LLTrace::BlockTimerStatHandle FTM_RENDER_ALPHA_GROUP_LOOP("Alpha Group");
+static LLTrace::BlockTimerStatHandle FTM_RENDER_ALPHA_PUSH("Alpha Push Verts");
+
void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass)
{
BOOL initialized_lighting = FALSE;
@@ -374,18 +377,18 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass)
{
LLSpatialGroup* group = *i;
llassert(group);
- llassert(group->mSpatialPartition);
+ llassert(group->getSpatialPartition());
- if (group->mSpatialPartition->mRenderByGroup &&
+ if (group->getSpatialPartition()->mRenderByGroup &&
!group->isDead())
{
- bool is_particle_or_hud_particle = group->mSpatialPartition->mPartitionType == LLViewerRegion::PARTITION_PARTICLE
- || group->mSpatialPartition->mPartitionType == LLViewerRegion::PARTITION_HUD_PARTICLE;
+ bool is_particle_or_hud_particle = group->getSpatialPartition()->mPartitionType == LLViewerRegion::PARTITION_PARTICLE
+ || group->getSpatialPartition()->mPartitionType == LLViewerRegion::PARTITION_HUD_PARTICLE;
bool draw_glow_for_this_partition = mVertexShaderLevel > 0; // no shaders = no glow.
- static LLFastTimer::DeclareTimer FTM_RENDER_ALPHA_GROUP_LOOP("Alpha Group");
- LLFastTimer t(FTM_RENDER_ALPHA_GROUP_LOOP);
+
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_GROUP_LOOP);
bool disable_cull = is_particle_or_hud_particle;
LLGLDisable cull(disable_cull ? GL_CULL_FACE : 0);
@@ -398,7 +401,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass)
if ((params.mVertexBuffer->getTypeMask() & mask) != mask)
{ //FIXME!
- llwarns << "Missing required components, skipping render batch." << llendl;
+ LL_WARNS() << "Missing required components, skipping render batch." << LL_ENDL;
continue;
}
@@ -420,14 +423,14 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass)
}
LLRenderPass::applyModelMatrix(params);
-
+
LLMaterial* mat = NULL;
if (deferred_render)
{
mat = params.mMaterial;
}
-
+
if (params.mFullbright)
{
// Turn off lighting if it hasn't already been so.
@@ -497,7 +500,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass)
LLGLSLShader::bindNoShader();
current_shader = NULL;
}
-
+
if (use_shaders && mat)
{
// We have a material. Supply the appropriate data here.
@@ -547,7 +550,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass)
}
}
}
- else
+ else
{ //not batching textures or batch has only 1 texture -- might need a texture matrix
if (params.mTexture.notNull())
{
@@ -558,7 +561,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass)
}
else
{
- gGL.getTexUnit(0)->bind(params.mTexture, TRUE);
+ gGL.getTexUnit(0)->bind(params.mTexture, TRUE) ;
}
if (params.mTextureMatrix)
@@ -576,9 +579,8 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass)
}
}
- static LLFastTimer::DeclareTimer FTM_RENDER_ALPHA_PUSH("Alpha Push Verts");
{
- LLFastTimer t(FTM_RENDER_ALPHA_PUSH);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_PUSH);
gGL.blendFunc((LLRender::eBlendFactor) params.mBlendFuncSrc, (LLRender::eBlendFactor) params.mBlendFuncDst, mAlphaSFactor, mAlphaDFactor);
params.mVertexBuffer->setBuffer(mask & ~(params.mFullbright ? (LLVertexBuffer::MAP_TANGENT | LLVertexBuffer::MAP_TEXCOORD1 | LLVertexBuffer::MAP_TEXCOORD2) : 0));
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 24f467f954..90e6dfe351 100755
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -103,7 +103,7 @@ S32 normal_channel = -1;
S32 specular_channel = -1;
S32 cube_channel = -1;
-static LLFastTimer::DeclareTimer FTM_SHADOW_AVATAR("Avatar Shadow");
+static LLTrace::BlockTimerStatHandle FTM_SHADOW_AVATAR("Avatar Shadow");
LLDrawPoolAvatar::LLDrawPoolAvatar() :
LLFacePool(POOL_AVATAR)
@@ -170,7 +170,7 @@ LLMatrix4& LLDrawPoolAvatar::getModelView()
void LLDrawPoolAvatar::beginDeferredPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_CHARACTERS);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_CHARACTERS);
sSkipTransparent = TRUE;
is_deferred_render = true;
@@ -205,7 +205,7 @@ void LLDrawPoolAvatar::beginDeferredPass(S32 pass)
void LLDrawPoolAvatar::endDeferredPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_CHARACTERS);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_CHARACTERS);
sSkipTransparent = FALSE;
is_deferred_render = false;
@@ -409,7 +409,7 @@ S32 LLDrawPoolAvatar::getNumShadowPasses()
void LLDrawPoolAvatar::beginShadowPass(S32 pass)
{
- LLFastTimer t(FTM_SHADOW_AVATAR);
+ LL_RECORD_BLOCK_TIME(FTM_SHADOW_AVATAR);
if (pass == 0)
{
@@ -435,7 +435,7 @@ void LLDrawPoolAvatar::beginShadowPass(S32 pass)
void LLDrawPoolAvatar::endShadowPass(S32 pass)
{
- LLFastTimer t(FTM_SHADOW_AVATAR);
+ LL_RECORD_BLOCK_TIME(FTM_SHADOW_AVATAR);
if (pass == 0)
{
if (sShaderLevel > 0)
@@ -454,7 +454,7 @@ void LLDrawPoolAvatar::endShadowPass(S32 pass)
void LLDrawPoolAvatar::renderShadow(S32 pass)
{
- LLFastTimer t(FTM_SHADOW_AVATAR);
+ LL_RECORD_BLOCK_TIME(FTM_SHADOW_AVATAR);
if (mDrawFace.empty())
{
@@ -481,7 +481,7 @@ void LLDrawPoolAvatar::renderShadow(S32 pass)
if (pass == 0)
{
- avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE);
+ avatarp->renderSkinned();
}
else
{
@@ -520,7 +520,7 @@ S32 LLDrawPoolAvatar::getNumDeferredPasses()
void LLDrawPoolAvatar::render(S32 pass)
{
- LLFastTimer t(FTM_RENDER_CHARACTERS);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_CHARACTERS);
if (LLPipeline::sImpostorRender)
{
renderAvatars(NULL, pass+2);
@@ -532,7 +532,7 @@ void LLDrawPoolAvatar::render(S32 pass)
void LLDrawPoolAvatar::beginRenderPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_CHARACTERS);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_CHARACTERS);
//reset vertex buffer mappings
LLVertexBuffer::unbind();
@@ -583,7 +583,7 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass)
void LLDrawPoolAvatar::endRenderPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_CHARACTERS);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_CHARACTERS);
if (LLPipeline::sImpostorRender)
{
@@ -1175,12 +1175,12 @@ void LLDrawPoolAvatar::endDeferredSkinned()
gGL.getTexUnit(0)->activate();
}
-static LLFastTimer::DeclareTimer FTM_RENDER_AVATARS("renderAvatars");
+static LLTrace::BlockTimerStatHandle FTM_RENDER_AVATARS("renderAvatars");
void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
{
- LLFastTimer t(FTM_RENDER_AVATARS);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_AVATARS);
if (pass == -1)
{
@@ -1460,7 +1460,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
if( !single_avatar || (avatarp == single_avatar) )
{
- avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE);
+ avatarp->renderSkinned();
}
}
@@ -1517,7 +1517,19 @@ void LLDrawPoolAvatar::getRiggedGeometry(LLFace* face, LLPointer<LLVertexBuffer>
face->setPoolType(LLDrawPool::POOL_AVATAR);
}
- //llinfos << "Rebuilt face " << face->getTEOffset() << " of " << face->getDrawable() << " at " << gFrameTimeSeconds << llendl;
+ //LL_INFOS() << "Rebuilt face " << face->getTEOffset() << " of " << face->getDrawable() << " at " << gFrameTimeSeconds << LL_ENDL;
+
+ // Let getGeometryVolume know if a texture matrix is in play
+ if (face->mTextureMatrix)
+ {
+ face->setState(LLFace::TEXTURE_ANIM);
+ }
+ else
+ {
+ face->clearState(LLFace::TEXTURE_ANIM);
+ }
+
+
face->getGeometryVolume(*volume, face->getTEOffset(), mat_vert, mat_normal, offset, true);
buffer->flush();
@@ -1871,11 +1883,11 @@ void LLDrawPoolAvatar::renderDeferredRiggedMaterial(LLVOAvatar* avatar, S32 pass
renderRigged(avatar, pass);
}
-static LLFastTimer::DeclareTimer FTM_RIGGED_VBO("Rigged VBO");
+static LLTrace::BlockTimerStatHandle FTM_RIGGED_VBO("Rigged VBO");
void LLDrawPoolAvatar::updateRiggedVertexBuffers(LLVOAvatar* avatar)
{
- LLFastTimer t(FTM_RIGGED_VBO);
+ LL_RECORD_BLOCK_TIME(FTM_RIGGED_VBO);
//update rigged vertex buffers
for (U32 type = 0; type < NUM_RIGGED_PASSES; ++type)
@@ -2033,12 +2045,12 @@ void LLDrawPoolAvatar::addRiggedFace(LLFace* facep, U32 type)
{
if (type >= NUM_RIGGED_PASSES)
{
- llerrs << "Invalid rigged face type." << llendl;
+ LL_ERRS() << "Invalid rigged face type." << LL_ENDL;
}
if (facep->getRiggedIndex(type) != -1)
{
- llerrs << "Tried to add a rigged face that's referenced elsewhere." << llendl;
+ LL_ERRS() << "Tried to add a rigged face that's referenced elsewhere." << LL_ENDL;
}
facep->setRiggedIndex(type, mRiggedFace[type].size());
@@ -2067,7 +2079,7 @@ void LLDrawPoolAvatar::removeRiggedFace(LLFace* facep)
}
else
{
- llerrs << "Face reference data corrupt for rigged type " << i << llendl;
+ LL_ERRS() << "Face reference data corrupt for rigged type " << i << LL_ENDL;
}
}
}
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index 6b4c5cfca1..67d1642639 100755
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -104,7 +104,7 @@ void LLStandardBumpmap::addstandard()
// can't assert; we destroyGL and restoreGL a lot during *first* startup, which populates this list already, THEN we explicitly init the list as part of *normal* startup. Sigh. So clear the list every time before we (re-)add the standard bumpmaps.
//llassert( LLStandardBumpmap::sStandardBumpmapCount == 0 );
clear();
- llinfos << "Adding standard bumpmaps." << llendl;
+ LL_INFOS() << "Adding standard bumpmaps." << LL_ENDL;
gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount++] = LLStandardBumpmap("None"); // BE_NO_BUMP
gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount++] = LLStandardBumpmap("Brightness"); // BE_BRIGHTNESS
gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount++] = LLStandardBumpmap("Darkness"); // BE_DARKNESS
@@ -113,7 +113,7 @@ void LLStandardBumpmap::addstandard()
LLFILE* file = LLFile::fopen( file_name, "rt" ); /*Flawfinder: ignore*/
if( !file )
{
- llwarns << "Could not open std_bump <" << file_name << ">" << llendl;
+ LL_WARNS() << "Could not open std_bump <" << file_name << ">" << LL_ENDL;
return;
}
@@ -122,13 +122,13 @@ void LLStandardBumpmap::addstandard()
S32 fields_read = fscanf( file, "LLStandardBumpmap version %d", &file_version );
if( fields_read != 1 )
{
- llwarns << "Bad LLStandardBumpmap header" << llendl;
+ LL_WARNS() << "Bad LLStandardBumpmap header" << LL_ENDL;
return;
}
if( file_version > STD_BUMP_LATEST_FILE_VERSION )
{
- llwarns << "LLStandardBumpmap has newer version (" << file_version << ") than viewer (" << STD_BUMP_LATEST_FILE_VERSION << ")" << llendl;
+ LL_WARNS() << "LLStandardBumpmap has newer version (" << file_version << ") than viewer (" << STD_BUMP_LATEST_FILE_VERSION << ")" << LL_ENDL;
return;
}
@@ -145,17 +145,17 @@ void LLStandardBumpmap::addstandard()
}
if( fields_read != 2 )
{
- llwarns << "Bad LLStandardBumpmap entry" << llendl;
+ LL_WARNS() << "Bad LLStandardBumpmap entry" << LL_ENDL;
return;
}
-// llinfos << "Loading bumpmap: " << bump_image_id << " from viewerart" << llendl;
+// LL_INFOS() << "Loading bumpmap: " << bump_image_id << " from viewerart" << LL_ENDL;
gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mLabel = label;
gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage =
LLViewerTextureManager::getFetchedTexture(LLUUID(bump_image_id));
gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage->setBoostLevel(LLGLTexture::LOCAL) ;
gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage->setLoadedCallback(LLBumpImageList::onSourceStandardLoaded, 0, TRUE, FALSE, NULL, NULL );
- gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage->forceToSaveRawImage(0) ;
+ gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage->forceToSaveRawImage(0, 30.f) ;
LLStandardBumpmap::sStandardBumpmapCount++;
}
@@ -165,7 +165,7 @@ void LLStandardBumpmap::addstandard()
// static
void LLStandardBumpmap::clear()
{
- llinfos << "Clearing standard bumpmaps." << llendl;
+ LL_INFOS() << "Clearing standard bumpmaps." << LL_ENDL;
for( U32 i = 0; i < LLStandardBumpmap::sStandardBumpmapCount; i++ )
{
gStandardBumpmapList[i].mLabel.assign("");
@@ -234,7 +234,7 @@ S32 LLDrawPoolBump::getNumPasses()
void LLDrawPoolBump::beginRenderPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_BUMP);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_BUMP);
switch( pass )
{
case 0:
@@ -261,7 +261,7 @@ void LLDrawPoolBump::beginRenderPass(S32 pass)
void LLDrawPoolBump::render(S32 pass)
{
- LLFastTimer t(FTM_RENDER_BUMP);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_BUMP);
if (!gPipeline.hasRenderType(LLDrawPool::POOL_SIMPLE))
{
@@ -294,7 +294,7 @@ void LLDrawPoolBump::render(S32 pass)
void LLDrawPoolBump::endRenderPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_BUMP);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_BUMP);
switch( pass )
{
case 0:
@@ -325,7 +325,7 @@ void LLDrawPoolBump::endRenderPass(S32 pass)
//static
void LLDrawPoolBump::beginShiny(bool invisible)
{
- LLFastTimer t(FTM_RENDER_SHINY);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_SHINY);
if ((!invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_SHINY))||
(invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_INVISI_SHINY)))
{
@@ -418,7 +418,7 @@ void LLDrawPoolBump::bindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& di
void LLDrawPoolBump::renderShiny(bool invisible)
{
- LLFastTimer t(FTM_RENDER_SHINY);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_SHINY);
if ((!invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_SHINY))||
(invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_INVISI_SHINY)))
{
@@ -479,7 +479,7 @@ void LLDrawPoolBump::unbindCubeMap(LLGLSLShader* shader, S32 shader_level, S32&
void LLDrawPoolBump::endShiny(bool invisible)
{
- LLFastTimer t(FTM_RENDER_SHINY);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_SHINY);
if ((!invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_SHINY))||
(invisible && !gPipeline.hasRenderBatches(LLRenderPass::PASS_INVISI_SHINY)))
{
@@ -499,7 +499,7 @@ void LLDrawPoolBump::endShiny(bool invisible)
void LLDrawPoolBump::beginFullbrightShiny()
{
- LLFastTimer t(FTM_RENDER_SHINY);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_SHINY);
if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_FULLBRIGHT_SHINY))
{
return;
@@ -561,7 +561,7 @@ void LLDrawPoolBump::beginFullbrightShiny()
void LLDrawPoolBump::renderFullbrightShiny()
{
- LLFastTimer t(FTM_RENDER_SHINY);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_SHINY);
if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_FULLBRIGHT_SHINY))
{
return;
@@ -584,7 +584,7 @@ void LLDrawPoolBump::renderFullbrightShiny()
void LLDrawPoolBump::endFullbrightShiny()
{
- LLFastTimer t(FTM_RENDER_SHINY);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_SHINY);
if (!gPipeline.hasRenderBatches(LLRenderPass::PASS_FULLBRIGHT_SHINY))
{
return;
@@ -715,7 +715,7 @@ void LLDrawPoolBump::beginBump(U32 pass)
}
sVertexMask = VERTEX_MASK_BUMP;
- LLFastTimer t(FTM_RENDER_BUMP);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_BUMP);
// Optional second pass: emboss bump map
stop_glerror();
@@ -767,7 +767,7 @@ void LLDrawPoolBump::renderBump(U32 pass)
return;
}
- LLFastTimer ftm(FTM_RENDER_BUMP);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_BUMP);
LLGLDisable fog(GL_FOG);
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_LEQUAL);
LLGLEnable blend(GL_BLEND);
@@ -823,7 +823,7 @@ void LLDrawPoolBump::beginDeferredPass(S32 pass)
{
return;
}
- LLFastTimer ftm(FTM_RENDER_BUMP);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_BUMP);
mShiny = TRUE;
gDeferredBumpProgram.bind();
diffuse_channel = gDeferredBumpProgram.enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
@@ -838,7 +838,7 @@ void LLDrawPoolBump::endDeferredPass(S32 pass)
{
return;
}
- LLFastTimer ftm(FTM_RENDER_BUMP);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_BUMP);
mShiny = FALSE;
gDeferredBumpProgram.disableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
gDeferredBumpProgram.disableTexture(LLViewerShaderMgr::BUMP_MAP);
@@ -852,7 +852,7 @@ void LLDrawPoolBump::renderDeferred(S32 pass)
{
return;
}
- LLFastTimer ftm(FTM_RENDER_BUMP);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_BUMP);
U32 type = LLRenderPass::PASS_BUMP;
LLCullResult::drawinfo_iterator begin = gPipeline.beginRenderMap(type);
@@ -929,7 +929,7 @@ void LLBumpImageList::init()
void LLBumpImageList::clear()
{
- llinfos << "Clearing dynamic bumpmaps." << llendl;
+ LL_INFOS() << "Clearing dynamic bumpmaps." << LL_ENDL;
// these will be re-populated on-demand
mBrightnessEntries.clear();
mDarknessEntries.clear();
@@ -1005,7 +1005,7 @@ void LLBumpImageList::updateImages()
if( destroy )
{
- //llinfos << "*** Destroying bright " << (void*)image << llendl;
+ //LL_INFOS() << "*** Destroying bright " << (void*)image << LL_ENDL;
mBrightnessEntries.erase(curiter); // deletes the image thanks to reference counting
}
}
@@ -1032,7 +1032,7 @@ void LLBumpImageList::updateImages()
if( destroy )
{
- //llinfos << "*** Destroying dark " << (void*)image << llendl;;
+ //LL_INFOS() << "*** Destroying dark " << (void*)image << LL_ENDL;;
mDarknessEntries.erase(curiter); // deletes the image thanks to reference counting
}
}
@@ -1095,7 +1095,7 @@ LLViewerTexture* LLBumpImageList::getBrightnessDarknessImage(LLViewerFetchedText
}
-static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_STANDARD_LOADED("Bump Standard Callback");
+static LLTrace::BlockTimerStatHandle FTM_BUMP_SOURCE_STANDARD_LOADED("Bump Standard Callback");
// static
void LLBumpImageList::onSourceBrightnessLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata )
@@ -1119,22 +1119,22 @@ void LLBumpImageList::onSourceDarknessLoaded( BOOL success, LLViewerFetchedTextu
}
}
-static LLFastTimer::DeclareTimer FTM_BUMP_GEN_NORMAL("Generate Normal Map");
-static LLFastTimer::DeclareTimer FTM_BUMP_CREATE_TEXTURE("Create GL Normal Map");
+static LLTrace::BlockTimerStatHandle FTM_BUMP_GEN_NORMAL("Generate Normal Map");
+static LLTrace::BlockTimerStatHandle FTM_BUMP_CREATE_TEXTURE("Create GL Normal Map");
void LLBumpImageList::onSourceStandardLoaded( BOOL success, LLViewerFetchedTexture* src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata)
{
if (success && LLPipeline::sRenderDeferred)
{
- LLFastTimer t(FTM_BUMP_SOURCE_STANDARD_LOADED);
+ LL_RECORD_BLOCK_TIME(FTM_BUMP_SOURCE_STANDARD_LOADED);
LLPointer<LLImageRaw> nrm_image = new LLImageRaw(src->getWidth(), src->getHeight(), 4);
{
- LLFastTimer t(FTM_BUMP_GEN_NORMAL);
+ LL_RECORD_BLOCK_TIME(FTM_BUMP_GEN_NORMAL);
generateNormalMapFromAlpha(src, nrm_image);
}
src_vi->setExplicitFormat(GL_RGBA, GL_RGBA);
{
- LLFastTimer t(FTM_BUMP_CREATE_TEXTURE);
+ LL_RECORD_BLOCK_TIME(FTM_BUMP_CREATE_TEXTURE);
src_vi->createGLTexture(src_vi->getDiscardLevel(), nrm_image);
}
}
@@ -1196,27 +1196,27 @@ void LLBumpImageList::generateNormalMapFromAlpha(LLImageRaw* src, LLImageRaw* nr
}
-static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_LOADED("Bump Source Loaded");
-static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_ENTRIES_UPDATE("Entries Update");
-static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_MIN_MAX("Min/Max");
-static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_RGB2LUM("RGB to Luminance");
-static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_RESCALE("Rescale");
-static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_GEN_NORMAL("Generate Normal");
-static LLFastTimer::DeclareTimer FTM_BUMP_SOURCE_CREATE("Bump Source Create");
+static LLTrace::BlockTimerStatHandle FTM_BUMP_SOURCE_LOADED("Bump Source Loaded");
+static LLTrace::BlockTimerStatHandle FTM_BUMP_SOURCE_ENTRIES_UPDATE("Entries Update");
+static LLTrace::BlockTimerStatHandle FTM_BUMP_SOURCE_MIN_MAX("Min/Max");
+static LLTrace::BlockTimerStatHandle FTM_BUMP_SOURCE_RGB2LUM("RGB to Luminance");
+static LLTrace::BlockTimerStatHandle FTM_BUMP_SOURCE_RESCALE("Rescale");
+static LLTrace::BlockTimerStatHandle FTM_BUMP_SOURCE_GEN_NORMAL("Generate Normal");
+static LLTrace::BlockTimerStatHandle FTM_BUMP_SOURCE_CREATE("Bump Source Create");
// static
void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLImageRaw* src, LLUUID& source_asset_id, EBumpEffect bump_code )
{
if( success )
{
- LLFastTimer t(FTM_BUMP_SOURCE_LOADED);
+ LL_RECORD_BLOCK_TIME(FTM_BUMP_SOURCE_LOADED);
bump_image_map_t& entries_list(bump_code == BE_BRIGHTNESS ? gBumpImageList.mBrightnessEntries : gBumpImageList.mDarknessEntries );
bump_image_map_t::iterator iter = entries_list.find(source_asset_id);
{
- LLFastTimer t(FTM_BUMP_SOURCE_ENTRIES_UPDATE);
+ LL_RECORD_BLOCK_TIME(FTM_BUMP_SOURCE_ENTRIES_UPDATE);
if (iter == entries_list.end() ||
iter->second.isNull() ||
iter->second->getWidth() != src->getWidth() ||
@@ -1259,7 +1259,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
case 1:
case 2:
{
- LLFastTimer t(FTM_BUMP_SOURCE_MIN_MAX);
+ LL_RECORD_BLOCK_TIME(FTM_BUMP_SOURCE_MIN_MAX);
if( src_data_size == dst_data_size * src_components )
{
for( S32 i = 0, j=0; i < dst_data_size; i++, j+= src_components )
@@ -1285,7 +1285,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
case 3:
case 4:
{
- LLFastTimer t(FTM_BUMP_SOURCE_RGB2LUM);
+ LL_RECORD_BLOCK_TIME(FTM_BUMP_SOURCE_RGB2LUM);
if( src_data_size == dst_data_size * src_components )
{
for( S32 i = 0, j=0; i < dst_data_size; i++, j+= src_components )
@@ -1318,7 +1318,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
if( maximum > minimum )
{
- LLFastTimer t(FTM_BUMP_SOURCE_RESCALE);
+ LL_RECORD_BLOCK_TIME(FTM_BUMP_SOURCE_RESCALE);
U8 bias_and_scale_lut[256];
F32 twice_one_over_range = 2.f / (maximum - minimum);
S32 i;
@@ -1354,7 +1354,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
if (!LLPipeline::sRenderDeferred)
{
- LLFastTimer t(FTM_BUMP_SOURCE_CREATE);
+ LL_RECORD_BLOCK_TIME(FTM_BUMP_SOURCE_CREATE);
bump->setExplicitFormat(GL_ALPHA8, GL_ALPHA);
bump->createGLTexture(0, dst_image);
}
@@ -1365,13 +1365,13 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
bump->getGLTexture()->setAllowCompression(false);
{
- LLFastTimer t(FTM_BUMP_SOURCE_CREATE);
+ LL_RECORD_BLOCK_TIME(FTM_BUMP_SOURCE_CREATE);
bump->setExplicitFormat(GL_RGBA8, GL_ALPHA);
bump->createGLTexture(0, dst_image);
}
{
- LLFastTimer t(FTM_BUMP_SOURCE_GEN_NORMAL);
+ LL_RECORD_BLOCK_TIME(FTM_BUMP_SOURCE_GEN_NORMAL);
gPipeline.mScreen.bindTarget();
LLGLDepthTest depth(GL_FALSE);
@@ -1568,7 +1568,7 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL
void LLDrawPoolInvisible::render(S32 pass)
{ //render invisiprims
- LLFastTimer t(FTM_RENDER_INVISIBLE);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_INVISIBLE);
if (gPipeline.canUseVertexShaders())
{
@@ -1608,7 +1608,7 @@ void LLDrawPoolInvisible::endDeferredPass( S32 pass )
void LLDrawPoolInvisible::renderDeferred( S32 pass )
{ //render invisiprims; this doesn't work becaue it also blocks all the post-deferred stuff
#if 0
- LLFastTimer t(FTM_RENDER_INVISIBLE);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_INVISIBLE);
U32 invisi_mask = LLVertexBuffer::MAP_VERTEX;
glStencilMask(0);
diff --git a/indra/newview/lldrawpoolmaterials.cpp b/indra/newview/lldrawpoolmaterials.cpp
index d1b5080650..514411aef5 100644
--- a/indra/newview/lldrawpoolmaterials.cpp
+++ b/indra/newview/lldrawpoolmaterials.cpp
@@ -82,12 +82,12 @@ void LLDrawPoolMaterials::beginDeferredPass(S32 pass)
diffuse_channel = mShader->enableTexture(LLShaderMgr::DIFFUSE_MAP);
- LLFastTimer t(FTM_RENDER_MATERIALS);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_MATERIALS);
}
void LLDrawPoolMaterials::endDeferredPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_MATERIALS);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_MATERIALS);
mShader->unbind();
diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp
index 0bc7ae766c..bd180de6c6 100755
--- a/indra/newview/lldrawpoolsimple.cpp
+++ b/indra/newview/lldrawpoolsimple.cpp
@@ -40,8 +40,8 @@
static LLGLSLShader* simple_shader = NULL;
static LLGLSLShader* fullbright_shader = NULL;
-static LLFastTimer::DeclareTimer FTM_RENDER_SIMPLE_DEFERRED("Deferred Simple");
-static LLFastTimer::DeclareTimer FTM_RENDER_GRASS_DEFERRED("Deferred Grass");
+static LLTrace::BlockTimerStatHandle FTM_RENDER_SIMPLE_DEFERRED("Deferred Simple");
+static LLTrace::BlockTimerStatHandle FTM_RENDER_GRASS_DEFERRED("Deferred Grass");
void LLDrawPoolGlow::beginPostDeferredPass(S32 pass)
{
@@ -49,11 +49,11 @@ void LLDrawPoolGlow::beginPostDeferredPass(S32 pass)
gDeferredEmissiveProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, 2.2f);
}
-static LLFastTimer::DeclareTimer FTM_RENDER_GLOW_PUSH("Glow Push");
+static LLTrace::BlockTimerStatHandle FTM_RENDER_GLOW_PUSH("Glow Push");
void LLDrawPoolGlow::renderPostDeferred(S32 pass)
{
- LLFastTimer t(FTM_RENDER_GLOW);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_GLOW);
LLGLEnable blend(GL_BLEND);
LLGLDisable test(GL_ALPHA_TEST);
gGL.flush();
@@ -66,7 +66,7 @@ void LLDrawPoolGlow::renderPostDeferred(S32 pass)
gGL.setColorMask(false, true);
{
- LLFastTimer t(FTM_RENDER_GLOW_PUSH);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_GLOW_PUSH);
pushBatches(LLRenderPass::PASS_GLOW, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE);
}
@@ -94,7 +94,7 @@ S32 LLDrawPoolGlow::getNumPasses()
void LLDrawPoolGlow::render(S32 pass)
{
- LLFastTimer t(FTM_RENDER_GLOW);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_GLOW);
LLGLEnable blend(GL_BLEND);
LLGLDisable test(GL_ALPHA_TEST);
gGL.flush();
@@ -152,7 +152,7 @@ void LLDrawPoolSimple::prerender()
void LLDrawPoolSimple::beginRenderPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_SIMPLE);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_SIMPLE);
if (LLPipeline::sImpostorRender)
{
@@ -183,7 +183,7 @@ void LLDrawPoolSimple::beginRenderPass(S32 pass)
void LLDrawPoolSimple::endRenderPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_SIMPLE);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_SIMPLE);
stop_glerror();
LLRenderPass::endRenderPass(pass);
stop_glerror();
@@ -198,7 +198,7 @@ void LLDrawPoolSimple::render(S32 pass)
LLGLDisable blend(GL_BLEND);
{ //render simple
- LLFastTimer t(FTM_RENDER_SIMPLE);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_SIMPLE);
gPipeline.enableLightsDynamic();
if (mVertexShaderLevel > 0)
@@ -235,7 +235,7 @@ void LLDrawPoolSimple::render(S32 pass)
-static LLFastTimer::DeclareTimer FTM_RENDER_ALPHA_MASK("Alpha Mask");
+static LLTrace::BlockTimerStatHandle FTM_RENDER_ALPHA_MASK("Alpha Mask");
LLDrawPoolAlphaMask::LLDrawPoolAlphaMask() :
LLRenderPass(POOL_ALPHA_MASK)
@@ -249,7 +249,7 @@ void LLDrawPoolAlphaMask::prerender()
void LLDrawPoolAlphaMask::beginRenderPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_ALPHA_MASK);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_MASK);
if (LLPipeline::sUnderWaterRender)
{
@@ -276,7 +276,7 @@ void LLDrawPoolAlphaMask::beginRenderPass(S32 pass)
void LLDrawPoolAlphaMask::endRenderPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_ALPHA_MASK);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_MASK);
stop_glerror();
LLRenderPass::endRenderPass(pass);
stop_glerror();
@@ -289,7 +289,7 @@ void LLDrawPoolAlphaMask::endRenderPass(S32 pass)
void LLDrawPoolAlphaMask::render(S32 pass)
{
LLGLDisable blend(GL_BLEND);
- LLFastTimer t(FTM_RENDER_ALPHA_MASK);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_MASK);
if (mVertexShaderLevel > 0)
{
@@ -322,7 +322,7 @@ void LLDrawPoolFullbrightAlphaMask::prerender()
void LLDrawPoolFullbrightAlphaMask::beginRenderPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_ALPHA_MASK);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_MASK);
if (LLPipeline::sUnderWaterRender)
{
@@ -349,7 +349,7 @@ void LLDrawPoolFullbrightAlphaMask::beginRenderPass(S32 pass)
void LLDrawPoolFullbrightAlphaMask::endRenderPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_ALPHA_MASK);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_MASK);
stop_glerror();
LLRenderPass::endRenderPass(pass);
stop_glerror();
@@ -361,7 +361,7 @@ void LLDrawPoolFullbrightAlphaMask::endRenderPass(S32 pass)
void LLDrawPoolFullbrightAlphaMask::render(S32 pass)
{
- LLFastTimer t(FTM_RENDER_ALPHA_MASK);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_MASK);
if (mVertexShaderLevel > 0)
{
@@ -395,13 +395,13 @@ void LLDrawPoolFullbrightAlphaMask::render(S32 pass)
void LLDrawPoolSimple::beginDeferredPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_SIMPLE_DEFERRED);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_SIMPLE_DEFERRED);
gDeferredDiffuseProgram.bind();
}
void LLDrawPoolSimple::endDeferredPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_SIMPLE_DEFERRED);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_SIMPLE_DEFERRED);
LLRenderPass::endRenderPass(pass);
gDeferredDiffuseProgram.unbind();
@@ -413,12 +413,12 @@ void LLDrawPoolSimple::renderDeferred(S32 pass)
LLGLDisable alpha_test(GL_ALPHA_TEST);
{ //render simple
- LLFastTimer t(FTM_RENDER_SIMPLE_DEFERRED);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_SIMPLE_DEFERRED);
pushBatches(LLRenderPass::PASS_SIMPLE, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE);
}
}
-static LLFastTimer::DeclareTimer FTM_RENDER_ALPHA_MASK_DEFERRED("Deferred Alpha Mask");
+static LLTrace::BlockTimerStatHandle FTM_RENDER_ALPHA_MASK_DEFERRED("Deferred Alpha Mask");
void LLDrawPoolAlphaMask::beginDeferredPass(S32 pass)
{
@@ -432,7 +432,7 @@ void LLDrawPoolAlphaMask::endDeferredPass(S32 pass)
void LLDrawPoolAlphaMask::renderDeferred(S32 pass)
{
- LLFastTimer t(FTM_RENDER_ALPHA_MASK_DEFERRED);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_MASK_DEFERRED);
gDeferredDiffuseAlphaMaskProgram.bind();
gDeferredDiffuseAlphaMaskProgram.setMinimumAlpha(0.33f);
pushMaskBatches(LLRenderPass::PASS_ALPHA_MASK, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE);
@@ -455,7 +455,7 @@ void LLDrawPoolGrass::prerender()
void LLDrawPoolGrass::beginRenderPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_GRASS);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_GRASS);
stop_glerror();
if (LLPipeline::sUnderWaterRender)
@@ -485,7 +485,7 @@ void LLDrawPoolGrass::beginRenderPass(S32 pass)
void LLDrawPoolGrass::endRenderPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_GRASS);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_GRASS);
LLRenderPass::endRenderPass(pass);
if (mVertexShaderLevel > 0)
@@ -503,7 +503,7 @@ void LLDrawPoolGrass::render(S32 pass)
LLGLDisable blend(GL_BLEND);
{
- LLFastTimer t(FTM_RENDER_GRASS);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_GRASS);
LLGLEnable test(GL_ALPHA_TEST);
gGL.setSceneBlendType(LLRender::BT_ALPHA);
//render grass
@@ -524,7 +524,7 @@ void LLDrawPoolGrass::endDeferredPass(S32 pass)
void LLDrawPoolGrass::renderDeferred(S32 pass)
{
{
- LLFastTimer t(FTM_RENDER_GRASS_DEFERRED);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_GRASS_DEFERRED);
gDeferredNonIndexedDiffuseAlphaMaskProgram.bind();
gDeferredNonIndexedDiffuseAlphaMaskProgram.setMinimumAlpha(0.5f);
//render grass
@@ -559,7 +559,7 @@ void LLDrawPoolFullbright::beginPostDeferredPass(S32 pass)
void LLDrawPoolFullbright::renderPostDeferred(S32 pass)
{
- LLFastTimer t(FTM_RENDER_FULLBRIGHT);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_FULLBRIGHT);
gGL.setSceneBlendType(LLRender::BT_ALPHA);
U32 fullbright_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_TEXTURE_INDEX;
@@ -581,7 +581,7 @@ void LLDrawPoolFullbright::endPostDeferredPass(S32 pass)
void LLDrawPoolFullbright::beginRenderPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_FULLBRIGHT);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_FULLBRIGHT);
if (LLPipeline::sUnderWaterRender)
{
@@ -595,7 +595,7 @@ void LLDrawPoolFullbright::beginRenderPass(S32 pass)
void LLDrawPoolFullbright::endRenderPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_FULLBRIGHT);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_FULLBRIGHT);
LLRenderPass::endRenderPass(pass);
stop_glerror();
@@ -610,7 +610,7 @@ void LLDrawPoolFullbright::endRenderPass(S32 pass)
void LLDrawPoolFullbright::render(S32 pass)
{ //render fullbright
- LLFastTimer t(FTM_RENDER_FULLBRIGHT);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_FULLBRIGHT);
gGL.setSceneBlendType(LLRender::BT_ALPHA);
stop_glerror();
@@ -673,7 +673,7 @@ void LLDrawPoolFullbrightAlphaMask::beginPostDeferredPass(S32 pass)
void LLDrawPoolFullbrightAlphaMask::renderPostDeferred(S32 pass)
{
- LLFastTimer t(FTM_RENDER_FULLBRIGHT);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_FULLBRIGHT);
LLGLDisable blend(GL_BLEND);
U32 fullbright_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_TEXTURE_INDEX;
pushMaskBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, fullbright_mask, TRUE, TRUE);
diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp
index ef8bdc3304..bdb16abc78 100755
--- a/indra/newview/lldrawpoolsky.cpp
+++ b/indra/newview/lldrawpoolsky.cpp
@@ -28,8 +28,6 @@
#include "lldrawpoolsky.h"
-#include "imageids.h"
-
#include "llagent.h"
#include "lldrawable.h"
#include "llface.h"
diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index c3ec234223..33ce3d0111 100755
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -55,7 +55,7 @@ int DebugDetailMap = 0;
S32 LLDrawPoolTerrain::sDetailMode = 1;
F32 LLDrawPoolTerrain::sDetailScale = DETAIL_SCALE;
static LLGLSLShader* sShader = NULL;
-static LLFastTimer::DeclareTimer FTM_SHADOW_TERRAIN("Terrain Shadow");
+static LLTrace::BlockTimerStatHandle FTM_SHADOW_TERRAIN("Terrain Shadow");
LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerTexture *texturep) :
@@ -129,7 +129,7 @@ void LLDrawPoolTerrain::prerender()
void LLDrawPoolTerrain::beginRenderPass( S32 pass )
{
- LLFastTimer t(FTM_RENDER_TERRAIN);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_TERRAIN);
LLFacePool::beginRenderPass(pass);
sShader = LLPipeline::sUnderWaterRender ?
@@ -144,7 +144,7 @@ void LLDrawPoolTerrain::beginRenderPass( S32 pass )
void LLDrawPoolTerrain::endRenderPass( S32 pass )
{
- LLFastTimer t(FTM_RENDER_TERRAIN);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_TERRAIN);
//LLFacePool::endRenderPass(pass);
if (mVertexShaderLevel > 1 && sShader->mShaderLevel > 0) {
@@ -160,7 +160,7 @@ S32 LLDrawPoolTerrain::getDetailMode()
void LLDrawPoolTerrain::render(S32 pass)
{
- LLFastTimer t(FTM_RENDER_TERRAIN);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_TERRAIN);
if (mDrawFace.empty())
{
@@ -243,7 +243,7 @@ void LLDrawPoolTerrain::render(S32 pass)
void LLDrawPoolTerrain::beginDeferredPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_TERRAIN);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_TERRAIN);
LLFacePool::beginRenderPass(pass);
sShader = &gDeferredTerrainProgram;
@@ -253,14 +253,14 @@ void LLDrawPoolTerrain::beginDeferredPass(S32 pass)
void LLDrawPoolTerrain::endDeferredPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_TERRAIN);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_TERRAIN);
LLFacePool::endRenderPass(pass);
sShader->unbind();
}
void LLDrawPoolTerrain::renderDeferred(S32 pass)
{
- LLFastTimer t(FTM_RENDER_TERRAIN);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_TERRAIN);
if (mDrawFace.empty())
{
return;
@@ -270,7 +270,7 @@ void LLDrawPoolTerrain::renderDeferred(S32 pass)
void LLDrawPoolTerrain::beginShadowPass(S32 pass)
{
- LLFastTimer t(FTM_SHADOW_TERRAIN);
+ LL_RECORD_BLOCK_TIME(FTM_SHADOW_TERRAIN);
LLFacePool::beginRenderPass(pass);
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gDeferredShadowProgram.bind();
@@ -278,14 +278,14 @@ void LLDrawPoolTerrain::beginShadowPass(S32 pass)
void LLDrawPoolTerrain::endShadowPass(S32 pass)
{
- LLFastTimer t(FTM_SHADOW_TERRAIN);
+ LL_RECORD_BLOCK_TIME(FTM_SHADOW_TERRAIN);
LLFacePool::endRenderPass(pass);
gDeferredShadowProgram.unbind();
}
void LLDrawPoolTerrain::renderShadow(S32 pass)
{
- LLFastTimer t(FTM_SHADOW_TERRAIN);
+ LL_RECORD_BLOCK_TIME(FTM_SHADOW_TERRAIN);
if (mDrawFace.empty())
{
return;
diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp
index fedbd782dc..b1f40781f7 100755
--- a/indra/newview/lldrawpooltree.cpp
+++ b/indra/newview/lldrawpooltree.cpp
@@ -41,7 +41,7 @@
S32 LLDrawPoolTree::sDiffTex = 0;
static LLGLSLShader* shader = NULL;
-static LLFastTimer::DeclareTimer FTM_SHADOW_TREE("Tree Shadow");
+static LLTrace::BlockTimerStatHandle FTM_SHADOW_TREE("Tree Shadow");
LLDrawPoolTree::LLDrawPoolTree(LLViewerTexture *texturep) :
LLFacePool(POOL_TREE),
@@ -62,7 +62,7 @@ void LLDrawPoolTree::prerender()
void LLDrawPoolTree::beginRenderPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_TREES);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_TREES);
if (LLPipeline::sUnderWaterRender)
{
@@ -88,7 +88,7 @@ void LLDrawPoolTree::beginRenderPass(S32 pass)
void LLDrawPoolTree::render(S32 pass)
{
- LLFastTimer t(LLPipeline::sShadowRender ? FTM_SHADOW_TREE : FTM_RENDER_TREES);
+ LL_RECORD_BLOCK_TIME(LLPipeline::sShadowRender ? FTM_SHADOW_TREE : FTM_RENDER_TREES);
if (mDrawFace.empty())
{
@@ -131,7 +131,7 @@ void LLDrawPoolTree::render(S32 pass)
void LLDrawPoolTree::endRenderPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_TREES);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_TREES);
if (gPipeline.canUseWindLightShadersOnObjects())
{
@@ -149,7 +149,7 @@ void LLDrawPoolTree::endRenderPass(S32 pass)
//============================================
void LLDrawPoolTree::beginDeferredPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_TREES);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_TREES);
shader = &gDeferredTreeProgram;
shader->bind();
@@ -163,7 +163,7 @@ void LLDrawPoolTree::renderDeferred(S32 pass)
void LLDrawPoolTree::endDeferredPass(S32 pass)
{
- LLFastTimer t(FTM_RENDER_TREES);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_TREES);
shader->unbind();
}
@@ -173,7 +173,7 @@ void LLDrawPoolTree::endDeferredPass(S32 pass)
//============================================
void LLDrawPoolTree::beginShadowPass(S32 pass)
{
- LLFastTimer t(FTM_SHADOW_TREE);
+ LL_RECORD_BLOCK_TIME(FTM_SHADOW_TREE);
glPolygonOffset(gSavedSettings.getF32("RenderDeferredTreeShadowOffset"),
gSavedSettings.getF32("RenderDeferredTreeShadowBias"));
@@ -189,7 +189,7 @@ void LLDrawPoolTree::renderShadow(S32 pass)
void LLDrawPoolTree::endShadowPass(S32 pass)
{
- LLFastTimer t(FTM_SHADOW_TREE);
+ LL_RECORD_BLOCK_TIME(FTM_SHADOW_TREE);
glPolygonOffset(gSavedSettings.getF32("RenderDeferredSpotShadowOffset"),
gSavedSettings.getF32("RenderDeferredSpotShadowBias"));
diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp
index 76e89b26e4..df06ad31e6 100755
--- a/indra/newview/lldrawpoolwater.cpp
+++ b/indra/newview/lldrawpoolwater.cpp
@@ -98,7 +98,7 @@ void LLDrawPoolWater::restoreGL()
LLDrawPool *LLDrawPoolWater::instancePool()
{
- llerrs << "Should never be calling instancePool on a water pool!" << llendl;
+ LL_ERRS() << "Should never be calling instancePool on a water pool!" << LL_ENDL;
return NULL;
}
@@ -142,7 +142,7 @@ void LLDrawPoolWater::endPostDeferredPass(S32 pass)
//===============================
void LLDrawPoolWater::renderDeferred(S32 pass)
{
- LLFastTimer t(FTM_RENDER_WATER);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_WATER);
deferred_render = TRUE;
shade();
deferred_render = FALSE;
@@ -152,7 +152,7 @@ void LLDrawPoolWater::renderDeferred(S32 pass)
void LLDrawPoolWater::render(S32 pass)
{
- LLFastTimer ftm(FTM_RENDER_WATER);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_WATER);
if (mDrawFace.empty() || LLDrawable::getCurrentFrame() <= 1)
{
return;
@@ -463,7 +463,7 @@ void LLDrawPoolWater::renderReflection(LLFace* face)
gGL.getTexUnit(0)->bind(mHBTex[dr]);
- LLOverrideFaceColor override(this, face->getFaceColor().mV);
+ LLOverrideFaceColor override(this, LLColor4(face->getFaceColor().mV));
face->renderIndexed();
}
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index a98d3e6b05..309f535c39 100755
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -54,12 +54,12 @@ LLDrawPoolWLSky::LLDrawPoolWLSky(void) :
LLDrawPool(POOL_WL_SKY)
{
const std::string cloudNoiseFilename(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", "clouds2.tga"));
- llinfos << "loading WindLight cloud noise from " << cloudNoiseFilename << llendl;
+ LL_INFOS() << "loading WindLight cloud noise from " << cloudNoiseFilename << LL_ENDL;
LLPointer<LLImageFormatted> cloudNoiseFile(LLImageFormatted::createFromExtension(cloudNoiseFilename));
if(cloudNoiseFile.isNull()) {
- llerrs << "Error: Failed to load cloud noise image " << cloudNoiseFilename << llendl;
+ LL_ERRS() << "Error: Failed to load cloud noise image " << cloudNoiseFilename << LL_ENDL;
}
if(cloudNoiseFile->load(cloudNoiseFilename))
@@ -69,8 +69,8 @@ LLDrawPoolWLSky::LLDrawPoolWLSky(void) :
if(cloudNoiseFile->decode(sCloudNoiseRawImage, 0.0f))
{
//debug use
- lldebugs << "cloud noise raw image width: " << sCloudNoiseRawImage->getWidth() << " : height: " << sCloudNoiseRawImage->getHeight() << " : components: " <<
- (S32)sCloudNoiseRawImage->getComponents() << " : data size: " << sCloudNoiseRawImage->getDataSize() << llendl ;
+ LL_DEBUGS() << "cloud noise raw image width: " << sCloudNoiseRawImage->getWidth() << " : height: " << sCloudNoiseRawImage->getHeight() << " : components: " <<
+ (S32)sCloudNoiseRawImage->getComponents() << " : data size: " << sCloudNoiseRawImage->getDataSize() << LL_ENDL ;
llassert_always(sCloudNoiseRawImage->getData()) ;
sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(sCloudNoiseRawImage.get(), TRUE);
@@ -86,7 +86,7 @@ LLDrawPoolWLSky::LLDrawPoolWLSky(void) :
LLDrawPoolWLSky::~LLDrawPoolWLSky()
{
- //llinfos << "destructing wlsky draw pool." << llendl;
+ //LL_INFOS() << "destructing wlsky draw pool." << LL_ENDL;
sCloudNoiseTexture = NULL;
sCloudNoiseRawImage = NULL;
}
@@ -197,7 +197,7 @@ void LLDrawPoolWLSky::renderStars(void) const
// If start_brightness is not set, exit
if( error )
{
- llwarns << "star_brightness missing in mCurParams" << llendl;
+ LL_WARNS() << "star_brightness missing in mCurParams" << LL_ENDL;
return;
}
@@ -308,7 +308,7 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass)
{
return;
}
- LLFastTimer ftm(FTM_RENDER_WL_SKY);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_WL_SKY);
const F32 camHeightLocal = LLWLParamManager::getInstance()->getDomeOffset() * LLWLParamManager::getInstance()->getDomeRadius();
@@ -355,7 +355,7 @@ void LLDrawPoolWLSky::render(S32 pass)
{
return;
}
- LLFastTimer ftm(FTM_RENDER_WL_SKY);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_WL_SKY);
const F32 camHeightLocal = LLWLParamManager::getInstance()->getDomeOffset() * LLWLParamManager::getInstance()->getDomeRadius();
@@ -391,7 +391,7 @@ void LLDrawPoolWLSky::render(S32 pass)
void LLDrawPoolWLSky::prerender()
{
- //llinfos << "wlsky prerendering pass." << llendl;
+ //LL_INFOS() << "wlsky prerendering pass." << LL_ENDL;
}
LLDrawPoolWLSky *LLDrawPoolWLSky::instancePool()
diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp
index 29ad4f34d2..fa9a0712fa 100755
--- a/indra/newview/lldynamictexture.cpp
+++ b/indra/newview/lldynamictexture.cpp
@@ -99,7 +99,7 @@ void LLViewerDynamicTexture::generateGLTexture(LLGLint internal_format, LLGLenum
{
if (mComponents < 1 || mComponents > 4)
{
- llerrs << "Bad number of components in dynamic texture: " << mComponents << llendl;
+ LL_ERRS() << "Bad number of components in dynamic texture: " << mComponents << LL_ENDL;
}
LLPointer<LLImageRaw> raw_image = new LLImageRaw(mFullWidth, mFullHeight, mComponents);
diff --git a/indra/newview/lldynamictexture.h b/indra/newview/lldynamictexture.h
index d287ae6eeb..f3f57c9a6b 100755
--- a/indra/newview/lldynamictexture.h
+++ b/indra/newview/lldynamictexture.h
@@ -38,12 +38,12 @@ class LLViewerDynamicTexture : public LLViewerTexture
public:
void* operator new(size_t size)
{
- return ll_aligned_malloc_16(size);
+ return LLTrace::MemTrackable<LLTexture>::aligned_new<16>(size);
}
- void operator delete(void* ptr)
+ void operator delete(void* ptr, size_t size)
{
- ll_aligned_free_16(ptr);
+ LLTrace::MemTrackable<LLTexture>::aligned_delete<16>(ptr, size);
}
enum
diff --git a/indra/newview/llemote.cpp b/indra/newview/llemote.cpp
index 510ff69acf..b9ef297c00 100755
--- a/indra/newview/llemote.cpp
+++ b/indra/newview/llemote.cpp
@@ -79,13 +79,13 @@ BOOL LLEmote::onActivate()
LLVisualParam* default_param = mCharacter->getVisualParam( "Express_Closed_Mouth" );
if( default_param )
{
- default_param->setWeight( default_param->getMaxWeight(), FALSE );
+ default_param->setWeight( default_param->getMaxWeight());
}
mParam = mCharacter->getVisualParam(mName.c_str());
if (mParam)
{
- mParam->setWeight(0.f, FALSE);
+ mParam->setWeight(0.f);
mCharacter->updateVisualParams();
}
@@ -101,7 +101,7 @@ BOOL LLEmote::onUpdate(F32 time, U8* joint_mask)
if( mParam )
{
F32 weight = mParam->getMinWeight() + mPose.getWeight() * (mParam->getMaxWeight() - mParam->getMinWeight());
- mParam->setWeight(weight, FALSE);
+ mParam->setWeight(weight);
// Cross fade against the default parameter
LLVisualParam* default_param = mCharacter->getVisualParam( "Express_Closed_Mouth" );
@@ -110,7 +110,7 @@ BOOL LLEmote::onUpdate(F32 time, U8* joint_mask)
F32 default_param_weight = default_param->getMinWeight() +
(1.f - mPose.getWeight()) * ( default_param->getMaxWeight() - default_param->getMinWeight() );
- default_param->setWeight( default_param_weight, FALSE );
+ default_param->setWeight( default_param_weight);
}
mCharacter->updateVisualParams();
@@ -127,13 +127,13 @@ void LLEmote::onDeactivate()
{
if( mParam )
{
- mParam->setWeight( mParam->getDefaultWeight(), FALSE );
+ mParam->setWeight( mParam->getDefaultWeight());
}
LLVisualParam* default_param = mCharacter->getVisualParam( "Express_Closed_Mouth" );
if( default_param )
{
- default_param->setWeight( default_param->getMaxWeight(), FALSE );
+ default_param->setWeight( default_param->getMaxWeight());
}
mCharacter->updateVisualParams();
diff --git a/indra/newview/llenvmanager.cpp b/indra/newview/llenvmanager.cpp
index 589cf28615..41d378fea1 100755
--- a/indra/newview/llenvmanager.cpp
+++ b/indra/newview/llenvmanager.cpp
@@ -40,7 +40,7 @@ std::string LLEnvPrefs::getWaterPresetName() const
{
if (mWaterPresetName.empty())
{
- llwarns << "Water preset name is empty" << llendl;
+ LL_WARNS() << "Water preset name is empty" << LL_ENDL;
}
return mWaterPresetName;
@@ -50,7 +50,7 @@ std::string LLEnvPrefs::getSkyPresetName() const
{
if (mSkyPresetName.empty())
{
- llwarns << "Sky preset name is empty" << llendl;
+ LL_WARNS() << "Sky preset name is empty" << LL_ENDL;
}
return mSkyPresetName;
@@ -60,7 +60,7 @@ std::string LLEnvPrefs::getDayCycleName() const
{
if (mDayCycleName.empty())
{
- llwarns << "Day cycle name is empty" << llendl;
+ LL_WARNS() << "Day cycle name is empty" << LL_ENDL;
}
return mDayCycleName;
@@ -201,7 +201,7 @@ bool LLEnvManagerNew::useSkyPreset(const std::string& name)
if (!sky_mgr.getParamSet(LLWLParamKey(name, LLEnvKey::SCOPE_LOCAL), param_set))
{
- llwarns << "No sky preset named " << name << llendl;
+ LL_WARNS() << "No sky preset named " << name << LL_ENDL;
return false;
}
@@ -232,7 +232,7 @@ bool LLEnvManagerNew::useDayCycle(const std::string& name, LLEnvKey::EScope scop
if (!LLDayCycleManager::instance().getPreset(name, params))
{
- llwarns << "No day cycle named " << name << llendl;
+ LL_WARNS() << "No day cycle named " << name << LL_ENDL;
return false;
}
}
@@ -260,7 +260,7 @@ void LLEnvManagerNew::setUseWaterPreset(const std::string& name)
// *TODO: make sure the preset exists.
if (name.empty())
{
- llwarns << "Empty water preset name passed" << llendl;
+ LL_WARNS() << "Empty water preset name passed" << LL_ENDL;
return;
}
@@ -274,7 +274,7 @@ void LLEnvManagerNew::setUseSkyPreset(const std::string& name)
// *TODO: make sure the preset exists.
if (name.empty())
{
- llwarns << "Empty sky preset name passed" << llendl;
+ LL_WARNS() << "Empty sky preset name passed" << LL_ENDL;
return;
}
@@ -287,7 +287,7 @@ void LLEnvManagerNew::setUseDayCycle(const std::string& name)
{
if (!LLDayCycleManager::instance().presetExists(name))
{
- llwarns << "Invalid day cycle name passed" << llendl;
+ LL_WARNS() << "Invalid day cycle name passed" << LL_ENDL;
return;
}
@@ -574,7 +574,7 @@ void LLEnvManagerNew::updateWaterFromPrefs(bool interpolate)
LLWaterParamSet params;
if (!water_mgr.getParamSet(water, params))
{
- llwarns << "No water preset named " << water << ", falling back to defaults" << llendl;
+ LL_WARNS() << "No water preset named " << water << ", falling back to defaults" << LL_ENDL;
water_mgr.getParamSet("Default", params);
// *TODO: Fix user preferences accordingly.
@@ -654,19 +654,19 @@ void LLEnvManagerNew::onRegionChange()
LLUUID region_uuid = regionp ? regionp->getRegionID() : LLUUID::null;
if (region_uuid != mCurRegionUUID)
{
- // Clear locally modified region settings.
- mNewRegionPrefs.clear();
+ // Clear locally modified region settings.
+ mNewRegionPrefs.clear();
- // *TODO: clear environment settings of the previous region?
+ // *TODO: clear environment settings of the previous region?
- // Request environment settings of the new region.
- mCurRegionUUID = region_uuid;
+ // Request environment settings of the new region.
+ mCurRegionUUID = region_uuid;
// for region crossings, interpolate the change; for teleports, don't
mInterpNextChangeMessage = (gAgent.getTeleportState() == LLAgent::TELEPORT_NONE);
LL_DEBUGS("Windlight") << (mInterpNextChangeMessage ? "Crossed" : "Teleported")
<< " to new region: " << region_uuid
<< LL_ENDL;
- requestRegionSettings();
+ requestRegionSettings();
}
else
{
diff --git a/indra/newview/llestateinfomodel.cpp b/indra/newview/llestateinfomodel.cpp
index 2669b0340f..78d619a315 100755
--- a/indra/newview/llestateinfomodel.cpp
+++ b/indra/newview/llestateinfomodel.cpp
@@ -93,7 +93,7 @@ void LLEstateInfoModel::update(const strings_t& strings)
LL_DEBUGS("Windlight Sync") << "Received estate info: "
<< "is_sun_fixed = " << getUseFixedSun()
<< ", sun_hour = " << getSunHour() << LL_ENDL;
- lldebugs << getInfoDump() << llendl;
+ LL_DEBUGS() << getInfoDump() << LL_ENDL;
// Update region owner.
LLViewerRegion* regionp = gAgent.getRegion();
@@ -112,19 +112,19 @@ void LLEstateInfoModel::notifyCommit()
class LLEstateChangeInfoResponder : public LLHTTPClient::Responder
{
-public:
-
+ LOG_CLASS(LLEstateChangeInfoResponder);
+protected:
// if we get a normal response, handle it here
- virtual void result(const LLSD& content)
+ virtual void httpSuccesss()
{
- llinfos << "Committed estate info" << llendl;
+ LL_INFOS() << "Committed estate info" << LL_ENDL;
LLEstateInfoModel::instance().notifyCommit();
}
// if we get an error response
- virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+ virtual void httpFailure()
{
- llwarns << "Failed to commit estate info [status:" << status << "]: " << content << llendl;
+ LL_WARNS() << "Failed to commit estate info " << dumpResponse() << LL_ENDL;
}
};
@@ -155,7 +155,7 @@ bool LLEstateInfoModel::commitEstateInfoCaps()
LL_DEBUGS("Windlight Sync") << "Sending estate caps: "
<< "is_sun_fixed = " << getUseFixedSun()
<< ", sun_hour = " << getSunHour() << LL_ENDL;
- lldebugs << body << LL_ENDL;
+ LL_DEBUGS() << body << LL_ENDL;
// we use a responder so that we can re-get the data after committing to the database
LLHTTPClient::post(url, body, new LLEstateChangeInfoResponder);
@@ -174,7 +174,7 @@ void LLEstateInfoModel::commitEstateInfoDataserver()
LL_DEBUGS("Windlight Sync") << "Sending estate info: "
<< "is_sun_fixed = " << getUseFixedSun()
<< ", sun_hour = " << getSunHour() << LL_ENDL;
- lldebugs << getInfoDump() << LL_ENDL;
+ LL_DEBUGS() << getInfoDump() << LL_ENDL;
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("EstateOwnerMessage");
diff --git a/indra/newview/lleventnotifier.cpp b/indra/newview/lleventnotifier.cpp
index bedab75f98..e3c17f9877 100755
--- a/indra/newview/lleventnotifier.cpp
+++ b/indra/newview/lleventnotifier.cpp
@@ -167,7 +167,7 @@ bool LLEventNotifier::add(U32 eventId, F64 eventEpoch, const std::string& eventD
{
LLEventNotification *new_enp = new LLEventNotification(eventId, eventEpoch, eventDateStr, eventName);
- llinfos << "Add event " << eventName << " id " << eventId << " date " << eventDateStr << llendl;
+ LL_INFOS() << "Add event " << eventName << " id " << eventId << " date " << eventDateStr << LL_ENDL;
if(!new_enp->isValid())
{
delete new_enp;
diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp
index c1630318e8..4de6ad4d2f 100755
--- a/indra/newview/lleventpoll.cpp
+++ b/indra/newview/lleventpoll.cpp
@@ -31,7 +31,7 @@
#include "llagent.h"
#include "llhttpclient.h"
-#include "llhttpstatuscodes.h"
+#include "llhttpconstants.h"
#include "llsdserialize.h"
#include "lleventtimer.h"
#include "llviewerregion.h"
@@ -49,6 +49,7 @@ namespace
class LLEventPollResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(LLEventPollResponder);
public:
static LLHTTPClient::ResponderPtr start(const std::string& pollURL, const LLHost& sender);
@@ -56,19 +57,19 @@ namespace
void makeRequest();
+ /* virtual */ void completedRaw(const LLChannelDescriptors& channels,
+ const LLIOPipe::buffer_ptr_t& buffer);
+
private:
LLEventPollResponder(const std::string& pollURL, const LLHost& sender);
~LLEventPollResponder();
void handleMessage(const LLSD& content);
- virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content);
- virtual void result(const LLSD& content);
- virtual void completedRaw(U32 status,
- const std::string& reason,
- const LLChannelDescriptors& channels,
- const LLIOPipe::buffer_ptr_t& buffer);
+ /* virtual */ void httpFailure();
+ /* virtual */ void httpSuccess();
+
private:
bool mDone;
@@ -109,15 +110,15 @@ namespace
const std::string& pollURL, const LLHost& sender)
{
LLHTTPClient::ResponderPtr result = new LLEventPollResponder(pollURL, sender);
- llinfos << "LLEventPollResponder::start <" << sCount << "> "
- << pollURL << llendl;
+ LL_INFOS() << "LLEventPollResponder::start <" << sCount << "> "
+ << pollURL << LL_ENDL;
return result;
}
void LLEventPollResponder::stop()
{
- llinfos << "LLEventPollResponder::stop <" << mCount << "> "
- << mPollURL << llendl;
+ LL_INFOS() << "LLEventPollResponder::stop <" << mCount << "> "
+ << mPollURL << LL_ENDL;
// there should be a way to stop a LLHTTPClient request in progress
mDone = true;
}
@@ -134,35 +135,33 @@ namespace
LLViewerRegion *regionp = gAgent.getRegion();
if (!regionp)
{
- llerrs << "LLEventPoll initialized before region is added." << llendl;
+ LL_ERRS() << "LLEventPoll initialized before region is added." << LL_ENDL;
}
mSender = sender.getIPandPort();
- llinfos << "LLEventPoll initialized with sender " << mSender << llendl;
+ LL_INFOS() << "LLEventPoll initialized with sender " << mSender << LL_ENDL;
makeRequest();
}
LLEventPollResponder::~LLEventPollResponder()
{
stop();
- lldebugs << "LLEventPollResponder::~Impl <" << mCount << "> "
- << mPollURL << llendl;
+ LL_DEBUGS() << "LLEventPollResponder::~Impl <" << mCount << "> "
+ << mPollURL << LL_ENDL;
}
// virtual
- void LLEventPollResponder::completedRaw(U32 status,
- const std::string& reason,
- const LLChannelDescriptors& channels,
- const LLIOPipe::buffer_ptr_t& buffer)
+ void LLEventPollResponder::completedRaw(const LLChannelDescriptors& channels,
+ const LLIOPipe::buffer_ptr_t& buffer)
{
- if (status == HTTP_BAD_GATEWAY)
+ if (getStatus() == HTTP_BAD_GATEWAY)
{
// These errors are not parsable as LLSD,
// which LLHTTPClient::Responder::completedRaw will try to do.
- completed(status, reason, LLSD());
+ httpCompleted();
}
else
{
- LLHTTPClient::Responder::completedRaw(status,reason,channels,buffer);
+ LLHTTPClient::Responder::completedRaw(channels,buffer);
}
}
@@ -172,8 +171,8 @@ namespace
request["ack"] = mAcknowledge;
request["done"] = mDone;
- lldebugs << "LLEventPollResponder::makeRequest <" << mCount << "> ack = "
- << LLSDXMLStreamer(mAcknowledge) << llendl;
+ LL_DEBUGS() << "LLEventPollResponder::makeRequest <" << mCount << "> ack = "
+ << LLSDXMLStreamer(mAcknowledge) << LL_ENDL;
LLHTTPClient::post(mPollURL, request, this);
}
@@ -187,13 +186,13 @@ namespace
}
//virtual
- void LLEventPollResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+ void LLEventPollResponder::httpFailure()
{
if (mDone) return;
// A HTTP_BAD_GATEWAY (502) error is our standard timeout response
// we get this when there are no events.
- if ( status == HTTP_BAD_GATEWAY )
+ if ( getStatus() == HTTP_BAD_GATEWAY )
{
mErrorCount = 0;
makeRequest();
@@ -207,13 +206,13 @@ namespace
+ mErrorCount * EVENT_POLL_ERROR_RETRY_SECONDS_INC
, this);
- llwarns << "LLEventPollResponder error [status:" << status << "]: " << content << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
}
else
{
- llwarns << "LLEventPollResponder error <" << mCount
- << "> [status:" << status << "]: " << content
- << (mDone ? " -- done" : "") << llendl;
+ LL_WARNS() << dumpResponse()
+ << " [count:" << mCount << "] "
+ << (mDone ? " -- done" : "") << LL_ENDL;
stop();
// At this point we have given up and the viewer will not receive HTTP messages from the simulator.
@@ -227,26 +226,28 @@ namespace
// continue running.
if(gAgent.getRegion() && gAgent.getRegion()->getHost().getIPandPort() == mSender)
{
- llwarns << "Forcing disconnect due to stalled main region event poll." << llendl;
+ LL_WARNS() << "Forcing disconnect due to stalled main region event poll." << LL_ENDL;
LLAppViewer::instance()->forceDisconnect(LLTrans::getString("AgentLostConnection"));
}
}
}
//virtual
- void LLEventPollResponder::result(const LLSD& content)
+ void LLEventPollResponder::httpSuccess()
{
- lldebugs << "LLEventPollResponder::result <" << mCount << ">"
- << (mDone ? " -- done" : "") << llendl;
+ LL_DEBUGS() << "LLEventPollResponder::result <" << mCount << ">"
+ << (mDone ? " -- done" : "") << LL_ENDL;
if (mDone) return;
mErrorCount = 0;
- if (!content.get("events") ||
+ const LLSD& content = getContent();
+ if (!content.isMap() ||
+ !content.get("events") ||
!content.get("id"))
{
- llwarns << "received event poll with no events or id key" << llendl;
+ LL_WARNS() << "received event poll with no events or id key: " << dumpResponse() << LL_ENDL;
makeRequest();
return;
}
@@ -256,12 +257,12 @@ namespace
if(mAcknowledge.isUndefined())
{
- llwarns << "LLEventPollResponder: id undefined" << llendl;
+ LL_WARNS() << "LLEventPollResponder: id undefined" << LL_ENDL;
}
- // was llinfos but now that CoarseRegionUpdate is TCP @ 1/second, it'd be too verbose for viewer logs. -MG
- lldebugs << "LLEventPollResponder::completed <" << mCount << "> " << events.size() << "events (id "
- << LLSDXMLStreamer(mAcknowledge) << ")" << llendl;
+ // was LL_INFOS() but now that CoarseRegionUpdate is TCP @ 1/second, it'd be too verbose for viewer logs. -MG
+ LL_DEBUGS() << "LLEventPollResponder::httpSuccess <" << mCount << "> " << events.size() << "events (id "
+ << LLSDXMLStreamer(mAcknowledge) << ")" << LL_ENDL;
LLSD::array_const_iterator i = events.beginArray();
LLSD::array_const_iterator end = events.endArray();
diff --git a/indra/newview/llexternaleditor.cpp b/indra/newview/llexternaleditor.cpp
index 9480e54809..df9c848cb8 100755
--- a/indra/newview/llexternaleditor.cpp
+++ b/indra/newview/llexternaleditor.cpp
@@ -44,7 +44,7 @@ LLExternalEditor::EErrorCode LLExternalEditor::setCommand(const std::string& env
std::string cmd = findCommand(env_var, override);
if (cmd.empty())
{
- llwarns << "Editor command is empty or not set" << llendl;
+ LL_WARNS() << "Editor command is empty or not set" << LL_ENDL;
return EC_NOT_SPECIFIED;
}
@@ -55,7 +55,7 @@ LLExternalEditor::EErrorCode LLExternalEditor::setCommand(const std::string& env
std::string bin_path = tokens[0];
if (!LLFile::isfile(bin_path))
{
- llwarns << "Editor binary [" << bin_path << "] not found" << llendl;
+ LL_WARNS() << "Editor binary [" << bin_path << "] not found" << LL_ENDL;
return EC_BINARY_NOT_FOUND;
}
@@ -71,10 +71,10 @@ LLExternalEditor::EErrorCode LLExternalEditor::setCommand(const std::string& env
if (cmd.find(sFilenameMarker) == std::string::npos)
{
mProcessParams.args.add(sFilenameMarker);
- llinfos << "Adding the filename marker (" << sFilenameMarker << ")" << llendl;
+ LL_INFOS() << "Adding the filename marker (" << sFilenameMarker << ")" << LL_ENDL;
}
- llinfos << "Setting command [" << mProcessParams << "]" << llendl;
+ LL_INFOS() << "Setting command [" << mProcessParams << "]" << LL_ENDL;
return EC_SUCCESS;
}
@@ -83,7 +83,7 @@ LLExternalEditor::EErrorCode LLExternalEditor::run(const std::string& file_path)
{
if (std::string(mProcessParams.executable).empty() || mProcessParams.args.empty())
{
- llwarns << "Editor command not set" << llendl;
+ LL_WARNS() << "Editor command not set" << LL_ENDL;
return EC_NOT_SPECIFIED;
}
@@ -181,12 +181,12 @@ std::string LLExternalEditor::findCommand(
if (!override.empty()) // try the supplied override first
{
cmd = override;
- llinfos << "Using override" << llendl;
+ LL_INFOS() << "Using override" << LL_ENDL;
}
else if (!LLUI::sSettingGroups["config"]->getString(sSetting).empty())
{
cmd = LLUI::sSettingGroups["config"]->getString(sSetting);
- llinfos << "Using setting" << llendl;
+ LL_INFOS() << "Using setting" << LL_ENDL;
}
else // otherwise use the path specified by the environment variable
{
@@ -194,10 +194,10 @@ std::string LLExternalEditor::findCommand(
if (env_var_val)
{
cmd = env_var_val;
- llinfos << "Using env var " << env_var << llendl;
+ LL_INFOS() << "Using env var " << env_var << LL_ENDL;
}
}
- llinfos << "Found command [" << cmd << "]" << llendl;
+ LL_INFOS() << "Found command [" << cmd << "]" << LL_ENDL;
return cmd;
}
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index ae62be0ad0..32b510b21a 100755
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -220,7 +220,7 @@ void LLFace::destroy()
}
setDrawInfo(NULL);
-
+
mDrawablep = NULL;
mVObjp = NULL;
}
@@ -233,7 +233,7 @@ void LLFace::initClass()
void LLFace::setWorldMatrix(const LLMatrix4 &mat)
{
- llerrs << "Faces on this drawable are not independently modifiable\n" << llendl;
+ LL_ERRS() << "Faces on this drawable are not independently modifiable\n" << LL_ENDL;
}
void LLFace::setPool(LLFacePool* pool)
@@ -245,7 +245,7 @@ void LLFace::setPool(LLFacePool* new_pool, LLViewerTexture *texturep)
{
if (!new_pool)
{
- llerrs << "Setting pool to null!" << llendl;
+ LL_ERRS() << "Setting pool to null!" << LL_ENDL;
}
if (new_pool != mDrawPoolp)
@@ -355,7 +355,7 @@ void LLFace::switchTexture(U32 ch, LLViewerTexture* new_texture)
if(!new_texture)
{
- llerrs << "Can not switch to a null texture." << llendl;
+ LL_ERRS() << "Can not switch to a null texture." << LL_ENDL;
return;
}
@@ -365,7 +365,7 @@ void LLFace::switchTexture(U32 ch, LLViewerTexture* new_texture)
if (ch == LLRender::DIFFUSE_MAP)
{
- getViewerObject()->changeTEImage(mTEOffset, new_texture) ;
+ getViewerObject()->changeTEImage(mTEOffset, new_texture) ;
}
setTexture(ch, new_texture) ;
@@ -437,7 +437,7 @@ void LLFace::setTextureIndex(U8 index)
{
if (mDrawInfo && !mDrawInfo->mTextureList.empty())
{
- llerrs << "Face with no texture index references indexed texture draw info." << llendl;
+ LL_ERRS() << "Face with no texture index references indexed texture draw info." << LL_ENDL;
}
}
}
@@ -629,29 +629,29 @@ void LLFace::setDrawInfo(LLDrawInfo* draw_info)
void LLFace::printDebugInfo() const
{
LLFacePool *poolp = getPool();
- llinfos << "Object: " << getViewerObject()->mID << llendl;
+ LL_INFOS() << "Object: " << getViewerObject()->mID << LL_ENDL;
if (getDrawable())
{
- llinfos << "Type: " << LLPrimitive::pCodeToString(getDrawable()->getVObj()->getPCode()) << llendl;
+ LL_INFOS() << "Type: " << LLPrimitive::pCodeToString(getDrawable()->getVObj()->getPCode()) << LL_ENDL;
}
if (getTexture())
{
- llinfos << "Texture: " << getTexture() << " Comps: " << (U32)getTexture()->getComponents() << llendl;
+ LL_INFOS() << "Texture: " << getTexture() << " Comps: " << (U32)getTexture()->getComponents() << LL_ENDL;
}
else
{
- llinfos << "No texture: " << llendl;
+ LL_INFOS() << "No texture: " << LL_ENDL;
}
- llinfos << "Face: " << this << llendl;
- llinfos << "State: " << getState() << llendl;
- llinfos << "Geom Index Data:" << llendl;
- llinfos << "--------------------" << llendl;
- llinfos << "GI: " << mGeomIndex << " Count:" << mGeomCount << llendl;
- llinfos << "Face Index Data:" << llendl;
- llinfos << "--------------------" << llendl;
- llinfos << "II: " << mIndicesIndex << " Count:" << mIndicesCount << llendl;
- llinfos << llendl;
+ LL_INFOS() << "Face: " << this << LL_ENDL;
+ LL_INFOS() << "State: " << getState() << LL_ENDL;
+ LL_INFOS() << "Geom Index Data:" << LL_ENDL;
+ LL_INFOS() << "--------------------" << LL_ENDL;
+ LL_INFOS() << "GI: " << mGeomIndex << " Count:" << mGeomCount << LL_ENDL;
+ LL_INFOS() << "Face Index Data:" << LL_ENDL;
+ LL_INFOS() << "--------------------" << LL_ENDL;
+ LL_INFOS() << "II: " << mIndicesIndex << " Count:" << mIndicesCount << LL_ENDL;
+ LL_INFOS() << LL_ENDL;
if (poolp)
{
@@ -664,20 +664,20 @@ void LLFace::printDebugInfo() const
LLFace *facep = *iter;
if (facep == this)
{
- llinfos << "Pool reference: " << pool_references << llendl;
+ LL_INFOS() << "Pool reference: " << pool_references << LL_ENDL;
pool_references++;
}
}
if (pool_references != 1)
{
- llinfos << "Incorrect number of pool references!" << llendl;
+ LL_INFOS() << "Incorrect number of pool references!" << LL_ENDL;
}
}
#if 0
- llinfos << "Indices:" << llendl;
- llinfos << "--------------------" << llendl;
+ LL_INFOS() << "Indices:" << LL_ENDL;
+ LL_INFOS() << "--------------------" << LL_ENDL;
const U32 *indicesp = getRawIndices();
S32 indices_count = getIndicesCount();
@@ -685,17 +685,17 @@ void LLFace::printDebugInfo() const
for (S32 i = 0; i < indices_count; i++)
{
- llinfos << i << ":" << indicesp[i] << ":" << (S32)(indicesp[i] - geom_start) << llendl;
+ LL_INFOS() << i << ":" << indicesp[i] << ":" << (S32)(indicesp[i] - geom_start) << LL_ENDL;
}
- llinfos << llendl;
+ LL_INFOS() << LL_ENDL;
- llinfos << "Vertices:" << llendl;
- llinfos << "--------------------" << llendl;
+ LL_INFOS() << "Vertices:" << LL_ENDL;
+ LL_INFOS() << "--------------------" << LL_ENDL;
for (S32 i = 0; i < mGeomCount; i++)
{
- llinfos << mGeomIndex + i << ":" << poolp->getVertex(mGeomIndex + i) << llendl;
+ LL_INFOS() << mGeomIndex + i << ":" << poolp->getVertex(mGeomIndex + i) << LL_ENDL;
}
- llinfos << llendl;
+ LL_INFOS() << LL_ENDL;
#endif
}
@@ -798,7 +798,7 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f,
if (f >= volume.getNumVolumeFaces())
{
- llwarns << "Generating bounding box for invalid face index!" << llendl;
+ LL_WARNS() << "Generating bounding box for invalid face index!" << LL_ENDL;
f = 0;
}
@@ -828,7 +828,7 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f,
mask[4].setElement<2>();
mask[5].setElement<0>(); //110
mask[5].setElement<1>();
-
+
LLVector4a v[8];
v[6] = min;
@@ -928,7 +928,7 @@ LLVector2 LLFace::surfaceToTexture(LLVector2 surface_coord, const LLVector4a& po
if (texgen == LLTextureEntry::TEX_GEN_PLANAR)
{
planarProjection(tc, volume_normal, center, volume_position);
- }
+ }
}
if (mTextureMatrix) // if we have a texture matrix, use it
@@ -1081,12 +1081,12 @@ bool LLFace::canRenderAsMask()
}
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_VOLUME("Volume VB Cache");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_VOLUME("Volume VB Cache");
//static
void LLFace::cacheFaceInVRAM(const LLVolumeFace& vf)
{
- LLFastTimer t(FTM_FACE_GEOM_VOLUME);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_VOLUME);
U32 mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 |
LLVertexBuffer::MAP_TANGENT | LLVertexBuffer::MAP_NORMAL;
@@ -1148,33 +1148,33 @@ void push_for_transform(LLVertexBuffer* buff, U32 source_count, U32 dest_count)
}
}
-static LLFastTimer::DeclareTimer FTM_FACE_GET_GEOM("Face Geom");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_POSITION("Position");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_NORMAL("Normal");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_TEXTURE("Texture");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_COLOR("Color");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_EMISSIVE("Emissive");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_WEIGHTS("Weights");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_TANGENT("Binormal");
-
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_FEEDBACK("Face Feedback");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_FEEDBACK_POSITION("Feedback Position");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_FEEDBACK_NORMAL("Feedback Normal");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_FEEDBACK_TEXTURE("Feedback Texture");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_FEEDBACK_COLOR("Feedback Color");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_FEEDBACK_EMISSIVE("Feedback Emissive");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_FEEDBACK_BINORMAL("Feedback Binormal");
-
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_INDEX("Index");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_INDEX_TAIL("Tail");
-static LLFastTimer::DeclareTimer FTM_FACE_POSITION_STORE("Pos");
-static LLFastTimer::DeclareTimer FTM_FACE_TEXTURE_INDEX_STORE("TexIdx");
-static LLFastTimer::DeclareTimer FTM_FACE_POSITION_PAD("Pad");
-static LLFastTimer::DeclareTimer FTM_FACE_TEX_DEFAULT("Default");
-static LLFastTimer::DeclareTimer FTM_FACE_TEX_QUICK("Quick");
-static LLFastTimer::DeclareTimer FTM_FACE_TEX_QUICK_NO_XFORM("No Xform");
-static LLFastTimer::DeclareTimer FTM_FACE_TEX_QUICK_XFORM("Xform");
-static LLFastTimer::DeclareTimer FTM_FACE_TEX_QUICK_PLANAR("Quick Planar");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GET_GEOM("Face Geom");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_POSITION("Position");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_NORMAL("Normal");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_TEXTURE("Texture");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_COLOR("Color");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_EMISSIVE("Emissive");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_WEIGHTS("Weights");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_TANGENT("Binormal");
+
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_FEEDBACK("Face Feedback");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_FEEDBACK_POSITION("Feedback Position");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_FEEDBACK_NORMAL("Feedback Normal");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_FEEDBACK_TEXTURE("Feedback Texture");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_FEEDBACK_COLOR("Feedback Color");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_FEEDBACK_EMISSIVE("Feedback Emissive");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_FEEDBACK_BINORMAL("Feedback Binormal");
+
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_INDEX("Index");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_INDEX_TAIL("Tail");
+static LLTrace::BlockTimerStatHandle FTM_FACE_POSITION_STORE("Pos");
+static LLTrace::BlockTimerStatHandle FTM_FACE_TEXTURE_INDEX_STORE("TexIdx");
+static LLTrace::BlockTimerStatHandle FTM_FACE_POSITION_PAD("Pad");
+static LLTrace::BlockTimerStatHandle FTM_FACE_TEX_DEFAULT("Default");
+static LLTrace::BlockTimerStatHandle FTM_FACE_TEX_QUICK("Quick");
+static LLTrace::BlockTimerStatHandle FTM_FACE_TEX_QUICK_NO_XFORM("No Xform");
+static LLTrace::BlockTimerStatHandle FTM_FACE_TEX_QUICK_XFORM("Xform");
+static LLTrace::BlockTimerStatHandle FTM_FACE_TEX_QUICK_PLANAR("Quick Planar");
BOOL LLFace::getGeometryVolume(const LLVolume& volume,
const S32 &f,
@@ -1182,7 +1182,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
const U16 &index_offset,
bool force_rebuild)
{
- LLFastTimer t(FTM_FACE_GET_GEOM);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GET_GEOM);
llassert(verify());
const LLVolumeFace &vf = volume.getVolumeFace(f);
S32 num_vertices = (S32)vf.mNumVertices;
@@ -1203,13 +1203,13 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
{
if (gDebugGL)
{
- llwarns << "Index buffer overflow!" << llendl;
- llwarns << "Indices Count: " << mIndicesCount
+ LL_WARNS() << "Index buffer overflow!" << LL_ENDL;
+ LL_WARNS() << "Indices Count: " << mIndicesCount
<< " VF Num Indices: " << num_indices
<< " Indices Index: " << mIndicesIndex
- << " VB Num Indices: " << mVertexBuffer->getNumIndices() << llendl;
- llwarns << " Face Index: " << f
- << " Pool Type: " << mPoolType << llendl;
+ << " VB Num Indices: " << mVertexBuffer->getNumIndices() << LL_ENDL;
+ LL_WARNS() << " Face Index: " << f
+ << " Pool Type: " << mPoolType << LL_ENDL;
}
return FALSE;
}
@@ -1218,7 +1218,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
{
if (gDebugGL)
{
- llwarns << "Vertex buffer overflow!" << llendl;
+ LL_WARNS() << "Vertex buffer overflow!" << LL_ENDL;
}
return FALSE;
}
@@ -1278,7 +1278,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
{ //decide if shiny goes in alpha channel of color
if (tep &&
getPoolType() != LLDrawPool::POOL_ALPHA) // <--- alpha channel MUST contain transparency, not shiny
- {
+ {
LLMaterial* mat = tep->getMaterialParams().get();
bool shiny_in_alpha = false;
@@ -1299,15 +1299,15 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
}
if (shiny_in_alpha)
- {
+ {
- GLfloat alpha[4] =
- {
- 0.00f,
- 0.25f,
- 0.5f,
- 0.75f
- };
+ GLfloat alpha[4] =
+ {
+ 0.00f,
+ 0.25f,
+ 0.5f,
+ 0.75f
+ };
llassert(tep->getShiny() <= 3);
color.mV[3] = U8 (alpha[tep->getShiny()] * 255);
@@ -1318,7 +1318,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
// INDICES
if (full_rebuild)
{
- LLFastTimer t(FTM_FACE_GEOM_INDEX);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_INDEX);
mVertexBuffer->getIndexStrider(indicesp, mIndicesIndex, mIndicesCount, map_range);
volatile __m128i* dst = (__m128i*) indicesp.get();
@@ -1334,7 +1334,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
}
{
- LLFastTimer t(FTM_FACE_GEOM_INDEX_TAIL);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_INDEX_TAIL);
U16* idx = (U16*) dst;
for (S32 i = end*8; i < num_indices; ++i)
@@ -1397,7 +1397,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
!volume.isUnique()) //source volume is NOT flexi
{ //use transform feedback to pack vertex buffer
//gGLDebugLoggingEnabled = TRUE;
- LLFastTimer t(FTM_FACE_GEOM_FEEDBACK);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_FEEDBACK);
LLGLEnable discard(GL_RASTERIZER_DISCARD);
LLVertexBuffer* buff = (LLVertexBuffer*) vf.mVertexBuffer.get();
@@ -1415,7 +1415,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_pos)
{
- LLFastTimer t(FTM_FACE_GEOM_FEEDBACK_POSITION);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_FEEDBACK_POSITION);
gTransformPositionProgram.bind();
mVertexBuffer->bindForFeedback(0, LLVertexBuffer::TYPE_VERTEX, mGeomIndex, mGeomCount);
@@ -1440,7 +1440,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_color)
{
- LLFastTimer t(FTM_FACE_GEOM_FEEDBACK_COLOR);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_FEEDBACK_COLOR);
gTransformColorProgram.bind();
mVertexBuffer->bindForFeedback(0, LLVertexBuffer::TYPE_COLOR, mGeomIndex, mGeomCount);
@@ -1456,7 +1456,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_emissive)
{
- LLFastTimer t(FTM_FACE_GEOM_FEEDBACK_EMISSIVE);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_FEEDBACK_EMISSIVE);
gTransformColorProgram.bind();
mVertexBuffer->bindForFeedback(0, LLVertexBuffer::TYPE_EMISSIVE, mGeomIndex, mGeomCount);
@@ -1477,7 +1477,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_normal)
{
- LLFastTimer t(FTM_FACE_GEOM_FEEDBACK_NORMAL);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_FEEDBACK_NORMAL);
gTransformNormalProgram.bind();
mVertexBuffer->bindForFeedback(0, LLVertexBuffer::TYPE_NORMAL, mGeomIndex, mGeomCount);
@@ -1490,7 +1490,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_tangent)
{
- LLFastTimer t(FTM_FACE_GEOM_TANGENT);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_TANGENT);
gTransformTangentProgram.bind();
mVertexBuffer->bindForFeedback(0, LLVertexBuffer::TYPE_TANGENT, mGeomIndex, mGeomCount);
@@ -1503,7 +1503,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_tcoord)
{
- LLFastTimer t(FTM_FACE_GEOM_FEEDBACK_TEXTURE);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_FEEDBACK_TEXTURE);
gTransformTexCoordProgram.bind();
mVertexBuffer->bindForFeedback(0, LLVertexBuffer::TYPE_TEXCOORD0, mGeomIndex, mGeomCount);
@@ -1542,7 +1542,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_tcoord)
{
- LLFastTimer t(FTM_FACE_GEOM_TEXTURE);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_TEXTURE);
//bump setup
LLVector4a binormal_dir( -sin_ang, cos_ang, 0.f );
@@ -1613,8 +1613,8 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
bool tex_anim = false;
- LLVOVolume* vobj = (LLVOVolume*) (LLViewerObject*) mVObjp;
- tex_mode = vobj->mTexAnimMode;
+ LLVOVolume* vobj = (LLVOVolume*) (LLViewerObject*) mVObjp;
+ tex_mode = vobj->mTexAnimMode;
if (vobj->mTextureAnimp)
{ //texture animation is in play, override specular and normal map tex coords with diffuse texcoords
@@ -1637,8 +1637,8 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
do_xform = false;
}
-
- if (getVirtualSize() >= MIN_TEX_ANIM_SIZE)
+
+ if (getVirtualSize() >= MIN_TEX_ANIM_SIZE || isState(LLFace::RIGGED))
{ //don't override texture transform during tc bake
tex_mode = 0;
}
@@ -1658,25 +1658,25 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
}
bool do_tex_mat = tex_mode && mTextureMatrix;
-
+
if (!do_bump)
{ //not bump mapped, might be able to do a cheap update
mVertexBuffer->getTexCoord0Strider(tex_coords0, mGeomIndex, mGeomCount);
if (texgen != LLTextureEntry::TEX_GEN_PLANAR)
{
- LLFastTimer t(FTM_FACE_TEX_QUICK);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_TEX_QUICK);
if (!do_tex_mat)
{
if (!do_xform)
{
- LLFastTimer t(FTM_FACE_TEX_QUICK_NO_XFORM);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_TEX_QUICK_NO_XFORM);
S32 tc_size = (num_vertices*2*sizeof(F32)+0xF) & ~0xF;
LLVector4a::memcpyNonAliased16((F32*) tex_coords0.get(), (F32*) vf.mTexCoords, tc_size);
}
else
{
- LLFastTimer t(FTM_FACE_TEX_QUICK_XFORM);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_TEX_QUICK_XFORM);
F32* dst = (F32*) tex_coords0.get();
LLVector4a* src = (LLVector4a*) vf.mTexCoords;
@@ -1729,7 +1729,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
}
else
{ //no bump, tex gen planar
- LLFastTimer t(FTM_FACE_TEX_QUICK_PLANAR);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_TEX_QUICK_PLANAR);
if (do_tex_mat)
{
for (S32 i = 0; i < num_vertices; i++)
@@ -1774,10 +1774,10 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
}
else
{ //bump mapped or has material, just do the whole expensive loop
- LLFastTimer t(FTM_FACE_TEX_DEFAULT);
-
- std::vector<LLVector2> bump_tc;
+ LL_RECORD_BLOCK_TIME(FTM_FACE_TEX_DEFAULT);
+ std::vector<LLVector2> bump_tc;
+
if (mat && !mat->getNormalID().isNull())
{ //writing out normal and specular texture coordinates, not bump offsets
do_bump = false;
@@ -1834,45 +1834,45 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
}
- for (S32 i = 0; i < num_vertices; i++)
- {
- LLVector2 tc(vf.mTexCoords[i]);
+ for (S32 i = 0; i < num_vertices; i++)
+ {
+ LLVector2 tc(vf.mTexCoords[i]);
- LLVector4a& norm = vf.mNormals[i];
+ LLVector4a& norm = vf.mNormals[i];
- LLVector4a& center = *(vf.mCenter);
+ LLVector4a& center = *(vf.mCenter);
- if (texgen != LLTextureEntry::TEX_GEN_DEFAULT)
- {
- LLVector4a vec = vf.mPositions[i];
+ if (texgen != LLTextureEntry::TEX_GEN_DEFAULT)
+ {
+ LLVector4a vec = vf.mPositions[i];
- vec.mul(scalea);
+ vec.mul(scalea);
if (texgen == LLTextureEntry::TEX_GEN_PLANAR)
- {
+ {
planarProjection(tc, norm, center, vec);
- }
- }
+ }
+ }
- if (tex_mode && mTextureMatrix)
- {
- LLVector3 tmp(tc.mV[0], tc.mV[1], 0.f);
- tmp = tmp * *mTextureMatrix;
- tc.mV[0] = tmp.mV[0];
- tc.mV[1] = tmp.mV[1];
- }
- else
- {
- xform(tc, cos_ang, sin_ang, os, ot, ms, mt);
- }
+ if (tex_mode && mTextureMatrix)
+ {
+ LLVector3 tmp(tc.mV[0], tc.mV[1], 0.f);
+ tmp = tmp * *mTextureMatrix;
+ tc.mV[0] = tmp.mV[0];
+ tc.mV[1] = tmp.mV[1];
+ }
+ else
+ {
+ xform(tc, cos_ang, sin_ang, os, ot, ms, mt);
+ }
*dst++ = tc;
- if (do_bump)
- {
- bump_tc.push_back(tc);
- }
+ if (do_bump)
+ {
+ bump_tc.push_back(tc);
}
}
+ }
if (map_range)
{
@@ -1890,7 +1890,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
LLVector4a binorm;
binorm.setCross3(vf.mNormals[i], tangent);
binorm.mul(tangent.getF32ptr()[3]);
-
+
LLMatrix4a tangent_to_object;
tangent_to_object.setRows(tangent, binorm, vf.mNormals[i]);
LLVector4a t;
@@ -1932,7 +1932,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
LLVector4a* end = src+num_vertices;
//LLVector4a* end_64 = end-4;
- //LLFastTimer t(FTM_FACE_GEOM_POSITION);
+ //LL_RECORD_TIME_BLOCK(FTM_FACE_GEOM_POSITION);
llassert(num_vertices > 0);
mVertexBuffer->getVertexStrider(vert, mGeomIndex, mGeomCount, map_range);
@@ -1970,7 +1970,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
LLVector4a tmp;
{
- //LLFastTimer t2(FTM_FACE_POSITION_STORE);
+ //LL_RECORD_TIME_BLOCK(FTM_FACE_POSITION_STORE);
/*if (num_vertices > 4)
{ //more than 64 bytes
@@ -2010,7 +2010,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
}
{
- //LLFastTimer t(FTM_FACE_POSITION_PAD);
+ //LL_RECORD_TIME_BLOCK(FTM_FACE_POSITION_PAD);
while (dst < end_f32)
{
res0.store4a((F32*) dst);
@@ -2027,7 +2027,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_normal)
{
- //LLFastTimer t(FTM_FACE_GEOM_NORMAL);
+ //LL_RECORD_TIME_BLOCK(FTM_FACE_GEOM_NORMAL);
mVertexBuffer->getNormalStrider(norm, mGeomIndex, mGeomCount, map_range);
F32* normals = (F32*) norm.get();
LLVector4a* src = vf.mNormals;
@@ -2049,7 +2049,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_tangent)
{
- LLFastTimer t(FTM_FACE_GEOM_TANGENT);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_TANGENT);
mVertexBuffer->getTangentStrider(tangent, mGeomIndex, mGeomCount, map_range);
F32* tangents = (F32*) tangent.get();
@@ -2082,7 +2082,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_weights && vf.mWeights)
{
- LLFastTimer t(FTM_FACE_GEOM_WEIGHTS);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_WEIGHTS);
mVertexBuffer->getWeight4Strider(wght, mGeomIndex, mGeomCount, map_range);
F32* weights = (F32*) wght.get();
LLVector4a::memcpyNonAliased16(weights, (F32*) vf.mWeights, num_vertices*4*sizeof(F32));
@@ -2094,7 +2094,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_color && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_COLOR) )
{
- LLFastTimer t(FTM_FACE_GEOM_COLOR);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_COLOR);
mVertexBuffer->getColorStrider(colors, mGeomIndex, mGeomCount, map_range);
LLVector4a src;
@@ -2125,7 +2125,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_emissive)
{
- LLFastTimer t(FTM_FACE_GEOM_EMISSIVE);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_EMISSIVE);
LLStrider<LLColor4U> emissive;
mVertexBuffer->getEmissiveStrider(emissive, mGeomIndex, mGeomCount, map_range);
@@ -2137,7 +2137,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
LLColor4U glow4u = LLColor4U(0,0,0,glow);
U32 glow32 = glow4u.mAll;
-
+
U32 vec[4];
vec[0] = vec[1] = vec[2] = vec[3] = glow32;
@@ -2282,7 +2282,7 @@ BOOL LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius)
dist *= 16.f;
}
- lookAt.normalize3fast();
+ lookAt.normalize3fast() ;
//get area of circle around node
F32 app_angle = atanf((F32) sqrt(size_squared) / dist);
@@ -2382,8 +2382,6 @@ F32 LLFace::calcImportanceToCamera(F32 cos_angle_to_view_dir, F32 dist)
return 0.f ;
}
- //F32 camera_relative_speed = camera_moving_speed * (lookAt * LLViewerCamera::getInstance()->getVelocityDir()) ;
-
S32 i = 0 ;
for(i = 0; i < FACE_IMPORTANCE_LEVEL && dist > FACE_IMPORTANCE_TO_CAMERA_OVER_DISTANCE[i][0]; ++i);
i = llmin(i, FACE_IMPORTANCE_LEVEL - 1) ;
@@ -2432,7 +2430,7 @@ BOOL LLFace::verify(const U32* indices_array) const
if ((mGeomIndex + mGeomCount) > mVertexBuffer->getNumVerts())
{
ok = FALSE;
- llinfos << "Face references invalid vertices!" << llendl;
+ LL_INFOS() << "Face references invalid vertices!" << LL_ENDL;
}
S32 indices_count = (S32)getIndicesCount();
@@ -2445,13 +2443,13 @@ BOOL LLFace::verify(const U32* indices_array) const
if (indices_count > LL_MAX_INDICES_COUNT)
{
ok = FALSE;
- llinfos << "Face has bogus indices count" << llendl;
+ LL_INFOS() << "Face has bogus indices count" << LL_ENDL;
}
if (mIndicesIndex + mIndicesCount > mVertexBuffer->getNumIndices())
{
ok = FALSE;
- llinfos << "Face references invalid indices!" << llendl;
+ LL_INFOS() << "Face references invalid indices!" << LL_ENDL;
}
#if 0
@@ -2465,14 +2463,14 @@ BOOL LLFace::verify(const U32* indices_array) const
S32 delta = indicesp[i] - geom_start;
if (0 > delta)
{
- llwarns << "Face index too low!" << llendl;
- llinfos << "i:" << i << " Index:" << indicesp[i] << " GStart: " << geom_start << llendl;
+ LL_WARNS() << "Face index too low!" << LL_ENDL;
+ LL_INFOS() << "i:" << i << " Index:" << indicesp[i] << " GStart: " << geom_start << LL_ENDL;
ok = FALSE;
}
else if (delta >= geom_count)
{
- llwarns << "Face index too high!" << llendl;
- llinfos << "i:" << i << " Index:" << indicesp[i] << " GEnd: " << geom_start + geom_count << llendl;
+ LL_WARNS() << "Face index too high!" << LL_ENDL;
+ LL_INFOS() << "i:" << i << " Index:" << indicesp[i] << " GEnd: " << geom_start + geom_count << LL_ENDL;
ok = FALSE;
}
}
diff --git a/indra/newview/llface.h b/indra/newview/llface.h
index c9037ce1eb..d3a561facc 100755
--- a/indra/newview/llface.h
+++ b/indra/newview/llface.h
@@ -28,7 +28,6 @@
#define LL_LLFACE_H
#include "llstrider.h"
-
#include "llrender.h"
#include "v2math.h"
#include "v3math.h"
@@ -37,7 +36,6 @@
#include "v4coloru.h"
#include "llquaternion.h"
#include "xform.h"
-#include "lldarrayptr.h"
#include "llvertexbuffer.h"
#include "llviewertexture.h"
#include "lldrawable.h"
@@ -49,33 +47,24 @@ class LLTextureEntry;
class LLVertexProgram;
class LLViewerTexture;
class LLGeometryManager;
+class LLTextureAtlasSlot;
+class LLDrawInfo;
const F32 MIN_ALPHA_SIZE = 1024.f;
const F32 MIN_TEX_ANIM_SIZE = 512.f;
-class LLFace
+class LLFace : public LLTrace::MemTrackableNonVirtual<LLFace, 16>
{
public:
-
- void* operator new(size_t size)
- {
- return ll_aligned_malloc_16(size);
- }
-
- void operator delete(void* ptr)
- {
- ll_aligned_free_16(ptr);
- }
-
-
LLFace(const LLFace& rhs)
+ : LLTrace::MemTrackableNonVirtual<LLFace, 16>("LLFace")
{
*this = rhs;
}
const LLFace& operator=(const LLFace& rhs)
{
- llerrs << "Illegal operation!" << llendl;
+ LL_ERRS() << "Illegal operation!" << LL_ENDL;
return *this;
}
@@ -96,7 +85,11 @@ public:
static void cacheFaceInVRAM(const LLVolumeFace& vf);
public:
- LLFace(LLDrawable* drawablep, LLViewerObject* objp) { init(drawablep, objp); }
+ LLFace(LLDrawable* drawablep, LLViewerObject* objp)
+ : LLTrace::MemTrackableNonVirtual<LLFace, 16>("LLFace")
+ {
+ init(drawablep, objp);
+ }
~LLFace() { destroy(); }
const LLMatrix4& getWorldMatrix() const { return mVObjp->getWorldMatrix(mXform); }
diff --git a/indra/newview/llface.inl b/indra/newview/llface.inl
index 85c35a88f3..c37b77d2cd 100755
--- a/indra/newview/llface.inl
+++ b/indra/newview/llface.inl
@@ -77,7 +77,7 @@ inline S32 LLFace::getColors (LLStrider<LLColor4U> &colors)
if (!mBackupMem)
{
printDebugInfo();
- llerrs << "No backup memory for face" << llendl;
+ LL_ERRS() << "No backup memory for face" << LL_ENDL;
}
colorp = (LLColor4U*)(mBackupMem + (4 * mIndicesCount) + (mGeomCount * mDrawPoolp->getStride()));
colors = colorp;
@@ -89,7 +89,7 @@ inline S32 LLFace::getColors (LLStrider<LLColor4U> &colors)
if (!mDrawPoolp->getColorStrider(colors, mGeomIndex))
{
printDebugInfo();
- llerrs << "No color pointer for a color strider!" << llendl;
+ LL_ERRS() << "No color pointer for a color strider!" << LL_ENDL;
}
mDrawPoolp->setDirtyColors();
return mGeomIndex;
@@ -107,7 +107,7 @@ inline S32 LLFace::getTexCoords (LLStrider<LLVector2> &texCoords, S32 pass )
if (!mBackupMem)
{
printDebugInfo();
- llerrs << "No backup memory for face" << llendl;
+ LL_ERRS() << "No backup memory for face" << LL_ENDL;
}
texCoords = (LLVector2*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_TEX_COORDS0 + pass]);
texCoords.setStride( mDrawPoolp->getStride());
diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 9a20ce8f1b..28319564e4 100644..100755
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -28,6 +28,8 @@
#include "llviewerprecompiledheaders.h"
#include "llfacebookconnect.h"
+#include "llflickrconnect.h"
+#include "lltwitterconnect.h"
#include "llagent.h"
#include "llcallingcard.h" // for LLAvatarTracker
@@ -58,7 +60,7 @@ void log_facebook_connect_error(const std::string& request, U32 status, const st
}
}
-void toast_user_for_success()
+void toast_user_for_facebook_success()
{
LLSD args;
args["MESSAGE"] = LLTrans::getString("facebook_post_success");
@@ -74,23 +76,46 @@ public:
bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web)
{
- if (tokens.size() > 0)
+ if (tokens.size() >= 1)
{
if (tokens[0].asString() == "connect")
{
- // this command probably came from the fbc_web browser, so close it
- LLFloater* fbc_web = LLFloaterReg::getInstance("fbc_web");
- if (fbc_web)
+ if (tokens.size() >= 2 && tokens[1].asString() == "flickr")
{
- fbc_web->closeFloater();
+ // this command probably came from the flickr_web browser, so close it
+ LLFloaterReg::hideInstance("flickr_web");
+
+ // connect to flickr
+ if (query_map.has("oauth_token"))
+ {
+ LLFlickrConnect::instance().connectToFlickr(query_map["oauth_token"], query_map.get("oauth_verifier"));
+ }
+ return true;
}
-
- // connect to facebook
- if (query_map.has("code"))
+ else if (tokens.size() >= 2 && tokens[1].asString() == "twitter")
+ {
+ // this command probably came from the twitter_web browser, so close it
+ LLFloaterReg::hideInstance("twitter_web");
+
+ // connect to twitter
+ if (query_map.has("oauth_token"))
+ {
+ LLTwitterConnect::instance().connectToTwitter(query_map["oauth_token"], query_map.get("oauth_verifier"));
+ }
+ return true;
+ }
+ else //if (tokens.size() >= 2 && tokens[1].asString() == "facebook")
{
- LLFacebookConnect::instance().connectToFacebook(query_map["code"], query_map.get("state"));
+ // this command probably came from the fbc_web browser, so close it
+ LLFloaterReg::hideInstance("fbc_web");
+
+ // connect to facebook
+ if (query_map.has("code"))
+ {
+ LLFacebookConnect::instance().connectToFacebook(query_map["code"], query_map.get("state"));
+ }
+ return true;
}
- return true;
}
}
return false;
@@ -110,28 +135,36 @@ public:
LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS);
}
- virtual void completed(U32 status, const std::string& reason, const LLSD& content)
+ /* virtual */ void httpSuccess()
+ {
+ LL_DEBUGS("FacebookConnect") << "Connect successful. " << dumpResponse() << LL_ENDL;
+ LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED);
+ }
+
+ /* virtual */ void httpFailure()
{
- if (isGoodStatus(status))
+ if ( HTTP_FOUND == getStatus() )
{
- LL_DEBUGS("FacebookConnect") << "Connect successful. content: " << content << LL_ENDL;
-
- LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED);
+ const std::string& location = getResponseHeader(HTTP_IN_HEADER_LOCATION);
+ if (location.empty())
+ {
+ LL_WARNS("FacebookConnect") << "Missing Location header " << dumpResponse()
+ << "[headers:" << getResponseHeaders() << "]" << LL_ENDL;
+ }
+ else
+ {
+ LLFacebookConnect::instance().openFacebookWeb(location);
+ }
}
- else if (status != 302)
+ else
{
- LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_FAILED);
- log_facebook_connect_error("Connect", status, reason, content.get("error_code"), content.get("error_description"));
+ LL_WARNS("FacebookConnect") << dumpResponse() << LL_ENDL;
+ LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_FAILED);
+ const LLSD& content = getContent();
+ log_facebook_connect_error("Connect", getStatus(), getReason(),
+ content.get("error_code"), content.get("error_description"));
}
}
-
- void completedHeader(U32 status, const std::string& reason, const LLSD& content)
- {
- if (status == 302)
- {
- LLFacebookConnect::instance().openFacebookWeb(content["location"]);
- }
- }
};
///////////////////////////////////////////////////////////////////////////////
@@ -145,34 +178,42 @@ public:
{
LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_POSTING);
}
-
- virtual void completed(U32 status, const std::string& reason, const LLSD& content)
+
+ /* virtual */ void httpSuccess()
{
- if (isGoodStatus(status))
+ toast_user_for_facebook_success();
+ LL_DEBUGS("FacebookConnect") << "Post successful. " << dumpResponse() << LL_ENDL;
+ LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_POSTED);
+ }
+
+ /* virtual */ void httpFailure()
+ {
+ if ( HTTP_FOUND == getStatus() )
{
- toast_user_for_success();
- LL_DEBUGS("FacebookConnect") << "Post successful. content: " << content << LL_ENDL;
-
- LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_POSTED);
+ const std::string& location = getResponseHeader(HTTP_IN_HEADER_LOCATION);
+ if (location.empty())
+ {
+ LL_WARNS("FacebookConnect") << "Missing Location header " << dumpResponse()
+ << "[headers:" << getResponseHeaders() << "]" << LL_ENDL;
+ }
+ else
+ {
+ LLFacebookConnect::instance().openFacebookWeb(location);
+ }
}
- else if (status == 404)
+ else if ( HTTP_NOT_FOUND == getStatus() )
{
LLFacebookConnect::instance().connectToFacebook();
}
else
{
- LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_POST_FAILED);
- log_facebook_connect_error("Share", status, reason, content.get("error_code"), content.get("error_description"));
+ LL_WARNS("FacebookConnect") << dumpResponse() << LL_ENDL;
+ LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_POST_FAILED);
+ const LLSD& content = getContent();
+ log_facebook_connect_error("Share", getStatus(), getReason(),
+ content.get("error_code"), content.get("error_description"));
}
}
-
- void completedHeader(U32 status, const std::string& reason, const LLSD& content)
- {
- if (status == 302)
- {
- LLFacebookConnect::instance().openFacebookWeb(content["location"]);
- }
- }
};
///////////////////////////////////////////////////////////////////////////////
@@ -196,24 +237,27 @@ public:
LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED);
}
- virtual void completed(U32 status, const std::string& reason, const LLSD& content)
+ /* virtual */ void httpSuccess()
{
- if (isGoodStatus(status))
- {
- LL_DEBUGS("FacebookConnect") << "Disconnect successful. content: " << content << LL_ENDL;
- setUserDisconnected();
+ LL_DEBUGS("FacebookConnect") << "Disconnect successful. " << dumpResponse() << LL_ENDL;
+ setUserDisconnected();
+ }
- }
+ /* virtual */ void httpFailure()
+ {
//User not found so already disconnected
- else if(status == 404)
+ if ( HTTP_NOT_FOUND == getStatus() )
{
- LL_DEBUGS("FacebookConnect") << "Already disconnected. content: " << content << LL_ENDL;
+ LL_DEBUGS("FacebookConnect") << "Already disconnected. " << dumpResponse() << LL_ENDL;
setUserDisconnected();
}
else
{
+ LL_WARNS("FacebookConnect") << dumpResponse() << LL_ENDL;
LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_DISCONNECT_FAILED);
- log_facebook_connect_error("Disconnect", status, reason, content.get("error_code"), content.get("error_description"));
+ const LLSD& content = getContent();
+ log_facebook_connect_error("Disconnect", getStatus(), getReason(),
+ content.get("error_code"), content.get("error_description"));
}
}
};
@@ -229,34 +273,35 @@ public:
{
LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS);
}
-
- virtual void completed(U32 status, const std::string& reason, const LLSD& content)
+
+ /* virtual */ void httpSuccess()
+ {
+ LL_DEBUGS("FacebookConnect") << "Connect successful. " << dumpResponse() << LL_ENDL;
+ LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED);
+ }
+
+ /* virtual */ void httpFailure()
{
- if (isGoodStatus(status))
+ // show the facebook login page if not connected yet
+ if ( HTTP_NOT_FOUND == getStatus() )
{
- LL_DEBUGS("FacebookConnect") << "Connect successful. content: " << content << LL_ENDL;
-
- LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTED);
+ LL_DEBUGS("FacebookConnect") << "Not connected. " << dumpResponse() << LL_ENDL;
+ if (mAutoConnect)
+ {
+ LLFacebookConnect::instance().connectToFacebook();
+ }
+ else
+ {
+ LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED);
+ }
}
else
{
- // show the facebook login page if not connected yet
- if (status == 404)
- {
- if (mAutoConnect)
- {
- LLFacebookConnect::instance().connectToFacebook();
- }
- else
- {
- LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED);
- }
- }
- else
- {
- LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_FAILED);
- log_facebook_connect_error("Connected", status, reason, content.get("error_code"), content.get("error_description"));
- }
+ LL_WARNS("FacebookConnect") << dumpResponse() << LL_ENDL;
+ LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_DISCONNECT_FAILED);
+ const LLSD& content = getContent();
+ log_facebook_connect_error("Connected", getStatus(), getReason(),
+ content.get("error_code"), content.get("error_description"));
}
}
@@ -271,25 +316,34 @@ class LLFacebookInfoResponder : public LLHTTPClient::Responder
LOG_CLASS(LLFacebookInfoResponder);
public:
- virtual void completed(U32 status, const std::string& reason, const LLSD& info)
+ /* virtual */ void httpSuccess()
{
- if (isGoodStatus(status))
- {
- llinfos << "Facebook: Info received" << llendl;
- LL_DEBUGS("FacebookConnect") << "Getting Facebook info successful. info: " << info << LL_ENDL;
- LLFacebookConnect::instance().storeInfo(info);
- }
- else
- {
- log_facebook_connect_error("Info", status, reason, info.get("error_code"), info.get("error_description"));
- }
+ LL_INFOS("FacebookConnect") << "Facebook: Info received" << LL_ENDL;
+ LL_DEBUGS("FacebookConnect") << "Getting Facebook info successful. " << dumpResponse() << LL_ENDL;
+ LLFacebookConnect::instance().storeInfo(getContent());
}
- void completedHeader(U32 status, const std::string& reason, const LLSD& content)
+ /* virtual */ void httpFailure()
{
- if (status == 302)
+ if ( HTTP_FOUND == getStatus() )
{
- LLFacebookConnect::instance().openFacebookWeb(content["location"]);
+ const std::string& location = getResponseHeader(HTTP_IN_HEADER_LOCATION);
+ if (location.empty())
+ {
+ LL_WARNS("FacebookConnect") << "Missing Location header " << dumpResponse()
+ << "[headers:" << getResponseHeaders() << "]" << LL_ENDL;
+ }
+ else
+ {
+ LLFacebookConnect::instance().openFacebookWeb(location);
+ }
+ }
+ else
+ {
+ LL_WARNS("FacebookConnect") << dumpResponse() << LL_ENDL;
+ const LLSD& content = getContent();
+ log_facebook_connect_error("Info", getStatus(), getReason(),
+ content.get("error_code"), content.get("error_description"));
}
}
};
@@ -300,27 +354,36 @@ class LLFacebookFriendsResponder : public LLHTTPClient::Responder
{
LOG_CLASS(LLFacebookFriendsResponder);
public:
+
+ /* virtual */ void httpSuccess()
+ {
+ LL_DEBUGS("FacebookConnect") << "Getting Facebook friends successful. " << dumpResponse() << LL_ENDL;
+ LLFacebookConnect::instance().storeContent(getContent());
+ }
- virtual void completed(U32 status, const std::string& reason, const LLSD& content)
+ /* virtual */ void httpFailure()
{
- if (isGoodStatus(status))
+ if ( HTTP_FOUND == getStatus() )
{
- LL_DEBUGS("FacebookConnect") << "Getting Facebook friends successful. content: " << content << LL_ENDL;
- LLFacebookConnect::instance().storeContent(content);
+ const std::string& location = getResponseHeader(HTTP_IN_HEADER_LOCATION);
+ if (location.empty())
+ {
+ LL_WARNS("FacebookConnect") << "Missing Location header " << dumpResponse()
+ << "[headers:" << getResponseHeaders() << "]" << LL_ENDL;
+ }
+ else
+ {
+ LLFacebookConnect::instance().openFacebookWeb(location);
+ }
}
else
{
- log_facebook_connect_error("Friends", status, reason, content.get("error_code"), content.get("error_description"));
+ LL_WARNS("FacebookConnect") << dumpResponse() << LL_ENDL;
+ const LLSD& content = getContent();
+ log_facebook_connect_error("Friends", getStatus(), getReason(),
+ content.get("error_code"), content.get("error_description"));
}
}
-
- void completedHeader(U32 status, const std::string& reason, const LLSD& content)
- {
- if (status == 302)
- {
- LLFacebookConnect::instance().openFacebookWeb(content["location"]);
- }
- }
};
///////////////////////////////////////////////////////////////////////////////
@@ -340,10 +403,12 @@ void LLFacebookConnect::openFacebookWeb(std::string url)
{
// Open the URL in an internal browser window without navigation UI
LLFloaterWebContent::Params p;
- p.url(url).show_chrome(true);
- p.url(url).allow_address_entry(false);
- p.url(url).allow_back_forward_navigation(false);
- p.url(url).trusted_content(true);
+ p.url(url);
+ p.show_chrome(true);
+ p.allow_address_entry(false);
+ p.allow_back_forward_navigation(false);
+ p.trusted_content(true);
+ p.clean_browser(true);
LLFloater *floater = LLFloaterReg::showInstance("fbc_web", p);
//the internal web browser has a bug that prevents it from gaining focus unless a mouse event occurs first (it seems).
//So when showing the internal web browser, set focus to it's containing floater "fbc_web". When a mouse event
@@ -360,7 +425,8 @@ std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route, b
LLViewerRegion *regionp = gAgent.getRegion();
if (regionp)
{
- url = regionp->getCapability("FacebookConnect");
+ //url = "http://pdp15.lindenlab.com/fbc/agent/" + gAgentID.asString(); // TEMPORARY FOR TESTING - CHO
+ url = regionp->getCapability("FacebookConnect");
url += route;
if (include_read_from_master && mReadFromMaster)
@@ -375,9 +441,13 @@ void LLFacebookConnect::connectToFacebook(const std::string& auth_code, const st
{
LLSD body;
if (!auth_code.empty())
+ {
body["code"] = auth_code;
+ }
if (!auth_state.empty())
+ {
body["state"] = auth_state;
+ }
LLHTTPClient::put(getFacebookConnectURL("/connection"), body, new LLFacebookConnectResponder());
}
@@ -421,15 +491,25 @@ void LLFacebookConnect::postCheckin(const std::string& location, const std::stri
{
LLSD body;
if (!location.empty())
+ {
body["location"] = location;
+ }
if (!name.empty())
+ {
body["name"] = name;
+ }
if (!description.empty())
+ {
body["description"] = description;
+ }
if (!image.empty())
+ {
body["image"] = image;
+ }
if (!message.empty())
+ {
body["message"] = message;
+ }
// Note: we can use that route for different publish action. We should be able to use the same responder.
LLHTTPClient::post(getFacebookConnectURL("/share/checkin", true), body, new LLFacebookShareResponder());
@@ -458,7 +538,7 @@ void LLFacebookConnect::sharePhoto(LLPointer<LLImageFormatted> image, const std:
}
else
{
- llwarns << "Image to upload is not a PNG or JPEG" << llendl;
+ LL_WARNS() << "Image to upload is not a PNG or JPEG" << LL_ENDL;
return;
}
@@ -476,7 +556,7 @@ void LLFacebookConnect::sharePhoto(LLPointer<LLImageFormatted> image, const std:
<< caption << "\r\n";
body << "--" << boundary << "\r\n"
- << "Content-Disposition: form-data; name=\"image\"; filename=\"snapshot." << imageFormat << "\"\r\n"
+ << "Content-Disposition: form-data; name=\"image\"; filename=\"Untitled." << imageFormat << "\"\r\n"
<< "Content-Type: image/" << imageFormat << "\r\n\r\n";
// Insert the image data.
@@ -568,12 +648,13 @@ void LLFacebookConnect::setConnectionState(LLFacebookConnect::EConnectionState c
if (mConnectionState != connection_state)
{
+ // set the connection state before notifying watchers
+ mConnectionState = connection_state;
+
LLSD state_info;
state_info["enum"] = connection_state;
sStateWatcher->post(state_info);
}
-
- mConnectionState = connection_state;
}
void LLFacebookConnect::setConnected(bool connected)
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index a77ac24167..c157db2178 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -89,7 +89,7 @@ private:
LLFacebookConnect();
~LLFacebookConnect() {};
std::string getFacebookConnectURL(const std::string& route = "", bool include_read_from_master = false);
-
+
EConnectionState mConnectionState;
BOOL mConnected;
LLSD mInfo;
diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index 06119620de..76c37439ab 100755
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -30,12 +30,14 @@
#include "llviewerwindow.h"
#include "llrect.h"
+#include "llcombobox.h"
#include "llerror.h"
#include "llgl.h"
#include "llimagepng.h"
#include "llrender.h"
#include "llrendertarget.h"
#include "lllocalcliprect.h"
+#include "lllayoutstack.h"
#include "llmath.h"
#include "llfontgl.h"
#include "llsdserialize.h"
@@ -46,7 +48,6 @@
#include "llviewertexturelist.h"
#include "llui.h"
#include "llviewercontrol.h"
-#include "llstat.h"
#include "llfasttimer.h"
#include "lltreeiterators.h"
@@ -55,62 +56,73 @@
//////////////////////////////////////////////////////////////////////////////
-static const S32 MAX_VISIBLE_HISTORY = 10;
-static const S32 LINE_GRAPH_HEIGHT = 240;
-
-//static const int FTV_DISPLAY_NUM = (sizeof(ft_display_table)/sizeof(ft_display_table[0]));
-static S32 FTV_NUM_TIMERS;
-const S32 FTV_MAX_DEPTH = 8;
+using namespace LLTrace;
-std::vector<LLFastTimer::NamedTimer*> ft_display_idx; // line of table entry for display purposes (for collapse)
+static const S32 MAX_VISIBLE_HISTORY = 12;
+static const S32 LINE_GRAPH_HEIGHT = 240;
+static const S32 MIN_BAR_HEIGHT = 3;
+static const S32 RUNNING_AVERAGE_WIDTH = 100;
+static const S32 NUM_FRAMES_HISTORY = 200;
-typedef LLTreeDFSIter<LLFastTimer::NamedTimer, LLFastTimer::NamedTimer::child_const_iter> timer_tree_iterator_t;
+std::vector<BlockTimerStatHandle*> ft_display_idx; // line of table entry for display purposes (for collapse)
BOOL LLFastTimerView::sAnalyzePerformance = FALSE;
-static timer_tree_iterator_t begin_timer_tree(LLFastTimer::NamedTimer& id)
-{
- return timer_tree_iterator_t(&id,
- boost::bind(boost::mem_fn(&LLFastTimer::NamedTimer::beginChildren), _1),
- boost::bind(boost::mem_fn(&LLFastTimer::NamedTimer::endChildren), _1));
-}
-
-static timer_tree_iterator_t end_timer_tree()
-{
- return timer_tree_iterator_t();
+S32 get_depth(const BlockTimerStatHandle* blockp)
+{
+ S32 depth = 0;
+ BlockTimerStatHandle* timerp = blockp->getParent();
+ while(timerp)
+ {
+ depth++;
+ if (timerp->getParent() == timerp) break;
+ timerp = timerp->getParent();
+ }
+ return depth;
}
LLFastTimerView::LLFastTimerView(const LLSD& key)
: LLFloater(key),
- mHoverTimer(NULL)
+ mHoverTimer(NULL),
+ mDisplayMode(0),
+ mDisplayType(DISPLAY_TIME),
+ mScrollIndex(0),
+ mHoverID(NULL),
+ mHoverBarIndex(-1),
+ mStatsIndex(-1),
+ mPauseHistory(false),
+ mRecording(NUM_FRAMES_HISTORY)
+{
+ mTimerBarRows.resize(NUM_FRAMES_HISTORY);
+}
+
+LLFastTimerView::~LLFastTimerView()
{
- mDisplayMode = 0;
- mAvgCountTotal = 0;
- mMaxCountTotal = 0;
- mDisplayCenter = ALIGN_CENTER;
- mDisplayCalls = 0;
- mDisplayHz = 0;
- mScrollIndex = 0;
- mHoverID = NULL;
- mHoverBarIndex = -1;
- FTV_NUM_TIMERS = LLFastTimer::NamedTimer::instanceCount();
- mPrintStats = -1;
}
void LLFastTimerView::onPause()
{
- LLFastTimer::sPauseHistory = !LLFastTimer::sPauseHistory;
+ setPauseState(!mPauseHistory);
+}
+
+void LLFastTimerView::setPauseState(bool pause_state)
+{
+ if (pause_state == mPauseHistory) return;
+
// reset scroll to bottom when unpausing
- if (!LLFastTimer::sPauseHistory)
+ if (!pause_state)
{
- mScrollIndex = 0;
- LLFastTimer::sResetHistory = true;
+
getChild<LLButton>("pause_btn")->setLabel(getString("pause"));
}
else
{
+ mScrollIndex = 0;
+
getChild<LLButton>("pause_btn")->setLabel(getString("run"));
}
+
+ mPauseHistory = pause_state;
}
BOOL LLFastTimerView::postBuild()
@@ -126,13 +138,13 @@ BOOL LLFastTimerView::handleRightMouseDown(S32 x, S32 y, MASK mask)
if (mHoverTimer )
{
// right click collapses timers
- if (!mHoverTimer->getCollapsed())
+ if (!mHoverTimer->getTreeNode().mCollapsed)
{
- mHoverTimer->setCollapsed(true);
+ mHoverTimer->getTreeNode().mCollapsed = true;
}
else if (mHoverTimer->getParent())
{
- mHoverTimer->getParent()->setCollapsed(true);
+ mHoverTimer->getParent()->getTreeNode().mCollapsed = true;
}
return TRUE;
}
@@ -140,15 +152,15 @@ BOOL LLFastTimerView::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
S32 bar_idx = MAX_VISIBLE_HISTORY - ((y - mBarRect.mBottom) * (MAX_VISIBLE_HISTORY + 2) / mBarRect.getHeight());
bar_idx = llclamp(bar_idx, 0, MAX_VISIBLE_HISTORY);
- mPrintStats = LLFastTimer::NamedTimer::HISTORY_NUM - mScrollIndex - bar_idx;
+ mStatsIndex = mScrollIndex + bar_idx;
return TRUE;
}
return LLFloater::handleRightMouseDown(x, y, mask);
}
-LLFastTimer::NamedTimer* LLFastTimerView::getLegendID(S32 y)
+BlockTimerStatHandle* LLFastTimerView::getLegendID(S32 y)
{
- S32 idx = (getRect().getHeight() - y) / (LLFontGL::getFontMonospace()->getLineHeight()+2) - 5;
+ S32 idx = (mLegendRect.mTop - y) / (LLFontGL::getFontMonospace()->getLineHeight() + 2);
if (idx >= 0 && idx < (S32)ft_display_idx.size())
{
@@ -160,11 +172,11 @@ LLFastTimer::NamedTimer* LLFastTimerView::getLegendID(S32 y)
BOOL LLFastTimerView::handleDoubleClick(S32 x, S32 y, MASK mask)
{
- for(timer_tree_iterator_t it = begin_timer_tree(getFrameTimer());
- it != end_timer_tree();
+ for(LLTrace::block_timer_tree_df_iterator_t it = LLTrace::begin_block_timer_tree_df(FTM_FRAME);
+ it != LLTrace::end_block_timer_tree_df();
++it)
{
- (*it)->setCollapsed(false);
+ (*it)->getTreeNode().mCollapsed = false;
}
return TRUE;
}
@@ -173,52 +185,23 @@ BOOL LLFastTimerView::handleMouseDown(S32 x, S32 y, MASK mask)
{
if (x < mBarRect.mLeft)
{
- LLFastTimer::NamedTimer* idp = getLegendID(y);
+ BlockTimerStatHandle* idp = getLegendID(y);
if (idp)
{
- idp->setCollapsed(!idp->getCollapsed());
+ idp->getTreeNode().mCollapsed = !idp->getTreeNode().mCollapsed;
}
}
else if (mHoverTimer)
{
//left click drills down by expanding timers
- mHoverTimer->setCollapsed(false);
- }
- else if (mask & MASK_ALT)
- {
- if (mask & MASK_CONTROL)
- {
- mDisplayHz = !mDisplayHz;
- }
- else
- {
- mDisplayCalls = !mDisplayCalls;
- }
- }
- else if (mask & MASK_SHIFT)
- {
- if (++mDisplayMode > 3)
- mDisplayMode = 0;
- }
- else if (mask & MASK_CONTROL)
- {
- mDisplayCenter = (ChildAlignment)((mDisplayCenter + 1) % ALIGN_COUNT);
+ mHoverTimer->getTreeNode().mCollapsed = false;
}
else if (mGraphRect.pointInRect(x, y))
{
gFocusMgr.setMouseCapture(this);
return TRUE;
}
- //else
- //{
- // // pause/unpause
- // LLFastTimer::sPauseHistory = !LLFastTimer::sPauseHistory;
- // // reset scroll to bottom when unpausing
- // if (!LLFastTimer::sPauseHistory)
- // {
- // mScrollIndex = 0;
- // }
- //}
+
return LLFloater::handleMouseDown(x, y, mask);
}
@@ -236,17 +219,21 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask)
if (hasMouseCapture())
{
F32 lerp = llclamp(1.f - (F32) (x - mGraphRect.mLeft) / (F32) mGraphRect.getWidth(), 0.f, 1.f);
- mScrollIndex = llround( lerp * (F32)(LLFastTimer::NamedTimer::HISTORY_NUM - MAX_VISIBLE_HISTORY));
- mScrollIndex = llclamp( mScrollIndex, 0, LLFastTimer::getLastFrameIndex());
+ mScrollIndex = llround( lerp * (F32)(mRecording.getNumRecordedPeriods() - MAX_VISIBLE_HISTORY));
+ mScrollIndex = llclamp( mScrollIndex, 0, (S32)mRecording.getNumRecordedPeriods());
return TRUE;
}
mHoverTimer = NULL;
mHoverID = NULL;
- if(LLFastTimer::sPauseHistory && mBarRect.pointInRect(x, y))
+ if(mPauseHistory && mBarRect.pointInRect(x, y))
{
- mHoverBarIndex = llmin(LLFastTimer::getCurFrameIndex() - 1,
- MAX_VISIBLE_HISTORY - ((y - mBarRect.mBottom) * (MAX_VISIBLE_HISTORY + 2) / mBarRect.getHeight()));
+ //const S32 bars_top = mBarRect.mTop;
+ const S32 bars_top = mBarRect.mTop - ((S32)LLFontGL::getFontMonospace()->getLineHeight() + 4);
+
+ mHoverBarIndex = llmin((bars_top - y) / (mBarRect.getHeight() / (MAX_VISIBLE_HISTORY + 2)) - 1,
+ (S32)mRecording.getNumRecordedPeriods() - 1,
+ MAX_VISIBLE_HISTORY);
if (mHoverBarIndex == 0)
{
return TRUE;
@@ -256,40 +243,50 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask)
mHoverBarIndex = 0;
}
- S32 i = 0;
- for(timer_tree_iterator_t it = begin_timer_tree(getFrameTimer());
- it != end_timer_tree();
- ++it, ++i)
+ TimerBarRow& row = mHoverBarIndex == 0 ? mAverageTimerRow : mTimerBarRows[mScrollIndex + mHoverBarIndex - 1];
+
+ TimerBar* hover_bar = NULL;
+ F32Seconds mouse_time_offset = ((F32)(x - mBarRect.mLeft) / (F32)mBarRect.getWidth()) * mTotalTimeDisplay;
+ for (int bar_index = 0, end_index = LLTrace::BlockTimerStatHandle::instance_tracker_t::instanceCount();
+ bar_index < end_index;
+ ++bar_index)
{
- // is mouse over bar for this timer?
- if (x > mBarStart[mHoverBarIndex][i] &&
- x < mBarEnd[mHoverBarIndex][i])
+ TimerBar& bar = row.mBars[bar_index];
+ if (bar.mSelfStart > mouse_time_offset)
{
- mHoverID = (*it);
- if (mHoverTimer != *it)
- {
- // could be that existing tooltip is for a parent and is thus
- // covering region for this new timer, go ahead and unblock
- // so we can create a new tooltip
- LLToolTipMgr::instance().unblockToolTips();
- mHoverTimer = (*it);
+ break;
+ }
+ if (bar.mSelfEnd > mouse_time_offset)
+ {
+ hover_bar = &bar;
+ if (bar.mTimeBlock->getTreeNode().mCollapsed)
+ {
+ // stop on first collapsed BlockTimerStatHandle, since we can't select any children
+ break;
}
-
- mToolTipRect.set(mBarStart[mHoverBarIndex][i],
- mBarRect.mBottom + llround(((F32)(MAX_VISIBLE_HISTORY - mHoverBarIndex + 1)) * ((F32)mBarRect.getHeight() / ((F32)MAX_VISIBLE_HISTORY + 2.f))),
- mBarEnd[mHoverBarIndex][i],
- mBarRect.mBottom + llround((F32)(MAX_VISIBLE_HISTORY - mHoverBarIndex) * ((F32)mBarRect.getHeight() / ((F32)MAX_VISIBLE_HISTORY + 2.f))));
}
+ }
- if ((*it)->getCollapsed())
+ if (hover_bar)
+ {
+ mHoverID = hover_bar->mTimeBlock;
+ if (mHoverTimer != mHoverID)
{
- it.skipDescendants();
+ // could be that existing tooltip is for a parent and is thus
+ // covering region for this new timer, go ahead and unblock
+ // so we can create a new tooltip
+ LLToolTipMgr::instance().unblockToolTips();
+ mHoverTimer = mHoverID;
+ mToolTipRect.set(mBarRect.mLeft + (hover_bar->mSelfStart / mTotalTimeDisplay) * mBarRect.getWidth(),
+ row.mTop,
+ mBarRect.mLeft + (hover_bar->mSelfEnd / mTotalTimeDisplay) * mBarRect.getWidth(),
+ row.mBottom);
}
}
}
else if (x < mBarRect.mLeft)
{
- LLFastTimer::NamedTimer* timer_id = getLegendID(y);
+ BlockTimerStatHandle* timer_id = getLegendID(y);
if (timer_id)
{
mHoverID = timer_id;
@@ -300,9 +297,24 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask)
}
+static std::string get_tooltip(BlockTimerStatHandle& timer, S32 history_index, PeriodicRecording& frame_recording)
+{
+ std::string tooltip;
+ if (history_index == 0)
+ {
+ // by default, show average number of call
+ tooltip = llformat("%s (%d ms, %d calls)", timer.getName().c_str(), (S32)F64Milliseconds(frame_recording.getPeriodMean (timer, RUNNING_AVERAGE_WIDTH)).value(), (S32)frame_recording.getPeriodMean(timer.callCount(), RUNNING_AVERAGE_WIDTH));
+ }
+ else
+ {
+ tooltip = llformat("%s (%d ms, %d calls)", timer.getName().c_str(), (S32)F64Milliseconds(frame_recording.getPrevRecording(history_index).getSum(timer)).value(), (S32)frame_recording.getPrevRecording(history_index).getSum(timer.callCount()));
+ }
+ return tooltip;
+}
+
BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, MASK mask)
{
- if(LLFastTimer::sPauseHistory && mBarRect.pointInRect(x, y))
+ if(mPauseHistory && mBarRect.pointInRect(x, y))
{
// tooltips for timer bars
if (mHoverTimer)
@@ -310,8 +322,10 @@ BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, MASK mask)
LLRect screen_rect;
localRectToScreen(mToolTipRect, &screen_rect);
+ std::string tooltip = get_tooltip(*mHoverTimer, mHoverBarIndex > 0 ? mScrollIndex + mHoverBarIndex : 0, mRecording);
+
LLToolTipMgr::instance().show(LLToolTip::Params()
- .message(mHoverTimer->getToolTip(LLFastTimer::NamedTimer::HISTORY_NUM - mScrollIndex - mHoverBarIndex))
+ .message(tooltip)
.sticky_rect(screen_rect)
.delay_time(0.f));
@@ -323,10 +337,10 @@ BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, MASK mask)
// tooltips for timer legend
if (x < mBarRect.mLeft)
{
- LLFastTimer::NamedTimer* idp = getLegendID(y);
+ BlockTimerStatHandle* idp = getLegendID(y);
if (idp)
{
- LLToolTipMgr::instance().show(idp->getToolTip());
+ LLToolTipMgr::instance().show(get_tooltip(*idp, 0, mRecording));
return TRUE;
}
@@ -338,705 +352,86 @@ BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, MASK mask)
BOOL LLFastTimerView::handleScrollWheel(S32 x, S32 y, S32 clicks)
{
- LLFastTimer::sPauseHistory = TRUE;
+ setPauseState(true);
mScrollIndex = llclamp( mScrollIndex + clicks,
0,
- llmin(LLFastTimer::getLastFrameIndex(), (S32)LLFastTimer::NamedTimer::HISTORY_NUM - MAX_VISIBLE_HISTORY));
+ llmin((S32)mRecording.getNumRecordedPeriods(), (S32)mRecording.getNumRecordedPeriods() - MAX_VISIBLE_HISTORY));
return TRUE;
}
-static LLFastTimer::DeclareTimer FTM_RENDER_TIMER("Timers");
+static BlockTimerStatHandle FTM_RENDER_TIMER("Timers");
+static const S32 MARGIN = 10;
+static const S32 LEGEND_WIDTH = 220;
-static std::map<LLFastTimer::NamedTimer*, LLColor4> sTimerColors;
+static std::vector<LLColor4> sTimerColors;
void LLFastTimerView::draw()
{
- LLFastTimer t(FTM_RENDER_TIMER);
-
- std::string tdesc;
-
- F64 clock_freq = (F64)LLFastTimer::countsPerSecond();
- F64 iclock_freq = 1000.0 / clock_freq;
-
- S32 margin = 10;
- S32 height = getRect().getHeight();
- S32 width = getRect().getWidth();
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_TIMER);
- LLRect new_rect;
- new_rect.setLeftTopAndSize(getRect().mLeft, getRect().mTop, width, height);
- setRect(new_rect);
-
- S32 left, top, right, bottom;
- S32 x, y, barw, barh, dx, dy;
- S32 texth;
- LLPointer<LLUIImage> box_imagep = LLUI::getUIImage("Rounded_Square");
-
- // Draw the window background
- gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
- gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4(0.f, 0.f, 0.f, 0.25f));
-
- S32 xleft = margin;
- S32 ytop = margin;
-
- // Draw some help
+ if (!mPauseHistory)
{
-
- x = xleft;
- y = height - ytop;
- texth = (S32)LLFontGL::getFontMonospace()->getLineHeight();
-
- char modedesc[][32] = {
- "2 x Average ",
- "Max ",
- "Recent Max ",
- "100 ms "
- };
- char centerdesc[][32] = {
- "Left ",
- "Centered ",
- "Ordered "
- };
-
- tdesc = llformat("Full bar = %s [Click to pause/reset] [SHIFT-Click to toggle]",modedesc[mDisplayMode]);
- LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP);
-
- x = xleft, y -= (texth + 2);
- tdesc = llformat("Justification = %s [CTRL-Click to toggle]",centerdesc[mDisplayCenter]);
- LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP);
- y -= (texth + 2);
-
- LLFontGL::getFontMonospace()->renderUTF8(std::string("[Right-Click log selected] [ALT-Click toggle counts] [ALT-SHIFT-Click sub hidden]"),
- 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP);
- y -= (texth + 2);
+ mRecording.appendRecording(LLTrace::get_frame_recording().getLastRecording());
+ mTimerBarRows.pop_back();
+ mTimerBarRows.push_front(TimerBarRow());
}
- S32 histmax = llmin(LLFastTimer::getLastFrameIndex()+1, MAX_VISIBLE_HISTORY);
+ mDisplayMode = llclamp(getChild<LLComboBox>("time_scale_combo")->getCurrentIndex(), 0, 3);
+ mDisplayType = (EDisplayType)llclamp(getChild<LLComboBox>("metric_combo")->getCurrentIndex(), 0, 2);
- // Draw the legend
- xleft = margin;
- ytop = y;
-
- y -= (texth + 2);
-
- sTimerColors[&getFrameTimer()] = LLColor4::grey;
-
- F32 hue = 0.f;
+ generateUniqueColors();
- for (timer_tree_iterator_t it = begin_timer_tree(getFrameTimer());
- it != timer_tree_iterator_t();
- ++it)
- {
- LLFastTimer::NamedTimer* idp = (*it);
+ LLView::drawChildren();
+ //getChild<LLLayoutStack>("timer_bars_stack")->updateLayout();
+ //getChild<LLLayoutStack>("legend_stack")->updateLayout();
+ LLView* bars_panel = getChildView("bars_panel");
+ bars_panel->localRectToOtherView(bars_panel->getLocalRect(), &mBarRect, this);
- const F32 HUE_INCREMENT = 0.23f;
- hue = fmodf(hue + HUE_INCREMENT, 1.f);
- // saturation increases with depth
- F32 saturation = clamp_rescale((F32)idp->getDepth(), 0.f, 3.f, 0.f, 1.f);
- // lightness alternates with depth
- F32 lightness = idp->getDepth() % 2 ? 0.5f : 0.6f;
+ LLView* lines_panel = getChildView("lines_panel");
+ lines_panel->localRectToOtherView(lines_panel->getLocalRect(), &mGraphRect, this);
- LLColor4 child_color;
- child_color.setHSL(hue, saturation, lightness);
-
- sTimerColors[idp] = child_color;
- }
-
- const S32 LEGEND_WIDTH = 220;
- {
- LLLocalClipRect clip(LLRect(margin, y, LEGEND_WIDTH, margin));
- S32 cur_line = 0;
- ft_display_idx.clear();
- std::map<LLFastTimer::NamedTimer*, S32> display_line;
- for (timer_tree_iterator_t it = begin_timer_tree(getFrameTimer());
- it != timer_tree_iterator_t();
- ++it)
- {
- LLFastTimer::NamedTimer* idp = (*it);
- display_line[idp] = cur_line;
- ft_display_idx.push_back(idp);
- cur_line++;
-
- x = xleft;
-
- left = x; right = x + texth;
- top = y; bottom = y - texth;
- S32 scale_offset = 0;
- if (idp == mHoverID)
- {
- scale_offset = llfloor(sinf(mHighlightTimer.getElapsedTimeF32() * 6.f) * 2.f);
- }
- gl_rect_2d(left - scale_offset, top + scale_offset, right + scale_offset, bottom - scale_offset, sTimerColors[idp]);
-
- F32 ms = 0;
- S32 calls = 0;
- if (mHoverBarIndex > 0 && mHoverID)
- {
- S32 hidx = LLFastTimer::NamedTimer::HISTORY_NUM - mScrollIndex - mHoverBarIndex;
- U64 ticks = idp->getHistoricalCount(hidx);
- ms = (F32)((F64)ticks * iclock_freq);
- calls = (S32)idp->getHistoricalCalls(hidx);
- }
- else
- {
- U64 ticks = idp->getCountAverage();
- ms = (F32)((F64)ticks * iclock_freq);
- calls = (S32)idp->getCallAverage();
- }
-
- if (mDisplayCalls)
- {
- tdesc = llformat("%s (%d)",idp->getName().c_str(),calls);
- }
- else
- {
- tdesc = llformat("%s [%.1f]",idp->getName().c_str(),ms);
- }
- dx = (texth+4) + idp->getDepth()*8;
-
- LLColor4 color = LLColor4::white;
- if (idp->getDepth() > 0)
- {
- S32 line_start_y = (top + bottom) / 2;
- S32 line_end_y = line_start_y + ((texth + 2) * (cur_line - display_line[idp->getParent()])) - texth;
- gl_line_2d(x + dx - 8, line_start_y, x + dx, line_start_y, color);
- S32 line_x = x + (texth + 4) + ((idp->getDepth() - 1) * 8);
- gl_line_2d(line_x, line_start_y, line_x, line_end_y, color);
- if (idp->getCollapsed() && !idp->getChildren().empty())
- {
- gl_line_2d(line_x+4, line_start_y-3, line_x+4, line_start_y+4, color);
- }
- }
-
- x += dx;
- BOOL is_child_of_hover_item = (idp == mHoverID);
- LLFastTimer::NamedTimer* next_parent = idp->getParent();
- while(!is_child_of_hover_item && next_parent)
- {
- is_child_of_hover_item = (mHoverID == next_parent);
- if (next_parent->getParent() == next_parent) break;
- next_parent = next_parent->getParent();
- }
-
- LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0,
- x, y,
- color,
- LLFontGL::LEFT, LLFontGL::TOP,
- is_child_of_hover_item ? LLFontGL::BOLD : LLFontGL::NORMAL);
-
- y -= (texth + 2);
-
- if (idp->getCollapsed())
- {
- it.skipDescendants();
- }
- }
- }
-
- xleft += LEGEND_WIDTH + 8;
- // ytop = ytop;
-
- // update rectangle that includes timer bars
- mBarRect.mLeft = xleft;
- mBarRect.mRight = getRect().getWidth();
- mBarRect.mTop = ytop - (LLFontGL::getFontMonospace()->getLineHeight() + 4);
- mBarRect.mBottom = margin + LINE_GRAPH_HEIGHT;
-
- y = ytop;
- barh = (ytop - margin - LINE_GRAPH_HEIGHT) / (MAX_VISIBLE_HISTORY + 2);
- dy = barh>>2; // spacing between bars
- if (dy < 1) dy = 1;
- barh -= dy;
- barw = width - xleft - margin;
-
- // Draw the history bars
- if (LLFastTimer::getLastFrameIndex() >= 0)
- {
- LLLocalClipRect clip(LLRect(xleft, ytop, getRect().getWidth() - margin, margin));
-
- U64 totalticks;
- if (!LLFastTimer::sPauseHistory)
- {
- U64 ticks = getFrameTimer().getHistoricalCount(mScrollIndex);
-
- if (LLFastTimer::getCurFrameIndex() >= 10)
- {
- U64 framec = LLFastTimer::getCurFrameIndex();
- U64 avg = (U64)mAvgCountTotal;
- mAvgCountTotal = (avg*framec + ticks) / (framec + 1);
- if (ticks > mMaxCountTotal)
- {
- mMaxCountTotal = ticks;
- }
- }
-
- if (ticks < mAvgCountTotal/100 || ticks > mAvgCountTotal*100)
- {
- LLFastTimer::sResetHistory = true;
- }
-
- if (LLFastTimer::getCurFrameIndex() < 10 || LLFastTimer::sResetHistory)
- {
- mAvgCountTotal = ticks;
- mMaxCountTotal = ticks;
- LLFastTimer::sResetHistory = false;
- }
- }
+ LLView* legend_panel = getChildView("legend");
+ legend_panel->localRectToOtherView(legend_panel->getLocalRect(), &mLegendRect, this);
- if (mDisplayMode == 0)
- {
- totalticks = mAvgCountTotal*2;
- }
- else if (mDisplayMode == 1)
- {
- totalticks = mMaxCountTotal;
- }
- else if (mDisplayMode == 2)
- {
- // Calculate the max total ticks for the current history
- totalticks = 0;
- for (S32 j=0; j<histmax; j++)
- {
- U64 ticks = getFrameTimer().getHistoricalCount(j);
-
- if (ticks > totalticks)
- totalticks = ticks;
- }
- }
- else
- {
- totalticks = (U64)(clock_freq * .1); // 100 ms
- }
-
- // Draw MS ticks
- {
- U32 ms = (U32)((F64)totalticks * iclock_freq) ;
-
- tdesc = llformat("%.1f ms |", (F32)ms*.25f);
- x = xleft + barw/4 - LLFontGL::getFontMonospace()->getWidth(tdesc);
- LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white,
- LLFontGL::LEFT, LLFontGL::TOP);
-
- tdesc = llformat("%.1f ms |", (F32)ms*.50f);
- x = xleft + barw/2 - LLFontGL::getFontMonospace()->getWidth(tdesc);
- LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white,
- LLFontGL::LEFT, LLFontGL::TOP);
-
- tdesc = llformat("%.1f ms |", (F32)ms*.75f);
- x = xleft + (barw*3)/4 - LLFontGL::getFontMonospace()->getWidth(tdesc);
- LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white,
- LLFontGL::LEFT, LLFontGL::TOP);
-
- tdesc = llformat( "%d ms |", ms);
- x = xleft + barw - LLFontGL::getFontMonospace()->getWidth(tdesc);
- LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white,
- LLFontGL::LEFT, LLFontGL::TOP);
- }
-
- // Draw borders
- {
- gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
- gGL.color4f(0.5f,0.5f,0.5f,0.5f);
-
- S32 by = y + 2;
-
- y -= ((S32)LLFontGL::getFontMonospace()->getLineHeight() + 4);
-
- //heading
- gl_rect_2d(xleft-5, by, getRect().getWidth()-5, y+5, FALSE);
-
- //tree view
- gl_rect_2d(5, by, xleft-10, 5, FALSE);
-
- by = y + 5;
- //average bar
- gl_rect_2d(xleft-5, by, getRect().getWidth()-5, by-barh-dy-5, FALSE);
-
- by -= barh*2+dy;
-
- //current frame bar
- gl_rect_2d(xleft-5, by, getRect().getWidth()-5, by-barh-dy-2, FALSE);
-
- by -= barh+dy+1;
-
- //history bars
- gl_rect_2d(xleft-5, by, getRect().getWidth()-5, LINE_GRAPH_HEIGHT-barh-dy-2, FALSE);
-
- by = LINE_GRAPH_HEIGHT-barh-dy-7;
-
- //line graph
- mGraphRect = LLRect(xleft-5, by, getRect().getWidth()-5, 5);
-
- gl_rect_2d(mGraphRect, FALSE);
- }
-
- mBarStart.clear();
- mBarEnd.clear();
-
- // Draw bars for each history entry
- // Special: -1 = show running average
- gGL.getTexUnit(0)->bind(box_imagep->getImage());
- for (S32 j=-1; j<histmax && y > LINE_GRAPH_HEIGHT; j++)
- {
- mBarStart.push_back(std::vector<S32>());
- mBarEnd.push_back(std::vector<S32>());
- int sublevel_dx[FTV_MAX_DEPTH];
- int sublevel_left[FTV_MAX_DEPTH];
- int sublevel_right[FTV_MAX_DEPTH];
- S32 tidx;
- if (j >= 0)
- {
- tidx = LLFastTimer::NamedTimer::HISTORY_NUM - j - 1 - mScrollIndex;
- }
- else
- {
- tidx = -1;
- }
-
- x = xleft;
-
- // draw the bars for each stat
- std::vector<S32> xpos;
- std::vector<S32> deltax;
- xpos.push_back(xleft);
-
- LLFastTimer::NamedTimer* prev_id = NULL;
-
- S32 i = 0;
- for(timer_tree_iterator_t it = begin_timer_tree(getFrameTimer());
- it != end_timer_tree();
- ++it, ++i)
- {
- LLFastTimer::NamedTimer* idp = (*it);
- F32 frac = tidx == -1
- ? (F32)idp->getCountAverage() / (F32)totalticks
- : (F32)idp->getHistoricalCount(tidx) / (F32)totalticks;
-
- dx = llround(frac * (F32)barw);
- S32 prev_delta_x = deltax.empty() ? 0 : deltax.back();
- deltax.push_back(dx);
-
- int level = idp->getDepth() - 1;
-
- while ((S32)xpos.size() > level + 1)
- {
- xpos.pop_back();
- }
- left = xpos.back();
-
- if (level == 0)
- {
- sublevel_left[level] = xleft;
- sublevel_dx[level] = dx;
- sublevel_right[level] = sublevel_left[level] + sublevel_dx[level];
- }
- else if (prev_id && prev_id->getDepth() < idp->getDepth())
- {
- U64 sublevelticks = 0;
-
- for (LLFastTimer::NamedTimer::child_const_iter it = prev_id->beginChildren();
- it != prev_id->endChildren();
- ++it)
- {
- sublevelticks += (tidx == -1)
- ? (*it)->getCountAverage()
- : (*it)->getHistoricalCount(tidx);
- }
-
- F32 subfrac = (F32)sublevelticks / (F32)totalticks;
- sublevel_dx[level] = (int)(subfrac * (F32)barw + .5f);
-
- if (mDisplayCenter == ALIGN_CENTER)
- {
- left += (prev_delta_x - sublevel_dx[level])/2;
- }
- else if (mDisplayCenter == ALIGN_RIGHT)
- {
- left += (prev_delta_x - sublevel_dx[level]);
- }
-
- sublevel_left[level] = left;
- sublevel_right[level] = sublevel_left[level] + sublevel_dx[level];
- }
-
- right = left + dx;
- xpos.back() = right;
- xpos.push_back(left);
-
- mBarStart.back().push_back(left);
- mBarEnd.back().push_back(right);
-
- top = y;
- bottom = y - barh;
-
- if (right > left)
- {
- //U32 rounded_edges = 0;
- LLColor4 color = sTimerColors[idp];//*ft_display_table[i].color;
- S32 scale_offset = 0;
-
- BOOL is_child_of_hover_item = (idp == mHoverID);
- LLFastTimer::NamedTimer* next_parent = idp->getParent();
- while(!is_child_of_hover_item && next_parent)
- {
- is_child_of_hover_item = (mHoverID == next_parent);
- if (next_parent->getParent() == next_parent) break;
- next_parent = next_parent->getParent();
- }
-
- if (idp == mHoverID)
- {
- scale_offset = llfloor(sinf(mHighlightTimer.getElapsedTimeF32() * 6.f) * 3.f);
- //color = lerp(color, LLColor4::black, -0.4f);
- }
- else if (mHoverID != NULL && !is_child_of_hover_item)
- {
- color = lerp(color, LLColor4::grey, 0.8f);
- }
-
- gGL.color4fv(color.mV);
- F32 start_fragment = llclamp((F32)(left - sublevel_left[level]) / (F32)sublevel_dx[level], 0.f, 1.f);
- F32 end_fragment = llclamp((F32)(right - sublevel_left[level]) / (F32)sublevel_dx[level], 0.f, 1.f);
- gl_segmented_rect_2d_fragment_tex(sublevel_left[level], top - level + scale_offset, sublevel_right[level], bottom + level - scale_offset, box_imagep->getTextureWidth(), box_imagep->getTextureHeight(), 16, start_fragment, end_fragment);
-
- }
-
- if ((*it)->getCollapsed())
- {
- it.skipDescendants();
- }
-
- prev_id = idp;
- }
- y -= (barh + dy);
- if (j < 0)
- y -= barh;
- }
-
- //draw line graph history
- {
+ // Draw the window background
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
- LLLocalClipRect clip(mGraphRect);
-
- //normalize based on last frame's maximum
- static U64 last_max = 0;
- static F32 alpha_interp = 0.f;
- U64 max_ticks = llmax(last_max, (U64) 1);
- F32 ms = (F32)((F64)max_ticks * iclock_freq);
-
- //display y-axis range
- std::string tdesc;
- if (mDisplayCalls)
- tdesc = llformat("%d calls", (int)max_ticks);
- else if (mDisplayHz)
- tdesc = llformat("%d Hz", (int)max_ticks);
- else
- tdesc = llformat("%4.2f ms", ms);
-
- x = mGraphRect.mRight - LLFontGL::getFontMonospace()->getWidth(tdesc)-5;
- y = mGraphRect.mTop - LLFontGL::getFontMonospace()->getLineHeight();
-
- LLFontGL::getFontMonospace()->renderUTF8(tdesc, 0, x, y, LLColor4::white,
- LLFontGL::LEFT, LLFontGL::TOP);
-
- //highlight visible range
- {
- S32 first_frame = LLFastTimer::NamedTimer::HISTORY_NUM - mScrollIndex;
- S32 last_frame = first_frame - MAX_VISIBLE_HISTORY;
-
- F32 frame_delta = ((F32) (mGraphRect.getWidth()))/(LLFastTimer::NamedTimer::HISTORY_NUM-1);
-
- F32 right = (F32) mGraphRect.mLeft + frame_delta*first_frame;
- F32 left = (F32) mGraphRect.mLeft + frame_delta*last_frame;
-
- gGL.color4f(0.5f,0.5f,0.5f,0.3f);
- gl_rect_2d((S32) left, mGraphRect.mTop, (S32) right, mGraphRect.mBottom);
-
- if (mHoverBarIndex >= 0)
- {
- S32 bar_frame = first_frame - mHoverBarIndex;
- F32 bar = (F32) mGraphRect.mLeft + frame_delta*bar_frame;
+ gl_rect_2d(getLocalRect(), LLColor4(0.f, 0.f, 0.f, 0.25f));
- gGL.color4f(0.5f,0.5f,0.5f,1);
-
- gGL.begin(LLRender::LINES);
- gGL.vertex2i((S32)bar, mGraphRect.mBottom);
- gGL.vertex2i((S32)bar, mGraphRect.mTop);
- gGL.end();
- }
- }
+ drawHelp(getRect().getHeight() - MARGIN);
+ drawLegend();
- U64 cur_max = 0;
- for(timer_tree_iterator_t it = begin_timer_tree(getFrameTimer());
- it != end_timer_tree();
- ++it)
- {
- LLFastTimer::NamedTimer* idp = (*it);
-
- //fatten highlighted timer
- if (mHoverID == idp)
- {
- gGL.flush();
- glLineWidth(3);
- }
-
- const F32 * col = sTimerColors[idp].mV;// ft_display_table[idx].color->mV;
-
- F32 alpha = 1.f;
-
- if (mHoverID != NULL &&
- idp != mHoverID)
- { //fade out non-highlighted timers
- if (idp->getParent() != mHoverID)
- {
- alpha = alpha_interp;
- }
- }
-
- gGL.color4f(col[0], col[1], col[2], alpha);
- gGL.begin(LLRender::TRIANGLE_STRIP);
- for (U32 j = llmax(0, LLFastTimer::NamedTimer::HISTORY_NUM - LLFastTimer::getLastFrameIndex());
- j < LLFastTimer::NamedTimer::HISTORY_NUM;
- j++)
- {
- U64 ticks = idp->getHistoricalCount(j);
-
- if (mDisplayHz)
- {
- F64 tc = (F64) (ticks+1) * iclock_freq;
- tc = 1000.f/tc;
- ticks = llmin((U64) tc, (U64) 1024);
- }
- else if (mDisplayCalls)
- {
- ticks = (S32)idp->getHistoricalCalls(j);
- }
-
- if (alpha == 1.f)
- {
- //normalize to highlighted timer
- cur_max = llmax(cur_max, ticks);
- }
- F32 x = mGraphRect.mLeft + ((F32) (mGraphRect.getWidth()))/(LLFastTimer::NamedTimer::HISTORY_NUM-1)*j;
- F32 y = mGraphRect.mBottom + (F32) mGraphRect.getHeight()/max_ticks*ticks;
- gGL.vertex2f(x,y);
- gGL.vertex2f(x,mGraphRect.mBottom);
- }
- gGL.end();
-
- if (mHoverID == idp)
- {
- gGL.flush();
- glLineWidth(1);
- }
-
- if (idp->getCollapsed())
- {
- //skip hidden timers
- it.skipDescendants();
- }
- }
-
- //interpolate towards new maximum
- last_max = (U64) lerp((F32)last_max, (F32) cur_max, LLCriticalDamp::getInterpolant(0.1f));
- if (last_max - cur_max <= 1 || cur_max - last_max <= 1)
- {
- last_max = cur_max;
- }
- F32 alpha_target = last_max > cur_max ?
- llmin((F32) last_max/ (F32) cur_max - 1.f,1.f) :
- llmin((F32) cur_max/ (F32) last_max - 1.f,1.f);
- alpha_interp = lerp(alpha_interp, alpha_target, LLCriticalDamp::getInterpolant(0.1f));
-
- if (mHoverID != NULL)
- {
- x = (mGraphRect.mRight + mGraphRect.mLeft)/2;
- y = mGraphRect.mBottom + 8;
-
- LLFontGL::getFontMonospace()->renderUTF8(
- mHoverID->getName(),
- 0,
- x, y,
- LLColor4::white,
- LLFontGL::LEFT, LLFontGL::BOTTOM);
- }
- }
- }
-
- // Output stats for clicked bar to log
- if (mPrintStats >= 0)
- {
- std::string legend_stat;
- bool first = true;
- for(timer_tree_iterator_t it = begin_timer_tree(getFrameTimer());
- it != end_timer_tree();
- ++it)
- {
- LLFastTimer::NamedTimer* idp = (*it);
-
- if (!first)
- {
- legend_stat += ", ";
- }
- first = false;
- legend_stat += idp->getName();
-
- if (idp->getCollapsed())
- {
- it.skipDescendants();
- }
- }
- llinfos << legend_stat << llendl;
-
- std::string timer_stat;
- first = true;
- for(timer_tree_iterator_t it = begin_timer_tree(getFrameTimer());
- it != end_timer_tree();
- ++it)
- {
- LLFastTimer::NamedTimer* idp = (*it);
-
- if (!first)
- {
- timer_stat += ", ";
- }
- first = false;
-
- U64 ticks;
- if (mPrintStats > 0)
- {
- ticks = idp->getHistoricalCount(mPrintStats);
- }
- else
- {
- ticks = idp->getCountAverage();
- }
- F32 ms = (F32)((F64)ticks * iclock_freq);
-
- timer_stat += llformat("%.1f",ms);
+ //mBarRect.mLeft = MARGIN + LEGEND_WIDTH + 8;
+ //mBarRect.mTop = y;
+ //mBarRect.mRight = getRect().getWidth() - MARGIN;
+ //mBarRect.mBottom = MARGIN + LINE_GRAPH_HEIGHT;
+
+ drawBars();
+ drawLineGraph();
+ printLineStats();
+ LLView::draw();
- if (idp->getCollapsed())
- {
- it.skipDescendants();
- }
- }
- llinfos << timer_stat << llendl;
- mPrintStats = -1;
- }
-
+ mAllTimeMax = llmax(mAllTimeMax, mRecording.getLastRecording().getSum(FTM_FRAME));
mHoverID = NULL;
mHoverBarIndex = -1;
-
- LLView::draw();
}
-F64 LLFastTimerView::getTime(const std::string& name)
+void LLFastTimerView::onOpen(const LLSD& key)
{
- const LLFastTimer::NamedTimer* timerp = LLFastTimer::getTimerByName(name);
- if (timerp)
+ setPauseState(false);
+ mRecording.reset();
+ mRecording.appendPeriodicRecording(LLTrace::get_frame_recording());
+ for(std::deque<TimerBarRow>::iterator it = mTimerBarRows.begin(), end_it = mTimerBarRows.end();
+ it != end_it;
+ ++it)
{
- return (F64)timerp->getCountAverage() / (F64)LLFastTimer::countsPerSecond();
+ delete []it->mBars;
+ it->mBars = NULL;
}
- return 0.0;
+}
+
+void LLFastTimerView::onClose(bool app_quitting)
+{
+ setVisible(FALSE);
}
void saveChart(const std::string& label, const char* suffix, LLImageRaw* scratch)
@@ -1431,7 +826,7 @@ void LLFastTimerView::doAnalysisDefault(std::string baseline, std::string target
std::ifstream target_is(target.c_str());
if (!base_is.is_open() || !target_is.is_open())
{
- llwarns << "'-analyzeperformance' error : baseline or current target file inexistent" << llendl;
+ LL_WARNS() << "'-analyzeperformance' error : baseline or current target file inexistent" << LL_ENDL;
base_is.close();
target_is.close();
return;
@@ -1445,7 +840,7 @@ void LLFastTimerView::doAnalysisDefault(std::string baseline, std::string target
LLSD current = analyzePerformanceLogDefault(target_is);
target_is.close();
- //output comparision
+ //output comparison
std::ofstream os(output.c_str());
LLSD::Real session_time = current["SessionTime"].asReal();
@@ -1533,26 +928,724 @@ void LLFastTimerView::outputAllMetrics()
//static
void LLFastTimerView::doAnalysis(std::string baseline, std::string target, std::string output)
{
- if(LLFastTimer::sLog)
+ if(BlockTimer::sLog)
{
doAnalysisDefault(baseline, target, output) ;
return ;
}
- if(LLFastTimer::sMetricLog)
+ if(BlockTimer::sMetricLog)
{
LLMetricPerformanceTesterBasic::doAnalysisMetrics(baseline, target, output) ;
return ;
}
}
-void LLFastTimerView::onClickCloseBtn(bool)
+
+
+void LLFastTimerView::printLineStats()
+{
+ // Output stats for clicked bar to log
+ if (mStatsIndex >= 0)
+ {
+ std::string legend_stat;
+ bool first = true;
+ for(block_timer_tree_df_iterator_t it = LLTrace::begin_block_timer_tree_df(FTM_FRAME);
+ it != LLTrace::end_block_timer_tree_df();
+ ++it)
+ {
+ BlockTimerStatHandle* idp = (*it);
+
+ if (!first)
+ {
+ legend_stat += ", ";
+ }
+ first = false;
+ legend_stat += idp->getName();
+
+ //if (idp->getTreeNode().mCollapsed)
+ //{
+ // it.skipDescendants();
+ //}
+ }
+ LL_INFOS() << legend_stat << LL_ENDL;
+
+ std::string timer_stat;
+ first = true;
+ for(block_timer_tree_df_iterator_t it = LLTrace::begin_block_timer_tree_df(FTM_FRAME);
+ it != LLTrace::end_block_timer_tree_df();
+ ++it)
+ {
+ BlockTimerStatHandle* idp = (*it);
+
+ if (!first)
+ {
+ timer_stat += ", ";
+ }
+ first = false;
+
+ F32Seconds ticks;
+ if (mStatsIndex == 0)
+ {
+ ticks = mRecording.getPeriodMean(*idp, RUNNING_AVERAGE_WIDTH);
+ }
+ else
+ {
+ ticks = mRecording.getPrevRecording(mStatsIndex).getSum(*idp);
+ }
+ F32Milliseconds ms = ticks;
+
+ timer_stat += llformat("%.1f",ms.value());
+
+ //if (idp->getTreeNode().mCollapsed)
+ //{
+ // it.skipDescendants();
+ //}
+ }
+ LL_INFOS() << timer_stat << LL_ENDL;
+ mStatsIndex = -1;
+ }
+}
+
+static LLTrace::BlockTimerStatHandle FTM_DRAW_LINE_GRAPH("Draw line graph");
+
+void LLFastTimerView::drawLineGraph()
+{
+ LL_RECORD_BLOCK_TIME(FTM_DRAW_LINE_GRAPH);
+ //draw line graph history
+ gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+ LLLocalClipRect clip(mGraphRect);
+
+ //normalize based on last frame's maximum
+ static F32Seconds max_time(0.000001);
+ static U32 max_calls = 0;
+ static F32 alpha_interp = 0.f;
+
+ //highlight visible range
+ {
+ S32 first_frame = mRecording.getNumRecordedPeriods() - mScrollIndex;
+ S32 last_frame = first_frame - MAX_VISIBLE_HISTORY;
+
+ F32 frame_delta = ((F32) (mGraphRect.getWidth()))/(mRecording.getNumRecordedPeriods()-1);
+
+ F32 right = (F32) mGraphRect.mLeft + frame_delta*first_frame;
+ F32 left = (F32) mGraphRect.mLeft + frame_delta*last_frame;
+
+ gGL.color4f(0.5f,0.5f,0.5f,0.3f);
+ gl_rect_2d((S32) left, mGraphRect.mTop, (S32) right, mGraphRect.mBottom);
+
+ if (mHoverBarIndex > 0)
+ {
+ S32 bar_frame = first_frame - (mScrollIndex + mHoverBarIndex) - 1;
+ F32 bar = (F32) mGraphRect.mLeft + frame_delta*bar_frame;
+
+ gGL.color4f(0.5f,0.5f,0.5f,1);
+
+ gGL.begin(LLRender::LINES);
+ gGL.vertex2i((S32)bar, mGraphRect.mBottom);
+ gGL.vertex2i((S32)bar, mGraphRect.mTop);
+ gGL.end();
+ }
+ }
+
+ F32Seconds cur_max(0);
+ U32 cur_max_calls = 0;
+ for(block_timer_tree_df_iterator_t it = LLTrace::begin_block_timer_tree_df(FTM_FRAME);
+ it != LLTrace::end_block_timer_tree_df();
+ ++it)
+ {
+ BlockTimerStatHandle* idp = (*it);
+
+ //fatten highlighted timer
+ if (mHoverID == idp)
+ {
+ gGL.flush();
+ glLineWidth(3);
+ }
+
+ llassert(idp->getIndex() < sTimerColors.size());
+ const F32 * col = sTimerColors[idp->getIndex()].mV;// ft_display_table[idx].color->mV;
+
+ F32 alpha = 1.f;
+ bool is_hover_timer = true;
+
+ if (mHoverID != NULL &&
+ mHoverID != idp)
+ { //fade out non-highlighted timers
+ if (idp->getParent() != mHoverID)
+ {
+ alpha = alpha_interp;
+ is_hover_timer = false;
+ }
+ }
+
+ gGL.color4f(col[0], col[1], col[2], alpha);
+ gGL.begin(LLRender::TRIANGLE_STRIP);
+ F32 call_scale_factor = (F32)mGraphRect.getHeight() / (F32)max_calls;
+ F32 time_scale_factor = (F32)mGraphRect.getHeight() / max_time.value();
+ F32 hz_scale_factor = (F32) mGraphRect.getHeight() / (1.f / max_time.value());
+ for (U32 j = mRecording.getNumRecordedPeriods();
+ j > 0;
+ j--)
+ {
+ LLTrace::Recording& recording = mRecording.getPrevRecording(j);
+ F32Seconds time = llmax(recording.getSum(*idp), F64Seconds(0.000001));
+ U32 calls = recording.getSum(idp->callCount());
+
+ if (is_hover_timer)
+ {
+ //normalize to highlighted timer
+ cur_max = llmax(cur_max, time);
+ cur_max_calls = llmax(cur_max_calls, calls);
+ }
+ F32 x = mGraphRect.mRight - j * (F32)(mGraphRect.getWidth())/(mRecording.getNumRecordedPeriods()-1);
+ F32 y;
+ switch(mDisplayType)
+{
+ case DISPLAY_TIME:
+ y = mGraphRect.mBottom + time.value() * time_scale_factor;
+ break;
+ case DISPLAY_CALLS:
+ y = mGraphRect.mBottom + (F32)calls * call_scale_factor;
+ break;
+ case DISPLAY_HZ:
+ y = mGraphRect.mBottom + (1.f / time.value()) * hz_scale_factor;
+ break;
+ }
+ gGL.vertex2f(x,y);
+ gGL.vertex2f(x,mGraphRect.mBottom);
+ }
+ gGL.end();
+
+ if (mHoverID == idp)
+ {
+ gGL.flush();
+ glLineWidth(1);
+ }
+
+ if (idp->getTreeNode().mCollapsed)
+ {
+ //skip hidden timers
+ it.skipDescendants();
+ }
+ }
+
+ //interpolate towards new maximum
+ max_time = (F32Seconds)lerp(max_time.value(), cur_max.value(), LLSmoothInterpolation::getInterpolant(0.1f));
+ if (llabs((max_time - cur_max).value()) <= 1)
+ {
+ max_time = llmax(F32Microseconds(1.f), F32Microseconds(cur_max));
+ }
+
+ max_calls = llround(lerp((F32)max_calls, (F32) cur_max_calls, LLSmoothInterpolation::getInterpolant(0.1f)));
+ if (llabs((S32)(max_calls - cur_max_calls)) <= 1)
+ {
+ max_calls = cur_max_calls;
+ }
+
+ // TODO: make sure alpha is correct in DisplayHz mode
+ F32 alpha_target = (max_time > cur_max)
+ ? llmin(max_time / cur_max - 1.f,1.f)
+ : llmin(cur_max/ max_time - 1.f,1.f);
+ alpha_interp = lerp(alpha_interp, alpha_target, LLSmoothInterpolation::getInterpolant(0.1f));
+
+ if (mHoverID != NULL)
+ {
+ S32 x = (mGraphRect.mRight + mGraphRect.mLeft)/2;
+ S32 y = mGraphRect.mBottom + 8;
+
+ LLFontGL::getFontMonospace()->renderUTF8(
+ mHoverID->getName(),
+ 0,
+ x, y,
+ LLColor4::white,
+ LLFontGL::LEFT, LLFontGL::BOTTOM);
+ }
+
+ //display y-axis range
+ std::string axis_label;
+ switch(mDisplayType)
+ {
+ case DISPLAY_TIME:
+ axis_label = llformat("%4.2f ms", F32Milliseconds(max_time).value());
+ break;
+ case DISPLAY_CALLS:
+ axis_label = llformat("%d calls", (int)max_calls);
+ break;
+ case DISPLAY_HZ:
+ axis_label = llformat("%4.2f Hz", max_time.value() ? 1.f / max_time.value() : 0.f);
+ break;
+ }
+
+ LLFontGL* font = LLFontGL::getFontMonospace();
+ S32 x = mGraphRect.mRight - font->getWidth(axis_label)-5;
+ S32 y = mGraphRect.mTop - font->getLineHeight();;
+
+ font->renderUTF8(axis_label, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP);
+}
+
+void LLFastTimerView::drawLegend()
+{
+ // draw legend
+ S32 dx;
+ S32 x = mLegendRect.mLeft;
+ S32 y = mLegendRect.mTop;
+ const S32 TEXT_HEIGHT = (S32)LLFontGL::getFontMonospace()->getLineHeight();
+
+ {
+ LLLocalClipRect clip(mLegendRect);
+ S32 cur_line = 0;
+ ft_display_idx.clear();
+ std::map<BlockTimerStatHandle*, S32> display_line;
+ for (block_timer_tree_df_iterator_t it = LLTrace::begin_block_timer_tree_df(FTM_FRAME);
+ it != block_timer_tree_df_iterator_t();
+ ++it)
+ {
+ BlockTimerStatHandle* idp = (*it);
+ display_line[idp] = cur_line;
+ ft_display_idx.push_back(idp);
+ cur_line++;
+
+ x = MARGIN;
+
+ LLRect bar_rect(x, y, x + TEXT_HEIGHT, y - TEXT_HEIGHT);
+ S32 scale_offset = 0;
+ if (idp == mHoverID)
+ {
+ scale_offset = llfloor(sinf(mHighlightTimer.getElapsedTimeF32() * 6.f) * 2.f);
+ }
+ bar_rect.stretch(scale_offset);
+ llassert(idp->getIndex() < sTimerColors.size());
+ gl_rect_2d(bar_rect, sTimerColors[idp->getIndex()]);
+
+ F32Milliseconds ms(0);
+ S32 calls = 0;
+ if (mHoverBarIndex > 0 && mHoverID)
+ {
+ S32 hidx = mScrollIndex + mHoverBarIndex;
+ ms = mRecording.getPrevRecording(hidx).getSum(*idp);
+ calls = mRecording.getPrevRecording(hidx).getSum(idp->callCount());
+ }
+ else
+ {
+ ms = F64Seconds(mRecording.getPeriodMean(*idp, RUNNING_AVERAGE_WIDTH));
+ calls = (S32)mRecording.getPeriodMean(idp->callCount(), RUNNING_AVERAGE_WIDTH);
+ }
+
+ std::string timer_label;
+ switch(mDisplayType)
+ {
+ case DISPLAY_TIME:
+ timer_label = llformat("%s [%.1f]",idp->getName().c_str(),ms.value());
+ break;
+ case DISPLAY_CALLS:
+ timer_label = llformat("%s (%d)",idp->getName().c_str(),calls);
+ break;
+ case DISPLAY_HZ:
+ timer_label = llformat("%.1f", ms.value() ? (1.f / ms.value()) : 0.f);
+ break;
+ }
+ dx = (TEXT_HEIGHT+4) + get_depth(idp)*8;
+
+ LLColor4 color = LLColor4::white;
+ if (get_depth(idp) > 0)
+ {
+ S32 line_start_y = bar_rect.getCenterY();
+ S32 line_end_y = line_start_y + ((TEXT_HEIGHT + 2) * (cur_line - display_line[idp->getParent()])) - TEXT_HEIGHT;
+ gl_line_2d(x + dx - 8, line_start_y, x + dx, line_start_y, color);
+ S32 line_x = x + (TEXT_HEIGHT + 4) + ((get_depth(idp) - 1) * 8);
+ gl_line_2d(line_x, line_start_y, line_x, line_end_y, color);
+ if (idp->getTreeNode().mCollapsed && !idp->getChildren().empty())
+ {
+ gl_line_2d(line_x+4, line_start_y-3, line_x+4, line_start_y+4, color);
+ }
+ }
+
+ x += dx;
+ BOOL is_child_of_hover_item = (idp == mHoverID);
+ BlockTimerStatHandle* next_parent = idp->getParent();
+ while(!is_child_of_hover_item && next_parent)
+ {
+ is_child_of_hover_item = (mHoverID == next_parent);
+ if (next_parent->getParent() == next_parent) break;
+ next_parent = next_parent->getParent();
+ }
+
+ LLFontGL::getFontMonospace()->renderUTF8(timer_label, 0,
+ x, y,
+ color,
+ LLFontGL::LEFT, LLFontGL::TOP,
+ is_child_of_hover_item ? LLFontGL::BOLD : LLFontGL::NORMAL);
+
+ y -= (TEXT_HEIGHT + 2);
+
+ if (idp->getTreeNode().mCollapsed)
+ {
+ it.skipDescendants();
+ }
+ }
+ }
+}
+
+void LLFastTimerView::generateUniqueColors()
+{
+ // generate unique colors
+ {
+ sTimerColors.resize(LLTrace::BlockTimerStatHandle::getNumIndices());
+ sTimerColors[FTM_FRAME.getIndex()] = LLColor4::grey;
+
+ F32 hue = 0.f;
+
+ for (block_timer_tree_df_iterator_t it = LLTrace::begin_block_timer_tree_df(FTM_FRAME);
+ it != block_timer_tree_df_iterator_t();
+ ++it)
+ {
+ BlockTimerStatHandle* idp = (*it);
+
+ const F32 HUE_INCREMENT = 0.23f;
+ hue = fmodf(hue + HUE_INCREMENT, 1.f);
+ // saturation increases with depth
+ F32 saturation = clamp_rescale((F32)get_depth(idp), 0.f, 3.f, 0.f, 1.f);
+ // lightness alternates with depth
+ F32 lightness = get_depth(idp) % 2 ? 0.5f : 0.6f;
+
+ LLColor4 child_color;
+ child_color.setHSL(hue, saturation, lightness);
+
+ llassert(idp->getIndex() < sTimerColors.size());
+ sTimerColors[idp->getIndex()] = child_color;
+ }
+ }
+}
+
+void LLFastTimerView::drawHelp( S32 y )
+{
+ // Draw some help
+ const S32 texth = (S32)LLFontGL::getFontMonospace()->getLineHeight();
+
+ y -= (texth + 2);
+ y -= (texth + 2);
+
+ LLFontGL::getFontMonospace()->renderUTF8(std::string("[Right-Click log selected]"),
+ 0, MARGIN, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP);
+}
+
+void LLFastTimerView::drawTicks()
+{
+ // Draw MS ticks
+ {
+ U32Milliseconds ms = mTotalTimeDisplay;
+ std::string tick_label;
+ S32 x;
+ S32 barw = mBarRect.getWidth();
+
+ tick_label = llformat("%.1f ms |", (F32)ms.value()*.25f);
+ x = mBarRect.mLeft + barw/4 - LLFontGL::getFontMonospace()->getWidth(tick_label);
+ LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, x, mBarRect.mTop, LLColor4::white,
+ LLFontGL::LEFT, LLFontGL::TOP);
+
+ tick_label = llformat("%.1f ms |", (F32)ms.value()*.50f);
+ x = mBarRect.mLeft + barw/2 - LLFontGL::getFontMonospace()->getWidth(tick_label);
+ LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, x, mBarRect.mTop, LLColor4::white,
+ LLFontGL::LEFT, LLFontGL::TOP);
+
+ tick_label = llformat("%.1f ms |", (F32)ms.value()*.75f);
+ x = mBarRect.mLeft + (barw*3)/4 - LLFontGL::getFontMonospace()->getWidth(tick_label);
+ LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, x, mBarRect.mTop, LLColor4::white,
+ LLFontGL::LEFT, LLFontGL::TOP);
+
+ tick_label = llformat( "%d ms |", (U32)ms.value());
+ x = mBarRect.mLeft + barw - LLFontGL::getFontMonospace()->getWidth(tick_label);
+ LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, x, mBarRect.mTop, LLColor4::white,
+ LLFontGL::LEFT, LLFontGL::TOP);
+ }
+}
+
+void LLFastTimerView::drawBorders( S32 y, const S32 x_start, S32 bar_height, S32 dy )
+{
+ // Draw borders
+ {
+ S32 by = y + 6 + (S32)LLFontGL::getFontMonospace()->getLineHeight();
+
+ //heading
+ gl_rect_2d(x_start-5, by, getRect().getWidth()-5, y+5, LLColor4::grey, FALSE);
+
+ //tree view
+ gl_rect_2d(5, by, x_start-10, 5, LLColor4::grey, FALSE);
+
+ by = y + 5;
+ //average bar
+ gl_rect_2d(x_start-5, by, getRect().getWidth()-5, by-bar_height-dy-5, LLColor4::grey, FALSE);
+
+ by -= bar_height*2+dy;
+
+ //current frame bar
+ gl_rect_2d(x_start-5, by, getRect().getWidth()-5, by-bar_height-dy-2, LLColor4::grey, FALSE);
+
+ by -= bar_height+dy+1;
+
+ //history bars
+ gl_rect_2d(x_start-5, by, getRect().getWidth()-5, LINE_GRAPH_HEIGHT-bar_height-dy-2, LLColor4::grey, FALSE);
+
+ by = LINE_GRAPH_HEIGHT-dy;
+
+ //line graph
+ //mGraphRect = LLRect(x_start-5, by, getRect().getWidth()-5, 5);
+
+ gl_rect_2d(mGraphRect, FALSE);
+ }
+}
+
+void LLFastTimerView::updateTotalTime()
+{
+ switch(mDisplayMode)
+ {
+ case 0:
+ mTotalTimeDisplay = mRecording.getPeriodMean(FTM_FRAME, RUNNING_AVERAGE_WIDTH)*2;
+ break;
+ case 1:
+ mTotalTimeDisplay = mRecording.getPeriodMax(FTM_FRAME);
+ break;
+ case 2:
+ // Calculate the max total ticks for the current history
+ mTotalTimeDisplay = mRecording.getPeriodMax(FTM_FRAME, 20);
+ break;
+ default:
+ mTotalTimeDisplay = F64Milliseconds(100);
+ break;
+ }
+
+ mTotalTimeDisplay = LLUnits::Milliseconds::fromValue(llceil(mTotalTimeDisplay.valueInUnits<LLUnits::Milliseconds>() / 20.f) * 20.f);
+}
+
+void LLFastTimerView::drawBars()
+{
+ LLLocalClipRect clip(mBarRect);
+
+ S32 bar_height = mBarRect.getHeight() / (MAX_VISIBLE_HISTORY + 2);
+ const S32 vpad = llmax(1, bar_height / 4); // spacing between bars
+ bar_height -= vpad;
+
+ updateTotalTime();
+ if (mTotalTimeDisplay <= (F32Seconds)0.0) return;
+
+ drawTicks();
+ const S32 bars_top = mBarRect.mTop - ((S32)LLFontGL::getFontMonospace()->getLineHeight() + 4);
+ drawBorders(bars_top, mBarRect.mLeft, bar_height, vpad);
+
+ // Draw bars for each history entry
+ // Special: 0 = show running average
+ LLPointer<LLUIImage> bar_image = LLUI::getUIImage("Rounded_Square");
+
+ const S32 image_width = bar_image->getTextureWidth();
+ const S32 image_height = bar_image->getTextureHeight();
+
+ gGL.getTexUnit(0)->bind(bar_image->getImage());
+ {
+ const S32 histmax = (S32)mRecording.getNumRecordedPeriods();
+
+ // update widths
+ if (!mPauseHistory)
+ {
+ U32 bar_index = 0;
+ if (!mAverageTimerRow.mBars)
+ {
+ mAverageTimerRow.mBars = new TimerBar[LLTrace::BlockTimerStatHandle::instance_tracker_t::instanceCount()];
+ }
+ updateTimerBarWidths(&FTM_FRAME, mAverageTimerRow, -1, bar_index);
+ updateTimerBarOffsets(&FTM_FRAME, mAverageTimerRow);
+
+ for (S32 history_index = 1; history_index <= histmax; history_index++)
+ {
+ llassert(history_index <= mTimerBarRows.size());
+ TimerBarRow& row = mTimerBarRows[history_index - 1];
+ bar_index = 0;
+ if (!row.mBars)
+ {
+ row.mBars = new TimerBar[LLTrace::BlockTimerStatHandle::instance_tracker_t::instanceCount()];
+ updateTimerBarWidths(&FTM_FRAME, row, history_index, bar_index);
+ updateTimerBarOffsets(&FTM_FRAME, row);
+ }
+ }
+ }
+
+ // draw bars
+ LLRect frame_bar_rect;
+ frame_bar_rect.setLeftTopAndSize(mBarRect.mLeft,
+ bars_top,
+ llround((mAverageTimerRow.mBars[0].mTotalTime / mTotalTimeDisplay) * mBarRect.getWidth()),
+ bar_height);
+ mAverageTimerRow.mTop = frame_bar_rect.mTop;
+ mAverageTimerRow.mBottom = frame_bar_rect.mBottom;
+ drawBar(frame_bar_rect, mAverageTimerRow, image_width, image_height);
+ frame_bar_rect.translate(0, -(bar_height + vpad + bar_height));
+
+ for(S32 bar_index = mScrollIndex; bar_index < llmin(histmax, mScrollIndex + MAX_VISIBLE_HISTORY); ++bar_index)
+ {
+ llassert(bar_index < mTimerBarRows.size());
+ TimerBarRow& row = mTimerBarRows[bar_index];
+ row.mTop = frame_bar_rect.mTop;
+ row.mBottom = frame_bar_rect.mBottom;
+ frame_bar_rect.mRight = frame_bar_rect.mLeft
+ + llround((row.mBars[0].mTotalTime / mTotalTimeDisplay) * mBarRect.getWidth());
+ drawBar(frame_bar_rect, row, image_width, image_height);
+
+ frame_bar_rect.translate(0, -(bar_height + vpad));
+ }
+
+ }
+ gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+}
+
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_TIMER_BAR_WIDTHS("Update timer bar widths");
+
+F32Seconds LLFastTimerView::updateTimerBarWidths(LLTrace::BlockTimerStatHandle* time_block, TimerBarRow& row, S32 history_index, U32& bar_index)
{
- setVisible(false);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_TIMER_BAR_WIDTHS);
+ const F32Seconds self_time = history_index == -1
+ ? mRecording.getPeriodMean(time_block->selfTime(), RUNNING_AVERAGE_WIDTH)
+ : mRecording.getPrevRecording(history_index).getSum(time_block->selfTime());
+
+ F32Seconds full_time = self_time;
+
+ // reserve a spot for this bar to be rendered before its children
+ // even though we don't know its size yet
+ TimerBar& timer_bar = row.mBars[bar_index];
+ bar_index++;
+
+ for (BlockTimerStatHandle::child_iter it = time_block->beginChildren(), end_it = time_block->endChildren(); it != end_it; ++it)
+ {
+ full_time += updateTimerBarWidths(*it, row, history_index, bar_index);
+ }
+
+ timer_bar.mTotalTime = full_time;
+ timer_bar.mSelfTime = self_time;
+ timer_bar.mTimeBlock = time_block;
+
+ return full_time;
}
-LLFastTimer::NamedTimer& LLFastTimerView::getFrameTimer()
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_TIMER_BAR_FRACTIONS("Update timer bar fractions");
+
+S32 LLFastTimerView::updateTimerBarOffsets(LLTrace::BlockTimerStatHandle* time_block, TimerBarRow& row, S32 timer_bar_index)
{
- return FTM_FRAME.getNamedTimer();
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_TIMER_BAR_FRACTIONS);
+
+ TimerBar& timer_bar = row.mBars[timer_bar_index];
+ const F32Seconds bar_time = timer_bar.mTotalTime - timer_bar.mSelfTime;
+ timer_bar.mChildrenStart = timer_bar.mSelfStart + timer_bar.mSelfTime / 2;
+ timer_bar.mChildrenEnd = timer_bar.mChildrenStart + timer_bar.mTotalTime - timer_bar.mSelfTime;
+
+ if (timer_bar_index == 0)
+ {
+ timer_bar.mSelfStart = F32Seconds(0.f);
+ timer_bar.mSelfEnd = bar_time;
+ }
+
+ //now loop through children and figure out portion of bar image covered by each bar, now that we know the
+ //sum of all children
+ F32 bar_fraction_start = 0.f;
+ TimerBar* last_child_timer_bar = NULL;
+
+ bool first_child = true;
+ for (BlockTimerStatHandle::child_iter it = time_block->beginChildren(), end_it = time_block->endChildren();
+ it != end_it;
+ ++it)
+ {
+ timer_bar_index++;
+
+ TimerBar& child_timer_bar = row.mBars[timer_bar_index];
+ BlockTimerStatHandle* child_time_block = *it;
+
+ if (last_child_timer_bar)
+ {
+ last_child_timer_bar->mLastChild = false;
+ }
+ child_timer_bar.mLastChild = true;
+ last_child_timer_bar = &child_timer_bar;
+
+ child_timer_bar.mFirstChild = first_child;
+ if (first_child)
+ {
+ first_child = false;
+ }
+
+ child_timer_bar.mStartFraction = bar_fraction_start;
+ child_timer_bar.mEndFraction = bar_time > (S32Seconds)0
+ ? bar_fraction_start + child_timer_bar.mTotalTime / bar_time
+ : 1.f;
+ child_timer_bar.mSelfStart = timer_bar.mChildrenStart
+ + child_timer_bar.mStartFraction
+ * (timer_bar.mChildrenEnd - timer_bar.mChildrenStart);
+ child_timer_bar.mSelfEnd = timer_bar.mChildrenStart
+ + child_timer_bar.mEndFraction
+ * (timer_bar.mChildrenEnd - timer_bar.mChildrenStart);
+
+ timer_bar_index = updateTimerBarOffsets(child_time_block, row, timer_bar_index);
+
+ bar_fraction_start = child_timer_bar.mEndFraction;
+ }
+ return timer_bar_index;
}
+S32 LLFastTimerView::drawBar(LLRect bar_rect, TimerBarRow& row, S32 image_width, S32 image_height, bool hovered, bool visible, S32 bar_index)
+{
+ TimerBar& timer_bar = row.mBars[bar_index];
+ LLTrace::BlockTimerStatHandle* time_block = timer_bar.mTimeBlock;
+
+ hovered |= mHoverID == time_block;
+
+ // animate scale of bar when hovering over that particular timer
+ if (visible && (F32)bar_rect.getWidth() * (timer_bar.mEndFraction - timer_bar.mStartFraction) > 2.f)
+ {
+ LLRect render_rect(bar_rect);
+ S32 scale_offset = 0;
+ if (mHoverID == time_block)
+ {
+ scale_offset = llfloor(sinf(mHighlightTimer.getElapsedTimeF32() * 6.f) * 3.f);
+ render_rect.mTop += scale_offset;
+ render_rect.mBottom -= scale_offset;
+ }
+
+ llassert(time_block->getIndex() < sTimerColors.size());
+ LLColor4 color = sTimerColors[time_block->getIndex()];
+ if (!hovered) color = lerp(color, LLColor4::grey, 0.2f);
+ gGL.color4fv(color.mV);
+ gl_segmented_rect_2d_fragment_tex(render_rect,
+ image_width, image_height,
+ 16,
+ timer_bar.mStartFraction, timer_bar.mEndFraction);
+ }
+
+ LLRect children_rect;
+ children_rect.mLeft = llround(timer_bar.mChildrenStart / mTotalTimeDisplay * (F32)mBarRect.getWidth()) + mBarRect.mLeft;
+ children_rect.mRight = llround(timer_bar.mChildrenEnd / mTotalTimeDisplay * (F32)mBarRect.getWidth()) + mBarRect.mLeft;
+
+ if (bar_rect.getHeight() > MIN_BAR_HEIGHT)
+ {
+ // shrink as we go down a level
+ children_rect.mTop = bar_rect.mTop - 1;
+ children_rect.mBottom = bar_rect.mBottom + 1;
+ }
+ else
+ {
+ children_rect.mTop = bar_rect.mTop;
+ children_rect.mBottom = bar_rect.mBottom;
+ }
+
+ bool children_visible = visible && !time_block->getTreeNode().mCollapsed;
+ bar_index++;
+ const U32 num_bars = LLTrace::BlockTimerStatHandle::instance_tracker_t::instanceCount();
+ if (bar_index < num_bars && row.mBars[bar_index].mFirstChild)
+ {
+ bool is_last = false;
+ do
+ {
+ is_last = row.mBars[bar_index].mLastChild;
+ bar_index = drawBar(children_rect, row, image_width, image_height, hovered, children_visible, bar_index);
+ }
+ while(!is_last && bar_index < num_bars);
+ }
+
+ return bar_index;
+}
diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h
index 1349b1e99c..3e30bd86ba 100755
--- a/indra/newview/llfasttimerview.h
+++ b/indra/newview/llfasttimerview.h
@@ -29,11 +29,15 @@
#include "llfloater.h"
#include "llfasttimer.h"
+#include "llunits.h"
+#include "lltracerecording.h"
+#include <deque>
class LLFastTimerView : public LLFloater
{
public:
LLFastTimerView(const LLSD&);
+ ~LLFastTimerView();
BOOL postBuild();
static BOOL sAnalyzePerformance;
@@ -46,7 +50,6 @@ private:
static LLSD analyzePerformanceLogDefault(std::istream& is) ;
static void exportCharts(const std::string& base, const std::string& target);
void onPause();
- LLFastTimer::NamedTimer& getFrameTimer();
public:
@@ -58,40 +61,87 @@ public:
virtual BOOL handleToolTip(S32 x, S32 y, MASK mask);
virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
virtual void draw();
+ virtual void onOpen(const LLSD& key);
+ virtual void onClose(bool app_quitting);
+ LLTrace::BlockTimerStatHandle* getLegendID(S32 y);
- LLFastTimer::NamedTimer* getLegendID(S32 y);
- F64 getTime(const std::string& name);
-
-protected:
- virtual void onClickCloseBtn(bool app_quitting = false);
private:
- typedef std::vector<std::vector<S32> > bar_positions_t;
- bar_positions_t mBarStart;
- bar_positions_t mBarEnd;
- S32 mDisplayMode;
+ void drawTicks();
+ void drawLineGraph();
+ void drawLegend();
+ void drawHelp(S32 y);
+ void drawBorders( S32 y, const S32 x_start, S32 barh, S32 dy);
+ void drawBars();
+
+ void printLineStats();
+ void generateUniqueColors();
+ void updateTotalTime();
+
+ struct TimerBar
+ {
+ TimerBar()
+ : mTotalTime(0),
+ mSelfTime(0),
+ mStartFraction(0.f),
+ mEndFraction(1.f),
+ mFirstChild(false),
+ mLastChild(false)
+ {}
+ F32Seconds mTotalTime,
+ mSelfTime,
+ mChildrenStart,
+ mChildrenEnd,
+ mSelfStart,
+ mSelfEnd;
+ LLTrace::BlockTimerStatHandle* mTimeBlock;
+ bool mVisible,
+ mFirstChild,
+ mLastChild;
+ F32 mStartFraction,
+ mEndFraction;
+ };
+
+ struct TimerBarRow
+ {
+ TimerBarRow()
+ : mBottom(0),
+ mTop(0),
+ mBars(NULL)
+ {}
+ S32 mBottom,
+ mTop;
+ TimerBar* mBars;
+ };
+
+ F32Seconds updateTimerBarWidths(LLTrace::BlockTimerStatHandle* time_block, TimerBarRow& row, S32 history_index, U32& bar_index);
+ S32 updateTimerBarOffsets(LLTrace::BlockTimerStatHandle* time_block, TimerBarRow& row, S32 timer_bar_index = 0);
+ S32 drawBar(LLRect bar_rect, TimerBarRow& row, S32 image_width, S32 image_height, bool hovered = false, bool visible = true, S32 bar_index = 0);
+ void setPauseState(bool pause_state);
+
+ std::deque<TimerBarRow> mTimerBarRows;
+ TimerBarRow mAverageTimerRow;
- typedef enum child_alignment
+ enum EDisplayType
{
- ALIGN_LEFT,
- ALIGN_CENTER,
- ALIGN_RIGHT,
- ALIGN_COUNT
- } ChildAlignment;
-
- ChildAlignment mDisplayCenter;
- S32 mDisplayCalls;
- S32 mDisplayHz;
- U64 mAvgCountTotal;
- U64 mMaxCountTotal;
- LLRect mBarRect;
- S32 mScrollIndex;
- LLFastTimer::NamedTimer* mHoverID;
- LLFastTimer::NamedTimer* mHoverTimer;
- LLRect mToolTipRect;
- S32 mHoverBarIndex;
- LLFrameTimer mHighlightTimer;
- S32 mPrintStats;
- LLRect mGraphRect;
+ DISPLAY_TIME,
+ DISPLAY_CALLS,
+ DISPLAY_HZ
+ } mDisplayType;
+ bool mPauseHistory;
+ F64Seconds mAllTimeMax,
+ mTotalTimeDisplay;
+ S32 mScrollIndex,
+ mHoverBarIndex,
+ mStatsIndex;
+ S32 mDisplayMode;
+ LLTrace::BlockTimerStatHandle* mHoverID;
+ LLTrace::BlockTimerStatHandle* mHoverTimer;
+ LLRect mToolTipRect,
+ mGraphRect,
+ mBarRect,
+ mLegendRect;
+ LLFrameTimer mHighlightTimer;
+ LLTrace::PeriodicRecording mRecording;
};
#endif
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index a2d0759587..6c5b5be720 100755
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -40,7 +40,6 @@
#include "llagent.h"
#include "llavatarnamecache.h"
#include "llclipboard.h"
-#include "llclipboard.h"
#include "llinventorybridge.h"
#include "llinventoryfunctions.h"
#include "llfloatersidepanelcontainer.h"
@@ -51,7 +50,7 @@
#include "lltoggleablemenu.h"
#include "llviewerinventory.h"
#include "llviewermenu.h"
-#include "llviewermenu.h"
+#include "llviewernetwork.h"
#include "lltooldraganddrop.h"
#include "llsdserialize.h"
@@ -327,6 +326,7 @@ public:
gInventory.updateItem(item);
gInventory.notifyObservers();
+ LLFavoritesOrderStorage::instance().saveOrder();
}
LLView::getWindow()->setCursor(UI_CURSOR_ARROW);
@@ -480,7 +480,7 @@ BOOL LLFavoritesBarCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
const LLUUID favorites_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE);
if (item->getParentUUID() == favorites_id)
{
- llwarns << "Attemt to copy a favorite item into the same folder." << llendl;
+ LL_WARNS() << "Attemt to copy a favorite item into the same folder." << LL_ENDL;
break;
}
@@ -632,7 +632,7 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con
// landmarks to an empty favorites bar.
updateButtons();
- llinfos << "Copied inventory item #" << item->getUUID() << " to favorites." << llendl;
+ LL_INFOS() << "Copied inventory item #" << item->getUUID() << " to favorites." << LL_ENDL;
}
//virtual
@@ -738,7 +738,7 @@ void LLFavoritesBarCtrl::updateButtons()
int first_changed_item_index = 0;
int rightest_point = getRect().mRight - mMoreTextBox->getRect().getWidth();
//lets find first changed button
- while (child_it != childs->end() && first_changed_item_index < mItems.count())
+ while (child_it != childs->end() && first_changed_item_index < mItems.size())
{
LLFavoriteLandmarkButton* button = dynamic_cast<LLFavoriteLandmarkButton*> (*child_it);
if (button)
@@ -760,7 +760,7 @@ void LLFavoritesBarCtrl::updateButtons()
}
// now first_changed_item_index should contains a number of button that need to change
- if (first_changed_item_index <= mItems.count())
+ if (first_changed_item_index <= mItems.size())
{
// Rebuild the buttons only
// child_list_t is a linked list, so safe to erase from the middle if we pre-increment the iterator
@@ -798,7 +798,7 @@ void LLFavoritesBarCtrl::updateButtons()
//last_right_edge is saving coordinates
LLButton* last_new_button = NULL;
int j = first_changed_item_index;
- for (; j < mItems.count(); j++)
+ for (; j < mItems.size(); j++)
{
last_new_button = createButton(mItems[j], button_params, last_right_edge);
if (!last_new_button)
@@ -812,7 +812,7 @@ void LLFavoritesBarCtrl::updateButtons()
}
mFirstDropDownItem = j;
// Chevron button
- if (mFirstDropDownItem < mItems.count())
+ if (mFirstDropDownItem < mItems.size())
{
// if updateButton had been called it means:
//or there are some new favorites, or width had been changed
@@ -871,7 +871,7 @@ LLButton* LLFavoritesBarCtrl::createButton(const LLPointer<LLViewerInventoryItem
fav_btn = LLUICtrlFactory::create<LLFavoriteLandmarkButton>(fav_btn_params);
if (NULL == fav_btn)
{
- llwarns << "Unable to create LLFavoriteLandmarkButton widget: " << item->getName() << llendl;
+ LL_WARNS() << "Unable to create LLFavoriteLandmarkButton widget: " << item->getName() << LL_ENDL;
return NULL;
}
@@ -977,9 +977,9 @@ void LLFavoritesBarCtrl::updateMenuItems(LLToggleableMenu* menu)
U32 widest_item = 0;
- for (S32 i = mFirstDropDownItem; i < mItems.count(); i++)
+ for (S32 i = mFirstDropDownItem; i < mItems.size(); i++)
{
- LLViewerInventoryItem* item = mItems.get(i);
+ LLViewerInventoryItem* item = mItems.at(i);
const std::string& item_name = item->getName();
LLFavoriteLandmarkMenuItem::Params item_params;
@@ -1160,7 +1160,7 @@ bool LLFavoritesBarCtrl::enableSelected(const LLSD& userdata)
void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata)
{
std::string action = userdata.asString();
- llinfos << "Action = " << action << " Item = " << mSelectedItemID.asString() << llendl;
+ LL_INFOS() << "Action = " << action << " Item = " << mSelectedItemID.asString() << LL_ENDL;
LLViewerInventoryItem* item = gInventory.getItem(mSelectedItemID);
if (!item)
@@ -1235,12 +1235,12 @@ BOOL LLFavoritesBarCtrl::isClipboardPasteable() const
return FALSE;
}
- LLDynamicArray<LLUUID> objects;
+ std::vector<LLUUID> objects;
LLClipboard::instance().pasteFromClipboard(objects);
- S32 count = objects.count();
+ S32 count = objects.size();
for(S32 i = 0; i < count; i++)
{
- const LLUUID &item_id = objects.get(i);
+ const LLUUID &item_id = objects.at(i);
// Can't paste folders
const LLInventoryCategory *cat = gInventory.getCategory(item_id);
@@ -1264,13 +1264,13 @@ void LLFavoritesBarCtrl::pasteFromClipboard() const
if(model && isClipboardPasteable())
{
LLInventoryItem* item = NULL;
- LLDynamicArray<LLUUID> objects;
+ std::vector<LLUUID> objects;
LLClipboard::instance().pasteFromClipboard(objects);
- S32 count = objects.count();
+ S32 count = objects.size();
LLUUID parent_id(mFavoriteFolderId);
for(S32 i = 0; i < count; i++)
{
- item = model->getItem(objects.get(i));
+ item = model->getItem(objects.at(i));
if (item)
{
copy_inventory_item(
@@ -1452,6 +1452,18 @@ void LLFavoritesOrderStorage::getSLURL(const LLUUID& asset_id)
void LLFavoritesOrderStorage::destroyClass()
{
LLFavoritesOrderStorage::instance().cleanup();
+
+
+ std::string old_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
+ llifstream file;
+ file.open(old_filename);
+ if (file.is_open())
+ {
+ std::string new_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites_" + LLGridManager::getInstance()->getGrid() + ".xml");
+ LLFile::copy(old_filename,new_filename);
+ LLFile::remove(old_filename);
+ }
+
if (gSavedPerAccountSettings.getBOOL("ShowFavoritesOnLogin"))
{
LLFavoritesOrderStorage::instance().saveFavoritesSLURLs();
@@ -1487,18 +1499,18 @@ void LLFavoritesOrderStorage::saveFavoritesSLURLs()
// Do not change the file if we are not logged in yet.
if (!LLLoginInstance::getInstance()->authSuccess())
{
- llwarns << "Cannot save favorites: not logged in" << llendl;
+ LL_WARNS() << "Cannot save favorites: not logged in" << LL_ENDL;
return;
}
std::string user_dir = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "");
if (user_dir.empty())
{
- llwarns << "Cannot save favorites: empty user dir name" << llendl;
+ LL_WARNS() << "Cannot save favorites: empty user dir name" << LL_ENDL;
return;
}
- std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
+ std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites_" + LLGridManager::getInstance()->getGrid() + ".xml");
llifstream in_file;
in_file.open(filename);
LLSD fav_llsd;
@@ -1522,13 +1534,13 @@ void LLFavoritesOrderStorage::saveFavoritesSLURLs()
slurls_map_t::iterator slurl_iter = mSLURLs.find(value["asset_id"]);
if (slurl_iter != mSLURLs.end())
{
- lldebugs << "Saving favorite: idx=" << LLFavoritesOrderStorage::instance().getSortIndex((*it)->getUUID()) << ", SLURL=" << slurl_iter->second << ", value=" << value << llendl;
+ LL_DEBUGS() << "Saving favorite: idx=" << LLFavoritesOrderStorage::instance().getSortIndex((*it)->getUUID()) << ", SLURL=" << slurl_iter->second << ", value=" << value << LL_ENDL;
value["slurl"] = slurl_iter->second;
user_llsd[LLFavoritesOrderStorage::instance().getSortIndex((*it)->getUUID())] = value;
}
else
{
- llwarns << "Not saving favorite " << value["name"] << ": no matching SLURL" << llendl;
+ LL_WARNS() << "Not saving favorite " << value["name"] << ": no matching SLURL" << LL_ENDL;
}
}
@@ -1536,7 +1548,7 @@ void LLFavoritesOrderStorage::saveFavoritesSLURLs()
LLAvatarNameCache::get( gAgentID, &av_name );
// Note : use the "John Doe" and not the "john.doe" version of the name
// as we'll compare it with the stored credentials in the login panel.
- lldebugs << "Saved favorites for " << av_name.getUserName() << llendl;
+ LL_DEBUGS() << "Saved favorites for " << av_name.getUserName() << LL_ENDL;
fav_llsd[av_name.getUserName()] = user_llsd;
llofstream file;
@@ -1546,7 +1558,7 @@ void LLFavoritesOrderStorage::saveFavoritesSLURLs()
void LLFavoritesOrderStorage::removeFavoritesRecordOfUser()
{
- std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
+ std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites_" + LLGridManager::getInstance()->getGrid() + ".xml");
LLSD fav_llsd;
llifstream file;
file.open(filename);
@@ -1557,7 +1569,7 @@ void LLFavoritesOrderStorage::removeFavoritesRecordOfUser()
LLAvatarNameCache::get( gAgentID, &av_name );
// Note : use the "John Doe" and not the "john.doe" version of the name.
// See saveFavoritesSLURLs() here above for the reason why.
- lldebugs << "Removed favorites for " << av_name.getUserName() << llendl;
+ LL_DEBUGS() << "Removed favorites for " << av_name.getUserName() << LL_ENDL;
if (fav_llsd.has(av_name.getUserName()))
{
fav_llsd.erase(av_name.getUserName());
@@ -1590,7 +1602,7 @@ void LLFavoritesOrderStorage::onLandmarkLoaded(const LLUUID& asset_id, LLLandmar
void LLFavoritesOrderStorage::storeFavoriteSLURL(const LLUUID& asset_id, std::string& slurl)
{
- lldebugs << "Saving landmark SLURL: " << slurl << llendl;
+ LL_DEBUGS() << "Saving landmark SLURL: " << slurl << LL_ENDL;
mSLURLs[asset_id] = slurl;
}
@@ -1641,6 +1653,16 @@ void LLFavoritesOrderStorage::cleanup()
mSortIndexes.swap(aTempMap);
}
+void LLFavoritesOrderStorage::saveOrder()
+{
+ LLInventoryModel::cat_array_t cats;
+ LLInventoryModel::item_array_t items;
+ LLIsType is_type(LLAssetType::AT_LANDMARK);
+ LLUUID favorites_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE);
+ gInventory.collectDescendentsIf(favorites_id, cats, items, LLInventoryModel::EXCLUDE_TRASH, is_type);
+ saveItemsOrder(items);
+}
+
void LLFavoritesOrderStorage::saveItemsOrder( const LLInventoryModel::item_array_t& items )
{
int sortField = 0;
diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h
index 211d3c4ce3..5ca1d3e8ed 100755
--- a/indra/newview/llfavoritesbar.h
+++ b/indra/newview/llfavoritesbar.h
@@ -203,6 +203,8 @@ public:
// Is used to save order for Favorites folder.
void saveItemsOrder(const LLInventoryModel::item_array_t& items);
+ void saveOrder();
+
void rearrangeFavoriteLandmarks(const LLUUID& source_item_id, const LLUUID& target_item_id);
/**
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp
index ba6f26d3ef..d0555477ea 100755
--- a/indra/newview/llfeaturemanager.cpp
+++ b/indra/newview/llfeaturemanager.cpp
@@ -37,9 +37,9 @@
#include "llsys.h"
#include "llgl.h"
-#include "llsecondlifeurls.h"
#include "llappviewer.h"
+#include "llbufferstream.h"
#include "llhttpclient.h"
#include "llnotificationsutil.h"
#include "llviewercontrol.h"
@@ -131,7 +131,7 @@ F32 LLFeatureList::getRecommendedValue(const std::string& name)
BOOL LLFeatureList::maskList(LLFeatureList &mask)
{
- //llinfos << "Masking with " << mask.mName << llendl;
+ //LL_INFOS() << "Masking with " << mask.mName << LL_ENDL;
//
// Lookup the specified feature mask, and overlay it on top of the
// current feature mask.
@@ -610,6 +610,7 @@ bool LLFeatureManager::parseGPUTable(std::string filename)
// responder saves table into file
class LLHTTPFeatureTableResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(LLHTTPFeatureTableResponder);
public:
LLHTTPFeatureTableResponder(std::string filename) :
@@ -618,15 +619,14 @@ public:
}
- virtual void completedRaw(U32 status, const std::string& reason,
- const LLChannelDescriptors& channels,
+ virtual void completedRaw(const LLChannelDescriptors& channels,
const LLIOPipe::buffer_ptr_t& buffer)
{
- if (isGoodStatus(status))
+ if (isGoodStatus())
{
// write to file
- llinfos << "writing feature table to " << mFilename << llendl;
+ LL_INFOS() << "writing feature table to " << mFilename << LL_ENDL;
S32 file_size = buffer->countAfter(channels.in(), NULL);
if (file_size > 0)
@@ -641,7 +641,18 @@ public:
out.close();
}
}
-
+ else
+ {
+ char body[1025];
+ body[1024] = '\0';
+ LLBufferStream istr(channels, buffer.get());
+ istr.get(body,1024);
+ if (strlen(body) > 0)
+ {
+ mContent["body"] = body;
+ }
+ LL_WARNS() << dumpResponse() << LL_ENDL;
+ }
}
private:
@@ -671,7 +682,7 @@ void fetch_feature_table(std::string table)
const std::string path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename);
- llinfos << "LLFeatureManager fetching " << url << " into " << path << llendl;
+ LL_INFOS() << "LLFeatureManager fetching " << url << " into " << path << LL_ENDL;
LLHTTPClient::get(url, new LLHTTPFeatureTableResponder(path));
}
@@ -686,7 +697,7 @@ void fetch_gpu_table(std::string table)
const std::string path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename);
- llinfos << "LLFeatureManager fetching " << url << " into " << path << llendl;
+ LL_INFOS() << "LLFeatureManager fetching " << url << " into " << path << LL_ENDL;
LLHTTPClient::get(url, new LLHTTPFeatureTableResponder(path));
}
@@ -723,7 +734,7 @@ void LLFeatureManager::applyRecommendedSettings()
// cap the level at 2 (high)
U32 level = llmax(GPU_CLASS_0, llmin(mGPUClass, GPU_CLASS_5));
- llinfos << "Applying Recommended Features" << llendl;
+ LL_INFOS() << "Applying Recommended Features" << LL_ENDL;
setGraphicsLevel(level, false);
gSavedSettings.setU32("RenderQualityPerformance", level);
@@ -769,7 +780,7 @@ void LLFeatureManager::applyFeatures(bool skipFeatures)
LLControlVariable* ctrl = gSavedSettings.getControl(mIt->first);
if(ctrl == NULL)
{
- llwarns << "AHHH! Control setting " << mIt->first << " does not exist!" << llendl;
+ LL_WARNS() << "AHHH! Control setting " << mIt->first << " does not exist!" << LL_ENDL;
continue;
}
@@ -792,7 +803,7 @@ void LLFeatureManager::applyFeatures(bool skipFeatures)
}
else
{
- llwarns << "AHHH! Control variable is not a numeric type!" << llendl;
+ LL_WARNS() << "AHHH! Control variable is not a numeric type!" << LL_ENDL;
}
}
}
@@ -944,11 +955,11 @@ void LLFeatureManager::applyBaseMasks()
}
}
- //llinfos << "Masking features from gpu table match: " << gpustr << llendl;
+ //LL_INFOS() << "Masking features from gpu table match: " << gpustr << LL_ENDL;
maskFeatures(gpustr);
// now mask cpu type ones
- if (gSysMemory.getPhysicalMemoryClamped() <= 256*1024*1024)
+ if (gSysMemory.getPhysicalMemoryClamped() <= U32Megabytes(256))
{
maskFeatures("RAM256MB");
}
diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp
index 16eacc9392..ef50594feb 100755
--- a/indra/newview/llfilepicker.cpp
+++ b/indra/newview/llfilepicker.cpp
@@ -167,7 +167,8 @@ BOOL LLFilePicker::setupFilter(ELoadFilter filter)
BOOL res = TRUE;
switch (filter)
{
- case FFLOAD_ALL:
+ case FFLOAD_ALL:
+ case FFLOAD_EXE:
mOFN.lpstrFilter = L"All Files (*.*)\0*.*\0" \
SOUND_FILTER \
IMAGE_FILTER \
@@ -570,6 +571,7 @@ std::vector<std::string>* LLFilePicker::navOpenFilterProc(ELoadFilter filter) //
allowedv->push_back("lsl");
allowedv->push_back("dic");
allowedv->push_back("xcu");
+ allowedv->push_back("gif");
case FFLOAD_IMAGE:
allowedv->push_back("jpg");
allowedv->push_back("jpeg");
@@ -579,6 +581,10 @@ std::vector<std::string>* LLFilePicker::navOpenFilterProc(ELoadFilter filter) //
allowedv->push_back("tpic");
allowedv->push_back("png");
break;
+ case FFLOAD_EXE:
+ allowedv->push_back("app");
+ allowedv->push_back("exe");
+ break;
case FFLOAD_WAV:
allowedv->push_back("wav");
break;
@@ -594,6 +600,9 @@ std::vector<std::string>* LLFilePicker::navOpenFilterProc(ELoadFilter filter) //
allowedv->push_back("slg");
break;
#endif
+ case FFLOAD_XML:
+ allowedv->push_back("xml");
+ break;
case FFLOAD_RAW:
allowedv->push_back("raw");
break;
@@ -607,7 +616,7 @@ std::vector<std::string>* LLFilePicker::navOpenFilterProc(ELoadFilter filter) //
case FFLOAD_DIRECTORY:
break;
default:
- llwarns << "Unsupported format." << llendl;
+ LL_WARNS() << "Unsupported format." << LL_ENDL;
}
return allowedv;
@@ -661,7 +670,7 @@ bool LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& filena
case FFSAVE_TGAPNG:
type = "PNG";
creator = "prvw";
- extension = "png";
+ extension = "png,tga";
break;
case FFSAVE_BMP:
type = "BMPf";
@@ -696,7 +705,14 @@ bool LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& filena
creator = "\?\?\?\?";
extension = "slg";
break;
-#endif
+#endif
+
+ case FFSAVE_XML:
+ type = "\?\?\?\?";
+ creator = "\?\?\?\?";
+ extension = "xml";
+ break;
+
case FFSAVE_RAW:
type = "\?\?\?\?";
creator = "\?\?\?\?";
@@ -777,9 +793,9 @@ BOOL LLFilePicker::getOpenFile(ELoadFilter filter, bool blocking)
mPickOptions &= ~F_FILE;
}
- if(filter == FFLOAD_ALL) // allow application bundles etc. to be traversed; important for DEV-16869, but generally useful
+ if (filter == FFLOAD_ALL) // allow application bundles etc. to be traversed; important for DEV-16869, but generally useful
{
- mPickOptions &= F_NAV_SUPPORT;
+ mPickOptions |= F_NAV_SUPPORT;
}
if (blocking)
@@ -909,13 +925,13 @@ void LLFilePicker::add_to_selectedfiles(gpointer data, gpointer user_data)
{
display_name += (char)((*str >= 0x20 && *str <= 0x7E) ? *str : '?');
}
- llwarns << "g_filename_to_utf8 failed on \"" << display_name << "\": " << error->message << llendl;
+ LL_WARNS() << "g_filename_to_utf8 failed on \"" << display_name << "\": " << error->message << LL_ENDL;
}
if (filename_utf8)
{
picker->mFiles.push_back(std::string(filename_utf8));
- lldebugs << "ADDED FILE " << filename_utf8 << llendl;
+ LL_DEBUGS() << "ADDED FILE " << filename_utf8 << LL_ENDL;
g_free(filename_utf8);
}
@@ -927,7 +943,7 @@ void LLFilePicker::chooser_responder(GtkWidget *widget, gint response, gpointer
{
LLFilePicker* picker = (LLFilePicker*)user_data;
- lldebugs << "GTK DIALOG RESPONSE " << response << llendl;
+ LL_DEBUGS() << "GTK DIALOG RESPONSE " << response << LL_ENDL;
if (response == GTK_RESPONSE_ACCEPT)
{
@@ -1018,7 +1034,7 @@ GtkWindow* LLFilePicker::buildFilePicker(bool is_save, bool is_folder, std::stri
}
else
{
- llwarns << "Hmm, couldn't get xwid to use for transient." << llendl;
+ LL_WARNS() << "Hmm, couldn't get xwid to use for transient." << LL_ENDL;
}
# endif //LL_X11
@@ -1094,6 +1110,12 @@ static std::string add_anim_filter_to_gtkchooser(GtkWindow *picker)
return filtername;
}
+static std::string add_xml_filter_to_gtkchooser(GtkWindow *picker)
+{
+ return add_simple_pattern_filter_to_gtkchooser(picker, "*.xml",
+ LLTrans::getString("xml_files") + " (*.xml)");
+}
+
static std::string add_collada_filter_to_gtkchooser(GtkWindow *picker)
{
return add_simple_pattern_filter_to_gtkchooser(picker, "*.dae",
@@ -1104,9 +1126,9 @@ static std::string add_imageload_filter_to_gtkchooser(GtkWindow *picker)
{
GtkFileFilter *gfilter = gtk_file_filter_new();
gtk_file_filter_add_pattern(gfilter, "*.tga");
- gtk_file_filter_add_mime_type(gfilter, "image/jpeg");
- gtk_file_filter_add_mime_type(gfilter, "image/png");
- gtk_file_filter_add_mime_type(gfilter, "image/bmp");
+ gtk_file_filter_add_mime_type(gfilter, HTTP_CONTENT_IMAGE_JPEG.c_str());
+ gtk_file_filter_add_mime_type(gfilter, HTTP_CONTENT_IMAGE_PNG.c_str());
+ gtk_file_filter_add_mime_type(gfilter, HTTP_CONTENT_IMAGE_BMP.c_str());
std::string filtername = LLTrans::getString("image_files") + " (*.tga; *.bmp; *.jpg; *.png)";
add_common_filters_to_gtkchooser(gfilter, picker, filtername);
return filtername;
@@ -1114,13 +1136,13 @@ static std::string add_imageload_filter_to_gtkchooser(GtkWindow *picker)
static std::string add_script_filter_to_gtkchooser(GtkWindow *picker)
{
- return add_simple_mime_filter_to_gtkchooser(picker, "text/plain",
+ return add_simple_mime_filter_to_gtkchooser(picker, HTTP_CONTENT_TEXT_PLAIN,
LLTrans::getString("script_files") + " (*.lsl)");
}
static std::string add_dictionary_filter_to_gtkchooser(GtkWindow *picker)
{
- return add_simple_mime_filter_to_gtkchooser(picker, "text/plain",
+ return add_simple_mime_filter_to_gtkchooser(picker, HTTP_CONTENT_TEXT_PLAIN,
LLTrans::getString("dictionary_files") + " (*.dic; *.xcu)");
}
@@ -1176,7 +1198,7 @@ BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename
break;
case FFSAVE_BMP:
caption += add_simple_mime_filter_to_gtkchooser
- (picker, "image/bmp", LLTrans::getString("bitmap_image_files") + " (*.bmp)");
+ (picker, HTTP_CONTENT_IMAGE_BMP, LLTrans::getString("bitmap_image_files") + " (*.bmp)");
suggest_ext = ".bmp";
break;
case FFSAVE_PNG:
@@ -1210,6 +1232,7 @@ BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename
suggest_ext = ".raw";
break;
case FFSAVE_J2C:
+ // *TODO: Should this be 'image/j2c' ?
caption += add_simple_mime_filter_to_gtkchooser
(picker, "images/jp2",
LLTrans::getString("compressed_image_files") + " (*.j2c)");
@@ -1286,6 +1309,9 @@ BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking )
case FFLOAD_ANIM:
filtername = add_anim_filter_to_gtkchooser(picker);
break;
+ case FFLOAD_XML:
+ filtername = add_xml_filter_to_gtkchooser(picker);
+ break;
case FFLOAD_COLLADA:
filtername = add_collada_filter_to_gtkchooser(picker);
break;
@@ -1366,8 +1392,8 @@ BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename
reset();
- llinfos << "getSaveFile suggested filename is [" << filename
- << "]" << llendl;
+ LL_INFOS() << "getSaveFile suggested filename is [" << filename
+ << "]" << LL_ENDL;
if (!filename.empty())
{
mFiles.push_back(gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter() + filename);
@@ -1397,7 +1423,7 @@ BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking )
default: break;
}
mFiles.push_back(filename);
- llinfos << "getOpenFile: Will try to open file: " << filename << llendl;
+ LL_INFOS() << "getOpenFile: Will try to open file: " << filename << LL_ENDL;
return TRUE;
}
diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h
index f0f82c51db..0e0cec3943 100755
--- a/indra/newview/llfilepicker.h
+++ b/indra/newview/llfilepicker.h
@@ -50,6 +50,7 @@
// Need commdlg.h for OPENFILENAMEA
#ifdef LL_WINDOWS
+#include "llwin32headers.h"
#include <commdlg.h>
#endif
@@ -86,7 +87,8 @@ public:
FFLOAD_COLLADA = 10,
FFLOAD_SCRIPT = 11,
FFLOAD_DICTIONARY = 12,
- FFLOAD_DIRECTORY = 13 //To call from lldirpicker.
+ FFLOAD_DIRECTORY = 13, // To call from lldirpicker.
+ FFLOAD_EXE = 14 // Note: EXE will be treated as ALL on Windows and Linux but not on Darwin
};
enum ESaveFilter
diff --git a/indra/newview/llfilepicker_mac.mm b/indra/newview/llfilepicker_mac.mm
index 13757904e3..1438e4dc0a 100644
--- a/indra/newview/llfilepicker_mac.mm
+++ b/indra/newview/llfilepicker_mac.mm
@@ -107,7 +107,7 @@ std::string* doSaveDialog(const std::string* file,
NSSavePanel *panel = [NSSavePanel savePanel];
NSString *extensionns = [NSString stringWithCString:extension->c_str() encoding:[NSString defaultCStringEncoding]];
- NSArray *fileType = [[NSArray alloc] initWithObjects:extensionns,nil];
+ NSArray *fileType = [extensionns componentsSeparatedByString:@","];
//[panel setMessage:@"Save Image File"];
[panel setTreatsFilePackagesAsDirectories: ( flags & F_NAV_SUPPORT ) ];
diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp
index e2850f5181..2e1afc68b4 100755
--- a/indra/newview/llfirstuse.cpp
+++ b/indra/newview/llfirstuse.cpp
@@ -96,6 +96,11 @@ void LLFirstUse::newInventory(bool enable)
// firstUseNotification("FirstInventoryOffer", enable, "HintInventory", LLSD(), LLSD().with("target", "inventory_btn").with("direction", "left"));
}
+// first clean starts at 3 AM
+const S32 SANDBOX_FIRST_CLEAN_HOUR = 3;
+// clean every <n> hours
+const S32 SANDBOX_CLEAN_FREQ = 12;
+
// static
void LLFirstUse::useSandbox()
{
diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp
index 98c0c0bf51..b64034b945 100755
--- a/indra/newview/llflexibleobject.cpp
+++ b/indra/newview/llflexibleobject.cpp
@@ -47,8 +47,8 @@
std::vector<LLVolumeImplFlexible*> LLVolumeImplFlexible::sInstanceList;
std::vector<S32> LLVolumeImplFlexible::sUpdateDelay;
-static LLFastTimer::DeclareTimer FTM_FLEXIBLE_REBUILD("Rebuild");
-static LLFastTimer::DeclareTimer FTM_DO_FLEXIBLE_UPDATE("Flexible Update");
+static LLTrace::BlockTimerStatHandle FTM_FLEXIBLE_REBUILD("Rebuild");
+static LLTrace::BlockTimerStatHandle FTM_DO_FLEXIBLE_UPDATE("Flexible Update");
// LLFlexibleObjectData::pack/unpack now in llprimitive.cpp
@@ -334,14 +334,14 @@ void LLVolumeImplFlexible::updateRenderRes()
// updated every time step. In the future, perhaps there could be an
// optimization similar to what Havok does for objects that are stationary.
//---------------------------------------------------------------------------------
-static LLFastTimer::DeclareTimer FTM_FLEXIBLE_UPDATE("Update Flexies");
+static LLTrace::BlockTimerStatHandle FTM_FLEXIBLE_UPDATE("Update Flexies");
void LLVolumeImplFlexible::doIdleUpdate()
{
LLDrawable* drawablep = mVO->mDrawable;
if (drawablep)
{
- //LLFastTimer ftm(FTM_FLEXIBLE_UPDATE);
+ //LL_RECORD_BLOCK_TIME(FTM_FLEXIBLE_UPDATE);
//ensure drawable is active
drawablep->makeActive();
@@ -424,7 +424,7 @@ inline S32 log2(S32 x)
void LLVolumeImplFlexible::doFlexibleUpdate()
{
- LLFastTimer ftm(FTM_DO_FLEXIBLE_UPDATE);
+ LL_RECORD_BLOCK_TIME(FTM_DO_FLEXIBLE_UPDATE);
LLVolume* volume = mVO->getVolume();
LLPath *path = &volume->getPath();
if ((mSimulateRes == 0 || !mInitialized) && mVO->mDrawable->isVisible())
@@ -660,7 +660,7 @@ void LLVolumeImplFlexible::doFlexibleUpdate()
mSection[i].mdPosition = (mSection[i].mPosition - mSection[i-1].mPosition) * inv_section_length;
// Create points
- llassert(mRenderRes > -1)
+ llassert(mRenderRes > -1);
S32 num_render_sections = 1<<mRenderRes;
if (path->getPathLength() != num_render_sections+1)
{
@@ -715,20 +715,24 @@ void LLVolumeImplFlexible::doFlexibleUpdate()
mLastSegmentRotation = parentSegmentRotation;
}
-static LLFastTimer::DeclareTimer FTM_FLEXI_PREBUILD("Flexi Prebuild");
+static LLTrace::BlockTimerStatHandle FTM_FLEXI_PREBUILD("Flexi Prebuild");
void LLVolumeImplFlexible::preRebuild()
{
if (!mUpdated)
{
- LLFastTimer t(FTM_FLEXI_PREBUILD);
- doFlexibleRebuild();
+ LL_RECORD_BLOCK_TIME(FTM_FLEXI_PREBUILD);
+ doFlexibleRebuild(false);
}
}
-void LLVolumeImplFlexible::doFlexibleRebuild()
+void LLVolumeImplFlexible::doFlexibleRebuild(bool rebuild_volume)
{
LLVolume* volume = mVO->getVolume();
+ if(rebuild_volume)
+ {
+ volume->setDirty();
+ }
volume->regen();
mUpdated = TRUE;
@@ -780,7 +784,7 @@ BOOL LLVolumeImplFlexible::doUpdateGeometry(LLDrawable *drawable)
if (mRenderRes > -1)
{
- LLFastTimer t(FTM_DO_FLEXIBLE_UPDATE);
+ LL_RECORD_BLOCK_TIME(FTM_DO_FLEXIBLE_UPDATE);
doFlexibleUpdate();
}
@@ -800,8 +804,8 @@ BOOL LLVolumeImplFlexible::doUpdateGeometry(LLDrawable *drawable)
volume->mDrawable->setState(LLDrawable::REBUILD_VOLUME);
volume->dirtySpatialGroup();
{
- LLFastTimer t(FTM_FLEXIBLE_REBUILD);
- doFlexibleRebuild();
+ LL_RECORD_BLOCK_TIME(FTM_FLEXIBLE_REBUILD);
+ doFlexibleRebuild(volume->mVolumeChanged);
}
volume->genBBoxes(isVolumeGlobal());
}
diff --git a/indra/newview/llflexibleobject.h b/indra/newview/llflexibleobject.h
index beb281a906..a00551df8e 100755
--- a/indra/newview/llflexibleobject.h
+++ b/indra/newview/llflexibleobject.h
@@ -100,7 +100,7 @@ private:
const LLMatrix4& getWorldMatrix(LLXformMatrix* xform) const;
void updateRelativeXform(bool force_identity);
void doFlexibleUpdate(); // Called to update the simulation
- void doFlexibleRebuild(); // Called to rebuild the geometry
+ void doFlexibleRebuild(bool rebuild_volume); // Called to rebuild the geometry
void preRebuild();
//void setAttributes( LLFlexibleObjectData );
diff --git a/indra/newview/llflickrconnect.cpp b/indra/newview/llflickrconnect.cpp
new file mode 100644
index 0000000000..b715896264
--- /dev/null
+++ b/indra/newview/llflickrconnect.cpp
@@ -0,0 +1,509 @@
+/**
+ * @file llflickrconnect.h
+ * @author Merov, Cho
+ * @brief Connection to Flickr Service
+ *
+ * $LicenseInfo:firstyear=2013&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2013, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llflickrconnect.h"
+
+#include "llagent.h"
+#include "llcallingcard.h" // for LLAvatarTracker
+#include "llcommandhandler.h"
+#include "llhttpclient.h"
+#include "llnotificationsutil.h"
+#include "llurlaction.h"
+#include "llimagepng.h"
+#include "llimagejpeg.h"
+#include "lltrans.h"
+#include "llevents.h"
+#include "llviewerregion.h"
+
+#include "llfloaterwebcontent.h"
+#include "llfloaterreg.h"
+
+boost::scoped_ptr<LLEventPump> LLFlickrConnect::sStateWatcher(new LLEventStream("FlickrConnectState"));
+boost::scoped_ptr<LLEventPump> LLFlickrConnect::sInfoWatcher(new LLEventStream("FlickrConnectInfo"));
+boost::scoped_ptr<LLEventPump> LLFlickrConnect::sContentWatcher(new LLEventStream("FlickrConnectContent"));
+
+// Local functions
+void log_flickr_connect_error(const std::string& request, U32 status, const std::string& reason, const std::string& code, const std::string& description)
+{
+ // Note: 302 (redirect) is *not* an error that warrants logging
+ if (status != 302)
+ {
+ LL_WARNS("FlickrConnect") << request << " request failed with a " << status << " " << reason << ". Reason: " << code << " (" << description << ")" << LL_ENDL;
+ }
+}
+
+void toast_user_for_flickr_success()
+{
+ LLSD args;
+ args["MESSAGE"] = LLTrans::getString("flickr_post_success");
+ LLNotificationsUtil::add("FlickrConnect", args);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+//
+class LLFlickrConnectResponder : public LLHTTPClient::Responder
+{
+ LOG_CLASS(LLFlickrConnectResponder);
+public:
+
+ LLFlickrConnectResponder()
+ {
+ LLFlickrConnect::instance().setConnectionState(LLFlickrConnect::FLICKR_CONNECTION_IN_PROGRESS);
+ }
+
+ /* virtual */ void httpSuccess()
+ {
+ LL_DEBUGS("FlickrConnect") << "Connect successful. " << dumpResponse() << LL_ENDL;
+ LLFlickrConnect::instance().setConnectionState(LLFlickrConnect::FLICKR_CONNECTED);
+ }
+
+ /* virtual */ void httpFailure()
+ {
+ if ( HTTP_FOUND == getStatus() )
+ {
+ const std::string& location = getResponseHeader(HTTP_IN_HEADER_LOCATION);
+ if (location.empty())
+ {
+ LL_WARNS("FlickrConnect") << "Missing Location header " << dumpResponse()
+ << "[headers:" << getResponseHeaders() << "]" << LL_ENDL;
+ }
+ else
+ {
+ LLFlickrConnect::instance().openFlickrWeb(location);
+ }
+ }
+ else
+ {
+ LL_WARNS("FlickrConnect") << dumpResponse() << LL_ENDL;
+ LLFlickrConnect::instance().setConnectionState(LLFlickrConnect::FLICKR_CONNECTION_FAILED);
+ const LLSD& content = getContent();
+ log_flickr_connect_error("Connect", getStatus(), getReason(),
+ content.get("error_code"), content.get("error_description"));
+ }
+ }
+};
+
+///////////////////////////////////////////////////////////////////////////////
+//
+class LLFlickrShareResponder : public LLHTTPClient::Responder
+{
+ LOG_CLASS(LLFlickrShareResponder);
+public:
+
+ LLFlickrShareResponder()
+ {
+ LLFlickrConnect::instance().setConnectionState(LLFlickrConnect::FLICKR_POSTING);
+ }
+
+ /* virtual */ void httpSuccess()
+ {
+ toast_user_for_flickr_success();
+ LL_DEBUGS("FlickrConnect") << "Post successful. " << dumpResponse() << LL_ENDL;
+ LLFlickrConnect::instance().setConnectionState(LLFlickrConnect::FLICKR_POSTED);
+ }
+
+ /* virtual */ void httpFailure()
+ {
+ if ( HTTP_FOUND == getStatus() )
+ {
+ const std::string& location = getResponseHeader(HTTP_IN_HEADER_LOCATION);
+ if (location.empty())
+ {
+ LL_WARNS("FlickrConnect") << "Missing Location header " << dumpResponse()
+ << "[headers:" << getResponseHeaders() << "]" << LL_ENDL;
+ }
+ else
+ {
+ LLFlickrConnect::instance().openFlickrWeb(location);
+ }
+ }
+ else if ( HTTP_NOT_FOUND == getStatus() )
+ {
+ LLFlickrConnect::instance().connectToFlickr();
+ }
+ else
+ {
+ LL_WARNS("FlickrConnect") << dumpResponse() << LL_ENDL;
+ LLFlickrConnect::instance().setConnectionState(LLFlickrConnect::FLICKR_POST_FAILED);
+ const LLSD& content = getContent();
+ log_flickr_connect_error("Share", getStatus(), getReason(),
+ content.get("error_code"), content.get("error_description"));
+ }
+ }
+};
+
+///////////////////////////////////////////////////////////////////////////////
+//
+class LLFlickrDisconnectResponder : public LLHTTPClient::Responder
+{
+ LOG_CLASS(LLFlickrDisconnectResponder);
+public:
+
+ LLFlickrDisconnectResponder()
+ {
+ LLFlickrConnect::instance().setConnectionState(LLFlickrConnect::FLICKR_DISCONNECTING);
+ }
+
+ void setUserDisconnected()
+ {
+ // Clear data
+ LLFlickrConnect::instance().clearInfo();
+
+ //Notify state change
+ LLFlickrConnect::instance().setConnectionState(LLFlickrConnect::FLICKR_NOT_CONNECTED);
+ }
+
+ /* virtual */ void httpSuccess()
+ {
+ LL_DEBUGS("FlickrConnect") << "Disconnect successful. " << dumpResponse() << LL_ENDL;
+ setUserDisconnected();
+ }
+
+ /* virtual */ void httpFailure()
+ {
+ //User not found so already disconnected
+ if ( HTTP_NOT_FOUND == getStatus() )
+ {
+ LL_DEBUGS("FlickrConnect") << "Already disconnected. " << dumpResponse() << LL_ENDL;
+ setUserDisconnected();
+ }
+ else
+ {
+ LL_WARNS("FlickrConnect") << dumpResponse() << LL_ENDL;
+ LLFlickrConnect::instance().setConnectionState(LLFlickrConnect::FLICKR_DISCONNECT_FAILED);
+ const LLSD& content = getContent();
+ log_flickr_connect_error("Disconnect", getStatus(), getReason(),
+ content.get("error_code"), content.get("error_description"));
+ }
+ }
+};
+
+///////////////////////////////////////////////////////////////////////////////
+//
+class LLFlickrConnectedResponder : public LLHTTPClient::Responder
+{
+ LOG_CLASS(LLFlickrConnectedResponder);
+public:
+
+ LLFlickrConnectedResponder(bool auto_connect) : mAutoConnect(auto_connect)
+ {
+ LLFlickrConnect::instance().setConnectionState(LLFlickrConnect::FLICKR_CONNECTION_IN_PROGRESS);
+ }
+
+ /* virtual */ void httpSuccess()
+ {
+ LL_DEBUGS("FlickrConnect") << "Connect successful. " << dumpResponse() << LL_ENDL;
+ LLFlickrConnect::instance().setConnectionState(LLFlickrConnect::FLICKR_CONNECTED);
+ }
+
+ /* virtual */ void httpFailure()
+ {
+ // show the facebook login page if not connected yet
+ if ( HTTP_NOT_FOUND == getStatus() )
+ {
+ LL_DEBUGS("FlickrConnect") << "Not connected. " << dumpResponse() << LL_ENDL;
+ if (mAutoConnect)
+ {
+ LLFlickrConnect::instance().connectToFlickr();
+ }
+ else
+ {
+ LLFlickrConnect::instance().setConnectionState(LLFlickrConnect::FLICKR_NOT_CONNECTED);
+ }
+ }
+ else
+ {
+ LL_WARNS("FlickrConnect") << dumpResponse() << LL_ENDL;
+ LLFlickrConnect::instance().setConnectionState(LLFlickrConnect::FLICKR_CONNECTION_FAILED);
+ const LLSD& content = getContent();
+ log_flickr_connect_error("Connected", getStatus(), getReason(),
+ content.get("error_code"), content.get("error_description"));
+ }
+ }
+
+private:
+ bool mAutoConnect;
+};
+
+///////////////////////////////////////////////////////////////////////////////
+//
+class LLFlickrInfoResponder : public LLHTTPClient::Responder
+{
+ LOG_CLASS(LLFlickrInfoResponder);
+public:
+
+ /* virtual */ void httpSuccess()
+ {
+ LL_INFOS("FlickrConnect") << "Flickr: Info received" << LL_ENDL;
+ LL_DEBUGS("FlickrConnect") << "Getting Flickr info successful. " << dumpResponse() << LL_ENDL;
+ LLFlickrConnect::instance().storeInfo(getContent());
+ }
+
+ /* virtual */ void httpFailure()
+ {
+ if ( HTTP_FOUND == getStatus() )
+ {
+ const std::string& location = getResponseHeader(HTTP_IN_HEADER_LOCATION);
+ if (location.empty())
+ {
+ LL_WARNS("FlickrConnect") << "Missing Location header " << dumpResponse()
+ << "[headers:" << getResponseHeaders() << "]" << LL_ENDL;
+ }
+ else
+ {
+ LLFlickrConnect::instance().openFlickrWeb(location);
+ }
+ }
+ else
+ {
+ LL_WARNS("FlickrConnect") << dumpResponse() << LL_ENDL;
+ const LLSD& content = getContent();
+ log_flickr_connect_error("Info", getStatus(), getReason(),
+ content.get("error_code"), content.get("error_description"));
+ }
+ }
+};
+
+///////////////////////////////////////////////////////////////////////////////
+//
+LLFlickrConnect::LLFlickrConnect()
+: mConnectionState(FLICKR_NOT_CONNECTED),
+ mConnected(false),
+ mInfo(),
+ mRefreshInfo(false),
+ mReadFromMaster(false)
+{
+}
+
+void LLFlickrConnect::openFlickrWeb(std::string url)
+{
+ // Open the URL in an internal browser window without navigation UI
+ LLFloaterWebContent::Params p;
+ p.url(url);
+ p.show_chrome(true);
+ p.allow_address_entry(false);
+ p.allow_back_forward_navigation(false);
+ p.trusted_content(true);
+ p.clean_browser(true);
+ LLFloater *floater = LLFloaterReg::showInstance("flickr_web", p);
+ //the internal web browser has a bug that prevents it from gaining focus unless a mouse event occurs first (it seems).
+ //So when showing the internal web browser, set focus to it's containing floater "flickr_web". When a mouse event
+ //occurs on the "webbrowser" panel part of the floater, a mouse cursor will properly show and the "webbrowser" will gain focus.
+ //flickr_web floater contains the "webbrowser" panel. JIRA: ACME-744
+ gFocusMgr.setKeyboardFocus( floater );
+
+ //LLUrlAction::openURLExternal(url);
+}
+
+std::string LLFlickrConnect::getFlickrConnectURL(const std::string& route, bool include_read_from_master)
+{
+ std::string url("");
+ LLViewerRegion *regionp = gAgent.getRegion();
+ if (regionp)
+ {
+ //url = "http://pdp15.lindenlab.com/flickr/agent/" + gAgentID.asString(); // TEMPORARY FOR TESTING - CHO
+ url = regionp->getCapability("FlickrConnect");
+ url += route;
+
+ if (include_read_from_master && mReadFromMaster)
+ {
+ url += "?read_from_master=true";
+ }
+ }
+ return url;
+}
+
+void LLFlickrConnect::connectToFlickr(const std::string& request_token, const std::string& oauth_verifier)
+{
+ LLSD body;
+ if (!request_token.empty())
+ body["request_token"] = request_token;
+ if (!oauth_verifier.empty())
+ body["oauth_verifier"] = oauth_verifier;
+
+ LLHTTPClient::put(getFlickrConnectURL("/connection"), body, new LLFlickrConnectResponder());
+}
+
+void LLFlickrConnect::disconnectFromFlickr()
+{
+ LLHTTPClient::del(getFlickrConnectURL("/connection"), new LLFlickrDisconnectResponder());
+}
+
+void LLFlickrConnect::checkConnectionToFlickr(bool auto_connect)
+{
+ const bool follow_redirects = false;
+ const F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
+ LLHTTPClient::get(getFlickrConnectURL("/connection", true), new LLFlickrConnectedResponder(auto_connect),
+ LLSD(), timeout, follow_redirects);
+}
+
+void LLFlickrConnect::loadFlickrInfo()
+{
+ if(mRefreshInfo)
+ {
+ const bool follow_redirects = false;
+ const F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
+ LLHTTPClient::get(getFlickrConnectURL("/info", true), new LLFlickrInfoResponder(),
+ LLSD(), timeout, follow_redirects);
+ }
+}
+
+void LLFlickrConnect::uploadPhoto(const std::string& image_url, const std::string& title, const std::string& description, const std::string& tags, int safety_level)
+{
+ LLSD body;
+ body["image"] = image_url;
+ body["title"] = title;
+ body["description"] = description;
+ body["tags"] = tags;
+ body["safety_level"] = safety_level;
+
+ // Note: we can use that route for different publish action. We should be able to use the same responder.
+ LLHTTPClient::post(getFlickrConnectURL("/share/photo", true), body, new LLFlickrShareResponder());
+}
+
+void LLFlickrConnect::uploadPhoto(LLPointer<LLImageFormatted> image, const std::string& title, const std::string& description, const std::string& tags, int safety_level)
+{
+ std::string imageFormat;
+ if (dynamic_cast<LLImagePNG*>(image.get()))
+ {
+ imageFormat = "png";
+ }
+ else if (dynamic_cast<LLImageJPEG*>(image.get()))
+ {
+ imageFormat = "jpg";
+ }
+ else
+ {
+ llwarns << "Image to upload is not a PNG or JPEG" << llendl;
+ return;
+ }
+
+ // All this code is mostly copied from LLWebProfile::post()
+ const std::string boundary = "----------------------------0123abcdefab";
+
+ LLSD headers;
+ headers["Content-Type"] = "multipart/form-data; boundary=" + boundary;
+
+ std::ostringstream body;
+
+ // *NOTE: The order seems to matter.
+ body << "--" << boundary << "\r\n"
+ << "Content-Disposition: form-data; name=\"title\"\r\n\r\n"
+ << title << "\r\n";
+
+ body << "--" << boundary << "\r\n"
+ << "Content-Disposition: form-data; name=\"description\"\r\n\r\n"
+ << description << "\r\n";
+
+ body << "--" << boundary << "\r\n"
+ << "Content-Disposition: form-data; name=\"tags\"\r\n\r\n"
+ << tags << "\r\n";
+
+ body << "--" << boundary << "\r\n"
+ << "Content-Disposition: form-data; name=\"safety_level\"\r\n\r\n"
+ << safety_level << "\r\n";
+
+ body << "--" << boundary << "\r\n"
+ << "Content-Disposition: form-data; name=\"image\"; filename=\"Untitled." << imageFormat << "\"\r\n"
+ << "Content-Type: image/" << imageFormat << "\r\n\r\n";
+
+ // Insert the image data.
+ // *FIX: Treating this as a string will probably screw it up ...
+ U8* image_data = image->getData();
+ for (S32 i = 0; i < image->getDataSize(); ++i)
+ {
+ body << image_data[i];
+ }
+
+ body << "\r\n--" << boundary << "--\r\n";
+
+ // postRaw() takes ownership of the buffer and releases it later.
+ size_t size = body.str().size();
+ U8 *data = new U8[size];
+ memcpy(data, body.str().data(), size);
+
+ // Note: we can use that route for different publish action. We should be able to use the same responder.
+ LLHTTPClient::postRaw(getFlickrConnectURL("/share/photo", true), data, size, new LLFlickrShareResponder(), headers);
+}
+
+void LLFlickrConnect::storeInfo(const LLSD& info)
+{
+ mInfo = info;
+ mRefreshInfo = false;
+
+ sInfoWatcher->post(info);
+}
+
+const LLSD& LLFlickrConnect::getInfo() const
+{
+ return mInfo;
+}
+
+void LLFlickrConnect::clearInfo()
+{
+ mInfo = LLSD();
+}
+
+void LLFlickrConnect::setDataDirty()
+{
+ mRefreshInfo = true;
+}
+
+void LLFlickrConnect::setConnectionState(LLFlickrConnect::EConnectionState connection_state)
+{
+ if(connection_state == FLICKR_CONNECTED)
+ {
+ mReadFromMaster = true;
+ setConnected(true);
+ setDataDirty();
+ }
+ else if(connection_state == FLICKR_NOT_CONNECTED)
+ {
+ setConnected(false);
+ }
+ else if(connection_state == FLICKR_POSTED)
+ {
+ mReadFromMaster = false;
+ }
+
+ if (mConnectionState != connection_state)
+ {
+ // set the connection state before notifying watchers
+ mConnectionState = connection_state;
+
+ LLSD state_info;
+ state_info["enum"] = connection_state;
+ sStateWatcher->post(state_info);
+ }
+}
+
+void LLFlickrConnect::setConnected(bool connected)
+{
+ mConnected = connected;
+}
diff --git a/indra/newview/llflickrconnect.h b/indra/newview/llflickrconnect.h
new file mode 100644
index 0000000000..b127e6e104
--- /dev/null
+++ b/indra/newview/llflickrconnect.h
@@ -0,0 +1,98 @@
+/**
+ * @file llflickrconnect.h
+ * @author Merov, Cho
+ * @brief Connection to Flickr Service
+ *
+ * $LicenseInfo:firstyear=2013&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2013, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLFLICKRCONNECT_H
+#define LL_LLFLICKRCONNECT_H
+
+#include "llsingleton.h"
+#include "llimage.h"
+
+class LLEventPump;
+
+/**
+ * @class LLFlickrConnect
+ *
+ * Manages authentication to, and interaction with, a web service allowing the
+ * the viewer to upload photos to Flickr.
+ */
+class LLFlickrConnect : public LLSingleton<LLFlickrConnect>
+{
+ LOG_CLASS(LLFlickrConnect);
+public:
+ enum EConnectionState
+ {
+ FLICKR_NOT_CONNECTED = 0,
+ FLICKR_CONNECTION_IN_PROGRESS = 1,
+ FLICKR_CONNECTED = 2,
+ FLICKR_CONNECTION_FAILED = 3,
+ FLICKR_POSTING = 4,
+ FLICKR_POSTED = 5,
+ FLICKR_POST_FAILED = 6,
+ FLICKR_DISCONNECTING = 7,
+ FLICKR_DISCONNECT_FAILED = 8
+ };
+
+ void connectToFlickr(const std::string& request_token = "", const std::string& oauth_verifier = ""); // Initiate the complete Flickr connection. Please use checkConnectionToFlickr() in normal use.
+ void disconnectFromFlickr(); // Disconnect from the Flickr service.
+ void checkConnectionToFlickr(bool auto_connect = false); // Check if an access token is available on the Flickr service. If not, call connectToFlickr().
+
+ void loadFlickrInfo();
+ void uploadPhoto(const std::string& image_url, const std::string& title, const std::string& description, const std::string& tags, int safety_level);
+ void uploadPhoto(LLPointer<LLImageFormatted> image, const std::string& title, const std::string& description, const std::string& tags, int safety_level);
+
+ void storeInfo(const LLSD& info);
+ const LLSD& getInfo() const;
+ void clearInfo();
+ void setDataDirty();
+
+ void setConnectionState(EConnectionState connection_state);
+ void setConnected(bool connected);
+ bool isConnected() { return mConnected; }
+ bool isTransactionOngoing() { return ((mConnectionState == FLICKR_CONNECTION_IN_PROGRESS) || (mConnectionState == FLICKR_POSTING) || (mConnectionState == FLICKR_DISCONNECTING)); }
+ EConnectionState getConnectionState() { return mConnectionState; }
+
+ void openFlickrWeb(std::string url);
+
+private:
+ friend class LLSingleton<LLFlickrConnect>;
+
+ LLFlickrConnect();
+ ~LLFlickrConnect() {};
+ std::string getFlickrConnectURL(const std::string& route = "", bool include_read_from_master = false);
+
+ EConnectionState mConnectionState;
+ BOOL mConnected;
+ LLSD mInfo;
+ bool mRefreshInfo;
+ bool mReadFromMaster;
+
+ static boost::scoped_ptr<LLEventPump> sStateWatcher;
+ static boost::scoped_ptr<LLEventPump> sInfoWatcher;
+ static boost::scoped_ptr<LLEventPump> sContentWatcher;
+};
+
+#endif // LL_LLFLICKRCONNECT_H
diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp
index 4331a63346..66149a4367 100755
--- a/indra/newview/llfloaterabout.cpp
+++ b/indra/newview/llfloaterabout.cpp
@@ -35,7 +35,6 @@
#include "llagent.h"
#include "llagentui.h"
#include "llappviewer.h"
-#include "llsecondlifeurls.h"
#include "llslurl.h"
#include "llvoiceclient.h"
#include "lluictrlfactory.h"
@@ -77,14 +76,9 @@ class LLServerReleaseNotesURLFetcher : public LLHTTPClient::Responder
{
LOG_CLASS(LLServerReleaseNotesURLFetcher);
public:
-
static void startFetch();
- /*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content);
- /*virtual*/ void completedRaw(
- U32 status,
- const std::string& reason,
- const LLChannelDescriptors& channels,
- const LLIOPipe::buffer_ptr_t& buffer);
+private:
+ /* virtual */ void httpCompleted();
};
///----------------------------------------------------------------------------
@@ -149,7 +143,8 @@ BOOL LLFloaterAbout::postBuild()
}
else // not logged in
{
- setSupportText(LLStringUtil::null);
+ LL_DEBUGS("ViewerInfo") << "cannot display region info when not connected" << LL_ENDL;
+ setSupportText(LLTrans::getString("NotConnected"));
}
support_widget->blockUndo();
@@ -268,11 +263,10 @@ void LLFloaterAbout::setSupportText(const std::string& server_release_notes_url)
LLViewerTextEditor *support_widget =
getChild<LLViewerTextEditor>("support_editor", true);
+ LLUIColor about_color = LLUIColorTable::instance().getColor("TextFgReadOnlyColor");
support_widget->clear();
support_widget->appendText(LLAppViewer::instance()->getViewerInfoString(),
- FALSE,
- LLStyle::Params()
- .color(LLUIColorTable::instance().getColor("TextFgReadOnlyColor")));
+ FALSE, LLStyle::Params() .color(about_color));
}
///----------------------------------------------------------------------------
@@ -304,16 +298,15 @@ void LLServerReleaseNotesURLFetcher::startFetch()
}
// virtual
-void LLServerReleaseNotesURLFetcher::completedHeader(U32 status, const std::string& reason, const LLSD& content)
+void LLServerReleaseNotesURLFetcher::httpCompleted()
{
- lldebugs << "Status: " << status << llendl;
- lldebugs << "Reason: " << reason << llendl;
- lldebugs << "Headers: " << content << llendl;
+ LL_DEBUGS("ServerReleaseNotes") << dumpResponse()
+ << " [headers:" << getResponseHeaders() << "]" << LL_ENDL;
LLFloaterAbout* floater_about = LLFloaterReg::getTypedInstance<LLFloaterAbout>("sl_about");
if (floater_about)
{
- std::string location = content["location"].asString();
+ std::string location = getResponseHeader(HTTP_IN_HEADER_LOCATION);
if (location.empty())
{
location = LLTrans::getString("ErrorFetchingServerReleaseNotesURL");
@@ -322,14 +315,3 @@ void LLServerReleaseNotesURLFetcher::completedHeader(U32 status, const std::stri
}
}
-// virtual
-void LLServerReleaseNotesURLFetcher::completedRaw(
- U32 status,
- const std::string& reason,
- const LLChannelDescriptors& channels,
- const LLIOPipe::buffer_ptr_t& buffer)
-{
- // Do nothing.
- // We're overriding just because the base implementation tries to
- // deserialize LLSD which triggers warnings.
-}
diff --git a/indra/newview/llfloaterauction.cpp b/indra/newview/llfloaterauction.cpp
index 3c40e2d4bc..51b59a7a74 100755
--- a/indra/newview/llfloaterauction.cpp
+++ b/indra/newview/llfloaterauction.cpp
@@ -194,7 +194,7 @@ void LLFloaterAuction::onClickSnapshot(void* data)
{
gViewerWindow->playSnapshotAnimAndSound();
}
- llinfos << "Writing TGA..." << llendl;
+ LL_INFOS() << "Writing TGA..." << LL_ENDL;
LLPointer<LLImageTGA> tga = new LLImageTGA;
tga->encode(raw);
@@ -202,7 +202,7 @@ void LLFloaterAuction::onClickSnapshot(void* data)
raw->biasedScaleToPowerOfTwo(LLViewerTexture::MAX_IMAGE_SIZE_DEFAULT);
- llinfos << "Writing J2C..." << llendl;
+ LL_INFOS() << "Writing J2C..." << LL_ENDL;
LLPointer<LLImageJ2C> j2c = new LLImageJ2C;
j2c->encode(raw, 0.0f);
@@ -214,7 +214,7 @@ void LLFloaterAuction::onClickSnapshot(void* data)
}
else
{
- llwarns << "Unable to take snapshot" << llendl;
+ LL_WARNS() << "Unable to take snapshot" << LL_ENDL;
}
}
@@ -359,8 +359,8 @@ void LLFloaterAuction::doResetParcel()
body["user_look_at"] = ll_sd_from_vector3( LLVector3::zero );
body["landing_type"] = (U8) LLParcel::L_DIRECT;
- llinfos << "Sending parcel update to reset for auction via capability to: "
- << mParcelUpdateCapUrl << llendl;
+ LL_INFOS() << "Sending parcel update to reset for auction via capability to: "
+ << mParcelUpdateCapUrl << LL_ENDL;
LLHTTPClient::post(mParcelUpdateCapUrl, body, new LLHTTPClient::Responder());
// Send a message to clear the object return time
@@ -509,8 +509,8 @@ void LLFloaterAuction::doSellToAnyone()
body["sale_price"] = parcelp->getArea(); // Sell for L$1 per square meter
body["auth_buyer_id"] = LLUUID::null; // To anyone
- llinfos << "Sending parcel update to sell to anyone for L$1 via capability to: "
- << mParcelUpdateCapUrl << llendl;
+ LL_INFOS() << "Sending parcel update to sell to anyone for L$1 via capability to: "
+ << mParcelUpdateCapUrl << LL_ENDL;
LLHTTPClient::post(mParcelUpdateCapUrl, body, new LLHTTPClient::Responder());
// clean up floater, and get out
@@ -526,8 +526,8 @@ void LLFloaterAuction::doSellToAnyone()
void auction_tga_upload_done(const LLUUID& asset_id, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed)
{
std::string* name = (std::string*)(user_data);
- llinfos << "Upload of asset '" << *name << "' " << asset_id
- << " returned " << status << llendl;
+ LL_INFOS() << "Upload of asset '" << *name << "' " << asset_id
+ << " returned " << status << LL_ENDL;
delete name;
gViewerWindow->getWindow()->decBusyCount();
@@ -547,8 +547,8 @@ void auction_tga_upload_done(const LLUUID& asset_id, void* user_data, S32 status
void auction_j2c_upload_done(const LLUUID& asset_id, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed)
{
std::string* name = (std::string*)(user_data);
- llinfos << "Upload of asset '" << *name << "' " << asset_id
- << " returned " << status << llendl;
+ LL_INFOS() << "Upload of asset '" << *name << "' " << asset_id
+ << " returned " << status << LL_ENDL;
delete name;
gViewerWindow->getWindow()->decBusyCount();
diff --git a/indra/newview/llfloateravatar.cpp b/indra/newview/llfloateravatar.cpp
index bdc5b581a9..31adf5b61e 100755
--- a/indra/newview/llfloateravatar.cpp
+++ b/indra/newview/llfloateravatar.cpp
@@ -34,6 +34,7 @@
#include "llfloateravatar.h"
#include "lluictrlfactory.h"
+#include "llmediactrl.h"
LLFloaterAvatar::LLFloaterAvatar(const LLSD& key)
@@ -43,6 +44,13 @@ LLFloaterAvatar::LLFloaterAvatar(const LLSD& key)
LLFloaterAvatar::~LLFloaterAvatar()
{
+ LLMediaCtrl* avatar_picker = findChild<LLMediaCtrl>("avatar_picker_contents");
+ if (avatar_picker)
+ {
+ avatar_picker->navigateStop();
+ avatar_picker->clearCache(); //images are reloading each time already
+ avatar_picker->unloadMediaSource();
+ }
}
BOOL LLFloaterAvatar::postBuild()
diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp
index c0afb72cff..513c33e60d 100755
--- a/indra/newview/llfloateravatarpicker.cpp
+++ b/indra/newview/llfloateravatarpicker.cpp
@@ -70,7 +70,7 @@ LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback,
LLFloaterReg::showTypedInstance<LLFloaterAvatarPicker>("avatar_picker", LLSD(name));
if (!floater)
{
- llwarns << "Cannot instantiate avatar picker" << llendl;
+ LL_WARNS() << "Cannot instantiate avatar picker" << LL_ENDL;
return NULL;
}
@@ -405,11 +405,11 @@ void LLFloaterAvatarPicker::drawFrustum()
if (gFocusMgr.childHasMouseCapture(getDragHandle()))
{
- mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(mContextConeFadeTime));
+ mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLSmoothInterpolation::getInterpolant(mContextConeFadeTime));
}
else
{
- mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(mContextConeFadeTime));
+ mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLSmoothInterpolation::getInterpolant(mContextConeFadeTime));
}
}
}
@@ -458,33 +458,34 @@ BOOL LLFloaterAvatarPicker::visibleItemsSelected() const
class LLAvatarPickerResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(LLAvatarPickerResponder);
public:
LLUUID mQueryID;
std::string mName;
LLAvatarPickerResponder(const LLUUID& id, const std::string& name) : mQueryID(id), mName(name) { }
- /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content)
+protected:
+ /*virtual*/ void httpCompleted()
{
//std::ostringstream ss;
//LLSDSerialize::toPrettyXML(content, ss);
- //llinfos << ss.str() << llendl;
+ //LL_INFOS() << ss.str() << LL_ENDL;
// in case of invalid characters, the avatar picker returns a 400
// just set it to process so it displays 'not found'
- if (isGoodStatus(status) || status == 400)
+ if (isGoodStatus() || getStatus() == HTTP_BAD_REQUEST)
{
LLFloaterAvatarPicker* floater =
LLFloaterReg::findTypedInstance<LLFloaterAvatarPicker>("avatar_picker", mName);
if (floater)
{
- floater->processResponse(mQueryID, content);
+ floater->processResponse(mQueryID, getContent());
}
}
else
{
- llwarns << "avatar picker failed [status:" << status << "]: " << content << llendl;
-
+ LL_WARNS() << "avatar picker failed " << dumpResponse() << LL_ENDL;
}
}
};
@@ -515,7 +516,7 @@ void LLFloaterAvatarPicker::find()
url += "?page_size=100&names=";
std::replace(text.begin(), text.end(), '.', ' ');
url += LLURI::escape(text);
- llinfos << "avatar picker " << url << llendl;
+ LL_INFOS() << "avatar picker " << url << LL_ENDL;
LLHTTPClient::get(url, new LLAvatarPickerResponder(mQueryID, getKey().asString()));
}
else
@@ -736,7 +737,7 @@ void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD&
if (search_results->isEmpty())
{
LLStringUtil::format_map_t map;
- map["[TEXT]"] = childGetText("Edit");
+ map["[TEXT]"] = getChild<LLUICtrl>("Edit")->getValue().asString();
LLSD item;
item["id"] = LLUUID::null;
item["columns"][0]["column"] = "name";
@@ -795,7 +796,7 @@ bool LLFloaterAvatarPicker::isSelectBtnEnabled()
{
bool ret_val = visibleItemsSelected();
- if ( ret_val && mOkButtonValidateSignal.num_slots() )
+ if ( ret_val )
{
std::string acvtive_panel_name;
LLScrollListCtrl* list = NULL;
@@ -826,7 +827,7 @@ bool LLFloaterAvatarPicker::isSelectBtnEnabled()
getSelectedAvatarData(list, avatar_ids, avatar_names);
if (avatar_ids.size() >= 1)
{
- ret_val = mOkButtonValidateSignal(avatar_ids);
+ ret_val = mOkButtonValidateSignal.num_slots()?mOkButtonValidateSignal(avatar_ids):true;
}
else
{
diff --git a/indra/newview/llfloateravatartextures.cpp b/indra/newview/llfloateravatartextures.cpp
index 048837acfe..78807a8e99 100755
--- a/indra/newview/llfloateravatartextures.cpp
+++ b/indra/newview/llfloateravatartextures.cpp
@@ -37,6 +37,7 @@
#include "lluictrlfactory.h"
#include "llviewerobjectlist.h"
#include "llvoavatarself.h"
+#include "lllocaltextureobject.h"
using namespace LLAvatarAppearanceDefines;
@@ -186,16 +187,16 @@ void LLFloaterAvatarTextures::onClickDump(void* data)
}
if (id != IMG_DEFAULT_AVATAR)
{
- llinfos << "TE " << i << " name:" << tex_entry->mName << " id:" << id << llendl;
+ LL_INFOS() << "TE " << i << " name:" << tex_entry->mName << " id:" << id << LL_ENDL;
}
else
{
- llinfos << "TE " << i << " name:" << tex_entry->mName << " id:" << "<DEFAULT>" << llendl;
+ LL_INFOS() << "TE " << i << " name:" << tex_entry->mName << " id:" << "<DEFAULT>" << LL_ENDL;
}
}
else
{
- llinfos << "TE " << i << " name:" << tex_entry->mName << " id:" << te->getID() << llendl;
+ LL_INFOS() << "TE " << i << " name:" << tex_entry->mName << " id:" << te->getID() << LL_ENDL;
}
}
}
diff --git a/indra/newview/llfloaterbigpreview.cpp b/indra/newview/llfloaterbigpreview.cpp
new file mode 100644
index 0000000000..b516e9dd01
--- /dev/null
+++ b/indra/newview/llfloaterbigpreview.cpp
@@ -0,0 +1,110 @@
+/**
+* @file llfloaterbigpreview.cpp
+* @brief Display of extended (big) preview for snapshots and SL Share
+* @author merov@lindenlab.com
+*
+* $LicenseInfo:firstyear=2013&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2013, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+* $/LicenseInfo$
+*/
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llfloaterbigpreview.h"
+#include "llsnapshotlivepreview.h"
+
+///////////////////////
+//LLFloaterBigPreview//
+///////////////////////
+
+LLFloaterBigPreview::LLFloaterBigPreview(const LLSD& key) : LLFloater(key),
+ mPreviewPlaceholder(NULL),
+ mFloaterOwner(NULL)
+{
+}
+
+LLFloaterBigPreview::~LLFloaterBigPreview()
+{
+ if (mPreviewHandle.get())
+ {
+ mPreviewHandle.get()->die();
+ }
+}
+
+void LLFloaterBigPreview::onCancel()
+{
+ closeFloater();
+}
+
+void LLFloaterBigPreview::closeOnFloaterOwnerClosing(LLFloater* floaterp)
+{
+ if (isFloaterOwner(floaterp))
+ {
+ closeFloater();
+ }
+}
+
+BOOL LLFloaterBigPreview::postBuild()
+{
+ mPreviewPlaceholder = getChild<LLUICtrl>("big_preview_placeholder");
+ return LLFloater::postBuild();
+}
+
+void LLFloaterBigPreview::draw()
+{
+ LLFloater::draw();
+
+ LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(mPreviewHandle.get());
+
+ // Display the preview if one is available
+ if (previewp && previewp->getBigThumbnailImage())
+ {
+ // Get the preview rect
+ const LLRect& preview_rect = mPreviewPlaceholder->getRect();
+
+ // Get the preview texture size
+ S32 thumbnail_w = previewp->getBigThumbnailWidth();
+ S32 thumbnail_h = previewp->getBigThumbnailHeight();
+
+ // Compute the scaling ratio and the size of the final texture in the rect: we want to prevent anisotropic scaling (distorted in x and y)
+ F32 ratio = llmax((F32)(thumbnail_w)/(F32)(preview_rect.getWidth()), (F32)(thumbnail_h)/(F32)(preview_rect.getHeight()));
+ thumbnail_w = (S32)((F32)(thumbnail_w)/ratio);
+ thumbnail_h = (S32)((F32)(thumbnail_h)/ratio);
+
+ // Compute the preview offset within the preview rect: we want to center that preview in the available rect
+ const S32 local_offset_x = (preview_rect.getWidth() - thumbnail_w) / 2 ;
+ const S32 local_offset_y = (preview_rect.getHeight() - thumbnail_h) / 2 ;
+
+ // Compute preview offset within the floater rect
+ S32 offset_x = preview_rect.mLeft + local_offset_x;
+ S32 offset_y = preview_rect.mBottom + local_offset_y;
+
+ gGL.matrixMode(LLRender::MM_MODELVIEW);
+ // Apply floater transparency to the texture unless the floater is focused.
+ F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency();
+ LLColor4 color = LLColor4::white;
+
+ // Draw the preview texture
+ gl_draw_scaled_image(offset_x, offset_y,
+ thumbnail_w, thumbnail_h,
+ previewp->getBigThumbnailImage(), color % alpha);
+ }
+}
+
diff --git a/indra/newview/llfloaterbigpreview.h b/indra/newview/llfloaterbigpreview.h
new file mode 100644
index 0000000000..63c6784d36
--- /dev/null
+++ b/indra/newview/llfloaterbigpreview.h
@@ -0,0 +1,54 @@
+/**
+* @file llfloaterbigpreview.h
+* @brief Display of extended (big) preview for snapshots and SL Share
+* @author merov@lindenlab.com
+*
+* $LicenseInfo:firstyear=2013&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2013, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+* $/LicenseInfo$
+*/
+#ifndef LL_LLFLOATERBIGPREVIEW_H
+#define LL_LLFLOATERBIGPREVIEW_H
+
+#include "llfloater.h"
+
+class LLFloaterBigPreview : public LLFloater
+{
+public:
+ LLFloaterBigPreview(const LLSD& key);
+ ~LLFloaterBigPreview();
+
+ BOOL postBuild();
+ void draw();
+ void onCancel();
+
+ void setPreview(LLView* previewp) { mPreviewHandle = previewp->getHandle(); }
+ void setFloaterOwner(LLFloater* floaterp) { mFloaterOwner = floaterp; }
+ bool isFloaterOwner(LLFloater* floaterp) const { return (mFloaterOwner == floaterp); }
+ void closeOnFloaterOwnerClosing(LLFloater* floaterp);
+
+private:
+ LLHandle<LLView> mPreviewHandle;
+ LLUICtrl* mPreviewPlaceholder;
+ LLFloater* mFloaterOwner;
+};
+
+#endif // LL_LLFLOATERBIGPREVIEW_H
+
diff --git a/indra/newview/llfloaterbulkpermission.cpp b/indra/newview/llfloaterbulkpermission.cpp
index 07bd262c00..f2040bc760 100755
--- a/indra/newview/llfloaterbulkpermission.cpp
+++ b/indra/newview/llfloaterbulkpermission.cpp
@@ -36,7 +36,6 @@
#include "llviewerobject.h"
#include "llviewerobjectlist.h"
#include "llviewerregion.h"
-#include "lscript_rt_interface.h"
#include "llviewercontrol.h"
#include "llviewerinventory.h"
#include "llviewerobject.h"
@@ -96,17 +95,17 @@ void LLFloaterBulkPermission::doApply()
class ModifiableGatherer : public LLSelectedNodeFunctor
{
public:
- ModifiableGatherer(LLDynamicArray<LLUUID>& q) : mQueue(q) {}
+ ModifiableGatherer(std::vector<LLUUID>& q) : mQueue(q) { mQueue.reserve(32); }
virtual bool apply(LLSelectNode* node)
{
if( node->allowOperationOnNode(PERM_MODIFY, GP_OBJECT_MANIPULATE) )
{
- mQueue.put(node->getObject()->getID());
+ mQueue.push_back(node->getObject()->getID());
}
return true;
}
private:
- LLDynamicArray<LLUUID>& mQueue;
+ std::vector<LLUUID>& mQueue;
};
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output");
list->deleteAllItems();
@@ -121,7 +120,7 @@ void LLFloaterBulkPermission::doApply()
mDone = FALSE;
if (!start())
{
- llwarns << "Unexpected bulk permission change failure." << llendl;
+ LL_WARNS() << "Unexpected bulk permission change failure." << LL_ENDL;
}
}
}
@@ -135,7 +134,7 @@ void LLFloaterBulkPermission::inventoryChanged(LLViewerObject* viewer_object,
S32,
void* q_id)
{
- //llinfos << "changed object: " << viewer_object->getID() << llendl;
+ //LL_INFOS() << "changed object: " << viewer_object->getID() << LL_ENDL;
//Remove this listener from the object since its
//listener callback is now being executed.
@@ -160,7 +159,7 @@ void LLFloaterBulkPermission::inventoryChanged(LLViewerObject* viewer_object,
// something went wrong...
// note that we're not working on this one, and move onto the
// next object in the list.
- llwarns << "No inventory for " << mCurrentObjectID << llendl;
+ LL_WARNS() << "No inventory for " << mCurrentObjectID << LL_ENDL;
nextObject();
}
}
@@ -210,7 +209,7 @@ void LLFloaterBulkPermission::onCommitCopy()
BOOL LLFloaterBulkPermission::start()
{
- // note: number of top-level objects to modify is mObjectIDs.count().
+ // note: number of top-level objects to modify is mObjectIDs.size().
getChild<LLScrollListCtrl>("queue output")->setCommentText(getString("start_text"));
return nextObject();
}
@@ -222,15 +221,15 @@ BOOL LLFloaterBulkPermission::nextObject()
BOOL successful_start = FALSE;
do
{
- count = mObjectIDs.count();
- //llinfos << "Objects left to process = " << count << llendl;
+ count = mObjectIDs.size();
+ //LL_INFOS() << "Objects left to process = " << count << LL_ENDL;
mCurrentObjectID.setNull();
if(count > 0)
{
successful_start = popNext();
- //llinfos << (successful_start ? "successful" : "unsuccessful") << llendl;
+ //LL_INFOS() << (successful_start ? "successful" : "unsuccessful") << LL_ENDL;
}
- } while((mObjectIDs.count() > 0) && !successful_start);
+ } while((mObjectIDs.size() > 0) && !successful_start);
if(isDone() && !mDone)
{
@@ -246,16 +245,16 @@ BOOL LLFloaterBulkPermission::popNext()
{
// get the head element from the container, and attempt to get its inventory.
BOOL rv = FALSE;
- S32 count = mObjectIDs.count();
+ S32 count = mObjectIDs.size();
if(mCurrentObjectID.isNull() && (count > 0))
{
- mCurrentObjectID = mObjectIDs.get(0);
- //llinfos << "mCurrentID: " << mCurrentObjectID << llendl;
- mObjectIDs.remove(0);
+ mCurrentObjectID = mObjectIDs.at(0);
+ //LL_INFOS() << "mCurrentID: " << mCurrentObjectID << LL_ENDL;
+ mObjectIDs.erase(mObjectIDs.begin());
LLViewerObject* obj = gObjectList.findObject(mCurrentObjectID);
if(obj)
{
- //llinfos << "requesting inv for " << mCurrentObjectID << llendl;
+ //LL_INFOS() << "requesting inv for " << mCurrentObjectID << LL_ENDL;
LLUUID* id = new LLUUID(mID);
registerVOInventoryListener(obj,id);
requestVOInventory();
@@ -263,7 +262,7 @@ BOOL LLFloaterBulkPermission::popNext()
}
else
{
- llinfos<<"NULL LLViewerObject" <<llendl;
+ LL_INFOS()<<"NULL LLViewerObject" <<LL_ENDL;
}
}
diff --git a/indra/newview/llfloaterbulkpermission.h b/indra/newview/llfloaterbulkpermission.h
index 25e76eca65..0c042c3ee3 100755
--- a/indra/newview/llfloaterbulkpermission.h
+++ b/indra/newview/llfloaterbulkpermission.h
@@ -28,11 +28,9 @@
#ifndef LL_LLBULKPERMISSION_H
#define LL_LLBULKPERMISSION_H
-#include "lldarray.h"
#include "llinventory.h"
#include "llviewerobject.h"
#include "llvoinventorylistener.h"
-#include "llmap.h"
#include "lluuid.h"
#include "llfloater.h"
@@ -79,7 +77,7 @@ private:
void onUncheckAll() { doCheckUncheckAll(FALSE); }
// returns true if this is done
- BOOL isDone() const { return (mCurrentObjectID.isNull() || (mObjectIDs.count() == 0)); }
+ BOOL isDone() const { return (mCurrentObjectID.isNull() || (mObjectIDs.size() == 0)); }
//Read the settings and Apply the permissions
void doApply();
@@ -91,7 +89,7 @@ private:
LLButton* mCloseBtn;
// Object Queue
- LLDynamicArray<LLUUID> mObjectIDs;
+ std::vector<LLUUID> mObjectIDs;
LLUUID mCurrentObjectID;
BOOL mDone;
diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp
index eeb81085bb..ad44c509d9 100755
--- a/indra/newview/llfloaterbump.cpp
+++ b/indra/newview/llfloaterbump.cpp
@@ -110,8 +110,8 @@ void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd)
action = "physical_object_collide";
break;
default:
- llinfos << "LLFloaterBump::add unknown mean collision type "
- << mcd->mType << llendl;
+ LL_INFOS() << "LLFloaterBump::add unknown mean collision type "
+ << mcd->mType << LL_ENDL;
return;
}
diff --git a/indra/newview/llfloaterbuy.cpp b/indra/newview/llfloaterbuy.cpp
index 087b0007e1..5a9cdbba44 100755
--- a/indra/newview/llfloaterbuy.cpp
+++ b/indra/newview/llfloaterbuy.cpp
@@ -194,14 +194,14 @@ void LLFloaterBuy::inventoryChanged(LLViewerObject* obj,
{
if (!obj)
{
- llwarns << "No object in LLFloaterBuy::inventoryChanged" << llendl;
+ LL_WARNS() << "No object in LLFloaterBuy::inventoryChanged" << LL_ENDL;
return;
}
if (!inv)
{
- llwarns << "No inventory in LLFloaterBuy::inventoryChanged"
- << llendl;
+ LL_WARNS() << "No inventory in LLFloaterBuy::inventoryChanged"
+ << LL_ENDL;
removeVOInventoryListener();
return;
}
diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp
index aa6ace2a61..b32ac860aa 100755
--- a/indra/newview/llfloaterbuycontents.cpp
+++ b/indra/newview/llfloaterbuycontents.cpp
@@ -145,7 +145,7 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj,
{
if (!obj)
{
- llwarns << "No object in LLFloaterBuyContents::inventoryChanged" << llendl;
+ LL_WARNS() << "No object in LLFloaterBuyContents::inventoryChanged" << LL_ENDL;
return;
}
@@ -160,8 +160,8 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj,
if (!inv)
{
- llwarns << "No inventory in LLFloaterBuyContents::inventoryChanged"
- << llendl;
+ LL_WARNS() << "No inventory in LLFloaterBuyContents::inventoryChanged"
+ << LL_ENDL;
return;
}
diff --git a/indra/newview/llfloaterbuycurrencyhtml.cpp b/indra/newview/llfloaterbuycurrencyhtml.cpp
index 013cf74c7b..a69aa8d227 100755
--- a/indra/newview/llfloaterbuycurrencyhtml.cpp
+++ b/indra/newview/llfloaterbuycurrencyhtml.cpp
@@ -27,6 +27,7 @@
#include "llviewerprecompiledheaders.h"
#include "llfloaterbuycurrencyhtml.h"
+#include "llhttpconstants.h"
#include "llstatusbar.h"
////////////////////////////////////////////////////////////////////////////////
@@ -82,10 +83,10 @@ void LLFloaterBuyCurrencyHTML::navigateToFinalURL()
LLStringUtil::format( buy_currency_url, replace );
// write final URL to debug console
- llinfos << "Buy currency HTML parsed URL is " << buy_currency_url << llendl;
+ LL_INFOS() << "Buy currency HTML parsed URL is " << buy_currency_url << LL_ENDL;
// kick off the navigation
- mBrowser->navigateTo( buy_currency_url, "text/html" );
+ mBrowser->navigateTo( buy_currency_url, HTTP_CONTENT_TEXT_HTML );
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp
index 42857b2aa2..060c091737 100755
--- a/indra/newview/llfloaterbuyland.cpp
+++ b/indra/newview/llfloaterbuyland.cpp
@@ -202,7 +202,7 @@ public:
virtual void draw();
virtual BOOL canClose();
- void onVisibilityChange ( const LLSD& new_visibility );
+ void onVisibilityChanged ( const LLSD& new_visibility );
};
@@ -877,7 +877,7 @@ void LLFloaterBuyLandUI::startTransaction(TransactionType type, const LLXMLRPCVa
method = "buyLandPrep";
break;
default:
- llwarns << "LLFloaterBuyLandUI: Unknown transaction type!" << llendl;
+ LL_WARNS() << "LLFloaterBuyLandUI: Unknown transaction type!" << LL_ENDL;
return;
}
@@ -934,7 +934,7 @@ void LLFloaterBuyLandUI::tellUserError(
// virtual
BOOL LLFloaterBuyLandUI::postBuild()
{
- setVisibleCallback(boost::bind(&LLFloaterBuyLandUI::onVisibilityChange, this, _2));
+ setVisibleCallback(boost::bind(&LLFloaterBuyLandUI::onVisibilityChanged, this, _2));
mCurrency.prepare();
@@ -1008,7 +1008,7 @@ BOOL LLFloaterBuyLandUI::canClose()
return can_close;
}
-void LLFloaterBuyLandUI::onVisibilityChange ( const LLSD& new_visibility )
+void LLFloaterBuyLandUI::onVisibilityChanged ( const LLSD& new_visibility )
{
if (new_visibility.asBoolean())
{
diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp
index f2deb6a805..669ffa7c59 100755
--- a/indra/newview/llfloaterbvhpreview.cpp
+++ b/indra/newview/llfloaterbvhpreview.cpp
@@ -228,7 +228,7 @@ BOOL LLFloaterBvhPreview::postBuild()
if (!infile.getFileHandle())
{
- llwarns << "Can't open BVH file:" << mFilename << llendl;
+ LL_WARNS() << "Can't open BVH file:" << mFilename << LL_ENDL;
}
else
{
@@ -239,7 +239,7 @@ BOOL LLFloaterBvhPreview::postBuild()
if (file_size == infile.read(file_buffer, file_size))
{
file_buffer[file_size] = '\0';
- llinfos << "Loading BVH file " << mFilename << llendl;
+ LL_INFOS() << "Loading BVH file " << mFilename << LL_ENDL;
ELoadStatus load_status = E_ST_OK;
S32 line_number = 0;
loaderp = new LLBVHLoader(file_buffer, load_status, line_number);
@@ -247,11 +247,11 @@ BOOL LLFloaterBvhPreview::postBuild()
if(load_status == E_ST_NO_XLT_FILE)
{
- llwarns << "NOTE: No translation table found." << llendl;
+ LL_WARNS() << "NOTE: No translation table found." << LL_ENDL;
}
else
{
- llwarns << "ERROR: [line: " << line_number << "] " << status << llendl;
+ LL_WARNS() << "ERROR: [line: " << line_number << "] " << status << LL_ENDL;
}
}
@@ -1002,14 +1002,14 @@ void LLFloaterBvhPreview::onBtnOK(void* userdata)
0,
LLFolderType::FT_NONE,
LLInventoryType::IT_ANIMATION,
- LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
+ LLFloaterPerms::getNextOwnerPerms("Uploads"), LLFloaterPerms::getGroupPerms("Uploads"), LLFloaterPerms::getEveryonePerms("Uploads"),
name,
callback, expected_upload_cost, userdata);
}
else
{
- llwarns << "Failure writing animation data." << llendl;
+ LL_WARNS() << "Failure writing animation data." << LL_ENDL;
LLNotificationsUtil::add("WriteAnimationFail");
}
}
diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp
index a03425649f..0c59ba9a6d 100755
--- a/indra/newview/llfloatercolorpicker.cpp
+++ b/indra/newview/llfloatercolorpicker.cpp
@@ -162,12 +162,7 @@ void LLFloaterColorPicker::createUI ()
// create palette
for ( S32 each = 0; each < numPaletteColumns * numPaletteRows; ++each )
{
- std::ostringstream codec;
- codec << "ColorPaletteEntry" << std::setfill ( '0' ) << std::setw ( 2 ) << each + 1;
-
- // argh!
- const std::string s ( codec.str () );
- mPalette.push_back ( new LLColor4 ( LLUIColorTable::instance().getColor ( s ) ) );
+ mPalette.push_back(new LLColor4(LLUIColorTable::instance().getColor(llformat("ColorPaletteEntry%02d", each + 1))));
}
}
@@ -347,6 +342,11 @@ void LLFloaterColorPicker::setCurRgb ( F32 curRIn, F32 curGIn, F32 curBIn )
curG = curGIn;
curB = curBIn;
+ if (mApplyImmediateCheck->get())
+ {
+ LLColorSwatchCtrl::onColorChanged ( getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE );
+ }
+
// update corresponding HSL values and
LLColor3(curRIn, curGIn, curBIn).calcHSL(&curH, &curS, &curL);
@@ -374,6 +374,11 @@ void LLFloaterColorPicker::setCurHsl ( F32 curHIn, F32 curSIn, F32 curLIn )
// update corresponding RGB values and
hslToRgb ( curH, curS, curL, curR, curG, curB );
+
+ if (mApplyImmediateCheck->get())
+ {
+ LLColorSwatchCtrl::onColorChanged ( getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE );
+ }
}
//////////////////////////////////////////////////////////////////////////////
@@ -463,10 +468,6 @@ void LLFloaterColorPicker::onImmediateCheck( LLUICtrl* ctrl, void* data)
void LLFloaterColorPicker::onColorSelect( const LLTextureEntry& te )
{
setCurRgb(te.getColor().mV[VRED], te.getColor().mV[VGREEN], te.getColor().mV[VBLUE]);
- if (mApplyImmediateCheck->get())
- {
- LLColorSwatchCtrl::onColorChanged ( getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE );
- }
}
void LLFloaterColorPicker::onMouseCaptureLost()
@@ -529,11 +530,11 @@ void LLFloaterColorPicker::draw()
if (gFocusMgr.childHasMouseCapture(getDragHandle()))
{
mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"),
- LLCriticalDamp::getInterpolant(mContextConeFadeTime));
+ LLSmoothInterpolation::getInterpolant(mContextConeFadeTime));
}
else
{
- mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(mContextConeFadeTime));
+ mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLSmoothInterpolation::getInterpolant(mContextConeFadeTime));
}
mPipetteBtn->setToggleState(LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance());
diff --git a/indra/newview/llfloatercolorpicker.h b/indra/newview/llfloatercolorpicker.h
index bab0617712..d4d22b643a 100755
--- a/indra/newview/llfloatercolorpicker.h
+++ b/indra/newview/llfloatercolorpicker.h
@@ -33,7 +33,6 @@
#include "llpointer.h"
#include "llcolorswatch.h"
#include "llspinctrl.h"
-#include "lltextureentry.h"
class LLButton;
class LLLineEditor;
@@ -121,7 +120,7 @@ class LLFloaterColorPicker
void onClickPipette ( );
static void onTextCommit ( LLUICtrl* ctrl, void* data );
static void onImmediateCheck ( LLUICtrl* ctrl, void* data );
- void onColorSelect( const LLTextureEntry& te );
+ void onColorSelect( const class LLTextureEntry& te );
private:
// draws color selection palette
void drawPalette ();
@@ -171,7 +170,7 @@ class LLFloaterColorPicker
const S32 mPaletteRegionHeight;
// image used to compose color grid
- LLPointer<LLViewerTexture> mRGBImage;
+ LLPointer<class LLViewerTexture> mRGBImage;
// current swatch in use
LLColorSwatchCtrl* mSwatch;
diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp
index a303c2c6b3..a358b7c10b 100755
--- a/indra/newview/llfloaterconversationpreview.cpp
+++ b/indra/newview/llfloaterconversationpreview.cpp
@@ -32,6 +32,7 @@
#include "llfloaterimnearbychat.h"
#include "llspinctrl.h"
#include "lltrans.h"
+#include "llnotificationsutil.h"
const std::string LL_FCP_COMPLETE_NAME("complete_name");
const std::string LL_FCP_ACCOUNT_NAME("user_name");
@@ -45,14 +46,20 @@ LLFloaterConversationPreview::LLFloaterConversationPreview(const LLSD& session_i
mAccountName(session_id[LL_FCP_ACCOUNT_NAME]),
mCompleteName(session_id[LL_FCP_COMPLETE_NAME]),
mMutex(NULL),
- mShowHistory(false)
+ mShowHistory(false),
+ mMessages(NULL),
+ mHistoryThreadsBusy(false),
+ mOpened(false)
+{
+}
+
+LLFloaterConversationPreview::~LLFloaterConversationPreview()
{
}
BOOL LLFloaterConversationPreview::postBuild()
{
mChatHistory = getChild<LLChatHistory>("chat_history");
- LLLoadHistoryThread::setLoadEndSignal(boost::bind(&LLFloaterConversationPreview::setPages, this, _1, _2));
const LLConversation* conv = LLConversationLog::instance().getConversation(mSessionID);
std::string name;
@@ -79,31 +86,21 @@ BOOL LLFloaterConversationPreview::postBuild()
std::string title = getString("Title", args);
setTitle(title);
- LLSD load_params;
- load_params["load_all_history"] = true;
- load_params["cut_off_todays_date"] = false;
-
-
- LLSD loading;
- loading[LL_IM_TEXT] = LLTrans::getString("loading_chat_logs");
- mMessages.push_back(loading);
- mPageSpinner = getChild<LLSpinCtrl>("history_page_spin");
- mPageSpinner->setCommitCallback(boost::bind(&LLFloaterConversationPreview::onMoreHistoryBtnClick, this));
- mPageSpinner->setMinValue(1);
- mPageSpinner->set(1);
- mPageSpinner->setEnabled(false);
- LLLogChat::startChatHistoryThread(file, load_params);
return LLFloater::postBuild();
}
-void LLFloaterConversationPreview::setPages(std::list<LLSD>& messages,const std::string& file_name)
+void LLFloaterConversationPreview::setPages(std::list<LLSD>* messages, const std::string& file_name)
{
- if(file_name == mChatHistoryFileName)
+ if(file_name == mChatHistoryFileName && messages)
{
// additional protection to avoid changes of mMessages in setPages()
LLMutexLock lock(&mMutex);
+ if (mMessages)
+ {
+ delete mMessages; // Clean up temporary message list with "Loading..." text
+ }
mMessages = messages;
- mCurrentPage = (mMessages.size() ? (mMessages.size() - 1) / mPageSize : 0);
+ mCurrentPage = (mMessages->size() ? (mMessages->size() - 1) / mPageSize : 0);
mPageSpinner->setEnabled(true);
mPageSpinner->setMaxValue(mCurrentPage+1);
@@ -113,6 +110,11 @@ void LLFloaterConversationPreview::setPages(std::list<LLSD>& messages,const std:
getChild<LLTextBox>("page_num_label")->setValue(total_page_num);
mShowHistory = true;
}
+ LLLoadHistoryThread* loadThread = LLLogChat::getLoadHistoryThread(mSessionID);
+ if (loadThread)
+ {
+ loadThread->removeLoadEndSignal(boost::bind(&LLFloaterConversationPreview::setPages, this, _1, _2));
+ }
}
void LLFloaterConversationPreview::draw()
@@ -127,24 +129,82 @@ void LLFloaterConversationPreview::draw()
void LLFloaterConversationPreview::onOpen(const LLSD& key)
{
+ if (mOpened)
+ {
+ return;
+ }
+ mOpened = true;
+ if (!LLLogChat::historyThreadsFinished(mSessionID))
+ {
+ LLNotificationsUtil::add("ChatHistoryIsBusyAlert");
+ mHistoryThreadsBusy = true;
+ closeFloater();
+ return;
+ }
+ LLSD load_params;
+ load_params["load_all_history"] = true;
+ load_params["cut_off_todays_date"] = false;
+
+ // The temporary message list with "Loading..." text
+ // Will be deleted upon loading completion in setPages() method
+ mMessages = new std::list<LLSD>();
+
+
+ LLSD loading;
+ loading[LL_IM_TEXT] = LLTrans::getString("loading_chat_logs");
+ mMessages->push_back(loading);
+ mPageSpinner = getChild<LLSpinCtrl>("history_page_spin");
+ mPageSpinner->setCommitCallback(boost::bind(&LLFloaterConversationPreview::onMoreHistoryBtnClick, this));
+ mPageSpinner->setMinValue(1);
+ mPageSpinner->set(1);
+ mPageSpinner->setEnabled(false);
+
+ // The actual message list to load from file
+ // Will be deleted in a separate thread LLDeleteHistoryThread not to freeze UI
+ // LLDeleteHistoryThread is started in destructor
+ std::list<LLSD>* messages = new std::list<LLSD>();
+
+ LLLogChat::cleanupHistoryThreads();
+
+ LLLoadHistoryThread* loadThread = new LLLoadHistoryThread(mChatHistoryFileName, messages, load_params);
+ loadThread->setLoadEndSignal(boost::bind(&LLFloaterConversationPreview::setPages, this, _1, _2));
+ loadThread->start();
+ LLLogChat::addLoadHistoryThread(mSessionID, loadThread);
+
+ LLDeleteHistoryThread* deleteThread = new LLDeleteHistoryThread(messages, loadThread);
+ LLLogChat::addDeleteHistoryThread(mSessionID, deleteThread);
+
mShowHistory = true;
}
+void LLFloaterConversationPreview::onClose(bool app_quitting)
+{
+ mOpened = false;
+ if (!mHistoryThreadsBusy)
+ {
+ LLDeleteHistoryThread* deleteThread = LLLogChat::getDeleteHistoryThread(mSessionID);
+ if (deleteThread)
+ {
+ deleteThread->start();
+ }
+ }
+}
+
void LLFloaterConversationPreview::showHistory()
{
// additional protection to avoid changes of mMessages in setPages
LLMutexLock lock(&mMutex);
- if (!mMessages.size() || mCurrentPage * mPageSize >= mMessages.size())
+ if(mMessages == NULL || !mMessages->size() || mCurrentPage * mPageSize >= mMessages->size())
{
return;
}
mChatHistory->clear();
std::ostringstream message;
- std::list<LLSD>::const_iterator iter = mMessages.begin();
+ std::list<LLSD>::const_iterator iter = mMessages->begin();
std::advance(iter, mCurrentPage * mPageSize);
- for (int msg_num = 0; iter != mMessages.end() && msg_num < mPageSize; ++iter, ++msg_num)
+ for (int msg_num = 0; iter != mMessages->end() && msg_num < mPageSize; ++iter, ++msg_num)
{
LLSD msg = *iter;
diff --git a/indra/newview/llfloaterconversationpreview.h b/indra/newview/llfloaterconversationpreview.h
index b0488f4ff1..a8dbbc9ffe 100755
--- a/indra/newview/llfloaterconversationpreview.h
+++ b/indra/newview/llfloaterconversationpreview.h
@@ -39,13 +39,14 @@ class LLFloaterConversationPreview : public LLFloater
public:
LLFloaterConversationPreview(const LLSD& session_id);
- virtual ~LLFloaterConversationPreview(){};
+ virtual ~LLFloaterConversationPreview();
virtual BOOL postBuild();
- void setPages(std::list<LLSD>& messages,const std::string& file_name);
+ void setPages(std::list<LLSD>* messages,const std::string& file_name);
virtual void draw();
virtual void onOpen(const LLSD& key);
+ virtual void onClose(bool app_quitting);
private:
void onMoreHistoryBtnClick();
@@ -58,11 +59,13 @@ private:
int mCurrentPage;
int mPageSize;
- std::list<LLSD> mMessages;
+ std::list<LLSD>* mMessages;
std::string mAccountName;
std::string mCompleteName;
- std::string mChatHistoryFileName;
+ std::string mChatHistoryFileName;
bool mShowHistory;
+ bool mHistoryThreadsBusy;
+ bool mOpened;
};
#endif /* LLFLOATERCONVERSATIONPREVIEW_H_ */
diff --git a/indra/newview/llfloaterdeleteenvpreset.cpp b/indra/newview/llfloaterdeleteenvpreset.cpp
index d08aa81cfe..bb11c813b4 100755
--- a/indra/newview/llfloaterdeleteenvpreset.cpp
+++ b/indra/newview/llfloaterdeleteenvpreset.cpp
@@ -144,7 +144,7 @@ void LLFloaterDeleteEnvPreset::onBtnDelete()
}
else
{
- llwarns << "Unrecognized key" << llendl;
+ LL_WARNS() << "Unrecognized key" << LL_ENDL;
}
LLSD args;
@@ -176,7 +176,7 @@ void LLFloaterDeleteEnvPreset::populatePresetsList()
}
else
{
- llwarns << "Unrecognized key" << llendl;
+ LL_WARNS() << "Unrecognized key" << LL_ENDL;
}
}
diff --git a/indra/newview/llfloaterdisplayname.cpp b/indra/newview/llfloaterdisplayname.cpp
index e2cef5630b..596e8c0dbe 100755
--- a/indra/newview/llfloaterdisplayname.cpp
+++ b/indra/newview/llfloaterdisplayname.cpp
@@ -127,7 +127,7 @@ void LLFloaterDisplayName::onCacheSetName(bool success,
// Request failed, notify the user
std::string error_tag = content["error_tag"].asString();
- llinfos << "set name failure error_tag " << error_tag << llendl;
+ LL_INFOS() << "set name failure error_tag " << error_tag << LL_ENDL;
// We might have a localized string for this message
// error_args will usually be empty from the server.
diff --git a/indra/newview/llfloatereditdaycycle.cpp b/indra/newview/llfloatereditdaycycle.cpp
index 78e20e3bf0..5c0991b0b3 100755
--- a/indra/newview/llfloatereditdaycycle.cpp
+++ b/indra/newview/llfloatereditdaycycle.cpp
@@ -172,7 +172,7 @@ void LLFloaterEditDayCycle::loadTrack()
// add sliders
- lldebugs << "Adding " << LLWLParamManager::getInstance()->mDay.mTimeMap.size() << " keys to slider" << llendl;
+ LL_DEBUGS() << "Adding " << LLWLParamManager::getInstance()->mDay.mTimeMap.size() << " keys to slider" << LL_ENDL;
LLWLDayCycle& cur_dayp = LLWLParamManager::instance().mDay;
for (std::map<F32, LLWLParamKey>::iterator it = cur_dayp.mTimeMap.begin(); it != cur_dayp.mTimeMap.end(); ++it)
@@ -192,12 +192,12 @@ void LLFloaterEditDayCycle::loadTrack()
void LLFloaterEditDayCycle::applyTrack()
{
- lldebugs << "Applying track (" << mSliderToKey.size() << ")" << llendl;
+ LL_DEBUGS() << "Applying track (" << mSliderToKey.size() << ")" << LL_ENDL;
// if no keys, do nothing
if (mSliderToKey.size() == 0)
{
- lldebugs << "No keys, not syncing" << llendl;
+ LL_DEBUGS() << "No keys, not syncing" << LL_ENDL;
return;
}
@@ -342,7 +342,7 @@ void LLFloaterEditDayCycle::onKeyTimeMoved()
// check to see if a key exists
LLWLParamKey key = mSliderToKey[cur_sldr].keyframe;
- lldebugs << "Setting key time: " << time24 << LL_ENDL;
+ LL_DEBUGS() << "Setting key time: " << time24 << LL_ENDL;
mSliderToKey[cur_sldr].time = time24;
// if it exists, turn on check box
@@ -368,7 +368,7 @@ void LLFloaterEditDayCycle::onKeyTimeChanged()
F32 time = mKeysSlider->getCurSliderValue() / sHoursPerDay;
// now set the key's time in the sliderToKey map
- lldebugs << "Setting key time: " << time << LL_ENDL;
+ LL_DEBUGS() << "Setting key time: " << time << LL_ENDL;
mSliderToKey[cur_sldr].time = time;
applyTrack();
@@ -564,7 +564,7 @@ void LLFloaterEditDayCycle::saveRegionDayCycle()
#else // Temporary disabled ability to upload new region settings from the Day Cycle Editor.
if (!LLEnvManagerNew::instance().sendRegionSettings(new_region_settings))
{
- llwarns << "Error applying region environment settings" << llendl;
+ LL_WARNS() << "Error applying region environment settings" << LL_ENDL;
return;
}
@@ -637,7 +637,7 @@ void LLFloaterEditDayCycle::onRegionSettingsChange()
// Change preference if requested.
if (mMakeDefaultCheckBox->getValue())
{
- LL_DEBUGS("Windlight") << "Changed environment preference to region settings" << llendl;
+ LL_DEBUGS("Windlight") << "Changed environment preference to region settings" << LL_ENDL;
LLEnvManagerNew::instance().setUseRegionSettings(true);
}
@@ -699,7 +699,7 @@ void LLFloaterEditDayCycle::onDayCycleSelected()
{
if (!LLDayCycleManager::instance().getPreset(dc_key.name, day_data))
{
- llwarns << "No day cycle named " << dc_key.name << llendl;
+ LL_WARNS() << "No day cycle named " << dc_key.name << LL_ENDL;
return;
}
}
@@ -708,7 +708,7 @@ void LLFloaterEditDayCycle::onDayCycleSelected()
day_data = LLEnvManagerNew::instance().getRegionSettings().getWLDayCycle();
if (day_data.size() == 0)
{
- llwarns << "Empty region day cycle" << llendl;
+ LL_WARNS() << "Empty region day cycle" << LL_ENDL;
llassert(day_data.size() > 0);
return;
}
@@ -742,7 +742,7 @@ void LLFloaterEditDayCycle::onBtnSave()
if (name.empty())
{
// *TODO: show an alert
- llwarns << "Empty day cycle name" << llendl;
+ LL_WARNS() << "Empty day cycle name" << LL_ENDL;
return;
}
@@ -795,7 +795,7 @@ void LLFloaterEditDayCycle::onSaveConfirmed()
// Change preference if requested.
if (mMakeDefaultCheckBox->getValue())
{
- LL_DEBUGS("Windlight") << name << " is now the new preferred day cycle" << llendl;
+ LL_DEBUGS("Windlight") << name << " is now the new preferred day cycle" << LL_ENDL;
LLEnvManagerNew::instance().setUseDayCycle(name);
}
diff --git a/indra/newview/llfloatereditsky.cpp b/indra/newview/llfloatereditsky.cpp
index 352361ce9e..d809211ea7 100755
--- a/indra/newview/llfloatereditsky.cpp
+++ b/indra/newview/llfloatereditsky.cpp
@@ -721,7 +721,7 @@ void LLFloaterEditSky::saveRegionSky()
LLWLParamKey key(getSelectedSkyPreset());
llassert(key.scope == LLEnvKey::SCOPE_REGION);
- LL_DEBUGS("Windlight") << "Saving region sky preset: " << key.name << llendl;
+ LL_DEBUGS("Windlight") << "Saving region sky preset: " << key.name << LL_ENDL;
LLWLParamManager& wl_mgr = LLWLParamManager::instance();
wl_mgr.mCurParams.mName = key.name;
wl_mgr.setParamSet(key, wl_mgr.mCurParams);
@@ -819,7 +819,7 @@ void LLFloaterEditSky::onSaveConfirmed()
// Change preference if requested.
if (mMakeDefaultCheckBox->getValue())
{
- LL_DEBUGS("Windlight") << key.name << " is now the new preferred sky preset" << llendl;
+ LL_DEBUGS("Windlight") << key.name << " is now the new preferred sky preset" << LL_ENDL;
LLEnvManagerNew::instance().setUseSkyPreset(key.name);
}
@@ -842,7 +842,7 @@ void LLFloaterEditSky::onBtnSave()
if (name.empty())
{
// *TODO: show an alert
- llwarns << "Empty sky preset name" << llendl;
+ LL_WARNS() << "Empty sky preset name" << LL_ENDL;
return;
}
diff --git a/indra/newview/llfloatereditwater.cpp b/indra/newview/llfloatereditwater.cpp
index 64cfc4054f..43b44eae37 100755
--- a/indra/newview/llfloatereditwater.cpp
+++ b/indra/newview/llfloatereditwater.cpp
@@ -546,7 +546,7 @@ void LLFloaterEditWater::saveRegionWater()
{
llassert(getCurrentScope() == LLEnvKey::SCOPE_REGION); // make sure we're editing region water
- LL_DEBUGS("Windlight") << "Saving region water preset" << llendl;
+ LL_DEBUGS("Windlight") << "Saving region water preset" << LL_ENDL;
//LLWaterParamSet region_water = water_mgr.mCurParams;
@@ -665,7 +665,7 @@ void LLFloaterEditWater::onSaveConfirmed()
// Change preference if requested.
if (mMakeDefaultCheckBox->getEnabled() && mMakeDefaultCheckBox->getValue())
{
- LL_DEBUGS("Windlight") << name << " is now the new preferred water preset" << llendl;
+ LL_DEBUGS("Windlight") << name << " is now the new preferred water preset" << LL_ENDL;
LLEnvManagerNew::instance().setUseWaterPreset(name);
}
@@ -688,7 +688,7 @@ void LLFloaterEditWater::onBtnSave()
if (name.empty())
{
// *TODO: show an alert
- llwarns << "Empty water preset name" << llendl;
+ LL_WARNS() << "Empty water preset name" << LL_ENDL;
return;
}
diff --git a/indra/newview/llfloaterevent.cpp b/indra/newview/llfloaterevent.cpp
index a6dafda3e6..3e303e0932 100755
--- a/indra/newview/llfloaterevent.cpp
+++ b/indra/newview/llfloaterevent.cpp
@@ -45,7 +45,6 @@
#include "llmediactrl.h"
#include "llfloaterworldmap.h"
#include "llinventorymodel.h"
-#include "llsecondlifeurls.h"
#include "llslurl.h"
#include "lltextbox.h"
#include "lltexteditor.h"
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloaterfacebook.cpp
index e8c6b179cf..6888e076aa 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloaterfacebook.cpp
@@ -1,6 +1,6 @@
/**
-* @file llfloatersocial.cpp
-* @brief Implementation of llfloatersocial
+* @file llfloaterfacebook.cpp
+* @brief Implementation of llfloaterfacebook
* @author Gilbert@lindenlab.com
*
* $LicenseInfo:firstyear=2013&license=viewerlgpl$
@@ -27,15 +27,17 @@
#include "llviewerprecompiledheaders.h"
-#include "llfloatersocial.h"
+#include "llfloaterfacebook.h"
#include "llagent.h"
#include "llagentui.h"
#include "llcheckboxctrl.h"
#include "llcombobox.h"
#include "llfacebookconnect.h"
+#include "llfloaterbigpreview.h"
#include "llfloaterreg.h"
#include "lliconctrl.h"
+#include "llimagefiltersmanager.h"
#include "llresmgr.h" // LLLocale
#include "llsdserialize.h"
#include "llloadingindicator.h"
@@ -46,11 +48,16 @@
#include "llviewerregion.h"
#include "llviewercontrol.h"
#include "llviewermedia.h"
+#include "lltabcontainer.h"
+#include "llavatarlist.h"
+#include "llpanelpeoplemenus.h"
+#include "llaccordionctrl.h"
+#include "llaccordionctrltab.h"
-static LLPanelInjector<LLSocialStatusPanel> t_panel_status("llsocialstatuspanel");
-static LLPanelInjector<LLSocialPhotoPanel> t_panel_photo("llsocialphotopanel");
-static LLPanelInjector<LLSocialCheckinPanel> t_panel_checkin("llsocialcheckinpanel");
-static LLPanelInjector<LLSocialAccountPanel> t_panel_account("llsocialaccountpanel");
+static LLPanelInjector<LLFacebookStatusPanel> t_panel_status("llfacebookstatuspanel");
+static LLPanelInjector<LLFacebookPhotoPanel> t_panel_photo("llfacebookphotopanel");
+static LLPanelInjector<LLFacebookCheckinPanel> t_panel_checkin("llfacebookcheckinpanel");
+static LLPanelInjector<LLFacebookFriendsPanel> t_panel_friends("llfacebookfriendspanel");
const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte
const std::string DEFAULT_CHECKIN_LOCATION_URL = "http://maps.secondlife.com/";
@@ -58,12 +65,17 @@ const std::string DEFAULT_CHECKIN_ICON_URL = "http://map.secondlife.com.s3.amazo
const std::string DEFAULT_CHECKIN_QUERY_PARAMETERS = "?sourceid=slshare_checkin&utm_source=facebook&utm_medium=checkin&utm_campaign=slshare";
const std::string DEFAULT_PHOTO_QUERY_PARAMETERS = "?sourceid=slshare_photo&utm_source=facebook&utm_medium=photo&utm_campaign=slshare";
+const S32 MAX_QUALITY = 100; // Max quality value for jpeg images
+const S32 MIN_QUALITY = 0; // Min quality value for jpeg images
+const S32 TARGET_DATA_SIZE = 95000; // Size of the image (compressed) we're trying to send to Facebook
+
std::string get_map_url()
{
LLVector3d center_agent;
- if (gAgent.getRegion())
+ LLViewerRegion *regionp = gAgent.getRegion();
+ if (regionp)
{
- center_agent = gAgent.getRegion()->getCenterGlobal();
+ center_agent = regionp->getCenterGlobal();
}
int x_pos = center_agent[0] / 256.0;
int y_pos = center_agent[1] / 256.0;
@@ -71,20 +83,44 @@ std::string get_map_url()
return map_url;
}
+// Compute target jpeg quality : see https://wiki.lindenlab.com/wiki/Facebook_Image_Quality for details
+S32 compute_jpeg_quality(S32 width, S32 height)
+{
+ F32 target_compression_ratio = (F32)(width * height * 3) / (F32)(TARGET_DATA_SIZE);
+ S32 quality = (S32)(110.0f - (2.0f * target_compression_ratio));
+ return llclamp(quality,MIN_QUALITY,MAX_QUALITY);
+}
+
///////////////////////////
-//LLSocialStatusPanel//////
+//LLFacebookStatusPanel//////
///////////////////////////
-LLSocialStatusPanel::LLSocialStatusPanel() :
+LLFacebookStatusPanel::LLFacebookStatusPanel() :
mMessageTextEditor(NULL),
mPostButton(NULL),
- mCancelButton(NULL)
+ mCancelButton(NULL),
+ mAccountCaptionLabel(NULL),
+ mAccountNameLabel(NULL),
+ mPanelButtons(NULL),
+ mConnectButton(NULL),
+ mDisconnectButton(NULL)
{
- mCommitCallbackRegistrar.add("SocialSharing.SendStatus", boost::bind(&LLSocialStatusPanel::onSend, this));
+ mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLFacebookStatusPanel::onConnect, this));
+ mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLFacebookStatusPanel::onDisconnect, this));
+
+ setVisibleCallback(boost::bind(&LLFacebookStatusPanel::onVisibilityChange, this, _2));
+
+ mCommitCallbackRegistrar.add("SocialSharing.SendStatus", boost::bind(&LLFacebookStatusPanel::onSend, this));
}
-BOOL LLSocialStatusPanel::postBuild()
+BOOL LLFacebookStatusPanel::postBuild()
{
+ mAccountCaptionLabel = getChild<LLTextBox>("account_caption_label");
+ mAccountNameLabel = getChild<LLTextBox>("account_name_label");
+ mPanelButtons = getChild<LLUICtrl>("panel_buttons");
+ mConnectButton = getChild<LLUICtrl>("connect_btn");
+ mDisconnectButton = getChild<LLUICtrl>("disconnect_btn");
+
mMessageTextEditor = getChild<LLUICtrl>("status_message");
mPostButton = getChild<LLUICtrl>("post_status_btn");
mCancelButton = getChild<LLUICtrl>("cancel_status_btn");
@@ -92,8 +128,18 @@ BOOL LLSocialStatusPanel::postBuild()
return LLPanel::postBuild();
}
-void LLSocialStatusPanel::draw()
+void LLFacebookStatusPanel::draw()
{
+ LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState();
+
+ //Disable the 'disconnect' button and the 'use another account' button when disconnecting in progress
+ bool disconnecting = connection_state == LLFacebookConnect::FB_DISCONNECTING;
+ mDisconnectButton->setEnabled(!disconnecting);
+
+ //Disable the 'connect' button when a connection is in progress
+ bool connecting = connection_state == LLFacebookConnect::FB_CONNECTION_IN_PROGRESS;
+ mConnectButton->setEnabled(!connecting);
+
if (mMessageTextEditor && mPostButton && mCancelButton)
{
bool no_ongoing_connection = !(LLFacebookConnect::instance().isTransactionOngoing());
@@ -106,11 +152,11 @@ void LLSocialStatusPanel::draw()
LLPanel::draw();
}
-void LLSocialStatusPanel::onSend()
+void LLFacebookStatusPanel::onSend()
{
- LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel"); // just in case it is already listening
- LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialStatusPanel", boost::bind(&LLSocialStatusPanel::onFacebookConnectStateChange, this, _1));
-
+ LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookStatusPanel"); // just in case it is already listening
+ LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookStatusPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectStateChange, this, _1));
+
// Connect to Facebook if necessary and then post
if (LLFacebookConnect::instance().isConnected())
{
@@ -122,7 +168,7 @@ void LLSocialStatusPanel::onSend()
}
}
-bool LLSocialStatusPanel::onFacebookConnectStateChange(const LLSD& data)
+bool LLFacebookStatusPanel::onFacebookConnectStateChange(const LLSD& data)
{
switch (data.get("enum").asInteger())
{
@@ -131,7 +177,7 @@ bool LLSocialStatusPanel::onFacebookConnectStateChange(const LLSD& data)
break;
case LLFacebookConnect::FB_POSTED:
- LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel");
+ LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookStatusPanel");
clearAndClose();
break;
}
@@ -139,7 +185,25 @@ bool LLSocialStatusPanel::onFacebookConnectStateChange(const LLSD& data)
return false;
}
-void LLSocialStatusPanel::sendStatus()
+bool LLFacebookStatusPanel::onFacebookConnectAccountStateChange(const LLSD& data)
+{
+ if(LLFacebookConnect::instance().isConnected())
+ {
+ //In process of disconnecting so leave the layout as is
+ if(data.get("enum").asInteger() != LLFacebookConnect::FB_DISCONNECTING)
+ {
+ showConnectedLayout();
+ }
+ }
+ else
+ {
+ showDisconnectedLayout();
+ }
+
+ return false;
+}
+
+void LLFacebookStatusPanel::sendStatus()
{
std::string message = mMessageTextEditor->getValue().asString();
if (!message.empty())
@@ -148,7 +212,104 @@ void LLSocialStatusPanel::sendStatus()
}
}
-void LLSocialStatusPanel::clearAndClose()
+void LLFacebookStatusPanel::onVisibilityChange(BOOL visible)
+{
+ if(visible)
+ {
+ LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel");
+ LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectAccountStateChange, this, _1));
+
+ LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel");
+ LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectInfoChange, this));
+
+ //Connected
+ if(LLFacebookConnect::instance().isConnected())
+ {
+ showConnectedLayout();
+ }
+ //Check if connected (show disconnected layout in meantime)
+ else
+ {
+ showDisconnectedLayout();
+ }
+ if ((LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_NOT_CONNECTED) ||
+ (LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_CONNECTION_FAILED))
+ {
+ LLFacebookConnect::instance().checkConnectionToFacebook();
+ }
+ }
+ else
+ {
+ LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel");
+ LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel");
+ }
+}
+
+bool LLFacebookStatusPanel::onFacebookConnectInfoChange()
+{
+ LLSD info = LLFacebookConnect::instance().getInfo();
+ std::string clickable_name;
+
+ //Strings of format [http://www.somewebsite.com Click Me] become clickable text
+ if(info.has("link") && info.has("name"))
+ {
+ clickable_name = "[" + info["link"].asString() + " " + info["name"].asString() + "]";
+ }
+
+ mAccountNameLabel->setText(clickable_name);
+
+ return false;
+}
+
+void LLFacebookStatusPanel::showConnectButton()
+{
+ if(!mConnectButton->getVisible())
+ {
+ mConnectButton->setVisible(TRUE);
+ mDisconnectButton->setVisible(FALSE);
+ }
+}
+
+void LLFacebookStatusPanel::hideConnectButton()
+{
+ if(mConnectButton->getVisible())
+ {
+ mConnectButton->setVisible(FALSE);
+ mDisconnectButton->setVisible(TRUE);
+ }
+}
+
+void LLFacebookStatusPanel::showDisconnectedLayout()
+{
+ mAccountCaptionLabel->setText(getString("facebook_disconnected"));
+ mAccountNameLabel->setText(std::string(""));
+ showConnectButton();
+}
+
+void LLFacebookStatusPanel::showConnectedLayout()
+{
+ LLFacebookConnect::instance().loadFacebookInfo();
+
+ mAccountCaptionLabel->setText(getString("facebook_connected"));
+ hideConnectButton();
+}
+
+void LLFacebookStatusPanel::onConnect()
+{
+ LLFacebookConnect::instance().checkConnectionToFacebook(true);
+
+ //Clear only the facebook browser cookies so that the facebook login screen appears
+ LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com");
+}
+
+void LLFacebookStatusPanel::onDisconnect()
+{
+ LLFacebookConnect::instance().disconnectFromFacebook();
+
+ LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com");
+}
+
+void LLFacebookStatusPanel::clearAndClose()
{
mMessageTextEditor->setValue("");
@@ -160,23 +321,26 @@ void LLSocialStatusPanel::clearAndClose()
}
///////////////////////////
-//LLSocialPhotoPanel///////
+//LLFacebookPhotoPanel///////
///////////////////////////
-LLSocialPhotoPanel::LLSocialPhotoPanel() :
-mSnapshotPanel(NULL),
+LLFacebookPhotoPanel::LLFacebookPhotoPanel() :
mResolutionComboBox(NULL),
mRefreshBtn(NULL),
+mBtnPreview(NULL),
mWorkingLabel(NULL),
mThumbnailPlaceholder(NULL),
mCaptionTextBox(NULL),
-mPostButton(NULL)
+mPostButton(NULL),
+mBigPreviewFloater(NULL),
+mQuality(MAX_QUALITY)
{
- mCommitCallbackRegistrar.add("SocialSharing.SendPhoto", boost::bind(&LLSocialPhotoPanel::onSend, this));
- mCommitCallbackRegistrar.add("SocialSharing.RefreshPhoto", boost::bind(&LLSocialPhotoPanel::onClickNewSnapshot, this));
+ mCommitCallbackRegistrar.add("SocialSharing.SendPhoto", boost::bind(&LLFacebookPhotoPanel::onSend, this));
+ mCommitCallbackRegistrar.add("SocialSharing.RefreshPhoto", boost::bind(&LLFacebookPhotoPanel::onClickNewSnapshot, this));
+ mCommitCallbackRegistrar.add("SocialSharing.BigPreview", boost::bind(&LLFacebookPhotoPanel::onClickBigPreview, this));
}
-LLSocialPhotoPanel::~LLSocialPhotoPanel()
+LLFacebookPhotoPanel::~LLFacebookPhotoPanel()
{
if(mPreviewHandle.get())
{
@@ -184,24 +348,64 @@ LLSocialPhotoPanel::~LLSocialPhotoPanel()
}
}
-BOOL LLSocialPhotoPanel::postBuild()
+BOOL LLFacebookPhotoPanel::postBuild()
{
- setVisibleCallback(boost::bind(&LLSocialPhotoPanel::onVisibilityChange, this, _2));
+ setVisibleCallback(boost::bind(&LLFacebookPhotoPanel::onVisibilityChange, this, _2));
- mSnapshotPanel = getChild<LLUICtrl>("snapshot_panel");
mResolutionComboBox = getChild<LLUICtrl>("resolution_combobox");
- mResolutionComboBox->setCommitCallback(boost::bind(&LLSocialPhotoPanel::updateResolution, this, TRUE));
+ mResolutionComboBox->setValue("[i1200,i630]"); // hardcoded defaults ftw!
+ mResolutionComboBox->setCommitCallback(boost::bind(&LLFacebookPhotoPanel::updateResolution, this, TRUE));
+ mFilterComboBox = getChild<LLUICtrl>("filters_combobox");
+ mFilterComboBox->setCommitCallback(boost::bind(&LLFacebookPhotoPanel::updateResolution, this, TRUE));
mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn");
+ mBtnPreview = getChild<LLButton>("big_preview_btn");
mWorkingLabel = getChild<LLUICtrl>("working_lbl");
mThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder");
mCaptionTextBox = getChild<LLUICtrl>("photo_caption");
mPostButton = getChild<LLUICtrl>("post_photo_btn");
mCancelButton = getChild<LLUICtrl>("cancel_photo_btn");
+ mBigPreviewFloater = dynamic_cast<LLFloaterBigPreview*>(LLFloaterReg::getInstance("big_preview"));
+
+ // Update filter list
+ std::vector<std::string> filter_list = LLImageFiltersManager::getInstance()->getFiltersList();
+ LLComboBox* filterbox = static_cast<LLComboBox *>(mFilterComboBox);
+ for (U32 i = 0; i < filter_list.size(); i++)
+ {
+ filterbox->add(filter_list[i]);
+ }
return LLPanel::postBuild();
}
-void LLSocialPhotoPanel::draw()
+// virtual
+S32 LLFacebookPhotoPanel::notify(const LLSD& info)
+{
+ if (info.has("snapshot-updating"))
+ {
+ // Disable the Post button and whatever else while the snapshot is not updated
+ // updateControls();
+ return 1;
+ }
+
+ if (info.has("snapshot-updated"))
+ {
+ // Enable the send/post/save buttons.
+ updateControls();
+
+ // The refresh button is initially hidden. We show it after the first update,
+ // i.e. after snapshot is taken
+ LLUICtrl * refresh_button = getRefreshBtn();
+ if (!refresh_button->getVisible())
+ {
+ refresh_button->setVisible(true);
+ }
+ return 1;
+ }
+
+ return 0;
+}
+
+void LLFacebookPhotoPanel::draw()
{
LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(mPreviewHandle.get());
@@ -210,9 +414,21 @@ void LLSocialPhotoPanel::draw()
mCancelButton->setEnabled(no_ongoing_connection);
mCaptionTextBox->setEnabled(no_ongoing_connection);
mResolutionComboBox->setEnabled(no_ongoing_connection);
+ mFilterComboBox->setEnabled(no_ongoing_connection);
mRefreshBtn->setEnabled(no_ongoing_connection);
+ mBtnPreview->setEnabled(no_ongoing_connection);
+
+ // Reassign the preview floater if we have the focus and the preview exists
+ if (hasFocus() && isPreviewVisible())
+ {
+ attachPreview();
+ }
- // Display the preview if one is available
+ // Toggle the button state as appropriate
+ bool preview_active = (isPreviewVisible() && mBigPreviewFloater->isFloaterOwner(getParentByType<LLFloater>()));
+ mBtnPreview->setToggleState(preview_active);
+
+ // Display the thumbnail if one is available
if (previewp && previewp->getThumbnailImage())
{
const LLRect& thumbnail_rect = mThumbnailPlaceholder->getRect();
@@ -222,16 +438,9 @@ void LLSocialPhotoPanel::draw()
// calc preview offset within the preview rect
const S32 local_offset_x = (thumbnail_rect.getWidth() - thumbnail_w) / 2 ;
const S32 local_offset_y = (thumbnail_rect.getHeight() - thumbnail_h) / 2 ;
+ S32 offset_x = thumbnail_rect.mLeft + local_offset_x;
+ S32 offset_y = thumbnail_rect.mBottom + local_offset_y;
- // calc preview offset within the floater rect
- // Hack : To get the full offset, we need to take into account each and every offset of each widgets up to the floater.
- // This is almost as arbitrary as using a fixed offset so that's what we do here for the sake of simplicity.
- // *TODO : Get the offset looking through the hierarchy of widgets, should be done in postBuild() so to avoid traversing the hierarchy each time.
- S32 offset_x = thumbnail_rect.mLeft + local_offset_x - 1;
- S32 offset_y = thumbnail_rect.mBottom + local_offset_y - 39;
-
- mSnapshotPanel->localPointToOtherView(offset_x, offset_y, &offset_x, &offset_y, getParentByType<LLFloater>());
-
gGL.matrixMode(LLRender::MM_MODELVIEW);
// Apply floater transparency to the texture unless the floater is focused.
F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency();
@@ -239,8 +448,6 @@ void LLSocialPhotoPanel::draw()
gl_draw_scaled_image(offset_x, offset_y,
thumbnail_w, thumbnail_h,
previewp->getThumbnailImage(), color % alpha);
-
- previewp->drawPreviewRect(offset_x, offset_y) ;
}
// Update the visibility of the working (computing preview) label
@@ -253,15 +460,14 @@ void LLSocialPhotoPanel::draw()
LLPanel::draw();
}
-LLSnapshotLivePreview* LLSocialPhotoPanel::getPreviewView()
+LLSnapshotLivePreview* LLFacebookPhotoPanel::getPreviewView()
{
LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)mPreviewHandle.get();
return previewp;
}
-void LLSocialPhotoPanel::onVisibilityChange(const LLSD& new_visibility)
+void LLFacebookPhotoPanel::onVisibilityChange(BOOL visible)
{
- bool visible = new_visibility.asBoolean();
if (visible)
{
if (mPreviewHandle.get())
@@ -269,7 +475,7 @@ void LLSocialPhotoPanel::onVisibilityChange(const LLSD& new_visibility)
LLSnapshotLivePreview* preview = getPreviewView();
if(preview)
{
- lldebugs << "opened, updating snapshot" << llendl;
+ LL_DEBUGS() << "opened, updating snapshot" << LL_ENDL;
preview->updateSnapshot(TRUE);
}
}
@@ -280,10 +486,15 @@ void LLSocialPhotoPanel::onVisibilityChange(const LLSD& new_visibility)
p.rect(full_screen_rect);
LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p);
mPreviewHandle = previewp->getHandle();
+ mQuality = MAX_QUALITY;
+ previewp->setContainer(this);
previewp->setSnapshotType(previewp->SNAPSHOT_WEB);
previewp->setSnapshotFormat(LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG);
- //previewp->setSnapshotQuality(98);
+ previewp->setSnapshotQuality(mQuality, false);
+ previewp->setThumbnailSubsampled(TRUE); // We want the preview to reflect the *saved* image
+ previewp->setAllowRenderUI(FALSE); // We do not want the rendered UI in our snapshots
+ previewp->setAllowFullScreenPreview(FALSE); // No full screen preview in SL Share mode
previewp->setThumbnailPlaceholderRect(mThumbnailPlaceholder->getRect());
updateControls();
@@ -291,21 +502,48 @@ void LLSocialPhotoPanel::onVisibilityChange(const LLSD& new_visibility)
}
}
-void LLSocialPhotoPanel::onClickNewSnapshot()
+void LLFacebookPhotoPanel::onClickNewSnapshot()
{
LLSnapshotLivePreview* previewp = getPreviewView();
if (previewp)
{
- //setStatus(Impl::STATUS_READY);
- lldebugs << "updating snapshot" << llendl;
previewp->updateSnapshot(TRUE);
}
}
-void LLSocialPhotoPanel::onSend()
+void LLFacebookPhotoPanel::onClickBigPreview()
+{
+ // Toggle the preview
+ if (isPreviewVisible())
+ {
+ LLFloaterReg::hideInstance("big_preview");
+ }
+ else
+ {
+ attachPreview();
+ LLFloaterReg::showInstance("big_preview");
+ }
+}
+
+bool LLFacebookPhotoPanel::isPreviewVisible()
+{
+ return (mBigPreviewFloater && mBigPreviewFloater->getVisible());
+}
+
+void LLFacebookPhotoPanel::attachPreview()
+{
+ if (mBigPreviewFloater)
+ {
+ LLSnapshotLivePreview* previewp = getPreviewView();
+ mBigPreviewFloater->setPreview(previewp);
+ mBigPreviewFloater->setFloaterOwner(getParentByType<LLFloater>());
+ }
+}
+
+void LLFacebookPhotoPanel::onSend()
{
- LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel"); // just in case it is already listening
- LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialPhotoPanel", boost::bind(&LLSocialPhotoPanel::onFacebookConnectStateChange, this, _1));
+ LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookPhotoPanel"); // just in case it is already listening
+ LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookPhotoPanel", boost::bind(&LLFacebookPhotoPanel::onFacebookConnectStateChange, this, _1));
// Connect to Facebook if necessary and then post
if (LLFacebookConnect::instance().isConnected())
@@ -318,7 +556,7 @@ void LLSocialPhotoPanel::onSend()
}
}
-bool LLSocialPhotoPanel::onFacebookConnectStateChange(const LLSD& data)
+bool LLFacebookPhotoPanel::onFacebookConnectStateChange(const LLSD& data)
{
switch (data.get("enum").asInteger())
{
@@ -327,7 +565,7 @@ bool LLSocialPhotoPanel::onFacebookConnectStateChange(const LLSD& data)
break;
case LLFacebookConnect::FB_POSTED:
- LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel");
+ LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookPhotoPanel");
clearAndClose();
break;
}
@@ -335,7 +573,7 @@ bool LLSocialPhotoPanel::onFacebookConnectStateChange(const LLSD& data)
return false;
}
-void LLSocialPhotoPanel::sendPhoto()
+void LLFacebookPhotoPanel::sendPhoto()
{
// Get the caption
std::string caption = mCaptionTextBox->getValue().asString();
@@ -349,7 +587,7 @@ void LLSocialPhotoPanel::sendPhoto()
updateControls();
}
-void LLSocialPhotoPanel::clearAndClose()
+void LLFacebookPhotoPanel::clearAndClose()
{
mCaptionTextBox->setValue("");
@@ -357,39 +595,28 @@ void LLSocialPhotoPanel::clearAndClose()
if (floater)
{
floater->closeFloater();
+ if (mBigPreviewFloater)
+ {
+ mBigPreviewFloater->closeOnFloaterOwnerClosing(floater);
+ }
}
}
-void LLSocialPhotoPanel::updateControls()
+void LLFacebookPhotoPanel::updateControls()
{
LLSnapshotLivePreview* previewp = getPreviewView();
- BOOL got_bytes = previewp && previewp->getDataSize() > 0;
BOOL got_snap = previewp && previewp->getSnapshotUpToDate();
- LLSnapshotLivePreview::ESnapshotType shot_type = (previewp ? previewp->getSnapshotType() : LLSnapshotLivePreview::SNAPSHOT_POSTCARD);
-
+
// *TODO: Separate maximum size for Web images from postcards
- lldebugs << "Is snapshot up-to-date? " << got_snap << llendl;
-
- LLLocale locale(LLLocale::USER_LOCALE);
- std::string bytes_string;
- if (got_snap)
- {
- LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 );
- }
-
- //getChild<LLUICtrl>("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : getString("unknown")); <---uses localized string
- getChild<LLUICtrl>("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : "unknown");
- getChild<LLUICtrl>("file_size_label")->setColor(
- shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD
- && got_bytes
- && previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLUIColor(LLColor4::red) : LLUIColorTable::instance().getColor( "LabelTextColor" ));
-
+ LL_DEBUGS() << "Is snapshot up-to-date? " << got_snap << LL_ENDL;
+
updateResolution(FALSE);
}
-void LLSocialPhotoPanel::updateResolution(BOOL do_update)
+void LLFacebookPhotoPanel::updateResolution(BOOL do_update)
{
LLComboBox* combobox = static_cast<LLComboBox *>(mResolutionComboBox);
+ LLComboBox* filterbox = static_cast<LLComboBox *>(mFilterComboBox);
std::string sdstring = combobox->getSelectedValue();
LLSD sdres;
@@ -399,6 +626,9 @@ void LLSocialPhotoPanel::updateResolution(BOOL do_update)
S32 width = sdres[0];
S32 height = sdres[1];
+ // Note : index 0 of the filter drop down is assumed to be "No filter" in whichever locale
+ std::string filter_name = (filterbox->getCurrentIndex() ? filterbox->getSimple() : "");
+
LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(mPreviewHandle.get());
if (previewp && combobox->getCurrentIndex() >= 0)
{
@@ -408,40 +638,48 @@ void LLSocialPhotoPanel::updateResolution(BOOL do_update)
if (width == 0 || height == 0)
{
// take resolution from current window size
- lldebugs << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << llendl;
+ LL_DEBUGS() << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << LL_ENDL;
previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw());
}
else
{
// use the resolution from the selected pre-canned drop-down choice
- lldebugs << "Setting preview res selected from combo: " << width << "x" << height << llendl;
+ LL_DEBUGS() << "Setting preview res selected from combo: " << width << "x" << height << LL_ENDL;
previewp->setSize(width, height);
}
checkAspectRatio(width);
previewp->getSize(width, height);
+
+ // Recompute quality setting
+ mQuality = compute_jpeg_quality(width, height);
+ previewp->setSnapshotQuality(mQuality, false);
- if(original_width != width || original_height != height)
+ if (original_width != width || original_height != height)
{
previewp->setSize(width, height);
-
- // hide old preview as the aspect ratio could be wrong
- lldebugs << "updating thumbnail" << llendl;
-
- previewp->updateSnapshot(FALSE, TRUE);
- if(do_update)
+ if (do_update)
{
- lldebugs << "Will update controls" << llendl;
+ previewp->updateSnapshot(TRUE);
+ updateControls();
+ }
+ }
+ // Get the old filter, compare to the current one "filter_name" and set if changed
+ std::string original_filter = previewp->getFilter();
+ if (original_filter != filter_name)
+ {
+ previewp->setFilter(filter_name);
+ if (do_update)
+ {
+ previewp->updateSnapshot(FALSE, TRUE);
updateControls();
- LLSocialPhotoPanel::onClickNewSnapshot();
}
}
-
}
}
-void LLSocialPhotoPanel::checkAspectRatio(S32 index)
+void LLFacebookPhotoPanel::checkAspectRatio(S32 index)
{
LLSnapshotLivePreview *previewp = getPreviewView() ;
@@ -462,23 +700,23 @@ void LLSocialPhotoPanel::checkAspectRatio(S32 index)
}
}
-LLUICtrl* LLSocialPhotoPanel::getRefreshBtn()
+LLUICtrl* LLFacebookPhotoPanel::getRefreshBtn()
{
return mRefreshBtn;
}
////////////////////////
-//LLSocialCheckinPanel//
+//LLFacebookCheckinPanel//
////////////////////////
-LLSocialCheckinPanel::LLSocialCheckinPanel() :
+LLFacebookCheckinPanel::LLFacebookCheckinPanel() :
mMapUrl(""),
mReloadingMapTexture(false)
{
- mCommitCallbackRegistrar.add("SocialSharing.SendCheckin", boost::bind(&LLSocialCheckinPanel::onSend, this));
+ mCommitCallbackRegistrar.add("SocialSharing.SendCheckin", boost::bind(&LLFacebookCheckinPanel::onSend, this));
}
-BOOL LLSocialCheckinPanel::postBuild()
+BOOL LLFacebookCheckinPanel::postBuild()
{
// Keep pointers to widgets so we don't traverse the UI hierarchy too often
mPostButton = getChild<LLUICtrl>("post_place_btn");
@@ -492,7 +730,7 @@ BOOL LLSocialCheckinPanel::postBuild()
return LLPanel::postBuild();
}
-void LLSocialCheckinPanel::draw()
+void LLFacebookCheckinPanel::draw()
{
bool no_ongoing_connection = !(LLFacebookConnect::instance().isTransactionOngoing());
mPostButton->setEnabled(no_ongoing_connection);
@@ -533,10 +771,10 @@ void LLSocialCheckinPanel::draw()
LLPanel::draw();
}
-void LLSocialCheckinPanel::onSend()
+void LLFacebookCheckinPanel::onSend()
{
- LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel"); // just in case it is already listening
- LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialCheckinPanel", boost::bind(&LLSocialCheckinPanel::onFacebookConnectStateChange, this, _1));
+ LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookCheckinPanel"); // just in case it is already listening
+ LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookCheckinPanel", boost::bind(&LLFacebookCheckinPanel::onFacebookConnectStateChange, this, _1));
// Connect to Facebook if necessary and then post
if (LLFacebookConnect::instance().isConnected())
@@ -549,7 +787,7 @@ void LLSocialCheckinPanel::onSend()
}
}
-bool LLSocialCheckinPanel::onFacebookConnectStateChange(const LLSD& data)
+bool LLFacebookCheckinPanel::onFacebookConnectStateChange(const LLSD& data)
{
switch (data.get("enum").asInteger())
{
@@ -558,7 +796,7 @@ bool LLSocialCheckinPanel::onFacebookConnectStateChange(const LLSD& data)
break;
case LLFacebookConnect::FB_POSTED:
- LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel");
+ LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookCheckinPanel");
clearAndClose();
break;
}
@@ -566,7 +804,7 @@ bool LLSocialCheckinPanel::onFacebookConnectStateChange(const LLSD& data)
return false;
}
-void LLSocialCheckinPanel::sendCheckin()
+void LLFacebookCheckinPanel::sendCheckin()
{
// Get the location SLURL
LLSLURL slurl;
@@ -584,7 +822,12 @@ void LLSocialCheckinPanel::sendCheckin()
slurl_string += DEFAULT_CHECKIN_QUERY_PARAMETERS;
// Get the region name
- std::string region_name = gAgent.getRegion()->getName();
+ std::string region_name("");
+ LLViewerRegion *regionp = gAgent.getRegion();
+ if (regionp)
+ {
+ region_name = regionp->getName();
+ }
// Get the region description
std::string description;
@@ -601,7 +844,7 @@ void LLSocialCheckinPanel::sendCheckin()
LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, map_url, caption);
}
-void LLSocialCheckinPanel::clearAndClose()
+void LLFacebookCheckinPanel::clearAndClose()
{
mMessageTextEditor->setValue("");
@@ -613,187 +856,205 @@ void LLSocialCheckinPanel::clearAndClose()
}
///////////////////////////
-//LLSocialAccountPanel//////
+//LLFacebookFriendsPanel//////
///////////////////////////
-LLSocialAccountPanel::LLSocialAccountPanel() :
-mAccountCaptionLabel(NULL),
-mAccountNameLabel(NULL),
-mPanelButtons(NULL),
-mConnectButton(NULL),
-mDisconnectButton(NULL)
+LLFacebookFriendsPanel::LLFacebookFriendsPanel() :
+mFriendsStatusCaption(NULL),
+mSecondLifeFriends(NULL),
+mSuggestedFriends(NULL)
{
- mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLSocialAccountPanel::onConnect, this));
- mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLSocialAccountPanel::onDisconnect, this));
-
- setVisibleCallback(boost::bind(&LLSocialAccountPanel::onVisibilityChange, this, _2));
}
-BOOL LLSocialAccountPanel::postBuild()
+LLFacebookFriendsPanel::~LLFacebookFriendsPanel()
{
- mAccountCaptionLabel = getChild<LLTextBox>("account_caption_label");
- mAccountNameLabel = getChild<LLTextBox>("account_name_label");
- mPanelButtons = getChild<LLUICtrl>("panel_buttons");
- mConnectButton = getChild<LLUICtrl>("connect_btn");
- mDisconnectButton = getChild<LLUICtrl>("disconnect_btn");
-
- return LLPanel::postBuild();
+ LLAvatarTracker::instance().removeObserver(this);
}
-void LLSocialAccountPanel::draw()
+BOOL LLFacebookFriendsPanel::postBuild()
{
- LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState();
+ mFriendsStatusCaption = getChild<LLTextBox>("facebook_friends_status");
- //Disable the 'disconnect' button and the 'use another account' button when disconnecting in progress
- bool disconnecting = connection_state == LLFacebookConnect::FB_DISCONNECTING;
- mDisconnectButton->setEnabled(!disconnecting);
-
- //Disable the 'connect' button when a connection is in progress
- bool connecting = connection_state == LLFacebookConnect::FB_CONNECTION_IN_PROGRESS;
- mConnectButton->setEnabled(!connecting);
+ mSecondLifeFriends = getChild<LLAvatarList>("second_life_friends");
+ mSecondLifeFriends->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
+
+ mSuggestedFriends = getChild<LLAvatarList>("suggested_friends");
+ mSuggestedFriends->setContextMenu(&LLPanelPeopleMenus::gSuggestedFriendsContextMenu);
+
+ setVisibleCallback(boost::bind(&LLFacebookFriendsPanel::updateFacebookList, this, _2));
- LLPanel::draw();
+ LLAvatarTracker::instance().addObserver(this);
+
+ return LLPanel::postBuild();
}
-void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility)
+bool LLFacebookFriendsPanel::updateSuggestedFriendList()
{
- bool visible = new_visibility.asBoolean();
-
- if(visible)
+ const LLAvatarTracker& av_tracker = LLAvatarTracker::instance();
+ uuid_vec_t& second_life_friends = mSecondLifeFriends->getIDs();
+ second_life_friends.clear();
+ uuid_vec_t& suggested_friends = mSuggestedFriends->getIDs();
+ suggested_friends.clear();
+
+ //Add suggested friends
+ LLSD friends = LLFacebookConnect::instance().getContent();
+ for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i)
{
- LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialAccountPanel");
- LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialAccountPanel", boost::bind(&LLSocialAccountPanel::onFacebookConnectStateChange, this, _1));
-
- LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLSocialAccountPanel");
- LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLSocialAccountPanel", boost::bind(&LLSocialAccountPanel::onFacebookConnectInfoChange, this));
-
- //Connected
- if(LLFacebookConnect::instance().isConnected())
+ LLUUID agent_id = (*i).asUUID();
+ if (agent_id.notNull())
{
- showConnectedLayout();
- }
- //Check if connected (show disconnected layout in meantime)
- else
- {
- showDisconnectedLayout();
+ bool second_life_buddy = av_tracker.isBuddy(agent_id);
+ if (second_life_buddy)
+ {
+ second_life_friends.push_back(agent_id);
+ }
+ else
+ {
+ //FB+SL but not SL friend
+ suggested_friends.push_back(agent_id);
+ }
}
- if ((LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_NOT_CONNECTED) ||
- (LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_CONNECTION_FAILED))
- {
- LLFacebookConnect::instance().checkConnectionToFacebook();
- }
}
- else
- {
- LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialAccountPanel");
- LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLSocialAccountPanel");
- }
-}
-bool LLSocialAccountPanel::onFacebookConnectStateChange(const LLSD& data)
-{
- if(LLFacebookConnect::instance().isConnected())
- {
- //In process of disconnecting so leave the layout as is
- if(data.get("enum").asInteger() != LLFacebookConnect::FB_DISCONNECTING)
- {
- showConnectedLayout();
- }
- }
- else
- {
- showDisconnectedLayout();
- }
+ //Force a refresh when there aren't any filter matches (prevent displaying content that shouldn't display)
+ mSecondLifeFriends->setDirty(true, !mSecondLifeFriends->filterHasMatches());
+ mSuggestedFriends->setDirty(true, !mSuggestedFriends->filterHasMatches());
+ showFriendsAccordionsIfNeeded();
return false;
}
-bool LLSocialAccountPanel::onFacebookConnectInfoChange()
+void LLFacebookFriendsPanel::showFriendsAccordionsIfNeeded()
{
- LLSD info = LLFacebookConnect::instance().getInfo();
- std::string clickable_name;
-
- //Strings of format [http://www.somewebsite.com Click Me] become clickable text
- if(info.has("link") && info.has("name"))
- {
- clickable_name = "[" + info["link"].asString() + " " + info["name"].asString() + "]";
- }
-
- mAccountNameLabel->setText(clickable_name);
-
- return false;
+ // Show / hide the status text : needs to be done *before* showing / hidding the accordions
+ if (!mSecondLifeFriends->filterHasMatches() && !mSuggestedFriends->filterHasMatches())
+ {
+ // Show some explanation text if the lists are empty...
+ mFriendsStatusCaption->setVisible(true);
+ if (LLFacebookConnect::instance().isConnected())
+ {
+ //...you're connected to FB but have no friends :(
+ mFriendsStatusCaption->setText(getString("facebook_friends_empty"));
+ }
+ else
+ {
+ //...you're not connected to FB
+ mFriendsStatusCaption->setText(getString("facebook_friends_no_connected"));
+ }
+ // Hide the lists
+ getChild<LLAccordionCtrl>("friends_accordion")->setVisible(false);
+ getChild<LLAccordionCtrlTab>("tab_second_life_friends")->setVisible(false);
+ getChild<LLAccordionCtrlTab>("tab_suggested_friends")->setVisible(false);
+ }
+ else
+ {
+ // We have something in the lists, hide the explanatory text
+ mFriendsStatusCaption->setVisible(false);
+
+ // Show the lists
+ LLAccordionCtrl* accordion = getChild<LLAccordionCtrl>("friends_accordion");
+ accordion->setVisible(true);
+
+ // Expand and show accordions if needed, else - hide them
+ getChild<LLAccordionCtrlTab>("tab_second_life_friends")->setVisible(mSecondLifeFriends->filterHasMatches());
+ getChild<LLAccordionCtrlTab>("tab_suggested_friends")->setVisible(mSuggestedFriends->filterHasMatches());
+
+ // Rearrange accordions
+ accordion->arrange();
+ }
}
-void LLSocialAccountPanel::showConnectButton()
+void LLFacebookFriendsPanel::changed(U32 mask)
{
- if(!mConnectButton->getVisible())
+ if (mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE))
{
- mConnectButton->setVisible(TRUE);
- mDisconnectButton->setVisible(FALSE);
+ LLFacebookConnect::instance().loadFacebookFriends();
+ updateFacebookList(true);
}
}
-void LLSocialAccountPanel::hideConnectButton()
+
+void LLFacebookFriendsPanel::updateFacebookList(bool visible)
{
- if(mConnectButton->getVisible())
+ if (visible)
{
- mConnectButton->setVisible(FALSE);
- mDisconnectButton->setVisible(TRUE);
+ // We want this to be called to fetch the friends list once a connection is established
+ LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookFriendsPanel");
+ LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookFriendsPanel", boost::bind(&LLFacebookFriendsPanel::onConnectedToFacebook, this, _1));
+
+ // We then want this to be called to update the displayed lists once the list of friends is received
+ LLEventPumps::instance().obtain("FacebookConnectContent").stopListening("LLFacebookFriendsPanel"); // just in case it is already listening
+ LLEventPumps::instance().obtain("FacebookConnectContent").listen("LLFacebookFriendsPanel", boost::bind(&LLFacebookFriendsPanel::updateSuggestedFriendList, this));
+
+ // Try to connect to Facebook
+ if ((LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_NOT_CONNECTED) ||
+ (LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_CONNECTION_FAILED))
+ {
+ LLFacebookConnect::instance().checkConnectionToFacebook();
+ }
+ // Loads FB friends
+ if (LLFacebookConnect::instance().isConnected())
+ {
+ LLFacebookConnect::instance().loadFacebookFriends();
+ }
+ // Sort the FB friends and update the lists
+ updateSuggestedFriendList();
}
}
-void LLSocialAccountPanel::showDisconnectedLayout()
-{
- mAccountCaptionLabel->setText(getString("facebook_disconnected"));
- mAccountNameLabel->setText(std::string(""));
- showConnectButton();
-}
-
-void LLSocialAccountPanel::showConnectedLayout()
+bool LLFacebookFriendsPanel::onConnectedToFacebook(const LLSD& data)
{
- LLFacebookConnect::instance().loadFacebookInfo();
-
- mAccountCaptionLabel->setText(getString("facebook_connected"));
- hideConnectButton();
-}
+ LLSD::Integer connection_state = data.get("enum").asInteger();
-void LLSocialAccountPanel::onConnect()
-{
- LLFacebookConnect::instance().checkConnectionToFacebook(true);
-
- //Clear only the facebook browser cookies so that the facebook login screen appears
- LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com");
-}
-
-void LLSocialAccountPanel::onDisconnect()
-{
- LLFacebookConnect::instance().disconnectFromFacebook();
+ if (connection_state == LLFacebookConnect::FB_CONNECTED)
+ {
+ LLFacebookConnect::instance().loadFacebookFriends();
+ }
+ else if (connection_state == LLFacebookConnect::FB_NOT_CONNECTED)
+ {
+ updateSuggestedFriendList();
+ }
- LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com");
+ return false;
}
////////////////////////
-//LLFloaterSocial///////
+//LLFloaterFacebook///////
////////////////////////
-LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key),
- mSocialPhotoPanel(NULL),
+LLFloaterFacebook::LLFloaterFacebook(const LLSD& key) : LLFloater(key),
+ mFacebookPhotoPanel(NULL),
mStatusErrorText(NULL),
mStatusLoadingText(NULL),
mStatusLoadingIndicator(NULL)
{
- mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterSocial::onCancel, this));
+ mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterFacebook::onCancel, this));
}
-void LLFloaterSocial::onCancel()
+void LLFloaterFacebook::onClose(bool app_quitting)
{
+ LLFloaterBigPreview* big_preview_floater = dynamic_cast<LLFloaterBigPreview*>(LLFloaterReg::getInstance("big_preview"));
+ if (big_preview_floater)
+ {
+ big_preview_floater->closeOnFloaterOwnerClosing(this);
+ }
+ LLFloater::onClose(app_quitting);
+}
+
+void LLFloaterFacebook::onCancel()
+{
+ LLFloaterBigPreview* big_preview_floater = dynamic_cast<LLFloaterBigPreview*>(LLFloaterReg::getInstance("big_preview"));
+ if (big_preview_floater)
+ {
+ big_preview_floater->closeOnFloaterOwnerClosing(this);
+ }
closeFloater();
}
-BOOL LLFloaterSocial::postBuild()
+BOOL LLFloaterFacebook::postBuild()
{
// Keep tab of the Photo Panel
- mSocialPhotoPanel = static_cast<LLSocialPhotoPanel*>(getChild<LLUICtrl>("panel_social_photo"));
+ mFacebookPhotoPanel = static_cast<LLFacebookPhotoPanel*>(getChild<LLUICtrl>("panel_facebook_photo"));
// Connection status widgets
mStatusErrorText = getChild<LLTextBox>("connection_error_text");
mStatusLoadingText = getChild<LLTextBox>("connection_loading_text");
@@ -801,39 +1062,19 @@ BOOL LLFloaterSocial::postBuild()
return LLFloater::postBuild();
}
-// static
-void LLFloaterSocial::preUpdate()
+void LLFloaterFacebook::showPhotoPanel()
{
- LLFloaterSocial* instance = LLFloaterReg::findTypedInstance<LLFloaterSocial>("social");
- if (instance)
+ LLTabContainer* parent = dynamic_cast<LLTabContainer*>(mFacebookPhotoPanel->getParent());
+ if (!parent)
{
- //Will set file size text to 'unknown'
- instance->mSocialPhotoPanel->updateControls();
+ LL_WARNS() << "Cannot find panel container" << LL_ENDL;
+ return;
}
-}
-
-// static
-void LLFloaterSocial::postUpdate()
-{
- LLFloaterSocial* instance = LLFloaterReg::findTypedInstance<LLFloaterSocial>("social");
- if (instance)
- {
- //Will set the file size text
- instance->mSocialPhotoPanel->updateControls();
- // The refresh button is initially hidden. We show it after the first update,
- // i.e. after snapshot is taken
- LLUICtrl * refresh_button = instance->mSocialPhotoPanel->getRefreshBtn();
-
- if (!refresh_button->getVisible())
- {
- refresh_button->setVisible(true);
- }
-
- }
+ parent->selectTabPanel(mFacebookPhotoPanel);
}
-void LLFloaterSocial::draw()
+void LLFloaterFacebook::draw()
{
if (mStatusErrorText && mStatusLoadingText && mStatusLoadingIndicator)
{
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloaterfacebook.h
index 309f015ce9..a4ca666b20 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloaterfacebook.h
@@ -1,6 +1,6 @@
/**
-* @file llfloatersocial.h
-* @brief Header file for llfloatersocial
+* @file llfloaterfacebook.h
+* @brief Header file for llfloaterfacebook
* @author Gilbert@lindenlab.com
*
* $LicenseInfo:firstyear=2013&license=viewerlgpl$
@@ -24,9 +24,10 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-#ifndef LL_LLFLOATERSOCIAL_H
-#define LL_LLFLOATERSOCIAL_H
+#ifndef LL_LLFLOATERFACEBOOK_H
+#define LL_LLFLOATERFACEBOOK_H
+#include "llcallingcard.h"
#include "llfloater.h"
#include "lltextbox.h"
#include "llviewertexture.h"
@@ -34,38 +35,59 @@
class LLIconCtrl;
class LLCheckBoxCtrl;
class LLSnapshotLivePreview;
+class LLAvatarList;
+class LLFloaterBigPreview;
-class LLSocialStatusPanel : public LLPanel
+class LLFacebookStatusPanel : public LLPanel
{
public:
- LLSocialStatusPanel();
+ LLFacebookStatusPanel();
BOOL postBuild();
void draw();
void onSend();
bool onFacebookConnectStateChange(const LLSD& data);
+ bool onFacebookConnectAccountStateChange(const LLSD& data);
void sendStatus();
void clearAndClose();
private:
+ void onVisibilityChange(BOOL new_visibility);
+ bool onFacebookConnectInfoChange();
+ void onConnect();
+ void onUseAnotherAccount();
+ void onDisconnect();
+
+ void showConnectButton();
+ void hideConnectButton();
+ void showDisconnectedLayout();
+ void showConnectedLayout();
+
+ LLTextBox * mAccountCaptionLabel;
+ LLTextBox * mAccountNameLabel;
+ LLUICtrl * mPanelButtons;
+ LLUICtrl * mConnectButton;
+ LLUICtrl * mDisconnectButton;
LLUICtrl* mMessageTextEditor;
LLUICtrl* mPostButton;
LLUICtrl* mCancelButton;
};
-class LLSocialPhotoPanel : public LLPanel
+class LLFacebookPhotoPanel : public LLPanel
{
public:
- LLSocialPhotoPanel();
- ~LLSocialPhotoPanel();
+ LLFacebookPhotoPanel();
+ ~LLFacebookPhotoPanel();
BOOL postBuild();
void draw();
LLSnapshotLivePreview* getPreviewView();
- void onVisibilityChange(const LLSD& new_visibility);
+ void onVisibilityChange(BOOL new_visibility);
+ void onClickBigPreview();
void onClickNewSnapshot();
void onSend();
+ S32 notify(const LLSD& info);
bool onFacebookConnectStateChange(const LLSD& data);
void sendPhoto();
@@ -77,22 +99,30 @@ public:
LLUICtrl* getRefreshBtn();
private:
+ bool isPreviewVisible();
+ void attachPreview();
+
LLHandle<LLView> mPreviewHandle;
- LLUICtrl * mSnapshotPanel;
LLUICtrl * mResolutionComboBox;
+ LLUICtrl * mFilterComboBox;
LLUICtrl * mRefreshBtn;
LLUICtrl * mWorkingLabel;
LLUICtrl * mThumbnailPlaceholder;
LLUICtrl * mCaptionTextBox;
LLUICtrl * mPostButton;
- LLUICtrl* mCancelButton;
+ LLUICtrl * mCancelButton;
+ LLButton * mBtnPreview;
+
+ LLFloaterBigPreview * mBigPreviewFloater;
+
+ S32 mQuality; // Compression quality
};
-class LLSocialCheckinPanel : public LLPanel
+class LLFacebookCheckinPanel : public LLPanel
{
public:
- LLSocialCheckinPanel();
+ LLFacebookCheckinPanel();
BOOL postBuild();
void draw();
void onSend();
@@ -114,51 +144,42 @@ private:
bool mReloadingMapTexture;
};
-class LLSocialAccountPanel : public LLPanel
+class LLFacebookFriendsPanel : public LLPanel, public LLFriendObserver
{
public:
- LLSocialAccountPanel();
+ LLFacebookFriendsPanel();
+ ~LLFacebookFriendsPanel();
BOOL postBuild();
- void draw();
+ virtual void changed(U32 mask);
private:
- void onVisibilityChange(const LLSD& new_visibility);
- bool onFacebookConnectStateChange(const LLSD& data);
- bool onFacebookConnectInfoChange();
- void onConnect();
- void onUseAnotherAccount();
- void onDisconnect();
-
- void showConnectButton();
- void hideConnectButton();
- void showDisconnectedLayout();
- void showConnectedLayout();
-
- LLTextBox * mAccountCaptionLabel;
- LLTextBox * mAccountNameLabel;
- LLUICtrl * mPanelButtons;
- LLUICtrl * mConnectButton;
- LLUICtrl * mDisconnectButton;
+ bool updateSuggestedFriendList();
+ void showFriendsAccordionsIfNeeded();
+ void updateFacebookList(bool visible);
+ bool onConnectedToFacebook(const LLSD& data);
+
+ LLTextBox * mFriendsStatusCaption;
+ LLAvatarList* mSecondLifeFriends;
+ LLAvatarList* mSuggestedFriends;
};
-
-class LLFloaterSocial : public LLFloater
+class LLFloaterFacebook : public LLFloater
{
public:
- LLFloaterSocial(const LLSD& key);
+ LLFloaterFacebook(const LLSD& key);
BOOL postBuild();
void draw();
+ void onClose(bool app_quitting);
void onCancel();
-
- static void preUpdate();
- static void postUpdate();
+
+ void showPhotoPanel();
private:
- LLSocialPhotoPanel* mSocialPhotoPanel;
+ LLFacebookPhotoPanel* mFacebookPhotoPanel;
LLTextBox* mStatusErrorText;
LLTextBox* mStatusLoadingText;
LLUICtrl* mStatusLoadingIndicator;
};
-#endif // LL_LLFLOATERSOCIAL_H
+#endif // LL_LLFLOATERFACEBOOK_H
diff --git a/indra/newview/llfloaterflickr.cpp b/indra/newview/llfloaterflickr.cpp
new file mode 100644
index 0000000000..36afab86b7
--- /dev/null
+++ b/indra/newview/llfloaterflickr.cpp
@@ -0,0 +1,789 @@
+/**
+* @file llfloaterflickr.cpp
+* @brief Implementation of llfloaterflickr
+* @author cho@lindenlab.com
+*
+* $LicenseInfo:firstyear=2013&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2013, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+* $/LicenseInfo$
+*/
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llfloaterflickr.h"
+
+#include "llagent.h"
+#include "llagentui.h"
+#include "llcheckboxctrl.h"
+#include "llcombobox.h"
+#include "llflickrconnect.h"
+#include "llfloaterreg.h"
+#include "lliconctrl.h"
+#include "llimagefiltersmanager.h"
+#include "llresmgr.h" // LLLocale
+#include "llsdserialize.h"
+#include "llloadingindicator.h"
+#include "llplugincookiestore.h"
+#include "llslurl.h"
+#include "lltrans.h"
+#include "llsnapshotlivepreview.h"
+#include "llfloaterbigpreview.h"
+#include "llviewerregion.h"
+#include "llviewercontrol.h"
+#include "llviewermedia.h"
+#include "lltabcontainer.h"
+#include "llviewerparcelmgr.h"
+#include "llviewerregion.h"
+
+static LLPanelInjector<LLFlickrPhotoPanel> t_panel_photo("llflickrphotopanel");
+static LLPanelInjector<LLFlickrAccountPanel> t_panel_account("llflickraccountpanel");
+
+const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte
+const std::string DEFAULT_PHOTO_QUERY_PARAMETERS = "?sourceid=slshare_photo&utm_source=flickr&utm_medium=photo&utm_campaign=slshare";
+const std::string DEFAULT_TAG_TEXT = "secondlife ";
+const std::string FLICKR_MACHINE_TAGS_NAMESPACE = "secondlife";
+
+///////////////////////////
+//LLFlickrPhotoPanel///////
+///////////////////////////
+
+LLFlickrPhotoPanel::LLFlickrPhotoPanel() :
+mResolutionComboBox(NULL),
+mRefreshBtn(NULL),
+mBtnPreview(NULL),
+mWorkingLabel(NULL),
+mThumbnailPlaceholder(NULL),
+mTitleTextBox(NULL),
+mDescriptionTextBox(NULL),
+mLocationCheckbox(NULL),
+mTagsTextBox(NULL),
+mRatingComboBox(NULL),
+mBigPreviewFloater(NULL),
+mPostButton(NULL)
+{
+ mCommitCallbackRegistrar.add("SocialSharing.SendPhoto", boost::bind(&LLFlickrPhotoPanel::onSend, this));
+ mCommitCallbackRegistrar.add("SocialSharing.RefreshPhoto", boost::bind(&LLFlickrPhotoPanel::onClickNewSnapshot, this));
+ mCommitCallbackRegistrar.add("SocialSharing.BigPreview", boost::bind(&LLFlickrPhotoPanel::onClickBigPreview, this));
+}
+
+LLFlickrPhotoPanel::~LLFlickrPhotoPanel()
+{
+ if(mPreviewHandle.get())
+ {
+ mPreviewHandle.get()->die();
+ }
+}
+
+BOOL LLFlickrPhotoPanel::postBuild()
+{
+ setVisibleCallback(boost::bind(&LLFlickrPhotoPanel::onVisibilityChange, this, _2));
+
+ mResolutionComboBox = getChild<LLUICtrl>("resolution_combobox");
+ mResolutionComboBox->setCommitCallback(boost::bind(&LLFlickrPhotoPanel::updateResolution, this, TRUE));
+ mFilterComboBox = getChild<LLUICtrl>("filters_combobox");
+ mFilterComboBox->setCommitCallback(boost::bind(&LLFlickrPhotoPanel::updateResolution, this, TRUE));
+ mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn");
+ mBtnPreview = getChild<LLButton>("big_preview_btn");
+ mWorkingLabel = getChild<LLUICtrl>("working_lbl");
+ mThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder");
+ mTitleTextBox = getChild<LLUICtrl>("photo_title");
+ mDescriptionTextBox = getChild<LLUICtrl>("photo_description");
+ mLocationCheckbox = getChild<LLUICtrl>("add_location_cb");
+ mTagsTextBox = getChild<LLUICtrl>("photo_tags");
+ mTagsTextBox->setValue(DEFAULT_TAG_TEXT);
+ mRatingComboBox = getChild<LLUICtrl>("rating_combobox");
+ mPostButton = getChild<LLUICtrl>("post_photo_btn");
+ mCancelButton = getChild<LLUICtrl>("cancel_photo_btn");
+ mBigPreviewFloater = dynamic_cast<LLFloaterBigPreview*>(LLFloaterReg::getInstance("big_preview"));
+
+ // Update filter list
+ std::vector<std::string> filter_list = LLImageFiltersManager::getInstance()->getFiltersList();
+ LLComboBox* filterbox = static_cast<LLComboBox *>(mFilterComboBox);
+ for (U32 i = 0; i < filter_list.size(); i++)
+ {
+ filterbox->add(filter_list[i]);
+ }
+
+ return LLPanel::postBuild();
+}
+
+// virtual
+S32 LLFlickrPhotoPanel::notify(const LLSD& info)
+{
+ if (info.has("snapshot-updating"))
+ {
+ // Disable the Post button and whatever else while the snapshot is not updated
+ // updateControls();
+ return 1;
+ }
+
+ if (info.has("snapshot-updated"))
+ {
+ // Enable the send/post/save buttons.
+ updateControls();
+
+ // The refresh button is initially hidden. We show it after the first update,
+ // i.e. after snapshot is taken
+ LLUICtrl * refresh_button = getRefreshBtn();
+ if (!refresh_button->getVisible())
+ {
+ refresh_button->setVisible(true);
+ }
+ return 1;
+ }
+
+ return 0;
+}
+
+void LLFlickrPhotoPanel::draw()
+{
+ LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(mPreviewHandle.get());
+
+ // Enable interaction only if no transaction with the service is on-going (prevent duplicated posts)
+ bool no_ongoing_connection = !(LLFlickrConnect::instance().isTransactionOngoing());
+ mCancelButton->setEnabled(no_ongoing_connection);
+ mTitleTextBox->setEnabled(no_ongoing_connection);
+ mDescriptionTextBox->setEnabled(no_ongoing_connection);
+ mTagsTextBox->setEnabled(no_ongoing_connection);
+ mRatingComboBox->setEnabled(no_ongoing_connection);
+ mResolutionComboBox->setEnabled(no_ongoing_connection);
+ mFilterComboBox->setEnabled(no_ongoing_connection);
+ mRefreshBtn->setEnabled(no_ongoing_connection);
+ mBtnPreview->setEnabled(no_ongoing_connection);
+ mLocationCheckbox->setEnabled(no_ongoing_connection);
+
+ // Reassign the preview floater if we have the focus and the preview exists
+ if (hasFocus() && isPreviewVisible())
+ {
+ attachPreview();
+ }
+
+ // Toggle the button state as appropriate
+ bool preview_active = (isPreviewVisible() && mBigPreviewFloater->isFloaterOwner(getParentByType<LLFloater>()));
+ mBtnPreview->setToggleState(preview_active);
+
+ // Display the preview if one is available
+ if (previewp && previewp->getThumbnailImage())
+ {
+ const LLRect& thumbnail_rect = mThumbnailPlaceholder->getRect();
+ const S32 thumbnail_w = previewp->getThumbnailWidth();
+ const S32 thumbnail_h = previewp->getThumbnailHeight();
+
+ // calc preview offset within the preview rect
+ const S32 local_offset_x = (thumbnail_rect.getWidth() - thumbnail_w) / 2 ;
+ const S32 local_offset_y = (thumbnail_rect.getHeight() - thumbnail_h) / 2 ;
+ S32 offset_x = thumbnail_rect.mLeft + local_offset_x;
+ S32 offset_y = thumbnail_rect.mBottom + local_offset_y;
+
+ gGL.matrixMode(LLRender::MM_MODELVIEW);
+ // Apply floater transparency to the texture unless the floater is focused.
+ F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency();
+ LLColor4 color = LLColor4::white;
+ gl_draw_scaled_image(offset_x, offset_y,
+ thumbnail_w, thumbnail_h,
+ previewp->getThumbnailImage(), color % alpha);
+ }
+
+ // Update the visibility of the working (computing preview) label
+ mWorkingLabel->setVisible(!(previewp && previewp->getSnapshotUpToDate()));
+
+ // Enable Post if we have a preview to send and no on going connection being processed
+ mPostButton->setEnabled(no_ongoing_connection && (previewp && previewp->getSnapshotUpToDate()));
+
+ // Draw the rest of the panel on top of it
+ LLPanel::draw();
+}
+
+LLSnapshotLivePreview* LLFlickrPhotoPanel::getPreviewView()
+{
+ LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)mPreviewHandle.get();
+ return previewp;
+}
+
+void LLFlickrPhotoPanel::onVisibilityChange(BOOL visible)
+{
+ if (visible)
+ {
+ if (mPreviewHandle.get())
+ {
+ LLSnapshotLivePreview* preview = getPreviewView();
+ if(preview)
+ {
+ LL_DEBUGS() << "opened, updating snapshot" << LL_ENDL;
+ preview->updateSnapshot(TRUE);
+ }
+ }
+ else
+ {
+ LLRect full_screen_rect = getRootView()->getRect();
+ LLSnapshotLivePreview::Params p;
+ p.rect(full_screen_rect);
+ LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p);
+ mPreviewHandle = previewp->getHandle();
+
+ previewp->setContainer(this);
+ previewp->setSnapshotType(previewp->SNAPSHOT_WEB);
+ previewp->setSnapshotFormat(LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG);
+ previewp->setThumbnailSubsampled(TRUE); // We want the preview to reflect the *saved* image
+ previewp->setAllowRenderUI(FALSE); // We do not want the rendered UI in our snapshots
+ previewp->setAllowFullScreenPreview(FALSE); // No full screen preview in SL Share mode
+ previewp->setThumbnailPlaceholderRect(mThumbnailPlaceholder->getRect());
+
+ updateControls();
+ }
+ }
+}
+
+void LLFlickrPhotoPanel::onClickNewSnapshot()
+{
+ LLSnapshotLivePreview* previewp = getPreviewView();
+ if (previewp)
+ {
+ previewp->updateSnapshot(TRUE);
+ }
+}
+
+void LLFlickrPhotoPanel::onClickBigPreview()
+{
+ // Toggle the preview
+ if (isPreviewVisible())
+ {
+ LLFloaterReg::hideInstance("big_preview");
+ }
+ else
+ {
+ attachPreview();
+ LLFloaterReg::showInstance("big_preview");
+ }
+}
+
+bool LLFlickrPhotoPanel::isPreviewVisible()
+{
+ return (mBigPreviewFloater && mBigPreviewFloater->getVisible());
+}
+
+void LLFlickrPhotoPanel::attachPreview()
+{
+ if (mBigPreviewFloater)
+ {
+ LLSnapshotLivePreview* previewp = getPreviewView();
+ mBigPreviewFloater->setPreview(previewp);
+ mBigPreviewFloater->setFloaterOwner(getParentByType<LLFloater>());
+ }
+}
+
+void LLFlickrPhotoPanel::onSend()
+{
+ LLEventPumps::instance().obtain("FlickrConnectState").stopListening("LLFlickrPhotoPanel"); // just in case it is already listening
+ LLEventPumps::instance().obtain("FlickrConnectState").listen("LLFlickrPhotoPanel", boost::bind(&LLFlickrPhotoPanel::onFlickrConnectStateChange, this, _1));
+
+ // Connect to Flickr if necessary and then post
+ if (LLFlickrConnect::instance().isConnected())
+ {
+ sendPhoto();
+ }
+ else
+ {
+ LLFlickrConnect::instance().checkConnectionToFlickr(true);
+ }
+}
+
+bool LLFlickrPhotoPanel::onFlickrConnectStateChange(const LLSD& data)
+{
+ switch (data.get("enum").asInteger())
+ {
+ case LLFlickrConnect::FLICKR_CONNECTED:
+ sendPhoto();
+ break;
+
+ case LLFlickrConnect::FLICKR_POSTED:
+ LLEventPumps::instance().obtain("FlickrConnectState").stopListening("LLFlickrPhotoPanel");
+ clearAndClose();
+ break;
+ }
+
+ return false;
+}
+
+void LLFlickrPhotoPanel::sendPhoto()
+{
+ // Get the title, description, and tags
+ std::string title = mTitleTextBox->getValue().asString();
+ std::string description = mDescriptionTextBox->getValue().asString();
+ std::string tags = mTagsTextBox->getValue().asString();
+
+ // Add the location if required
+ bool add_location = mLocationCheckbox->getValue().asBoolean();
+ if (add_location)
+ {
+ // Get the SLURL for the location
+ LLSLURL slurl;
+ LLAgentUI::buildSLURL(slurl);
+ std::string slurl_string = slurl.getSLURLString();
+
+ // Add query parameters so Google Analytics can track incoming clicks!
+ slurl_string += DEFAULT_PHOTO_QUERY_PARAMETERS;
+
+ std::string photo_link_text = "Visit this location";// at [] in Second Life";
+ std::string parcel_name = LLViewerParcelMgr::getInstance()->getAgentParcelName();
+ if (!parcel_name.empty())
+ {
+ photo_link_text += " at " + parcel_name;
+ }
+ photo_link_text += " in Second Life";
+
+ slurl_string = "<a href=\"" + slurl_string + "\">" + photo_link_text + "</a>";
+
+ // Add it to the description (pretty crude, but we don't have a better option with photos)
+ if (description.empty())
+ description = slurl_string;
+ else
+ description = description + "\n\n" + slurl_string;
+
+ // Also add special "machine tags" with location metadata
+ const LLVector3& agent_pos_region = gAgent.getPositionAgent();
+ LLViewerRegion* region = gAgent.getRegion();
+ LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
+ if (region && parcel)
+ {
+ S32 pos_x = S32(agent_pos_region.mV[VX]);
+ S32 pos_y = S32(agent_pos_region.mV[VY]);
+ S32 pos_z = S32(agent_pos_region.mV[VZ]);
+
+ std::string parcel_name = LLViewerParcelMgr::getInstance()->getAgentParcelName();
+ std::string region_name = region->getName();
+
+ if (!region_name.empty())
+ {
+ tags += llformat(" \"%s:region=%s\"", FLICKR_MACHINE_TAGS_NAMESPACE.c_str(), region_name.c_str());
+ }
+ if (!parcel_name.empty())
+ {
+ tags += llformat(" \"%s:parcel=%s\"", FLICKR_MACHINE_TAGS_NAMESPACE.c_str(), parcel_name.c_str());
+ }
+ tags += llformat(" \"%s:x=%d\"", FLICKR_MACHINE_TAGS_NAMESPACE.c_str(), pos_x);
+ tags += llformat(" \"%s:y=%d\"", FLICKR_MACHINE_TAGS_NAMESPACE.c_str(), pos_y);
+ tags += llformat(" \"%s:z=%d\"", FLICKR_MACHINE_TAGS_NAMESPACE.c_str(), pos_z);
+ }
+ }
+
+ // Get the content rating
+ int content_rating = mRatingComboBox->getValue().asInteger();
+
+ // Get the image
+ LLSnapshotLivePreview* previewp = getPreviewView();
+
+ // Post to Flickr
+ LLFlickrConnect::instance().uploadPhoto(previewp->getFormattedImage(), title, description, tags, content_rating);
+
+ updateControls();
+}
+
+void LLFlickrPhotoPanel::clearAndClose()
+{
+ mTitleTextBox->setValue("");
+ mDescriptionTextBox->setValue("");
+
+ LLFloater* floater = getParentByType<LLFloater>();
+ if (floater)
+ {
+ floater->closeFloater();
+ if (mBigPreviewFloater)
+ {
+ mBigPreviewFloater->closeOnFloaterOwnerClosing(floater);
+ }
+ }
+}
+
+void LLFlickrPhotoPanel::updateControls()
+{
+ LLSnapshotLivePreview* previewp = getPreviewView();
+ BOOL got_snap = previewp && previewp->getSnapshotUpToDate();
+
+ // *TODO: Separate maximum size for Web images from postcards
+ LL_DEBUGS() << "Is snapshot up-to-date? " << got_snap << LL_ENDL;
+
+ updateResolution(FALSE);
+}
+
+void LLFlickrPhotoPanel::updateResolution(BOOL do_update)
+{
+ LLComboBox* combobox = static_cast<LLComboBox *>(mResolutionComboBox);
+ LLComboBox* filterbox = static_cast<LLComboBox *>(mFilterComboBox);
+
+ std::string sdstring = combobox->getSelectedValue();
+ LLSD sdres;
+ std::stringstream sstream(sdstring);
+ LLSDSerialize::fromNotation(sdres, sstream, sdstring.size());
+
+ S32 width = sdres[0];
+ S32 height = sdres[1];
+
+ // Note : index 0 of the filter drop down is assumed to be "No filter" in whichever locale
+ std::string filter_name = (filterbox->getCurrentIndex() ? filterbox->getSimple() : "");
+
+ LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(mPreviewHandle.get());
+ if (previewp && combobox->getCurrentIndex() >= 0)
+ {
+ S32 original_width = 0 , original_height = 0 ;
+ previewp->getSize(original_width, original_height) ;
+
+ if (width == 0 || height == 0)
+ {
+ // take resolution from current window size
+ LL_DEBUGS() << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << LL_ENDL;
+ previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw());
+ }
+ else
+ {
+ // use the resolution from the selected pre-canned drop-down choice
+ LL_DEBUGS() << "Setting preview res selected from combo: " << width << "x" << height << LL_ENDL;
+ previewp->setSize(width, height);
+ }
+
+ checkAspectRatio(width);
+
+ previewp->getSize(width, height);
+ if ((original_width != width) || (original_height != height))
+ {
+ previewp->setSize(width, height);
+ if (do_update)
+ {
+ previewp->updateSnapshot(TRUE);
+ updateControls();
+ }
+ }
+ // Get the old filter, compare to the current one "filter_name" and set if changed
+ std::string original_filter = previewp->getFilter();
+ if (original_filter != filter_name)
+ {
+ previewp->setFilter(filter_name);
+ if (do_update)
+ {
+ previewp->updateSnapshot(FALSE, TRUE);
+ updateControls();
+ }
+ }
+ }
+}
+
+void LLFlickrPhotoPanel::checkAspectRatio(S32 index)
+{
+ LLSnapshotLivePreview *previewp = getPreviewView() ;
+
+ BOOL keep_aspect = FALSE;
+
+ if (0 == index) // current window size
+ {
+ keep_aspect = TRUE;
+ }
+ else // predefined resolution
+ {
+ keep_aspect = FALSE;
+ }
+
+ if (previewp)
+ {
+ previewp->mKeepAspectRatio = keep_aspect;
+ }
+}
+
+LLUICtrl* LLFlickrPhotoPanel::getRefreshBtn()
+{
+ return mRefreshBtn;
+}
+
+///////////////////////////
+//LLFlickrAccountPanel//////
+///////////////////////////
+
+LLFlickrAccountPanel::LLFlickrAccountPanel() :
+mAccountCaptionLabel(NULL),
+mAccountNameLabel(NULL),
+mPanelButtons(NULL),
+mConnectButton(NULL),
+mDisconnectButton(NULL)
+{
+ mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLFlickrAccountPanel::onConnect, this));
+ mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLFlickrAccountPanel::onDisconnect, this));
+
+ setVisibleCallback(boost::bind(&LLFlickrAccountPanel::onVisibilityChange, this, _2));
+}
+
+BOOL LLFlickrAccountPanel::postBuild()
+{
+ mAccountCaptionLabel = getChild<LLTextBox>("account_caption_label");
+ mAccountNameLabel = getChild<LLTextBox>("account_name_label");
+ mPanelButtons = getChild<LLUICtrl>("panel_buttons");
+ mConnectButton = getChild<LLUICtrl>("connect_btn");
+ mDisconnectButton = getChild<LLUICtrl>("disconnect_btn");
+
+ return LLPanel::postBuild();
+}
+
+void LLFlickrAccountPanel::draw()
+{
+ LLFlickrConnect::EConnectionState connection_state = LLFlickrConnect::instance().getConnectionState();
+
+ //Disable the 'disconnect' button and the 'use another account' button when disconnecting in progress
+ bool disconnecting = connection_state == LLFlickrConnect::FLICKR_DISCONNECTING;
+ mDisconnectButton->setEnabled(!disconnecting);
+
+ //Disable the 'connect' button when a connection is in progress
+ bool connecting = connection_state == LLFlickrConnect::FLICKR_CONNECTION_IN_PROGRESS;
+ mConnectButton->setEnabled(!connecting);
+
+ LLPanel::draw();
+}
+
+void LLFlickrAccountPanel::onVisibilityChange(BOOL visible)
+{
+ if(visible)
+ {
+ LLEventPumps::instance().obtain("FlickrConnectState").stopListening("LLFlickrAccountPanel");
+ LLEventPumps::instance().obtain("FlickrConnectState").listen("LLFlickrAccountPanel", boost::bind(&LLFlickrAccountPanel::onFlickrConnectStateChange, this, _1));
+
+ LLEventPumps::instance().obtain("FlickrConnectInfo").stopListening("LLFlickrAccountPanel");
+ LLEventPumps::instance().obtain("FlickrConnectInfo").listen("LLFlickrAccountPanel", boost::bind(&LLFlickrAccountPanel::onFlickrConnectInfoChange, this));
+
+ //Connected
+ if(LLFlickrConnect::instance().isConnected())
+ {
+ showConnectedLayout();
+ }
+ //Check if connected (show disconnected layout in meantime)
+ else
+ {
+ showDisconnectedLayout();
+ }
+ if ((LLFlickrConnect::instance().getConnectionState() == LLFlickrConnect::FLICKR_NOT_CONNECTED) ||
+ (LLFlickrConnect::instance().getConnectionState() == LLFlickrConnect::FLICKR_CONNECTION_FAILED))
+ {
+ LLFlickrConnect::instance().checkConnectionToFlickr();
+ }
+ }
+ else
+ {
+ LLEventPumps::instance().obtain("FlickrConnectState").stopListening("LLFlickrAccountPanel");
+ LLEventPumps::instance().obtain("FlickrConnectInfo").stopListening("LLFlickrAccountPanel");
+ }
+}
+
+bool LLFlickrAccountPanel::onFlickrConnectStateChange(const LLSD& data)
+{
+ if(LLFlickrConnect::instance().isConnected())
+ {
+ //In process of disconnecting so leave the layout as is
+ if(data.get("enum").asInteger() != LLFlickrConnect::FLICKR_DISCONNECTING)
+ {
+ showConnectedLayout();
+ }
+ }
+ else
+ {
+ showDisconnectedLayout();
+ }
+
+ return false;
+}
+
+bool LLFlickrAccountPanel::onFlickrConnectInfoChange()
+{
+ LLSD info = LLFlickrConnect::instance().getInfo();
+ std::string clickable_name;
+
+ //Strings of format [http://www.somewebsite.com Click Me] become clickable text
+ if(info.has("link") && info.has("name"))
+ {
+ clickable_name = "[" + info["link"].asString() + " " + info["name"].asString() + "]";
+ }
+
+ mAccountNameLabel->setText(clickable_name);
+
+ return false;
+}
+
+void LLFlickrAccountPanel::showConnectButton()
+{
+ if(!mConnectButton->getVisible())
+ {
+ mConnectButton->setVisible(TRUE);
+ mDisconnectButton->setVisible(FALSE);
+ }
+}
+
+void LLFlickrAccountPanel::hideConnectButton()
+{
+ if(mConnectButton->getVisible())
+ {
+ mConnectButton->setVisible(FALSE);
+ mDisconnectButton->setVisible(TRUE);
+ }
+}
+
+void LLFlickrAccountPanel::showDisconnectedLayout()
+{
+ mAccountCaptionLabel->setText(getString("flickr_disconnected"));
+ mAccountNameLabel->setText(std::string(""));
+ showConnectButton();
+}
+
+void LLFlickrAccountPanel::showConnectedLayout()
+{
+ LLFlickrConnect::instance().loadFlickrInfo();
+
+ mAccountCaptionLabel->setText(getString("flickr_connected"));
+ hideConnectButton();
+}
+
+void LLFlickrAccountPanel::onConnect()
+{
+ LLFlickrConnect::instance().checkConnectionToFlickr(true);
+
+ //Clear only the flickr browser cookies so that the flickr login screen appears
+ LLViewerMedia::getCookieStore()->removeCookiesByDomain(".flickr.com");
+}
+
+void LLFlickrAccountPanel::onDisconnect()
+{
+ LLFlickrConnect::instance().disconnectFromFlickr();
+
+ LLViewerMedia::getCookieStore()->removeCookiesByDomain(".flickr.com");
+}
+
+////////////////////////
+//LLFloaterFlickr///////
+////////////////////////
+
+LLFloaterFlickr::LLFloaterFlickr(const LLSD& key) : LLFloater(key),
+ mFlickrPhotoPanel(NULL),
+ mStatusErrorText(NULL),
+ mStatusLoadingText(NULL),
+ mStatusLoadingIndicator(NULL)
+{
+ mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterFlickr::onCancel, this));
+}
+
+void LLFloaterFlickr::onClose(bool app_quitting)
+{
+ LLFloaterBigPreview* big_preview_floater = dynamic_cast<LLFloaterBigPreview*>(LLFloaterReg::getInstance("big_preview"));
+ if (big_preview_floater)
+ {
+ big_preview_floater->closeOnFloaterOwnerClosing(this);
+ }
+ LLFloater::onClose(app_quitting);
+}
+
+void LLFloaterFlickr::onCancel()
+{
+ LLFloaterBigPreview* big_preview_floater = dynamic_cast<LLFloaterBigPreview*>(LLFloaterReg::getInstance("big_preview"));
+ if (big_preview_floater)
+ {
+ big_preview_floater->closeOnFloaterOwnerClosing(this);
+ }
+ closeFloater();
+}
+
+BOOL LLFloaterFlickr::postBuild()
+{
+ // Keep tab of the Photo Panel
+ mFlickrPhotoPanel = static_cast<LLFlickrPhotoPanel*>(getChild<LLUICtrl>("panel_flickr_photo"));
+ // Connection status widgets
+ mStatusErrorText = getChild<LLTextBox>("connection_error_text");
+ mStatusLoadingText = getChild<LLTextBox>("connection_loading_text");
+ mStatusLoadingIndicator = getChild<LLUICtrl>("connection_loading_indicator");
+ return LLFloater::postBuild();
+}
+
+void LLFloaterFlickr::showPhotoPanel()
+{
+ LLTabContainer* parent = dynamic_cast<LLTabContainer*>(mFlickrPhotoPanel->getParent());
+ if (!parent)
+ {
+ LL_WARNS() << "Cannot find panel container" << LL_ENDL;
+ return;
+ }
+
+ parent->selectTabPanel(mFlickrPhotoPanel);
+}
+
+void LLFloaterFlickr::draw()
+{
+ if (mStatusErrorText && mStatusLoadingText && mStatusLoadingIndicator)
+ {
+ mStatusErrorText->setVisible(false);
+ mStatusLoadingText->setVisible(false);
+ mStatusLoadingIndicator->setVisible(false);
+ LLFlickrConnect::EConnectionState connection_state = LLFlickrConnect::instance().getConnectionState();
+ std::string status_text;
+
+ switch (connection_state)
+ {
+ case LLFlickrConnect::FLICKR_NOT_CONNECTED:
+ // No status displayed when first opening the panel and no connection done
+ case LLFlickrConnect::FLICKR_CONNECTED:
+ // When successfully connected, no message is displayed
+ case LLFlickrConnect::FLICKR_POSTED:
+ // No success message to show since we actually close the floater after successful posting completion
+ break;
+ case LLFlickrConnect::FLICKR_CONNECTION_IN_PROGRESS:
+ // Connection loading indicator
+ mStatusLoadingText->setVisible(true);
+ status_text = LLTrans::getString("SocialFlickrConnecting");
+ mStatusLoadingText->setValue(status_text);
+ mStatusLoadingIndicator->setVisible(true);
+ break;
+ case LLFlickrConnect::FLICKR_POSTING:
+ // Posting indicator
+ mStatusLoadingText->setVisible(true);
+ status_text = LLTrans::getString("SocialFlickrPosting");
+ mStatusLoadingText->setValue(status_text);
+ mStatusLoadingIndicator->setVisible(true);
+ break;
+ case LLFlickrConnect::FLICKR_CONNECTION_FAILED:
+ // Error connecting to the service
+ mStatusErrorText->setVisible(true);
+ status_text = LLTrans::getString("SocialFlickrErrorConnecting");
+ mStatusErrorText->setValue(status_text);
+ break;
+ case LLFlickrConnect::FLICKR_POST_FAILED:
+ // Error posting to the service
+ mStatusErrorText->setVisible(true);
+ status_text = LLTrans::getString("SocialFlickrErrorPosting");
+ mStatusErrorText->setValue(status_text);
+ break;
+ case LLFlickrConnect::FLICKR_DISCONNECTING:
+ // Disconnecting loading indicator
+ mStatusLoadingText->setVisible(true);
+ status_text = LLTrans::getString("SocialFlickrDisconnecting");
+ mStatusLoadingText->setValue(status_text);
+ mStatusLoadingIndicator->setVisible(true);
+ break;
+ case LLFlickrConnect::FLICKR_DISCONNECT_FAILED:
+ // Error disconnecting from the service
+ mStatusErrorText->setVisible(true);
+ status_text = LLTrans::getString("SocialFlickrErrorDisconnecting");
+ mStatusErrorText->setValue(status_text);
+ break;
+ }
+ }
+ LLFloater::draw();
+}
+
diff --git a/indra/newview/llfloaterflickr.h b/indra/newview/llfloaterflickr.h
new file mode 100644
index 0000000000..74da3bcea9
--- /dev/null
+++ b/indra/newview/llfloaterflickr.h
@@ -0,0 +1,134 @@
+/**
+* @file llfloaterflickr.h
+* @brief Header file for llfloaterflickr
+* @author cho@lindenlab.com
+*
+* $LicenseInfo:firstyear=2013&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2013, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+* $/LicenseInfo$
+*/
+#ifndef LL_LLFLOATERFLICKR_H
+#define LL_LLFLOATERFLICKR_H
+
+#include "llfloater.h"
+#include "lltextbox.h"
+#include "llviewertexture.h"
+
+class LLIconCtrl;
+class LLCheckBoxCtrl;
+class LLSnapshotLivePreview;
+class LLFloaterBigPreview;
+
+class LLFlickrPhotoPanel : public LLPanel
+{
+public:
+ LLFlickrPhotoPanel();
+ ~LLFlickrPhotoPanel();
+
+ BOOL postBuild();
+ S32 notify(const LLSD& info);
+ void draw();
+
+ LLSnapshotLivePreview* getPreviewView();
+ void onVisibilityChange(BOOL new_visibility);
+ void onClickNewSnapshot();
+ void onClickBigPreview();
+ void onSend();
+ bool onFlickrConnectStateChange(const LLSD& data);
+
+ void sendPhoto();
+ void clearAndClose();
+
+ void updateControls();
+ void updateResolution(BOOL do_update);
+ void checkAspectRatio(S32 index);
+ LLUICtrl* getRefreshBtn();
+
+private:
+ bool isPreviewVisible();
+ void attachPreview();
+
+ LLHandle<LLView> mPreviewHandle;
+
+ LLUICtrl * mResolutionComboBox;
+ LLUICtrl * mFilterComboBox;
+ LLUICtrl * mRefreshBtn;
+ LLUICtrl * mWorkingLabel;
+ LLUICtrl * mThumbnailPlaceholder;
+ LLUICtrl * mTitleTextBox;
+ LLUICtrl * mDescriptionTextBox;
+ LLUICtrl * mLocationCheckbox;
+ LLUICtrl * mTagsTextBox;
+ LLUICtrl * mRatingComboBox;
+ LLUICtrl * mPostButton;
+ LLUICtrl * mCancelButton;
+ LLButton * mBtnPreview;
+
+ LLFloaterBigPreview * mBigPreviewFloater;
+};
+
+class LLFlickrAccountPanel : public LLPanel
+{
+public:
+ LLFlickrAccountPanel();
+ BOOL postBuild();
+ void draw();
+
+private:
+ void onVisibilityChange(BOOL new_visibility);
+ bool onFlickrConnectStateChange(const LLSD& data);
+ bool onFlickrConnectInfoChange();
+ void onConnect();
+ void onUseAnotherAccount();
+ void onDisconnect();
+
+ void showConnectButton();
+ void hideConnectButton();
+ void showDisconnectedLayout();
+ void showConnectedLayout();
+
+ LLTextBox * mAccountCaptionLabel;
+ LLTextBox * mAccountNameLabel;
+ LLUICtrl * mPanelButtons;
+ LLUICtrl * mConnectButton;
+ LLUICtrl * mDisconnectButton;
+};
+
+
+class LLFloaterFlickr : public LLFloater
+{
+public:
+ LLFloaterFlickr(const LLSD& key);
+ BOOL postBuild();
+ void draw();
+ void onClose(bool app_quitting);
+ void onCancel();
+
+ void showPhotoPanel();
+
+private:
+ LLFlickrPhotoPanel* mFlickrPhotoPanel;
+ LLTextBox* mStatusErrorText;
+ LLTextBox* mStatusLoadingText;
+ LLUICtrl* mStatusLoadingIndicator;
+};
+
+#endif // LL_LLFLOATERFLICKR_H
+
diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp
index 56051ff684..7da65a9a7c 100755
--- a/indra/newview/llfloatergesture.cpp
+++ b/indra/newview/llfloatergesture.cpp
@@ -48,6 +48,7 @@
#include "llviewermenu.h"
#include "llviewerinventory.h"
#include "llviewercontrol.h"
+#include "llfloaterperms.h"
BOOL item_name_precedes( LLInventoryItem* a, LLInventoryItem* b )
{
@@ -74,6 +75,17 @@ public:
void fire(const LLUUID &inv_item)
{
LLPreviewGesture::show(inv_item, LLUUID::null);
+
+ LLInventoryItem* item = gInventory.getItem(inv_item);
+ if (item)
+ {
+ LLPermissions perm = item->getPermissions();
+ perm.setMaskNext(LLFloaterPerms::getNextOwnerPerms("Gestures"));
+ perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Gestures"));
+ perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Gestures"));
+ item->setPermissions(perm);
+ item->updateServer(FALSE);
+ }
}
};
@@ -400,9 +412,9 @@ bool LLFloaterGesture::isActionEnabled(const LLSD& command)
if(!LLClipboard::instance().hasContents())
return false;
- LLDynamicArray<LLUUID> ids;
+ std::vector<LLUUID> ids;
LLClipboard::instance().pasteFromClipboard(ids);
- for(LLDynamicArray<LLUUID>::iterator it = ids.begin(); it != ids.end(); it++)
+ for(std::vector<LLUUID>::iterator it = ids.begin(); it != ids.end(); it++)
{
LLInventoryItem* item = gInventory.getItem(*it);
@@ -449,9 +461,17 @@ void LLFloaterGesture::onClickPlay()
void LLFloaterGesture::onClickNew()
{
LLPointer<LLInventoryCallback> cb = new GestureShowCallback();
- create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
- LLUUID::null, LLTransactionID::tnull, "New Gesture", "", LLAssetType::AT_GESTURE,
- LLInventoryType::IT_GESTURE, NOT_WEARABLE, PERM_MOVE | PERM_TRANSFER, cb);
+ create_inventory_item(gAgent.getID(),
+ gAgent.getSessionID(),
+ LLUUID::null,
+ LLTransactionID::tnull,
+ "New Gesture",
+ "",
+ LLAssetType::AT_GESTURE,
+ LLInventoryType::IT_GESTURE,
+ NOT_WEARABLE,
+ PERM_MOVE | LLFloaterPerms::getNextOwnerPerms("Gestures"),
+ cb);
}
void LLFloaterGesture::onActivateBtnClick()
@@ -514,7 +534,7 @@ void LLFloaterGesture::onCopyPasteAction(const LLSD& command)
}
else if ("paste" == command_name)
{
- LLDynamicArray<LLUUID> ids;
+ std::vector<LLUUID> ids;
LLClipboard::instance().pasteFromClipboard(ids);
if(ids.empty() || !gInventory.isCategoryComplete(mGestureFolderID))
return;
@@ -522,7 +542,7 @@ void LLFloaterGesture::onCopyPasteAction(const LLSD& command)
llassert(gesture_dir);
LLPointer<GestureCopiedCallback> cb = new GestureCopiedCallback(this);
- for(LLDynamicArray<LLUUID>::iterator it = ids.begin(); it != ids.end(); it++)
+ for(std::vector<LLUUID>::iterator it = ids.begin(); it != ids.end(); it++)
{
LLInventoryItem* item = gInventory.getItem(*it);
if(gesture_dir && item && item->getInventoryType() == LLInventoryType::IT_GESTURE)
@@ -617,9 +637,10 @@ void LLFloaterGesture::addToCurrentOutFit()
uuid_vec_t ids;
getSelectedIds(ids);
LLAppearanceMgr* am = LLAppearanceMgr::getInstance();
+ LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy;
for(uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); it++)
{
- am->addCOFItemLink(*it);
+ am->addCOFItemLink(*it, cb);
}
}
diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp
index fe6223fbf5..6966ca5639 100755
--- a/indra/newview/llfloatergodtools.cpp
+++ b/indra/newview/llfloatergodtools.cpp
@@ -796,7 +796,7 @@ void LLPanelRegionTools::onSwapTerrain()
void LLPanelRegionTools::onSelectRegion()
{
- llinfos << "LLPanelRegionTools::onSelectRegion" << llendl;
+ LL_INFOS() << "LLPanelRegionTools::onSelectRegion" << LL_ENDL;
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(gAgent.getPositionGlobal());
if (!regionp)
@@ -1262,8 +1262,8 @@ void LLPanelRequestTools::sendRequest(const std::string& request,
const std::string& parameter,
const LLHost& host)
{
- llinfos << "Sending request '" << request << "', '"
- << parameter << "' to " << host << llendl;
+ LL_INFOS() << "Sending request '" << request << "', '"
+ << parameter << "' to " << host << LL_ENDL;
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("GodlikeMessage");
msg->nextBlockFast(_PREHASH_AgentData);
@@ -1316,7 +1316,7 @@ void terrain_download_done(void** data, S32 status, LLExtStat ext_status)
void test_callback(const LLTSCode status)
{
- llinfos << "Test transfer callback returned!" << llendl;
+ LL_INFOS() << "Test transfer callback returned!" << LL_ENDL;
}
diff --git a/indra/newview/llfloatergotoline.cpp b/indra/newview/llfloatergotoline.cpp
index d66e418926..3b34f03532 100644
--- a/indra/newview/llfloatergotoline.cpp
+++ b/indra/newview/llfloatergotoline.cpp
@@ -30,7 +30,7 @@
#include "llpreviewscript.h"
#include "llfloaterreg.h"
#include "lllineeditor.h"
-#include "llviewertexteditor.h"
+#include "llscripteditor.h"
#include "llviewerwindow.h"
LLFloaterGotoLine* LLFloaterGotoLine::sInstance = NULL;
diff --git a/indra/newview/llfloatergroupbulkban.cpp b/indra/newview/llfloatergroupbulkban.cpp
new file mode 100644
index 0000000000..54a2283b13
--- /dev/null
+++ b/indra/newview/llfloatergroupbulkban.cpp
@@ -0,0 +1,134 @@
+/**
+* @file llfloatergroupbulkban.cpp
+* @brief Floater to ban Residents from a group.
+*
+* $LicenseInfo:firstyear=2013&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2013, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+* $/LicenseInfo$
+*/
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llfloatergroupbulkban.h"
+#include "llpanelgroupbulkban.h"
+#include "lltrans.h"
+#include "lldraghandle.h"
+
+
+class LLFloaterGroupBulkBan::impl
+{
+public:
+ impl(const LLUUID& group_id) : mGroupID(group_id), mBulkBanPanelp(NULL) {}
+ ~impl() {}
+
+ static void closeFloater(void* data);
+
+public:
+ LLUUID mGroupID;
+ LLPanelGroupBulkBan* mBulkBanPanelp;
+
+ static std::map<LLUUID, LLFloaterGroupBulkBan*> sInstances;
+};
+
+//
+// Globals
+//
+std::map<LLUUID, LLFloaterGroupBulkBan*> LLFloaterGroupBulkBan::impl::sInstances;
+
+void LLFloaterGroupBulkBan::impl::closeFloater(void* data)
+{
+ LLFloaterGroupBulkBan* floaterp = (LLFloaterGroupBulkBan*)data;
+ if(floaterp)
+ floaterp->closeFloater();
+}
+
+//-----------------------------------------------------------------------------
+// Implementation
+//-----------------------------------------------------------------------------
+LLFloaterGroupBulkBan::LLFloaterGroupBulkBan(const LLUUID& group_id/*=LLUUID::null*/)
+ : LLFloater(group_id)
+{
+ S32 floater_header_size = getHeaderHeight();
+ LLRect contents;
+
+ mImpl = new impl(group_id);
+ mImpl->mBulkBanPanelp = new LLPanelGroupBulkBan(group_id);
+
+ contents = mImpl->mBulkBanPanelp->getRect();
+ contents.mTop -= floater_header_size;
+
+ setTitle(mImpl->mBulkBanPanelp->getString("GroupBulkBan"));
+ mImpl->mBulkBanPanelp->setCloseCallback(impl::closeFloater, this);
+ mImpl->mBulkBanPanelp->setRect(contents);
+
+ addChild(mImpl->mBulkBanPanelp);
+}
+
+LLFloaterGroupBulkBan::~LLFloaterGroupBulkBan()
+{
+ if(mImpl->mGroupID.notNull())
+ {
+ impl::sInstances.erase(mImpl->mGroupID);
+ }
+
+ delete mImpl->mBulkBanPanelp;
+ delete mImpl;
+}
+
+void LLFloaterGroupBulkBan::showForGroup(const LLUUID& group_id, uuid_vec_t* agent_ids)
+{
+ const LLFloater::Params& floater_params = LLFloater::getDefaultParams();
+ S32 floater_header_size = floater_params.header_height;
+ LLRect contents;
+
+ // Make sure group_id isn't null
+ if (group_id.isNull())
+ {
+ llwarns << "LLFloaterGroupInvite::showForGroup with null group_id!" << llendl;
+ return;
+ }
+
+ // If we don't have a floater for this group, create one.
+ LLFloaterGroupBulkBan* fgb = get_if_there(impl::sInstances,
+ group_id,
+ (LLFloaterGroupBulkBan*)NULL);
+ if (!fgb)
+ {
+ fgb = new LLFloaterGroupBulkBan(group_id);
+ contents = fgb->mImpl->mBulkBanPanelp->getRect();
+ contents.mTop += floater_header_size;
+ fgb->setRect(contents);
+ fgb->getDragHandle()->setRect(contents);
+ fgb->getDragHandle()->setTitle(fgb->mImpl->mBulkBanPanelp->getString("GroupBulkBan"));
+
+ impl::sInstances[group_id] = fgb;
+
+ fgb->mImpl->mBulkBanPanelp->clear();
+ }
+
+ if (agent_ids != NULL)
+ {
+ fgb->mImpl->mBulkBanPanelp->addUsers(*agent_ids);
+ }
+
+ fgb->center();
+ fgb->openFloater();
+ fgb->mImpl->mBulkBanPanelp->update();
+}
diff --git a/indra/newview/llfloatergroupbulkban.h b/indra/newview/llfloatergroupbulkban.h
new file mode 100644
index 0000000000..5b680a1ba4
--- /dev/null
+++ b/indra/newview/llfloatergroupbulkban.h
@@ -0,0 +1,48 @@
+/**
+* @file llfloatergroupbulkban.h
+* @brief This floater is a wrapper for LLPanelGroupBulkBan, which
+* is used to ban Residents from a specific group.
+*
+* $LicenseInfo:firstyear=2013&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2013, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+* $/LicenseInfo$
+*/
+
+#ifndef LL_LLFLOATERGROUPBULKBAN_H
+#define LL_LLFLOATERGROUPBULKBAN_H
+
+#include "llfloater.h"
+#include "lluuid.h"
+
+class LLFloaterGroupBulkBan : public LLFloater
+{
+public:
+ virtual ~LLFloaterGroupBulkBan();
+
+ static void showForGroup(const LLUUID& group_id, uuid_vec_t* agent_ids = NULL);
+
+protected:
+ LLFloaterGroupBulkBan(const LLUUID& group_id = LLUUID::null);
+
+ class impl;
+ impl* mImpl;
+};
+
+#endif // LL_LLFLOATERGROUPBULKBAN_H
diff --git a/indra/newview/llfloatergroupinvite.cpp b/indra/newview/llfloatergroupinvite.cpp
index d0f3289769..7fdba8734a 100755
--- a/indra/newview/llfloatergroupinvite.cpp
+++ b/indra/newview/llfloatergroupinvite.cpp
@@ -117,7 +117,7 @@ void LLFloaterGroupInvite::showForGroup(const LLUUID& group_id, uuid_vec_t *agen
// Make sure group_id isn't null
if (group_id.isNull())
{
- llwarns << "LLFloaterGroupInvite::showForGroup with null group_id!" << llendl;
+ LL_WARNS() << "LLFloaterGroupInvite::showForGroup with null group_id!" << LL_ENDL;
return;
}
diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp
index d84364a68a..dbe7fee108 100755
--- a/indra/newview/llfloatergroups.cpp
+++ b/indra/newview/llfloatergroups.cpp
@@ -171,7 +171,7 @@ void LLPanelGroups::reset()
{
group_list->operateOnAll(LLCtrlListInterface::OP_DELETE);
}
- getChild<LLUICtrl>("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.count()));
+ getChild<LLUICtrl>("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.size()));
getChild<LLUICtrl>("groupcount")->setTextArg("[MAX]", llformat("%d",gMaxAgentGroups));
init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID());
@@ -182,7 +182,7 @@ BOOL LLPanelGroups::postBuild()
{
childSetCommitCallback("group list", onGroupList, this);
- getChild<LLUICtrl>("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.count()));
+ getChild<LLUICtrl>("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.size()));
getChild<LLUICtrl>("groupcount")->setTextArg("[MAX]", llformat("%d",gMaxAgentGroups));
LLScrollListCtrl *list = getChild<LLScrollListCtrl>("group list");
@@ -341,7 +341,7 @@ void LLPanelGroups::onGroupList(LLUICtrl* ctrl, void* userdata)
void init_group_list(LLScrollListCtrl* group_list, const LLUUID& highlight_id, U64 powers_mask)
{
- S32 count = gAgent.mGroups.count();
+ S32 count = gAgent.mGroups.size();
LLUUID id;
if (!group_list) return;
@@ -349,8 +349,8 @@ void init_group_list(LLScrollListCtrl* group_list, const LLUUID& highlight_id, U
for(S32 i = 0; i < count; ++i)
{
- id = gAgent.mGroups.get(i).mID;
- LLGroupData* group_datap = &gAgent.mGroups.get(i);
+ id = gAgent.mGroups.at(i).mID;
+ LLGroupData* group_datap = &gAgent.mGroups.at(i);
if ((powers_mask == GP_ALL_POWERS) || ((group_datap->mPowers & powers_mask) != 0))
{
std::string style = "NORMAL";
diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp
index 792a2a5d25..035eb307c2 100755
--- a/indra/newview/llfloaterhardwaresettings.cpp
+++ b/indra/newview/llfloaterhardwaresettings.cpp
@@ -89,12 +89,11 @@ void LLFloaterHardwareSettings::refresh()
void LLFloaterHardwareSettings::refreshEnabledState()
{
- F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple");
-
- S32 min_tex_mem = LLViewerTextureList::getMinVideoRamSetting();
- S32 max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(false, mem_multiplier);
- getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMinValue(min_tex_mem);
- getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem);
+ F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple");
+ S32Megabytes min_tex_mem = LLViewerTextureList::getMinVideoRamSetting();
+ S32Megabytes max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(false, mem_multiplier);
+ getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMinValue(min_tex_mem.value());
+ getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem.value());
if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") ||
!gGLManager.mHasVertexBufferObject)
diff --git a/indra/newview/llfloaterhelpbrowser.cpp b/indra/newview/llfloaterhelpbrowser.cpp
index 4cb632bd6a..c0bb213540 100755
--- a/indra/newview/llfloaterhelpbrowser.cpp
+++ b/indra/newview/llfloaterhelpbrowser.cpp
@@ -29,6 +29,7 @@
#include "llfloaterhelpbrowser.h"
#include "llfloaterreg.h"
+#include "llhttpconstants.h"
#include "llpluginclassmedia.h"
#include "llmediactrl.h"
#include "llviewerwindow.h"
@@ -37,7 +38,6 @@
#include "llui.h"
#include "llurlhistory.h"
-#include "llmediactrl.h"
#include "llviewermedia.h"
#include "llviewerhelp.h"
@@ -148,7 +148,7 @@ void LLFloaterHelpBrowser::openMedia(const std::string& media_url)
{
// explicitly make the media mime type for this floater since it will
// only ever display one type of content (Web).
- mBrowser->setHomePageUrl(media_url, "text/html");
- mBrowser->navigateTo(media_url, "text/html");
+ mBrowser->setHomePageUrl(media_url, HTTP_CONTENT_TEXT_HTML);
+ mBrowser->navigateTo(media_url, HTTP_CONTENT_TEXT_HTML);
setCurrentURL(media_url);
}
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 566f9bc9cc..ab57e8c170 100755
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -229,7 +229,9 @@ BOOL LLFloaterIMContainer::postBuild()
mStubCollapseBtn = getChild<LLButton>("stub_collapse_btn");
mStubCollapseBtn->setClickedCallback(boost::bind(&LLFloaterIMContainer::onStubCollapseButtonClicked, this));
mSpeakBtn = getChild<LLButton>("speak_btn");
- mSpeakBtn->setClickedCallback(boost::bind(&LLFloaterIMContainer::onSpeakButtonClicked, this));
+
+ mSpeakBtn->setMouseDownCallback(boost::bind(&LLFloaterIMContainer::onSpeakButtonPressed, this));
+ mSpeakBtn->setMouseUpCallback(boost::bind(&LLFloaterIMContainer::onSpeakButtonReleased, this));
childSetAction("add_btn", boost::bind(&LLFloaterIMContainer::onAddButtonClicked, this));
@@ -352,11 +354,18 @@ void LLFloaterIMContainer::onStubCollapseButtonClicked()
collapseMessagesPane(true);
}
-void LLFloaterIMContainer::onSpeakButtonClicked()
+void LLFloaterIMContainer::onSpeakButtonPressed()
+{
+ LLVoiceClient::getInstance()->inputUserControlState(true);
+ updateSpeakBtnState();
+}
+
+void LLFloaterIMContainer::onSpeakButtonReleased()
{
- LLAgent::toggleMicrophone("speak");
+ LLVoiceClient::getInstance()->inputUserControlState(false);
updateSpeakBtnState();
}
+
void LLFloaterIMContainer::onExpandCollapseButtonClicked()
{
if (mConversationsPane->isCollapsed() && mMessagesPane->isCollapsed()
@@ -424,7 +433,7 @@ bool LLFloaterIMContainer::onConversationModelEvent(const LLSD& event)
// For debug only
//std::ostringstream llsd_value;
//llsd_value << LLSDOStreamer<LLSDNotationFormatter>(event) << std::endl;
- //llinfos << "LLFloaterIMContainer::onConversationModelEvent, event = " << llsd_value.str() << llendl;
+ //LL_INFOS() << "LLFloaterIMContainer::onConversationModelEvent, event = " << llsd_value.str() << LL_ENDL;
// end debug
// Note: In conversations, the model is not responsible for creating the view, which is a good thing. This means that
@@ -532,6 +541,7 @@ void LLFloaterIMContainer::draw()
{
LLConversationItemParticipant* participant_model = dynamic_cast<LLConversationItemParticipant*>(*current_participant_model);
participant_model->setModeratorOptionsVisible(isGroupModerator() && participant_model->getUUID() != gAgentID);
+ participant_model->setGroupBanVisible(haveAbilityToBan() && participant_model->getUUID() != gAgentID);
current_participant_model++;
}
@@ -1150,6 +1160,10 @@ void LLFloaterIMContainer::doToParticipants(const std::string& command, uuid_vec
{
toggleAllowTextChat(userID);
}
+ else if ("ban_member" == command)
+ {
+ banSelectedMember(userID);
+ }
}
else if (selectedIDS.size() > 1)
{
@@ -1271,6 +1285,22 @@ bool LLFloaterIMContainer::enableContextMenuItem(const LLSD& userdata)
uuid_vec_t uuids;
getParticipantUUIDs(uuids);
+
+ //If there is group or ad-hoc chat in multiselection, everything needs to be disabled
+ if(uuids.size() > 1)
+ {
+ const std::set<LLFolderViewItem*> selectedItems = mConversationsRoot->getSelectionList();
+ LLConversationItem * conversationItem;
+ for(std::set<LLFolderViewItem*>::const_iterator it = selectedItems.begin(); it != selectedItems.end(); ++it)
+ {
+ conversationItem = static_cast<LLConversationItem *>((*it)->getViewModelItem());
+ if((conversationItem->getType() == LLConversationItem::CONV_SESSION_GROUP) || (conversationItem->getType() == LLConversationItem::CONV_SESSION_AD_HOC))
+ {
+ return false;
+ }
+ }
+ }
+
if ("conversation_log" == item)
{
return gSavedPerAccountSettings.getS32("KeepConversationLogTranscripts") > 0;
@@ -1318,7 +1348,12 @@ bool LLFloaterIMContainer::enableContextMenuItem(const std::string& item, uuid_v
// Extract the single select info
bool is_single_select = (uuids.size() == 1);
const LLUUID& single_id = uuids.front();
-
+
+ if ("can_chat_history" == item && is_single_select)
+ {
+ return LLLogChat::isTranscriptExist(uuids.front(),false);
+ }
+
// Handle options that are applicable to all including the user agent
if ("can_view_profile" == item)
{
@@ -1371,6 +1406,14 @@ bool LLFloaterIMContainer::enableContextMenuItem(const std::string& item, uuid_v
{
return LLAvatarActions::canCall();
}
+ else if ("can_open_voice_conversation" == item)
+ {
+ return is_single_select && LLAvatarActions::canCall();
+ }
+ else if ("can_open_voice_conversation" == item)
+ {
+ return is_single_select && LLAvatarActions::canCall();
+ }
else if ("can_zoom_in" == item)
{
return is_single_select && gObjectList.findObject(single_id);
@@ -1383,6 +1426,10 @@ bool LLFloaterIMContainer::enableContextMenuItem(const std::string& item, uuid_v
{
return LLAvatarActions::canOfferTeleport(uuids);
}
+ else if ("can_ban_member" == item)
+ {
+ return canBanSelectedMember(single_id);
+ }
else if (("can_moderate_voice" == item) || ("can_allow_text_chat" == item) || ("can_mute" == item) || ("can_unmute" == item))
{
// *TODO : get that out of here...
@@ -1607,7 +1654,7 @@ LLConversationItem* LLFloaterIMContainer::addConversationListItem(const LLUUID&
}
if (!item)
{
- llwarns << "Couldn't create conversation session item : " << display_name << llendl;
+ LL_WARNS() << "Couldn't create conversation session item : " << display_name << LL_ENDL;
return NULL;
}
item->renameItem(display_name);
@@ -1789,7 +1836,7 @@ bool LLFloaterIMContainer::isGroupModerator()
LLSpeakerMgr * speaker_manager = getSpeakerMgrForSelectedParticipant();
if (NULL == speaker_manager)
{
- llwarns << "Speaker manager is missing" << llendl;
+ LL_WARNS() << "Speaker manager is missing" << LL_ENDL;
return false;
}
@@ -1805,6 +1852,95 @@ bool LLFloaterIMContainer::isGroupModerator()
return false;
}
+bool LLFloaterIMContainer::haveAbilityToBan()
+{
+ LLSpeakerMgr * speaker_manager = getSpeakerMgrForSelectedParticipant();
+ if (NULL == speaker_manager)
+ {
+ LL_WARNS() << "Speaker manager is missing" << LL_ENDL;
+ return false;
+ }
+ LLUUID group_uuid = speaker_manager->getSessionID();
+
+ return gAgent.isInGroup(group_uuid) && gAgent.hasPowerInGroup(group_uuid, GP_GROUP_BAN_ACCESS);
+}
+
+bool LLFloaterIMContainer::canBanSelectedMember(const LLUUID& participant_uuid)
+{
+ LLSpeakerMgr * speaker_manager = getSpeakerMgrForSelectedParticipant();
+ if (NULL == speaker_manager)
+ {
+ LL_WARNS() << "Speaker manager is missing" << LL_ENDL;
+ return false;
+ }
+ LLUUID group_uuid = speaker_manager->getSessionID();
+ LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(group_uuid);
+ if(!gdatap)
+ {
+ LL_WARNS("Groups") << "Unable to get group data for group " << group_uuid << LL_ENDL;
+ return false;
+ }
+
+ if (!gdatap->mMembers.size())
+ {
+ return false;
+ }
+
+ LLGroupMgrGroupData::member_list_t::iterator mi = gdatap->mMembers.find((participant_uuid));
+ if (mi == gdatap->mMembers.end())
+ {
+ return false;
+ }
+
+ LLGroupMemberData* member_data = (*mi).second;
+ // Is the member an owner?
+ if ( member_data && member_data->isInRole(gdatap->mOwnerRole) )
+ {
+ return false;
+ }
+
+ if( gAgent.hasPowerInGroup(group_uuid, GP_ROLE_REMOVE_MEMBER) &&
+ gAgent.hasPowerInGroup(group_uuid, GP_GROUP_BAN_ACCESS) )
+ {
+ return true;
+ }
+
+ return false;
+}
+
+void LLFloaterIMContainer::banSelectedMember(const LLUUID& participant_uuid)
+{
+ LLSpeakerMgr * speaker_manager = getSpeakerMgrForSelectedParticipant();
+ if (NULL == speaker_manager)
+ {
+ LL_WARNS() << "Speaker manager is missing" << LL_ENDL;
+ return;
+ }
+
+ LLUUID group_uuid = speaker_manager->getSessionID();
+ LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(group_uuid);
+ if(!gdatap)
+ {
+ LL_WARNS("Groups") << "Unable to get group data for group " << group_uuid << LL_ENDL;
+ return;
+ }
+ std::vector<LLUUID> ids;
+ ids.push_back(participant_uuid);
+
+ LLGroupBanData ban_data;
+ gdatap->createBanEntry(participant_uuid, ban_data);
+ LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_POST, group_uuid, LLGroupMgr::BAN_CREATE, ids);
+ LLGroupMgr::getInstance()->sendGroupMemberEjects(group_uuid, ids);
+ LLGroupMgr::getInstance()->sendGroupMembersRequest(group_uuid);
+ LLSD args;
+ std::string name;
+ gCacheName->getFullName(participant_uuid, name);
+ args["AVATAR_NAME"] = name;
+ args["GROUP_NAME"] = gdatap->mName;
+ LLNotifications::instance().add(LLNotification::Params("EjectAvatarFromGroup").substitutions(args));
+
+}
+
void LLFloaterIMContainer::moderateVoice(const std::string& command, const LLUUID& userID)
{
if (!gAgent.getRegion()) return;
@@ -1881,7 +2017,7 @@ LLSpeakerMgr * LLFloaterIMContainer::getSpeakerMgrForSelectedParticipant()
LLFolderViewItem *selectedItem = mConversationsRoot->getCurSelectedItem();
if (NULL == selectedItem)
{
- llwarns << "Current selected item is null" << llendl;
+ LL_WARNS() << "Current selected item is null" << LL_ENDL;
return NULL;
}
@@ -1899,7 +2035,7 @@ LLSpeakerMgr * LLFloaterIMContainer::getSpeakerMgrForSelectedParticipant()
}
if (NULL == conversation_uuidp)
{
- llwarns << "Cannot find conversation item widget" << llendl;
+ LL_WARNS() << "Cannot find conversation item widget" << LL_ENDL;
return NULL;
}
@@ -1911,14 +2047,14 @@ LLSpeaker * LLFloaterIMContainer::getSpeakerOfSelectedParticipant(LLSpeakerMgr *
{
if (NULL == speaker_managerp)
{
- llwarns << "Speaker manager is missing" << llendl;
+ LL_WARNS() << "Speaker manager is missing" << LL_ENDL;
return NULL;
}
const LLConversationItem * participant_itemp = getCurSelectedViewModelItem();
if (NULL == participant_itemp)
{
- llwarns << "Cannot evaluate current selected view model item" << llendl;
+ LL_WARNS() << "Cannot evaluate current selected view model item" << LL_ENDL;
return NULL;
}
@@ -2131,14 +2267,7 @@ BOOL LLFloaterIMContainer::isFrontmost()
// This is intentional so it doesn't confuse the user. onClickCloseBtn() closes the whole floater.
void LLFloaterIMContainer::onClickCloseBtn(bool app_quitting/* = false*/)
{
- // Always unminimize before trying to close.
- // Most of the time the user will never see this state.
- if(isMinimized())
- {
- LLMultiFloater::setMinimized(FALSE);
- }
-
- LLFloater::closeFloater(app_quitting);
+ LLMultiFloater::closeFloater(app_quitting);
}
void LLFloaterIMContainer::closeHostedFloater()
@@ -2148,7 +2277,7 @@ void LLFloaterIMContainer::closeHostedFloater()
void LLFloaterIMContainer::closeAllConversations()
{
- LLDynamicArray<LLUUID> ids;
+ std::vector<LLUUID> ids;
for (conversations_items_map::iterator it_session = mConversationsItems.begin(); it_session != mConversationsItems.end(); it_session++)
{
LLUUID session_id = it_session->first;
@@ -2158,7 +2287,7 @@ void LLFloaterIMContainer::closeAllConversations()
}
}
- for (LLDynamicArray<LLUUID>::const_iterator it = ids.begin(); it != ids.end(); ++it)
+ for (std::vector<LLUUID>::const_iterator it = ids.begin(); it != ids.end(); ++it)
{
LLFloaterIMSession *conversationFloater = LLFloaterIMSession::findInstance(*it);
LLFloater::onClickClose(conversationFloater);
diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h
index f6d973b9b3..f21c0b9947 100755
--- a/indra/newview/llfloaterimcontainer.h
+++ b/indra/newview/llfloaterimcontainer.h
@@ -135,7 +135,8 @@ private:
void onExpandCollapseButtonClicked();
void onStubCollapseButtonClicked();
void processParticipantsStyleUpdate();
- void onSpeakButtonClicked();
+ void onSpeakButtonPressed();
+ void onSpeakButtonReleased();
/*virtual*/ void onClickCloseBtn(bool app_quitting = false);
/*virtual*/ void closeHostedFloater();
@@ -167,12 +168,16 @@ private:
LLSpeaker * getSpeakerOfSelectedParticipant(LLSpeakerMgr * speaker_managerp);
LLSpeakerMgr * getSpeakerMgrForSelectedParticipant();
bool isGroupModerator();
+ bool haveAbilityToBan();
+ bool canBanSelectedMember(const LLUUID& participant_uuid);
+ LLUUID getGroupUIIDForSelectedParticipant();
bool isMuted(const LLUUID& avatar_id);
void moderateVoice(const std::string& command, const LLUUID& userID);
void moderateVoiceAllParticipants(bool unmute);
void moderateVoiceParticipant(const LLUUID& avatar_id, bool unmute);
void toggleAllowTextChat(const LLUUID& participant_uuid);
void toggleMute(const LLUUID& participant_id, U32 flags);
+ void banSelectedMember(const LLUUID& participant_uuid);
void openNearbyChat();
bool isParticipantListExpanded();
diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp
index 323e84751f..7a989806a1 100755
--- a/indra/newview/llfloaterimnearbychat.cpp
+++ b/indra/newview/llfloaterimnearbychat.cpp
@@ -89,7 +89,7 @@ static LLChatTypeTrigger sChatTypeTriggers[] = {
LLFloaterIMNearbyChat::LLFloaterIMNearbyChat(const LLSD& llsd)
-: LLFloaterIMSessionTab(llsd),
+: LLFloaterIMSessionTab(LLSD(LLUUID::null)),
//mOutputMonitor(NULL),
mSpeakerMgr(NULL),
mExpandedHeight(COLLAPSED_HEIGHT + EXPANDED_HEIGHT)
@@ -97,7 +97,6 @@ LLFloaterIMNearbyChat::LLFloaterIMNearbyChat(const LLSD& llsd)
mIsP2PChat = false;
mIsNearbyChat = true;
mSpeakerMgr = LLLocalSpeakerMgr::getInstance();
- mSessionID = LLUUID();
}
//static
@@ -331,7 +330,7 @@ void LLFloaterIMNearbyChat::onChatFontChange(LLFontGL* fontp)
void LLFloaterIMNearbyChat::show()
{
openFloater(getKey());
- }
+}
bool LLFloaterIMNearbyChat::isChatVisible() const
{
@@ -507,10 +506,10 @@ void LLFloaterIMNearbyChat::onChatBoxKeystroke()
mInputEditor->endOfDoc();
}
- //llinfos << "GESTUREDEBUG " << trigger
+ //LL_INFOS() << "GESTUREDEBUG " << trigger
// << " len " << length
// << " outlen " << out_str.getLength()
- // << llendl;
+ // << LL_ENDL;
}
}
@@ -697,22 +696,22 @@ void LLFloaterIMNearbyChat::sendChatFromViewer(const LLWString &wtext, EChatType
{
if (type == CHAT_TYPE_WHISPER)
{
- lldebugs << "You whisper " << utf8_text << llendl;
+ LL_DEBUGS() << "You whisper " << utf8_text << LL_ENDL;
gAgent.sendAnimationRequest(ANIM_AGENT_WHISPER, ANIM_REQUEST_START);
}
else if (type == CHAT_TYPE_NORMAL)
{
- lldebugs << "You say " << utf8_text << llendl;
+ LL_DEBUGS() << "You say " << utf8_text << LL_ENDL;
gAgent.sendAnimationRequest(ANIM_AGENT_TALK, ANIM_REQUEST_START);
}
else if (type == CHAT_TYPE_SHOUT)
{
- lldebugs << "You shout " << utf8_text << llendl;
+ LL_DEBUGS() << "You shout " << utf8_text << LL_ENDL;
gAgent.sendAnimationRequest(ANIM_AGENT_SHOUT, ANIM_REQUEST_START);
}
else
{
- llinfos << "send_chat_from_viewer() - invalid volume" << llendl;
+ LL_INFOS() << "send_chat_from_viewer() - invalid volume" << LL_ENDL;
return;
}
}
@@ -720,7 +719,7 @@ void LLFloaterIMNearbyChat::sendChatFromViewer(const LLWString &wtext, EChatType
{
if (type != CHAT_TYPE_START && type != CHAT_TYPE_STOP)
{
- lldebugs << "Channel chat: " << utf8_text << llendl;
+ LL_DEBUGS() << "Channel chat: " << utf8_text << LL_ENDL;
}
}
@@ -850,7 +849,7 @@ void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32
gAgent.sendReliableMessage();
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_CHAT_COUNT);
+ add(LLStatViewer::CHAT_COUNT, 1);
}
class LLChatCommandHandler : public LLCommandHandler
diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp
index a8f815c389..1f85c5ac1b 100755
--- a/indra/newview/llfloaterimnearbychathandler.cpp
+++ b/indra/newview/llfloaterimnearbychathandler.cpp
@@ -111,7 +111,7 @@ public:
virtual void deleteAllChildren()
{
- LL_DEBUGS("NearbyChat") << "Clearing toast pool" << llendl;
+ LL_DEBUGS("NearbyChat") << "Clearing toast pool" << LL_ENDL;
m_toast_pool.clear();
m_active_toasts.clear();
LLScreenChannelBase::deleteAllChildren();
@@ -122,7 +122,7 @@ protected:
void addToToastPool(LLToast* toast)
{
if (!toast) return;
- LL_DEBUGS("NearbyChat") << "Pooling toast" << llendl;
+ LL_DEBUGS("NearbyChat") << "Pooling toast" << LL_ENDL;
toast->setVisible(FALSE);
toast->stopTimer();
toast->setIsHidden(true);
@@ -189,7 +189,7 @@ void LLFloaterIMNearbyChatScreenChannel::deactivateToast(LLToast* toast)
if (pos != m_active_toasts.end())
{
- LL_DEBUGS("NearbyChat") << "Deactivating toast" << llendl;
+ LL_DEBUGS("NearbyChat") << "Deactivating toast" << LL_ENDL;
m_active_toasts.erase(pos);
}
}
@@ -201,7 +201,7 @@ void LLFloaterIMNearbyChatScreenChannel::createOverflowToast(S32 bottom, F32 tim
void LLFloaterIMNearbyChatScreenChannel::onToastDestroyed(LLToast* toast, bool app_quitting)
{
- LL_DEBUGS("NearbyChat") << "Toast destroyed (app_quitting=" << app_quitting << ")" << llendl;
+ LL_DEBUGS("NearbyChat") << "Toast destroyed (app_quitting=" << app_quitting << ")" << LL_ENDL;
if (app_quitting)
{
@@ -220,7 +220,7 @@ void LLFloaterIMNearbyChatScreenChannel::onToastDestroyed(LLToast* toast, bool a
void LLFloaterIMNearbyChatScreenChannel::onToastFade(LLToast* toast)
{
- LL_DEBUGS("NearbyChat") << "Toast fading" << llendl;
+ LL_DEBUGS("NearbyChat") << "Toast fading" << LL_ENDL;
//fade mean we put toast to toast pool
if(!toast)
@@ -274,7 +274,7 @@ bool LLFloaterIMNearbyChatScreenChannel::createPoolToast()
// If the toast gets somehow prematurely destroyed, deactivate it to prevent crash (STORM-1352).
toast->setOnToastDestroyedCallback(boost::bind(&LLFloaterIMNearbyChatScreenChannel::onToastDestroyed, this, _1, false));
- LL_DEBUGS("NearbyChat") << "Creating and pooling toast" << llendl;
+ LL_DEBUGS("NearbyChat") << "Creating and pooling toast" << LL_ENDL;
m_toast_pool.push_back(toast->getHandle());
return true;
}
@@ -315,7 +315,7 @@ void LLFloaterIMNearbyChatScreenChannel::addChat(LLSD& chat)
if(m_toast_pool.empty())
{
//"pool" is empty - create one more panel
- LL_DEBUGS("NearbyChat") << "Empty pool" << llendl;
+ LL_DEBUGS("NearbyChat") << "Empty pool" << LL_ENDL;
if(!createPoolToast())//created toast will go to pool. so next call will find it
return;
addChat(chat);
@@ -335,7 +335,7 @@ void LLFloaterIMNearbyChatScreenChannel::addChat(LLSD& chat)
//take 1st element from pool, (re)initialize it, put it in active toasts
- LL_DEBUGS("NearbyChat") << "Getting toast from pool" << llendl;
+ LL_DEBUGS("NearbyChat") << "Getting toast from pool" << LL_ENDL;
LLToast* toast = m_toast_pool.back().get();
m_toast_pool.pop_back();
@@ -403,7 +403,7 @@ void LLFloaterIMNearbyChatScreenChannel::arrangeToasts()
LLToast* toast = it->get();
if (!toast)
{
- llwarns << "NULL found in the active chat toasts list!" << llendl;
+ LL_WARNS() << "NULL found in the active chat toasts list!" << LL_ENDL;
continue;
}
diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp
index 84921849d0..9def253ba5 100755
--- a/indra/newview/llfloaterimsession.cpp
+++ b/indra/newview/llfloaterimsession.cpp
@@ -41,6 +41,7 @@
#include "llchicletbar.h"
#include "lldonotdisturbnotificationstorage.h"
#include "llfloaterreg.h"
+#include "llhttpclient.h"
#include "llfloateravatarpicker.h"
#include "llfloaterimcontainer.h" // to replace separate IM Floaters with multifloater container
#include "llinventoryfunctions.h"
@@ -52,6 +53,7 @@
#include "lltrans.h"
#include "llchathistory.h"
#include "llnotifications.h"
+#include "llviewerregion.h"
#include "llviewerwindow.h"
#include "lltransientfloatermgr.h"
#include "llinventorymodel.h"
@@ -102,7 +104,7 @@ LLFloaterIMSession::LLFloaterIMSession(const LLUUID& session_id)
void LLFloaterIMSession::refresh()
{
if (mMeTyping)
- {
+{
// Send an additional Start Typing packet every ME_TYPING_TIMEOUT seconds
if (mMeTypingTimer.getElapsedTimeF32() > ME_TYPING_TIMEOUT && false == mShouldSendTypingState)
{
@@ -114,7 +116,7 @@ void LLFloaterIMSession::refresh()
// Time out if user hasn't typed for a while.
if (mTypingTimeoutTimer.getElapsedTimeF32() > LLAgent::TYPING_TIMEOUT_SECS)
{
- setTyping(false);
+ setTyping(false);
LL_DEBUGS("TypingMsgs") << "Send stop typing due to timeout" << LL_ENDL;
}
}
@@ -158,7 +160,7 @@ void LLFloaterIMSession::onClickCloseBtn(bool)
}
else
{
- llwarns << "Empty session with id: " << (mSessionID.asString()) << llendl;
+ LL_WARNS() << "Empty session with id: " << (mSessionID.asString()) << LL_ENDL;
return;
}
@@ -182,7 +184,7 @@ void LLFloaterIMSession::newIMCallback(const LLSD& data)
}
}
-void LLFloaterIMSession::onVisibilityChange(const LLSD& new_visibility)
+void LLFloaterIMSession::onVisibilityChanged(const LLSD& new_visibility)
{
bool visible = new_visibility.asBoolean();
@@ -260,7 +262,7 @@ void LLFloaterIMSession::sendMsgFromInputEditor()
}
else
{
- llinfos << "Cannot send IM to everyone unless you're a god." << llendl;
+ LL_INFOS() << "Cannot send IM to everyone unless you're a god." << LL_ENDL;
}
}
@@ -714,7 +716,7 @@ void LLFloaterIMSession::setVisible(BOOL visible)
if (visible && isInVisibleChain())
{
sIMFloaterShowedSignal(mSessionID);
-
+ updateMessages();
}
}
@@ -925,8 +927,7 @@ void LLFloaterIMSession::onInputEditorFocusReceived( LLFocusableElement* caller,
// Allow enabling the LLFloaterIMSession input editor only if session can accept text
LLIMModel::LLIMSession* im_session =
LLIMModel::instance().findIMSession(self->mSessionID);
- //TODO: While disabled lllineeditor can receive focus we need to check if it is enabled (EK)
- if( im_session && im_session->mTextIMPossible && self->mInputEditor->getEnabled())
+ if( im_session && im_session->mTextIMPossible && !self->mInputEditor->getReadOnly())
{
//in disconnected state IM input editor should be disabled
self->mInputEditor->setEnabled(!gDisconnected);
@@ -980,7 +981,7 @@ void LLFloaterIMSession::setTyping(bool typing)
if ( mMeTyping )
{
if ( mTypingTimer.getElapsedTimeF32() > 1.f )
- {
+ {
// Still typing, send 'start typing' notification
LLIMModel::instance().sendTypingState(mSessionID, mOtherParticipantUUID, TRUE);
mShouldSendTypingState = false;
@@ -991,7 +992,7 @@ void LLFloaterIMSession::setTyping(bool typing)
{
// Send 'stop typing' notification immediately
LLIMModel::instance().sendTypingState(mSessionID, mOtherParticipantUUID, FALSE);
- mShouldSendTypingState = false;
+ mShouldSendTypingState = false;
}
}
@@ -1179,16 +1180,17 @@ BOOL LLFloaterIMSession::isInviteAllowed() const
class LLSessionInviteResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(LLSessionInviteResponder);
public:
LLSessionInviteResponder(const LLUUID& session_id)
{
mSessionID = session_id;
}
- void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content)
+protected:
+ void httpFailure()
{
- llwarns << "Error inviting all agents to session [status:"
- << statusNum << "]: " << content << llendl;
+ LL_WARNS() << "Error inviting all agents to session " << dumpResponse() << LL_ENDL;
//throw something back to the viewer here?
}
@@ -1207,7 +1209,7 @@ BOOL LLFloaterIMSession::inviteToSession(const uuid_vec_t& ids)
if( isInviteAllowed() && (count > 0) )
{
- llinfos << "LLFloaterIMSession::inviteToSession() - inviting participants" << llendl;
+ LL_INFOS() << "LLFloaterIMSession::inviteToSession() - inviting participants" << LL_ENDL;
std::string url = region->getCapability("ChatSessionRequest");
@@ -1223,9 +1225,9 @@ BOOL LLFloaterIMSession::inviteToSession(const uuid_vec_t& ids)
}
else
{
- llinfos << "LLFloaterIMSession::inviteToSession -"
+ LL_INFOS() << "LLFloaterIMSession::inviteToSession -"
<< " no need to invite agents for "
- << mDialog << llendl;
+ << mDialog << LL_ENDL;
// successful add, because everyone that needed to get added
// was added.
}
diff --git a/indra/newview/llfloaterimsession.h b/indra/newview/llfloaterimsession.h
index 2b9d06e744..0f7164a585 100755..100644
--- a/indra/newview/llfloaterimsession.h
+++ b/indra/newview/llfloaterimsession.h
@@ -107,7 +107,7 @@ public:
// called when docked floater's position has been set by chiclet
void setPositioned(bool b) { mPositioned = b; };
- void onVisibilityChange(const LLSD& new_visibility);
+ void onVisibilityChanged(const LLSD& new_visibility);
bool enableGearMenuItem(const LLSD& userdata);
void GearDoToSelected(const LLSD& userdata);
bool checkGearMenuItem(const LLSD& userdata);
diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp
index 29511f56ff..fbdaca0e6f 100755
--- a/indra/newview/llfloaterimsessiontab.cpp
+++ b/indra/newview/llfloaterimsessiontab.cpp
@@ -47,24 +47,24 @@
const F32 REFRESH_INTERVAL = 1.0f;
LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id)
- : LLTransientDockableFloater(NULL, true, session_id)
- , mIsP2PChat(false)
- , mExpandCollapseBtn(NULL)
- , mTearOffBtn(NULL)
- , mCloseBtn(NULL)
- , mSessionID(session_id.asUUID())
- , mConversationsRoot(NULL)
- , mScroller(NULL)
- , mChatHistory(NULL)
- , mInputEditor(NULL)
- , mInputEditorPad(0)
- , mRefreshTimer(new LLTimer())
- , mIsHostAttached(false)
- , mHasVisibleBeenInitialized(false)
- , mIsParticipantListExpanded(true)
- , mChatLayoutPanel(NULL)
- , mInputPanels(NULL)
- , mChatLayoutPanelHeight(0)
+: LLTransientDockableFloater(NULL, true, session_id),
+ mIsP2PChat(false),
+ mExpandCollapseBtn(NULL),
+ mTearOffBtn(NULL),
+ mCloseBtn(NULL),
+ mSessionID(session_id.asUUID()),
+ mConversationsRoot(NULL),
+ mScroller(NULL),
+ mChatHistory(NULL),
+ mInputEditor(NULL),
+ mInputEditorPad(0),
+ mRefreshTimer(new LLTimer()),
+ mIsHostAttached(false),
+ mHasVisibleBeenInitialized(false),
+ mIsParticipantListExpanded(true),
+ mChatLayoutPanel(NULL),
+ mInputPanels(NULL),
+ mChatLayoutPanelHeight(0)
{
setAutoFocus(FALSE);
mSession = LLIMModel::getInstance()->findIMSession(mSessionID);
diff --git a/indra/newview/llfloaterjoystick.cpp b/indra/newview/llfloaterjoystick.cpp
index d0c22d25f2..b7fff6cae3 100755
--- a/indra/newview/llfloaterjoystick.cpp
+++ b/indra/newview/llfloaterjoystick.cpp
@@ -33,7 +33,7 @@
#include "llerror.h"
#include "llrect.h"
#include "llstring.h"
-#include "llstat.h"
+#include "lltrace.h"
// project includes
#include "lluictrlfactory.h"
@@ -42,6 +42,22 @@
#include "llviewerjoystick.h"
#include "llcheckboxctrl.h"
+static LLTrace::SampleStatHandle<> sJoystickAxis0("Joystick axis 0"),
+ sJoystickAxis1("Joystick axis 1"),
+ sJoystickAxis2("Joystick axis 2"),
+ sJoystickAxis3("Joystick axis 3"),
+ sJoystickAxis4("Joystick axis 4"),
+ sJoystickAxis5("Joystick axis 5");
+static LLTrace::SampleStatHandle<>* sJoystickAxes[6] =
+{
+ &sJoystickAxis0,
+ &sJoystickAxis1,
+ &sJoystickAxis2,
+ &sJoystickAxis3,
+ &sJoystickAxis4,
+ &sJoystickAxis5
+};
+
LLFloaterJoystick::LLFloaterJoystick(const LLSD& data)
: LLFloater(data)
{
@@ -61,7 +77,7 @@ void LLFloaterJoystick::draw()
for (U32 i = 0; i < 6; i++)
{
F32 value = joystick->getJoystickAxis(i);
- mAxisStats[i]->addValue(value * gFrameIntervalSeconds);
+ sample(*sJoystickAxes[i], value * gFrameIntervalSeconds.value());
if (mAxisStatsBar[i])
{
F32 minbar, maxbar;
@@ -69,7 +85,7 @@ void LLFloaterJoystick::draw()
if (llabs(value) > maxbar)
{
F32 range = llabs(value);
- mAxisStatsBar[i]->setRange(-range, range, range * 0.25f, range * 0.5f);
+ mAxisStatsBar[i]->setRange(-range, range);
}
}
}
@@ -85,13 +101,12 @@ BOOL LLFloaterJoystick::postBuild()
for (U32 i = 0; i < 6; i++)
{
std::string stat_name(llformat("Joystick axis %d", i));
- mAxisStats[i] = new LLStat(stat_name, 4);
std::string axisname = llformat("axis%d", i);
mAxisStatsBar[i] = getChild<LLStatBar>(axisname);
if (mAxisStatsBar[i])
{
- mAxisStatsBar[i]->setStat(mAxisStats[i]);
- mAxisStatsBar[i]->setRange(-range, range, range * 0.25f, range * 0.5f);
+ mAxisStatsBar[i]->setStat(stat_name);
+ mAxisStatsBar[i]->setRange(-range, range);
}
}
diff --git a/indra/newview/llfloaterjoystick.h b/indra/newview/llfloaterjoystick.h
index dfdb108ff8..9c3752540d 100755
--- a/indra/newview/llfloaterjoystick.h
+++ b/indra/newview/llfloaterjoystick.h
@@ -84,7 +84,6 @@ private:
LLCheckBoxCtrl *mCheckFlycamEnabled;
// stats view
- LLStat* mAxisStats[6];
LLStatBar* mAxisStatsBar[6];
};
diff --git a/indra/newview/llfloaterlagmeter.cpp b/indra/newview/llfloaterlagmeter.cpp
index 68b1770bb2..f72f2631a1 100755..100644
--- a/indra/newview/llfloaterlagmeter.cpp
+++ b/indra/newview/llfloaterlagmeter.cpp
@@ -75,26 +75,26 @@ BOOL LLFloaterLagMeter::postBuild()
mServerCause = getChild<LLTextBox>("server_lag_cause");
std::string config_string = getString("client_frame_rate_critical_fps", mStringArgs);
- mClientFrameTimeCritical = 1.0f / (float)atof( config_string.c_str() );
+ mClientFrameTimeCritical = F32Seconds(1.0f / (float)atof( config_string.c_str() ));
config_string = getString("client_frame_rate_warning_fps", mStringArgs);
- mClientFrameTimeWarning = 1.0f / (float)atof( config_string.c_str() );
+ mClientFrameTimeWarning = F32Seconds(1.0f / (float)atof( config_string.c_str() ));
config_string = getString("network_packet_loss_critical_pct", mStringArgs);
- mNetworkPacketLossCritical = (float)atof( config_string.c_str() );
+ mNetworkPacketLossCritical = F32Percent((float)atof( config_string.c_str() ));
config_string = getString("network_packet_loss_warning_pct", mStringArgs);
- mNetworkPacketLossWarning = (float)atof( config_string.c_str() );
+ mNetworkPacketLossWarning = F32Percent((float)atof( config_string.c_str() ));
config_string = getString("network_ping_critical_ms", mStringArgs);
- mNetworkPingCritical = (float)atof( config_string.c_str() );
+ mNetworkPingCritical = F32Milliseconds((float)atof( config_string.c_str() ));
config_string = getString("network_ping_warning_ms", mStringArgs);
- mNetworkPingWarning = (float)atof( config_string.c_str() );
+ mNetworkPingWarning = F32Milliseconds((float)atof( config_string.c_str() ));
config_string = getString("server_frame_rate_critical_fps", mStringArgs);
- mServerFrameTimeCritical = 1000.0f / (float)atof( config_string.c_str() );
+ mServerFrameTimeCritical = F32Seconds(1.0f / (float)atof( config_string.c_str() ));
config_string = getString("server_frame_rate_warning_fps", mStringArgs);
- mServerFrameTimeWarning = 1000.0f / (float)atof( config_string.c_str() );
+ mServerFrameTimeWarning = F32Seconds(1.0f / (float)atof( config_string.c_str() ));
config_string = getString("server_single_process_max_time_ms", mStringArgs);
- mServerSingleProcessMaxTime = (float)atof( config_string.c_str() );
+ mServerSingleProcessMaxTime = F32Seconds((float)atof( config_string.c_str() ));
// mShrunk = false;
config_string = getString("max_width_px", mStringArgs);
@@ -141,7 +141,7 @@ void LLFloaterLagMeter::draw()
void LLFloaterLagMeter::determineClient()
{
- F32 client_frame_time = LLViewerStats::getInstance()->mFPSStat.getMeanDuration();
+ F32Milliseconds client_frame_time = LLTrace::get_frame_recording().getPeriodMean(LLStatViewer::FRAME_STACKTIME);
bool find_cause = false;
if (!gFocusMgr.getAppHasFocus())
@@ -179,7 +179,7 @@ void LLFloaterLagMeter::determineClient()
{
mClientCause->setText( getString("client_texture_loading_cause_msg", mStringArgs) );
}
- else if((BYTES_TO_MEGA_BYTES(LLViewerTexture::sBoundTextureMemoryInBytes)) > LLViewerTexture::sMaxBoundTextureMemInMegaBytes)
+ else if(LLViewerTexture::sBoundTextureMemory > LLViewerTexture::sMaxBoundTextureMemory)
{
mClientCause->setText( getString("client_texture_memory_cause_msg", mStringArgs) );
}
@@ -192,8 +192,9 @@ void LLFloaterLagMeter::determineClient()
void LLFloaterLagMeter::determineNetwork()
{
- F32 packet_loss = LLViewerStats::getInstance()->mPacketsLostPercentStat.getMean();
- F32 ping_time = LLViewerStats::getInstance()->mSimPingStat.getMean();
+ LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording();
+ F32Percent packet_loss = frame_recording.getPeriodMean(LLStatViewer::PACKETS_LOST_PERCENT);
+ F32Milliseconds ping_time = frame_recording.getPeriodMean(LLStatViewer::SIM_PING);
bool find_cause_loss = false;
bool find_cause_ping = false;
@@ -201,7 +202,7 @@ void LLFloaterLagMeter::determineNetwork()
// particular if the frame rate is low, because a low frame
// rate is a sure recipe for bad ping times right now until
// the network handlers are de-synched from the rendering.
- F32 client_frame_time_ms = 1000.0f * LLViewerStats::getInstance()->mFPSStat.getMeanDuration();
+ F32Milliseconds client_frame_time = frame_recording.getPeriodMean(LLStatViewer::FRAME_STACKTIME);
if(packet_loss >= mNetworkPacketLossCritical)
{
@@ -212,7 +213,7 @@ void LLFloaterLagMeter::determineNetwork()
else if(ping_time >= mNetworkPingCritical)
{
mNetworkButton->setImageUnselected(LLUI::getUIImage(LAG_CRITICAL_IMAGE_NAME));
- if (client_frame_time_ms < mNetworkPingCritical)
+ if (client_frame_time < mNetworkPingCritical)
{
mNetworkText->setText( getString("network_ping_critical_msg", mStringArgs) );
find_cause_ping = true;
@@ -227,7 +228,7 @@ void LLFloaterLagMeter::determineNetwork()
else if(ping_time >= mNetworkPingWarning)
{
mNetworkButton->setImageUnselected(LLUI::getUIImage(LAG_WARNING_IMAGE_NAME));
- if (client_frame_time_ms < mNetworkPingWarning)
+ if (client_frame_time < mNetworkPingWarning)
{
mNetworkText->setText( getString("network_ping_warning_msg", mStringArgs) );
find_cause_ping = true;
@@ -255,7 +256,7 @@ void LLFloaterLagMeter::determineNetwork()
void LLFloaterLagMeter::determineServer()
{
- F32 sim_frame_time = LLViewerStats::getInstance()->mSimFrameMsec.getCurrent();
+ F32Milliseconds sim_frame_time = LLTrace::get_frame_recording().getLastRecording().getLastValue(LLStatViewer::SIM_FRAME_TIME);
bool find_cause = false;
if(sim_frame_time >= mServerFrameTimeCritical)
@@ -279,23 +280,25 @@ void LLFloaterLagMeter::determineServer()
if(find_cause)
{
- if(LLViewerStats::getInstance()->mSimSimPhysicsMsec.getCurrent() > mServerSingleProcessMaxTime)
+ LLTrace::Recording& last_recording = LLTrace::get_frame_recording().getLastRecording();
+
+ if(last_recording.getLastValue(LLStatViewer::SIM_PHYSICS_TIME) > mServerSingleProcessMaxTime)
{
mServerCause->setText( getString("server_physics_cause_msg", mStringArgs) );
}
- else if(LLViewerStats::getInstance()->mSimScriptMsec.getCurrent() > mServerSingleProcessMaxTime)
+ else if(last_recording.getLastValue(LLStatViewer::SIM_SCRIPTS_TIME) > mServerSingleProcessMaxTime)
{
mServerCause->setText( getString("server_scripts_cause_msg", mStringArgs) );
}
- else if(LLViewerStats::getInstance()->mSimNetMsec.getCurrent() > mServerSingleProcessMaxTime)
+ else if(last_recording.getLastValue(LLStatViewer::SIM_NET_TIME) > mServerSingleProcessMaxTime)
{
mServerCause->setText( getString("server_net_cause_msg", mStringArgs) );
}
- else if(LLViewerStats::getInstance()->mSimAgentMsec.getCurrent() > mServerSingleProcessMaxTime)
+ else if(last_recording.getLastValue(LLStatViewer::SIM_AGENTS_TIME) > mServerSingleProcessMaxTime)
{
mServerCause->setText( getString("server_agent_cause_msg", mStringArgs) );
}
- else if(LLViewerStats::getInstance()->mSimImagesMsec.getCurrent() > mServerSingleProcessMaxTime)
+ else if(last_recording.getLastValue(LLStatViewer::SIM_IMAGES_TIME) > mServerSingleProcessMaxTime)
{
mServerCause->setText( getString("server_images_cause_msg", mStringArgs) );
}
diff --git a/indra/newview/llfloaterlagmeter.h b/indra/newview/llfloaterlagmeter.h
index eef6955601..929ea40629 100755..100644
--- a/indra/newview/llfloaterlagmeter.h
+++ b/indra/newview/llfloaterlagmeter.h
@@ -53,26 +53,26 @@ private:
bool mShrunk;
S32 mMaxWidth, mMinWidth;
- F32 mClientFrameTimeCritical;
- F32 mClientFrameTimeWarning;
- LLButton * mClientButton;
- LLTextBox * mClientText;
- LLTextBox * mClientCause;
+ F32Milliseconds mClientFrameTimeCritical;
+ F32Milliseconds mClientFrameTimeWarning;
+ LLButton* mClientButton;
+ LLTextBox* mClientText;
+ LLTextBox* mClientCause;
- F32 mNetworkPacketLossCritical;
- F32 mNetworkPacketLossWarning;
- F32 mNetworkPingCritical;
- F32 mNetworkPingWarning;
- LLButton * mNetworkButton;
- LLTextBox * mNetworkText;
- LLTextBox * mNetworkCause;
+ F32Percent mNetworkPacketLossCritical;
+ F32Percent mNetworkPacketLossWarning;
+ F32Milliseconds mNetworkPingCritical;
+ F32Milliseconds mNetworkPingWarning;
+ LLButton* mNetworkButton;
+ LLTextBox* mNetworkText;
+ LLTextBox* mNetworkCause;
- F32 mServerFrameTimeCritical;
- F32 mServerFrameTimeWarning;
- F32 mServerSingleProcessMaxTime;
- LLButton * mServerButton;
- LLTextBox * mServerText;
- LLTextBox * mServerCause;
+ F32Milliseconds mServerFrameTimeCritical;
+ F32Milliseconds mServerFrameTimeWarning;
+ F32Milliseconds mServerSingleProcessMaxTime;
+ LLButton* mServerButton;
+ LLTextBox* mServerText;
+ LLTextBox* mServerCause;
LLStringUtil::format_map_t mStringArgs;
};
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index b16ef6dd79..7621c35ed2 100755
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -225,7 +225,7 @@ void LLFloaterLand::onOpen(const LLSD& key)
refresh();
}
-void LLFloaterLand::onVisibilityChange(const LLSD& visible)
+void LLFloaterLand::onVisibilityChanged(const LLSD& visible)
{
if (!visible.asBoolean())
{
@@ -255,7 +255,7 @@ LLFloaterLand::LLFloaterLand(const LLSD& seed)
BOOL LLFloaterLand::postBuild()
{
- setVisibleCallback(boost::bind(&LLFloaterLand::onVisibilityChange, this, _2));
+ setVisibleCallback(boost::bind(&LLFloaterLand::onVisibilityChanged, this, _2));
LLTabContainer* tab = getChild<LLTabContainer>("landtab");
@@ -936,7 +936,7 @@ void LLPanelLandGeneral::onClickRelease(void*)
// static
void LLPanelLandGeneral::onClickReclaim(void*)
{
- lldebugs << "LLPanelLandGeneral::onClickReclaim()" << llendl;
+ LL_DEBUGS() << "LLPanelLandGeneral::onClickReclaim()" << LL_ENDL;
LLViewerParcelMgr::getInstance()->reclaimParcel();
}
@@ -1517,6 +1517,8 @@ void LLPanelLandObjects::onClickRefresh(void* userdata)
LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
if (!region) return;
+ self->mBtnRefresh->setEnabled(false);
+
// ready the list for results
self->mOwnerList->deleteAllItems();
self->mOwnerList->setCommentText(LLTrans::getString("Searching"));
@@ -1541,8 +1543,8 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo
if (!self)
{
- llwarns << "Received message for nonexistent LLPanelLandObject"
- << llendl;
+ LL_WARNS() << "Received message for nonexistent LLPanelLandObject"
+ << LL_ENDL;
return;
}
@@ -1576,6 +1578,7 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo
{
msg->getU32("DataExtended", "TimeStamp", most_recent_time, i);
}
+
if (owner_id.isNull())
{
continue;
@@ -1611,10 +1614,10 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo
item_params.columns.add().value(LLDate((time_t)most_recent_time)).font(FONT).column("mostrecent").type("date");
self->mOwnerList->addNameItemRow(item_params);
-
- lldebugs << "object owner " << owner_id << " (" << (is_group_owned ? "group" : "agent")
- << ") owns " << object_count << " objects." << llendl;
+ LL_DEBUGS() << "object owner " << owner_id << " (" << (is_group_owned ? "group" : "agent")
+ << ") owns " << object_count << " objects." << LL_ENDL;
}
+
// check for no results
if (0 == self->mOwnerList->getItemCount())
{
@@ -1624,6 +1627,8 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo
{
self->mOwnerList->setEnabled(TRUE);
}
+
+ self->mBtnRefresh->setEnabled(true);
}
// static
@@ -1797,11 +1802,11 @@ void LLPanelLandObjects::onCommitClean(LLUICtrl *caller, void* user_data)
{
lop->mOtherTime = return_time;
- parcel->setCleanOtherTime(lop->mOtherTime);
- send_other_clean_time_message(parcel->getLocalID(), lop->mOtherTime);
- }
+ parcel->setCleanOtherTime(lop->mOtherTime);
+ send_other_clean_time_message(parcel->getLocalID(), lop->mOtherTime);
}
}
+}
//---------------------------------------------------------------------------
@@ -1899,7 +1904,7 @@ BOOL LLPanelLandOptions::postBuild()
}
else
{
- llwarns << "LLUICtrlFactory::getTexturePickerByName() returned NULL for 'snapshot_ctrl'" << llendl;
+ LL_WARNS() << "LLUICtrlFactory::getTexturePickerByName() returned NULL for 'snapshot_ctrl'" << LL_ENDL;
}
@@ -2336,7 +2341,7 @@ BOOL LLPanelLandAccess::postBuild()
childSetCommitCallback("public_access", onCommitPublicAccess, this);
childSetCommitCallback("limit_payment", onCommitAny, this);
childSetCommitCallback("limit_age_verified", onCommitAny, this);
- childSetCommitCallback("GroupCheck", onCommitAny, this);
+ childSetCommitCallback("GroupCheck", onCommitGroupCheck, this);
childSetCommitCallback("PassCheck", onCommitAny, this);
childSetCommitCallback("pass_combo", onCommitAny, this);
childSetCommitCallback("PriceSpin", onCommitAny, this);
@@ -2501,11 +2506,11 @@ void LLPanelLandAccess::refresh()
}
BOOL use_pass = parcel->getParcelFlag(PF_USE_PASS_LIST);
- getChild<LLUICtrl>("PassCheck")->setValue(use_pass );
+ getChild<LLUICtrl>("PassCheck")->setValue(use_pass);
LLCtrlSelectionInterface* passcombo = childGetSelectionInterface("pass_combo");
if (passcombo)
{
- if (public_access || !use_pass || !use_group)
+ if (public_access || !use_pass)
{
passcombo->selectByValue("anyone");
}
@@ -2598,12 +2603,11 @@ void LLPanelLandAccess::refresh_ui()
getChildView("limit_age_verified")->setEnabled(FALSE);
- BOOL group_access = getChild<LLUICtrl>("GroupCheck")->getValue().asBoolean();
BOOL sell_passes = getChild<LLUICtrl>("PassCheck")->getValue().asBoolean();
getChildView("PassCheck")->setEnabled(can_manage_allowed);
if (sell_passes)
{
- getChildView("pass_combo")->setEnabled(group_access && can_manage_allowed);
+ getChildView("pass_combo")->setEnabled(can_manage_allowed);
getChildView("PriceSpin")->setEnabled(can_manage_allowed);
getChildView("HoursSpin")->setEnabled(can_manage_allowed);
}
@@ -2662,6 +2666,32 @@ void LLPanelLandAccess::onCommitPublicAccess(LLUICtrl *ctrl, void *userdata)
onCommitAny(ctrl, userdata);
}
+void LLPanelLandAccess::onCommitGroupCheck(LLUICtrl *ctrl, void *userdata)
+{
+ LLPanelLandAccess *self = (LLPanelLandAccess *)userdata;
+ LLParcel* parcel = self->mParcel->getParcel();
+ if (!parcel)
+ {
+ return;
+ }
+
+ BOOL use_pass_list = !self->getChild<LLUICtrl>("public_access")->getValue().asBoolean();
+ BOOL use_access_group = self->getChild<LLUICtrl>("GroupCheck")->getValue().asBoolean();
+ LLCtrlSelectionInterface* passcombo = self->childGetSelectionInterface("pass_combo");
+ if (passcombo)
+ {
+ if (use_access_group && use_pass_list)
+ {
+ if (passcombo->getSelectedValue().asString() == "group")
+ {
+ passcombo->selectByValue("anyone");
+ }
+ }
+ }
+
+ onCommitAny(ctrl, userdata);
+}
+
// static
void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata)
{
@@ -2699,14 +2729,14 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata)
{
use_access_list = TRUE;
use_pass_list = self->getChild<LLUICtrl>("PassCheck")->getValue().asBoolean();
- if (use_access_group && use_pass_list)
+ LLCtrlSelectionInterface* passcombo = self->childGetSelectionInterface("pass_combo");
+ if (passcombo)
{
- LLCtrlSelectionInterface* passcombo = self->childGetSelectionInterface("pass_combo");
- if (passcombo)
+ if (use_access_group && use_pass_list)
{
if (passcombo->getSelectedValue().asString() == "group")
{
- use_access_list = FALSE;
+ use_access_group = FALSE;
}
}
}
@@ -2751,10 +2781,16 @@ void LLPanelLandAccess::callbackAvatarCBAccess(const uuid_vec_t& ids)
{
LLUUID id = ids[0];
LLParcel* parcel = mParcel->getParcel();
- if (parcel)
+ if (parcel && parcel->addToAccessList(id, 0))
{
- parcel->addToAccessList(id, 0);
- LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(AL_ACCESS);
+ U32 lists_to_update = AL_ACCESS;
+ // agent was successfully added to access list
+ // but we also need to check ban list to ensure that agent will not be in two lists simultaneously
+ if(parcel->removeFromBanList(id))
+ {
+ lists_to_update |= AL_BAN;
+ }
+ LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(lists_to_update);
refresh();
}
}
@@ -2803,10 +2839,16 @@ void LLPanelLandAccess::callbackAvatarCBBanned(const uuid_vec_t& ids)
{
LLUUID id = ids[0];
LLParcel* parcel = mParcel->getParcel();
- if (parcel)
+ if (parcel && parcel->addToBanList(id, 0))
{
- parcel->addToBanList(id, 0);
- LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(AL_BAN);
+ U32 lists_to_update = AL_BAN;
+ // agent was successfully added to ban list
+ // but we also need to check access list to ensure that agent will not be in two lists simultaneously
+ if (parcel->removeFromAccessList(id))
+ {
+ lists_to_update |= AL_ACCESS;
+ }
+ LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(lists_to_update);
refresh();
}
}
diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h
index 4f1c10274a..1d9bd33720 100755
--- a/indra/newview/llfloaterland.h
+++ b/indra/newview/llfloaterland.h
@@ -88,7 +88,7 @@ private:
LLFloaterLand(const LLSD& seed);
virtual ~LLFloaterLand();
- void onVisibilityChange(const LLSD& visible);
+ void onVisibilityChanged(const LLSD& visible);
protected:
@@ -366,6 +366,7 @@ public:
static void onCommitPublicAccess(LLUICtrl* ctrl, void *userdata);
static void onCommitAny(LLUICtrl* ctrl, void *userdata);
+ static void onCommitGroupCheck(LLUICtrl* ctrl, void *userdata);
static void onClickRemoveAccess(void*);
static void onClickRemoveBanned(void*);
diff --git a/indra/newview/llfloaterlandholdings.cpp b/indra/newview/llfloaterlandholdings.cpp
index 98e9b74278..cf03087afb 100755
--- a/indra/newview/llfloaterlandholdings.cpp
+++ b/indra/newview/llfloaterlandholdings.cpp
@@ -72,19 +72,19 @@ BOOL LLFloaterLandHoldings::postBuild()
grant_list->sortByColumnIndex(0, TRUE);
grant_list->setDoubleClickCallback(onGrantList, this);
- S32 count = gAgent.mGroups.count();
+ S32 count = gAgent.mGroups.size();
for(S32 i = 0; i < count; ++i)
{
- LLUUID id(gAgent.mGroups.get(i).mID);
+ LLUUID id(gAgent.mGroups.at(i).mID);
LLSD element;
element["id"] = id;
element["columns"][0]["column"] = "group";
- element["columns"][0]["value"] = gAgent.mGroups.get(i).mName;
+ element["columns"][0]["value"] = gAgent.mGroups.at(i).mName;
element["columns"][0]["font"] = "SANSSERIF";
LLUIString areastr = getString("area_string");
- areastr.setArg("[AREA]", llformat("%d", gAgent.mGroups.get(i).mContribution));
+ areastr.setArg("[AREA]", llformat("%d", gAgent.mGroups.at(i).mContribution));
element["columns"][1]["column"] = "area";
element["columns"][1]["value"] = areastr;
element["columns"][1]["font"] = "SANSSERIF";
@@ -194,7 +194,7 @@ void LLFloaterLandHoldings::processPlacesReply(LLMessageSystem* msg, void**)
if ( msg->getSizeFast(_PREHASH_QueryData, i, _PREHASH_ProductSKU) > 0 )
{
msg->getStringFast( _PREHASH_QueryData, _PREHASH_ProductSKU, land_sku, i);
- llinfos << "Land sku: " << land_sku << llendl;
+ LL_INFOS() << "Land sku: " << land_sku << LL_ENDL;
land_type = LLProductInfoRequestManager::instance().getDescriptionForSku(land_sku);
}
else
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 855836af7a..b17ce97a2e 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -113,8 +113,6 @@
#include "llviewernetwork.h"
#include "llviewershadermgr.h"
#include "glod/glod.h"
-#include <boost/algorithm/string.hpp>
-
const S32 SLM_SUPPORTED_VERSION = 3;
@@ -295,13 +293,13 @@ bool validate_face(const LLVolumeFace& face)
{
if(face.mPositions && !face.mPositions[v].isFinite3())
{
- llwarns << "NaN position data in face found!" << llendl;
+ LL_WARNS() << "NaN position data in face found!" << LL_ENDL;
return false;
}
if(face.mNormals && !face.mNormals[v].isFinite3())
{
- llwarns << "NaN normal data in face found!" << llendl;
+ LL_WARNS() << "NaN normal data in face found!" << LL_ENDL;
return false;
}
}
@@ -310,14 +308,14 @@ bool validate_face(const LLVolumeFace& face)
{
if (face.mIndices[i] >= face.mNumVertices)
{
- llwarns << "Face has invalid index." << llendl;
+ LL_WARNS() << "Face has invalid index." << LL_ENDL;
return false;
}
}
if (face.mNumIndices % 3 != 0 || face.mNumIndices == 0)
{
- llwarns << "Face has invalid number of indices." << llendl;
+ LL_WARNS() << "Face has invalid number of indices." << LL_ENDL;
return false;
}
@@ -337,7 +335,7 @@ bool validate_face(const LLVolumeFace& face)
if (ll_is_degenerate(v1,v2,v3))
{
- llwarns << "Degenerate face found!" << llendl;
+ LL_WARNS() << "Degenerate face found!" << LL_ENDL;
return false;
}
}*/
@@ -348,7 +346,7 @@ bool validate_model(const LLModel* mdl)
{
if (mdl->getNumVolumeFaces() == 0)
{
- llwarns << "Model has no faces!" << llendl;
+ LL_WARNS() << "Model has no faces!" << LL_ENDL;
return false;
}
@@ -356,13 +354,13 @@ bool validate_model(const LLModel* mdl)
{
if (mdl->getVolumeFace(i).mNumVertices == 0)
{
- llwarns << "Face has no vertices." << llendl;
+ LL_WARNS() << "Face has no vertices." << LL_ENDL;
return false;
}
if (mdl->getVolumeFace(i).mNumIndices == 0)
{
- llwarns << "Face has no indices." << llendl;
+ LL_WARNS() << "Face has no indices." << LL_ENDL;
return false;
}
@@ -381,7 +379,7 @@ BOOL stop_gloderror()
if (error != GLOD_NO_ERROR)
{
- llwarns << "GLOD error detected, cannot generate LOD: " << std::hex << error << llendl;
+ LL_WARNS() << "GLOD error detected, cannot generate LOD: " << std::hex << error << LL_ENDL;
return TRUE;
}
@@ -537,9 +535,9 @@ BOOL LLFloaterModelPreview::postBuild()
if (LLConvexDecomposition::getInstance() != NULL)
{
- mCalculateBtn->setClickedCallback(boost::bind(&LLFloaterModelPreview::onClickCalculateBtn, this));
+ mCalculateBtn->setClickedCallback(boost::bind(&LLFloaterModelPreview::onClickCalculateBtn, this));
- toggleCalculateButton(true);
+ toggleCalculateButton(true);
}
else
{
@@ -600,7 +598,7 @@ bool LLFloaterModelPreview::isViewOptionChecked(const LLSD& userdata)
bool LLFloaterModelPreview::isViewOptionEnabled(const LLSD& userdata)
{
- return childIsEnabled(userdata.asString());
+ return getChildView(userdata.asString())->getEnabled();
}
void LLFloaterModelPreview::setViewOptionEnabled(const std::string& option, bool enabled)
@@ -956,7 +954,7 @@ void LLFloaterModelPreview::onPhysicsParamCommit(LLUICtrl* ctrl, void* data)
{
if (LLConvexDecomposition::getInstance() == NULL)
{
- llinfos << "convex decomposition tool is a stub on this platform. cannot get decomp." << llendl;
+ LL_INFOS() << "convex decomposition tool is a stub on this platform. cannot get decomp." << LL_ENDL;
return;
}
@@ -1004,7 +1002,7 @@ void LLFloaterModelPreview::onPhysicsStageExecute(LLUICtrl* ctrl, void* data)
{
if (!sInstance->mCurRequest.empty())
{
- llinfos << "Decomposition request still pending." << llendl;
+ LL_INFOS() << "Decomposition request still pending." << LL_ENDL;
return;
}
@@ -1055,13 +1053,13 @@ void LLFloaterModelPreview::onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata)
}
else
{
- llwarns << "no iface" << llendl;
+ LL_WARNS() << "no iface" << LL_ENDL;
return;
}
if (which_mode <= 0)
{
- llwarns << "which_mode out of range, " << which_mode << llendl;
+ LL_WARNS() << "which_mode out of range, " << which_mode << LL_ENDL;
}
S32 file_mode = iface->getItemCount() - 1;
@@ -1146,8 +1144,8 @@ void LLFloaterModelPreview::initDecompControls()
// protected against stub by stage_count being 0 for stub above
LLConvexDecomposition::getInstance()->registerCallback(j, LLPhysicsDecomp::llcdCallback);
- //llinfos << "Physics decomp stage " << stage[j].mName << " (" << j << ") parameters:" << llendl;
- //llinfos << "------------------------------------" << llendl;
+ //LL_INFOS() << "Physics decomp stage " << stage[j].mName << " (" << j << ") parameters:" << LL_ENDL;
+ //LL_INFOS() << "------------------------------------" << LL_ENDL;
for (S32 i = 0; i < param_count; ++i)
{
@@ -1161,12 +1159,12 @@ void LLFloaterModelPreview::initDecompControls()
std::string type = "unknown";
- llinfos << name << " - " << description << llendl;
+ LL_INFOS() << name << " - " << description << LL_ENDL;
if (param[i].mType == LLCDParam::LLCD_FLOAT)
{
mDecompParams[param[i].mName] = LLSD(param[i].mDefault.mFloat);
- //llinfos << "Type: float, Default: " << param[i].mDefault.mFloat << llendl;
+ //LL_INFOS() << "Type: float, Default: " << param[i].mDefault.mFloat << LL_ENDL;
LLUICtrl* ctrl = getChild<LLUICtrl>(name);
@@ -1216,7 +1214,7 @@ void LLFloaterModelPreview::initDecompControls()
else if (param[i].mType == LLCDParam::LLCD_INTEGER)
{
mDecompParams[param[i].mName] = LLSD(param[i].mDefault.mIntOrEnumValue);
- //llinfos << "Type: integer, Default: " << param[i].mDefault.mIntOrEnumValue << llendl;
+ //LL_INFOS() << "Type: integer, Default: " << param[i].mDefault.mIntOrEnumValue << LL_ENDL;
LLUICtrl* ctrl = getChild<LLUICtrl>(name);
@@ -1242,7 +1240,7 @@ void LLFloaterModelPreview::initDecompControls()
else if (param[i].mType == LLCDParam::LLCD_BOOLEAN)
{
mDecompParams[param[i].mName] = LLSD(param[i].mDefault.mBool);
- //llinfos << "Type: boolean, Default: " << (param[i].mDefault.mBool ? "True" : "False") << llendl;
+ //LL_INFOS() << "Type: boolean, Default: " << (param[i].mDefault.mBool ? "True" : "False") << LL_ENDL;
LLCheckBoxCtrl* check_box = getChild<LLCheckBoxCtrl>(name);
if (check_box)
@@ -1254,16 +1252,16 @@ void LLFloaterModelPreview::initDecompControls()
else if (param[i].mType == LLCDParam::LLCD_ENUM)
{
mDecompParams[param[i].mName] = LLSD(param[i].mDefault.mIntOrEnumValue);
- //llinfos << "Type: enum, Default: " << param[i].mDefault.mIntOrEnumValue << llendl;
+ //LL_INFOS() << "Type: enum, Default: " << param[i].mDefault.mIntOrEnumValue << LL_ENDL;
{ //plug into combo box
- //llinfos << "Accepted values: " << llendl;
+ //LL_INFOS() << "Accepted values: " << LL_ENDL;
LLComboBox* combo_box = getChild<LLComboBox>(name);
for (S32 k = 0; k < param[i].mDetails.mEnumValues.mNumEnums; ++k)
{
- //llinfos << param[i].mDetails.mEnumValues.mEnumsArray[k].mValue
- // << " - " << param[i].mDetails.mEnumValues.mEnumsArray[k].mName << llendl;
+ //LL_INFOS() << param[i].mDetails.mEnumValues.mEnumsArray[k].mValue
+ // << " - " << param[i].mDetails.mEnumValues.mEnumsArray[k].mName << LL_ENDL;
std::string name(param[i].mDetails.mEnumValues.mEnumsArray[k].mName);
std::string localized_name;
@@ -1276,9 +1274,9 @@ void LLFloaterModelPreview::initDecompControls()
combo_box->setCommitCallback(onPhysicsParamCommit, (void*) &param[i]);
}
- //llinfos << "----" << llendl;
+ //LL_INFOS() << "----" << LL_ENDL;
}
- //llinfos << "-----------------------------" << llendl;
+ //LL_INFOS() << "-----------------------------" << LL_ENDL;
}
}
@@ -1525,14 +1523,14 @@ bool LLModelLoader::doLoadModel()
if (!dom)
{
- llinfos<<" Error with dae - traditionally indicates a corrupt file."<<llendl;
+ LL_INFOS()<<" Error with dae - traditionally indicates a corrupt file."<<LL_ENDL;
setLoadState( ERROR_PARSING );
return false;
}
//Dom version
daeString domVersion = dae.getDomVersion();
std::string sldom(domVersion);
- llinfos<<"Collada Importer Version: "<<sldom<<llendl;
+ LL_INFOS()<<"Collada Importer Version: "<<sldom<<LL_ENDL;
//Dae version
domVersionType docVersion = dom->getVersion();
//0=1.4
@@ -1542,7 +1540,7 @@ bool LLModelLoader::doLoadModel()
{
docVersion = VERSIONTYPE_COUNT;
}
- llinfos<<"Dae version "<<colladaVersion[docVersion]<<llendl;
+ LL_INFOS()<<"Dae version "<<colladaVersion[docVersion]<<LL_ENDL;
daeDatabase* db = dae.getDatabase();
@@ -1552,14 +1550,14 @@ bool LLModelLoader::doLoadModel()
daeDocument* doc = dae.getDoc(mFilename);
if (!doc)
{
- llwarns << "can't find internal doc" << llendl;
+ LL_WARNS() << "can't find internal doc" << LL_ENDL;
return false;
}
daeElement* root = doc->getDomRoot();
if (!root)
{
- llwarns << "document has no root" << llendl;
+ LL_WARNS() << "document has no root" << LL_ENDL;
return false;
}
@@ -1724,7 +1722,7 @@ bool LLModelLoader::doLoadModel()
daeElement* pScene = root->getDescendant("visual_scene");
if ( !pScene )
{
- llwarns<<"No visual scene - unable to parse bone offsets "<<llendl;
+ LL_WARNS()<<"No visual scene - unable to parse bone offsets "<<LL_ENDL;
missingSkeletonOrScene = true;
}
else
@@ -1762,7 +1760,7 @@ bool LLModelLoader::doLoadModel()
//Build a joint for the resolver to work with
char str[64]={0};
sprintf(str,"./%s",(*jointIt).first.c_str() );
- //llwarns<<"Joint "<< str <<llendl;
+ //LL_WARNS()<<"Joint "<< str <<LL_ENDL;
//Setup the resolver
daeSIDResolver resolver( pSkeletonRootNode, str );
@@ -1795,7 +1793,7 @@ bool LLModelLoader::doLoadModel()
daeElement* pTranslateElement = getChildFromElement( pJoint, "translate" );
if ( pTranslateElement && pTranslateElement->typeID() != domTranslate::ID() )
{
- llwarns<< "The found element is not a translate node" <<llendl;
+ LL_WARNS()<< "The found element is not a translate node" <<LL_ENDL;
missingSkeletonOrScene = true;
}
else
@@ -1819,7 +1817,7 @@ bool LLModelLoader::doLoadModel()
//mention it
if ( missingSkeletonOrScene )
{
- llwarns<< "Partial jointmap found in asset - did you mean to just have a partial map?" << llendl;
+ LL_WARNS()<< "Partial jointmap found in asset - did you mean to just have a partial map?" << LL_ENDL;
}
}//got skeleton?
}
@@ -1932,7 +1930,7 @@ bool LLModelLoader::doLoadModel()
if ( mJointList.find( lookingForJoint ) != mJointList.end() )
{
- //llinfos<<"joint "<<lookingForJoint.c_str()<<llendl;
+ //LL_INFOS()<<"joint "<<lookingForJoint.c_str()<<LL_ENDL;
LLMatrix4 jointTransform = mJointList[lookingForJoint];
LLJoint* pJoint = mPreview->getPreviewAvatar()->getJoint( lookingForJoint );
if ( pJoint )
@@ -1942,7 +1940,7 @@ bool LLModelLoader::doLoadModel()
else
{
//Most likely an error in the asset.
- llwarns<<"Tried to apply joint position from .dae, but it did not exist in the avatar rig." << llendl;
+ LL_WARNS()<<"Tried to apply joint position from .dae, but it did not exist in the avatar rig." << LL_ENDL;
}
}
}
@@ -1970,7 +1968,7 @@ bool LLModelLoader::doLoadModel()
}
else
{
- llwarns<<"Possibly misnamed/missing joint [" <<lookingForJoint.c_str()<<" ] "<<llendl;
+ LL_WARNS()<<"Possibly misnamed/missing joint [" <<lookingForJoint.c_str()<<" ] "<<LL_ENDL;
}
}
@@ -1996,7 +1994,7 @@ bool LLModelLoader::doLoadModel()
{
if (pos.getCount() <= j+2)
{
- llerrs << "Invalid position array size." << llendl;
+ LL_ERRS() << "Invalid position array size." << LL_ENDL;
}
LLVector3 v(pos[j], pos[j+1], pos[j+2]);
@@ -2122,7 +2120,7 @@ bool LLModelLoader::doLoadModel()
if (!scene)
{
- llwarns << "document has no visual_scene" << llendl;
+ LL_WARNS() << "document has no visual_scene" << LL_ENDL;
setLoadState( ERROR_PARSING );
return true;
}
@@ -2337,7 +2335,7 @@ void LLModelLoader::processJointToNodeMapping( domNode* pNode )
}
else
{
- llinfos<<"Node is NULL"<<llendl;
+ LL_INFOS()<<"Node is NULL"<<LL_ENDL;
}
}
@@ -2408,7 +2406,7 @@ void LLModelPreview::critiqueJointToNodeMappingFromScene( void )
}
else
{
- llinfos<<"critiqueJointToNodeMappingFromScene is missing a: "<<name<<llendl;
+ LL_INFOS()<<"critiqueJointToNodeMappingFromScene is missing a: "<<name<<LL_ENDL;
result = false;
}
}
@@ -2460,7 +2458,7 @@ bool LLModelPreview::isRigLegacy( const std::vector<std::string> &jointListFromA
}
if ( !result )
{
- llinfos<<" Asset did not contain the joint (if you're u/l a fully rigged asset w/joint positions - it is required)." << *masterJointIt<< llendl;
+ LL_INFOS()<<" Asset did not contain the joint (if you're u/l a fully rigged asset w/joint positions - it is required)." << *masterJointIt<< LL_ENDL;
break;
}
}
@@ -2494,7 +2492,7 @@ bool LLModelPreview::isRigSuitableForJointPositionUpload( const std::vector<std:
}
if ( !result )
{
- llinfos<<" Asset did not contain the joint (if you're u/l a fully rigged asset w/joint positions - it is required)." << *masterJointIt<< llendl;
+ LL_INFOS()<<" Asset did not contain the joint (if you're u/l a fully rigged asset w/joint positions - it is required)." << *masterJointIt<< LL_ENDL;
break;
}
}
@@ -2542,17 +2540,17 @@ bool LLModelLoader::isNodeAJoint( domNode* pNode )
{
if ( !pNode )
{
- llinfos<<"Created node is NULL"<<llendl;
+ LL_INFOS()<<"Created node is NULL"<<LL_ENDL;
return false;
}
if ( pNode->getName() == NULL )
{
- llinfos<<"Parsed node has no name "<<llendl;
+ LL_INFOS()<<"Parsed node has no name "<<LL_ENDL;
//Attempt to write the node id, if possible (aids in debugging the visual scene)
if ( pNode->getId() )
{
- llinfos<<"Parsed node ID: "<<pNode->getId()<<llendl;
+ LL_INFOS()<<"Parsed node ID: "<<pNode->getId()<<LL_ENDL;
}
return false;
}
@@ -2571,7 +2569,7 @@ bool LLModelPreview::verifyCount( int expected, int result )
{
if ( expected != result )
{
- llinfos<< "Error: (expected/got)"<<expected<<"/"<<result<<"verts"<<llendl;
+ LL_INFOS()<< "Error: (expected/got)"<<expected<<"/"<<result<<"verts"<<LL_ENDL;
return false;
}
return true;
@@ -2593,7 +2591,7 @@ bool LLModelPreview::verifyController( domController* pController )
if ( !pElement )
{
- llinfos<<"Can't resolve skin source"<<llendl;
+ LL_INFOS()<<"Can't resolve skin source"<<LL_ENDL;
return false;
}
@@ -2612,7 +2610,7 @@ bool LLModelPreview::verifyController( domController* pController )
domVertices* pVertices = pMesh->getVertices();
if ( !pVertices )
{
- llinfos<<"No vertices!"<<llendl;
+ LL_INFOS()<<"No vertices!"<<LL_ENDL;
return false;
}
@@ -2698,7 +2696,7 @@ void LLModelLoader::extractTranslationViaSID( daeElement* pElement, LLMatrix4& t
}
else
{
- llwarns<<"Element is nonexistent - empty/unsupported node."<<llendl;
+ LL_WARNS()<<"Element is nonexistent - empty/unsupported node."<<LL_ENDL;
}
}
//-----------------------------------------------------------------------------
@@ -2708,11 +2706,11 @@ void LLModelLoader::processJointNode( domNode* pNode, JointTransformMap& jointTr
{
if (pNode->getName() == NULL)
{
- llwarns << "nameless node, can't process" << llendl;
+ LL_WARNS() << "nameless node, can't process" << LL_ENDL;
return;
}
- //llwarns<<"ProcessJointNode# Node:" <<pNode->getName()<<llendl;
+ //LL_WARNS()<<"ProcessJointNode# Node:" <<pNode->getName()<<LL_ENDL;
//1. handle the incoming node - extract out translation via SID or element
@@ -2740,12 +2738,12 @@ void LLModelLoader::processJointNode( domNode* pNode, JointTransformMap& jointTr
daeElement* pTranslateElement = getChildFromElement( pNode, "translate" );
if ( !pTranslateElement || pTranslateElement->typeID() != domTranslate::ID() )
{
- //llwarns<< "The found element is not a translate node" <<llendl;
+ //LL_WARNS()<< "The found element is not a translate node" <<LL_ENDL;
daeSIDResolver jointResolver( pNode, "./matrix" );
domMatrix* pMatrix = daeSafeCast<domMatrix>( jointResolver.getElement() );
if ( pMatrix )
{
- //llinfos<<"A matrix SID was however found!"<<llendl;
+ //LL_INFOS()<<"A matrix SID was however found!"<<LL_ENDL;
domFloat4x4 domArray = pMatrix->getValue();
for ( int i = 0; i < 4; i++ )
{
@@ -2757,7 +2755,7 @@ void LLModelLoader::processJointNode( domNode* pNode, JointTransformMap& jointTr
}
else
{
- llwarns<< "The found element is not translate or matrix node - most likely a corrupt export!" <<llendl;
+ LL_WARNS()<< "The found element is not translate or matrix node - most likely a corrupt export!" <<LL_ENDL;
}
}
else
@@ -2794,7 +2792,7 @@ daeElement* LLModelLoader::getChildFromElement( daeElement* pElement, std::strin
{
return pChildOfElement;
}
- llwarns<< "Could not find a child [" << name << "] for the element: \"" << pElement->getAttribute("id") << "\"" << llendl;
+ LL_WARNS()<< "Could not find a child [" << name << "] for the element: \"" << pElement->getAttribute("id") << "\"" << LL_ENDL;
return NULL;
}
@@ -2876,7 +2874,7 @@ void LLModelLoader::processElement( daeElement* element, bool& badElement )
if (mTransform.determinant() < 0)
{ //negative scales are not supported
- llinfos << "Negative scale detected, unsupported transform. domInstance_geometry: " << LLModel::getElementLabel(instance_geo) << llendl;
+ LL_INFOS() << "Negative scale detected, unsupported transform. domInstance_geometry: " << LLModel::getElementLabel(instance_geo) << LL_ENDL;
badElement = true;
}
@@ -2906,7 +2904,7 @@ void LLModelLoader::processElement( daeElement* element, bool& badElement )
}
else
{
- llinfos<<"Unable to resolve geometry URL."<<llendl;
+ LL_INFOS()<<"Unable to resolve geometry URL."<<LL_ENDL;
badElement = true;
}
@@ -3541,7 +3539,7 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable
if (lod < LLModel::LOD_IMPOSTOR || lod > LLModel::NUM_LODS - 1)
{
- llwarns << "Invalid level of detail: " << lod << llendl;
+ LL_WARNS() << "Invalid level of detail: " << lod << LL_ENDL;
assert(lod >= LLModel::LOD_IMPOSTOR && lod < LLModel::NUM_LODS);
return;
}
@@ -3564,7 +3562,7 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable
if (mModelLoader)
{
- llwarns << "Incompleted model load operation pending." << llendl;
+ LL_WARNS() << "Incompleted model load operation pending." << LL_ENDL;
return;
}
@@ -3596,11 +3594,11 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable
if (lod == mPreviewLOD)
{
- mFMP->childSetText("lod_file_" + lod_name[lod], mLODFile[lod]);
+ mFMP->childSetValue("lod_file_" + lod_name[lod], mLODFile[lod]);
}
else if (lod == LLModel::LOD_PHYSICS)
{
- mFMP->childSetText("physics_file", mLODFile[lod]);
+ mFMP->childSetValue("physics_file", mLODFile[lod]);
}
mFMP->openFloater();
@@ -3615,7 +3613,7 @@ void LLModelPreview::setPhysicsFromLOD(S32 lod)
mModel[LLModel::LOD_PHYSICS] = mModel[lod];
mScene[LLModel::LOD_PHYSICS] = mScene[lod];
mLODFile[LLModel::LOD_PHYSICS].clear();
- mFMP->childSetText("physics_file", mLODFile[LLModel::LOD_PHYSICS]);
+ mFMP->childSetValue("physics_file", mLODFile[LLModel::LOD_PHYSICS]);
mVertexBuffer[LLModel::LOD_PHYSICS].clear();
rebuildUploadData();
refresh();
@@ -3874,7 +3872,7 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
// Allow LoD from -1 to LLModel::LOD_PHYSICS
if (which_lod < -1 || which_lod > LLModel::NUM_LODS - 1)
{
- llwarns << "Invalid level of detail: " << which_lod << llendl;
+ LL_WARNS() << "Invalid level of detail: " << which_lod << LL_ENDL;
assert(which_lod >= -1 && which_lod < LLModel::NUM_LODS);
return;
}
@@ -4162,7 +4160,7 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
if (!validate_face(target_model->getVolumeFace(names[i])))
{
- llerrs << "Invalid face generated during LOD generation." << llendl;
+ LL_ERRS() << "Invalid face generated during LOD generation." << LL_ENDL;
}
}
@@ -4177,7 +4175,7 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
if (!validate_model(target_model))
{
- llerrs << "Invalid model generated when creating LODs" << llendl;
+ LL_ERRS() << "Invalid model generated when creating LODs" << LL_ENDL;
}
delete [] sizes;
@@ -4331,8 +4329,8 @@ void LLModelPreview::updateStatusMessages()
if (total_tris[lod] > 0)
{
- mFMP->childSetText(lod_triangles_name[lod], llformat("%d", total_tris[lod]));
- mFMP->childSetText(lod_vertices_name[lod], llformat("%d", total_verts[lod]));
+ mFMP->childSetValue(lod_triangles_name[lod], llformat("%d", total_tris[lod]));
+ mFMP->childSetValue(lod_vertices_name[lod], llformat("%d", total_verts[lod]));
}
else
{
@@ -4353,8 +4351,8 @@ void LLModelPreview::updateStatusMessages()
}
}
- mFMP->childSetText(lod_triangles_name[lod], mesh_status_na);
- mFMP->childSetText(lod_vertices_name[lod], mesh_status_na);
+ mFMP->childSetValue(lod_triangles_name[lod], mesh_status_na);
+ mFMP->childSetValue(lod_vertices_name[lod], mesh_status_na);
}
const U32 lod_high = LLModel::LOD_HIGH;
@@ -4403,7 +4401,7 @@ void LLModelPreview::updateStatusMessages()
if (lod == mPreviewLOD)
{
- mFMP->childSetText("lod_status_message_text", mFMP->getString(message));
+ mFMP->childSetValue("lod_status_message_text", mFMP->getString(message));
icon = mFMP->getChild<LLIconCtrl>("lod_status_message_icon");
icon->setImage(img);
}
@@ -4622,7 +4620,7 @@ void LLModelPreview::updateLodControls(S32 lod)
{
if (lod < LLModel::LOD_IMPOSTOR || lod > LLModel::LOD_HIGH)
{
- llwarns << "Invalid level of detail: " << lod << llendl;
+ LL_WARNS() << "Invalid level of detail: " << lod << LL_ENDL;
assert(lod >= LLModel::LOD_IMPOSTOR && lod <= LLModel::LOD_HIGH);
return;
}
@@ -4654,12 +4652,12 @@ void LLModelPreview::updateLodControls(S32 lod)
fmp->mLODMode[lod] = 0;
for (U32 i = 0; i < num_file_controls; ++i)
{
- mFMP->childShow(file_controls[i] + lod_name[lod]);
+ mFMP->childSetVisible(file_controls[i] + lod_name[lod], true);
}
for (U32 i = 0; i < num_lod_controls; ++i)
{
- mFMP->childHide(lod_controls[i] + lod_name[lod]);
+ mFMP->childSetVisible(lod_controls[i] + lod_name[lod], false);
}
}
else if (lod_mode == USE_LOD_ABOVE) // use LoD above
@@ -4667,12 +4665,12 @@ void LLModelPreview::updateLodControls(S32 lod)
fmp->mLODMode[lod] = 2;
for (U32 i = 0; i < num_file_controls; ++i)
{
- mFMP->childHide(file_controls[i] + lod_name[lod]);
+ mFMP->childSetVisible(file_controls[i] + lod_name[lod], false);
}
for (U32 i = 0; i < num_lod_controls; ++i)
{
- mFMP->childHide(lod_controls[i] + lod_name[lod]);
+ mFMP->childSetVisible(lod_controls[i] + lod_name[lod], false);
}
if (lod < LLModel::LOD_HIGH)
@@ -4697,12 +4695,12 @@ void LLModelPreview::updateLodControls(S32 lod)
for (U32 i = 0; i < num_file_controls; ++i)
{
- mFMP->childHide(file_controls[i] + lod_name[lod]);
+ mFMP->getChildView(file_controls[i] + lod_name[lod])->setVisible(false);
}
for (U32 i = 0; i < num_lod_controls; ++i)
{
- mFMP->childShow(lod_controls[i] + lod_name[lod]);
+ mFMP->getChildView(lod_controls[i] + lod_name[lod])->setVisible(true);
}
@@ -4935,7 +4933,7 @@ void LLModelPreview::createPreviewAvatar( void )
}
else
{
- llinfos<<"Failed to create preview avatar for upload model window"<<llendl;
+ LL_INFOS()<<"Failed to create preview avatar for upload model window"<<LL_ENDL;
}
}
@@ -5653,7 +5651,7 @@ void LLModelPreview::setPreviewLOD(S32 lod)
LLComboBox* combo_box = mFMP->getChild<LLComboBox>("preview_lod_combo");
combo_box->setCurrentByIndex((NUM_LOD-1)-mPreviewLOD); // combo box list of lods is in reverse order
- mFMP->childSetText("lod_file_" + lod_name[mPreviewLOD], mLODFile[mPreviewLOD]);
+ mFMP->childSetValue("lod_file_" + lod_name[mPreviewLOD], mLODFile[mPreviewLOD]);
LLComboBox* combo_box2 = mFMP->getChild<LLComboBox>("preview_lod_combo2");
combo_box2->setCurrentByIndex((NUM_LOD-1)-mPreviewLOD); // combo box list of lods is in reverse order
@@ -5863,9 +5861,9 @@ void LLFloaterModelPreview::handleModelPhysicsFeeReceived()
mUploadBtn->setEnabled(mHasUploadPerm && !mUploadModelUrl.empty());
}
-void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason)
+void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason)
{
- llwarns << "LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(" << status << " : " << reason << ")" << llendl;
+ LL_WARNS() << "LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(" << status << " : " << reason << ")" << LL_ENDL;
doOnIdleOneTime(boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this, true));
}
@@ -5939,9 +5937,9 @@ void LLFloaterModelPreview::onPermissionsReceived(const LLSD& result)
getChild<LLTextBox>("warning_message")->setVisible(!mHasUploadPerm);
}
-void LLFloaterModelPreview::setPermissonsErrorStatus(U32 status, const std::string& reason)
+void LLFloaterModelPreview::setPermissonsErrorStatus(S32 status, const std::string& reason)
{
- llwarns << "LLFloaterModelPreview::setPermissonsErrorStatus(" << status << " : " << reason << ")" << llendl;
+ LL_WARNS() << "LLFloaterModelPreview::setPermissonsErrorStatus(" << status << " : " << reason << ")" << LL_ENDL;
LLNotificationsUtil::add("MeshUploadPermError");
}
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index e588418f7b..6c0c60b87f 100755
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -200,11 +200,11 @@ public:
/*virtual*/ void onPermissionsReceived(const LLSD& result);
// called when error occurs during permissions request
- /*virtual*/ void setPermissonsErrorStatus(U32 status, const std::string& reason);
+ /*virtual*/ void setPermissonsErrorStatus(S32 status, const std::string& reason);
/*virtual*/ void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url);
void handleModelPhysicsFeeReceived();
- /*virtual*/ void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason);
+ /*virtual*/ void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason);
/*virtual*/ void onModelUploadSuccess();
diff --git a/indra/newview/llfloatermodeluploadbase.cpp b/indra/newview/llfloatermodeluploadbase.cpp
index 6d3800bfa4..22a8ac4705 100755
--- a/indra/newview/llfloatermodeluploadbase.cpp
+++ b/indra/newview/llfloatermodeluploadbase.cpp
@@ -44,8 +44,10 @@ void LLFloaterModelUploadBase::requestAgentUploadPermissions()
if (!url.empty())
{
- llinfos<< typeid(*this).name() <<"::requestAgentUploadPermissions() requesting for upload model permissions from: "<< url <<llendl;
- LLHTTPClient::get(url, new LLUploadModelPremissionsResponder(getPermObserverHandle()));
+ LL_INFOS()<< typeid(*this).name()
+ << "::requestAgentUploadPermissions() requesting for upload model permissions from: "
+ << url << LL_ENDL;
+ LLHTTPClient::get(url, new LLUploadModelPermissionsResponder(getPermObserverHandle()));
}
else
{
diff --git a/indra/newview/llfloatermodeluploadbase.h b/indra/newview/llfloatermodeluploadbase.h
index a52bc28687..d9a8879687 100755
--- a/indra/newview/llfloatermodeluploadbase.h
+++ b/indra/newview/llfloatermodeluploadbase.h
@@ -37,13 +37,13 @@ public:
virtual ~LLFloaterModelUploadBase(){};
- virtual void setPermissonsErrorStatus(U32 status, const std::string& reason) = 0;
+ virtual void setPermissonsErrorStatus(S32 status, const std::string& reason) = 0;
virtual void onPermissionsReceived(const LLSD& result) = 0;
virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0;
- virtual void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason) = 0;
+ virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason) = 0;
virtual void onModelUploadSuccess() {};
diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp
index 27b1c3b9cd..ee7f413a59 100755
--- a/indra/newview/llfloaternamedesc.cpp
+++ b/indra/newview/llfloaternamedesc.cpp
@@ -45,6 +45,7 @@
#include "lluictrlfactory.h"
#include "llstring.h"
#include "lleconomy.h"
+#include "llpermissions.h"
// linden includes
#include "llassetstorage.h"
@@ -167,11 +168,14 @@ void LLFloaterNameDesc::onBtnOK( )
S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); // kinda hack - assumes that unsubclassed LLFloaterNameDesc is only used for uploading chargeable assets, which it is right now (it's only used unsubclassed for the sound upload dialog, and THAT should be a subclass).
void *nruserdata = NULL;
std::string display_name = LLStringUtil::null;
+
upload_new_resource(mFilenameAndPath, // file
getChild<LLUICtrl>("name_form")->getValue().asString(),
getChild<LLUICtrl>("description_form")->getValue().asString(),
0, LLFolderType::FT_NONE, LLInventoryType::IT_NONE,
- LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
+ LLFloaterPerms::getNextOwnerPerms("Uploads"),
+ LLFloaterPerms::getGroupPerms("Uploads"),
+ LLFloaterPerms::getEveryonePerms("Uploads"),
display_name, callback, expected_upload_cost, nruserdata);
closeFloater(false);
}
diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp
index 4f35c325a8..fd03efa061 100755
--- a/indra/newview/llfloaternotificationsconsole.cpp
+++ b/indra/newview/llfloaternotificationsconsole.cpp
@@ -41,6 +41,7 @@ class LLNotificationChannelPanel : public LLLayoutPanel
{
public:
LLNotificationChannelPanel(const Params& p);
+ ~LLNotificationChannelPanel();
BOOL postBuild();
private:
@@ -57,6 +58,20 @@ LLNotificationChannelPanel::LLNotificationChannelPanel(const LLNotificationChann
buildFromFile( "panel_notifications_channel.xml");
}
+LLNotificationChannelPanel::~LLNotificationChannelPanel()
+{
+ // Userdata for all records is a LLNotification* we need to clean up
+ std::vector<LLScrollListItem*> data_list = getChild<LLScrollListCtrl>("notifications_list")->getAllData();
+ std::vector<LLScrollListItem*>::iterator data_itor;
+ for (data_itor = data_list.begin(); data_itor != data_list.end(); ++data_itor)
+ {
+ LLScrollListItem* item = *data_itor;
+ LLNotification* notification = (LLNotification*)item->getUserdata();
+ delete notification;
+ notification = NULL;
+ }
+}
+
BOOL LLNotificationChannelPanel::postBuild()
{
LLButton* header_button = getChild<LLButton>("header");
@@ -124,7 +139,7 @@ bool LLNotificationChannelPanel::update(const LLSD& payload)
row["columns"][2]["type"] = "date";
LLScrollListItem* sli = getChild<LLScrollListCtrl>("notifications_list")->addElement(row);
- sli->setUserdata(&(*notification));
+ sli->setUserdata(new LLNotification(notification->asLLSD()));
}
return false;
@@ -257,7 +272,7 @@ void LLFloaterNotification::respond()
LLComboBox* responses_combo = getChild<LLComboBox>("response");
LLCtrlListInterface* response_list = responses_combo->getListInterface();
const std::string& trigger = response_list->getSelectedValue().asString();
- //llinfos << trigger << llendl;
+ //LL_INFOS() << trigger << LL_ENDL;
LLSD response = mNote->getResponseTemplate();
response[trigger] = true;
diff --git a/indra/newview/llfloaterobjectweights.cpp b/indra/newview/llfloaterobjectweights.cpp
index 0862cd2897..feaeef4ad0 100755
--- a/indra/newview/llfloaterobjectweights.cpp
+++ b/indra/newview/llfloaterobjectweights.cpp
@@ -123,7 +123,7 @@ void LLFloaterObjectWeights::onWeightsUpdate(const SelectionCost& selection_cost
}
//virtual
-void LLFloaterObjectWeights::setErrorStatus(U32 status, const std::string& reason)
+void LLFloaterObjectWeights::setErrorStatus(S32 status, const std::string& reason)
{
const std::string text = getString("nothing_selected");
@@ -207,7 +207,7 @@ void LLFloaterObjectWeights::refresh()
}
else
{
- llwarns << "Failed to get region capabilities" << llendl;
+ LL_WARNS() << "Failed to get region capabilities" << LL_ENDL;
}
}
}
diff --git a/indra/newview/llfloaterobjectweights.h b/indra/newview/llfloaterobjectweights.h
index 9a244573be..1a2c317bad 100755
--- a/indra/newview/llfloaterobjectweights.h
+++ b/indra/newview/llfloaterobjectweights.h
@@ -63,7 +63,7 @@ public:
/*virtual*/ void onOpen(const LLSD& key);
/*virtual*/ void onWeightsUpdate(const SelectionCost& selection_cost);
- /*virtual*/ void setErrorStatus(U32 status, const std::string& reason);
+ /*virtual*/ void setErrorStatus(S32 status, const std::string& reason);
void updateLandImpacts(const LLParcel* parcel);
void refresh();
diff --git a/indra/newview/llfloateropenobject.cpp b/indra/newview/llfloateropenobject.cpp
index 4bfef8b45f..9986bdbd7f 100755
--- a/indra/newview/llfloateropenobject.cpp
+++ b/indra/newview/llfloateropenobject.cpp
@@ -162,21 +162,17 @@ void LLFloaterOpenObject::moveToInventory(bool wear)
{
parent_category_id = gInventory.getRootFolderID();
}
-
- LLCategoryCreate* cat_data = new LLCategoryCreate(object_id, wear);
-
+
+ inventory_func_type func = boost::bind(LLFloaterOpenObject::callbackCreateInventoryCategory,_1,object_id,wear);
LLUUID category_id = gInventory.createNewCategory(parent_category_id,
LLFolderType::FT_NONE,
name,
- callbackCreateInventoryCategory,
- (void*)cat_data);
+ func);
//If we get a null category ID, we are using a capability in createNewCategory and we will
//handle the following in the callbackCreateInventoryCategory routine.
if ( category_id.notNull() )
{
- delete cat_data;
-
LLCatAndWear* data = new LLCatAndWear;
data->mCatID = category_id;
data->mWear = wear;
@@ -198,20 +194,17 @@ void LLFloaterOpenObject::moveToInventory(bool wear)
}
// static
-void LLFloaterOpenObject::callbackCreateInventoryCategory(const LLSD& result, void* data)
+void LLFloaterOpenObject::callbackCreateInventoryCategory(const LLUUID& category_id, LLUUID object_id, bool wear)
{
- LLCategoryCreate* cat_data = (LLCategoryCreate*)data;
-
- LLUUID category_id = result["folder_id"].asUUID();
LLCatAndWear* wear_data = new LLCatAndWear;
wear_data->mCatID = category_id;
- wear_data->mWear = cat_data->mWear;
+ wear_data->mWear = wear;
wear_data->mFolderResponded = true;
// Copy and/or move the items into the newly created folder.
// Ignore any "you're going to break this item" messages.
- BOOL success = move_inv_category_world_to_agent(cat_data->mObjectID, category_id, TRUE,
+ BOOL success = move_inv_category_world_to_agent(object_id, category_id, TRUE,
callbackMoveInventory,
(void*)wear_data);
if (!success)
@@ -221,7 +214,6 @@ void LLFloaterOpenObject::callbackCreateInventoryCategory(const LLSD& result, vo
LLNotificationsUtil::add("OpenObjectCannotCopy");
}
- delete cat_data;
}
// static
diff --git a/indra/newview/llfloateropenobject.h b/indra/newview/llfloateropenobject.h
index bf7fe69c65..8e472804a4 100755
--- a/indra/newview/llfloateropenobject.h
+++ b/indra/newview/llfloateropenobject.h
@@ -45,15 +45,6 @@ public:
void dirty();
- class LLCategoryCreate
- {
- public:
- LLCategoryCreate(LLUUID object_id, bool wear) : mObjectID(object_id), mWear(wear) {}
- public:
- LLUUID mObjectID;
- bool mWear;
- };
-
struct LLCatAndWear
{
LLUUID mCatID;
@@ -72,7 +63,7 @@ protected:
void onClickMoveToInventory();
void onClickMoveAndWear();
- static void callbackCreateInventoryCategory(const LLSD& result, void* data);
+ static void callbackCreateInventoryCategory(const LLUUID& category_id, LLUUID object_id, bool wear);
static void callbackMoveInventory(S32 result, void* data);
private:
diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index de96f75602..e5efca1102 100755
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -235,7 +235,7 @@ void LLFloaterOutbox::setupOutbox()
if (outbox_id.isNull())
{
// We should never get there unless the inventory fails badly
- llerrs << "Inventory problem: failure to create the outbox for a merchant!" << llendl;
+ LL_ERRS() << "Inventory problem: failure to create the outbox for a merchant!" << LL_ENDL;
return;
}
@@ -245,7 +245,7 @@ void LLFloaterOutbox::setupOutbox()
if (outbox_id == mOutboxId)
{
- llwarns << "Inventory warning: Merchant outbox already set" << llendl;
+ LL_WARNS() << "Inventory warning: Merchant outbox already set" << LL_ENDL;
return;
}
mOutboxId = outbox_id;
@@ -319,7 +319,7 @@ void LLFloaterOutbox::updateFolderCount()
{
if (mOutboxInventoryPanel.get() && mOutboxId.notNull())
{
- S32 item_count = 0;
+ U32 item_count = 0;
if (mOutboxId.notNull())
{
@@ -327,7 +327,7 @@ void LLFloaterOutbox::updateFolderCount()
LLInventoryModel::item_array_t * items;
gInventory.getDirectDescendentsOf(mOutboxId, cats, items);
- item_count = cats->count() + items->count();
+ item_count = cats->size() + items->size();
}
mOutboxItemCount = item_count;
diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp
index 161259d049..ccf3e723fd 100755
--- a/indra/newview/llfloaterpathfindingconsole.cpp
+++ b/indra/newview/llfloaterpathfindingconsole.cpp
@@ -207,7 +207,7 @@ void LLFloaterPathfindingConsole::onOpen(const LLSD& pKey)
if ( LLPathingLib::getInstance() == NULL )
{
setConsoleState(kConsoleStateLibraryNotImplemented);
- llwarns <<"Errror: cannot find pathing library implementation."<<llendl;
+ LL_WARNS() <<"Errror: cannot find pathing library implementation."<<LL_ENDL;
}
else
{
diff --git a/indra/newview/llfloaterperms.cpp b/indra/newview/llfloaterperms.cpp
index 80b55c3cbb..0880a5f35a 100755
--- a/indra/newview/llfloaterperms.cpp
+++ b/indra/newview/llfloaterperms.cpp
@@ -1,7 +1,7 @@
/**
* @file llfloaterperms.cpp
* @brief Asset creation permission preferences.
- * @author Coco
+ * @author Jonathan Yap
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
@@ -32,101 +32,230 @@
#include "llviewerwindow.h"
#include "lluictrlfactory.h"
#include "llpermissions.h"
-
+#include "llagent.h"
+#include "llviewerregion.h"
+#include "llnotificationsutil.h"
LLFloaterPerms::LLFloaterPerms(const LLSD& seed)
: LLFloater(seed)
{
- mCommitCallbackRegistrar.add("Perms.Copy", boost::bind(&LLFloaterPerms::onCommitCopy, this));
- mCommitCallbackRegistrar.add("Perms.OK", boost::bind(&LLFloaterPerms::onClickOK, this));
- mCommitCallbackRegistrar.add("Perms.Cancel", boost::bind(&LLFloaterPerms::onClickCancel, this));
-
}
BOOL LLFloaterPerms::postBuild()
{
- mCloseSignal.connect(boost::bind(&LLFloaterPerms::cancel, this));
-
+ return TRUE;
+}
+
+//static
+U32 LLFloaterPerms::getGroupPerms(std::string prefix)
+{
+ return gSavedSettings.getBOOL(prefix+"ShareWithGroup") ? PERM_COPY | PERM_MOVE | PERM_MODIFY : PERM_NONE;
+}
+
+//static
+U32 LLFloaterPerms::getEveryonePerms(std::string prefix)
+{
+ return gSavedSettings.getBOOL(prefix+"EveryoneCopy") ? PERM_COPY : PERM_NONE;
+}
+
+//static
+U32 LLFloaterPerms::getNextOwnerPerms(std::string prefix)
+{
+ U32 flags = PERM_MOVE;
+ if ( gSavedSettings.getBOOL(prefix+"NextOwnerCopy") )
+ {
+ flags |= PERM_COPY;
+ }
+ if ( gSavedSettings.getBOOL(prefix+"NextOwnerModify") )
+ {
+ flags |= PERM_MODIFY;
+ }
+ if ( gSavedSettings.getBOOL(prefix+"NextOwnerTransfer") )
+ {
+ flags |= PERM_TRANSFER;
+ }
+ return flags;
+}
+
+//static
+U32 LLFloaterPerms::getNextOwnerPermsInverted(std::string prefix)
+{
+ // Sets bits for permissions that are off
+ U32 flags = PERM_MOVE;
+ if ( !gSavedSettings.getBOOL(prefix+"NextOwnerCopy") )
+ {
+ flags |= PERM_COPY;
+ }
+ if ( !gSavedSettings.getBOOL(prefix+"NextOwnerModify") )
+ {
+ flags |= PERM_MODIFY;
+ }
+ if ( !gSavedSettings.getBOOL(prefix+"NextOwnerTransfer") )
+ {
+ flags |= PERM_TRANSFER;
+ }
+ return flags;
+}
+
+static bool mCapSent = false;
+
+LLFloaterPermsDefault::LLFloaterPermsDefault(const LLSD& seed)
+ : LLFloater(seed)
+{
+ mCommitCallbackRegistrar.add("PermsDefault.Copy", boost::bind(&LLFloaterPermsDefault::onCommitCopy, this, _2));
+ mCommitCallbackRegistrar.add("PermsDefault.OK", boost::bind(&LLFloaterPermsDefault::onClickOK, this));
+ mCommitCallbackRegistrar.add("PermsDefault.Cancel", boost::bind(&LLFloaterPermsDefault::onClickCancel, this));
+}
+
+
+// String equivalents of enum Categories - initialization order must match enum order!
+const std::string LLFloaterPermsDefault::sCategoryNames[CAT_LAST] =
+{
+ "Objects",
+ "Uploads",
+ "Scripts",
+ "Notecards",
+ "Gestures",
+ "Wearables"
+};
+
+BOOL LLFloaterPermsDefault::postBuild()
+{
+ if(!gSavedSettings.getBOOL("DefaultUploadPermissionsConverted"))
+ {
+ gSavedSettings.setBOOL("UploadsEveryoneCopy", gSavedSettings.getBOOL("EveryoneCopy"));
+ gSavedSettings.setBOOL("UploadsNextOwnerCopy", gSavedSettings.getBOOL("NextOwnerCopy"));
+ gSavedSettings.setBOOL("UploadsNextOwnerModify", gSavedSettings.getBOOL("NextOwnerModify"));
+ gSavedSettings.setBOOL("UploadsNextOwnerTransfer", gSavedSettings.getBOOL("NextOwnerTransfer"));
+ gSavedSettings.setBOOL("UploadsShareWithGroup", gSavedSettings.getBOOL("ShareWithGroup"));
+ gSavedSettings.setBOOL("DefaultUploadPermissionsConverted", true);
+ }
+
+ mCloseSignal.connect(boost::bind(&LLFloaterPermsDefault::cancel, this));
+
refresh();
- return TRUE;
+ return true;
}
-void LLFloaterPerms::onClickOK()
+void LLFloaterPermsDefault::onClickOK()
{
ok();
closeFloater();
}
-void LLFloaterPerms::onClickCancel()
+void LLFloaterPermsDefault::onClickCancel()
{
cancel();
closeFloater();
}
-void LLFloaterPerms::onCommitCopy()
+void LLFloaterPermsDefault::onCommitCopy(const LLSD& user_data)
{
// Implements fair use
- BOOL copyable = gSavedSettings.getBOOL("NextOwnerCopy");
+ std::string prefix = user_data.asString();
+
+ BOOL copyable = gSavedSettings.getBOOL(prefix+"NextOwnerCopy");
if(!copyable)
{
- gSavedSettings.setBOOL("NextOwnerTransfer", TRUE);
+ gSavedSettings.setBOOL(prefix+"NextOwnerTransfer", TRUE);
}
- LLCheckBoxCtrl* xfer = getChild<LLCheckBoxCtrl>("next_owner_transfer");
+ LLCheckBoxCtrl* xfer = getChild<LLCheckBoxCtrl>(prefix+"_transfer");
xfer->setEnabled(copyable);
}
-void LLFloaterPerms::ok()
+class LLFloaterPermsResponder : public LLHTTPClient::Responder
{
- refresh(); // Changes were already applied to saved settings. Refreshing internal values makes it official.
-}
+public:
+ LLFloaterPermsResponder(): LLHTTPClient::Responder() {}
+private:
+ static std::string sPreviousReason;
+
+ void error(U32 status, const std::string& reason)
+ {
+ // Do not display the same error more than once in a row
+ if (reason != sPreviousReason)
+ {
+ sPreviousReason = reason;
+ LLSD args;
+ args["REASON"] = reason;
+ LLNotificationsUtil::add("DefaultObjectPermissions", args);
+ }
+ }
+ void result(const LLSD& content)
+ {
+ // Since we have had a successful POST call be sure to display the next error message
+ // even if it is the same as a previous one.
+ sPreviousReason = "";
+ LLFloaterPermsDefault::setCapSent(true);
+ LL_INFOS("FloaterPermsResponder") << "Sent default permissions to simulator" << LL_ENDL;
+ }
+};
+
+ std::string LLFloaterPermsResponder::sPreviousReason;
-void LLFloaterPerms::cancel()
+void LLFloaterPermsDefault::sendInitialPerms()
{
- gSavedSettings.setBOOL("ShareWithGroup", mShareWithGroup);
- gSavedSettings.setBOOL("EveryoneCopy", mEveryoneCopy);
- gSavedSettings.setBOOL("NextOwnerCopy", mNextOwnerCopy);
- gSavedSettings.setBOOL("NextOwnerModify", mNextOwnerModify);
- gSavedSettings.setBOOL("NextOwnerTransfer", mNextOwnerTransfer);
+ if(!mCapSent)
+ {
+ updateCap();
+ }
}
-void LLFloaterPerms::refresh()
+void LLFloaterPermsDefault::updateCap()
{
- mShareWithGroup = gSavedSettings.getBOOL("ShareWithGroup");
- mEveryoneCopy = gSavedSettings.getBOOL("EveryoneCopy");
- mNextOwnerCopy = gSavedSettings.getBOOL("NextOwnerCopy");
- mNextOwnerModify = gSavedSettings.getBOOL("NextOwnerModify");
- mNextOwnerTransfer = gSavedSettings.getBOOL("NextOwnerTransfer");
+ std::string object_url = gAgent.getRegion()->getCapability("AgentPreferences");
+
+ if(!object_url.empty())
+ {
+ LLSD report = LLSD::emptyMap();
+ report["default_object_perm_masks"]["Group"] =
+ (LLSD::Integer)LLFloaterPerms::getGroupPerms(sCategoryNames[CAT_OBJECTS]);
+ report["default_object_perm_masks"]["Everyone"] =
+ (LLSD::Integer)LLFloaterPerms::getEveryonePerms(sCategoryNames[CAT_OBJECTS]);
+ report["default_object_perm_masks"]["NextOwner"] =
+ (LLSD::Integer)LLFloaterPerms::getNextOwnerPerms(sCategoryNames[CAT_OBJECTS]);
+
+ LLHTTPClient::post(object_url, report, new LLFloaterPermsResponder());
+ }
}
-//static
-U32 LLFloaterPerms::getGroupPerms(std::string prefix)
-{
- return gSavedSettings.getBOOL(prefix+"ShareWithGroup") ? PERM_COPY : PERM_NONE;
+void LLFloaterPermsDefault::setCapSent(bool cap_sent)
+{
+ mCapSent = cap_sent;
}
-//static
-U32 LLFloaterPerms::getEveryonePerms(std::string prefix)
+void LLFloaterPermsDefault::ok()
{
- return gSavedSettings.getBOOL(prefix+"EveryoneCopy") ? PERM_COPY : PERM_NONE;
+// Changes were already applied automatically to saved settings.
+// Refreshing internal values makes it official.
+ refresh();
+
+// We know some setting has changed but not which one. Just in case it was a setting for
+// object permissions tell the server what the values are.
+ updateCap();
}
-//static
-U32 LLFloaterPerms::getNextOwnerPerms(std::string prefix)
+void LLFloaterPermsDefault::cancel()
{
- U32 flags = PERM_MOVE;
- if ( gSavedSettings.getBOOL(prefix+"NextOwnerCopy") )
+ for (U32 iter = CAT_OBJECTS; iter < CAT_LAST; iter++)
{
- flags |= PERM_COPY;
- }
- if ( gSavedSettings.getBOOL(prefix+"NextOwnerModify") )
- {
- flags |= PERM_MODIFY;
+ gSavedSettings.setBOOL(sCategoryNames[iter]+"NextOwnerCopy", mNextOwnerCopy[iter]);
+ gSavedSettings.setBOOL(sCategoryNames[iter]+"NextOwnerModify", mNextOwnerModify[iter]);
+ gSavedSettings.setBOOL(sCategoryNames[iter]+"NextOwnerTransfer", mNextOwnerTransfer[iter]);
+ gSavedSettings.setBOOL(sCategoryNames[iter]+"ShareWithGroup", mShareWithGroup[iter]);
+ gSavedSettings.setBOOL(sCategoryNames[iter]+"EveryoneCopy", mEveryoneCopy[iter]);
}
- if ( gSavedSettings.getBOOL(prefix+"NextOwnerTransfer") )
+}
+
+void LLFloaterPermsDefault::refresh()
+{
+ for (U32 iter = CAT_OBJECTS; iter < CAT_LAST; iter++)
{
- flags |= PERM_TRANSFER;
+ mShareWithGroup[iter] = gSavedSettings.getBOOL(sCategoryNames[iter]+"ShareWithGroup");
+ mEveryoneCopy[iter] = gSavedSettings.getBOOL(sCategoryNames[iter]+"EveryoneCopy");
+ mNextOwnerCopy[iter] = gSavedSettings.getBOOL(sCategoryNames[iter]+"NextOwnerCopy");
+ mNextOwnerModify[iter] = gSavedSettings.getBOOL(sCategoryNames[iter]+"NextOwnerModify");
+ mNextOwnerTransfer[iter] = gSavedSettings.getBOOL(sCategoryNames[iter]+"NextOwnerTransfer");
}
- return flags;
}
-
diff --git a/indra/newview/llfloaterperms.h b/indra/newview/llfloaterperms.h
index 6b65f4b0cd..2bb0a19dc1 100755
--- a/indra/newview/llfloaterperms.h
+++ b/indra/newview/llfloaterperms.h
@@ -1,7 +1,7 @@
/**
* @file llfloaterperms.h
* @brief Asset creation permission preferences.
- * @author Coco
+ * @author Jonathan Yap
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
@@ -36,26 +36,57 @@ class LLFloaterPerms : public LLFloater
public:
/*virtual*/ BOOL postBuild();
- void ok();
- void cancel();
- void onClickOK();
- void onClickCancel();
- void onCommitCopy();
+
// Convenience methods to get current permission preference bitfields from saved settings:
static U32 getEveryonePerms(std::string prefix=""); // prefix + "EveryoneCopy"
static U32 getGroupPerms(std::string prefix=""); // prefix + "ShareWithGroup"
static U32 getNextOwnerPerms(std::string prefix=""); // bitfield for prefix + "NextOwner" + "Copy", "Modify", and "Transfer"
+ static U32 getNextOwnerPermsInverted(std::string prefix="");
private:
LLFloaterPerms(const LLSD& seed);
+
+};
+
+class LLFloaterPermsDefault : public LLFloater
+{
+ friend class LLFloaterReg;
+
+public:
+ /*virtual*/ BOOL postBuild();
+ void ok();
+ void cancel();
+ void onClickOK();
+ void onClickCancel();
+ void onCommitCopy(const LLSD& user_data);
+ static void sendInitialPerms();
+ static void updateCap();
+ static void setCapSent(bool cap_sent);
+
+// Update instantiation of sCategoryNames in the .cpp file to match if you change this!
+enum Categories
+{
+ CAT_OBJECTS,
+ CAT_UPLOADS,
+ CAT_SCRIPTS,
+ CAT_NOTECARDS,
+ CAT_GESTURES,
+ CAT_WEARABLES,
+ CAT_LAST
+};
+
+private:
+ LLFloaterPermsDefault(const LLSD& seed);
void refresh();
- BOOL // cached values only for implementing cancel.
- mShareWithGroup,
- mEveryoneCopy,
- mNextOwnerCopy,
- mNextOwnerModify,
- mNextOwnerTransfer;
+ static const std::string sCategoryNames[CAT_LAST];
+
+ // cached values only for implementing cancel.
+ bool mShareWithGroup[CAT_LAST];
+ bool mEveryoneCopy[CAT_LAST];
+ bool mNextOwnerCopy[CAT_LAST];
+ bool mNextOwnerModify[CAT_LAST];
+ bool mNextOwnerTransfer[CAT_LAST];
};
#endif
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index b50a2e6f85..d3773767d0 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -37,7 +37,6 @@
#include "message.h"
#include "llfloaterautoreplacesettings.h"
#include "llagent.h"
-#include "llavatarconstants.h"
#include "llcheckboxctrl.h"
#include "llcolorswatch.h"
#include "llcombobox.h"
@@ -113,6 +112,10 @@
const F32 MAX_USER_FAR_CLIP = 512.f;
const F32 MIN_USER_FAR_CLIP = 64.f;
const F32 BANDWIDTH_UPDATER_TIMEOUT = 0.5f;
+char const* const VISIBILITY_DEFAULT = "default";
+char const* const VISIBILITY_HIDDEN = "hidden";
+char const* const VISIBILITY_VISIBLE = "visible";
+char const* const VISIBILITY_INVISIBLE = "invisible";
//control value for middle mouse as talk2push button
const static std::string MIDDLE_MOUSE_CV = "MiddleMouse";
@@ -347,6 +350,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
mCommitCallbackRegistrar.add("Pref.Proxy", boost::bind(&LLFloaterPreference::onClickProxySettings, this));
mCommitCallbackRegistrar.add("Pref.TranslationSettings", boost::bind(&LLFloaterPreference::onClickTranslationSettings, this));
mCommitCallbackRegistrar.add("Pref.AutoReplace", boost::bind(&LLFloaterPreference::onClickAutoReplace, this));
+ mCommitCallbackRegistrar.add("Pref.PermsDefault", boost::bind(&LLFloaterPreference::onClickPermsDefault, this));
mCommitCallbackRegistrar.add("Pref.SpellChecker", boost::bind(&LLFloaterPreference::onClickSpellChecker, this));
sSkin = gSavedSettings.getString("SkinCurrent");
@@ -752,6 +756,16 @@ void LLFloaterPreference::initDoNotDisturbResponse()
}
}
+//static
+void LLFloaterPreference::updateShowFavoritesCheckbox(bool val)
+{
+ LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences");
+ if (instance)
+ {
+ instance->getChild<LLUICtrl>("favorites_on_login_check")->setValue(val);
+ }
+}
+
void LLFloaterPreference::setHardwareDefaults()
{
LLFeatureManager::getInstance()->applyRecommendedSettings();
@@ -832,7 +846,7 @@ void LLFloaterPreference::onBtnOK()
else
{
// Show beep, pop up dialog, etc.
- llinfos << "Can't close preferences!" << llendl;
+ LL_INFOS() << "Can't close preferences!" << LL_ENDL;
}
LLPanelLogin::updateLocationSelectorsVisibility();
@@ -1188,6 +1202,9 @@ void LLFloaterPreference::refreshEnabledState()
disableUnavailableSettings();
getChildView("block_list")->setEnabled(LLLoginInstance::getInstance()->authSuccess());
+
+ // Cannot have floater active until caps have been received
+ getChild<LLButton>("default_creation_permissions")->setEnabled(LLStartUp::getStartupState() < STATE_STARTED ? false : true);
}
void LLFloaterPreference::disableUnavailableSettings()
@@ -1602,6 +1619,7 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im
getChildView("chat_font_size")->setEnabled(TRUE);
}
+
void LLFloaterPreference::refreshUI()
{
refresh();
@@ -1683,6 +1701,11 @@ void LLFloaterPreference::onClickActionChange()
mClickActionDirty = true;
}
+void LLFloaterPreference::onClickPermsDefault()
+{
+ LLFloaterReg::showInstance("perms_default");
+}
+
void LLFloaterPreference::onDeleteTranscripts()
{
LLSD args;
@@ -1889,6 +1912,8 @@ BOOL LLPanelPreference::postBuild()
if (hasChild("favorites_on_login_check", TRUE))
{
getChild<LLCheckBoxCtrl>("favorites_on_login_check")->setCommitCallback(boost::bind(&showFavoritesOnLoginWarning, _1, _2));
+ bool show_favorites_at_login = LLPanelLogin::getShowFavorites();
+ getChild<LLCheckBoxCtrl>("favorites_on_login_check")->setValue(show_favorites_at_login);
}
//////////////////////PanelAdvanced ///////////////////
diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h
index cb180f6f1e..7bf6ae7d79 100755
--- a/indra/newview/llfloaterpreference.h
+++ b/indra/newview/llfloaterpreference.h
@@ -84,6 +84,9 @@ public:
// translate user's do not disturb response message according to current locale if message is default, otherwise do nothing
static void initDoNotDisturbResponse();
+ // update Show Favorites checkbox
+ static void updateShowFavoritesCheckbox(bool val);
+
void processProperties( void* pData, EAvatarProcessorType type );
void processProfileProperties(const LLAvatarData* pAvatarData );
void storeAvatarProperties( const LLAvatarData* pAvatarData );
@@ -164,6 +167,7 @@ public:
void onClickBlockList();
void onClickProxySettings();
void onClickTranslationSettings();
+ void onClickPermsDefault();
void onClickAutoReplace();
void onClickSpellChecker();
void applyUIColor(LLUICtrl* ctrl, const LLSD& param);
diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp
index 3f00ba39c7..a3bf99f054 100755
--- a/indra/newview/llfloaterproperties.cpp
+++ b/indra/newview/llfloaterproperties.cpp
@@ -561,7 +561,7 @@ void LLFloaterProperties::onClickOwner()
// static
void LLFloaterProperties::onCommitName()
{
- //llinfos << "LLFloaterProperties::onCommitName()" << llendl;
+ //LL_INFOS() << "LLFloaterProperties::onCommitName()" << LL_ENDL;
LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem();
if(!item)
{
@@ -597,7 +597,7 @@ void LLFloaterProperties::onCommitName()
void LLFloaterProperties::onCommitDescription()
{
- //llinfos << "LLFloaterProperties::onCommitDescription()" << llendl;
+ //LL_INFOS() << "LLFloaterProperties::onCommitDescription()" << LL_ENDL;
LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem();
if(!item) return;
@@ -635,7 +635,7 @@ void LLFloaterProperties::onCommitDescription()
// static
void LLFloaterProperties::onCommitPermissions()
{
- //llinfos << "LLFloaterProperties::onCommitPermissions()" << llendl;
+ //LL_INFOS() << "LLFloaterProperties::onCommitPermissions()" << LL_ENDL;
LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem();
if(!item) return;
LLPermissions perm(item->getPermissions());
@@ -732,14 +732,14 @@ void LLFloaterProperties::onCommitPermissions()
// static
void LLFloaterProperties::onCommitSaleInfo()
{
- //llinfos << "LLFloaterProperties::onCommitSaleInfo()" << llendl;
+ //LL_INFOS() << "LLFloaterProperties::onCommitSaleInfo()" << LL_ENDL;
updateSaleInfo();
}
// static
void LLFloaterProperties::onCommitSaleType()
{
- //llinfos << "LLFloaterProperties::onCommitSaleType()" << llendl;
+ //LL_INFOS() << "LLFloaterProperties::onCommitSaleType()" << LL_ENDL;
updateSaleInfo();
}
diff --git a/indra/newview/llfloaterregiondebugconsole.cpp b/indra/newview/llfloaterregiondebugconsole.cpp
index 3a7ca17b73..40757a4d04 100755
--- a/indra/newview/llfloaterregiondebugconsole.cpp
+++ b/indra/newview/llfloaterregiondebugconsole.cpp
@@ -73,24 +73,29 @@ namespace
// called if this request times out.
class AsyncConsoleResponder : public LLHTTPClient::Responder
{
- public:
+ LOG_CLASS(AsyncConsoleResponder);
+ protected:
/* virtual */
- void errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+ void httpFailure()
{
+ LL_WARNS("Console") << dumpResponse() << LL_ENDL;
sConsoleReplySignal(UNABLE_TO_SEND_COMMAND);
}
};
class ConsoleResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(ConsoleResponder);
public:
ConsoleResponder(LLTextEditor *output) : mOutput(output)
{
}
+ protected:
/*virtual*/
- void error(U32 status, const std::string& reason)
+ void httpFailure()
{
+ LL_WARNS("Console") << dumpResponse() << LL_ENDL;
if (mOutput)
{
mOutput->appendText(
@@ -100,8 +105,10 @@ namespace
}
/*virtual*/
- void result(const LLSD& content)
+ void httpSuccess()
{
+ const LLSD& content = getContent();
+ LL_DEBUGS("Console") << content << LL_ENDL;
if (mOutput)
{
mOutput->appendText(
@@ -109,6 +116,7 @@ namespace
}
}
+ public:
LLTextEditor * mOutput;
};
@@ -123,8 +131,8 @@ namespace
const LLSD& context,
const LLSD& input) const
{
- llinfos << "Received response from the debug console: "
- << input << llendl;
+ LL_INFOS() << "Received response from the debug console: "
+ << input << LL_ENDL;
sConsoleReplySignal(input["body"].asString());
}
};
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index 73c0963a1d..a2af9da670 100755
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -281,7 +281,7 @@ void LLFloaterRegionInfo::processEstateOwnerRequest(LLMessageSystem* msg,void**)
LLDispatcher::unpackMessage(msg, request, invoice, strings);
if(invoice != getLastInvoice())
{
- llwarns << "Mismatched Estate message: " << request << llendl;
+ LL_WARNS() << "Mismatched Estate message: " << request << LL_ENDL;
return;
}
@@ -366,6 +366,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
panel->getChild<LLUICtrl>("block_terraform_check")->setValue((region_flags & REGION_FLAGS_BLOCK_TERRAFORM) ? TRUE : FALSE );
panel->getChild<LLUICtrl>("block_fly_check")->setValue((region_flags & REGION_FLAGS_BLOCK_FLY) ? TRUE : FALSE );
+ panel->getChild<LLUICtrl>("block_fly_over_check")->setValue((region_flags & REGION_FLAGS_BLOCK_FLYOVER) ? TRUE : FALSE );
panel->getChild<LLUICtrl>("allow_damage_check")->setValue((region_flags & REGION_FLAGS_ALLOW_DAMAGE) ? TRUE : FALSE );
panel->getChild<LLUICtrl>("restrict_pushobject")->setValue((region_flags & REGION_FLAGS_RESTRICT_PUSHOBJECT) ? TRUE : FALSE );
panel->getChild<LLUICtrl>("allow_land_resell_check")->setValue((region_flags & REGION_FLAGS_BLOCK_LAND_RESELL) ? FALSE : TRUE );
@@ -480,6 +481,17 @@ void LLFloaterRegionInfo::refresh()
}
}
+void LLFloaterRegionInfo::enableTopButtons()
+{
+ getChildView("top_colliders_btn")->setEnabled(true);
+ getChildView("top_scripts_btn")->setEnabled(true);
+}
+
+void LLFloaterRegionInfo::disableTopButtons()
+{
+ getChildView("top_colliders_btn")->setEnabled(false);
+ getChildView("top_scripts_btn")->setEnabled(false);
+}
///----------------------------------------------------------------------------
/// Local class implementation
@@ -559,7 +571,7 @@ void LLPanelRegionInfo::sendEstateOwnerMessage(
const LLUUID& invoice,
const strings_t& strings)
{
- llinfos << "Sending estate request '" << request << "'" << llendl;
+ LL_INFOS() << "Sending estate request '" << request << "'" << LL_ENDL;
msg->newMessage("EstateOwnerMessage");
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
@@ -635,6 +647,7 @@ BOOL LLPanelRegionGeneralInfo::postBuild()
// Enable the "Apply" button if something is changed. JC
initCtrl("block_terraform_check");
initCtrl("block_fly_check");
+ initCtrl("block_fly_over_check");
initCtrl("allow_damage_check");
initCtrl("allow_land_resell_check");
initCtrl("allow_parcel_changes_check");
@@ -654,7 +667,7 @@ BOOL LLPanelRegionGeneralInfo::postBuild()
void LLPanelRegionGeneralInfo::onClickKick()
{
- llinfos << "LLPanelRegionGeneralInfo::onClickKick" << llendl;
+ LL_INFOS() << "LLPanelRegionGeneralInfo::onClickKick" << LL_ENDL;
// this depends on the grandparent view being a floater
// in order to set up floater dependency
@@ -691,7 +704,7 @@ void LLPanelRegionGeneralInfo::onKickCommit(const uuid_vec_t& ids)
// static
void LLPanelRegionGeneralInfo::onClickKickAll(void* userdata)
{
- llinfos << "LLPanelRegionGeneralInfo::onClickKickAll" << llendl;
+ LL_INFOS() << "LLPanelRegionGeneralInfo::onClickKickAll" << LL_ENDL;
LLNotificationsUtil::add("KickUsersFromRegion",
LLSD(),
LLSD(),
@@ -719,7 +732,7 @@ bool LLPanelRegionGeneralInfo::onKickAllCommit(const LLSD& notification, const L
// static
void LLPanelRegionGeneralInfo::onClickMessage(void* userdata)
{
- llinfos << "LLPanelRegionGeneralInfo::onClickMessage" << llendl;
+ LL_INFOS() << "LLPanelRegionGeneralInfo::onClickMessage" << LL_ENDL;
LLNotificationsUtil::add("MessageRegion",
LLSD(),
LLSD(),
@@ -734,7 +747,7 @@ bool LLPanelRegionGeneralInfo::onMessageCommit(const LLSD& notification, const L
std::string text = response["message"].asString();
if (text.empty()) return false;
- llinfos << "Message to everyone: " << text << llendl;
+ LL_INFOS() << "Message to everyone: " << text << LL_ENDL;
strings_t strings;
// [0] grid_x, unused here
// [1] grid_y, unused here
@@ -757,12 +770,12 @@ bool LLPanelRegionGeneralInfo::onMessageCommit(const LLSD& notification, const L
class ConsoleRequestResponder : public LLHTTPClient::Responder
{
-public:
+ LOG_CLASS(ConsoleRequestResponder);
+protected:
/*virtual*/
- void errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+ void httpFailure()
{
- llwarns << "ConsoleRequestResponder error requesting mesh_rez_enabled [status:"
- << status << "]: " << content << llendl;
+ LL_WARNS() << "error requesting mesh_rez_enabled " << dumpResponse() << LL_ENDL;
}
};
@@ -770,12 +783,12 @@ public:
// called if this request times out.
class ConsoleUpdateResponder : public LLHTTPClient::Responder
{
-public:
+ LOG_CLASS(ConsoleUpdateResponder);
+protected:
/* virtual */
- void errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+ void httpFailure()
{
- llwarns << "ConsoleRequestResponder error updating mesh enabled region setting [status:"
- << status << "]: " << content << llendl;
+ LL_WARNS() << "error updating mesh enabled region setting " << dumpResponse() << LL_ENDL;
}
};
@@ -807,7 +820,7 @@ void LLFloaterRegionInfo::requestMeshRezInfo()
// strings[9] = 'Y' - block parcel search, 'N' - allow
BOOL LLPanelRegionGeneralInfo::sendUpdate()
{
- llinfos << "LLPanelRegionGeneralInfo::sendUpdate()" << llendl;
+ LL_INFOS() << "LLPanelRegionGeneralInfo::sendUpdate()" << LL_ENDL;
// First try using a Cap. If that fails use the old method.
LLSD body;
@@ -816,6 +829,7 @@ BOOL LLPanelRegionGeneralInfo::sendUpdate()
{
body["block_terraform"] = getChild<LLUICtrl>("block_terraform_check")->getValue();
body["block_fly"] = getChild<LLUICtrl>("block_fly_check")->getValue();
+ body["block_fly_over"] = getChild<LLUICtrl>("block_fly_over_check")->getValue();
body["allow_damage"] = getChild<LLUICtrl>("allow_damage_check")->getValue();
body["allow_land_resell"] = getChild<LLUICtrl>("allow_land_resell_check")->getValue();
body["agent_limit"] = getChild<LLUICtrl>("agent_limit_spin")->getValue();
@@ -891,6 +905,7 @@ BOOL LLPanelRegionDebugInfo::postBuild()
childSetAction("top_scripts_btn", onClickTopScripts, this);
childSetAction("restart_btn", onClickRestart, this);
childSetAction("cancel_restart_btn", onClickCancelRestart, this);
+ childSetAction("region_debug_console_btn", onClickDebugConsole, this);
return TRUE;
}
@@ -912,6 +927,7 @@ bool LLPanelRegionDebugInfo::refreshFromRegion(LLViewerRegion* region)
getChildView("top_scripts_btn")->setEnabled(allow_modify);
getChildView("restart_btn")->setEnabled(allow_modify);
getChildView("cancel_restart_btn")->setEnabled(allow_modify);
+ getChildView("region_debug_console_btn")->setEnabled(allow_modify);
return LLPanelRegionInfo::refreshFromRegion(region);
}
@@ -919,7 +935,7 @@ bool LLPanelRegionDebugInfo::refreshFromRegion(LLViewerRegion* region)
// virtual
BOOL LLPanelRegionDebugInfo::sendUpdate()
{
- llinfos << "LLPanelRegionDebugInfo::sendUpdate" << llendl;
+ LL_INFOS() << "LLPanelRegionDebugInfo::sendUpdate" << LL_ENDL;
strings_t strings;
std::string buffer;
@@ -1028,6 +1044,11 @@ void LLPanelRegionDebugInfo::onClickTopColliders(void* data)
if(!instance) return;
LLFloaterReg::showInstance("top_objects");
instance->clearList();
+ instance->disableRefreshBtn();
+
+ self->getChildView("top_colliders_btn")->setEnabled(false);
+ self->getChildView("top_scripts_btn")->setEnabled(false);
+
self->sendEstateOwnerMessage(gMessageSystem, "colliders", invoice, strings);
}
@@ -1042,6 +1063,11 @@ void LLPanelRegionDebugInfo::onClickTopScripts(void* data)
if(!instance) return;
LLFloaterReg::showInstance("top_objects");
instance->clearList();
+ instance->disableRefreshBtn();
+
+ self->getChildView("top_colliders_btn")->setEnabled(false);
+ self->getChildView("top_scripts_btn")->setEnabled(false);
+
self->sendEstateOwnerMessage(gMessageSystem, "scripts", invoice, strings);
}
@@ -1074,6 +1100,11 @@ void LLPanelRegionDebugInfo::onClickCancelRestart(void* data)
self->sendEstateOwnerMessage(gMessageSystem, "restart", invoice, strings);
}
+// static
+void LLPanelRegionDebugInfo::onClickDebugConsole(void* data)
+{
+ LLFloaterReg::showInstance("region_debug_console");
+}
BOOL LLPanelRegionTerrainInfo::validateTextureSizes()
{
@@ -1091,7 +1122,7 @@ BOOL LLPanelRegionTerrainInfo::validateTextureSizes()
S32 width = img->getFullWidth();
S32 height = img->getFullHeight();
- //llinfos << "texture detail " << i << " is " << width << "x" << height << "x" << components << llendl;
+ //LL_INFOS() << "texture detail " << i << " is " << width << "x" << height << "x" << components << LL_ENDL;
if (components != 3)
{
@@ -1177,8 +1208,8 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region)
texture_ctrl = getChild<LLTextureCtrl>(buffer);
if(texture_ctrl)
{
- lldebugs << "Detail Texture " << i << ": "
- << compp->getDetailTextureID(i) << llendl;
+ LL_DEBUGS() << "Detail Texture " << i << ": "
+ << compp->getDetailTextureID(i) << LL_ENDL;
LLUUID tmp_id(compp->getDetailTextureID(i));
texture_ctrl->setImageAssetID(tmp_id);
}
@@ -1194,7 +1225,7 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region)
}
else
{
- lldebugs << "no region set" << llendl;
+ LL_DEBUGS() << "no region set" << LL_ENDL;
getChild<LLUICtrl>("region_text")->setValue(LLSD(""));
}
@@ -1209,7 +1240,7 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region)
// virtual
BOOL LLPanelRegionTerrainInfo::sendUpdate()
{
- llinfos << "LLPanelRegionTerrainInfo::sendUpdate" << llendl;
+ LL_INFOS() << "LLPanelRegionTerrainInfo::sendUpdate" << LL_ENDL;
std::string buffer;
strings_t strings;
LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
@@ -1278,7 +1309,7 @@ void LLPanelRegionTerrainInfo::onClickDownloadRaw(void* data)
LLFilePicker& picker = LLFilePicker::instance();
if (!picker.getSaveFile(LLFilePicker::FFSAVE_RAW, "terrain.raw"))
{
- llwarns << "No file" << llendl;
+ LL_WARNS() << "No file" << LL_ENDL;
return;
}
std::string filepath = picker.getFirstFile();
@@ -1298,7 +1329,7 @@ void LLPanelRegionTerrainInfo::onClickUploadRaw(void* data)
LLFilePicker& picker = LLFilePicker::instance();
if (!picker.getOpenFile(LLFilePicker::FFLOAD_RAW))
{
- llwarns << "No file" << llendl;
+ LL_WARNS() << "No file" << LL_ENDL;
return;
}
std::string filepath = picker.getFirstFile();
@@ -2048,7 +2079,7 @@ void LLPanelEstateInfo::updateChild(LLUICtrl* child_ctrl)
bool LLPanelEstateInfo::estateUpdate(LLMessageSystem* msg)
{
- llinfos << "LLPanelEstateInfo::estateUpdate()" << llendl;
+ LL_INFOS() << "LLPanelEstateInfo::estateUpdate()" << LL_ENDL;
return false;
}
@@ -2148,7 +2179,7 @@ void LLPanelEstateInfo::refreshFromEstate()
BOOL LLPanelEstateInfo::sendUpdate()
{
- llinfos << "LLPanelEsateInfo::sendUpdate()" << llendl;
+ LL_INFOS() << "LLPanelEsateInfo::sendUpdate()" << LL_ENDL;
LLNotification::Params params("ChangeLindenEstate");
params.functor.function(boost::bind(&LLPanelEstateInfo::callbackChangeLindenEstate, this, _1, _2));
@@ -2234,16 +2265,18 @@ void LLPanelEstateInfo::getEstateOwner()
class LLEstateChangeInfoResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(LLEstateChangeInfoResponder);
public:
LLEstateChangeInfoResponder(LLPanelEstateInfo* panel)
{
mpPanel = panel->getHandle();
}
+protected:
// if we get a normal response, handle it here
- virtual void result(const LLSD& content)
+ virtual void httpSuccess()
{
- LL_INFOS("Windlight") << "Successfully committed estate info" << llendl;
+ LL_INFOS("Windlight") << "Successfully committed estate info" << LL_ENDL;
// refresh the panel from the database
LLPanelEstateInfo* panel = dynamic_cast<LLPanelEstateInfo*>(mpPanel.get());
@@ -2252,10 +2285,9 @@ public:
}
// if we get an error response
- virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+ virtual void httpFailure()
{
- llinfos << "LLEstateChangeInfoResponder::error [status:"
- << status << "]: " << content << llendl;
+ LL_WARNS("Windlight") << dumpResponse() << LL_ENDL;
}
private:
LLHandle<LLPanel> mpPanel;
@@ -2290,7 +2322,7 @@ void LLPanelEstateInfo::clearAccessLists()
// static
void LLPanelEstateInfo::onClickMessageEstate(void* userdata)
{
- llinfos << "LLPanelEstateInfo::onClickMessageEstate" << llendl;
+ LL_INFOS() << "LLPanelEstateInfo::onClickMessageEstate" << LL_ENDL;
LLNotificationsUtil::add("MessageEstate", LLSD(), LLSD(), boost::bind(&LLPanelEstateInfo::onMessageCommit, (LLPanelEstateInfo*)userdata, _1, _2));
}
@@ -2300,7 +2332,7 @@ bool LLPanelEstateInfo::onMessageCommit(const LLSD& notification, const LLSD& re
std::string text = response["message"].asString();
if(option != 0) return false;
if(text.empty()) return false;
- llinfos << "Message to everyone: " << text << llendl;
+ LL_INFOS() << "Message to everyone: " << text << LL_ENDL;
strings_t strings;
//integers_t integers;
std::string name;
@@ -2377,7 +2409,7 @@ bool LLPanelEstateCovenant::refreshFromRegion(LLViewerRegion* region)
// virtual
bool LLPanelEstateCovenant::estateUpdate(LLMessageSystem* msg)
{
- llinfos << "LLPanelEstateCovenant::estateUpdate()" << llendl;
+ LL_INFOS() << "LLPanelEstateCovenant::estateUpdate()" << LL_ENDL;
return true;
}
@@ -2511,7 +2543,7 @@ void LLPanelEstateCovenant::onLoadComplete(LLVFS *vfs,
LLAssetType::EType type,
void* user_data, S32 status, LLExtStat ext_status)
{
- llinfos << "LLPanelEstateCovenant::onLoadComplete()" << llendl;
+ LL_INFOS() << "LLPanelEstateCovenant::onLoadComplete()" << LL_ENDL;
LLPanelEstateCovenant* panelp = (LLPanelEstateCovenant*)user_data;
if( panelp )
{
@@ -2530,7 +2562,7 @@ void LLPanelEstateCovenant::onLoadComplete(LLVFS *vfs,
{
if( !panelp->mEditor->importBuffer( &buffer[0], file_length+1 ) )
{
- llwarns << "Problem importing estate covenant." << llendl;
+ LL_WARNS() << "Problem importing estate covenant." << LL_ENDL;
LLNotificationsUtil::add("ProblemImportingEstateCovenant");
}
else
@@ -2546,8 +2578,6 @@ void LLPanelEstateCovenant::onLoadComplete(LLVFS *vfs,
}
else
{
- LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED );
-
if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ||
LL_ERR_FILE_EMPTY == status)
{
@@ -2562,7 +2592,7 @@ void LLPanelEstateCovenant::onLoadComplete(LLVFS *vfs,
LLNotificationsUtil::add("UnableToLoadNotecardAsset");
}
- llwarns << "Problem loading notecard: " << status << llendl;
+ LL_WARNS() << "Problem loading notecard: " << status << LL_ENDL;
}
panelp->mAssetStatus = ASSET_LOADED;
panelp->setCovenantID(asset_uuid);
@@ -2684,7 +2714,7 @@ bool LLDispatchEstateUpdateInfo::operator()(
const LLUUID& invoice,
const sparam_t& strings)
{
- lldebugs << "Received estate update" << llendl;
+ LL_DEBUGS() << "Received estate update" << LL_ENDL;
// Update estate info model.
// This will call LLPanelEstateInfo::refreshFromEstate().
@@ -2726,22 +2756,22 @@ bool LLDispatchSetEstateAccess::operator()(
if (num_allowed_agents > 0
&& !(access_flags & ESTATE_ACCESS_ALLOWED_AGENTS))
{
- llwarns << "non-zero count for allowed agents, but no corresponding flag" << llendl;
+ LL_WARNS() << "non-zero count for allowed agents, but no corresponding flag" << LL_ENDL;
}
if (num_allowed_groups > 0
&& !(access_flags & ESTATE_ACCESS_ALLOWED_GROUPS))
{
- llwarns << "non-zero count for allowed groups, but no corresponding flag" << llendl;
+ LL_WARNS() << "non-zero count for allowed groups, but no corresponding flag" << LL_ENDL;
}
if (num_banned_agents > 0
&& !(access_flags & ESTATE_ACCESS_BANNED_AGENTS))
{
- llwarns << "non-zero count for banned agents, but no corresponding flag" << llendl;
+ LL_WARNS() << "non-zero count for banned agents, but no corresponding flag" << LL_ENDL;
}
if (num_estate_managers > 0
&& !(access_flags & ESTATE_ACCESS_MANAGERS))
{
- llwarns << "non-zero count for managers, but no corresponding flag" << llendl;
+ LL_WARNS() << "non-zero count for managers, but no corresponding flag" << LL_ENDL;
}
// grab the UUID's out of the string fields
@@ -2924,7 +2954,7 @@ void LLPanelEnvironmentInfo::onOpen(const LLSD& key)
}
// virtual
-void LLPanelEnvironmentInfo::handleVisibilityChange(BOOL new_visibility)
+void LLPanelEnvironmentInfo::onVisibilityChange(BOOL new_visibility)
{
// If hiding (user switched to another tab or closed the floater),
// display user's preferred environment.
@@ -3049,7 +3079,7 @@ void LLPanelEnvironmentInfo::fixEstateSun()
LLEstateInfoModel& estate_info = LLEstateInfoModel::instance();
if (estate_info.getUseFixedSun())
{
- llinfos << "Switching estate to global sun" << llendl;
+ LL_INFOS() << "Switching estate to global sun" << LL_ENDL;
estate_info.setUseFixedSun(false);
estate_info.sendEstateInfo();
}
@@ -3190,7 +3220,7 @@ bool LLPanelEnvironmentInfo::getSelectedWaterParams(LLSD& water_params)
LLWaterParamSet param_set;
if (!LLWaterParamManager::instance().getParamSet(water_key.name, param_set))
{
- llwarns << "Error getting water preset: " << water_key.name << llendl;
+ LL_WARNS() << "Error getting water preset: " << water_key.name << LL_ENDL;
return false;
}
@@ -3209,7 +3239,7 @@ bool LLPanelEnvironmentInfo::getSelectedSkyParams(LLSD& sky_params, std::string&
LLWLParamSet param_set;
if (!LLWLParamManager::instance().getParamSet(preset, param_set))
{
- llwarns << "Error getting sky params: " << preset.toLLSD() << llendl;
+ LL_WARNS() << "Error getting sky params: " << preset.toLLSD() << LL_ENDL;
return false;
}
@@ -3234,7 +3264,7 @@ bool LLPanelEnvironmentInfo::getSelectedDayCycleParams(LLSD& day_cycle, LLSD& sk
{
if (!LLDayCycleManager::instance().getPreset(dc.name, day_cycle))
{
- llwarns << "Error getting day cycle " << dc.name << llendl;
+ LL_WARNS() << "Error getting day cycle " << dc.name << LL_ENDL;
return false;
}
@@ -3401,7 +3431,7 @@ void LLPanelEnvironmentInfo::onBtnApply()
new_region_settings.saveParams(day_cycle, sky_map, water_params, 0.0f);
if (!LLEnvManagerNew::instance().sendRegionSettings(new_region_settings))
{
- llwarns << "Error applying region environment settings" << llendl;
+ LL_WARNS() << "Error applying region environment settings" << LL_ENDL;
return;
}
diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h
index f0499f1903..792f60ebc8 100755
--- a/indra/newview/llfloaterregioninfo.h
+++ b/indra/newview/llfloaterregioninfo.h
@@ -96,6 +96,8 @@ public:
void requestRegionInfo();
void requestMeshRezInfo();
+ void enableTopButtons();
+ void disableTopButtons();
private:
@@ -209,6 +211,7 @@ protected:
static void onClickRestart(void* data);
bool callbackRestart(const LLSD& notification, const LLSD& response);
static void onClickCancelRestart(void* data);
+ static void onClickDebugConsole(void* data);
private:
LLUUID mTargetAvatar;
@@ -402,7 +405,7 @@ public:
/*virtual*/ void onOpen(const LLSD& key);
// LLView
- /*virtual*/ void handleVisibilityChange(BOOL new_visibility);
+ /*virtual*/ void onVisibilityChange(BOOL new_visibility);
// LLPanelRegionInfo
/*virtual*/ bool refreshFromRegion(LLViewerRegion* region);
diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp
index 35b63c5480..a3b9713e3e 100755
--- a/indra/newview/llfloaterreporter.cpp
+++ b/indra/newview/llfloaterreporter.cpp
@@ -460,7 +460,7 @@ void LLFloaterReporter::showFromMenu(EReportType report_type)
{
if (COMPLAINT_REPORT != report_type)
{
- llwarns << "Unknown LLViewerReporter type : " << report_type << llendl;
+ LL_WARNS() << "Unknown LLViewerReporter type : " << report_type << LL_ENDL;
return;
}
@@ -707,16 +707,18 @@ public:
class LLUserReportResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(LLUserReportResponder);
public:
LLUserReportResponder(): LLHTTPClient::Responder() {}
- void errorWithContent(U32 status, const std::string& reason, const LLSD& content)
- {
- // *TODO do some user messaging here
- LLUploadDialog::modalUploadFinished();
- }
- void result(const LLSD& content)
+private:
+ void httpCompleted()
{
+ if (!isGoodStatus())
+ {
+ // *TODO do some user messaging here
+ LL_WARNS("UserReport") << dumpResponse() << LL_ENDL;
+ }
// we don't care about what the server returns
LLUploadDialog::modalUploadFinished();
}
@@ -746,7 +748,7 @@ void LLFloaterReporter::takeScreenshot()
LLPointer<LLImageRaw> raw = new LLImageRaw;
if( !gViewerWindow->rawSnapshot(raw, IMAGE_WIDTH, IMAGE_HEIGHT, TRUE, FALSE, TRUE, FALSE))
{
- llwarns << "Unable to take screenshot" << llendl;
+ LL_WARNS() << "Unable to take screenshot" << LL_ENDL;
return;
}
LLPointer<LLImageJ2C> upload_data = LLViewerTextureList::convertToUploadFile(raw);
@@ -765,7 +767,7 @@ void LLFloaterReporter::takeScreenshot()
}
else
{
- llwarns << "Unknown LLFloaterReporter type" << llendl;
+ LL_WARNS() << "Unknown LLFloaterReporter type" << LL_ENDL;
}
mResourceDatap->mAssetInfo.mCreatorID = gAgentID;
mResourceDatap->mAssetInfo.setName("screenshot_name");
@@ -784,7 +786,7 @@ void LLFloaterReporter::takeScreenshot()
image_in_list->createGLTexture(0, raw, 0, TRUE, LLGLTexture::OTHER);
// the texture picker then uses that texture
- LLTexturePicker* texture = getChild<LLTextureCtrl>("screenshot");
+ LLTextureCtrl* texture = getChild<LLTextureCtrl>("screenshot");
if (texture)
{
texture->setImageAssetID(mResourceDatap->mAssetInfo.mUuid);
@@ -796,11 +798,11 @@ void LLFloaterReporter::takeScreenshot()
void LLFloaterReporter::uploadImage()
{
- llinfos << "*** Uploading: " << llendl;
- llinfos << "Type: " << LLAssetType::lookup(mResourceDatap->mAssetInfo.mType) << llendl;
- llinfos << "UUID: " << mResourceDatap->mAssetInfo.mUuid << llendl;
- llinfos << "Name: " << mResourceDatap->mAssetInfo.getName() << llendl;
- llinfos << "Desc: " << mResourceDatap->mAssetInfo.getDescription() << llendl;
+ LL_INFOS() << "*** Uploading: " << LL_ENDL;
+ LL_INFOS() << "Type: " << LLAssetType::lookup(mResourceDatap->mAssetInfo.mType) << LL_ENDL;
+ LL_INFOS() << "UUID: " << mResourceDatap->mAssetInfo.mUuid << LL_ENDL;
+ LL_INFOS() << "Name: " << mResourceDatap->mAssetInfo.getName() << LL_ENDL;
+ LL_INFOS() << "Desc: " << mResourceDatap->mAssetInfo.getDescription() << LL_ENDL;
gAssetStorage->storeAssetData(mResourceDatap->mAssetInfo.mTransactionID,
mResourceDatap->mAssetInfo.mType,
@@ -824,20 +826,20 @@ void LLFloaterReporter::uploadDoneCallback(const LLUUID &uuid, void *user_data,
std::string err_msg("There was a problem uploading a report screenshot");
err_msg += " due to the following reason: " + args["REASON"].asString();
- llwarns << err_msg << llendl;
+ LL_WARNS() << err_msg << LL_ENDL;
return;
}
if (data->mPreferredLocation != LLResourceData::INVALID_LOCATION)
{
- llwarns << "Unknown report type : " << data->mPreferredLocation << llendl;
+ LL_WARNS() << "Unknown report type : " << data->mPreferredLocation << LL_ENDL;
}
LLFloaterReporter *self = LLFloaterReg::findTypedInstance<LLFloaterReporter>("reporter");
if (self)
{
self->mScreenID = uuid;
- llinfos << "Got screen shot " << uuid << llendl;
+ LL_INFOS() << "Got screen shot " << uuid << LL_ENDL;
self->sendReportViaLegacy(self->gatherReport());
self->closeFloater();
}
diff --git a/indra/newview/llfloatersceneloadstats.cpp b/indra/newview/llfloatersceneloadstats.cpp
new file mode 100644
index 0000000000..8aa93eae96
--- /dev/null
+++ b/indra/newview/llfloatersceneloadstats.cpp
@@ -0,0 +1,40 @@
+/**
+ * @file llfloatersceneloadstats.cpp
+ * @author Richard Nelson
+ * @brief debug floater for measuring various scene load statistics
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2013, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llfloatersceneloadstats.h"
+
+
+LLFloaterSceneLoadStats::LLFloaterSceneLoadStats( const LLSD& key )
+: LLFloater(key)
+{}
+
+BOOL LLFloaterSceneLoadStats::postBuild()
+{
+ return TRUE;
+}
diff --git a/indra/llcommon/lloptioninterface.h b/indra/newview/llfloatersceneloadstats.h
index 93b465db32..aa414bf544 100755..100644
--- a/indra/llcommon/lloptioninterface.h
+++ b/indra/newview/llfloatersceneloadstats.h
@@ -1,10 +1,10 @@
/**
- * @file lloptioninterface.h
- * @brief
+ * @file llfloatersceneloadstats.h
+ * @brief debug floater for measuring various scene load statistics
*
- * $LicenseInfo:firstyear=2009&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
+ * Copyright (C) 2013, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -24,17 +24,20 @@
* $/LicenseInfo$
*/
-#ifndef LL_LLOPTIONINTERFACE_H
-#define LL_LLOPTIONINTERFACE_H
+#ifndef LL_FLOATERSCENELOADSTATS_H
+#define LL_FLOATERSCENELOADSTATS_H
-#include "linden_common.h"
+#include "llfloater.h"
-class LLSD;
-class LLOptionInterface
+class LLFloaterSceneLoadStats : public LLFloater
{
+ friend class LLFloaterReg;
+private:
+ LLFloaterSceneLoadStats(const LLSD& key);
+
public:
- virtual ~LLOptionInterface() = 0;
- virtual LLSD getOption(const std::string& name) const = 0;
+ BOOL postBuild();
+
};
-#endif
+#endif // LL_FLOATERSCENELOADSTATS_H
diff --git a/indra/newview/llfloaterscriptedprefs.cpp b/indra/newview/llfloaterscriptedprefs.cpp
new file mode 100644
index 0000000000..2484a08626
--- /dev/null
+++ b/indra/newview/llfloaterscriptedprefs.cpp
@@ -0,0 +1,65 @@
+/**
+ * @file llfloaterscriptedprefs.cpp
+ * @brief Color controls for the script editor
+ * @author Cinder Roxley
+ *
+ * $LicenseInfo:firstyear=2006&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2014, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+#include "llfloaterscriptedprefs.h"
+
+#include "llcolorswatch.h"
+#include "llscripteditor.h"
+
+
+LLFloaterScriptEdPrefs::LLFloaterScriptEdPrefs(const LLSD& key)
+: LLFloater(key)
+, mEditor(NULL)
+{
+ mCommitCallbackRegistrar.add("ScriptPref.applyUIColor", boost::bind(&LLFloaterScriptEdPrefs::applyUIColor, this ,_1, _2));
+ mCommitCallbackRegistrar.add("ScriptPref.getUIColor", boost::bind(&LLFloaterScriptEdPrefs::getUIColor, this ,_1, _2));
+}
+
+BOOL LLFloaterScriptEdPrefs::postBuild()
+{
+ mEditor = getChild<LLScriptEditor>("Script Preview");
+ if (mEditor)
+ {
+ mEditor->initKeywords();
+ mEditor->loadKeywords();
+ }
+ return TRUE;
+}
+
+void LLFloaterScriptEdPrefs::applyUIColor(LLUICtrl* ctrl, const LLSD& param)
+{
+ LLUIColorTable::instance().setColor(param.asString(), LLColor4(ctrl->getValue()));
+ mEditor->initKeywords();
+ mEditor->loadKeywords();
+}
+
+void LLFloaterScriptEdPrefs::getUIColor(LLUICtrl* ctrl, const LLSD& param)
+{
+ LLColorSwatchCtrl* color_swatch = dynamic_cast<LLColorSwatchCtrl*>(ctrl);
+ color_swatch->setOriginal(LLUIColorTable::instance().getColor(param.asString()));
+}
diff --git a/indra/llcommon/reflectivet.h b/indra/newview/llfloaterscriptedprefs.h
index 958921f23e..31df897aac 100755..100644
--- a/indra/llcommon/reflectivet.h
+++ b/indra/newview/llfloaterscriptedprefs.h
@@ -1,48 +1,51 @@
-/**
- * @file reflectivet.h
+/**
+ * @file llfloaterscriptedprefs.h
+ * @brief Color controls for the script editor
+ * @author Cinder Roxley
*
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
+ * Copyright (C) 2014, Linden Research, Inc.
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-#ifndef LL_REFLECTIVET_H
-#define LL_REFLECTIVET_H
+#ifndef LL_FLOATERSCRIPTEDPREFS_H
+#define LL_FLOATERSCRIPTEDPREFS_H
+
+#include "llfloater.h"
-#include "reflective.h"
+class LLScriptEditor;
+class LLUICtrl;
-template <class T>
-class LLReflectiveT : public LLReflective
+class LLFloaterScriptEdPrefs : public LLFloater
{
public:
-
- LLReflectiveT(const T& value) : mValue(value) {;}
- virtual ~LLReflectiveT() {;}
+ LLFloaterScriptEdPrefs(const LLSD& key);
+ BOOL postBuild();
- virtual const LLMetaClass& getMetaClass() const {return LLMetaClassT<LLReflectiveT<T> >::instance();}
+private:
+ ~LLFloaterScriptEdPrefs() {};
- const T& getValue() const {return mValue;}
+ void applyUIColor(LLUICtrl* ctrl, const LLSD& param);
+ void getUIColor(LLUICtrl* ctrl, const LLSD& param);
-private:
-
- T mValue;
+ LLScriptEditor* mEditor;
};
-#endif
+#endif // LL_FLOATERSCRIPTEDPREFS_H
diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp
index 13cb3c2eb0..5fbdd75e97 100755
--- a/indra/newview/llfloaterscriptlimits.cpp
+++ b/indra/newview/llfloaterscriptlimits.cpp
@@ -58,7 +58,7 @@
// debug switches, won't work in release
#ifndef LL_RELEASE_FOR_DOWNLOAD
-// dump responder replies to llinfos for debugging
+// dump responder replies to LL_INFOS() for debugging
//#define DUMP_REPLIES_TO_LLINFOS
#ifdef DUMP_REPLIES_TO_LLINFOS
@@ -106,7 +106,7 @@ BOOL LLFloaterScriptLimits::postBuild()
if(!mTab)
{
- llwarns << "Error! couldn't get scriptlimits_panels, aborting Script Information setup" << llendl;
+ LL_WARNS() << "Error! couldn't get scriptlimits_panels, aborting Script Information setup" << LL_ENDL;
return FALSE;
}
@@ -183,8 +183,14 @@ void LLPanelScriptLimitsInfo::updateChild(LLUICtrl* child_ctr)
// Responders
///----------------------------------------------------------------------------
-void fetchScriptLimitsRegionInfoResponder::result(const LLSD& content)
+void fetchScriptLimitsRegionInfoResponder::httpSuccess()
{
+ const LLSD& content = getContent();
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
//we don't need to test with a fake respose here (shouldn't anyway)
#ifdef DUMP_REPLIES_TO_LLINFOS
@@ -195,7 +201,7 @@ void fetchScriptLimitsRegionInfoResponder::result(const LLSD& content)
OSMessageBox(nice_llsd.str(), "main cap response:", 0);
- llinfos << "main cap response:" << content << llendl;
+ LL_INFOS() << "main cap response:" << content << LL_ENDL;
#endif
@@ -210,7 +216,7 @@ void fetchScriptLimitsRegionInfoResponder::result(const LLSD& content)
LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits");
if(!instance)
{
- llwarns << "Failed to get llfloaterscriptlimits instance" << llendl;
+ LL_WARNS() << "Failed to get llfloaterscriptlimits instance" << LL_ENDL;
}
}
@@ -221,13 +227,14 @@ void fetchScriptLimitsRegionInfoResponder::result(const LLSD& content)
}
}
-void fetchScriptLimitsRegionInfoResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+void fetchScriptLimitsRegionInfoResponder::httpFailure()
{
- llwarns << "fetchScriptLimitsRegionInfoResponder error [status:" << status << "]: " << content << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
}
-void fetchScriptLimitsRegionSummaryResponder::result(const LLSD& content_ref)
+void fetchScriptLimitsRegionSummaryResponder::httpSuccess()
{
+ const LLSD& content_ref = getContent();
#ifdef USE_FAKE_RESPONSES
LLSD fake_content;
@@ -268,6 +275,12 @@ void fetchScriptLimitsRegionSummaryResponder::result(const LLSD& content_ref)
#endif
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
+
#ifdef DUMP_REPLIES_TO_LLINFOS
@@ -277,21 +290,21 @@ void fetchScriptLimitsRegionSummaryResponder::result(const LLSD& content_ref)
OSMessageBox(nice_llsd.str(), "summary response:", 0);
- llwarns << "summary response:" << *content << llendl;
+ LL_WARNS() << "summary response:" << *content << LL_ENDL;
#endif
LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits");
if(!instance)
{
- llwarns << "Failed to get llfloaterscriptlimits instance" << llendl;
+ LL_WARNS() << "Failed to get llfloaterscriptlimits instance" << LL_ENDL;
}
else
{
LLTabContainer* tab = instance->getChild<LLTabContainer>("scriptlimits_panels");
if(tab)
{
- LLPanelScriptLimitsRegionMemory* panel_memory = (LLPanelScriptLimitsRegionMemory*)tab->getChild<LLPanel>("script_limits_region_memory_panel");
+ LLPanelScriptLimitsRegionMemory* panel_memory = (LLPanelScriptLimitsRegionMemory*)tab->getChild<LLPanel>("script_limits_region_memory_panel");
if(panel_memory)
{
panel_memory->getChild<LLUICtrl>("loading_text")->setValue(LLSD(std::string("")));
@@ -301,20 +314,21 @@ void fetchScriptLimitsRegionSummaryResponder::result(const LLSD& content_ref)
{
btn->setEnabled(true);
}
-
- panel_memory->setRegionSummary(content);
- }
-}
+
+ panel_memory->setRegionSummary(content);
+ }
+ }
}
}
-void fetchScriptLimitsRegionSummaryResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+void fetchScriptLimitsRegionSummaryResponder::httpFailure()
{
- llwarns << "fetchScriptLimitsRegionSummaryResponder error [status:" << status << "]: " << content << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
}
-void fetchScriptLimitsRegionDetailsResponder::result(const LLSD& content_ref)
+void fetchScriptLimitsRegionDetailsResponder::httpSuccess()
{
+ const LLSD& content_ref = getContent();
#ifdef USE_FAKE_RESPONSES
/*
Updated detail service, ** denotes field added:
@@ -377,6 +391,12 @@ result (map)
#endif
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
+
#ifdef DUMP_REPLIES_TO_LLINFOS
LLSDNotationStreamer notation_streamer(content);
@@ -385,7 +405,7 @@ result (map)
OSMessageBox(nice_llsd.str(), "details response:", 0);
- llinfos << "details response:" << content << llendl;
+ LL_INFOS() << "details response:" << content << LL_ENDL;
#endif
@@ -393,7 +413,7 @@ result (map)
if(!instance)
{
- llwarns << "Failed to get llfloaterscriptlimits instance" << llendl;
+ LL_WARNS() << "Failed to get llfloaterscriptlimits instance" << LL_ENDL;
}
else
{
@@ -407,23 +427,24 @@ result (map)
}
else
{
- llwarns << "Failed to get scriptlimits memory panel" << llendl;
+ LL_WARNS() << "Failed to get scriptlimits memory panel" << LL_ENDL;
}
}
else
{
- llwarns << "Failed to get scriptlimits_panels" << llendl;
+ LL_WARNS() << "Failed to get scriptlimits_panels" << LL_ENDL;
}
}
}
-void fetchScriptLimitsRegionDetailsResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+void fetchScriptLimitsRegionDetailsResponder::httpFailure()
{
- llwarns << "fetchScriptLimitsRegionDetailsResponder error [status:" << status << "]: " << content << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
}
-void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref)
+void fetchScriptLimitsAttachmentInfoResponder::httpSuccess()
{
+ const LLSD& content_ref = getContent();
#ifdef USE_FAKE_RESPONSES
@@ -465,6 +486,12 @@ void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref)
#endif
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
+
#ifdef DUMP_REPLIES_TO_LLINFOS
LLSDNotationStreamer notation_streamer(content);
@@ -473,7 +500,7 @@ void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref)
OSMessageBox(nice_llsd.str(), "attachment response:", 0);
- llinfos << "attachment response:" << content << llendl;
+ LL_INFOS() << "attachment response:" << content << LL_ENDL;
#endif
@@ -481,7 +508,7 @@ void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref)
if(!instance)
{
- llwarns << "Failed to get llfloaterscriptlimits instance" << llendl;
+ LL_WARNS() << "Failed to get llfloaterscriptlimits instance" << LL_ENDL;
}
else
{
@@ -503,19 +530,19 @@ void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref)
}
else
{
- llwarns << "Failed to get script_limits_my_avatar_panel" << llendl;
+ LL_WARNS() << "Failed to get script_limits_my_avatar_panel" << LL_ENDL;
}
}
else
{
- llwarns << "Failed to get scriptlimits_panels" << llendl;
+ LL_WARNS() << "Failed to get scriptlimits_panels" << LL_ENDL;
}
}
}
-void fetchScriptLimitsAttachmentInfoResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+void fetchScriptLimitsAttachmentInfoResponder::httpFailure()
{
- llwarns << "fetchScriptLimitsAttachmentInfoResponder error [status:" << status << "]: " << content << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
}
///----------------------------------------------------------------------------
@@ -586,9 +613,9 @@ void LLPanelScriptLimitsRegionMemory::setParcelID(const LLUUID& parcel_id)
}
// virtual
-void LLPanelScriptLimitsRegionMemory::setErrorStatus(U32 status, const std::string& reason)
+void LLPanelScriptLimitsRegionMemory::setErrorStatus(S32 status, const std::string& reason)
{
- llwarns << "Can't handle remote parcel request."<< " Http Status: "<< status << ". Reason : "<< reason<<llendl;
+ LL_WARNS() << "Can't handle remote parcel request."<< " Http Status: "<< status << ". Reason : "<< reason<<LL_ENDL;
}
// callback from the name cache with an owner name to add to the list
@@ -627,7 +654,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content)
if(!list)
{
- llwarns << "Error getting the scripts_list control" << llendl;
+ LL_WARNS() << "Error getting the scripts_list control" << LL_ENDL;
return;
}
@@ -800,7 +827,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionSummary(LLSD content)
}
else
{
- llwarns << "summary doesn't contain memory info" << llendl;
+ LL_WARNS() << "summary doesn't contain memory info" << LL_ENDL;
return;
}
@@ -818,7 +845,7 @@ void LLPanelScriptLimitsRegionMemory::setRegionSummary(LLSD content)
}
else
{
- llwarns << "summary doesn't contain urls info" << llendl;
+ LL_WARNS() << "summary doesn't contain urls info" << LL_ENDL;
return;
}
@@ -922,9 +949,9 @@ BOOL LLPanelScriptLimitsRegionMemory::StartRequestChain()
}
else
{
- llwarns << "Can't get parcel info for script information request" << region_id
+ LL_WARNS() << "Can't get parcel info for script information request" << region_id
<< ". Region: " << region->getName()
- << " does not support RemoteParcelRequest" << llendl;
+ << " does not support RemoteParcelRequest" << LL_ENDL;
std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestError");
getChild<LLUICtrl>("loading_text")->setValue(LLSD(msg_waiting));
@@ -990,7 +1017,7 @@ void LLPanelScriptLimitsRegionMemory::onClickRefresh(void* userdata)
}
else
{
- llwarns << "could not find LLPanelScriptLimitsRegionMemory instance after refresh button clicked" << llendl;
+ LL_WARNS() << "could not find LLPanelScriptLimitsRegionMemory instance after refresh button clicked" << LL_ENDL;
return;
}
}
@@ -1036,7 +1063,7 @@ void LLPanelScriptLimitsRegionMemory::onClickHighlight(void* userdata)
}
else
{
- llwarns << "could not find LLPanelScriptLimitsRegionMemory instance after highlight button clicked" << llendl;
+ LL_WARNS() << "could not find LLPanelScriptLimitsRegionMemory instance after highlight button clicked" << LL_ENDL;
return;
}
}
@@ -1141,7 +1168,7 @@ void LLPanelScriptLimitsRegionMemory::onClickReturn(void* userdata)
}
else
{
- llwarns << "could not find LLPanelScriptLimitsRegionMemory instance after highlight button clicked" << llendl;
+ LL_WARNS() << "could not find LLPanelScriptLimitsRegionMemory instance after highlight button clicked" << LL_ENDL;
return;
}
}
@@ -1273,7 +1300,7 @@ void LLPanelScriptLimitsAttachment::setAttachmentSummary(LLSD content)
}
else
{
- llwarns << "attachment details don't contain memory summary info" << llendl;
+ LL_WARNS() << "attachment details don't contain memory summary info" << LL_ENDL;
return;
}
@@ -1291,7 +1318,7 @@ void LLPanelScriptLimitsAttachment::setAttachmentSummary(LLSD content)
}
else
{
- llwarns << "attachment details don't contain urls summary info" << llendl;
+ LL_WARNS() << "attachment details don't contain urls summary info" << LL_ENDL;
return;
}
@@ -1343,7 +1370,7 @@ void LLPanelScriptLimitsAttachment::onClickRefresh(void* userdata)
}
else
{
- llwarns << "could not find LLPanelScriptLimitsRegionMemory instance after refresh button clicked" << llendl;
+ LL_WARNS() << "could not find LLPanelScriptLimitsRegionMemory instance after refresh button clicked" << LL_ENDL;
return;
}
}
diff --git a/indra/newview/llfloaterscriptlimits.h b/indra/newview/llfloaterscriptlimits.h
index f8732ef94b..a5cb1b6184 100755
--- a/indra/newview/llfloaterscriptlimits.h
+++ b/indra/newview/llfloaterscriptlimits.h
@@ -85,49 +85,49 @@ protected:
class fetchScriptLimitsRegionInfoResponder: public LLHTTPClient::Responder
{
- public:
- fetchScriptLimitsRegionInfoResponder(const LLSD& info) : mInfo(info) {};
-
- void result(const LLSD& content);
- void errorWithContent(U32 status, const std::string& reason, const LLSD& content);
- public:
- protected:
- LLSD mInfo;
+ LOG_CLASS(fetchScriptLimitsRegionInfoResponder);
+public:
+ fetchScriptLimitsRegionInfoResponder(const LLSD& info) : mInfo(info) {};
+
+private:
+ /* virtual */ void httpSuccess();
+ /* virtual */ void httpFailure();
+ LLSD mInfo;
};
class fetchScriptLimitsRegionSummaryResponder: public LLHTTPClient::Responder
{
- public:
- fetchScriptLimitsRegionSummaryResponder(const LLSD& info) : mInfo(info) {};
-
- void result(const LLSD& content);
- void errorWithContent(U32 status, const std::string& reason, const LLSD& content);
- public:
- protected:
- LLSD mInfo;
+ LOG_CLASS(fetchScriptLimitsRegionSummaryResponder);
+public:
+ fetchScriptLimitsRegionSummaryResponder(const LLSD& info) : mInfo(info) {};
+
+private:
+ /* virtual */ void httpSuccess();
+ /* virtual */ void httpFailure();
+ LLSD mInfo;
};
class fetchScriptLimitsRegionDetailsResponder: public LLHTTPClient::Responder
{
- public:
- fetchScriptLimitsRegionDetailsResponder(const LLSD& info) : mInfo(info) {};
-
- void result(const LLSD& content);
- void errorWithContent(U32 status, const std::string& reason, const LLSD& content);
- public:
- protected:
- LLSD mInfo;
+ LOG_CLASS(fetchScriptLimitsRegionDetailsResponder);
+public:
+ fetchScriptLimitsRegionDetailsResponder(const LLSD& info) : mInfo(info) {};
+
+private:
+ /* virtual */ void httpSuccess();
+ /* virtual */ void httpFailure();
+ LLSD mInfo;
};
class fetchScriptLimitsAttachmentInfoResponder: public LLHTTPClient::Responder
{
- public:
- fetchScriptLimitsAttachmentInfoResponder() {};
+ LOG_CLASS(fetchScriptLimitsAttachmentInfoResponder);
+public:
+ fetchScriptLimitsAttachmentInfoResponder() {};
- void result(const LLSD& content);
- void errorWithContent(U32 status, const std::string& reason, const LLSD& content);
- public:
- protected:
+private:
+ /* virtual */ void httpSuccess();
+ /* virtual */ void httpFailure();
};
/////////////////////////////////////////////////////////////////////////////
@@ -190,7 +190,7 @@ protected:
// LLRemoteParcelInfoObserver interface:
/*virtual*/ void processParcelInfo(const LLParcelData& parcel_data);
/*virtual*/ void setParcelID(const LLUUID& parcel_id);
-/*virtual*/ void setErrorStatus(U32 status, const std::string& reason);
+/*virtual*/ void setErrorStatus(S32 status, const std::string& reason);
static void onClickRefresh(void* userdata);
static void onClickHighlight(void* userdata);
diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp
index 2a946b1edf..a446b767ac 100755
--- a/indra/newview/llfloatersearch.cpp
+++ b/indra/newview/llfloatersearch.cpp
@@ -30,6 +30,7 @@
#include "llcommandhandler.h"
#include "llfloaterreg.h"
#include "llfloatersearch.h"
+#include "llhttpconstants.h"
#include "llmediactrl.h"
#include "llnotificationsutil.h"
#include "lllogininstance.h"
@@ -200,5 +201,5 @@ void LLFloaterSearch::search(const SearchQuery &p)
url = LLWeb::expandURLSubstitutions(url, subs);
// and load the URL in the web view
- mWebBrowser->navigateTo(url, "text/html");
+ mWebBrowser->navigateTo(url, HTTP_CONTENT_TEXT_HTML);
}
diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp
index 07f5220ab7..fb202b4c40 100755
--- a/indra/newview/llfloatersettingsdebug.cpp
+++ b/indra/newview/llfloatersettingsdebug.cpp
@@ -194,8 +194,8 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp)
if (!spinner1 || !spinner2 || !spinner3 || !spinner4 || !color_swatch)
{
- llwarns << "Could not find all desired controls by name"
- << llendl;
+ LL_WARNS() << "Could not find all desired controls by name"
+ << LL_ENDL;
return;
}
diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp
index c5248719e9..aee20ff706 100755
--- a/indra/newview/llfloatersidepanelcontainer.cpp
+++ b/indra/newview/llfloatersidepanelcontainer.cpp
@@ -57,7 +57,7 @@ void LLFloaterSidePanelContainer::onOpen(const LLSD& key)
getChild<LLPanel>(sMainPanelName)->onOpen(key);
}
-void LLFloaterSidePanelContainer::onClickCloseBtn(bool)
+void LLFloaterSidePanelContainer::closeFloater(bool app_quitting)
{
LLPanelOutfitEdit* panel_outfit_edit =
dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit"));
@@ -75,7 +75,7 @@ void LLFloaterSidePanelContainer::onClickCloseBtn(bool)
}
}
- LLFloater::onClickCloseBtn();
+ LLFloater::closeFloater(app_quitting);
}
LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_name, const LLSD& params)
diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h
index 65ec8f604e..d7ecd52e57 100755
--- a/indra/newview/llfloatersidepanelcontainer.h
+++ b/indra/newview/llfloatersidepanelcontainer.h
@@ -51,7 +51,7 @@ public:
/*virtual*/ void onOpen(const LLSD& key);
- /*virtual*/ void onClickCloseBtn(bool app_quitting = false);
+ /*virtual*/ void closeFloater(bool app_quitting = false);
LLPanel* openChildPanel(const std::string& panel_name, const LLSD& params);
@@ -74,7 +74,7 @@ public:
T* panel = dynamic_cast<T*>(getPanel(floater_name, panel_name));
if (!panel)
{
- llwarns << "Child named \"" << panel_name << "\" of type " << typeid(T*).name() << " not found" << llendl;
+ LL_WARNS() << "Child named \"" << panel_name << "\" of type " << typeid(T*).name() << " not found" << LL_ENDL;
}
return panel;
}
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index ea385d7baf..8677028942 100755
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -31,7 +31,10 @@
#include "llagent.h"
#include "llfacebookconnect.h"
#include "llfloaterreg.h"
-#include "llfloatersocial.h"
+#include "llfloaterfacebook.h"
+#include "llfloaterflickr.h"
+#include "llfloatertwitter.h"
+#include "llimagefiltersmanager.h"
#include "llcheckboxctrl.h"
#include "llcombobox.h"
#include "llpostcard.h"
@@ -44,7 +47,6 @@
#include "lltoolfocus.h"
#include "lltoolmgr.h"
#include "llwebprofile.h"
-#include "llwebsharing.h"
///----------------------------------------------------------------------------
/// Local function declarations, constants, enums, and typedefs
@@ -60,7 +62,6 @@ const S32 MAX_TEXTURE_SIZE = 512 ; //max upload texture size 512 * 512
static LLDefaultChildRegistry::Register<LLSnapshotFloaterView> r("snapshot_floater_view");
-
///----------------------------------------------------------------------------
/// Class LLFloaterSnapshot::Impl
///----------------------------------------------------------------------------
@@ -92,8 +93,8 @@ public:
}
static void onClickNewSnapshot(void* data);
static void onClickAutoSnap(LLUICtrl *ctrl, void* data);
+ static void onClickFilter(LLUICtrl *ctrl, void* data);
//static void onClickAdvanceSnap(LLUICtrl *ctrl, void* data);
- static void onClickMore(void* data) ;
static void onClickUICheck(LLUICtrl *ctrl, void* data);
static void onClickHUDCheck(LLUICtrl *ctrl, void* data);
static void applyKeepAspectCheck(LLFloaterSnapshot* view, BOOL checked);
@@ -261,29 +262,34 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp)
BOOL advanced = gSavedSettings.getBOOL("AdvanceSnapshot");
- // Show/hide advanced options.
- LLPanel* advanced_options_panel = floaterp->getChild<LLPanel>("advanced_options_panel");
- floaterp->getChild<LLButton>("advanced_options_btn")->setImageOverlay(advanced ? "TabIcon_Open_Off" : "TabIcon_Close_Off");
- if (advanced != advanced_options_panel->getVisible())
+ //BD - Automatically calculate the size of our snapshot window to enlarge
+ // the snapshot preview to its maximum size, this is especially helpfull
+ // for pretty much every aspect ratio other than 1:1.
+ F32 panel_width = 400.f * gViewerWindow->getWorldViewAspectRatio();
+
+ //BD - Make sure we clamp at 700 here because 700 would be for 16:9 which we
+ // consider the maximum. Everything bigger will be clamped and will have
+ // a slightly smaller preview window which most likely won't fill up the
+ // whole snapshot floater as it should.
+ if(panel_width > 700.f)
{
- S32 panel_width = advanced_options_panel->getRect().getWidth();
- floaterp->getChild<LLPanel>("advanced_options_panel")->setVisible(advanced);
- S32 floater_width = floaterp->getRect().getWidth();
- floater_width += (advanced ? panel_width : -panel_width);
- floaterp->reshape(floater_width, floaterp->getRect().getHeight());
+ panel_width = 700.f;
}
- if(!advanced) //set to original window resolution
+ S32 floater_width = 224.f;
+ if(advanced)
{
- previewp->mKeepAspectRatio = TRUE;
-
- floaterp->getChild<LLComboBox>("profile_size_combo")->setCurrentByIndex(0);
- floaterp->getChild<LLComboBox>("postcard_size_combo")->setCurrentByIndex(0);
- floaterp->getChild<LLComboBox>("texture_size_combo")->setCurrentByIndex(0);
- floaterp->getChild<LLComboBox>("local_size_combo")->setCurrentByIndex(0);
+ floater_width = floater_width + panel_width;
+ }
- LLSnapshotLivePreview* previewp = getPreviewView(floaterp);
- previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw());
+ LLUICtrl* thumbnail_placeholder = floaterp->getChild<LLUICtrl>("thumbnail_placeholder");
+ thumbnail_placeholder->setVisible(advanced);
+ thumbnail_placeholder->reshape(panel_width, thumbnail_placeholder->getRect().getHeight());
+ floaterp->getChild<LLUICtrl>("image_res_text")->setVisible(advanced);
+ floaterp->getChild<LLUICtrl>("file_size_label")->setVisible(advanced);
+ if(!floaterp->isMinimized())
+ {
+ floaterp->reshape(floater_width, floaterp->getRect().getHeight());
}
bool use_freeze_frame = floaterp->getChild<LLUICtrl>("freeze_frame_check")->getValue().asBoolean();
@@ -360,10 +366,6 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
ESnapshotFormat shot_format = (ESnapshotFormat)gSavedSettings.getS32("SnapshotFormat");
LLViewerWindow::ESnapshotType layer_type = getLayerType(floater);
-#if 0
- floater->getChildView("share_to_web")->setVisible( gSavedSettings.getBOOL("SnapshotSharingEnabled"));
-#endif
-
floater->getChild<LLComboBox>("local_format_combo")->selectNthItem(gSavedSettings.getS32("SnapshotFormat"));
enableAspectRatioCheckbox(floater, !floater->impl.mAspectRatioCheckOff);
setAspectRatioCheckboxValue(floater, gSavedSettings.getBOOL("KeepAspectForSnapshot"));
@@ -379,17 +381,17 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
if (width_ctrl->getValue().asInteger() == 0)
{
S32 w = gViewerWindow->getWindowWidthRaw();
- lldebugs << "Initializing width spinner (" << width_ctrl->getName() << "): " << w << llendl;
+ LL_DEBUGS() << "Initializing width spinner (" << width_ctrl->getName() << "): " << w << LL_ENDL;
width_ctrl->setValue(w);
}
if (height_ctrl->getValue().asInteger() == 0)
{
S32 h = gViewerWindow->getWindowHeightRaw();
- lldebugs << "Initializing height spinner (" << height_ctrl->getName() << "): " << h << llendl;
+ LL_DEBUGS() << "Initializing height spinner (" << height_ctrl->getName() << "): " << h << LL_ENDL;
height_ctrl->setValue(h);
}
- // Сlamp snapshot resolution to window size when showing UI or HUD in snapshot.
+ // Clamp snapshot resolution to window size when showing UI or HUD in snapshot.
if (gSavedSettings.getBOOL("RenderUIInSnapshot") || gSavedSettings.getBOOL("RenderHUDInSnapshot"))
{
S32 width = gViewerWindow->getWindowWidthRaw();
@@ -420,7 +422,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
BOOL got_snap = previewp && previewp->getSnapshotUpToDate();
// *TODO: Separate maximum size for Web images from postcards
- lldebugs << "Is snapshot up-to-date? " << got_snap << llendl;
+ LL_DEBUGS() << "Is snapshot up-to-date? " << got_snap << LL_ENDL;
LLLocale locale(LLLocale::USER_LOCALE);
std::string bytes_string;
@@ -434,9 +436,8 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
image_res_tb->setVisible(got_snap);
if (got_snap)
{
- LLPointer<LLImageRaw> img = previewp->getEncodedImage();
- image_res_tb->setTextArg("[WIDTH]", llformat("%d", img->getWidth()));
- image_res_tb->setTextArg("[HEIGHT]", llformat("%d", img->getHeight()));
+ image_res_tb->setTextArg("[WIDTH]", llformat("%d", previewp->getEncodedImageWidth()));
+ image_res_tb->setTextArg("[HEIGHT]", llformat("%d", previewp->getEncodedImageHeight()));
}
floater->getChild<LLUICtrl>("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : floater->getString("unknown"));
@@ -469,8 +470,8 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
default:
break;
}
-
- if (previewp)
+
+ if (previewp)
{
previewp->setSnapshotType(shot_type);
previewp->setSnapshotFormat(shot_format);
@@ -484,7 +485,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
info["have-snapshot"] = got_snap;
current_panel->updateControls(info);
}
- lldebugs << "finished updating controls" << llendl;
+ LL_DEBUGS() << "finished updating controls" << LL_ENDL;
}
// static
@@ -531,7 +532,7 @@ void LLFloaterSnapshot::Impl::checkAutoSnapshot(LLSnapshotLivePreview* previewp,
if (previewp)
{
BOOL autosnap = gSavedSettings.getBOOL("AutoSnapshot");
- lldebugs << "updating " << (autosnap ? "snapshot" : "thumbnail") << llendl;
+ LL_DEBUGS() << "updating " << (autosnap ? "snapshot" : "thumbnail") << LL_ENDL;
previewp->updateSnapshot(autosnap, update_thumbnail, autosnap ? AUTO_SNAPSHOT_TIME_DELAY : 0.f);
}
}
@@ -544,7 +545,7 @@ void LLFloaterSnapshot::Impl::onClickNewSnapshot(void* data)
if (previewp && view)
{
view->impl.setStatus(Impl::STATUS_READY);
- lldebugs << "updating snapshot" << llendl;
+ LL_DEBUGS() << "updating snapshot" << LL_ENDL;
previewp->updateSnapshot(TRUE);
}
}
@@ -563,17 +564,23 @@ void LLFloaterSnapshot::Impl::onClickAutoSnap(LLUICtrl *ctrl, void* data)
}
}
-void LLFloaterSnapshot::Impl::onClickMore(void* data)
+// static
+void LLFloaterSnapshot::Impl::onClickFilter(LLUICtrl *ctrl, void* data)
{
- BOOL visible = gSavedSettings.getBOOL("AdvanceSnapshot");
-
LLFloaterSnapshot *view = (LLFloaterSnapshot *)data;
if (view)
{
- view->impl.setStatus(Impl::STATUS_READY);
- gSavedSettings.setBOOL("AdvanceSnapshot", !visible);
- updateControls(view) ;
- updateLayout(view) ;
+ updateControls(view);
+ LLSnapshotLivePreview* previewp = getPreviewView(view);
+ if (previewp)
+ {
+ checkAutoSnapshot(previewp);
+ // Note : index 0 of the filter drop down is assumed to be "No filter" in whichever locale
+ LLComboBox* filterbox = static_cast<LLComboBox *>(view->getChild<LLComboBox>("filters_combobox"));
+ std::string filter_name = (filterbox->getCurrentIndex() ? filterbox->getSimple() : "");
+ previewp->setFilter(filter_name);
+ previewp->updateSnapshot(TRUE);
+ }
}
}
@@ -621,9 +628,9 @@ void LLFloaterSnapshot::Impl::applyKeepAspectCheck(LLFloaterSnapshot* view, BOOL
previewp->getSize(w, h) ;
updateSpinners(view, previewp, w, h, TRUE); // may change w and h
- lldebugs << "updating thumbnail" << llendl;
+ LL_DEBUGS() << "updating thumbnail" << LL_ENDL;
previewp->setSize(w, h) ;
- previewp->updateSnapshot(FALSE, TRUE);
+ previewp->updateSnapshot(TRUE);
checkAutoSnapshot(previewp, TRUE);
}
}
@@ -754,10 +761,16 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL
S32 original_width = 0 , original_height = 0 ;
previewp->getSize(original_width, original_height) ;
+ if (gSavedSettings.getBOOL("RenderUIInSnapshot") || gSavedSettings.getBOOL("RenderHUDInSnapshot"))
+ { //clamp snapshot resolution to window size when showing UI or HUD in snapshot
+ width = llmin(width, gViewerWindow->getWindowWidthRaw());
+ height = llmin(height, gViewerWindow->getWindowHeightRaw());
+ }
+
if (width == 0 || height == 0)
{
// take resolution from current window size
- lldebugs << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << llendl;
+ LL_DEBUGS() << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << LL_ENDL;
previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw());
}
else if (width == -1 || height == -1)
@@ -767,7 +780,7 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL
LLPanelSnapshot* spanel = getActivePanel(view);
if (spanel)
{
- lldebugs << "Loading typed res from panel " << spanel->getName() << llendl;
+ LL_DEBUGS() << "Loading typed res from panel " << spanel->getName() << LL_ENDL;
new_width = spanel->getTypedPreviewWidth();
new_height = spanel->getTypedPreviewHeight();
@@ -780,8 +793,8 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL
}
else
{
- lldebugs << "No custom res chosen, setting preview res from window: "
- << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << llendl;
+ LL_DEBUGS() << "No custom res chosen, setting preview res from window: "
+ << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << LL_ENDL;
new_width = gViewerWindow->getWindowWidthRaw();
new_height = gViewerWindow->getWindowHeightRaw();
}
@@ -792,21 +805,19 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL
else
{
// use the resolution from the selected pre-canned drop-down choice
- lldebugs << "Setting preview res selected from combo: " << width << "x" << height << llendl;
+ LL_DEBUGS() << "Setting preview res selected from combo: " << width << "x" << height << LL_ENDL;
previewp->setSize(width, height);
}
checkAspectRatio(view, width) ;
previewp->getSize(width, height);
-
- if (gSavedSettings.getBOOL("RenderUIInSnapshot") || gSavedSettings.getBOOL("RenderHUDInSnapshot"))
- { //clamp snapshot resolution to window size when showing UI or HUD in snapshot
- width = llmin(width, gViewerWindow->getWindowWidthRaw());
- height = llmin(height, gViewerWindow->getWindowHeightRaw());
- }
- updateSpinners(view, previewp, width, height, TRUE); // may change width and height
+ // We use the height spinner here because we come here via the aspect ratio
+ // checkbox as well and we want height always changing to width by default.
+ // If we use the width spinner we would change width according to height by
+ // default, that is not what we want.
+ updateSpinners(view, previewp, width, height, !getHeightSpinner(view)->isDirty()); // may change width and height
if(getWidthSpinner(view)->getValue().asInteger() != width || getHeightSpinner(view)->getValue().asInteger() != height)
{
@@ -820,13 +831,12 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL
// hide old preview as the aspect ratio could be wrong
checkAutoSnapshot(previewp, FALSE);
- lldebugs << "updating thumbnail" << llendl;
- getPreviewView(view)->updateSnapshot(FALSE, TRUE);
+ LL_DEBUGS() << "updating thumbnail" << LL_ENDL;
+ getPreviewView(view)->updateSnapshot(TRUE);
if(do_update)
{
- lldebugs << "Will update controls" << llendl;
+ LL_DEBUGS() << "Will update controls" << LL_ENDL;
updateControls(view);
- setNeedRefresh(view, true);
}
}
}
@@ -858,7 +868,6 @@ void LLFloaterSnapshot::Impl::onImageQualityChange(LLFloaterSnapshot* view, S32
{
previewp->setSnapshotQuality(quality_val);
}
- checkAutoSnapshot(previewp, TRUE);
}
// static
@@ -867,10 +876,9 @@ void LLFloaterSnapshot::Impl::onImageFormatChange(LLFloaterSnapshot* view)
if (view)
{
gSavedSettings.setS32("SnapshotFormat", getImageFormat(view));
- lldebugs << "image format changed, updating snapshot" << llendl;
+ LL_DEBUGS() << "image format changed, updating snapshot" << LL_ENDL;
getPreviewView(view)->updateSnapshot(TRUE);
updateControls(view);
- setNeedRefresh(view, false); // we're refreshing
}
}
@@ -939,6 +947,8 @@ void LLFloaterSnapshot::Impl::setImageSizeSpinnersValues(LLFloaterSnapshot *view
// static
void LLFloaterSnapshot::Impl::updateSpinners(LLFloaterSnapshot* view, LLSnapshotLivePreview* previewp, S32& width, S32& height, BOOL is_width_changed)
{
+ getWidthSpinner(view)->resetDirty();
+ getHeightSpinner(view)->resetDirty();
if (checkImageSize(previewp, width, height, is_width_changed, previewp->getMaxImageSize()))
{
setImageSizeSpinnersValues(view, width, height);
@@ -948,9 +958,7 @@ void LLFloaterSnapshot::Impl::updateSpinners(LLFloaterSnapshot* view, LLSnapshot
// static
void LLFloaterSnapshot::Impl::applyCustomResolution(LLFloaterSnapshot* view, S32 w, S32 h)
{
- bool need_refresh = false;
-
- lldebugs << "applyCustomResolution(" << w << ", " << h << ")" << llendl;
+ LL_DEBUGS() << "applyCustomResolution(" << w << ", " << h << ")" << LL_ENDL;
if (!view) return;
LLSnapshotLivePreview* previewp = getPreviewView(view);
@@ -964,25 +972,16 @@ void LLFloaterSnapshot::Impl::applyCustomResolution(LLFloaterSnapshot* view, S32
//if to upload a snapshot, process spinner input in a special way.
previewp->setMaxImageSize((S32) getWidthSpinner(view)->getMaxValue()) ;
- updateSpinners(view, previewp, w, h, w != curw); // may change w and h
-
previewp->setSize(w,h);
checkAutoSnapshot(previewp, FALSE);
- lldebugs << "applied custom resolution, updating thumbnail" << llendl;
- previewp->updateSnapshot(FALSE, TRUE);
comboSetCustom(view, "profile_size_combo");
comboSetCustom(view, "postcard_size_combo");
comboSetCustom(view, "texture_size_combo");
comboSetCustom(view, "local_size_combo");
- need_refresh = true;
+ LL_DEBUGS() << "applied custom resolution, updating thumbnail" << LL_ENDL;
+ previewp->updateSnapshot(TRUE);
}
}
-
- updateControls(view);
- if (need_refresh)
- {
- setNeedRefresh(view, true); // need to do this after updateControls()
- }
}
// static
@@ -1032,20 +1031,12 @@ LLFloaterSnapshot::~LLFloaterSnapshot()
BOOL LLFloaterSnapshot::postBuild()
{
- // Kick start Web Sharing, to fetch its config data if it needs to.
- if (gSavedSettings.getBOOL("SnapshotSharingEnabled"))
- {
- LLWebSharing::instance().init();
- }
-
mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn");
childSetAction("new_snapshot_btn", Impl::onClickNewSnapshot, this);
mRefreshLabel = getChild<LLUICtrl>("refresh_lbl");
mSucceessLblPanel = getChild<LLUICtrl>("succeeded_panel");
mFailureLblPanel = getChild<LLUICtrl>("failed_panel");
- childSetAction("advanced_options_btn", Impl::onClickMore, this);
-
childSetCommitCallback("ui_check", Impl::onClickUICheck, this);
getChild<LLUICtrl>("ui_check")->setValue(gSavedSettings.getBOOL("RenderUIInSnapshot"));
@@ -1063,7 +1054,17 @@ BOOL LLFloaterSnapshot::postBuild()
getChild<LLUICtrl>("auto_snapshot_check")->setValue(gSavedSettings.getBOOL("AutoSnapshot"));
childSetCommitCallback("auto_snapshot_check", Impl::onClickAutoSnap, this);
-
+
+
+ // Filters
+ LLComboBox* filterbox = getChild<LLComboBox>("filters_combobox");
+ std::vector<std::string> filter_list = LLImageFiltersManager::getInstance()->getFiltersList();
+ for (U32 i = 0; i < filter_list.size(); i++)
+ {
+ filterbox->add(filter_list[i]);
+ }
+ childSetCommitCallback("filters_combobox", Impl::onClickFilter, this);
+
LLWebProfile::setImageUploadResultCallback(boost::bind(&LLFloaterSnapshot::Impl::onSnapshotUploadFinished, _1));
LLPostCard::setPostResultCallback(boost::bind(&LLFloaterSnapshot::Impl::onSendingPostcardFinished, _1));
@@ -1089,10 +1090,11 @@ BOOL LLFloaterSnapshot::postBuild()
getChild<LLComboBox>("profile_size_combo")->selectNthItem(0);
getChild<LLComboBox>("postcard_size_combo")->selectNthItem(0);
getChild<LLComboBox>("texture_size_combo")->selectNthItem(0);
- getChild<LLComboBox>("local_size_combo")->selectNthItem(0);
+ getChild<LLComboBox>("local_size_combo")->selectNthItem(8);
getChild<LLComboBox>("local_format_combo")->selectNthItem(0);
impl.mPreviewHandle = previewp->getHandle();
+ previewp->setContainer(this);
impl.updateControls(this);
impl.updateLayout(this);
@@ -1114,7 +1116,7 @@ void LLFloaterSnapshot::draw()
LLFloater::draw();
- if (previewp && !isMinimized())
+ if (previewp && !isMinimized() && sThumbnailPlaceholder->getVisible())
{
if(previewp->getThumbnailImage())
{
@@ -1141,44 +1143,13 @@ void LLFloaterSnapshot::draw()
previewp->drawPreviewRect(offset_x, offset_y) ;
- // Draw some controls on top of the preview thumbnail.
- static const S32 PADDING = 5;
- static const S32 REFRESH_LBL_BG_HEIGHT = 32;
-
- // Reshape and position the posting result message panels at the top of the thumbnail.
- // Do this regardless of current posting status (finished or not) to avoid flicker
- // when the result message is displayed for the first time.
- // if (impl.getStatus() == Impl::STATUS_FINISHED)
- {
- LLRect result_lbl_rect = mSucceessLblPanel->getRect();
- const S32 result_lbl_h = result_lbl_rect.getHeight();
- result_lbl_rect.setLeftTopAndSize(local_offset_x, local_offset_y + thumbnail_h, thumbnail_w - 1, result_lbl_h);
- mSucceessLblPanel->reshape(result_lbl_rect.getWidth(), result_lbl_h);
- mSucceessLblPanel->setRect(result_lbl_rect);
- mFailureLblPanel->reshape(result_lbl_rect.getWidth(), result_lbl_h);
- mFailureLblPanel->setRect(result_lbl_rect);
- }
-
- // Position the refresh button in the bottom left corner of the thumbnail.
- mRefreshBtn->setOrigin(local_offset_x + PADDING, local_offset_y + PADDING);
-
- if (impl.mNeedRefresh)
- {
- // Place the refresh hint text to the right of the refresh button.
- const LLRect& refresh_btn_rect = mRefreshBtn->getRect();
- mRefreshLabel->setOrigin(refresh_btn_rect.mLeft + refresh_btn_rect.getWidth() + PADDING, refresh_btn_rect.mBottom);
-
- // Draw the refresh hint background.
- LLRect refresh_label_bg_rect(offset_x, offset_y + REFRESH_LBL_BG_HEIGHT, offset_x + thumbnail_w - 1, offset_y);
- gl_rect_2d(refresh_label_bg_rect, LLColor4::white % 0.9f, TRUE);
- }
-
gGL.pushUIMatrix();
LLUI::translate((F32) thumbnail_rect.mLeft, (F32) thumbnail_rect.mBottom);
sThumbnailPlaceholder->draw();
gGL.popUIMatrix();
}
}
+ impl.updateLayout(this);
}
void LLFloaterSnapshot::onOpen(const LLSD& key)
@@ -1186,7 +1157,7 @@ void LLFloaterSnapshot::onOpen(const LLSD& key)
LLSnapshotLivePreview* preview = LLFloaterSnapshot::Impl::getPreviewView(this);
if(preview)
{
- lldebugs << "opened, updating snapshot" << llendl;
+ LL_DEBUGS() << "opened, updating snapshot" << LL_ENDL;
preview->updateSnapshot(TRUE);
}
focusFirstItem(FALSE);
@@ -1194,6 +1165,9 @@ void LLFloaterSnapshot::onOpen(const LLSD& key)
gSnapshotFloaterView->setVisible(TRUE);
gSnapshotFloaterView->adjustToFitScreen(this, FALSE);
+ impl.updateControls(this);
+ impl.updateLayout(this);
+
// Initialize default tab.
getChild<LLSideTrayPanelContainer>("panel_container")->getCurrentPanel()->onOpen(LLSD());
}
@@ -1257,20 +1231,46 @@ S32 LLFloaterSnapshot::notify(const LLSD& info)
impl.setStatus(Impl::STATUS_FINISHED, data["ok"].asBoolean(), data["msg"].asString());
return 1;
}
+
+ if (info.has("snapshot-updating"))
+ {
+ // Disable the send/post/save buttons until snapshot is ready.
+ impl.updateControls(this);
+ return 1;
+ }
+
+ if (info.has("snapshot-updated"))
+ {
+ // Enable the send/post/save buttons.
+ impl.updateControls(this);
+ // We've just done refresh.
+ impl.setNeedRefresh(this, false);
+
+ // The refresh button is initially hidden. We show it after the first update,
+ // i.e. when preview appears.
+ if (!mRefreshBtn->getVisible())
+ {
+ mRefreshBtn->setVisible(true);
+ }
+ return 1;
+ }
+
return 0;
}
//static
void LLFloaterSnapshot::update()
{
- LLFloaterSnapshot* inst = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot");
- LLFloaterSocial* floater_social = LLFloaterReg::findTypedInstance<LLFloaterSocial>("social");
+ LLFloaterSnapshot* inst = findInstance();
+ LLFloaterFacebook* floater_facebook = LLFloaterReg::findTypedInstance<LLFloaterFacebook>("facebook");
+ LLFloaterFlickr* floater_flickr = LLFloaterReg::findTypedInstance<LLFloaterFlickr>("flickr");
+ LLFloaterTwitter* floater_twitter = LLFloaterReg::findTypedInstance<LLFloaterTwitter>("twitter");
- if (!inst && !floater_social)
+ if (!inst && !floater_facebook && !floater_flickr && !floater_twitter)
return;
BOOL changed = FALSE;
- lldebugs << "npreviews: " << LLSnapshotLivePreview::sList.size() << llendl;
+ LL_DEBUGS() << "npreviews: " << LLSnapshotLivePreview::sList.size() << LL_ENDL;
for (std::set<LLSnapshotLivePreview*>::iterator iter = LLSnapshotLivePreview::sList.begin();
iter != LLSnapshotLivePreview::sList.end(); ++iter)
{
@@ -1279,7 +1279,7 @@ void LLFloaterSnapshot::update()
if (inst && changed)
{
- lldebugs << "changed" << llendl;
+ LL_DEBUGS() << "changed" << LL_ENDL;
inst->impl.updateControls(inst);
}
}
@@ -1291,12 +1291,18 @@ LLFloaterSnapshot* LLFloaterSnapshot::getInstance()
}
// static
+LLFloaterSnapshot* LLFloaterSnapshot::findInstance()
+{
+ return LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot");
+}
+
+// static
void LLFloaterSnapshot::saveTexture()
{
- lldebugs << "saveTexture" << llendl;
+ LL_DEBUGS() << "saveTexture" << LL_ENDL;
// FIXME: duplicated code
- LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot");
+ LLFloaterSnapshot* instance = findInstance();
if (!instance)
{
llassert(instance != NULL);
@@ -1315,9 +1321,9 @@ void LLFloaterSnapshot::saveTexture()
// static
BOOL LLFloaterSnapshot::saveLocal()
{
- lldebugs << "saveLocal" << llendl;
+ LL_DEBUGS() << "saveLocal" << LL_ENDL;
// FIXME: duplicated code
- LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot");
+ LLFloaterSnapshot* instance = findInstance();
if (!instance)
{
llassert(instance != NULL);
@@ -1334,46 +1340,9 @@ BOOL LLFloaterSnapshot::saveLocal()
}
// static
-void LLFloaterSnapshot::preUpdate()
-{
- // FIXME: duplicated code
- LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot");
- if (instance)
- {
- // Disable the send/post/save buttons until snapshot is ready.
- Impl::updateControls(instance);
-
- // Force hiding the "Refresh to save" hint because we know we've just started refresh.
- Impl::setNeedRefresh(instance, false);
- }
-}
-
-// static
-void LLFloaterSnapshot::postUpdate()
-{
- // FIXME: duplicated code
- LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot");
- if (instance)
- {
- // Enable the send/post/save buttons.
- Impl::updateControls(instance);
-
- // We've just done refresh.
- Impl::setNeedRefresh(instance, false);
-
- // The refresh button is initially hidden. We show it after the first update,
- // i.e. when preview appears.
- if (!instance->mRefreshBtn->getVisible())
- {
- instance->mRefreshBtn->setVisible(true);
- }
- }
-}
-
-// static
void LLFloaterSnapshot::postSave()
{
- LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot");
+ LLFloaterSnapshot* instance = findInstance();
if (!instance)
{
llassert(instance != NULL);
@@ -1399,7 +1368,7 @@ LLPointer<LLImageFormatted> LLFloaterSnapshot::getImageData()
{
// FIXME: May not work for textures.
- LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot");
+ LLFloaterSnapshot* instance = findInstance();
if (!instance)
{
llassert(instance != NULL);
@@ -1416,7 +1385,7 @@ LLPointer<LLImageFormatted> LLFloaterSnapshot::getImageData()
LLPointer<LLImageFormatted> img = previewp->getFormattedImage();
if (!img.get())
{
- llwarns << "Empty snapshot image data" << llendl;
+ LL_WARNS() << "Empty snapshot image data" << LL_ENDL;
llassert(img.get() != NULL);
}
@@ -1426,7 +1395,7 @@ LLPointer<LLImageFormatted> LLFloaterSnapshot::getImageData()
// static
const LLVector3d& LLFloaterSnapshot::getPosTakenGlobal()
{
- LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot");
+ LLFloaterSnapshot* instance = findInstance();
if (!instance)
{
llassert(instance != NULL);
@@ -1446,7 +1415,7 @@ const LLVector3d& LLFloaterSnapshot::getPosTakenGlobal()
// static
void LLFloaterSnapshot::setAgentEmail(const std::string& email)
{
- LLFloaterSnapshot* instance = LLFloaterReg::findTypedInstance<LLFloaterSnapshot>("snapshot");
+ LLFloaterSnapshot* instance = findInstance();
if (instance)
{
LLSideTrayPanelContainer* panel_container = instance->getChild<LLSideTrayPanelContainer>("panel_container");
diff --git a/indra/newview/llfloatersnapshot.h b/indra/newview/llfloatersnapshot.h
index 82af8c7a9d..0bb9474bb5 100755
--- a/indra/newview/llfloatersnapshot.h
+++ b/indra/newview/llfloatersnapshot.h
@@ -56,10 +56,9 @@ public:
// TODO: create a snapshot model instead
static LLFloaterSnapshot* getInstance();
+ static LLFloaterSnapshot* findInstance();
static void saveTexture();
static BOOL saveLocal();
- static void preUpdate();
- static void postUpdate();
static void postSave();
static void postPanelSwitch();
static LLPointer<LLImageFormatted> getImageData();
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 7b25291da7..7477b02867 100755
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -266,7 +266,7 @@ BOOL LLFloaterTools::postBuild()
found->setClickedCallback(boost::bind(&LLFloaterTools::setObjectType, toolData[t]));
mButtons.push_back( found );
}else{
- llwarns << "Tool button not found! DOA Pending." << llendl;
+ LL_WARNS() << "Tool button not found! DOA Pending." << LL_ENDL;
}
}
mCheckCopySelection = getChild<LLCheckBoxCtrl>("checkbox copy selection");
@@ -500,7 +500,7 @@ void LLFloaterTools::refresh()
}
else
{
- llwarns << "Failed to get selected object" << llendl;
+ LL_WARNS() << "Failed to get selected object" << LL_ENDL;
}
}
@@ -888,6 +888,9 @@ void LLFloaterTools::onClose(bool app_quitting)
// hide the advanced object weights floater
LLFloaterReg::hideInstance("object_weights");
+
+ // prepare content for next call
+ mPanelContents->clearContents();
}
void click_popup_info(void*)
@@ -1069,9 +1072,9 @@ void LLFloaterTools::setGridMode(S32 mode)
void LLFloaterTools::onClickGridOptions()
{
- LLFloaterReg::showInstance("build_options");
- // RN: this makes grid options dependent on build tools window
- //floaterp->addDependentFloater(LLFloaterBuildOptions::getInstance(), FALSE);
+ LLFloater* floaterp = LLFloaterReg::showInstance("build_options");
+ // position floater next to build tools, not over
+ floaterp->setRect(gFloaterView->findNeighboringPosition(this, floaterp));
}
// static
@@ -1095,7 +1098,7 @@ void LLFloaterTools::setTool(const LLSD& user_data)
else if (control_name == "Land" )
LLToolMgr::getInstance()->getCurrentToolset()->selectTool( (LLTool *) LLToolSelectLand::getInstance());
else
- llwarns<<" no parameter name "<<control_name<<" found!! No Tool selected!!"<< llendl;
+ LL_WARNS()<<" no parameter name "<<control_name<<" found!! No Tool selected!!"<< LL_ENDL;
}
void LLFloaterTools::onFocusReceived()
diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp
index 7530c72dd2..d604b8619a 100755
--- a/indra/newview/llfloatertopobjects.cpp
+++ b/indra/newview/llfloatertopobjects.cpp
@@ -50,6 +50,7 @@
#include "llviewerregion.h"
#include "lluictrlfactory.h"
#include "llviewerwindow.h"
+#include "llfloaterregioninfo.h"
//LLFloaterTopObjects* LLFloaterTopObjects::sInstance = NULL;
@@ -207,7 +208,7 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data)
columns[column_num++]["font"] = "SANSSERIF";
columns[column_num]["column"] = "location";
- columns[column_num]["value"] = llformat("<%0.1f,%0.1f,%0.1f>", location_x, location_y, location_z);
+ columns[column_num]["value"] = llformat("<%0.f, %0.f, %0.f>", location_x, location_y, location_z);
columns[column_num++]["font"] = "SANSSERIF";
columns[column_num]["column"] = "parcel";
@@ -257,6 +258,8 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data)
format.setArg("[COUNT]", llformat("%d", total_count));
format.setArg("[TIME]", llformat("%0.3f", mtotalScore));
getChild<LLUICtrl>("title_text")->setValue(LLSD(format));
+ list->setColumnLabel("URLs", getString("URLs"));
+ list->setColumnLabel("memory", getString("memory"));
}
else
{
@@ -268,6 +271,13 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data)
format.setArg("[COUNT]", llformat("%d", total_count));
getChild<LLUICtrl>("title_text")->setValue(LLSD(format));
}
+
+ LLFloaterRegionInfo* region_info_floater = LLFloaterReg::getTypedInstance<LLFloaterRegionInfo>("region_info");
+ if(region_info_floater)
+ {
+ region_info_floater->enableTopButtons();
+ }
+ getChildView("refresh_btn")->setEnabled(true);
}
void LLFloaterTopObjects::onCommitObjectsList()
@@ -453,12 +463,24 @@ void LLFloaterTopObjects::onRefresh()
msg->addStringFast(_PREHASH_Filter, filter);
msg->addS32Fast(_PREHASH_ParcelLocalID, 0);
+ LLFloaterRegionInfo* region_info_floater = LLFloaterReg::getTypedInstance<LLFloaterRegionInfo>("region_info");
+ if(region_info_floater)
+ {
+ region_info_floater->disableTopButtons();
+ }
+ disableRefreshBtn();
+
msg->sendReliable(gAgent.getRegionHost());
mFilter.clear();
mFlags = 0;
}
+void LLFloaterTopObjects::disableRefreshBtn()
+{
+ getChildView("refresh_btn")->setEnabled(false);
+}
+
void LLFloaterTopObjects::onGetByObjectName()
{
mFlags = STAT_FILTER_BY_OBJECT;
diff --git a/indra/newview/llfloatertopobjects.h b/indra/newview/llfloatertopobjects.h
index 6edc46cf79..dbbe9ac521 100755
--- a/indra/newview/llfloatertopobjects.h
+++ b/indra/newview/llfloatertopobjects.h
@@ -31,6 +31,22 @@
class LLUICtrl;
+// Bits for simulator performance query flags
+enum LAND_STAT_FLAGS
+{
+ STAT_FILTER_BY_PARCEL = 0x00000001,
+ STAT_FILTER_BY_OWNER = 0x00000002,
+ STAT_FILTER_BY_OBJECT = 0x00000004,
+ STAT_FILTER_BY_PARCEL_NAME = 0x00000008,
+ STAT_REQUEST_LAST_ENTRY = 0x80000000,
+};
+
+enum LAND_STAT_REPORT_TYPE
+{
+ STAT_REPORT_TOP_SCRIPTS = 0,
+ STAT_REPORT_TOP_COLLIDERS
+};
+
class LLFloaterTopObjects : public LLFloater
{
friend class LLFloaterReg;
@@ -50,6 +66,7 @@ public:
void onRefresh();
static void setMode(U32 mode);
+ void disableRefreshBtn();
private:
LLFloaterTopObjects(const LLSD& key);
diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp
index a242b224cd..0613ffc94d 100755
--- a/indra/newview/llfloatertos.cpp
+++ b/indra/newview/llfloatertos.cpp
@@ -36,7 +36,7 @@
#include "llbutton.h"
#include "llevents.h"
#include "llhttpclient.h"
-#include "llhttpstatuscodes.h" // for HTTP_FOUND
+#include "llhttpconstants.h"
#include "llnotificationsutil.h"
#include "llradiogroup.h"
#include "lltextbox.h"
@@ -62,42 +62,46 @@ LLFloaterTOS::LLFloaterTOS(const LLSD& data)
// on parent class indicating if the web server is working or not
class LLIamHere : public LLHTTPClient::Responder
{
- private:
- LLIamHere( LLFloaterTOS* parent ) :
- mParent( parent )
- {}
+ LOG_CLASS(LLIamHere);
+private:
+ LLIamHere( LLFloaterTOS* parent ) :
+ mParent( parent )
+ {}
- LLFloaterTOS* mParent;
+ LLFloaterTOS* mParent;
- public:
-
- static LLIamHere* build( LLFloaterTOS* parent )
- {
- return new LLIamHere( parent );
- };
-
- virtual void setParent( LLFloaterTOS* parentIn )
- {
- mParent = parentIn;
- };
-
- virtual void result( const LLSD& content )
+public:
+ static LLIamHere* build( LLFloaterTOS* parent )
+ {
+ return new LLIamHere( parent );
+ }
+
+ virtual void setParent( LLFloaterTOS* parentIn )
+ {
+ mParent = parentIn;
+ }
+
+protected:
+ virtual void httpSuccess()
+ {
+ if ( mParent )
{
- if ( mParent )
- mParent->setSiteIsAlive( true );
- };
+ mParent->setSiteIsAlive( true );
+ }
+ }
- virtual void error( U32 status, const std::string& reason )
+ virtual void httpFailure()
+ {
+ LL_DEBUGS("LLIamHere") << dumpResponse() << LL_ENDL;
+ if ( mParent )
{
- if ( mParent )
- {
- // *HACK: For purposes of this alive check, 302 Found
- // (aka Moved Temporarily) is considered alive. The web site
- // redirects this link to a "cache busting" temporary URL. JC
- bool alive = (status == HTTP_FOUND);
- mParent->setSiteIsAlive( alive );
- }
- };
+ // *HACK: For purposes of this alive check, 302 Found
+ // (aka Moved Temporarily) is considered alive. The web site
+ // redirects this link to a "cache busting" temporary URL. JC
+ bool alive = (getStatus() == HTTP_FOUND);
+ mParent->setSiteIsAlive( alive );
+ }
+ }
};
// this is global and not a class member to keep crud out of the header file
diff --git a/indra/newview/llfloatertranslationsettings.cpp b/indra/newview/llfloatertranslationsettings.cpp
index 33f2c35239..965d29b09c 100755
--- a/indra/newview/llfloatertranslationsettings.cpp
+++ b/indra/newview/llfloatertranslationsettings.cpp
@@ -59,7 +59,7 @@ private:
if (!floater)
{
- llwarns << "Cannot find translation settings floater" << llendl;
+ LL_WARNS() << "Cannot find translation settings floater" << LL_ENDL;
return;
}
diff --git a/indra/newview/llfloatertwitter.cpp b/indra/newview/llfloatertwitter.cpp
new file mode 100644
index 0000000000..868d623d57
--- /dev/null
+++ b/indra/newview/llfloatertwitter.cpp
@@ -0,0 +1,818 @@
+/**
+* @file llfloatertwitter.cpp
+* @brief Implementation of llfloatertwitter
+* @author cho@lindenlab.com
+*
+* $LicenseInfo:firstyear=2013&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2013, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+* $/LicenseInfo$
+*/
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llfloatertwitter.h"
+
+#include "llagent.h"
+#include "llagentui.h"
+#include "llcheckboxctrl.h"
+#include "llcombobox.h"
+#include "lltwitterconnect.h"
+#include "llfloaterbigpreview.h"
+#include "llfloaterreg.h"
+#include "lliconctrl.h"
+#include "llimagefiltersmanager.h"
+#include "llresmgr.h" // LLLocale
+#include "llsdserialize.h"
+#include "llloadingindicator.h"
+#include "llplugincookiestore.h"
+#include "llslurl.h"
+#include "lltrans.h"
+#include "llsnapshotlivepreview.h"
+#include "llviewerregion.h"
+#include "llviewercontrol.h"
+#include "llviewermedia.h"
+#include "lltabcontainer.h"
+#include "lltexteditor.h"
+
+static LLPanelInjector<LLTwitterPhotoPanel> t_panel_photo("lltwitterphotopanel");
+static LLPanelInjector<LLTwitterAccountPanel> t_panel_account("lltwitteraccountpanel");
+
+const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte
+const std::string DEFAULT_PHOTO_LOCATION_URL = "http://maps.secondlife.com/";
+const std::string DEFAULT_PHOTO_QUERY_PARAMETERS = "?sourceid=slshare_photo&utm_source=twitter&utm_medium=photo&utm_campaign=slshare";
+const std::string DEFAULT_STATUS_TEXT = " #SecondLife";
+
+///////////////////////////
+//LLTwitterPhotoPanel///////
+///////////////////////////
+
+LLTwitterPhotoPanel::LLTwitterPhotoPanel() :
+mResolutionComboBox(NULL),
+mRefreshBtn(NULL),
+mBtnPreview(NULL),
+mWorkingLabel(NULL),
+mThumbnailPlaceholder(NULL),
+mStatusCounterLabel(NULL),
+mStatusTextBox(NULL),
+mLocationCheckbox(NULL),
+mPhotoCheckbox(NULL),
+mBigPreviewFloater(NULL),
+mPostButton(NULL)
+{
+ mCommitCallbackRegistrar.add("SocialSharing.SendPhoto", boost::bind(&LLTwitterPhotoPanel::onSend, this));
+ mCommitCallbackRegistrar.add("SocialSharing.RefreshPhoto", boost::bind(&LLTwitterPhotoPanel::onClickNewSnapshot, this));
+ mCommitCallbackRegistrar.add("SocialSharing.BigPreview", boost::bind(&LLTwitterPhotoPanel::onClickBigPreview, this));
+}
+
+LLTwitterPhotoPanel::~LLTwitterPhotoPanel()
+{
+ if(mPreviewHandle.get())
+ {
+ mPreviewHandle.get()->die();
+ }
+}
+
+BOOL LLTwitterPhotoPanel::postBuild()
+{
+ setVisibleCallback(boost::bind(&LLTwitterPhotoPanel::onVisibilityChange, this, _2));
+
+ mResolutionComboBox = getChild<LLUICtrl>("resolution_combobox");
+ mResolutionComboBox->setValue("[i800,i600]"); // hardcoded defaults ftw!
+ mResolutionComboBox->setCommitCallback(boost::bind(&LLTwitterPhotoPanel::updateResolution, this, TRUE));
+ mFilterComboBox = getChild<LLUICtrl>("filters_combobox");
+ mFilterComboBox->setCommitCallback(boost::bind(&LLTwitterPhotoPanel::updateResolution, this, TRUE));
+ mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn");
+ mBtnPreview = getChild<LLButton>("big_preview_btn");
+ mWorkingLabel = getChild<LLUICtrl>("working_lbl");
+ mThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder");
+ mStatusCounterLabel = getChild<LLUICtrl>("status_counter_label");
+ mStatusTextBox = getChild<LLUICtrl>("photo_status");
+ mStatusTextBox->setValue(DEFAULT_STATUS_TEXT);
+ mLocationCheckbox = getChild<LLUICtrl>("add_location_cb");
+ mLocationCheckbox->setCommitCallback(boost::bind(&LLTwitterPhotoPanel::onAddLocationToggled, this));
+ mPhotoCheckbox = getChild<LLUICtrl>("add_photo_cb");
+ mPhotoCheckbox->setCommitCallback(boost::bind(&LLTwitterPhotoPanel::onAddPhotoToggled, this));
+ mPostButton = getChild<LLUICtrl>("post_photo_btn");
+ mCancelButton = getChild<LLUICtrl>("cancel_photo_btn");
+ mBigPreviewFloater = dynamic_cast<LLFloaterBigPreview*>(LLFloaterReg::getInstance("big_preview"));
+
+ // Update filter list
+ std::vector<std::string> filter_list = LLImageFiltersManager::getInstance()->getFiltersList();
+ LLComboBox* filterbox = static_cast<LLComboBox *>(mFilterComboBox);
+ for (U32 i = 0; i < filter_list.size(); i++)
+ {
+ filterbox->add(filter_list[i]);
+ }
+
+ return LLPanel::postBuild();
+}
+
+// virtual
+S32 LLTwitterPhotoPanel::notify(const LLSD& info)
+{
+ if (info.has("snapshot-updating"))
+ {
+ // Disable the Post button and whatever else while the snapshot is not updated
+ // updateControls();
+ return 1;
+ }
+
+ if (info.has("snapshot-updated"))
+ {
+ // Enable the send/post/save buttons.
+ updateControls();
+
+ // The refresh button is initially hidden. We show it after the first update,
+ // i.e. after snapshot is taken
+ LLUICtrl * refresh_button = getRefreshBtn();
+ if (!refresh_button->getVisible())
+ {
+ refresh_button->setVisible(true);
+ }
+ return 1;
+ }
+
+ return 0;
+}
+
+void LLTwitterPhotoPanel::draw()
+{
+ LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(mPreviewHandle.get());
+
+ // Enable interaction only if no transaction with the service is on-going (prevent duplicated posts)
+ bool no_ongoing_connection = !(LLTwitterConnect::instance().isTransactionOngoing());
+ bool photo_checked = mPhotoCheckbox->getValue().asBoolean();
+ mCancelButton->setEnabled(no_ongoing_connection);
+ mStatusTextBox->setEnabled(no_ongoing_connection);
+ mResolutionComboBox->setEnabled(no_ongoing_connection && photo_checked);
+ mFilterComboBox->setEnabled(no_ongoing_connection && photo_checked);
+ mRefreshBtn->setEnabled(no_ongoing_connection && photo_checked);
+ mBtnPreview->setEnabled(no_ongoing_connection);
+ mLocationCheckbox->setEnabled(no_ongoing_connection);
+ mPhotoCheckbox->setEnabled(no_ongoing_connection);
+
+ bool add_location = mLocationCheckbox->getValue().asBoolean();
+ bool add_photo = mPhotoCheckbox->getValue().asBoolean();
+ updateStatusTextLength(false);
+
+ // Reassign the preview floater if we have the focus and the preview exists
+ if (hasFocus() && isPreviewVisible())
+ {
+ attachPreview();
+ }
+
+ // Toggle the button state as appropriate
+ bool preview_active = (isPreviewVisible() && mBigPreviewFloater->isFloaterOwner(getParentByType<LLFloater>()));
+ mBtnPreview->setToggleState(preview_active);
+
+ // Display the preview if one is available
+ if (previewp && previewp->getThumbnailImage())
+ {
+ const LLRect& thumbnail_rect = mThumbnailPlaceholder->getRect();
+ const S32 thumbnail_w = previewp->getThumbnailWidth();
+ const S32 thumbnail_h = previewp->getThumbnailHeight();
+
+ // calc preview offset within the preview rect
+ const S32 local_offset_x = (thumbnail_rect.getWidth() - thumbnail_w) / 2 ;
+ const S32 local_offset_y = (thumbnail_rect.getHeight() - thumbnail_h) / 2 ;
+ S32 offset_x = thumbnail_rect.mLeft + local_offset_x;
+ S32 offset_y = thumbnail_rect.mBottom + local_offset_y;
+
+ gGL.matrixMode(LLRender::MM_MODELVIEW);
+ // Apply floater transparency to the texture unless the floater is focused.
+ F32 alpha = (add_photo ? (getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency()) : 0.5f);
+ LLColor4 color = LLColor4::white;
+ gl_draw_scaled_image(offset_x, offset_y,
+ thumbnail_w, thumbnail_h,
+ previewp->getThumbnailImage(), color % alpha);
+ }
+
+ // Update the visibility of the working (computing preview) label
+ mWorkingLabel->setVisible(!(previewp && previewp->getSnapshotUpToDate()));
+
+ // Enable Post if we have a preview to send and no on going connection being processed
+ mPostButton->setEnabled(no_ongoing_connection && (previewp && previewp->getSnapshotUpToDate()) && (add_photo || add_location || !mStatusTextBox->getValue().asString().empty()));
+
+ // Draw the rest of the panel on top of it
+ LLPanel::draw();
+}
+
+LLSnapshotLivePreview* LLTwitterPhotoPanel::getPreviewView()
+{
+ LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)mPreviewHandle.get();
+ return previewp;
+}
+
+void LLTwitterPhotoPanel::onVisibilityChange(BOOL visible)
+{
+ if (visible)
+ {
+ if (mPreviewHandle.get())
+ {
+ LLSnapshotLivePreview* preview = getPreviewView();
+ if(preview)
+ {
+ LL_DEBUGS() << "opened, updating snapshot" << LL_ENDL;
+ preview->updateSnapshot(TRUE);
+ }
+ }
+ else
+ {
+ LLRect full_screen_rect = getRootView()->getRect();
+ LLSnapshotLivePreview::Params p;
+ p.rect(full_screen_rect);
+ LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p);
+ mPreviewHandle = previewp->getHandle();
+
+ previewp->setContainer(this);
+ previewp->setSnapshotType(previewp->SNAPSHOT_WEB);
+ previewp->setSnapshotFormat(LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG);
+ previewp->setThumbnailSubsampled(TRUE); // We want the preview to reflect the *saved* image
+ previewp->setAllowRenderUI(FALSE); // We do not want the rendered UI in our snapshots
+ previewp->setAllowFullScreenPreview(FALSE); // No full screen preview in SL Share mode
+ previewp->setThumbnailPlaceholderRect(mThumbnailPlaceholder->getRect());
+
+ updateControls();
+ }
+ }
+}
+
+void LLTwitterPhotoPanel::onAddLocationToggled()
+{
+ bool add_location = mLocationCheckbox->getValue().asBoolean();
+ updateStatusTextLength(!add_location);
+}
+
+void LLTwitterPhotoPanel::onAddPhotoToggled()
+{
+ bool add_photo = mPhotoCheckbox->getValue().asBoolean();
+ updateStatusTextLength(!add_photo);
+}
+
+void LLTwitterPhotoPanel::onClickNewSnapshot()
+{
+ LLSnapshotLivePreview* previewp = getPreviewView();
+ if (previewp)
+ {
+ previewp->updateSnapshot(TRUE);
+ }
+}
+
+void LLTwitterPhotoPanel::onClickBigPreview()
+{
+ // Toggle the preview
+ if (isPreviewVisible())
+ {
+ LLFloaterReg::hideInstance("big_preview");
+ }
+ else
+ {
+ attachPreview();
+ LLFloaterReg::showInstance("big_preview");
+ }
+}
+
+bool LLTwitterPhotoPanel::isPreviewVisible()
+{
+ return (mBigPreviewFloater && mBigPreviewFloater->getVisible());
+}
+
+void LLTwitterPhotoPanel::attachPreview()
+{
+ if (mBigPreviewFloater)
+ {
+ LLSnapshotLivePreview* previewp = getPreviewView();
+ mBigPreviewFloater->setPreview(previewp);
+ mBigPreviewFloater->setFloaterOwner(getParentByType<LLFloater>());
+ }
+}
+
+void LLTwitterPhotoPanel::onSend()
+{
+ LLEventPumps::instance().obtain("TwitterConnectState").stopListening("LLTwitterPhotoPanel"); // just in case it is already listening
+ LLEventPumps::instance().obtain("TwitterConnectState").listen("LLTwitterPhotoPanel", boost::bind(&LLTwitterPhotoPanel::onTwitterConnectStateChange, this, _1));
+
+ // Connect to Twitter if necessary and then post
+ if (LLTwitterConnect::instance().isConnected())
+ {
+ sendPhoto();
+ }
+ else
+ {
+ LLTwitterConnect::instance().checkConnectionToTwitter(true);
+ }
+}
+
+bool LLTwitterPhotoPanel::onTwitterConnectStateChange(const LLSD& data)
+{
+ switch (data.get("enum").asInteger())
+ {
+ case LLTwitterConnect::TWITTER_CONNECTED:
+ sendPhoto();
+ break;
+
+ case LLTwitterConnect::TWITTER_POSTED:
+ LLEventPumps::instance().obtain("TwitterConnectState").stopListening("LLTwitterPhotoPanel");
+ clearAndClose();
+ break;
+ }
+
+ return false;
+}
+
+void LLTwitterPhotoPanel::sendPhoto()
+{
+ // Get the status text
+ std::string status = mStatusTextBox->getValue().asString();
+
+ // Add the location if required
+ bool add_location = mLocationCheckbox->getValue().asBoolean();
+ if (add_location)
+ {
+ // Get the SLURL for the location
+ LLSLURL slurl;
+ LLAgentUI::buildSLURL(slurl);
+ std::string slurl_string = slurl.getSLURLString();
+
+ // Use a valid http:// URL if the scheme is secondlife://
+ LLURI slurl_uri(slurl_string);
+ if (slurl_uri.scheme() == LLSLURL::SLURL_SECONDLIFE_SCHEME)
+ {
+ slurl_string = DEFAULT_PHOTO_LOCATION_URL;
+ }
+
+ // Add query parameters so Google Analytics can track incoming clicks!
+ slurl_string += DEFAULT_PHOTO_QUERY_PARAMETERS;
+
+ // Add it to the status (pretty crude, but we don't have a better option with photos)
+ if (status.empty())
+ status = slurl_string;
+ else
+ status = status + " " + slurl_string;
+ }
+
+ // Add the photo if required
+ bool add_photo = mPhotoCheckbox->getValue().asBoolean();
+ if (add_photo)
+ {
+ // Get the image
+ LLSnapshotLivePreview* previewp = getPreviewView();
+
+ // Post to Twitter
+ LLTwitterConnect::instance().uploadPhoto(previewp->getFormattedImage(), status);
+ }
+ else
+ {
+ // Just post the status to Twitter
+ LLTwitterConnect::instance().updateStatus(status);
+ }
+
+ updateControls();
+}
+
+void LLTwitterPhotoPanel::clearAndClose()
+{
+ mStatusTextBox->setValue(DEFAULT_STATUS_TEXT);
+
+ LLFloater* floater = getParentByType<LLFloater>();
+ if (floater)
+ {
+ floater->closeFloater();
+ if (mBigPreviewFloater)
+ {
+ mBigPreviewFloater->closeOnFloaterOwnerClosing(floater);
+ }
+ }
+}
+
+void LLTwitterPhotoPanel::updateStatusTextLength(BOOL restore_old_status_text)
+{
+ bool add_location = mLocationCheckbox->getValue().asBoolean();
+ bool add_photo = mPhotoCheckbox->getValue().asBoolean();
+
+ // Restrict the status text length to Twitter's character limit
+ LLTextEditor* status_text_box = dynamic_cast<LLTextEditor*>(mStatusTextBox);
+ if (status_text_box)
+ {
+ int max_status_length = 140 - (add_location ? 40 : 0) - (add_photo ? 40 : 0);
+ status_text_box->setMaxTextLength(max_status_length);
+ if (restore_old_status_text)
+ {
+ if (mOldStatusText.length() > status_text_box->getText().length() && status_text_box->getText() == mOldStatusText.substr(0, status_text_box->getText().length()))
+ {
+ status_text_box->setText(mOldStatusText);
+ }
+ if (mOldStatusText.length() <= max_status_length)
+ {
+ mOldStatusText = "";
+ }
+ }
+ if (status_text_box->getText().length() > max_status_length)
+ {
+ if (mOldStatusText.length() < status_text_box->getText().length() || status_text_box->getText() != mOldStatusText.substr(0, status_text_box->getText().length()))
+ {
+ mOldStatusText = status_text_box->getText();
+ }
+ status_text_box->setText(mOldStatusText.substr(0, max_status_length));
+ }
+
+ // Update the status character counter
+ int characters_remaining = max_status_length - status_text_box->getText().length();
+ mStatusCounterLabel->setValue(characters_remaining);
+ }
+
+}
+
+void LLTwitterPhotoPanel::updateControls()
+{
+ LLSnapshotLivePreview* previewp = getPreviewView();
+ BOOL got_snap = previewp && previewp->getSnapshotUpToDate();
+
+ // *TODO: Separate maximum size for Web images from postcards
+ LL_DEBUGS() << "Is snapshot up-to-date? " << got_snap << LL_ENDL;
+
+ updateResolution(FALSE);
+}
+
+void LLTwitterPhotoPanel::updateResolution(BOOL do_update)
+{
+ LLComboBox* combobox = static_cast<LLComboBox *>(mResolutionComboBox);
+ LLComboBox* filterbox = static_cast<LLComboBox *>(mFilterComboBox);
+
+ std::string sdstring = combobox->getSelectedValue();
+ LLSD sdres;
+ std::stringstream sstream(sdstring);
+ LLSDSerialize::fromNotation(sdres, sstream, sdstring.size());
+
+ S32 width = sdres[0];
+ S32 height = sdres[1];
+
+ // Note : index 0 of the filter drop down is assumed to be "No filter" in whichever locale
+ std::string filter_name = (filterbox->getCurrentIndex() ? filterbox->getSimple() : "");
+
+ LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(mPreviewHandle.get());
+ if (previewp && combobox->getCurrentIndex() >= 0)
+ {
+ S32 original_width = 0 , original_height = 0 ;
+ previewp->getSize(original_width, original_height) ;
+
+ if (width == 0 || height == 0)
+ {
+ // take resolution from current window size
+ LL_DEBUGS() << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << LL_ENDL;
+ previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw());
+ }
+ else
+ {
+ // use the resolution from the selected pre-canned drop-down choice
+ LL_DEBUGS() << "Setting preview res selected from combo: " << width << "x" << height << LL_ENDL;
+ previewp->setSize(width, height);
+ }
+
+ checkAspectRatio(width);
+
+ previewp->getSize(width, height);
+
+ if (original_width != width || original_height != height)
+ {
+ previewp->setSize(width, height);
+ if (do_update)
+ {
+ previewp->updateSnapshot(TRUE);
+ updateControls();
+ }
+ }
+ // Get the old filter, compare to the current one "filter_name" and set if changed
+ std::string original_filter = previewp->getFilter();
+ if (original_filter != filter_name)
+ {
+ previewp->setFilter(filter_name);
+ if (do_update)
+ {
+ previewp->updateSnapshot(FALSE, TRUE);
+ updateControls();
+ }
+ }
+ }
+}
+
+void LLTwitterPhotoPanel::checkAspectRatio(S32 index)
+{
+ LLSnapshotLivePreview *previewp = getPreviewView() ;
+
+ BOOL keep_aspect = FALSE;
+
+ if (0 == index) // current window size
+ {
+ keep_aspect = TRUE;
+ }
+ else // predefined resolution
+ {
+ keep_aspect = FALSE;
+ }
+
+ if (previewp)
+ {
+ previewp->mKeepAspectRatio = keep_aspect;
+ }
+}
+
+LLUICtrl* LLTwitterPhotoPanel::getRefreshBtn()
+{
+ return mRefreshBtn;
+}
+
+///////////////////////////
+//LLTwitterAccountPanel//////
+///////////////////////////
+
+LLTwitterAccountPanel::LLTwitterAccountPanel() :
+mAccountCaptionLabel(NULL),
+mAccountNameLabel(NULL),
+mPanelButtons(NULL),
+mConnectButton(NULL),
+mDisconnectButton(NULL)
+{
+ mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLTwitterAccountPanel::onConnect, this));
+ mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLTwitterAccountPanel::onDisconnect, this));
+
+ setVisibleCallback(boost::bind(&LLTwitterAccountPanel::onVisibilityChange, this, _2));
+}
+
+BOOL LLTwitterAccountPanel::postBuild()
+{
+ mAccountCaptionLabel = getChild<LLTextBox>("account_caption_label");
+ mAccountNameLabel = getChild<LLTextBox>("account_name_label");
+ mPanelButtons = getChild<LLUICtrl>("panel_buttons");
+ mConnectButton = getChild<LLUICtrl>("connect_btn");
+ mDisconnectButton = getChild<LLUICtrl>("disconnect_btn");
+
+ return LLPanel::postBuild();
+}
+
+void LLTwitterAccountPanel::draw()
+{
+ LLTwitterConnect::EConnectionState connection_state = LLTwitterConnect::instance().getConnectionState();
+
+ //Disable the 'disconnect' button and the 'use another account' button when disconnecting in progress
+ bool disconnecting = connection_state == LLTwitterConnect::TWITTER_DISCONNECTING;
+ mDisconnectButton->setEnabled(!disconnecting);
+
+ //Disable the 'connect' button when a connection is in progress
+ bool connecting = connection_state == LLTwitterConnect::TWITTER_CONNECTION_IN_PROGRESS;
+ mConnectButton->setEnabled(!connecting);
+
+ LLPanel::draw();
+}
+
+void LLTwitterAccountPanel::onVisibilityChange(BOOL visible)
+{
+ if(visible)
+ {
+ LLEventPumps::instance().obtain("TwitterConnectState").stopListening("LLTwitterAccountPanel");
+ LLEventPumps::instance().obtain("TwitterConnectState").listen("LLTwitterAccountPanel", boost::bind(&LLTwitterAccountPanel::onTwitterConnectStateChange, this, _1));
+
+ LLEventPumps::instance().obtain("TwitterConnectInfo").stopListening("LLTwitterAccountPanel");
+ LLEventPumps::instance().obtain("TwitterConnectInfo").listen("LLTwitterAccountPanel", boost::bind(&LLTwitterAccountPanel::onTwitterConnectInfoChange, this));
+
+ //Connected
+ if(LLTwitterConnect::instance().isConnected())
+ {
+ showConnectedLayout();
+ }
+ //Check if connected (show disconnected layout in meantime)
+ else
+ {
+ showDisconnectedLayout();
+ }
+ if ((LLTwitterConnect::instance().getConnectionState() == LLTwitterConnect::TWITTER_NOT_CONNECTED) ||
+ (LLTwitterConnect::instance().getConnectionState() == LLTwitterConnect::TWITTER_CONNECTION_FAILED))
+ {
+ LLTwitterConnect::instance().checkConnectionToTwitter();
+ }
+ }
+ else
+ {
+ LLEventPumps::instance().obtain("TwitterConnectState").stopListening("LLTwitterAccountPanel");
+ LLEventPumps::instance().obtain("TwitterConnectInfo").stopListening("LLTwitterAccountPanel");
+ }
+}
+
+bool LLTwitterAccountPanel::onTwitterConnectStateChange(const LLSD& data)
+{
+ if(LLTwitterConnect::instance().isConnected())
+ {
+ //In process of disconnecting so leave the layout as is
+ if(data.get("enum").asInteger() != LLTwitterConnect::TWITTER_DISCONNECTING)
+ {
+ showConnectedLayout();
+ }
+ }
+ else
+ {
+ showDisconnectedLayout();
+ }
+
+ return false;
+}
+
+bool LLTwitterAccountPanel::onTwitterConnectInfoChange()
+{
+ LLSD info = LLTwitterConnect::instance().getInfo();
+ std::string clickable_name;
+
+ //Strings of format [http://www.somewebsite.com Click Me] become clickable text
+ if(info.has("link") && info.has("name"))
+ {
+ clickable_name = "[" + info["link"].asString() + " " + info["name"].asString() + "]";
+ }
+
+ mAccountNameLabel->setText(clickable_name);
+
+ return false;
+}
+
+void LLTwitterAccountPanel::showConnectButton()
+{
+ if(!mConnectButton->getVisible())
+ {
+ mConnectButton->setVisible(TRUE);
+ mDisconnectButton->setVisible(FALSE);
+ }
+}
+
+void LLTwitterAccountPanel::hideConnectButton()
+{
+ if(mConnectButton->getVisible())
+ {
+ mConnectButton->setVisible(FALSE);
+ mDisconnectButton->setVisible(TRUE);
+ }
+}
+
+void LLTwitterAccountPanel::showDisconnectedLayout()
+{
+ mAccountCaptionLabel->setText(getString("twitter_disconnected"));
+ mAccountNameLabel->setText(std::string(""));
+ showConnectButton();
+}
+
+void LLTwitterAccountPanel::showConnectedLayout()
+{
+ LLTwitterConnect::instance().loadTwitterInfo();
+
+ mAccountCaptionLabel->setText(getString("twitter_connected"));
+ hideConnectButton();
+}
+
+void LLTwitterAccountPanel::onConnect()
+{
+ LLTwitterConnect::instance().checkConnectionToTwitter(true);
+
+ //Clear only the twitter browser cookies so that the twitter login screen appears
+ LLViewerMedia::getCookieStore()->removeCookiesByDomain(".twitter.com");
+}
+
+void LLTwitterAccountPanel::onDisconnect()
+{
+ LLTwitterConnect::instance().disconnectFromTwitter();
+
+ LLViewerMedia::getCookieStore()->removeCookiesByDomain(".twitter.com");
+}
+
+////////////////////////
+//LLFloaterTwitter///////
+////////////////////////
+
+LLFloaterTwitter::LLFloaterTwitter(const LLSD& key) : LLFloater(key),
+ mTwitterPhotoPanel(NULL),
+ mStatusErrorText(NULL),
+ mStatusLoadingText(NULL),
+ mStatusLoadingIndicator(NULL)
+{
+ mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterTwitter::onCancel, this));
+}
+
+void LLFloaterTwitter::onClose(bool app_quitting)
+{
+ LLFloaterBigPreview* big_preview_floater = dynamic_cast<LLFloaterBigPreview*>(LLFloaterReg::getInstance("big_preview"));
+ if (big_preview_floater)
+ {
+ big_preview_floater->closeOnFloaterOwnerClosing(this);
+ }
+ LLFloater::onClose(app_quitting);
+}
+
+void LLFloaterTwitter::onCancel()
+{
+ LLFloaterBigPreview* big_preview_floater = dynamic_cast<LLFloaterBigPreview*>(LLFloaterReg::getInstance("big_preview"));
+ if (big_preview_floater)
+ {
+ big_preview_floater->closeOnFloaterOwnerClosing(this);
+ }
+ closeFloater();
+}
+
+BOOL LLFloaterTwitter::postBuild()
+{
+ // Keep tab of the Photo Panel
+ mTwitterPhotoPanel = static_cast<LLTwitterPhotoPanel*>(getChild<LLUICtrl>("panel_twitter_photo"));
+ // Connection status widgets
+ mStatusErrorText = getChild<LLTextBox>("connection_error_text");
+ mStatusLoadingText = getChild<LLTextBox>("connection_loading_text");
+ mStatusLoadingIndicator = getChild<LLUICtrl>("connection_loading_indicator");
+ return LLFloater::postBuild();
+}
+
+void LLFloaterTwitter::showPhotoPanel()
+{
+ LLTabContainer* parent = dynamic_cast<LLTabContainer*>(mTwitterPhotoPanel->getParent());
+ if (!parent)
+ {
+ LL_WARNS() << "Cannot find panel container" << LL_ENDL;
+ return;
+ }
+
+ parent->selectTabPanel(mTwitterPhotoPanel);
+}
+
+void LLFloaterTwitter::draw()
+{
+ if (mStatusErrorText && mStatusLoadingText && mStatusLoadingIndicator)
+ {
+ mStatusErrorText->setVisible(false);
+ mStatusLoadingText->setVisible(false);
+ mStatusLoadingIndicator->setVisible(false);
+ LLTwitterConnect::EConnectionState connection_state = LLTwitterConnect::instance().getConnectionState();
+ std::string status_text;
+
+ switch (connection_state)
+ {
+ case LLTwitterConnect::TWITTER_NOT_CONNECTED:
+ // No status displayed when first opening the panel and no connection done
+ case LLTwitterConnect::TWITTER_CONNECTED:
+ // When successfully connected, no message is displayed
+ case LLTwitterConnect::TWITTER_POSTED:
+ // No success message to show since we actually close the floater after successful posting completion
+ break;
+ case LLTwitterConnect::TWITTER_CONNECTION_IN_PROGRESS:
+ // Connection loading indicator
+ mStatusLoadingText->setVisible(true);
+ status_text = LLTrans::getString("SocialTwitterConnecting");
+ mStatusLoadingText->setValue(status_text);
+ mStatusLoadingIndicator->setVisible(true);
+ break;
+ case LLTwitterConnect::TWITTER_POSTING:
+ // Posting indicator
+ mStatusLoadingText->setVisible(true);
+ status_text = LLTrans::getString("SocialTwitterPosting");
+ mStatusLoadingText->setValue(status_text);
+ mStatusLoadingIndicator->setVisible(true);
+ break;
+ case LLTwitterConnect::TWITTER_CONNECTION_FAILED:
+ // Error connecting to the service
+ mStatusErrorText->setVisible(true);
+ status_text = LLTrans::getString("SocialTwitterErrorConnecting");
+ mStatusErrorText->setValue(status_text);
+ break;
+ case LLTwitterConnect::TWITTER_POST_FAILED:
+ // Error posting to the service
+ mStatusErrorText->setVisible(true);
+ status_text = LLTrans::getString("SocialTwitterErrorPosting");
+ mStatusErrorText->setValue(status_text);
+ break;
+ case LLTwitterConnect::TWITTER_DISCONNECTING:
+ // Disconnecting loading indicator
+ mStatusLoadingText->setVisible(true);
+ status_text = LLTrans::getString("SocialTwitterDisconnecting");
+ mStatusLoadingText->setValue(status_text);
+ mStatusLoadingIndicator->setVisible(true);
+ break;
+ case LLTwitterConnect::TWITTER_DISCONNECT_FAILED:
+ // Error disconnecting from the service
+ mStatusErrorText->setVisible(true);
+ status_text = LLTrans::getString("SocialTwitterErrorDisconnecting");
+ mStatusErrorText->setValue(status_text);
+ break;
+ }
+ }
+ LLFloater::draw();
+}
+
diff --git a/indra/newview/llfloatertwitter.h b/indra/newview/llfloatertwitter.h
new file mode 100644
index 0000000000..d586799d18
--- /dev/null
+++ b/indra/newview/llfloatertwitter.h
@@ -0,0 +1,138 @@
+/**
+* @file llfloatertwitter.h
+* @brief Header file for llfloatertwitter
+* @author cho@lindenlab.com
+*
+* $LicenseInfo:firstyear=2013&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2013, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+* $/LicenseInfo$
+*/
+#ifndef LL_LLFLOATERTWITTER_H
+#define LL_LLFLOATERTWITTER_H
+
+#include "llfloater.h"
+#include "lltextbox.h"
+#include "llviewertexture.h"
+
+class LLIconCtrl;
+class LLCheckBoxCtrl;
+class LLSnapshotLivePreview;
+class LLFloaterBigPreview;
+
+class LLTwitterPhotoPanel : public LLPanel
+{
+public:
+ LLTwitterPhotoPanel();
+ ~LLTwitterPhotoPanel();
+
+ BOOL postBuild();
+ void draw();
+
+ LLSnapshotLivePreview* getPreviewView();
+ void onVisibilityChange(BOOL new_visibility);
+ void onAddLocationToggled();
+ void onAddPhotoToggled();
+ void onClickBigPreview();
+ void onClickNewSnapshot();
+ void onSend();
+ S32 notify(const LLSD& info);
+ bool onTwitterConnectStateChange(const LLSD& data);
+
+ void sendPhoto();
+ void clearAndClose();
+
+ void updateStatusTextLength(BOOL restore_old_status_text);
+ void updateControls();
+ void updateResolution(BOOL do_update);
+ void checkAspectRatio(S32 index);
+ LLUICtrl* getRefreshBtn();
+
+private:
+ bool isPreviewVisible();
+ void attachPreview();
+
+ LLHandle<LLView> mPreviewHandle;
+
+ LLUICtrl * mResolutionComboBox;
+ LLUICtrl * mFilterComboBox;
+ LLUICtrl * mRefreshBtn;
+ LLUICtrl * mWorkingLabel;
+ LLUICtrl * mThumbnailPlaceholder;
+ LLUICtrl * mStatusCounterLabel;
+ LLUICtrl * mStatusTextBox;
+ LLUICtrl * mLocationCheckbox;
+ LLUICtrl * mPhotoCheckbox;
+ LLUICtrl * mPostButton;
+ LLUICtrl * mCancelButton;
+ LLButton * mBtnPreview;
+
+ LLFloaterBigPreview * mBigPreviewFloater;
+
+ std::string mOldStatusText;
+};
+
+class LLTwitterAccountPanel : public LLPanel
+{
+public:
+ LLTwitterAccountPanel();
+ BOOL postBuild();
+ void draw();
+
+private:
+ void onVisibilityChange(BOOL new_visibility);
+ bool onTwitterConnectStateChange(const LLSD& data);
+ bool onTwitterConnectInfoChange();
+ void onConnect();
+ void onUseAnotherAccount();
+ void onDisconnect();
+
+ void showConnectButton();
+ void hideConnectButton();
+ void showDisconnectedLayout();
+ void showConnectedLayout();
+
+ LLTextBox * mAccountCaptionLabel;
+ LLTextBox * mAccountNameLabel;
+ LLUICtrl * mPanelButtons;
+ LLUICtrl * mConnectButton;
+ LLUICtrl * mDisconnectButton;
+};
+
+
+class LLFloaterTwitter : public LLFloater
+{
+public:
+ LLFloaterTwitter(const LLSD& key);
+ BOOL postBuild();
+ void draw();
+ void onClose(bool app_quitting);
+ void onCancel();
+
+ void showPhotoPanel();
+
+private:
+ LLTwitterPhotoPanel* mTwitterPhotoPanel;
+ LLTextBox* mStatusErrorText;
+ LLTextBox* mStatusLoadingText;
+ LLUICtrl* mStatusLoadingIndicator;
+};
+
+#endif // LL_LLFLOATERTWITTER_H
+
diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp
index 0106a1615d..bfc36a6bfb 100755
--- a/indra/newview/llfloateruipreview.cpp
+++ b/indra/newview/llfloateruipreview.cpp
@@ -607,7 +607,7 @@ void LLFloaterUIPreview::onClose(bool app_quitting)
// *TODO: this is currently unlocalized. Add to alerts/notifications.xml, someday, maybe.
void LLFloaterUIPreview::popupAndPrintWarning(const std::string& warning)
{
- llwarns << warning << llendl;
+ LL_WARNS() << warning << LL_ENDL;
LLSD args;
args["MESSAGE"] = warning;
LLNotificationsUtil::add("GenericAlert", args);
@@ -960,7 +960,7 @@ void LLFloaterUIPreview::onClickEditFloater()
std::string file_name = mFileList->getSelectedItemLabel(1); // get the file name of the currently-selected floater
if (file_name.empty()) // if no item is selected
{
- llwarns << "No file selected" << llendl;
+ LL_WARNS() << "No file selected" << LL_ENDL;
return; // ignore click
}
file_path = getLocalizedDirectory() + file_name;
@@ -1020,12 +1020,11 @@ void LLFloaterUIPreview::onClickEditFloater()
// Respond to button click to browse for an executable with which to edit XML files
void LLFloaterUIPreview::onClickBrowseForEditor()
{
- // create load dialog box
- LLFilePicker::ELoadFilter type = (LLFilePicker::ELoadFilter)((intptr_t)((void*)LLFilePicker::FFLOAD_ALL)); // nothing for *.exe so just use all
+ // Let the user choose an executable through the file picker dialog box
LLFilePicker& picker = LLFilePicker::instance();
- if (!picker.getOpenFile(type)) // user cancelled -- do nothing
+ if (!picker.getOpenFile(LLFilePicker::FFLOAD_EXE))
{
- return;
+ return; // user cancelled -- do nothing
}
// put the selected path into text field
@@ -1268,8 +1267,8 @@ void LLFloaterUIPreview::highlightChangedElements()
// if we still didn't find it...
if(NULL == element)
{
- llinfos << "Unable to find element in XuiDelta file named \"" << *iter << "\" in file \"" << mLiveFile->mFileName <<
- "\". The element may no longer exist, the path may be incorrect, or it may not be a non-displayable element (not an LLView) such as a \"string\" type." << llendl;
+ LL_INFOS() << "Unable to find element in XuiDelta file named \"" << *iter << "\" in file \"" << mLiveFile->mFileName <<
+ "\". The element may no longer exist, the path may be incorrect, or it may not be a non-displayable element (not an LLView) such as a \"string\" type." << LL_ENDL;
failed = TRUE;
break;
}
diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp
index e85d849c9a..e02e8eeb5a 100755
--- a/indra/newview/llfloaterurlentry.cpp
+++ b/indra/newview/llfloaterurlentry.cpp
@@ -48,31 +48,30 @@ static LLFloaterURLEntry* sInstance = NULL;
// on the Panel Land Media and to discover the MIME type
class LLMediaTypeResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(LLMediaTypeResponder);
public:
LLMediaTypeResponder( const LLHandle<LLFloater> parent ) :
- mParent( parent )
- {}
-
- LLHandle<LLFloater> mParent;
-
-
- virtual void completedHeader(U32 status, const std::string& reason, const LLSD& content)
- {
- std::string media_type = content["content-type"].asString();
- std::string::size_type idx1 = media_type.find_first_of(";");
- std::string mime_type = media_type.substr(0, idx1);
- completeAny(status, mime_type);
- }
-
- void completeAny(U32 status, const std::string& mime_type)
- {
- // Set empty type to none/none. Empty string is reserved for legacy parcels
- // which have no mime type set.
- std::string resolved_mime_type = ! mime_type.empty() ? mime_type : LLMIMETypes::getDefaultMimeType();
- LLFloaterURLEntry* floater_url_entry = (LLFloaterURLEntry*)mParent.get();
- if ( floater_url_entry )
- floater_url_entry->headerFetchComplete( status, resolved_mime_type );
- }
+ mParent( parent )
+ {}
+
+ LLHandle<LLFloater> mParent;
+
+private:
+ /* virtual */ void httpCompleted()
+ {
+ const std::string& media_type = getResponseHeader(HTTP_IN_HEADER_CONTENT_TYPE);
+ std::string::size_type idx1 = media_type.find_first_of(";");
+ std::string mime_type = media_type.substr(0, idx1);
+
+ // Set empty type to none/none. Empty string is reserved for legacy parcels
+ // which have no mime type set.
+ std::string resolved_mime_type = ! mime_type.empty() ? mime_type : LLMIMETypes::getDefaultMimeType();
+ LLFloaterURLEntry* floater_url_entry = (LLFloaterURLEntry*)mParent.get();
+ if ( floater_url_entry )
+ {
+ floater_url_entry->headerFetchComplete( getStatus(), resolved_mime_type );
+ }
+ }
};
//-----------------------------------------------------------------------------
@@ -136,7 +135,7 @@ void LLFloaterURLEntry::buildURLHistory()
}
}
-void LLFloaterURLEntry::headerFetchComplete(U32 status, const std::string& mime_type)
+void LLFloaterURLEntry::headerFetchComplete(S32 status, const std::string& mime_type)
{
LLPanelLandMedia* panel_media = dynamic_cast<LLPanelLandMedia*>(mPanelLandMediaHandle.get());
if (panel_media)
@@ -205,6 +204,10 @@ void LLFloaterURLEntry::onBtnOK( void* userdata )
LLURLHistory::addURL("parcel", media_url);
}
+ // show progress bar here?
+ getWindow()->incBusyCount();
+ self->getChildView("loading_label")->setVisible( true);
+
// leading whitespace causes problems with the MIME-type detection so strip it
LLStringUtil::trim( media_url );
@@ -234,10 +237,6 @@ void LLFloaterURLEntry::onBtnOK( void* userdata )
self->getChildView("ok_btn")->setEnabled(false);
self->getChildView("cancel_btn")->setEnabled(false);
self->getChildView("media_entry")->setEnabled(false);
-
- // show progress bar here?
- getWindow()->incBusyCount();
- self->getChildView("loading_label")->setVisible( true);
}
// static
diff --git a/indra/newview/llfloaterurlentry.h b/indra/newview/llfloaterurlentry.h
index dfb49fe5ac..bdd1ebe592 100755
--- a/indra/newview/llfloaterurlentry.h
+++ b/indra/newview/llfloaterurlentry.h
@@ -40,7 +40,7 @@ public:
// that panel via the handle.
static LLHandle<LLFloater> show(LLHandle<LLPanel> panel_land_media_handle, const std::string media_url);
/*virtual*/ BOOL postBuild();
- void headerFetchComplete(U32 status, const std::string& mime_type);
+ void headerFetchComplete(S32 status, const std::string& mime_type);
bool addURLToCombobox(const std::string& media_url);
diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp
index 68dbb5ae33..3f3d87b564 100755
--- a/indra/newview/llfloaterwebcontent.cpp
+++ b/indra/newview/llfloaterwebcontent.cpp
@@ -29,7 +29,10 @@
#include "llcombobox.h"
#include "lliconctrl.h"
#include "llfloaterreg.h"
+#include "llhttpconstants.h"
#include "llfacebookconnect.h"
+#include "llflickrconnect.h"
+#include "lltwitterconnect.h"
#include "lllayoutstack.h"
#include "llpluginclassmedia.h"
#include "llprogressbar.h"
@@ -51,12 +54,13 @@ LLFloaterWebContent::_Params::_Params()
allow_back_forward_navigation("allow_back_forward_navigation", true),
preferred_media_size("preferred_media_size"),
trusted_content("trusted_content", false),
- show_page_title("show_page_title", true)
+ show_page_title("show_page_title", true),
+ clean_browser("clean_browser", false)
{}
LLFloaterWebContent::LLFloaterWebContent( const Params& params )
: LLFloater( params ),
- LLInstanceTracker<LLFloaterWebContent, std::string>(params.id()),
+ LLInstanceTracker<LLFloaterWebContent, std::string, LLInstanceTrackerReplaceOnCollision>(params.id()),
mWebBrowser(NULL),
mAddressCombo(NULL),
mSecureLockIcon(NULL),
@@ -70,8 +74,7 @@ LLFloaterWebContent::LLFloaterWebContent( const Params& params )
mShowPageTitle(params.show_page_title),
mAllowNavigation(true),
mCurrentURL(""),
- mDisplayURL(""),
- mSecureURL(false)
+ mDisplayURL("")
{
mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this ));
mCommitCallbackRegistrar.add( "WebContent.Forward", boost::bind( &LLFloaterWebContent::onClickForward, this ));
@@ -192,7 +195,7 @@ void LLFloaterWebContent::geometryChanged(S32 x, S32 y, S32 width, S32 height)
width + getRect().getWidth() - browser_rect.getWidth(),
height + getRect().getHeight() - browser_rect.getHeight());
- lldebugs << "geometry change: " << geom << llendl;
+ LL_DEBUGS() << "geometry change: " << geom << LL_ENDL;
LLRect new_rect;
getParent()->screenRectToLocal(geom, &new_rect);
@@ -202,7 +205,7 @@ void LLFloaterWebContent::geometryChanged(S32 x, S32 y, S32 width, S32 height)
// static
void LLFloaterWebContent::preCreate(LLFloaterWebContent::Params& p)
{
- lldebugs << "url = " << p.url() << ", target = " << p.target() << ", uuid = " << p.id() << llendl;
+ LL_DEBUGS() << "url = " << p.url() << ", target = " << p.target() << ", uuid = " << p.id() << LL_ENDL;
if (!p.id.isProvided())
{
@@ -221,11 +224,11 @@ void LLFloaterWebContent::preCreate(LLFloaterWebContent::Params& p)
// and close the least recently opened one if this will put us over the limit.
LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList(p.window_class);
- lldebugs << "total instance count is " << instances.size() << llendl;
+ LL_DEBUGS() << "total instance count is " << instances.size() << LL_ENDL;
for(LLFloaterReg::const_instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); iter++)
{
- lldebugs << " " << (*iter)->getKey()["target"] << llendl;
+ LL_DEBUGS() << " " << (*iter)->getKey()["target"] << LL_ENDL;
}
if(instances.size() >= (size_t)browser_window_limit)
@@ -240,9 +243,9 @@ void LLFloaterWebContent::open_media(const Params& p)
{
// Specifying a mime type of text/html here causes the plugin system to skip the MIME type probe and just open a browser plugin.
LLViewerMedia::proxyWindowOpened(p.target(), p.id());
- mWebBrowser->setHomePageUrl(p.url, "text/html");
+ mWebBrowser->setHomePageUrl(p.url, HTTP_CONTENT_TEXT_HTML);
mWebBrowser->setTarget(p.target);
- mWebBrowser->navigateTo(p.url, "text/html");
+ mWebBrowser->navigateTo(p.url, HTTP_CONTENT_TEXT_HTML, p.clean_browser);
set_current_url(p.url);
@@ -253,11 +256,6 @@ void LLFloaterWebContent::open_media(const Params& p)
getChildView("address")->setEnabled(address_entry_enabled);
getChildView("popexternal")->setEnabled(address_entry_enabled);
- if (!address_entry_enabled)
- {
- mWebBrowser->setFocus(TRUE);
- }
-
if (!p.show_chrome)
{
setResizeLimits(100, 100);
@@ -295,7 +293,7 @@ void LLFloaterWebContent::onOpen(const LLSD& key)
void LLFloaterWebContent::onClose(bool app_quitting)
{
// If we close the web browsing window showing the facebook login, we need to signal to this object that the connection will not happen
- LLFloater* fbc_web = LLFloaterReg::getInstance("fbc_web");
+ LLFloater* fbc_web = LLFloaterReg::findInstance("fbc_web");
if (fbc_web == this)
{
if (!LLFacebookConnect::instance().isConnected())
@@ -303,7 +301,24 @@ void LLFloaterWebContent::onClose(bool app_quitting)
LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_FAILED);
}
}
-
+ // Same with Flickr
+ LLFloater* flickr_web = LLFloaterReg::getInstance("flickr_web");
+ if (flickr_web == this)
+ {
+ if (!LLFlickrConnect::instance().isConnected())
+ {
+ LLFlickrConnect::instance().setConnectionState(LLFlickrConnect::FLICKR_CONNECTION_FAILED);
+ }
+ }
+ // And Twitter
+ LLFloater* twitter_web = LLFloaterReg::getInstance("twitter_web");
+ if (twitter_web == this)
+ {
+ if (!LLTwitterConnect::instance().isConnected())
+ {
+ LLTwitterConnect::instance().setConnectionState(LLTwitterConnect::TWITTER_CONNECTION_FAILED);
+ }
+ }
LLViewerMedia::proxyWindowClosed(mUUID);
destroy();
}
@@ -315,9 +330,6 @@ void LLFloaterWebContent::draw()
mBtnBack->setEnabled( mWebBrowser->canNavigateBack() && mAllowNavigation);
mBtnForward->setEnabled( mWebBrowser->canNavigateForward() && mAllowNavigation);
- // Show/hide the lock icon
- mSecureLockIcon->setVisible(mSecureURL && !mAddressCombo->hasFocus());
-
LLFloater::draw();
}
@@ -362,8 +374,6 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
// we populate the status bar with URLs as they change so clear it now we're done
const std::string end_str = "";
mStatusBarText->setText( end_str );
- mAddressCombo->setLeftTextPadding(22);
- mAddressCombo->setLeftTextPadding(2);
}
else if(event == MEDIA_EVENT_CLOSE_REQUEST)
{
@@ -374,8 +384,8 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
{
if (mCurrentURL.find("facebook.com/dialog/oauth") == std::string::npos) // HACK to fix ACME-1317 - Cho
{
- geometryChanged(self->getGeometryX(), self->getGeometryY(), self->getGeometryWidth(), self->getGeometryHeight());
- }
+ geometryChanged(self->getGeometryX(), self->getGeometryY(), self->getGeometryWidth(), self->getGeometryHeight());
+ }
}
else if(event == MEDIA_EVENT_STATUS_TEXT_CHANGED )
{
@@ -430,18 +440,15 @@ void LLFloaterWebContent::set_current_url(const std::string& url)
static const std::string secure_prefix = std::string("https://");
std::string prefix = mCurrentURL.substr(0, secure_prefix.length());
LLStringUtil::toLower(prefix);
- mSecureURL = (prefix == secure_prefix);
-
- // Hack : we move the text a bit to make space for the lock icon in the secure URL case
- mDisplayURL = (mSecureURL ? " " + mCurrentURL : mCurrentURL);
+ bool secure_url = (prefix == secure_prefix);
+ mSecureLockIcon->setVisible(secure_url);
+ mAddressCombo->setLeftTextPadding(secure_url ? 22 : 2);
+ mDisplayURL = mCurrentURL;
// Clean up browsing list (prevent dupes) and add/select the new URL to it
mAddressCombo->remove(mCurrentURL);
mAddressCombo->add(mDisplayURL);
mAddressCombo->selectByValue(mDisplayURL);
-
- // Set the focus back to the web page. When setting the url, there's no point to leave the focus anywhere else.
- mWebBrowser->setFocus(TRUE);
}
}
@@ -489,7 +496,7 @@ void LLFloaterWebContent::onEnterAddress()
LLStringUtil::trim(url);
if ( url.length() > 0 )
{
- mWebBrowser->navigateTo( url, "text/html");
+ mWebBrowser->navigateTo(url, HTTP_CONTENT_TEXT_HTML);
};
}
diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h
index f22940cd07..4291fd9f2c 100755
--- a/indra/newview/llfloaterwebcontent.h
+++ b/indra/newview/llfloaterwebcontent.h
@@ -40,11 +40,11 @@ class LLIconCtrl;
class LLFloaterWebContent :
public LLFloater,
public LLViewerMediaObserver,
- public LLInstanceTracker<LLFloaterWebContent, std::string>
+ public LLInstanceTracker<LLFloaterWebContent, std::string, LLInstanceTrackerReplaceOnCollision>
{
public:
- typedef LLInstanceTracker<LLFloaterWebContent, std::string> instance_tracker_t;
+ typedef LLInstanceTracker<LLFloaterWebContent, std::string, LLInstanceTrackerReplaceOnCollision> instance_tracker_t;
LOG_CLASS(LLFloaterWebContent);
struct _Params : public LLInitParam::Block<_Params>
@@ -57,7 +57,8 @@ public:
allow_address_entry,
allow_back_forward_navigation,
trusted_content,
- show_page_title;
+ show_page_title,
+ clean_browser;
Optional<LLRect> preferred_media_size;
_Params();
@@ -112,7 +113,6 @@ protected:
std::string mUUID;
bool mShowPageTitle;
bool mAllowNavigation;
- bool mSecureURL; // true when the current url is prefixed "https://"
};
#endif // LL_LLFLOATERWEBCONTENT_H
diff --git a/indra/newview/llfloaterwebprofile.cpp b/indra/newview/llfloaterwebprofile.cpp
index c41f6f148f..a46f1d8af2 100755
--- a/indra/newview/llfloaterwebprofile.cpp
+++ b/indra/newview/llfloaterwebprofile.cpp
@@ -47,11 +47,11 @@ void LLFloaterWebProfile::onOpen(const LLSD& key)
// virtual
void LLFloaterWebProfile::handleReshape(const LLRect& new_rect, bool by_user)
{
- lldebugs << "handleReshape: " << new_rect << llendl;
+ LL_DEBUGS() << "handleReshape: " << new_rect << LL_ENDL;
if (by_user && !isMinimized())
{
- lldebugs << "Storing new rect" << llendl;
+ LL_DEBUGS() << "Storing new rect" << LL_ENDL;
gSavedSettings.setRect("WebProfileFloaterRect", new_rect);
}
@@ -68,7 +68,7 @@ LLFloater* LLFloaterWebProfile::create(const LLSD& key)
void LLFloaterWebProfile::applyPreferredRect()
{
const LLRect preferred_rect = gSavedSettings.getRect("WebProfileFloaterRect");
- lldebugs << "Applying preferred rect: " << preferred_rect << llendl;
+ LL_DEBUGS() << "Applying preferred rect: " << preferred_rect << LL_ENDL;
// Don't override position that may have been set by floater stacking code.
LLRect new_rect = getRect();
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index cb637c7162..ff66bdedb0 100755
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -570,9 +570,9 @@ void LLFloaterWorldMap::trackLandmark( const LLUUID& landmark_item_id )
buildLandmarkIDLists();
BOOL found = FALSE;
S32 idx;
- for (idx = 0; idx < mLandmarkItemIDList.count(); idx++)
+ for (idx = 0; idx < mLandmarkItemIDList.size(); idx++)
{
- if ( mLandmarkItemIDList.get(idx) == landmark_item_id)
+ if ( mLandmarkItemIDList.at(idx) == landmark_item_id)
{
found = TRUE;
break;
@@ -581,13 +581,13 @@ void LLFloaterWorldMap::trackLandmark( const LLUUID& landmark_item_id )
if (found && iface->setCurrentByID( landmark_item_id ) )
{
- LLUUID asset_id = mLandmarkAssetIDList.get( idx );
+ LLUUID asset_id = mLandmarkAssetIDList.at( idx );
std::string name;
LLComboBox* combo = getChild<LLComboBox>( "landmark combo");
if (combo) name = combo->getSimple();
mTrackedStatus = LLTracker::TRACKING_LANDMARK;
- LLTracker::trackLandmark(mLandmarkAssetIDList.get( idx ), // assetID
- mLandmarkItemIDList.get( idx ), // itemID
+ LLTracker::trackLandmark(mLandmarkAssetIDList.at( idx ), // assetID
+ mLandmarkItemIDList.at( idx ), // itemID
name); // name
if( asset_id != sHomeID )
@@ -911,15 +911,15 @@ void LLFloaterWorldMap::buildLandmarkIDLists()
list->operateOnSelection(LLCtrlListInterface::OP_DELETE);
}
- mLandmarkItemIDList.reset();
- mLandmarkAssetIDList.reset();
+ mLandmarkItemIDList.clear();
+ mLandmarkAssetIDList.clear();
// Get all of the current landmarks
- mLandmarkAssetIDList.put( LLUUID::null );
- mLandmarkItemIDList.put( LLUUID::null );
+ mLandmarkAssetIDList.push_back( LLUUID::null );
+ mLandmarkItemIDList.push_back( LLUUID::null );
- mLandmarkAssetIDList.put( sHomeID );
- mLandmarkItemIDList.put( sHomeID );
+ mLandmarkAssetIDList.push_back( sHomeID );
+ mLandmarkItemIDList.push_back( sHomeID );
LLInventoryModel::cat_array_t cats;
LLInventoryModel::item_array_t items;
@@ -932,15 +932,18 @@ void LLFloaterWorldMap::buildLandmarkIDLists()
std::sort(items.begin(), items.end(), LLViewerInventoryItem::comparePointers());
- S32 count = items.count();
+ mLandmarkAssetIDList.reserve(mLandmarkAssetIDList.size() + items.size());
+ mLandmarkItemIDList.reserve(mLandmarkItemIDList.size() + items.size());
+
+ S32 count = items.size();
for(S32 i = 0; i < count; ++i)
{
- LLInventoryItem* item = items.get(i);
+ LLInventoryItem* item = items.at(i);
list->addSimpleElement(item->getName(), ADD_BOTTOM, item->getUUID());
- mLandmarkAssetIDList.put( item->getAssetUUID() );
- mLandmarkItemIDList.put( item->getUUID() );
+ mLandmarkAssetIDList.push_back( item->getAssetUUID() );
+ mLandmarkItemIDList.push_back( item->getUUID() );
}
list->selectFirstItem();
diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h
index e3b83b2579..84ca5a7a71 100755
--- a/indra/newview/llfloaterworldmap.h
+++ b/indra/newview/llfloaterworldmap.h
@@ -32,7 +32,6 @@
#ifndef LL_LLFLOATERWORLDMAP_H
#define LL_LLFLOATERWORLDMAP_H
-#include "lldarray.h"
#include "llfloater.h"
#include "llhudtext.h"
#include "llmapimagetype.h"
@@ -166,8 +165,8 @@ private:
// enable/disable teleport destination coordinates
void enableTeleportCoordsDisplay( bool enabled );
- LLDynamicArray<LLUUID> mLandmarkAssetIDList;
- LLDynamicArray<LLUUID> mLandmarkItemIDList;
+ std::vector<LLUUID> mLandmarkAssetIDList;
+ std::vector<LLUUID> mLandmarkItemIDList;
static const LLUUID sHomeID;
diff --git a/indra/newview/llfolderviewmodelinventory.cpp b/indra/newview/llfolderviewmodelinventory.cpp
index aac3a41b9e..7615c12043 100755
--- a/indra/newview/llfolderviewmodelinventory.cpp
+++ b/indra/newview/llfolderviewmodelinventory.cpp
@@ -34,7 +34,7 @@
//
// class LLFolderViewModelInventory
//
-static LLFastTimer::DeclareTimer FTM_INVENTORY_SORT("Sort");
+static LLTrace::BlockTimerStatHandle FTM_INVENTORY_SORT("Inventory Sort");
bool LLFolderViewModelInventory::startDrag(std::vector<LLFolderViewModelItem*>& items)
{
@@ -63,7 +63,7 @@ bool LLFolderViewModelInventory::startDrag(std::vector<LLFolderViewModelItem*>&
void LLFolderViewModelInventory::sort( LLFolderViewFolder* folder )
{
- LLFastTimer _(FTM_INVENTORY_SORT);
+ LL_RECORD_BLOCK_TIME(FTM_INVENTORY_SORT);
if (!needsSort(folder->getViewModelItem())) return;
@@ -133,9 +133,9 @@ void LLFolderViewModelItemInventory::setPassedFilter(bool passed, S32 filter_gen
bool before = mPrevPassedAllFilters;
mPrevPassedAllFilters = passedFilter(filter_generation);
- if (before != mPrevPassedAllFilters)
+ if (before != mPrevPassedAllFilters)
{
- // Need to rearrange the folder if the filtered state of the item changed
+ // Need to rearrange the folder if the filtered state of the item changed
LLFolderViewFolder* parent_folder = mFolderViewItem->getParentFolder();
if (parent_folder)
{
diff --git a/indra/newview/llfolderviewmodelinventory.h b/indra/newview/llfolderviewmodelinventory.h
index 9dcfdfa185..8772185ad0 100755
--- a/indra/newview/llfolderviewmodelinventory.h
+++ b/indra/newview/llfolderviewmodelinventory.h
@@ -105,6 +105,10 @@ class LLFolderViewModelInventory
public:
typedef LLFolderViewModel<LLInventorySort, LLFolderViewModelItemInventory, LLFolderViewModelItemInventory, LLInventoryFilter> base_t;
+ LLFolderViewModelInventory(const std::string& name)
+ : base_t(new LLInventorySort(), new LLInventoryFilter(LLInventoryFilter::Params().name(name)))
+ {}
+
void setTaskID(const LLUUID& id) {mTaskID = id;}
void sort(LLFolderViewFolder* folder);
diff --git a/indra/newview/llfollowcam.cpp b/indra/newview/llfollowcam.cpp
index 47612fe25c..612afc0d18 100755
--- a/indra/newview/llfollowcam.cpp
+++ b/indra/newview/llfollowcam.cpp
@@ -327,11 +327,11 @@ void LLFollowCam::update()
F32 force = focusOffsetDistance - focusThresholdNormalizedByDistance;
*/
- F32 focusLagLerp = LLCriticalDamp::getInterpolant( mFocusLag );
+ F32 focusLagLerp = LLSmoothInterpolation::getInterpolant( mFocusLag );
focus_pt_agent = lerp( focus_pt_agent, whereFocusWantsToBe, focusLagLerp );
mSimulatedFocusGlobal = gAgent.getPosGlobalFromAgent(focus_pt_agent);
}
- mRelativeFocus = lerp(mRelativeFocus, (focus_pt_agent - mSubjectPosition) * ~mSubjectRotation, LLCriticalDamp::getInterpolant(0.05f));
+ mRelativeFocus = lerp(mRelativeFocus, (focus_pt_agent - mSubjectPosition) * ~mSubjectRotation, LLSmoothInterpolation::getInterpolant(0.05f));
}// if focus is not locked ---------------------------------------------
@@ -414,7 +414,7 @@ void LLFollowCam::update()
//-------------------------------------------------------------------------------------------------
if ( distanceFromPositionToIdealPosition > mPositionThreshold )
{
- F32 positionPullLerp = LLCriticalDamp::getInterpolant( mPositionLag );
+ F32 positionPullLerp = LLSmoothInterpolation::getInterpolant( mPositionLag );
simulated_pos_agent = lerp( simulated_pos_agent, whereCameraPositionWantsToBe, positionPullLerp );
}
@@ -434,7 +434,7 @@ void LLFollowCam::update()
updateBehindnessConstraint(gAgent.getPosAgentFromGlobal(mSimulatedFocusGlobal), simulated_pos_agent);
mSimulatedPositionGlobal = gAgent.getPosGlobalFromAgent(simulated_pos_agent);
- mRelativePos = lerp(mRelativePos, (simulated_pos_agent - mSubjectPosition) * ~mSubjectRotation, LLCriticalDamp::getInterpolant(0.05f));
+ mRelativePos = lerp(mRelativePos, (simulated_pos_agent - mSubjectPosition) * ~mSubjectRotation, LLSmoothInterpolation::getInterpolant(0.05f));
} // if position is not locked -----------------------------------------------------------
@@ -489,7 +489,7 @@ BOOL LLFollowCam::updateBehindnessConstraint(LLVector3 focus, LLVector3& cam_pos
if ( cameraOffsetAngle > mBehindnessMaxAngle )
{
- F32 fraction = ((cameraOffsetAngle - mBehindnessMaxAngle) / cameraOffsetAngle) * LLCriticalDamp::getInterpolant(mBehindnessLag);
+ F32 fraction = ((cameraOffsetAngle - mBehindnessMaxAngle) / cameraOffsetAngle) * LLSmoothInterpolation::getInterpolant(mBehindnessLag);
cam_position = focus + horizontalSubjectBack * (slerp(fraction, camera_offset_rotation, LLQuaternion::DEFAULT));
cam_position.mV[VZ] = cameraZ; // clamp z value back to what it was before we started messing with it
constraint_active = TRUE;
@@ -876,12 +876,12 @@ bool LLFollowCamMgr::isScriptedCameraSource(const LLUUID& source)
void LLFollowCamMgr::dump()
{
S32 param_count = 0;
- llinfos << "Scripted camera active stack" << llendl;
+ LL_INFOS() << "Scripted camera active stack" << LL_ENDL;
for (param_stack_t::iterator param_it = sParamStack.begin();
param_it != sParamStack.end();
++param_it)
{
- llinfos << param_count++ <<
+ LL_INFOS() << param_count++ <<
" rot_limit: " << (*param_it)->getBehindnessAngle() <<
" rot_lag: " << (*param_it)->getBehindnessLag() <<
" distance: " << (*param_it)->getDistance() <<
@@ -894,7 +894,7 @@ void LLFollowCamMgr::dump()
" pos: " << (*param_it)->getPosition() <<
" pos_lag: " << (*param_it)->getPositionLag() <<
" pos_lock: " << ((*param_it)->getPositionLocked() ? "Y" : "N") <<
- " pos_thresh: " << (*param_it)->getPositionThreshold() << llendl;
+ " pos_thresh: " << (*param_it)->getPositionThreshold() << LL_ENDL;
}
}
diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp
index 16ed3f990c..307e259006 100755
--- a/indra/newview/llfriendcard.cpp
+++ b/indra/newview/llfriendcard.cpp
@@ -38,6 +38,7 @@
#include "llcallingcard.h" // for LLAvatarTracker
#include "llviewerinventory.h"
#include "llinventorymodel.h"
+#include "llcallbacklist.h"
// Constants;
@@ -67,10 +68,10 @@ inline const std::string get_friend_all_subfolder_name()
void move_from_to_arrays(LLInventoryModel::cat_array_t& from, LLInventoryModel::cat_array_t& to)
{
- while (from.count() > 0)
+ while (from.size() > 0)
{
- to.put(from.get(0));
- from.remove(0);
+ to.push_back(from.at(0));
+ from.erase(from.begin());
}
}
@@ -82,17 +83,17 @@ const LLUUID& get_folder_uuid(const LLUUID& parentFolderUUID, LLInventoryCollect
gInventory.collectDescendentsIf(parentFolderUUID, cats, items,
LLInventoryModel::EXCLUDE_TRASH, matchFunctor);
- S32 cats_count = cats.count();
+ S32 cats_count = cats.size();
if (cats_count > 1)
{
- LL_WARNS("LLFriendCardsManager")
+ LL_WARNS_ONCE("LLFriendCardsManager")
<< "There is more than one Friend card folder."
<< "The first folder will be used."
<< LL_ENDL;
}
- return (cats_count >= 1) ? cats.get(0)->getUUID() : LLUUID::null;
+ return (cats_count >= 1) ? cats.at(0)->getUUID() : LLUUID::null;
}
/**
@@ -154,7 +155,7 @@ void LLInitialFriendCardsFetch::done()
// This observer is no longer needed.
gInventory.removeObserver(this);
- mCheckFolderCallback();
+ doOnIdleOneTime(mCheckFolderCallback);
delete this;
}
@@ -172,14 +173,14 @@ LLFriendCardsManager::~LLFriendCardsManager()
void LLFriendCardsManager::putAvatarData(const LLUUID& avatarID)
{
- llinfos << "Store avatar data, avatarID: " << avatarID << llendl;
+ LL_INFOS() << "Store avatar data, avatarID: " << avatarID << LL_ENDL;
std::pair< avatar_uuid_set_t::iterator, bool > pr;
pr = mBuddyIDSet.insert(avatarID);
if (pr.second == false)
{
- llwarns << "Trying to add avatar UUID for the stored avatar: "
+ LL_WARNS() << "Trying to add avatar UUID for the stored avatar: "
<< avatarID
- << llendl;
+ << LL_ENDL;
}
}
@@ -189,7 +190,7 @@ const LLUUID LLFriendCardsManager::extractAvatarID(const LLUUID& avatarID)
avatar_uuid_set_t::iterator it = mBuddyIDSet.find(avatarID);
if (mBuddyIDSet.end() == it)
{
- llwarns << "Call method for non-existent avatar name in the map: " << avatarID << llendl;
+ LL_WARNS() << "Call method for non-existent avatar name in the map: " << avatarID << LL_ENDL;
}
else
{
@@ -207,7 +208,7 @@ bool LLFriendCardsManager::isItemInAnyFriendsList(const LLViewerInventoryItem* i
LLInventoryModel::item_array_t items;
findMatchedFriendCards(item->getCreatorUUID(), items);
- return items.count() > 0;
+ return items.size() > 0;
}
@@ -242,9 +243,9 @@ bool LLFriendCardsManager::isObjDirectDescendentOfCategory(const LLInventoryObje
{
LLUUID creator_id = item->getCreatorUUID();
LLViewerInventoryItem* cur_item = NULL;
- for ( S32 i = items->count() - 1; i >= 0; --i )
+ for ( S32 i = items->size() - 1; i >= 0; --i )
{
- cur_item = items->get(i);
+ cur_item = items->at(i);
if ( creator_id == cur_item->getCreatorUUID() )
{
result = true;
@@ -259,9 +260,9 @@ bool LLFriendCardsManager::isObjDirectDescendentOfCategory(const LLInventoryObje
// Note: UUID's of compared items also may be not equal.
std::string obj_name = obj->getName();
LLViewerInventoryItem* cur_item = NULL;
- for ( S32 i = items->count() - 1; i >= 0; --i )
+ for ( S32 i = items->size() - 1; i >= 0; --i )
{
- cur_item = items->get(i);
+ cur_item = items->at(i);
if ( obj->getType() != cur_item->getType() )
continue;
if ( obj_name == cur_item->getName() )
@@ -279,9 +280,9 @@ bool LLFriendCardsManager::isObjDirectDescendentOfCategory(const LLInventoryObje
// then return true. Note: UUID's of compared items also may be not equal.
std::string obj_name = obj->getName();
LLViewerInventoryCategory* cur_cat = NULL;
- for ( S32 i = cats->count() - 1; i >= 0; --i )
+ for ( S32 i = cats->size() - 1; i >= 0; --i )
{
- cur_cat = cats->get(i);
+ cur_cat = cats->at(i);
if ( obj->getType() != cur_cat->getType() )
continue;
if ( obj_name == cur_cat->getName() )
@@ -381,10 +382,10 @@ void LLFriendCardsManager::findMatchedFriendCards(const LLUUID& avatarID, LLInve
LLInventoryModel::cat_array_t subFolders;
subFolders.push_back(friendFolder);
- while (subFolders.count() > 0)
+ while (subFolders.size() > 0)
{
- LLViewerInventoryCategory* cat = subFolders.get(0);
- subFolders.remove(0);
+ LLViewerInventoryCategory* cat = subFolders.at(0);
+ subFolders.erase(subFolders.begin());
gInventory.collectDescendentsIf(cat->getUUID(), cats, items,
LLInventoryModel::EXCLUDE_TRASH, matchFunctor);
@@ -431,7 +432,7 @@ void LLFriendCardsManager::ensureFriendsFolderExists()
{
LLViewerInventoryCategory* cat = gInventory.getCategory(calling_cards_folder_ID);
std::string cat_name = cat ? cat->getName() : "unknown";
- llwarns << "Failed to find \"" << cat_name << "\" category descendents in Category Tree." << llendl;
+ LL_WARNS() << "Failed to find \"" << cat_name << "\" category descendents in Category Tree." << LL_ENDL;
}
friends_folder_ID = gInventory.createNewCategory(calling_cards_folder_ID,
@@ -462,7 +463,7 @@ void LLFriendCardsManager::ensureFriendsAllFolderExists()
{
LLViewerInventoryCategory* cat = gInventory.getCategory(friends_folder_ID);
std::string cat_name = cat ? cat->getName() : "unknown";
- llwarns << "Failed to find \"" << cat_name << "\" category descendents in Category Tree." << llendl;
+ LL_WARNS() << "Failed to find \"" << cat_name << "\" category descendents in Category Tree." << LL_ENDL;
}
friends_all_folder_ID = gInventory.createNewCategory(friends_folder_ID,
@@ -507,7 +508,7 @@ void LLFriendCardsManager::syncFriendsFolder()
// 2. Add missing Friend Cards for friends
LLAvatarTracker::buddy_map_t::const_iterator buddy_it = all_buddies.begin();
- llinfos << "try to build friends, count: " << all_buddies.size() << llendl;
+ LL_INFOS() << "try to build friends, count: " << all_buddies.size() << LL_ENDL;
for(; buddy_it != all_buddies.end(); ++buddy_it)
{
const LLUUID& buddy_id = (*buddy_it).first;
@@ -535,26 +536,26 @@ void LLFriendCardsManager::addFriendCardToInventory(const LLUUID& avatarID)
LLAvatarNameCache::get(avatarID, &av_name);
const std::string& name = av_name.getAccountName();
- lldebugs << "Processing buddy name: " << name
+ LL_DEBUGS() << "Processing buddy name: " << name
<< ", id: " << avatarID
- << llendl;
+ << LL_ENDL;
if (shouldBeAdded && findFriendCardInventoryUUIDImpl(avatarID).notNull())
{
shouldBeAdded = false;
- lldebugs << "is found in Inventory: " << name << llendl;
+ LL_DEBUGS() << "is found in Inventory: " << name << LL_ENDL;
}
if (shouldBeAdded && isAvatarDataStored(avatarID))
{
shouldBeAdded = false;
- lldebugs << "is found in sentRequests: " << name << llendl;
+ LL_DEBUGS() << "is found in sentRequests: " << name << LL_ENDL;
}
if (shouldBeAdded)
{
putAvatarData(avatarID);
- lldebugs << "Sent create_inventory_item for " << avatarID << ", " << name << llendl;
+ LL_DEBUGS() << "Sent create_inventory_item for " << avatarID << ", " << name << LL_ENDL;
// TODO: mantipov: Is CreateFriendCardCallback really needed? Probably not
LLPointer<LLInventoryCallback> cb = new CreateFriendCardCallback;
diff --git a/indra/newview/llgesturelistener.cpp b/indra/newview/llgesturelistener.cpp
index 2fff506681..6fd749d83e 100755
--- a/indra/newview/llgesturelistener.cpp
+++ b/indra/newview/llgesturelistener.cpp
@@ -101,12 +101,12 @@ void LLGestureListener::isGesturePlaying(const LLSD& event_data) const
}
else
{
- llwarns << "isGesturePlaying did not find a gesture object for " << gesture_id << llendl;
+ LL_WARNS() << "isGesturePlaying did not find a gesture object for " << gesture_id << LL_ENDL;
}
}
else
{
- llwarns << "isGesturePlaying didn't have 'id' value passed in" << llendl;
+ LL_WARNS() << "isGesturePlaying didn't have 'id' value passed in" << LL_ENDL;
}
LLSD reply = LLSD::emptyMap();
@@ -148,12 +148,12 @@ void LLGestureListener::startOrStopGesture(LLSD const & event_data, bool start)
}
else
{
- llwarns << "startOrStopGesture did not find a gesture object for " << gesture_id << llendl;
+ LL_WARNS() << "startOrStopGesture did not find a gesture object for " << gesture_id << LL_ENDL;
}
}
else
{
- llwarns << "startOrStopGesture didn't have 'id' value passed in" << llendl;
+ LL_WARNS() << "startOrStopGesture didn't have 'id' value passed in" << LL_ENDL;
}
}
diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp
index b56c34573d..119872ec29 100755
--- a/indra/newview/llgesturemgr.cpp
+++ b/indra/newview/llgesturemgr.cpp
@@ -257,19 +257,19 @@ void LLGestureMgr::activateGestureWithAsset(const LLUUID& item_id,
if( !gAssetStorage )
{
- llwarns << "LLGestureMgr::activateGestureWithAsset without valid gAssetStorage" << llendl;
+ LL_WARNS() << "LLGestureMgr::activateGestureWithAsset without valid gAssetStorage" << LL_ENDL;
return;
}
// If gesture is already active, nothing to do.
if (isGestureActive(item_id))
{
- llwarns << "Tried to loadGesture twice " << item_id << llendl;
+ LL_WARNS() << "Tried to loadGesture twice " << item_id << LL_ENDL;
return;
}
// if (asset_id.isNull())
// {
-// llwarns << "loadGesture() - gesture has no asset" << llendl;
+// LL_WARNS() << "loadGesture() - gesture has no asset" << LL_ENDL;
// return;
// }
@@ -299,13 +299,19 @@ void LLGestureMgr::activateGestureWithAsset(const LLUUID& item_id,
}
+void notify_update_label(const LLUUID& base_item_id)
+{
+ gInventory.addChangedMask(LLInventoryObserver::LABEL, base_item_id);
+ LLGestureMgr::instance().notifyObservers();
+}
+
void LLGestureMgr::deactivateGesture(const LLUUID& item_id)
{
const LLUUID& base_item_id = get_linked_uuid(item_id);
item_map_t::iterator it = mActive.find(base_item_id);
if (it == mActive.end())
{
- llwarns << "deactivateGesture for inactive gesture " << item_id << llendl;
+ LL_WARNS() << "deactivateGesture for inactive gesture " << item_id << LL_ENDL;
return;
}
@@ -322,7 +328,6 @@ void LLGestureMgr::deactivateGesture(const LLUUID& item_id)
}
mActive.erase(it);
- gInventory.addChangedMask(LLInventoryObserver::LABEL, base_item_id);
// Inform the database of this change
LLMessageSystem* msg = gMessageSystem;
@@ -338,9 +343,11 @@ void LLGestureMgr::deactivateGesture(const LLUUID& item_id)
gAgent.sendReliableMessage();
- LLAppearanceMgr::instance().removeCOFItemLinks(base_item_id);
+ LLPointer<LLInventoryCallback> cb =
+ new LLBoostFuncInventoryCallback(no_op_inventory_func,
+ boost::bind(notify_update_label,base_item_id));
- notifyObservers();
+ LLAppearanceMgr::instance().removeCOFItemLinks(base_item_id, cb);
}
@@ -469,7 +476,7 @@ void LLGestureMgr::replaceGesture(const LLUUID& item_id, LLMultiGesture* new_ges
item_map_t::iterator it = mActive.find(base_item_id);
if (it == mActive.end())
{
- llwarns << "replaceGesture for inactive gesture " << base_item_id << llendl;
+ LL_WARNS() << "replaceGesture for inactive gesture " << base_item_id << LL_ENDL;
return;
}
@@ -511,7 +518,7 @@ void LLGestureMgr::replaceGesture(const LLUUID& item_id, const LLUUID& new_asset
item_map_t::iterator it = LLGestureMgr::instance().mActive.find(base_item_id);
if (it == mActive.end())
{
- llwarns << "replaceGesture for inactive gesture " << base_item_id << llendl;
+ LL_WARNS() << "replaceGesture for inactive gesture " << base_item_id << LL_ENDL;
return;
}
@@ -586,7 +593,7 @@ void LLGestureMgr::playGesture(LLMultiGesture* gesture)
}
default:
{
- llwarns << "Unknown gesture step type: " << step->getType() << llendl;
+ LL_WARNS() << "Unknown gesture step type: " << step->getType() << LL_ENDL;
}
}
}
@@ -907,8 +914,8 @@ void LLGestureMgr::stepGesture(LLMultiGesture* gesture)
else if (gesture->mWaitTimer.getElapsedTimeF32() > MAX_WAIT_ANIM_SECS)
{
// we've waited too long for an animation
- llinfos << "Waited too long for animations to stop, continuing gesture."
- << llendl;
+ LL_INFOS() << "Waited too long for animations to stop, continuing gesture."
+ << LL_ENDL;
gesture->mWaitingAnimations = FALSE;
gesture->mCurrentStep++;
}
@@ -1129,7 +1136,7 @@ void LLGestureMgr::onLoadComplete(LLVFS *vfs,
}
else
{
- llwarns << "Unable to load gesture" << llendl;
+ LL_WARNS() << "Unable to load gesture" << LL_ENDL;
self.mActive.erase(item_id);
@@ -1139,8 +1146,6 @@ void LLGestureMgr::onLoadComplete(LLVFS *vfs,
}
else
{
- LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED );
-
if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ||
LL_ERR_FILE_EMPTY == status)
{
@@ -1151,7 +1156,7 @@ void LLGestureMgr::onLoadComplete(LLVFS *vfs,
LLDelayedGestureError::gestureFailedToLoad( item_id );
}
- llwarns << "Problem loading gesture: " << status << llendl;
+ LL_WARNS() << "Problem loading gesture: " << status << LL_ENDL;
LLGestureMgr::instance().mActive.erase(item_id);
}
@@ -1187,7 +1192,7 @@ void LLGestureMgr::onAssetLoadComplete(LLVFS *vfs,
}
default:
{
- llwarns << "Unexpected asset type: " << type << llendl;
+ LL_WARNS() << "Unexpected asset type: " << type << LL_ENDL;
// We don't want to return from this callback without
// an animation or sound callback being fired
@@ -1242,7 +1247,7 @@ bool LLGestureMgr::hasLoadingAssets(LLMultiGesture* gesture)
}
default:
{
- llwarns << "Unknown gesture step type: " << step->getType() << llendl;
+ LL_WARNS() << "Unknown gesture step type: " << step->getType() << LL_ENDL;
}
}
}
@@ -1324,7 +1329,7 @@ void LLGestureMgr::removeObserver(LLGestureManagerObserver* observer)
// from the list.
void LLGestureMgr::notifyObservers()
{
- lldebugs << "LLGestureMgr::notifyObservers" << llendl;
+ LL_DEBUGS() << "LLGestureMgr::notifyObservers" << LL_ENDL;
for(std::vector<LLGestureManagerObserver*>::iterator iter = mObservers.begin();
iter != mObservers.end();
@@ -1339,6 +1344,7 @@ BOOL LLGestureMgr::matchPrefix(const std::string& in_str, std::string* out_str)
{
S32 in_len = in_str.length();
+ //return whole trigger, if received text equals to it
item_map_t::iterator it;
for (it = mActive.begin(); it != mActive.end(); ++it)
{
@@ -1346,7 +1352,24 @@ BOOL LLGestureMgr::matchPrefix(const std::string& in_str, std::string* out_str)
if (gesture)
{
const std::string& trigger = gesture->getTrigger();
-
+ if (!LLStringUtil::compareInsensitive(in_str, trigger))
+ {
+ *out_str = trigger;
+ return TRUE;
+ }
+ }
+ }
+
+ //return common chars, if more than one trigger matches the prefix
+ std::string rest_of_match = "";
+ std::string buf = "";
+ for (it = mActive.begin(); it != mActive.end(); ++it)
+ {
+ LLMultiGesture* gesture = (*it).second;
+ if (gesture)
+ {
+ const std::string& trigger = gesture->getTrigger();
+
if (in_len > (S32)trigger.length())
{
// too short, bail out
@@ -1357,11 +1380,49 @@ BOOL LLGestureMgr::matchPrefix(const std::string& in_str, std::string* out_str)
LLStringUtil::truncate(trigger_trunc, in_len);
if (!LLStringUtil::compareInsensitive(in_str, trigger_trunc))
{
- *out_str = trigger;
- return TRUE;
+ if (rest_of_match.compare("") == 0)
+ {
+ rest_of_match = trigger.substr(in_str.size());
+ }
+ std::string cur_rest_of_match = trigger.substr(in_str.size());
+ buf = "";
+ S32 i=0;
+
+ while (i<rest_of_match.length() && i<cur_rest_of_match.length())
+ {
+ if (rest_of_match[i]==cur_rest_of_match[i])
+ {
+ buf.push_back(rest_of_match[i]);
+ }
+ else
+ {
+ if(i==0)
+ {
+ rest_of_match = "";
+ }
+ break;
+ }
+ i++;
+ }
+ if (rest_of_match.compare("") == 0)
+ {
+ return TRUE;
+ }
+ if (buf.compare("") != 0)
+ {
+ rest_of_match = buf;
+ }
+
}
}
}
+
+ if (rest_of_match.compare("") != 0)
+ {
+ *out_str = in_str+rest_of_match;
+ return TRUE;
+ }
+
return FALSE;
}
diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp
index 72bea8db10..813d2081ce 100755
--- a/indra/newview/llgiveinventory.cpp
+++ b/indra/newview/llgiveinventory.cpp
@@ -139,7 +139,7 @@ bool LLGiveInventory::isInventoryGiveAcceptable(const LLInventoryItem* item)
BOOL copyable = false;
if (item->getPermissions().allowCopyBy(gAgentID)) copyable = true;
- if (!copyable && get_is_item_worn(item->getUUID()))
+ if (!copyable || get_is_item_worn(item->getUUID()))
{
acceptable = false;
}
@@ -192,7 +192,7 @@ bool LLGiveInventory::doGiveInventoryItem(const LLUUID& to_agent,
{
bool res = true;
- llinfos << "LLGiveInventory::giveInventory()" << llendl;
+ LL_INFOS() << "LLGiveInventory::giveInventory()" << LL_ENDL;
if (!isInventoryGiveAcceptable(item))
{
return false;
@@ -230,8 +230,8 @@ bool LLGiveInventory::doGiveInventoryCategory(const LLUUID& to_agent,
{
return false;
}
- llinfos << "LLGiveInventory::giveInventoryCategory() - "
- << cat->getUUID() << llendl;
+ LL_INFOS() << "LLGiveInventory::giveInventoryCategory() - "
+ << cat->getUUID() << LL_ENDL;
if (!isAgentAvatarValid())
{
@@ -248,11 +248,11 @@ bool LLGiveInventory::doGiveInventoryCategory(const LLUUID& to_agent,
items,
LLInventoryModel::EXCLUDE_TRASH,
giveable);
- S32 count = cats.count();
+ S32 count = cats.size();
bool complete = true;
for(S32 i = 0; i < count; ++i)
{
- if (!gInventory.isCategoryComplete(cats.get(i)->getUUID()))
+ if (!gInventory.isCategoryComplete(cats.at(i)->getUUID()))
{
complete = false;
break;
@@ -263,7 +263,7 @@ bool LLGiveInventory::doGiveInventoryCategory(const LLUUID& to_agent,
LLNotificationsUtil::add("IncompleteInventory");
give_successful = false;
}
- count = items.count() + cats.count();
+ count = items.size() + cats.size();
if (count > MAX_ITEMS)
{
LLNotificationsUtil::add("TooManyItems");
@@ -447,10 +447,10 @@ bool LLGiveInventory::handleCopyProtectedCategory(const LLSD& notification, cons
items,
LLInventoryModel::EXCLUDE_TRASH,
remove);
- S32 count = items.count();
+ S32 count = items.size();
for(S32 i = 0; i < count; ++i)
{
- gInventory.deleteObject(items.get(i)->getUUID());
+ gInventory.deleteObject(items.at(i)->getUUID());
}
gInventory.notifyObservers();
@@ -484,8 +484,8 @@ bool LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent,
{
return false;
}
- llinfos << "LLGiveInventory::commitGiveInventoryCategory() - "
- << cat->getUUID() << llendl;
+ LL_INFOS() << "LLGiveInventory::commitGiveInventoryCategory() - "
+ << cat->getUUID() << LL_ENDL;
// add buddy to recent people list
LLRecentPeople::instance().add(to_agent);
@@ -504,7 +504,7 @@ bool LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent,
// MAX ITEMS is based on (sizeof(uuid)+2) * count must be <
// MTUBYTES or 18 * count < 1200 => count < 1200/18 =>
// 66. I've cut it down a bit from there to give some pad.
- S32 count = items.count() + cats.count();
+ S32 count = items.size() + cats.size();
if (count > MAX_ITEMS)
{
LLNotificationsUtil::add("TooManyItems");
@@ -530,21 +530,21 @@ bool LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent,
memcpy(pos, &(cat->getUUID()), UUID_BYTES); /* Flawfinder: ignore */
pos += UUID_BYTES;
S32 i;
- count = cats.count();
+ count = cats.size();
for(i = 0; i < count; ++i)
{
memcpy(pos, &type, sizeof(U8)); /* Flawfinder: ignore */
pos += sizeof(U8);
- memcpy(pos, &(cats.get(i)->getUUID()), UUID_BYTES); /* Flawfinder: ignore */
+ memcpy(pos, &(cats.at(i)->getUUID()), UUID_BYTES); /* Flawfinder: ignore */
pos += UUID_BYTES;
}
- count = items.count();
+ count = items.size();
for(i = 0; i < count; ++i)
{
- type = (U8)items.get(i)->getType();
+ type = (U8)items.at(i)->getType();
memcpy(pos, &type, sizeof(U8)); /* Flawfinder: ignore */
pos += sizeof(U8);
- memcpy(pos, &(items.get(i)->getUUID()), UUID_BYTES); /* Flawfinder: ignore */
+ memcpy(pos, &(items.at(i)->getUUID()), UUID_BYTES); /* Flawfinder: ignore */
pos += UUID_BYTES;
}
pack_instant_message(
diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp
index c4c1827266..c386030329 100755
--- a/indra/newview/llglsandbox.cpp
+++ b/indra/newview/llglsandbox.cpp
@@ -624,7 +624,8 @@ void LLViewerParcelMgr::renderCollisionSegments(U8* segments, BOOL use_pass, LLV
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
LLGLDisable cull(GL_CULL_FACE);
- if (mCollisionBanned == BA_BANNED)
+ if (mCollisionBanned == BA_BANNED ||
+ regionp->getRegionFlag(REGION_FLAGS_BLOCK_FLYOVER))
{
collision_height = BAN_HEIGHT;
}
@@ -990,7 +991,7 @@ void gpu_benchmark()
F32 gbps = results[results.size()/2];
- llinfos << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to CPU timers" << llendl;
+ LL_INFOS() << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to CPU timers" << LL_ENDL;
F32 ms = gBenchmarkProgram.mTimeElapsed/1000000.f;
F32 seconds = ms/1000.f;
@@ -1001,11 +1002,11 @@ void gpu_benchmark()
if (gGLManager.mHasTimerQuery)
{
- llinfos << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to ARB_timer_query" << llendl;
+ LL_INFOS() << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to ARB_timer_query" << LL_ENDL;
}
else
{
- llinfos << "ARB_timer_query unavailable." << llendl;
+ LL_INFOS() << "ARB_timer_query unavailable." << LL_ENDL;
}
}
diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp
index 302d21c2e4..913efd6434 100755
--- a/indra/newview/llgroupactions.cpp
+++ b/indra/newview/llgroupactions.cpp
@@ -126,7 +126,7 @@ public:
mRequestProcessed(false),
LLGroupMgrObserver(group_id)
{
- llinfos << "Sending new group member request for group_id: "<< group_id << llendl;
+ LL_INFOS() << "Sending new group member request for group_id: "<< group_id << LL_ENDL;
LLGroupMgr* mgr = LLGroupMgr::getInstance();
// register ourselves as an observer
mgr->addObserver(this);
@@ -140,8 +140,8 @@ public:
if (!mRequestProcessed)
{
// Request is pending
- llwarns << "Destroying pending group member request for group_id: "
- << mGroupId << llendl;
+ LL_WARNS() << "Destroying pending group member request for group_id: "
+ << mGroupId << LL_ENDL;
}
// Remove ourselves as an observer
LLGroupMgr::getInstance()->removeObserver(this);
@@ -149,19 +149,16 @@ public:
void changed(LLGroupChange gc)
{
- if (gc == GC_MEMBER_DATA && !mRequestProcessed)
+ if (gc == GC_PROPERTIES && !mRequestProcessed)
{
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupId);
if (!gdatap)
{
- llwarns << "LLGroupMgr::getInstance()->getGroupData() was NULL" << llendl;
+ LL_WARNS() << "LLGroupMgr::getInstance()->getGroupData() was NULL" << LL_ENDL;
}
else if (!gdatap->isMemberDataComplete())
{
- llwarns << "LLGroupMgr::getInstance()->getGroupData()->isMemberDataComplete() was FALSE" << llendl;
- }
- else
- {
+ LL_WARNS() << "LLGroupMgr::getInstance()->getGroupData()->isMemberDataComplete() was FALSE" << LL_ENDL;
processGroupData();
mRequestProcessed = true;
}
@@ -204,14 +201,14 @@ void LLGroupActions::startCall(const LLUUID& group_id)
if (!gAgent.getGroupData(group_id, gdata))
{
- llwarns << "Error getting group data" << llendl;
+ LL_WARNS() << "Error getting group data" << LL_ENDL;
return;
}
LLUUID session_id = gIMMgr->addSession(gdata.mName, IM_SESSION_GROUP_START, group_id, true);
if (session_id == LLUUID::null)
{
- llwarns << "Error adding session" << llendl;
+ LL_WARNS() << "Error adding session" << LL_ENDL;
return;
}
@@ -257,8 +254,8 @@ void LLGroupActions::join(const LLUUID& group_id)
}
else
{
- llwarns << "LLGroupMgr::getInstance()->getGroupData(" << group_id
- << ") was NULL" << llendl;
+ LL_WARNS() << "LLGroupMgr::getInstance()->getGroupData(" << group_id
+ << ") was NULL" << LL_ENDL;
}
}
diff --git a/indra/newview/llgroupiconctrl.cpp b/indra/newview/llgroupiconctrl.cpp
index 2d0fc26c2a..6abf9ea637 100755
--- a/indra/newview/llgroupiconctrl.cpp
+++ b/indra/newview/llgroupiconctrl.cpp
@@ -30,33 +30,21 @@
#include "llagent.h"
#include "llviewertexture.h"
-/*
-#include "llavatarconstants.h"
-#include "llcallingcard.h" // for LLAvatarTracker
-#include "llavataractions.h"
-#include "llmenugl.h"
-#include "lluictrlfactory.h"
-
-#include "llcachename.h"
-#include "llagentdata.h"
-#include "llfloaterimsession.h"
-*/
static LLDefaultChildRegistry::Register<LLGroupIconCtrl> g_i("group_icon");
LLGroupIconCtrl::Params::Params()
-: group_id("group_id")
-, draw_tooltip("draw_tooltip", true)
-, default_icon_name("default_icon_name")
-{
-}
+: group_id("group_id"),
+ draw_tooltip("draw_tooltip", true),
+ default_icon_name("default_icon_name")
+{}
LLGroupIconCtrl::LLGroupIconCtrl(const LLGroupIconCtrl::Params& p)
-: LLIconCtrl(p)
-, mGroupId(LLUUID::null)
-, mDrawTooltip(p.draw_tooltip)
-, mDefaultIconName(p.default_icon_name)
+: LLIconCtrl(p),
+ mGroupId(LLUUID::null),
+ mDrawTooltip(p.draw_tooltip),
+ mDefaultIconName(p.default_icon_name)
{
mPriority = LLViewerFetchedTexture::BOOST_ICON;
diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp
index aba3d74d87..b1b7a87ae8 100755
--- a/indra/newview/llgrouplist.cpp
+++ b/indra/newview/llgrouplist.cpp
@@ -163,7 +163,7 @@ static bool findInsensitive(std::string haystack, const std::string& needle_uppe
void LLGroupList::refresh()
{
const LLUUID& highlight_id = gAgent.getGroupID();
- S32 count = gAgent.mGroups.count();
+ S32 count = gAgent.mGroups.size();
LLUUID id;
bool have_filter = !mNameFilter.empty();
@@ -171,8 +171,8 @@ void LLGroupList::refresh()
for(S32 i = 0; i < count; ++i)
{
- id = gAgent.mGroups.get(i).mID;
- const LLGroupData& group_data = gAgent.mGroups.get(i);
+ id = gAgent.mGroups.at(i).mID;
+ const LLGroupData& group_data = gAgent.mGroups.at(i);
if (have_filter && !findInsensitive(group_data.mName, mNameFilter))
continue;
addNewItem(id, group_data.mName, group_data.mInsigniaID, ADD_BOTTOM);
diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp
index 7ea08539f9..56e671d902 100755
--- a/indra/newview/llgroupmgr.cpp
+++ b/indra/newview/llgroupmgr.cpp
@@ -41,6 +41,7 @@
#include "llui.h"
#include "message.h"
#include "roles_constants.h"
+#include "llhttpclient.h"
#include "lltransactiontypes.h"
#include "llstatusbar.h"
#include "lleconomy.h"
@@ -50,6 +51,7 @@
#include "llnotificationsutil.h"
#include "lluictrlfactory.h"
#include "lltrans.h"
+#include "llviewerregion.h"
#include <boost/regex.hpp>
#if LL_MSVC
@@ -232,11 +234,11 @@ LLGroupMgrGroupData::LLGroupMgrGroupData(const LLUUID& id) :
mMemberCount(0),
mRoleCount(0),
mReceivedRoleMemberPairs(0),
- mMemberDataComplete(FALSE),
- mRoleDataComplete(FALSE),
- mRoleMemberDataComplete(FALSE),
- mGroupPropertiesDataComplete(FALSE),
- mPendingRoleMemberRequest(FALSE),
+ mMemberDataComplete(false),
+ mRoleDataComplete(false),
+ mRoleMemberDataComplete(false),
+ mGroupPropertiesDataComplete(false),
+ mPendingRoleMemberRequest(false),
mAccessTime(0.0f)
{
mMemberVersion.generate();
@@ -328,7 +330,7 @@ void LLGroupMgrGroupData::setRoleData(const LLUUID& role_id, LLRoleData role_dat
}
else
{
- llwarns << "Change being made to non-existant role " << role_id << llendl;
+ LL_WARNS() << "Change being made to non-existant role " << role_id << LL_ENDL;
}
}
@@ -342,7 +344,7 @@ void LLGroupMgrGroupData::createRole(const LLUUID& role_id, LLRoleData role_data
{
if (mRoleChanges.find(role_id) != mRoleChanges.end())
{
- llwarns << "create role for existing role! " << role_id << llendl;
+ LL_WARNS() << "create role for existing role! " << role_id << LL_ENDL;
}
else
{
@@ -379,7 +381,7 @@ void LLGroupMgrGroupData::addRolePower(const LLUUID &role_id, U64 power)
}
else
{
- llwarns << "addRolePower: no role data found for " << role_id << llendl;
+ LL_WARNS() << "addRolePower: no role data found for " << role_id << LL_ENDL;
}
}
@@ -393,7 +395,7 @@ void LLGroupMgrGroupData::removeRolePower(const LLUUID &role_id, U64 power)
}
else
{
- llwarns << "removeRolePower: no role data found for " << role_id << llendl;
+ LL_WARNS() << "removeRolePower: no role data found for " << role_id << LL_ENDL;
}
}
@@ -406,7 +408,7 @@ U64 LLGroupMgrGroupData::getRolePowers(const LLUUID& role_id)
}
else
{
- llwarns << "getRolePowers: no role data found for " << role_id << llendl;
+ LL_WARNS() << "getRolePowers: no role data found for " << role_id << LL_ENDL;
return GP_NO_POWERS;
}
}
@@ -425,7 +427,7 @@ void LLGroupMgrGroupData::removeMemberData()
delete mi->second;
}
mMembers.clear();
- mMemberDataComplete = FALSE;
+ mMemberDataComplete = false;
mMemberVersion.generate();
}
@@ -447,8 +449,8 @@ void LLGroupMgrGroupData::removeRoleData()
}
mRoles.clear();
mReceivedRoleMemberPairs = 0;
- mRoleDataComplete = FALSE;
- mRoleMemberDataComplete = FALSE;
+ mRoleDataComplete = false;
+ mRoleMemberDataComplete= false;
}
void LLGroupMgrGroupData::removeRoleMemberData()
@@ -472,7 +474,7 @@ void LLGroupMgrGroupData::removeRoleMemberData()
}
mReceivedRoleMemberPairs = 0;
- mRoleMemberDataComplete = FALSE;
+ mRoleMemberDataComplete= false;
}
LLGroupMgrGroupData::~LLGroupMgrGroupData()
@@ -490,8 +492,8 @@ bool LLGroupMgrGroupData::changeRoleMember(const LLUUID& role_id,
if (ri == mRoles.end()
|| mi == mMembers.end() )
{
- if (ri == mRoles.end()) llwarns << "LLGroupMgrGroupData::changeRoleMember couldn't find role " << role_id << llendl;
- if (mi == mMembers.end()) llwarns << "LLGroupMgrGroupData::changeRoleMember couldn't find member " << member_id << llendl;
+ if (ri == mRoles.end()) LL_WARNS() << "LLGroupMgrGroupData::changeRoleMember couldn't find role " << role_id << LL_ENDL;
+ if (mi == mMembers.end()) LL_WARNS() << "LLGroupMgrGroupData::changeRoleMember couldn't find member " << member_id << LL_ENDL;
return false;
}
@@ -500,13 +502,13 @@ bool LLGroupMgrGroupData::changeRoleMember(const LLUUID& role_id,
if (!grd || !gmd)
{
- llwarns << "LLGroupMgrGroupData::changeRoleMember couldn't get member or role data." << llendl;
+ LL_WARNS() << "LLGroupMgrGroupData::changeRoleMember couldn't get member or role data." << LL_ENDL;
return false;
}
if (RMC_ADD == rmc)
{
- llinfos << " adding member to role." << llendl;
+ LL_INFOS() << " adding member to role." << LL_ENDL;
grd->addMember(member_id);
gmd->addRole(role_id,grd);
@@ -516,7 +518,7 @@ bool LLGroupMgrGroupData::changeRoleMember(const LLUUID& role_id,
}
else if (RMC_REMOVE == rmc)
{
- llinfos << " removing member from role." << llendl;
+ LL_INFOS() << " removing member from role." << LL_ENDL;
grd->removeMember(member_id);
gmd->removeRole(role_id);
@@ -535,9 +537,9 @@ bool LLGroupMgrGroupData::changeRoleMember(const LLUUID& role_id,
if (it->second.mChange == rmc)
{
// Already recorded this change? Weird.
- llinfos << "Received duplicate change for "
+ LL_INFOS() << "Received duplicate change for "
<< " role: " << role_id << " member " << member_id
- << " change " << (rmc == RMC_ADD ? "ADD" : "REMOVE") << llendl;
+ << " change " << (rmc == RMC_ADD ? "ADD" : "REMOVE") << LL_ENDL;
}
else
{
@@ -545,7 +547,7 @@ bool LLGroupMgrGroupData::changeRoleMember(const LLUUID& role_id,
// If that changes this will need more logic
if (rmc == RMC_NONE)
{
- llwarns << "changeRoleMember: existing entry with 'RMC_NONE' change! This shouldn't happen." << llendl;
+ LL_WARNS() << "changeRoleMember: existing entry with 'RMC_NONE' change! This shouldn't happen." << LL_ENDL;
LLRoleMemberChange rc(role_id,member_id,rmc);
mRoleMemberChanges[role_member] = rc;
}
@@ -609,6 +611,11 @@ void LLGroupMgrGroupData::recalcAgentPowers(const LLUUID& agent_id)
}
}
+bool LLGroupMgrGroupData::isSingleMemberNotOwner()
+{
+ return mMembers.size() == 1 && !mMembers.begin()->second->isOwner();
+}
+
bool packRoleUpdateMessageBlock(LLMessageSystem* msg,
const LLUUID& group_id,
const LLUUID& role_id,
@@ -743,6 +750,20 @@ void LLGroupMgrGroupData::cancelRoleChanges()
// Clear out all changes!
mRoleChanges.clear();
}
+
+void LLGroupMgrGroupData::createBanEntry(const LLUUID& ban_id, const LLGroupBanData& ban_data)
+{
+ mBanList[ban_id] = ban_data;
+}
+
+void LLGroupMgrGroupData::removeBanEntry(const LLUUID& ban_id)
+{
+ mBanList.erase(ban_id);
+}
+
+
+
+
//
// LLGroupMgr
//
@@ -863,12 +884,12 @@ static void formatDateString(std::string &date_string)
// static
void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data)
{
- lldebugs << "LLGroupMgr::processGroupMembersReply" << llendl;
+ LL_DEBUGS() << "LLGroupMgr::processGroupMembersReply" << LL_ENDL;
LLUUID agent_id;
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
if (gAgent.getID() != agent_id)
{
- llwarns << "Got group members reply for another agent!" << llendl;
+ LL_WARNS() << "Got group members reply for another agent!" << LL_ENDL;
return;
}
@@ -881,7 +902,7 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data)
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->getGroupData(group_id);
if (!group_datap || (group_datap->mMemberRequestID != request_id))
{
- llwarns << "processGroupMembersReply: Received incorrect (stale?) group or request id" << llendl;
+ LL_WARNS() << "processGroupMembersReply: Received incorrect (stale?) group or request id" << LL_ENDL;
return;
}
@@ -919,7 +940,7 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data)
formatDateString(online_status); // reformat for sorting, e.g. 12/25/2008 -> 2008/12/25
}
- //llinfos << "Member " << member_id << " has powers " << std::hex << agent_powers << std::dec << llendl;
+ //LL_INFOS() << "Member " << member_id << " has powers " << std::hex << agent_powers << std::dec << LL_ENDL;
LLGroupMemberData* newdata = new LLGroupMemberData(member_id,
contribution,
agent_powers,
@@ -930,14 +951,14 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data)
LLGroupMgrGroupData::member_list_t::iterator mit = group_datap->mMembers.find(member_id);
if (mit != group_datap->mMembers.end())
{
- llinfos << " *** Received duplicate member data for agent " << member_id << llendl;
+ LL_INFOS() << " *** Received duplicate member data for agent " << member_id << LL_ENDL;
}
#endif
group_datap->mMembers[member_id] = newdata;
}
else
{
- llinfos << "Received null group member data." << llendl;
+ LL_INFOS() << "Received null group member data." << LL_ENDL;
}
}
@@ -952,12 +973,12 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data)
if (group_datap->mMembers.size() == (U32)group_datap->mMemberCount)
{
- group_datap->mMemberDataComplete = TRUE;
+ group_datap->mMemberDataComplete = true;
group_datap->mMemberRequestID.setNull();
// We don't want to make role-member data requests until we have all the members
if (group_datap->mPendingRoleMemberRequest)
{
- group_datap->mPendingRoleMemberRequest = FALSE;
+ group_datap->mPendingRoleMemberRequest = false;
LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(group_datap->mID);
}
}
@@ -969,12 +990,12 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data)
//static
void LLGroupMgr::processGroupPropertiesReply(LLMessageSystem* msg, void** data)
{
- lldebugs << "LLGroupMgr::processGroupPropertiesReply" << llendl;
+ LL_DEBUGS() << "LLGroupMgr::processGroupPropertiesReply" << LL_ENDL;
LLUUID agent_id;
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
if (gAgent.getID() != agent_id)
{
- llwarns << "Got group properties reply for another agent!" << llendl;
+ LL_WARNS() << "Got group properties reply for another agent!" << LL_ENDL;
return;
}
@@ -1027,7 +1048,7 @@ void LLGroupMgr::processGroupPropertiesReply(LLMessageSystem* msg, void** data)
group_datap->mMemberCount = num_group_members;
group_datap->mRoleCount = num_group_roles + 1; // Add the everyone role.
- group_datap->mGroupPropertiesDataComplete = TRUE;
+ group_datap->mGroupPropertiesDataComplete = true;
group_datap->mChanged = TRUE;
LLGroupMgr::getInstance()->notifyObservers(GC_PROPERTIES);
@@ -1036,12 +1057,12 @@ void LLGroupMgr::processGroupPropertiesReply(LLMessageSystem* msg, void** data)
// static
void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data)
{
- lldebugs << "LLGroupMgr::processGroupRoleDataReply" << llendl;
+ LL_DEBUGS() << "LLGroupMgr::processGroupRoleDataReply" << LL_ENDL;
LLUUID agent_id;
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
if (gAgent.getID() != agent_id)
{
- llwarns << "Got group role data reply for another agent!" << llendl;
+ LL_WARNS() << "Got group role data reply for another agent!" << LL_ENDL;
return;
}
@@ -1054,7 +1075,7 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data)
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->getGroupData(group_id);
if (!group_datap || (group_datap->mRoleDataRequestID != request_id))
{
- llwarns << "processGroupPropertiesReply: Received incorrect (stale?) group or request id" << llendl;
+ LL_WARNS() << "processGroupPropertiesReply: Received incorrect (stale?) group or request id" << LL_ENDL;
return;
}
@@ -1097,19 +1118,19 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data)
- lldebugs << "Adding role data: " << name << " {" << role_id << "}" << llendl;
+ LL_DEBUGS() << "Adding role data: " << name << " {" << role_id << "}" << LL_ENDL;
LLGroupRoleData* rd = new LLGroupRoleData(role_id,name,title,desc,powers,member_count);
group_datap->mRoles[role_id] = rd;
}
if (group_datap->mRoles.size() == (U32)group_datap->mRoleCount)
{
- group_datap->mRoleDataComplete = TRUE;
+ group_datap->mRoleDataComplete = true;
group_datap->mRoleDataRequestID.setNull();
// We don't want to make role-member data requests until we have all the role data
if (group_datap->mPendingRoleMemberRequest)
{
- group_datap->mPendingRoleMemberRequest = FALSE;
+ group_datap->mPendingRoleMemberRequest = false;
LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(group_datap->mID);
}
}
@@ -1121,12 +1142,12 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data)
// static
void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data)
{
- lldebugs << "LLGroupMgr::processGroupRoleMembersReply" << llendl;
+ LL_DEBUGS() << "LLGroupMgr::processGroupRoleMembersReply" << LL_ENDL;
LLUUID agent_id;
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
if (gAgent.getID() != agent_id)
{
- llwarns << "Got group role members reply for another agent!" << llendl;
+ LL_WARNS() << "Got group role members reply for another agent!" << LL_ENDL;
return;
}
@@ -1142,7 +1163,7 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data)
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->getGroupData(group_id);
if (!group_datap || (group_datap->mRoleMembersRequestID != request_id))
{
- llwarns << "processGroupRoleMembersReply: Received incorrect (stale?) group or request id" << llendl;
+ LL_WARNS() << "processGroupRoleMembersReply: Received incorrect (stale?) group or request id" << LL_ENDL;
return;
}
@@ -1182,14 +1203,14 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data)
if (rd && md)
{
- lldebugs << "Adding role-member pair: " << role_id << ", " << member_id << llendl;
+ LL_DEBUGS() << "Adding role-member pair: " << role_id << ", " << member_id << LL_ENDL;
rd->addMember(member_id);
md->addRole(role_id,rd);
}
else
{
- if (!rd) llwarns << "Received role data for unknown role " << role_id << " in group " << group_id << llendl;
- if (!md) llwarns << "Received role data for unknown member " << member_id << " in group " << group_id << llendl;
+ if (!rd) LL_WARNS() << "Received role data for unknown role " << role_id << " in group " << group_id << LL_ENDL;
+ if (!md) LL_WARNS() << "Received role data for unknown member " << member_id << " in group " << group_id << LL_ENDL;
}
}
}
@@ -1203,7 +1224,7 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data)
LLGroupRoleData* everyone = group_datap->mRoles[LLUUID::null];
if (!everyone)
{
- llwarns << "Everyone role not found!" << llendl;
+ LL_WARNS() << "Everyone role not found!" << LL_ENDL;
}
else
{
@@ -1218,7 +1239,7 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data)
}
}
- group_datap->mRoleMemberDataComplete = TRUE;
+ group_datap->mRoleMemberDataComplete= true;
group_datap->mRoleMembersRequestID.setNull();
}
@@ -1229,12 +1250,12 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data)
// static
void LLGroupMgr::processGroupTitlesReply(LLMessageSystem* msg, void** data)
{
- lldebugs << "LLGroupMgr::processGroupTitlesReply" << llendl;
+ LL_DEBUGS() << "LLGroupMgr::processGroupTitlesReply" << LL_ENDL;
LLUUID agent_id;
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
if (gAgent.getID() != agent_id)
{
- llwarns << "Got group properties reply for another agent!" << llendl;
+ LL_WARNS() << "Got group properties reply for another agent!" << LL_ENDL;
return;
}
@@ -1246,7 +1267,7 @@ void LLGroupMgr::processGroupTitlesReply(LLMessageSystem* msg, void** data)
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->getGroupData(group_id);
if (!group_datap || (group_datap->mTitlesRequestID != request_id))
{
- llwarns << "processGroupTitlesReply: Received incorrect (stale?) group" << llendl;
+ LL_WARNS() << "processGroupTitlesReply: Received incorrect (stale?) group" << LL_ENDL;
return;
}
@@ -1262,7 +1283,7 @@ void LLGroupMgr::processGroupTitlesReply(LLMessageSystem* msg, void** data)
if (!title.mTitle.empty())
{
- lldebugs << "LLGroupMgr adding title: " << title.mTitle << ", " << title.mRoleID << ", " << (title.mSelected ? 'Y' : 'N') << llendl;
+ LL_DEBUGS() << "LLGroupMgr adding title: " << title.mTitle << ", " << title.mRoleID << ", " << (title.mSelected ? 'Y' : 'N') << LL_ENDL;
group_datap->mTitles.push_back(title);
}
}
@@ -1274,7 +1295,7 @@ void LLGroupMgr::processGroupTitlesReply(LLMessageSystem* msg, void** data)
// static
void LLGroupMgr::processEjectGroupMemberReply(LLMessageSystem* msg, void ** data)
{
- lldebugs << "processEjectGroupMemberReply" << llendl;
+ LL_DEBUGS() << "processEjectGroupMemberReply" << LL_ENDL;
LLUUID group_id;
msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_GroupID, group_id);
BOOL success;
@@ -1290,7 +1311,7 @@ void LLGroupMgr::processEjectGroupMemberReply(LLMessageSystem* msg, void ** data
// static
void LLGroupMgr::processJoinGroupReply(LLMessageSystem* msg, void ** data)
{
- lldebugs << "processJoinGroupReply" << llendl;
+ LL_DEBUGS() << "processJoinGroupReply" << LL_ENDL;
LLUUID group_id;
BOOL success;
msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_GroupID, group_id);
@@ -1310,7 +1331,7 @@ void LLGroupMgr::processJoinGroupReply(LLMessageSystem* msg, void ** data)
// static
void LLGroupMgr::processLeaveGroupReply(LLMessageSystem* msg, void ** data)
{
- lldebugs << "processLeaveGroupReply" << llendl;
+ LL_DEBUGS() << "processLeaveGroupReply" << LL_ENDL;
LLUUID group_id;
BOOL success;
msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_GroupID, group_id);
@@ -1472,7 +1493,7 @@ void LLGroupMgr::addGroup(LLGroupMgrGroupData* group_datap)
void LLGroupMgr::sendGroupPropertiesRequest(const LLUUID& group_id)
{
- lldebugs << "LLGroupMgr::sendGroupPropertiesRequest" << llendl;
+ LL_DEBUGS() << "LLGroupMgr::sendGroupPropertiesRequest" << LL_ENDL;
// This will happen when we get the reply
//LLGroupMgrGroupData* group_datap = createGroupData(group_id);
@@ -1488,7 +1509,7 @@ void LLGroupMgr::sendGroupPropertiesRequest(const LLUUID& group_id)
void LLGroupMgr::sendGroupMembersRequest(const LLUUID& group_id)
{
- lldebugs << "LLGroupMgr::sendGroupMembersRequest" << llendl;
+ LL_DEBUGS() << "LLGroupMgr::sendGroupMembersRequest" << LL_ENDL;
LLGroupMgrGroupData* group_datap = createGroupData(group_id);
if (group_datap->mMemberRequestID.isNull())
{
@@ -1510,7 +1531,7 @@ void LLGroupMgr::sendGroupMembersRequest(const LLUUID& group_id)
void LLGroupMgr::sendGroupRoleDataRequest(const LLUUID& group_id)
{
- lldebugs << "LLGroupMgr::sendGroupRoleDataRequest" << llendl;
+ LL_DEBUGS() << "LLGroupMgr::sendGroupRoleDataRequest" << LL_ENDL;
LLGroupMgrGroupData* group_datap = createGroupData(group_id);
if (group_datap->mRoleDataRequestID.isNull())
{
@@ -1531,7 +1552,7 @@ void LLGroupMgr::sendGroupRoleDataRequest(const LLUUID& group_id)
void LLGroupMgr::sendGroupRoleMembersRequest(const LLUUID& group_id)
{
- lldebugs << "LLGroupMgr::sendGroupRoleMembersRequest" << llendl;
+ LL_DEBUGS() << "LLGroupMgr::sendGroupRoleMembersRequest" << LL_ENDL;
LLGroupMgrGroupData* group_datap = createGroupData(group_id);
if (group_datap->mRoleMembersRequestID.isNull())
@@ -1541,9 +1562,9 @@ void LLGroupMgr::sendGroupRoleMembersRequest(const LLUUID& group_id)
|| !group_datap->isRoleDataComplete())
{
// *TODO: KLW FIXME: Should we start a member or role data request?
- llinfos << " Pending: " << (group_datap->mPendingRoleMemberRequest ? "Y" : "N")
+ LL_INFOS() << " Pending: " << (group_datap->mPendingRoleMemberRequest ? "Y" : "N")
<< " MemberDataComplete: " << (group_datap->mMemberDataComplete ? "Y" : "N")
- << " RoleDataComplete: " << (group_datap->mRoleDataComplete ? "Y" : "N") << llendl;
+ << " RoleDataComplete: " << (group_datap->mRoleDataComplete ? "Y" : "N") << LL_ENDL;
group_datap->mPendingRoleMemberRequest = TRUE;
return;
}
@@ -1565,7 +1586,7 @@ void LLGroupMgr::sendGroupRoleMembersRequest(const LLUUID& group_id)
void LLGroupMgr::sendGroupTitlesRequest(const LLUUID& group_id)
{
- lldebugs << "LLGroupMgr::sendGroupTitlesRequest" << llendl;
+ LL_DEBUGS() << "LLGroupMgr::sendGroupTitlesRequest" << LL_ENDL;
LLGroupMgrGroupData* group_datap = createGroupData(group_id);
group_datap->mTitles.clear();
@@ -1584,7 +1605,7 @@ void LLGroupMgr::sendGroupTitlesRequest(const LLUUID& group_id)
void LLGroupMgr::sendGroupTitleUpdate(const LLUUID& group_id, const LLUUID& title_role_id)
{
- lldebugs << "LLGroupMgr::sendGroupTitleUpdate" << llendl;
+ LL_DEBUGS() << "LLGroupMgr::sendGroupTitleUpdate" << LL_ENDL;
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("GroupTitleUpdate");
@@ -1643,7 +1664,7 @@ void LLGroupMgr::sendCreateGroupRequest(const std::string& name,
void LLGroupMgr::sendUpdateGroupInfo(const LLUUID& group_id)
{
- lldebugs << "LLGroupMgr::sendUpdateGroupInfo" << llendl;
+ LL_DEBUGS() << "LLGroupMgr::sendUpdateGroupInfo" << LL_ENDL;
LLGroupMgrGroupData* group_datap = createGroupData(group_id);
LLMessageSystem* msg = gMessageSystem;
@@ -1672,7 +1693,7 @@ void LLGroupMgr::sendUpdateGroupInfo(const LLUUID& group_id)
void LLGroupMgr::sendGroupRoleMemberChanges(const LLUUID& group_id)
{
- lldebugs << "LLGroupMgr::sendGroupRoleMemberChanges" << llendl;
+ LL_DEBUGS() << "LLGroupMgr::sendGroupRoleMemberChanges" << LL_ENDL;
LLGroupMgrGroupData* group_datap = createGroupData(group_id);
if (group_datap->mRoleMemberChanges.empty()) return;
@@ -1842,25 +1863,165 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id,
// Responder class for capability group management
-class GroupMemberDataResponder : public LLHTTPClient::Responder
+class GroupBanDataResponder : public LLHTTPClient::Responder
{
public:
- GroupMemberDataResponder() {}
- virtual ~GroupMemberDataResponder() {}
- virtual void result(const LLSD& pContent);
- virtual void errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& pContent);
+ GroupBanDataResponder(const LLUUID& gropup_id, BOOL force_refresh=false);
+ virtual ~GroupBanDataResponder() {}
+ virtual void httpSuccess();
+ virtual void httpFailure();
private:
- LLSD mMemberData;
+ LLUUID mGroupID;
+ BOOL mForceRefresh;
};
-void GroupMemberDataResponder::errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& pContent)
+GroupBanDataResponder::GroupBanDataResponder(const LLUUID& gropup_id, BOOL force_refresh) :
+ mGroupID(gropup_id),
+ mForceRefresh(force_refresh)
+{}
+
+void GroupBanDataResponder::httpFailure()
{
LL_WARNS("GrpMgr") << "Error receiving group member data [status:"
- << pStatus << "]: " << pContent << LL_ENDL;
+ << mStatus << "]: " << mContent << LL_ENDL;
+}
+
+void GroupBanDataResponder::httpSuccess()
+{
+ if (mContent.has("ban_list"))
+ {
+ // group ban data received
+ LLGroupMgr::processGroupBanRequest(mContent);
+ }
+ else if (mForceRefresh)
+ {
+ // no ban data received, refreshing data after successful operation
+ LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_GET, mGroupID);
+ }
}
-void GroupMemberDataResponder::result(const LLSD& content)
+void LLGroupMgr::sendGroupBanRequest( EBanRequestType request_type,
+ const LLUUID& group_id,
+ U32 ban_action, /* = BAN_NO_ACTION */
+ const std::vector<LLUUID> ban_list) /* = std::vector<LLUUID>() */
{
+ LLViewerRegion* currentRegion = gAgent.getRegion();
+ if(!currentRegion)
+ {
+ LL_WARNS("GrpMgr") << "Agent does not have a current region. Uh-oh!" << LL_ENDL;
+ return;
+ }
+
+ // Check to make sure we have our capabilities
+ if(!currentRegion->capabilitiesReceived())
+ {
+ LL_WARNS("GrpMgr") << " Capabilities not received!" << LL_ENDL;
+ return;
+ }
+
+ // Get our capability
+ std::string cap_url = currentRegion->getCapability("GroupAPIv1");
+ if(cap_url.empty())
+ {
+ return;
+ }
+ cap_url += "?group_id=" + group_id.asString();
+
+ LLSD body = LLSD::emptyMap();
+ body["ban_action"] = (LLSD::Integer)(ban_action & ~BAN_UPDATE);
+ // Add our list of potential banned residents to the list
+ body["ban_ids"] = LLSD::emptyArray();
+ LLSD ban_entry;
+
+ uuid_vec_t::const_iterator iter = ban_list.begin();
+ for(;iter != ban_list.end(); ++iter)
+ {
+ ban_entry = (*iter);
+ body["ban_ids"].append(ban_entry);
+ }
+
+ LLHTTPClient::ResponderPtr grp_ban_responder = new GroupBanDataResponder(group_id, ban_action & BAN_UPDATE);
+ switch(request_type)
+ {
+ case REQUEST_GET:
+ LLHTTPClient::get(cap_url, grp_ban_responder);
+ break;
+ case REQUEST_POST:
+ LLHTTPClient::post(cap_url, body, grp_ban_responder);
+ break;
+ case REQUEST_PUT:
+ case REQUEST_DEL:
+ break;
+ }
+}
+
+
+void LLGroupMgr::processGroupBanRequest(const LLSD& content)
+{
+ // Did we get anything in content?
+ if(!content.size())
+ {
+ LL_WARNS("GrpMgr") << "No group member data received." << LL_ENDL;
+ return;
+ }
+
+ LLUUID group_id = content["group_id"].asUUID();
+
+ LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(group_id);
+ if (!gdatap)
+ return;
+
+ LLSD::map_const_iterator i = content["ban_list"].beginMap();
+ LLSD::map_const_iterator iEnd = content["ban_list"].endMap();
+ for(;i != iEnd; ++i)
+ {
+ const LLUUID ban_id(i->first);
+ LLSD ban_entry(i->second);
+
+ LLGroupBanData ban_data;
+ if(ban_entry.has("ban_date"))
+ {
+ ban_data.mBanDate = ban_entry["ban_date"].asDate();
+ // TODO: Ban Reason
+ }
+
+ gdatap->createBanEntry(ban_id, ban_data);
+ }
+
+ gdatap->mChanged = TRUE;
+ LLGroupMgr::getInstance()->notifyObservers(GC_BANLIST);
+}
+
+
+
+// Responder class for capability group management
+class GroupMemberDataResponder : public LLHTTPClient::Responder
+{
+ LOG_CLASS(GroupMemberDataResponder);
+public:
+ GroupMemberDataResponder() {}
+ virtual ~GroupMemberDataResponder() {}
+
+private:
+ /* virtual */ void httpSuccess();
+ /* virtual */ void httpFailure();
+ LLSD mMemberData;
+};
+
+void GroupMemberDataResponder::httpFailure()
+{
+ LL_WARNS("GrpMgr") << "Error receiving group member data "
+ << dumpResponse() << LL_ENDL;
+}
+
+void GroupMemberDataResponder::httpSuccess()
+{
+ const LLSD& content = getContent();
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
LLGroupMgr::processCapGroupMembersRequest(content);
}
@@ -1926,7 +2087,7 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content)
if(num_members < 1)
return;
- LLUUID group_id = content["group_id"].asUUID();
+ LLUUID group_id = content["group_id"].asUUID();
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->getGroupData(group_id);
if(!group_datap)
@@ -1993,6 +2154,22 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content)
online_status,
is_owner);
+ LLGroupMemberData* member_old = group_datap->mMembers[member_id];
+ if (member_old && group_datap->mRoleMemberDataComplete)
+ {
+ LLGroupMemberData::role_list_t::iterator rit = member_old->roleBegin();
+ LLGroupMemberData::role_list_t::iterator end = member_old->roleEnd();
+
+ for ( ; rit != end; ++rit)
+ {
+ data->addRole((*rit).first,(*rit).second);
+ }
+ }
+ else
+ {
+ group_datap->mRoleMemberDataComplete = false;
+ }
+
group_datap->mMembers[member_id] = data;
}
@@ -2009,12 +2186,12 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content)
LLGroupMgr::getInstance()->sendGroupTitlesRequest(group_id);
- group_datap->mMemberDataComplete = TRUE;
+ group_datap->mMemberDataComplete = true;
group_datap->mMemberRequestID.setNull();
// Make the role-member data request
- if (group_datap->mPendingRoleMemberRequest)
+ if (group_datap->mPendingRoleMemberRequest || !group_datap->mRoleMemberDataComplete)
{
- group_datap->mPendingRoleMemberRequest = FALSE;
+ group_datap->mPendingRoleMemberRequest = false;
LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(group_id);
}
@@ -2026,7 +2203,7 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content)
void LLGroupMgr::sendGroupRoleChanges(const LLUUID& group_id)
{
- lldebugs << "LLGroupMgr::sendGroupRoleChanges" << llendl;
+ LL_DEBUGS() << "LLGroupMgr::sendGroupRoleChanges" << LL_ENDL;
LLGroupMgrGroupData* group_datap = getGroupData(group_id);
if (group_datap && group_datap->pendingRoleChanges())
@@ -2041,7 +2218,7 @@ void LLGroupMgr::sendGroupRoleChanges(const LLUUID& group_id)
void LLGroupMgr::cancelGroupRoleChanges(const LLUUID& group_id)
{
- lldebugs << "LLGroupMgr::cancelGroupRoleChanges" << llendl;
+ LL_DEBUGS() << "LLGroupMgr::cancelGroupRoleChanges" << LL_ENDL;
LLGroupMgrGroupData* group_datap = getGroupData(group_id);
if (group_datap) group_datap->cancelRoleChanges();
@@ -2056,7 +2233,7 @@ bool LLGroupMgr::parseRoleActions(const std::string& xml_filename)
if (!success || !root || !root->hasName( "role_actions" ))
{
- llerrs << "Problem reading UI role_actions file: " << xml_filename << llendl;
+ LL_ERRS() << "Problem reading UI role_actions file: " << xml_filename << LL_ENDL;
return false;
}
@@ -2075,12 +2252,12 @@ bool LLGroupMgr::parseRoleActions(const std::string& xml_filename)
std::string action_set_name;
if (action_set->getAttributeString("name", action_set_name))
{
- lldebugs << "Loading action set " << action_set_name << llendl;
+ LL_DEBUGS() << "Loading action set " << action_set_name << LL_ENDL;
role_action_data->mName = action_set_name;
}
else
{
- llwarns << "Unable to parse action set with no name" << llendl;
+ LL_WARNS() << "Unable to parse action set with no name" << LL_ENDL;
delete role_action_set;
delete role_action_data;
continue;
@@ -2116,12 +2293,12 @@ bool LLGroupMgr::parseRoleActions(const std::string& xml_filename)
std::string action_name;
if (action->getAttributeString("name", action_name))
{
- lldebugs << "Loading action " << action_name << llendl;
+ LL_DEBUGS() << "Loading action " << action_name << LL_ENDL;
role_action->mName = action_name;
}
else
{
- llwarns << "Unable to parse action with no name" << llendl;
+ LL_WARNS() << "Unable to parse action with no name" << LL_ENDL;
delete role_action;
continue;
}
diff --git a/indra/newview/llgroupmgr.h b/indra/newview/llgroupmgr.h
index d8c1ab7ef5..2e94e8d9a0 100755
--- a/indra/newview/llgroupmgr.h
+++ b/indra/newview/llgroupmgr.h
@@ -33,7 +33,23 @@
#include <string>
#include <map>
+// Forward Declarations
class LLMessageSystem;
+class LLGroupRoleData;
+class LLGroupMgr;
+
+enum LLGroupChange
+{
+ GC_PROPERTIES,
+ GC_MEMBER_DATA,
+ GC_ROLE_DATA,
+ GC_ROLE_MEMBER_DATA,
+ GC_TITLES,
+ GC_BANLIST,
+ GC_ALL
+};
+
+const U32 GB_MAX_BANNED_AGENTS = 500;
class LLGroupMgrObserver
{
@@ -54,8 +70,6 @@ public:
virtual void changed(const LLUUID& group_id, LLGroupChange gc) = 0;
};
-class LLGroupRoleData;
-
class LLGroupMemberData
{
friend class LLGroupMgrGroupData;
@@ -190,6 +204,17 @@ struct lluuid_pair_less
}
};
+
+struct LLGroupBanData
+{
+ LLGroupBanData(): mBanDate() {}
+ ~LLGroupBanData() {}
+
+ LLDate mBanDate;
+ // TODO: std:string ban_reason;
+};
+
+
struct LLGroupTitle
{
std::string mTitle;
@@ -197,8 +222,6 @@ struct LLGroupTitle
BOOL mSelected;
};
-class LLGroupMgr;
-
class LLGroupMgrGroupData
{
friend class LLGroupMgr;
@@ -228,27 +251,38 @@ public:
void recalcAllAgentPowers();
void recalcAgentPowers(const LLUUID& agent_id);
- BOOL isMemberDataComplete() { return mMemberDataComplete; }
- BOOL isRoleDataComplete() { return mRoleDataComplete; }
- BOOL isRoleMemberDataComplete() { return mRoleMemberDataComplete; }
- BOOL isGroupPropertiesDataComplete() { return mGroupPropertiesDataComplete; }
+ bool isMemberDataComplete() { return mMemberDataComplete; }
+ bool isRoleDataComplete() { return mRoleDataComplete; }
+ bool isRoleMemberDataComplete() { return mRoleMemberDataComplete; }
+ bool isGroupPropertiesDataComplete() { return mGroupPropertiesDataComplete; }
+
+ bool isSingleMemberNotOwner();
F32 getAccessTime() const { return mAccessTime; }
void setAccessed();
const LLUUID& getMemberVersion() const { return mMemberVersion; }
+ void clearBanList() { mBanList.clear(); }
+ void getBanList(const LLUUID& group_id, LLGroupBanData& ban_data);
+ const LLGroupBanData& getBanEntry(const LLUUID& ban_id) { return mBanList[ban_id]; }
+
+ void createBanEntry(const LLUUID& ban_id, const LLGroupBanData& ban_data = LLGroupBanData());
+ void removeBanEntry(const LLUUID& ban_id);
+
+
public:
typedef std::map<LLUUID,LLGroupMemberData*> member_list_t;
typedef std::map<LLUUID,LLGroupRoleData*> role_list_t;
typedef std::map<lluuid_pair,LLRoleMemberChange,lluuid_pair_less> change_map_t;
typedef std::map<LLUUID,LLRoleData> role_data_map_t;
+ typedef std::map<LLUUID,LLGroupBanData> ban_list_t;
+
member_list_t mMembers;
role_list_t mRoles;
-
-
change_map_t mRoleMemberChanges;
role_data_map_t mRoleChanges;
+ ban_list_t mBanList;
std::vector<LLGroupTitle> mTitles;
@@ -279,12 +313,12 @@ private:
LLUUID mTitlesRequestID;
U32 mReceivedRoleMemberPairs;
- BOOL mMemberDataComplete;
- BOOL mRoleDataComplete;
- BOOL mRoleMemberDataComplete;
- BOOL mGroupPropertiesDataComplete;
+ bool mMemberDataComplete;
+ bool mRoleDataComplete;
+ bool mRoleMemberDataComplete;
+ bool mGroupPropertiesDataComplete;
- BOOL mPendingRoleMemberRequest;
+ bool mPendingRoleMemberRequest;
F32 mAccessTime;
// Generate a new ID every time mMembers
@@ -312,6 +346,23 @@ class LLGroupMgr : public LLSingleton<LLGroupMgr>
LOG_CLASS(LLGroupMgr);
public:
+ enum EBanRequestType
+ {
+ REQUEST_GET = 0,
+ REQUEST_POST,
+ REQUEST_PUT,
+ REQUEST_DEL
+ };
+
+ enum EBanRequestAction
+ {
+ BAN_NO_ACTION = 0,
+ BAN_CREATE = 1,
+ BAN_DELETE = 2,
+ BAN_UPDATE = 4
+ };
+
+public:
LLGroupMgr();
~LLGroupMgr();
@@ -344,8 +395,14 @@ public:
static void sendGroupMemberInvites(const LLUUID& group_id, std::map<LLUUID,LLUUID>& role_member_pairs);
static void sendGroupMemberEjects(const LLUUID& group_id,
uuid_vec_t& member_ids);
+
+ static void sendGroupBanRequest(EBanRequestType request_type,
+ const LLUUID& group_id,
+ U32 ban_action = BAN_NO_ACTION,
+ const uuid_vec_t ban_list = uuid_vec_t());
+
+ static void processGroupBanRequest(const LLSD& content);
- // BAKER
void sendCapGroupMembersRequest(const LLUUID& group_id);
static void processCapGroupMembersRequest(const LLSD& content);
@@ -390,4 +447,3 @@ private:
#endif
-
diff --git a/indra/newview/llhomelocationresponder.cpp b/indra/newview/llhomelocationresponder.cpp
index 37428c4a44..d0492bcdb4 100755
--- a/indra/newview/llhomelocationresponder.cpp
+++ b/indra/newview/llhomelocationresponder.cpp
@@ -33,71 +33,76 @@
#include "llagent.h"
#include "llviewerregion.h"
-void LLHomeLocationResponder::result( const LLSD& content )
+void LLHomeLocationResponder::httpSuccess()
{
+ const LLSD& content = getContent();
LLVector3 agent_pos;
bool error = true;
-
+
do {
-
+
// was the call to /agent/<agent-id>/home-location successful?
// If not, we keep error set to true
if( ! content.has("success") )
{
break;
}
-
+
if( 0 != strncmp("true", content["success"].asString().c_str(), 4 ) )
{
break;
}
-
+
// did the simulator return a "justified" home location?
// If no, we keep error set to true
if( ! content.has( "HomeLocation" ) )
{
break;
}
-
+
if( ! content["HomeLocation"].has("LocationPos") )
{
break;
}
-
+
if( ! content["HomeLocation"]["LocationPos"].has("X") )
{
break;
}
agent_pos.mV[VX] = content["HomeLocation"]["LocationPos"]["X"].asInteger();
-
+
if( ! content["HomeLocation"]["LocationPos"].has("Y") )
{
break;
}
agent_pos.mV[VY] = content["HomeLocation"]["LocationPos"]["Y"].asInteger();
-
+
if( ! content["HomeLocation"]["LocationPos"].has("Z") )
{
break;
}
agent_pos.mV[VZ] = content["HomeLocation"]["LocationPos"]["Z"].asInteger();
-
+
error = false;
} while( 0 );
-
- if( ! error )
+
+ if( error )
{
- llinfos << "setting home position" << llendl;
-
+ failureResult(HTTP_INTERNAL_ERROR, "Invalid server response content", content);
+ }
+ else
+ {
+ LL_INFOS() << "setting home position" << LL_ENDL;
+
LLViewerRegion *viewer_region = gAgent.getRegion();
gAgent.setHomePosRegion( viewer_region->getHandle(), agent_pos );
}
}
-void LLHomeLocationResponder::errorWithContent( U32 status, const std::string& reason, const LLSD& content )
+void LLHomeLocationResponder::httpFailure()
{
- llwarns << "LLHomeLocationResponder error [status:" << status << "]: " << content << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
}
diff --git a/indra/newview/llhomelocationresponder.h b/indra/newview/llhomelocationresponder.h
index 9bf4b12c4e..adc6c8cb58 100755
--- a/indra/newview/llhomelocationresponder.h
+++ b/indra/newview/llhomelocationresponder.h
@@ -35,8 +35,10 @@
/* Typedef, Enum, Class, Struct, etc. */
class LLHomeLocationResponder : public LLHTTPClient::Responder
{
- virtual void result( const LLSD& content );
- virtual void errorWithContent( U32 status, const std::string& reason, const LLSD& content );
+ LOG_CLASS(LLHomeLocationResponder);
+private:
+ /* virtual */ void httpSuccess();
+ /* virtual */ void httpFailure();
};
#endif
diff --git a/indra/newview/llhttpretrypolicy.cpp b/indra/newview/llhttpretrypolicy.cpp
new file mode 100755
index 0000000000..2d4ce6c883
--- /dev/null
+++ b/indra/newview/llhttpretrypolicy.cpp
@@ -0,0 +1,142 @@
+/**
+ * @file llhttpretrypolicy.h
+ * @brief Header for a retry policy class intended for use with http responders.
+ *
+ * $LicenseInfo:firstyear=2013&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2013, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llhttpretrypolicy.h"
+
+LLAdaptiveRetryPolicy::LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 backoff_factor, U32 max_retries, bool retry_on_4xx):
+ mMinDelay(min_delay),
+ mMaxDelay(max_delay),
+ mBackoffFactor(backoff_factor),
+ mMaxRetries(max_retries),
+ mRetryOn4xx(retry_on_4xx)
+{
+ init();
+}
+
+void LLAdaptiveRetryPolicy::init()
+{
+ mDelay = mMinDelay;
+ mRetryCount = 0;
+ mShouldRetry = true;
+}
+
+void LLAdaptiveRetryPolicy::reset()
+{
+ init();
+}
+
+bool LLAdaptiveRetryPolicy::getRetryAfter(const LLSD& headers, F32& retry_header_time)
+{
+ return (headers.has(HTTP_IN_HEADER_RETRY_AFTER)
+ && getSecondsUntilRetryAfter(headers[HTTP_IN_HEADER_RETRY_AFTER].asStringRef(), retry_header_time));
+}
+
+bool LLAdaptiveRetryPolicy::getRetryAfter(const LLCore::HttpHeaders *headers, F32& retry_header_time)
+{
+ if (headers)
+ {
+ const std::string *retry_value = headers->find(HTTP_IN_HEADER_RETRY_AFTER.c_str());
+ if (retry_value &&
+ getSecondsUntilRetryAfter(*retry_value, retry_header_time))
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+void LLAdaptiveRetryPolicy::onSuccess()
+{
+ init();
+}
+
+void LLAdaptiveRetryPolicy::onFailure(S32 status, const LLSD& headers)
+{
+ F32 retry_header_time;
+ bool has_retry_header_time = getRetryAfter(headers,retry_header_time);
+ onFailureCommon(status, has_retry_header_time, retry_header_time);
+}
+
+void LLAdaptiveRetryPolicy::onFailure(const LLCore::HttpResponse *response)
+{
+ F32 retry_header_time;
+ const LLCore::HttpHeaders *headers = response->getHeaders();
+ bool has_retry_header_time = getRetryAfter(headers,retry_header_time);
+ onFailureCommon(response->getStatus().mType, has_retry_header_time, retry_header_time);
+}
+
+void LLAdaptiveRetryPolicy::onFailureCommon(S32 status, bool has_retry_header_time, F32 retry_header_time)
+{
+ if (!mShouldRetry)
+ {
+ LL_INFOS() << "keep on failing" << LL_ENDL;
+ return;
+ }
+ if (mRetryCount > 0)
+ {
+ mDelay = llclamp(mDelay*mBackoffFactor,mMinDelay,mMaxDelay);
+ }
+ // Honor server Retry-After header.
+ // Status 503 may ask us to wait for a certain amount of time before retrying.
+ F32 wait_time = mDelay;
+ if (has_retry_header_time)
+ {
+ wait_time = retry_header_time;
+ }
+
+ if (mRetryCount>=mMaxRetries)
+ {
+ LL_INFOS() << "Too many retries " << mRetryCount << ", will not retry" << LL_ENDL;
+ mShouldRetry = false;
+ }
+ if (!mRetryOn4xx && !isHttpServerErrorStatus(status))
+ {
+ LL_INFOS() << "Non-server error " << status << ", will not retry" << LL_ENDL;
+ mShouldRetry = false;
+ }
+ if (mShouldRetry)
+ {
+ LL_INFOS() << "Retry count " << mRetryCount << " should retry after " << wait_time << LL_ENDL;
+ mRetryTimer.reset();
+ mRetryTimer.setTimerExpirySec(wait_time);
+ }
+ mRetryCount++;
+}
+
+
+bool LLAdaptiveRetryPolicy::shouldRetry(F32& seconds_to_wait) const
+{
+ if (mRetryCount == 0)
+ {
+ // Called shouldRetry before any failure.
+ seconds_to_wait = F32_MAX;
+ return false;
+ }
+ seconds_to_wait = mShouldRetry ? (F32) mRetryTimer.getRemainingTimeF32() : F32_MAX;
+ return mShouldRetry;
+}
diff --git a/indra/newview/llhttpretrypolicy.h b/indra/newview/llhttpretrypolicy.h
new file mode 100755
index 0000000000..cf79e0b401
--- /dev/null
+++ b/indra/newview/llhttpretrypolicy.h
@@ -0,0 +1,98 @@
+/**
+ * @file file llhttpretrypolicy.h
+ * @brief declarations for http retry policy class.
+ *
+ * $LicenseInfo:firstyear=2013&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2013, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_RETRYPOLICY_H
+#define LL_RETRYPOLICY_H
+
+#include "lltimer.h"
+#include "llthread.h"
+
+#include "llhttpconstants.h"
+
+// For compatibility with new core http lib.
+#include "httpresponse.h"
+#include "httpheaders.h"
+
+// This is intended for use with HTTP Clients/Responders, but is not
+// specifically coupled with those classes.
+class LLHTTPRetryPolicy: public LLThreadSafeRefCount
+{
+public:
+ LLHTTPRetryPolicy() {}
+
+ virtual ~LLHTTPRetryPolicy() {}
+ // Call after a sucess to reset retry state.
+
+ virtual void onSuccess() = 0;
+ // Call once after an HTTP failure to update state.
+ virtual void onFailure(S32 status, const LLSD& headers) = 0;
+
+ virtual void onFailure(const LLCore::HttpResponse *response) = 0;
+
+ virtual bool shouldRetry(F32& seconds_to_wait) const = 0;
+
+ virtual void reset() = 0;
+};
+
+// Very general policy with geometric back-off after failures,
+// up to a maximum delay, and maximum number of retries.
+class LLAdaptiveRetryPolicy: public LLHTTPRetryPolicy
+{
+public:
+ LLAdaptiveRetryPolicy(F32 min_delay, F32 max_delay, F32 backoff_factor, U32 max_retries, bool retry_on_4xx = false);
+
+ // virtual
+ void onSuccess();
+
+ void reset();
+
+ // virtual
+ void onFailure(S32 status, const LLSD& headers);
+ // virtual
+ void onFailure(const LLCore::HttpResponse *response);
+ // virtual
+ bool shouldRetry(F32& seconds_to_wait) const;
+
+protected:
+ void init();
+ bool getRetryAfter(const LLSD& headers, F32& retry_header_time);
+ bool getRetryAfter(const LLCore::HttpHeaders *headers, F32& retry_header_time);
+ void onFailureCommon(S32 status, bool has_retry_header_time, F32 retry_header_time);
+
+private:
+
+ const F32 mMinDelay; // delay never less than this value
+ const F32 mMaxDelay; // delay never exceeds this value
+ const F32 mBackoffFactor; // delay increases by this factor after each retry, up to mMaxDelay.
+ const U32 mMaxRetries; // maximum number of times shouldRetry will return true.
+ F32 mDelay; // current default delay.
+ U32 mRetryCount; // number of times shouldRetry has been called.
+ LLTimer mRetryTimer; // time until next retry.
+ bool mShouldRetry; // Becomes false after too many retries, or the wrong sort of status received, etc.
+ bool mRetryOn4xx; // Normally only retry on 5xx server errors.
+};
+
+#endif
diff --git a/indra/newview/llhudeffect.cpp b/indra/newview/llhudeffect.cpp
index 159ec6c803..eff5587610 100755
--- a/indra/newview/llhudeffect.cpp
+++ b/indra/newview/llhudeffect.cpp
@@ -71,7 +71,7 @@ void LLHUDEffect::unpackData(LLMessageSystem *mesgsys, S32 blocknum)
void LLHUDEffect::render()
{
- llerrs << "Never call this!" << llendl;
+ LL_ERRS() << "Never call this!" << LL_ENDL;
}
void LLHUDEffect::setID(const LLUUID &id)
diff --git a/indra/newview/llhudeffectbeam.cpp b/indra/newview/llhudeffectbeam.cpp
index 8abad3d292..54e683e048 100755
--- a/indra/newview/llhudeffectbeam.cpp
+++ b/indra/newview/llhudeffectbeam.cpp
@@ -78,7 +78,7 @@ void LLHUDEffectBeam::packData(LLMessageSystem *mesgsys)
{
if (!mSourceObject)
{
- llwarns << "Missing source object!" << llendl;
+ LL_WARNS() << "Missing source object!" << LL_ENDL;
}
// Pack the default data
@@ -115,7 +115,7 @@ void LLHUDEffectBeam::packData(LLMessageSystem *mesgsys)
void LLHUDEffectBeam::unpackData(LLMessageSystem *mesgsys, S32 blocknum)
{
- llerrs << "Got beam!" << llendl;
+ LL_ERRS() << "Got beam!" << LL_ENDL;
BOOL use_target_object;
LLVector3d new_target;
U8 packed_data[41];
@@ -126,7 +126,7 @@ void LLHUDEffectBeam::unpackData(LLMessageSystem *mesgsys, S32 blocknum)
S32 size = mesgsys->getSizeFast(_PREHASH_Effect, blocknum, _PREHASH_TypeData);
if (size != 41)
{
- llwarns << "Beam effect with bad size " << size << llendl;
+ LL_WARNS() << "Beam effect with bad size " << size << LL_ENDL;
return;
}
mesgsys->getBinaryDataFast(_PREHASH_Effect, _PREHASH_TypeData, packed_data, 41, blocknum);
@@ -172,7 +172,7 @@ void LLHUDEffectBeam::setSourceObject(LLViewerObject *objp)
{
if (objp->isDead())
{
- llwarns << "HUDEffectBeam: Source object is dead!" << llendl;
+ LL_WARNS() << "HUDEffectBeam: Source object is dead!" << LL_ENDL;
mSourceObject = NULL;
return;
}
@@ -210,7 +210,7 @@ void LLHUDEffectBeam::setTargetObject(LLViewerObject *objp)
{
if (mTargetObject->isDead())
{
- llwarns << "HUDEffectBeam: Target object is dead!" << llendl;
+ LL_WARNS() << "HUDEffectBeam: Target object is dead!" << LL_ENDL;
}
mTargetObject = objp;
diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp
index 9dde65ceb6..f3a48625a4 100755
--- a/indra/newview/llhudeffectlookat.cpp
+++ b/indra/newview/llhudeffectlookat.cpp
@@ -204,7 +204,7 @@ static BOOL loadAttentions()
//-------------------------------------------------------------------------
if( !root->hasName( "linden_attentions" ) )
{
- llwarns << "Invalid linden_attentions file header: " << filename << llendl;
+ LL_WARNS() << "Invalid linden_attentions file header: " << filename << LL_ENDL;
return FALSE;
}
@@ -212,7 +212,7 @@ static BOOL loadAttentions()
static LLStdStringHandle version_string = LLXmlTree::addAttributeString("version");
if( !root->getFastAttributeString( version_string, version ) || (version != "1.0") )
{
- llwarns << "Invalid linden_attentions file version: " << version << llendl;
+ LL_WARNS() << "Invalid linden_attentions file version: " << version << LL_ENDL;
return FALSE;
}
@@ -322,7 +322,7 @@ void LLHUDEffectLookAt::unpackData(LLMessageSystem *mesgsys, S32 blocknum)
S32 size = mesgsys->getSizeFast(_PREHASH_Effect, blocknum, _PREHASH_TypeData);
if (size != PKT_SIZE)
{
- llwarns << "LookAt effect with bad size " << size << llendl;
+ LL_WARNS() << "LookAt effect with bad size " << size << LL_ENDL;
return;
}
mesgsys->getBinaryDataFast(_PREHASH_Effect, _PREHASH_TypeData, packed_data, PKT_SIZE, blocknum);
@@ -336,7 +336,7 @@ void LLHUDEffectLookAt::unpackData(LLMessageSystem *mesgsys, S32 blocknum)
}
else
{
- //llwarns << "Could not find source avatar for lookat effect" << llendl;
+ //LL_WARNS() << "Could not find source avatar for lookat effect" << LL_ENDL;
return;
}
@@ -356,7 +356,7 @@ void LLHUDEffectLookAt::unpackData(LLMessageSystem *mesgsys, S32 blocknum)
}
else
{
- //llwarns << "Could not find target object for lookat effect" << llendl;
+ //LL_WARNS() << "Could not find target object for lookat effect" << LL_ENDL;
}
U8 lookAtTypeUnpacked = 0;
@@ -400,7 +400,7 @@ BOOL LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *objec
if (target_type >= LOOKAT_NUM_TARGETS)
{
- llwarns << "Bad target_type " << (int)target_type << " - ignoring." << llendl;
+ LL_WARNS() << "Bad target_type " << (int)target_type << " - ignoring." << LL_ENDL;
return FALSE;
}
diff --git a/indra/newview/llhudeffectpointat.cpp b/indra/newview/llhudeffectpointat.cpp
index 114a633821..44c8db19c0 100755
--- a/indra/newview/llhudeffectpointat.cpp
+++ b/indra/newview/llhudeffectpointat.cpp
@@ -159,7 +159,7 @@ void LLHUDEffectPointAt::unpackData(LLMessageSystem *mesgsys, S32 blocknum)
S32 size = mesgsys->getSizeFast(_PREHASH_Effect, blocknum, _PREHASH_TypeData);
if (size != PKT_SIZE)
{
- llwarns << "PointAt effect with bad size " << size << llendl;
+ LL_WARNS() << "PointAt effect with bad size " << size << LL_ENDL;
return;
}
mesgsys->getBinaryDataFast(_PREHASH_Effect, _PREHASH_TypeData, packed_data, PKT_SIZE, blocknum);
@@ -176,7 +176,7 @@ void LLHUDEffectPointAt::unpackData(LLMessageSystem *mesgsys, S32 blocknum)
}
else
{
- //llwarns << "Could not find source avatar for pointat effect" << llendl;
+ //LL_WARNS() << "Could not find source avatar for pointat effect" << LL_ENDL;
return;
}
@@ -228,7 +228,7 @@ BOOL LLHUDEffectPointAt::setPointAt(EPointAtType target_type, LLViewerObject *ob
if (target_type >= POINTAT_NUM_TARGETS)
{
- llwarns << "Bad target_type " << (int)target_type << " - ignoring." << llendl;
+ LL_WARNS() << "Bad target_type " << (int)target_type << " - ignoring." << LL_ENDL;
return FALSE;
}
@@ -252,7 +252,7 @@ BOOL LLHUDEffectPointAt::setPointAt(EPointAtType target_type, LLViewerObject *ob
mLastSentOffsetGlobal = position;
setDuration(POINTAT_TIMEOUTS[target_type]);
setNeedsSendToSim(TRUE);
-// llinfos << "Sending pointat data" << llendl;
+// LL_INFOS() << "Sending pointat data" << LL_ENDL;
}
if (target_type == POINTAT_TARGET_CLEAR)
diff --git a/indra/newview/llhudeffecttrail.cpp b/indra/newview/llhudeffecttrail.cpp
index 39b526c1b5..8771219034 100755
--- a/indra/newview/llhudeffecttrail.cpp
+++ b/indra/newview/llhudeffecttrail.cpp
@@ -85,7 +85,7 @@ void LLHUDEffectSpiral::packData(LLMessageSystem *mesgsys)
{
if (!mSourceObject)
{
- //llwarns << "Missing object in trail pack!" << llendl;
+ //LL_WARNS() << "Missing object in trail pack!" << LL_ENDL;
}
LLHUDEffect::packData(mesgsys);
@@ -117,7 +117,7 @@ void LLHUDEffectSpiral::unpackData(LLMessageSystem *mesgsys, S32 blocknum)
size_t size = mesgsys->getSizeFast(_PREHASH_Effect, blocknum, _PREHASH_TypeData);
if (size != EFFECT_SIZE)
{
- llwarns << "Spiral effect with bad size " << size << llendl;
+ LL_WARNS() << "Spiral effect with bad size " << size << LL_ENDL;
return;
}
mesgsys->getBinaryDataFast(_PREHASH_Effect, _PREHASH_TypeData,
diff --git a/indra/newview/llhudicon.h b/indra/newview/llhudicon.h
index 557252ab0b..e00a985ddc 100755
--- a/indra/newview/llhudicon.h
+++ b/indra/newview/llhudicon.h
@@ -28,7 +28,6 @@
#define LL_LLHUDICON_H
#include "llpointer.h"
-#include "lldarrayptr.h"
#include "llhudobject.h"
#include "v4color.h"
@@ -39,11 +38,8 @@
#include "llfontgl.h"
#include <set>
#include <vector>
-#include "lldarray.h"
// Renders a 2D icon billboard floating at the location specified.
-class LLDrawable;
-class LLViewerObject;
class LLViewerTexture;
class LLHUDIcon : public LLHUDObject
diff --git a/indra/newview/llhudmanager.cpp b/indra/newview/llhudmanager.cpp
index 8f14b53db0..1f9b0f47b1 100755
--- a/indra/newview/llhudmanager.cpp
+++ b/indra/newview/llhudmanager.cpp
@@ -54,13 +54,13 @@ LLHUDManager::~LLHUDManager()
{
}
-static LLFastTimer::DeclareTimer FTM_HUD_EFFECTS("Hud Effects");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_HUD_EFFECTS("Update Hud Effects");
void LLHUDManager::updateEffects()
{
- LLFastTimer ftm(FTM_HUD_EFFECTS);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_HUD_EFFECTS);
S32 i;
- for (i = 0; i < mHUDEffects.count(); i++)
+ for (i = 0; i < mHUDEffects.size(); i++)
{
LLHUDEffect *hep = mHUDEffects[i];
if (hep->isDead())
@@ -74,17 +74,17 @@ void LLHUDManager::updateEffects()
void LLHUDManager::sendEffects()
{
S32 i;
- for (i = 0; i < mHUDEffects.count(); i++)
+ for (i = 0; i < mHUDEffects.size(); i++)
{
LLHUDEffect *hep = mHUDEffects[i];
if (hep->isDead())
{
- llwarns << "Trying to send dead effect!" << llendl;
+ LL_WARNS() << "Trying to send dead effect!" << LL_ENDL;
continue;
}
if (hep->mType < LLHUDObject::LL_HUD_EFFECT_BEAM)
{
- llwarns << "Trying to send effect of type " << hep->mType << " which isn't really an effect and shouldn't be in this list!" << llendl;
+ LL_WARNS() << "Trying to send effect of type " << hep->mType << " which isn't really an effect and shouldn't be in this list!" << LL_ENDL;
continue;
}
if (hep->getNeedsSendToSim() && hep->getOriginatedHere())
@@ -105,18 +105,18 @@ void LLHUDManager::sendEffects()
//static
void LLHUDManager::shutdownClass()
{
- getInstance()->mHUDEffects.reset();
+ getInstance()->mHUDEffects.clear();
}
void LLHUDManager::cleanupEffects()
{
S32 i = 0;
- while (i < mHUDEffects.count())
+ while (i < mHUDEffects.size())
{
if (mHUDEffects[i]->isDead())
{
- mHUDEffects.remove(i);
+ mHUDEffects.erase(mHUDEffects.begin() + i);
}
else
{
@@ -140,7 +140,7 @@ LLHUDEffect *LLHUDManager::createViewerEffect(const U8 type, BOOL send_to_sim, B
hep->setNeedsSendToSim(send_to_sim);
hep->setOriginatedHere(originated_here);
- mHUDEffects.put(hep);
+ mHUDEffects.push_back(hep);
return hep;
}
@@ -159,20 +159,20 @@ void LLHUDManager::processViewerEffect(LLMessageSystem *mesgsys, void **user_dat
effectp = NULL;
LLHUDEffect::getIDType(mesgsys, k, effect_id, effect_type);
S32 i;
- for (i = 0; i < LLHUDManager::getInstance()->mHUDEffects.count(); i++)
+ for (i = 0; i < LLHUDManager::getInstance()->mHUDEffects.size(); i++)
{
LLHUDEffect *cur_effectp = LLHUDManager::getInstance()->mHUDEffects[i];
if (!cur_effectp)
{
- llwarns << "Null effect in effect manager, skipping" << llendl;
- LLHUDManager::getInstance()->mHUDEffects.remove(i);
+ LL_WARNS() << "Null effect in effect manager, skipping" << LL_ENDL;
+ LLHUDManager::getInstance()->mHUDEffects.erase(LLHUDManager::getInstance()->mHUDEffects.begin() + i);
i--;
continue;
}
if (cur_effectp->isDead())
{
- // llwarns << "Dead effect in effect manager, removing" << llendl;
- LLHUDManager::getInstance()->mHUDEffects.remove(i);
+ // LL_WARNS() << "Dead effect in effect manager, removing" << LL_ENDL;
+ LLHUDManager::getInstance()->mHUDEffects.erase(LLHUDManager::getInstance()->mHUDEffects.begin() + i);
i--;
continue;
}
@@ -180,7 +180,7 @@ void LLHUDManager::processViewerEffect(LLMessageSystem *mesgsys, void **user_dat
{
if (cur_effectp->getType() != effect_type)
{
- llwarns << "Viewer effect update doesn't match old type!" << llendl;
+ LL_WARNS() << "Viewer effect update doesn't match old type!" << LL_ENDL;
}
effectp = cur_effectp;
break;
@@ -201,10 +201,10 @@ void LLHUDManager::processViewerEffect(LLMessageSystem *mesgsys, void **user_dat
}
else
{
- llwarns << "Received viewer effect of type " << effect_type << " which isn't really an effect!" << llendl;
+ LL_WARNS() << "Received viewer effect of type " << effect_type << " which isn't really an effect!" << LL_ENDL;
}
}
- //llinfos << "Got viewer effect: " << effect_id << llendl;
+ //LL_INFOS() << "Got viewer effect: " << effect_id << LL_ENDL;
}
diff --git a/indra/newview/llhudmanager.h b/indra/newview/llhudmanager.h
index 09e79acbfc..9c5d49decd 100755
--- a/indra/newview/llhudmanager.h
+++ b/indra/newview/llhudmanager.h
@@ -30,13 +30,8 @@
// Responsible for managing all HUD elements.
#include "llhudobject.h"
-#include "lldarrayptr.h"
-class LLViewerObject;
class LLHUDEffect;
-//Ventrella 9/16/05
-class LLHUDAnimalControls;
-// End Ventrella
class LLMessageSystem;
class LLHUDManager : public LLSingleton<LLHUDManager>
@@ -59,7 +54,7 @@ public:
static LLColor4 sChildColor;
protected:
- LLDynamicArrayPtr<LLPointer<LLHUDEffect> > mHUDEffects;
+ std::vector<LLPointer<LLHUDEffect> > mHUDEffects;
};
#endif // LL_LLHUDMANAGER_H
diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp
index c3b49f739a..31d832e524 100755
--- a/indra/newview/llhudnametag.cpp
+++ b/indra/newview/llhudnametag.cpp
@@ -30,6 +30,7 @@
#include "llhudnametag.h"
#include "llrender.h"
+#include "lltracerecording.h"
#include "llagent.h"
#include "llviewercontrol.h"
@@ -537,7 +538,7 @@ void LLHUDNameTag::updateVisibility()
if (!mSourceObject)
{
- //llwarns << "LLHUDNameTag::updateScreenPos -- mSourceObject is NULL!" << llendl;
+ //LL_WARNS() << "LLHUDNameTag::updateScreenPos -- mSourceObject is NULL!" << LL_ENDL;
mVisible = TRUE;
sVisibleTextObjects.push_back(LLPointer<LLHUDNameTag> (this));
return;
@@ -745,8 +746,8 @@ void LLHUDNameTag::updateAll()
current_screen_area += (F32)(textp->mSoftScreenRect.getWidth() * textp->mSoftScreenRect.getHeight());
}
- LLStat* camera_vel_stat = LLViewerCamera::getInstance()->getVelocityStat();
- F32 camera_vel = camera_vel_stat->getCurrent();
+ LLTrace::CountStatHandle<>* camera_vel_stat = LLViewerCamera::getVelocityStat();
+ F32 camera_vel = LLTrace::get_frame_recording().getLastRecording().getPerSec(*camera_vel_stat);
if (camera_vel > MAX_STABLE_CAMERA_VELOCITY)
{
return;
@@ -814,7 +815,7 @@ void LLHUDNameTag::updateAll()
VisibleTextObjectIterator this_object_it;
for (this_object_it = sVisibleTextObjects.begin(); this_object_it != sVisibleTextObjects.end(); ++this_object_it)
{
- (*this_object_it)->mPositionOffset = lerp((*this_object_it)->mPositionOffset, (*this_object_it)->mTargetPositionOffset, LLCriticalDamp::getInterpolant(POSITION_DAMPING_TC));
+ (*this_object_it)->mPositionOffset = lerp((*this_object_it)->mPositionOffset, (*this_object_it)->mTargetPositionOffset, LLSmoothInterpolation::getInterpolant(POSITION_DAMPING_TC));
}
}
diff --git a/indra/newview/llhudobject.cpp b/indra/newview/llhudobject.cpp
index 95d57d08d8..45fa09e1a1 100755
--- a/indra/newview/llhudobject.cpp
+++ b/indra/newview/llhudobject.cpp
@@ -123,7 +123,7 @@ void LLHUDObject::cleanupHUDObjects()
(*object_it)->markDead();
if ((*object_it)->getNumRefs() > 1)
{
- llinfos << "LLHUDObject " << (LLHUDObject *)(*object_it) << " type " << (S32)(*object_it)->getType() << " has " << (*object_it)->getNumRefs() << " refs!" << llendl;
+ LL_INFOS() << "LLHUDObject " << (LLHUDObject *)(*object_it) << " type " << (S32)(*object_it)->getType() << " has " << (*object_it)->getNumRefs() << " refs!" << LL_ENDL;
}
}
sHUDObjects.clear();
@@ -146,7 +146,7 @@ LLHUDObject *LLHUDObject::addHUDObject(const U8 type)
hud_objectp = new LLHUDNameTag(type);
break;
default:
- llwarns << "Unknown type of hud object:" << (U32) type << llendl;
+ LL_WARNS() << "Unknown type of hud object:" << (U32) type << LL_ENDL;
}
if (hud_objectp)
{
@@ -242,7 +242,7 @@ LLHUDEffect *LLHUDObject::addHUDEffect(const U8 type)
hud_objectp = new LLHUDEffectBlob(type);
break;
default:
- llwarns << "Unknown type of hud effect:" << (U32) type << llendl;
+ LL_WARNS() << "Unknown type of hud effect:" << (U32) type << LL_ENDL;
}
if (hud_objectp)
@@ -252,12 +252,12 @@ LLHUDEffect *LLHUDObject::addHUDEffect(const U8 type)
return hud_objectp;
}
-static LLFastTimer::DeclareTimer FTM_HUD_UPDATE("Update Hud");
+static LLTrace::BlockTimerStatHandle FTM_HUD_UPDATE("Update Hud");
// static
void LLHUDObject::updateAll()
{
- LLFastTimer ftm(FTM_HUD_UPDATE);
+ LL_RECORD_BLOCK_TIME(FTM_HUD_UPDATE);
LLHUDText::updateAll();
LLHUDIcon::updateAll();
LLHUDNameTag::updateAll();
diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp
index 3c6bcd9829..f648d7baae 100755
--- a/indra/newview/llhudtext.cpp
+++ b/indra/newview/llhudtext.cpp
@@ -346,7 +346,7 @@ void LLHUDText::updateVisibility()
if (!mSourceObject)
{
- //llwarns << "LLHUDText::updateScreenPos -- mSourceObject is NULL!" << llendl;
+ //LL_WARNS() << "LLHUDText::updateScreenPos -- mSourceObject is NULL!" << LL_ENDL;
mVisible = TRUE;
if (mOnHUDAttachment)
{
diff --git a/indra/newview/llimagefiltersmanager.cpp b/indra/newview/llimagefiltersmanager.cpp
new file mode 100644
index 0000000000..ee6b39efac
--- /dev/null
+++ b/indra/newview/llimagefiltersmanager.cpp
@@ -0,0 +1,115 @@
+/**
+ * @file llimagefiltersmanager.cpp
+ * @brief Load image filters list and retrieve their path. Mostly used for Flickr UI at the moment.
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2014, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llimagefiltersmanager.h"
+
+#include "lldiriterator.h"
+#include "lltrans.h"
+
+std::string get_sys_dir()
+{
+ return gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "filters", "");
+}
+
+//---------------------------------------------------------------------------
+// LLImageFiltersManager
+//---------------------------------------------------------------------------
+
+LLImageFiltersManager::LLImageFiltersManager()
+{
+}
+
+LLImageFiltersManager::~LLImageFiltersManager()
+{
+}
+
+// virtual static
+void LLImageFiltersManager::initSingleton()
+{
+ loadAllFilters();
+}
+
+void LLImageFiltersManager::loadAllFilters()
+{
+ // Load system (coming out of the box) filters
+ loadFiltersFromDir(get_sys_dir());
+}
+
+void LLImageFiltersManager::loadFiltersFromDir(const std::string& dir)
+{
+ mFiltersList.clear();
+
+ LLDirIterator dir_iter(dir, "*.xml");
+ while (1)
+ {
+ std::string file_name;
+ if (!dir_iter.next(file_name))
+ {
+ break; // no more files
+ }
+
+ // Get the ".xml" out of the file name to get the filter name. That's the one known in strings.xml
+ std::string filter_name_untranslated = file_name.substr(0,file_name.length()-4);
+
+ // Get the localized name for the filter
+ std::string filter_name_translated;
+ bool translated = LLTrans::findString(filter_name_translated, filter_name_untranslated);
+ std::string filter_name = (translated ? filter_name_translated: filter_name_untranslated);
+
+ // Store the filter in the list with its associated file name
+ mFiltersList[filter_name] = file_name;
+ }
+}
+
+// Note : That method is a bit heavy handed but the list of filters is always small (10 or so)
+// and that method is typically called only once when building UI widgets.
+const std::vector<std::string> LLImageFiltersManager::getFiltersList() const
+{
+ std::vector<std::string> filter_list;
+ for (std::map<std::string,std::string>::const_iterator it = mFiltersList.begin(); it != mFiltersList.end(); ++it)
+ {
+ filter_list.push_back(it->first);
+ }
+ return filter_list;
+}
+
+std::string LLImageFiltersManager::getFilterPath(const std::string& filter_name)
+{
+ std::string path = "";
+ std::map<std::string,std::string>::const_iterator it = mFiltersList.find(filter_name);
+ if (it != mFiltersList.end())
+ {
+ // Get the file name for that filter and build the complete path
+ std::string file = it->second;
+ std::string dir = get_sys_dir();
+ path = gDirUtilp->add(dir, file);
+ }
+ return path;
+}
+
+//============================================================================
diff --git a/indra/newview/llimagefiltersmanager.h b/indra/newview/llimagefiltersmanager.h
new file mode 100644
index 0000000000..4751933065
--- /dev/null
+++ b/indra/newview/llimagefiltersmanager.h
@@ -0,0 +1,55 @@
+/**
+ * @file llimagefiltersmanager.h
+ * @brief Load image filters list and retrieve their path. Mostly used for Flickr UI at the moment.
+ *
+ * $LicenseInfo:firstyear=2000&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2014, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLIMAGEFILTERSMANAGER_H
+#define LL_LLIMAGEFILTERSMANAGER_H
+
+#include "llsingleton.h"
+
+//============================================================================
+// LLImageFiltersManager class
+
+class LLImageFiltersManager : public LLSingleton<LLImageFiltersManager>
+{
+ LOG_CLASS(LLImageFiltersManager);
+public:
+ const std::vector<std::string> getFiltersList() const;
+ std::string getFilterPath(const std::string& filter_name);
+
+private:
+ void loadAllFilters();
+ void loadFiltersFromDir(const std::string& dir);
+
+ friend class LLSingleton<LLImageFiltersManager>;
+ /*virtual*/ void initSingleton();
+ LLImageFiltersManager();
+ ~LLImageFiltersManager();
+
+ // List of filters : first is the user friendly localized name, second is the xml file name
+ std::map<std::string,std::string> mFiltersList;
+};
+
+#endif // LL_LLIMAGEFILTERSMANAGER_H
diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp
index 59272d721f..c194dc05b0 100755
--- a/indra/newview/llimpanel.cpp
+++ b/indra/newview/llimpanel.cpp
@@ -159,7 +159,7 @@ LLFloaterIMPanel::LLFloaterIMPanel(const std::string& session_label,
mCallBackEnabled = LLVoiceClient::getInstance()->isSessionCallBackPossible(mSessionUUID);
break;
default:
- llwarns << "Unknown session type" << llendl;
+ LL_WARNS() << "Unknown session type" << LL_ENDL;
xml_filename = "floater_instant_message.xml";
break;
}
@@ -388,16 +388,17 @@ void LLFloaterIMPanel::draw()
class LLSessionInviteResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(LLSessionInviteResponder);
public:
LLSessionInviteResponder(const LLUUID& session_id)
{
mSessionID = session_id;
}
- void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content)
+protected:
+ void httpFailure()
{
- llwarns << "Error inviting all agents to session [status:"
- << statusNum << "]: " << content << llendl;
+ LL_WARNS() << "Error inviting all agents to session " << dumpResponse() << LL_ENDL;
//throw something back to the viewer here?
}
@@ -417,7 +418,7 @@ BOOL LLFloaterIMPanel::inviteToSession(const std::vector<LLUUID>& ids)
if( isInviteAllowed() && (count > 0) )
{
- llinfos << "LLFloaterIMPanel::inviteToSession() - inviting participants" << llendl;
+ LL_INFOS() << "LLFloaterIMPanel::inviteToSession() - inviting participants" << LL_ENDL;
std::string url = region->getCapability("ChatSessionRequest");
@@ -439,9 +440,9 @@ BOOL LLFloaterIMPanel::inviteToSession(const std::vector<LLUUID>& ids)
}
else
{
- llinfos << "LLFloaterIMPanel::inviteToSession -"
+ LL_INFOS() << "LLFloaterIMPanel::inviteToSession -"
<< " no need to invite agents for "
- << mDialog << llendl;
+ << mDialog << LL_ENDL;
// successful add, because everyone that needed to get added
// was added.
}
@@ -778,7 +779,7 @@ void LLFloaterIMPanel::sendMsg()
&& (mDialog == IM_NOTHING_SPECIAL)
&& mOtherParticipantUUID.isNull())
{
- llinfos << "Cannot send IM to everyone unless you're a god." << llendl;
+ LL_INFOS() << "Cannot send IM to everyone unless you're a god." << LL_ENDL;
return;
}
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 70ffdc14ff..8d8239611c 100755
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -68,6 +68,7 @@
#include "llviewerparcelmgr.h"
#include "llconversationlog.h"
#include "message.h"
+#include "llviewerregion.h"
const static std::string ADHOC_NAME_SUFFIX(" Conference");
@@ -254,7 +255,7 @@ void notify_of_message(const LLSD& msg, bool is_dnd_msg)
// 0. nothing - exit
if (("noaction" == user_preferences ||
ON_TOP_AND_ITEM_IS_SELECTED == conversations_floater_status)
- && session_floater->isMessagePaneExpanded())
+ && session_floater->isMessagePaneExpanded())
{
return;
}
@@ -409,6 +410,7 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string&
mOtherParticipantIsAvatar(true),
mStartCallOnInitialize(false),
mStartedAsIMCall(voice),
+ mIsDNDsend(false),
mAvatarNameCacheConnection()
{
// set P2P type by default
@@ -784,7 +786,7 @@ bool LLIMModel::LLIMSession::isOtherParticipantAvaline()
return !mOtherParticipantIsAvatar;
}
-LLUUID LLIMModel::LLIMSession::generateOutgouigAdHocHash() const
+LLUUID LLIMModel::LLIMSession::generateOutgoingAdHocHash() const
{
LLUUID hash = LLUUID::null;
@@ -919,13 +921,13 @@ bool LLIMModel::newSession(const LLUUID& session_id, const std::string& name, co
{
if (name.empty())
{
- llwarns << "Attempt to create a new session with empty name; id = " << session_id << llendl;
+ LL_WARNS() << "Attempt to create a new session with empty name; id = " << session_id << LL_ENDL;
return false;
}
if (findIMSession(session_id))
{
- llwarns << "IM Session " << session_id << " already exists" << llendl;
+ LL_WARNS() << "IM Session " << session_id << " already exists" << LL_ENDL;
return false;
}
@@ -971,7 +973,7 @@ void LLIMModel::getMessagesSilently(const LLUUID& session_id, std::list<LLSD>& m
LLIMSession* session = findIMSession(session_id);
if (!session)
{
- llwarns << "session " << session_id << "does not exist " << llendl;
+ LL_WARNS() << "session " << session_id << "does not exist " << LL_ENDL;
return;
}
@@ -993,7 +995,7 @@ void LLIMModel::sendNoUnreadMessages(const LLUUID& session_id)
LLIMSession* session = findIMSession(session_id);
if (!session)
{
- llwarns << "session " << session_id << "does not exist " << llendl;
+ LL_WARNS() << "session " << session_id << "does not exist " << LL_ENDL;
return;
}
@@ -1013,7 +1015,7 @@ bool LLIMModel::addToHistory(const LLUUID& session_id, const std::string& from,
if (!session)
{
- llwarns << "session " << session_id << "does not exist " << llendl;
+ LL_WARNS() << "session " << session_id << "does not exist " << LL_ENDL;
return false;
}
@@ -1088,7 +1090,7 @@ LLIMModel::LLIMSession* LLIMModel::addMessageSilently(const LLUUID& session_id,
if (!session)
{
- llwarns << "session " << session_id << "does not exist " << llendl;
+ LL_WARNS() << "session " << session_id << "does not exist " << LL_ENDL;
return NULL;
}
@@ -1125,7 +1127,7 @@ const std::string LLIMModel::getName(const LLUUID& session_id) const
if (!session)
{
- llwarns << "session " << session_id << "does not exist " << llendl;
+ LL_WARNS() << "session " << session_id << "does not exist " << LL_ENDL;
return LLTrans::getString("no_session_message");
}
@@ -1137,7 +1139,7 @@ const S32 LLIMModel::getNumUnread(const LLUUID& session_id) const
LLIMSession* session = findIMSession(session_id);
if (!session)
{
- llwarns << "session " << session_id << "does not exist " << llendl;
+ LL_WARNS() << "session " << session_id << "does not exist " << LL_ENDL;
return -1;
}
@@ -1149,7 +1151,7 @@ const LLUUID& LLIMModel::getOtherParticipantID(const LLUUID& session_id) const
LLIMSession* session = findIMSession(session_id);
if (!session)
{
- llwarns << "session " << session_id << " does not exist " << llendl;
+ LL_WARNS() << "session " << session_id << " does not exist " << LL_ENDL;
return LLUUID::null;
}
@@ -1161,7 +1163,7 @@ EInstantMessage LLIMModel::getType(const LLUUID& session_id) const
LLIMSession* session = findIMSession(session_id);
if (!session)
{
- llwarns << "session " << session_id << "does not exist " << llendl;
+ LL_WARNS() << "session " << session_id << "does not exist " << LL_ENDL;
return IM_COUNT;
}
@@ -1173,7 +1175,7 @@ LLVoiceChannel* LLIMModel::getVoiceChannel( const LLUUID& session_id ) const
LLIMSession* session = findIMSession(session_id);
if (!session)
{
- llwarns << "session " << session_id << "does not exist " << llendl;
+ LL_WARNS() << "session " << session_id << "does not exist " << LL_ENDL;
return NULL;
}
@@ -1185,7 +1187,7 @@ LLIMSpeakerMgr* LLIMModel::getSpeakerManager( const LLUUID& session_id ) const
LLIMSession* session = findIMSession(session_id);
if (!session)
{
- llwarns << "session " << session_id << " does not exist " << llendl;
+ LL_WARNS() << "session " << session_id << " does not exist " << LL_ENDL;
return NULL;
}
@@ -1197,7 +1199,7 @@ const std::string& LLIMModel::getHistoryFileName(const LLUUID& session_id) const
LLIMSession* session = findIMSession(session_id);
if (!session)
{
- llwarns << "session " << session_id << " does not exist " << llendl;
+ LL_WARNS() << "session " << session_id << " does not exist " << LL_ENDL;
return LLStringUtil::null;
}
@@ -1352,7 +1354,7 @@ void LLIMModel::sendMessage(const std::string& utf8_text,
// IM_SESSION_INVITE means that this is an Ad-hoc incoming chat
// (it can be also Group chat but it is checked above)
// In this case mInitialTargetIDs contains Ad-hoc session ID and it should not be added
- // to Recent People to prevent showing of an item with (???)(???). See EXT-8246.
+ // to Recent People to prevent showing of an item with (?? ?)(?? ?), sans the spaces. See EXT-8246.
// Concrete participants will be added into this list once they sent message in chat.
if (IM_SESSION_INVITE == dialog) return;
@@ -1459,6 +1461,7 @@ void start_deprecated_conference_chat(
class LLStartConferenceChatResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(LLStartConferenceChatResponder);
public:
LLStartConferenceChatResponder(
const LLUUID& temp_session_id,
@@ -1472,10 +1475,12 @@ public:
mAgents = agents_to_invite;
}
- virtual void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content)
+protected:
+ virtual void httpFailure()
{
//try an "old school" way.
- if ( statusNum == 400 )
+ // *TODO: What about other error status codes? 4xx 5xx?
+ if ( getStatus() == HTTP_BAD_REQUEST )
{
start_deprecated_conference_chat(
mTempSessionID,
@@ -1484,8 +1489,7 @@ public:
mAgents);
}
- llwarns << "LLStartConferenceChatResponder error [status:"
- << statusNum << "]: " << content << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
//else throw an error back to the client?
//in theory we should have just have these error strings
@@ -1577,6 +1581,7 @@ bool LLIMModel::sendStartSession(
class LLViewerChatterBoxInvitationAcceptResponder :
public LLHTTPClient::Responder
{
+ LOG_CLASS(LLViewerChatterBoxInvitationAcceptResponder);
public:
LLViewerChatterBoxInvitationAcceptResponder(
const LLUUID& session_id,
@@ -1586,8 +1591,15 @@ public:
mInvitiationType = invitation_type;
}
- void result(const LLSD& content)
+private:
+ void httpSuccess()
{
+ const LLSD& content = getContent();
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
if ( gIMMgr)
{
LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionID);
@@ -1632,19 +1644,17 @@ public:
}
}
- void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content)
- {
- llwarns << "LLViewerChatterBoxInvitationAcceptResponder error [status:"
- << statusNum << "]: " << content << llendl;
+ void httpFailure()
+ {
+ LL_WARNS() << dumpResponse() << LL_ENDL;
//throw something back to the viewer here?
if ( gIMMgr )
{
gIMMgr->clearPendingAgentListUpdates(mSessionID);
gIMMgr->clearPendingInvitation(mSessionID);
- if ( 404 == statusNum )
+ if ( HTTP_NOT_FOUND == getStatus() )
{
- std::string error_string;
- error_string = "session_does_not_exist_error";
+ static const std::string error_string("session_does_not_exist_error");
gIMMgr->showSessionStartError(error_string, mSessionID);
}
}
@@ -1697,7 +1707,7 @@ LLUUID LLIMMgr::computeSessionID(
if (gAgent.isInGroup(session_id) && (session_id != other_participant_id))
{
- llwarns << "Group session id different from group id: IM type = " << dialog << ", session id = " << session_id << ", group id = " << other_participant_id << llendl;
+ LL_WARNS() << "Group session id different from group id: IM type = " << dialog << ", session id = " << session_id << ", group id = " << other_participant_id << LL_ENDL;
}
return session_id;
}
@@ -2443,7 +2453,7 @@ void LLIncomingCallDialog::processCallResponse(S32 response, const LLSD &payload
std::string correct_session_name = session_name;
if (session_name.empty())
{
- llwarns << "Received an empty session name from a server" << llendl;
+ LL_WARNS() << "Received an empty session name from a server" << LL_ENDL;
switch(type){
case IM_SESSION_CONFERENCE_START:
@@ -2465,10 +2475,10 @@ void LLIncomingCallDialog::processCallResponse(S32 response, const LLSD &payload
correct_session_name.append(ADHOC_NAME_SUFFIX);
}
}
- llinfos << "Corrected session name is " << correct_session_name << llendl;
+ LL_INFOS() << "Corrected session name is " << correct_session_name << LL_ENDL;
break;
default:
- llwarning("Received an empty session name from a server and failed to generate a new proper session name", 0);
+ LL_WARNS() << "Received an empty session name from a server and failed to generate a new proper session name" << LL_ENDL;
break;
}
}
@@ -2719,10 +2729,10 @@ void LLIMMgr::addMessage(
// code, but the session has to be established inside the server before it can be left.
if (LLMuteList::getInstance()->isMuted(other_participant_id) && !from_linden)
{
- llwarns << "Leaving IM session from initiating muted resident " << from << llendl;
+ LL_WARNS() << "Leaving IM session from initiating muted resident " << from << LL_ENDL;
if(!gIMMgr->leaveSession(new_session_id))
{
- llinfos << "Session " << new_session_id << " does not exist." << llendl;
+ LL_INFOS() << "Session " << new_session_id << " does not exist." << LL_ENDL;
}
return;
}
@@ -2857,8 +2867,8 @@ LLUUID LLIMMgr::addSession(
EInstantMessage dialog,
const LLUUID& other_participant_id, bool voice)
{
- LLDynamicArray<LLUUID> ids;
- ids.put(other_participant_id);
+ std::vector<LLUUID> ids;
+ ids.push_back(other_participant_id);
LLUUID session_id = addSession(name, dialog, other_participant_id, ids, voice);
return session_id;
}
@@ -2869,17 +2879,17 @@ LLUUID LLIMMgr::addSession(
const std::string& name,
EInstantMessage dialog,
const LLUUID& other_participant_id,
- const LLDynamicArray<LLUUID>& ids, bool voice,
+ const std::vector<LLUUID>& ids, bool voice,
const LLUUID& floater_id)
{
- if (0 == ids.getLength())
+ if (ids.empty())
{
return LLUUID::null;
}
if (name.empty())
{
- llwarning("Session name cannot be null!", 0);
+ LL_WARNS() << "Session name cannot be null!" << LL_ENDL;
return LLUUID::null;
}
@@ -2927,7 +2937,7 @@ LLUUID LLIMMgr::addSession(
//we don't need to show notes about online/offline, mute/unmute users' statuses for existing sessions
if (!new_session) return session_id;
- llinfos << "LLIMMgr::addSession, new session added, name = " << name << ", session id = " << session_id << llendl;
+ LL_INFOS() << "LLIMMgr::addSession, new session added, name = " << name << ", session id = " << session_id << LL_ENDL;
//Per Plan's suggestion commented "explicit offline status warning" out to make Dessie happier (see EXT-3609)
//*TODO After February 2010 remove this commented out line if no one will be missing that warning
@@ -2964,7 +2974,7 @@ void LLIMMgr::removeSession(const LLUUID& session_id)
LLIMModel::getInstance()->clearSession(session_id);
- llinfos << "LLIMMgr::removeSession, session removed, session id = " << session_id << llendl;
+ LL_INFOS() << "LLIMMgr::removeSession, session removed, session id = " << session_id << LL_ENDL;
notifyObserverSessionRemoved(session_id);
}
@@ -3029,7 +3039,7 @@ void LLIMMgr::inviteToSession(
{
if (voice_invite && "VoiceInviteQuestionDefault" == question_type)
{
- llinfos << "Rejecting voice call from initiating muted resident " << caller_name << llendl;
+ LL_INFOS() << "Rejecting voice call from initiating muted resident " << caller_name << LL_ENDL;
LLIncomingCallDialog::processCallResponse(1, payload);
}
return;
@@ -3306,6 +3316,38 @@ bool LLIMMgr::isVoiceCall(const LLUUID& session_id)
return im_session->mStartedAsIMCall;
}
+void LLIMMgr::updateDNDMessageStatus()
+{
+ if (LLIMModel::getInstance()->mId2SessionMap.empty()) return;
+
+ std::map<LLUUID, LLIMModel::LLIMSession*>::const_iterator it = LLIMModel::getInstance()->mId2SessionMap.begin();
+ for (; it != LLIMModel::getInstance()->mId2SessionMap.end(); ++it)
+ {
+ LLIMModel::LLIMSession* session = (*it).second;
+
+ if (session->isP2P())
+ {
+ setDNDMessageSent(session->mSessionID,false);
+ }
+ }
+}
+
+bool LLIMMgr::isDNDMessageSend(const LLUUID& session_id)
+{
+ LLIMModel::LLIMSession* im_session = LLIMModel::getInstance()->findIMSession(session_id);
+ if (!im_session) return false;
+
+ return im_session->mIsDNDsend;
+}
+
+void LLIMMgr::setDNDMessageSent(const LLUUID& session_id, bool is_send)
+{
+ LLIMModel::LLIMSession* im_session = LLIMModel::getInstance()->findIMSession(session_id);
+ if (!im_session) return;
+
+ im_session->mIsDNDsend = is_send;
+}
+
void LLIMMgr::addNotifiedNonFriendSessionID(const LLUUID& session_id)
{
mNotifiedNonFriendSessions.insert(session_id);
@@ -3319,9 +3361,9 @@ bool LLIMMgr::isNonFriendSessionNotified(const LLUUID& session_id)
void LLIMMgr::noteOfflineUsers(
const LLUUID& session_id,
- const LLDynamicArray<LLUUID>& ids)
+ const std::vector<LLUUID>& ids)
{
- S32 count = ids.count();
+ S32 count = ids.size();
if(count == 0)
{
const std::string& only_user = LLTrans::getString("only_user_message");
@@ -3334,11 +3376,11 @@ void LLIMMgr::noteOfflineUsers(
LLIMModel& im_model = LLIMModel::instance();
for(S32 i = 0; i < count; ++i)
{
- info = at.getBuddyInfo(ids.get(i));
+ info = at.getBuddyInfo(ids.at(i));
LLAvatarName av_name;
if (info
&& !info->isOnline()
- && LLAvatarNameCache::get(ids.get(i), &av_name))
+ && LLAvatarNameCache::get(ids.at(i), &av_name))
{
LLUIString offline = LLTrans::getString("offline_message");
// Use display name only because this user is your friend
@@ -3350,7 +3392,7 @@ void LLIMMgr::noteOfflineUsers(
}
void LLIMMgr::noteMutedUsers(const LLUUID& session_id,
- const LLDynamicArray<LLUUID>& ids)
+ const std::vector<LLUUID>& ids)
{
// Don't do this if we don't have a mute list.
LLMuteList *ml = LLMuteList::getInstance();
@@ -3359,14 +3401,14 @@ void LLIMMgr::noteMutedUsers(const LLUUID& session_id,
return;
}
- S32 count = ids.count();
+ S32 count = ids.size();
if(count > 0)
{
LLIMModel* im_model = LLIMModel::getInstance();
for(S32 i = 0; i < count; ++i)
{
- if( ml->isMuted(ids.get(i)) )
+ if( ml->isMuted(ids.at(i)) )
{
LLUIString muted = LLTrans::getString("muted_message");
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index da6039a3ae..f92eff4845 100755
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -34,12 +34,10 @@
#include "lllogchat.h"
#include "llvoicechannel.h"
-
class LLAvatarName;
class LLFriendObserver;
class LLCallDialogManager;
class LLIMSpeakerMgr;
-
/**
* Timeout Timer for outgoing Ad-Hoc/Group IM sessions which being initialized by the server
*/
@@ -95,7 +93,7 @@ public:
bool isGroupSessionType() const { return mSessionType == GROUP_SESSION;}
bool isAvalineSessionType() const { return mSessionType == AVALINE_SESSION;}
- LLUUID generateOutgouigAdHocHash() const;
+ LLUUID generateOutgoingAdHocHash() const;
//*TODO make private
/** ad-hoc sessions involve sophisticated chat history file naming schemes */
@@ -140,6 +138,8 @@ public:
bool mHasOfflineMessage;
+ bool mIsDNDsend;
+
private:
void onAdHocNameCache(const LLAvatarName& av_name);
@@ -355,7 +355,7 @@ public:
LLUUID addSession(const std::string& name,
EInstantMessage dialog,
const LLUUID& other_participant_id,
- const LLDynamicArray<LLUUID>& ids, bool voice = false,
+ const std::vector<LLUUID>& ids, bool voice = false,
const LLUUID& floater_id = LLUUID::null);
/**
@@ -443,6 +443,12 @@ public:
bool isVoiceCall(const LLUUID& session_id);
+ void updateDNDMessageStatus();
+
+ bool isDNDMessageSend(const LLUUID& session_id);
+
+ void setDNDMessageSent(const LLUUID& session_id, bool is_send);
+
void addNotifiedNonFriendSessionID(const LLUUID& session_id);
bool isNonFriendSessionNotified(const LLUUID& session_id);
@@ -458,8 +464,8 @@ private:
// prints a simple message if they are not online. Used to help
// reduce 'hello' messages to the linden employees unlucky enough
// to have their calling card in the default inventory.
- void noteOfflineUsers(const LLUUID& session_id, const LLDynamicArray<LLUUID>& ids);
- void noteMutedUsers(const LLUUID& session_id, const LLDynamicArray<LLUUID>& ids);
+ void noteOfflineUsers(const LLUUID& session_id, const std::vector<LLUUID>& ids);
+ void noteMutedUsers(const LLUUID& session_id, const std::vector<LLUUID>& ids);
void processIMTypingCore(const LLIMInfo* im_info, BOOL typing);
@@ -557,7 +563,7 @@ public:
mAvatarNameCacheConnection.disconnect();
}
}
-
+
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
diff --git a/indra/newview/llinspect.cpp b/indra/newview/llinspect.cpp
index 14382e82d7..e6cb068613 100755
--- a/indra/newview/llinspect.cpp
+++ b/indra/newview/llinspect.cpp
@@ -59,7 +59,7 @@ void LLInspect::draw()
}
else if (mCloseTimer.getStarted())
{
- F32 alpha = clamp_rescale(mCloseTimer.getElapsedTimeF32(), 0.f, FADE_TIME, 1.f, 0.f);
+ F32 alpha = clamp_rescale(mCloseTimer.getElapsedTimeF32(), 0.f, FADE_TIME(), 1.f, 0.f);
LLViewDrawContext context(alpha);
LLFloater::draw();
if (mCloseTimer.getElapsedTimeF32() > FADE_TIME)
diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp
index 9c6db3676f..1e15dc832c 100755
--- a/indra/newview/llinspectavatar.cpp
+++ b/indra/newview/llinspectavatar.cpp
@@ -292,11 +292,6 @@ void LLInspectAvatar::processAvatarData(LLAvatarData* data)
delete mPropertiesRequest;
mPropertiesRequest = NULL;
}
-/*
-prep#
- virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content)
- llwarns << "MuteVoiceResponder error [status:" << status << "]: " << content << llendl;
- */
void LLInspectAvatar::updateVolumeSlider()
{
diff --git a/indra/newview/llinspecttoast.cpp b/indra/newview/llinspecttoast.cpp
index f4fe5dec01..0bc7bd188d 100755
--- a/indra/newview/llinspecttoast.cpp
+++ b/indra/newview/llinspecttoast.cpp
@@ -63,7 +63,7 @@ LLInspectToast::LLInspectToast(const LLSD& notification_id) :
mScreenChannel = dynamic_cast<LLScreenChannel*>(channel);
if(NULL == mScreenChannel)
{
- llwarns << "Could not get requested screen channel." << llendl;
+ LL_WARNS() << "Could not get requested screen channel." << LL_ENDL;
return;
}
@@ -83,7 +83,7 @@ void LLInspectToast::onOpen(const LLSD& notification_id)
LLToast* toast = mScreenChannel->getToastByNotificationID(notification_id);
if (toast == NULL)
{
- llwarns << "Could not get requested toast from screen channel." << llendl;
+ LL_WARNS() << "Could not get requested toast from screen channel." << LL_ENDL;
return;
}
mConnection = toast->setOnToastDestroyedCallback(boost::bind(&LLInspectToast::onToastDestroy, this, _1));
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 44943d8722..33e557cddd 100755
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -70,6 +70,7 @@
#include "llviewermenu.h"
#include "llviewermessage.h"
#include "llviewerobjectlist.h"
+#include "llviewerregion.h"
#include "llviewerwindow.h"
#include "llvoavatarself.h"
#include "llwearablelist.h"
@@ -102,6 +103,7 @@ bool move_task_inventory_callback(const LLSD& notification, const LLSD& response
bool confirm_attachment_rez(const LLSD& notification, const LLSD& response);
void teleport_via_landmark(const LLUUID& asset_id);
static BOOL can_move_to_outfit(LLInventoryItem* inv_item, BOOL move_is_into_current_outfit);
+static BOOL can_move_to_landmarks(LLInventoryItem* inv_item);
static bool check_category(LLInventoryModel* model,
const LLUUID& cat_id,
LLInventoryPanel* active_panel,
@@ -201,6 +203,7 @@ const std::string& LLInvFVBridge::getDisplayName() const
{
buildDisplayName();
}
+
return mDisplayName;
}
@@ -328,7 +331,7 @@ void LLInvFVBridge::removeBatch(std::vector<LLFolderViewModelItem*>& batch)
if (cat)
{
gInventory.collectDescendents( cat->getUUID(), descendent_categories, descendent_items, FALSE );
- for (j=0; j<descendent_items.count(); j++)
+ for (j=0; j<descendent_items.size(); j++)
{
if(LLAssetType::AT_GESTURE == descendent_items[j]->getType())
{
@@ -490,12 +493,12 @@ BOOL LLInvFVBridge::isClipboardPasteable() const
}
// In normal mode, we need to check each element of the clipboard to know if we can paste or not
- LLDynamicArray<LLUUID> objects;
+ std::vector<LLUUID> objects;
LLClipboard::instance().pasteFromClipboard(objects);
- S32 count = objects.count();
+ S32 count = objects.size();
for(S32 i = 0; i < count; i++)
{
- const LLUUID &item_id = objects.get(i);
+ const LLUUID &item_id = objects.at(i);
// Folders are pastable if all items in there are copyable
const LLInventoryCategory *cat = model->getCategory(item_id);
@@ -530,12 +533,12 @@ BOOL LLInvFVBridge::isClipboardPasteableAsLink() const
return FALSE;
}
- LLDynamicArray<LLUUID> objects;
+ std::vector<LLUUID> objects;
LLClipboard::instance().pasteFromClipboard(objects);
- S32 count = objects.count();
+ S32 count = objects.size();
for(S32 i = 0; i < count; i++)
{
- const LLInventoryItem *item = model->getItem(objects.get(i));
+ const LLInventoryItem *item = model->getItem(objects.at(i));
if (item)
{
if (!LLAssetType::lookupCanLink(item->getActualType()))
@@ -543,7 +546,7 @@ BOOL LLInvFVBridge::isClipboardPasteableAsLink() const
return FALSE;
}
}
- const LLViewerInventoryCategory *cat = model->getCategory(objects.get(i));
+ const LLViewerInventoryCategory *cat = model->getCategory(objects.at(i));
if (cat && LLFolderType::lookupIsProtectedType(cat->getPreferredType()))
{
return FALSE;
@@ -733,7 +736,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
{
- lldebugs << "LLInvFVBridge::buildContextMenu()" << llendl;
+ LL_DEBUGS() << "LLInvFVBridge::buildContextMenu()" << LL_ENDL;
menuentry_vec_t items;
menuentry_vec_t disabled_items;
if(isItemInTrash())
@@ -861,7 +864,7 @@ BOOL LLInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const
}
*id = obj->getUUID();
- //object_ids.put(obj->getUUID());
+ //object_ids.push_back(obj->getUUID());
if (*type == DAD_CATEGORY)
{
@@ -1032,7 +1035,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type,
case LLAssetType::AT_TEXTURE:
if(!(inv_type == LLInventoryType::IT_TEXTURE || inv_type == LLInventoryType::IT_SNAPSHOT))
{
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << llendl;
+ LL_WARNS() << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << LL_ENDL;
}
new_listener = new LLTextureBridge(inventory, root, uuid, inv_type);
break;
@@ -1040,7 +1043,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type,
case LLAssetType::AT_SOUND:
if(!(inv_type == LLInventoryType::IT_SOUND))
{
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << llendl;
+ LL_WARNS() << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << LL_ENDL;
}
new_listener = new LLSoundBridge(inventory, root, uuid);
break;
@@ -1048,7 +1051,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type,
case LLAssetType::AT_LANDMARK:
if(!(inv_type == LLInventoryType::IT_LANDMARK))
{
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << llendl;
+ LL_WARNS() << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << LL_ENDL;
}
new_listener = new LLLandmarkBridge(inventory, root, uuid, flags);
break;
@@ -1056,7 +1059,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type,
case LLAssetType::AT_CALLINGCARD:
if(!(inv_type == LLInventoryType::IT_CALLINGCARD))
{
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << llendl;
+ LL_WARNS() << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << LL_ENDL;
}
new_listener = new LLCallingCardBridge(inventory, root, uuid);
break;
@@ -1064,7 +1067,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type,
case LLAssetType::AT_SCRIPT:
if(!(inv_type == LLInventoryType::IT_LSL))
{
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << llendl;
+ LL_WARNS() << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << LL_ENDL;
}
new_listener = new LLItemBridge(inventory, root, uuid);
break;
@@ -1072,7 +1075,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type,
case LLAssetType::AT_OBJECT:
if(!(inv_type == LLInventoryType::IT_OBJECT || inv_type == LLInventoryType::IT_ATTACHMENT))
{
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << llendl;
+ LL_WARNS() << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << LL_ENDL;
}
new_listener = new LLObjectBridge(inventory, root, uuid, inv_type, flags);
break;
@@ -1080,7 +1083,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type,
case LLAssetType::AT_NOTECARD:
if(!(inv_type == LLInventoryType::IT_NOTECARD))
{
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << llendl;
+ LL_WARNS() << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << LL_ENDL;
}
new_listener = new LLNotecardBridge(inventory, root, uuid);
break;
@@ -1088,7 +1091,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type,
case LLAssetType::AT_ANIMATION:
if(!(inv_type == LLInventoryType::IT_ANIMATION))
{
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << llendl;
+ LL_WARNS() << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << LL_ENDL;
}
new_listener = new LLAnimationBridge(inventory, root, uuid);
break;
@@ -1096,7 +1099,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type,
case LLAssetType::AT_GESTURE:
if(!(inv_type == LLInventoryType::IT_GESTURE))
{
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << llendl;
+ LL_WARNS() << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << LL_ENDL;
}
new_listener = new LLGestureBridge(inventory, root, uuid);
break;
@@ -1104,7 +1107,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type,
case LLAssetType::AT_LSL_TEXT:
if(!(inv_type == LLInventoryType::IT_LSL))
{
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << llendl;
+ LL_WARNS() << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << LL_ENDL;
}
new_listener = new LLLSLTextBridge(inventory, root, uuid);
break;
@@ -1113,7 +1116,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type,
case LLAssetType::AT_BODYPART:
if(!(inv_type == LLInventoryType::IT_WEARABLE))
{
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << llendl;
+ LL_WARNS() << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << LL_ENDL;
}
new_listener = new LLWearableBridge(inventory, root, uuid, asset_type, inv_type, (LLWearableType::EType)flags);
break;
@@ -1134,19 +1137,19 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type,
case LLAssetType::AT_MESH:
if(!(inv_type == LLInventoryType::IT_MESH))
{
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << llendl;
+ LL_WARNS() << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << LL_ENDL;
}
new_listener = new LLMeshBridge(inventory, root, uuid);
break;
case LLAssetType::AT_IMAGE_TGA:
case LLAssetType::AT_IMAGE_JPEG:
- //llwarns << LLAssetType::lookup(asset_type) << " asset type is unhandled for uuid " << uuid << llendl;
+ //LL_WARNS() << LLAssetType::lookup(asset_type) << " asset type is unhandled for uuid " << uuid << LL_ENDL;
break;
default:
- llinfos << "Unhandled asset type (llassetstorage.h): "
- << (S32)asset_type << " (" << LLAssetType::lookup(asset_type) << ")" << llendl;
+ LL_INFOS() << "Unhandled asset type (llassetstorage.h): "
+ << (S32)asset_type << " (" << LLAssetType::lookup(asset_type) << ")" << LL_ENDL;
break;
}
@@ -1160,17 +1163,10 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type,
void LLInvFVBridge::purgeItem(LLInventoryModel *model, const LLUUID &uuid)
{
- LLInventoryCategory* cat = model->getCategory(uuid);
- if (cat)
- {
- model->purgeDescendentsOf(uuid);
- model->notifyObservers();
- }
LLInventoryObject* obj = model->getObject(uuid);
if (obj)
{
- model->purgeObject(uuid);
- model->notifyObservers();
+ remove_inventory_object(uuid, NULL);
}
}
@@ -1427,7 +1423,7 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action)
}
else if (isMarketplaceCopyAction(action))
{
- llinfos << "Copy item to marketplace action!" << llendl;
+ LL_INFOS() << "Copy item to marketplace action!" << LL_ENDL;
LLInventoryItem* itemp = model->getItem(mUUID);
if (!itemp) return;
@@ -1606,18 +1602,18 @@ void LLItemBridge::buildDisplayName() const
else
{
mDisplayName.assign(LLStringUtil::null);
-}
-
+ }
+
mSearchableName.assign(mDisplayName);
mSearchableName.append(getLabelSuffix());
LLStringUtil::toUpper(mSearchableName);
-
+
//Name set, so trigger a sort
if(mParent)
-{
- mParent->requestSort();
- }
+ {
+ mParent->requestSort();
}
+}
LLFontGL::StyleFlags LLItemBridge::getLabelStyle() const
{
@@ -1626,7 +1622,7 @@ LLFontGL::StyleFlags LLItemBridge::getLabelStyle() const
if (get_is_item_worn(mUUID))
{
- // llinfos << "BOLD" << llendl;
+ // LL_INFOS() << "BOLD" << LL_ENDL;
font |= LLFontGL::BOLD;
}
else if(item && item->getIsLinkType())
@@ -1731,13 +1727,9 @@ BOOL LLItemBridge::renameItem(const std::string& new_name)
LLViewerInventoryItem* item = getItem();
if(item && (item->getName() != new_name))
{
- LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
- new_item->rename(new_name);
- new_item->updateServer(FALSE);
- model->updateItem(new_item);
-
- model->notifyObservers();
- buildDisplayName();
+ LLSD updates;
+ updates["name"] = new_name;
+ update_inventory_item(item->getUUID(),updates, NULL);
}
// return FALSE because we either notified observers (& therefore
// rebuilt) or we didn't update.
@@ -1773,16 +1765,8 @@ BOOL LLItemBridge::removeItem()
{
if (!item->getIsLinkType())
{
- LLInventoryModel::cat_array_t cat_array;
- LLInventoryModel::item_array_t item_array;
- LLLinkedItemIDMatches is_linked_item_match(mUUID);
- gInventory.collectDescendentsIf(gInventory.getRootFolderID(),
- cat_array,
- item_array,
- LLInventoryModel::INCLUDE_TRASH,
- is_linked_item_match);
-
- const U32 num_links = cat_array.size() + item_array.size();
+ LLInventoryModel::item_array_t item_array = gInventory.collectLinksTo(mUUID);
+ const U32 num_links = item_array.size();
if (num_links > 0)
{
// Warn if the user is will break any links when deleting this item.
@@ -1934,49 +1918,19 @@ void LLFolderBridge::buildDisplayName() const
void LLFolderBridge::update()
{
- bool possibly_has_children = false;
- bool up_to_date = isUpToDate();
- if(!up_to_date && hasChildren()) // we know we have children but haven't fetched them (doesn't obey filter)
- {
- possibly_has_children = true;
- }
-
- bool loading = (possibly_has_children
- && !up_to_date );
+ // we know we have children but haven't fetched them (doesn't obey filter)
+ bool loading = !isUpToDate() && hasChildren() && mFolderViewItem->isOpen();
if (loading != mIsLoading)
{
- if ( loading && !mIsLoading )
+ if ( loading )
{
// Measure how long we've been in the loading state
mTimeSinceRequestStart.reset();
}
+ mIsLoading = loading;
- const BOOL in_inventory = gInventory.isObjectDescendentOf(getUUID(), gInventory.getRootFolderID());
- const BOOL in_library = gInventory.isObjectDescendentOf(getUUID(), gInventory.getLibraryRootFolderID());
-
- bool root_is_loading = false;
- if (in_inventory)
- {
- root_is_loading = LLInventoryModelBackgroundFetch::instance().inventoryFetchInProgress();
- }
- if (in_library)
- {
- root_is_loading = LLInventoryModelBackgroundFetch::instance().libraryFetchInProgress();
- }
- if ((mIsLoading
- && mTimeSinceRequestStart.getElapsedTimeF32() >= gSavedSettings.getF32("FolderLoadingMessageWaitTime"))
- || (LLInventoryModelBackgroundFetch::instance().folderFetchActive()
- && root_is_loading))
- {
- mDisplayName = LLInvFVBridge::getDisplayName() + " ( " + LLTrans::getString("LoadingData") + " ) ";
- mIsLoading = true;
- }
- else
- {
- mDisplayName = LLInvFVBridge::getDisplayName();
- mIsLoading = false;
- }
+ mFolderViewItem->refresh();
}
}
@@ -2080,15 +2034,15 @@ BOOL LLFolderBridge::isClipboardPasteable() const
return FALSE;
}
- LLDynamicArray<LLUUID> objects;
+ std::vector<LLUUID> objects;
LLClipboard::instance().pasteFromClipboard(objects);
const LLViewerInventoryCategory *current_cat = getCategory();
// Search for the direct descendent of current Friends subfolder among all pasted items,
// and return false if is found.
- for(S32 i = objects.count() - 1; i >= 0; --i)
+ for(S32 i = objects.size() - 1; i >= 0; --i)
{
- const LLUUID &obj_id = objects.get(i);
+ const LLUUID &obj_id = objects.at(i);
if ( LLFriendCardsManager::instance().isObjDirectDescendentOfCategory(model->getObject(obj_id), current_cat) )
{
return FALSE;
@@ -2118,12 +2072,12 @@ BOOL LLFolderBridge::isClipboardPasteableAsLink() const
{
const BOOL is_in_friend_folder = LLFriendCardsManager::instance().isCategoryInFriendFolder( current_cat );
const LLUUID &current_cat_id = current_cat->getUUID();
- LLDynamicArray<LLUUID> objects;
+ std::vector<LLUUID> objects;
LLClipboard::instance().pasteFromClipboard(objects);
- S32 count = objects.count();
+ S32 count = objects.size();
for(S32 i = 0; i < count; i++)
{
- const LLUUID &obj_id = objects.get(i);
+ const LLUUID &obj_id = objects.at(i);
const LLInventoryCategory *cat = model->getCategory(obj_id);
if (cat)
{
@@ -2197,9 +2151,9 @@ int get_folder_levels(LLInventoryCategory* inv_cat)
int max_child_levels = 0;
- for (S32 i=0; i < cats->count(); ++i)
+ for (S32 i=0; i < cats->size(); ++i)
{
- LLInventoryCategory* category = cats->get(i);
+ LLInventoryCategory* category = cats->at(i);
max_child_levels = llmax(max_child_levels, get_folder_levels(category));
}
@@ -2227,7 +2181,7 @@ int get_folder_path_length(const LLUUID& ancestor_id, const LLUUID& descendant_i
category = gInventory.getCategory(parent_id);
}
- llwarns << "get_folder_path_length() couldn't trace a path from the descendant to the ancestor" << llendl;
+ LL_WARNS() << "get_folder_path_length() couldn't trace a path from the descendant to the ancestor" << LL_ENDL;
return -1;
}
@@ -2263,13 +2217,18 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
&& (LLToolDragAndDrop::SOURCE_AGENT == source);
BOOL accept = FALSE;
+ U64 filter_types = filter->getFilterTypes();
+ BOOL use_filter = filter_types && (filter_types&LLInventoryFilter::FILTERTYPE_DATE || (filter_types&LLInventoryFilter::FILTERTYPE_OBJECT)==0);
+
if (is_agent_inventory)
{
const LLUUID &trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH, false);
const LLUUID &landmarks_id = model->findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false);
+ const LLUUID &my_outifts_id = model->findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS, false);
const BOOL move_is_into_trash = (mUUID == trash_id) || model->isObjectDescendentOf(mUUID, trash_id);
- const BOOL move_is_into_outfit = getCategory() && (getCategory()->getPreferredType() == LLFolderType::FT_OUTFIT);
+ const BOOL move_is_into_my_outfits = (mUUID == my_outifts_id) || model->isObjectDescendentOf(mUUID, my_outifts_id);
+ const BOOL move_is_into_outfit = move_is_into_my_outfits || (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT);
const BOOL move_is_into_landmarks = (mUUID == landmarks_id) || model->isObjectDescendentOf(mUUID, landmarks_id);
//--------------------------------------------------------------------------------
@@ -2309,7 +2268,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
if (is_movable)
{
model->collectDescendents(cat_id, descendent_categories, descendent_items, FALSE);
- for (S32 i=0; i < descendent_categories.count(); ++i)
+ for (S32 i=0; i < descendent_categories.size(); ++i)
{
LLInventoryCategory* category = descendent_categories[i];
if(LLFolderType::lookupIsProtectedType(category->getPreferredType()))
@@ -2320,9 +2279,32 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
}
}
}
+ U32 max_items_to_wear = gSavedSettings.getU32("WearFolderLimit");
+ if (is_movable
+ && move_is_into_current_outfit
+ && descendent_items.size() > max_items_to_wear)
+ {
+ LLInventoryModel::cat_array_t cats;
+ LLInventoryModel::item_array_t items;
+ LLFindWearablesEx not_worn(/*is_worn=*/ false, /*include_body_parts=*/ false);
+ gInventory.collectDescendentsIf(cat_id,
+ cats,
+ items,
+ LLInventoryModel::EXCLUDE_TRASH,
+ not_worn);
+
+ if (items.size() > max_items_to_wear)
+ {
+ // Can't move 'large' folders into current outfit: MAINT-4086
+ is_movable = FALSE;
+ LLStringUtil::format_map_t args;
+ args["AMOUNT"] = llformat("%d", max_items_to_wear);
+ tooltip_msg = LLTrans::getString("TooltipTooManyWearables",args);
+ }
+ }
if (is_movable && move_is_into_trash)
{
- for (S32 i=0; i < descendent_items.count(); ++i)
+ for (S32 i=0; i < descendent_items.size(); ++i)
{
LLInventoryItem* item = descendent_items[i];
if (get_is_item_worn(item->getUUID()))
@@ -2334,7 +2316,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
}
if (is_movable && move_is_into_landmarks)
{
- for (S32 i=0; i < descendent_items.count(); ++i)
+ for (S32 i=0; i < descendent_items.size(); ++i)
{
LLViewerInventoryItem* item = descendent_items[i];
@@ -2358,7 +2340,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
}
else
{
- int dragged_folder_count = descendent_categories.count();
+ int dragged_folder_count = descendent_categories.size();
int existing_item_count = 0;
int existing_folder_count = 0;
@@ -2397,8 +2379,8 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
model->collectDescendents(master_folder->getUUID(), existing_categories, existing_items, FALSE);
- existing_folder_count += existing_categories.count();
- existing_item_count += existing_items.count();
+ existing_folder_count += existing_categories.size();
+ existing_item_count += existing_items.size();
}
else
{
@@ -2408,7 +2390,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
}
const int nested_folder_count = existing_folder_count + dragged_folder_count;
- const int nested_item_count = existing_item_count + descendent_items.count();
+ const int nested_item_count = existing_item_count + descendent_items.size();
if (nested_folder_count > gSavedSettings.getU32("InventoryOutboxMaxFolderCount"))
{
@@ -2423,7 +2405,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
if (is_movable == TRUE)
{
- for (S32 i=0; i < descendent_items.count(); ++i)
+ for (S32 i=0; i < descendent_items.size(); ++i)
{
LLInventoryItem* item = descendent_items[i];
if (!can_move_to_outbox(item, tooltip_msg))
@@ -2461,7 +2443,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
is_movable = active_folder_view != NULL;
}
- if (is_movable)
+ if (is_movable && use_filter)
{
// Check whether the folder being dragged from active inventory panel
// passes the filter of the destination panel.
@@ -2479,7 +2461,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
// Look for any gestures and deactivate them
if (move_is_into_trash)
{
- for (S32 i=0; i < descendent_items.count(); i++)
+ for (S32 i=0; i < descendent_items.size(); i++)
{
LLInventoryItem* item = descendent_items[i];
if (item->getType() == LLAssetType::AT_GESTURE
@@ -2489,49 +2471,13 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
}
}
}
- // if target is an outfit or current outfit folder we use link
- if (move_is_into_current_outfit || move_is_into_outfit)
+ // if target is current outfit folder we use link
+ if (move_is_into_current_outfit &&
+ inv_cat->getPreferredType() == LLFolderType::FT_NONE)
{
- if (inv_cat->getPreferredType() == LLFolderType::FT_NONE)
- {
- if (move_is_into_current_outfit)
- {
- // traverse category and add all contents to currently worn.
- BOOL append = true;
- LLAppearanceMgr::instance().wearInventoryCategory(inv_cat, false, append);
- }
- else
- {
- // Recursively create links in target outfit.
- LLInventoryModel::cat_array_t cats;
- LLInventoryModel::item_array_t items;
- model->collectDescendents(cat_id, cats, items, LLInventoryModel::EXCLUDE_TRASH);
- LLAppearanceMgr::instance().linkAll(mUUID,items,NULL);
- }
- }
- else
- {
-#if SUPPORT_ENSEMBLES
- // BAP - should skip if dup.
- if (move_is_into_current_outfit)
- {
- LLAppearanceMgr::instance().addEnsembleLink(inv_cat);
- }
- else
- {
- LLPointer<LLInventoryCallback> cb = NULL;
- const std::string empty_description = "";
- link_inventory_item(
- gAgent.getID(),
- cat_id,
- mUUID,
- inv_cat->getName(),
- empty_description,
- LLAssetType::AT_LINK_FOLDER,
- cb);
- }
-#endif
- }
+ // traverse category and add all contents to currently worn.
+ BOOL append = true;
+ LLAppearanceMgr::instance().wearInventoryCategory(inv_cat, false, append);
}
else if (move_is_into_outbox && !move_is_from_outbox)
{
@@ -2618,7 +2564,7 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id,
LLViewerObject* object = gObjectList.findObject(object_id);
if(!object)
{
- llinfos << "Object not found for drop." << llendl;
+ LL_INFOS() << "Object not found for drop." << LL_ENDL;
return FALSE;
}
@@ -2629,12 +2575,18 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id,
if (inventory_objects.empty())
{
- llinfos << "Object contents not found for drop." << llendl;
+ LL_INFOS() << "Object contents not found for drop." << LL_ENDL;
return FALSE;
}
BOOL accept = FALSE;
BOOL is_move = FALSE;
+ BOOL use_filter = FALSE;
+ if (filter)
+ {
+ U64 filter_types = filter->getFilterTypes();
+ use_filter = filter_types && (filter_types&LLInventoryFilter::FILTERTYPE_DATE || (filter_types&LLInventoryFilter::FILTERTYPE_OBJECT)==0);
+ }
// coming from a task. Need to figure out if the person can
// move/copy this item.
@@ -2645,7 +2597,7 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id,
LLInventoryItem* item = dynamic_cast<LLInventoryItem*>(it->get());
if (!item)
{
- llwarns << "Invalid inventory item for drop" << llendl;
+ LL_WARNS() << "Invalid inventory item for drop" << LL_ENDL;
continue;
}
@@ -2667,7 +2619,7 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id,
accept = TRUE;
}
- if (filter && accept)
+ if (accept && use_filter)
{
accept = filter->check(item);
}
@@ -2713,7 +2665,7 @@ void LLRightClickInventoryFetchDescendentsObserver::execute(bool clear_observer)
// Bail out immediately if no descendents
if( mComplete.empty() )
{
- llwarns << "LLRightClickInventoryFetchDescendentsObserver::done with empty mCompleteFolders" << llendl;
+ LL_WARNS() << "LLRightClickInventoryFetchDescendentsObserver::done with empty mCompleteFolders" << LL_ENDL;
if (clear_observer)
{
gInventory.removeObserver(this);
@@ -2743,13 +2695,13 @@ void LLRightClickInventoryFetchDescendentsObserver::execute(bool clear_observer)
S32 item_count(0);
if( item_array )
{
- item_count = item_array->count();
+ item_count = item_array->size();
}
S32 cat_count(0);
if( cat_array )
{
- cat_count = cat_array->count();
+ cat_count = cat_array->size();
}
// Move to next if current folder empty
@@ -2767,7 +2719,7 @@ void LLRightClickInventoryFetchDescendentsObserver::execute(bool clear_observer)
{
for (S32 i = 0; i < item_count; ++i)
{
- ids.push_back(item_array->get(i)->getUUID());
+ ids.push_back(item_array->at(i)->getUUID());
}
outfit = new LLRightClickInventoryFetchObserver(ids);
}
@@ -2776,7 +2728,7 @@ void LLRightClickInventoryFetchDescendentsObserver::execute(bool clear_observer)
{
for (S32 i = 0; i < cat_count; ++i)
{
- ids.push_back(cat_array->get(i)->getUUID());
+ ids.push_back(cat_array->at(i)->getUUID());
}
categories = new LLRightClickInventoryFetchDescendentsObserver(ids);
}
@@ -2871,8 +2823,8 @@ void LLInventoryCopyAndWearObserver::changed(U32 mask)
LLViewerInventoryCategory* category = gInventory.getCategory(mCatID);
if (NULL == category)
{
- llwarns << "gInventory.getCategory(" << mCatID
- << ") was NULL" << llendl;
+ LL_WARNS() << "gInventory.getCategory(" << mCatID
+ << ") was NULL" << LL_ENDL;
}
else
{
@@ -2880,7 +2832,7 @@ void LLInventoryCopyAndWearObserver::changed(U32 mask)
mContentsCount)
{
gInventory.removeObserver(this);
- LLAppearanceMgr::instance().wearInventoryCategory(category, FALSE, FALSE);
+ LLAppearanceMgr::instance().wearInventoryCategory(category, FALSE, TRUE);
delete this;
}
}
@@ -2898,7 +2850,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
LLFolderViewFolder *f = dynamic_cast<LLFolderViewFolder *>(mInventoryPanel.get()->getItemByID(mUUID));
if (f)
{
- f->setOpen(TRUE);
+ f->toggleOpen();
}
return;
@@ -2923,17 +2875,6 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
modifyOutfit(FALSE);
return;
}
-#if SUPPORT_ENSEMBLES
- else if ("wearasensemble" == action)
- {
- LLInventoryModel* model = getInventoryModel();
- if(!model) return;
- LLViewerInventoryCategory* cat = getCategory();
- if(!cat) return;
- LLAppearanceMgr::instance().addEnsembleLink(cat,true);
- return;
- }
-#endif
else if ("addtooutfit" == action)
{
modifyOutfit(TRUE);
@@ -2978,7 +2919,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
#endif
else if (isMarketplaceCopyAction(action))
{
- llinfos << "Copy folder to marketplace action!" << llendl;
+ LL_INFOS() << "Copy folder to marketplace action!" << LL_ENDL;
LLInventoryCategory * cat = gInventory.getCategory(mUUID);
if (!cat) return;
@@ -2989,7 +2930,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
#if ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU
else if (isMarketplaceSendAction(action))
{
- llinfos << "Send to marketplace action!" << llendl;
+ LL_INFOS() << "Send to marketplace action!" << LL_ENDL;
LLInventoryCategory * cat = gInventory.getCategory(mUUID);
if (!cat) return;
@@ -3001,7 +2942,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
void LLFolderBridge::openItem()
{
- lldebugs << "LLFolderBridge::openItem()" << llendl;
+ LL_DEBUGS() << "LLFolderBridge::openItem()" << LL_ENDL;
LLInventoryModel* model = getInventoryModel();
if(!model) return;
if(mUUID.isNull()) return;
@@ -3096,9 +3037,20 @@ LLUIImagePtr LLFolderBridge::getIconOverlay() const
return NULL;
}
+std::string LLFolderBridge::getLabelSuffix() const
+{
+ static LLCachedControl<F32> folder_loading_message_delay(gSavedSettings, "FolderLoadingMessageWaitTime", 0.5f);
+ return mIsLoading && mTimeSinceRequestStart.getElapsedTimeF32() >= folder_loading_message_delay()
+ ? llformat(" ( %s ) ", LLTrans::getString("LoadingData").c_str())
+ : LLStringUtil::null;
+}
BOOL LLFolderBridge::renameItem(const std::string& new_name)
{
+
+ LLScrollOnRenameObserver *observer = new LLScrollOnRenameObserver(mUUID, mRoot);
+ gInventory.addObserver(observer);
+
rename_category(getInventoryModel(), mUUID, new_name);
// return FALSE because we either notified observers (& therefore
@@ -3180,12 +3132,16 @@ void LLFolderBridge::pasteFromClipboard()
{
const LLUUID &current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false);
const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
+ const LLUUID &favorites_id = model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE, false);
+ const LLUUID &my_outifts_id = model->findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS, false);
const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id);
- const BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT);
+ const BOOL move_is_into_my_outfits = (mUUID == my_outifts_id) || model->isObjectDescendentOf(mUUID, my_outifts_id);
+ const BOOL move_is_into_outfit = move_is_into_my_outfits || (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT);
const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id);
+ const BOOL move_is_into_favorites = (mUUID == favorites_id);
- LLDynamicArray<LLUUID> objects;
+ std::vector<LLUUID> objects;
LLClipboard::instance().pasteFromClipboard(objects);
if (move_is_into_outbox)
@@ -3198,7 +3154,7 @@ void LLFolderBridge::pasteFromClipboard()
BOOL can_list = TRUE;
- for (LLDynamicArray<LLUUID>::const_iterator iter = objects.begin();
+ for (std::vector<LLUUID>::const_iterator iter = objects.begin();
(iter != objects.end()) && (can_list == TRUE);
++iter)
{
@@ -3229,7 +3185,7 @@ void LLFolderBridge::pasteFromClipboard()
const LLUUID parent_id(mUUID);
- for (LLDynamicArray<LLUUID>::const_iterator iter = objects.begin();
+ for (std::vector<LLUUID>::const_iterator iter = objects.begin();
iter != objects.end();
++iter)
{
@@ -3241,11 +3197,18 @@ void LLFolderBridge::pasteFromClipboard()
{
if (move_is_into_current_outfit || move_is_into_outfit)
{
- if (can_move_to_outfit(item, move_is_into_current_outfit))
+ if (item && can_move_to_outfit(item, move_is_into_current_outfit))
{
dropToOutfit(item, move_is_into_current_outfit);
}
}
+ else if (move_is_into_favorites)
+ {
+ if (item && can_move_to_landmarks(item))
+ {
+ dropToFavorites(item);
+ }
+ }
else if (LLClipboard::instance().isCutMode())
{
// Do a move to "paste" a "cut"
@@ -3308,9 +3271,11 @@ void LLFolderBridge::pasteLinkFromClipboard()
{
const LLUUID &current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false);
const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
+ const LLUUID &my_outifts_id = model->findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS, false);
const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id);
- const BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT);
+ const BOOL move_is_into_my_outfits = (mUUID == my_outifts_id) || model->isObjectDescendentOf(mUUID, my_outifts_id);
+ const BOOL move_is_into_outfit = move_is_into_my_outfits || (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT);
const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id);
if (move_is_into_outbox)
@@ -3321,9 +3286,9 @@ void LLFolderBridge::pasteLinkFromClipboard()
const LLUUID parent_id(mUUID);
- LLDynamicArray<LLUUID> objects;
+ std::vector<LLUUID> objects;
LLClipboard::instance().pasteFromClipboard(objects);
- for (LLDynamicArray<LLUUID>::const_iterator iter = objects.begin();
+ for (std::vector<LLUUID>::const_iterator iter = objects.begin();
iter != objects.end();
++iter)
{
@@ -3336,28 +3301,9 @@ void LLFolderBridge::pasteLinkFromClipboard()
dropToOutfit(item, move_is_into_current_outfit);
}
}
- else if (LLInventoryCategory *cat = model->getCategory(object_id))
- {
- const std::string empty_description = "";
- link_inventory_item(
- gAgent.getID(),
- cat->getUUID(),
- parent_id,
- cat->getName(),
- empty_description,
- LLAssetType::AT_LINK_FOLDER,
- LLPointer<LLInventoryCallback>(NULL));
- }
- else if (LLInventoryItem *item = model->getItem(object_id))
+ else if (LLConstPointer<LLInventoryObject> obj = model->getObject(object_id))
{
- link_inventory_item(
- gAgent.getID(),
- item->getLinkedUUID(),
- parent_id,
- item->getName(),
- item->getDescription(),
- LLAssetType::AT_LINK,
- LLPointer<LLInventoryCallback>(NULL));
+ link_inventory_object(parent_id, obj, LLPointer<LLInventoryCallback>(NULL));
}
}
// Change mode to paste for next paste
@@ -3384,7 +3330,7 @@ BOOL LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInv
item_array,
LLInventoryModel::EXCLUDE_TRASH,
is_type);
- return ((item_array.count() > 0) ? TRUE : FALSE );
+ return ((item_array.size() > 0) ? TRUE : FALSE );
}
void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items, menuentry_vec_t& disabled_items)
@@ -3448,16 +3394,6 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items
items.push_back(std::string("New Clothes"));
items.push_back(std::string("New Body Parts"));
}
-#if SUPPORT_ENSEMBLES
- // Changing folder types is an unfinished unsupported feature
- // and can lead to unexpected behavior if enabled.
- items.push_back(std::string("Change Type"));
- const LLViewerInventoryCategory *cat = getCategory();
- if (cat && LLFolderType::lookupIsProtectedType(cat->getPreferredType()))
- {
- disabled_items.push_back(std::string("Change Type"));
- }
-#endif
getClipboardEntries(false, items, disabled_items, flags);
}
else
@@ -3619,6 +3555,10 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t&
{
disabled_items.push_back(std::string("Replace Outfit"));
}
+ if (!LLAppearanceMgr::instance().getCanAddToCOF(mUUID))
+ {
+ disabled_items.push_back(std::string("Add To Outfit"));
+ }
items.push_back(std::string("Outfit Separator"));
}
}
@@ -3636,7 +3576,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
menuentry_vec_t items;
menuentry_vec_t disabled_items;
- lldebugs << "LLFolderBridge::buildContextMenu()" << llendl;
+ LL_DEBUGS() << "LLFolderBridge::buildContextMenu()" << LL_ENDL;
LLInventoryModel* model = getInventoryModel();
if(!model) return;
@@ -3665,7 +3605,7 @@ BOOL LLFolderBridge::dragOrDrop(MASK mask, BOOL drop,
{
LLInventoryItem* inv_item = (LLInventoryItem*)cargo_data;
- //llinfos << "LLFolderBridge::dragOrDrop()" << llendl;
+ //LL_INFOS() << "LLFolderBridge::dragOrDrop()" << LL_ENDL;
BOOL accept = FALSE;
switch(cargo_type)
{
@@ -3714,7 +3654,7 @@ BOOL LLFolderBridge::dragOrDrop(MASK mask, BOOL drop,
case DAD_NONE:
break;
default:
- llwarns << "Unhandled cargo type for drag&drop " << cargo_type << llendl;
+ LL_WARNS() << "Unhandled cargo type for drag&drop " << cargo_type << LL_ENDL;
break;
}
return accept;
@@ -3837,6 +3777,28 @@ void LLFolderBridge::modifyOutfit(BOOL append)
LLViewerInventoryCategory* cat = getCategory();
if(!cat) return;
+ // checking amount of items to wear
+ U32 max_items = gSavedSettings.getU32("WearFolderLimit");
+ if (cat->getDescendentCount() > max_items)
+ {
+ LLInventoryModel::cat_array_t cats;
+ LLInventoryModel::item_array_t items;
+ LLFindWearablesEx not_worn(/*is_worn=*/ false, /*include_body_parts=*/ false);
+ gInventory.collectDescendentsIf(cat->getUUID(),
+ cats,
+ items,
+ LLInventoryModel::EXCLUDE_TRASH,
+ not_worn);
+
+ if (items.size() > max_items)
+ {
+ LLSD args;
+ args["AMOUNT"] = llformat("%d", max_items);
+ LLNotificationsUtil::add("TooManyWearables", args);
+ return;
+ }
+ }
+
LLAppearanceMgr::instance().wearInventoryCategory( cat, FALSE, append );
}
@@ -3891,6 +3853,12 @@ static BOOL can_move_to_outfit(LLInventoryItem* inv_item, BOOL move_is_into_curr
return FALSE;
}
+ U32 flags = inv_item->getFlags();
+ if(flags & LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS)
+ {
+ return FALSE;
+ }
+
if (move_is_into_current_outfit && get_is_item_worn(inv_item->getUUID()))
{
return FALSE;
@@ -3949,14 +3917,7 @@ void LLFolderBridge::dropToOutfit(LLInventoryItem* inv_item, BOOL move_is_into_c
else
{
LLPointer<LLInventoryCallback> cb = NULL;
- link_inventory_item(
- gAgent.getID(),
- inv_item->getLinkedUUID(),
- mUUID,
- inv_item->getName(),
- inv_item->getDescription(),
- LLAssetType::AT_LINK,
- cb);
+ link_inventory_object(mUUID, LLConstPointer<LLInventoryObject>(inv_item), cb);
}
}
@@ -3983,16 +3944,22 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
const LLUUID &favorites_id = model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE, false);
const LLUUID &landmarks_id = model->findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false);
const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
+ const LLUUID &my_outifts_id = model->findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS, false);
const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id);
const BOOL move_is_into_favorites = (mUUID == favorites_id);
- const BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT);
+ const BOOL move_is_into_my_outfits = (mUUID == my_outifts_id) || model->isObjectDescendentOf(mUUID, my_outifts_id);
+ const BOOL move_is_into_outfit = move_is_into_my_outfits || (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT);
const BOOL move_is_into_landmarks = (mUUID == landmarks_id) || model->isObjectDescendentOf(mUUID, landmarks_id);
const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id);
const BOOL move_is_from_outbox = model->isObjectDescendentOf(inv_item->getUUID(), outbox_id);
LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource();
BOOL accept = FALSE;
+ U64 filter_types = filter->getFilterTypes();
+ // We shouldn't allow to drop non recent items into recent tab (or some similar transactions)
+ // while we are allowing to interact with regular filtered inventory
+ BOOL use_filter = filter_types && (filter_types&LLInventoryFilter::FILTERTYPE_DATE || (filter_types&LLInventoryFilter::FILTERTYPE_OBJECT)==0);
LLViewerObject* object = NULL;
if(LLToolDragAndDrop::SOURCE_AGENT == source)
{
@@ -4076,7 +4043,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
gInventory.collectDescendents(master_folder->getUUID(), existing_categories, existing_items, FALSE);
- existing_item_count += existing_items.count();
+ existing_item_count += existing_items.size();
}
if (existing_item_count > gSavedSettings.getU32("InventoryOutboxMaxItemCount"))
@@ -4091,7 +4058,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
// Check whether the item being dragged from active inventory panel
// passes the filter of the destination panel.
- if (accept && active_panel)
+ if (accept && active_panel && use_filter)
{
LLFolderViewItem* fv_item = active_panel->getItemByID(inv_item->getUUID());
if (!fv_item) return false;
@@ -4184,7 +4151,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
object = gObjectList.findObject(inv_item->getParentUUID());
if (!object)
{
- llinfos << "Object not found for drop." << llendl;
+ LL_INFOS() << "Object not found for drop." << LL_ENDL;
return FALSE;
}
@@ -4229,7 +4196,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
// Check whether the item being dragged from in world
// passes the filter of the destination panel.
- if (accept)
+ if (accept && use_filter)
{
accept = filter->check(inv_item);
}
@@ -4273,7 +4240,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
// Check whether the item being dragged from notecard
// passes the filter of the destination panel.
- if (accept)
+ if (accept && use_filter)
{
accept = filter->check(inv_item);
}
@@ -4313,7 +4280,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
// Check whether the item being dragged from the library
// passes the filter of the destination panel.
- if (accept && active_panel)
+ if (accept && active_panel && use_filter)
{
LLFolderViewItem* fv_item = active_panel->getItemByID(inv_item->getUUID());
if (!fv_item) return false;
@@ -4350,7 +4317,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
}
else
{
- llwarns << "unhandled drag source" << llendl;
+ LL_WARNS() << "unhandled drag source" << LL_ENDL;
}
return accept;
}
@@ -4373,8 +4340,8 @@ bool check_category(LLInventoryModel* model,
LLInventoryModel::item_array_t descendent_items;
model->collectDescendents(cat_id, descendent_categories, descendent_items, TRUE);
- S32 num_descendent_categories = descendent_categories.count();
- S32 num_descendent_items = descendent_items.count();
+ S32 num_descendent_categories = descendent_categories.size();
+ S32 num_descendent_items = descendent_items.size();
if (num_descendent_categories + num_descendent_items == 0)
{
@@ -4455,7 +4422,7 @@ bool LLTextureBridge::canSaveTexture(void)
void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
{
- lldebugs << "LLTextureBridge::buildContextMenu()" << llendl;
+ LL_DEBUGS() << "LLTextureBridge::buildContextMenu()" << LL_ENDL;
menuentry_vec_t items;
menuentry_vec_t disabled_items;
if(isItemInTrash())
@@ -4525,7 +4492,7 @@ void LLSoundBridge::openSoundPreview(void* which)
void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
{
- lldebugs << "LLSoundBridge::buildContextMenu()" << llendl;
+ LL_DEBUGS() << "LLSoundBridge::buildContextMenu()" << LL_ENDL;
menuentry_vec_t items;
menuentry_vec_t disabled_items;
@@ -4586,7 +4553,7 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
menuentry_vec_t items;
menuentry_vec_t disabled_items;
- lldebugs << "LLLandmarkBridge::buildContextMenu()" << llendl;
+ LL_DEBUGS() << "LLLandmarkBridge::buildContextMenu()" << LL_ENDL;
if(isOutboxFolder())
{
addOutboxContextMenuOptions(flags, items, disabled_items);
@@ -4708,6 +4675,10 @@ public:
virtual void changed(U32 mask)
{
mBridgep->refreshFolderViewItem();
+ if (mask & LLFriendObserver::ONLINE)
+ {
+ mBridgep->checkSearchBySuffixChanges();
+ }
}
protected:
LLCallingCardBridge* mBridgep;
@@ -4742,6 +4713,44 @@ void LLCallingCardBridge::refreshFolderViewItem()
}
}
+void LLCallingCardBridge::checkSearchBySuffixChanges()
+{
+ if (!mDisplayName.empty())
+ {
+ // changes in mDisplayName are processed by rename function and here it will be always same
+ // suffixes are also of fixed length, and we are processing change of one at a time,
+ // so it should be safe to use length (note: mSearchableName is capitalized)
+ S32 old_length = mSearchableName.length();
+ S32 new_length = mDisplayName.length() + getLabelSuffix().length();
+ if (old_length == new_length)
+ {
+ return;
+ }
+ mSearchableName.assign(mDisplayName);
+ mSearchableName.append(getLabelSuffix());
+ LLStringUtil::toUpper(mSearchableName);
+ if (new_length<old_length)
+ {
+ LLInventoryFilter* filter = getInventoryFilter();
+ if (filter && mPassedFilter && mSearchableName.find(filter->getFilterSubString()) == std::string::npos)
+ {
+ // string no longer contains substring
+ // we either have to update all parents manually or restart filter.
+ // dirtyFilter will not work here due to obsolete descendants' generations
+ getInventoryFilter()->setModified(LLFolderViewFilter::FILTER_MORE_RESTRICTIVE);
+ }
+ }
+ else
+ {
+ if (getInventoryFilter())
+ {
+ // mSearchableName became longer, we gained additional suffix and need to repeat filter check.
+ dirtyFilter();
+ }
+ }
+ }
+}
+
// virtual
void LLCallingCardBridge::performAction(LLInventoryModel* model, std::string action)
{
@@ -4829,7 +4838,7 @@ void LLCallingCardBridge::openItem()
void LLCallingCardBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
{
- lldebugs << "LLCallingCardBridge::buildContextMenu()" << llendl;
+ LL_DEBUGS() << "LLCallingCardBridge::buildContextMenu()" << LL_ENDL;
menuentry_vec_t items;
menuentry_vec_t disabled_items;
@@ -5097,7 +5106,7 @@ BOOL LLGestureBridge::removeItem()
void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
{
- lldebugs << "LLGestureBridge::buildContextMenu()" << llendl;
+ LL_DEBUGS() << "LLGestureBridge::buildContextMenu()" << LL_ENDL;
menuentry_vec_t items;
menuentry_vec_t disabled_items;
if(isItemInTrash())
@@ -5157,7 +5166,7 @@ void LLAnimationBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
menuentry_vec_t items;
menuentry_vec_t disabled_items;
- lldebugs << "LLAnimationBridge::buildContextMenu()" << llendl;
+ LL_DEBUGS() << "LLAnimationBridge::buildContextMenu()" << LL_ENDL;
if(isOutboxFolder())
{
items.push_back(std::string("Delete"));
@@ -5340,7 +5349,7 @@ void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attach
(gAgentAvatarp->attachmentWasRequested(item_id) ||
gAgentAvatarp->isWearingAttachment(item_id)))
{
- llwarns << "duplicate attachment request, ignoring" << llendl;
+ LL_WARNS() << "duplicate attachment request, ignoring" << LL_ENDL;
return;
}
gAgentAvatarp->addAttachmentRequest(item_id);
@@ -5652,7 +5661,7 @@ void LLWearableBridge::openItem()
void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
{
- lldebugs << "LLWearableBridge::buildContextMenu()" << llendl;
+ LL_DEBUGS() << "LLWearableBridge::buildContextMenu()" << LL_ENDL;
menuentry_vec_t items;
menuentry_vec_t disabled_items;
if(isItemInTrash())
@@ -5816,7 +5825,7 @@ void LLWearableBridge::onWearOnAvatarArrived( LLViewerWearable* wearable, void*
}
else
{
- llinfos << "By the time wearable asset arrived, its inv item already pointed to a different asset." << llendl;
+ LL_INFOS() << "By the time wearable asset arrived, its inv item already pointed to a different asset." << LL_ENDL;
}
}
}
@@ -5843,7 +5852,7 @@ void LLWearableBridge::onWearAddOnAvatarArrived( LLViewerWearable* wearable, voi
}
else
{
- llinfos << "By the time wearable asset arrived, its inv item already pointed to a different asset." << llendl;
+ LL_INFOS() << "By the time wearable asset arrived, its inv item already pointed to a different asset." << LL_ENDL;
}
}
}
@@ -5887,7 +5896,7 @@ BOOL LLWearableBridge::canRemoveFromAvatar(void* user_data)
void LLWearableBridge::removeFromAvatar()
{
- llwarns << "safe to remove?" << llendl;
+ LL_WARNS() << "safe to remove?" << LL_ENDL;
if (get_is_item_worn(mUUID))
{
LLAppearanceMgr::instance().removeItemFromAvatar(mUUID);
@@ -5905,7 +5914,7 @@ std::string LLLinkItemBridge::sPrefix("Link: ");
void LLLinkItemBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
{
// *TODO: Translate
- lldebugs << "LLLink::buildContextMenu()" << llendl;
+ LL_DEBUGS() << "LLLink::buildContextMenu()" << LL_ENDL;
menuentry_vec_t items;
menuentry_vec_t disabled_items;
@@ -5945,7 +5954,7 @@ void LLMeshBridge::openItem()
void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
{
- lldebugs << "LLMeshBridge::buildContextMenu()" << llendl;
+ LL_DEBUGS() << "LLMeshBridge::buildContextMenu()" << LL_ENDL;
std::vector<std::string> items;
std::vector<std::string> disabled_items;
@@ -6002,7 +6011,7 @@ LLUIImagePtr LLLinkFolderBridge::getIcon() const
void LLLinkFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
{
// *TODO: Translate
- lldebugs << "LLLink::buildContextMenu()" << llendl;
+ LL_DEBUGS() << "LLLink::buildContextMenu()" << LL_ENDL;
menuentry_vec_t items;
menuentry_vec_t disabled_items;
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index bc875e8f37..833fbbadbb 100755
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -158,7 +158,7 @@ protected:
BOOL isAgentInventory() const; // false if lost or in the inventory library
BOOL isCOFFolder() const; // true if COF or descendant of
BOOL isInboxFolder() const; // true if COF or descendant of marketplace inbox
- BOOL isOutboxFolder() const; // true if COF or descendant of marketplace outbox
+
BOOL isOutboxFolderDirectParent() const;
const LLUUID getOutboxFolder() const;
@@ -172,6 +172,10 @@ protected:
const LLUUID& new_parent,
BOOL restamp);
void removeBatchNoCheck(std::vector<LLFolderViewModelItem*>& batch);
+
+public:
+ BOOL isOutboxFolder() const; // true if COF or descendant of marketplace outbox
+
protected:
LLHandle<LLInventoryPanel> mInventoryPanel;
LLFolderView* mRoot;
@@ -252,7 +256,7 @@ public:
LLFolderBridge(LLInventoryPanel* inventory,
LLFolderView* root,
const LLUUID& uuid)
- : LLInvFVBridge(inventory, root, uuid),
+ : LLInvFVBridge(inventory, root, uuid),
mCallingCards(FALSE),
mWearables(FALSE),
mIsLoading(false)
@@ -276,6 +280,8 @@ public:
virtual LLUIImagePtr getIconOverlay() const;
static LLUIImagePtr getIcon(LLFolderType::EType preferred_type);
+
+ virtual std::string getLabelSuffix() const;
virtual BOOL renameItem(const std::string& new_name);
@@ -419,6 +425,7 @@ public:
void* cargo_data,
std::string& tooltip_msg);
void refreshFolderViewItem();
+ void checkSearchBySuffixChanges();
protected:
LLCallingCardObserver* mObserver;
};
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 15463e0d33..f211acedf0 100755
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -37,12 +37,13 @@
#include "llfolderview.h"
#include "llinventorybridge.h"
#include "llviewerfoldertype.h"
+#include "llradiogroup.h"
// linden library includes
#include "llclipboard.h"
#include "lltrans.h"
-LLFastTimer::DeclareTimer FT_FILTER_CLIPBOARD("Filter Clipboard");
+LLTrace::BlockTimerStatHandle FT_FILTER_CLIPBOARD("Filter Clipboard");
LLInventoryFilter::FilterOps::FilterOps(const Params& p)
: mFilterObjectTypes(p.object_types),
@@ -51,6 +52,7 @@ LLInventoryFilter::FilterOps::FilterOps(const Params& p)
mMinDate(p.date_range.min_date),
mMaxDate(p.date_range.max_date),
mHoursAgo(p.hours_ago),
+ mDateSearchDirection(p.date_search_direction),
mShowFolderState(p.show_folder_state),
mPermissions(p.permissions),
mFilterTypes(p.types),
@@ -113,7 +115,7 @@ bool LLInventoryFilter::checkFolder(const LLFolderViewModelItem* item) const
const LLFolderViewModelItemInventory* listener = dynamic_cast<const LLFolderViewModelItemInventory*>(item);
if (!listener)
{
- llerrs << "Folder view event listener not found." << llendl;
+ LL_ERRS() << "Folder view event listener not found." << LL_ENDL;
return false;
}
@@ -177,6 +179,7 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent
// Pass if this item's type is of the correct filter type
if (filterTypes & FILTERTYPE_OBJECT)
{
+
// If it has no type, pass it, unless it's a link.
if (object_type == LLInventoryType::IT_NONE)
{
@@ -209,6 +212,7 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent
{
const U16 HOURS_TO_SECONDS = 3600;
time_t earliest = time_corrected() - mFilterOps.mHoursAgo * HOURS_TO_SECONDS;
+
if (mFilterOps.mMinDate > time_min() && mFilterOps.mMinDate < earliest)
{
earliest = mFilterOps.mMinDate;
@@ -217,9 +221,19 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent
{
earliest = 0;
}
- if (listener->getCreationDate() < earliest ||
- listener->getCreationDate() > mFilterOps.mMaxDate)
- return FALSE;
+
+ if (FILTERDATEDIRECTION_NEWER == mFilterOps.mDateSearchDirection || isSinceLogoff())
+ {
+ if (listener->getCreationDate() < earliest ||
+ listener->getCreationDate() > mFilterOps.mMaxDate)
+ return FALSE;
+ }
+ else
+ {
+ if (listener->getCreationDate() > earliest ||
+ listener->getCreationDate() > mFilterOps.mMaxDate)
+ return FALSE;
+ }
}
////////////////////////////////////////////////////////////////////////////////
@@ -244,13 +258,25 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent
bool is_hidden_if_empty = LLViewerFolderType::lookupIsHiddenIfEmpty(listener->getPreferredType());
if (is_hidden_if_empty)
{
- // Force the fetching of those folders so they are hidden iff they really are empty...
+ // Force the fetching of those folders so they are hidden if they really are empty...
gInventory.fetchDescendentsOf(object_id);
- return FALSE;
+
+ LLInventoryModel::cat_array_t* cat_array = NULL;
+ LLInventoryModel::item_array_t* item_array = NULL;
+ gInventory.getDirectDescendentsOf(object_id,cat_array,item_array);
+ S32 descendents_actual = 0;
+ if(cat_array && item_array)
+ {
+ descendents_actual = cat_array->size() + item_array->size();
+ }
+ if (descendents_actual == 0)
+ {
+ return FALSE;
+ }
}
}
}
-
+
return TRUE;
}
@@ -310,7 +336,7 @@ bool LLInventoryFilter::checkAgainstClipboard(const LLUUID& object_id) const
{
if (LLClipboard::instance().isCutMode())
{
- LLFastTimer ft(FT_FILTER_CLIPBOARD);
+ LL_RECORD_BLOCK_TIME(FT_FILTER_CLIPBOARD);
LLUUID current_id = object_id;
LLInventoryObject *current_object = gInventory.getObject(object_id);
while (current_id.notNull() && current_object)
@@ -629,11 +655,22 @@ void LLInventoryFilter::setHoursAgo(U32 hours)
bool are_date_limits_valid = mFilterOps.mMinDate == time_min() && mFilterOps.mMaxDate == time_max();
bool is_increasing = hours > mFilterOps.mHoursAgo;
+ bool is_decreasing = hours < mFilterOps.mHoursAgo;
bool is_increasing_from_zero = is_increasing && !mFilterOps.mHoursAgo && !isSinceLogoff();
// *NOTE: need to cache last filter time, in case filter goes stale
- BOOL less_restrictive = (are_date_limits_valid && ((is_increasing && mFilterOps.mHoursAgo)) || !hours);
- BOOL more_restrictive = (are_date_limits_valid && (!is_increasing && hours) || is_increasing_from_zero);
+ BOOL less_restrictive;
+ BOOL more_restrictive;
+ if (FILTERDATEDIRECTION_NEWER == mFilterOps.mDateSearchDirection)
+ {
+ less_restrictive = (are_date_limits_valid && ((is_increasing && mFilterOps.mHoursAgo)) || !hours);
+ more_restrictive = (are_date_limits_valid && (!is_increasing && hours) || is_increasing_from_zero);
+ }
+ else
+ {
+ less_restrictive = (are_date_limits_valid && ((is_decreasing && mFilterOps.mHoursAgo)) || !hours);
+ more_restrictive = (are_date_limits_valid && (!is_decreasing && hours) || is_increasing_from_zero);
+ }
mFilterOps.mHoursAgo = hours;
mFilterOps.mMinDate = time_min();
@@ -662,6 +699,20 @@ void LLInventoryFilter::setHoursAgo(U32 hours)
}
}
+void LLInventoryFilter::setDateSearchDirection(U32 direction)
+{
+ if (direction != mFilterOps.mDateSearchDirection)
+ {
+ mFilterOps.mDateSearchDirection = direction;
+ setModified(FILTER_RESTART);
+ }
+}
+
+U32 LLInventoryFilter::getDateSearchDirection() const
+{
+ return mFilterOps.mDateSearchDirection;
+}
+
void LLInventoryFilter::setFilterLinks(U64 filter_links)
{
if (mFilterOps.mFilterLinks != filter_links)
@@ -738,7 +789,7 @@ void LLInventoryFilter::setModified(EFilterModified behavior)
mFirstSuccessGeneration = mCurrentGeneration;
break;
default:
- llerrs << "Bad filter behavior specified" << llendl;
+ LL_ERRS() << "Bad filter behavior specified" << LL_ENDL;
}
}
@@ -926,6 +977,7 @@ LLInventoryFilter& LLInventoryFilter::operator=( const LLInventoryFilter& othe
setFilterObjectTypes(other.getFilterObjectTypes());
setDateRange(other.getMinDate(), other.getMaxDate());
setHoursAgo(other.getHoursAgo());
+ setDateSearchDirection(other.getDateSearchDirection());
setShowFolderState(other.getShowFolderState());
setFilterPermissions(other.getFilterPermissions());
setFilterSubString(other.getFilterSubString());
@@ -938,10 +990,14 @@ void LLInventoryFilter::toParams(Params& params) const
{
params.filter_ops.types = getFilterObjectTypes();
params.filter_ops.category_types = getFilterCategoryTypes();
- params.filter_ops.wearable_types = getFilterWearableTypes();
+ if (getFilterObjectTypes() & FILTERTYPE_WEARABLE)
+ {
+ params.filter_ops.wearable_types = getFilterWearableTypes();
+ }
params.filter_ops.date_range.min_date = getMinDate();
params.filter_ops.date_range.max_date = getMaxDate();
params.filter_ops.hours_ago = getHoursAgo();
+ params.filter_ops.date_search_direction = getDateSearchDirection();
params.filter_ops.show_folder_state = getShowFolderState();
params.filter_ops.permissions = getFilterPermissions();
params.substring = getFilterSubString();
@@ -957,15 +1013,24 @@ void LLInventoryFilter::fromParams(const Params& params)
setFilterObjectTypes(params.filter_ops.types);
setFilterCategoryTypes(params.filter_ops.category_types);
- setFilterWearableTypes(params.filter_ops.wearable_types);
+ if (params.filter_ops.wearable_types.isProvided())
+ {
+ setFilterWearableTypes(params.filter_ops.wearable_types);
+ }
setDateRange(params.filter_ops.date_range.min_date, params.filter_ops.date_range.max_date);
setHoursAgo(params.filter_ops.hours_ago);
+ setDateSearchDirection(params.filter_ops.date_search_direction);
setShowFolderState(params.filter_ops.show_folder_state);
setFilterPermissions(params.filter_ops.permissions);
setFilterSubString(params.substring);
setDateRangeLastLogoff(params.since_logoff);
}
+U64 LLInventoryFilter::getFilterTypes() const
+{
+ return mFilterOps.mFilterTypes;
+}
+
U64 LLInventoryFilter::getFilterObjectTypes() const
{
return mFilterOps.mFilterObjectTypes;
@@ -1080,7 +1145,7 @@ bool LLInventoryFilter::FilterOps::DateRange::validateBlock( bool emit_errors
{
if (emit_errors)
{
- llwarns << "max_date should be greater or equal to min_date" << llendl;
+ LL_WARNS() << "max_date should be greater or equal to min_date" << LL_ENDL;
}
valid = false;
}
diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h
index ce516af0b9..5e18ad4d20 100755
--- a/indra/newview/llinventoryfilter.h
+++ b/indra/newview/llinventoryfilter.h
@@ -55,6 +55,12 @@ public:
FILTERTYPE_EMPTYFOLDERS = 0x1 << 5 // pass if folder is not a system folder to be hidden if
};
+ enum EFilterDateDirection
+ {
+ FILTERDATEDIRECTION_NEWER,
+ FILTERDATEDIRECTION_OLDER
+ };
+
enum EFilterLink
{
FILTERLINK_INCLUDE_LINKS, // show links too
@@ -94,7 +100,8 @@ public:
Optional<EFilterLink> links;
Optional<LLUUID> uuid;
Optional<DateRange> date_range;
- Optional<S32> hours_ago;
+ Optional<U32> hours_ago;
+ Optional<U32> date_search_direction;
Optional<EFolderShow> show_folder_state;
Optional<PermissionMask> permissions;
@@ -107,6 +114,7 @@ public:
uuid("uuid"),
date_range("date_range"),
hours_ago("hours_ago", 0),
+ date_search_direction("date_search_direction", FILTERDATEDIRECTION_NEWER),
show_folder_state("show_folder_state", SHOW_NON_EMPTY_FOLDERS),
permissions("permissions", PERM_NONE)
{}
@@ -124,6 +132,7 @@ public:
time_t mMinDate,
mMaxDate;
U32 mHoursAgo;
+ U32 mDateSearchDirection;
EFolderShow mShowFolderState;
PermissionMask mPermissions;
@@ -151,6 +160,7 @@ public:
// +-------------------------------------------------------------------+
// + Parameters
// +-------------------------------------------------------------------+
+ U64 getFilterTypes() const;
U64 getFilterObjectTypes() const;
U64 getFilterCategoryTypes() const;
U64 getFilterWearableTypes() const;
@@ -177,6 +187,8 @@ public:
void setHoursAgo(U32 hours);
U32 getHoursAgo() const;
+ void setDateSearchDirection(U32 direction);
+ U32 getDateSearchDirection() const;
void setFilterLinks(U64 filter_link);
U64 getFilterLinks() const;
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index f1a4889f5a..1abc09bf3b 100755
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -123,12 +123,9 @@ void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::s
return;
}
- LLPointer<LLViewerInventoryCategory> new_cat = new LLViewerInventoryCategory(cat);
- new_cat->rename(new_name);
- new_cat->updateServer(FALSE);
- model->updateCategory(new_cat);
-
- model->notifyObservers();
+ LLSD updates;
+ updates["name"] = new_name;
+ update_inventory_category(cat_id, updates, NULL);
}
void copy_inventory_category(LLInventoryModel* model,
@@ -436,7 +433,7 @@ void show_item_original(const LLUUID& item_uuid)
LLFloater* floater_inventory = LLFloaterReg::getInstance("inventory");
if (!floater_inventory)
{
- llwarns << "Could not find My Inventory floater" << llendl;
+ LL_WARNS() << "Could not find My Inventory floater" << LL_ENDL;
return;
}
@@ -741,6 +738,13 @@ bool LLIsOfAssetType::operator()(LLInventoryCategory* cat, LLInventoryItem* item
return FALSE;
}
+bool LLIsValidItemLink::operator()(LLInventoryCategory* cat, LLInventoryItem* item)
+{
+ LLViewerInventoryItem *vitem = dynamic_cast<LLViewerInventoryItem*>(item);
+ if (!vitem) return false;
+ return (vitem->getActualType() == LLAssetType::AT_LINK && !vitem->getIsBrokenLink());
+}
+
bool LLIsTypeWithPermissions::operator()(LLInventoryCategory* cat, LLInventoryItem* item)
{
if(mType == LLAssetType::AT_CATEGORY)
@@ -877,7 +881,7 @@ bool LLFindWearablesEx::operator()(LLInventoryCategory* cat, LLInventoryItem* it
if (!vitem) return false;
// Skip non-wearables.
- if (!vitem->isWearableType() && vitem->getType() != LLAssetType::AT_OBJECT)
+ if (!vitem->isWearableType() && vitem->getType() != LLAssetType::AT_OBJECT && vitem->getType() != LLAssetType::AT_GESTURE)
{
return false;
}
@@ -928,7 +932,7 @@ bool LLFindNonRemovableObjects::operator()(LLInventoryCategory* cat, LLInventory
return !get_is_category_removable(&gInventory, cat->getUUID());
}
- llwarns << "Not a category and not an item?" << llendl;
+ LL_WARNS() << "Not a category and not an item?" << LL_ENDL;
return false;
}
diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h
index f1066a4dc9..6b3861aa79 100755
--- a/indra/newview/llinventoryfunctions.h
+++ b/indra/newview/llinventoryfunctions.h
@@ -186,6 +186,13 @@ protected:
LLAssetType::EType mType;
};
+class LLIsValidItemLink : public LLInventoryCollectFunctor
+{
+public:
+ virtual bool operator()(LLInventoryCategory* cat,
+ LLInventoryItem* item);
+};
+
class LLIsTypeWithPermissions : public LLInventoryCollectFunctor
{
public:
diff --git a/indra/newview/llinventoryicon.cpp b/indra/newview/llinventoryicon.cpp
index 02a2475cfd..b7c4ec6f8b 100755
--- a/indra/newview/llinventoryicon.cpp
+++ b/indra/newview/llinventoryicon.cpp
@@ -32,6 +32,7 @@
#include "lldictionary.h"
#include "llinventorydefines.h"
#include "llui.h"
+#include "lluiimage.h"
#include "llwearabletype.h"
struct IconEntry : public LLDictionaryEntry
@@ -49,6 +50,8 @@ public:
LLIconDictionary();
};
+typedef LLPointer<LLUIImage> LLUIImagePtr;
+
LLIconDictionary::LLIconDictionary()
{
addEntry(LLInventoryType::ICONNAME_TEXTURE, new IconEntry("Inv_Texture"));
diff --git a/indra/newview/llinventoryicon.h b/indra/newview/llinventoryicon.h
index 2197c53bb8..bc09e32087 100755
--- a/indra/newview/llinventoryicon.h
+++ b/indra/newview/llinventoryicon.h
@@ -30,7 +30,6 @@
#include "llassettype.h"
#include "llinventorytype.h"
-#include "lluiimage.h"
class LLInventoryIcon
{
@@ -41,11 +40,11 @@ public:
BOOL item_is_multi = FALSE);
static const std::string& getIconName(LLInventoryType::EIconName idx);
- static LLUIImagePtr getIcon(LLAssetType::EType asset_type,
+ static LLPointer<class LLUIImage> getIcon(LLAssetType::EType asset_type,
LLInventoryType::EType inventory_type = LLInventoryType::IT_NONE,
U32 misc_flag = 0, // different meanings depending on item type
BOOL item_is_multi = FALSE);
- static LLUIImagePtr getIcon(LLInventoryType::EIconName idx);
+ static LLPointer<class LLUIImage> getIcon(LLInventoryType::EIconName idx);
protected:
static LLInventoryType::EIconName assignWearableIcon(U32 misc_flag);
diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp
index 348d7ebcec..36e1cc97d1 100755
--- a/indra/newview/llinventoryitemslist.cpp
+++ b/indra/newview/llinventoryitemslist.cpp
@@ -133,11 +133,11 @@ void LLInventoryItemsList::idle(void* user_data)
}
}
-LLFastTimer::DeclareTimer FTM_INVENTORY_ITEMS_REFRESH("Inventory List Refresh");
+LLTrace::BlockTimerStatHandle FTM_INVENTORY_ITEMS_REFRESH("Inventory List Refresh");
void LLInventoryItemsList::refresh()
{
- LLFastTimer _(FTM_INVENTORY_ITEMS_REFRESH);
+ LL_RECORD_BLOCK_TIME(FTM_INVENTORY_ITEMS_REFRESH);
static const unsigned ADD_LIMIT = 20;
uuid_vec_t added_items;
@@ -208,7 +208,7 @@ void LLInventoryItemsList::addNewItem(LLViewerInventoryItem* item, bool rearrang
{
if (!item)
{
- llwarns << "No inventory item. Couldn't create flat list item." << llendl;
+ LL_WARNS() << "No inventory item. Couldn't create flat list item." << LL_ENDL;
llassert(item != NULL);
}
@@ -219,7 +219,7 @@ void LLInventoryItemsList::addNewItem(LLViewerInventoryItem* item, bool rearrang
bool is_item_added = addItem(list_item, item->getUUID(), ADD_BOTTOM, rearrange);
if (!is_item_added)
{
- llwarns << "Couldn't add flat list item." << llendl;
+ LL_WARNS() << "Couldn't add flat list item." << LL_ENDL;
llassert(is_item_added);
}
}
diff --git a/indra/newview/llinventoryitemslist.h b/indra/newview/llinventoryitemslist.h
index b183a2052d..1aa230df99 100755
--- a/indra/newview/llinventoryitemslist.h
+++ b/indra/newview/llinventoryitemslist.h
@@ -29,8 +29,6 @@
#ifndef LL_LLINVENTORYITEMSLIST_H
#define LL_LLINVENTORYITEMSLIST_H
-#include "lldarray.h"
-
// newview
#include "llflatlistview.h"
@@ -46,7 +44,7 @@ public:
virtual ~LLInventoryItemsList();
- void refreshList(const LLDynamicArray<LLPointer<LLViewerInventoryItem> > item_array);
+ void refreshList(const std::vector<LLPointer<LLViewerInventoryItem> > item_array);
boost::signals2::connection setRefreshCompleteCallback(const commit_signal_t::slot_type& cb);
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index ed7fd3cd34..14ca0095ae 100755
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -27,6 +27,7 @@
#include "llviewerprecompiledheaders.h"
#include "llinventorymodel.h"
+#include "llaisapi.h"
#include "llagent.h"
#include "llagentwearables.h"
#include "llappearancemgr.h"
@@ -48,6 +49,7 @@
#include "llcallbacklist.h"
#include "llvoavatarself.h"
#include "llgesturemgr.h"
+#include "llsdutil.h"
#include <typeinfo>
//#define DIFF_INVENTORY_FILES
@@ -103,17 +105,7 @@ bool LLCanCache::operator()(LLInventoryCategory* cat, LLInventoryItem* item)
if(c->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN)
{
S32 descendents_server = c->getDescendentCount();
- LLInventoryModel::cat_array_t* cats;
- LLInventoryModel::item_array_t* items;
- mModel->getDirectDescendentsOf(
- c->getUUID(),
- cats,
- items);
- S32 descendents_actual = 0;
- if(cats && items)
- {
- descendents_actual = cats->count() + items->count();
- }
+ S32 descendents_actual = c->getViewerDescendentCount();
if(descendents_server == descendents_actual)
{
mCachedCatIDs.insert(c->getUUID());
@@ -135,6 +127,7 @@ LLInventoryModel gInventory;
LLInventoryModel::LLInventoryModel()
: mModifyMask(LLInventoryObserver::ALL),
mChangedItemIDs(),
+ mBacklinkMMap(),
mCategoryMap(),
mItemMap(),
mCategoryLock(),
@@ -252,6 +245,23 @@ const LLViewerInventoryCategory* LLInventoryModel::getFirstDescendantOf(const LL
return NULL;
}
+bool LLInventoryModel::getObjectTopmostAncestor(const LLUUID& object_id, LLUUID& result) const
+{
+ LLInventoryObject *object = getObject(object_id);
+ while (object && object->getParentUUID().notNull())
+ {
+ LLInventoryObject *parent_object = getObject(object->getParentUUID());
+ if (!parent_object)
+ {
+ LL_WARNS() << "unable to trace topmost ancestor, missing item for uuid " << object->getParentUUID() << LL_ENDL;
+ return false;
+ }
+ object = parent_object;
+ }
+ result = object->getUUID();
+ return true;
+}
+
// Get the object by id. Returns NULL if not found.
LLInventoryObject* LLInventoryModel::getObject(const LLUUID& id) const
{
@@ -429,15 +439,12 @@ void LLInventoryModel::consolidateForType(const LLUUID& main_id, LLFolderType::E
}
}
-// findCategoryUUIDForType() returns the uuid of the category that
-// specifies 'type' as what it defaults to containing. The category is
-// not necessarily only for that type. *NOTE: This will create a new
-// inventory category on the fly if one does not exist.
-const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType preferred_type, bool create_folder/*,
- bool find_in_library*/)
+const LLUUID LLInventoryModel::findCategoryUUIDForTypeInRoot(
+ LLFolderType::EType preferred_type,
+ bool create_folder,
+ const LLUUID& root_id)
{
LLUUID rv = LLUUID::null;
- const LLUUID &root_id = /*(find_in_library) ? gInventory.getLibraryRootFolderID() :*/ gInventory.getRootFolderID();
if(LLFolderType::FT_ROOT_INVENTORY == preferred_type)
{
rv = root_id;
@@ -448,19 +455,22 @@ const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType prefe
cats = get_ptr_in_map(mParentChildCategoryTree, root_id);
if(cats)
{
- S32 count = cats->count();
+ S32 count = cats->size();
for(S32 i = 0; i < count; ++i)
{
- if (cats->get(i)->getPreferredType() == preferred_type)
+ if(cats->at(i)->getPreferredType() == preferred_type)
{
- rv = cats->get(i)->getUUID();
- break;
+ const LLUUID& folder_id = cats->at(i)->getUUID();
+ if (rv.isNull() || folder_id < rv)
+ {
+ rv = folder_id;
+ }
}
}
}
}
- if(rv.isNull() && isInventoryUsable() && (create_folder && true/*!find_in_library*/))
+ if(rv.isNull() && isInventoryUsable() && create_folder)
{
if(root_id.notNull())
{
@@ -470,68 +480,49 @@ const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType prefe
return rv;
}
-const LLUUID LLInventoryModel::findLibraryCategoryUUIDForType(LLFolderType::EType preferred_type, bool create_folder)
+// findCategoryUUIDForType() returns the uuid of the category that
+// specifies 'type' as what it defaults to containing. The category is
+// not necessarily only for that type. *NOTE: This will create a new
+// inventory category on the fly if one does not exist.
+const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType preferred_type, bool create_folder)
{
- LLUUID rv = LLUUID::null;
-
- const LLUUID &root_id = gInventory.getLibraryRootFolderID();
- if(LLFolderType::FT_ROOT_INVENTORY == preferred_type)
- {
- rv = root_id;
- }
- else if (root_id.notNull())
- {
- cat_array_t* cats = NULL;
- cats = get_ptr_in_map(mParentChildCategoryTree, root_id);
- if(cats)
- {
- S32 count = cats->count();
- for(S32 i = 0; i < count; ++i)
- {
- if(cats->get(i)->getPreferredType() == preferred_type)
- {
- rv = cats->get(i)->getUUID();
- break;
- }
- }
- }
- }
+ return findCategoryUUIDForTypeInRoot(preferred_type, create_folder, gInventory.getRootFolderID());
+}
- if(rv.isNull() && isInventoryUsable() && (create_folder && true/*!find_in_library*/))
- {
- if(root_id.notNull())
- {
- return createNewCategory(root_id, preferred_type, LLStringUtil::null);
- }
- }
- return rv;
+const LLUUID LLInventoryModel::findLibraryCategoryUUIDForType(LLFolderType::EType preferred_type, bool create_folder)
+{
+ return findCategoryUUIDForTypeInRoot(preferred_type, create_folder, gInventory.getLibraryRootFolderID());
}
class LLCreateInventoryCategoryResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(LLCreateInventoryCategoryResponder);
public:
LLCreateInventoryCategoryResponder(LLInventoryModel* model,
- void (*callback)(const LLSD&, void*),
- void* user_data) :
- mModel(model),
- mCallback(callback),
- mData(user_data)
+ boost::optional<inventory_func_type> callback):
+ mModel(model),
+ mCallback(callback)
{
}
- virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+protected:
+ virtual void httpFailure()
{
- LL_WARNS("InvAPI") << "CreateInventoryCategory failed [status:"
- << status << "]: " << content << LL_ENDL;
+ LL_WARNS("InvAPI") << dumpResponse() << LL_ENDL;
}
- virtual void result(const LLSD& content)
+ virtual void httpSuccess()
{
//Server has created folder.
-
+ const LLSD& content = getContent();
+ if (!content.isMap() || !content.has("folder_id"))
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
LLUUID category_id = content["folder_id"].asUUID();
-
+ LL_DEBUGS("Avatar") << ll_pretty_print_sd(content) << LL_ENDL;
// Add the category to the internal representation
LLPointer<LLViewerInventoryCategory> cat =
new LLViewerInventoryCategory( category_id,
@@ -544,17 +535,15 @@ public:
LLInventoryModel::LLCategoryUpdate update(cat->getParentUUID(), 1);
mModel->accountForUpdate(update);
mModel->updateCategory(cat);
-
- if (mCallback && mData)
+
+ if (mCallback)
{
- mCallback(content, mData);
+ mCallback.get()(category_id);
}
-
}
private:
- void (*mCallback)(const LLSD&, void*);
- void* mData;
+ boost::optional<inventory_func_type> mCallback;
LLInventoryModel* mModel;
};
@@ -565,20 +554,19 @@ private:
LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id,
LLFolderType::EType preferred_type,
const std::string& pname,
- void (*callback)(const LLSD&, void*), //Default to NULL
- void* user_data) //Default to NULL
+ boost::optional<inventory_func_type> callback)
{
LLUUID id;
if(!isInventoryUsable())
{
- llwarns << "Inventory is broken." << llendl;
+ LL_WARNS() << "Inventory is broken." << LL_ENDL;
return id;
}
if(LLFolderType::lookup(preferred_type) == LLFolderType::badLookup())
{
- lldebugs << "Attempt to create undefined category." << llendl;
+ LL_DEBUGS() << "Attempt to create undefined category." << LL_ENDL;
return id;
}
@@ -593,33 +581,32 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id,
name.assign(LLViewerFolderType::lookupNewCategoryName(preferred_type));
}
- if ( callback && user_data ) //callback required for acked message.
+ LLViewerRegion* viewer_region = gAgent.getRegion();
+ std::string url;
+ if ( viewer_region )
+ url = viewer_region->getCapability("CreateInventoryCategory");
+
+ if (!url.empty() && callback.get_ptr())
{
- LLViewerRegion* viewer_region = gAgent.getRegion();
- std::string url;
- if ( viewer_region )
- url = viewer_region->getCapability("CreateInventoryCategory");
+ //Let's use the new capability.
- if (!url.empty())
- {
- //Let's use the new capability.
-
- LLSD request, body;
- body["folder_id"] = id;
- body["parent_id"] = parent_id;
- body["type"] = (LLSD::Integer) preferred_type;
- body["name"] = name;
-
- request["message"] = "CreateInventoryCategory";
- request["payload"] = body;
-
- // viewer_region->getCapAPI().post(request);
- LLHTTPClient::post(
- url,
- body,
- new LLCreateInventoryCategoryResponder(this, callback, user_data) );
- return LLUUID::null;
- }
+ LLSD request, body;
+ body["folder_id"] = id;
+ body["parent_id"] = parent_id;
+ body["type"] = (LLSD::Integer) preferred_type;
+ body["name"] = name;
+
+ request["message"] = "CreateInventoryCategory";
+ request["payload"] = body;
+
+ LL_DEBUGS("Avatar") << "create category request: " << ll_pretty_print_sd(request) << LL_ENDL;
+ // viewer_region->getCapAPI().post(request);
+ LLHTTPClient::post(
+ url,
+ body,
+ new LLCreateInventoryCategoryResponder(this, callback) );
+
+ return LLUUID::null;
}
// Add the category to the internal representation
@@ -646,6 +633,40 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id,
return id;
}
+// This is optimized for the case that we just want to know whether a
+// category has any immediate children meeting a condition, without
+// needing to recurse or build up any lists.
+bool LLInventoryModel::hasMatchingDirectDescendent(const LLUUID& cat_id,
+ LLInventoryCollectFunctor& filter)
+{
+ LLInventoryModel::cat_array_t *cats;
+ LLInventoryModel::item_array_t *items;
+ getDirectDescendentsOf(cat_id, cats, items);
+ if (cats)
+ {
+ for (LLInventoryModel::cat_array_t::const_iterator it = cats->begin();
+ it != cats->end(); ++it)
+ {
+ if (filter(*it,NULL))
+ {
+ return true;
+ }
+ }
+ }
+ if (items)
+ {
+ for (LLInventoryModel::item_array_t::const_iterator it = items->begin();
+ it != items->end(); ++it)
+ {
+ if (filter(NULL,*it))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
// Starting with the object specified, add its descendents to the
// array provided, but do not add the inventory object specified by
// id. There is no guaranteed order. Neither array will be erased
@@ -677,8 +698,7 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id,
cat_array_t& cats,
item_array_t& items,
BOOL include_trash,
- LLInventoryCollectFunctor& add,
- BOOL follow_folder_links)
+ LLInventoryCollectFunctor& add)
{
// Start with categories
if(!include_trash)
@@ -690,13 +710,13 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id,
cat_array_t* cat_array = get_ptr_in_map(mParentChildCategoryTree, id);
if(cat_array)
{
- S32 count = cat_array->count();
+ S32 count = cat_array->size();
for(S32 i = 0; i < count; ++i)
{
- LLViewerInventoryCategory* cat = cat_array->get(i);
+ LLViewerInventoryCategory* cat = cat_array->at(i);
if(add(cat,NULL))
{
- cats.put(cat);
+ cats.push_back(cat);
}
collectDescendentsIf(cat->getUUID(), cats, items, include_trash, add);
}
@@ -705,46 +725,16 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id,
LLViewerInventoryItem* item = NULL;
item_array_t* item_array = get_ptr_in_map(mParentChildItemTree, id);
- // Follow folder links recursively. Currently never goes more
- // than one level deep (for current outfit support)
- // Note: if making it fully recursive, need more checking against infinite loops.
- if (follow_folder_links && item_array)
- {
- S32 count = item_array->count();
- for(S32 i = 0; i < count; ++i)
- {
- item = item_array->get(i);
- if (item && item->getActualType() == LLAssetType::AT_LINK_FOLDER)
- {
- LLViewerInventoryCategory *linked_cat = item->getLinkedCategory();
- if (linked_cat && linked_cat->getPreferredType() != LLFolderType::FT_OUTFIT)
- // BAP - was
- // LLAssetType::lookupIsEnsembleCategoryType(linked_cat->getPreferredType()))
- // Change back once ensemble typing is in place.
- {
- if(add(linked_cat,NULL))
- {
- // BAP should this be added here? May not
- // matter if it's only being used in current
- // outfit traversal.
- cats.put(LLPointer<LLViewerInventoryCategory>(linked_cat));
- }
- collectDescendentsIf(linked_cat->getUUID(), cats, items, include_trash, add, FALSE);
- }
- }
- }
- }
-
// Move onto items
if(item_array)
{
- S32 count = item_array->count();
+ S32 count = item_array->size();
for(S32 i = 0; i < count; ++i)
{
- item = item_array->get(i);
+ item = item_array->at(i);
if(add(NULL, item))
{
- items.put(item);
+ items.push_back(item);
}
}
}
@@ -756,26 +746,7 @@ void LLInventoryModel::addChangedMaskForLinks(const LLUUID& object_id, U32 mask)
if (!obj || obj->getIsLinkType())
return;
- LLInventoryModel::cat_array_t cat_array;
- LLInventoryModel::item_array_t item_array;
- LLLinkedItemIDMatches is_linked_item_match(object_id);
- collectDescendentsIf(gInventory.getRootFolderID(),
- cat_array,
- item_array,
- LLInventoryModel::INCLUDE_TRASH,
- is_linked_item_match);
- if (cat_array.empty() && item_array.empty())
- {
- return;
- }
- for (LLInventoryModel::cat_array_t::iterator cat_iter = cat_array.begin();
- cat_iter != cat_array.end();
- cat_iter++)
- {
- LLViewerInventoryCategory *linked_cat = (*cat_iter);
- addChangedMask(mask, linked_cat->getUUID());
- };
-
+ LLInventoryModel::item_array_t item_array = collectLinksTo(object_id);
for (LLInventoryModel::item_array_t::iterator iter = item_array.begin();
iter != item_array.end();
iter++)
@@ -803,17 +774,27 @@ LLViewerInventoryItem* LLInventoryModel::getLinkedItem(const LLUUID& object_id)
return object_id.notNull() ? getItem(getLinkedItemID(object_id)) : NULL;
}
-LLInventoryModel::item_array_t LLInventoryModel::collectLinkedItems(const LLUUID& id,
- const LLUUID& start_folder_id)
+LLInventoryModel::item_array_t LLInventoryModel::collectLinksTo(const LLUUID& id)
{
+ // Get item list via collectDescendents (slow!)
item_array_t items;
- LLInventoryModel::cat_array_t cat_array;
- LLLinkedItemIDMatches is_linked_item_match(id);
- collectDescendentsIf((start_folder_id == LLUUID::null ? gInventory.getRootFolderID() : start_folder_id),
- cat_array,
- items,
- LLInventoryModel::INCLUDE_TRASH,
- is_linked_item_match);
+ const LLInventoryObject *obj = getObject(id);
+ // FIXME - should be as in next line, but this is causing a
+ // stack-smashing crash of cause TBD... check in the REBUILD code.
+ //if (obj && obj->getIsLinkType())
+ if (!obj || obj->getIsLinkType())
+ return items;
+
+ std::pair<backlink_mmap_t::iterator, backlink_mmap_t::iterator> range = mBacklinkMMap.equal_range(id);
+ for (backlink_mmap_t::iterator it = range.first; it != range.second; ++it)
+ {
+ LLViewerInventoryItem *item = getItem(it->second);
+ if (item)
+ {
+ items.push_back(item);
+ }
+ }
+
return items;
}
@@ -830,9 +811,8 @@ bool LLInventoryModel::isInventoryUsable() const
// Calling this method with an inventory item will either change an
// existing item with a matching item_id, or will add the item to the
// current inventory.
-U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item)
+U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item, U32 mask)
{
- U32 mask = LLInventoryObserver::NONE;
if(item->getUUID().isNull())
{
return mask;
@@ -840,7 +820,7 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item)
if(!isInventoryUsable())
{
- llwarns << "Inventory is broken." << llendl;
+ LL_WARNS() << "Inventory is broken." << LL_ENDL;
return mask;
}
@@ -852,7 +832,7 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item)
}
#endif
- LLViewerInventoryItem* old_item = getItem(item->getUUID());
+ LLPointer<LLViewerInventoryItem> old_item = getItem(item->getUUID());
LLPointer<LLViewerInventoryItem> new_item;
if(old_item)
{
@@ -868,12 +848,12 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item)
item_array = get_ptr_in_map(mParentChildItemTree, old_parent_id);
if(item_array)
{
- item_array->removeObj(old_item);
+ vector_replace_with_last(*item_array, old_item);
}
item_array = get_ptr_in_map(mParentChildItemTree, new_parent_id);
if(item_array)
{
- item_array->put(old_item);
+ item_array->push_back(old_item);
}
mask |= LLInventoryObserver::STRUCTURE;
}
@@ -899,11 +879,11 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item)
{
// *FIX: bit of a hack to call update server from here...
new_item->updateServer(TRUE);
- item_array->put(new_item);
+ item_array->push_back(new_item);
}
else
{
- llwarns << "Couldn't find parent-child item tree for " << new_item->getName() << llendl;
+ LL_WARNS() << "Couldn't find parent-child item tree for " << new_item->getName() << LL_ENDL;
}
}
else
@@ -927,13 +907,13 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item)
item_array_t* item_array = get_ptr_in_map(mParentChildItemTree, parent_id);
if(item_array)
{
- item_array->put(new_item);
+ item_array->push_back(new_item);
}
else
{
// Whoops! No such parent, make one.
- llinfos << "Lost item: " << new_item->getUUID() << " - "
- << new_item->getName() << llendl;
+ LL_INFOS() << "Lost item: " << new_item->getUUID() << " - "
+ << new_item->getName() << LL_ENDL;
parent_id = findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND);
new_item->setParent(parent_id);
item_array = get_ptr_in_map(mParentChildItemTree, parent_id);
@@ -942,11 +922,11 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item)
// *FIX: bit of a hack to call update server from
// here...
new_item->updateServer(TRUE);
- item_array->put(new_item);
+ item_array->push_back(new_item);
}
else
{
- llwarns << "Lost and found Not there!!" << llendl;
+ LL_WARNS() << "Lost and found Not there!!" << LL_ENDL;
}
}
}
@@ -1011,7 +991,7 @@ LLInventoryModel::item_array_t* LLInventoryModel::getUnlockedItemArray(const LLU
// Calling this method with an inventory category will either change
// an existing item with the matching id, or it will add the category.
-void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat)
+void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat, U32 mask)
{
if(cat->getUUID().isNull())
{
@@ -1020,15 +1000,14 @@ void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat)
if(!isInventoryUsable())
{
- llwarns << "Inventory is broken." << llendl;
+ LL_WARNS() << "Inventory is broken." << LL_ENDL;
return;
}
- LLViewerInventoryCategory* old_cat = getCategory(cat->getUUID());
+ LLPointer<LLViewerInventoryCategory> old_cat = getCategory(cat->getUUID());
if(old_cat)
{
// We already have an old category, modify it's values
- U32 mask = LLInventoryObserver::NONE;
LLUUID old_parent_id = old_cat->getParentUUID();
LLUUID new_parent_id = cat->getParentUUID();
if(old_parent_id != new_parent_id)
@@ -1038,12 +1017,12 @@ void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat)
cat_array = getUnlockedCatArray(old_parent_id);
if(cat_array)
{
- cat_array->removeObj(old_cat);
+ vector_replace_with_last(*cat_array, old_cat);
}
cat_array = getUnlockedCatArray(new_parent_id);
if(cat_array)
{
- cat_array->put(old_cat);
+ cat_array->push_back(old_cat);
}
mask |= LLInventoryObserver::STRUCTURE;
mask |= LLInventoryObserver::INTERNAL;
@@ -1067,7 +1046,7 @@ void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat)
cat_array = getUnlockedCatArray(cat->getParentUUID());
if(cat_array)
{
- cat_array->put(new_cat);
+ cat_array->push_back(new_cat);
}
// make space in the tree for this category's children.
@@ -1083,40 +1062,40 @@ void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat)
void LLInventoryModel::moveObject(const LLUUID& object_id, const LLUUID& cat_id)
{
- lldebugs << "LLInventoryModel::moveObject()" << llendl;
+ LL_DEBUGS() << "LLInventoryModel::moveObject()" << LL_ENDL;
if(!isInventoryUsable())
{
- llwarns << "Inventory is broken." << llendl;
+ LL_WARNS() << "Inventory is broken." << LL_ENDL;
return;
}
if((object_id == cat_id) || !is_in_map(mCategoryMap, cat_id))
{
- llwarns << "Could not move inventory object " << object_id << " to "
- << cat_id << llendl;
+ LL_WARNS() << "Could not move inventory object " << object_id << " to "
+ << cat_id << LL_ENDL;
return;
}
- LLViewerInventoryCategory* cat = getCategory(object_id);
+ LLPointer<LLViewerInventoryCategory> cat = getCategory(object_id);
if(cat && (cat->getParentUUID() != cat_id))
{
cat_array_t* cat_array;
cat_array = getUnlockedCatArray(cat->getParentUUID());
- if(cat_array) cat_array->removeObj(cat);
+ if(cat_array) vector_replace_with_last(*cat_array, cat);
cat_array = getUnlockedCatArray(cat_id);
cat->setParent(cat_id);
- if(cat_array) cat_array->put(cat);
+ if(cat_array) cat_array->push_back(cat);
addChangedMask(LLInventoryObserver::STRUCTURE, object_id);
return;
}
- LLViewerInventoryItem* item = getItem(object_id);
+ LLPointer<LLViewerInventoryItem> item = getItem(object_id);
if(item && (item->getParentUUID() != cat_id))
{
item_array_t* item_array;
item_array = getUnlockedItemArray(item->getParentUUID());
- if(item_array) item_array->removeObj(item);
+ if(item_array) vector_replace_with_last(*item_array, item);
item_array = getUnlockedItemArray(cat_id);
item->setParent(cat_id);
- if(item_array) item_array->put(item);
+ if(item_array) item_array->push_back(item);
addChangedMask(LLInventoryObserver::STRUCTURE, object_id);
return;
}
@@ -1182,18 +1161,209 @@ void LLInventoryModel::changeCategoryParent(LLViewerInventoryCategory* cat,
notifyObservers();
}
+void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLSD& update)
+{
+ LLTimer timer;
+ if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"))
+ {
+ dump_sequential_xml(gAgentAvatarp->getFullname() + "_ais_update", update);
+ }
+
+ AISUpdate ais_update(update); // parse update llsd into stuff to do.
+ ais_update.doUpdate(); // execute the updates in the appropriate order.
+ LL_INFOS() << "elapsed: " << timer.getElapsedTimeF32() << LL_ENDL;
+}
+
+// Does not appear to be used currently.
+void LLInventoryModel::onItemUpdated(const LLUUID& item_id, const LLSD& updates, bool update_parent_version)
+{
+ U32 mask = LLInventoryObserver::NONE;
+
+ LLPointer<LLViewerInventoryItem> item = gInventory.getItem(item_id);
+ LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (item ? item->getName() : "(NOT FOUND)") << LL_ENDL;
+ if(item)
+ {
+ for (LLSD::map_const_iterator it = updates.beginMap();
+ it != updates.endMap(); ++it)
+ {
+ if (it->first == "name")
+ {
+ LL_INFOS() << "Updating name from " << item->getName() << " to " << it->second.asString() << LL_ENDL;
+ item->rename(it->second.asString());
+ mask |= LLInventoryObserver::LABEL;
+ }
+ else if (it->first == "desc")
+ {
+ LL_INFOS() << "Updating description from " << item->getActualDescription()
+ << " to " << it->second.asString() << LL_ENDL;
+ item->setDescription(it->second.asString());
+ }
+ else
+ {
+ LL_ERRS() << "unhandled updates for field: " << it->first << LL_ENDL;
+ }
+ }
+ mask |= LLInventoryObserver::INTERNAL;
+ addChangedMask(mask, item->getUUID());
+ if (update_parent_version)
+ {
+ // Descendent count is unchanged, but folder version incremented.
+ LLInventoryModel::LLCategoryUpdate up(item->getParentUUID(), 0);
+ accountForUpdate(up);
+ }
+ gInventory.notifyObservers(); // do we want to be able to make this optional?
+ }
+}
+
+// Not used?
+void LLInventoryModel::onCategoryUpdated(const LLUUID& cat_id, const LLSD& updates)
+{
+ U32 mask = LLInventoryObserver::NONE;
+
+ LLPointer<LLViewerInventoryCategory> cat = gInventory.getCategory(cat_id);
+ LL_DEBUGS("Inventory") << "cat_id: [" << cat_id << "] name " << (cat ? cat->getName() : "(NOT FOUND)") << LL_ENDL;
+ if(cat)
+ {
+ for (LLSD::map_const_iterator it = updates.beginMap();
+ it != updates.endMap(); ++it)
+ {
+ if (it->first == "name")
+ {
+ LL_INFOS() << "Updating name from " << cat->getName() << " to " << it->second.asString() << LL_ENDL;
+ cat->rename(it->second.asString());
+ mask |= LLInventoryObserver::LABEL;
+ }
+ else
+ {
+ LL_ERRS() << "unhandled updates for field: " << it->first << LL_ENDL;
+ }
+ }
+ mask |= LLInventoryObserver::INTERNAL;
+ addChangedMask(mask, cat->getUUID());
+ gInventory.notifyObservers(); // do we want to be able to make this optional?
+ }
+}
+
+// Update model after descendents have been purged.
+void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id, bool fix_broken_links)
+{
+ LLPointer<LLViewerInventoryCategory> cat = getCategory(object_id);
+ if (cat.notNull())
+ {
+ // do the cache accounting
+ S32 descendents = cat->getDescendentCount();
+ if(descendents > 0)
+ {
+ LLInventoryModel::LLCategoryUpdate up(object_id, -descendents);
+ accountForUpdate(up);
+ }
+
+ // we know that descendent count is 0, however since the
+ // accounting may actually not do an update, we should force
+ // it here.
+ cat->setDescendentCount(0);
+
+ // unceremoniously remove anything we have locally stored.
+ LLInventoryModel::cat_array_t categories;
+ LLInventoryModel::item_array_t items;
+ collectDescendents(object_id,
+ categories,
+ items,
+ LLInventoryModel::INCLUDE_TRASH);
+ S32 count = items.size();
+
+ LLUUID uu_id;
+ for(S32 i = 0; i < count; ++i)
+ {
+ uu_id = items.at(i)->getUUID();
+
+ // This check prevents the deletion of a previously deleted item.
+ // This is necessary because deletion is not done in a hierarchical
+ // order. The current item may have been already deleted as a child
+ // of its deleted parent.
+ if (getItem(uu_id))
+ {
+ deleteObject(uu_id, fix_broken_links);
+ }
+ }
+
+ count = categories.size();
+ // Slightly kludgy way to make sure categories are removed
+ // only after their child categories have gone away.
+
+ // FIXME: Would probably make more sense to have this whole
+ // descendent-clearing thing be a post-order recursive
+ // function to get the leaf-up behavior automatically.
+ S32 deleted_count;
+ S32 total_deleted_count = 0;
+ do
+ {
+ deleted_count = 0;
+ for(S32 i = 0; i < count; ++i)
+ {
+ uu_id = categories.at(i)->getUUID();
+ if (getCategory(uu_id))
+ {
+ cat_array_t* cat_list = getUnlockedCatArray(uu_id);
+ if (!cat_list || (cat_list->size() == 0))
+ {
+ deleteObject(uu_id, fix_broken_links);
+ deleted_count++;
+ }
+ }
+ }
+ total_deleted_count += deleted_count;
+ }
+ while (deleted_count > 0);
+ if (total_deleted_count != count)
+ {
+ LL_WARNS() << "Unexpected count of categories deleted, got "
+ << total_deleted_count << " expected " << count << LL_ENDL;
+ }
+ //gInventory.validate();
+ }
+}
+
+// Update model after an item is confirmed as removed from
+// server. Works for categories or items.
+void LLInventoryModel::onObjectDeletedFromServer(const LLUUID& object_id, bool fix_broken_links, bool update_parent_version, bool do_notify_observers)
+{
+ LLPointer<LLInventoryObject> obj = getObject(object_id);
+ if(obj)
+ {
+ if (getCategory(object_id))
+ {
+ // For category, need to delete/update all children first.
+ onDescendentsPurgedFromServer(object_id, fix_broken_links);
+ }
+
+
+ // From item/cat removeFromServer()
+ if (update_parent_version)
+ {
+ LLInventoryModel::LLCategoryUpdate up(obj->getParentUUID(), -1);
+ accountForUpdate(up);
+ }
+
+ // From purgeObject()
+ LLPreview::hide(object_id);
+ deleteObject(object_id, fix_broken_links, do_notify_observers);
+ }
+}
+
+
// Delete a particular inventory object by ID.
-void LLInventoryModel::deleteObject(const LLUUID& id)
+void LLInventoryModel::deleteObject(const LLUUID& id, bool fix_broken_links, bool do_notify_observers)
{
- lldebugs << "LLInventoryModel::deleteObject()" << llendl;
+ LL_DEBUGS() << "LLInventoryModel::deleteObject()" << LL_ENDL;
LLPointer<LLInventoryObject> obj = getObject(id);
if (!obj)
{
- llwarns << "Deleting non-existent object [ id: " << id << " ] " << llendl;
+ LL_WARNS() << "Deleting non-existent object [ id: " << id << " ] " << LL_ENDL;
return;
}
- lldebugs << "Deleting inventory object " << id << llendl;
+ LL_DEBUGS() << "Deleting inventory object " << id << LL_ENDL;
mLastItem = NULL;
LLUUID parent_id = obj->getParentUUID();
mCategoryMap.erase(id);
@@ -1202,169 +1372,76 @@ void LLInventoryModel::deleteObject(const LLUUID& id)
item_array_t* item_list = getUnlockedItemArray(parent_id);
if(item_list)
{
- LLViewerInventoryItem* item = (LLViewerInventoryItem*)((LLInventoryObject*)obj);
- item_list->removeObj(item);
+ LLPointer<LLViewerInventoryItem> item = (LLViewerInventoryItem*)((LLInventoryObject*)obj);
+ vector_replace_with_last(*item_list, item);
}
cat_array_t* cat_list = getUnlockedCatArray(parent_id);
if(cat_list)
{
- LLViewerInventoryCategory* cat = (LLViewerInventoryCategory*)((LLInventoryObject*)obj);
- cat_list->removeObj(cat);
+ LLPointer<LLViewerInventoryCategory> cat = (LLViewerInventoryCategory*)((LLInventoryObject*)obj);
+ vector_replace_with_last(*cat_list, cat);
}
item_list = getUnlockedItemArray(id);
if(item_list)
{
+ if (item_list->size())
+ {
+ LL_WARNS() << "Deleting cat " << id << " while it still has child items" << LL_ENDL;
+ }
delete item_list;
mParentChildItemTree.erase(id);
}
cat_list = getUnlockedCatArray(id);
if(cat_list)
{
+ if (cat_list->size())
+ {
+ LL_WARNS() << "Deleting cat " << id << " while it still has child cats" << LL_ENDL;
+ }
delete cat_list;
mParentChildCategoryTree.erase(id);
}
addChangedMask(LLInventoryObserver::REMOVE, id);
- obj = NULL; // delete obj
- updateLinkedObjectsFromPurge(id);
- gInventory.notifyObservers();
-}
-// Delete a particular inventory item by ID, and remove it from the server.
-void LLInventoryModel::purgeObject(const LLUUID &id)
-{
- lldebugs << "LLInventoryModel::purgeObject() [ id: " << id << " ] " << llendl;
- LLPointer<LLInventoryObject> obj = getObject(id);
- if(obj)
+ bool is_link_type = obj->getIsLinkType();
+ if (is_link_type)
+ {
+ removeBacklinkInfo(obj->getUUID(), obj->getLinkedUUID());
+ }
+
+ // Can't have links to links, so there's no need for this update
+ // if the item removed is a link. Can also skip if source of the
+ // update is getting broken link info separately.
+ obj = NULL; // delete obj
+ if (fix_broken_links && !is_link_type)
+ {
+ updateLinkedObjectsFromPurge(id);
+ }
+ if (do_notify_observers)
{
- obj->removeFromServer();
- LLPreview::hide(id);
- deleteObject(id);
+ notifyObservers();
}
}
void LLInventoryModel::updateLinkedObjectsFromPurge(const LLUUID &baseobj_id)
{
- LLInventoryModel::item_array_t item_array = collectLinkedItems(baseobj_id);
+ LLInventoryModel::item_array_t item_array = collectLinksTo(baseobj_id);
// REBUILD is expensive, so clear the current change list first else
// everything else on the changelist will also get rebuilt.
- gInventory.notifyObservers();
- for (LLInventoryModel::item_array_t::const_iterator iter = item_array.begin();
- iter != item_array.end();
- iter++)
- {
- const LLViewerInventoryItem *linked_item = (*iter);
- const LLUUID &item_id = linked_item->getUUID();
- if (item_id == baseobj_id) continue;
- addChangedMask(LLInventoryObserver::REBUILD, item_id);
- }
- gInventory.notifyObservers();
-}
-
-// This is a method which collects the descendents of the id
-// provided. If the category is not found, no action is
-// taken. This method goes through the long winded process of
-// cancelling any calling cards, removing server representation of
-// folders, items, etc in a fairly efficient manner.
-void LLInventoryModel::purgeDescendentsOf(const LLUUID& id)
-{
- LLPointer<LLViewerInventoryCategory> cat = getCategory(id);
- if (cat.notNull())
+ if (item_array.size() > 0)
{
- if (LLClipboard::instance().hasContents() && LLClipboard::instance().isCutMode())
- {
- // Something on the clipboard is in "cut mode" and needs to be preserved
- llinfos << "LLInventoryModel::purgeDescendentsOf " << cat->getName()
- << " iterate and purge non hidden items" << llendl;
- cat_array_t* categories;
- item_array_t* items;
- // Get the list of direct descendants in that category passed as argument
- getDirectDescendentsOf(id, categories, items);
- std::vector<LLUUID> list_uuids;
- // Make a unique list with all the UUIDs of the direct descendants (items and categories are not treated differently)
- // Note: we need to do that shallow copy as purging things will invalidate the categories or items lists
- for (cat_array_t::const_iterator it = categories->begin(); it != categories->end(); ++it)
- {
- list_uuids.push_back((*it)->getUUID());
- }
- for (item_array_t::const_iterator it = items->begin(); it != items->end(); ++it)
- {
- list_uuids.push_back((*it)->getUUID());
- }
- // Iterate through the list and only purge the UUIDs that are not on the clipboard
- for (std::vector<LLUUID>::const_iterator it = list_uuids.begin(); it != list_uuids.end(); ++it)
- {
- if (!LLClipboard::instance().isOnClipboard(*it))
- {
- purgeObject(*it);
- }
- }
- }
- else
+ gInventory.notifyObservers();
+ for (LLInventoryModel::item_array_t::const_iterator iter = item_array.begin();
+ iter != item_array.end();
+ iter++)
{
- // Fast purge
- // do the cache accounting
- llinfos << "LLInventoryModel::purgeDescendentsOf " << cat->getName()
- << llendl;
- S32 descendents = cat->getDescendentCount();
- if(descendents > 0)
- {
- LLCategoryUpdate up(id, -descendents);
- accountForUpdate(up);
- }
-
- // we know that descendent count is 0, however since the
- // accounting may actually not do an update, we should force
- // it here.
- cat->setDescendentCount(0);
-
- // send it upstream
- LLMessageSystem* msg = gMessageSystem;
- msg->newMessage("PurgeInventoryDescendents");
- msg->nextBlock("AgentData");
- msg->addUUID("AgentID", gAgent.getID());
- msg->addUUID("SessionID", gAgent.getSessionID());
- msg->nextBlock("InventoryData");
- msg->addUUID("FolderID", id);
- gAgent.sendReliableMessage();
-
- // unceremoniously remove anything we have locally stored.
- cat_array_t categories;
- item_array_t items;
- collectDescendents(id,
- categories,
- items,
- INCLUDE_TRASH);
- S32 count = items.count();
-
- item_map_t::iterator item_map_end = mItemMap.end();
- cat_map_t::iterator cat_map_end = mCategoryMap.end();
- LLUUID uu_id;
-
- for(S32 i = 0; i < count; ++i)
- {
- uu_id = items.get(i)->getUUID();
-
- // This check prevents the deletion of a previously deleted item.
- // This is necessary because deletion is not done in a hierarchical
- // order. The current item may have been already deleted as a child
- // of its deleted parent.
- if (mItemMap.find(uu_id) != item_map_end)
- {
- deleteObject(uu_id);
- }
- }
-
- count = categories.count();
- for(S32 i = 0; i < count; ++i)
- {
- uu_id = categories.get(i)->getUUID();
- if (mCategoryMap.find(uu_id) != cat_map_end)
- {
- deleteObject(uu_id);
- }
- }
+ const LLViewerInventoryItem *linked_item = (*iter);
+ const LLUUID &item_id = linked_item->getUUID();
+ if (item_id == baseobj_id) continue;
+ addChangedMask(LLInventoryObserver::REBUILD, item_id);
}
+ gInventory.notifyObservers();
}
}
@@ -1402,7 +1479,7 @@ void LLInventoryModel::notifyObservers()
// Within notifyObservers, something called notifyObservers
// again. This type of recursion is unsafe because it causes items to be
// processed twice, and this can easily lead to infinite loops.
- llwarns << "Call was made to notifyObservers within notifyObservers!" << llendl;
+ LL_WARNS() << "Call was made to notifyObservers within notifyObservers!" << LL_ENDL;
return;
}
@@ -1419,6 +1496,7 @@ void LLInventoryModel::notifyObservers()
mModifyMask = LLInventoryObserver::NONE;
mChangedItemIDs.clear();
+ mAddedItemIDs.clear();
mIsNotifyObservers = FALSE;
}
@@ -1431,34 +1509,58 @@ void LLInventoryModel::addChangedMask(U32 mask, const LLUUID& referent)
// Something marked an item for change within a call to notifyObservers
// (which is in the process of processing the list of items marked for change).
// This means the change may fail to be processed.
- llwarns << "Adding changed mask within notify observers! Change will likely be lost." << llendl;
+ LL_WARNS() << "Adding changed mask within notify observers! Change will likely be lost." << LL_ENDL;
+ LLViewerInventoryItem *item = getItem(referent);
+ if (item)
+ {
+ LL_WARNS() << "Item " << item->getName() << LL_ENDL;
+ }
+ else
+ {
+ LLViewerInventoryCategory *cat = getCategory(referent);
+ if (cat)
+ {
+ LL_WARNS() << "Category " << cat->getName() << LL_ENDL;
+ }
+ }
}
mModifyMask |= mask;
if (referent.notNull())
{
mChangedItemIDs.insert(referent);
- }
+
+ if (mask & LLInventoryObserver::ADD)
+ {
+ mAddedItemIDs.insert(referent);
+ }
- // Update all linked items. Starting with just LABEL because I'm
- // not sure what else might need to be accounted for this.
- if (mModifyMask & LLInventoryObserver::LABEL)
- {
- addChangedMaskForLinks(referent, LLInventoryObserver::LABEL);
+ // Update all linked items. Starting with just LABEL because I'm
+ // not sure what else might need to be accounted for this.
+ if (mask & LLInventoryObserver::LABEL)
+ {
+ addChangedMaskForLinks(referent, LLInventoryObserver::LABEL);
+ }
}
}
// If we get back a normal response, handle it here
-void LLInventoryModel::fetchInventoryResponder::result(const LLSD& content)
-{
+void LLInventoryModel::fetchInventoryResponder::httpSuccess()
+{
+ const LLSD& content = getContent();
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
start_new_inventory_observer();
/*LLUUID agent_id;
agent_id = content["agent_id"].asUUID();
if(agent_id != gAgent.getID())
{
- llwarns << "Got a inventory update for the wrong agent: " << agent_id
- << llendl;
+ LL_WARNS() << "Got a inventory update for the wrong agent: " << agent_id
+ << LL_ENDL;
return;
}*/
item_array_t items;
@@ -1471,8 +1573,8 @@ void LLInventoryModel::fetchInventoryResponder::result(const LLSD& content)
LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem;
titem->unpackMessage(content["items"][i]);
- lldebugs << "LLInventoryModel::messageUpdateCore() item id:"
- << titem->getUUID() << llendl;
+ LL_DEBUGS() << "LLInventoryModel::fetchInventoryResponder item id: "
+ << titem->getUUID() << LL_ENDL;
items.push_back(titem);
// examine update for changes.
LLViewerInventoryItem* itemp = gInventory.getItem(titem->getUUID());
@@ -1509,9 +1611,9 @@ void LLInventoryModel::fetchInventoryResponder::result(const LLSD& content)
}
//If we get back an error (not found, etc...), handle it here
-void LLInventoryModel::fetchInventoryResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+void LLInventoryModel::fetchInventoryResponder::httpFailure()
{
- llwarns << "fetchInventory error [status:" << status << "]: " << content << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
gInventory.notifyObservers();
}
@@ -1519,14 +1621,14 @@ bool LLInventoryModel::fetchDescendentsOf(const LLUUID& folder_id) const
{
if(folder_id.isNull())
{
- llwarns << "Calling fetch descendents on NULL folder id!" << llendl;
+ LL_WARNS() << "Calling fetch descendents on NULL folder id!" << LL_ENDL;
return false;
}
LLViewerInventoryCategory* cat = getCategory(folder_id);
if(!cat)
{
- llwarns << "Asked to fetch descendents of non-existent folder: "
- << folder_id << llendl;
+ LL_WARNS() << "Asked to fetch descendents of non-existent folder: "
+ << folder_id << LL_ENDL;
return false;
}
//S32 known_descendents = 0;
@@ -1534,11 +1636,11 @@ bool LLInventoryModel::fetchDescendentsOf(const LLUUID& folder_id) const
//item_array_t* items = get_ptr_in_map(mParentChildItemTree, folder_id);
//if(categories)
//{
- // known_descendents += categories->count();
+ // known_descendents += categories->size();
//}
//if(items)
//{
- // known_descendents += items->count();
+ // known_descendents += items->size();
//}
return cat->fetch();
}
@@ -1547,12 +1649,12 @@ void LLInventoryModel::cache(
const LLUUID& parent_folder_id,
const LLUUID& agent_id)
{
- lldebugs << "Caching " << parent_folder_id << " for " << agent_id
- << llendl;
+ LL_DEBUGS() << "Caching " << parent_folder_id << " for " << agent_id
+ << LL_ENDL;
LLViewerInventoryCategory* root_cat = getCategory(parent_folder_id);
if(!root_cat) return;
cat_array_t categories;
- categories.put(root_cat);
+ categories.push_back(root_cat);
item_array_t items;
LLCanCache can_cache(this);
@@ -1573,19 +1675,19 @@ void LLInventoryModel::cache(
gzip_filename.append(".gz");
if(gzip_file(inventory_filename, gzip_filename))
{
- lldebugs << "Successfully compressed " << inventory_filename << llendl;
+ LL_DEBUGS() << "Successfully compressed " << inventory_filename << LL_ENDL;
LLFile::remove(inventory_filename);
}
else
{
- llwarns << "Unable to compress " << inventory_filename << llendl;
+ LL_WARNS() << "Unable to compress " << inventory_filename << LL_ENDL;
}
}
void LLInventoryModel::addCategory(LLViewerInventoryCategory* category)
{
- //llinfos << "LLInventoryModel::addCategory()" << llendl;
+ //LL_INFOS() << "LLInventoryModel::addCategory()" << LL_ENDL;
if(category)
{
// We aren't displaying the Meshes folder
@@ -1603,6 +1705,47 @@ void LLInventoryModel::addCategory(LLViewerInventoryCategory* category)
}
}
+bool LLInventoryModel::hasBacklinkInfo(const LLUUID& link_id, const LLUUID& target_id) const
+{
+ std::pair <backlink_mmap_t::const_iterator, backlink_mmap_t::const_iterator> range;
+ range = mBacklinkMMap.equal_range(target_id);
+ for (backlink_mmap_t::const_iterator it = range.first; it != range.second; ++it)
+ {
+ if (it->second == link_id)
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+void LLInventoryModel::addBacklinkInfo(const LLUUID& link_id, const LLUUID& target_id)
+{
+ if (!hasBacklinkInfo(link_id, target_id))
+ {
+ mBacklinkMMap.insert(std::make_pair(target_id, link_id));
+ }
+}
+
+void LLInventoryModel::removeBacklinkInfo(const LLUUID& link_id, const LLUUID& target_id)
+{
+ std::pair <backlink_mmap_t::iterator, backlink_mmap_t::iterator> range;
+ range = mBacklinkMMap.equal_range(target_id);
+ for (backlink_mmap_t::iterator it = range.first; it != range.second; )
+ {
+ if (it->second == link_id)
+ {
+ backlink_mmap_t::iterator delete_it = it; // iterator will be invalidated by erase.
+ ++it;
+ mBacklinkMMap.erase(delete_it);
+ }
+ else
+ {
+ ++it;
+ }
+ }
+}
+
void LLInventoryModel::addItem(LLViewerInventoryItem* item)
{
llassert(item);
@@ -1614,7 +1757,7 @@ void LLInventoryModel::addItem(LLViewerInventoryItem* item)
if ((item->getType() == LLAssetType::AT_NONE)
|| LLAssetType::lookup(item->getType()) == LLAssetType::badLookup())
{
- llwarns << "Got bad asset type for item [ name: " << item->getName() << " type: " << item->getType() << " inv-type: " << item->getInventoryType() << " ], ignoring." << llendl;
+ LL_WARNS() << "Got bad asset type for item [ name: " << item->getName() << " type: " << item->getType() << " inv-type: " << item->getInventoryType() << " ], ignoring." << LL_ENDL;
return;
}
@@ -1622,9 +1765,15 @@ void LLInventoryModel::addItem(LLViewerInventoryItem* item)
// The item will show up as a broken link.
if (item->getIsBrokenLink())
{
- llinfos << "Adding broken link [ name: " << item->getName() << " itemID: " << item->getUUID() << " assetID: " << item->getAssetUUID() << " ) parent: " << item->getParentUUID() << llendl;
+ LL_INFOS() << "Adding broken link [ name: " << item->getName() << " itemID: " << item->getUUID() << " assetID: " << item->getAssetUUID() << " ) parent: " << item->getParentUUID() << LL_ENDL;
+ }
+ if (item->getIsLinkType())
+ {
+ // Add back-link from linked-to UUID.
+ const LLUUID& link_id = item->getUUID();
+ const LLUUID& target_id = item->getLinkedUUID();
+ addBacklinkInfo(link_id, target_id);
}
-
mItemMap[item->getUUID()] = item;
}
}
@@ -1632,7 +1781,7 @@ void LLInventoryModel::addItem(LLViewerInventoryItem* item)
// Empty the entire contents
void LLInventoryModel::empty()
{
-// llinfos << "LLInventoryModel::empty()" << llendl;
+// LL_INFOS() << "LLInventoryModel::empty()" << LL_ENDL;
std::for_each(
mParentChildCategoryTree.begin(),
mParentChildCategoryTree.end(),
@@ -1643,6 +1792,7 @@ void LLInventoryModel::empty()
mParentChildItemTree.end(),
DeletePairedPointer());
mParentChildItemTree.clear();
+ mBacklinkMMap.clear(); // forget all backlink information.
mCategoryMap.clear(); // remove all references (should delete entries)
mItemMap.clear(); // remove all references (should delete entries)
mLastItem = NULL;
@@ -1654,42 +1804,39 @@ void LLInventoryModel::accountForUpdate(const LLCategoryUpdate& update) const
LLViewerInventoryCategory* cat = getCategory(update.mCategoryID);
if(cat)
{
- bool accounted = false;
S32 version = cat->getVersion();
if(version != LLViewerInventoryCategory::VERSION_UNKNOWN)
{
S32 descendents_server = cat->getDescendentCount();
- LLInventoryModel::cat_array_t* cats;
- LLInventoryModel::item_array_t* items;
- getDirectDescendentsOf(update.mCategoryID, cats, items);
- S32 descendents_actual = 0;
- if(cats && items)
- {
- descendents_actual = cats->count() + items->count();
- }
+ S32 descendents_actual = cat->getViewerDescendentCount();
if(descendents_server == descendents_actual)
{
- accounted = true;
descendents_actual += update.mDescendentDelta;
cat->setDescendentCount(descendents_actual);
cat->setVersion(++version);
- lldebugs << "accounted: '" << cat->getName() << "' "
- << version << " with " << descendents_actual
- << " descendents." << llendl;
+ LL_DEBUGS("Inventory") << "accounted: '" << cat->getName() << "' "
+ << version << " with " << descendents_actual
+ << " descendents." << LL_ENDL;
+ }
+ else
+ {
+ // Error condition, this means that the category did not register that
+ // it got new descendents (perhaps because it is still being loaded)
+ // which means its descendent count will be wrong.
+ LL_WARNS() << "Accounting failed for '" << cat->getName() << "' version:"
+ << version << " due to mismatched descendent count: server == "
+ << descendents_server << ", viewer == " << descendents_actual << LL_ENDL;
}
}
- if(!accounted)
+ else
{
- // Error condition, this means that the category did not register that
- // it got new descendents (perhaps because it is still being loaded)
- // which means its descendent count will be wrong.
- llwarns << "Accounting failed for '" << cat->getName() << "' version:"
- << version << llendl;
+ LL_WARNS() << "Accounting failed for '" << cat->getName() << "' version: unknown ("
+ << version << ")" << LL_ENDL;
}
}
else
{
- llwarns << "No category found for update " << update.mCategoryID << llendl;
+ LL_WARNS() << "No category found for update " << update.mCategoryID << LL_ENDL;
}
}
@@ -1718,47 +1865,6 @@ void LLInventoryModel::accountForUpdate(
}
}
-
-/*
-void LLInventoryModel::incrementCategoryVersion(const LLUUID& category_id)
-{
- LLViewerInventoryCategory* cat = getCategory(category_id);
- if(cat)
- {
- S32 version = cat->getVersion();
- if(LLViewerInventoryCategory::VERSION_UNKNOWN != version)
- {
- cat->setVersion(version + 1);
- llinfos << "IncrementVersion: " << cat->getName() << " "
- << cat->getVersion() << llendl;
- }
- else
- {
- llinfos << "Attempt to increment version when unknown: "
- << category_id << llendl;
- }
- }
- else
- {
- llinfos << "Attempt to increment category: " << category_id << llendl;
- }
-}
-void LLInventoryModel::incrementCategorySetVersion(
- const std::set<LLUUID>& categories)
-{
- if(!categories.empty())
- {
- std::set<LLUUID>::const_iterator it = categories.begin();
- std::set<LLUUID>::const_iterator end = categories.end();
- for(; it != end; ++it)
- {
- incrementCategoryVersion(*it);
- }
- }
-}
-*/
-
-
LLInventoryModel::EHasChildren LLInventoryModel::categoryHasChildren(
const LLUUID& cat_id) const
{
@@ -1780,12 +1886,12 @@ LLInventoryModel::EHasChildren LLInventoryModel::categoryHasChildren(
// Shouldn't have to run this, but who knows.
parent_cat_map_t::const_iterator cat_it = mParentChildCategoryTree.find(cat->getUUID());
- if (cat_it != mParentChildCategoryTree.end() && cat_it->second->count() > 0)
+ if (cat_it != mParentChildCategoryTree.end() && cat_it->second->size() > 0)
{
return CHILDREN_YES;
}
parent_item_map_t::const_iterator item_it = mParentChildItemTree.find(cat->getUUID());
- if (item_it != mParentChildItemTree.end() && item_it->second->count() > 0)
+ if (item_it != mParentChildItemTree.end() && item_it->second->size() > 0)
{
return CHILDREN_YES;
}
@@ -1799,14 +1905,7 @@ bool LLInventoryModel::isCategoryComplete(const LLUUID& cat_id) const
if(cat && (cat->getVersion()!=LLViewerInventoryCategory::VERSION_UNKNOWN))
{
S32 descendents_server = cat->getDescendentCount();
- LLInventoryModel::cat_array_t* cats;
- LLInventoryModel::item_array_t* items;
- getDirectDescendentsOf(cat_id, cats, items);
- S32 descendents_actual = 0;
- if(cats && items)
- {
- descendents_actual = cats->count() + items->count();
- }
+ S32 descendents_actual = cat->getViewerDescendentCount();
if(descendents_server == descendents_actual)
{
return true;
@@ -1819,7 +1918,7 @@ bool LLInventoryModel::loadSkeleton(
const LLSD& options,
const LLUUID& owner_id)
{
- lldebugs << "importing inventory skeleton for " << owner_id << llendl;
+ LL_DEBUGS() << "importing inventory skeleton for " << owner_id << LL_ENDL;
typedef std::set<LLPointer<LLViewerInventoryCategory>, InventoryIDPtrLess> cat_set_t;
cat_set_t temp_cats;
@@ -1856,7 +1955,7 @@ bool LLInventoryModel::loadSkeleton(
}
else
{
- llwarns << "Unable to import near " << name.asString() << llendl;
+ LL_WARNS() << "Unable to import near " << name.asString() << LL_ENDL;
rv = false;
}
}
@@ -1893,7 +1992,7 @@ bool LLInventoryModel::loadSkeleton(
}
else
{
- llinfos << "Unable to gunzip " << gzip_filename << llendl;
+ LL_INFOS() << "Unable to gunzip " << gzip_filename << LL_ENDL;
}
}
bool is_cache_obsolete = false;
@@ -1903,7 +2002,7 @@ bool LLInventoryModel::loadSkeleton(
// found to generate a set of categories we should add. We
// will go through each category loaded and if the version
// does not match, invalidate the version.
- S32 count = categories.count();
+ S32 count = categories.size();
cat_set_t::iterator not_cached = temp_cats.end();
std::set<LLUUID> cached_ids;
for(S32 i = 0; i < count; ++i)
@@ -1974,10 +2073,10 @@ bool LLInventoryModel::loadSkeleton(
if (item->getIsBrokenLink())
{
//bad_link_count++;
- lldebugs << "Attempted to add cached link item without baseobj present ( name: "
+ LL_DEBUGS() << "Attempted to add cached link item without baseobj present ( name: "
<< item->getName() << " itemID: " << item->getUUID()
<< " assetID: " << item->getAssetUUID()
- << " ). Ignoring and invalidating " << cat->getName() << " . " << llendl;
+ << " ). Ignoring and invalidating " << cat->getName() << " . " << LL_ENDL;
possible_broken_links.push_back(item);
continue;
}
@@ -2004,7 +2103,7 @@ bool LLInventoryModel::loadSkeleton(
{
bad_link_count++;
invalid_categories.insert(cit->second);
- //llinfos << "link still broken: " << item->getName() << " in folder " << cat->getName() << llendl;
+ //LL_INFOS() << "link still broken: " << item->getName() << " in folder " << cat->getName() << LL_ENDL;
}
else
{
@@ -2016,11 +2115,11 @@ bool LLInventoryModel::loadSkeleton(
}
}
- llinfos << "Attempted to add " << bad_link_count
+ LL_INFOS() << "Attempted to add " << bad_link_count
<< " cached link items without baseobj present. "
<< good_link_count << " link items were successfully added. "
<< recovered_link_count << " links added in recovery. "
- << "The corresponding categories were invalidated." << llendl;
+ << "The corresponding categories were invalidated." << LL_ENDL;
}
}
@@ -2044,9 +2143,9 @@ bool LLInventoryModel::loadSkeleton(
{
LLViewerInventoryCategory* cat = (*invalid_cat_it).get();
cat->setVersion(NO_VERSION);
- LL_DEBUGS("Inventory") << "Invalidating category name: " << cat->getName() << " UUID: " << cat->getUUID() << " due to invalid descendents cache" << llendl;
+ LL_DEBUGS("Inventory") << "Invalidating category name: " << cat->getName() << " UUID: " << cat->getUUID() << " due to invalid descendents cache" << LL_ENDL;
}
- LL_INFOS("Inventory") << "Invalidated " << invalid_categories.size() << " categories due to invalid descendents cache" << llendl;
+ LL_INFOS("Inventory") << "Invalidated " << invalid_categories.size() << " categories due to invalid descendents cache" << LL_ENDL;
// At this point, we need to set the known descendents for each
// category which successfully cached so that we do not
@@ -2078,15 +2177,15 @@ bool LLInventoryModel::loadSkeleton(
if(is_cache_obsolete)
{
// If out of date, remove the gzipped file too.
- llwarns << "Inv cache out of date, removing" << llendl;
+ LL_WARNS() << "Inv cache out of date, removing" << LL_ENDL;
LLFile::remove(gzip_filename);
}
categories.clear(); // will unref and delete entries
}
- llinfos << "Successfully loaded " << cached_category_count
+ LL_INFOS() << "Successfully loaded " << cached_category_count
<< " categories and " << cached_item_count << " items from cache."
- << llendl;
+ << LL_ENDL;
return rv;
}
@@ -2096,7 +2195,7 @@ bool LLInventoryModel::loadSkeleton(
// should be sufficient for our needs.
void LLInventoryModel::buildParentChildMap()
{
- llinfos << "LLInventoryModel::buildParentChildMap()" << llendl;
+ LL_INFOS() << "LLInventoryModel::buildParentChildMap()" << LL_ENDL;
// *NOTE: I am skipping the logic around folder version
// synchronization here because it seems if a folder is lost, we
@@ -2113,7 +2212,7 @@ void LLInventoryModel::buildParentChildMap()
for(cat_map_t::iterator cit = mCategoryMap.begin(); cit != mCategoryMap.end(); ++cit)
{
LLViewerInventoryCategory* cat = cit->second;
- cats.put(cat);
+ cats.push_back(cat);
if (mParentChildCategoryTree.count(cat->getUUID()) == 0)
{
llassert_always(mCategoryLock[cat->getUUID()] == false);
@@ -2141,16 +2240,21 @@ void LLInventoryModel::buildParentChildMap()
// Now we have a structure with all of the categories that we can
// iterate over and insert into the correct place in the child
// category tree.
- S32 count = cats.count();
+ S32 count = cats.size();
S32 i;
S32 lost = 0;
+ cat_array_t lost_cats;
for(i = 0; i < count; ++i)
{
- LLViewerInventoryCategory* cat = cats.get(i);
+ LLViewerInventoryCategory* cat = cats.at(i);
catsp = getUnlockedCatArray(cat->getParentUUID());
- if(catsp)
+ if(catsp &&
+ // Only the two root folders should be children of null.
+ // Others should go to lost & found.
+ (cat->getParentUUID().notNull() ||
+ cat->getPreferredType() == LLFolderType::FT_ROOT_INVENTORY ))
{
- catsp->put(cat);
+ catsp->push_back(cat);
}
else
{
@@ -2160,40 +2264,51 @@ void LLInventoryModel::buildParentChildMap()
// implement it, we would need a set or map of uuid pairs
// which would be (folder_id, new_parent_id) to be sent up
// to the server.
- llinfos << "Lost categroy: " << cat->getUUID() << " - "
- << cat->getName() << llendl;
+ LL_INFOS() << "Lost category: " << cat->getUUID() << " - "
+ << cat->getName() << LL_ENDL;
++lost;
- // plop it into the lost & found.
- LLFolderType::EType pref = cat->getPreferredType();
- if(LLFolderType::FT_NONE == pref)
- {
- cat->setParent(findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND));
- }
- else if(LLFolderType::FT_ROOT_INVENTORY == pref)
- {
- // it's the root
- cat->setParent(LLUUID::null);
- }
- else
- {
- // it's a protected folder.
- cat->setParent(gInventory.getRootFolderID());
- }
- cat->updateServer(TRUE);
- catsp = getUnlockedCatArray(cat->getParentUUID());
- if(catsp)
- {
- catsp->put(cat);
- }
- else
- {
- llwarns << "Lost and found Not there!!" << llendl;
- }
+ lost_cats.push_back(cat);
}
}
if(lost)
{
- llwarns << "Found " << lost << " lost categories." << llendl;
+ LL_WARNS() << "Found " << lost << " lost categories." << LL_ENDL;
+ }
+
+ // Do moves in a separate pass to make sure we've properly filed
+ // the FT_LOST_AND_FOUND category before we try to find its UUID.
+ for(i = 0; i<lost_cats.size(); ++i)
+ {
+ LLViewerInventoryCategory *cat = lost_cats.at(i);
+
+ // plop it into the lost & found.
+ LLFolderType::EType pref = cat->getPreferredType();
+ if(LLFolderType::FT_NONE == pref)
+ {
+ cat->setParent(findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND));
+ }
+ else if(LLFolderType::FT_ROOT_INVENTORY == pref)
+ {
+ // it's the root
+ cat->setParent(LLUUID::null);
+ }
+ else
+ {
+ // it's a protected folder.
+ cat->setParent(gInventory.getRootFolderID());
+ }
+ // FIXME note that updateServer() fails with protected
+ // types, so this will not work as intended in that case.
+ cat->updateServer(TRUE);
+ catsp = getUnlockedCatArray(cat->getParentUUID());
+ if(catsp)
+ {
+ catsp->push_back(cat);
+ }
+ else
+ {
+ LL_WARNS() << "Lost and found Not there!!" << LL_ENDL;
+ }
}
const BOOL COF_exists = (findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, FALSE) != LLUUID::null);
@@ -2210,25 +2325,25 @@ void LLInventoryModel::buildParentChildMap()
for(item_map_t::iterator iit = mItemMap.begin(); iit != mItemMap.end(); ++iit)
{
item = (*iit).second;
- items.put(item);
+ items.push_back(item);
}
}
- count = items.count();
+ count = items.size();
lost = 0;
uuid_vec_t lost_item_ids;
for(i = 0; i < count; ++i)
{
LLPointer<LLViewerInventoryItem> item;
- item = items.get(i);
+ item = items.at(i);
itemsp = getUnlockedItemArray(item->getParentUUID());
if(itemsp)
{
- itemsp->put(item);
+ itemsp->push_back(item);
}
else
{
- llinfos << "Lost item: " << item->getUUID() << " - "
- << item->getName() << llendl;
+ LL_INFOS() << "Lost item: " << item->getUUID() << " - "
+ << item->getName() << LL_ENDL;
++lost;
// plop it into the lost & found.
//
@@ -2240,17 +2355,17 @@ void LLInventoryModel::buildParentChildMap()
itemsp = getUnlockedItemArray(item->getParentUUID());
if(itemsp)
{
- itemsp->put(item);
+ itemsp->push_back(item);
}
else
{
- llwarns << "Lost and found Not there!!" << llendl;
+ LL_WARNS() << "Lost and found Not there!!" << LL_ENDL;
}
}
}
if(lost)
{
- llwarns << "Found " << lost << " lost items." << llendl;
+ LL_WARNS() << "Found " << lost << " lost items." << LL_ENDL;
LLMessageSystem* msg = gMessageSystem;
BOOL start_new_message = TRUE;
const LLUUID lnf = findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND);
@@ -2319,11 +2434,25 @@ void LLInventoryModel::buildParentChildMap()
// The inv tree is built.
mIsAgentInvUsable = true;
- llinfos << "Inventory initialized, notifying observers" << llendl;
- addChangedMask(LLInventoryObserver::ALL, LLUUID::null);
- notifyObservers();
+ // notifyObservers() has been moved to
+ // llstartup/idle_startup() after this func completes.
+ // Allows some system categories to be created before
+ // observers start firing.
}
}
+
+ if (!gInventory.validate())
+ {
+ LL_WARNS() << "model failed validity check!" << LL_ENDL;
+ }
+}
+
+void LLInventoryModel::createCommonSystemCategories()
+{
+ gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH,true);
+ gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE,true);
+ gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD,true);
+ gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS,true);
}
struct LLUUIDAndName
@@ -2366,14 +2495,14 @@ bool LLInventoryModel::loadFromFile(const std::string& filename,
{
if(filename.empty())
{
- llerrs << "Filename is Null!" << llendl;
+ LL_ERRS() << "Filename is Null!" << LL_ENDL;
return false;
}
- llinfos << "LLInventoryModel::loadFromFile(" << filename << ")" << llendl;
+ LL_INFOS() << "LLInventoryModel::loadFromFile(" << filename << ")" << LL_ENDL;
LLFILE* file = LLFile::fopen(filename, "rb"); /*Flawfinder: ignore*/
if(!file)
{
- llinfos << "unable to load inventory from: " << filename << llendl;
+ LL_INFOS() << "unable to load inventory from: " << filename << LL_ENDL;
return false;
}
// *NOTE: This buffer size is hard coded into scanf() below.
@@ -2408,11 +2537,11 @@ bool LLInventoryModel::loadFromFile(const std::string& filename,
LLPointer<LLViewerInventoryCategory> inv_cat = new LLViewerInventoryCategory(LLUUID::null);
if(inv_cat->importFileLocal(file))
{
- categories.put(inv_cat);
+ categories.push_back(inv_cat);
}
else
{
- llwarns << "loadInventoryFromFile(). Ignoring invalid inventory category: " << inv_cat->getName() << llendl;
+ LL_WARNS() << "loadInventoryFromFile(). Ignoring invalid inventory category: " << inv_cat->getName() << LL_ENDL;
//delete inv_cat; // automatic when inv_cat is reassigned or destroyed
}
}
@@ -2430,25 +2559,25 @@ bool LLInventoryModel::loadFromFile(const std::string& filename,
if(inv_item->getUUID().isNull())
{
//delete inv_item; // automatic when inv_cat is reassigned or destroyed
- llwarns << "Ignoring inventory with null item id: "
- << inv_item->getName() << llendl;
+ LL_WARNS() << "Ignoring inventory with null item id: "
+ << inv_item->getName() << LL_ENDL;
}
else
{
- items.put(inv_item);
+ items.push_back(inv_item);
}
}
else
{
- llwarns << "loadInventoryFromFile(). Ignoring invalid inventory item: " << inv_item->getName() << llendl;
+ LL_WARNS() << "loadInventoryFromFile(). Ignoring invalid inventory item: " << inv_item->getName() << LL_ENDL;
//delete inv_item; // automatic when inv_cat is reassigned or destroyed
}
}
else
{
- llwarns << "Unknown token in inventory file '" << keyword << "'"
- << llendl;
+ LL_WARNS() << "Unknown token in inventory file '" << keyword << "'"
+ << LL_ENDL;
}
}
fclose(file);
@@ -2464,19 +2593,19 @@ bool LLInventoryModel::saveToFile(const std::string& filename,
{
if(filename.empty())
{
- llerrs << "Filename is Null!" << llendl;
+ LL_ERRS() << "Filename is Null!" << LL_ENDL;
return false;
}
- llinfos << "LLInventoryModel::saveToFile(" << filename << ")" << llendl;
+ LL_INFOS() << "LLInventoryModel::saveToFile(" << filename << ")" << LL_ENDL;
LLFILE* file = LLFile::fopen(filename, "wb"); /*Flawfinder: ignore*/
if(!file)
{
- llwarns << "unable to save inventory to: " << filename << llendl;
+ LL_WARNS() << "unable to save inventory to: " << filename << LL_ENDL;
return false;
}
fprintf(file, "\tinv_cache_version\t%d\n",sCurrentInvCacheVersion);
- S32 count = categories.count();
+ S32 count = categories.size();
S32 i;
for(i = 0; i < count; ++i)
{
@@ -2487,7 +2616,7 @@ bool LLInventoryModel::saveToFile(const std::string& filename,
}
}
- count = items.count();
+ count = items.size();
for(i = 0; i < count; ++i)
{
items[i]->exportFile(file);
@@ -2547,7 +2676,7 @@ void LLInventoryModel::registerCallbacks(LLMessageSystem* msg)
void LLInventoryModel::processUpdateCreateInventoryItem(LLMessageSystem* msg, void**)
{
// do accounting and highlight new items if they arrive
- if (gInventory.messageUpdateCore(msg, true))
+ if (gInventory.messageUpdateCore(msg, true, LLInventoryObserver::UPDATE_CREATE))
{
U32 callback_id;
LLUUID item_id;
@@ -2567,7 +2696,7 @@ void LLInventoryModel::processFetchInventoryReply(LLMessageSystem* msg, void**)
}
-bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account)
+bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account, U32 mask)
{
//make sure our added inventory observer is active
start_new_inventory_observer();
@@ -2576,8 +2705,8 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account)
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id);
if(agent_id != gAgent.getID())
{
- llwarns << "Got a inventory update for the wrong agent: " << agent_id
- << llendl;
+ LL_WARNS() << "Got a inventory update for the wrong agent: " << agent_id
+ << LL_ENDL;
return false;
}
item_array_t items;
@@ -2589,8 +2718,8 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account)
{
LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem;
titem->unpackMessage(msg, _PREHASH_InventoryData, i);
- lldebugs << "LLInventoryModel::messageUpdateCore() item id:"
- << titem->getUUID() << llendl;
+ LL_DEBUGS() << "LLInventoryModel::messageUpdateCore() item id:"
+ << titem->getUUID() << LL_ENDL;
items.push_back(titem);
// examine update for changes.
LLViewerInventoryItem* itemp = gInventory.getItem(titem->getUUID());
@@ -2621,10 +2750,14 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account)
}
U32 changes = 0x0;
+ if (account)
+ {
+ mask |= LLInventoryObserver::CREATE;
+ }
//as above, this loop never seems to loop more than once per call
for (item_array_t::iterator it = items.begin(); it != items.end(); ++it)
{
- changes |= gInventory.updateItem(*it);
+ changes |= gInventory.updateItem(*it, mask);
}
gInventory.notifyObservers();
gViewerWindow->getWindow()->decBusyCount();
@@ -2637,17 +2770,17 @@ void LLInventoryModel::removeInventoryItem(LLUUID agent_id, LLMessageSystem* msg
{
LLUUID item_id;
S32 count = msg->getNumberOfBlocksFast(msg_label);
- lldebugs << "Message has " << count << " item blocks" << llendl;
+ LL_DEBUGS() << "Message has " << count << " item blocks" << LL_ENDL;
uuid_vec_t item_ids;
update_map_t update;
for(S32 i = 0; i < count; ++i)
{
msg->getUUIDFast(msg_label, _PREHASH_ItemID, item_id, i);
- lldebugs << "Checking for item-to-be-removed " << item_id << llendl;
+ LL_DEBUGS() << "Checking for item-to-be-removed " << item_id << LL_ENDL;
LLViewerInventoryItem* itemp = gInventory.getItem(item_id);
if(itemp)
{
- lldebugs << "Item will be removed " << item_id << llendl;
+ LL_DEBUGS() << "Item will be removed " << item_id << LL_ENDL;
// we only bother with the delete and account if we found
// the item - this is usually a back-up for permissions,
// so frequently the item will already be gone.
@@ -2658,7 +2791,7 @@ void LLInventoryModel::removeInventoryItem(LLUUID agent_id, LLMessageSystem* msg
gInventory.accountForUpdate(update);
for(uuid_vec_t::iterator it = item_ids.begin(); it != item_ids.end(); ++it)
{
- lldebugs << "Calling deleteObject " << *it << llendl;
+ LL_DEBUGS() << "Calling deleteObject " << *it << LL_ENDL;
gInventory.deleteObject(*it);
}
}
@@ -2666,13 +2799,13 @@ void LLInventoryModel::removeInventoryItem(LLUUID agent_id, LLMessageSystem* msg
// static
void LLInventoryModel::processRemoveInventoryItem(LLMessageSystem* msg, void**)
{
- lldebugs << "LLInventoryModel::processRemoveInventoryItem()" << llendl;
+ LL_DEBUGS() << "LLInventoryModel::processRemoveInventoryItem()" << LL_ENDL;
LLUUID agent_id, item_id;
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id);
if(agent_id != gAgent.getID())
{
- llwarns << "Got a RemoveInventoryItem for the wrong agent."
- << llendl;
+ LL_WARNS() << "Got a RemoveInventoryItem for the wrong agent."
+ << LL_ENDL;
return;
}
LLInventoryModel::removeInventoryItem(agent_id, msg, _PREHASH_InventoryData);
@@ -2683,14 +2816,14 @@ void LLInventoryModel::processRemoveInventoryItem(LLMessageSystem* msg, void**)
void LLInventoryModel::processUpdateInventoryFolder(LLMessageSystem* msg,
void**)
{
- lldebugs << "LLInventoryModel::processUpdateInventoryFolder()" << llendl;
+ LL_DEBUGS() << "LLInventoryModel::processUpdateInventoryFolder()" << LL_ENDL;
LLUUID agent_id, folder_id, parent_id;
//char name[DB_INV_ITEM_NAME_BUF_SIZE];
msg->getUUIDFast(_PREHASH_FolderData, _PREHASH_AgentID, agent_id);
if(agent_id != gAgent.getID())
{
- llwarns << "Got an UpdateInventoryFolder for the wrong agent."
- << llendl;
+ LL_WARNS() << "Got an UpdateInventoryFolder for the wrong agent."
+ << LL_ENDL;
return;
}
LLPointer<LLViewerInventoryCategory> lastfolder; // hack
@@ -2768,14 +2901,14 @@ void LLInventoryModel::removeInventoryFolder(LLUUID agent_id,
void LLInventoryModel::processRemoveInventoryFolder(LLMessageSystem* msg,
void**)
{
- lldebugs << "LLInventoryModel::processRemoveInventoryFolder()" << llendl;
+ LL_DEBUGS() << "LLInventoryModel::processRemoveInventoryFolder()" << LL_ENDL;
LLUUID agent_id, session_id;
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id);
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_SessionID, session_id);
if(agent_id != gAgent.getID())
{
- llwarns << "Got a RemoveInventoryFolder for the wrong agent."
- << llendl;
+ LL_WARNS() << "Got a RemoveInventoryFolder for the wrong agent."
+ << LL_ENDL;
return;
}
LLInventoryModel::removeInventoryFolder( agent_id, msg );
@@ -2786,14 +2919,14 @@ void LLInventoryModel::processRemoveInventoryFolder(LLMessageSystem* msg,
void LLInventoryModel::processRemoveInventoryObjects(LLMessageSystem* msg,
void**)
{
- lldebugs << "LLInventoryModel::processRemoveInventoryObjects()" << llendl;
+ LL_DEBUGS() << "LLInventoryModel::processRemoveInventoryObjects()" << LL_ENDL;
LLUUID agent_id, session_id;
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id);
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_SessionID, session_id);
if(agent_id != gAgent.getID())
{
- llwarns << "Got a RemoveInventoryObjects for the wrong agent."
- << llendl;
+ LL_WARNS() << "Got a RemoveInventoryObjects for the wrong agent."
+ << LL_ENDL;
return;
}
LLInventoryModel::removeInventoryFolder( agent_id, msg );
@@ -2809,8 +2942,8 @@ void LLInventoryModel::processSaveAssetIntoInventory(LLMessageSystem* msg,
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id);
if(agent_id != gAgent.getID())
{
- llwarns << "Got a SaveAssetIntoInventory message for the wrong agent."
- << llendl;
+ LL_WARNS() << "Got a SaveAssetIntoInventory message for the wrong agent."
+ << LL_ENDL;
return;
}
@@ -2820,8 +2953,8 @@ void LLInventoryModel::processSaveAssetIntoInventory(LLMessageSystem* msg,
// The viewer ignores the asset id because this message is only
// used for attachments/objects, so the asset id is not used in
// the viewer anyway.
- lldebugs << "LLInventoryModel::processSaveAssetIntoInventory itemID="
- << item_id << llendl;
+ LL_DEBUGS() << "LLInventoryModel::processSaveAssetIntoInventory itemID="
+ << item_id << LL_ENDL;
LLViewerInventoryItem* item = gInventory.getItem( item_id );
if( item )
{
@@ -2832,8 +2965,8 @@ void LLInventoryModel::processSaveAssetIntoInventory(LLMessageSystem* msg,
}
else
{
- llinfos << "LLInventoryModel::processSaveAssetIntoInventory item"
- " not found: " << item_id << llendl;
+ LL_INFOS() << "LLInventoryModel::processSaveAssetIntoInventory item"
+ " not found: " << item_id << LL_ENDL;
}
if(gViewerWindow)
{
@@ -2856,13 +2989,13 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**)
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id);
if(agent_id != gAgent.getID())
{
- llwarns << "Got a BulkUpdateInventory for the wrong agent." << llendl;
+ LL_WARNS() << "Got a BulkUpdateInventory for the wrong agent." << LL_ENDL;
return;
}
LLUUID tid;
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_TransactionID, tid);
#ifndef LL_RELEASE_FOR_DOWNLOAD
- llinfos << "Bulk inventory: " << tid << llendl;
+ LL_DEBUGS("Inventory") << "Bulk inventory: " << tid << LL_ENDL;
#endif
update_map_t update;
@@ -2874,9 +3007,9 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**)
{
LLPointer<LLViewerInventoryCategory> tfolder = new LLViewerInventoryCategory(gAgent.getID());
tfolder->unpackMessage(msg, _PREHASH_FolderData, i);
- llinfos << "unpacked folder '" << tfolder->getName() << "' ("
- << tfolder->getUUID() << ") in " << tfolder->getParentUUID()
- << llendl;
+ LL_DEBUGS("Inventory") << "unpacked folder '" << tfolder->getName() << "' ("
+ << tfolder->getUUID() << ") in " << tfolder->getParentUUID()
+ << LL_ENDL;
if(tfolder->getUUID().notNull())
{
folders.push_back(tfolder);
@@ -2916,8 +3049,8 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**)
{
LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem;
titem->unpackMessage(msg, _PREHASH_ItemData, i);
- llinfos << "unpacked item '" << titem->getName() << "' in "
- << titem->getParentUUID() << llendl;
+ LL_DEBUGS("Inventory") << "unpacked item '" << titem->getName() << "' in "
+ << titem->getParentUUID() << LL_ENDL;
U32 callback_id;
msg->getU32Fast(_PREHASH_ItemData, _PREHASH_CallbackID, callback_id);
if(titem->getUUID().notNull() ) // && callback_id.notNull() )
@@ -2994,6 +3127,9 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**)
InventoryCallbackInfo cbinfo = (*inv_it);
gInventoryCallbacks.fire(cbinfo.mCallback, cbinfo.mInvID);
}
+
+ //gInventory.validate();
+
// Don't show the inventory. We used to call showAgentInventory here.
//LLFloaterInventory* view = LLFloaterInventory::getActiveInventory();
//if(view)
@@ -3023,7 +3159,7 @@ void LLInventoryModel::processInventoryDescendents(LLMessageSystem* msg,void**)
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id);
if(agent_id != gAgent.getID())
{
- llwarns << "Got a UpdateInventoryItem for the wrong agent." << llendl;
+ LL_WARNS() << "Got a UpdateInventoryItem for the wrong agent." << LL_ENDL;
return;
}
LLUUID parent_id;
@@ -3052,7 +3188,8 @@ void LLInventoryModel::processInventoryDescendents(LLMessageSystem* msg,void**)
// If the item has already been added (e.g. from link prefetch), then it doesn't need to be re-added.
if (gInventory.getItem(titem->getUUID()))
{
- lldebugs << "Skipping prefetched item [ Name: " << titem->getName() << " | Type: " << titem->getActualType() << " | ItemUUID: " << titem->getUUID() << " ] " << llendl;
+ LL_DEBUGS("Inventory") << "Skipping prefetched item [ Name: " << titem->getName()
+ << " | Type: " << titem->getActualType() << " | ItemUUID: " << titem->getUUID() << " ] " << LL_ENDL;
continue;
}
gInventory.updateItem(titem);
@@ -3074,13 +3211,13 @@ void LLInventoryModel::processInventoryDescendents(LLMessageSystem* msg,void**)
// static
void LLInventoryModel::processMoveInventoryItem(LLMessageSystem* msg, void**)
{
- lldebugs << "LLInventoryModel::processMoveInventoryItem()" << llendl;
+ LL_DEBUGS() << "LLInventoryModel::processMoveInventoryItem()" << LL_ENDL;
LLUUID agent_id;
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id);
if(agent_id != gAgent.getID())
{
- llwarns << "Got a MoveInventoryItem message for the wrong agent."
- << llendl;
+ LL_WARNS() << "Got a MoveInventoryItem message for the wrong agent."
+ << LL_ENDL;
return;
}
@@ -3099,8 +3236,8 @@ void LLInventoryModel::processMoveInventoryItem(LLMessageSystem* msg, void**)
msg->getUUIDFast(_PREHASH_InventoryData, _PREHASH_FolderID, folder_id, i);
msg->getString("InventoryData", "NewName", new_name, i);
- lldebugs << "moving item " << item_id << " to folder "
- << folder_id << llendl;
+ LL_DEBUGS() << "moving item " << item_id << " to folder "
+ << folder_id << LL_ENDL;
update_list_t update;
LLCategoryUpdate old_folder(item->getParentUUID(), -1);
update.push_back(old_folder);
@@ -3118,7 +3255,7 @@ void LLInventoryModel::processMoveInventoryItem(LLMessageSystem* msg, void**)
}
else
{
- llinfos << "LLInventoryModel::processMoveInventoryItem item not found: " << item_id << llendl;
+ LL_INFOS() << "LLInventoryModel::processMoveInventoryItem item not found: " << item_id << LL_ENDL;
}
}
if(anything_changed)
@@ -3138,8 +3275,7 @@ bool LLInventoryModel::callbackEmptyFolderType(const LLSD& notification, const L
if (option == 0) // YES
{
const LLUUID folder_id = findCategoryUUIDForType(preferred_type);
- purgeDescendentsOf(folder_id);
- notifyObservers();
+ purge_descendents_of(folder_id, NULL);
}
return false;
}
@@ -3154,8 +3290,7 @@ void LLInventoryModel::emptyFolderType(const std::string notification, LLFolderT
else
{
const LLUUID folder_id = findCategoryUUIDForType(preferred_type);
- purgeDescendentsOf(folder_id);
- notifyObservers();
+ purge_descendents_of(folder_id, NULL);
}
}
@@ -3274,7 +3409,7 @@ BOOL LLInventoryModel::getIsFirstTimeInViewer2()
// Do not call this before parentchild map is built.
if (!gInventory.mIsAgentInvUsable)
{
- llwarns << "Parent Child Map not yet built; guessing as first time in viewer2." << llendl;
+ LL_WARNS() << "Parent Child Map not yet built; guessing as first time in viewer2." << LL_ENDL;
return TRUE;
}
@@ -3409,37 +3544,336 @@ void LLInventoryModel::rearrangeFavoriteLandmarks(const LLUUID& source_item_id,
// *NOTE: DEBUG functionality
void LLInventoryModel::dumpInventory() const
{
- llinfos << "\nBegin Inventory Dump\n**********************:" << llendl;
- llinfos << "mCategory[] contains " << mCategoryMap.size() << " items." << llendl;
+ LL_INFOS() << "\nBegin Inventory Dump\n**********************:" << LL_ENDL;
+ LL_INFOS() << "mCategory[] contains " << mCategoryMap.size() << " items." << LL_ENDL;
for(cat_map_t::const_iterator cit = mCategoryMap.begin(); cit != mCategoryMap.end(); ++cit)
{
const LLViewerInventoryCategory* cat = cit->second;
if(cat)
{
- llinfos << " " << cat->getUUID() << " '" << cat->getName() << "' "
+ LL_INFOS() << " " << cat->getUUID() << " '" << cat->getName() << "' "
<< cat->getVersion() << " " << cat->getDescendentCount()
- << llendl;
+ << LL_ENDL;
}
else
{
- llinfos << " NULL!" << llendl;
+ LL_INFOS() << " NULL!" << LL_ENDL;
}
}
- llinfos << "mItemMap[] contains " << mItemMap.size() << " items." << llendl;
+ LL_INFOS() << "mItemMap[] contains " << mItemMap.size() << " items." << LL_ENDL;
for(item_map_t::const_iterator iit = mItemMap.begin(); iit != mItemMap.end(); ++iit)
{
const LLViewerInventoryItem* item = iit->second;
if(item)
{
- llinfos << " " << item->getUUID() << " "
- << item->getName() << llendl;
+ LL_INFOS() << " " << item->getUUID() << " "
+ << item->getName() << LL_ENDL;
}
else
{
- llinfos << " NULL!" << llendl;
+ LL_INFOS() << " NULL!" << LL_ENDL;
}
}
- llinfos << "\n**********************\nEnd Inventory Dump" << llendl;
+ LL_INFOS() << "\n**********************\nEnd Inventory Dump" << LL_ENDL;
+}
+
+// Do various integrity checks on model, logging issues found and
+// returning an overall good/bad flag.
+bool LLInventoryModel::validate() const
+{
+ bool valid = true;
+
+ if (getRootFolderID().isNull())
+ {
+ LL_WARNS() << "no root folder id" << LL_ENDL;
+ valid = false;
+ }
+ if (getLibraryRootFolderID().isNull())
+ {
+ LL_WARNS() << "no root folder id" << LL_ENDL;
+ valid = false;
+ }
+
+ if (mCategoryMap.size() + 1 != mParentChildCategoryTree.size())
+ {
+ // ParentChild should be one larger because of the special entry for null uuid.
+ LL_INFOS() << "unexpected sizes: cat map size " << mCategoryMap.size()
+ << " parent/child " << mParentChildCategoryTree.size() << LL_ENDL;
+ valid = false;
+ }
+ S32 cat_lock = 0;
+ S32 item_lock = 0;
+ S32 desc_unknown_count = 0;
+ S32 version_unknown_count = 0;
+ for(cat_map_t::const_iterator cit = mCategoryMap.begin(); cit != mCategoryMap.end(); ++cit)
+ {
+ const LLUUID& cat_id = cit->first;
+ const LLViewerInventoryCategory *cat = cit->second;
+ if (!cat)
+ {
+ LL_WARNS() << "invalid cat" << LL_ENDL;
+ valid = false;
+ continue;
+ }
+ if (cat_id != cat->getUUID())
+ {
+ LL_WARNS() << "cat id/index mismatch " << cat_id << " " << cat->getUUID() << LL_ENDL;
+ valid = false;
+ }
+
+ if (cat->getParentUUID().isNull())
+ {
+ if (cat_id != getRootFolderID() && cat_id != getLibraryRootFolderID())
+ {
+ LL_WARNS() << "cat " << cat_id << " has no parent, but is not root ("
+ << getRootFolderID() << ") or library root ("
+ << getLibraryRootFolderID() << ")" << LL_ENDL;
+ }
+ }
+ cat_array_t* cats;
+ item_array_t* items;
+ getDirectDescendentsOf(cat_id,cats,items);
+ if (!cats || !items)
+ {
+ LL_WARNS() << "invalid direct descendents for " << cat_id << LL_ENDL;
+ valid = false;
+ continue;
+ }
+ if (cat->getDescendentCount() == LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN)
+ {
+ desc_unknown_count++;
+ }
+ else if (cats->size() + items->size() != cat->getDescendentCount())
+ {
+ LL_WARNS() << "invalid desc count for " << cat_id << " name [" << cat->getName()
+ << "] parent " << cat->getParentUUID()
+ << " cached " << cat->getDescendentCount()
+ << " expected " << cats->size() << "+" << items->size()
+ << "=" << cats->size() +items->size() << LL_ENDL;
+ valid = false;
+ }
+ if (cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN)
+ {
+ version_unknown_count++;
+ }
+ if (mCategoryLock.count(cat_id))
+ {
+ cat_lock++;
+ }
+ if (mItemLock.count(cat_id))
+ {
+ item_lock++;
+ }
+ for (S32 i = 0; i<items->size(); i++)
+ {
+ LLViewerInventoryItem *item = items->at(i);
+
+ if (!item)
+ {
+ LL_WARNS() << "null item at index " << i << " for cat " << cat_id << LL_ENDL;
+ valid = false;
+ continue;
+ }
+
+ const LLUUID& item_id = item->getUUID();
+
+ if (item->getParentUUID() != cat_id)
+ {
+ LL_WARNS() << "wrong parent for " << item_id << " found "
+ << item->getParentUUID() << " expected " << cat_id
+ << LL_ENDL;
+ valid = false;
+ }
+
+
+ // Entries in items and mItemMap should correspond.
+ item_map_t::const_iterator it = mItemMap.find(item_id);
+ if (it == mItemMap.end())
+ {
+ LL_WARNS() << "item " << item_id << " found as child of "
+ << cat_id << " but not in top level mItemMap" << LL_ENDL;
+ valid = false;
+ }
+ else
+ {
+ LLViewerInventoryItem *top_item = it->second;
+ if (top_item != item)
+ {
+ LL_WARNS() << "item mismatch, item_id " << item_id
+ << " top level entry is different, uuid " << top_item->getUUID() << LL_ENDL;
+ }
+ }
+
+ // Topmost ancestor should be root or library.
+ LLUUID topmost_ancestor_id;
+ bool found = getObjectTopmostAncestor(item_id, topmost_ancestor_id);
+ if (!found)
+ {
+ LL_WARNS() << "unable to find topmost ancestor for " << item_id << LL_ENDL;
+ valid = false;
+ }
+ else
+ {
+ if (topmost_ancestor_id != getRootFolderID() &&
+ topmost_ancestor_id != getLibraryRootFolderID())
+ {
+ LL_WARNS() << "unrecognized top level ancestor for " << item_id
+ << " got " << topmost_ancestor_id
+ << " expected " << getRootFolderID()
+ << " or " << getLibraryRootFolderID() << LL_ENDL;
+ valid = false;
+ }
+ }
+ }
+
+ // Does this category appear as a child of its supposed parent?
+ const LLUUID& parent_id = cat->getParentUUID();
+ if (!parent_id.isNull())
+ {
+ cat_array_t* cats;
+ item_array_t* items;
+ getDirectDescendentsOf(parent_id,cats,items);
+ if (!cats)
+ {
+ LL_WARNS() << "cat " << cat_id << " name [" << cat->getName()
+ << "] orphaned - no child cat array for alleged parent " << parent_id << LL_ENDL;
+ valid = false;
+ }
+ else
+ {
+ bool found = false;
+ for (S32 i = 0; i<cats->size(); i++)
+ {
+ LLViewerInventoryCategory *kid_cat = cats->at(i);
+ if (kid_cat == cat)
+ {
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ {
+ LL_WARNS() << "cat " << cat_id << " name [" << cat->getName()
+ << "] orphaned - not found in child cat array of alleged parent " << parent_id << LL_ENDL;
+ }
+ }
+ }
+ }
+
+ for(item_map_t::const_iterator iit = mItemMap.begin(); iit != mItemMap.end(); ++iit)
+ {
+ const LLUUID& item_id = iit->first;
+ LLViewerInventoryItem *item = iit->second;
+ if (item->getUUID() != item_id)
+ {
+ LL_WARNS() << "item_id " << item_id << " does not match " << item->getUUID() << LL_ENDL;
+ valid = false;
+ }
+
+ const LLUUID& parent_id = item->getParentUUID();
+ if (parent_id.isNull())
+ {
+ LL_WARNS() << "item " << item_id << " name [" << item->getName() << "] has null parent id!" << LL_ENDL;
+ }
+ else
+ {
+ cat_array_t* cats;
+ item_array_t* items;
+ getDirectDescendentsOf(parent_id,cats,items);
+ if (!items)
+ {
+ LL_WARNS() << "item " << item_id << " name [" << item->getName()
+ << "] orphaned - alleged parent has no child items list " << parent_id << LL_ENDL;
+ }
+ else
+ {
+ bool found = false;
+ for (S32 i=0; i<items->size(); ++i)
+ {
+ if (items->at(i) == item)
+ {
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ {
+ LL_WARNS() << "item " << item_id << " name [" << item->getName()
+ << "] orphaned - not found as child of alleged parent " << parent_id << LL_ENDL;
+ }
+ }
+
+ }
+ // Link checking
+ if (item->getIsLinkType())
+ {
+ const LLUUID& link_id = item->getUUID();
+ const LLUUID& target_id = item->getLinkedUUID();
+ LLViewerInventoryItem *target_item = getItem(target_id);
+ LLViewerInventoryCategory *target_cat = getCategory(target_id);
+ // Linked-to UUID should have back reference to this link.
+ if (!hasBacklinkInfo(link_id, target_id))
+ {
+ LL_WARNS() << "link " << item->getUUID() << " type " << item->getActualType()
+ << " missing backlink info at target_id " << target_id
+ << LL_ENDL;
+ }
+ // Links should have referents.
+ if (item->getActualType() == LLAssetType::AT_LINK && !target_item)
+ {
+ LL_WARNS() << "broken item link " << item->getName() << " id " << item->getUUID() << LL_ENDL;
+ }
+ else if (item->getActualType() == LLAssetType::AT_LINK_FOLDER && !target_cat)
+ {
+ LL_WARNS() << "broken folder link " << item->getName() << " id " << item->getUUID() << LL_ENDL;
+ }
+ if (target_item && target_item->getIsLinkType())
+ {
+ LL_WARNS() << "link " << item->getName() << " references a link item "
+ << target_item->getName() << " " << target_item->getUUID() << LL_ENDL;
+ }
+
+ // Links should not have backlinks.
+ std::pair<backlink_mmap_t::const_iterator, backlink_mmap_t::const_iterator> range = mBacklinkMMap.equal_range(link_id);
+ if (range.first != range.second)
+ {
+ LL_WARNS() << "Link item " << item->getName() << " has backlinks!" << LL_ENDL;
+ }
+ }
+ else
+ {
+ // Check the backlinks of a non-link item.
+ const LLUUID& target_id = item->getUUID();
+ std::pair<backlink_mmap_t::const_iterator, backlink_mmap_t::const_iterator> range = mBacklinkMMap.equal_range(target_id);
+ for (backlink_mmap_t::const_iterator it = range.first; it != range.second; ++it)
+ {
+ const LLUUID& link_id = it->second;
+ LLViewerInventoryItem *link_item = getItem(link_id);
+ if (!link_item || !link_item->getIsLinkType())
+ {
+ LL_WARNS() << "invalid backlink from target " << item->getName() << " to " << link_id << LL_ENDL;
+ }
+ }
+ }
+ }
+
+ if (cat_lock > 0 || item_lock > 0)
+ {
+ LL_INFOS() << "Found locks on some categories: sub-cat arrays "
+ << cat_lock << ", item arrays " << item_lock << LL_ENDL;
+ }
+ if (desc_unknown_count != 0)
+ {
+ LL_INFOS() << "Found " << desc_unknown_count << " cats with unknown descendent count" << LL_ENDL;
+ }
+ if (version_unknown_count != 0)
+ {
+ LL_INFOS() << "Found " << version_unknown_count << " cats with unknown version" << LL_ENDL;
+ }
+
+ LL_INFOS() << "Validate done, valid = " << (U32) valid << LL_ENDL;
+
+ return valid;
}
///----------------------------------------------------------------------------
diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h
index 544ca5e5dc..2e957809be 100755
--- a/indra/newview/llinventorymodel.h
+++ b/indra/newview/llinventorymodel.h
@@ -29,11 +29,11 @@
#include "llassettype.h"
#include "llfoldertype.h"
-#include "lldarray.h"
#include "llframetimer.h"
-#include "llhttpclient.h"
+#include "llcurl.h"
#include "lluuid.h"
#include "llpermissionsflags.h"
+#include "llviewerinventory.h"
#include "llstring.h"
#include "llmd5.h"
#include <map>
@@ -45,14 +45,9 @@ class LLInventoryObserver;
class LLInventoryObject;
class LLInventoryItem;
class LLInventoryCategory;
-class LLViewerInventoryItem;
-class LLViewerInventoryCategory;
-class LLViewerInventoryItem;
-class LLViewerInventoryCategory;
class LLMessageSystem;
class LLInventoryCollectFunctor;
-
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// LLInventoryModel
//
@@ -75,17 +70,18 @@ public:
CHILDREN_MAYBE
};
- typedef LLDynamicArray<LLPointer<LLViewerInventoryCategory> > cat_array_t;
- typedef LLDynamicArray<LLPointer<LLViewerInventoryItem> > item_array_t;
+ typedef std::vector<LLPointer<LLViewerInventoryCategory> > cat_array_t;
+ typedef std::vector<LLPointer<LLViewerInventoryItem> > item_array_t;
typedef std::set<LLUUID> changed_items_t;
- class fetchInventoryResponder : public LLHTTPClient::Responder
+ class fetchInventoryResponder : public LLCurl::Responder
{
+ LOG_CLASS(fetchInventoryResponder);
public:
fetchInventoryResponder(const LLSD& request_sd) : mRequestSD(request_sd) {};
- void result(const LLSD& content);
- void errorWithContent(U32 status, const std::string& reason, const LLSD& content);
protected:
+ virtual void httpSuccess();
+ virtual void httpFailure();
LLSD mRequestSD;
};
@@ -138,6 +134,8 @@ public:
// during authentication. Returns true if everything parsed.
bool loadSkeleton(const LLSD& options, const LLUUID& owner_id);
void buildParentChildMap(); // brute force method to rebuild the entire parent-child relations
+ void createCommonSystemCategories();
+
// Call on logout to save a terse representation.
void cache(const LLUUID& parent_folder_id, const LLUUID& agent_id);
private:
@@ -156,6 +154,15 @@ private:
parent_cat_map_t mParentChildCategoryTree;
parent_item_map_t mParentChildItemTree;
+ // Track links to items and categories. We do not store item or
+ // category pointers here, because broken links are also supported.
+ typedef std::multimap<LLUUID, LLUUID> backlink_mmap_t;
+ backlink_mmap_t mBacklinkMMap; // key = target_id: ID of item, values = link_ids: IDs of item or folder links referencing it.
+ // For internal use only
+ bool hasBacklinkInfo(const LLUUID& link_id, const LLUUID& target_id) const;
+ void addBacklinkInfo(const LLUUID& link_id, const LLUUID& target_id);
+ void removeBacklinkInfo(const LLUUID& link_id, const LLUUID& target_id);
+
//--------------------------------------------------------------------
// Login
//--------------------------------------------------------------------
@@ -204,6 +211,9 @@ public:
EXCLUDE_TRASH = FALSE,
INCLUDE_TRASH = TRUE
};
+ // Simpler existence test if matches don't actually need to be collected.
+ bool hasMatchingDirectDescendent(const LLUUID& cat_id,
+ LLInventoryCollectFunctor& filter);
void collectDescendents(const LLUUID& id,
cat_array_t& categories,
item_array_t& items,
@@ -212,22 +222,27 @@ public:
cat_array_t& categories,
item_array_t& items,
BOOL include_trash,
- LLInventoryCollectFunctor& add,
- BOOL follow_folder_links = FALSE);
+ LLInventoryCollectFunctor& add);
// Collect all items in inventory that are linked to item_id.
// Assumes item_id is itself not a linked item.
- item_array_t collectLinkedItems(const LLUUID& item_id,
- const LLUUID& start_folder_id = LLUUID::null);
-
+ item_array_t collectLinksTo(const LLUUID& item_id);
// Check if one object has a parent chain up to the category specified by UUID.
BOOL isObjectDescendentOf(const LLUUID& obj_id, const LLUUID& cat_id) const;
+ // Follow parent chain to the top.
+ bool getObjectTopmostAncestor(const LLUUID& object_id, LLUUID& result) const;
+
//--------------------------------------------------------------------
// Find
//--------------------------------------------------------------------
public:
+ const LLUUID findCategoryUUIDForTypeInRoot(
+ LLFolderType::EType preferred_type,
+ bool create_folder,
+ const LLUUID& root_id);
+
// Returns the uuid of the category that specifies 'type' as what it
// defaults to containing. The category is not necessarily only for that type.
// NOTE: If create_folder is true, this will create a new inventory category
@@ -297,7 +312,7 @@ public:
// NOTE: In usage, you will want to perform cache accounting
// operations in LLInventoryModel::accountForUpdate() or
// LLViewerInventoryItem::updateServer() before calling this method.
- U32 updateItem(const LLViewerInventoryItem* item);
+ U32 updateItem(const LLViewerInventoryItem* item, U32 mask = 0);
// Change an existing item with the matching id or add
// the category. No notifcation will be sent to observers. This
@@ -306,7 +321,7 @@ public:
// NOTE: In usage, you will want to perform cache accounting
// operations in accountForUpdate() or LLViewerInventoryCategory::
// updateServer() before calling this method.
- void updateCategory(const LLViewerInventoryCategory* cat);
+ void updateCategory(const LLViewerInventoryCategory* cat, U32 mask = 0);
// Move the specified object id to the specified category and
// update the internal structures. No cache accounting,
@@ -327,11 +342,31 @@ public:
// Delete
//--------------------------------------------------------------------
public:
+
+ // Update model after an AISv3 update received for any operation.
+ void onAISUpdateReceived(const std::string& context, const LLSD& update);
+
+ // Update model after an item is confirmed as removed from
+ // server. Works for categories or items.
+ void onObjectDeletedFromServer(const LLUUID& item_id,
+ bool fix_broken_links = true,
+ bool update_parent_version = true,
+ bool do_notify_observers = true);
+
+ // Update model after all descendents removed from server.
+ void onDescendentsPurgedFromServer(const LLUUID& object_id, bool fix_broken_links = true);
+
+ // Update model after an existing item gets updated on server.
+ void onItemUpdated(const LLUUID& item_id, const LLSD& updates, bool update_parent_version);
+
+ // Update model after an existing category gets updated on server.
+ void onCategoryUpdated(const LLUUID& cat_id, const LLSD& updates);
+
// Delete a particular inventory object by ID. Will purge one
// object from the internal data structures, maintaining a
// consistent internal state. No cache accounting, observer
// notification, or server update is performed.
- void deleteObject(const LLUUID& id);
+ void deleteObject(const LLUUID& id, bool fix_broken_links = true, bool do_notify_observers = true);
/// move Item item_id to Trash
void removeItem(const LLUUID& item_id);
/// move Category category_id to Trash
@@ -339,17 +374,6 @@ public:
/// removeItem() or removeCategory(), whichever is appropriate
void removeObject(const LLUUID& object_id);
- // Delete a particular inventory object by ID, and delete it from
- // the server. Also updates linked items.
- void purgeObject(const LLUUID& id);
-
- // Collects and purges the descendants of the id
- // provided. If the category is not found, no action is
- // taken. This method goes through the long winded process of
- // removing server representation of folders and items while doing
- // cache accounting in a fairly efficient manner. This method does
- // not notify observers (though maybe it should...)
- void purgeDescendentsOf(const LLUUID& id);
protected:
void updateLinkedObjectsFromPurge(const LLUUID& baseobj_id);
@@ -384,8 +408,7 @@ public:
LLUUID createNewCategory(const LLUUID& parent_id,
LLFolderType::EType preferred_type,
const std::string& name,
- void (*callback)(const LLSD&, void*) = NULL,
- void* user_data = NULL );
+ boost::optional<inventory_func_type> callback = boost::optional<inventory_func_type>());
protected:
// Internal methods that add inventory and make sure that all of
// the internal data structures are consistent. These methods
@@ -462,7 +485,9 @@ public:
// been changed 'under the hood', but outside the control of the
// inventory. The next notify will include that notification.
void addChangedMask(U32 mask, const LLUUID& referent);
+
const changed_items_t& getChangedIDs() const { return mChangedItemIDs; }
+ const changed_items_t& getAddedIDs() const { return mAddedItemIDs; }
protected:
// Updates all linked items pointing to this id.
void addChangedMaskForLinks(const LLUUID& object_id, U32 mask);
@@ -473,6 +498,8 @@ private:
// Variables used to track what has changed since the last notify.
U32 mModifyMask;
changed_items_t mChangedItemIDs;
+ changed_items_t mAddedItemIDs;
+
//--------------------------------------------------------------------
// Observers
@@ -534,7 +561,7 @@ public:
static void processMoveInventoryItem(LLMessageSystem* msg, void**);
static void processFetchInventoryReply(LLMessageSystem* msg, void**);
protected:
- bool messageUpdateCore(LLMessageSystem* msg, bool do_accounting);
+ bool messageUpdateCore(LLMessageSystem* msg, bool do_accounting, U32 mask = 0x0);
//--------------------------------------------------------------------
// Locks
@@ -556,6 +583,7 @@ private:
//--------------------------------------------------------------------
public:
void dumpInventory() const;
+ bool validate() const;
/** Miscellaneous
** **
diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp
index d88e0c3192..2de37b0790 100755
--- a/indra/newview/llinventorymodelbackgroundfetch.cpp
+++ b/indra/newview/llinventorymodelbackgroundfetch.cpp
@@ -1,6 +1,6 @@
/**
- * @file llinventorymodel.cpp
- * @brief Implementation of the inventory model used to track agent inventory.
+ * @file llinventorymodelbackgroundfetch.cpp
+ * @brief Implementation of background fetching of inventory.
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
@@ -172,8 +172,11 @@ void LLInventoryModelBackgroundFetch::setAllFoldersFetched()
mRecursiveLibraryFetchStarted)
{
mAllFoldersFetched = TRUE;
+ //LL_INFOS() << "All folders fetched, validating" << LL_ENDL;
+ //gInventory.validate();
}
mFolderFetchActive = false;
+ mBackgroundFetchActive = false;
}
void LLInventoryModelBackgroundFetch::backgroundFetchCB(void *)
@@ -200,7 +203,7 @@ void LLInventoryModelBackgroundFetch::backgroundFetch()
// No more categories to fetch, stop fetch process.
if (mFetchQueue.empty())
{
- llinfos << "Inventory fetch completed" << llendl;
+ LL_INFOS() << "Inventory fetch completed" << LL_ENDL;
setAllFoldersFetched();
mBackgroundFetchActive = false;
@@ -216,7 +219,7 @@ void LLInventoryModelBackgroundFetch::backgroundFetch()
// Double timeouts on failure.
mMinTimeBetweenFetches = llmin(mMinTimeBetweenFetches * 2.f, 10.f);
mMaxTimeBetweenFetches = llmin(mMaxTimeBetweenFetches * 2.f, 120.f);
- lldebugs << "Inventory fetch times grown to (" << mMinTimeBetweenFetches << ", " << mMaxTimeBetweenFetches << ")" << llendl;
+ LL_DEBUGS() << "Inventory fetch times grown to (" << mMinTimeBetweenFetches << ", " << mMaxTimeBetweenFetches << ")" << LL_ENDL;
// fetch is no longer considered "timely" although we will wait for full time-out.
mTimelyFetchPending = FALSE;
}
@@ -289,7 +292,7 @@ void LLInventoryModelBackgroundFetch::backgroundFetch()
// Shrink timeouts based on success.
mMinTimeBetweenFetches = llmax(mMinTimeBetweenFetches * 0.8f, 0.3f);
mMaxTimeBetweenFetches = llmax(mMaxTimeBetweenFetches * 0.8f, 10.f);
- lldebugs << "Inventory fetch times shrunk to (" << mMinTimeBetweenFetches << ", " << mMaxTimeBetweenFetches << ")" << llendl;
+ LL_DEBUGS() << "Inventory fetch times shrunk to (" << mMinTimeBetweenFetches << ", " << mMaxTimeBetweenFetches << ")" << LL_ENDL;
}
mTimelyFetchPending = FALSE;
@@ -363,35 +366,40 @@ void LLInventoryModelBackgroundFetch::incrFetchCount(S16 fetching)
class LLInventoryModelFetchItemResponder : public LLInventoryModel::fetchInventoryResponder
{
+ LOG_CLASS(LLInventoryModelFetchItemResponder);
public:
- LLInventoryModelFetchItemResponder(const LLSD& request_sd) : LLInventoryModel::fetchInventoryResponder(request_sd) {};
- void result(const LLSD& content);
- void errorWithContent(U32 status, const std::string& reason, const LLSD& content);
+ LLInventoryModelFetchItemResponder(const LLSD& request_sd) :
+ LLInventoryModel::fetchInventoryResponder(request_sd)
+ {
+ LLInventoryModelBackgroundFetch::instance().incrFetchCount(1);
+ }
+private:
+ /* virtual */ void httpCompleted()
+ {
+ LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1);
+ LLInventoryModel::fetchInventoryResponder::httpCompleted();
+ }
};
-void LLInventoryModelFetchItemResponder::result( const LLSD& content )
-{
- LLInventoryModel::fetchInventoryResponder::result(content);
- LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1);
-}
-
-void LLInventoryModelFetchItemResponder::errorWithContent( U32 status, const std::string& reason, const LLSD& content )
-{
- LLInventoryModel::fetchInventoryResponder::errorWithContent(status, reason, content);
- LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1);
-}
-
-
class LLInventoryModelFetchDescendentsResponder: public LLHTTPClient::Responder
{
+ LOG_CLASS(LLInventoryModelFetchDescendentsResponder);
public:
LLInventoryModelFetchDescendentsResponder(const LLSD& request_sd, uuid_vec_t recursive_cats) :
mRequestSD(request_sd),
mRecursiveCatUUIDs(recursive_cats)
- {};
+ {
+ LLInventoryModelBackgroundFetch::instance().incrFetchCount(1);
+ }
//LLInventoryModelFetchDescendentsResponder() {};
- void result(const LLSD& content);
- void errorWithContent(U32 status, const std::string& reason, const LLSD& content);
+private:
+ /* virtual */ void httpCompleted()
+ {
+ LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1);
+ LLHTTPClient::Responder::httpCompleted();
+ }
+ /* virtual */ void httpSuccess();
+ /* virtual */ void httpFailure();
protected:
BOOL getIsRecursive(const LLUUID& cat_id) const;
private:
@@ -400,8 +408,14 @@ private:
};
// If we get back a normal response, handle it here.
-void LLInventoryModelFetchDescendentsResponder::result(const LLSD& content)
+void LLInventoryModelFetchDescendentsResponder::httpSuccess()
{
+ const LLSD& content = getContent();
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
LLInventoryModelBackgroundFetch *fetcher = LLInventoryModelBackgroundFetch::getInstance();
if (content.has("folders"))
{
@@ -417,8 +431,8 @@ void LLInventoryModelFetchDescendentsResponder::result(const LLSD& content)
//if(agent_id != gAgent.getID()) //This should never happen.
//{
- // llwarns << "Got a UpdateInventoryItem for the wrong agent."
- // << llendl;
+ // LL_WARNS() << "Got a UpdateInventoryItem for the wrong agent."
+ // << LL_ENDL;
// break;
//}
@@ -508,20 +522,19 @@ void LLInventoryModelFetchDescendentsResponder::result(const LLSD& content)
for(LLSD::array_const_iterator folder_it = content["bad_folders"].beginArray();
folder_it != content["bad_folders"].endArray();
++folder_it)
- {
+ {
+ // *TODO: Stop copying data
LLSD folder_sd = *folder_it;
// These folders failed on the dataserver. We probably don't want to retry them.
- llinfos << "Folder " << folder_sd["folder_id"].asString()
- << "Error: " << folder_sd["error"].asString() << llendl;
+ LL_WARNS() << "Folder " << folder_sd["folder_id"].asString()
+ << "Error: " << folder_sd["error"].asString() << LL_ENDL;
}
}
-
- fetcher->incrFetchCount(-1);
if (fetcher->isBulkFetchProcessingComplete())
{
- llinfos << "Inventory fetch completed" << llendl;
+ LL_INFOS() << "Inventory fetch completed" << LL_ENDL;
fetcher->setAllFoldersFetched();
}
@@ -529,21 +542,21 @@ void LLInventoryModelFetchDescendentsResponder::result(const LLSD& content)
}
// If we get back an error (not found, etc...), handle it here.
-void LLInventoryModelFetchDescendentsResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+void LLInventoryModelFetchDescendentsResponder::httpFailure()
{
+ LL_WARNS() << dumpResponse() << LL_ENDL;
LLInventoryModelBackgroundFetch *fetcher = LLInventoryModelBackgroundFetch::getInstance();
- llinfos << "LLInventoryModelFetchDescendentsResponder::error [status:"
- << status << "]: " << content << llendl;
+ LL_INFOS() << dumpResponse() << LL_ENDL;
fetcher->incrFetchCount(-1);
- if (status==499) // timed out
+ if (getStatus()==HTTP_INTERNAL_ERROR) // timed out or curl failure
{
for(LLSD::array_const_iterator folder_it = mRequestSD["folders"].beginArray();
folder_it != mRequestSD["folders"].endArray();
++folder_it)
- {
+ {
LLSD folder_sd = *folder_it;
LLUUID folder_id = folder_sd["folder_id"];
const BOOL recursive = getIsRecursive(folder_id);
@@ -586,7 +599,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch()
(mFetchTimer.getElapsedTimeF32() < mMinTimeBetweenFetches))
{
return; // just bail if we are disconnected
- }
+ }
U32 item_count=0;
U32 folder_count=0;
@@ -686,63 +699,46 @@ void LLInventoryModelBackgroundFetch::bulkFetch()
{
if (folder_count)
{
- std::string url = region->getCapability("FetchInventoryDescendents2");
+ std::string url = region->getCapability("FetchInventoryDescendents2");
if ( !url.empty() )
{
- mFetchCount++;
- if (folder_request_body["folders"].size())
- {
- LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(folder_request_body, recursive_cats);
- LLHTTPClient::post(url, folder_request_body, fetcher, 300.0);
- }
- if (folder_request_body_lib["folders"].size())
- {
- std::string url_lib = gAgent.getRegion()->getCapability("FetchLibDescendents2");
+ if (folder_request_body["folders"].size())
+ {
+ LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(folder_request_body, recursive_cats);
+ LLHTTPClient::post(url, folder_request_body, fetcher, 300.0);
+ }
+ if (folder_request_body_lib["folders"].size())
+ {
+ std::string url_lib = gAgent.getRegion()->getCapability("FetchLibDescendents2");
- LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(folder_request_body_lib, recursive_cats);
- LLHTTPClient::post(url_lib, folder_request_body_lib, fetcher, 300.0);
+ LLInventoryModelFetchDescendentsResponder *fetcher = new LLInventoryModelFetchDescendentsResponder(folder_request_body_lib, recursive_cats);
+ LLHTTPClient::post(url_lib, folder_request_body_lib, fetcher, 300.0);
+ }
}
}
- }
if (item_count)
{
std::string url;
if (item_request_body.size())
{
- mFetchCount++;
url = region->getCapability("FetchInventory2");
if (!url.empty())
{
LLSD body;
- body["agent_id"] = gAgent.getID();
body["items"] = item_request_body;
LLHTTPClient::post(url, body, new LLInventoryModelFetchItemResponder(body));
}
- //else
- //{
- // LLMessageSystem* msg = gMessageSystem;
- // msg->newMessage("FetchInventory");
- // msg->nextBlock("AgentData");
- // msg->addUUID("AgentID", gAgent.getID());
- // msg->addUUID("SessionID", gAgent.getSessionID());
- // msg->nextBlock("InventoryData");
- // msg->addUUID("OwnerID", mPermissions.getOwner());
- // msg->addUUID("ItemID", mUUID);
- // gAgent.sendReliableMessage();
- //}
}
if (item_request_body_lib.size())
{
- mFetchCount++;
url = region->getCapability("FetchLib2");
if (!url.empty())
{
LLSD body;
- body["agent_id"] = gAgent.getID();
body["items"] = item_request_body_lib;
LLHTTPClient::post(url, body, new LLInventoryModelFetchItemResponder(body));
diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp
index 16427f2016..2dd8dce42f 100755
--- a/indra/newview/llinventoryobserver.cpp
+++ b/indra/newview/llinventoryobserver.cpp
@@ -149,10 +149,10 @@ LLInventoryFetchItemsObserver::LLInventoryFetchItemsObserver(const uuid_vec_t& i
void LLInventoryFetchItemsObserver::changed(U32 mask)
{
- lldebugs << this << " remaining incomplete " << mIncomplete.size()
+ LL_DEBUGS() << this << " remaining incomplete " << mIncomplete.size()
<< " complete " << mComplete.size()
<< " wait period " << mFetchingPeriod.getRemainingTimeF32()
- << llendl;
+ << LL_ENDL;
// scan through the incomplete items and move or erase them as
// appropriate.
@@ -176,7 +176,7 @@ void LLInventoryFetchItemsObserver::changed(U32 mask)
if (timeout_expired)
{
// Just concede that this item hasn't arrived in reasonable time and continue on.
- llwarns << "Fetcher timed out when fetching inventory item UUID: " << item_id << LL_ENDL;
+ LL_WARNS() << "Fetcher timed out when fetching inventory item UUID: " << item_id << LL_ENDL;
it = mIncomplete.erase(it);
}
else
@@ -191,12 +191,12 @@ void LLInventoryFetchItemsObserver::changed(U32 mask)
if (mIncomplete.empty())
{
- lldebugs << this << " done at remaining incomplete "
- << mIncomplete.size() << " complete " << mComplete.size() << llendl;
+ LL_DEBUGS() << this << " done at remaining incomplete "
+ << mIncomplete.size() << " complete " << mComplete.size() << LL_ENDL;
done();
}
- //llinfos << "LLInventoryFetchItemsObserver::changed() mComplete size " << mComplete.size() << llendl;
- //llinfos << "LLInventoryFetchItemsObserver::changed() mIncomplete size " << mIncomplete.size() << llendl;
+ //LL_INFOS() << "LLInventoryFetchItemsObserver::changed() mComplete size " << mComplete.size() << LL_ENDL;
+ //LL_INFOS() << "LLInventoryFetchItemsObserver::changed() mIncomplete size " << mIncomplete.size() << LL_ENDL;
}
void fetch_items_from_llsd(const LLSD& items_llsd)
@@ -224,12 +224,12 @@ void fetch_items_from_llsd(const LLSD& items_llsd)
{
if (!gAgent.getRegion())
{
- llwarns << "Agent's region is null" << llendl;
+ LL_WARNS() << "Agent's region is null" << LL_ENDL;
break;
}
if (0 == body[i]["items"].size()) {
- lldebugs << "Skipping body with no items to fetch" << llendl;
+ LL_DEBUGS() << "Skipping body with no items to fetch" << LL_ENDL;
continue;
}
@@ -391,14 +391,14 @@ BOOL LLInventoryFetchDescendentsObserver::isCategoryComplete(const LLViewerInven
gInventory.getDirectDescendentsOf(cat->getUUID(), cats, items);
if (!cats || !items)
{
- llwarns << "Category '" << cat->getName() << "' descendents corrupted, fetch failed." << llendl;
+ LL_WARNS() << "Category '" << cat->getName() << "' descendents corrupted, fetch failed." << LL_ENDL;
// NULL means the call failed -- cats/items map doesn't exist (note: this does NOT mean
// that the cat just doesn't have any items or subfolders).
// Unrecoverable, so just return done so that this observer can be cleared
// from memory.
return TRUE;
}
- const S32 current_num_known_descendents = cats->count() + items->count();
+ const S32 current_num_known_descendents = cats->size() + items->size();
// Got the number of descendents that we were expecting, so we're done.
if (current_num_known_descendents == expected_num_descendents)
@@ -411,7 +411,7 @@ BOOL LLInventoryFetchDescendentsObserver::isCategoryComplete(const LLViewerInven
// count and thus the category thinks it has fewer descendents than it actually has.
if (current_num_known_descendents >= expected_num_descendents)
{
- llwarns << "Category '" << cat->getName() << "' expected descendentcount:" << expected_num_descendents << " descendents but got descendentcount:" << current_num_known_descendents << llendl;
+ LL_WARNS() << "Category '" << cat->getName() << "' expected descendentcount:" << expected_num_descendents << " descendents but got descendentcount:" << current_num_known_descendents << LL_ENDL;
const_cast<LLViewerInventoryCategory *>(cat)->setDescendentCount(current_num_known_descendents);
return TRUE;
}
@@ -465,41 +465,13 @@ void LLInventoryFetchComboObserver::startFetch()
mFetchDescendents->startFetch();
}
-void LLInventoryExistenceObserver::watchItem(const LLUUID& id)
-{
- if (id.notNull())
- {
- mMIA.push_back(id);
- }
-}
-
-void LLInventoryExistenceObserver::changed(U32 mask)
-{
- // scan through the incomplete items and move or erase them as
- // appropriate.
- if (!mMIA.empty())
- {
- for (uuid_vec_t::iterator it = mMIA.begin(); it < mMIA.end(); )
- {
- LLViewerInventoryItem* item = gInventory.getItem(*it);
- if (!item)
- {
- ++it;
- continue;
- }
- mExist.push_back(*it);
- it = mMIA.erase(it);
- }
- if (mMIA.empty())
- {
- done();
- }
- }
-}
-
+// See comment preceding LLInventoryAddedObserver::changed() for some
+// concerns that also apply to this observer.
void LLInventoryAddItemByAssetObserver::changed(U32 mask)
{
- if(!(mask & LLInventoryObserver::ADD))
+ if(!(mask & LLInventoryObserver::ADD) ||
+ !(mask & LLInventoryObserver::CREATE) ||
+ !(mask & LLInventoryObserver::UPDATE_CREATE))
{
return;
}
@@ -510,20 +482,12 @@ void LLInventoryAddItemByAssetObserver::changed(U32 mask)
return;
}
- LLMessageSystem* msg = gMessageSystem;
- if (!(msg->getMessageName() && (0 == strcmp(msg->getMessageName(), "UpdateCreateInventoryItem"))))
+ const uuid_set_t& added = gInventory.getAddedIDs();
+ for (uuid_set_t::iterator it = added.begin(); it != added.end(); ++it)
{
- // this is not our message
- return; // to prevent a crash. EXT-7921;
- }
-
- LLPointer<LLViewerInventoryItem> item = new LLViewerInventoryItem;
- S32 num_blocks = msg->getNumberOfBlocksFast(_PREHASH_InventoryData);
- for(S32 i = 0; i < num_blocks; ++i)
- {
- item->unpackMessage(msg, _PREHASH_InventoryData, i);
+ LLInventoryItem *item = gInventory.getItem(*it);
const LLUUID& asset_uuid = item->getAssetUUID();
- if (item->getUUID().notNull() && asset_uuid.notNull())
+ if (item && item->getUUID().notNull() && asset_uuid.notNull())
{
if (isAssetWatched(asset_uuid))
{
@@ -532,11 +496,11 @@ void LLInventoryAddItemByAssetObserver::changed(U32 mask)
}
}
}
-
+
if (mAddedItems.size() == mWatchedAssets.size())
{
- done();
LL_DEBUGS("Inventory_Move") << "All watched items are added & processed." << LL_ENDL;
+ done();
mAddedItems.clear();
// Unable to clean watched items here due to somebody can require to check them in current frame.
@@ -566,41 +530,28 @@ bool LLInventoryAddItemByAssetObserver::isAssetWatched( const LLUUID& asset_id )
return std::find(mWatchedAssets.begin(), mWatchedAssets.end(), asset_id) != mWatchedAssets.end();
}
+// This observer used to explicitly check for whether it was being
+// called as a result of an UpdateCreateInventoryItem message. It has
+// now been decoupled enough that it's not actually checking the
+// message system, but now we have the special UPDATE_CREATE flag
+// being used for the same purpose. Fixing this, as we would need to
+// do to get rid of the message, is somewhat subtle because there's no
+// particular obvious criterion for when creating a new item should
+// trigger this observer and when it shouldn't. For example, creating
+// a new notecard with new->notecard causes a preview window to pop up
+// via the derived class LLOpenTaskOffer, but creating a new notecard
+// by copy and paste does not, solely because one goes through
+// UpdateCreateInventoryItem and the other doesn't.
void LLInventoryAddedObserver::changed(U32 mask)
{
- if (!(mask & LLInventoryObserver::ADD))
+ if (!(mask & LLInventoryObserver::ADD) ||
+ !(mask & LLInventoryObserver::CREATE) ||
+ !(mask & LLInventoryObserver::UPDATE_CREATE))
{
return;
}
- // *HACK: If this was in response to a packet off
- // the network, figure out which item was updated.
- LLMessageSystem* msg = gMessageSystem;
-
- std::string msg_name = msg->getMessageName();
- if (msg_name.empty())
- {
- return;
- }
-
- // We only want newly created inventory items. JC
- if ( msg_name != "UpdateCreateInventoryItem")
- {
- return;
- }
-
- LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem;
- S32 num_blocks = msg->getNumberOfBlocksFast(_PREHASH_InventoryData);
- for (S32 i = 0; i < num_blocks; ++i)
- {
- titem->unpackMessage(msg, _PREHASH_InventoryData, i);
- if (!(titem->getUUID().isNull()))
- {
- //we don't do anything with null keys
- mAdded.push_back(titem->getUUID());
- }
- }
- if (!mAdded.empty())
+ if (!gInventory.getAddedIDs().empty())
{
done();
}
@@ -613,9 +564,9 @@ void LLInventoryCategoryAddedObserver::changed(U32 mask)
return;
}
- const LLInventoryModel::changed_items_t& changed_ids = gInventory.getChangedIDs();
+ const LLInventoryModel::changed_items_t& added_ids = gInventory.getAddedIDs();
- for (LLInventoryModel::changed_items_t::const_iterator cit = changed_ids.begin(); cit != changed_ids.end(); ++cit)
+ for (LLInventoryModel::changed_items_t::const_iterator cit = added_ids.begin(); cit != added_ids.end(); ++cit)
{
LLViewerInventoryCategory* cat = gInventory.getCategory(*cit);
@@ -633,58 +584,6 @@ void LLInventoryCategoryAddedObserver::changed(U32 mask)
}
}
-
-LLInventoryTransactionObserver::LLInventoryTransactionObserver(const LLTransactionID& transaction_id) :
- mTransactionID(transaction_id)
-{
-}
-
-void LLInventoryTransactionObserver::changed(U32 mask)
-{
- if (mask & LLInventoryObserver::ADD)
- {
- // This could be it - see if we are processing a bulk update
- LLMessageSystem* msg = gMessageSystem;
- if (msg->getMessageName()
- && (0 == strcmp(msg->getMessageName(), "BulkUpdateInventory")))
- {
- // we have a match for the message - now check the
- // transaction id.
- LLUUID id;
- msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_TransactionID, id);
- if (id == mTransactionID)
- {
- // woo hoo, we found it
- uuid_vec_t folders;
- uuid_vec_t items;
- S32 count;
- count = msg->getNumberOfBlocksFast(_PREHASH_FolderData);
- S32 i;
- for (i = 0; i < count; ++i)
- {
- msg->getUUIDFast(_PREHASH_FolderData, _PREHASH_FolderID, id, i);
- if (id.notNull())
- {
- folders.push_back(id);
- }
- }
- count = msg->getNumberOfBlocksFast(_PREHASH_ItemData);
- for (i = 0; i < count; ++i)
- {
- msg->getUUIDFast(_PREHASH_ItemData, _PREHASH_ItemID, id, i);
- if (id.notNull())
- {
- items.push_back(id);
- }
- }
-
- // call the derived class the implements this method.
- done(folders, items);
- }
- }
- }
-}
-
void LLInventoryCategoriesObserver::changed(U32 mask)
{
if (!mCategoryMap.size())
@@ -702,7 +601,7 @@ void LLInventoryCategoriesObserver::changed(U32 mask)
LLViewerInventoryCategory* category = gInventory.getCategory(cat_id);
if (!category)
{
- llwarns << "Category : Category id = " << cat_id << " disappeared" << llendl;
+ LL_WARNS() << "Category : Category id = " << cat_id << " disappeared" << LL_ENDL;
cat_data.mCallback();
// Keep track of those deleted categories so we can remove them
deleted_categories_ids.push_back(cat_id);
@@ -723,7 +622,7 @@ void LLInventoryCategoriesObserver::changed(U32 mask)
gInventory.getDirectDescendentsOf(cat_id, cats, items);
if (!cats || !items)
{
- llwarns << "Category '" << category->getName() << "' descendents corrupted, fetch failed." << llendl;
+ LL_WARNS() << "Category '" << category->getName() << "' descendents corrupted, fetch failed." << LL_ENDL;
// NULL means the call failed -- cats/items map doesn't exist (note: this does NOT mean
// that the cat just doesn't have any items or subfolders).
// Unrecoverable, so just skip this category.
@@ -733,7 +632,7 @@ void LLInventoryCategoriesObserver::changed(U32 mask)
continue;
}
- const S32 current_num_known_descendents = cats->count() + items->count();
+ const S32 current_num_known_descendents = cats->size() + items->size();
bool cat_changed = false;
@@ -794,7 +693,7 @@ bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t
gInventory.getDirectDescendentsOf(cat_id, cats, items);
if (!cats || !items)
{
- llwarns << "Category '" << category->getName() << "' descendents corrupted, fetch failed." << llendl;
+ LL_WARNS() << "Category '" << category->getName() << "' descendents corrupted, fetch failed." << LL_ENDL;
// NULL means the call failed -- cats/items map doesn't exist (note: this does NOT mean
// that the cat just doesn't have any items or subfolders).
// Unrecoverable, so just return "false" meaning that the category can't be observed.
@@ -804,7 +703,7 @@ bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t
}
else
{
- current_num_known_descendents = cats->count() + items->count();
+ current_num_known_descendents = cats->size() + items->size();
}
}
@@ -833,3 +732,23 @@ LLInventoryCategoriesObserver::LLCategoryData::LLCategoryData(
{
mItemNameHash.finalize();
}
+
+void LLScrollOnRenameObserver::changed(U32 mask)
+{
+ if (mask & LLInventoryObserver::LABEL)
+ {
+ const uuid_set_t& changed_item_ids = gInventory.getChangedIDs();
+ for (uuid_set_t::const_iterator it = changed_item_ids.begin(); it != changed_item_ids.end(); ++it)
+ {
+ const LLUUID& id = *it;
+ if (id == mUUID)
+ {
+ mView->scrollToShowSelection();
+
+ gInventory.removeObserver(this);
+ delete this;
+ return;
+ }
+ }
+ }
+}
diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h
index aa1eae84d7..8cf6a6bdab 100755
--- a/indra/newview/llinventoryobserver.h
+++ b/indra/newview/llinventoryobserver.h
@@ -58,6 +58,9 @@ public:
GESTURE = 64,
REBUILD = 128, // Item UI changed (e.g. item type different)
SORT = 256, // Folder needs to be resorted.
+ CREATE = 512, // With ADD, item has just been created.
+ // unfortunately a particular message is still associated with some unique semantics.
+ UPDATE_CREATE = 1024, // With ADD, item added via UpdateCreateInventoryItem
ALL = 0xffffffff
};
LLInventoryObserver();
@@ -152,25 +155,6 @@ protected:
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// Class LLInventoryExistenceObserver
-//
-// Used as a base class for doing something when all the
-// observed item ids exist in the inventory somewhere.
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-class LLInventoryExistenceObserver : public LLInventoryObserver
-{
-public:
- LLInventoryExistenceObserver() {}
- /*virtual*/ void changed(U32 mask);
-
- void watchItem(const LLUUID& id);
-protected:
- virtual void done() = 0;
- uuid_vec_t mExist;
- uuid_vec_t mMIA;
-};
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLInventoryMovedObserver
//
// This class is used as a base class for doing something when all the
@@ -209,13 +193,11 @@ private:
class LLInventoryAddedObserver : public LLInventoryObserver
{
public:
- LLInventoryAddedObserver() : mAdded() {}
+ LLInventoryAddedObserver() {}
/*virtual*/ void changed(U32 mask);
protected:
virtual void done() = 0;
-
- uuid_vec_t mAdded;
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -241,25 +223,6 @@ protected:
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// Class LLInventoryTransactionObserver
-//
-// Base class for doing something when an inventory transaction completes.
-// NOTE: This class is not quite complete. Avoid using unless you fix up its
-// functionality gaps.
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-class LLInventoryTransactionObserver : public LLInventoryObserver
-{
-public:
- LLInventoryTransactionObserver(const LLTransactionID& transaction_id);
- /*virtual*/ void changed(U32 mask);
-
-protected:
- virtual void done(const uuid_vec_t& folders, const uuid_vec_t& items) = 0;
-
- LLTransactionID mTransactionID;
-};
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLInventoryCompletionObserver
//
// Base class for doing something when when all observed items are locally
@@ -326,4 +289,22 @@ protected:
category_map_t mCategoryMap;
};
+class LLFolderView;
+
+// Force a FolderView to scroll after an item in the corresponding view has been renamed.
+class LLScrollOnRenameObserver: public LLInventoryObserver
+{
+public:
+ LLFolderView *mView;
+ LLUUID mUUID;
+
+ LLScrollOnRenameObserver(const LLUUID& uuid, LLFolderView *view):
+ mUUID(uuid),
+ mView(view)
+ {
+ }
+ /* virtual */ void changed(U32 mask);
+};
+
+
#endif // LL_LLINVENTORYOBSERVERS_H
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 81ee7ac07e..e18ecd2e2a 100755
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -145,7 +145,8 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :
mShowItemLinkOverlays(p.show_item_link_overlays),
mShowEmptyMessage(p.show_empty_message),
mViewsInitialized(false),
- mInvFVBridgeBuilder(NULL)
+ mInvFVBridgeBuilder(NULL),
+ mInventoryViewModel(p.name)
{
mInvFVBridgeBuilder = &INVENTORY_BRIDGE_BUILDER;
@@ -335,7 +336,9 @@ LLInventoryFilter& LLInventoryPanel::getFilter()
void LLInventoryPanel::setFilterTypes(U64 types, LLInventoryFilter::EFilterType filter_type)
{
if (filter_type == LLInventoryFilter::FILTERTYPE_OBJECT)
+ {
getFilter().setFilterObjectTypes(types);
+ }
if (filter_type == LLInventoryFilter::FILTERTYPE_CATEGORY)
getFilter().setFilterCategoryTypes(types);
}
@@ -399,6 +402,11 @@ void LLInventoryPanel::setHoursAgo(U32 hours)
getFilter().setHoursAgo(hours);
}
+void LLInventoryPanel::setDateSearchDirection(U32 direction)
+{
+ getFilter().setDateSearchDirection(direction);
+}
+
void LLInventoryPanel::setFilterLinks(U64 filter_links)
{
getFilter().setFilterLinks(filter_links);
@@ -415,10 +423,10 @@ LLInventoryFilter::EFolderShow LLInventoryPanel::getShowFolderState()
}
// Called when something changed in the global model (new item, item coming through the wire, rename, move, etc...) (CHUI-849)
+static LLTrace::BlockTimerStatHandle FTM_REFRESH("Inventory Refresh");
void LLInventoryPanel::modelChanged(U32 mask)
{
- static LLFastTimer::DeclareTimer FTM_REFRESH("Inventory Refresh");
- LLFastTimer t2(FTM_REFRESH);
+ LL_RECORD_BLOCK_TIME(FTM_REFRESH);
if (!mViewsInitialized) return;
@@ -546,6 +554,14 @@ void LLInventoryPanel::modelChanged(U32 mask)
// Item is to be moved and we found its new parent in the panel's directory, so move the item's UI.
view_item->addToFolder(new_parent);
addItemID(viewmodel_item->getUUID(), view_item);
+ if (mInventory)
+ {
+ const LLUUID trash_id = mInventory->findCategoryUUIDForType(LLFolderType::FT_TRASH);
+ if (trash_id != model_item->getParentUUID() && (mask & LLInventoryObserver::INTERNAL) && new_parent->isOpen())
+ {
+ setSelection(item_id, FALSE);
+ }
+ }
}
else
{
@@ -572,6 +588,22 @@ void LLInventoryPanel::modelChanged(U32 mask)
}
}
}
+
+ if (mask & (LLInventoryObserver::STRUCTURE | LLInventoryObserver::REMOVE))
+ {
+ // STRUCTURE and REMOVE model changes usually fail to update (clean)
+ // mMostFilteredDescendantGeneration of parent folder and dirtyFilter()
+ // is not sufficient for successful filter update, so we need to check
+ // all already passed element over again to remove obsolete elements.
+ // New items or moved items should be sufficiently covered by
+ // dirtyFilter().
+ LLInventoryFilter& filter = getFilter();
+ if (filter.getFilterTypes() & LLInventoryFilter::FILTERTYPE_DATE
+ || filter.isNotDefault())
+ {
+ filter.setModified(LLFolderViewFilter::FILTER_MORE_RESTRICTIVE);
+ }
+ }
}
LLUUID LLInventoryPanel::getRootFolderID()
@@ -605,7 +637,7 @@ LLUUID LLInventoryPanel::getRootFolderID()
root_id = gInventory.findCategoryUUIDForType(preferred_type, false);
if (root_id.isNull())
{
- llwarns << "Could not find folder of type " << preferred_type << llendl;
+ LL_WARNS() << "Could not find folder of type " << preferred_type << LL_ENDL;
root_id.generateNewID();
}
}
@@ -685,7 +717,7 @@ void LLInventoryPanel::idle(void* user_data)
}
else
{
- llwarns << "Inventory : Deleted folder root detected on panel" << llendl;
+ LL_WARNS() << "Inventory : Deleted folder root detected on panel" << LL_ENDL;
panel->clearFolderRoot();
}
}
@@ -781,9 +813,9 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id)
if (objectp->getType() <= LLAssetType::AT_NONE ||
objectp->getType() >= LLAssetType::AT_COUNT)
{
- llwarns << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : "
+ LL_WARNS() << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : "
<< ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID()
- << llendl;
+ << LL_ENDL;
return NULL;
}
@@ -1048,7 +1080,7 @@ bool LLInventoryPanel::beginIMSession()
std::string name;
- LLDynamicArray<LLUUID> members;
+ std::vector<LLUUID> members;
EInstantMessage type = IM_SESSION_CONFERENCE_START;
std::set<LLFolderViewItem*>::const_iterator iter;
@@ -1076,7 +1108,7 @@ bool LLInventoryPanel::beginIMSession()
item_array,
LLInventoryModel::EXCLUDE_TRASH,
is_buddy);
- S32 count = item_array.count();
+ S32 count = item_array.size();
if(count > 0)
{
//*TODO by what to replace that?
@@ -1087,10 +1119,10 @@ bool LLInventoryPanel::beginIMSession()
LLUUID id;
for(S32 i = 0; i < count; ++i)
{
- id = item_array.get(i)->getCreatorUUID();
+ id = item_array.at(i)->getCreatorUUID();
if(at.isBuddyOnline(id))
{
- members.put(id);
+ members.push_back(id);
}
}
}
@@ -1110,7 +1142,7 @@ bool LLInventoryPanel::beginIMSession()
if(at.isBuddyOnline(id))
{
- members.put(id);
+ members.push_back(id);
}
}
} //if IT_CALLINGCARD
@@ -1185,7 +1217,7 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)
LLFloater* floater_inventory = LLFloaterReg::getInstance("inventory");
if (!floater_inventory)
{
- llwarns << "Could not find My Inventory floater" << llendl;
+ LL_WARNS() << "Could not find My Inventory floater" << LL_ENDL;
return FALSE;
}
@@ -1319,10 +1351,10 @@ void LLInventoryPanel::removeItemID(const LLUUID& id)
}
}
-LLFastTimer::DeclareTimer FTM_GET_ITEM_BY_ID("Get FolderViewItem by ID");
+LLTrace::BlockTimerStatHandle FTM_GET_ITEM_BY_ID("Get FolderViewItem by ID");
LLFolderViewItem* LLInventoryPanel::getItemByID(const LLUUID& id)
{
- LLFastTimer _(FTM_GET_ITEM_BY_ID);
+ LL_RECORD_BLOCK_TIME(FTM_GET_ITEM_BY_ID);
std::map<LLUUID, LLFolderViewItem*>::iterator map_it;
map_it = mItemMap.find(id);
@@ -1381,6 +1413,17 @@ BOOL LLInventoryPanel::handleKeyHere( KEY key, MASK mask )
// Open selected items if enter key hit on the inventory panel
if (mask == MASK_NONE)
{
+ //Don't allow attaching or opening items from Merchant Outbox
+ LLFolderViewItem* folder_item = mFolderRoot.get()->getCurSelectedItem();
+ if(folder_item)
+ {
+ LLInvFVBridge* bridge = (LLInvFVBridge*)folder_item->getViewModelItem();
+ if(bridge && bridge->isOutboxFolder() && (bridge->getInventoryType() != LLInventoryType::IT_CATEGORY))
+ {
+ return handled;
+ }
+ }
+
LLInventoryAction::doToSelected(mInventory, mFolderRoot.get(), "open");
handled = TRUE;
}
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index c0ce513694..a490dfce5d 100755
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -29,7 +29,6 @@
#define LL_LLINVENTORYPANEL_H
#include "llassetstorage.h"
-#include "lldarray.h"
#include "llfolderviewitem.h"
#include "llfolderviewmodelinventory.h"
#include "llfloater.h"
@@ -174,6 +173,7 @@ public:
const std::string getFilterSubString();
void setSinceLogoff(BOOL sl);
void setHoursAgo(U32 hours);
+ void setDateSearchDirection(U32 direction);
BOOL getSinceLogoff();
void setFilterLinks(U64 filter_links);
diff --git a/indra/newview/lljoystickbutton.cpp b/indra/newview/lljoystickbutton.cpp
index 3d1f186bba..d38f90015e 100755
--- a/indra/newview/lljoystickbutton.cpp
+++ b/indra/newview/lljoystickbutton.cpp
@@ -121,7 +121,7 @@ void LLJoystick::updateSlop()
break;
default:
- llerrs << "LLJoystick::LLJoystick() - bad switch case" << llendl;
+ LL_ERRS() << "LLJoystick::LLJoystick() - bad switch case" << LL_ENDL;
break;
}
@@ -132,7 +132,7 @@ bool LLJoystick::pointInCircle(S32 x, S32 y) const
{
if(this->getLocalRect().getHeight() != this->getLocalRect().getWidth())
{
- llwarns << "Joystick shape is not square"<<llendl;
+ LL_WARNS() << "Joystick shape is not square"<<LL_ENDL;
return true;
}
//center is x and y coordinates of center of joystick circle, and also its radius
@@ -143,7 +143,7 @@ bool LLJoystick::pointInCircle(S32 x, S32 y) const
BOOL LLJoystick::handleMouseDown(S32 x, S32 y, MASK mask)
{
- //llinfos << "joystick mouse down " << x << ", " << y << llendl;
+ //LL_INFOS() << "joystick mouse down " << x << ", " << y << LL_ENDL;
bool handles = false;
if(pointInCircle(x, y))
@@ -160,7 +160,7 @@ BOOL LLJoystick::handleMouseDown(S32 x, S32 y, MASK mask)
BOOL LLJoystick::handleMouseUp(S32 x, S32 y, MASK mask)
{
- // llinfos << "joystick mouse up " << x << ", " << y << llendl;
+ // LL_INFOS() << "joystick mouse up " << x << ", " << y << LL_ENDL;
if( hasMouseCapture() )
{
@@ -271,7 +271,7 @@ void LLJoystickAgentTurn::onHeldDown()
F32 time = getElapsedHeldDownTime();
updateSlop();
- //llinfos << "move forward/backward (and/or turn)" << llendl;
+ //LL_INFOS() << "move forward/backward (and/or turn)" << LL_ENDL;
S32 dx = mLastMouse.mX - mFirstMouse.mX + mInitialOffset.mX;
S32 dy = mLastMouse.mY - mFirstMouse.mY + mInitialOffset.mY;
@@ -353,7 +353,7 @@ void LLJoystickAgentSlide::onMouseUp()
void LLJoystickAgentSlide::onHeldDown()
{
- //llinfos << "slide left/right (and/or move forward/backward)" << llendl;
+ //LL_INFOS() << "slide left/right (and/or move forward/backward)" << LL_ENDL;
updateSlop();
@@ -504,7 +504,7 @@ F32 LLJoystickCameraRotate::getOrbitRate()
if( time < NUDGE_TIME )
{
F32 rate = ORBIT_NUDGE_RATE + time * (1 - ORBIT_NUDGE_RATE)/ NUDGE_TIME;
- //llinfos << rate << llendl;
+ //LL_INFOS() << rate << LL_ENDL;
return rate;
}
else
diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp
index 6625a194fb..f893daaeb2 100755
--- a/indra/newview/lllandmarkactions.cpp
+++ b/indra/newview/lllandmarkactions.cpp
@@ -233,7 +233,7 @@ bool LLLandmarkActions::canCreateLandmarkHere()
LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if(!agent_parcel)
{
- llwarns << "No agent region" << llendl;
+ LL_WARNS() << "No agent region" << LL_ENDL;
return false;
}
if (agent_parcel->getAllowLandmark()
@@ -252,13 +252,13 @@ void LLLandmarkActions::createLandmarkHere(
{
if(!gAgent.getRegion())
{
- llwarns << "No agent region" << llendl;
+ LL_WARNS() << "No agent region" << LL_ENDL;
return;
}
LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if (!agent_parcel)
{
- llwarns << "No agent parcel" << llendl;
+ LL_WARNS() << "No agent parcel" << LL_ENDL;
return;
}
if (!canCreateLandmarkHere())
diff --git a/indra/newview/lllandmarklist.cpp b/indra/newview/lllandmarklist.cpp
index a92df8250e..c58540914e 100755
--- a/indra/newview/lllandmarklist.cpp
+++ b/indra/newview/lllandmarklist.cpp
@@ -142,8 +142,7 @@ void LLLandmarkList::processGetAssetReply(
}
else
{
- LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED );
- // SJB: No use case for a notification here. Use lldebugs instead
+ // SJB: No use case for a notification here. Use LL_DEBUGS() instead
if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status )
{
LL_WARNS("Landmarks") << "Missing Landmark" << LL_ENDL;
@@ -176,7 +175,7 @@ void LLLandmarkList::onRegionHandle(const LLUUID& landmark_id)
if (!landmark)
{
- llwarns << "Got region handle but the landmark not found." << llendl;
+ LL_WARNS() << "Got region handle but the landmark not found." << LL_ENDL;
return;
}
@@ -185,7 +184,7 @@ void LLLandmarkList::onRegionHandle(const LLUUID& landmark_id)
LLVector3d pos;
if (!landmark->getGlobalPos(pos))
{
- llwarns << "Got region handle but the landmark global position is still unknown." << llendl;
+ LL_WARNS() << "Got region handle but the landmark global position is still unknown." << LL_ENDL;
return;
}
@@ -198,7 +197,7 @@ void LLLandmarkList::makeCallbacks(const LLUUID& landmark_id)
if (!landmark)
{
- llwarns << "Landmark to make callbacks for not found." << llendl;
+ LL_WARNS() << "Landmark to make callbacks for not found." << LL_ENDL;
}
// make all the callbacks here.
diff --git a/indra/newview/lllistcontextmenu.cpp b/indra/newview/lllistcontextmenu.cpp
index 6421ab42bf..6bda8b1d0d 100755
--- a/indra/newview/lllistcontextmenu.cpp
+++ b/indra/newview/lllistcontextmenu.cpp
@@ -80,7 +80,7 @@ void LLListContextMenu::show(LLView* spawning_view, const uuid_vec_t& uuids, S32
menup = createMenu();
if (!menup)
{
- llwarns << "Context menu creation failed" << llendl;
+ LL_WARNS() << "Context menu creation failed" << LL_ENDL;
return;
}
@@ -110,6 +110,7 @@ void LLListContextMenu::handleMultiple(functor_t functor, const uuid_vec_t& ids)
// static
LLContextMenu* LLListContextMenu::createFromFile(const std::string& filename)
{
+ llassert(LLMenuGL::sMenuContainer != NULL);
return LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>(
filename, LLContextMenu::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance());
}
diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp
index 2d9385390b..897ee8429a 100755
--- a/indra/newview/lllocalbitmaps.cpp
+++ b/indra/newview/lllocalbitmaps.cpp
@@ -48,6 +48,7 @@
/* misc headers */
#include "llscrolllistctrl.h"
#include "llfilepicker.h"
+#include "lllocaltextureobject.h"
#include "llviewertexturelist.h"
#include "llviewerobjectlist.h"
#include "llviewerobject.h"
@@ -60,7 +61,9 @@
#include "llnotificationsutil.h"
#include "pipeline.h"
#include "llmaterialmgr.h"
-
+#include "llimagedimensionsinfo.h"
+#include "llviewercontrol.h"
+#include "lltrans.h"
/*=======================================*/
/* Formal declarations, constants, etc. */
/*=======================================*/
@@ -110,8 +113,8 @@ LLLocalBitmap::LLLocalBitmap(std::string filename)
}
else
{
- llwarns << "File of no valid extension given, local bitmap creation aborted." << "\n"
- << "Filename: " << mFilename << llendl;
+ LL_WARNS() << "File of no valid extension given, local bitmap creation aborted." << "\n"
+ << "Filename: " << mFilename << LL_ENDL;
return; // no valid extension.
}
@@ -189,7 +192,7 @@ bool LLLocalBitmap::updateSelf(EUpdateType optional_firstupdate)
{
// decode is successful, we can safely proceed.
LLUUID old_id = LLUUID::null;
- if (!(optional_firstupdate == UT_FIRSTUSE) && !mWorldID.isNull())
+ if ((optional_firstupdate != UT_FIRSTUSE) && !mWorldID.isNull())
{
old_id = mWorldID;
}
@@ -205,15 +208,18 @@ bool LLLocalBitmap::updateSelf(EUpdateType optional_firstupdate)
gTextureList.addImage(texture);
- if (!optional_firstupdate == UT_FIRSTUSE)
+ if (optional_firstupdate != UT_FIRSTUSE)
{
// seek out everything old_id uses and replace it with mWorldID
replaceIDs(old_id, mWorldID);
// remove old_id from gimagelist
LLViewerFetchedTexture* image = gTextureList.findImage(old_id);
- gTextureList.deleteImage(image);
- image->unref();
+ if (image != NULL)
+ {
+ gTextureList.deleteImage(image);
+ image->unref();
+ }
}
mUpdateRetries = LL_LOCAL_UPDATE_RETRIES;
@@ -230,10 +236,10 @@ bool LLLocalBitmap::updateSelf(EUpdateType optional_firstupdate)
}
else
{
- llwarns << "During the update process the following file was found" << "\n"
+ LL_WARNS() << "During the update process the following file was found" << "\n"
<< "but could not be opened or decoded for " << LL_LOCAL_UPDATE_RETRIES << " attempts." << "\n"
<< "Filename: " << mFilename << "\n"
- << "Disabling further update attempts for this file." << llendl;
+ << "Disabling further update attempts for this file." << LL_ENDL;
LLSD notif_args;
notif_args["FNAME"] = mFilename;
@@ -249,9 +255,9 @@ bool LLLocalBitmap::updateSelf(EUpdateType optional_firstupdate)
else
{
- llwarns << "During the update process, the following file was not found." << "\n"
+ LL_WARNS() << "During the update process, the following file was not found." << "\n"
<< "Filename: " << mFilename << "\n"
- << "Disabling further update attempts for this file." << llendl;
+ << "Disabling further update attempts for this file." << LL_ENDL;
LLSD notif_args;
notif_args["FNAME"] = mFilename;
@@ -317,13 +323,13 @@ bool LLLocalBitmap::decodeBitmap(LLPointer<LLImageRaw> rawimg)
default:
{
- // separating this into -several- llwarns calls because in the extremely unlikely case that this happens
+ // separating this into -several- LL_WARNS() calls because in the extremely unlikely case that this happens
// accessing mFilename and any other object properties might very well crash the viewer.
// getting here should be impossible, or there's been a pretty serious bug.
- llwarns << "During a decode attempt, the following local bitmap had no properly assigned extension." << llendl;
- llwarns << "Filename: " << mFilename << llendl;
- llwarns << "Disabling further update attempts for this file." << llendl;
+ LL_WARNS() << "During a decode attempt, the following local bitmap had no properly assigned extension." << LL_ENDL;
+ LL_WARNS() << "Filename: " << mFilename << LL_ENDL;
+ LL_WARNS() << "Disabling further update attempts for this file." << LL_ENDL;
mLinkStatus = LS_BROKEN;
}
}
@@ -336,8 +342,8 @@ void LLLocalBitmap::replaceIDs(LLUUID old_id, LLUUID new_id)
// checking for misuse.
if (old_id == new_id)
{
- llinfos << "An attempt was made to replace a texture with itself. (matching UUIDs)" << "\n"
- << "Texture UUID: " << old_id.asString() << llendl;
+ LL_INFOS() << "An attempt was made to replace a texture with itself. (matching UUIDs)" << "\n"
+ << "Texture UUID: " << old_id.asString() << LL_ENDL;
return;
}
@@ -378,7 +384,7 @@ std::vector<LLViewerObject*> LLLocalBitmap::prepUpdateObjects(LLUUID old_id, U32
{
std::vector<LLViewerObject*> obj_list;
LLViewerFetchedTexture* old_texture = gTextureList.findImage(old_id);
-
+
for(U32 face_iterator = 0; face_iterator < old_texture->getNumFaces(channel); face_iterator++)
{
// getting an object from a face
@@ -451,7 +457,7 @@ void LLLocalBitmap::updateUserPrims(LLUUID old_id, LLUUID new_id, U32 channel)
switch(channel)
{
case LLRender::DIFFUSE_MAP:
- {
+ {
object->setTETexture(face_iter, new_id);
update_tex = true;
break;
@@ -540,7 +546,7 @@ void LLLocalBitmap::updateUserLayers(LLUUID old_id, LLUUID new_id, LLWearableTyp
{
U32 index = gAgentWearables.getWearableIndex(wearable);
gAgentAvatarp->setLocalTexture(reg_texind, gTextureList.getImage(new_id), FALSE, index);
- gAgentAvatarp->wearableUpdated(type, FALSE);
+ gAgentAvatarp->wearableUpdated(type);
/* telling the manager to rebake once update cycle is fully done */
LLLocalBitmapMgr::setNeedsRebake();
@@ -768,11 +774,11 @@ LLAvatarAppearanceDefines::ETextureIndex LLLocalBitmap::getTexIndex(
default:
{
- llwarns << "Unknown wearable type: " << (int)type << "\n"
+ LL_WARNS() << "Unknown wearable type: " << (int)type << "\n"
<< "Baked Texture Index: " << (int)baked_texind << "\n"
<< "Filename: " << mFilename << "\n"
<< "TrackingID: " << mTrackingID << "\n"
- << "InworldID: " << mWorldID << llendl;
+ << "InworldID: " << mWorldID << LL_ENDL;
}
}
@@ -823,6 +829,12 @@ LLLocalBitmapMgr::~LLLocalBitmapMgr()
{
}
+void LLLocalBitmapMgr::cleanupClass()
+{
+ std::for_each(sBitmapList.begin(), sBitmapList.end(), DeletePointer());
+ sBitmapList.clear();
+}
+
bool LLLocalBitmapMgr::addUnit()
{
bool add_successful = false;
@@ -835,6 +847,12 @@ bool LLLocalBitmapMgr::addUnit()
std::string filename = picker.getFirstFile();
while(!filename.empty())
{
+ if(!checkTextureDimensions(filename))
+ {
+ filename = picker.getNextFile();
+ continue;
+ }
+
LLLocalBitmap* unit = new LLLocalBitmap(filename);
if (unit->getValid())
@@ -844,8 +862,8 @@ bool LLLocalBitmapMgr::addUnit()
}
else
{
- llwarns << "Attempted to add invalid or unreadable image file, attempt cancelled.\n"
- << "Filename: " << filename << llendl;
+ LL_WARNS() << "Attempted to add invalid or unreadable image file, attempt cancelled.\n"
+ << "Filename: " << filename << LL_ENDL;
LLSD notif_args;
notif_args["FNAME"] = filename;
@@ -864,6 +882,37 @@ bool LLLocalBitmapMgr::addUnit()
return add_successful;
}
+bool LLLocalBitmapMgr::checkTextureDimensions(std::string filename)
+{
+ std::string exten = gDirUtilp->getExtension(filename);
+ U32 codec = LLImageBase::getCodecFromExtension(exten);
+ std::string mImageLoadError;
+ LLImageDimensionsInfo image_info;
+ if (!image_info.load(filename,codec))
+ {
+ return false;
+ }
+
+ S32 max_width = gSavedSettings.getS32("max_texture_dimension_X");
+ S32 max_height = gSavedSettings.getS32("max_texture_dimension_Y");
+
+ if ((image_info.getWidth() > max_width) || (image_info.getHeight() > max_height))
+ {
+ LLStringUtil::format_map_t args;
+ args["WIDTH"] = llformat("%d", max_width);
+ args["HEIGHT"] = llformat("%d", max_height);
+ mImageLoadError = LLTrans::getString("texture_load_dimensions_error", args);
+
+ LLSD notif_args;
+ notif_args["REASON"] = mImageLoadError;
+ LLNotificationsUtil::add("CannotUploadTexture", notif_args);
+
+ return false;
+ }
+
+ return true;
+}
+
void LLLocalBitmapMgr::delUnit(LLUUID tracking_id)
{
if (!sBitmapList.empty())
diff --git a/indra/newview/lllocalbitmaps.h b/indra/newview/lllocalbitmaps.h
index 2ee84bf46e..59467922b4 100755
--- a/indra/newview/lllocalbitmaps.h
+++ b/indra/newview/lllocalbitmaps.h
@@ -30,11 +30,11 @@
#include "llavatarappearancedefines.h"
#include "lleventtimer.h"
-#include "llimage.h"
#include "llpointer.h"
#include "llwearabletype.h"
class LLScrollListCtrl;
+class LLImageRaw;
class LLViewerObject;
class LLLocalBitmap
@@ -117,8 +117,10 @@ class LLLocalBitmapMgr
~LLLocalBitmapMgr();
public:
+ static void cleanupClass();
static bool addUnit();
static void delUnit(LLUUID tracking_id);
+ static bool checkTextureDimensions(std::string filename);
static LLUUID getWorldID(LLUUID tracking_id);
static std::string getFilename(LLUUID tracking_id);
diff --git a/indra/newview/lllocationhistory.cpp b/indra/newview/lllocationhistory.cpp
index 5138c5e620..680b35b550 100755
--- a/indra/newview/lllocationhistory.cpp
+++ b/indra/newview/lllocationhistory.cpp
@@ -107,11 +107,11 @@ bool LLLocationHistory::getMatchingItems(const std::string& substring, location_
void LLLocationHistory::dump() const
{
- llinfos << "Location history dump:" << llendl;
+ LL_INFOS() << "Location history dump:" << LL_ENDL;
int i = 0;
for (location_list_t::const_iterator it = mItems.begin(); it != mItems.end(); ++it, ++i)
{
- llinfos << "#" << std::setw(2) << std::setfill('0') << i << ": " << it->getLocation() << llendl;
+ LL_INFOS() << "#" << std::setw(2) << std::setfill('0') << i << ": " << it->getLocation() << LL_ENDL;
}
}
@@ -122,7 +122,7 @@ void LLLocationHistory::save() const
if (resolved_filename.empty())
{
- llinfos << "can't get path to location history filename - probably not logged in yet." << llendl;
+ LL_INFOS() << "can't get path to location history filename - probably not logged in yet." << LL_ENDL;
return;
}
@@ -130,7 +130,7 @@ void LLLocationHistory::save() const
llofstream file (resolved_filename);
if (!file.is_open())
{
- llwarns << "can't open location history file \"" << mFilename << "\" for writing" << llendl;
+ LL_WARNS() << "can't open location history file \"" << mFilename << "\" for writing" << LL_ENDL;
return;
}
@@ -144,7 +144,7 @@ void LLLocationHistory::save() const
void LLLocationHistory::load()
{
- llinfos << "Loading location history." << llendl;
+ LL_INFOS() << "Loading location history." << LL_ENDL;
// build filename for each user
std::string resolved_filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, mFilename);
@@ -152,7 +152,7 @@ void LLLocationHistory::load()
if (!file.is_open())
{
- llwarns << "can't load location history from file \"" << mFilename << "\"" << llendl;
+ LL_WARNS() << "can't load location history from file \"" << mFilename << "\"" << LL_ENDL;
return;
}
@@ -166,7 +166,7 @@ void LLLocationHistory::load()
std::istringstream iss(line);
if (parser->parse(iss, s_item, line.length()) == LLSDParser::PARSE_FAILURE)
{
- llinfos<< "Parsing saved teleport history failed" << llendl;
+ LL_INFOS()<< "Parsing saved teleport history failed" << LL_ENDL;
break;
}
diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp
index dbdff11f11..8d21fda8f9 100755
--- a/indra/newview/lllocationinputctrl.cpp
+++ b/indra/newview/lllocationinputctrl.cpp
@@ -107,8 +107,8 @@ public:
private:
/*virtual*/ void done()
{
- uuid_vec_t::const_iterator it = mAdded.begin(), end = mAdded.end();
- for(; it != end; ++it)
+ const uuid_set_t& added = gInventory.getAddedIDs();
+ for (uuid_set_t::const_iterator it = added.begin(); it != added.end(); ++it)
{
LLInventoryItem* item = gInventory.getItem(*it);
if (!item || item->getType() != LLAssetType::AT_LANDMARK)
@@ -124,8 +124,6 @@ private:
mInput->onLandmarkLoaded(lm);
}
}
-
- mAdded.clear();
}
LLLocationInputCtrl* mInput;
@@ -142,7 +140,11 @@ public:
private:
/*virtual*/ void changed(U32 mask)
{
- if (mask & (~(LLInventoryObserver::LABEL|LLInventoryObserver::INTERNAL|LLInventoryObserver::ADD)))
+ if (mask & (~(LLInventoryObserver::LABEL|
+ LLInventoryObserver::INTERNAL|
+ LLInventoryObserver::ADD|
+ LLInventoryObserver::CREATE|
+ LLInventoryObserver::UPDATE_CREATE)))
{
mInput->updateAddLandmarkButton();
}
@@ -384,7 +386,7 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p)
mLocationContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_navbar.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
if (!mLocationContextMenu)
{
- llwarns << "Error loading navigation bar context menu" << llendl;
+ LL_WARNS() << "Error loading navigation bar context menu" << LL_ENDL;
}
getTextEntry()->setRightMouseUpCallback(boost::bind(&LLLocationInputCtrl::onTextEditorRightClicked,this,_2,_3,_4));
@@ -777,7 +779,7 @@ void LLLocationInputCtrl::refreshLocation()
(mTextEntry && mTextEntry->hasFocus()) ||
(mAddLandmarkBtn->hasFocus()))
{
- llwarns << "Location input should not be refreshed when having focus" << llendl;
+ LL_WARNS() << "Location input should not be refreshed when having focus" << LL_ENDL;
return;
}
diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp
index 90b169ecd3..06e517a861 100755
--- a/indra/newview/lllogchat.cpp
+++ b/indra/newview/lllogchat.cpp
@@ -206,7 +206,11 @@ private:
};
LLLogChat::save_history_signal_t * LLLogChat::sSaveHistorySignal = NULL;
-LLLoadHistoryThread::load_end_signal_t * LLLoadHistoryThread::mLoadEndSignal = NULL;
+
+std::map<LLUUID,LLLoadHistoryThread *> LLLogChat::sLoadHistoryThreads;
+std::map<LLUUID,LLDeleteHistoryThread *> LLLogChat::sDeleteHistoryThreads;
+LLMutex* LLLogChat::sHistoryThreadsMutex = NULL;
+
//static
std::string LLLogChat::makeLogFileName(std::string filename)
@@ -293,7 +297,7 @@ void LLLogChat::saveHistory(const std::string& filename,
if (tmp_filename.empty())
{
std::string warn = "Chat history filename [" + filename + "] is empty!";
- llwarning(warn, 666);
+ LL_WARNS() << warn << LL_ENDL;
llassert(tmp_filename.size());
return;
}
@@ -301,7 +305,7 @@ void LLLogChat::saveHistory(const std::string& filename,
llofstream file (LLLogChat::makeLogFileName(filename), std::ios_base::app);
if (!file.is_open())
{
- llwarns << "Couldn't open chat history log! - " + filename << llendl;
+ LL_WARNS() << "Couldn't open chat history log! - " + filename << LL_ENDL;
return;
}
@@ -337,83 +341,179 @@ void LLLogChat::saveHistory(const std::string& filename,
void LLLogChat::loadChatHistory(const std::string& file_name, std::list<LLSD>& messages, const LLSD& load_params)
{
if (file_name.empty())
- {
- LL_WARNS("LLLogChat::loadChatHistory") << "Session name is Empty!" << LL_ENDL;
- return ;
- }
+ {
+ LL_WARNS("LLLogChat::loadChatHistory") << "Session name is Empty!" << LL_ENDL;
+ return ;
+ }
- bool load_all_history = load_params.has("load_all_history") ? load_params["load_all_history"].asBoolean() : false;
+ bool load_all_history = load_params.has("load_all_history") ? load_params["load_all_history"].asBoolean() : false;
- LLFILE* fptr = LLFile::fopen(LLLogChat::makeLogFileName(file_name), "r");/*Flawfinder: ignore*/
- if (!fptr)
- {
- fptr = LLFile::fopen(LLLogChat::oldLogFileName(file_name), "r");/*Flawfinder: ignore*/
- if (!fptr)
- {
- return; //No previous conversation with this name.
- }
- }
+ LLFILE* fptr = LLFile::fopen(LLLogChat::makeLogFileName(file_name), "r");/*Flawfinder: ignore*/
+ if (!fptr)
+ {
+ fptr = LLFile::fopen(LLLogChat::oldLogFileName(file_name), "r");/*Flawfinder: ignore*/
+ if (!fptr)
+ {
+ return; //No previous conversation with this name.
+ }
+ }
- char buffer[LOG_RECALL_SIZE]; /*Flawfinder: ignore*/
- char *bptr;
- S32 len;
- bool firstline = TRUE;
-
- if (load_all_history || fseek(fptr, (LOG_RECALL_SIZE - 1) * -1 , SEEK_END))
- { //We need to load the whole historyFile or it's smaller than recall size, so get it all.
- firstline = FALSE;
- if (fseek(fptr, 0, SEEK_SET))
- {
- fclose(fptr);
- return;
- }
- }
- while (fgets(buffer, LOG_RECALL_SIZE, fptr) && !feof(fptr))
- {
- len = strlen(buffer) - 1; /*Flawfinder: ignore*/
- for (bptr = (buffer + len); (*bptr == '\n' || *bptr == '\r') && bptr>buffer; bptr--) *bptr='\0';
-
- if (firstline)
- {
- firstline = FALSE;
- continue;
- }
-
- std::string line(buffer);
-
- //updated 1.23 plain text log format requires a space added before subsequent lines in a multilined message
- if (' ' == line[0])
- {
- line.erase(0, MULTI_LINE_PREFIX.length());
- append_to_last_message(messages, '\n' + line);
- }
- else if (0 == len && ('\n' == line[0] || '\r' == line[0]))
- {
- //to support old format's multilined messages with new lines used to divide paragraphs
- append_to_last_message(messages, line);
- }
- else
- {
- LLSD item;
- if (!LLChatLogParser::parse(line, item, load_params))
- {
- item[LL_IM_TEXT] = line;
- }
- messages.push_back(item);
- }
- }
- fclose(fptr);
+ char buffer[LOG_RECALL_SIZE]; /*Flawfinder: ignore*/
+ char *bptr;
+ S32 len;
+ bool firstline = TRUE;
+
+ if (load_all_history || fseek(fptr, (LOG_RECALL_SIZE - 1) * -1 , SEEK_END))
+ { //We need to load the whole historyFile or it's smaller than recall size, so get it all.
+ firstline = FALSE;
+ if (fseek(fptr, 0, SEEK_SET))
+ {
+ fclose(fptr);
+ return;
+ }
+ }
+ while (fgets(buffer, LOG_RECALL_SIZE, fptr) && !feof(fptr))
+ {
+ len = strlen(buffer) - 1; /*Flawfinder: ignore*/
+ for (bptr = (buffer + len); (*bptr == '\n' || *bptr == '\r') && bptr>buffer; bptr--) *bptr='\0';
+
+ if (firstline)
+ {
+ firstline = FALSE;
+ continue;
+ }
+ std::string line(buffer);
+ //updated 1.23 plain text log format requires a space added before subsequent lines in a multilined message
+ if (' ' == line[0])
+ {
+ line.erase(0, MULTI_LINE_PREFIX.length());
+ append_to_last_message(messages, '\n' + line);
+ }
+ else if (0 == len && ('\n' == line[0] || '\r' == line[0]))
+ {
+ //to support old format's multilined messages with new lines used to divide paragraphs
+ append_to_last_message(messages, line);
+ }
+ else
+ {
+ LLSD item;
+ if (!LLChatLogParser::parse(line, item, load_params))
+ {
+ item[LL_IM_TEXT] = line;
+ }
+ messages.push_back(item);
+ }
+ }
+ fclose(fptr);
}
-void LLLogChat::startChatHistoryThread(const std::string& file_name, const LLSD& load_params)
+// static
+bool LLLogChat::historyThreadsFinished(LLUUID session_id)
{
+ LLMutexLock lock(historyThreadsMutex());
+ bool finished = true;
+ std::map<LLUUID,LLLoadHistoryThread *>::iterator it = sLoadHistoryThreads.find(session_id);
+ if (it != sLoadHistoryThreads.end())
+ {
+ finished = it->second->isFinished();
+ }
+ if (!finished)
+ {
+ return false;
+ }
+ std::map<LLUUID,LLDeleteHistoryThread *>::iterator dit = sDeleteHistoryThreads.find(session_id);
+ if (dit != sDeleteHistoryThreads.end())
+ {
+ finished = finished && dit->second->isFinished();
+ }
+ return finished;
+}
- LLLoadHistoryThread* mThread = new LLLoadHistoryThread();
- mThread->start();
- mThread->setHistoryParams(file_name, load_params);
+// static
+LLLoadHistoryThread* LLLogChat::getLoadHistoryThread(LLUUID session_id)
+{
+ LLMutexLock lock(historyThreadsMutex());
+ std::map<LLUUID,LLLoadHistoryThread *>::iterator it = sLoadHistoryThreads.find(session_id);
+ if (it != sLoadHistoryThreads.end())
+ {
+ return it->second;
+ }
+ return NULL;
+}
+
+// static
+LLDeleteHistoryThread* LLLogChat::getDeleteHistoryThread(LLUUID session_id)
+{
+ LLMutexLock lock(historyThreadsMutex());
+ std::map<LLUUID,LLDeleteHistoryThread *>::iterator it = sDeleteHistoryThreads.find(session_id);
+ if (it != sDeleteHistoryThreads.end())
+ {
+ return it->second;
+ }
+ return NULL;
+}
+
+// static
+bool LLLogChat::addLoadHistoryThread(LLUUID& session_id, LLLoadHistoryThread* lthread)
+{
+ LLMutexLock lock(historyThreadsMutex());
+ std::map<LLUUID,LLLoadHistoryThread *>::const_iterator it = sLoadHistoryThreads.find(session_id);
+ if (it != sLoadHistoryThreads.end())
+ {
+ return false;
+ }
+ sLoadHistoryThreads[session_id] = lthread;
+ return true;
}
+
+// static
+bool LLLogChat::addDeleteHistoryThread(LLUUID& session_id, LLDeleteHistoryThread* dthread)
+{
+ LLMutexLock lock(historyThreadsMutex());
+ std::map<LLUUID,LLDeleteHistoryThread *>::const_iterator it = sDeleteHistoryThreads.find(session_id);
+ if (it != sDeleteHistoryThreads.end())
+ {
+ return false;
+ }
+ sDeleteHistoryThreads[session_id] = dthread;
+ return true;
+}
+
+// static
+void LLLogChat::cleanupHistoryThreads()
+{
+ LLMutexLock lock(historyThreadsMutex());
+ std::vector<LLUUID> uuids;
+ std::map<LLUUID,LLLoadHistoryThread *>::iterator lit = sLoadHistoryThreads.begin();
+ for (; lit != sLoadHistoryThreads.end(); lit++)
+ {
+ if (lit->second->isFinished() && sDeleteHistoryThreads[lit->first]->isFinished())
+ {
+ delete lit->second;
+ delete sDeleteHistoryThreads[lit->first];
+ uuids.push_back(lit->first);
+ }
+ }
+ std::vector<LLUUID>::iterator uuid_it = uuids.begin();
+ for ( ;uuid_it != uuids.end(); uuid_it++)
+ {
+ sLoadHistoryThreads.erase(*uuid_it);
+ sDeleteHistoryThreads.erase(*uuid_it);
+ }
+}
+
+//static
+LLMutex* LLLogChat::historyThreadsMutex()
+{
+ if (sHistoryThreadsMutex == NULL)
+ {
+ sHistoryThreadsMutex = new LLMutex(NULL);
+ }
+ return sHistoryThreadsMutex;
+}
+
// static
std::string LLLogChat::oldLogFileName(std::string filename)
{
@@ -475,7 +575,7 @@ void LLLogChat::findTranscriptFiles(std::string pattern, std::vector<std::string
//Add Nearby chat history to the list of transcriptions
list_of_transcriptions.push_back(gDirUtilp->add(dirname, filename));
LLFile::close(filep);
- return;
+ continue;
}
char buffer[LOG_RECALL_SIZE];
@@ -711,7 +811,7 @@ void LLChatLogFormatter::format(const LLSD& im, std::ostream& ostr) const
{
if (!im.isMap())
{
- llwarning("invalid LLSD type of an instant message", 0);
+ LL_WARNS() << "invalid LLSD type of an instant message" << LL_ENDL;
return;
}
@@ -845,115 +945,186 @@ bool LLChatLogParser::parse(std::string& raw, LLSD& im, const LLSD& parse_params
return true; //parsed name and message text, maybe have a timestamp too
}
+LLDeleteHistoryThread::LLDeleteHistoryThread(std::list<LLSD>* messages, LLLoadHistoryThread* loadThread)
+ : LLActionThread("delete chat history"),
+ mMessages(messages),
+ mLoadThread(loadThread)
+{
+}
+LLDeleteHistoryThread::~LLDeleteHistoryThread()
+{
+}
+void LLDeleteHistoryThread::run()
+{
+ if (mLoadThread != NULL)
+ {
+ mLoadThread->waitFinished();
+ }
+ if (NULL != mMessages)
+ {
+ delete mMessages;
+ }
+ mMessages = NULL;
+ setFinished();
+}
+LLActionThread::LLActionThread(const std::string& name)
+ : LLThread(name),
+ mMutex(NULL),
+ mRunCondition(NULL),
+ mFinished(false)
+{
+}
- LLLoadHistoryThread::LLLoadHistoryThread() : LLThread("load chat history")
- {
- mNewLoad = false;
- }
+LLActionThread::~LLActionThread()
+{
+}
- void LLLoadHistoryThread::run()
+void LLActionThread::waitFinished()
+{
+ mMutex.lock();
+ if (!mFinished)
{
- while (!LLApp::isQuitting())
- {
- if(mNewLoad)
- {
- loadHistory(mFileName,mMessages,mLoadParams);
- shutdown();
- }
- }
+ mMutex.unlock();
+ mRunCondition.wait();
}
- void LLLoadHistoryThread::setHistoryParams(const std::string& file_name, const LLSD& load_params)
+ else
{
- mFileName = file_name;
- mLoadParams = load_params;
- mNewLoad = true;
+ mMutex.unlock();
}
- void LLLoadHistoryThread::loadHistory(const std::string& file_name, std::list<LLSD>& messages, const LLSD& load_params)
- {
+}
- if (file_name.empty())
- {
- LL_WARNS("LLLogChat::loadHistory") << "Session name is Empty!" << LL_ENDL;
- return ;
- }
+void LLActionThread::setFinished()
+{
+ mMutex.lock();
+ mFinished = true;
+ mMutex.unlock();
+ mRunCondition.signal();
+}
- bool load_all_history = load_params.has("load_all_history") ? load_params["load_all_history"].asBoolean() : false;
+LLLoadHistoryThread::LLLoadHistoryThread(const std::string& file_name, std::list<LLSD>* messages, const LLSD& load_params)
+ : LLActionThread("load chat history"),
+ mMessages(messages),
+ mFileName(file_name),
+ mLoadParams(load_params),
+ mNewLoad(true),
+ mLoadEndSignal(NULL)
+{
+}
- LLFILE* fptr = LLFile::fopen(LLLogChat::makeLogFileName(file_name), "r");/*Flawfinder: ignore*/
- if (!fptr)
- {
- fptr = LLFile::fopen(LLLogChat::oldLogFileName(file_name), "r");/*Flawfinder: ignore*/
- if (!fptr)
- {
- mNewLoad = false;
- (*mLoadEndSignal)(messages, file_name);
- return; //No previous conversation with this name.
- }
- }
+LLLoadHistoryThread::~LLLoadHistoryThread()
+{
+}
- char buffer[LOG_RECALL_SIZE]; /*Flawfinder: ignore*/
- char *bptr;
- S32 len;
- bool firstline = TRUE;
+void LLLoadHistoryThread::run()
+{
+ if(mNewLoad)
+ {
+ loadHistory(mFileName, mMessages, mLoadParams);
+ int count = mMessages->size();
+ llinfos << "mMessages->size(): " << count << llendl;
+ setFinished();
+ }
+}
- if (load_all_history || fseek(fptr, (LOG_RECALL_SIZE - 1) * -1 , SEEK_END))
- { //We need to load the whole historyFile or it's smaller than recall size, so get it all.
- firstline = FALSE;
- if (fseek(fptr, 0, SEEK_SET))
- {
- fclose(fptr);
- mNewLoad = false;
- (*mLoadEndSignal)(messages, file_name);
- return;
- }
- }
- while (fgets(buffer, LOG_RECALL_SIZE, fptr) && !feof(fptr))
- {
- len = strlen(buffer) - 1; /*Flawfinder: ignore*/
- for (bptr = (buffer + len); (*bptr == '\n' || *bptr == '\r') && bptr>buffer; bptr--) *bptr='\0';
+void LLLoadHistoryThread::loadHistory(const std::string& file_name, std::list<LLSD>* messages, const LLSD& load_params)
+{
+ if (file_name.empty())
+ {
+ LL_WARNS("LLLogChat::loadHistory") << "Session name is Empty!" << LL_ENDL;
+ return ;
+ }
- if (firstline)
- {
- firstline = FALSE;
- continue;
- }
+ bool load_all_history = load_params.has("load_all_history") ? load_params["load_all_history"].asBoolean() : false;
+ LLFILE* fptr = LLFile::fopen(LLLogChat::makeLogFileName(file_name), "r");/*Flawfinder: ignore*/
- std::string line(buffer);
+ if (!fptr)
+ {
+ fptr = LLFile::fopen(LLLogChat::oldLogFileName(file_name), "r");/*Flawfinder: ignore*/
+ if (!fptr)
+ {
+ mNewLoad = false;
+ (*mLoadEndSignal)(messages, file_name);
+ return; //No previous conversation with this name.
+ }
+ }
- //updated 1.23 plaint text log format requires a space added before subsequent lines in a multilined message
- if (' ' == line[0])
- {
- line.erase(0, MULTI_LINE_PREFIX.length());
- append_to_last_message(messages, '\n' + line);
- }
- else if (0 == len && ('\n' == line[0] || '\r' == line[0]))
- {
- //to support old format's multilined messages with new lines used to divide paragraphs
- append_to_last_message(messages, line);
- }
- else
- {
- LLSD item;
- if (!LLChatLogParser::parse(line, item, load_params))
- {
- item[LL_IM_TEXT] = line;
- }
- messages.push_back(item);
- }
- }
+ char buffer[LOG_RECALL_SIZE]; /*Flawfinder: ignore*/
+
+ char *bptr;
+ S32 len;
+ bool firstline = TRUE;
+
+ if (load_all_history || fseek(fptr, (LOG_RECALL_SIZE - 1) * -1 , SEEK_END))
+ { //We need to load the whole historyFile or it's smaller than recall size, so get it all.
+ firstline = FALSE;
+ if (fseek(fptr, 0, SEEK_SET))
+ {
fclose(fptr);
mNewLoad = false;
(*mLoadEndSignal)(messages, file_name);
+ return;
+ }
}
- //static
- boost::signals2::connection LLLoadHistoryThread::setLoadEndSignal(const load_end_signal_t::slot_type& cb)
+
+ while (fgets(buffer, LOG_RECALL_SIZE, fptr) && !feof(fptr))
{
- if (NULL == mLoadEndSignal)
+ len = strlen(buffer) - 1; /*Flawfinder: ignore*/
+
+ for (bptr = (buffer + len); (*bptr == '\n' || *bptr == '\r') && bptr>buffer; bptr--) *bptr='\0';
+
+
+ if (firstline)
{
- mLoadEndSignal = new load_end_signal_t();
+ firstline = FALSE;
+ continue;
}
+ std::string line(buffer);
- return mLoadEndSignal->connect(cb);
+ //updated 1.23 plaint text log format requires a space added before subsequent lines in a multilined message
+ if (' ' == line[0])
+ {
+ line.erase(0, MULTI_LINE_PREFIX.length());
+ append_to_last_message(*messages, '\n' + line);
+ }
+ else if (0 == len && ('\n' == line[0] || '\r' == line[0]))
+ {
+ //to support old format's multilined messages with new lines used to divide paragraphs
+ append_to_last_message(*messages, line);
+ }
+ else
+ {
+ LLSD item;
+ if (!LLChatLogParser::parse(line, item, load_params))
+ {
+ item[LL_IM_TEXT] = line;
+ }
+ messages->push_back(item);
+ }
}
+
+ fclose(fptr);
+ mNewLoad = false;
+ (*mLoadEndSignal)(messages, file_name);
+}
+
+boost::signals2::connection LLLoadHistoryThread::setLoadEndSignal(const load_end_signal_t::slot_type& cb)
+{
+ if (NULL == mLoadEndSignal)
+ {
+ mLoadEndSignal = new load_end_signal_t();
+ }
+
+ return mLoadEndSignal->connect(cb);
+}
+
+void LLLoadHistoryThread::removeLoadEndSignal(const load_end_signal_t::slot_type& cb)
+{
+ if (NULL != mLoadEndSignal)
+ {
+ mLoadEndSignal->disconnect_all_slots();
+ delete mLoadEndSignal;
+ }
+ mLoadEndSignal = NULL;
+}
diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h
index acee99afa2..ca597599dd 100755
--- a/indra/newview/lllogchat.h
+++ b/indra/newview/lllogchat.h
@@ -26,25 +26,57 @@
#ifndef LL_LLLOGCHAT_H
#define LL_LLLOGCHAT_H
+#include "llthread.h"
class LLChat;
-class LLLoadHistoryThread : public LLThread
+
+class LLActionThread : public LLThread
{
+public:
+ LLActionThread(const std::string& name);
+ ~LLActionThread();
+
+ void waitFinished();
+ bool isFinished() { return mFinished; }
+protected:
+ void setFinished();
private:
- std::string mFileName;
- std::list<LLSD> mMessages;
+ bool mFinished;
+ LLMutex mMutex;
+ LLCondition mRunCondition;
+};
+
+class LLLoadHistoryThread : public LLActionThread
+{
+private:
+ const std::string& mFileName;
+ std::list<LLSD>* mMessages;
LLSD mLoadParams;
bool mNewLoad;
public:
- LLLoadHistoryThread();
-
- void setHistoryParams(const std::string& file_name, const LLSD& load_params);
- virtual void loadHistory(const std::string& file_name, std::list<LLSD>& messages, const LLSD& load_params);
+ LLLoadHistoryThread(const std::string& file_name, std::list<LLSD>* messages, const LLSD& load_params);
+ ~LLLoadHistoryThread();
+ //void setHistoryParams(const std::string& file_name, const LLSD& load_params);
+ virtual void loadHistory(const std::string& file_name, std::list<LLSD>* messages, const LLSD& load_params);
virtual void run();
- typedef boost::signals2::signal<void (std::list<LLSD>& messages,const std::string& file_name)> load_end_signal_t;
- static load_end_signal_t * mLoadEndSignal;
- static boost::signals2::connection setLoadEndSignal(const load_end_signal_t::slot_type& cb);
+ typedef boost::signals2::signal<void (std::list<LLSD>* messages,const std::string& file_name)> load_end_signal_t;
+ load_end_signal_t * mLoadEndSignal;
+ boost::signals2::connection setLoadEndSignal(const load_end_signal_t::slot_type& cb);
+ void removeLoadEndSignal(const load_end_signal_t::slot_type& cb);
+};
+
+class LLDeleteHistoryThread : public LLActionThread
+{
+private:
+ std::list<LLSD>* mMessages;
+ LLLoadHistoryThread* mLoadThread;
+public:
+ LLDeleteHistoryThread(std::list<LLSD>* messages, LLLoadHistoryThread* loadThread);
+ ~LLDeleteHistoryThread();
+
+ virtual void run();
+ static void deleteHistory();
};
class LLLogChat
@@ -73,7 +105,6 @@ public:
static void getListOfTranscriptBackupFiles(std::vector<std::string>& list_of_transcriptions);
static void loadChatHistory(const std::string& file_name, std::list<LLSD>& messages, const LLSD& load_params = LLSD());
- static void startChatHistoryThread(const std::string& file_name, const LLSD& load_params);
typedef boost::signals2::signal<void ()> save_history_signal_t;
static boost::signals2::connection setSaveHistorySignal(const save_history_signal_t::slot_type& cb);
@@ -90,9 +121,21 @@ public:
static bool isTranscriptExist(const LLUUID& avatar_id, bool is_group=false);
static bool isNearbyTranscriptExist();
+ static bool historyThreadsFinished(LLUUID session_id);
+ static LLLoadHistoryThread* getLoadHistoryThread(LLUUID session_id);
+ static LLDeleteHistoryThread* getDeleteHistoryThread(LLUUID session_id);
+ static bool addLoadHistoryThread(LLUUID& session_id, LLLoadHistoryThread* lthread);
+ static bool addDeleteHistoryThread(LLUUID& session_id, LLDeleteHistoryThread* dthread);
+ static void cleanupHistoryThreads();
+
private:
static std::string cleanFileName(std::string filename);
static save_history_signal_t * sSaveHistorySignal;
+
+ static std::map<LLUUID,LLLoadHistoryThread *> sLoadHistoryThreads;
+ static std::map<LLUUID,LLDeleteHistoryThread *> sDeleteHistoryThreads;
+ static LLMutex* sHistoryThreadsMutex;
+ static LLMutex* historyThreadsMutex();
};
/**
diff --git a/indra/newview/llloginhandler.cpp b/indra/newview/llloginhandler.cpp
index 9b4f146332..39f3c0f113 100755
--- a/indra/newview/llloginhandler.cpp
+++ b/indra/newview/llloginhandler.cpp
@@ -96,33 +96,6 @@ bool LLLoginHandler::handle(const LLSD& tokens,
return true;
}
- if (tokens.size() == 1
- && tokens[0].asString() == "show")
- {
- // We're using reg-in-client, so show the XUI login widgets
- LLPanelLogin::showLoginWidgets();
- return true;
- }
-
- if (tokens.size() == 1
- && tokens[0].asString() == "reg")
- {
- LLWindow* window = gViewerWindow->getWindow();
- window->incBusyCount();
- window->setCursor(UI_CURSOR_ARROW);
-
- // Do this first, as it may be slow and we want to keep something
- // on the user's screen as long as possible
- LLWeb::loadURLExternal( "http://join.eniac15.lindenlab.com/" );
-
- window->decBusyCount();
- window->setCursor(UI_CURSOR_ARROW);
-
- // Then hide the window
- window->minimize();
- return true;
- }
-
// Make sure window is visible
LLWindow* window = gViewerWindow->getWindow();
if (window->getMinimized())
diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp
index f681c12747..df59283bc4 100755
--- a/indra/newview/lllogininstance.cpp
+++ b/indra/newview/lllogininstance.cpp
@@ -202,7 +202,7 @@ MandatoryUpdateMachine::MandatoryUpdateMachine(LLLoginInstance & loginInstance,
void MandatoryUpdateMachine::start(void)
{
- llinfos << "starting mandatory update machine" << llendl;
+ LL_INFOS() << "starting mandatory update machine" << LL_ENDL;
if(mUpdaterService.isChecking()) {
switch(mUpdaterService.getState()) {
@@ -268,7 +268,7 @@ MandatoryUpdateMachine::CheckingForUpdate::CheckingForUpdate(MandatoryUpdateMach
void MandatoryUpdateMachine::CheckingForUpdate::enter(void)
{
- llinfos << "entering checking for update" << llendl;
+ LL_INFOS() << "entering checking for update" << LL_ENDL;
mProgressView = gViewerWindow->getProgressView();
mProgressView->setMessage("Looking for update...");
@@ -327,7 +327,7 @@ MandatoryUpdateMachine::Error::Error(MandatoryUpdateMachine & machine):
void MandatoryUpdateMachine::Error::enter(void)
{
- llinfos << "entering error" << llendl;
+ LL_INFOS() << "entering error" << LL_ENDL;
LLNotificationsUtil::add("FailedRequiredUpdateInstall", LLSD(), LLSD(), boost::bind(&MandatoryUpdateMachine::Error::onButtonClicked, this, _1, _2));
}
@@ -358,7 +358,7 @@ MandatoryUpdateMachine::ReadyToInstall::ReadyToInstall(MandatoryUpdateMachine &
void MandatoryUpdateMachine::ReadyToInstall::enter(void)
{
- llinfos << "entering ready to install" << llendl;
+ LL_INFOS() << "entering ready to install" << LL_ENDL;
// Open update ready dialog.
}
@@ -383,7 +383,7 @@ MandatoryUpdateMachine::StartingUpdaterService::StartingUpdaterService(Mandatory
void MandatoryUpdateMachine::StartingUpdaterService::enter(void)
{
- llinfos << "entering start update service" << llendl;
+ LL_INFOS() << "entering start update service" << LL_ENDL;
LLNotificationsUtil::add("UpdaterServiceNotRunning", LLSD(), LLSD(), boost::bind(&MandatoryUpdateMachine::StartingUpdaterService::onButtonClicked, this, _1, _2));
}
@@ -420,7 +420,7 @@ MandatoryUpdateMachine::WaitingForDownload::WaitingForDownload(MandatoryUpdateMa
void MandatoryUpdateMachine::WaitingForDownload::enter(void)
{
- llinfos << "entering waiting for download" << llendl;
+ LL_INFOS() << "entering waiting for download" << LL_ENDL;
mProgressView = gViewerWindow->getProgressView();
mProgressView->setMessage("Downloading update...");
std::ostringstream stream;
@@ -589,7 +589,7 @@ void LLLoginInstance::constructAuthParams(LLPointer<LLCredential> user_credentia
unsigned char hashed_unique_id_string[MD5HEX_STR_SIZE];
if ( ! llHashedUniqueID(hashed_unique_id_string) )
{
- llwarns << "Not providing a unique id in request params" << llendl;
+ LL_WARNS() << "Not providing a unique id in request params" << LL_ENDL;
}
request_params["start"] = construct_start_string();
request_params["skipoptional"] = mSkipOptionalUpdate;
@@ -621,7 +621,7 @@ bool LLLoginInstance::handleLoginEvent(const LLSD& event)
if(!(event.has("state") && event.has("change") && event.has("progress")))
{
- llerrs << "Unknown message from LLLogin: " << event << llendl;
+ LL_ERRS() << "Unknown message from LLLogin: " << event << LL_ENDL;
}
mLoginState = event["state"].asString();
@@ -656,7 +656,7 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event)
// to reconnect or to end the attempt in failure.
if(reason_response == "tos")
{
- llinfos << "LLLoginInstance::handleLoginFailure ToS" << llendl;
+ LL_INFOS() << "LLLoginInstance::handleLoginFailure ToS" << LL_ENDL;
LLSD data(LLSD::emptyMap());
data["message"] = message_response;
@@ -671,7 +671,7 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event)
}
else if(reason_response == "critical")
{
- llinfos << "LLLoginInstance::handleLoginFailure Crit" << llendl;
+ LL_INFOS() << "LLLoginInstance::handleLoginFailure Crit" << LL_ENDL;
LLSD data(LLSD::emptyMap());
data["message"] = message_response;
@@ -696,27 +696,27 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event)
}
else if(reason_response == "update" || gSavedSettings.getBOOL("ForceMandatoryUpdate"))
{
- llinfos << "LLLoginInstance::handleLoginFailure update" << llendl;
+ LL_INFOS() << "LLLoginInstance::handleLoginFailure update" << LL_ENDL;
gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE);
updateApp(true, message_response);
}
else if(reason_response == "optional")
{
- llinfos << "LLLoginInstance::handleLoginFailure optional" << llendl;
+ LL_INFOS() << "LLLoginInstance::handleLoginFailure optional" << LL_ENDL;
updateApp(false, message_response);
}
else
{
- llinfos << "LLLoginInstance::handleLoginFailure attemptComplete" << llendl;
+ LL_INFOS() << "LLLoginInstance::handleLoginFailure attemptComplete" << LL_ENDL;
attemptComplete();
}
}
void LLLoginInstance::handleLoginSuccess(const LLSD& event)
{
- llinfos << "LLLoginInstance::handleLoginSuccess" << llendl;
+ LL_INFOS() << "LLLoginInstance::handleLoginSuccess" << LL_ENDL;
if(gSavedSettings.getBOOL("ForceMandatoryUpdate"))
{
@@ -740,7 +740,7 @@ void LLLoginInstance::handleDisconnect(const LLSD& event)
{
// placeholder
- llinfos << "LLLoginInstance::handleDisconnect placeholder " << llendl;
+ LL_INFOS() << "LLLoginInstance::handleDisconnect placeholder " << LL_ENDL;
}
void LLLoginInstance::handleIndeterminate(const LLSD& event)
@@ -754,7 +754,7 @@ void LLLoginInstance::handleIndeterminate(const LLSD& event)
LLSD message = event.get("data").get("message");
if(message.isDefined())
{
- llinfos << "LLLoginInstance::handleIndeterminate " << message.asString() << llendl;
+ LL_INFOS() << "LLLoginInstance::handleIndeterminate " << message.asString() << LL_ENDL;
LLSD progress_update;
progress_update["desc"] = message;
@@ -766,7 +766,7 @@ bool LLLoginInstance::handleTOSResponse(bool accepted, const std::string& key)
{
if(accepted)
{
- llinfos << "LLLoginInstance::handleTOSResponse: accepted" << llendl;
+ LL_INFOS() << "LLLoginInstance::handleTOSResponse: accepted" << LL_ENDL;
// Set the request data to true and retry login.
mRequestData["params"][key] = true;
@@ -774,7 +774,7 @@ bool LLLoginInstance::handleTOSResponse(bool accepted, const std::string& key)
}
else
{
- llinfos << "LLLoginInstance::handleTOSResponse: attemptComplete" << llendl;
+ LL_INFOS() << "LLLoginInstance::handleTOSResponse: attemptComplete" << LL_ENDL;
attemptComplete();
}
diff --git a/indra/newview/llmainlooprepeater.cpp b/indra/newview/llmainlooprepeater.cpp
index 5c020e6d98..db8d2e4ede 100755
--- a/indra/newview/llmainlooprepeater.cpp
+++ b/indra/newview/llmainlooprepeater.cpp
@@ -81,7 +81,7 @@ bool LLMainLoopRepeater::onMessage(LLSD const & event)
try {
mQueue->pushFront(event);
} catch(LLThreadSafeQueueError & e) {
- llwarns << "could not repeat message (" << e.what() << ")" <<
+ LL_WARNS() << "could not repeat message (" << e.what() << ")" <<
event.asString() << LL_ENDL;
}
return false;
diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp
index a7d6cb5eac..0935691ebc 100755
--- a/indra/newview/llmanip.cpp
+++ b/indra/newview/llmanip.cpp
@@ -62,7 +62,7 @@ F32 LLManip::sHelpTextFadeTime = 2.f;
S32 LLManip::sNumTimesHelpTextShown = 0;
S32 LLManip::sMaxTimesShowHelpText = 5;
F32 LLManip::sGridMaxSubdivisionLevel = 32.f;
-F32 LLManip::sGridMinSubdivisionLevel = 1.f;
+F32 LLManip::sGridMinSubdivisionLevel = 1.f / 32.f;
LLVector2 LLManip::sTickLabelSpacing(60.f, 25.f);
@@ -176,7 +176,7 @@ BOOL LLManip::getManipAxis(LLViewerObject* object, EManipPart manip, LLVector3 &
return TRUE;
}
-F32 LLManip::getSubdivisionLevel(const LLVector3 &reference_point, const LLVector3 &translate_axis, F32 grid_scale, S32 min_pixel_spacing)
+F32 LLManip::getSubdivisionLevel(const LLVector3 &reference_point, const LLVector3 &translate_axis, F32 grid_scale, S32 min_pixel_spacing, F32 min_subdivisions, F32 max_subdivisions)
{
//update current snap subdivision level
LLVector3 cam_to_reference;
@@ -192,7 +192,8 @@ F32 LLManip::getSubdivisionLevel(const LLVector3 &reference_point, const LLVecto
F32 projected_translation_axis_length = (translate_axis % cam_to_reference).magVec();
F32 subdivisions = llmax(projected_translation_axis_length * grid_scale / (current_range / LLViewerCamera::getInstance()->getPixelMeterRatio() * min_pixel_spacing), 0.f);
- subdivisions = llclamp((F32)pow(2.f, llfloor(log(subdivisions) / log(2.f))), 1.f / 32.f, 32.f);
+ // figure out nearest power of 2 that subdivides grid_scale with result > min_pixel_spacing
+ subdivisions = llclamp((F32)pow(2.f, llfloor(log(subdivisions) / log(2.f))), min_subdivisions, max_subdivisions);
return subdivisions;
}
@@ -226,11 +227,11 @@ BOOL LLManip::handleHover(S32 x, S32 y, MASK mask)
setMouseCapture( FALSE );
}
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLManip (active)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLManip (active)" << LL_ENDL;
}
else
{
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLManip (inactive)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLManip (inactive)" << LL_ENDL;
}
gViewerWindow->setCursor(UI_CURSOR_ARROW);
return TRUE;
@@ -548,37 +549,31 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string
BOOL hud_selection = mObjectSelection->getSelectType() == SELECT_TYPE_HUD;
gGL.matrixMode(LLRender::MM_MODELVIEW);
gGL.pushMatrix();
- LLVector3 render_pos = pos;
- if (hud_selection)
{
- F32 zoom_amt = gAgentCamera.mHUDCurZoom;
- F32 inv_zoom_amt = 1.f / zoom_amt;
- // scale text back up to counter-act zoom level
- render_pos = pos * zoom_amt;
- gGL.scalef(inv_zoom_amt, inv_zoom_amt, inv_zoom_amt);
- }
-
- LLColor4 shadow_color = LLColor4::black;
- shadow_color.mV[VALPHA] = color.mV[VALPHA] * 0.5f;
+ LLVector3 render_pos = pos;
+ if (hud_selection)
+ {
+ F32 zoom_amt = gAgentCamera.mHUDCurZoom;
+ F32 inv_zoom_amt = 1.f / zoom_amt;
+ // scale text back up to counter-act zoom level
+ render_pos = pos * zoom_amt;
+ gGL.scalef(inv_zoom_amt, inv_zoom_amt, inv_zoom_amt);
+ }
- if (fractional_portion != 0)
- {
- fraction_string = llformat("%c%02d%s", LLResMgr::getInstance()->getDecimalPoint(), fractional_portion, suffix.c_str());
+ LLColor4 shadow_color = LLColor4::black;
+ shadow_color.mV[VALPHA] = color.mV[VALPHA] * 0.5f;
- gViewerWindow->setup3DViewport(1, -1);
- hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -1.f * big_fontp->getWidthF32(val_string), 3.f, shadow_color, hud_selection);
- hud_render_utf8text(fraction_string, render_pos, *small_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, 1.f, 3.f, shadow_color, hud_selection);
+ if (fractional_portion != 0)
+ {
+ fraction_string = llformat("%c%02d%s", LLResMgr::getInstance()->getDecimalPoint(), fractional_portion, suffix.c_str());
- gViewerWindow->setup3DViewport();
- hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -1.f * big_fontp->getWidthF32(val_string), 3.f, color, hud_selection);
- hud_render_utf8text(fraction_string, render_pos, *small_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, 1.f, 3.f, color, hud_selection);
- }
- else
- {
- gViewerWindow->setup3DViewport(1, -1);
- hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(val_string), 3.f, shadow_color, hud_selection);
- gViewerWindow->setup3DViewport();
- hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(val_string), 3.f, color, hud_selection);
+ hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::DROP_SHADOW, -1.f * big_fontp->getWidthF32(val_string), 3.f, color, hud_selection);
+ hud_render_utf8text(fraction_string, render_pos, *small_fontp, LLFontGL::NORMAL, LLFontGL::DROP_SHADOW, 1.f, 3.f, color, hud_selection);
+ }
+ else
+ {
+ hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::DROP_SHADOW, -0.5f * big_fontp->getWidthF32(val_string), 3.f, color, hud_selection);
+ }
}
gGL.popMatrix();
}
diff --git a/indra/newview/llmanip.h b/indra/newview/llmanip.h
index 6263e4244f..1fb05e047a 100755
--- a/indra/newview/llmanip.h
+++ b/indra/newview/llmanip.h
@@ -137,7 +137,7 @@ protected:
LLVector3 getPivotPoint();
void getManipNormal(LLViewerObject* object, EManipPart manip, LLVector3 &normal);
BOOL getManipAxis(LLViewerObject* object, EManipPart manip, LLVector3 &axis);
- F32 getSubdivisionLevel(const LLVector3 &reference_point, const LLVector3 &translate_axis, F32 grid_scale, S32 min_pixel_spacing = MIN_DIVISION_PIXEL_WIDTH);
+ F32 getSubdivisionLevel(const LLVector3 &reference_point, const LLVector3 &translate_axis, F32 grid_scale, S32 min_pixel_spacing = MIN_DIVISION_PIXEL_WIDTH, F32 min_subdivisions = sGridMinSubdivisionLevel, F32 max_subdivisions = sGridMaxSubdivisionLevel);
void renderTickValue(const LLVector3& pos, F32 value, const std::string& suffix, const LLColor4 &color);
void renderTickText(const LLVector3& pos, const std::string& suffix, const LLColor4 &color);
void updateGridSettings();
diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp
index 4cbdfde868..b2350e5a75 100755
--- a/indra/newview/llmaniprotate.cpp
+++ b/indra/newview/llmaniprotate.cpp
@@ -61,6 +61,7 @@
#include "llglheaders.h"
#include "lltrans.h"
#include "llvoavatarself.h"
+#include "llhudrender.h"
const F32 RADIUS_PIXELS = 100.f; // size in screen space
const F32 SQ_RADIUS = RADIUS_PIXELS * RADIUS_PIXELS;
@@ -240,7 +241,7 @@ void LLManipRotate::render()
if (mManipPart == LL_ROT_Z)
{
- mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
+ mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
gGL.pushMatrix();
{
// selected part
@@ -251,7 +252,7 @@ void LLManipRotate::render()
}
else if (mManipPart == LL_ROT_Y)
{
- mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
+ mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
gGL.pushMatrix();
{
gGL.rotatef( 90.f, 1.f, 0.f, 0.f );
@@ -262,7 +263,7 @@ void LLManipRotate::render()
}
else if (mManipPart == LL_ROT_X)
{
- mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
+ mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
gGL.pushMatrix();
{
gGL.rotatef( 90.f, 0.f, 1.f, 0.f );
@@ -273,13 +274,13 @@ void LLManipRotate::render()
}
else if (mManipPart == LL_ROT_ROLL)
{
- mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
+ mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
}
else if (mManipPart == LL_NO_PART)
{
if (mHighlightedPart == LL_NO_PART)
{
- mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
+ mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, 1.f), LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
}
LLGLEnable cull_face(GL_CULL_FACE);
@@ -294,7 +295,7 @@ void LLManipRotate::render()
{
if (mHighlightedPart == LL_ROT_Z)
{
- mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
+ mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
gGL.scalef(mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ]);
// hovering over part
gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 0.f, 1.f, 1.f ), LLColor4( 0.f, 0.f, 1.f, 0.5f ), CIRCLE_STEPS, i);
@@ -312,7 +313,7 @@ void LLManipRotate::render()
gGL.rotatef( 90.f, 1.f, 0.f, 0.f );
if (mHighlightedPart == LL_ROT_Y)
{
- mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
+ mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
gGL.scalef(mManipulatorScales.mV[VY], mManipulatorScales.mV[VY], mManipulatorScales.mV[VY]);
// hovering over part
gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 1.f, 0.f, 1.f ), LLColor4( 0.f, 1.f, 0.f, 0.5f ), CIRCLE_STEPS, i);
@@ -330,7 +331,7 @@ void LLManipRotate::render()
gGL.rotatef( 90.f, 0.f, 1.f, 0.f );
if (mHighlightedPart == LL_ROT_X)
{
- mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
+ mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
gGL.scalef(mManipulatorScales.mV[VX], mManipulatorScales.mV[VX], mManipulatorScales.mV[VX]);
// hovering over part
@@ -346,7 +347,7 @@ void LLManipRotate::render()
if (mHighlightedPart == LL_ROT_ROLL)
{
- mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
+ mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
}
}
@@ -452,6 +453,9 @@ BOOL LLManipRotate::handleMouseDownOnPart( S32 x, S32 y, MASK mask )
// Route future Mouse messages here preemptively. (Release on mouse up.)
setMouseCapture( TRUE );
LLSelectMgr::getInstance()->enableSilhouette(FALSE);
+
+ mHelpTextTimer.reset();
+ sNumTimesHelpTextShown++;
return TRUE;
}
@@ -519,12 +523,12 @@ BOOL LLManipRotate::handleHover(S32 x, S32 y, MASK mask)
drag(x, y);
}
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLManipRotate (active)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLManipRotate (active)" << LL_ENDL;
}
else
{
highlightManipulators(x, y);
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLManipRotate (inactive)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLManipRotate (inactive)" << LL_ENDL;
}
gViewerWindow->setCursor(UI_CURSOR_TOOLROTATE);
@@ -1111,6 +1115,31 @@ void LLManipRotate::renderSnapGuides()
}
}
}
+
+
+ // render help text
+ if (mObjectSelection->getSelectType() != SELECT_TYPE_HUD)
+ {
+ if (mHelpTextTimer.getElapsedTimeF32() < sHelpTextVisibleTime + sHelpTextFadeTime && sNumTimesHelpTextShown < sMaxTimesShowHelpText)
+ {
+ LLVector3 selection_center_start = LLSelectMgr::getInstance()->getSavedBBoxOfSelection().getCenterAgent();
+
+ LLVector3 offset_dir = LLViewerCamera::getInstance()->getUpAxis();
+
+ F32 line_alpha = gSavedSettings.getF32("GridOpacity");
+
+ LLVector3 help_text_pos = selection_center_start + (mRadiusMeters * 3.f * offset_dir);
+ const LLFontGL* big_fontp = LLFontGL::getFontSansSerif();
+
+ std::string help_text = LLTrans::getString("manip_hint1");
+ LLColor4 help_text_color = LLColor4::white;
+ help_text_color.mV[VALPHA] = clamp_rescale(mHelpTextTimer.getElapsedTimeF32(), sHelpTextVisibleTime, sHelpTextVisibleTime + sHelpTextFadeTime, line_alpha, 0.f);
+ hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, false);
+ help_text = LLTrans::getString("manip_hint2");
+ help_text_pos -= offset_dir * mRadiusMeters * 0.4f;
+ hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, false);
+ }
+ }
}
// Returns TRUE if center of sphere is visible. Also sets a bunch of member variables that are used later (e.g. mCenterToCam)
@@ -1211,10 +1240,10 @@ LLQuaternion LLManipRotate::dragUnconstrained( S32 x, S32 y )
F32 dist_from_sphere_center = sqrt(delta_x * delta_x + delta_y * delta_y);
LLVector3 axis = mMouseDown % mMouseCur;
+ F32 angle = atan2(sqrtf(axis * axis), mMouseDown * mMouseCur);
axis.normVec();
- F32 angle = acos(mMouseDown * mMouseCur);
LLQuaternion sphere_rot( angle, axis );
-
+
if (is_approx_zero(1.f - mMouseDown * mMouseCur))
{
return LLQuaternion::DEFAULT;
@@ -1272,9 +1301,9 @@ LLVector3 LLManipRotate::getConstraintAxis()
else
{
#ifndef LL_RELEASE_FOR_DOWNLOAD
- llerrs << "Got bogus hit part in LLManipRotate::getConstraintAxis():" << mManipPart << llendl;
+ LL_ERRS() << "Got bogus hit part in LLManipRotate::getConstraintAxis():" << mManipPart << LL_ENDL;
#else
- llwarns << "Got bogus hit part in LLManipRotate::getConstraintAxis():" << mManipPart << llendl;
+ LL_WARNS() << "Got bogus hit part in LLManipRotate::getConstraintAxis():" << mManipPart << LL_ENDL;
#endif
axis.mV[0] = 1.f;
}
@@ -1609,9 +1638,9 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y )
mInSnapRegime = FALSE;
}
- angle = acos(mMouseCur * mMouseDown);
-
- F32 dir = (mMouseDown % mMouseCur) * constraint_axis; // cross product
+ LLVector3 cross_product = mMouseDown % mMouseCur;
+ angle = atan2(sqrtf(cross_product * cross_product), mMouseCur * mMouseDown);
+ F32 dir = cross_product * constraint_axis; // cross product
if( dir < 0.f )
{
angle *= -1.f;
diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp
index ae0884ac5d..2810941d83 100755
--- a/indra/newview/llmanipscale.cpp
+++ b/indra/newview/llmanipscale.cpp
@@ -59,16 +59,15 @@
#include "v2math.h"
#include "llvoavatar.h"
#include "llmeshrepository.h"
-
+#include "lltrans.h"
const F32 MAX_MANIP_SELECT_DISTANCE_SQUARED = 11.f * 11.f;
const F32 SNAP_GUIDE_SCREEN_OFFSET = 0.05f;
const F32 SNAP_GUIDE_SCREEN_LENGTH = 0.7f;
const F32 SELECTED_MANIPULATOR_SCALE = 1.2f;
const F32 MANIPULATOR_SCALE_HALF_LIFE = 0.07f;
-const S32 NUM_MANIPULATORS = 14;
-const LLManip::EManipPart MANIPULATOR_IDS[NUM_MANIPULATORS] =
+const LLManip::EManipPart MANIPULATOR_IDS[LLManipScale::NUM_MANIPULATORS] =
{
LLManip::LL_CORNER_NNN,
LLManip::LL_CORNER_NNP,
@@ -87,7 +86,7 @@ const LLManip::EManipPart MANIPULATOR_IDS[NUM_MANIPULATORS] =
};
-F32 get_default_max_prim_scale(bool is_flora)
+F32 get_default_max_prim_scale(bool is_flora)
{
// a bit of a hack, but if it's foilage, we don't want to use the
// new larger scale which would result in giant trees and grass
@@ -97,7 +96,7 @@ F32 get_default_max_prim_scale(bool is_flora)
return DEFAULT_MAX_PRIM_SCALE;
}
else
- {
+ {
return DEFAULT_MAX_PRIM_SCALE_NO_MESH;
}
}
@@ -143,18 +142,16 @@ inline void LLManipScale::conditionalHighlight( U32 part, const LLColor4* highli
LLColor4 default_highlight( 1.f, 1.f, 1.f, 1.f );
LLColor4 default_normal( 0.7f, 0.7f, 0.7f, 0.6f );
LLColor4 invisible(0.f, 0.f, 0.f, 0.f);
- F32 manipulator_scale = 1.f;
for (S32 i = 0; i < NUM_MANIPULATORS; i++)
{
if((U32)MANIPULATOR_IDS[i] == part)
{
- manipulator_scale = mManipulatorScales[i];
+ mScaledBoxHandleSize = mManipulatorScales[i] * mBoxHandleSize[i];
break;
}
}
- mScaledBoxHandleSize = mBoxHandleSize * manipulator_scale;
if (mManipPart != (S32)LL_NO_PART && mManipPart != (S32)part)
{
gGL.color4fv( invisible.mV );
@@ -179,9 +176,8 @@ void LLManipScale::handleSelect()
}
LLManipScale::LLManipScale( LLToolComposite* composite )
- :
+ :
LLManip( std::string("Scale"), composite ),
- mBoxHandleSize( 1.f ),
mScaledBoxHandleSize( 1.f ),
mLastMouseX( -1 ),
mLastMouseY( -1 ),
@@ -190,21 +186,22 @@ LLManipScale::LLManipScale( LLToolComposite* composite )
mScaleSnapUnit1(1.f),
mScaleSnapUnit2(1.f),
mSnapRegimeOffset(0.f),
+ mTickPixelSpacing1(0.f),
+ mTickPixelSpacing2(0.f),
mSnapGuideLength(0.f),
- mInSnapRegime(FALSE),
- mScaleSnapValue(0.f)
-{
- mManipulatorScales = new F32[NUM_MANIPULATORS];
+ mSnapRegime(SNAP_REGIME_NONE),
+ mScaleSnappedValue(0.f)
+{
for (S32 i = 0; i < NUM_MANIPULATORS; i++)
{
mManipulatorScales[i] = 1.f;
+ mBoxHandleSize[i] = 1.f;
}
}
LLManipScale::~LLManipScale()
{
for_each(mProjectedManipulators.begin(), mProjectedManipulators.end(), DeletePointer());
- delete[] mManipulatorScales;
}
void LLManipScale::render()
@@ -214,7 +211,8 @@ void LLManipScale::render()
LLGLDepthTest gls_depth(GL_TRUE);
LLGLEnable gl_blend(GL_BLEND);
LLGLEnable gls_alpha_test(GL_ALPHA_TEST);
-
+ LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection();
+
if( canAffectSelection() )
{
gGL.matrixMode(LLRender::MM_MODELVIEW);
@@ -226,51 +224,57 @@ void LLManipScale::render()
}
////////////////////////////////////////////////////////////////////////
- // Calculate size of drag handles
+ // Calculate size of drag handles
const F32 BOX_HANDLE_BASE_SIZE = 50.0f; // box size in pixels = BOX_HANDLE_BASE_SIZE * BOX_HANDLE_BASE_FACTOR
const F32 BOX_HANDLE_BASE_FACTOR = 0.2f;
-
+
LLVector3 center_agent = gAgent.getPosAgentFromGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal());
if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
{
- mBoxHandleSize = BOX_HANDLE_BASE_SIZE * BOX_HANDLE_BASE_FACTOR / (F32) LLViewerCamera::getInstance()->getViewHeightInPixels();
- mBoxHandleSize /= gAgentCamera.mHUDCurZoom;
+ for (S32 i = 0; i < NUM_MANIPULATORS; i++)
+ {
+ mBoxHandleSize[i] = BOX_HANDLE_BASE_SIZE * BOX_HANDLE_BASE_FACTOR / (F32) LLViewerCamera::getInstance()->getViewHeightInPixels();
+ mBoxHandleSize[i] /= gAgentCamera.mHUDCurZoom;
+ }
}
else
{
- F32 range_squared = dist_vec_squared(gAgentCamera.getCameraPositionAgent(), center_agent);
- F32 range_from_agent_squared = dist_vec_squared(gAgent.getPositionAgent(), center_agent);
-
- // Don't draw manip if object too far away
- if (gSavedSettings.getBOOL("LimitSelectDistance"))
+ for (S32 i = 0; i < NUM_MANIPULATORS; i++)
{
- F32 max_select_distance = gSavedSettings.getF32("MaxSelectDistance");
- if (range_from_agent_squared > max_select_distance * max_select_distance)
+ LLVector3 manipulator_pos = bbox.localToAgent(unitVectorToLocalBBoxExtent(partToUnitVector(MANIPULATOR_IDS[i]), bbox));
+ F32 range_squared = dist_vec_squared(gAgentCamera.getCameraPositionAgent(), manipulator_pos);
+ F32 range_from_agent_squared = dist_vec_squared(gAgent.getPositionAgent(), manipulator_pos);
+
+ // Don't draw manip if object too far away
+ if (gSavedSettings.getBOOL("LimitSelectDistance"))
{
- return;
+ F32 max_select_distance = gSavedSettings.getF32("MaxSelectDistance");
+ if (range_from_agent_squared > max_select_distance * max_select_distance)
+ {
+ return;
+ }
}
- }
- if (range_squared > 0.001f * 0.001f)
- {
- // range != zero
- F32 fraction_of_fov = BOX_HANDLE_BASE_SIZE / (F32) LLViewerCamera::getInstance()->getViewHeightInPixels();
- F32 apparent_angle = fraction_of_fov * LLViewerCamera::getInstance()->getView(); // radians
- mBoxHandleSize = (F32) sqrtf(range_squared) * tan(apparent_angle) * BOX_HANDLE_BASE_FACTOR;
- }
- else
- {
- // range == zero
- mBoxHandleSize = BOX_HANDLE_BASE_FACTOR;
+ if (range_squared > 0.001f * 0.001f)
+ {
+ // range != zero
+ F32 fraction_of_fov = BOX_HANDLE_BASE_SIZE / (F32) LLViewerCamera::getInstance()->getViewHeightInPixels();
+ F32 apparent_angle = fraction_of_fov * LLViewerCamera::getInstance()->getView(); // radians
+ mBoxHandleSize[i] = (F32) sqrtf(range_squared) * tan(apparent_angle) * BOX_HANDLE_BASE_FACTOR;
+ }
+ else
+ {
+ // range == zero
+ mBoxHandleSize[i] = BOX_HANDLE_BASE_FACTOR;
+ }
}
}
////////////////////////////////////////////////////////////////////////
// Draw bounding box
- LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection();
LLVector3 pos_agent = bbox.getPositionAgent();
LLQuaternion rot = bbox.getRotation();
@@ -283,7 +287,7 @@ void LLManipScale::render()
rot.getAngleAxis(&angle_radians, &x, &y, &z);
gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z);
-
+
{
LLGLEnable poly_offset(GL_POLYGON_OFFSET_FILL);
glPolygonOffset( -2.f, -2.f);
@@ -345,7 +349,7 @@ BOOL LLManipScale::handleMouseDownOnPart( S32 x, S32 y, MASK mask )
LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection();
LLVector3 box_center_agent = bbox.getCenterAgent();
LLVector3 box_corner_agent = bbox.localToAgent( unitVectorToLocalBBoxExtent( partToUnitVector( mManipPart ), bbox ) );
-
+
updateSnapGuides(bbox);
mDragStartPointGlobal = gAgent.getPosGlobalFromAgent(box_corner_agent);
@@ -372,27 +376,27 @@ BOOL LLManipScale::handleMouseUp(S32 x, S32 y, MASK mask)
if( hasMouseCapture() )
{
- if( (LL_FACE_MIN <= (S32)mManipPart)
+ if( (LL_FACE_MIN <= (S32)mManipPart)
&& ((S32)mManipPart <= LL_FACE_MAX) )
{
sendUpdates(TRUE,TRUE,FALSE);
}
else
- if( (LL_CORNER_MIN <= (S32)mManipPart)
+ if( (LL_CORNER_MIN <= (S32)mManipPart)
&& ((S32)mManipPart <= LL_CORNER_MAX) )
{
sendUpdates(TRUE,TRUE,TRUE);
}
-
+
//send texture update
LLSelectMgr::getInstance()->adjustTexturesByScale(TRUE, getStretchTextures());
-
+
LLSelectMgr::getInstance()->enableSilhouette(TRUE);
mManipPart = LL_NO_PART;
// Might have missed last update due to UPDATE_DELAY timing
LLSelectMgr::getInstance()->sendMultipleUpdate( mLastUpdateFlags );
-
+
//gAgent.setObjectTracking(gSavedSettings.getBOOL("TrackFocusObject"));
LLSelectMgr::getInstance()->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK);
}
@@ -413,15 +417,15 @@ BOOL LLManipScale::handleHover(S32 x, S32 y, MASK mask)
{
drag( x, y );
}
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLManipScale (active)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLManipScale (active)" << LL_ENDL;
}
else
{
- mInSnapRegime = FALSE;
+ mSnapRegime = SNAP_REGIME_NONE;
// not dragging...
highlightManipulators(x, y);
}
-
+
// Patch up textures, if possible.
LLSelectMgr::getInstance()->adjustTexturesByScale(FALSE, getStretchTextures());
@@ -458,7 +462,7 @@ void LLManipScale::highlightManipulators(S32 x, S32 y)
LLMatrix4 projMatrix = LLViewerCamera::getInstance()->getProjection();
LLMatrix4 modelView = LLViewerCamera::getInstance()->getModelview();
transform.initAll(LLVector3(1.f, 1.f, 1.f), bbox.getRotation(), bbox.getPositionAgent());
-
+
transform *= modelView;
transform *= projMatrix;
}
@@ -477,7 +481,7 @@ void LLManipScale::highlightManipulators(S32 x, S32 y)
mManipulatorVertices[numManips++] = LLVector4(max.mV[VX], min.mV[VY], max.mV[VZ], 1.f);
mManipulatorVertices[numManips++] = LLVector4(max.mV[VX], max.mV[VY], min.mV[VZ], 1.f);
mManipulatorVertices[numManips++] = LLVector4(max.mV[VX], max.mV[VY], max.mV[VZ], 1.f);
-
+
// 1-D highlights are applicable iff one object is selected
if( mObjectSelection->getObjectCount() == 1 )
{
@@ -492,13 +496,13 @@ void LLManipScale::highlightManipulators(S32 x, S32 y)
for_each(mProjectedManipulators.begin(), mProjectedManipulators.end(), DeletePointer());
mProjectedManipulators.clear();
-
+
for (S32 i = 0; i < numManips; i++)
{
LLVector4 projectedVertex = mManipulatorVertices[i] * transform;
projectedVertex = projectedVertex * (1.f / projectedVertex.mV[VW]);
- ManipulatorHandle* projManipulator = new ManipulatorHandle(LLVector3(projectedVertex.mV[VX], projectedVertex.mV[VY],
+ ManipulatorHandle* projManipulator = new ManipulatorHandle(LLVector3(projectedVertex.mV[VX], projectedVertex.mV[VY],
projectedVertex.mV[VZ]), MANIPULATOR_IDS[i], (i < 7) ? SCALE_MANIP_CORNER : SCALE_MANIP_FACE);
mProjectedManipulators.insert(projManipulator);
}
@@ -512,19 +516,19 @@ void LLManipScale::highlightManipulators(S32 x, S32 y)
mHighlightedPart = LL_NO_PART;
- for (minpulator_list_t::iterator iter = mProjectedManipulators.begin();
+ for (manipulator_list_t::iterator iter = mProjectedManipulators.begin();
iter != mProjectedManipulators.end(); ++iter)
{
ManipulatorHandle* manipulator = *iter;
{
- manip2d.setVec(manipulator->mPosition.mV[VX] * half_width, manipulator->mPosition.mV[VY] * half_height);
-
+ manip2d.set(manipulator->mPosition.mV[VX] * half_width, manipulator->mPosition.mV[VY] * half_height);
+
delta = manip2d - mousePos;
- if (delta.magVecSquared() < MAX_MANIP_SELECT_DISTANCE_SQUARED)
+ if (delta.lengthSquared() < MAX_MANIP_SELECT_DISTANCE_SQUARED)
{
mHighlightedPart = manipulator->mManipID;
- //llinfos << "Tried: " << mHighlightedPart << llendl;
+ //LL_INFOS() << "Tried: " << mHighlightedPart << LL_ENDL;
break;
}
}
@@ -535,50 +539,50 @@ void LLManipScale::highlightManipulators(S32 x, S32 y)
{
if (mHighlightedPart == MANIPULATOR_IDS[i])
{
- mManipulatorScales[i] = lerp(mManipulatorScales[i], SELECTED_MANIPULATOR_SCALE, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
+ mManipulatorScales[i] = lerp(mManipulatorScales[i], SELECTED_MANIPULATOR_SCALE, LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
}
else
{
- mManipulatorScales[i] = lerp(mManipulatorScales[i], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
+ mManipulatorScales[i] = lerp(mManipulatorScales[i], 1.f, LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE));
}
}
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLManipScale (inactive)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLManipScale (inactive)" << LL_ENDL;
}
void LLManipScale::renderFaces( const LLBBox& bbox )
{
- // Don't bother to render the drag handles for 1-D scaling if
+ // Don't bother to render the drag handles for 1-D scaling if
// more than one object is selected or if it is an attachment
if ( mObjectSelection->getObjectCount() > 1 )
{
return;
}
- // This is a flattened representation of the box as render here
- // .
- // (+++) (++-) /|\t
- // +------------+ | (texture coordinates)
- // | | |
- // | 1 | (*) --->s
- // | +X |
+ // This is a flattened representation of the box as render here
+ // .
+ // (+++) (++-) /|\t
+ // +------------+ | (texture coordinates)
+ // | | |
+ // | 1 | (*) --->s
+ // | +X |
// | |
- // (+++) (+-+)| |(+--) (++-) (+++)
- // +------------+------------+------------+------------+
- // |0 3|3 7|7 4|4 0|
- // | 0 | 4 | 5 | 2 |
- // | +Z | -Y | -Z | +Y |
- // | | | | |
- // |1 2|2 6|6 5|5 1|
- // +------------+------------+------------+------------+
- // (-++) (--+)| |(---) (-+-) (-++)
- // | 3 |
- // | -X |
- // | |
- // | |
- // +------------+
- // (-++) (-+-)
+ // (+++) (+-+)| |(+--) (++-) (+++)
+ // +------------+------------+------------+------------+
+ // |0 3|3 7|7 4|4 0|
+ // | 0 | 4 | 5 | 2 |
+ // | +Z | -Y | -Z | +Y |
+ // | | | | |
+ // |1 2|2 6|6 5|5 1|
+ // +------------+------------+------------+------------+
+ // (-++) (--+)| |(---) (-+-) (-++)
+ // | 3 |
+ // | -X |
+ // | |
+ // | |
+ // +------------+
+ // (-++) (-+-)
LLColor4 highlight_color( 1.f, 1.f, 1.f, 0.5f);
LLColor4 normal_color( 1.f, 1.f, 1.f, 0.3f);
@@ -602,7 +606,7 @@ void LLManipScale::renderFaces( const LLBBox& bbox )
{
gGL.color4fv( default_normal_color.mV );
LLGLDepthTest gls_depth(GL_FALSE);
- gGL.begin(LLRender::QUADS);
+ gGL.begin(LLRender::QUADS);
{
// Face 0
gGL.vertex3f(min.mV[VX], max.mV[VY], max.mV[VZ]);
@@ -645,9 +649,9 @@ void LLManipScale::renderFaces( const LLBBox& bbox )
// Find nearest vertex
LLVector3 orientWRTHead = bbox.agentToLocalBasis( bbox.getCenterAgent() - gAgentCamera.getCameraPositionAgent() );
- U32 nearest =
- (orientWRTHead.mV[0] < 0.0f ? 1 : 0) +
- (orientWRTHead.mV[1] < 0.0f ? 2 : 0) +
+ U32 nearest =
+ (orientWRTHead.mV[0] < 0.0f ? 1 : 0) +
+ (orientWRTHead.mV[1] < 0.0f ? 2 : 0) +
(orientWRTHead.mV[2] < 0.0f ? 4 : 0);
// opposite faces on Linden cubes:
@@ -656,7 +660,7 @@ void LLManipScale::renderFaces( const LLBBox& bbox )
// 2 & 4
// Table of order to draw faces, based on nearest vertex
- static U32 face_list[8][6] = {
+ static U32 face_list[8][6] = {
{ 2,0,1, 4,5,3 }, // v6 F201 F453
{ 2,0,3, 4,5,1 }, // v7 F203 F451
{ 4,0,1, 2,5,3 }, // v5 F401 F253
@@ -677,32 +681,32 @@ void LLManipScale::renderFaces( const LLBBox& bbox )
{
case 0:
conditionalHighlight( LL_FACE_POSZ, &z_highlight_color, &z_normal_color );
- renderAxisHandle( ctr, LLVector3( ctr.mV[VX], ctr.mV[VY], max.mV[VZ] ) );
+ renderAxisHandle( LL_FACE_POSZ, ctr, LLVector3( ctr.mV[VX], ctr.mV[VY], max.mV[VZ] ) );
break;
case 1:
conditionalHighlight( LL_FACE_POSX, &x_highlight_color, &x_normal_color );
- renderAxisHandle( ctr, LLVector3( max.mV[VX], ctr.mV[VY], ctr.mV[VZ] ) );
+ renderAxisHandle( LL_FACE_POSX, ctr, LLVector3( max.mV[VX], ctr.mV[VY], ctr.mV[VZ] ) );
break;
case 2:
conditionalHighlight( LL_FACE_POSY, &y_highlight_color, &y_normal_color );
- renderAxisHandle( ctr, LLVector3( ctr.mV[VX], max.mV[VY], ctr.mV[VZ] ) );
+ renderAxisHandle( LL_FACE_POSY, ctr, LLVector3( ctr.mV[VX], max.mV[VY], ctr.mV[VZ] ) );
break;
case 3:
conditionalHighlight( LL_FACE_NEGX, &x_highlight_color, &x_normal_color );
- renderAxisHandle( ctr, LLVector3( min.mV[VX], ctr.mV[VY], ctr.mV[VZ] ) );
+ renderAxisHandle( LL_FACE_NEGX, ctr, LLVector3( min.mV[VX], ctr.mV[VY], ctr.mV[VZ] ) );
break;
case 4:
conditionalHighlight( LL_FACE_NEGY, &y_highlight_color, &y_normal_color );
- renderAxisHandle( ctr, LLVector3( ctr.mV[VX], min.mV[VY], ctr.mV[VZ] ) );
+ renderAxisHandle( LL_FACE_NEGY, ctr, LLVector3( ctr.mV[VX], min.mV[VY], ctr.mV[VZ] ) );
break;
case 5:
conditionalHighlight( LL_FACE_NEGZ, &z_highlight_color, &z_normal_color );
- renderAxisHandle( ctr, LLVector3( ctr.mV[VX], ctr.mV[VY], min.mV[VZ] ) );
+ renderAxisHandle( LL_FACE_NEGZ, ctr, LLVector3( ctr.mV[VX], ctr.mV[VY], min.mV[VZ] ) );
break;
}
}
@@ -712,10 +716,10 @@ void LLManipScale::renderFaces( const LLBBox& bbox )
void LLManipScale::renderEdges( const LLBBox& bbox )
{
LLVector3 extent = bbox.getExtentLocal();
- F32 edge_width = mBoxHandleSize * .6f;
for( U32 part = LL_EDGE_MIN; part <= LL_EDGE_MAX; part++ )
{
+ F32 edge_width = mBoxHandleSize[part] * .6f;
LLVector3 direction = edgeToUnitVector( part );
LLVector3 center_to_edge = unitVectorToLocalBBoxExtent( direction, bbox );
@@ -723,7 +727,7 @@ void LLManipScale::renderEdges( const LLBBox& bbox )
{
gGL.translatef( center_to_edge.mV[0], center_to_edge.mV[1], center_to_edge.mV[2] );
conditionalHighlight( part );
- gGL.scalef(
+ gGL.scalef(
direction.mV[0] ? edge_width : extent.mV[VX],
direction.mV[1] ? edge_width : extent.mV[VY],
direction.mV[2] ? edge_width : extent.mV[VZ] );
@@ -757,7 +761,7 @@ void LLManipScale::renderCorners( const LLBBox& bbox )
y_offset = bbox.getMaxLocal().mV[VY];
}
x_offset = bbox.getMaxLocal().mV[VX];
- }
+ }
}
@@ -776,14 +780,14 @@ void LLManipScale::renderBoxHandle( F32 x, F32 y, F32 z )
}
-void LLManipScale::renderAxisHandle( const LLVector3& start, const LLVector3& end )
+void LLManipScale::renderAxisHandle( U32 part, const LLVector3& start, const LLVector3& end )
{
if( getShowAxes() )
{
// Draws a single "jacks" style handle: a long, retangular box from start to end.
LLVector3 offset_start = end - start;
- offset_start.normVec();
- offset_start = start + mBoxHandleSize * offset_start;
+ offset_start.normalize();
+ offset_start = start + mBoxHandleSize[part] * offset_start;
LLVector3 delta = end - offset_start;
LLVector3 pos = offset_start + 0.5f * delta;
@@ -791,10 +795,10 @@ void LLManipScale::renderAxisHandle( const LLVector3& start, const LLVector3& en
gGL.pushMatrix();
{
gGL.translatef( pos.mV[VX], pos.mV[VY], pos.mV[VZ] );
- gGL.scalef(
- mBoxHandleSize + llabs(delta.mV[VX]),
- mBoxHandleSize + llabs(delta.mV[VY]),
- mBoxHandleSize + llabs(delta.mV[VZ]));
+ gGL.scalef(
+ mBoxHandleSize[part] + llabs(delta.mV[VX]),
+ mBoxHandleSize[part] + llabs(delta.mV[VY]),
+ mBoxHandleSize[part] + llabs(delta.mV[VZ]));
gBox.render();
}
gGL.popMatrix();
@@ -805,21 +809,20 @@ void LLManipScale::renderAxisHandle( const LLVector3& start, const LLVector3& en
}
}
-
+// General scale call
void LLManipScale::drag( S32 x, S32 y )
{
- if( (LL_FACE_MIN <= (S32)mManipPart)
+ if( (LL_FACE_MIN <= (S32)mManipPart)
&& ((S32)mManipPart <= LL_FACE_MAX) )
{
dragFace( x, y );
}
- else
- if( (LL_CORNER_MIN <= (S32)mManipPart)
+ else if( (LL_CORNER_MIN <= (S32)mManipPart)
&& ((S32)mManipPart <= LL_CORNER_MAX) )
{
dragCorner( x, y );
}
-
+
// store changes to override updates
for (LLObjectSelection::iterator iter = LLSelectMgr::getInstance()->getSelection()->begin();
iter != LLSelectMgr::getInstance()->getSelection()->end(); iter++)
@@ -834,139 +837,108 @@ void LLManipScale::drag( S32 x, S32 y )
selectNode->mLastScale = cur->getScale();
selectNode->mLastPositionLocal = cur->getPosition();
}
- }
+ }
LLSelectMgr::getInstance()->updateSelectionCenter();
- gAgentCamera.clearFocusObject();
+ gAgentCamera.clearFocusObject();
}
-// Scale around the
+// Scale on three axis simultaneously
void LLManipScale::dragCorner( S32 x, S32 y )
{
- LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection();
-
// Suppress scale if mouse hasn't moved.
if (x == mLastMouseX && y == mLastMouseY)
{
- // sendUpdates(TRUE,TRUE,TRUE);
return;
}
-
mLastMouseX = x;
mLastMouseY = y;
- LLVector3d drag_start_point_global = mDragStartPointGlobal;
- LLVector3d drag_start_center_global = mDragStartCenterGlobal;
- LLVector3 drag_start_point_agent = gAgent.getPosAgentFromGlobal(drag_start_point_global);
- LLVector3 drag_start_center_agent = gAgent.getPosAgentFromGlobal(drag_start_center_global);
+ LLVector3 drag_start_point_agent = gAgent.getPosAgentFromGlobal(mDragStartPointGlobal);
+ LLVector3 drag_start_center_agent = gAgent.getPosAgentFromGlobal(mDragStartCenterGlobal);
LLVector3d drag_start_dir_d;
- drag_start_dir_d.setVec(drag_start_point_global - drag_start_center_global);
- LLVector3 drag_start_dir_f;
- drag_start_dir_f.setVec(drag_start_dir_d);
+ drag_start_dir_d.set(mDragStartPointGlobal - mDragStartCenterGlobal);
F32 s = 0;
F32 t = 0;
-
- nearestPointOnLineFromMouse(x, y,
- drag_start_center_agent,
- drag_start_point_agent,
- s, t );
-
- F32 drag_start_dist = dist_vec(drag_start_point_agent, drag_start_center_agent);
+ nearestPointOnLineFromMouse(x, y,
+ drag_start_center_agent,
+ drag_start_point_agent,
+ s, t );
if( s <= 0 ) // we only care about intersections in front of the camera
{
return;
}
+ mDragPointGlobal = lerp(mDragStartCenterGlobal, mDragStartPointGlobal, t);
- LLVector3d drag_point_global = drag_start_center_global + t * drag_start_dir_d;
-
- F32 scale_factor = t;
-
- BOOL uniform = LLManipScale::getUniform();
-
- if( !uniform )
- {
- scale_factor = 0.5f + (scale_factor * 0.5f);
- }
+ LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection();
+ F32 scale_factor = 1.f;
+ F32 max_scale = partToMaxScale(mManipPart, bbox);
+ F32 min_scale = partToMinScale(mManipPart, bbox);
+ BOOL uniform = LLManipScale::getUniform();
// check for snapping
- LLVector3 drag_center_agent = gAgent.getPosAgentFromGlobal(drag_point_global);
LLVector3 mouse_on_plane1;
- getMousePointOnPlaneAgent(mouse_on_plane1, x, y, drag_center_agent, mScalePlaneNormal1);
- LLVector3 mouse_on_plane2;
- getMousePointOnPlaneAgent(mouse_on_plane2, x, y, drag_center_agent, mScalePlaneNormal2);
- LLVector3 mouse_dir_1 = mouse_on_plane1 - mScaleCenter;
- LLVector3 mouse_dir_2 = mouse_on_plane2 - mScaleCenter;
- LLVector3 mouse_to_scale_line_1 = mouse_dir_1 - projected_vec(mouse_dir_1, mScaleDir);
- LLVector3 mouse_to_scale_line_2 = mouse_dir_2 - projected_vec(mouse_dir_2, mScaleDir);
- LLVector3 mouse_to_scale_line_dir_1 = mouse_to_scale_line_1;
- mouse_to_scale_line_dir_1.normVec();
- if (mouse_to_scale_line_dir_1 * mSnapGuideDir1 < 0.f)
- {
- // need to keep sign of mouse offset wrt to snap guide direction
- mouse_to_scale_line_dir_1 *= -1.f;
- }
- LLVector3 mouse_to_scale_line_dir_2 = mouse_to_scale_line_2;
- mouse_to_scale_line_dir_2.normVec();
- if (mouse_to_scale_line_dir_2 * mSnapGuideDir2 < 0.f)
- {
- // need to keep sign of mouse offset wrt to snap guide direction
- mouse_to_scale_line_dir_2 *= -1.f;
- }
+ getMousePointOnPlaneAgent(mouse_on_plane1, x, y, mScaleCenter, mScalePlaneNormal1);
+ mouse_on_plane1 -= mScaleCenter;
- F32 snap_dir_dot_mouse_offset1 = mSnapGuideDir1 * mouse_to_scale_line_dir_1;
- F32 snap_dir_dot_mouse_offset2 = mSnapGuideDir2 * mouse_to_scale_line_dir_2;
-
- F32 dist_from_scale_line_1 = mouse_to_scale_line_1 * mouse_to_scale_line_dir_1;
- F32 dist_from_scale_line_2 = mouse_to_scale_line_2 * mouse_to_scale_line_dir_2;
+ LLVector3 mouse_on_plane2;
+ getMousePointOnPlaneAgent(mouse_on_plane2, x, y, mScaleCenter, mScalePlaneNormal2);
+ mouse_on_plane2 -= mScaleCenter;
- F32 max_scale = partToMaxScale(mManipPart, bbox);
- F32 min_scale = partToMinScale(mManipPart, bbox);
+ LLVector3 projected_drag_pos1 = inverse_projected_vec(mScaleDir, orthogonal_component(mouse_on_plane1, mSnapGuideDir1));
+ LLVector3 projected_drag_pos2 = inverse_projected_vec(mScaleDir, orthogonal_component(mouse_on_plane2, mSnapGuideDir2));
BOOL snap_enabled = gSavedSettings.getBOOL("SnapEnabled");
- if (snap_enabled && dist_from_scale_line_1 > mSnapRegimeOffset * snap_dir_dot_mouse_offset1)
+ if (snap_enabled && (mouse_on_plane1 - projected_drag_pos1) * mSnapGuideDir1 > mSnapRegimeOffset)
{
- mInSnapRegime = TRUE;
- LLVector3 projected_drag_pos = mouse_on_plane1 - (dist_from_scale_line_1 / snap_dir_dot_mouse_offset1) * mSnapGuideDir1;
- F32 drag_dist = (projected_drag_pos - mScaleCenter) * mScaleDir;
+ F32 drag_dist = mScaleDir * projected_drag_pos1; // Projecting the drag position allows for negative results, vs using the length which will result in a "reverse scaling" bug.
- F32 cur_subdivisions = llclamp(getSubdivisionLevel(projected_drag_pos, mScaleDir, mScaleSnapUnit1), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel);
+ F32 cur_subdivisions = llclamp(getSubdivisionLevel(mScaleCenter + projected_drag_pos1, mScaleDir, mScaleSnapUnit1, mTickPixelSpacing1), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel);
F32 snap_dist = mScaleSnapUnit1 / (2.f * cur_subdivisions);
F32 relative_snap_dist = fmodf(drag_dist + snap_dist, mScaleSnapUnit1 / cur_subdivisions);
- mScaleSnapValue = llclamp((drag_dist - (relative_snap_dist - snap_dist)), min_scale, max_scale);
+ mScaleSnappedValue = llclamp((drag_dist - (relative_snap_dist - snap_dist)), min_scale, max_scale);
+ scale_factor = mScaleSnappedValue / dist_vec(drag_start_point_agent, drag_start_center_agent);
+ mScaleSnappedValue /= mScaleSnapUnit1 * 2.f;
+ mSnapRegime = SNAP_REGIME_UPPER;
- scale_factor = mScaleSnapValue / drag_start_dist;
- if( !uniform )
+ if (!uniform)
{
scale_factor *= 0.5f;
}
}
- else if (snap_enabled && dist_from_scale_line_2 > mSnapRegimeOffset * snap_dir_dot_mouse_offset2)
+ else if (snap_enabled && (mouse_on_plane2 - projected_drag_pos2) * mSnapGuideDir2 > mSnapRegimeOffset )
{
- mInSnapRegime = TRUE;
- LLVector3 projected_drag_pos = mouse_on_plane2 - (dist_from_scale_line_2 / snap_dir_dot_mouse_offset2) * mSnapGuideDir2;
- F32 drag_dist = (projected_drag_pos - mScaleCenter) * mScaleDir;
+ F32 drag_dist = mScaleDir * projected_drag_pos2; // Projecting the drag position allows for negative results, vs using the length which will result in a "reverse scaling" bug.
- F32 cur_subdivisions = llclamp(getSubdivisionLevel(projected_drag_pos, mScaleDir, mScaleSnapUnit2), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel);
+ F32 cur_subdivisions = llclamp(getSubdivisionLevel(mScaleCenter + projected_drag_pos2, mScaleDir, mScaleSnapUnit2, mTickPixelSpacing2), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel);
F32 snap_dist = mScaleSnapUnit2 / (2.f * cur_subdivisions);
F32 relative_snap_dist = fmodf(drag_dist + snap_dist, mScaleSnapUnit2 / cur_subdivisions);
- mScaleSnapValue = llclamp((drag_dist - (relative_snap_dist - snap_dist)), min_scale, max_scale);
+ mScaleSnappedValue = llclamp((drag_dist - (relative_snap_dist - snap_dist)), min_scale, max_scale);
+ scale_factor = mScaleSnappedValue / dist_vec(drag_start_point_agent, drag_start_center_agent);
+ mScaleSnappedValue /= mScaleSnapUnit2 * 2.f;
+ mSnapRegime = SNAP_REGIME_LOWER;
- scale_factor = mScaleSnapValue / drag_start_dist;
- if( !uniform )
+ if (!uniform)
{
scale_factor *= 0.5f;
}
}
- else
+ else
{
- mInSnapRegime = FALSE;
+ mSnapRegime = SNAP_REGIME_NONE;
+ scale_factor = t;
+ if (!uniform)
+ {
+ scale_factor = 0.5f + (scale_factor * 0.5f);
+ }
}
+
F32 max_scale_factor = get_default_max_prim_scale() / MIN_PRIM_SCALE;
F32 min_scale_factor = MIN_PRIM_SCALE / get_default_max_prim_scale();
@@ -1008,7 +980,7 @@ void LLManipScale::dragCorner( S32 x, S32 y )
{
const LLVector3& scale = selectNode->mSavedScale;
cur->setScale( scale_factor * scale );
-
+
LLVector3 delta_pos;
LLVector3 original_pos = cur->getPositionEdit();
LLVector3d new_pos_global = drag_global + (selectNode->mSavedPositionGlobal - drag_global) * scale_factor;
@@ -1018,7 +990,7 @@ void LLManipScale::dragCorner( S32 x, S32 y )
}
cur->setPositionAbsoluteGlobal( new_pos_global );
rebuild(cur);
-
+
delta_pos = cur->getPositionEdit() - original_pos;
if (selectNode->mIndividualSelection)
@@ -1059,7 +1031,7 @@ void LLManipScale::dragCorner( S32 x, S32 y )
{
const LLVector3& scale = selectNode->mSavedScale;
cur->setScale( scale_factor * scale, FALSE );
-
+
if (!selectNode->mIndividualSelection)
{
cur->setPosition(selectNode->mSavedPositionLocal * scale_factor);
@@ -1068,19 +1040,14 @@ void LLManipScale::dragCorner( S32 x, S32 y )
rebuild(cur);
}
}
-
-
-
- mDragPointGlobal = drag_point_global;
}
-
+// Scale on a single axis
void LLManipScale::dragFace( S32 x, S32 y )
{
// Suppress scale if mouse hasn't moved.
if (x == mLastMouseX && y == mLastMouseY)
{
- // sendUpdates(TRUE,TRUE,FALSE);
return;
}
@@ -1093,9 +1060,9 @@ void LLManipScale::dragFace( S32 x, S32 y )
LLVector3 drag_start_center_agent = gAgent.getPosAgentFromGlobal(drag_start_center_global);
LLVector3d drag_start_dir_d;
- drag_start_dir_d.setVec(drag_start_point_global - drag_start_center_global);
+ drag_start_dir_d.set(drag_start_point_global - drag_start_center_global);
LLVector3 drag_start_dir_f;
- drag_start_dir_f.setVec(drag_start_dir_d);
+ drag_start_dir_f.set(drag_start_dir_d);
LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection();
@@ -1139,26 +1106,26 @@ void LLManipScale::dragFace( S32 x, S32 y )
if (snap_enabled && dist_from_scale_line > mSnapRegimeOffset)
{
- mInSnapRegime = TRUE;
+ mSnapRegime = static_cast<ESnapRegimes>(SNAP_REGIME_UPPER | SNAP_REGIME_LOWER); // A face drag doesn't have split regimes.
- if (dist_along_scale_line > max_drag_dist)
+ if (dist_along_scale_line > max_drag_dist)
{
- mScaleSnapValue = max_drag_dist;
+ mScaleSnappedValue = max_drag_dist;
LLVector3 clamp_point = mScaleCenter + max_drag_dist * mScaleDir;
- drag_delta.setVec(clamp_point - drag_start_point_agent);
+ drag_delta.set(clamp_point - drag_start_point_agent);
}
else if (dist_along_scale_line < min_drag_dist)
{
- mScaleSnapValue = min_drag_dist;
+ mScaleSnappedValue = min_drag_dist;
LLVector3 clamp_point = mScaleCenter + min_drag_dist * mScaleDir;
- drag_delta.setVec(clamp_point - drag_start_point_agent);
+ drag_delta.set(clamp_point - drag_start_point_agent);
}
else
{
F32 drag_dist = scale_center_to_mouse * mScaleDir;
- F32 cur_subdivisions = llclamp(getSubdivisionLevel(mScaleCenter + mScaleDir * drag_dist, mScaleDir, mScaleSnapUnit1), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel);
+ F32 cur_subdivisions = llclamp(getSubdivisionLevel(mScaleCenter + mScaleDir * drag_dist, mScaleDir, mScaleSnapUnit1, mTickPixelSpacing1), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel);
F32 snap_dist = mScaleSnapUnit1 / (2.f * cur_subdivisions);
F32 relative_snap_dist = fmodf(drag_dist + snap_dist, mScaleSnapUnit1 / cur_subdivisions);
relative_snap_dist -= snap_dist;
@@ -1172,7 +1139,7 @@ void LLManipScale::dragFace( S32 x, S32 y )
drag_dist - max_drag_dist,
drag_dist - min_drag_dist);
- mScaleSnapValue = drag_dist - relative_snap_dist;
+ mScaleSnappedValue = (drag_dist - relative_snap_dist) / (mScaleSnapUnit1 * 2.f);
if (llabs(relative_snap_dist) < snap_dist)
{
@@ -1186,9 +1153,9 @@ void LLManipScale::dragFace( S32 x, S32 y )
}
}
}
- else
+ else
{
- mInSnapRegime = FALSE;
+ mSnapRegime = SNAP_REGIME_NONE;
}
LLVector3 dir_agent;
@@ -1204,7 +1171,7 @@ void LLManipScale::dragFace( S32 x, S32 y )
{
dir_agent = bbox.localToAgentBasis( LLVector3::z_axis );
}
- stretchFace(
+ stretchFace(
projected_vec(drag_start_dir_f, dir_agent) + drag_start_center_agent,
projected_vec(drag_delta, dir_agent));
@@ -1223,7 +1190,7 @@ void LLManipScale::sendUpdates( BOOL send_position_update, BOOL send_scale_updat
U32 update_flags = UPD_NONE;
if (send_position_update) update_flags |= UPD_POSITION;
if (send_scale_update) update_flags |= UPD_SCALE;
-
+
// BOOL send_type = SEND_INDIVIDUALS;
if (corner)
{
@@ -1271,7 +1238,7 @@ void LLManipScale::stretchFace( const LLVector3& drag_start_agent, const LLVecto
S32 axis_index = axis.mV[0] ? 0 : (axis.mV[1] ? 1 : 2 );
LLVector3 delta_local = end_local - start_local;
- F32 delta_local_mag = delta_local.magVec();
+ F32 delta_local_mag = delta_local.length();
LLVector3 dir_local;
if (delta_local_mag == 0.f)
{
@@ -1291,13 +1258,13 @@ void LLManipScale::stretchFace( const LLVector3& drag_start_agent, const LLVecto
LLVector3 scale = cur->getScale();
scale.mV[axis_index] = desired_scale;
cur->setScale(scale, FALSE);
- rebuild(cur);
+ rebuild(cur);
LLVector3 delta_pos;
if( !getUniform() )
{
LLVector3 delta_pos_local = axis * (0.5f * desired_delta_size);
LLVector3d delta_pos_global;
- delta_pos_global.setVec(cur_bbox.localToAgent( delta_pos_local ) - cur_bbox.getCenterAgent());
+ delta_pos_global.set(cur_bbox.localToAgent( delta_pos_local ) - cur_bbox.getCenterAgent());
LLVector3 cur_pos = cur->getPositionEdit();
if (cur->isRootEdit() && !cur->isAttachment())
@@ -1346,7 +1313,7 @@ void LLManipScale::stretchFace( const LLVector3& drag_start_agent, const LLVecto
void LLManipScale::renderGuidelinesPart( const LLBBox& bbox )
{
LLVector3 guideline_start = bbox.getCenterLocal();
-
+
LLVector3 guideline_end = unitVectorToLocalBBoxExtent( partToUnitVector( mManipPart ), bbox );
if (!getUniform())
@@ -1355,7 +1322,7 @@ void LLManipScale::renderGuidelinesPart( const LLBBox& bbox )
}
guideline_end -= guideline_start;
- guideline_end.normVec();
+ guideline_end.normalize();
guideline_end *= LLWorld::getInstance()->getRegionWidthInMeters();
guideline_end += guideline_start;
@@ -1376,26 +1343,27 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox)
LLQuaternion grid_rotation;
LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rotation, grid_scale);
+ bool uniform = LLManipScale::getUniform();
+
LLVector3 box_corner_agent = bbox.localToAgent(unitVectorToLocalBBoxExtent( partToUnitVector( mManipPart ), bbox ));
- mScaleCenter = getUniform() ? bbox.getCenterAgent() : bbox.localToAgent(unitVectorToLocalBBoxExtent( -1.f * partToUnitVector( mManipPart ), bbox ));
+ mScaleCenter = uniform ? bbox.getCenterAgent() : bbox.localToAgent(unitVectorToLocalBBoxExtent( -1.f * partToUnitVector( mManipPart ), bbox ));
mScaleDir = box_corner_agent - mScaleCenter;
- mScaleDir.normVec();
+ mScaleDir.normalize();
if(mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
{
mSnapRegimeOffset = SNAP_GUIDE_SCREEN_OFFSET / gAgentCamera.mHUDCurZoom;
-
}
else
{
- F32 object_distance = dist_vec(mScaleCenter, LLViewerCamera::getInstance()->getOrigin());
+ F32 object_distance = dist_vec(box_corner_agent, LLViewerCamera::getInstance()->getOrigin());
mSnapRegimeOffset = (SNAP_GUIDE_SCREEN_OFFSET * gViewerWindow->getWorldViewWidthRaw() * object_distance) / LLViewerCamera::getInstance()->getPixelMeterRatio();
}
LLVector3 cam_at_axis;
F32 snap_guide_length;
if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
{
- cam_at_axis.setVec(1.f, 0.f, 0.f);
+ cam_at_axis.set(1.f, 0.f, 0.f);
snap_guide_length = SNAP_GUIDE_SCREEN_LENGTH / gAgentCamera.mHUDCurZoom;
}
else
@@ -1404,22 +1372,21 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox)
F32 manipulator_distance = dist_vec(box_corner_agent, LLViewerCamera::getInstance()->getOrigin());
snap_guide_length = (SNAP_GUIDE_SCREEN_LENGTH * gViewerWindow->getWorldViewWidthRaw() * manipulator_distance) / LLViewerCamera::getInstance()->getPixelMeterRatio();
}
-
+
mSnapGuideLength = snap_guide_length / llmax(0.1f, (llmin(mSnapGuideDir1 * cam_at_axis, mSnapGuideDir2 * cam_at_axis)));
LLVector3 off_axis_dir = mScaleDir % cam_at_axis;
- off_axis_dir.normVec();
+ off_axis_dir.normalize();
if( (LL_FACE_MIN <= (S32)mManipPart) && ((S32)mManipPart <= LL_FACE_MAX) )
{
- LLVector3 object_scale = bbox.getMaxLocal();
- object_scale.scaleVec(off_axis_dir * ~bbox.getRotation());
- object_scale.abs();
- if (object_scale.mV[VX] > object_scale.mV[VY] && object_scale.mV[VX] > object_scale.mV[VZ])
+ LLVector3 bbox_relative_cam_dir = off_axis_dir * ~bbox.getRotation();
+ bbox_relative_cam_dir.abs();
+ if (bbox_relative_cam_dir.mV[VX] > bbox_relative_cam_dir.mV[VY] && bbox_relative_cam_dir.mV[VX] > bbox_relative_cam_dir.mV[VZ])
{
mSnapGuideDir1 = LLVector3::x_axis * bbox.getRotation();
}
- else if (object_scale.mV[VY] > object_scale.mV[VZ])
+ else if (bbox_relative_cam_dir.mV[VY] > bbox_relative_cam_dir.mV[VZ])
{
mSnapGuideDir1 = LLVector3::y_axis * bbox.getRotation();
}
@@ -1429,7 +1396,7 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox)
}
LLVector3 scale_snap = grid_scale;
- mScaleSnapUnit1 = scale_snap.scaleVec(partToUnitVector( mManipPart )).magVec();
+ mScaleSnapUnit1 = scale_snap.scaleVec(partToUnitVector( mManipPart )).length();
mScaleSnapUnit2 = mScaleSnapUnit1;
mSnapGuideDir1 *= mSnapGuideDir1 * LLViewerCamera::getInstance()->getUpAxis() > 0.f ? 1.f : -1.f;
mSnapGuideDir2 = mSnapGuideDir1 * -1.f;
@@ -1438,7 +1405,6 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox)
}
else if( (LL_CORNER_MIN <= (S32)mManipPart) && ((S32)mManipPart <= LL_CORNER_MAX) )
{
- LLVector3 local_scale_dir = partToUnitVector( mManipPart );
LLVector3 local_camera_dir;
if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
{
@@ -1446,74 +1412,133 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox)
}
else
{
- local_camera_dir = (LLViewerCamera::getInstance()->getOrigin() - bbox.getCenterAgent()) * ~bbox.getRotation();
- local_camera_dir.normVec();
- }
- local_scale_dir -= projected_vec(local_scale_dir, local_camera_dir);
- local_scale_dir.normVec();
- LLVector3 x_axis_proj_camera = LLVector3::x_axis - projected_vec(LLVector3::x_axis, local_camera_dir);
- x_axis_proj_camera.normVec();
- LLVector3 y_axis_proj_camera = LLVector3::y_axis - projected_vec(LLVector3::y_axis, local_camera_dir);
- y_axis_proj_camera.normVec();
- LLVector3 z_axis_proj_camera = LLVector3::z_axis - projected_vec(LLVector3::z_axis, local_camera_dir);
- z_axis_proj_camera.normVec();
- F32 x_axis_proj = llabs(local_scale_dir * x_axis_proj_camera);
- F32 y_axis_proj = llabs(local_scale_dir * y_axis_proj_camera);
- F32 z_axis_proj = llabs(local_scale_dir * z_axis_proj_camera);
-
- if (x_axis_proj > y_axis_proj && x_axis_proj > z_axis_proj)
- {
- mSnapGuideDir1 = LLVector3::y_axis;
- mScaleSnapUnit2 = grid_scale.mV[VY];
- mSnapGuideDir2 = LLVector3::z_axis;
- mScaleSnapUnit1 = grid_scale.mV[VZ];
- }
- else if (y_axis_proj > z_axis_proj)
- {
- mSnapGuideDir1 = LLVector3::x_axis;
- mScaleSnapUnit2 = grid_scale.mV[VX];
- mSnapGuideDir2 = LLVector3::z_axis;
- mScaleSnapUnit1 = grid_scale.mV[VZ];
- }
- else
- {
- mSnapGuideDir1 = LLVector3::x_axis;
- mScaleSnapUnit2 = grid_scale.mV[VX];
- mSnapGuideDir2 = LLVector3::y_axis;
- mScaleSnapUnit1 = grid_scale.mV[VY];
+ local_camera_dir = (LLViewerCamera::getInstance()->getOrigin() - box_corner_agent) * ~bbox.getRotation();
+ local_camera_dir.normalize();
}
- LLVector3 snap_guide_flip(1.f, 1.f, 1.f);
+ LLVector3 axis_flip;
switch (mManipPart)
{
case LL_CORNER_NNN:
+ axis_flip.set(1.f, 1.f, 1.f);
break;
case LL_CORNER_NNP:
- snap_guide_flip.setVec(1.f, 1.f, -1.f);
+ axis_flip.set(1.f, 1.f, -1.f);
break;
case LL_CORNER_NPN:
- snap_guide_flip.setVec(1.f, -1.f, 1.f);
+ axis_flip.set(1.f, -1.f, 1.f);
break;
case LL_CORNER_NPP:
- snap_guide_flip.setVec(1.f, -1.f, -1.f);
+ axis_flip.set(1.f, -1.f, -1.f);
break;
case LL_CORNER_PNN:
- snap_guide_flip.setVec(-1.f, 1.f, 1.f);
+ axis_flip.set(-1.f, 1.f, 1.f);
break;
case LL_CORNER_PNP:
- snap_guide_flip.setVec(-1.f, 1.f, -1.f);
+ axis_flip.set(-1.f, 1.f, -1.f);
break;
case LL_CORNER_PPN:
- snap_guide_flip.setVec(-1.f, -1.f, 1.f);
+ axis_flip.set(-1.f, -1.f, 1.f);
break;
case LL_CORNER_PPP:
- snap_guide_flip.setVec(-1.f, -1.f, -1.f);
+ axis_flip.set(-1.f, -1.f, -1.f);
+ break;
+ default:
+ break;
+ }
+
+ // account for which side of the object the camera is located and negate appropriate axes
+ local_camera_dir.scaleVec(axis_flip);
+
+ // normalize to object scale
+ LLVector3 bbox_extent = bbox.getExtentLocal();
+ local_camera_dir.scaleVec(LLVector3(1.f / bbox_extent.mV[VX], 1.f / bbox_extent.mV[VY], 1.f / bbox_extent.mV[VZ]));
+
+ S32 scale_face = -1;
+
+ if ((local_camera_dir.mV[VX] > 0.f) == (local_camera_dir.mV[VY] > 0.f))
+ {
+ if ((local_camera_dir.mV[VZ] > 0.f) == (local_camera_dir.mV[VY] > 0.f))
+ {
+ LLVector3 local_camera_dir_abs = local_camera_dir;
+ local_camera_dir_abs.abs();
+ // all neighboring faces of bbox are pointing towards camera or away from camera
+ // use largest magnitude face for snap guides
+ if (local_camera_dir_abs.mV[VX] > local_camera_dir_abs.mV[VY])
+ {
+ if (local_camera_dir_abs.mV[VX] > local_camera_dir_abs.mV[VZ])
+ {
+ scale_face = VX;
+ }
+ else
+ {
+ scale_face = VZ;
+ }
+ }
+ else // y > x
+ {
+ if (local_camera_dir_abs.mV[VY] > local_camera_dir_abs.mV[VZ])
+ {
+ scale_face = VY;
+ }
+ else
+ {
+ scale_face = VZ;
+ }
+ }
+ }
+ else
+ {
+ // z axis facing opposite direction from x and y relative to camera, use x and y for snap guides
+ scale_face = VZ;
+ }
+ }
+ else // x and y axes are facing in opposite directions relative to camera
+ {
+ if ((local_camera_dir.mV[VZ] > 0.f) == (local_camera_dir.mV[VY] > 0.f))
+ {
+ // x axis facing opposite direction from y and z relative to camera, use y and z for snap guides
+ scale_face = VX;
+ }
+ else
+ {
+ // y axis facing opposite direction from x and z relative to camera, use x and z for snap guides
+ scale_face = VY;
+ }
+ }
+
+ switch(scale_face)
+ {
+ case VX:
+ // x axis face being scaled, use y and z for snap guides
+ mSnapGuideDir1 = LLVector3::y_axis.scaledVec(axis_flip);
+ mScaleSnapUnit1 = grid_scale.mV[VZ];
+ mSnapGuideDir2 = LLVector3::z_axis.scaledVec(axis_flip);
+ mScaleSnapUnit2 = grid_scale.mV[VY];
+ break;
+ case VY:
+ // y axis facing being scaled, use x and z for snap guides
+ mSnapGuideDir1 = LLVector3::x_axis.scaledVec(axis_flip);
+ mScaleSnapUnit1 = grid_scale.mV[VZ];
+ mSnapGuideDir2 = LLVector3::z_axis.scaledVec(axis_flip);
+ mScaleSnapUnit2 = grid_scale.mV[VX];
+ break;
+ case VZ:
+ // z axis facing being scaled, use x and y for snap guides
+ mSnapGuideDir1 = LLVector3::x_axis.scaledVec(axis_flip);
+ mScaleSnapUnit1 = grid_scale.mV[VY];
+ mSnapGuideDir2 = LLVector3::y_axis.scaledVec(axis_flip);
+ mScaleSnapUnit2 = grid_scale.mV[VX];
break;
default:
+ mSnapGuideDir1.setZero();
+ mScaleSnapUnit1 = 0.f;
+
+ mSnapGuideDir2.setZero();
+ mScaleSnapUnit2 = 0.f;
break;
}
- mSnapGuideDir1.scaleVec(snap_guide_flip);
- mSnapGuideDir2.scaleVec(snap_guide_flip);
+
mSnapGuideDir1.rotVec(bbox.getRotation());
mSnapGuideDir2.rotVec(bbox.getRotation());
mSnapDir1 = -1.f * mSnapGuideDir2;
@@ -1521,13 +1546,22 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox)
}
mScalePlaneNormal1 = mSnapGuideDir1 % mScaleDir;
- mScalePlaneNormal1.normVec();
+ mScalePlaneNormal1.normalize();
mScalePlaneNormal2 = mSnapGuideDir2 % mScaleDir;
- mScalePlaneNormal2.normVec();
+ mScalePlaneNormal2.normalize();
mScaleSnapUnit1 = mScaleSnapUnit1 / (mSnapDir1 * mScaleDir);
mScaleSnapUnit2 = mScaleSnapUnit2 / (mSnapDir2 * mScaleDir);
+
+ mTickPixelSpacing1 = llround((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir1).length());
+ mTickPixelSpacing2 = llround((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir2).length());
+
+ if (uniform)
+ {
+ mScaleSnapUnit1 *= 0.5f;
+ mScaleSnapUnit2 *= 0.5f;
+ }
}
void LLManipScale::renderSnapGuides(const LLBBox& bbox)
@@ -1537,7 +1571,6 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
return;
}
- F32 max_subdivisions = sGridMaxSubdivisionLevel;
F32 grid_alpha = gSavedSettings.getF32("GridOpacity");
F32 max_point_on_scale_line = partToMaxScale(mManipPart, bbox);
@@ -1551,10 +1584,10 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
LLColor4 tick_color = setupSnapGuideRenderPass(pass);
gGL.begin(LLRender::LINES);
- LLVector3 line_mid = mScaleCenter + (mScaleSnapValue * mScaleDir) + (mSnapGuideDir1 * mSnapRegimeOffset);
- LLVector3 line_start = line_mid - (mScaleDir * (llmin(mScaleSnapValue, mSnapGuideLength * 0.5f)));
- LLVector3 line_end = line_mid + (mScaleDir * llmin(max_point_on_scale_line - mScaleSnapValue, mSnapGuideLength * 0.5f));
-
+ LLVector3 line_mid = mScaleCenter + (mScaleSnappedValue * mScaleDir) + (mSnapGuideDir1 * mSnapRegimeOffset);
+ LLVector3 line_start = line_mid - (mScaleDir * (llmin(mScaleSnappedValue, mSnapGuideLength * 0.5f)));
+ LLVector3 line_end = line_mid + (mScaleDir * llmin(max_point_on_scale_line - mScaleSnappedValue, mSnapGuideLength * 0.5f));
+
gGL.color4f(tick_color.mV[VRED], tick_color.mV[VGREEN], tick_color.mV[VBLUE], tick_color.mV[VALPHA] * 0.1f);
gGL.vertex3fv(line_start.mV);
gGL.color4fv(tick_color.mV);
@@ -1563,9 +1596,9 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
gGL.color4f(tick_color.mV[VRED], tick_color.mV[VGREEN], tick_color.mV[VBLUE], tick_color.mV[VALPHA] * 0.1f);
gGL.vertex3fv(line_end.mV);
- line_mid = mScaleCenter + (mScaleSnapValue * mScaleDir) + (mSnapGuideDir2 * mSnapRegimeOffset);
- line_start = line_mid - (mScaleDir * (llmin(mScaleSnapValue, mSnapGuideLength * 0.5f)));
- line_end = line_mid + (mScaleDir * llmin(max_point_on_scale_line - mScaleSnapValue, mSnapGuideLength * 0.5f));
+ line_mid = mScaleCenter + (mScaleSnappedValue * mScaleDir) + (mSnapGuideDir2 * mSnapRegimeOffset);
+ line_start = line_mid - (mScaleDir * (llmin(mScaleSnappedValue, mSnapGuideLength * 0.5f)));
+ line_end = line_mid + (mScaleDir * llmin(max_point_on_scale_line - mScaleSnappedValue, mSnapGuideLength * 0.5f));
gGL.vertex3fv(line_start.mV);
gGL.color4fv(tick_color.mV);
gGL.vertex3fv(line_mid.mV);
@@ -1578,31 +1611,38 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
{
LLGLDepthTest gls_depth(GL_FALSE);
- F32 dist_grid_axis = (drag_point - mScaleCenter) * mScaleDir;
+ F32 dist_grid_axis = llmax(0.f, (drag_point - mScaleCenter) * mScaleDir);
+
+ F32 smallest_subdivision1 = mScaleSnapUnit1 / sGridMaxSubdivisionLevel;
+ F32 smallest_subdivision2 = mScaleSnapUnit2 / sGridMaxSubdivisionLevel;
+
+ F32 dist_scale_units_1 = dist_grid_axis / smallest_subdivision1;
+ F32 dist_scale_units_2 = dist_grid_axis / smallest_subdivision2;
+
// find distance to nearest smallest grid unit
- F32 grid_offset1 = fmodf(dist_grid_axis, mScaleSnapUnit1 / max_subdivisions);
- F32 grid_offset2 = fmodf(dist_grid_axis, mScaleSnapUnit2 / max_subdivisions);
+ F32 grid_multiple1 = llfloor(dist_scale_units_1);
+ F32 grid_multiple2 = llfloor(dist_scale_units_2);
+ F32 grid_offset1 = fmodf(dist_grid_axis, smallest_subdivision1);
+ F32 grid_offset2 = fmodf(dist_grid_axis, smallest_subdivision2);
// how many smallest grid units are we away from largest grid scale?
- S32 sub_div_offset_1 = llround(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 / sGridMinSubdivisionLevel) / (mScaleSnapUnit1 / max_subdivisions));
- S32 sub_div_offset_2 = llround(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 / sGridMinSubdivisionLevel) / (mScaleSnapUnit2 / max_subdivisions));
+ S32 sub_div_offset_1 = llround(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 / sGridMinSubdivisionLevel) / smallest_subdivision1);
+ S32 sub_div_offset_2 = llround(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 / sGridMinSubdivisionLevel) / smallest_subdivision2);
- S32 num_ticks_per_side1 = llmax(1, lltrunc(0.5f * mSnapGuideLength / (mScaleSnapUnit1 / max_subdivisions)));
- S32 num_ticks_per_side2 = llmax(1, lltrunc(0.5f * mSnapGuideLength / (mScaleSnapUnit2 / max_subdivisions)));
- F32 dist_scale_units_1 = dist_grid_axis / (mScaleSnapUnit1 / max_subdivisions);
- F32 dist_scale_units_2 = dist_grid_axis / (mScaleSnapUnit2 / max_subdivisions);
+ S32 num_ticks_per_side1 = llmax(1, lltrunc(0.5f * mSnapGuideLength / smallest_subdivision1));
+ S32 num_ticks_per_side2 = llmax(1, lltrunc(0.5f * mSnapGuideLength / smallest_subdivision2));
S32 ticks_from_scale_center_1 = lltrunc(dist_scale_units_1);
S32 ticks_from_scale_center_2 = lltrunc(dist_scale_units_2);
- S32 max_ticks1 = llceil(max_point_on_scale_line / (mScaleSnapUnit1 / max_subdivisions) - dist_scale_units_1);
- S32 max_ticks2 = llceil(max_point_on_scale_line / (mScaleSnapUnit2 / max_subdivisions) - dist_scale_units_2);
+ S32 max_ticks1 = llceil(max_point_on_scale_line / smallest_subdivision1 - dist_scale_units_1);
+ S32 max_ticks2 = llceil(max_point_on_scale_line / smallest_subdivision2 - dist_scale_units_2);
S32 start_tick = 0;
S32 stop_tick = 0;
- if (mInSnapRegime)
+ if (mSnapRegime != SNAP_REGIME_NONE)
{
// draw snap guide line
gGL.begin(LLRender::LINES);
- LLVector3 snap_line_center = mScaleCenter + (mScaleSnapValue * mScaleDir);
+ LLVector3 snap_line_center = bbox.localToAgent(unitVectorToLocalBBoxExtent( partToUnitVector( mManipPart ), bbox ));
LLVector3 snap_line_start = snap_line_center + (mSnapGuideDir1 * mSnapRegimeOffset);
LLVector3 snap_line_end = snap_line_center + (mSnapGuideDir2 * mSnapRegimeOffset);
@@ -1624,22 +1664,22 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
LLVector3 arrow_span = mScaleDir;
arrow_dir = snap_line_start - snap_line_center;
- arrow_dir.normVec();
- gGL.vertex3fv((snap_line_start + arrow_dir * mBoxHandleSize).mV);
- gGL.vertex3fv((snap_line_start + arrow_span * mBoxHandleSize).mV);
- gGL.vertex3fv((snap_line_start - arrow_span * mBoxHandleSize).mV);
+ arrow_dir.normalize();
+ gGL.vertex3fv((snap_line_start + arrow_dir * mSnapRegimeOffset * 0.1f).mV);
+ gGL.vertex3fv((snap_line_start + arrow_span * mSnapRegimeOffset * 0.1f).mV);
+ gGL.vertex3fv((snap_line_start - arrow_span * mSnapRegimeOffset * 0.1f).mV);
arrow_dir = snap_line_end - snap_line_center;
- arrow_dir.normVec();
- gGL.vertex3fv((snap_line_end + arrow_dir * mBoxHandleSize).mV);
- gGL.vertex3fv((snap_line_end + arrow_span * mBoxHandleSize).mV);
- gGL.vertex3fv((snap_line_end - arrow_span * mBoxHandleSize).mV);
+ arrow_dir.normalize();
+ gGL.vertex3fv((snap_line_end + arrow_dir * mSnapRegimeOffset * 0.1f).mV);
+ gGL.vertex3fv((snap_line_end + arrow_span * mSnapRegimeOffset * 0.1f).mV);
+ gGL.vertex3fv((snap_line_end - arrow_span * mSnapRegimeOffset * 0.1f).mV);
}
gGL.end();
}
-
+
LLVector2 screen_translate_axis(llabs(mScaleDir * LLViewerCamera::getInstance()->getLeftAxis()), llabs(mScaleDir * LLViewerCamera::getInstance()->getUpAxis()));
- screen_translate_axis.normVec();
+ screen_translate_axis.normalize();
S32 tick_label_spacing = llround(screen_translate_axis * sTickLabelSpacing);
@@ -1655,17 +1695,17 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
for (S32 i = start_tick; i <= stop_tick; i++)
{
F32 alpha = (1.f - (1.f * ((F32)llabs(i) / (F32)num_ticks_per_side1)));
- LLVector3 tick_pos = drag_point + (mScaleDir * (mScaleSnapUnit1 / max_subdivisions * (F32)i - grid_offset1));
+ LLVector3 tick_pos = mScaleCenter + (mScaleDir * (grid_multiple1 + i) * smallest_subdivision1);
- F32 cur_subdivisions = llclamp(getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit1), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel);
+ F32 cur_subdivisions = llclamp(getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit1, mTickPixelSpacing1), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel);
- if (fmodf((F32)(i + sub_div_offset_1), (max_subdivisions / cur_subdivisions)) != 0.f)
+ if (fmodf((F32)(i + sub_div_offset_1), (sGridMaxSubdivisionLevel / cur_subdivisions)) != 0.f)
{
continue;
}
F32 tick_scale = 1.f;
- for (F32 division_level = max_subdivisions; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f)
+ for (F32 division_level = sGridMaxSubdivisionLevel; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f)
{
if (fmodf((F32)(i + sub_div_offset_1), division_level) == 0.f)
{
@@ -1688,17 +1728,17 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
for (S32 i = start_tick; i <= stop_tick; i++)
{
F32 alpha = (1.f - (1.f * ((F32)llabs(i) / (F32)num_ticks_per_side2)));
- LLVector3 tick_pos = drag_point + (mScaleDir * (mScaleSnapUnit2 / max_subdivisions * (F32)i - grid_offset2));
-
- F32 cur_subdivisions = llclamp(getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit2), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel);
+ LLVector3 tick_pos = mScaleCenter + (mScaleDir * (grid_multiple2 + i) * smallest_subdivision2);
+
+ F32 cur_subdivisions = llclamp(getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit2, mTickPixelSpacing2), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel);
- if (fmodf((F32)(i + sub_div_offset_2), (max_subdivisions / cur_subdivisions)) != 0.f)
+ if (fmodf((F32)(i + sub_div_offset_2), (sGridMaxSubdivisionLevel / cur_subdivisions)) != 0.f)
{
continue;
}
F32 tick_scale = 1.f;
- for (F32 division_level = max_subdivisions; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f)
+ for (F32 division_level = sGridMaxSubdivisionLevel; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f)
{
if (fmodf((F32)(i + sub_div_offset_2), division_level) == 0.f)
{
@@ -1716,21 +1756,21 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
gGL.end();
}
- // render tick labels
+ // render upper tick labels
start_tick = -(llmin(ticks_from_scale_center_1, num_ticks_per_side1));
stop_tick = llmin(max_ticks1, num_ticks_per_side1);
F32 grid_resolution = mObjectSelection->getSelectType() == SELECT_TYPE_HUD ? 0.25f : llmax(gSavedSettings.getF32("GridResolution"), 0.001f);
- S32 label_sub_div_offset_1 = llround(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 * 32.f) / (mScaleSnapUnit1 / max_subdivisions));
- S32 label_sub_div_offset_2 = llround(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 * 32.f) / (mScaleSnapUnit2 / max_subdivisions));
+ S32 label_sub_div_offset_1 = llround(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 * 32.f) / smallest_subdivision1);
+ S32 label_sub_div_offset_2 = llround(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 * 32.f) / smallest_subdivision2);
for (S32 i = start_tick; i <= stop_tick; i++)
{
F32 tick_scale = 1.f;
F32 alpha = grid_alpha * (1.f - (0.5f * ((F32)llabs(i) / (F32)num_ticks_per_side1)));
- LLVector3 tick_pos = drag_point + (mScaleDir * (mScaleSnapUnit1 / max_subdivisions * (F32)i - grid_offset1));
+ LLVector3 tick_pos = mScaleCenter + (mScaleDir * (grid_multiple1 + i) * smallest_subdivision1);
- for (F32 division_level = max_subdivisions; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f)
+ for (F32 division_level = sGridMaxSubdivisionLevel; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f)
{
if (fmodf((F32)(i + label_sub_div_offset_1), division_level) == 0.f)
{
@@ -1739,39 +1779,34 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
tick_scale *= 0.7f;
}
- if (fmodf((F32)(i + label_sub_div_offset_1), (max_subdivisions / llmin(sGridMaxSubdivisionLevel, getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit1, tick_label_spacing)))) == 0.f)
+ if (fmodf((F32)(i + label_sub_div_offset_1), (sGridMaxSubdivisionLevel / llmin(sGridMaxSubdivisionLevel, getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit1, tick_label_spacing)))) == 0.f)
{
- LLVector3 text_origin = tick_pos +
- (mSnapGuideDir1 * mSnapRegimeOffset * (1.f + tick_scale));
-
+ LLVector3 text_origin = tick_pos + (mSnapGuideDir1 * mSnapRegimeOffset * (1.f + tick_scale));
+
EGridMode grid_mode = LLSelectMgr::getInstance()->getGridMode();
- F32 tick_val;
+ F32 tick_value;
if (grid_mode == GRID_MODE_WORLD)
{
- tick_val = (tick_pos - mScaleCenter) * mScaleDir / (mScaleSnapUnit1 / grid_resolution);
+ tick_value = (grid_multiple1 + i) / (sGridMaxSubdivisionLevel / grid_resolution);
}
else
{
- tick_val = (tick_pos - mScaleCenter) * mScaleDir / (mScaleSnapUnit1 * 2.f);
- }
-
- if (getUniform())
- {
- tick_val *= 2.f;
+ tick_value = (grid_multiple1 + i) / (2.f * sGridMaxSubdivisionLevel);
}
F32 text_highlight = 0.8f;
- if (is_approx_equal(tick_val, mScaleSnapValue) && mInSnapRegime)
+ // Highlight this text if the tick value matches the snapped to value, and if either the second set of ticks isn't going to be shown or cursor is in the first snap regime.
+ if (is_approx_equal(tick_value, mScaleSnappedValue) && (mScaleSnapUnit2 == mScaleSnapUnit1 || (mSnapRegime & SNAP_REGIME_UPPER)))
{
text_highlight = 1.f;
}
- renderTickValue(text_origin, tick_val, grid_mode == GRID_MODE_WORLD ? std::string("m") : std::string("x"), LLColor4(text_highlight, text_highlight, text_highlight, alpha));
+ renderTickValue(text_origin, tick_value, grid_mode == GRID_MODE_WORLD ? std::string("m") : std::string("x"), LLColor4(text_highlight, text_highlight, text_highlight, alpha));
}
}
- // label ticks on opposite side
+ // label ticks on opposite side, only can happen in scaling modes that effect more than one axis and when the object's axis don't have the same scale. A differing scale indicates both conditions.
if (mScaleSnapUnit2 != mScaleSnapUnit1)
{
start_tick = -(llmin(ticks_from_scale_center_2, num_ticks_per_side2));
@@ -1780,9 +1815,9 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
{
F32 tick_scale = 1.f;
F32 alpha = grid_alpha * (1.f - (0.5f * ((F32)llabs(i) / (F32)num_ticks_per_side2)));
- LLVector3 tick_pos = drag_point + (mScaleDir * (mScaleSnapUnit2 / max_subdivisions * (F32)i - grid_offset2));
+ LLVector3 tick_pos = mScaleCenter + (mScaleDir * (grid_multiple2 + i) * smallest_subdivision2);
- for (F32 division_level = max_subdivisions; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f)
+ for (F32 division_level = sGridMaxSubdivisionLevel; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f)
{
if (fmodf((F32)(i + label_sub_div_offset_2), division_level) == 0.f)
{
@@ -1791,35 +1826,29 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
tick_scale *= 0.7f;
}
- if (fmodf((F32)(i + label_sub_div_offset_2), (max_subdivisions / llmin(max_subdivisions, getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit2, tick_label_spacing)))) == 0.f)
+ if (fmodf((F32)(i + label_sub_div_offset_2), (sGridMaxSubdivisionLevel / llmin(sGridMaxSubdivisionLevel, getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit2, tick_label_spacing)))) == 0.f)
{
- LLVector3 text_origin = tick_pos +
- (mSnapGuideDir2 * mSnapRegimeOffset * (1.f + tick_scale));
+ LLVector3 text_origin = tick_pos + (mSnapGuideDir2 * mSnapRegimeOffset * (1.f + tick_scale));
EGridMode grid_mode = LLSelectMgr::getInstance()->getGridMode();
- F32 tick_val;
+ F32 tick_value;
if (grid_mode == GRID_MODE_WORLD)
{
- tick_val = (tick_pos - mScaleCenter) * mScaleDir / (mScaleSnapUnit2 / grid_resolution);
+ tick_value = (grid_multiple2 + i) / (sGridMaxSubdivisionLevel / grid_resolution);
}
else
{
- tick_val = (tick_pos - mScaleCenter) * mScaleDir / (mScaleSnapUnit2 * 2.f);
- }
-
- if (getUniform())
- {
- tick_val *= 2.f;
+ tick_value = (grid_multiple2 + i) / (2.f * sGridMaxSubdivisionLevel);
}
F32 text_highlight = 0.8f;
- if (is_approx_equal(tick_val, mScaleSnapValue) && mInSnapRegime)
+ if (is_approx_equal(tick_value, mScaleSnappedValue) && (mSnapRegime & SNAP_REGIME_LOWER))
{
text_highlight = 1.f;
}
- renderTickValue(text_origin, tick_val, grid_mode == GRID_MODE_WORLD ? std::string("m") : std::string("x"), LLColor4(text_highlight, text_highlight, text_highlight, alpha));
+ renderTickValue(text_origin, tick_value, grid_mode == GRID_MODE_WORLD ? std::string("m") : std::string("x"), LLColor4(text_highlight, text_highlight, text_highlight, alpha));
}
}
}
@@ -1845,13 +1874,13 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
LLVector3 help_text_pos = selection_center_start + (mSnapRegimeOffset * 5.f * offset_dir);
const LLFontGL* big_fontp = LLFontGL::getFontSansSerif();
- std::string help_text = "Move mouse cursor over ruler";
+ std::string help_text = LLTrans::getString("manip_hint1");
LLColor4 help_text_color = LLColor4::white;
help_text_color.mV[VALPHA] = clamp_rescale(mHelpTextTimer.getElapsedTimeF32(), sHelpTextVisibleTime, sHelpTextVisibleTime + sHelpTextFadeTime, grid_alpha, 0.f);
- hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD);
- help_text = "to snap to grid";
+ hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, false);
+ help_text = LLTrans::getString("manip_hint2");
help_text_pos -= LLViewerCamera::getInstance()->getUpAxis() * mSnapRegimeOffset * 0.4f;
- hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD);
+ hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, false);
}
}
}
@@ -1860,17 +1889,15 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
// Returns unit vector in direction of part of an origin-centered cube
LLVector3 LLManipScale::partToUnitVector( S32 part ) const
{
- if( (LL_FACE_MIN <= part) && (part <= LL_FACE_MAX) )
+ if ( (LL_FACE_MIN <= part) && (part <= LL_FACE_MAX) )
{
return faceToUnitVector( part );
}
- else
- if( (LL_CORNER_MIN <= part) && (part <= LL_CORNER_MAX) )
+ else if ( (LL_CORNER_MIN <= part) && (part <= LL_CORNER_MAX) )
{
return cornerToUnitVector( part );
}
- else
- if( (LL_EDGE_MIN <= part) && (part <= LL_EDGE_MAX ) )
+ else if ( (LL_EDGE_MIN <= part) && (part <= LL_EDGE_MAX ) )
{
return edgeToUnitVector( part );
}
@@ -1882,27 +1909,32 @@ LLVector3 LLManipScale::partToUnitVector( S32 part ) const
LLVector3 LLManipScale::faceToUnitVector( S32 part ) const
{
llassert( (LL_FACE_MIN <= part) && (part <= LL_FACE_MAX) );
+ LLVector3 vec;
switch( part )
{
case LL_FACE_POSX:
- return LLVector3( 1.f, 0.f, 0.f );
-
+ vec.set( 1.f, 0.f, 0.f );
+ break;
case LL_FACE_NEGX:
- return LLVector3( -1.f, 0.f, 0.f );
-
+ vec.set( -1.f, 0.f, 0.f );
+ break;
case LL_FACE_POSY:
- return LLVector3( 0.f, 1.f, 0.f );
-
+ vec.set( 0.f, 1.f, 0.f );
+ break;
case LL_FACE_NEGY:
- return LLVector3( 0.f, -1.f, 0.f );
-
+ vec.set( 0.f, -1.f, 0.f );
+ break;
case LL_FACE_POSZ:
- return LLVector3( 0.f, 0.f, 1.f );
-
+ vec.set( 0.f, 0.f, 1.f );
+ break;
case LL_FACE_NEGZ:
- return LLVector3( 0.f, 0.f, -1.f );
+ vec.set( 0.f, 0.f, -1.f );
+ break;
+ default:
+ vec.clear();
}
- return LLVector3();
+
+ return vec;
}
@@ -1914,31 +1946,31 @@ LLVector3 LLManipScale::cornerToUnitVector( S32 part ) const
switch(part)
{
case LL_CORNER_NNN:
- vec.setVec(-F_SQRT3, -F_SQRT3, -F_SQRT3);
+ vec.set(-OO_SQRT3, -OO_SQRT3, -OO_SQRT3);
break;
- case LL_CORNER_NNP:
- vec.setVec(-F_SQRT3, -F_SQRT3, F_SQRT3);
+ case LL_CORNER_NNP:
+ vec.set(-OO_SQRT3, -OO_SQRT3, OO_SQRT3);
break;
case LL_CORNER_NPN:
- vec.setVec(-F_SQRT3, F_SQRT3, -F_SQRT3);
+ vec.set(-OO_SQRT3, OO_SQRT3, -OO_SQRT3);
break;
case LL_CORNER_NPP:
- vec.setVec(-F_SQRT3, F_SQRT3, F_SQRT3);
+ vec.set(-OO_SQRT3, OO_SQRT3, OO_SQRT3);
break;
case LL_CORNER_PNN:
- vec.setVec(F_SQRT3, -F_SQRT3, -F_SQRT3);
+ vec.set(OO_SQRT3, -OO_SQRT3, -OO_SQRT3);
break;
case LL_CORNER_PNP:
- vec.setVec(F_SQRT3, -F_SQRT3, F_SQRT3);
+ vec.set(OO_SQRT3, -OO_SQRT3, OO_SQRT3);
break;
case LL_CORNER_PPN:
- vec.setVec(F_SQRT3, F_SQRT3, -F_SQRT3);
+ vec.set(OO_SQRT3, OO_SQRT3, -OO_SQRT3);
break;
case LL_CORNER_PPP:
- vec.setVec(F_SQRT3, F_SQRT3, F_SQRT3);
+ vec.set(OO_SQRT3, OO_SQRT3, OO_SQRT3);
break;
default:
- vec.clearVec();
+ vec.clear();
}
return vec;
@@ -1965,8 +1997,8 @@ LLVector3 LLManipScale::unitVectorToLocalBBoxExtent( const LLVector3& v, const L
LLVector3 ctr = bbox.getCenterLocal();
return LLVector3(
- v.mV[0] ? (v.mV[0]>0 ? max.mV[0] : min.mV[0] ) : ctr.mV[0],
- v.mV[1] ? (v.mV[1]>0 ? max.mV[1] : min.mV[1] ) : ctr.mV[1],
+ v.mV[0] ? (v.mV[0]>0 ? max.mV[0] : min.mV[0] ) : ctr.mV[0],
+ v.mV[1] ? (v.mV[1]>0 ? max.mV[1] : min.mV[1] ) : ctr.mV[1],
v.mV[2] ? (v.mV[2]>0 ? max.mV[2] : min.mV[2] ) : ctr.mV[2] );
}
@@ -1984,7 +2016,7 @@ F32 LLManipScale::partToMaxScale( S32 part, const LLBBox &bbox ) const
max_extent = bbox_extents.mV[i];
}
}
- max_scale_factor = bbox_extents.magVec() * get_default_max_prim_scale() / max_extent;
+ max_scale_factor = bbox_extents.length() * get_default_max_prim_scale() / max_extent;
if (getUniform())
{
@@ -2007,7 +2039,7 @@ F32 LLManipScale::partToMinScale( S32 part, const LLBBox &bbox ) const
min_extent = bbox_extents.mV[i];
}
}
- F32 min_scale_factor = bbox_extents.magVec() * MIN_PRIM_SCALE / min_extent;
+ F32 min_scale_factor = bbox_extents.length() * MIN_PRIM_SCALE / min_extent;
if (getUniform())
{
@@ -2058,7 +2090,7 @@ LLVector3 LLManipScale::nearestAxis( const LLVector3& v ) const
// virtual
BOOL LLManipScale::canAffectSelection()
{
- // An selection is scalable if you are allowed to both edit and move
+ // An selection is scalable if you are allowed to both edit and move
// everything in it, and it does not have any sitting agents
BOOL can_scale = mObjectSelection->getObjectCount() != 0;
if (can_scale)
diff --git a/indra/newview/llmanipscale.h b/indra/newview/llmanipscale.h
index 5cb8898fd0..7cc3c99810 100755
--- a/indra/newview/llmanipscale.h
+++ b/indra/newview/llmanipscale.h
@@ -51,6 +51,13 @@ typedef enum e_scale_manipulator_type
SCALE_MANIP_FACE
} EScaleManipulatorType;
+typedef enum e_snap_regimes
+{
+ SNAP_REGIME_NONE = 0, //!< The cursor is not in either of the snap regimes.
+ SNAP_REGIME_UPPER = 0x1, //!< The cursor is, non-exclusively, in the first of the snap regimes. Prefer to treat as bitmask.
+ SNAP_REGIME_LOWER = 0x2 //!< The cursor is, non-exclusively, in the second of the snap regimes. Prefer to treat as bitmask.
+} ESnapRegimes;
+
class LLManipScale : public LLManip
{
@@ -64,7 +71,7 @@ public:
ManipulatorHandle(LLVector3 pos, EManipPart id, EScaleManipulatorType type):mPosition(pos), mManipID(id), mType(type){}
};
-
+ static const S32 NUM_MANIPULATORS = 14;
LLManipScale( LLToolComposite* composite );
~LLManipScale();
@@ -91,12 +98,12 @@ private:
void renderFaces( const LLBBox& local_bbox );
void renderEdges( const LLBBox& local_bbox );
void renderBoxHandle( F32 x, F32 y, F32 z );
- void renderAxisHandle( const LLVector3& start, const LLVector3& end );
+ void renderAxisHandle( U32 part, const LLVector3& start, const LLVector3& end );
void renderGuidelinesPart( const LLBBox& local_bbox );
void renderSnapGuides( const LLBBox& local_bbox );
void revert();
-
+
inline void conditionalHighlight( U32 part, const LLColor4* highlight = NULL, const LLColor4* normal = NULL );
void drag( S32 x, S32 y );
@@ -135,34 +142,36 @@ private:
};
- F32 mBoxHandleSize; // The size of the handles at the corners of the bounding box
- F32 mScaledBoxHandleSize; // handle size after scaling for selection feedback
+ F32 mScaledBoxHandleSize; //!< Handle size after scaling for selection feedback.
LLVector3d mDragStartPointGlobal;
- LLVector3d mDragStartCenterGlobal; // The center of the bounding box of all selected objects at time of drag start
+ LLVector3d mDragStartCenterGlobal; //!< The center of the bounding box of all selected objects at time of drag start.
LLVector3d mDragPointGlobal;
LLVector3d mDragFarHitGlobal;
S32 mLastMouseX;
S32 mLastMouseY;
BOOL mSendUpdateOnMouseUp;
U32 mLastUpdateFlags;
- typedef std::set<ManipulatorHandle*, compare_manipulators> minpulator_list_t;
- minpulator_list_t mProjectedManipulators;
+ typedef std::set<ManipulatorHandle*, compare_manipulators> manipulator_list_t;
+ manipulator_list_t mProjectedManipulators;
LLVector4 mManipulatorVertices[14];
- F32 mScaleSnapUnit1; // size of snap multiples for axis 1
- F32 mScaleSnapUnit2; // size of snap multiples for axis 2
- LLVector3 mScalePlaneNormal1; // normal of plane in which scale occurs that most faces camera
- LLVector3 mScalePlaneNormal2; // normal of plane in which scale occurs that most faces camera
- LLVector3 mSnapGuideDir1;
- LLVector3 mSnapGuideDir2;
- LLVector3 mSnapDir1;
- LLVector3 mSnapDir2;
- F32 mSnapRegimeOffset;
+ F32 mScaleSnapUnit1; //!< Size of snap multiples for the upper scale.
+ F32 mScaleSnapUnit2; //!< Size of snap multiples for the lower scale.
+ LLVector3 mScalePlaneNormal1; //!< Normal of plane in which scale occurs that most faces camera.
+ LLVector3 mScalePlaneNormal2; //!< Normal of plane in which scale occurs that most faces camera.
+ LLVector3 mSnapGuideDir1; //!< The direction in which the upper snap guide tick marks face.
+ LLVector3 mSnapGuideDir2; //!< The direction in which the lower snap guide tick marks face.
+ LLVector3 mSnapDir1; //!< The direction in which the upper snap guides face.
+ LLVector3 mSnapDir2; //!< The direction in which the lower snap guides face.
+ F32 mSnapRegimeOffset; //!< How far off the scale axis centerline the mouse can be before it exits/enters the snap regime.
+ F32 mTickPixelSpacing1; //!< The pixel spacing between snap guide tick marks for the upper scale.
+ F32 mTickPixelSpacing2; //!< The pixel spacing between snap guide tick marks for the lower scale.
F32 mSnapGuideLength;
- LLVector3 mScaleCenter;
- LLVector3 mScaleDir;
- F32 mScaleSnapValue;
- BOOL mInSnapRegime;
- F32* mManipulatorScales;
+ LLVector3 mScaleCenter; //!< The location of the origin of the scaling operation.
+ LLVector3 mScaleDir; //!< The direction of the scaling action. In face-dragging this is aligned with one of the cardinal axis relative to the prim, but in corner-dragging this is along the diagonal.
+ F32 mScaleSnappedValue; //!< The distance of the current position nearest the mouse location, measured along mScaleDir. Is measured either from the center or from the far face/corner depending upon whether uniform scaling is true or false respectively.
+ ESnapRegimes mSnapRegime; //<! Which, if any, snap regime the cursor is currently residing in.
+ F32 mManipulatorScales[NUM_MANIPULATORS];
+ F32 mBoxHandleSize[NUM_MANIPULATORS]; // The size of the handles at the corners of the bounding box
};
#endif // LL_MANIPSCALE_H
diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp
index 06bf294417..d22672bc16 100755
--- a/indra/newview/llmaniptranslate.cpp
+++ b/indra/newview/llmaniptranslate.cpp
@@ -61,6 +61,7 @@
#include "llui.h"
#include "pipeline.h"
#include "llviewershadermgr.h"
+#include "lltrans.h"
const S32 NUM_AXES = 3;
const S32 MOUSE_DRAG_SLOP = 2; // pixels
@@ -111,7 +112,6 @@ LLManipTranslate::LLManipTranslate( LLToolComposite* composite )
: LLManip( std::string("Move"), composite ),
mLastHoverMouseX(-1),
mLastHoverMouseY(-1),
- mSendUpdateOnMouseUp(FALSE),
mMouseOutsideSlop(FALSE),
mCopyMadeThisDrag(FALSE),
mMouseDownX(-1),
@@ -125,7 +125,6 @@ LLManipTranslate::LLManipTranslate( LLToolComposite* composite )
mSnapOffsetMeters(0.f),
mSubdivisions(10.f),
mInSnapRegime(FALSE),
- mSnapped(FALSE),
mArrowScales(1.f, 1.f, 1.f),
mPlaneScales(1.f, 1.f, 1.f),
mPlaneManipPositions(1.f, 1.f, 1.f, 1.f)
@@ -355,7 +354,7 @@ BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask )
if (!selectNode)
{
// didn't find the object in our selection...oh well
- llwarns << "Trying to translate an unselected object" << llendl;
+ LL_WARNS() << "Trying to translate an unselected object" << LL_ENDL;
return TRUE;
}
@@ -363,7 +362,7 @@ BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask )
if (!selected_object)
{
// somehow we lost the object!
- llwarns << "Translate manip lost the object, no selected object" << llendl;
+ LL_WARNS() << "Translate manip lost the object, no selected object" << LL_ENDL;
gViewerWindow->setCursor(UI_CURSOR_TOOLTRANSLATE);
return TRUE;
}
@@ -375,7 +374,7 @@ BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask )
//LLVector3 select_center_agent = gAgent.getPosAgentFromGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal());
// TomY: The above should (?) be identical to the below
LLVector3 select_center_agent = getPivotPoint();
- mSubdivisions = llclamp(getSubdivisionLevel(select_center_agent, axis_exists ? axis : LLVector3::z_axis, getMinGridScale()), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel);
+ mSubdivisions = getSubdivisionLevel(select_center_agent, axis_exists ? axis : LLVector3::z_axis, getMinGridScale());
// if we clicked on a planar manipulator, recenter mouse cursor
if (mManipPart >= LL_YZ_PLANE && mManipPart <= LL_XY_PLANE)
@@ -384,7 +383,7 @@ BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask )
if (!LLViewerCamera::getInstance()->projectPosAgentToScreen(select_center_agent, mouse_pos))
{
// mouse_pos may be nonsense
- llwarns << "Failed to project object center to screen" << llendl;
+ LL_WARNS() << "Failed to project object center to screen" << LL_ENDL;
}
else if (gSavedSettings.getBOOL("SnapToMouseCursor"))
{
@@ -412,7 +411,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
// Bail out if mouse not down.
if( !hasMouseCapture() )
{
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLManipTranslate (inactive)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLManipTranslate (inactive)" << LL_ENDL;
// Always show cursor
// gViewerWindow->setCursor(UI_CURSOR_ARROW);
gViewerWindow->setCursor(UI_CURSOR_TOOLTRANSLATE);
@@ -448,7 +447,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
// rotation above.
if( x == mLastHoverMouseX && y == mLastHoverMouseY && !rotated)
{
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLManipTranslate (mouse unmoved)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLManipTranslate (mouse unmoved)" << LL_ENDL;
gViewerWindow->setCursor(UI_CURSOR_TOOLTRANSLATE);
return TRUE;
}
@@ -461,7 +460,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
{
if (abs(mMouseDownX - x) < MOUSE_DRAG_SLOP && abs(mMouseDownY - y) < MOUSE_DRAG_SLOP )
{
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLManipTranslate (mouse inside slop)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLManipTranslate (mouse inside slop)" << LL_ENDL;
gViewerWindow->setCursor(UI_CURSOR_TOOLTRANSLATE);
return TRUE;
}
@@ -478,7 +477,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
// When we make the copy, we don't want to do any other processing.
// If so, the object will also be moved, and the copy will be offset.
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLManipTranslate (made copy)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLManipTranslate (made copy)" << LL_ENDL;
gViewerWindow->setCursor(UI_CURSOR_TOOLTRANSLATE);
}
}
@@ -495,7 +494,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
if (!selectNode)
{
// somehow we lost the object!
- llwarns << "Translate manip lost the object, no selectNode" << llendl;
+ LL_WARNS() << "Translate manip lost the object, no selectNode" << LL_ENDL;
gViewerWindow->setCursor(UI_CURSOR_TOOLTRANSLATE);
return TRUE;
}
@@ -504,7 +503,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
if (!object)
{
// somehow we lost the object!
- llwarns << "Translate manip lost the object, no object in selectNode" << llendl;
+ LL_WARNS() << "Translate manip lost the object, no object in selectNode" << LL_ENDL;
gViewerWindow->setCursor(UI_CURSOR_TOOLTRANSLATE);
return TRUE;
}
@@ -517,7 +516,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
LLSelectMgr::getInstance()->updateSelectionCenter();
LLVector3d current_pos_global = gAgent.getPosGlobalFromAgent(getPivotPoint());
- mSubdivisions = llclamp(getSubdivisionLevel(getPivotPoint(), axis_f, getMinGridScale()), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel);
+ mSubdivisions = getSubdivisionLevel(getPivotPoint(), axis_f, getMinGridScale());
// Project the cursor onto that plane
LLVector3d relative_move;
@@ -531,7 +530,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
if (relative_move.magVecSquared() > max_drag_distance * max_drag_distance)
{
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLManipTranslate (too far)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLManipTranslate (too far)" << LL_ENDL;
gViewerWindow->setCursor(UI_CURSOR_NOLOCKED);
return TRUE;
}
@@ -607,7 +606,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
max_grid_scale = mGridScale.mV[VZ];
}
- F32 num_subdivisions = llclamp(getSubdivisionLevel(getPivotPoint(), camera_projected_dir, max_grid_scale), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel);
+ F32 num_subdivisions = getSubdivisionLevel(getPivotPoint(), camera_projected_dir, max_grid_scale);
F32 grid_scale_a;
F32 grid_scale_b;
@@ -776,7 +775,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
gAgentCamera.clearFocusObject();
dialog_refresh_all(); // ??? is this necessary?
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLManipTranslate (active)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLManipTranslate (active)" << LL_ENDL;
gViewerWindow->setCursor(UI_CURSOR_TOOLTRANSLATE);
return TRUE;
}
@@ -1247,7 +1246,7 @@ void LLManipTranslate::renderSnapGuides()
// find distance to nearest smallest grid unit
F32 offset_nearest_grid_unit = fmodf(dist_grid_axis, smallest_grid_unit_scale);
// how many smallest grid units are we away from largest grid scale?
- S32 sub_div_offset = llround(fmod(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() / sGridMinSubdivisionLevel) / smallest_grid_unit_scale);
+ S32 sub_div_offset = llround(fmodf(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() / sGridMinSubdivisionLevel) / smallest_grid_unit_scale);
S32 num_ticks_per_side = llmax(1, llfloor(0.5f * guide_size_meters / smallest_grid_unit_scale));
LLGLDepthTest gls_depth(GL_FALSE);
@@ -1255,6 +1254,7 @@ void LLManipTranslate::renderSnapGuides()
for (S32 pass = 0; pass < 3; pass++)
{
LLColor4 line_color = setupSnapGuideRenderPass(pass);
+ LLGLDepthTest gls_depth(pass != 1);
gGL.begin(LLRender::LINES);
{
@@ -1286,7 +1286,7 @@ void LLManipTranslate::renderSnapGuides()
{
tick_start = selection_center + (translate_axis * (smallest_grid_unit_scale * (F32)i - offset_nearest_grid_unit));
- F32 cur_subdivisions = llclamp(getSubdivisionLevel(tick_start, translate_axis, getMinGridScale()), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel);
+ F32 cur_subdivisions = getSubdivisionLevel(tick_start, translate_axis, getMinGridScale());
if (fmodf((F32)(i + sub_div_offset), (max_subdivisions / cur_subdivisions)) != 0.f)
{
@@ -1384,7 +1384,7 @@ void LLManipTranslate::renderSnapGuides()
tick_scale *= 0.7f;
}
- if (fmodf((F32)(i + sub_div_offset), (max_subdivisions / llmin(sGridMaxSubdivisionLevel, getSubdivisionLevel(tick_pos, translate_axis, getMinGridScale(), tick_label_spacing)))) == 0.f)
+ if (fmodf((F32)(i + sub_div_offset), (max_subdivisions / getSubdivisionLevel(tick_pos, translate_axis, getMinGridScale(), tick_label_spacing))) == 0.f)
{
F32 snap_offset_meters;
@@ -1441,13 +1441,13 @@ void LLManipTranslate::renderSnapGuides()
LLVector3 help_text_pos = selection_center_start + (snap_offset_meters_up * 3.f * mSnapOffsetAxis);
const LLFontGL* big_fontp = LLFontGL::getFontSansSerif();
- std::string help_text = "Move mouse cursor over ruler";
+ std::string help_text = LLTrans::getString("manip_hint1");
LLColor4 help_text_color = LLColor4::white;
help_text_color.mV[VALPHA] = clamp_rescale(mHelpTextTimer.getElapsedTimeF32(), sHelpTextVisibleTime, sHelpTextVisibleTime + sHelpTextFadeTime, line_alpha, 0.f);
- hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD);
- help_text = "to snap to grid";
+ hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, false);
+ help_text = LLTrans::getString("manip_hint2");
help_text_pos -= LLViewerCamera::getInstance()->getUpAxis() * mSnapOffsetMeters * 0.2f;
- hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD);
+ hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, false);
}
}
}
@@ -1905,18 +1905,18 @@ void LLManipTranslate::renderTranslationHandles()
{
if (index == mManipPart - LL_X_ARROW || index == mHighlightedPart - LL_X_ARROW)
{
- mArrowScales.mV[index] = lerp(mArrowScales.mV[index], SELECTED_ARROW_SCALE, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE ));
- mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE ));
+ mArrowScales.mV[index] = lerp(mArrowScales.mV[index], SELECTED_ARROW_SCALE, LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE ));
+ mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE ));
}
else if (index == mManipPart - LL_YZ_PLANE || index == mHighlightedPart - LL_YZ_PLANE)
{
- mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE ));
- mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], SELECTED_ARROW_SCALE, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE ));
+ mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE ));
+ mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], SELECTED_ARROW_SCALE, LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE ));
}
else
{
- mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE ));
- mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE ));
+ mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE ));
+ mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE ));
}
}
@@ -2251,7 +2251,7 @@ void LLManipTranslate::renderArrow(S32 which_arrow, S32 selected_arrow, F32 box_
axis.mV[0] = 1.0f;
break;
default:
- llerrs << "renderArrow called with bad arrow " << which_arrow << llendl;
+ LL_ERRS() << "renderArrow called with bad arrow " << which_arrow << LL_ENDL;
break;
}
diff --git a/indra/newview/llmaniptranslate.h b/indra/newview/llmaniptranslate.h
index 37567c7bd1..3c37bbd698 100755
--- a/indra/newview/llmaniptranslate.h
+++ b/indra/newview/llmaniptranslate.h
@@ -85,7 +85,6 @@ protected:
private:
S32 mLastHoverMouseX;
S32 mLastHoverMouseY;
- BOOL mSendUpdateOnMouseUp;
BOOL mMouseOutsideSlop; // true after mouse goes outside slop region
BOOL mCopyMadeThisDrag;
S32 mMouseDownX;
@@ -107,7 +106,6 @@ private:
LLVector3 mGridScale;
F32 mSubdivisions;
BOOL mInSnapRegime;
- BOOL mSnapped;
LLVector3 mArrowScales;
LLVector3 mPlaneScales;
LLVector4 mPlaneManipPositions;
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index 05c9d76810..4a7a4e268d 100755
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -100,7 +100,7 @@ namespace LLMarketplaceImport
bool hasSessionCookie();
bool inProgress();
bool resultPending();
- U32 getResultStatus();
+ S32 getResultStatus();
const LLSD& getResults();
bool establishMarketplaceSessionCookie();
@@ -114,7 +114,7 @@ namespace LLMarketplaceImport
static bool sImportInProgress = false;
static bool sImportPostPending = false;
static bool sImportGetPending = false;
- static U32 sImportResultStatus = 0;
+ static S32 sImportResultStatus = 0;
static LLSD sImportResults = LLSD::emptyMap();
static LLTimer slmGetTimer;
@@ -124,27 +124,30 @@ namespace LLMarketplaceImport
class LLImportPostResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(LLImportPostResponder);
public:
LLImportPostResponder() : LLCurl::Responder() {}
-
- void completed(U32 status, const std::string& reason, const LLSD& content)
+
+ protected:
+ /* virtual */ void httpCompleted()
{
slmPostTimer.stop();
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
- llinfos << " SLM POST status: " << status << llendl;
- llinfos << " SLM POST reason: " << reason << llendl;
- llinfos << " SLM POST content: " << content.asString() << llendl;
- llinfos << " SLM POST timer: " << slmPostTimer.getElapsedTimeF32() << llendl;
+ LL_INFOS() << " SLM [timer:" << slmPostTimer.getElapsedTimeF32() << "] "
+ << dumpResponse() << LL_ENDL;
}
- // MAINT-2301 : we determined we can safely ignore that error in that context
- if (status == MarketplaceErrorCodes::IMPORT_JOB_TIMEOUT)
+ S32 status = getStatus();
+ if ((status == MarketplaceErrorCodes::IMPORT_REDIRECT) ||
+ (status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR) ||
+ // MAINT-2301 : we determined we can safely ignore that error in that context
+ (status == MarketplaceErrorCodes::IMPORT_JOB_TIMEOUT))
{
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
- llinfos << " SLM POST : Ignoring time out status and treating it as success" << llendl;
+ LL_INFOS() << " SLM POST : Ignoring time out status and treating it as success" << LL_ENDL;
}
status = MarketplaceErrorCodes::IMPORT_DONE;
}
@@ -153,7 +156,7 @@ namespace LLMarketplaceImport
{
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
- llinfos << " SLM POST clearing marketplace cookie due to client or server error" << llendl;
+ LL_INFOS() << " SLM POST clearing marketplace cookie due to client or server error" << LL_ENDL;
}
sMarketplaceCookie.clear();
}
@@ -161,58 +164,56 @@ namespace LLMarketplaceImport
sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_DONE);
sImportPostPending = false;
sImportResultStatus = status;
- sImportId = content;
+ sImportId = getContent();
}
};
class LLImportGetResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(LLImportGetResponder);
public:
LLImportGetResponder() : LLCurl::Responder() {}
- void completedHeader(U32 status, const std::string& reason, const LLSD& content)
+ protected:
+ /* virtual */ void httpCompleted()
{
- const std::string& set_cookie_string = content["set-cookie"].asString();
+ const std::string& set_cookie_string = getResponseHeader(HTTP_IN_HEADER_SET_COOKIE);
if (!set_cookie_string.empty())
{
sMarketplaceCookie = set_cookie_string;
}
- }
-
- void completed(U32 status, const std::string& reason, const LLSD& content)
- {
+
slmGetTimer.stop();
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
- llinfos << " SLM GET status: " << status << llendl;
- llinfos << " SLM GET reason: " << reason << llendl;
- llinfos << " SLM GET content: " << content.asString() << llendl;
- llinfos << " SLM GET timer: " << slmGetTimer.getElapsedTimeF32() << llendl;
+ LL_INFOS() << " SLM [timer:" << slmGetTimer.getElapsedTimeF32() << "] "
+ << dumpResponse() << LL_ENDL;
}
// MAINT-2452 : Do not clear the cookie on IMPORT_DONE_WITH_ERRORS : Happens when trying to import objects with wrong permissions
// ACME-1221 : Do not clear the cookie on IMPORT_NOT_FOUND : Happens for newly created Merchant accounts that are initally empty
+ S32 status = getStatus();
if ((status >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST) &&
(status != MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS) &&
(status != MarketplaceErrorCodes::IMPORT_NOT_FOUND))
{
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
- llinfos << " SLM GET clearing marketplace cookie due to client or server error" << llendl;
+ LL_INFOS() << " SLM GET clearing marketplace cookie due to client or server error" << LL_ENDL;
}
sMarketplaceCookie.clear();
}
else if (gSavedSettings.getBOOL("InventoryOutboxLogging") && (status >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST))
{
- llinfos << " SLM GET : Got error status = " << status << ", but marketplace cookie not cleared." << llendl;
+ LL_INFOS() << " SLM GET : Got error status = " << status << ", but marketplace cookie not cleared." << LL_ENDL;
}
sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_PROCESSING);
sImportGetPending = false;
sImportResultStatus = status;
- sImportResults = content;
+ sImportResults = getContent();
}
};
@@ -233,7 +234,7 @@ namespace LLMarketplaceImport
return (sImportPostPending || sImportGetPending);
}
- U32 getResultStatus()
+ S32 getResultStatus()
{
return sImportResultStatus;
}
@@ -268,12 +269,12 @@ namespace LLMarketplaceImport
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
- llinfos << " SLM GET: establishMarketplaceSessionCookie, LLHTTPClient::get, url = " << url << llendl;
+ LL_INFOS() << " SLM GET: establishMarketplaceSessionCookie, LLHTTPClient::get, url = " << url << LL_ENDL;
LLSD headers = LLViewerMedia::getHeaders();
std::stringstream str;
LLSDSerialize::toPrettyXML(headers, str);
- llinfos << " SLM GET: headers " << llendl;
- llinfos << str.str() << llendl;
+ LL_INFOS() << " SLM GET: headers " << LL_ENDL;
+ LL_INFOS() << str.str() << LL_ENDL;
}
slmGetTimer.start();
@@ -297,18 +298,19 @@ namespace LLMarketplaceImport
// Make the headers for the post
LLSD headers = LLSD::emptyMap();
- headers["Accept"] = "*/*";
- headers["Cookie"] = sMarketplaceCookie;
- headers["Content-Type"] = "application/llsd+xml";
- headers["User-Agent"] = LLViewerMedia::getCurrentUserAgent();
+ headers[HTTP_OUT_HEADER_ACCEPT] = "*/*";
+ headers[HTTP_OUT_HEADER_COOKIE] = sMarketplaceCookie;
+ // *TODO: Why are we setting Content-Type for a GET request?
+ headers[HTTP_OUT_HEADER_CONTENT_TYPE] = HTTP_CONTENT_LLSD_XML;
+ headers[HTTP_OUT_HEADER_USER_AGENT] = LLViewerMedia::getCurrentUserAgent();
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
- llinfos << " SLM GET: pollStatus, LLHTTPClient::get, url = " << url << llendl;
+ LL_INFOS() << " SLM GET: pollStatus, LLHTTPClient::get, url = " << url << LL_ENDL;
std::stringstream str;
LLSDSerialize::toPrettyXML(headers, str);
- llinfos << " SLM GET: headers " << llendl;
- llinfos << str.str() << llendl;
+ LL_INFOS() << " SLM GET: headers " << LL_ENDL;
+ LL_INFOS() << str.str() << LL_ENDL;
}
slmGetTimer.start();
@@ -334,19 +336,19 @@ namespace LLMarketplaceImport
// Make the headers for the post
LLSD headers = LLSD::emptyMap();
- headers["Accept"] = "*/*";
- headers["Connection"] = "Keep-Alive";
- headers["Cookie"] = sMarketplaceCookie;
- headers["Content-Type"] = "application/xml";
- headers["User-Agent"] = LLViewerMedia::getCurrentUserAgent();
+ headers[HTTP_OUT_HEADER_ACCEPT] = "*/*";
+ headers[HTTP_OUT_HEADER_CONNECTION] = "Keep-Alive";
+ headers[HTTP_OUT_HEADER_COOKIE] = sMarketplaceCookie;
+ headers[HTTP_OUT_HEADER_CONTENT_TYPE] = HTTP_CONTENT_XML;
+ headers[HTTP_OUT_HEADER_USER_AGENT] = LLViewerMedia::getCurrentUserAgent();
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
- llinfos << " SLM POST: triggerImport, LLHTTPClient::post, url = " << url << llendl;
+ LL_INFOS() << " SLM POST: triggerImport, LLHTTPClient::post, url = " << url << LL_ENDL;
std::stringstream str;
LLSDSerialize::toPrettyXML(headers, str);
- llinfos << " SLM POST: headers " << llendl;
- llinfos << str.str() << llendl;
+ LL_INFOS() << " SLM POST: headers " << LL_ENDL;
+ LL_INFOS() << str.str() << LL_ENDL;
}
slmPostTimer.start();
diff --git a/indra/newview/llmaterialmgr.cpp b/indra/newview/llmaterialmgr.cpp
index 14d3d4e7a8..a1f6a01aa0 100644..100755
--- a/indra/newview/llmaterialmgr.cpp
+++ b/indra/newview/llmaterialmgr.cpp
@@ -71,8 +71,8 @@ public:
LLMaterialsResponder(const std::string& pMethod, const std::string& pCapabilityURL, CallbackFunction pCallback);
virtual ~LLMaterialsResponder();
- virtual void result(const LLSD& pContent);
- virtual void error(U32 pStatus, const std::string& pReason);
+ virtual void httpSuccess();
+ virtual void httpFailure();
private:
std::string mMethod;
@@ -92,14 +92,19 @@ LLMaterialsResponder::~LLMaterialsResponder()
{
}
-void LLMaterialsResponder::result(const LLSD& pContent)
+void LLMaterialsResponder::httpSuccess()
{
+ const LLSD& pContent = getContent();
+
LL_DEBUGS("Materials") << LL_ENDL;
mCallback(true, pContent);
}
-void LLMaterialsResponder::error(U32 pStatus, const std::string& pReason)
+void LLMaterialsResponder::httpFailure()
{
+ U32 pStatus = (U32) getStatus();
+ const std::string& pReason = getReason();
+
LL_WARNS("Materials")
<< "\n--------------------------------------------------------------------------\n"
<< mMethod << " Error[" << pStatus << "] cannot access cap '" << MATERIALS_CAPABILITY_NAME
@@ -527,11 +532,11 @@ void LLMaterialMgr::onPutResponse(bool success, const LLSD& content)
}
}
-static LLFastTimer::DeclareTimer FTM_MATERIALS_IDLE("Materials");
+static LLTrace::BlockTimerStatHandle FTM_MATERIALS_IDLE("Idle Materials");
void LLMaterialMgr::onIdle(void*)
{
- LLFastTimer t(FTM_MATERIALS_IDLE);
+ LL_RECORD_BLOCK_TIME(FTM_MATERIALS_IDLE);
LLMaterialMgr* instancep = LLMaterialMgr::getInstance();
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index 2075aeed63..f4e08dc790 100755
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -52,6 +52,7 @@
#include "llsdutil.h"
#include "lllayoutstack.h"
#include "lliconctrl.h"
+#include "llhttpconstants.h"
#include "lltextbox.h"
#include "llbutton.h"
#include "llcheckboxctrl.h"
@@ -390,9 +391,13 @@ BOOL LLMediaCtrl::postBuild ()
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registar;
registar.add("Open.WebInspector", boost::bind(&LLMediaCtrl::onOpenWebInspector, this));
+ // stinson 05/05/2014 : use this as the parent of the context menu if the static menu
+ // container has yet to be created
+ LLPanel* menuParent = (LLMenuGL::sMenuContainer != NULL) ? dynamic_cast<LLPanel*>(LLMenuGL::sMenuContainer) : dynamic_cast<LLPanel*>(this);
+ llassert(menuParent != NULL);
mContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>(
- "menu_media_ctrl.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance());
- setVisibleCallback(boost::bind(&LLMediaCtrl::onVisibilityChange, this, _2));
+ "menu_media_ctrl.xml", menuParent, LLViewerMenuHolderGL::child_registry_t::instance());
+ setVisibleCallback(boost::bind(&LLMediaCtrl::onVisibilityChanged, this, _2));
return TRUE;
}
@@ -422,9 +427,9 @@ BOOL LLMediaCtrl::handleKeyHere( KEY key, MASK mask )
////////////////////////////////////////////////////////////////////////////////
//
-void LLMediaCtrl::handleVisibilityChange ( BOOL new_visibility )
+void LLMediaCtrl::onVisibilityChange ( BOOL new_visibility )
{
- llinfos << "visibility changed to " << (new_visibility?"true":"false") << llendl;
+ LL_INFOS() << "visibility changed to " << (new_visibility?"true":"false") << LL_ENDL;
if(mMediaSource)
{
mMediaSource->setVisible( new_visibility );
@@ -450,7 +455,7 @@ BOOL LLMediaCtrl::handleUnicodeCharHere(llwchar uni_char)
////////////////////////////////////////////////////////////////////////////////
//
-void LLMediaCtrl::onVisibilityChange ( const LLSD& new_visibility )
+void LLMediaCtrl::onVisibilityChanged ( const LLSD& new_visibility )
{
// set state of frequent updates automatically if visibility changes
if ( new_visibility.asBoolean() )
@@ -504,6 +509,16 @@ void LLMediaCtrl::navigateForward()
////////////////////////////////////////////////////////////////////////////////
//
+void LLMediaCtrl::navigateStop()
+{
+ if (mMediaSource && mMediaSource->hasMedia())
+ {
+ mMediaSource->getMediaPlugin()->browse_stop();
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
bool LLMediaCtrl::canNavigateBack()
{
if (mMediaSource)
@@ -539,7 +554,7 @@ void LLMediaCtrl::clearCache()
////////////////////////////////////////////////////////////////////////////////
//
-void LLMediaCtrl::navigateTo( std::string url_in, std::string mime_type)
+void LLMediaCtrl::navigateTo( std::string url_in, std::string mime_type, bool clean_browser)
{
// don't browse to anything that starts with secondlife:// or sl://
const std::string protocol1 = "secondlife://";
@@ -548,7 +563,7 @@ void LLMediaCtrl::navigateTo( std::string url_in, std::string mime_type)
(LLStringUtil::compareInsensitive(url_in.substr(0, protocol2.length()), protocol2) == 0))
{
// TODO: Print out/log this attempt?
- // llinfos << "Rejecting attempt to load restricted website :" << urlIn << llendl;
+ // LL_INFOS() << "Rejecting attempt to load restricted website :" << urlIn << LL_ENDL;
return;
}
@@ -556,7 +571,7 @@ void LLMediaCtrl::navigateTo( std::string url_in, std::string mime_type)
{
mCurrentNavUrl = url_in;
mMediaSource->setSize(mTextureWidth, mTextureHeight);
- mMediaSource->navigateTo(url_in, mime_type, mime_type.empty());
+ mMediaSource->navigateTo(url_in, mime_type, mime_type.empty(), false, clean_browser);
}
}
@@ -569,14 +584,14 @@ void LLMediaCtrl::navigateToLocalPage( const std::string& subdir, const std::str
if (expanded_filename.empty())
{
- llwarns << "File " << filename << "not found" << llendl;
+ LL_WARNS() << "File " << filename << "not found" << LL_ENDL;
return;
}
if (ensureMediaSourceExists())
{
mCurrentNavUrl = expanded_filename;
mMediaSource->setSize(mTextureWidth, mTextureHeight);
- mMediaSource->navigateTo(expanded_filename, "text/html", false);
+ mMediaSource->navigateTo(expanded_filename, HTTP_CONTENT_TEXT_HTML, false);
}
}
@@ -677,7 +692,7 @@ bool LLMediaCtrl::ensureMediaSourceExists()
}
else
{
- llwarns << "media source create failed " << llendl;
+ LL_WARNS() << "media source create failed " << LL_ENDL;
// return;
}
}
@@ -948,7 +963,7 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_NAVIGATE_ERROR_PAGE" << LL_ENDL;
if ( mErrorPageURL.length() > 0 )
{
- navigateTo(mErrorPageURL, "text/html");
+ navigateTo(mErrorPageURL, HTTP_CONTENT_TEXT_HTML);
};
};
break;
@@ -1117,3 +1132,8 @@ void LLMediaCtrl::setTrustedContent(bool trusted)
mMediaSource->setTrustedBrowser(trusted);
}
}
+
+void LLMediaCtrl::updateContextMenuParent(LLView* pNewParent)
+{
+ mContextMenu->updateParent(pNewParent);
+}
diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h
index 6c38c1fb56..785c57b78a 100755
--- a/indra/newview/llmediactrl.h
+++ b/indra/newview/llmediactrl.h
@@ -95,10 +95,11 @@ public:
virtual BOOL handleToolTip(S32 x, S32 y, MASK mask);
// navigation
- void navigateTo( std::string url_in, std::string mime_type = "");
+ void navigateTo( std::string url_in, std::string mime_type = "", bool clean_browser = false);
void navigateBack();
void navigateHome();
void navigateForward();
+ void navigateStop();
void navigateToLocalPage( const std::string& subdir, const std::string& filename_in );
bool canNavigateBack();
bool canNavigateForward();
@@ -150,7 +151,7 @@ public:
// over-rides
virtual BOOL handleKeyHere( KEY key, MASK mask);
- virtual void handleVisibilityChange ( BOOL new_visibility );
+ virtual void onVisibilityChange ( BOOL new_visibility );
virtual BOOL handleUnicodeCharHere(llwchar uni_char);
virtual void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE);
virtual void draw();
@@ -168,11 +169,13 @@ public:
LLUUID getTextureID() {return mMediaTextureID;}
+ void updateContextMenuParent(LLView* pNewParent);
+
protected:
void convertInputCoords(S32& x, S32& y);
private:
- void onVisibilityChange ( const LLSD& new_visibility );
+ void onVisibilityChanged ( const LLSD& new_visibility );
void onPopup(const LLSD& notification, const LLSD& response);
const S32 mTextureDepthBytes;
diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp
index e3b46d5d2f..691be13610 100755
--- a/indra/newview/llmediadataclient.cpp
+++ b/indra/newview/llmediadataclient.cpp
@@ -35,7 +35,7 @@
#include <boost/lexical_cast.hpp>
-#include "llhttpstatuscodes.h"
+#include "llhttpconstants.h"
#include "llsdutil.h"
#include "llmediaentry.h"
#include "lltextureentry.h"
@@ -564,7 +564,7 @@ LLMediaDataClient::Responder::Responder(const request_ptr_t &request)
}
/*virtual*/
-void LLMediaDataClient::Responder::errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+void LLMediaDataClient::Responder::httpFailure()
{
mRequest->stopTracking();
@@ -574,9 +574,17 @@ void LLMediaDataClient::Responder::errorWithContent(U32 status, const std::strin
return;
}
- if (status == HTTP_SERVICE_UNAVAILABLE)
+ if (getStatus() == HTTP_SERVICE_UNAVAILABLE)
{
- F32 retry_timeout = mRequest->getRetryTimerDelay();
+ F32 retry_timeout;
+#if 0
+ // *TODO: Honor server Retry-After header.
+ if (!hasResponseHeader(HTTP_IN_HEADER_RETRY_AFTER)
+ || !getSecondsUntilRetryAfter(getResponseHeader(HTTP_IN_HEADER_RETRY_AFTER), retry_timeout))
+#endif
+ {
+ retry_timeout = mRequest->getRetryTimerDelay();
+ }
mRequest->incRetryCount();
@@ -594,15 +602,16 @@ void LLMediaDataClient::Responder::errorWithContent(U32 status, const std::strin
<< mRequest->getRetryCount() << " exceeds " << mRequest->getMaxNumRetries() << ", not retrying" << LL_ENDL;
}
}
+ // *TODO: Redirect on 3xx status codes.
else
{
- LL_WARNS("LLMediaDataClient") << *mRequest << " http error [status:"
- << status << "]:" << content << ")" << LL_ENDL;
+ LL_WARNS("LLMediaDataClient") << *mRequest << " http failure "
+ << dumpResponse() << LL_ENDL;
}
}
/*virtual*/
-void LLMediaDataClient::Responder::result(const LLSD& content)
+void LLMediaDataClient::Responder::httpSuccess()
{
mRequest->stopTracking();
@@ -612,7 +621,7 @@ void LLMediaDataClient::Responder::result(const LLSD& content)
return;
}
- LL_DEBUGS("LLMediaDataClientResponse") << *mRequest << " result : " << ll_print_sd(content) << LL_ENDL;
+ LL_DEBUGS("LLMediaDataClientResponse") << *mRequest << " " << dumpResponse() << LL_ENDL;
}
//////////////////////////////////////////////////////////////////////////////////////
@@ -876,7 +885,7 @@ LLMediaDataClient::Responder *LLObjectMediaDataClient::RequestUpdate::createResp
/*virtual*/
-void LLObjectMediaDataClient::Responder::result(const LLSD& content)
+void LLObjectMediaDataClient::Responder::httpSuccess()
{
getRequest()->stopTracking();
@@ -886,10 +895,16 @@ void LLObjectMediaDataClient::Responder::result(const LLSD& content)
return;
}
+ const LLSD& content = getContent();
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
+
// This responder is only used for GET requests, not UPDATE.
+ LL_DEBUGS("LLMediaDataClientResponse") << *(getRequest()) << " " << dumpResponse() << LL_ENDL;
- LL_DEBUGS("LLMediaDataClientResponse") << *(getRequest()) << " GET returned: " << ll_print_sd(content) << LL_ENDL;
-
// Look for an error
if (content.has("error"))
{
@@ -1003,7 +1018,7 @@ LLMediaDataClient::Responder *LLObjectMediaNavigateClient::RequestNavigate::crea
}
/*virtual*/
-void LLObjectMediaNavigateClient::Responder::errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+void LLObjectMediaNavigateClient::Responder::httpFailure()
{
getRequest()->stopTracking();
@@ -1015,14 +1030,14 @@ void LLObjectMediaNavigateClient::Responder::errorWithContent(U32 status, const
// Bounce back (unless HTTP_SERVICE_UNAVAILABLE, in which case call base
// class
- if (status == HTTP_SERVICE_UNAVAILABLE)
+ if (getStatus() == HTTP_SERVICE_UNAVAILABLE)
{
- LLMediaDataClient::Responder::errorWithContent(status, reason, content);
+ LLMediaDataClient::Responder::httpFailure();
}
else
{
// bounce the face back
- LL_WARNS("LLMediaDataClient") << *(getRequest()) << " Error navigating: http code=" << status << LL_ENDL;
+ LL_WARNS("LLMediaDataClient") << *(getRequest()) << " Error navigating: " << dumpResponse() << LL_ENDL;
const LLSD &payload = getRequest()->getPayload();
// bounce the face back
getRequest()->getObject()->mediaNavigateBounceBack((LLSD::Integer)payload[LLTextureEntry::TEXTURE_INDEX_KEY]);
@@ -1030,7 +1045,7 @@ void LLObjectMediaNavigateClient::Responder::errorWithContent(U32 status, const
}
/*virtual*/
-void LLObjectMediaNavigateClient::Responder::result(const LLSD& content)
+void LLObjectMediaNavigateClient::Responder::httpSuccess()
{
getRequest()->stopTracking();
@@ -1040,8 +1055,9 @@ void LLObjectMediaNavigateClient::Responder::result(const LLSD& content)
return;
}
- LL_INFOS("LLMediaDataClient") << *(getRequest()) << " NAVIGATE returned " << ll_print_sd(content) << LL_ENDL;
+ LL_INFOS("LLMediaDataClient") << *(getRequest()) << " NAVIGATE returned " << dumpResponse() << LL_ENDL;
+ const LLSD& content = getContent();
if (content.has("error"))
{
const LLSD &error = content["error"];
@@ -1065,6 +1081,6 @@ void LLObjectMediaNavigateClient::Responder::result(const LLSD& content)
else
{
// No action required.
- LL_DEBUGS("LLMediaDataClientResponse") << *(getRequest()) << " result : " << ll_print_sd(content) << LL_ENDL;
+ LL_DEBUGS("LLMediaDataClientResponse") << *(getRequest()) << " " << dumpResponse() << LL_ENDL;
}
}
diff --git a/indra/newview/llmediadataclient.h b/indra/newview/llmediadataclient.h
index 89e20a28d0..231b883c32 100755
--- a/indra/newview/llmediadataclient.h
+++ b/indra/newview/llmediadataclient.h
@@ -74,8 +74,9 @@ public:
// Abstracts the Cap URL, the request, and the responder
class LLMediaDataClient : public LLRefCount
{
-public:
+protected:
LOG_CLASS(LLMediaDataClient);
+public:
const static F32 QUEUE_TIMER_DELAY;// = 1.0; // seconds(s)
const static F32 UNAVAILABLE_RETRY_TIMER_DELAY;// = 5.0; // secs
@@ -192,14 +193,16 @@ protected:
// Responder
class Responder : public LLHTTPClient::Responder
{
+ LOG_CLASS(Responder);
public:
Responder(const request_ptr_t &request);
+ request_ptr_t &getRequest() { return mRequest; }
+
+ protected:
//If we get back an error (not found, etc...), handle it here
- virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content);
+ virtual void httpFailure();
//If we get back a normal response, handle it here. Default just logs it.
- virtual void result(const LLSD& content);
-
- request_ptr_t &getRequest() { return mRequest; }
+ virtual void httpSuccess();
private:
request_ptr_t mRequest;
@@ -287,8 +290,9 @@ private:
// MediaDataClient specific for the ObjectMedia cap
class LLObjectMediaDataClient : public LLMediaDataClient
{
-public:
+protected:
LOG_CLASS(LLObjectMediaDataClient);
+public:
LLObjectMediaDataClient(F32 queue_timer_delay = QUEUE_TIMER_DELAY,
F32 retry_timer_delay = UNAVAILABLE_RETRY_TIMER_DELAY,
U32 max_retries = MAX_RETRIES,
@@ -341,10 +345,12 @@ protected:
class Responder : public LLMediaDataClient::Responder
{
+ LOG_CLASS(Responder);
public:
Responder(const request_ptr_t &request)
: LLMediaDataClient::Responder(request) {}
- virtual void result(const LLSD &content);
+ protected:
+ virtual void httpSuccess();
};
private:
// The Get/Update data client needs a second queue to avoid object updates starving load-ins.
@@ -362,8 +368,9 @@ private:
// MediaDataClient specific for the ObjectMediaNavigate cap
class LLObjectMediaNavigateClient : public LLMediaDataClient
{
-public:
+protected:
LOG_CLASS(LLObjectMediaNavigateClient);
+public:
// NOTE: from llmediaservice.h
static const int ERROR_PERMISSION_DENIED_CODE = 8002;
@@ -397,11 +404,13 @@ protected:
class Responder : public LLMediaDataClient::Responder
{
+ LOG_CLASS(Responder);
public:
Responder(const request_ptr_t &request)
: LLMediaDataClient::Responder(request) {}
- virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content);
- virtual void result(const LLSD &content);
+ protected:
+ virtual void httpFailure();
+ virtual void httpSuccess();
private:
void mediaNavigateBounceBack();
};
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 5afd2cb329..8f50555a73 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -29,7 +29,8 @@
#include "apr_pools.h"
#include "apr_dso.h"
-#include "llhttpstatuscodes.h"
+#include "llhttpconstants.h"
+#include "llapr.h"
#include "llmeshrepository.h"
#include "llagent.h"
@@ -310,18 +311,8 @@
// under the 'Mesh Fetch' timer which will be either top-level
// or under 'Render' time.
-#ifndef LL_MESH_FASTTIMER_ENABLE
-#define LL_MESH_FASTTIMER_ENABLE 1
-#endif
-#if LL_MESH_FASTTIMER_ENABLE
static LLFastTimer::DeclareTimer FTM_MESH_FETCH("Mesh Fetch");
-#define MESH_FASTTIMER_DEFBLOCK LLFastTimer meshtimer(FTM_MESH_FETCH)
-#else
-#define MESH_FASTTIMER_DEFBLOCK
-#endif // LL_MESH_FASTTIMER_ENABLE
-
-
// Random failure testing for development/QA.
//
// Set the MESH_*_FAILED macros to either 'false' or to
@@ -391,10 +382,10 @@ U32 LLMeshRepository::sCacheBytesWritten = 0;
U32 LLMeshRepository::sCacheReads = 0;
U32 LLMeshRepository::sCacheWrites = 0;
U32 LLMeshRepository::sMaxLockHoldoffs = 0;
-
+
LLDeadmanTimer LLMeshRepository::sQuiescentTimer(15.0, false); // true -> gather cpu metrics
-
+
static S32 dump_num = 0;
std::string make_dump_name(std::string prefix, S32 num)
{
@@ -526,6 +517,7 @@ S32 LLMeshRepoThread::sRequestWaterLevel = 0;
class LLMeshHandlerBase : public LLCore::HttpHandler
{
public:
+ LOG_CLASS(LLMeshHandlerBase);
LLMeshHandlerBase()
: LLCore::HttpHandler(),
mMeshParams(),
@@ -546,8 +538,8 @@ public:
virtual void processFailure(LLCore::HttpStatus status) = 0;
public:
- LLVolumeParams mMeshParams;
- bool mProcessed;
+ LLVolumeParams mMeshParams;
+ bool mProcessed;
LLCore::HttpHandle mHttpHandle;
};
@@ -558,6 +550,7 @@ public:
class LLMeshHeaderHandler : public LLMeshHandlerBase
{
public:
+ LOG_CLASS(LLMeshHeaderHandler);
LLMeshHeaderHandler(const LLVolumeParams & mesh_params)
: LLMeshHandlerBase()
{
@@ -580,23 +573,23 @@ public:
//
// Thread: repo
class LLMeshLODHandler : public LLMeshHandlerBase
-{
+ {
public:
LLMeshLODHandler(const LLVolumeParams & mesh_params, S32 lod, U32 offset, U32 requested_bytes)
: LLMeshHandlerBase(),
mLOD(lod),
mRequestedBytes(requested_bytes),
mOffset(offset)
- {
+ {
mMeshParams = mesh_params;
LLMeshRepoThread::incActiveLODRequests();
- }
+ }
virtual ~LLMeshLODHandler();
-
+
protected:
LLMeshLODHandler(const LLMeshLODHandler &); // Not defined
void operator=(const LLMeshLODHandler &); // Not defined
-
+
public:
virtual void processData(LLCore::BufferArray * body, U8 * data, S32 data_size);
virtual void processFailure(LLCore::HttpStatus status);
@@ -612,8 +605,9 @@ public:
//
// Thread: repo
class LLMeshSkinInfoHandler : public LLMeshHandlerBase
-{
+ {
public:
+ LOG_CLASS(LLMeshSkinInfoHandler);
LLMeshSkinInfoHandler(const LLUUID& id, U32 offset, U32 size)
: LLMeshHandlerBase(),
mMeshID(id),
@@ -625,7 +619,7 @@ public:
protected:
LLMeshSkinInfoHandler(const LLMeshSkinInfoHandler &); // Not defined
void operator=(const LLMeshSkinInfoHandler &); // Not defined
-
+
public:
virtual void processData(LLCore::BufferArray * body, U8 * data, S32 data_size);
virtual void processFailure(LLCore::HttpStatus status);
@@ -641,8 +635,9 @@ public:
//
// Thread: repo
class LLMeshDecompositionHandler : public LLMeshHandlerBase
-{
+ {
public:
+ LOG_CLASS(LLMeshDecompositionHandler);
LLMeshDecompositionHandler(const LLUUID& id, U32 offset, U32 size)
: LLMeshHandlerBase(),
mMeshID(id),
@@ -654,7 +649,7 @@ public:
protected:
LLMeshDecompositionHandler(const LLMeshDecompositionHandler &); // Not defined
void operator=(const LLMeshDecompositionHandler &); // Not defined
-
+
public:
virtual void processData(LLCore::BufferArray * body, U8 * data, S32 data_size);
virtual void processFailure(LLCore::HttpStatus status);
@@ -670,8 +665,9 @@ public:
//
// Thread: repo
class LLMeshPhysicsShapeHandler : public LLMeshHandlerBase
-{
+ {
public:
+ LOG_CLASS(LLMeshPhysicsShapeHandler);
LLMeshPhysicsShapeHandler(const LLUUID& id, U32 offset, U32 size)
: LLMeshHandlerBase(),
mMeshID(id),
@@ -683,15 +679,15 @@ public:
protected:
LLMeshPhysicsShapeHandler(const LLMeshPhysicsShapeHandler &); // Not defined
void operator=(const LLMeshPhysicsShapeHandler &); // Not defined
-
+
public:
virtual void processData(LLCore::BufferArray * body, U8 * data, S32 data_size);
virtual void processFailure(LLCore::HttpStatus status);
public:
- LLUUID mMeshID;
- U32 mRequestedBytes;
- U32 mOffset;
+ LLUUID mMeshID;
+ U32 mRequestedBytes;
+ U32 mOffset;
};
@@ -717,8 +713,8 @@ void log_upload_error(LLCore::HttpStatus status, const LLSD& content,
LL_WARNS(LOG_MESH) << "error: " << err << LL_ENDL;
LL_WARNS(LOG_MESH) << " mesh upload failed, stage '" << stage
<< "', error '" << err["error"].asString()
- << "', message '" << err["message"].asString()
- << "', id '" << err["identifier"].asString()
+ << "', message '" << err["message"].asString()
+ << "', id '" << err["identifier"].asString()
<< "'" << LL_ENDL;
if (err.has("errors"))
{
@@ -747,7 +743,6 @@ void log_upload_error(LLCore::HttpStatus status, const LLSD& content,
}
}
-
LLMeshRepoThread::LLMeshRepoThread()
: LLThread("mesh repo"),
mHttpRequest(NULL),
@@ -759,7 +754,7 @@ LLMeshRepoThread::LLMeshRepoThread()
mHttpLargePolicyClass(LLCore::HttpRequest::DEFAULT_POLICY_ID),
mHttpPriority(0),
mGetMeshVersion(2)
-{
+ {
mMutex = new LLMutex(NULL);
mHeaderMutex = new LLMutex(NULL);
mSignal = new LLCondition(NULL);
@@ -775,11 +770,11 @@ LLMeshRepoThread::LLMeshRepoThread()
mHttpPolicyClass = LLAppViewer::instance()->getAppCoreHttp().getPolicy(LLAppCoreHttp::AP_MESH2);
mHttpLegacyPolicyClass = LLAppViewer::instance()->getAppCoreHttp().getPolicy(LLAppCoreHttp::AP_MESH1);
mHttpLargePolicyClass = LLAppViewer::instance()->getAppCoreHttp().getPolicy(LLAppCoreHttp::AP_LARGE_MESH);
-}
-
+ }
+
LLMeshRepoThread::~LLMeshRepoThread()
-{
+ {
LL_INFOS(LOG_MESH) << "Small GETs issued: " << LLMeshRepository::sHTTPRequestCount
<< ", Large GETs issued: " << LLMeshRepository::sHTTPLargeRequestCount
<< ", Max Lock Holdoffs: " << LLMeshRepository::sMaxLockHoldoffs
@@ -790,23 +785,23 @@ LLMeshRepoThread::~LLMeshRepoThread()
++iter)
{
delete *iter;
- }
+ }
mHttpRequestSet.clear();
if (mHttpHeaders)
- {
+ {
mHttpHeaders->release();
mHttpHeaders = NULL;
- }
+ }
if (mHttpOptions)
- {
+ {
mHttpOptions->release();
mHttpOptions = NULL;
- }
+ }
if (mHttpLargeOptions)
- {
+{
mHttpLargeOptions->release();
mHttpLargeOptions = NULL;
- }
+}
delete mHttpRequest;
mHttpRequest = NULL;
delete mMutex;
@@ -846,53 +841,53 @@ void LLMeshRepoThread::run()
{
break;
}
-
+
if (! mHttpRequestSet.empty())
{
// Dispatch all HttpHandler notifications
mHttpRequest->update(0L);
- }
+ }
sRequestWaterLevel = mHttpRequestSet.size(); // Stats data update
-
- // NOTE: order of queue processing intentionally favors LOD requests over header requests
+ // NOTE: order of queue processing intentionally favors LOD requests over header requests
+
while (!mLODReqQ.empty() && mHttpRequestSet.size() < sRequestHighWater)
- {
- if (! mMutex)
{
+ if (! mMutex)
+ {
break;
}
- mMutex->lock();
- LODRequest req = mLODReqQ.front();
- mLODReqQ.pop();
- LLMeshRepository::sLODProcessing--;
- mMutex->unlock();
+ mMutex->lock();
+ LODRequest req = mLODReqQ.front();
+ mLODReqQ.pop();
+ LLMeshRepository::sLODProcessing--;
+ mMutex->unlock();
if (!fetchMeshLOD(req.mMeshParams, req.mLOD)) // failed, resubmit
- {
- mMutex->lock();
- mLODReqQ.push(req) ;
+ {
+ mMutex->lock();
+ mLODReqQ.push(req);
++LLMeshRepository::sLODProcessing;
- mMutex->unlock();
- }
- }
+ mMutex->unlock();
+ }
+ }
while (!mHeaderReqQ.empty() && mHttpRequestSet.size() < sRequestHighWater)
- {
- if (! mMutex)
{
+ if (! mMutex)
+ {
break;
}
- mMutex->lock();
- HeaderRequest req = mHeaderReqQ.front();
- mHeaderReqQ.pop();
- mMutex->unlock();
+ mMutex->lock();
+ HeaderRequest req = mHeaderReqQ.front();
+ mHeaderReqQ.pop();
+ mMutex->unlock();
if (!fetchMeshHeader(req.mMeshParams))//failed, resubmit
- {
- mMutex->lock();
- mHeaderReqQ.push(req) ;
- mMutex->unlock();
- }
- }
+ {
+ mMutex->lock();
+ mHeaderReqQ.push(req) ;
+ mMutex->unlock();
+ }
+ }
// For the final three request lists, similar goal to above but
// slightly different queue structures. Stay off the mutex when
@@ -918,7 +913,7 @@ void LLMeshRepoThread::run()
mSkinRequests.erase(iter);
mMutex->unlock();
- if (! fetchMeshSkinInfo(mesh_id))
+ if (!fetchMeshSkinInfo(mesh_id))
{
incomplete.insert(mesh_id);
}
@@ -947,7 +942,7 @@ void LLMeshRepoThread::run()
mDecompositionRequests.erase(iter);
mMutex->unlock();
- if (! fetchMeshDecomposition(mesh_id))
+ if (!fetchMeshDecomposition(mesh_id))
{
incomplete.insert(mesh_id);
}
@@ -973,7 +968,7 @@ void LLMeshRepoThread::run()
mPhysicsShapeRequests.erase(iter);
mMutex->unlock();
- if (! fetchMeshPhysicsShape(mesh_id))
+ if (!fetchMeshPhysicsShape(mesh_id))
{
incomplete.insert(mesh_id);
}
@@ -988,7 +983,7 @@ void LLMeshRepoThread::run()
}
}
mMutex->unlock();
- }
+ }
// For dev purposes only. A dynamic change could make this false
// and that shouldn't assert.
@@ -1055,7 +1050,7 @@ void LLMeshRepoThread::loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod)
if (pending != mPendingLOD.end())
{ //append this lod request to existing header request
pending->second.push_back(lod);
- llassert(pending->second.size() <= LLModel::NUM_LODS)
+ llassert(pending->second.size() <= LLModel::NUM_LODS);
}
else
{ //if no header request is pending, fetch header
@@ -1196,7 +1191,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id)
}
++LLMeshRepository::sMeshRequestCount;
- bool ret = true;
+ bool ret = true ;
U32 header_size = mMeshHeaderSize[mesh_id];
if (header_size > 0)
@@ -1244,7 +1239,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id)
constructUrl(mesh_id, &http_url, &cap_version);
if (!http_url.empty())
- {
+ {
LLMeshSkinInfoHandler * handler = new LLMeshSkinInfoHandler(mesh_id, offset, size);
LLCore::HttpHandle handle = getByteRange(http_url, cap_version, offset, size, handler);
if (LLCORE_HTTP_HANDLE_INVALID == handle)
@@ -1291,7 +1286,7 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id)
++LLMeshRepository::sMeshRequestCount;
U32 header_size = mMeshHeaderSize[mesh_id];
- bool ret = true;
+ bool ret = true ;
if (header_size > 0)
{
@@ -1337,9 +1332,9 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id)
int cap_version(2);
std::string http_url;
constructUrl(mesh_id, &http_url, &cap_version);
-
+
if (!http_url.empty())
- {
+ {
LLMeshDecompositionHandler * handler = new LLMeshDecompositionHandler(mesh_id, offset, size);
LLCore::HttpHandle handle = getByteRange(http_url, cap_version, offset, size, handler);
if (LLCORE_HTTP_HANDLE_INVALID == handle)
@@ -1385,7 +1380,7 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id)
++LLMeshRepository::sMeshRequestCount;
U32 header_size = mMeshHeaderSize[mesh_id];
- bool ret = true;
+ bool ret = true ;
if (header_size > 0)
{
@@ -1430,9 +1425,9 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id)
int cap_version(2);
std::string http_url;
constructUrl(mesh_id, &http_url, &cap_version);
-
+
if (!http_url.empty())
- {
+ {
LLMeshPhysicsShapeHandler * handler = new LLMeshPhysicsShapeHandler(mesh_id, offset, size);
LLCore::HttpHandle handle = getByteRange(http_url, cap_version, offset, size, handler);
if (LLCORE_HTTP_HANDLE_INVALID == handle)
@@ -1521,11 +1516,11 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params)
}
//either cache entry doesn't exist or is corrupt, request header from simulator
- bool retval = true;
+ bool retval = true ;
int cap_version(2);
std::string http_url;
constructUrl(mesh_params.getSculptID(), &http_url, &cap_version);
-
+
if (!http_url.empty())
{
//grab first 4KB if we're going to bother with a fetch. Cache will prevent future fetches if a full mesh fits
@@ -1613,9 +1608,9 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod)
int cap_version(2);
std::string http_url;
constructUrl(mesh_id, &http_url, &cap_version);
-
+
if (!http_url.empty())
- {
+ {
LLMeshLODHandler * handler = new LLMeshLODHandler(mesh_params, lod, offset, size);
LLCore::HttpHandle handle = getByteRange(http_url, cap_version, offset, size, handler);
if (LLCORE_HTTP_HANDLE_INVALID == handle)
@@ -1865,7 +1860,7 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data,
bool upload_skin, bool upload_joints, const std::string & upload_url, bool do_upload,
LLHandle<LLWholeModelFeeObserver> fee_observer,
LLHandle<LLWholeModelUploadObserver> upload_observer)
- : LLThread("mesh upload"),
+: LLThread("mesh upload"),
LLCore::HttpHandler(),
mDiscarded(false),
mDoUpload(do_upload),
@@ -1887,7 +1882,7 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data,
mOrigin += gAgent.getAtAxis() * scale.magVec();
- mMeshUploadTimeOut = gSavedSettings.getS32("MeshUploadTimeOut");
+ mMeshUploadTimeOut = gSavedSettings.getS32("MeshUploadTimeOut") ;
mHttpRequest = new LLCore::HttpRequest;
mHttpOptions = new LLCore::HttpOptions;
@@ -1955,14 +1950,14 @@ void LLMeshUploadThread::preStart()
void LLMeshUploadThread::discard()
{
- LLMutexLock lock(mMutex);
+ LLMutexLock lock(mMutex) ;
mDiscarded = true;
}
bool LLMeshUploadThread::isDiscarded() const
{
- LLMutexLock lock(mMutex);
- return mDiscarded;
+ LLMutexLock lock(mMutex) ;
+ return mDiscarded ;
}
void LLMeshUploadThread::run()
@@ -2004,9 +1999,9 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
result["asset_type"] = "mesh";
result["inventory_type"] = "object";
result["description"] = "(No Description)";
- result["next_owner_mask"] = LLSD::Integer(LLFloaterPerms::getNextOwnerPerms());
- result["group_mask"] = LLSD::Integer(LLFloaterPerms::getGroupPerms());
- result["everyone_mask"] = LLSD::Integer(LLFloaterPerms::getEveryonePerms());
+ result["next_owner_mask"] = LLSD::Integer(LLFloaterPerms::getNextOwnerPerms("Uploads"));
+ result["group_mask"] = LLSD::Integer(LLFloaterPerms::getGroupPerms("Uploads"));
+ result["everyone_mask"] = LLSD::Integer(LLFloaterPerms::getEveryonePerms("Uploads"));
res["mesh_list"] = LLSD::emptyArray();
res["texture_list"] = LLSD::emptyArray();
@@ -2213,7 +2208,7 @@ void LLMeshUploadThread::generateHulls()
}
}
- if (has_valid_requests)
+ if(has_valid_requests)
{
// *NOTE: Interesting livelock condition on shutdown. If there
// is an upload request in generateHulls() when shutdown starts,
@@ -2245,7 +2240,7 @@ void LLMeshUploadThread::doWholeModelUpload()
mModelData = LLSD::emptyMap();
wholeModelToLLSD(mModelData, true);
LLSD body = mModelData["asset_resources"];
- dump_llsd_to_file(body, make_dump_name("whole_model_body_", dump_num));
+ dump_llsd_to_file(body,make_dump_name("whole_model_body_",dump_num));
LLCore::BufferArray * ba = new LLCore::BufferArray;
LLCore::BufferArrayStream bas(ba);
@@ -2276,7 +2271,7 @@ void LLMeshUploadThread::doWholeModelUpload()
mHttpRequest->update(0);
while (! LLApp::isQuitting() && ! finished() && ! isDiscarded())
- {
+ {
ms_sleep(sleep_time);
sleep_time = llmin(250U, sleep_time + sleep_time);
mHttpRequest->update(0);
@@ -2292,7 +2287,7 @@ void LLMeshUploadThread::doWholeModelUpload()
}
}
}
-}
+ }
void LLMeshUploadThread::requestWholeModelFee()
{
@@ -2323,11 +2318,11 @@ void LLMeshUploadThread::requestWholeModelFee()
LL_WARNS(LOG_MESH) << "Couldn't issue request for model fee. Reason: " << mHttpStatus.toString()
<< " (" << mHttpStatus.toTerseString() << ")"
<< LL_ENDL;
- }
+ }
else
{
U32 sleep_time(10);
-
+
mHttpRequest->update(0);
while (! LLApp::isQuitting() && ! finished() && ! isDiscarded())
{
@@ -2340,7 +2335,7 @@ void LLMeshUploadThread::requestWholeModelFee()
LL_DEBUGS(LOG_MESH) << "Mesh fee query operation discarded." << LL_ENDL;
}
}
-}
+ }
// Does completion duty for both fee queries and actual uploads.
@@ -2393,12 +2388,12 @@ void LLMeshUploadThread::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResp
{
LLCore::BufferArrayStream bas(ba);
LLSDSerialize::fromXML(body, bas);
- }
+}
}
dump_llsd_to_file(body, make_dump_name("whole_model_upload_response_", dump_num));
if (body["state"].asString() == "complete")
- {
+{
// requested "mesh" asset type isn't actually the type
// of the resultant object, fix it up here.
mModelData["asset_type"] = "object";
@@ -2426,7 +2421,7 @@ void LLMeshUploadThread::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResp
// model fee case
LLWholeModelFeeObserver* observer(mFeeObserverHandle.get());
mWholeModelUploadURL.clear();
-
+
if (! status)
{
LL_WARNS(LOG_MESH) << "Fee request failed. Reason: " << reason
@@ -2451,18 +2446,18 @@ void LLMeshUploadThread::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResp
body = llsd_from_file("fake_upload_error.xml");
}
else
- {
+ {
LLCore::BufferArray * ba(response->getBody());
if (ba && ba->size())
- {
+ {
LLCore::BufferArrayStream bas(ba);
LLSDSerialize::fromXML(body, bas);
- }
- }
+ }
+ }
dump_llsd_to_file(body, make_dump_name("whole_model_fee_response_", dump_num));
-
+
if (body["state"].asString() == "upload")
- {
+ {
mWholeModelUploadURL = body["uploader"].asString();
if (observer)
@@ -2531,7 +2526,7 @@ void LLMeshRepoThread::notifyLoadedMeshes()
LODRequest req = mUnavailableQ.front();
mUnavailableQ.pop();
mMutex->unlock();
-
+
update_metrics = true;
gMeshRepo.notifyMeshUnavailable(req.mMeshParams, req.mLOD);
}
@@ -2548,18 +2543,18 @@ void LLMeshRepoThread::notifyLoadedMeshes()
skin_info_q.swap(mSkinInfoQ);
}
if (! mDecompositionQ.empty())
- {
+ {
decomp_q.swap(mDecompositionQ);
- }
+ }
mMutex->unlock();
// Process the elements free of the lock
while (! skin_info_q.empty())
- {
+ {
gMeshRepo.notifySkinInfoReceived(skin_info_q.front());
skin_info_q.pop_front();
- }
+ }
while (! decomp_q.empty())
{
@@ -2656,7 +2651,7 @@ void LLMeshRepository::cacheOutgoingMesh(LLMeshUploadData& data, LLSD& header)
void LLMeshHandlerBase::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response)
{
mProcessed = true;
-
+
unsigned int retries(0U);
response->getRetries(NULL, &retries);
LLMeshRepository::sHTTPRetryCount += retries;
@@ -2688,18 +2683,18 @@ void LLMeshHandlerBase::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRespo
LL_WARNS_ONCE(LOG_MESH) << "Non-206 successful status received for fetch: "
<< status.toTerseString() << LL_ENDL;
}
-
+
LLCore::BufferArray * body(response->getBody());
S32 data_size(body ? body->size() : 0);
U8 * data(NULL);
- if (data_size > 0)
- {
+ if (data_size > 0)
+ {
// *TODO: Try to get rid of data copying and add interfaces
// that support BufferArray directly. Introduce a two-phase
// handler, optional first that takes a body, fallback second
// that requires a temporary allocation and data copy.
- data = new U8[data_size];
+ data = new U8[data_size];
body->read(0, (char *) data, data_size);
LLMeshRepository::sBytesReceived += data_size;
}
@@ -2744,7 +2739,7 @@ void LLMeshHeaderHandler::processFailure(LLCore::HttpStatus status)
{
gMeshRepo.mThread->mUnavailableQ.push(LLMeshRepoThread::LODRequest(mMeshParams, i));
}
-}
+ }
void LLMeshHeaderHandler::processData(LLCore::BufferArray * body, U8 * data, S32 data_size)
{
@@ -2761,12 +2756,12 @@ void LLMeshHeaderHandler::processData(LLCore::BufferArray * body, U8 * data, S32
// Can't get the header so none of the LODs will be available
LLMutexLock lock(gMeshRepo.mThread->mMutex);
for (int i(0); i < 4; ++i)
- {
+ {
gMeshRepo.mThread->mUnavailableQ.push(LLMeshRepoThread::LODRequest(mMeshParams, i));
- }
}
+ }
else if (data && data_size > 0)
- {
+ {
// header was successfully retrieved from sim, cache in vfs
LLSD header = gMeshRepo.mThread->mMeshHeader[mesh_id];
@@ -2779,12 +2774,12 @@ void LLMeshHeaderHandler::processData(LLCore::BufferArray * body, U8 * data, S32
S32 lod_bytes = 0;
for (U32 i = 0; i < LLModel::LOD_PHYSICS; ++i)
- {
+ {
// figure out how many bytes we'll need to reserve in the file
const std::string & lod_name = header_lod[i];
lod_bytes = llmax(lod_bytes, header[lod_name]["offset"].asInteger()+header[lod_name]["size"].asInteger());
- }
-
+ }
+
// just in case skin info or decomposition is at the end of the file (which it shouldn't be)
lod_bytes = llmax(lod_bytes, header["skin"]["offset"].asInteger() + header["skin"]["size"].asInteger());
lod_bytes = llmax(lod_bytes, header["physics_convex"]["offset"].asInteger() + header["physics_convex"]["size"].asInteger());
@@ -2792,37 +2787,37 @@ void LLMeshHeaderHandler::processData(LLCore::BufferArray * body, U8 * data, S32
S32 header_bytes = (S32) gMeshRepo.mThread->mMeshHeaderSize[mesh_id];
S32 bytes = lod_bytes + header_bytes;
-
+
// It's possible for the remote asset to have more data than is needed for the local cache
// only allocate as much space in the VFS as is needed for the local cache
data_size = llmin(data_size, bytes);
LLVFile file(gVFS, mesh_id, LLAssetType::AT_MESH, LLVFile::WRITE);
if (file.getMaxSize() >= bytes || file.setMaxSize(bytes))
- {
+ {
LLMeshRepository::sCacheBytesWritten += data_size;
++LLMeshRepository::sCacheWrites;
file.write(data, data_size);
-
+
// zero out the rest of the file
U8 block[MESH_HEADER_SIZE];
memset(block, 0, sizeof(block));
-
+
while (bytes-file.tell() > sizeof(block))
- {
+ {
file.write(block, sizeof(block));
- }
+ }
S32 remaining = bytes-file.tell();
if (remaining > 0)
- {
+ {
file.write(block, remaining);
}
}
}
}
-}
+ }
LLMeshLODHandler::~LLMeshLODHandler()
{
@@ -2834,8 +2829,8 @@ LLMeshLODHandler::~LLMeshLODHandler()
gMeshRepo.mThread->lockAndLoadMeshLOD(mMeshParams, mLOD);
}
LLMeshRepoThread::decActiveLODRequests();
+ }
}
-}
void LLMeshLODHandler::processFailure(LLCore::HttpStatus status)
{
@@ -2849,10 +2844,10 @@ void LLMeshLODHandler::processFailure(LLCore::HttpStatus status)
}
void LLMeshLODHandler::processData(LLCore::BufferArray * body, U8 * data, S32 data_size)
-{
+ {
if ((! MESH_LOD_PROCESS_FAILED) && gMeshRepo.mThread->lodReceived(mMeshParams, mLOD, data, data_size))
{
- // good fetch from sim, write to VFS for caching
+ //good fetch from sim, write to VFS for caching
LLVFile file(gVFS, mMeshParams.getSculptID(), LLAssetType::AT_MESH, LLVFile::WRITE);
S32 offset = mOffset;
@@ -2865,7 +2860,7 @@ void LLMeshLODHandler::processData(LLCore::BufferArray * body, U8 * data, S32 da
LLMeshRepository::sCacheBytesWritten += size;
++LLMeshRepository::sCacheWrites;
}
- }
+ }
else
{
LL_WARNS(LOG_MESH) << "Error during mesh LOD processing. ID: " << mMeshParams.getSculptID()
@@ -2877,12 +2872,12 @@ void LLMeshLODHandler::processData(LLCore::BufferArray * body, U8 * data, S32 da
}
LLMeshSkinInfoHandler::~LLMeshSkinInfoHandler()
-{
+ {
llassert(mProcessed);
-}
+ }
void LLMeshSkinInfoHandler::processFailure(LLCore::HttpStatus status)
-{
+ {
LL_WARNS(LOG_MESH) << "Error during mesh skin info handling. ID: " << mMeshID
<< ", Reason: " << status.toString()
<< " (" << status.toTerseString() << "). Not retrying."
@@ -2890,13 +2885,13 @@ void LLMeshSkinInfoHandler::processFailure(LLCore::HttpStatus status)
// *TODO: Mark mesh unavailable on error. For now, simply leave
// request unfulfilled rather than retry forever.
-}
+ }
void LLMeshSkinInfoHandler::processData(LLCore::BufferArray * body, U8 * data, S32 data_size)
-{
+ {
if ((! MESH_SKIN_INFO_PROCESS_FAILED) && gMeshRepo.mThread->skinInfoReceived(mMeshID, data, data_size))
{
- // good fetch from sim, write to VFS for caching
+ //good fetch from sim, write to VFS for caching
LLVFile file(gVFS, mMeshID, LLAssetType::AT_MESH, LLVFile::WRITE);
S32 offset = mOffset;
@@ -2925,14 +2920,14 @@ LLMeshDecompositionHandler::~LLMeshDecompositionHandler()
}
void LLMeshDecompositionHandler::processFailure(LLCore::HttpStatus status)
-{
+ {
LL_WARNS(LOG_MESH) << "Error during mesh decomposition handling. ID: " << mMeshID
<< ", Reason: " << status.toString()
<< " (" << status.toTerseString() << "). Not retrying."
<< LL_ENDL;
// *TODO: Mark mesh unavailable on error. For now, simply leave
// request unfulfilled rather than retry forever.
-}
+ }
void LLMeshDecompositionHandler::processData(LLCore::BufferArray * body, U8 * data, S32 data_size)
{
@@ -2951,34 +2946,34 @@ void LLMeshDecompositionHandler::processData(LLCore::BufferArray * body, U8 * da
file.seek(offset);
file.write(data, size);
}
- }
- else
- {
+ }
+ else
+ {
LL_WARNS(LOG_MESH) << "Error during mesh decomposition processing. ID: " << mMeshID
<< ", Unknown reason. Not retrying."
<< LL_ENDL;
// *TODO: Mark mesh unavailable on error
+ }
}
-}
LLMeshPhysicsShapeHandler::~LLMeshPhysicsShapeHandler()
-{
+ {
llassert(mProcessed);
-}
+ }
void LLMeshPhysicsShapeHandler::processFailure(LLCore::HttpStatus status)
-{
+ {
LL_WARNS(LOG_MESH) << "Error during mesh physics shape handling. ID: " << mMeshID
<< ", Reason: " << status.toString()
<< " (" << status.toTerseString() << "). Not retrying."
<< LL_ENDL;
// *TODO: Mark mesh unavailable on error
-}
+ }
void LLMeshPhysicsShapeHandler::processData(LLCore::BufferArray * body, U8 * data, S32 data_size)
-{
+ {
if ((! MESH_PHYS_SHAPE_PROCESS_FAILED) && gMeshRepo.mThread->physicsShapeReceived(mMeshID, data, data_size))
- {
+ {
// good fetch from sim, write to VFS for caching
LLVFile file(gVFS, mMeshID, LLAssetType::AT_MESH, LLVFile::WRITE);
@@ -2986,13 +2981,13 @@ void LLMeshPhysicsShapeHandler::processData(LLCore::BufferArray * body, U8 * dat
S32 size = mRequestedBytes;
if (file.getSize() >= offset+size)
- {
+ {
LLMeshRepository::sCacheBytesWritten += size;
++LLMeshRepository::sCacheWrites;
file.seek(offset);
file.write(data, size);
+ }
}
- }
else
{
LL_WARNS(LOG_MESH) << "Error during mesh physics shape processing. ID: " << mMeshID
@@ -3104,7 +3099,7 @@ S32 LLMeshRepository::update()
S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_params, S32 detail, S32 last_lod)
{
- MESH_FASTTIMER_DEFBLOCK;
+ LL_RECORD_BLOCK_TIME(FTM_MESH_FETCH);
// Manage time-to-load metrics for mesh download operations.
metricsProgress(1);
@@ -3187,12 +3182,12 @@ S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_para
void LLMeshRepository::notifyLoadedMeshes()
{ //called from main thread
- MESH_FASTTIMER_DEFBLOCK;
+ LL_RECORD_BLOCK_TIME(FTM_MESH_FETCH);
if (1 == mGetMeshVersion)
{
// Legacy GetMesh operation with high connection concurrency
- LLMeshRepoThread::sMaxConcurrentRequests = gSavedSettings.getU32("MeshMaxConcurrentRequests");
+ LLMeshRepoThread::sMaxConcurrentRequests = gSavedSettings.getU32("MeshMaxConcurrentRequests");
LLMeshRepoThread::sRequestHighWater = llclamp(2 * S32(LLMeshRepoThread::sMaxConcurrentRequests),
REQUEST_HIGH_WATER_MIN,
REQUEST_HIGH_WATER_MAX);
@@ -3212,7 +3207,7 @@ void LLMeshRepository::notifyLoadedMeshes()
REQUEST2_LOW_WATER_MIN,
REQUEST2_LOW_WATER_MAX);
}
-
+
//clean up completed upload threads
for (std::vector<LLMeshUploadThread*>::iterator iter = mUploads.begin(); iter != mUploads.end(); )
{
@@ -3289,7 +3284,7 @@ void LLMeshRepository::notifyLoadedMeshes()
//call completed callbacks on finished decompositions
mDecompThread->notifyCompleted();
-
+
// For major operations, attempt to get the required locks
// without blocking and punt if they're not available. The
// longest run of holdoffs is kept in sMaxLockHoldoffs just
@@ -3305,18 +3300,18 @@ void LLMeshRepository::notifyLoadedMeshes()
// If we can't get the locks, skip and pick this up later.
++hold_offs;
sMaxLockHoldoffs = llmax(sMaxLockHoldoffs, hold_offs);
- return;
- }
+ return;
+ }
hold_offs = 0;
-
+
if (gAgent.getRegion())
{
// Update capability urls
- static std::string region_name("never name a region this");
-
- if (gAgent.getRegion()->getName() != region_name && gAgent.getRegion()->capabilitiesReceived())
- {
- region_name = gAgent.getRegion()->getName();
+ static std::string region_name("never name a region this");
+
+ if (gAgent.getRegion()->getName() != region_name && gAgent.getRegion()->capabilitiesReceived())
+ {
+ region_name = gAgent.getRegion()->getName();
const bool use_v1(gSavedSettings.getBOOL("MeshUseGetMesh1"));
const std::string mesh1(gAgent.getRegion()->getCapability("GetMesh"));
const std::string mesh2(gAgent.getRegion()->getCapability("GetMesh2"));
@@ -3327,9 +3322,9 @@ void LLMeshRepository::notifyLoadedMeshes()
<< ", GetMesh: " << mesh1
<< ", using version: " << mGetMeshVersion
<< LL_ENDL;
- }
}
-
+ }
+
//popup queued error messages from background threads
while (!mUploadErrorQ.empty())
{
@@ -3343,46 +3338,46 @@ void LLMeshRepository::notifyLoadedMeshes()
S32 push_count = LLMeshRepoThread::sRequestHighWater - active_count;
if (mPendingRequests.size() > push_count)
- {
+ {
// More requests than the high-water limit allows so
// sort and forward the most important.
- //calculate "score" for pending requests
+ //calculate "score" for pending requests
- //create score map
- std::map<LLUUID, F32> score_map;
+ //create score map
+ std::map<LLUUID, F32> score_map;
- for (U32 i = 0; i < 4; ++i)
+ for (U32 i = 0; i < 4; ++i)
+ {
+ for (mesh_load_map::iterator iter = mLoadingMeshes[i].begin(); iter != mLoadingMeshes[i].end(); ++iter)
{
- for (mesh_load_map::iterator iter = mLoadingMeshes[i].begin(); iter != mLoadingMeshes[i].end(); ++iter)
+ F32 max_score = 0.f;
+ for (std::set<LLUUID>::iterator obj_iter = iter->second.begin(); obj_iter != iter->second.end(); ++obj_iter)
{
- F32 max_score = 0.f;
- for (std::set<LLUUID>::iterator obj_iter = iter->second.begin(); obj_iter != iter->second.end(); ++obj_iter)
- {
- LLViewerObject* object = gObjectList.findObject(*obj_iter);
+ LLViewerObject* object = gObjectList.findObject(*obj_iter);
- if (object)
+ if (object)
+ {
+ LLDrawable* drawable = object->mDrawable;
+ if (drawable)
{
- LLDrawable* drawable = object->mDrawable;
- if (drawable)
- {
- F32 cur_score = drawable->getRadius()/llmax(drawable->mDistanceWRTCamera, 1.f);
- max_score = llmax(max_score, cur_score);
- }
+ F32 cur_score = drawable->getRadius()/llmax(drawable->mDistanceWRTCamera, 1.f);
+ max_score = llmax(max_score, cur_score);
}
}
-
- score_map[iter->first.getSculptID()] = max_score;
}
+
+ score_map[iter->first.getSculptID()] = max_score;
}
+ }
- //set "score" for pending requests
- for (std::vector<LLMeshRepoThread::LODRequest>::iterator iter = mPendingRequests.begin(); iter != mPendingRequests.end(); ++iter)
- {
- iter->mScore = score_map[iter->mMeshParams.getSculptID()];
- }
+ //set "score" for pending requests
+ for (std::vector<LLMeshRepoThread::LODRequest>::iterator iter = mPendingRequests.begin(); iter != mPendingRequests.end(); ++iter)
+ {
+ iter->mScore = score_map[iter->mMeshParams.getSculptID()];
+ }
- //sort by "score"
+ //sort by "score"
std::partial_sort(mPendingRequests.begin(), mPendingRequests.begin() + push_count,
mPendingRequests.end(), LLMeshRepoThread::CompareScoreGreater());
}
@@ -3540,7 +3535,7 @@ S32 LLMeshRepository::getActualMeshLOD(const LLVolumeParams& mesh_params, S32 lo
const LLMeshSkinInfo* LLMeshRepository::getSkinInfo(const LLUUID& mesh_id, const LLVOVolume* requesting_obj)
{
- MESH_FASTTIMER_DEFBLOCK;
+ LL_RECORD_BLOCK_TIME(FTM_MESH_FETCH);
if (mesh_id.notNull())
{
@@ -3568,7 +3563,7 @@ const LLMeshSkinInfo* LLMeshRepository::getSkinInfo(const LLUUID& mesh_id, const
void LLMeshRepository::fetchPhysicsShape(const LLUUID& mesh_id)
{
- MESH_FASTTIMER_DEFBLOCK;
+ LL_RECORD_BLOCK_TIME(FTM_MESH_FETCH);
if (mesh_id.notNull())
{
@@ -3598,7 +3593,7 @@ void LLMeshRepository::fetchPhysicsShape(const LLUUID& mesh_id)
LLModel::Decomposition* LLMeshRepository::getDecomposition(const LLUUID& mesh_id)
{
- MESH_FASTTIMER_DEFBLOCK;
+ LL_RECORD_BLOCK_TIME(FTM_MESH_FETCH);
LLModel::Decomposition* ret = NULL;
@@ -3662,7 +3657,7 @@ bool LLMeshRepository::hasPhysicsShape(const LLUUID& mesh_id)
LLSD& LLMeshRepository::getMeshHeader(const LLUUID& mesh_id)
{
- MESH_FASTTIMER_DEFBLOCK;
+ LL_RECORD_BLOCK_TIME(FTM_MESH_FETCH);
return mThread->getMeshHeader(mesh_id);
}
@@ -3685,7 +3680,7 @@ LLSD& LLMeshRepoThread::getMeshHeader(const LLUUID& mesh_id)
void LLMeshRepository::uploadModel(std::vector<LLModelInstance>& data, LLVector3& scale, bool upload_textures,
- bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload,
+ bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload,
LLHandle<LLWholeModelFeeObserver> fee_observer, LLHandle<LLWholeModelUploadObserver> upload_observer)
{
LLMeshUploadThread* thread = new LLMeshUploadThread(data, scale, upload_textures, upload_skin, upload_joints, upload_url,
@@ -4184,7 +4179,7 @@ void LLPhysicsDecomp::doDecompositionSingleHull()
setMeshData(mesh, true);
LLCDResult ret = decomp->buildSingleHull() ;
- if (ret)
+ if(ret)
{
LL_WARNS(LOG_MESH) << "Could not execute decomposition stage when attempting to create single hull." << LL_ENDL;
make_box(mCurRequest);
diff --git a/indra/newview/llmimetypes.cpp b/indra/newview/llmimetypes.cpp
index e689e39b26..790a184068 100755
--- a/indra/newview/llmimetypes.cpp
+++ b/indra/newview/llmimetypes.cpp
@@ -55,8 +55,8 @@ bool LLMIMETypes::parseMIMETypes(const std::string& xml_filename)
bool success = LLUICtrlFactory::getLayeredXMLNode(xml_filename, root);
if ( ! success || root.isNull() || ! root->hasName( "mimetypes" ) )
{
- llwarns << "Unable to read MIME type file: "
- << xml_filename << llendl;
+ LL_WARNS() << "Unable to read MIME type file: "
+ << xml_filename << LL_ENDL;
return false;
}
diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp
index 8bddf49fb5..fe562baf96 100755
--- a/indra/newview/llmoveview.cpp
+++ b/indra/newview/llmoveview.cpp
@@ -549,7 +549,7 @@ void LLPanelStandStopFlying::clearStandStopFlyingMode(EStandStopFlyingMode mode)
panel->mStopFlyingButton->setVisible(FALSE);
break;
default:
- llerrs << "Unexpected EStandStopFlyingMode is passed: " << mode << llendl;
+ LL_ERRS() << "Unexpected EStandStopFlyingMode is passed: " << mode << LL_ENDL;
}
}
@@ -614,7 +614,7 @@ void LLPanelStandStopFlying::reparent(LLFloaterMove* move_view)
LLPanel* parent = dynamic_cast<LLPanel*>(getParent());
if (!parent)
{
- llwarns << "Stand/stop flying panel parent is unset, already attached?: " << mAttached << ", new parent: " << (move_view == NULL ? "NULL" : "Move Floater") << llendl;
+ LL_WARNS() << "Stand/stop flying panel parent is unset, already attached?: " << mAttached << ", new parent: " << (move_view == NULL ? "NULL" : "Move Floater") << LL_ENDL;
return;
}
@@ -636,7 +636,7 @@ void LLPanelStandStopFlying::reparent(LLFloaterMove* move_view)
{
if (!mOriginalParent.get())
{
- llwarns << "Original parent of the stand / stop flying panel not found" << llendl;
+ LL_WARNS() << "Original parent of the stand / stop flying panel not found" << LL_ENDL;
return;
}
@@ -664,7 +664,7 @@ LLPanelStandStopFlying* LLPanelStandStopFlying::getStandStopFlyingPanel()
panel->setVisible(FALSE);
//LLUI::getRootView()->addChild(panel);
- llinfos << "Build LLPanelStandStopFlying panel" << llendl;
+ LL_INFOS() << "Build LLPanelStandStopFlying panel" << LL_ENDL;
panel->updatePosition();
return panel;
diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp
index 0720d443f8..65ac11092c 100755
--- a/indra/newview/llmutelist.cpp
+++ b/indra/newview/llmutelist.cpp
@@ -234,21 +234,21 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags)
// Can't mute empty string by name
if (mute.mName.empty())
{
- llwarns << "Trying to mute empty string by-name" << llendl;
+ LL_WARNS() << "Trying to mute empty string by-name" << LL_ENDL;
return FALSE;
}
// Null mutes must have uuid null
if (mute.mID.notNull())
{
- llwarns << "Trying to add by-name mute with non-null id" << llendl;
+ LL_WARNS() << "Trying to add by-name mute with non-null id" << LL_ENDL;
return FALSE;
}
std::pair<string_set_t::iterator, bool> result = mLegacyMutes.insert(mute.mName);
if (result.second)
{
- llinfos << "Muting by name " << mute.mName << llendl;
+ LL_INFOS() << "Muting by name " << mute.mName << LL_ENDL;
updateAdd(mute);
notifyObservers();
notifyObserversDetailed(mute);
@@ -297,7 +297,7 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags)
std::pair<mute_set_t::iterator, bool> result = mMutes.insert(localmute);
if (result.second)
{
- llinfos << "Muting " << localmute.mName << " id " << localmute.mID << " flags " << localmute.mFlags << llendl;
+ LL_INFOS() << "Muting " << localmute.mName << " id " << localmute.mID << " flags " << localmute.mFlags << LL_ENDL;
updateAdd(localmute);
notifyObservers();
notifyObserversDetailed(localmute);
@@ -387,14 +387,14 @@ BOOL LLMuteList::remove(const LLMute& mute, U32 flags)
{
// The entry was actually removed. Notify the server.
updateRemove(localmute);
- llinfos << "Unmuting " << localmute.mName << " id " << localmute.mID << " flags " << localmute.mFlags << llendl;
+ LL_INFOS() << "Unmuting " << localmute.mName << " id " << localmute.mID << " flags " << localmute.mFlags << LL_ENDL;
}
else
{
// Flags were updated, the mute entry needs to be retransmitted to the server and re-added to the list.
mMutes.insert(localmute);
updateAdd(localmute);
- llinfos << "Updating mute entry " << localmute.mName << " id " << localmute.mID << " flags " << localmute.mFlags << llendl;
+ LL_INFOS() << "Updating mute entry " << localmute.mName << " id " << localmute.mID << " flags " << localmute.mFlags << LL_ENDL;
}
// Must be after erase.
@@ -531,14 +531,14 @@ BOOL LLMuteList::loadFromFile(const std::string& filename)
{
if(!filename.size())
{
- llwarns << "Mute List Filename is Empty!" << llendl;
+ LL_WARNS() << "Mute List Filename is Empty!" << LL_ENDL;
return FALSE;
}
LLFILE* fp = LLFile::fopen(filename, "rb"); /*Flawfinder: ignore*/
if (!fp)
{
- llwarns << "Couldn't open mute list " << filename << llendl;
+ LL_WARNS() << "Couldn't open mute list " << filename << LL_ENDL;
return FALSE;
}
@@ -581,14 +581,14 @@ BOOL LLMuteList::saveToFile(const std::string& filename)
{
if(!filename.size())
{
- llwarns << "Mute List Filename is Empty!" << llendl;
+ LL_WARNS() << "Mute List Filename is Empty!" << LL_ENDL;
return FALSE;
}
LLFILE* fp = LLFile::fopen(filename, "wb"); /*Flawfinder: ignore*/
if (!fp)
{
- llwarns << "Couldn't open mute list " << filename << llendl;
+ LL_WARNS() << "Couldn't open mute list " << filename << LL_ENDL;
return FALSE;
}
// legacy mutes have null uuid
@@ -691,12 +691,12 @@ void LLMuteList::cache(const LLUUID& agent_id)
void LLMuteList::processMuteListUpdate(LLMessageSystem* msg, void**)
{
- llinfos << "LLMuteList::processMuteListUpdate()" << llendl;
+ LL_INFOS() << "LLMuteList::processMuteListUpdate()" << LL_ENDL;
LLUUID agent_id;
msg->getUUIDFast(_PREHASH_MuteData, _PREHASH_AgentID, agent_id);
if(agent_id != gAgent.getID())
{
- llwarns << "Got an mute list update for the wrong agent." << llendl;
+ LL_WARNS() << "Got an mute list update for the wrong agent." << LL_ENDL;
return;
}
std::string unclean_filename;
@@ -716,7 +716,7 @@ void LLMuteList::processMuteListUpdate(LLMessageSystem* msg, void**)
void LLMuteList::processUseCachedMuteList(LLMessageSystem* msg, void**)
{
- llinfos << "LLMuteList::processUseCachedMuteList()" << llendl;
+ LL_INFOS() << "LLMuteList::processUseCachedMuteList()" << LL_ENDL;
std::string agent_id_string;
gAgent.getID().toString(agent_id_string);
@@ -727,7 +727,7 @@ void LLMuteList::processUseCachedMuteList(LLMessageSystem* msg, void**)
void LLMuteList::onFileMuteList(void** user_data, S32 error_code, LLExtStat ext_status)
{
- llinfos << "LLMuteList::processMuteListFile()" << llendl;
+ LL_INFOS() << "LLMuteList::processMuteListFile()" << LL_ENDL;
std::string* local_filename_and_path = (std::string*)user_data;
if(local_filename_and_path && !local_filename_and_path->empty() && (error_code == 0))
diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp
index 7ddd04fed0..54e4c6c1da 100755
--- a/indra/newview/llnamelistctrl.cpp
+++ b/indra/newview/llnamelistctrl.cpp
@@ -65,14 +65,14 @@ LLNameListCtrl::LLNameListCtrl(const LLNameListCtrl::Params& p)
mNameColumn(p.name_column.column_name),
mAllowCallingCardDrop(p.allow_calling_card_drop),
mShortNames(p.short_names),
- mAvatarNameCacheConnection()
+ mPendingLookupsRemaining(0)
{}
// public
LLScrollListItem* LLNameListCtrl::addNameItem(const LLUUID& agent_id, EAddPosition pos,
BOOL enabled, const std::string& suffix)
{
- //llinfos << "LLNameListCtrl::addNameItem " << agent_id << llendl;
+ //LL_INFOS() << "LLNameListCtrl::addNameItem " << agent_id << LL_ENDL;
NameItem item;
item.value = agent_id;
@@ -125,7 +125,7 @@ BOOL LLNameListCtrl::handleDragAndDrop(
}
handled = TRUE;
- lldebugst(LLERR_USER_INPUT) << "dragAndDrop handled by LLNameListCtrl " << getName() << llendl;
+ LL_DEBUGS("UserInput") << "dragAndDrop handled by LLNameListCtrl " << getName() << LL_ENDL;
return handled;
}
@@ -178,7 +178,7 @@ void LLNameListCtrl::mouseOverHighlightNthItem( S32 target_index )
}
else
{
- llwarns << "highlighted name list item is NULL" << llendl;
+ LL_WARNS() << "highlighted name list item is NULL" << LL_ENDL;
}
}
if(target_index != -1)
@@ -192,7 +192,7 @@ void LLNameListCtrl::mouseOverHighlightNthItem( S32 target_index )
}
else
{
- llwarns << "target name item is NULL" << llendl;
+ LL_WARNS() << "target name item is NULL" << LL_ENDL;
}
}
}
@@ -328,13 +328,27 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow(
else
{
// ...schedule a callback
- // This is not correct and will likely lead to partially populated lists in cases where avatar names are not cached.
- // *TODO : Change this to have 2 callbacks : one callback per list item and one for the whole list.
- if (mAvatarNameCacheConnection.connected())
+ avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(id);
+ if (it != mAvatarNameCacheConnections.end())
{
- mAvatarNameCacheConnection.disconnect();
+ if (it->second.connected())
+ {
+ it->second.disconnect();
+ }
+ mAvatarNameCacheConnections.erase(it);
}
- mAvatarNameCacheConnection = LLAvatarNameCache::get(id,boost::bind(&LLNameListCtrl::onAvatarNameCache,this, _1, _2, item->getHandle()));
+ mAvatarNameCacheConnections[id] = LLAvatarNameCache::get(id,boost::bind(&LLNameListCtrl::onAvatarNameCache,this, _1, _2, suffix, item->getHandle()));
+
+ if(mPendingLookupsRemaining <= 0)
+ {
+ // BAKER TODO:
+ // We might get into a state where mPendingLookupsRemaining might
+ // go negative. So just reset it right now and figure out if it's
+ // possible later :)
+ mPendingLookupsRemaining = 0;
+ mNameListCompleteSignal(false);
+ }
+ mPendingLookupsRemaining++;
}
break;
}
@@ -386,14 +400,25 @@ void LLNameListCtrl::removeNameItem(const LLUUID& agent_id)
{
selectNthItem(idx); // not sure whether this is needed, taken from previous implementation
deleteSingleItem(idx);
+
+ mPendingLookupsRemaining--;
}
}
void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id,
const LLAvatarName& av_name,
+ std::string suffix,
LLHandle<LLNameListItem> item)
{
- mAvatarNameCacheConnection.disconnect();
+ avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(agent_id);
+ if (it != mAvatarNameCacheConnections.end())
+ {
+ if (it->second.connected())
+ {
+ it->second.disconnect();
+ }
+ mAvatarNameCacheConnections.erase(it);
+ }
std::string name;
if (mShortNames)
@@ -401,6 +426,12 @@ void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id,
else
name = av_name.getCompleteName();
+ // Append optional suffix.
+ if (!suffix.empty())
+ {
+ name.append(suffix);
+ }
+
LLNameListItem* list_item = item.get();
if (list_item && list_item->getUUID() == agent_id)
{
@@ -412,6 +443,23 @@ void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id,
}
}
+ //////////////////////////////////////////////////////////////////////////
+ // BAKER - FIX NameListCtrl
+ //if (mPendingLookupsRemaining <= 0)
+ {
+ // We might get into a state where mPendingLookupsRemaining might
+ // go negative. So just reset it right now and figure out if it's
+ // possible later :)
+ //mPendingLookupsRemaining = 0;
+
+ mNameListCompleteSignal(true);
+ }
+ //else
+ {
+ // mPendingLookupsRemaining--;
+ }
+ //////////////////////////////////////////////////////////////////////////
+
dirtyColumns();
}
diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h
index 92e82b672d..2c40eeaaca 100755
--- a/indra/newview/llnamelistctrl.h
+++ b/indra/newview/llnamelistctrl.h
@@ -67,6 +67,7 @@ class LLNameListCtrl
: public LLScrollListCtrl, public LLInstanceTracker<LLNameListCtrl>
{
public:
+ typedef boost::signals2::signal<void(bool)> namelist_complete_signal_t;
typedef enum e_name_type
{
@@ -114,10 +115,14 @@ protected:
LLNameListCtrl(const Params&);
virtual ~LLNameListCtrl()
{
- if (mAvatarNameCacheConnection.connected())
+ for (avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.begin(); it != mAvatarNameCacheConnections.end(); ++it)
{
- mAvatarNameCacheConnection.disconnect();
+ if (it->second.connected())
+ {
+ it->second.disconnect();
+ }
}
+ mAvatarNameCacheConnections.clear();
}
friend class LLUICtrlFactory;
public:
@@ -152,17 +157,28 @@ public:
/*virtual*/ void updateColumns(bool force_update);
- /*virtual*/ void mouseOverHighlightNthItem( S32 index );
+ /*virtual*/ void mouseOverHighlightNthItem( S32 index );
private:
void showInspector(const LLUUID& avatar_id, bool is_group);
- void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name, LLHandle<LLNameListItem> item);
+ void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name, std::string suffix, LLHandle<LLNameListItem> item);
private:
S32 mNameColumnIndex;
std::string mNameColumn;
BOOL mAllowCallingCardDrop;
bool mShortNames; // display name only, no SLID
- boost::signals2::connection mAvatarNameCacheConnection;
+ typedef std::map<LLUUID, boost::signals2::connection> avatar_name_cache_connection_map_t;
+ avatar_name_cache_connection_map_t mAvatarNameCacheConnections;
+
+ S32 mPendingLookupsRemaining;
+ namelist_complete_signal_t mNameListCompleteSignal;
+
+public:
+ boost::signals2::connection setOnNameListCompleteCallback(boost::function<void(bool)> onNameListCompleteCallback)
+ {
+ return mNameListCompleteSignal.connect(onNameListCompleteCallback);
+ }
+
};
diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp
index 95caa2731a..8c4849d28d 100755
--- a/indra/newview/llnavigationbar.cpp
+++ b/indra/newview/llnavigationbar.cpp
@@ -600,7 +600,7 @@ void LLNavigationBar::onRegionNameResponse(
LLVector3d region_pos = from_region_handle(region_handle);
LLVector3d global_pos = region_pos + (LLVector3d) local_coords;
- llinfos << "Teleporting to: " << LLSLURL(region_name, global_pos).getSLURLString() << llendl;
+ LL_INFOS() << "Teleporting to: " << LLSLURL(region_name, global_pos).getSLURLString() << LL_ENDL;
gAgent.teleportViaLocation(global_pos);
}
else if (gSavedSettings.getBOOL("SearchFromAddressBar"))
@@ -614,7 +614,7 @@ void LLNavigationBar::showTeleportHistoryMenu(LLUICtrl* btn_ctrl)
// Don't show the popup if teleport history is empty.
if (LLTeleportHistory::getInstance()->isEmpty())
{
- lldebugs << "Teleport history is empty, will not show the menu." << llendl;
+ LL_DEBUGS() << "Teleport history is empty, will not show the menu." << LL_ENDL;
return;
}
diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp
index 08b5eaedbb..1685a18e26 100755
--- a/indra/newview/llnetmap.cpp
+++ b/indra/newview/llnetmap.cpp
@@ -162,7 +162,7 @@ void LLNetMap::draw()
static LLUICachedControl<bool> auto_center("MiniMapAutoCenter", true);
if (auto_center)
{
- mCurPan = lerp(mCurPan, mTargetPan, LLCriticalDamp::getInterpolant(0.1f));
+ mCurPan = lerp(mCurPan, mTargetPan, LLSmoothInterpolation::getInterpolant(0.1f));
}
// Prepare a scissor region
diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp
index ef4d735616..a078889d46 100755
--- a/indra/newview/llnotificationhandlerutil.cpp
+++ b/indra/newview/llnotificationhandlerutil.cpp
@@ -135,7 +135,7 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_fi
if (from_id.isNull())
{
// Normal behavior for system generated messages, don't spam.
- // llwarns << " from_id for notification " << notification->getName() << " is null " << llendl;
+ // LL_WARNS() << " from_id for notification " << notification->getName() << " is null " << LL_ENDL;
return;
}
@@ -158,9 +158,9 @@ void LLHandlerUtil::logGroupNoticeToIMGroup(
LLGroupData groupData;
if (!gAgent.getGroupData(payload["group_id"].asUUID(), groupData))
{
- llwarns
+ LL_WARNS()
<< "Group notice for unknown group: "
- << payload["group_id"].asUUID() << llendl;
+ << payload["group_id"].asUUID() << LL_ENDL;
return;
}
diff --git a/indra/newview/llnotificationstorage.cpp b/indra/newview/llnotificationstorage.cpp
index 2923221c90..e9970de58c 100755
--- a/indra/newview/llnotificationstorage.cpp
+++ b/indra/newview/llnotificationstorage.cpp
@@ -103,19 +103,21 @@ bool LLNotificationStorage::writeNotifications(const LLSD& pNotificationData) co
return didFileOpen;
}
-bool LLNotificationStorage::readNotifications(LLSD& pNotificationData) const
+bool LLNotificationStorage::readNotifications(LLSD& pNotificationData, bool is_new_filename) const
{
- LL_INFOS("LLNotificationStorage") << "starting read '" << mFileName << "'" << LL_ENDL;
+ std::string filename = is_new_filename? mFileName : mOldFileName;
+
+ LL_INFOS("LLNotificationStorage") << "starting read '" << filename << "'" << LL_ENDL;
bool didFileRead;
pNotificationData.clear();
- llifstream notifyFile(mFileName.c_str());
+ llifstream notifyFile(filename.c_str());
didFileRead = notifyFile.is_open();
if (!didFileRead)
{
- LL_WARNS("LLNotificationStorage") << "Failed to open file '" << mFileName << "'" << LL_ENDL;
+ LL_WARNS("LLNotificationStorage") << "Failed to open file '" << filename << "'" << LL_ENDL;
}
else
{
@@ -128,7 +130,19 @@ bool LLNotificationStorage::readNotifications(LLSD& pNotificationData) const
}
}
- LL_INFOS("LLNotificationStorage") << "ending read '" << mFileName << "'" << LL_ENDL;
+ LL_INFOS("LLNotificationStorage") << "ending read '" << filename << "'" << LL_ENDL;
+ if (!didFileRead)
+ {
+ if(is_new_filename)
+ {
+ didFileRead = readNotifications(pNotificationData, false);
+ if(didFileRead)
+ {
+ writeNotifications(pNotificationData);
+ LLFile::remove(mOldFileName);
+ }
+ }
+ }
return didFileRead;
}
diff --git a/indra/newview/llnotificationstorage.h b/indra/newview/llnotificationstorage.h
index 53fd898ea4..21d7123747 100755
--- a/indra/newview/llnotificationstorage.h
+++ b/indra/newview/llnotificationstorage.h
@@ -43,13 +43,15 @@ public:
protected:
bool writeNotifications(const LLSD& pNotificationData) const;
- bool readNotifications(LLSD& pNotificationData) const;
+ bool readNotifications(LLSD& pNotificationData, bool is_new_filename = true) const;
void setFileName(std::string pFileName) {mFileName = pFileName;}
+ void setOldFileName(std::string pFileName) {mOldFileName = pFileName;}
LLNotificationResponderInterface* createResponder(const std::string& pNotificationName, const LLSD& pParams) const;
private:
std::string mFileName;
+ std::string mOldFileName;
};
#endif // LL_NOTIFICATIONSTORAGE_H
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp
index ff8bfafb79..883221382c 100755
--- a/indra/newview/lloutfitslist.cpp
+++ b/indra/newview/lloutfitslist.cpp
@@ -90,7 +90,7 @@ const outfit_accordion_tab_params& get_accordion_tab_params()
}
else
{
- llwarns << "Failed to read xml of Outfit's Accordion Tab from outfit_accordion_tab.xml" << llendl;
+ LL_WARNS() << "Failed to read xml of Outfit's Accordion Tab from outfit_accordion_tab.xml" << LL_ENDL;
}
}
@@ -204,7 +204,7 @@ private:
LLWearableType::EType type = LLWearableType::typeNameToType(data.asString());
if (type == LLWearableType::WT_NONE)
{
- llwarns << "Invalid wearable type" << llendl;
+ LL_WARNS() << "Invalid wearable type" << LL_ENDL;
return;
}
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp
index 679b1bdcda..5d1b582d1f 100755
--- a/indra/newview/llpanelavatar.cpp
+++ b/indra/newview/llpanelavatar.cpp
@@ -29,7 +29,6 @@
#include "llagent.h"
#include "llavataractions.h"
-#include "llavatarconstants.h" // AVATAR_ONLINE
#include "llcallingcard.h"
#include "llcombobox.h"
#include "lldateutil.h" // ageFromDate()
@@ -98,7 +97,7 @@ LLDropTarget::~LLDropTarget()
void LLDropTarget::doDrop(EDragAndDropType cargo_type, void* cargo_data)
{
- llinfos << "LLDropTarget::doDrop()" << llendl;
+ LL_INFOS() << "LLDropTarget::doDrop()" << LL_ENDL;
}
BOOL LLDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
diff --git a/indra/newview/llpanelblockedlist.cpp b/indra/newview/llpanelblockedlist.cpp
index 9665314e75..81ed2963e6 100755
--- a/indra/newview/llpanelblockedlist.cpp
+++ b/indra/newview/llpanelblockedlist.cpp
@@ -90,7 +90,7 @@ BOOL LLPanelBlockedList::postBuild()
mBlockedList->sortByType();
break;
default:
- llwarns << "Unrecognized sort order for blocked list" << llendl;
+ LL_WARNS() << "Unrecognized sort order for blocked list" << LL_ENDL;
break;
}
diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp
index 862e4be203..3cd39d7c7e 100755
--- a/indra/newview/llpanelclassified.cpp
+++ b/indra/newview/llpanelclassified.cpp
@@ -52,6 +52,7 @@
#include "llfloaterworldmap.h"
#include "llviewergenericmessage.h" // send_generic_message
#include "llviewerregion.h"
+#include "llviewertexture.h"
#include "lltrans.h"
#include "llscrollcontainer.h"
#include "llstatusbar.h"
@@ -95,15 +96,11 @@ class LLClassifiedClickMessageResponder : public LLHTTPClient::Responder
{
LOG_CLASS(LLClassifiedClickMessageResponder);
-public:
+protected:
// If we get back an error (not found, etc...), handle it here
- virtual void errorWithContent(
- U32 status,
- const std::string& reason,
- const LLSD& content)
+ virtual void httpFailure()
{
- llwarns << "Sending click message failed (" << status << "): [" << reason << "]" << llendl;
- llwarns << "Content: [" << content << "]" << llendl;
+ LL_WARNS() << "Sending click message failed " << dumpResponse() << LL_ENDL;
}
};
@@ -219,7 +216,7 @@ void LLPanelClassifiedInfo::onOpen(const LLSD& key)
setSnapshotId(key["classified_snapshot_id"]);
setFromSearch(key["from_search"]);
- llinfos << "Opening classified [" << getClassifiedName() << "] (" << getClassifiedId() << ")" << llendl;
+ LL_INFOS() << "Opening classified [" << getClassifiedName() << "] (" << getClassifiedId() << ")" << LL_ENDL;
LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(), this);
LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getClassifiedId());
@@ -230,7 +227,7 @@ void LLPanelClassifiedInfo::onOpen(const LLSD& key)
std::string url = gAgent.getRegion()->getCapability("SearchStatRequest");
if (!url.empty())
{
- llinfos << "Classified stat request via capability" << llendl;
+ LL_INFOS() << "Classified stat request via capability" << LL_ENDL;
LLSD body;
body["classified_id"] = getClassifiedId();
LLHTTPClient::post(url, body, new LLClassifiedStatsResponder(getClassifiedId()));
@@ -388,9 +385,9 @@ void LLPanelClassifiedInfo::setClickThrough(
S32 profile,
bool from_new_table)
{
- llinfos << "Click-through data for classified " << classified_id << " arrived: ["
+ LL_INFOS() << "Click-through data for classified " << classified_id << " arrived: ["
<< teleport << ", " << map << ", " << profile << "] ("
- << (from_new_table ? "new" : "old") << ")" << llendl;
+ << (from_new_table ? "new" : "old") << ")" << LL_ENDL;
for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter)
{
@@ -407,7 +404,7 @@ void LLPanelClassifiedInfo::setClickThrough(
continue;
}
- llinfos << "Updating classified info panel" << llendl;
+ LL_INFOS() << "Updating classified info panel" << LL_ENDL;
// We need to check to see if the data came from the new stat_table
// or the old classified table. We also need to cache the data from
@@ -436,10 +433,10 @@ void LLPanelClassifiedInfo::setClickThrough(
// *HACK: remove this when there is enough room for click stats in the info panel
self->getChildView("click_through_text")->setToolTip(ct_str.getString());
- llinfos << "teleport: " << llformat("%d", self->mTeleportClicksNew + self->mTeleportClicksOld)
+ LL_INFOS() << "teleport: " << llformat("%d", self->mTeleportClicksNew + self->mTeleportClicksOld)
<< ", map: " << llformat("%d", self->mMapClicksNew + self->mMapClicksOld)
<< ", profile: " << llformat("%d", self->mProfileClicksNew + self->mProfileClicksOld)
- << llendl;
+ << LL_ENDL;
}
}
@@ -549,8 +546,8 @@ void LLPanelClassifiedInfo::sendClickMessage(
body["region_name"] = sim_name;
std::string url = gAgent.getRegion()->getCapability("SearchStatTracking");
- llinfos << "Sending click msg via capability (url=" << url << ")" << llendl;
- llinfos << "body: [" << body << "]" << llendl;
+ LL_INFOS() << "Sending click msg via capability (url=" << url << ")" << LL_ENDL;
+ LL_INFOS() << "body: [" << body << "]" << LL_ENDL;
LLHTTPClient::post(url, body, new LLClassifiedClickMessageResponder());
}
diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp
index 1a427338e5..407cbfc47b 100755
--- a/indra/newview/llpanelcontents.cpp
+++ b/indra/newview/llpanelcontents.cpp
@@ -59,6 +59,7 @@
#include "llviewerregion.h"
#include "llviewerwindow.h"
#include "llworld.h"
+#include "llfloaterperms.h"
//
// Imported globals
@@ -141,6 +142,13 @@ void LLPanelContents::refresh()
}
}
+void LLPanelContents::clearContents()
+{
+ if (mPanelInventoryObject)
+ {
+ mPanelInventoryObject->clearInventoryTask();
+ }
+}
//
@@ -156,12 +164,14 @@ void LLPanelContents::onClickNewScript(void *userdata)
{
LLPermissions perm;
perm.init(gAgent.getID(), gAgent.getID(), LLUUID::null, LLUUID::null);
+
+ // Parameters are base, owner, everyone, group, next
perm.initMasks(
PERM_ALL,
PERM_ALL,
- PERM_NONE,
- PERM_NONE,
- PERM_MOVE | PERM_TRANSFER);
+ LLFloaterPerms::getEveryonePerms("Scripts"),
+ LLFloaterPerms::getGroupPerms("Scripts"),
+ PERM_MOVE | LLFloaterPerms::getNextOwnerPerms("Scripts"));
std::string desc;
LLViewerAssetType::generateDescriptionFor(LLAssetType::AT_LSL_TEXT, desc);
LLPointer<LLViewerInventoryItem> new_item =
@@ -179,6 +189,8 @@ void LLPanelContents::onClickNewScript(void *userdata)
time_corrected());
object->saveScript(new_item, TRUE, true);
+ std::string name = new_item->getName();
+
// *NOTE: In order to resolve SL-22177, we needed to create
// the script first, and then you have to click it in
// inventory to edit it.
diff --git a/indra/newview/llpanelcontents.h b/indra/newview/llpanelcontents.h
index 62ccb64a4c..6ecc78afa0 100755
--- a/indra/newview/llpanelcontents.h
+++ b/indra/newview/llpanelcontents.h
@@ -31,7 +31,6 @@
#include "llpanel.h"
#include "llinventory.h"
#include "lluuid.h"
-#include "llmap.h"
#include "llviewerobject.h"
#include "llvoinventorylistener.h"
@@ -49,6 +48,7 @@ public:
virtual ~LLPanelContents();
void refresh();
+ void clearContents();
static void onClickNewScript(void*);
diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp
index 0621cc8fad..19a86cdcea 100755
--- a/indra/newview/llpaneleditwearable.cpp
+++ b/indra/newview/llpaneleditwearable.cpp
@@ -30,6 +30,7 @@
#include "llpanel.h"
#include "llviewerwearable.h"
#include "lluictrl.h"
+#include "lllocaltextureobject.h"
#include "llscrollingpanellist.h"
#include "llvisualparam.h"
#include "lltoolmorph.h"
@@ -453,7 +454,7 @@ get_pickers_indexes<LLColorSwatchCtrl> (const LLEditWearableDictionary::Wearable
{
if (!wearable_entry)
{
- llwarns << "could not get LLColorSwatchCtrl indexes for null wearable entry." << llendl;
+ LL_WARNS() << "could not get LLColorSwatchCtrl indexes for null wearable entry." << LL_ENDL;
return null_texture_vec;
}
return wearable_entry->mColorSwatchCtrls;
@@ -466,7 +467,7 @@ get_pickers_indexes<LLTextureCtrl> (const LLEditWearableDictionary::WearableEntr
{
if (!wearable_entry)
{
- llwarns << "could not get LLTextureCtrl indexes for null wearable entry." << llendl;
+ LL_WARNS() << "could not get LLTextureCtrl indexes for null wearable entry." << LL_ENDL;
return null_texture_vec;
}
return wearable_entry->mTextureCtrls;
@@ -496,7 +497,7 @@ find_picker_ctrl_entry_if(LLWearableType::EType type, const Predicate pred)
= LLEditWearableDictionary::getInstance()->getWearable(type);
if (!wearable_entry)
{
- llwarns << "could not get wearable dictionary entry for wearable of type: " << type << llendl;
+ LL_WARNS() << "could not get wearable dictionary entry for wearable of type: " << type << LL_ENDL;
return NULL;
}
const texture_vec_t& indexes = get_pickers_indexes<CtrlType>(wearable_entry);
@@ -510,7 +511,7 @@ find_picker_ctrl_entry_if(LLWearableType::EType type, const Predicate pred)
= get_picker_entry<CtrlType>(te);
if (!entry)
{
- llwarns << "could not get picker dictionary entry (" << te << ") for wearable of type: " << type << llendl;
+ LL_WARNS() << "could not get picker dictionary entry (" << te << ") for wearable of type: " << type << LL_ENDL;
continue;
}
if (pred(entry))
@@ -527,14 +528,14 @@ for_each_picker_ctrl_entry(LLPanel* panel, LLWearableType::EType type, function_
{
if (!panel)
{
- llwarns << "the panel wasn't passed for wearable of type: " << type << llendl;
+ LL_WARNS() << "the panel wasn't passed for wearable of type: " << type << LL_ENDL;
return;
}
const LLEditWearableDictionary::WearableEntry *wearable_entry
= LLEditWearableDictionary::getInstance()->getWearable(type);
if (!wearable_entry)
{
- llwarns << "could not get wearable dictionary entry for wearable of type: " << type << llendl;
+ LL_WARNS() << "could not get wearable dictionary entry for wearable of type: " << type << LL_ENDL;
return;
}
const texture_vec_t& indexes = get_pickers_indexes<CtrlType>(wearable_entry);
@@ -548,7 +549,7 @@ for_each_picker_ctrl_entry(LLPanel* panel, LLWearableType::EType type, function_
= get_picker_entry<CtrlType>(te);
if (!entry)
{
- llwarns << "could not get picker dictionary entry (" << te << ") for wearable of type: " << type << llendl;
+ LL_WARNS() << "could not get picker dictionary entry (" << te << ") for wearable of type: " << type << LL_ENDL;
continue;
}
fun (panel, entry);
@@ -700,12 +701,12 @@ void LLPanelEditWearable::setWearablePanelVisibilityChangeCallback(LLPanel* body
}
else
{
- llwarns << "accordion_ctrl is NULL" << llendl;
+ LL_WARNS() << "accordion_ctrl is NULL" << LL_ENDL;
}
}
else
{
- llwarns << "bodypart_panel is NULL" << llendl;
+ LL_WARNS() << "bodypart_panel is NULL" << LL_ENDL;
}
}
@@ -776,7 +777,7 @@ BOOL LLPanelEditWearable::postBuild()
const LLEditWearableDictionary::WearableEntry *wearable_entry = LLEditWearableDictionary::getInstance()->getWearable(type);
if (!wearable_entry)
{
- llwarns << "could not get wearable dictionary entry for wearable of type: " << type << llendl;
+ LL_WARNS() << "could not get wearable dictionary entry for wearable of type: " << type << LL_ENDL;
continue;
}
U8 num_subparts = wearable_entry->mSubparts.size();
@@ -789,7 +790,7 @@ BOOL LLPanelEditWearable::postBuild()
if (!subpart_entry)
{
- llwarns << "could not get wearable subpart dictionary entry for subpart: " << subpart_e << llendl;
+ LL_WARNS() << "could not get wearable subpart dictionary entry for subpart: " << subpart_e << LL_ENDL;
continue;
}
@@ -799,7 +800,7 @@ BOOL LLPanelEditWearable::postBuild()
if (!tab)
{
- llwarns << "could not get llaccordionctrltab from UI with name: " << accordion_tab << llendl;
+ LL_WARNS() << "could not get llaccordionctrltab from UI with name: " << accordion_tab << LL_ENDL;
continue;
}
@@ -859,10 +860,8 @@ void LLPanelEditWearable::draw()
void LLPanelEditWearable::onClose()
{
- if ( isDirty() )
- {
- revertChanges();
- }
+ // any unsaved changes should be reverted at this point
+ revertChanges();
}
void LLPanelEditWearable::setVisible(BOOL visible)
@@ -943,14 +942,14 @@ void LLPanelEditWearable::onCommitSexChange()
LLViewerWearable* wearable = gAgentWearables.getViewerWearable(type, index);
if (wearable)
{
- wearable->setVisualParamWeight(param->getID(), is_new_sex_male, FALSE);
+ wearable->setVisualParamWeight(param->getID(), is_new_sex_male);
}
- param->setWeight( is_new_sex_male, FALSE );
+ param->setWeight( is_new_sex_male);
- gAgentAvatarp->updateSexDependentLayerSets( FALSE );
+ gAgentAvatarp->updateSexDependentLayerSets();
gAgentAvatarp->updateVisualParams();
-
+ showWearable(mWearablePtr, TRUE, TRUE);
updateScrollingPanelUI();
}
@@ -959,7 +958,7 @@ void LLPanelEditWearable::onTexturePickerCommit(const LLUICtrl* ctrl)
const LLTextureCtrl* texture_ctrl = dynamic_cast<const LLTextureCtrl*>(ctrl);
if (!texture_ctrl)
{
- llwarns << "got commit signal from not LLTextureCtrl." << llendl;
+ LL_WARNS() << "got commit signal from not LLTextureCtrl." << LL_ENDL;
return;
}
@@ -982,12 +981,12 @@ void LLPanelEditWearable::onTexturePickerCommit(const LLUICtrl* ctrl)
U32 index = gAgentWearables.getWearableIndex(getWearable());
gAgentAvatarp->setLocalTexture(entry->mTextureIndex, image, FALSE, index);
LLVisualParamHint::requestHintUpdates();
- gAgentAvatarp->wearableUpdated(type, FALSE);
+ gAgentAvatarp->wearableUpdated(type);
}
}
else
{
- llwarns << "could not get texture picker dictionary entry for wearable of type: " << type << llendl;
+ LL_WARNS() << "could not get texture picker dictionary entry for wearable of type: " << type << LL_ENDL;
}
}
}
@@ -1006,14 +1005,14 @@ void LLPanelEditWearable::onColorSwatchCommit(const LLUICtrl* ctrl)
const LLColor4& new_color = LLColor4(ctrl->getValue());
if( old_color != new_color )
{
- getWearable()->setClothesColor(entry->mTextureIndex, new_color, TRUE);
+ getWearable()->setClothesColor(entry->mTextureIndex, new_color);
LLVisualParamHint::requestHintUpdates();
- gAgentAvatarp->wearableUpdated(getWearable()->getType(), FALSE);
+ gAgentAvatarp->wearableUpdated(getWearable()->getType());
}
}
else
{
- llwarns << "could not get color swatch dictionary entry for wearable of type: " << type << llendl;
+ LL_WARNS() << "could not get color swatch dictionary entry for wearable of type: " << type << LL_ENDL;
}
}
}
@@ -1070,7 +1069,7 @@ void LLPanelEditWearable::saveChanges(bool force_save_as)
LLAppearanceMgr::instance().findCOFItemLinks(mWearablePtr->getItemID());
if (links.size()>0)
{
- link_item = links.get(0).get();
+ link_item = links.at(0).get();
if (link_item && link_item->getIsLinkType())
{
description = link_item->getActualDescription();
@@ -1079,10 +1078,10 @@ void LLPanelEditWearable::saveChanges(bool force_save_as)
if (force_save_as)
{
- // the name of the wearable has changed, re-save wearable with new name
- LLAppearanceMgr::instance().removeCOFItemLinks(mWearablePtr->getItemID());
+ // the name of the wearable has changed, re-save wearable with new name
+ LLAppearanceMgr::instance().removeCOFItemLinks(mWearablePtr->getItemID(),gAgentAvatarp->mEndCustomizeCallback);
gAgentWearables.saveWearableAs(mWearablePtr->getType(), index, new_name, description, FALSE);
- mNameEditor->setText(mWearableItem->getName());
+ mNameEditor->setText(mWearableItem->getName());
}
else
{
@@ -1092,17 +1091,19 @@ void LLPanelEditWearable::saveChanges(bool force_save_as)
if (link_item)
{
// Create new link
- link_inventory_item( gAgent.getID(),
- link_item->getLinkedUUID(),
- LLAppearanceMgr::instance().getCOF(),
- link_item->getName(),
- description,
- LLAssetType::AT_LINK,
- NULL);
+ LL_DEBUGS("Avatar") << "link refresh, creating new link to " << link_item->getLinkedUUID()
+ << " removing old link at " << link_item->getUUID()
+ << " wearable item id " << mWearablePtr->getItemID() << LL_ENDL;
+
+ LLInventoryObject::const_object_list_t obj_array;
+ obj_array.push_back(LLConstPointer<LLInventoryObject>(link_item));
+ link_inventory_array(LLAppearanceMgr::instance().getCOF(),
+ obj_array,
+ gAgentAvatarp->mEndCustomizeCallback);
// Remove old link
- gInventory.purgeObject(link_item->getUUID());
+ remove_inventory_item(link_item->getUUID(), gAgentAvatarp->mEndCustomizeCallback);
}
- gAgentWearables.saveWearable(mWearablePtr->getType(), index, TRUE, new_name);
+ gAgentWearables.saveWearable(mWearablePtr->getType(), index, new_name);
}
@@ -1120,7 +1121,7 @@ void LLPanelEditWearable::revertChanges()
mNameEditor->setText(mWearableItem->getName());
updatePanelPickerControls(mWearablePtr->getType());
updateTypeSpecificControls(mWearablePtr->getType());
- gAgentAvatarp->wearableUpdated(mWearablePtr->getType(), FALSE);
+ gAgentAvatarp->wearableUpdated(mWearablePtr->getType());
}
void LLPanelEditWearable::showWearable(LLViewerWearable* wearable, BOOL show, BOOL disable_camera_switch)
@@ -1141,7 +1142,7 @@ void LLPanelEditWearable::showWearable(LLViewerWearable* wearable, BOOL show, BO
const LLEditWearableDictionary::WearableEntry *wearable_entry = LLEditWearableDictionary::getInstance()->getWearable(type);
if (!wearable_entry)
{
- llwarns << "called LLPanelEditWearable::showWearable with an invalid wearable type! (" << type << ")" << llendl;
+ LL_WARNS() << "called LLPanelEditWearable::showWearable with an invalid wearable type! (" << type << ")" << LL_ENDL;
return;
}
@@ -1179,7 +1180,7 @@ void LLPanelEditWearable::showWearable(LLViewerWearable* wearable, BOOL show, BO
if (!subpart_entry)
{
- llwarns << "could not get wearable subpart dictionary entry for subpart: " << subpart_e << llendl;
+ LL_WARNS() << "could not get wearable subpart dictionary entry for subpart: " << subpart_e << LL_ENDL;
continue;
}
@@ -1191,13 +1192,13 @@ void LLPanelEditWearable::showWearable(LLViewerWearable* wearable, BOOL show, BO
if (!panel_list)
{
- llwarns << "could not get scrolling panel list: " << scrolling_panel << llendl;
+ LL_WARNS() << "could not get scrolling panel list: " << scrolling_panel << LL_ENDL;
continue;
}
if (!tab)
{
- llwarns << "could not get llaccordionctrltab from UI with name: " << accordion_tab << llendl;
+ LL_WARNS() << "could not get llaccordionctrltab from UI with name: " << accordion_tab << LL_ENDL;
continue;
}
@@ -1271,13 +1272,13 @@ void LLPanelEditWearable::changeCamera(U8 subpart)
const LLEditWearableDictionary::WearableEntry *wearable_entry = LLEditWearableDictionary::getInstance()->getWearable(mWearablePtr->getType());
if (!wearable_entry)
{
- llinfos << "could not get wearable dictionary entry for wearable type: " << mWearablePtr->getType() << llendl;
+ LL_INFOS() << "could not get wearable dictionary entry for wearable type: " << mWearablePtr->getType() << LL_ENDL;
return;
}
if (subpart >= wearable_entry->mSubparts.size())
{
- llinfos << "accordion tab expanded for invalid subpart. Wearable type: " << mWearablePtr->getType() << " subpart num: " << subpart << llendl;
+ LL_INFOS() << "accordion tab expanded for invalid subpart. Wearable type: " << mWearablePtr->getType() << " subpart num: " << subpart << LL_ENDL;
return;
}
@@ -1286,7 +1287,7 @@ void LLPanelEditWearable::changeCamera(U8 subpart)
if (!subpart_entry)
{
- llwarns << "could not get wearable subpart dictionary entry for subpart: " << subpart_e << llendl;
+ LL_WARNS() << "could not get wearable subpart dictionary entry for subpart: " << subpart_e << LL_ENDL;
return;
}
@@ -1375,7 +1376,7 @@ void LLPanelEditWearable::updateScrollingPanelUI()
if (!panel_list)
{
- llwarns << "could not get scrolling panel list: " << scrolling_panel << llendl;
+ LL_WARNS() << "could not get scrolling panel list: " << scrolling_panel << LL_ENDL;
continue;
}
@@ -1571,7 +1572,7 @@ void LLPanelEditWearable::onInvisibilityCommit(LLCheckBoxCtrl* checkbox_ctrl, LL
if (!checkbox_ctrl) return;
if (!getWearable()) return;
- llinfos << "onInvisibilityCommit, self " << this << " checkbox_ctrl " << checkbox_ctrl << llendl;
+ LL_INFOS() << "onInvisibilityCommit, self " << this << " checkbox_ctrl " << checkbox_ctrl << LL_ENDL;
bool new_invis_state = checkbox_ctrl->get();
if (new_invis_state)
@@ -1582,7 +1583,7 @@ void LLPanelEditWearable::onInvisibilityCommit(LLCheckBoxCtrl* checkbox_ctrl, LL
LLViewerFetchedTexture* image = LLViewerTextureManager::getFetchedTexture( IMG_INVISIBLE );
U32 index = gAgentWearables.getWearableIndex(getWearable());
gAgentAvatarp->setLocalTexture(te, image, FALSE, index);
- gAgentAvatarp->wearableUpdated(getWearable()->getType(), FALSE);
+ gAgentAvatarp->wearableUpdated(getWearable()->getType());
}
else
{
@@ -1599,7 +1600,7 @@ void LLPanelEditWearable::onInvisibilityCommit(LLCheckBoxCtrl* checkbox_ctrl, LL
U32 index = gAgentWearables.getWearableIndex(getWearable());
gAgentAvatarp->setLocalTexture(te, image, FALSE, index);
- gAgentAvatarp->wearableUpdated(getWearable()->getType(), FALSE);
+ gAgentAvatarp->wearableUpdated(getWearable()->getType());
}
updatePanelPickerControls(getWearable()->getType());
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index 3869219da6..e3be1312e4 100755
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -337,7 +337,7 @@ void LLPanelFace::sendBump(U32 bumpiness)
{
LLTextureCtrl* bumpytexture_ctrl = getChild<LLTextureCtrl>("bumpytexture control");
if (bumpiness < BUMPY_TEXTURE)
- {
+{
LL_DEBUGS("Materials") << "clearing bumptexture control" << LL_ENDL;
bumpytexture_ctrl->clear();
bumpytexture_ctrl->setImageAssetID(LLUUID());
@@ -358,7 +358,7 @@ void LLPanelFace::sendBump(U32 bumpiness)
//
LLSelectedTEMaterial::setNormalID(this, current_normal_map);
- LLSelectMgr::getInstance()->selectionSetBumpmap( bump );
+ LLSelectMgr::getInstance()->selectionSetBumpmap( bump );
}
void LLPanelFace::sendTexGen()
@@ -374,7 +374,7 @@ void LLPanelFace::sendShiny(U32 shininess)
LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("shinytexture control");
if (shininess < SHINY_TEXTURE)
- {
+{
texture_ctrl->clear();
texture_ctrl->setImageAssetID(LLUUID());
}
@@ -661,7 +661,7 @@ void LLPanelFace::updateUI()
// only turn on auto-adjust button if there is a media renderer and the media is loaded
getChildView("button align")->setEnabled(editable);
-
+
LLComboBox* combobox_matmedia = getChild<LLComboBox>("combobox matmedia");
if (combobox_matmedia)
{
@@ -672,7 +672,7 @@ void LLPanelFace::updateUI()
}
else
{
- llwarns << "failed getChild for 'combobox matmedia'" << llendl;
+ LL_WARNS() << "failed getChild for 'combobox matmedia'" << LL_ENDL;
}
getChildView("combobox matmedia")->setEnabled(editable);
@@ -696,15 +696,15 @@ void LLPanelFace::updateUI()
bool identical_diffuse = false;
bool identical_norm = false;
bool identical_spec = false;
-
- LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("texture control");
+
+ LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("texture control");
LLTextureCtrl* shinytexture_ctrl = getChild<LLTextureCtrl>("shinytexture control");
LLTextureCtrl* bumpytexture_ctrl = getChild<LLTextureCtrl>("bumpytexture control");
LLUUID id;
LLUUID normmap_id;
LLUUID specmap_id;
-
+
// Color swatch
{
getChildView("color label")->setEnabled(editable);
@@ -715,7 +715,7 @@ void LLPanelFace::updateUI()
bool identical_color = false;
if(mColorSwatch)
- {
+ {
LLSelectedTE::getColor(color, identical_color);
mColorSwatch->setOriginal(color);
@@ -747,7 +747,7 @@ void LLPanelFace::updateUI()
LLCtrlSelectionInterface* combobox_shininess = childGetSelectionInterface("combobox shininess");
if (combobox_shininess)
- {
+ {
combobox_shininess->selectNthItem((S32)shiny);
}
@@ -760,15 +760,15 @@ void LLPanelFace::updateUI()
getChildView("label environment")->setEnabled(editable);
getChildView("environment")->setEnabled(editable);
getChildView("label shinycolor")->setEnabled(editable);
-
+
getChild<LLUICtrl>("combobox shininess")->setTentative(!identical_spec);
getChild<LLUICtrl>("glossiness")->setTentative(!identical_spec);
getChild<LLUICtrl>("environment")->setTentative(!identical_spec);
getChild<LLUICtrl>("shinycolorswatch")->setTentative(!identical_spec);
-
+
LLColorSwatchCtrl* mShinyColorSwatch = getChild<LLColorSwatchCtrl>("shinycolorswatch");
if(mShinyColorSwatch)
- {
+ {
mShinyColorSwatch->setValid(editable);
mShinyColorSwatch->setEnabled( editable );
mShinyColorSwatch->setCanApplyImmediately( editable );
@@ -776,7 +776,7 @@ void LLPanelFace::updateUI()
U8 bumpy = 0;
// Bumpy
- {
+ {
bool identical_bumpy = false;
LLSelectedTE::getBumpmap(bumpy,identical_bumpy);
@@ -786,18 +786,18 @@ void LLPanelFace::updateUI()
bumpy = norm_map_id.isNull() ? bumpy : BUMPY_TEXTURE;
if (combobox_bumpiness)
- {
+ {
combobox_bumpiness->selectNthItem((S32)bumpy);
- }
+ }
else
- {
- llwarns << "failed childGetSelectionInterface for 'combobox bumpiness'" << llendl;
- }
+ {
+ LL_WARNS() << "failed childGetSelectionInterface for 'combobox bumpiness'" << LL_ENDL;
+ }
getChildView("combobox bumpiness")->setEnabled(editable);
getChild<LLUICtrl>("combobox bumpiness")->setTentative(!identical_bumpy);
getChildView("label bumpiness")->setEnabled(editable);
- }
+ }
// Texture
{
@@ -824,10 +824,10 @@ void LLPanelFace::updateUI()
case GL_RGB: break;
default:
{
- llwarns << "Unexpected tex format in LLPanelFace...resorting to no alpha" << llendl;
- }
+ LL_WARNS() << "Unexpected tex format in LLPanelFace...resorting to no alpha" << LL_ENDL;
+ }
break;
- }
+ }
if(LLViewerMedia::textureHasMedia(id))
{
@@ -860,13 +860,13 @@ void LLPanelFace::updateUI()
}
else
{
- llwarns << "failed childGetSelectionInterface for 'combobox alphamode'" << llendl;
+ LL_WARNS() << "failed childGetSelectionInterface for 'combobox alphamode'" << LL_ENDL;
}
updateAlphaControls();
- if(texture_ctrl)
- {
+ if(texture_ctrl)
+ {
if (identical_diffuse)
{
texture_ctrl->setTentative( FALSE );
@@ -878,22 +878,22 @@ void LLPanelFace::updateUI()
getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha);
}
else if (id.isNull())
- {
- // None selected
- texture_ctrl->setTentative( FALSE );
- texture_ctrl->setEnabled( FALSE );
- texture_ctrl->setImageAssetID( LLUUID::null );
+ {
+ // None selected
+ texture_ctrl->setTentative( FALSE );
+ texture_ctrl->setEnabled( FALSE );
+ texture_ctrl->setImageAssetID( LLUUID::null );
getChildView("combobox alphamode")->setEnabled( FALSE );
getChildView("label alphamode")->setEnabled( FALSE );
getChildView("maskcutoff")->setEnabled( FALSE);
getChildView("label maskcutoff")->setEnabled( FALSE );
- }
- else
- {
- // Tentative: multiple selected with different textures
- texture_ctrl->setTentative( TRUE );
- texture_ctrl->setEnabled( editable );
- texture_ctrl->setImageAssetID( id );
+ }
+ else
+ {
+ // Tentative: multiple selected with different textures
+ texture_ctrl->setTentative( TRUE );
+ texture_ctrl->setEnabled( editable );
+ texture_ctrl->setImageAssetID( id );
getChildView("combobox alphamode")->setEnabled(editable && mIsAlpha && transparency <= 0.f);
getChildView("label alphamode")->setEnabled(editable && mIsAlpha);
getChildView("maskcutoff")->setEnabled(editable && mIsAlpha);
@@ -908,20 +908,20 @@ void LLPanelFace::updateUI()
shinytexture_ctrl->setTentative( FALSE );
shinytexture_ctrl->setEnabled( editable );
shinytexture_ctrl->setImageAssetID( specmap_id );
- }
+ }
else if (specmap_id.isNull())
{
shinytexture_ctrl->setTentative( FALSE );
shinytexture_ctrl->setEnabled( editable );
shinytexture_ctrl->setImageAssetID( LLUUID::null );
- }
+ }
else
{
shinytexture_ctrl->setTentative( TRUE );
shinytexture_ctrl->setEnabled( editable );
shinytexture_ctrl->setImageAssetID( specmap_id );
- }
- }
+ }
+ }
if (bumpytexture_ctrl)
{
@@ -952,7 +952,7 @@ void LLPanelFace::updateUI()
{
LLCheckBoxCtrl* cb_planar_align = getChild<LLCheckBoxCtrl>("checkbox planar align");
align_planar = (cb_planar_align && cb_planar_align->get());
-
+
bool enabled = (editable && isIdenticalPlanarTexgen());
childSetValue("checkbox planar align", align_planar && enabled);
childSetEnabled("checkbox planar align", enabled);
@@ -1145,7 +1145,7 @@ void LLPanelFace::updateUI()
F32 diff_rot_deg = diff_rotation * RAD_TO_DEG;
F32 norm_rot_deg = norm_rotation * RAD_TO_DEG;
F32 spec_rot_deg = spec_rotation * RAD_TO_DEG;
-
+
getChildView("TexRot")->setEnabled(editable);
getChildView("shinyRot")->setEnabled(editable && specmap_id.notNull());
getChildView("bumpyRot")->setEnabled(editable && normmap_id.notNull());
@@ -1166,10 +1166,10 @@ void LLPanelFace::updateUI()
getChild<LLUICtrl>("glow")->setValue(glow);
getChild<LLUICtrl>("glow")->setTentative(!identical_glow);
getChildView("glow")->setEnabled(editable);
- getChildView("glow label")->setEnabled(editable);
+ getChildView("glow label")->setEnabled(editable);
}
- {
+ {
LLCtrlSelectionInterface* combobox_texgen = childGetSelectionInterface("combobox texgen");
if (combobox_texgen)
{
@@ -1177,9 +1177,9 @@ void LLPanelFace::updateUI()
combobox_texgen->selectNthItem(((S32)selected_texgen) >> 1);
}
else
- {
- llwarns << "failed childGetSelectionInterface for 'combobox texgen'" << llendl;
- }
+ {
+ LL_WARNS() << "failed childGetSelectionInterface for 'combobox texgen'" << LL_ENDL;
+ }
getChildView("combobox texgen")->setEnabled(editable);
getChild<LLUICtrl>("combobox texgen")->setTentative(!identical);
@@ -1195,7 +1195,7 @@ void LLPanelFace::updateUI()
{
getChild<LLUICtrl>("rpt")->setValue(getString("string repeats per face"));
}
- }
+ }
{
U8 fullbright_flag = 0;
@@ -1207,8 +1207,7 @@ void LLPanelFace::updateUI()
getChildView("checkbox fullbright")->setEnabled(editable);
getChild<LLUICtrl>("checkbox fullbright")->setTentative(!identical_fullbright);
}
-
-
+
// Repeats per meter
{
F32 repeats_diff = 1.f;
@@ -1225,7 +1224,7 @@ void LLPanelFace::updateUI()
LLComboBox* mComboTexGen = getChild<LLComboBox>("combobox texgen");
if (mComboTexGen)
- {
+ {
S32 index = mComboTexGen ? mComboTexGen->getCurrentIndex() : 0;
BOOL enabled = editable && (index != 1);
BOOL identical_repeats = true;
@@ -1236,26 +1235,26 @@ void LLPanelFace::updateUI()
LLSelectMgr::getInstance()->setTextureChannel(LLRender::eTexIndex(material_type));
switch (material_type)
- {
+ {
default:
case MATTYPE_DIFFUSE:
- {
+ {
enabled = editable && !id.isNull();
identical_repeats = identical_diff_repeats;
repeats = repeats_diff;
- }
+ }
break;
case MATTYPE_SPECULAR:
- {
+ {
enabled = (editable && ((shiny == SHINY_TEXTURE) && !specmap_id.isNull()));
identical_repeats = identical_spec_repeats;
repeats = repeats_spec;
- }
+ }
break;
case MATTYPE_NORMAL:
- {
+ {
enabled = (editable && ((bumpy == BUMPY_TEXTURE) && !normmap_id.isNull()));
identical_repeats = identical_norm_repeats;
repeats = repeats_norm;
@@ -1295,14 +1294,14 @@ void LLPanelFace::updateUI()
if (!mIsAlpha)
{ // ... unless there is no alpha channel in the texture, in which case alpha mode MUST ebe none
alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
- }
+ }
combobox_alphamode->selectNthItem(alpha_mode);
- }
- else
- {
- llwarns << "failed childGetSelectionInterface for 'combobox alphamode'" << llendl;
- }
+ }
+ else
+ {
+ LL_WARNS() << "failed childGetSelectionInterface for 'combobox alphamode'" << LL_ENDL;
+ }
getChild<LLUICtrl>("maskcutoff")->setValue(material->getAlphaMaskCutoff());
updateAlphaControls();
@@ -1314,15 +1313,15 @@ void LLPanelFace::updateUI()
texture_ctrl->setImageAssetID(material->getSpecularID());
if (!material->getSpecularID().isNull() && (shiny == SHINY_TEXTURE))
- {
+ {
material->getSpecularOffset(offset_x,offset_y);
material->getSpecularRepeat(repeat_x,repeat_y);
if (identical_planar_texgen)
- {
+ {
repeat_x *= 2.0f;
repeat_y *= 2.0f;
- }
+ }
rot = material->getSpecularRotation();
getChild<LLUICtrl>("shinyScaleU")->setValue(repeat_x);
@@ -1334,7 +1333,7 @@ void LLPanelFace::updateUI()
getChild<LLUICtrl>("environment")->setValue(material->getEnvironmentIntensity());
updateShinyControls(!material->getSpecularID().isNull(), true);
- }
+ }
// Assert desired colorswatch color to match material AFTER updateShinyControls
// to avoid getting overwritten with the default on some UI state changes.
@@ -1359,7 +1358,7 @@ void LLPanelFace::updateUI()
repeat_x *= 2.0f;
repeat_y *= 2.0f;
}
-
+
rot = material->getNormalRotation();
getChild<LLUICtrl>("bumpyScaleU")->setValue(repeat_x);
getChild<LLUICtrl>("bumpyScaleV")->setValue(repeat_y);
@@ -1399,7 +1398,7 @@ void LLPanelFace::updateUI()
if(mColorSwatch)
{
mColorSwatch->setEnabled( FALSE );
- mColorSwatch->setFallbackImageName("locked_image.j2c" );
+ mColorSwatch->setFallbackImage(LLUI::getUIImage("locked_image.j2c") );
mColorSwatch->setValid(FALSE);
}
getChildView("color trans")->setEnabled(FALSE);
@@ -1411,7 +1410,7 @@ void LLPanelFace::updateUI()
getChildView("button align")->setEnabled(FALSE);
//getChildView("has media")->setEnabled(FALSE);
//getChildView("media info set")->setEnabled(FALSE);
-
+
updateVisibility();
// Set variable values for numeric expressions
@@ -1769,7 +1768,7 @@ BOOL LLPanelFace::onDragTexture(LLUICtrl*, LLInventoryItem* item)
void LLPanelFace::onCommitTexture( const LLSD& data )
{
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT );
+ add(LLStatViewer::EDIT_TEXTURE, 1);
sendTexture();
}
@@ -1805,7 +1804,7 @@ void LLPanelFace::onSelectTexture(const LLSD& data)
case GL_RGB: break;
default:
{
- llwarns << "Unexpected tex format in LLPanelFace...resorting to no alpha" << llendl;
+ LL_WARNS() << "Unexpected tex format in LLPanelFace...resorting to no alpha" << LL_ENDL;
}
break;
}
@@ -2024,8 +2023,8 @@ void LLPanelFace::onCommitRepeatsPerMeter(LLUICtrl* ctrl, void* userdata)
{
case MATTYPE_DIFFUSE:
{
- LLSelectMgr::getInstance()->selectionTexScaleAutofit( repeats_per_meter );
- }
+ LLSelectMgr::getInstance()->selectionTexScaleAutofit( repeats_per_meter );
+}
break;
case MATTYPE_NORMAL:
diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h
index b684881225..e32f039921 100755
--- a/indra/newview/llpanelface.h
+++ b/indra/newview/llpanelface.h
@@ -485,7 +485,7 @@ private:
{
public:
- static void getFace(LLFace*& face_to_return, bool& identical_face);
+ static void getFace(class LLFace*& face_to_return, bool& identical_face);
static void getImageFormat(LLGLenum& image_format_to_return, bool& identical_face);
static void getTexId(LLUUID& id, bool& identical);
static void getObjectScaleS(F32& scale_s, bool& identical);
diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp
index 180c1d6ab5..f4aab6bd4e 100755
--- a/indra/newview/llpanelgroup.cpp
+++ b/indra/newview/llpanelgroup.cpp
@@ -49,6 +49,7 @@
#include "llpanelgroupnotices.h"
#include "llpanelgroupgeneral.h"
+#include "llpanelgrouproles.h"
#include "llaccordionctrltab.h"
#include "llaccordionctrl.h"
@@ -275,6 +276,7 @@ void LLPanelGroup::onBtnApply(void* user_data)
{
LLPanelGroup* self = static_cast<LLPanelGroup*>(user_data);
self->apply();
+ self->refreshData();
}
void LLPanelGroup::onBtnGroupCallClicked(void* user_data)
@@ -291,7 +293,7 @@ void LLPanelGroup::onBtnGroupChatClicked(void* user_data)
void LLPanelGroup::onBtnJoin()
{
- lldebugs << "joining group: " << mID << llendl;
+ LL_DEBUGS() << "joining group: " << mID << LL_ENDL;
LLGroupActions::join(mID);
}
@@ -329,8 +331,9 @@ void LLPanelGroup::update(LLGroupChange gc)
if(gdatap)
{
std::string group_name = gdatap->mName.empty() ? LLTrans::getString("LoadingData") : gdatap->mName;
- childSetValue("group_name", group_name);
- childSetToolTip("group_name",group_name);
+ LLUICtrl* group_name_ctrl = getChild<LLUICtrl>("group_name");
+ group_name_ctrl->setValue(group_name);
+ group_name_ctrl->setToolTip(group_name);
LLGroupData agent_gdatap;
bool is_member = gAgent.getGroupData(mID,agent_gdatap) || gAgent.isGodlike();
@@ -376,8 +379,9 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id)
if(gdatap)
{
std::string group_name = gdatap->mName.empty() ? LLTrans::getString("LoadingData") : gdatap->mName;
- childSetValue("group_name", group_name);
- childSetToolTip("group_name",group_name);
+ LLUICtrl* group_name_ctrl = getChild<LLUICtrl>("group_name");
+ group_name_ctrl->setValue(group_name);
+ group_name_ctrl->setToolTip(group_name);
}
LLButton* button_apply = findChild<LLButton>("btn_apply");
@@ -495,6 +499,22 @@ bool LLPanelGroup::apply(LLPanelGroupTab* tab)
{
//we skip refreshing group after ew manually apply changes since its very annoying
//for those who are editing group
+
+ LLPanelGroupRoles * roles_tab = dynamic_cast<LLPanelGroupRoles*>(tab);
+ if (roles_tab)
+ {
+ LLGroupMgr* gmgrp = LLGroupMgr::getInstance();
+ LLGroupMgrGroupData* gdatap = gmgrp->getGroupData(roles_tab->getGroupID());
+
+ // allow refresh only for one specific case:
+ // there is only one member in group and it is not owner
+ // it's a wrong situation and need refresh panels from server
+ if (gdatap && gdatap->isSingleMemberNotOwner())
+ {
+ return true;
+ }
+ }
+
mSkipRefresh = TRUE;
return true;
}
diff --git a/indra/newview/llpanelgroupbulk.cpp b/indra/newview/llpanelgroupbulk.cpp
new file mode 100644
index 0000000000..1eafc5bd64
--- /dev/null
+++ b/indra/newview/llpanelgroupbulk.cpp
@@ -0,0 +1,421 @@
+/**
+* @file llpanelgroupbulk.cpp
+* @brief Implementation of llpanelgroupbulk
+* @author Baker@lindenlab.com
+*
+* $LicenseInfo:firstyear=2013&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2013, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+* $/LicenseInfo$
+*/
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llpanelgroupbulk.h"
+#include "llpanelgroupbulkimpl.h"
+
+#include "llagent.h"
+#include "llavatarnamecache.h"
+#include "llfloateravatarpicker.h"
+#include "llbutton.h"
+#include "llcallingcard.h"
+#include "llcombobox.h"
+#include "llgroupactions.h"
+#include "llgroupmgr.h"
+#include "llnamelistctrl.h"
+#include "llnotificationsutil.h"
+#include "llscrolllistitem.h"
+#include "llspinctrl.h"
+#include "lltextbox.h"
+#include "llviewerobject.h"
+#include "llviewerobjectlist.h"
+#include "lluictrlfactory.h"
+#include "llviewerwindow.h"
+
+
+//////////////////////////////////////////////////////////////////////////
+// Implementation of llpanelgroupbulkimpl.h functions
+//////////////////////////////////////////////////////////////////////////
+LLPanelGroupBulkImpl::LLPanelGroupBulkImpl(const LLUUID& group_id) :
+ mGroupID(group_id),
+ mBulkAgentList(NULL),
+ mOKButton(NULL),
+ mRemoveButton(NULL),
+ mGroupName(NULL),
+ mLoadingText(),
+ mTooManySelected(),
+ mCloseCallback(NULL),
+ mCloseCallbackUserData(NULL),
+ mAvatarNameCacheConnection(),
+ mRoleNames(NULL),
+ mOwnerWarning(),
+ mAlreadyInGroup(),
+ mConfirmedOwnerInvite(false),
+ mListFullNotificationSent(false)
+{}
+
+LLPanelGroupBulkImpl::~LLPanelGroupBulkImpl()
+{
+ if(mAvatarNameCacheConnection.connected())
+ {
+ mAvatarNameCacheConnection.disconnect();
+ }
+}
+
+void LLPanelGroupBulkImpl::callbackClickAdd(void* userdata)
+{
+ LLPanelGroupBulk* panelp = (LLPanelGroupBulk*)userdata;
+
+ if(panelp)
+ {
+ //Right now this is hard coded with some knowledge that it is part
+ //of a floater since the avatar picker needs to be added as a dependent
+ //floater to the parent floater.
+ //Soon the avatar picker will be embedded into this panel
+ //instead of being it's own separate floater. But that is next week.
+ //This will do for now. -jwolk May 10, 2006
+ LLView* button = panelp->findChild<LLButton>("add_button");
+ LLFloater* root_floater = gFloaterView->getParentFloater(panelp);
+ LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(
+ boost::bind(callbackAddUsers, _1, panelp->mImplementation), TRUE, FALSE, FALSE, root_floater->getName(), button);
+ if(picker)
+ {
+ root_floater->addDependentFloater(picker);
+ }
+ }
+}
+
+void LLPanelGroupBulkImpl::callbackClickRemove(void* userdata)
+{
+ LLPanelGroupBulkImpl* selfp = (LLPanelGroupBulkImpl*)userdata;
+ if (selfp)
+ selfp->handleRemove();
+}
+
+void LLPanelGroupBulkImpl::callbackClickCancel(void* userdata)
+{
+ LLPanelGroupBulkImpl* selfp = (LLPanelGroupBulkImpl*)userdata;
+ if(selfp)
+ (*(selfp->mCloseCallback))(selfp->mCloseCallbackUserData);
+}
+
+void LLPanelGroupBulkImpl::callbackSelect(LLUICtrl* ctrl, void* userdata)
+{
+ LLPanelGroupBulkImpl* selfp = (LLPanelGroupBulkImpl*)userdata;
+ if (selfp)
+ selfp->handleSelection();
+}
+
+void LLPanelGroupBulkImpl::callbackAddUsers(const uuid_vec_t& agent_ids, void* user_data)
+{
+ std::vector<std::string> names;
+ for (S32 i = 0; i < (S32)agent_ids.size(); i++)
+ {
+ LLAvatarName av_name;
+ if (LLAvatarNameCache::get(agent_ids[i], &av_name))
+ {
+ onAvatarNameCache(agent_ids[i], av_name, user_data);
+ }
+ else
+ {
+ LLPanelGroupBulkImpl* selfp = (LLPanelGroupBulkImpl*) user_data;
+ if (selfp)
+ {
+ if (selfp->mAvatarNameCacheConnection.connected())
+ {
+ selfp->mAvatarNameCacheConnection.disconnect();
+ }
+ // *TODO : Add a callback per avatar name being fetched.
+ selfp->mAvatarNameCacheConnection = LLAvatarNameCache::get(agent_ids[i],boost::bind(onAvatarNameCache, _1, _2, user_data));
+ }
+ }
+ }
+}
+
+void LLPanelGroupBulkImpl::onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name, void* user_data)
+{
+ LLPanelGroupBulkImpl* selfp = (LLPanelGroupBulkImpl*) user_data;
+
+ if (selfp)
+ {
+ if (selfp->mAvatarNameCacheConnection.connected())
+ {
+ selfp->mAvatarNameCacheConnection.disconnect();
+ }
+ std::vector<std::string> names;
+ uuid_vec_t agent_ids;
+ agent_ids.push_back(agent_id);
+ names.push_back(av_name.getCompleteName());
+
+ selfp->addUsers(names, agent_ids);
+ }
+}
+
+void LLPanelGroupBulkImpl::handleRemove()
+{
+ std::vector<LLScrollListItem*> selection = mBulkAgentList->getAllSelected();
+ if (selection.empty())
+ return;
+
+ std::vector<LLScrollListItem*>::iterator iter;
+ for(iter = selection.begin(); iter != selection.end(); ++iter)
+ {
+ mInviteeIDs.erase((*iter)->getUUID());
+ }
+
+ mBulkAgentList->deleteSelectedItems();
+ mRemoveButton->setEnabled(FALSE);
+
+ if( mOKButton && mOKButton->getEnabled() &&
+ mBulkAgentList->isEmpty())
+ {
+ mOKButton->setEnabled(FALSE);
+ }
+}
+
+void LLPanelGroupBulkImpl::handleSelection()
+{
+ std::vector<LLScrollListItem*> selection = mBulkAgentList->getAllSelected();
+ if (selection.empty())
+ mRemoveButton->setEnabled(FALSE);
+ else
+ mRemoveButton->setEnabled(TRUE);
+}
+
+void LLPanelGroupBulkImpl::addUsers(const std::vector<std::string>& names, const uuid_vec_t& agent_ids)
+{
+ std::string name;
+ LLUUID id;
+
+ if(mListFullNotificationSent)
+ {
+ return;
+ }
+
+ if( !mListFullNotificationSent &&
+ (names.size() + mInviteeIDs.size() > MAX_GROUP_INVITES))
+ {
+ mListFullNotificationSent = true;
+
+ // Fail! Show a warning and don't add any names.
+ LLSD msg;
+ msg["MESSAGE"] = mTooManySelected;
+ LLNotificationsUtil::add("GenericAlert", msg);
+ return;
+ }
+
+ for (S32 i = 0; i < (S32)names.size(); ++i)
+ {
+ name = names[i];
+ id = agent_ids[i];
+
+ if(mInviteeIDs.find(id) != mInviteeIDs.end())
+ {
+ continue;
+ }
+
+ //add the name to the names list
+ LLSD row;
+ row["id"] = id;
+ row["columns"][0]["value"] = name;
+
+ mBulkAgentList->addElement(row);
+ mInviteeIDs.insert(id);
+
+ // We've successfully added someone to the list.
+ if(mOKButton && !mOKButton->getEnabled())
+ mOKButton->setEnabled(TRUE);
+ }
+}
+
+void LLPanelGroupBulkImpl::setGroupName(std::string name)
+{
+ if(mGroupName)
+ mGroupName->setText(name);
+}
+
+
+LLPanelGroupBulk::LLPanelGroupBulk(const LLUUID& group_id) :
+ LLPanel(),
+ mImplementation(new LLPanelGroupBulkImpl(group_id)),
+ mPendingGroupPropertiesUpdate(false),
+ mPendingRoleDataUpdate(false),
+ mPendingMemberDataUpdate(false)
+{}
+
+LLPanelGroupBulk::~LLPanelGroupBulk()
+{
+ delete mImplementation;
+}
+
+void LLPanelGroupBulk::clear()
+{
+ mImplementation->mInviteeIDs.clear();
+
+ if(mImplementation->mBulkAgentList)
+ mImplementation->mBulkAgentList->deleteAllItems();
+
+ if(mImplementation->mOKButton)
+ mImplementation->mOKButton->setEnabled(FALSE);
+}
+
+void LLPanelGroupBulk::update()
+{
+ updateGroupName();
+ updateGroupData();
+}
+
+void LLPanelGroupBulk::draw()
+{
+ LLPanel::draw();
+ update();
+}
+
+void LLPanelGroupBulk::updateGroupName()
+{
+ LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mImplementation->mGroupID);
+
+ if( gdatap &&
+ gdatap->isGroupPropertiesDataComplete())
+ {
+ // Only do work if the current group name differs
+ if(mImplementation->mGroupName->getText().compare(gdatap->mName) != 0)
+ mImplementation->setGroupName(gdatap->mName);
+ }
+ else
+ {
+ mImplementation->setGroupName(mImplementation->mLoadingText);
+ }
+}
+
+void LLPanelGroupBulk::updateGroupData()
+{
+ LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mImplementation->mGroupID);
+ if(gdatap && gdatap->isGroupPropertiesDataComplete())
+ {
+ mPendingGroupPropertiesUpdate = false;
+ }
+ else
+ {
+ if(!mPendingGroupPropertiesUpdate)
+ {
+ mPendingGroupPropertiesUpdate = true;
+ LLGroupMgr::getInstance()->sendGroupPropertiesRequest(mImplementation->mGroupID);
+ }
+ }
+
+ if(gdatap && gdatap->isRoleDataComplete())
+ {
+ mPendingRoleDataUpdate = false;
+ }
+ else
+ {
+ if(!mPendingRoleDataUpdate)
+ {
+ mPendingRoleDataUpdate = true;
+ LLGroupMgr::getInstance()->sendGroupRoleDataRequest(mImplementation->mGroupID);
+ }
+ }
+
+ if(gdatap && gdatap->isMemberDataComplete())
+ {
+ mPendingMemberDataUpdate = false;
+ }
+ else
+ {
+ if(!mPendingMemberDataUpdate)
+ {
+ mPendingMemberDataUpdate = true;
+ LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mImplementation->mGroupID);
+ }
+ }
+}
+
+void LLPanelGroupBulk::addUserCallback(const LLUUID& id, const LLAvatarName& av_name)
+{
+ std::vector<std::string> names;
+ uuid_vec_t agent_ids;
+ agent_ids.push_back(id);
+ names.push_back(av_name.getAccountName());
+
+ mImplementation->addUsers(names, agent_ids);
+}
+
+void LLPanelGroupBulk::setCloseCallback(void (*close_callback)(void*), void* data)
+{
+ mImplementation->mCloseCallback = close_callback;
+ mImplementation->mCloseCallbackUserData = data;
+}
+
+void LLPanelGroupBulk::addUsers(uuid_vec_t& agent_ids)
+{
+ std::vector<std::string> names;
+ for (S32 i = 0; i < (S32)agent_ids.size(); i++)
+ {
+ std::string fullname;
+ LLUUID agent_id = agent_ids[i];
+ LLViewerObject* dest = gObjectList.findObject(agent_id);
+ if(dest && dest->isAvatar())
+ {
+ LLNameValue* nvfirst = dest->getNVPair("FirstName");
+ LLNameValue* nvlast = dest->getNVPair("LastName");
+ if(nvfirst && nvlast)
+ {
+ fullname = LLCacheName::buildFullName(
+ nvfirst->getString(), nvlast->getString());
+
+ }
+ if (!fullname.empty())
+ {
+ names.push_back(fullname);
+ }
+ else
+ {
+ llwarns << "llPanelGroupBulk: Selected avatar has no name: " << dest->getID() << llendl;
+ names.push_back("(Unknown)");
+ }
+ }
+ else
+ {
+ //looks like user try to invite offline friend
+ //for offline avatar_id gObjectList.findObject() will return null
+ //so we need to do this additional search in avatar tracker, see EXT-4732
+ if (LLAvatarTracker::instance().isBuddy(agent_id))
+ {
+ LLAvatarName av_name;
+ if (!LLAvatarNameCache::get(agent_id, &av_name))
+ {
+ // actually it should happen, just in case
+ LLAvatarNameCache::get(LLUUID(agent_id), boost::bind(&LLPanelGroupBulk::addUserCallback, this, _1, _2));
+ // for this special case!
+ //when there is no cached name we should remove resident from agent_ids list to avoid breaking of sequence
+ // removed id will be added in callback
+ agent_ids.erase(agent_ids.begin() + i);
+ }
+ else
+ {
+ names.push_back(av_name.getAccountName());
+ }
+ }
+ }
+ }
+ mImplementation->mListFullNotificationSent = false;
+ mImplementation->addUsers(names, agent_ids);
+}
+
diff --git a/indra/newview/llpanelgroupbulk.h b/indra/newview/llpanelgroupbulk.h
new file mode 100644
index 0000000000..25ae71ab86
--- /dev/null
+++ b/indra/newview/llpanelgroupbulk.h
@@ -0,0 +1,74 @@
+/**
+* @file llpanelgroupbulk.h
+* @brief Header file for llpanelgroupbulk
+* @author Baker@lindenlab.com
+*
+* $LicenseInfo:firstyear=2013&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2013, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+* $/LicenseInfo$
+*/
+#ifndef LL_LLPANELGROUPBULK_H
+#define LL_LLPANELGROUPBULK_H
+
+#include "llpanel.h"
+#include "lluuid.h"
+
+class LLAvatarName;
+class LLGroupMgrGroupData;
+class LLPanelGroupBulkImpl;
+
+// Base panel class for bulk group invite / ban floaters
+class LLPanelGroupBulk : public LLPanel
+{
+public:
+ LLPanelGroupBulk(const LLUUID& group_id);
+ /*virtual*/ ~LLPanelGroupBulk();
+
+public:
+ static void callbackClickSubmit(void* userdata) {}
+ virtual void submit() = 0;
+
+public:
+ virtual void clear();
+ virtual void update();
+ virtual void draw();
+
+protected:
+ virtual void updateGroupName();
+ virtual void updateGroupData();
+
+public:
+ // this callback is being used to add a user whose fullname isn't been loaded before invoking of addUsers().
+ virtual void addUserCallback(const LLUUID& id, const LLAvatarName& av_name);
+ virtual void setCloseCallback(void (*close_callback)(void*), void* data);
+
+ virtual void addUsers(uuid_vec_t& agent_ids);
+
+public:
+ LLPanelGroupBulkImpl* mImplementation;
+
+protected:
+ bool mPendingGroupPropertiesUpdate;
+ bool mPendingRoleDataUpdate;
+ bool mPendingMemberDataUpdate;
+};
+
+#endif // LL_LLPANELGROUPBULK_H
+
diff --git a/indra/newview/llpanelgroupbulkban.cpp b/indra/newview/llpanelgroupbulkban.cpp
new file mode 100644
index 0000000000..cf1f0bc32f
--- /dev/null
+++ b/indra/newview/llpanelgroupbulkban.cpp
@@ -0,0 +1,259 @@
+/**
+* @file llpanelgroupbulkban.cpp
+*
+* $LicenseInfo:firstyear=2013&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2013, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+* $/LicenseInfo$
+*/
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llpanelgroupbulkban.h"
+#include "llpanelgroupbulk.h"
+#include "llpanelgroupbulkimpl.h"
+
+#include "llagent.h"
+#include "llavatarnamecache.h"
+#include "llavataractions.h"
+#include "llfloateravatarpicker.h"
+#include "llbutton.h"
+#include "llcallingcard.h"
+#include "llcombobox.h"
+#include "llgroupactions.h"
+#include "llgroupmgr.h"
+#include "llnamelistctrl.h"
+#include "llnotificationsutil.h"
+#include "llscrolllistitem.h"
+#include "llslurl.h"
+#include "llspinctrl.h"
+#include "lltextbox.h"
+#include "llviewerobject.h"
+#include "llviewerobjectlist.h"
+#include "lluictrlfactory.h"
+#include "llviewerwindow.h"
+
+#include <boost/foreach.hpp>
+
+LLPanelGroupBulkBan::LLPanelGroupBulkBan(const LLUUID& group_id) : LLPanelGroupBulk(group_id)
+{
+ // Pass on construction of this panel to the control factory.
+ buildFromFile( "panel_group_bulk_ban.xml");
+}
+
+BOOL LLPanelGroupBulkBan::postBuild()
+{
+ BOOL recurse = TRUE;
+
+ mImplementation->mLoadingText = getString("loading");
+ mImplementation->mGroupName = getChild<LLTextBox>("group_name_text", recurse);
+ mImplementation->mBulkAgentList = getChild<LLNameListCtrl>("banned_agent_list", recurse);
+ if ( mImplementation->mBulkAgentList )
+ {
+ mImplementation->mBulkAgentList->setCommitOnSelectionChange(TRUE);
+ mImplementation->mBulkAgentList->setCommitCallback(LLPanelGroupBulkImpl::callbackSelect, mImplementation);
+ }
+
+ LLButton* button = getChild<LLButton>("add_button", recurse);
+ if ( button )
+ {
+ // default to opening avatarpicker automatically
+ // (*impl::callbackClickAdd)((void*)this);
+ button->setClickedCallback(LLPanelGroupBulkImpl::callbackClickAdd, this);
+ }
+
+ mImplementation->mRemoveButton =
+ getChild<LLButton>("remove_button", recurse);
+ if ( mImplementation->mRemoveButton )
+ {
+ mImplementation->mRemoveButton->setClickedCallback(LLPanelGroupBulkImpl::callbackClickRemove, mImplementation);
+ mImplementation->mRemoveButton->setEnabled(FALSE);
+ }
+
+ mImplementation->mOKButton =
+ getChild<LLButton>("ban_button", recurse);
+ if ( mImplementation->mOKButton )
+ {
+ mImplementation->mOKButton->setClickedCallback(LLPanelGroupBulkBan::callbackClickSubmit, this);
+ mImplementation->mOKButton->setEnabled(FALSE);
+ }
+
+ button = getChild<LLButton>("cancel_button", recurse);
+ if ( button )
+ {
+ button->setClickedCallback(LLPanelGroupBulkImpl::callbackClickCancel, mImplementation);
+ }
+
+ mImplementation->mTooManySelected = getString("ban_selection_too_large");
+ mImplementation->mBanNotPermitted = getString("ban_not_permitted");
+ mImplementation->mBanLimitFail = getString("ban_limit_fail");
+ mImplementation->mCannotBanYourself = getString("cant_ban_yourself");
+
+ update();
+ return TRUE;
+}
+
+// TODO: Refactor the shitty callback functions with void* -- just use boost::bind to call submit() instead.
+void LLPanelGroupBulkBan::callbackClickSubmit(void* userdata)
+{
+ LLPanelGroupBulkBan* selfp = (LLPanelGroupBulkBan*)userdata;
+
+ if(selfp)
+ selfp->submit();
+}
+
+
+void LLPanelGroupBulkBan::submit()
+{
+ if (!gAgent.hasPowerInGroup(mImplementation->mGroupID, GP_GROUP_BAN_ACCESS))
+ {
+ // Fail! Agent no longer have ban rights. Permissions could have changed after button was pressed.
+ LLSD msg;
+ msg["MESSAGE"] = mImplementation->mBanNotPermitted;
+ LLNotificationsUtil::add("GenericAlert", msg);
+ (*(mImplementation->mCloseCallback))(mImplementation->mCloseCallbackUserData);
+ return;
+ }
+ LLGroupMgrGroupData * group_datap = LLGroupMgr::getInstance()->getGroupData(mImplementation->mGroupID);
+ if (group_datap && group_datap->mBanList.size() >= GB_MAX_BANNED_AGENTS)
+ {
+ // Fail! Size limit exceeded. List could have updated after button was pressed.
+ LLSD msg;
+ msg["MESSAGE"] = mImplementation->mBanLimitFail;
+ LLNotificationsUtil::add("GenericAlert", msg);
+ (*(mImplementation->mCloseCallback))(mImplementation->mCloseCallbackUserData);
+ return;
+ }
+ std::vector<LLUUID> banned_agent_list;
+ std::vector<LLScrollListItem*> agents = mImplementation->mBulkAgentList->getAllData();
+ std::vector<LLScrollListItem*>::iterator iter = agents.begin();
+ for(;iter != agents.end(); ++iter)
+ {
+ LLScrollListItem* agent = *iter;
+ banned_agent_list.push_back(agent->getUUID());
+ }
+
+ const S32 MAX_BANS_PER_REQUEST = 100; // Max bans per request. 100 to match server cap.
+ if (banned_agent_list.size() > MAX_BANS_PER_REQUEST)
+ {
+ // Fail!
+ LLSD msg;
+ msg["MESSAGE"] = mImplementation->mTooManySelected;
+ LLNotificationsUtil::add("GenericAlert", msg);
+ (*(mImplementation->mCloseCallback))(mImplementation->mCloseCallbackUserData);
+ return;
+ }
+
+ // remove already banned users and yourself from request.
+ std::vector<LLAvatarName> banned_avatar_names;
+ std::vector<LLAvatarName> out_of_limit_names;
+ bool banning_self = FALSE;
+ std::vector<LLUUID>::iterator conflict = std::find(banned_agent_list.begin(), banned_agent_list.end(), gAgent.getID());
+ if (conflict != banned_agent_list.end())
+ {
+ banned_agent_list.erase(conflict);
+ banning_self = TRUE;
+ }
+ if (group_datap)
+ {
+ BOOST_FOREACH(const LLGroupMgrGroupData::ban_list_t::value_type& group_ban_pair, group_datap->mBanList)
+ {
+ const LLUUID& group_ban_agent_id = group_ban_pair.first;
+ std::vector<LLUUID>::iterator conflict = std::find(banned_agent_list.begin(), banned_agent_list.end(), group_ban_agent_id);
+ if (conflict != banned_agent_list.end())
+ {
+ LLAvatarName av_name;
+ LLAvatarNameCache::get(group_ban_agent_id, &av_name);
+ banned_avatar_names.push_back(av_name);
+
+ banned_agent_list.erase(conflict);
+ if (banned_agent_list.size() == 0)
+ {
+ break;
+ }
+ }
+ }
+ // this check should always be the last one before we send the request.
+ // Otherwise we have a possibility of cutting more then we need to.
+ if (banned_agent_list.size() > GB_MAX_BANNED_AGENTS - group_datap->mBanList.size())
+ {
+ std::vector<LLUUID>::iterator exeedes_limit = banned_agent_list.begin() + GB_MAX_BANNED_AGENTS - group_datap->mBanList.size();
+ for (std::vector<LLUUID>::iterator itor = exeedes_limit ;
+ itor != banned_agent_list.end(); ++itor)
+ {
+ LLAvatarName av_name;
+ LLAvatarNameCache::get(*itor, &av_name);
+ out_of_limit_names.push_back(av_name);
+ }
+ banned_agent_list.erase(exeedes_limit,banned_agent_list.end());
+ }
+ }
+
+ // sending request and ejecting members
+ if (banned_agent_list.size() != 0)
+ {
+ LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_POST, mImplementation->mGroupID, LLGroupMgr::BAN_CREATE | LLGroupMgr::BAN_UPDATE, banned_agent_list);
+ LLGroupMgr::getInstance()->sendGroupMemberEjects(mImplementation->mGroupID, banned_agent_list);
+ }
+
+ // building notification
+ if (banned_avatar_names.size() > 0 || banning_self || out_of_limit_names.size() > 0)
+ {
+ std::string reasons;
+ if(banned_avatar_names.size() > 0)
+ {
+ reasons = "\n " + buildResidentsArgument(banned_avatar_names, "residents_already_banned");
+ }
+
+ if(banning_self)
+ {
+ reasons += "\n " + mImplementation->mCannotBanYourself;
+ }
+
+ if(out_of_limit_names.size() > 0)
+ {
+ reasons += "\n " + buildResidentsArgument(out_of_limit_names, "ban_limit_reached");
+ }
+
+ LLStringUtil::format_map_t msg_args;
+ msg_args["[REASONS]"] = reasons;
+ LLSD msg;
+ if (banned_agent_list.size() == 0)
+ {
+ msg["MESSAGE"] = getString("ban_failed", msg_args);
+ }
+ else
+ {
+ msg["MESSAGE"] = getString("partial_ban", msg_args);
+ }
+ LLNotificationsUtil::add("GenericAlert", msg);
+ }
+
+ //then close
+ (*(mImplementation->mCloseCallback))(mImplementation->mCloseCallbackUserData);
+}
+
+std::string LLPanelGroupBulkBan::buildResidentsArgument(std::vector<LLAvatarName> avatar_names, const std::string &format)
+{
+ std::string names_string;
+ LLAvatarActions::buildResidentsString(avatar_names, names_string);
+ LLStringUtil::format_map_t args;
+ args["[RESIDENTS]"] = names_string;
+ return getString(format, args);
+}
diff --git a/indra/newview/llpanelgroupbulkban.h b/indra/newview/llpanelgroupbulkban.h
new file mode 100644
index 0000000000..9060d275f9
--- /dev/null
+++ b/indra/newview/llpanelgroupbulkban.h
@@ -0,0 +1,49 @@
+/**
+* @file llpanelgroupbulkban.h
+*
+* $LicenseInfo:firstyear=2013&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2013, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+* $/LicenseInfo$
+*/
+
+#ifndef LL_LLPANELGROUPBULKBAN_H
+#define LL_LLPANELGROUPBULKBAN_H
+
+#include "llpanel.h"
+#include "lluuid.h"
+#include "llpanelgroupbulk.h"
+
+class LLAvatarName;
+
+class LLPanelGroupBulkBan : public LLPanelGroupBulk
+{
+public:
+ LLPanelGroupBulkBan(const LLUUID& group_id);
+ ~LLPanelGroupBulkBan() {}
+
+ virtual BOOL postBuild();
+
+ static void callbackClickSubmit(void* userdata);
+ virtual void submit();
+private:
+ std::string buildResidentsArgument(std::vector<LLAvatarName> avatar_names, const std::string &format);
+};
+
+#endif // LL_LLPANELGROUPBULKBAN_H
diff --git a/indra/newview/llpanelgroupbulkimpl.h b/indra/newview/llpanelgroupbulkimpl.h
new file mode 100644
index 0000000000..d3a48e5a9a
--- /dev/null
+++ b/indra/newview/llpanelgroupbulkimpl.h
@@ -0,0 +1,99 @@
+/**
+* @file llpanelgroupbulkimpl.h
+* @brief Class definition for implementation class of LLPanelGroupBulk
+* @author Baker@lindenlab.com
+*
+* $LicenseInfo:firstyear=2013&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2013, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+* $/LicenseInfo$
+*/
+#ifndef LL_LLPANELGROUPBULKIMPL_H
+#define LL_LLPANELGROUPBULKIMPL_H
+
+#include "llpanel.h"
+#include "lluuid.h"
+
+class LLAvatarName;
+class LLNameListCtrl;
+class LLTextBox;
+class LLComboBox;
+
+//////////////////////////////////////////////////////////////////////////
+// Implementation found in llpanelgroupbulk.cpp
+//////////////////////////////////////////////////////////////////////////
+class LLPanelGroupBulkImpl
+{
+public:
+ LLPanelGroupBulkImpl(const LLUUID& group_id);
+ ~LLPanelGroupBulkImpl();
+
+ static void callbackClickAdd(void* userdata);
+ static void callbackClickRemove(void* userdata);
+
+ static void callbackClickCancel(void* userdata);
+
+ static void callbackSelect(LLUICtrl* ctrl, void* userdata);
+ static void callbackAddUsers(const uuid_vec_t& agent_ids, void* user_data);
+
+ static void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name, void* user_data);
+
+ void handleRemove();
+ void handleSelection();
+
+ void addUsers(const std::vector<std::string>& names, const uuid_vec_t& agent_ids);
+ void setGroupName(std::string name);
+
+
+public:
+ static const S32 MAX_GROUP_INVITES = 100; // Max invites per request. 100 to match server cap.
+
+
+ LLUUID mGroupID;
+
+ LLNameListCtrl* mBulkAgentList;
+ LLButton* mOKButton;
+ LLButton* mRemoveButton;
+ LLTextBox* mGroupName;
+
+ std::string mLoadingText;
+ std::string mTooManySelected;
+ std::string mBanNotPermitted;
+ std::string mBanLimitFail;
+ std::string mCannotBanYourself;
+
+ std::set<LLUUID> mInviteeIDs;
+
+ void (*mCloseCallback)(void* data);
+ void* mCloseCallbackUserData;
+ boost::signals2::connection mAvatarNameCacheConnection;
+
+ // The following are for the LLPanelGroupInvite subclass only.
+ // These aren't needed for LLPanelGroupBulkBan, but if we have to add another
+ // group bulk floater for some reason, we'll have these objects too.
+public:
+ LLComboBox* mRoleNames;
+ std::string mOwnerWarning;
+ std::string mAlreadyInGroup;
+ bool mConfirmedOwnerInvite;
+ bool mListFullNotificationSent;
+};
+
+#endif // LL_LLPANELGROUPBULKIMPL_H
+
diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp
index eaf33c7108..7ffaa05919 100755
--- a/indra/newview/llpanelgroupgeneral.cpp
+++ b/indra/newview/llpanelgroupgeneral.cpp
@@ -266,7 +266,7 @@ void LLPanelGroupGeneral::onClickInfo(void *userdata)
if ( !self ) return;
- lldebugs << "open group info: " << self->mGroupID << llendl;
+ LL_DEBUGS() << "open group info: " << self->mGroupID << LL_ENDL;
LLGroupActions::show(self->mGroupID);
@@ -318,7 +318,7 @@ bool LLPanelGroupGeneral::apply(std::string& mesg)
if (has_power_in_group || mGroupID.isNull())
{
- llinfos << "LLPanelGroupGeneral::apply" << llendl;
+ LL_INFOS() << "LLPanelGroupGeneral::apply" << LL_ENDL;
// Check to make sure mature has been set
if(mComboMature &&
@@ -624,7 +624,7 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
{
mEditCharter->setText(gdatap->mCharter);
}
-
+
resetDirty();
}
@@ -703,7 +703,7 @@ void LLPanelGroupGeneral::reset()
mEditCharter->setText(empty_str);
mGroupNameEditor->setText(empty_str);
}
-
+
{
mComboMature->setEnabled(true);
mComboMature->setVisible( !gAgent.isTeen() );
diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp
index a9a3c686a6..236ad861a5 100755
--- a/indra/newview/llpanelgroupinvite.cpp
+++ b/indra/newview/llpanelgroupinvite.cpp
@@ -260,7 +260,7 @@ void LLPanelGroupInvite::impl::addRoleNames(LLGroupMgrGroupData* gdatap)
//else if they have the limited add to roles power
//we add every role the user is in
//else we just add to everyone
- bool is_owner = member_data->isInRole(gdatap->mOwnerRole);
+ bool is_owner = member_data->isOwner();
bool can_assign_any = gAgent.hasPowerInGroup(mGroupID,
GP_ROLE_ASSIGN_MEMBER);
bool can_assign_limited = gAgent.hasPowerInGroup(mGroupID,
@@ -579,7 +579,7 @@ void LLPanelGroupInvite::updateLists()
{
waiting = true;
}
- if (gdatap->isRoleDataComplete() && gdatap->isMemberDataComplete())
+ if (gdatap->isRoleDataComplete() && gdatap->isMemberDataComplete() && gdatap->isRoleMemberDataComplete())
{
if ( mImplementation->mRoleNames )
{
@@ -607,6 +607,7 @@ void LLPanelGroupInvite::updateLists()
{
LLGroupMgr::getInstance()->sendGroupPropertiesRequest(mImplementation->mGroupID);
LLGroupMgr::getInstance()->sendGroupRoleDataRequest(mImplementation->mGroupID);
+ LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(mImplementation->mGroupID);
LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mImplementation->mGroupID);
}
mPendingUpdate = TRUE;
@@ -654,7 +655,7 @@ BOOL LLPanelGroupInvite::postBuild()
}
mImplementation->mOKButton =
- getChild<LLButton>("ok_button", recurse);
+ getChild<LLButton>("invite_button", recurse);
if ( mImplementation->mOKButton )
{
mImplementation->mOKButton->setClickedCallback(impl::callbackClickOK, mImplementation);
diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp
index 17707557bb..375c54479d 100755
--- a/indra/newview/llpanelgrouplandmoney.cpp
+++ b/indra/newview/llpanelgrouplandmoney.cpp
@@ -131,7 +131,7 @@ public:
- static LLMap<LLUUID, LLGroupMoneyTabEventHandler*> sInstanceIDs;
+ static std::map<LLUUID, LLGroupMoneyTabEventHandler*> sInstanceIDs;
static std::map<LLPanel*, LLGroupMoneyTabEventHandler*> sTabsToHandlers;
protected:
LLGroupMoneyTabEventHandlerImpl* mImplementationp;
@@ -324,7 +324,7 @@ bool LLPanelGroupLandMoney::impl::applyContribution()
if(!gAgent.setGroupContribution(mPanel.mGroupID, new_contribution))
{
// should never happen...
- llwarns << "Unable to set contribution." << llendl;
+ LL_WARNS() << "Unable to set contribution." << LL_ENDL;
return false;
}
}
@@ -421,27 +421,14 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
msg->getUUID("QueryData", "OwnerID", owner_id, 0);
msg->getUUID("TransactionData", "TransactionID", trans_id);
+ S32 total_contribution = 0;
if(owner_id.isNull())
{
// special block which has total contribution
++first_block;
-
- S32 total_contribution;
+
msg->getS32("QueryData", "ActualArea", total_contribution, 0);
mPanel.getChild<LLUICtrl>("total_contributed_land_value")->setTextArg("[AREA]", llformat("%d", total_contribution));
-
- S32 committed;
- msg->getS32("QueryData", "BillableArea", committed, 0);
- mPanel.getChild<LLUICtrl>("total_land_in_use_value")->setTextArg("[AREA]", llformat("%d", committed));
-
- S32 available = total_contribution - committed;
- mPanel.getChild<LLUICtrl>("land_available_value")->setTextArg("[AREA]", llformat("%d", available));
-
- if ( mGroupOverLimitTextp && mGroupOverLimitIconp )
- {
- mGroupOverLimitIconp->setVisible(available < 0);
- mGroupOverLimitTextp->setVisible(available < 0);
- }
}
if ( trans_id != mTransID ) return;
@@ -460,7 +447,8 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
std::string sim_name;
std::string land_sku;
std::string land_type;
-
+ S32 committed = 0;
+
for(S32 i = first_block; i < count; ++i)
{
msg->getUUID("QueryData", "OwnerID", owner_id, i);
@@ -476,7 +464,7 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
if ( msg->getSizeFast(_PREHASH_QueryData, i, _PREHASH_ProductSKU) > 0 )
{
msg->getStringFast( _PREHASH_QueryData, _PREHASH_ProductSKU, land_sku, i);
- llinfos << "Land sku: " << land_sku << llendl;
+ LL_INFOS() << "Land sku: " << land_sku << LL_ENDL;
land_type = LLProductInfoRequestManager::instance().getDescriptionForSku(land_sku);
}
else
@@ -489,6 +477,9 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
S32 region_y = llround(global_y) % REGION_WIDTH_UNITS;
std::string location = sim_name + llformat(" (%d, %d)", region_x, region_y);
std::string area;
+ committed+=billable_area;
+
+
if(billable_area == actual_area)
{
area = llformat("%d", billable_area);
@@ -525,6 +516,16 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
mGroupParcelsp->addElement(row);
}
+
+ mPanel.getChild<LLUICtrl>("total_land_in_use_value")->setTextArg("[AREA]", llformat("%d", committed));
+
+ S32 available = total_contribution - committed;
+ mPanel.getChild<LLUICtrl>("land_available_value")->setTextArg("[AREA]", llformat("%d", available));
+ if ( mGroupOverLimitTextp && mGroupOverLimitIconp )
+ {
+ mGroupOverLimitIconp->setVisible(available < 0);
+ mGroupOverLimitTextp->setVisible(available < 0);
+ }
}
}
@@ -534,7 +535,7 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
//static
-LLMap<LLUUID, LLPanelGroupLandMoney*> LLPanelGroupLandMoney::sGroupIDs;
+std::map<LLUUID, LLPanelGroupLandMoney*> LLPanelGroupLandMoney::sGroupIDs;
LLPanelGroupLandMoney::LLPanelGroupLandMoney() :
LLPanelGroupTab()
@@ -547,13 +548,13 @@ LLPanelGroupLandMoney::LLPanelGroupLandMoney() :
//will then only be working for the last panel for a given group id :(
//FIXME - add to setGroupID()
- //LLPanelGroupLandMoney::sGroupIDs.addData(group_id, this);
+ //LLPanelGroupLandMoney::sGroupIDs.insert(group_id, this);
}
LLPanelGroupLandMoney::~LLPanelGroupLandMoney()
{
delete mImplementationp;
- LLPanelGroupLandMoney::sGroupIDs.removeData(mGroupID);
+ LLPanelGroupLandMoney::sGroupIDs.erase(mGroupID);
}
void LLPanelGroupLandMoney::activate()
@@ -821,15 +822,15 @@ void LLPanelGroupLandMoney::processPlacesReply(LLMessageSystem* msg, void**)
LLUUID group_id;
msg->getUUID("AgentData", "QueryID", group_id);
- LLPanelGroupLandMoney* selfp = sGroupIDs.getIfThere(group_id);
- if(!selfp)
+ group_id_map_t::iterator found_it = sGroupIDs.find(group_id);
+ if(found_it == sGroupIDs.end())
{
- llinfos << "Group Panel Land L$ " << group_id << " no longer in existence."
- << llendl;
+ LL_INFOS() << "Group Panel Land L$ " << group_id << " no longer in existence."
+ << LL_ENDL;
return;
}
- selfp->mImplementationp->processGroupLand(msg);
+ found_it->second->mImplementationp->processGroupLand(msg);
}
@@ -885,7 +886,7 @@ void LLGroupMoneyTabEventHandlerImpl::updateButtons()
//** LLGroupMoneyTabEventHandler Functions **
//*******************************************
-LLMap<LLUUID, LLGroupMoneyTabEventHandler*> LLGroupMoneyTabEventHandler::sInstanceIDs;
+std::map<LLUUID, LLGroupMoneyTabEventHandler*> LLGroupMoneyTabEventHandler::sInstanceIDs;
std::map<LLPanel*, LLGroupMoneyTabEventHandler*> LLGroupMoneyTabEventHandler::sTabsToHandlers;
LLGroupMoneyTabEventHandler::LLGroupMoneyTabEventHandler(LLButton* earlier_buttonp,
@@ -922,13 +923,13 @@ LLGroupMoneyTabEventHandler::LLGroupMoneyTabEventHandler(LLButton* earlier_butto
tab_containerp->setCommitCallback(boost::bind(&LLGroupMoneyTabEventHandler::onClickTab, this));
}
- sInstanceIDs.addData(mImplementationp->mPanelID, this);
+ sInstanceIDs.insert(std::make_pair(mImplementationp->mPanelID, this));
sTabsToHandlers[panelp] = this;
}
LLGroupMoneyTabEventHandler::~LLGroupMoneyTabEventHandler()
{
- sInstanceIDs.removeData(mImplementationp->mPanelID);
+ sInstanceIDs.erase(mImplementationp->mPanelID);
sTabsToHandlers.erase(mImplementationp->mTabPanelp);
delete mImplementationp;
@@ -1045,7 +1046,7 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg,
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_GroupID, group_id );
if (mImplementationp->getGroupID() != group_id)
{
- llwarns << "Group Account details not for this group!" << llendl;
+ LL_WARNS() << "Group Account details not for this group!" << LL_ENDL;
return;
}
@@ -1068,8 +1069,8 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg,
if ( interval_days != mImplementationp->mIntervalLength ||
current_interval != mImplementationp->mCurrentInterval )
{
- llinfos << "Out of date details packet " << interval_days << " "
- << current_interval << llendl;
+ LL_INFOS() << "Out of date details packet " << interval_days << " "
+ << current_interval << LL_ENDL;
return;
}
@@ -1116,16 +1117,16 @@ void LLPanelGroupLandMoney::processGroupAccountDetailsReply(LLMessageSystem* msg
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
if (gAgent.getID() != agent_id)
{
- llwarns << "Got group L$ history reply for another agent!" << llendl;
+ LL_WARNS() << "Got group L$ history reply for another agent!" << LL_ENDL;
return;
}
LLUUID request_id;
msg->getUUIDFast(_PREHASH_MoneyData, _PREHASH_RequestID, request_id );
- LLGroupMoneyTabEventHandler* selfp = LLGroupMoneyTabEventHandler::sInstanceIDs.getIfThere(request_id);
+ LLGroupMoneyTabEventHandler* selfp = get_ptr_in_map(LLGroupMoneyTabEventHandler::sInstanceIDs, request_id);
if (!selfp)
{
- llwarns << "GroupAccountDetails recieved for non-existent group panel." << llendl;
+ LL_WARNS() << "GroupAccountDetails received for non-existent group panel." << LL_ENDL;
return;
}
@@ -1186,7 +1187,7 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg,
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_GroupID, group_id );
if (mImplementationp->getGroupID() != group_id)
{
- llwarns << "Group Account Transactions not for this group!" << llendl;
+ LL_WARNS() << "Group Account Transactions not for this group!" << LL_ENDL;
return;
}
@@ -1203,8 +1204,8 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg,
if (interval_days != mImplementationp->mIntervalLength ||
current_interval != mImplementationp->mCurrentInterval)
{
- llinfos << "Out of date details packet " << interval_days << " "
- << current_interval << llendl;
+ LL_INFOS() << "Out of date details packet " << interval_days << " "
+ << current_interval << LL_ENDL;
return;
}
@@ -1293,7 +1294,7 @@ void LLPanelGroupLandMoney::processGroupAccountTransactionsReply(LLMessageSystem
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
if (gAgent.getID() != agent_id)
{
- llwarns << "Got group L$ history reply for another agent!" << llendl;
+ LL_WARNS() << "Got group L$ history reply for another agent!" << LL_ENDL;
return;
}
@@ -1302,10 +1303,10 @@ void LLPanelGroupLandMoney::processGroupAccountTransactionsReply(LLMessageSystem
LLGroupMoneyTabEventHandler* self;
- self = LLGroupMoneyTabEventHandler::sInstanceIDs.getIfThere(request_id);
+ self = get_ptr_in_map(LLGroupMoneyTabEventHandler::sInstanceIDs, request_id);
if (!self)
{
- llwarns << "GroupAccountTransactions recieved for non-existent group panel." << llendl;
+ LL_WARNS() << "GroupAccountTransactions recieved for non-existent group panel." << LL_ENDL;
return;
}
@@ -1364,7 +1365,7 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg,
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_GroupID, group_id );
if (mImplementationp->getGroupID() != group_id)
{
- llwarns << "Group Account Summary received not for this group!" << llendl;
+ LL_WARNS() << "Group Account Summary received not for this group!" << LL_ENDL;
return;
}
@@ -1415,8 +1416,8 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg,
if (interval_days != mImplementationp->mIntervalLength ||
current_interval != mImplementationp->mCurrentInterval)
{
- llinfos << "Out of date summary packet " << interval_days << " "
- << current_interval << llendl;
+ LL_INFOS() << "Out of date summary packet " << interval_days << " "
+ << current_interval << LL_ENDL;
return;
}
@@ -1473,7 +1474,7 @@ void LLPanelGroupLandMoney::processGroupAccountSummaryReply(LLMessageSystem* msg
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
if (gAgent.getID() != agent_id)
{
- llwarns << "Got group L$ history reply for another agent!" << llendl;
+ LL_WARNS() << "Got group L$ history reply for another agent!" << LL_ENDL;
return;
}
@@ -1482,10 +1483,10 @@ void LLPanelGroupLandMoney::processGroupAccountSummaryReply(LLMessageSystem* msg
LLGroupMoneyTabEventHandler* self;
- self = LLGroupMoneyTabEventHandler::sInstanceIDs.getIfThere(request_id);
+ self = get_ptr_in_map(LLGroupMoneyTabEventHandler::sInstanceIDs, request_id);
if (!self)
{
- llwarns << "GroupAccountSummary recieved for non-existent group L$ planning tab." << llendl;
+ LL_WARNS() << "GroupAccountSummary recieved for non-existent group L$ planning tab." << LL_ENDL;
return;
}
@@ -1494,9 +1495,9 @@ void LLPanelGroupLandMoney::processGroupAccountSummaryReply(LLMessageSystem* msg
void LLPanelGroupLandMoney::setGroupID(const LLUUID& id)
{
- LLPanelGroupLandMoney::sGroupIDs.removeData(mGroupID);
+ LLPanelGroupLandMoney::sGroupIDs.erase(mGroupID);
LLPanelGroupTab::setGroupID(id);
- LLPanelGroupLandMoney::sGroupIDs.addData(mGroupID, this);
+ LLPanelGroupLandMoney::sGroupIDs.insert(std::make_pair(mGroupID, this));
bool can_view = gAgent.isInGroup(mGroupID);
diff --git a/indra/newview/llpanelgrouplandmoney.h b/indra/newview/llpanelgrouplandmoney.h
index ac3518ee19..3cec6065e7 100755
--- a/indra/newview/llpanelgrouplandmoney.h
+++ b/indra/newview/llpanelgrouplandmoney.h
@@ -28,7 +28,7 @@
#define LL_PANEL_GROUP_LAND_MONEY_H
#include "llpanelgroup.h"
-#include "llmap.h"
+#include <map>
#include "lluuid.h"
class LLPanelGroupLandMoney : public LLPanelGroupTab
@@ -47,7 +47,8 @@ public:
static void processPlacesReply(LLMessageSystem* msg, void**);
- static LLMap<LLUUID, LLPanelGroupLandMoney*> sGroupIDs;
+ typedef std::map<LLUUID, LLPanelGroupLandMoney*> group_id_map_t;
+ static group_id_map_t sGroupIDs;
static void processGroupAccountDetailsReply(LLMessageSystem* msg, void** data);
static void processGroupAccountTransactionsReply(LLMessageSystem* msg, void** data);
diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp
index 0dfb8fef53..54728885c1 100755
--- a/indra/newview/llpanelgroupnotices.cpp
+++ b/indra/newview/llpanelgroupnotices.cpp
@@ -117,7 +117,7 @@ LLGroupDropTarget::LLGroupDropTarget(const LLGroupDropTarget::Params& p)
void LLGroupDropTarget::doDrop(EDragAndDropType cargo_type, void* cargo_data)
{
- llinfos << "LLGroupDropTarget::doDrop()" << llendl;
+ LL_INFOS() << "LLGroupDropTarget::doDrop()" << LL_ENDL;
}
BOOL LLGroupDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
@@ -439,7 +439,7 @@ void LLPanelGroupNotices::refreshNotices()
{
onClickRefreshNotices(this);
/*
- lldebugs << "LLPanelGroupNotices::onClickGetPastNotices" << llendl;
+ LL_DEBUGS() << "LLPanelGroupNotices::onClickGetPastNotices" << LL_ENDL;
mNoticesList->deleteAllItems();
@@ -457,7 +457,7 @@ void LLPanelGroupNotices::refreshNotices()
void LLPanelGroupNotices::onClickRefreshNotices(void* data)
{
- lldebugs << "LLPanelGroupNotices::onClickGetPastNotices" << llendl;
+ LL_DEBUGS() << "LLPanelGroupNotices::onClickGetPastNotices" << LL_ENDL;
LLPanelGroupNotices* self = (LLPanelGroupNotices*)data;
self->mNoticesList->deleteAllItems();
@@ -484,16 +484,16 @@ void LLPanelGroupNotices::processGroupNoticesListReply(LLMessageSystem* msg, voi
std::map<LLUUID,LLPanelGroupNotices*>::iterator it = sInstances.find(group_id);
if (it == sInstances.end())
{
- llinfos << "Group Panel Notices " << group_id << " no longer in existence."
- << llendl;
+ LL_INFOS() << "Group Panel Notices " << group_id << " no longer in existence."
+ << LL_ENDL;
return;
}
LLPanelGroupNotices* selfp = it->second;
if(!selfp)
{
- llinfos << "Group Panel Notices " << group_id << " no longer in existence."
- << llendl;
+ LL_INFOS() << "Group Panel Notices " << group_id << " no longer in existence."
+ << LL_ENDL;
return;
}
@@ -595,7 +595,7 @@ void LLPanelGroupNotices::onSelectNotice(LLUICtrl* ctrl, void* data)
msg->addUUID("GroupNoticeID",item->getUUID());
gAgent.sendReliableMessage();
- lldebugs << "Item " << item->getUUID() << " selected." << llendl;
+ LL_DEBUGS() << "Item " << item->getUUID() << " selected." << LL_ENDL;
}
void LLPanelGroupNotices::showNotice(const std::string& subject,
diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp
index c30c932c41..c3a10b3fa0 100755
--- a/indra/newview/llpanelgrouproles.cpp
+++ b/indra/newview/llpanelgrouproles.cpp
@@ -1,4 +1,4 @@
-/**
+/**
* @file llpanelgrouproles.cpp
* @brief Panel for roles information about a particular group.
*
@@ -32,6 +32,7 @@
#include "llavatarnamecache.h"
#include "llbutton.h"
#include "llfiltereditor.h"
+#include "llfloatergroupbulkban.h"
#include "llfloatergroupinvite.h"
#include "llavataractions.h"
#include "lliconctrl.h"
@@ -72,8 +73,8 @@ bool agentCanAddToRole(const LLUUID& group_id,
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(group_id);
if (!gdatap)
{
- llwarns << "agentCanAddToRole "
- << "-- No group data!" << llendl;
+ LL_WARNS() << "agentCanAddToRole "
+ << "-- No group data!" << LL_ENDL;
return false;
}
@@ -109,8 +110,10 @@ bool agentCanAddToRole(const LLUUID& group_id,
return false;
}
-// static
+// LLPanelGroupRoles /////////////////////////////////////////////////////
+
+// static
LLPanelGroupRoles::LLPanelGroupRoles()
: LLPanelGroupTab(),
mCurrentTab(NULL),
@@ -126,7 +129,7 @@ LLPanelGroupRoles::~LLPanelGroupRoles()
BOOL LLPanelGroupRoles::postBuild()
{
- lldebugs << "LLPanelGroupRoles::postBuild()" << llendl;
+ LL_DEBUGS() << "LLPanelGroupRoles::postBuild()" << LL_ENDL;
mSubTabContainer = getChild<LLTabContainer>("roles_tab_container");
@@ -139,7 +142,7 @@ BOOL LLPanelGroupRoles::postBuild()
LLPanelGroupSubTab* subtabp = dynamic_cast<LLPanelGroupSubTab*>(panel);
if (!subtabp)
{
- llwarns << "Invalid subtab panel: " << panel->getName() << llendl;
+ LL_WARNS() << "Invalid subtab panel: " << panel->getName() << LL_ENDL;
return FALSE;
}
@@ -297,7 +300,6 @@ bool LLPanelGroupRoles::onModalClose(const LLSD& notification, const LLSD& respo
return false;
}
-
bool LLPanelGroupRoles::apply(std::string& mesg)
{
// Pass this along to the currently visible sub tab.
@@ -334,7 +336,6 @@ void LLPanelGroupRoles::update(LLGroupChange gc)
{
if (mGroupID.isNull()) return;
-
LLPanelGroupTab* panelp = (LLPanelGroupTab*) mSubTabContainer->getCurrentPanel();
if (panelp)
{
@@ -342,7 +343,7 @@ void LLPanelGroupRoles::update(LLGroupChange gc)
}
else
{
- llwarns << "LLPanelGroupRoles::update() -- No subtab to update!" << llendl;
+ LL_WARNS() << "LLPanelGroupRoles::update() -- No subtab to update!" << LL_ENDL;
}
}
@@ -351,39 +352,33 @@ void LLPanelGroupRoles::activate()
{
// Start requesting member and role data if needed.
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
- //if (!gdatap || mFirstUse)
+ if (!gdatap || !gdatap->isMemberDataComplete() )
{
- // Check member data.
-
- if (!gdatap || !gdatap->isMemberDataComplete() )
- {
- LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mGroupID);
- }
-
- // Check role data.
- if (!gdatap || !gdatap->isRoleDataComplete() )
- {
- // Mildly hackish - clear all pending changes
- cancel();
+ LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mGroupID);
+ }
- LLGroupMgr::getInstance()->sendGroupRoleDataRequest(mGroupID);
- }
+ if (!gdatap || !gdatap->isRoleDataComplete() )
+ {
+ // Mildly hackish - clear all pending changes
+ cancel();
- // Check role-member mapping data.
- if (!gdatap || !gdatap->isRoleMemberDataComplete() )
- {
- LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(mGroupID);
- }
+ LLGroupMgr::getInstance()->sendGroupRoleDataRequest(mGroupID);
+ }
- // Need this to get base group member powers
- if (!gdatap || !gdatap->isGroupPropertiesDataComplete() )
- {
- LLGroupMgr::getInstance()->sendGroupPropertiesRequest(mGroupID);
- }
+ // Check role-member mapping data.
+ if (!gdatap || !gdatap->isRoleMemberDataComplete() )
+ {
+ LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(mGroupID);
+ }
- mFirstUse = FALSE;
+ // Need this to get base group member powers
+ if (!gdatap || !gdatap->isGroupPropertiesDataComplete() )
+ {
+ LLGroupMgr::getInstance()->sendGroupPropertiesRequest(mGroupID);
}
+ mFirstUse = FALSE;
+
LLPanelGroupTab* panelp = (LLPanelGroupTab*) mSubTabContainer->getCurrentPanel();
if (panelp) panelp->activate();
}
@@ -412,15 +407,38 @@ BOOL LLPanelGroupRoles::hasModal()
return panelp->hasModal();
}
+void LLPanelGroupRoles::setGroupID(const LLUUID& id)
+{
+ LLPanelGroupTab::setGroupID(id);
+
+ LLPanelGroupMembersSubTab* group_members_tab = findChild<LLPanelGroupMembersSubTab>("members_sub_tab");
+ LLPanelGroupRolesSubTab* group_roles_tab = findChild<LLPanelGroupRolesSubTab>("roles_sub_tab");
+ LLPanelGroupActionsSubTab* group_actions_tab = findChild<LLPanelGroupActionsSubTab>("actions_sub_tab");
+ LLPanelGroupBanListSubTab* group_ban_tab = findChild<LLPanelGroupBanListSubTab>("banlist_sub_tab");
+
+ if(group_members_tab) group_members_tab->setGroupID(id);
+ if(group_roles_tab) group_roles_tab->setGroupID(id);
+ if(group_actions_tab) group_actions_tab->setGroupID(id);
+ if(group_ban_tab) group_ban_tab->setGroupID(id);
-////////////////////////////
-// LLPanelGroupSubTab
-////////////////////////////
+ LLButton* button = getChild<LLButton>("member_invite");
+ if ( button )
+ button->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_MEMBER_INVITE));
+
+ if(mSubTabContainer)
+ mSubTabContainer->selectTab(1);
+ group_roles_tab->mFirstOpen = TRUE;
+ activate();
+}
+
+
+// LLPanelGroupSubTab ////////////////////////////////////////////////////
LLPanelGroupSubTab::LLPanelGroupSubTab()
: LLPanelGroupTab(),
mHeader(NULL),
mFooter(NULL),
mActivated(false),
+ mHasGroupBanPower(false),
mSearchEditor(NULL)
{
}
@@ -538,13 +556,14 @@ void LLPanelGroupSubTab::buildActionsList(LLScrollListCtrl* ctrl,
{
if (LLGroupMgr::getInstance()->mRoleActionSets.empty())
{
- llwarns << "Can't build action list - no actions found." << llendl;
+ LL_WARNS() << "Can't build action list - no actions found." << LL_ENDL;
return;
}
+ mHasGroupBanPower = false;
+
std::vector<LLRoleActionSet*>::iterator ras_it = LLGroupMgr::getInstance()->mRoleActionSets.begin();
std::vector<LLRoleActionSet*>::iterator ras_end = LLGroupMgr::getInstance()->mRoleActionSets.end();
-
for ( ; ras_it != ras_end; ++ras_it)
{
buildActionCategory(ctrl,
@@ -567,7 +586,7 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl,
BOOL filter,
BOOL is_owner_role)
{
- lldebugs << "Building role list for: " << action_set->mActionSetData->mName << llendl;
+ LL_DEBUGS() << "Building role list for: " << action_set->mActionSetData->mName << LL_ENDL;
// See if the allow mask matches anything in this category.
if (show_all || (allowed_by_some & action_set->mActionSetData->mPowerBit))
{
@@ -674,6 +693,31 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl,
row["columns"][column_index]["value"] = (*ra_it)->mDescription;
row["columns"][column_index]["font"] = "SANSSERIF_SMALL";
+ if(mHasGroupBanPower)
+ {
+ // The ban ability is being set. Prevent these abilities from being manipulated
+ if((*ra_it)->mPowerBit == GP_MEMBER_EJECT)
+ {
+ row["enabled"] = false;
+ }
+ else if((*ra_it)->mPowerBit == GP_ROLE_REMOVE_MEMBER)
+ {
+ row["enabled"] = false;
+ }
+ }
+ else
+ {
+ // The ban ability is not set. Allow these abilities to be manipulated
+ if((*ra_it)->mPowerBit == GP_MEMBER_EJECT)
+ {
+ row["enabled"] = true;
+ }
+ else if((*ra_it)->mPowerBit == GP_ROLE_REMOVE_MEMBER)
+ {
+ row["enabled"] = true;
+ }
+ }
+
LLScrollListItem* item = ctrl->addElement(row, ADD_BOTTOM, (*ra_it));
if (-1 != check_box_index)
@@ -709,6 +753,15 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl,
check->setTentative(TRUE);
}
}
+
+ // Regardless of whether or not this ability is allowed by all or some, we want to prevent
+ // the group managers from accidentally disabling either of the two additional abilities
+ // tied with GP_GROUP_BAN_ACCESS.
+ if( (allowed_by_all & GP_GROUP_BAN_ACCESS) == GP_GROUP_BAN_ACCESS ||
+ (allowed_by_some & GP_GROUP_BAN_ACCESS) == GP_GROUP_BAN_ACCESS)
+ {
+ mHasGroupBanPower = true;
+ }
}
}
@@ -728,11 +781,8 @@ void LLPanelGroupSubTab::setFooterEnabled(BOOL enable)
}
}
-////////////////////////////
-// LLPanelGroupMembersSubTab
-////////////////////////////
-
+// LLPanelGroupMembersSubTab /////////////////////////////////////////////
static LLPanelInjector<LLPanelGroupMembersSubTab> t_panel_group_members_subtab("panel_group_members_subtab");
LLPanelGroupMembersSubTab::LLPanelGroupMembersSubTab()
@@ -743,17 +793,20 @@ LLPanelGroupMembersSubTab::LLPanelGroupMembersSubTab()
mChanged(FALSE),
mPendingMemberUpdate(FALSE),
mHasMatch(FALSE),
- mNumOwnerAdditions(0),
- mAvatarNameCacheConnection()
+ mNumOwnerAdditions(0)
{
}
LLPanelGroupMembersSubTab::~LLPanelGroupMembersSubTab()
{
- if (mAvatarNameCacheConnection.connected())
+ for (avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.begin(); it != mAvatarNameCacheConnections.end(); ++it)
{
- mAvatarNameCacheConnection.disconnect();
+ if (it->second.connected())
+ {
+ it->second.disconnect();
+ }
}
+ mAvatarNameCacheConnections.clear();
if (mMembersList)
{
gSavedSettings.setString("GroupMembersSortOrder", mMembersList->getSortColumnName());
@@ -810,6 +863,13 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root)
mEjectBtn->setEnabled(FALSE);
}
+ mBanBtn = parent->getChild<LLButton>("member_ban", recurse);
+ if(mBanBtn)
+ {
+ mBanBtn->setClickedCallback(onBanMember, this);
+ mBanBtn->setEnabled(FALSE);
+ }
+
return TRUE;
}
@@ -823,34 +883,6 @@ void LLPanelGroupMembersSubTab::setGroupID(const LLUUID& id)
LLPanelGroupSubTab::setGroupID(id);
}
-void LLPanelGroupRolesSubTab::setGroupID(const LLUUID& id)
-{
- if(mRolesList) mRolesList->deleteAllItems();
- if(mAssignedMembersList) mAssignedMembersList->deleteAllItems();
- if(mAllowedActionsList) mAllowedActionsList->deleteAllItems();
-
- if(mRoleName) mRoleName->clear();
- if(mRoleDescription) mRoleDescription->clear();
- if(mRoleTitle) mRoleTitle->clear();
-
- mHasRoleChange = FALSE;
-
- setFooterEnabled(FALSE);
-
- LLPanelGroupSubTab::setGroupID(id);
-}
-void LLPanelGroupActionsSubTab::setGroupID(const LLUUID& id)
-{
- if(mActionList) mActionList->deleteAllItems();
- if(mActionRoles) mActionRoles->deleteAllItems();
- if(mActionMembers) mActionMembers->deleteAllItems();
-
- if(mActionDescription) mActionDescription->clear();
-
- LLPanelGroupSubTab::setGroupID(id);
-}
-
-
// static
void LLPanelGroupMembersSubTab::onMemberSelect(LLUICtrl* ctrl, void* user_data)
{
@@ -860,7 +892,7 @@ void LLPanelGroupMembersSubTab::onMemberSelect(LLUICtrl* ctrl, void* user_data)
void LLPanelGroupMembersSubTab::handleMemberSelect()
{
- lldebugs << "LLPanelGroupMembersSubTab::handleMemberSelect" << llendl;
+ LL_DEBUGS() << "LLPanelGroupMembersSubTab::handleMemberSelect" << LL_ENDL;
mAssignedRolesList->deleteAllItems();
mAllowedActionsList->deleteAllItems();
@@ -868,8 +900,8 @@ void LLPanelGroupMembersSubTab::handleMemberSelect()
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
if (!gdatap)
{
- llwarns << "LLPanelGroupMembersSubTab::handleMemberSelect() "
- << "-- No group data!" << llendl;
+ LL_WARNS() << "LLPanelGroupMembersSubTab::handleMemberSelect() "
+ << "-- No group data!" << LL_ENDL;
return;
}
@@ -879,7 +911,7 @@ void LLPanelGroupMembersSubTab::handleMemberSelect()
// Build a vector of all selected members, and gather allowed actions.
uuid_vec_t selected_members;
- U64 allowed_by_all = 0xffffffffffffLL;
+ U64 allowed_by_all = GP_ALL_POWERS; //0xFFFFffffFFFFffffLL;
U64 allowed_by_some = 0;
std::vector<LLScrollListItem*>::iterator itor;
@@ -916,8 +948,8 @@ void LLPanelGroupMembersSubTab::handleMemberSelect()
LLGroupMgrGroupData::role_list_t::iterator iter = gdatap->mRoles.begin();
LLGroupMgrGroupData::role_list_t::iterator end = gdatap->mRoles.end();
- BOOL can_eject_members = gAgent.hasPowerInGroup(mGroupID,
- GP_MEMBER_EJECT);
+ BOOL can_ban_members = gAgent.hasPowerInGroup(mGroupID, GP_GROUP_BAN_ACCESS);
+ BOOL can_eject_members = gAgent.hasPowerInGroup(mGroupID, GP_MEMBER_EJECT);
BOOL member_is_owner = FALSE;
for( ; iter != end; ++iter)
@@ -964,6 +996,7 @@ void LLPanelGroupMembersSubTab::handleMemberSelect()
{
// Can't remove other owners.
cb_enable = FALSE;
+ can_ban_members = FALSE;
break;
}
}
@@ -983,14 +1016,14 @@ void LLPanelGroupMembersSubTab::handleMemberSelect()
}
// If anyone selected is in any role besides 'Everyone' then they can't be ejected.
- if (role_id.notNull() && (count > 0))
- {
+ if (role_id.notNull() && (count > 0))
+ {
can_eject_members = FALSE;
- if (role_id == gdatap->mOwnerRole)
- {
- member_is_owner = TRUE;
- }
- }
+ if (role_id == gdatap->mOwnerRole)
+ {
+ member_is_owner = TRUE;
+ }
+ }
LLRoleData rd;
if (gdatap->getRoleData(role_id,rd))
@@ -1041,13 +1074,16 @@ void LLPanelGroupMembersSubTab::handleMemberSelect()
else
{
// This could happen if changes are not synced right on sub-panel change.
- llwarns << "No group role data for " << iter->second << llendl;
+ LL_WARNS() << "No group role data for " << iter->second << LL_ENDL;
}
}
mAssignedRolesList->setEnabled(TRUE);
if (gAgent.isGodlike())
+ {
can_eject_members = TRUE;
+ // can_ban_members = TRUE;
+ }
if (!can_eject_members && !member_is_owner)
{
@@ -1060,10 +1096,41 @@ void LLPanelGroupMembersSubTab::handleMemberSelect()
if ( member_data && member_data->isInRole(gdatap->mOwnerRole) )
{
can_eject_members = TRUE;
+ //can_ban_members = TRUE;
}
}
+
+ }
+
+ // ... or we can eject them because we have all the requisite powers...
+ if( gAgent.hasPowerInGroup(mGroupID, GP_ROLE_REMOVE_MEMBER) &&
+ !member_is_owner)
+ {
+ if( gAgent.hasPowerInGroup(mGroupID, GP_MEMBER_EJECT))
+ {
+ can_eject_members = TRUE;
+ }
+
+ if( gAgent.hasPowerInGroup(mGroupID, GP_GROUP_BAN_ACCESS))
+ {
+ can_ban_members = TRUE;
+ }
}
+
+ uuid_vec_t::const_iterator member_iter = selected_members.begin();
+ uuid_vec_t::const_iterator member_end = selected_members.end();
+ for ( ; member_iter != member_end; ++member_iter)
+ {
+ // Don't count the agent.
+ if ((*member_iter) == gAgent.getID())
+ {
+ can_eject_members = FALSE;
+ can_ban_members = FALSE;
+ }
+ }
+
+ mBanBtn->setEnabled(can_ban_members);
mEjectBtn->setEnabled(can_eject_members);
}
@@ -1101,61 +1168,26 @@ void LLPanelGroupMembersSubTab::onEjectMembers(void *userdata)
}
void LLPanelGroupMembersSubTab::handleEjectMembers()
-{
+{
+ //send down an eject message
+ uuid_vec_t selected_members;
+
std::vector<LLScrollListItem*> selection = mMembersList->getAllSelected();
if (selection.empty()) return;
-
- S32 selection_count = selection.size();
- if (selection_count == 1)
- {
- LLSD args;
- LLUUID selected_avatar = mMembersList->getValue().asUUID();
- std::string fullname = LLSLURL("agent", selected_avatar, "inspect").getSLURLString();
- args["AVATAR_NAME"] = fullname;
- LLSD payload;
- LLNotificationsUtil::add("EjectGroupMemberWarning",
- args,
- payload,
- boost::bind(&LLPanelGroupMembersSubTab::handleEjectCallback, this, _1, _2));
- }
- else
- {
- LLSD args;
- args["COUNT"] = llformat("%d", selection_count);
- LLSD payload;
- LLNotificationsUtil::add("EjectGroupMembersWarning",
- args,
- payload,
- boost::bind(&LLPanelGroupMembersSubTab::handleEjectCallback, this, _1, _2));
- }
-}
-bool LLPanelGroupMembersSubTab::handleEjectCallback(const LLSD& notification, const LLSD& response)
-{
- S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
- if (0 == option) // Eject button
+ std::vector<LLScrollListItem*>::iterator itor;
+ for (itor = selection.begin() ;
+ itor != selection.end(); ++itor)
{
- //send down an eject message
- uuid_vec_t selected_members;
-
- std::vector<LLScrollListItem*> selection = mMembersList->getAllSelected();
- if (selection.empty()) return false;
-
- std::vector<LLScrollListItem*>::iterator itor;
- for (itor = selection.begin() ;
- itor != selection.end(); ++itor)
- {
- LLUUID member_id = (*itor)->getUUID();
- selected_members.push_back( member_id );
- }
-
- mMembersList->deleteSelectedItems();
-
- sendEjectNotifications(mGroupID, selected_members);
-
- LLGroupMgr::getInstance()->sendGroupMemberEjects(mGroupID, selected_members);
+ LLUUID member_id = (*itor)->getUUID();
+ selected_members.push_back( member_id );
}
- return false;
+
+ mMembersList->deleteSelectedItems();
+
+ sendEjectNotifications(mGroupID, selected_members);
+
+ LLGroupMgr::getInstance()->sendGroupMemberEjects(mGroupID, selected_members);
}
void LLPanelGroupMembersSubTab::sendEjectNotifications(const LLUUID& group_id, const uuid_vec_t& selected_members)
@@ -1183,12 +1215,11 @@ void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id,
//add that the user is requesting to change the roles for selected
//members
- U64 powers_all_have = 0xffffffffffffLL;
+ U64 powers_all_have = GP_ALL_POWERS;
U64 powers_some_have = 0;
BOOL is_owner_role = ( gdatap->mOwnerRole == role_id );
LLUUID member_id;
-
std::vector<LLScrollListItem*> selection = mMembersList->getAllSelected();
if (selection.empty())
@@ -1199,7 +1230,6 @@ void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id,
for (std::vector<LLScrollListItem*>::iterator itor = selection.begin() ;
itor != selection.end(); ++itor)
{
-
member_id = (*itor)->getUUID();
//see if we requested a change for this member before
@@ -1265,7 +1295,6 @@ void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id,
FALSE);
}
-
// static
void LLPanelGroupMembersSubTab::onRoleCheck(LLUICtrl* ctrl, void* user_data)
{
@@ -1304,6 +1333,15 @@ void LLPanelGroupMembersSubTab::activate()
update(GC_ALL);
mActivated = true;
}
+ else
+ {
+ LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
+ // Members can be removed outside of this tab, checking changes
+ if (!gdatap || (gdatap->isMemberDataComplete() && gdatap->mMembers.size() != mMembersList->getItemCount()))
+ {
+ update(GC_MEMBER_DATA);
+ }
+ }
}
void LLPanelGroupMembersSubTab::deactivate()
@@ -1335,7 +1373,7 @@ bool LLPanelGroupMembersSubTab::apply(std::string& mesg)
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
if (!gdatap)
{
- llwarns << "Unable to get group data for group " << mGroupID << llendl;
+ LL_WARNS() << "Unable to get group data for group " << mGroupID << LL_ENDL;
mesg.assign("Unable to save member data. Try again later.");
return false;
@@ -1361,7 +1399,7 @@ bool LLPanelGroupMembersSubTab::apply(std::string& mesg)
}
else
{
- llwarns << "Unable to get role information for the owner role in group " << mGroupID << llendl;
+ LL_WARNS() << "Unable to get role information for the owner role in group " << mGroupID << LL_ENDL;
mesg.assign("Unable to retried specific group information. Try again later");
return false;
@@ -1397,7 +1435,7 @@ void LLPanelGroupMembersSubTab::applyMemberChanges()
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
if (!gdatap)
{
- llwarns << "Unable to get group data for group " << mGroupID << llendl;
+ LL_WARNS() << "Unable to get group data for group " << mGroupID << LL_ENDL;
return;
}
@@ -1461,21 +1499,21 @@ U64 LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges(const LLUUID& ag
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
if (!gdatap)
{
- llwarns << "LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges() -- No group data!" << llendl;
+ LL_WARNS() << "LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges() -- No group data!" << LL_ENDL;
return GP_NO_POWERS;
}
LLGroupMgrGroupData::member_list_t::iterator iter = gdatap->mMembers.find(agent_id);
if ( iter == gdatap->mMembers.end() )
{
- llwarns << "LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges() -- No member data for member with UUID " << agent_id << llendl;
+ LL_WARNS() << "LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges() -- No member data for member with UUID " << agent_id << LL_ENDL;
return GP_NO_POWERS;
}
LLGroupMemberData* member_data = (*iter).second;
if (!member_data)
{
- llwarns << "LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges() -- Null member data for member with UUID " << agent_id << llendl;
+ LL_WARNS() << "LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges() -- Null member data for member with UUID " << agent_id << LL_ENDL;
return GP_NO_POWERS;
}
@@ -1581,7 +1619,7 @@ void LLPanelGroupMembersSubTab::update(LLGroupChange gc)
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
if (!gdatap)
{
- llwarns << "LLPanelGroupMembersSubTab::update() -- No group data!" << llendl;
+ LL_WARNS() << "LLPanelGroupMembersSubTab::update() -- No group data!" << LL_ENDL;
return;
}
@@ -1644,9 +1682,17 @@ void LLPanelGroupMembersSubTab::addMemberToList(LLGroupMemberData* data)
mHasMatch = TRUE;
}
-void LLPanelGroupMembersSubTab::onNameCache(const LLUUID& update_id, LLGroupMemberData* member, const LLAvatarName& av_name)
+void LLPanelGroupMembersSubTab::onNameCache(const LLUUID& update_id, LLGroupMemberData* member, const LLAvatarName& av_name, const LLUUID& av_id)
{
- mAvatarNameCacheConnection.disconnect();
+ avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(av_id);
+ if (it != mAvatarNameCacheConnections.end())
+ {
+ if (it->second.connected())
+ {
+ it->second.disconnect();
+ }
+ mAvatarNameCacheConnections.erase(it);
+ }
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
if (!gdatap
@@ -1677,7 +1723,7 @@ void LLPanelGroupMembersSubTab::updateMembers()
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
if (!gdatap)
{
- llwarns << "LLPanelGroupMembersSubTab::updateMembers() -- No group data!" << llendl;
+ LL_WARNS() << "LLPanelGroupMembersSubTab::updateMembers() -- No group data!" << LL_ENDL;
return;
}
@@ -1690,13 +1736,12 @@ void LLPanelGroupMembersSubTab::updateMembers()
return;
}
- //cleanup list only for first iretation
+ //cleanup list only for first iteration
if(mMemberProgress == gdatap->mMembers.begin())
{
mMembersList->deleteAllItems();
}
-
LLGroupMgrGroupData::member_list_t::iterator end = gdatap->mMembers.end();
LLTimer update_time;
@@ -1719,12 +1764,16 @@ void LLPanelGroupMembersSubTab::updateMembers()
else
{
// If name is not cached, onNameCache() should be called when it is cached and add this member to list.
- // *TODO : Add one callback per fetched avatar name
- if (mAvatarNameCacheConnection.connected())
+ avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(mMemberProgress->first);
+ if (it != mAvatarNameCacheConnections.end())
{
- mAvatarNameCacheConnection.disconnect();
+ if (it->second.connected())
+ {
+ it->second.disconnect();
+ }
+ mAvatarNameCacheConnections.erase(it);
}
- mAvatarNameCacheConnection = LLAvatarNameCache::get(mMemberProgress->first, boost::bind(&LLPanelGroupMembersSubTab::onNameCache, this, gdatap->getMemberVersion(), mMemberProgress->second, _2));
+ mAvatarNameCacheConnections[mMemberProgress->first] = LLAvatarNameCache::get(mMemberProgress->first, boost::bind(&LLPanelGroupMembersSubTab::onNameCache, this, gdatap->getMemberVersion(), mMemberProgress->second, _2, _1));
}
}
@@ -1749,12 +1798,44 @@ void LLPanelGroupMembersSubTab::updateMembers()
handleMemberSelect();
}
+void LLPanelGroupMembersSubTab::onBanMember(void* user_data)
+{
+ LLPanelGroupMembersSubTab* self = static_cast<LLPanelGroupMembersSubTab*>(user_data);
+ self->handleBanMember();
+}
+void LLPanelGroupMembersSubTab::handleBanMember()
+{
+ LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
+ if(!gdatap)
+ {
+ LL_WARNS("Groups") << "Unable to get group data for group " << mGroupID << LL_ENDL;
+ return;
+ }
+
+ std::vector<LLScrollListItem*> selection = mMembersList->getAllSelected();
+ if(selection.empty())
+ {
+ return;
+ }
-////////////////////////////
-// LLPanelGroupRolesSubTab
-////////////////////////////
+ uuid_vec_t ban_ids;
+ std::vector<LLScrollListItem*>::iterator itor;
+ for(itor = selection.begin(); itor != selection.end(); ++itor)
+ {
+ LLUUID ban_id = (*itor)->getUUID();
+ ban_ids.push_back(ban_id);
+
+ LLGroupBanData ban_data;
+ gdatap->createBanEntry(ban_id, ban_data);
+ }
+
+ LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_POST, mGroupID, LLGroupMgr::BAN_CREATE, ban_ids);
+ handleEjectMembers();
+}
+
+// LLPanelGroupRolesSubTab ///////////////////////////////////////////////
static LLPanelInjector<LLPanelGroupRolesSubTab> t_panel_group_roles_subtab("panel_group_roles_subtab");
LLPanelGroupRolesSubTab::LLPanelGroupRolesSubTab()
@@ -1768,7 +1849,7 @@ LLPanelGroupRolesSubTab::LLPanelGroupRolesSubTab()
mMemberVisibleCheck(NULL),
mDeleteRoleButton(NULL),
mCreateRoleButton(NULL),
-
+ mFirstOpen(TRUE),
mHasRoleChange(FALSE)
{
}
@@ -1803,7 +1884,7 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root)
if (!mRolesList || !mAssignedMembersList || !mAllowedActionsList
|| !mRoleName || !mRoleTitle || !mRoleDescription || !mMemberVisibleCheck)
{
- llwarns << "ARG! element not found." << llendl;
+ LL_WARNS() << "ARG! element not found." << LL_ENDL;
return FALSE;
}
@@ -1867,16 +1948,23 @@ void LLPanelGroupRolesSubTab::activate()
void LLPanelGroupRolesSubTab::deactivate()
{
- lldebugs << "LLPanelGroupRolesSubTab::deactivate()" << llendl;
+ LL_DEBUGS() << "LLPanelGroupRolesSubTab::deactivate()" << LL_ENDL;
LLPanelGroupSubTab::deactivate();
+ mFirstOpen = FALSE;
}
bool LLPanelGroupRolesSubTab::needsApply(std::string& mesg)
{
- lldebugs << "LLPanelGroupRolesSubTab::needsApply()" << llendl;
+ LL_DEBUGS() << "LLPanelGroupRolesSubTab::needsApply()" << LL_ENDL;
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
+ if(!gdatap)
+ {
+ LL_WARNS() << "Unable to get group data for group " << mGroupID << LL_ENDL;
+ return false;
+ }
+
return (mHasRoleChange // Text changed in current role
|| (gdatap && gdatap->pendingRoleChanges())); // Pending role changes in the group
@@ -1884,10 +1972,10 @@ bool LLPanelGroupRolesSubTab::needsApply(std::string& mesg)
bool LLPanelGroupRolesSubTab::apply(std::string& mesg)
{
- lldebugs << "LLPanelGroupRolesSubTab::apply()" << llendl;
+ LL_DEBUGS() << "LLPanelGroupRolesSubTab::apply()" << LL_ENDL;
saveRoleChanges(true);
-
+ mFirstOpen = FALSE;
LLGroupMgr::getInstance()->sendGroupRoleChanges(mGroupID);
notifyObservers();
@@ -1947,7 +2035,7 @@ bool LLPanelGroupRolesSubTab::matchesSearchFilter(std::string rolename, std::str
void LLPanelGroupRolesSubTab::update(LLGroupChange gc)
{
- lldebugs << "LLPanelGroupRolesSubTab::update()" << llendl;
+ LL_DEBUGS() << "LLPanelGroupRolesSubTab::update()" << LL_ENDL;
if (mGroupID.isNull()) return;
@@ -1992,7 +2080,7 @@ void LLPanelGroupRolesSubTab::update(LLGroupChange gc)
}
else
{
- llwarns << "LLPanelGroupRolesSubTab::update() No role data for role " << (*rit).first << llendl;
+ LL_WARNS() << "LLPanelGroupRolesSubTab::update() No role data for role " << (*rit).first << LL_ENDL;
}
}
@@ -2024,14 +2112,17 @@ void LLPanelGroupRolesSubTab::update(LLGroupChange gc)
}
}
- if (!gdatap || !gdatap->isMemberDataComplete())
+ if(!mFirstOpen)
{
- LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mGroupID);
- }
-
- if (!gdatap || !gdatap->isRoleMemberDataComplete())
- {
- LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(mGroupID);
+ if (!gdatap || !gdatap->isMemberDataComplete())
+ {
+ LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mGroupID);
+ }
+
+ if (!gdatap || !gdatap->isRoleMemberDataComplete())
+ {
+ LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(mGroupID);
+ }
}
if ((GC_ROLE_MEMBER_DATA == gc || GC_MEMBER_DATA == gc)
@@ -2047,13 +2138,16 @@ void LLPanelGroupRolesSubTab::update(LLGroupChange gc)
void LLPanelGroupRolesSubTab::onRoleSelect(LLUICtrl* ctrl, void* user_data)
{
LLPanelGroupRolesSubTab* self = static_cast<LLPanelGroupRolesSubTab*>(user_data);
+ if (!self)
+ return;
+
self->handleRoleSelect();
}
void LLPanelGroupRolesSubTab::handleRoleSelect()
{
BOOL can_delete = TRUE;
- lldebugs << "LLPanelGroupRolesSubTab::handleRoleSelect()" << llendl;
+ LL_DEBUGS() << "LLPanelGroupRolesSubTab::handleRoleSelect()" << LL_ENDL;
mAssignedMembersList->deleteAllItems();
mAllowedActionsList->deleteAllItems();
@@ -2061,8 +2155,8 @@ void LLPanelGroupRolesSubTab::handleRoleSelect()
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
if (!gdatap)
{
- llwarns << "LLPanelGroupRolesSubTab::handleRoleSelect() "
- << "-- No group data!" << llendl;
+ LL_WARNS() << "LLPanelGroupRolesSubTab::handleRoleSelect() "
+ << "-- No group data!" << LL_ENDL;
return;
}
@@ -2150,8 +2244,8 @@ void LLPanelGroupRolesSubTab::buildMembersList()
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
if (!gdatap)
{
- llwarns << "LLPanelGroupRolesSubTab::handleRoleSelect() "
- << "-- No group data!" << llendl;
+ LL_WARNS() << "LLPanelGroupRolesSubTab::handleRoleSelect() "
+ << "-- No group data!" << LL_ENDL;
return;
}
@@ -2200,13 +2294,13 @@ void LLPanelGroupRolesSubTab::handleActionCheck(LLUICtrl* ctrl, bool force)
if (!check)
return;
- lldebugs << "LLPanelGroupRolesSubTab::handleActionSelect()" << llendl;
+ LL_DEBUGS() << "LLPanelGroupRolesSubTab::handleActionSelect()" << LL_ENDL;
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
if (!gdatap)
{
- llwarns << "LLPanelGroupRolesSubTab::handleRoleSelect() "
- << "-- No group data!" << llendl;
+ LL_WARNS() << "LLPanelGroupRolesSubTab::handleRoleSelect() "
+ << "-- No group data!" << LL_ENDL;
return;
}
@@ -2226,40 +2320,115 @@ void LLPanelGroupRolesSubTab::handleActionCheck(LLUICtrl* ctrl, bool force)
LLRoleAction* rap = (LLRoleAction*)action_item->getUserdata();
U64 power = rap->mPowerBit;
- if (check->get())
+ bool isEnablingAbility = check->get();
+ LLRoleData rd;
+ LLSD args;
+
+ if (isEnablingAbility &&
+ !force &&
+ ((GP_ROLE_ASSIGN_MEMBER == power) || (GP_ROLE_CHANGE_ACTIONS == power) ))
{
- if (!force && ( (GP_ROLE_ASSIGN_MEMBER == power)
- || (GP_ROLE_CHANGE_ACTIONS == power) ))
+ // Uncheck the item, for now. It will be
+ // checked if they click 'Yes', below.
+ check->set(FALSE);
+
+ LLRoleData rd;
+ LLSD args;
+
+ if ( gdatap->getRoleData(role_id, rd) )
{
- // Uncheck the item, for now. It will be
- // checked if they click 'Yes', below.
- check->set(FALSE);
+ args["ACTION_NAME"] = rap->mDescription;
+ args["ROLE_NAME"] = rd.mRoleName;
+ mHasModal = TRUE;
+ std::string warning = "AssignDangerousActionWarning";
+ if (GP_ROLE_CHANGE_ACTIONS == power)
+ {
+ warning = "AssignDangerousAbilityWarning";
+ }
+ LLNotificationsUtil::add(warning, args, LLSD(), boost::bind(&LLPanelGroupRolesSubTab::addActionCB, this, _1, _2, check));
+ }
+ else
+ {
+ LL_WARNS() << "Unable to look up role information for role id: "
+ << role_id << LL_ENDL;
+ }
+ }
- LLRoleData rd;
- LLSD args;
+ if(GP_GROUP_BAN_ACCESS == power)
+ {
+ std::string warning = isEnablingAbility ? "AssignBanAbilityWarning" : "RemoveBanAbilityWarning";
- if ( gdatap->getRoleData(role_id, rd) )
+ //////////////////////////////////////////////////////////////////////////
+ // Get role data for both GP_ROLE_REMOVE_MEMBER and GP_MEMBER_EJECT
+ // Add description and role name to LLSD
+ // Pop up dialog saying "Yo, you also granted these other abilities when you did this!"
+ if ( gdatap->getRoleData(role_id, rd) )
+ {
+ args["ACTION_NAME"] = rap->mDescription;
+ args["ROLE_NAME"] = rd.mRoleName;
+ mHasModal = TRUE;
+
+ std::vector<LLScrollListItem*> all_data = mAllowedActionsList->getAllData();
+ std::vector<LLScrollListItem*>::iterator ad_it = all_data.begin();
+ std::vector<LLScrollListItem*>::iterator ad_end = all_data.end();
+ LLRoleAction* adp;
+ for( ; ad_it != ad_end; ++ad_it)
{
- args["ACTION_NAME"] = rap->mDescription;
- args["ROLE_NAME"] = rd.mRoleName;
- mHasModal = TRUE;
- std::string warning = "AssignDangerousActionWarning";
- if (GP_ROLE_CHANGE_ACTIONS == power)
+ adp = (LLRoleAction*)(*ad_it)->getUserdata();
+ if(adp->mPowerBit == GP_MEMBER_EJECT)
{
- warning = "AssignDangerousAbilityWarning";
+ args["ACTION_NAME_2"] = adp->mDescription;
+ }
+ else if(adp->mPowerBit == GP_ROLE_REMOVE_MEMBER)
+ {
+ args["ACTION_NAME_3"] = adp->mDescription;
}
- LLNotificationsUtil::add(warning, args, LLSD(), boost::bind(&LLPanelGroupRolesSubTab::addActionCB, this, _1, _2, check));
- }
- else
- {
- llwarns << "Unable to look up role information for role id: "
- << role_id << llendl;
}
+
+ LLNotificationsUtil::add(warning, args);
+ }
+ else
+ {
+ LL_WARNS() << "Unable to look up role information for role id: "
+ << role_id << LL_ENDL;
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+
+ LLGroupMgrGroupData::role_list_t::iterator rit = gdatap->mRoles.find(role_id);
+ U64 current_role_powers = GP_NO_POWERS;
+ if (rit != gdatap->mRoles.end())
+ {
+ current_role_powers = ((*rit).second->getRoleData().mRolePowers);
+ }
+
+ if(isEnablingAbility)
+ {
+ power |= (GP_ROLE_REMOVE_MEMBER | GP_MEMBER_EJECT);
+ current_role_powers |= power;
}
else
{
- gdatap->addRolePower(role_id,power);
+ current_role_powers &= ~GP_GROUP_BAN_ACCESS;
}
+
+ mAllowedActionsList->deleteAllItems();
+ buildActionsList( mAllowedActionsList,
+ current_role_powers,
+ current_role_powers,
+ boost::bind(&LLPanelGroupRolesSubTab::handleActionCheck, this, _1, false),
+ TRUE,
+ FALSE,
+ FALSE);
+
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ // Adding non-specific ability to role
+ //////////////////////////////////////////////////////////////////////////
+ if(isEnablingAbility)
+ {
+ gdatap->addRolePower(role_id, power);
}
else
{
@@ -2268,6 +2437,7 @@ void LLPanelGroupRolesSubTab::handleActionCheck(LLUICtrl* ctrl, bool force)
mHasRoleChange = TRUE;
notifyObservers();
+
}
bool LLPanelGroupRolesSubTab::addActionCB(const LLSD& notification, const LLSD& response, LLCheckBoxCtrl* check)
@@ -2287,7 +2457,6 @@ bool LLPanelGroupRolesSubTab::addActionCB(const LLSD& notification, const LLSD&
return false;
}
-
// static
void LLPanelGroupRolesSubTab::onPropertiesKey(LLLineEditor* ctrl, void* user_data)
{
@@ -2326,13 +2495,13 @@ void LLPanelGroupRolesSubTab::onMemberVisibilityChange(LLUICtrl* ctrl, void* use
void LLPanelGroupRolesSubTab::handleMemberVisibilityChange(bool value)
{
- lldebugs << "LLPanelGroupRolesSubTab::handleMemberVisibilityChange()" << llendl;
+ LL_DEBUGS() << "LLPanelGroupRolesSubTab::handleMemberVisibilityChange()" << LL_ENDL;
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
if (!gdatap)
{
- llwarns << "LLPanelGroupRolesSubTab::handleRoleSelect() "
- << "-- No group data!" << llendl;
+ LL_WARNS() << "LLPanelGroupRolesSubTab::handleRoleSelect() "
+ << "-- No group data!" << LL_ENDL;
return;
}
@@ -2465,12 +2634,27 @@ void LLPanelGroupRolesSubTab::saveRoleChanges(bool select_saved_role)
mHasRoleChange = FALSE;
}
}
-////////////////////////////
-// LLPanelGroupActionsSubTab
-////////////////////////////
-static LLPanelInjector<LLPanelGroupActionsSubTab> t_panel_group_actions_subtab("panel_group_actions_subtab");
+void LLPanelGroupRolesSubTab::setGroupID(const LLUUID& id)
+{
+ if(mRolesList) mRolesList->deleteAllItems();
+ if(mAssignedMembersList) mAssignedMembersList->deleteAllItems();
+ if(mAllowedActionsList) mAllowedActionsList->deleteAllItems();
+ if(mRoleName) mRoleName->clear();
+ if(mRoleDescription) mRoleDescription->clear();
+ if(mRoleTitle) mRoleTitle->clear();
+
+ mHasRoleChange = FALSE;
+
+ setFooterEnabled(FALSE);
+
+ LLPanelGroupSubTab::setGroupID(id);
+}
+
+
+// LLPanelGroupActionsSubTab /////////////////////////////////////////////
+static LLPanelInjector<LLPanelGroupActionsSubTab> t_panel_group_actions_subtab("panel_group_actions_subtab");
LLPanelGroupActionsSubTab::LLPanelGroupActionsSubTab()
: LLPanelGroupSubTab()
@@ -2519,27 +2703,27 @@ void LLPanelGroupActionsSubTab::activate()
void LLPanelGroupActionsSubTab::deactivate()
{
- lldebugs << "LLPanelGroupActionsSubTab::deactivate()" << llendl;
+ LL_DEBUGS() << "LLPanelGroupActionsSubTab::deactivate()" << LL_ENDL;
LLPanelGroupSubTab::deactivate();
}
bool LLPanelGroupActionsSubTab::needsApply(std::string& mesg)
{
- lldebugs << "LLPanelGroupActionsSubTab::needsApply()" << llendl;
+ LL_DEBUGS() << "LLPanelGroupActionsSubTab::needsApply()" << LL_ENDL;
return false;
}
bool LLPanelGroupActionsSubTab::apply(std::string& mesg)
{
- lldebugs << "LLPanelGroupActionsSubTab::apply()" << llendl;
+ LL_DEBUGS() << "LLPanelGroupActionsSubTab::apply()" << LL_ENDL;
return true;
}
void LLPanelGroupActionsSubTab::update(LLGroupChange gc)
{
- lldebugs << "LLPanelGroupActionsSubTab::update()" << llendl;
+ LL_DEBUGS() << "LLPanelGroupActionsSubTab::update()" << LL_ENDL;
if (mGroupID.isNull()) return;
@@ -2644,26 +2828,298 @@ void LLPanelGroupActionsSubTab::handleActionSelect()
}
}
-void LLPanelGroupRoles::setGroupID(const LLUUID& id)
+void LLPanelGroupActionsSubTab::setGroupID(const LLUUID& id)
{
- LLPanelGroupTab::setGroupID(id);
+ if(mActionList) mActionList->deleteAllItems();
+ if(mActionRoles) mActionRoles->deleteAllItems();
+ if(mActionMembers) mActionMembers->deleteAllItems();
+
+ if(mActionDescription) mActionDescription->clear();
- LLPanelGroupMembersSubTab* group_members_tab = findChild<LLPanelGroupMembersSubTab>("members_sub_tab");
- LLPanelGroupRolesSubTab* group_roles_tab = findChild<LLPanelGroupRolesSubTab>("roles_sub_tab");
- LLPanelGroupActionsSubTab* group_actions_tab = findChild<LLPanelGroupActionsSubTab>("actions_sub_tab");
+ LLPanelGroupSubTab::setGroupID(id);
+}
- if(group_members_tab) group_members_tab->setGroupID(id);
- if(group_roles_tab) group_roles_tab->setGroupID(id);
- if(group_actions_tab) group_actions_tab->setGroupID(id);
- LLButton* button = getChild<LLButton>("member_invite");
- if ( button )
- button->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_MEMBER_INVITE));
+// LLPanelGroupBanListSubTab /////////////////////////////////////////////
+static LLPanelInjector<LLPanelGroupBanListSubTab> t_panel_group_ban_subtab("panel_group_banlist_subtab");
- if(mSubTabContainer)
- mSubTabContainer->selectTab(1);
+LLPanelGroupBanListSubTab::LLPanelGroupBanListSubTab()
+ : LLPanelGroupSubTab(),
+ mBanList(NULL),
+ mCreateBanButton(NULL),
+ mDeleteBanButton(NULL)
+{}
- activate();
+BOOL LLPanelGroupBanListSubTab::postBuildSubTab(LLView* root)
+{
+ LLPanelGroupSubTab::postBuildSubTab(root);
+
+ // Upcast parent so we can ask it for sibling controls.
+ LLPanelGroupRoles* parent = (LLPanelGroupRoles*)root;
+
+ // Look recursively from the parent to find all our widgets.
+ bool recurse = true;
+
+ mHeader = parent->getChild<LLPanel>("banlist_header", recurse);
+ mFooter = parent->getChild<LLPanel>("banlist_footer", recurse);
+
+ mBanList = parent->getChild<LLNameListCtrl>("ban_list", recurse);
+
+ mCreateBanButton = parent->getChild<LLButton>("ban_create", recurse);
+ mDeleteBanButton = parent->getChild<LLButton>("ban_delete", recurse);
+ mRefreshBanListButton = parent->getChild<LLButton>("ban_refresh", recurse);
+ mBanCountText = parent->getChild<LLTextBase>("ban_count", recurse);
+
+ if(!mBanList || !mCreateBanButton || !mDeleteBanButton || !mRefreshBanListButton || !mBanCountText)
+ return FALSE;
+
+ mBanList->setCommitOnSelectionChange(TRUE);
+ mBanList->setCommitCallback(onBanEntrySelect, this);
+
+ mCreateBanButton->setClickedCallback(onCreateBanEntry, this);
+ mCreateBanButton->setEnabled(FALSE);
+
+ mDeleteBanButton->setClickedCallback(onDeleteBanEntry, this);
+ mDeleteBanButton->setEnabled(FALSE);
+
+ mRefreshBanListButton->setClickedCallback(onRefreshBanList, this);
+ mRefreshBanListButton->setEnabled(FALSE);
+
+ setBanCount(0);
+
+ mBanList->setOnNameListCompleteCallback(boost::bind(&LLPanelGroupBanListSubTab::onBanListCompleted, this, _1));
+
+ populateBanList();
+
+ setFooterEnabled(FALSE);
+ return TRUE;
}
+void LLPanelGroupBanListSubTab::activate()
+{
+ LLPanelGroupSubTab::activate();
+
+ mBanList->deselectAllItems();
+ mDeleteBanButton->setEnabled(FALSE);
+ LLGroupMgrGroupData * group_datap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
+ if (group_datap)
+ {
+ mCreateBanButton->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_GROUP_BAN_ACCESS) &&
+ group_datap->mBanList.size() < GB_MAX_BANNED_AGENTS);
+ setBanCount(group_datap->mBanList.size());
+ }
+ else
+ {
+ mCreateBanButton->setEnabled(FALSE);
+ setBanCount(0);
+ }
+
+ // BAKER: Should I really request everytime activate() is called?
+ // Perhaps I should only do it on a force refresh, or if an action on the list happens...
+ // Because it's not going to live-update the list anyway... You'd have to refresh if you
+ // wanted to see someone else's additions anyway...
+ //
+ LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_GET, mGroupID);
+
+ setFooterEnabled(FALSE);
+ update(GC_ALL);
+}
+
+void LLPanelGroupBanListSubTab::update(LLGroupChange gc)
+{
+ populateBanList();
+}
+
+void LLPanelGroupBanListSubTab::draw()
+{
+ LLPanelGroupSubTab::draw();
+
+ // BAKER: Might be good to put it here instead of update, maybe.. See how often draw gets hit.
+ //if(
+ // populateBanList();
+}
+
+void LLPanelGroupBanListSubTab::onBanEntrySelect(LLUICtrl* ctrl, void* user_data)
+{
+ LLPanelGroupBanListSubTab* self = static_cast<LLPanelGroupBanListSubTab*>(user_data);
+ if (!self)
+ return;
+
+ self->handleBanEntrySelect();
+}
+
+void LLPanelGroupBanListSubTab::handleBanEntrySelect()
+{
+ if (gAgent.hasPowerInGroup(mGroupID, GP_GROUP_BAN_ACCESS))
+ {
+ mDeleteBanButton->setEnabled(TRUE);
+ }
+}
+
+void LLPanelGroupBanListSubTab::onCreateBanEntry(void* user_data)
+{
+ LLPanelGroupBanListSubTab* self = static_cast<LLPanelGroupBanListSubTab*>(user_data);
+ if (!self)
+ return;
+
+ self->handleCreateBanEntry();
+}
+
+void LLPanelGroupBanListSubTab::handleCreateBanEntry()
+{
+ LLFloaterGroupBulkBan::showForGroup(mGroupID);
+ //populateBanList();
+}
+
+void LLPanelGroupBanListSubTab::onDeleteBanEntry(void* user_data)
+{
+ LLPanelGroupBanListSubTab* self = static_cast<LLPanelGroupBanListSubTab*>(user_data);
+ if (!self)
+ return;
+
+ self->handleDeleteBanEntry();
+}
+
+void LLPanelGroupBanListSubTab::handleDeleteBanEntry()
+{
+ LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
+ if(!gdatap)
+ {
+ LL_WARNS("Groups") << "Unable to get group data for group " << mGroupID << LL_ENDL;
+ return;
+ }
+
+ std::vector<LLScrollListItem*> selection = mBanList->getAllSelected();
+ if(selection.empty())
+ {
+ return;
+ }
+
+ bool can_ban_members = false;
+ if (gAgent.isGodlike() ||
+ gAgent.hasPowerInGroup(mGroupID, GP_GROUP_BAN_ACCESS))
+ {
+ can_ban_members = true;
+ }
+
+ // Owners can ban anyone in the group.
+ LLGroupMgrGroupData::member_list_t::iterator mi = gdatap->mMembers.find(gAgent.getID());
+ if (mi != gdatap->mMembers.end())
+ {
+ LLGroupMemberData* member_data = (*mi).second;
+ if ( member_data && member_data->isInRole(gdatap->mOwnerRole) )
+ {
+ can_ban_members = true;
+ }
+ }
+
+ if(!can_ban_members)
+ return;
+
+ std::vector<LLUUID> ban_ids;
+ std::vector<LLScrollListItem*>::iterator itor;
+ for(itor = selection.begin(); itor != selection.end(); ++itor)
+ {
+ LLUUID ban_id = (*itor)->getUUID();
+ ban_ids.push_back(ban_id);
+
+ gdatap->removeBanEntry(ban_id);
+ mBanList->removeNameItem(ban_id);
+
+ // Removing an item removes the selection, we shouldn't be able to click
+ // the button anymore until we reselect another entry.
+ mDeleteBanButton->setEnabled(FALSE);
+ }
+
+ // update ban-count related elements
+ mCreateBanButton->setEnabled(TRUE);
+ setBanCount(gdatap->mBanList.size());
+
+ LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_POST, mGroupID, LLGroupMgr::BAN_DELETE, ban_ids);
+}
+
+void LLPanelGroupBanListSubTab::onRefreshBanList(void* user_data)
+{
+ LLPanelGroupBanListSubTab* self = static_cast<LLPanelGroupBanListSubTab*>(user_data);
+ if (!self)
+ return;
+
+ self->handleRefreshBanList();
+}
+
+void LLPanelGroupBanListSubTab::handleRefreshBanList()
+{
+ mRefreshBanListButton->setEnabled(FALSE);
+ LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_GET, mGroupID);
+}
+
+void LLPanelGroupBanListSubTab::onBanListCompleted(bool isComplete)
+{
+ if(isComplete)
+ {
+ mRefreshBanListButton->setEnabled(TRUE);
+ populateBanList();
+ }
+}
+
+void LLPanelGroupBanListSubTab::setBanCount(U32 ban_count)
+{
+ LLStringUtil::format_map_t args;
+ args["[COUNT]"] = llformat("%d", ban_count);
+ args["[LIMIT]"] = llformat("%d", GB_MAX_BANNED_AGENTS);
+ mBanCountText->setText(getString("ban_count_template", args));
+}
+
+void LLPanelGroupBanListSubTab::populateBanList()
+{
+ LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
+ if(!gdatap)
+ {
+ LL_WARNS("Groups") << "Unable to get group data for group " << mGroupID << LL_ENDL;
+ return;
+ }
+
+ mBanList->deleteAllItems();
+ std::map<LLUUID,LLGroupBanData>::const_iterator entry = gdatap->mBanList.begin();
+ for(; entry != gdatap->mBanList.end(); entry++)
+ {
+ LLNameListCtrl::NameItem ban_entry;
+ ban_entry.value = entry->first;
+ LLGroupBanData bd = entry->second;
+
+ ban_entry.columns.add().column("name").font.name("SANSSERIF_SMALL").style("NORMAL");
+
+ // Baker TODO: MAINT-
+ // Check out utc_to_pacific_time()
+
+ std::string ban_date_str = bd.mBanDate.toHTTPDateString("%Y/%m/%d");
+// time_t utc_time;
+// utc_time = time_corrected();
+// LLSD substitution;
+// substitution["datetime"] = (S32) utc_time;
+// LLStringUtil::format (ban_date_str, substitution);
+
+ //LL_INFOS("BAKER") << "[BAKER] BAN_DATE: " << bd.mBanDate.toHTTPDateString("%Y/%m/%d") << LL_ENDL;
+ //LL_INFOS("BAKER") << "[BAKER] BAN_DATE_MODIFIED: " << ban_date_str << LL_ENDL;
+
+ //ban_entry.columns.add().column("ban_date").value(ban_date_str.font.name("SANSSERIF_SMALL").style("NORMAL");
+ ban_entry.columns.add().column("ban_date").value(bd.mBanDate.toHTTPDateString("%Y/%m/%d")).font.name("SANSSERIF_SMALL").style("NORMAL");
+
+ mBanList->addNameItemRow(ban_entry);
+ }
+
+ mRefreshBanListButton->setEnabled(TRUE);
+ mCreateBanButton->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_GROUP_BAN_ACCESS) &&
+ gdatap->mBanList.size() < GB_MAX_BANNED_AGENTS);
+ setBanCount(gdatap->mBanList.size());
+}
+
+void LLPanelGroupBanListSubTab::setGroupID(const LLUUID& id)
+{
+ if(mBanList)
+ mBanList->deleteAllItems();
+
+ setFooterEnabled(FALSE);
+ LLPanelGroupSubTab::setGroupID(id);
+}
diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h
index 0cf272f3ee..540b24ada6 100755
--- a/indra/newview/llpanelgrouproles.h
+++ b/indra/newview/llpanelgrouproles.h
@@ -39,11 +39,9 @@ class LLScrollListCtrl;
class LLScrollListItem;
class LLTextEditor;
-// Forward declare for friend usage.
-//virtual BOOL LLPanelGroupSubTab::postBuildSubTab(LLView*);
-
typedef std::map<std::string,std::string> icon_map_t;
+
class LLPanelGroupRoles : public LLPanelGroupTab
{
public:
@@ -92,6 +90,7 @@ protected:
std::string mWantApplyMesg;
};
+
class LLPanelGroupSubTab : public LLPanelGroupTab
{
public:
@@ -143,10 +142,14 @@ protected:
icon_map_t mActionIcons;
bool mActivated;
-
+
+ bool mHasGroupBanPower; // Used to communicate between action sets due to the dependency between
+ // GP_GROUP_BAN_ACCESS and GP_EJECT_MEMBER and GP_ROLE_REMOVE_MEMBER
+
void setOthersVisible(BOOL b);
};
+
class LLPanelGroupMembersSubTab : public LLPanelGroupSubTab
{
public:
@@ -173,6 +176,10 @@ public:
void handleRoleCheck(const LLUUID& role_id,
LLRoleMemberChangeType type);
+ static void onBanMember(void* user_data);
+ void handleBanMember();
+
+
void applyMemberChanges();
bool addOwnerCB(const LLSD& notification, const LLSD& response);
@@ -189,7 +196,7 @@ public:
virtual void setGroupID(const LLUUID& id);
void addMemberToList(LLGroupMemberData* data);
- void onNameCache(const LLUUID& update_id, LLGroupMemberData* member, const LLAvatarName& av_name);
+ void onNameCache(const LLUUID& update_id, LLGroupMemberData* member, const LLAvatarName& av_name, const LLUUID& av_id);
protected:
typedef std::map<LLUUID, LLRoleMemberChangeType> role_change_data_map_t;
@@ -206,6 +213,7 @@ protected:
LLScrollListCtrl* mAssignedRolesList;
LLScrollListCtrl* mAllowedActionsList;
LLButton* mEjectBtn;
+ LLButton* mBanBtn;
BOOL mChanged;
BOOL mPendingMemberUpdate;
@@ -215,9 +223,11 @@ protected:
U32 mNumOwnerAdditions;
LLGroupMgrGroupData::member_list_t::iterator mMemberProgress;
- boost::signals2::connection mAvatarNameCacheConnection;
+ typedef std::map<LLUUID, boost::signals2::connection> avatar_name_cache_connection_map_t;
+ avatar_name_cache_connection_map_t mAvatarNameCacheConnections;
};
+
class LLPanelGroupRolesSubTab : public LLPanelGroupSubTab
{
public:
@@ -240,7 +250,7 @@ public:
static void onActionCheck(LLUICtrl*, void*);
bool addActionCB(const LLSD& notification, const LLSD& response, LLCheckBoxCtrl* check);
-
+
static void onPropertiesKey(LLLineEditor*, void*);
void onDescriptionKeyStroke(LLTextEditor* caller);
@@ -259,6 +269,9 @@ public:
void saveRoleChanges(bool select_saved_role);
virtual void setGroupID(const LLUUID& id);
+
+ BOOL mFirstOpen;
+
protected:
void handleActionCheck(LLUICtrl* ctrl, bool force);
LLSD createRoleItem(const LLUUID& role_id, std::string name, std::string title, S32 members);
@@ -280,6 +293,7 @@ protected:
std::string mRemoveEveryoneTxt;
};
+
class LLPanelGroupActionsSubTab : public LLPanelGroupSubTab
{
public:
@@ -307,4 +321,46 @@ protected:
};
+class LLPanelGroupBanListSubTab : public LLPanelGroupSubTab
+{
+public:
+ LLPanelGroupBanListSubTab();
+ virtual ~LLPanelGroupBanListSubTab() {}
+
+ virtual BOOL postBuildSubTab(LLView* root);
+
+ virtual void activate();
+ virtual void update(LLGroupChange gc);
+ virtual void draw();
+
+ static void onBanEntrySelect(LLUICtrl* ctrl, void* user_data);
+ void handleBanEntrySelect();
+
+ static void onCreateBanEntry(void* user_data);
+ void handleCreateBanEntry();
+
+ static void onDeleteBanEntry(void* user_data);
+ void handleDeleteBanEntry();
+
+ static void onRefreshBanList(void* user_data);
+ void handleRefreshBanList();
+
+ void onBanListCompleted(bool isComplete);
+
+protected:
+ void setBanCount(U32 ban_count);
+ void populateBanList();
+
+public:
+ virtual void setGroupID(const LLUUID& id);
+
+protected:
+ LLNameListCtrl* mBanList;
+ LLButton* mCreateBanButton;
+ LLButton* mDeleteBanButton;
+ LLButton* mRefreshBanListButton;
+ LLTextBase* mBanCountText;
+
+};
+
#endif // LL_LLPANELGROUPROLES_H
diff --git a/indra/newview/llpanelland.cpp b/indra/newview/llpanelland.cpp
index 5321ebc777..acdb16f432 100755
--- a/indra/newview/llpanelland.cpp
+++ b/indra/newview/llpanelland.cpp
@@ -145,7 +145,7 @@ void LLPanelLandInfo::refresh()
&& ((gAgent.getID() == auth_buyer_id)
|| (auth_buyer_id.isNull())));
- if (is_public)
+ if (is_public && !LLViewerParcelMgr::getInstance()->getParcelSelection()->getMultipleOwners())
{
getChildView("button buy land")->setEnabled(TRUE);
}
@@ -187,7 +187,7 @@ void LLPanelLandInfo::refresh()
}
else
{
- lldebugs << "Invalid selection for joining land" << llendl;
+ LL_DEBUGS() << "Invalid selection for joining land" << LL_ENDL;
getChildView("button join land")->setEnabled(FALSE);
}
diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp
index 934f8ed8c7..63ddc05037 100755
--- a/indra/newview/llpanellandmarkinfo.cpp
+++ b/indra/newview/llpanellandmarkinfo.cpp
@@ -435,7 +435,7 @@ void LLPanelLandmarkInfo::populateFoldersList()
const LLViewerInventoryCategory* lmcat = gInventory.getCategory(landmarks_id);
if (!lmcat)
{
- llwarns << "Cannot find the landmarks folder" << llendl;
+ LL_WARNS() << "Cannot find the landmarks folder" << LL_ENDL;
}
else
{
@@ -446,9 +446,9 @@ void LLPanelLandmarkInfo::populateFoldersList()
typedef std::vector<folder_pair_t> folder_vec_t;
folder_vec_t folders;
// Sort the folders by their full name.
- for (S32 i = 0; i < cats.count(); i++)
+ for (S32 i = 0; i < cats.size(); i++)
{
- const LLViewerInventoryCategory* cat = cats.get(i);
+ const LLViewerInventoryCategory* cat = cats.at(i);
std::string cat_full_name = getFullFolderName(cat);
folders.push_back(folder_pair_t(cat->getUUID(), cat_full_name));
}
@@ -483,10 +483,10 @@ static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats)
LLViewerInventoryCategory* favorites_cat = gInventory.getCategory(favorites_id);
if (!favorites_cat)
{
- llwarns << "Cannot find the favorites folder" << llendl;
+ LL_WARNS() << "Cannot find the favorites folder" << LL_ENDL;
}
else
{
- cats.put(favorites_cat);
+ cats.push_back(favorites_cat);
}
}
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp
index 88400e4ef2..75a3584a1e 100755
--- a/indra/newview/llpanellandmarks.cpp
+++ b/indra/newview/llpanellandmarks.cpp
@@ -264,7 +264,7 @@ void LLLandmarksPanel::onShowOnMap()
{
if (NULL == mCurrentSelectedList)
{
- llwarns << "There are no selected list. No actions are performed." << llendl;
+ LL_WARNS() << "There are no selected list. No actions are performed." << LL_ENDL;
return;
}
@@ -421,7 +421,7 @@ bool LLLandmarksPanel::isReceivedFolderSelected() const
// *TODO: it should be filled with logic when EXT-976 is done.
- llwarns << "Not implemented yet until EXT-976 is done." << llendl;
+ LL_WARNS() << "Not implemented yet until EXT-976 is done." << LL_ENDL;
return false;
}
@@ -527,9 +527,9 @@ void LLLandmarksPanel::setParcelID(const LLUUID& parcel_id)
}
// virtual
-void LLLandmarksPanel::setErrorStatus(U32 status, const std::string& reason)
+void LLLandmarksPanel::setErrorStatus(S32 status, const std::string& reason)
{
- llwarns << "Can't handle remote parcel request."<< " Http Status: "<< status << ". Reason : "<< reason<<llendl;
+ LL_WARNS() << "Can't handle remote parcel request."<< " Http Status: "<< status << ". Reason : "<< reason<<LL_ENDL;
}
@@ -716,6 +716,11 @@ void LLLandmarksPanel::updateListCommands()
mListCommands->getChildView(TRASH_BUTTON_NAME)->setEnabled(trash_enabled);
}
+void LLLandmarksPanel::updateMenuVisibility(LLUICtrl* menu)
+{
+ onMenuVisibilityChange(menu, LLSD().with("visibility", true));
+}
+
void LLLandmarksPanel::onActionsButtonClick()
{
LLToggleableMenu* menu = mGearFolderMenu;
@@ -1042,7 +1047,7 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const
}
else
{
- llwarns << "Unprocessed command has come: " << command_name << llendl;
+ LL_WARNS() << "Unprocessed command has come: " << command_name << LL_ENDL;
}
return true;
@@ -1201,7 +1206,7 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold
}
else
{
- llwarns << "Unprocessed command has come: " << command_name << llendl;
+ LL_WARNS() << "Unprocessed command has come: " << command_name << LL_ENDL;
}
}
@@ -1258,6 +1263,7 @@ bool LLLandmarksPanel::handleDragAndDropToTrash(BOOL drop, EDragAndDropType carg
break;
}
+ updateVerbs();
return true;
}
@@ -1359,9 +1365,9 @@ void LLLandmarksPanel::doCreatePick(LLLandmark* landmark)
}
else
{
- llwarns << "Can't create pick for landmark for region" << region_id
+ LL_WARNS() << "Can't create pick for landmark for region" << region_id
<< ". Region: " << region->getName()
- << " does not support RemoteParcelRequest" << llendl;
+ << " does not support RemoteParcelRequest" << LL_ENDL;
}
}
diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h
index 8fae0f0b67..c11cbe05ae 100755
--- a/indra/newview/llpanellandmarks.h
+++ b/indra/newview/llpanellandmarks.h
@@ -80,6 +80,8 @@ public:
LLPlacesInventoryPanel* getLibraryInventoryPanel() { return mLibraryInventoryPanel; }
+ void updateMenuVisibility(LLUICtrl* menu);
+
protected:
/**
* @return true - if current selected panel is not null and selected item is a landmark
@@ -106,7 +108,7 @@ protected:
//LLRemoteParcelInfoObserver interface
/*virtual*/ void processParcelInfo(const LLParcelData& parcel_data);
/*virtual*/ void setParcelID(const LLUUID& parcel_id);
- /*virtual*/ void setErrorStatus(U32 status, const std::string& reason);
+ /*virtual*/ void setErrorStatus(S32 status, const std::string& reason);
private:
void initFavoritesInventoryPanel();
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 911ecaad9d..bbc3b85bf0 100755
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -33,7 +33,6 @@
#include "llfloaterreg.h"
#include "llfontgl.h"
#include "llmd5.h"
-#include "llsecondlifeurls.h"
#include "v4color.h"
#include "llappviewer.h"
@@ -82,20 +81,86 @@ const S32 MAX_PASSWORD = 16;
LLPanelLogin *LLPanelLogin::sInstance = NULL;
BOOL LLPanelLogin::sCapslockDidNotification = FALSE;
-class LLLoginRefreshHandler : public LLCommandHandler
+class LLLoginLocationAutoHandler : public LLCommandHandler
{
public:
// don't allow from external browsers
- LLLoginRefreshHandler() : LLCommandHandler("login_refresh", UNTRUSTED_BLOCK) { }
+ LLLoginLocationAutoHandler() : LLCommandHandler("location_login", UNTRUSTED_BLOCK) { }
bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web)
{
if (LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP)
{
- LLPanelLogin::loadLoginPage();
+ if ( tokens.size() == 0 || tokens.size() > 4 )
+ return false;
+
+ // unescape is important - uris with spaces are escaped in this code path
+ // (e.g. space -> %20) and the code to log into a region doesn't support that.
+ const std::string region = LLURI::unescape( tokens[0].asString() );
+
+ // just region name as payload
+ if ( tokens.size() == 1 )
+ {
+ // region name only - slurl will end up as center of region
+ LLSLURL slurl(region);
+ LLPanelLogin::autologinToLocation(slurl);
+ }
+ else
+ // region name and x coord as payload
+ if ( tokens.size() == 2 )
+ {
+ // invalid to only specify region and x coordinate
+ // slurl code will revert to same as region only, so do this anyway
+ LLSLURL slurl(region);
+ LLPanelLogin::autologinToLocation(slurl);
+ }
+ else
+ // region name and x/y coord as payload
+ if ( tokens.size() == 3 )
+ {
+ // region and x/y specified - default z to 0
+ F32 xpos;
+ std::istringstream codec(tokens[1].asString());
+ codec >> xpos;
+
+ F32 ypos;
+ codec.clear();
+ codec.str(tokens[2].asString());
+ codec >> ypos;
+
+ const LLVector3 location(xpos, ypos, 0.0f);
+ LLSLURL slurl(region, location);
+
+ LLPanelLogin::autologinToLocation(slurl);
+ }
+ else
+ // region name and x/y/z coord as payload
+ if ( tokens.size() == 4 )
+ {
+ // region and x/y/z specified - ok
+ F32 xpos;
+ std::istringstream codec(tokens[1].asString());
+ codec >> xpos;
+
+ F32 ypos;
+ codec.clear();
+ codec.str(tokens[2].asString());
+ codec >> ypos;
+
+ F32 zpos;
+ codec.clear();
+ codec.str(tokens[3].asString());
+ codec >> zpos;
+
+ const LLVector3 location(xpos, ypos, zpos);
+ LLSLURL slurl(region, location);
+
+ LLPanelLogin::autologinToLocation(slurl);
+ };
}
return true;
}
};
+LLLoginLocationAutoHandler gLoginLocationAutoHandler;
//---------------------------------------------------------------------------
// Public methods
@@ -104,24 +169,18 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
void (*callback)(S32 option, void* user_data),
void *cb_data)
: LLPanel(),
- mLogoImage(),
mCallback(callback),
mCallbackData(cb_data),
- mListener(new LLPanelLoginListener(this))
+ mListener(new LLPanelLoginListener(this)),
+ mUsernameLength(0),
+ mPasswordLength(0),
+ mLocationLength(0),
+ mFavoriteSelected(false),
+ mShowFavorites(false)
{
setBackgroundVisible(FALSE);
setBackgroundOpaque(TRUE);
- // instance management
- if (LLPanelLogin::sInstance)
- {
- LL_WARNS("AppInit") << "Duplicate instance of login view deleted" << LL_ENDL;
- // Don't leave bad pointer in gFocusMgr
- gFocusMgr.setDefaultKeyboardFocus(NULL);
-
- delete LLPanelLogin::sInstance;
- }
-
mPasswordModified = FALSE;
LLPanelLogin::sInstance = this;
@@ -131,28 +190,37 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
login_holder->addChild(this);
}
- // Logo
- mLogoImage = LLUI::getUIImage("startup_logo");
-
+ if (gSavedSettings.getBOOL("FirstLoginThisInstall"))
+ {
+ buildFromFile( "panel_login_first.xml");
+ }
+ else
+ {
buildFromFile( "panel_login.xml");
+ }
reshape(rect.getWidth(), rect.getHeight());
LLLineEditor* password_edit(getChild<LLLineEditor>("password_edit"));
password_edit->setKeystrokeCallback(onPassKey, this);
// STEAM-14: When user presses Enter with this field in focus, initiate login
- password_edit->setCommitCallback(boost::bind(&LLPanelLogin::onClickConnect, this));
+ password_edit->setCommitCallback(boost::bind(&LLPanelLogin::onClickConnectLast, this));
// change z sort of clickable text to be behind buttons
sendChildToBack(getChildView("forgot_password_text"));
- LLComboBox* location_combo = getChild<LLComboBox>("start_location_combo");
+ LLComboBox* favorites_combo = getChild<LLComboBox>("start_location_combo");
updateLocationSelectorsVisibility(); // separate so that it can be called from preferences
- location_combo->setFocusLostCallback(boost::bind(&LLPanelLogin::onLocationSLURL, this));
+ favorites_combo->setFocusLostCallback(boost::bind(&LLPanelLogin::onLocationSLURL, this));
+ favorites_combo->setCommitCallback(boost::bind(&LLPanelLogin::onSelectFavorite, this));
LLComboBox* server_choice_combo = getChild<LLComboBox>("server_combo");
server_choice_combo->setCommitCallback(boost::bind(&LLPanelLogin::onSelectServer, this));
+ LLLineEditor* location_edit = sInstance->getChild<LLLineEditor>("location_edit");
+ location_edit->setKeystrokeCallback(boost::bind(&LLPanelLogin::onLocationEditChanged, this, _1), NULL);
+ location_edit->setCommitCallback(boost::bind(&LLPanelLogin::onClickConnectLocation, this));
+
// Load all of the grids, sorted, and then add a bar and the current grid at the top
server_choice_combo->removeall();
@@ -199,9 +267,12 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
LLPanelLogin::onUpdateStartSLURL(start_slurl); // updates grid if needed
}
- childSetAction("connect_btn", onClickConnect, this);
+ childSetAction("connect_btn", onClickConnectLast, this);
+ childSetAction("connect_favorite_btn", onClickConnectFavorite, this);
+ childSetAction("connect_location_btn", onClickConnectLocation, this);
- getChild<LLPanel>("links_login_panel")->setDefaultBtn("connect_btn");
+ LLButton* def_btn = getChild<LLButton>("connect_btn");
+ setDefaultBtn(def_btn);
std::string channel = LLVersionInfo::getChannel();
std::string version = llformat("%s (%d)",
@@ -211,8 +282,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
LLTextBox* forgot_password_text = getChild<LLTextBox>("forgot_password_text");
forgot_password_text->setClickedCallback(onClickForgotPassword, NULL);
- childSetAction("create_new_account_btn", onClickNewAccount, NULL);
-
LLTextBox* need_help_text = getChild<LLTextBox>("login_help");
need_help_text->setClickedCallback(onClickHelp, NULL);
@@ -220,8 +289,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html");
web_browser->addObserver(this);
- reshapeBrowser();
-
loadLoginPage();
// Show last logged in user favorites in "Start at" combo.
@@ -236,16 +303,23 @@ void LLPanelLogin::addUsersWithFavoritesToUsername()
{
LLComboBox* combo = getChild<LLComboBox>("username_combo");
if (!combo) return;
- std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
+ std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites_" + LLGridManager::getInstance()->getGrid() + ".xml");
+ std::string old_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
LLSD fav_llsd;
llifstream file;
file.open(filename);
- if (!file.is_open()) return;
+ if (!file.is_open())
+ {
+ file.open(old_filename);
+ if (!file.is_open()) return;
+ }
LLSDSerialize::fromXML(fav_llsd, file);
for (LLSD::map_const_iterator iter = fav_llsd.beginMap();
iter != fav_llsd.endMap(); ++iter)
{
combo->add(iter->first);
+ mUsernameLength = iter->first.length();
+ updateLoginButtons();
}
}
@@ -255,19 +329,29 @@ void LLPanelLogin::addFavoritesToStartLocation()
LLComboBox* combo = getChild<LLComboBox>("start_location_combo");
if (!combo) return;
int num_items = combo->getItemCount();
- for (int i = num_items - 1; i > 2; i--)
+ for (int i = num_items - 1; i > 0; i--)
{
combo->remove(i);
}
// Load favorites into the combo.
std::string user_defined_name = getChild<LLComboBox>("username_combo")->getSimple();
- std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
+ std::replace(user_defined_name.begin(), user_defined_name.end(), '.', ' ');
+ std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites_" + LLGridManager::getInstance()->getGrid() + ".xml");
+ std::string old_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
+ mUsernameLength = user_defined_name.length();
+ updateLoginButtons();
+
LLSD fav_llsd;
llifstream file;
file.open(filename);
- if (!file.is_open()) return;
+ if (!file.is_open())
+ {
+ file.open(old_filename);
+ if (!file.is_open()) return;
+ }
LLSDSerialize::fromXML(fav_llsd, file);
+
for (LLSD::map_const_iterator iter = fav_llsd.beginMap();
iter != fav_llsd.endMap(); ++iter)
{
@@ -277,12 +361,12 @@ void LLPanelLogin::addFavoritesToStartLocation()
S32 res = LLStringUtil::compareInsensitive(user_defined_name, iter->first);
if (res != 0)
{
- lldebugs << "Skipping favorites for " << iter->first << llendl;
+ LL_DEBUGS() << "Skipping favorites for " << iter->first << LL_ENDL;
continue;
}
combo->addSeparator();
- lldebugs << "Loading favorites for " << iter->first << llendl;
+ LL_DEBUGS() << "Loading favorites for " << iter->first << LL_ENDL;
LLSD user_llsd = iter->second;
for (LLSD::array_const_iterator iter1 = user_llsd.beginArray();
iter1 != user_llsd.endArray(); ++iter1)
@@ -291,6 +375,7 @@ void LLPanelLogin::addFavoritesToStartLocation()
std::string value = (*iter1)["slurl"].asString();
if(label != "" && value != "")
{
+ mShowFavorites = true;
combo->add(label, value);
}
}
@@ -298,21 +383,6 @@ void LLPanelLogin::addFavoritesToStartLocation()
}
}
-// force the size to be correct (XML doesn't seem to be sufficient to do this)
-// (with some padding so the other login screen doesn't show through)
-void LLPanelLogin::reshapeBrowser()
-{
- LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html");
- LLRect rect = gViewerWindow->getWindowRectScaled();
- LLRect html_rect;
- html_rect.setCenterAndSize(
- rect.getCenterX() - 2, rect.getCenterY() + 40,
- rect.getWidth() + 6, rect.getHeight() - 78 );
- web_browser->setRect( html_rect );
- web_browser->reshape( html_rect.getWidth(), html_rect.getHeight(), TRUE );
- reshape( rect.getWidth(), rect.getHeight(), 1 );
-}
-
LLPanelLogin::~LLPanelLogin()
{
LLPanelLogin::sInstance = NULL;
@@ -323,50 +393,6 @@ LLPanelLogin::~LLPanelLogin()
}
// virtual
-void LLPanelLogin::draw()
-{
- gGL.pushMatrix();
- {
- F32 image_aspect = 1.333333f;
- F32 view_aspect = (F32)getRect().getWidth() / (F32)getRect().getHeight();
- // stretch image to maintain aspect ratio
- if (image_aspect > view_aspect)
- {
- gGL.translatef(-0.5f * (image_aspect / view_aspect - 1.f) * getRect().getWidth(), 0.f, 0.f);
- gGL.scalef(image_aspect / view_aspect, 1.f, 1.f);
- }
-
- S32 width = getRect().getWidth();
- S32 height = getRect().getHeight();
-
- if (getChild<LLView>("login_widgets")->getVisible())
- {
- // draw a background box in black
- gl_rect_2d( 0, height - 264, width, 264, LLColor4::black );
- // draw the bottom part of the background image
- // just the blue background to the native client UI
- mLogoImage->draw(0, -264, width + 8, mLogoImage->getHeight());
- };
- }
- gGL.popMatrix();
-
- LLPanel::draw();
-}
-
-// virtual
-BOOL LLPanelLogin::handleKeyHere(KEY key, MASK mask)
-{
- if ( KEY_F1 == key )
- {
- LLViewerHelp* vhelp = LLViewerHelp::getInstance();
- vhelp->showTopic(vhelp->f1HelpTopic());
- return TRUE;
- }
-
- return LLPanel::handleKeyHere(key, mask);
-}
-
-// virtual
void LLPanelLogin::setFocus(BOOL b)
{
if(b != hasFocus())
@@ -429,7 +455,7 @@ void LLPanelLogin::showLoginWidgets()
// It seems to be part of the defunct? reg-in-client project.
sInstance->getChildView("login_widgets")->setVisible( true);
LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
- sInstance->reshapeBrowser();
+
// *TODO: Append all the usual login parameters, like first_login=Y etc.
std::string splash_screen_url = LLGridManager::getInstance()->getLoginPage();
web_browser->navigateTo( splash_screen_url, "text/html" );
@@ -443,6 +469,16 @@ void LLPanelLogin::show(const LLRect &rect,
void (*callback)(S32 option, void* user_data),
void* callback_data)
{
+ // instance management
+ if (LLPanelLogin::sInstance)
+ {
+ LL_WARNS("AppInit") << "Duplicate instance of login view deleted" << LL_ENDL;
+ // Don't leave bad pointer in gFocusMgr
+ gFocusMgr.setDefaultKeyboardFocus(NULL);
+
+ delete LLPanelLogin::sInstance;
+ }
+
new LLPanelLogin(rect, callback, callback_data);
if( !gFocusMgr.getKeyboardFocus() )
@@ -461,7 +497,7 @@ void LLPanelLogin::setFields(LLPointer<LLCredential> credential,
{
if (!sInstance)
{
- llwarns << "Attempted fillFields with no login view shown" << llendl;
+ LL_WARNS() << "Attempted fillFields with no login view shown" << LL_ENDL;
return;
}
LL_INFOS("Credentials") << "Setting login fields to " << *credential << LL_ENDL;
@@ -501,9 +537,11 @@ void LLPanelLogin::setFields(LLPointer<LLCredential> credential,
// This is a MD5 hex digest of a password.
// We don't actually use the password input field,
// fill it with MAX_PASSWORD characters so we get a
- // nice row of asterixes.
+ // nice row of asterisks.
const std::string filler("123456789!123456");
- sInstance->getChild<LLUICtrl>("password_edit")->setValue(std::string("123456789!123456"));
+ sInstance->getChild<LLUICtrl>("password_edit")->setValue(filler);
+ sInstance->mPasswordLength = filler.length();
+ sInstance->updateLoginButtons();
}
else
{
@@ -519,7 +557,7 @@ void LLPanelLogin::getFields(LLPointer<LLCredential>& credential,
{
if (!sInstance)
{
- llwarns << "Attempted getFields with no login view shown" << llendl;
+ LL_WARNS() << "Attempted getFields with no login view shown" << LL_ENDL;
return;
}
@@ -540,13 +578,13 @@ void LLPanelLogin::getFields(LLPointer<LLCredential>& credential,
LLStringUtil::trim(username);
std::string password = sInstance->getChild<LLUICtrl>("password_edit")->getValue().asString();
- LL_INFOS2("Credentials", "Authentication") << "retrieving username:" << username << LL_ENDL;
+ LL_INFOS("Credentials", "Authentication") << "retrieving username:" << username << LL_ENDL;
// determine if the username is a first/last form or not.
size_t separator_index = username.find_first_of(' ');
if (separator_index == username.npos
&& !LLGridManager::getInstance()->isSystemGrid())
{
- LL_INFOS2("Credentials", "Authentication") << "account: " << username << LL_ENDL;
+ LL_INFOS("Credentials", "Authentication") << "account: " << username << LL_ENDL;
// single username, so this is a 'clear' identifier
identifier["type"] = CRED_IDENTIFIER_TYPE_ACCOUNT;
identifier["account_name"] = username;
@@ -581,7 +619,7 @@ void LLPanelLogin::getFields(LLPointer<LLCredential>& credential,
if (last.find_first_of(' ') == last.npos)
{
- LL_INFOS2("Credentials", "Authentication") << "agent: " << username << LL_ENDL;
+ LL_INFOS("Credentials", "Authentication") << "agent: " << username << LL_ENDL;
// traditional firstname / lastname
identifier["type"] = CRED_IDENTIFIER_TYPE_AGENT;
identifier["first_name"] = first;
@@ -609,7 +647,7 @@ BOOL LLPanelLogin::areCredentialFieldsDirty()
{
if (!sInstance)
{
- llwarns << "Attempted getServer with no login view shown" << llendl;
+ LL_WARNS() << "Attempted getServer with no login view shown" << LL_ENDL;
}
else
{
@@ -636,11 +674,12 @@ void LLPanelLogin::updateLocationSelectorsVisibility()
{
if (sInstance)
{
- BOOL show_start = gSavedSettings.getBOOL("ShowStartLocation");
- sInstance->getChild<LLLayoutPanel>("start_location_panel")->setVisible(show_start);
-
BOOL show_server = gSavedSettings.getBOOL("ForceShowGrid");
- sInstance->getChild<LLLayoutPanel>("grid_panel")->setVisible(show_server);
+ LLComboBox* server_combo = sInstance->getChild<LLComboBox>("server_combo");
+ if ( server_combo )
+ {
+ server_combo->setVisible(show_server);
+ }
}
}
@@ -652,6 +691,7 @@ void LLPanelLogin::onUpdateStartSLURL(const LLSLURL& new_start_slurl)
LL_DEBUGS("AppInit")<<new_start_slurl.asString()<<LL_ENDL;
LLComboBox* location_combo = sInstance->getChild<LLComboBox>("start_location_combo");
+ LLLineEditor* location_edit = sInstance->getChild<LLLineEditor>("location_edit");
/*
* Determine whether or not the new_start_slurl modifies the grid.
*
@@ -681,7 +721,12 @@ void LLPanelLogin::onUpdateStartSLURL(const LLSLURL& new_start_slurl)
updateServer(); // to change the links and splash screen
}
- location_combo->setTextEntry(new_start_slurl.getLocationString());
+ if ( new_start_slurl.getLocationString().length() )
+ {
+ location_edit->setValue(new_start_slurl.getLocationString());
+ sInstance->mLocationLength = new_start_slurl.getLocationString().length();
+ sInstance->updateLoginButtons();
+ }
}
else
{
@@ -694,16 +739,12 @@ void LLPanelLogin::onUpdateStartSLURL(const LLSLURL& new_start_slurl)
break;
case LLSLURL::HOME_LOCATION:
- location_combo->setCurrentByIndex(1); // home location
- break;
-
- case LLSLURL::LAST_LOCATION:
- location_combo->setCurrentByIndex(0); // last location
+ //location_combo->setCurrentByIndex(0); // home location
break;
default:
LL_WARNS("AppInit")<<"invalid login slurl, using home"<<LL_ENDL;
- location_combo->setCurrentByIndex(1); // home location
+ //location_combo->setCurrentByIndex(0); // home location
break;
}
}
@@ -714,6 +755,19 @@ void LLPanelLogin::setLocation(const LLSLURL& slurl)
LLStartUp::setStartSLURL(slurl); // calls onUpdateStartSLURL, above
}
+void LLPanelLogin::autologinToLocation(const LLSLURL& slurl)
+{
+ LL_DEBUGS("AppInit")<<"automatically logging into Location "<<slurl.asString()<<LL_ENDL;
+ LLStartUp::setStartSLURL(slurl); // calls onUpdateStartSLURL, above
+
+ if ( LLPanelLogin::sInstance != NULL )
+ {
+ void* unused_parameter = 0;
+ LLPanelLogin::sInstance->onClickConnect(unused_parameter);
+ }
+}
+
+
// static
void LLPanelLogin::closePanel()
{
@@ -751,6 +805,13 @@ void LLPanelLogin::loadLoginPage()
LL_DEBUGS("AppInit") << "login_page: " << login_page << LL_ENDL;
+ // allow users (testers really) to specify a different login content URL
+ std::string force_login_url = gSavedSettings.getString("ForceLoginURL");
+ if ( force_login_url.length() > 0 )
+ {
+ login_page = LLURI(force_login_url);
+ }
+
// Language
params["lang"] = LLUI::getLanguage();
@@ -775,6 +836,9 @@ void LLPanelLogin::loadLoginPage()
// sourceid
params["sourceid"] = gSavedSettings.getString("sourceid");
+ // login page (web) content version
+ params["login_content_version"] = gSavedSettings.getString("LoginContentVersion");
+
// Make an LLURI with this augmented info
LLURI login_uri(LLURI::buildHTTP(login_page.authority(),
login_page.path(),
@@ -797,6 +861,32 @@ void LLPanelLogin::handleMediaEvent(LLPluginClassMedia* /*self*/, EMediaEvent ev
//---------------------------------------------------------------------------
// Protected methods
//---------------------------------------------------------------------------
+// static
+void LLPanelLogin::onClickConnectLast(void *)
+{
+ std::string location = LLSLURL::SIM_LOCATION_LAST;
+ LLStartUp::setStartSLURL(location);
+
+ void* unused_parameter = 0;
+ LLPanelLogin::sInstance->onClickConnect(unused_parameter);
+}
+
+void LLPanelLogin::onClickConnectFavorite(void *)
+{
+ LLPanelLogin::sInstance->onLocationSLURL();
+
+ void* unused_parameter = 0;
+ LLPanelLogin::sInstance->onClickConnect(unused_parameter);
+}
+
+void LLPanelLogin::onClickConnectLocation(void *)
+{
+ std::string location = sInstance->getChild<LLUICtrl>("location_edit")->getValue().asString();
+ LLStartUp::setStartSLURL(location);
+
+ void* unused_parameter = 0;
+ LLPanelLogin::sInstance->onClickConnect(unused_parameter);
+}
// static
void LLPanelLogin::onClickConnect(void *)
@@ -866,16 +956,6 @@ void LLPanelLogin::onClickConnect(void *)
}
// static
-void LLPanelLogin::onClickNewAccount(void*)
-{
- if (sInstance)
- {
- LLWeb::loadURLExternal(LLTrans::getString("create_account_url"));
- }
-}
-
-
-// static
void LLPanelLogin::onClickVersion(void*)
{
LLFloaterReg::showInstance("sl_about");
@@ -903,13 +983,17 @@ void LLPanelLogin::onClickHelp(void*)
// static
void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data)
{
- LLPanelLogin *This = (LLPanelLogin *) user_data;
- This->mPasswordModified = TRUE;
+ LLPanelLogin *self = (LLPanelLogin *)user_data;
+ self->mPasswordModified = TRUE;
if (gKeyboard->getKeyDown(KEY_CAPSLOCK) && sCapslockDidNotification == FALSE)
{
// *TODO: use another way to notify user about enabled caps lock, see EXT-6858
sCapslockDidNotification = TRUE;
}
+
+ LLLineEditor* password_edit(self->getChild<LLLineEditor>("password_edit"));
+ self->mPasswordLength = password_edit->getText().length();
+ self->updateLoginButtons();
}
@@ -950,16 +1034,75 @@ void LLPanelLogin::updateServer()
}
}
+void LLPanelLogin::updateLoginButtons()
+{
+ LLButton* last_login_btn = getChild<LLButton>("connect_btn");
+ LLButton* loc_btn = getChild<LLButton>("connect_location_btn");
+ LLButton* fav_btn = getChild<LLButton>("connect_favorite_btn");
+
+ // no username or no password - turn all buttons off
+ if ( mUsernameLength == 0 || mPasswordLength == 0 )
+ {
+ last_login_btn->setEnabled(false);
+ loc_btn->setEnabled(false);
+ fav_btn->setEnabled(false);
+ };
+
+ // we have a username and a password
+ if ( mUsernameLength != 0 && mPasswordLength != 0 )
+ {
+ // last login button always enabled for this case
+ last_login_btn->setEnabled(true);
+
+ // double check status of favorites combo (must be items there and one must be selected to enable button)
+ LLComboBox* favorites_combo = getChild<LLComboBox>("start_location_combo");
+ int num_items = favorites_combo->getItemCount();
+ int selected_index = favorites_combo->getCurrentIndex();
+ if ( num_items > 0 && selected_index >=0 )
+ mFavoriteSelected = true;
+ else
+ mFavoriteSelected = false;
+
+ // only turn on favorites login button if one is selected
+ fav_btn->setEnabled( mFavoriteSelected );
+
+ // only enable location login if there is content there
+ if ( mLocationLength > 0 )
+ loc_btn->setEnabled(true);
+ else
+ loc_btn->setEnabled(false);
+ }
+}
+
+void LLPanelLogin::onLocationEditChanged(LLUICtrl* ctrl)
+{
+ LLLineEditor* self = (LLLineEditor*)ctrl;
+ if (self )
+ {
+ mLocationLength = self->getText().length();
+ updateLoginButtons();
+ }
+}
+
+void LLPanelLogin::onSelectFavorite()
+{
+ // no way to unselect a favorite once it's selected (i think)
+ mFavoriteSelected = true;
+
+ updateLoginButtons();
+}
+
void LLPanelLogin::onSelectServer()
{
// The user twiddled with the grid choice ui.
// apply the selection to the grid setting.
LLPointer<LLCredential> credential;
-
+
LLComboBox* server_combo = getChild<LLComboBox>("server_combo");
LLSD server_combo_val = server_combo->getSelectedValue();
LL_INFOS("AppInit") << "grid "<<server_combo_val.asString()<< LL_ENDL;
LLGridManager::getInstance()->setGridChoice(server_combo_val.asString());
+ addFavoritesToStartLocation();
/*
* Determine whether or not the value in the start_location_combo makes sense
@@ -991,6 +1134,7 @@ void LLPanelLogin::onSelectServer()
// the grid specified by the location is not this one, so clear the combo
location_combo->setCurrentByIndex(0); // last location on the new grid
location_combo->setTextEntry(LLStringUtil::null);
+ mFavoriteSelected = true;
}
}
break;
@@ -1007,3 +1151,9 @@ void LLPanelLogin::onLocationSLURL()
LLStartUp::setStartSLURL(location); // calls onUpdateStartSLURL, above
}
+
+// static
+bool LLPanelLogin::getShowFavorites()
+{
+ return gSavedPerAccountSettings.getBOOL("ShowFavoritesOnLogin");
+}
diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h
index c71cfc3783..aa63ffabfc 100755
--- a/indra/newview/llpanellogin.h
+++ b/indra/newview/llpanellogin.h
@@ -49,14 +49,8 @@ public:
void *callback_data);
~LLPanelLogin();
- virtual BOOL handleKeyHere(KEY key, MASK mask);
- virtual void draw();
virtual void setFocus( BOOL b );
- // Show the XUI first name, last name, and password widgets. They are
- // hidden on startup for reg-in-client
- static void showLoginWidgets();
-
static void show(const LLRect &rect,
void (*callback)(S32 option, void* user_data),
void* callback_data);
@@ -67,6 +61,7 @@ public:
static BOOL areCredentialFieldsDirty();
static void setLocation(const LLSLURL& slurl);
+ static void autologinToLocation(const LLSLURL& slurl);
/// Call when preferences that control visibility may have changed
static void updateLocationSelectorsVisibility();
@@ -75,6 +70,8 @@ public:
void setSiteIsAlive( bool alive );
+ void showLoginWidgets();
+
static void loadLoginPage();
static void giveFocus();
static void setAlwaysRefresh(bool refresh);
@@ -86,14 +83,21 @@ public:
/// to be called from LLStartUp::setStartSLURL
static void onUpdateStartSLURL(const LLSLURL& new_start_slurl);
+ // called from prefs when initializing panel
+ static bool getShowFavorites();
+
private:
friend class LLPanelLoginListener;
- void reshapeBrowser();
void addFavoritesToStartLocation();
void addUsersWithFavoritesToUsername();
+ void onLocationEditChanged(LLUICtrl* ctrl);
+ void onSelectFavorite();
void onSelectServer();
void onLocationSLURL();
+ static void onClickConnectLast(void*);
+ static void onClickConnectFavorite(void*);
+ static void onClickConnectLocation(void*);
static void onClickConnect(void*);
static void onClickNewAccount(void*);
static void onClickVersion(void*);
@@ -103,16 +107,23 @@ private:
static void updateServerCombo();
private:
- LLPointer<LLUIImage> mLogoImage;
boost::scoped_ptr<LLPanelLoginListener> mListener;
+ void updateLoginButtons();
+
void (*mCallback)(S32 option, void *userdata);
void* mCallbackData;
BOOL mPasswordModified;
+ bool mShowFavorites;
static LLPanelLogin* sInstance;
static BOOL sCapslockDidNotification;
+ bool mFirstLoginThisInstall;
+ bool mFavoriteSelected;
+ unsigned int mUsernameLength;
+ unsigned int mPasswordLength;
+ unsigned int mLocationLength;
};
#endif
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 68c22c12fd..a7c9dbdf7b 100755
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -55,6 +55,7 @@
#include "llviewertexturelist.h"
#include "llsidepanelinventory.h"
#include "llfolderview.h"
+#include "llradiogroup.h"
const std::string FILTERS_FILENAME("filters.xml");
@@ -82,6 +83,7 @@ public:
void updateElementsFromFilter();
BOOL getCheckShowEmpty();
BOOL getCheckSinceLogoff();
+ U32 getDateSearchDirection();
static void onTimeAgo(LLUICtrl*, void *);
static void onCloseBtn(void* user_data);
@@ -158,7 +160,7 @@ BOOL LLPanelMainInventory::postBuild()
// Now load the stored settings from disk, if available.
std::ostringstream filterSaveName;
filterSaveName << gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, FILTERS_FILENAME);
- llinfos << "LLPanelMainInventory::init: reading from " << filterSaveName.str() << llendl;
+ LL_INFOS() << "LLPanelMainInventory::init: reading from " << filterSaveName.str() << LL_ENDL;
llifstream file(filterSaveName.str());
LLSD savedFilterState;
if (file.is_open())
@@ -244,7 +246,7 @@ LLPanelMainInventory::~LLPanelMainInventory( void )
llofstream filtersFile(filterSaveName.str());
if(!LLSDSerialize::toPrettyXML(filterRoot, filtersFile))
{
- llwarns << "Could not write to filters save file " << filterSaveName << llendl;
+ LL_WARNS() << "Could not write to filters save file " << filterSaveName << LL_ENDL;
}
else
filtersFile.close();
@@ -382,9 +384,11 @@ BOOL LLPanelMainInventory::filtersVisible(void* user_data)
void LLPanelMainInventory::onClearSearch()
{
+ BOOL initially_active = FALSE;
LLFloater *finder = getFinder();
if (mActivePanel)
{
+ initially_active = mActivePanel->getFilter().isNotDefault();
mActivePanel->setFilterSubString(LLStringUtil::null);
mActivePanel->setFilterTypes(0xffffffffffffffffULL);
mActivePanel->setFilterLinks(LLInventoryFilter::FILTERLINK_INCLUDE_LINKS);
@@ -395,8 +399,8 @@ void LLPanelMainInventory::onClearSearch()
LLFloaterInventoryFinder::selectAllTypes(finder);
}
- // re-open folders that were initially open
- if (mActivePanel)
+ // re-open folders that were initially open in case filter was active
+ if (mActivePanel && (mFilterSubString.size() || initially_active))
{
mSavedFolderState->setApply(TRUE);
mActivePanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
@@ -609,7 +613,7 @@ void LLPanelMainInventory::onFocusReceived()
LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
if (!sidepanel_inventory)
{
- llwarns << "Could not find Inventory Panel in My Inventory floater" << llendl;
+ LL_WARNS() << "Could not find Inventory Panel in My Inventory floater" << LL_ENDL;
return;
}
@@ -700,6 +704,30 @@ void LLFloaterInventoryFinder::onTimeAgo(LLUICtrl *ctrl, void *user_data)
if ( self->mSpinSinceDays->get() || self->mSpinSinceHours->get() )
{
self->getChild<LLUICtrl>("check_since_logoff")->setValue(false);
+
+ U32 days = (U32)self->mSpinSinceDays->get();
+ U32 hours = (U32)self->mSpinSinceHours->get();
+ if (hours >= 24)
+ {
+ // Try to handle both cases of spinner clicking and text input in a sensible fashion as best as possible.
+ // There is no way to tell if someone has clicked the spinner to get to 24 or input 24 manually, so in
+ // this case add to days. Any value > 24 means they have input the hours manually, so do not add to the
+ // current day value.
+ if (24 == hours) // Got to 24 via spinner clicking or text input of 24
+ {
+ days = days + hours / 24;
+ }
+ else // Text input, so do not add to days
+ {
+ days = hours / 24;
+ }
+ hours = (U32)hours % 24;
+ self->mSpinSinceHours->setFocus(false);
+ self->mSpinSinceDays->setFocus(false);
+ self->mSpinSinceDays->set((F32)days);
+ self->mSpinSinceHours->set((F32)hours);
+ self->mSpinSinceHours->setFocus(true);
+ }
}
}
@@ -719,6 +747,7 @@ void LLFloaterInventoryFinder::updateElementsFromFilter()
std::string filter_string = mFilter->getFilterSubString();
LLInventoryFilter::EFolderShow show_folders = mFilter->getShowFolderState();
U32 hours = mFilter->getHoursAgo();
+ U32 date_search_direction = mFilter->getDateSearchDirection();
// update the ui elements
setTitle(mFilter->getName());
@@ -740,6 +769,7 @@ void LLFloaterInventoryFinder::updateElementsFromFilter()
getChild<LLUICtrl>("check_since_logoff")->setValue(mFilter->isSinceLogoff());
mSpinSinceHours->set((F32)(hours % 24));
mSpinSinceDays->set((F32)(hours / 24));
+ getChild<LLRadioGroup>("date_search_direction")->setSelectedIndex(date_search_direction);
}
void LLFloaterInventoryFinder::draw()
@@ -840,17 +870,23 @@ void LLFloaterInventoryFinder::draw()
}
U32 days = (U32)mSpinSinceDays->get();
U32 hours = (U32)mSpinSinceHours->get();
- if (hours > 24)
+ if (hours >= 24)
{
- days += hours / 24;
+ days = hours / 24;
hours = (U32)hours % 24;
+ // A UI element that has focus will not display a new value set to it
+ mSpinSinceHours->setFocus(false);
+ mSpinSinceDays->setFocus(false);
mSpinSinceDays->set((F32)days);
mSpinSinceHours->set((F32)hours);
+ mSpinSinceHours->setFocus(true);
}
hours += days * 24;
+
mPanelMainInventory->getPanel()->setHoursAgo(hours);
mPanelMainInventory->getPanel()->setSinceLogoff(getCheckSinceLogoff());
mPanelMainInventory->setFilterTextFromFilter();
+ mPanelMainInventory->getPanel()->setDateSearchDirection(getDateSearchDirection());
LLPanel::draw();
}
@@ -865,6 +901,11 @@ BOOL LLFloaterInventoryFinder::getCheckSinceLogoff()
return getChild<LLUICtrl>("check_since_logoff")->getValue();
}
+U32 LLFloaterInventoryFinder::getDateSearchDirection()
+{
+ return getChild<LLRadioGroup>("date_search_direction")->getSelectedIndex();
+}
+
void LLFloaterInventoryFinder::onCloseBtn(void* user_data)
{
LLFloaterInventoryFinder* finderp = (LLFloaterInventoryFinder*)user_data;
diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp
index da938712d7..f7c2f629ec 100755
--- a/indra/newview/llpanelmarketplaceinboxinventory.cpp
+++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp
@@ -129,11 +129,11 @@ void LLInboxFolderViewFolder::addItem(LLFolderViewItem* item)
// virtual
void LLInboxFolderViewFolder::draw()
{
- if (!badgeHasParent())
+ if (!hasBadgeHolderParent())
{
- addBadgeToParentPanel();
+ addBadgeToParentHolder();
}
-
+
setBadgeVisibility(mFresh);
LLFolderViewFolder::draw();
@@ -164,7 +164,7 @@ void LLInboxFolderViewFolder::computeFreshness()
#if DEBUGGING_FRESHNESS
if (mFresh)
{
- llinfos << "Item is fresh! -- creation " << mCreationDate << ", saved_freshness_date " << last_expansion_utc << llendl;
+ LL_INFOS() << "Item is fresh! -- creation " << mCreationDate << ", saved_freshness_date " << last_expansion_utc << LL_ENDL;
}
#endif
}
@@ -214,9 +214,9 @@ BOOL LLInboxFolderViewItem::handleDoubleClick(S32 x, S32 y, MASK mask)
// virtual
void LLInboxFolderViewItem::draw()
{
- if (!badgeHasParent())
+ if (!hasBadgeHolderParent())
{
- addBadgeToParentPanel();
+ addBadgeToParentHolder();
}
setBadgeVisibility(mFresh);
@@ -242,7 +242,7 @@ void LLInboxFolderViewItem::computeFreshness()
#if DEBUGGING_FRESHNESS
if (mFresh)
{
- llinfos << "Item is fresh! -- creation " << mCreationDate << ", saved_freshness_date " << last_expansion_utc << llendl;
+ LL_INFOS() << "Item is fresh! -- creation " << mCreationDate << ", saved_freshness_date " << last_expansion_utc << LL_ENDL;
}
#endif
}
diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp
index 7a408e736f..cedd3025fc 100755
--- a/indra/newview/llpanelme.cpp
+++ b/indra/newview/llpanelme.cpp
@@ -30,7 +30,6 @@
// Viewer includes
#include "llpanelprofile.h"
-#include "llavatarconstants.h"
#include "llagent.h"
#include "llagentcamera.h"
#include "llagentwearables.h"
diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp
index a50d9074f7..1cdd1b664e 100755
--- a/indra/newview/llpanelnearbymedia.cpp
+++ b/indra/newview/llpanelnearbymedia.cpp
@@ -202,7 +202,7 @@ void LLPanelNearByMedia::onTopLost()
/*virtual*/
-void LLPanelNearByMedia::handleVisibilityChange ( BOOL new_visibility )
+void LLPanelNearByMedia::onVisibilityChange ( BOOL new_visibility )
{
if (new_visibility)
{
@@ -876,7 +876,10 @@ void LLPanelNearByMedia::onClickParcelAudioPlay()
// playing and updated as they cross to other parcels etc.
mParcelAudioAutoStart = true;
if (!gAudiop)
+ {
+ LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
return;
+ }
if (LLAudioEngine::AUDIO_PAUSED == gAudiop->isInternetStreamPlaying())
{
@@ -896,7 +899,10 @@ void LLPanelNearByMedia::onClickParcelAudioStop()
// they explicitly start it again.
mParcelAudioAutoStart = false;
if (!gAudiop)
+ {
+ LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
return;
+ }
LLViewerAudio::getInstance()->stopInternetStreamWithAutoFade();
}
@@ -904,7 +910,10 @@ void LLPanelNearByMedia::onClickParcelAudioStop()
void LLPanelNearByMedia::onClickParcelAudioPause()
{
if (!gAudiop)
+ {
+ LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
return;
+ }
// 'true' means pause
gAudiop->pauseInternetStream(true);
diff --git a/indra/newview/llpanelnearbymedia.h b/indra/newview/llpanelnearbymedia.h
index c3634de9b4..a9c1b190cf 100755
--- a/indra/newview/llpanelnearbymedia.h
+++ b/indra/newview/llpanelnearbymedia.h
@@ -48,7 +48,7 @@ public:
/*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask);
/*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask);
/*virtual*/ void onTopLost();
- /*virtual*/ void handleVisibilityChange ( BOOL new_visibility );
+ /*virtual*/ void onVisibilityChange ( BOOL new_visibility );
/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent);
/*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp
index 25ef9a3d6a..9123252f4c 100755
--- a/indra/newview/llpanelobject.cpp
+++ b/indra/newview/llpanelobject.cpp
@@ -625,7 +625,7 @@ void LLPanelObject::getState( )
}
else
{
- llinfos << "Unknown path " << (S32) path << " profile " << (S32) profile << " in getState" << llendl;
+ LL_INFOS() << "Unknown path " << (S32) path << " profile " << (S32) profile << " in getState" << LL_ENDL;
selected_item = MI_BOX;
}
@@ -1175,11 +1175,11 @@ void LLPanelObject::sendIsPhysical()
LLSelectMgr::getInstance()->selectionUpdatePhysics(value);
mIsPhysical = value;
- llinfos << "update physics sent" << llendl;
+ LL_INFOS() << "update physics sent" << LL_ENDL;
}
else
{
- llinfos << "update physics not changed" << llendl;
+ LL_INFOS() << "update physics not changed" << LL_ENDL;
}
}
@@ -1191,11 +1191,11 @@ void LLPanelObject::sendIsTemporary()
LLSelectMgr::getInstance()->selectionUpdateTemporary(value);
mIsTemporary = value;
- llinfos << "update temporary sent" << llendl;
+ LL_INFOS() << "update temporary sent" << LL_ENDL;
}
else
{
- llinfos << "update temporary not changed" << llendl;
+ LL_INFOS() << "update temporary not changed" << LL_ENDL;
}
}
@@ -1208,11 +1208,11 @@ void LLPanelObject::sendIsPhantom()
LLSelectMgr::getInstance()->selectionUpdatePhantom(value);
mIsPhantom = value;
- llinfos << "update phantom sent" << llendl;
+ LL_INFOS() << "update phantom sent" << LL_ENDL;
}
else
{
- llinfos << "update phantom not changed" << llendl;
+ LL_INFOS() << "update phantom not changed" << LL_ENDL;
}
}
@@ -1322,8 +1322,8 @@ void LLPanelObject::getVolumeParams(LLVolumeParams& volume_params)
break;
default:
- llwarns << "Unknown base type " << selected_type
- << " in getVolumeParams()" << llendl;
+ LL_WARNS() << "Unknown base type " << selected_type
+ << " in getVolumeParams()" << LL_ENDL;
// assume a box
selected_type = MI_BOX;
profile = LL_PCODE_PROFILE_SQUARE;
@@ -1640,11 +1640,11 @@ void LLPanelObject::sendScale(BOOL btn_down)
}
LLSelectMgr::getInstance()->adjustTexturesByScale(TRUE, !dont_stretch_textures);
-// llinfos << "scale sent" << llendl;
+// LL_INFOS() << "scale sent" << LL_ENDL;
}
else
{
-// llinfos << "scale not changed" << llendl;
+// LL_INFOS() << "scale not changed" << LL_ENDL;
}
}
diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp
index d7130820ab..6b74d90708 100755
--- a/indra/newview/llpanelobjectinventory.cpp
+++ b/indra/newview/llpanelobjectinventory.cpp
@@ -210,7 +210,7 @@ struct LLBuyInvItemData
void LLTaskInvFVBridge::buyItem()
{
- llinfos << "LLTaskInvFVBridge::buyItem()" << llendl;
+ LL_INFOS() << "LLTaskInvFVBridge::buyItem()" << LL_ENDL;
LLInventoryItem* item = findItem();
if(!item || !item->getSaleInfo().isForSale()) return;
LLBuyInvItemData* inv = new LLBuyInvItemData(mPanel->getTaskUUID(),
@@ -225,7 +225,7 @@ void LLTaskInvFVBridge::buyItem()
if( ( obj = gObjectList.findObject( mPanel->getTaskUUID() ) ) && obj->isAttachment() )
{
LLNotificationsUtil::add("Cannot_Purchase_an_Attachment");
- llinfos << "Attempt to purchase an attachment" << llendl;
+ LL_INFOS() << "Attempt to purchase an attachment" << LL_ENDL;
delete inv;
}
else
@@ -372,7 +372,7 @@ LLUIImagePtr LLTaskInvFVBridge::getIcon() const
void LLTaskInvFVBridge::openItem()
{
// no-op.
- lldebugs << "LLTaskInvFVBridge::openItem()" << llendl;
+ LL_DEBUGS() << "LLTaskInvFVBridge::openItem()" << LL_ENDL;
}
BOOL LLTaskInvFVBridge::isItemRenameable() const
@@ -562,7 +562,7 @@ void LLTaskInvFVBridge::pasteLinkFromClipboard()
BOOL LLTaskInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const
{
- //llinfos << "LLTaskInvFVBridge::startDrag()" << llendl;
+ //LL_INFOS() << "LLTaskInvFVBridge::startDrag()" << LL_ENDL;
if(mPanel)
{
LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID());
@@ -603,7 +603,7 @@ BOOL LLTaskInvFVBridge::dragOrDrop(MASK mask, BOOL drop,
void* cargo_data,
std::string& tooltip_msg)
{
- //llinfos << "LLTaskInvFVBridge::dragOrDrop()" << llendl;
+ //LL_INFOS() << "LLTaskInvFVBridge::dragOrDrop()" << LL_ENDL;
return FALSE;
}
@@ -616,7 +616,7 @@ void LLTaskInvFVBridge::performAction(LLInventoryModel* model, std::string actio
S32 price = getPrice();
if (-1 == price)
{
- llwarns << "label_buy_task_bridged_item: Invalid price" << llendl;
+ LL_WARNS() << "label_buy_task_bridged_item: Invalid price" << LL_ENDL;
}
else
{
@@ -665,7 +665,7 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
S32 price = getPrice();
if (-1 == price)
{
- llwarns << "label_buy_task_bridged_item: Invalid price" << llendl;
+ LL_WARNS() << "label_buy_task_bridged_item: Invalid price" << LL_ENDL;
}
else
{
@@ -799,7 +799,7 @@ void LLTaskCategoryBridge::openItem()
BOOL LLTaskCategoryBridge::startDrag(EDragAndDropType* type, LLUUID* id) const
{
- //llinfos << "LLTaskInvFVBridge::startDrag()" << llendl;
+ //LL_INFOS() << "LLTaskInvFVBridge::startDrag()" << LL_ENDL;
if(mPanel && mUUID.notNull())
{
LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID());
@@ -822,7 +822,7 @@ BOOL LLTaskCategoryBridge::dragOrDrop(MASK mask, BOOL drop,
void* cargo_data,
std::string& tooltip_msg)
{
- //llinfos << "LLTaskCategoryBridge::dragOrDrop()" << llendl;
+ //LL_INFOS() << "LLTaskCategoryBridge::dragOrDrop()" << LL_ENDL;
BOOL accept = FALSE;
LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID());
if(object)
@@ -901,7 +901,7 @@ public:
void LLTaskTextureBridge::openItem()
{
- llinfos << "LLTaskTextureBridge::openItem()" << llendl;
+ LL_INFOS() << "LLTaskTextureBridge::openItem()" << LL_ENDL;
LLPreviewTexture* preview = LLFloaterReg::showTypedInstance<LLPreviewTexture>("preview_texture", LLSD(mUUID), TAKE_FOCUS_YES);
if(preview)
{
@@ -978,7 +978,7 @@ void LLTaskSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
S32 price = getPrice();
if (-1 == price)
{
- llwarns << "label_buy_task_bridged_item: Invalid price" << llendl;
+ LL_WARNS() << "label_buy_task_bridged_item: Invalid price" << LL_ENDL;
}
else
{
@@ -1095,7 +1095,7 @@ public:
void LLTaskLSLBridge::openItem()
{
- llinfos << "LLTaskLSLBridge::openItem() " << mUUID << llendl;
+ LL_INFOS() << "LLTaskLSLBridge::openItem() " << mUUID << LL_ENDL;
LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID());
if(!object || object->isInventoryPending())
{
@@ -1336,7 +1336,7 @@ void LLTaskMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
S32 price = getPrice();
if (-1 == price)
{
- llwarns << "label_buy_task_bridged_item: Invalid price" << llendl;
+ LL_WARNS() << "label_buy_task_bridged_item: Invalid price" << LL_ENDL;
}
else
{
@@ -1417,7 +1417,7 @@ LLTaskInvFVBridge* LLTaskInvFVBridge::createObjectBridge(LLPanelObjectInventory*
break;
case LLAssetType::AT_SCRIPT:
// OLD SCRIPTS DEPRECATED - JC
- llwarns << "Old script" << llendl;
+ LL_WARNS() << "Old script" << LL_ENDL;
//new_bridge = new LLTaskOldScriptBridge(panel,
// object_id,
// object_name);
@@ -1466,8 +1466,8 @@ LLTaskInvFVBridge* LLTaskInvFVBridge::createObjectBridge(LLPanelObjectInventory*
object_name);
break;
default:
- llinfos << "Unhandled inventory type (llassetstorage.h): "
- << (S32)type << llendl;
+ LL_INFOS() << "Unhandled inventory type (llassetstorage.h): "
+ << (S32)type << LL_ENDL;
break;
}
return new_bridge;
@@ -1491,7 +1491,8 @@ LLPanelObjectInventory::LLPanelObjectInventory(const LLPanelObjectInventory::Par
mFolders(NULL),
mHaveInventory(FALSE),
mIsInventoryEmpty(TRUE),
- mInventoryNeedsUpdate(FALSE)
+ mInventoryNeedsUpdate(FALSE),
+ mInventoryViewModel(p.name)
{
// Setup context menu callbacks
mCommitCallbackRegistrar.add("Inventory.DoToSelected", boost::bind(&LLPanelObjectInventory::doToSelected, this, _2));
@@ -1508,7 +1509,7 @@ LLPanelObjectInventory::~LLPanelObjectInventory()
{
if (!gIdleCallbacks.deleteFunction(idle, this))
{
- llwarns << "LLPanelObjectInventory::~LLPanelObjectInventory() failed to delete callback" << llendl;
+ LL_WARNS() << "LLPanelObjectInventory::~LLPanelObjectInventory() failed to delete callback" << LL_ENDL;
}
}
@@ -1603,9 +1604,9 @@ void LLPanelObjectInventory::inventoryChanged(LLViewerObject* object,
{
if(!object) return;
- //llinfos << "invetnory arrived: \n"
+ //LL_INFOS() << "invetnory arrived: \n"
// << " panel UUID: " << panel->mTaskUUID << "\n"
- // << " task UUID: " << object->mID << llendl;
+ // << " task UUID: " << object->mID << LL_ENDL;
if(mTaskUUID == object->mID)
{
mInventoryNeedsUpdate = TRUE;
@@ -1629,9 +1630,9 @@ void LLPanelObjectInventory::inventoryChanged(LLViewerObject* object,
void LLPanelObjectInventory::updateInventory()
{
- //llinfos << "inventory arrived: \n"
+ //LL_INFOS() << "inventory arrived: \n"
// << " panel UUID: " << panel->mTaskUUID << "\n"
- // << " task UUID: " << object->mID << llendl;
+ // << " task UUID: " << object->mID << LL_ENDL;
// We're still interested in this task's inventory.
std::vector<LLUUID> selected_item_ids;
std::set<LLFolderViewItem*> selected_items;
@@ -1753,7 +1754,7 @@ void LLPanelObjectInventory::createViewsForCategory(LLInventoryObject::object_li
LLUIColor item_color = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
// Find all in the first pass
- LLDynamicArray<obj_folder_pair*> child_categories;
+ std::vector<obj_folder_pair*> child_categories;
LLTaskInvFVBridge* bridge;
LLFolderViewItem* view;
@@ -1780,7 +1781,7 @@ void LLPanelObjectInventory::createViewsForCategory(LLInventoryObject::object_li
p.font_color = item_color;
p.font_highlight_color = item_color;
view = LLUICtrlFactory::create<LLFolderViewFolder>(p);
- child_categories.put(new obj_folder_pair(obj,
+ child_categories.push_back(new obj_folder_pair(obj,
(LLFolderViewFolder*)view));
}
else
@@ -1802,7 +1803,7 @@ void LLPanelObjectInventory::createViewsForCategory(LLInventoryObject::object_li
}
// now, for each category, do the second pass
- for(S32 i = 0; i < child_categories.count(); i++)
+ for(S32 i = 0; i < child_categories.size(); i++)
{
createViewsForCategory(inventory, child_categories[i]->first,
child_categories[i]->second );
@@ -1812,7 +1813,7 @@ void LLPanelObjectInventory::createViewsForCategory(LLInventoryObject::object_li
void LLPanelObjectInventory::refresh()
{
- //llinfos << "LLPanelObjectInventory::refresh()" << llendl;
+ //LL_INFOS() << "LLPanelObjectInventory::refresh()" << LL_ENDL;
BOOL has_inventory = FALSE;
const BOOL non_root_ok = TRUE;
LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(NULL, non_root_ok);
@@ -1861,12 +1862,17 @@ void LLPanelObjectInventory::refresh()
}
if(!has_inventory)
{
- mTaskUUID = LLUUID::null;
- removeVOInventoryListener();
- clearContents();
+ clearInventoryTask();
}
mInventoryViewModel.setTaskID(mTaskUUID);
- //llinfos << "LLPanelObjectInventory::refresh() " << mTaskUUID << llendl;
+ //LL_INFOS() << "LLPanelObjectInventory::refresh() " << mTaskUUID << LL_ENDL;
+}
+
+void LLPanelObjectInventory::clearInventoryTask()
+{
+ mTaskUUID = LLUUID::null;
+ removeVOInventoryListener();
+ clearContents();
}
void LLPanelObjectInventory::removeSelectedItem()
@@ -2010,3 +2016,46 @@ void LLPanelObjectInventory::clearItemIDs()
mItemMap.clear();
}
+BOOL LLPanelObjectInventory::handleKeyHere( KEY key, MASK mask )
+{
+ BOOL handled = FALSE;
+ switch (key)
+ {
+ case KEY_DELETE:
+ case KEY_BACKSPACE:
+ // Delete selected items if delete or backspace key hit on the inventory panel
+ // Note: on Mac laptop keyboards, backspace and delete are one and the same
+ if (isSelectionRemovable() && mask == MASK_NONE)
+ {
+ LLInventoryAction::doToSelected(&gInventory, mFolders, "delete");
+ handled = TRUE;
+ }
+ break;
+ }
+ return handled;
+}
+
+BOOL LLPanelObjectInventory::isSelectionRemovable()
+{
+ if (!mFolders || !mFolders->getRoot())
+ {
+ return FALSE;
+ }
+ std::set<LLFolderViewItem*> selection_set = mFolders->getRoot()->getSelectionList();
+ if (selection_set.empty())
+ {
+ return FALSE;
+ }
+ for (std::set<LLFolderViewItem*>::iterator iter = selection_set.begin();
+ iter != selection_set.end();
+ ++iter)
+ {
+ LLFolderViewItem *item = *iter;
+ const LLFolderViewModelItemInventory *listener = dynamic_cast<const LLFolderViewModelItemInventory*>(item->getViewModelItem());
+ if (!listener || !listener->isItemRemovable() || listener->isItemInTrash())
+ {
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
diff --git a/indra/newview/llpanelobjectinventory.h b/indra/newview/llpanelobjectinventory.h
index f497c695b3..3de49242ac 100755
--- a/indra/newview/llpanelobjectinventory.h
+++ b/indra/newview/llpanelobjectinventory.h
@@ -62,6 +62,7 @@ public:
void refresh();
const LLUUID& getTaskUUID() { return mTaskUUID;}
+ void clearInventoryTask();
void removeSelectedItem();
void startRenamingSelectedItem();
@@ -94,6 +95,9 @@ protected:
void removeItemID(const LLUUID& id);
void clearItemIDs();
+ BOOL handleKeyHere( KEY key, MASK mask );
+ BOOL isSelectionRemovable();
+
private:
std::map<LLUUID, LLFolderViewItem*> mItemMap;
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index f75d76da94..496168229d 100755
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -159,6 +159,7 @@ public:
registrar.add("Wearable.Create", boost::bind(onCreate, _2));
+ llassert(LLMenuGL::sMenuContainer != NULL);
LLToggleableMenu* menu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>(
"menu_cof_gear.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance());
llassert(menu);
@@ -169,14 +170,14 @@ public:
return menu;
}
-
+
private:
static void onCreate(const LLSD& param)
{
LLWearableType::EType type = LLWearableType::typeNameToType(param.asString());
if (type == LLWearableType::WT_NONE)
{
- llwarns << "Invalid wearable type" << llendl;
+ LL_WARNS() << "Invalid wearable type" << LL_ENDL;
return;
}
@@ -228,6 +229,7 @@ public:
enable_registrar.add("AddWearable.Gear.Check", boost::bind(onCheck, flat_list_handle, inventory_panel_handle, _2));
enable_registrar.add("AddWearable.Gear.Visible", boost::bind(onVisible, inventory_panel_handle, _2));
+ llassert(LLMenuGL::sMenuContainer != NULL);
LLToggleableMenu* menu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>(
"menu_add_wearable_gear.xml",
LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance());
@@ -263,7 +265,7 @@ private:
}
else
{
- llwarns << "Unrecognized sort order action" << llendl;
+ LL_WARNS() << "Unrecognized sort order action" << LL_ENDL;
return;
}
@@ -306,7 +308,7 @@ private:
// If inventory panel is not sorted by date then it is sorted by name.
return LLWearableItemsList::E_SORT_BY_MOST_RECENT & ~sort_order;
}
- llwarns << "Unrecognized inventory panel sort order" << llendl;
+ LL_WARNS() << "Unrecognized inventory panel sort order" << LL_ENDL;
}
else
{
@@ -324,7 +326,7 @@ private:
{
return LLWearableItemsList::E_SORT_BY_TYPE_NAME == sort_order;
}
- llwarns << "Unrecognized wearable list sort order" << llendl;
+ LL_WARNS() << "Unrecognized wearable list sort order" << LL_ENDL;
}
return false;
}
@@ -481,7 +483,7 @@ BOOL LLPanelOutfitEdit::postBuild()
childSetCommitCallback("shop_btn_1", boost::bind(&LLPanelOutfitEdit::onShopButtonClicked, this), NULL);
childSetCommitCallback("shop_btn_2", boost::bind(&LLPanelOutfitEdit::onShopButtonClicked, this), NULL);
- setVisibleCallback(boost::bind(&LLPanelOutfitEdit::onVisibilityChange, this, _2));
+ setVisibleCallback(boost::bind(&LLPanelOutfitEdit::onVisibilityChanged, this, _2));
mWearablesGearMenuBtn = getChild<LLMenuButton>("wearables_gear_menu_btn");
mGearMenuBtn = getChild<LLMenuButton>("gear_menu_btn");
@@ -767,7 +769,7 @@ void LLPanelOutfitEdit::onPlusBtnClicked(void)
}
}
-void LLPanelOutfitEdit::onVisibilityChange(const LLSD &in_visible_chain)
+void LLPanelOutfitEdit::onVisibilityChanged(const LLSD &in_visible_chain)
{
showAddWearablesPanel(false);
mWearableItemsList->resetSelection();
@@ -842,7 +844,7 @@ void LLPanelOutfitEdit::onShopButtonClicked()
}
else
{
- llwarns << "Agent avatar is invalid" << llendl;
+ LL_WARNS() << "Agent avatar is invalid" << LL_ENDL;
// the second argument is not important in this case: generic market place will be opened
url = url_resolver.resolveURL(LLWearableType::WT_NONE, SEX_FEMALE);
@@ -1154,7 +1156,7 @@ BOOL LLPanelOutfitEdit::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
{
if (cargo_data == NULL)
{
- llwarns << "cargo_data is NULL" << llendl;
+ LL_WARNS() << "cargo_data is NULL" << LL_ENDL;
return TRUE;
}
@@ -1184,12 +1186,12 @@ BOOL LLPanelOutfitEdit::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
* second argument is used to delay the appearance update until all dragged items
* are added to optimize user experience.
*/
- LLAppearanceMgr::instance().addCOFItemLink(item->getLinkedUUID(), false);
+ LLAppearanceMgr::instance().addCOFItemLink(item->getLinkedUUID());
}
else
{
// if asset id is not available for the item we must wear it immediately (attachments only)
- LLAppearanceMgr::instance().addCOFItemLink(item->getLinkedUUID(), true);
+ LLAppearanceMgr::instance().addCOFItemLink(item->getLinkedUUID(), new LLUpdateAppearanceAndEditWearableOnDestroy(item->getUUID()));
}
}
@@ -1260,7 +1262,7 @@ void LLPanelOutfitEdit::resetAccordionState()
}
else
{
- llwarns << "mCOFWearables is NULL" << llendl;
+ LL_WARNS() << "mCOFWearables is NULL" << LL_ENDL;
}
}
diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h
index 5d4b8d4644..30870daf40 100755
--- a/indra/newview/llpaneloutfitedit.h
+++ b/indra/newview/llpaneloutfitedit.h
@@ -145,7 +145,7 @@ public:
void updatePlusButton();
void onPlusBtnClicked(void);
- void onVisibilityChange(const LLSD &in_visible_chain);
+ void onVisibilityChanged(const LLSD &in_visible_chain);
void applyFolderViewFilter(EFolderViewItemType type);
void applyListViewFilter(EListViewItemType type);
diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp
index e0132d20fb..1e1f59055f 100755
--- a/indra/newview/llpaneloutfitsinventory.cpp
+++ b/indra/newview/llpaneloutfitsinventory.cpp
@@ -76,7 +76,8 @@ BOOL LLPanelOutfitsInventory::postBuild()
// Fetch your outfits folder so that the links are in memory.
// ( This is only necessary if we want to show a warning if a user deletes an item that has a
// a link in an outfit, see "ConfirmItemDeleteHasLinks". )
- const LLUUID &outfits_cat = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTFIT, false);
+
+ const LLUUID &outfits_cat = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS, false);
if (outfits_cat.notNull())
{
LLInventoryModelBackgroundFetch::instance().start(outfits_cat);
@@ -183,7 +184,7 @@ bool LLPanelOutfitsInventory::onSaveCommit(const LLSD& notification, const LLSD&
LLStringUtil::trim(outfit_name);
if( !outfit_name.empty() )
{
- LLUUID outfit_folder = LLAppearanceMgr::getInstance()->makeNewOutfitLinks(outfit_name);
+ LLAppearanceMgr::getInstance()->makeNewOutfitLinks(outfit_name);
LLSidepanelAppearance* panel_appearance = getAppearanceSP();
if (panel_appearance)
@@ -242,18 +243,12 @@ void LLPanelOutfitsInventory::updateListCommands()
bool wear_visible = !isCOFPanelActive();
bool make_outfit_enabled = isActionEnabled("save_outfit");
+ LLButton* wear_btn = mListCommands->getChild<LLButton>("wear_btn");
mMyOutfitsPanel->childSetEnabled("trash_btn", trash_enabled);
- mListCommands->childSetEnabled("wear_btn", wear_enabled);
- mListCommands->childSetVisible("wear_btn", wear_visible);
+ wear_btn->setEnabled(wear_enabled);
+ wear_btn->setVisible(wear_visible);
mSaveComboBtn->setMenuItemEnabled("save_outfit", make_outfit_enabled);
- if (mMyOutfitsPanel->hasItemSelected())
- {
- mListCommands->childSetToolTip("wear_btn", getString("wear_items_tooltip"));
- }
- else
- {
- mListCommands->childSetToolTip("wear_btn", getString("wear_outfit_tooltip"));
- }
+ wear_btn->setToolTip(getString(mMyOutfitsPanel->hasItemSelected() ? "wear_items_tooltip" : "wear_outfit_tooltip"));
}
void LLPanelOutfitsInventory::onTrashButtonClick()
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index f5542ee7a6..5977d558d3 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -394,7 +394,7 @@ private:
}
/*virtual*/ void changed(U32 mask)
{
- lldebugs << "Inventory changed: " << mask << llendl;
+ LL_DEBUGS() << "Inventory changed: " << mask << LL_ENDL;
static bool synchronize_friends_folders = true;
if (synchronize_friends_folders)
@@ -410,9 +410,9 @@ private:
// That means LLInventoryObserver::STRUCTURE is present in MASK instead of LLInventoryObserver::REMOVE
if ((CALLINGCARD_ADDED & mask) == CALLINGCARD_ADDED)
{
- lldebugs << "Calling card added: count: " << gInventory.getChangedIDs().size()
+ LL_DEBUGS() << "Calling card added: count: " << gInventory.getChangedIDs().size()
<< ", first Inventory ID: "<< (*gInventory.getChangedIDs().begin())
- << llendl;
+ << LL_ENDL;
bool friendFound = false;
std::set<LLUUID> changedIDs = gInventory.getChangedIDs();
@@ -427,7 +427,7 @@ private:
if (friendFound)
{
- lldebugs << "friend found, panel should be updated" << llendl;
+ LL_DEBUGS() << "friend found, panel should be updated" << LL_ENDL;
mUpdater->changed(LLFriendObserver::ADD);
}
}
@@ -505,7 +505,7 @@ public:
LLPanelPeople::LLPanelPeople()
: LLPanel(),
- mTryToConnectToFbc(true),
+ mTryToConnectToFacebook(true),
mTabContainer(NULL),
mOnlineFriendList(NULL),
mAllFriendList(NULL),
@@ -556,7 +556,7 @@ void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LL
{
if(!avatar_list)
{
- llerrs << "Bad parameter" << llendl;
+ LL_ERRS() << "Bad parameter" << LL_ENDL;
return;
}
@@ -668,7 +668,7 @@ BOOL LLPanelPeople::postBuild()
}
else
{
- llwarns << "People->Groups list menu not found" << llendl;
+ LL_WARNS() << "People->Groups list menu not found" << LL_ENDL;
}
LLAccordionCtrlTab* accordion_tab = getChild<LLAccordionCtrlTab>("tab_all");
@@ -753,12 +753,12 @@ void LLPanelPeople::updateFriendList()
if (buddies_uuids.size() > 0)
{
- lldebugs << "Friends added to the list: " << buddies_uuids.size() << llendl;
+ LL_DEBUGS() << "Friends added to the list: " << buddies_uuids.size() << LL_ENDL;
all_friendsp = buddies_uuids;
}
else
{
- lldebugs << "No friends found" << llendl;
+ LL_DEBUGS() << "No friends found" << LL_ENDL;
}
LLAvatarTracker::buddy_map_t::const_iterator buddy_it = all_buddies.begin();
@@ -865,10 +865,10 @@ void LLPanelPeople::updateFacebookList(bool visible)
{
LLFacebookConnect::instance().loadFacebookFriends();
}
- else if(mTryToConnectToFbc)
+ else if(mTryToConnectToFacebook)
{
LLFacebookConnect::instance().checkConnectionToFacebook();
- mTryToConnectToFbc = false;
+ mTryToConnectToFacebook = false;
}
updateSuggestedFriendList();
@@ -902,8 +902,8 @@ void LLPanelPeople::updateButtons()
LLPanel* groups_panel = mTabContainer->getCurrentPanel();
groups_panel->getChildView("minus_btn")->setEnabled(item_selected && selected_id.notNull()); // a real group selected
- groups_panel->getChild<LLUICtrl>("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.count()));
- groups_panel->getChild<LLUICtrl>("groupcount")->setTextArg("[REMAINING]", llformat("%d",(gMaxAgentGroups-gAgent.mGroups.count())));
+ groups_panel->getChild<LLUICtrl>("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.size()));
+ groups_panel->getChild<LLUICtrl>("groupcount")->setTextArg("[REMAINING]", llformat("%d",(gMaxAgentGroups-gAgent.mGroups.size())));
}
else
{
@@ -1037,7 +1037,7 @@ void LLPanelPeople::setSortOrder(LLAvatarList* list, ESortOrder order, bool save
list->sort();
break;
default:
- llwarns << "Unrecognized people sort order for " << list->getName() << llendl;
+ LL_WARNS() << "Unrecognized people sort order for " << list->getName() << LL_ENDL;
return;
}
@@ -1435,7 +1435,7 @@ bool LLPanelPeople::notifyChildren(const LLSD& info)
LLSideTrayPanelContainer* container = dynamic_cast<LLSideTrayPanelContainer*>(getParent());
if (!container)
{
- llwarns << "Cannot find People panel container" << llendl;
+ LL_WARNS() << "Cannot find People panel container" << LL_ENDL;
return true;
}
@@ -1457,7 +1457,7 @@ void LLPanelPeople::showAccordion(const std::string name, bool show)
{
if(name.empty())
{
- llwarns << "No name provided" << llendl;
+ LL_WARNS() << "No name provided" << LL_ENDL;
return;
}
@@ -1510,7 +1510,7 @@ void LLPanelPeople::setAccordionCollapsedByUser(LLUICtrl* acc_tab, bool collapse
{
if(!acc_tab)
{
- llwarns << "Invalid parameter" << llendl;
+ LL_WARNS() << "Invalid parameter" << LL_ENDL;
return;
}
@@ -1528,7 +1528,7 @@ bool LLPanelPeople::isAccordionCollapsedByUser(LLUICtrl* acc_tab)
{
if(!acc_tab)
{
- llwarns << "Invalid parameter" << llendl;
+ LL_WARNS() << "Invalid parameter" << LL_ENDL;
return false;
}
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index c7141f36ee..55eaf74f74 100755
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -39,6 +39,7 @@ class LLFilterEditor;
class LLGroupList;
class LLMenuButton;
class LLTabContainer;
+class LLNetMap;
class LLPanelPeople
: public LLPanel
@@ -56,7 +57,7 @@ public:
// when voice is available
/*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal);
- bool mTryToConnectToFbc;
+ bool mTryToConnectToFacebook;
// internals
class Updater;
diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp
index 6979ae06e0..a5f59dbf4a 100755
--- a/indra/newview/llpanelpeoplemenus.cpp
+++ b/indra/newview/llpanelpeoplemenus.cpp
@@ -90,7 +90,7 @@ LLContextMenu* PeopleContextMenu::createMenu()
// Set up for multi-selected People
// registrar.add("Avatar.AddFriend", boost::bind(&LLAvatarActions::requestFriendshipDialog, mUUIDs)); // *TODO: unimplemented
- registrar.add("Avatar.IM", boost::bind(&LLAvatarActions::startConference, mUUIDs, LLUUID::null));
+ registrar.add("Avatar.IM", boost::bind(&PeopleContextMenu::startConference, this));
registrar.add("Avatar.Call", boost::bind(&LLAvatarActions::startAdhocCall, mUUIDs, LLUUID::null));
registrar.add("Avatar.OfferTeleport", boost::bind(&PeopleContextMenu::offerTeleport, this));
registrar.add("Avatar.RemoveFriend", boost::bind(&LLAvatarActions::removeFriendsDialog, mUUIDs));
@@ -272,6 +272,19 @@ void PeopleContextMenu::offerTeleport()
LLAvatarActions::offerTeleport(mUUIDs);
}
+void PeopleContextMenu::startConference()
+{
+ uuid_vec_t uuids;
+ for (uuid_vec_t::const_iterator it = mUUIDs.begin(); it != mUUIDs.end(); ++it)
+ {
+ if(*it != gAgentID)
+ {
+ uuids.push_back(*it);
+ }
+ }
+ LLAvatarActions::startConference(uuids);
+}
+
//== NearbyPeopleContextMenu ===============================================================
void NearbyPeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags)
diff --git a/indra/newview/llpanelpeoplemenus.h b/indra/newview/llpanelpeoplemenus.h
index 945382ebc5..9767bab89f 100755
--- a/indra/newview/llpanelpeoplemenus.h
+++ b/indra/newview/llpanelpeoplemenus.h
@@ -47,6 +47,7 @@ private:
bool enableContextMenuItem(const LLSD& userdata);
bool checkContextMenuItem(const LLSD& userdata);
void offerTeleport();
+ void startConference();
void requestTeleport();
};
diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp
index 131e8e9359..58055d98c6 100755
--- a/indra/newview/llpanelpermissions.cpp
+++ b/indra/newview/llpanelpermissions.cpp
@@ -913,7 +913,6 @@ bool callback_deed_to_group(const LLSD& notification, const LLSD& response)
if(group_id.notNull() && groups_identical && (gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED)))
{
LLSelectMgr::getInstance()->sendOwner(LLUUID::null, group_id, FALSE);
-// LLViewerStats::getInstance()->incStat(LLViewerStats::ST_RELEASE_COUNT);
}
}
return false;
@@ -964,28 +963,28 @@ void LLPanelPermissions::onCommitEveryoneCopy(LLUICtrl *ctrl, void *data)
// static
void LLPanelPermissions::onCommitNextOwnerModify(LLUICtrl* ctrl, void* data)
{
- //llinfos << "LLPanelPermissions::onCommitNextOwnerModify" << llendl;
+ //LL_INFOS() << "LLPanelPermissions::onCommitNextOwnerModify" << LL_ENDL;
onCommitPerm(ctrl, data, PERM_NEXT_OWNER, PERM_MODIFY);
}
// static
void LLPanelPermissions::onCommitNextOwnerCopy(LLUICtrl* ctrl, void* data)
{
- //llinfos << "LLPanelPermissions::onCommitNextOwnerCopy" << llendl;
+ //LL_INFOS() << "LLPanelPermissions::onCommitNextOwnerCopy" << LL_ENDL;
onCommitPerm(ctrl, data, PERM_NEXT_OWNER, PERM_COPY);
}
// static
void LLPanelPermissions::onCommitNextOwnerTransfer(LLUICtrl* ctrl, void* data)
{
- //llinfos << "LLPanelPermissions::onCommitNextOwnerTransfer" << llendl;
+ //LL_INFOS() << "LLPanelPermissions::onCommitNextOwnerTransfer" << LL_ENDL;
onCommitPerm(ctrl, data, PERM_NEXT_OWNER, PERM_TRANSFER);
}
// static
void LLPanelPermissions::onCommitName(LLUICtrl*, void* data)
{
- //llinfos << "LLPanelPermissions::onCommitName()" << llendl;
+ //LL_INFOS() << "LLPanelPermissions::onCommitName()" << LL_ENDL;
LLPanelPermissions* self = (LLPanelPermissions*)data;
LLLineEditor* tb = self->getChild<LLLineEditor>("Object Name");
if(tb)
@@ -999,7 +998,7 @@ void LLPanelPermissions::onCommitName(LLUICtrl*, void* data)
// static
void LLPanelPermissions::onCommitDesc(LLUICtrl*, void* data)
{
- //llinfos << "LLPanelPermissions::onCommitDesc()" << llendl;
+ //LL_INFOS() << "LLPanelPermissions::onCommitDesc()" << LL_ENDL;
LLPanelPermissions* self = (LLPanelPermissions*)data;
LLLineEditor* le = self->getChild<LLLineEditor>("Object Description");
if(le)
@@ -1024,7 +1023,7 @@ void LLPanelPermissions::onCommitSaleType(LLUICtrl*, void* data)
void LLPanelPermissions::setAllSaleInfo()
{
- llinfos << "LLPanelPermissions::setAllSaleInfo()" << llendl;
+ LL_INFOS() << "LLPanelPermissions::setAllSaleInfo()" << LL_ENDL;
LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_NOT;
LLCheckBoxCtrl *checkPurchase = getChild<LLCheckBoxCtrl>("checkbox for sale");
diff --git a/indra/newview/llpanelpick.h b/indra/newview/llpanelpick.h
index 3c1f14759c..7a8bd66fcf 100755
--- a/indra/newview/llpanelpick.h
+++ b/indra/newview/llpanelpick.h
@@ -86,7 +86,7 @@ public:
//This stuff we got from LLRemoteParcelObserver, in the last one we intentionally do nothing
/*virtual*/ void processParcelInfo(const LLParcelData& parcel_data);
/*virtual*/ void setParcelID(const LLUUID& parcel_id) { mParcelId = parcel_id; }
- /*virtual*/ void setErrorStatus(U32 status, const std::string& reason) {};
+ /*virtual*/ void setErrorStatus(S32 status, const std::string& reason) {};
protected:
diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp
index f0617266db..d73a5b402e 100755
--- a/indra/newview/llpanelpicks.cpp
+++ b/indra/newview/llpanelpicks.cpp
@@ -30,7 +30,6 @@
#include "llagent.h"
#include "llagentpicksinfo.h"
-#include "llavatarconstants.h"
#include "llcommandhandler.h"
#include "lldispatcher.h"
#include "llflatlistview.h"
@@ -123,7 +122,7 @@ public:
}
else
{
- llwarns << "unknown verb " << verb << llendl;
+ LL_WARNS() << "unknown verb " << verb << LL_ENDL;
return false;
}
}
@@ -174,7 +173,7 @@ public:
}
else
{
- llwarns << "Can't edit a pick you did not create" << llendl;
+ LL_WARNS() << "Can't edit a pick you did not create" << LL_ENDL;
}
// remove our observer now that we're done
@@ -281,7 +280,7 @@ public:
{
if (c_info->creator_id == gAgent.getID())
{
- llwarns << "edit in progress" << llendl;
+ LL_WARNS() << "edit in progress" << LL_ENDL;
// open the new classified panel on the Me > Picks sidetray
LLSD params;
params["id"] = gAgent.getID();
@@ -292,7 +291,7 @@ public:
}
else
{
- llwarns << "Can't edit a classified you did not create" << llendl;
+ LL_WARNS() << "Can't edit a classified you did not create" << LL_ENDL;
}
}
}
@@ -677,7 +676,7 @@ void LLPanelPicks::onListCommit(const LLFlatListView* f_list)
}
else
{
- llwarns << "Unknown list" << llendl;
+ LL_WARNS() << "Unknown list" << LL_ENDL;
}
updateButtons();
@@ -937,7 +936,7 @@ void LLPanelPicks::openClassifiedInfo(const LLSD &params)
void LLPanelPicks::openClassifiedEdit(const LLSD& params)
{
LLUUID classified_id = params["classified_id"].asUUID();;
- llinfos << "opening classified " << classified_id << " for edit" << llendl;
+ LL_INFOS() << "opening classified " << classified_id << " for edit" << LL_ENDL;
editClassified(classified_id);
}
@@ -1169,7 +1168,7 @@ void LLPanelPicks::editClassified(const LLUUID& classified_id)
LLClassifiedItem* c_item = findClassifiedById(classified_id);
if (!c_item)
{
- llwarns << "item not found for classified_id " << classified_id << llendl;
+ LL_WARNS() << "item not found for classified_id " << classified_id << LL_ENDL;
return;
}
diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp
index 4ae0c0eb12..4e7c5f6ed2 100755
--- a/indra/newview/llpanelplaceinfo.cpp
+++ b/indra/newview/llpanelplaceinfo.cpp
@@ -169,15 +169,15 @@ void LLPanelPlaceInfo::displayParcelInfo(const LLUUID& region_id,
}
// virtual
-void LLPanelPlaceInfo::setErrorStatus(U32 status, const std::string& reason)
+void LLPanelPlaceInfo::setErrorStatus(S32 status, const std::string& reason)
{
// We only really handle 404 and 499 errors
std::string error_text;
- if(status == 404)
+ if(status == HTTP_NOT_FOUND)
{
error_text = getString("server_error_text");
}
- else if(status == 499)
+ else if(status == HTTP_INTERNAL_ERROR)
{
error_text = getString("server_forbidden_text");
}
diff --git a/indra/newview/llpanelplaceinfo.h b/indra/newview/llpanelplaceinfo.h
index 64f0b6b550..30327378ef 100755
--- a/indra/newview/llpanelplaceinfo.h
+++ b/indra/newview/llpanelplaceinfo.h
@@ -86,7 +86,7 @@ public:
void displayParcelInfo(const LLUUID& region_id,
const LLVector3d& pos_global);
- /*virtual*/ void setErrorStatus(U32 status, const std::string& reason);
+ /*virtual*/ void setErrorStatus(S32 status, const std::string& reason);
/*virtual*/ void processParcelInfo(const LLParcelData& parcel_data);
diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp
index 14b5d9af47..ed91d277dd 100755
--- a/indra/newview/llpanelplaceprofile.cpp
+++ b/indra/newview/llpanelplaceprofile.cpp
@@ -129,6 +129,7 @@ BOOL LLPanelPlaceProfile::postBuild()
mEstateNameText = getChild<LLTextBox>("estate_name");
mEstateRatingText = getChild<LLTextBox>("estate_rating");
+ mEstateRatingIcon = getChild<LLIconCtrl>("estate_rating_icon");
mEstateOwnerText = getChild<LLTextBox>("estate_owner");
mCovenantText = getChild<LLTextEditor>("covenant");
@@ -201,6 +202,7 @@ void LLPanelPlaceProfile::resetLocation()
mEstateNameText->setValue(loading);
mEstateRatingText->setValue(loading);
+ mEstateRatingIcon->setValue(loading);
mEstateOwnerText->setValue(loading);
mCovenantText->setValue(loading);
@@ -302,9 +304,9 @@ void LLPanelPlaceProfile::processParcelInfo(const LLParcelData& parcel_data)
}
// virtual
-void LLPanelPlaceProfile::handleVisibilityChange(BOOL new_visibility)
+void LLPanelPlaceProfile::onVisibilityChange(BOOL new_visibility)
{
- LLPanel::handleVisibilityChange(new_visibility);
+ LLPanel::onVisibilityChange(new_visibility);
LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance();
if (!parcel_mgr)
@@ -348,6 +350,7 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel,
mParcelRatingIcon->setValue(icon_m);
mRegionRatingIcon->setValue(icon_m);
+ mEstateRatingIcon->setValue(icon_m);
break;
case SIM_ACCESS_ADULT:
@@ -355,6 +358,7 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel,
mParcelRatingIcon->setValue(icon_r);
mRegionRatingIcon->setValue(icon_r);
+ mEstateRatingIcon->setValue(icon_r);
break;
default:
@@ -362,6 +366,7 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel,
mParcelRatingIcon->setValue(icon_pg);
mRegionRatingIcon->setValue(icon_pg);
+ mEstateRatingIcon->setValue(icon_pg);
}
std::string rating = LLViewerRegion::accessToString(sim_access);
@@ -483,8 +488,9 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel,
gCacheName->getGroup(parcel->getGroupID(),
boost::bind(&LLPanelPlaceInfo::onNameCache, mRegionGroupText, _2));
- gCacheName->getGroup(parcel->getGroupID(),
- boost::bind(&LLPanelPlaceInfo::onNameCache, mParcelOwner, _2));
+ std::string owner =
+ LLSLURL("group", parcel->getGroupID(), "inspect").getSLURLString();
+ mParcelOwner->setText(owner);
}
else
{
diff --git a/indra/newview/llpanelplaceprofile.h b/indra/newview/llpanelplaceprofile.h
index f4c6145881..4547e14b2e 100755
--- a/indra/newview/llpanelplaceprofile.h
+++ b/indra/newview/llpanelplaceprofile.h
@@ -38,7 +38,7 @@ class LLPanelPlaceProfile : public LLPanelPlaceInfo
public:
LLPanelPlaceProfile();
/*virtual*/ ~LLPanelPlaceProfile();
-
+
/*virtual*/ BOOL postBuild();
/*virtual*/ void resetLocation();
@@ -47,7 +47,7 @@ public:
/*virtual*/ void processParcelInfo(const LLParcelData& parcel_data);
- /*virtual*/ void handleVisibilityChange(BOOL new_visibility);
+ /*virtual*/ void onVisibilityChange(BOOL new_visibility);
// Displays information about the currently selected parcel
// without sending a request to the server.
@@ -103,6 +103,7 @@ private:
LLTextBox* mEstateNameText;
LLTextBox* mEstateRatingText;
+ LLIconCtrl* mEstateRatingIcon;
LLTextBox* mEstateOwnerText;
LLTextEditor* mCovenantText;
diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp
index 499b9ab62e..2be96b9b78 100755
--- a/indra/newview/llpanelplaces.cpp
+++ b/indra/newview/llpanelplaces.cpp
@@ -168,8 +168,7 @@ public:
protected:
/*virtual*/ void done()
{
- mPlaces->showAddedLandmarkInfo(mAdded);
- mAdded.clear();
+ mPlaces->showAddedLandmarkInfo(gInventory.getAddedIDs());
}
private:
@@ -217,10 +216,10 @@ public:
LLRemoteParcelInfoProcessor::getInstance()->sendParcelInfoRequest(parcel_id);
}
}
- /*virtual*/ void setErrorStatus(U32 status, const std::string& reason)
+ /*virtual*/ void setErrorStatus(S32 status, const std::string& reason)
{
- llerrs << "Can't complete remote parcel request. Http Status: "
- << status << ". Reason : " << reason << llendl;
+ LL_ERRS() << "Can't complete remote parcel request. Http Status: "
+ << status << ". Reason : " << reason << LL_ENDL;
}
private:
@@ -308,13 +307,13 @@ BOOL LLPanelPlaces::postBuild()
mPlaceMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_place.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
if (!mPlaceMenu)
{
- llwarns << "Error loading Place menu" << llendl;
+ LL_WARNS() << "Error loading Place menu" << LL_ENDL;
}
mLandmarkMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_landmark.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
if (!mLandmarkMenu)
{
- llwarns << "Error loading Landmark menu" << llendl;
+ LL_WARNS() << "Error loading Landmark menu" << LL_ENDL;
}
mTabContainer = getChild<LLTabContainer>("Places Tabs");
@@ -614,7 +613,7 @@ void LLPanelPlaces::onTeleportButtonClicked()
{
if (mItem.isNull())
{
- llwarns << "NULL landmark item" << llendl;
+ LL_WARNS() << "NULL landmark item" << LL_ENDL;
llassert(mItem.notNull());
return;
}
@@ -902,7 +901,7 @@ void LLPanelPlaces::onOverflowMenuItemClicked(const LLSD& param)
favorites_id,
std::string(),
LLPointer<LLInventoryCallback>(NULL));
- llinfos << "Copied inventory item #" << mItem->getUUID() << " to favorites." << llendl;
+ LL_INFOS() << "Copied inventory item #" << mItem->getUUID() << " to favorites." << LL_ENDL;
}
}
}
@@ -998,9 +997,9 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible)
}
// virtual
-void LLPanelPlaces::handleVisibilityChange(BOOL new_visibility)
+void LLPanelPlaces::onVisibilityChange(BOOL new_visibility)
{
- LLPanel::handleVisibilityChange(new_visibility);
+ LLPanel::onVisibilityChange(new_visibility);
if (!new_visibility && mPlaceInfoType == AGENT_INFO_TYPE)
{
@@ -1100,9 +1099,9 @@ void LLPanelPlaces::changedGlobalPos(const LLVector3d &global_pos)
updateVerbs();
}
-void LLPanelPlaces::showAddedLandmarkInfo(const uuid_vec_t& items)
+void LLPanelPlaces::showAddedLandmarkInfo(const uuid_set_t& items)
{
- for (uuid_vec_t::const_iterator item_iter = items.begin();
+ for (uuid_set_t::const_iterator item_iter = items.begin();
item_iter != items.end();
++item_iter)
{
diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h
index 85bdc2c4e1..c3d1b9bc53 100755
--- a/indra/newview/llpanelplaces.h
+++ b/indra/newview/llpanelplaces.h
@@ -69,7 +69,7 @@ public:
void changedGlobalPos(const LLVector3d &global_pos);
// Opens landmark info panel when agent creates or receives landmark.
- void showAddedLandmarkInfo(const uuid_vec_t& items);
+ void showAddedLandmarkInfo(const uuid_set_t& items);
void setItem(LLInventoryItem* item);
@@ -102,7 +102,7 @@ private:
void togglePickPanel(BOOL visible);
void togglePlaceInfoPanel(BOOL visible);
- /*virtual*/ void handleVisibilityChange(BOOL new_visibility);
+ /*virtual*/ void onVisibilityChange(BOOL new_visibility);
void updateVerbs();
diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp
index 9504f22a1d..7c0e448a99 100755
--- a/indra/newview/llpanelprimmediacontrols.cpp
+++ b/indra/newview/llpanelprimmediacontrols.cpp
@@ -830,7 +830,7 @@ bool LLPanelPrimMediaControls::isMouseOver()
if(hit_child && hit_child->getVisible())
{
// This was useful for debugging both coordinate translation and view hieararchy problems...
- // llinfos << "mouse coords: " << x << ", " << y << " hit child " << hit_child->getName() << llendl;
+ // LL_INFOS() << "mouse coords: " << x << ", " << y << " hit child " << hit_child->getName() << LL_ENDL;
// This will be a direct child of the LLLayoutStack, which should be a layout_panel.
// These may not shown/hidden by the logic in updateShape(), so we need to do another hit test on the children of the layout panel,
@@ -841,7 +841,7 @@ bool LLPanelPrimMediaControls::isMouseOver()
if(hit_child_2 && hit_child_2->getVisible())
{
// This was useful for debugging both coordinate translation and view hieararchy problems...
- // llinfos << " mouse coords: " << x << ", " << y << " hit child 2 " << hit_child_2->getName() << llendl;
+ // LL_INFOS() << " mouse coords: " << x << ", " << y << " hit child 2 " << hit_child_2->getName() << LL_ENDL;
result = true;
}
}
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index 5acc98904b..f91c4110c0 100755
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -38,6 +38,7 @@
#include "llviewernetwork.h"
#include "llmutelist.h"
#include "llpanelblockedlist.h"
+#include "llweb.h"
static const std::string PANEL_PICKS = "panel_picks";
@@ -71,7 +72,7 @@ public:
{
if (params.size() < 1) return false;
std::string agent_name = params[0];
- llinfos << "Profile, agent_name " << agent_name << llendl;
+ LL_INFOS() << "Profile, agent_name " << agent_name << LL_ENDL;
std::string url = getProfileURL(agent_name);
LLWeb::loadURLInternal(url);
@@ -231,7 +232,7 @@ bool LLPanelProfile::ChildStack::pop()
{
if (mStack.size() == 0)
{
- llwarns << "Empty stack" << llendl;
+ LL_WARNS() << "Empty stack" << LL_ENDL;
llassert(mStack.size() == 0);
return false;
}
@@ -270,7 +271,7 @@ void LLPanelProfile::ChildStack::postParentReshape()
for (view_list_t::const_iterator list_it = vlist.begin(); list_it != vlist.end(); ++list_it)
{
LLView* viewp = *list_it;
- lldebugs << "removing " << viewp->getName() << llendl;
+ LL_DEBUGS() << "removing " << viewp->getName() << LL_ENDL;
mParent->removeChild(viewp);
}
}
@@ -279,7 +280,7 @@ void LLPanelProfile::ChildStack::postParentReshape()
void LLPanelProfile::ChildStack::dump()
{
unsigned lvl = 0;
- lldebugs << "child stack dump:" << llendl;
+ LL_DEBUGS() << "child stack dump:" << LL_ENDL;
for (stack_t::const_iterator stack_it = mStack.begin(); stack_it != mStack.end(); ++stack_it, ++lvl)
{
std::ostringstream dbg_line;
@@ -289,7 +290,7 @@ void LLPanelProfile::ChildStack::dump()
{
dbg_line << " " << (*list_it)->getName();
}
- lldebugs << dbg_line.str() << llendl;
+ LL_DEBUGS() << dbg_line.str() << LL_ENDL;
}
}
@@ -434,7 +435,7 @@ void LLPanelProfile::closePanel(LLPanel* panel)
}
else
{
- llwarns << "No underlying panel to focus." << llendl;
+ LL_WARNS() << "No underlying panel to focus." << LL_ENDL;
}
}
}
diff --git a/indra/newview/llpanelsnapshot.cpp b/indra/newview/llpanelsnapshot.cpp
index 2f29e758c6..56569e3207 100755
--- a/indra/newview/llpanelsnapshot.cpp
+++ b/indra/newview/llpanelsnapshot.cpp
@@ -65,8 +65,6 @@ void LLPanelSnapshot::onOpen(const LLSD& key)
{
LLFloaterSnapshot::getInstance()->notify(LLSD().with("image-format-change", true));
}
-
- updateCustomResControls();
}
LLFloaterSnapshot::ESnapshotFormat LLPanelSnapshot::getImageFormat() const
@@ -77,11 +75,6 @@ LLFloaterSnapshot::ESnapshotFormat LLPanelSnapshot::getImageFormat() const
void LLPanelSnapshot::enableControls(BOOL enable)
{
setCtrlsEnabled(enable);
- if (enable)
- {
- // Make sure only relevant controls are enabled/shown.
- updateCustomResControls();
- }
}
LLSpinCtrl* LLPanelSnapshot::getWidthSpinner()
@@ -114,23 +107,13 @@ LLSideTrayPanelContainer* LLPanelSnapshot::getParentContainer()
LLSideTrayPanelContainer* parent = dynamic_cast<LLSideTrayPanelContainer*>(getParent());
if (!parent)
{
- llwarns << "Cannot find panel container" << llendl;
+ LL_WARNS() << "Cannot find panel container" << LL_ENDL;
return NULL;
}
return parent;
}
-// virtual
-void LLPanelSnapshot::updateCustomResControls()
-{
- // Only show width/height spinners and the aspect ratio checkbox
- // when a custom resolution is chosen.
- LLComboBox* combo = getChild<LLComboBox>(getImageSizeComboName());
- const bool show = combo->getFirstSelectedIndex() == (combo->getItemCount() - 1);
- getChild<LLUICtrl>(getImageSizePanelName())->setVisible(show);
-}
-
void LLPanelSnapshot::updateImageQualityLevel()
{
LLSliderCtrl* quality_slider = getChild<LLSliderCtrl>("image_quality_slider");
@@ -188,8 +171,6 @@ void LLPanelSnapshot::onCustomResolutionCommit()
void LLPanelSnapshot::onResolutionComboCommit(LLUICtrl* ctrl)
{
- updateCustomResControls();
-
LLSD info;
info["combo-res-change"]["control-name"] = ctrl->getName();
LLFloaterSnapshot::getInstance()->notify(info);
diff --git a/indra/newview/llpanelsnapshot.h b/indra/newview/llpanelsnapshot.h
index f3274cf594..42ad798d60 100755
--- a/indra/newview/llpanelsnapshot.h
+++ b/indra/newview/llpanelsnapshot.h
@@ -57,7 +57,6 @@ public:
protected:
LLSideTrayPanelContainer* getParentContainer();
- virtual void updateCustomResControls();
void updateImageQualityLevel();
void goBack(); ///< Switch to the default (Snapshot Options) panel
void cancel();
diff --git a/indra/newview/llpanelsnapshotinventory.cpp b/indra/newview/llpanelsnapshotinventory.cpp
index 47e46a968f..c8a201a5c8 100755
--- a/indra/newview/llpanelsnapshotinventory.cpp
+++ b/indra/newview/llpanelsnapshotinventory.cpp
@@ -49,7 +49,6 @@ public:
/*virtual*/ void onOpen(const LLSD& key);
private:
- /*virtual*/ void updateCustomResControls(); ///< Show/hide custom resolution controls (spinners and checkbox)
/*virtual*/ std::string getWidthSpinnerName() const { return "inventory_snapshot_width"; }
/*virtual*/ std::string getHeightSpinnerName() const { return "inventory_snapshot_height"; }
/*virtual*/ std::string getAspectRatioCBName() const { return "inventory_keep_aspect_check"; }
@@ -73,7 +72,6 @@ BOOL LLPanelSnapshotInventory::postBuild()
{
getChild<LLSpinCtrl>(getWidthSpinnerName())->setAllowEdit(FALSE);
getChild<LLSpinCtrl>(getHeightSpinnerName())->setAllowEdit(FALSE);
- getChild<LLUICtrl>(getAspectRatioCBName())->setVisible(FALSE); // we don't keep aspect ratio for inventory textures
return LLPanelSnapshot::postBuild();
}
@@ -85,17 +83,6 @@ void LLPanelSnapshotInventory::onOpen(const LLSD& key)
}
// virtual
-void LLPanelSnapshotInventory::updateCustomResControls()
-{
- LLComboBox* combo = getChild<LLComboBox>(getImageSizeComboName());
- S32 selected_idx = combo->getFirstSelectedIndex();
- const bool show = selected_idx == (combo->getItemCount() - 1); // Custom selected
-
- getChild<LLUICtrl>(getWidthSpinnerName())->setVisible(show);
- getChild<LLUICtrl>(getHeightSpinnerName())->setVisible(show);
-}
-
-// virtual
void LLPanelSnapshotInventory::updateControls(const LLSD& info)
{
const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true;
diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp
index 455c1c9e5f..0fc9ceec83 100755
--- a/indra/newview/llpanelsnapshotoptions.cpp
+++ b/indra/newview/llpanelsnapshotoptions.cpp
@@ -31,6 +31,10 @@
#include "llsidetraypanelcontainer.h"
#include "llfloatersnapshot.h" // FIXME: create a snapshot model
+#include "llfloaterreg.h"
+#include "llfloaterfacebook.h"
+#include "llfloaterflickr.h"
+#include "llfloatertwitter.h"
/**
* Provides several ways to save a snapshot.
@@ -44,6 +48,7 @@ class LLPanelSnapshotOptions
public:
LLPanelSnapshotOptions();
~LLPanelSnapshotOptions();
+ /*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
/*virtual*/ void onEconomyDataChange() { updateUploadCost(); }
@@ -54,6 +59,9 @@ private:
void onSaveToEmail();
void onSaveToInventory();
void onSaveToComputer();
+ void onSendToFacebook();
+ void onSendToTwitter();
+ void onSendToFlickr();
};
static LLPanelInjector<LLPanelSnapshotOptions> panel_class("llpanelsnapshotoptions");
@@ -64,7 +72,9 @@ LLPanelSnapshotOptions::LLPanelSnapshotOptions()
mCommitCallbackRegistrar.add("Snapshot.SaveToEmail", boost::bind(&LLPanelSnapshotOptions::onSaveToEmail, this));
mCommitCallbackRegistrar.add("Snapshot.SaveToInventory", boost::bind(&LLPanelSnapshotOptions::onSaveToInventory, this));
mCommitCallbackRegistrar.add("Snapshot.SaveToComputer", boost::bind(&LLPanelSnapshotOptions::onSaveToComputer, this));
-
+ mCommitCallbackRegistrar.add("Snapshot.SendToFacebook", boost::bind(&LLPanelSnapshotOptions::onSendToFacebook, this));
+ mCommitCallbackRegistrar.add("Snapshot.SendToTwitter", boost::bind(&LLPanelSnapshotOptions::onSendToTwitter, this));
+ mCommitCallbackRegistrar.add("Snapshot.SendToFlickr", boost::bind(&LLPanelSnapshotOptions::onSendToFlickr, this));
LLGlobalEconomy::Singleton::getInstance()->addObserver(this);
}
@@ -74,6 +84,12 @@ LLPanelSnapshotOptions::~LLPanelSnapshotOptions()
}
// virtual
+BOOL LLPanelSnapshotOptions::postBuild()
+{
+ return LLPanel::postBuild();
+}
+
+// virtual
void LLPanelSnapshotOptions::onOpen(const LLSD& key)
{
updateUploadCost();
@@ -90,7 +106,7 @@ void LLPanelSnapshotOptions::openPanel(const std::string& panel_name)
LLSideTrayPanelContainer* parent = dynamic_cast<LLSideTrayPanelContainer*>(getParent());
if (!parent)
{
- llwarns << "Cannot find panel container" << llendl;
+ LL_WARNS() << "Cannot find panel container" << LL_ENDL;
return;
}
@@ -118,3 +134,39 @@ void LLPanelSnapshotOptions::onSaveToComputer()
{
openPanel("panel_snapshot_local");
}
+
+void LLPanelSnapshotOptions::onSendToFacebook()
+{
+ LLFloaterReg::hideInstance("snapshot");
+
+ LLFloaterFacebook* facebook_floater = dynamic_cast<LLFloaterFacebook*>(LLFloaterReg::getInstance("facebook"));
+ if (facebook_floater)
+ {
+ facebook_floater->showPhotoPanel();
+ }
+ LLFloaterReg::showInstance("facebook");
+}
+
+void LLPanelSnapshotOptions::onSendToTwitter()
+{
+ LLFloaterReg::hideInstance("snapshot");
+
+ LLFloaterTwitter* twitter_floater = dynamic_cast<LLFloaterTwitter*>(LLFloaterReg::getInstance("twitter"));
+ if (twitter_floater)
+ {
+ twitter_floater->showPhotoPanel();
+ }
+ LLFloaterReg::showInstance("twitter");
+}
+
+void LLPanelSnapshotOptions::onSendToFlickr()
+{
+ LLFloaterReg::hideInstance("snapshot");
+
+ LLFloaterFlickr* flickr_floater = dynamic_cast<LLFloaterFlickr*>(LLFloaterReg::getInstance("flickr"));
+ if (flickr_floater)
+ {
+ flickr_floater->showPhotoPanel();
+ }
+ LLFloaterReg::showInstance("flickr");
+}
diff --git a/indra/newview/llpanelsnapshotpostcard.cpp b/indra/newview/llpanelsnapshotpostcard.cpp
index aa109e9a51..8e37b1418c 100755
--- a/indra/newview/llpanelsnapshotpostcard.cpp
+++ b/indra/newview/llpanelsnapshotpostcard.cpp
@@ -72,7 +72,6 @@ private:
void onMsgFormFocusRecieved();
void onFormatComboCommit(LLUICtrl* ctrl);
void onQualitySliderCommit(LLUICtrl* ctrl);
- void onTabButtonPress(S32 btn_idx);
void onSend();
bool mHasFirstMsgFocus;
@@ -86,8 +85,6 @@ LLPanelSnapshotPostcard::LLPanelSnapshotPostcard()
{
mCommitCallbackRegistrar.add("Postcard.Send", boost::bind(&LLPanelSnapshotPostcard::onSend, this));
mCommitCallbackRegistrar.add("Postcard.Cancel", boost::bind(&LLPanelSnapshotPostcard::cancel, this));
- mCommitCallbackRegistrar.add("Postcard.Message", boost::bind(&LLPanelSnapshotPostcard::onTabButtonPress, this, 0));
- mCommitCallbackRegistrar.add("Postcard.Settings", boost::bind(&LLPanelSnapshotPostcard::onTabButtonPress, this, 1));
}
@@ -108,8 +105,6 @@ BOOL LLPanelSnapshotPostcard::postBuild()
getChild<LLUICtrl>("image_quality_slider")->setCommitCallback(boost::bind(&LLPanelSnapshotPostcard::onQualitySliderCommit, this, _1));
- getChild<LLButton>("message_btn")->setToggleState(TRUE);
-
return LLPanelSnapshot::postBuild();
}
@@ -218,27 +213,6 @@ void LLPanelSnapshotPostcard::onQualitySliderCommit(LLUICtrl* ctrl)
LLFloaterSnapshot::getInstance()->notify(info); // updates the "SnapshotQuality" setting
}
-void LLPanelSnapshotPostcard::onTabButtonPress(S32 btn_idx)
-{
- LLButton* buttons[2] = {
- getChild<LLButton>("message_btn"),
- getChild<LLButton>("settings_btn"),
- };
-
- // Switch between Message and Settings tabs.
- LLButton* clicked_btn = buttons[btn_idx];
- LLButton* other_btn = buttons[!btn_idx];
- LLSideTrayPanelContainer* container =
- getChild<LLSideTrayPanelContainer>("postcard_panel_container");
-
- container->selectTab(clicked_btn->getToggleState() ? btn_idx : !btn_idx);
- //clicked_btn->setEnabled(FALSE);
- other_btn->toggleState();
- //other_btn->setEnabled(TRUE);
-
- lldebugs << "Button #" << btn_idx << " (" << clicked_btn->getName() << ") clicked" << llendl;
-}
-
void LLPanelSnapshotPostcard::onSend()
{
// Validate input.
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp
index 9c380f63bd..3de9dc2f80 100755
--- a/indra/newview/llpanelteleporthistory.cpp
+++ b/indra/newview/llpanelteleporthistory.cpp
@@ -45,6 +45,7 @@
#include "llviewermenu.h"
#include "lllandmarkactions.h"
#include "llclipboard.h"
+#include "lltrans.h"
// Maximum number of items that can be added to a list in one pass.
// Used to limit time spent for items list update per frame.
@@ -55,7 +56,8 @@ static const std::string COLLAPSED_BY_USER = "collapsed_by_user";
class LLTeleportHistoryFlatItem : public LLPanel
{
public:
- LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string &region_name, const std::string &hl);
+ LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string &region_name,
+ LLDate date, const std::string &hl);
virtual ~LLTeleportHistoryFlatItem();
virtual BOOL postBuild();
@@ -66,8 +68,11 @@ public:
void setIndex(S32 index) { mIndex = index; }
const std::string& getRegionName() { return mRegionName;}
void setRegionName(const std::string& name);
+ void setDate(LLDate date);
void setHighlightedText(const std::string& text);
void updateTitle();
+ void updateTimestamp();
+ std::string getTimestamp();
/*virtual*/ void setValue(const LLSD& value);
@@ -84,12 +89,14 @@ private:
LLButton* mProfileBtn;
LLTextBox* mTitle;
+ LLTextBox* mTimeTextBox;
LLTeleportHistoryPanel::ContextMenu *mContextMenu;
S32 mIndex;
std::string mRegionName;
std::string mHighlight;
+ LLDate mDate;
LLRootHandle<LLTeleportHistoryFlatItem> mItemHandle;
};
@@ -121,11 +128,13 @@ private:
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
-LLTeleportHistoryFlatItem::LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string &region_name, const std::string &hl)
+LLTeleportHistoryFlatItem::LLTeleportHistoryFlatItem(S32 index, LLTeleportHistoryPanel::ContextMenu *context_menu, const std::string &region_name,
+ LLDate date, const std::string &hl)
: LLPanel(),
mIndex(index),
mContextMenu(context_menu),
mRegionName(region_name),
+ mDate(date),
mHighlight(hl)
{
buildFromFile( "panel_teleport_history_item.xml");
@@ -140,11 +149,14 @@ BOOL LLTeleportHistoryFlatItem::postBuild()
{
mTitle = getChild<LLTextBox>("region");
+ mTimeTextBox = getChild<LLTextBox>("timestamp");
+
mProfileBtn = getChild<LLButton>("profile_btn");
mProfileBtn->setClickedCallback(boost::bind(&LLTeleportHistoryFlatItem::onProfileBtnClick, this));
updateTitle();
+ updateTimestamp();
return true;
}
@@ -179,6 +191,38 @@ void LLTeleportHistoryFlatItem::setRegionName(const std::string& name)
mRegionName = name;
}
+void LLTeleportHistoryFlatItem::setDate(LLDate date)
+{
+ mDate = date;
+}
+
+std::string LLTeleportHistoryFlatItem::getTimestamp()
+{
+ const LLDate &date = mDate;
+ std::string timestamp = "";
+
+ LLDate now = LLDate::now();
+ S32 now_year, now_month, now_day, now_hour, now_min, now_sec;
+ now.split(&now_year, &now_month, &now_day, &now_hour, &now_min, &now_sec);
+
+ const S32 seconds_in_day = 24 * 60 * 60;
+ S32 seconds_today = now_hour * 60 * 60 + now_min * 60 + now_sec;
+ S32 time_diff = (S32) now.secondsSinceEpoch() - (S32) date.secondsSinceEpoch();
+
+ // Only show timestamp for today and yesterday
+ if(time_diff < seconds_today + seconds_in_day)
+ {
+ timestamp = "[" + LLTrans::getString("TimeHour12")+"]:["
+ + LLTrans::getString("TimeMin")+"] ["+ LLTrans::getString("TimeAMPM")+"]";
+ LLSD substitution;
+ substitution["datetime"] = (S32) date.secondsSinceEpoch();
+ LLStringUtil::format(timestamp, substitution);
+ }
+
+ return timestamp;
+
+}
+
void LLTeleportHistoryFlatItem::updateTitle()
{
static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", LLColor4U(255, 255, 255));
@@ -190,6 +234,17 @@ void LLTeleportHistoryFlatItem::updateTitle()
mHighlight);
}
+void LLTeleportHistoryFlatItem::updateTimestamp()
+{
+ static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", LLColor4U(255, 255, 255));
+
+ LLTextUtil::textboxSetHighlightedVal(
+ mTimeTextBox,
+ LLStyle::Params().color(sFgColor),
+ getTimestamp(),
+ mHighlight);
+}
+
void LLTeleportHistoryFlatItem::onMouseEnter(S32 x, S32 y, MASK mask)
{
getChildView("hovered_icon")->setVisible( true);
@@ -248,9 +303,11 @@ LLTeleportHistoryFlatItemStorage::getFlatItemForPersistentItem (
{
item->setIndex(cur_item_index);
item->setRegionName(persistent_item.mTitle);
+ item->setDate(persistent_item.mDate);
item->setHighlightedText(hl);
item->setVisible(TRUE);
item->updateTitle();
+ item->updateTimestamp();
}
else
{
@@ -264,6 +321,7 @@ LLTeleportHistoryFlatItemStorage::getFlatItemForPersistentItem (
item = new LLTeleportHistoryFlatItem(cur_item_index,
context_menu,
persistent_item.mTitle,
+ persistent_item.mDate,
hl);
mItems.push_back(item->getItemHandle());
}
@@ -341,6 +399,7 @@ LLContextMenu* LLTeleportHistoryPanel::ContextMenu::createMenu()
registrar.add("TeleportHistory.CopyToClipboard",boost::bind(&LLTeleportHistoryPanel::ContextMenu::onCopyToClipboard, this));
// create the context menu from the XUI
+ llassert(LLMenuGL::sMenuContainer != NULL);
return LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>(
"menu_teleport_history_item.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance());
}
@@ -421,7 +480,7 @@ BOOL LLTeleportHistoryPanel::postBuild()
// All accordion tabs are collapsed initially
setAccordionCollapsedByUser(tab, true);
- mItemContainers.put(tab);
+ mItemContainers.push_back(tab);
LLFlatListView* fl = getFlatListViewFromTab(tab);
if (fl)
@@ -437,14 +496,14 @@ BOOL LLTeleportHistoryPanel::postBuild()
// Open first 2 accordion tabs
if (mItemContainers.size() > 1)
{
- LLAccordionCtrlTab* tab = mItemContainers.get(mItemContainers.size() - 1);
+ LLAccordionCtrlTab* tab = mItemContainers.at(mItemContainers.size() - 1);
tab->setDisplayChildren(true);
setAccordionCollapsedByUser(tab, false);
}
if (mItemContainers.size() > 2)
{
- LLAccordionCtrlTab* tab = mItemContainers.get(mItemContainers.size() - 2);
+ LLAccordionCtrlTab* tab = mItemContainers.at(mItemContainers.size() - 2);
tab->setDisplayChildren(true);
setAccordionCollapsedByUser(tab, false);
}
@@ -688,7 +747,7 @@ void LLTeleportHistoryPanel::refresh()
tab_idx = mItemContainers.size() - 1 - tab_idx;
if (tab_idx >= 0)
{
- LLAccordionCtrlTab* tab = mItemContainers.get(tab_idx);
+ LLAccordionCtrlTab* tab = mItemContainers.at(tab_idx);
tab->setVisible(true);
// Expand all accordion tabs when filtering
@@ -722,7 +781,7 @@ void LLTeleportHistoryPanel::refresh()
mCurrentItem,
filter_string);
if ( !curr_flat_view->addItem(item, LLUUID::null, ADD_BOTTOM, false) )
- llerrs << "Couldn't add flat item to teleport history." << llendl;
+ LL_ERRS() << "Couldn't add flat item to teleport history." << LL_ENDL;
if (mLastSelectedItemIndex == mCurrentItem)
curr_flat_view->selectItem(item, true);
}
@@ -735,7 +794,7 @@ void LLTeleportHistoryPanel::refresh()
for (S32 n = mItemContainers.size() - 1; n >= 0; --n)
{
- LLAccordionCtrlTab* tab = mItemContainers.get(n);
+ LLAccordionCtrlTab* tab = mItemContainers.at(n);
LLFlatListView* fv = getFlatListViewFromTab(tab);
if (fv)
{
@@ -797,7 +856,7 @@ void LLTeleportHistoryPanel::replaceItem(S32 removed_index)
// to point to the right item in LLTeleportHistoryStorage
for (S32 tab_idx = mItemContainers.size() - 1; tab_idx >= 0; --tab_idx)
{
- LLAccordionCtrlTab* tab = mItemContainers.get(tab_idx);
+ LLAccordionCtrlTab* tab = mItemContainers.at(tab_idx);
if (!tab->getVisible())
continue;
@@ -851,7 +910,7 @@ void LLTeleportHistoryPanel::showTeleportHistory()
for (S32 n = mItemContainers.size() - 1; n >= 0; --n)
{
- LLAccordionCtrlTab* tab = mItemContainers.get(n);
+ LLAccordionCtrlTab* tab = mItemContainers.at(n);
if (tab)
{
tab->setVisible(false);
@@ -878,7 +937,7 @@ void LLTeleportHistoryPanel::handleItemSelect(LLFlatListView* selected)
for (S32 n = 0; n < tabs_cnt; n++)
{
- LLAccordionCtrlTab* tab = mItemContainers.get(n);
+ LLAccordionCtrlTab* tab = mItemContainers.at(n);
if (!tab->getVisible())
continue;
@@ -935,6 +994,7 @@ void LLTeleportHistoryPanel::onAccordionTabRightClick(LLView *view, S32 x, S32 y
registrar.add("TeleportHistory.TabClose", boost::bind(&LLTeleportHistoryPanel::onAccordionTabClose, this, tab));
// create the context menu from the XUI
+ llassert(LLMenuGL::sMenuContainer != NULL);
mAccordionTabMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>(
"menu_teleport_history_tab.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance());
@@ -963,7 +1023,7 @@ void LLTeleportHistoryPanel::onExpandAllFolders()
for (S32 n = 0; n < tabs_cnt; n++)
{
- mItemContainers.get(n)->setDisplayChildren(true);
+ mItemContainers.at(n)->setDisplayChildren(true);
}
mHistoryAccordion->arrange();
}
@@ -974,7 +1034,7 @@ void LLTeleportHistoryPanel::onCollapseAllFolders()
for (S32 n = 0; n < tabs_cnt; n++)
{
- mItemContainers.get(n)->setDisplayChildren(false);
+ mItemContainers.at(n)->setDisplayChildren(false);
}
mHistoryAccordion->arrange();
@@ -1029,7 +1089,7 @@ bool LLTeleportHistoryPanel::isActionEnabled(const LLSD& userdata) const
for (S32 n = 0; n < tabs_cnt; n++)
{
- LLAccordionCtrlTab* tab = mItemContainers.get(n);
+ LLAccordionCtrlTab* tab = mItemContainers.at(n);
if (!tab->getVisible())
continue;
diff --git a/indra/newview/llpanelteleporthistory.h b/indra/newview/llpanelteleporthistory.h
index 47b607a2f4..b88861c5c6 100755
--- a/indra/newview/llpanelteleporthistory.h
+++ b/indra/newview/llpanelteleporthistory.h
@@ -112,7 +112,7 @@ private:
bool mDirty;
S32 mCurrentItem;
- typedef LLDynamicArray<LLAccordionCtrlTab*> item_containers_t;
+ typedef std::vector<LLAccordionCtrlTab*> item_containers_t;
item_containers_t mItemContainers;
ContextMenu mContextMenu;
diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp
index 0d09f0bbfc..109013498e 100755
--- a/indra/newview/llpaneltopinfobar.cpp
+++ b/indra/newview/llpaneltopinfobar.cpp
@@ -169,7 +169,7 @@ BOOL LLPanelTopInfoBar::postBuild()
mParcelMgrConnection = gAgent.addParcelChangedCallback(
boost::bind(&LLPanelTopInfoBar::onAgentParcelChange, this));
- setVisibleCallback(boost::bind(&LLPanelTopInfoBar::onVisibilityChange, this, _2));
+ setVisibleCallback(boost::bind(&LLPanelTopInfoBar::onVisibilityChanged, this, _2));
return TRUE;
}
@@ -186,7 +186,7 @@ void LLPanelTopInfoBar::onNavBarShowParcelPropertiesCtrlChanged()
// when panel is shown, all minimized floaters should be shifted downwards to prevent overlapping of
// PanelTopInfoBar. See EXT-7951.
-void LLPanelTopInfoBar::onVisibilityChange(const LLSD& show)
+void LLPanelTopInfoBar::onVisibilityChanged(const LLSD& show)
{
// this height is used as a vertical offset for ALREADY MINIMIZED floaters
// when PanelTopInfoBar visibility changes
diff --git a/indra/newview/llpaneltopinfobar.h b/indra/newview/llpaneltopinfobar.h
index d58d95be90..f37bd9c048 100755
--- a/indra/newview/llpaneltopinfobar.h
+++ b/indra/newview/llpaneltopinfobar.h
@@ -57,7 +57,7 @@ public:
/**
* Called when the top info bar gets shown or hidden
*/
- void onVisibilityChange(const LLSD& show);
+ void onVisibilityChanged(const LLSD& show);
boost::signals2::connection setResizeCallback( const resize_signal_t::slot_type& cb );
diff --git a/indra/newview/llpanelvoicedevicesettings.cpp b/indra/newview/llpanelvoicedevicesettings.cpp
index 6f0a1624a7..3946d6a63b 100755
--- a/indra/newview/llpanelvoicedevicesettings.cpp
+++ b/indra/newview/llpanelvoicedevicesettings.cpp
@@ -85,7 +85,7 @@ BOOL LLPanelVoiceDeviceSettings::postBuild()
}
// virtual
-void LLPanelVoiceDeviceSettings::handleVisibilityChange ( BOOL new_visibility )
+void LLPanelVoiceDeviceSettings::onVisibilityChange ( BOOL new_visibility )
{
if (new_visibility)
{
diff --git a/indra/newview/llpanelvoicedevicesettings.h b/indra/newview/llpanelvoicedevicesettings.h
index ba3bcad0dc..83464f476a 100755
--- a/indra/newview/llpanelvoicedevicesettings.h
+++ b/indra/newview/llpanelvoicedevicesettings.h
@@ -44,7 +44,7 @@ public:
void initialize();
void cleanup();
- /*virtual*/ void handleVisibilityChange ( BOOL new_visibility );
+ /*virtual*/ void onVisibilityChange ( BOOL new_visibility );
void setUseTuningMode(bool use) { mUseTuningMode = use; };
diff --git a/indra/newview/llpanelvoiceeffect.cpp b/indra/newview/llpanelvoiceeffect.cpp
index 7da553801a..a3f0e25ef0 100755
--- a/indra/newview/llpanelvoiceeffect.cpp
+++ b/indra/newview/llpanelvoiceeffect.cpp
@@ -35,6 +35,7 @@
#include "lltrans.h"
#include "lltransientfloatermgr.h"
#include "llvoiceclient.h"
+#include "llweb.h"
static LLPanelInjector<LLPanelVoiceEffect> t_panel_voice_effect("panel_voice_effect");
diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp
index a1d60b5b16..f1f87e212d 100755
--- a/indra/newview/llpanelvolume.cpp
+++ b/indra/newview/llpanelvolume.cpp
@@ -620,7 +620,7 @@ void LLPanelVolume::sendIsLight()
BOOL value = getChild<LLUICtrl>("Light Checkbox Ctrl")->getValue();
volobjp->setIsLight(value);
- llinfos << "update light sent" << llendl;
+ LL_INFOS() << "update light sent" << LL_ENDL;
}
void LLPanelVolume::sendIsFlexible()
@@ -652,7 +652,7 @@ void LLPanelVolume::sendIsFlexible()
LLSelectMgr::getInstance()->selectionUpdatePhantom(volobjp->flagPhantom());
}
- llinfos << "update flexible sent" << llendl;
+ LL_INFOS() << "update flexible sent" << LL_ENDL;
}
void LLPanelVolume::sendPhysicsShapeType(LLUICtrl* ctrl, void* userdata)
diff --git a/indra/newview/llpanelvolumepulldown.cpp b/indra/newview/llpanelvolumepulldown.cpp
index aea7b33d7f..cb00f742cc 100755
--- a/indra/newview/llpanelvolumepulldown.cpp
+++ b/indra/newview/llpanelvolumepulldown.cpp
@@ -87,7 +87,7 @@ void LLPanelVolumePulldown::onMouseLeave(S32 x, S32 y, MASK mask)
}
/*virtual*/
-void LLPanelVolumePulldown::handleVisibilityChange ( BOOL new_visibility )
+void LLPanelVolumePulldown::onVisibilityChange ( BOOL new_visibility )
{
if (new_visibility)
{
diff --git a/indra/newview/llpanelvolumepulldown.h b/indra/newview/llpanelvolumepulldown.h
index 0d86e6bd28..b843fab756 100755
--- a/indra/newview/llpanelvolumepulldown.h
+++ b/indra/newview/llpanelvolumepulldown.h
@@ -42,7 +42,7 @@ class LLPanelVolumePulldown : public LLPanel
/*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask);
/*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask);
/*virtual*/ void onTopLost();
- /*virtual*/ void handleVisibilityChange ( BOOL new_visibility );
+ /*virtual*/ void onVisibilityChange ( BOOL new_visibility );
/*virtual*/ BOOL postBuild();
private:
diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp
index edb624e3aa..75e0ed3741 100755
--- a/indra/newview/llpanelwearing.cpp
+++ b/indra/newview/llpanelwearing.cpp
@@ -118,7 +118,7 @@ protected:
if (!item)
{
- llwarns << "Invalid item" << llendl;
+ LL_WARNS() << "Invalid item" << LL_ENDL;
continue;
}
diff --git a/indra/newview/llpatchvertexarray.cpp b/indra/newview/llpatchvertexarray.cpp
index dece2928c0..6e3e375488 100755
--- a/indra/newview/llpatchvertexarray.cpp
+++ b/indra/newview/llpatchvertexarray.cpp
@@ -128,7 +128,7 @@ void LLPatchVertexArray::create(U32 surface_width, U32 patch_width, F32 meters_p
{
// init() and some other things all want to deref these
// pointers, so this is serious.
- llerrs << "mRenderLevelp or mRenderStridep was NULL; we'd crash soon." << llendl;
+ LL_ERRS() << "mRenderLevelp or mRenderStridep was NULL; we'd crash soon." << LL_ENDL;
return;
}
diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp
index c277359133..4977a72dc6 100755
--- a/indra/newview/llpathfindingmanager.cpp
+++ b/indra/newview/llpathfindingmanager.cpp
@@ -103,17 +103,16 @@ LLHTTPRegistration<LLAgentStateChangeNode> gHTTPRegistrationAgentStateChangeNode
class NavMeshStatusResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(NavMeshStatusResponder);
public:
- NavMeshStatusResponder(const std::string &pCapabilityURL, LLViewerRegion *pRegion, bool pIsGetStatusOnly);
+ NavMeshStatusResponder(LLViewerRegion *pRegion, bool pIsGetStatusOnly);
virtual ~NavMeshStatusResponder();
- virtual void result(const LLSD &pContent);
- virtual void errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& pContent);
-
protected:
+ virtual void httpSuccess();
+ virtual void httpFailure();
private:
- std::string mCapabilityURL;
LLViewerRegion *mRegion;
LLUUID mRegionUUID;
bool mIsGetStatusOnly;
@@ -125,17 +124,16 @@ private:
class NavMeshResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(NavMeshResponder);
public:
- NavMeshResponder(const std::string &pCapabilityURL, U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr);
+ NavMeshResponder(U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr);
virtual ~NavMeshResponder();
- virtual void result(const LLSD &pContent);
- virtual void errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& pContent);
-
protected:
+ virtual void httpSuccess();
+ virtual void httpFailure();
private:
- std::string mCapabilityURL;
U32 mNavMeshVersion;
LLPathfindingNavMeshPtr mNavMeshPtr;
};
@@ -146,17 +144,14 @@ private:
class AgentStateResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(AgentStateResponder);
public:
- AgentStateResponder(const std::string &pCapabilityURL);
+ AgentStateResponder();
virtual ~AgentStateResponder();
- virtual void result(const LLSD &pContent);
- virtual void errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& pContent);
-
protected:
-
-private:
- std::string mCapabilityURL;
+ virtual void httpSuccess();
+ virtual void httpFailure();
};
@@ -165,17 +160,16 @@ private:
//---------------------------------------------------------------------------
class NavMeshRebakeResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(NavMeshRebakeResponder);
public:
- NavMeshRebakeResponder(const std::string &pCapabilityURL, LLPathfindingManager::rebake_navmesh_callback_t pRebakeNavMeshCallback);
+ NavMeshRebakeResponder(LLPathfindingManager::rebake_navmesh_callback_t pRebakeNavMeshCallback);
virtual ~NavMeshRebakeResponder();
- virtual void result(const LLSD &pContent);
- virtual void errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& pContent);
-
protected:
+ virtual void httpSuccess();
+ virtual void httpFailure();
private:
- std::string mCapabilityURL;
LLPathfindingManager::rebake_navmesh_callback_t mRebakeNavMeshCallback;
};
@@ -190,11 +184,9 @@ public:
virtual ~LinksetsResponder();
void handleObjectLinksetsResult(const LLSD &pContent);
- void handleObjectLinksetsError(U32 pStatus, const std::string &pReason,
- const LLSD& pContent, const std::string &pURL);
+ void handleObjectLinksetsError();
void handleTerrainLinksetsResult(const LLSD &pContent);
- void handleTerrainLinksetsError(U32 pStatus, const std::string &pReason,
- const LLSD& pContent, const std::string &pURL);
+ void handleTerrainLinksetsError();
protected:
@@ -227,17 +219,16 @@ typedef boost::shared_ptr<LinksetsResponder> LinksetsResponderPtr;
class ObjectLinksetsResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(ObjectLinksetsResponder);
public:
- ObjectLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr);
+ ObjectLinksetsResponder(LinksetsResponderPtr pLinksetsResponsderPtr);
virtual ~ObjectLinksetsResponder();
- virtual void result(const LLSD &pContent);
- virtual void errorWithContent(U32 pStatus, const std::string &pReason, const LLSD& pContent);
-
protected:
+ virtual void httpSuccess();
+ virtual void httpFailure();
private:
- std::string mCapabilityURL;
LinksetsResponderPtr mLinksetsResponsderPtr;
};
@@ -247,17 +238,16 @@ private:
class TerrainLinksetsResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(TerrainLinksetsResponder);
public:
- TerrainLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr);
+ TerrainLinksetsResponder(LinksetsResponderPtr pLinksetsResponsderPtr);
virtual ~TerrainLinksetsResponder();
- virtual void result(const LLSD &pContent);
- virtual void errorWithContent(U32 pStatus, const std::string &pReason, const LLSD& pContent);
-
protected:
+ virtual void httpSuccess();
+ virtual void httpFailure();
private:
- std::string mCapabilityURL;
LinksetsResponderPtr mLinksetsResponsderPtr;
};
@@ -267,17 +257,16 @@ private:
class CharactersResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(TerrainLinksetsResponder);
public:
- CharactersResponder(const std::string &pCapabilityURL, LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::object_request_callback_t pCharactersCallback);
+ CharactersResponder(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::object_request_callback_t pCharactersCallback);
virtual ~CharactersResponder();
- virtual void result(const LLSD &pContent);
- virtual void errorWithContent(U32 pStatus, const std::string &pReason, const LLSD& pContent);
-
protected:
+ virtual void httpSuccess();
+ virtual void httpFailure();
private:
- std::string mCapabilityURL;
LLPathfindingManager::request_id_t mRequestId;
LLPathfindingManager::object_request_callback_t mCharactersCallback;
};
@@ -364,7 +353,7 @@ void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion, b
std::string navMeshStatusURL = getNavMeshStatusURLForRegion(pRegion);
llassert(!navMeshStatusURL.empty());
navMeshPtr->handleNavMeshCheckVersion();
- LLHTTPClient::ResponderPtr navMeshStatusResponder = new NavMeshStatusResponder(navMeshStatusURL, pRegion, pIsGetStatusOnly);
+ LLHTTPClient::ResponderPtr navMeshStatusResponder = new NavMeshStatusResponder(pRegion, pIsGetStatusOnly);
LLHTTPClient::get(navMeshStatusURL, navMeshStatusResponder);
}
}
@@ -398,12 +387,12 @@ void LLPathfindingManager::requestGetLinksets(request_id_t pRequestId, object_re
bool doRequestTerrain = isAllowViewTerrainProperties();
LinksetsResponderPtr linksetsResponderPtr(new LinksetsResponder(pRequestId, pLinksetsCallback, true, doRequestTerrain));
- LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(objectLinksetsURL, linksetsResponderPtr);
+ LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(linksetsResponderPtr);
LLHTTPClient::get(objectLinksetsURL, objectLinksetsResponder);
if (doRequestTerrain)
{
- LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(terrainLinksetsURL, linksetsResponderPtr);
+ LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(linksetsResponderPtr);
LLHTTPClient::get(terrainLinksetsURL, terrainLinksetsResponder);
}
}
@@ -447,13 +436,13 @@ void LLPathfindingManager::requestSetLinksets(request_id_t pRequestId, const LLP
if (!objectPostData.isUndefined())
{
- LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(objectLinksetsURL, linksetsResponderPtr);
+ LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(linksetsResponderPtr);
LLHTTPClient::put(objectLinksetsURL, objectPostData, objectLinksetsResponder);
}
if (!terrainPostData.isUndefined())
{
- LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(terrainLinksetsURL, linksetsResponderPtr);
+ LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(linksetsResponderPtr);
LLHTTPClient::put(terrainLinksetsURL, terrainPostData, terrainLinksetsResponder);
}
}
@@ -486,7 +475,7 @@ void LLPathfindingManager::requestGetCharacters(request_id_t pRequestId, object_
{
pCharactersCallback(pRequestId, kRequestStarted, emptyCharacterListPtr);
- LLHTTPClient::ResponderPtr charactersResponder = new CharactersResponder(charactersURL, pRequestId, pCharactersCallback);
+ LLHTTPClient::ResponderPtr charactersResponder = new CharactersResponder(pRequestId, pCharactersCallback);
LLHTTPClient::get(charactersURL, charactersResponder);
}
}
@@ -519,7 +508,7 @@ void LLPathfindingManager::requestGetAgentState()
{
std::string agentStateURL = getAgentStateURLForRegion(currentRegion);
llassert(!agentStateURL.empty());
- LLHTTPClient::ResponderPtr responder = new AgentStateResponder(agentStateURL);
+ LLHTTPClient::ResponderPtr responder = new AgentStateResponder();
LLHTTPClient::get(agentStateURL, responder);
}
}
@@ -543,7 +532,7 @@ void LLPathfindingManager::requestRebakeNavMesh(rebake_navmesh_callback_t pRebak
llassert(!navMeshStatusURL.empty());
LLSD postData;
postData["command"] = "rebuild";
- LLHTTPClient::ResponderPtr responder = new NavMeshRebakeResponder(navMeshStatusURL, pRebakeNavMeshCallback);
+ LLHTTPClient::ResponderPtr responder = new NavMeshRebakeResponder(pRebakeNavMeshCallback);
LLHTTPClient::post(navMeshStatusURL, postData, responder);
}
}
@@ -565,7 +554,7 @@ void LLPathfindingManager::sendRequestGetNavMeshForRegion(LLPathfindingNavMeshPt
else
{
navMeshPtr->handleNavMeshStart(pNavMeshStatus);
- LLHTTPClient::ResponderPtr responder = new NavMeshResponder(navMeshURL, pNavMeshStatus.getVersion(), navMeshPtr);
+ LLHTTPClient::ResponderPtr responder = new NavMeshResponder(pNavMeshStatus.getVersion(), navMeshPtr);
LLSD postData;
LLHTTPClient::post(navMeshURL, postData, responder);
@@ -736,8 +725,8 @@ std::string LLPathfindingManager::getCapabilityURLForRegion(LLViewerRegion *pReg
if (capabilityURL.empty())
{
- llwarns << "cannot find capability '" << pCapabilityName << "' for current region '"
- << ((pRegion != NULL) ? pRegion->getName() : "<null>") << "'" << llendl;
+ LL_WARNS() << "cannot find capability '" << pCapabilityName << "' for current region '"
+ << ((pRegion != NULL) ? pRegion->getName() : "<null>") << "'" << LL_ENDL;
}
return capabilityURL;
@@ -779,9 +768,8 @@ void LLAgentStateChangeNode::post(ResponsePtr pResponse, const LLSD &pContext, c
// NavMeshStatusResponder
//---------------------------------------------------------------------------
-NavMeshStatusResponder::NavMeshStatusResponder(const std::string &pCapabilityURL, LLViewerRegion *pRegion, bool pIsGetStatusOnly)
+NavMeshStatusResponder::NavMeshStatusResponder(LLViewerRegion *pRegion, bool pIsGetStatusOnly)
: LLHTTPClient::Responder(),
- mCapabilityURL(pCapabilityURL),
mRegion(pRegion),
mRegionUUID(),
mIsGetStatusOnly(pIsGetStatusOnly)
@@ -796,15 +784,15 @@ NavMeshStatusResponder::~NavMeshStatusResponder()
{
}
-void NavMeshStatusResponder::result(const LLSD &pContent)
+void NavMeshStatusResponder::httpSuccess()
{
- LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID, pContent);
+ LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID, getContent());
LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion, mIsGetStatusOnly);
}
-void NavMeshStatusResponder::errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& pContent)
+void NavMeshStatusResponder::httpFailure()
{
- llwarns << "NavMeshStatusResponder error [status:" << pStatus << "]: " << pContent << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
LLPathfindingNavMeshStatus navMeshStatus(mRegionUUID);
LLPathfindingManager::getInstance()->handleNavMeshStatusRequest(navMeshStatus, mRegion, mIsGetStatusOnly);
}
@@ -813,9 +801,8 @@ void NavMeshStatusResponder::errorWithContent(U32 pStatus, const std::string& pR
// NavMeshResponder
//---------------------------------------------------------------------------
-NavMeshResponder::NavMeshResponder(const std::string &pCapabilityURL, U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr)
+NavMeshResponder::NavMeshResponder(U32 pNavMeshVersion, LLPathfindingNavMeshPtr pNavMeshPtr)
: LLHTTPClient::Responder(),
- mCapabilityURL(pCapabilityURL),
mNavMeshVersion(pNavMeshVersion),
mNavMeshPtr(pNavMeshPtr)
{
@@ -825,23 +812,23 @@ NavMeshResponder::~NavMeshResponder()
{
}
-void NavMeshResponder::result(const LLSD &pContent)
+void NavMeshResponder::httpSuccess()
{
- mNavMeshPtr->handleNavMeshResult(pContent, mNavMeshVersion);
+ mNavMeshPtr->handleNavMeshResult(getContent(), mNavMeshVersion);
}
-void NavMeshResponder::errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& pContent)
+void NavMeshResponder::httpFailure()
{
- mNavMeshPtr->handleNavMeshError(pStatus, pReason, pContent, mCapabilityURL, mNavMeshVersion);
+ LL_WARNS() << dumpResponse() << LL_ENDL;
+ mNavMeshPtr->handleNavMeshError(mNavMeshVersion);
}
//---------------------------------------------------------------------------
// AgentStateResponder
//---------------------------------------------------------------------------
-AgentStateResponder::AgentStateResponder(const std::string &pCapabilityURL)
+AgentStateResponder::AgentStateResponder()
: LLHTTPClient::Responder()
-, mCapabilityURL(pCapabilityURL)
{
}
@@ -849,17 +836,18 @@ AgentStateResponder::~AgentStateResponder()
{
}
-void AgentStateResponder::result(const LLSD &pContent)
+void AgentStateResponder::httpSuccess()
{
+ const LLSD& pContent = getContent();
llassert(pContent.has(AGENT_STATE_CAN_REBAKE_REGION_FIELD));
llassert(pContent.get(AGENT_STATE_CAN_REBAKE_REGION_FIELD).isBoolean());
BOOL canRebakeRegion = pContent.get(AGENT_STATE_CAN_REBAKE_REGION_FIELD).asBoolean();
LLPathfindingManager::getInstance()->handleAgentState(canRebakeRegion);
}
-void AgentStateResponder::errorWithContent(U32 pStatus, const std::string &pReason, const LLSD& pContent)
+void AgentStateResponder::httpFailure()
{
- llwarns << "AgentStateResponder error [status:" << pStatus << "]: " << pContent << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
LLPathfindingManager::getInstance()->handleAgentState(FALSE);
}
@@ -867,9 +855,8 @@ void AgentStateResponder::errorWithContent(U32 pStatus, const std::string &pReas
//---------------------------------------------------------------------------
// navmesh rebake responder
//---------------------------------------------------------------------------
-NavMeshRebakeResponder::NavMeshRebakeResponder(const std::string &pCapabilityURL, LLPathfindingManager::rebake_navmesh_callback_t pRebakeNavMeshCallback)
+NavMeshRebakeResponder::NavMeshRebakeResponder(LLPathfindingManager::rebake_navmesh_callback_t pRebakeNavMeshCallback)
: LLHTTPClient::Responder(),
- mCapabilityURL(pCapabilityURL),
mRebakeNavMeshCallback(pRebakeNavMeshCallback)
{
}
@@ -878,14 +865,14 @@ NavMeshRebakeResponder::~NavMeshRebakeResponder()
{
}
-void NavMeshRebakeResponder::result(const LLSD &pContent)
+void NavMeshRebakeResponder::httpSuccess()
{
mRebakeNavMeshCallback(true);
}
-void NavMeshRebakeResponder::errorWithContent(U32 pStatus, const std::string &pReason, const LLSD& pContent)
+void NavMeshRebakeResponder::httpFailure()
{
- llwarns << "NavMeshRebakeResponder error [status:" << pStatus << "]: " << pContent << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
mRebakeNavMeshCallback(false);
}
@@ -918,11 +905,9 @@ void LinksetsResponder::handleObjectLinksetsResult(const LLSD &pContent)
}
}
-void LinksetsResponder::handleObjectLinksetsError(U32 pStatus, const std::string &pReason,
- const LLSD& pContent, const std::string &pURL)
+void LinksetsResponder::handleObjectLinksetsError()
{
- llwarns << "LinksetsResponder object linksets error with request to URL '" << pURL << "' [status:"
- << pStatus << "]: " << pContent << llendl;
+ LL_WARNS() << "LinksetsResponder object linksets error" << LL_ENDL;
mObjectMessagingState = kReceivedError;
if (mTerrainMessagingState != kWaiting)
{
@@ -941,11 +926,9 @@ void LinksetsResponder::handleTerrainLinksetsResult(const LLSD &pContent)
}
}
-void LinksetsResponder::handleTerrainLinksetsError(U32 pStatus, const std::string &pReason,
- const LLSD& pContent, const std::string &pURL)
+void LinksetsResponder::handleTerrainLinksetsError()
{
- llwarns << "LinksetsResponder terrain linksets error with request to URL '" << pURL << "' [status:"
- << pStatus << "]: " << pContent << llendl;
+ LL_WARNS() << "LinksetsResponder terrain linksets error" << LL_ENDL;
mTerrainMessagingState = kReceivedError;
if (mObjectMessagingState != kWaiting)
{
@@ -979,9 +962,8 @@ void LinksetsResponder::sendCallback()
// ObjectLinksetsResponder
//---------------------------------------------------------------------------
-ObjectLinksetsResponder::ObjectLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr)
+ObjectLinksetsResponder::ObjectLinksetsResponder(LinksetsResponderPtr pLinksetsResponsderPtr)
: LLHTTPClient::Responder(),
- mCapabilityURL(pCapabilityURL),
mLinksetsResponsderPtr(pLinksetsResponsderPtr)
{
}
@@ -990,23 +972,23 @@ ObjectLinksetsResponder::~ObjectLinksetsResponder()
{
}
-void ObjectLinksetsResponder::result(const LLSD &pContent)
+void ObjectLinksetsResponder::httpSuccess()
{
- mLinksetsResponsderPtr->handleObjectLinksetsResult(pContent);
+ mLinksetsResponsderPtr->handleObjectLinksetsResult(getContent());
}
-void ObjectLinksetsResponder::errorWithContent(U32 pStatus, const std::string &pReason, const LLSD& pContent)
+void ObjectLinksetsResponder::httpFailure()
{
- mLinksetsResponsderPtr->handleObjectLinksetsError(pStatus, pReason, pContent, mCapabilityURL);
+ LL_WARNS() << dumpResponse() << LL_ENDL;
+ mLinksetsResponsderPtr->handleObjectLinksetsError();
}
//---------------------------------------------------------------------------
// TerrainLinksetsResponder
//---------------------------------------------------------------------------
-TerrainLinksetsResponder::TerrainLinksetsResponder(const std::string &pCapabilityURL, LinksetsResponderPtr pLinksetsResponsderPtr)
+TerrainLinksetsResponder::TerrainLinksetsResponder(LinksetsResponderPtr pLinksetsResponsderPtr)
: LLHTTPClient::Responder(),
- mCapabilityURL(pCapabilityURL),
mLinksetsResponsderPtr(pLinksetsResponsderPtr)
{
}
@@ -1015,23 +997,23 @@ TerrainLinksetsResponder::~TerrainLinksetsResponder()
{
}
-void TerrainLinksetsResponder::result(const LLSD &pContent)
+void TerrainLinksetsResponder::httpSuccess()
{
- mLinksetsResponsderPtr->handleTerrainLinksetsResult(pContent);
+ mLinksetsResponsderPtr->handleTerrainLinksetsResult(getContent());
}
-void TerrainLinksetsResponder::errorWithContent(U32 pStatus, const std::string &pReason, const LLSD& pContent)
+void TerrainLinksetsResponder::httpFailure()
{
- mLinksetsResponsderPtr->handleTerrainLinksetsError(pStatus, pReason, pContent, mCapabilityURL);
+ LL_WARNS() << dumpResponse() << LL_ENDL;
+ mLinksetsResponsderPtr->handleTerrainLinksetsError();
}
//---------------------------------------------------------------------------
// CharactersResponder
//---------------------------------------------------------------------------
-CharactersResponder::CharactersResponder(const std::string &pCapabilityURL, LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::object_request_callback_t pCharactersCallback)
+CharactersResponder::CharactersResponder(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::object_request_callback_t pCharactersCallback)
: LLHTTPClient::Responder(),
- mCapabilityURL(pCapabilityURL),
mRequestId(pRequestId),
mCharactersCallback(pCharactersCallback)
{
@@ -1041,15 +1023,15 @@ CharactersResponder::~CharactersResponder()
{
}
-void CharactersResponder::result(const LLSD &pContent)
+void CharactersResponder::httpSuccess()
{
- LLPathfindingObjectListPtr characterListPtr = LLPathfindingObjectListPtr(new LLPathfindingCharacterList(pContent));
+ LLPathfindingObjectListPtr characterListPtr = LLPathfindingObjectListPtr(new LLPathfindingCharacterList(getContent()));
mCharactersCallback(mRequestId, LLPathfindingManager::kRequestCompleted, characterListPtr);
}
-void CharactersResponder::errorWithContent(U32 pStatus, const std::string &pReason, const LLSD& pContent)
+void CharactersResponder::httpFailure()
{
- llwarns << "CharactersResponder error [status:" << pStatus << "]: " << pContent << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
LLPathfindingObjectListPtr characterListPtr = LLPathfindingObjectListPtr(new LLPathfindingCharacterList());
mCharactersCallback(mRequestId, LLPathfindingManager::kRequestError, characterListPtr);
diff --git a/indra/newview/llpathfindingnavmesh.cpp b/indra/newview/llpathfindingnavmesh.cpp
index 0c23e5ac92..0287c07f96 100755
--- a/indra/newview/llpathfindingnavmesh.cpp
+++ b/indra/newview/llpathfindingnavmesh.cpp
@@ -129,7 +129,7 @@ void LLPathfindingNavMesh::handleNavMeshResult(const LLSD &pContent, U32 pNavMes
llassert(embeddedNavMeshVersion == pNavMeshVersion); // stinson 03/13/2012 : does this ever occur?
if (embeddedNavMeshVersion != pNavMeshVersion)
{
- llwarns << "Mismatch between expected and embedded navmesh versions occurred" << llendl;
+ LL_WARNS() << "Mismatch between expected and embedded navmesh versions occurred" << LL_ENDL;
pNavMeshVersion = embeddedNavMeshVersion;
}
}
@@ -148,7 +148,7 @@ void LLPathfindingNavMesh::handleNavMeshResult(const LLSD &pContent, U32 pNavMes
U8* pUncompressedNavMeshContainer = unzip_llsdNavMesh( valid, decompBinSize, streamdecomp, binSize ) ;
if ( !valid )
{
- llwarns << "Unable to decompress the navmesh llsd." << llendl;
+ LL_WARNS() << "Unable to decompress the navmesh llsd." << LL_ENDL;
status = kNavMeshRequestError;
}
else
@@ -165,7 +165,7 @@ void LLPathfindingNavMesh::handleNavMeshResult(const LLSD &pContent, U32 pNavMes
}
else
{
- llwarns << "No mesh data received" << llendl;
+ LL_WARNS() << "No mesh data received" << LL_ENDL;
status = kNavMeshRequestError;
}
setRequestStatus(status);
@@ -184,10 +184,8 @@ void LLPathfindingNavMesh::handleNavMeshError()
setRequestStatus(kNavMeshRequestError);
}
-void LLPathfindingNavMesh::handleNavMeshError(U32 pStatus, const std::string &pReason, const LLSD& pContent, const std::string &pURL, U32 pNavMeshVersion)
+void LLPathfindingNavMesh::handleNavMeshError(U32 pNavMeshVersion)
{
- llwarns << "LLPathfindingNavMesh error with request to URL '" << pURL << "' [status:"
- << pStatus << "]: " << pContent << llendl;
if (mNavMeshStatus.getVersion() == pNavMeshVersion)
{
handleNavMeshError();
diff --git a/indra/newview/llpathfindingnavmesh.h b/indra/newview/llpathfindingnavmesh.h
index b872ccad7c..87f32b8d56 100755
--- a/indra/newview/llpathfindingnavmesh.h
+++ b/indra/newview/llpathfindingnavmesh.h
@@ -74,7 +74,7 @@ public:
void handleNavMeshResult(const LLSD &pContent, U32 pNavMeshVersion);
void handleNavMeshNotEnabled();
void handleNavMeshError();
- void handleNavMeshError(U32 pStatus, const std::string &pReason, const LLSD& pContent, const std::string &pURL, U32 pNavMeshVersion);
+ void handleNavMeshError(U32 pNavMeshVersion);
protected:
diff --git a/indra/newview/llpersistentnotificationstorage.cpp b/indra/newview/llpersistentnotificationstorage.cpp
index 4f7d071d66..9e4f50b7a7 100755
--- a/indra/newview/llpersistentnotificationstorage.cpp
+++ b/indra/newview/llpersistentnotificationstorage.cpp
@@ -35,7 +35,7 @@
#include "llscreenchannel.h"
#include "llscriptfloater.h"
#include "llviewermessage.h"
-
+#include "llviewernetwork.h"
LLPersistentNotificationStorage::LLPersistentNotificationStorage()
: LLSingleton<LLPersistentNotificationStorage>()
, LLNotificationStorage("")
@@ -47,11 +47,11 @@ LLPersistentNotificationStorage::~LLPersistentNotificationStorage()
{
}
-static LLFastTimer::DeclareTimer FTM_SAVE_NOTIFICATIONS("Save Notifications");
+static LLTrace::BlockTimerStatHandle FTM_SAVE_NOTIFICATIONS("Save Notifications");
void LLPersistentNotificationStorage::saveNotifications()
{
- LLFastTimer _(FTM_SAVE_NOTIFICATIONS);
+ LL_RECORD_BLOCK_TIME(FTM_SAVE_NOTIFICATIONS);
boost::intrusive_ptr<LLPersistentNotificationChannel> history_channel = boost::dynamic_pointer_cast<LLPersistentNotificationChannel>(LLNotifications::instance().getChannel("Persistent"));
if (!history_channel)
@@ -79,9 +79,9 @@ void LLPersistentNotificationStorage::saveNotifications()
data.append(notification->asLLSD(true));
if (data.size() >= gSavedSettings.getS32("MaxPersistentNotifications"))
{
- llwarns << "Too many persistent notifications."
+ LL_WARNS() << "Too many persistent notifications."
<< " Saved " << gSavedSettings.getS32("MaxPersistentNotifications") << " of " << history_channel->size()
- << " persistent notifications." << llendl;
+ << " persistent notifications." << LL_ENDL;
break;
}
@@ -90,11 +90,11 @@ void LLPersistentNotificationStorage::saveNotifications()
writeNotifications(output);
}
-static LLFastTimer::DeclareTimer FTM_LOAD_NOTIFICATIONS("Load Notifications");
+static LLTrace::BlockTimerStatHandle FTM_LOAD_NOTIFICATIONS("Load Notifications");
void LLPersistentNotificationStorage::loadNotifications()
{
- LLFastTimer _(FTM_LOAD_NOTIFICATIONS);
+ LL_RECORD_BLOCK_TIME(FTM_LOAD_NOTIFICATIONS);
LL_INFOS("LLPersistentNotificationStorage") << "start loading notifications" << LL_ENDL;
@@ -146,8 +146,8 @@ void LLPersistentNotificationStorage::loadNotifications()
++processed_notifications;
if (processed_notifications >= gSavedSettings.getS32("MaxPersistentNotifications"))
{
- llwarns << "Too many persistent notifications."
- << " Processed " << gSavedSettings.getS32("MaxPersistentNotifications") << " of " << data.size() << " persistent notifications." << llendl;
+ LL_WARNS() << "Too many persistent notifications."
+ << " Processed " << gSavedSettings.getS32("MaxPersistentNotifications") << " of " << data.size() << " persistent notifications." << LL_ENDL;
break;
}
}
@@ -158,7 +158,10 @@ void LLPersistentNotificationStorage::loadNotifications()
void LLPersistentNotificationStorage::initialize()
{
- setFileName(gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "open_notifications.xml"));
+ std::string file_name = "open_notifications_" + LLGridManager::getInstance()->getGrid() + ".xml";
+ setFileName(gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, file_name));
+ setOldFileName(gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "open_notifications.xml"));
+
LLNotifications::instance().getChannel("Persistent")->
connectChanged(boost::bind(&LLPersistentNotificationStorage::onPersistentChannelChanged, this, _1));
}
diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp
index 18b85cc9c3..ea10d03264 100755
--- a/indra/newview/llphysicsmotion.cpp
+++ b/indra/newview/llphysicsmotion.cpp
@@ -224,7 +224,7 @@ BOOL LLPhysicsMotion::initialize()
mParamDriver = (LLViewerVisualParam*)mCharacter->getVisualParam(mParamDriverName.c_str());
if (mParamDriver == NULL)
{
- llinfos << "Failure reading in [ " << mParamDriverName << " ]" << llendl;
+ LL_INFOS() << "Failure reading in [ " << mParamDriverName << " ]" << LL_ENDL;
return FALSE;
}
@@ -668,9 +668,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time)
if ((driver_param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) &&
(driver_param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT))
{
- mCharacter->setVisualParamWeight(driver_param,
- 0,
- FALSE);
+ mCharacter->setVisualParamWeight(driver_param, 0);
}
S32 num_driven = driver_param->getDrivenParamsCount();
for (S32 i = 0; i < num_driven; ++i)
@@ -770,7 +768,5 @@ void LLPhysicsMotion::setParamValue(const LLViewerVisualParam *param,
// Scale from [0,1] to [value_min_local,value_max_local]
const F32 new_value_local = value_min_local + (value_max_local-value_min_local) * new_value_rescaled;
- mCharacter->setVisualParamWeight(param,
- new_value_local,
- FALSE);
+ mCharacter->setVisualParamWeight(param, new_value_local);
}
diff --git a/indra/newview/llphysicsshapebuilderutil.h b/indra/newview/llphysicsshapebuilderutil.h
index 7dedfb05e2..bd5b7d799c 100755
--- a/indra/newview/llphysicsshapebuilderutil.h
+++ b/indra/newview/llphysicsshapebuilderutil.h
@@ -41,6 +41,8 @@
#define SHAPE_BUILDER_IMPLICIT_THRESHOLD_TWIST 0.09f
#define SHAPE_BUILDER_IMPLICIT_THRESHOLD_SHEAR 0.05f
+const F32 COLLISION_TOLERANCE = 0.1f;
+
const F32 SHAPE_BUILDER_ENTRY_SNAP_SCALE_BIN_SIZE = 0.15f;
const F32 SHAPE_BUILDER_ENTRY_SNAP_PARAMETER_BIN_SIZE = 0.010f;
const F32 SHAPE_BUILDER_CONVEXIFICATION_SIZE = 2.f * COLLISION_TOLERANCE;
diff --git a/indra/newview/llplacesfolderview.cpp b/indra/newview/llplacesfolderview.cpp
index 3caa93ae71..fe89c1e314 100755
--- a/indra/newview/llplacesfolderview.cpp
+++ b/indra/newview/llplacesfolderview.cpp
@@ -31,6 +31,7 @@
#include "llplacesinventorypanel.h"
#include "llpanellandmarks.h"
+#include "llmenugl.h"
LLPlacesFolderView::LLPlacesFolderView(const LLFolderView::Params& p)
: LLFolderView(p)
@@ -59,7 +60,7 @@ BOOL LLPlacesFolderView::handleRightMouseDown(S32 x, S32 y, MASK mask)
}
else
{
- llwarns << "Requested menu handle for non-setup inventory type: " << inventory_type << llendl;
+ LL_WARNS() << "Requested menu handle for non-setup inventory type: " << inventory_type << LL_ENDL;
}
}
@@ -67,6 +68,16 @@ BOOL LLPlacesFolderView::handleRightMouseDown(S32 x, S32 y, MASK mask)
return LLFolderView::handleRightMouseDown(x, y, mask);
}
+void LLPlacesFolderView::updateMenu()
+{
+ LLFolderView::updateMenu();
+ LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get();
+ if (menu && menu->getVisible())
+ {
+ mParentLandmarksPanel->updateMenuVisibility(menu);
+ }
+}
+
void LLPlacesFolderView::setupMenuHandle(LLInventoryType::EType asset_type, LLHandle<LLView> menu_handle)
{
mMenuHandlesByInventoryType[asset_type] = menu_handle;
diff --git a/indra/newview/llplacesfolderview.h b/indra/newview/llplacesfolderview.h
index 8c5be39b5e..65fe76007a 100755
--- a/indra/newview/llplacesfolderview.h
+++ b/indra/newview/llplacesfolderview.h
@@ -51,6 +51,8 @@ public:
*/
/*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask );
+ /*virtual*/ void updateMenu();
+
void setupMenuHandle(LLInventoryType::EType asset_type, LLHandle<LLView> menu_handle);
void setParentLandmarksPanel(LLLandmarksPanel* panel)
diff --git a/indra/newview/llplacesinventorybridge.cpp b/indra/newview/llplacesinventorybridge.cpp
index ebd9604c5b..a498d27d2b 100755
--- a/indra/newview/llplacesinventorybridge.cpp
+++ b/indra/newview/llplacesinventorybridge.cpp
@@ -162,7 +162,7 @@ LLInvFVBridge* LLPlacesInventoryBridgeBuilder::createBridge(
case LLAssetType::AT_LANDMARK:
if(!(inv_type == LLInventoryType::IT_LANDMARK))
{
- llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << llendl;
+ LL_WARNS() << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << LL_ENDL;
}
new_listener = new LLPlacesLandmarkBridge(inv_type, inventory, root, uuid, flags);
break;
diff --git a/indra/newview/llpostcard.cpp b/indra/newview/llpostcard.cpp
index aebe636f59..649bb2fb2c 100755
--- a/indra/newview/llpostcard.cpp
+++ b/indra/newview/llpostcard.cpp
@@ -48,7 +48,7 @@ static void postcard_upload_callback(const LLUUID& asset_id, void *user_data, S3
if (result)
{
// TODO: display the error messages in UI
- llwarns << "Failed to send postcard: " << LLAssetStorage::getErrorString(result) << llendl;
+ LL_WARNS() << "Failed to send postcard: " << LLAssetStorage::getErrorString(result) << LL_ENDL;
LLPostCard::reportPostResult(false);
}
else
@@ -97,14 +97,14 @@ public:
/*virtual*/ void uploadComplete(const LLSD& content)
{
- llinfos << "Postcard sent" << llendl;
- LL_DEBUGS("Snapshots") << "content: " << content << llendl;
+ LL_INFOS() << "Postcard sent" << LL_ENDL;
+ LL_DEBUGS("Snapshots") << "content: " << content << LL_ENDL;
LLPostCard::reportPostResult(true);
}
/*virtual*/ void uploadFailure(const LLSD& content)
{
- llwarns << "Sending postcard failed: " << content << llendl;
+ LL_WARNS() << "Sending postcard failed: " << content << LL_ENDL;
LLPostCard::reportPostResult(false);
}
};
@@ -128,17 +128,17 @@ void LLPostCard::send(LLPointer<LLImageFormatted> image, const LLSD& postcard_da
std::string url = gAgent.getRegion()->getCapability("SendPostcard");
if (!url.empty())
{
- llinfos << "Sending postcard via capability" << llendl;
+ LL_INFOS() << "Sending postcard via capability" << LL_ENDL;
// the capability already encodes: agent ID, region ID
- LL_DEBUGS("Snapshots") << "url: " << url << llendl;
- LL_DEBUGS("Snapshots") << "body: " << postcard_data << llendl;
- LL_DEBUGS("Snapshots") << "data size: " << image->getDataSize() << llendl;
+ LL_DEBUGS("Snapshots") << "url: " << url << LL_ENDL;
+ LL_DEBUGS("Snapshots") << "body: " << postcard_data << LL_ENDL;
+ LL_DEBUGS("Snapshots") << "data size: " << image->getDataSize() << LL_ENDL;
LLHTTPClient::post(url, postcard_data,
new LLPostcardSendResponder(postcard_data, asset_id, LLAssetType::AT_IMAGE_JPEG));
}
else
{
- llinfos << "Sending postcard" << llendl;
+ LL_INFOS() << "Sending postcard" << LL_ENDL;
LLSD* data = new LLSD(postcard_data);
(*data)["asset-id"] = asset_id;
gAssetStorage->storeAssetData(transaction_id, LLAssetType::AT_IMAGE_JPEG,
diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp
index 04934b13f1..398f4e6e42 100755
--- a/indra/newview/llpreview.cpp
+++ b/indra/newview/llpreview.cpp
@@ -25,7 +25,6 @@
*/
#include "llviewerprecompiledheaders.h"
-#include "stdenums.h"
#include "llpreview.h"
@@ -91,6 +90,7 @@ void LLPreview::setObjectID(const LLUUID& object_id)
{
loadAsset();
}
+ refreshFromItem();
}
void LLPreview::setItem( LLInventoryItem* item )
@@ -100,6 +100,7 @@ void LLPreview::setItem( LLInventoryItem* item )
{
loadAsset();
}
+ refreshFromItem();
}
const LLInventoryItem *LLPreview::getItem() const
@@ -135,10 +136,10 @@ void LLPreview::onCommit()
if (!item->isFinished())
{
// We are attempting to save an item that was never loaded
- llwarns << "LLPreview::onCommit() called with mIsComplete == FALSE"
+ LL_WARNS() << "LLPreview::onCommit() called with mIsComplete == FALSE"
<< " Type: " << item->getType()
<< " ID: " << item->getUUID()
- << llendl;
+ << LL_ENDL;
return;
}
@@ -401,13 +402,6 @@ void LLPreview::onDiscardBtn(void* data)
self->mForceClose = TRUE;
self->closeFloater();
- // Delete the item entirely
- /*
- item->removeFromServer();
- gInventory.deleteObject(item->getUUID());
- gInventory.notifyObservers();
- */
-
// Move the item to the trash
const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
if (item->getParentUUID() != trash_id)
diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp
index f47928b131..c378738b05 100755
--- a/indra/newview/llpreviewgesture.cpp
+++ b/indra/newview/llpreviewgesture.cpp
@@ -253,7 +253,7 @@ void LLPreviewGesture::onUpdateSucceeded()
refresh();
}
-void LLPreviewGesture::onVisibilityChange ( const LLSD& new_visibility )
+void LLPreviewGesture::onVisibilityChanged ( const LLSD& new_visibility )
{
if (new_visibility.asBoolean())
{
@@ -333,7 +333,7 @@ LLPreviewGesture::~LLPreviewGesture()
BOOL LLPreviewGesture::postBuild()
{
- setVisibleCallback(boost::bind(&LLPreviewGesture::onVisibilityChange, this, _2));
+ setVisibleCallback(boost::bind(&LLPreviewGesture::onVisibilityChanged, this, _2));
LLLineEditor* edit;
LLComboBox* combo;
@@ -546,10 +546,10 @@ void LLPreviewGesture::addAnimations()
// Copy into something we can sort
std::vector<LLInventoryItem*> animations;
- S32 count = items.count();
+ S32 count = items.size();
for(i = 0; i < count; ++i)
{
- animations.push_back( items.get(i) );
+ animations.push_back( items.at(i) );
}
// Do the sort
@@ -592,10 +592,10 @@ void LLPreviewGesture::addSounds()
std::vector<LLInventoryItem*> sounds;
S32 i;
- S32 count = items.count();
+ S32 count = items.size();
for(i = 0; i < count; ++i)
{
- sounds.push_back( items.get(i) );
+ sounds.push_back( items.at(i) );
}
// Do the sort
@@ -873,7 +873,7 @@ void LLPreviewGesture::onLoadComplete(LLVFS *vfs,
}
else
{
- llwarns << "Unable to load gesture" << llendl;
+ LL_WARNS() << "Unable to load gesture" << LL_ENDL;
}
delete gesture;
@@ -883,8 +883,6 @@ void LLPreviewGesture::onLoadComplete(LLVFS *vfs,
}
else
{
- LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED );
-
if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ||
LL_ERR_FILE_EMPTY == status)
{
@@ -895,7 +893,7 @@ void LLPreviewGesture::onLoadComplete(LLVFS *vfs,
LLDelayedGestureError::gestureFailedToLoad( *item_idp );
}
- llwarns << "Problem loading gesture: " << status << llendl;
+ LL_WARNS() << "Problem loading gesture: " << status << LL_ENDL;
self->mAssetStatus = PREVIEW_ASSET_ERROR;
}
}
@@ -1021,7 +1019,7 @@ void LLPreviewGesture::saveIfNeeded()
{
if (!gAssetStorage)
{
- llwarns << "Can't save gesture, no asset storage system." << llendl;
+ LL_WARNS() << "Can't save gesture, no asset storage system." << LL_ENDL;
return;
}
@@ -1168,8 +1166,8 @@ void LLPreviewGesture::onSaveComplete(const LLUUID& asset_uuid, void* user_data,
}
else
{
- llwarns << "Inventory item for gesture " << info->mItemUUID
- << " is no longer in agent inventory." << llendl;
+ LL_WARNS() << "Inventory item for gesture " << info->mItemUUID
+ << " is no longer in agent inventory." << LL_ENDL;
}
}
else
@@ -1204,7 +1202,7 @@ void LLPreviewGesture::onSaveComplete(const LLUUID& asset_uuid, void* user_data,
}
else
{
- llwarns << "Problem saving gesture: " << status << llendl;
+ LL_WARNS() << "Problem saving gesture: " << status << LL_ENDL;
LLSD args;
args["REASON"] = std::string(LLAssetStorage::getErrorString(status));
LLNotificationsUtil::add("GestureSaveFailedReason", args);
@@ -1535,7 +1533,7 @@ void LLPreviewGesture::onClickAdd(void* data)
if( library_item_index >= STEP_EOF )
{
- llerrs << "Unknown step type: " << library_text << llendl;
+ LL_ERRS() << "Unknown step type: " << library_text << LL_ENDL;
return;
}
@@ -1565,7 +1563,7 @@ LLScrollListItem* LLPreviewGesture::addStep( const EStepType step_type )
step = new LLGestureStepWait();
break;
default:
- llerrs << "Unknown step type: " << (S32)step_type << llendl;
+ LL_ERRS() << "Unknown step type: " << (S32)step_type << LL_ENDL;
return NULL;
}
diff --git a/indra/newview/llpreviewgesture.h b/indra/newview/llpreviewgesture.h
index fd4fcf9d8f..7ce5706a0d 100755
--- a/indra/newview/llpreviewgesture.h
+++ b/indra/newview/llpreviewgesture.h
@@ -102,7 +102,7 @@ protected:
// "Sound", "Chat", or "Wait"
LLScrollListItem* addStep(const enum EStepType step_type);
- void onVisibilityChange ( const LLSD& new_visibility );
+ void onVisibilityChanged ( const LLSD& new_visibility );
static std::string getLabel(std::vector<std::string> labels);
static void updateLabel(LLScrollListItem* item);
diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp
index 3a9360fd23..337a63e627 100755
--- a/indra/newview/llpreviewnotecard.cpp
+++ b/indra/newview/llpreviewnotecard.cpp
@@ -185,7 +185,7 @@ void LLPreviewNotecard::refreshFromInventory(const LLUUID& new_item_id)
mItemUUID = new_item_id;
setKey(LLSD(new_item_id));
}
- lldebugs << "LLPreviewNotecard::refreshFromInventory()" << llendl;
+ LL_DEBUGS() << "LLPreviewNotecard::refreshFromInventory()" << LL_ENDL;
loadAsset();
}
@@ -240,7 +240,7 @@ void LLPreviewNotecard::loadAsset()
else
{
// The object that we're trying to look at disappeared, bail.
- llwarns << "Can't find object " << mObjectUUID << " associated with notecard." << llendl;
+ LL_WARNS() << "Can't find object " << mObjectUUID << " associated with notecard." << LL_ENDL;
mAssetID.setNull();
editor->setText(getString("no_object"));
editor->makePristine();
@@ -295,7 +295,7 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs,
LLAssetType::EType type,
void* user_data, S32 status, LLExtStat ext_status)
{
- llinfos << "LLPreviewNotecard::onLoadComplete()" << llendl;
+ LL_INFOS() << "LLPreviewNotecard::onLoadComplete()" << LL_ENDL;
LLUUID* item_id = (LLUUID*)user_data;
LLPreviewNotecard* preview = LLFloaterReg::findTypedInstance<LLPreviewNotecard>("preview_notecard", LLSD(*item_id));
@@ -320,7 +320,7 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs,
{
if( !previewEditor->importBuffer( &buffer[0], file_length+1 ) )
{
- llwarns << "Problem importing notecard" << llendl;
+ LL_WARNS() << "Problem importing notecard" << LL_ENDL;
}
}
else
@@ -339,8 +339,6 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs,
}
else
{
- LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED );
-
if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ||
LL_ERR_FILE_EMPTY == status)
{
@@ -355,7 +353,7 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs,
LLNotificationsUtil::add("UnableToLoadNotecard");
}
- llwarns << "Problem loading notecard: " << status << llendl;
+ LL_WARNS() << "Problem loading notecard: " << status << LL_ENDL;
preview->mAssetStatus = PREVIEW_ASSET_ERROR;
}
}
@@ -365,7 +363,7 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs,
// static
void LLPreviewNotecard::onClickSave(void* user_data)
{
- //llinfos << "LLPreviewNotecard::onBtnSave()" << llendl;
+ //LL_INFOS() << "LLPreviewNotecard::onBtnSave()" << LL_ENDL;
LLPreviewNotecard* preview = (LLPreviewNotecard*)user_data;
if(preview)
{
@@ -404,7 +402,7 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem)
if(!editor)
{
- llwarns << "Cannot get handle to the notecard editor." << llendl;
+ LL_WARNS() << "Cannot get handle to the notecard editor." << LL_ENDL;
return false;
}
@@ -437,7 +435,7 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem)
const LLViewerRegion* region = gAgent.getRegion();
if (!region)
{
- llwarns << "Not connected to a region, cannot save notecard." << llendl;
+ LL_WARNS() << "Not connected to a region, cannot save notecard." << LL_ENDL;
return false;
}
std::string agent_url = region->getCapability("UpdateNotecardAgentInventory");
@@ -450,8 +448,8 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem)
setEnabled(FALSE);
LLSD body;
body["item_id"] = mItemUUID;
- llinfos << "Saving notecard " << mItemUUID
- << " into agent inventory via " << agent_url << llendl;
+ LL_INFOS() << "Saving notecard " << mItemUUID
+ << " into agent inventory via " << agent_url << LL_ENDL;
LLHTTPClient::post(agent_url, body,
new LLUpdateAgentInventoryResponder(body, asset_id, LLAssetType::AT_NOTECARD));
}
@@ -463,8 +461,8 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem)
LLSD body;
body["task_id"] = mObjectUUID;
body["item_id"] = mItemUUID;
- llinfos << "Saving notecard " << mItemUUID << " into task "
- << mObjectUUID << " via " << task_url << llendl;
+ LL_INFOS() << "Saving notecard " << mItemUUID << " into task "
+ << mObjectUUID << " via " << task_url << LL_ENDL;
LLHTTPClient::post(task_url, body,
new LLUpdateTaskInventoryResponder(body, asset_id, LLAssetType::AT_NOTECARD));
}
@@ -476,12 +474,17 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem)
&onSaveComplete,
(void*)info,
FALSE);
+ return true;
}
else // !gAssetStorage
{
- llwarns << "Not connected to an asset storage system." << llendl;
+ LL_WARNS() << "Not connected to an asset storage system." << LL_ENDL;
return false;
}
+ if(mCloseAfterSave)
+ {
+ closeFloater();
+ }
}
}
return true;
@@ -520,8 +523,8 @@ void LLPreviewNotecard::onSaveComplete(const LLUUID& asset_uuid, void* user_data
}
else
{
- llwarns << "Inventory item for script " << info->mItemUUID
- << " is no longer in agent inventory." << llendl;
+ LL_WARNS() << "Inventory item for script " << info->mItemUUID
+ << " is no longer in agent inventory." << LL_ENDL;
}
}
else
@@ -564,7 +567,7 @@ void LLPreviewNotecard::onSaveComplete(const LLUUID& asset_uuid, void* user_data
}
else
{
- llwarns << "Problem saving notecard: " << status << llendl;
+ LL_WARNS() << "Problem saving notecard: " << status << LL_ENDL;
LLSD args;
args["REASON"] = std::string(LLAssetStorage::getErrorString(status));
LLNotificationsUtil::add("SaveNotecardFailReason", args);
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index e533be7f24..8eea5ea73e 100755
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -34,6 +34,7 @@
#include "llcheckboxctrl.h"
#include "llcombobox.h"
#include "lldir.h"
+#include "llenvmanager.h"
#include "llexternaleditor.h"
#include "llfilepicker.h"
#include "llfloaterreg.h"
@@ -50,11 +51,9 @@
#include "llscrolllistctrl.h"
#include "llscrolllistitem.h"
#include "llscrolllistcell.h"
+#include "llsdserialize.h"
#include "llslider.h"
#include "lscript_rt_interface.h"
-#include "lscript_library.h"
-#include "lscript_export.h"
-#include "lltextbox.h"
#include "lltooldraganddrop.h"
#include "llvfile.h"
@@ -70,6 +69,7 @@
#include "llkeyboard.h"
#include "llscrollcontainer.h"
#include "llcheckboxctrl.h"
+#include "llscripteditor.h"
#include "llselectmgr.h"
#include "lltooldraganddrop.h"
#include "llscrolllistctrl.h"
@@ -78,7 +78,6 @@
#include "lldir.h"
#include "llcombobox.h"
#include "llviewerstats.h"
-#include "llviewertexteditor.h"
#include "llviewerwindow.h"
#include "lluictrlfactory.h"
#include "llmediactrl.h"
@@ -192,11 +191,11 @@ public:
private:
LLScriptEdCore* mEditorCore;
-
static LLFloaterScriptSearch* sInstance;
protected:
LLLineEditor* mSearchBox;
+ LLLineEditor* mReplaceBox;
void onSearchBoxCommit();
};
@@ -205,6 +204,7 @@ LLFloaterScriptSearch* LLFloaterScriptSearch::sInstance = NULL;
LLFloaterScriptSearch::LLFloaterScriptSearch(LLScriptEdCore* editor_core)
: LLFloater(LLSD()),
mSearchBox(NULL),
+ mReplaceBox(NULL),
mEditorCore(editor_core)
{
buildFromFile("floater_script_search.xml");
@@ -227,6 +227,7 @@ LLFloaterScriptSearch::LLFloaterScriptSearch(LLScriptEdCore* editor_core)
BOOL LLFloaterScriptSearch::postBuild()
{
+ mReplaceBox = getChild<LLLineEditor>("replace_text");
mSearchBox = getChild<LLLineEditor>("search_text");
mSearchBox->setCommitCallback(boost::bind(&LLFloaterScriptSearch::onSearchBoxCommit, this));
mSearchBox->setCommitOnFocusLost(FALSE);
@@ -242,8 +243,12 @@ BOOL LLFloaterScriptSearch::postBuild()
//static
void LLFloaterScriptSearch::show(LLScriptEdCore* editor_core)
{
+ LLSD::String search_text;
+ LLSD::String replace_text;
if (sInstance && sInstance->mEditorCore && sInstance->mEditorCore != editor_core)
{
+ search_text=sInstance->mSearchBox->getValue().asString();
+ replace_text=sInstance->mReplaceBox->getValue().asString();
sInstance->closeFloater();
delete sInstance;
}
@@ -252,6 +257,8 @@ void LLFloaterScriptSearch::show(LLScriptEdCore* editor_core)
{
// sInstance will be assigned in the constructor.
new LLFloaterScriptSearch(editor_core);
+ sInstance->mSearchBox->setValue(search_text);
+ sInstance->mReplaceBox->setValue(replace_text);
}
sInstance->openFloater();
@@ -272,7 +279,7 @@ void LLFloaterScriptSearch::onBtnSearch(void *userdata)
void LLFloaterScriptSearch::handleBtnSearch()
{
LLCheckBoxCtrl* caseChk = getChild<LLCheckBoxCtrl>("case_text");
- mEditorCore->mEditor->selectNext(getChild<LLUICtrl>("search_text")->getValue().asString(), caseChk->get());
+ mEditorCore->mEditor->selectNext(mSearchBox->getValue().asString(), caseChk->get());
}
// static
@@ -285,7 +292,7 @@ void LLFloaterScriptSearch::onBtnReplace(void *userdata)
void LLFloaterScriptSearch::handleBtnReplace()
{
LLCheckBoxCtrl* caseChk = getChild<LLCheckBoxCtrl>("case_text");
- mEditorCore->mEditor->replaceText(getChild<LLUICtrl>("search_text")->getValue().asString(), getChild<LLUICtrl>("replace_text")->getValue().asString(), caseChk->get());
+ mEditorCore->mEditor->replaceText(mSearchBox->getValue().asString(), mReplaceBox->getValue().asString(), caseChk->get());
}
// static
@@ -298,7 +305,7 @@ void LLFloaterScriptSearch::onBtnReplaceAll(void *userdata)
void LLFloaterScriptSearch::handleBtnReplaceAll()
{
LLCheckBoxCtrl* caseChk = getChild<LLCheckBoxCtrl>("case_text");
- mEditorCore->mEditor->replaceTextAll(getChild<LLUICtrl>("search_text")->getValue().asString(), getChild<LLUICtrl>("replace_text")->getValue().asString(), caseChk->get());
+ mEditorCore->mEditor->replaceTextAll(mSearchBox->getValue().asString(), mReplaceBox->getValue().asString(), caseChk->get());
}
bool LLFloaterScriptSearch::hasAccelerators() const
@@ -329,7 +336,7 @@ void LLFloaterScriptSearch::onSearchBoxCommit()
if (mEditorCore && mEditorCore->mEditor)
{
LLCheckBoxCtrl* caseChk = getChild<LLCheckBoxCtrl>("case_text");
- mEditorCore->mEditor->selectNext(getChild<LLUICtrl>("search_text")->getValue().asString(), caseChk->get());
+ mEditorCore->mEditor->selectNext(mSearchBox->getValue().asString(), caseChk->get());
}
}
@@ -353,6 +360,7 @@ LLScriptEdCore::LLScriptEdCore(
void (*save_callback)(void*, BOOL),
void (*search_replace_callback) (void* userdata),
void* userdata,
+ bool live,
S32 bottom_pad)
:
LLPanel(),
@@ -367,6 +375,7 @@ LLScriptEdCore::LLScriptEdCore(
mLiveHelpHistorySize(0),
mEnableSave(FALSE),
mLiveFile(NULL),
+ mLive(live),
mContainer(container),
mHasScriptData(FALSE)
{
@@ -390,17 +399,21 @@ LLScriptEdCore::~LLScriptEdCore()
}
delete mLiveFile;
+ if (mSyntaxIDConnection.connected())
+ {
+ mSyntaxIDConnection.disconnect();
+ }
}
BOOL LLScriptEdCore::postBuild()
{
mErrorList = getChild<LLScrollListCtrl>("lsl errors");
- mFunctions = getChild<LLComboBox>( "Insert...");
+ mFunctions = getChild<LLComboBox>("Insert...");
childSetCommitCallback("Insert...", &LLScriptEdCore::onBtnInsertFunction, this);
- mEditor = getChild<LLViewerTextEditor>("Script Editor");
+ mEditor = getChild<LLScriptEditor>("Script Editor");
childSetCommitCallback("lsl errors", &LLScriptEdCore::onErrorList, this);
childSetAction("Save_btn", boost::bind(&LLScriptEdCore::doSave,this,FALSE));
@@ -408,51 +421,30 @@ BOOL LLScriptEdCore::postBuild()
initMenu();
+ mSyntaxIDConnection = LLSyntaxIdLSL::getInstance()->addSyntaxIDCallback(boost::bind(&LLScriptEdCore::processKeywords, this));
- std::vector<std::string> funcs;
- std::vector<std::string> tooltips;
- for (std::vector<LLScriptLibraryFunction>::const_iterator i = gScriptLibrary.mFunctions.begin();
- i != gScriptLibrary.mFunctions.end(); ++i)
- {
- // Make sure this isn't a god only function, or the agent is a god.
- if (!i->mGodOnly || gAgent.isGodlike())
- {
- std::string name = i->mName;
- funcs.push_back(name);
-
- std::string desc_name = "LSLTipText_";
- desc_name += name;
- std::string desc = LLTrans::getString(desc_name);
-
- F32 sleep_time = i->mSleepTime;
- if( sleep_time )
- {
- desc += "\n";
-
- LLStringUtil::format_map_t args;
- args["[SLEEP_TIME]"] = llformat("%.1f", sleep_time );
- desc += LLTrans::getString("LSLTipSleepTime", args);
- }
-
- // A \n linefeed is not part of xml. Let's add one to keep all
- // the tips one-per-line in strings.xml
- LLStringUtil::replaceString( desc, "\\n", "\n" );
-
- tooltips.push_back(desc);
- }
- }
-
- LLColor3 color(0.5f, 0.0f, 0.15f);
- mEditor->loadKeywords(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"keywords.ini"), funcs, tooltips, color);
+ // Intialise keyword highlighting for the current simulator's version of LSL
+ LLSyntaxIdLSL::getInstance()->initialize();
+ processKeywords();
+
+ return TRUE;
+}
- std::vector<std::string> primary_keywords;
- std::vector<std::string> secondary_keywords;
+void LLScriptEdCore::processKeywords()
+{
+ LL_DEBUGS("SyntaxLSL") << "Processing keywords" << LL_ENDL;
+ mEditor->clearSegments();
+ mEditor->initKeywords();
+ mEditor->loadKeywords();
+
+ string_vec_t primary_keywords;
+ string_vec_t secondary_keywords;
LLKeywordToken *token;
LLKeywords::keyword_iterator_t token_it;
for (token_it = mEditor->keywordsBegin(); token_it != mEditor->keywordsEnd(); ++token_it)
{
token = token_it->second;
- if (token->getColor() == color) // Wow, what a disgusting hack.
+ if (token->getType() == LLKeywordToken::TT_FUNCTION)
{
primary_keywords.push_back( wstring_to_utf8str(token->getToken()) );
}
@@ -461,24 +453,16 @@ BOOL LLScriptEdCore::postBuild()
secondary_keywords.push_back( wstring_to_utf8str(token->getToken()) );
}
}
-
- // Case-insensitive dictionary sort for primary keywords. We don't sort the secondary
- // keywords. They're intelligently grouped in keywords.ini.
- std::stable_sort( primary_keywords.begin(), primary_keywords.end(), LLSECKeywordCompare() );
-
- for (std::vector<std::string>::const_iterator iter= primary_keywords.begin();
- iter!= primary_keywords.end(); ++iter)
+ for (string_vec_t::const_iterator iter = primary_keywords.begin();
+ iter!= primary_keywords.end(); ++iter)
{
mFunctions->add(*iter);
}
-
- for (std::vector<std::string>::const_iterator iter= secondary_keywords.begin();
- iter!= secondary_keywords.end(); ++iter)
+ for (string_vec_t::const_iterator iter = secondary_keywords.begin();
+ iter!= secondary_keywords.end(); ++iter)
{
mFunctions->add(*iter);
}
-
- return TRUE;
}
void LLScriptEdCore::initMenu()
@@ -518,6 +502,10 @@ void LLScriptEdCore::initMenu()
menuItem->setClickCallback(boost::bind(&LLTextEditor::selectAll, mEditor));
menuItem->setEnableCallback(boost::bind(&LLTextEditor::canSelectAll, mEditor));
+ menuItem = getChild<LLMenuItemCallGL>("Deselect");
+ menuItem->setClickCallback(boost::bind(&LLTextEditor::deselect, mEditor));
+ menuItem->setEnableCallback(boost::bind(&LLTextEditor::canDeselect, mEditor));
+
menuItem = getChild<LLMenuItemCallGL>("Search / Replace...");
menuItem->setClickCallback(boost::bind(&LLFloaterScriptSearch::show, this));
@@ -552,14 +540,14 @@ bool LLScriptEdCore::loadScriptText(const std::string& filename)
{
if (filename.empty())
{
- llwarns << "Empty file name" << llendl;
+ LL_WARNS() << "Empty file name" << LL_ENDL;
return false;
}
LLFILE* file = LLFile::fopen(filename, "rb"); /*Flawfinder: ignore*/
if (!file)
{
- llwarns << "Error opening " << filename << llendl;
+ LL_WARNS() << "Error opening " << filename << LL_ENDL;
return false;
}
@@ -571,7 +559,7 @@ bool LLScriptEdCore::loadScriptText(const std::string& filename)
size_t nread = fread(buffer, 1, file_length, file);
if (nread < file_length)
{
- llwarns << "Short read" << llendl;
+ LL_WARNS() << "Short read" << LL_ENDL;
}
buffer[nread] = '\0';
fclose(file);
@@ -587,7 +575,7 @@ bool LLScriptEdCore::writeToFile(const std::string& filename)
LLFILE* fp = LLFile::fopen(filename, "wb");
if (!fp)
{
- llwarns << "Unable to write to " << filename << llendl;
+ LL_WARNS() << "Unable to write to " << filename << LL_ENDL;
LLSD row;
row["columns"][0]["value"] = "Error writing to local file. Is your hard drive full?";
@@ -680,7 +668,7 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate)
std::vector<LLTextSegmentPtr>::iterator segment_iter;
for (segment_iter = selected_segments.begin(); segment_iter != selected_segments.end(); ++segment_iter)
{
- if((*segment_iter)->getToken() && (*segment_iter)->getToken()->getType() == LLKeywordToken::WORD)
+ if((*segment_iter)->getToken() && (*segment_iter)->getToken()->getType() == LLKeywordToken::TT_WORD)
{
segment = *segment_iter;
break;
@@ -691,7 +679,7 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate)
if (!segment)
{
const LLTextSegmentPtr test_segment = mEditor->getPreviousSegment();
- if(test_segment->getToken() && test_segment->getToken()->getType() == LLKeywordToken::WORD)
+ if(test_segment->getToken() && test_segment->getToken()->getType() == LLKeywordToken::TT_WORD)
{
segment = test_segment;
}
@@ -967,7 +955,7 @@ void LLScriptEdCore::onBtnInsertFunction(LLUICtrl *ui, void* userdata)
void LLScriptEdCore::doSave( BOOL close_after_save )
{
- LLViewerStats::getInstance()->incStat( LLViewerStats::ST_LSL_SAVE_COUNT );
+ add(LLStatViewer::LSL_SAVES, 1);
if( mSaveCallback )
{
@@ -1042,8 +1030,8 @@ void LLScriptEdCore::onErrorList(LLUICtrl*, void* user_data)
LLStringUtil::replaceChar(line, ',',' ');
LLStringUtil::replaceChar(line, ')',' ');
sscanf(line.c_str(), "%d %d", &row, &column);
- //llinfos << "LLScriptEdCore::onErrorList() - " << row << ", "
- //<< column << llendl;
+ //LL_INFOS() << "LLScriptEdCore::onErrorList() - " << row << ", "
+ //<< column << LL_ENDL;
self->mEditor->setCursor(row, column);
self->mEditor->setFocus(TRUE);
}
@@ -1090,15 +1078,15 @@ struct LLEntryAndEdCore
void LLScriptEdCore::deleteBridges()
{
- S32 count = mBridges.count();
+ S32 count = mBridges.size();
LLEntryAndEdCore* eandc;
for(S32 i = 0; i < count; i++)
{
- eandc = mBridges.get(i);
+ eandc = mBridges.at(i);
delete eandc;
mBridges[i] = NULL;
}
- mBridges.reset();
+ mBridges.clear();
}
// virtual
@@ -1171,15 +1159,14 @@ void LLScriptEdCore::onBtnLoadFromFile( void* data )
void LLScriptEdCore::onBtnSaveToFile( void* userdata )
{
-
- LLViewerStats::getInstance()->incStat( LLViewerStats::ST_LSL_SAVE_COUNT );
+ add(LLStatViewer::LSL_SAVES, 1);
LLScriptEdCore* self = (LLScriptEdCore*) userdata;
if( self->mSaveCallback )
{
LLFilePicker& file_picker = LLFilePicker::instance();
- if( file_picker.getSaveFile( LLFilePicker::FFSAVE_SCRIPT ) )
+ if( file_picker.getSaveFile( LLFilePicker::FFSAVE_SCRIPT, self->mScriptName ) )
{
std::string filename = file_picker.getFirstFile();
std::string scriptText=self->mEditor->getText();
@@ -1216,8 +1203,8 @@ bool LLScriptEdCore::enableLoadFromFileMenu(void* userdata)
/// LLScriptEdContainer
/// ---------------------------------------------------------------------------
-LLScriptEdContainer::LLScriptEdContainer(const LLSD& key)
-: LLPreview(key)
+LLScriptEdContainer::LLScriptEdContainer(const LLSD& key) :
+ LLPreview(key)
, mScriptEd(NULL)
{
}
@@ -1279,8 +1266,8 @@ void* LLPreviewLSL::createScriptEdPanel(void* userdata)
LLPreviewLSL::onSave,
LLPreviewLSL::onSearchReplace,
self,
+ false,
0);
-
return self->mScriptEd;
}
@@ -1295,7 +1282,7 @@ LLPreviewLSL::LLPreviewLSL(const LLSD& key )
// virtual
BOOL LLPreviewLSL::postBuild()
{
- const LLInventoryItem* item = getItem();
+ const LLInventoryItem* item = getItem();
llassert(item);
if (item)
@@ -1311,7 +1298,7 @@ BOOL LLPreviewLSL::postBuild()
// virtual
void LLPreviewLSL::callbackLSLCompileSucceeded()
{
- llinfos << "LSL Bytecode saved" << llendl;
+ LL_INFOS() << "LSL Bytecode saved" << LL_ENDL;
mScriptEd->mErrorList->setCommentText(LLTrans::getString("CompileSuccessful"));
mScriptEd->mErrorList->setCommentText(LLTrans::getString("SaveComplete"));
closeIfNeeded();
@@ -1320,7 +1307,7 @@ void LLPreviewLSL::callbackLSLCompileSucceeded()
// virtual
void LLPreviewLSL::callbackLSLCompileFailed(const LLSD& compile_errors)
{
- llinfos << "Compile failed!" << llendl;
+ LL_INFOS() << "Compile failed!" << LL_ENDL;
for(LLSD::array_const_iterator line = compile_errors.beginArray();
line < compile_errors.endArray();
@@ -1435,7 +1422,7 @@ void LLPreviewLSL::onSave(void* userdata, BOOL close_after_save)
// fails, go ahead and save the text anyway.
void LLPreviewLSL::saveIfNeeded(bool sync /*= true*/)
{
- // llinfos << "LLPreviewLSL::saveIfNeeded()" << llendl;
+ // LL_INFOS() << "LLPreviewLSL::saveIfNeeded()" << LL_ENDL;
if(!mScriptEd->hasChanged())
{
return;
@@ -1481,7 +1468,7 @@ void LLPreviewLSL::uploadAssetViaCaps(const std::string& url,
const std::string& filename,
const LLUUID& item_id)
{
- llinfos << "Update Agent Inventory via capability" << llendl;
+ LL_INFOS() << "Update Agent Inventory via capability" << LL_ENDL;
LLSD body;
body["item_id"] = item_id;
body["target"] = "lsl2";
@@ -1514,7 +1501,7 @@ void LLPreviewLSL::uploadAssetLegacy(const std::string& filename,
asset_id.asString().c_str(),
gAgent.isGodlike()))
{
- llinfos << "Compile failed!" << llendl;
+ LL_INFOS() << "Compile failed!" << LL_ENDL;
//char command[256];
//sprintf(command, "type %s\n", err_filename.c_str());
//system(command);
@@ -1552,7 +1539,7 @@ void LLPreviewLSL::uploadAssetLegacy(const std::string& filename,
}
else
{
- llinfos << "Compile worked!" << llendl;
+ LL_INFOS() << "Compile worked!" << LL_ENDL;
if(gAssetStorage)
{
getWindow()->incBusyCount();
@@ -1594,8 +1581,8 @@ void LLPreviewLSL::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32
}
else
{
- llwarns << "Inventory item for script " << info->mItemUUID
- << " is no longer in agent inventory." << llendl;
+ LL_WARNS() << "Inventory item for script " << info->mItemUUID
+ << " is no longer in agent inventory." << LL_ENDL;
}
// Find our window and close it if requested.
@@ -1614,7 +1601,7 @@ void LLPreviewLSL::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32
}
else
{
- llwarns << "Problem saving script: " << status << llendl;
+ LL_WARNS() << "Problem saving script: " << status << LL_ENDL;
LLSD args;
args["REASON"] = std::string(LLAssetStorage::getErrorString(status));
LLNotificationsUtil::add("SaveScriptFailReason", args);
@@ -1652,7 +1639,7 @@ void LLPreviewLSL::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_d
}
else
{
- llwarns << "Problem saving LSL Bytecode (Preview)" << llendl;
+ LL_WARNS() << "Problem saving LSL Bytecode (Preview)" << LL_ENDL;
LLSD args;
args["REASON"] = std::string(LLAssetStorage::getErrorString(status));
LLNotificationsUtil::add("SaveBytecodeFailReason", args);
@@ -1664,8 +1651,8 @@ void LLPreviewLSL::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* user_d
void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAssetType::EType type,
void* user_data, S32 status, LLExtStat ext_status)
{
- lldebugs << "LLPreviewLSL::onLoadComplete: got uuid " << asset_uuid
- << llendl;
+ LL_DEBUGS() << "LLPreviewLSL::onLoadComplete: got uuid " << asset_uuid
+ << LL_ENDL;
LLUUID* item_uuid = (LLUUID*)user_data;
LLPreviewLSL* preview = LLFloaterReg::findTypedInstance<LLPreviewLSL>("preview_script", *item_uuid);
if( preview )
@@ -1695,8 +1682,6 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset
}
else
{
- LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED );
-
if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ||
LL_ERR_FILE_EMPTY == status)
{
@@ -1712,7 +1697,7 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset
}
preview->mAssetStatus = PREVIEW_ASSET_ERROR;
- llwarns << "Problem loading script: " << status << llendl;
+ LL_WARNS() << "Problem loading script: " << status << LL_ENDL;
}
}
delete item_uuid;
@@ -1727,7 +1712,6 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset
//static
void* LLLiveLSLEditor::createScriptEdPanel(void* userdata)
{
-
LLLiveLSLEditor *self = (LLLiveLSLEditor*)userdata;
self->mScriptEd = new LLScriptEdCore(
@@ -1738,8 +1722,8 @@ void* LLLiveLSLEditor::createScriptEdPanel(void* userdata)
&LLLiveLSLEditor::onSave,
&LLLiveLSLEditor::onSearchReplace,
self,
+ true,
0);
-
return self->mScriptEd;
}
@@ -1779,7 +1763,7 @@ void LLLiveLSLEditor::callbackLSLCompileSucceeded(const LLUUID& task_id,
const LLUUID& item_id,
bool is_script_running)
{
- lldebugs << "LSL Bytecode saved" << llendl;
+ LL_DEBUGS() << "LSL Bytecode saved" << LL_ENDL;
mScriptEd->mErrorList->setCommentText(LLTrans::getString("CompileSuccessful"));
mScriptEd->mErrorList->setCommentText(LLTrans::getString("SaveComplete"));
closeIfNeeded();
@@ -1788,7 +1772,7 @@ void LLLiveLSLEditor::callbackLSLCompileSucceeded(const LLUUID& task_id,
// virtual
void LLLiveLSLEditor::callbackLSLCompileFailed(const LLSD& compile_errors)
{
- lldebugs << "Compile failed!" << llendl;
+ LL_DEBUGS() << "Compile failed!" << LL_ENDL;
for(LLSD::array_const_iterator line = compile_errors.beginArray();
line < compile_errors.endArray();
line++)
@@ -1807,7 +1791,7 @@ void LLLiveLSLEditor::callbackLSLCompileFailed(const LLSD& compile_errors)
void LLLiveLSLEditor::loadAsset()
{
- //llinfos << "LLLiveLSLEditor::loadAsset()" << llendl;
+ //LL_INFOS() << "LLLiveLSLEditor::loadAsset()" << LL_ENDL;
if(!mIsNew)
{
LLViewerObject* object = gObjectList.findObject(mObjectUUID);
@@ -1819,7 +1803,7 @@ void LLLiveLSLEditor::loadAsset()
|| gAgent.isGodlike()))
{
mItem = new LLViewerInventoryItem(item);
- //llinfos << "asset id " << mItem->getAssetUUID() << llendl;
+ //LL_INFOS() << "asset id " << mItem->getAssetUUID() << LL_ENDL;
}
if(!gAgent.isGodlike()
@@ -1867,7 +1851,7 @@ void LLLiveLSLEditor::loadAsset()
mIsModifiable = item && gAgent.allowOperation(PERM_MODIFY,
item->getPermissions(),
GP_OBJECT_MANIPULATE);
-
+
// This is commented out, because we don't completely
// handle script exports yet.
/*
@@ -1911,8 +1895,8 @@ void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id,
LLAssetType::EType type,
void* user_data, S32 status, LLExtStat ext_status)
{
- lldebugs << "LLLiveLSLEditor::onLoadComplete: got uuid " << asset_id
- << llendl;
+ LL_DEBUGS() << "LLLiveLSLEditor::onLoadComplete: got uuid " << asset_id
+ << LL_ENDL;
LLUUID* xored_id = (LLUUID*)user_data;
LLLiveLSLEditor* instance = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", *xored_id);
@@ -1927,8 +1911,6 @@ void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id,
}
else
{
- LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED );
-
if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ||
LL_ERR_FILE_EMPTY == status)
{
@@ -1959,13 +1941,14 @@ void LLLiveLSLEditor::loadScriptText(LLVFS *vfs, const LLUUID &uuid, LLAssetType
if (file.getLastBytesRead() != file_length ||
file_length <= 0)
{
- llwarns << "Error reading " << uuid << ":" << type << llendl;
+ LL_WARNS() << "Error reading " << uuid << ":" << type << LL_ENDL;
}
buffer[file_length] = '\0';
mScriptEd->setScriptText(LLStringExplicit(&buffer[0]), TRUE);
mScriptEd->mEditor->makePristine();
+ mScriptEd->setScriptName(getItem()->getName());
}
@@ -2182,7 +2165,7 @@ void LLLiveLSLEditor::uploadAssetViaCaps(const std::string& url,
const LLUUID& item_id,
BOOL is_running)
{
- llinfos << "Update Task Inventory via capability " << url << llendl;
+ LL_INFOS() << "Update Task Inventory via capability " << url << LL_ENDL;
LLSD body;
body["task_id"] = task_id;
body["item_id"] = item_id;
@@ -2221,7 +2204,7 @@ void LLLiveLSLEditor::uploadAssetLegacy(const std::string& filename,
gAgent.isGodlike()))
{
// load the error file into the error scrolllist
- llinfos << "Compile failed!" << llendl;
+ LL_INFOS() << "Compile failed!" << LL_ENDL;
if(NULL != (fp = LLFile::fopen(err_filename, "r")))
{
char buffer[MAX_STRING]; /*Flawfinder: ignore*/
@@ -2259,12 +2242,12 @@ void LLLiveLSLEditor::uploadAssetLegacy(const std::string& filename,
}
else
{
- llinfos << "Compile worked!" << llendl;
+ LL_INFOS() << "Compile worked!" << LL_ENDL;
mScriptEd->mErrorList->setCommentText(LLTrans::getString("CompileSuccessfulSaving"));
if(gAssetStorage)
{
- llinfos << "LLLiveLSLEditor::saveAsset "
- << mItem->getAssetUUID() << llendl;
+ LL_INFOS() << "LLLiveLSLEditor::saveAsset "
+ << mItem->getAssetUUID() << LL_ENDL;
getWindow()->incBusyCount();
mPendingUploads++;
LLLiveLSLSaveData* data = NULL;
@@ -2297,7 +2280,7 @@ void LLLiveLSLEditor::onSaveTextComplete(const LLUUID& asset_uuid, void* user_da
if (status)
{
- llwarns << "Unable to save text for a script." << llendl;
+ LL_WARNS() << "Unable to save text for a script." << LL_ENDL;
LLSD args;
args["REASON"] = std::string(LLAssetStorage::getErrorString(status));
LLNotificationsUtil::add("CompileQueueSaveText", args);
@@ -2328,7 +2311,7 @@ void LLLiveLSLEditor::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* use
return;
if(0 ==status)
{
- llinfos << "LSL Bytecode saved" << llendl;
+ LL_INFOS() << "LSL Bytecode saved" << LL_ENDL;
LLLiveLSLEditor* self = LLFloaterReg::findTypedInstance<LLLiveLSLEditor>("preview_scriptedit", data->mItem->getUUID()); // ^ data->mSaveObjectID
if (self)
{
@@ -2354,8 +2337,8 @@ void LLLiveLSLEditor::onSaveBytecodeComplete(const LLUUID& asset_uuid, void* use
}
else
{
- llinfos << "Problem saving LSL Bytecode (Live Editor)" << llendl;
- llwarns << "Unable to save a compiled script." << llendl;
+ LL_INFOS() << "Problem saving LSL Bytecode (Live Editor)" << LL_ENDL;
+ LL_WARNS() << "Unable to save a compiled script." << LL_ENDL;
LLSD args;
args["REASON"] = std::string(LLAssetStorage::getErrorString(status));
diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h
index 9fb0a4fb63..515f277c4a 100755
--- a/indra/newview/llpreviewscript.h
+++ b/indra/newview/llpreviewscript.h
@@ -27,7 +27,6 @@
#ifndef LL_LLPREVIEWSCRIPT_H
#define LL_LLPREVIEWSCRIPT_H
-#include "lldarray.h"
#include "llpreview.h"
#include "lltabcontainer.h"
#include "llinventory.h"
@@ -35,10 +34,11 @@
#include "lliconctrl.h"
#include "llframetimer.h"
#include "llfloatergotoline.h"
+#include "llsyntaxid.h"
class LLLiveLSLFile;
class LLMessageSystem;
-class LLTextEditor;
+class LLScriptEditor;
class LLButton;
class LLCheckBoxCtrl;
class LLScrollListCtrl;
@@ -72,11 +72,15 @@ protected:
void (*save_callback)(void* userdata, BOOL close_after_save),
void (*search_replace_callback)(void* userdata),
void* userdata,
+ bool live,
S32 bottom_pad = 0); // pad below bottom row of buttons
public:
~LLScriptEdCore();
+ void initializeKeywords();
void initMenu();
+ void processKeywords();
+ void processLoaded();
virtual void draw();
/*virtual*/ BOOL postBuild();
@@ -110,6 +114,8 @@ public:
virtual bool hasAccelerators() const { return true; }
+ void setScriptName(const std::string& name){mScriptName = name;};
+
private:
void onBtnHelp();
void onBtnDynamicHelp();
@@ -130,9 +136,12 @@ protected:
void addHelpItemToHistory(const std::string& help_string);
static void onErrorList(LLUICtrl*, void* user_data);
+ bool mLive;
+
private:
std::string mSampleText;
- LLTextEditor* mEditor;
+ std::string mScriptName;
+ LLScriptEditor* mEditor;
void (*mLoadCallback)(void* userdata);
void (*mSaveCallback)(void* userdata, BOOL close_after_save);
void (*mSearchReplaceCallback) (void* userdata);
@@ -141,7 +150,7 @@ private:
BOOL mForceClose;
LLPanel* mCodePanel;
LLScrollListCtrl* mErrorList;
- LLDynamicArray<LLEntryAndEdCore*> mBridges;
+ std::vector<LLEntryAndEdCore*> mBridges;
LLHandle<LLFloater> mLiveHelpHandle;
LLKeywordToken* mLastHelpToken;
LLFrameTimer mLiveHelpTimer;
@@ -151,6 +160,10 @@ private:
LLLiveLSLFile* mLiveFile;
LLScriptEdContainer* mContainer; // parent view
+
+public:
+ boost::signals2::connection mSyntaxIDConnection;
+
};
class LLScriptEdContainer : public LLPreview
@@ -159,6 +172,7 @@ class LLScriptEdContainer : public LLPreview
public:
LLScriptEdContainer(const LLSD& key);
+ LLScriptEdContainer(const LLSD& key, const bool live);
protected:
std::string getTmpFileName();
@@ -168,7 +182,7 @@ protected:
LLScriptEdCore* mScriptEd;
};
-// Used to view and edit a LSL from your inventory.
+// Used to view and edit an LSL script from your inventory.
class LLPreviewLSL : public LLScriptEdContainer
{
public:
@@ -213,7 +227,7 @@ protected:
};
-// Used to view and edit an LSL that is attached to an object.
+// Used to view and edit an LSL script that is attached to an object.
class LLLiveLSLEditor : public LLScriptEdContainer
{
friend class LLLiveLSLFile;
diff --git a/indra/newview/llpreviewsound.cpp b/indra/newview/llpreviewsound.cpp
index 33d2d015ad..105c5e8cbe 100755
--- a/indra/newview/llpreviewsound.cpp
+++ b/indra/newview/llpreviewsound.cpp
@@ -55,7 +55,9 @@ BOOL LLPreviewSound::postBuild()
{
getChild<LLUICtrl>("desc")->setValue(item->getDescription());
if (gAudiop)
+ {
gAudiop->preloadSound(item->getAssetUUID()); // preload the sound
+ }
}
childSetAction("Sound play btn",&LLPreviewSound::playSound,this);
@@ -93,7 +95,6 @@ void LLPreviewSound::auditionSound( void *userdata )
if(item && gAudiop)
{
- LLVector3d lpos_global = gAgent.getPositionGlobal();
- gAudiop->triggerSound(item->getAssetUUID(), gAgent.getID(), SOUND_GAIN, LLAudioEngine::AUDIO_TYPE_UI, lpos_global);
+ gAudiop->triggerSound(item->getAssetUUID(), gAgent.getID(), SOUND_GAIN, LLAudioEngine::AUDIO_TYPE_SFX);
}
}
diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp
index 1ed48a978f..5c41c5ad97 100755
--- a/indra/newview/llpreviewtexture.cpp
+++ b/indra/newview/llpreviewtexture.cpp
@@ -127,9 +127,28 @@ BOOL LLPreviewTexture::postBuild()
getChild<LLLineEditor>("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe);
}
}
+
+ // Fill in ratios list with common aspect ratio values
+ mRatiosList.clear();
+ mRatiosList.push_back(LLTrans::getString("Unconstrained"));
+ mRatiosList.push_back("1:1");
+ mRatiosList.push_back("4:3");
+ mRatiosList.push_back("10:7");
+ mRatiosList.push_back("3:2");
+ mRatiosList.push_back("16:10");
+ mRatiosList.push_back("16:9");
+ mRatiosList.push_back("2:1");
- childSetCommitCallback("combo_aspect_ratio", onAspectRatioCommit, this);
+ // Now fill combo box with provided list
LLComboBox* combo = getChild<LLComboBox>("combo_aspect_ratio");
+ combo->removeall();
+
+ for (std::vector<std::string>::const_iterator it = mRatiosList.begin(); it != mRatiosList.end(); ++it)
+ {
+ combo->add(*it);
+ }
+
+ childSetCommitCallback("combo_aspect_ratio", onAspectRatioCommit, this);
combo->setCurrentByIndex(0);
return LLPreview::postBuild();
@@ -414,6 +433,13 @@ void LLPreviewTexture::updateDimensions()
{
return;
}
+
+ if (mAssetStatus != PREVIEW_ASSET_LOADED)
+ {
+ mAssetStatus = PREVIEW_ASSET_LOADED;
+ // Asset has been fully loaded, adjust aspect ratio
+ adjustAspectRatio();
+ }
// Update the width/height display every time
getChild<LLUICtrl>("dimensions")->setTextArg("[WIDTH]", llformat("%d", mImage->getFullWidth()));
@@ -501,6 +527,46 @@ LLPreview::EAssetStatus LLPreviewTexture::getAssetStatus()
return mAssetStatus;
}
+void LLPreviewTexture::adjustAspectRatio()
+{
+ S32 w = mImage->getFullWidth();
+ S32 h = mImage->getFullHeight();
+
+ // Determine aspect ratio of the image
+ S32 tmp;
+ while (h != 0)
+ {
+ tmp = w % h;
+ w = h;
+ h = tmp;
+ }
+ S32 divisor = w;
+ S32 num = mImage->getFullWidth() / divisor;
+ S32 denom = mImage->getFullHeight() / divisor;
+
+ if (setAspectRatio(num, denom))
+ {
+ // Select corresponding ratio entry in the combo list
+ LLComboBox* combo = getChild<LLComboBox>("combo_aspect_ratio");
+ if (combo)
+ {
+ std::ostringstream ratio;
+ ratio << num << ":" << denom;
+ std::vector<std::string>::const_iterator found = std::find(mRatiosList.begin(), mRatiosList.end(), ratio.str());
+ if (found == mRatiosList.end())
+ {
+ combo->setCurrentByIndex(0);
+ }
+ else
+ {
+ combo->setCurrentByIndex(found - mRatiosList.begin());
+ }
+ }
+ }
+
+ mUpdateDimensions = TRUE;
+}
+
void LLPreviewTexture::updateImageID()
{
const LLViewerInventoryItem *item = static_cast<const LLViewerInventoryItem*>(getItem());
diff --git a/indra/newview/llpreviewtexture.h b/indra/newview/llpreviewtexture.h
index cd16bacde2..97e74706cc 100755
--- a/indra/newview/llpreviewtexture.h
+++ b/indra/newview/llpreviewtexture.h
@@ -70,6 +70,7 @@ protected:
/* virtual */ BOOL postBuild();
bool setAspectRatio(const F32 width, const F32 height);
static void onAspectRatioCommit(LLUICtrl*,void* userdata);
+ void adjustAspectRatio();
private:
void updateImageID(); // set what image is being uploaded.
@@ -95,5 +96,6 @@ private:
F32 mAspectRatio;
LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList ;
+ std::vector<std::string> mRatiosList;
};
#endif // LL_LLPREVIEWTEXTURE_H
diff --git a/indra/newview/llproductinforequest.cpp b/indra/newview/llproductinforequest.cpp
index 1390000fc5..e92bf4590d 100755
--- a/indra/newview/llproductinforequest.cpp
+++ b/indra/newview/llproductinforequest.cpp
@@ -35,18 +35,24 @@
class LLProductInfoRequestResponder : public LLHTTPClient::Responder
{
-public:
+ LOG_CLASS(LLProductInfoRequestResponder);
+private:
//If we get back a normal response, handle it here
- virtual void result(const LLSD& content)
+ /* virtual */ void httpSuccess()
{
- LLProductInfoRequestManager::instance().setSkuDescriptions(content);
+ const LLSD& content = getContent();
+ if (!content.isArray())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
+ LLProductInfoRequestManager::instance().setSkuDescriptions(getContent());
}
//If we get back an error (not found, etc...), handle it here
- virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+ /* virtual */ void httpFailure()
{
- llwarns << "LLProductInfoRequest error [status:"
- << status << ":] " << content << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
}
};
@@ -76,7 +82,7 @@ std::string LLProductInfoRequestManager::getDescriptionForSku(const std::string&
it != mSkuDescriptions.endArray();
++it)
{
- // llwarns << (*it)["sku"].asString() << " = " << (*it)["description"].asString() << llendl;
+ // LL_WARNS() << (*it)["sku"].asString() << " = " << (*it)["description"].asString() << LL_ENDL;
if ((*it)["sku"].asString() == sku)
{
return (*it)["description"].asString();
diff --git a/indra/newview/llregioninfomodel.cpp b/indra/newview/llregioninfomodel.cpp
index 590e246482..25c576468b 100755
--- a/indra/newview/llregioninfomodel.cpp
+++ b/indra/newview/llregioninfomodel.cpp
@@ -192,11 +192,11 @@ void LLRegionInfoModel::sendEstateOwnerMessage(
if (!cur_region)
{
- llwarns << "Agent region not set" << llendl;
+ LL_WARNS() << "Agent region not set" << LL_ENDL;
return;
}
- llinfos << "Sending estate request '" << request << "'" << llendl;
+ LL_INFOS() << "Sending estate request '" << request << "'" << LL_ENDL;
msg->newMessage("EstateOwnerMessage");
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
@@ -217,7 +217,7 @@ void LLRegionInfoModel::sendEstateOwnerMessage(
std::vector<std::string>::const_iterator end = strings.end();
for (unsigned i = 0; it != end; ++it, ++i)
{
- lldebugs << "- [" << i << "] " << (*it) << llendl;
+ LL_DEBUGS() << "- [" << i << "] " << (*it) << LL_ENDL;
msg->nextBlock("ParamList");
msg->addString("Parameter", *it);
}
diff --git a/indra/newview/llremoteparcelrequest.cpp b/indra/newview/llremoteparcelrequest.cpp
index 500dec7ee5..29dcc12f9e 100755
--- a/indra/newview/llremoteparcelrequest.cpp
+++ b/indra/newview/llremoteparcelrequest.cpp
@@ -47,9 +47,15 @@ LLRemoteParcelRequestResponder::LLRemoteParcelRequestResponder(LLHandle<LLRemote
//If we get back a normal response, handle it here
//virtual
-void LLRemoteParcelRequestResponder::result(const LLSD& content)
+void LLRemoteParcelRequestResponder::httpSuccess()
{
- LLUUID parcel_id = content["parcel_id"];
+ const LLSD& content = getContent();
+ if (!content.isMap() || !content.has("parcel_id"))
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
+ LLUUID parcel_id = getContent()["parcel_id"];
// Panel inspecting the information may be closed and destroyed
// before this response is received.
@@ -62,17 +68,16 @@ void LLRemoteParcelRequestResponder::result(const LLSD& content)
//If we get back an error (not found, etc...), handle it here
//virtual
-void LLRemoteParcelRequestResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+void LLRemoteParcelRequestResponder::httpFailure()
{
- llwarns << "LLRemoteParcelRequest error [status:"
- << status << "]: " << content << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
// Panel inspecting the information may be closed and destroyed
// before this response is received.
LLRemoteParcelInfoObserver* observer = mObserverHandle.get();
if (observer)
{
- observer->setErrorStatus(status, reason);
+ observer->setErrorStatus(getStatus(), getReason());
}
}
diff --git a/indra/newview/llremoteparcelrequest.h b/indra/newview/llremoteparcelrequest.h
index b87056573b..35348b69ff 100755
--- a/indra/newview/llremoteparcelrequest.h
+++ b/indra/newview/llremoteparcelrequest.h
@@ -30,23 +30,25 @@
#define LL_LLREMOTEPARCELREQUEST_H
#include "llhttpclient.h"
-#include "llpanel.h"
+#include "llhandle.h"
+#include "llsingleton.h"
class LLMessageSystem;
class LLRemoteParcelInfoObserver;
class LLRemoteParcelRequestResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(LLRemoteParcelRequestResponder);
public:
LLRemoteParcelRequestResponder(LLHandle<LLRemoteParcelInfoObserver> observer_handle);
+private:
//If we get back a normal response, handle it here
- /*virtual*/ void result(const LLSD& content);
+ /*virtual*/ void httpSuccess();
//If we get back an error (not found, etc...), handle it here
- /*virtual*/ void errorWithContent(U32 status, const std::string& reason, const LLSD& content);
+ /*virtual*/ void httpFailure();
-protected:
LLHandle<LLRemoteParcelInfoObserver> mObserverHandle;
};
@@ -78,7 +80,7 @@ public:
virtual ~LLRemoteParcelInfoObserver() {}
virtual void processParcelInfo(const LLParcelData& parcel_data) = 0;
virtual void setParcelID(const LLUUID& parcel_id) = 0;
- virtual void setErrorStatus(U32 status, const std::string& reason) = 0;
+ virtual void setErrorStatus(S32 status, const std::string& reason) = 0;
LLHandle<LLRemoteParcelInfoObserver> getObserverHandle() const { return mObserverHandle; }
protected:
diff --git a/indra/newview/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp
new file mode 100644
index 0000000000..179a73413e
--- /dev/null
+++ b/indra/newview/llscenemonitor.cpp
@@ -0,0 +1,774 @@
+/**
+ * @file llscenemonitor.cpp
+ * @brief monitor the scene loading process.
+ *
+ * $LicenseInfo:firstyear=2003&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+#include "llrendertarget.h"
+#include "llscenemonitor.h"
+#include "llviewerwindow.h"
+#include "llviewerdisplay.h"
+#include "llviewercontrol.h"
+#include "llviewershadermgr.h"
+#include "llui.h"
+#include "llstartup.h"
+#include "llappviewer.h"
+#include "llwindow.h"
+#include "llpointer.h"
+#include "llspatialpartition.h"
+#include "llagent.h"
+#include "pipeline.h"
+#include "llviewerpartsim.h"
+
+LLSceneMonitorView* gSceneMonitorView = NULL;
+
+//
+//The procedures of monitoring when the scene finishes loading visually,
+//i.e., no pixel differences among frames, are:
+//1, freeze all dynamic objects and avatars;
+//2, (?) disable all sky and water;
+//3, capture frames periodically, by calling "capture()";
+//4, compute pixel differences between two latest captured frames, by calling "compare()", results are stored at mDiff;
+//5, compute the number of pixels in mDiff above some tolerance threshold in GPU, by calling "calcDiffAggregate()";
+//6, use gl occlusion query to fetch the result from GPU, by calling "fetchQueryResult()";
+//END.
+//
+
+LLSceneMonitor::LLSceneMonitor() :
+ mEnabled(false),
+ mDiff(NULL),
+ mDiffResult(0.f),
+ mDiffTolerance(0.1f),
+ mDiffState(WAITING_FOR_NEXT_DIFF),
+ mDebugViewerVisible(false),
+ mQueryObject(0),
+ mDiffPixelRatio(0.5f)
+{
+ mFrames[0] = NULL;
+ mFrames[1] = NULL;
+}
+
+LLSceneMonitor::~LLSceneMonitor()
+{
+ mDiffState = VIEWER_QUITTING;
+ reset();
+
+ mDitheringTexture = NULL;
+}
+
+void LLSceneMonitor::reset()
+{
+ delete mFrames[0];
+ delete mFrames[1];
+ delete mDiff;
+
+ mFrames[0] = NULL;
+ mFrames[1] = NULL;
+ mDiff = NULL;
+
+ mMonitorRecording.reset();
+ mSceneLoadRecording.reset();
+ mRecordingTimer.reset();
+
+ unfreezeScene();
+
+ if(mQueryObject > 0)
+ {
+ LLOcclusionCullingGroup::releaseOcclusionQueryObjectName(mQueryObject);
+ mQueryObject = 0;
+ }
+}
+
+void LLSceneMonitor::generateDitheringTexture(S32 width, S32 height)
+{
+#if 1
+ //4 * 4 matrix
+ mDitherMatrixWidth = 4;
+ S32 dither_matrix[4][4] =
+ {
+ {1, 9, 3, 11},
+ {13, 5, 15, 7},
+ {4, 12, 2, 10},
+ {16, 8, 14, 6}
+ };
+
+ mDitherScale = 255.f / 17;
+#else
+ //8 * 8 matrix
+ mDitherMatrixWidth = 16;
+ S32 dither_matrix[16][16] =
+ {
+ {1, 49, 13, 61, 4, 52, 16, 64, 1, 49, 13, 61, 4, 52, 16, 64},
+ {33, 17, 45, 29, 36, 20, 48, 32, 33, 17, 45, 29, 36, 20, 48, 32},
+ {9, 57, 5, 53, 12, 60, 8, 56, 9, 57, 5, 53, 12, 60, 8, 56},
+ {41, 25, 37, 21, 44, 28, 40, 24, 41, 25, 37, 21, 44, 28, 40, 24},
+ {3, 51, 15, 63, 2, 50, 14, 62, 3, 51, 15, 63, 2, 50, 14, 62},
+ {35, 19, 47, 31, 34, 18, 46, 30, 35, 19, 47, 31, 34, 18, 46, 30},
+ {11, 59, 7, 55, 10, 58, 6, 54, 11, 59, 7, 55, 10, 58, 6, 54},
+ {43, 27, 39, 23, 42, 26, 38, 22, 43, 27, 39, 23, 42, 26, 38, 22},
+ {1, 49, 13, 61, 4, 52, 16, 64, 1, 49, 13, 61, 4, 52, 16, 64},
+ {33, 17, 45, 29, 36, 20, 48, 32, 33, 17, 45, 29, 36, 20, 48, 32},
+ {9, 57, 5, 53, 12, 60, 8, 56, 9, 57, 5, 53, 12, 60, 8, 56},
+ {41, 25, 37, 21, 44, 28, 40, 24, 41, 25, 37, 21, 44, 28, 40, 24},
+ {3, 51, 15, 63, 2, 50, 14, 62, 3, 51, 15, 63, 2, 50, 14, 62},
+ {35, 19, 47, 31, 34, 18, 46, 30, 35, 19, 47, 31, 34, 18, 46, 30},
+ {11, 59, 7, 55, 10, 58, 6, 54, 11, 59, 7, 55, 10, 58, 6, 54},
+ {43, 27, 39, 23, 42, 26, 38, 22, 43, 27, 39, 23, 42, 26, 38, 22}
+ };
+
+ mDitherScale = 255.f / 65;
+#endif
+
+ LLPointer<LLImageRaw> image_raw = new LLImageRaw(mDitherMatrixWidth, mDitherMatrixWidth, 3);
+ U8* data = image_raw->getData();
+ for (S32 i = 0; i < mDitherMatrixWidth; i++)
+ {
+ for (S32 j = 0; j < mDitherMatrixWidth; j++)
+ {
+ U8 val = dither_matrix[i][j];
+ *data++ = val;
+ *data++ = val;
+ *data++ = val;
+ }
+ }
+
+ mDitheringTexture = LLViewerTextureManager::getLocalTexture(image_raw.get(), FALSE) ;
+ mDitheringTexture->setAddressMode(LLTexUnit::TAM_WRAP);
+ mDitheringTexture->setFilteringOption(LLTexUnit::TFO_POINT);
+
+ mDitherScaleS = (F32)width / mDitherMatrixWidth;
+ mDitherScaleT = (F32)height / mDitherMatrixWidth;
+}
+
+void LLSceneMonitor::setDebugViewerVisible(bool visible)
+{
+ mDebugViewerVisible = visible;
+}
+
+LLRenderTarget& LLSceneMonitor::getCaptureTarget()
+{
+ LLRenderTarget* cur_target = NULL;
+
+ S32 width = gViewerWindow->getWorldViewWidthRaw();
+ S32 height = gViewerWindow->getWorldViewHeightRaw();
+
+ if(!mFrames[0])
+ {
+ mFrames[0] = new LLRenderTarget();
+ mFrames[0]->allocate(width, height, GL_RGB, false, false, LLTexUnit::TT_TEXTURE, true);
+ gGL.getTexUnit(0)->bind(mFrames[0]);
+ gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
+ gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+
+ cur_target = mFrames[0];
+ }
+ else if(!mFrames[1])
+ {
+ mFrames[1] = new LLRenderTarget();
+ mFrames[1]->allocate(width, height, GL_RGB, false, false, LLTexUnit::TT_TEXTURE, true);
+ gGL.getTexUnit(0)->bind(mFrames[1]);
+ gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
+ gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+
+ cur_target = mFrames[1];
+ }
+ else //swap
+ {
+ cur_target = mFrames[0];
+ mFrames[0] = mFrames[1];
+ mFrames[1] = cur_target;
+ }
+
+ if(cur_target->getWidth() != width || cur_target->getHeight() != height) //size changed
+ {
+ cur_target->resize(width, height);
+ }
+
+ // we're promising the target exists
+ return *cur_target;
+}
+
+void LLSceneMonitor::freezeAvatar(LLCharacter* avatarp)
+{
+ if(mEnabled)
+ {
+ mAvatarPauseHandles.push_back(avatarp->requestPause());
+ }
+}
+
+void LLSceneMonitor::freezeScene()
+{
+ if(!mEnabled)
+ {
+ return;
+ }
+
+ //freeze all avatars
+ for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
+ iter != LLCharacter::sInstances.end(); ++iter)
+ {
+ freezeAvatar((LLCharacter*)(*iter));
+ }
+
+ // freeze everything else
+ gSavedSettings.setBOOL("FreezeTime", TRUE);
+
+ //disable sky, water and clouds
+ gPipeline.clearRenderTypeMask(LLPipeline::RENDER_TYPE_SKY, LLPipeline::RENDER_TYPE_WL_SKY,
+ LLPipeline::RENDER_TYPE_WATER, LLPipeline::RENDER_TYPE_CLOUDS, LLPipeline::END_RENDER_TYPES);
+
+ //disable particle system
+ LLViewerPartSim::getInstance()->enable(false);
+}
+
+void LLSceneMonitor::unfreezeScene()
+{
+ //thaw all avatars
+ mAvatarPauseHandles.clear();
+
+ if(mDiffState == VIEWER_QUITTING)
+ {
+ return;
+ }
+
+ // thaw everything else
+ gSavedSettings.setBOOL("FreezeTime", FALSE);
+
+ //enable sky, water and clouds
+ gPipeline.setRenderTypeMask(LLPipeline::RENDER_TYPE_SKY, LLPipeline::RENDER_TYPE_WL_SKY,
+ LLPipeline::RENDER_TYPE_WATER, LLPipeline::RENDER_TYPE_CLOUDS, LLPipeline::END_RENDER_TYPES);
+
+ //enable particle system
+ LLViewerPartSim::getInstance()->enable(true);
+}
+
+void LLSceneMonitor::capture()
+{
+ static U32 last_capture_frame = 0;
+ static LLCachedControl<bool> monitor_enabled(gSavedSettings, "SceneLoadingMonitorEnabled");
+ static LLCachedControl<F32> scene_load_sample_time(gSavedSettings, "SceneLoadingMonitorSampleTime");
+ static bool force_capture = true;
+
+ bool enabled = LLGLSLShader::sNoFixedFunction && (monitor_enabled || mDebugViewerVisible);
+ if(mEnabled != enabled)
+ {
+ if(mEnabled)
+ {
+ mEnabled = enabled;
+ unfreezeScene();
+ reset();
+ force_capture = true;
+ }
+ else
+ {
+ mEnabled = enabled;
+ reset();
+ freezeScene();
+ }
+ }
+
+ if (mEnabled
+ && (mMonitorRecording.getSum(*LLViewerCamera::getVelocityStat()) > 0.1f
+ || mMonitorRecording.getSum(*LLViewerCamera::getAngularVelocityStat()) > 0.05f))
+ {
+ reset();
+ freezeScene();
+ force_capture = true;
+ }
+
+ if(mEnabled
+ && (mRecordingTimer.getElapsedTimeF32() > scene_load_sample_time()
+ || force_capture)
+ && last_capture_frame != gFrameCount)
+ {
+ force_capture = false;
+
+ mSceneLoadRecording.resume();
+ mMonitorRecording.resume();
+
+ last_capture_frame = gFrameCount;
+
+ LLRenderTarget& cur_target = getCaptureTarget();
+
+ U32 old_FBO = LLRenderTarget::sCurFBO;
+
+ gGL.getTexUnit(0)->bind(&cur_target);
+ glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); //point to the main frame buffer.
+
+ glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, cur_target.getWidth(), cur_target.getHeight()); //copy the content
+
+ glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, old_FBO);
+
+ mDiffState = NEED_DIFF;
+ }
+}
+
+bool LLSceneMonitor::needsUpdate() const
+{
+ return mDiffState == NEED_DIFF;
+}
+
+static LLTrace::BlockTimerStatHandle FTM_GENERATE_SCENE_LOAD_DITHER_TEXTURE("Generate Scene Load Dither Texture");
+static LLTrace::BlockTimerStatHandle FTM_SCENE_LOAD_IMAGE_DIFF("Scene Load Image Diff");
+
+static LLStaticHashedString sDitherScale("dither_scale");
+static LLStaticHashedString sDitherScaleS("dither_scale_s");
+static LLStaticHashedString sDitherScaleT("dither_scale_t");
+
+void LLSceneMonitor::compare()
+{
+#ifdef LL_WINDOWS
+ if(mDiffState != NEED_DIFF)
+ {
+ return;
+ }
+
+ if(!mFrames[0] || !mFrames[1])
+ {
+ return;
+ }
+ if(mFrames[0]->getWidth() != mFrames[1]->getWidth() || mFrames[0]->getHeight() != mFrames[1]->getHeight())
+ { //size does not match
+ return;
+ }
+
+ LL_RECORD_BLOCK_TIME(FTM_SCENE_LOAD_IMAGE_DIFF);
+ mDiffState = EXECUTE_DIFF;
+
+ S32 width = gViewerWindow->getWindowWidthRaw();
+ S32 height = gViewerWindow->getWindowHeightRaw();
+ if(!mDiff)
+ {
+ LL_RECORD_BLOCK_TIME(FTM_GENERATE_SCENE_LOAD_DITHER_TEXTURE);
+ mDiff = new LLRenderTarget();
+ mDiff->allocate(width, height, GL_RGBA, false, false, LLTexUnit::TT_TEXTURE, true);
+
+ generateDitheringTexture(width, height);
+ }
+ else if(mDiff->getWidth() != width || mDiff->getHeight() != height)
+ {
+ LL_RECORD_BLOCK_TIME(FTM_GENERATE_SCENE_LOAD_DITHER_TEXTURE);
+ mDiff->resize(width, height);
+ generateDitheringTexture(width, height);
+ }
+
+ mDiff->bindTarget();
+ mDiff->clear();
+
+ gTwoTextureCompareProgram.bind();
+
+ gTwoTextureCompareProgram.uniform1f(sDitherScale, mDitherScale);
+ gTwoTextureCompareProgram.uniform1f(sDitherScaleS, mDitherScaleS);
+ gTwoTextureCompareProgram.uniform1f(sDitherScaleT, mDitherScaleT);
+
+ gGL.getTexUnit(0)->activate();
+ gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
+ gGL.getTexUnit(0)->bind(mFrames[0]);
+ gGL.getTexUnit(0)->activate();
+
+ gGL.getTexUnit(1)->activate();
+ gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE);
+ gGL.getTexUnit(1)->bind(mFrames[1]);
+ gGL.getTexUnit(1)->activate();
+
+ gGL.getTexUnit(2)->activate();
+ gGL.getTexUnit(2)->enable(LLTexUnit::TT_TEXTURE);
+ gGL.getTexUnit(2)->bind(mDitheringTexture);
+ gGL.getTexUnit(2)->activate();
+
+ gl_rect_2d_simple_tex(width, height);
+
+ mDiff->flush();
+
+ gTwoTextureCompareProgram.unbind();
+
+ gGL.getTexUnit(0)->disable();
+ gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+ gGL.getTexUnit(1)->disable();
+ gGL.getTexUnit(1)->unbind(LLTexUnit::TT_TEXTURE);
+ gGL.getTexUnit(2)->disable();
+ gGL.getTexUnit(2)->unbind(LLTexUnit::TT_TEXTURE);
+
+ if (!mDebugViewerVisible)
+ {
+ calcDiffAggregate();
+ }
+#endif
+}
+
+static LLStaticHashedString sTolerance("tolerance");
+
+//calculate Diff aggregate information in GPU, and enable gl occlusion query to capture it.
+void LLSceneMonitor::calcDiffAggregate()
+{
+#ifdef LL_WINDOWS
+
+ LL_RECORD_BLOCK_TIME(FTM_SCENE_LOAD_IMAGE_DIFF);
+
+ if(mDiffState != EXECUTE_DIFF && !mDebugViewerVisible)
+ {
+ return;
+ }
+
+ if(!mQueryObject)
+ {
+ mQueryObject = LLOcclusionCullingGroup::getNewOcclusionQueryObjectName();
+ }
+
+ LLGLDepthTest depth(true, false, GL_ALWAYS);
+ if(!mDebugViewerVisible)
+ {
+ glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
+ }
+
+ LLGLSLShader* cur_shader = NULL;
+
+ cur_shader = LLGLSLShader::sCurBoundShaderPtr;
+ gOneTextureFilterProgram.bind();
+ gOneTextureFilterProgram.uniform1f(sTolerance, mDiffTolerance);
+
+ if(mDiffState == EXECUTE_DIFF)
+ {
+ glBeginQueryARB(GL_SAMPLES_PASSED_ARB, mQueryObject);
+ }
+
+ gl_draw_scaled_target(0, 0, S32(mDiff->getWidth() * mDiffPixelRatio), S32(mDiff->getHeight() * mDiffPixelRatio), mDiff);
+
+ if(mDiffState == EXECUTE_DIFF)
+ {
+ glEndQueryARB(GL_SAMPLES_PASSED_ARB);
+ mDiffState = WAIT_ON_RESULT;
+ }
+
+ gOneTextureFilterProgram.unbind();
+
+ if(cur_shader != NULL)
+ {
+ cur_shader->bind();
+ }
+
+ if(!mDebugViewerVisible)
+ {
+ glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
+ }
+#endif
+}
+
+static LLTrace::EventStatHandle<> sFramePixelDiff("FramePixelDifference");
+void LLSceneMonitor::fetchQueryResult()
+{
+ LL_RECORD_BLOCK_TIME(FTM_SCENE_LOAD_IMAGE_DIFF);
+
+ // also throttle timing here, to avoid going below sample time due to phasing with frame capture
+ static LLCachedControl<F32> scene_load_sample_time_control(gSavedSettings, "SceneLoadingMonitorSampleTime");
+ F32Seconds scene_load_sample_time = (F32Seconds)scene_load_sample_time_control();
+
+ if(mDiffState == WAIT_ON_RESULT
+ && !LLAppViewer::instance()->quitRequested())
+ {
+ mDiffState = WAITING_FOR_NEXT_DIFF;
+
+ GLuint available = 0;
+ glGetQueryObjectuivARB(mQueryObject, GL_QUERY_RESULT_AVAILABLE_ARB, &available);
+ if(available)
+ {
+ GLuint count = 0;
+ glGetQueryObjectuivARB(mQueryObject, GL_QUERY_RESULT_ARB, &count);
+
+ mDiffResult = sqrtf(count * 0.5f / (mDiff->getWidth() * mDiff->getHeight() * mDiffPixelRatio * mDiffPixelRatio)); //0.5 -> (front face + back face)
+
+ LL_DEBUGS("SceneMonitor") << "Frame difference: " << mDiffResult << LL_ENDL;
+ record(sFramePixelDiff, mDiffResult);
+
+ static LLCachedControl<F32> diff_threshold(gSavedSettings,"SceneLoadingMonitorPixelDiffThreshold");
+ F32Seconds elapsed_time = mRecordingTimer.getElapsedTimeF32();
+
+ if (elapsed_time > scene_load_sample_time)
+ {
+ if(mDiffResult > diff_threshold())
+ {
+ mSceneLoadRecording.extend();
+ llassert_always(mSceneLoadRecording.getResults().getLastRecording().getDuration() > scene_load_sample_time);
+ }
+ else
+ {
+ mSceneLoadRecording.nextPeriod();
+ }
+ mRecordingTimer.reset();
+ }
+ }
+ }
+}
+
+//dump results to a file _scene_xmonitor_results.csv
+void LLSceneMonitor::dumpToFile(std::string file_name)
+{ using namespace LLTrace;
+
+ if (!hasResults()) return;
+
+ LL_INFOS("SceneMonitor") << "Saving scene load stats to " << file_name << LL_ENDL;
+
+ std::ofstream os(file_name.c_str());
+
+ os << std::setprecision(10);
+
+ PeriodicRecording& scene_load_recording = mSceneLoadRecording.getResults();
+ const U32 frame_count = scene_load_recording.getNumRecordedPeriods();
+
+ F64Seconds frame_time;
+
+ os << "Stat";
+ for (S32 frame = 1; frame <= frame_count; frame++)
+ {
+ frame_time += scene_load_recording.getPrevRecording(frame_count - frame).getDuration();
+ os << ", " << frame_time.value();
+ }
+ os << '\n';
+
+ os << "Sample period(s)";
+ for (S32 frame = 1; frame <= frame_count; frame++)
+ {
+ frame_time = scene_load_recording.getPrevRecording(frame_count - frame).getDuration();
+ os << ", " << frame_time.value();
+ }
+ os << '\n';
+
+
+ typedef StatType<CountAccumulator> trace_count;
+ for (trace_count::instance_iter it = trace_count::beginInstances(), end_it = trace_count::endInstances();
+ it != end_it;
+ ++it)
+ {
+ std::ostringstream row;
+ row << std::setprecision(10);
+
+ row << it->getName();
+
+ const char* unit_label = it->getUnitLabel();
+ if(unit_label[0])
+ {
+ row << "(" << unit_label << ")";
+ }
+
+ S32 samples = 0;
+
+ for (S32 frame = 1; frame <= frame_count; frame++)
+ {
+ Recording& recording = scene_load_recording.getPrevRecording(frame_count - frame);
+ samples += recording.getSampleCount(*it);
+ row << ", " << recording.getSum(*it);
+ }
+
+ row << '\n';
+
+ if (samples > 0)
+ {
+ os << row.str();
+ }
+ }
+
+ typedef StatType<EventAccumulator> trace_event;
+
+ for (trace_event::instance_iter it = trace_event::beginInstances(), end_it = trace_event::endInstances();
+ it != end_it;
+ ++it)
+ {
+ std::ostringstream row;
+ row << std::setprecision(10);
+ row << it->getName();
+
+ const char* unit_label = it->getUnitLabel();
+ if(unit_label[0])
+ {
+ row << "(" << unit_label << ")";
+ }
+
+ S32 samples = 0;
+
+ for (S32 frame = 1; frame <= frame_count; frame++)
+ {
+ Recording& recording = scene_load_recording.getPrevRecording(frame_count - frame);
+ samples += recording.getSampleCount(*it);
+ F64 mean = recording.getMean(*it);
+ if (llisnan(mean))
+ {
+ row << ", n/a";
+ }
+ else
+ {
+ row << ", " << mean;
+ }
+ }
+
+ row << '\n';
+
+ if (samples > 0)
+ {
+ os << row.str();
+ }
+ }
+
+ typedef StatType<SampleAccumulator> trace_sample;
+
+ for (trace_sample::instance_iter it = trace_sample::beginInstances(), end_it = trace_sample::endInstances();
+ it != end_it;
+ ++it)
+ {
+ std::ostringstream row;
+ row << std::setprecision(10);
+ row << it->getName();
+
+ const char* unit_label = it->getUnitLabel();
+ if(unit_label[0])
+ {
+ row << "(" << unit_label << ")";
+ }
+
+ S32 samples = 0;
+
+ for (S32 frame = 1; frame <= frame_count; frame++)
+ {
+ Recording& recording = scene_load_recording.getPrevRecording(frame_count - frame);
+ samples += recording.getSampleCount(*it);
+ F64 mean = recording.getMean(*it);
+ if (llisnan(mean))
+ {
+ row << ", n/a";
+ }
+ else
+ {
+ row << ", " << mean;
+ }
+ }
+
+ row << '\n';
+
+ if (samples > 0)
+ {
+ os << row.str();
+ }
+ }
+
+ typedef StatType<MemAccumulator> trace_mem;
+ for (trace_mem::instance_iter it = trace_mem::beginInstances(), end_it = trace_mem::endInstances();
+ it != end_it;
+ ++it)
+ {
+ os << it->getName() << "(KiB)";
+
+ for (S32 frame = 1; frame <= frame_count; frame++)
+ {
+ os << ", " << scene_load_recording.getPrevRecording(frame_count - frame).getMax(*it).valueInUnits<LLUnits::Kilobytes>();
+ }
+
+ os << '\n';
+ }
+
+ os.flush();
+ os.close();
+}
+
+//-------------------------------------------------------------------------------------------------------------
+//definition of class LLSceneMonitorView
+//-------------------------------------------------------------------------------------------------------------
+LLSceneMonitorView::LLSceneMonitorView(const LLRect& rect)
+ : LLFloater(LLSD())
+{
+ setRect(rect);
+ setVisible(FALSE);
+
+ setCanMinimize(false);
+ setCanClose(true);
+}
+
+void LLSceneMonitorView::onClose(bool app_quitting)
+{
+ setVisible(false);
+}
+
+void LLSceneMonitorView::onClickCloseBtn(bool app_quitting)
+{
+ setVisible(false);
+}
+
+void LLSceneMonitorView::onVisibilityChange(BOOL visible)
+{
+ if (!LLGLSLShader::sNoFixedFunction && visible)
+ {
+ visible = false;
+ // keep Scene monitor and its view in sycn
+ setVisible(false);
+ LL_WARNS("SceneMonitor") << "Incompatible graphical settings, Scene Monitor can't be turned on" << LL_ENDL;
+ }
+ LLSceneMonitor::getInstance()->setDebugViewerVisible(visible);
+}
+
+void LLSceneMonitorView::draw()
+{
+ const LLRenderTarget* target = LLSceneMonitor::getInstance()->getDiffTarget();
+ if(!target)
+ {
+ return;
+ }
+
+ F32 ratio = LLSceneMonitor::getInstance()->getDiffPixelRatio();
+ S32 height = (S32)(target->getHeight() * ratio);
+ S32 width = (S32)(target->getWidth() * ratio);
+
+ LLRect new_rect;
+ new_rect.setLeftTopAndSize(getRect().mLeft, getRect().mTop, width, height);
+ setRect(new_rect);
+
+ //draw background
+ gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+ gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4(0.f, 0.f, 0.f, 0.25f));
+
+ LLSceneMonitor::getInstance()->calcDiffAggregate();
+
+ //show some texts
+ LLColor4 color = LLColor4::white;
+ S32 line_height = LLFontGL::getFontMonospace()->getLineHeight();
+
+ S32 lines = 0;
+ std::string num_str = llformat("Frame difference: %.6f", LLSceneMonitor::getInstance()->getDiffResult());
+ LLFontGL::getFontMonospace()->renderUTF8(num_str, 0, 5, getRect().getHeight() - line_height * lines, color, LLFontGL::LEFT, LLFontGL::TOP);
+ lines++;
+
+ num_str = llformat("Pixel tolerance: (R+G+B) < %.4f", LLSceneMonitor::getInstance()->getDiffTolerance());
+ LLFontGL::getFontMonospace()->renderUTF8(num_str, 0, 5, getRect().getHeight() - line_height * lines, color, LLFontGL::LEFT, LLFontGL::TOP);
+ lines++;
+
+ num_str = llformat("Sampling time: %.3f seconds", gSavedSettings.getF32("SceneLoadingMonitorSampleTime"));
+ LLFontGL::getFontMonospace()->renderUTF8(num_str, 0, 5, getRect().getHeight() - line_height * lines, color, LLFontGL::LEFT, LLFontGL::TOP);
+ lines++;
+
+ num_str = llformat("Scene Loading time: %.3f seconds", (F32)LLSceneMonitor::getInstance()->getRecording()->getResults().getDuration().value());
+ LLFontGL::getFontMonospace()->renderUTF8(num_str, 0, 5, getRect().getHeight() - line_height * lines, color, LLFontGL::LEFT, LLFontGL::TOP);
+ lines++;
+
+ LLView::draw();
+}
+
diff --git a/indra/newview/llscenemonitor.h b/indra/newview/llscenemonitor.h
new file mode 100644
index 0000000000..5bde3b5aab
--- /dev/null
+++ b/indra/newview/llscenemonitor.h
@@ -0,0 +1,125 @@
+/**
+ * @file llscenemonitor.h
+ * @brief monitor the process of scene loading
+ *
+ * $LicenseInfo:firstyear=2003&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLSCENE_MONITOR_H
+#define LL_LLSCENE_MONITOR_H
+
+#include "llsingleton.h"
+#include "llmath.h"
+#include "llfloater.h"
+#include "llcharacter.h"
+#include "lltracerecording.h"
+
+class LLCharacter;
+class LLRenderTarget;
+class LLViewerTexture;
+
+class LLSceneMonitor : public LLSingleton<LLSceneMonitor>
+{
+ LOG_CLASS(LLSceneMonitor);
+public:
+ LLSceneMonitor();
+ ~LLSceneMonitor();
+
+ void freezeAvatar(LLCharacter* avatarp);
+ void setDebugViewerVisible(bool visible);
+
+ void capture(); //capture the main frame buffer
+ void compare(); //compare the stored two buffers.
+ void fetchQueryResult();
+ void calcDiffAggregate();
+ void setDiffTolerance(F32 tol) {mDiffTolerance = tol;}
+
+ const LLRenderTarget* getDiffTarget() const {return mDiff;}
+ F32 getDiffTolerance() const {return mDiffTolerance;}
+ F32 getDiffResult() const { return mDiffResult;}
+ F32 getDiffPixelRatio() const { return mDiffPixelRatio;}
+ bool isEnabled()const {return mEnabled;}
+ bool needsUpdate() const;
+
+ const LLTrace::ExtendablePeriodicRecording* getRecording() const {return &mSceneLoadRecording;}
+ void dumpToFile(std::string file_name);
+ bool hasResults() const { return mSceneLoadRecording.getResults().getDuration() != S32Seconds(0);}
+
+private:
+ void freezeScene();
+ void unfreezeScene();
+ void reset();
+ LLRenderTarget& getCaptureTarget();
+ void generateDitheringTexture(S32 width, S32 height);
+
+private:
+ bool mEnabled,
+ mDebugViewerVisible;
+
+ enum EDiffState
+ {
+ WAITING_FOR_NEXT_DIFF,
+ NEED_DIFF,
+ EXECUTE_DIFF,
+ WAIT_ON_RESULT,
+ VIEWER_QUITTING
+ } mDiffState;
+
+ LLRenderTarget* mFrames[2];
+ LLRenderTarget* mDiff;
+
+ GLuint mQueryObject; //used for glQuery
+ F32 mDiffResult, //aggregate results of mDiff.
+ mDiffTolerance, //pixels are filtered out when R+G+B < mDiffTolerance
+ mDiffPixelRatio; //ratio of pixels used for comparison against the original mDiff size along one dimension
+
+ LLPointer<LLViewerTexture> mDitheringTexture;
+ S32 mDitherMatrixWidth;
+ F32 mDitherScale,
+ mDitherScaleS,
+ mDitherScaleT;
+
+ std::vector<LLAnimPauseRequest> mAvatarPauseHandles;
+
+ LLTimer mRecordingTimer;
+ LLTrace::ExtendablePeriodicRecording mSceneLoadRecording;
+ LLTrace::Recording mMonitorRecording;
+};
+
+class LLSceneMonitorView : public LLFloater
+{
+public:
+ LLSceneMonitorView(const LLRect& rect);
+
+ virtual void draw();
+
+ virtual void onVisibilityChange(BOOL visible);
+
+protected:
+ virtual void onClose(bool app_quitting=false);
+ virtual void onClickCloseBtn(bool app_quitting=false);
+};
+
+extern LLSceneMonitorView* gSceneMonitorView;
+
+#endif
+
diff --git a/indra/newview/llsceneview.cpp b/indra/newview/llsceneview.cpp
index cbd8bee9d5..112fa5b4e1 100755
--- a/indra/newview/llsceneview.cpp
+++ b/indra/newview/llsceneview.cpp
@@ -51,11 +51,15 @@ LLSceneView::LLSceneView(const LLRect& rect)
setCanClose(true);
}
-void LLSceneView::onClickCloseBtn(bool)
+void LLSceneView::onClose(bool)
{
setVisible(false);
}
+void LLSceneView::onClickCloseBtn(bool)
+{
+ setVisible(false);
+}
void LLSceneView::draw()
{
diff --git a/indra/newview/llsceneview.h b/indra/newview/llsceneview.h
index 1fceecb9e1..e077c358b4 100755
--- a/indra/newview/llsceneview.h
+++ b/indra/newview/llsceneview.h
@@ -38,7 +38,8 @@ public:
virtual void draw();
protected:
- virtual void onClickCloseBtn(bool app_qutting = false);
+ virtual void onClose(bool app_qutting = false);
+ virtual void onClickCloseBtn(bool app_qutting = false);
};
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp
index 168a941ec3..8708fb87ee 100755
--- a/indra/newview/llscreenchannel.cpp
+++ b/indra/newview/llscreenchannel.cpp
@@ -49,10 +49,10 @@ using namespace LLNotificationsUI;
bool LLScreenChannel::mWasStartUpToastShown = false;
-LLFastTimer::DeclareTimer FTM_GET_CHANNEL_RECT("Calculate Notification Channel Region");
+LLTrace::BlockTimerStatHandle FTM_GET_CHANNEL_RECT("Calculate Notification Channel Region");
LLRect LLScreenChannelBase::getChannelRect()
{
- LLFastTimer _(FTM_GET_CHANNEL_RECT);
+ LL_RECORD_BLOCK_TIME(FTM_GET_CHANNEL_RECT);
if (mFloaterSnapRegion == NULL)
{
@@ -273,6 +273,14 @@ void LLScreenChannel::addToast(const LLToast::Params& p)
// only cancel notification if it isn't being used in IM session
LLNotifications::instance().cancel(notification);
}
+
+ // It was assumed that the toast would take ownership of the panel pointer.
+ // But since we have decided not to display the toast, kill the panel to
+ // prevent the memory leak.
+ if (p.panel != NULL)
+ {
+ p.panel()->die();
+ }
return;
}
@@ -599,7 +607,7 @@ void LLScreenChannel::showToastsBottom()
LLToast* toast = (it-1)->getToast();
if (!toast)
{
- llwarns << "Attempt to display a deleted toast." << llendl;
+ LL_WARNS() << "Attempt to display a deleted toast." << LL_ENDL;
return;
}
@@ -610,7 +618,7 @@ void LLScreenChannel::showToastsBottom()
LLToast* toast = it->getToast();
if(!toast)
{
- llwarns << "Attempt to display a deleted toast." << llendl;
+ LL_WARNS() << "Attempt to display a deleted toast." << LL_ENDL;
return;
}
@@ -698,7 +706,7 @@ void LLScreenChannel::showToastsCentre()
LLToast* toast = mToastList[0].getToast();
if (!toast)
{
- llwarns << "Attempt to display a deleted toast." << llendl;
+ LL_WARNS() << "Attempt to display a deleted toast." << LL_ENDL;
return;
}
@@ -711,7 +719,7 @@ void LLScreenChannel::showToastsCentre()
LLToast* toast = it->getToast();
if (!toast)
{
- llwarns << "Attempt to display a deleted toast." << llendl;
+ LL_WARNS() << "Attempt to display a deleted toast." << LL_ENDL;
return;
}
@@ -747,7 +755,7 @@ void LLScreenChannel::showToastsTop()
LLToast* toast = (it-1)->getToast();
if (!toast)
{
- llwarns << "Attempt to display a deleted toast." << llendl;
+ LL_WARNS() << "Attempt to display a deleted toast." << LL_ENDL;
return;
}
@@ -758,7 +766,7 @@ void LLScreenChannel::showToastsTop()
LLToast* toast = it->getToast();
if (!toast)
{
- llwarns << "Attempt to display a deleted toast." << llendl;
+ LL_WARNS() << "Attempt to display a deleted toast." << LL_ENDL;
return;
}
@@ -954,7 +962,7 @@ void LLScreenChannel::hideToastsFromScreen()
}
else
{
- llwarns << "Attempt to hide a deleted toast." << llendl;
+ LL_WARNS() << "Attempt to hide a deleted toast." << LL_ENDL;
}
}
}
@@ -972,7 +980,7 @@ void LLScreenChannel::hideToast(const LLUUID& notification_id)
}
else
{
- llwarns << "Attempt to hide a deleted toast." << llendl;
+ LL_WARNS() << "Attempt to hide a deleted toast." << LL_ENDL;
}
}
}
diff --git a/indra/newview/llscripteditor.cpp b/indra/newview/llscripteditor.cpp
new file mode 100644
index 0000000000..81920562a7
--- /dev/null
+++ b/indra/newview/llscripteditor.cpp
@@ -0,0 +1,289 @@
+/**
+ * @file llscripteditor.cpp
+ * @author Cinder Roxley
+ * @brief Text editor widget used for viewing and editing scripts
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2012, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+#include "llscripteditor.h"
+
+#include "llsyntaxid.h"
+#include "lllocalcliprect.h"
+
+const S32 UI_TEXTEDITOR_LINE_NUMBER_MARGIN = 32;
+const S32 UI_TEXTEDITOR_LINE_NUMBER_DIGITS = 4;
+
+static LLDefaultChildRegistry::Register<LLScriptEditor> r("script_editor");
+
+LLScriptEditor::Params::Params()
+: show_line_numbers("show_line_numbers", true)
+{}
+
+
+LLScriptEditor::LLScriptEditor(const Params& p)
+: LLTextEditor(p)
+, mShowLineNumbers(p.show_line_numbers)
+{
+ if (mShowLineNumbers)
+ {
+ mHPad += UI_TEXTEDITOR_LINE_NUMBER_MARGIN;
+ updateRects();
+ }
+}
+
+void LLScriptEditor::draw()
+{
+ {
+ // pad clipping rectangle so that cursor can draw at full width
+ // when at left edge of mVisibleTextRect
+ LLRect clip_rect(mVisibleTextRect);
+ clip_rect.stretch(1);
+ LLLocalClipRect clip(clip_rect);
+ }
+
+ LLTextBase::draw();
+ drawLineNumbers();
+
+ drawPreeditMarker();
+
+ //RN: the decision was made to always show the orange border for keyboard focus but do not put an insertion caret
+ // when in readonly mode
+ mBorder->setKeyboardFocusHighlight( hasFocus() );// && !mReadOnly);
+}
+
+void LLScriptEditor::drawLineNumbers()
+{
+ LLGLSUIDefault gls_ui;
+ LLRect scrolled_view_rect = getVisibleDocumentRect();
+ LLRect content_rect = getVisibleTextRect();
+ LLLocalClipRect clip(content_rect);
+ S32 first_line = getFirstVisibleLine();
+ S32 num_lines = getLineCount();
+ if (first_line >= num_lines)
+ {
+ return;
+ }
+
+ S32 cursor_line = mLineInfoList[getLineNumFromDocIndex(mCursorPos)].mLineNum;
+
+ if (mShowLineNumbers)
+ {
+ S32 left = 0;
+ S32 top = getRect().getHeight();
+ S32 bottom = 0;
+
+ gl_rect_2d(left, top, UI_TEXTEDITOR_LINE_NUMBER_MARGIN, bottom, mReadOnlyBgColor.get() ); // line number area always read-only
+ gl_rect_2d(UI_TEXTEDITOR_LINE_NUMBER_MARGIN, top, UI_TEXTEDITOR_LINE_NUMBER_MARGIN-1, bottom, LLColor4::grey3); // separator
+
+ S32 last_line_num = -1;
+
+ for (S32 cur_line = first_line; cur_line < num_lines; cur_line++)
+ {
+ line_info& line = mLineInfoList[cur_line];
+
+ if ((line.mRect.mTop - scrolled_view_rect.mBottom) < mVisibleTextRect.mBottom)
+ {
+ break;
+ }
+
+ S32 line_bottom = line.mRect.mBottom - scrolled_view_rect.mBottom + mVisibleTextRect.mBottom;
+ // draw the line numbers
+ if(line.mLineNum != last_line_num && line.mRect.mTop <= scrolled_view_rect.mTop)
+ {
+ const LLFontGL *num_font = LLFontGL::getFontMonospace();
+ const LLWString ltext = utf8str_to_wstring(llformat("%d", line.mLineNum ));
+ BOOL is_cur_line = cursor_line == line.mLineNum;
+ const U8 style = is_cur_line ? LLFontGL::BOLD : LLFontGL::NORMAL;
+ const LLColor4 fg_color = is_cur_line ? mCursorColor : mReadOnlyFgColor;
+ num_font->render(
+ ltext, // string to draw
+ 0, // begin offset
+ UI_TEXTEDITOR_LINE_NUMBER_MARGIN - 2, // x
+ line_bottom, // y
+ fg_color,
+ LLFontGL::RIGHT, // horizontal alignment
+ LLFontGL::BOTTOM, // vertical alignment
+ style,
+ LLFontGL::NO_SHADOW,
+ S32_MAX, // max chars
+ UI_TEXTEDITOR_LINE_NUMBER_MARGIN - 2); // max pixels
+ last_line_num = line.mLineNum;
+ }
+ }
+ }
+}
+
+void LLScriptEditor::initKeywords()
+{
+ mKeywords.initialize(LLSyntaxIdLSL::getInstance()->getKeywordsXML());
+}
+
+LLTrace::BlockTimerStatHandle FTM_SYNTAX_HIGHLIGHTING("Syntax Highlighting");
+
+void LLScriptEditor::loadKeywords()
+{
+ LL_RECORD_BLOCK_TIME(FTM_SYNTAX_HIGHLIGHTING);
+ mKeywords.processTokens();
+
+ segment_vec_t segment_list;
+ mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this);
+
+ mSegments.clear();
+ segment_set_t::iterator insert_it = mSegments.begin();
+ for (segment_vec_t::iterator list_it = segment_list.begin(); list_it != segment_list.end(); ++list_it)
+ {
+ insert_it = mSegments.insert(insert_it, *list_it);
+ }
+}
+
+void LLScriptEditor::updateSegments()
+{
+ if (mReflowIndex < S32_MAX && mKeywords.isLoaded() && mParseOnTheFly)
+ {
+ LL_RECORD_BLOCK_TIME(FTM_SYNTAX_HIGHLIGHTING);
+ // HACK: No non-ascii keywords for now
+ segment_vec_t segment_list;
+ mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this);
+
+ clearSegments();
+ for (segment_vec_t::iterator list_it = segment_list.begin(); list_it != segment_list.end(); ++list_it)
+ {
+ insertSegment(*list_it);
+ }
+ }
+
+ LLTextBase::updateSegments();
+}
+
+void LLScriptEditor::clearSegments()
+{
+ if (!mSegments.empty())
+ {
+ mSegments.clear();
+ }
+}
+
+// Most of this is shamelessly copied from LLTextBase
+void LLScriptEditor::drawSelectionBackground()
+{
+ // Draw selection even if we don't have keyboard focus for search/replace
+ if( hasSelection() && !mLineInfoList.empty())
+ {
+ std::vector<LLRect> selection_rects;
+
+ S32 selection_left = llmin( mSelectionStart, mSelectionEnd );
+ S32 selection_right = llmax( mSelectionStart, mSelectionEnd );
+
+ // Skip through the lines we aren't drawing.
+ LLRect content_display_rect = getVisibleDocumentRect();
+
+ // binary search for line that starts before top of visible buffer
+ line_list_t::const_iterator line_iter = std::lower_bound(mLineInfoList.begin(), mLineInfoList.end(), content_display_rect.mTop, LLTextBase::compare_bottom());
+ line_list_t::const_iterator end_iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), content_display_rect.mBottom, LLTextBase::compare_top());
+
+ bool done = false;
+
+ // Find the coordinates of the selected area
+ for (;line_iter != end_iter && !done; ++line_iter)
+ {
+ // is selection visible on this line?
+ if (line_iter->mDocIndexEnd > selection_left && line_iter->mDocIndexStart < selection_right)
+ {
+ segment_set_t::iterator segment_iter;
+ S32 segment_offset;
+ getSegmentAndOffset(line_iter->mDocIndexStart, &segment_iter, &segment_offset);
+
+ LLRect selection_rect;
+ selection_rect.mLeft = line_iter->mRect.mLeft;
+ selection_rect.mRight = line_iter->mRect.mLeft;
+ selection_rect.mBottom = line_iter->mRect.mBottom;
+ selection_rect.mTop = line_iter->mRect.mTop;
+
+ for(;segment_iter != mSegments.end(); ++segment_iter, segment_offset = 0)
+ {
+ LLTextSegmentPtr segmentp = *segment_iter;
+
+ S32 segment_line_start = segmentp->getStart() + segment_offset;
+ S32 segment_line_end = llmin(segmentp->getEnd(), line_iter->mDocIndexEnd);
+
+ if (segment_line_start > segment_line_end) break;
+
+ S32 segment_width = 0;
+ S32 segment_height = 0;
+
+ // if selection after beginning of segment
+ if(selection_left >= segment_line_start)
+ {
+ S32 num_chars = llmin(selection_left, segment_line_end) - segment_line_start;
+ segmentp->getDimensions(segment_offset, num_chars, segment_width, segment_height);
+ selection_rect.mLeft += segment_width;
+ }
+
+ // if selection_right == segment_line_end then that means we are the first character of the next segment
+ // or first character of the next line, in either case we want to add the length of the current segment
+ // to the selection rectangle and continue.
+ // if selection right > segment_line_end then selection spans end of current segment...
+ if (selection_right >= segment_line_end)
+ {
+ // extend selection slightly beyond end of line
+ // to indicate selection of newline character (use "n" character to determine width)
+ S32 num_chars = segment_line_end - segment_line_start;
+ segmentp->getDimensions(segment_offset, num_chars, segment_width, segment_height);
+ selection_rect.mRight += segment_width;
+ }
+ // else if selection ends on current segment...
+ else
+ {
+ S32 num_chars = selection_right - segment_line_start;
+ segmentp->getDimensions(segment_offset, num_chars, segment_width, segment_height);
+ selection_rect.mRight += segment_width;
+
+ break;
+ }
+ }
+ selection_rects.push_back(selection_rect);
+ }
+ }
+
+ gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+ const LLColor4& color = mReadOnly ? mReadOnlyFgColor : mFgColor;
+ F32 alpha = hasFocus() ? 0.7f : 0.3f;
+ alpha *= getDrawContext().mAlpha;
+ // We want to shift the color to something readable but distinct
+ LLColor4 selection_color((1.f + color.mV[VRED]) * 0.5f,
+ (1.f + color.mV[VGREEN]) * 0.5f,
+ (1.f + color.mV[VBLUE]) * 0.5f,
+ alpha);
+
+ for (std::vector<LLRect>::iterator rect_it = selection_rects.begin();
+ rect_it != selection_rects.end();
+ ++rect_it)
+ {
+ LLRect selection_rect = *rect_it;
+ selection_rect = *rect_it;
+ selection_rect.translate(mVisibleTextRect.mLeft - content_display_rect.mLeft, mVisibleTextRect.mBottom - content_display_rect.mBottom);
+ gl_rect_2d(selection_rect, selection_color);
+ }
+ }
+}
diff --git a/indra/newview/llscripteditor.h b/indra/newview/llscripteditor.h
new file mode 100644
index 0000000000..f458203a39
--- /dev/null
+++ b/indra/newview/llscripteditor.h
@@ -0,0 +1,70 @@
+/**
+ * @file llscripteditor.h
+ * @author Cinder Roxley
+ * @brief Text editor widget used for viewing and editing scripts
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2012, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_SCRIPTEDITOR_H
+#define LL_SCRIPTEDITOR_H
+
+#include "lltexteditor.h"
+
+class LLScriptEditor : public LLTextEditor
+{
+public:
+
+ struct Params : public LLInitParam::Block<Params, LLTextEditor::Params>
+ {
+ Optional<bool> show_line_numbers;
+
+ Params();
+ };
+
+ virtual ~LLScriptEditor() {};
+
+ // LLView override
+ virtual void draw();
+
+ void initKeywords();
+ void loadKeywords();
+ /* virtual */ void clearSegments();
+ LLKeywords::keyword_iterator_t keywordsBegin() { return mKeywords.begin(); }
+ LLKeywords::keyword_iterator_t keywordsEnd() { return mKeywords.end(); }
+
+protected:
+ friend class LLUICtrlFactory;
+ LLScriptEditor(const Params& p);
+
+private:
+ void drawLineNumbers();
+ /* virtual */ void updateSegments();
+ /* virtual */ void drawSelectionBackground();
+ void loadKeywords(const std::string& filename_keywords,
+ const std::string& filename_colors);
+
+ LLKeywords mKeywords;
+ bool mShowLineNumbers;
+};
+
+#endif // LL_SCRIPTEDITOR_H
diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp
index 0e0da6bdc7..590a1c2647 100755
--- a/indra/newview/llscriptfloater.cpp
+++ b/indra/newview/llscriptfloater.cpp
@@ -234,7 +234,7 @@ void LLScriptFloater::onMouseDown()
// Remove new message icon
if (NULL == chicletp)
{
- llerror("Dock chiclet for LLScriptFloater doesn't exist", 0);
+ LL_ERRS() << "Dock chiclet for LLScriptFloater doesn't exist" << LL_ENDL;
}
else
{
@@ -306,7 +306,7 @@ void LLScriptFloater::dockToChiclet(bool dock)
LLChiclet * chicletp = chiclet_panelp->findChiclet<LLChiclet>(getNotificationId());
if (NULL == chicletp)
{
- llwarns << "Dock chiclet for LLScriptFloater doesn't exist" << llendl;
+ LL_WARNS() << "Dock chiclet for LLScriptFloater doesn't exist" << LL_ENDL;
return;
}
@@ -350,7 +350,7 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id)
{
if(notification_id.isNull())
{
- llwarns << "Invalid notification ID" << llendl;
+ LL_WARNS() << "Invalid notification ID" << LL_ENDL;
return;
}
@@ -434,7 +434,7 @@ void LLScriptFloaterManager::onRemoveNotification(const LLUUID& notification_id)
{
if(notification_id.isNull())
{
- llwarns << "Invalid notification ID" << llendl;
+ LL_WARNS() << "Invalid notification ID" << LL_ENDL;
return;
}
@@ -505,7 +505,7 @@ LLScriptFloaterManager::EObjectType LLScriptFloaterManager::getObjectType(const
{
if(notification_id.isNull())
{
- llwarns << "Invalid notification ID" << llendl;
+ LL_WARNS() << "Invalid notification ID" << LL_ENDL;
return OBJ_UNKNOWN;
}
@@ -518,7 +518,7 @@ LLScriptFloaterManager::EObjectType LLScriptFloaterManager::getObjectType(const
return it->second;
}
- llwarns << "Unknown object type" << llendl;
+ LL_WARNS() << "Unknown object type" << LL_ENDL;
return OBJ_UNKNOWN;
}
@@ -529,7 +529,7 @@ std::string LLScriptFloaterManager::getObjectName(const LLUUID& notification_id)
LLNotificationPtr notification = LLNotifications::getInstance()->find(notification_id);
if(!notification)
{
- llwarns << "Invalid notification" << llendl;
+ LL_WARNS() << "Invalid notification" << LL_ENDL;
return LLStringUtil::null;
}
@@ -586,7 +586,7 @@ void LLScriptFloaterManager::saveFloaterPosition(const LLUUID& object_id, const
}
else
{
- llwarns << "Invalid object id" << llendl;
+ LL_WARNS() << "Invalid object id" << LL_ENDL;
}
}
diff --git a/indra/newview/llscrollingpanelparam.cpp b/indra/newview/llscrollingpanelparam.cpp
index a7e24b86b1..bfa453a0ae 100755
--- a/indra/newview/llscrollingpanelparam.cpp
+++ b/indra/newview/llscrollingpanelparam.cpp
@@ -266,7 +266,7 @@ void LLScrollingPanelParam::onHintHeldDown( LLVisualParamHint* hint )
if (slider->getMinValue() < new_percent
&& new_percent < slider->getMaxValue())
{
- mWearable->setVisualParamWeight( hint->getVisualParam()->getID(), new_weight, FALSE);
+ mWearable->setVisualParamWeight( hint->getVisualParam()->getID(), new_weight);
mWearable->writeToAvatar(gAgentAvatarp);
gAgentAvatarp->updateVisualParams();
@@ -299,7 +299,7 @@ void LLScrollingPanelParam::onHintMinMouseUp( void* userdata )
if (slider->getMinValue() < new_percent
&& new_percent < slider->getMaxValue())
{
- self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight, FALSE);
+ self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight);
self->mWearable->writeToAvatar(gAgentAvatarp);
slider->setValue( self->weightToPercent( new_weight ) );
}
@@ -333,7 +333,7 @@ void LLScrollingPanelParam::onHintMaxMouseUp( void* userdata )
if (slider->getMinValue() < new_percent
&& new_percent < slider->getMaxValue())
{
- self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight, FALSE);
+ self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight);
self->mWearable->writeToAvatar(gAgentAvatarp);
slider->setValue( self->weightToPercent( new_weight ) );
}
diff --git a/indra/newview/llscrollingpanelparambase.cpp b/indra/newview/llscrollingpanelparambase.cpp
index 8e083ddb6c..fe7a362723 100755
--- a/indra/newview/llscrollingpanelparambase.cpp
+++ b/indra/newview/llscrollingpanelparambase.cpp
@@ -93,7 +93,7 @@ void LLScrollingPanelParamBase::onSliderMoved(LLUICtrl* ctrl, void* userdata)
F32 new_weight = self->percentToWeight( (F32)slider->getValue().asReal() );
if (current_weight != new_weight )
{
- self->mWearable->setVisualParamWeight( param->getID(), new_weight, FALSE );
+ self->mWearable->setVisualParamWeight( param->getID(), new_weight);
self->mWearable->writeToAvatar(gAgentAvatarp);
gAgentAvatarp->updateVisualParams();
}
diff --git a/indra/newview/llsecapi.h b/indra/newview/llsecapi.h
index db57848320..c01d318f56 100755
--- a/indra/newview/llsecapi.h
+++ b/indra/newview/llsecapi.h
@@ -28,8 +28,10 @@
#ifndef LLSECAPI_H
#define LLSECAPI_H
#include <vector>
+#include "llwin32headerslean.h"
#include <openssl/x509.h>
#include <ostream>
+#include "llpointer.h"
#ifdef LL_WINDOWS
#pragma warning(disable:4250)
diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp
index c4d5450e2b..fc9d9f0842 100755
--- a/indra/newview/llsechandler_basic.cpp
+++ b/indra/newview/llsechandler_basic.cpp
@@ -1220,7 +1220,7 @@ void LLSecAPIBasicHandler::init()
// grab the application CA.pem file that contains the well-known certs shipped
// with the product
std::string ca_file_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "CA.pem");
- llinfos << "app path " << ca_file_path << llendl;
+ LL_INFOS() << "app path " << ca_file_path << LL_ENDL;
LLPointer<LLBasicCertificateStore> app_ca_store = new LLBasicCertificateStore(ca_file_path);
// push the applicate CA files into the store, therefore adding any new CA certs that
@@ -1372,7 +1372,7 @@ void LLSecAPIBasicHandler::_writeProtectedData()
// EXP-1825 crash in LLSecAPIBasicHandler::_writeProtectedData()
// Decided throwing an exception here was overkill until we figure out why this happens
//throw LLProtectedDataException("Error writing Protected Data Store");
- llinfos << "LLProtectedDataException(Error writing Protected Data Store)" << llendl;
+ LL_INFOS() << "LLProtectedDataException(Error writing Protected Data Store)" << LL_ENDL;
}
// move the temporary file to the specified file location.
@@ -1385,7 +1385,7 @@ void LLSecAPIBasicHandler::_writeProtectedData()
// EXP-1825 crash in LLSecAPIBasicHandler::_writeProtectedData()
// Decided throwing an exception here was overkill until we figure out why this happens
//throw LLProtectedDataException("Could not overwrite protected data store");
- llinfos << "LLProtectedDataException(Could not overwrite protected data store)" << llendl;
+ LL_INFOS() << "LLProtectedDataException(Could not overwrite protected data store)" << LL_ENDL;
}
}
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index c83b459279..eb3a4c37d9 100755
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -10,7 +10,7 @@
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@@ -104,6 +104,9 @@ const F32 SILHOUETTE_UPDATE_THRESHOLD_SQUARED = 0.02f;
const S32 MAX_ACTION_QUEUE_SIZE = 20;
const S32 MAX_SILS_PER_FRAME = 50;
const S32 MAX_OBJECTS_PER_PACKET = 254;
+// For linked sets
+const S32 MAX_CHILDREN_PER_TASK = 255;
+const S32 MAX_CHILDREN_PER_PHYSICAL_TASK = 32;
//
// Globals
@@ -323,7 +326,7 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectOnly(LLViewerObject* object, S3
return NULL;
}
- // llinfos << "Adding object to selected object list" << llendl;
+ // LL_INFOS() << "Adding object to selected object list" << LL_ENDL;
// Place it in the list and tag it.
// This will refresh dialogs.
@@ -889,7 +892,7 @@ void LLSelectMgr::addAsIndividual(LLViewerObject *objectp, S32 face, BOOL undoab
}
else
{
- llerrs << "LLSelectMgr::add face " << face << " out-of-range" << llendl;
+ LL_ERRS() << "LLSelectMgr::add face " << face << " out-of-range" << LL_ENDL;
return;
}
@@ -940,6 +943,10 @@ LLObjectSelectionHandle LLSelectMgr::setHoverObject(LLViewerObject *objectp, S32
iter != objects.end(); ++iter)
{
LLViewerObject* cur_objectp = *iter;
+ if(!cur_objectp || cur_objectp->isDead())
+ {
+ continue;
+ }
LLSelectNode* nodep = new LLSelectNode(cur_objectp, FALSE);
nodep->selectTE(face, TRUE);
mHoverObjects->addNodeAtEnd(nodep);
@@ -1333,7 +1340,7 @@ void LLSelectMgr::remove(LLViewerObject *objectp, S32 te, BOOL undoable)
}
else
{
- llerrs << "LLSelectMgr::remove - tried to remove TE " << te << " that wasn't selected" << llendl;
+ LL_ERRS() << "LLSelectMgr::remove - tried to remove TE " << te << " that wasn't selected" << LL_ENDL;
return;
}
@@ -1356,7 +1363,7 @@ void LLSelectMgr::remove(LLViewerObject *objectp, S32 te, BOOL undoable)
else
{
// ...out of range face
- llerrs << "LLSelectMgr::remove - TE " << te << " out of range" << llendl;
+ LL_ERRS() << "LLSelectMgr::remove - TE " << te << " out of range" << LL_ENDL;
}
updateSelectionCenter();
@@ -1455,26 +1462,26 @@ void LLSelectMgr::demoteSelectionToIndividuals()
//-----------------------------------------------------------------------------
void LLSelectMgr::dump()
{
- llinfos << "Selection Manager: " << mSelectedObjects->getNumNodes() << " items" << llendl;
+ LL_INFOS() << "Selection Manager: " << mSelectedObjects->getNumNodes() << " items" << LL_ENDL;
- llinfos << "TE mode " << mTEMode << llendl;
+ LL_INFOS() << "TE mode " << mTEMode << LL_ENDL;
S32 count = 0;
for (LLObjectSelection::iterator iter = getSelection()->begin();
iter != getSelection()->end(); iter++ )
{
LLViewerObject* objectp = (*iter)->getObject();
- llinfos << "Object " << count << " type " << LLPrimitive::pCodeToString(objectp->getPCode()) << llendl;
- llinfos << " hasLSL " << objectp->flagScripted() << llendl;
- llinfos << " hasTouch " << objectp->flagHandleTouch() << llendl;
- llinfos << " hasMoney " << objectp->flagTakesMoney() << llendl;
- llinfos << " getposition " << objectp->getPosition() << llendl;
- llinfos << " getpositionAgent " << objectp->getPositionAgent() << llendl;
- llinfos << " getpositionRegion " << objectp->getPositionRegion() << llendl;
- llinfos << " getpositionGlobal " << objectp->getPositionGlobal() << llendl;
+ LL_INFOS() << "Object " << count << " type " << LLPrimitive::pCodeToString(objectp->getPCode()) << LL_ENDL;
+ LL_INFOS() << " hasLSL " << objectp->flagScripted() << LL_ENDL;
+ LL_INFOS() << " hasTouch " << objectp->flagHandleTouch() << LL_ENDL;
+ LL_INFOS() << " hasMoney " << objectp->flagTakesMoney() << LL_ENDL;
+ LL_INFOS() << " getposition " << objectp->getPosition() << LL_ENDL;
+ LL_INFOS() << " getpositionAgent " << objectp->getPositionAgent() << LL_ENDL;
+ LL_INFOS() << " getpositionRegion " << objectp->getPositionRegion() << LL_ENDL;
+ LL_INFOS() << " getpositionGlobal " << objectp->getPositionGlobal() << LL_ENDL;
LLDrawable* drawablep = objectp->mDrawable;
- llinfos << " " << (drawablep&& drawablep->isVisible() ? "visible" : "invisible") << llendl;
- llinfos << " " << (drawablep&& drawablep->isState(LLDrawable::FORCE_INVISIBLE) ? "force_invisible" : "") << llendl;
+ LL_INFOS() << " " << (drawablep&& drawablep->isVisible() ? "visible" : "invisible") << LL_ENDL;
+ LL_INFOS() << " " << (drawablep&& drawablep->isState(LLDrawable::FORCE_INVISIBLE) ? "force_invisible" : "") << LL_ENDL;
count++;
}
@@ -1490,14 +1497,14 @@ void LLSelectMgr::dump()
{
if (node->isTESelected(te))
{
- llinfos << "Object " << objectp << " te " << te << llendl;
+ LL_INFOS() << "Object " << objectp << " te " << te << LL_ENDL;
}
}
}
- llinfos << mHighlightedObjects->getNumNodes() << " objects currently highlighted." << llendl;
+ LL_INFOS() << mHighlightedObjects->getNumNodes() << " objects currently highlighted." << LL_ENDL;
- llinfos << "Center global " << mSelectionCenterGlobal << llendl;
+ LL_INFOS() << "Center global " << mSelectionCenterGlobal << LL_ENDL;
}
//-----------------------------------------------------------------------------
@@ -1557,7 +1564,7 @@ void LLObjectSelection::applyNoCopyTextureToTEs(LLViewerInventoryItem* item)
}
// apply texture for the selected faces
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT );
+ add(LLStatViewer::EDIT_TEXTURE, 1);
object->setTEImage(te, image);
dialog_refresh_all();
@@ -1580,8 +1587,8 @@ void LLSelectMgr::selectionSetImage(const LLUUID& imageid)
&& !item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID())
&& (mSelectedObjects->getNumNodes() > 1) )
{
- llwarns << "Attempted to apply no-copy texture to multiple objects"
- << llendl;
+ LL_WARNS() << "Attempted to apply no-copy texture to multiple objects"
+ << LL_ENDL;
return;
}
@@ -3510,7 +3517,7 @@ bool LLSelectMgr::confirmDelete(const LLSD& notification, const LLSD& response,
S32 option = LLNotification::getSelectedOption(notification, response);
if (!handle->getObjectCount())
{
- llwarns << "Nothing to delete!" << llendl;
+ LL_WARNS() << "Nothing to delete!" << LL_ENDL;
return false;
}
@@ -3541,9 +3548,7 @@ bool LLSelectMgr::confirmDelete(const LLSD& notification, const LLSD& response,
gAgentCamera.setLookAt(LOOKAT_TARGET_CLEAR);
// Keep track of how many objects have been deleted.
- F64 obj_delete_count = LLViewerStats::getInstance()->getStat(LLViewerStats::ST_OBJECT_DELETE_COUNT);
- obj_delete_count += LLSelectMgr::getInstance()->mSelectedObjects->getObjectCount();
- LLViewerStats::getInstance()->setStat(LLViewerStats::ST_OBJECT_DELETE_COUNT, obj_delete_count );
+ add(LLStatViewer::DELETE_OBJECT, LLSelectMgr::getInstance()->mSelectedObjects->getObjectCount());
}
break;
case 1:
@@ -3950,7 +3955,7 @@ void LLSelectMgr::packMultipleUpdate(LLSelectNode* node, void *user_data)
}
if (type & UPD_SCALE)
{
- //llinfos << "Sending object scale " << object->getScale() << llendl;
+ //LL_INFOS() << "Sending object scale " << object->getScale() << LL_ENDL;
htonmemcpy(&data[offset], &(object->getScale().mV), MVT_LLVector3, 12);
offset += 12;
}
@@ -4088,7 +4093,7 @@ void LLSelectMgr::packPermissionsHead(void* user_data)
/*
void LLSelectMgr::sendSelect()
{
- llerrs << "Not implemented" << llendl;
+ LL_ERRS() << "Not implemented" << LL_ENDL;
}
*/
@@ -4202,9 +4207,9 @@ void LLSelectMgr::deselectAllIfTooFar()
{
if (mDebugSelectMgr)
{
- llinfos << "Selection manager: auto-deselecting, select_dist = " << (F32) sqrt(select_dist_sq) << llendl;
- llinfos << "agent pos global = " << gAgent.getPositionGlobal() << llendl;
- llinfos << "selection pos global = " << selectionCenter << llendl;
+ LL_INFOS() << "Selection manager: auto-deselecting, select_dist = " << (F32) sqrt(select_dist_sq) << LL_ENDL;
+ LL_INFOS() << "agent pos global = " << gAgent.getPositionGlobal() << LL_ENDL;
+ LL_INFOS() << "selection pos global = " << selectionCenter << LL_ENDL;
}
deselectAll();
@@ -4916,7 +4921,7 @@ void LLSelectMgr::sendListToRegions(const std::string& message_name,
break;
default:
- llerrs << "Bad send type " << send_type << " passed to SendListToRegions()" << llendl;
+ LL_ERRS() << "Bad send type " << send_type << " passed to SendListToRegions()" << LL_ENDL;
}
// bail if nothing selected
@@ -4990,7 +4995,7 @@ void LLSelectMgr::sendListToRegions(const std::string& message_name,
gMessageSystem->clearMessage();
}
- // llinfos << "sendListToRegions " << message_name << " obj " << objects_sent << " pkt " << packets_sent << llendl;
+ // LL_INFOS() << "sendListToRegions " << message_name << " obj " << objects_sent << " pkt " << packets_sent << LL_ENDL;
}
@@ -5107,7 +5112,7 @@ void LLSelectMgr::processObjectProperties(LLMessageSystem* msg, void** user_data
if (!node)
{
- llwarns << "Couldn't find object " << id << " selected." << llendl;
+ LL_WARNS() << "Couldn't find object " << id << " selected." << LL_ENDL;
}
else
{
@@ -5913,7 +5918,7 @@ void LLSelectNode::saveTextureScaleRatios(LLRender::eTexIndex index_to_query)
LLPrimitive::getTESTAxes(i, &s_axis, &t_axis);
tep->getScale(&diffuse_s,&diffuse_t);
-
+
if (tep->getTexGen() == LLTextureEntry::TEX_GEN_PLANAR)
{
v.mV[s_axis] = diffuse_s*scale.mV[s_axis];
@@ -5925,7 +5930,7 @@ void LLSelectNode::saveTextureScaleRatios(LLRender::eTexIndex index_to_query)
v.mV[s_axis] = diffuse_s/scale.mV[s_axis];
v.mV[t_axis] = diffuse_t/scale.mV[t_axis];
mTextureScaleRatios.push_back(v);
- }
+ }
}
}
}
@@ -6369,7 +6374,7 @@ S32 get_family_count(LLViewerObject *parent)
{
if (!parent)
{
- llwarns << "Trying to get_family_count on null parent!" << llendl;
+ LL_WARNS() << "Trying to get_family_count on null parent!" << LL_ENDL;
}
S32 count = 1; // for this object
LLViewerObject::const_child_list_t& child_list = parent->getChildren();
@@ -6380,11 +6385,11 @@ S32 get_family_count(LLViewerObject *parent)
if (!child)
{
- llwarns << "Family object has NULL child! Show Doug." << llendl;
+ LL_WARNS() << "Family object has NULL child! Show Doug." << LL_ENDL;
}
else if (child->isDead())
{
- llwarns << "Family object has dead child object. Show Doug." << llendl;
+ LL_WARNS() << "Family object has dead child object. Show Doug." << LL_ENDL;
}
else
{
diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h
index d4b736640c..a68328167a 100755
--- a/indra/newview/llselectmgr.h
+++ b/indra/newview/llselectmgr.h
@@ -56,6 +56,33 @@ class LLColor4;
class LLVector3;
class LLSelectNode;
+const U8 UPD_NONE = 0x00;
+const U8 UPD_POSITION = 0x01;
+const U8 UPD_ROTATION = 0x02;
+const U8 UPD_SCALE = 0x04;
+const U8 UPD_LINKED_SETS = 0x08;
+const U8 UPD_UNIFORM = 0x10; // used with UPD_SCALE
+
+// This is used by the DeRezObject message to determine where to put
+// derezed tasks.
+enum EDeRezDestination
+{
+ DRD_SAVE_INTO_AGENT_INVENTORY = 0,
+ DRD_ACQUIRE_TO_AGENT_INVENTORY = 1, // try to leave copy in world
+ DRD_SAVE_INTO_TASK_INVENTORY = 2,
+ DRD_ATTACHMENT = 3,
+ DRD_TAKE_INTO_AGENT_INVENTORY = 4, // delete from world
+ DRD_FORCE_TO_GOD_INVENTORY = 5, // force take copy
+ DRD_TRASH = 6,
+ DRD_ATTACHMENT_TO_INV = 7,
+ DRD_ATTACHMENT_EXISTS = 8,
+ DRD_RETURN_TO_OWNER = 9, // back to owner's inventory
+ DRD_RETURN_TO_LAST_OWNER = 10, // deeded object back to last owner's inventory
+
+ DRD_COUNT = 11
+};
+
+
const S32 SELECT_ALL_TES = -1;
const S32 SELECT_MAX_TES = 32;
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp
index ec6a1d9bdc..64f24cd291 100755
--- a/indra/newview/llsidepanelappearance.cpp
+++ b/indra/newview/llsidepanelappearance.cpp
@@ -142,7 +142,7 @@ BOOL LLSidepanelAppearance::postBuild()
mCurrOutfitPanel = getChild<LLPanel>("panel_currentlook");
- setVisibleCallback(boost::bind(&LLSidepanelAppearance::onVisibilityChange,this,_2));
+ setVisibleCallback(boost::bind(&LLSidepanelAppearance::onVisibilityChanged,this,_2));
return TRUE;
}
@@ -181,7 +181,7 @@ void LLSidepanelAppearance::onOpen(const LLSD& key)
mOpened = true;
}
-void LLSidepanelAppearance::onVisibilityChange(const LLSD &new_visibility)
+void LLSidepanelAppearance::onVisibilityChanged(const LLSD &new_visibility)
{
LLSD visibility;
visibility["visible"] = new_visibility.asBoolean();
@@ -201,7 +201,7 @@ void LLSidepanelAppearance::updateToVisibility(const LLSD &new_visibility)
const LLViewerWearable *wearable_ptr = mEditWearable->getWearable();
if (!wearable_ptr)
{
- llwarns << "Visibility change to invalid wearable" << llendl;
+ LL_WARNS() << "Visibility change to invalid wearable" << LL_ENDL;
return;
}
// Disable camera switch is currently just for WT_PHYSICS type since we don't want to freeze the avatar
@@ -231,7 +231,7 @@ void LLSidepanelAppearance::updateToVisibility(const LLSD &new_visibility)
{
gAgentCamera.changeCameraToDefault();
gAgentCamera.resetView();
- }
+ }
}
}
@@ -452,7 +452,7 @@ void LLSidepanelAppearance::editWearable(LLViewerWearable *wearable, LLView *dat
LLFloaterSidePanelContainer::showPanel("appearance", LLSD());
LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>(data);
if (panel)
- {
+ {
panel->showWearableEditPanel(wearable, disable_camera_switch);
}
}
diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h
index b0a6b9cf91..cde05a8d9b 100755
--- a/indra/newview/llsidepanelappearance.h
+++ b/indra/newview/llsidepanelappearance.h
@@ -47,7 +47,7 @@ public:
virtual ~LLSidepanelAppearance();
/*virtual*/ BOOL postBuild();
- /*virtual*/ void onOpen(const LLSD& key);
+ /*virtual*/ void onOpen(const LLSD& key);
void refreshCurrentOutfitName(const std::string& name = "");
@@ -68,7 +68,7 @@ public:
private:
void onFilterEdit(const std::string& search_string);
- void onVisibilityChange ( const LLSD& new_visibility );
+ void onVisibilityChanged ( const LLSD& new_visibility );
void onOpenOutfitButtonClicked();
void onEditAppearanceButtonClicked();
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index 040cbc22a6..4970eec636 100755
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -160,7 +160,7 @@ BOOL LLSidepanelInventory::postBuild()
{
// UI elements from inventory panel
{
- mInventoryPanel = getChild<LLPanel>("sidepanel__inventory_panel");
+ mInventoryPanel = getChild<LLPanel>("sidepanel_inventory_panel");
mInfoBtn = mInventoryPanel->getChild<LLButton>("info_btn");
mInfoBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onInfoButtonClicked, this));
@@ -257,12 +257,9 @@ void LLSidepanelInventory::updateInbox()
//
// Track inbox folder changes
//
-
- const bool do_not_create_folder = false;
-
- const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, do_not_create_folder);
+ const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, true);
- // Set up observer to listen for creation of inbox if at least one of them doesn't exist
+ // Set up observer to listen for creation of inbox if it doesn't exist
if (inbox_id.isNull())
{
observeInboxCreation();
@@ -270,6 +267,11 @@ void LLSidepanelInventory::updateInbox()
// Set up observer for inbox changes, if we have an inbox already
else
{
+ // Consolidate Received items
+ // We shouldn't have to do that but with a client/server system relying on a "well known folder" convention,
+ // things can get messy and conventions broken. This call puts everything back together in its right place.
+ gInventory.consolidateForType(inbox_id, LLFolderType::FT_INBOX);
+
// Enable the display of the inbox if it exists
enableInbox(true);
@@ -309,7 +311,7 @@ void LLSidepanelInventory::observeInboxModifications(const LLUUID& inboxID)
if (inboxID.isNull())
{
- llwarns << "Attempting to track modifications to non-existent inbox" << llendl;
+ LL_WARNS() << "Attempting to track modifications to non-existent inbox" << LL_ENDL;
return;
}
@@ -710,13 +712,13 @@ void LLSidepanelInventory::clearSelections(bool clearMain, bool clearInbox)
if (inv_panel)
{
- inv_panel->clearSelection();
+ inv_panel->getRootFolder()->clearSelection();
}
}
if (clearInbox && mInboxEnabled && mInventoryPanelInbox.get())
{
- mInventoryPanelInbox.get()->clearSelection();
+ mInventoryPanelInbox.get()->getRootFolder()->clearSelection();
}
updateVerbs();
diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp
index e52b2f2559..1d20b7bed5 100755
--- a/indra/newview/llsidepaneliteminfo.cpp
+++ b/indra/newview/llsidepaneliteminfo.cpp
@@ -678,7 +678,7 @@ void LLSidepanelItemInfo::startObjectInventoryObserver()
if (mObjectID.isNull())
{
- llwarns << "Empty object id passed to inventory observer" << llendl;
+ LL_WARNS() << "Empty object id passed to inventory observer" << LL_ENDL;
return;
}
@@ -721,7 +721,7 @@ void LLSidepanelItemInfo::onClickOwner()
// static
void LLSidepanelItemInfo::onCommitName()
{
- //llinfos << "LLSidepanelItemInfo::onCommitName()" << llendl;
+ //LL_INFOS() << "LLSidepanelItemInfo::onCommitName()" << LL_ENDL;
LLViewerInventoryItem* item = findItem();
if(!item)
{
@@ -757,7 +757,7 @@ void LLSidepanelItemInfo::onCommitName()
void LLSidepanelItemInfo::onCommitDescription()
{
- //llinfos << "LLSidepanelItemInfo::onCommitDescription()" << llendl;
+ //LL_INFOS() << "LLSidepanelItemInfo::onCommitDescription()" << LL_ENDL;
LLViewerInventoryItem* item = findItem();
if(!item) return;
@@ -795,7 +795,7 @@ void LLSidepanelItemInfo::onCommitDescription()
// static
void LLSidepanelItemInfo::onCommitPermissions()
{
- //llinfos << "LLSidepanelItemInfo::onCommitPermissions()" << llendl;
+ //LL_INFOS() << "LLSidepanelItemInfo::onCommitPermissions()" << LL_ENDL;
LLViewerInventoryItem* item = findItem();
if(!item) return;
LLPermissions perm(item->getPermissions());
@@ -892,14 +892,14 @@ void LLSidepanelItemInfo::onCommitPermissions()
// static
void LLSidepanelItemInfo::onCommitSaleInfo()
{
- //llinfos << "LLSidepanelItemInfo::onCommitSaleInfo()" << llendl;
+ //LL_INFOS() << "LLSidepanelItemInfo::onCommitSaleInfo()" << LL_ENDL;
updateSaleInfo();
}
// static
void LLSidepanelItemInfo::onCommitSaleType()
{
- //llinfos << "LLSidepanelItemInfo::onCommitSaleType()" << llendl;
+ //LL_INFOS() << "LLSidepanelItemInfo::onCommitSaleType()" << LL_ENDL;
updateSaleInfo();
}
diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp
index 4428098929..636654ad23 100755
--- a/indra/newview/llsidepaneltaskinfo.cpp
+++ b/indra/newview/llsidepaneltaskinfo.cpp
@@ -162,7 +162,7 @@ BOOL LLSidepanelTaskInfo::postBuild()
return TRUE;
}
-/*virtual*/ void LLSidepanelTaskInfo::handleVisibilityChange ( BOOL visible )
+/*virtual*/ void LLSidepanelTaskInfo::onVisibilityChange ( BOOL visible )
{
if (visible)
{
@@ -945,7 +945,6 @@ static bool callback_deed_to_group(const LLSD& notification, const LLSD& respons
if (group_id.notNull() && groups_identical && (gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED)))
{
LLSelectMgr::getInstance()->sendOwner(LLUUID::null, group_id, FALSE);
-// LLViewerStats::getInstance()->incStat(LLViewerStats::ST_RELEASE_COUNT);
}
}
return FALSE;
@@ -996,28 +995,28 @@ void LLSidepanelTaskInfo::onCommitEveryoneCopy(LLUICtrl *ctrl, void *data)
// static
void LLSidepanelTaskInfo::onCommitNextOwnerModify(LLUICtrl* ctrl, void* data)
{
- //llinfos << "LLSidepanelTaskInfo::onCommitNextOwnerModify" << llendl;
+ //LL_INFOS() << "LLSidepanelTaskInfo::onCommitNextOwnerModify" << LL_ENDL;
onCommitPerm(ctrl, data, PERM_NEXT_OWNER, PERM_MODIFY);
}
// static
void LLSidepanelTaskInfo::onCommitNextOwnerCopy(LLUICtrl* ctrl, void* data)
{
- //llinfos << "LLSidepanelTaskInfo::onCommitNextOwnerCopy" << llendl;
+ //LL_INFOS() << "LLSidepanelTaskInfo::onCommitNextOwnerCopy" << LL_ENDL;
onCommitPerm(ctrl, data, PERM_NEXT_OWNER, PERM_COPY);
}
// static
void LLSidepanelTaskInfo::onCommitNextOwnerTransfer(LLUICtrl* ctrl, void* data)
{
- //llinfos << "LLSidepanelTaskInfo::onCommitNextOwnerTransfer" << llendl;
+ //LL_INFOS() << "LLSidepanelTaskInfo::onCommitNextOwnerTransfer" << LL_ENDL;
onCommitPerm(ctrl, data, PERM_NEXT_OWNER, PERM_TRANSFER);
}
// static
void LLSidepanelTaskInfo::onCommitName(LLUICtrl*, void* data)
{
- //llinfos << "LLSidepanelTaskInfo::onCommitName()" << llendl;
+ //LL_INFOS() << "LLSidepanelTaskInfo::onCommitName()" << LL_ENDL;
LLSidepanelTaskInfo* self = (LLSidepanelTaskInfo*)data;
LLLineEditor* tb = self->getChild<LLLineEditor>("Object Name");
if(tb)
@@ -1031,7 +1030,7 @@ void LLSidepanelTaskInfo::onCommitName(LLUICtrl*, void* data)
// static
void LLSidepanelTaskInfo::onCommitDesc(LLUICtrl*, void* data)
{
- //llinfos << "LLSidepanelTaskInfo::onCommitDesc()" << llendl;
+ //LL_INFOS() << "LLSidepanelTaskInfo::onCommitDesc()" << LL_ENDL;
LLSidepanelTaskInfo* self = (LLSidepanelTaskInfo*)data;
LLLineEditor* le = self->getChild<LLLineEditor>("Object Description");
if(le)
diff --git a/indra/newview/llsidepaneltaskinfo.h b/indra/newview/llsidepaneltaskinfo.h
index 05edcda5ed..a1479ef0e7 100755
--- a/indra/newview/llsidepaneltaskinfo.h
+++ b/indra/newview/llsidepaneltaskinfo.h
@@ -50,7 +50,7 @@ public:
virtual ~LLSidepanelTaskInfo();
/*virtual*/ BOOL postBuild();
- /*virtual*/ void handleVisibilityChange ( BOOL new_visibility );
+ /*virtual*/ void onVisibilityChange ( BOOL new_visibility );
void setObjectSelection(LLObjectSelectionHandle selection);
diff --git a/indra/newview/llsimplestat.h b/indra/newview/llsimplestat.h
deleted file mode 100755
index 9d7780c4f9..0000000000
--- a/indra/newview/llsimplestat.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/**
- * @file llsimplestat.h
- * @brief Runtime statistics accumulation.
- *
- * $LicenseInfo:firstyear=2010&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_SIMPLESTAT_H
-#define LL_SIMPLESTAT_H
-
-// History
-//
-// The original source for this code is the server repositories'
-// llcommon/llstat.h file. This particular code was added after the
-// viewer/server code schism but before the effort to convert common
-// code to libraries was complete. Rather than add to merge issues,
-// the needed code was cut'n'pasted into this new header as it isn't
-// too awful a burden. Post-modularization, we can look at removing
-// this redundancy.
-
-
-/**
- * @class LLSimpleStatCounter
- * @brief Just counts events.
- *
- * Really not needed but have a pattern in mind in the future.
- * Interface limits what can be done at that's just fine.
- *
- * *TODO: Update/transfer unit tests
- * Unit tests: indra/test/llcommon_llstat_tut.cpp
- */
-class LLSimpleStatCounter
-{
-public:
- inline LLSimpleStatCounter() { reset(); }
- // Default destructor and assignment operator are valid
-
- inline void reset() { mCount = 0; }
-
- inline void merge(const LLSimpleStatCounter & src)
- { mCount += src.mCount; }
-
- inline U32 operator++() { return ++mCount; }
-
- inline U32 getCount() const { return mCount; }
-
-protected:
- U32 mCount;
-};
-
-
-/**
- * @class LLSimpleStatMMM
- * @brief Templated collector of min, max and mean data for stats.
- *
- * Fed a stream of data samples, keeps a running account of the
- * min, max and mean seen since construction or the last reset()
- * call. A freshly-constructed or reset instance returns counts
- * and values of zero.
- *
- * Overflows and underflows (integer, inf or -inf) and NaN's
- * are the caller's problem. As is loss of precision when
- * the running sum's exponent (when parameterized by a floating
- * point of some type) differs from a given data sample's.
- *
- * Unit tests: indra/test/llcommon_llstat_tut.cpp
- */
-template <typename VALUE_T = F32>
-class LLSimpleStatMMM
-{
-public:
- typedef VALUE_T Value;
-
-public:
- LLSimpleStatMMM() { reset(); }
- // Default destructor and assignment operator are valid
-
- /**
- * Resets the object returning all counts and derived
- * values back to zero.
- */
- void reset()
- {
- mCount = 0;
- mMin = Value(0);
- mMax = Value(0);
- mTotal = Value(0);
- }
-
- void record(Value v)
- {
- if (mCount)
- {
- mMin = llmin(mMin, v);
- mMax = llmax(mMax, v);
- }
- else
- {
- mMin = v;
- mMax = v;
- }
- mTotal += v;
- ++mCount;
- }
-
- void merge(const LLSimpleStatMMM<VALUE_T> & src)
- {
- if (! mCount)
- {
- *this = src;
- }
- else if (src.mCount)
- {
- mMin = llmin(mMin, src.mMin);
- mMax = llmax(mMax, src.mMax);
- mCount += src.mCount;
- mTotal += src.mTotal;
- }
- }
-
- inline U32 getCount() const { return mCount; }
- inline Value getMin() const { return mMin; }
- inline Value getMax() const { return mMax; }
- inline Value getMean() const { return mCount ? mTotal / mCount : mTotal; }
-
-protected:
- U32 mCount;
- Value mMin;
- Value mMax;
- Value mTotal;
-};
-
-#endif // LL_SIMPLESTAT_H
diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp
index 7532ebfc57..1aa7041175 100644
--- a/indra/newview/llsnapshotlivepreview.cpp
+++ b/indra/newview/llsnapshotlivepreview.cpp
@@ -34,7 +34,11 @@
#include "lleconomy.h"
#include "llfloaterperms.h"
#include "llfloaterreg.h"
-#include "llfloatersocial.h"
+#include "llfloaterfacebook.h"
+#include "llfloaterflickr.h"
+#include "llfloatertwitter.h"
+#include "llimagefilter.h"
+#include "llimagefiltersmanager.h"
#include "llimagebmp.h"
#include "llimagej2c.h"
#include "llimagejpeg.h"
@@ -50,7 +54,6 @@
#include "llviewerstats.h"
#include "llvfile.h"
#include "llvfs.h"
-#include "llwebsharing.h"
#include "llwindow.h"
#include "llworld.h"
@@ -71,9 +74,11 @@ LLSnapshotLivePreview::LLSnapshotLivePreview (const LLSnapshotLivePreview::Param
mColor(1.f, 0.f, 0.f, 0.5f),
mCurImageIndex(0),
mPreviewImage(NULL),
- mThumbnailImage(NULL) ,
+ mThumbnailImage(NULL) ,
+ mBigThumbnailImage(NULL) ,
mThumbnailWidth(0),
mThumbnailHeight(0),
+ mThumbnailSubsampled(FALSE),
mPreviewImageEncoded(NULL),
mFormattedImage(NULL),
mShineCountdown(0),
@@ -87,7 +92,11 @@ LLSnapshotLivePreview::LLSnapshotLivePreview (const LLSnapshotLivePreview::Param
mCameraPos(LLViewerCamera::getInstance()->getOrigin()),
mCameraRot(LLViewerCamera::getInstance()->getQuaternion()),
mSnapshotActive(FALSE),
- mSnapshotBufferType(LLViewerWindow::SNAPSHOT_TYPE_COLOR)
+ mSnapshotBufferType(LLViewerWindow::SNAPSHOT_TYPE_COLOR),
+ mFilterName(""),
+ mAllowRenderUI(TRUE),
+ mAllowFullScreenPreview(TRUE),
+ mViewContainer(NULL)
{
setSnapshotQuality(gSavedSettings.getS32("SnapshotQuality"));
mSnapshotDelayTimer.setTimerExpirySec(0.0f);
@@ -106,6 +115,7 @@ LLSnapshotLivePreview::LLSnapshotLivePreview (const LLSnapshotLivePreview::Param
mKeepAspectRatio = gSavedSettings.getBOOL("KeepAspectForSnapshot") ;
mThumbnailUpdateLock = FALSE ;
mThumbnailUpToDate = FALSE ;
+ mBigThumbnailUpToDate = FALSE ;
}
LLSnapshotLivePreview::~LLSnapshotLivePreview()
@@ -121,14 +131,7 @@ LLSnapshotLivePreview::~LLSnapshotLivePreview()
void LLSnapshotLivePreview::setMaxImageSize(S32 size)
{
- if(size < MAX_SNAPSHOT_IMAGE_SIZE)
- {
- mMaxImageSize = size;
- }
- else
- {
- mMaxImageSize = MAX_SNAPSHOT_IMAGE_SIZE ;
- }
+ mMaxImageSize = llmin(size,(S32)(MAX_SNAPSHOT_IMAGE_SIZE));
}
LLViewerTexture* LLSnapshotLivePreview::getCurrentImage()
@@ -136,97 +139,94 @@ LLViewerTexture* LLSnapshotLivePreview::getCurrentImage()
return mViewerImage[mCurImageIndex];
}
-F32 LLSnapshotLivePreview::getAspect()
-{
- F32 image_aspect_ratio = ((F32)getWidth()) / ((F32)getHeight());
- F32 window_aspect_ratio = ((F32)getRect().getWidth()) / ((F32)getRect().getHeight());
-
- if (!mKeepAspectRatio)//gSavedSettings.getBOOL("KeepAspectForSnapshot"))
- {
- return image_aspect_ratio;
- }
- else
- {
- return window_aspect_ratio;
- }
-}
-
F32 LLSnapshotLivePreview::getImageAspect()
{
if (!getCurrentImage())
{
return 0.f;
}
-
- return getAspect() ;
+ // mKeepAspectRatio) == gSavedSettings.getBOOL("KeepAspectForSnapshot"))
+ return (mKeepAspectRatio ? ((F32)getRect().getWidth()) / ((F32)getRect().getHeight()) : ((F32)getWidth()) / ((F32)getHeight()));
}
-void LLSnapshotLivePreview::updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail, F32 delay)
+void LLSnapshotLivePreview::updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail, F32 delay)
{
- // Invalidate current image.
- lldebugs << "updateSnapshot: mSnapshotUpToDate = " << getSnapshotUpToDate() << llendl;
- if (getSnapshotUpToDate())
- {
- S32 old_image_index = mCurImageIndex;
- mCurImageIndex = (mCurImageIndex + 1) % 2;
- setSize(mWidth[old_image_index], mHeight[old_image_index]);
- mFallAnimTimer.start();
- }
- mSnapshotUpToDate = FALSE;
-
- // Update snapshot source rect depending on whether we keep the aspect ratio.
- LLRect& rect = mImageRect[mCurImageIndex];
- rect.set(0, getRect().getHeight(), getRect().getWidth(), 0);
-
- F32 image_aspect_ratio = ((F32)getWidth()) / ((F32)getHeight());
- F32 window_aspect_ratio = ((F32)getRect().getWidth()) / ((F32)getRect().getHeight());
-
- if (mKeepAspectRatio)//gSavedSettings.getBOOL("KeepAspectForSnapshot"))
- {
- if (image_aspect_ratio > window_aspect_ratio)
- {
- // trim off top and bottom
- S32 new_height = llround((F32)getRect().getWidth() / image_aspect_ratio);
- rect.mBottom += (getRect().getHeight() - new_height) / 2;
- rect.mTop -= (getRect().getHeight() - new_height) / 2;
- }
- else if (image_aspect_ratio < window_aspect_ratio)
- {
- // trim off left and right
- S32 new_width = llround((F32)getRect().getHeight() * image_aspect_ratio);
- rect.mLeft += (getRect().getWidth() - new_width) / 2;
- rect.mRight -= (getRect().getWidth() - new_width) / 2;
- }
- }
-
- // Stop shining animation.
- mShineAnimTimer.stop();
+ LL_DEBUGS() << "updateSnapshot: mSnapshotUpToDate = " << getSnapshotUpToDate() << LL_ENDL;
// Update snapshot if requested.
if (new_snapshot)
{
+ if (getSnapshotUpToDate())
+ {
+ S32 old_image_index = mCurImageIndex;
+ mCurImageIndex = (mCurImageIndex + 1) % 2;
+ setSize(mWidth[old_image_index], mHeight[old_image_index]);
+ mFallAnimTimer.start();
+ }
+ mSnapshotUpToDate = FALSE;
+
+ // Update snapshot source rect depending on whether we keep the aspect ratio.
+ LLRect& rect = mImageRect[mCurImageIndex];
+ rect.set(0, getRect().getHeight(), getRect().getWidth(), 0);
+
+ F32 image_aspect_ratio = ((F32)getWidth()) / ((F32)getHeight());
+ F32 window_aspect_ratio = ((F32)getRect().getWidth()) / ((F32)getRect().getHeight());
+
+ if (mKeepAspectRatio)//gSavedSettings.getBOOL("KeepAspectForSnapshot"))
+ {
+ if (image_aspect_ratio > window_aspect_ratio)
+ {
+ // trim off top and bottom
+ S32 new_height = llround((F32)getRect().getWidth() / image_aspect_ratio);
+ rect.mBottom += (getRect().getHeight() - new_height) / 2;
+ rect.mTop -= (getRect().getHeight() - new_height) / 2;
+ }
+ else if (image_aspect_ratio < window_aspect_ratio)
+ {
+ // trim off left and right
+ S32 new_width = llround((F32)getRect().getHeight() * image_aspect_ratio);
+ rect.mLeft += (getRect().getWidth() - new_width) / 2;
+ rect.mRight -= (getRect().getWidth() - new_width) / 2;
+ }
+ }
+
+ // Stop shining animation.
+ mShineAnimTimer.stop();
mSnapshotDelayTimer.start();
mSnapshotDelayTimer.setTimerExpirySec(delay);
- LLFloaterSnapshot::preUpdate();
- LLFloaterSocial::preUpdate();
+
+ mPosTakenGlobal = gAgentCamera.getCameraPositionGlobal();
+
+ // Tell the floater container that the snapshot is in the process of updating itself
+ if (mViewContainer)
+ {
+ mViewContainer->notify(LLSD().with("snapshot-updating", true));
+ }
}
// Update thumbnail if requested.
- if(new_thumbnail)
+ if (new_thumbnail)
{
mThumbnailUpToDate = FALSE ;
+ mBigThumbnailUpToDate = FALSE;
}
}
-void LLSnapshotLivePreview::setSnapshotQuality(S32 quality)
+// Return true if the quality has been changed, false otherwise
+bool LLSnapshotLivePreview::setSnapshotQuality(S32 quality, bool set_by_user)
{
llclamp(quality, 0, 100);
if (quality != mSnapshotQuality)
{
mSnapshotQuality = quality;
- gSavedSettings.setS32("SnapshotQuality", quality);
- mSnapshotUpToDate = FALSE;
+ if (set_by_user)
+ {
+ gSavedSettings.setS32("SnapshotQuality", quality);
+ }
+ mFormattedImage = NULL; // Invalidate the already formatted image if any
+ return true;
}
+ return false;
}
void LLSnapshotLivePreview::drawPreviewRect(S32 offset_x, S32 offset_y)
@@ -338,7 +338,7 @@ void LLSnapshotLivePreview::draw()
}
else if (mShineAnimTimer.getStarted())
{
- lldebugs << "Drawing shining animation" << llendl;
+ LL_DEBUGS() << "Drawing shining animation" << LL_ENDL;
F32 shine_interp = llmin(1.f, mShineAnimTimer.getElapsedTimeF32() / SHINE_TIME);
// draw "shine" effect
@@ -415,7 +415,7 @@ void LLSnapshotLivePreview::draw()
S32 old_image_index = (mCurImageIndex + 1) % 2;
if (mViewerImage[old_image_index].notNull() && mFallAnimTimer.getElapsedTimeF32() < FALL_TIME)
{
- lldebugs << "Drawing fall animation" << llendl;
+ LL_DEBUGS() << "Drawing fall animation" << LL_ENDL;
F32 fall_interp = mFallAnimTimer.getElapsedTimeF32() / FALL_TIME;
F32 alpha = clamp_rescale(fall_interp, 0.f, 1.f, 0.8f, 0.4f);
LLColor4 image_color(1.f, 1.f, 1.f, alpha);
@@ -459,69 +459,58 @@ void LLSnapshotLivePreview::reshape(S32 width, S32 height, BOOL called_from_pare
LLView::reshape(width, height, called_from_parent);
if (old_rect.getWidth() != width || old_rect.getHeight() != height)
{
- lldebugs << "window reshaped, updating thumbnail" << llendl;
- updateSnapshot(FALSE, TRUE);
+ LL_DEBUGS() << "window reshaped, updating thumbnail" << LL_ENDL;
+ updateSnapshot(TRUE);
}
}
BOOL LLSnapshotLivePreview::setThumbnailImageSize()
{
- if(getWidth() < 10 || getHeight() < 10)
+ if (getWidth() < 10 || getHeight() < 10)
{
return FALSE ;
}
- S32 window_width = gViewerWindow->getWindowWidthRaw() ;
- S32 window_height = gViewerWindow->getWindowHeightRaw() ;
+ S32 width = (mThumbnailSubsampled ? mPreviewImage->getWidth() : gViewerWindow->getWindowWidthRaw());
+ S32 height = (mThumbnailSubsampled ? mPreviewImage->getHeight() : gViewerWindow->getWindowHeightRaw()) ;
- F32 window_aspect_ratio = ((F32)window_width) / ((F32)window_height);
+ F32 aspect_ratio = ((F32)width) / ((F32)height);
// UI size for thumbnail
- // *FIXME: the rect does not change, so maybe there's no need to recalculate max w/h.
- const LLRect& thumbnail_rect = mThumbnailPlaceholderRect;
- S32 max_width = thumbnail_rect.getWidth();
- S32 max_height = thumbnail_rect.getHeight();
+ S32 max_width = mThumbnailPlaceholderRect.getWidth();
+ S32 max_height = mThumbnailPlaceholderRect.getHeight();
- if (window_aspect_ratio > (F32)max_width / max_height)
+ if (aspect_ratio > (F32)max_width / (F32)max_height)
{
// image too wide, shrink to width
mThumbnailWidth = max_width;
- mThumbnailHeight = llround((F32)max_width / window_aspect_ratio);
+ mThumbnailHeight = llround((F32)max_width / aspect_ratio);
}
else
{
// image too tall, shrink to height
mThumbnailHeight = max_height;
- mThumbnailWidth = llround((F32)max_height * window_aspect_ratio);
+ mThumbnailWidth = llround((F32)max_height * aspect_ratio);
}
-
- if(mThumbnailWidth > window_width || mThumbnailHeight > window_height)
+
+ if (mThumbnailWidth > width || mThumbnailHeight > height)
{
return FALSE ;//if the window is too small, ignore thumbnail updating.
}
S32 left = 0 , top = mThumbnailHeight, right = mThumbnailWidth, bottom = 0 ;
- if(!mKeepAspectRatio)
+ if (!mKeepAspectRatio)
{
- F32 ratio_x = (F32)getWidth() / window_width ;
- F32 ratio_y = (F32)getHeight() / window_height ;
-
- //if(getWidth() > window_width ||
- // getHeight() > window_height )
- {
- if(ratio_x > ratio_y)
- {
- top = (S32)(top * ratio_y / ratio_x) ;
- }
- else
- {
- right = (S32)(right * ratio_x / ratio_y) ;
- }
- }
- //else
- //{
- // right = (S32)(right * ratio_x) ;
- // top = (S32)(top * ratio_y) ;
- //}
+ F32 ratio_x = (F32)getWidth() / width ;
+ F32 ratio_y = (F32)getHeight() / height ;
+
+ if (ratio_x > ratio_y)
+ {
+ top = (S32)(top * ratio_y / ratio_x) ;
+ }
+ else
+ {
+ right = (S32)(right * ratio_x / ratio_y) ;
+ }
left = (S32)((mThumbnailWidth - right) * 0.5f) ;
bottom = (S32)((mThumbnailHeight - top) * 0.5f) ;
top += bottom ;
@@ -557,25 +546,62 @@ void LLSnapshotLivePreview::generateThumbnailImage(BOOL force_update)
return ;
}
+ // Invalidate the big thumbnail when we regenerate the small one
+ mBigThumbnailUpToDate = FALSE;
+
if(mThumbnailImage)
{
resetThumbnailImage() ;
}
LLPointer<LLImageRaw> raw = new LLImageRaw;
- if(!gViewerWindow->thumbnailSnapshot(raw,
- mThumbnailWidth, mThumbnailHeight,
- gSavedSettings.getBOOL("RenderUIInSnapshot"),
- FALSE,
- mSnapshotBufferType) )
+
+ if (mThumbnailSubsampled)
+ {
+ // The thumbnail is be a subsampled version of the preview (used in SL Share previews, i.e. Flickr, Twitter, Facebook)
+ raw->resize( mPreviewImage->getWidth(),
+ mPreviewImage->getHeight(),
+ mPreviewImage->getComponents());
+ raw->copy(mPreviewImage);
+ // Scale to the thumbnail size
+ if (!raw->scale(mThumbnailWidth, mThumbnailHeight))
+ {
+ raw = NULL ;
+ }
+ }
+ else
+ {
+ // The thumbnail is a screen view with screen grab positioning preview
+ if(!gViewerWindow->thumbnailSnapshot(raw,
+ mThumbnailWidth, mThumbnailHeight,
+ mAllowRenderUI && gSavedSettings.getBOOL("RenderUIInSnapshot"),
+ FALSE,
+ mSnapshotBufferType) )
+ {
+ raw = NULL ;
+ }
+ }
+
+ if (raw)
{
- raw = NULL ;
- }
-
- if(raw)
- {
- raw->expandToPowerOfTwo();
- mThumbnailImage = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE);
+ // Filter the thumbnail
+ // Note: filtering needs to be done *before* the scaling to power of 2 or the effect is distorted
+ if (getFilter() != "")
+ {
+ std::string filter_path = LLImageFiltersManager::getInstance()->getFilterPath(getFilter());
+ if (filter_path != "")
+ {
+ LLImageFilter filter(filter_path);
+ filter.executeFilter(raw);
+ }
+ else
+ {
+ LL_WARNS() << "Couldn't find a path to the following filter : " << getFilter() << LL_ENDL;
+ }
+ }
+ // Scale to a power of 2 so it can be mapped to a texture
+ raw->expandToPowerOfTwo();
+ mThumbnailImage = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE);
mThumbnailUpToDate = TRUE ;
}
@@ -583,6 +609,52 @@ void LLSnapshotLivePreview::generateThumbnailImage(BOOL force_update)
mThumbnailUpdateLock = FALSE ;
}
+LLViewerTexture* LLSnapshotLivePreview::getBigThumbnailImage()
+{
+ if (mThumbnailUpdateLock) //in the process of updating
+ {
+ return NULL;
+ }
+ if (mBigThumbnailUpToDate && mBigThumbnailImage)//already updated
+ {
+ return mBigThumbnailImage;
+ }
+
+ LLPointer<LLImageRaw> raw = new LLImageRaw;
+
+ if (raw)
+ {
+ // The big thumbnail is a new filtered version of the preview (used in SL Share previews, i.e. Flickr, Twitter, Facebook)
+ mBigThumbnailWidth = mPreviewImage->getWidth();
+ mBigThumbnailHeight = mPreviewImage->getHeight();
+ raw->resize( mBigThumbnailWidth,
+ mBigThumbnailHeight,
+ mPreviewImage->getComponents());
+ raw->copy(mPreviewImage);
+
+ // Filter
+ // Note: filtering needs to be done *before* the scaling to power of 2 or the effect is distorted
+ if (getFilter() != "")
+ {
+ std::string filter_path = LLImageFiltersManager::getInstance()->getFilterPath(getFilter());
+ if (filter_path != "")
+ {
+ LLImageFilter filter(filter_path);
+ filter.executeFilter(raw);
+ }
+ else
+ {
+ LL_WARNS() << "Couldn't find a path to the following filter : " << getFilter() << LL_ENDL;
+ }
+ }
+ // Scale to a power of 2 so it can be mapped to a texture
+ raw->expandToPowerOfTwo();
+ mBigThumbnailImage = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE);
+ mBigThumbnailUpToDate = TRUE ;
+ }
+
+ return mBigThumbnailImage ;
+}
// Called often. Checks whether it's time to grab a new snapshot and if so, does it.
// Returns TRUE if new snapshot generated, FALSE otherwise.
@@ -592,21 +664,21 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)snapshot_preview;
if (previewp->getWidth() == 0 || previewp->getHeight() == 0)
{
- llwarns << "Incorrect dimensions: " << previewp->getWidth() << "x" << previewp->getHeight() << llendl;
+ LL_WARNS() << "Incorrect dimensions: " << previewp->getWidth() << "x" << previewp->getHeight() << LL_ENDL;
return FALSE;
}
// If we're in freeze-frame mode and camera has moved, update snapshot.
LLVector3 new_camera_pos = LLViewerCamera::getInstance()->getOrigin();
LLQuaternion new_camera_rot = LLViewerCamera::getInstance()->getQuaternion();
- if (gSavedSettings.getBOOL("FreezeTime") &&
+ if (gSavedSettings.getBOOL("FreezeTime") && previewp->mAllowFullScreenPreview &&
(new_camera_pos != previewp->mCameraPos || dot(new_camera_rot, previewp->mCameraRot) < 0.995f))
{
previewp->mCameraPos = new_camera_pos;
previewp->mCameraRot = new_camera_rot;
// request a new snapshot whenever the camera moves, with a time delay
BOOL autosnap = gSavedSettings.getBOOL("AutoSnapshot");
- lldebugs << "camera moved, updating thumbnail" << llendl;
+ LL_DEBUGS() << "camera moved, updating thumbnail" << LL_ENDL;
previewp->updateSnapshot(
autosnap, // whether a new snapshot is needed or merely invalidate the existing one
FALSE, // or if 1st arg is false, whether to produce a new thumbnail image.
@@ -617,166 +689,273 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
previewp->mSnapshotActive =
(previewp->mSnapshotDelayTimer.getStarted() && previewp->mSnapshotDelayTimer.hasExpired())
&& !LLToolCamera::getInstance()->hasMouseCapture(); // don't take snapshots while ALT-zoom active
- if ( ! previewp->mSnapshotActive)
+ if (!previewp->mSnapshotActive && previewp->getSnapshotUpToDate() && previewp->getThumbnailUpToDate())
{
return FALSE;
}
// time to produce a snapshot
- previewp->setThumbnailImageSize();
-
- lldebugs << "producing snapshot" << llendl;
- if (!previewp->mPreviewImage)
+ if(!previewp->getSnapshotUpToDate())
+ {
+ LL_DEBUGS() << "producing snapshot" << LL_ENDL;
+ if (!previewp->mPreviewImage)
+ {
+ previewp->mPreviewImage = new LLImageRaw;
+ }
+
+ previewp->setVisible(FALSE);
+ previewp->setEnabled(FALSE);
+
+ previewp->getWindow()->incBusyCount();
+ previewp->setImageScaled(FALSE);
+
+ // grab the raw image
+ if (gViewerWindow->rawSnapshot(
+ previewp->mPreviewImage,
+ previewp->getWidth(),
+ previewp->getHeight(),
+ previewp->mKeepAspectRatio,//gSavedSettings.getBOOL("KeepAspectForSnapshot"),
+ previewp->getSnapshotType() == LLSnapshotLivePreview::SNAPSHOT_TEXTURE,
+ previewp->mAllowRenderUI && gSavedSettings.getBOOL("RenderUIInSnapshot"),
+ FALSE,
+ previewp->mSnapshotBufferType,
+ previewp->getMaxImageSize()))
+ {
+ // Invalidate/delete any existing encoded image
+ previewp->mPreviewImageEncoded = NULL;
+ // Invalidate/delete any existing formatted image
+ previewp->mFormattedImage = NULL;
+ // Update the data size
+ previewp->estimateDataSize();
+
+ // Full size preview is set: get the decoded image result and save it for animation
+ if (gSavedSettings.getBOOL("UseFreezeFrame") && previewp->mAllowFullScreenPreview)
+ {
+ // Get the decoded version of the formatted image
+ previewp->getEncodedImage();
+
+ // We need to scale that a bit for display...
+ LLPointer<LLImageRaw> scaled = new LLImageRaw(
+ previewp->mPreviewImageEncoded->getData(),
+ previewp->mPreviewImageEncoded->getWidth(),
+ previewp->mPreviewImageEncoded->getHeight(),
+ previewp->mPreviewImageEncoded->getComponents());
+
+ if (!scaled->isBufferInvalid())
+ {
+ // leave original image dimensions, just scale up texture buffer
+ if (previewp->mPreviewImageEncoded->getWidth() > 1024 || previewp->mPreviewImageEncoded->getHeight() > 1024)
+ {
+ // go ahead and shrink image to appropriate power of 2 for display
+ scaled->biasedScaleToPowerOfTwo(1024);
+ previewp->setImageScaled(TRUE);
+ }
+ else
+ {
+ // expand image but keep original image data intact
+ scaled->expandToPowerOfTwo(1024, FALSE);
+ }
+
+ previewp->mViewerImage[previewp->mCurImageIndex] = LLViewerTextureManager::getLocalTexture(scaled.get(), FALSE);
+ LLPointer<LLViewerTexture> curr_preview_image = previewp->mViewerImage[previewp->mCurImageIndex];
+ gGL.getTexUnit(0)->bind(curr_preview_image);
+ curr_preview_image->setFilteringOption(previewp->getSnapshotType() == SNAPSHOT_TEXTURE ? LLTexUnit::TFO_ANISOTROPIC : LLTexUnit::TFO_POINT);
+ curr_preview_image->setAddressMode(LLTexUnit::TAM_CLAMP);
+
+ previewp->mShineCountdown = 4; // wait a few frames to avoid animation glitch due to readback this frame
+ }
+ }
+ // The snapshot is updated now...
+ previewp->mSnapshotUpToDate = TRUE;
+
+ // We need to update the thumbnail though
+ previewp->setThumbnailImageSize();
+ previewp->generateThumbnailImage(TRUE) ;
+ }
+ previewp->getWindow()->decBusyCount();
+ previewp->setVisible(gSavedSettings.getBOOL("UseFreezeFrame") && previewp->mAllowFullScreenPreview); // only show fullscreen preview when in freeze frame mode
+ previewp->mSnapshotDelayTimer.stop();
+ previewp->mSnapshotActive = FALSE;
+ LL_DEBUGS() << "done creating snapshot" << LL_ENDL;
+ }
+
+ if (!previewp->getThumbnailUpToDate())
{
- previewp->mPreviewImage = new LLImageRaw;
+ previewp->generateThumbnailImage() ;
}
+
+ // Tell the floater container that the snapshot is updated now
+ if (previewp->mViewContainer)
+ {
+ previewp->mViewContainer->notify(LLSD().with("snapshot-updated", true));
+ }
- if (!previewp->mPreviewImageEncoded)
- {
- previewp->mPreviewImageEncoded = new LLImageRaw;
- }
+ return TRUE;
+}
+
+S32 LLSnapshotLivePreview::getEncodedImageWidth() const
+{
+ S32 width = getWidth();
+ if (getSnapshotType() == SNAPSHOT_TEXTURE)
+ {
+ width = LLImageRaw::biasedDimToPowerOfTwo(width,MAX_TEXTURE_SIZE);
+ }
+ return width;
+}
+S32 LLSnapshotLivePreview::getEncodedImageHeight() const
+{
+ S32 height = getHeight();
+ if (getSnapshotType() == SNAPSHOT_TEXTURE)
+ {
+ height = LLImageRaw::biasedDimToPowerOfTwo(height,MAX_TEXTURE_SIZE);
+ }
+ return height;
+}
- previewp->setVisible(FALSE);
- previewp->setEnabled(FALSE);
-
- previewp->getWindow()->incBusyCount();
- previewp->setImageScaled(FALSE);
-
- // grab the raw image and encode it into desired format
- if(gViewerWindow->rawSnapshot(
- previewp->mPreviewImage,
- previewp->getWidth(),
- previewp->getHeight(),
- previewp->mKeepAspectRatio,//gSavedSettings.getBOOL("KeepAspectForSnapshot"),
- previewp->getSnapshotType() == LLSnapshotLivePreview::SNAPSHOT_TEXTURE,
- gSavedSettings.getBOOL("RenderUIInSnapshot"),
- FALSE,
- previewp->mSnapshotBufferType,
- previewp->getMaxImageSize()))
- {
- previewp->mPreviewImageEncoded->resize(
- previewp->mPreviewImage->getWidth(),
- previewp->mPreviewImage->getHeight(),
- previewp->mPreviewImage->getComponents());
-
- if(previewp->getSnapshotType() == SNAPSHOT_TEXTURE)
+LLPointer<LLImageRaw> LLSnapshotLivePreview::getEncodedImage()
+{
+ if (!mPreviewImageEncoded)
+ {
+ mPreviewImageEncoded = new LLImageRaw;
+
+ mPreviewImageEncoded->resize(
+ mPreviewImage->getWidth(),
+ mPreviewImage->getHeight(),
+ mPreviewImage->getComponents());
+
+ if (getSnapshotType() == SNAPSHOT_TEXTURE)
{
- lldebugs << "Encoding new image of format J2C" << llendl;
+ // We don't store the intermediate formatted image in mFormattedImage in the J2C case
+ LL_DEBUGS() << "Encoding new image of format J2C" << LL_ENDL;
LLPointer<LLImageJ2C> formatted = new LLImageJ2C;
+ // Copy the preview
LLPointer<LLImageRaw> scaled = new LLImageRaw(
- previewp->mPreviewImage->getData(),
- previewp->mPreviewImage->getWidth(),
- previewp->mPreviewImage->getHeight(),
- previewp->mPreviewImage->getComponents());
-
+ mPreviewImage->getData(),
+ mPreviewImage->getWidth(),
+ mPreviewImage->getHeight(),
+ mPreviewImage->getComponents());
+ // Scale it as required by J2C
scaled->biasedScaleToPowerOfTwo(MAX_TEXTURE_SIZE);
- previewp->setImageScaled(TRUE);
+ setImageScaled(TRUE);
+ // Compress to J2C
if (formatted->encode(scaled, 0.f))
{
- previewp->mDataSize = formatted->getDataSize();
- formatted->decode(previewp->mPreviewImageEncoded, 0);
+ // We can update the data size precisely at that point
+ mDataSize = formatted->getDataSize();
+ // Decompress back
+ formatted->decode(mPreviewImageEncoded, 0);
}
}
else
{
- // delete any existing image
- previewp->mFormattedImage = NULL;
- // now create the new one of the appropriate format.
- LLFloaterSnapshot::ESnapshotFormat format = previewp->getSnapshotFormat();
- lldebugs << "Encoding new image of format " << format << llendl;
-
- switch(format)
- {
- case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG:
- previewp->mFormattedImage = new LLImagePNG();
- break;
- case LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG:
- previewp->mFormattedImage = new LLImageJPEG(previewp->mSnapshotQuality);
- break;
- case LLFloaterSnapshot::SNAPSHOT_FORMAT_BMP:
- previewp->mFormattedImage = new LLImageBMP();
- break;
- }
- if (previewp->mFormattedImage->encode(previewp->mPreviewImage, 0))
- {
- previewp->mDataSize = previewp->mFormattedImage->getDataSize();
- // special case BMP to copy instead of decode otherwise decode will crash.
- if(format == LLFloaterSnapshot::SNAPSHOT_FORMAT_BMP)
- {
- previewp->mPreviewImageEncoded->copy(previewp->mPreviewImage);
- }
- else
- {
- previewp->mFormattedImage->decode(previewp->mPreviewImageEncoded, 0);
- }
- }
- }
-
- LLPointer<LLImageRaw> scaled = new LLImageRaw(
- previewp->mPreviewImageEncoded->getData(),
- previewp->mPreviewImageEncoded->getWidth(),
- previewp->mPreviewImageEncoded->getHeight(),
- previewp->mPreviewImageEncoded->getComponents());
-
- if(!scaled->isBufferInvalid())
- {
- // leave original image dimensions, just scale up texture buffer
- if (previewp->mPreviewImageEncoded->getWidth() > 1024 || previewp->mPreviewImageEncoded->getHeight() > 1024)
- {
- // go ahead and shrink image to appropriate power of 2 for display
- scaled->biasedScaleToPowerOfTwo(1024);
- previewp->setImageScaled(TRUE);
- }
- else
- {
- // expand image but keep original image data intact
- scaled->expandToPowerOfTwo(1024, FALSE);
- }
-
- previewp->mViewerImage[previewp->mCurImageIndex] = LLViewerTextureManager::getLocalTexture(scaled.get(), FALSE);
- LLPointer<LLViewerTexture> curr_preview_image = previewp->mViewerImage[previewp->mCurImageIndex];
- gGL.getTexUnit(0)->bind(curr_preview_image);
- if (previewp->getSnapshotType() != SNAPSHOT_TEXTURE)
- {
- curr_preview_image->setFilteringOption(LLTexUnit::TFO_POINT);
- }
- else
- {
- curr_preview_image->setFilteringOption(LLTexUnit::TFO_ANISOTROPIC);
- }
- curr_preview_image->setAddressMode(LLTexUnit::TAM_CLAMP);
-
- previewp->mSnapshotUpToDate = TRUE;
- previewp->generateThumbnailImage(TRUE) ;
-
- previewp->mPosTakenGlobal = gAgentCamera.getCameraPositionGlobal();
- previewp->mShineCountdown = 4; // wait a few frames to avoid animation glitch due to readback this frame
+ // Update mFormattedImage if necessary
+ getFormattedImage();
+ if (getSnapshotFormat() == LLFloaterSnapshot::SNAPSHOT_FORMAT_BMP)
+ {
+ // BMP hack : copy instead of decode otherwise decode will crash.
+ mPreviewImageEncoded->copy(mPreviewImage);
+ }
+ else
+ {
+ // Decode back
+ mFormattedImage->decode(mPreviewImageEncoded, 0);
+ }
}
}
- previewp->getWindow()->decBusyCount();
- // only show fullscreen preview when in freeze frame mode
- previewp->setVisible(gSavedSettings.getBOOL("UseFreezeFrame"));
- previewp->mSnapshotDelayTimer.stop();
- previewp->mSnapshotActive = FALSE;
+ return mPreviewImageEncoded;
+}
- if(!previewp->getThumbnailUpToDate())
- {
- previewp->generateThumbnailImage() ;
- }
- lldebugs << "done creating snapshot" << llendl;
- LLFloaterSnapshot::postUpdate();
- LLFloaterSocial::postUpdate();
+// We actually estimate the data size so that we do not require actual compression when showing the preview
+// Note : whenever formatted image is computed, mDataSize will be updated to reflect the true size
+void LLSnapshotLivePreview::estimateDataSize()
+{
+ // Compression ratio
+ F32 ratio = 1.0;
+
+ if (getSnapshotType() == SNAPSHOT_TEXTURE)
+ {
+ ratio = 8.0; // This is what we shoot for when compressing to J2C
+ }
+ else
+ {
+ LLFloaterSnapshot::ESnapshotFormat format = getSnapshotFormat();
+ switch (format)
+ {
+ case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG:
+ ratio = 3.0; // Average observed PNG compression ratio
+ break;
+ case LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG:
+ // Observed from JPG compression tests
+ ratio = (110 - mSnapshotQuality) / 2;
+ break;
+ case LLFloaterSnapshot::SNAPSHOT_FORMAT_BMP:
+ ratio = 1.0; // No compression with BMP
+ break;
+ }
+ }
+ mDataSize = (S32)((F32)mPreviewImage->getDataSize() / ratio);
+}
- return TRUE;
+LLPointer<LLImageFormatted> LLSnapshotLivePreview::getFormattedImage()
+{
+ if (!mFormattedImage)
+ {
+ // Apply the filter to mPreviewImage
+ if (getFilter() != "")
+ {
+ std::string filter_path = LLImageFiltersManager::getInstance()->getFilterPath(getFilter());
+ if (filter_path != "")
+ {
+ LLImageFilter filter(filter_path);
+ filter.executeFilter(mPreviewImage);
+ }
+ else
+ {
+ LL_WARNS() << "Couldn't find a path to the following filter : " << getFilter() << LL_ENDL;
+ }
+ }
+
+ // Create the new formatted image of the appropriate format.
+ LLFloaterSnapshot::ESnapshotFormat format = getSnapshotFormat();
+ LL_DEBUGS() << "Encoding new image of format " << format << LL_ENDL;
+
+ switch (format)
+ {
+ case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG:
+ mFormattedImage = new LLImagePNG();
+ break;
+ case LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG:
+ mFormattedImage = new LLImageJPEG(mSnapshotQuality);
+ break;
+ case LLFloaterSnapshot::SNAPSHOT_FORMAT_BMP:
+ mFormattedImage = new LLImageBMP();
+ break;
+ }
+ if (mFormattedImage->encode(mPreviewImage, 0))
+ {
+ // We can update the data size precisely at that point
+ mDataSize = mFormattedImage->getDataSize();
+ }
+ }
+ return mFormattedImage;
}
void LLSnapshotLivePreview::setSize(S32 w, S32 h)
{
- lldebugs << "setSize(" << w << ", " << h << ")" << llendl;
+ LL_DEBUGS() << "setSize(" << w << ", " << h << ")" << LL_ENDL;
setWidth(w);
setHeight(h);
}
+void LLSnapshotLivePreview::setSnapshotFormat(LLFloaterSnapshot::ESnapshotFormat format)
+{
+ if (mSnapshotFormat != format)
+ {
+ mFormattedImage = NULL; // Invalidate the already formatted image if any
+ mSnapshotFormat = format;
+ }
+}
+
void LLSnapshotLivePreview::getSize(S32& w, S32& h) const
{
w = getWidth();
@@ -785,7 +964,7 @@ void LLSnapshotLivePreview::getSize(S32& w, S32& h) const
void LLSnapshotLivePreview::saveTexture()
{
- lldebugs << "saving texture: " << mPreviewImage->getWidth() << "x" << mPreviewImage->getHeight() << llendl;
+ LL_DEBUGS() << "saving texture: " << mPreviewImage->getWidth() << "x" << mPreviewImage->getHeight() << LL_ENDL;
// gen a new uuid for this asset
LLTransactionID tid;
tid.generate();
@@ -797,8 +976,23 @@ void LLSnapshotLivePreview::saveTexture()
mPreviewImage->getHeight(),
mPreviewImage->getComponents());
+ // Apply the filter to mPreviewImage
+ if (getFilter() != "")
+ {
+ std::string filter_path = LLImageFiltersManager::getInstance()->getFilterPath(getFilter());
+ if (filter_path != "")
+ {
+ LLImageFilter filter(filter_path);
+ filter.executeFilter(scaled);
+ }
+ else
+ {
+ LL_WARNS() << "Couldn't find a path to the following filter : " << getFilter() << LL_ENDL;
+ }
+ }
+
scaled->biasedScaleToPowerOfTwo(MAX_TEXTURE_SIZE);
- lldebugs << "scaled texture to " << scaled->getWidth() << "x" << scaled->getHeight() << llendl;
+ LL_DEBUGS() << "scaled texture to " << scaled->getWidth() << "x" << scaled->getHeight() << LL_ENDL;
if (formatted->encode(scaled, 0.0f))
{
@@ -818,8 +1012,8 @@ void LLSnapshotLivePreview::saveTexture()
LLFolderType::FT_SNAPSHOT_CATEGORY,
LLInventoryType::IT_SNAPSHOT,
PERM_ALL, // Note: Snapshots to inventory is a special case of content upload
- LLFloaterPerms::getGroupPerms(), // that is more permissive than other uploads
- LLFloaterPerms::getEveryonePerms(),
+ LLFloaterPerms::getGroupPerms("Uploads"), // that is more permissive than other uploads
+ LLFloaterPerms::getEveryonePerms("Uploads"),
"Snapshot : " + pos_string,
callback, expected_upload_cost, userdata);
gViewerWindow->playSnapshotAnimAndSound();
@@ -827,16 +1021,20 @@ void LLSnapshotLivePreview::saveTexture()
else
{
LLNotificationsUtil::add("ErrorEncodingSnapshot");
- llwarns << "Error encoding snapshot" << llendl;
+ LL_WARNS() << "Error encoding snapshot" << LL_ENDL;
}
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_SNAPSHOT_COUNT );
+ add(LLStatViewer::SNAPSHOT, 1);
mDataSize = 0;
}
BOOL LLSnapshotLivePreview::saveLocal()
{
+ // Update mFormattedImage if necessary
+ getFormattedImage();
+
+ // Save the formatted image
BOOL success = gViewerWindow->saveImageNumbered(mFormattedImage);
if(success)
@@ -846,29 +1044,3 @@ BOOL LLSnapshotLivePreview::saveLocal()
return success;
}
-void LLSnapshotLivePreview::saveWeb()
-{
- // *FIX: Will break if the window closes because of CloseSnapshotOnKeep!
- // Needs to pass on ownership of the image.
- LLImageJPEG* jpg = dynamic_cast<LLImageJPEG*>(mFormattedImage.get());
- if(!jpg)
- {
- llwarns << "Formatted image not a JPEG" << llendl;
- return;
- }
-
- LLSD metadata;
- metadata["description"] = getChild<LLLineEditor>("description")->getText();
-
- LLLandmarkActions::getRegionNameAndCoordsFromPosGlobal(gAgentCamera.getCameraPositionGlobal(),
- boost::bind(&LLSnapshotLivePreview::regionNameCallback, this, jpg, metadata, _1, _2, _3, _4));
-
- gViewerWindow->playSnapshotAnimAndSound();
-}
-
-void LLSnapshotLivePreview::regionNameCallback(LLImageJPEG* snapshot, LLSD& metadata, const std::string& name, S32 x, S32 y, S32 z)
-{
- metadata["slurl"] = LLSLURL(name, LLVector3d(x, y, z)).getSLURLString();
-
- LLWebSharing::instance().shareSnapshot(snapshot, metadata);
-}
diff --git a/indra/newview/llsnapshotlivepreview.h b/indra/newview/llsnapshotlivepreview.h
index fe3d257b02..e1937187a3 100644
--- a/indra/newview/llsnapshotlivepreview.h
+++ b/indra/newview/llsnapshotlivepreview.h
@@ -28,6 +28,7 @@
#define LL_LLSNAPSHOTLIVEPREVIEW_H
#include "llpanelsnapshot.h"
+#include "llviewertexture.h"
#include "llviewerwindow.h"
class LLImageJPEG;
@@ -61,6 +62,8 @@ public:
LLSnapshotLivePreview(const LLSnapshotLivePreview::Params& p);
~LLSnapshotLivePreview();
+ void setContainer(LLView* container) { mViewContainer = container; }
+
/*virtual*/ void draw();
/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent);
@@ -70,6 +73,9 @@ public:
void getSize(S32& w, S32& h) const;
S32 getWidth() const { return mWidth[mCurImageIndex]; }
S32 getHeight() const { return mHeight[mCurImageIndex]; }
+ S32 getEncodedImageWidth() const;
+ S32 getEncodedImageHeight() const;
+ void estimateDataSize();
S32 getDataSize() const { return mDataSize; }
void setMaxImageSize(S32 size) ;
S32 getMaxImageSize() {return mMaxImageSize ;}
@@ -83,40 +89,48 @@ public:
S32 getThumbnailHeight() const { return mThumbnailHeight ; }
BOOL getThumbnailLock() const { return mThumbnailUpdateLock ; }
BOOL getThumbnailUpToDate() const { return mThumbnailUpToDate ;}
+ void setThumbnailSubsampled(BOOL subsampled) { mThumbnailSubsampled = subsampled; }
+
LLViewerTexture* getCurrentImage();
F32 getImageAspect();
- F32 getAspect() ;
const LLRect& getImageRect() const { return mImageRect[mCurImageIndex]; }
BOOL isImageScaled() const { return mImageScaled[mCurImageIndex]; }
void setImageScaled(BOOL scaled) { mImageScaled[mCurImageIndex] = scaled; }
const LLVector3d& getPosTakenGlobal() const { return mPosTakenGlobal; }
void setSnapshotType(ESnapshotType type) { mSnapshotType = type; }
- void setSnapshotFormat(LLFloaterSnapshot::ESnapshotFormat type) { mSnapshotFormat = type; }
- void setSnapshotQuality(S32 quality);
+ void setSnapshotFormat(LLFloaterSnapshot::ESnapshotFormat format);
+ bool setSnapshotQuality(S32 quality, bool set_by_user = true);
void setSnapshotBufferType(LLViewerWindow::ESnapshotType type) { mSnapshotBufferType = type; }
+ void setAllowRenderUI(BOOL allow) { mAllowRenderUI = allow; }
+ void setAllowFullScreenPreview(BOOL allow) { mAllowFullScreenPreview = allow; }
+ void setFilter(std::string filter_name) { mFilterName = filter_name; }
+ std::string getFilter() const { return mFilterName; }
void updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail = FALSE, F32 delay = 0.f);
- void saveWeb();
void saveTexture();
BOOL saveLocal();
- LLPointer<LLImageFormatted> getFormattedImage() const { return mFormattedImage; }
- LLPointer<LLImageRaw> getEncodedImage() const { return mPreviewImageEncoded; }
+ LLPointer<LLImageFormatted> getFormattedImage();
+ LLPointer<LLImageRaw> getEncodedImage();
- /// Sets size of preview thumbnail image and thhe surrounding rect.
+ /// Sets size of preview thumbnail image and the surrounding rect.
void setThumbnailPlaceholderRect(const LLRect& rect) {mThumbnailPlaceholderRect = rect; }
BOOL setThumbnailImageSize() ;
void generateThumbnailImage(BOOL force_update = FALSE) ;
void resetThumbnailImage() { mThumbnailImage = NULL ; }
void drawPreviewRect(S32 offset_x, S32 offset_y) ;
+
+ LLViewerTexture* getBigThumbnailImage();
+ S32 getBigThumbnailWidth() const { return mBigThumbnailWidth ; }
+ S32 getBigThumbnailHeight() const { return mBigThumbnailHeight ; }
+
// Returns TRUE when snapshot generated, FALSE otherwise.
static BOOL onIdle( void* snapshot_preview );
- // callback for region name resolve
- void regionNameCallback(LLImageJPEG* snapshot, LLSD& metadata, const std::string& name, S32 x, S32 y, S32 z);
-
private:
+ LLView* mViewContainer;
+
LLColor4 mColor;
LLPointer<LLViewerTexture> mViewerImage[2]; //used to represent the scene when the frame is frozen.
LLRect mImageRect[2];
@@ -133,11 +147,20 @@ private:
BOOL mThumbnailUpdateLock ;
BOOL mThumbnailUpToDate ;
LLRect mThumbnailPlaceholderRect;
+ BOOL mThumbnailSubsampled; // TRUE if the thumbnail is a subsampled version of the mPreviewImage
+
+ LLPointer<LLViewerTexture> mBigThumbnailImage ;
+ S32 mBigThumbnailWidth;
+ S32 mBigThumbnailHeight;
+ BOOL mBigThumbnailUpToDate;
S32 mCurImageIndex;
+ // The logic is mPreviewImage (raw frame) -> mFormattedImage (formatted / filtered) -> mPreviewImageEncoded (decoded back, to show artifacts)
LLPointer<LLImageRaw> mPreviewImage;
LLPointer<LLImageRaw> mPreviewImageEncoded;
LLPointer<LLImageFormatted> mFormattedImage;
+ BOOL mAllowRenderUI;
+ BOOL mAllowFullScreenPreview;
LLFrameTimer mSnapshotDelayTimer;
S32 mShineCountdown;
LLFrameTimer mShineAnimTimer;
@@ -154,6 +177,7 @@ private:
LLQuaternion mCameraRot;
BOOL mSnapshotActive;
LLViewerWindow::ESnapshotType mSnapshotBufferType;
+ std::string mFilterName;
public:
static std::set<LLSnapshotLivePreview*> sList;
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 2c83f6d0b7..0a8257f42b 100755
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -51,68 +51,25 @@
#include "llvoavatar.h"
#include "llvolumemgr.h"
#include "lltextureatlas.h"
-#include "llglslshader.h"
#include "llviewershadermgr.h"
-static LLFastTimer::DeclareTimer FTM_FRUSTUM_CULL("Frustum Culling");
-static LLFastTimer::DeclareTimer FTM_CULL_REBOUND("Cull Rebound Partition");
-
-const F32 SG_OCCLUSION_FUDGE = 0.25f;
-#define SG_DISCARD_TOLERANCE 0.01f
-
-#if LL_OCTREE_PARANOIA_CHECK
-#define assert_octree_valid(x) x->validate()
-#define assert_states_valid(x) ((LLSpatialGroup*) x->mSpatialPartition->mOctree->getListener(0))->checkStates()
-#else
-#define assert_octree_valid(x)
-#define assert_states_valid(x)
-#endif
+static LLTrace::BlockTimerStatHandle FTM_FRUSTUM_CULL("Frustum Culling");
+static LLTrace::BlockTimerStatHandle FTM_CULL_REBOUND("Cull Rebound Partition");
extern bool gShiftFrame;
static U32 sZombieGroups = 0;
U32 LLSpatialGroup::sNodeCount = 0;
-#define LL_TRACK_PENDING_OCCLUSION_QUERIES 0
-
-std::set<GLuint> LLSpatialGroup::sPendingQueries;
-
U32 gOctreeMaxCapacity;
+F32 gOctreeMinSize;
BOOL LLSpatialGroup::sNoDelete = FALSE;
static F32 sLastMaxTexPriority = 1.f;
static F32 sCurMaxTexPriority = 1.f;
-class LLOcclusionQueryPool : public LLGLNamePool
-{
-public:
- LLOcclusionQueryPool()
- {
-
- }
-
-protected:
-
- virtual GLuint allocateName()
- {
- GLuint ret = 0;
-
- glGenQueriesARB(1, &ret);
-
- return ret;
- }
-
- virtual void releaseName(GLuint name)
- {
-#if LL_TRACK_PENDING_OCCLUSION_QUERIES
- LLSpatialGroup::sPendingQueries.erase(name);
-#endif
- glDeleteQueriesARB(1, &name);
- }
-};
-
-static LLOcclusionQueryPool sQueryPool;
+BOOL LLSpatialPartition::sTeleportRequested = FALSE;
//static counter for frame to switch LOD on
@@ -121,190 +78,11 @@ void sg_assert(BOOL expr)
#if LL_OCTREE_PARANOIA_CHECK
if (!expr)
{
- llerrs << "Octree invalid!" << llendl;
+ LL_ERRS() << "Octree invalid!" << LL_ENDL;
}
#endif
}
-S32 AABBSphereIntersect(const LLVector3& min, const LLVector3& max, const LLVector3 &origin, const F32 &rad)
-{
- return AABBSphereIntersectR2(min, max, origin, rad*rad);
-}
-
-S32 AABBSphereIntersectR2(const LLVector3& min, const LLVector3& max, const LLVector3 &origin, const F32 &r)
-{
- F32 d = 0.f;
- F32 t;
-
- if ((min-origin).magVecSquared() < r &&
- (max-origin).magVecSquared() < r)
- {
- return 2;
- }
-
- for (U32 i = 0; i < 3; i++)
- {
- if (origin.mV[i] < min.mV[i])
- {
- t = min.mV[i] - origin.mV[i];
- d += t*t;
- }
- else if (origin.mV[i] > max.mV[i])
- {
- t = origin.mV[i] - max.mV[i];
- d += t*t;
- }
-
- if (d > r)
- {
- return 0;
- }
- }
-
- return 1;
-}
-
-
-S32 AABBSphereIntersect(const LLVector4a& min, const LLVector4a& max, const LLVector3 &origin, const F32 &rad)
-{
- return AABBSphereIntersectR2(min, max, origin, rad*rad);
-}
-
-S32 AABBSphereIntersectR2(const LLVector4a& min, const LLVector4a& max, const LLVector3 &origin, const F32 &r)
-{
- F32 d = 0.f;
- F32 t;
-
- LLVector4a origina;
- origina.load3(origin.mV);
-
- LLVector4a v;
- v.setSub(min, origina);
-
- if (v.dot3(v) < r)
- {
- v.setSub(max, origina);
- if (v.dot3(v) < r)
- {
- return 2;
- }
- }
-
-
- for (U32 i = 0; i < 3; i++)
- {
- if (origin.mV[i] < min[i])
- {
- t = min[i] - origin.mV[i];
- d += t*t;
- }
- else if (origin.mV[i] > max[i])
- {
- t = origin.mV[i] - max[i];
- d += t*t;
- }
-
- if (d > r)
- {
- return 0;
- }
- }
-
- return 1;
-}
-
-
-typedef enum
-{
- b000 = 0x00,
- b001 = 0x01,
- b010 = 0x02,
- b011 = 0x03,
- b100 = 0x04,
- b101 = 0x05,
- b110 = 0x06,
- b111 = 0x07,
-} eLoveTheBits;
-
-//contact Runitai Linden for a copy of the SL object used to write this table
-//basically, you give the table a bitmask of the look-at vector to a node and it
-//gives you a triangle fan index array
-static U16 sOcclusionIndices[] =
-{
- //000
- b111, b110, b010, b011, b001, b101, b100, b110,
- //001
- b011, b010, b000, b001, b101, b111, b110, b010,
- //010
- b101, b100, b110, b111, b011, b001, b000, b100,
- //011
- b001, b000, b100, b101, b111, b011, b010, b000,
- //100
- b110, b000, b010, b011, b111, b101, b100, b000,
- //101
- b010, b100, b000, b001, b011, b111, b110, b100,
- //110
- b100, b010, b110, b111, b101, b001, b000, b010,
- //111
- b000, b110, b100, b101, b001, b011, b010, b110,
-};
-
-U32 get_box_fan_indices(LLCamera* camera, const LLVector4a& center)
-{
- LLVector4a origin;
- origin.load3(camera->getOrigin().mV);
-
- S32 cypher = center.greaterThan(origin).getGatheredBits() & 0x7;
-
- return cypher*8;
-}
-
-U8* get_box_fan_indices_ptr(LLCamera* camera, const LLVector4a& center)
-{
- LLVector4a origin;
- origin.load3(camera->getOrigin().mV);
-
- S32 cypher = center.greaterThan(origin).getGatheredBits() & 0x7;
-
- return (U8*) (sOcclusionIndices+cypher*8);
-}
-
-//create a vertex buffer for efficiently rendering cubes
-LLVertexBuffer* ll_create_cube_vb(U32 type_mask, U32 usage)
-{
- LLVertexBuffer* ret = new LLVertexBuffer(type_mask, usage);
-
- ret->allocateBuffer(8, 64, true);
-
- LLStrider<LLVector3> pos;
- LLStrider<U16> idx;
-
- ret->getVertexStrider(pos);
- ret->getIndexStrider(idx);
-
- pos[0] = LLVector3(-1,-1,-1);
- pos[1] = LLVector3(-1,-1, 1);
- pos[2] = LLVector3(-1, 1,-1);
- pos[3] = LLVector3(-1, 1, 1);
- pos[4] = LLVector3( 1,-1,-1);
- pos[5] = LLVector3( 1,-1, 1);
- pos[6] = LLVector3( 1, 1,-1);
- pos[7] = LLVector3( 1, 1, 1);
-
- for (U32 i = 0; i < 64; i++)
- {
- idx[i] = sOcclusionIndices[i];
- }
-
- ret->flush();
-
- return ret;
-}
-
-static LLFastTimer::DeclareTimer FTM_BUILD_OCCLUSION("Build Occlusion");
-
-BOOL earlyFail(LLCamera* camera, LLSpatialGroup* group);
-
//returns:
// 0 if sphere and AABB are not intersecting
// 1 if they are
@@ -338,7 +116,7 @@ LLSpatialGroup::~LLSpatialGroup()
{
/*if (sNoDelete)
{
- llerrs << "Illegal deletion of LLSpatialGroup!" << llendl;
+ LL_ERRS() << "Illegal deletion of LLSpatialGroup!" << LL_ENDL;
}*/
if (gDebugGL)
@@ -346,24 +124,13 @@ LLSpatialGroup::~LLSpatialGroup()
gPipeline.checkReferences(this);
}
- if (isState(DEAD))
+ if (hasState(DEAD))
{
sZombieGroups--;
}
sNodeCount--;
- if (gGLManager.mHasOcclusionQuery)
- {
- for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; ++i)
- {
- if (mOcclusionQuery[i])
- {
- sQueryPool.release(mOcclusionQuery[i]);
- }
- }
- }
-
clearDrawMap();
clearAtlasList() ;
}
@@ -497,22 +264,7 @@ void LLSpatialGroup::clearDrawMap()
BOOL LLSpatialGroup::isHUDGroup()
{
- return mSpatialPartition && mSpatialPartition->isHUDPartition() ;
-}
-
-BOOL LLSpatialGroup::isRecentlyVisible() const
-{
- return (LLDrawable::getCurrentFrame() - mVisible[LLViewerCamera::sCurCameraID]) < LLDrawable::getMinVisFrameRange() ;
-}
-
-BOOL LLSpatialGroup::isVisible() const
-{
- return mVisible[LLViewerCamera::sCurCameraID] >= LLDrawable::getCurrentFrame() ? TRUE : FALSE;
-}
-
-void LLSpatialGroup::setVisible()
-{
- mVisible[LLViewerCamera::sCurCameraID] = LLDrawable::getCurrentFrame();
+ return getSpatialPartition() && getSpatialPartition()->isHUDPartition() ;
}
void LLSpatialGroup::validate()
@@ -536,7 +288,7 @@ void LLSpatialGroup::validate()
sg_assert(drawable->getSpatialGroup() == this);
if (drawable->getSpatialBridge())
{
- sg_assert(drawable->getSpatialBridge() == mSpatialPartition->asBridge());
+ sg_assert(drawable->getSpatialBridge() == getSpatialPartition()->asBridge());
}
/*if (drawable->isSpatialBridge())
@@ -544,7 +296,7 @@ void LLSpatialGroup::validate()
LLSpatialPartition* part = drawable->asPartition();
if (!part)
{
- llerrs << "Drawable reports it is a spatial bridge but not a partition." << llendl;
+ LL_ERRS() << "Drawable reports it is a spatial bridge but not a partition." << LL_ENDL;
}
LLSpatialGroup* group = (LLSpatialGroup*) part->mOctree->getListener(0);
group->validate();
@@ -576,14 +328,6 @@ void LLSpatialGroup::validate()
#endif
}
-void LLSpatialGroup::checkStates()
-{
-#if LL_OCTREE_PARANOIA_CHECK
- //LLOctreeStateCheck checker;
- //checker.traverse(mOctreeNode);
-#endif
-}
-
void LLSpatialGroup::validateDrawMap()
{
#if LL_OCTREE_PARANOIA_CHECK
@@ -607,7 +351,7 @@ BOOL LLSpatialGroup::updateInGroup(LLDrawable *drawablep, BOOL immediate)
OctreeNode* parent = mOctreeNode->getOctParent();
if (mOctreeNode->isInside(drawablep->getPositionGroup()) &&
- (mOctreeNode->contains(drawablep) ||
+ (mOctreeNode->contains(drawablep->getEntry()) ||
(drawablep->getBinRadius() > mOctreeNode->getSize()[0] &&
parent && parent->getElementCount() >= gOctreeMaxCapacity)))
{
@@ -621,15 +365,14 @@ BOOL LLSpatialGroup::updateInGroup(LLDrawable *drawablep, BOOL immediate)
}
-BOOL LLSpatialGroup::addObject(LLDrawable *drawablep, BOOL add_all, BOOL from_octree)
+BOOL LLSpatialGroup::addObject(LLDrawable *drawablep)
{
- if (!from_octree)
+ if(!drawablep)
{
- mOctreeNode->insert(drawablep);
+ return FALSE;
}
- else
{
- drawablep->setSpatialGroup(this);
+ drawablep->setGroup(this);
setState(OBJECT_DIRTY | GEOM_DIRTY);
setOcclusionState(LLSpatialGroup::DISCARD_QUERY, LLSpatialGroup::STATE_MODE_ALL_CAMERAS);
gPipeline.markRebuild(this, TRUE);
@@ -650,9 +393,9 @@ void LLSpatialGroup::rebuildGeom()
{
if (!isDead())
{
- mSpatialPartition->rebuildGeom(this);
+ getSpatialPartition()->rebuildGeom(this);
- if (isState(LLSpatialGroup::MESH_DIRTY))
+ if (hasState(LLSpatialGroup::MESH_DIRTY))
{
gPipeline.markMeshDirty(this);
}
@@ -663,18 +406,18 @@ void LLSpatialGroup::rebuildMesh()
{
if (!isDead())
{
- mSpatialPartition->rebuildMesh(this);
+ getSpatialPartition()->rebuildMesh(this);
}
}
-static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt");
-static LLFastTimer::DeclareTimer FTM_ADD_GEOMETRY_COUNT("Add Geometry");
-static LLFastTimer::DeclareTimer FTM_CREATE_VB("Create VB");
-static LLFastTimer::DeclareTimer FTM_GET_GEOMETRY("Get Geometry");
+static LLTrace::BlockTimerStatHandle FTM_REBUILD_VBO("VBO Rebuilt");
+static LLTrace::BlockTimerStatHandle FTM_ADD_GEOMETRY_COUNT("Add Geometry");
+static LLTrace::BlockTimerStatHandle FTM_CREATE_VB("Create VB");
+static LLTrace::BlockTimerStatHandle FTM_GET_GEOMETRY("Get Geometry");
void LLSpatialPartition::rebuildGeom(LLSpatialGroup* group)
{
- if (group->isDead() || !group->isState(LLSpatialGroup::GEOM_DIRTY))
+ if (group->isDead() || !group->hasState(LLSpatialGroup::GEOM_DIRTY))
{
return;
}
@@ -685,7 +428,7 @@ void LLSpatialPartition::rebuildGeom(LLSpatialGroup* group)
group->mLastUpdateViewAngle = group->mViewAngle;
}
- LLFastTimer ftm(FTM_REBUILD_VBO);
+ LL_RECORD_BLOCK_TIME(FTM_REBUILD_VBO);
group->clearDrawMap();
@@ -694,14 +437,14 @@ void LLSpatialPartition::rebuildGeom(LLSpatialGroup* group)
U32 vertex_count = 0;
{
- LLFastTimer t(FTM_ADD_GEOMETRY_COUNT);
+ LL_RECORD_BLOCK_TIME(FTM_ADD_GEOMETRY_COUNT);
addGeometryCount(group, vertex_count, index_count);
}
if (vertex_count > 0 && index_count > 0)
{ //create vertex buffer containing volume geometry for this node
{
- LLFastTimer t(FTM_CREATE_VB);
+ LL_RECORD_BLOCK_TIME(FTM_CREATE_VB);
group->mBuilt = 1.f;
if (group->mVertexBuffer.isNull() ||
!group->mVertexBuffer->isWriteable() ||
@@ -719,7 +462,7 @@ void LLSpatialPartition::rebuildGeom(LLSpatialGroup* group)
}
{
- LLFastTimer t(FTM_GET_GEOMETRY);
+ LL_RECORD_BLOCK_TIME(FTM_GET_GEOMETRY);
getGeometry(group);
}
}
@@ -739,137 +482,26 @@ void LLSpatialPartition::rebuildMesh(LLSpatialGroup* group)
}
-BOOL LLSpatialGroup::boundObjects(BOOL empty, LLVector4a& minOut, LLVector4a& maxOut)
-{
- const OctreeNode* node = mOctreeNode;
-
- if (node->isEmpty())
- { //don't do anything if there are no objects
- if (empty && mOctreeNode->getParent())
- { //only root is allowed to be empty
- OCT_ERRS << "Empty leaf found in octree." << llendl;
- }
- return FALSE;
- }
-
- LLVector4a& newMin = mObjectExtents[0];
- LLVector4a& newMax = mObjectExtents[1];
-
- if (isState(OBJECT_DIRTY))
- { //calculate new bounding box
- clearState(OBJECT_DIRTY);
-
- //initialize bounding box to first element
- OctreeNode::const_element_iter i = node->getDataBegin();
- LLDrawable* drawablep = *i;
- const LLVector4a* minMax = drawablep->getSpatialExtents();
-
- newMin = minMax[0];
- newMax = minMax[1];
-
- for (++i; i != node->getDataEnd(); ++i)
- {
- drawablep = *i;
- minMax = drawablep->getSpatialExtents();
-
- update_min_max(newMin, newMax, minMax[0]);
- update_min_max(newMin, newMax, minMax[1]);
-
- //bin up the object
- /*for (U32 i = 0; i < 3; i++)
- {
- if (minMax[0].mV[i] < newMin.mV[i])
- {
- newMin.mV[i] = minMax[0].mV[i];
- }
- if (minMax[1].mV[i] > newMax.mV[i])
- {
- newMax.mV[i] = minMax[1].mV[i];
- }
- }*/
- }
-
- mObjectBounds[0].setAdd(newMin, newMax);
- mObjectBounds[0].mul(0.5f);
- mObjectBounds[1].setSub(newMax, newMin);
- mObjectBounds[1].mul(0.5f);
- }
-
- if (empty)
- {
- minOut = newMin;
- maxOut = newMax;
- }
- else
- {
- minOut.setMin(minOut, newMin);
- maxOut.setMax(maxOut, newMax);
- }
-
- return TRUE;
-}
-
-void LLSpatialGroup::unbound()
-{
- if (isState(DIRTY))
- {
- return;
- }
-
- setState(DIRTY);
-
- //all the parent nodes need to rebound this child
- if (mOctreeNode)
- {
- OctreeNode* parent = (OctreeNode*) mOctreeNode->getParent();
- while (parent != NULL)
- {
- LLSpatialGroup* group = (LLSpatialGroup*) parent->getListener(0);
- if (group->isState(DIRTY))
- {
- return;
- }
-
- group->setState(DIRTY);
- parent = (OctreeNode*) parent->getParent();
- }
- }
-}
-
LLSpatialGroup* LLSpatialGroup::getParent()
{
- if (isDead())
- {
- return NULL;
+ return (LLSpatialGroup*)LLViewerOctreeGroup::getParent();
}
- if(!mOctreeNode)
+BOOL LLSpatialGroup::removeObject(LLDrawable *drawablep, BOOL from_octree)
{
- return NULL;
- }
- OctreeNode* parent = mOctreeNode->getOctParent();
-
- if (parent)
+ if(!drawablep)
{
- return (LLSpatialGroup*) parent->getListener(0);
+ return FALSE;
}
- return NULL;
-}
-
-BOOL LLSpatialGroup::removeObject(LLDrawable *drawablep, BOOL from_octree)
-{
unbound();
if (mOctreeNode && !from_octree)
{
- if (!mOctreeNode->remove(drawablep))
- {
- OCT_ERRS << "Could not remove drawable from spatial group" << llendl;
- }
+ drawablep->setGroup(NULL);
}
else
{
- drawablep->setSpatialGroup(NULL);
+ drawablep->setGroup(NULL);
setState(GEOM_DIRTY);
gPipeline.markRebuild(this, TRUE);
@@ -906,22 +538,22 @@ void LLSpatialGroup::shift(const LLVector4a &offset)
mObjectExtents[0].add(offset);
mObjectExtents[1].add(offset);
- if (!mSpatialPartition->mRenderByGroup &&
- mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_TREE &&
- mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_TERRAIN &&
- mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_BRIDGE)
+ if (!getSpatialPartition()->mRenderByGroup &&
+ getSpatialPartition()->mPartitionType != LLViewerRegion::PARTITION_TREE &&
+ getSpatialPartition()->mPartitionType != LLViewerRegion::PARTITION_TERRAIN &&
+ getSpatialPartition()->mPartitionType != LLViewerRegion::PARTITION_BRIDGE)
{
setState(GEOM_DIRTY);
gPipeline.markRebuild(this, TRUE);
}
}
-class LLSpatialSetState : public LLSpatialGroup::OctreeTraveler
+class LLSpatialSetState : public OctreeTraveler
{
public:
U32 mState;
LLSpatialSetState(U32 state) : mState(state) { }
- virtual void visit(const LLSpatialGroup::OctreeNode* branch) { ((LLSpatialGroup*) branch->getListener(0))->setState(mState); }
+ virtual void visit(const OctreeNode* branch) { ((LLSpatialGroup*) branch->getListener(0))->setState(mState); }
};
class LLSpatialSetStateDiff : public LLSpatialSetState
@@ -929,24 +561,17 @@ class LLSpatialSetStateDiff : public LLSpatialSetState
public:
LLSpatialSetStateDiff(U32 state) : LLSpatialSetState(state) { }
- virtual void traverse(const LLSpatialGroup::OctreeNode* n)
+ virtual void traverse(const OctreeNode* n)
{
LLSpatialGroup* group = (LLSpatialGroup*) n->getListener(0);
- if (!group->isState(mState))
+ if (!group->hasState(mState))
{
- LLSpatialGroup::OctreeTraveler::traverse(n);
+ OctreeTraveler::traverse(n);
}
}
};
-void LLSpatialGroup::setState(U32 state)
-{
- mState |= state;
-
- llassert(state <= LLSpatialGroup::STATE_MASK);
-}
-
void LLSpatialGroup::setState(U32 state, S32 mode)
{
llassert(state <= LLSpatialGroup::STATE_MASK);
@@ -970,12 +595,12 @@ void LLSpatialGroup::setState(U32 state, S32 mode)
}
}
-class LLSpatialClearState : public LLSpatialGroup::OctreeTraveler
+class LLSpatialClearState : public OctreeTraveler
{
public:
U32 mState;
LLSpatialClearState(U32 state) : mState(state) { }
- virtual void visit(const LLSpatialGroup::OctreeNode* branch) { ((LLSpatialGroup*) branch->getListener(0))->clearState(mState); }
+ virtual void visit(const OctreeNode* branch) { ((LLSpatialGroup*) branch->getListener(0))->clearState(mState); }
};
class LLSpatialClearStateDiff : public LLSpatialClearState
@@ -983,24 +608,17 @@ class LLSpatialClearStateDiff : public LLSpatialClearState
public:
LLSpatialClearStateDiff(U32 state) : LLSpatialClearState(state) { }
- virtual void traverse(const LLSpatialGroup::OctreeNode* n)
+ virtual void traverse(const OctreeNode* n)
{
LLSpatialGroup* group = (LLSpatialGroup*) n->getListener(0);
- if (group->isState(mState))
+ if (group->hasState(mState))
{
- LLSpatialGroup::OctreeTraveler::traverse(n);
+ OctreeTraveler::traverse(n);
}
}
};
-void LLSpatialGroup::clearState(U32 state)
-{
- llassert(state <= LLSpatialGroup::STATE_MASK);
-
- mState &= ~state;
-}
-
void LLSpatialGroup::clearState(U32 state, S32 mode)
{
llassert(state <= LLSpatialGroup::STATE_MASK);
@@ -1024,144 +642,15 @@ void LLSpatialGroup::clearState(U32 state, S32 mode)
}
}
-BOOL LLSpatialGroup::isState(U32 state) const
-{
- llassert(state <= LLSpatialGroup::STATE_MASK);
-
- return mState & state ? TRUE : FALSE;
-}
-
-//=====================================
-// Occlusion State Set/Clear
-//=====================================
-class LLSpatialSetOcclusionState : public LLSpatialGroup::OctreeTraveler
-{
-public:
- U32 mState;
- LLSpatialSetOcclusionState(U32 state) : mState(state) { }
- virtual void visit(const LLSpatialGroup::OctreeNode* branch) { ((LLSpatialGroup*) branch->getListener(0))->setOcclusionState(mState); }
-};
-
-class LLSpatialSetOcclusionStateDiff : public LLSpatialSetOcclusionState
-{
-public:
- LLSpatialSetOcclusionStateDiff(U32 state) : LLSpatialSetOcclusionState(state) { }
-
- virtual void traverse(const LLSpatialGroup::OctreeNode* n)
- {
- LLSpatialGroup* group = (LLSpatialGroup*) n->getListener(0);
-
- if (!group->isOcclusionState(mState))
- {
- LLSpatialGroup::OctreeTraveler::traverse(n);
- }
- }
-};
-
-
-void LLSpatialGroup::setOcclusionState(U32 state, S32 mode)
-{
- if (mode > STATE_MODE_SINGLE)
- {
- if (mode == STATE_MODE_DIFF)
- {
- LLSpatialSetOcclusionStateDiff setter(state);
- setter.traverse(mOctreeNode);
- }
- else if (mode == STATE_MODE_BRANCH)
- {
- LLSpatialSetOcclusionState setter(state);
- setter.traverse(mOctreeNode);
- }
- else
- {
- for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++)
- {
- mOcclusionState[i] |= state;
-
- if ((state & DISCARD_QUERY) && mOcclusionQuery[i])
- {
- sQueryPool.release(mOcclusionQuery[i]);
- mOcclusionQuery[i] = 0;
- }
- }
- }
- }
- else
- {
- mOcclusionState[LLViewerCamera::sCurCameraID] |= state;
- if ((state & DISCARD_QUERY) && mOcclusionQuery[LLViewerCamera::sCurCameraID])
- {
- sQueryPool.release(mOcclusionQuery[LLViewerCamera::sCurCameraID]);
- mOcclusionQuery[LLViewerCamera::sCurCameraID] = 0;
- }
- }
-}
-
-class LLSpatialClearOcclusionState : public LLSpatialGroup::OctreeTraveler
-{
-public:
- U32 mState;
-
- LLSpatialClearOcclusionState(U32 state) : mState(state) { }
- virtual void visit(const LLSpatialGroup::OctreeNode* branch) { ((LLSpatialGroup*) branch->getListener(0))->clearOcclusionState(mState); }
-};
-
-class LLSpatialClearOcclusionStateDiff : public LLSpatialClearOcclusionState
-{
-public:
- LLSpatialClearOcclusionStateDiff(U32 state) : LLSpatialClearOcclusionState(state) { }
-
- virtual void traverse(const LLSpatialGroup::OctreeNode* n)
- {
- LLSpatialGroup* group = (LLSpatialGroup*) n->getListener(0);
-
- if (group->isOcclusionState(mState))
- {
- LLSpatialGroup::OctreeTraveler::traverse(n);
- }
- }
-};
-
-void LLSpatialGroup::clearOcclusionState(U32 state, S32 mode)
-{
- if (mode > STATE_MODE_SINGLE)
- {
- if (mode == STATE_MODE_DIFF)
- {
- LLSpatialClearOcclusionStateDiff clearer(state);
- clearer.traverse(mOctreeNode);
- }
- else if (mode == STATE_MODE_BRANCH)
- {
- LLSpatialClearOcclusionState clearer(state);
- clearer.traverse(mOctreeNode);
- }
- else
- {
- for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++)
- {
- mOcclusionState[i] &= ~state;
- }
- }
- }
- else
- {
- mOcclusionState[LLViewerCamera::sCurCameraID] &= ~state;
- }
-}
//======================================
// Octree Listener Implementation
//======================================
-LLSpatialGroup::LLSpatialGroup(OctreeNode* node, LLSpatialPartition* part) :
+LLSpatialGroup::LLSpatialGroup(OctreeNode* node, LLSpatialPartition* part) : LLOcclusionCullingGroup(node, part),
mObjectBoxSize(1.f),
- mState(0),
mGeometryBytes(0),
mSurfaceArea(0.f),
mBuilt(0.f),
- mOctreeNode(node),
- mSpatialPartition(part),
mVertexBuffer(NULL),
mBufferUsage(part->mBufferUsage),
mDistance(0.f),
@@ -1179,32 +668,11 @@ LLSpatialGroup::LLSpatialGroup(OctreeNode* node, LLSpatialPartition* part) :
mViewAngle.splat(0.f);
mLastUpdateViewAngle.splat(-1.f);
- mExtents[0] = mExtents[1] = mObjectBounds[0] = mObjectBounds[0] = mObjectBounds[1] =
- mObjectExtents[0] = mObjectExtents[1] = mViewAngle;
sg_assert(mOctreeNode->getListenerCount() == 0);
- mOctreeNode->addListener(this);
setState(SG_INITIAL_STATE_MASK);
gPipeline.markRebuild(this, TRUE);
- mBounds[0] = node->getCenter();
- mBounds[1] = node->getSize();
-
- part->mLODSeed = (part->mLODSeed+1)%part->mLODPeriod;
- mLODHash = part->mLODSeed;
-
- OctreeNode* oct_parent = node->getOctParent();
-
- LLSpatialGroup* parent = oct_parent ? (LLSpatialGroup*) oct_parent->getListener(0) : NULL;
-
- for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++)
- {
- mOcclusionQuery[i] = 0;
- mOcclusionIssued[i] = 0;
- mOcclusionState[i] = parent ? SG_STATE_INHERIT_MASK & parent->mOcclusionState[i] : 0;
- mVisible[i] = 0;
- }
-
mRadius = 1;
mPixelArea = 1024.f;
}
@@ -1213,7 +681,7 @@ void LLSpatialGroup::updateDistance(LLCamera &camera)
{
if (LLViewerCamera::sCurCameraID != LLViewerCamera::CAMERA_WORLD)
{
- llwarns << "Attempted to update distance for camera other than world camera!" << llendl;
+ LL_WARNS() << "Attempted to update distance for camera other than world camera!" << LL_ENDL;
return;
}
@@ -1223,17 +691,17 @@ void LLSpatialGroup::updateDistance(LLCamera &camera)
}
#if !LL_RELEASE_FOR_DOWNLOAD
- if (isState(LLSpatialGroup::OBJECT_DIRTY))
+ if (hasState(LLSpatialGroup::OBJECT_DIRTY))
{
- llerrs << "Spatial group dirty on distance update." << llendl;
+ LL_ERRS() << "Spatial group dirty on distance update." << LL_ENDL;
}
#endif
if (!isEmpty())
{
- mRadius = mSpatialPartition->mRenderByGroup ? mObjectBounds[1].getLength3().getF32() :
+ mRadius = getSpatialPartition()->mRenderByGroup ? mObjectBounds[1].getLength3().getF32() :
(F32) mOctreeNode->getSize().getLength3().getF32();
- mDistance = mSpatialPartition->calcDistance(this, camera);
- mPixelArea = mSpatialPartition->calcPixelArea(this, camera);
+ mDistance = getSpatialPartition()->calcDistance(this, camera);
+ mPixelArea = getSpatialPartition()->calcPixelArea(this, camera);
}
}
@@ -1254,9 +722,9 @@ F32 LLSpatialPartition::calcDistance(LLSpatialGroup* group, LLCamera& camera)
dist = eye.getLength3().getF32();
eye.normalize3fast();
- if (!group->isState(LLSpatialGroup::ALPHA_DIRTY))
+ if (!group->hasState(LLSpatialGroup::ALPHA_DIRTY))
{
- if (!group->mSpatialPartition->isBridge())
+ if (!group->getSpatialPartition()->isBridge())
{
LLVector4a view_angle = eye;
@@ -1324,23 +792,18 @@ F32 LLSpatialGroup::getUpdateUrgency() const
}
}
-BOOL LLSpatialGroup::needsUpdate()
-{
- return (LLDrawable::getCurrentFrame()%mSpatialPartition->mLODPeriod == mLODHash) ? TRUE : FALSE;
-}
-
BOOL LLSpatialGroup::changeLOD()
{
- if (isState(ALPHA_DIRTY | OBJECT_DIRTY))
+ if (hasState(ALPHA_DIRTY | OBJECT_DIRTY))
{ ///a rebuild is going to happen, update distance and LoD
return TRUE;
}
- if (mSpatialPartition->mSlopRatio > 0.f)
+ if (getSpatialPartition()->mSlopRatio > 0.f)
{
F32 ratio = (mDistance - mLastUpdateDistance)/(llmax(mLastUpdateDistance, mRadius));
- if (fabsf(ratio) >= mSpatialPartition->mSlopRatio)
+ if (fabsf(ratio) >= getSpatialPartition()->mSlopRatio)
{
return TRUE;
}
@@ -1359,34 +822,42 @@ BOOL LLSpatialGroup::changeLOD()
return FALSE;
}
-void LLSpatialGroup::handleInsertion(const TreeNode* node, LLDrawable* drawablep)
+void LLSpatialGroup::handleInsertion(const TreeNode* node, LLViewerOctreeEntry* entry)
{
- addObject(drawablep, FALSE, TRUE);
+ addObject((LLDrawable*)entry->getDrawable());
unbound();
setState(OBJECT_DIRTY);
}
-void LLSpatialGroup::handleRemoval(const TreeNode* node, LLDrawable* drawable)
+void LLSpatialGroup::handleRemoval(const TreeNode* node, LLViewerOctreeEntry* entry)
{
- removeObject(drawable, TRUE);
- setState(OBJECT_DIRTY);
+ removeObject((LLDrawable*)entry->getDrawable(), TRUE);
+ LLViewerOctreeGroup::handleRemoval(node, entry);
}
void LLSpatialGroup::handleDestruction(const TreeNode* node)
{
- setState(DEAD);
-
+ if(isDead())
+ {
+ return;
+ }
+ setState(DEAD);
+
for (element_iter i = getDataBegin(); i != getDataEnd(); ++i)
{
- LLDrawable* drawable = *i;
- if (drawable->getSpatialGroup() == this)
+ LLViewerOctreeEntry* entry = *i;
+
+ if (entry->getGroup() == this)
{
- drawable->setSpatialGroup(NULL);
+ if(entry->hasDrawable())
+ {
+ ((LLDrawable*)entry->getDrawable())->setGroup(NULL);
+ }
}
}
//clean up avatar attachment stats
- LLSpatialBridge* bridge = mSpatialPartition->asBridge();
+ LLSpatialBridge* bridge = getSpatialPartition()->asBridge();
if (bridge)
{
if (bridge->mAvatar.notNull())
@@ -1405,25 +876,15 @@ void LLSpatialGroup::handleDestruction(const TreeNode* node)
mOctreeNode = NULL;
}
-void LLSpatialGroup::handleStateChange(const TreeNode* node)
-{
- //drop bounding box upon state change
- if (mOctreeNode != node)
- {
- mOctreeNode = (OctreeNode*) node;
- }
- unbound();
-}
-
void LLSpatialGroup::handleChildAddition(const OctreeNode* parent, OctreeNode* child)
{
if (child->getListenerCount() == 0)
{
- new LLSpatialGroup(child, mSpatialPartition);
+ new LLSpatialGroup(child, getSpatialPartition());
}
else
{
- OCT_ERRS << "LLSpatialGroup redundancy detected." << llendl;
+ OCT_ERRS << "LLSpatialGroup redundancy detected." << LL_ENDL;
}
unbound();
@@ -1431,11 +892,6 @@ void LLSpatialGroup::handleChildAddition(const OctreeNode* parent, OctreeNode* c
assert_states_valid(this);
}
-void LLSpatialGroup::handleChildRemoval(const OctreeNode* parent, const OctreeNode* child)
-{
- unbound();
-}
-
void LLSpatialGroup::destroyGL(bool keep_occlusion)
{
setState(LLSpatialGroup::GEOM_DIRTY | LLSpatialGroup::IMAGE_DIRTY);
@@ -1453,20 +909,17 @@ void LLSpatialGroup::destroyGL(bool keep_occlusion)
if (!keep_occlusion)
{
- for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++)
- {
- if (mOcclusionQuery[i])
- {
- sQueryPool.release(mOcclusionQuery[i]);
- mOcclusionQuery[i] = 0;
- }
- }
+ releaseOcclusionQueryObjectNames();
}
for (LLSpatialGroup::element_iter i = getDataBegin(); i != getDataEnd(); ++i)
{
- LLDrawable* drawable = *i;
+ LLDrawable* drawable = (LLDrawable*)(*i)->getDrawable();
+ if(!drawable)
+ {
+ continue;
+ }
for (S32 j = 0; j < drawable->getNumFaces(); j++)
{
LLFace* facep = drawable->getFace(j);
@@ -1478,324 +931,27 @@ void LLSpatialGroup::destroyGL(bool keep_occlusion)
}
}
-BOOL LLSpatialGroup::rebound()
-{
- if (!isState(DIRTY))
- { //return TRUE if we're not empty
- return TRUE;
- }
-
- if (mOctreeNode->getChildCount() == 1 && mOctreeNode->getElementCount() == 0)
- {
- LLSpatialGroup* group = (LLSpatialGroup*) mOctreeNode->getChild(0)->getListener(0);
-
- //rebound single child
- group->rebound();
-
- //copy single child's bounding box
- mBounds[0] = group->mBounds[0];
- mBounds[1] = group->mBounds[1];
- mExtents[0] = group->mExtents[0];
- mExtents[1] = group->mExtents[1];
-
- //treat this node as a "chute" to a deeper level of the tree
- group->setState(SKIP_FRUSTUM_CHECK);
- }
- else if (mOctreeNode->isLeaf())
- { //copy object bounding box if this is a leaf
- boundObjects(TRUE, mExtents[0], mExtents[1]);
- mBounds[0] = mObjectBounds[0];
- mBounds[1] = mObjectBounds[1];
- }
- else
- {
- LLVector4a& newMin = mExtents[0];
- LLVector4a& newMax = mExtents[1];
-
- //get bounding box of first child
- LLSpatialGroup* group = (LLSpatialGroup*) mOctreeNode->getChild(0)->getListener(0);
- group->clearState(SKIP_FRUSTUM_CHECK);
- group->rebound();
-
- //initialize to first child
- newMin = group->mExtents[0];
- newMax = group->mExtents[1];
-
- //rebound remaining children, expanding bounding box to encompass children
- for (U32 i = 1; i < mOctreeNode->getChildCount(); i++)
- {
- group = (LLSpatialGroup*) mOctreeNode->getChild(i)->getListener(0);
- group->clearState(SKIP_FRUSTUM_CHECK);
- group->rebound();
- const LLVector4a& max = group->mExtents[1];
- const LLVector4a& min = group->mExtents[0];
-
- newMax.setMax(newMax, max);
- newMin.setMin(newMin, min);
- }
-
- boundObjects(FALSE, newMin, newMax);
-
- mBounds[0].setAdd(newMin, newMax);
- mBounds[0].mul(0.5f);
- mBounds[1].setSub(newMax, newMin);
- mBounds[1].mul(0.5f);
- }
-
- clearState(DIRTY);
-
- return TRUE;
-}
-
-static LLFastTimer::DeclareTimer FTM_OCCLUSION_READBACK("Readback Occlusion");
-static LLFastTimer::DeclareTimer FTM_OCCLUSION_WAIT("Occlusion Wait");
-
-void LLSpatialGroup::checkOcclusion()
-{
- if (LLPipeline::sUseOcclusion > 1)
- {
- LLFastTimer t(FTM_OCCLUSION_READBACK);
- LLSpatialGroup* parent = getParent();
- if (parent && parent->isOcclusionState(LLSpatialGroup::OCCLUDED))
- { //if the parent has been marked as occluded, the child is implicitly occluded
- clearOcclusionState(QUERY_PENDING | DISCARD_QUERY);
- }
- else if (isOcclusionState(QUERY_PENDING))
- { //otherwise, if a query is pending, read it back
-
- GLuint available = 0;
- if (mOcclusionQuery[LLViewerCamera::sCurCameraID])
- {
- glGetQueryObjectuivARB(mOcclusionQuery[LLViewerCamera::sCurCameraID], GL_QUERY_RESULT_AVAILABLE_ARB, &available);
-
- static LLCachedControl<bool> wait_for_query(gSavedSettings, "RenderSynchronousOcclusion", true);
-
- if (wait_for_query && mOcclusionIssued[LLViewerCamera::sCurCameraID] < gFrameCount)
- { //query was issued last frame, wait until it's available
- S32 max_loop = 1024;
- LLFastTimer t(FTM_OCCLUSION_WAIT);
- while (!available && max_loop-- > 0)
- {
- F32 max_time = llmin(gFrameIntervalSeconds*10.f, 1.f);
- //do some usefu work while we wait
- LLAppViewer::getTextureCache()->update(max_time); // unpauses the texture cache thread
- LLAppViewer::getImageDecodeThread()->update(max_time); // unpauses the image thread
- LLAppViewer::getTextureFetch()->update(max_time); // unpauses the texture fetch thread
-
- glGetQueryObjectuivARB(mOcclusionQuery[LLViewerCamera::sCurCameraID], GL_QUERY_RESULT_AVAILABLE_ARB, &available);
- }
- }
- }
- else
- {
- available = 1;
- }
-
- if (available)
- { //result is available, read it back, otherwise wait until next frame
- GLuint res = 1;
- if (!isOcclusionState(DISCARD_QUERY) && mOcclusionQuery[LLViewerCamera::sCurCameraID])
- {
- glGetQueryObjectuivARB(mOcclusionQuery[LLViewerCamera::sCurCameraID], GL_QUERY_RESULT_ARB, &res);
-#if LL_TRACK_PENDING_OCCLUSION_QUERIES
- sPendingQueries.erase(mOcclusionQuery[LLViewerCamera::sCurCameraID]);
-#endif
- }
- else if (mOcclusionQuery[LLViewerCamera::sCurCameraID])
- { //delete the query to avoid holding onto hundreds of pending queries
- sQueryPool.release(mOcclusionQuery[LLViewerCamera::sCurCameraID]);
- mOcclusionQuery[LLViewerCamera::sCurCameraID] = 0;
- }
-
- if (isOcclusionState(DISCARD_QUERY))
- {
- res = 2;
- }
-
- if (res > 0)
- {
- assert_states_valid(this);
- clearOcclusionState(LLSpatialGroup::OCCLUDED, LLSpatialGroup::STATE_MODE_DIFF);
- assert_states_valid(this);
- }
- else
- {
- assert_states_valid(this);
-
- setOcclusionState(LLSpatialGroup::OCCLUDED, LLSpatialGroup::STATE_MODE_DIFF);
-
- assert_states_valid(this);
- }
-
- clearOcclusionState(QUERY_PENDING | DISCARD_QUERY);
- }
- }
- else if (mSpatialPartition->isOcclusionEnabled() && isOcclusionState(LLSpatialGroup::OCCLUDED))
- { //check occlusion has been issued for occluded node that has not had a query issued
- assert_states_valid(this);
- clearOcclusionState(LLSpatialGroup::OCCLUDED, LLSpatialGroup::STATE_MODE_DIFF);
- assert_states_valid(this);
- }
- }
-}
-
-static LLFastTimer::DeclareTimer FTM_PUSH_OCCLUSION_VERTS("Push Occlusion");
-static LLFastTimer::DeclareTimer FTM_SET_OCCLUSION_STATE("Occlusion State");
-static LLFastTimer::DeclareTimer FTM_OCCLUSION_EARLY_FAIL("Occlusion Early Fail");
-static LLFastTimer::DeclareTimer FTM_OCCLUSION_ALLOCATE("Allocate");
-static LLFastTimer::DeclareTimer FTM_OCCLUSION_BUILD("Build");
-static LLFastTimer::DeclareTimer FTM_OCCLUSION_BEGIN_QUERY("Begin Query");
-static LLFastTimer::DeclareTimer FTM_OCCLUSION_END_QUERY("End Query");
-static LLFastTimer::DeclareTimer FTM_OCCLUSION_SET_BUFFER("Set Buffer");
-static LLFastTimer::DeclareTimer FTM_OCCLUSION_DRAW_WATER("Draw Water");
-static LLFastTimer::DeclareTimer FTM_OCCLUSION_DRAW("Draw");
-
-
-
-void LLSpatialGroup::doOcclusion(LLCamera* camera)
-{
- if (mSpatialPartition->isOcclusionEnabled() && LLPipeline::sUseOcclusion > 1)
- {
- // Don't cull hole/edge water, unless we have the GL_ARB_depth_clamp extension
- if (earlyFail(camera, this))
- {
- LLFastTimer t(FTM_OCCLUSION_EARLY_FAIL);
- setOcclusionState(LLSpatialGroup::DISCARD_QUERY);
- assert_states_valid(this);
- clearOcclusionState(LLSpatialGroup::OCCLUDED, LLSpatialGroup::STATE_MODE_DIFF);
- assert_states_valid(this);
- }
- else
- {
- if (!isOcclusionState(QUERY_PENDING) || isOcclusionState(DISCARD_QUERY))
- {
- { //no query pending, or previous query to be discarded
- LLFastTimer t(FTM_RENDER_OCCLUSION);
-
- if (!mOcclusionQuery[LLViewerCamera::sCurCameraID])
- {
- LLFastTimer t(FTM_OCCLUSION_ALLOCATE);
- mOcclusionQuery[LLViewerCamera::sCurCameraID] = sQueryPool.allocate();
- }
-
- // Depth clamp all water to avoid it being culled as a result of being
- // behind the far clip plane, and in the case of edge water to avoid
- // it being culled while still visible.
- bool const use_depth_clamp = gGLManager.mHasDepthClamp &&
- (mSpatialPartition->mDrawableType == LLDrawPool::POOL_WATER ||
- mSpatialPartition->mDrawableType == LLDrawPool::POOL_VOIDWATER);
-
- LLGLEnable clamp(use_depth_clamp ? GL_DEPTH_CLAMP : 0);
-
-#if !LL_DARWIN
- U32 mode = gGLManager.mHasOcclusionQuery2 ? GL_ANY_SAMPLES_PASSED : GL_SAMPLES_PASSED_ARB;
-#else
- U32 mode = GL_SAMPLES_PASSED_ARB;
-#endif
-
-#if LL_TRACK_PENDING_OCCLUSION_QUERIES
- sPendingQueries.insert(mOcclusionQuery[LLViewerCamera::sCurCameraID]);
-#endif
-
- {
- LLFastTimer t(FTM_PUSH_OCCLUSION_VERTS);
-
- //store which frame this query was issued on
- mOcclusionIssued[LLViewerCamera::sCurCameraID] = gFrameCount;
-
- {
- LLFastTimer t(FTM_OCCLUSION_BEGIN_QUERY);
- glBeginQueryARB(mode, mOcclusionQuery[LLViewerCamera::sCurCameraID]);
- }
-
- LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
- llassert(shader);
-
- shader->uniform3fv(LLShaderMgr::BOX_CENTER, 1, mBounds[0].getF32ptr());
- shader->uniform3f(LLShaderMgr::BOX_SIZE, mBounds[1][0]+SG_OCCLUSION_FUDGE,
- mBounds[1][1]+SG_OCCLUSION_FUDGE,
- mBounds[1][2]+SG_OCCLUSION_FUDGE);
-
- if (!use_depth_clamp && mSpatialPartition->mDrawableType == LLDrawPool::POOL_VOIDWATER)
- {
- LLFastTimer t(FTM_OCCLUSION_DRAW_WATER);
-
- LLGLSquashToFarClip squash(glh_get_current_projection(), 1);
- if (camera->getOrigin().isExactlyZero())
- { //origin is invalid, draw entire box
- gPipeline.mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, 0);
- gPipeline.mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, b111*8);
- }
- else
- {
- gPipeline.mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, mBounds[0]));
- }
- }
- else
- {
- LLFastTimer t(FTM_OCCLUSION_DRAW);
- if (camera->getOrigin().isExactlyZero())
- { //origin is invalid, draw entire box
- gPipeline.mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, 0);
- gPipeline.mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, b111*8);
- }
- else
- {
- gPipeline.mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, mBounds[0]));
- }
- }
-
-
- {
- LLFastTimer t(FTM_OCCLUSION_END_QUERY);
- glEndQueryARB(mode);
- }
- }
- }
-
- {
- LLFastTimer t(FTM_SET_OCCLUSION_STATE);
- setOcclusionState(LLSpatialGroup::QUERY_PENDING);
- clearOcclusionState(LLSpatialGroup::DISCARD_QUERY);
- }
- }
- }
- }
-}
-
//==============================================
-LLSpatialPartition::LLSpatialPartition(U32 data_mask, BOOL render_by_group, U32 buffer_usage)
+LLSpatialPartition::LLSpatialPartition(U32 data_mask, BOOL render_by_group, U32 buffer_usage, LLViewerRegion* regionp)
: mRenderByGroup(render_by_group), mBridge(NULL)
{
- mOcclusionEnabled = TRUE;
- mDrawableType = 0;
+ mRegionp = regionp;
mPartitionType = LLViewerRegion::PARTITION_NONE;
- mLODSeed = 0;
- mLODPeriod = 1;
mVertexDataMask = data_mask;
mBufferUsage = buffer_usage;
mDepthMask = FALSE;
mSlopRatio = 0.25f;
mInfiniteFarClip = FALSE;
- LLVector4a center, size;
- center.splat(0.f);
- size.splat(1.f);
-
- mOctree = new LLSpatialGroup::OctreeRoot(center,size,
- NULL);
new LLSpatialGroup(mOctree, this);
}
LLSpatialPartition::~LLSpatialPartition()
{
- delete mOctree;
- mOctree = NULL;
}
-
LLSpatialGroup *LLSpatialPartition::put(LLDrawable *drawablep, BOOL was_visible)
{
drawablep->updateSpatialExtents();
@@ -1803,11 +959,15 @@ LLSpatialGroup *LLSpatialPartition::put(LLDrawable *drawablep, BOOL was_visible)
//keep drawable from being garbage collected
LLPointer<LLDrawable> ptr = drawablep;
+ if(!drawablep->getGroup())
+ {
assert_octree_valid(mOctree);
- mOctree->insert(drawablep);
+ mOctree->insert(drawablep->getEntry());
assert_octree_valid(mOctree);
+ }
LLSpatialGroup* group = drawablep->getSpatialGroup();
+ llassert(group != NULL);
if (group && was_visible && group->isOcclusionState(LLSpatialGroup::QUERY_PENDING))
{
@@ -1821,15 +981,13 @@ BOOL LLSpatialPartition::remove(LLDrawable *drawablep, LLSpatialGroup *curp)
{
if (!curp->removeObject(drawablep))
{
- OCT_ERRS << "Failed to remove drawable from octree!" << llendl;
+ OCT_ERRS << "Failed to remove drawable from octree!" << LL_ENDL;
}
else
{
- drawablep->setSpatialGroup(NULL);
+ drawablep->setGroup(NULL);
}
- drawablep->setSpatialGroup(NULL);
-
assert_octree_valid(mOctree);
return TRUE;
@@ -1841,24 +999,24 @@ void LLSpatialPartition::move(LLDrawable *drawablep, LLSpatialGroup *curp, BOOL
// who was seeing crashing here. (See VWR-424 reported by Bunny Mayne)
if (!drawablep)
{
- OCT_ERRS << "LLSpatialPartition::move was passed a bad drawable." << llendl;
+ OCT_ERRS << "LLSpatialPartition::move was passed a bad drawable." << LL_ENDL;
return;
}
BOOL was_visible = curp ? curp->isVisible() : FALSE;
- if (curp && curp->mSpatialPartition != this)
+ if (curp && curp->getSpatialPartition() != this)
{
//keep drawable from being garbage collected
LLPointer<LLDrawable> ptr = drawablep;
- if (curp->mSpatialPartition->remove(drawablep, curp))
+ if (curp->getSpatialPartition()->remove(drawablep, curp))
{
put(drawablep, was_visible);
return;
}
else
{
- OCT_ERRS << "Drawable lost between spatial partitions on outbound transition." << llendl;
+ OCT_ERRS << "Drawable lost between spatial partitions on outbound transition." << LL_ENDL;
}
}
@@ -1873,19 +1031,19 @@ void LLSpatialPartition::move(LLDrawable *drawablep, LLSpatialGroup *curp, BOOL
LLPointer<LLDrawable> ptr = drawablep;
if (curp && !remove(drawablep, curp))
{
- OCT_ERRS << "Move couldn't find existing spatial group!" << llendl;
+ OCT_ERRS << "Move couldn't find existing spatial group!" << LL_ENDL;
}
put(drawablep, was_visible);
}
-class LLSpatialShift : public LLSpatialGroup::OctreeTraveler
+class LLSpatialShift : public OctreeTraveler
{
public:
const LLVector4a& mOffset;
LLSpatialShift(const LLVector4a& offset) : mOffset(offset) { }
- virtual void visit(const LLSpatialGroup::OctreeNode* branch)
+ virtual void visit(const OctreeNode* branch)
{
((LLSpatialGroup*) branch->getListener(0))->shift(mOffset);
}
@@ -1897,17 +1055,17 @@ void LLSpatialPartition::shift(const LLVector4a &offset)
shifter.traverse(mOctree);
}
-class LLOctreeCull : public LLSpatialGroup::OctreeTraveler
+class LLOctreeCull : public LLViewerOctreeCull
{
public:
- LLOctreeCull(LLCamera* camera)
- : mCamera(camera), mRes(0) { }
+ LLOctreeCull(LLCamera* camera) : LLViewerOctreeCull(camera) {}
- virtual bool earlyFail(LLSpatialGroup* group)
+ virtual bool earlyFail(LLViewerOctreeGroup* base_group)
{
+ LLSpatialGroup* group = (LLSpatialGroup*)base_group;
group->checkOcclusion();
- if (group->mOctreeNode->getParent() && //never occlusion cull the root node
+ if (group->getOctreeNode()->getParent() && //never occlusion cull the root node
LLPipeline::sUseOcclusion && //ignore occlusion if disabled
group->isOcclusionState(LLSpatialGroup::OCCLUDED))
{
@@ -1918,100 +1076,36 @@ public:
return false;
}
- virtual void traverse(const LLSpatialGroup::OctreeNode* n)
- {
- LLSpatialGroup* group = (LLSpatialGroup*) n->getListener(0);
-
- if (earlyFail(group))
- {
- return;
- }
-
- if (mRes == 2 ||
- (mRes && group->isState(LLSpatialGroup::SKIP_FRUSTUM_CHECK)))
- { //fully in, just add everything
- LLSpatialGroup::OctreeTraveler::traverse(n);
- }
- else
- {
- mRes = frustumCheck(group);
-
- if (mRes)
- { //at least partially in, run on down
- LLSpatialGroup::OctreeTraveler::traverse(n);
- }
-
- mRes = 0;
- }
- }
-
- virtual S32 frustumCheck(const LLSpatialGroup* group)
+ virtual S32 frustumCheck(const LLViewerOctreeGroup* group)
{
- S32 res = mCamera->AABBInFrustumNoFarClip(group->mBounds[0], group->mBounds[1]);
+ S32 res = AABBInFrustumNoFarClipGroupBounds(group);
if (res != 0)
{
- res = llmin(res, AABBSphereIntersect(group->mExtents[0], group->mExtents[1], mCamera->getOrigin(), mCamera->mFrustumCornerDist));
+ res = llmin(res, AABBSphereIntersectGroupExtents(group));
}
return res;
}
- virtual S32 frustumCheckObjects(const LLSpatialGroup* group)
+ virtual S32 frustumCheckObjects(const LLViewerOctreeGroup* group)
{
- S32 res = mCamera->AABBInFrustumNoFarClip(group->mObjectBounds[0], group->mObjectBounds[1]);
+ S32 res = AABBInFrustumNoFarClipObjectBounds(group);
if (res != 0)
{
- res = llmin(res, AABBSphereIntersect(group->mObjectExtents[0], group->mObjectExtents[1], mCamera->getOrigin(), mCamera->mFrustumCornerDist));
+ res = llmin(res, AABBSphereIntersectObjectExtents(group));
}
return res;
}
- virtual bool checkObjects(const LLSpatialGroup::OctreeNode* branch, const LLSpatialGroup* group)
- {
- if (branch->getElementCount() == 0) //no elements
- {
- return false;
- }
- else if (branch->getChildCount() == 0) //leaf state, already checked tightest bounding box
- {
- return true;
- }
- else if (mRes == 1 && !frustumCheckObjects(group)) //no objects in frustum
- {
- return false;
- }
-
- return true;
- }
-
- virtual void preprocess(LLSpatialGroup* group)
- {
-
- }
-
- virtual void processGroup(LLSpatialGroup* group)
+ virtual void processGroup(LLViewerOctreeGroup* base_group)
{
+ LLSpatialGroup* group = (LLSpatialGroup*)base_group;
if (group->needsUpdate() ||
- group->mVisible[LLViewerCamera::sCurCameraID] < LLDrawable::getCurrentFrame() - 1)
+ group->getVisible(LLViewerCamera::sCurCameraID) < LLDrawable::getCurrentFrame() - 1)
{
group->doOcclusion(mCamera);
}
gPipeline.markNotCulled(group, *mCamera);
}
-
- virtual void visit(const LLSpatialGroup::OctreeNode* branch)
- {
- LLSpatialGroup* group = (LLSpatialGroup*) branch->getListener(0);
-
- preprocess(group);
-
- if (checkObjects(branch, group))
- {
- processGroup(group);
- }
- }
-
- LLCamera *mCamera;
- S32 mRes;
};
class LLOctreeCullNoFarClip : public LLOctreeCull
@@ -2020,14 +1114,14 @@ public:
LLOctreeCullNoFarClip(LLCamera* camera)
: LLOctreeCull(camera) { }
- virtual S32 frustumCheck(const LLSpatialGroup* group)
+ virtual S32 frustumCheck(const LLViewerOctreeGroup* group)
{
- return mCamera->AABBInFrustumNoFarClip(group->mBounds[0], group->mBounds[1]);
+ return AABBInFrustumNoFarClipGroupBounds(group);
}
- virtual S32 frustumCheckObjects(const LLSpatialGroup* group)
+ virtual S32 frustumCheckObjects(const LLViewerOctreeGroup* group)
{
- S32 res = mCamera->AABBInFrustumNoFarClip(group->mObjectBounds[0], group->mObjectBounds[1]);
+ S32 res = AABBInFrustumNoFarClipObjectBounds(group);
return res;
}
};
@@ -2038,14 +1132,14 @@ public:
LLOctreeCullShadow(LLCamera* camera)
: LLOctreeCull(camera) { }
- virtual S32 frustumCheck(const LLSpatialGroup* group)
+ virtual S32 frustumCheck(const LLViewerOctreeGroup* group)
{
- return mCamera->AABBInFrustum(group->mBounds[0], group->mBounds[1]);
+ return AABBInFrustumGroupBounds(group);
}
- virtual S32 frustumCheckObjects(const LLSpatialGroup* group)
+ virtual S32 frustumCheckObjects(const LLViewerOctreeGroup* group)
{
- return mCamera->AABBInFrustum(group->mObjectBounds[0], group->mObjectBounds[1]);
+ return AABBInFrustumObjectBounds(group);
}
};
@@ -2055,9 +1149,11 @@ public:
LLOctreeCullVisExtents(LLCamera* camera, LLVector4a& min, LLVector4a& max)
: LLOctreeCullShadow(camera), mMin(min), mMax(max), mEmpty(TRUE) { }
- virtual bool earlyFail(LLSpatialGroup* group)
+ virtual bool earlyFail(LLViewerOctreeGroup* base_group)
{
- if (group->mOctreeNode->getParent() && //never occlusion cull the root node
+ LLSpatialGroup* group = (LLSpatialGroup*)base_group;
+
+ if (group->getOctreeNode()->getParent() && //never occlusion cull the root node
LLPipeline::sUseOcclusion && //ignore occlusion if disabled
group->isOcclusionState(LLSpatialGroup::OCCLUDED))
{
@@ -2067,7 +1163,7 @@ public:
return false;
}
- virtual void traverse(const LLSpatialGroup::OctreeNode* n)
+ virtual void traverse(const OctreeNode* n)
{
LLSpatialGroup* group = (LLSpatialGroup*) n->getListener(0);
@@ -2076,10 +1172,10 @@ public:
return;
}
- if ((mRes && group->isState(LLSpatialGroup::SKIP_FRUSTUM_CHECK)) ||
+ if ((mRes && group->hasState(LLSpatialGroup::SKIP_FRUSTUM_CHECK)) ||
mRes == 2)
{ //don't need to do frustum check
- LLSpatialGroup::OctreeTraveler::traverse(n);
+ OctreeTraveler::traverse(n);
}
else
{
@@ -2087,31 +1183,35 @@ public:
if (mRes)
{ //at least partially in, run on down
- LLSpatialGroup::OctreeTraveler::traverse(n);
+ OctreeTraveler::traverse(n);
}
mRes = 0;
}
}
- virtual void processGroup(LLSpatialGroup* group)
+ virtual void processGroup(LLViewerOctreeGroup* base_group)
{
- llassert(!group->isState(LLSpatialGroup::DIRTY) && !group->isEmpty())
+ LLSpatialGroup* group = (LLSpatialGroup*)base_group;
+
+ llassert(!group->hasState(LLSpatialGroup::DIRTY) && !group->isEmpty());
if (mRes < 2)
{
- if (mCamera->AABBInFrustum(group->mObjectBounds[0], group->mObjectBounds[1]) > 0)
+ if (AABBInFrustumObjectBounds(group) > 0)
{
mEmpty = FALSE;
- update_min_max(mMin, mMax, group->mObjectExtents[0]);
- update_min_max(mMin, mMax, group->mObjectExtents[1]);
+ const LLVector4a* exts = group->getObjectExtents();
+ update_min_max(mMin, mMax, exts[0]);
+ update_min_max(mMin, mMax, exts[1]);
}
}
else
{
mEmpty = FALSE;
- update_min_max(mMin, mMax, group->mExtents[0]);
- update_min_max(mMin, mMax, group->mExtents[1]);
+ const LLVector4a* exts = group->getExtents();
+ update_min_max(mMin, mMax, exts[0]);
+ update_min_max(mMin, mMax, exts[1]);
}
}
@@ -2126,10 +1226,12 @@ public:
LLOctreeCullDetectVisible(LLCamera* camera)
: LLOctreeCullShadow(camera), mResult(FALSE) { }
- virtual bool earlyFail(LLSpatialGroup* group)
+ virtual bool earlyFail(LLViewerOctreeGroup* base_group)
{
+ LLSpatialGroup* group = (LLSpatialGroup*)base_group;
+
if (mResult || //already found a node, don't check any more
- (group->mOctreeNode->getParent() && //never occlusion cull the root node
+ (group->getOctreeNode()->getParent() && //never occlusion cull the root node
LLPipeline::sUseOcclusion && //ignore occlusion if disabled
group->isOcclusionState(LLSpatialGroup::OCCLUDED)))
{
@@ -2139,9 +1241,9 @@ public:
return false;
}
- virtual void processGroup(LLSpatialGroup* group)
+ virtual void processGroup(LLViewerOctreeGroup* base_group)
{
- if (group->isVisible())
+ if (base_group->isVisible())
{
mResult = TRUE;
}
@@ -2156,17 +1258,21 @@ public:
LLOctreeSelect(LLCamera* camera, std::vector<LLDrawable*>* results)
: LLOctreeCull(camera), mResults(results) { }
- virtual bool earlyFail(LLSpatialGroup* group) { return false; }
- virtual void preprocess(LLSpatialGroup* group) { }
+ virtual bool earlyFail(LLViewerOctreeGroup* group) { return false; }
+ virtual void preprocess(LLViewerOctreeGroup* group) { }
- virtual void processGroup(LLSpatialGroup* group)
+ virtual void processGroup(LLViewerOctreeGroup* base_group)
{
- LLSpatialGroup::OctreeNode* branch = group->mOctreeNode;
+ LLSpatialGroup* group = (LLSpatialGroup*)base_group;
+ OctreeNode* branch = group->getOctreeNode();
- for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getDataBegin(); i != branch->getDataEnd(); ++i)
+ for (OctreeNode::const_element_iter i = branch->getDataBegin(); i != branch->getDataEnd(); ++i)
{
- LLDrawable* drawable = *i;
-
+ LLDrawable* drawable = (LLDrawable*)(*i)->getDrawable();
+ if(!drawable)
+ {
+ continue;
+ }
if (!drawable->isDead())
{
if (drawable->isSpatialBridge())
@@ -2291,18 +1397,24 @@ void drawBoxOutline(const LLVector4a& pos, const LLVector4a& size)
drawBoxOutline(reinterpret_cast<const LLVector3&>(pos), reinterpret_cast<const LLVector3&>(size));
}
-class LLOctreeDirty : public LLOctreeTraveler<LLDrawable>
+class LLOctreeDirty : public OctreeTraveler
{
public:
- virtual void visit(const LLOctreeNode<LLDrawable>* state)
+ LLOctreeDirty(bool no_rebuild) : mNoRebuild(no_rebuild){}
+
+ virtual void visit(const OctreeNode* state)
{
LLSpatialGroup* group = (LLSpatialGroup*) state->getListener(0);
group->destroyGL();
for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
{
- LLDrawable* drawable = *i;
- if (drawable->getVObj().notNull() && !group->mSpatialPartition->mRenderByGroup)
+ LLDrawable* drawable = (LLDrawable*)(*i)->getDrawable();
+ if(!drawable)
+ {
+ continue;
+ }
+ if (!mNoRebuild && drawable->getVObj().notNull() && !group->getSpatialPartition()->mRenderByGroup)
{
gPipeline.markRebuild(drawable, LLDrawable::REBUILD_ALL, TRUE);
}
@@ -2314,6 +1426,9 @@ public:
traverse(bridge->mOctree);
}
}
+
+private:
+ BOOL mNoRebuild;
};
void LLSpatialPartition::restoreGL()
@@ -2322,15 +1437,10 @@ void LLSpatialPartition::restoreGL()
void LLSpatialPartition::resetVertexBuffers()
{
- LLOctreeDirty dirty;
+ LLOctreeDirty dirty(sTeleportRequested);
dirty.traverse(mOctree);
}
-BOOL LLSpatialPartition::isOcclusionEnabled()
-{
- return mOcclusionEnabled || LLPipeline::sUseOcclusion > 2;
-}
-
BOOL LLSpatialPartition::getVisibleExtents(LLCamera& camera, LLVector3& visMin, LLVector3& visMax)
{
LLVector4a visMina, visMaxa;
@@ -2338,7 +1448,7 @@ BOOL LLSpatialPartition::getVisibleExtents(LLCamera& camera, LLVector3& visMin,
visMaxa.load3(visMax.mV);
{
- LLFastTimer ftm(FTM_CULL_REBOUND);
+ LL_RECORD_BLOCK_TIME(FTM_CULL_REBOUND);
LLSpatialGroup* group = (LLSpatialGroup*) mOctree->getListener(0);
group->rebound();
}
@@ -2364,7 +1474,7 @@ S32 LLSpatialPartition::cull(LLCamera &camera, std::vector<LLDrawable *>* result
((LLSpatialGroup*)mOctree->getListener(0))->checkStates();
#endif
{
- LLFastTimer ftm(FTM_CULL_REBOUND);
+ LL_RECORD_BLOCK_TIME(FTM_CULL_REBOUND);
LLSpatialGroup* group = (LLSpatialGroup*) mOctree->getListener(0);
group->rebound();
}
@@ -2373,27 +1483,42 @@ S32 LLSpatialPartition::cull(LLCamera &camera, std::vector<LLDrawable *>* result
((LLSpatialGroup*)mOctree->getListener(0))->validate();
#endif
-
- if (for_select)
- {
LLOctreeSelect selecter(&camera, results);
selecter.traverse(mOctree);
+
+ return 0;
}
- else if (LLPipeline::sShadowRender)
+
+S32 LLSpatialPartition::cull(LLCamera &camera, bool do_occlusion)
+{
+#if LL_OCTREE_PARANOIA_CHECK
+ ((LLSpatialGroup*)mOctree->getListener(0))->checkStates();
+#endif
{
- LLFastTimer ftm(FTM_FRUSTUM_CULL);
+ LL_RECORD_BLOCK_TIME(FTM_CULL_REBOUND);
+ LLSpatialGroup* group = (LLSpatialGroup*) mOctree->getListener(0);
+ group->rebound();
+ }
+
+#if LL_OCTREE_PARANOIA_CHECK
+ ((LLSpatialGroup*)mOctree->getListener(0))->validate();
+#endif
+
+ if (LLPipeline::sShadowRender)
+ {
+ LL_RECORD_BLOCK_TIME(FTM_FRUSTUM_CULL);
LLOctreeCullShadow culler(&camera);
culler.traverse(mOctree);
}
else if (mInfiniteFarClip || !LLPipeline::sUseFarClip)
{
- LLFastTimer ftm(FTM_FRUSTUM_CULL);
+ LL_RECORD_BLOCK_TIME(FTM_FRUSTUM_CULL);
LLOctreeCullNoFarClip culler(&camera);
culler.traverse(mOctree);
}
else
{
- LLFastTimer ftm(FTM_FRUSTUM_CULL);
+ LL_RECORD_BLOCK_TIME(FTM_FRUSTUM_CULL);
LLOctreeCull culler(&camera);
culler.traverse(mOctree);
}
@@ -2401,50 +1526,6 @@ S32 LLSpatialPartition::cull(LLCamera &camera, std::vector<LLDrawable *>* result
return 0;
}
-BOOL earlyFail(LLCamera* camera, LLSpatialGroup* group)
-{
- if (camera->getOrigin().isExactlyZero())
- {
- return FALSE;
- }
-
- const F32 vel = SG_OCCLUSION_FUDGE*2.f;
- LLVector4a fudge;
- fudge.splat(vel);
-
- const LLVector4a& c = group->mBounds[0];
- LLVector4a r;
- r.setAdd(group->mBounds[1], fudge);
-
- /*if (r.magVecSquared() > 1024.0*1024.0)
- {
- return TRUE;
- }*/
-
- LLVector4a e;
- e.load3(camera->getOrigin().mV);
-
- LLVector4a min;
- min.setSub(c,r);
- LLVector4a max;
- max.setAdd(c,r);
-
- S32 lt = e.lessThan(min).getGatheredBits() & 0x7;
- if (lt)
- {
- return FALSE;
- }
-
- S32 gt = e.greaterThan(max).getGatheredBits() & 0x7;
- if (gt)
- {
- return FALSE;
- }
-
- return TRUE;
-}
-
-
void pushVerts(LLDrawInfo* params, U32 mask)
{
LLRenderPass::applyModelMatrix(*params);
@@ -2516,7 +1597,7 @@ void pushBufferVerts(LLVertexBuffer* buffer, U32 mask)
void pushBufferVerts(LLSpatialGroup* group, U32 mask, bool push_alpha = true)
{
- if (group->mSpatialPartition->mRenderByGroup)
+ if (group->getSpatialPartition()->mRenderByGroup)
{
if (!group->mDrawMap.empty())
{
@@ -2542,7 +1623,8 @@ void pushBufferVerts(LLSpatialGroup* group, U32 mask, bool push_alpha = true)
}
/*else
{
- //drawBox(group->mBounds[0], group->mBounds[1]);
+ //const LLVector4a* bounds = group->getBounds();
+ //drawBox(bounds[0], bounds[1]);
}*/
}
@@ -2587,7 +1669,7 @@ void renderOctree(LLSpatialGroup* group)
LLVector4 col;
if (group->mBuilt > 0.f)
{
- group->mBuilt -= 2.f * gFrameIntervalSeconds;
+ group->mBuilt -= 2.f * gFrameIntervalSeconds.value();
if (group->mBufferUsage == GL_STATIC_DRAW_ARB)
{
col.setVec(1.0f, 0, 0, group->mBuilt*0.5f);
@@ -2606,14 +1688,20 @@ void renderOctree(LLSpatialGroup* group)
gGL.diffuseColor4f(1,0,0,group->mBuilt);
gGL.flush();
glLineWidth(5.f);
- drawBoxOutline(group->mObjectBounds[0], group->mObjectBounds[1]);
+
+ const LLVector4a* bounds = group->getObjectBounds();
+ drawBoxOutline(bounds[0], bounds[1]);
gGL.flush();
glLineWidth(1.f);
gGL.flush();
for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
{
- LLDrawable* drawable = *i;
- if (!group->mSpatialPartition->isBridge())
+ LLDrawable* drawable = (LLDrawable*)(*i)->getDrawable();
+ if(!drawable)
+ {
+ continue;
+ }
+ if (!group->getSpatialPartition()->isBridge())
{
gGL.pushMatrix();
LLVector3 trans = drawable->getRegion()->getOriginAgent();
@@ -2645,7 +1733,7 @@ void renderOctree(LLSpatialGroup* group)
}
}
- if (!group->mSpatialPartition->isBridge())
+ if (!group->getSpatialPartition()->isBridge())
{
gGL.popMatrix();
}
@@ -2657,7 +1745,7 @@ void renderOctree(LLSpatialGroup* group)
else
{
if (group->mBufferUsage == GL_STATIC_DRAW_ARB && !group->isEmpty()
- && group->mSpatialPartition->mRenderByGroup)
+ && group->getSpatialPartition()->mRenderByGroup)
{
col.setVec(0.8f, 0.4f, 0.1f, 0.1f);
}
@@ -2670,9 +1758,10 @@ void renderOctree(LLSpatialGroup* group)
gGL.diffuseColor4fv(col.mV);
LLVector4a fudge;
fudge.splat(0.001f);
- LLVector4a size = group->mObjectBounds[1];
- size.mul(1.01f);
- size.add(fudge);
+
+ //LLVector4a size = group->mObjectBounds[1];
+ //size.mul(1.01f);
+ //size.add(fudge);
//{
// LLGLDepthTest depth(GL_TRUE, GL_FALSE);
@@ -2688,10 +1777,12 @@ void renderOctree(LLSpatialGroup* group)
//drawBoxOutline(group->mObjectBounds[0], group->mObjectBounds[1]);
gGL.diffuseColor4f(0,1,1,1);
- drawBoxOutline(group->mBounds[0],group->mBounds[1]);
+
+ const LLVector4a* bounds = group->getBounds();
+ drawBoxOutline(bounds[0], bounds[1]);
//draw bounding box for draw info
- /*if (group->mSpatialPartition->mRenderByGroup)
+ /*if (group->getSpatialPartition()->mRenderByGroup)
{
gGL.diffuseColor4f(1.0f, 0.75f, 0.25f, 0.6f);
for (LLSpatialGroup::draw_map_t::iterator i = group->mDrawMap.begin(); i != group->mDrawMap.end(); ++i)
@@ -2821,7 +1912,7 @@ void renderXRay(LLSpatialGroup* group, LLCamera* camera)
for (LLSpatialGroup::element_iter iter = group->getDataBegin(); iter != group->getDataEnd(); ++iter)
{
- LLDrawable* drawable = *iter;
+ LLDrawable* drawable = (LLDrawable*)(*iter)->getDrawable();
if (drawable->getVObj().notNull() && drawable->getVObj()->isSelected())
{
selected = true;
@@ -2832,13 +1923,13 @@ void renderXRay(LLSpatialGroup* group, LLCamera* camera)
if (selected)
{ //store for rendering occlusion volume as overlay
- if (!group->mSpatialPartition->isBridge())
+ if (!group->getSpatialPartition()->isBridge())
{
visible_selected_groups.insert(group);
}
else
{
- visible_selected_groups.insert(group->mSpatialPartition->asBridge()->getSpatialGroup());
+ visible_selected_groups.insert(group->getSpatialPartition()->asBridge()->getSpatialGroup());
}
}
}
@@ -2889,7 +1980,7 @@ void renderUpdateType(LLDrawable* drawablep)
gGL.diffuseColor4f(0,0,1,0.5f);
break;
default:
- llwarns << "Unknown update_type " << vobj->getLastUpdateType() << llendl;
+ LL_WARNS() << "Unknown update_type " << vobj->getLastUpdateType() << LL_ENDL;
break;
};
S32 num_faces = drawablep->getNumFaces();
@@ -3539,7 +2630,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
}
else
{
- llerrs << "Unhandled type" << llendl;
+ LL_ERRS() << "Unhandled type" << LL_ENDL;
}
gGL.popMatrix();
@@ -3547,9 +2638,13 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
void renderPhysicsShapes(LLSpatialGroup* group)
{
- for (LLSpatialGroup::OctreeNode::const_element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
+ for (OctreeNode::const_element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
{
- LLDrawable* drawable = *i;
+ LLDrawable* drawable = (LLDrawable*)(*i)->getDrawable();
+ if(!drawable)
+ {
+ continue;
+ }
if (drawable->isSpatialBridge())
{
@@ -3568,7 +2663,7 @@ void renderPhysicsShapes(LLSpatialGroup* group)
LLVOVolume* volume = drawable->getVOVolume();
if (volume && !volume->isAttachment() && volume->getPhysicsShapeType() != LLViewerObject::PHYSICS_SHAPE_NONE )
{
- if (!group->mSpatialPartition->isBridge())
+ if (!group->getSpatialPartition()->isBridge())
{
gGL.pushMatrix();
LLVector3 trans = drawable->getRegion()->getOriginAgent();
@@ -4133,17 +3228,18 @@ void renderAgentTarget(LLVOAvatar* avatar)
}
}
-class LLOctreeRenderNonOccluded : public LLOctreeTraveler<LLDrawable>
+class LLOctreeRenderNonOccluded : public OctreeTraveler
{
public:
LLCamera* mCamera;
LLOctreeRenderNonOccluded(LLCamera* camera): mCamera(camera) {}
- virtual void traverse(const LLSpatialGroup::OctreeNode* node)
+ virtual void traverse(const OctreeNode* node)
{
LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0);
- if (!mCamera || mCamera->AABBInFrustumNoFarClip(group->mBounds[0], group->mBounds[1]))
+ const LLVector4a* bounds = group->getBounds();
+ if (!mCamera || mCamera->AABBInFrustumNoFarClip(bounds[0], bounds[1]))
{
node->accept(this);
stop_glerror();
@@ -4183,11 +3279,11 @@ public:
}
}
- virtual void visit(const LLSpatialGroup::OctreeNode* branch)
+ virtual void visit(const OctreeNode* branch)
{
LLSpatialGroup* group = (LLSpatialGroup*) branch->getListener(0);
-
- if (group->isState(LLSpatialGroup::GEOM_DIRTY) || (mCamera && !mCamera->AABBInFrustumNoFarClip(group->mBounds[0], group->mBounds[1])))
+ const LLVector4a* bounds = group->getBounds();
+ if (group->hasState(LLSpatialGroup::GEOM_DIRTY) || (mCamera && !mCamera->AABBInFrustumNoFarClip(bounds[0], bounds[1])))
{
return;
}
@@ -4200,18 +3296,18 @@ public:
if (!group->isEmpty())
{
gGL.diffuseColor3f(0,0,1);
-
- llassert(group->mObjectBounds[0].isFinite3());
- llassert(group->mObjectBounds[1].isFinite3());
-
- drawBoxOutline(group->mObjectBounds[0],
- group->mObjectBounds[1]);
+ const LLVector4a* obj_bounds = group->getObjectBounds();
+ drawBoxOutline(obj_bounds[0], obj_bounds[1]);
}
}
- for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getDataBegin(); i != branch->getDataEnd(); ++i)
+ for (OctreeNode::const_element_iter i = branch->getDataBegin(); i != branch->getDataEnd(); ++i)
{
- LLDrawable* drawable = *i;
+ LLDrawable* drawable = (LLDrawable*)(*i)->getDrawable();
+ if(!drawable)
+ {
+ continue;
+ }
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_BBOXES))
{
@@ -4297,11 +3393,11 @@ public:
{
if (facep->mDrawInfo->mTextureList.size() <= index)
{
- llerrs << "Face texture index out of bounds." << llendl;
+ LL_ERRS() << "Face texture index out of bounds." << LL_ENDL;
}
else if (facep->mDrawInfo->mTextureList[index] != facep->getTexture())
{
- llerrs << "Face texture index incorrect." << llendl;
+ LL_ERRS() << "Face texture index incorrect." << LL_ENDL;
}
}
}
@@ -4333,17 +3429,18 @@ public:
}
};
-class LLOctreeRenderXRay : public LLOctreeTraveler<LLDrawable>
+class LLOctreeRenderXRay : public OctreeTraveler
{
public:
LLCamera* mCamera;
LLOctreeRenderXRay(LLCamera* camera): mCamera(camera) {}
- virtual void traverse(const LLSpatialGroup::OctreeNode* node)
+ virtual void traverse(const OctreeNode* node)
{
LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0);
- if (!mCamera || mCamera->AABBInFrustumNoFarClip(group->mBounds[0], group->mBounds[1]))
+ const LLVector4a* bounds = group->getBounds();
+ if (!mCamera || mCamera->AABBInFrustumNoFarClip(bounds[0], bounds[1]))
{
node->accept(this);
stop_glerror();
@@ -4372,21 +3469,22 @@ public:
}
}
- virtual void visit(const LLSpatialGroup::OctreeNode* node) {}
+ virtual void visit(const OctreeNode* node) {}
};
-class LLOctreeRenderPhysicsShapes : public LLOctreeTraveler<LLDrawable>
+class LLOctreeRenderPhysicsShapes : public OctreeTraveler
{
public:
LLCamera* mCamera;
LLOctreeRenderPhysicsShapes(LLCamera* camera): mCamera(camera) {}
- virtual void traverse(const LLSpatialGroup::OctreeNode* node)
+ virtual void traverse(const OctreeNode* node)
{
LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0);
- if (!mCamera || mCamera->AABBInFrustumNoFarClip(group->mBounds[0], group->mBounds[1]))
+ const LLVector4a* bounds = group->getBounds();
+ if (!mCamera || mCamera->AABBInFrustumNoFarClip(bounds[0], bounds[1]))
{
node->accept(this);
stop_glerror();
@@ -4404,23 +3502,24 @@ public:
}
}
- virtual void visit(const LLSpatialGroup::OctreeNode* branch)
+ virtual void visit(const OctreeNode* branch)
{
}
};
-class LLOctreePushBBoxVerts : public LLOctreeTraveler<LLDrawable>
+class LLOctreePushBBoxVerts : public OctreeTraveler
{
public:
LLCamera* mCamera;
LLOctreePushBBoxVerts(LLCamera* camera): mCamera(camera) {}
- virtual void traverse(const LLSpatialGroup::OctreeNode* node)
+ virtual void traverse(const OctreeNode* node)
{
LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0);
- if (!mCamera || mCamera->AABBInFrustum(group->mBounds[0], group->mBounds[1]))
+ const LLVector4a* bounds = group->getBounds();
+ if (!mCamera || mCamera->AABBInFrustum(bounds[0], bounds[1]))
{
node->accept(this);
@@ -4431,19 +3530,23 @@ public:
}
}
- virtual void visit(const LLSpatialGroup::OctreeNode* branch)
+ virtual void visit(const OctreeNode* branch)
{
LLSpatialGroup* group = (LLSpatialGroup*) branch->getListener(0);
- if (group->isState(LLSpatialGroup::GEOM_DIRTY) || (mCamera && !mCamera->AABBInFrustumNoFarClip(group->mBounds[0], group->mBounds[1])))
+ const LLVector4a* bounds = group->getBounds();
+ if (group->hasState(LLSpatialGroup::GEOM_DIRTY) || (mCamera && !mCamera->AABBInFrustumNoFarClip(bounds[0], bounds[1])))
{
return;
}
- for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getDataBegin(); i != branch->getDataEnd(); ++i)
+ for (OctreeNode::const_element_iter i = branch->getDataBegin(); i != branch->getDataEnd(); ++i)
{
- LLDrawable* drawable = *i;
-
+ LLDrawable* drawable = (LLDrawable*)(*i)->getDrawable();
+ if(!drawable)
+ {
+ continue;
+ }
renderBoundingBox(drawable, FALSE);
}
}
@@ -4455,7 +3558,7 @@ void LLSpatialPartition::renderIntersectingBBoxes(LLCamera* camera)
pusher.traverse(mOctree);
}
-class LLOctreeStateCheck : public LLOctreeTraveler<LLDrawable>
+class LLOctreeStateCheck : public OctreeTraveler
{
public:
U32 mInheritedMask[LLViewerCamera::NUM_CAMERAS];
@@ -4468,7 +3571,7 @@ public:
}
}
- virtual void traverse(const LLSpatialGroup::OctreeNode* node)
+ virtual void traverse(const OctreeNode* node)
{
LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0);
@@ -4495,7 +3598,7 @@ public:
}
- virtual void visit(const LLOctreeNode<LLDrawable>* state)
+ virtual void visit(const OctreeNode* state)
{
LLSpatialGroup* group = (LLSpatialGroup*) state->getListener(0);
@@ -4503,11 +3606,11 @@ public:
{
if (mInheritedMask[i] && !(group->mOcclusionState[i] & mInheritedMask[i]))
{
- llerrs << "Spatial group failed inherited mask test." << llendl;
+ LL_ERRS() << "Spatial group failed inherited mask test." << LL_ENDL;
}
}
- if (group->isState(LLSpatialGroup::DIRTY))
+ if (group->hasState(LLSpatialGroup::DIRTY))
{
assert_parent_state(group, LLSpatialGroup::DIRTY);
}
@@ -4518,9 +3621,9 @@ public:
LLSpatialGroup* parent = group->getParent();
while (parent)
{
- if (!parent->isState(state))
+ if (!parent->hasState(state))
{
- llerrs << "Spatial group failed parent state check." << llendl;
+ LL_ERRS() << "Spatial group failed parent state check." << LL_ENDL;
}
parent = parent->getParent();
}
@@ -4654,7 +3757,7 @@ BOOL LLSpatialPartition::isVisible(const LLVector3& v)
}
LL_ALIGN_PREFIX(16)
-class LLOctreeIntersect : public LLSpatialGroup::OctreeTraveler
+class LLOctreeIntersect : public LLOctreeTraveler<LLViewerOctreeEntry>
{
public:
LL_ALIGN_16(LLVector4a mStart);
@@ -4682,21 +3785,21 @@ public:
{
}
- virtual void visit(const LLSpatialGroup::OctreeNode* branch)
+ virtual void visit(const OctreeNode* branch)
{
- for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getDataBegin(); i != branch->getDataEnd(); ++i)
+ for (OctreeNode::const_element_iter i = branch->getDataBegin(); i != branch->getDataEnd(); ++i)
{
check(*i);
}
}
- virtual LLDrawable* check(const LLSpatialGroup::OctreeNode* node)
+ virtual LLDrawable* check(const OctreeNode* node)
{
node->accept(this);
for (U32 i = 0; i < node->getChildCount(); i++)
{
- const LLSpatialGroup::OctreeNode* child = node->getChild(i);
+ const OctreeNode* child = node->getChild(i);
LLVector3 res;
LLSpatialGroup* group = (LLSpatialGroup*) child->getListener(0);
@@ -4704,17 +3807,18 @@ public:
LLVector4a size;
LLVector4a center;
- size = group->mBounds[1];
- center = group->mBounds[0];
+ const LLVector4a* bounds = group->getBounds();
+ size = bounds[1];
+ center = bounds[0];
LLVector4a local_start = mStart;
LLVector4a local_end = mEnd;
- if (group->mSpatialPartition->isBridge())
+ if (group->getSpatialPartition()->isBridge())
{
- LLMatrix4 local_matrix = group->mSpatialPartition->asBridge()->mDrawable->getRenderMatrix();
+ LLMatrix4 local_matrix = group->getSpatialPartition()->asBridge()->mDrawable->getRenderMatrix();
local_matrix.invert();
-
+
LLMatrix4a local_matrix4a;
local_matrix4a.loadu(local_matrix);
@@ -4731,8 +3835,10 @@ public:
return mHit;
}
- virtual bool check(LLDrawable* drawable)
+ virtual bool check(LLViewerOctreeEntry* entry)
{
+ LLDrawable* drawable = (LLDrawable*)entry->getDrawable();
+
if (!drawable || !gPipeline.hasRenderType(drawable->getRenderType()) || !drawable->isVisible())
{
return false;
@@ -4812,7 +3918,7 @@ LLDrawable* LLSpatialPartition::lineSegmentIntersect(const LLVector4a& start, co
LLDrawInfo::LLDrawInfo(U16 start, U16 end, U32 count, U32 offset,
LLViewerTexture* texture, LLVertexBuffer* buffer,
BOOL fullbright, U8 bump, BOOL particle, F32 part_size)
-:
+: LLTrace::MemTrackableNonVirtual<LLDrawInfo, 16>("LLDrawInfo"),
mVertexBuffer(buffer),
mTexture(texture),
mTextureMatrix(NULL),
@@ -4849,7 +3955,7 @@ LLDrawInfo::~LLDrawInfo()
{
/*if (LLSpatialGroup::sNoDelete)
{
- llerrs << "LLDrawInfo deleted illegally!" << llendl;
+ LL_ERRS() << "LLDrawInfo deleted illegally!" << LL_ENDL;
}*/
if (mFace)
@@ -5127,10 +4233,8 @@ void LLCullResult::assertDrawMapsEmpty()
{
if (mRenderMapSize[i] != 0)
{
- llerrs << "Stale LLDrawInfo's in LLCullResult!" << llendl;
+ LL_ERRS() << "Stale LLDrawInfo's in LLCullResult!" << LL_ENDL;
}
}
}
-
-
diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h
index f26defd5e1..08a4d00d0f 100755
--- a/indra/newview/llspatialpartition.h
+++ b/indra/newview/llspatialpartition.h
@@ -45,48 +45,31 @@
#define SG_STATE_INHERIT_MASK (OCCLUDED)
#define SG_INITIAL_STATE_MASK (DIRTY | GEOM_DIRTY)
+class LLViewerOctreePartition;
class LLSpatialPartition;
class LLSpatialBridge;
class LLSpatialGroup;
class LLTextureAtlas;
class LLTextureAtlasSlot;
+class LLViewerRegion;
-S32 AABBSphereIntersect(const LLVector4a& min, const LLVector4a& max, const LLVector3 &origin, const F32 &rad);
-S32 AABBSphereIntersectR2(const LLVector4a& min, const LLVector4a& max, const LLVector3 &origin, const F32 &radius_squared);
-
-S32 AABBSphereIntersect(const LLVector3& min, const LLVector3& max, const LLVector3 &origin, const F32 &rad);
-S32 AABBSphereIntersectR2(const LLVector3& min, const LLVector3& max, const LLVector3 &origin, const F32 &radius_squared);
void pushVerts(LLFace* face, U32 mask);
-// get index buffer for binary encoded axis vertex buffer given a box at center being viewed by given camera
-U32 get_box_fan_indices(LLCamera* camera, const LLVector4a& center);
-U8* get_box_fan_indices_ptr(LLCamera* camera, const LLVector4a& center);
-
-class LLDrawInfo : public LLRefCount
+class LLDrawInfo : public LLRefCount, public LLTrace::MemTrackableNonVirtual<LLDrawInfo, 16>
{
protected:
~LLDrawInfo();
public:
- void* operator new(size_t size)
- {
- return ll_aligned_malloc(size,64);
- }
-
- void operator delete(void* ptr)
- {
- ll_aligned_free(ptr);
- }
-
-
LLDrawInfo(const LLDrawInfo& rhs)
+ : LLTrace::MemTrackableNonVirtual<LLDrawInfo, 16>("LLDrawInfo")
{
*this = rhs;
}
const LLDrawInfo& operator=(const LLDrawInfo& rhs)
{
- llerrs << "Illegal operation!" << llendl;
+ LL_ERRS() << "Illegal operation!" << LL_ENDL;
return *this;
}
@@ -185,7 +168,7 @@ public:
}
};
-
+
struct CompareBump
{
bool operator()(const LLPointer<LLDrawInfo>& lhs, const LLPointer<LLDrawInfo>& rhs)
@@ -208,34 +191,23 @@ public:
};
LL_ALIGN_PREFIX(64)
-class LLSpatialGroup : public LLOctreeListener<LLDrawable>
+class LLSpatialGroup : public LLOcclusionCullingGroup
{
friend class LLSpatialPartition;
friend class LLOctreeStateCheck;
public:
- LLSpatialGroup(const LLSpatialGroup& rhs)
+ LLSpatialGroup(const LLSpatialGroup& rhs) : LLOcclusionCullingGroup(rhs)
{
*this = rhs;
}
- void* operator new(size_t size)
- {
- return ll_aligned_malloc_16(size);
- }
-
- void operator delete(void* ptr)
- {
- ll_aligned_free_16(ptr);
- }
-
const LLSpatialGroup& operator=(const LLSpatialGroup& rhs)
{
- llerrs << "Illegal operation!" << llendl;
+ LL_ERRS() << "Illegal operation!" << LL_ENDL;
return *this;
}
- static std::set<GLuint> sPendingQueries; //pending occlusion queries
static U32 sNodeCount;
static BOOL sNoDelete; //deletion of spatial groups and draw info not allowed if TRUE
@@ -247,15 +219,6 @@ public:
typedef std::map<LLFace*, buffer_list_t> buffer_texture_map_t;
typedef std::map<U32, buffer_texture_map_t> buffer_map_t;
- typedef LLOctreeListener<LLDrawable> BaseType;
- typedef LLOctreeListener<LLDrawable> OctreeListener;
- typedef LLTreeNode<LLDrawable> TreeNode;
- typedef LLOctreeNode<LLDrawable> OctreeNode;
- typedef LLOctreeRoot<LLDrawable> OctreeRoot;
- typedef LLOctreeTraveler<LLDrawable> OctreeTraveler;
- typedef LLOctreeNode<LLDrawable>::element_iter element_iter;
- typedef LLOctreeNode<LLDrawable>::element_list element_list;
-
struct CompareDistanceGreater
{
bool operator()(const LLSpatialGroup* const& lhs, const LLSpatialGroup* const& rhs)
@@ -282,104 +245,56 @@ public:
typedef enum
{
- OCCLUDED = 0x00010000,
- QUERY_PENDING = 0x00020000,
- ACTIVE_OCCLUSION = 0x00040000,
- DISCARD_QUERY = 0x00080000,
- EARLY_FAIL = 0x00100000,
- } eOcclusionState;
-
- typedef enum
- {
- DEAD = 0x00000001,
- DIRTY = 0x00000002,
- OBJECT_DIRTY = 0x00000004,
- GEOM_DIRTY = 0x00000008,
- ALPHA_DIRTY = 0x00000010,
- SKIP_FRUSTUM_CHECK = 0x00000020,
- IN_IMAGE_QUEUE = 0x00000040,
- IMAGE_DIRTY = 0x00000080,
- MESH_DIRTY = 0x00000100,
- NEW_DRAWINFO = 0x00000200,
- IN_BUILD_Q1 = 0x00000400,
- IN_BUILD_Q2 = 0x00000800,
+ GEOM_DIRTY = LLViewerOctreeGroup::INVALID_STATE,
+ ALPHA_DIRTY = (GEOM_DIRTY << 1),
+ IN_IMAGE_QUEUE = (ALPHA_DIRTY << 1),
+ IMAGE_DIRTY = (IN_IMAGE_QUEUE << 1),
+ MESH_DIRTY = (IMAGE_DIRTY << 1),
+ NEW_DRAWINFO = (MESH_DIRTY << 1),
+ IN_BUILD_Q1 = (NEW_DRAWINFO << 1),
+ IN_BUILD_Q2 = (IN_BUILD_Q1 << 1),
STATE_MASK = 0x0000FFFF,
} eSpatialState;
- typedef enum
- {
- STATE_MODE_SINGLE = 0, //set one node
- STATE_MODE_BRANCH, //set entire branch
- STATE_MODE_DIFF, //set entire branch as long as current state is different
- STATE_MODE_ALL_CAMERAS, //used for occlusion state, set state for all cameras
- } eSetStateMode;
-
LLSpatialGroup(OctreeNode* node, LLSpatialPartition* part);
BOOL isHUDGroup() ;
- BOOL isDead() { return isState(DEAD); }
- BOOL isState(U32 state) const;
- BOOL isOcclusionState(U32 state) const { return mOcclusionState[LLViewerCamera::sCurCameraID] & state ? TRUE : FALSE; }
- U32 getState() { return mState; }
- void setState(U32 state);
- void clearState(U32 state);
void clearDrawMap();
void validate();
- void checkStates();
void validateDrawMap();
void setState(U32 state, S32 mode);
void clearState(U32 state, S32 mode);
-
- void setOcclusionState(U32 state, S32 mode = STATE_MODE_SINGLE);
- void clearOcclusionState(U32 state, S32 mode = STATE_MODE_SINGLE);
+ void clearState(U32 state) {mState &= ~state;}
LLSpatialGroup* getParent();
-
- BOOL addObject(LLDrawable *drawablep, BOOL add_all = FALSE, BOOL from_octree = FALSE);
+ BOOL addObject(LLDrawable *drawablep);
BOOL removeObject(LLDrawable *drawablep, BOOL from_octree = FALSE);
BOOL updateInGroup(LLDrawable *drawablep, BOOL immediate = FALSE); // Update position if it's in the group
- BOOL isVisible() const;
- BOOL isRecentlyVisible() const;
- void setVisible();
void shift(const LLVector4a &offset);
- BOOL boundObjects(BOOL empty, LLVector4a& newMin, LLVector4a& newMax);
- void unbound();
- BOOL rebound();
- void checkOcclusion(); //read back last occlusion query (if any)
- void doOcclusion(LLCamera* camera); //issue occlusion query
void destroyGL(bool keep_occlusion = false);
void updateDistance(LLCamera& camera);
- BOOL needsUpdate();
F32 getUpdateUrgency() const;
BOOL changeLOD();
void rebuildGeom();
void rebuildMesh();
+ void setState(U32 state) {mState |= state;}
void dirtyGeom() { setState(GEOM_DIRTY); }
void dirtyMesh() { setState(MESH_DIRTY); }
- //octree wrappers to make code more readable
- element_list& getData() { return mOctreeNode->getData(); }
- element_iter getDataBegin() { return mOctreeNode->getDataBegin(); }
- element_iter getDataEnd() { return mOctreeNode->getDataEnd(); }
- bool hasElement(LLDrawable* drawablep) { return std::find(mOctreeNode->getDataBegin(), mOctreeNode->getDataEnd(), drawablep) != mOctreeNode->getDataEnd(); }
-
- U32 getElementCount() const { return mOctreeNode->getElementCount(); }
- bool isEmpty() const { return mOctreeNode->isEmpty(); }
-
void drawObjectBox(LLColor4 col);
+ LLSpatialPartition* getSpatialPartition() {return (LLSpatialPartition*)mSpatialPartition;}
+
//LISTENER FUNCTIONS
- virtual void handleInsertion(const TreeNode* node, LLDrawable* face);
- virtual void handleRemoval(const TreeNode* node, LLDrawable* face);
+ virtual void handleInsertion(const TreeNode* node, LLViewerOctreeEntry* face);
+ virtual void handleRemoval(const TreeNode* node, LLViewerOctreeEntry* face);
virtual void handleDestruction(const TreeNode* node);
- virtual void handleStateChange(const TreeNode* node);
virtual void handleChildAddition(const OctreeNode* parent, OctreeNode* child);
- virtual void handleChildRemoval(const OctreeNode* parent, const OctreeNode* child);
//-------------------
//for atlas use
@@ -402,21 +317,6 @@ public:
public:
- typedef enum
- {
- BOUNDS = 0,
- EXTENTS = 2,
- OBJECT_BOUNDS = 4,
- OBJECT_EXTENTS = 6,
- VIEW_ANGLE = 8,
- LAST_VIEW_ANGLE = 9,
- V4_COUNT = 10
- } eV4Index;
-
- LL_ALIGN_16(LLVector4a mBounds[2]); // bounding box (center, size) of this node and all its children (tight fit to objects)
- LL_ALIGN_16(LLVector4a mExtents[2]); // extents (min, max) of this node and all its children
- LL_ALIGN_16(LLVector4a mObjectExtents[2]); // extents (min, max) of objects in this node
- LL_ALIGN_16(LLVector4a mObjectBounds[2]); // bounding box (center, size) of objects in this node
LL_ALIGN_16(LLVector4a mViewAngle);
LL_ALIGN_16(LLVector4a mLastUpdateViewAngle);
@@ -437,11 +337,6 @@ private:
protected:
virtual ~LLSpatialGroup();
- U32 mState;
- U32 mOcclusionState[LLViewerCamera::NUM_CAMERAS];
- U32 mOcclusionIssued[LLViewerCamera::NUM_CAMERAS];
-
- S32 mLODHash;
static S32 sLODSeed;
public:
@@ -452,16 +347,12 @@ public:
F32 mSurfaceArea; //used by volumes to track estimated surface area of geometry in this node
F32 mBuilt;
- OctreeNode* mOctreeNode;
- LLSpatialPartition* mSpatialPartition;
LLPointer<LLVertexBuffer> mVertexBuffer;
- GLuint mOcclusionQuery[LLViewerCamera::NUM_CAMERAS];
U32 mBufferUsage;
draw_map_t mDrawMap;
- S32 mVisible[LLViewerCamera::NUM_CAMERAS];
F32 mDistance;
F32 mDepth;
F32 mLastUpdateDistance;
@@ -484,10 +375,10 @@ public:
virtual LLVertexBuffer* createVertexBuffer(U32 type_mask, U32 usage);
};
-class LLSpatialPartition: public LLGeometryManager
+class LLSpatialPartition: public LLViewerOctreePartition, public LLGeometryManager
{
public:
- LLSpatialPartition(U32 data_mask, BOOL render_by_group, U32 mBufferUsage);
+ LLSpatialPartition(U32 data_mask, BOOL render_by_group, U32 mBufferUsage, LLViewerRegion* regionp);
virtual ~LLSpatialPartition();
LLSpatialGroup *put(LLDrawable *drawablep, BOOL was_visible = FALSE);
@@ -514,7 +405,8 @@ public:
virtual void rebuildMesh(LLSpatialGroup* group);
BOOL visibleObjectsInFrustum(LLCamera& camera);
- S32 cull(LLCamera &camera, std::vector<LLDrawable *>* results = NULL, BOOL for_select = FALSE); // Cull on arbitrary frustum
+ /*virtual*/ S32 cull(LLCamera &camera, bool do_occlusion=false); // Cull on arbitrary frustum
+ S32 cull(LLCamera &camera, std::vector<LLDrawable *>* results, BOOL for_select); // Cull on arbitrary frustum
BOOL isVisible(const LLVector3& v);
bool isHUDPartition() ;
@@ -527,25 +419,22 @@ public:
void renderIntersectingBBoxes(LLCamera* camera);
void restoreGL();
void resetVertexBuffers();
- BOOL isOcclusionEnabled();
+
BOOL getVisibleExtents(LLCamera& camera, LLVector3& visMin, LLVector3& visMax);
public:
- LLSpatialGroup::OctreeNode* mOctree;
LLSpatialBridge* mBridge; // NULL for non-LLSpatialBridge instances, otherwise, mBridge == this
// use a pointer instead of making "isBridge" and "asBridge" virtual so it's safe
// to call asBridge() from the destructor
- BOOL mOcclusionEnabled; // if TRUE, occlusion culling is performed
+
BOOL mInfiniteFarClip; // if TRUE, frustum culling ignores far clip plane
U32 mBufferUsage;
const BOOL mRenderByGroup;
- U32 mLODSeed;
- U32 mLODPeriod; //number of frames between LOD updates for a given spatial group (staggered by mLODSeed)
U32 mVertexDataMask;
F32 mSlopRatio; //percentage distance must change before drawables receive LOD update (default is 0.25);
BOOL mDepthMask; //if TRUE, objects in this partition will be written to depth during alpha rendering
- U32 mDrawableType;
- U32 mPartitionType;
+
+ static BOOL sTeleportRequested; //started to issue a teleport request
};
// class for creating bridges between spatial partitions
@@ -557,7 +446,7 @@ protected:
public:
typedef std::vector<LLPointer<LLSpatialBridge> > bridge_vector_t;
- LLSpatialBridge(LLDrawable* root, BOOL render_by_group, U32 data_mask);
+ LLSpatialBridge(LLDrawable* root, BOOL render_by_group, U32 data_mask, LLViewerRegion* regionp);
void destroyTree();
@@ -679,7 +568,7 @@ private:
class LLWaterPartition : public LLSpatialPartition
{
public:
- LLWaterPartition();
+ LLWaterPartition(LLViewerRegion* regionp);
virtual void getGeometry(LLSpatialGroup* group) { }
virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { }
};
@@ -688,14 +577,14 @@ public:
class LLVoidWaterPartition : public LLWaterPartition
{
public:
- LLVoidWaterPartition();
+ LLVoidWaterPartition(LLViewerRegion* regionp);
};
//spatial partition for terrain (impelmented in LLVOSurfacePatch.cpp)
class LLTerrainPartition : public LLSpatialPartition
{
public:
- LLTerrainPartition();
+ LLTerrainPartition(LLViewerRegion* regionp);
virtual void getGeometry(LLSpatialGroup* group);
virtual LLVertexBuffer* createVertexBuffer(U32 type_mask, U32 usage);
};
@@ -704,7 +593,7 @@ public:
class LLTreePartition : public LLSpatialPartition
{
public:
- LLTreePartition();
+ LLTreePartition(LLViewerRegion* regionp);
virtual void getGeometry(LLSpatialGroup* group) { }
virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { }
@@ -714,7 +603,7 @@ public:
class LLParticlePartition : public LLSpatialPartition
{
public:
- LLParticlePartition();
+ LLParticlePartition(LLViewerRegion* regionp);
virtual void rebuildGeom(LLSpatialGroup* group);
virtual void getGeometry(LLSpatialGroup* group);
virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count);
@@ -726,14 +615,14 @@ protected:
class LLHUDParticlePartition : public LLParticlePartition
{
public:
- LLHUDParticlePartition();
+ LLHUDParticlePartition(LLViewerRegion* regionp);
};
//spatial partition for grass (implemented in LLVOGrass.cpp)
class LLGrassPartition : public LLSpatialPartition
{
public:
- LLGrassPartition();
+ LLGrassPartition(LLViewerRegion* regionp);
virtual void getGeometry(LLSpatialGroup* group);
virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count);
protected:
@@ -751,19 +640,33 @@ class LLVolumeGeometryManager: public LLGeometryManager
DISTANCE_SORT
} eSortType;
- virtual ~LLVolumeGeometryManager() { }
+ LLVolumeGeometryManager();
+ virtual ~LLVolumeGeometryManager();
virtual void rebuildGeom(LLSpatialGroup* group);
virtual void rebuildMesh(LLSpatialGroup* group);
virtual void getGeometry(LLSpatialGroup* group);
void genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace** faces, U32 face_count, BOOL distance_sort = FALSE, BOOL batch_textures = FALSE, BOOL no_materials = FALSE);
void registerFace(LLSpatialGroup* group, LLFace* facep, U32 type);
+
+private:
+ void allocateFaces(U32 pMaxFaceCount);
+ void freeFaces();
+
+ static int32_t sInstanceCount;
+ static LLFace** sFullbrightFaces;
+ static LLFace** sBumpFaces;
+ static LLFace** sSimpleFaces;
+ static LLFace** sNormFaces;
+ static LLFace** sSpecFaces;
+ static LLFace** sNormSpecFaces;
+ static LLFace** sAlphaFaces;
};
//spatial partition that uses volume geometry manager (implemented in LLVOVolume.cpp)
class LLVolumePartition : public LLSpatialPartition, public LLVolumeGeometryManager
{
public:
- LLVolumePartition();
+ LLVolumePartition(LLViewerRegion* regionp);
virtual void rebuildGeom(LLSpatialGroup* group) { LLVolumeGeometryManager::rebuildGeom(group); }
virtual void getGeometry(LLSpatialGroup* group) { LLVolumeGeometryManager::getGeometry(group); }
virtual void rebuildMesh(LLSpatialGroup* group) { LLVolumeGeometryManager::rebuildMesh(group); }
@@ -774,7 +677,7 @@ public:
class LLVolumeBridge : public LLSpatialBridge, public LLVolumeGeometryManager
{
public:
- LLVolumeBridge(LLDrawable* drawable);
+ LLVolumeBridge(LLDrawable* drawable, LLViewerRegion* regionp);
virtual void rebuildGeom(LLSpatialGroup* group) { LLVolumeGeometryManager::rebuildGeom(group); }
virtual void getGeometry(LLSpatialGroup* group) { LLVolumeGeometryManager::getGeometry(group); }
virtual void rebuildMesh(LLSpatialGroup* group) { LLVolumeGeometryManager::rebuildMesh(group); }
@@ -784,7 +687,7 @@ public:
class LLHUDBridge : public LLVolumeBridge
{
public:
- LLHUDBridge(LLDrawable* drawablep);
+ LLHUDBridge(LLDrawable* drawablep, LLViewerRegion* regionp);
virtual void shiftPos(const LLVector4a& vec);
virtual F32 calcPixelArea(LLSpatialGroup* group, LLCamera& camera);
};
@@ -793,7 +696,7 @@ public:
class LLBridgePartition : public LLSpatialPartition
{
public:
- LLBridgePartition();
+ LLBridgePartition(LLViewerRegion* regionp);
virtual void getGeometry(LLSpatialGroup* group) { }
virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { }
};
@@ -801,7 +704,7 @@ public:
class LLHUDPartition : public LLBridgePartition
{
public:
- LLHUDPartition();
+ LLHUDPartition(LLViewerRegion* regionp);
virtual void shift(const LLVector4a &offset);
};
diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp
index a4582071e8..89302c3c64 100755
--- a/indra/newview/llspeakers.cpp
+++ b/indra/newview/llspeakers.cpp
@@ -34,7 +34,9 @@
#include "llgroupmgr.h"
#include "llsdutil.h"
#include "lluicolortable.h"
+#include "llhttpclient.h"
#include "llviewerobjectlist.h"
+#include "llviewerregion.h"
#include "llvoavatar.h"
#include "llworld.h"
@@ -268,21 +270,23 @@ bool LLSpeakersDelayActionsStorage::isTimerStarted(const LLUUID& speaker_id)
class ModerationResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(ModerationResponder);
public:
ModerationResponder(const LLUUID& session_id)
{
mSessionID = session_id;
}
- virtual void error(U32 status, const std::string& reason)
+protected:
+ virtual void httpFailure()
{
- llwarns << status << ": " << reason << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
if ( gIMMgr )
{
//403 == you're not a mod
//should be disabled if you're not a moderator
- if ( 403 == status )
+ if ( HTTP_FORBIDDEN == getStatus() )
{
gIMMgr->showSessionEventError(
"mute",
@@ -339,7 +343,7 @@ LLPointer<LLSpeaker> LLSpeakerMgr::setSpeaker(const LLUUID& id, const std::strin
speakerp->mStatus = status;
mSpeakers.insert(std::make_pair(speakerp->mID, speakerp));
mSpeakersSorted.push_back(speakerp);
- LL_DEBUGS("Speakers") << "Added speaker " << id << llendl;
+ LL_DEBUGS("Speakers") << "Added speaker " << id << LL_ENDL;
fireEvent(new LLSpeakerListChangeEvent(this, speakerp->mID), "add");
}
else
@@ -360,7 +364,7 @@ LLPointer<LLSpeaker> LLSpeakerMgr::setSpeaker(const LLUUID& id, const std::strin
}
else
{
- LL_WARNS("Speakers") << "Speaker " << id << " not found" << llendl;
+ LL_WARNS("Speakers") << "Speaker " << id << " not found" << LL_ENDL;
}
}
@@ -424,7 +428,7 @@ void LLSpeakerMgr::update(BOOL resort_ok)
if (moderator_muted_voice != speakerp->mModeratorMutedVoice)
{
speakerp->mModeratorMutedVoice = moderator_muted_voice;
- LL_DEBUGS("Speakers") << (speakerp->mModeratorMutedVoice? "Muted" : "Umuted") << " speaker " << speaker_id<< llendl;
+ LL_DEBUGS("Speakers") << (speakerp->mModeratorMutedVoice? "Muted" : "Umuted") << " speaker " << speaker_id<< LL_ENDL;
speakerp->fireEvent(new LLSpeakerVoiceModerationEvent(speakerp));
}
@@ -621,7 +625,7 @@ bool LLSpeakerMgr::removeSpeaker(const LLUUID& speaker_id)
}
}
- LL_DEBUGS("Speakers") << "Removed speaker " << speaker_id << llendl;
+ LL_DEBUGS("Speakers") << "Removed speaker " << speaker_id << LL_ENDL;
fireEvent(new LLSpeakerListChangeEvent(this, speaker_id), "remove");
update(TRUE);
@@ -739,7 +743,7 @@ void LLIMSpeakerMgr::setSpeakers(const LLSD& speakers)
// Fire event only if moderator changed
if ( is_moderator != speakerp->mIsModerator )
{
- LL_DEBUGS("Speakers") << "Speaker " << agent_id << (is_moderator ? "is now" : "no longer is") << " a moderator" << llendl;
+ LL_DEBUGS("Speakers") << "Speaker " << agent_id << (is_moderator ? "is now" : "no longer is") << " a moderator" << LL_ENDL;
fireEvent(new LLSpeakerUpdateModeratorEvent(speakerp), "update_moderator");
}
}
@@ -794,7 +798,7 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update)
}
else
{
- llwarns << "bad membership list update " << ll_print_sd(agent_data["transition"]) << llendl;
+ LL_WARNS() << "bad membership list update " << ll_print_sd(agent_data["transition"]) << LL_ENDL;
}
}
@@ -812,7 +816,7 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update)
// Fire event only if moderator changed
if ( is_moderator != speakerp->mIsModerator )
{
- LL_DEBUGS("Speakers") << "Speaker " << agent_id << (is_moderator ? "is now" : "no longer is") << " a moderator" << llendl;
+ LL_DEBUGS("Speakers") << "Speaker " << agent_id << (is_moderator ? "is now" : "no longer is") << " a moderator" << LL_ENDL;
fireEvent(new LLSpeakerUpdateModeratorEvent(speakerp), "update_moderator");
}
}
@@ -847,16 +851,13 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update)
}
else
{
- llwarns << "bad membership list update "
- << agent_transition << llendl;
+ LL_WARNS() << "bad membership list update "
+ << agent_transition << LL_ENDL;
}
}
}
}
-/*prep#
- virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content)
- llwarns << "ModerationResponder error [status:" << status << "]: " << content << llendl;
- */
+
void LLIMSpeakerMgr::toggleAllowTextChat(const LLUUID& speaker_id)
{
LLPointer<LLSpeaker> speakerp = findSpeaker(speaker_id);
@@ -972,7 +973,7 @@ void LLActiveSpeakerMgr::updateSpeakerList()
// always populate from active voice channel
if (LLVoiceChannel::getCurrentVoiceChannel() != mVoiceChannel) //MA: seems this is always false
{
- LL_DEBUGS("Speakers") << "Removed all speakers" << llendl;
+ LL_DEBUGS("Speakers") << "Removed all speakers" << LL_ENDL;
fireEvent(new LLSpeakerListChangeEvent(this, LLUUID::null), "clear");
mSpeakers.clear();
mSpeakersSorted.clear();
@@ -1036,7 +1037,7 @@ void LLLocalSpeakerMgr::updateSpeakerList()
if (speakerp->mStatus == LLSpeaker::STATUS_TEXT_ONLY)
{
LLVOAvatar* avatarp = (LLVOAvatar*)gObjectList.findObject(speaker_id);
- if (!avatarp || dist_vec_squared(avatarp->getPositionAgent(), gAgent.getPositionAgent()) > CHAT_NORMAL_RADIUS_SQUARED)
+ if (!avatarp || dist_vec_squared(avatarp->getPositionAgent(), gAgent.getPositionAgent()) > CHAT_NORMAL_RADIUS * CHAT_NORMAL_RADIUS)
{
setSpeakerNotInChannel(speakerp);
}
diff --git a/indra/newview/llspeakingindicatormanager.cpp b/indra/newview/llspeakingindicatormanager.cpp
index 07e9371124..78fe7863c8 100755
--- a/indra/newview/llspeakingindicatormanager.cpp
+++ b/indra/newview/llspeakingindicatormanager.cpp
@@ -279,7 +279,7 @@ void SpeakingIndicatorManager::ensureInstanceDoesNotExist(LLSpeakingIndicator* c
// So, using stored deleted pointer leads to crash. See EXT-4782.
if (it != mSpeakingIndicators.end())
{
- llwarns << "The same instance of indicator has already been registered, removing it: " << it->first << "|"<< speaking_indicator << llendl;
+ LL_WARNS() << "The same instance of indicator has already been registered, removing it: " << it->first << "|"<< speaking_indicator << LL_ENDL;
llassert(it == mSpeakingIndicators.end());
mSpeakingIndicators.erase(it);
}
diff --git a/indra/newview/llsrv.cpp b/indra/newview/llsrv.cpp
index 567c2a0158..8b9aead165 100755
--- a/indra/newview/llsrv.cpp
+++ b/indra/newview/llsrv.cpp
@@ -35,7 +35,7 @@ struct Responder : public LLAres::UriRewriteResponder
void rewriteResult(const std::vector<std::string> &uris) {
for (size_t i = 0; i < uris.size(); i++)
{
- llinfos << "[" << i << "] " << uris[i] << llendl;
+ LL_INFOS() << "[" << i << "] " << uris[i] << LL_ENDL;
}
mUris = uris;
}
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index d4b3fcf28a..9da7717b74 100755
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -75,7 +75,6 @@
#include "llsd.h"
#include "llsdserialize.h"
#include "llsdutil_math.h"
-#include "llsecondlifeurls.h"
#include "llstring.h"
#include "lluserrelations.h"
#include "llversioninfo.h"
@@ -84,7 +83,6 @@
#include "llvfs.h"
#include "llxorcipher.h" // saved password, MAC address
#include "llwindow.h"
-#include "imageids.h"
#include "message.h"
#include "v3math.h"
@@ -133,7 +131,6 @@
#include "llpreviewscript.h"
#include "llproxy.h"
#include "llproductinforequest.h"
-#include "llsecondlifeurls.h"
#include "llselectmgr.h"
#include "llsky.h"
#include "llstatview.h"
@@ -243,6 +240,7 @@ static LLVector3 gAgentStartLookAt(1.0f, 0.f, 0.f);
static std::string gAgentStartLocation = "safe";
static bool mLoginStatePastUI = false;
+const S32 DEFAULT_MAX_AGENT_GROUPS = 25;
boost::scoped_ptr<LLEventPump> LLStartUp::sStateWatcher(new LLEventStream("StartupState"));
boost::scoped_ptr<LLStartupListener> LLStartUp::sListener(new LLStartupListener());
@@ -313,6 +311,12 @@ void update_texture_fetch()
gTextureList.updateImages(0.10f);
}
+void set_flags_and_update_appearance()
+{
+ LLAppearanceMgr::instance().setAttachmentInvLinkEnable(true);
+ LLAppearanceMgr::instance().updateAppearanceFromCOF(true, true, no_op);
+}
+
// Returns false to skip other idle processing. Should only return
// true when all initialization done.
bool idle_startup()
@@ -624,30 +628,27 @@ bool idle_startup()
if (FALSE == gSavedSettings.getBOOL("NoAudio"))
{
+ delete gAudiop;
gAudiop = NULL;
#ifdef LL_FMODEX
- if (!gAudiop
#if !LL_WINDOWS
- && NULL == getenv("LL_BAD_FMODEX_DRIVER")
+ if (NULL == getenv("LL_BAD_FMODEX_DRIVER"))
#endif // !LL_WINDOWS
- )
{
gAudiop = (LLAudioEngine *) new LLAudioEngine_FMODEX(gSavedSettings.getBOOL("FMODExProfilerEnable"));
}
#endif
#ifdef LL_OPENAL
- if (!gAudiop
#if !LL_WINDOWS
- && NULL == getenv("LL_BAD_OPENAL_DRIVER")
+ if (NULL == getenv("LL_BAD_OPENAL_DRIVER"))
#endif // !LL_WINDOWS
- )
{
gAudiop = (LLAudioEngine *) new LLAudioEngine_OpenAL();
}
#endif
-
+
if (gAudiop)
{
#if LL_WINDOWS
@@ -1195,6 +1196,7 @@ bool idle_startup()
// create the default proximal channel
LLVoiceChannel::initClass();
LLStartUp::setStartupState( STATE_WORLD_INIT);
+ LLTrace::get_frame_recording().reset();
}
else
{
@@ -1291,6 +1293,8 @@ bool idle_startup()
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(gFirstSimHandle);
LL_INFOS("AppInit") << "Adding initial simulator " << regionp->getOriginGlobal() << LL_ENDL;
+ LL_DEBUGS("CrossingCaps") << "Calling setSeedCapability from init_idle(). Seed cap == "
+ << gFirstSimSeedCap << LL_ENDL;
regionp->setSeedCapability(gFirstSimSeedCap);
LL_DEBUGS("AppInit") << "Waiting for seed grant ...." << LL_ENDL;
display_startup();
@@ -1440,8 +1444,8 @@ bool idle_startup()
LL_DEBUGS("AppInit") << "Initializing camera..." << LL_ENDL;
gFrameTime = totalTime();
- F32 last_time = gFrameTimeSeconds;
- gFrameTimeSeconds = (S64)(gFrameTime - gStartTime)/SEC_TO_MICROSEC;
+ F32Seconds last_time = gFrameTimeSeconds;
+ gFrameTimeSeconds = (gFrameTime - gStartTime);
gFrameIntervalSeconds = gFrameTimeSeconds - last_time;
if (gFrameIntervalSeconds < 0.f)
@@ -1518,7 +1522,7 @@ bool idle_startup()
gFirstSim,
gSavedSettings.getS32("UseCircuitCodeMaxRetries"),
FALSE,
- gSavedSettings.getF32("UseCircuitCodeTimeout"),
+ (F32Seconds)gSavedSettings.getF32("UseCircuitCodeTimeout"),
use_circuit_callback,
NULL);
@@ -1686,7 +1690,7 @@ bool idle_startup()
LLSD inv_basic = response["inventory-basic"];
if(inv_basic.isDefined())
{
- llinfos << "Basic inventory root folder id is " << inv_basic["folder_id"] << llendl;
+ LL_INFOS() << "Basic inventory root folder id is " << inv_basic["folder_id"] << LL_ENDL;
}
LLSD buddy_list = response["buddy-list"];
@@ -1775,36 +1779,45 @@ bool idle_startup()
// This method MUST be called before gInventory.findCategoryUUIDForType because of
// gInventory.mIsAgentInvUsable is set to true in the gInventory.buildParentChildMap.
gInventory.buildParentChildMap();
+ gInventory.createCommonSystemCategories();
+
+ // It's debatable whether this flag is a good idea - sets all
+ // bits, and in general it isn't true that inventory
+ // initialization generates all types of changes. Maybe add an
+ // INITIALIZE mask bit instead?
+ gInventory.addChangedMask(LLInventoryObserver::ALL, LLUUID::null);
+ gInventory.notifyObservers();
+
display_startup();
//all categories loaded. lets create "My Favorites" category
gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE,true);
// set up callbacks
- llinfos << "Registering Callbacks" << llendl;
+ LL_INFOS() << "Registering Callbacks" << LL_ENDL;
LLMessageSystem* msg = gMessageSystem;
- llinfos << " Inventory" << llendl;
+ LL_INFOS() << " Inventory" << LL_ENDL;
LLInventoryModel::registerCallbacks(msg);
- llinfos << " AvatarTracker" << llendl;
+ LL_INFOS() << " AvatarTracker" << LL_ENDL;
LLAvatarTracker::instance().registerCallbacks(msg);
- llinfos << " Landmark" << llendl;
+ LL_INFOS() << " Landmark" << LL_ENDL;
LLLandmark::registerCallbacks(msg);
display_startup();
// request mute list
- llinfos << "Requesting Mute List" << llendl;
+ LL_INFOS() << "Requesting Mute List" << LL_ENDL;
LLMuteList::getInstance()->requestFromServer(gAgent.getID());
display_startup();
// Get L$ and ownership credit information
- llinfos << "Requesting Money Balance" << llendl;
+ LL_INFOS() << "Requesting Money Balance" << LL_ENDL;
LLStatusBar::sendMoneyBalanceRequest();
display_startup();
// request all group information
- llinfos << "Requesting Agent Data" << llendl;
+ LL_INFOS() << "Requesting Agent Data" << LL_ENDL;
gAgent.sendAgentDataUpdateRequest();
display_startup();
// Create the inventory views
- llinfos << "Creating Inventory Views" << llendl;
+ LL_INFOS() << "Creating Inventory Views" << LL_ENDL;
LLFloaterReg::getInstance("inventory");
display_startup();
LLStartUp::setStartupState( STATE_MISC );
@@ -1878,19 +1891,6 @@ bool idle_startup()
display_startup();
- // based on the comments, we've successfully logged in so we can delete the 'forced'
- // URL that the updater set in settings.ini (in a mostly paranoid fashion)
- std::string nextLoginLocation = gSavedSettings.getString( "NextLoginLocation" );
- if ( nextLoginLocation.length() )
- {
- // clear it
- gSavedSettings.setString( "NextLoginLocation", "" );
-
- // and make sure it's saved
- gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE );
- LLUIColorTable::instance().saveUserSettings();
- };
-
display_startup();
// JC: Initializing audio requests many sounds for download.
init_audio();
@@ -1942,6 +1942,7 @@ bool idle_startup()
LL_DEBUGS("AppInit") << "Initialization complete" << LL_ENDL;
+ LL_DEBUGS("SceneLoadTiming", "Start") << "Scene Load Started " << LL_ENDL;
gRenderStartTime.reset();
gForegroundTime.reset();
@@ -1958,7 +1959,7 @@ bool idle_startup()
// thus, do not show this alert.
if (!gAgent.isFirstLogin())
{
- llinfos << "gAgentStartLocation : " << gAgentStartLocation << llendl;
+ LL_INFOS() << "gAgentStartLocation : " << gAgentStartLocation << LL_ENDL;
LLSLURL start_slurl = LLStartUp::getStartSLURL();
LL_DEBUGS("AppInit") << "start slurl "<<start_slurl.asString()<<LL_ENDL;
@@ -1966,10 +1967,9 @@ bool idle_startup()
((start_slurl.getType() == LLSLURL::LAST_LOCATION) && (gAgentStartLocation == "last")) ||
((start_slurl.getType() == LLSLURL::HOME_LOCATION) && (gAgentStartLocation == "home")))
{
- // Start location is OK
- // Disabled code to restore camera location and focus if logging in to default location
- static bool samename = false;
- if (samename)
+ if (start_slurl.getType() == LLSLURL::LAST_LOCATION
+ && gAgentStartLocation == "last"
+ && gSavedSettings.getBOOL("RestoreCameraPosOnLogin"))
{
// restore old camera pos
gAgentCamera.setFocusOnAvatar(FALSE, FALSE);
@@ -2022,7 +2022,7 @@ bool idle_startup()
{
display_startup();
F32 timeout_frac = timeout.getElapsedTimeF32()/PRECACHING_DELAY;
-
+
// We now have an inventory skeleton, so if this is a user's first
// login, we can start setting up their clothing and avatar
// appearance. This helps to avoid the generic "Ruth" avatar in
@@ -2031,20 +2031,40 @@ bool idle_startup()
&& !sInitialOutfit.empty() // registration set up an outfit
&& !sInitialOutfitGender.empty() // and a gender
&& isAgentAvatarValid() // can't wear clothes without object
- && !gAgent.isGenderChosen() ) // nothing already loading
+ && !gAgent.isOutfitChosen()) // nothing already loading
{
// Start loading the wearables, textures, gestures
LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender );
}
+ // If not first login, we need to fetch COF contents and
+ // compute appearance from that.
+ if (isAgentAvatarValid() && !gAgent.isFirstLogin() && !gAgent.isOutfitChosen())
+ {
+ gAgentWearables.notifyLoadingStarted();
+ gAgent.setOutfitChosen(TRUE);
+ gAgentWearables.sendDummyAgentWearablesUpdate();
+ callAfterCategoryFetch(LLAppearanceMgr::instance().getCOF(), set_flags_and_update_appearance);
+ }
display_startup();
// wait precache-delay and for agent's avatar or a lot longer.
- if(((timeout_frac > 1.f) && isAgentAvatarValid())
- || (timeout_frac > 3.f))
+ if ((timeout_frac > 1.f) && isAgentAvatarValid())
{
LLStartUp::setStartupState( STATE_WEARABLES_WAIT );
}
+ else if (timeout_frac > 10.f)
+ {
+ // If we exceed the wait above while isAgentAvatarValid is
+ // not true yet, we will change startup state and
+ // eventually (once avatar does get created) wind up at
+ // the gender chooser. This should occur only in very
+ // unusual circumstances, so set the timeout fairly high
+ // to minimize mistaken hits here.
+ LL_WARNS() << "Wait for valid avatar state exceeded "
+ << timeout.getElapsedTimeF32() << " will invoke gender chooser" << LL_ENDL;
+ LLStartUp::setStartupState( STATE_WEARABLES_WAIT );
+ }
else
{
update_texture_fetch();
@@ -2062,13 +2082,13 @@ bool idle_startup()
static LLFrameTimer wearables_timer;
const F32 wearables_time = wearables_timer.getElapsedTimeF32();
- const F32 MAX_WEARABLES_TIME = 10.f;
+ static LLCachedControl<F32> max_wearables_time(gSavedSettings, "ClothingLoadingDelay");
- if (!gAgent.isGenderChosen() && isAgentAvatarValid())
+ if (!gAgent.isOutfitChosen() && isAgentAvatarValid())
{
- // No point in waiting for clothing, we don't even
- // know what gender we are. Pop a dialog to ask and
- // proceed to draw the world. JC
+ // No point in waiting for clothing, we don't even know
+ // what outfit we want. Pop up a gender chooser dialog to
+ // ask and proceed to draw the world. JC
//
// *NOTE: We might hit this case even if we have an
// initial outfit, but if the load hasn't started
@@ -2077,26 +2097,25 @@ bool idle_startup()
LLNotificationsUtil::add("WelcomeChooseSex", LLSD(), LLSD(),
callback_choose_gender);
LLStartUp::setStartupState( STATE_CLEANUP );
- return TRUE;
}
display_startup();
- if (wearables_time > MAX_WEARABLES_TIME)
+ if (gAgent.isOutfitChosen() && (wearables_time > max_wearables_time))
{
LLNotificationsUtil::add("ClothingLoading");
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_WEARABLES_TOO_LONG);
+ record(LLStatViewer::LOADING_WEARABLES_LONG_DELAY, wearables_time);
LLStartUp::setStartupState( STATE_CLEANUP );
- return TRUE;
}
-
- if (gAgent.isFirstLogin())
+ else if (gAgent.isFirstLogin()
+ && isAgentAvatarValid()
+ && gAgentAvatarp->isFullyLoaded())
{
// wait for avatar to be completely loaded
if (isAgentAvatarValid()
&& gAgentAvatarp->isFullyLoaded())
{
- //llinfos << "avatar fully loaded" << llendl;
+ LL_DEBUGS("Avatar") << "avatar fully loaded" << LL_ENDL;
LLStartUp::setStartupState( STATE_CLEANUP );
return TRUE;
}
@@ -2107,20 +2126,12 @@ bool idle_startup()
if ( gAgentWearables.areWearablesLoaded() )
{
// We have our clothing, proceed.
- //llinfos << "wearables loaded" << llendl;
+ LL_DEBUGS("Avatar") << "wearables loaded" << LL_ENDL;
LLStartUp::setStartupState( STATE_CLEANUP );
return TRUE;
}
}
-
- display_startup();
- update_texture_fetch();
- display_startup();
- set_startup_status(0.9f + 0.1f * wearables_time / MAX_WEARABLES_TIME,
- LLTrans::getString("LoginDownloadingClothing").c_str(),
- gAgent.mMOTD.c_str());
- display_startup();
- return TRUE;
+ //fall through this frame to STATE_CLEANUP
}
if (STATE_CLEANUP == LLStartUp::getStartupState())
@@ -2182,7 +2193,7 @@ bool idle_startup()
// Unmute audio if desired and setup volumes.
// This is a not-uncommon crash site, so surround it with
- // llinfos output to aid diagnosis.
+ // LL_INFOS() output to aid diagnosis.
LL_INFOS("AppInit") << "Doing first audio_update_volume..." << LL_ENDL;
audio_update_volume();
LL_INFOS("AppInit") << "Done first audio_update_volume." << LL_ENDL;
@@ -2190,15 +2201,8 @@ bool idle_startup()
// reset keyboard focus to sane state of pointing at world
gFocusMgr.setKeyboardFocus(NULL);
-#if 0 // sjb: enable for auto-enabling timer display
- gDebugView->mFastTimerView->setVisible(TRUE);
-#endif
-
LLAppViewer::instance()->handleLoginComplete();
- // reset timers now that we are running "logged in" logic
- LLFastTimer::reset();
-
LLAgentPicksInfo::getInstance()->requestNumberOfPicks();
display_startup();
@@ -2209,7 +2213,6 @@ bool idle_startup()
return TRUE;
}
- LL_WARNS("AppInit") << "Reached end of idle_startup for state " << LLStartUp::getStartupState() << LL_ENDL;
return TRUE;
}
@@ -2372,8 +2375,6 @@ void register_viewer_callbacks(LLMessageSystem* msg)
msg->setHandlerFuncFast(_PREHASH_RemoveNameValuePair, process_remove_name_value);
msg->setHandlerFuncFast(_PREHASH_AvatarAnimation, process_avatar_animation);
msg->setHandlerFuncFast(_PREHASH_AvatarAppearance, process_avatar_appearance);
- msg->setHandlerFunc("AgentCachedTextureResponse", LLAgent::processAgentCachedTextureResponse);
- msg->setHandlerFunc("RebakeAvatarTextures", LLVOAvatarSelf::processRebakeAvatarTextures);
msg->setHandlerFuncFast(_PREHASH_CameraConstraint, process_camera_constraint);
msg->setHandlerFuncFast(_PREHASH_AvatarSitResponse, process_avatar_sit_response);
msg->setHandlerFunc("SetFollowCamProperties", process_set_follow_cam_properties);
@@ -2447,9 +2448,6 @@ void register_viewer_callbacks(LLMessageSystem* msg)
// msg->setHandlerFuncFast(_PREHASH_ReputationIndividualReply,
// LLFloaterRate::processReputationIndividualReply);
- msg->setHandlerFuncFast(_PREHASH_AgentWearablesUpdate,
- LLAgentWearables::processAgentInitialWearablesUpdate );
-
msg->setHandlerFunc("ScriptControlChange",
LLAgent::processScriptControlChange );
@@ -2553,7 +2551,7 @@ bool callback_choose_gender(const LLSD& notification, const LLSD& response)
void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name,
const std::string& gender_name )
{
- lldebugs << "starting" << llendl;
+ LL_DEBUGS() << "starting" << LL_ENDL;
// Not going through the processAgentInitialWearables path, so need to set this here.
LLAppearanceMgr::instance().setAttachmentInvLinkEnable(true);
@@ -2563,18 +2561,18 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name,
ESex gender;
if (gender_name == "male")
{
- lldebugs << "male" << llendl;
+ LL_DEBUGS() << "male" << LL_ENDL;
gender = SEX_MALE;
}
else
{
- lldebugs << "female" << llendl;
+ LL_DEBUGS() << "female" << LL_ENDL;
gender = SEX_FEMALE;
}
if (!isAgentAvatarValid())
{
- llwarns << "Trying to load an initial outfit for an invalid agent avatar" << llendl;
+ LL_WARNS() << "Trying to load an initial outfit for an invalid agent avatar" << LL_ENDL;
return;
}
@@ -2587,7 +2585,7 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name,
outfit_folder_name);
if (cat_id.isNull())
{
- lldebugs << "standard wearables" << llendl;
+ LL_DEBUGS() << "standard wearables" << LL_ENDL;
gAgentWearables.createStandardWearables();
}
else
@@ -2603,28 +2601,27 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name,
// Need to fetch cof contents before we can wear.
callAfterCategoryFetch(LLAppearanceMgr::instance().getCOF(),
boost::bind(&LLAppearanceMgr::wearInventoryCategory, LLAppearanceMgr::getInstance(), cat, do_copy, do_append));
- lldebugs << "initial outfit category id: " << cat_id << llendl;
+ LL_DEBUGS() << "initial outfit category id: " << cat_id << LL_ENDL;
}
- // This is really misnamed -- it means we have started loading
- // an outfit/shape that will give the avatar a gender eventually. JC
- gAgent.setGenderChosen(TRUE);
+ gAgent.setOutfitChosen(TRUE);
+ gAgentWearables.sendDummyAgentWearablesUpdate();
}
//static
void LLStartUp::saveInitialOutfit()
{
if (sInitialOutfit.empty()) {
- lldebugs << "sInitialOutfit is empty" << llendl;
+ LL_DEBUGS() << "sInitialOutfit is empty" << LL_ENDL;
return;
}
if (sWearablesLoadedCon.connected())
{
- lldebugs << "sWearablesLoadedCon is connected, disconnecting" << llendl;
+ LL_DEBUGS("Avatar") << "sWearablesLoadedCon is connected, disconnecting" << LL_ENDL;
sWearablesLoadedCon.disconnect();
}
- lldebugs << "calling makeNewOutfitLinks( \"" << sInitialOutfit << "\" )" << llendl;
+ LL_DEBUGS("Avatar") << "calling makeNewOutfitLinks( \"" << sInitialOutfit << "\" )" << LL_ENDL;
LLAppearanceMgr::getInstance()->makeNewOutfitLinks(sInitialOutfit,false);
}
@@ -2822,6 +2819,7 @@ void LLStartUp::initNameCache()
// capabilities for display name lookup
LLAvatarNameCache::initClass(false,gSavedSettings.getBOOL("UsePeopleAPI"));
LLAvatarNameCache::setUseDisplayNames(gSavedSettings.getBOOL("UseDisplayNames"));
+ LLAvatarNameCache::setUseUsernames(gSavedSettings.getBOOL("NameTagShowUsernames"));
}
void LLStartUp::cleanupNameCache()
@@ -3163,7 +3161,7 @@ void apply_udp_blacklist(const std::string& csv)
}
std::string item(csv, start, comma-start);
- lldebugs << "udp_blacklist " << item << llendl;
+ LL_DEBUGS() << "udp_blacklist " << item << LL_ENDL;
gMessageSystem->banUdpMessage(item);
start = comma + 1;
@@ -3369,7 +3367,11 @@ bool process_login_success_response()
flag = login_flags["gendered"].asString();
if(flag == "Y")
{
- gAgent.setGenderChosen(TRUE);
+ // We don't care about this flag anymore; now base whether
+ // outfit is chosen on COF contents, initial outfit
+ // requested and available, etc.
+
+ //gAgent.setGenderChosen(TRUE);
}
bool pacific_daylight_time = false;
diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h
index 760e38890b..e39810713a 100755
--- a/indra/newview/llstartup.h
+++ b/indra/newview/llstartup.h
@@ -45,6 +45,18 @@ bool login_alert_done(const LLSD& notification, const LLSD& response);
extern std::string SCREEN_HOME_FILENAME;
extern std::string SCREEN_LAST_FILENAME;
+// start location constants
+enum EStartLocation
+{
+ START_LOCATION_ID_LAST,
+ START_LOCATION_ID_HOME,
+ START_LOCATION_ID_DIRECT,
+ START_LOCATION_ID_PARCEL,
+ START_LOCATION_ID_TELEHUB,
+ START_LOCATION_ID_URL,
+ START_LOCATION_ID_COUNT
+};
+
typedef enum {
STATE_FIRST, // Initial startup
STATE_BROWSER_INIT, // Initialize web browser for login screen
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index ff69c6e9fd..eedb829b48 100755
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -37,7 +37,6 @@
#include "llviewercontrol.h"
#include "llfloaterbuycurrency.h"
#include "llbuycurrencyhtml.h"
-#include "llfloaterlagmeter.h"
#include "llpanelnearbymedia.h"
#include "llpanelvolumepulldown.h"
#include "llfloaterregioninfo.h"
@@ -73,7 +72,6 @@
#include "lltrans.h"
// library includes
-#include "imageids.h"
#include "llfloaterreg.h"
#include "llfontgl.h"
#include "llrect.h"
@@ -199,10 +197,11 @@ BOOL LLStatusBar::postBuild()
sgp.rect(r);
sgp.follows.flags(FOLLOWS_BOTTOM | FOLLOWS_RIGHT);
sgp.mouse_opaque(false);
+ sgp.stat.count_stat_float(&LLStatViewer::ACTIVE_MESSAGE_DATA_RECEIVED);
+ sgp.units("Kbps");
+ sgp.precision(0);
+ sgp.per_sec(true);
mSGBandwidth = LLUICtrlFactory::create<LLStatGraph>(sgp);
- mSGBandwidth->setStat(&LLViewerStats::getInstance()->mKBitStat);
- mSGBandwidth->setUnits("Kbps");
- mSGBandwidth->setPrecision(0);
addChild(mSGBandwidth);
x -= SIM_STAT_WIDTH + 2;
@@ -213,17 +212,20 @@ BOOL LLStatusBar::postBuild()
pgp.rect(r);
pgp.follows.flags(FOLLOWS_BOTTOM | FOLLOWS_RIGHT);
pgp.mouse_opaque(false);
+ pgp.stat.sample_stat_float(&LLStatViewer::PACKETS_LOST_PERCENT);
+ pgp.units("%");
+ pgp.min(0.f);
+ pgp.max(5.f);
+ pgp.precision(1);
+ pgp.per_sec(false);
+ LLStatGraph::Thresholds thresholds;
+ thresholds.threshold.add(LLStatGraph::ThresholdParams().value(0.1).color(LLColor4::green))
+ .add(LLStatGraph::ThresholdParams().value(0.25f).color(LLColor4::yellow))
+ .add(LLStatGraph::ThresholdParams().value(0.6f).color(LLColor4::red));
+
+ pgp.thresholds(thresholds);
mSGPacketLoss = LLUICtrlFactory::create<LLStatGraph>(pgp);
- mSGPacketLoss->setStat(&LLViewerStats::getInstance()->mPacketsLostPercentStat);
- mSGPacketLoss->setUnits("%");
- mSGPacketLoss->setMin(0.f);
- mSGPacketLoss->setMax(5.f);
- mSGPacketLoss->setThreshold(0, 0.5f);
- mSGPacketLoss->setThreshold(1, 1.f);
- mSGPacketLoss->setThreshold(2, 3.f);
- mSGPacketLoss->setPrecision(1);
- mSGPacketLoss->mPerSec = FALSE;
addChild(mSGPacketLoss);
mPanelVolumePulldown = new LLPanelVolumePulldown();
@@ -253,9 +255,9 @@ void LLStatusBar::refresh()
F32 bwtotal = gViewerThrottle.getMaxBandwidth() / 1000.f;
mSGBandwidth->setMin(0.f);
mSGBandwidth->setMax(bwtotal*1.25f);
- mSGBandwidth->setThreshold(0, bwtotal*0.75f);
- mSGBandwidth->setThreshold(1, bwtotal);
- mSGBandwidth->setThreshold(2, bwtotal);
+ //mSGBandwidth->setThreshold(0, bwtotal*0.75f);
+ //mSGBandwidth->setThreshold(1, bwtotal);
+ //mSGBandwidth->setThreshold(2, bwtotal);
}
// update clock every 10 seconds
@@ -390,7 +392,7 @@ void LLStatusBar::sendMoneyBalanceRequest()
void LLStatusBar::setHealth(S32 health)
{
- //llinfos << "Setting health to: " << buffer << llendl;
+ //LL_INFOS() << "Setting health to: " << buffer << LL_ENDL;
if( mHealth > health )
{
if (mHealth > (health + gSavedSettings.getF32("UISndHealthReductionThreshold")))
diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp
index 93c7f54101..e75af8db53 100755
--- a/indra/newview/llsurface.cpp
+++ b/indra/newview/llsurface.cpp
@@ -34,7 +34,7 @@
#include "llpatchvertexarray.h"
#include "patch_dct.h"
#include "patch_code.h"
-#include "bitpack.h"
+#include "llbitpack.h"
#include "llviewerobjectlist.h"
#include "llregionhandle.h"
#include "llagent.h"
@@ -123,7 +123,7 @@ LLSurface::~LLSurface()
LLDrawPoolTerrain *poolp = (LLDrawPoolTerrain*) gPipeline.findPool(LLDrawPool::POOL_TERRAIN, mSTexturep);
if (!poolp)
{
- llwarns << "No pool for terrain on destruction!" << llendl;
+ LL_WARNS() << "No pool for terrain on destruction!" << LL_ENDL;
}
else if (poolp->mReferences.empty())
{
@@ -140,7 +140,7 @@ LLSurface::~LLSurface()
}
else
{
- llerrs << "Terrain pool not empty!" << llendl;
+ LL_ERRS() << "Terrain pool not empty!" << LL_ENDL;
}
}
@@ -709,7 +709,7 @@ void LLSurface::decompressDCTPatch(LLBitPack &bitpack, LLGroupHeader *gopp, BOOL
if ((i >= mPatchesPerEdge) || (j >= mPatchesPerEdge))
{
- llwarns << "Received invalid terrain packet - patch header patch ID incorrect!"
+ LL_WARNS() << "Received invalid terrain packet - patch header patch ID incorrect!"
<< " patches per edge " << mPatchesPerEdge
<< " i " << i
<< " j " << j
@@ -717,7 +717,7 @@ void LLSurface::decompressDCTPatch(LLBitPack &bitpack, LLGroupHeader *gopp, BOOL
<< " range " << (S32)ph.range
<< " quant_wbits " << (S32)ph.quant_wbits
<< " patchids " << (S32)ph.patchids
- << llendl;
+ << LL_ENDL;
LLAppViewer::instance()->badNetworkHandler();
return;
}
@@ -955,13 +955,13 @@ LLSurfacePatch *LLSurface::resolvePatchRegion(const F32 x, const F32 y) const
{
if(0 == mNumberOfPatches)
{
- llwarns << "No patches for current region!" << llendl;
+ LL_WARNS() << "No patches for current region!" << LL_ENDL;
return NULL;
}
S32 old_index = index;
index = llclamp(old_index, 0, (mNumberOfPatches - 1));
- llwarns << "Clamping out of range patch index " << old_index
- << " to " << index << llendl;
+ LL_WARNS() << "Clamping out of range patch index " << old_index
+ << " to " << index << LL_ENDL;
}
return &(mPatchList[index]);
}
@@ -1150,12 +1150,12 @@ LLSurfacePatch *LLSurface::getPatch(const S32 x, const S32 y) const
{
if ((x < 0) || (x >= mPatchesPerEdge))
{
- llerrs << "Asking for patch out of bounds" << llendl;
+ LL_ERRS() << "Asking for patch out of bounds" << LL_ENDL;
return NULL;
}
if ((y < 0) || (y >= mPatchesPerEdge))
{
- llerrs << "Asking for patch out of bounds" << llendl;
+ LL_ERRS() << "Asking for patch out of bounds" << LL_ENDL;
return NULL;
}
@@ -1194,7 +1194,7 @@ void LLSurface::setWaterHeight(F32 height)
}
else
{
- llwarns << "LLSurface::setWaterHeight with no water object!" << llendl;
+ LL_WARNS() << "LLSurface::setWaterHeight with no water object!" << LL_ENDL;
}
}
diff --git a/indra/newview/llsurface.h b/indra/newview/llsurface.h
index 9d24bf8771..33a64ae7d5 100755
--- a/indra/newview/llsurface.h
+++ b/indra/newview/llsurface.h
@@ -45,7 +45,6 @@
class LLTimer;
class LLUUID;
class LLAgent;
-class LLStat;
static const U8 NO_EDGE = 0x00;
static const U8 EAST_EDGE = 0x01;
diff --git a/indra/newview/llsurfacepatch.cpp b/indra/newview/llsurfacepatch.cpp
index a9ba2bce9c..2d06b8599c 100755
--- a/indra/newview/llsurfacepatch.cpp
+++ b/indra/newview/llsurfacepatch.cpp
@@ -33,7 +33,6 @@
#include "llsurface.h"
#include "pipeline.h"
#include "llagent.h"
-#include "timing.h"
#include "llsky.h"
#include "llviewercamera.h"
@@ -44,11 +43,11 @@
#include "noise.h"
extern bool gShiftFrame;
-extern U64 gFrameTime;
+extern U64MicrosecondsImplicit gFrameTime;
extern LLPipeline gPipeline;
-LLSurfacePatch::LLSurfacePatch() :
- mHasReceivedData(FALSE),
+LLSurfacePatch::LLSurfacePatch()
+: mHasReceivedData(FALSE),
mSTexUpdate(FALSE),
mDirty(FALSE),
mDirtyZStats(TRUE),
@@ -100,7 +99,7 @@ void LLSurfacePatch::dirty()
}
else
{
- llwarns << "No viewer object for this surface patch!" << llendl;
+ LL_WARNS() << "No viewer object for this surface patch!" << LL_ENDL;
}
mDirtyZStats = TRUE;
diff --git a/indra/newview/llsyntaxid.cpp b/indra/newview/llsyntaxid.cpp
new file mode 100644
index 0000000000..a763d42a8d
--- /dev/null
+++ b/indra/newview/llsyntaxid.cpp
@@ -0,0 +1,329 @@
+/**
+ * @file LLSyntaxId
+ * @brief Handles downloading, saving, and checking of LSL keyword/syntax files
+ * for each region.
+ * @author Ima Mechanique, Cinder Roxley
+ *
+ * $LicenseInfo:firstyear=2013&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2013, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llsyntaxid.h"
+#include "llagent.h"
+#include "llappviewer.h"
+#include "llhttpclient.h"
+#include "llsdserialize.h"
+#include "llviewerregion.h"
+
+//-----------------------------------------------------------------------------
+// fetchKeywordsFileResponder
+//-----------------------------------------------------------------------------
+class fetchKeywordsFileResponder : public LLHTTPClient::Responder
+{
+public:
+ fetchKeywordsFileResponder(const std::string& filespec)
+ : mFileSpec(filespec)
+ {
+ LL_DEBUGS("SyntaxLSL") << "Instantiating with file saving to: '" << filespec << "'" << LL_ENDL;
+ }
+
+ /* virtual */ void httpFailure()
+ {
+ LL_WARNS("SyntaxLSL") << "failed to fetch syntax file [status:" << getStatus() << "]: " << getContent() << LL_ENDL;
+ }
+
+ /* virtual */ void httpSuccess()
+ {
+ // Continue only if a valid LLSD object was returned.
+ const LLSD& content = getContent();
+ if (content.isMap())
+ {
+ if (LLSyntaxIdLSL::getInstance()->isSupportedVersion(content))
+ {
+ LLSyntaxIdLSL::getInstance()->setKeywordsXml(content);
+
+ cacheFile(content);
+ LLSyntaxIdLSL::getInstance()->handleFileFetched(mFileSpec);
+ }
+ else
+ {
+ LL_WARNS("SyntaxLSL") << "Unknown or unsupported version of syntax file." << LL_ENDL;
+ }
+ }
+ else
+ {
+ LL_WARNS("SyntaxLSL") << "Syntax file '" << mFileSpec << "' contains invalid LLSD." << LL_ENDL;
+ }
+ }
+
+ void cacheFile(const LLSD& content_ref)
+ {
+ std::stringstream str;
+ LLSDSerialize::toXML(content_ref, str);
+ const std::string xml = str.str();
+
+ // save the str to disk, usually to the cache.
+ llofstream file(mFileSpec, std::ios_base::out);
+ file.write(xml.c_str(), str.str().size());
+ file.close();
+
+ LL_DEBUGS("SyntaxLSL") << "Syntax file received, saving as: '" << mFileSpec << "'" << LL_ENDL;
+ }
+
+private:
+ std::string mFileSpec;
+};
+
+//-----------------------------------------------------------------------------
+// LLSyntaxIdLSL
+//-----------------------------------------------------------------------------
+const std::string SYNTAX_ID_CAPABILITY_NAME = "LSLSyntax";
+const std::string SYNTAX_ID_SIMULATOR_FEATURE = "LSLSyntaxId";
+const std::string FILENAME_DEFAULT = "keywords_lsl_default.xml";
+
+/**
+ * @brief LLSyntaxIdLSL constructor
+ */
+LLSyntaxIdLSL::LLSyntaxIdLSL()
+: mKeywordsXml(LLSD())
+, mCapabilityURL(std::string())
+, mFilePath(LL_PATH_APP_SETTINGS)
+, mSyntaxId(LLUUID())
+{
+ loadDefaultKeywordsIntoLLSD();
+ mRegionChangedCallback = gAgent.addRegionChangedCallback(boost::bind(&LLSyntaxIdLSL::handleRegionChanged, this));
+ handleRegionChanged(); // Kick off an initial caps query and fetch
+}
+
+void LLSyntaxIdLSL::buildFullFileSpec()
+{
+ ELLPath path = mSyntaxId.isNull() ? LL_PATH_APP_SETTINGS : LL_PATH_CACHE;
+ const std::string filename = mSyntaxId.isNull() ? FILENAME_DEFAULT : "keywords_lsl_" + mSyntaxId.asString() + ".llsd.xml";
+ mFullFileSpec = gDirUtilp->getExpandedFilename(path, filename);
+}
+
+//-----------------------------------------------------------------------------
+// syntaxIdChange()
+//-----------------------------------------------------------------------------
+bool LLSyntaxIdLSL::syntaxIdChanged()
+{
+ LLViewerRegion* region = gAgent.getRegion();
+
+ if (region)
+ {
+ if (region->capabilitiesReceived())
+ {
+ LLSD sim_features;
+ region->getSimulatorFeatures(sim_features);
+
+ if (sim_features.has(SYNTAX_ID_SIMULATOR_FEATURE))
+ {
+ // get and check the hash
+ LLUUID new_syntax_id = sim_features[SYNTAX_ID_SIMULATOR_FEATURE].asUUID();
+ mCapabilityURL = region->getCapability(SYNTAX_ID_CAPABILITY_NAME);
+ LL_DEBUGS("SyntaxLSL") << SYNTAX_ID_SIMULATOR_FEATURE << " capability URL: " << mCapabilityURL << LL_ENDL;
+ if (new_syntax_id != mSyntaxId)
+ {
+ LL_DEBUGS("SyntaxLSL") << "New SyntaxID '" << new_syntax_id << "' found." << LL_ENDL;
+ mSyntaxId = new_syntax_id;
+ return true;
+ }
+ else
+ LL_DEBUGS("SyntaxLSL") << "SyntaxID matches what we have." << LL_ENDL;
+ }
+ }
+ else
+ {
+ region->setCapabilitiesReceivedCallback(boost::bind(&LLSyntaxIdLSL::handleCapsReceived, this, _1));
+ LL_DEBUGS("SyntaxLSL") << "Region has not received capabilities. Waiting for caps..." << LL_ENDL;
+ }
+ }
+ return false;
+}
+
+//-----------------------------------------------------------------------------
+// fetchKeywordsFile
+//-----------------------------------------------------------------------------
+void LLSyntaxIdLSL::fetchKeywordsFile(const std::string& filespec)
+{
+ mInflightFetches.push_back(filespec);
+ LLHTTPClient::get(mCapabilityURL,
+ new fetchKeywordsFileResponder(filespec),
+ LLSD(), 30.f);
+ LL_DEBUGS("SyntaxLSL") << "LSLSyntaxId capability URL is: " << mCapabilityURL << ". Filename to use is: '" << filespec << "'." << LL_ENDL;
+}
+
+
+//-----------------------------------------------------------------------------
+// initialize
+//-----------------------------------------------------------------------------
+void LLSyntaxIdLSL::initialize()
+{
+ if (mSyntaxId.isNull())
+ {
+ loadDefaultKeywordsIntoLLSD();
+ }
+ else if (!mCapabilityURL.empty())
+ {
+ LL_DEBUGS("SyntaxLSL") << "LSL version has changed, getting appropriate file." << LL_ENDL;
+
+ // Need a full spec regardless of file source, so build it now.
+ buildFullFileSpec();
+ if (mSyntaxId.notNull())
+ {
+ if (!gDirUtilp->fileExists(mFullFileSpec))
+ { // Does not exist, so fetch it from the capability
+ LL_DEBUGS("SyntaxLSL") << "LSL syntax not cached, attempting download." << LL_ENDL;
+ fetchKeywordsFile(mFullFileSpec);
+ }
+ else
+ {
+ LL_DEBUGS("SyntaxLSL") << "Found cached Syntax file: " << mFullFileSpec << " Loading keywords." << LL_ENDL;
+ loadKeywordsIntoLLSD();
+ }
+ }
+ else
+ {
+ LL_DEBUGS("SyntaxLSL") << "LSLSyntaxId is null. Loading default values" << LL_ENDL;
+ loadDefaultKeywordsIntoLLSD();
+ }
+ }
+ else
+ {
+ LL_DEBUGS("SyntaxLSL") << "LSLSyntaxId capability URL is empty." << LL_ENDL;
+ loadDefaultKeywordsIntoLLSD();
+ }
+}
+
+//-----------------------------------------------------------------------------
+// isSupportedVersion
+//-----------------------------------------------------------------------------
+const U32 LLSD_SYNTAX_LSL_VERSION_EXPECTED = 2;
+const std::string LLSD_SYNTAX_LSL_VERSION_KEY("llsd-lsl-syntax-version");
+
+bool LLSyntaxIdLSL::isSupportedVersion(const LLSD& content)
+{
+ bool is_valid = false;
+ /*
+ * If the schema used to store LSL keywords and hints changes, this value is incremented
+ * Note that it should _not_ be changed if the keywords and hints _content_ changes.
+ */
+
+ if (content.has(LLSD_SYNTAX_LSL_VERSION_KEY))
+ {
+ LL_DEBUGS("SyntaxLSL") << "LSL syntax version: " << content[LLSD_SYNTAX_LSL_VERSION_KEY].asString() << LL_ENDL;
+
+ if (content[LLSD_SYNTAX_LSL_VERSION_KEY].asInteger() == LLSD_SYNTAX_LSL_VERSION_EXPECTED)
+ {
+ is_valid = true;
+ }
+ }
+ else
+ {
+ LL_DEBUGS("SyntaxLSL") << "Missing LSL syntax version key." << LL_ENDL;
+ }
+
+ return is_valid;
+}
+
+//-----------------------------------------------------------------------------
+// loadDefaultKeywordsIntoLLSD()
+//-----------------------------------------------------------------------------
+void LLSyntaxIdLSL::loadDefaultKeywordsIntoLLSD()
+{
+ mSyntaxId.setNull();
+ buildFullFileSpec();
+ loadKeywordsIntoLLSD();
+}
+
+//-----------------------------------------------------------------------------
+// loadKeywordsFileIntoLLSD
+//-----------------------------------------------------------------------------
+/**
+ * @brief Load xml serialised LLSD
+ * @desc Opens the specified filespec and attempts to deserialise the
+ * contained data to the specified LLSD object. indicate success/failure with
+ * sLoaded/sLoadFailed members.
+ */
+void LLSyntaxIdLSL::loadKeywordsIntoLLSD()
+{
+ LLSD content;
+ llifstream file;
+ file.open(mFullFileSpec);
+ if (file.is_open())
+ {
+ if (LLSDSerialize::fromXML(content, file) != LLSDParser::PARSE_FAILURE)
+ {
+ if (isSupportedVersion(content))
+ {
+ LL_DEBUGS("SyntaxLSL") << "Deserialised: " << mFullFileSpec << LL_ENDL;
+ }
+ else
+ {
+ LL_WARNS("SyntaxLSL") << "Unknown or unsupported version of syntax file." << LL_ENDL;
+ }
+ }
+ }
+ else
+ {
+ LL_WARNS("SyntaxLSL") << "Failed to open: " << mFullFileSpec << LL_ENDL;
+ }
+ mKeywordsXml = content;
+ mSyntaxIDChangedSignal();
+}
+
+bool LLSyntaxIdLSL::keywordFetchInProgress()
+{
+ return !mInflightFetches.empty();
+}
+
+void LLSyntaxIdLSL::handleRegionChanged()
+{
+ if (syntaxIdChanged())
+ {
+ buildFullFileSpec();
+ fetchKeywordsFile(mFullFileSpec);
+ }
+}
+
+void LLSyntaxIdLSL::handleCapsReceived(const LLUUID& region_uuid)
+{
+ LLViewerRegion* current_region = gAgent.getRegion();
+
+ if (region_uuid.notNull()
+ && current_region->getRegionID() == region_uuid)
+ {
+ syntaxIdChanged();
+ }
+}
+
+void LLSyntaxIdLSL::handleFileFetched(const std::string& filepath)
+{
+ mInflightFetches.remove(filepath);
+ loadKeywordsIntoLLSD();
+}
+
+boost::signals2::connection LLSyntaxIdLSL::addSyntaxIDCallback(const syntax_id_changed_signal_t::slot_type& cb)
+{
+ return mSyntaxIDChangedSignal.connect(cb);
+}
diff --git a/indra/newview/llsyntaxid.h b/indra/newview/llsyntaxid.h
new file mode 100644
index 0000000000..504fb0997e
--- /dev/null
+++ b/indra/newview/llsyntaxid.h
@@ -0,0 +1,73 @@
+/**
+ * @file llsyntaxid.h
+ * @brief Contains methods to access the LSLSyntaxId feature and LSLSyntax capability
+ * to use the appropriate syntax file for the current region's LSL version.
+ * @author Ima Mechanique, Cinder Roxley
+ *
+ * $LicenseInfo:firstyear=2013&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2013, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+#ifndef LL_SYNTAXID_H
+#define LL_SYNTAXID_H
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llsingleton.h"
+
+class fetchKeywordsFileResponder;
+
+class LLSyntaxIdLSL : public LLSingleton<LLSyntaxIdLSL>
+{
+ friend class LLSingleton<LLSyntaxIdLSL>;
+ friend class fetchKeywordsFileResponder;
+
+private:
+ std::list<std::string> mInflightFetches;
+ typedef boost::signals2::signal<void()> syntax_id_changed_signal_t;
+ syntax_id_changed_signal_t mSyntaxIDChangedSignal;
+ boost::signals2::connection mRegionChangedCallback;
+
+ bool syntaxIdChanged();
+ bool isSupportedVersion(const LLSD& content);
+ void handleRegionChanged();
+ void handleCapsReceived(const LLUUID& region_uuid);
+ void handleFileFetched(const std::string& filepath);
+ void setKeywordsXml(const LLSD& content) { mKeywordsXml = content; };
+ void buildFullFileSpec();
+ void fetchKeywordsFile(const std::string& filespec);
+ void loadDefaultKeywordsIntoLLSD();
+ void loadKeywordsIntoLLSD();
+
+ std::string mCapabilityURL;
+ std::string mFullFileSpec;
+ ELLPath mFilePath;
+ LLUUID mSyntaxId;
+ LLSD mKeywordsXml;
+
+public:
+ LLSyntaxIdLSL();
+ void initialize();
+ bool keywordFetchInProgress();
+ LLSD getKeywordsXML() const { return mKeywordsXml; };
+ boost::signals2::connection addSyntaxIDCallback(const syntax_id_changed_signal_t::slot_type& cb);
+};
+
+#endif // LLSYNTAXID_H
diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp
index 626d69aca4..8babb874f8 100755
--- a/indra/newview/llsyswellwindow.cpp
+++ b/indra/newview/llsyswellwindow.cpp
@@ -107,8 +107,8 @@ void LLSysWellWindow::removeItemByID(const LLUUID& id)
}
else
{
- llwarns << "Unable to remove notification from the list, ID: " << id
- << llendl;
+ LL_WARNS() << "Unable to remove notification from the list, ID: " << id
+ << LL_ENDL;
}
// hide chiclet window if there are no items left
@@ -132,7 +132,7 @@ void LLSysWellWindow::initChannel()
mChannel = dynamic_cast<LLNotificationsUI::LLScreenChannel*>(channel);
if(NULL == mChannel)
{
- llwarns << "LLSysWellWindow::initChannel() - could not get a requested screen channel" << llendl;
+ LL_WARNS() << "LLSysWellWindow::initChannel() - could not get a requested screen channel" << LL_ENDL;
}
}
@@ -360,9 +360,9 @@ void LLNotificationWellWindow::addItem(LLSysWellItem::Params p)
}
else
{
- llwarns << "Unable to add Notification into the list, notification ID: " << p.notification_id
+ LL_WARNS() << "Unable to add Notification into the list, notification ID: " << p.notification_id
<< ", title: " << p.title
- << llendl;
+ << LL_ENDL;
new_item->die();
}
@@ -509,7 +509,7 @@ void LLIMWellWindow::addObjectRow(const LLUUID& notification_id, bool new_messag
ObjectRowPanel* item = new ObjectRowPanel(notification_id, new_message);
if (!mMessageList->addItem(item, notification_id))
{
- llwarns << "Unable to add Object Row into the list, notificationID: " << notification_id << llendl;
+ LL_WARNS() << "Unable to add Object Row into the list, notificationID: " << notification_id << LL_ENDL;
item->die();
}
reshapeWindow();
@@ -520,7 +520,7 @@ void LLIMWellWindow::removeObjectRow(const LLUUID& notification_id)
{
if (!mMessageList->removeItemByValue(notification_id))
{
- llwarns << "Unable to remove Object Row from the list, notificationID: " << notification_id << llendl;
+ LL_WARNS() << "Unable to remove Object Row from the list, notificationID: " << notification_id << LL_ENDL;
}
reshapeWindow();
diff --git a/indra/newview/llteleporthistory.cpp b/indra/newview/llteleporthistory.cpp
index 50a088b799..a20d69dd41 100755
--- a/indra/newview/llteleporthistory.cpp
+++ b/indra/newview/llteleporthistory.cpp
@@ -77,14 +77,14 @@ void LLTeleportHistory::goToItem(int idx)
// Validate specified index.
if (idx < 0 || idx >= (int)mItems.size())
{
- llwarns << "Invalid teleport history index (" << idx << ") specified" << llendl;
+ LL_WARNS() << "Invalid teleport history index (" << idx << ") specified" << LL_ENDL;
dump();
return;
}
if (idx == mCurrentItem)
{
- llwarns << "Will not teleport to the same location." << llendl;
+ LL_WARNS() << "Will not teleport to the same location." << LL_ENDL;
dump();
return;
}
@@ -156,7 +156,7 @@ void LLTeleportHistory::updateCurrentLocation(const LLVector3d& new_pos)
// Update current history item.
if (mCurrentItem < 0 || mCurrentItem >= (int) mItems.size()) // sanity check
{
- llwarns << "Invalid current item. (this should not happen)" << llendl;
+ LL_WARNS() << "Invalid current item. (this should not happen)" << LL_ENDL;
llassert(!"Invalid current teleport history item");
return;
}
@@ -222,7 +222,7 @@ std::string LLTeleportHistory::getCurrentLocationTitle(bool full, const LLVector
void LLTeleportHistory::dump() const
{
- llinfos << "Teleport history dump (" << mItems.size() << " items):" << llendl;
+ LL_INFOS() << "Teleport history dump (" << mItems.size() << " items):" << LL_ENDL;
for (size_t i=0; i<mItems.size(); i++)
{
@@ -231,6 +231,6 @@ void LLTeleportHistory::dump() const
line << i << ": " << mItems[i].mTitle;
line << " REGION_ID: " << mItems[i].mRegionID;
line << ", pos: " << mItems[i].mGlobalPos;
- llinfos << line.str() << llendl;
+ LL_INFOS() << line.str() << LL_ENDL;
}
}
diff --git a/indra/newview/llteleporthistorystorage.cpp b/indra/newview/llteleporthistorystorage.cpp
index af5a047da4..f88f88a4fa 100755
--- a/indra/newview/llteleporthistorystorage.cpp
+++ b/indra/newview/llteleporthistorystorage.cpp
@@ -167,7 +167,7 @@ void LLTeleportHistoryStorage::save()
llofstream file (resolvedFilename);
if (!file.is_open())
{
- llwarns << "can't open teleport history file \"" << mFilename << "\" for writing" << llendl;
+ LL_WARNS() << "can't open teleport history file \"" << mFilename << "\" for writing" << LL_ENDL;
return;
}
@@ -189,7 +189,7 @@ void LLTeleportHistoryStorage::load()
llifstream file(resolved_filename);
if (!file.is_open())
{
- llwarns << "can't load teleport history from file \"" << mFilename << "\"" << llendl;
+ LL_WARNS() << "can't load teleport history from file \"" << mFilename << "\"" << LL_ENDL;
return;
}
@@ -205,7 +205,7 @@ void LLTeleportHistoryStorage::load()
std::istringstream iss(line);
if (parser->parse(iss, s_item, line.length()) == LLSDParser::PARSE_FAILURE)
{
- llinfos << "Parsing saved teleport history failed" << llendl;
+ LL_INFOS() << "Parsing saved teleport history failed" << LL_ENDL;
break;
}
@@ -221,7 +221,7 @@ void LLTeleportHistoryStorage::load()
void LLTeleportHistoryStorage::dump() const
{
- llinfos << "Teleport history storage dump (" << mItems.size() << " items):" << llendl;
+ LL_INFOS() << "Teleport history storage dump (" << mItems.size() << " items):" << LL_ENDL;
for (size_t i=0; i<mItems.size(); i++)
{
@@ -230,7 +230,7 @@ void LLTeleportHistoryStorage::dump() const
line << " global pos: " << mItems[i].mGlobalPos;
line << " date: " << mItems[i].mDate;
- llinfos << line.str() << llendl;
+ LL_INFOS() << line.str() << LL_ENDL;
}
}
@@ -244,7 +244,7 @@ void LLTeleportHistoryStorage::goToItem(S32 idx)
// Validate specified index.
if (idx < 0 || idx >= (S32)mItems.size())
{
- llwarns << "Invalid teleport history index (" << idx << ") specified" << llendl;
+ LL_WARNS() << "Invalid teleport history index (" << idx << ") specified" << LL_ENDL;
dump();
return;
}
diff --git a/indra/newview/lltextureatlas.cpp b/indra/newview/lltextureatlas.cpp
index dbbe331954..1c8e4f796e 100755
--- a/indra/newview/lltextureatlas.cpp
+++ b/indra/newview/lltextureatlas.cpp
@@ -63,7 +63,7 @@ LLTextureAtlas::~LLTextureAtlas()
{
if(mSpatialGroupList.size() > 0)
{
- llerrs << "Not clean up the spatial groups!" << llendl ;
+ LL_ERRS() << "Not clean up the spatial groups!" << LL_ENDL ;
}
releaseUsageBits() ;
}
@@ -105,7 +105,7 @@ LLGLuint LLTextureAtlas::insertSubTexture(LLImageGL* source_gl_tex, S32 discard_
BOOL res = gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, getTexName());
if (!res)
{
- llerrs << "bindTexture failed" << llendl;
+ LL_ERRS() << "bindTexture failed" << LL_ENDL;
}
GLint xoffset = sSlotSize * slot_col ;
@@ -342,7 +342,7 @@ BOOL LLTextureAtlas::areUsageBitsMarked(S8 bits_len, U8 mask, S16 col, S16 row)
if(ret != ret2)
{
- llerrs << "bits map corrupted." << llendl ;
+ LL_ERRS() << "bits map corrupted." << LL_ENDL ;
}
#endif
return ret ;//FALSE ;
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp
index 5bc2e971eb..ef852bc905 100755
--- a/indra/newview/lltexturecache.cpp
+++ b/indra/newview/lltexturecache.cpp
@@ -191,7 +191,7 @@ bool LLTextureCacheLocalFileWorker::doRead()
if (mImageFormat == IMG_CODEC_INVALID)
{
-// llwarns << "Unrecognized file extension " << extension << " for local texture " << mFileName << llendl;
+// LL_WARNS() << "Unrecognized file extension " << extension << " for local texture " << mFileName << LL_ENDL;
mDataSize = 0; // no data
return true;
}
@@ -232,9 +232,9 @@ bool LLTextureCacheLocalFileWorker::doRead()
{
if (mBytesRead != mBytesToRead)
{
-// llwarns << "Error reading file from local cache: " << local_filename
+// LL_WARNS() << "Error reading file from local cache: " << local_filename
// << " Bytes: " << mDataSize << " Offset: " << mOffset
-// << " / " << mDataSize << llendl;
+// << " / " << mDataSize << LL_ENDL;
mDataSize = 0; // failed
FREE_MEM(LLImageBase::getPrivatePool(), mReadData);
mReadData = NULL;
@@ -257,9 +257,9 @@ bool LLTextureCacheLocalFileWorker::doRead()
if (bytes_read != mDataSize)
{
-// llwarns << "Error reading file from local cache: " << mFileName
+// LL_WARNS() << "Error reading file from local cache: " << mFileName
// << " Bytes: " << mDataSize << " Offset: " << mOffset
-// << " / " << mDataSize << llendl;
+// << " / " << mDataSize << LL_ENDL;
mDataSize = 0;
FREE_MEM(LLImageBase::getPrivatePool(), mReadData);
mReadData = NULL;
@@ -390,16 +390,16 @@ bool LLTextureCacheRemoteWorker::doRead()
mReadData, mOffset, mDataSize, mCache->getLocalAPRFilePool());
if (bytes_read != mDataSize)
{
- llwarns << "Error reading file from local cache: " << local_filename
+ LL_WARNS() << "Error reading file from local cache: " << local_filename
<< " Bytes: " << mDataSize << " Offset: " << mOffset
- << " / " << mDataSize << llendl;
+ << " / " << mDataSize << LL_ENDL;
mDataSize = 0;
FREE_MEM(LLImageBase::getPrivatePool(), mReadData);
mReadData = NULL;
}
else
{
- //llinfos << "texture " << mID.asString() << " found in local_assets" << llendl;
+ //LL_INFOS() << "texture " << mID.asString() << " found in local_assets" << LL_ENDL;
mImageSize = local_size;
mImageLocal = TRUE;
}
@@ -442,9 +442,9 @@ bool LLTextureCacheRemoteWorker::doRead()
mReadData, offset, size, mCache->getLocalAPRFilePool());
if (bytes_read != size)
{
- llwarns << "LLTextureCacheWorker: " << mID
+ LL_WARNS() << "LLTextureCacheWorker: " << mID
<< " incorrect number of bytes read from header: " << bytes_read
- << " / " << size << llendl;
+ << " / " << size << LL_ENDL;
FREE_MEM(LLImageBase::getPrivatePool(), mReadData);
mReadData = NULL;
mDataSize = -1; // failed
@@ -511,9 +511,9 @@ bool LLTextureCacheRemoteWorker::doRead()
mCache->getLocalAPRFilePool());
if (bytes_read != file_size)
{
- llwarns << "LLTextureCacheWorker: " << mID
+ LL_WARNS() << "LLTextureCacheWorker: " << mID
<< " incorrect number of bytes read from body: " << bytes_read
- << " / " << file_size << llendl;
+ << " / " << file_size << LL_ENDL;
FREE_MEM(LLImageBase::getPrivatePool(), mReadData);
mReadData = NULL;
mDataSize = -1; // failed
@@ -524,7 +524,7 @@ bool LLTextureCacheRemoteWorker::doRead()
{
// No body, we're done.
mDataSize = llmax(TEXTURE_CACHE_ENTRY_SIZE - mOffset, 0);
- lldebugs << "No body file for: " << filename << llendl;
+ LL_DEBUGS() << "No body file for: " << filename << LL_ENDL;
}
// Nothing else to do at that point...
done = true;
@@ -571,10 +571,10 @@ bool LLTextureCacheRemoteWorker::doWrite()
// (almost always) write to the fast cache.
if (mRawImage->getDataSize())
{
- llassert_always(mCache->writeToFastCache(idx, mRawImage, mRawDiscardLevel));
- }
+ llassert_always(mCache->writeToFastCache(idx, mRawImage, mRawDiscardLevel));
}
}
+ }
else
{
alreadyCached = mCache->updateEntry(idx, entry, mImageSize, mDataSize); // update the existing entry.
@@ -582,8 +582,8 @@ bool LLTextureCacheRemoteWorker::doWrite()
if (idx < 0)
{
- llwarns << "LLTextureCacheWorker: " << mID
- << " Unable to create header entry for writing!" << llendl;
+ LL_WARNS() << "LLTextureCacheWorker: " << mID
+ << " Unable to create header entry for writing!" << LL_ENDL;
mDataSize = -1; // failed
done = true;
}
@@ -628,8 +628,8 @@ bool LLTextureCacheRemoteWorker::doWrite()
if (bytes_written <= 0)
{
- llwarns << "LLTextureCacheWorker: " << mID
- << " Unable to write header entry!" << llendl;
+ LL_WARNS() << "LLTextureCacheWorker: " << mID
+ << " Unable to write header entry!" << LL_ENDL;
mDataSize = -1; // failed
done = true;
}
@@ -655,16 +655,16 @@ bool LLTextureCacheRemoteWorker::doWrite()
{
// build the cache file name from the UUID
std::string filename = mCache->getTextureFileName(mID);
-// llinfos << "Writing Body: " << filename << " Bytes: " << file_offset+file_size << llendl;
+// LL_INFOS() << "Writing Body: " << filename << " Bytes: " << file_offset+file_size << LL_ENDL;
S32 bytes_written = LLAPRFile::writeEx( filename,
mWriteData + TEXTURE_CACHE_ENTRY_SIZE,
0, file_size,
mCache->getLocalAPRFilePool());
if (bytes_written <= 0)
{
- llwarns << "LLTextureCacheWorker: " << mID
+ LL_WARNS() << "LLTextureCacheWorker: " << mID
<< " incorrect number of bytes written to body: " << bytes_written
- << " / " << file_size << llendl;
+ << " / " << file_size << LL_ENDL;
mDataSize = -1; // failed
done = true;
}
@@ -922,7 +922,7 @@ void LLTextureCache::setDirNames(ELLPath location)
mFastCacheFileName = gDirUtilp->getExpandedFilename(location, textures_dirname, fast_cache_filename);
}
-void LLTextureCache::purgeCache(ELLPath location)
+void LLTextureCache::purgeCache(ELLPath location, bool remove_dir)
{
LLMutexLock lock(&mHeaderMutex);
@@ -948,7 +948,7 @@ void LLTextureCache::purgeCache(ELLPath location)
}
//remove the current texture cache.
- purgeAllTextures(true);
+ purgeAllTextures(remove_dir);
}
//is called in the main thread before initCache(...) is called.
@@ -1135,7 +1135,7 @@ S32 LLTextureCache::openAndReadEntry(const LLUUID& id, Entry& entry, bool create
}
if(entry.mImageSize <= entry.mBodySize)//it happens on 64-bit systems, do not know why
{
- llwarns << "corrupted entry: " << id << " entry image size: " << entry.mImageSize << " entry body size: " << entry.mBodySize << llendl ;
+ LL_WARNS() << "corrupted entry: " << id << " entry image size: " << entry.mImageSize << " entry body size: " << entry.mBodySize << LL_ENDL ;
//erase this entry and the cached texture from the cache.
std::string tex_filename = getTextureFileName(id);
@@ -1303,13 +1303,13 @@ U32 LLTextureCache::openAndReadEntries(std::vector<Entry>& entries)
S32 bytes_read = aprfile->read((void*)(&entry), (S32)sizeof(Entry));
if (bytes_read < sizeof(Entry))
{
- llwarns << "Corrupted header entries, failed at " << idx << " / " << num_entries << llendl;
+ LL_WARNS() << "Corrupted header entries, failed at " << idx << " / " << num_entries << LL_ENDL;
closeHeaderEntriesFile();
purgeAllTextures(false);
return 0;
}
entries.push_back(entry);
-// llinfos << "ENTRY: " << entry.mTime << " TEX: " << entry.mID << " IDX: " << idx << " Size: " << entry.mImageSize << llendl;
+// LL_INFOS() << "ENTRY: " << entry.mTime << " TEX: " << entry.mID << " IDX: " << idx << " Size: " << entry.mImageSize << LL_ENDL;
if(entry.mImageSize > entry.mBodySize)
{
mHeaderIDMap[entry.mID] = idx;
@@ -1439,7 +1439,7 @@ void LLTextureCache::readHeaderCache()
if (entry.mBodySize > entry.mImageSize)
{
// Shouldn't happen, failsafe only
- llwarns << "Bad entry: " << i << ": " << entry.mID << ": BodySize: " << entry.mBodySize << llendl;
+ LL_WARNS() << "Bad entry: " << i << ": " << entry.mID << ": BodySize: " << entry.mBodySize << LL_ENDL;
purge_list.insert(i);
}
}
@@ -1450,7 +1450,7 @@ void LLTextureCache::readHeaderCache()
// Special case: cache size was reduced, need to remove entries
// Note: After we prune entries, we will call this again and create the LRU
U32 entries_to_purge = (num_entries - empty_entries) - sCacheMaxEntries;
- llinfos << "Texture Cache Entries: " << num_entries << " Max: " << sCacheMaxEntries << " Empty: " << empty_entries << " Purging: " << entries_to_purge << llendl;
+ LL_INFOS() << "Texture Cache Entries: " << num_entries << " Max: " << sCacheMaxEntries << " Empty: " << empty_entries << " Purging: " << entries_to_purge << LL_ENDL;
// We can exit the following loop with the given condition, since if we'd reach the end of the lru set we'd have:
// purge_list.size() = lru.size() = num_entries - empty_entries = entries_to_purge + sCacheMaxEntries >= entries_to_purge
// So, it's certain that iter will never reach lru.end() first.
@@ -1467,7 +1467,7 @@ void LLTextureCache::readHeaderCache()
for (std::set<lru_data_t>::iterator iter = lru.begin(); iter != lru.end(); ++iter)
{
mLRU.insert(entries[iter->second].mID);
-// llinfos << "LRU: " << iter->first << " : " << iter->second << llendl;
+// LL_INFOS() << "LRU: " << iter->first << " : " << iter->second << LL_ENDL;
if (--lru_entries <= 0)
break;
}
@@ -1513,7 +1513,7 @@ void LLTextureCache::readHeaderCache()
//the header mutex is locked before calling this.
void LLTextureCache::clearCorruptedCache()
{
- llwarns << "the texture cache is corrupted, need to be cleared." << llendl ;
+ LL_WARNS() << "the texture cache is corrupted, need to be cleared." << LL_ENDL ;
closeHeaderEntriesFile();//close possible file handler
purgeAllTextures(false) ; //clear the cache.
@@ -1543,7 +1543,7 @@ void LLTextureCache::purgeAllTextures(bool purge_directories)
for (S32 i=0; i<16; i++)
{
std::string dirname = mTexturesDirName + delem + subdirs[i];
- llinfos << "Deleting files in directory: " << dirname << llendl;
+ LL_INFOS() << "Deleting files in directory: " << dirname << LL_ENDL;
gDirUtilp->deleteFilesInDir(dirname, mask);
if (purge_directories)
{
@@ -1568,7 +1568,7 @@ void LLTextureCache::purgeAllTextures(bool purge_directories)
mHeaderEntriesInfo.mEntries = 0;
writeEntriesHeader();
- llinfos << "The entire texture cache is cleared." << llendl ;
+ LL_INFOS() << "The entire texture cache is cleared." << LL_ENDL ;
}
void LLTextureCache::purgeTextures(bool validate)
@@ -1586,7 +1586,7 @@ void LLTextureCache::purgeTextures(bool validate)
LLMutexLock lock(&mHeaderMutex);
- llinfos << "TEXTURE CACHE: Purging." << llendl;
+ LL_INFOS() << "TEXTURE CACHE: Purging." << LL_ENDL;
// Read the entries list
std::vector<Entry> entries;
@@ -1609,11 +1609,11 @@ void LLTextureCache::purgeTextures(bool validate)
{
S32 idx = iter2->second;
time_idx_set.insert(std::make_pair(entries[idx].mTime, idx));
-// llinfos << "TIME: " << entries[idx].mTime << " TEX: " << entries[idx].mID << " IDX: " << idx << " Size: " << entries[idx].mImageSize << llendl;
+// LL_INFOS() << "TIME: " << entries[idx].mTime << " TEX: " << entries[idx].mID << " IDX: " << idx << " Size: " << entries[idx].mImageSize << LL_ENDL;
}
else
{
- llerrs << "mTexturesSizeMap / mHeaderIDMap corrupted." << llendl ;
+ LL_ERRS() << "mTexturesSizeMap / mHeaderIDMap corrupted." << LL_ENDL ;
}
}
}
@@ -1682,7 +1682,7 @@ void LLTextureCache::purgeTextures(bool validate)
<< " PURGED: " << purge_count
<< " ENTRIES: " << num_entries
<< " CACHE SIZE: " << mTexturesSizeTotal / (1024 * 1024) << " MB"
- << llendl;
+ << LL_ENDL;
}
//////////////////////////////////////////////////////////////////////////////
@@ -1900,7 +1900,7 @@ bool LLTextureCache::writeToFastCache(S32 id, LLPointer<LLImageRaw> raw, S32 dis
//rescale image if needed
if (raw.isNull() || !raw->getData())
{
- llerrs << "Attempted to write NULL raw image to fastcache" << llendl;
+ LL_ERRS() << "Attempted to write NULL raw image to fastcache" << LL_ENDL;
return false;
}
@@ -2094,7 +2094,7 @@ void LLTextureCache::removeEntry(S32 idx, Entry& entry, std::string& filename)
bool LLTextureCache::removeFromCache(const LLUUID& id)
{
- //llwarns << "Removing texture from cache: " << id << llendl;
+ //LL_WARNS() << "Removing texture from cache: " << id << LL_ENDL;
bool ret = false ;
if (!mReadOnly)
{
diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h
index deaacc4975..6ff4c44568 100755
--- a/indra/newview/lltexturecache.h
+++ b/indra/newview/lltexturecache.h
@@ -104,7 +104,7 @@ public:
/*virtual*/ S32 update(F32 max_time_ms);
- void purgeCache(ELLPath location);
+ void purgeCache(ELLPath location, bool remove_dir = true);
void setReadOnly(BOOL read_only) ;
S64 initCache(ELLPath location, S64 maxsize, BOOL texture_cache_mismatch);
@@ -131,8 +131,8 @@ public:
// debug
S32 getNumReads() { return mReaders.size(); }
S32 getNumWrites() { return mWriters.size(); }
- S64 getUsage() { return mTexturesSizeTotal; }
- S64 getMaxUsage() { return sCacheMaxTexturesSize; }
+ S64Bytes getUsage() { return S64Bytes(mTexturesSizeTotal); }
+ S64Bytes getMaxUsage() { return S64Bytes(sCacheMaxTexturesSize); }
U32 getEntries() { return mHeaderEntriesInfo.mEntries; }
U32 getMaxEntries() { return sCacheMaxEntries; };
BOOL isInCache(const LLUUID& id) ;
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index ea837c9127..c12753acb0 100755
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -208,7 +208,7 @@ LLFloaterTexturePicker::LLFloaterTexturePicker(
: LLFloater(LLSD()),
mOwner( owner ),
mImageAssetID( owner->getImageAssetID() ),
- mFallbackImage( fallback_image ),
+ mFallbackImage( fallback_image ),
mOriginalImageAssetID(owner->getImageAssetID()),
mLabel(label),
mTentativeLabel(NULL),
@@ -242,7 +242,7 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id)
LLUUID item_id = findItemID(mImageAssetID, FALSE);
if (item_id.isNull())
{
- mInventoryPanel->clearSelection();
+ mInventoryPanel->getRootFolder()->clearSelection();
}
else
{
@@ -355,7 +355,7 @@ BOOL LLFloaterTexturePicker::handleDragAndDrop(
}
handled = TRUE;
- lldebugst(LLERR_USER_INPUT) << "dragAndDrop handled by LLFloaterTexturePicker " << getName() << llendl;
+ LL_DEBUGS("UserInput") << "dragAndDrop handled by LLFloaterTexturePicker " << getName() << LL_ENDL;
return handled;
}
@@ -549,11 +549,11 @@ void LLFloaterTexturePicker::draw()
if (gFocusMgr.childHasMouseCapture(getDragHandle()))
{
- mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME));
+ mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLSmoothInterpolation::getInterpolant(CONTEXT_FADE_TIME));
}
else
{
- mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME));
+ mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLSmoothInterpolation::getInterpolant(CONTEXT_FADE_TIME));
}
updateImageStats();
@@ -667,10 +667,10 @@ const LLUUID& LLFloaterTexturePicker::findItemID(const LLUUID& asset_id, BOOL co
LLInventoryModel::INCLUDE_TRASH,
asset_id_matches);
- if (items.count())
+ if (items.size())
{
// search for copyable version first
- for (S32 i = 0; i < items.count(); i++)
+ for (S32 i = 0; i < items.size(); i++)
{
LLInventoryItem* itemp = items[i];
LLPermissions item_permissions = itemp->getPermissions();
@@ -1342,9 +1342,9 @@ void LLTextureCtrl::onFloaterCommit(ETexturePickOp op, LLUUID id)
else
{
mImageItemID = floaterp->findItemID(floaterp->getAssetID(), FALSE);
- lldebugs << "mImageItemID: " << mImageItemID << llendl;
+ LL_DEBUGS() << "mImageItemID: " << mImageItemID << LL_ENDL;
mImageAssetID = floaterp->getAssetID();
- lldebugs << "mImageAssetID: " << mImageAssetID << llendl;
+ LL_DEBUGS() << "mImageAssetID: " << mImageAssetID << LL_ENDL;
}
if (op == TEXTURE_SELECT && mOnSelectCallback)
@@ -1445,7 +1445,7 @@ BOOL LLTextureCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask,
}
handled = TRUE;
- lldebugst(LLERR_USER_INPUT) << "dragAndDrop handled by LLTextureCtrl " << getName() << llendl;
+ LL_DEBUGS("UserInput") << "dragAndDrop handled by LLTextureCtrl " << getName() << LL_ENDL;
return handled;
}
diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h
index ad79042ef1..15ca7bed92 100755
--- a/indra/newview/lltexturectrl.h
+++ b/indra/newview/lltexturectrl.h
@@ -227,8 +227,4 @@ private:
S32 mLabelWidth;
};
-// XUI HACK: When floaters converted, switch this file to lltexturepicker.h/cpp
-// and class to LLTexturePicker
-#define LLTexturePicker LLTextureCtrl
-
#endif // LL_LLTEXTURECTRL_H
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index e5f2ca7e5c..d9a874be49 100644..100755
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -4,7 +4,7 @@
*
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2012-2013, Linden Research, Inc.
+ * Copyright (C) 2012-2014, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -36,7 +36,7 @@
#include "lldir.h"
#include "llhttpclient.h"
-#include "llhttpstatuscodes.h"
+#include "llhttpconstants.h"
#include "llimage.h"
#include "llimagej2c.h"
#include "llimageworker.h"
@@ -53,6 +53,7 @@
#include "llviewerstatsrecorder.h"
#include "llviewerassetstats.h"
#include "llworld.h"
+#include "llsdparam.h"
#include "llsdutil.h"
#include "llstartup.h"
#include "llsdserialize.h"
@@ -63,9 +64,11 @@
#include "bufferarray.h"
#include "bufferstream.h"
+#include "llhttpretrypolicy.h"
+
bool LLTextureFetchDebugger::sDebuggerEnabled = false ;
-LLStat LLTextureFetch::sCacheHitRate("texture_cache_hits", 128);
-LLStat LLTextureFetch::sCacheReadLatency("texture_cache_read_latency", 128);
+LLTrace::EventStatHandle<LLUnit<F32, LLUnits::Percent> > LLTextureFetch::sCacheHitRate("texture_cache_hits");
+LLTrace::EventStatHandle<F64Milliseconds > LLTextureFetch::sCacheReadLatency("texture_cache_read_latency");
//////////////////////////////////////////////////////////////////////////////
@@ -241,9 +244,38 @@ LLStat LLTextureFetch::sCacheReadLatency("texture_cache_read_latency", 128);
static const S32 HTTP_REQUESTS_IN_QUEUE_HIGH_WATER = 40; // Maximum requests to have active in HTTP
static const S32 HTTP_REQUESTS_IN_QUEUE_LOW_WATER = 20; // Active level at which to refill
+// BUG-3323/SH-4375
+// *NOTE: This is a heuristic value. Texture fetches have a habit of using a
+// value of 32MB to indicate 'get the rest of the image'. Certain ISPs and
+// network equipment get confused when they see this in a Range: header. So,
+// if the request end is beyond this value, we issue an open-ended Range:
+// request (e.g. 'Range: <start>-') which seems to fix the problem.
+static const S32 HTTP_REQUESTS_RANGE_END_MAX = 20000000;
//////////////////////////////////////////////////////////////////////////////
+static const char* e_state_name[] =
+{
+ "INVALID",
+ "INIT",
+ "LOAD_FROM_TEXTURE_CACHE",
+ "CACHE_POST",
+ "LOAD_FROM_NETWORK",
+ "LOAD_FROM_SIMULATOR",
+ "WAIT_HTTP_RESOURCE",
+ "WAIT_HTTP_RESOURCE2",
+ "SEND_HTTP_REQ",
+ "WAIT_HTTP_REQ",
+ "DECODE_IMAGE",
+ "DECODE_IMAGE_UPDATE",
+ "WRITE_TO_CACHE",
+ "WAIT_ON_WRITE",
+ "DONE"
+};
+
+// Log scope
+static const char * const LOG_TXT = "Texture";
+
class LLTextureFetchWorker : public LLWorkerClass, public LLCore::HttpHandler
{
@@ -382,12 +414,14 @@ public:
void setCanUseHTTP(bool can_use_http) { mCanUseHTTP = can_use_http; }
bool getCanUseHTTP() const { return mCanUseHTTP; }
+ void setUrl(const std::string& url) { mUrl = url; }
+
LLTextureFetch & getFetcher() { return *mFetcher; }
// Inherited from LLCore::HttpHandler
// Threads: Ttf
virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response);
-
+
protected:
LLTextureFetchWorker(LLTextureFetch* fetcher, FTType f_type,
const std::string& url, const LLUUID& id, const LLHost& host,
@@ -503,11 +537,12 @@ private:
static const char* sStateDescs[];
e_state mState;
void setState(e_state new_state);
+
e_write_to_cache_state mWriteToCacheState;
LLTextureFetch* mFetcher;
LLPointer<LLImageFormatted> mFormattedImage;
- LLPointer<LLImageRaw> mRawImage;
- LLPointer<LLImageRaw> mAuxImage;
+ LLPointer<LLImageRaw> mRawImage,
+ mAuxImage;
FTType mFTType;
LLUUID mID;
LLHost mHost;
@@ -516,22 +551,22 @@ private:
F32 mImagePriority;
U32 mWorkPriority;
F32 mRequestedPriority;
- S32 mDesiredDiscard;
- S32 mSimRequestedDiscard;
- S32 mRequestedDiscard;
- S32 mLoadedDiscard;
- S32 mDecodedDiscard;
- LLFrameTimer mRequestedTimer;
- LLFrameTimer mFetchTimer;
+ S32 mDesiredDiscard,
+ mSimRequestedDiscard,
+ mRequestedDiscard,
+ mLoadedDiscard,
+ mDecodedDiscard;
+ LLFrameTimer mRequestedTimer,
+ mFetchTimer;
LLTimer mCacheReadTimer;
F32 mCacheReadTime;
- LLTextureCache::handle_t mCacheReadHandle;
- LLTextureCache::handle_t mCacheWriteHandle;
- S32 mRequestedSize;
- S32 mRequestedOffset;
- S32 mDesiredSize;
- S32 mFileSize;
- S32 mCachedSize;
+ LLTextureCache::handle_t mCacheReadHandle,
+ mCacheWriteHandle;
+ S32 mRequestedSize,
+ mRequestedOffset,
+ mDesiredSize,
+ mFileSize,
+ mCachedSize;
e_request_state mSentRequest;
handle_t mDecodeHandle;
BOOL mLoaded;
@@ -541,20 +576,25 @@ private:
BOOL mHaveAllData;
BOOL mInLocalCache;
BOOL mInCache;
- bool mCanUseHTTP ;
- bool mCanUseNET ; //can get from asset server.
+ bool mCanUseHTTP,
+ mCanUseNET ; //can get from asset server.
S32 mRetryAttempt;
S32 mActiveCount;
LLCore::HttpStatus mGetStatus;
std::string mGetReason;
+ LLAdaptiveRetryPolicy mFetchRetryPolicy;
+
// Work Data
LLMutex mWorkMutex;
struct PacketData
{
- PacketData(U8* data, S32 size) { mData = data; mSize = size; }
+ PacketData(U8* data, S32 size)
+ : mData(data), mSize(size)
+ {}
~PacketData() { clearData(); }
void clearData() { delete[] mData; mData = NULL; }
+
U8* mData;
U32 mSize;
};
@@ -568,16 +608,16 @@ private:
LLCore::HttpHandle mHttpHandle; // Handle of any active request
LLCore::BufferArray * mHttpBufferArray; // Refcounted pointer to response data
- int mHttpPolicyClass;
+ S32 mHttpPolicyClass;
bool mHttpActive; // Active request to http library
- unsigned int mHttpReplySize; // Actual received data size
- unsigned int mHttpReplyOffset; // Actual received data offset
+ U32 mHttpReplySize, // Actual received data size
+ mHttpReplyOffset; // Actual received data offset
bool mHttpHasResource; // Counts against Fetcher's mHttpSemaphore
// State history
- U32 mCacheReadCount;
- U32 mCacheWriteCount;
- U32 mResourceWaitCount; // Requests entering WAIT_HTTP_RESOURCE2
+ U32 mCacheReadCount,
+ mCacheWriteCount,
+ mResourceWaitCount; // Requests entering WAIT_HTTP_RESOURCE2
};
//////////////////////////////////////////////////////////////////////////////
@@ -889,13 +929,14 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher,
mHttpHasResource(false),
mCacheReadCount(0U),
mCacheWriteCount(0U),
- mResourceWaitCount(0U)
+ mResourceWaitCount(0U),
+ mFetchRetryPolicy(10.0,3600.0,2.0,10)
{
mCanUseNET = mUrl.empty() ;
calcWorkPriority();
mType = host.isOk() ? LLImageBase::TYPE_AVATAR_BAKE : LLImageBase::TYPE_NORMAL;
-// llinfos << "Create: " << mID << " mHost:" << host << " Discard=" << discard << llendl;
+// LL_INFOS(LOG_TXT) << "Create: " << mID << " mHost:" << host << " Discard=" << discard << LL_ENDL;
if (!mFetcher->mDebugPause)
{
U32 work_priority = mWorkPriority | LLWorkerThread::PRIORITY_HIGH;
@@ -906,10 +947,10 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher,
LLTextureFetchWorker::~LLTextureFetchWorker()
{
-// llinfos << "Destroy: " << mID
+// LL_INFOS(LOG_TXT) << "Destroy: " << mID
// << " Decoded=" << mDecodedDiscard
// << " Requested=" << mRequestedDiscard
-// << " Desired=" << mDesiredDiscard << llendl;
+// << " Desired=" << mDesiredDiscard << LL_ENDL;
llassert_always(!haveWork());
lockWorkMutex(); // +Mw (should be useless)
@@ -941,7 +982,7 @@ LLTextureFetchWorker::~LLTextureFetchWorker()
mHttpBufferArray = NULL;
}
unlockWorkMutex(); // -Mw
- mFetcher->removeFromHTTPQueue(mID, 0);
+ mFetcher->removeFromHTTPQueue(mID, (S32Bytes)0);
mFetcher->removeHttpWaiter(mID);
mFetcher->updateStateStats(mCacheReadCount, mCacheWriteCount, mResourceWaitCount);
}
@@ -970,7 +1011,7 @@ void LLTextureFetchWorker::setupPacketData()
mFirstPacket = (data_size - FIRST_PACKET_SIZE) / MAX_IMG_PACKET_SIZE + 1;
if (FIRST_PACKET_SIZE + (mFirstPacket-1) * MAX_IMG_PACKET_SIZE != data_size)
{
- llwarns << "Bad CACHED TEXTURE size: " << data_size << " removing." << llendl;
+ LL_WARNS(LOG_TXT) << "Bad CACHED TEXTURE size: " << data_size << " removing." << LL_ENDL;
removeFromCache();
resetFormattedData();
clearPackets();
@@ -1093,14 +1134,14 @@ bool LLTextureFetchWorker::doWork(S32 param)
{
if (mState == INIT || mState == LOAD_FROM_NETWORK || mState == LOAD_FROM_SIMULATOR)
{
- LL_DEBUGS("Texture") << mID << " abort: mImagePriority < F_ALMOST_ZERO" << llendl;
+ LL_DEBUGS(LOG_TXT) << mID << " abort: mImagePriority < F_ALMOST_ZERO" << LL_ENDL;
return true; // abort
}
}
if(mState > CACHE_POST && !mCanUseNET && !mCanUseHTTP)
{
//nowhere to get data, abort.
- LL_WARNS("Texture") << mID << " abort, nowhere to get data" << llendl;
+ LL_WARNS(LOG_TXT) << mID << " abort, nowhere to get data" << LL_ENDL;
return true ;
}
@@ -1146,8 +1187,9 @@ bool LLTextureFetchWorker::doWork(S32 param)
setState(LOAD_FROM_TEXTURE_CACHE);
mInCache = FALSE;
mDesiredSize = llmax(mDesiredSize, TEXTURE_CACHE_ENTRY_SIZE); // min desired size is TEXTURE_CACHE_ENTRY_SIZE
- LL_DEBUGS("Texture") << mID << ": Priority: " << llformat("%8.0f",mImagePriority)
- << " Desired Discard: " << mDesiredDiscard << " Desired Size: " << mDesiredSize << LL_ENDL;
+ LL_DEBUGS(LOG_TXT) << mID << ": Priority: " << llformat("%8.0f",mImagePriority)
+ << " Desired Discard: " << mDesiredDiscard << " Desired Size: " << mDesiredSize << LL_ENDL;
+
// fall through
}
@@ -1178,9 +1220,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
offset, size, responder);
mCacheReadTimer.reset();
}
-/* SH-3980 - disabling caching of server bakes until we can fix the blurring problems */
-/* else if ((mUrl.empty()||mFTType==FTT_SERVER_BAKE) && mFetcher->canLoadFromCache()) */
- else if (mUrl.empty() && mFetcher->canLoadFromCache())
+ else if ((mUrl.empty() || mFTType==FTT_SERVER_BAKE) && mFetcher->canLoadFromCache())
{
setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); // Set priority first since Responder may change it
@@ -1216,7 +1256,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
//
//This should never happen
//
- LL_DEBUGS("Texture") << mID << " this should never happen" << llendl;
+ LL_DEBUGS(LOG_TXT) << mID << " this should never happen" << LL_ENDL;
return false;
}
}
@@ -1237,39 +1277,54 @@ bool LLTextureFetchWorker::doWork(S32 param)
mLoadedDiscard = mDesiredDiscard;
if (mLoadedDiscard < 0)
{
- LL_WARNS("Texture") << mID << " mLoadedDiscard is " << mLoadedDiscard
- << ", should be >=0" << llendl;
+ LL_WARNS(LOG_TXT) << mID << " mLoadedDiscard is " << mLoadedDiscard
+ << ", should be >=0" << LL_ENDL;
}
setState(DECODE_IMAGE);
mInCache = TRUE;
mWriteToCacheState = NOT_WRITE ;
- LL_DEBUGS("Texture") << mID << ": Cached. Bytes: " << mFormattedImage->getDataSize()
- << " Size: " << llformat("%dx%d",mFormattedImage->getWidth(),mFormattedImage->getHeight())
- << " Desired Discard: " << mDesiredDiscard << " Desired Size: " << mDesiredSize << LL_ENDL;
- LLTextureFetch::sCacheHitRate.addValue(100.f);
+ LL_DEBUGS(LOG_TXT) << mID << ": Cached. Bytes: " << mFormattedImage->getDataSize()
+ << " Size: " << llformat("%dx%d",mFormattedImage->getWidth(),mFormattedImage->getHeight())
+ << " Desired Discard: " << mDesiredDiscard << " Desired Size: " << mDesiredSize << LL_ENDL;
+ record(LLTextureFetch::sCacheHitRate, LLUnits::Ratio::fromValue(1));
}
else
{
if (mUrl.compare(0, 7, "file://") == 0)
{
// failed to load local file, we're done.
- LL_WARNS("Texture") << mID << ": abort, failed to load local file " << mUrl << LL_ENDL;
+ LL_WARNS(LOG_TXT) << mID << ": abort, failed to load local file " << mUrl << LL_ENDL;
return true;
}
// need more data
else
{
- LL_DEBUGS("Texture") << mID << ": Not in Cache" << LL_ENDL;
+ LL_DEBUGS(LOG_TXT) << mID << ": Not in Cache" << LL_ENDL;
setState(LOAD_FROM_NETWORK);
}
// fall through
- LLTextureFetch::sCacheHitRate.addValue(0.f);
+ record(LLTextureFetch::sCacheHitRate, LLUnits::Ratio::fromValue(0));
}
}
if (mState == LOAD_FROM_NETWORK)
{
+ // Check for retries to previous server failures.
+ F32 wait_seconds;
+ if (mFetchRetryPolicy.shouldRetry(wait_seconds))
+ {
+ if (wait_seconds <= 0.0)
+ {
+ LL_INFOS(LOG_TXT) << mID << " retrying now" << LL_ENDL;
+ }
+ else
+ {
+ //LL_INFOS(LOG_TXT) << mID << " waiting to retry for " << wait_seconds << " seconds" << LL_ENDL;
+ return false;
+ }
+ }
+
static LLCachedControl<bool> use_http(gSavedSettings,"ImagePipelineUseHTTP", true);
// if (mHost != LLHost::invalid) get_url = false;
@@ -1286,27 +1341,33 @@ bool LLTextureFetchWorker::doWork(S32 param)
std::string http_url = region->getHttpUrl() ;
if (!http_url.empty())
{
- mUrl = http_url + "/?texture_id=" + mID.asString().c_str();
+ if (mFTType != FTT_DEFAULT)
+ {
+ LL_WARNS(LOG_TXT) << "trying to seek a non-default texture on the sim. Bad!" << LL_ENDL;
+ }
+ setUrl(http_url + "/?texture_id=" + mID.asString().c_str());
+ LL_DEBUGS("Texture") << "Texture URL " << mUrl << LL_ENDL;
mWriteToCacheState = CAN_WRITE ; //because this texture has a fixed texture id.
}
else
{
mCanUseHTTP = false ;
+ LL_DEBUGS("Texture") << "Texture not available via HTTP: no URL " << mUrl << LL_ENDL;
}
}
else
{
// This will happen if not logged in or if a region deoes not have HTTP Texture enabled
- //llwarns << "Region not found for host: " << mHost << llendl;
+ //LL_WARNS(LOG_TXT) << "Region not found for host: " << mHost << LL_ENDL;
+ LL_DEBUGS("Texture") << "Texture not available via HTTP: no region " << mUrl << LL_ENDL;
mCanUseHTTP = false;
}
}
-#if 0 /* SH-3980 - disabling caching of server bakes until we can fix the blurring problems */
- if (mFTType == FTT_SERVER_BAKE)
+ else if (mFTType == FTT_SERVER_BAKE)
{
mWriteToCacheState = CAN_WRITE;
}
-#endif
+
if (mCanUseHTTP && !mUrl.empty())
{
setState(WAIT_HTTP_RESOURCE);
@@ -1340,7 +1401,6 @@ bool LLTextureFetchWorker::doWork(S32 param)
//recordTextureStart(false);
//setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority);
- LL_DEBUGS("Texture") << mID << " does this happen?" << llendl;
return false;
}
}
@@ -1353,20 +1413,20 @@ bool LLTextureFetchWorker::doWork(S32 param)
}
if (processSimulatorPackets())
{
- LL_DEBUGS("Texture") << mID << ": Loaded from Sim. Bytes: " << mFormattedImage->getDataSize() << LL_ENDL;
+ LL_DEBUGS(LOG_TXT) << mID << ": Loaded from Sim. Bytes: " << mFormattedImage->getDataSize() << LL_ENDL;
mFetcher->removeFromNetworkQueue(this, false);
if (mFormattedImage.isNull() || !mFormattedImage->getDataSize())
{
// processSimulatorPackets() failed
-// llwarns << "processSimulatorPackets() failed to load buffer" << llendl;
- LL_WARNS("Texture") << mID << " processSimulatorPackets() failed to load buffer" << llendl;
+// LL_WARNS(LOG_TXT) << "processSimulatorPackets() failed to load buffer" << LL_ENDL;
+ LL_WARNS(LOG_TXT) << mID << " processSimulatorPackets() failed to load buffer" << LL_ENDL;
return true; // failed
}
setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
if (mLoadedDiscard < 0)
{
- LL_WARNS("Texture") << mID << " mLoadedDiscard is " << mLoadedDiscard
- << ", should be >=0" << llendl;
+ LL_WARNS(LOG_TXT) << mID << " mLoadedDiscard is " << mLoadedDiscard
+ << ", should be >=0" << LL_ENDL;
}
setState(DECODE_IMAGE);
mWriteToCacheState = SHOULD_WRITE;
@@ -1416,7 +1476,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
if (! mCanUseHTTP)
{
releaseHttpSemaphore();
- LL_WARNS("Texture") << mID << " abort: SEND_HTTP_REQ but !mCanUseHTTP" << llendl;
+ LL_WARNS(LOG_TXT) << mID << " abort: SEND_HTTP_REQ but !mCanUseHTTP" << LL_ENDL;
return true; // abort
}
@@ -1435,8 +1495,8 @@ bool LLTextureFetchWorker::doWork(S32 param)
setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
if (mLoadedDiscard < 0)
{
- LL_WARNS("Texture") << mID << " mLoadedDiscard is " << mLoadedDiscard
- << ", should be >=0" << llendl;
+ LL_WARNS(LOG_TXT) << mID << " mLoadedDiscard is " << mLoadedDiscard
+ << ", should be >=0" << LL_ENDL;
}
setState(DECODE_IMAGE);
releaseHttpSemaphore();
@@ -1445,7 +1505,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
else
{
releaseHttpSemaphore();
- LL_WARNS("Texture") << mID << " SEND_HTTP_REQ abort: cur_size " << cur_size << " <=0" << llendl;
+ LL_WARNS(LOG_TXT) << mID << " SEND_HTTP_REQ abort: cur_size " << cur_size << " <=0" << LL_ENDL;
return true; // abort.
}
}
@@ -1476,24 +1536,28 @@ bool LLTextureFetchWorker::doWork(S32 param)
mLoaded = FALSE;
mGetStatus = LLCore::HttpStatus();
mGetReason.clear();
- LL_DEBUGS("Texture") << "HTTP GET: " << mID << " Offset: " << mRequestedOffset
- << " Bytes: " << mRequestedSize
- << " Bandwidth(kbps): " << mFetcher->getTextureBandwidth() << "/" << mFetcher->mMaxBandwidth
- << LL_ENDL;
+ LL_DEBUGS(LOG_TXT) << "HTTP GET: " << mID << " Offset: " << mRequestedOffset
+ << " Bytes: " << mRequestedSize
+ << " Bandwidth(kbps): " << mFetcher->getTextureBandwidth() << "/" << mFetcher->mMaxBandwidth
+ << LL_ENDL;
// Will call callbackHttpGet when curl request completes
+ // Only server bake images use the returned headers currently, for getting retry-after field.
+ LLCore::HttpOptions *options = (mFTType == FTT_SERVER_BAKE) ? mFetcher->mHttpOptionsWithHeaders: mFetcher->mHttpOptions;
mHttpHandle = mFetcher->mHttpRequest->requestGetByteRange(mHttpPolicyClass,
mWorkPriority,
mUrl,
mRequestedOffset,
- mRequestedSize,
- mFetcher->mHttpOptions,
+ (mRequestedOffset + mRequestedSize) > HTTP_REQUESTS_RANGE_END_MAX
+ ? 0
+ : mRequestedSize,
+ options,
mFetcher->mHttpHeaders,
this);
}
if (LLCORE_HTTP_HANDLE_INVALID == mHttpHandle)
{
- llwarns << "HTTP GET request failed for " << mID << llendl;
+ LL_WARNS(LOG_TXT) << "HTTP GET request failed for " << mID << LL_ENDL;
resetFormattedData();
releaseHttpSemaphore();
return true; // failed
@@ -1519,16 +1583,22 @@ bool LLTextureFetchWorker::doWork(S32 param)
{
if (http_not_found == mGetStatus)
{
- if(mWriteToCacheState == NOT_WRITE) //map tiles
+ if (mFTType != FTT_MAP_TILE)
+ {
+ LL_WARNS(LOG_TXT) << "Texture missing from server (404): " << mUrl << LL_ENDL;
+ }
+
+ if(mWriteToCacheState == NOT_WRITE) //map tiles or server bakes
{
setState(DONE);
releaseHttpSemaphore();
- LL_DEBUGS("Texture") << mID << " abort: WAIT_HTTP_REQ not found" << llendl;
- return true; // failed, means no map tile on the empty region.
+ if (mFTType != FTT_MAP_TILE)
+ {
+ LL_WARNS(LOG_TXT) << mID << " abort: WAIT_HTTP_REQ not found" << LL_ENDL;
+ }
+ return true;
}
- llwarns << "Texture missing from server (404): " << mUrl << llendl;
-
// roll back to try UDP
if (mCanUseNET)
{
@@ -1542,7 +1612,11 @@ bool LLTextureFetchWorker::doWork(S32 param)
}
else if (http_service_unavail == mGetStatus)
{
- LL_INFOS_ONCE("Texture") << "Texture server busy (503): " << mUrl << LL_ENDL;
+ LL_INFOS_ONCE(LOG_TXT) << "Texture server busy (503): " << mUrl << LL_ENDL;
+ LL_INFOS(LOG_TXT) << "503: HTTP GET failed for: " << mUrl
+ << " Status: " << mGetStatus.toHex()
+ << " Reason: '" << mGetReason << "'"
+ << LL_ENDL;
}
else if (http_not_sat == mGetStatus)
{
@@ -1551,13 +1625,16 @@ bool LLTextureFetchWorker::doWork(S32 param)
}
else
{
- llinfos << "HTTP GET failed for: " << mUrl
- << " Status: " << mGetStatus.toTerseString()
- << " Reason: '" << mGetReason << "'"
- << llendl;
+ LL_INFOS(LOG_TXT) << "HTTP GET failed for: " << mUrl
+ << " Status: " << mGetStatus.toTerseString()
+ << " Reason: '" << mGetReason << "'"
+ << LL_ENDL;
}
- mUrl.clear();
+ if (mFTType != FTT_SERVER_BAKE)
+ {
+ mUrl.clear();
+ }
if (cur_size > 0)
{
// Use available data
@@ -1565,8 +1642,8 @@ bool LLTextureFetchWorker::doWork(S32 param)
setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
if (mLoadedDiscard < 0)
{
- LL_WARNS("Texture") << mID << " mLoadedDiscard is " << mLoadedDiscard
- << ", should be >=0" << llendl;
+ LL_WARNS(LOG_TXT) << mID << " mLoadedDiscard is " << mLoadedDiscard
+ << ", should be >=0" << LL_ENDL;
}
setState(DECODE_IMAGE);
releaseHttpSemaphore();
@@ -1577,14 +1654,14 @@ bool LLTextureFetchWorker::doWork(S32 param)
resetFormattedData();
setState(DONE);
releaseHttpSemaphore();
- LL_WARNS("Texture") << mID << " abort: fail harder" << llendl;
+ LL_WARNS(LOG_TXT) << mID << " abort: fail harder" << LL_ENDL;
return true; // failed
}
// Clear the url since we're done with the fetch
// Note: mUrl is used to check is fetching is required so failure to clear it will force an http fetch
// next time the texture is requested, even if the data have already been fetched.
- if(mWriteToCacheState != NOT_WRITE)
+ if(mWriteToCacheState != NOT_WRITE && mFTType != FTT_SERVER_BAKE)
{
// Why do we want to keep url if NOT_WRITE - is this a proxy for map tiles?
mUrl.clear();
@@ -1601,7 +1678,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
// abort.
setState(DONE);
- LL_WARNS("Texture") << mID << " abort: no data received" << llendl;
+ LL_WARNS(LOG_TXT) << mID << " abort: no data received" << LL_ENDL;
releaseHttpSemaphore();
return true;
}
@@ -1617,8 +1694,8 @@ bool LLTextureFetchWorker::doWork(S32 param)
// Get back into alignment.
if (mHttpReplyOffset > cur_size)
{
- LL_WARNS("Texture") << "Partial HTTP response produces break in image data for texture "
- << mID << ". Aborting load." << LL_ENDL;
+ LL_WARNS(LOG_TXT) << "Partial HTTP response produces break in image data for texture "
+ << mID << ". Aborting load." << LL_ENDL;
setState(DONE);
releaseHttpSemaphore();
return true;
@@ -1669,8 +1746,8 @@ bool LLTextureFetchWorker::doWork(S32 param)
mLoadedDiscard = mRequestedDiscard;
if (mLoadedDiscard < 0)
{
- LL_WARNS("Texture") << mID << " mLoadedDiscard is " << mLoadedDiscard
- << ", should be >=0" << llendl;
+ LL_WARNS(LOG_TXT) << mID << " mLoadedDiscard is " << mLoadedDiscard
+ << ", should be >=0" << LL_ENDL;
}
setState(DECODE_IMAGE);
if (mWriteToCacheState != NOT_WRITE)
@@ -1711,26 +1788,26 @@ bool LLTextureFetchWorker::doWork(S32 param)
{
// We aborted, don't decode
setState(DONE);
- LL_DEBUGS("Texture") << mID << " DECODE_IMAGE abort: desired discard " << mDesiredDiscard << "<0" << llendl;
+ LL_DEBUGS(LOG_TXT) << mID << " DECODE_IMAGE abort: desired discard " << mDesiredDiscard << "<0" << LL_ENDL;
return true;
}
if (mFormattedImage->getDataSize() <= 0)
{
- llwarns << "Decode entered with invalid mFormattedImage. ID = " << mID << llendl;
+ LL_WARNS(LOG_TXT) << "Decode entered with invalid mFormattedImage. ID = " << mID << LL_ENDL;
//abort, don't decode
setState(DONE);
- LL_DEBUGS("Texture") << mID << " DECODE_IMAGE abort: (mFormattedImage->getDataSize() <= 0)" << llendl;
+ LL_DEBUGS(LOG_TXT) << mID << " DECODE_IMAGE abort: (mFormattedImage->getDataSize() <= 0)" << LL_ENDL;
return true;
}
if (mLoadedDiscard < 0)
{
- llwarns << "Decode entered with invalid mLoadedDiscard. ID = " << mID << llendl;
+ LL_WARNS(LOG_TXT) << "Decode entered with invalid mLoadedDiscard. ID = " << mID << LL_ENDL;
//abort, don't decode
setState(DONE);
- LL_DEBUGS("Texture") << mID << " DECODE_IMAGE abort: mLoadedDiscard < 0" << llendl;
+ LL_DEBUGS(LOG_TXT) << mID << " DECODE_IMAGE abort: mLoadedDiscard < 0" << LL_ENDL;
return true;
}
@@ -1741,8 +1818,8 @@ bool LLTextureFetchWorker::doWork(S32 param)
U32 image_priority = LLWorkerThread::PRIORITY_NORMAL | mWorkPriority;
mDecoded = FALSE;
setState(DECODE_IMAGE_UPDATE);
- LL_DEBUGS("Texture") << mID << ": Decoding. Bytes: " << mFormattedImage->getDataSize() << " Discard: " << discard
- << " All Data: " << mHaveAllData << LL_ENDL;
+ LL_DEBUGS(LOG_TXT) << mID << ": Decoding. Bytes: " << mFormattedImage->getDataSize() << " Discard: " << discard
+ << " All Data: " << mHaveAllData << LL_ENDL;
mDecodeHandle = mFetcher->mImageDecodeThread->decodeImage(mFormattedImage, image_priority, discard, mNeedsAux,
new DecodeResponder(mFetcher, mID, this));
// fall though
@@ -1759,11 +1836,11 @@ bool LLTextureFetchWorker::doWork(S32 param)
if (mDecodedDiscard < 0)
{
- LL_DEBUGS("Texture") << mID << ": Failed to Decode." << LL_ENDL;
+ LL_DEBUGS(LOG_TXT) << mID << ": Failed to Decode." << LL_ENDL;
if (mCachedSize > 0 && !mInLocalCache && mRetryAttempt == 0)
{
// Cache file should be deleted, try again
-// llwarns << mID << ": Decode of cached file failed (removed), retrying" << llendl;
+ LL_WARNS(LOG_TXT) << mID << ": Decode of cached file failed (removed), retrying" << LL_ENDL;
llassert_always(mDecodeHandle == 0);
mFormattedImage = NULL;
++mRetryAttempt;
@@ -1773,15 +1850,15 @@ bool LLTextureFetchWorker::doWork(S32 param)
}
else
{
-// llwarns << "UNABLE TO LOAD TEXTURE: " << mID << " RETRIES: " << mRetryAttempt << llendl;
+// LL_WARNS(LOG_TXT) << "UNABLE TO LOAD TEXTURE: " << mID << " RETRIES: " << mRetryAttempt << LL_ENDL;
setState(DONE); // failed
}
}
else
{
llassert_always(mRawImage.notNull());
- LL_DEBUGS("Texture") << mID << ": Decoded. Discard: " << mDecodedDiscard
- << " Raw Image: " << llformat("%dx%d",mRawImage->getWidth(),mRawImage->getHeight()) << LL_ENDL;
+ LL_DEBUGS(LOG_TXT) << mID << ": Decoded. Discard: " << mDecodedDiscard
+ << " Raw Image: " << llformat("%dx%d",mRawImage->getWidth(),mRawImage->getHeight()) << LL_ENDL;
setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
setState(WRITE_TO_CACHE);
}
@@ -1853,9 +1930,9 @@ bool LLTextureFetchWorker::doWork(S32 param)
{
// More data was requested, return to INIT
setState(INIT);
- LL_DEBUGS("Texture") << mID << " more data requested, returning to INIT: "
- << " mDecodedDiscard " << mDecodedDiscard << ">= 0 && mDesiredDiscard " << mDesiredDiscard
- << "<" << " mDecodedDiscard " << mDecodedDiscard << llendl;
+ LL_DEBUGS(LOG_TXT) << mID << " more data requested, returning to INIT: "
+ << " mDecodedDiscard " << mDecodedDiscard << ">= 0 && mDesiredDiscard " << mDesiredDiscard
+ << "<" << " mDecodedDiscard " << mDecodedDiscard << LL_ENDL;
setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
return false;
}
@@ -1883,37 +1960,65 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe
if (log_to_viewer_log || log_to_sim)
{
- U64 timeNow = LLTimer::getTotalTime();
- mFetcher->mTextureInfo.setRequestStartTime(mID, mMetricsStartTime);
+ mFetcher->mTextureInfo.setRequestStartTime(mID, mMetricsStartTime.value());
mFetcher->mTextureInfo.setRequestType(mID, LLTextureInfoDetails::REQUEST_TYPE_HTTP);
mFetcher->mTextureInfo.setRequestSize(mID, mRequestedSize);
mFetcher->mTextureInfo.setRequestOffset(mID, mRequestedOffset);
- mFetcher->mTextureInfo.setRequestCompleteTimeAndLog(mID, timeNow);
+ mFetcher->mTextureInfo.setRequestCompleteTimeAndLog(mID, LLTimer::getTotalTime());
}
+ static LLCachedControl<F32> fake_failure_rate(gSavedSettings, "TextureFetchFakeFailureRate", 0.0f);
+ F32 rand_val = ll_frand();
+ F32 rate = fake_failure_rate;
+ if (mFTType == FTT_SERVER_BAKE && (fake_failure_rate > 0.0) && (rand_val < fake_failure_rate))
+ {
+ LL_WARNS(LOG_TXT) << mID << " for debugging, setting fake failure status for texture " << mID
+ << " (rand was " << rand_val << "/" << rate << ")" << LL_ENDL;
+ response->setStatus(LLCore::HttpStatus(503));
+ }
bool success = true;
bool partial = false;
LLCore::HttpStatus status(response->getStatus());
+ if (!status && (mFTType == FTT_SERVER_BAKE))
+ {
+ LL_INFOS(LOG_TXT) << mID << " state " << e_state_name[mState] << LL_ENDL;
+ mFetchRetryPolicy.onFailure(response);
+ F32 retry_after;
+ if (mFetchRetryPolicy.shouldRetry(retry_after))
+ {
+ LL_INFOS(LOG_TXT) << mID << " will retry after " << retry_after << " seconds, resetting state to LOAD_FROM_NETWORK" << LL_ENDL;
+ mFetcher->removeFromHTTPQueue(mID, S32Bytes(0));
+ std::string reason(status.toString());
+ setGetStatus(status, reason);
+ releaseHttpSemaphore();
+ setState(LOAD_FROM_NETWORK);
+ return;
+ }
+ else
+ {
+ LL_INFOS(LOG_TXT) << mID << " will not retry" << LL_ENDL;
+ }
+ }
+ else
+ {
+ mFetchRetryPolicy.onSuccess();
+ }
- LL_DEBUGS("Texture") << "HTTP COMPLETE: " << mID
- << " status: " << status.toTerseString()
- << " '" << status.toString() << "'"
- << llendl;
-// unsigned int offset(0), length(0), full_length(0);
-// response->getRange(&offset, &length, &full_length);
-// llwarns << "HTTP COMPLETE: " << mID << " handle: " << handle
-// << " status: " << status.toULong() << " '" << status.toString() << "'"
-// << " req offset: " << mRequestedOffset << " req length: " << mRequestedSize
-// << " offset: " << offset << " length: " << length
-// << llendl;
+ std::string reason(status.toString());
+ setGetStatus(status, reason);
+ LL_DEBUGS(LOG_TXT) << "HTTP COMPLETE: " << mID
+ << " status: " << status.toTerseString()
+ << " '" << reason << "'"
+ << LL_ENDL;
if (! status)
{
success = false;
- std::string reason(status.toString());
- setGetStatus(status, reason);
- llwarns << "CURL GET FAILED, status: " << status.toTerseString()
- << " reason: " << reason << llendl;
+ if (mFTType != FTT_MAP_TILE) // missing map tiles are normal, don't complain about them.
+ {
+ LL_WARNS(LOG_TXT) << "CURL GET FAILED, status: " << status.toTerseString()
+ << " reason: " << reason << LL_ENDL;
+ }
}
else
{
@@ -1927,7 +2032,7 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe
partial = (par_status == status);
}
- S32 data_size = callbackHttpGet(response, partial, success);
+ S32BytesImplicit data_size = callbackHttpGet(response, partial, success);
if (log_texture_traffic && data_size > 0)
{
@@ -2123,13 +2228,13 @@ S32 LLTextureFetchWorker::callbackHttpGet(LLCore::HttpResponse * response,
if (mState != WAIT_HTTP_REQ)
{
- llwarns << "callbackHttpGet for unrequested fetch worker: " << mID
- << " req=" << mSentRequest << " state= " << mState << llendl;
+ LL_WARNS(LOG_TXT) << "callbackHttpGet for unrequested fetch worker: " << mID
+ << " req=" << mSentRequest << " state= " << mState << LL_ENDL;
return data_size;
}
if (mLoaded)
{
- llwarns << "Duplicate callback for " << mID.asString() << llendl;
+ LL_WARNS(LOG_TXT) << "Duplicate callback for " << mID.asString() << LL_ENDL;
return data_size ; // ignore duplicate callback
}
if (success)
@@ -2138,7 +2243,7 @@ S32 LLTextureFetchWorker::callbackHttpGet(LLCore::HttpResponse * response,
LLCore::BufferArray * body(response->getBody());
data_size = body ? body->size() : 0;
- LL_DEBUGS("Texture") << "HTTP RECEIVED: " << mID.asString() << " Bytes: " << data_size << LL_ENDL;
+ LL_DEBUGS(LOG_TXT) << "HTTP RECEIVED: " << mID.asString() << " Bytes: " << data_size << LL_ENDL;
if (data_size > 0)
{
LLViewerStatsRecorder::instance().textureFetch(data_size);
@@ -2178,10 +2283,10 @@ S32 LLTextureFetchWorker::callbackHttpGet(LLCore::HttpResponse * response,
// response body becomes the entire dataset.
if (data_size <= mRequestedOffset)
{
- LL_WARNS("Texture") << "Fetched entire texture " << mID
- << " when it was expected to be marked complete. mImageSize: "
- << mFileSize << " datasize: " << mFormattedImage->getDataSize()
- << LL_ENDL;
+ LL_WARNS(LOG_TXT) << "Fetched entire texture " << mID
+ << " when it was expected to be marked complete. mImageSize: "
+ << mFileSize << " datasize: " << mFormattedImage->getDataSize()
+ << LL_ENDL;
}
mHaveAllData = TRUE;
llassert_always(mDecodeHandle == 0);
@@ -2194,7 +2299,7 @@ S32 LLTextureFetchWorker::callbackHttpGet(LLCore::HttpResponse * response,
else if (data_size > mRequestedSize)
{
// *TODO: This shouldn't be happening any more (REALLY don't expect this anymore)
- llwarns << "data_size = " << data_size << " > requested: " << mRequestedSize << llendl;
+ LL_WARNS(LOG_TXT) << "data_size = " << data_size << " > requested: " << mRequestedSize << LL_ENDL;
mHaveAllData = TRUE;
llassert_always(mDecodeHandle == 0);
mFormattedImage = NULL; // discard any previous data we had
@@ -2229,7 +2334,7 @@ void LLTextureFetchWorker::callbackCacheRead(bool success, LLImageFormatted* ima
LLMutexLock lock(&mWorkMutex); // +Mw
if (mState != LOAD_FROM_TEXTURE_CACHE)
{
-// llwarns << "Read callback for " << mID << " with state = " << mState << llendl;
+// LL_WARNS(LOG_TXT) << "Read callback for " << mID << " with state = " << mState << LL_ENDL;
return;
}
if (success)
@@ -2254,7 +2359,7 @@ void LLTextureFetchWorker::callbackCacheWrite(bool success)
LLMutexLock lock(&mWorkMutex); // +Mw
if (mState != WAIT_ON_WRITE)
{
-// llwarns << "Write callback for " << mID << " with state = " << mState << llendl;
+// LL_WARNS(LOG_TXT) << "Write callback for " << mID << " with state = " << mState << LL_ENDL;
return;
}
mWritten = TRUE;
@@ -2273,7 +2378,7 @@ void LLTextureFetchWorker::callbackDecoded(bool success, LLImageRaw* raw, LLImag
}
if (mState != DECODE_IMAGE_UPDATE)
{
-// llwarns << "Decode callback for " << mID << " with state = " << mState << llendl;
+// LL_WARNS(LOG_TXT) << "Decode callback for " << mID << " with state = " << mState << LL_ENDL;
mDecodeHandle = 0;
return;
}
@@ -2286,17 +2391,17 @@ void LLTextureFetchWorker::callbackDecoded(bool success, LLImageRaw* raw, LLImag
mRawImage = raw;
mAuxImage = aux;
mDecodedDiscard = mFormattedImage->getDiscardLevel();
- LL_DEBUGS("Texture") << mID << ": Decode Finished. Discard: " << mDecodedDiscard
- << " Raw Image: " << llformat("%dx%d",mRawImage->getWidth(),mRawImage->getHeight()) << LL_ENDL;
+ LL_DEBUGS(LOG_TXT) << mID << ": Decode Finished. Discard: " << mDecodedDiscard
+ << " Raw Image: " << llformat("%dx%d",mRawImage->getWidth(),mRawImage->getHeight()) << LL_ENDL;
}
else
{
- llwarns << "DECODE FAILED: " << mID << " Discard: " << (S32)mFormattedImage->getDiscardLevel() << llendl;
+ LL_WARNS(LOG_TXT) << "DECODE FAILED: " << mID << " Discard: " << (S32)mFormattedImage->getDiscardLevel() << LL_ENDL;
removeFromCache();
mDecodedDiscard = -1; // Redundant, here for clarity and paranoia
}
mDecoded = TRUE;
-// llinfos << mID << " : DECODE COMPLETE " << llendl;
+// LL_INFOS(LOG_TXT) << mID << " : DECODE COMPLETE " << LL_ENDL;
setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
mCacheReadTime = mCacheReadTimer.getElapsedTimeF32();
} // -Mw
@@ -2329,11 +2434,11 @@ bool LLTextureFetchWorker::writeToCacheComplete()
// Threads: Ttf
void LLTextureFetchWorker::recordTextureStart(bool is_http)
{
- if (! mMetricsStartTime)
+ if (! mMetricsStartTime.value())
{
mMetricsStartTime = LLViewerAssetStatsFF::get_timestamp();
}
- LLViewerAssetStatsFF::record_enqueue_thread1(LLViewerAssetType::AT_TEXTURE,
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_TEXTURE,
is_http,
LLImageBase::TYPE_AVATAR_BAKE == mType);
}
@@ -2342,15 +2447,15 @@ void LLTextureFetchWorker::recordTextureStart(bool is_http)
// Threads: Ttf
void LLTextureFetchWorker::recordTextureDone(bool is_http)
{
- if (mMetricsStartTime)
+ if (mMetricsStartTime.value())
{
- LLViewerAssetStatsFF::record_response_thread1(LLViewerAssetType::AT_TEXTURE,
+ LLViewerAssetStatsFF::record_response(LLViewerAssetType::AT_TEXTURE,
is_http,
LLImageBase::TYPE_AVATAR_BAKE == mType,
LLViewerAssetStatsFF::get_timestamp() - mMetricsStartTime);
- mMetricsStartTime = 0;
+ mMetricsStartTime = (U32Seconds)0;
}
- LLViewerAssetStatsFF::record_dequeue_thread1(LLViewerAssetType::AT_TEXTURE,
+ LLViewerAssetStatsFF::record_dequeue(LLViewerAssetType::AT_TEXTURE,
is_http,
LLImageBase::TYPE_AVATAR_BAKE == mType);
}
@@ -2390,7 +2495,7 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image
mFetcherLocked(FALSE)
{
mMaxBandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS");
- mTextureInfo.setUpLogging(gSavedSettings.getBOOL("LogTextureDownloadsToViewerLog"), gSavedSettings.getBOOL("LogTextureDownloadsToSimulator"), gSavedSettings.getU32("TextureLoggingThreshold"));
+ mTextureInfo.setUpLogging(gSavedSettings.getBOOL("LogTextureDownloadsToViewerLog"), gSavedSettings.getBOOL("LogTextureDownloadsToSimulator"), U32Bytes(gSavedSettings.getU32("TextureLoggingThreshold")));
LLTextureFetchDebugger::sDebuggerEnabled = gSavedSettings.getBOOL("TextureFetchDebuggerEnabled");
if(LLTextureFetchDebugger::isEnabled())
@@ -2473,14 +2578,18 @@ bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const
{
return false;
}
-
+
+ if (f_type == FTT_SERVER_BAKE)
+ {
+ LL_DEBUGS("Avatar") << " requesting " << id << " " << w << "x" << h << " discard " << desired_discard << " type " << f_type << LL_ENDL;
+ }
LLTextureFetchWorker* worker = getWorker(id) ;
if (worker)
{
if (worker->mHost != host)
{
- llwarns << "LLTextureFetch::createRequest " << id << " called with multiple hosts: "
- << host << " != " << worker->mHost << llendl;
+ LL_WARNS(LOG_TXT) << "LLTextureFetch::createRequest " << id << " called with multiple hosts: "
+ << host << " != " << worker->mHost << LL_ENDL;
removeRequest(worker, true);
worker = NULL;
return false;
@@ -2489,9 +2598,21 @@ bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const
S32 desired_size;
std::string exten = gDirUtilp->getExtension(url);
- if (!url.empty() && (!exten.empty() && LLImageBase::getCodecFromExtension(exten) != IMG_CODEC_J2C))
+ //if (f_type == FTT_SERVER_BAKE)
+ if ((f_type == FTT_SERVER_BAKE) && !url.empty() && !exten.empty() && (LLImageBase::getCodecFromExtension(exten) != IMG_CODEC_J2C))
+ {
+ // SH-4030: This case should be redundant with the following one, just
+ // breaking it out here to clarify that it's intended behavior.
+ llassert(!url.empty() && (!exten.empty() && LLImageBase::getCodecFromExtension(exten) != IMG_CODEC_J2C));
+
+ // Do full requests for baked textures to reduce interim blurring.
+ LL_DEBUGS(LOG_TXT) << "full request for " << id << " texture is FTT_SERVER_BAKE" << LL_ENDL;
+ desired_size = MAX_IMAGE_DATA_SIZE;
+ desired_discard = 0;
+ }
+ else if (!url.empty() && (!exten.empty() && LLImageBase::getCodecFromExtension(exten) != IMG_CODEC_J2C))
{
- LL_DEBUGS("Texture") << "full request for " << id << " exten is not J2C: " << exten << llendl;
+ LL_DEBUGS(LOG_TXT) << "full request for " << id << " exten is not J2C: " << exten << LL_ENDL;
// Only do partial requests for J2C at the moment
desired_size = MAX_IMAGE_DATA_SIZE;
desired_discard = 0;
@@ -2531,7 +2652,10 @@ bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const
worker->mNeedsAux = needs_aux;
worker->setImagePriority(priority);
worker->setDesiredDiscard(desired_discard, desired_size);
- worker->setCanUseHTTP(can_use_http) ;
+ worker->setCanUseHTTP(can_use_http);
+
+ //MAINT-4184 url is always empty. Do not set with it.
+
if (!worker->haveWork())
{
worker->setState(LLTextureFetchWorker::INIT);
@@ -2558,7 +2682,8 @@ bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const
worker->unlockWorkMutex(); // -Mw
}
- LL_DEBUGS("Texture") << "REQUESTED: " << id << " Discard: " << desired_discard << " size " << desired_size << llendl;
+ LL_DEBUGS(LOG_TXT) << "REQUESTED: " << id << " f_type " << fttype_to_string(f_type)
+ << " Discard: " << desired_discard << " size " << desired_size << LL_ENDL;
return true;
}
@@ -2608,11 +2733,11 @@ void LLTextureFetch::addToHTTPQueue(const LLUUID& id)
} // -Mfnq
// Threads: T*
-void LLTextureFetch::removeFromHTTPQueue(const LLUUID& id, S32 received_size)
+void LLTextureFetch::removeFromHTTPQueue(const LLUUID& id, S32Bytes received_size)
{
LLMutexLock lock(&mNetworkQueueMutex); // +Mfnq
mHTTPTextureQueue.erase(id);
- mHTTPTextureBits += received_size * 8; // Approximate - does not include header bits
+ mHTTPTextureBits += received_size; // Approximate - does not include header bits
} // -Mfnq
// NB: If you change deleteRequest() you should probably make
@@ -2737,7 +2862,8 @@ LLTextureFetchWorker* LLTextureFetch::getWorker(const LLUUID& id)
// Threads: T*
bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level,
- LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux)
+ LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux,
+ LLCore::HttpStatus& last_http_get_status)
{
bool res = false;
LLTextureFetchWorker* worker = getWorker(id);
@@ -2752,23 +2878,24 @@ bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level,
// Should only happen if we set mDebugPause...
if (!mDebugPause)
{
-// llwarns << "Adding work for inactive worker: " << id << llendl;
+// LL_WARNS(LOG_TXT) << "Adding work for inactive worker: " << id << LL_ENDL;
worker->addWork(0, LLWorkerThread::PRIORITY_HIGH | worker->mWorkPriority);
}
}
else if (worker->checkWork())
{
worker->lockWorkMutex(); // +Mw
+ last_http_get_status = worker->mGetStatus;
discard_level = worker->mDecodedDiscard;
raw = worker->mRawImage;
aux = worker->mAuxImage;
- F32 cache_read_time = worker->mCacheReadTime;
- if (cache_read_time != 0.f)
+ F32Seconds cache_read_time(worker->mCacheReadTime);
+ if (cache_read_time != (F32Seconds)0.f)
{
- sCacheReadLatency.addValue(cache_read_time * 1000.f);
+ record(sCacheReadLatency, cache_read_time);
}
res = true;
- LL_DEBUGS("Texture") << id << ": Request Finished. State: " << worker->mState << " Discard: " << discard_level << LL_ENDL;
+ LL_DEBUGS(LOG_TXT) << id << ": Request Finished. State: " << worker->mState << " Discard: " << discard_level << LL_ENDL;
worker->unlockWorkMutex(); // -Mw
}
else
@@ -2873,9 +3000,9 @@ void LLTextureFetch::commonUpdate()
LLCore::HttpStatus status = mHttpRequest->update(0);
if (! status)
{
- LL_INFOS_ONCE("Texture") << "Problem during HTTP servicing. Reason: "
- << status.toString()
- << LL_ENDL;
+ LL_INFOS_ONCE(LOG_TXT) << "Problem during HTTP servicing. Reason: "
+ << status.toString()
+ << LL_ENDL;
}
}
@@ -2889,10 +3016,10 @@ S32 LLTextureFetch::update(F32 max_time_ms)
{
mNetworkQueueMutex.lock(); // +Mfnq
- mMaxBandwidth = band_width;
+ mMaxBandwidth = band_width();
- gTextureList.sTextureBits += mHTTPTextureBits;
- mHTTPTextureBits = 0;
+ add(LLStatViewer::TEXTURE_NETWORK_DATA_RECEIVED, mHTTPTextureBits);
+ mHTTPTextureBits = (U32Bits)0;
mNetworkQueueMutex.unlock(); // -Mfnq
}
@@ -2955,11 +3082,11 @@ void LLTextureFetch::startThread()
// Threads: Ttf
void LLTextureFetch::endThread()
{
- LL_INFOS("Texture") << "CacheReads: " << mTotalCacheReadCount
- << ", CacheWrites: " << mTotalCacheWriteCount
- << ", ResWaits: " << mTotalResourceWaitCount
- << ", TotalHTTPReq: " << getTotalNumHTTPRequests()
- << LL_ENDL;
+ LL_INFOS(LOG_TXT) << "CacheReads: " << mTotalCacheReadCount
+ << ", CacheWrites: " << mTotalCacheWriteCount
+ << ", ResWaits: " << mTotalResourceWaitCount
+ << ", TotalHTTPReq: " << getTotalNumHTTPRequests()
+ << LL_ENDL;
}
// Threads: Ttf
@@ -2988,7 +3115,7 @@ void LLTextureFetch::threadedUpdate()
S32 q = mCurlGetRequest->getQueued();
if (q > 0)
{
- llinfos << "Queued gets: " << q << llendl;
+ LL_INFOS(LOG_TXT) << "Queued gets: " << q << LL_ENDL;
info_timer.reset();
}
}
@@ -3037,7 +3164,7 @@ void LLTextureFetch::sendRequestListToSimulators()
(req->mState != LLTextureFetchWorker::LOAD_FROM_SIMULATOR))
{
// We already received our URL, remove from the queue
- llwarns << "Worker: " << req->mID << " in mNetworkQueue but in wrong state: " << req->mState << llendl;
+ LL_WARNS(LOG_TXT) << "Worker: " << req->mID << " in mNetworkQueue but in wrong state: " << req->mState << LL_ENDL;
mNetworkQueue.erase(curiter);
continue;
}
@@ -3105,8 +3232,8 @@ void LLTextureFetch::sendRequestListToSimulators()
gMessageSystem->addF32Fast(_PREHASH_DownloadPriority, req->mImagePriority);
gMessageSystem->addU32Fast(_PREHASH_Packet, packet);
gMessageSystem->addU8Fast(_PREHASH_Type, req->mType);
-// llinfos << "IMAGE REQUEST: " << req->mID << " Discard: " << req->mDesiredDiscard
-// << " Packet: " << packet << " Priority: " << req->mImagePriority << llendl;
+// LL_INFOS(LOG_TXT) << "IMAGE REQUEST: " << req->mID << " Discard: " << req->mDesiredDiscard
+// << " Packet: " << packet << " Priority: " << req->mImagePriority << LL_ENDL;
static LLCachedControl<bool> log_to_viewer_log(gSavedSettings,"LogTextureDownloadsToViewerLog", false);
static LLCachedControl<bool> log_to_sim(gSavedSettings,"LogTextureDownloadsToSimulator", false);
@@ -3127,7 +3254,7 @@ void LLTextureFetch::sendRequestListToSimulators()
sim_request_count++;
if (sim_request_count >= IMAGES_PER_REQUEST)
{
-// llinfos << "REQUESTING " << sim_request_count << " IMAGES FROM HOST: " << host.getIPString() << llendl;
+// LL_INFOS(LOG_TXT) << "REQUESTING " << sim_request_count << " IMAGES FROM HOST: " << host.getIPString() << LL_ENDL;
gMessageSystem->sendSemiReliable(host, NULL, NULL);
sim_request_count = 0;
@@ -3136,7 +3263,7 @@ void LLTextureFetch::sendRequestListToSimulators()
}
if (gMessageSystem && sim_request_count > 0 && sim_request_count < IMAGES_PER_REQUEST)
{
-// llinfos << "REQUESTING " << sim_request_count << " IMAGES FROM HOST: " << host.getIPString() << llendl;
+// LL_INFOS(LOG_TXT) << "REQUESTING " << sim_request_count << " IMAGES FROM HOST: " << host.getIPString() << LL_ENDL;
gMessageSystem->sendSemiReliable(host, NULL, NULL);
sim_request_count = 0;
}
@@ -3172,7 +3299,7 @@ void LLTextureFetch::sendRequestListToSimulators()
gMessageSystem->addF32Fast(_PREHASH_DownloadPriority, 0);
gMessageSystem->addU32Fast(_PREHASH_Packet, 0);
gMessageSystem->addU8Fast(_PREHASH_Type, 0);
-// llinfos << "CANCELING IMAGE REQUEST: " << (*iter2) << llendl;
+// LL_INFOS(LOG_TXT) << "CANCELING IMAGE REQUEST: " << (*iter2) << LL_ENDL;
request_count++;
if (request_count >= IMAGES_PER_REQUEST)
@@ -3200,12 +3327,12 @@ bool LLTextureFetchWorker::insertPacket(S32 index, U8* data, S32 size)
mRequestedTimer.reset();
if (index >= mTotalPackets)
{
-// llwarns << "Received Image Packet " << index << " > max: " << mTotalPackets << " for image: " << mID << llendl;
+// LL_WARNS(LOG_TXT) << "Received Image Packet " << index << " > max: " << mTotalPackets << " for image: " << mID << LL_ENDL;
return false;
}
if (index > 0 && index < mTotalPackets-1 && size != MAX_IMG_PACKET_SIZE)
{
-// llwarns << "Received bad sized packet: " << index << ", " << size << " != " << MAX_IMG_PACKET_SIZE << " for image: " << mID << llendl;
+// LL_WARNS(LOG_TXT) << "Received bad sized packet: " << index << ", " << size << " != " << MAX_IMG_PACKET_SIZE << " for image: " << mID << LL_ENDL;
return false;
}
@@ -3215,7 +3342,7 @@ bool LLTextureFetchWorker::insertPacket(S32 index, U8* data, S32 size)
}
else if (mPackets[index] != NULL)
{
-// llwarns << "Received duplicate packet: " << index << " for image: " << mID << llendl;
+// LL_WARNS(LOG_TXT) << "Received duplicate packet: " << index << " for image: " << mID << LL_ENDL;
return false;
}
@@ -3229,25 +3356,14 @@ bool LLTextureFetchWorker::insertPacket(S32 index, U8* data, S32 size)
void LLTextureFetchWorker::setState(e_state new_state)
{
- static const char* e_state_name[] =
- {
- "INVALID",
- "INIT",
- "LOAD_FROM_TEXTURE_CACHE",
- "CACHE_POST",
- "LOAD_FROM_NETWORK",
- "LOAD_FROM_SIMULATOR",
- "WAIT_HTTP_RESOURCE",
- "WAIT_HTTP_RESOURCE2",
- "SEND_HTTP_REQ",
- "WAIT_HTTP_REQ",
- "DECODE_IMAGE",
- "DECODE_IMAGE_UPDATE",
- "WRITE_TO_CACHE",
- "WAIT_ON_WRITE",
- "DONE"
- };
- LL_DEBUGS("Texture") << "id: " << mID << " FTType: " << mFTType << " disc: " << mDesiredDiscard << " sz: " << mDesiredSize << " state: " << e_state_name[mState] << " => " << e_state_name[new_state] << llendl;
+ if (mFTType == FTT_SERVER_BAKE)
+ {
+ // NOTE: turning on these log statements is a reliable way to get
+ // blurry images fairly frequently. Presumably this is an
+ // indication of some subtle timing or locking issue.
+
+// LL_INFOS(LOG_TXT) << "id: " << mID << " FTType: " << mFTType << " disc: " << mDesiredDiscard << " sz: " << mDesiredSize << " state: " << e_state_name[mState] << " => " << e_state_name[new_state] << LL_ENDL;
+ }
mState = new_state;
}
@@ -3262,26 +3378,26 @@ bool LLTextureFetch::receiveImageHeader(const LLHost& host, const LLUUID& id, U8
if (!worker)
{
-// llwarns << "Received header for non active worker: " << id << llendl;
+// LL_WARNS(LOG_TXT) << "Received header for non active worker: " << id << LL_ENDL;
res = false;
}
else if (worker->mState != LLTextureFetchWorker::LOAD_FROM_NETWORK ||
worker->mSentRequest != LLTextureFetchWorker::SENT_SIM)
{
-// llwarns << "receiveImageHeader for worker: " << id
+// LL_WARNS(LOG_TXT) << "receiveImageHeader for worker: " << id
// << " in state: " << LLTextureFetchWorker::sStateDescs[worker->mState]
-// << " sent: " << worker->mSentRequest << llendl;
+// << " sent: " << worker->mSentRequest << LL_ENDL;
res = false;
}
else if (worker->mLastPacket != -1)
{
// check to see if we've gotten this packet before
-// llwarns << "Received duplicate header for: " << id << llendl;
+// LL_WARNS(LOG_TXT) << "Received duplicate header for: " << id << LL_ENDL;
res = false;
}
else if (!data_size)
{
-// llwarns << "Img: " << id << ":" << " Empty Image Header" << llendl;
+// LL_WARNS(LOG_TXT) << "Img: " << id << ":" << " Empty Image Header" << LL_ENDL;
res = false;
}
if (!res)
@@ -3323,17 +3439,17 @@ bool LLTextureFetch::receiveImagePacket(const LLHost& host, const LLUUID& id, U1
if (!worker)
{
-// llwarns << "Received packet " << packet_num << " for non active worker: " << id << llendl;
+// LL_WARNS(LOG_TXT) << "Received packet " << packet_num << " for non active worker: " << id << LL_ENDL;
res = false;
}
else if (worker->mLastPacket == -1)
{
-// llwarns << "Received packet " << packet_num << " before header for: " << id << llendl;
+// LL_WARNS(LOG_TXT) << "Received packet " << packet_num << " before header for: " << id << LL_ENDL;
res = false;
}
else if (!data_size)
{
-// llwarns << "Img: " << id << ":" << " Empty Image Header" << llendl;
+// LL_WARNS(LOG_TXT) << "Img: " << id << ":" << " Empty Image Header" << LL_ENDL;
res = false;
}
if (!res)
@@ -3361,8 +3477,8 @@ bool LLTextureFetch::receiveImagePacket(const LLHost& host, const LLUUID& id, U1
}
else
{
-// llwarns << "receiveImagePacket " << packet_num << "/" << worker->mLastPacket << " for worker: " << id
-// << " in state: " << LLTextureFetchWorker::sStateDescs[worker->mState] << llendl;
+// LL_WARNS(LOG_TXT) << "receiveImagePacket " << packet_num << "/" << worker->mLastPacket << " for worker: " << id
+// << " in state: " << LLTextureFetchWorker::sStateDescs[worker->mState] << LL_ENDL;
removeFromNetworkQueue(worker, true); // failsafe
}
@@ -3373,7 +3489,7 @@ bool LLTextureFetch::receiveImagePacket(const LLHost& host, const LLUUID& id, U1
if (log_to_viewer_log || log_to_sim)
{
- U64 timeNow = LLTimer::getTotalTime();
+ U64Microseconds timeNow = LLTimer::getTotalTime();
mTextureInfo.setRequestSize(id, worker->mFileSize);
mTextureInfo.setRequestCompleteTimeAndLog(id, timeNow);
}
@@ -3454,33 +3570,33 @@ S32 LLTextureFetch::getFetchState(const LLUUID& id, F32& data_progress_p, F32& r
void LLTextureFetch::dump()
{
- llinfos << "LLTextureFetch REQUESTS:" << llendl;
+ LL_INFOS(LOG_TXT) << "LLTextureFetch REQUESTS:" << LL_ENDL;
for (request_queue_t::iterator iter = mRequestQueue.begin();
iter != mRequestQueue.end(); ++iter)
{
LLQueuedThread::QueuedRequest* qreq = *iter;
LLWorkerThread::WorkRequest* wreq = (LLWorkerThread::WorkRequest*)qreq;
LLTextureFetchWorker* worker = (LLTextureFetchWorker*)wreq->getWorkerClass();
- llinfos << " ID: " << worker->mID
- << " PRI: " << llformat("0x%08x",wreq->getPriority())
- << " STATE: " << worker->sStateDescs[worker->mState]
- << llendl;
+ LL_INFOS(LOG_TXT) << " ID: " << worker->mID
+ << " PRI: " << llformat("0x%08x",wreq->getPriority())
+ << " STATE: " << worker->sStateDescs[worker->mState]
+ << LL_ENDL;
}
- llinfos << "LLTextureFetch ACTIVE_HTTP:" << llendl;
+ LL_INFOS(LOG_TXT) << "LLTextureFetch ACTIVE_HTTP:" << LL_ENDL;
for (queue_t::const_iterator iter(mHTTPTextureQueue.begin());
mHTTPTextureQueue.end() != iter;
++iter)
{
- llinfos << " ID: " << (*iter) << llendl;
+ LL_INFOS(LOG_TXT) << " ID: " << (*iter) << LL_ENDL;
}
- llinfos << "LLTextureFetch WAIT_HTTP_RESOURCE:" << llendl;
+ LL_INFOS(LOG_TXT) << "LLTextureFetch WAIT_HTTP_RESOURCE:" << LL_ENDL;
for (wait_http_res_queue_t::const_iterator iter(mHttpWaitResource.begin());
mHttpWaitResource.end() != iter;
++iter)
{
- llinfos << " ID: " << (*iter) << llendl;
+ LL_INFOS(LOG_TXT) << " ID: " << (*iter) << LL_ENDL;
}
}
@@ -3605,10 +3721,10 @@ void LLTextureFetch::releaseHttpWaiters()
{
// Not in expected state, remove it, try the next one
worker->unlockWorkMutex(); // -Mw
- LL_WARNS("Texture") << "Resource-waited texture " << worker->mID
- << " in unexpected state: " << worker->mState
- << ". Removing from wait list."
- << LL_ENDL;
+ LL_WARNS(LOG_TXT) << "Resource-waited texture " << worker->mID
+ << " in unexpected state: " << worker->mState
+ << ". Removing from wait list."
+ << LL_ENDL;
removeHttpWaiter(worker->mID);
continue;
}
@@ -3775,14 +3891,14 @@ public:
if (status)
{
- LL_DEBUGS("Texture") << "Successfully delivered asset metrics to grid."
- << LL_ENDL;
+ LL_DEBUGS(LOG_TXT) << "Successfully delivered asset metrics to grid."
+ << LL_ENDL;
}
else
{
- LL_WARNS("Texture") << "Error delivering asset metrics to grid. Status: "
- << status.toTerseString()
- << ", Reason: " << status.toString() << LL_ENDL;
+ LL_WARNS(LOG_TXT) << "Error delivering asset metrics to grid. Status: "
+ << status.toTerseString()
+ << ", Reason: " << status.toString() << LL_ENDL;
}
}
}; // end class AssetReportHandler
@@ -3798,7 +3914,7 @@ AssetReportHandler stats_handler;
bool
TFReqSetRegion::doWork(LLTextureFetch *)
{
- LLViewerAssetStatsFF::set_region_thread1(mRegionHandle);
+ LLViewerAssetStatsFF::set_region(mRegionHandle);
return true;
}
@@ -3823,8 +3939,8 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher)
static const U32 report_priority(1);
static LLCore::HttpHandler * const handler(fetcher->isQAMode() || true ? &stats_handler : NULL);
- if (! gViewerAssetStatsThread1)
- return true;
+ //if (! gViewerAssetStatsThread1)
+ // return true;
static volatile bool reporting_started(false);
static volatile S32 report_sequence(0);
@@ -3834,17 +3950,21 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher)
// but leave it in 'this'. Destructor will rid us of it.
LLViewerAssetStats & main_stats = *mMainStats;
- // Merge existing stats into those from main, convert to LLSD
- main_stats.merge(*gViewerAssetStatsThread1);
- LLSD merged_llsd = main_stats.asLLSD(true);
-
- // Add some additional meta fields to the content
- merged_llsd["session_id"] = mSessionID;
- merged_llsd["agent_id"] = mAgentID;
- merged_llsd["message"] = "ViewerAssetMetrics"; // Identifies the type of metrics
- merged_llsd["sequence"] = report_sequence; // Sequence number
- merged_llsd["initial"] = ! reporting_started; // Initial data from viewer
- merged_llsd["break"] = LLTextureFetch::svMetricsDataBreak; // Break in data prior to this report
+ LLViewerAssetStats::AssetStats stats;
+ main_stats.getStats(stats, true);
+ //LLSD merged_llsd = main_stats.asLLSD();
+
+ bool initial_report = !reporting_started;
+ stats.session_id = mSessionID;
+ stats.agent_id = mAgentID;
+ stats.message = "ViewerAssetMetrics";
+ stats.sequence = static_cast<bool>(report_sequence);
+ stats.initial = initial_report;
+ stats.break_ = static_cast<bool>(LLTextureFetch::svMetricsDataBreak);
+
+ LLSD sd;
+ LLParamSDParser parser;
+ parser.writeSD(sd, stats);
// Update sequence number
if (S32_MAX == ++report_sequence)
@@ -3852,13 +3972,14 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher)
reporting_started = true;
// Limit the size of the stats report if necessary.
- merged_llsd["truncated"] = truncate_viewer_metrics(10, merged_llsd);
+
+ sd["truncated"] = truncate_viewer_metrics(10, sd);
if (! mCapsURL.empty())
{
LLCore::BufferArray * ba = new LLCore::BufferArray;
LLCore::BufferArrayStream bas(ba);
- LLSDSerialize::toXML(merged_llsd, bas);
+ LLSDSerialize::toXML(sd, bas);
fetcher->getHttpRequest().requestPost(fetcher->getPolicyClass(),
report_priority,
@@ -3878,11 +3999,9 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher)
// In QA mode, Metrics submode, log the result for ease of testing
if (fetcher->isQAMode())
{
- LL_INFOS("Textures") << ll_pretty_print_sd(merged_llsd) << LL_ENDL;
+ LL_INFOS("Textures") << ll_pretty_print_sd(sd) << LL_ENDL;
}
- gViewerAssetStatsThread1->reset();
-
return true;
}
@@ -4009,7 +4128,7 @@ LLTextureFetchDebugger::~LLTextureFetchDebugger()
void LLTextureFetchDebugger::init()
{
- mState = IDLE;
+ setDebuggerState(IDLE);
mCacheReadTime = -1.f;
mCacheWriteTime = -1.f;
@@ -4106,7 +4225,7 @@ void LLTextureFetchDebugger::startDebug()
//clear the current fetching queue
gTextureList.clearFetchingRequests();
- mState = START_DEBUG;
+ setDebuggerState(START_DEBUG);
}
bool LLTextureFetchDebugger::processStartDebug(F32 max_time)
@@ -4181,7 +4300,7 @@ void LLTextureFetchDebugger::tryToStopDebug()
//clear the current debug work
S32 size = mFetchingHistory.size();
- switch(mState)
+ switch(mDebuggerState)
{
case READ_CACHE:
for(S32 i = 0 ; i < size; i++)
@@ -4254,7 +4373,7 @@ void LLTextureFetchDebugger::addHistoryEntry(LLTextureFetchWorker* worker)
if(mFreezeHistory)
{
- if(mState == REFETCH_VIS_CACHE || mState == REFETCH_VIS_HTTP)
+ if(mDebuggerState == REFETCH_VIS_CACHE || mDebuggerState == REFETCH_VIS_HTTP)
{
mRefetchedVisPixels += worker->mRawImage->getWidth() * worker->mRawImage->getHeight();
mRefetchedVisData += worker->mFormattedImage->getDataSize();
@@ -4299,9 +4418,9 @@ void LLTextureFetchDebugger::unlockCache()
void LLTextureFetchDebugger::debugCacheRead()
{
lockCache();
- llassert_always(mState == IDLE);
+ llassert_always(mDebuggerState == IDLE);
mTimer.reset();
- mState = READ_CACHE;
+ setDebuggerState(READ_CACHE);
mCacheReadTime = -1.f;
S32 size = mFetchingHistory.size();
@@ -4335,9 +4454,9 @@ void LLTextureFetchDebugger::debugCacheWrite()
clearCache();
lockCache();
- llassert_always(mState == IDLE);
+ llassert_always(mDebuggerState == IDLE);
mTimer.reset();
- mState = WRITE_CACHE;
+ setDebuggerState(WRITE_CACHE);
mCacheWriteTime = -1.f;
S32 size = mFetchingHistory.size();
@@ -4364,9 +4483,9 @@ void LLTextureFetchDebugger::unlockDecoder()
void LLTextureFetchDebugger::debugDecoder()
{
lockDecoder();
- llassert_always(mState == IDLE);
+ llassert_always(mDebuggerState == IDLE);
mTimer.reset();
- mState = DECODING;
+ setDebuggerState(DECODING);
mDecodingTime = -1.f;
S32 size = mFetchingHistory.size();
@@ -4385,24 +4504,24 @@ void LLTextureFetchDebugger::debugDecoder()
void LLTextureFetchDebugger::debugHTTP()
{
- llassert_always(mState == IDLE);
+ llassert_always(mDebuggerState == IDLE);
LLViewerRegion* region = gAgent.getRegion();
if (!region)
{
- llinfos << "Fetch Debugger : Current region undefined. Cannot fetch textures through HTTP." << llendl;
+ LL_INFOS(LOG_TXT) << "Fetch Debugger : Current region undefined. Cannot fetch textures through HTTP." << LL_ENDL;
return;
}
mHTTPUrl = region->getHttpUrl();
if (mHTTPUrl.empty())
{
- llinfos << "Fetch Debugger : Current region URL undefined. Cannot fetch textures through HTTP." << llendl;
+ LL_INFOS(LOG_TXT) << "Fetch Debugger : Current region URL undefined. Cannot fetch textures through HTTP." << LL_ENDL;
return;
}
mTimer.reset();
- mState = HTTP_FETCHING;
+ setDebuggerState(HTTP_FETCHING);
mHTTPTime = -1.f;
S32 size = mFetchingHistory.size();
@@ -4468,22 +4587,22 @@ S32 LLTextureFetchDebugger::fillCurlQueue()
// Failed to queue request, log it and mark it done.
LLCore::HttpStatus status(mFetcher->getHttpRequest().getStatus());
- LL_WARNS("Texture") << "Couldn't issue HTTP request in debugger for texture "
- << mFetchingHistory[i].mID
- << ", status: " << status.toTerseString()
- << " reason: " << status.toString()
- << LL_ENDL;
+ LL_WARNS(LOG_TXT) << "Couldn't issue HTTP request in debugger for texture "
+ << mFetchingHistory[i].mID
+ << ", status: " << status.toTerseString()
+ << " reason: " << status.toString()
+ << LL_ENDL;
mFetchingHistory[i].mCurlState = FetchEntry::CURL_DONE;
}
}
- //llinfos << "Fetch Debugger : Having " << mNbCurlRequests << " requests through the curl thread." << llendl;
+ //LL_INFOS(LOG_TXT) << "Fetch Debugger : Having " << mNbCurlRequests << " requests through the curl thread." << LL_ENDL;
return mNbCurlRequests;
}
void LLTextureFetchDebugger::debugGLTextureCreation()
{
- llassert_always(mState == IDLE);
- mState = GL_TEX;
+ llassert_always(mDebuggerState == IDLE);
+ setDebuggerState(GL_TEX);
mTempTexList.clear();
S32 size = mFetchingHistory.size();
@@ -4604,8 +4723,8 @@ void LLTextureFetchDebugger::scanRefetchList()
void LLTextureFetchDebugger::debugRefetchVisibleFromCache()
{
- llassert_always(mState == IDLE);
- mState = REFETCH_VIS_CACHE;
+ llassert_always(mDebuggerState == IDLE);
+ setDebuggerState(REFETCH_VIS_CACHE);
clearTextures();
mFetcher->setLoadSource(LLTextureFetch::FROM_ALL);
@@ -4619,8 +4738,8 @@ void LLTextureFetchDebugger::debugRefetchVisibleFromCache()
void LLTextureFetchDebugger::debugRefetchVisibleFromHTTP()
{
- llassert_always(mState == IDLE);
- mState = REFETCH_VIS_HTTP;
+ llassert_always(mDebuggerState == IDLE);
+ setDebuggerState(REFETCH_VIS_HTTP);
clearTextures();
mFetcher->setLoadSource(LLTextureFetch::FROM_HTTP_ONLY);
@@ -4634,8 +4753,8 @@ void LLTextureFetchDebugger::debugRefetchVisibleFromHTTP()
void LLTextureFetchDebugger::debugRefetchAllFromCache()
{
- llassert_always(mState == IDLE);
- mState = REFETCH_ALL_CACHE;
+ llassert_always(mDebuggerState == IDLE);
+ setDebuggerState(REFETCH_ALL_CACHE);
clearTextures();
makeRefetchList();
@@ -4651,8 +4770,8 @@ void LLTextureFetchDebugger::debugRefetchAllFromCache()
void LLTextureFetchDebugger::debugRefetchAllFromHTTP()
{
- llassert_always(mState == IDLE);
- mState = REFETCH_ALL_HTTP;
+ llassert_always(mDebuggerState == IDLE);
+ setDebuggerState(REFETCH_ALL_HTTP);
clearTextures();
makeRefetchList();
@@ -4668,19 +4787,19 @@ void LLTextureFetchDebugger::debugRefetchAllFromHTTP()
bool LLTextureFetchDebugger::update(F32 max_time)
{
- switch(mState)
+ switch(mDebuggerState)
{
case START_DEBUG:
if(processStartDebug(max_time))
{
- mState = IDLE;
+ setDebuggerState(IDLE);
}
break;
case READ_CACHE:
if(!mTextureCache->update(1))
{
mCacheReadTime = mTimer.getElapsedTimeF32() ;
- mState = IDLE;
+ setDebuggerState(IDLE);
unlockCache();
}
break;
@@ -4688,7 +4807,7 @@ bool LLTextureFetchDebugger::update(F32 max_time)
if(!mTextureCache->update(1))
{
mCacheWriteTime = mTimer.getElapsedTimeF32() ;
- mState = IDLE;
+ setDebuggerState(IDLE);
unlockCache();
}
break;
@@ -4696,7 +4815,7 @@ bool LLTextureFetchDebugger::update(F32 max_time)
if(!mImageDecodeThread->update(1))
{
mDecodingTime = mTimer.getElapsedTimeF32() ;
- mState = IDLE;
+ setDebuggerState(IDLE);
unlockDecoder();
}
break;
@@ -4706,13 +4825,13 @@ bool LLTextureFetchDebugger::update(F32 max_time)
if (!fillCurlQueue() && mNbCurlCompleted == mFetchingHistory.size())
{
mHTTPTime = mTimer.getElapsedTimeF32() ;
- mState = IDLE;
+ setDebuggerState(IDLE);
}
break;
case GL_TEX:
if(processGLCreation(max_time))
{
- mState = IDLE;
+ setDebuggerState(IDLE);
mTempTexList.clear();
}
break;
@@ -4720,7 +4839,7 @@ bool LLTextureFetchDebugger::update(F32 max_time)
if (LLAppViewer::getTextureFetch()->getNumRequests() == 0)
{
mRefetchVisCacheTime = mTimer.getElapsedTimeF32() ;
- mState = IDLE;
+ setDebuggerState(IDLE);
mFetcher->lockFetcher(true);
mFetcher->resetLoadSource();
}
@@ -4729,7 +4848,7 @@ bool LLTextureFetchDebugger::update(F32 max_time)
if (LLAppViewer::getTextureFetch()->getNumRequests() == 0)
{
mRefetchVisHTTPTime = mTimer.getElapsedTimeF32() ;
- mState = IDLE;
+ setDebuggerState(IDLE);
mFetcher->lockFetcher(true);
mFetcher->resetLoadSource();
}
@@ -4746,7 +4865,7 @@ bool LLTextureFetchDebugger::update(F32 max_time)
}
mRefetchAllCacheTime = mTimer.getElapsedTimeF32() ;
- mState = IDLE;
+ setDebuggerState(IDLE);
mFetcher->lockFetcher(true);
mFetcher->resetLoadSource();
mRefetchList.clear();
@@ -4758,7 +4877,7 @@ bool LLTextureFetchDebugger::update(F32 max_time)
if (LLAppViewer::getTextureFetch()->getNumRequests() == 0)
{
mRefetchAllHTTPTime = mTimer.getElapsedTimeF32() ;
- mState = IDLE;
+ setDebuggerState(IDLE);
mFetcher->lockFetcher(true);
mFetcher->resetLoadSource();
mRefetchList.clear();
@@ -4766,11 +4885,11 @@ bool LLTextureFetchDebugger::update(F32 max_time)
}
break;
default:
- mState = IDLE;
+ setDebuggerState(IDLE);
break;
}
- return mState == IDLE;
+ return mDebuggerState == IDLE;
}
void LLTextureFetchDebugger::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response)
@@ -4778,7 +4897,7 @@ void LLTextureFetchDebugger::onCompleted(LLCore::HttpHandle handle, LLCore::Http
handle_fetch_map_t::iterator iter(mHandleToFetchIndex.find(handle));
if (mHandleToFetchIndex.end() == iter)
{
- llinfos << "Fetch Debugger : Couldn't find handle " << handle << " in fetch list." << llendl;
+ LL_INFOS(LOG_TXT) << "Fetch Debugger : Couldn't find handle " << handle << " in fetch list." << LL_ENDL;
return;
}
@@ -4786,7 +4905,7 @@ void LLTextureFetchDebugger::onCompleted(LLCore::HttpHandle handle, LLCore::Http
mHandleToFetchIndex.erase(iter);
if (fetch_ind >= mFetchingHistory.size() || mFetchingHistory[fetch_ind].mHttpHandle != handle)
{
- llinfos << "Fetch Debugger : Handle and fetch object in disagreement. Punting." << llendl;
+ LL_INFOS(LOG_TXT) << "Fetch Debugger : Handle and fetch object in disagreement. Punting." << LL_ENDL;
}
else
{
@@ -4836,7 +4955,7 @@ void LLTextureFetchDebugger::callbackHTTP(FetchEntry & fetch, LLCore::HttpRespon
S32 data_size = ba ? ba->size() : 0;
fetch.mCurlReceivedSize += data_size;
- //llinfos << "Fetch Debugger : got results for " << fetch.mID << ", data_size = " << data_size << ", received = " << fetch.mCurlReceivedSize << ", requested = " << fetch.mRequestedSize << ", partial = " << partial << llendl;
+ //LL_INFOS(LOG_TXT) << "Fetch Debugger : got results for " << fetch.mID << ", data_size = " << data_size << ", received = " << fetch.mCurlReceivedSize << ", requested = " << fetch.mRequestedSize << ", partial = " << partial << LL_ENDL;
if ((fetch.mCurlReceivedSize >= fetch.mRequestedSize) || !partial || (fetch.mRequestedSize == 600))
{
U8* d_buffer = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), data_size);
@@ -4862,9 +4981,9 @@ void LLTextureFetchDebugger::callbackHTTP(FetchEntry & fetch, LLCore::HttpRespon
}
else //failed
{
- llinfos << "Fetch Debugger : CURL GET FAILED, ID = " << fetch.mID
- << ", status: " << status.toTerseString()
- << " reason: " << status.toString() << llendl;
+ LL_INFOS(LOG_TXT) << "Fetch Debugger : CURL GET FAILED, ID = " << fetch.mID
+ << ", status: " << status.toTerseString()
+ << " reason: " << status.toString() << LL_ENDL;
}
}
diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h
index 3c79a5a24d..c4da2e8685 100755
--- a/indra/newview/lltexturefetch.h
+++ b/indra/newview/lltexturefetch.h
@@ -37,15 +37,15 @@
#include "lltextureinfo.h"
#include "llapr.h"
#include "llimageworker.h"
-#include "llstat.h"
#include "llcurl.h"
-#include "llstat.h"
#include "httprequest.h"
#include "httpoptions.h"
#include "httpheaders.h"
#include "httphandler.h"
+#include "lltrace.h"
#include "llviewertexture.h"
+class LLViewerTexture;
class LLTextureFetchWorker;
class LLImageDecodeThread;
class LLHost;
@@ -95,7 +95,8 @@ public:
// Threads: T*
bool getRequestFinished(const LLUUID& id, S32& discard_level,
- LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux);
+ LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux,
+ LLCore::HttpStatus& last_http_get_status);
// Threads: T*
bool updateRequestPriority(const LLUUID& id, F32 priority);
@@ -234,7 +235,7 @@ protected:
// XXX possible delete
// Threads: T*
- void removeFromHTTPQueue(const LLUUID& id, S32 received_size);
+ void removeFromHTTPQueue(const LLUUID& id, S32Bytes received_size);
// Identical to @deleteRequest but with different arguments
// (caller already has the worker pointer).
@@ -309,8 +310,8 @@ private:
LLMutex mQueueMutex; //to protect mRequestMap and mCommands only
LLMutex mNetworkQueueMutex; //to protect mNetworkQueue, mHTTPTextureQueue and mCancelQueue.
- static LLStat sCacheHitRate;
- static LLStat sCacheReadLatency;
+ static LLTrace::EventStatHandle<LLUnit<F32, LLUnits::Percent> > sCacheHitRate;
+ static LLTrace::EventStatHandle<F64Milliseconds > sCacheReadLatency;
LLTextureCache* mTextureCache;
LLImageDecodeThread* mImageDecodeThread;
@@ -330,7 +331,7 @@ private:
LLTextureInfo mTextureInfo;
// XXX possible delete
- U32 mHTTPTextureBits; // Mfnq
+ U32Bits mHTTPTextureBits; // Mfnq
// XXX possible delete
//debug use
@@ -396,6 +397,9 @@ private:
e_tex_source mFetchSource;
e_tex_source mOriginFetchSource;
+ // Retry logic
+ //LLAdaptiveRetryPolicy mFetchRetryPolicy;
+
public:
//debug use
LLTextureFetchDebugger* getFetchDebugger() { return mFetchDebugger;}
@@ -475,8 +479,9 @@ private:
typedef std::map<LLCore::HttpHandle, S32> handle_fetch_map_t;
handle_fetch_map_t mHandleToFetchIndex;
-
- e_debug_state mState;
+
+ void setDebuggerState(e_debug_state new_state) { mDebuggerState = new_state; }
+ e_debug_state mDebuggerState;
F32 mCacheReadTime;
F32 mCacheWriteTime;
@@ -549,7 +554,7 @@ public:
void callbackDecoded(S32 id, bool success, LLImageRaw* raw, LLImageRaw* aux);
void callbackHTTP(FetchEntry & fetch, LLCore::HttpResponse * response);
- e_debug_state getState() {return mState;}
+ e_debug_state getState() {return mDebuggerState;}
S32 getNumFetchedTextures() {return mNumFetchedTextures;}
S32 getNumFetchingRequests() {return mFetchingHistory.size();}
S32 getNumCacheHits() {return mNumCacheHits;}
diff --git a/indra/newview/lltextureinfo.cpp b/indra/newview/lltextureinfo.cpp
index adfdbc997e..59d692b287 100755
--- a/indra/newview/lltextureinfo.cpp
+++ b/indra/newview/lltextureinfo.cpp
@@ -29,26 +29,28 @@
#include "lltextureinfo.h"
#include "lltexturestats.h"
#include "llviewercontrol.h"
+#include "lltrace.h"
+
+static LLTrace::CountStatHandle<S32> sTextureDownloadsStarted("texture_downloads_started", "number of texture downloads initiated");
+static LLTrace::CountStatHandle<S32> sTextureDownloadsCompleted("texture_downloads_completed", "number of texture downloads completed");
+static LLTrace::CountStatHandle<S32Bytes > sTextureDataDownloaded("texture_data_downloaded", "amount of texture data downloaded");
+static LLTrace::CountStatHandle<U32Milliseconds > sTexureDownloadTime("texture_download_time", "amount of time spent fetching textures");
LLTextureInfo::LLTextureInfo() :
mLogTextureDownloadsToViewerLog(false),
mLogTextureDownloadsToSimulator(false),
- mTotalBytes(0),
- mTotalMilliseconds(0),
- mTextureDownloadsStarted(0),
- mTextureDownloadsCompleted(0),
mTextureDownloadProtocol("NONE"),
- mTextureLogThreshold(100 * 1024),
- mCurrentStatsBundleStartTime(0)
+ mTextureLogThreshold(LLUnits::Kilobytes::fromValue(100))
{
mTextures.clear();
+ mRecording.start();
}
-void LLTextureInfo::setUpLogging(bool writeToViewerLog, bool sendToSim, U32 textureLogThreshold)
+void LLTextureInfo::setUpLogging(bool writeToViewerLog, bool sendToSim, U32Bytes textureLogThreshold)
{
mLogTextureDownloadsToViewerLog = writeToViewerLog;
mLogTextureDownloadsToSimulator = sendToSim;
- mTextureLogThreshold = textureLogThreshold;
+ mTextureLogThreshold = U32Bytes(textureLogThreshold);
}
LLTextureInfo::~LLTextureInfo()
@@ -93,8 +95,8 @@ void LLTextureInfo::setRequestStartTime(const LLUUID& id, U64 startTime)
{
addRequest(id);
}
- mTextures[id]->mStartTime = startTime;
- mTextureDownloadsStarted++;
+ mTextures[id]->mStartTime = (U64Microseconds)startTime;
+ add(sTextureDownloadsStarted, 1);
}
void LLTextureInfo::setRequestSize(const LLUUID& id, U32 size)
@@ -103,7 +105,7 @@ void LLTextureInfo::setRequestSize(const LLUUID& id, U32 size)
{
addRequest(id);
}
- mTextures[id]->mSize = size;
+ mTextures[id]->mSize = (U32Bytes)size;
}
void LLTextureInfo::setRequestOffset(const LLUUID& id, U32 offset)
@@ -124,16 +126,19 @@ void LLTextureInfo::setRequestType(const LLUUID& id, LLTextureInfoDetails::LLReq
mTextures[id]->mType = type;
}
-void LLTextureInfo::setRequestCompleteTimeAndLog(const LLUUID& id, U64 completeTime)
+void LLTextureInfo::setRequestCompleteTimeAndLog(const LLUUID& id, U64Microseconds completeTime)
{
if (!has(id))
{
addRequest(id);
}
- mTextures[id]->mCompleteTime = completeTime;
+
+ LLTextureInfoDetails& details = *mTextures[id];
+
+ details.mCompleteTime = completeTime;
std::string protocol = "NONE";
- switch(mTextures[id]->mType)
+ switch(details.mType)
{
case LLTextureInfoDetails::REQUEST_TYPE_HTTP:
protocol = "HTTP";
@@ -150,24 +155,23 @@ void LLTextureInfo::setRequestCompleteTimeAndLog(const LLUUID& id, U64 completeT
if (mLogTextureDownloadsToViewerLog)
{
- llinfos << "texture=" << id
- << " start=" << mTextures[id]->mStartTime
- << " end=" << mTextures[id]->mCompleteTime
- << " size=" << mTextures[id]->mSize
- << " offset=" << mTextures[id]->mOffset
- << " length_in_ms=" << (mTextures[id]->mCompleteTime - mTextures[id]->mStartTime) / 1000
- << " protocol=" << protocol
- << llendl;
+ LL_INFOS() << "texture=" << id
+ << " start=" << details.mStartTime
+ << " end=" << details.mCompleteTime
+ << " size=" << details.mSize
+ << " offset=" << details.mOffset
+ << " length=" << U32Milliseconds(details.mCompleteTime - details.mStartTime)
+ << " protocol=" << protocol
+ << LL_ENDL;
}
if(mLogTextureDownloadsToSimulator)
{
- S32 texture_stats_upload_threshold = mTextureLogThreshold;
- mTotalBytes += mTextures[id]->mSize;
- mTotalMilliseconds += mTextures[id]->mCompleteTime - mTextures[id]->mStartTime;
- mTextureDownloadsCompleted++;
+ add(sTextureDataDownloaded, details.mSize);
+ add(sTexureDownloadTime, details.mCompleteTime - details.mStartTime);
+ add(sTextureDownloadsCompleted, 1);
mTextureDownloadProtocol = protocol;
- if (mTotalBytes >= texture_stats_upload_threshold)
+ if (mRecording.getSum(sTextureDataDownloaded) >= mTextureLogThreshold)
{
LLSD texture_data;
std::stringstream startTime;
@@ -189,39 +193,37 @@ LLSD LLTextureInfo::getAverages()
{
LLSD averagedTextureData;
S32 averageDownloadRate;
- if(mTotalMilliseconds == 0)
+ U32Milliseconds download_time = mRecording.getSum(sTexureDownloadTime);
+ if(download_time == (U32Milliseconds)0)
{
averageDownloadRate = 0;
}
else
{
- averageDownloadRate = (mTotalBytes * 8) / mTotalMilliseconds;
+ averageDownloadRate = mRecording.getSum(sTextureDataDownloaded).valueInUnits<LLUnits::Bits>() / download_time.valueInUnits<LLUnits::Seconds>();
}
- averagedTextureData["bits_per_second"] = averageDownloadRate;
- averagedTextureData["bytes_downloaded"] = mTotalBytes;
- averagedTextureData["texture_downloads_started"] = mTextureDownloadsStarted;
- averagedTextureData["texture_downloads_completed"] = mTextureDownloadsCompleted;
- averagedTextureData["transport"] = mTextureDownloadProtocol;
+ averagedTextureData["bits_per_second"] = averageDownloadRate;
+ averagedTextureData["bytes_downloaded"] = mRecording.getSum(sTextureDataDownloaded).valueInUnits<LLUnits::Bytes>();
+ averagedTextureData["texture_downloads_started"] = mRecording.getSum(sTextureDownloadsStarted);
+ averagedTextureData["texture_downloads_completed"] = mRecording.getSum(sTextureDownloadsCompleted);
+ averagedTextureData["transport"] = mTextureDownloadProtocol;
return averagedTextureData;
}
void LLTextureInfo::resetTextureStatistics()
{
- mTotalMilliseconds = 0;
- mTotalBytes = 0;
- mTextureDownloadsStarted = 0;
- mTextureDownloadsCompleted = 0;
+ mRecording.restart();
mTextureDownloadProtocol = "NONE";
mCurrentStatsBundleStartTime = LLTimer::getTotalTime();
}
-U32 LLTextureInfo::getRequestStartTime(const LLUUID& id)
+U32Microseconds LLTextureInfo::getRequestStartTime(const LLUUID& id)
{
if (!has(id))
{
- return 0;
+ return U32Microseconds(0);
}
else
{
@@ -230,11 +232,11 @@ U32 LLTextureInfo::getRequestStartTime(const LLUUID& id)
}
}
-U32 LLTextureInfo::getRequestSize(const LLUUID& id)
+U32Bytes LLTextureInfo::getRequestSize(const LLUUID& id)
{
if (!has(id))
{
- return 0;
+ return U32Bytes(0);
}
else
{
@@ -269,11 +271,11 @@ LLTextureInfoDetails::LLRequestType LLTextureInfo::getRequestType(const LLUUID&
}
}
-U32 LLTextureInfo::getRequestCompleteTime(const LLUUID& id)
+U32Microseconds LLTextureInfo::getRequestCompleteTime(const LLUUID& id)
{
if (!has(id))
{
- return 0;
+ return U32Microseconds(0);
}
else
{
diff --git a/indra/newview/lltextureinfo.h b/indra/newview/lltextureinfo.h
index 2ccbcc5fd2..176f2cbb74 100755
--- a/indra/newview/lltextureinfo.h
+++ b/indra/newview/lltextureinfo.h
@@ -29,6 +29,7 @@
#include "lluuid.h"
#include "lltextureinfodetails.h"
+#include "lltracerecording.h"
#include <map>
class LLTextureInfo
@@ -37,18 +38,18 @@ public:
LLTextureInfo();
~LLTextureInfo();
- void setUpLogging(bool writeToViewerLog, bool sendToSim, U32 textureLogThreshold);
+ void setUpLogging(bool writeToViewerLog, bool sendToSim, U32Bytes textureLogThreshold);
bool has(const LLUUID& id);
void setRequestStartTime(const LLUUID& id, U64 startTime);
void setRequestSize(const LLUUID& id, U32 size);
void setRequestOffset(const LLUUID& id, U32 offset);
void setRequestType(const LLUUID& id, LLTextureInfoDetails::LLRequestType type);
- void setRequestCompleteTimeAndLog(const LLUUID& id, U64 completeTime);
- U32 getRequestStartTime(const LLUUID& id);
- U32 getRequestSize(const LLUUID& id);
+ void setRequestCompleteTimeAndLog(const LLUUID& id, U64Microseconds completeTime);
+ U32Microseconds getRequestStartTime(const LLUUID& id);
+ U32Bytes getRequestSize(const LLUUID& id);
U32 getRequestOffset(const LLUUID& id);
LLTextureInfoDetails::LLRequestType getRequestType(const LLUUID& id);
- U32 getRequestCompleteTime(const LLUUID& id);
+ U32Microseconds getRequestCompleteTime(const LLUUID& id);
void resetTextureStatistics();
U32 getTextureInfoMapSize();
LLSD getAverages();
@@ -56,19 +57,14 @@ public:
private:
void addRequest(const LLUUID& id);
- std::map<LLUUID, LLTextureInfoDetails *> mTextures;
-
- LLSD mAverages;
-
- bool mLogTextureDownloadsToViewerLog;
- bool mLogTextureDownloadsToSimulator;
- S32 mTotalBytes;
- S32 mTotalMilliseconds;
- S32 mTextureDownloadsStarted;
- S32 mTextureDownloadsCompleted;
- std::string mTextureDownloadProtocol;
- U32 mTextureLogThreshold; // in bytes
- U64 mCurrentStatsBundleStartTime;
+ std::map<LLUUID, LLTextureInfoDetails *> mTextures;
+ LLSD mAverages;
+ bool mLogTextureDownloadsToViewerLog,
+ mLogTextureDownloadsToSimulator;
+ std::string mTextureDownloadProtocol;
+ U32Bytes mTextureLogThreshold;
+ U64Microseconds mCurrentStatsBundleStartTime;
+ LLTrace::Recording mRecording;
};
#endif // LL_LLTEXTUREINFO_H
diff --git a/indra/newview/lltextureinfodetails.cpp b/indra/newview/lltextureinfodetails.cpp
index 0d750db3bf..cab16eb922 100755
--- a/indra/newview/lltextureinfodetails.cpp
+++ b/indra/newview/lltextureinfodetails.cpp
@@ -28,7 +28,9 @@
#include "lltextureinfodetails.h"
-LLTextureInfoDetails::LLTextureInfoDetails() : mStartTime(0), mCompleteTime(0), mSize(0), mType(REQUEST_TYPE_NONE), mOffset(0)
+LLTextureInfoDetails::LLTextureInfoDetails()
+: mType(REQUEST_TYPE_NONE),
+ mOffset(0)
{
}
diff --git a/indra/newview/lltextureinfodetails.h b/indra/newview/lltextureinfodetails.h
index 4a3cd29084..a42c335035 100755
--- a/indra/newview/lltextureinfodetails.h
+++ b/indra/newview/lltextureinfodetails.h
@@ -28,10 +28,10 @@
#define LL_LLTEXTUREINFODETAILS_H
#include "lluuid.h"
+#include "llunits.h"
-class LLTextureInfoDetails
+struct LLTextureInfoDetails
{
-public:
enum LLRequestType
{
REQUEST_TYPE_NONE,
@@ -39,11 +39,11 @@ public:
REQUEST_TYPE_UDP
};
- U32 mStartTime;
- U32 mCompleteTime;
- U32 mOffset;
- U32 mSize;
- LLRequestType mType;
+ U32Microseconds mStartTime,
+ mCompleteTime;
+ U32 mOffset;
+ U32Bytes mSize;
+ LLRequestType mType;
LLTextureInfoDetails();
};
diff --git a/indra/newview/lltexturestats.cpp b/indra/newview/lltexturestats.cpp
index f820ae65df..ca42d710f8 100755
--- a/indra/newview/lltexturestats.cpp
+++ b/indra/newview/lltexturestats.cpp
@@ -48,8 +48,7 @@ void send_texture_stats_to_sim(const LLSD &texture_stats)
texture_stats_report["stats_data"] = texture_stats;
std::string texture_cap_url = gAgent.getRegion()->getCapability("TextureStats");
- LLTextureStatsUploader tsu;
- llinfos << "uploading texture stats data to simulator" << llendl;
- tsu.uploadStatsToSimulator(texture_cap_url, texture_stats);
+ LL_INFOS() << "uploading texture stats data to simulator" << LL_ENDL;
+ LLTextureStatsUploader::uploadStatsToSimulator(texture_cap_url, texture_stats);
}
diff --git a/indra/newview/lltexturestatsuploader.cpp b/indra/newview/lltexturestatsuploader.cpp
index 23ba09cb91..c4809bc8e7 100755
--- a/indra/newview/lltexturestatsuploader.cpp
+++ b/indra/newview/lltexturestatsuploader.cpp
@@ -30,14 +30,8 @@
#include "llhttpclient.h"
-LLTextureStatsUploader::LLTextureStatsUploader()
-{
-}
-
-LLTextureStatsUploader::~LLTextureStatsUploader()
-{
-}
+// static
void LLTextureStatsUploader::uploadStatsToSimulator(const std::string texture_cap_url, const LLSD &texture_stats)
{
if ( texture_cap_url != "" )
@@ -46,10 +40,10 @@ void LLTextureStatsUploader::uploadStatsToSimulator(const std::string texture_ca
}
else
{
- llinfos << "Not sending texture stats: "
+ LL_INFOS() << "Not sending texture stats: "
<< texture_stats
<< " as there is no cap url."
- << llendl;
+ << LL_ENDL;
}
}
diff --git a/indra/newview/lltexturestatsuploader.h b/indra/newview/lltexturestatsuploader.h
index 6b02aeb845..ac268c2516 100755
--- a/indra/newview/lltexturestatsuploader.h
+++ b/indra/newview/lltexturestatsuploader.h
@@ -34,9 +34,7 @@
class LLTextureStatsUploader
{
public:
- LLTextureStatsUploader();
- ~LLTextureStatsUploader();
- void uploadStatsToSimulator(const std::string texture_cap_url, const LLSD &texture_stats);
+ static void uploadStatsToSimulator(const std::string texture_cap_url, const LLSD &texture_stats);
};
#endif // LL_LLTEXTURESTATSUPLOADER_H
diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp
index 50edbb61a8..b7786bcdd7 100755
--- a/indra/newview/lltextureview.cpp
+++ b/indra/newview/lltextureview.cpp
@@ -39,17 +39,19 @@
#include "lltooltip.h"
#include "llappviewer.h"
+#include "llmeshrepository.h"
#include "llselectmgr.h"
#include "llviewertexlayer.h"
#include "lltexturecache.h"
#include "lltexturefetch.h"
#include "llviewercontrol.h"
#include "llviewerobject.h"
+#include "llviewerobjectlist.h"
#include "llviewertexture.h"
#include "llviewertexturelist.h"
#include "llvovolume.h"
#include "llviewerstats.h"
-#include "llmeshrepository.h"
+#include "llworld.h"
// For avatar texture view
#include "llvoavatarself.h"
@@ -349,7 +351,7 @@ void LLTextureBar::draw()
// draw the image size at the end
{
std::string num_str = llformat("%3dx%3d (%2d) %7d", mImagep->getWidth(), mImagep->getHeight(),
- mImagep->getDiscardLevel(), mImagep->hasGLTexture() ? mImagep->getTextureMemory() : 0);
+ mImagep->getDiscardLevel(), mImagep->hasGLTexture() ? mImagep->getTextureMemory().value() : 0);
LLFontGL::getFontMonospace()->renderUTF8(num_str, 0, title_x4, getRect().getHeight(), color,
LLFontGL::LEFT, LLFontGL::TOP);
}
@@ -432,15 +434,7 @@ void LLAvatarTexBar::draw()
if (!layerset_buffer) continue;
LLColor4 text_color = LLColor4::white;
-
- if (layerset_buffer->uploadNeeded())
- {
- text_color = LLColor4::red;
- }
- if (layerset_buffer->uploadInProgress())
- {
- text_color = LLColor4::magenta;
- }
+
std::string text = layerset_buffer->dumpTextureInfo();
LLFontGL::getFontMonospace()->renderUTF8(text, 0, l_offset, v_offset + line_height*line_num,
text_color, LLFontGL::LEFT, LLFontGL::TOP); //, LLFontGL::BOLD, LLFontGL::DROP_SHADOW_SOFT);
@@ -506,20 +500,22 @@ private:
void LLGLTexMemBar::draw()
{
- S32 bound_mem = BYTES_TO_MEGA_BYTES(LLViewerTexture::sBoundTextureMemoryInBytes);
- S32 max_bound_mem = LLViewerTexture::sMaxBoundTextureMemInMegaBytes;
- S32 total_mem = BYTES_TO_MEGA_BYTES(LLViewerTexture::sTotalTextureMemoryInBytes);
- S32 max_total_mem = LLViewerTexture::sMaxTotalTextureMemInMegaBytes;
+ S32Megabytes bound_mem = LLViewerTexture::sBoundTextureMemory;
+ S32Megabytes max_bound_mem = LLViewerTexture::sMaxBoundTextureMemory;
+ S32Megabytes total_mem = LLViewerTexture::sTotalTextureMemory;
+ S32Megabytes max_total_mem = LLViewerTexture::sMaxTotalTextureMem;
F32 discard_bias = LLViewerTexture::sDesiredDiscardBias;
- F32 cache_usage = (F32)BYTES_TO_MEGA_BYTES(LLAppViewer::getTextureCache()->getUsage()) ;
- F32 cache_max_usage = (F32)BYTES_TO_MEGA_BYTES(LLAppViewer::getTextureCache()->getMaxUsage()) ;
+ F32 cache_usage = LLAppViewer::getTextureCache()->getUsage().valueInUnits<LLUnits::Megabytes>();
+ F32 cache_max_usage = LLAppViewer::getTextureCache()->getMaxUsage().valueInUnits<LLUnits::Megabytes>();
S32 line_height = LLFontGL::getFontMonospace()->getLineHeight();
S32 v_offset = 0;//(S32)((texture_bar_height + 2.2f) * mTextureView->mNumTextureBars + 2.0f);
- F32 total_texture_downloaded = (F32)gTotalTextureBytes / (1024 * 1024);
- F32 total_object_downloaded = (F32)gTotalObjectBytes / (1024 * 1024);
+ F32Bytes total_texture_downloaded = gTotalTextureData;
+ F32Bytes total_object_downloaded = gTotalObjectData;
U32 total_http_requests = LLAppViewer::getTextureFetch()->getTotalNumHTTPRequests();
+ U32 total_active_cached_objects = LLWorld::getInstance()->getNumOfActiveCachedObjects();
+ U32 total_objects = gObjectList.getNumObjects();
F32 x_right = 0.0;
-
+
//----------------------------------------------------------------------------
LLGLSUIDefault gls_ui;
LLColor4 text_color(1.f, 1.f, 1.f, 0.75f);
@@ -535,10 +531,10 @@ void LLGLTexMemBar::draw()
text_color, LLFontGL::LEFT, LLFontGL::TOP);
text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB FBO: %d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB",
- total_mem,
- max_total_mem,
- bound_mem,
- max_bound_mem,
+ total_mem.value(),
+ max_total_mem.value(),
+ bound_mem.value(),
+ max_bound_mem.value(),
LLRenderTarget::sBytesAllocated/(1024*1024),
LLImageRaw::sGlobalRawMemory >> 20,
discard_bias,
@@ -552,9 +548,11 @@ void LLGLTexMemBar::draw()
U32 cache_read(0U), cache_write(0U), res_wait(0U);
LLAppViewer::getTextureFetch()->getStateStats(&cache_read, &cache_write, &res_wait);
- text = llformat("Net Tot Tex: %.1f MB Tot Obj: %.1f MB Tot Htp: %d Cread: %u Cwrite: %u Rwait: %u",
- total_texture_downloaded,
- total_object_downloaded,
+ text = llformat("Net Tot Tex: %.1f MB Tot Obj: %.1f MB #Objs/#Cached: %d/%d Tot Htp: %d Cread: %u Cwrite: %u Rwait: %u",
+ total_texture_downloaded.valueInUnits<LLUnits::Megabytes>(),
+ total_object_downloaded.valueInUnits<LLUnits::Megabytes>(),
+ total_objects,
+ total_active_cached_objects,
total_http_requests,
cache_read,
cache_write,
@@ -582,14 +580,14 @@ void LLGLTexMemBar::draw()
LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX,
&x_right, FALSE);
- F32 bandwidth = LLAppViewer::getTextureFetch()->getTextureBandwidth();
- F32 max_bandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS");
- color = bandwidth > max_bandwidth ? LLColor4::red : bandwidth > max_bandwidth * .75f ? LLColor4::yellow : text_color;
+ F32Kilobits bandwidth(LLAppViewer::getTextureFetch()->getTextureBandwidth());
+ F32Kilobits max_bandwidth(gSavedSettings.getF32("ThrottleBandwidthKBPS"));
+ color = bandwidth > max_bandwidth ? LLColor4::red : bandwidth > max_bandwidth*.75f ? LLColor4::yellow : text_color;
color[VALPHA] = text_color[VALPHA];
- text = llformat("BW:%.0f/%.0f", bandwidth, max_bandwidth);
+ text = llformat("BW:%.0f/%.0f",bandwidth.value(), max_bandwidth.value());
LLFontGL::getFontMonospace()->renderUTF8(text, 0, x_right, v_offset + line_height*3,
color, LLFontGL::LEFT, LLFontGL::TOP);
-
+
// Mesh status line
text = llformat("Mesh: Reqs(Tot/Htp/Big): %u/%u/%u Rtr/Err: %u/%u Cread/Cwrite: %u/%u Low/At/High: %d/%d/%d",
LLMeshRepository::sMeshRequestCount, LLMeshRepository::sHTTPRequestCount, LLMeshRepository::sHTTPLargeRequestCount,
@@ -692,7 +690,7 @@ void LLGLTexSizeBar::draw()
if(LLImageGL::sCurTexSizeBar == mIndex)
{
- F32 text_color[] = {1.f, 1.f, 1.f, 0.75f};
+ LLColor4 text_color(1.f, 1.f, 1.f, 0.75f);
std::string text;
text = llformat("%d", mTopLoaded) ;
@@ -704,8 +702,8 @@ void LLGLTexSizeBar::draw()
text_color, LLFontGL::LEFT, LLFontGL::TOP);
}
- F32 loaded_color[] = {1.0f, 0.0f, 0.0f, 0.75f};
- F32 bound_color[] = {1.0f, 1.0f, 0.0f, 0.75f};
+ LLColor4 loaded_color(1.0f, 0.0f, 0.0f, 0.75f);
+ LLColor4 bound_color(1.0f, 1.0f, 0.0f, 0.75f);
gl_rect_2d(mLeft, mBottom + (S32)(mTopLoaded * mScale), (mLeft + mRight) / 2, mBottom, loaded_color) ;
gl_rect_2d((mLeft + mRight) / 2, mBottom + (S32)(mTopBound * mScale), mRight, mBottom, bound_color) ;
}
@@ -782,7 +780,7 @@ void LLTextureView::draw()
if (mPrintList)
{
- llinfos << "ID\tMEM\tBOOST\tPRI\tWIDTH\tHEIGHT\tDISCARD" << llendl;
+ LL_INFOS() << "ID\tMEM\tBOOST\tPRI\tWIDTH\tHEIGHT\tDISCARD" << LL_ENDL;
}
for (LLViewerTextureList::image_priority_list_t::iterator iter = gTextureList.mImageList.begin();
@@ -799,15 +797,15 @@ void LLTextureView::draw()
if (mPrintList)
{
- S32 tex_mem = imagep->hasGLTexture() ? imagep->getTextureMemory() : 0 ;
- llinfos << imagep->getID()
+ S32 tex_mem = imagep->hasGLTexture() ? imagep->getTextureMemory().value() : 0 ;
+ LL_INFOS() << imagep->getID()
<< "\t" << tex_mem
<< "\t" << imagep->getBoostLevel()
<< "\t" << imagep->getDecodePriority()
<< "\t" << imagep->getWidth()
<< "\t" << imagep->getHeight()
<< "\t" << cur_discard
- << llendl;
+ << LL_ENDL;
}
if (imagep->getID() == LLAppViewer::getTextureFetch()->mDebugID)
diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp
index 448fae48de..63ede7f8ac 100755
--- a/indra/newview/lltoast.cpp
+++ b/indra/newview/lltoast.cpp
@@ -234,6 +234,8 @@ void LLToast::closeToast()
{
mOnDeleteToastSignal(this);
+ setSoundFlags(SILENT);
+
closeFloater();
}
@@ -605,7 +607,7 @@ void LLToast::cleanupToasts()
toastp = &(*iter);
}
- //llinfos << "Cleaning up toast id " << toastp->getNotificationID() << llendl;
+ //LL_INFOS() << "Cleaning up toast id " << toastp->getNotificationID() << LL_ENDL;
// LLToast destructor will remove it from the LLInstanceTracker.
if (!toastp)
diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp
index 6083210080..c82894a5cc 100755
--- a/indra/newview/lltoastalertpanel.cpp
+++ b/indra/newview/lltoastalertpanel.cpp
@@ -42,7 +42,6 @@
#include "lllineeditor.h"
#include "lluictrlfactory.h"
#include "llnotifications.h"
-#include "llfunctorregistry.h"
#include "llrootview.h"
#include "lltransientfloatermgr.h"
#include "llviewercontrol.h" // for gSavedSettings
@@ -175,7 +174,7 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal
// Message: create text box using raw string, as text has been structure deliberately
// Use size of created text box to generate dialog box size
std::string msg = mNotification->getMessage();
- llwarns << "Alert: " << msg << llendl;
+ LL_WARNS() << "Alert: " << msg << LL_ENDL;
LLTextBox::Params params;
params.name("Alert message");
params.font(font);
@@ -267,6 +266,11 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal
mLineEditor->setMaxTextChars(edit_text_max_chars);
mLineEditor->setText(edit_text_contents);
+ if("SaveOutfitAs" == mNotification->getName())
+ {
+ mLineEditor->setPrevalidate(&LLTextValidate::validateASCII);
+ }
+
// decrease limit of line editor of teleport offer dialog to avoid truncation of
// location URL in invitation message, see EXT-6891
if ("OfferTeleport" == mNotification->getName())
@@ -509,7 +513,7 @@ void LLToastAlertPanel::setEditTextArgs(const LLSD& edit_args)
}
else
{
- llwarns << "LLToastAlertPanel::setEditTextArgs called on dialog with no line editor" << llendl;
+ LL_WARNS() << "LLToastAlertPanel::setEditTextArgs called on dialog with no line editor" << LL_ENDL;
}
}
diff --git a/indra/newview/lltoastgroupnotifypanel.cpp b/indra/newview/lltoastgroupnotifypanel.cpp
index beb45e8179..e00b18dedb 100755
--- a/indra/newview/lltoastgroupnotifypanel.cpp
+++ b/indra/newview/lltoastgroupnotifypanel.cpp
@@ -61,7 +61,7 @@ LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(const LLNotificationPtr& notifi
LLGroupData groupData;
if (!gAgent.getGroupData(payload["group_id"].asUUID(),groupData))
{
- llwarns << "Group notice for unknown group: " << payload["group_id"].asUUID() << llendl;
+ LL_WARNS() << "Group notice for unknown group: " << payload["group_id"].asUUID() << LL_ENDL;
}
//group icon
diff --git a/indra/newview/lltoastgroupnotifypanel.h b/indra/newview/lltoastgroupnotifypanel.h
index dfdc6ae559..431fd32da2 100755
--- a/indra/newview/lltoastgroupnotifypanel.h
+++ b/indra/newview/lltoastgroupnotifypanel.h
@@ -29,7 +29,6 @@
#include "llfontgl.h"
#include "lltoastpanel.h"
-#include "lldarray.h"
#include "lltimer.h"
#include "llviewermessage.h"
#include "llnotificationptr.h"
diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp
index bdbd8f1f83..39adfb3431 100755
--- a/indra/newview/lltoastimpanel.cpp
+++ b/indra/newview/lltoastimpanel.cpp
@@ -54,6 +54,7 @@ LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) : LLToastPanel(p.notif
mAvatarName = getChild<LLTextBox>("user_name");
mTime = getChild<LLTextBox>("time_box");
mMessage = getChild<LLTextBox>("message");
+ mMessage->setContentTrusted(false);
LLStyle::Params style_params;
LLFontGL* fontp = LLViewerChat::getChatFont();
@@ -189,7 +190,7 @@ void LLToastIMPanel::spawnGroupIconToolTip()
LLGroupData g_data;
if(!gAgent.getGroupData(mSessionID, g_data))
{
- llwarns << "Error getting group data" << llendl;
+ LL_WARNS() << "Error getting group data" << LL_ENDL;
}
LLInspector::Params params;
@@ -222,7 +223,7 @@ void LLToastIMPanel::initIcon()
LLIMModel::LLIMSession* im_session = LLIMModel::getInstance()->findIMSession(mSessionID);
if(!im_session)
{
- llwarns << "Invalid IM session" << llendl;
+ LL_WARNS() << "Invalid IM session" << LL_ENDL;
return;
}
@@ -242,7 +243,7 @@ void LLToastIMPanel::initIcon()
mAdhocIcon->setToolTip(im_session->mName);
break;
default:
- llwarns << "Unknown IM session type" << llendl;
+ LL_WARNS() << "Unknown IM session type" << LL_ENDL;
break;
}
}
diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp
index 9824f2dd38..602c701a33 100755
--- a/indra/newview/lltoastnotifypanel.cpp
+++ b/indra/newview/lltoastnotifypanel.cpp
@@ -46,7 +46,7 @@
const S32 BOTTOM_PAD = VPAD * 3;
const S32 IGNORE_BTN_TOP_DELTA = 3*VPAD;//additional ignore_btn padding
S32 BUTTON_WIDTH = 90;
-// *TODO: magic numbers(???) - copied from llnotify.cpp(250)
+// *TODO: magic numbers(?) - copied from llnotify.cpp(250)
const S32 MAX_LENGTH = 512 + 20 + DB_FIRST_NAME_BUF_SIZE + DB_LAST_NAME_BUF_SIZE + DB_INV_ITEM_NAME_BUF_SIZE;
@@ -58,7 +58,7 @@ LLToastNotifyPanel::button_click_signal_t LLToastNotifyPanel::sButtonClickSignal
LLToastNotifyPanel::LLToastNotifyPanel(const LLNotificationPtr& notification, const LLRect& rect, bool show_images)
: LLToastPanel(notification),
- LLInstanceTracker<LLToastNotifyPanel, LLUUID>(notification->getID())
+ LLInstanceTracker<LLToastNotifyPanel, LLUUID, LLInstanceTrackerReplaceOnCollision>(notification->getID())
{
init(rect, show_images);
}
@@ -270,8 +270,12 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images )
// customize panel's attributes
// is it intended for displaying a tip?
mIsTip = mNotification->getType() == "notifytip";
+
+ std::string notif_name = mNotification->getName();
// is it a script dialog?
- mIsScriptDialog = (mNotification->getName() == "ScriptDialog" || mNotification->getName() == "ScriptDialogGroup");
+ mIsScriptDialog = (notif_name == "ScriptDialog" || notif_name == "ScriptDialogGroup");
+
+ bool is_content_trusted = (notif_name != "LoadWebPage");
// is it a caution?
//
// caution flag can be set explicitly by specifying it in the notification payload, or it can be set implicitly if the
@@ -314,6 +318,7 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images )
mTextBox->setMaxTextLength(MAX_LENGTH);
mTextBox->setVisible(TRUE);
mTextBox->setPlainText(!show_images);
+ mTextBox->setContentTrusted(is_content_trusted);
mTextBox->setValue(mNotification->getMessage());
mTextBox->setIsFriendCallback(LLAvatarActions::isFriend);
diff --git a/indra/newview/lltoastnotifypanel.h b/indra/newview/lltoastnotifypanel.h
index fe7f1cf8f3..e4a75acfda 100755
--- a/indra/newview/lltoastnotifypanel.h
+++ b/indra/newview/lltoastnotifypanel.h
@@ -47,7 +47,7 @@ class LLNotificationForm;
* @deprecated this class will be removed after all toast panel types are
* implemented in separate classes.
*/
-class LLToastNotifyPanel: public LLToastPanel, public LLInstanceTracker<LLToastNotifyPanel, LLUUID>
+class LLToastNotifyPanel: public LLToastPanel, public LLInstanceTracker<LLToastNotifyPanel, LLUUID, LLInstanceTrackerReplaceOnCollision>
{
public:
/**
diff --git a/indra/newview/lltoastscripttextbox.cpp b/indra/newview/lltoastscripttextbox.cpp
index 45fbabad59..78d9e92b5c 100755
--- a/indra/newview/lltoastscripttextbox.cpp
+++ b/indra/newview/lltoastscripttextbox.cpp
@@ -109,7 +109,7 @@ void LLToastScriptTextbox::onClickSubmit()
}
mNotification->respond(response);
close();
- llwarns << response << llendl;
+ LL_WARNS() << response << LL_ENDL;
}
}
diff --git a/indra/newview/lltool.cpp b/indra/newview/lltool.cpp
index 2d8ce95347..4aad650b68 100755
--- a/indra/newview/lltool.cpp
+++ b/indra/newview/lltool.cpp
@@ -55,7 +55,7 @@ LLTool::~LLTool()
{
if( hasMouseCapture() )
{
- llwarns << "Tool deleted holding mouse capture. Mouse capture removed." << llendl;
+ LL_WARNS() << "Tool deleted holding mouse capture. Mouse capture removed." << LL_ENDL;
gFocusMgr.removeMouseCaptureWithoutCallback( this );
}
}
@@ -80,10 +80,10 @@ BOOL LLTool::handleMouseDown(S32 x, S32 y, MASK mask)
{
if (gDebugClicks)
{
- llinfos << "LLTool left mouse down" << llendl;
+ LL_INFOS() << "LLTool left mouse down" << LL_ENDL;
}
// by default, didn't handle it
- // llinfos << "LLTool::handleMouseDown" << llendl;
+ // LL_INFOS() << "LLTool::handleMouseDown" << LL_ENDL;
gAgent.setControlFlags(AGENT_CONTROL_LBUTTON_DOWN);
return TRUE;
}
@@ -92,10 +92,10 @@ BOOL LLTool::handleMouseUp(S32 x, S32 y, MASK mask)
{
if (gDebugClicks)
{
- llinfos << "LLTool left mouse up" << llendl;
+ LL_INFOS() << "LLTool left mouse up" << LL_ENDL;
}
// by default, didn't handle it
- // llinfos << "LLTool::handleMouseUp" << llendl;
+ // LL_INFOS() << "LLTool::handleMouseUp" << LL_ENDL;
gAgent.setControlFlags(AGENT_CONTROL_LBUTTON_UP);
return TRUE;
}
@@ -103,7 +103,7 @@ BOOL LLTool::handleMouseUp(S32 x, S32 y, MASK mask)
BOOL LLTool::handleHover(S32 x, S32 y, MASK mask)
{
gViewerWindow->setCursor(UI_CURSOR_ARROW);
- lldebugst(LLERR_USER_INPUT) << "hover handled by a tool" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by a tool" << LL_ENDL;
// by default, do nothing, say we handled it
return TRUE;
}
@@ -111,13 +111,13 @@ BOOL LLTool::handleHover(S32 x, S32 y, MASK mask)
BOOL LLTool::handleScrollWheel(S32 x, S32 y, S32 clicks)
{
// by default, didn't handle it
- // llinfos << "LLTool::handleScrollWheel" << llendl;
+ // LL_INFOS() << "LLTool::handleScrollWheel" << LL_ENDL;
return FALSE;
}
BOOL LLTool::handleDoubleClick(S32 x,S32 y,MASK mask)
{
- // llinfos << "LLTool::handleDoubleClick" << llendl;
+ // LL_INFOS() << "LLTool::handleDoubleClick" << LL_ENDL;
// by default, pretend it's a left click
return FALSE;
}
@@ -125,35 +125,35 @@ BOOL LLTool::handleDoubleClick(S32 x,S32 y,MASK mask)
BOOL LLTool::handleRightMouseDown(S32 x,S32 y,MASK mask)
{
// by default, didn't handle it
- // llinfos << "LLTool::handleRightMouseDown" << llendl;
+ // LL_INFOS() << "LLTool::handleRightMouseDown" << LL_ENDL;
return FALSE;
}
BOOL LLTool::handleRightMouseUp(S32 x, S32 y, MASK mask)
{
// by default, didn't handle it
- // llinfos << "LLTool::handleRightMouseDown" << llendl;
+ // LL_INFOS() << "LLTool::handleRightMouseDown" << LL_ENDL;
return FALSE;
}
BOOL LLTool::handleMiddleMouseDown(S32 x,S32 y,MASK mask)
{
// by default, didn't handle it
- // llinfos << "LLTool::handleMiddleMouseDown" << llendl;
+ // LL_INFOS() << "LLTool::handleMiddleMouseDown" << LL_ENDL;
return FALSE;
}
BOOL LLTool::handleMiddleMouseUp(S32 x, S32 y, MASK mask)
{
// by default, didn't handle it
- // llinfos << "LLTool::handleMiddleMouseUp" << llendl;
+ // LL_INFOS() << "LLTool::handleMiddleMouseUp" << LL_ENDL;
return FALSE;
}
BOOL LLTool::handleToolTip(S32 x, S32 y, MASK mask)
{
// by default, didn't handle it
- // llinfos << "LLTool::handleToolTip" << llendl;
+ // LL_INFOS() << "LLTool::handleToolTip" << LL_ENDL;
return FALSE;
}
diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp
index 36d4654393..fd950864aa 100755
--- a/indra/newview/lltoolbarview.cpp
+++ b/indra/newview/lltoolbarview.cpp
@@ -203,7 +203,7 @@ bool LLToolBarView::addCommandInternal(const LLCommandId& command, LLToolBar* to
}
else
{
- llwarns << "Toolbars creation : the command with id " << command.uuid().asString() << " cannot be found in the command manager" << llendl;
+ LL_WARNS() << "Toolbars creation : the command with id " << command.uuid().asString() << " cannot be found in the command manager" << LL_ENDL;
return false;
}
return true;
@@ -222,20 +222,20 @@ bool LLToolBarView::loadToolbars(bool force_default)
}
else if (!gDirUtilp->fileExists(toolbar_file))
{
- llwarns << "User toolbars def not found -> use default" << llendl;
+ LL_WARNS() << "User toolbars def not found -> use default" << LL_ENDL;
toolbar_file = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "toolbars.xml");
}
LLXMLNodePtr root;
if(!LLXMLNode::parseFile(toolbar_file, root, NULL))
{
- llwarns << "Unable to load toolbars from file: " << toolbar_file << llendl;
+ LL_WARNS() << "Unable to load toolbars from file: " << toolbar_file << LL_ENDL;
err = true;
}
if (!err && !root->hasName("toolbars"))
{
- llwarns << toolbar_file << " is not a valid toolbars definition file" << llendl;
+ LL_WARNS() << toolbar_file << " is not a valid toolbars definition file" << LL_ENDL;
err = true;
}
@@ -248,7 +248,7 @@ bool LLToolBarView::loadToolbars(bool force_default)
if (!err && !toolbar_set.validateBlock())
{
- llwarns << "Unable to validate toolbars from file: " << toolbar_file << llendl;
+ LL_WARNS() << "Unable to validate toolbars from file: " << toolbar_file << LL_ENDL;
err = true;
}
@@ -256,7 +256,7 @@ bool LLToolBarView::loadToolbars(bool force_default)
{
if (force_default)
{
- llerrs << "Unable to load toolbars from default file : " << toolbar_file << llendl;
+ LL_ERRS() << "Unable to load toolbars from default file : " << toolbar_file << LL_ENDL;
return false;
}
@@ -285,7 +285,7 @@ bool LLToolBarView::loadToolbars(bool force_default)
{
if (addCommandInternal(LLCommandId(command_params), mToolbars[LLToolBarEnums::TOOLBAR_LEFT]))
{
- llwarns << "Error adding command '" << command_params.name() << "' to left toolbar." << llendl;
+ LL_WARNS() << "Error adding command '" << command_params.name() << "' to left toolbar." << LL_ENDL;
}
}
}
@@ -300,7 +300,7 @@ bool LLToolBarView::loadToolbars(bool force_default)
{
if (addCommandInternal(LLCommandId(command_params), mToolbars[LLToolBarEnums::TOOLBAR_RIGHT]))
{
- llwarns << "Error adding command '" << command_params.name() << "' to right toolbar." << llendl;
+ LL_WARNS() << "Error adding command '" << command_params.name() << "' to right toolbar." << LL_ENDL;
}
}
}
@@ -315,7 +315,7 @@ bool LLToolBarView::loadToolbars(bool force_default)
{
if (addCommandInternal(LLCommandId(command_params), mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM]))
{
- llwarns << "Error adding command '" << command_params.name() << "' to bottom toolbar." << llendl;
+ LL_WARNS() << "Error adding command '" << command_params.name() << "' to bottom toolbar." << LL_ENDL;
}
}
}
@@ -523,7 +523,7 @@ void LLToolBarView::draw()
{
if (mToolbars[i])
{
- LLLayoutStack::ELayoutOrientation orientation = LLToolBarEnums::getOrientation(mToolbars[i]->getSideType());
+ LLView::EOrientation orientation = LLToolBarEnums::getOrientation(mToolbars[i]->getSideType());
if (orientation == LLLayoutStack::HORIZONTAL)
{
@@ -653,7 +653,7 @@ BOOL LLToolBarView::handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* t
}
else
{
- llwarns << "Command couldn't be found in command manager" << llendl;
+ LL_WARNS() << "Command couldn't be found in command manager" << LL_ENDL;
}
}
diff --git a/indra/newview/lltoolbrush.cpp b/indra/newview/lltoolbrush.cpp
index 08d82ea9cb..e3eb8ba7af 100755
--- a/indra/newview/lltoolbrush.cpp
+++ b/indra/newview/lltoolbrush.cpp
@@ -52,7 +52,7 @@
#include "llworld.h"
#include "llappviewer.h"
#include "llparcel.h"
-
+#include "roles_constants.h"
#include "llglheaders.h"
const std::string REGION_BLOCKS_TERRAFORM_MSG = "This region does not allow terraforming.\n"
@@ -239,9 +239,9 @@ void LLToolBrushLand::modifyLandInSelectionGlobal()
iter != mLastAffectedRegions.end(); ++iter)
{
LLViewerRegion* regionp = *iter;
- if (!canTerraform(regionp))
+ if (!canTerraformRegion(regionp))
{
- alertNoTerraform(regionp);
+ alertNoTerraformRegion(regionp);
return;
}
}
@@ -376,12 +376,17 @@ BOOL LLToolBrushLand::handleMouseDown(S32 x, S32 y, MASK mask)
LLRegionPosition region_position( spot );
LLViewerRegion* regionp = region_position.getRegion();
- if (!canTerraform(regionp))
+ if (!canTerraformRegion(regionp))
{
- alertNoTerraform(regionp);
+ alertNoTerraformRegion(regionp);
return TRUE;
}
+ if (!canTerraformParcel(regionp))
+ {
+ alertNoTerraformParcel();
+ }
+
LLVector3 pos_region = region_position.getPositionRegion();
U32 grids = regionp->getLand().mGridsPerEdge;
S32 i = llclamp( (S32)pos_region.mV[VX], 0, (S32)grids );
@@ -401,13 +406,23 @@ BOOL LLToolBrushLand::handleMouseDown(S32 x, S32 y, MASK mask)
BOOL LLToolBrushLand::handleHover( S32 x, S32 y, MASK mask )
{
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolBrushLand ("
+ LL_DEBUGS("UserInput") << "hover handled by LLToolBrushLand ("
<< (hasMouseCapture() ? "active":"inactive")
- << ")" << llendl;
+ << ")" << LL_ENDL;
mMouseX = x;
mMouseY = y;
mGotHover = TRUE;
gViewerWindow->setCursor(UI_CURSOR_TOOLLAND);
+
+ LLVector3d spot;
+ if( gViewerWindow->mousePointOnLandGlobal( mMouseX, mMouseY, &spot ) )
+ {
+
+ spot.mdV[VX] = floor( spot.mdV[VX] + 0.5 );
+ spot.mdV[VY] = floor( spot.mdV[VY] + 0.5 );
+
+ LLViewerParcelMgr::getInstance()->setHoverParcel(spot);
+ }
return TRUE;
}
@@ -456,7 +471,7 @@ void LLToolBrushLand::render()
{
if(mGotHover)
{
- //llinfos << "LLToolBrushLand::render()" << llendl;
+ //LL_INFOS() << "LLToolBrushLand::render()" << LL_ENDL;
LLVector3d spot;
if(gViewerWindow->mousePointOnLandGlobal(mMouseX, mMouseY, &spot))
{
@@ -653,7 +668,7 @@ void LLToolBrushLand::redo()
}*/
// static
-bool LLToolBrushLand::canTerraform(LLViewerRegion* regionp) const
+bool LLToolBrushLand::canTerraformRegion(LLViewerRegion* regionp) const
{
if (!regionp) return false;
if (regionp->canManageEstate()) return true;
@@ -661,7 +676,22 @@ bool LLToolBrushLand::canTerraform(LLViewerRegion* regionp) const
}
// static
-void LLToolBrushLand::alertNoTerraform(LLViewerRegion* regionp)
+bool LLToolBrushLand::canTerraformParcel(LLViewerRegion* regionp) const
+{
+ LLParcel* selected_parcel = LLViewerParcelMgr::getInstance()->getHoverParcel();
+ bool is_terraform_allowed = false;
+ if (selected_parcel)
+ {
+ BOOL owner_release = LLViewerParcelMgr::isParcelOwnedByAgent(selected_parcel, GP_LAND_ALLOW_EDIT_LAND);
+ is_terraform_allowed = ( gAgent.canManageEstate() || (selected_parcel->getOwnerID() == regionp->getOwner()) || owner_release);
+ }
+
+ return is_terraform_allowed;
+}
+
+
+// static
+void LLToolBrushLand::alertNoTerraformRegion(LLViewerRegion* regionp)
{
if (!regionp) return;
@@ -671,6 +701,19 @@ void LLToolBrushLand::alertNoTerraform(LLViewerRegion* regionp)
}
+// static
+void LLToolBrushLand::alertNoTerraformParcel()
+{
+ LLParcel* selected_parcel = LLViewerParcelMgr::getInstance()->getHoverParcel();
+ if (selected_parcel)
+ {
+ LLSD args;
+ args["PARCEL"] = selected_parcel->getName();
+ LLNotificationsUtil::add("ParcelNoTerraforming", args);
+ }
+
+}
+
///============================================================================
/// Local function definitions
///============================================================================
diff --git a/indra/newview/lltoolbrush.h b/indra/newview/lltoolbrush.h
index 1c7f198900..2ec6911de9 100755
--- a/indra/newview/lltoolbrush.h
+++ b/indra/newview/lltoolbrush.h
@@ -81,10 +81,14 @@ protected:
const LLVector3& pos_world);
// Does region allow terraform, or are we a god?
- bool canTerraform(LLViewerRegion* regionp) const;
+ bool canTerraformRegion(LLViewerRegion* regionp) const;
+
+ bool canTerraformParcel(LLViewerRegion* regionp) const;
// Modal dialog that you can't terraform the region
- void alertNoTerraform(LLViewerRegion* regionp);
+ void alertNoTerraformRegion(LLViewerRegion* regionp);
+
+ void alertNoTerraformParcel();
protected:
F32 mStartingZ;
diff --git a/indra/newview/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp
index b75d6b3dcb..4bda9072d0 100755
--- a/indra/newview/lltoolcomp.cpp
+++ b/indra/newview/lltoolcomp.cpp
@@ -126,12 +126,20 @@ void LLToolComposite::handleSelect()
mSelected = TRUE;
}
+void LLToolComposite::handleDeselect()
+{
+ mCur->handleDeselect();
+ mCur = mDefault;
+ mSelected = FALSE;
+}
+
//----------------------------------------------------------------------------
// LLToolCompInspect
//----------------------------------------------------------------------------
LLToolCompInspect::LLToolCompInspect()
-: LLToolComposite(std::string("Inspect"))
+: LLToolComposite(std::string("Inspect")),
+ mIsToolCameraActive(FALSE)
{
mSelectRect = new LLToolSelectRect(this);
mDefault = mSelectRect;
@@ -146,42 +154,87 @@ LLToolCompInspect::~LLToolCompInspect()
BOOL LLToolCompInspect::handleMouseDown(S32 x, S32 y, MASK mask)
{
- mMouseDown = TRUE;
- gViewerWindow->pickAsync(x, y, mask, pickCallback);
- return TRUE;
+ BOOL handled = FALSE;
+
+ if (mCur == LLToolCamera::getInstance())
+ {
+ handled = mCur->handleMouseDown(x, y, mask);
+ }
+ else
+ {
+ mMouseDown = TRUE;
+ gViewerWindow->pickAsync(x, y, mask, pickCallback);
+ handled = TRUE;
+ }
+
+ return handled;
+}
+
+BOOL LLToolCompInspect::handleMouseUp(S32 x, S32 y, MASK mask)
+{
+ BOOL handled = LLToolComposite::handleMouseUp(x, y, mask);
+ mIsToolCameraActive = getCurrentTool() == LLToolCamera::getInstance();
+ return handled;
}
void LLToolCompInspect::pickCallback(const LLPickInfo& pick_info)
{
LLViewerObject* hit_obj = pick_info.getObject();
+ LLToolCompInspect * tool_inspectp = LLToolCompInspect::getInstance();
- if (!LLToolCompInspect::getInstance()->mMouseDown)
+ if (!tool_inspectp->mMouseDown)
{
// fast click on object, but mouse is already up...just do select
- LLToolCompInspect::getInstance()->mSelectRect->handleObjectSelection(pick_info, gSavedSettings.getBOOL("EditLinkedParts"), FALSE);
+ tool_inspectp->mSelectRect->handleObjectSelection(pick_info, gSavedSettings.getBOOL("EditLinkedParts"), FALSE);
return;
}
- if( hit_obj )
- {
- if (LLSelectMgr::getInstance()->getSelection()->getObjectCount())
- {
- LLEditMenuHandler::gEditMenuHandler = LLSelectMgr::getInstance();
- }
- LLToolCompInspect::getInstance()->setCurrentTool( LLToolCompInspect::getInstance()->mSelectRect );
- LLToolCompInspect::getInstance()->mSelectRect->handlePick( pick_info );
+ LLSelectMgr * mgr_selectp = LLSelectMgr::getInstance();
+ if( hit_obj && mgr_selectp->getSelection()->getObjectCount()) {
+ LLEditMenuHandler::gEditMenuHandler = mgr_selectp;
+ }
+
+ tool_inspectp->setCurrentTool( tool_inspectp->mSelectRect );
+ tool_inspectp->mIsToolCameraActive = FALSE;
+ tool_inspectp->mSelectRect->handlePick( pick_info );
+}
+
+BOOL LLToolCompInspect::handleDoubleClick(S32 x, S32 y, MASK mask)
+{
+ return TRUE;
+}
+
+BOOL LLToolCompInspect::handleKey(KEY key, MASK mask)
+{
+ BOOL handled = FALSE;
+ if(KEY_ALT == key)
+ {
+ setCurrentTool(LLToolCamera::getInstance());
+ mIsToolCameraActive = TRUE;
+ handled = TRUE;
}
else
{
- LLToolCompInspect::getInstance()->setCurrentTool( LLToolCompInspect::getInstance()->mSelectRect );
- LLToolCompInspect::getInstance()->mSelectRect->handlePick( pick_info );
+ handled = LLToolComposite::handleKey(key, mask);
}
+
+ return handled;
}
-BOOL LLToolCompInspect::handleDoubleClick(S32 x, S32 y, MASK mask)
+void LLToolCompInspect::onMouseCaptureLost()
{
- return TRUE;
+ LLToolComposite::onMouseCaptureLost();
+ mIsToolCameraActive = FALSE;
+}
+
+void LLToolCompInspect::keyUp(KEY key, MASK mask)
+{
+ if (KEY_ALT == key && mCur == LLToolCamera::getInstance())
+ {
+ setCurrentTool(mDefault);
+ mIsToolCameraActive = FALSE;
+ }
}
//----------------------------------------------------------------------------
diff --git a/indra/newview/lltoolcomp.h b/indra/newview/lltoolcomp.h
index bbb5ed5797..e75d3c22e2 100755
--- a/indra/newview/lltoolcomp.h
+++ b/indra/newview/lltoolcomp.h
@@ -62,7 +62,7 @@ public:
virtual BOOL clipMouseWhenDown() { return mCur->clipMouseWhenDown(); }
virtual void handleSelect();
- virtual void handleDeselect() { mCur->handleDeselect(); mCur = mDefault; mSelected = FALSE; }
+ virtual void handleDeselect();
virtual void render() { mCur->render(); }
virtual void draw() { mCur->draw(); }
@@ -78,9 +78,10 @@ public:
{ mCur->localPointToScreen(local_x, local_y, screen_x, screen_y); }
BOOL isSelecting();
+ LLTool* getCurrentTool() { return mCur; }
+
protected:
void setCurrentTool( LLTool* new_tool );
- LLTool* getCurrentTool() { return mCur; }
// In hover handler, call this to auto-switch tools
void setToolFromMask( MASK mask, LLTool *normal );
@@ -108,9 +109,18 @@ public:
// Overridden from LLToolComposite
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
+ virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
+ virtual BOOL handleKey(KEY key, MASK mask);
+ virtual void onMouseCaptureLost();
+ void keyUp(KEY key, MASK mask);
static void pickCallback(const LLPickInfo& pick_info);
+
+ BOOL isToolCameraActive() const { return mIsToolCameraActive; }
+
+private:
+ BOOL mIsToolCameraActive;
};
//-----------------------------------------------------------------------
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index 1a137f7129..575e5c5c52 100755
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -175,7 +175,7 @@ public:
virtual void done()
{
/* no-op: it's fire n forget right? */
- lldebugs << "LLCategoryFireAndForget::done()" << llendl;
+ LL_DEBUGS() << "LLCategoryFireAndForget::done()" << LL_ENDL;
}
};
@@ -256,7 +256,7 @@ void LLCategoryDropDescendentsObserver::done()
LLInventoryModel::EXCLUDE_TRASH);
}
- S32 count = items.count();
+ S32 count = items.size();
if (count)
{
std::set<LLUUID> unique_ids;
@@ -371,7 +371,7 @@ void LLToolDragAndDrop::beginDrag(EDragAndDropType type,
{
if (type == DAD_NONE)
{
- llwarns << "Attempted to start drag without a cargo type" << llendl;
+ LL_WARNS() << "Attempted to start drag without a cargo type" << LL_ENDL;
return;
}
mCargoTypes.clear();
@@ -408,16 +408,16 @@ void LLToolDragAndDrop::beginDrag(EDragAndDropType type,
items,
LLInventoryModel::EXCLUDE_TRASH,
is_not_preferred);
- S32 count = cats.count();
+ S32 count = cats.size();
S32 i;
for(i = 0; i < count; ++i)
{
- folder_ids.push_back(cats.get(i)->getUUID());
+ folder_ids.push_back(cats.at(i)->getUUID());
}
- count = items.count();
+ count = items.size();
for(i = 0; i < count; ++i)
{
- item_ids.push_back(items.get(i)->getUUID());
+ item_ids.push_back(items.at(i)->getUUID());
}
if (!folder_ids.empty() || !item_ids.empty())
{
@@ -443,7 +443,7 @@ void LLToolDragAndDrop::beginMultiDrag(
{
if (DAD_NONE == *types_it)
{
- llwarns << "Attempted to start drag without a cargo type" << llendl;
+ LL_WARNS() << "Attempted to start drag without a cargo type" << LL_ENDL;
return;
}
}
@@ -479,7 +479,7 @@ void LLToolDragAndDrop::beginMultiDrag(
items,
LLInventoryModel::EXCLUDE_TRASH,
is_not_preferred);
- S32 cat_count = cats.count();
+ S32 cat_count = cats.size();
for(S32 i = 0; i < cat_count; ++i)
{
cat_ids.insert(cat->getUUID());
@@ -513,6 +513,7 @@ void LLToolDragAndDrop::onMouseCaptureLost()
mSource = SOURCE_AGENT;
mSourceID.setNull();
mObjectID.setNull();
+ mCustomMsg.clear();
}
BOOL LLToolDragAndDrop::handleMouseUp( S32 x, S32 y, MASK mask )
@@ -556,6 +557,12 @@ ECursorType LLToolDragAndDrop::acceptanceToCursor( EAcceptance acceptance )
mCursor = UI_CURSOR_NOLOCKED;
break;
+ case ACCEPT_NO_CUSTOM:
+ mToolTipMsg = mCustomMsg;
+ mCursor = UI_CURSOR_NO;
+ break;
+
+
case ACCEPT_NO:
mCursor = UI_CURSOR_NO;
break;
@@ -598,7 +605,7 @@ BOOL LLToolDragAndDrop::handleHover( S32 x, S32 y, MASK mask )
ECursorType cursor = acceptanceToCursor(acceptance);
gViewerWindow->getWindow()->setCursor( cursor );
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolDragAndDrop" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolDragAndDrop" << LL_ENDL;
return TRUE;
}
@@ -630,6 +637,7 @@ BOOL LLToolDragAndDrop::handleToolTip(S32 x, S32 y, MASK mask)
void LLToolDragAndDrop::handleDeselect()
{
mToolTipMsg.clear();
+ mCustomMsg.clear();
LLToolTipMgr::instance().blockToolTips();
}
@@ -1035,7 +1043,7 @@ BOOL LLToolDragAndDrop::handleDropTextureProtections(LLViewerObject* hit_obj,
}
else
{
- llwarns << "Unable to find source object." << llendl;
+ LL_WARNS() << "Unable to find source object." << LL_ENDL;
return FALSE;
}
}
@@ -1085,7 +1093,7 @@ void LLToolDragAndDrop::dropTextureAllFaces(LLViewerObject* hit_obj,
{
if (!item)
{
- llwarns << "LLToolDragAndDrop::dropTextureAllFaces no texture item." << llendl;
+ LL_WARNS() << "LLToolDragAndDrop::dropTextureAllFaces no texture item." << LL_ENDL;
return;
}
LLUUID asset_id = item->getAssetUUID();
@@ -1095,7 +1103,7 @@ void LLToolDragAndDrop::dropTextureAllFaces(LLViewerObject* hit_obj,
return;
}
LLViewerTexture* image = LLViewerTextureManager::getFetchedTexture(asset_id);
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT );
+ add(LLStatViewer::EDIT_TEXTURE, 1);
S32 num_faces = hit_obj->getNumTEs();
for( S32 face = 0; face < num_faces; face++ )
{
@@ -1115,7 +1123,7 @@ void LLToolDragAndDrop::dropMesh(LLViewerObject* hit_obj,
{
if (!item)
{
- llwarns << "no inventory item." << llendl;
+ LL_WARNS() << "no inventory item." << LL_ENDL;
return;
}
LLUUID asset_id = item->getAssetUUID();
@@ -1152,7 +1160,7 @@ void LLToolDragAndDrop::dropTextureOneFace(LLViewerObject* hit_obj,
if (hit_face == -1) return;
if (!item)
{
- llwarns << "LLToolDragAndDrop::dropTextureOneFace no texture item." << llendl;
+ LL_WARNS() << "LLToolDragAndDrop::dropTextureOneFace no texture item." << LL_ENDL;
return;
}
LLUUID asset_id = item->getAssetUUID();
@@ -1163,7 +1171,7 @@ void LLToolDragAndDrop::dropTextureOneFace(LLViewerObject* hit_obj,
}
// update viewer side image in anticipation of update from simulator
LLViewerTexture* image = LLViewerTextureManager::getFetchedTexture(asset_id);
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT );
+ add(LLStatViewer::EDIT_TEXTURE, 1);
LLTextureEntry* tep = hit_obj ? (hit_obj->getTE(hit_face)) : NULL;
@@ -1227,8 +1235,8 @@ void LLToolDragAndDrop::dropScript(LLViewerObject* hit_obj,
if ((SOURCE_WORLD == LLToolDragAndDrop::getInstance()->mSource)
|| (SOURCE_NOTECARD == LLToolDragAndDrop::getInstance()->mSource))
{
- llwarns << "Call to LLToolDragAndDrop::dropScript() from world"
- << " or notecard." << llendl;
+ LL_WARNS() << "Call to LLToolDragAndDrop::dropScript() from world"
+ << " or notecard." << LL_ENDL;
return;
}
if (hit_obj && item)
@@ -1255,7 +1263,7 @@ void LLToolDragAndDrop::dropScript(LLViewerObject* hit_obj,
}
else
{
- llwarns << "Unable to find source object." << llendl;
+ LL_WARNS() << "Unable to find source object." << LL_ENDL;
return;
}
}
@@ -1280,11 +1288,11 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target,
LLViewerRegion* regionp = LLWorld::getInstance()->getRegionFromPosGlobal(mLastHitPos);
if (!regionp)
{
- llwarns << "Couldn't find region to rez object" << llendl;
+ LL_WARNS() << "Couldn't find region to rez object" << LL_ENDL;
return;
}
- //llinfos << "Rezzing object" << llendl;
+ //LL_INFOS() << "Rezzing object" << LL_ENDL;
make_ui_sound("UISndObjectRezIn");
LLViewerInventoryItem* item;
LLViewerInventoryCategory* cat;
@@ -1431,7 +1439,7 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target,
effectp->setDuration(LL_HUD_DUR_SHORT);
effectp->setColor(LLColor4U(gAgent.getEffectColor()));
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_REZ_COUNT);
+ add(LLStatViewer::OBJECT_REZ, 1);
}
void LLToolDragAndDrop::dropInventory(LLViewerObject* hit_obj,
@@ -1444,8 +1452,8 @@ void LLToolDragAndDrop::dropInventory(LLViewerObject* hit_obj,
if ((SOURCE_WORLD == LLToolDragAndDrop::getInstance()->mSource)
|| (SOURCE_NOTECARD == LLToolDragAndDrop::getInstance()->mSource))
{
- llwarns << "Call to LLToolDragAndDrop::dropInventory() from world"
- << " or notecard." << llendl;
+ LL_WARNS() << "Call to LLToolDragAndDrop::dropInventory() from world"
+ << " or notecard." << LL_ENDL;
return;
}
@@ -1475,7 +1483,7 @@ void LLToolDragAndDrop::dropInventory(LLViewerObject* hit_obj,
}
else
{
- llwarns << "Unable to find source object." << llendl;
+ LL_WARNS() << "Unable to find source object." << LL_ENDL;
return;
}
}
@@ -1584,13 +1592,22 @@ static void give_inventory_cb(const LLSD& notification, const LLSD& response)
const LLUUID& session_id = payload["session_id"];
const LLUUID& agent_id = payload["agent_id"];
LLViewerInventoryItem * inv_item = gInventory.getItem(payload["item_id"]);
- if (NULL == inv_item)
+ LLViewerInventoryCategory * inv_cat = gInventory.getCategory(payload["item_id"]);
+ if (NULL == inv_item && NULL == inv_cat)
{
- llassert(NULL != inv_item);
+ llassert( FALSE );
return;
}
-
- if (LLGiveInventory::doGiveInventoryItem(agent_id, inv_item, session_id))
+ bool successfully_shared;
+ if (inv_item)
+ {
+ successfully_shared = LLGiveInventory::doGiveInventoryItem(agent_id, inv_item, session_id);
+ }
+ else
+ {
+ successfully_shared = LLGiveInventory::doGiveInventoryCategory(agent_id, inv_cat, session_id);
+ }
+ if (successfully_shared)
{
if ("avatarpicker" == payload["d&d_dest"].asString())
{
@@ -1600,8 +1617,8 @@ static void give_inventory_cb(const LLSD& notification, const LLSD& response)
}
}
-static void show_item_sharing_confirmation(const std::string name,
- LLViewerInventoryItem* inv_item,
+static void show_object_sharing_confirmation(const std::string name,
+ LLInventoryObject* inv_item,
const LLSD& dest,
const LLUUID& dest_agent,
const LLUUID& session_id = LLUUID::null)
@@ -1611,7 +1628,6 @@ static void show_item_sharing_confirmation(const std::string name,
llassert(NULL != inv_item);
return;
}
-
LLSD substitutions;
substitutions["RESIDENTS"] = name;
substitutions["ITEMS"] = inv_item->getName();
@@ -1625,15 +1641,15 @@ static void show_item_sharing_confirmation(const std::string name,
static void get_name_cb(const LLUUID& id,
const std::string& full_name,
- LLViewerInventoryItem* inv_item,
+ LLInventoryObject* inv_obj,
const LLSD& dest,
const LLUUID& dest_agent)
{
- show_item_sharing_confirmation(full_name,
- inv_item,
- dest,
- id,
- LLUUID::null);
+ show_object_sharing_confirmation(full_name,
+ inv_obj,
+ dest,
+ id,
+ LLUUID::null);
}
// function used as drag-and-drop handler for simple agent give inventory requests
@@ -1659,10 +1675,11 @@ bool LLToolDragAndDrop::handleGiveDragAndDrop(LLUUID dest_agent, LLUUID session_
case DAD_GESTURE:
case DAD_CALLINGCARD:
case DAD_MESH:
+ case DAD_CATEGORY:
{
- LLViewerInventoryItem* inv_item = (LLViewerInventoryItem*)cargo_data;
- if(gInventory.getItem(inv_item->getUUID())
- && LLGiveInventory::isInventoryGiveAcceptable(inv_item))
+ LLInventoryObject* inv_obj = (LLInventoryObject*)cargo_data;
+ if(gInventory.getCategory(inv_obj->getUUID()) || (gInventory.getItem(inv_obj->getUUID())
+ && LLGiveInventory::isInventoryGiveAcceptable(dynamic_cast<LLInventoryItem*>(inv_obj))))
{
// *TODO: get multiple object transfers working
*accept = ACCEPT_YES_COPY_SINGLE;
@@ -1679,40 +1696,18 @@ bool LLToolDragAndDrop::handleGiveDragAndDrop(LLUUID dest_agent, LLUUID session_
// Otherwise set up a callback to show the dialog when the name arrives.
if (gCacheName->getFullName(dest_agent, fullname))
{
- show_item_sharing_confirmation(fullname, inv_item, dest, dest_agent, LLUUID::null);
+ show_object_sharing_confirmation(fullname, inv_obj, dest, dest_agent, LLUUID::null);
}
else
{
- gCacheName->get(dest_agent, false, boost::bind(&get_name_cb, _1, _2, inv_item, dest, dest_agent));
+ gCacheName->get(dest_agent, false, boost::bind(&get_name_cb, _1, _2, inv_obj, dest, dest_agent));
}
return true;
}
// If an IM session with destination agent is found item offer will be logged in this session.
- show_item_sharing_confirmation(session->mName, inv_item, dest, dest_agent, session_id);
- }
- }
- else
- {
- // It's not in the user's inventory (it's probably
- // in an object's contents), so disallow dragging
- // it here. You can't give something you don't
- // yet have.
- *accept = ACCEPT_NO;
- }
- break;
- }
- case DAD_CATEGORY:
- {
- LLViewerInventoryCategory* inv_cat = (LLViewerInventoryCategory*)cargo_data;
- if( gInventory.getCategory( inv_cat->getUUID() ) )
- {
- // *TODO: get multiple object transfers working
- *accept = ACCEPT_YES_COPY_SINGLE;
- if(drop)
- {
- LLGiveInventory::doGiveInventoryCategory(dest_agent, inv_cat, session_id);
+ show_object_sharing_confirmation(session->mName, inv_obj, dest, dest_agent, session_id);
}
}
else
@@ -1742,14 +1737,14 @@ bool LLToolDragAndDrop::handleGiveDragAndDrop(LLUUID dest_agent, LLUUID session_
EAcceptance LLToolDragAndDrop::dad3dNULL(
LLViewerObject*, S32, MASK, BOOL)
{
- lldebugs << "LLToolDragAndDrop::dad3dNULL()" << llendl;
+ LL_DEBUGS() << "LLToolDragAndDrop::dad3dNULL()" << LL_ENDL;
return ACCEPT_NO;
}
EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv(
LLViewerObject* obj, S32 face, MASK mask, BOOL drop)
{
- lldebugs << "LLToolDragAndDrop::dad3dRezAttachmentFromInv()" << llendl;
+ LL_DEBUGS() << "LLToolDragAndDrop::dad3dRezAttachmentFromInv()" << LL_ENDL;
// must be in the user's inventory
if(mSource != SOURCE_AGENT && mSource != SOURCE_LIBRARY)
{
@@ -1812,7 +1807,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezObjectOnLand(
return dad3dRezFromObjectOnLand(obj, face, mask, drop);
}
- lldebugs << "LLToolDragAndDrop::dad3dRezObjectOnLand()" << llendl;
+ LL_DEBUGS() << "LLToolDragAndDrop::dad3dRezObjectOnLand()" << LL_ENDL;
LLViewerInventoryItem* item;
LLViewerInventoryCategory* cat;
locateInventory(item, cat);
@@ -1875,7 +1870,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezObjectOnObject(
return dad3dRezFromObjectOnObject(obj, face, mask, drop);
}
- lldebugs << "LLToolDragAndDrop::dad3dRezObjectOnObject()" << llendl;
+ LL_DEBUGS() << "LLToolDragAndDrop::dad3dRezObjectOnObject()" << LL_ENDL;
LLViewerInventoryItem* item;
LLViewerInventoryCategory* cat;
locateInventory(item, cat);
@@ -1947,7 +1942,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezObjectOnObject(
EAcceptance LLToolDragAndDrop::dad3dRezScript(
LLViewerObject* obj, S32 face, MASK mask, BOOL drop)
{
- lldebugs << "LLToolDragAndDrop::dad3dRezScript()" << llendl;
+ LL_DEBUGS() << "LLToolDragAndDrop::dad3dRezScript()" << LL_ENDL;
// *HACK: In order to resolve SL-22177, we need to block drags
// from notecards and objects onto other objects.
@@ -1985,7 +1980,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezScript(
EAcceptance LLToolDragAndDrop::dad3dApplyToObject(
LLViewerObject* obj, S32 face, MASK mask, BOOL drop, EDragAndDropType cargo_type)
{
- lldebugs << "LLToolDragAndDrop::dad3dApplyToObject()" << llendl;
+ LL_DEBUGS() << "LLToolDragAndDrop::dad3dApplyToObject()" << LL_ENDL;
// *HACK: In order to resolve SL-22177, we need to block drags
// from notecards and objects onto other objects.
@@ -2036,7 +2031,7 @@ EAcceptance LLToolDragAndDrop::dad3dApplyToObject(
}
else
{
- llwarns << "unsupported asset type" << llendl;
+ LL_WARNS() << "unsupported asset type" << LL_ENDL;
}
// VEFFECT: SetTexture
@@ -2069,7 +2064,7 @@ EAcceptance LLToolDragAndDrop::dad3dMeshObject(
EAcceptance LLToolDragAndDrop::dad3dTextureSelf(
LLViewerObject* obj, S32 face, MASK mask, BOOL drop)
{
- lldebugs << "LLToolDragAndDrop::dad3dTextureAvatar()" << llendl;
+ LL_DEBUGS() << "LLToolDragAndDrop::dad3dTextureAvatar()" << LL_ENDL;
if(drop)
{
if( !(mask & MASK_SHIFT) )
@@ -2084,7 +2079,7 @@ EAcceptance LLToolDragAndDrop::dad3dTextureSelf(
EAcceptance LLToolDragAndDrop::dad3dWearItem(
LLViewerObject* obj, S32 face, MASK mask, BOOL drop)
{
- lldebugs << "LLToolDragAndDrop::dad3dWearItem()" << llendl;
+ LL_DEBUGS() << "LLToolDragAndDrop::dad3dWearItem()" << LL_ENDL;
LLViewerInventoryItem* item;
LLViewerInventoryCategory* cat;
locateInventory(item, cat);
@@ -2117,7 +2112,7 @@ EAcceptance LLToolDragAndDrop::dad3dWearItem(
EAcceptance LLToolDragAndDrop::dad3dActivateGesture(
LLViewerObject* obj, S32 face, MASK mask, BOOL drop)
{
- lldebugs << "LLToolDragAndDrop::dad3dActivateGesture()" << llendl;
+ LL_DEBUGS() << "LLToolDragAndDrop::dad3dActivateGesture()" << LL_ENDL;
LLViewerInventoryItem* item;
LLViewerInventoryCategory* cat;
locateInventory(item, cat);
@@ -2166,7 +2161,7 @@ EAcceptance LLToolDragAndDrop::dad3dActivateGesture(
EAcceptance LLToolDragAndDrop::dad3dWearCategory(
LLViewerObject* obj, S32 face, MASK mask, BOOL drop)
{
- lldebugs << "LLToolDragAndDrop::dad3dWearCategory()" << llendl;
+ LL_DEBUGS() << "LLToolDragAndDrop::dad3dWearCategory()" << LL_ENDL;
LLViewerInventoryItem* item;
LLViewerInventoryCategory* category;
locateInventory(item, category);
@@ -2177,6 +2172,26 @@ EAcceptance LLToolDragAndDrop::dad3dWearCategory(
// TODO: investigate wearables may not be loaded at this point EXT-8231
}
+ U32 max_items = gSavedSettings.getU32("WearFolderLimit");
+ if (category->getDescendentCount()>max_items)
+ {
+ LLInventoryModel::cat_array_t cats;
+ LLInventoryModel::item_array_t items;
+ LLFindWearablesEx not_worn(/*is_worn=*/ false, /*include_body_parts=*/ false);
+ gInventory.collectDescendentsIf(category->getUUID(),
+ cats,
+ items,
+ LLInventoryModel::EXCLUDE_TRASH,
+ not_worn);
+ if (items.size() > max_items)
+ {
+ LLStringUtil::format_map_t args;
+ args["AMOUNT"] = llformat("%d", max_items);
+ mCustomMsg = LLTrans::getString("TooltipTooManyWearables",args);
+ return ACCEPT_NO_CUSTOM;
+ }
+ }
+
if(mSource == SOURCE_AGENT)
{
const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
@@ -2217,7 +2232,7 @@ EAcceptance LLToolDragAndDrop::dad3dWearCategory(
EAcceptance LLToolDragAndDrop::dad3dUpdateInventory(
LLViewerObject* obj, S32 face, MASK mask, BOOL drop)
{
- lldebugs << "LLToolDragAndDrop::dadUpdateInventory()" << llendl;
+ LL_DEBUGS() << "LLToolDragAndDrop::dadUpdateInventory()" << LL_ENDL;
// *HACK: In order to resolve SL-22177, we need to block drags
// from notecards and objects onto other objects.
@@ -2257,10 +2272,10 @@ BOOL LLToolDragAndDrop::dadUpdateInventory(LLViewerObject* obj, BOOL drop)
EAcceptance LLToolDragAndDrop::dad3dUpdateInventoryCategory(
LLViewerObject* obj, S32 face, MASK mask, BOOL drop)
{
- lldebugs << "LLToolDragAndDrop::dad3dUpdateInventoryCategory()" << llendl;
+ LL_DEBUGS() << "LLToolDragAndDrop::dad3dUpdateInventoryCategory()" << LL_ENDL;
if (obj == NULL)
{
- llwarns << "obj is NULL; aborting func with ACCEPT_NO" << llendl;
+ LL_WARNS() << "obj is NULL; aborting func with ACCEPT_NO" << LL_ENDL;
return ACCEPT_NO;
}
@@ -2290,10 +2305,10 @@ EAcceptance LLToolDragAndDrop::dad3dUpdateInventoryCategory(
items,
LLInventoryModel::EXCLUDE_TRASH,
droppable);
- cats.put(cat);
+ cats.push_back(cat);
if (droppable.countNoCopy() > 0)
{
- llwarns << "*** Need to confirm this step" << llendl;
+ LL_WARNS() << "*** Need to confirm this step" << LL_ENDL;
}
LLViewerObject* root_object = obj;
if (obj->getParent())
@@ -2316,7 +2331,7 @@ EAcceptance LLToolDragAndDrop::dad3dUpdateInventoryCategory(
rv = gInventory.isCategoryComplete(cat->getUUID()) ? ACCEPT_YES_MULTI : ACCEPT_NO;
if(rv < ACCEPT_YES_SINGLE)
{
- lldebugs << "Category " << cat->getUUID() << "is not complete." << llendl;
+ LL_DEBUGS() << "Category " << cat->getUUID() << "is not complete." << LL_ENDL;
break;
}
}
@@ -2338,7 +2353,7 @@ EAcceptance LLToolDragAndDrop::dad3dUpdateInventoryCategory(
rv = willObjectAcceptInventory(root_object, item);
if (rv < ACCEPT_YES_COPY_SINGLE)
{
- lldebugs << "Object will not accept " << item->getUUID() << llendl;
+ LL_DEBUGS() << "Object will not accept " << item->getUUID() << LL_ENDL;
break;
}
}
@@ -2379,7 +2394,7 @@ BOOL LLToolDragAndDrop::dadUpdateInventoryCategory(LLViewerObject* obj,
EAcceptance LLToolDragAndDrop::dad3dGiveInventoryObject(
LLViewerObject* obj, S32 face, MASK mask, BOOL drop)
{
- lldebugs << "LLToolDragAndDrop::dad3dGiveInventoryObject()" << llendl;
+ LL_DEBUGS() << "LLToolDragAndDrop::dad3dGiveInventoryObject()" << LL_ENDL;
// item has to be in agent inventory.
if(mSource != SOURCE_AGENT) return ACCEPT_NO;
@@ -2417,7 +2432,7 @@ EAcceptance LLToolDragAndDrop::dad3dGiveInventoryObject(
EAcceptance LLToolDragAndDrop::dad3dGiveInventory(
LLViewerObject* obj, S32 face, MASK mask, BOOL drop)
{
- lldebugs << "LLToolDragAndDrop::dad3dGiveInventory()" << llendl;
+ LL_DEBUGS() << "LLToolDragAndDrop::dad3dGiveInventory()" << LL_ENDL;
// item has to be in agent inventory.
if(mSource != SOURCE_AGENT) return ACCEPT_NO;
LLViewerInventoryItem* item;
@@ -2440,7 +2455,7 @@ EAcceptance LLToolDragAndDrop::dad3dGiveInventory(
EAcceptance LLToolDragAndDrop::dad3dGiveInventoryCategory(
LLViewerObject* obj, S32 face, MASK mask, BOOL drop)
{
- lldebugs << "LLToolDragAndDrop::dad3dGiveInventoryCategory()" << llendl;
+ LL_DEBUGS() << "LLToolDragAndDrop::dad3dGiveInventoryCategory()" << LL_ENDL;
if(drop && obj)
{
LLViewerInventoryItem* item;
@@ -2458,7 +2473,7 @@ EAcceptance LLToolDragAndDrop::dad3dGiveInventoryCategory(
EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnLand(
LLViewerObject* obj, S32 face, MASK mask, BOOL drop)
{
- lldebugs << "LLToolDragAndDrop::dad3dRezFromObjectOnLand()" << llendl;
+ LL_DEBUGS() << "LLToolDragAndDrop::dad3dRezFromObjectOnLand()" << LL_ENDL;
LLViewerInventoryItem* item = NULL;
LLViewerInventoryCategory* cat = NULL;
locateInventory(item, cat);
@@ -2479,7 +2494,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnLand(
EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnObject(
LLViewerObject* obj, S32 face, MASK mask, BOOL drop)
{
- lldebugs << "LLToolDragAndDrop::dad3dRezFromObjectOnObject()" << llendl;
+ LL_DEBUGS() << "LLToolDragAndDrop::dad3dRezFromObjectOnObject()" << LL_ENDL;
LLViewerInventoryItem* item;
LLViewerInventoryCategory* cat;
locateInventory(item, cat);
@@ -2516,7 +2531,7 @@ EAcceptance LLToolDragAndDrop::dad3dCategoryOnLand(
{
return ACCEPT_NO;
/*
- lldebugs << "LLToolDragAndDrop::dad3dCategoryOnLand()" << llendl;
+ LL_DEBUGS() << "LLToolDragAndDrop::dad3dCategoryOnLand()" << LL_ENDL;
LLInventoryItem* item;
LLInventoryCategory* cat;
locateInventory(item, cat);
@@ -2532,7 +2547,7 @@ EAcceptance LLToolDragAndDrop::dad3dCategoryOnLand(
items,
LLInventoryModel::EXCLUDE_TRASH,
droppable);
- if(items.count() > 0)
+ if(items.size() > 0)
{
rv = ACCEPT_YES_SINGLE;
}
@@ -2554,19 +2569,19 @@ EAcceptance LLToolDragAndDrop::dad3dAssetOnLand(
{
return ACCEPT_NO;
/*
- lldebugs << "LLToolDragAndDrop::dad3dAssetOnLand()" << llendl;
+ LL_DEBUGS() << "LLToolDragAndDrop::dad3dAssetOnLand()" << LL_ENDL;
LLViewerInventoryCategory::cat_array_t cats;
LLViewerInventoryItem::item_array_t items;
LLViewerInventoryItem::item_array_t copyable_items;
locateMultipleInventory(items, cats);
- if(!items.count()) return ACCEPT_NO;
+ if(!items.size()) return ACCEPT_NO;
EAcceptance rv = ACCEPT_NO;
- for (S32 i = 0; i < items.count(); i++)
+ for (S32 i = 0; i < items.size(); i++)
{
LLInventoryItem* item = items[i];
if(item->getPermissions().allowCopyBy(gAgent.getID()))
{
- copyable_items.put(item);
+ copyable_items.push_back(item);
rv = ACCEPT_YES_SINGLE;
}
}
@@ -2638,21 +2653,21 @@ LLInventoryObject* LLToolDragAndDrop::locateInventory(
LLInventoryObject* LLToolDragAndDrop::locateMultipleInventory(LLViewerInventoryCategory::cat_array_t& cats,
LLViewerInventoryItem::item_array_t& items)
{
- if(mCargoIDs.count() == 0) return NULL;
+ if(mCargoIDs.size() == 0) return NULL;
if((mSource == SOURCE_AGENT) || (mSource == SOURCE_LIBRARY))
{
// The object should be in user inventory.
- for (S32 i = 0; i < mCargoIDs.count(); i++)
+ for (S32 i = 0; i < mCargoIDs.size(); i++)
{
LLInventoryItem* item = gInventory.getItem(mCargoIDs[i]);
if (item)
{
- items.put(item);
+ items.push_back(item);
}
LLInventoryCategory* category = gInventory.getCategory(mCargoIDs[i]);
if (category)
{
- cats.put(category);
+ cats.push_back(category);
}
}
}
@@ -2666,23 +2681,23 @@ LLInventoryObject* LLToolDragAndDrop::locateMultipleInventory(LLViewerInventoryC
|| (mCargoType == DAD_ROOT_CATEGORY))
{
// The object should be in user inventory.
- for (S32 i = 0; i < mCargoIDs.count(); i++)
+ for (S32 i = 0; i < mCargoIDs.size(); i++)
{
LLInventoryCategory* category = (LLInventoryCategory*)obj->getInventoryObject(mCargoIDs[i]);
if (category)
{
- cats.put(category);
+ cats.push_back(category);
}
}
}
else
{
- for (S32 i = 0; i < mCargoIDs.count(); i++)
+ for (S32 i = 0; i < mCargoIDs.size(); i++)
{
LLInventoryItem* item = (LLInventoryItem*)obj->getInventoryObject(mCargoIDs[i]);
if (item)
{
- items.put(item);
+ items.push_back(item);
}
}
}
@@ -2694,18 +2709,18 @@ LLInventoryObject* LLToolDragAndDrop::locateMultipleInventory(LLViewerInventoryC
card = (LLPreviewNotecard*)LLPreview::find(mSourceID);
if(card)
{
- items.put((LLInventoryItem*)card->getDragItem());
+ items.push_back((LLInventoryItem*)card->getDragItem());
}
}
- if(items.count()) return items[0];
- if(cats.count()) return cats[0];
+ if(items.size()) return items[0];
+ if(cats.size()) return cats[0];
return NULL;
}
*/
// void LLToolDragAndDrop::createContainer(LLViewerInventoryItem::item_array_t &items, const char* preferred_name )
// {
-// llwarns << "LLToolDragAndDrop::createContainer()" << llendl;
+// LL_WARNS() << "LLToolDragAndDrop::createContainer()" << LL_ENDL;
// return;
// }
diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h
index f17300a76a..de501ea32a 100755
--- a/indra/newview/lltooldraganddrop.h
+++ b/indra/newview/lltooldraganddrop.h
@@ -31,9 +31,7 @@
#include "lltool.h"
#include "llview.h"
#include "lluuid.h"
-#include "stdenums.h"
#include "llassetstorage.h"
-#include "lldarray.h"
#include "llpermissions.h"
#include "llwindow.h"
#include "llviewerinventory.h"
@@ -151,6 +149,7 @@ protected:
BOOL mDrop;
S32 mCurItemIndex;
std::string mToolTipMsg;
+ std::string mCustomMsg;
enddrag_signal_t mEndDragSignal;
diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp
index 857b0f0714..58073d1186 100755
--- a/indra/newview/lltoolfocus.cpp
+++ b/indra/newview/lltoolfocus.cpp
@@ -53,6 +53,7 @@
#include "llmorphview.h"
#include "llfloaterreg.h"
#include "llfloatercamera.h"
+#include "llmenugl.h"
// Globals
BOOL gCameraBtnZoom = TRUE;
@@ -75,6 +76,7 @@ LLToolCamera::LLToolCamera()
mOutsideSlopX(FALSE),
mOutsideSlopY(FALSE),
mValidClickPoint(FALSE),
+ mValidSelection(FALSE),
mMouseSteering(FALSE),
mMouseUpX(0),
mMouseUpY(0),
@@ -91,6 +93,8 @@ void LLToolCamera::handleSelect()
if (gFloaterTools)
{
gFloaterTools->setStatusText("camera");
+ // in case we start from tools floater, we count any selection as valid
+ mValidSelection = gFloaterTools->getVisible();
}
}
@@ -98,6 +102,14 @@ void LLToolCamera::handleSelect()
void LLToolCamera::handleDeselect()
{
// gAgent.setLookingAtAvatar(FALSE);
+
+ // Make sure that temporary selection won't pass anywhere except pie tool.
+ MASK override_mask = gKeyboard ? gKeyboard->currentMask(TRUE) : 0;
+ if (!mValidSelection && (override_mask != MASK_NONE || (gFloaterTools && gFloaterTools->getVisible())))
+ {
+ LLMenuGL::sMenuContainer->hideMenus();
+ LLSelectMgr::getInstance()->validateSelection();
+ }
}
BOOL LLToolCamera::handleMouseDown(S32 x, S32 y, MASK mask)
@@ -334,7 +346,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
{
if (!mValidClickPoint)
{
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolFocus [invalid point]" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolFocus [invalid point]" << LL_ENDL;
gViewerWindow->setCursor(UI_CURSOR_NO);
gViewerWindow->showCursor();
return TRUE;
@@ -361,7 +373,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
gViewerWindow->moveCursorToCenter();
}
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolFocus [active]" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolFocus [active]" << LL_ENDL;
}
else if ( gCameraBtnPan ||
mask == MASK_PAN ||
@@ -389,7 +401,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
gViewerWindow->moveCursorToCenter();
}
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPan" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolPan" << LL_ENDL;
}
else if (gCameraBtnZoom)
{
@@ -421,7 +433,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
gViewerWindow->moveCursorToCenter();
}
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolZoom" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolZoom" << LL_ENDL;
}
}
diff --git a/indra/newview/lltoolfocus.h b/indra/newview/lltoolfocus.h
index b1ac42e33f..d23eb2cce6 100755
--- a/indra/newview/lltoolfocus.h
+++ b/indra/newview/lltoolfocus.h
@@ -65,6 +65,7 @@ protected:
BOOL mOutsideSlopX;
BOOL mOutsideSlopY;
BOOL mValidClickPoint;
+ BOOL mValidSelection;
BOOL mMouseSteering;
S32 mMouseUpX; // needed for releaseMouse()
S32 mMouseUpY;
diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp
index 9907da0f0e..fa6694b93b 100755
--- a/indra/newview/lltoolgrab.cpp
+++ b/indra/newview/lltoolgrab.cpp
@@ -56,6 +56,7 @@
#include "llviewerregion.h"
#include "llvoavatarself.h"
#include "llworld.h"
+#include "llmenugl.h"
const S32 SLOP_DIST_SQ = 4;
@@ -83,6 +84,7 @@ LLToolGrab::LLToolGrab( LLToolComposite* composite )
mLastFace(0),
mSpinGrabbing( FALSE ),
mSpinRotation(),
+ mClickedInMouselook( FALSE ),
mHideBuildHighlight(FALSE)
{ }
@@ -97,6 +99,8 @@ void LLToolGrab::handleSelect()
{
// viewer can crash during startup if we don't check.
gFloaterTools->setStatusText("grab");
+ // in case we start from tools floater, we count any selection as valid
+ mValidSelection = gFloaterTools->getVisible();
}
gGrabBtnVertical = FALSE;
gGrabBtnSpin = FALSE;
@@ -109,13 +113,21 @@ void LLToolGrab::handleDeselect()
setMouseCapture( FALSE );
}
+ // Make sure that temporary(invalid) selection won't pass anywhere except pie tool.
+ MASK override_mask = gKeyboard ? gKeyboard->currentMask(TRUE) : 0;
+ if (!mValidSelection && (override_mask != MASK_NONE || (gFloaterTools && gFloaterTools->getVisible())))
+ {
+ LLMenuGL::sMenuContainer->hideMenus();
+ LLSelectMgr::getInstance()->validateSelection();
+ }
+
}
BOOL LLToolGrab::handleDoubleClick(S32 x, S32 y, MASK mask)
{
if (gDebugClicks)
{
- llinfos << "LLToolGrab handleDoubleClick (becoming mouseDown)" << llendl;
+ LL_INFOS() << "LLToolGrab handleDoubleClick (becoming mouseDown)" << LL_ENDL;
}
return FALSE;
@@ -125,7 +137,7 @@ BOOL LLToolGrab::handleMouseDown(S32 x, S32 y, MASK mask)
{
if (gDebugClicks)
{
- llinfos << "LLToolGrab handleMouseDown" << llendl;
+ LL_INFOS() << "LLToolGrab handleMouseDown" << LL_ENDL;
}
// call the base class to propogate info to sim
@@ -136,6 +148,7 @@ BOOL LLToolGrab::handleMouseDown(S32 x, S32 y, MASK mask)
// can grab transparent objects (how touch event propagates, scripters rely on this)
gViewerWindow->pickAsync(x, y, mask, pickCallback, TRUE);
}
+ mClickedInMouselook = gAgentCamera.cameraMouselook();
return TRUE;
}
@@ -176,12 +189,12 @@ BOOL LLToolGrab::handleObjectHit(const LLPickInfo& info)
if (gDebugClicks)
{
- llinfos << "LLToolGrab handleObjectHit " << info.mMousePt.mX << "," << info.mMousePt.mY << llendl;
+ LL_INFOS() << "LLToolGrab handleObjectHit " << info.mMousePt.mX << "," << info.mMousePt.mY << LL_ENDL;
}
if (NULL == objectp) // unexpected
{
- llwarns << "objectp was NULL; returning FALSE" << llendl;
+ LL_WARNS() << "objectp was NULL; returning FALSE" << LL_ENDL;
return FALSE;
}
@@ -707,7 +720,7 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask)
// HACK to avoid assert: error checking system makes sure that the cursor is set during every handleHover. This is actually a no-op since the cursor is hidden.
gViewerWindow->setCursor(UI_CURSOR_ARROW);
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolGrab (active) [cursor hidden]" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolGrab (active) [cursor hidden]" << LL_ENDL;
}
@@ -871,7 +884,7 @@ void LLToolGrab::handleHoverNonPhysical(S32 x, S32 y, MASK mask)
void LLToolGrab::handleHoverInactive(S32 x, S32 y, MASK mask)
{
// JC - TODO - change cursor based on gGrabBtnVertical, gGrabBtnSpin
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolGrab (inactive-not over editable object)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolGrab (inactive-not over editable object)" << LL_ENDL;
gViewerWindow->setCursor(UI_CURSOR_TOOLGRAB);
}
@@ -881,7 +894,7 @@ void LLToolGrab::handleHoverFailed(S32 x, S32 y, MASK mask)
if( GRAB_NOOBJECT == mMode )
{
gViewerWindow->setCursor(UI_CURSOR_NO);
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolGrab (not on object)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolGrab (not on object)" << LL_ENDL;
}
else
{
@@ -894,13 +907,13 @@ void LLToolGrab::handleHoverFailed(S32 x, S32 y, MASK mask)
{
case GRAB_LOCKED:
gViewerWindow->setCursor(UI_CURSOR_GRABLOCKED);
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolGrab (grab failed, no move permission)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolGrab (grab failed, no move permission)" << LL_ENDL;
break;
// Non physical now handled by handleHoverActive - CRO
// case GRAB_NONPHYSICAL:
// gViewerWindow->setCursor(UI_CURSOR_ARROW);
-// lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolGrab (grab failed, nonphysical)" << llendl;
+// LL_DEBUGS("UserInput") << "hover handled by LLToolGrab (grab failed, nonphysical)" << LL_ENDL;
// break;
default:
llassert(0);
@@ -909,7 +922,7 @@ void LLToolGrab::handleHoverFailed(S32 x, S32 y, MASK mask)
else
{
gViewerWindow->setCursor(UI_CURSOR_ARROW);
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolGrab (grab failed but within slop)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolGrab (grab failed but within slop)" << LL_ENDL;
}
}
}
@@ -926,13 +939,21 @@ BOOL LLToolGrab::handleMouseUp(S32 x, S32 y, MASK mask)
{
setMouseCapture( FALSE );
}
+
mMode = GRAB_INACTIVE;
- // HACK: Make some grabs temporary
- if (gGrabTransientTool)
+ if(mClickedInMouselook && !gAgentCamera.cameraMouselook())
{
- gBasicToolset->selectTool( gGrabTransientTool );
- gGrabTransientTool = NULL;
+ mClickedInMouselook = FALSE;
+ }
+ else
+ {
+ // HACK: Make some grabs temporary
+ if (gGrabTransientTool)
+ {
+ gBasicToolset->selectTool( gGrabTransientTool );
+ gGrabTransientTool = NULL;
+ }
}
//gAgent.setObjectTracking(gSavedSettings.getBOOL("TrackFocusObject"));
@@ -1108,16 +1129,16 @@ void send_ObjectGrab_message(LLViewerObject* object, const LLPickInfo & pick, co
msg->sendMessage( object->getRegion()->getHost());
/* Diagnostic code
- llinfos << "mUVCoords: " << pick.mUVCoords
+ LL_INFOS() << "mUVCoords: " << pick.mUVCoords
<< ", mSTCoords: " << pick.mSTCoords
<< ", mObjectFace: " << pick.mObjectFace
<< ", mIntersection: " << pick.mIntersection
<< ", mNormal: " << pick.mNormal
<< ", mBinormal: " << pick.mBinormal
- << llendl;
+ << LL_ENDL;
- llinfos << "Avatar pos: " << gAgent.getPositionAgent() << llendl;
- llinfos << "Object pos: " << object->getPosition() << llendl;
+ LL_INFOS() << "Avatar pos: " << gAgent.getPositionAgent() << LL_ENDL;
+ LL_INFOS() << "Object pos: " << object->getPosition() << LL_ENDL;
*/
}
diff --git a/indra/newview/lltoolgrab.h b/indra/newview/lltoolgrab.h
index 06a3b662c8..4e22732124 100755
--- a/indra/newview/lltoolgrab.h
+++ b/indra/newview/lltoolgrab.h
@@ -119,6 +119,7 @@ private:
BOOL mHasMoved; // has mouse moved off center at all?
BOOL mOutsideSlop; // has mouse moved outside center 5 pixels?
BOOL mDeselectedThisClick;
+ BOOL mValidSelection;
S32 mLastFace;
LLVector2 mLastUVCoords;
@@ -133,6 +134,8 @@ private:
LLQuaternion mSpinRotation;
BOOL mHideBuildHighlight;
+
+ BOOL mClickedInMouselook;
};
extern BOOL gGrabBtnVertical;
diff --git a/indra/newview/lltoolgun.cpp b/indra/newview/lltoolgun.cpp
index c1735adc9c..6c9155be85 100755
--- a/indra/newview/lltoolgun.cpp
+++ b/indra/newview/lltoolgun.cpp
@@ -116,11 +116,11 @@ BOOL LLToolGun::handleHover(S32 x, S32 y, MASK mask)
gViewerWindow->hideCursor();
}
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolGun (mouselook)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolGun (mouselook)" << LL_ENDL;
}
else
{
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolGun (not mouselook)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolGun (not mouselook)" << LL_ENDL;
}
// HACK to avoid assert: error checking system makes sure that the cursor is set during every handleHover. This is actually a no-op since the cursor is hidden.
diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp
index a135ba70f5..175227173f 100755
--- a/indra/newview/lltoolmgr.cpp
+++ b/indra/newview/lltoolmgr.cpp
@@ -34,6 +34,7 @@
//#include "llfirstuse.h"
// tools and manipulators
+#include "llfloaterinspect.h"
#include "lltool.h"
#include "llmanipscale.h"
#include "llselectmgr.h"
@@ -218,7 +219,20 @@ LLTool* LLToolMgr::getCurrentTool()
}
if (cur_tool)
{
- cur_tool->handleSelect();
+ if ( LLToolCompInspect::getInstance()->isToolCameraActive()
+ && prev_tool == LLToolCamera::getInstance()
+ && cur_tool == LLToolPie::getInstance() )
+ {
+ LLFloaterInspect * inspect_instance = LLFloaterReg::getTypedInstance<LLFloaterInspect>("inspect");
+ if(inspect_instance && inspect_instance->getVisible())
+ {
+ setTransientTool(LLToolCompInspect::getInstance());
+ }
+ }
+ else
+ {
+ cur_tool->handleSelect();
+ }
}
}
@@ -357,7 +371,7 @@ void LLToolMgr::clearTransientTool()
mTransientTool = NULL;
if (!mBaseTool)
{
- llwarns << "mBaseTool is NULL" << llendl;
+ LL_WARNS() << "mBaseTool is NULL" << LL_ENDL;
}
}
updateToolStatus();
diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp
index 148e5a015b..2d458db36b 100755
--- a/indra/newview/lltoolmorph.cpp
+++ b/indra/newview/lltoolmorph.cpp
@@ -54,6 +54,7 @@
#include "llviewercamera.h"
#include "llviewertexturelist.h"
#include "llviewerobject.h"
+#include "llviewerwearable.h"
#include "llviewerwindow.h"
#include "llvoavatarself.h"
#include "pipeline.h"
@@ -147,13 +148,20 @@ BOOL LLVisualParamHint::needsRender()
void LLVisualParamHint::preRender(BOOL clear_depth)
{
+ LLViewerWearable* wearable = (LLViewerWearable*)mWearablePtr;
+ if (wearable)
+ {
+ wearable->setVolatile(TRUE);
+ }
mLastParamWeight = mVisualParam->getWeight();
- mWearablePtr->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight, FALSE);
- gAgentAvatarp->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight, FALSE);
+ mWearablePtr->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight);
+ gAgentAvatarp->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight);
gAgentAvatarp->setVisualParamWeight("Blink_Left", 0.f);
gAgentAvatarp->setVisualParamWeight("Blink_Right", 0.f);
gAgentAvatarp->updateComposites();
- gAgentAvatarp->updateVisualParams();
+ // Calling LLCharacter version, as we don't want position/height changes to cause the avatar to jump
+ // up and down when we're doing preview renders. -Nyx
+ gAgentAvatarp->LLCharacter::updateVisualParams();
gAgentAvatarp->updateGeometry(gAgentAvatarp->mDrawable);
gAgentAvatarp->updateLOD();
@@ -238,7 +246,13 @@ BOOL LLVisualParamHint::render()
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
}
gAgentAvatarp->setVisualParamWeight(mVisualParam->getID(), mLastParamWeight);
- mWearablePtr->setVisualParamWeight(mVisualParam->getID(), mLastParamWeight, FALSE);
+ mWearablePtr->setVisualParamWeight(mVisualParam->getID(), mLastParamWeight);
+ LLViewerWearable* wearable = (LLViewerWearable*)mWearablePtr;
+ if (wearable)
+ {
+ wearable->setVolatile(FALSE);
+ }
+
gAgentAvatarp->updateVisualParams();
gGL.color4f(1,1,1,1);
mGLTexturep->setGLTextureCreated(true);
diff --git a/indra/newview/lltoolobjpicker.cpp b/indra/newview/lltoolobjpicker.cpp
index b65c4c1ec8..0d9fe9e577 100755
--- a/indra/newview/lltoolobjpicker.cpp
+++ b/indra/newview/lltoolobjpicker.cpp
@@ -76,7 +76,7 @@ BOOL LLToolObjPicker::handleMouseDown(S32 x, S32 y, MASK mask)
}
else
{
- llwarns << "PickerTool doesn't have mouse capture on mouseDown" << llendl;
+ LL_WARNS() << "PickerTool doesn't have mouse capture on mouseDown" << LL_ENDL;
}
}
@@ -109,7 +109,7 @@ BOOL LLToolObjPicker::handleMouseUp(S32 x, S32 y, MASK mask)
}
else
{
- llwarns << "PickerTool doesn't have mouse capture on mouseUp" << llendl;
+ LL_WARNS() << "PickerTool doesn't have mouse capture on mouseUp" << LL_ENDL;
}
return handled;
}
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index 1c362c18e0..e4353aafaa 100755
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -42,6 +42,7 @@
#include "llfloaterscriptdebug.h"
#include "lltooltip.h"
#include "llhudeffecttrail.h"
+#include "llhudicon.h"
#include "llhudmanager.h"
#include "llkeyboard.h"
#include "llmediaentry.h"
@@ -438,8 +439,12 @@ ECursorType LLToolPie::cursorFromObject(LLViewerObject* object)
break;
case CLICK_ACTION_BUY:
if ( mClickActionBuyEnabled )
- {
- cursor = UI_CURSOR_TOOLBUY;
+ {
+ LLSelectNode* node = LLSelectMgr::getInstance()->getHoverNode();
+ if (!node || node->mSaleInfo.isForSale())
+ {
+ cursor = UI_CURSOR_TOOLBUY;
+ }
}
break;
case CLICK_ACTION_OPEN:
@@ -543,6 +548,7 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
mHoverPick = gViewerWindow->pickImmediate(x, y, FALSE);
LLViewerObject *parent = NULL;
LLViewerObject *object = mHoverPick.getObject();
+ LLSelectMgr::getInstance()->setHoverObject(object, mHoverPick.mObjectFace);
if (object)
{
parent = object->getRootEdit();
@@ -557,7 +563,7 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
// could disable it here.
show_highlight = true;
// cursor set by media object
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolPie (inactive)" << LL_ENDL;
}
else if (!mMouseOutsideSlop
&& mMouseButtonDown
@@ -594,7 +600,7 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
show_highlight = true;
ECursorType cursor = cursorFromObject(click_action_object);
gViewerWindow->setCursor(cursor);
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolPie (inactive)" << LL_ENDL;
}
else if ((object && !object->isAvatar() && object->flagUsePhysics())
@@ -602,19 +608,19 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
{
show_highlight = true;
gViewerWindow->setCursor(UI_CURSOR_TOOLGRAB);
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolPie (inactive)" << LL_ENDL;
}
else if ( (object && object->flagHandleTouch())
|| (parent && parent->flagHandleTouch()))
{
show_highlight = true;
gViewerWindow->setCursor(UI_CURSOR_HAND);
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolPie (inactive)" << LL_ENDL;
}
else
{
gViewerWindow->setCursor(UI_CURSOR_ARROW);
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolPie (inactive)" << LL_ENDL;
}
}
@@ -706,7 +712,7 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask)
{
if (gDebugClicks)
{
- llinfos << "LLToolPie handleDoubleClick (becoming mouseDown)" << llendl;
+ LL_INFOS() << "LLToolPie handleDoubleClick (becoming mouseDown)" << LL_ENDL;
}
if (gSavedSettings.getBOOL("DoubleClickAutoPilot"))
@@ -1305,7 +1311,16 @@ void LLToolPie::handleDeselect()
}
// remove temporary selection for pie menu
LLSelectMgr::getInstance()->setHoverObject(NULL);
- LLSelectMgr::getInstance()->validateSelection();
+
+ // Menu may be still up during transfer to different tool.
+ // toolfocus and toolgrab should retain menu, they will clear it if needed
+ MASK override_mask = gKeyboard ? gKeyboard->currentMask(TRUE) : 0;
+ if (gMenuHolder && (!gMenuHolder->getVisible() || (override_mask & (MASK_ALT | MASK_CONTROL)) == 0))
+ {
+ // in most cases menu is useless without correct selection, so either keep both or discard both
+ gMenuHolder->hideMenus();
+ LLSelectMgr::getInstance()->validateSelection();
+ }
}
LLTool* LLToolPie::getOverrideTool(MASK mask)
@@ -1671,17 +1686,7 @@ BOOL LLToolPie::handleRightClickPick()
{
name = node->mName;
}
- std::string mute_msg;
- if (LLMuteList::getInstance()->isMuted(object->getID(), name))
- {
- mute_msg = LLTrans::getString("UnmuteObject");
- }
- else
- {
- mute_msg = LLTrans::getString("MuteObject2");
- }
-
- gMenuHolder->getChild<LLUICtrl>("Object Mute")->setValue(mute_msg);
+
gMenuObject->show(x, y);
showVisualContextMenuEffect();
@@ -1695,6 +1700,12 @@ BOOL LLToolPie::handleRightClickPick()
}
}
+ // non UI object - put focus back "in world"
+ if (gFocusMgr.getKeyboardFocus())
+ {
+ gFocusMgr.setKeyboardFocus(NULL);
+ }
+
LLTool::handleRightMouseDown(x, y, mask);
// We handled the event.
return TRUE;
diff --git a/indra/newview/lltoolplacer.cpp b/indra/newview/lltoolplacer.cpp
index 641fbc5042..ceb57d0172 100755
--- a/indra/newview/lltoolplacer.cpp
+++ b/indra/newview/lltoolplacer.cpp
@@ -127,7 +127,7 @@ BOOL LLToolPlacer::raycastForNewObjPos( S32 x, S32 y, LLViewerObject** hit_obj,
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(surface_pos_global);
if (!regionp)
{
- llwarns << "Trying to add object outside of all known regions!" << llendl;
+ LL_WARNS() << "Trying to add object outside of all known regions!" << LL_ENDL;
return FALSE;
}
@@ -178,7 +178,7 @@ BOOL LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics )
if (NULL == regionp)
{
- llwarns << "regionp was NULL; aborting function." << llendl;
+ LL_WARNS() << "regionp was NULL; aborting function." << LL_ENDL;
return FALSE;
}
@@ -433,7 +433,7 @@ BOOL LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics )
effectp->setDuration(LL_HUD_DUR_SHORT);
effectp->setColor(LLColor4U(gAgent.getEffectColor()));
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_CREATE_COUNT);
+ add(LLStatViewer::OBJECT_CREATE, 1);
return TRUE;
}
@@ -518,7 +518,7 @@ BOOL LLToolPlacer::placeObject(S32 x, S32 y, MASK mask)
BOOL LLToolPlacer::handleHover(S32 x, S32 y, MASK mask)
{
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPlacer" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolPlacer" << LL_ENDL;
gViewerWindow->setCursor(UI_CURSOR_TOOLCREATE);
return TRUE;
}
diff --git a/indra/newview/lltoolselect.cpp b/indra/newview/lltoolselect.cpp
index 7c604a04bf..812abe9dbd 100755
--- a/indra/newview/lltoolselect.cpp
+++ b/indra/newview/lltoolselect.cpp
@@ -32,9 +32,11 @@
#include "llagentcamera.h"
#include "llviewercontrol.h"
#include "lldrawable.h"
+#include "llhudicon.h"
#include "llmanip.h"
#include "llmenugl.h"
#include "llselectmgr.h"
+#include "llviewermediafocus.h"
#include "lltoolmgr.h"
#include "llfloaterscriptdebug.h"
#include "llviewercamera.h"
@@ -109,6 +111,21 @@ LLObjectSelectionHandle LLToolSelect::handleObjectSelection(const LLPickInfo& pi
{
BOOL already_selected = object->isSelected();
+ if (already_selected &&
+ object->getNumTEs() > 0 &&
+ !LLSelectMgr::getInstance()->getSelection()->contains(object,SELECT_ALL_TES))
+ {
+ const LLTextureEntry* tep = object->getTE(pick.mObjectFace);
+ if (tep && !tep->isSelected() && !LLViewerMediaFocus::getInstance()->getFocusedObjectID().isNull())
+ {
+ // we were interacting with media and clicked on non selected face, drop media focus
+ LLViewerMediaFocus::getInstance()->clearFocus();
+ // selection was removed and zoom preserved by clearFocus(), continue with regular selection
+ already_selected = false;
+ extend_select = true;
+ }
+ }
+
if ( extend_select )
{
if ( already_selected )
diff --git a/indra/newview/lltoolselectland.cpp b/indra/newview/lltoolselectland.cpp
index a48388c591..44c0cb3124 100755
--- a/indra/newview/lltoolselectland.cpp
+++ b/indra/newview/lltoolselectland.cpp
@@ -168,13 +168,13 @@ BOOL LLToolSelectLand::handleHover(S32 x, S32 y, MASK mask)
roundXY(mWestSouthBottom);
roundXY(mEastNorthTop);
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolSelectLand (active, land)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolSelectLand (active, land)" << LL_ENDL;
gViewerWindow->setCursor(UI_CURSOR_ARROW);
}
else
{
mDragEndValid = FALSE;
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolSelectLand (active, no land)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolSelectLand (active, no land)" << LL_ENDL;
gViewerWindow->setCursor(UI_CURSOR_NO);
}
@@ -183,13 +183,13 @@ BOOL LLToolSelectLand::handleHover(S32 x, S32 y, MASK mask)
}
else
{
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolSelectLand (active, in slop)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolSelectLand (active, in slop)" << LL_ENDL;
gViewerWindow->setCursor(UI_CURSOR_ARROW);
}
}
else
{
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolSelectLand (inactive)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolSelectLand (inactive)" << LL_ENDL;
gViewerWindow->setCursor(UI_CURSOR_ARROW);
}
diff --git a/indra/newview/lltoolselectrect.cpp b/indra/newview/lltoolselectrect.cpp
index a3f4e5a18c..c5616fb208 100755
--- a/indra/newview/lltoolselectrect.cpp
+++ b/indra/newview/lltoolselectrect.cpp
@@ -32,7 +32,6 @@
// Library includes
#include "llgl.h"
#include "llrender.h"
-#include "lldarray.h"
// Viewer includes
#include "llviewercontrol.h"
@@ -145,11 +144,11 @@ BOOL LLToolSelectRect::handleHover(S32 x, S32 y, MASK mask)
return LLToolSelect::handleHover(x, y, mask);
}
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolSelectRect (active)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolSelectRect (active)" << LL_ENDL;
}
else
{
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolSelectRect (inactive)" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolSelectRect (inactive)" << LL_ENDL;
}
gViewerWindow->setCursor(UI_CURSOR_ARROW);
diff --git a/indra/newview/lltoolview.cpp b/indra/newview/lltoolview.cpp
index 8c40ff3cb3..678e2c241a 100755
--- a/indra/newview/lltoolview.cpp
+++ b/indra/newview/lltoolview.cpp
@@ -179,7 +179,7 @@ LLToolContainer* LLToolView::findToolContainer( LLTool *tool )
return contain;
}
}
- llerrs << "LLToolView::findToolContainer - tool not found" << llendl;
+ LL_ERRS() << "LLToolView::findToolContainer - tool not found" << LL_ENDL;
return NULL;
}
diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp
index 73ceb783b5..f611d0503f 100755
--- a/indra/newview/lltracker.cpp
+++ b/indra/newview/lltracker.cpp
@@ -28,7 +28,6 @@
// library includes
#include "llcoord.h"
-#include "lldarray.h"
#include "llfontgl.h"
#include "llgl.h"
#include "llrender.h"
@@ -427,9 +426,9 @@ F32 pulse_func(F32 t, F32 z, bool tracking_avatar, std::string direction)
}
else
{
- z -= t*64.f - 256.f;
+ z -= t*64.f - 256.f;
}
-
+
F32 a = cosf(z*F_PI/512.f)*10.0f;
a = llmax(a, 9.9f);
a -= 9.9f;
@@ -502,54 +501,54 @@ void LLTracker::drawBeacon(LLVector3 pos_agent, std::string direction, LLColor4
step = pos_agent.mV[2] / BEACON_VERTS;
}
- gGL.color4fv(fogged_color.mV);
-
- LLVector3 x_axis = LLViewerCamera::getInstance()->getLeftAxis();
- F32 t = gRenderStartTime.getElapsedTimeF32();
-
- for (U32 i = 0; i < BEACON_VERTS; i++)
- {
- F32 x = x_axis.mV[0];
- F32 y = x_axis.mV[1];
+ gGL.color4fv(fogged_color.mV);
+
+ LLVector3 x_axis = LLViewerCamera::getInstance()->getLeftAxis();
+ F32 t = gRenderStartTime.getElapsedTimeF32();
+
+ for (U32 i = 0; i < BEACON_VERTS; i++)
+ {
+ F32 x = x_axis.mV[0];
+ F32 y = x_axis.mV[1];
- F32 z = i * step;
- F32 z_next = (i+1)*step;
-
+ F32 z = i * step;
+ F32 z_next = (i+1)*step;
+
bool tracking_avatar = getTrackingStatus() == TRACKING_AVATAR;
F32 a = pulse_func(t, z, tracking_avatar, direction);
F32 an = pulse_func(t, z_next, tracking_avatar, direction);
-
- LLColor4 c_col = fogged_color + LLColor4(a,a,a,a);
- LLColor4 col_next = fogged_color + LLColor4(an,an,an,an);
- LLColor4 col_edge = fogged_color * LLColor4(a,a,a,0.0f);
- LLColor4 col_edge_next = fogged_color * LLColor4(an,an,an,0.0f);
-
- a *= 2.f;
+
+ LLColor4 c_col = fogged_color + LLColor4(a,a,a,a);
+ LLColor4 col_next = fogged_color + LLColor4(an,an,an,an);
+ LLColor4 col_edge = fogged_color * LLColor4(a,a,a,0.0f);
+ LLColor4 col_edge_next = fogged_color * LLColor4(an,an,an,0.0f);
+
+ a *= 2.f;
a += 1.0f;
-
- an *= 2.f;
+
+ an *= 2.f;
an += 1.0f;
-
- gGL.begin(LLRender::TRIANGLE_STRIP);
- gGL.color4fv(col_edge.mV);
- gGL.vertex3f(-x*a, -y*a, z);
- gGL.color4fv(col_edge_next.mV);
- gGL.vertex3f(-x*an, -y*an, z_next);
-
- gGL.color4fv(c_col.mV);
- gGL.vertex3f(0, 0, z);
- gGL.color4fv(col_next.mV);
- gGL.vertex3f(0, 0, z_next);
-
- gGL.color4fv(col_edge.mV);
- gGL.vertex3f(x*a,y*a,z);
- gGL.color4fv(col_edge_next.mV);
- gGL.vertex3f(x*an,y*an,z_next);
+
+ gGL.begin(LLRender::TRIANGLE_STRIP);
+ gGL.color4fv(col_edge.mV);
+ gGL.vertex3f(-x*a, -y*a, z);
+ gGL.color4fv(col_edge_next.mV);
+ gGL.vertex3f(-x*an, -y*an, z_next);
+
+ gGL.color4fv(c_col.mV);
+ gGL.vertex3f(0, 0, z);
+ gGL.color4fv(col_next.mV);
+ gGL.vertex3f(0, 0, z_next);
+
+ gGL.color4fv(col_edge.mV);
+ gGL.vertex3f(x*a,y*a,z);
+ gGL.color4fv(col_edge_next.mV);
+ gGL.vertex3f(x*an,y*an,z_next);
gGL.end();
}
gGL.popMatrix();
}
-
+
// static
void LLTracker::renderBeacon(LLVector3d pos_global,
const LLColor4& color,
@@ -566,7 +565,7 @@ void LLTracker::renderBeacon(LLVector3d pos_global,
{
color_frac = 0.4f;
// pos_global = gAgentCamera.getCameraPositionGlobal() + 0.99f*(LLViewerCamera::getInstance()->getFar()/dist)*to_vec;
- }
+ }
else
{
color_frac = 1.f - 0.6f*(dist/LLViewerCamera::getInstance()->getFar());
@@ -805,7 +804,7 @@ void LLTracker::cacheLandmarkPosition()
}
else
{
- llwarns << "LLTracker couldn't find home pos" << llendl;
+ LL_WARNS() << "LLTracker couldn't find home pos" << LL_ENDL;
mTrackedLandmarkAssetID.setNull();
mTrackedLandmarkItemID.setNull();
}
diff --git a/indra/newview/lltracker.h b/indra/newview/lltracker.h
index d8d5803787..218f3430a6 100755
--- a/indra/newview/lltracker.h
+++ b/indra/newview/lltracker.h
@@ -33,7 +33,6 @@
#ifndef LL_LLTRACKER_H
#define LL_LLTRACKER_H
-#include "lldarray.h"
#include "llpointer.h"
#include "llstring.h"
#include "lluuid.h"
@@ -140,8 +139,8 @@ protected:
std::string mTrackedLandmarkName;
LLUUID mTrackedLandmarkAssetID;
LLUUID mTrackedLandmarkItemID;
- LLDynamicArray<LLUUID> mLandmarkAssetIDList;
- LLDynamicArray<LLUUID> mLandmarkItemIDList;
+ std::vector<LLUUID> mLandmarkAssetIDList;
+ std::vector<LLUUID> mLandmarkItemIDList;
BOOL mHasReachedLandmark;
BOOL mHasLandmarkPosition;
BOOL mLandmarkHasBeenVisited;
diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp
index f3d8de1904..c0ba0a1f39 100755
--- a/indra/newview/lltranslate.cpp
+++ b/indra/newview/lltranslate.cpp
@@ -84,7 +84,7 @@ bool LLGoogleTranslationHandler::parseResponse(
return false;
}
- if (status != STATUS_OK)
+ if (status != HTTP_OK)
{
// Request failed. Extract error message from the response.
parseErrorResponse(root, status, err_msg);
@@ -186,7 +186,7 @@ bool LLBingTranslationHandler::parseResponse(
std::string& detected_lang,
std::string& err_msg) const
{
- if (status != STATUS_OK)
+ if (status != HTTP_OK)
{
static const std::string MSG_BEGIN_MARKER = "Message: ";
size_t begin = body.find(MSG_BEGIN_MARKER);
@@ -251,8 +251,6 @@ LLTranslate::TranslationReceiver::TranslationReceiver(const std::string& from_la
// virtual
void LLTranslate::TranslationReceiver::completedRaw(
- U32 http_status,
- const std::string& reason,
const LLChannelDescriptors& channels,
const LLIOPipe::buffer_ptr_t& buffer)
{
@@ -262,8 +260,8 @@ void LLTranslate::TranslationReceiver::completedRaw(
const std::string body = strstrm.str();
std::string translation, detected_lang, err_msg;
- int status = http_status;
- LL_DEBUGS("Translate") << "HTTP status: " << status << " " << reason << LL_ENDL;
+ int status = getStatus();
+ LL_DEBUGS("Translate") << "HTTP status: " << status << " " << getReason() << LL_ENDL;
LL_DEBUGS("Translate") << "Response body: " << body << LL_ENDL;
if (mHandler.parseResponse(status, body, translation, detected_lang, err_msg))
{
@@ -284,7 +282,7 @@ void LLTranslate::TranslationReceiver::completedRaw(
err_msg = LLTrans::getString("TranslationResponseParseError");
}
- llwarns << "Translation request failed: " << err_msg << llendl;
+ LL_WARNS() << "Translation request failed: " << err_msg << LL_ENDL;
handleFailure(status, err_msg);
}
}
@@ -301,12 +299,10 @@ LLTranslate::EService LLTranslate::KeyVerificationReceiver::getService() const
// virtual
void LLTranslate::KeyVerificationReceiver::completedRaw(
- U32 http_status,
- const std::string& reason,
const LLChannelDescriptors& channels,
const LLIOPipe::buffer_ptr_t& buffer)
{
- bool ok = (http_status == 200);
+ bool ok = (getStatus() == HTTP_OK);
setVerificationStatus(ok);
}
@@ -398,8 +394,8 @@ void LLTranslate::sendRequest(const std::string& url, LLHTTPClient::ResponderPtr
LLVersionInfo::getPatch(),
LLVersionInfo::getBuild());
- sHeader.insert("Accept", "text/plain");
- sHeader.insert("User-Agent", user_agent);
+ sHeader.insert(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_TEXT_PLAIN);
+ sHeader.insert(HTTP_OUT_HEADER_USER_AGENT, user_agent);
}
LLHTTPClient::get(url, responder, sHeader, REQUEST_TIMEOUT);
diff --git a/indra/newview/lltranslate.h b/indra/newview/lltranslate.h
index db5ad9479c..972274714a 100755
--- a/indra/newview/lltranslate.h
+++ b/indra/newview/lltranslate.h
@@ -95,9 +95,6 @@ public:
virtual bool isConfigured() const = 0;
virtual ~LLTranslationAPIHandler() {}
-
-protected:
- static const int STATUS_OK = 200;
};
/// Google Translate v2 API handler.
@@ -201,8 +198,6 @@ public :
* @see mHandler
*/
/*virtual*/ void completedRaw(
- U32 http_status,
- const std::string& reason,
const LLChannelDescriptors& channels,
const LLIOPipe::buffer_ptr_t& buffer);
@@ -250,8 +245,6 @@ public :
* @see setVerificationStatus()
*/
/*virtual*/ void completedRaw(
- U32 http_status,
- const std::string& reason,
const LLChannelDescriptors& channels,
const LLIOPipe::buffer_ptr_t& buffer);
diff --git a/indra/newview/lltwitterconnect.cpp b/indra/newview/lltwitterconnect.cpp
new file mode 100644
index 0000000000..7088558b83
--- /dev/null
+++ b/indra/newview/lltwitterconnect.cpp
@@ -0,0 +1,503 @@
+/**
+ * @file lltwitterconnect.h
+ * @author Merov, Cho
+ * @brief Connection to Twitter Service
+ *
+ * $LicenseInfo:firstyear=2013&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2013, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "lltwitterconnect.h"
+
+#include "llagent.h"
+#include "llcallingcard.h" // for LLAvatarTracker
+#include "llcommandhandler.h"
+#include "llhttpclient.h"
+#include "llnotificationsutil.h"
+#include "llurlaction.h"
+#include "llimagepng.h"
+#include "llimagejpeg.h"
+#include "lltrans.h"
+#include "llevents.h"
+#include "llviewerregion.h"
+
+#include "llfloaterwebcontent.h"
+#include "llfloaterreg.h"
+
+boost::scoped_ptr<LLEventPump> LLTwitterConnect::sStateWatcher(new LLEventStream("TwitterConnectState"));
+boost::scoped_ptr<LLEventPump> LLTwitterConnect::sInfoWatcher(new LLEventStream("TwitterConnectInfo"));
+boost::scoped_ptr<LLEventPump> LLTwitterConnect::sContentWatcher(new LLEventStream("TwitterConnectContent"));
+
+// Local functions
+void log_twitter_connect_error(const std::string& request, U32 status, const std::string& reason, const std::string& code, const std::string& description)
+{
+ // Note: 302 (redirect) is *not* an error that warrants logging
+ if (status != 302)
+ {
+ LL_WARNS("TwitterConnect") << request << " request failed with a " << status << " " << reason << ". Reason: " << code << " (" << description << ")" << LL_ENDL;
+ }
+}
+
+void toast_user_for_twitter_success()
+{
+ LLSD args;
+ args["MESSAGE"] = LLTrans::getString("twitter_post_success");
+ LLNotificationsUtil::add("TwitterConnect", args);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+//
+class LLTwitterConnectResponder : public LLHTTPClient::Responder
+{
+ LOG_CLASS(LLTwitterConnectResponder);
+public:
+
+ LLTwitterConnectResponder()
+ {
+ LLTwitterConnect::instance().setConnectionState(LLTwitterConnect::TWITTER_CONNECTION_IN_PROGRESS);
+ }
+
+ /* virtual */ void httpSuccess()
+ {
+ LL_DEBUGS("TwitterConnect") << "Connect successful. " << dumpResponse() << LL_ENDL;
+ LLTwitterConnect::instance().setConnectionState(LLTwitterConnect::TWITTER_CONNECTED);
+ }
+
+ /* virtual */ void httpFailure()
+ {
+ if ( HTTP_FOUND == getStatus() )
+ {
+ const std::string& location = getResponseHeader(HTTP_IN_HEADER_LOCATION);
+ if (location.empty())
+ {
+ LL_WARNS("TwitterConnect") << "Missing Location header " << dumpResponse()
+ << "[headers:" << getResponseHeaders() << "]" << LL_ENDL;
+ }
+ else
+ {
+ LLTwitterConnect::instance().openTwitterWeb(location);
+ }
+ }
+ else
+ {
+ LL_WARNS("TwitterConnect") << dumpResponse() << LL_ENDL;
+ LLTwitterConnect::instance().setConnectionState(LLTwitterConnect::TWITTER_CONNECTION_FAILED);
+ const LLSD& content = getContent();
+ log_twitter_connect_error("Connect", getStatus(), getReason(),
+ content.get("error_code"), content.get("error_description"));
+ }
+ }
+};
+
+///////////////////////////////////////////////////////////////////////////////
+//
+class LLTwitterShareResponder : public LLHTTPClient::Responder
+{
+ LOG_CLASS(LLTwitterShareResponder);
+public:
+
+ LLTwitterShareResponder()
+ {
+ LLTwitterConnect::instance().setConnectionState(LLTwitterConnect::TWITTER_POSTING);
+ }
+
+ /* virtual */ void httpSuccess()
+ {
+ toast_user_for_twitter_success();
+ LL_DEBUGS("TwitterConnect") << "Post successful. " << dumpResponse() << LL_ENDL;
+ LLTwitterConnect::instance().setConnectionState(LLTwitterConnect::TWITTER_POSTED);
+ }
+
+ /* virtual */ void httpFailure()
+ {
+ if ( HTTP_FOUND == getStatus() )
+ {
+ const std::string& location = getResponseHeader(HTTP_IN_HEADER_LOCATION);
+ if (location.empty())
+ {
+ LL_WARNS("TwitterConnect") << "Missing Location header " << dumpResponse()
+ << "[headers:" << getResponseHeaders() << "]" << LL_ENDL;
+ }
+ else
+ {
+ LLTwitterConnect::instance().openTwitterWeb(location);
+ }
+ }
+ else if ( HTTP_NOT_FOUND == getStatus() )
+ {
+ LLTwitterConnect::instance().connectToTwitter();
+ }
+ else
+ {
+ LL_WARNS("TwitterConnect") << dumpResponse() << LL_ENDL;
+ LLTwitterConnect::instance().setConnectionState(LLTwitterConnect::TWITTER_POST_FAILED);
+ const LLSD& content = getContent();
+ log_twitter_connect_error("Share", getStatus(), getReason(),
+ content.get("error_code"), content.get("error_description"));
+ }
+ }
+};
+
+///////////////////////////////////////////////////////////////////////////////
+//
+class LLTwitterDisconnectResponder : public LLHTTPClient::Responder
+{
+ LOG_CLASS(LLTwitterDisconnectResponder);
+public:
+
+ LLTwitterDisconnectResponder()
+ {
+ LLTwitterConnect::instance().setConnectionState(LLTwitterConnect::TWITTER_DISCONNECTING);
+ }
+
+ void setUserDisconnected()
+ {
+ // Clear data
+ LLTwitterConnect::instance().clearInfo();
+
+ //Notify state change
+ LLTwitterConnect::instance().setConnectionState(LLTwitterConnect::TWITTER_NOT_CONNECTED);
+ }
+
+ /* virtual */ void httpSuccess()
+ {
+ LL_DEBUGS("TwitterConnect") << "Disconnect successful. " << dumpResponse() << LL_ENDL;
+ setUserDisconnected();
+ }
+
+ /* virtual */ void httpFailure()
+ {
+ //User not found so already disconnected
+ if ( HTTP_NOT_FOUND == getStatus() )
+ {
+ LL_DEBUGS("TwitterConnect") << "Already disconnected. " << dumpResponse() << LL_ENDL;
+ setUserDisconnected();
+ }
+ else
+ {
+ LL_WARNS("TwitterConnect") << dumpResponse() << LL_ENDL;
+ LLTwitterConnect::instance().setConnectionState(LLTwitterConnect::TWITTER_DISCONNECT_FAILED);
+ const LLSD& content = getContent();
+ log_twitter_connect_error("Disconnect", getStatus(), getReason(),
+ content.get("error_code"), content.get("error_description"));
+ }
+ }
+};
+
+///////////////////////////////////////////////////////////////////////////////
+//
+class LLTwitterConnectedResponder : public LLHTTPClient::Responder
+{
+ LOG_CLASS(LLTwitterConnectedResponder);
+public:
+
+ LLTwitterConnectedResponder(bool auto_connect) : mAutoConnect(auto_connect)
+ {
+ LLTwitterConnect::instance().setConnectionState(LLTwitterConnect::TWITTER_CONNECTION_IN_PROGRESS);
+ }
+
+ /* virtual */ void httpSuccess()
+ {
+ LL_DEBUGS("TwitterConnect") << "Connect successful. " << dumpResponse() << LL_ENDL;
+ LLTwitterConnect::instance().setConnectionState(LLTwitterConnect::TWITTER_CONNECTED);
+ }
+
+ /* virtual */ void httpFailure()
+ {
+ // show the facebook login page if not connected yet
+ if ( HTTP_NOT_FOUND == getStatus() )
+ {
+ LL_DEBUGS("TwitterConnect") << "Not connected. " << dumpResponse() << LL_ENDL;
+ if (mAutoConnect)
+ {
+ LLTwitterConnect::instance().connectToTwitter();
+ }
+ else
+ {
+ LLTwitterConnect::instance().setConnectionState(LLTwitterConnect::TWITTER_NOT_CONNECTED);
+ }
+ }
+ else
+ {
+ LL_WARNS("TwitterConnect") << dumpResponse() << LL_ENDL;
+ LLTwitterConnect::instance().setConnectionState(LLTwitterConnect::TWITTER_CONNECTION_FAILED);
+ const LLSD& content = getContent();
+ log_twitter_connect_error("Connected", getStatus(), getReason(),
+ content.get("error_code"), content.get("error_description"));
+ }
+ }
+
+private:
+ bool mAutoConnect;
+};
+
+///////////////////////////////////////////////////////////////////////////////
+//
+class LLTwitterInfoResponder : public LLHTTPClient::Responder
+{
+ LOG_CLASS(LLTwitterInfoResponder);
+public:
+
+ /* virtual */ void httpSuccess()
+ {
+ LL_INFOS("TwitterConnect") << "Twitter: Info received" << LL_ENDL;
+ LL_DEBUGS("TwitterConnect") << "Getting Twitter info successful. " << dumpResponse() << LL_ENDL;
+ LLTwitterConnect::instance().storeInfo(getContent());
+ }
+
+ /* virtual */ void httpFailure()
+ {
+ if ( HTTP_FOUND == getStatus() )
+ {
+ const std::string& location = getResponseHeader(HTTP_IN_HEADER_LOCATION);
+ if (location.empty())
+ {
+ LL_WARNS("TwitterConnect") << "Missing Location header " << dumpResponse()
+ << "[headers:" << getResponseHeaders() << "]" << LL_ENDL;
+ }
+ else
+ {
+ LLTwitterConnect::instance().openTwitterWeb(location);
+ }
+ }
+ else
+ {
+ LL_WARNS("TwitterConnect") << dumpResponse() << LL_ENDL;
+ const LLSD& content = getContent();
+ log_twitter_connect_error("Info", getStatus(), getReason(),
+ content.get("error_code"), content.get("error_description"));
+ }
+ }
+};
+
+///////////////////////////////////////////////////////////////////////////////
+//
+LLTwitterConnect::LLTwitterConnect()
+: mConnectionState(TWITTER_NOT_CONNECTED),
+ mConnected(false),
+ mInfo(),
+ mRefreshInfo(false),
+ mReadFromMaster(false)
+{
+}
+
+void LLTwitterConnect::openTwitterWeb(std::string url)
+{
+ // Open the URL in an internal browser window without navigation UI
+ LLFloaterWebContent::Params p;
+ p.url(url);
+ p.show_chrome(true);
+ p.allow_address_entry(false);
+ p.allow_back_forward_navigation(false);
+ p.trusted_content(true);
+ p.clean_browser(true);
+ LLFloater *floater = LLFloaterReg::showInstance("twitter_web", p);
+ //the internal web browser has a bug that prevents it from gaining focus unless a mouse event occurs first (it seems).
+ //So when showing the internal web browser, set focus to it's containing floater "twitter_web". When a mouse event
+ //occurs on the "webbrowser" panel part of the floater, a mouse cursor will properly show and the "webbrowser" will gain focus.
+ //twitter_web floater contains the "webbrowser" panel. JIRA: ACME-744
+ gFocusMgr.setKeyboardFocus( floater );
+
+ //LLUrlAction::openURLExternal(url);
+}
+
+std::string LLTwitterConnect::getTwitterConnectURL(const std::string& route, bool include_read_from_master)
+{
+ std::string url("");
+ LLViewerRegion *regionp = gAgent.getRegion();
+ if (regionp)
+ {
+ //url = "http://pdp15.lindenlab.com/twitter/agent/" + gAgentID.asString(); // TEMPORARY FOR TESTING - CHO
+ url = regionp->getCapability("TwitterConnect");
+ url += route;
+
+ if (include_read_from_master && mReadFromMaster)
+ {
+ url += "?read_from_master=true";
+ }
+ }
+ return url;
+}
+
+void LLTwitterConnect::connectToTwitter(const std::string& request_token, const std::string& oauth_verifier)
+{
+ LLSD body;
+ if (!request_token.empty())
+ body["request_token"] = request_token;
+ if (!oauth_verifier.empty())
+ body["oauth_verifier"] = oauth_verifier;
+
+ LLHTTPClient::put(getTwitterConnectURL("/connection"), body, new LLTwitterConnectResponder());
+}
+
+void LLTwitterConnect::disconnectFromTwitter()
+{
+ LLHTTPClient::del(getTwitterConnectURL("/connection"), new LLTwitterDisconnectResponder());
+}
+
+void LLTwitterConnect::checkConnectionToTwitter(bool auto_connect)
+{
+ const bool follow_redirects = false;
+ const F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
+ LLHTTPClient::get(getTwitterConnectURL("/connection", true), new LLTwitterConnectedResponder(auto_connect),
+ LLSD(), timeout, follow_redirects);
+}
+
+void LLTwitterConnect::loadTwitterInfo()
+{
+ if(mRefreshInfo)
+ {
+ const bool follow_redirects = false;
+ const F32 timeout = HTTP_REQUEST_EXPIRY_SECS;
+ LLHTTPClient::get(getTwitterConnectURL("/info", true), new LLTwitterInfoResponder(),
+ LLSD(), timeout, follow_redirects);
+ }
+}
+
+void LLTwitterConnect::uploadPhoto(const std::string& image_url, const std::string& status)
+{
+ LLSD body;
+ body["image"] = image_url;
+ body["status"] = status;
+
+ // Note: we can use that route for different publish action. We should be able to use the same responder.
+ LLHTTPClient::post(getTwitterConnectURL("/share/photo", true), body, new LLTwitterShareResponder());
+}
+
+void LLTwitterConnect::uploadPhoto(LLPointer<LLImageFormatted> image, const std::string& status)
+{
+ std::string imageFormat;
+ if (dynamic_cast<LLImagePNG*>(image.get()))
+ {
+ imageFormat = "png";
+ }
+ else if (dynamic_cast<LLImageJPEG*>(image.get()))
+ {
+ imageFormat = "jpg";
+ }
+ else
+ {
+ llwarns << "Image to upload is not a PNG or JPEG" << llendl;
+ return;
+ }
+
+ // All this code is mostly copied from LLWebProfile::post()
+ const std::string boundary = "----------------------------0123abcdefab";
+
+ LLSD headers;
+ headers["Content-Type"] = "multipart/form-data; boundary=" + boundary;
+
+ std::ostringstream body;
+
+ // *NOTE: The order seems to matter.
+ body << "--" << boundary << "\r\n"
+ << "Content-Disposition: form-data; name=\"status\"\r\n\r\n"
+ << status << "\r\n";
+
+ body << "--" << boundary << "\r\n"
+ << "Content-Disposition: form-data; name=\"image\"; filename=\"Untitled." << imageFormat << "\"\r\n"
+ << "Content-Type: image/" << imageFormat << "\r\n\r\n";
+
+ // Insert the image data.
+ // *FIX: Treating this as a string will probably screw it up ...
+ U8* image_data = image->getData();
+ for (S32 i = 0; i < image->getDataSize(); ++i)
+ {
+ body << image_data[i];
+ }
+
+ body << "\r\n--" << boundary << "--\r\n";
+
+ // postRaw() takes ownership of the buffer and releases it later.
+ size_t size = body.str().size();
+ U8 *data = new U8[size];
+ memcpy(data, body.str().data(), size);
+
+ // Note: we can use that route for different publish action. We should be able to use the same responder.
+ LLHTTPClient::postRaw(getTwitterConnectURL("/share/photo", true), data, size, new LLTwitterShareResponder(), headers);
+}
+
+void LLTwitterConnect::updateStatus(const std::string& status)
+{
+ LLSD body;
+ body["status"] = status;
+
+ // Note: we can use that route for different publish action. We should be able to use the same responder.
+ LLHTTPClient::post(getTwitterConnectURL("/share/status", true), body, new LLTwitterShareResponder());
+}
+
+void LLTwitterConnect::storeInfo(const LLSD& info)
+{
+ mInfo = info;
+ mRefreshInfo = false;
+
+ sInfoWatcher->post(info);
+}
+
+const LLSD& LLTwitterConnect::getInfo() const
+{
+ return mInfo;
+}
+
+void LLTwitterConnect::clearInfo()
+{
+ mInfo = LLSD();
+}
+
+void LLTwitterConnect::setDataDirty()
+{
+ mRefreshInfo = true;
+}
+
+void LLTwitterConnect::setConnectionState(LLTwitterConnect::EConnectionState connection_state)
+{
+ if(connection_state == TWITTER_CONNECTED)
+ {
+ mReadFromMaster = true;
+ setConnected(true);
+ setDataDirty();
+ }
+ else if(connection_state == TWITTER_NOT_CONNECTED)
+ {
+ setConnected(false);
+ }
+ else if(connection_state == TWITTER_POSTED)
+ {
+ mReadFromMaster = false;
+ }
+
+ if (mConnectionState != connection_state)
+ {
+ // set the connection state before notifying watchers
+ mConnectionState = connection_state;
+
+ LLSD state_info;
+ state_info["enum"] = connection_state;
+ sStateWatcher->post(state_info);
+ }
+}
+
+void LLTwitterConnect::setConnected(bool connected)
+{
+ mConnected = connected;
+}
diff --git a/indra/newview/lltwitterconnect.h b/indra/newview/lltwitterconnect.h
new file mode 100644
index 0000000000..c1df13f18c
--- /dev/null
+++ b/indra/newview/lltwitterconnect.h
@@ -0,0 +1,99 @@
+/**
+ * @file lltwitterconnect.h
+ * @author Merov, Cho
+ * @brief Connection to Twitter Service
+ *
+ * $LicenseInfo:firstyear=2013&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2013, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLTWITTERCONNECT_H
+#define LL_LLTWITTERCONNECT_H
+
+#include "llsingleton.h"
+#include "llimage.h"
+
+class LLEventPump;
+
+/**
+ * @class LLTwitterConnect
+ *
+ * Manages authentication to, and interaction with, a web service allowing the
+ * the viewer to post status updates and upload photos to Twitter.
+ */
+class LLTwitterConnect : public LLSingleton<LLTwitterConnect>
+{
+ LOG_CLASS(LLTwitterConnect);
+public:
+ enum EConnectionState
+ {
+ TWITTER_NOT_CONNECTED = 0,
+ TWITTER_CONNECTION_IN_PROGRESS = 1,
+ TWITTER_CONNECTED = 2,
+ TWITTER_CONNECTION_FAILED = 3,
+ TWITTER_POSTING = 4,
+ TWITTER_POSTED = 5,
+ TWITTER_POST_FAILED = 6,
+ TWITTER_DISCONNECTING = 7,
+ TWITTER_DISCONNECT_FAILED = 8
+ };
+
+ void connectToTwitter(const std::string& request_token = "", const std::string& oauth_verifier = ""); // Initiate the complete Twitter connection. Please use checkConnectionToTwitter() in normal use.
+ void disconnectFromTwitter(); // Disconnect from the Twitter service.
+ void checkConnectionToTwitter(bool auto_connect = false); // Check if an access token is available on the Twitter service. If not, call connectToTwitter().
+
+ void loadTwitterInfo();
+ void uploadPhoto(const std::string& image_url, const std::string& status);
+ void uploadPhoto(LLPointer<LLImageFormatted> image, const std::string& status);
+ void updateStatus(const std::string& status);
+
+ void storeInfo(const LLSD& info);
+ const LLSD& getInfo() const;
+ void clearInfo();
+ void setDataDirty();
+
+ void setConnectionState(EConnectionState connection_state);
+ void setConnected(bool connected);
+ bool isConnected() { return mConnected; }
+ bool isTransactionOngoing() { return ((mConnectionState == TWITTER_CONNECTION_IN_PROGRESS) || (mConnectionState == TWITTER_POSTING) || (mConnectionState == TWITTER_DISCONNECTING)); }
+ EConnectionState getConnectionState() { return mConnectionState; }
+
+ void openTwitterWeb(std::string url);
+
+private:
+ friend class LLSingleton<LLTwitterConnect>;
+
+ LLTwitterConnect();
+ ~LLTwitterConnect() {};
+ std::string getTwitterConnectURL(const std::string& route = "", bool include_read_from_master = false);
+
+ EConnectionState mConnectionState;
+ BOOL mConnected;
+ LLSD mInfo;
+ bool mRefreshInfo;
+ bool mReadFromMaster;
+
+ static boost::scoped_ptr<LLEventPump> sStateWatcher;
+ static boost::scoped_ptr<LLEventPump> sInfoWatcher;
+ static boost::scoped_ptr<LLEventPump> sContentWatcher;
+};
+
+#endif // LL_LLTWITTERCONNECT_H
diff --git a/indra/newview/lluploadfloaterobservers.cpp b/indra/newview/lluploadfloaterobservers.cpp
index 1d777b3f7f..69b9b1f9f1 100755
--- a/indra/newview/lluploadfloaterobservers.cpp
+++ b/indra/newview/lluploadfloaterobservers.cpp
@@ -1,6 +1,6 @@
/**
* @file lluploadfloaterobservers.cpp
- * @brief LLUploadModelPremissionsResponder definition
+ * @brief LLUploadModelPermissionsResponder definition
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
@@ -28,26 +28,31 @@
#include "lluploadfloaterobservers.h"
-LLUploadModelPremissionsResponder::LLUploadModelPremissionsResponder(const LLHandle<LLUploadPermissionsObserver>& observer)
+LLUploadModelPermissionsResponder::LLUploadModelPermissionsResponder(const LLHandle<LLUploadPermissionsObserver>& observer)
:mObserverHandle(observer)
{
}
-void LLUploadModelPremissionsResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+void LLUploadModelPermissionsResponder::httpFailure()
{
- llwarns << "LLUploadModelPremissionsResponder error [status:"
- << status << "]: " << content << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
LLUploadPermissionsObserver* observer = mObserverHandle.get();
if (observer)
{
- observer->setPermissonsErrorStatus(status, reason);
+ observer->setPermissonsErrorStatus(getStatus(), getReason());
}
}
-void LLUploadModelPremissionsResponder::result(const LLSD& content)
+void LLUploadModelPermissionsResponder::httpSuccess()
{
+ const LLSD& content = getContent();
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
LLUploadPermissionsObserver* observer = mObserverHandle.get();
if (observer)
@@ -55,3 +60,4 @@ void LLUploadModelPremissionsResponder::result(const LLSD& content)
observer->onPermissionsReceived(content);
}
}
+
diff --git a/indra/newview/lluploadfloaterobservers.h b/indra/newview/lluploadfloaterobservers.h
index b43ddb44d9..4ff4a827a5 100755
--- a/indra/newview/lluploadfloaterobservers.h
+++ b/indra/newview/lluploadfloaterobservers.h
@@ -1,6 +1,6 @@
/**
* @file lluploadfloaterobservers.h
- * @brief LLUploadModelPremissionsResponder declaration
+ * @brief LLUploadModelPermissionsResponder declaration
*
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
* Second Life Viewer Source Code
@@ -39,7 +39,7 @@ public:
virtual ~LLUploadPermissionsObserver() {}
virtual void onPermissionsReceived(const LLSD& result) = 0;
- virtual void setPermissonsErrorStatus(U32 status, const std::string& reason) = 0;
+ virtual void setPermissonsErrorStatus(S32 status, const std::string& reason) = 0;
LLHandle<LLUploadPermissionsObserver> getPermObserverHandle() const {return mUploadPermObserverHandle;}
@@ -54,7 +54,7 @@ public:
virtual ~LLWholeModelFeeObserver() {}
virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0;
- virtual void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason) = 0;
+ virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason) = 0;
LLHandle<LLWholeModelFeeObserver> getWholeModelFeeObserverHandle() const { return mWholeModelFeeObserverHandle; }
@@ -80,17 +80,16 @@ protected:
};
-class LLUploadModelPremissionsResponder : public LLHTTPClient::Responder
+class LLUploadModelPermissionsResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(LLUploadModelPermissionsResponder);
public:
-
- LLUploadModelPremissionsResponder(const LLHandle<LLUploadPermissionsObserver>& observer);
-
- void errorWithContent(U32 status, const std::string& reason, const LLSD& content);
-
- void result(const LLSD& content);
+ LLUploadModelPermissionsResponder(const LLHandle<LLUploadPermissionsObserver>& observer);
private:
+ /* virtual */ void httpSuccess();
+ /* virtual */ void httpFailure();
+
LLHandle<LLUploadPermissionsObserver> mObserverHandle;
};
diff --git a/indra/newview/llurl.cpp b/indra/newview/llurl.cpp
index aa90d16c67..01a81c5f83 100755
--- a/indra/newview/llurl.cpp
+++ b/indra/newview/llurl.cpp
@@ -126,13 +126,13 @@ void LLURL::init(const char * url)
strncpy(mPath,leftover_url, LL_MAX_PATH -1); /* Flawfinder: ignore */
mPath[LL_MAX_PATH -1] = '\0';
-// llinfos << url << " decomposed into: " << llendl;
-// llinfos << " URI : <" << mURI << ">" << llendl;
-// llinfos << " Auth: <" << mAuthority << ">" << llendl;
-// llinfos << " Path: <" << mPath << ">" << llendl;
-// llinfos << " File: <" << mFilename << ">" << llendl;
-// llinfos << " Ext : <" << mExtension << ">" << llendl;
-// llinfos << " Tag : <" << mTag << ">" << llendl;
+// LL_INFOS() << url << " decomposed into: " << LL_ENDL;
+// LL_INFOS() << " URI : <" << mURI << ">" << LL_ENDL;
+// LL_INFOS() << " Auth: <" << mAuthority << ">" << LL_ENDL;
+// LL_INFOS() << " Path: <" << mPath << ">" << LL_ENDL;
+// LL_INFOS() << " File: <" << mFilename << ">" << LL_ENDL;
+// LL_INFOS() << " Ext : <" << mExtension << ">" << LL_ENDL;
+// LL_INFOS() << " Tag : <" << mTag << ">" << LL_ENDL;
}
void LLURL::cleanup()
diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp
index 0c34db39b5..78268944fc 100755
--- a/indra/newview/llurldispatcher.cpp
+++ b/indra/newview/llurldispatcher.cpp
@@ -34,6 +34,7 @@
#include "llfloaterreg.h"
#include "llfloatersidepanelcontainer.h"
#include "llfloaterworldmap.h"
+#include "llnotifications.h"
#include "llpanellogin.h"
#include "llregionhandle.h"
#include "llslurl.h"
@@ -150,7 +151,7 @@ bool LLURLDispatcherImpl::dispatchApp(const LLSLURL& slurl,
LLMediaCtrl* web,
bool trusted_browser)
{
- llinfos << "cmd: " << slurl.getAppCmd() << " path: " << slurl.getAppPath() << " query: " << slurl.getAppQuery() << llendl;
+ LL_INFOS() << "cmd: " << slurl.getAppCmd() << " path: " << slurl.getAppPath() << " query: " << slurl.getAppQuery() << LL_ENDL;
const LLSD& query_map = LLURI::queryMap(slurl.getAppQuery());
bool handled = LLCommandDispatcher::dispatch(
slurl.getAppCmd(), slurl.getAppPath(), query_map, web, nav_type, trusted_browser);
@@ -253,13 +254,15 @@ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const LLSLURL&
//---------------------------------------------------------------------------
// Teleportation links are handled here because they are tightly coupled
// to SLURL parsing and sim-fragment parsing
+
class LLTeleportHandler : public LLCommandHandler
{
public:
// Teleport requests *must* come from a trusted browser
// inside the app, otherwise a malicious web page could
// cause a constant teleport loop. JC
- LLTeleportHandler() : LLCommandHandler("teleport", UNTRUSTED_BLOCK) { }
+ LLTeleportHandler() : LLCommandHandler("teleport", UNTRUSTED_THROTTLE) { }
+
bool handle(const LLSD& tokens, const LLSD& query_map,
LLMediaCtrl* web)
@@ -275,19 +278,51 @@ public:
tokens[2].asReal(),
tokens[3].asReal());
}
-
+
// Region names may be %20 escaped.
-
std::string region_name = LLURI::unescape(tokens[0]);
+ LLSD args;
+ args["LOCATION"] = region_name;
+
+ LLSD payload;
+ payload["region_name"] = region_name;
+ payload["callback_url"] = LLSLURL(region_name, coords).getSLURLString();
+
+ LLNotificationsUtil::add("TeleportViaSLAPP", args, payload);
+ return true;
+ }
+
+ static void teleport_via_slapp(std::string region_name, std::string callback_url)
+ {
+
LLWorldMapMessage::getInstance()->sendNamedRegionRequest(region_name,
LLURLDispatcherImpl::regionHandleCallback,
- LLSLURL(region_name, coords).getSLURLString(),
+ callback_url,
true); // teleport
- return true;
}
+
+ static bool teleport_via_slapp_callback(const LLSD& notification, const LLSD& response)
+ {
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+
+ std::string region_name = notification["payload"]["region_name"].asString();
+ std::string callback_url = notification["payload"]["callback_url"].asString();
+
+ if (option == 0)
+ {
+ teleport_via_slapp(region_name, callback_url);
+ return true;
+ }
+
+ return false;
+ }
+
};
LLTeleportHandler gTeleportHandler;
+static LLNotificationFunctorRegistration open_landmark_callback_reg("TeleportViaSLAPP", LLTeleportHandler::teleport_via_slapp_callback);
+
+
//---------------------------------------------------------------------------
diff --git a/indra/newview/llurlhistory.cpp b/indra/newview/llurlhistory.cpp
index a80b9da13c..8eea2b242a 100755
--- a/indra/newview/llurlhistory.cpp
+++ b/indra/newview/llurlhistory.cpp
@@ -48,15 +48,15 @@ bool LLURLHistory::loadFile(const std::string& filename)
if (file.is_open())
{
- llinfos << "Loading history.xml file at " << filename << llendl;
+ LL_INFOS() << "Loading history.xml file at " << filename << LL_ENDL;
LLSDSerialize::fromXML(data, file);
}
if (data.isUndefined())
{
- llinfos << "file missing, ill-formed, "
+ LL_INFOS() << "file missing, ill-formed, "
"or simply undefined; not changing the"
- " file" << llendl;
+ " file" << LL_ENDL;
sHistorySD = LLSD();
return false;
}
@@ -71,7 +71,7 @@ bool LLURLHistory::saveFile(const std::string& filename)
std::string temp_str = gDirUtilp->getLindenUserDir();
if( temp_str.empty() )
{
- llinfos << "Can't save URL history - no user directory set yet." << llendl;
+ LL_INFOS() << "Can't save URL history - no user directory set yet." << LL_ENDL;
return false;
}
@@ -79,7 +79,7 @@ bool LLURLHistory::saveFile(const std::string& filename)
llofstream out(temp_str);
if (!out.good())
{
- llwarns << "Unable to open " << filename << " for output." << llendl;
+ LL_WARNS() << "Unable to open " << filename << " for output." << LL_ENDL;
return false;
}
diff --git a/indra/newview/llurlwhitelist.cpp b/indra/newview/llurlwhitelist.cpp
index 72029203d9..8211ce12f6 100755
--- a/indra/newview/llurlwhitelist.cpp
+++ b/indra/newview/llurlwhitelist.cpp
@@ -117,7 +117,7 @@ bool LLUrlWhiteList::save ()
if (resolvedFilename.empty())
{
- llinfos << "No per-user dir for saving URL whitelist - presumably not logged in yet. Skipping." << llendl;
+ LL_INFOS() << "No per-user dir for saving URL whitelist - presumably not logged in yet. Skipping." << LL_ENDL;
return false;
}
diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp
index aaa81c57d4..54ac29723f 100755
--- a/indra/newview/llviewerassetstats.cpp
+++ b/indra/newview/llviewerassetstats.cpp
@@ -31,6 +31,8 @@
#include "stdtypes.h"
#include "llvoavatar.h"
+#include "llsdparam.h"
+#include "llsdutil.h"
/*
* Classes and utility functions for per-thread and per-region
@@ -78,126 +80,259 @@
*
*/
+namespace LLViewerAssetStatsFF
+{
+ static EViewerAssetCategories asset_type_to_category(const LLViewerAssetType::EType at, bool with_http, bool is_temp)
+ {
+ // For statistical purposes, we divide GETs into several
+ // populations of asset fetches:
+ // - textures which are de-prioritized in the asset system
+ // - wearables (clothing, bodyparts) which directly affect
+ // user experiences when they log in
+ // - sounds
+ // - gestures
+ // - everything else.
+ //
+ llassert_always(50 == LLViewerAssetType::AT_COUNT);
+
+ // Multiple asset definitions are floating around so this requires some
+ // maintenance and attention.
+ static const EViewerAssetCategories asset_to_bin_map[LLViewerAssetType::AT_COUNT] =
+ {
+ EVACTextureTempHTTPGet, // (0) AT_TEXTURE
+ EVACSoundUDPGet, // AT_SOUND
+ EVACOtherGet, // AT_CALLINGCARD
+ EVACOtherGet, // AT_LANDMARK
+ EVACOtherGet, // AT_SCRIPT
+ EVACWearableUDPGet, // AT_CLOTHING
+ EVACOtherGet, // AT_OBJECT
+ EVACOtherGet, // AT_NOTECARD
+ EVACOtherGet, // AT_CATEGORY
+ EVACOtherGet, // AT_ROOT_CATEGORY
+ EVACOtherGet, // (10) AT_LSL_TEXT
+ EVACOtherGet, // AT_LSL_BYTECODE
+ EVACOtherGet, // AT_TEXTURE_TGA
+ EVACWearableUDPGet, // AT_BODYPART
+ EVACOtherGet, // AT_TRASH
+ EVACOtherGet, // AT_SNAPSHOT_CATEGORY
+ EVACOtherGet, // AT_LOST_AND_FOUND
+ EVACSoundUDPGet, // AT_SOUND_WAV
+ EVACOtherGet, // AT_IMAGE_TGA
+ EVACOtherGet, // AT_IMAGE_JPEG
+ EVACGestureUDPGet, // (20) AT_ANIMATION
+ EVACGestureUDPGet, // AT_GESTURE
+ EVACOtherGet, // AT_SIMSTATE
+ EVACOtherGet, // AT_FAVORITE
+ EVACOtherGet, // AT_LINK
+ EVACOtherGet, // AT_LINK_FOLDER
+ EVACOtherGet, //
+ EVACOtherGet, //
+ EVACOtherGet, //
+ EVACOtherGet, //
+ EVACOtherGet, // (30)
+ EVACOtherGet, //
+ EVACOtherGet, //
+ EVACOtherGet, //
+ EVACOtherGet, //
+ EVACOtherGet, //
+ EVACOtherGet, //
+ EVACOtherGet, //
+ EVACOtherGet, //
+ EVACOtherGet, //
+ EVACOtherGet, // (40)
+ EVACOtherGet, //
+ EVACOtherGet, //
+ EVACOtherGet, //
+ EVACOtherGet, //
+ EVACOtherGet, //
+ EVACOtherGet, //
+ EVACOtherGet, //
+ EVACOtherGet, //
+ EVACOtherGet, // AT_MESH
+ // (50)
+ };
-// ------------------------------------------------------
-// Global data definitions
-// ------------------------------------------------------
-LLViewerAssetStats * gViewerAssetStatsMain(0);
-LLViewerAssetStats * gViewerAssetStatsThread1(0);
+ if (at < 0 || at >= LLViewerAssetType::AT_COUNT)
+ {
+ return EVACOtherGet;
+ }
+ EViewerAssetCategories ret(asset_to_bin_map[at]);
+ if (EVACTextureTempHTTPGet == ret)
+ {
+ // Indexed with [is_temp][with_http]
+ static const EViewerAssetCategories texture_bin_map[2][2] =
+ {
+ {
+ EVACTextureNonTempUDPGet,
+ EVACTextureNonTempHTTPGet,
+ },
+ {
+ EVACTextureTempUDPGet,
+ EVACTextureTempHTTPGet,
+ }
+ };
+
+ ret = texture_bin_map[is_temp][with_http];
+ }
+ return ret;
+ }
+ static LLTrace::CountStatHandle<> sEnqueueAssetRequestsTempTextureHTTP ("enqueuedassetrequeststemptexturehttp",
+ "Number of temporary texture asset http requests enqueued"),
+ sEnqueueAssetRequestsTempTextureUDP ("enqueuedassetrequeststemptextureudp",
+ "Number of temporary texture asset udp requests enqueued"),
+ sEnqueueAssetRequestsNonTempTextureHTTP("enqueuedassetrequestsnontemptexturehttp",
+ "Number of texture asset http requests enqueued"),
+ sEnqueueAssetRequestsNonTempTextureUDP ("enqueuedassetrequestsnontemptextureudp",
+ "Number of texture asset udp requests enqueued"),
+ sEnqueuedAssetRequestsWearableUdp ("enqueuedassetrequestswearableudp",
+ "Number of wearable asset requests enqueued"),
+ sEnqueuedAssetRequestsSoundUdp ("enqueuedassetrequestssoundudp",
+ "Number of sound asset requests enqueued"),
+ sEnqueuedAssetRequestsGestureUdp ("enqueuedassetrequestsgestureudp",
+ "Number of gesture asset requests enqueued"),
+ sEnqueuedAssetRequestsOther ("enqueuedassetrequestsother",
+ "Number of other asset requests enqueued");
+
+ static LLTrace::CountStatHandle<>* sEnqueued[EVACCount] = {
+ &sEnqueueAssetRequestsTempTextureHTTP,
+ &sEnqueueAssetRequestsTempTextureUDP,
+ &sEnqueueAssetRequestsNonTempTextureHTTP,
+ &sEnqueueAssetRequestsNonTempTextureUDP,
+ &sEnqueuedAssetRequestsWearableUdp,
+ &sEnqueuedAssetRequestsSoundUdp,
+ &sEnqueuedAssetRequestsGestureUdp,
+ &sEnqueuedAssetRequestsOther
+ };
+
+ static LLTrace::CountStatHandle<> sDequeueAssetRequestsTempTextureHTTP ("dequeuedassetrequeststemptexturehttp",
+ "Number of temporary texture asset http requests dequeued"),
+ sDequeueAssetRequestsTempTextureUDP ("dequeuedassetrequeststemptextureudp",
+ "Number of temporary texture asset udp requests dequeued"),
+ sDequeueAssetRequestsNonTempTextureHTTP("dequeuedassetrequestsnontemptexturehttp",
+ "Number of texture asset http requests dequeued"),
+ sDequeueAssetRequestsNonTempTextureUDP ("dequeuedassetrequestsnontemptextureudp",
+ "Number of texture asset udp requests dequeued"),
+ sDequeuedAssetRequestsWearableUdp ("dequeuedassetrequestswearableudp",
+ "Number of wearable asset requests dequeued"),
+ sDequeuedAssetRequestsSoundUdp ("dequeuedassetrequestssoundudp",
+ "Number of sound asset requests dequeued"),
+ sDequeuedAssetRequestsGestureUdp ("dequeuedassetrequestsgestureudp",
+ "Number of gesture asset requests dequeued"),
+ sDequeuedAssetRequestsOther ("dequeuedassetrequestsother",
+ "Number of other asset requests dequeued");
+
+ static LLTrace::CountStatHandle<>* sDequeued[EVACCount] = {
+ &sDequeueAssetRequestsTempTextureHTTP,
+ &sDequeueAssetRequestsTempTextureUDP,
+ &sDequeueAssetRequestsNonTempTextureHTTP,
+ &sDequeueAssetRequestsNonTempTextureUDP,
+ &sDequeuedAssetRequestsWearableUdp,
+ &sDequeuedAssetRequestsSoundUdp,
+ &sDequeuedAssetRequestsGestureUdp,
+ &sDequeuedAssetRequestsOther
+ };
+
+ static LLTrace::EventStatHandle<F64Seconds > sResponseAssetRequestsTempTextureHTTP ("assetresponsetimestemptexturehttp",
+ "Time spent responding to temporary texture asset http requests"),
+ sResponseAssetRequestsTempTextureUDP ("assetresponsetimestemptextureudp",
+ "Time spent responding to temporary texture asset udp requests"),
+ sResponseAssetRequestsNonTempTextureHTTP("assetresponsetimesnontemptexturehttp",
+ "Time spent responding to texture asset http requests"),
+ sResponseAssetRequestsNonTempTextureUDP ("assetresponsetimesnontemptextureudp",
+ "Time spent responding to texture asset udp requests"),
+ sResponsedAssetRequestsWearableUdp ("assetresponsetimeswearableudp",
+ "Time spent responding to wearable asset requests"),
+ sResponsedAssetRequestsSoundUdp ("assetresponsetimessoundudp",
+ "Time spent responding to sound asset requests"),
+ sResponsedAssetRequestsGestureUdp ("assetresponsetimesgestureudp",
+ "Time spent responding to gesture asset requests"),
+ sResponsedAssetRequestsOther ("assetresponsetimesother",
+ "Time spent responding to other asset requests");
+
+ static LLTrace::EventStatHandle<F64Seconds >* sResponse[EVACCount] = {
+ &sResponseAssetRequestsTempTextureHTTP,
+ &sResponseAssetRequestsTempTextureUDP,
+ &sResponseAssetRequestsNonTempTextureHTTP,
+ &sResponseAssetRequestsNonTempTextureUDP,
+ &sResponsedAssetRequestsWearableUdp,
+ &sResponsedAssetRequestsSoundUdp,
+ &sResponsedAssetRequestsGestureUdp,
+ &sResponsedAssetRequestsOther
+ };
+}
// ------------------------------------------------------
-// Local declarations
+// Global data definitions
// ------------------------------------------------------
-namespace
-{
-
-static LLViewerAssetStats::EViewerAssetCategories
-asset_type_to_category(const LLViewerAssetType::EType at, bool with_http, bool is_temp);
-
-}
+LLViewerAssetStats * gViewerAssetStats(0);
// ------------------------------------------------------
-// LLViewerAssetStats::PerRegionStats struct definition
+// LLViewerAssetStats class definition
// ------------------------------------------------------
-void
-LLViewerAssetStats::PerRegionStats::reset()
+LLViewerAssetStats::LLViewerAssetStats()
+: mRegionHandle(U64(0)),
+ mCurRecording(NULL)
{
- for (int i(0); i < LL_ARRAY_SIZE(mRequests); ++i)
- {
- mRequests[i].mEnqueued.reset();
- mRequests[i].mDequeued.reset();
- mRequests[i].mResponse.reset();
- }
- mFPS.reset();
-
- mTotalTime = 0;
- mStartTimestamp = LLViewerAssetStatsFF::get_timestamp();
+ start();
}
-void
-LLViewerAssetStats::PerRegionStats::merge(const LLViewerAssetStats::PerRegionStats & src)
+LLViewerAssetStats::LLViewerAssetStats(const LLViewerAssetStats & src)
+: mRegionHandle(src.mRegionHandle)
{
- // mRegionHandle, mTotalTime, mStartTimestamp are left alone.
+ mRegionRecordings = src.mRegionRecordings;
+
+ mCurRecording = &mRegionRecordings[mRegionHandle];
- // mFPS
- if (src.mFPS.getCount() && mFPS.getCount())
+ // assume this is being passed to another thread, so make sure we have unique copies of recording data
+ for (PerRegionRecordingContainer::iterator it = mRegionRecordings.begin(), end_it = mRegionRecordings.end();
+ it != end_it;
+ ++it)
{
- mFPS.merge(src.mFPS);
+ it->second.stop();
+ it->second.makeUnique();
}
- // Avatar stats - data all comes from main thread, so leave alone.
+ LLStopWatchControlsMixin<LLViewerAssetStats>::setPlayState(src.getPlayState());
+}
- // Requests
- for (int i = 0; i < LL_ARRAY_SIZE(mRequests); ++i)
+void LLViewerAssetStats::handleStart()
+{
+ if (mCurRecording)
{
- mRequests[i].mEnqueued.merge(src.mRequests[i].mEnqueued);
- mRequests[i].mDequeued.merge(src.mRequests[i].mDequeued);
- mRequests[i].mResponse.merge(src.mRequests[i].mResponse);
+ mCurRecording->start();
}
-
}
-
-void
-LLViewerAssetStats::PerRegionStats::accumulateTime(duration_t now)
+void LLViewerAssetStats::handleStop()
{
- mTotalTime += (now - mStartTimestamp);
- mStartTimestamp = now;
+ if (mCurRecording)
+ {
+ mCurRecording->stop();
+ }
}
-
-// ------------------------------------------------------
-// LLViewerAssetStats class definition
-// ------------------------------------------------------
-LLViewerAssetStats::LLViewerAssetStats()
- : mRegionHandle(U64(0))
+void LLViewerAssetStats::handleReset()
{
reset();
}
-LLViewerAssetStats::LLViewerAssetStats(const LLViewerAssetStats & src)
- : mRegionHandle(src.mRegionHandle),
- mResetTimestamp(src.mResetTimestamp)
-{
- const PerRegionContainer::const_iterator it_end(src.mRegionStats.end());
- for (PerRegionContainer::const_iterator it(src.mRegionStats.begin()); it_end != it; ++it)
- {
- mRegionStats[it->first] = new PerRegionStats(*it->second);
- }
- mCurRegionStats = mRegionStats[mRegionHandle];
-}
-
-
-void
-LLViewerAssetStats::reset()
+void LLViewerAssetStats::reset()
{
// Empty the map of all region stats
- mRegionStats.clear();
+ mRegionRecordings.clear();
- // If we have a current stats, reset it, otherwise, as at construction,
- // create a new one as we must always have a current stats block.
- if (mCurRegionStats)
- {
- mCurRegionStats->reset();
- }
- else
+ // initialize new recording for current region
+ if (mRegionHandle)
{
- mCurRegionStats = new PerRegionStats(mRegionHandle);
+ mCurRecording = &mRegionRecordings[mRegionHandle];
+ mCurRecording->setPlayState(getPlayState());
}
-
- // And add reference to map
- mRegionStats[mRegionHandle] = mCurRegionStats;
-
- // Start timestamp consistent with per-region collector
- mResetTimestamp = mCurRegionStats->mStartTimestamp;
}
-
-void
-LLViewerAssetStats::setRegion(region_handle_t region_handle)
+void LLViewerAssetStats::setRegion(region_handle_t region_handle)
{
if (region_handle == mRegionHandle)
{
@@ -205,410 +340,259 @@ LLViewerAssetStats::setRegion(region_handle_t region_handle)
return;
}
- // Get duration for current set
- const duration_t now = LLViewerAssetStatsFF::get_timestamp();
- mCurRegionStats->accumulateTime(now);
-
- // Prepare new set
- PerRegionContainer::iterator new_stats = mRegionStats.find(region_handle);
- if (mRegionStats.end() == new_stats)
+ if (mCurRecording)
{
- // Haven't seen this region_id before, create a new block and make it current.
- mCurRegionStats = new PerRegionStats(region_handle);
- mRegionStats[region_handle] = mCurRegionStats;
+ mCurRecording->pause();
}
- else
+ if (region_handle)
{
- mCurRegionStats = new_stats->second;
+ mCurRecording = &mRegionRecordings[region_handle];
+ mCurRecording->setPlayState(getPlayState());
}
- mCurRegionStats->mStartTimestamp = now;
- mRegionHandle = region_handle;
-}
-
-void
-LLViewerAssetStats::recordGetEnqueued(LLViewerAssetType::EType at, bool with_http, bool is_temp)
-{
- const EViewerAssetCategories eac(asset_type_to_category(at, with_http, is_temp));
-
- ++(mCurRegionStats->mRequests[int(eac)].mEnqueued);
-}
-
-void
-LLViewerAssetStats::recordGetDequeued(LLViewerAssetType::EType at, bool with_http, bool is_temp)
-{
- const EViewerAssetCategories eac(asset_type_to_category(at, with_http, is_temp));
-
- ++(mCurRegionStats->mRequests[int(eac)].mDequeued);
+ mRegionHandle = region_handle;
}
-void
-LLViewerAssetStats::recordGetServiced(LLViewerAssetType::EType at, bool with_http, bool is_temp, duration_t duration)
+void LLViewerAssetStats::getStats(AssetStats& stats, bool compact_output)
{
- const EViewerAssetCategories eac(asset_type_to_category(at, with_http, is_temp));
+ using namespace LLViewerAssetStatsFF;
- mCurRegionStats->mRequests[int(eac)].mResponse.record(duration);
-}
+ stats.regions.setProvided();
+
+ for (PerRegionRecordingContainer::iterator it = mRegionRecordings.begin(), end_it = mRegionRecordings.end();
+ it != end_it;
+ ++it)
+ {
+ RegionStats& r = stats.regions.add();
+ LLTrace::Recording& rec = it->second;
+ if (!compact_output
+ || rec.getSum(*sEnqueued[EVACTextureTempHTTPGet])
+ || rec.getSum(*sDequeued[EVACTextureTempHTTPGet])
+ || rec.getSum(*sResponse[EVACTextureTempHTTPGet]).value())
+ {
+ r.get_texture_temp_http .enqueued((S32)rec.getSum(*sEnqueued[EVACTextureTempHTTPGet]))
+ .dequeued((S32)rec.getSum(*sDequeued[EVACTextureTempHTTPGet]))
+ .resp_count((S32)rec.getSum(*sResponse[EVACTextureTempHTTPGet]).value())
+ .resp_min(rec.getMin(*sResponse[EVACTextureTempHTTPGet]).value())
+ .resp_max(rec.getMax(*sResponse[EVACTextureTempHTTPGet]).value())
+ .resp_mean(rec.getMean(*sResponse[EVACTextureTempHTTPGet]).value());
+ }
+ if (!compact_output
+ || rec.getSum(*sEnqueued[EVACTextureTempUDPGet])
+ || rec.getSum(*sDequeued[EVACTextureTempUDPGet])
+ || rec.getSum(*sResponse[EVACTextureTempUDPGet]).value())
+ {
+ r.get_texture_temp_udp .enqueued((S32)rec.getSum(*sEnqueued[EVACTextureTempUDPGet]))
+ .dequeued((S32)rec.getSum(*sDequeued[EVACTextureTempUDPGet]))
+ .resp_count((S32)rec.getSum(*sResponse[EVACTextureTempUDPGet]).value())
+ .resp_min(rec.getMin(*sResponse[EVACTextureTempUDPGet]).value())
+ .resp_max(rec.getMax(*sResponse[EVACTextureTempUDPGet]).value())
+ .resp_mean(rec.getMean(*sResponse[EVACTextureTempUDPGet]).value());
+ }
+ if (!compact_output
+ || rec.getSum(*sEnqueued[EVACTextureNonTempHTTPGet])
+ || rec.getSum(*sDequeued[EVACTextureNonTempHTTPGet])
+ || rec.getSum(*sResponse[EVACTextureNonTempHTTPGet]).value())
+ {
+ r.get_texture_non_temp_http .enqueued((S32)rec.getSum(*sEnqueued[EVACTextureNonTempHTTPGet]))
+ .dequeued((S32)rec.getSum(*sDequeued[EVACTextureNonTempHTTPGet]))
+ .resp_count((S32)rec.getSum(*sResponse[EVACTextureNonTempHTTPGet]).value())
+ .resp_min(rec.getMin(*sResponse[EVACTextureNonTempHTTPGet]).value())
+ .resp_max(rec.getMax(*sResponse[EVACTextureNonTempHTTPGet]).value())
+ .resp_mean(rec.getMean(*sResponse[EVACTextureNonTempHTTPGet]).value());
+ }
-void
-LLViewerAssetStats::recordFPS(F32 fps)
-{
- mCurRegionStats->mFPS.record(fps);
-}
+ if (!compact_output
+ || rec.getSum(*sEnqueued[EVACTextureNonTempUDPGet])
+ || rec.getSum(*sDequeued[EVACTextureNonTempUDPGet])
+ || rec.getSum(*sResponse[EVACTextureNonTempUDPGet]).value())
+ {
+ r.get_texture_non_temp_udp .enqueued((S32)rec.getSum(*sEnqueued[EVACTextureNonTempUDPGet]))
+ .dequeued((S32)rec.getSum(*sDequeued[EVACTextureNonTempUDPGet]))
+ .resp_count((S32)rec.getSum(*sResponse[EVACTextureNonTempUDPGet]).value())
+ .resp_min(rec.getMin(*sResponse[EVACTextureNonTempUDPGet]).value())
+ .resp_max(rec.getMax(*sResponse[EVACTextureNonTempUDPGet]).value())
+ .resp_mean(rec.getMean(*sResponse[EVACTextureNonTempUDPGet]).value());
+ }
-LLSD
-LLViewerAssetStats::asLLSD(bool compact_output)
-{
- // Top-level tags
- static const LLSD::String tags[EVACCount] =
+ if (!compact_output
+ || rec.getSum(*sEnqueued[EVACWearableUDPGet])
+ || rec.getSum(*sDequeued[EVACWearableUDPGet])
+ || rec.getSum(*sResponse[EVACWearableUDPGet]).value())
{
- LLSD::String("get_texture_temp_http"),
- LLSD::String("get_texture_temp_udp"),
- LLSD::String("get_texture_non_temp_http"),
- LLSD::String("get_texture_non_temp_udp"),
- LLSD::String("get_wearable_udp"),
- LLSD::String("get_sound_udp"),
- LLSD::String("get_gesture_udp"),
- LLSD::String("get_other")
- };
+ r.get_wearable_udp .enqueued((S32)rec.getSum(*sEnqueued[EVACWearableUDPGet]))
+ .dequeued((S32)rec.getSum(*sDequeued[EVACWearableUDPGet]))
+ .resp_count((S32)rec.getSum(*sResponse[EVACWearableUDPGet]).value())
+ .resp_min(rec.getMin(*sResponse[EVACWearableUDPGet]).value())
+ .resp_max(rec.getMax(*sResponse[EVACWearableUDPGet]).value())
+ .resp_mean(rec.getMean(*sResponse[EVACWearableUDPGet]).value());
+ }
- // Stats Group Sub-tags.
- static const LLSD::String enq_tag("enqueued");
- static const LLSD::String deq_tag("dequeued");
- static const LLSD::String rcnt_tag("resp_count");
- static const LLSD::String rmin_tag("resp_min");
- static const LLSD::String rmax_tag("resp_max");
- static const LLSD::String rmean_tag("resp_mean");
-
- // MMM Group Sub-tags.
- static const LLSD::String cnt_tag("count");
- static const LLSD::String min_tag("min");
- static const LLSD::String max_tag("max");
- static const LLSD::String mean_tag("mean");
-
- const duration_t now = LLViewerAssetStatsFF::get_timestamp();
- mCurRegionStats->accumulateTime(now);
-
- LLSD regions = LLSD::emptyArray();
- for (PerRegionContainer::iterator it = mRegionStats.begin();
- mRegionStats.end() != it;
- ++it)
- {
- if (0 == it->first)
+ if (!compact_output
+ || rec.getSum(*sEnqueued[EVACSoundUDPGet])
+ || rec.getSum(*sDequeued[EVACSoundUDPGet])
+ || rec.getSum(*sResponse[EVACSoundUDPGet]).value())
{
- // Never emit NULL UUID/handle in results.
- continue;
+ r.get_sound_udp .enqueued((S32)rec.getSum(*sEnqueued[EVACSoundUDPGet]))
+ .dequeued((S32)rec.getSum(*sDequeued[EVACSoundUDPGet]))
+ .resp_count((S32)rec.getSum(*sResponse[EVACSoundUDPGet]).value())
+ .resp_min(rec.getMin(*sResponse[EVACSoundUDPGet]).value())
+ .resp_max(rec.getMax(*sResponse[EVACSoundUDPGet]).value())
+ .resp_mean(rec.getMean(*sResponse[EVACSoundUDPGet]).value());
}
- PerRegionStats & stats = *it->second;
-
- LLSD reg_stat = LLSD::emptyMap();
-
- for (int i = 0; i < LL_ARRAY_SIZE(tags); ++i)
+ if (!compact_output
+ || rec.getSum(*sEnqueued[EVACGestureUDPGet])
+ || rec.getSum(*sDequeued[EVACGestureUDPGet])
+ || rec.getSum(*sResponse[EVACGestureUDPGet]).value())
{
- PerRegionStats::prs_group & group(stats.mRequests[i]);
+ r.get_gesture_udp .enqueued((S32)rec.getSum(*sEnqueued[EVACGestureUDPGet]))
+ .dequeued((S32)rec.getSum(*sDequeued[EVACGestureUDPGet]))
+ .resp_count((S32)rec.getSum(*sResponse[EVACGestureUDPGet]).value())
+ .resp_min(rec.getMin(*sResponse[EVACGestureUDPGet]).value())
+ .resp_max(rec.getMax(*sResponse[EVACGestureUDPGet]).value())
+ .resp_mean(rec.getMean(*sResponse[EVACGestureUDPGet]).value());
+ }
- if ((! compact_output) ||
- group.mEnqueued.getCount() ||
- group.mDequeued.getCount() ||
- group.mResponse.getCount())
+ if (!compact_output
+ || rec.getSum(*sEnqueued[EVACOtherGet])
+ || rec.getSum(*sDequeued[EVACOtherGet])
+ || rec.getSum(*sResponse[EVACOtherGet]).value())
{
- LLSD & slot = reg_stat[tags[i]];
- slot = LLSD::emptyMap();
- slot[enq_tag] = LLSD(S32(stats.mRequests[i].mEnqueued.getCount()));
- slot[deq_tag] = LLSD(S32(stats.mRequests[i].mDequeued.getCount()));
- slot[rcnt_tag] = LLSD(S32(stats.mRequests[i].mResponse.getCount()));
- slot[rmin_tag] = LLSD(F64(stats.mRequests[i].mResponse.getMin() * 1.0e-6));
- slot[rmax_tag] = LLSD(F64(stats.mRequests[i].mResponse.getMax() * 1.0e-6));
- slot[rmean_tag] = LLSD(F64(stats.mRequests[i].mResponse.getMean() * 1.0e-6));
- }
+ r.get_other .enqueued((S32)rec.getSum(*sEnqueued[EVACOtherGet]))
+ .dequeued((S32)rec.getSum(*sDequeued[EVACOtherGet]))
+ .resp_count((S32)rec.getSum(*sResponse[EVACOtherGet]).value())
+ .resp_min(rec.getMin(*sResponse[EVACOtherGet]).value())
+ .resp_max(rec.getMax(*sResponse[EVACOtherGet]).value())
+ .resp_mean(rec.getMean(*sResponse[EVACOtherGet]).value());
}
- if ((! compact_output) || stats.mFPS.getCount())
+ S32 fps = (S32)rec.getLastValue(LLStatViewer::FPS_SAMPLE);
+ if (!compact_output || fps != 0)
{
- LLSD & slot = reg_stat["fps"];
- slot = LLSD::emptyMap();
- slot[cnt_tag] = LLSD(S32(stats.mFPS.getCount()));
- slot[min_tag] = LLSD(F64(stats.mFPS.getMin()));
- slot[max_tag] = LLSD(F64(stats.mFPS.getMax()));
- slot[mean_tag] = LLSD(F64(stats.mFPS.getMean()));
+ r.fps .count(fps)
+ .min(rec.getMin(LLStatViewer::FPS_SAMPLE))
+ .max(rec.getMax(LLStatViewer::FPS_SAMPLE))
+ .mean(rec.getMean(LLStatViewer::FPS_SAMPLE));
}
U32 grid_x(0), grid_y(0);
grid_from_region_handle(it->first, &grid_x, &grid_y);
- reg_stat["grid_x"] = LLSD::Integer(grid_x);
- reg_stat["grid_y"] = LLSD::Integer(grid_y);
- reg_stat["duration"] = LLSD::Real(stats.mTotalTime * 1.0e-6);
- regions.append(reg_stat);
+ r .grid_x(grid_x)
+ .grid_y(grid_y)
+ .duration(F64Microseconds(rec.getDuration()).value());
}
- LLSD ret = LLSD::emptyMap();
- ret["regions"] = regions;
- ret["duration"] = LLSD::Real((now - mResetTimestamp) * 1.0e-6);
-
- return ret;
+ stats.duration(mCurRecording ? F64Microseconds(mCurRecording->getDuration()).value() : 0.0);
}
-void
-LLViewerAssetStats::merge(const LLViewerAssetStats & src)
+LLSD LLViewerAssetStats::asLLSD(bool compact_output)
{
- // mRegionHandle, mCurRegionStats and mResetTimestamp are left untouched.
- // Just merge the stats bodies
-
- const PerRegionContainer::const_iterator it_end(src.mRegionStats.end());
- for (PerRegionContainer::const_iterator it(src.mRegionStats.begin()); it_end != it; ++it)
+ LLParamSDParser parser;
+ LLSD sd;
+ AssetStats stats;
+ getStats(stats, compact_output);
+ LLInitParam::predicate_rule_t rule = LLInitParam::default_parse_rules();
+ if (!compact_output)
{
- PerRegionContainer::iterator dst(mRegionStats.find(it->first));
- if (mRegionStats.end() == dst)
- {
- // Destination is missing data, just make a private copy
- mRegionStats[it->first] = new PerRegionStats(*it->second);
- }
- else
- {
- dst->second->merge(*it->second);
- }
+ rule.allow(LLInitParam::EMPTY);
}
+ parser.writeSD(sd, stats, rule);
+ return sd;
}
-
// ------------------------------------------------------
// Global free-function definitions (LLViewerAssetStatsFF namespace)
// ------------------------------------------------------
namespace LLViewerAssetStatsFF
{
-
-//
-// Target thread is elaborated in the function name. This could
-// have been something 'templatey' like specializations iterated
-// over a set of constants but with so few, this is clearer I think.
-//
-// As for the threads themselves... rather than do fine-grained
-// locking as we gather statistics, this code creates a collector
-// for each thread, allocated and run independently. Logging
-// happens at relatively infrequent intervals and at that time
-// the data is sent to a single thread to be aggregated into
-// a single entity with locks, thread safety and other niceties.
-//
-// A particularly fussy implementation would distribute the
-// per-thread pointers across separate cache lines. But that should
-// be beyond current requirements.
-//
-
-// 'main' thread - initial program thread
-
-void
-set_region_main(LLViewerAssetStats::region_handle_t region_handle)
-{
- if (! gViewerAssetStatsMain)
- return;
-
- gViewerAssetStatsMain->setRegion(region_handle);
-}
-
-void
-record_enqueue_main(LLViewerAssetType::EType at, bool with_http, bool is_temp)
-{
- if (! gViewerAssetStatsMain)
- return;
-
- gViewerAssetStatsMain->recordGetEnqueued(at, with_http, is_temp);
-}
-
-void
-record_dequeue_main(LLViewerAssetType::EType at, bool with_http, bool is_temp)
-{
- if (! gViewerAssetStatsMain)
- return;
-
- gViewerAssetStatsMain->recordGetDequeued(at, with_http, is_temp);
-}
-
-void
-record_response_main(LLViewerAssetType::EType at, bool with_http, bool is_temp, LLViewerAssetStats::duration_t duration)
+void set_region(LLViewerAssetStats::region_handle_t region_handle)
{
- if (! gViewerAssetStatsMain)
+ if (! gViewerAssetStats)
return;
- gViewerAssetStatsMain->recordGetServiced(at, with_http, is_temp, duration);
+ gViewerAssetStats->setRegion(region_handle);
}
-void
-record_fps_main(F32 fps)
+void record_enqueue(LLViewerAssetType::EType at, bool with_http, bool is_temp)
{
- if (! gViewerAssetStatsMain)
- return;
-
- gViewerAssetStatsMain->recordFPS(fps);
-}
-
-// 'thread1' - should be for TextureFetch thread
-
-void
-set_region_thread1(LLViewerAssetStats::region_handle_t region_handle)
-{
- if (! gViewerAssetStatsThread1)
- return;
-
- gViewerAssetStatsThread1->setRegion(region_handle);
-}
-
-void
-record_enqueue_thread1(LLViewerAssetType::EType at, bool with_http, bool is_temp)
-{
- if (! gViewerAssetStatsThread1)
- return;
+ const EViewerAssetCategories eac(asset_type_to_category(at, with_http, is_temp));
- gViewerAssetStatsThread1->recordGetEnqueued(at, with_http, is_temp);
+ add(*sEnqueued[int(eac)], 1);
}
-void
-record_dequeue_thread1(LLViewerAssetType::EType at, bool with_http, bool is_temp)
+void record_dequeue(LLViewerAssetType::EType at, bool with_http, bool is_temp)
{
- if (! gViewerAssetStatsThread1)
- return;
+ const EViewerAssetCategories eac(asset_type_to_category(at, with_http, is_temp));
- gViewerAssetStatsThread1->recordGetDequeued(at, with_http, is_temp);
+ add(*sDequeued[int(eac)], 1);
}
-void
-record_response_thread1(LLViewerAssetType::EType at, bool with_http, bool is_temp, LLViewerAssetStats::duration_t duration)
+void record_response(LLViewerAssetType::EType at, bool with_http, bool is_temp, LLViewerAssetStats::duration_t duration)
{
- if (! gViewerAssetStatsThread1)
- return;
+ const EViewerAssetCategories eac(asset_type_to_category(at, with_http, is_temp));
- gViewerAssetStatsThread1->recordGetServiced(at, with_http, is_temp, duration);
+ record(*sResponse[int(eac)], F64Microseconds(duration));
}
-
-void
-init()
+void init()
{
- if (! gViewerAssetStatsMain)
- {
- gViewerAssetStatsMain = new LLViewerAssetStats();
- }
- if (! gViewerAssetStatsThread1)
+ if (! gViewerAssetStats)
{
- gViewerAssetStatsThread1 = new LLViewerAssetStats();
+ gViewerAssetStats = new LLViewerAssetStats();
}
}
void
cleanup()
{
- delete gViewerAssetStatsMain;
- gViewerAssetStatsMain = 0;
-
- delete gViewerAssetStatsThread1;
- gViewerAssetStatsThread1 = 0;
+ delete gViewerAssetStats;
+ gViewerAssetStats = 0;
}
} // namespace LLViewerAssetStatsFF
-// ------------------------------------------------------
-// Local function definitions
-// ------------------------------------------------------
-
-namespace
-{
-LLViewerAssetStats::EViewerAssetCategories
-asset_type_to_category(const LLViewerAssetType::EType at, bool with_http, bool is_temp)
-{
- // For statistical purposes, we divide GETs into several
- // populations of asset fetches:
- // - textures which are de-prioritized in the asset system
- // - wearables (clothing, bodyparts) which directly affect
- // user experiences when they log in
- // - sounds
- // - gestures
- // - everything else.
- //
- llassert_always(50 == LLViewerAssetType::AT_COUNT);
-
- // Multiple asset definitions are floating around so this requires some
- // maintenance and attention.
- static const LLViewerAssetStats::EViewerAssetCategories asset_to_bin_map[LLViewerAssetType::AT_COUNT] =
- {
- LLViewerAssetStats::EVACTextureTempHTTPGet, // (0) AT_TEXTURE
- LLViewerAssetStats::EVACSoundUDPGet, // AT_SOUND
- LLViewerAssetStats::EVACOtherGet, // AT_CALLINGCARD
- LLViewerAssetStats::EVACOtherGet, // AT_LANDMARK
- LLViewerAssetStats::EVACOtherGet, // AT_SCRIPT
- LLViewerAssetStats::EVACWearableUDPGet, // AT_CLOTHING
- LLViewerAssetStats::EVACOtherGet, // AT_OBJECT
- LLViewerAssetStats::EVACOtherGet, // AT_NOTECARD
- LLViewerAssetStats::EVACOtherGet, // AT_CATEGORY
- LLViewerAssetStats::EVACOtherGet, // AT_ROOT_CATEGORY
- LLViewerAssetStats::EVACOtherGet, // (10) AT_LSL_TEXT
- LLViewerAssetStats::EVACOtherGet, // AT_LSL_BYTECODE
- LLViewerAssetStats::EVACOtherGet, // AT_TEXTURE_TGA
- LLViewerAssetStats::EVACWearableUDPGet, // AT_BODYPART
- LLViewerAssetStats::EVACOtherGet, // AT_TRASH
- LLViewerAssetStats::EVACOtherGet, // AT_SNAPSHOT_CATEGORY
- LLViewerAssetStats::EVACOtherGet, // AT_LOST_AND_FOUND
- LLViewerAssetStats::EVACSoundUDPGet, // AT_SOUND_WAV
- LLViewerAssetStats::EVACOtherGet, // AT_IMAGE_TGA
- LLViewerAssetStats::EVACOtherGet, // AT_IMAGE_JPEG
- LLViewerAssetStats::EVACGestureUDPGet, // (20) AT_ANIMATION
- LLViewerAssetStats::EVACGestureUDPGet, // AT_GESTURE
- LLViewerAssetStats::EVACOtherGet, // AT_SIMSTATE
- LLViewerAssetStats::EVACOtherGet, // AT_FAVORITE
- LLViewerAssetStats::EVACOtherGet, // AT_LINK
- LLViewerAssetStats::EVACOtherGet, // AT_LINK_FOLDER
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, // (30)
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, // (40)
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, //
- LLViewerAssetStats::EVACOtherGet, // AT_MESH
- // (50)
- };
+LLViewerAssetStats::AssetRequestType::AssetRequestType()
+: enqueued("enqueued"),
+ dequeued("dequeued"),
+ resp_count("resp_count"),
+ resp_min("resp_min"),
+ resp_max("resp_max"),
+ resp_mean("resp_mean")
+{}
- if (at < 0 || at >= LLViewerAssetType::AT_COUNT)
- {
- return LLViewerAssetStats::EVACOtherGet;
- }
- LLViewerAssetStats::EViewerAssetCategories ret(asset_to_bin_map[at]);
- if (LLViewerAssetStats::EVACTextureTempHTTPGet == ret)
- {
- // Indexed with [is_temp][with_http]
- static const LLViewerAssetStats::EViewerAssetCategories texture_bin_map[2][2] =
- {
- {
- LLViewerAssetStats::EVACTextureNonTempUDPGet,
- LLViewerAssetStats::EVACTextureNonTempHTTPGet,
- },
- {
- LLViewerAssetStats::EVACTextureTempUDPGet,
- LLViewerAssetStats::EVACTextureTempHTTPGet,
- }
- };
-
- ret = texture_bin_map[is_temp][with_http];
- }
- return ret;
-}
-
-} // anonymous namespace
+LLViewerAssetStats::FPSStats::FPSStats()
+: count("count"),
+ min("min"),
+ max("max"),
+ mean("mean")
+{}
+
+LLViewerAssetStats::RegionStats::RegionStats()
+: get_texture_temp_http("get_texture_temp_http"),
+ get_texture_temp_udp("get_texture_temp_udp"),
+ get_texture_non_temp_http("get_texture_non_temp_http"),
+ get_texture_non_temp_udp("get_texture_non_temp_udp"),
+ get_wearable_udp("get_wearable_udp"),
+ get_sound_udp("get_sound_udp"),
+ get_gesture_udp("get_gesture_udp"),
+ get_other("get_other"),
+ fps("fps"),
+ grid_x("grid_x"),
+ grid_y("grid_y"),
+ duration("duration")
+{}
+
+LLViewerAssetStats::AssetStats::AssetStats()
+: regions("regions"),
+ duration("duration"),
+ session_id("session_id"),
+ agent_id("agent_id"),
+ message("message"),
+ sequence("sequence"),
+ initial("initial"),
+ break_("break")
+{}
diff --git a/indra/newview/llviewerassetstats.h b/indra/newview/llviewerassetstats.h
index e4581d2120..9d425c82fc 100755
--- a/indra/newview/llviewerassetstats.h
+++ b/indra/newview/llviewerassetstats.h
@@ -34,9 +34,10 @@
#include "llrefcount.h"
#include "llviewerassettype.h"
#include "llviewerassetstorage.h"
-#include "llsimplestat.h"
#include "llsd.h"
#include "llvoavatar.h"
+#include "lltrace.h"
+#include "llinitparam.h"
/**
* @class LLViewerAssetStats
@@ -73,29 +74,15 @@
* LLViewerAssetStatsFF is provided for conditional test-and-call
* operations.
*/
-class LLViewerAssetStats
+class LLViewerAssetStats : public LLStopWatchControlsMixin<LLViewerAssetStats>
{
public:
- enum EViewerAssetCategories
- {
- EVACTextureTempHTTPGet, //< Texture GETs - temp/baked, HTTP
- EVACTextureTempUDPGet, //< Texture GETs - temp/baked, UDP
- EVACTextureNonTempHTTPGet, //< Texture GETs - perm, HTTP
- EVACTextureNonTempUDPGet, //< Texture GETs - perm, UDP
- EVACWearableUDPGet, //< Wearable GETs
- EVACSoundUDPGet, //< Sound GETs
- EVACGestureUDPGet, //< Gesture GETs
- EVACOtherGet, //< Other GETs
-
- EVACCount // Must be last
- };
-
/**
* Type for duration and other time values in the metrics. Selected
* for compatibility with the pre-existing timestamp on the texture
* fetcher class, LLTextureFetch.
*/
- typedef U64 duration_t;
+ typedef U64Microseconds duration_t;
/**
* Type for the region identifier used in stats. Currently uses
@@ -104,64 +91,65 @@ public:
*/
typedef U64 region_handle_t;
- /**
- * @brief Collected data for a single region visited by the avatar.
- *
- * Fairly simple, for each asset bin enumerated above a count
- * of enqueue and dequeue operations and simple stats on response
- * times for completed requests.
- */
- class PerRegionStats : public LLRefCount
+ struct AssetRequestType : public LLInitParam::Block<AssetRequestType>
{
- public:
- PerRegionStats(const region_handle_t region_handle)
- : LLRefCount(),
- mRegionHandle(region_handle)
- {
- reset();
- }
-
- PerRegionStats(const PerRegionStats & src)
- : LLRefCount(),
- mRegionHandle(src.mRegionHandle),
- mTotalTime(src.mTotalTime),
- mStartTimestamp(src.mStartTimestamp),
- mFPS(src.mFPS)
+ Mandatory<S32> enqueued,
+ dequeued,
+ resp_count;
+ Mandatory<F64> resp_min,
+ resp_max,
+ resp_mean;
+
+ AssetRequestType();
+ };
+
+ struct FPSStats : public LLInitParam::Block<FPSStats>
{
- for (int i = 0; i < LL_ARRAY_SIZE(mRequests); ++i)
- {
- mRequests[i] = src.mRequests[i];
- }
- }
+ Mandatory<S32> count;
+ Mandatory<F64> min,
+ max,
+ mean;
+ FPSStats();
+ };
- // Default assignment and destructor are correct.
+ struct RegionStats : public LLInitParam::Block<RegionStats>
+ {
+ Optional<AssetRequestType> get_texture_temp_http,
+ get_texture_temp_udp,
+ get_texture_non_temp_http,
+ get_texture_non_temp_udp,
+ get_wearable_udp,
+ get_sound_udp,
+ get_gesture_udp,
+ get_other;
+ Optional<FPSStats> fps;
+ Optional<S32> grid_x,
+ grid_y;
+ Optional<F64> duration;
+
+ RegionStats();
+ };
- void reset();
-
- void merge(const PerRegionStats & src);
+ struct AssetStats : public LLInitParam::Block<AssetStats>
+ {
+ Multiple<RegionStats> regions;
+ Mandatory<F64> duration;
- // Apply current running time to total and reset start point.
- // Return current timestamp as a convenience.
- void accumulateTime(duration_t now);
+ Mandatory<LLUUID> session_id,
+ agent_id;
- public:
- region_handle_t mRegionHandle;
- duration_t mTotalTime;
- duration_t mStartTimestamp;
- LLSimpleStatMMM<> mFPS;
+ Mandatory<std::string> message;
+ Mandatory<S32> sequence;
+ Mandatory<bool> initial,
+ break_;
- struct prs_group
- {
- LLSimpleStatCounter mEnqueued;
- LLSimpleStatCounter mDequeued;
- LLSimpleStatMMM<duration_t> mResponse;
- }
- mRequests [EVACCount];
+ AssetStats();
};
public:
LLViewerAssetStats();
LLViewerAssetStats(const LLViewerAssetStats &);
+
// Default destructor is correct.
LLViewerAssetStats & operator=(const LLViewerAssetStats &); // Not defined
@@ -174,88 +162,28 @@ public:
// collection calls.
void setRegion(region_handle_t region_handle);
- // Asset GET Requests
- void recordGetEnqueued(LLViewerAssetType::EType at, bool with_http, bool is_temp);
- void recordGetDequeued(LLViewerAssetType::EType at, bool with_http, bool is_temp);
- void recordGetServiced(LLViewerAssetType::EType at, bool with_http, bool is_temp, duration_t duration);
-
- // Frames-Per-Second Samples
- void recordFPS(F32 fps);
-
- // Avatar-related statistics
- void recordAvatarStats();
-
- // Merge a source instance into a destination instance. This is
- // conceptually an 'operator+=()' method:
- // - counts are added
- // - minimums are min'd
- // - maximums are max'd
- // - other scalars are ignored ('this' wins)
- //
- void merge(const LLViewerAssetStats & src);
-
// Retrieve current metrics for all visited regions (NULL region UUID/handle excluded)
- // Returned LLSD is structured as follows:
- //
- // &stats_group = {
- // enqueued : int,
- // dequeued : int,
- // resp_count : int,
- // resp_min : float,
- // resp_max : float,
- // resp_mean : float
- // }
- //
- // &mmm_group = {
- // count : int,
- // min : float,
- // max : float,
- // mean : float
- // }
- //
- // {
- // duration: int
- // regions: {
- // $: { // Keys are strings of the region's handle in hex
- // duration: : int,
- // fps: : &mmm_group,
- // get_texture_temp_http : &stats_group,
- // get_texture_temp_udp : &stats_group,
- // get_texture_non_temp_http : &stats_group,
- // get_texture_non_temp_udp : &stats_group,
- // get_wearable_udp : &stats_group,
- // get_sound_udp : &stats_group,
- // get_gesture_udp : &stats_group,
- // get_other : &stats_group
- // }
- // }
- // }
- //
- // @param compact_output If true, omits from conversion any mmm_block
- // or stats_block that would contain all zero data.
- // Useful for transmission when the receiver knows
- // what is expected and will assume zero for missing
- // blocks.
+ // Uses AssetStats structure seen above
+ void getStats(AssetStats& stats, bool compact_output);
LLSD asLLSD(bool compact_output);
protected:
- typedef std::map<region_handle_t, LLPointer<PerRegionStats> > PerRegionContainer;
+ void handleStart();
+ void handleStop();
+ void handleReset();
+
+ typedef std::map<region_handle_t, LLTrace::Recording > PerRegionRecordingContainer;
// Region of the currently-active region. Always valid but may
// be zero after construction or when explicitly set. Unchanged
// by a reset() call.
region_handle_t mRegionHandle;
- // Pointer to metrics collection for currently-active region. Always
- // valid and unchanged after reset() though contents will be changed.
- // Always points to a collection contained in mRegionStats.
- LLPointer<PerRegionStats> mCurRegionStats;
+ // Pointer to metrics collection for currently-active region.
+ LLTrace::Recording* mCurRecording;
// Metrics data for all regions during one collection cycle
- PerRegionContainer mRegionStats;
-
- // Time of last reset
- duration_t mResetTimestamp;
+ PerRegionRecordingContainer mRegionRecordings;
};
@@ -273,12 +201,24 @@ protected:
* - Main: main() program execution thread
* - Thread1: TextureFetch worker thread
*/
-extern LLViewerAssetStats * gViewerAssetStatsMain;
-
-extern LLViewerAssetStats * gViewerAssetStatsThread1;
+extern LLViewerAssetStats * gViewerAssetStats;
namespace LLViewerAssetStatsFF
{
+ enum EViewerAssetCategories
+ {
+ EVACTextureTempHTTPGet, //< Texture GETs - temp/baked, HTTP
+ EVACTextureTempUDPGet, //< Texture GETs - temp/baked, UDP
+ EVACTextureNonTempHTTPGet, //< Texture GETs - perm, HTTP
+ EVACTextureNonTempUDPGet, //< Texture GETs - perm, UDP
+ EVACWearableUDPGet, //< Wearable GETs
+ EVACSoundUDPGet, //< Sound GETs
+ EVACGestureUDPGet, //< Gesture GETs
+ EVACOtherGet, //< Other GETs
+
+ EVACCount // Must be last
+ };
+
/**
* @brief Allocation and deallocation of globals.
*
@@ -303,28 +243,16 @@ inline LLViewerAssetStats::duration_t get_timestamp()
/**
* Region context, event and duration loggers for the Main thread.
*/
-void set_region_main(LLViewerAssetStats::region_handle_t region_handle);
+void set_region(LLViewerAssetStats::region_handle_t region_handle);
-void record_enqueue_main(LLViewerAssetType::EType at, bool with_http, bool is_temp);
+void record_enqueue(LLViewerAssetType::EType at, bool with_http, bool is_temp);
-void record_dequeue_main(LLViewerAssetType::EType at, bool with_http, bool is_temp);
+void record_dequeue(LLViewerAssetType::EType at, bool with_http, bool is_temp);
-void record_response_main(LLViewerAssetType::EType at, bool with_http, bool is_temp,
+void record_response(LLViewerAssetType::EType at, bool with_http, bool is_temp,
LLViewerAssetStats::duration_t duration);
-void record_fps_main(F32 fps);
-
-/**
- * Region context, event and duration loggers for Thread 1.
- */
-void set_region_thread1(LLViewerAssetStats::region_handle_t region_handle);
-
-void record_enqueue_thread1(LLViewerAssetType::EType at, bool with_http, bool is_temp);
-
-void record_dequeue_thread1(LLViewerAssetType::EType at, bool with_http, bool is_temp);
-
-void record_response_thread1(LLViewerAssetType::EType at, bool with_http, bool is_temp,
- LLViewerAssetStats::duration_t duration);
+void record_avatar_stats();
} // namespace LLViewerAssetStatsFF
diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp
index d042f62830..5fb99ce02f 100755
--- a/indra/newview/llviewerassetstorage.cpp
+++ b/indra/newview/llviewerassetstorage.cpp
@@ -69,15 +69,15 @@ public:
protected:
void recordMetrics()
{
- if (mMetricsStartTime)
+ if (mMetricsStartTime.value())
{
// Okay, it appears this request was used for useful things. Record
// the expected dequeue and duration of request processing.
- LLViewerAssetStatsFF::record_dequeue_main(mType, false, false);
- LLViewerAssetStatsFF::record_response_main(mType, false, false,
+ LLViewerAssetStatsFF::record_dequeue(mType, false, false);
+ LLViewerAssetStatsFF::record_response(mType, false, false,
(LLViewerAssetStatsFF::get_timestamp()
- mMetricsStartTime));
- mMetricsStartTime = 0;
+ mMetricsStartTime = (U32Seconds)0;
}
}
@@ -113,11 +113,11 @@ void LLViewerAssetStorage::storeAssetData(
bool is_priority,
bool store_local,
bool user_waiting,
- F64 timeout)
+ F64Seconds timeout)
{
LLAssetID asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
LL_DEBUGS("AssetStorage") << "LLViewerAssetStorage::storeAssetData (legacy) " << tid << ":" << LLAssetType::lookup(asset_type)
- << " ASSET_ID: " << asset_id << llendl;
+ << " ASSET_ID: " << asset_id << LL_ENDL;
if (mUpstreamHost.isOk())
{
@@ -137,7 +137,7 @@ void LLViewerAssetStorage::storeAssetData(
if (asset_size < 1)
{
// This can happen if there's a bug in our code or if the VFS has been corrupted.
- llwarns << "LLViewerAssetStorage::storeAssetData() Data _should_ already be in the VFS, but it's not! " << asset_id << llendl;
+ LL_WARNS() << "LLViewerAssetStorage::storeAssetData() Data _should_ already be in the VFS, but it's not! " << asset_id << LL_ENDL;
// LLAssetStorage metric: Zero size VFS
reportMetric( asset_id, asset_type, LLStringUtil::null, LLUUID::null, 0, MR_ZERO_SIZE, __FILE__, __LINE__, "The file didn't exist or was zero length (VFS - can't tell which)" );
@@ -174,11 +174,11 @@ void LLViewerAssetStorage::storeAssetData(
if( bytes_read == asset_size )
{
req->mDataSentInFirstPacket = TRUE;
- //llinfos << "LLViewerAssetStorage::createAsset sending data in first packet" << llendl;
+ //LL_INFOS() << "LLViewerAssetStorage::createAsset sending data in first packet" << LL_ENDL;
}
else
{
- llwarns << "Probable corruption in VFS file, aborting store asset data" << llendl;
+ LL_WARNS() << "Probable corruption in VFS file, aborting store asset data" << LL_ENDL;
// LLAssetStorage metric: VFS corrupt - bogus size
reportMetric( asset_id, asset_type, LLStringUtil::null, LLUUID::null, asset_size, MR_VFS_CORRUPTION, __FILE__, __LINE__, "VFS corruption" );
@@ -207,7 +207,7 @@ void LLViewerAssetStorage::storeAssetData(
}
else
{
- llwarns << "AssetStorage: attempt to upload non-existent vfile " << asset_id << ":" << LLAssetType::lookup(asset_type) << llendl;
+ LL_WARNS() << "AssetStorage: attempt to upload non-existent vfile " << asset_id << ":" << LLAssetType::lookup(asset_type) << LL_ENDL;
// LLAssetStorage metric: Zero size VFS
reportMetric( asset_id, asset_type, LLStringUtil::null, LLUUID::null, 0, MR_ZERO_SIZE, __FILE__, __LINE__, "The file didn't exist or was zero length (VFS - can't tell which)" );
if (callback)
@@ -218,7 +218,7 @@ void LLViewerAssetStorage::storeAssetData(
}
else
{
- llwarns << "Attempt to move asset store request upstream w/o valid upstream provider" << llendl;
+ LL_WARNS() << "Attempt to move asset store request upstream w/o valid upstream provider" << LL_ENDL;
// LLAssetStorage metric: Upstream provider dead
reportMetric( asset_id, asset_type, LLStringUtil::null, LLUUID::null, 0, MR_NO_UPSTREAM, __FILE__, __LINE__, "No upstream provider" );
if (callback)
@@ -237,20 +237,20 @@ void LLViewerAssetStorage::storeAssetData(
bool temp_file,
bool is_priority,
bool user_waiting,
- F64 timeout)
+ F64Seconds timeout)
{
if(filename.empty())
{
// LLAssetStorage metric: no filename
reportMetric( LLUUID::null, asset_type, LLStringUtil::null, LLUUID::null, 0, MR_VFS_CORRUPTION, __FILE__, __LINE__, "Filename missing" );
- llerrs << "No filename specified" << llendl;
+ LL_ERRS() << "No filename specified" << LL_ENDL;
return;
}
LLAssetID asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
- LL_DEBUGS("AssetStorage") << "LLViewerAssetStorage::storeAssetData (legacy)" << asset_id << ":" << LLAssetType::lookup(asset_type) << llendl;
+ LL_DEBUGS("AssetStorage") << "LLViewerAssetStorage::storeAssetData (legacy)" << asset_id << ":" << LLAssetType::lookup(asset_type) << LL_ENDL;
- LL_DEBUGS("AssetStorage") << "ASSET_ID: " << asset_id << llendl;
+ LL_DEBUGS("AssetStorage") << "ASSET_ID: " << asset_id << LL_ENDL;
S32 size = 0;
LLFILE* fp = LLFile::fopen(filename, "rb");
@@ -369,17 +369,17 @@ void LLViewerAssetStorage::_queueDataRequest(
tpvf.setAsset(uuid, atype);
tpvf.setCallback(downloadCompleteCallback, req);
- LL_DEBUGS("AssetStorage") << "Starting transfer for " << uuid << llendl;
+ LL_DEBUGS("AssetStorage") << "Starting transfer for " << uuid << LL_ENDL;
LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(mUpstreamHost, LLTCT_ASSET);
ttcp->requestTransfer(spa, tpvf, 100.f + (is_priority ? 1.f : 0.f));
- LLViewerAssetStatsFF::record_enqueue_main(atype, false, false);
+ LLViewerAssetStatsFF::record_enqueue(atype, false, false);
}
}
else
{
// uh-oh, we shouldn't have gotten here
- llwarns << "Attempt to move asset data request upstream w/o valid upstream provider" << llendl;
+ LL_WARNS() << "Attempt to move asset data request upstream w/o valid upstream provider" << LL_ENDL;
if (callback)
{
callback(mVFS, uuid, atype, user_data, LL_ERR_CIRCUIT_GONE, LL_EXSTAT_NO_UPSTREAM);
diff --git a/indra/newview/llviewerassetstorage.h b/indra/newview/llviewerassetstorage.h
index ca9b9943fa..6baec647e6 100755
--- a/indra/newview/llviewerassetstorage.h
+++ b/indra/newview/llviewerassetstorage.h
@@ -51,7 +51,7 @@ public:
bool is_priority = false,
bool store_local = false,
bool user_waiting=FALSE,
- F64 timeout=LL_ASSET_STORAGE_TIMEOUT);
+ F64Seconds timeout=LL_ASSET_STORAGE_TIMEOUT);
virtual void storeAssetData(
const std::string& filename,
@@ -62,7 +62,7 @@ public:
bool temp_file = false,
bool is_priority = false,
bool user_waiting=FALSE,
- F64 timeout=LL_ASSET_STORAGE_TIMEOUT);
+ F64Seconds timeout=LL_ASSET_STORAGE_TIMEOUT);
protected:
using LLAssetStorage::_queueDataRequest;
diff --git a/indra/newview/llviewerassettype.h b/indra/newview/llviewerassettype.h
index ec8b822917..9ad8ea7eeb 100755
--- a/indra/newview/llviewerassettype.h
+++ b/indra/newview/llviewerassettype.h
@@ -29,6 +29,7 @@
#include <string>
#include "llassettype.h"
+#include "llui.h" //EDragAndDropType
// This class is similar to llassettype, but contains methods
// only used by the viewer.
diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp
index 826d296117..7ce9d858dd 100755
--- a/indra/newview/llvieweraudio.cpp
+++ b/indra/newview/llvieweraudio.cpp
@@ -37,6 +37,7 @@
#include "llviewerwindow.h"
#include "llvoiceclient.h"
#include "llviewermedia.h"
+#include "llviewerregion.h"
#include "llprogressview.h"
#include "llcallbacklist.h"
#include "llstartup.h"
@@ -93,7 +94,12 @@ void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI)
switch (mFadeState)
{
- case FADE_IDLE:
+ case FADE_IDLE:
+ if (!gAudiop)
+ {
+ LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
+ break;
+ }
// If a stream is playing fade it out first
if (!gAudiop->getInternetStreamURL().empty())
{
@@ -115,18 +121,18 @@ void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI)
break;
}
- case FADE_OUT:
- startFading();
- registerIdleListener();
- break;
+ case FADE_OUT:
+ startFading();
+ registerIdleListener();
+ break;
- case FADE_IN:
- registerIdleListener();
- break;
+ case FADE_IN:
+ registerIdleListener();
+ break;
- default:
- llwarns << "Unknown fading state: " << mFadeState << llendl;
- break;
+ default:
+ LL_WARNS() << "Unknown fading state: " << mFadeState << LL_ENDL;
+ break;
}
}
@@ -157,19 +163,26 @@ bool LLViewerAudio::onIdleUpdate()
// we have finished the current fade operation
if (mFadeState == FADE_OUT)
{
- // Clear URI
- gAudiop->startInternetStream(LLStringUtil::null);
- gAudiop->stopInternetStream();
+ if (gAudiop)
+ {
+ // Clear URI
+ gAudiop->startInternetStream(LLStringUtil::null);
+ gAudiop->stopInternetStream();
+ }
if (!mNextStreamURI.empty())
{
mFadeState = FADE_IN;
- LLStreamingAudioInterface *stream = gAudiop->getStreamingAudioImpl();
- if(stream && stream->supportsAdjustableBufferSizes())
- stream->setBufferSizes(gSavedSettings.getU32("FMODExStreamBufferSize"),gSavedSettings.getU32("FMODExDecodeBufferSize"));
+ if (gAudiop)
+ {
+ LLStreamingAudioInterface *stream = gAudiop->getStreamingAudioImpl();
+ if(stream && stream->supportsAdjustableBufferSizes())
+ stream->setBufferSizes(gSavedSettings.getU32("FMODExStreamBufferSize"),gSavedSettings.getU32("FMODExDecodeBufferSize"));
+
+ gAudiop->startInternetStream(mNextStreamURI);
+ }
- gAudiop->startInternetStream(mNextStreamURI);
startFading();
}
else
@@ -181,7 +194,7 @@ bool LLViewerAudio::onIdleUpdate()
}
else if (mFadeState == FADE_IN)
{
- if (mNextStreamURI != gAudiop->getInternetStreamURL())
+ if (gAudiop && mNextStreamURI != gAudiop->getInternetStreamURL())
{
mFadeState = FADE_OUT;
startFading();
@@ -203,9 +216,12 @@ void LLViewerAudio::stopInternetStreamWithAutoFade()
mFadeState = FADE_IDLE;
mNextStreamURI = LLStringUtil::null;
mDone = true;
-
- gAudiop->startInternetStream(LLStringUtil::null);
- gAudiop->stopInternetStream();
+
+ if (gAudiop)
+ {
+ gAudiop->startInternetStream(LLStringUtil::null);
+ gAudiop->stopInternetStream();
+ }
}
void LLViewerAudio::startFading()
@@ -267,7 +283,7 @@ F32 LLViewerAudio::getFadeVolume()
void LLViewerAudio::onTeleportStarted()
{
- if (!LLViewerAudio::getInstance()->getForcedTeleportFade())
+ if (gAudiop && !LLViewerAudio::getInstance()->getForcedTeleportFade())
{
// Even though the music was turned off it was starting up (with autoplay disabled) occasionally
// after a failed teleport or after an intra-parcel teleport. Also, the music sometimes was not
@@ -291,7 +307,7 @@ void LLViewerAudio::onTeleportFailed()
if (parcel)
{
mNextStreamURI = parcel->getMusicURL();
- llinfos << "Teleport failed -- setting music stream to " << mNextStreamURI << llendl;
+ LL_INFOS() << "Teleport failed -- setting music stream to " << mNextStreamURI << LL_ENDL;
}
}
mWasPlaying = false;
@@ -309,7 +325,7 @@ void LLViewerAudio::onTeleportFinished(const LLVector3d& pos, const bool& local)
if (parcel)
{
mNextStreamURI = parcel->getMusicURL();
- llinfos << "Intraparcel teleport -- setting music stream to " << mNextStreamURI << llendl;
+ LL_INFOS() << "Intraparcel teleport -- setting music stream to " << mNextStreamURI << LL_ENDL;
}
}
mWasPlaying = false;
@@ -319,7 +335,7 @@ void init_audio()
{
if (!gAudiop)
{
- llwarns << "Failed to create an appropriate Audio Engine" << llendl;
+ LL_WARNS() << "Failed to create an appropriate Audio Engine" << LL_ENDL;
return;
}
LLVector3d lpos_global = gAgentCamera.getCameraPositionGlobal();
@@ -393,9 +409,10 @@ void audio_update_volume(bool force_update)
}
F32 mute_volume = mute_audio ? 0.0f : 1.0f;
- // Sound Effects
if (gAudiop)
{
+ // Sound Effects
+
gAudiop->setMasterGain ( master_volume );
gAudiop->setDopplerFactor(gSavedSettings.getF32("AudioLevelDoppler"));
@@ -425,11 +442,9 @@ void audio_update_volume(bool force_update)
gSavedSettings.getBOOL("MuteUI") ? 0.f : gSavedSettings.getF32("AudioLevelUI"));
gAudiop->setSecondaryGain(LLAudioEngine::AUDIO_TYPE_AMBIENT,
gSavedSettings.getBOOL("MuteAmbient") ? 0.f : gSavedSettings.getF32("AudioLevelAmbient"));
- }
- // Streaming Music
- if (gAudiop)
- {
+ // Streaming Music
+
if (!progress_view_visible && LLViewerAudio::getInstance()->getForcedTeleportFade())
{
LLViewerAudio::getInstance()->setWasPlaying(!gAudiop->getInternetStreamURL().empty());
@@ -527,6 +542,12 @@ void audio_update_wind(bool force_update)
volume_delta = 1.f;
}
+ if (!gAudiop)
+ {
+ LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
+ return;
+ }
+
// mute wind when not flying
if (gAgent.getFlying())
{
diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp
index b5aa0ac92a..57a0195d23 100755
--- a/indra/newview/llviewercamera.cpp
+++ b/indra/newview/llviewercamera.cpp
@@ -49,11 +49,15 @@
#include "llglheaders.h"
#include "llquaternion.h"
#include "llwindow.h" // getPixelAspectRatio()
+#include "lltracerecording.h"
// System includes
#include <iomanip> // for setprecision
-U32 LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
+LLTrace::CountStatHandle<> LLViewerCamera::sVelocityStat("camera_velocity");
+LLTrace::CountStatHandle<> LLViewerCamera::sAngularVelocityStat("camera_angular_velocity");
+
+LLViewerCamera::eCameraID LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
//glu pick matrix implementation borrowed from Mesa3D
glh::matrix4f gl_pick_matrix(GLfloat x, GLfloat y, GLfloat width, GLfloat height, GLint* viewport)
@@ -151,7 +155,7 @@ void LLViewerCamera::updateCameraLocation(const LLVector3 &center,
setOriginAndLookAt(origin, up_direction, point_of_interest);
- mVelocityDir = center - last_position ;
+ mVelocityDir = origin - last_position ;
F32 dpos = mVelocityDir.normVec() ;
LLQuaternion rotation;
rotation.shortestArc(last_axis, getAtAxis());
@@ -160,11 +164,11 @@ void LLViewerCamera::updateCameraLocation(const LLVector3 &center,
F32 drot;
rotation.getAngleAxis(&drot, &x, &y, &z);
- mVelocityStat.addValue(dpos);
- mAngularVelocityStat.addValue(drot);
+ add(sVelocityStat, dpos);
+ add(sAngularVelocityStat, drot);
- mAverageSpeed = mVelocityStat.getMeanPerSec() ;
- mAverageAngularSpeed = mAngularVelocityStat.getMeanPerSec() ;
+ mAverageSpeed = LLTrace::get_frame_recording().getPeriodMeanPerSec(sVelocityStat, 50);
+ mAverageAngularSpeed = LLTrace::get_frame_recording().getPeriodMeanPerSec(sAngularVelocityStat);
mCosHalfCameraFOV = cosf(0.5f * getView() * llmax(1.0f, getAspect()));
// update pixel meter ratio using default fov, not modified one
diff --git a/indra/newview/llviewercamera.h b/indra/newview/llviewercamera.h
index b857c7fe89..7b2887d725 100755
--- a/indra/newview/llviewercamera.h
+++ b/indra/newview/llviewercamera.h
@@ -29,10 +29,10 @@
#include "llcamera.h"
#include "llsingleton.h"
-#include "llstat.h"
#include "lltimer.h"
#include "m4math.h"
#include "llcoord.h"
+#include "lltrace.h"
class LLViewerObject;
@@ -80,7 +80,7 @@ public:
NUM_CAMERAS
} eCameraID;
- static U32 sCurCameraID;
+ static eCameraID sCurCameraID;
LLViewerCamera();
@@ -100,9 +100,9 @@ public:
BOOL projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoordGL &out_point, const BOOL clamp = TRUE) const;
BOOL projectPosAgentToScreenEdge(const LLVector3 &pos_agent, LLCoordGL &out_point) const;
- const LLVector3* getVelocityDir() const {return &mVelocityDir;}
- LLStat *getVelocityStat() { return &mVelocityStat; }
- LLStat *getAngularVelocityStat() { return &mAngularVelocityStat; }
+ LLVector3 getVelocityDir() const {return mVelocityDir;}
+ static LLTrace::CountStatHandle<>* getVelocityStat() {return &sVelocityStat; }
+ static LLTrace::CountStatHandle<>* getAngularVelocityStat() {return &sAngularVelocityStat; }
F32 getCosHalfFov() {return mCosHalfCameraFOV;}
F32 getAverageSpeed() {return mAverageSpeed ;}
F32 getAverageAngularSpeed() {return mAverageAngularSpeed;}
@@ -117,9 +117,9 @@ public:
F32 getDefaultFOV() { return mCameraFOVDefault; }
BOOL cameraUnderWater() const;
+ BOOL areVertsVisible(LLViewerObject* volumep, BOOL all_verts);
const LLVector3 &getPointOfInterest() { return mLastPointOfInterest; }
- BOOL areVertsVisible(LLViewerObject* volumep, BOOL all_verts);
F32 getPixelMeterRatio() const { return mPixelMeterRatio; }
S32 getScreenPixelArea() const { return mScreenPixelArea; }
@@ -130,12 +130,12 @@ public:
protected:
void calcProjection(const F32 far_distance) const;
- LLStat mVelocityStat;
- LLStat mAngularVelocityStat;
+ static LLTrace::CountStatHandle<> sVelocityStat;
+ static LLTrace::CountStatHandle<> sAngularVelocityStat;
+
LLVector3 mVelocityDir ;
F32 mAverageSpeed ;
F32 mAverageAngularSpeed ;
-
mutable LLMatrix4 mProjectionMatrix; // Cache of perspective matrix
mutable LLMatrix4 mModelviewMatrix;
F32 mCameraFOVDefault;
diff --git a/indra/newview/llviewerchat.cpp b/indra/newview/llviewerchat.cpp
index 93687dbd5f..1c3c547bc1 100755
--- a/indra/newview/llviewerchat.cpp
+++ b/indra/newview/llviewerchat.cpp
@@ -241,7 +241,7 @@ std::string LLViewerChat::getSenderSLURL(const LLChat& chat, const LLSD& args)
return getObjectImSLURL(chat, args);
default:
- llwarns << "Getting SLURL for an unsupported sender type: " << chat.mSourceType << llendl;
+ LL_WARNS() << "Getting SLURL for an unsupported sender type: " << chat.mSourceType << LL_ENDL;
}
return LLStringUtil::null;
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 744ec4de2b..5020518454 100755
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -264,7 +264,7 @@ static bool handleGammaChanged(const LLSD& newvalue)
// Only save it if it's changed
if (!gViewerWindow->getWindow()->setGamma(gamma))
{
- llwarns << "setGamma failed!" << llendl;
+ LL_WARNS() << "setGamma failed!" << LL_ENDL;
}
}
@@ -289,7 +289,7 @@ static bool handleMaxPartCountChanged(const LLSD& newvalue)
static bool handleVideoMemoryChanged(const LLSD& newvalue)
{
- gTextureList.updateMaxResidentTexMem(newvalue.asInteger());
+ gTextureList.updateMaxResidentTexMem(S32Megabytes(newvalue.asInteger()));
return true;
}
@@ -368,6 +368,7 @@ static bool handleRepartition(const LLSD&)
if (gPipeline.isInit())
{
gOctreeMaxCapacity = gSavedSettings.getU32("OctreeMaxNodeCapacity");
+ gOctreeMinSize = gSavedSettings.getF32("OctreeMinimumNodeSize");
gObjectList.repartitionObjects();
}
return true;
@@ -499,7 +500,7 @@ bool handleVelocityInterpolate(const LLSD& newvalue)
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
gAgent.sendReliableMessage();
- llinfos << "Velocity Interpolation On" << llendl;
+ LL_INFOS() << "Velocity Interpolation On" << LL_ENDL;
}
else
{
@@ -508,7 +509,7 @@ bool handleVelocityInterpolate(const LLSD& newvalue)
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
gAgent.sendReliableMessage();
- llinfos << "Velocity Interpolation Off" << llendl;
+ LL_INFOS() << "Velocity Interpolation Off" << LL_ENDL;
}
return true;
}
@@ -785,13 +786,13 @@ static LLCachedControl<std::string> test_BrowserHomePage("BrowserHomePage", "hah
void test_cached_control()
{
-#define do { TEST_LLCC(T, V) if((T)mySetting_##T != V) llerrs << "Fail "#T << llendl; } while(0)
+#define do { TEST_LLCC(T, V) if((T)mySetting_##T != V) LL_ERRS() << "Fail "#T << LL_ENDL; } while(0)
TEST_LLCC(U32, 666);
TEST_LLCC(S32, (S32)-666);
TEST_LLCC(F32, (F32)-666.666);
TEST_LLCC(bool, true);
TEST_LLCC(BOOL, FALSE);
- if((std::string)mySetting_string != "Default String Value") llerrs << "Fail string" << llendl;
+ if((std::string)mySetting_string != "Default String Value") LL_ERRS() << "Fail string" << LL_ENDL;
TEST_LLCC(LLVector3, LLVector3(1.0f, 2.0f, 3.0f));
TEST_LLCC(LLVector3d, LLVector3d(6.0f, 5.0f, 4.0f));
TEST_LLCC(LLRect, LLRect(0, 0, 100, 500));
@@ -800,7 +801,7 @@ void test_cached_control()
TEST_LLCC(LLColor4U, LLColor4U(255, 200, 100, 255));
//There's no LLSD comparsion for LLCC yet. TEST_LLCC(LLSD, test_llsd);
- if((std::string)test_BrowserHomePage != "http://www.secondlife.com") llerrs << "Fail BrowserHomePage" << llendl;
+ if((std::string)test_BrowserHomePage != "http://www.secondlife.com") LL_ERRS() << "Fail BrowserHomePage" << LL_ENDL;
}
#endif // TEST_CACHED_CONTROL
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index bbebeea3e0..981e4c40aa 100755
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -77,6 +77,7 @@
#include "llwlparammanager.h"
#include "llwaterparammanager.h"
#include "llpostprocess.h"
+#include "llscenemonitor.h"
extern LLPointer<LLViewerTexture> gStartTexture;
extern bool gShiftFrame;
@@ -84,9 +85,6 @@ extern bool gShiftFrame;
LLPointer<LLViewerTexture> gDisconnectedImagep = NULL;
// used to toggle renderer back on after teleport
-const F32 TELEPORT_RENDER_DELAY = 20.f; // Max time a teleport is allowed to take before we raise the curtain
-const F32 TELEPORT_ARRIVAL_DELAY = 2.f; // Time to preload the world before raising the curtain after we've actually already arrived.
-const F32 TELEPORT_LOCAL_DELAY = 1.0f; // Delay to prevent teleports after starting an in-sim teleport.
BOOL gTeleportDisplay = FALSE;
LLFrameTimer gTeleportDisplayTimer;
LLFrameTimer gTeleportArrivalTimer;
@@ -100,6 +98,11 @@ BOOL gWindowResized = FALSE;
BOOL gSnapshot = FALSE;
BOOL gShaderProfileFrame = FALSE;
+// This is how long the sim will try to teleport you before giving up.
+const F32 TELEPORT_EXPIRY = 15.0f;
+// Additional time (in seconds) to wait per attachment
+const F32 TELEPORT_EXPIRY_PER_ATTACHMENT = 3.f;
+
U32 gRecentFrameCount = 0; // number of 'recent' frames
LLFrameTimer gRecentFPSTime;
LLFrameTimer gRecentMemoryTime;
@@ -108,6 +111,7 @@ LLFrameTimer gRecentMemoryTime;
void pre_show_depth_buffer();
void post_show_depth_buffer();
void render_ui(F32 zoom_factor = 1.f, int subfield = 0);
+void swap();
void render_hud_attachments();
void render_ui_3d();
void render_ui_2d();
@@ -133,7 +137,7 @@ void display_startup()
//
if (!LLViewerFetchedTexture::sWhiteImagep.isNull())
{
- LLTexUnit::sWhiteTexture = LLViewerFetchedTexture::sWhiteImagep->getTexName();
+ LLTexUnit::sWhiteTexture = LLViewerFetchedTexture::sWhiteImagep->getTexName();
}
LLGLSDefault gls_default;
@@ -176,11 +180,11 @@ void display_startup()
glClear(GL_DEPTH_BUFFER_BIT);
}
-static LLFastTimer::DeclareTimer FTM_UPDATE_CAMERA("Update Camera");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_CAMERA("Update Camera");
void display_update_camera()
{
- LLFastTimer t(FTM_UPDATE_CAMERA);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_CAMERA);
// TODO: cut draw distance down if customizing avatar?
// TODO: cut draw distance on per-parcel basis?
@@ -202,51 +206,51 @@ void display_update_camera()
LLWorld::getInstance()->setLandFarClip(final_far);
}
-// Write some stats to llinfos
+// Write some stats to LL_INFOS()
void display_stats()
{
F32 fps_log_freq = gSavedSettings.getF32("FPSLogFrequency");
if (fps_log_freq > 0.f && gRecentFPSTime.getElapsedTimeF32() >= fps_log_freq)
{
F32 fps = gRecentFrameCount / fps_log_freq;
- llinfos << llformat("FPS: %.02f", fps) << llendl;
+ LL_INFOS() << llformat("FPS: %.02f", fps) << LL_ENDL;
gRecentFrameCount = 0;
gRecentFPSTime.reset();
}
F32 mem_log_freq = gSavedSettings.getF32("MemoryLogFrequency");
if (mem_log_freq > 0.f && gRecentMemoryTime.getElapsedTimeF32() >= mem_log_freq)
{
- gMemoryAllocated = LLMemory::getCurrentRSS();
- U32 memory = (U32)(gMemoryAllocated / (1024*1024));
- llinfos << llformat("MEMORY: %d MB", memory) << llendl;
+ gMemoryAllocated = (U64Bytes)LLMemory::getCurrentRSS();
+ U32Megabytes memory = gMemoryAllocated;
+ LL_INFOS() << llformat("MEMORY: %d MB", memory.value()) << LL_ENDL;
LLMemory::logMemoryInfo(TRUE) ;
gRecentMemoryTime.reset();
}
}
-static LLFastTimer::DeclareTimer FTM_PICK("Picking");
-static LLFastTimer::DeclareTimer FTM_RENDER("Render", true);
-static LLFastTimer::DeclareTimer FTM_UPDATE_SKY("Update Sky");
-static LLFastTimer::DeclareTimer FTM_UPDATE_TEXTURES("Update Textures");
-static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE("Update Images");
-static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_CLASS("Class");
-static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_BUMP("Image Update Bump");
-static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_LIST("List");
-static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_DELETE("Delete");
-static LLFastTimer::DeclareTimer FTM_RESIZE_WINDOW("Resize Window");
-static LLFastTimer::DeclareTimer FTM_HUD_UPDATE("HUD Update");
-static LLFastTimer::DeclareTimer FTM_DISPLAY_UPDATE_GEOM("Update Geom");
-static LLFastTimer::DeclareTimer FTM_TEXTURE_UNBIND("Texture Unbind");
-static LLFastTimer::DeclareTimer FTM_TELEPORT_DISPLAY("Teleport Display");
+static LLTrace::BlockTimerStatHandle FTM_PICK("Picking");
+static LLTrace::BlockTimerStatHandle FTM_RENDER("Render");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_SKY("Update Sky");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_DYNAMIC_TEXTURES("Update Dynamic Textures");
+static LLTrace::BlockTimerStatHandle FTM_IMAGE_UPDATE("Update Images");
+static LLTrace::BlockTimerStatHandle FTM_IMAGE_UPDATE_CLASS("Class");
+static LLTrace::BlockTimerStatHandle FTM_IMAGE_UPDATE_BUMP("Image Update Bump");
+static LLTrace::BlockTimerStatHandle FTM_IMAGE_UPDATE_LIST("List");
+static LLTrace::BlockTimerStatHandle FTM_IMAGE_UPDATE_DELETE("Delete");
+static LLTrace::BlockTimerStatHandle FTM_RESIZE_WINDOW("Resize Window");
+static LLTrace::BlockTimerStatHandle FTM_HUD_UPDATE("HUD Update");
+static LLTrace::BlockTimerStatHandle FTM_DISPLAY_UPDATE_GEOM("Update Geom");
+static LLTrace::BlockTimerStatHandle FTM_TEXTURE_UNBIND("Texture Unbind");
+static LLTrace::BlockTimerStatHandle FTM_TELEPORT_DISPLAY("Teleport Display");
// Paint the display!
void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
{
- LLFastTimer t(FTM_RENDER);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER);
if (gWindowResized)
{ //skip render on frames where window has been resized
- LLFastTimer t(FTM_RESIZE_WINDOW);
+ LL_RECORD_BLOCK_TIME(FTM_RESIZE_WINDOW);
gGL.flush();
glClear(GL_COLOR_BUFFER_BIT);
gViewerWindow->getWindow()->swapBuffers();
@@ -310,7 +314,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
gViewerWindow->checkSettings();
{
- LLFastTimer ftm(FTM_PICK);
+ LL_RECORD_BLOCK_TIME(FTM_PICK);
LLAppViewer::instance()->pingMainloopTimeout("Display:Pick");
gViewerWindow->performPick();
}
@@ -346,7 +350,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
// Bail out if we're in the startup state and don't want to try to
// render the world.
//
- if (LLStartUp::getStartupState() < STATE_STARTED)
+ if (LLStartUp::getStartupState() < STATE_PRECACHE)
{
LLAppViewer::instance()->pingMainloopTimeout("Display:Startup");
display_startup();
@@ -389,9 +393,10 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
if (gTeleportDisplay)
{
- LLFastTimer t(FTM_TELEPORT_DISPLAY);
+ LL_RECORD_BLOCK_TIME(FTM_TELEPORT_DISPLAY);
LLAppViewer::instance()->pingMainloopTimeout("Display:Teleport");
- const F32 TELEPORT_ARRIVAL_DELAY = 2.f; // Time to preload the world before raising the curtain after we've actually already arrived.
+ static LLCachedControl<F32> teleport_arrival_delay(gSavedSettings, "TeleportArrivalDelay");
+ static LLCachedControl<F32> teleport_local_delay(gSavedSettings, "TeleportLocalDelay");
S32 attach_count = 0;
if (isAgentAvatarValid())
@@ -459,7 +464,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
case LLAgent::TELEPORT_ARRIVING:
// Make the user wait while content "pre-caches"
{
- F32 arrival_fraction = (gTeleportArrivalTimer.getElapsedTimeF32() / TELEPORT_ARRIVAL_DELAY);
+ F32 arrival_fraction = (gTeleportArrivalTimer.getElapsedTimeF32() / teleport_arrival_delay());
if( arrival_fraction > 1.f )
{
arrival_fraction = 1.f;
@@ -476,7 +481,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
// Short delay when teleporting in the same sim (progress screen active but not shown - did not
// fall-through from TELEPORT_START)
{
- if( gTeleportDisplayTimer.getElapsedTimeF32() > TELEPORT_LOCAL_DELAY )
+ if( gTeleportDisplayTimer.getElapsedTimeF32() > teleport_local_delay() )
{
//LLFirstUse::useTeleport();
gAgent.setTeleportState( LLAgent::TELEPORT_NONE );
@@ -554,6 +559,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
{
LLAppViewer::instance()->pingMainloopTimeout("Display:Disconnected");
render_ui();
+ swap();
}
//////////////////////////
@@ -584,7 +590,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_DYNAMIC_TEXTURES))
{
LLAppViewer::instance()->pingMainloopTimeout("Display:DynamicTextures");
- LLFastTimer t(FTM_UPDATE_TEXTURES);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_DYNAMIC_TEXTURES);
if (LLViewerDynamicTexture::updateAllInstances())
{
gGL.setColorMask(true, true);
@@ -618,15 +624,15 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
// *TODO: merge these two methods
{
- LLFastTimer t(FTM_HUD_UPDATE);
+ LL_RECORD_BLOCK_TIME(FTM_HUD_UPDATE);
LLHUDManager::getInstance()->updateEffects();
LLHUDObject::updateAll();
stop_glerror();
}
{
- LLFastTimer t(FTM_DISPLAY_UPDATE_GEOM);
- const F32 max_geom_update_time = 0.005f*10.f*gFrameIntervalSeconds; // 50 ms/second update time
+ LL_RECORD_BLOCK_TIME(FTM_DISPLAY_UPDATE_GEOM);
+ const F32 max_geom_update_time = 0.005f*10.f*gFrameIntervalSeconds.value(); // 50 ms/second update time
gPipeline.createObjects(max_geom_update_time);
gPipeline.processPartitionQ();
gPipeline.updateGeom(max_geom_update_time);
@@ -764,29 +770,31 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
LLAppViewer::instance()->pingMainloopTimeout("Display:UpdateImages");
{
- LLFastTimer t(FTM_IMAGE_UPDATE);
+ LL_RECORD_BLOCK_TIME(FTM_IMAGE_UPDATE);
{
- LLFastTimer t(FTM_IMAGE_UPDATE_CLASS);
- LLViewerTexture::updateClass(LLViewerCamera::getInstance()->getVelocityStat()->getMean(),
- LLViewerCamera::getInstance()->getAngularVelocityStat()->getMean());
+ LL_RECORD_BLOCK_TIME(FTM_IMAGE_UPDATE_CLASS);
+ LLTrace::CountStatHandle<>* velocity_stat = LLViewerCamera::getVelocityStat();
+ LLTrace::CountStatHandle<>* angular_velocity_stat = LLViewerCamera::getAngularVelocityStat();
+ LLViewerTexture::updateClass(LLTrace::get_frame_recording().getPeriodMeanPerSec(*velocity_stat),
+ LLTrace::get_frame_recording().getPeriodMeanPerSec(*angular_velocity_stat));
}
{
- LLFastTimer t(FTM_IMAGE_UPDATE_BUMP);
+ LL_RECORD_BLOCK_TIME(FTM_IMAGE_UPDATE_BUMP);
gBumpImageList.updateImages(); // must be called before gTextureList version so that it's textures are thrown out first.
}
{
- LLFastTimer t(FTM_IMAGE_UPDATE_LIST);
- F32 max_image_decode_time = 0.050f*gFrameIntervalSeconds; // 50 ms/second decode time
+ LL_RECORD_BLOCK_TIME(FTM_IMAGE_UPDATE_LIST);
+ F32 max_image_decode_time = 0.050f*gFrameIntervalSeconds.value(); // 50 ms/second decode time
max_image_decode_time = llclamp(max_image_decode_time, 0.002f, 0.005f ); // min 2ms/frame, max 5ms/frame)
gTextureList.updateImages(max_image_decode_time);
}
/*{
- LLFastTimer t(FTM_IMAGE_UPDATE_DELETE);
+ LL_RECORD_BLOCK_TIME(FTM_IMAGE_UPDATE_DELETE);
//remove dead textures from GL
LLImageGL::deleteDeadTextures();
stop_glerror();
@@ -822,6 +830,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
}
}
+ LLSceneMonitor::getInstance()->fetchQueryResult();
+
LLGLState::checkStates();
LLGLState::checkClientArrays();
@@ -829,7 +839,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
{
LLAppViewer::instance()->pingMainloopTimeout("Display:Sky");
- LLFastTimer t(FTM_UPDATE_SKY);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_SKY);
gSky.updateSky();
}
@@ -961,7 +971,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
}
{
- LLFastTimer t(FTM_TEXTURE_UNBIND);
+ LL_RECORD_BLOCK_TIME(FTM_TEXTURE_UNBIND);
for (U32 i = 0; i < gGLManager.mNumTextureImageUnits; i++)
{ //dummy cleanup of any currently bound textures
if (gGL.getTexUnit(i)->getCurrType() != LLTexUnit::TT_NONE)
@@ -1009,11 +1019,17 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
LLPipeline::sUnderWaterRender = FALSE;
+ {
+ //capture the frame buffer.
+ LLSceneMonitor::getInstance()->capture();
+ }
+
LLAppViewer::instance()->pingMainloopTimeout("Display:RenderUI");
if (!for_snapshot)
{
- LLFastTimer t(FTM_RENDER_UI);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_UI);
render_ui();
+ swap();
}
@@ -1059,7 +1075,7 @@ void render_hud_attachments()
// clamp target zoom level to reasonable values
gAgentCamera.mHUDTargetZoom = llclamp(gAgentCamera.mHUDTargetZoom, 0.1f, 1.f);
// smoothly interpolate current zoom level
- gAgentCamera.mHUDCurZoom = lerp(gAgentCamera.mHUDCurZoom, gAgentCamera.mHUDTargetZoom, LLCriticalDamp::getInterpolant(0.03f));
+ gAgentCamera.mHUDCurZoom = lerp(gAgentCamera.mHUDCurZoom, gAgentCamera.mHUDTargetZoom, LLSmoothInterpolation::getInterpolant(0.03f));
if (LLPipeline::sShowHUDAttachments && !gDisconnected && setup_hud_matrices())
{
@@ -1237,8 +1253,6 @@ BOOL setup_hud_matrices(const LLRect& screen_region)
return TRUE;
}
-static LLFastTimer::DeclareTimer FTM_SWAP("Swap");
-
void render_ui(F32 zoom_factor, int subfield)
{
LLGLState::checkStates();
@@ -1252,6 +1266,15 @@ void render_ui(F32 zoom_factor, int subfield)
glh_set_current_modelview(glh_copy_matrix(gGLLastModelView));
}
+ if(LLSceneMonitor::getInstance()->needsUpdate())
+ {
+ gGL.pushMatrix();
+ gViewerWindow->setup2DRender();
+ LLSceneMonitor::getInstance()->compare();
+ gViewerWindow->setup3DRender();
+ gGL.popMatrix();
+ }
+
{
BOOL to_texture = gPipeline.canUseVertexShaders() &&
LLPipeline::sRenderGlow;
@@ -1275,7 +1298,7 @@ void render_ui(F32 zoom_factor, int subfield)
gGL.color4f(1,1,1,1);
if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
{
- LLFastTimer t(FTM_RENDER_UI);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_UI);
if (!gDisconnected)
{
@@ -1306,10 +1329,16 @@ void render_ui(F32 zoom_factor, int subfield)
glh_set_current_modelview(saved_view);
gGL.popMatrix();
}
+}
+
+static LLTrace::BlockTimerStatHandle FTM_SWAP("Swap");
+
+void swap()
+{
+ LL_RECORD_BLOCK_TIME(FTM_SWAP);
if (gDisplaySwapBuffers)
{
- LLFastTimer t(FTM_SWAP);
gViewerWindow->getWindow()->swapBuffers();
}
gDisplaySwapBuffers = TRUE;
@@ -1545,7 +1574,7 @@ void render_disconnected_background()
gGL.color4f(1,1,1,1);
if (!gDisconnectedImagep && gDisconnected)
{
- llinfos << "Loading last bitmap..." << llendl;
+ LL_INFOS() << "Loading last bitmap..." << LL_ENDL;
std::string temp_str;
temp_str = gDirUtilp->getLindenUserDir() + gDirUtilp->getDirDelimiter() + SCREEN_LAST_FILENAME;
@@ -1553,14 +1582,14 @@ void render_disconnected_background()
LLPointer<LLImageBMP> image_bmp = new LLImageBMP;
if( !image_bmp->load(temp_str) )
{
- //llinfos << "Bitmap load failed" << llendl;
+ //LL_INFOS() << "Bitmap load failed" << LL_ENDL;
return;
}
LLPointer<LLImageRaw> raw = new LLImageRaw;
if (!image_bmp->decode(raw, 0.0f))
{
- llinfos << "Bitmap decode failed" << llendl;
+ LL_INFOS() << "Bitmap decode failed" << LL_ENDL;
gDisconnectedImagep = NULL;
return;
}
diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp
index f81206ffec..e390e8776d 100755
--- a/indra/newview/llviewerdisplayname.cpp
+++ b/indra/newview/llviewerdisplayname.cpp
@@ -58,12 +58,12 @@ namespace LLViewerDisplayName
class LLSetDisplayNameResponder : public LLHTTPClient::Responder
{
-public:
+ LOG_CLASS(LLSetDisplayNameResponder);
+private:
// only care about errors
- /*virtual*/ void errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+ /*virtual*/ void httpFailure()
{
- llwarns << "LLSetDisplayNameResponder error [status:"
- << status << "]: " << content << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
LLViewerDisplayName::sSetDisplayNameSignal(false, "", LLSD());
LLViewerDisplayName::sSetDisplayNameSignal.disconnect_all_slots();
}
@@ -86,7 +86,7 @@ void LLViewerDisplayName::set(const std::string& display_name, const set_name_sl
// People API can return localized error messages. Indicate our
// language preference via header.
LLSD headers;
- headers["Accept-Language"] = LLUI::getLanguage();
+ headers[HTTP_OUT_HEADER_ACCEPT_LANGUAGE] = LLUI::getLanguage();
// People API requires both the old and new value to change a variable.
// Our display name will be in cache before the viewer's UI is available
@@ -103,7 +103,7 @@ void LLViewerDisplayName::set(const std::string& display_name, const set_name_sl
change_array.append(av_name.getDisplayName());
change_array.append(display_name);
- llinfos << "Set name POST to " << cap_url << llendl;
+ LL_INFOS() << "Set name POST to " << cap_url << LL_ENDL;
// Record our caller for when the server sends back a reply
sSetDisplayNameSignal.connect(slot);
@@ -128,16 +128,16 @@ public:
LLSD body = input["body"];
S32 status = body["status"].asInteger();
- bool success = (status == 200);
+ bool success = (status == HTTP_OK);
std::string reason = body["reason"].asString();
LLSD content = body["content"];
- llinfos << "status " << status << " reason " << reason << llendl;
+ LL_INFOS() << "status " << status << " reason " << reason << LL_ENDL;
// If viewer's concept of display name is out-of-date, the set request
// will fail with 409 Conflict. If that happens, fetch up-to-date
// name information.
- if (status == 409)
+ if (status == HTTP_CONFLICT)
{
LLUUID agent_id = gAgent.getID();
// Flush stale data
@@ -173,9 +173,9 @@ class LLDisplayNameUpdate : public LLHTTPNode
LLAvatarName av_name;
av_name.fromLLSD( name_data );
- llinfos << "name-update now " << LLDate::now()
+ LL_INFOS() << "name-update now " << LLDate::now()
<< " next_update " << LLDate(av_name.mNextUpdate)
- << llendl;
+ << LL_ENDL;
// Name expiration time may be provided in headers, or we may use a
// default value
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index a8eeddb798..e19fe9ca75 100755
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -28,47 +28,48 @@
#include "llviewerprecompiledheaders.h"
#include "llfloaterreg.h"
-
#include "llviewerfloaterreg.h"
-#include "llfloaterautoreplacesettings.h"
+
+#include "llcommandhandler.h"
#include "llcompilequeue.h"
#include "llfasttimerview.h"
#include "llfloaterabout.h"
#include "llfloaterauction.h"
+#include "llfloaterautoreplacesettings.h"
#include "llfloateravatar.h"
#include "llfloateravatarpicker.h"
#include "llfloateravatartextures.h"
+#include "llfloaterbigpreview.h"
#include "llfloaterbeacons.h"
#include "llfloaterbuildoptions.h"
+#include "llfloaterbulkpermission.h"
+#include "llfloaterbump.h"
#include "llfloaterbuy.h"
#include "llfloaterbuycontents.h"
#include "llfloaterbuycurrency.h"
#include "llfloaterbuycurrencyhtml.h"
#include "llfloaterbuyland.h"
-#include "llfloaterbulkpermission.h"
-#include "llfloaterbump.h"
#include "llfloaterbvhpreview.h"
#include "llfloatercamera.h"
#include "llfloaterchatvoicevolume.h"
#include "llfloaterconversationlog.h"
#include "llfloaterconversationpreview.h"
#include "llfloaterdeleteenvpreset.h"
+#include "llfloaterdestinations.h"
#include "llfloaterdisplayname.h"
#include "llfloatereditdaycycle.h"
#include "llfloatereditsky.h"
#include "llfloatereditwater.h"
#include "llfloaterenvironmentsettings.h"
#include "llfloaterevent.h"
-#include "llfloaterdestinations.h"
+#include "llfloaterfacebook.h"
+#include "llfloaterflickr.h"
#include "llfloaterfonttest.h"
#include "llfloatergesture.h"
#include "llfloatergodtools.h"
#include "llfloatergroups.h"
#include "llfloaterhardwaresettings.h"
#include "llfloaterhelpbrowser.h"
-#include "llfloaterwebcontent.h"
-#include "llfloaterwebprofile.h"
-#include "llfloatermediasettings.h"
#include "llfloaterhud.h"
#include "llfloaterimagepreview.h"
#include "llfloaterimsession.h"
@@ -79,15 +80,17 @@
#include "llfloaterland.h"
#include "llfloaterlandholdings.h"
#include "llfloatermap.h"
+#include "llfloatermediasettings.h"
#include "llfloatermemleak.h"
+#include "llfloatermodelpreview.h"
#include "llfloaternamedesc.h"
#include "llfloaternotificationsconsole.h"
#include "llfloaterobjectweights.h"
#include "llfloateropenobject.h"
#include "llfloateroutbox.h"
#include "llfloaterpathfindingcharacters.h"
-#include "llfloaterpathfindinglinksets.h"
#include "llfloaterpathfindingconsole.h"
+#include "llfloaterpathfindinglinksets.h"
#include "llfloaterpay.h"
#include "llfloaterperms.h"
#include "llfloaterpostprocess.h"
@@ -97,14 +100,15 @@
#include "llfloaterregioninfo.h"
#include "llfloaterregionrestarting.h"
#include "llfloaterreporter.h"
+#include "llfloatersceneloadstats.h"
#include "llfloaterscriptdebug.h"
+#include "llfloaterscriptedprefs.h"
#include "llfloaterscriptlimits.h"
#include "llfloatersearch.h"
#include "llfloatersellland.h"
#include "llfloatersettingsdebug.h"
#include "llfloatersidepanelcontainer.h"
#include "llfloatersnapshot.h"
-#include "llfloatersocial.h"
#include "llfloatersounddevices.h"
#include "llfloaterspellchecksettings.h"
#include "llfloatertelehub.h"
@@ -112,12 +116,15 @@
#include "llfloatertestlistview.h"
#include "llfloatertexturefetchdebugger.h"
#include "llfloatertools.h"
-#include "llfloatertos.h"
#include "llfloatertopobjects.h"
+#include "llfloatertos.h"
#include "llfloatertoybox.h"
#include "llfloatertranslationsettings.h"
+#include "llfloatertwitter.h"
#include "llfloateruipreview.h"
#include "llfloatervoiceeffect.h"
+#include "llfloaterwebcontent.h"
+#include "llfloaterwebprofile.h"
#include "llfloatervoicevolume.h"
#include "llfloaterwhitelistentry.h"
#include "llfloaterwindowsize.h"
@@ -138,10 +145,8 @@
#include "llpreviewscript.h"
#include "llpreviewsound.h"
#include "llpreviewtexture.h"
-#include "llsyswellwindow.h"
#include "llscriptfloater.h"
-#include "llfloatermodelpreview.h"
-#include "llcommandhandler.h"
+#include "llsyswellwindow.h"
// *NOTE: Please add files in alphabetical order to keep merges easy.
@@ -174,7 +179,7 @@ void LLViewerFloaterReg::registerFloaters()
// *NOTE: Please keep these alphabetized for easier merges
LLFloaterAboutUtil::registerFloater();
- LLFloaterReg::add("fast_timers", "floater_fast_timers.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFastTimerView>);
+ LLFloaterReg::add("block_timers", "floater_fast_timers.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFastTimerView>);
LLFloaterReg::add("about_land", "floater_about_land.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLand>);
LLFloaterReg::add("appearance", "floater_my_appearance.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>);
LLFloaterReg::add("auction", "floater_auction.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAuction>);
@@ -262,6 +267,7 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("pathfinding_linksets", "floater_pathfinding_linksets.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPathfindingLinksets>);
LLFloaterReg::add("pathfinding_console", "floater_pathfinding_console.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPathfindingConsole>);
LLFloaterReg::add("people", "floater_people.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>);
+ LLFloaterReg::add("perms_default", "floater_perms_default.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPermsDefault>);
LLFloaterReg::add("places", "floater_places.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>);
LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreference>);
LLFloaterReg::add("prefs_proxy", "floater_preferences_proxy.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreferenceProxy>);
@@ -270,7 +276,6 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("prefs_translation", "floater_translation_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTranslationSettings>);
LLFloaterReg::add("prefs_spellchecker", "floater_spellcheck.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSpellCheckerSettings>);
LLFloaterReg::add("prefs_autoreplace", "floater_autoreplace.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAutoReplaceSettings>);
- LLFloaterReg::add("perm_prefs", "floater_perm_prefs.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPerms>);
LLFloaterReg::add("picks", "floater_picks.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>);
LLFloaterReg::add("pref_joystick", "floater_joystick.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterJoystick>);
LLFloaterReg::add("preview_anim", "floater_preview_animation.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLPreviewAnim>, "preview");
@@ -283,6 +288,7 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("preview_texture", "floater_preview_texture.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLPreviewTexture>, "preview");
LLFloaterReg::add("properties", "floater_inventory_item_properties.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterProperties>);
LLFloaterReg::add("publish_classified", "floater_publish_classified.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLPublishClassifiedFloater>);
+ LLFloaterReg::add("script_colors", "floater_script_ed_prefs.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterScriptEdPrefs>);
LLFloaterReg::add("telehubs", "floater_telehub.xml",&LLFloaterReg::build<LLFloaterTelehub>);
LLFloaterReg::add("test_inspectors", "floater_test_inspectors.xml", &LLFloaterReg::build<LLFloaterTestInspectors>);
@@ -306,16 +312,24 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("sell_land", "floater_sell_land.xml", &LLFloaterSellLand::buildFloater);
LLFloaterReg::add("settings_debug", "floater_settings_debug.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSettingsDebug>);
LLFloaterReg::add("sound_devices", "floater_sound_devices.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSoundDevices>);
- LLFloaterReg::add("social", "floater_social.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSocial>);
LLFloaterReg::add("stats", "floater_stats.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloater>);
LLFloaterReg::add("start_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterRunQueue>);
+ LLFloaterReg::add("scene_load_stats", "floater_scene_load_stats.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSceneLoadStats>);
LLFloaterReg::add("stop_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotRunQueue>);
LLFloaterReg::add("snapshot", "floater_snapshot.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSnapshot>);
LLFloaterReg::add("search", "floater_search.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSearch>);
LLFloaterReg::add("my_profile", "floater_my_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebProfile::create);
LLFloaterReg::add("profile", "floater_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebProfile::create);
- LLFloaterReg::add("how_to", "floater_how_to.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create);
+ LLFloaterReg::add("how_to", "floater_how_to.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create);
+
LLFloaterReg::add("fbc_web", "floater_fbc_web.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create);
+ LLFloaterReg::add("flickr_web", "floater_fbc_web.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create);
+ LLFloaterReg::add("twitter_web", "floater_fbc_web.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create);
+
+ LLFloaterReg::add("facebook", "floater_facebook.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterFacebook>);
+ LLFloaterReg::add("flickr", "floater_flickr.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterFlickr>);
+ LLFloaterReg::add("twitter", "floater_twitter.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTwitter>);
+ LLFloaterReg::add("big_preview", "floater_big_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBigPreview>);
LLFloaterUIPreviewUtil::registerFloater();
LLFloaterReg::add("upload_anim_bvh", "floater_animation_bvh_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBvhPreview>, "upload");
diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp
index 991f6b40e6..0401de7e69 100644
--- a/indra/newview/llviewerfoldertype.cpp
+++ b/indra/newview/llviewerfoldertype.cpp
@@ -136,21 +136,17 @@ LLViewerFolderDictionary::LLViewerFolderDictionary()
addEntry(LLFolderType::FT_MESH, new ViewerFolderEntry("Meshes", "Inv_SysOpen", "Inv_SysClosed", FALSE, true));
bool boxes_invisible = !gSavedSettings.getBOOL("InventoryOutboxMakeVisible");
- addEntry(LLFolderType::FT_INBOX, new ViewerFolderEntry("Inbox", "Inv_SysOpen", "Inv_SysClosed", FALSE, boxes_invisible));
+ addEntry(LLFolderType::FT_INBOX, new ViewerFolderEntry("Received Items", "Inv_SysOpen", "Inv_SysClosed", FALSE, boxes_invisible));
addEntry(LLFolderType::FT_OUTBOX, new ViewerFolderEntry("Merchant Outbox", "Inv_SysOpen", "Inv_SysClosed", FALSE, boxes_invisible));
addEntry(LLFolderType::FT_BASIC_ROOT, new ViewerFolderEntry("Basic Root", "Inv_SysOpen", "Inv_SysClosed", FALSE, true));
addEntry(LLFolderType::FT_NONE, new ViewerFolderEntry("New Folder", "Inv_FolderOpen", "Inv_FolderClosed", FALSE, false, "default"));
-#if SUPPORT_ENSEMBLES
- initEnsemblesFromFile();
-#else
for (U32 type = (U32)LLFolderType::FT_ENSEMBLE_START; type <= (U32)LLFolderType::FT_ENSEMBLE_END; ++type)
{
addEntry((LLFolderType::EType)type, new ViewerFolderEntry("New Folder", "Inv_FolderOpen", "Inv_FolderClosed", FALSE, false));
- }
-#endif
+ }
}
bool LLViewerFolderDictionary::initEnsemblesFromFile()
@@ -159,7 +155,7 @@ bool LLViewerFolderDictionary::initEnsemblesFromFile()
LLXmlTree folder_def;
if (!folder_def.parseFile(xml_filename))
{
- llerrs << "Failed to parse folders file " << xml_filename << llendl;
+ LL_ERRS() << "Failed to parse folders file " << xml_filename << LL_ENDL;
return false;
}
@@ -170,7 +166,7 @@ bool LLViewerFolderDictionary::initEnsemblesFromFile()
{
if (!ensemble->hasName("ensemble"))
{
- llwarns << "Invalid ensemble definition node " << ensemble->getName() << llendl;
+ LL_WARNS() << "Invalid ensemble definition node " << ensemble->getName() << LL_ENDL;
continue;
}
@@ -178,14 +174,14 @@ bool LLViewerFolderDictionary::initEnsemblesFromFile()
static LLStdStringHandle ensemble_num_string = LLXmlTree::addAttributeString("foldertype_num");
if (!ensemble->getFastAttributeS32(ensemble_num_string, ensemble_type))
{
- llwarns << "No ensemble type defined" << llendl;
+ LL_WARNS() << "No ensemble type defined" << LL_ENDL;
continue;
}
if (ensemble_type < S32(LLFolderType::FT_ENSEMBLE_START) || ensemble_type > S32(LLFolderType::FT_ENSEMBLE_END))
{
- llwarns << "Exceeded maximum ensemble index" << LLFolderType::FT_ENSEMBLE_END << llendl;
+ LL_WARNS() << "Exceeded maximum ensemble index" << LLFolderType::FT_ENSEMBLE_END << LL_ENDL;
break;
}
@@ -193,7 +189,7 @@ bool LLViewerFolderDictionary::initEnsemblesFromFile()
static LLStdStringHandle xui_name_string = LLXmlTree::addAttributeString("xui_name");
if (!ensemble->getFastAttributeString(xui_name_string, xui_name))
{
- llwarns << "No xui name defined" << llendl;
+ LL_WARNS() << "No xui name defined" << LL_ENDL;
continue;
}
@@ -201,7 +197,7 @@ bool LLViewerFolderDictionary::initEnsemblesFromFile()
static LLStdStringHandle icon_name_string = LLXmlTree::addAttributeString("icon_name");
if (!ensemble->getFastAttributeString(icon_name_string, icon_name))
{
- llwarns << "No ensemble icon name defined" << llendl;
+ LL_WARNS() << "No ensemble icon name defined" << LL_ENDL;
continue;
}
diff --git a/indra/newview/llviewergenericmessage.cpp b/indra/newview/llviewergenericmessage.cpp
index f8a2be14d4..3df53a4a30 100755
--- a/indra/newview/llviewergenericmessage.cpp
+++ b/indra/newview/llviewergenericmessage.cpp
@@ -78,7 +78,7 @@ void process_generic_message(LLMessageSystem* msg, void**)
msg->getUUID("AgentData", "AgentID", agent_id);
if (agent_id != gAgent.getID())
{
- llwarns << "GenericMessage for wrong agent" << llendl;
+ LL_WARNS() << "GenericMessage for wrong agent" << LL_ENDL;
return;
}
@@ -89,7 +89,7 @@ void process_generic_message(LLMessageSystem* msg, void**)
if(!gGenericDispatcher.dispatch(request, invoice, strings))
{
- llwarns << "GenericMessage " << request << " failed to dispatch"
- << llendl;
+ LL_WARNS() << "GenericMessage " << request << " failed to dispatch"
+ << LL_ENDL;
}
}
diff --git a/indra/newview/llviewergesture.cpp b/indra/newview/llviewergesture.cpp
index 3f35a5001d..f30279d1e9 100755
--- a/indra/newview/llviewergesture.cpp
+++ b/indra/newview/llviewergesture.cpp
@@ -194,13 +194,13 @@ void LLViewerGestureList::xferCallback(void *data, S32 size, void** /*user_data*
if (end - buffer > size)
{
- llerrs << "Read off of end of array, error in serialization" << llendl;
+ LL_ERRS() << "Read off of end of array, error in serialization" << LL_ENDL;
}
gGestureList.mIsLoaded = TRUE;
}
else
{
- llwarns << "Unable to load gesture list!" << llendl;
+ LL_WARNS() << "Unable to load gesture list!" << LL_ENDL;
}
}
diff --git a/indra/newview/llviewergesture.h b/indra/newview/llviewergesture.h
index 8dba10226b..8b621850ea 100755
--- a/indra/newview/llviewergesture.h
+++ b/indra/newview/llviewergesture.h
@@ -30,7 +30,6 @@
#include "llanimationstates.h"
#include "lluuid.h"
#include "llstring.h"
-#include "lldarray.h"
#include "llgesture.h"
class LLMessageSystem;
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index fff9821e86..4e4c3471be 100755
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -31,6 +31,7 @@
#include "llsdserialize.h"
#include "message.h"
+#include "llaisapi.h"
#include "llagent.h"
#include "llagentcamera.h"
#include "llagentwearables.h"
@@ -65,9 +66,13 @@
#include "llavataractions.h"
#include "lllogininstance.h"
#include "llfavoritesbar.h"
+#include "llfloaterperms.h"
+#include "llclipboard.h"
+#include "llhttpretrypolicy.h"
-// Two do-nothing ops for use in callbacks.
+// do-nothing ops for use in callbacks.
void no_op_inventory_func(const LLUUID&) {}
+void no_op_llsd_func(const LLSD&) {}
void no_op() {}
///----------------------------------------------------------------------------
@@ -256,7 +261,6 @@ public:
};
LLInventoryHandler gInventoryHandler;
-
///----------------------------------------------------------------------------
/// Class LLViewerInventoryItem
///----------------------------------------------------------------------------
@@ -303,8 +307,8 @@ LLViewerInventoryItem::LLViewerInventoryItem(const LLViewerInventoryItem* other)
copyViewerItem(other);
if (!mIsComplete)
{
- llwarns << "LLViewerInventoryItem copy constructor for incomplete item"
- << mUUID << llendl;
+ LL_WARNS() << "LLViewerInventoryItem copy constructor for incomplete item"
+ << mUUID << LL_ENDL;
}
}
@@ -345,39 +349,22 @@ void LLViewerInventoryItem::cloneViewerItem(LLPointer<LLViewerInventoryItem>& ne
}
}
-void LLViewerInventoryItem::removeFromServer()
-{
- lldebugs << "Removing inventory item " << mUUID << " from server."
- << llendl;
-
- LLInventoryModel::LLCategoryUpdate up(mParentUUID, -1);
- gInventory.accountForUpdate(up);
-
- LLMessageSystem* msg = gMessageSystem;
- msg->newMessageFast(_PREHASH_RemoveInventoryItem);
- msg->nextBlockFast(_PREHASH_AgentData);
- msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
- msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
- msg->nextBlockFast(_PREHASH_InventoryData);
- msg->addUUIDFast(_PREHASH_ItemID, mUUID);
- gAgent.sendReliableMessage();
-}
-
void LLViewerInventoryItem::updateServer(BOOL is_new) const
{
if(!mIsComplete)
{
// *FIX: deal with this better.
// If we're crashing here then the UI is incorrectly enabled.
- llerrs << "LLViewerInventoryItem::updateServer() - for incomplete item"
- << llendl;
+ LL_ERRS() << "LLViewerInventoryItem::updateServer() - for incomplete item"
+ << LL_ENDL;
return;
}
if(gAgent.getID() != mPermissions.getOwner())
{
// *FIX: deal with this better.
- llwarns << "LLViewerInventoryItem::updateServer() - for unowned item"
- << llendl;
+ LL_WARNS() << "LLViewerInventoryItem::updateServer() - for unowned item "
+ << ll_pretty_print_sd(this->asLLSD())
+ << LL_ENDL;
return;
}
LLInventoryModel::LLCategoryUpdate up(mParentUUID, is_new ? 1 : 0);
@@ -416,7 +403,7 @@ void LLViewerInventoryItem::fetchFromServer(void) const
}
else
{
- llwarns << "Agent Region is absent" << llendl;
+ LL_WARNS() << "Agent Region is absent" << LL_ENDL;
}
if (!url.empty())
@@ -444,7 +431,7 @@ void LLViewerInventoryItem::fetchFromServer(void) const
}
// virtual
-BOOL LLViewerInventoryItem::unpackMessage(LLSD item)
+BOOL LLViewerInventoryItem::unpackMessage(const LLSD& item)
{
BOOL rv = LLInventoryItem::fromLLSD(item);
@@ -469,7 +456,7 @@ void LLViewerInventoryItem::setTransactionID(const LLTransactionID& transaction_
{
mTransactionID = transaction_id;
}
-// virtual
+
void LLViewerInventoryItem::packMessage(LLMessageSystem* msg) const
{
msg->addUUIDFast(_PREHASH_ItemID, mUUID);
@@ -488,6 +475,7 @@ void LLViewerInventoryItem::packMessage(LLMessageSystem* msg) const
U32 crc = getCRC32();
msg->addU32Fast(_PREHASH_CRC, crc);
}
+
// virtual
BOOL LLViewerInventoryItem::importFile(LLFILE* fp)
{
@@ -599,6 +587,15 @@ void LLViewerInventoryCategory::copyViewerCategory(const LLViewerInventoryCatego
}
+void LLViewerInventoryCategory::packMessage(LLMessageSystem* msg) const
+{
+ msg->addUUIDFast(_PREHASH_FolderID, mUUID);
+ msg->addUUIDFast(_PREHASH_ParentID, mParentUUID);
+ S8 type = static_cast<S8>(mPreferredType);
+ msg->addS8Fast(_PREHASH_Type, type);
+ msg->addStringFast(_PREHASH_Name, mName);
+}
+
void LLViewerInventoryCategory::updateParentOnServer(BOOL restamp) const
{
LLMessageSystem* msg = gMessageSystem;
@@ -637,30 +634,6 @@ void LLViewerInventoryCategory::updateServer(BOOL is_new) const
gAgent.sendReliableMessage();
}
-void LLViewerInventoryCategory::removeFromServer( void )
-{
- llinfos << "Removing inventory category " << mUUID << " from server."
- << llendl;
- // communicate that change with the server.
- if(LLFolderType::lookupIsProtectedType(mPreferredType))
- {
- LLNotificationsUtil::add("CannotRemoveProtectedCategories");
- return;
- }
-
- LLInventoryModel::LLCategoryUpdate up(mParentUUID, -1);
- gInventory.accountForUpdate(up);
-
- LLMessageSystem* msg = gMessageSystem;
- msg->newMessageFast(_PREHASH_RemoveInventoryFolder);
- msg->nextBlockFast(_PREHASH_AgentData);
- msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
- msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
- msg->nextBlockFast(_PREHASH_FolderData);
- msg->addUUIDFast(_PREHASH_FolderID, mUUID);
- gAgent.sendReliableMessage();
-}
-
S32 LLViewerInventoryCategory::getVersion() const
{
return mVersion;
@@ -701,7 +674,7 @@ bool LLViewerInventoryCategory::fetch()
}
else
{
- llwarns << "agent region is null" << llendl;
+ LL_WARNS() << "agent region is null" << LL_ENDL;
}
if (!url.empty()) //Capability found. Build up LLSD and use it.
{
@@ -709,7 +682,7 @@ bool LLViewerInventoryCategory::fetch()
}
else
{ //Deprecated, but if we don't have a capability, use the old system.
- llinfos << "FetchInventoryDescendents2 capability not found. Using deprecated UDP message." << llendl;
+ LL_INFOS() << "FetchInventoryDescendents2 capability not found. Using deprecated UDP message." << LL_ENDL;
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("FetchInventoryDescendents");
msg->nextBlock("AgentData");
@@ -729,6 +702,19 @@ bool LLViewerInventoryCategory::fetch()
return false;
}
+S32 LLViewerInventoryCategory::getViewerDescendentCount() const
+{
+ LLInventoryModel::cat_array_t* cats;
+ LLInventoryModel::item_array_t* items;
+ gInventory.getDirectDescendentsOf(getUUID(), cats, items);
+ S32 descendents_actual = 0;
+ if(cats && items)
+ {
+ descendents_actual = cats->size() + items->size();
+ }
+ return descendents_actual;
+}
+
bool LLViewerInventoryCategory::importFileLocal(LLFILE* fp)
{
// *NOTE: This buffer size is hard coded into scanf() below.
@@ -791,8 +777,8 @@ bool LLViewerInventoryCategory::importFileLocal(LLFILE* fp)
}
else
{
- llwarns << "unknown keyword '" << keyword
- << "' in inventory import category " << mUUID << llendl;
+ LL_WARNS() << "unknown keyword '" << keyword
+ << "' in inventory import category " << mUUID << LL_ENDL;
}
}
return true;
@@ -894,6 +880,21 @@ void LLViewerInventoryCategory::localizeName()
LLLocalizedInventoryItemsDictionary::getInstance()->localizeInventoryObjectName(mName);
}
+// virtual
+BOOL LLViewerInventoryCategory::unpackMessage(const LLSD& category)
+{
+ BOOL rv = LLInventoryCategory::fromLLSD(category);
+ localizeName();
+ return rv;
+}
+
+// virtual
+void LLViewerInventoryCategory::unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num)
+{
+ LLInventoryCategory::unpackMessage(msg, block, block_num);
+ localizeName();
+}
+
///----------------------------------------------------------------------------
/// Local function definitions
///----------------------------------------------------------------------------
@@ -905,7 +906,7 @@ LLInventoryCallbackManager::LLInventoryCallbackManager() :
{
if( sInstance != NULL )
{
- llwarns << "LLInventoryCallbackManager::LLInventoryCallbackManager: unexpected multiple instances" << llendl;
+ LL_WARNS() << "LLInventoryCallbackManager::LLInventoryCallbackManager: unexpected multiple instances" << LL_ENDL;
return;
}
sInstance = this;
@@ -915,7 +916,7 @@ LLInventoryCallbackManager::~LLInventoryCallbackManager()
{
if( sInstance != this )
{
- llwarns << "LLInventoryCallbackManager::~LLInventoryCallbackManager: unexpected multiple instances" << llendl;
+ LL_WARNS() << "LLInventoryCallbackManager::~LLInventoryCallbackManager: unexpected multiple instances" << LL_ENDL;
return;
}
sInstance = NULL;
@@ -989,24 +990,73 @@ void activate_gesture_cb(const LLUUID& inv_item)
LLGestureMgr::instance().activateGesture(inv_item);
}
-void create_gesture_cb(const LLUUID& inv_item)
+void create_script_cb(const LLUUID& inv_item)
{
- if (inv_item.isNull())
- return;
+ if (!inv_item.isNull())
+ {
+ LLViewerInventoryItem* item = gInventory.getItem(inv_item);
+ if (item)
+ {
+ LLPermissions perm = item->getPermissions();
+ perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Scripts"));
+ perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Scripts"));
- LLGestureMgr::instance().activateGesture(inv_item);
+ item->setPermissions(perm);
+
+ item->updateServer(FALSE);
+ gInventory.updateItem(item);
+ gInventory.notifyObservers();
+ }
+ }
+}
+
+void create_gesture_cb(const LLUUID& inv_item)
+{
+ if (!inv_item.isNull())
+ {
+ LLGestureMgr::instance().activateGesture(inv_item);
- LLViewerInventoryItem* item = gInventory.getItem(inv_item);
- if (!item) return;
- gInventory.updateItem(item);
- gInventory.notifyObservers();
+ LLViewerInventoryItem* item = gInventory.getItem(inv_item);
+ if (item)
+ {
+ LLPermissions perm = item->getPermissions();
+ perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Gestures"));
+ perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Gestures"));
+
+ item->setPermissions(perm);
+
+ item->updateServer(FALSE);
+ gInventory.updateItem(item);
+ gInventory.notifyObservers();
- LLPreviewGesture* preview = LLPreviewGesture::show(inv_item, LLUUID::null);
- // Force to be entirely onscreen.
- gFloaterView->adjustToFitScreen(preview, FALSE);
+ LLPreviewGesture* preview = LLPreviewGesture::show(inv_item, LLUUID::null);
+ // Force to be entirely onscreen.
+ gFloaterView->adjustToFitScreen(preview, FALSE);
+ }
+ }
}
+void create_notecard_cb(const LLUUID& inv_item)
+{
+ if (!inv_item.isNull())
+ {
+ LLViewerInventoryItem* item = gInventory.getItem(inv_item);
+ if (item)
+ {
+ LLPermissions perm = item->getPermissions();
+ perm.setMaskEveryone(LLFloaterPerms::getEveryonePerms("Notecards"));
+ perm.setMaskGroup(LLFloaterPerms::getGroupPerms("Notecards"));
+
+ item->setPermissions(perm);
+
+ item->updateServer(FALSE);
+ gInventory.updateItem(item);
+ gInventory.notifyObservers();
+ }
+ }
+}
+
LLInventoryCallbackManager gInventoryCallbacks;
void create_inventory_item(const LLUUID& agent_id, const LLUUID& session_id,
@@ -1087,75 +1137,148 @@ void copy_inventory_item(
gAgent.sendReliableMessage();
}
-void link_inventory_item(
- const LLUUID& agent_id,
- const LLUUID& item_id,
- const LLUUID& parent_id,
- const std::string& new_name,
- const std::string& new_description,
- const LLAssetType::EType asset_type,
- LLPointer<LLInventoryCallback> cb)
+// Create link to single inventory object.
+void link_inventory_object(const LLUUID& category,
+ LLConstPointer<LLInventoryObject> baseobj,
+ LLPointer<LLInventoryCallback> cb)
{
- const LLInventoryObject *baseobj = gInventory.getObject(item_id);
if (!baseobj)
{
- llwarns << "attempt to link to unknown item, linked-to-item's itemID " << item_id << llendl;
- return;
- }
- if (baseobj && baseobj->getIsLinkType())
- {
- llwarns << "attempt to create a link to a link, linked-to-item's itemID " << item_id << llendl;
+ LL_WARNS() << "Attempt to link to non-existent object" << LL_ENDL;
return;
}
- if (baseobj && !LLAssetType::lookupCanLink(baseobj->getType()))
- {
- // Fail if item can be found but is of a type that can't be linked.
- // Arguably should fail if the item can't be found too, but that could
- // be a larger behavioral change.
- llwarns << "attempt to link an unlinkable item, type = " << baseobj->getActualType() << llendl;
- return;
- }
-
- LLUUID transaction_id;
- LLInventoryType::EType inv_type = LLInventoryType::IT_NONE;
- if (dynamic_cast<const LLInventoryCategory *>(baseobj))
- {
- inv_type = LLInventoryType::IT_CATEGORY;
- }
- else
+ LLInventoryObject::const_object_list_t obj_array;
+ obj_array.push_back(baseobj);
+ link_inventory_array(category, obj_array, cb);
+}
+
+void link_inventory_object(const LLUUID& category,
+ const LLUUID& id,
+ LLPointer<LLInventoryCallback> cb)
+{
+ LLConstPointer<LLInventoryObject> baseobj = gInventory.getObject(id);
+ link_inventory_object(category, baseobj, cb);
+}
+
+// Create links to all listed inventory objects.
+void link_inventory_array(const LLUUID& category,
+ LLInventoryObject::const_object_list_t& baseobj_array,
+ LLPointer<LLInventoryCallback> cb)
+{
+#ifndef LL_RELEASE_FOR_DOWNLOAD
+ const LLViewerInventoryCategory *cat = gInventory.getCategory(category);
+ const std::string cat_name = cat ? cat->getName() : "CAT NOT FOUND";
+#endif
+ LLInventoryObject::const_object_list_t::const_iterator it = baseobj_array.begin();
+ LLInventoryObject::const_object_list_t::const_iterator end = baseobj_array.end();
+ LLSD links = LLSD::emptyArray();
+ for (; it != end; ++it)
{
- const LLViewerInventoryItem *baseitem = dynamic_cast<const LLViewerInventoryItem *>(baseobj);
- if (baseitem)
+ const LLInventoryObject* baseobj = *it;
+ if (!baseobj)
{
- inv_type = baseitem->getInventoryType();
+ LL_WARNS() << "attempt to link to unknown object" << LL_ENDL;
+ continue;
}
- }
-#if 1 // debugging stuff
- LLViewerInventoryCategory* cat = gInventory.getCategory(parent_id);
- lldebugs << "cat: " << cat << llendl;
-
+ if (!LLAssetType::lookupCanLink(baseobj->getType()))
+ {
+ // Fail if item can be found but is of a type that can't be linked.
+ // Arguably should fail if the item can't be found too, but that could
+ // be a larger behavioral change.
+ LL_WARNS() << "attempt to link an unlinkable object, type = " << baseobj->getActualType() << LL_ENDL;
+ continue;
+ }
+
+ LLInventoryType::EType inv_type = LLInventoryType::IT_NONE;
+ LLAssetType::EType asset_type = LLAssetType::AT_NONE;
+ std::string new_desc;
+ LLUUID linkee_id;
+ if (dynamic_cast<const LLInventoryCategory *>(baseobj))
+ {
+ inv_type = LLInventoryType::IT_CATEGORY;
+ asset_type = LLAssetType::AT_LINK_FOLDER;
+ linkee_id = baseobj->getUUID();
+ }
+ else
+ {
+ const LLViewerInventoryItem *baseitem = dynamic_cast<const LLViewerInventoryItem *>(baseobj);
+ if (baseitem)
+ {
+ inv_type = baseitem->getInventoryType();
+ new_desc = baseitem->getActualDescription();
+ switch (baseitem->getActualType())
+ {
+ case LLAssetType::AT_LINK:
+ case LLAssetType::AT_LINK_FOLDER:
+ linkee_id = baseobj->getLinkedUUID();
+ asset_type = baseitem->getActualType();
+ break;
+ default:
+ linkee_id = baseobj->getUUID();
+ asset_type = LLAssetType::AT_LINK;
+ break;
+ }
+ }
+ else
+ {
+ LL_WARNS() << "could not convert object into an item or category: " << baseobj->getUUID() << LL_ENDL;
+ continue;
+ }
+ }
+
+ LLSD link = LLSD::emptyMap();
+ link["linked_id"] = linkee_id;
+ link["type"] = (S8)asset_type;
+ link["inv_type"] = (S8)inv_type;
+ link["name"] = baseobj->getName();
+ link["desc"] = new_desc;
+ links.append(link);
+
+#ifndef LL_RELEASE_FOR_DOWNLOAD
+ LL_DEBUGS("Inventory") << "Linking Object [ name:" << baseobj->getName()
+ << " UUID:" << baseobj->getUUID()
+ << " ] into Category [ name:" << cat_name
+ << " UUID:" << category << " ] " << LL_ENDL;
#endif
- LLMessageSystem* msg = gMessageSystem;
- msg->newMessageFast(_PREHASH_LinkInventoryItem);
- msg->nextBlock(_PREHASH_AgentData);
+ }
+
+ bool ais_ran = false;
+ if (AISCommand::isAPIAvailable())
{
- msg->addUUIDFast(_PREHASH_AgentID, agent_id);
- msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
+ LLSD new_inventory = LLSD::emptyMap();
+ new_inventory["links"] = links;
+ LLPointer<AISCommand> cmd_ptr = new CreateInventoryCommand(category, new_inventory, cb);
+ ais_ran = cmd_ptr->run_command();
}
- msg->nextBlock(_PREHASH_InventoryBlock);
+
+ if (!ais_ran)
{
- msg->addU32Fast(_PREHASH_CallbackID, gInventoryCallbacks.registerCB(cb));
- msg->addUUIDFast(_PREHASH_FolderID, parent_id);
- msg->addUUIDFast(_PREHASH_TransactionID, transaction_id);
- msg->addUUIDFast(_PREHASH_OldItemID, item_id);
- msg->addS8Fast(_PREHASH_Type, (S8)asset_type);
- msg->addS8Fast(_PREHASH_InvType, (S8)inv_type);
- msg->addStringFast(_PREHASH_Name, new_name);
- msg->addStringFast(_PREHASH_Description, new_description);
+ LLMessageSystem* msg = gMessageSystem;
+ for (LLSD::array_iterator iter = links.beginArray(); iter != links.endArray(); ++iter )
+ {
+ msg->newMessageFast(_PREHASH_LinkInventoryItem);
+ msg->nextBlock(_PREHASH_AgentData);
+ {
+ msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
+ msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
+ }
+ msg->nextBlock(_PREHASH_InventoryBlock);
+ {
+ LLSD link = (*iter);
+ msg->addU32Fast(_PREHASH_CallbackID, gInventoryCallbacks.registerCB(cb));
+ msg->addUUIDFast(_PREHASH_FolderID, category);
+ msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null);
+ msg->addUUIDFast(_PREHASH_OldItemID, link["linked_id"].asUUID());
+ msg->addS8Fast(_PREHASH_Type, link["type"].asInteger());
+ msg->addS8Fast(_PREHASH_InvType, link["inv_type"].asInteger());
+ msg->addStringFast(_PREHASH_Name, link["name"].asString());
+ msg->addStringFast(_PREHASH_Description, link["desc"].asString());
+ }
+ gAgent.sendReliableMessage();
+ }
}
- gAgent.sendReliableMessage();
}
void move_inventory_item(
@@ -1179,6 +1302,392 @@ void move_inventory_item(
gAgent.sendReliableMessage();
}
+// Should call this with an update_item that's been copied and
+// modified from an original source item, rather than modifying the
+// source item directly.
+void update_inventory_item(
+ LLViewerInventoryItem *update_item,
+ LLPointer<LLInventoryCallback> cb)
+{
+ const LLUUID& item_id = update_item->getUUID();
+ bool ais_ran = false;
+ if (AISCommand::isAPIAvailable())
+ {
+ LLSD updates = update_item->asLLSD();
+ // Replace asset_id and/or shadow_id with transaction_id (hash_id)
+ if (updates.has("asset_id"))
+ {
+ updates.erase("asset_id");
+ updates["hash_id"] = update_item->getTransactionID();
+ }
+ if (updates.has("shadow_id"))
+ {
+ updates.erase("shadow_id");
+ updates["hash_id"] = update_item->getTransactionID();
+ }
+ LLPointer<AISCommand> cmd_ptr = new UpdateItemCommand(item_id, updates, cb);
+ ais_ran = cmd_ptr->run_command();
+ }
+ if (!ais_ran)
+ {
+ LLPointer<LLViewerInventoryItem> obj = gInventory.getItem(item_id);
+ LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (update_item ? update_item->getName() : "(NOT FOUND)") << LL_ENDL;
+ if(obj)
+ {
+ LLMessageSystem* msg = gMessageSystem;
+ msg->newMessageFast(_PREHASH_UpdateInventoryItem);
+ msg->nextBlockFast(_PREHASH_AgentData);
+ msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
+ msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
+ msg->addUUIDFast(_PREHASH_TransactionID, update_item->getTransactionID());
+ msg->nextBlockFast(_PREHASH_InventoryData);
+ msg->addU32Fast(_PREHASH_CallbackID, 0);
+ update_item->packMessage(msg);
+ gAgent.sendReliableMessage();
+
+ LLInventoryModel::LLCategoryUpdate up(update_item->getParentUUID(), 0);
+ gInventory.accountForUpdate(up);
+ gInventory.updateItem(update_item);
+ if (cb)
+ {
+ cb->fire(item_id);
+ }
+ }
+ }
+}
+
+// Note this only supports updating an existing item. Goes through AISv3
+// code path where available. Not all uses of item->updateServer() can
+// easily be switched to this paradigm.
+void update_inventory_item(
+ const LLUUID& item_id,
+ const LLSD& updates,
+ LLPointer<LLInventoryCallback> cb)
+{
+ bool ais_ran = false;
+ if (AISCommand::isAPIAvailable())
+ {
+ LLPointer<AISCommand> cmd_ptr = new UpdateItemCommand(item_id, updates, cb);
+ ais_ran = cmd_ptr->run_command();
+ }
+ if (!ais_ran)
+ {
+ LLPointer<LLViewerInventoryItem> obj = gInventory.getItem(item_id);
+ LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << LL_ENDL;
+ if(obj)
+ {
+ LLPointer<LLViewerInventoryItem> new_item(new LLViewerInventoryItem);
+ new_item->copyViewerItem(obj);
+ new_item->fromLLSD(updates,false);
+
+ LLMessageSystem* msg = gMessageSystem;
+ msg->newMessageFast(_PREHASH_UpdateInventoryItem);
+ msg->nextBlockFast(_PREHASH_AgentData);
+ msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
+ msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
+ msg->addUUIDFast(_PREHASH_TransactionID, new_item->getTransactionID());
+ msg->nextBlockFast(_PREHASH_InventoryData);
+ msg->addU32Fast(_PREHASH_CallbackID, 0);
+ new_item->packMessage(msg);
+ gAgent.sendReliableMessage();
+
+ LLInventoryModel::LLCategoryUpdate up(new_item->getParentUUID(), 0);
+ gInventory.accountForUpdate(up);
+ gInventory.updateItem(new_item);
+ if (cb)
+ {
+ cb->fire(item_id);
+ }
+ }
+ }
+}
+
+void update_inventory_category(
+ const LLUUID& cat_id,
+ const LLSD& updates,
+ LLPointer<LLInventoryCallback> cb)
+{
+ LLPointer<LLViewerInventoryCategory> obj = gInventory.getCategory(cat_id);
+ LL_DEBUGS("Inventory") << "cat_id: [" << cat_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << LL_ENDL;
+ if(obj)
+ {
+ if (LLFolderType::lookupIsProtectedType(obj->getPreferredType()))
+ {
+ LLNotificationsUtil::add("CannotModifyProtectedCategories");
+ return;
+ }
+
+ LLPointer<LLViewerInventoryCategory> new_cat = new LLViewerInventoryCategory(obj);
+ new_cat->fromLLSD(updates);
+ // FIXME - restore this once the back-end work has been done.
+ if (AISCommand::isAPIAvailable())
+ {
+ LLSD new_llsd = new_cat->asLLSD();
+ LLPointer<AISCommand> cmd_ptr = new UpdateCategoryCommand(cat_id, new_llsd, cb);
+ cmd_ptr->run_command();
+ }
+ else // no cap
+ {
+ LLMessageSystem* msg = gMessageSystem;
+ msg->newMessageFast(_PREHASH_UpdateInventoryFolder);
+ msg->nextBlockFast(_PREHASH_AgentData);
+ msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
+ msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
+ msg->nextBlockFast(_PREHASH_FolderData);
+ new_cat->packMessage(msg);
+ gAgent.sendReliableMessage();
+
+ LLInventoryModel::LLCategoryUpdate up(new_cat->getParentUUID(), 0);
+ gInventory.accountForUpdate(up);
+ gInventory.updateCategory(new_cat);
+ if (cb)
+ {
+ cb->fire(cat_id);
+ }
+ }
+ }
+}
+
+void remove_inventory_items(
+ LLInventoryObject::object_list_t& items_to_kill,
+ LLPointer<LLInventoryCallback> cb)
+{
+ for (LLInventoryObject::object_list_t::iterator it = items_to_kill.begin();
+ it != items_to_kill.end();
+ ++it)
+ {
+ remove_inventory_item(*it, cb);
+ }
+}
+
+void remove_inventory_item(
+ const LLUUID& item_id,
+ LLPointer<LLInventoryCallback> cb)
+{
+ LLPointer<LLInventoryObject> obj = gInventory.getItem(item_id);
+ if (obj)
+ {
+ remove_inventory_item(obj, cb);
+ }
+ else
+ {
+ LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << "(NOT FOUND)" << LL_ENDL;
+ }
+}
+
+void remove_inventory_item(
+ LLPointer<LLInventoryObject> obj,
+ LLPointer<LLInventoryCallback> cb)
+{
+ if(obj)
+ {
+ const LLUUID item_id(obj->getUUID());
+ LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << obj->getName() << LL_ENDL;
+ if (AISCommand::isAPIAvailable())
+ {
+ LLPointer<AISCommand> cmd_ptr = new RemoveItemCommand(item_id, cb);
+ cmd_ptr->run_command();
+ }
+ else // no cap
+ {
+ LLMessageSystem* msg = gMessageSystem;
+ msg->newMessageFast(_PREHASH_RemoveInventoryItem);
+ msg->nextBlockFast(_PREHASH_AgentData);
+ msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
+ msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
+ msg->nextBlockFast(_PREHASH_InventoryData);
+ msg->addUUIDFast(_PREHASH_ItemID, item_id);
+ gAgent.sendReliableMessage();
+
+ // Update inventory and call callback immediately since
+ // message-based system has no callback mechanism (!)
+ gInventory.onObjectDeletedFromServer(item_id);
+ if (cb)
+ {
+ cb->fire(item_id);
+ }
+ }
+ }
+ else
+ {
+ // *TODO: Clean up callback?
+ LL_WARNS() << "remove_inventory_item called for invalid or nonexistent item." << LL_ENDL;
+ }
+}
+
+class LLRemoveCategoryOnDestroy: public LLInventoryCallback
+{
+public:
+ LLRemoveCategoryOnDestroy(const LLUUID& cat_id, LLPointer<LLInventoryCallback> cb):
+ mID(cat_id),
+ mCB(cb)
+ {
+ }
+ /* virtual */ void fire(const LLUUID& item_id) {}
+ ~LLRemoveCategoryOnDestroy()
+ {
+ LLInventoryModel::EHasChildren children = gInventory.categoryHasChildren(mID);
+ if(children != LLInventoryModel::CHILDREN_NO)
+ {
+ LL_WARNS() << "remove descendents failed, cannot remove category " << LL_ENDL;
+ }
+ else
+ {
+ remove_inventory_category(mID, mCB);
+ }
+ }
+private:
+ LLUUID mID;
+ LLPointer<LLInventoryCallback> mCB;
+};
+
+void remove_inventory_category(
+ const LLUUID& cat_id,
+ LLPointer<LLInventoryCallback> cb)
+{
+ LL_DEBUGS("Inventory") << "cat_id: [" << cat_id << "] " << LL_ENDL;
+ LLPointer<LLViewerInventoryCategory> obj = gInventory.getCategory(cat_id);
+ if(obj)
+ {
+ if(LLFolderType::lookupIsProtectedType(obj->getPreferredType()))
+ {
+ LLNotificationsUtil::add("CannotRemoveProtectedCategories");
+ return;
+ }
+ if (AISCommand::isAPIAvailable())
+ {
+ LLPointer<AISCommand> cmd_ptr = new RemoveCategoryCommand(cat_id, cb);
+ cmd_ptr->run_command();
+ }
+ else // no cap
+ {
+ // RemoveInventoryFolder does not remove children, so must
+ // clear descendents first.
+ LLInventoryModel::EHasChildren children = gInventory.categoryHasChildren(cat_id);
+ if(children != LLInventoryModel::CHILDREN_NO)
+ {
+ LL_DEBUGS("Inventory") << "Will purge descendents first before deleting category " << cat_id << LL_ENDL;
+ LLPointer<LLInventoryCallback> wrap_cb = new LLRemoveCategoryOnDestroy(cat_id, cb);
+ purge_descendents_of(cat_id, wrap_cb);
+ return;
+ }
+
+ LLMessageSystem* msg = gMessageSystem;
+ msg->newMessageFast(_PREHASH_RemoveInventoryFolder);
+ msg->nextBlockFast(_PREHASH_AgentData);
+ msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
+ msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
+ msg->nextBlockFast(_PREHASH_FolderData);
+ msg->addUUIDFast(_PREHASH_FolderID, cat_id);
+ gAgent.sendReliableMessage();
+
+ // Update inventory and call callback immediately since
+ // message-based system has no callback mechanism (!)
+ gInventory.onObjectDeletedFromServer(cat_id);
+ if (cb)
+ {
+ cb->fire(cat_id);
+ }
+ }
+ }
+ else
+ {
+ LL_WARNS() << "remove_inventory_category called for invalid or nonexistent item " << cat_id << LL_ENDL;
+ }
+}
+
+void remove_inventory_object(
+ const LLUUID& object_id,
+ LLPointer<LLInventoryCallback> cb)
+{
+ if (gInventory.getCategory(object_id))
+ {
+ remove_inventory_category(object_id, cb);
+ }
+ else
+ {
+ remove_inventory_item(object_id, cb);
+ }
+}
+
+// This is a method which collects the descendents of the id
+// provided. If the category is not found, no action is
+// taken. This method goes through the long winded process of
+// cancelling any calling cards, removing server representation of
+// folders, items, etc in a fairly efficient manner.
+void purge_descendents_of(const LLUUID& id, LLPointer<LLInventoryCallback> cb)
+{
+ LLInventoryModel::EHasChildren children = gInventory.categoryHasChildren(id);
+ if(children == LLInventoryModel::CHILDREN_NO)
+ {
+ LL_DEBUGS("Inventory") << "No descendents to purge for " << id << LL_ENDL;
+ return;
+ }
+ LLPointer<LLViewerInventoryCategory> cat = gInventory.getCategory(id);
+ if (cat.notNull())
+ {
+ if (LLClipboard::instance().hasContents() && LLClipboard::instance().isCutMode())
+ {
+ // Something on the clipboard is in "cut mode" and needs to be preserved
+ LL_DEBUGS("Inventory") << "purge_descendents_of clipboard case " << cat->getName()
+ << " iterate and purge non hidden items" << LL_ENDL;
+ LLInventoryModel::cat_array_t* categories;
+ LLInventoryModel::item_array_t* items;
+ // Get the list of direct descendants in tha categoy passed as argument
+ gInventory.getDirectDescendentsOf(id, categories, items);
+ std::vector<LLUUID> list_uuids;
+ // Make a unique list with all the UUIDs of the direct descendants (items and categories are not treated differently)
+ // Note: we need to do that shallow copy as purging things will invalidate the categories or items lists
+ for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin(); it != categories->end(); ++it)
+ {
+ list_uuids.push_back((*it)->getUUID());
+ }
+ for (LLInventoryModel::item_array_t::const_iterator it = items->begin(); it != items->end(); ++it)
+ {
+ list_uuids.push_back((*it)->getUUID());
+ }
+ // Iterate through the list and only purge the UUIDs that are not on the clipboard
+ for (std::vector<LLUUID>::const_iterator it = list_uuids.begin(); it != list_uuids.end(); ++it)
+ {
+ if (!LLClipboard::instance().isOnClipboard(*it))
+ {
+ remove_inventory_object(*it, NULL);
+ }
+ }
+ }
+ else
+ {
+ if (AISCommand::isAPIAvailable())
+ {
+ LLPointer<AISCommand> cmd_ptr = new PurgeDescendentsCommand(id, cb);
+ cmd_ptr->run_command();
+ }
+ else // no cap
+ {
+ // Fast purge
+ LL_DEBUGS("Inventory") << "purge_descendents_of fast case " << cat->getName() << LL_ENDL;
+
+ // send it upstream
+ LLMessageSystem* msg = gMessageSystem;
+ msg->newMessage("PurgeInventoryDescendents");
+ msg->nextBlock("AgentData");
+ msg->addUUID("AgentID", gAgent.getID());
+ msg->addUUID("SessionID", gAgent.getSessionID());
+ msg->nextBlock("InventoryData");
+ msg->addUUID("FolderID", id);
+ gAgent.sendReliableMessage();
+
+ // Update model immediately because there is no callback mechanism.
+ gInventory.onDescendentsPurgedFromServer(id);
+ if (cb)
+ {
+ cb->fire(id);
+ }
+ }
+ }
+ }
+}
+
const LLUUID get_folder_by_itemtype(const LLInventoryItem *src)
{
LLUUID retval = LLUUID::null;
@@ -1260,23 +1769,93 @@ void create_new_item(const std::string& name,
LLViewerAssetType::generateDescriptionFor(asset_type, desc);
next_owner_perm = (next_owner_perm) ? next_owner_perm : PERM_MOVE | PERM_TRANSFER;
-
- if (inv_type == LLInventoryType::IT_GESTURE)
+ LLPointer<LLInventoryCallback> cb = NULL;
+
+ switch (inv_type)
{
- LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(create_gesture_cb);
- create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
- parent_id, LLTransactionID::tnull, name, desc, asset_type, inv_type,
- NOT_WEARABLE, next_owner_perm, cb);
+ case LLInventoryType::IT_LSL:
+ {
+ cb = new LLBoostFuncInventoryCallback(create_script_cb);
+ next_owner_perm = LLFloaterPerms::getNextOwnerPerms("Scripts");
+ break;
+ }
+
+ case LLInventoryType::IT_GESTURE:
+ {
+ cb = new LLBoostFuncInventoryCallback(create_gesture_cb);
+ next_owner_perm = LLFloaterPerms::getNextOwnerPerms("Gestures");
+ break;
+ }
+
+ case LLInventoryType::IT_NOTECARD:
+ {
+ cb = new LLBoostFuncInventoryCallback(create_notecard_cb);
+ next_owner_perm = LLFloaterPerms::getNextOwnerPerms("Notecards");
+ break;
+ }
+ default:
+ break;
}
- else
+
+ create_inventory_item(gAgent.getID(),
+ gAgent.getSessionID(),
+ parent_id,
+ LLTransactionID::tnull,
+ name,
+ desc,
+ asset_type,
+ inv_type,
+ NOT_WEARABLE,
+ next_owner_perm,
+ cb);
+}
+
+void slam_inventory_folder(const LLUUID& folder_id,
+ const LLSD& contents,
+ LLPointer<LLInventoryCallback> cb)
+{
+ if (AISCommand::isAPIAvailable())
{
- LLPointer<LLInventoryCallback> cb = NULL;
- create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
- parent_id, LLTransactionID::tnull, name, desc, asset_type, inv_type,
- NOT_WEARABLE, next_owner_perm, cb);
+ LL_DEBUGS("Avatar") << "using AISv3 to slam folder, id " << folder_id
+ << " new contents: " << ll_pretty_print_sd(contents) << LL_ENDL;
+ LLPointer<AISCommand> cmd_ptr = new SlamFolderCommand(folder_id, contents, cb);
+ cmd_ptr->run_command();
}
-
-}
+ else // no cap
+ {
+ LL_DEBUGS("Avatar") << "using item-by-item calls to slam folder, id " << folder_id
+ << " new contents: " << ll_pretty_print_sd(contents) << LL_ENDL;
+ for (LLSD::array_const_iterator it = contents.beginArray();
+ it != contents.endArray();
+ ++it)
+ {
+ const LLSD& item_contents = *it;
+ LLViewerInventoryItem *item = new LLViewerInventoryItem;
+ item->fromLLSD(item_contents);
+ link_inventory_object(folder_id, item, cb);
+ }
+ remove_folder_contents(folder_id,false,cb);
+ }
+}
+
+void remove_folder_contents(const LLUUID& category, bool keep_outfit_links,
+ LLPointer<LLInventoryCallback> cb)
+{
+ LLInventoryModel::cat_array_t cats;
+ LLInventoryModel::item_array_t items;
+ gInventory.collectDescendents(category, cats, items,
+ LLInventoryModel::EXCLUDE_TRASH);
+ for (S32 i = 0; i < items.size(); ++i)
+ {
+ LLViewerInventoryItem *item = items.at(i);
+ if (keep_outfit_links && (item->getActualType() == LLAssetType::AT_LINK_FOLDER))
+ continue;
+ if (item->getIsLinkType())
+ {
+ remove_inventory_item(item->getUUID(), cb);
+ }
+ }
+}
const std::string NEW_LSL_NAME = "New Script"; // *TODO:Translate? (probably not)
const std::string NEW_NOTECARD_NAME = "New Note"; // *TODO:Translate? (probably not)
@@ -1316,7 +1895,7 @@ void menu_create_inventory_item(LLInventoryPanel* panel, LLFolderBridge *bridge,
parent_id,
LLAssetType::AT_LSL_TEXT,
LLInventoryType::IT_LSL,
- PERM_MOVE | PERM_TRANSFER);
+ PERM_MOVE | PERM_TRANSFER); // overridden in create_new_item
}
else if ("notecard" == type_name)
{
@@ -1325,7 +1904,7 @@ void menu_create_inventory_item(LLInventoryPanel* panel, LLFolderBridge *bridge,
parent_id,
LLAssetType::AT_NOTECARD,
LLInventoryType::IT_NOTECARD,
- PERM_ALL);
+ PERM_ALL); // overridden in create_new_item
}
else if ("gesture" == type_name)
{
@@ -1334,7 +1913,7 @@ void menu_create_inventory_item(LLInventoryPanel* panel, LLFolderBridge *bridge,
parent_id,
LLAssetType::AT_GESTURE,
LLInventoryType::IT_GESTURE,
- PERM_ALL);
+ PERM_ALL); // overridden in create_new_item
}
else
{
@@ -1347,7 +1926,7 @@ void menu_create_inventory_item(LLInventoryPanel* panel, LLFolderBridge *bridge,
}
else
{
- llwarns << "Can't create unrecognized type " << type_name << llendl;
+ LL_WARNS() << "Can't create unrecognized type " << type_name << LL_ENDL;
}
}
panel->getRootFolder()->setNeedsAutoRename(TRUE);
@@ -1582,7 +2161,7 @@ LLViewerInventoryItem *LLViewerInventoryItem::getLinkedItem() const
LLViewerInventoryItem *linked_item = gInventory.getItem(mAssetUUID);
if (linked_item && linked_item->getIsLinkType())
{
- llwarns << "Warning: Accessing link to link" << llendl;
+ LL_WARNS() << "Warning: Accessing link to link" << LL_ENDL;
return NULL;
}
return linked_item;
@@ -1713,3 +2292,5 @@ BOOL LLViewerInventoryItem::regenerateLink()
gInventory.notifyObservers();
return TRUE;
}
+
+
diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h
index ab19a12014..d345c49cfb 100755
--- a/indra/newview/llviewerinventory.h
+++ b/indra/newview/llviewerinventory.h
@@ -49,7 +49,7 @@ class LLViewerInventoryCategory;
class LLViewerInventoryItem : public LLInventoryItem, public boost::signals2::trackable
{
public:
- typedef LLDynamicArray<LLPointer<LLViewerInventoryItem> > item_array_t;
+ typedef std::vector<LLPointer<LLViewerInventoryItem> > item_array_t;
protected:
~LLViewerInventoryItem( void ); // ref counted
@@ -118,14 +118,13 @@ public:
void cloneViewerItem(LLPointer<LLViewerInventoryItem>& newitem) const;
// virtual methods
- virtual void removeFromServer( void );
virtual void updateParentOnServer(BOOL restamp) const;
virtual void updateServer(BOOL is_new) const;
void fetchFromServer(void) const;
- //virtual void packMessage(LLMessageSystem* msg) const;
+ virtual void packMessage(LLMessageSystem* msg) const;
virtual BOOL unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0);
- virtual BOOL unpackMessage(LLSD item);
+ virtual BOOL unpackMessage(const LLSD& item);
virtual BOOL importFile(LLFILE* fp);
virtual BOOL importLegacyStream(std::istream& input_stream);
@@ -139,7 +138,6 @@ public:
void setComplete(BOOL complete) { mIsComplete = complete; }
//void updateAssetOnServer() const;
- virtual void packMessage(LLMessageSystem* msg) const;
virtual void setTransactionID(const LLTransactionID& transaction_id);
struct comparePointers
{
@@ -181,7 +179,7 @@ public:
class LLViewerInventoryCategory : public LLInventoryCategory
{
public:
- typedef LLDynamicArray<LLPointer<LLViewerInventoryCategory> > cat_array_t;
+ typedef std::vector<LLPointer<LLViewerInventoryCategory> > cat_array_t;
protected:
~LLViewerInventoryCategory();
@@ -198,10 +196,11 @@ public:
LLViewerInventoryCategory(const LLViewerInventoryCategory* other);
void copyViewerCategory(const LLViewerInventoryCategory* other);
- virtual void removeFromServer();
virtual void updateParentOnServer(BOOL restamp_children) const;
virtual void updateServer(BOOL is_new) const;
+ virtual void packMessage(LLMessageSystem* msg) const;
+
const LLUUID& getOwnerID() const { return mOwnerID; }
// Version handling
@@ -218,6 +217,8 @@ public:
enum { DESCENDENT_COUNT_UNKNOWN = -1 };
S32 getDescendentCount() const { return mDescendentCount; }
void setDescendentCount(S32 descendents) { mDescendentCount = descendents; }
+ // How many descendents do we currently have information for in the InventoryModel?
+ S32 getViewerDescendentCount() const;
// file handling on the viewer. These are not meant for anything
// other than caching.
@@ -225,6 +226,8 @@ public:
bool importFileLocal(LLFILE* fp);
void determineFolderType();
void changeType(LLFolderType::EType new_folder_type);
+ virtual void unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0);
+ virtual BOOL unpackMessage(const LLSD& category);
private:
friend class LLInventoryModel;
@@ -249,7 +252,9 @@ void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachme
void activate_gesture_cb(const LLUUID& inv_item);
+void create_script_cb(const LLUUID& inv_item);
void create_gesture_cb(const LLUUID& inv_item);
+void create_notecard_cb(const LLUUID& inv_item);
class AddFavoriteLandmarkCallback : public LLInventoryCallback
{
@@ -264,9 +269,11 @@ private:
};
typedef boost::function<void(const LLUUID&)> inventory_func_type;
-void no_op_inventory_func(const LLUUID&); // A do-nothing inventory_func
-
+typedef boost::function<void(const LLSD&)> llsd_func_type;
typedef boost::function<void()> nullary_func_type;
+
+void no_op_inventory_func(const LLUUID&); // A do-nothing inventory_func
+void no_op_llsd_func(const LLSD&); // likewise for LLSD
void no_op(); // A do-nothing nullary func.
// Shim between inventory callback and boost function/callable
@@ -274,7 +281,7 @@ class LLBoostFuncInventoryCallback: public LLInventoryCallback
{
public:
- LLBoostFuncInventoryCallback(inventory_func_type fire_func,
+ LLBoostFuncInventoryCallback(inventory_func_type fire_func = no_op_inventory_func,
nullary_func_type destroy_func = no_op):
mFireFunc(fire_func),
mDestroyFunc(destroy_func)
@@ -348,14 +355,16 @@ void copy_inventory_item(
const std::string& new_name,
LLPointer<LLInventoryCallback> cb);
-void link_inventory_item(
- const LLUUID& agent_id,
- const LLUUID& item_id,
- const LLUUID& parent_id,
- const std::string& new_name,
- const std::string& new_description,
- const LLAssetType::EType asset_type,
- LLPointer<LLInventoryCallback> cb);
+// utility functions for inventory linking.
+void link_inventory_object(const LLUUID& category,
+ LLConstPointer<LLInventoryObject> baseobj,
+ LLPointer<LLInventoryCallback> cb);
+void link_inventory_object(const LLUUID& category,
+ const LLUUID& id,
+ LLPointer<LLInventoryCallback> cb);
+void link_inventory_array(const LLUUID& category,
+ LLInventoryObject::const_object_list_t& baseobj_array,
+ LLPointer<LLInventoryCallback> cb);
void move_inventory_item(
const LLUUID& agent_id,
@@ -365,6 +374,44 @@ void move_inventory_item(
const std::string& new_name,
LLPointer<LLInventoryCallback> cb);
+void update_inventory_item(
+ LLViewerInventoryItem *update_item,
+ LLPointer<LLInventoryCallback> cb);
+
+void update_inventory_item(
+ const LLUUID& item_id,
+ const LLSD& updates,
+ LLPointer<LLInventoryCallback> cb);
+
+void update_inventory_category(
+ const LLUUID& cat_id,
+ const LLSD& updates,
+ LLPointer<LLInventoryCallback> cb);
+
+void remove_inventory_items(
+ LLInventoryObject::object_list_t& items,
+ LLPointer<LLInventoryCallback> cb);
+
+void remove_inventory_item(
+ LLPointer<LLInventoryObject> obj,
+ LLPointer<LLInventoryCallback> cb);
+
+void remove_inventory_item(
+ const LLUUID& item_id,
+ LLPointer<LLInventoryCallback> cb);
+
+void remove_inventory_category(
+ const LLUUID& cat_id,
+ LLPointer<LLInventoryCallback> cb);
+
+void remove_inventory_object(
+ const LLUUID& object_id,
+ LLPointer<LLInventoryCallback> cb);
+
+void purge_descendents_of(
+ const LLUUID& cat_id,
+ LLPointer<LLInventoryCallback> cb);
+
const LLUUID get_folder_by_itemtype(const LLInventoryItem *src);
void copy_inventory_from_notecard(const LLUUID& destination_id,
@@ -379,4 +426,11 @@ void menu_create_inventory_item(LLInventoryPanel* root,
const LLSD& userdata,
const LLUUID& default_parent_uuid = LLUUID::null);
+void slam_inventory_folder(const LLUUID& folder_id,
+ const LLSD& contents,
+ LLPointer<LLInventoryCallback> cb);
+
+void remove_folder_contents(const LLUUID& folder_id, bool keep_outfit_links,
+ LLPointer<LLInventoryCallback> cb);
+
#endif // LL_LLVIEWERINVENTORY_H
diff --git a/indra/newview/llviewerjointattachment.cpp b/indra/newview/llviewerjointattachment.cpp
index 3a04bbed4f..888decd3be 100755
--- a/indra/newview/llviewerjointattachment.cpp
+++ b/indra/newview/llviewerjointattachment.cpp
@@ -28,7 +28,6 @@
#include "llviewerjointattachment.h"
-#include "llagentconstants.h"
#include "llviewercontrol.h"
#include "lldrawable.h"
#include "llgl.h"
@@ -46,6 +45,7 @@
#include "llglheaders.h"
extern LLPipeline gPipeline;
+const F32 MAX_ATTACHMENT_DIST = 3.5f; // meters?
//-----------------------------------------------------------------------------
// LLViewerJointAttachment()
@@ -171,7 +171,7 @@ BOOL LLViewerJointAttachment::addObject(LLViewerObject* object)
// Same object reattached
if (isObjectAttached(object))
{
- llinfos << "(same object re-attached)" << llendl;
+ LL_INFOS() << "(same object re-attached)" << LL_ENDL;
removeObject(object);
// Pass through anyway to let setupDrawable()
// re-connect object to the joint correctly
@@ -181,7 +181,7 @@ BOOL LLViewerJointAttachment::addObject(LLViewerObject* object)
// Request detach, and kill the object in the meantime.
if (getAttachedObject(object->getAttachmentItemID()))
{
- llinfos << "(same object re-attached)" << llendl;
+ LL_INFOS() << "(same object re-attached)" << LL_ENDL;
object->markDead();
// If this happens to be attached to self, then detach.
@@ -233,7 +233,7 @@ void LLViewerJointAttachment::removeObject(LLViewerObject *object)
}
if (iter == mAttachedObjects.end())
{
- llwarns << "Could not find object to detach" << llendl;
+ LL_WARNS() << "Could not find object to detach" << LL_ENDL;
return;
}
diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp
index 64454a03d1..bf7cf08c63 100755
--- a/indra/newview/llviewerjointmesh.cpp
+++ b/indra/newview/llviewerjointmesh.cpp
@@ -29,7 +29,6 @@
//-----------------------------------------------------------------------------
#include "llviewerprecompiledheaders.h"
-#include "imageids.h"
#include "llfasttimer.h"
#include "llrender.h"
@@ -116,7 +115,7 @@ void LLViewerJointMesh::uploadJointMatrices()
BOOL hardware_skinning = (poolp && poolp->getVertexShaderLevel() > 0) ? TRUE : FALSE;
//calculate joint matrices
- for (joint_num = 0; joint_num < reference_mesh->mJointRenderData.count(); joint_num++)
+ for (joint_num = 0; joint_num < reference_mesh->mJointRenderData.size(); joint_num++)
{
LLMatrix4 joint_mat = *reference_mesh->mJointRenderData[joint_num]->mWorldMatrix;
@@ -132,7 +131,7 @@ void LLViewerJointMesh::uploadJointMatrices()
S32 j = 0;
//upload joint pivots
- for (joint_num = 0; joint_num < reference_mesh->mJointRenderData.count(); joint_num++)
+ for (joint_num = 0; joint_num < reference_mesh->mJointRenderData.size(); joint_num++)
{
LLSkinJoint *sj = reference_mesh->mJointRenderData[joint_num]->mSkinJoint;
if (sj)
@@ -172,7 +171,7 @@ void LLViewerJointMesh::uploadJointMatrices()
GLfloat mat[45*4];
memset(mat, 0, sizeof(GLfloat)*45*4);
- for (joint_num = 0; joint_num < reference_mesh->mJointRenderData.count(); joint_num++)
+ for (joint_num = 0; joint_num < reference_mesh->mJointRenderData.size(); joint_num++)
{
gJointMatUnaligned[joint_num].transpose();
@@ -193,7 +192,7 @@ void LLViewerJointMesh::uploadJointMatrices()
else
{
//load gJointMatUnaligned into gJointMatAligned
- for (joint_num = 0; joint_num < reference_mesh->mJointRenderData.count(); ++joint_num)
+ for (joint_num = 0; joint_num < reference_mesh->mJointRenderData.size(); ++joint_num)
{
gJointMatAligned[joint_num].loadu(gJointMatUnaligned[joint_num]);
}
@@ -377,7 +376,7 @@ void LLViewerJointMesh::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32
//-----------------------------------------------------------------------------
// updateFaceData()
//-----------------------------------------------------------------------------
-static LLFastTimer::DeclareTimer FTM_AVATAR_FACE("Avatar Face");
+static LLTrace::BlockTimerStatHandle FTM_AVATAR_FACE("Avatar Face");
void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind, bool terse_update)
{
@@ -400,7 +399,7 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_w
}
- LLFastTimer t(FTM_AVATAR_FACE);
+ LL_RECORD_BLOCK_TIME(FTM_AVATAR_FACE);
LLStrider<LLVector3> verticesp;
LLStrider<LLVector3> normalsp;
@@ -552,7 +551,7 @@ void LLViewerJointMesh::dump()
{
if (mValid)
{
- llinfos << "Usable LOD " << mName << llendl;
+ LL_INFOS() << "Usable LOD " << mName << LL_ENDL;
}
}
diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp
index aeeb591d55..e44d80b7ce 100755
--- a/indra/newview/llviewerjoystick.cpp
+++ b/indra/newview/llviewerjoystick.cpp
@@ -107,7 +107,7 @@ NDOF_HotPlugResult LLViewerJoystick::HotPlugAddCallback(NDOF_Device *dev)
LLViewerJoystick* joystick(LLViewerJoystick::getInstance());
if (joystick->mDriverState == JDS_UNINITIALIZED)
{
- llinfos << "HotPlugAddCallback: will use device:" << llendl;
+ LL_INFOS() << "HotPlugAddCallback: will use device:" << LL_ENDL;
ndof_dump(dev);
joystick->mNdofDev = dev;
joystick->mDriverState = JDS_INITIALIZED;
@@ -125,8 +125,8 @@ void LLViewerJoystick::HotPlugRemovalCallback(NDOF_Device *dev)
LLViewerJoystick* joystick(LLViewerJoystick::getInstance());
if (joystick->mNdofDev == dev)
{
- llinfos << "HotPlugRemovalCallback: joystick->mNdofDev="
- << joystick->mNdofDev << "; removed device:" << llendl;
+ LL_INFOS() << "HotPlugRemovalCallback: joystick->mNdofDev="
+ << joystick->mNdofDev << "; removed device:" << LL_ENDL;
ndof_dump(dev);
joystick->mDriverState = JDS_UNINITIALIZED;
}
@@ -215,7 +215,7 @@ void LLViewerJoystick::init(bool autoenable)
if (ndof_init_first(mNdofDev, NULL))
{
mDriverState = JDS_UNINITIALIZED;
- llwarns << "ndof_init_first FAILED" << llendl;
+ LL_WARNS() << "ndof_init_first FAILED" << LL_ENDL;
}
else
{
@@ -259,8 +259,8 @@ void LLViewerJoystick::init(bool autoenable)
// No device connected, don't change any settings
}
- llinfos << "ndof: mDriverState=" << mDriverState << "; mNdofDev="
- << mNdofDev << "; libinit=" << libinit << llendl;
+ LL_INFOS() << "ndof: mDriverState=" << mDriverState << "; mNdofDev="
+ << mNdofDev << "; libinit=" << libinit << LL_ENDL;
#endif
}
@@ -270,7 +270,7 @@ void LLViewerJoystick::terminate()
#if LIB_NDOF
ndof_libcleanup();
- llinfos << "Terminated connection with NDOF device." << llendl;
+ LL_INFOS() << "Terminated connection with NDOF device." << LL_ENDL;
mDriverState = JDS_UNINITIALIZED;
#endif
}
@@ -501,7 +501,7 @@ void LLViewerJoystick::moveObjects(bool reset)
};
F32 cur_delta[6];
- F32 time = gFrameIntervalSeconds;
+ F32 time = gFrameIntervalSeconds.value();
// avoid making ridicously big movements if there's a big drop in fps
if (time > .2f)
@@ -665,7 +665,7 @@ void LLViewerJoystick::moveAvatar(bool reset)
};
// time interval in seconds between this frame and the previous
- F32 time = gFrameIntervalSeconds;
+ F32 time = gFrameIntervalSeconds.value();
// avoid making ridicously big movements if there's a big drop in fps
if (time > .2f)
@@ -878,7 +878,7 @@ void LLViewerJoystick::moveFlycam(bool reset)
gSavedSettings.getF32("FlycamAxisDeadZone6")
};
- F32 time = gFrameIntervalSeconds;
+ F32 time = gFrameIntervalSeconds.value();
// avoid making ridiculously big movements if there's a big drop in fps
if (time > .2f)
@@ -1101,7 +1101,7 @@ void LLViewerJoystick::setSNDefaults()
#endif
//gViewerWindow->alertXml("CacheWillClear");
- llinfos << "restoring SpaceNavigator defaults..." << llendl;
+ LL_INFOS() << "restoring SpaceNavigator defaults..." << LL_ENDL;
gSavedSettings.setS32("JoystickAxis0", 1); // z (at)
gSavedSettings.setS32("JoystickAxis1", 0); // x (slide)
diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp
index aa9de076b8..b0f4802e20 100755
--- a/indra/newview/llviewerkeyboard.cpp
+++ b/indra/newview/llviewerkeyboard.cpp
@@ -146,9 +146,11 @@ void agent_push_forward( EKeystate s )
if (LLFloaterCamera::inFreeCameraMode())
{
camera_move_forward(s);
- return;
}
- agent_push_forwardbackward(s, 1, LLAgent::DOUBLETAP_FORWARD);
+ else
+ {
+ agent_push_forwardbackward(s, 1, LLAgent::DOUBLETAP_FORWARD);
+ }
}
void camera_move_backward( EKeystate s );
@@ -159,9 +161,15 @@ void agent_push_backward( EKeystate s )
if (LLFloaterCamera::inFreeCameraMode())
{
camera_move_backward(s);
- return;
}
- agent_push_forwardbackward(s, -1, LLAgent::DOUBLETAP_BACKWARD);
+ else if (!gAgent.backwardGrabbed() && gAgentAvatarp->isSitting() && gSavedSettings.getBOOL("LeaveMouselook"))
+ {
+ gAgentCamera.changeCameraToThirdPerson();
+ }
+ else
+ {
+ agent_push_forwardbackward(s, -1, LLAgent::DOUBLETAP_BACKWARD);
+ }
}
static void agent_slide_leftright( EKeystate s, S32 direction, LLAgent::EDoubleTapRunMode mode )
@@ -269,7 +277,7 @@ F32 get_orbit_rate()
if( time < NUDGE_TIME )
{
F32 rate = ORBIT_NUDGE_RATE + time * (1 - ORBIT_NUDGE_RATE)/ NUDGE_TIME;
- //llinfos << rate << llendl;
+ //LL_INFOS() << rate << LL_ENDL;
return rate;
}
else
@@ -676,7 +684,7 @@ BOOL LLViewerKeyboard::handleKey(KEY translated_key, MASK translated_mask, BOOL
return FALSE;
}
- lldebugst(LLERR_USER_INPUT) << "keydown -" << translated_key << "-" << llendl;
+ LL_DEBUGS("UserInput") << "keydown -" << translated_key << "-" << LL_ENDL;
// skip skipped keys
if(mKeysSkippedByUI.find(translated_key) != mKeysSkippedByUI.end())
{
@@ -733,7 +741,7 @@ BOOL LLViewerKeyboard::bindKey(const S32 mode, const KEY key, const MASK mask, c
if (!function)
{
- llerrs << "Can't bind key to function " << function_name << ", no function with this name found" << llendl;
+ LL_ERRS() << "Can't bind key to function " << function_name << ", no function with this name found" << LL_ENDL;
return FALSE;
}
@@ -746,13 +754,13 @@ BOOL LLViewerKeyboard::bindKey(const S32 mode, const KEY key, const MASK mask, c
if (index >= MAX_KEY_BINDINGS)
{
- llerrs << "LLKeyboard::bindKey() - too many keys for mode " << mode << llendl;
+ LL_ERRS() << "LLKeyboard::bindKey() - too many keys for mode " << mode << LL_ENDL;
return FALSE;
}
if (mode >= MODE_COUNT)
{
- llerror("LLKeyboard::bindKey() - unknown mode passed", mode);
+ LL_ERRS() << "LLKeyboard::bindKey() - unknown mode passed" << mode << LL_ENDL;
return FALSE;
}
@@ -841,7 +849,7 @@ S32 LLViewerKeyboard::loadBindings(const std::string& filename)
if(filename.empty())
{
- llerrs << " No filename specified" << llendl;
+ LL_ERRS() << " No filename specified" << LL_ENDL;
return 0;
}
@@ -873,35 +881,35 @@ S32 LLViewerKeyboard::loadBindings(const std::string& filename)
if (tokens_read == EOF)
{
- llinfos << "Unexpected end-of-file at line " << line_count << " of key binding file " << filename << llendl;
+ LL_INFOS() << "Unexpected end-of-file at line " << line_count << " of key binding file " << filename << LL_ENDL;
fclose(fp);
return 0;
}
else if (tokens_read < 4)
{
- llinfos << "Can't read line " << line_count << " of key binding file " << filename << llendl;
+ LL_INFOS() << "Can't read line " << line_count << " of key binding file " << filename << LL_ENDL;
continue;
}
// convert mode
if (!modeFromString(mode_string, &mode))
{
- llinfos << "Unknown mode on line " << line_count << " of key binding file " << filename << llendl;
- llinfos << "Mode must be one of FIRST_PERSON, THIRD_PERSON, EDIT, EDIT_AVATAR" << llendl;
+ LL_INFOS() << "Unknown mode on line " << line_count << " of key binding file " << filename << LL_ENDL;
+ LL_INFOS() << "Mode must be one of FIRST_PERSON, THIRD_PERSON, EDIT, EDIT_AVATAR" << LL_ENDL;
continue;
}
// convert key
if (!LLKeyboard::keyFromString(key_string, &key))
{
- llinfos << "Can't interpret key on line " << line_count << " of key binding file " << filename << llendl;
+ LL_INFOS() << "Can't interpret key on line " << line_count << " of key binding file " << filename << LL_ENDL;
continue;
}
// convert mask
if (!LLKeyboard::maskFromString(mask_string, &mask))
{
- llinfos << "Can't interpret mask on line " << line_count << " of key binding file " << filename << llendl;
+ LL_INFOS() << "Can't interpret mask on line " << line_count << " of key binding file " << filename << LL_ENDL;
continue;
}
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 21fb8d519b..8499012cfc 100755
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -67,7 +67,6 @@
#include "llvoavatarself.h"
#include "llvovolume.h"
#include "llwebprofile.h"
-#include "llwebsharing.h" // For LLWebSharing::setOpenIDCookie(), *TODO: find a better way to do this!
#include "llwindow.h"
#include "llvieweraudio.h"
@@ -158,7 +157,7 @@ LLViewerMediaObserver::~LLViewerMediaObserver()
// on the Panel Land Media and to discover the MIME type
class LLMimeDiscoveryResponder : public LLHTTPClient::Responder
{
-LOG_CLASS(LLMimeDiscoveryResponder);
+ LOG_CLASS(LLMimeDiscoveryResponder);
public:
LLMimeDiscoveryResponder( viewer_media_t media_impl)
: mMediaImpl(media_impl),
@@ -166,7 +165,7 @@ public:
{
if(mMediaImpl->mMimeTypeProbe != NULL)
{
- llerrs << "impl already has an outstanding responder" << llendl;
+ LL_ERRS() << "impl already has an outstanding responder" << LL_ENDL;
}
mMediaImpl->mMimeTypeProbe = this;
@@ -177,13 +176,19 @@ public:
disconnectOwner();
}
- virtual void completedHeader(U32 status, const std::string& reason, const LLSD& content)
+private:
+ /* virtual */ void httpCompleted()
{
- std::string media_type = content["content-type"].asString();
+ if (!isGoodStatus())
+ {
+ LL_WARNS() << dumpResponse()
+ << " [headers:" << getResponseHeaders() << "]" << LL_ENDL;
+ }
+ const std::string& media_type = getResponseHeader(HTTP_IN_HEADER_CONTENT_TYPE);
std::string::size_type idx1 = media_type.find_first_of(";");
std::string mime_type = media_type.substr(0, idx1);
- lldebugs << "status is " << status << ", media type \"" << media_type << "\"" << llendl;
+ LL_DEBUGS() << "status is " << getStatus() << ", media type \"" << media_type << "\"" << LL_ENDL;
// 2xx status codes indicate success.
// Most 4xx status codes are successful enough for our purposes.
@@ -191,7 +196,7 @@ public:
// 500 means "Internal Server error" but we decided it's okay to
// accept this and go past it in the MIME type probe
// 302 means the resource can be found temporarily in a different place - added this for join.secondlife.com
- // 499 is a code specifc to join.secondlife.com (????) apparently safe to ignore
+ // 499 is a code specifc to join.secondlife.com (?) apparently safe to ignore
// if( ((status >= 200) && (status < 300)) ||
// ((status >= 400) && (status < 499)) ||
// (status == 500) ||
@@ -200,32 +205,27 @@ public:
// )
// We now no longer check the error code returned from the probe.
// If we have a mime type, use it. If not, default to the web plugin and let it handle error reporting.
- if(1)
+ //if(1)
{
// The probe was successful.
if(mime_type.empty())
{
// Some sites don't return any content-type header at all.
// Treat an empty mime type as text/html.
- mime_type = "text/html";
- }
-
- completeAny(status, mime_type);
- }
- else
- {
- llwarns << "responder failed with status " << status << ", reason " << reason << llendl;
-
- if(mMediaImpl)
- {
- mMediaImpl->mMediaSourceFailed = true;
+ mime_type = HTTP_CONTENT_TEXT_HTML;
}
}
+ //else
+ //{
+ // LL_WARNS() << "responder failed with status " << dumpResponse() << LL_ENDL;
+ //
+ // if(mMediaImpl)
+ // {
+ // mMediaImpl->mMediaSourceFailed = true;
+ // }
+ // return;
+ //}
- }
-
- void completeAny(U32 status, const std::string& mime_type)
- {
// the call to initializeMedia may disconnect the responder, which will clear mMediaImpl.
// Make a local copy so we can call loadURI() afterwards.
LLViewerMediaImpl *impl = mMediaImpl;
@@ -241,6 +241,7 @@ public:
}
}
+public:
void cancelRequest()
{
disconnectOwner();
@@ -253,7 +254,7 @@ private:
{
if(mMediaImpl->mMimeTypeProbe != this)
{
- llerrs << "internal error: mMediaImpl->mMimeTypeProbe != this" << llendl;
+ LL_ERRS() << "internal error: mMediaImpl->mMimeTypeProbe != this" << LL_ENDL;
}
mMediaImpl->mMimeTypeProbe = NULL;
@@ -269,7 +270,7 @@ public:
class LLViewerMediaOpenIDResponder : public LLHTTPClient::Responder
{
-LOG_CLASS(LLViewerMediaOpenIDResponder);
+ LOG_CLASS(LLViewerMediaOpenIDResponder);
public:
LLViewerMediaOpenIDResponder( )
{
@@ -279,23 +280,17 @@ public:
{
}
- /* virtual */ void completedHeader(U32 status, const std::string& reason, const LLSD& content)
- {
- LL_DEBUGS("MediaAuth") << "status = " << status << ", reason = " << reason << LL_ENDL;
- LL_DEBUGS("MediaAuth") << content << LL_ENDL;
- std::string cookie = content["set-cookie"].asString();
-
- LLViewerMedia::openIDCookieResponse(cookie);
- }
-
/* virtual */ void completedRaw(
- U32 status,
- const std::string& reason,
const LLChannelDescriptors& channels,
const LLIOPipe::buffer_ptr_t& buffer)
{
- // This is just here to disable the default behavior (attempting to parse the response as llsd).
- // We don't care about the content of the response, only the set-cookie header.
+ // We don't care about the content of the response, only the Set-Cookie header.
+ LL_DEBUGS("MediaAuth") << dumpResponse()
+ << " [headers:" << getResponseHeaders() << "]" << LL_ENDL;
+ const std::string& cookie = getResponseHeader(HTTP_IN_HEADER_SET_COOKIE);
+
+ // *TODO: What about bad status codes? Does this destroy previous cookies?
+ LLViewerMedia::openIDCookieResponse(cookie);
}
};
@@ -313,17 +308,23 @@ public:
{
}
- /* virtual */ void completedHeader(U32 status, const std::string& reason, const LLSD& content)
+ void completedRaw(
+ const LLChannelDescriptors& channels,
+ const LLIOPipe::buffer_ptr_t& buffer)
{
- LL_WARNS("MediaAuth") << "status = " << status << ", reason = " << reason << LL_ENDL;
+ // We don't care about the content of the response, only the set-cookie header.
+ LL_WARNS("MediaAuth") << dumpResponse()
+ << " [headers:" << getResponseHeaders() << "]" << LL_ENDL;
- LLSD stripped_content = content;
- stripped_content.erase("set-cookie");
+ LLSD stripped_content = getResponseHeaders();
+ // *TODO: Check that this works.
+ stripped_content.erase(HTTP_IN_HEADER_SET_COOKIE);
LL_WARNS("MediaAuth") << stripped_content << LL_ENDL;
- std::string cookie = content["set-cookie"].asString();
+ const std::string& cookie = getResponseHeader(HTTP_IN_HEADER_SET_COOKIE);
LL_DEBUGS("MediaAuth") << "cookie = " << cookie << LL_ENDL;
+ // *TODO: What about bad status codes? Does this destroy previous cookies?
LLViewerMedia::getCookieStore()->setCookiesFromHost(cookie, mHost);
// Set cookie for snapshot publishing.
@@ -331,16 +332,6 @@ public:
LLWebProfile::setAuthCookie(auth_cookie);
}
- void completedRaw(
- U32 status,
- const std::string& reason,
- const LLChannelDescriptors& channels,
- const LLIOPipe::buffer_ptr_t& buffer)
- {
- // This is just here to disable the default behavior (attempting to parse the response as llsd).
- // We don't care about the content of the response, only the set-cookie header.
- }
-
std::string mHost;
};
@@ -429,10 +420,10 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s
// Try to find media with the same media ID
viewer_media_t media_impl = getMediaImplFromTextureID(media_entry->getMediaID());
- lldebugs << "called, current URL is \"" << media_entry->getCurrentURL()
+ LL_DEBUGS() << "called, current URL is \"" << media_entry->getCurrentURL()
<< "\", previous URL is \"" << previous_url
<< "\", update_from_self is " << (update_from_self?"true":"false")
- << llendl;
+ << LL_ENDL;
bool was_loaded = false;
bool needs_navigate = false;
@@ -464,7 +455,7 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s
// The current media URL is now empty. Unload the media source.
media_impl->unload();
- lldebugs << "Unloading media instance (new current URL is empty)." << llendl;
+ LL_DEBUGS() << "Unloading media instance (new current URL is empty)." << LL_ENDL;
}
}
else
@@ -478,9 +469,9 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s
needs_navigate = url_changed;
}
- lldebugs << "was_loaded is " << (was_loaded?"true":"false")
+ LL_DEBUGS() << "was_loaded is " << (was_loaded?"true":"false")
<< ", auto_play is " << (auto_play?"true":"false")
- << ", needs_navigate is " << (needs_navigate?"true":"false") << llendl;
+ << ", needs_navigate is " << (needs_navigate?"true":"false") << LL_ENDL;
}
}
else
@@ -506,7 +497,7 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s
if(needs_navigate)
{
media_impl->navigateTo(media_impl->mMediaEntryURL, "", true, true);
- lldebugs << "navigating to URL " << media_impl->mMediaEntryURL << llendl;
+ LL_DEBUGS() << "navigating to URL " << media_impl->mMediaEntryURL << LL_ENDL;
}
else if(!media_impl->mMediaURL.empty() && (media_impl->mMediaURL != media_impl->mMediaEntryURL))
{
@@ -516,7 +507,7 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s
// If this causes a navigate at some point (such as after a reload), it should be considered server-driven so it isn't broadcast.
media_impl->mNavigateServerRequest = true;
- lldebugs << "updating URL in the media impl to " << media_impl->mMediaEntryURL << llendl;
+ LL_DEBUGS() << "updating URL in the media impl to " << media_impl->mMediaEntryURL << LL_ENDL;
}
}
@@ -561,7 +552,7 @@ std::string LLViewerMedia::getCurrentUserAgent()
codec << "SecondLife/";
codec << LLVersionInfo::getVersion();
codec << " (" << channel << "; " << skin_name << " skin)";
- llinfos << codec.str() << llendl;
+ LL_INFOS() << codec.str() << LL_ENDL;
return codec.str();
}
@@ -678,7 +669,7 @@ bool LLViewerMedia::isInterestingEnough(const LLVOVolume *object, const F64 &obj
}
else
{
- lldebugs << "object interest = " << object_interest << ", lowest loadable = " << sLowestLoadableImplInterest << llendl;
+ LL_DEBUGS() << "object interest = " << object_interest << ", lowest loadable = " << sLowestLoadableImplInterest << LL_ENDL;
if(object_interest >= sLowestLoadableImplInterest)
result = true;
}
@@ -776,19 +767,19 @@ static bool proximity_comparitor(const LLViewerMediaImpl* i1, const LLViewerMedi
}
}
-static LLFastTimer::DeclareTimer FTM_MEDIA_UPDATE("Update Media");
-static LLFastTimer::DeclareTimer FTM_MEDIA_SPARE_IDLE("Spare Idle");
-static LLFastTimer::DeclareTimer FTM_MEDIA_UPDATE_INTEREST("Update/Interest");
-static LLFastTimer::DeclareTimer FTM_MEDIA_SORT("Sort");
-static LLFastTimer::DeclareTimer FTM_MEDIA_SORT2("Sort 2");
-static LLFastTimer::DeclareTimer FTM_MEDIA_MISC("Misc");
+static LLTrace::BlockTimerStatHandle FTM_MEDIA_UPDATE("Update Media");
+static LLTrace::BlockTimerStatHandle FTM_MEDIA_SPARE_IDLE("Spare Idle");
+static LLTrace::BlockTimerStatHandle FTM_MEDIA_UPDATE_INTEREST("Update/Interest");
+static LLTrace::BlockTimerStatHandle FTM_MEDIA_SORT("Media Sort");
+static LLTrace::BlockTimerStatHandle FTM_MEDIA_SORT2("Media Sort 2");
+static LLTrace::BlockTimerStatHandle FTM_MEDIA_MISC("Misc");
//////////////////////////////////////////////////////////////////////////////////////////
// static
void LLViewerMedia::updateMedia(void *dummy_arg)
{
- LLFastTimer t1(FTM_MEDIA_UPDATE);
+ LL_RECORD_BLOCK_TIME(FTM_MEDIA_UPDATE);
// Enable/disable the plugin read thread
LLPluginProcessParent::setUseReadThread(gSavedSettings.getBOOL("PluginUseReadThread"));
@@ -800,15 +791,15 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
sUpdatedCookies = getCookieStore()->getChangedCookies();
if(!sUpdatedCookies.empty())
{
- lldebugs << "updated cookies will be sent to all loaded plugins: " << llendl;
- lldebugs << sUpdatedCookies << llendl;
+ LL_DEBUGS() << "updated cookies will be sent to all loaded plugins: " << LL_ENDL;
+ LL_DEBUGS() << sUpdatedCookies << LL_ENDL;
}
impl_list::iterator iter = sViewerMediaImplList.begin();
impl_list::iterator end = sViewerMediaImplList.end();
{
- LLFastTimer t(FTM_MEDIA_UPDATE_INTEREST);
+ LL_RECORD_BLOCK_TIME(FTM_MEDIA_UPDATE_INTEREST);
for(; iter != end;)
{
LLViewerMediaImpl* pimpl = *iter++;
@@ -820,12 +811,12 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
// Let the spare media source actually launch
if(sSpareBrowserMediaSource)
{
- LLFastTimer t(FTM_MEDIA_SPARE_IDLE);
+ LL_RECORD_BLOCK_TIME(FTM_MEDIA_SPARE_IDLE);
sSpareBrowserMediaSource->idle();
}
{
- LLFastTimer t(FTM_MEDIA_SORT);
+ LL_RECORD_BLOCK_TIME(FTM_MEDIA_SORT);
// Sort the static instance list using our interest criteria
sViewerMediaImplList.sort(priorityComparitor);
}
@@ -857,7 +848,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
// If max_normal + max_low is less than max_instances, things will tend to get unloaded instead of being set to slideshow.
{
- LLFastTimer t(FTM_MEDIA_MISC);
+ LL_RECORD_BLOCK_TIME(FTM_MEDIA_MISC);
for(; iter != end; iter++)
{
LLViewerMediaImpl* pimpl = *iter;
@@ -1025,7 +1016,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
}
else
{
- LLFastTimer t(FTM_MEDIA_SORT2);
+ LL_RECORD_BLOCK_TIME(FTM_MEDIA_SORT2);
// Use a distance-based sort for proximity values.
std::stable_sort(proximity_order.begin(), proximity_order.end(), proximity_comparitor);
}
@@ -1036,7 +1027,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
proximity_order[i]->mProximity = i;
}
- LL_DEBUGS("PluginPriority") << "Total reported CPU usage is " << total_cpu << llendl;
+ LL_DEBUGS("PluginPriority") << "Total reported CPU usage is " << total_cpu << LL_ENDL;
}
@@ -1171,14 +1162,14 @@ void LLViewerMedia::clearAllCookies()
std::string target;
std::string filename;
- lldebugs << "base dir = " << base_dir << llendl;
+ LL_DEBUGS() << "base dir = " << base_dir << LL_ENDL;
// The non-logged-in version is easy
target = base_dir;
target += "browser_profile";
target += gDirUtilp->getDirDelimiter();
target += "cookies";
- lldebugs << "target = " << target << llendl;
+ LL_DEBUGS() << "target = " << target << LL_ENDL;
if(LLFile::isfile(target))
{
LLFile::remove(target);
@@ -1191,7 +1182,7 @@ void LLViewerMedia::clearAllCookies()
target = gDirUtilp->add(base_dir, filename);
gDirUtilp->append(target, "browser_profile");
gDirUtilp->append(target, "cookies");
- lldebugs << "target = " << target << llendl;
+ LL_DEBUGS() << "target = " << target << LL_ENDL;
if(LLFile::isfile(target))
{
LLFile::remove(target);
@@ -1200,7 +1191,7 @@ void LLViewerMedia::clearAllCookies()
// Other accounts may have new-style cookie files too -- delete them as well
target = gDirUtilp->add(base_dir, filename);
gDirUtilp->append(target, PLUGIN_COOKIE_FILE_NAME);
- lldebugs << "target = " << target << llendl;
+ LL_DEBUGS() << "target = " << target << LL_ENDL;
if(LLFile::isfile(target))
{
LLFile::remove(target);
@@ -1282,7 +1273,7 @@ void LLViewerMedia::loadCookieFile()
if (resolved_filename.empty())
{
- llinfos << "can't get path to plugin cookie file - probably not logged in yet." << llendl;
+ LL_INFOS() << "can't get path to plugin cookie file - probably not logged in yet." << LL_ENDL;
return;
}
@@ -1290,7 +1281,7 @@ void LLViewerMedia::loadCookieFile()
llifstream file(resolved_filename);
if (!file.is_open())
{
- llwarns << "can't load plugin cookies from file \"" << PLUGIN_COOKIE_FILE_NAME << "\"" << llendl;
+ LL_WARNS() << "can't load plugin cookies from file \"" << PLUGIN_COOKIE_FILE_NAME << "\"" << LL_ENDL;
return;
}
@@ -1324,7 +1315,7 @@ void LLViewerMedia::saveCookieFile()
if (resolved_filename.empty())
{
- llinfos << "can't get path to plugin cookie file - probably not logged in yet." << llendl;
+ LL_INFOS() << "can't get path to plugin cookie file - probably not logged in yet." << LL_ENDL;
return;
}
@@ -1332,7 +1323,7 @@ void LLViewerMedia::saveCookieFile()
llofstream file (resolved_filename);
if (!file.is_open())
{
- llwarns << "can't open plugin cookie file \"" << PLUGIN_COOKIE_FILE_NAME << "\" for writing" << llendl;
+ LL_WARNS() << "can't open plugin cookie file \"" << PLUGIN_COOKIE_FILE_NAME << "\" for writing" << LL_ENDL;
return;
}
@@ -1387,10 +1378,12 @@ void LLViewerMedia::removeCookie(const std::string &name, const std::string &dom
LLSD LLViewerMedia::getHeaders()
{
LLSD headers = LLSD::emptyMap();
- headers["Accept"] = "*/*";
- headers["Content-Type"] = "application/xml";
- headers["Cookie"] = sOpenIDCookie;
- headers["User-Agent"] = getCurrentUserAgent();
+ headers[HTTP_OUT_HEADER_ACCEPT] = "*/*";
+ // *TODO: Should this be 'application/llsd+xml' ?
+ // *TODO: Should this even be set at all? This header is only not overridden in 'GET' methods.
+ headers[HTTP_OUT_HEADER_CONTENT_TYPE] = HTTP_CONTENT_XML;
+ headers[HTTP_OUT_HEADER_COOKIE] = sOpenIDCookie;
+ headers[HTTP_OUT_HEADER_USER_AGENT] = getCurrentUserAgent();
return headers;
}
@@ -1426,20 +1419,17 @@ void LLViewerMedia::setOpenIDCookie()
getCookieStore()->setCookiesFromHost(sOpenIDCookie, authority.substr(host_start, host_end - host_start));
- // *HACK: Doing this here is nasty, find a better way.
- LLWebSharing::instance().setOpenIDCookie(sOpenIDCookie);
-
// Do a web profile get so we can store the cookie
LLSD headers = LLSD::emptyMap();
- headers["Accept"] = "*/*";
- headers["Cookie"] = sOpenIDCookie;
- headers["User-Agent"] = getCurrentUserAgent();
+ headers[HTTP_OUT_HEADER_ACCEPT] = "*/*";
+ headers[HTTP_OUT_HEADER_COOKIE] = sOpenIDCookie;
+ headers[HTTP_OUT_HEADER_USER_AGENT] = getCurrentUserAgent();
std::string profile_url = getProfileURL("");
LLURL raw_profile_url( profile_url.c_str() );
- LL_DEBUGS("MediaAuth") << "Requesting " << profile_url << llendl;
- LL_DEBUGS("MediaAuth") << "sOpenIDCookie = [" << sOpenIDCookie << "]" << llendl;
+ LL_DEBUGS("MediaAuth") << "Requesting " << profile_url << LL_ENDL;
+ LL_DEBUGS("MediaAuth") << "sOpenIDCookie = [" << sOpenIDCookie << "]" << LL_ENDL;
LLHTTPClient::get(profile_url,
new LLViewerMediaWebProfileResponder(raw_profile_url.getAuthority()),
headers);
@@ -1463,9 +1453,9 @@ void LLViewerMedia::openIDSetup(const std::string &openid_url, const std::string
LLSD headers = LLSD::emptyMap();
// Keep LLHTTPClient from adding an "Accept: application/llsd+xml" header
- headers["Accept"] = "*/*";
+ headers[HTTP_OUT_HEADER_ACCEPT] = "*/*";
// and use the expected content-type for a post, instead of the LLHTTPClient::postRaw() default of "application/octet-stream"
- headers["Content-Type"] = "application/x-www-form-urlencoded";
+ headers[HTTP_OUT_HEADER_CONTENT_TYPE] = "application/x-www-form-urlencoded";
// postRaw() takes ownership of the buffer and releases it later, so we need to allocate a new buffer here.
size_t size = openid_token.size();
@@ -1534,16 +1524,16 @@ void LLViewerMedia::createSpareBrowserMediaSource()
// popping up at the moment we start a media plugin.
if (!sSpareBrowserMediaSource && !gSavedSettings.getBOOL("PluginAttachDebuggerToPlugins"))
{
- // The null owner will keep the browser plugin from fully initializing
+ // The null owner will keep the browser plugin from fully initializing
// (specifically, it keeps LLPluginClassMedia from negotiating a size change,
// which keeps MediaPluginWebkit::initBrowserWindow from doing anything until we have some necessary data, like the background color)
- sSpareBrowserMediaSource = LLViewerMediaImpl::newSourceFromMediaType("text/html", NULL, 0, 0);
+ sSpareBrowserMediaSource = LLViewerMediaImpl::newSourceFromMediaType(HTTP_CONTENT_TEXT_HTML, NULL, 0, 0);
}
}
/////////////////////////////////////////////////////////////////////////////////////////
// static
-LLPluginClassMedia* LLViewerMedia::getSpareBrowserMediaSource()
+LLPluginClassMedia* LLViewerMedia::getSpareBrowserMediaSource()
{
LLPluginClassMedia* result = sSpareBrowserMediaSource;
sSpareBrowserMediaSource = NULL;
@@ -1592,7 +1582,7 @@ std::string LLViewerMedia::getParcelAudioURL()
// static
void LLViewerMedia::initClass()
{
- gIdleCallbacks.addFunction(LLViewerMedia::updateMedia, NULL);
+ gIdleCallbacks.addFunction(LLViewerMedia::updateMedia, NULL);
sTeleportFinishConnection = LLViewerParcelMgr::getInstance()->
setTeleportFinishedCallback(boost::bind(&LLViewerMedia::onTeleportFinished));
}
@@ -1603,6 +1593,17 @@ void LLViewerMedia::cleanupClass()
{
gIdleCallbacks.deleteFunction(LLViewerMedia::updateMedia, NULL);
sTeleportFinishConnection.disconnect();
+ if (sSpareBrowserMediaSource != NULL)
+ {
+ delete sSpareBrowserMediaSource;
+ sSpareBrowserMediaSource = NULL;
+ }
+
+ if (sCookieStore != NULL)
+ {
+ delete sCookieStore;
+ sCookieStore = NULL;
+ }
}
//////////////////////////////////////////////////////////////////////////////////////////
@@ -1669,7 +1670,8 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id,
mNavigateSuspendedDeferred(false),
mIsUpdated(false),
mTrustedBrowser(false),
- mZoomFactor(1.0)
+ mZoomFactor(1.0),
+ mCleanBrowser(false)
{
// Set up the mute list observer if it hasn't been set up already.
@@ -1793,14 +1795,16 @@ void LLViewerMediaImpl::setMediaType(const std::string& media_type)
//////////////////////////////////////////////////////////////////////////////////////////
/*static*/
-LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_type, LLPluginClassMediaOwner *owner /* may be NULL */, S32 default_width, S32 default_height, const std::string target)
+LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_type, LLPluginClassMediaOwner *owner /* may be NULL */, S32 default_width, S32 default_height, const std::string target, bool clean_browser)
{
std::string plugin_basename = LLMIMETypes::implType(media_type);
LLPluginClassMedia* media_source = NULL;
// HACK: we always try to keep a spare running webkit plugin around to improve launch times.
// If a spare was already created before PluginAttachDebuggerToPlugins was set, don't use it.
- if(plugin_basename == "media_plugin_webkit" && !gSavedSettings.getBOOL("PluginAttachDebuggerToPlugins"))
+ // Do not use a spare if launching with full viewer control (e.g. Facebook, Twitter and few others)
+ if ((plugin_basename == "media_plugin_webkit") &&
+ !gSavedSettings.getBOOL("PluginAttachDebuggerToPlugins") && !clean_browser)
{
media_source = LLViewerMedia::getSpareBrowserMediaSource();
if(media_source)
@@ -1812,7 +1816,6 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
return media_source;
}
}
-
if(plugin_basename.empty())
{
LL_WARNS_ONCE("Media") << "Couldn't find plugin for media type " << media_type << LL_ENDL;
@@ -1856,18 +1859,18 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
// collect 'cookies enabled' setting from prefs and send to embedded browser
bool cookies_enabled = gSavedSettings.getBOOL( "CookiesEnabled" );
- media_source->enable_cookies( cookies_enabled );
+ media_source->enable_cookies( cookies_enabled || clean_browser);
// collect 'plugins enabled' setting from prefs and send to embedded browser
bool plugins_enabled = gSavedSettings.getBOOL( "BrowserPluginsEnabled" );
- media_source->setPluginsEnabled( plugins_enabled );
+ media_source->setPluginsEnabled( plugins_enabled || clean_browser);
// collect 'javascript enabled' setting from prefs and send to embedded browser
bool javascript_enabled = gSavedSettings.getBOOL( "BrowserJavascriptEnabled" );
- media_source->setJavascriptEnabled( javascript_enabled );
+ media_source->setJavascriptEnabled( javascript_enabled || clean_browser);
bool media_plugin_debugging_enabled = gSavedSettings.getBOOL("MediaPluginDebugging");
- media_source->enableMediaPluginDebugging( media_plugin_debugging_enabled );
+ media_source->enableMediaPluginDebugging( media_plugin_debugging_enabled || clean_browser);
media_source->setTarget(target);
@@ -1922,7 +1925,7 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type)
// Save the MIME type that really caused the plugin to load
mCurrentMimeType = mMimeType;
- LLPluginClassMedia* media_source = newSourceFromMediaType(mMimeType, this, mMediaWidth, mMediaHeight, mTarget);
+ LLPluginClassMedia* media_source = newSourceFromMediaType(mMimeType, this, mMediaWidth, mMediaHeight, mTarget, mCleanBrowser);
if (media_source)
{
@@ -1958,7 +1961,7 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type)
// Due to the ordering of messages, it's possible we wouldn't get that information back in time to send cookies before sending a navigate message,
// which could cause odd race conditions.
std::string all_cookies = LLViewerMedia::getCookieStore()->getAllCookies();
- lldebugs << "setting cookies: " << all_cookies << llendl;
+ LL_DEBUGS() << "setting cookies: " << all_cookies << LL_ENDL;
if(!all_cookies.empty())
{
media_source->set_cookies(all_cookies);
@@ -2004,7 +2007,7 @@ void LLViewerMediaImpl::loadURI()
// Do not log the query parts
LLURI u(uri);
std::string sanitized_uri = (u.query().empty() ? uri : u.scheme() + "://" + u.authority() + u.path());
- llinfos << "Asking media source to load URI: " << sanitized_uri << llendl;
+ LL_INFOS() << "Asking media source to load URI: " << sanitized_uri << LL_ENDL;
}
mMediaSource->loadURI( uri );
@@ -2277,7 +2280,7 @@ void LLViewerMediaImpl::mouseDown(S32 x, S32 y, MASK mask, S32 button)
scaleMouse(&x, &y);
mLastMouseX = x;
mLastMouseY = y;
-// llinfos << "mouse down (" << x << ", " << y << ")" << llendl;
+// LL_INFOS() << "mouse down (" << x << ", " << y << ")" << LL_ENDL;
if (mMediaSource)
{
mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_DOWN, button, x, y, mask);
@@ -2290,7 +2293,7 @@ void LLViewerMediaImpl::mouseUp(S32 x, S32 y, MASK mask, S32 button)
scaleMouse(&x, &y);
mLastMouseX = x;
mLastMouseY = y;
-// llinfos << "mouse up (" << x << ", " << y << ")" << llendl;
+// LL_INFOS() << "mouse up (" << x << ", " << y << ")" << LL_ENDL;
if (mMediaSource)
{
mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_UP, button, x, y, mask);
@@ -2303,7 +2306,7 @@ void LLViewerMediaImpl::mouseMove(S32 x, S32 y, MASK mask)
scaleMouse(&x, &y);
mLastMouseX = x;
mLastMouseY = y;
-// llinfos << "mouse move (" << x << ", " << y << ")" << llendl;
+// LL_INFOS() << "mouse move (" << x << ", " << y << ")" << LL_ENDL;
if (mMediaSource)
{
mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_MOVE, 0, x, y, mask);
@@ -2543,7 +2546,7 @@ void LLViewerMediaImpl::unload()
}
//////////////////////////////////////////////////////////////////////////////////////////
-void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mime_type, bool rediscover_type, bool server_request)
+void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mime_type, bool rediscover_type, bool server_request, bool clean_browser)
{
cancelMimeTypeProbe();
@@ -2556,6 +2559,7 @@ void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mi
// Always set the current URL and MIME type.
mMediaURL = url;
mMimeType = mime_type;
+ mCleanBrowser = clean_browser;
// Clear the current media URL, since it will no longer be correct.
mCurrentMediaURL.clear();
@@ -2576,7 +2580,7 @@ void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mi
// Do not log the query parts
LLURI u(url);
std::string sanitized_url = (u.query().empty() ? url : u.scheme() + "://" + u.authority() + u.path());
- llinfos << "NOT LOADING media id= " << mTextureId << " url=" << sanitized_url << ", mime_type=" << mime_type << llendl;
+ LL_INFOS() << "NOT LOADING media id= " << mTextureId << " url=" << sanitized_url << ", mime_type=" << mime_type << LL_ENDL;
}
// This impl should not be loaded at this time.
@@ -2596,19 +2600,19 @@ void LLViewerMediaImpl::navigateInternal()
// Do not log the query parts
LLURI u(mMediaURL);
std::string sanitized_url = (u.query().empty() ? mMediaURL : u.scheme() + "://" + u.authority() + u.path());
- llinfos << "media id= " << mTextureId << " url=" << sanitized_url << ", mime_type=" << mMimeType << llendl;
+ LL_INFOS() << "media id= " << mTextureId << " url=" << sanitized_url << ", mime_type=" << mMimeType << LL_ENDL;
}
if(mNavigateSuspended)
{
- llwarns << "Deferring navigate." << llendl;
+ LL_WARNS() << "Deferring navigate." << LL_ENDL;
mNavigateSuspendedDeferred = true;
return;
}
if(mMimeTypeProbe != NULL)
{
- llwarns << "MIME type probe already in progress -- bailing out." << llendl;
+ LL_WARNS() << "MIME type probe already in progress -- bailing out." << LL_ENDL;
return;
}
@@ -2648,16 +2652,16 @@ void LLViewerMediaImpl::navigateInternal()
// Accept: application/llsd+xml
// which is really not what we want.
LLSD headers = LLSD::emptyMap();
- headers["Accept"] = "*/*";
+ headers[HTTP_OUT_HEADER_ACCEPT] = "*/*";
// Allow cookies in the response, to prevent a redirect loop when accessing join.secondlife.com
- headers["Cookie"] = "";
+ headers[HTTP_OUT_HEADER_COOKIE] = "";
LLHTTPClient::getHeaderOnly( mMediaURL, new LLMimeDiscoveryResponder(this), headers, 10.0f);
}
else if("data" == scheme || "file" == scheme || "about" == scheme)
{
// FIXME: figure out how to really discover the type for these schemes
// We use "data" internally for a text/html url for loading the login screen
- if(initializeMedia("text/html"))
+ if(initializeMedia(HTTP_CONTENT_TEXT_HTML))
{
loadURI();
}
@@ -2761,14 +2765,14 @@ bool LLViewerMediaImpl::canNavigateBack()
}
//////////////////////////////////////////////////////////////////////////////////////////
-static LLFastTimer::DeclareTimer FTM_MEDIA_DO_UPDATE("Do Update");
-static LLFastTimer::DeclareTimer FTM_MEDIA_GET_DATA("Get Data");
-static LLFastTimer::DeclareTimer FTM_MEDIA_SET_SUBIMAGE("Set Subimage");
+static LLTrace::BlockTimerStatHandle FTM_MEDIA_DO_UPDATE("Do Update");
+static LLTrace::BlockTimerStatHandle FTM_MEDIA_GET_DATA("Get Data");
+static LLTrace::BlockTimerStatHandle FTM_MEDIA_SET_SUBIMAGE("Set Subimage");
void LLViewerMediaImpl::update()
{
- LLFastTimer t(FTM_MEDIA_DO_UPDATE);
+ LL_RECORD_BLOCK_TIME(FTM_MEDIA_DO_UPDATE);
if(mMediaSource == NULL)
{
if(mPriority == LLPluginClassMedia::PRIORITY_UNLOADED)
@@ -2870,7 +2874,7 @@ void LLViewerMediaImpl::update()
U8* data = NULL;
{
- LLFastTimer t(FTM_MEDIA_GET_DATA);
+ LL_RECORD_BLOCK_TIME(FTM_MEDIA_GET_DATA);
data = mMediaSource->getBitsData();
}
@@ -2879,7 +2883,7 @@ void LLViewerMediaImpl::update()
data += ( y_pos * mMediaSource->getTextureDepth() );
{
- LLFastTimer t(FTM_MEDIA_SET_SUBIMAGE);
+ LL_RECORD_BLOCK_TIME(FTM_MEDIA_SET_SUBIMAGE);
placeholder_image->setSubImage(
data,
mMediaSource->getBitsWidth(),
@@ -3328,7 +3332,7 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla
{
std::string uuid = plugin->getClickUUID();
- llinfos << "MEDIA_EVENT_CLOSE_REQUEST for uuid " << uuid << llendl;
+ LL_INFOS() << "MEDIA_EVENT_CLOSE_REQUEST for uuid " << uuid << LL_ENDL;
if(uuid.empty())
{
@@ -3347,7 +3351,7 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla
{
std::string uuid = plugin->getClickUUID();
- llinfos << "MEDIA_EVENT_GEOMETRY_CHANGE for uuid " << uuid << llendl;
+ LL_INFOS() << "MEDIA_EVENT_GEOMETRY_CHANGE for uuid " << uuid << LL_ENDL;
if(uuid.empty())
{
@@ -3450,11 +3454,11 @@ BOOL LLViewerMediaImpl::isUpdated()
return mIsUpdated ;
}
-static LLFastTimer::DeclareTimer FTM_MEDIA_CALCULATE_INTEREST("Calculate Interest");
+static LLTrace::BlockTimerStatHandle FTM_MEDIA_CALCULATE_INTEREST("Calculate Interest");
void LLViewerMediaImpl::calculateInterest()
{
- LLFastTimer t(FTM_MEDIA_CALCULATE_INTEREST);
+ LL_RECORD_BLOCK_TIME(FTM_MEDIA_CALCULATE_INTEREST);
LLViewerMediaTexture* texture = LLViewerTextureManager::findMediaTexture( mTextureId );
if(texture != NULL)
@@ -3637,16 +3641,16 @@ void LLViewerMediaImpl::setNavState(EMediaNavState state)
switch (state)
{
- case MEDIANAVSTATE_NONE: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_NONE" << llendl; break;
- case MEDIANAVSTATE_BEGUN: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_BEGUN" << llendl; break;
- case MEDIANAVSTATE_FIRST_LOCATION_CHANGED: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_FIRST_LOCATION_CHANGED" << llendl; break;
- case MEDIANAVSTATE_FIRST_LOCATION_CHANGED_SPURIOUS: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_FIRST_LOCATION_CHANGED_SPURIOUS" << llendl; break;
- case MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED" << llendl; break;
- case MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED_SPURIOUS: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED_SPURIOUS" << llendl; break;
- case MEDIANAVSTATE_SERVER_SENT: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_SERVER_SENT" << llendl; break;
- case MEDIANAVSTATE_SERVER_BEGUN: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_SERVER_BEGUN" << llendl; break;
- case MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED" << llendl; break;
- case MEDIANAVSTATE_SERVER_COMPLETE_BEFORE_LOCATION_CHANGED: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_SERVER_COMPLETE_BEFORE_LOCATION_CHANGED" << llendl; break;
+ case MEDIANAVSTATE_NONE: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_NONE" << LL_ENDL; break;
+ case MEDIANAVSTATE_BEGUN: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_BEGUN" << LL_ENDL; break;
+ case MEDIANAVSTATE_FIRST_LOCATION_CHANGED: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_FIRST_LOCATION_CHANGED" << LL_ENDL; break;
+ case MEDIANAVSTATE_FIRST_LOCATION_CHANGED_SPURIOUS: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_FIRST_LOCATION_CHANGED_SPURIOUS" << LL_ENDL; break;
+ case MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED" << LL_ENDL; break;
+ case MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED_SPURIOUS: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED_SPURIOUS" << LL_ENDL; break;
+ case MEDIANAVSTATE_SERVER_SENT: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_SERVER_SENT" << LL_ENDL; break;
+ case MEDIANAVSTATE_SERVER_BEGUN: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_SERVER_BEGUN" << LL_ENDL; break;
+ case MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED" << LL_ENDL; break;
+ case MEDIANAVSTATE_SERVER_COMPLETE_BEFORE_LOCATION_CHANGED: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_SERVER_COMPLETE_BEFORE_LOCATION_CHANGED" << LL_ENDL; break;
}
}
@@ -3678,7 +3682,7 @@ void LLViewerMediaImpl::cancelMimeTypeProbe()
// The above should already have set mMimeTypeProbe to NULL.
if(mMimeTypeProbe != NULL)
{
- llerrs << "internal error: mMimeTypeProbe is not NULL after cancelling request." << llendl;
+ LL_ERRS() << "internal error: mMimeTypeProbe is not NULL after cancelling request." << LL_ENDL;
}
}
}
@@ -3760,10 +3764,10 @@ bool LLViewerMediaImpl::shouldShowBasedOnClass() const
bool attached_to_another_avatar = isAttachedToAnotherAvatar();
bool inside_parcel = isInAgentParcel();
- // llinfos << " hasFocus = " << hasFocus() <<
+ // LL_INFOS() << " hasFocus = " << hasFocus() <<
// " others = " << (attached_to_another_avatar && gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_ON_OTHERS_SETTING)) <<
// " within = " << (inside_parcel && gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_WITHIN_PARCEL_SETTING)) <<
- // " outside = " << (!inside_parcel && gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING)) << llendl;
+ // " outside = " << (!inside_parcel && gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING)) << LL_ENDL;
// If it has focus, we should show it
// This is incorrect, and causes EXT-6750 (disabled attachment media still plays)
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index fff5b3fc08..6803adfaa2 100755
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -234,7 +234,7 @@ public:
void navigateReload();
void navigateHome();
void unload();
- void navigateTo(const std::string& url, const std::string& mime_type = "", bool rediscover_type = false, bool server_request = false);
+ void navigateTo(const std::string& url, const std::string& mime_type = "", bool rediscover_type = false, bool server_request = false, bool clean_browser = false);
void navigateInternal();
void navigateStop();
bool handleKeyHere(KEY key, MASK mask);
@@ -289,7 +289,7 @@ public:
void setTarget(const std::string& target) { mTarget = target; }
// utility function to create a ready-to-use media instance from a desired media type.
- static LLPluginClassMedia* newSourceFromMediaType(std::string media_type, LLPluginClassMediaOwner *owner /* may be NULL */, S32 default_width, S32 default_height, const std::string target = LLStringUtil::null);
+ static LLPluginClassMedia* newSourceFromMediaType(std::string media_type, LLPluginClassMediaOwner *owner /* may be NULL */, S32 default_width, S32 default_height, const std::string target = LLStringUtil::null, bool clean_browser = false);
// Internally set our desired browser user agent string, including
// the Second Life version and skin name. Used because we can
@@ -464,6 +464,7 @@ private:
bool mTrustedBrowser;
std::string mTarget;
LLNotificationPtr mNotification;
+ bool mCleanBrowser; // force the creation of a clean browsing target with full options enabled
private:
BOOL mIsUpdated ;
diff --git a/indra/newview/llviewermedia_streamingaudio.cpp b/indra/newview/llviewermedia_streamingaudio.cpp
index e2a74e8e3c..c107e8472c 100755
--- a/indra/newview/llviewermedia_streamingaudio.cpp
+++ b/indra/newview/llviewermedia_streamingaudio.cpp
@@ -56,20 +56,20 @@ void LLStreamingAudio_MediaPlugins::start(const std::string& url)
if (!mMediaPlugin) // lazy-init the underlying media plugin
{
mMediaPlugin = initializeMedia("audio/mpeg"); // assumes that whatever media implementation supports mp3 also supports vorbis.
- llinfos << "streaming audio mMediaPlugin is now " << mMediaPlugin << llendl;
+ LL_INFOS() << "streaming audio mMediaPlugin is now " << mMediaPlugin << LL_ENDL;
}
if(!mMediaPlugin)
return;
if (!url.empty()) {
- llinfos << "Starting internet stream: " << url << llendl;
+ LL_INFOS() << "Starting internet stream: " << url << LL_ENDL;
mURL = url;
mMediaPlugin->loadURI ( url );
mMediaPlugin->start();
- llinfos << "Playing stream..." << llendl;
+ LL_INFOS() << "Playing stream..." << LL_ENDL;
} else {
- llinfos << "setting stream to NULL"<< llendl;
+ LL_INFOS() << "setting stream to NULL"<< LL_ENDL;
mURL.clear();
mMediaPlugin->stop();
}
@@ -77,7 +77,7 @@ void LLStreamingAudio_MediaPlugins::start(const std::string& url)
void LLStreamingAudio_MediaPlugins::stop()
{
- llinfos << "Stopping internet stream." << llendl;
+ LL_INFOS() << "Stopping internet stream." << LL_ENDL;
if(mMediaPlugin)
{
mMediaPlugin->stop();
@@ -93,12 +93,12 @@ void LLStreamingAudio_MediaPlugins::pause(int pause)
if(pause)
{
- llinfos << "Pausing internet stream." << llendl;
+ LL_INFOS() << "Pausing internet stream." << LL_ENDL;
mMediaPlugin->pause();
}
else
{
- llinfos << "Unpausing internet stream." << llendl;
+ LL_INFOS() << "Unpausing internet stream." << LL_ENDL;
mMediaPlugin->start();
}
}
diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp
index 297906803b..aa019dfdd8 100755
--- a/indra/newview/llviewermediafocus.cpp
+++ b/indra/newview/llviewermediafocus.cpp
@@ -108,7 +108,7 @@ void LLViewerMediaFocus::setFocusFace(LLPointer<LLViewerObject> objectp, S32 fac
else
{
// This should never happen.
- llwarns << "Can't find media entry for focused face" << llendl;
+ LL_WARNS() << "Can't find media entry for focused face" << LL_ENDL;
}
media_impl->focus(true);
@@ -223,7 +223,7 @@ void LLViewerMediaFocus::setCameraZoom(LLViewerObject* object, LLVector3 normal,
F32 aspect_ratio = getBBoxAspectRatio(bbox, normal, &height, &width, &depth);
F32 camera_aspect = LLViewerCamera::getInstance()->getAspect();
- lldebugs << "normal = " << normal << ", aspect_ratio = " << aspect_ratio << ", camera_aspect = " << camera_aspect << llendl;
+ LL_DEBUGS() << "normal = " << normal << ", aspect_ratio = " << aspect_ratio << ", camera_aspect = " << camera_aspect << LL_ENDL;
// We will normally use the side of the volume aligned with the short side of the screen (i.e. the height for
// a screen in a landscape aspect ratio), however there is an edge case where the aspect ratio of the object is
@@ -241,14 +241,14 @@ void LLViewerMediaFocus::setCameraZoom(LLViewerObject* object, LLVector3 normal,
angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect());
distance = width * 0.5 * padding_factor / tan(angle_of_view * 0.5f );
- lldebugs << "using width (" << width << "), angle_of_view = " << angle_of_view << ", distance = " << distance << llendl;
+ LL_DEBUGS() << "using width (" << width << "), angle_of_view = " << angle_of_view << ", distance = " << distance << LL_ENDL;
}
else
{
angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getView());
distance = height * 0.5 * padding_factor / tan(angle_of_view * 0.5f );
- lldebugs << "using height (" << height << "), angle_of_view = " << angle_of_view << ", distance = " << distance << llendl;
+ LL_DEBUGS() << "using height (" << height << "), angle_of_view = " << angle_of_view << ", distance = " << distance << LL_ENDL;
}
distance += depth * 0.5;
@@ -452,7 +452,7 @@ F32 LLViewerMediaFocus::getBBoxAspectRatio(const LLBBox& bbox, const LLVector3&
F32 dot1 = 0.f;
F32 dot2 = 0.f;
- lldebugs << "bounding box local size = " << bbox_max << ", local_normal = " << local_normal << llendl;
+ LL_DEBUGS() << "bounding box local size = " << bbox_max << ", local_normal = " << local_normal << LL_ENDL;
// The largest component of the localized normal vector is the depth component
// meaning that the other two are the legs of the rectangle.
@@ -465,21 +465,21 @@ F32 LLViewerMediaFocus::getBBoxAspectRatio(const LLBBox& bbox, const LLVector3&
if(XgtY && XgtZ)
{
- lldebugs << "x component of normal is longest, using y and z" << llendl;
+ LL_DEBUGS() << "x component of normal is longest, using y and z" << LL_ENDL;
comp1.mV[VY] = bbox_max.mV[VY];
comp2.mV[VZ] = bbox_max.mV[VZ];
*depth = bbox_max.mV[VX];
}
else if(!XgtY && YgtZ)
{
- lldebugs << "y component of normal is longest, using x and z" << llendl;
+ LL_DEBUGS() << "y component of normal is longest, using x and z" << LL_ENDL;
comp1.mV[VX] = bbox_max.mV[VX];
comp2.mV[VZ] = bbox_max.mV[VZ];
*depth = bbox_max.mV[VY];
}
else
{
- lldebugs << "z component of normal is longest, using x and y" << llendl;
+ LL_DEBUGS() << "z component of normal is longest, using x and y" << LL_ENDL;
comp1.mV[VX] = bbox_max.mV[VX];
comp2.mV[VY] = bbox_max.mV[VY];
*depth = bbox_max.mV[VZ];
@@ -493,19 +493,19 @@ F32 LLViewerMediaFocus::getBBoxAspectRatio(const LLBBox& bbox, const LLVector3&
*height = comp1.length();
*width = comp2.length();
- lldebugs << "comp1 = " << comp1 << ", height = " << *height << llendl;
- lldebugs << "comp2 = " << comp2 << ", width = " << *width << llendl;
+ LL_DEBUGS() << "comp1 = " << comp1 << ", height = " << *height << LL_ENDL;
+ LL_DEBUGS() << "comp2 = " << comp2 << ", width = " << *width << LL_ENDL;
}
else
{
*height = comp2.length();
*width = comp1.length();
- lldebugs << "comp2 = " << comp2 << ", height = " << *height << llendl;
- lldebugs << "comp1 = " << comp1 << ", width = " << *width << llendl;
+ LL_DEBUGS() << "comp2 = " << comp2 << ", height = " << *height << LL_ENDL;
+ LL_DEBUGS() << "comp1 = " << comp1 << ", width = " << *width << LL_ENDL;
}
- lldebugs << "returning " << (*width / *height) << llendl;
+ LL_DEBUGS() << "returning " << (*width / *height) << LL_ENDL;
// Return the aspect ratio.
return *width / *height;
@@ -560,7 +560,7 @@ void LLViewerMediaFocus::focusZoomOnMedia(LLUUID media_id)
if(normal.isNull())
{
// If that didn't work, use the inverse of the camera "look at" axis, which should keep the camera pointed in the same direction.
-// llinfos << "approximate face normal invalid, using camera direction." << llendl;
+// LL_INFOS() << "approximate face normal invalid, using camera direction." << LL_ENDL;
normal = LLViewerCamera::getInstance()->getAtAxis();
normal *= (F32)-1.0f;
}
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index c7c8da27f3..38aaff9279 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -64,6 +64,7 @@
#include "llfloaterinventory.h"
#include "llfloaterimcontainer.h"
#include "llfloaterland.h"
+#include "llfloaterimnearbychat.h"
#include "llfloaterpathfindingcharacters.h"
#include "llfloaterpathfindinglinksets.h"
#include "llfloaterpay.h"
@@ -92,6 +93,7 @@
#include "llparcel.h"
#include "llrootview.h"
#include "llsceneview.h"
+#include "llscenemonitor.h"
#include "llselectmgr.h"
#include "llspellcheckmenuhandler.h"
#include "llstatusbar.h"
@@ -126,6 +128,7 @@
#include "lltoolgrab.h"
#include "llwindow.h"
#include "llpathfindingmanager.h"
+#include "llstartup.h"
#include "boost/unordered_map.hpp"
using namespace LLAvatarAppearanceDefines;
@@ -482,14 +485,12 @@ void init_menus()
gAttachSubMenu = gMenuBarView->findChildMenuByName("Attach Object", TRUE);
gDetachSubMenu = gMenuBarView->findChildMenuByName("Detach Object", TRUE);
-#if !MEM_TRACK_MEM
// Don't display the Memory console menu if the feature is turned off
LLMenuItemCheckGL *memoryMenu = gMenuBarView->getChild<LLMenuItemCheckGL>("Memory", TRUE);
if (memoryMenu)
{
memoryMenu->setVisible(FALSE);
}
-#endif
gMenuBarView->createJumpKeys();
@@ -528,19 +529,17 @@ class LLAdvancedToggleConsole : public view_listener_t
}
else if ("fast timers" == console_type)
{
- LLFloaterReg::toggleInstance("fast_timers");
+ LLFloaterReg::toggleInstance("block_timers");
}
else if ("scene view" == console_type)
{
toggle_visibility( (void*)gSceneView);
}
-
-#if MEM_TRACK_MEM
- else if ("memory view" == console_type)
+ else if ("scene monitor" == console_type)
{
- toggle_visibility( (void*)gDebugView->mMemoryView );
+ toggle_visibility( (void*)gSceneMonitorView);
}
-#endif
+
return true;
}
};
@@ -560,18 +559,16 @@ class LLAdvancedCheckConsole : public view_listener_t
}
else if ("fast timers" == console_type)
{
- new_value = LLFloaterReg::instanceVisible("fast_timers");
+ new_value = LLFloaterReg::instanceVisible("block_timers");
}
else if ("scene view" == console_type)
{
new_value = get_visibility( (void*) gSceneView);
}
-#if MEM_TRACK_MEM
- else if ("memory view" == console_type)
+ else if ("scene monitor" == console_type)
{
- new_value = get_visibility( (void*)gDebugView->mMemoryView );
+ new_value = get_visibility( (void*) gSceneMonitorView);
}
-#endif
return new_value;
}
@@ -1660,7 +1657,7 @@ class LLAdvancedAnimTenFaster : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- //llinfos << "LLAdvancedAnimTenFaster" << llendl;
+ //LL_INFOS() << "LLAdvancedAnimTenFaster" << LL_ENDL;
F32 time_factor = LLMotionController::getCurrentTimeFactor();
time_factor = llmin(time_factor + 0.1f, 2.f); // Upper limit is 200% speed
set_all_animation_time_factors(time_factor);
@@ -1672,7 +1669,7 @@ class LLAdvancedAnimTenSlower : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- //llinfos << "LLAdvancedAnimTenSlower" << llendl;
+ //LL_INFOS() << "LLAdvancedAnimTenSlower" << LL_ENDL;
F32 time_factor = LLMotionController::getCurrentTimeFactor();
time_factor = llmax(time_factor - 0.1f, 0.1f); // Lower limit is at 10% of normal speed
set_all_animation_time_factors(time_factor);
@@ -1971,9 +1968,9 @@ class LLAdvancedViewerEventRecorder : public view_listener_t
std::string command = userdata.asString();
if ("start playback" == command)
{
- llinfos << "Event Playback starting" << llendl;
+ LL_INFOS() << "Event Playback starting" << LL_ENDL;
LLViewerEventRecorder::instance().playbackRecording();
- llinfos << "Event Playback completed" << llendl;
+ LL_INFOS() << "Event Playback completed" << LL_ENDL;
}
else if ("stop playback" == command)
{
@@ -1982,12 +1979,12 @@ class LLAdvancedViewerEventRecorder : public view_listener_t
else if ("start recording" == command)
{
LLViewerEventRecorder::instance().setEventLoggingOn();
- llinfos << "Event recording started" << llendl;
+ LL_INFOS() << "Event recording started" << LL_ENDL;
}
else if ("stop recording" == command)
{
LLViewerEventRecorder::instance().setEventLoggingOff();
- llinfos << "Event recording stopped" << llendl;
+ LL_INFOS() << "Event recording stopped" << LL_ENDL;
}
return true;
@@ -2594,11 +2591,11 @@ bool enable_object_touch(LLUICtrl* ctrl)
LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode();
if (node && node->mValid && !node->mTouchName.empty())
{
- gMenuHolder->childSetText(item_name, node->mTouchName);
+ gMenuHolder->childSetValue(item_name, node->mTouchName);
}
else
{
- gMenuHolder->childSetText(item_name, get_default_item_label(item_name));
+ gMenuHolder->childSetValue(item_name, get_default_item_label(item_name));
}
return new_value;
@@ -3234,7 +3231,7 @@ class LLAvatarDebug : public view_listener_t
{
((LLVOAvatarSelf *)avatar)->dumpLocalTextures();
}
- llinfos << "Dumping temporary asset data to simulator logs for avatar " << avatar->getID() << llendl;
+ LL_INFOS() << "Dumping temporary asset data to simulator logs for avatar " << avatar->getID() << LL_ENDL;
std::vector<std::string> strings;
strings.push_back(avatar->getID().asString());
LLUUID invoice;
@@ -3508,7 +3505,7 @@ void handle_buy_contents(LLSaleInfo sale_info)
void handle_region_dump_temp_asset_data(void*)
{
- llinfos << "Dumping temporary asset data to simulator logs" << llendl;
+ LL_INFOS() << "Dumping temporary asset data to simulator logs" << LL_ENDL;
std::vector<std::string> strings;
LLUUID invoice;
send_generic_message("dumptempassetdata", strings, invoice);
@@ -3516,7 +3513,7 @@ void handle_region_dump_temp_asset_data(void*)
void handle_region_clear_temp_asset_data(void*)
{
- llinfos << "Clearing temporary asset data" << llendl;
+ LL_INFOS() << "Clearing temporary asset data" << LL_ENDL;
std::vector<std::string> strings;
LLUUID invoice;
send_generic_message("cleartempassetdata", strings, invoice);
@@ -3527,14 +3524,14 @@ void handle_region_dump_settings(void*)
LLViewerRegion* regionp = gAgent.getRegion();
if (regionp)
{
- llinfos << "Damage: " << (regionp->getAllowDamage() ? "on" : "off") << llendl;
- llinfos << "Landmark: " << (regionp->getAllowLandmark() ? "on" : "off") << llendl;
- llinfos << "SetHome: " << (regionp->getAllowSetHome() ? "on" : "off") << llendl;
- llinfos << "ResetHome: " << (regionp->getResetHomeOnTeleport() ? "on" : "off") << llendl;
- llinfos << "SunFixed: " << (regionp->getSunFixed() ? "on" : "off") << llendl;
- llinfos << "BlockFly: " << (regionp->getBlockFly() ? "on" : "off") << llendl;
- llinfos << "AllowP2P: " << (regionp->getAllowDirectTeleport() ? "on" : "off") << llendl;
- llinfos << "Water: " << (regionp->getWaterHeight()) << llendl;
+ LL_INFOS() << "Damage: " << (regionp->getAllowDamage() ? "on" : "off") << LL_ENDL;
+ LL_INFOS() << "Landmark: " << (regionp->getAllowLandmark() ? "on" : "off") << LL_ENDL;
+ LL_INFOS() << "SetHome: " << (regionp->getAllowSetHome() ? "on" : "off") << LL_ENDL;
+ LL_INFOS() << "ResetHome: " << (regionp->getResetHomeOnTeleport() ? "on" : "off") << LL_ENDL;
+ LL_INFOS() << "SunFixed: " << (regionp->getSunFixed() ? "on" : "off") << LL_ENDL;
+ LL_INFOS() << "BlockFly: " << (regionp->getBlockFly() ? "on" : "off") << LL_ENDL;
+ LL_INFOS() << "AllowP2P: " << (regionp->getAllowDirectTeleport() ? "on" : "off") << LL_ENDL;
+ LL_INFOS() << "Water: " << (regionp->getWaterHeight()) << LL_ENDL;
}
}
@@ -3565,7 +3562,7 @@ void handle_dump_focus()
{
LLUICtrl *ctrl = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus());
- llinfos << "Keyboard focus " << (ctrl ? ctrl->getName() : "(none)") << llendl;
+ LL_INFOS() << "Keyboard focus " << (ctrl ? ctrl->getName() : "(none)") << LL_ENDL;
}
class LLSelfStandUp : public view_listener_t
@@ -3777,7 +3774,7 @@ void process_grant_godlike_powers(LLMessageSystem* msg, void**)
}
else
{
- llwarns << "Grant godlike for wrong agent " << agent_id << llendl;
+ LL_WARNS() << "Grant godlike for wrong agent " << agent_id << LL_ENDL;
}
}
@@ -4119,7 +4116,7 @@ class LLEditEnableDuplicate : public view_listener_t
void handle_duplicate_in_place(void*)
{
- llinfos << "handle_duplicate_in_place" << llendl;
+ LL_INFOS() << "handle_duplicate_in_place" << LL_ENDL;
LLVector3 offset(0.f, 0.f, 0.f);
LLSelectMgr::getInstance()->selectDuplicate(offset, TRUE);
@@ -4290,13 +4287,16 @@ static bool get_derezzable_objects(
EDeRezDestination dest,
std::string& error,
LLViewerRegion*& first_region,
- LLDynamicArray<LLViewerObjectPtr>* derez_objectsp,
+ std::vector<LLViewerObjectPtr>* derez_objectsp,
bool only_check = false)
{
bool found = false;
LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
+ if (derez_objectsp)
+ derez_objectsp->reserve(selection->getRootObjectCount());
+
// Check conditions that we can't deal with, building a list of
// everything that we'll actually be derezzing.
for (LLObjectSelection::valid_root_iterator iter = selection->valid_root_begin();
@@ -4333,7 +4333,7 @@ static bool get_derezzable_objects(
&& dest != DRD_RETURN_TO_OWNER)
{
// this object is an asset container, derez its contents, not it
- llwarns << "Attempt to derez deprecated AssetContainer object type not supported." << llendl;
+ LL_WARNS() << "Attempt to derez deprecated AssetContainer object type not supported." << LL_ENDL;
/*
object->requestInventory(container_inventory_arrived,
(void *)(BOOL)(DRD_TAKE_INTO_AGENT_INVENTORY == dest));
@@ -4375,7 +4375,7 @@ static bool get_derezzable_objects(
break;
if (derez_objectsp)
- derez_objectsp->put(object);
+ derez_objectsp->push_back(object);
}
}
@@ -4395,16 +4395,16 @@ static void derez_objects(
const LLUUID& dest_id,
LLViewerRegion*& first_region,
std::string& error,
- LLDynamicArray<LLViewerObjectPtr>* objectsp)
+ std::vector<LLViewerObjectPtr>* objectsp)
{
- LLDynamicArray<LLViewerObjectPtr> derez_objects;
+ std::vector<LLViewerObjectPtr> derez_objects;
if (!objectsp) // if objects to derez not specified
{
// get them from selection
if (!get_derezzable_objects(dest, error, first_region, &derez_objects, false))
{
- llwarns << "No objects to derez" << llendl;
+ LL_WARNS() << "No objects to derez" << LL_ENDL;
return;
}
@@ -4424,13 +4424,13 @@ static void derez_objects(
// satisfy anybody.
const S32 MAX_ROOTS_PER_PACKET = 250;
const S32 MAX_PACKET_COUNT = 254;
- F32 packets = ceil((F32)objectsp->count() / (F32)MAX_ROOTS_PER_PACKET);
+ F32 packets = ceil((F32)objectsp->size() / (F32)MAX_ROOTS_PER_PACKET);
if(packets > (F32)MAX_PACKET_COUNT)
{
error = "AcquireErrorTooManyObjects";
}
- if(error.empty() && objectsp->count() > 0)
+ if(error.empty() && objectsp->size() > 0)
{
U8 d = (U8)dest;
LLUUID tid;
@@ -4455,11 +4455,11 @@ static void derez_objects(
msg->addU8Fast(_PREHASH_PacketCount, packet_count);
msg->addU8Fast(_PREHASH_PacketNumber, packet_number);
objects_in_packet = 0;
- while((object_index < objectsp->count())
+ while((object_index < objectsp->size())
&& (objects_in_packet++ < MAX_ROOTS_PER_PACKET))
{
- LLViewerObject* object = objectsp->get(object_index++);
+ LLViewerObject* object = objectsp->at(object_index++);
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_ObjectLocalID, object->getLocalID());
// VEFFECT: DerezObject
@@ -4539,7 +4539,7 @@ private:
LLObjectSelectionHandle mObjectSelection;
- LLDynamicArray<LLViewerObjectPtr> mReturnableObjects;
+ std::vector<LLViewerObjectPtr> mReturnableObjects;
std::string mError;
LLViewerRegion* mFirstRegion;
};
@@ -4892,7 +4892,7 @@ bool callback_show_buy_currency(const LLSD& notification, const LLSD& response)
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (0 == option)
{
- llinfos << "Loading page " << LLNotifications::instance().getGlobalString("BUY_CURRENCY_URL") << llendl;
+ LL_INFOS() << "Loading page " << LLNotifications::instance().getGlobalString("BUY_CURRENCY_URL") << LL_ENDL;
LLWeb::loadURL(LLNotifications::instance().getGlobalString("BUY_CURRENCY_URL"));
}
return false;
@@ -5411,7 +5411,7 @@ public:
};
LLObjectSelectionHandle mObjectSelection;
- LLDynamicArray<LLViewerObjectPtr> mReturnableObjects;
+ std::vector<LLViewerObjectPtr> mReturnableObjects;
std::string mError;
LLViewerRegion *mFirstRegion;
};
@@ -5579,7 +5579,7 @@ void print_agent_nvpairs(void*)
{
LLViewerObject *objectp;
- llinfos << "Agent Name Value Pairs" << llendl;
+ LL_INFOS() << "Agent Name Value Pairs" << LL_ENDL;
objectp = gObjectList.findObject(gAgentID);
if (objectp)
@@ -5588,10 +5588,10 @@ void print_agent_nvpairs(void*)
}
else
{
- llinfos << "Can't find agent object" << llendl;
+ LL_INFOS() << "Can't find agent object" << LL_ENDL;
}
- llinfos << "Camera at " << gAgentCamera.getCameraPositionGlobal() << llendl;
+ LL_INFOS() << "Camera at " << gAgentCamera.getCameraPositionGlobal() << LL_ENDL;
}
void show_debug_menus()
@@ -5644,7 +5644,7 @@ void toggle_debug_menus(void*)
// {
// return;
// }
-// llinfos << "Exporting selected objects:" << llendl;
+// LL_INFOS() << "Exporting selected objects:" << LL_ENDL;
// gExporterRequestID.generate();
// gExportDirectory = "";
@@ -5663,13 +5663,32 @@ void toggle_debug_menus(void*)
// LLViewerObject* object = node->getObject();
// msg->nextBlockFast(_PREHASH_ObjectData);
// msg->addUUIDFast(_PREHASH_ObjectID, object->getID());
-// llinfos << "Object: " << object->getID() << llendl;
+// LL_INFOS() << "Object: " << object->getID() << LL_ENDL;
// }
// msg->sendReliable(gAgent.getRegion()->getHost());
// gExportDialog = LLUploadDialog::modalUploadDialog("Exporting selected objects...");
// }
//
+
+class LLCommunicateNearbyChat : public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ LLFloaterIMContainer* im_box = LLFloaterIMContainer::getInstance();
+ bool nearby_visible = LLFloaterReg::getTypedInstance<LLFloaterIMNearbyChat>("nearby_chat")->isInVisibleChain();
+ if(nearby_visible && im_box->getSelectedSession() == LLUUID() && im_box->getConversationListItemSize() > 1)
+ {
+ im_box->selectNextorPreviousConversation(false);
+ }
+ else
+ {
+ LLFloaterReg::toggleInstanceOrBringToFront("nearby_chat");
+ }
+ return true;
+ }
+};
+
class LLWorldSetHomeLocation : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
@@ -6005,11 +6024,11 @@ bool enable_object_sit(LLUICtrl* ctrl)
LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode();
if (node && node->mValid && !node->mSitName.empty())
{
- gMenuHolder->childSetText(item_name, node->mSitName);
+ gMenuHolder->childSetValue(item_name, node->mSitName);
}
else
{
- gMenuHolder->childSetText(item_name, get_default_item_label(item_name));
+ gMenuHolder->childSetValue(item_name, get_default_item_label(item_name));
}
}
return !sitting_on_sel && is_object_sittable();
@@ -6186,7 +6205,7 @@ class LLPromptShowURL : public view_listener_t
std::string alert = param.substr(0, offset);
std::string url = param.substr(offset+1);
- if(gSavedSettings.getBOOL("UseExternalBrowser"))
+ if (LLWeb::useExternalBrowser(url))
{
LLSD payload;
payload["url"] = url;
@@ -6199,7 +6218,7 @@ class LLPromptShowURL : public view_listener_t
}
else
{
- llinfos << "PromptShowURL invalid parameters! Expecting \"ALERT,URL\"." << llendl;
+ LL_INFOS() << "PromptShowURL invalid parameters! Expecting \"ALERT,URL\"." << LL_ENDL;
}
return true;
}
@@ -6232,7 +6251,7 @@ class LLPromptShowFile : public view_listener_t
}
else
{
- llinfos << "PromptShowFile invalid parameters! Expecting \"ALERT,FILE\"." << llendl;
+ LL_INFOS() << "PromptShowFile invalid parameters! Expecting \"ALERT,FILE\"." << LL_ENDL;
}
return true;
}
@@ -6515,7 +6534,7 @@ void callback_attachment_drop(const LLSD& notification, const LLSD& response)
if (!object)
{
- llwarns << "handle_drop_attachment() - no object to drop" << llendl;
+ LL_WARNS() << "handle_drop_attachment() - no object to drop" << LL_ENDL;
return;
}
@@ -6532,13 +6551,13 @@ void callback_attachment_drop(const LLSD& notification, const LLSD& response)
if (!object)
{
- llwarns << "handle_detach() - no object to detach" << llendl;
+ LL_WARNS() << "handle_detach() - no object to detach" << LL_ENDL;
return;
}
if (object->isAvatar())
{
- llwarns << "Trying to detach avatar from avatar." << llendl;
+ LL_WARNS() << "Trying to detach avatar from avatar." << LL_ENDL;
return;
}
@@ -6563,7 +6582,7 @@ class LLAttachmentDrop : public view_listener_t
}
else
{
- llwarns << "Drop object not found" << llendl;
+ LL_WARNS() << "Drop object not found" << LL_ENDL;
return true;
}
@@ -6637,7 +6656,7 @@ class LLAttachmentDetach : public view_listener_t
LLViewerObject *object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
if (!object)
{
- llwarns << "handle_detach() - no object to detach" << llendl;
+ LL_WARNS() << "handle_detach() - no object to detach" << LL_ENDL;
return true;
}
@@ -6654,13 +6673,13 @@ class LLAttachmentDetach : public view_listener_t
if (!object)
{
- llwarns << "handle_detach() - no object to detach" << llendl;
+ LL_WARNS() << "handle_detach() - no object to detach" << LL_ENDL;
return true;
}
if (object->isAvatar())
{
- llwarns << "Trying to detach avatar from avatar." << llendl;
+ LL_WARNS() << "Trying to detach avatar from avatar." << LL_ENDL;
return true;
}
@@ -6924,14 +6943,14 @@ void queue_actions(LLFloaterScriptQueue* q, const std::string& msg)
}
else
{
- llerrs << "Bad logic." << llendl;
+ LL_ERRS() << "Bad logic." << LL_ENDL;
}
}
else
{
if (!q->start())
{
- llwarns << "Unexpected script compile failure." << llendl;
+ LL_WARNS() << "Unexpected script compile failure." << LL_ENDL;
}
}
}
@@ -6986,7 +7005,7 @@ class LLToolsSelectedScriptAction : public view_listener_t
}
else
{
- llwarns << "Failed to generate LLFloaterScriptQueue with action: " << action << llendl;
+ LL_WARNS() << "Failed to generate LLFloaterScriptQueue with action: " << action << LL_ENDL;
}
return true;
}
@@ -7118,12 +7137,12 @@ void handle_dump_attachments(void*)
!attached_object->mDrawable->isRenderType(0));
LLVector3 pos;
if (visible) pos = attached_object->mDrawable->getPosition();
- llinfos << "ATTACHMENT " << key << ": item_id=" << attached_object->getAttachmentItemID()
+ LL_INFOS() << "ATTACHMENT " << key << ": item_id=" << attached_object->getAttachmentItemID()
<< (attached_object ? " present " : " absent ")
<< (visible ? "visible " : "invisible ")
<< " at " << pos
<< " and " << (visible ? attached_object->getPosition() : LLVector3::zero)
- << llendl;
+ << LL_ENDL;
}
}
}
@@ -7556,7 +7575,7 @@ void handle_dump_avatar_local_textures(void*)
void handle_dump_timers()
{
- LLFastTimer::dumpCurTimes();
+ LLTrace::BlockTimer::dumpCurTimes();
}
void handle_debug_avatar_textures(void*)
@@ -7574,7 +7593,7 @@ void handle_grab_baked_texture(void* data)
if (!isAgentAvatarValid()) return;
const LLUUID& asset_id = gAgentAvatarp->grabBakedTexture(baked_tex_index);
- LL_INFOS("texture") << "Adding baked texture " << asset_id << " to inventory." << llendl;
+ LL_INFOS("texture") << "Adding baked texture " << asset_id << " to inventory." << LL_ENDL;
LLAssetType::EType asset_type = LLAssetType::AT_TEXTURE;
LLInventoryType::EType inv_type = LLInventoryType::IT_TEXTURE;
const LLUUID folder_id = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(asset_type));
@@ -7630,7 +7649,7 @@ void handle_grab_baked_texture(void* data)
}
else
{
- llwarns << "Can't find a folder to put it in" << llendl;
+ LL_WARNS() << "Can't find a folder to put it in" << LL_ENDL;
}
}
@@ -7806,7 +7825,7 @@ void handle_web_content_test(const LLSD& param)
void handle_show_url(const LLSD& param)
{
std::string url = param.asString();
- if(gSavedSettings.getBOOL("UseExternalBrowser"))
+ if (LLWeb::useExternalBrowser(url))
{
LLWeb::loadURLExternal(url);
}
@@ -7825,7 +7844,7 @@ void handle_report_bug(const LLSD& param)
replace["[ENVIRONMENT]"] = LLURI::escape(LLAppViewer::instance()->getViewerInfoString());
LLSLURL location_url;
LLAgentUI::buildSLURL(location_url);
- replace["[LOCATION]"] = location_url.getSLURLString();
+ replace["[LOCATION]"] = LLURI::escape(location_url.getSLURLString());
LLUIString file_bug_url = gSavedSettings.getString("ReportBugURL");
file_bug_url.setArgs(replace);
@@ -7844,11 +7863,12 @@ void handle_buy_currency_test(void*)
replace["[LANGUAGE]"] = LLUI::getLanguage();
LLStringUtil::format(url, replace);
- llinfos << "buy currency url " << url << llendl;
+ LL_INFOS() << "buy currency url " << url << LL_ENDL;
LLFloaterReg::showInstance("buy_currency_html", LLSD(url));
}
+// SUNSHINE CLEANUP - is only the request update at the end needed now?
void handle_rebake_textures(void*)
{
if (!isAgentAvatarValid()) return;
@@ -8235,6 +8255,45 @@ class LLWorldEnvSettings : public view_listener_t
}
};
+class LLWorldEnableEnvSettings : public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ bool result = false;
+ std::string tod = userdata.asString();
+
+ if (LLEnvManagerNew::instance().getUseRegionSettings())
+ {
+ return (tod == "region");
+ }
+
+ if (LLEnvManagerNew::instance().getUseFixedSky())
+ {
+ if (tod == "sunrise")
+ {
+ result = (LLEnvManagerNew::instance().getSkyPresetName() == "Sunrise");
+ }
+ else if (tod == "noon")
+ {
+ result = (LLEnvManagerNew::instance().getSkyPresetName() == "Midday");
+ }
+ else if (tod == "sunset")
+ {
+ result = (LLEnvManagerNew::instance().getSkyPresetName() == "Sunset");
+ }
+ else if (tod == "midnight")
+ {
+ result = (LLEnvManagerNew::instance().getSkyPresetName() == "Midnight");
+ }
+ else
+ {
+ llwarns << "Unknown item" << llendl;
+ }
+ }
+ return result;
+ }
+};
+
class LLWorldEnvPreset : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
@@ -8279,7 +8338,7 @@ class LLWorldEnvPreset : public view_listener_t
}
else
{
- llwarns << "Unknown item selected" << llendl;
+ LL_WARNS() << "Unknown item selected" << LL_ENDL;
}
return true;
@@ -8312,7 +8371,7 @@ class LLWorldEnableEnvPreset : public view_listener_t
}
else
{
- llwarns << "Unknown item" << llendl;
+ LL_WARNS() << "Unknown item" << LL_ENDL;
}
return false;
@@ -8548,6 +8607,9 @@ void initialize_menus()
// Me > Movement
view_listener_t::addMenu(new LLAdvancedAgentFlyingInfo(), "Agent.getFlying");
+ //Communicate Nearby chat
+ view_listener_t::addMenu(new LLCommunicateNearbyChat(), "Communicate.NearbyChat");
+
// Communicate > Voice morphing > Subscribe...
commit.add("Communicate.VoiceMorphing.Subscribe", boost::bind(&handle_voice_morphing_subscribe));
LLVivoxVoiceClient * voice_clientp = LLVivoxVoiceClient::getInstance();
@@ -8573,6 +8635,7 @@ void initialize_menus()
view_listener_t::addMenu(new LLWorldCheckAlwaysRun(), "World.CheckAlwaysRun");
view_listener_t::addMenu(new LLWorldEnvSettings(), "World.EnvSettings");
+ view_listener_t::addMenu(new LLWorldEnableEnvSettings(), "World.EnableEnvSettings");
view_listener_t::addMenu(new LLWorldEnvPreset(), "World.EnvPreset");
view_listener_t::addMenu(new LLWorldEnableEnvPreset(), "World.EnableEnvPreset");
view_listener_t::addMenu(new LLWorldPostProcess(), "World.PostProcess");
diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index be78603e2d..b2a37694fe 100755
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -215,7 +215,8 @@ std::string build_extensions_string(LLFilePicker::ELoadFilter filter)
#endif
case LLFilePicker::FFLOAD_XML:
return XML_EXTENSIONS;
- case LLFilePicker::FFLOAD_ALL:
+ case LLFilePicker::FFLOAD_ALL:
+ case LLFilePicker::FFLOAD_EXE:
return ALL_FILE_EXTENSIONS;
#endif
default:
@@ -253,7 +254,7 @@ const std::string upload_pick(void* data)
LLFilePicker& picker = LLFilePicker::instance();
if (!picker.getOpenFile(type))
{
- llinfos << "Couldn't import objects from file" << llendl;
+ LL_INFOS() << "Couldn't import objects from file" << LL_ENDL;
return std::string();
}
@@ -327,7 +328,7 @@ const std::string upload_pick(void* data)
std::string error_msg;
if (check_for_invalid_wav_formats(filename,error_msg))
{
- llinfos << error_msg << ": " << filename << llendl;
+ LL_INFOS() << error_msg << ": " << filename << LL_ENDL;
LLSD args;
args["FILE"] = filename;
LLNotificationsUtil::add( error_msg, args );
@@ -442,9 +443,9 @@ class LLFileUploadBulk : public view_listener_t
0,
LLFolderType::FT_NONE,
LLInventoryType::IT_NONE,
- LLFloaterPerms::getNextOwnerPerms(),
- LLFloaterPerms::getGroupPerms(),
- LLFloaterPerms::getEveryonePerms(),
+ LLFloaterPerms::getNextOwnerPerms("Uploads"),
+ LLFloaterPerms::getGroupPerms("Uploads"),
+ LLFloaterPerms::getEveryonePerms("Uploads"),
display_name,
callback,
expected_upload_cost,
@@ -455,7 +456,7 @@ class LLFileUploadBulk : public view_listener_t
}
else
{
- llinfos << "Couldn't import objects from file" << llendl;
+ LL_INFOS() << "Couldn't import objects from file" << LL_ENDL;
}
return true;
}
@@ -463,11 +464,11 @@ class LLFileUploadBulk : public view_listener_t
void upload_error(const std::string& error_message, const std::string& label, const std::string& filename, const LLSD& args)
{
- llwarns << error_message << llendl;
+ LL_WARNS() << error_message << LL_ENDL;
LLNotificationsUtil::add(label, args);
if(LLFile::remove(filename) == -1)
{
- lldebugs << "unable to remove temp file" << llendl;
+ LL_DEBUGS() << "unable to remove temp file" << LL_ENDL;
}
LLFilePicker::instance().reset();
}
@@ -476,8 +477,10 @@ class LLFileEnableCloseWindow : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- bool new_value = NULL != gFloaterView->getFrontmostClosableFloater();
- return new_value;
+ bool frontmost_fl_exists = (NULL != gFloaterView->getFrontmostClosableFloater());
+ bool frontmost_snapshot_fl_exists = (NULL != gSnapshotFloaterView->getFrontmostClosableFloater());
+
+ return frontmost_fl_exists || frontmost_snapshot_fl_exists;
}
};
@@ -485,7 +488,21 @@ class LLFileCloseWindow : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- LLFloater::closeFrontmostFloater();
+ bool frontmost_fl_exists = (NULL != gFloaterView->getFrontmostClosableFloater());
+ LLFloater* snapshot_floater = gSnapshotFloaterView->getFrontmostClosableFloater();
+
+ if(snapshot_floater && (!frontmost_fl_exists || snapshot_floater->hasFocus()))
+ {
+ snapshot_floater->closeFloater();
+ if (gFocusMgr.getKeyboardFocus() == NULL)
+ {
+ gFloaterView->focusFrontFloater();
+ }
+ }
+ else
+ {
+ LLFloater::closeFrontmostFloater();
+ }
return true;
}
};
@@ -494,7 +511,9 @@ class LLFileEnableCloseAllWindows : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- bool open_children = gFloaterView->allChildrenClosed() && !LLFloaterSnapshot::getInstance()->isInVisibleChain();
+ LLFloaterSnapshot* floater_snapshot = LLFloaterSnapshot::findInstance();
+ bool is_floater_snapshot_opened = floater_snapshot && floater_snapshot->isInVisibleChain();
+ bool open_children = gFloaterView->allChildrenClosed() && !is_floater_snapshot_opened;
return !open_children;
}
};
@@ -542,7 +561,7 @@ class LLFileTakeSnapshotToDisk : public view_listener_t
formatted = new LLImageJPEG(gSavedSettings.getS32("SnapshotQuality"));
break;
default:
- llwarns << "Unknown local snapshot format: " << fmt << llendl;
+ LL_WARNS() << "Unknown local snapshot format: " << fmt << LL_ENDL;
case LLFloaterSnapshot::SNAPSHOT_FORMAT_PNG:
formatted = new LLImagePNG;
break;
@@ -579,8 +598,8 @@ void handle_compress_image(void*)
{
std::string outfile = infile + ".j2c";
- llinfos << "Input: " << infile << llendl;
- llinfos << "Output: " << outfile << llendl;
+ LL_INFOS() << "Input: " << infile << LL_ENDL;
+ LL_INFOS() << "Output: " << outfile << LL_ENDL;
BOOL success;
@@ -588,11 +607,11 @@ void handle_compress_image(void*)
if (success)
{
- llinfos << "Compression complete" << llendl;
+ LL_INFOS() << "Compression complete" << LL_ENDL;
}
else
{
- llinfos << "Compression failed: " << LLImage::getLastError() << llendl;
+ LL_INFOS() << "Compression failed: " << LLImage::getLastError() << LL_ENDL;
}
infile = picker.getNextFile();
@@ -660,7 +679,7 @@ LLUUID upload_new_resource(
asset_type = LLAssetType::AT_SOUND; // tag it as audio
S32 encode_result = 0;
- llinfos << "Attempting to encode wav as an ogg file" << llendl;
+ LL_INFOS() << "Attempting to encode wav as an ogg file" << LL_ENDL;
encode_result = encode_vorbis_file(src_filename, filename);
@@ -711,8 +730,8 @@ LLUUID upload_new_resource(
"%254s %254s\n",
label, value);
- llinfos << "got: " << label << " = " << value
- << llendl;
+ LL_INFOS() << "got: " << label << " = " << value
+ << LL_ENDL;
if (EOF == tokens_read)
{
@@ -765,7 +784,7 @@ LLUUID upload_new_resource(
// read in and throw out most of the header except for the type
if (fread(buf, header_size, 1, in) != 1)
{
- llwarns << "Short read" << llendl;
+ LL_WARNS() << "Short read" << LL_ENDL;
}
memcpy(&type_num, buf + 16, sizeof(S16)); /* Flawfinder: ignore */
asset_type = (LLAssetType::EType)type_num;
@@ -779,7 +798,7 @@ LLUUID upload_new_resource(
{
if (fwrite(buf, 1, readbytes, out) != readbytes)
{
- llwarns << "Short write" << llendl;
+ LL_WARNS() << "Short write" << LL_ENDL;
}
}
fclose(out);
@@ -797,7 +816,7 @@ LLUUID upload_new_resource(
}
else
{
- llinfos << "Couldn't open .lin file " << src_filename << llendl;
+ LL_INFOS() << "Couldn't open .lin file " << src_filename << LL_ENDL;
}
}
else if (exten == "bvh")
@@ -873,13 +892,13 @@ LLUUID upload_new_resource(
}
else
{
- llwarns << error_message << llendl;
+ LL_WARNS() << error_message << LL_ENDL;
LLSD args;
args["ERROR_MESSAGE"] = error_message;
LLNotificationsUtil::add("ErrorMessage", args);
if(LLFile::remove(filename) == -1)
{
- lldebugs << "unable to remove temp file" << llendl;
+ LL_DEBUGS() << "unable to remove temp file" << LL_ENDL;
}
LLFilePicker::instance().reset();
}
@@ -947,7 +966,7 @@ void upload_done_callback(
if(is_balance_sufficient)
{
// Actually add the upload to inventory
- llinfos << "Adding " << uuid << " to inventory." << llendl;
+ LL_INFOS() << "Adding " << uuid << " to inventory." << LL_ENDL;
const LLUUID folder_id = gInventory.findCategoryUUIDForType(dest_loc);
if(folder_id.notNull())
{
@@ -964,7 +983,7 @@ void upload_done_callback(
}
else
{
- llwarns << "Can't find a folder to put it in" << llendl;
+ LL_WARNS() << "Can't find a folder to put it in" << LL_ENDL;
}
}
}
@@ -1004,9 +1023,9 @@ void upload_done_callback(
0,
LLFolderType::FT_NONE,
LLInventoryType::IT_NONE,
- PERM_NONE,
- PERM_NONE,
- PERM_NONE,
+ LLFloaterPerms::getNextOwnerPerms("Uploads"),
+ LLFloaterPerms::getGroupPerms("Uploads"),
+ LLFloaterPerms::getEveryonePerms("Uploads"),
display_name,
callback,
expected_upload_cost, // assuming next in a group of uploads is of roughly the same type, i.e. same upload cost
@@ -1096,17 +1115,17 @@ void upload_new_resource(
if( LLAssetType::AT_SOUND == asset_type )
{
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_SOUND_COUNT );
+ add(LLStatViewer::UPLOAD_SOUND, 1);
}
else
if( LLAssetType::AT_TEXTURE == asset_type )
{
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_TEXTURE_COUNT );
+ add(LLStatViewer::UPLOAD_TEXTURE, 1);
}
else
if( LLAssetType::AT_ANIMATION == asset_type)
{
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_ANIM_COUNT );
+ add(LLStatViewer::ANIMATION_UPLOADS, 1);
}
if(LLInventoryType::IT_NONE == inv_type)
@@ -1129,21 +1148,21 @@ void upload_new_resource(
upload_message.append(display_name);
LLUploadDialog::modalUploadDialog(upload_message);
- llinfos << "*** Uploading: " << llendl;
- llinfos << "Type: " << LLAssetType::lookup(asset_type) << llendl;
- llinfos << "UUID: " << uuid << llendl;
- llinfos << "Name: " << name << llendl;
- llinfos << "Desc: " << desc << llendl;
- llinfos << "Expected Upload Cost: " << expected_upload_cost << llendl;
- lldebugs << "Folder: " << gInventory.findCategoryUUIDForType((destination_folder_type == LLFolderType::FT_NONE) ? LLFolderType::assetTypeToFolderType(asset_type) : destination_folder_type) << llendl;
- lldebugs << "Asset Type: " << LLAssetType::lookup(asset_type) << llendl;
+ LL_INFOS() << "*** Uploading: " << LL_ENDL;
+ LL_INFOS() << "Type: " << LLAssetType::lookup(asset_type) << LL_ENDL;
+ LL_INFOS() << "UUID: " << uuid << LL_ENDL;
+ LL_INFOS() << "Name: " << name << LL_ENDL;
+ LL_INFOS() << "Desc: " << desc << LL_ENDL;
+ LL_INFOS() << "Expected Upload Cost: " << expected_upload_cost << LL_ENDL;
+ LL_DEBUGS() << "Folder: " << gInventory.findCategoryUUIDForType((destination_folder_type == LLFolderType::FT_NONE) ? LLFolderType::assetTypeToFolderType(asset_type) : destination_folder_type) << LL_ENDL;
+ LL_DEBUGS() << "Asset Type: " << LLAssetType::lookup(asset_type) << LL_ENDL;
std::string url = gAgent.getRegion()->getCapability(
"NewFileAgentInventory");
if ( !url.empty() )
{
- llinfos << "New Agent Inventory via capability" << llendl;
+ LL_INFOS() << "New Agent Inventory via capability" << LL_ENDL;
LLSD body;
body = generate_new_resource_upload_capability_body(
@@ -1166,7 +1185,7 @@ void upload_new_resource(
}
else
{
- llinfos << "NewAgentInventory capability not found, new agent inventory via asset system." << llendl;
+ LL_INFOS() << "NewAgentInventory capability not found, new agent inventory via asset system." << LL_ENDL;
// check for adequate funds
// TODO: do this check on the sim
if (LLAssetType::AT_SOUND == asset_type ||
@@ -1231,18 +1250,15 @@ void increase_new_upload_stats(LLAssetType::EType asset_type)
{
if ( LLAssetType::AT_SOUND == asset_type )
{
- LLViewerStats::getInstance()->incStat(
- LLViewerStats::ST_UPLOAD_SOUND_COUNT );
+ add(LLStatViewer::UPLOAD_SOUND, 1);
}
else if ( LLAssetType::AT_TEXTURE == asset_type )
{
- LLViewerStats::getInstance()->incStat(
- LLViewerStats::ST_UPLOAD_TEXTURE_COUNT );
+ add(LLStatViewer::UPLOAD_TEXTURE, 1);
}
else if ( LLAssetType::AT_ANIMATION == asset_type )
{
- LLViewerStats::getInstance()->incStat(
- LLViewerStats::ST_UPLOAD_ANIM_COUNT );
+ add(LLStatViewer::ANIMATION_UPLOADS, 1);
}
}
diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h
index 3136358b83..3034d00b22 100755
--- a/indra/newview/llviewermenufile.h
+++ b/indra/newview/llviewermenufile.h
@@ -31,6 +31,8 @@
#include "llassetstorage.h"
#include "llinventorytype.h"
#include "llfilepicker.h"
+#include "llthread.h"
+#include <queue>
class LLTransactionID;
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index df5c7d5c2e..44eb4361f1 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -151,6 +151,11 @@ LLFrameTimer gThrottleTimer;
const U32 OFFER_THROTTLE_MAX_COUNT=5; //number of items per time period
const F32 OFFER_THROTTLE_TIME=10.f; //time period in seconds
+// Agent Update Flags (U8)
+const U8 AU_FLAGS_NONE = 0x00;
+const U8 AU_FLAGS_HIDETITLE = 0x01;
+const U8 AU_FLAGS_CLIENT_AUTOPILOT = 0x02;
+
//script permissions
const std::string SCRIPT_QUESTIONS[SCRIPT_PERMISSION_EOF] =
{
@@ -372,9 +377,11 @@ void process_layer_data(LLMessageSystem *mesgsys, void **user_data)
{
LLViewerRegion *regionp = LLWorld::getInstance()->getRegion(mesgsys->getSender());
+ LL_DEBUGS_ONCE("SceneLoadTiming") << "Received layer data" << LL_ENDL;
+
if(!regionp)
{
- llwarns << "Invalid region for layer data." << llendl;
+ LL_WARNS() << "Invalid region for layer data." << LL_ENDL;
return;
}
S32 size;
@@ -400,11 +407,11 @@ void process_layer_data(LLMessageSystem *mesgsys, void **user_data)
LLVLData *vl_datap = new LLVLData(regionp, type, datap, size);
if (mesgsys->getReceiveCompressedSize())
{
- gVLManager.addLayerData(vl_datap, mesgsys->getReceiveCompressedSize());
+ gVLManager.addLayerData(vl_datap, (S32Bytes)mesgsys->getReceiveCompressedSize());
}
else
{
- gVLManager.addLayerData(vl_datap, mesgsys->getReceiveSize());
+ gVLManager.addLayerData(vl_datap, (S32Bytes)mesgsys->getReceiveSize());
}
}
@@ -644,32 +651,64 @@ void send_sound_trigger(const LLUUID& sound_id, F32 gain)
gAgent.sendMessage();
}
+static LLSD sSavedGroupInvite;
+static LLSD sSavedResponse;
+
bool join_group_response(const LLSD& notification, const LLSD& response)
{
- S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+// A bit of variable saving and restoring is used to deal with the case where your group list is full and you
+// receive an invitation to another group. The data from that invitation is stored in the sSaved
+// variables. If you then drop a group and click on the Join button the stored data is restored and used
+// to join the group.
+ LLSD notification_adjusted = notification;
+ LLSD response_adjusted = response;
+
+ std::string action = notification["name"];
+
+// Storing all the information by group id allows for the rare case of being at your maximum
+// group count and receiving more than one invitation.
+ std::string id = notification_adjusted["payload"]["group_id"].asString();
+
+ if ("JoinGroup" == action || "JoinGroupCanAfford" == action)
+ {
+ sSavedGroupInvite[id] = notification;
+ sSavedResponse[id] = response;
+ }
+ else if ("JoinedTooManyGroupsMember" == action)
+ {
+ S32 opt = LLNotificationsUtil::getSelectedOption(notification, response);
+ if (0 == opt) // Join button pressed
+ {
+ notification_adjusted = sSavedGroupInvite[id];
+ response_adjusted = sSavedResponse[id];
+ }
+ }
+
+ S32 option = LLNotificationsUtil::getSelectedOption(notification_adjusted, response_adjusted);
bool accept_invite = false;
- LLUUID group_id = notification["payload"]["group_id"].asUUID();
- LLUUID transaction_id = notification["payload"]["transaction_id"].asUUID();
- std::string name = notification["payload"]["name"].asString();
- std::string message = notification["payload"]["message"].asString();
- S32 fee = notification["payload"]["fee"].asInteger();
+ LLUUID group_id = notification_adjusted["payload"]["group_id"].asUUID();
+ LLUUID transaction_id = notification_adjusted["payload"]["transaction_id"].asUUID();
+ std::string name = notification_adjusted["payload"]["name"].asString();
+ std::string message = notification_adjusted["payload"]["message"].asString();
+ S32 fee = notification_adjusted["payload"]["fee"].asInteger();
if (option == 2 && !group_id.isNull())
{
LLGroupActions::show(group_id);
LLSD args;
args["MESSAGE"] = message;
- LLNotificationsUtil::add("JoinGroup", args, notification["payload"]);
+ LLNotificationsUtil::add("JoinGroup", args, notification_adjusted["payload"]);
return false;
}
+
if(option == 0 && !group_id.isNull())
{
// check for promotion or demotion.
S32 max_groups = gMaxAgentGroups;
if(gAgent.isInGroup(group_id)) ++max_groups;
- if(gAgent.mGroups.count() < max_groups)
+ if(gAgent.mGroups.size() < max_groups)
{
accept_invite = true;
}
@@ -677,7 +716,8 @@ bool join_group_response(const LLSD& notification, const LLSD& response)
{
LLSD args;
args["NAME"] = name;
- LLNotificationsUtil::add("JoinedTooManyGroupsMember", args, notification["payload"]);
+ LLNotificationsUtil::add("JoinedTooManyGroupsMember", args, notification_adjusted["payload"]);
+ return false;
}
}
@@ -691,7 +731,7 @@ bool join_group_response(const LLSD& notification, const LLSD& response)
args["COST"] = llformat("%d", fee);
// Set the fee for next time to 0, so that we don't keep
// asking about a fee.
- LLSD next_payload = notification["payload"];
+ LLSD next_payload = notification_adjusted["payload"];
next_payload["fee"] = 0;
LLNotificationsUtil::add("JoinGroupCanAfford",
args,
@@ -717,6 +757,9 @@ bool join_group_response(const LLSD& notification, const LLSD& response)
transaction_id);
}
+ sSavedGroupInvite[id] = LLSD::emptyMap();
+ sSavedResponse[id] = LLSD::emptyMap();
+
return false;
}
@@ -1003,7 +1046,12 @@ class LLOpenTaskOffer : public LLInventoryAddedObserver
protected:
/*virtual*/ void done()
{
- for (uuid_vec_t::iterator it = mAdded.begin(); it != mAdded.end();)
+ uuid_vec_t added;
+ for(uuid_set_t::const_iterator it = gInventory.getAddedIDs().begin(); it != gInventory.getAddedIDs().end(); ++it)
+ {
+ added.push_back(*it);
+ }
+ for (uuid_vec_t::iterator it = added.begin(); it != added.end();)
{
const LLUUID& item_uuid = *it;
bool was_moved = false;
@@ -1025,13 +1073,12 @@ protected:
if (was_moved)
{
- it = mAdded.erase(it);
+ it = added.erase(it);
}
else ++it;
}
- open_inventory_offer(mAdded, "");
- mAdded.clear();
+ open_inventory_offer(added, "");
}
};
@@ -1040,8 +1087,12 @@ class LLOpenTaskGroupOffer : public LLInventoryAddedObserver
protected:
/*virtual*/ void done()
{
- open_inventory_offer(mAdded, "group_offer");
- mAdded.clear();
+ uuid_vec_t added;
+ for(uuid_set_t::const_iterator it = gInventory.getAddedIDs().begin(); it != gInventory.getAddedIDs().end(); ++it)
+ {
+ added.push_back(*it);
+ }
+ open_inventory_offer(added, "group_offer");
gInventory.removeObserver(this);
delete this;
}
@@ -1214,7 +1265,7 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam
const LLInventoryObject *obj = gInventory.getObject(obj_id);
if (!obj)
{
- llwarns << "Cannot find object [ itemID:" << obj_id << " ] to open." << llendl;
+ LL_WARNS() << "Cannot find object [ itemID:" << obj_id << " ] to open." << LL_ENDL;
continue;
}
@@ -1490,7 +1541,7 @@ void LLOfferInfo::handleRespond(const LLSD& notification, const LLSD& response)
const std::string name = notification["name"].asString();
if(mRespondFunctions.find(name) == mRespondFunctions.end())
{
- llwarns << "Unexpected notification name : " << name << llendl;
+ LL_WARNS() << "Unexpected notification name : " << name << LL_ENDL;
llassert(!"Unexpected notification name");
return;
}
@@ -1876,6 +1927,7 @@ void inventory_offer_handler(LLOfferInfo* info)
return;
}
+ bool bAutoAccept(false);
// Avoid the Accept/Discard dialog if the user so desires. JC
if (gSavedSettings.getBOOL("AutoAcceptNewInventory")
&& (info->mType == LLAssetType::AT_NOTECARD
@@ -1884,8 +1936,7 @@ void inventory_offer_handler(LLOfferInfo* info)
{
// For certain types, just accept the items into the inventory,
// and possibly open them on receipt depending upon "ShowNewInventory".
- info->forceResponse(IOR_ACCEPT);
- return;
+ bAutoAccept = true;
}
// Strip any SLURL from the message display. (DEV-2754)
@@ -1953,7 +2004,7 @@ void inventory_offer_handler(LLOfferInfo* info)
LLNotification::Params p;
// Object -> Agent Inventory Offer
- if (info->mFromObject)
+ if (info->mFromObject && !bAutoAccept)
{
// Inventory Slurls don't currently work for non agent transfers, so only display the object name.
args["ITEM_SLURL"] = msg;
@@ -1999,11 +2050,12 @@ void inventory_offer_handler(LLOfferInfo* info)
send_do_not_disturb_message(gMessageSystem, info->mFromID);
}
- // Inform user that there is a script floater via toast system
+ if( !bAutoAccept ) // if we auto accept, do not pester the user
{
+ // Inform user that there is a script floater via toast system
payload["give_inventory_notification"] = TRUE;
- p.payload = payload;
- LLPostponedNotification::add<LLPostponedOfferNotification>(p, info->mFromID, false);
+ p.payload = payload;
+ LLPostponedNotification::add<LLPostponedOfferNotification>(p, info->mFromID, false);
}
}
@@ -2409,10 +2461,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
&& from_id.notNull() //not a system message
&& to_id.notNull()) //not global message
{
- // return a standard "do not disturb" message, but only do it to online IM
- // (i.e. not other auto responses and not store-and-forward IM)
-
- send_do_not_disturb_message(msg, from_id, session_id);
// now store incoming IM in chat history
@@ -2433,6 +2481,15 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
region_id,
position,
true);
+
+ if (!gIMMgr->isDNDMessageSend(session_id))
+ {
+ // return a standard "do not disturb" message, but only do it to online IM
+ // (i.e. not other auto responses and not store-and-forward IM)
+ send_do_not_disturb_message(msg, from_id, session_id);
+ gIMMgr->setDNDMessageSent(session_id, true);
+ }
+
}
else if (from_id.isNull())
{
@@ -2632,7 +2689,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
LLSD args;
args["SUBJECT"] = subj;
args["MESSAGE"] = mes;
- LLNotifications::instance().add(LLNotification::Params("GroupNotice").substitutions(args).payload(payload).time_stamp(timestamp));
+ LLNotifications::instance().add(LLNotification::Params("GroupNotice").substitutions(args).payload(payload).time_stamp(LLDate(timestamp)));
}
// Also send down the old path for now.
@@ -3458,7 +3515,7 @@ protected:
void handleFailure(int status, const std::string& err_msg)
{
- llwarns << "Translation failed for mesg " << m_origMesg << " toLang " << mToLang << " fromLang " << mFromLang << llendl;
+ LL_WARNS() << "Translation failed for mesg " << m_origMesg << " toLang " << mToLang << " fromLang " << mFromLang << LL_ENDL;
std::string msg = LLTrans::getString("TranslationFailed", LLSD().with("[REASON]", err_msg));
LLStringUtil::replaceString(msg, "\n", " "); // we want one-line error messages
@@ -3522,6 +3579,12 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
}
else
{
+ // make sure that we don't have an empty or all-whitespace name
+ LLStringUtil::trim(from_name);
+ if (from_name.empty())
+ {
+ from_name = LLTrans::getString("Unnamed");
+ }
chat.mFromName = from_name;
}
@@ -3704,6 +3767,15 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
LLNotificationsUI::LLNotificationManager::instance().onChat(chat, args);
}
+ // don't call notification for debug messages from not owned objects
+ if (chat.mChatType == CHAT_TYPE_DEBUG_MSG)
+ {
+ if (gAgentID != chat.mOwnerID)
+ {
+ return;
+ }
+ }
+
LLSD msg_notify = LLSD(LLSD::emptyMap());
msg_notify["session_id"] = LLUUID();
msg_notify["from_id"] = chat.mFromID;
@@ -3907,6 +3979,8 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
// Teleport is finished; it can't be cancelled now.
gViewerWindow->setProgressCancelButtonVisible(FALSE);
+ gPipeline.doResetVertexBuffers(true);
+
// Do teleport effect for where you're leaving
// VEFFECT: TeleportStart
LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE);
@@ -3986,6 +4060,8 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
gAgent.setTeleportState( LLAgent::TELEPORT_MOVING );
gAgent.setTeleportMessage(LLAgent::sTeleportProgressMessages["contacting"]);
+ LL_DEBUGS("CrossingCaps") << "Calling setSeedCapability from process_teleport_finish(). Seed cap == "
+ << seedCap << LL_ENDL;
regionp->setSeedCapability(seedCap);
// Don't send camera updates to the new region until we're
@@ -4101,10 +4177,6 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
gAgent.setTeleportState( LLAgent::TELEPORT_START_ARRIVAL );
- // set the appearance on teleport since the new sim does not
- // know what you look like.
- gAgent.sendAgentSetAppearance();
-
if (isAgentAvatarValid())
{
// Set the new position
@@ -4228,6 +4300,9 @@ void process_crossed_region(LLMessageSystem* msg, void**)
send_complete_agent_movement(sim_host);
LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host);
+
+ LL_DEBUGS("CrossingCaps") << "Calling setSeedCapability from process_crossed_region(). Seed cap == "
+ << seedCap << LL_ENDL;
regionp->setSeedCapability(seedCap);
}
@@ -4240,7 +4315,7 @@ const F32 THRESHOLD_HEAD_ROT_QDOT = 0.9997f; // ~= 2.5 degrees -- if its less th
const F32 MAX_HEAD_ROT_QDOT = 0.99999f; // ~= 0.5 degrees -- if its greater than this then no need to update head_rot
// between these values we delay the updates (but no more than one second)
-static LLFastTimer::DeclareTimer FTM_AGENT_UPDATE_SEND("Send Message");
+static LLTrace::BlockTimerStatHandle FTM_AGENT_UPDATE_SEND("Send Message");
void send_agent_update(BOOL force_send, BOOL send_reliable)
{
@@ -4417,14 +4492,14 @@ void send_agent_update(BOOL force_send, BOOL send_reliable)
update_sec = cur_sec;
//msg_number = 0;
max_update_count = llmax(max_update_count, update_count);
- llinfos << "Sent " << update_count << " AgentUpdate messages per second, max is " << max_update_count << llendl;
+ LL_INFOS() << "Sent " << update_count << " AgentUpdate messages per second, max is " << max_update_count << LL_ENDL;
}
update_sec = cur_sec;
update_count = 0;
}
*/
- LLFastTimer t(FTM_AGENT_UPDATE_SEND);
+ LL_RECORD_BLOCK_TIME(FTM_AGENT_UPDATE_SEND);
// Build the message
msg->newMessageFast(_PREHASH_AgentUpdate);
msg->nextBlockFast(_PREHASH_AgentData);
@@ -4490,18 +4565,18 @@ void send_agent_update(BOOL force_send, BOOL send_reliable)
// *TODO: Remove this dependency, or figure out a better way to handle
// this hack.
-extern U32 gObjectBits;
+extern U32Bits gObjectData;
void process_object_update(LLMessageSystem *mesgsys, void **user_data)
{
// Update the data counters
if (mesgsys->getReceiveCompressedSize())
{
- gObjectBits += mesgsys->getReceiveCompressedSize() * 8;
+ gObjectData += (U32Bytes)mesgsys->getReceiveCompressedSize();
}
else
{
- gObjectBits += mesgsys->getReceiveSize() * 8;
+ gObjectData += (U32Bytes)mesgsys->getReceiveSize();
}
// Update the object...
@@ -4513,11 +4588,11 @@ void process_compressed_object_update(LLMessageSystem *mesgsys, void **user_data
// Update the data counters
if (mesgsys->getReceiveCompressedSize())
{
- gObjectBits += mesgsys->getReceiveCompressedSize() * 8;
+ gObjectData += (U32Bytes)mesgsys->getReceiveCompressedSize();
}
else
{
- gObjectBits += mesgsys->getReceiveSize() * 8;
+ gObjectData += (U32Bytes)mesgsys->getReceiveSize();
}
// Update the object...
@@ -4529,11 +4604,11 @@ void process_cached_object_update(LLMessageSystem *mesgsys, void **user_data)
// Update the data counters
if (mesgsys->getReceiveCompressedSize())
{
- gObjectBits += mesgsys->getReceiveCompressedSize() * 8;
+ gObjectData += (U32Bytes)mesgsys->getReceiveCompressedSize();
}
else
{
- gObjectBits += mesgsys->getReceiveSize() * 8;
+ gObjectData += (U32Bytes)mesgsys->getReceiveSize();
}
// Update the object...
@@ -4545,38 +4620,40 @@ void process_terse_object_update_improved(LLMessageSystem *mesgsys, void **user_
{
if (mesgsys->getReceiveCompressedSize())
{
- gObjectBits += mesgsys->getReceiveCompressedSize() * 8;
+ gObjectData += (U32Bytes)mesgsys->getReceiveCompressedSize();
}
else
{
- gObjectBits += mesgsys->getReceiveSize() * 8;
+ gObjectData += (U32Bytes)mesgsys->getReceiveSize();
}
gObjectList.processCompressedObjectUpdate(mesgsys, user_data, OUT_TERSE_IMPROVED);
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_OBJECTS("Process Kill Objects");
-
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_OBJECTS("Process Kill Objects");
void process_kill_object(LLMessageSystem *mesgsys, void **user_data)
{
- LLFastTimer t(FTM_PROCESS_OBJECTS);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_OBJECTS);
LLUUID id;
- U32 local_id;
- S32 i;
- S32 num_objects;
- num_objects = mesgsys->getNumberOfBlocksFast(_PREHASH_ObjectData);
+ U32 ip = mesgsys->getSenderIP();
+ U32 port = mesgsys->getSenderPort();
+ LLViewerRegion* regionp = NULL;
+ {
+ LLHost host(ip, port);
+ regionp = LLWorld::getInstance()->getRegion(host);
+ }
- for (i = 0; i < num_objects; i++)
+ bool delete_object = LLViewerRegion::sVOCacheCullingEnabled;
+ S32 num_objects = mesgsys->getNumberOfBlocksFast(_PREHASH_ObjectData);
+ for (S32 i = 0; i < num_objects; ++i)
{
+ U32 local_id;
mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_ID, local_id, i);
- LLViewerObjectList::getUUIDFromLocal(id,
- local_id,
- gMessageSystem->getSenderIP(),
- gMessageSystem->getSenderPort());
+ LLViewerObjectList::getUUIDFromLocal(id, local_id, ip, port);
if (id == LLUUID::null)
{
LL_DEBUGS("Messaging") << "Unknown kill for local " << local_id << LL_ENDL;
@@ -4587,9 +4664,12 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data)
LL_DEBUGS("Messaging") << "Kill message for local " << local_id << LL_ENDL;
}
- // ...don't kill the avatar
- if (!(id == gAgentID))
+ if (id == gAgentID)
{
+ // never kill our avatar
+ continue;
+ }
+
LLViewerObject *objectp = gObjectList.findObject(id);
if (objectp)
{
@@ -4603,6 +4683,10 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data)
// Do the kill
gObjectList.killObject(objectp);
}
+
+ if(delete_object)
+ {
+ regionp->killCacheEntry(local_id);
}
// We should remove the object from selection after it is marked dead by gObjectList to make LLToolGrab,
@@ -4646,7 +4730,11 @@ void process_time_synch(LLMessageSystem *mesgsys, void **user_data)
void process_sound_trigger(LLMessageSystem *msg, void **)
{
- if (!gAudiop) return;
+ if (!gAudiop)
+ {
+ LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
+ return;
+ }
U64 region_handle = 0;
F32 gain = 0;
@@ -4706,6 +4794,7 @@ void process_preload_sound(LLMessageSystem *msg, void **user_data)
{
if (!gAudiop)
{
+ LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
return;
}
@@ -4736,9 +4825,9 @@ void process_preload_sound(LLMessageSystem *msg, void **user_data)
LLVector3d pos_global = objectp->getPositionGlobal();
if (gAgent.canAccessMaturityAtGlobal(pos_global))
{
- // Add audioData starts a transfer internally.
- sourcep->addAudioData(datap, FALSE);
-}
+ // Add audioData starts a transfer internally.
+ sourcep->addAudioData(datap, FALSE);
+ }
}
void process_attached_sound(LLMessageSystem *msg, void **user_data)
@@ -4820,145 +4909,18 @@ void process_sim_stats(LLMessageSystem *msg, void **user_data)
F32 stat_value;
msg->getU32("Stat", "StatID", stat_id, i);
msg->getF32("Stat", "StatValue", stat_value, i);
- switch (stat_id)
+ LLStatViewer::SimMeasurementSampler* measurementp = LLStatViewer::SimMeasurementSampler::getInstance((ESimStatID)stat_id);
+
+ if (measurementp )
{
- case LL_SIM_STAT_TIME_DILATION:
- LLViewerStats::getInstance()->mSimTimeDilation.addValue(stat_value);
- break;
- case LL_SIM_STAT_FPS:
- LLViewerStats::getInstance()->mSimFPS.addValue(stat_value);
- break;
- case LL_SIM_STAT_PHYSFPS:
- LLViewerStats::getInstance()->mSimPhysicsFPS.addValue(stat_value);
- break;
- case LL_SIM_STAT_AGENTUPS:
- LLViewerStats::getInstance()->mSimAgentUPS.addValue(stat_value);
- break;
- case LL_SIM_STAT_FRAMEMS:
- LLViewerStats::getInstance()->mSimFrameMsec.addValue(stat_value);
- break;
- case LL_SIM_STAT_NETMS:
- LLViewerStats::getInstance()->mSimNetMsec.addValue(stat_value);
- break;
- case LL_SIM_STAT_SIMOTHERMS:
- LLViewerStats::getInstance()->mSimSimOtherMsec.addValue(stat_value);
- break;
- case LL_SIM_STAT_SIMPHYSICSMS:
- LLViewerStats::getInstance()->mSimSimPhysicsMsec.addValue(stat_value);
- break;
- case LL_SIM_STAT_AGENTMS:
- LLViewerStats::getInstance()->mSimAgentMsec.addValue(stat_value);
- break;
- case LL_SIM_STAT_IMAGESMS:
- LLViewerStats::getInstance()->mSimImagesMsec.addValue(stat_value);
- break;
- case LL_SIM_STAT_SCRIPTMS:
- LLViewerStats::getInstance()->mSimScriptMsec.addValue(stat_value);
- break;
- case LL_SIM_STAT_NUMTASKS:
- LLViewerStats::getInstance()->mSimObjects.addValue(stat_value);
- break;
- case LL_SIM_STAT_NUMTASKSACTIVE:
- LLViewerStats::getInstance()->mSimActiveObjects.addValue(stat_value);
- break;
- case LL_SIM_STAT_NUMAGENTMAIN:
- LLViewerStats::getInstance()->mSimMainAgents.addValue(stat_value);
- break;
- case LL_SIM_STAT_NUMAGENTCHILD:
- LLViewerStats::getInstance()->mSimChildAgents.addValue(stat_value);
- break;
- case LL_SIM_STAT_NUMSCRIPTSACTIVE:
- LLViewerStats::getInstance()->mSimActiveScripts.addValue(stat_value);
- break;
- case LL_SIM_STAT_SCRIPT_EPS:
- LLViewerStats::getInstance()->mSimScriptEPS.addValue(stat_value);
- break;
- case LL_SIM_STAT_INPPS:
- LLViewerStats::getInstance()->mSimInPPS.addValue(stat_value);
- break;
- case LL_SIM_STAT_OUTPPS:
- LLViewerStats::getInstance()->mSimOutPPS.addValue(stat_value);
- break;
- case LL_SIM_STAT_PENDING_DOWNLOADS:
- LLViewerStats::getInstance()->mSimPendingDownloads.addValue(stat_value);
- break;
- case LL_SIM_STAT_PENDING_UPLOADS:
- LLViewerStats::getInstance()->mSimPendingUploads.addValue(stat_value);
- break;
- case LL_SIM_STAT_PENDING_LOCAL_UPLOADS:
- LLViewerStats::getInstance()->mSimPendingLocalUploads.addValue(stat_value);
- break;
- case LL_SIM_STAT_TOTAL_UNACKED_BYTES:
- LLViewerStats::getInstance()->mSimTotalUnackedBytes.addValue(stat_value / 1024.f);
- break;
- case LL_SIM_STAT_PHYSICS_PINNED_TASKS:
- LLViewerStats::getInstance()->mPhysicsPinnedTasks.addValue(stat_value);
- break;
- case LL_SIM_STAT_PHYSICS_LOD_TASKS:
- LLViewerStats::getInstance()->mPhysicsLODTasks.addValue(stat_value);
- break;
- case LL_SIM_STAT_SIMPHYSICSSTEPMS:
- LLViewerStats::getInstance()->mSimSimPhysicsStepMsec.addValue(stat_value);
- break;
- case LL_SIM_STAT_SIMPHYSICSSHAPEMS:
- LLViewerStats::getInstance()->mSimSimPhysicsShapeUpdateMsec.addValue(stat_value);
- break;
- case LL_SIM_STAT_SIMPHYSICSOTHERMS:
- LLViewerStats::getInstance()->mSimSimPhysicsOtherMsec.addValue(stat_value);
- break;
- case LL_SIM_STAT_SIMPHYSICSMEMORY:
- LLViewerStats::getInstance()->mPhysicsMemoryAllocated.addValue(stat_value);
- break;
- case LL_SIM_STAT_SIMSPARETIME:
- LLViewerStats::getInstance()->mSimSpareMsec.addValue(stat_value);
- break;
- case LL_SIM_STAT_SIMSLEEPTIME:
- LLViewerStats::getInstance()->mSimSleepMsec.addValue(stat_value);
- break;
- case LL_SIM_STAT_IOPUMPTIME:
- LLViewerStats::getInstance()->mSimPumpIOMsec.addValue(stat_value);
- break;
- case LL_SIM_STAT_PCTSCRIPTSRUN:
- LLViewerStats::getInstance()->mSimPctScriptsRun.addValue(stat_value);
- break;
- case LL_SIM_STAT_SIMAISTEPTIMEMS:
- LLViewerStats::getInstance()->mSimSimAIStepMsec.addValue(stat_value);
- break;
- case LL_SIM_STAT_SKIPPEDAISILSTEPS_PS:
- LLViewerStats::getInstance()->mSimSimSkippedSilhouetteSteps.addValue(stat_value);
- break;
- case LL_SIM_STAT_PCTSTEPPEDCHARACTERS:
- LLViewerStats::getInstance()->mSimSimPctSteppedCharacters.addValue(stat_value);
- break;
- default:
- // Used to be a commented out warning.
- LL_DEBUGS("Messaging") << "Unknown stat id" << stat_id << LL_ENDL;
- break;
+ measurementp->sample(stat_value);
+ }
+ else
+ {
+ LL_WARNS() << "Unknown sim stat identifier: " << stat_id << LL_ENDL;
}
}
- /*
- msg->getF32Fast(_PREHASH_Statistics, _PREHASH_PhysicsTimeDilation, time_dilation);
- LLViewerStats::getInstance()->mSimTDStat.addValue(time_dilation);
-
- // Process information
- // { CpuUsage F32 }
- // { SimMemTotal F32 }
- // { SimMemRSS F32 }
- // { ProcessUptime F32 }
- F32 cpu_usage;
- F32 sim_mem_total;
- F32 sim_mem_rss;
- F32 process_uptime;
- msg->getF32Fast(_PREHASH_Statistics, _PREHASH_CpuUsage, cpu_usage);
- msg->getF32Fast(_PREHASH_Statistics, _PREHASH_SimMemTotal, sim_mem_total);
- msg->getF32Fast(_PREHASH_Statistics, _PREHASH_SimMemRSS, sim_mem_rss);
- msg->getF32Fast(_PREHASH_Statistics, _PREHASH_ProcessUptime, process_uptime);
- LLViewerStats::getInstance()->mSimCPUUsageStat.addValue(cpu_usage);
- LLViewerStats::getInstance()->mSimMemTotalStat.addValue(sim_mem_total);
- LLViewerStats::getInstance()->mSimMemRSSStat.addValue(sim_mem_rss);
- */
-
//
// Various hacks that aren't statistics, but are being handled here.
//
@@ -5522,8 +5484,8 @@ static std::string reason_from_transaction_type(S32 transaction_type,
return std::string();
default:
- llwarns << "Unknown transaction type "
- << transaction_type << llendl;
+ LL_WARNS() << "Unknown transaction type "
+ << transaction_type << LL_ENDL;
return std::string();
}
}
@@ -5794,83 +5756,101 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock)
}
// some of the server notifications need special handling. This is where we do that.
-bool handle_teleport_access_blocked(LLSD& llsdBlock)
+bool handle_teleport_access_blocked(LLSD& llsdBlock, const std::string & notificationID, const std::string & defaultMessage)
{
- std::string notificationID("TeleportEntryAccessBlocked");
U8 regionAccess = static_cast<U8>(llsdBlock["_region_access"].asInteger());
std::string regionMaturity = LLViewerRegion::accessToString(regionAccess);
LLStringUtil::toLower(regionMaturity);
llsdBlock["REGIONMATURITY"] = regionMaturity;
bool returnValue = false;
- LLNotificationPtr maturityLevelNotification;
- std::string notifySuffix = "_Notify";
- if (regionAccess == SIM_ACCESS_MATURE)
- {
- if (gAgent.isTeen())
- {
- gAgent.clearTeleportRequest();
- maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock);
- returnValue = true;
+ LLNotificationPtr tp_failure_notification;
+ std::string notifySuffix;
- notifySuffix = "_NotifyAdultsOnly";
- }
- else if (gAgent.prefersPG())
+ if (notificationID == std::string("TeleportEntryAccessBlocked"))
+ {
+ notifySuffix = "_Notify";
+ if (regionAccess == SIM_ACCESS_MATURE)
{
- if (gAgent.hasRestartableFailedTeleportRequest())
+ if (gAgent.isTeen())
{
- maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback);
+ gAgent.clearTeleportRequest();
+ tp_failure_notification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock);
returnValue = true;
+
+ notifySuffix = "_NotifyAdultsOnly";
+ }
+ else if (gAgent.prefersPG())
+ {
+ if (gAgent.hasRestartableFailedTeleportRequest())
+ {
+ tp_failure_notification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback);
+ returnValue = true;
+ }
+ else
+ {
+ gAgent.clearTeleportRequest();
+ tp_failure_notification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
+ returnValue = true;
+ }
}
else
{
gAgent.clearTeleportRequest();
- maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
+ tp_failure_notification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
returnValue = true;
}
}
- else
- {
- gAgent.clearTeleportRequest();
- maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
- returnValue = true;
- }
- }
- else if (regionAccess == SIM_ACCESS_ADULT)
- {
- if (!gAgent.isAdult())
+ else if (regionAccess == SIM_ACCESS_ADULT)
{
- gAgent.clearTeleportRequest();
- maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock);
- returnValue = true;
-
- notifySuffix = "_NotifyAdultsOnly";
- }
- else if (gAgent.prefersPG() || gAgent.prefersMature())
- {
- if (gAgent.hasRestartableFailedTeleportRequest())
+ if (!gAgent.isAdult())
{
- maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback);
+ gAgent.clearTeleportRequest();
+ tp_failure_notification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock);
returnValue = true;
+
+ notifySuffix = "_NotifyAdultsOnly";
+ }
+ else if (gAgent.prefersPG() || gAgent.prefersMature())
+ {
+ if (gAgent.hasRestartableFailedTeleportRequest())
+ {
+ tp_failure_notification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback);
+ returnValue = true;
+ }
+ else
+ {
+ gAgent.clearTeleportRequest();
+ tp_failure_notification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
+ returnValue = true;
+ }
}
else
{
gAgent.clearTeleportRequest();
- maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
+ tp_failure_notification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
returnValue = true;
}
+ }
+ } // End of special handling for "TeleportEntryAccessBlocked"
+ else
+ { // Normal case, no message munging
+ gAgent.clearTeleportRequest();
+ if (LLNotifications::getInstance()->templateExists(notificationID))
+ {
+ tp_failure_notification = LLNotificationsUtil::add(notificationID, llsdBlock, llsdBlock);
}
else
{
- gAgent.clearTeleportRequest();
- maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
- returnValue = true;
- }
+ llsdBlock["MESSAGE"] = defaultMessage;
+ tp_failure_notification = LLNotificationsUtil::add("GenericAlertOK", llsdBlock);
}
+ returnValue = true;
+ }
- if ((maturityLevelNotification == NULL) || maturityLevelNotification->isIgnored())
+ if ((tp_failure_notification == NULL) || tp_failure_notification->isIgnored())
{
- // Given a simple notification if no maturityLevelNotification is set or it is ignore
+ // Given a simple notification if no tp_failure_notification is set or it is ignore
LLNotificationsUtil::add(notificationID + notifySuffix, llsdBlock);
}
@@ -5899,7 +5879,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem)
std::istringstream llsdData(llsdRaw);
if (!LLSDSerialize::deserialize(llsdBlock, llsdData, llsdRaw.length()))
{
- llwarns << "attempt_standard_notification: Attempted to read notification parameter data into LLSD but failed:" << llsdRaw << llendl;
+ LL_WARNS() << "attempt_standard_notification: Attempted to read notification parameter data into LLSD but failed:" << llsdRaw << LL_ENDL;
}
}
@@ -5949,7 +5929,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem)
snap_filename += SCREEN_HOME_FILENAME;
gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE);
}
-
+
if (notificationID == "RegionRestartMinutes" ||
notificationID == "RegionRestartSeconds")
{
@@ -5981,7 +5961,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem)
}
}
- send_sound_trigger(LLUUID(gSavedSettings.getString("UISndRestart")), 1.0f);
+ make_ui_sound("UISndRestart");
}
LLNotificationsUtil::add(notificationID, llsdBlock);
@@ -5997,7 +5977,7 @@ static void process_special_alert_messages(const std::string & message)
// text should be altered in the notifications.xml files.
if ( message == "You died and have been teleported to your home location")
{
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_KILLED_COUNT);
+ add(LLStatViewer::KILLED, 1);
}
else if( message == "Home position set." )
{
@@ -6086,8 +6066,8 @@ void process_alert_core(const std::string& message, BOOL modal)
std::string alert_name(message.substr(ALERT_PREFIX.length()));
if (!handle_special_alerts(alert_name))
{
- LLNotificationsUtil::add(alert_name);
- }
+ LLNotificationsUtil::add(alert_name);
+ }
}
else if (message.find(NOTIFY_PREFIX) == 0)
{
@@ -6695,8 +6675,8 @@ std::string formatted_time(const time_t& the_time)
void process_teleport_failed(LLMessageSystem *msg, void**)
{
- std::string reason;
- std::string big_reason;
+ std::string message_id; // Tag from server, like "RegionEntryAccessBlocked"
+ std::string big_reason; // Actual message to display
LLSD args;
// Let the interested parties know that teleport failed.
@@ -6706,16 +6686,16 @@ void process_teleport_failed(LLMessageSystem *msg, void**)
if (msg->has(_PREHASH_AlertInfo) && msg->getSizeFast(_PREHASH_AlertInfo, _PREHASH_Message) > 0)
{
// Get the message ID
- msg->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, reason);
- big_reason = LLAgent::sTeleportErrorMessages[reason];
+ msg->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, message_id);
+ big_reason = LLAgent::sTeleportErrorMessages[message_id];
if ( big_reason.size() > 0 )
{ // Substitute verbose reason from the local map
args["REASON"] = big_reason;
}
else
{ // Nothing found in the map - use what the server returned in the original message block
- msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, reason);
- args["REASON"] = reason;
+ msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, big_reason);
+ args["REASON"] = big_reason;
}
LLSD llsd_block;
@@ -6726,12 +6706,12 @@ void process_teleport_failed(LLMessageSystem *msg, void**)
std::istringstream llsd_data(llsd_raw);
if (!LLSDSerialize::deserialize(llsd_block, llsd_data, llsd_raw.length()))
{
- llwarns << "process_teleport_failed: Attempted to read alert parameter data into LLSD but failed:" << llsd_raw << llendl;
+ LL_WARNS() << "process_teleport_failed: Attempted to read alert parameter data into LLSD but failed:" << llsd_raw << LL_ENDL;
}
else
{
// change notification name in this special case
- if (handle_teleport_access_blocked(llsd_block))
+ if (handle_teleport_access_blocked(llsd_block, message_id, args["REASON"]))
{
if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE )
{
@@ -6744,17 +6724,17 @@ void process_teleport_failed(LLMessageSystem *msg, void**)
}
else
- {
- msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, reason);
+ { // Extra message payload not found - use what the simulator sent
+ msg->getStringFast(_PREHASH_Info, _PREHASH_Reason, message_id);
- big_reason = LLAgent::sTeleportErrorMessages[reason];
+ big_reason = LLAgent::sTeleportErrorMessages[message_id];
if ( big_reason.size() > 0 )
{ // Substitute verbose reason from the local map
args["REASON"] = big_reason;
}
else
{ // Nothing found in the map - use what the server returned
- args["REASON"] = reason;
+ args["REASON"] = message_id;
}
}
@@ -6969,7 +6949,7 @@ bool handle_lure_callback(const LLSD& notification, const LLSD& response)
void handle_lure(const LLUUID& invitee)
{
- LLDynamicArray<LLUUID> ids;
+ std::vector<LLUUID> ids;
ids.push_back(invitee);
handle_lure(ids);
}
@@ -6985,7 +6965,7 @@ void handle_lure(const uuid_vec_t& ids)
edit_args["REGION"] = gAgent.getRegion()->getName();
LLSD payload;
- for (LLDynamicArray<LLUUID>::const_iterator it = ids.begin();
+ for (std::vector<LLUUID>::const_iterator it = ids.begin();
it != ids.end();
++it)
{
@@ -7006,7 +6986,7 @@ bool teleport_request_callback(const LLSD& notification, const LLSD& response)
LLUUID from_id = notification["payload"]["from_id"].asUUID();
if(from_id.isNull())
{
- llwarns << "from_id is NULL" << llendl;
+ LL_WARNS() << "from_id is NULL" << LL_ENDL;
return false;
}
@@ -7242,7 +7222,7 @@ void process_script_dialog(LLMessageSystem* msg, void**)
S32 button_count = msg->getNumberOfBlocks("Buttons");
if (button_count > SCRIPT_DIALOG_MAX_BUTTONS)
{
- llwarns << "Too many script dialog buttons - omitting some" << llendl;
+ LL_WARNS() << "Too many script dialog buttons - omitting some" << LL_ENDL;
button_count = SCRIPT_DIALOG_MAX_BUTTONS;
}
@@ -7402,7 +7382,7 @@ void process_initiate_download(LLMessageSystem* msg, void**)
if (!gXferManager->validateFileForRequest(viewer_filename))
{
- llwarns << "SECURITY: Unauthorized download to local file " << viewer_filename << llendl;
+ LL_WARNS() << "SECURITY: Unauthorized download to local file " << viewer_filename << LL_ENDL;
return;
}
gXferManager->requestFile(viewer_filename,
@@ -7432,10 +7412,10 @@ void process_script_teleport_request(LLMessageSystem* msg, void**)
LLFloaterWorldMap* instance = LLFloaterWorldMap::getInstance();
if(instance)
{
- llinfos << "Object named " << object_name
+ LL_INFOS() << "Object named " << object_name
<< " is offering TP to region "
<< sim_name << " position " << pos
- << llendl;
+ << LL_ENDL;
instance->trackURL(sim_name, (S32)pos.mV[VX], (S32)pos.mV[VY], (S32)pos.mV[VZ]);
LLFloaterReg::showInstance("world_map", "center");
@@ -7581,8 +7561,6 @@ void onCovenantLoadComplete(LLVFS *vfs,
}
else
{
- LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED );
-
if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ||
LL_ERR_FILE_EMPTY == status)
{
diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h
index 3237f3fbdd..d8f5c71f8d 100755
--- a/indra/newview/llviewermessage.h
+++ b/indra/newview/llviewermessage.h
@@ -33,7 +33,6 @@
#include "lltransactiontypes.h"
#include "lluuid.h"
#include "message.h"
-#include "stdenums.h"
#include "llnotifications.h"
#include "llextendedstatus.h"
diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp
index e7821d4b9e..faa58d423f 100755
--- a/indra/newview/llviewernetwork.cpp
+++ b/indra/newview/llviewernetwork.cpp
@@ -550,7 +550,7 @@ std::string LLGridManager::getUpdateServiceURL()
std::string update_url_base = gSavedSettings.getString("CmdLineUpdateService");;
if ( !update_url_base.empty() )
{
- LL_INFOS2("UpdaterService","GridManager")
+ LL_INFOS("UpdaterService","GridManager")
<< "Update URL base overridden from command line: " << update_url_base
<< LL_ENDL;
}
@@ -560,7 +560,7 @@ std::string LLGridManager::getUpdateServiceURL()
}
else
{
- LL_WARNS2("UpdaterService","GridManager")
+ LL_WARNS("UpdaterService","GridManager")
<< "The grid property '" << GRID_UPDATE_SERVICE_URL
<< "' is not defined for the grid '" << mGrid << "'"
<< LL_ENDL;
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index e62998db70..4f992fc184 100755
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -29,7 +29,6 @@
#include "llviewerobject.h"
#include "llaudioengine.h"
-#include "imageids.h"
#include "indra_constants.h"
#include "llmath.h"
#include "llflexibleobject.h"
@@ -39,6 +38,7 @@
#include "llfloaterreg.h"
#include "llfontgl.h"
#include "llframetimer.h"
+#include "llhudicon.h"
#include "llinventory.h"
#include "llinventorydefines.h"
#include "llmaterialtable.h"
@@ -52,11 +52,11 @@
#include "llxfermanager.h"
#include "message.h"
#include "object_flags.h"
-#include "timing.h"
#include "llaudiosourcevo.h"
#include "llagent.h"
#include "llagentcamera.h"
+#include "llagentwearables.h"
#include "llbbox.h"
#include "llbox.h"
#include "llcylinder.h"
@@ -100,6 +100,8 @@
#include "lltrans.h"
#include "llsdutil.h"
#include "llmediaentry.h"
+#include "llfloaterperms.h"
+#include "llvocache.h"
//#define DEBUG_UPDATE_TYPE
@@ -112,21 +114,33 @@ BOOL LLViewerObject::sMapDebug = TRUE;
LLColor4 LLViewerObject::sEditSelectColor( 1.0f, 1.f, 0.f, 0.3f); // Edit OK
LLColor4 LLViewerObject::sNoEditSelectColor( 1.0f, 0.f, 0.f, 0.3f); // Can't edit
S32 LLViewerObject::sAxisArrowLength(50);
+
+
BOOL LLViewerObject::sPulseEnabled(FALSE);
BOOL LLViewerObject::sUseSharedDrawables(FALSE); // TRUE
// sMaxUpdateInterpolationTime must be greater than sPhaseOutUpdateInterpolationTime
-F64 LLViewerObject::sMaxUpdateInterpolationTime = 3.0; // For motion interpolation: after X seconds with no updates, don't predict object motion
-F64 LLViewerObject::sPhaseOutUpdateInterpolationTime = 2.0; // For motion interpolation: after Y seconds with no updates, taper off motion prediction
+F64Seconds LLViewerObject::sMaxUpdateInterpolationTime(3.0); // For motion interpolation: after X seconds with no updates, don't predict object motion
+F64Seconds LLViewerObject::sPhaseOutUpdateInterpolationTime(2.0); // For motion interpolation: after Y seconds with no updates, taper off motion prediction
+
+std::map<std::string, U32> LLViewerObject::sObjectDataMap;
+
+// The maximum size of an object extra parameters binary (packed) block
+#define MAX_OBJECT_PARAMS_SIZE 1024
+
+// At 45 Hz collisions seem stable and objects seem
+// to settle down at a reasonable rate.
+// JC 3/18/2003
+const F32 PHYSICS_TIMESTEP = 1.f / 45.f;
-static LLFastTimer::DeclareTimer FTM_CREATE_OBJECT("Create Object");
+static LLTrace::BlockTimerStatHandle FTM_CREATE_OBJECT("Create Object");
// static
LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
{
LLViewerObject *res = NULL;
- LLFastTimer t1(FTM_CREATE_OBJECT);
+ LL_RECORD_BLOCK_TIME(FTM_CREATE_OBJECT);
switch (pcode)
{
@@ -140,6 +154,7 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco
{
gAgentAvatarp = new LLVOAvatarSelf(id, pcode, regionp);
gAgentAvatarp->initInstance();
+ gAgentWearables.setAvatarObject(gAgentAvatarp);
}
else
{
@@ -161,13 +176,13 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco
case LL_PCODE_LEGACY_GRASS:
res = new LLVOGrass(id, pcode, regionp); break;
case LL_PCODE_LEGACY_PART_SYS:
-// llwarns << "Creating old part sys!" << llendl;
+// LL_WARNS() << "Creating old part sys!" << LL_ENDL;
// res = new LLVOPart(id, pcode, regionp); break;
res = NULL; break;
case LL_PCODE_LEGACY_TREE:
res = new LLVOTree(id, pcode, regionp); break;
case LL_PCODE_TREE_NEW:
-// llwarns << "Creating new tree!" << llendl;
+// LL_WARNS() << "Creating new tree!" << LL_ENDL;
// res = new LLVOTree(id, pcode, regionp); break;
res = NULL; break;
case LL_VO_SURFACE_PATCH:
@@ -187,14 +202,15 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco
case LL_VO_WL_SKY:
res = new LLVOWLSky(id, pcode, regionp); break;
default:
- llwarns << "Unknown object pcode " << (S32)pcode << llendl;
+ LL_WARNS() << "Unknown object pcode " << (S32)pcode << LL_ENDL;
res = NULL; break;
}
return res;
}
LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp, BOOL is_global)
-: LLPrimitive(),
+: LLTrace::MemTrackable<LLViewerObject>("LLViewerObject"),
+ LLPrimitive(),
mChildList(),
mID(id),
mLocalID(0),
@@ -340,7 +356,7 @@ void LLViewerObject::markDead()
{
if (!mDead)
{
- //llinfos << "Marking self " << mLocalID << " as dead." << llendl;
+ //LL_INFOS() << "Marking self " << mLocalID << " as dead." << LL_ENDL;
// Root object of this hierarchy unlinks itself.
if (getParent())
@@ -350,6 +366,10 @@ void LLViewerObject::markDead()
// Mark itself as dead
mDead = TRUE;
+ if(mRegionp)
+ {
+ mRegionp->removeFromCreatedList(getLocalID());
+ }
gObjectList.cleanupReferences(this);
LLViewerObject *childp;
@@ -358,7 +378,7 @@ void LLViewerObject::markDead()
childp = mChildList.back();
if (childp->getPCode() != LL_PCODE_LEGACY_AVATAR)
{
- //llinfos << "Marking child " << childp->getLocalID() << " as dead." << llendl;
+ //LL_INFOS() << "Marking child " << childp->getLocalID() << " as dead." << LL_ENDL;
childp->setParent(NULL); // LLViewerObject::markDead 1
childp->markDead();
}
@@ -428,17 +448,17 @@ void LLViewerObject::markDead()
void LLViewerObject::dump() const
{
- llinfos << "Type: " << pCodeToString(mPrimitiveCode) << llendl;
- llinfos << "Drawable: " << (LLDrawable *)mDrawable << llendl;
- llinfos << "Update Age: " << LLFrameTimer::getElapsedSeconds() - mLastMessageUpdateSecs << llendl;
-
- llinfos << "Parent: " << getParent() << llendl;
- llinfos << "ID: " << mID << llendl;
- llinfos << "LocalID: " << mLocalID << llendl;
- llinfos << "PositionRegion: " << getPositionRegion() << llendl;
- llinfos << "PositionAgent: " << getPositionAgent() << llendl;
- llinfos << "PositionGlobal: " << getPositionGlobal() << llendl;
- llinfos << "Velocity: " << getVelocity() << llendl;
+ LL_INFOS() << "Type: " << pCodeToString(mPrimitiveCode) << LL_ENDL;
+ LL_INFOS() << "Drawable: " << (LLDrawable *)mDrawable << LL_ENDL;
+ LL_INFOS() << "Update Age: " << LLFrameTimer::getElapsedSeconds() - mLastMessageUpdateSecs << LL_ENDL;
+
+ LL_INFOS() << "Parent: " << getParent() << LL_ENDL;
+ LL_INFOS() << "ID: " << mID << LL_ENDL;
+ LL_INFOS() << "LocalID: " << mLocalID << LL_ENDL;
+ LL_INFOS() << "PositionRegion: " << getPositionRegion() << LL_ENDL;
+ LL_INFOS() << "PositionAgent: " << getPositionAgent() << LL_ENDL;
+ LL_INFOS() << "PositionGlobal: " << getPositionGlobal() << LL_ENDL;
+ LL_INFOS() << "Velocity: " << getVelocity() << LL_ENDL;
if (mDrawable.notNull() &&
mDrawable->getNumFaces() &&
mDrawable->getFace(0))
@@ -446,31 +466,31 @@ void LLViewerObject::dump() const
LLFacePool *poolp = mDrawable->getFace(0)->getPool();
if (poolp)
{
- llinfos << "Pool: " << poolp << llendl;
- llinfos << "Pool reference count: " << poolp->mReferences.size() << llendl;
+ LL_INFOS() << "Pool: " << poolp << LL_ENDL;
+ LL_INFOS() << "Pool reference count: " << poolp->mReferences.size() << LL_ENDL;
}
}
- //llinfos << "BoxTree Min: " << mDrawable->getBox()->getMin() << llendl;
- //llinfos << "BoxTree Max: " << mDrawable->getBox()->getMin() << llendl;
+ //LL_INFOS() << "BoxTree Min: " << mDrawable->getBox()->getMin() << LL_ENDL;
+ //LL_INFOS() << "BoxTree Max: " << mDrawable->getBox()->getMin() << LL_ENDL;
/*
- llinfos << "Velocity: " << getVelocity() << llendl;
- llinfos << "AnyOwner: " << permAnyOwner() << " YouOwner: " << permYouOwner() << " Edit: " << mPermEdit << llendl;
- llinfos << "UsePhysics: " << flagUsePhysics() << " CanSelect " << mbCanSelect << " UserSelected " << mUserSelected << llendl;
- llinfos << "AppAngle: " << mAppAngle << llendl;
- llinfos << "PixelArea: " << mPixelArea << llendl;
+ LL_INFOS() << "Velocity: " << getVelocity() << LL_ENDL;
+ LL_INFOS() << "AnyOwner: " << permAnyOwner() << " YouOwner: " << permYouOwner() << " Edit: " << mPermEdit << LL_ENDL;
+ LL_INFOS() << "UsePhysics: " << flagUsePhysics() << " CanSelect " << mbCanSelect << " UserSelected " << mUserSelected << LL_ENDL;
+ LL_INFOS() << "AppAngle: " << mAppAngle << LL_ENDL;
+ LL_INFOS() << "PixelArea: " << mPixelArea << LL_ENDL;
char buffer[1000];
char *key;
for (key = mNameValuePairs.getFirstKey(); key; key = mNameValuePairs.getNextKey() )
{
mNameValuePairs[key]->printNameValue(buffer);
- llinfos << buffer << llendl;
+ LL_INFOS() << buffer << LL_ENDL;
}
for (child_list_t::iterator iter = mChildList.begin();
iter != mChildList.end(); iter++)
{
LLViewerObject* child = *iter;
- llinfos << " child " << child->getID() << llendl;
+ LL_INFOS() << " child " << child->getID() << LL_ENDL;
}
*/
}
@@ -481,7 +501,7 @@ void LLViewerObject::printNameValuePairs() const
iter != mNameValuePairs.end(); iter++)
{
LLNameValue* nv = iter->second;
- llinfos << nv->printNameValue() << llendl;
+ LL_INFOS() << nv->printNameValue() << LL_ENDL;
}
}
@@ -490,10 +510,12 @@ void LLViewerObject::initVOClasses()
// Initialized shared class stuff first.
LLVOAvatar::initClass();
LLVOTree::initClass();
- llinfos << "Viewer Object size: " << sizeof(LLViewerObject) << llendl;
+ LL_INFOS() << "Viewer Object size: " << sizeof(LLViewerObject) << LL_ENDL;
LLVOGrass::initClass();
LLVOWater::initClass();
LLVOVolume::initClass();
+
+ initObjectDataMap();
}
void LLViewerObject::cleanupVOClasses()
@@ -503,6 +525,118 @@ void LLViewerObject::cleanupVOClasses()
LLVOTree::cleanupClass();
LLVOAvatar::cleanupClass();
LLVOVolume::cleanupClass();
+
+ sObjectDataMap.clear();
+}
+
+//object data map for compressed && !OUT_TERSE_IMPROVED
+//static
+void LLViewerObject::initObjectDataMap()
+{
+ U32 count = 0;
+
+ sObjectDataMap["ID"] = count; //full id //LLUUID
+ count += sizeof(LLUUID);
+
+ sObjectDataMap["LocalID"] = count; //U32
+ count += sizeof(U32);
+
+ sObjectDataMap["PCode"] = count; //U8
+ count += sizeof(U8);
+
+ sObjectDataMap["State"] = count; //U8
+ count += sizeof(U8);
+
+ sObjectDataMap["CRC"] = count; //U32
+ count += sizeof(U32);
+
+ sObjectDataMap["Material"] = count; //U8
+ count += sizeof(U8);
+
+ sObjectDataMap["ClickAction"] = count; //U8
+ count += sizeof(U8);
+
+ sObjectDataMap["Scale"] = count; //LLVector3
+ count += sizeof(LLVector3);
+
+ sObjectDataMap["Pos"] = count; //LLVector3
+ count += sizeof(LLVector3);
+
+ sObjectDataMap["Rot"] = count; //LLVector3
+ count += sizeof(LLVector3);
+
+ sObjectDataMap["SpecialCode"] = count; //U32
+ count += sizeof(U32);
+
+ sObjectDataMap["Owner"] = count; //LLUUID
+ count += sizeof(LLUUID);
+
+ sObjectDataMap["Omega"] = count; //LLVector3, when SpecialCode & 0x80 is set
+ count += sizeof(LLVector3);
+
+ //ParentID is after Omega if there is Omega, otherwise is after Owner
+ sObjectDataMap["ParentID"] = count;//U32, when SpecialCode & 0x20 is set
+ count += sizeof(U32);
+
+ //-------
+ //The rest items are not included here
+ //-------
+}
+
+//static
+void LLViewerObject::unpackVector3(LLDataPackerBinaryBuffer* dp, LLVector3& value, std::string name)
+{
+ dp->shift(sObjectDataMap[name]);
+ dp->unpackVector3(value, name.c_str());
+ dp->reset();
+}
+
+//static
+void LLViewerObject::unpackUUID(LLDataPackerBinaryBuffer* dp, LLUUID& value, std::string name)
+{
+ dp->shift(sObjectDataMap[name]);
+ dp->unpackUUID(value, name.c_str());
+ dp->reset();
+}
+
+//static
+void LLViewerObject::unpackU32(LLDataPackerBinaryBuffer* dp, U32& value, std::string name)
+{
+ dp->shift(sObjectDataMap[name]);
+ dp->unpackU32(value, name.c_str());
+ dp->reset();
+}
+
+//static
+void LLViewerObject::unpackU8(LLDataPackerBinaryBuffer* dp, U8& value, std::string name)
+{
+ dp->shift(sObjectDataMap[name]);
+ dp->unpackU8(value, name.c_str());
+ dp->reset();
+}
+
+//static
+U32 LLViewerObject::unpackParentID(LLDataPackerBinaryBuffer* dp, U32& parent_id)
+{
+ dp->shift(sObjectDataMap["SpecialCode"]);
+ U32 value;
+ dp->unpackU32(value, "SpecialCode");
+
+ parent_id = 0;
+ if(value & 0x20)
+ {
+ S32 offset = sObjectDataMap["ParentID"];
+ if(!(value & 0x80))
+ {
+ offset -= sizeof(LLVector3);
+ }
+
+ dp->shift(offset);
+ dp->unpackU32(parent_id, "ParentID");
+ }
+ dp->reset();
+
+ return parent_id;
}
// Replaces all name value pairs with data from \n delimited list
@@ -613,7 +747,7 @@ void LLViewerObject::buildReturnablesForChildrenVO( std::vector<PotentialReturna
{
if ( !pChild )
{
- llerrs<<"child viewerobject is NULL "<<llendl;
+ LL_ERRS()<<"child viewerobject is NULL "<<LL_ENDL;
}
constructAndAddReturnable( returnables, pChild, pTargetRegion );
@@ -894,26 +1028,47 @@ U32 LLViewerObject::checkMediaURL(const std::string &media_url)
return retval;
}
+//extract spatial information from object update message
+//return parent_id
+//static
+U32 LLViewerObject::extractSpatialExtents(LLDataPackerBinaryBuffer *dp, LLVector3& pos, LLVector3& scale, LLQuaternion& rot)
+{
+ U32 parent_id = 0;
+ LLViewerObject::unpackParentID(dp, parent_id);
+
+ LLViewerObject::unpackVector3(dp, scale, "Scale");
+ LLViewerObject::unpackVector3(dp, pos, "Pos");
+
+ LLVector3 vec;
+ LLViewerObject::unpackVector3(dp, vec, "Rot");
+ rot.unpackFromVector3(vec);
+
+ return parent_id;
+}
+
U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
void **user_data,
U32 block_num,
const EObjectUpdateType update_type,
LLDataPacker *dp)
{
+ LL_DEBUGS_ONCE("SceneLoadTiming") << "Received viewer object data" << LL_ENDL;
+
U32 retval = 0x0;
// If region is removed from the list it is also deleted.
if (!LLWorld::instance().isRegionListed(mRegionp))
{
- llwarns << "Updating object in an invalid region" << llendl;
+ LL_WARNS() << "Updating object in an invalid region" << LL_ENDL;
return retval;
}
// Coordinates of objects on simulators are region-local.
- U64 region_handle;
- mesgsys->getU64Fast(_PREHASH_RegionData, _PREHASH_RegionHandle, region_handle);
+ U64 region_handle = 0;
+ if(mesgsys != NULL)
{
+ mesgsys->getU64Fast(_PREHASH_RegionData, _PREHASH_RegionHandle, region_handle);
LLViewerRegion* regionp = LLWorld::getInstance()->getRegionFromHandle(region_handle);
if(regionp != mRegionp && regionp && mRegionp)//region cross
{
@@ -926,6 +1081,17 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
}
else
{
+ if(regionp != mRegionp)
+ {
+ if(mRegionp)
+ {
+ mRegionp->removeFromCreatedList(getLocalID());
+ }
+ if(regionp)
+ {
+ regionp->addToCreatedList(getLocalID());
+ }
+ }
mRegionp = regionp ;
}
}
@@ -935,14 +1101,18 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
U32 x, y;
from_region_handle(region_handle, &x, &y);
- llerrs << "Object has invalid region " << x << ":" << y << "!" << llendl;
+ LL_ERRS() << "Object has invalid region " << x << ":" << y << "!" << LL_ENDL;
return retval;
}
+ F32 time_dilation = 1.f;
+ if(mesgsys != NULL)
+ {
U16 time_dilation16;
mesgsys->getU16Fast(_PREHASH_RegionData, _PREHASH_TimeDilation, time_dilation16);
- F32 time_dilation = ((F32) time_dilation16) / 65535.f;
+ time_dilation = ((F32) time_dilation16) / 65535.f;
mRegionp->setTimeDilation(time_dilation);
+ }
// this will be used to determine if we've really changed position
// Use getPosition, not getPositionRegion, since this is what we're comparing directly against.
@@ -990,7 +1160,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
case OUT_FULL:
{
#ifdef DEBUG_UPDATE_TYPE
- llinfos << "Full:" << getID() << llendl;
+ LL_INFOS() << "Full:" << getID() << LL_ENDL;
#endif
//clear cost and linkset cost
mCostStale = true;
@@ -1296,7 +1466,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
S32 param_size;
dp.unpackU16(param_type, "param_type");
dp.unpackBinaryData(param_block, param_size, "param_data");
- //llinfos << "Param type: " << param_type << ", Size: " << param_size << llendl;
+ //LL_INFOS() << "Param type: " << param_type << ", Size: " << param_size << LL_ENDL;
LLDataPackerBinaryBuffer dp2(param_block, param_size);
unpackParameterEntry(param_type, &dp2);
}
@@ -1318,7 +1488,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
case OUT_TERSE_IMPROVED:
{
#ifdef DEBUG_UPDATE_TYPE
- llinfos << "TI:" << getID() << llendl;
+ LL_INFOS() << "TI:" << getID() << LL_ENDL;
#endif
length = mesgsys->getSizeFast(_PREHASH_ObjectData, block_num, _PREHASH_ObjectData);
mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_ObjectData, data, length, block_num);
@@ -1495,7 +1665,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
case OUT_TERSE_IMPROVED:
{
#ifdef DEBUG_UPDATE_TYPE
- llinfos << "CompTI:" << getID() << llendl;
+ LL_INFOS() << "CompTI:" << getID() << LL_ENDL;
#endif
U8 value;
dp->unpackU8(value, "agent");
@@ -1541,7 +1711,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
case OUT_FULL_CACHED:
{
#ifdef DEBUG_UPDATE_TYPE
- llinfos << "CompFull:" << getID() << llendl;
+ LL_INFOS() << "CompFull:" << getID() << LL_ENDL;
#endif
mCostStale = true;
@@ -1679,7 +1849,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
S32 param_size;
dp->unpackU16(param_type, "param_type");
dp->unpackBinaryData(param_block, param_size, "param_data");
- //llinfos << "Param type: " << param_type << ", Size: " << param_size << llendl;
+ //LL_INFOS() << "Param type: " << param_type << ", Size: " << param_size << LL_ENDL;
LLDataPackerBinaryBuffer dp2(param_block, param_size);
unpackParameterEntry(param_type, &dp2);
}
@@ -1717,13 +1887,12 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
// Preload these five flags for every object.
// Finer shades require the object to be selected, and the selection manager
// stores the extended permission info.
+ if(mesgsys != NULL)
+ {
U32 flags;
mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_UpdateFlags, flags, block_num);
- // keep local flags and overwrite remote-controlled flags
- mFlags = (mFlags & FLAGS_LOCAL) | flags;
-
- // ...new objects that should come in selected need to be added to the selected list
- mCreateSelected = ((flags & FLAGS_CREATE_SELECTED) != 0);
+ loadFlags(flags);
+ }
}
break;
@@ -1751,10 +1920,21 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
{
// No parent now, new parent in message -> attach to that parent if possible
LLUUID parent_uuid;
+
+ if(mesgsys != NULL)
+ {
LLViewerObjectList::getUUIDFromLocal(parent_uuid,
parent_id,
mesgsys->getSenderIP(),
mesgsys->getSenderPort());
+ }
+ else
+ {
+ LLViewerObjectList::getUUIDFromLocal(parent_uuid,
+ parent_id,
+ mRegionp->getHost().getAddress(),
+ mRegionp->getHost().getPort());
+ }
LLViewerObject *sent_parentp = gObjectList.findObject(parent_uuid);
@@ -1764,7 +1944,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
if (sent_parentp && sent_parentp->getParent() == this)
{
// Try to recover if we attempt to attach a parent to its child
- llwarns << "Attempt to attach a parent to it's child: " << this->getID() << " to " << sent_parentp->getID() << llendl;
+ LL_WARNS() << "Attempt to attach a parent to it's child: " << this->getID() << " to " << sent_parentp->getID() << LL_ENDL;
this->removeChild(sent_parentp);
sent_parentp->setDrawableParent(NULL);
}
@@ -1783,7 +1963,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
{
if (mDrawable->isDead() || !mDrawable->getVObj())
{
- llwarns << "Drawable is dead or no VObj!" << llendl;
+ LL_WARNS() << "Drawable is dead or no VObj!" << LL_ENDL;
sent_parentp->addChild(this);
}
else
@@ -1793,9 +1973,9 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
// Bad, we got a cycle somehow.
// Kill both the parent and the child, and
// set cache misses for both of them.
- llwarns << "Attempting to recover from parenting cycle!" << llendl;
- llwarns << "Killing " << sent_parentp->getID() << " and " << getID() << llendl;
- llwarns << "Adding to cache miss list" << llendl;
+ LL_WARNS() << "Attempting to recover from parenting cycle!" << LL_ENDL;
+ LL_WARNS() << "Killing " << sent_parentp->getID() << " and " << getID() << LL_ENDL;
+ LL_WARNS() << "Adding to cache miss list" << LL_ENDL;
setParent(NULL);
sent_parentp->setParent(NULL);
getRegion()->addCacheMissFull(getLocalID());
@@ -1830,9 +2010,18 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
//
//parent_id
- U32 ip = mesgsys->getSenderIP();
- U32 port = mesgsys->getSenderPort();
+ U32 ip, port;
+ if(mesgsys != NULL)
+ {
+ ip = mesgsys->getSenderIP();
+ port = mesgsys->getSenderPort();
+ }
+ else
+ {
+ ip = mRegionp->getHost().getAddress();
+ port = mRegionp->getHost().getPort();
+ }
gObjectList.orphanize(this, parent_id, ip, port);
// Hide particles, icon and HUD
@@ -1853,7 +2042,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
//LLViewerObjectList::getUUIDFromLocal(parent_uuid, parent_id, mesgsys->getSenderIP(), mesgsys->getSenderPort() );
//if (parent_uuid != cur_parentp->getID() )
//{
- // llerrs << "Local ID match but UUID mismatch of viewer object" << llendl;
+ // LL_ERRS() << "Local ID match but UUID mismatch of viewer object" << LL_ENDL;
//}
}
else
@@ -1870,10 +2059,21 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
else
{
LLUUID parent_uuid;
+
+ if(mesgsys != NULL)
+ {
LLViewerObjectList::getUUIDFromLocal(parent_uuid,
parent_id,
gMessageSystem->getSenderIP(),
gMessageSystem->getSenderPort());
+ }
+ else
+ {
+ LLViewerObjectList::getUUIDFromLocal(parent_uuid,
+ parent_id,
+ mRegionp->getHost().getAddress(),
+ mRegionp->getHost().getPort());
+ }
sent_parentp = gObjectList.findObject(parent_uuid);
if (isAvatar())
@@ -1894,8 +2094,18 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
//
// Switching parents, but we don't know the new parent.
//
- U32 ip = mesgsys->getSenderIP();
- U32 port = mesgsys->getSenderPort();
+ U32 ip, port;
+
+ if(mesgsys != NULL)
+ {
+ ip = mesgsys->getSenderIP();
+ port = mesgsys->getSenderPort();
+ }
+ else
+ {
+ ip = mRegionp->getHost().getAddress();
+ port = mRegionp->getHost().getPort();
+ }
// We're an orphan, flag things appropriately.
gObjectList.orphanize(this, parent_id, ip, port);
@@ -1914,9 +2124,9 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
// Bad, we got a cycle somehow.
// Kill both the parent and the child, and
// set cache misses for both of them.
- llwarns << "Attempting to recover from parenting cycle!" << llendl;
- llwarns << "Killing " << sent_parentp->getID() << " and " << getID() << llendl;
- llwarns << "Adding to cache miss list" << llendl;
+ LL_WARNS() << "Attempting to recover from parenting cycle!" << LL_ENDL;
+ LL_WARNS() << "Killing " << sent_parentp->getID() << " and " << getID() << LL_ENDL;
+ LL_WARNS() << "Adding to cache miss list" << LL_ENDL;
setParent(NULL);
sent_parentp->setParent(NULL);
getRegion()->addCacheMissFull(getLocalID());
@@ -1948,7 +2158,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
// This is probably an object flying across a region boundary, the
// object probably ISN'T being reparented, but just got an object
// update out of order (child update before parent).
- //llinfos << "Don't reparent object handoffs!" << llendl;
+ //LL_INFOS() << "Don't reparent object handoffs!" << LL_ENDL;
remove_parent = false;
}
}
@@ -1979,18 +2189,18 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
new_rot.normQuat();
- if (sPingInterpolate)
+ if (sPingInterpolate && mesgsys != NULL)
{
LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(mesgsys->getSender());
if (cdp)
{
- F32 ping_delay = 0.5f * time_dilation * ( ((F32)cdp->getPingDelay()) * 0.001f + gFrameDTClamped);
+ F32 ping_delay = 0.5f * time_dilation * ( ((F32)cdp->getPingDelay().valueInUnits<LLUnits::Seconds>()) + gFrameDTClamped);
LLVector3 diff = getVelocity() * ping_delay;
new_pos_parent += diff;
}
else
{
- llwarns << "findCircuit() returned NULL; skipping interpolation" << llendl;
+ LL_WARNS() << "findCircuit() returned NULL; skipping interpolation" << LL_ENDL;
}
}
@@ -2002,6 +2212,8 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
// If we're going to skip this message, why are we
// doing all the parenting, etc above?
+ if(mesgsys != NULL)
+ {
U32 packet_id = mesgsys->getCurrentRecvPacketID();
if (packet_id < mLatestRecvPacketID &&
mLatestRecvPacketID - packet_id < 65536)
@@ -2009,8 +2221,8 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
//skip application of this message, it's old
return retval;
}
-
mLatestRecvPacketID = packet_id;
+ }
// Set the change flags for scale
if (new_scale != getScale())
@@ -2042,7 +2254,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
}
else
{
- llwarns << "Can not move the object/avatar to an infinite location!" << llendl ;
+ LL_WARNS() << "Can not move the object/avatar to an infinite location!" << LL_ENDL ;
retval |= INVALID_UPDATE ;
}
@@ -2058,7 +2270,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
// If we're snapping the position by more than 0.5m, update LLViewerStats::mAgentPositionSnaps
if ( asAvatar() && asAvatar()->isSelf() && (mag_sqr > 0.25f) )
{
- LLViewerStats::getInstance()->mAgentPositionSnaps.push( diff.length() );
+ record(LLStatViewer::AGENT_POSITION_SNAP, LLUnit<F64, LLUnits::Meters>(diff.length()));
}
}
@@ -2159,7 +2371,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
// Don't clear invisibility flag on update if still orphaned!
if (mDrawable->isState(LLDrawable::FORCE_INVISIBLE) && !mOrphaned)
{
-// lldebugs << "Clearing force invisible: " << mID << ":" << getPCodeString() << ":" << getPositionAgent() << llendl;
+// LL_DEBUGS() << "Clearing force invisible: " << mID << ":" << getPCodeString() << ":" << getPositionAgent() << LL_ENDL;
mDrawable->clearState(LLDrawable::FORCE_INVISIBLE);
gPipeline.markRebuild( mDrawable, LLDrawable::REBUILD_ALL, TRUE );
}
@@ -2181,12 +2393,26 @@ BOOL LLViewerObject::isActive() const
return TRUE;
}
+//load flags from cache or from message
+void LLViewerObject::loadFlags(U32 flags)
+{
+ if(flags == (U32)(-1))
+ {
+ return; //invalid
+ }
+
+ // keep local flags and overwrite remote-controlled flags
+ mFlags = (mFlags & FLAGS_LOCAL) | flags;
+ // ...new objects that should come in selected need to be added to the selected list
+ mCreateSelected = ((flags & FLAGS_CREATE_SELECTED) != 0);
+ return;
+}
void LLViewerObject::idleUpdate(LLAgent &agent, const F64 &time)
{
- //static LLFastTimer::DeclareTimer ftm("Viewer Object");
- //LLFastTimer t(ftm);
+ //static LLTrace::BlockTimerStatHandle ftm("Viewer Object");
+ //LL_RECORD_BLOCK_TIME(ftm);
if (!mDead)
{
@@ -2194,13 +2420,14 @@ void LLViewerObject::idleUpdate(LLAgent &agent, const F64 &time)
{
// calculate dt from last update
F32 time_dilation = mRegionp ? mRegionp->getTimeDilation() : 1.0f;
- F32 dt = time_dilation * (F32)(time - mLastInterpUpdateSecs);
+ F32 dt_raw = ((F64Seconds)time - mLastInterpUpdateSecs).value();
+ F32 dt = time_dilation * dt_raw;
applyAngularVelocity(dt);
if (isAttachment())
{
- mLastInterpUpdateSecs = time;
+ mLastInterpUpdateSecs = (F64Seconds)time;
return;
}
else
@@ -2214,8 +2441,8 @@ void LLViewerObject::idleUpdate(LLAgent &agent, const F64 &time)
}
-// Move an object due to idle-time viewer side updates by iterpolating motion
-void LLViewerObject::interpolateLinearMotion(const F64 & time, const F32 & dt)
+// Move an object due to idle-time viewer side updates by interpolating motion
+void LLViewerObject::interpolateLinearMotion(const F64SecondsImplicit& time, const F32SecondsImplicit& dt_seconds)
{
// linear motion
// PHYSICS_TIMESTEP is used below to correct for the fact that the velocity in object
@@ -2226,8 +2453,9 @@ void LLViewerObject::interpolateLinearMotion(const F64 & time, const F32 & dt)
// to see if object is selected, instead of explicitly
// zeroing it out
- F64 time_since_last_update = time - mLastMessageUpdateSecs;
- if (time_since_last_update <= 0.0 || dt <= 0.f)
+ F32 dt = dt_seconds;
+ F64Seconds time_since_last_update = time - mLastMessageUpdateSecs;
+ if (time_since_last_update <= (F64Seconds)0.0 || dt <= 0.f)
{
return;
}
@@ -2235,7 +2463,7 @@ void LLViewerObject::interpolateLinearMotion(const F64 & time, const F32 & dt)
LLVector3 accel = getAcceleration();
LLVector3 vel = getVelocity();
- if (sMaxUpdateInterpolationTime <= 0.0)
+ if (sMaxUpdateInterpolationTime <= (F64Seconds)0.0)
{ // Old code path ... unbounded, simple interpolation
if (!(accel.isExactlyZero() && vel.isExactlyZero()))
{
@@ -2257,8 +2485,8 @@ void LLViewerObject::interpolateLinearMotion(const F64 & time, const F32 & dt)
LLVector3 new_v = accel * dt;
if (time_since_last_update > sPhaseOutUpdateInterpolationTime &&
- sPhaseOutUpdateInterpolationTime > 0.0)
- { // Haven't seen a viewer update in a while, check to see if the ciruit is still active
+ sPhaseOutUpdateInterpolationTime > (F64Seconds)0.0)
+ { // Haven't seen a viewer update in a while, check to see if the circuit is still active
if (mRegionp)
{ // The simulator will NOT send updates if the object continues normally on the path
// predicted by the velocity and the acceleration (often gravity) sent to the viewer
@@ -2267,19 +2495,19 @@ void LLViewerObject::interpolateLinearMotion(const F64 & time, const F32 & dt)
if (cdp)
{
// Find out how many seconds since last packet arrived on the circuit
- F64 time_since_last_packet = LLMessageSystem::getMessageTimeSeconds() - cdp->getLastPacketInTime();
+ F64Seconds time_since_last_packet = LLMessageSystem::getMessageTimeSeconds() - cdp->getLastPacketInTime();
if (!cdp->isAlive() || // Circuit is dead or blocked
cdp->isBlocked() || // or doesn't seem to be getting any packets
(time_since_last_packet > sPhaseOutUpdateInterpolationTime))
{
// Start to reduce motion interpolation since we haven't seen a server update in a while
- F64 time_since_last_interpolation = time - mLastInterpUpdateSecs;
+ F64Seconds time_since_last_interpolation = time - mLastInterpUpdateSecs;
F64 phase_out = 1.0;
if (time_since_last_update > sMaxUpdateInterpolationTime)
{ // Past the time limit, so stop the object
phase_out = 0.0;
- //llinfos << "Motion phase out to zero" << llendl;
+ //LL_INFOS() << "Motion phase out to zero" << LL_ENDL;
// Kill angular motion as well. Note - not adding this due to paranoia
// about stopping rotation for llTargetOmega objects and not having it restart
@@ -2289,13 +2517,13 @@ void LLViewerObject::interpolateLinearMotion(const F64 & time, const F32 & dt)
{ // Last update was already phased out a bit
phase_out = (sMaxUpdateInterpolationTime - time_since_last_update) /
(sMaxUpdateInterpolationTime - time_since_last_interpolation);
- //llinfos << "Continuing motion phase out of " << (F32) phase_out << llendl;
+ //LL_INFOS() << "Continuing motion phase out of " << (F32) phase_out << LL_ENDL;
}
else
{ // Phase out from full value
phase_out = (sMaxUpdateInterpolationTime - time_since_last_update) /
(sMaxUpdateInterpolationTime - sPhaseOutUpdateInterpolationTime);
- //llinfos << "Starting motion phase out of " << (F32) phase_out << llendl;
+ //LL_INFOS() << "Starting motion phase out of " << (F32) phase_out << LL_ENDL;
}
phase_out = llclamp(phase_out, 0.0, 1.0);
@@ -2340,8 +2568,8 @@ void LLViewerObject::interpolateLinearMotion(const F64 & time, const F32 & dt)
if (clip_pos_global != new_pos_global)
{ // Was clipped, so this means we hit a edge where there is no region to enter
- //llinfos << "Hit empty region edge, clipped predicted position to " << mRegionp->getPosRegionFromGlobal(clip_pos_global)
- // << " from " << new_pos << llendl;
+ //LL_INFOS() << "Hit empty region edge, clipped predicted position to " << mRegionp->getPosRegionFromGlobal(clip_pos_global)
+ // << " from " << new_pos << LL_ENDL;
new_pos = mRegionp->getPosRegionFromGlobal(clip_pos_global);
// Stop motion and get server update for bouncing on the edge
@@ -2350,7 +2578,7 @@ void LLViewerObject::interpolateLinearMotion(const F64 & time, const F32 & dt)
}
else
{ // Let predicted movement cross into another region
- //llinfos << "Predicting region crossing to " << new_pos << llendl;
+ //LL_INFOS() << "Predicting region crossing to " << new_pos << LL_ENDL;
}
}
@@ -2498,7 +2726,8 @@ void LLViewerObject::saveScript(
* XXXPAM Investigate not making this copy. Seems unecessary, but I'm unsure about the
* interaction with doUpdateInventory() called below.
*/
- lldebugs << "LLViewerObject::saveScript() " << item->getUUID() << " " << item->getAssetUUID() << llendl;
+ LL_DEBUGS() << "LLViewerObject::saveScript() " << item->getUUID() << " " << item->getAssetUUID() << LL_ENDL;
+
LLPointer<LLViewerInventoryItem> task_item =
new LLViewerInventoryItem(item->getUUID(), mID, item->getPermissions(),
item->getAssetUUID(), item->getType(),
@@ -2529,7 +2758,7 @@ void LLViewerObject::saveScript(
void LLViewerObject::moveInventory(const LLUUID& folder_id,
const LLUUID& item_id)
{
- lldebugs << "LLViewerObject::moveInventory " << item_id << llendl;
+ LL_DEBUGS() << "LLViewerObject::moveInventory " << item_id << LL_ENDL;
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_MoveTaskInventory);
msg->nextBlockFast(_PREHASH_AgentData);
@@ -2563,8 +2792,8 @@ void LLViewerObject::dirtyInventory()
mInventory->clear(); // will deref and delete entries
delete mInventory;
mInventory = NULL;
- mInventoryDirty = TRUE;
}
+ mInventoryDirty = TRUE;
}
void LLViewerObject::registerInventoryListener(LLVOInventoryListener* listener, void* user_data)
@@ -2601,12 +2830,15 @@ void LLViewerObject::clearInventoryListeners()
void LLViewerObject::requestInventory()
{
- mInventoryDirty = FALSE;
+ if(mInventoryDirty && mInventory && !mInventoryCallbacks.empty())
+ {
+ mInventory->clear(); // will deref and delete entries
+ delete mInventory;
+ mInventory = NULL;
+ mInventoryDirty = FALSE; //since we are going to request it now
+ }
if(mInventory)
{
- //mInventory->clear() // will deref and delete it
- //delete mInventory;
- //mInventory = NULL;
doInventoryCallback();
}
// throw away duplicate requests
@@ -2646,12 +2878,12 @@ struct LLFilenameAndTask
LLFilenameAndTask()
{
++sCount;
- lldebugs << "Constructing LLFilenameAndTask: " << sCount << llendl;
+ LL_DEBUGS() << "Constructing LLFilenameAndTask: " << sCount << LL_ENDL;
}
~LLFilenameAndTask()
{
--sCount;
- lldebugs << "Destroying LLFilenameAndTask: " << sCount << llendl;
+ LL_DEBUGS() << "Destroying LLFilenameAndTask: " << sCount << LL_ENDL;
}
private:
LLFilenameAndTask(const LLFilenameAndTask& rhs);
@@ -2671,8 +2903,8 @@ void LLViewerObject::processTaskInv(LLMessageSystem* msg, void** user_data)
LLViewerObject* object = gObjectList.findObject(task_id);
if(!object)
{
- llwarns << "LLViewerObject::processTaskInv object "
- << task_id << " does not exist." << llendl;
+ LL_WARNS() << "LLViewerObject::processTaskInv object "
+ << task_id << " does not exist." << LL_ENDL;
return;
}
@@ -2686,7 +2918,7 @@ void LLViewerObject::processTaskInv(LLMessageSystem* msg, void** user_data)
if(ft->mFilename.empty())
{
- lldebugs << "Task has no inventory" << llendl;
+ LL_DEBUGS() << "Task has no inventory" << LL_ENDL;
// mock up some inventory to make a drop target.
if(object->mInventory)
{
@@ -2746,15 +2978,15 @@ void LLViewerObject::processTaskInvFile(void** user_data, S32 error_code, LLExtS
// MAINT-2597 - crash when trying to edit a no-mod object
// Somehow get an contents inventory response, but with an invalid stream (possibly 0 size?)
// Stated repro was specific to no-mod objects so failing without user interaction should be safe.
- llwarns << "Trying to load invalid task inventory file. Ignoring file contents." << llendl;
+ LL_WARNS() << "Trying to load invalid task inventory file. Ignoring file contents." << LL_ENDL;
}
}
else
{
// This Occurs When to requests were made, and the first one
// has already handled it.
- lldebugs << "Problem loading task inventory. Return code: "
- << error_code << llendl;
+ LL_DEBUGS() << "Problem loading task inventory. Return code: "
+ << error_code << LL_ENDL;
}
delete ft;
}
@@ -2795,8 +3027,8 @@ BOOL LLViewerObject::loadTaskInvFile(const std::string& filename)
}
else
{
- llwarns << "Unknown token in inventory file '"
- << keyword << "'" << llendl;
+ LL_WARNS() << "Unknown token in inventory file '"
+ << keyword << "'" << LL_ENDL;
}
}
ifs.close();
@@ -2804,8 +3036,8 @@ BOOL LLViewerObject::loadTaskInvFile(const std::string& filename)
}
else
{
- llwarns << "unable to load task inventory: " << filename_and_local_path
- << llendl;
+ LL_WARNS() << "unable to load task inventory: " << filename_and_local_path
+ << LL_ENDL;
return FALSE;
}
doInventoryCallback();
@@ -2829,7 +3061,7 @@ void LLViewerObject::doInventoryCallback()
}
else
{
- llinfos << "LLViewerObject::doInventoryCallback() deleting bad listener entry." << llendl;
+ LL_INFOS() << "LLViewerObject::doInventoryCallback() deleting bad listener entry." << LL_ENDL;
delete info;
mInventoryCallbacks.erase(curiter);
}
@@ -2977,7 +3209,7 @@ LLInventoryObject* LLViewerObject::getInventoryRoot()
LLViewerInventoryItem* LLViewerObject::getInventoryItemByAsset(const LLUUID& asset_id)
{
if (mInventoryDirty)
- llwarns << "Peforming inventory lookup for object " << mID << " that has dirty inventory!" << llendl;
+ LL_WARNS() << "Peforming inventory lookup for object " << mID << " that has dirty inventory!" << LL_ENDL;
LLViewerInventoryItem* rv = NULL;
if(mInventory)
@@ -3382,7 +3614,7 @@ void LLViewerObject::addNVPair(const std::string& data)
// char splat[MAX_STRING];
// temp->printNameValue(splat);
-// llinfos << "addNVPair " << splat << llendl;
+// LL_INFOS() << "addNVPair " << splat << LL_ENDL;
name_value_map_t::iterator iter = mNameValuePairs.find(nv->mName);
if (iter != mNameValuePairs.end())
@@ -3396,7 +3628,7 @@ void LLViewerObject::addNVPair(const std::string& data)
else
{
delete nv;
-// llinfos << "Trying to write to Read Only NVPair " << temp->mName << " in addNVPair()" << llendl;
+// LL_INFOS() << "Trying to write to Read Only NVPair " << temp->mName << " in addNVPair()" << LL_ENDL;
return;
}
}
@@ -3407,7 +3639,7 @@ BOOL LLViewerObject::removeNVPair(const std::string& name)
{
char* canonical_name = gNVNameTable.addString(name);
- lldebugs << "LLViewerObject::removeNVPair(): " << name << llendl;
+ LL_DEBUGS() << "LLViewerObject::removeNVPair(): " << name << LL_ENDL;
name_value_map_t::iterator iter = mNameValuePairs.find(canonical_name);
if (iter != mNameValuePairs.end())
@@ -3433,7 +3665,7 @@ BOOL LLViewerObject::removeNVPair(const std::string& name)
}
else
{
- lldebugs << "removeNVPair - No region for object" << llendl;
+ LL_DEBUGS() << "removeNVPair - No region for object" << LL_ENDL;
}
}
return FALSE;
@@ -4213,7 +4445,7 @@ S32 LLViewerObject::setTEColor(const U8 te, const LLColor4& color)
const LLTextureEntry *tep = getTE(te);
if (!tep)
{
- llwarns << "No texture entry for te " << (S32)te << ", object " << mID << llendl;
+ LL_WARNS() << "No texture entry for te " << (S32)te << ", object " << mID << LL_ENDL;
}
else if (color != tep->getColor())
{
@@ -4233,7 +4465,7 @@ S32 LLViewerObject::setTEBumpmap(const U8 te, const U8 bump)
const LLTextureEntry *tep = getTE(te);
if (!tep)
{
- llwarns << "No texture entry for te " << (S32)te << ", object " << mID << llendl;
+ LL_WARNS() << "No texture entry for te " << (S32)te << ", object " << mID << LL_ENDL;
}
else if (bump != tep->getBumpmap())
{
@@ -4254,7 +4486,7 @@ S32 LLViewerObject::setTETexGen(const U8 te, const U8 texgen)
const LLTextureEntry *tep = getTE(te);
if (!tep)
{
- llwarns << "No texture entry for te " << (S32)te << ", object " << mID << llendl;
+ LL_WARNS() << "No texture entry for te " << (S32)te << ", object " << mID << LL_ENDL;
}
else if (texgen != tep->getTexGen())
{
@@ -4270,7 +4502,7 @@ S32 LLViewerObject::setTEMediaTexGen(const U8 te, const U8 media)
const LLTextureEntry *tep = getTE(te);
if (!tep)
{
- llwarns << "No texture entry for te " << (S32)te << ", object " << mID << llendl;
+ LL_WARNS() << "No texture entry for te " << (S32)te << ", object " << mID << LL_ENDL;
}
else if (media != tep->getMediaTexGen())
{
@@ -4286,7 +4518,7 @@ S32 LLViewerObject::setTEShiny(const U8 te, const U8 shiny)
const LLTextureEntry *tep = getTE(te);
if (!tep)
{
- llwarns << "No texture entry for te " << (S32)te << ", object " << mID << llendl;
+ LL_WARNS() << "No texture entry for te " << (S32)te << ", object " << mID << LL_ENDL;
}
else if (shiny != tep->getShiny())
{
@@ -4302,7 +4534,7 @@ S32 LLViewerObject::setTEFullbright(const U8 te, const U8 fullbright)
const LLTextureEntry *tep = getTE(te);
if (!tep)
{
- llwarns << "No texture entry for te " << (S32)te << ", object " << mID << llendl;
+ LL_WARNS() << "No texture entry for te " << (S32)te << ", object " << mID << LL_ENDL;
}
else if (fullbright != tep->getFullbright())
{
@@ -4324,7 +4556,7 @@ S32 LLViewerObject::setTEMediaFlags(const U8 te, const U8 media_flags)
const LLTextureEntry *tep = getTE(te);
if (!tep)
{
- llwarns << "No texture entry for te " << (S32)te << ", object " << mID << llendl;
+ LL_WARNS() << "No texture entry for te " << (S32)te << ", object " << mID << LL_ENDL;
}
else if (media_flags != tep->getMediaFlags())
{
@@ -4347,7 +4579,7 @@ S32 LLViewerObject::setTEGlow(const U8 te, const F32 glow)
const LLTextureEntry *tep = getTE(te);
if (!tep)
{
- llwarns << "No texture entry for te " << (S32)te << ", object " << mID << llendl;
+ LL_WARNS() << "No texture entry for te " << (S32)te << ", object " << mID << LL_ENDL;
}
else if (glow != tep->getGlow())
{
@@ -4390,7 +4622,7 @@ S32 LLViewerObject::setTEMaterialParams(const U8 te, const LLMaterialPtr pMateri
const LLTextureEntry *tep = getTE(te);
if (!tep)
{
- llwarns << "No texture entry for te " << (S32)te << ", object " << mID << llendl;
+ LL_WARNS() << "No texture entry for te " << (S32)te << ", object " << mID << LL_ENDL;
return 0;
}
@@ -4509,7 +4741,7 @@ LLViewerTexture *LLViewerObject::getTEImage(const U8 face) const
}
}
- llerrs << llformat("Requested Image from invalid face: %d/%d",face,getNumTEs()) << llendl;
+ LL_ERRS() << llformat("Requested Image from invalid face: %d/%d",face,getNumTEs()) << LL_ENDL;
return NULL;
}
@@ -4531,7 +4763,7 @@ bool LLViewerObject::isImageAlphaBlended(const U8 te) const
case GL_RGB: break;
default:
{
- llwarns << "Unexpected tex format in LLViewerObject::isImageAlphaBlended...returning no alpha." << llendl;
+ LL_WARNS() << "Unexpected tex format in LLViewerObject::isImageAlphaBlended...returning no alpha." << LL_ENDL;
}
break;
}
@@ -4556,7 +4788,7 @@ LLViewerTexture *LLViewerObject::getTENormalMap(const U8 face) const
}
}
- llerrs << llformat("Requested Image from invalid face: %d/%d",face,getNumTEs()) << llendl;
+ LL_ERRS() << llformat("Requested Image from invalid face: %d/%d",face,getNumTEs()) << LL_ENDL;
return NULL;
}
@@ -4578,14 +4810,14 @@ LLViewerTexture *LLViewerObject::getTESpecularMap(const U8 face) const
}
}
- llerrs << llformat("Requested Image from invalid face: %d/%d",face,getNumTEs()) << llendl;
+ LL_ERRS() << llformat("Requested Image from invalid face: %d/%d",face,getNumTEs()) << LL_ENDL;
return NULL;
}
void LLViewerObject::fitFaceTexture(const U8 face)
{
- llinfos << "fitFaceTexture not implemented" << llendl;
+ LL_INFOS() << "fitFaceTexture not implemented" << LL_ENDL;
}
@@ -4834,7 +5066,7 @@ void LLViewerObject::unpackParticleSource(const S32 block_num, const LLUUID& own
// We need to be able to deal with a particle source that hasn't changed, but still got an update!
if (pss)
{
-// llinfos << "Making particle system with owner " << owner_id << llendl;
+// LL_INFOS() << "Making particle system with owner " << owner_id << LL_ENDL;
pss->setOwnerUUID(owner_id);
mPartSourcep = pss;
LLViewerPartSim::getInstance()->addPartSource(pss);
@@ -4881,7 +5113,7 @@ void LLViewerObject::unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_
// We need to be able to deal with a particle source that hasn't changed, but still got an update!
if (pss)
{
-// llinfos << "Making particle system with owner " << owner_id << llendl;
+// LL_INFOS() << "Making particle system with owner " << owner_id << LL_ENDL;
pss->setOwnerUUID(owner_id);
mPartSourcep = pss;
LLViewerPartSim::getInstance()->addPartSource(pss);
@@ -4950,6 +5182,7 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow
{
if (!gAudiop)
{
+ LL_WARNS("AudioEngine") << "LLAudioEngine instance doesn't exist!" << LL_ENDL;
return;
}
@@ -4965,7 +5198,7 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow
// At least, this appears to be how the scripts work.
// The attached sound ID is set to NULL to avoid it playing back when the
// object rezzes in on non-looping sounds.
- //llinfos << "Clearing attached sound " << mAudioSourcep->getCurrentData()->getID() << llendl;
+ //LL_INFOS() << "Clearing attached sound " << mAudioSourcep->getCurrentData()->getID() << LL_ENDL;
gAudiop->cleanupAudioSource(mAudioSourcep);
mAudioSourcep = NULL;
}
@@ -4980,7 +5213,7 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow
&& mAudioSourcep && mAudioSourcep->isLoop() && mAudioSourcep->getCurrentData()
&& mAudioSourcep->getCurrentData()->getID() == audio_uuid)
{
- //llinfos << "Already playing this sound on a loop, ignoring" << llendl;
+ //LL_INFOS() << "Already playing this sound on a loop, ignoring" << LL_ENDL;
return;
}
@@ -4994,7 +5227,7 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow
if (mAudioSourcep && mAudioSourcep->isMuted() &&
mAudioSourcep->getCurrentData() && mAudioSourcep->getCurrentData()->getID() == audio_uuid)
{
- //llinfos << "Already having this sound as muted sound, ignoring" << llendl;
+ //LL_INFOS() << "Already having this sound as muted sound, ignoring" << LL_ENDL;
return;
}
@@ -5017,7 +5250,7 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow
// Play this sound if region maturity permits
if( gAgent.canAccessMaturityAtGlobal(this->getPositionGlobal()) )
{
- //llinfos << "Playing attached sound " << audio_uuid << llendl;
+ //LL_INFOS() << "Playing attached sound " << audio_uuid << LL_ENDL;
mAudioSourcep->play(audio_uuid);
}
}
@@ -5032,7 +5265,10 @@ LLAudioSource *LLViewerObject::getAudioSource(const LLUUID& owner_id)
LLAudioSourceVO *asvop = new LLAudioSourceVO(mID, owner_id, 0.01f, this);
mAudioSourcep = asvop;
- if(gAudiop) gAudiop->addAudioSource(asvop);
+ if(gAudiop)
+ {
+ gAudiop->addAudioSource(asvop);
+ }
}
return mAudioSourcep;
@@ -5040,10 +5276,6 @@ LLAudioSource *LLViewerObject::getAudioSource(const LLUUID& owner_id)
void LLViewerObject::adjustAudioGain(const F32 gain)
{
- if (!gAudiop)
- {
- return;
- }
if (mAudioSourcep)
{
mAudioGain = gain;
@@ -5100,7 +5332,7 @@ LLViewerObject::ExtraParameter* LLViewerObject::createNewParameterEntry(U16 para
}
default:
{
- llinfos << "Unknown param type." << llendl;
+ LL_INFOS() << "Unknown param type." << LL_ENDL;
break;
}
};
@@ -5238,7 +5470,7 @@ void LLViewerObject::parameterChanged(U16 param_type, LLNetworkData* data, BOOL
}
else
{
- llwarns << "Failed to send object extra parameters: " << param_type << llendl;
+ LL_WARNS() << "Failed to send object extra parameters: " << param_type << LL_ENDL;
}
}
}
@@ -5277,6 +5509,28 @@ void LLViewerObject::clearDrawableState(U32 state, BOOL recursive)
}
}
+BOOL LLViewerObject::isDrawableState(U32 state, BOOL recursive) const
+{
+ BOOL matches = FALSE;
+ if (mDrawable)
+ {
+ matches = mDrawable->isState(state);
+ }
+ if (recursive)
+ {
+ for (child_list_t::const_iterator iter = mChildList.begin();
+ (iter != mChildList.end()) && matches; iter++)
+ {
+ LLViewerObject* child = *iter;
+ matches &= child->isDrawableState(state, recursive);
+ }
+ }
+
+ return matches;
+}
+
+
+
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// RN: these functions assume a 2-level hierarchy
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -5503,7 +5757,18 @@ void LLViewerObject::setRegion(LLViewerRegion *regionp)
{
if (!regionp)
{
- llwarns << "viewer object set region to NULL" << llendl;
+ LL_WARNS() << "viewer object set region to NULL" << LL_ENDL;
+ }
+ if(regionp != mRegionp)
+ {
+ if(mRegionp)
+ {
+ mRegionp->removeFromCreatedList(getLocalID());
+ }
+ if(regionp)
+ {
+ regionp->addToCreatedList(getLocalID());
+ }
}
mLatestRecvPacketID = 0;
@@ -5525,10 +5790,10 @@ void LLViewerObject::updateRegion(LLViewerRegion *regionp)
// if (regionp)
// {
// F64 now = LLFrameTimer::getElapsedSeconds();
-// llinfos << "Updating to region " << regionp->getName()
+// LL_INFOS() << "Updating to region " << regionp->getName()
// << ", ms since last update message: " << (F32)((now - mLastMessageUpdateSecs) * 1000.0)
// << ", ms since last interpolation: " << (F32)((now - mLastInterpUpdateSecs) * 1000.0)
-// << llendl;
+// << LL_ENDL;
// }
}
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index c34d4493d5..bab107cc57 100755
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -30,8 +30,7 @@
#include <map>
#include "llassetstorage.h"
-#include "lldarrayptr.h"
-#include "llhudicon.h"
+//#include "llhudicon.h"
#include "llinventory.h"
#include "llrefcount.h"
#include "llprimitive.h"
@@ -43,33 +42,30 @@
#include "v3math.h"
#include "llvertexbuffer.h"
#include "llbbox.h"
-#include "llbbox.h"
class LLAgent; // TODO: Get rid of this.
class LLAudioSource;
class LLAudioSourceVO;
-class LLDataPacker;
class LLColor4;
-class LLFrameTimer;
+class LLDataPacker;
+class LLDataPackerBinaryBuffer;
class LLDrawable;
-class LLHost;
class LLHUDText;
-class LLWorld;
-class LLNameValue;
-class LLNetMap;
+class LLHost;
class LLMessageSystem;
+class LLNameValue;
class LLPartSysData;
-class LLPrimitive;
class LLPipeline;
class LLTextureEntry;
-class LLViewerTexture;
+class LLVOAvatar;
+class LLVOInventoryListener;
class LLViewerInventoryItem;
class LLViewerObject;
+class LLViewerObjectMedia;
class LLViewerPartSourceScript;
class LLViewerRegion;
-class LLViewerObjectMedia;
-class LLVOInventoryListener;
-class LLVOAvatar;
+class LLViewerTexture;
+class LLWorld;
typedef enum e_object_update_type
{
@@ -107,7 +103,11 @@ struct PotentialReturnableObject
//============================================================================
-class LLViewerObject : public LLPrimitive, public LLRefCount, public LLGLUpdate
+class LLViewerObject
+: public LLPrimitive,
+ public LLRefCount,
+ public LLGLUpdate,
+ public LLTrace::MemTrackable<LLViewerObject>
{
protected:
~LLViewerObject(); // use unref()
@@ -157,6 +157,7 @@ public:
INVALID_UPDATE = 0x80000000
};
+ static U32 extractSpatialExtents(LLDataPackerBinaryBuffer *dp, LLVector3& pos, LLVector3& scale, LLQuaternion& rot);
virtual U32 processUpdateMessage(LLMessageSystem *mesgsys,
void **user_data,
U32 block_num,
@@ -414,6 +415,7 @@ public:
void setDrawableState(U32 state, BOOL recursive = TRUE);
void clearDrawableState(U32 state, BOOL recursive = TRUE);
+ BOOL isDrawableState(U32 state, BOOL recursive = TRUE) const;
// Called when the drawable shifts
virtual void onShift(const LLVector4a &shift_vector) { }
@@ -525,6 +527,7 @@ public:
virtual void updateRegion(LLViewerRegion *regionp);
void updateFlags(BOOL physics_changed = FALSE);
+ void loadFlags(U32 flags); //load flags from cache or from message
BOOL setFlags(U32 flag, BOOL state);
BOOL setFlagsWithoutUpdate(U32 flag, BOOL state);
void setPhysicsShapeType(U8 type);
@@ -555,6 +558,13 @@ public:
friend class LLViewerMediaList;
public:
+ static void unpackVector3(LLDataPackerBinaryBuffer* dp, LLVector3& value, std::string name);
+ static void unpackUUID(LLDataPackerBinaryBuffer* dp, LLUUID& value, std::string name);
+ static void unpackU32(LLDataPackerBinaryBuffer* dp, U32& value, std::string name);
+ static void unpackU8(LLDataPackerBinaryBuffer* dp, U8& value, std::string name);
+ static U32 unpackParentID(LLDataPackerBinaryBuffer* dp, U32& parent_id);
+
+public:
//counter-translation
void resetChildrenPosition(const LLVector3& offset, BOOL simplified = FALSE) ;
//counter-rotation
@@ -575,7 +585,9 @@ private:
U32 checkMediaURL(const std::string &media_url);
// Motion prediction between updates
- void interpolateLinearMotion(const F64 & time, const F32 & dt);
+ void interpolateLinearMotion(const F64SecondsImplicit & time, const F32SecondsImplicit & dt);
+
+ static void initObjectDataMap();
public:
//
@@ -628,6 +640,7 @@ private:
// Grabbed from UPDATE_FLAGS
U32 mFlags;
+ static std::map<std::string, U32> sObjectDataMap;
public:
// Sent to sim in UPDATE_FLAGS, received in ObjectPhysicsProperties
U8 mPhysicsShapeType;
@@ -651,7 +664,7 @@ public:
// TODO: Make all this stuff private. JC
LLPointer<LLHUDText> mText;
- LLPointer<LLHUDIcon> mIcon;
+ LLPointer<class LLHUDIcon> mIcon;
static BOOL sUseSharedDrawables;
@@ -689,8 +702,6 @@ protected:
void deleteParticleSource();
void setParticleSource(const LLPartSysData& particle_parameters, const LLUUID& owner_id);
-public:
-
private:
void setNameValueList(const std::string& list); // clears nv pairs and then individually adds \n separated NV pairs from \0 terminated string
void deleteTEImages(); // correctly deletes list of images
@@ -701,8 +712,8 @@ protected:
child_list_t mChildList;
- F64 mLastInterpUpdateSecs; // Last update for purposes of interpolation
- F64 mLastMessageUpdateSecs; // Last update from a message from the simulator
+ F64Seconds mLastInterpUpdateSecs; // Last update for purposes of interpolation
+ F64Seconds mLastMessageUpdateSecs; // Last update from a message from the simulator
TPACKETID mLatestRecvPacketID; // Latest time stamp on message from simulator
// extra data sent from the sim...currently only used for tree species info
@@ -768,12 +779,13 @@ protected:
static S32 sAxisArrowLength;
+
// These two caches are only correct for non-parented objects right now!
mutable LLVector3 mPositionRegion;
mutable LLVector3 mPositionAgent;
- static void setPhaseOutUpdateInterpolationTime(F32 value) { sPhaseOutUpdateInterpolationTime = (F64) value; }
- static void setMaxUpdateInterpolationTime(F32 value) { sMaxUpdateInterpolationTime = (F64) value; }
+ static void setPhaseOutUpdateInterpolationTime(F32 value) { sPhaseOutUpdateInterpolationTime = (F64Seconds) value; }
+ static void setMaxUpdateInterpolationTime(F32 value) { sMaxUpdateInterpolationTime = (F64Seconds) value; }
static void setVelocityInterpolate(BOOL value) { sVelocityInterpolate = value; }
static void setPingInterpolate(BOOL value) { sPingInterpolate = value; }
@@ -781,8 +793,8 @@ protected:
private:
static S32 sNumObjects;
- static F64 sPhaseOutUpdateInterpolationTime; // For motion interpolation
- static F64 sMaxUpdateInterpolationTime; // For motion interpolation
+ static F64Seconds sPhaseOutUpdateInterpolationTime; // For motion interpolation
+ static F64Seconds sMaxUpdateInterpolationTime; // For motion interpolation
static BOOL sVelocityInterpolate;
static BOOL sPingInterpolate;
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index f667c2bf33..7c36b30dd1 100755
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -29,7 +29,6 @@
#include "llviewerobjectlist.h"
#include "message.h"
-#include "timing.h"
#include "llfasttimer.h"
#include "llrender.h"
#include "llwindow.h" // decBusyCount()
@@ -47,6 +46,7 @@
#include "lltooltip.h"
#include "llworld.h"
#include "llstring.h"
+#include "llhudicon.h"
#include "llhudnametag.h"
#include "lldrawable.h"
#include "llflexibleobject.h"
@@ -68,7 +68,7 @@
#include "u64.h"
#include "llviewertexturelist.h"
#include "lldatapacker.h"
-#ifdef LL_STANDALONE
+#ifdef LL_USESYSTEMLIBS
#include <zlib.h>
#else
#include "zlib/zlib.h"
@@ -76,6 +76,8 @@
#include "object_flags.h"
#include "llappviewer.h"
+#include "llfloaterperms.h"
+#include "llvocache.h"
extern F32 gMinObjectDistance;
extern BOOL gAnimateTextures;
@@ -93,12 +95,9 @@ extern LLPipeline gPipeline;
U32 LLViewerObjectList::sSimulatorMachineIndex = 1; // Not zero deliberately, to speed up index check.
std::map<U64, U32> LLViewerObjectList::sIPAndPortToIndex;
std::map<U64, LLUUID> LLViewerObjectList::sIndexAndLocalIDToUUID;
-LLStat LLViewerObjectList::sCacheHitRate("object_cache_hits", 128);
LLViewerObjectList::LLViewerObjectList()
{
- mNumVisCulled = 0;
- mNumSizeCulled = 0;
mCurLazyUpdateIndex = 0;
mCurBin = 0;
mNumDeadObjects = 0;
@@ -172,7 +171,7 @@ BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject* objectp)
U64 ipport = (((U64)ip) << 32) | (U64)port;
U32 index = sIPAndPortToIndex[ipport];
- // llinfos << "Removing object from table, local ID " << local_id << ", ip " << ip << ":" << port << llendl;
+ // LL_INFOS() << "Removing object from table, local ID " << local_id << ", ip " << ip << ":" << port << LL_ENDL;
U64 indexid = (((U64)index) << 32) | (U64)local_id;
@@ -189,8 +188,8 @@ BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject* objectp)
return TRUE;
}
// UUIDs did not match - this would zap a valid entry, so don't erase it
- //llinfos << "Tried to erase entry where id in table ("
- // << iter->second << ") did not match object " << object.getID() << llendl;
+ //LL_INFOS() << "Tried to erase entry where id in table ("
+ // << iter->second << ") did not match object " << object.getID() << LL_ENDL;
}
return FALSE ;
@@ -215,8 +214,8 @@ void LLViewerObjectList::setUUIDAndLocal(const LLUUID &id,
sIndexAndLocalIDToUUID[indexid] = id;
- //llinfos << "Adding object to table, full ID " << id
- // << ", local ID " << local_id << ", ip " << ip << ":" << port << llendl;
+ //LL_INFOS() << "Adding object to table, full ID " << id
+ // << ", local ID " << local_id << ", ip " << ip << ":" << port << LL_ENDL;
}
S32 gFullObjectUpdates = 0;
@@ -227,9 +226,15 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp,
U32 i,
const EObjectUpdateType update_type,
LLDataPacker* dpp,
- BOOL just_created)
+ bool just_created,
+ bool from_cache)
{
- LLMessageSystem* msg = gMessageSystem;
+ LLMessageSystem* msg = NULL;
+
+ if(!from_cache)
+ {
+ msg = gMessageSystem;
+ }
// ignore returned flags
objectp->processUpdateMessage(msg, user_data, i, update_type, dpp);
@@ -253,7 +258,18 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp,
// RN: this must be called after we have a drawable
// (from gPipeline.addObject)
// so that the drawable parent is set properly
+ if(msg != NULL)
+ {
findOrphans(objectp, msg->getSenderIP(), msg->getSenderPort());
+ }
+ else
+ {
+ LLViewerRegion* regionp = objectp->getRegion();
+ if(regionp != NULL)
+ {
+ findOrphans(objectp, regionp->getHost().getAddress(), regionp->getHost().getPort());
+ }
+ }
// If we're just wandering around, don't create new objects selected.
if (just_created
@@ -262,8 +278,8 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp,
{
if ( LLToolMgr::getInstance()->getCurrentTool() != LLToolPie::getInstance() )
{
- // llinfos << "DEBUG selecting " << objectp->mID << " "
- // << objectp->mLocalID << llendl;
+ // LL_INFOS() << "DEBUG selecting " << objectp->mID << " "
+ // << objectp->mLocalID << LL_ENDL;
LLSelectMgr::getInstance()->selectObjectAndFamily(objectp);
dialog_refresh_all();
}
@@ -274,14 +290,104 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp,
}
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_OBJECTS("Process Objects");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_OBJECTS("Process Objects");
+
+LLViewerObject* LLViewerObjectList::processObjectUpdateFromCache(LLVOCacheEntry* entry, LLViewerRegion* regionp)
+{
+ LLDataPacker *cached_dpp = entry->getDP();
+
+ if (!cached_dpp)
+ {
+ return NULL; //nothing cached.
+ }
+
+ LLViewerObject *objectp;
+ U32 local_id;
+ LLPCode pcode = 0;
+ LLUUID fullid;
+ LLViewerStatsRecorder& recorder = LLViewerStatsRecorder::instance();
+
+ // Cache Hit.
+ record(LLStatViewer::OBJECT_CACHE_HIT_RATE, LLUnits::Ratio::fromValue(1));
+
+ cached_dpp->reset();
+ cached_dpp->unpackUUID(fullid, "ID");
+ cached_dpp->unpackU32(local_id, "LocalID");
+ cached_dpp->unpackU8(pcode, "PCode");
+
+ objectp = findObject(fullid);
+
+ if (objectp)
+ {
+ if(!objectp->isDead() && (objectp->mLocalID != entry->getLocalID() ||
+ objectp->getRegion() != regionp))
+ {
+ removeFromLocalIDTable(objectp);
+ setUUIDAndLocal(fullid, entry->getLocalID(),
+ regionp->getHost().getAddress(),
+ regionp->getHost().getPort());
+
+ if (objectp->mLocalID != entry->getLocalID())
+ { // Update local ID in object with the one sent from the region
+ objectp->mLocalID = entry->getLocalID();
+ }
+
+ if (objectp->getRegion() != regionp)
+ { // Object changed region, so update it
+ objectp->updateRegion(regionp); // for LLVOAvatar
+ }
+ }
+ else
+ {
+ //should fall through if already loaded because may need to update the object.
+ //return objectp; //already loaded.
+ }
+ }
+
+ bool justCreated = false;
+ if (!objectp)
+ {
+ objectp = createObjectFromCache(pcode, regionp, fullid, entry->getLocalID());
+
+ if (!objectp)
+ {
+ LL_INFOS() << "createObject failure for object: " << fullid << LL_ENDL;
+ recorder.objectUpdateFailure(entry->getLocalID(), OUT_FULL_CACHED, 0);
+ return NULL;
+ }
+ justCreated = true;
+ mNumNewObjects++;
+ }
+
+ if (objectp->isDead())
+ {
+ LL_WARNS() << "Dead object " << objectp->mID << " in UUID map 1!" << LL_ENDL;
+ }
+
+ processUpdateCore(objectp, NULL, 0, OUT_FULL_CACHED, cached_dpp, justCreated, true);
+ objectp->loadFlags(entry->getUpdateFlags()); //just in case, reload update flags from cache.
+
+ if(entry->getHitCount() > 0)
+ {
+ objectp->setLastUpdateType(OUT_FULL_CACHED);
+ }
+ else
+ {
+ objectp->setLastUpdateType(OUT_FULL_COMPRESSED); //newly cached
+ objectp->setLastUpdateCached(TRUE);
+ }
+ recorder.log(0.2f);
+ LLVOAvatar::cullAvatarsByPixelArea();
+
+ return objectp;
+}
void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
void **user_data,
const EObjectUpdateType update_type,
- bool cached, bool compressed)
+ bool compressed)
{
- LLFastTimer t(FTM_PROCESS_OBJECTS);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_OBJECTS);
LLViewerObject *objectp;
S32 num_objects;
@@ -297,9 +403,9 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
num_objects = mesgsys->getNumberOfBlocksFast(_PREHASH_ObjectData);
// I don't think this case is ever hit. TODO* Test this.
- if (!cached && !compressed && update_type != OUT_FULL)
+ if (!compressed && update_type != OUT_FULL)
{
- //llinfos << "TEST: !cached && !compressed && update_type != OUT_FULL" << llendl;
+ //LL_INFOS() << "TEST: !cached && !compressed && update_type != OUT_FULL" << LL_ENDL;
gTerseObjectUpdates += num_objects;
/*
S32 size;
@@ -311,7 +417,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
{
size = mesgsys->getReceiveSize();
}
- llinfos << "Received terse " << num_objects << " in " << size << " byte (" << size/num_objects << ")" << llendl;
+ LL_INFOS() << "Received terse " << num_objects << " in " << size << " byte (" << size/num_objects << ")" << LL_ENDL;
*/
}
else
@@ -327,7 +433,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
size = mesgsys->getReceiveSize();
}
- llinfos << "Received " << num_objects << " in " << size << " byte (" << size/num_objects << ")" << llendl;
+ LL_INFOS() << "Received " << num_objects << " in " << size << " byte (" << size/num_objects << ")" << LL_ENDL;
*/
gFullObjectUpdates += num_objects;
}
@@ -339,13 +445,12 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
if (!regionp)
{
- llwarns << "Object update from unknown region! " << region_handle << llendl;
+ LL_WARNS() << "Object update from unknown region! " << region_handle << LL_ENDL;
return;
}
U8 compressed_dpbuffer[2048];
LLDataPackerBinaryBuffer compressed_dp(compressed_dpbuffer, 2048);
- LLDataPacker *cached_dpp = NULL;
LLViewerStatsRecorder& recorder = LLViewerStatsRecorder::instance();
for (i = 0; i < num_objects; i++)
@@ -354,57 +459,37 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
LLTimer update_timer;
BOOL justCreated = FALSE;
S32 msg_size = 0;
+ bool update_cache = false; //update object cache if it is a full-update or terse update
- if (cached)
- {
- U32 id;
- U32 crc;
- mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_ID, id, i);
- mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_CRC, crc, i);
- msg_size += sizeof(U32) * 2;
-
- // Lookup data packer and add this id to cache miss lists if necessary.
- U8 cache_miss_type = LLViewerRegion::CACHE_MISS_TYPE_NONE;
- cached_dpp = regionp->getDP(id, crc, cache_miss_type);
- if (cached_dpp)
- {
- // Cache Hit.
- cached_dpp->reset();
- cached_dpp->unpackUUID(fullid, "ID");
- cached_dpp->unpackU32(local_id, "LocalID");
- cached_dpp->unpackU8(pcode, "PCode");
- }
- else
- {
- // Cache Miss.
- recorder.cacheMissEvent(id, update_type, cache_miss_type, msg_size);
-
- continue; // no data packer, skip this object
- }
- }
- else if (compressed)
+ if (compressed)
{
S32 uncompressed_length = 2048;
compressed_dp.reset();
- U32 flags = 0;
- if (update_type != OUT_TERSE_IMPROVED) // OUT_FULL_COMPRESSED only?
- {
- mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_UpdateFlags, flags, i);
- }
-
uncompressed_length = mesgsys->getSizeFast(_PREHASH_ObjectData, i, _PREHASH_Data);
mesgsys->getBinaryDataFast(_PREHASH_ObjectData, _PREHASH_Data, compressed_dpbuffer, 0, i);
compressed_dp.assignBuffer(compressed_dpbuffer, uncompressed_length);
if (update_type != OUT_TERSE_IMPROVED) // OUT_FULL_COMPRESSED only?
{
- compressed_dp.unpackUUID(fullid, "ID");
- compressed_dp.unpackU32(local_id, "LocalID");
- compressed_dp.unpackU8(pcode, "PCode");
+ U32 flags = 0;
+ mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_UpdateFlags, flags, i);
+
+ if(flags & FLAGS_TEMPORARY_ON_REZ)
+ {
+ compressed_dp.unpackUUID(fullid, "ID");
+ compressed_dp.unpackU32(local_id, "LocalID");
+ compressed_dp.unpackU8(pcode, "PCode");
+ }
+ else //send to object cache
+ {
+ regionp->cacheFullUpdate(compressed_dp, flags);
+ continue;
}
- else
+ }
+ else //OUT_TERSE_IMPROVED
{
+ update_cache = true;
compressed_dp.unpackU32(local_id, "LocalID");
getUUIDFromLocal(fullid,
local_id,
@@ -412,7 +497,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
gMessageSystem->getSenderPort());
if (fullid.isNull())
{
- // llwarns << "update for unknown localid " << local_id << " host " << gMessageSystem->getSender() << ":" << gMessageSystem->getSenderPort() << llendl;
+ // LL_WARNS() << "update for unknown localid " << local_id << " host " << gMessageSystem->getSender() << ":" << gMessageSystem->getSenderPort() << LL_ENDL;
mNumUnknownUpdates++;
}
}
@@ -428,20 +513,26 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
gMessageSystem->getSenderPort());
if (fullid.isNull())
{
- // llwarns << "update for unknown localid " << local_id << " host " << gMessageSystem->getSender() << llendl;
+ // LL_WARNS() << "update for unknown localid " << local_id << " host " << gMessageSystem->getSender() << LL_ENDL;
mNumUnknownUpdates++;
}
}
else // OUT_FULL only?
{
+ update_cache = true;
mesgsys->getUUIDFast(_PREHASH_ObjectData, _PREHASH_FullID, fullid, i);
mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_ID, local_id, i);
msg_size += sizeof(LLUUID);
msg_size += sizeof(U32);
- // llinfos << "Full Update, obj " << local_id << ", global ID" << fullid << "from " << mesgsys->getSender() << llendl;
+ // LL_INFOS() << "Full Update, obj " << local_id << ", global ID" << fullid << "from " << mesgsys->getSender() << LL_ENDL;
}
objectp = findObject(fullid);
+ if(update_cache)
+ {
+ objectp = regionp->updateCacheEntry(local_id, objectp, update_type);
+ }
+
// This looks like it will break if the local_id of the object doesn't change
// upon boundary crossing, but we check for region id matching later...
// Reset object local id and region pointer if things have changed
@@ -451,13 +542,13 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
{
//if (objectp->getRegion())
//{
- // llinfos << "Local ID change: Removing object from table, local ID " << objectp->mLocalID
+ // LL_INFOS() << "Local ID change: Removing object from table, local ID " << objectp->mLocalID
// << ", id from message " << local_id << ", from "
// << LLHost(objectp->getRegion()->getHost().getAddress(), objectp->getRegion()->getHost().getPort())
// << ", full id " << fullid
// << ", objects id " << objectp->getID()
// << ", regionp " << (U32) regionp << ", object region " << (U32) objectp->getRegion()
- // << llendl;
+ // << LL_ENDL;
//}
removeFromLocalIDTable(objectp);
setUUIDAndLocal(fullid,
@@ -482,19 +573,16 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
{
if (update_type == OUT_TERSE_IMPROVED)
{
- // llinfos << "terse update for an unknown object (compressed):" << fullid << llendl;
+ // LL_INFOS() << "terse update for an unknown object (compressed):" << fullid << LL_ENDL;
recorder.objectUpdateFailure(local_id, update_type, msg_size);
continue;
}
}
- else if (cached) // Cache hit only?
- {
- }
else
{
if (update_type != OUT_FULL)
{
- //llinfos << "terse update for an unknown object:" << fullid << llendl;
+ //LL_INFOS() << "terse update for an unknown object:" << fullid << LL_ENDL;
recorder.objectUpdateFailure(local_id, update_type, msg_size);
continue;
}
@@ -507,7 +595,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
if (mDeadObjects.find(fullid) != mDeadObjects.end())
{
mNumDeadObjectUpdates++;
- //llinfos << "update for a dead object:" << fullid << llendl;
+ //LL_INFOS() << "update for a dead object:" << fullid << LL_ENDL;
recorder.objectUpdateFailure(local_id, update_type, msg_size);
continue;
}
@@ -516,23 +604,21 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
objectp = createObject(pcode, regionp, fullid, local_id, gMessageSystem->getSender());
if (!objectp)
{
- llinfos << "createObject failure for object: " << fullid << llendl;
+ LL_INFOS() << "createObject failure for object: " << fullid << LL_ENDL;
recorder.objectUpdateFailure(local_id, update_type, msg_size);
continue;
}
+
justCreated = TRUE;
mNumNewObjects++;
- sCacheHitRate.addValue(cached ? 100.f : 0.f);
-
}
-
if (objectp->isDead())
{
- llwarns << "Dead object " << objectp->mID << " in UUID map 1!" << llendl;
+ LL_WARNS() << "Dead object " << objectp->mID << " in UUID map 1!" << LL_ENDL;
}
- bool bCached = false;
+ //bool bCached = false;
if (compressed)
{
if (update_type != OUT_TERSE_IMPROVED) // OUT_FULL_COMPRESSED only?
@@ -540,17 +626,21 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
objectp->mLocalID = local_id;
}
processUpdateCore(objectp, user_data, i, update_type, &compressed_dp, justCreated);
+
+#if 0
if (update_type != OUT_TERSE_IMPROVED) // OUT_FULL_COMPRESSED only?
{
+ U32 flags = 0;
+ mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_UpdateFlags, flags, i);
+
+ if(!(flags & FLAGS_TEMPORARY_ON_REZ))
+ {
bCached = true;
- LLViewerRegion::eCacheUpdateResult result = objectp->mRegionp->cacheFullUpdate(objectp, compressed_dp);
+ LLViewerRegion::eCacheUpdateResult result = objectp->mRegionp->cacheFullUpdate(objectp, compressed_dp, flags);
recorder.cacheFullUpdate(local_id, update_type, result, objectp, msg_size);
}
}
- else if (cached) // Cache hit only?
- {
- objectp->mLocalID = local_id;
- processUpdateCore(objectp, user_data, i, update_type, cached_dpp, justCreated);
+#endif
}
else
{
@@ -561,8 +651,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
processUpdateCore(objectp, user_data, i, update_type, NULL, justCreated);
}
recorder.objectUpdateEvent(local_id, update_type, objectp, msg_size);
- objectp->setLastUpdateType(update_type);
- objectp->setLastUpdateCached(bCached);
+ objectp->setLastUpdateType(update_type);
}
recorder.log(0.2f);
@@ -574,14 +663,52 @@ void LLViewerObjectList::processCompressedObjectUpdate(LLMessageSystem *mesgsys,
void **user_data,
const EObjectUpdateType update_type)
{
- processObjectUpdate(mesgsys, user_data, update_type, false, true);
+ processObjectUpdate(mesgsys, user_data, update_type, true);
}
void LLViewerObjectList::processCachedObjectUpdate(LLMessageSystem *mesgsys,
void **user_data,
const EObjectUpdateType update_type)
{
- processObjectUpdate(mesgsys, user_data, update_type, true, false);
+ //processObjectUpdate(mesgsys, user_data, update_type, true, false);
+
+ S32 num_objects = mesgsys->getNumberOfBlocksFast(_PREHASH_ObjectData);
+ gFullObjectUpdates += num_objects;
+
+ U64 region_handle;
+ mesgsys->getU64Fast(_PREHASH_RegionData, _PREHASH_RegionHandle, region_handle);
+ LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(region_handle);
+ if (!regionp)
+ {
+ LL_WARNS() << "Object update from unknown region! " << region_handle << LL_ENDL;
+ return;
+ }
+
+ LLViewerStatsRecorder& recorder = LLViewerStatsRecorder::instance();
+
+ for (S32 i = 0; i < num_objects; i++)
+ {
+ S32 msg_size = 0;
+ U32 id;
+ U32 crc;
+ U32 flags;
+ mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_ID, id, i);
+ mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_CRC, crc, i);
+ mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_UpdateFlags, flags, i);
+ msg_size += sizeof(U32) * 2;
+
+ // Lookup data packer and add this id to cache miss lists if necessary.
+ U8 cache_miss_type = LLViewerRegion::CACHE_MISS_TYPE_NONE;
+ if(!regionp->probeCache(id, crc, flags, cache_miss_type))
+ {
+ // Cache Miss.
+ recorder.cacheMissEvent(id, update_type, cache_miss_type, msg_size);
+
+ continue; // no data packer, skip this object
+ }
+ }
+
+ return;
}
void LLViewerObjectList::dirtyAllObjectInventory()
@@ -670,6 +797,7 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent)
class LLObjectCostResponder : public LLCurl::Responder
{
+ LOG_CLASS(LLObjectCostResponder);
public:
LLObjectCostResponder(const LLSD& object_ids)
: mObjectIDs(object_ids)
@@ -690,29 +818,28 @@ public:
}
}
- void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content)
+private:
+ /* virtual */ void httpFailure()
{
- llwarns
- << "Transport error requesting object cost "
- << "[status: " << statusNum << "]: "
- << content << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
// TODO*: Error message to user
// For now just clear the request from the pending list
clear_object_list_pending_requests();
}
- void result(const LLSD& content)
+ /* virtual */ void httpSuccess()
{
+ const LLSD& content = getContent();
if ( !content.isMap() || content.has("error") )
{
// Improper response or the request had an error,
// show an error to the user?
- llwarns
+ LL_WARNS()
<< "Application level error when fetching object "
<< "cost. Message: " << content["error"]["message"].asString()
<< ", identifier: " << content["error"]["identifier"].asString()
- << llendl;
+ << LL_ENDL;
// TODO*: Adaptively adjust request size if the
// service says we've requested too many and retry
@@ -759,6 +886,7 @@ private:
class LLPhysicsFlagsResponder : public LLCurl::Responder
{
+ LOG_CLASS(LLPhysicsFlagsResponder);
public:
LLPhysicsFlagsResponder(const LLSD& object_ids)
: mObjectIDs(object_ids)
@@ -779,29 +907,28 @@ public:
}
}
- void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content)
+private:
+ /* virtual */ void httpFailure()
{
- llwarns
- << "Transport error requesting object physics flags "
- << "[status: " << statusNum << "]: "
- << content << llendl;
+ LL_WARNS() << dumpResponse() << LL_ENDL;
// TODO*: Error message to user
// For now just clear the request from the pending list
clear_object_list_pending_requests();
}
- void result(const LLSD& content)
+ /* virtual void */ void httpSuccess()
{
+ const LLSD& content = getContent();
if ( !content.isMap() || content.has("error") )
{
// Improper response or the request had an error,
// show an error to the user?
- llwarns
+ LL_WARNS()
<< "Application level error when fetching object "
<< "physics flags. Message: " << content["error"]["message"].asString()
<< ", identifier: " << content["error"]["identifier"].asString()
- << llendl;
+ << LL_ENDL;
// TODO*: Adaptively adjust request size if the
// service says we've requested too many and retry
@@ -852,6 +979,8 @@ private:
LLSD mObjectIDs;
};
+static LLTrace::BlockTimerStatHandle FTM_IDLE_COPY("Idle Copy");
+
void LLViewerObjectList::update(LLAgent &agent)
{
// Update globals
@@ -864,7 +993,7 @@ void LLViewerObjectList::update(LLAgent &agent)
phase_out_time < 0.0 ||
phase_out_time > interp_time)
{
- llwarns << "Invalid values for InterpolationTime or InterpolationPhaseOut, resetting to defaults" << llendl;
+ LL_WARNS() << "Invalid values for InterpolationTime or InterpolationPhaseOut, resetting to defaults" << LL_ENDL;
interp_time = 3.0f;
phase_out_time = 1.0f;
}
@@ -875,14 +1004,14 @@ void LLViewerObjectList::update(LLAgent &agent)
// update global timer
F32 last_time = gFrameTimeSeconds;
- U64 time = totalTime(); // this will become the new gFrameTime when the update is done
+ U64Microseconds time = totalTime(); // this will become the new gFrameTime when the update is done
// Time _can_ go backwards, for example if the user changes the system clock.
// It doesn't cause any fatal problems (just some oddness with stats), so we shouldn't assert here.
// llassert(time > gFrameTime);
- F64 time_diff = U64_to_F64(time - gFrameTime)/(F64)SEC_TO_MICROSEC;
+ F64Seconds time_diff = time - gFrameTime;
gFrameTime = time;
- F64 time_since_start = U64_to_F64(gFrameTime - gStartTime)/(F64)SEC_TO_MICROSEC;
- gFrameTimeSeconds = (F32)time_since_start;
+ F64Seconds time_since_start = gFrameTime - gStartTime;
+ gFrameTimeSeconds = time_since_start;
gFrameIntervalSeconds = gFrameTimeSeconds - last_time;
if (gFrameIntervalSeconds < 0.f)
@@ -902,10 +1031,8 @@ void LLViewerObjectList::update(LLAgent &agent)
U32 idle_count = 0;
- static LLFastTimer::DeclareTimer idle_copy("Idle Copy");
-
{
- LLFastTimer t(idle_copy);
+ LL_RECORD_BLOCK_TIME(FTM_IDLE_COPY);
for (std::vector<LLPointer<LLViewerObject> >::iterator active_iter = mActiveObjects.begin();
active_iter != mActiveObjects.end(); active_iter++)
@@ -926,7 +1053,7 @@ void LLViewerObjectList::update(LLAgent &agent)
else
{ // There shouldn't be any NULL pointers in the list, but they have caused
// crashes before. This may be idleUpdate() messing with the list.
- llwarns << "LLViewerObjectList::update has a NULL objectp" << llendl;
+ LL_WARNS() << "LLViewerObjectList::update has a NULL objectp" << LL_ENDL;
}
}
}
@@ -971,9 +1098,6 @@ void LLViewerObjectList::update(LLAgent &agent)
fetchObjectCosts();
fetchPhysicsFlags();
- mNumSizeCulled = 0;
- mNumVisCulled = 0;
-
// update max computed render cost
LLVOVolume::updateRenderComplexity();
@@ -987,7 +1111,7 @@ void LLViewerObjectList::update(LLAgent &agent)
/*
// Debugging code for viewing orphans, and orphaned parents
LLUUID id;
- for (i = 0; i < mOrphanParents.count(); i++)
+ for (i = 0; i < mOrphanParents.size(); i++)
{
id = sIndexAndLocalIDToUUID[mOrphanParents[i]];
LLViewerObject *objectp = findObject(id);
@@ -1004,7 +1128,7 @@ void LLViewerObjectList::update(LLAgent &agent)
}
LLColor4 text_color;
- for (i = 0; i < mOrphanChildren.count(); i++)
+ for (i = 0; i < mOrphanChildren.size(); i++)
{
OrphanInfo oi = mOrphanChildren[i];
LLViewerObject *objectp = findObject(oi.mChildInfo);
@@ -1033,10 +1157,8 @@ void LLViewerObjectList::update(LLAgent &agent)
}
*/
- LLViewerStats::getInstance()->mNumObjectsStat.addValue((S32) mObjects.size());
- LLViewerStats::getInstance()->mNumActiveObjectsStat.addValue(idle_count);
- LLViewerStats::getInstance()->mNumSizeCulledStat.addValue(mNumSizeCulled);
- LLViewerStats::getInstance()->mNumVisCulledStat.addValue(mNumVisCulled);
+ sample(LLStatViewer::NUM_OBJECTS, mObjects.size());
+ sample(LLStatViewer::NUM_ACTIVE_OBJECTS, idle_count);
}
void LLViewerObjectList::fetchObjectCosts()
@@ -1169,7 +1291,7 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp)
{
if (mDeadObjects.find(objectp->mID) != mDeadObjects.end())
{
- llinfos << "Object " << objectp->mID << " already on dead list!" << llendl;
+ LL_INFOS() << "Object " << objectp->mID << " already on dead list!" << LL_ENDL;
}
else
{
@@ -1183,16 +1305,16 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp)
//if (objectp->getRegion())
//{
- // llinfos << "cleanupReferences removing object from table, local ID " << objectp->mLocalID << ", ip "
+ // LL_INFOS() << "cleanupReferences removing object from table, local ID " << objectp->mLocalID << ", ip "
// << objectp->getRegion()->getHost().getAddress() << ":"
- // << objectp->getRegion()->getHost().getPort() << llendl;
+ // << objectp->getRegion()->getHost().getPort() << LL_ENDL;
//}
removeFromLocalIDTable(objectp);
if (objectp->onActiveList())
{
- //llinfos << "Removing " << objectp->mID << " " << objectp->getPCodeString() << " from active list in cleanupReferences." << llendl;
+ //LL_INFOS() << "Removing " << objectp->mID << " " << objectp->getPCodeString() << " from active list in cleanupReferences." << LL_ENDL;
objectp->setOnActiveList(FALSE);
removeFromActiveList(objectp);
}
@@ -1209,11 +1331,11 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp)
mNumDeadObjects++;
}
-static LLFastTimer::DeclareTimer FTM_REMOVE_DRAWABLE("Remove Drawable");
+static LLTrace::BlockTimerStatHandle FTM_REMOVE_DRAWABLE("Remove Drawable");
void LLViewerObjectList::removeDrawable(LLDrawable* drawablep)
{
- LLFastTimer t(FTM_REMOVE_DRAWABLE);
+ LL_RECORD_BLOCK_TIME(FTM_REMOVE_DRAWABLE);
if (!drawablep)
{
@@ -1249,16 +1371,7 @@ BOOL LLViewerObjectList::killObject(LLViewerObject *objectp)
if (objectp)
{
- if (objectp->isDead())
- {
- // This object is already dead. Don't need to do more.
- return TRUE;
- }
- else
- {
- objectp->markDead();
- }
-
+ objectp->markDead(); // does the right thing if object already dead
return TRUE;
}
@@ -1301,19 +1414,19 @@ void LLViewerObjectList::killAllObjects()
if(!mObjects.empty())
{
- llwarns << "LLViewerObjectList::killAllObjects still has entries in mObjects: " << mObjects.size() << llendl;
+ LL_WARNS() << "LLViewerObjectList::killAllObjects still has entries in mObjects: " << mObjects.size() << LL_ENDL;
mObjects.clear();
}
if (!mActiveObjects.empty())
{
- llwarns << "Some objects still on active object list!" << llendl;
+ LL_WARNS() << "Some objects still on active object list!" << LL_ENDL;
mActiveObjects.clear();
}
if (!mMapObjects.empty())
{
- llwarns << "Some objects still on map object list!" << llendl;
+ LL_WARNS() << "Some objects still on map object list!" << LL_ENDL;
mMapObjects.clear();
}
}
@@ -1404,7 +1517,7 @@ void LLViewerObjectList::updateActive(LLViewerObject *objectp)
{
if (active)
{
- //llinfos << "Adding " << objectp->mID << " " << objectp->getPCodeString() << " to active list." << llendl;
+ //LL_INFOS() << "Adding " << objectp->mID << " " << objectp->getPCodeString() << " to active list." << LL_ENDL;
S32 idx = objectp->getListIndex();
if (idx <= -1)
{
@@ -1420,13 +1533,13 @@ void LLViewerObjectList::updateActive(LLViewerObject *objectp)
if (idx >= mActiveObjects.size() ||
mActiveObjects[idx] != objectp)
{
- llwarns << "Invalid object list index detected!" << llendl;
+ LL_WARNS() << "Invalid object list index detected!" << LL_ENDL;
}
}
}
else
{
- //llinfos << "Removing " << objectp->mID << " " << objectp->getPCodeString() << " from active list." << llendl;
+ //LL_INFOS() << "Removing " << objectp->mID << " " << objectp->getPCodeString() << " from active list." << LL_ENDL;
removeFromActiveList(objectp);
objectp->setOnActiveList(FALSE);
}
@@ -1464,7 +1577,7 @@ void LLViewerObjectList::updateObjectCost(const LLUUID& object_id, F32 object_co
void LLViewerObjectList::onObjectCostFetchFailure(const LLUUID& object_id)
{
- //llwarns << "Failed to fetch object cost for object: " << object_id << llendl;
+ //LL_WARNS() << "Failed to fetch object cost for object: " << object_id << LL_ENDL;
mPendingObjectCost.erase(object_id);
}
@@ -1503,13 +1616,13 @@ void LLViewerObjectList::updatePhysicsProperties(const LLUUID& object_id,
void LLViewerObjectList::onPhysicsFlagsFetchFailure(const LLUUID& object_id)
{
- //llwarns << "Failed to fetch physics flags for object: " << object_id << llendl;
+ //LL_WARNS() << "Failed to fetch physics flags for object: " << object_id << LL_ENDL;
mPendingPhysicsFlags.erase(object_id);
}
-static LLFastTimer::DeclareTimer FTM_SHIFT_OBJECTS("Shift Objects");
-static LLFastTimer::DeclareTimer FTM_PIPELINE_SHIFT("Pipeline Shift");
-static LLFastTimer::DeclareTimer FTM_REGION_SHIFT("Region Shift");
+static LLTrace::BlockTimerStatHandle FTM_SHIFT_OBJECTS("Shift Objects");
+static LLTrace::BlockTimerStatHandle FTM_PIPELINE_SHIFT("Pipeline Shift");
+static LLTrace::BlockTimerStatHandle FTM_REGION_SHIFT("Region Shift");
void LLViewerObjectList::shiftObjects(const LLVector3 &offset)
{
@@ -1522,7 +1635,7 @@ void LLViewerObjectList::shiftObjects(const LLVector3 &offset)
return;
}
- LLFastTimer t(FTM_SHIFT_OBJECTS);
+ LL_RECORD_BLOCK_TIME(FTM_SHIFT_OBJECTS);
LLViewerObject *objectp;
for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter)
@@ -1541,12 +1654,12 @@ void LLViewerObjectList::shiftObjects(const LLVector3 &offset)
}
{
- LLFastTimer t(FTM_PIPELINE_SHIFT);
+ LL_RECORD_BLOCK_TIME(FTM_PIPELINE_SHIFT);
gPipeline.shiftObjects(offset);
}
{
- LLFastTimer t(FTM_REGION_SHIFT);
+ LL_RECORD_BLOCK_TIME(FTM_REGION_SHIFT);
LLWorld::getInstance()->shiftRegions(offset);
}
}
@@ -1606,7 +1719,7 @@ void LLViewerObjectList::clearAllMapObjectsInRegion(LLViewerRegion* regionp)
if(dead_object_list.size() > 0)
{
- llwarns << "There are " << dead_object_list.size() << " dead objects on the map!" << llendl ;
+ LL_WARNS() << "There are " << dead_object_list.size() << " dead objects on the map!" << LL_ENDL ;
for(std::set<LLViewerObject*>::iterator iter = dead_object_list.begin(); iter != dead_object_list.end(); ++iter)
{
@@ -1615,7 +1728,7 @@ void LLViewerObjectList::clearAllMapObjectsInRegion(LLViewerRegion* regionp)
}
if(region_object_list.size() > 0)
{
- llwarns << "There are " << region_object_list.size() << " objects not removed from the deleted region!" << llendl ;
+ LL_WARNS() << "There are " << region_object_list.size() << " objects not removed from the deleted region!" << LL_ENDL ;
for(std::set<LLViewerObject*>::iterator iter = region_object_list.begin(); iter != region_object_list.end(); ++iter)
{
@@ -1881,7 +1994,7 @@ LLViewerObject *LLViewerObjectList::createObjectViewer(const LLPCode pcode, LLVi
LLViewerObject *objectp = LLViewerObject::createObject(fullid, pcode, regionp);
if (!objectp)
{
-// llwarns << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << llendl;
+// LL_WARNS() << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << LL_ENDL;
return NULL;
}
@@ -1894,6 +2007,29 @@ LLViewerObject *LLViewerObjectList::createObjectViewer(const LLPCode pcode, LLVi
return objectp;
}
+LLViewerObject *LLViewerObjectList::createObjectFromCache(const LLPCode pcode, LLViewerRegion *regionp, const LLUUID &uuid, const U32 local_id)
+{
+ llassert_always(uuid.notNull());
+
+ LLViewerObject *objectp = LLViewerObject::createObject(uuid, pcode, regionp);
+ if (!objectp)
+ {
+// LL_WARNS() << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << " id:" << fullid << LL_ENDL;
+ return NULL;
+ }
+
+ objectp->mLocalID = local_id;
+ mUUIDObjectMap[uuid] = objectp;
+ setUUIDAndLocal(uuid,
+ local_id,
+ regionp->getHost().getAddress(),
+ regionp->getHost().getPort());
+ mObjects.push_back(objectp);
+
+ updateActive(objectp);
+
+ return objectp;
+}
LLViewerObject *LLViewerObjectList::createObject(const LLPCode pcode, LLViewerRegion *regionp,
const LLUUID &uuid, const U32 local_id, const LLHost &sender)
@@ -1912,9 +2048,13 @@ LLViewerObject *LLViewerObjectList::createObject(const LLPCode pcode, LLViewerRe
LLViewerObject *objectp = LLViewerObject::createObject(fullid, pcode, regionp);
if (!objectp)
{
-// llwarns << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << " id:" << fullid << llendl;
+// LL_WARNS() << "Couldn't create object of type " << LLPrimitive::pCodeToString(pcode) << " id:" << fullid << LL_ENDL;
return NULL;
}
+ if(regionp)
+ {
+ regionp->addToCreatedList(local_id);
+ }
mUUIDObjectMap[fullid] = objectp;
setUUIDAndLocal(fullid,
@@ -1961,9 +2101,7 @@ S32 LLViewerObjectList::findReferences(LLDrawable *drawablep) const
void LLViewerObjectList::orphanize(LLViewerObject *childp, U32 parent_id, U32 ip, U32 port)
{
-#ifdef ORPHAN_SPAM
- llinfos << "Orphaning object " << childp->getID() << " with parent " << parent_id << llendl;
-#endif
+ LL_DEBUGS("ORPHANS") << "Orphaning object " << childp->getID() << " with parent " << parent_id << LL_ENDL;
// We're an orphan, flag things appropriately.
childp->mOrphaned = TRUE;
@@ -1979,7 +2117,7 @@ void LLViewerObjectList::orphanize(LLViewerObject *childp, U32 parent_id, U32 ip
// object probably ISN'T being reparented, but just got an object
// update out of order (child update before parent).
make_invisible = false;
- //llinfos << "Don't make object handoffs invisible!" << llendl;
+ //LL_INFOS() << "Don't make object handoffs invisible!" << LL_ENDL;
}
}
@@ -2011,11 +2149,17 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port)
{
if (objectp->isDead())
{
- llwarns << "Trying to find orphans for dead obj " << objectp->mID
- << ":" << objectp->getPCodeString() << llendl;
+ LL_WARNS() << "Trying to find orphans for dead obj " << objectp->mID
+ << ":" << objectp->getPCodeString() << LL_ENDL;
return;
}
+ //search object cache to get orphans
+ if(objectp->getRegion())
+ {
+ objectp->getRegion()->findOrphans(objectp->getLocalID());
+ }
+
// See if we are a parent of an orphan.
// Note: This code is fairly inefficient but it should happen very rarely.
// It can be sped up if this is somehow a performance issue...
@@ -2046,16 +2190,16 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port)
{
if (childp == objectp)
{
- llwarns << objectp->mID << " has self as parent, skipping!"
- << llendl;
+ LL_WARNS() << objectp->mID << " has self as parent, skipping!"
+ << LL_ENDL;
continue;
}
+ LL_DEBUGS("ORPHANS") << "Reunited parent " << objectp->mID
+ << " with child " << childp->mID << LL_ENDL;
+ LL_DEBUGS("ORPHANS") << "Glob: " << objectp->getPositionGlobal() << LL_ENDL;
+ LL_DEBUGS("ORPHANS") << "Agent: " << objectp->getPositionAgent() << LL_ENDL;
#ifdef ORPHAN_SPAM
- llinfos << "Reunited parent " << objectp->mID
- << " with child " << childp->mID << llendl;
- llinfos << "Glob: " << objectp->getPositionGlobal() << llendl;
- llinfos << "Agent: " << objectp->getPositionAgent() << llendl;
addDebugBeacon(objectp->getPositionAgent(),"");
#endif
gPipeline.markMoved(objectp->mDrawable);
@@ -2080,7 +2224,7 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port)
}
else
{
- llinfos << "Missing orphan child, removing from list" << llendl;
+ LL_INFOS() << "Missing orphan child, removing from list" << LL_ENDL;
iter = mOrphanChildren.erase(iter);
}
@@ -2143,3 +2287,10 @@ bool LLViewerObjectList::OrphanInfo::operator!=(const OrphanInfo &rhs) const
}
+LLDebugBeacon::~LLDebugBeacon()
+{
+ if (mHUDObject.notNull())
+ {
+ mHUDObject->markDead();
+ }
+}
diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h
index 98b50fa789..594317cd9f 100755
--- a/indra/newview/llviewerobjectlist.h
+++ b/indra/newview/llviewerobjectlist.h
@@ -31,8 +31,8 @@
#include <set>
// common includes
-#include "llstat.h"
#include "llstring.h"
+#include "lltrace.h"
// project includes
#include "llviewerobject.h"
@@ -40,6 +40,7 @@
class LLCamera;
class LLNetMap;
class LLDebugBeacon;
+class LLVOCacheEntry;
const U32 CLOSE_BIN_SIZE = 10;
const U32 NUM_BINS = 128;
@@ -65,6 +66,7 @@ public:
inline LLViewerObject *findObject(const LLUUID &id);
LLViewerObject *createObjectViewer(const LLPCode pcode, LLViewerRegion *regionp); // Create a viewer-side object
+ LLViewerObject *createObjectFromCache(const LLPCode pcode, LLViewerRegion *regionp, const LLUUID &uuid, const U32 local_id);
LLViewerObject *createObject(const LLPCode pcode, LLViewerRegion *regionp,
const LLUUID &uuid, const U32 local_id, const LLHost &sender);
@@ -78,8 +80,10 @@ public:
void cleanDeadObjects(const BOOL use_timer = TRUE); // Clean up the dead object list.
// Simulator and viewer side object updates...
- void processUpdateCore(LLViewerObject* objectp, void** data, U32 block, const EObjectUpdateType update_type, LLDataPacker* dpp, BOOL justCreated);
- void processObjectUpdate(LLMessageSystem *mesgsys, void **user_data, EObjectUpdateType update_type, bool cached=false, bool compressed=false);
+ void processUpdateCore(LLViewerObject* objectp, void** data, U32 block, const EObjectUpdateType update_type,
+ LLDataPacker* dpp, bool justCreated, bool from_cache = false);
+ LLViewerObject* processObjectUpdateFromCache(LLVOCacheEntry* entry, LLViewerRegion* regionp);
+ void processObjectUpdate(LLMessageSystem *mesgsys, void **user_data, EObjectUpdateType update_type, bool compressed=false);
void processCompressedObjectUpdate(LLMessageSystem *mesgsys, void **user_data, EObjectUpdateType update_type);
void processCachedObjectUpdate(LLMessageSystem *mesgsys, void **user_data, EObjectUpdateType update_type);
void updateApparentAngles(LLAgent &agent);
@@ -166,8 +170,6 @@ public:
// Statistics data (see also LLViewerStats)
S32 mNumNewObjects;
- S32 mNumSizeCulled;
- S32 mNumVisCulled;
// if we paused in the last frame
// used to discount stats from this frame
@@ -194,8 +196,6 @@ protected:
std::vector<OrphanInfo> mOrphanChildren; // UUID's of orphaned objects
S32 mNumOrphans;
- static LLStat sCacheHitRate;
-
typedef std::vector<LLPointer<LLViewerObject> > vobj_list_t;
vobj_list_t mObjects;
@@ -233,20 +233,14 @@ protected:
class LLDebugBeacon
{
public:
- ~LLDebugBeacon()
- {
- if (mHUDObject.notNull())
- {
- mHUDObject->markDead();
- }
- }
+ ~LLDebugBeacon();
LLVector3 mPositionAgent;
std::string mString;
LLColor4 mColor;
LLColor4 mTextColor;
S32 mLineWidth;
- LLPointer<LLHUDObject> mHUDObject;
+ LLPointer<class LLHUDObject> mHUDObject;
};
@@ -278,7 +272,7 @@ inline LLViewerObject *LLViewerObjectList::getObject(const S32 index)
objectp = mObjects[index];
if (objectp->isDead())
{
- //llwarns << "Dead object " << objectp->mID << " in getObject" << llendl;
+ //LL_WARNS() << "Dead object " << objectp->mID << " in getObject" << LL_ENDL;
return NULL;
}
return objectp;
diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp
new file mode 100644
index 0000000000..03c3f0fc08
--- /dev/null
+++ b/indra/newview/llvieweroctree.cpp
@@ -0,0 +1,1560 @@
+/**
+ * @file llvieweroctree.cpp
+ * @brief LLViewerOctreeGroup class implementation and supporting functions
+ *
+ * $LicenseInfo:firstyear=2003&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+#include "llvieweroctree.h"
+#include "llviewerregion.h"
+#include "pipeline.h"
+#include "llviewercontrol.h"
+#include "llappviewer.h"
+#include "llglslshader.h"
+#include "llviewershadermgr.h"
+
+//-----------------------------------------------------------------------------------
+//static variables definitions
+//-----------------------------------------------------------------------------------
+U32 LLViewerOctreeEntryData::sCurVisible = 10; //reserve the low numbers for special use.
+BOOL LLViewerOctreeDebug::sInDebug = FALSE;
+
+static LLTrace::CountStatHandle<S32> sOcclusionQueries("occlusion_queries", "Number of occlusion queries executed"),
+ sNumObjectsOccluded("occluded_objects", "Count of objects being occluded by a query"),
+ sNumObjectsUnoccluded("unoccluded_objects", "Count of objects being unoccluded by a query");
+
+//-----------------------------------------------------------------------------------
+//some global functions definitions
+//-----------------------------------------------------------------------------------
+typedef enum
+{
+ b000 = 0x00,
+ b001 = 0x01,
+ b010 = 0x02,
+ b011 = 0x03,
+ b100 = 0x04,
+ b101 = 0x05,
+ b110 = 0x06,
+ b111 = 0x07,
+} eLoveTheBits;
+
+//contact Runitai Linden for a copy of the SL object used to write this table
+//basically, you give the table a bitmask of the look-at vector to a node and it
+//gives you a triangle fan index array
+static U16 sOcclusionIndices[] =
+{
+ //000
+ b111, b110, b010, b011, b001, b101, b100, b110,
+ //001
+ b011, b010, b000, b001, b101, b111, b110, b010,
+ //010
+ b101, b100, b110, b111, b011, b001, b000, b100,
+ //011
+ b001, b000, b100, b101, b111, b011, b010, b000,
+ //100
+ b110, b000, b010, b011, b111, b101, b100, b000,
+ //101
+ b010, b100, b000, b001, b011, b111, b110, b100,
+ //110
+ b100, b010, b110, b111, b101, b001, b000, b010,
+ //111
+ b000, b110, b100, b101, b001, b011, b010, b110,
+};
+
+U32 get_box_fan_indices(LLCamera* camera, const LLVector4a& center)
+{
+ LLVector4a origin;
+ origin.load3(camera->getOrigin().mV);
+
+ S32 cypher = center.greaterThan(origin).getGatheredBits() & 0x7;
+
+ return cypher*8;
+}
+
+U8* get_box_fan_indices_ptr(LLCamera* camera, const LLVector4a& center)
+{
+ LLVector4a origin;
+ origin.load3(camera->getOrigin().mV);
+
+ S32 cypher = center.greaterThan(origin).getGatheredBits() & 0x7;
+
+ return (U8*) (sOcclusionIndices+cypher*8);
+}
+
+//create a vertex buffer for efficiently rendering cubes
+LLVertexBuffer* ll_create_cube_vb(U32 type_mask, U32 usage)
+{
+ LLVertexBuffer* ret = new LLVertexBuffer(type_mask, usage);
+
+ ret->allocateBuffer(8, 64, true);
+
+ LLStrider<LLVector3> pos;
+ LLStrider<U16> idx;
+
+ ret->getVertexStrider(pos);
+ ret->getIndexStrider(idx);
+
+ pos[0] = LLVector3(-1,-1,-1);
+ pos[1] = LLVector3(-1,-1, 1);
+ pos[2] = LLVector3(-1, 1,-1);
+ pos[3] = LLVector3(-1, 1, 1);
+ pos[4] = LLVector3( 1,-1,-1);
+ pos[5] = LLVector3( 1,-1, 1);
+ pos[6] = LLVector3( 1, 1,-1);
+ pos[7] = LLVector3( 1, 1, 1);
+
+ for (U32 i = 0; i < 64; i++)
+ {
+ idx[i] = sOcclusionIndices[i];
+ }
+
+ ret->flush();
+
+ return ret;
+}
+
+
+#define LL_TRACK_PENDING_OCCLUSION_QUERIES 0
+
+const F32 SG_OCCLUSION_FUDGE = 0.25f;
+#define SG_DISCARD_TOLERANCE 0.01f
+
+
+S32 AABBSphereIntersect(const LLVector3& min, const LLVector3& max, const LLVector3 &origin, const F32 &rad)
+{
+ return AABBSphereIntersectR2(min, max, origin, rad*rad);
+}
+
+S32 AABBSphereIntersectR2(const LLVector3& min, const LLVector3& max, const LLVector3 &origin, const F32 &r)
+{
+ F32 d = 0.f;
+ F32 t;
+
+ if ((min-origin).magVecSquared() < r &&
+ (max-origin).magVecSquared() < r)
+ {
+ return 2;
+ }
+
+ for (U32 i = 0; i < 3; i++)
+ {
+ if (origin.mV[i] < min.mV[i])
+ {
+ t = min.mV[i] - origin.mV[i];
+ d += t*t;
+ }
+ else if (origin.mV[i] > max.mV[i])
+ {
+ t = origin.mV[i] - max.mV[i];
+ d += t*t;
+ }
+
+ if (d > r)
+ {
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+
+S32 AABBSphereIntersect(const LLVector4a& min, const LLVector4a& max, const LLVector3 &origin, const F32 &rad)
+{
+ return AABBSphereIntersectR2(min, max, origin, rad*rad);
+}
+
+S32 AABBSphereIntersectR2(const LLVector4a& min, const LLVector4a& max, const LLVector3 &origin, const F32 &r)
+{
+ F32 d = 0.f;
+ F32 t;
+
+ LLVector4a origina;
+ origina.load3(origin.mV);
+
+ LLVector4a v;
+ v.setSub(min, origina);
+
+ if (v.dot3(v) < r)
+ {
+ v.setSub(max, origina);
+ if (v.dot3(v) < r)
+ {
+ return 2;
+ }
+ }
+
+
+ for (U32 i = 0; i < 3; i++)
+ {
+ if (origin.mV[i] < min[i])
+ {
+ t = min[i] - origin.mV[i];
+ d += t*t;
+ }
+ else if (origin.mV[i] > max[i])
+ {
+ t = origin.mV[i] - max[i];
+ d += t*t;
+ }
+
+ if (d > r)
+ {
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+//-----------------------------------------------------------------------------------
+//class LLViewerOctreeEntry definitions
+//-----------------------------------------------------------------------------------
+LLViewerOctreeEntry::LLViewerOctreeEntry()
+: LLTrace::MemTrackable<LLViewerOctreeEntry, 16>("LLViewerOctreeEntry"),
+ mGroup(NULL),
+ mBinRadius(0.f),
+ mBinIndex(-1),
+ mVisible(0)
+{
+ mPositionGroup.clear();
+ mExtents[0].clear();
+ mExtents[1].clear();
+
+ for(S32 i = 0; i < NUM_DATA_TYPE; i++)
+ {
+ mData[i] = NULL;
+ }
+}
+
+LLViewerOctreeEntry::~LLViewerOctreeEntry()
+{
+ llassert(!mGroup);
+}
+
+void LLViewerOctreeEntry::addData(LLViewerOctreeEntryData* data)
+{
+ //llassert(mData[data->getDataType()] == NULL);
+ llassert(data != NULL);
+
+ mData[data->getDataType()] = data;
+}
+
+void LLViewerOctreeEntry::removeData(LLViewerOctreeEntryData* data)
+{
+ //llassert(data->getDataType() != LLVOCACHEENTRY); //can not remove VOCache entry
+
+ if(!mData[data->getDataType()])
+ {
+ return;
+ }
+ if(mData[data->getDataType()] != data)
+ {
+ return;
+ }
+
+ mData[data->getDataType()] = NULL;
+
+ if(mGroup != NULL && !mData[LLDRAWABLE])
+ {
+ LLViewerOctreeGroup* group = mGroup;
+ mGroup = NULL;
+ group->removeFromGroup(data);
+
+ llassert(mBinIndex == -1);
+ }
+}
+
+//called by group handleDestruction() ONLY when group is destroyed by octree.
+void LLViewerOctreeEntry::nullGroup()
+{
+ mGroup = NULL;
+}
+
+void LLViewerOctreeEntry::setGroup(LLViewerOctreeGroup* group)
+{
+ if(mGroup == group)
+ {
+ return;
+ }
+
+ if(mGroup)
+ {
+ LLViewerOctreeGroup* old_group = mGroup;
+ mGroup = NULL;
+ old_group->removeFromGroup(this);
+
+ llassert(mBinIndex == -1);
+ }
+
+ mGroup = group;
+}
+
+//-----------------------------------------------------------------------------------
+//class LLViewerOctreeEntryData definitions
+//-----------------------------------------------------------------------------------
+LLViewerOctreeEntryData::~LLViewerOctreeEntryData()
+{
+ if(mEntry)
+ {
+ mEntry->removeData(this);
+ }
+}
+
+LLViewerOctreeEntryData::LLViewerOctreeEntryData(LLViewerOctreeEntry::eEntryDataType_t data_type)
+ : mDataType(data_type),
+ mEntry(NULL)
+{
+}
+
+//virtual
+void LLViewerOctreeEntryData::setOctreeEntry(LLViewerOctreeEntry* entry)
+{
+ llassert_always(mEntry.isNull());
+
+ if(mEntry.notNull())
+ {
+ return;
+ }
+
+ if(!entry)
+ {
+ mEntry = new LLViewerOctreeEntry();
+ }
+ else
+ {
+ mEntry = entry;
+ }
+ mEntry->addData(this);
+}
+
+void LLViewerOctreeEntryData::removeOctreeEntry()
+{
+ if(mEntry)
+ {
+ mEntry->removeData(this);
+ mEntry = NULL;
+ }
+}
+
+void LLViewerOctreeEntryData::setSpatialExtents(const LLVector3& min, const LLVector3& max)
+{
+ mEntry->mExtents[0].load3(min.mV);
+ mEntry->mExtents[1].load3(max.mV);
+}
+
+void LLViewerOctreeEntryData::setSpatialExtents(const LLVector4a& min, const LLVector4a& max)
+{
+ mEntry->mExtents[0] = min;
+ mEntry->mExtents[1] = max;
+}
+
+void LLViewerOctreeEntryData::setPositionGroup(const LLVector4a& pos)
+{
+ mEntry->mPositionGroup = pos;
+}
+
+const LLVector4a* LLViewerOctreeEntryData::getSpatialExtents() const
+{
+ return mEntry->getSpatialExtents();
+}
+
+//virtual
+void LLViewerOctreeEntryData::setGroup(LLViewerOctreeGroup* group)
+{
+ mEntry->setGroup(group);
+}
+
+void LLViewerOctreeEntryData::shift(const LLVector4a &shift_vector)
+{
+ mEntry->mExtents[0].add(shift_vector);
+ mEntry->mExtents[1].add(shift_vector);
+ mEntry->mPositionGroup.add(shift_vector);
+}
+
+LLViewerOctreeGroup* LLViewerOctreeEntryData::getGroup()const
+{
+ return mEntry.notNull() ? mEntry->mGroup : NULL;
+}
+
+const LLVector4a& LLViewerOctreeEntryData::getPositionGroup() const
+{
+ return mEntry->getPositionGroup();
+}
+
+//virtual
+bool LLViewerOctreeEntryData::isVisible() const
+{
+ if(mEntry)
+ {
+ return mEntry->mVisible == sCurVisible;
+ }
+ return false;
+}
+
+//virtual
+bool LLViewerOctreeEntryData::isRecentlyVisible() const
+{
+ if(!mEntry)
+ {
+ return false;
+ }
+
+ if(isVisible())
+ {
+ return true;
+ }
+ if(getGroup() && getGroup()->isRecentlyVisible())
+ {
+ setVisible();
+ return true;
+ }
+
+ return false;
+}
+
+void LLViewerOctreeEntryData::setVisible() const
+{
+ if(mEntry)
+ {
+ mEntry->mVisible = sCurVisible;
+ }
+}
+
+void LLViewerOctreeEntryData::resetVisible() const
+{
+ if(mEntry)
+ {
+ mEntry->mVisible = 0;
+ }
+}
+//-----------------------------------------------------------------------------------
+//class LLViewerOctreeGroup definitions
+//-----------------------------------------------------------------------------------
+
+LLViewerOctreeGroup::~LLViewerOctreeGroup()
+{
+ //empty here
+}
+
+LLViewerOctreeGroup::LLViewerOctreeGroup(OctreeNode* node)
+: LLTrace::MemTrackable<LLViewerOctreeGroup, 16>("LLViewerOctreeGroup"),
+ mOctreeNode(node),
+ mAnyVisible(0),
+ mState(CLEAN)
+{
+ LLVector4a tmp;
+ tmp.splat(0.f);
+ mExtents[0] = mExtents[1] = mObjectBounds[0] = mObjectBounds[0] = mObjectBounds[1] =
+ mObjectExtents[0] = mObjectExtents[1] = tmp;
+
+ mBounds[0] = node->getCenter();
+ mBounds[1] = node->getSize();
+
+ mOctreeNode->addListener(this);
+}
+
+bool LLViewerOctreeGroup::hasElement(LLViewerOctreeEntryData* data)
+{
+ if(!data->getEntry())
+ {
+ return false;
+ }
+ return std::find(getDataBegin(), getDataEnd(), data->getEntry()) != getDataEnd();
+}
+
+bool LLViewerOctreeGroup::removeFromGroup(LLViewerOctreeEntryData* data)
+{
+ return removeFromGroup(data->getEntry());
+}
+
+bool LLViewerOctreeGroup::removeFromGroup(LLViewerOctreeEntry* entry)
+{
+ llassert(entry != NULL);
+ llassert(!entry->getGroup());
+
+ if(isDead()) //group is about to be destroyed, not need to double delete the entry.
+ {
+ entry->setBinIndex(-1);
+ return true;
+ }
+
+ unbound();
+ setState(OBJECT_DIRTY);
+
+ if (mOctreeNode)
+ {
+ if (!mOctreeNode->remove(entry)) //this could cause *this* pointer to be destroyed, so no more function calls after this.
+ {
+ OCT_ERRS << "Could not remove LLVOCacheEntry from LLVOCacheOctreeGroup" << LL_ENDL;
+ return false;
+ }
+ }
+
+ return true;
+}
+
+//virtual
+void LLViewerOctreeGroup::unbound()
+{
+ if (isDirty())
+ {
+ return;
+ }
+
+ setState(DIRTY);
+
+ //all the parent nodes need to rebound this child
+ if (mOctreeNode)
+ {
+ OctreeNode* parent = (OctreeNode*) mOctreeNode->getParent();
+ while (parent != NULL)
+ {
+ LLViewerOctreeGroup* group = (LLViewerOctreeGroup*) parent->getListener(0);
+ if (!group || group->isDirty())
+ {
+ return;
+ }
+
+ group->setState(DIRTY);
+ parent = (OctreeNode*) parent->getParent();
+ }
+ }
+}
+
+//virtual
+void LLViewerOctreeGroup::rebound()
+{
+ if (!isDirty())
+ {
+ return;
+ }
+
+ if (mOctreeNode->getChildCount() == 1 && mOctreeNode->getElementCount() == 0)
+ {
+ LLViewerOctreeGroup* group = (LLViewerOctreeGroup*) mOctreeNode->getChild(0)->getListener(0);
+ group->rebound();
+
+ //copy single child's bounding box
+ mBounds[0] = group->mBounds[0];
+ mBounds[1] = group->mBounds[1];
+ mExtents[0] = group->mExtents[0];
+ mExtents[1] = group->mExtents[1];
+
+ group->setState(SKIP_FRUSTUM_CHECK);
+ }
+ else if (mOctreeNode->isLeaf())
+ { //copy object bounding box if this is a leaf
+ boundObjects(TRUE, mExtents[0], mExtents[1]);
+ mBounds[0] = mObjectBounds[0];
+ mBounds[1] = mObjectBounds[1];
+ }
+ else
+ {
+ LLVector4a& newMin = mExtents[0];
+ LLVector4a& newMax = mExtents[1];
+ LLViewerOctreeGroup* group = (LLViewerOctreeGroup*) mOctreeNode->getChild(0)->getListener(0);
+ group->clearState(SKIP_FRUSTUM_CHECK);
+ group->rebound();
+ //initialize to first child
+ newMin = group->mExtents[0];
+ newMax = group->mExtents[1];
+
+ //first, rebound children
+ for (U32 i = 1; i < mOctreeNode->getChildCount(); i++)
+ {
+ group = (LLViewerOctreeGroup*) mOctreeNode->getChild(i)->getListener(0);
+ group->clearState(SKIP_FRUSTUM_CHECK);
+ group->rebound();
+ const LLVector4a& max = group->mExtents[1];
+ const LLVector4a& min = group->mExtents[0];
+
+ newMax.setMax(newMax, max);
+ newMin.setMin(newMin, min);
+ }
+
+ boundObjects(FALSE, newMin, newMax);
+
+ mBounds[0].setAdd(newMin, newMax);
+ mBounds[0].mul(0.5f);
+ mBounds[1].setSub(newMax, newMin);
+ mBounds[1].mul(0.5f);
+ }
+
+ clearState(DIRTY);
+
+ return;
+}
+
+//virtual
+void LLViewerOctreeGroup::handleInsertion(const TreeNode* node, LLViewerOctreeEntry* obj)
+{
+ obj->setGroup(this);
+ unbound();
+ setState(OBJECT_DIRTY);
+}
+
+//virtual
+void LLViewerOctreeGroup::handleRemoval(const TreeNode* node, LLViewerOctreeEntry* obj)
+{
+ unbound();
+ setState(OBJECT_DIRTY);
+
+ obj->setGroup(NULL); //this could cause *this* pointer to be destroyed. So no more function calls after this.
+}
+
+//virtual
+void LLViewerOctreeGroup::handleDestruction(const TreeNode* node)
+{
+ for (OctreeNode::element_iter i = mOctreeNode->getDataBegin(); i != mOctreeNode->getDataEnd(); ++i)
+ {
+ LLViewerOctreeEntry* obj = *i;
+ if (obj && obj->getGroup() == this)
+ {
+ obj->nullGroup();
+ //obj->setGroup(NULL);
+ }
+ }
+ mOctreeNode = NULL;
+}
+
+//virtual
+void LLViewerOctreeGroup::handleStateChange(const TreeNode* node)
+{
+ //drop bounding box upon state change
+ if (mOctreeNode != node)
+ {
+ mOctreeNode = (OctreeNode*) node;
+ }
+ unbound();
+}
+
+//virtual
+void LLViewerOctreeGroup::handleChildAddition(const OctreeNode* parent, OctreeNode* child)
+{
+ if (child->getListenerCount() == 0)
+ {
+ new LLViewerOctreeGroup(child);
+ }
+ else
+ {
+ OCT_ERRS << "LLViewerOctreeGroup redundancy detected." << LL_ENDL;
+ }
+
+ unbound();
+
+ ((LLViewerOctreeGroup*)child->getListener(0))->unbound();
+}
+
+//virtual
+void LLViewerOctreeGroup::handleChildRemoval(const OctreeNode* parent, const OctreeNode* child)
+{
+ unbound();
+}
+
+LLViewerOctreeGroup* LLViewerOctreeGroup::getParent()
+{
+ if (isDead())
+ {
+ return NULL;
+ }
+
+ if(!mOctreeNode)
+ {
+ return NULL;
+ }
+
+ OctreeNode* parent = mOctreeNode->getOctParent();
+
+ if (parent)
+ {
+ return (LLViewerOctreeGroup*) parent->getListener(0);
+ }
+
+ return NULL;
+}
+
+//virtual
+bool LLViewerOctreeGroup::boundObjects(BOOL empty, LLVector4a& minOut, LLVector4a& maxOut)
+{
+ const OctreeNode* node = mOctreeNode;
+
+ if (node->isEmpty())
+ { //don't do anything if there are no objects
+ if (empty && mOctreeNode->getParent())
+ { //only root is allowed to be empty
+ OCT_ERRS << "Empty leaf found in octree." << LL_ENDL;
+ }
+ return false;
+ }
+
+ LLVector4a& newMin = mObjectExtents[0];
+ LLVector4a& newMax = mObjectExtents[1];
+
+ if (hasState(OBJECT_DIRTY))
+ { //calculate new bounding box
+ clearState(OBJECT_DIRTY);
+
+ //initialize bounding box to first element
+ OctreeNode::const_element_iter i = node->getDataBegin();
+ LLViewerOctreeEntry* entry = *i;
+ const LLVector4a* minMax = entry->getSpatialExtents();
+
+ newMin = minMax[0];
+ newMax = minMax[1];
+
+ for (++i; i != node->getDataEnd(); ++i)
+ {
+ entry = *i;
+ minMax = entry->getSpatialExtents();
+
+ update_min_max(newMin, newMax, minMax[0]);
+ update_min_max(newMin, newMax, minMax[1]);
+ }
+
+ mObjectBounds[0].setAdd(newMin, newMax);
+ mObjectBounds[0].mul(0.5f);
+ mObjectBounds[1].setSub(newMax, newMin);
+ mObjectBounds[1].mul(0.5f);
+ }
+
+ if (empty)
+ {
+ minOut = newMin;
+ maxOut = newMax;
+ }
+ else
+ {
+ minOut.setMin(minOut, newMin);
+ maxOut.setMax(maxOut, newMax);
+ }
+
+ return TRUE;
+}
+
+//virtual
+BOOL LLViewerOctreeGroup::isVisible() const
+{
+ return mVisible[LLViewerCamera::sCurCameraID] >= LLViewerOctreeEntryData::getCurrentFrame() ? TRUE : FALSE;
+}
+
+//virtual
+BOOL LLViewerOctreeGroup::isRecentlyVisible() const
+{
+ return FALSE;
+}
+
+void LLViewerOctreeGroup::setVisible()
+{
+ mVisible[LLViewerCamera::sCurCameraID] = LLViewerOctreeEntryData::getCurrentFrame();
+
+ if(LLViewerCamera::sCurCameraID < LLViewerCamera::CAMERA_WATER0)
+ {
+ mAnyVisible = LLViewerOctreeEntryData::getCurrentFrame();
+ }
+}
+
+void LLViewerOctreeGroup::checkStates()
+{
+#if LL_OCTREE_PARANOIA_CHECK
+ //LLOctreeStateCheck checker;
+ //checker.traverse(mOctreeNode);
+#endif
+}
+
+//-------------------------------------------------------------------------------------------
+//occulsion culling functions and classes
+//-------------------------------------------------------------------------------------------
+std::set<U32> LLOcclusionCullingGroup::sPendingQueries;
+class LLOcclusionQueryPool : public LLGLNamePool
+{
+public:
+ LLOcclusionQueryPool()
+ {
+ }
+
+protected:
+
+ virtual GLuint allocateName()
+ {
+ GLuint ret = 0;
+
+ glGenQueriesARB(1, &ret);
+
+ return ret;
+ }
+
+ virtual void releaseName(GLuint name)
+ {
+#if LL_TRACK_PENDING_OCCLUSION_QUERIES
+ LLOcclusionCullingGroup::sPendingQueries.erase(name);
+#endif
+ glDeleteQueriesARB(1, &name);
+ }
+};
+
+static LLOcclusionQueryPool sQueryPool;
+U32 LLOcclusionCullingGroup::getNewOcclusionQueryObjectName()
+{
+ return sQueryPool.allocate();
+}
+
+void LLOcclusionCullingGroup::releaseOcclusionQueryObjectName(GLuint name)
+{
+ sQueryPool.release(name);
+}
+
+//=====================================
+// Occlusion State Set/Clear
+//=====================================
+class LLSpatialSetOcclusionState : public OctreeTraveler
+{
+public:
+ U32 mState;
+ LLSpatialSetOcclusionState(U32 state) : mState(state) { }
+ virtual void visit(const OctreeNode* branch)
+ {
+ LLOcclusionCullingGroup* group = (LLOcclusionCullingGroup*)branch->getListener(0);
+ if(group)
+ {
+ group->setOcclusionState(mState);
+ }
+ }
+};
+
+class LLSpatialSetOcclusionStateDiff : public LLSpatialSetOcclusionState
+{
+public:
+ LLSpatialSetOcclusionStateDiff(U32 state) : LLSpatialSetOcclusionState(state) { }
+
+ virtual void traverse(const OctreeNode* n)
+ {
+ LLOcclusionCullingGroup* group = (LLOcclusionCullingGroup*) n->getListener(0);
+
+ if (group && !group->isOcclusionState(mState))
+ {
+ OctreeTraveler::traverse(n);
+ }
+ }
+};
+
+
+LLOcclusionCullingGroup::LLOcclusionCullingGroup(OctreeNode* node, LLViewerOctreePartition* part) :
+ LLViewerOctreeGroup(node),
+ mSpatialPartition(part)
+{
+ part->mLODSeed = (part->mLODSeed+1)%part->mLODPeriod;
+ mLODHash = part->mLODSeed;
+
+ OctreeNode* oct_parent = node->getOctParent();
+ LLOcclusionCullingGroup* parent = oct_parent ? (LLOcclusionCullingGroup*) oct_parent->getListener(0) : NULL;
+
+ for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++)
+ {
+ mOcclusionQuery[i] = 0;
+ mOcclusionIssued[i] = 0;
+ mOcclusionState[i] = parent ? SG_STATE_INHERIT_MASK & parent->mOcclusionState[i] : 0;
+ mVisible[i] = 0;
+ }
+}
+
+LLOcclusionCullingGroup::~LLOcclusionCullingGroup()
+{
+ releaseOcclusionQueryObjectNames();
+}
+
+BOOL LLOcclusionCullingGroup::needsUpdate()
+{
+ return (LLDrawable::getCurrentFrame() % mSpatialPartition->mLODPeriod == mLODHash) ? TRUE : FALSE;
+}
+
+BOOL LLOcclusionCullingGroup::isRecentlyVisible() const
+{
+ const S32 MIN_VIS_FRAME_RANGE = 2;
+ return (LLDrawable::getCurrentFrame() - mVisible[LLViewerCamera::sCurCameraID]) < MIN_VIS_FRAME_RANGE ;
+}
+
+BOOL LLOcclusionCullingGroup::isAnyRecentlyVisible() const
+{
+ const S32 MIN_VIS_FRAME_RANGE = 2;
+ return (LLDrawable::getCurrentFrame() - mAnyVisible) < MIN_VIS_FRAME_RANGE ;
+}
+
+//virtual
+void LLOcclusionCullingGroup::handleChildAddition(const OctreeNode* parent, OctreeNode* child)
+{
+ if (child->getListenerCount() == 0)
+ {
+ new LLOcclusionCullingGroup(child, mSpatialPartition);
+ }
+ else
+ {
+ OCT_ERRS << "LLOcclusionCullingGroup redundancy detected." << LL_ENDL;
+ }
+
+ unbound();
+
+ ((LLViewerOctreeGroup*)child->getListener(0))->unbound();
+}
+
+void LLOcclusionCullingGroup::releaseOcclusionQueryObjectNames()
+{
+ if (gGLManager.mHasOcclusionQuery)
+ {
+ for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; ++i)
+ {
+ if (mOcclusionQuery[i])
+ {
+ releaseOcclusionQueryObjectName(mOcclusionQuery[i]);
+ mOcclusionQuery[i] = 0;
+ }
+ }
+ }
+}
+
+void LLOcclusionCullingGroup::setOcclusionState(U32 state, S32 mode)
+{
+ if (mode > STATE_MODE_SINGLE)
+ {
+ if (mode == STATE_MODE_DIFF)
+ {
+ LLSpatialSetOcclusionStateDiff setter(state);
+ setter.traverse(mOctreeNode);
+ }
+ else if (mode == STATE_MODE_BRANCH)
+ {
+ LLSpatialSetOcclusionState setter(state);
+ setter.traverse(mOctreeNode);
+ }
+ else
+ {
+ for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++)
+ {
+ mOcclusionState[i] |= state;
+
+ if ((state & DISCARD_QUERY) && mOcclusionQuery[i])
+ {
+ releaseOcclusionQueryObjectName(mOcclusionQuery[i]);
+ mOcclusionQuery[i] = 0;
+ }
+ }
+ }
+ }
+ else
+ {
+ if (state & OCCLUDED)
+ {
+ add(sNumObjectsOccluded, 1);
+ }
+ mOcclusionState[LLViewerCamera::sCurCameraID] |= state;
+ if ((state & DISCARD_QUERY) && mOcclusionQuery[LLViewerCamera::sCurCameraID])
+ {
+ releaseOcclusionQueryObjectName(mOcclusionQuery[LLViewerCamera::sCurCameraID]);
+ mOcclusionQuery[LLViewerCamera::sCurCameraID] = 0;
+ }
+ }
+}
+
+class LLSpatialClearOcclusionState : public OctreeTraveler
+{
+public:
+ U32 mState;
+
+ LLSpatialClearOcclusionState(U32 state) : mState(state) { }
+ virtual void visit(const OctreeNode* branch)
+ {
+ LLOcclusionCullingGroup* group = (LLOcclusionCullingGroup*)branch->getListener(0);
+ if(group)
+ {
+ group->clearOcclusionState(mState);
+ }
+ }
+};
+
+class LLSpatialClearOcclusionStateDiff : public LLSpatialClearOcclusionState
+{
+public:
+ LLSpatialClearOcclusionStateDiff(U32 state) : LLSpatialClearOcclusionState(state) { }
+
+ virtual void traverse(const OctreeNode* n)
+ {
+ LLOcclusionCullingGroup* group = (LLOcclusionCullingGroup*) n->getListener(0);
+
+ if (group && group->isOcclusionState(mState))
+ {
+ OctreeTraveler::traverse(n);
+ }
+ }
+};
+
+void LLOcclusionCullingGroup::clearOcclusionState(U32 state, S32 mode)
+{
+ if (mode > STATE_MODE_SINGLE)
+ {
+ if (mode == STATE_MODE_DIFF)
+ {
+ LLSpatialClearOcclusionStateDiff clearer(state);
+ clearer.traverse(mOctreeNode);
+ }
+ else if (mode == STATE_MODE_BRANCH)
+ {
+ LLSpatialClearOcclusionState clearer(state);
+ clearer.traverse(mOctreeNode);
+ }
+ else
+ {
+ for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++)
+ {
+ mOcclusionState[i] &= ~state;
+ }
+ }
+ }
+ else
+ {
+ if (state & OCCLUDED)
+ {
+ add(sNumObjectsUnoccluded, 1);
+ }
+ mOcclusionState[LLViewerCamera::sCurCameraID] &= ~state;
+ }
+}
+
+static LLTrace::BlockTimerStatHandle FTM_OCCLUSION_READBACK("Readback Occlusion");
+static LLTrace::BlockTimerStatHandle FTM_OCCLUSION_WAIT("Occlusion Wait");
+
+BOOL LLOcclusionCullingGroup::earlyFail(LLCamera* camera, const LLVector4a* bounds)
+{
+ if (camera->getOrigin().isExactlyZero())
+ {
+ return FALSE;
+ }
+
+ const F32 vel = SG_OCCLUSION_FUDGE*2.f;
+ LLVector4a fudge;
+ fudge.splat(vel);
+
+ const LLVector4a& c = bounds[0];
+ LLVector4a r;
+ r.setAdd(bounds[1], fudge);
+
+ /*if (r.magVecSquared() > 1024.0*1024.0)
+ {
+ return TRUE;
+ }*/
+
+ LLVector4a e;
+ e.load3(camera->getOrigin().mV);
+
+ LLVector4a min;
+ min.setSub(c,r);
+ LLVector4a max;
+ max.setAdd(c,r);
+
+ S32 lt = e.lessThan(min).getGatheredBits() & 0x7;
+ if (lt)
+ {
+ return FALSE;
+ }
+
+ S32 gt = e.greaterThan(max).getGatheredBits() & 0x7;
+ if (gt)
+ {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+U32 LLOcclusionCullingGroup::getLastOcclusionIssuedTime()
+{
+ return mOcclusionIssued[LLViewerCamera::sCurCameraID];
+}
+
+void LLOcclusionCullingGroup::checkOcclusion()
+{
+ if (LLPipeline::sUseOcclusion > 1)
+ {
+ LL_RECORD_BLOCK_TIME(FTM_OCCLUSION_READBACK);
+ LLOcclusionCullingGroup* parent = (LLOcclusionCullingGroup*)getParent();
+ if (parent && parent->isOcclusionState(LLOcclusionCullingGroup::OCCLUDED))
+ { //if the parent has been marked as occluded, the child is implicitly occluded
+ clearOcclusionState(QUERY_PENDING | DISCARD_QUERY);
+ }
+ else if (isOcclusionState(QUERY_PENDING))
+ { //otherwise, if a query is pending, read it back
+
+ GLuint available = 0;
+ if (mOcclusionQuery[LLViewerCamera::sCurCameraID])
+ {
+ glGetQueryObjectuivARB(mOcclusionQuery[LLViewerCamera::sCurCameraID], GL_QUERY_RESULT_AVAILABLE_ARB, &available);
+
+ static LLCachedControl<bool> wait_for_query(gSavedSettings, "RenderSynchronousOcclusion", true);
+
+ if (wait_for_query && mOcclusionIssued[LLViewerCamera::sCurCameraID] < gFrameCount)
+ { //query was issued last frame, wait until it's available
+ S32 max_loop = 1024;
+ LL_RECORD_BLOCK_TIME(FTM_OCCLUSION_WAIT);
+ while (!available && max_loop-- > 0)
+ {
+ //do some usefu work while we wait
+ F32 max_time = llmin(gFrameIntervalSeconds.value()*10.f, 1.f);
+ LLAppViewer::instance()->updateTextureThreads(max_time);
+
+ glGetQueryObjectuivARB(mOcclusionQuery[LLViewerCamera::sCurCameraID], GL_QUERY_RESULT_AVAILABLE_ARB, &available);
+ }
+ }
+ }
+ else
+ {
+ available = 1;
+ }
+
+ if (available)
+ { //result is available, read it back, otherwise wait until next frame
+ GLuint res = 1;
+ if (!isOcclusionState(DISCARD_QUERY) && mOcclusionQuery[LLViewerCamera::sCurCameraID])
+ {
+ glGetQueryObjectuivARB(mOcclusionQuery[LLViewerCamera::sCurCameraID], GL_QUERY_RESULT_ARB, &res);
+#if LL_TRACK_PENDING_OCCLUSION_QUERIES
+ sPendingQueries.erase(mOcclusionQuery[LLViewerCamera::sCurCameraID]);
+#endif
+ }
+ else if (mOcclusionQuery[LLViewerCamera::sCurCameraID])
+ { //delete the query to avoid holding onto hundreds of pending queries
+ releaseOcclusionQueryObjectName(mOcclusionQuery[LLViewerCamera::sCurCameraID]);
+ mOcclusionQuery[LLViewerCamera::sCurCameraID] = 0;
+ }
+
+ if (isOcclusionState(DISCARD_QUERY))
+ {
+ res = 2;
+ }
+
+ if (res > 0)
+ {
+ assert_states_valid(this);
+ clearOcclusionState(LLOcclusionCullingGroup::OCCLUDED, LLOcclusionCullingGroup::STATE_MODE_DIFF);
+ assert_states_valid(this);
+ }
+ else
+ {
+ assert_states_valid(this);
+
+ setOcclusionState(LLOcclusionCullingGroup::OCCLUDED, LLOcclusionCullingGroup::STATE_MODE_DIFF);
+
+ assert_states_valid(this);
+ }
+
+ clearOcclusionState(QUERY_PENDING | DISCARD_QUERY);
+ }
+ }
+ else if (mSpatialPartition->isOcclusionEnabled() && isOcclusionState(LLOcclusionCullingGroup::OCCLUDED))
+ { //check occlusion has been issued for occluded node that has not had a query issued
+ assert_states_valid(this);
+ clearOcclusionState(LLOcclusionCullingGroup::OCCLUDED, LLOcclusionCullingGroup::STATE_MODE_DIFF);
+ assert_states_valid(this);
+ }
+ }
+}
+
+static LLTrace::BlockTimerStatHandle FTM_PUSH_OCCLUSION_VERTS("Push Occlusion");
+static LLTrace::BlockTimerStatHandle FTM_SET_OCCLUSION_STATE("Occlusion State");
+static LLTrace::BlockTimerStatHandle FTM_OCCLUSION_EARLY_FAIL("Occlusion Early Fail");
+static LLTrace::BlockTimerStatHandle FTM_OCCLUSION_ALLOCATE("Allocate");
+static LLTrace::BlockTimerStatHandle FTM_OCCLUSION_BUILD("Build");
+static LLTrace::BlockTimerStatHandle FTM_OCCLUSION_BEGIN_QUERY("Begin Query");
+static LLTrace::BlockTimerStatHandle FTM_OCCLUSION_END_QUERY("End Query");
+static LLTrace::BlockTimerStatHandle FTM_OCCLUSION_SET_BUFFER("Set Buffer");
+static LLTrace::BlockTimerStatHandle FTM_OCCLUSION_DRAW_WATER("Draw Water");
+static LLTrace::BlockTimerStatHandle FTM_OCCLUSION_DRAW("Draw");
+
+void LLOcclusionCullingGroup::doOcclusion(LLCamera* camera, const LLVector4a* shift)
+{
+ if (mSpatialPartition->isOcclusionEnabled() && LLPipeline::sUseOcclusion > 1)
+ {
+ //move mBounds to the agent space if necessary
+ LLVector4a bounds[2];
+ bounds[0] = mBounds[0];
+ bounds[1] = mBounds[1];
+ if(shift != NULL)
+ {
+ bounds[0].add(*shift);
+ }
+
+ // Don't cull hole/edge water, unless we have the GL_ARB_depth_clamp extension
+ if (earlyFail(camera, bounds))
+ {
+ LL_RECORD_BLOCK_TIME(FTM_OCCLUSION_EARLY_FAIL);
+ setOcclusionState(LLOcclusionCullingGroup::DISCARD_QUERY);
+ assert_states_valid(this);
+ clearOcclusionState(LLOcclusionCullingGroup::OCCLUDED, LLOcclusionCullingGroup::STATE_MODE_DIFF);
+ assert_states_valid(this);
+ }
+ else
+ {
+ if (!isOcclusionState(QUERY_PENDING) || isOcclusionState(DISCARD_QUERY))
+ {
+ { //no query pending, or previous query to be discarded
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_OCCLUSION);
+
+ if (!mOcclusionQuery[LLViewerCamera::sCurCameraID])
+ {
+ LL_RECORD_BLOCK_TIME(FTM_OCCLUSION_ALLOCATE);
+ mOcclusionQuery[LLViewerCamera::sCurCameraID] = getNewOcclusionQueryObjectName();
+ }
+
+ // Depth clamp all water to avoid it being culled as a result of being
+ // behind the far clip plane, and in the case of edge water to avoid
+ // it being culled while still visible.
+ bool const use_depth_clamp = gGLManager.mHasDepthClamp &&
+ (mSpatialPartition->mDrawableType == LLDrawPool::POOL_WATER ||
+ mSpatialPartition->mDrawableType == LLDrawPool::POOL_VOIDWATER);
+
+ LLGLEnable clamp(use_depth_clamp ? GL_DEPTH_CLAMP : 0);
+
+#if !LL_DARWIN
+ U32 mode = gGLManager.mHasOcclusionQuery2 ? GL_ANY_SAMPLES_PASSED : GL_SAMPLES_PASSED_ARB;
+#else
+ U32 mode = GL_SAMPLES_PASSED_ARB;
+#endif
+
+#if LL_TRACK_PENDING_OCCLUSION_QUERIES
+ sPendingQueries.insert(mOcclusionQuery[LLViewerCamera::sCurCameraID]);
+#endif
+ add(sOcclusionQueries, 1);
+
+ {
+ LL_RECORD_BLOCK_TIME(FTM_PUSH_OCCLUSION_VERTS);
+
+ //store which frame this query was issued on
+ mOcclusionIssued[LLViewerCamera::sCurCameraID] = gFrameCount;
+
+ {
+ LL_RECORD_BLOCK_TIME(FTM_OCCLUSION_BEGIN_QUERY);
+ glBeginQueryARB(mode, mOcclusionQuery[LLViewerCamera::sCurCameraID]);
+ }
+
+ LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+ llassert(shader);
+
+ shader->uniform3fv(LLShaderMgr::BOX_CENTER, 1, bounds[0].getF32ptr());
+ shader->uniform3f(LLShaderMgr::BOX_SIZE, bounds[1][0]+SG_OCCLUSION_FUDGE,
+ bounds[1][1]+SG_OCCLUSION_FUDGE,
+ bounds[1][2]+SG_OCCLUSION_FUDGE);
+
+ if (!use_depth_clamp && mSpatialPartition->mDrawableType == LLDrawPool::POOL_VOIDWATER)
+ {
+ LL_RECORD_BLOCK_TIME(FTM_OCCLUSION_DRAW_WATER);
+
+ LLGLSquashToFarClip squash(glh_get_current_projection(), 1);
+ if (camera->getOrigin().isExactlyZero())
+ { //origin is invalid, draw entire box
+ gPipeline.mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, 0);
+ gPipeline.mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, b111*8);
+ }
+ else
+ {
+ gPipeline.mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, bounds[0]));
+ }
+ }
+ else
+ {
+ LL_RECORD_BLOCK_TIME(FTM_OCCLUSION_DRAW);
+ if (camera->getOrigin().isExactlyZero())
+ { //origin is invalid, draw entire box
+ gPipeline.mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, 0);
+ gPipeline.mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, b111*8);
+ }
+ else
+ {
+ gPipeline.mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, bounds[0]));
+ }
+ }
+
+
+ {
+ LL_RECORD_BLOCK_TIME(FTM_OCCLUSION_END_QUERY);
+ glEndQueryARB(mode);
+ }
+ }
+ }
+
+ {
+ LL_RECORD_BLOCK_TIME(FTM_SET_OCCLUSION_STATE);
+ setOcclusionState(LLOcclusionCullingGroup::QUERY_PENDING);
+ clearOcclusionState(LLOcclusionCullingGroup::DISCARD_QUERY);
+ }
+ }
+ }
+ }
+}
+//-------------------------------------------------------------------------------------------
+//end of occulsion culling functions and classes
+//-------------------------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------------
+//class LLViewerOctreePartition definitions
+//-----------------------------------------------------------------------------------
+LLViewerOctreePartition::LLViewerOctreePartition() :
+ mRegionp(NULL),
+ mOcclusionEnabled(TRUE),
+ mDrawableType(0),
+ mLODSeed(0),
+ mLODPeriod(1)
+{
+ LLVector4a center, size;
+ center.splat(0.f);
+ size.splat(1.f);
+
+ mOctree = new OctreeRoot(center,size, NULL);
+}
+
+LLViewerOctreePartition::~LLViewerOctreePartition()
+{
+ delete mOctree;
+ mOctree = NULL;
+}
+
+BOOL LLViewerOctreePartition::isOcclusionEnabled()
+{
+ return mOcclusionEnabled || LLPipeline::sUseOcclusion > 2;
+}
+
+//-----------------------------------------------------------------------------------
+//class LLViewerOctreeCull definitions
+//-----------------------------------------------------------------------------------
+
+//virtual
+bool LLViewerOctreeCull::earlyFail(LLViewerOctreeGroup* group)
+{
+ return false;
+}
+
+//virtual
+void LLViewerOctreeCull::traverse(const OctreeNode* n)
+{
+ LLViewerOctreeGroup* group = (LLViewerOctreeGroup*) n->getListener(0);
+
+ if (earlyFail(group))
+ {
+ return;
+ }
+
+ if (mRes == 2 ||
+ (mRes && group->hasState(LLViewerOctreeGroup::SKIP_FRUSTUM_CHECK)))
+ { //fully in, just add everything
+ OctreeTraveler::traverse(n);
+ }
+ else
+ {
+ mRes = frustumCheck(group);
+
+ if (mRes)
+ { //at least partially in, run on down
+ OctreeTraveler::traverse(n);
+ }
+
+ mRes = 0;
+ }
+}
+
+//------------------------------------------
+//agent space group culling
+S32 LLViewerOctreeCull::AABBInFrustumNoFarClipGroupBounds(const LLViewerOctreeGroup* group)
+{
+ return mCamera->AABBInFrustumNoFarClip(group->mBounds[0], group->mBounds[1]);
+}
+
+S32 LLViewerOctreeCull::AABBSphereIntersectGroupExtents(const LLViewerOctreeGroup* group)
+{
+ return AABBSphereIntersect(group->mExtents[0], group->mExtents[1], mCamera->getOrigin(), mCamera->mFrustumCornerDist);
+}
+
+S32 LLViewerOctreeCull::AABBInFrustumGroupBounds(const LLViewerOctreeGroup* group)
+{
+ return mCamera->AABBInFrustum(group->mBounds[0], group->mBounds[1]);
+}
+//------------------------------------------
+
+//------------------------------------------
+//agent space object set culling
+S32 LLViewerOctreeCull::AABBInFrustumNoFarClipObjectBounds(const LLViewerOctreeGroup* group)
+{
+ return mCamera->AABBInFrustumNoFarClip(group->mObjectBounds[0], group->mObjectBounds[1]);
+}
+
+S32 LLViewerOctreeCull::AABBSphereIntersectObjectExtents(const LLViewerOctreeGroup* group)
+{
+ return AABBSphereIntersect(group->mObjectExtents[0], group->mObjectExtents[1], mCamera->getOrigin(), mCamera->mFrustumCornerDist);
+}
+
+S32 LLViewerOctreeCull::AABBInFrustumObjectBounds(const LLViewerOctreeGroup* group)
+{
+ return mCamera->AABBInFrustum(group->mObjectBounds[0], group->mObjectBounds[1]);
+}
+//------------------------------------------
+
+//------------------------------------------
+//local regional space group culling
+S32 LLViewerOctreeCull::AABBInRegionFrustumNoFarClipGroupBounds(const LLViewerOctreeGroup* group)
+{
+ return mCamera->AABBInRegionFrustumNoFarClip(group->mBounds[0], group->mBounds[1]);
+}
+
+S32 LLViewerOctreeCull::AABBInRegionFrustumGroupBounds(const LLViewerOctreeGroup* group)
+{
+ return mCamera->AABBInRegionFrustum(group->mBounds[0], group->mBounds[1]);
+}
+
+S32 LLViewerOctreeCull::AABBRegionSphereIntersectGroupExtents(const LLViewerOctreeGroup* group, const LLVector3& shift)
+{
+ return AABBSphereIntersect(group->mExtents[0], group->mExtents[1], mCamera->getOrigin() - shift, mCamera->mFrustumCornerDist);
+}
+//------------------------------------------
+
+//------------------------------------------
+//local regional space object culling
+S32 LLViewerOctreeCull::AABBInRegionFrustumObjectBounds(const LLViewerOctreeGroup* group)
+{
+ return mCamera->AABBInRegionFrustum(group->mObjectBounds[0], group->mObjectBounds[1]);
+}
+
+S32 LLViewerOctreeCull::AABBInRegionFrustumNoFarClipObjectBounds(const LLViewerOctreeGroup* group)
+{
+ return mCamera->AABBInRegionFrustumNoFarClip(group->mObjectBounds[0], group->mObjectBounds[1]);
+}
+
+S32 LLViewerOctreeCull::AABBRegionSphereIntersectObjectExtents(const LLViewerOctreeGroup* group, const LLVector3& shift)
+{
+ return AABBSphereIntersect(group->mObjectExtents[0], group->mObjectExtents[1], mCamera->getOrigin() - shift, mCamera->mFrustumCornerDist);
+}
+//------------------------------------------
+//check if the objects projection large enough
+
+bool LLViewerOctreeCull::checkProjectionArea(const LLVector4a& center, const LLVector4a& size, const LLVector3& shift, F32 pixel_threshold, F32 near_radius)
+{
+ LLVector3 local_orig = mCamera->getOrigin() - shift;
+ LLVector4a origin;
+ origin.load3(local_orig.mV);
+
+ LLVector4a lookAt;
+ lookAt.setSub(center, origin);
+ F32 distance = lookAt.getLength3().getF32();
+ if(distance <= near_radius)
+ {
+ return true; //always load close-by objects
+ }
+
+ // treat object as if it were near_radius meters closer than it actually was.
+ // this allows us to get some temporal coherence on visibility...objects that can be reached quickly will tend to be visible
+ distance -= near_radius;
+
+ F32 squared_rad = size.dot3(size).getF32();
+ return squared_rad / distance > pixel_threshold;
+}
+
+//virtual
+bool LLViewerOctreeCull::checkObjects(const OctreeNode* branch, const LLViewerOctreeGroup* group)
+{
+ if (branch->getElementCount() == 0) //no elements
+ {
+ return false;
+ }
+ else if (branch->getChildCount() == 0) //leaf state, already checked tightest bounding box
+ {
+ return true;
+ }
+ else if (mRes == 1 && !frustumCheckObjects(group)) //no objects in frustum
+ {
+ return false;
+ }
+
+ return true;
+}
+
+//virtual
+void LLViewerOctreeCull::preprocess(LLViewerOctreeGroup* group)
+{
+}
+
+//virtual
+void LLViewerOctreeCull::processGroup(LLViewerOctreeGroup* group)
+{
+}
+
+//virtual
+void LLViewerOctreeCull::visit(const OctreeNode* branch)
+{
+ LLViewerOctreeGroup* group = (LLViewerOctreeGroup*) branch->getListener(0);
+
+ preprocess(group);
+
+ if (checkObjects(branch, group))
+ {
+ processGroup(group);
+ }
+}
+
+//--------------------------------------------------------------
+//class LLViewerOctreeDebug
+//virtual
+void LLViewerOctreeDebug::visit(const OctreeNode* branch)
+{
+#if 0
+ LL_INFOS() << "Node: " << (U32)branch << " # Elements: " << branch->getElementCount() << " # Children: " << branch->getChildCount() << LL_ENDL;
+ for (U32 i = 0; i < branch->getChildCount(); i++)
+ {
+ LL_INFOS() << "Child " << i << " : " << (U32)branch->getChild(i) << LL_ENDL;
+ }
+#endif
+ LLViewerOctreeGroup* group = (LLViewerOctreeGroup*) branch->getListener(0);
+ processGroup(group);
+}
+
+//virtual
+void LLViewerOctreeDebug::processGroup(LLViewerOctreeGroup* group)
+{
+#if 0
+ const LLVector4a* vec4 = group->getBounds();
+ LLVector3 vec[2];
+ vec[0].set(vec4[0].getF32ptr());
+ vec[1].set(vec4[1].getF32ptr());
+ LL_INFOS() << "Bounds: " << vec[0] << " : " << vec[1] << LL_ENDL;
+
+ vec4 = group->getExtents();
+ vec[0].set(vec4[0].getF32ptr());
+ vec[1].set(vec4[1].getF32ptr());
+ LL_INFOS() << "Extents: " << vec[0] << " : " << vec[1] << LL_ENDL;
+
+ vec4 = group->getObjectBounds();
+ vec[0].set(vec4[0].getF32ptr());
+ vec[1].set(vec4[1].getF32ptr());
+ LL_INFOS() << "ObjectBounds: " << vec[0] << " : " << vec[1] << LL_ENDL;
+
+ vec4 = group->getObjectExtents();
+ vec[0].set(vec4[0].getF32ptr());
+ vec[1].set(vec4[1].getF32ptr());
+ LL_INFOS() << "ObjectExtents: " << vec[0] << " : " << vec[1] << LL_ENDL;
+#endif
+}
+//--------------------------------------------------------------
diff --git a/indra/newview/llvieweroctree.h b/indra/newview/llvieweroctree.h
new file mode 100644
index 0000000000..219ec7e8da
--- /dev/null
+++ b/indra/newview/llvieweroctree.h
@@ -0,0 +1,420 @@
+/**
+ * @file llvieweroctree.h
+ * @brief LLViewerObjectOctree.cpp header file, defining all supporting classes.
+ *
+ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_VIEWEROCTREE_H
+#define LL_VIEWEROCTREE_H
+
+#include <vector>
+#include <map>
+
+#include "v2math.h"
+#include "v3math.h"
+#include "v4math.h"
+#include "m4math.h"
+#include "llvector4a.h"
+#include "llquaternion.h"
+#include "lloctree.h"
+#include "llviewercamera.h"
+
+class LLViewerRegion;
+class LLViewerOctreeEntryData;
+class LLViewerOctreeGroup;
+class LLViewerOctreeEntry;
+class LLViewerOctreePartition;
+
+typedef LLOctreeListener<LLViewerOctreeEntry> OctreeListener;
+typedef LLTreeNode<LLViewerOctreeEntry> TreeNode;
+typedef LLOctreeNode<LLViewerOctreeEntry> OctreeNode;
+typedef LLOctreeRoot<LLViewerOctreeEntry> OctreeRoot;
+typedef LLOctreeTraveler<LLViewerOctreeEntry> OctreeTraveler;
+
+#if LL_OCTREE_PARANOIA_CHECK
+#define assert_octree_valid(x) x->validate()
+#define assert_states_valid(x) ((LLViewerOctreeGroup*) x->mSpatialPartition->mOctree->getListener(0))->checkStates()
+#else
+#define assert_octree_valid(x)
+#define assert_states_valid(x)
+#endif
+
+// get index buffer for binary encoded axis vertex buffer given a box at center being viewed by given camera
+U32 get_box_fan_indices(LLCamera* camera, const LLVector4a& center);
+U8* get_box_fan_indices_ptr(LLCamera* camera, const LLVector4a& center);
+
+S32 AABBSphereIntersect(const LLVector4a& min, const LLVector4a& max, const LLVector3 &origin, const F32 &rad);
+S32 AABBSphereIntersectR2(const LLVector4a& min, const LLVector4a& max, const LLVector3 &origin, const F32 &radius_squared);
+
+S32 AABBSphereIntersect(const LLVector3& min, const LLVector3& max, const LLVector3 &origin, const F32 &rad);
+S32 AABBSphereIntersectR2(const LLVector3& min, const LLVector3& max, const LLVector3 &origin, const F32 &radius_squared);
+
+//defines data needed for octree of an entry
+//LL_ALIGN_PREFIX(16)
+class LLViewerOctreeEntry : public LLRefCount, public LLTrace::MemTrackable<LLViewerOctreeEntry, 16>
+{
+ friend class LLViewerOctreeEntryData;
+
+public:
+ typedef enum
+ {
+ LLDRAWABLE = 0,
+ LLVOCACHEENTRY,
+ NUM_DATA_TYPE
+ }eEntryDataType_t;
+
+protected:
+ virtual ~LLViewerOctreeEntry();
+
+public:
+ LLViewerOctreeEntry();
+
+ void nullGroup(); //called by group handleDestruction() only
+ void setGroup(LLViewerOctreeGroup* group);
+ void removeData(LLViewerOctreeEntryData* data);
+
+ LLViewerOctreeEntryData* getDrawable() const {return mData[LLDRAWABLE];}
+ bool hasDrawable() const {return mData[LLDRAWABLE] != NULL;}
+ LLViewerOctreeEntryData* getVOCacheEntry() const {return mData[LLVOCACHEENTRY];}
+ bool hasVOCacheEntry() const {return mData[LLVOCACHEENTRY] != NULL;}
+
+ const LLVector4a* getSpatialExtents() const {return mExtents;}
+ const LLVector4a& getPositionGroup() const {return mPositionGroup;}
+ LLViewerOctreeGroup* getGroup()const {return mGroup;}
+
+ F32 getBinRadius() const {return mBinRadius;}
+ S32 getBinIndex() const {return mBinIndex; }
+ void setBinIndex(S32 index) const {mBinIndex = index; }
+
+private:
+ void addData(LLViewerOctreeEntryData* data);
+
+private:
+ LLViewerOctreeEntryData* mData[NUM_DATA_TYPE]; //do not use LLPointer here.
+ LLViewerOctreeGroup* mGroup;
+
+ //aligned members
+ LL_ALIGN_16(LLVector4a mExtents[2]);
+ LL_ALIGN_16(LLVector4a mPositionGroup);
+ F32 mBinRadius;
+ mutable S32 mBinIndex;
+ mutable U32 mVisible;
+
+} ;//LL_ALIGN_POSTFIX(16);
+
+//defines an abstract class for entry data
+//LL_ALIGN_PREFIX(16)
+class LLViewerOctreeEntryData : public LLRefCount
+{
+protected:
+ virtual ~LLViewerOctreeEntryData();
+
+public:
+ LLViewerOctreeEntryData(const LLViewerOctreeEntryData& rhs)
+ {
+ *this = rhs;
+ }
+ LLViewerOctreeEntryData(LLViewerOctreeEntry::eEntryDataType_t data_type);
+
+ LLViewerOctreeEntry::eEntryDataType_t getDataType() const {return mDataType;}
+ LLViewerOctreeEntry* getEntry() {return mEntry;}
+
+ virtual void setOctreeEntry(LLViewerOctreeEntry* entry);
+ void removeOctreeEntry();
+
+ F32 getBinRadius() const {return mEntry->getBinRadius();}
+ const LLVector4a* getSpatialExtents() const;
+ LLViewerOctreeGroup* getGroup()const;
+ const LLVector4a& getPositionGroup() const;
+
+ void setBinRadius(F32 rad) {mEntry->mBinRadius = rad;}
+ void setSpatialExtents(const LLVector3& min, const LLVector3& max);
+ void setSpatialExtents(const LLVector4a& min, const LLVector4a& max);
+ void setPositionGroup(const LLVector4a& pos);
+
+ virtual void setGroup(LLViewerOctreeGroup* group);
+ void shift(const LLVector4a &shift_vector);
+
+ U32 getVisible() const {return mEntry ? mEntry->mVisible : 0;}
+ void setVisible() const;
+ void resetVisible() const;
+ virtual bool isVisible() const;
+ virtual bool isRecentlyVisible() const;
+
+ static S32 getCurrentFrame() { return sCurVisible; }
+
+protected:
+ LLVector4a& getGroupPosition() {return mEntry->mPositionGroup;}
+ void initVisible(U32 visible) {mEntry->mVisible = visible;}
+
+ static void incrementVisible() {sCurVisible++;}
+protected:
+ LLPointer<LLViewerOctreeEntry> mEntry;
+ LLViewerOctreeEntry::eEntryDataType_t mDataType;
+ static U32 sCurVisible; // Counter for what value of mVisible means currently visible
+};//LL_ALIGN_POSTFIX(16);
+
+
+//defines an octree group for an octree node, which contains multiple entries.
+//LL_ALIGN_PREFIX(16)
+class LLViewerOctreeGroup
+: public LLOctreeListener<LLViewerOctreeEntry>, public LLTrace::MemTrackable<LLViewerOctreeGroup, 16>
+{
+ friend class LLViewerOctreeCull;
+protected:
+ virtual ~LLViewerOctreeGroup();
+
+public:
+ enum
+ {
+ CLEAN = 0x00000000,
+ DIRTY = 0x00000001,
+ OBJECT_DIRTY = 0x00000002,
+ SKIP_FRUSTUM_CHECK = 0x00000004,
+ DEAD = 0x00000008,
+ INVALID_STATE = 0x00000010,
+ };
+
+public:
+ typedef LLOctreeNode<LLViewerOctreeEntry>::element_iter element_iter;
+ typedef LLOctreeNode<LLViewerOctreeEntry>::element_list element_list;
+
+ LLViewerOctreeGroup(OctreeNode* node);
+ LLViewerOctreeGroup(const LLViewerOctreeGroup& rhs)
+ : LLTrace::MemTrackable<LLViewerOctreeGroup, 16>("LLViewerOctreeGroup")
+ {
+ *this = rhs;
+ }
+
+ bool removeFromGroup(LLViewerOctreeEntryData* data);
+ bool removeFromGroup(LLViewerOctreeEntry* entry);
+
+ virtual void unbound();
+ virtual void rebound();
+
+ BOOL isDead() { return hasState(DEAD); }
+
+ void setVisible();
+ BOOL isVisible() const;
+ virtual BOOL isRecentlyVisible() const;
+ S32 getVisible(LLViewerCamera::eCameraID id) const {return mVisible[id];}
+ S32 getAnyVisible() const {return mAnyVisible;}
+ bool isEmpty() const { return mOctreeNode->isEmpty(); }
+
+ U32 getState() {return mState; }
+ bool isDirty() const {return mState & DIRTY;}
+ bool hasState(U32 state) const {return mState & state;}
+ void setState(U32 state) {mState |= state;}
+ void clearState(U32 state) {mState &= ~state;}
+
+ //LISTENER FUNCTIONS
+ virtual void handleInsertion(const TreeNode* node, LLViewerOctreeEntry* obj);
+ virtual void handleRemoval(const TreeNode* node, LLViewerOctreeEntry* obj);
+ virtual void handleDestruction(const TreeNode* node);
+ virtual void handleStateChange(const TreeNode* node);
+ virtual void handleChildAddition(const OctreeNode* parent, OctreeNode* child);
+ virtual void handleChildRemoval(const OctreeNode* parent, const OctreeNode* child);
+
+ OctreeNode* getOctreeNode() {return mOctreeNode;}
+ LLViewerOctreeGroup* getParent();
+
+ const LLVector4a* getBounds() const {return mBounds;}
+ const LLVector4a* getExtents() const {return mExtents;}
+ const LLVector4a* getObjectBounds() const {return mObjectBounds;}
+ const LLVector4a* getObjectExtents() const {return mObjectExtents;}
+
+ //octree wrappers to make code more readable
+ element_list& getData() { return mOctreeNode->getData(); }
+ element_iter getDataBegin() { return mOctreeNode->getDataBegin(); }
+ element_iter getDataEnd() { return mOctreeNode->getDataEnd(); }
+ U32 getElementCount() const { return mOctreeNode->getElementCount(); }
+ bool hasElement(LLViewerOctreeEntryData* data);
+
+protected:
+ void checkStates();
+private:
+ virtual bool boundObjects(BOOL empty, LLVector4a& minOut, LLVector4a& maxOut);
+
+protected:
+ U32 mState;
+ OctreeNode* mOctreeNode;
+
+ LL_ALIGN_16(LLVector4a mBounds[2]); // bounding box (center, size) of this node and all its children (tight fit to objects)
+ LL_ALIGN_16(LLVector4a mObjectBounds[2]); // bounding box (center, size) of objects in this node
+ LL_ALIGN_16(LLVector4a mExtents[2]); // extents (min, max) of this node and all its children
+ LL_ALIGN_16(LLVector4a mObjectExtents[2]); // extents (min, max) of objects in this node
+
+ S32 mAnyVisible; //latest visible to any camera
+ S32 mVisible[LLViewerCamera::NUM_CAMERAS];
+
+};//LL_ALIGN_POSTFIX(16);
+
+//octree group which has capability to support occlusion culling
+//LL_ALIGN_PREFIX(16)
+class LLOcclusionCullingGroup : public LLViewerOctreeGroup
+{
+public:
+ typedef enum
+ {
+ OCCLUDED = 0x00010000,
+ QUERY_PENDING = 0x00020000,
+ ACTIVE_OCCLUSION = 0x00040000,
+ DISCARD_QUERY = 0x00080000,
+ EARLY_FAIL = 0x00100000,
+ } eOcclusionState;
+
+ typedef enum
+ {
+ STATE_MODE_SINGLE = 0, //set one node
+ STATE_MODE_BRANCH, //set entire branch
+ STATE_MODE_DIFF, //set entire branch as long as current state is different
+ STATE_MODE_ALL_CAMERAS, //used for occlusion state, set state for all cameras
+ } eSetStateMode;
+
+protected:
+ virtual ~LLOcclusionCullingGroup();
+
+public:
+ LLOcclusionCullingGroup(OctreeNode* node, LLViewerOctreePartition* part);
+ LLOcclusionCullingGroup(const LLOcclusionCullingGroup& rhs) : LLViewerOctreeGroup(rhs)
+ {
+ *this = rhs;
+ }
+
+ void setOcclusionState(U32 state, S32 mode = STATE_MODE_SINGLE);
+ void clearOcclusionState(U32 state, S32 mode = STATE_MODE_SINGLE);
+ void checkOcclusion(); //read back last occlusion query (if any)
+ void doOcclusion(LLCamera* camera, const LLVector4a* shift = NULL); //issue occlusion query
+ BOOL isOcclusionState(U32 state) const { return mOcclusionState[LLViewerCamera::sCurCameraID] & state ? TRUE : FALSE; }
+ U32 getOcclusionState() const { return mOcclusionState[LLViewerCamera::sCurCameraID];}
+
+ BOOL needsUpdate();
+ U32 getLastOcclusionIssuedTime();
+
+ //virtual
+ void handleChildAddition(const OctreeNode* parent, OctreeNode* child);
+
+ //virtual
+ BOOL isRecentlyVisible() const;
+ LLViewerOctreePartition* getSpatialPartition()const {return mSpatialPartition;}
+ BOOL isAnyRecentlyVisible() const;
+
+ static U32 getNewOcclusionQueryObjectName();
+ static void releaseOcclusionQueryObjectName(U32 name);
+
+protected:
+ void releaseOcclusionQueryObjectNames();
+
+private:
+ BOOL earlyFail(LLCamera* camera, const LLVector4a* bounds);
+
+protected:
+ U32 mOcclusionState[LLViewerCamera::NUM_CAMERAS];
+ U32 mOcclusionIssued[LLViewerCamera::NUM_CAMERAS];
+
+ S32 mLODHash;
+
+ LLViewerOctreePartition* mSpatialPartition;
+ U32 mOcclusionQuery[LLViewerCamera::NUM_CAMERAS];
+
+public:
+ static std::set<U32> sPendingQueries;
+};//LL_ALIGN_POSTFIX(16);
+
+class LLViewerOctreePartition
+{
+public:
+ LLViewerOctreePartition();
+ virtual ~LLViewerOctreePartition();
+
+ // Cull on arbitrary frustum
+ virtual S32 cull(LLCamera &camera, bool do_occlusion) = 0;
+ BOOL isOcclusionEnabled();
+
+public:
+ U32 mPartitionType;
+ U32 mDrawableType;
+ OctreeNode* mOctree;
+ LLViewerRegion* mRegionp; // the region this partition belongs to.
+ BOOL mOcclusionEnabled; // if TRUE, occlusion culling is performed
+ U32 mLODSeed;
+ U32 mLODPeriod; //number of frames between LOD updates for a given spatial group (staggered by mLODSeed)
+};
+
+class LLViewerOctreeCull : public OctreeTraveler
+{
+public:
+ LLViewerOctreeCull(LLCamera* camera)
+ : mCamera(camera), mRes(0) { }
+
+ virtual void traverse(const OctreeNode* n);
+
+protected:
+ virtual bool earlyFail(LLViewerOctreeGroup* group);
+
+ //agent space group cull
+ S32 AABBInFrustumNoFarClipGroupBounds(const LLViewerOctreeGroup* group);
+ S32 AABBSphereIntersectGroupExtents(const LLViewerOctreeGroup* group);
+ S32 AABBInFrustumGroupBounds(const LLViewerOctreeGroup* group);
+
+ //agent space object set cull
+ S32 AABBInFrustumNoFarClipObjectBounds(const LLViewerOctreeGroup* group);
+ S32 AABBSphereIntersectObjectExtents(const LLViewerOctreeGroup* group);
+ S32 AABBInFrustumObjectBounds(const LLViewerOctreeGroup* group);
+
+ //local region space group cull
+ S32 AABBInRegionFrustumNoFarClipGroupBounds(const LLViewerOctreeGroup* group);
+ S32 AABBInRegionFrustumGroupBounds(const LLViewerOctreeGroup* group);
+ S32 AABBRegionSphereIntersectGroupExtents(const LLViewerOctreeGroup* group, const LLVector3& shift);
+
+ //local region space object set cull
+ S32 AABBInRegionFrustumNoFarClipObjectBounds(const LLViewerOctreeGroup* group);
+ S32 AABBInRegionFrustumObjectBounds(const LLViewerOctreeGroup* group);
+ S32 AABBRegionSphereIntersectObjectExtents(const LLViewerOctreeGroup* group, const LLVector3& shift);
+
+ virtual S32 frustumCheck(const LLViewerOctreeGroup* group) = 0;
+ virtual S32 frustumCheckObjects(const LLViewerOctreeGroup* group) = 0;
+
+ bool checkProjectionArea(const LLVector4a& center, const LLVector4a& size, const LLVector3& shift, F32 pixel_threshold, F32 near_radius);
+ virtual bool checkObjects(const OctreeNode* branch, const LLViewerOctreeGroup* group);
+ virtual void preprocess(LLViewerOctreeGroup* group);
+ virtual void processGroup(LLViewerOctreeGroup* group);
+ virtual void visit(const OctreeNode* branch);
+
+protected:
+ LLCamera *mCamera;
+ S32 mRes;
+};
+
+//scan the octree, output the info of each node for debug use.
+class LLViewerOctreeDebug : public OctreeTraveler
+{
+public:
+ virtual void processGroup(LLViewerOctreeGroup* group);
+ virtual void visit(const OctreeNode* branch);
+
+public:
+ static BOOL sInDebug;
+};
+
+#endif
diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp
index 386b2fd400..37b249dddd 100755
--- a/indra/newview/llviewerparcelmedia.cpp
+++ b/indra/newview/llviewerparcelmedia.cpp
@@ -99,7 +99,7 @@ void LLViewerParcelMedia::update(LLParcel* parcel)
std::string mediaCurrentUrl = std::string( parcel->getMediaCurrentURL());
// if we have a current (link sharing) url, use it instead
- if (mediaCurrentUrl != "" && parcel->getMediaType() == "text/html")
+ if (mediaCurrentUrl != "" && parcel->getMediaType() == HTTP_CONTENT_TEXT_HTML)
{
mediaUrl = mediaCurrentUrl;
}
@@ -159,7 +159,7 @@ void LLViewerParcelMedia::update(LLParcel* parcel)
// static
void LLViewerParcelMedia::play(LLParcel* parcel)
{
- lldebugs << "LLViewerParcelMedia::play" << llendl;
+ LL_DEBUGS() << "LLViewerParcelMedia::play" << LL_ENDL;
if (!parcel) return;
@@ -471,7 +471,7 @@ void LLViewerParcelMedia::sendMediaNavigateMessage(const std::string& url)
}
else
{
- llwarns << "can't get ParcelNavigateMedia capability" << llendl;
+ LL_WARNS() << "can't get ParcelNavigateMedia capability" << LL_ENDL;
}
}
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index e361fad9de..7c94442f09 100755
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -36,7 +36,6 @@
#include "llnotifications.h"
#include "llnotificationsutil.h"
#include "llparcel.h"
-#include "llsecondlifeurls.h"
#include "message.h"
#include "llfloaterreg.h"
@@ -118,6 +117,7 @@ LLViewerParcelMgr::LLViewerParcelMgr()
mHoverRequestResult(0),
mHoverWestSouth(),
mHoverEastNorth(),
+ mTeleportInProgressPosition(),
mRenderCollision(FALSE),
mRenderSelection(TRUE),
mCollisionBanned(0),
@@ -198,22 +198,22 @@ LLViewerParcelMgr::~LLViewerParcelMgr()
void LLViewerParcelMgr::dump()
{
- llinfos << "Parcel Manager Dump" << llendl;
- llinfos << "mSelected " << S32(mSelected) << llendl;
- llinfos << "Selected parcel: " << llendl;
- llinfos << mWestSouth << " to " << mEastNorth << llendl;
+ LL_INFOS() << "Parcel Manager Dump" << LL_ENDL;
+ LL_INFOS() << "mSelected " << S32(mSelected) << LL_ENDL;
+ LL_INFOS() << "Selected parcel: " << LL_ENDL;
+ LL_INFOS() << mWestSouth << " to " << mEastNorth << LL_ENDL;
mCurrentParcel->dump();
- llinfos << "banning " << mCurrentParcel->mBanList.size() << llendl;
+ LL_INFOS() << "banning " << mCurrentParcel->mBanList.size() << LL_ENDL;
access_map_const_iterator cit = mCurrentParcel->mBanList.begin();
access_map_const_iterator end = mCurrentParcel->mBanList.end();
for ( ; cit != end; ++cit)
{
- llinfos << "ban id " << (*cit).first << llendl;
+ LL_INFOS() << "ban id " << (*cit).first << LL_ENDL;
}
- llinfos << "Hover parcel:" << llendl;
+ LL_INFOS() << "Hover parcel:" << LL_ENDL;
mHoverParcel->dump();
- llinfos << "Agent parcel:" << llendl;
+ LL_INFOS() << "Agent parcel:" << LL_ENDL;
mAgentParcel->dump();
}
@@ -591,13 +591,13 @@ void LLViewerParcelMgr::deselectLand()
void LLViewerParcelMgr::addObserver(LLParcelObserver* observer)
{
- mObservers.put(observer);
+ mObservers.push_back(observer);
}
void LLViewerParcelMgr::removeObserver(LLParcelObserver* observer)
{
- mObservers.removeObj(observer);
+ vector_replace_with_last(mObservers, observer);
}
@@ -606,16 +606,16 @@ void LLViewerParcelMgr::removeObserver(LLParcelObserver* observer)
// from the list.
void LLViewerParcelMgr::notifyObservers()
{
- LLDynamicArray<LLParcelObserver*> observers;
- S32 count = mObservers.count();
+ std::vector<LLParcelObserver*> observers;
+ S32 count = mObservers.size();
S32 i;
for(i = 0; i < count; ++i)
{
- observers.put(mObservers.get(i));
+ observers.push_back(mObservers.at(i));
}
for(i = 0; i < count; ++i)
{
- observers.get(i)->changed();
+ observers.at(i)->changed();
}
}
@@ -948,7 +948,7 @@ void LLViewerParcelMgr::sendParcelGodForceOwner(const LLUUID& owner_id)
return;
}
- llinfos << "Claiming " << mWestSouth << " to " << mEastNorth << llendl;
+ LL_INFOS() << "Claiming " << mWestSouth << " to " << mEastNorth << LL_ENDL;
// BUG: Only works for the region containing mWestSouthBottom
LLVector3d east_north_region_check( mEastNorth );
@@ -971,7 +971,7 @@ void LLViewerParcelMgr::sendParcelGodForceOwner(const LLUUID& owner_id)
return;
}
- llinfos << "Region " << region->getOriginGlobal() << llendl;
+ LL_INFOS() << "Region " << region->getOriginGlobal() << LL_ENDL;
LLSD payload;
payload["owner_id"] = owner_id;
@@ -1111,8 +1111,8 @@ LLViewerParcelMgr::ParcelBuyInfo* LLViewerParcelMgr::setupParcelBuy(
if (is_claim)
{
- llinfos << "Claiming " << mWestSouth << " to " << mEastNorth << llendl;
- llinfos << "Region " << region->getOriginGlobal() << llendl;
+ LL_INFOS() << "Claiming " << mWestSouth << " to " << mEastNorth << LL_ENDL;
+ LL_INFOS() << "Region " << region->getOriginGlobal() << LL_ENDL;
// BUG: Only works for the region containing mWestSouthBottom
LLVector3d east_north_region_check( mEastNorth );
@@ -1282,7 +1282,7 @@ void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel, bool use_ag
LLViewerRegion *region = use_agent_region ? gAgent.getRegion() : LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth );
if (!region) return;
- //llinfos << "found region: " << region->getName() << llendl;
+ //LL_INFOS() << "found region: " << region->getName() << LL_ENDL;
LLSD body;
std::string url = region->getCapability("ParcelPropertiesUpdate");
@@ -1292,8 +1292,8 @@ void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel, bool use_ag
U32 message_flags = 0x01;
body["flags"] = ll_sd_from_U32(message_flags);
parcel->packMessage(body);
- llinfos << "Sending parcel properties update via capability to: "
- << url << llendl;
+ LL_INFOS() << "Sending parcel properties update via capability to: "
+ << url << LL_ENDL;
LLHTTPClient::post(url, body, new LLHTTPClient::Responder());
}
else
@@ -1321,12 +1321,6 @@ void LLViewerParcelMgr::setHoverParcel(const LLVector3d& pos)
static U32 last_west, last_south;
- // only request parcel info when tooltip is shown
- if (!gSavedSettings.getBOOL("ShowLandHoverTip"))
- {
- return;
- }
-
// only request parcel info if position has changed outside of the
// last parcel grid step
U32 west_parcel_step = (U32) floor( pos.mdV[VX] / PARCEL_GRID_STEP_METERS );
@@ -1387,7 +1381,7 @@ void LLViewerParcelMgr::processParcelOverlay(LLMessageSystem *msg, void **user)
if (packed_overlay_size <= 0)
{
- llwarns << "Overlay size " << packed_overlay_size << llendl;
+ LL_WARNS() << "Overlay size " << packed_overlay_size << LL_ENDL;
return;
}
@@ -1395,8 +1389,8 @@ void LLViewerParcelMgr::processParcelOverlay(LLMessageSystem *msg, void **user)
S32 expected_size = parcels_per_edge * parcels_per_edge / PARCEL_OVERLAY_CHUNKS;
if (packed_overlay_size != expected_size)
{
- llwarns << "Got parcel overlay size " << packed_overlay_size
- << " expecting " << expected_size << llendl;
+ LL_WARNS() << "Got parcel overlay size " << packed_overlay_size
+ << " expecting " << expected_size << LL_ENDL;
return;
}
@@ -1462,7 +1456,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
if (request_result == PARCEL_RESULT_NO_DATA)
{
// no valid parcel data
- llinfos << "no valid parcel data" << llendl;
+ LL_INFOS() << "no valid parcel data" << LL_ENDL;
return;
}
@@ -1494,9 +1488,9 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
}
else
{
- llinfos << "out of order agent parcel sequence id " << sequence_id
+ LL_INFOS() << "out of order agent parcel sequence id " << sequence_id
<< " last good " << parcel_mgr.mAgentParcelSequenceID
- << llendl;
+ << LL_ENDL;
return;
}
@@ -1586,7 +1580,15 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
if (instance->mTeleportInProgress)
{
instance->mTeleportInProgress = FALSE;
- instance->mTeleportFinishedSignal(gAgent.getPositionGlobal(), false);
+ if(instance->mTeleportInProgressPosition.isNull())
+ {
+ //initial update
+ instance->mTeleportFinishedSignal(gAgent.getPositionGlobal(), false);
+ }
+ else
+ {
+ instance->mTeleportFinishedSignal(instance->mTeleportInProgressPosition, false);
+ }
}
}
}
@@ -1745,7 +1747,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
}
else
{
- llinfos << "Stopping parcel music (invalid audio stream URL)" << llendl;
+ LL_INFOS() << "Stopping parcel music (invalid audio stream URL)" << LL_ENDL;
// clears the URL
// null value causes fade out
LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null);
@@ -1753,7 +1755,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
}
else if (!gAudiop->getInternetStreamURL().empty())
{
- llinfos << "Stopping parcel music (parcel stream URL is empty)" << llendl;
+ LL_INFOS() << "Stopping parcel music (parcel stream URL is empty)" << LL_ENDL;
// null value causes fade out
LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null);
}
@@ -1781,7 +1783,7 @@ void LLViewerParcelMgr::optionally_start_music(const std::string& music_url)
gSavedSettings.getBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING) &&
gSavedSettings.getBOOL("MediaTentativeAutoPlay")))
{
- llinfos << "Starting parcel music " << music_url << llendl;
+ LL_INFOS() << "Starting parcel music " << music_url << LL_ENDL;
LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(music_url);
}
else
@@ -1810,7 +1812,7 @@ void LLViewerParcelMgr::processParcelAccessListReply(LLMessageSystem *msg, void
if (parcel_id != parcel->getLocalID())
{
LL_WARNS_ONCE("") << "processParcelAccessListReply for parcel " << parcel_id
- << " which isn't the selected parcel " << parcel->getLocalID()<< llendl;
+ << " which isn't the selected parcel " << parcel->getLocalID()<< LL_ENDL;
return;
}
@@ -2495,6 +2497,7 @@ void LLViewerParcelMgr::onTeleportFinished(bool local, const LLVector3d& new_pos
// Non-local teleport (inter-region or between different parcels of the same region).
// The agent parcel data has not been updated yet.
// Let's wait for the update and then emit the signal.
+ mTeleportInProgressPosition = new_pos;
mTeleportInProgress = TRUE;
}
}
diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h
index 9da49bb3f3..b5b269abdf 100755
--- a/indra/newview/llviewerparcelmgr.h
+++ b/indra/newview/llviewerparcelmgr.h
@@ -28,7 +28,6 @@
#define LL_LLVIEWERPARCELMGR_H
#include "v3dmath.h"
-#include "lldarray.h"
#include "llframetimer.h"
#include "llsingleton.h"
#include "llparcelselection.h"
@@ -333,9 +332,10 @@ private:
LLVector3d mHoverWestSouth;
LLVector3d mHoverEastNorth;
- LLDynamicArray<LLParcelObserver*> mObservers;
+ std::vector<LLParcelObserver*> mObservers;
BOOL mTeleportInProgress;
+ LLVector3d mTeleportInProgressPosition;
teleport_finished_signal_t mTeleportFinishedSignal;
teleport_failed_signal_t mTeleportFailedSignal;
diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp
index a1c12c5cd6..4fd423b6f4 100755
--- a/indra/newview/llviewerparceloverlay.cpp
+++ b/indra/newview/llviewerparceloverlay.cpp
@@ -432,9 +432,12 @@ void LLViewerParcelOverlay::updatePropertyLines()
const LLColor4U auction_coloru = LLUIColorTable::instance().getColor("PropertyColorAuction").get();
// Build into dynamic arrays, then copy into static arrays.
- LLDynamicArray<LLVector3, 256> new_vertex_array;
- LLDynamicArray<LLColor4U, 256> new_color_array;
- LLDynamicArray<LLVector2, 256> new_coord_array;
+ std::vector<LLVector3> new_vertex_array;
+ new_vertex_array.reserve(256);
+ std::vector<LLColor4U> new_color_array;
+ new_color_array.reserve(256);
+ std::vector<LLVector2> new_coord_array;
+ new_coord_array.reserve(256);
U8 overlay = 0;
BOOL add_edge = FALSE;
@@ -599,7 +602,7 @@ void LLViewerParcelOverlay::updatePropertyLines()
// Now copy into static arrays for faster rendering.
// Attempt to recycle old arrays if possible to avoid memory
// shuffling.
- S32 new_vertex_count = new_vertex_array.count();
+ S32 new_vertex_count = new_vertex_array.size();
if (!(mVertexArray && mColorArray && new_vertex_count == mVertexCount))
{
@@ -623,7 +626,7 @@ void LLViewerParcelOverlay::updatePropertyLines()
F32* vertex = mVertexArray;
for (i = 0; i < mVertexCount; i++)
{
- const LLVector3& point = new_vertex_array.get(i);
+ const LLVector3& point = new_vertex_array.at(i);
*vertex = point.mV[VX];
vertex++;
*vertex = point.mV[VY];
@@ -635,7 +638,7 @@ void LLViewerParcelOverlay::updatePropertyLines()
U8* colorp = mColorArray;
for (i = 0; i < mVertexCount; i++)
{
- const LLColor4U& color = new_color_array.get(i);
+ const LLColor4U& color = new_color_array.at(i);
*colorp = color.mV[VRED];
colorp++;
*colorp = color.mV[VGREEN];
@@ -652,9 +655,9 @@ void LLViewerParcelOverlay::updatePropertyLines()
void LLViewerParcelOverlay::addPropertyLine(
- LLDynamicArray<LLVector3, 256>& vertex_array,
- LLDynamicArray<LLColor4U, 256>& color_array,
- LLDynamicArray<LLVector2, 256>& coord_array,
+ std::vector<LLVector3>& vertex_array,
+ std::vector<LLColor4U>& color_array,
+ std::vector<LLVector2>& coord_array,
const F32 start_x, const F32 start_y,
const U32 edge,
const LLColor4U& color)
@@ -662,6 +665,10 @@ void LLViewerParcelOverlay::addPropertyLine(
LLColor4U underwater( color );
underwater.mV[VALPHA] /= 2;
+ vertex_array.reserve(16);
+ color_array.reserve(16);
+ coord_array.reserve(16);
+
LLSurface& land = mRegion->getLand();
F32 dx;
@@ -702,7 +709,7 @@ void LLViewerParcelOverlay::addPropertyLine(
break;
default:
- llerrs << "Invalid edge in addPropertyLine" << llendl;
+ LL_ERRS() << "Invalid edge in addPropertyLine" << LL_ENDL;
return;
}
@@ -716,11 +723,11 @@ void LLViewerParcelOverlay::addPropertyLine(
// First part, only one vertex
outside_z = land.resolveHeightRegion( outside_x, outside_y );
- if (outside_z > 20.f) color_array.put( color );
- else color_array.put( underwater );
+ if (outside_z > 20.f) color_array.push_back( color );
+ else color_array.push_back( underwater );
- vertex_array.put( LLVector3(outside_x, outside_y, outside_z) );
- coord_array.put( LLVector2(outside_x - start_x, 0.f) );
+ vertex_array.push_back( LLVector3(outside_x, outside_y, outside_z) );
+ coord_array.push_back( LLVector2(outside_x - start_x, 0.f) );
inside_x += dx * LINE_WIDTH;
inside_y += dy * LINE_WIDTH;
@@ -732,17 +739,17 @@ void LLViewerParcelOverlay::addPropertyLine(
inside_z = land.resolveHeightRegion( inside_x, inside_y );
outside_z = land.resolveHeightRegion( outside_x, outside_y );
- if (inside_z > 20.f) color_array.put( color );
- else color_array.put( underwater );
+ if (inside_z > 20.f) color_array.push_back( color );
+ else color_array.push_back( underwater );
- if (outside_z > 20.f) color_array.put( color );
- else color_array.put( underwater );
+ if (outside_z > 20.f) color_array.push_back( color );
+ else color_array.push_back( underwater );
- vertex_array.put( LLVector3(inside_x, inside_y, inside_z) );
- vertex_array.put( LLVector3(outside_x, outside_y, outside_z) );
+ vertex_array.push_back( LLVector3(inside_x, inside_y, inside_z) );
+ vertex_array.push_back( LLVector3(outside_x, outside_y, outside_z) );
- coord_array.put( LLVector2(outside_x - start_x, 1.f) );
- coord_array.put( LLVector2(outside_x - start_x, 0.f) );
+ coord_array.push_back( LLVector2(outside_x - start_x, 1.f) );
+ coord_array.push_back( LLVector2(outside_x - start_x, 0.f) );
inside_x += dx * (dx - LINE_WIDTH);
inside_y += dy * (dy - LINE_WIDTH);
@@ -758,17 +765,17 @@ void LLViewerParcelOverlay::addPropertyLine(
inside_z = land.resolveHeightRegion( inside_x, inside_y );
outside_z = land.resolveHeightRegion( outside_x, outside_y );
- if (inside_z > 20.f) color_array.put( color );
- else color_array.put( underwater );
+ if (inside_z > 20.f) color_array.push_back( color );
+ else color_array.push_back( underwater );
- if (outside_z > 20.f) color_array.put( color );
- else color_array.put( underwater );
+ if (outside_z > 20.f) color_array.push_back( color );
+ else color_array.push_back( underwater );
- vertex_array.put( LLVector3(inside_x, inside_y, inside_z) );
- vertex_array.put( LLVector3(outside_x, outside_y, outside_z) );
+ vertex_array.push_back( LLVector3(inside_x, inside_y, inside_z) );
+ vertex_array.push_back( LLVector3(outside_x, outside_y, outside_z) );
- coord_array.put( LLVector2(outside_x - start_x, 1.f) );
- coord_array.put( LLVector2(outside_x - start_x, 0.f) );
+ coord_array.push_back( LLVector2(outside_x - start_x, 1.f) );
+ coord_array.push_back( LLVector2(outside_x - start_x, 0.f) );
inside_x += dx;
inside_y += dy;
@@ -787,17 +794,17 @@ void LLViewerParcelOverlay::addPropertyLine(
inside_z = land.resolveHeightRegion( inside_x, inside_y );
outside_z = land.resolveHeightRegion( outside_x, outside_y );
- if (inside_z > 20.f) color_array.put( color );
- else color_array.put( underwater );
+ if (inside_z > 20.f) color_array.push_back( color );
+ else color_array.push_back( underwater );
- if (outside_z > 20.f) color_array.put( color );
- else color_array.put( underwater );
+ if (outside_z > 20.f) color_array.push_back( color );
+ else color_array.push_back( underwater );
- vertex_array.put( LLVector3(inside_x, inside_y, inside_z) );
- vertex_array.put( LLVector3(outside_x, outside_y, outside_z) );
+ vertex_array.push_back( LLVector3(inside_x, inside_y, inside_z) );
+ vertex_array.push_back( LLVector3(outside_x, outside_y, outside_z) );
- coord_array.put( LLVector2(outside_x - start_x, 1.f) );
- coord_array.put( LLVector2(outside_x - start_x, 0.f) );
+ coord_array.push_back( LLVector2(outside_x - start_x, 1.f) );
+ coord_array.push_back( LLVector2(outside_x - start_x, 0.f) );
inside_x += dx * LINE_WIDTH;
inside_y += dy * LINE_WIDTH;
@@ -808,11 +815,11 @@ void LLViewerParcelOverlay::addPropertyLine(
// Last edge is not drawn to the edge
outside_z = land.resolveHeightRegion( outside_x, outside_y );
- if (outside_z > 20.f) color_array.put( color );
- else color_array.put( underwater );
+ if (outside_z > 20.f) color_array.push_back( color );
+ else color_array.push_back( underwater );
- vertex_array.put( LLVector3(outside_x, outside_y, outside_z) );
- coord_array.put( LLVector2(outside_x - start_x, 0.f) );
+ vertex_array.push_back( LLVector3(outside_x, outside_y, outside_z) );
+ coord_array.push_back( LLVector2(outside_x - start_x, 0.f) );
}
diff --git a/indra/newview/llviewerparceloverlay.h b/indra/newview/llviewerparceloverlay.h
index 7445d5bf1d..14a2af5354 100755
--- a/indra/newview/llviewerparceloverlay.h
+++ b/indra/newview/llviewerparceloverlay.h
@@ -31,7 +31,6 @@
// One of these structures per region.
#include "llbbox.h"
-#include "lldarray.h"
#include "llframetimer.h"
#include "lluuid.h"
#include "llviewertexture.h"
@@ -88,9 +87,9 @@ private:
U8 ownership(S32 row, S32 col) const
{ return 0x7 & mOwnership[row * mParcelGridsPerEdge + col]; }
- void addPropertyLine(LLDynamicArray<LLVector3, 256>& vertex_array,
- LLDynamicArray<LLColor4U, 256>& color_array,
- LLDynamicArray<LLVector2, 256>& coord_array,
+ void addPropertyLine(std::vector<LLVector3>& vertex_array,
+ std::vector<LLColor4U>& color_array,
+ std::vector<LLVector2>& coord_array,
const F32 start_x, const F32 start_y,
const U32 edge,
const LLColor4U& color);
diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp
index 163c90019f..76418ad6a6 100755
--- a/indra/newview/llviewerpartsim.cpp
+++ b/indra/newview/llviewerpartsim.cpp
@@ -144,7 +144,7 @@ LLViewerPartGroup::LLViewerPartGroup(const LLVector3 &center_agent, const F32 bo
if (!mRegionp)
{
- //llwarns << "No region at position, using agent region!" << llendl;
+ //LL_WARNS() << "No region at position, using agent region!" << LL_ENDL;
mRegionp = gAgent.getRegion();
}
mCenterAgent = center_agent;
@@ -174,8 +174,8 @@ LLViewerPartGroup::LLViewerPartGroup(const LLVector3 &center_agent, const F32 bo
if (group != NULL)
{
- LLVector3 center(group->mOctreeNode->getCenter().getF32ptr());
- LLVector3 size(group->mOctreeNode->getSize().getF32ptr());
+ LLVector3 center(group->getOctreeNode()->getCenter().getF32ptr());
+ LLVector3 size(group->getOctreeNode()->getSize().getF32ptr());
size += LLVector3(0.01f, 0.01f, 0.01f);
mMinObjPos = center - size;
mMaxObjPos = center + size;
@@ -477,12 +477,12 @@ void LLViewerPartSim::checkParticleCount(U32 size)
{
if(LLViewerPartSim::sParticleCount2 != LLViewerPartSim::sParticleCount)
{
- llerrs << "sParticleCount: " << LLViewerPartSim::sParticleCount << " ; sParticleCount2: " << LLViewerPartSim::sParticleCount2 << llendl ;
+ LL_ERRS() << "sParticleCount: " << LLViewerPartSim::sParticleCount << " ; sParticleCount2: " << LLViewerPartSim::sParticleCount2 << LL_ENDL ;
}
if(size > (U32)LLViewerPartSim::sParticleCount2)
{
- llerrs << "curren particle size: " << LLViewerPartSim::sParticleCount2 << " array size: " << size << llendl ;
+ LL_ERRS() << "curren particle size: " << LLViewerPartSim::sParticleCount2 << " array size: " << size << LL_ENDL ;
}
}
@@ -493,6 +493,20 @@ LLViewerPartSim::LLViewerPartSim()
mID = ++id_seed;
}
+//enable/disable particle system
+void LLViewerPartSim::enable(bool enabled)
+{
+ if(!enabled && sMaxParticleCount > 0)
+ {
+ sMaxParticleCount = 0; //disable
+ }
+ else if(enabled && sMaxParticleCount < 1)
+ {
+ sMaxParticleCount = llmin(gSavedSettings.getS32("RenderMaxPartCount"), LL_MAX_PARTICLE_COUNT);
+ }
+
+ return;
+}
void LLViewerPartSim::destroyClass()
{
@@ -563,8 +577,8 @@ LLViewerPartGroup *LLViewerPartSim::put(LLViewerPart* part)
if (part->mPosAgent.magVecSquared() > MAX_MAG || !part->mPosAgent.isFinite())
{
#if 0 && !LL_RELEASE_FOR_DOWNLOAD
- llwarns << "LLViewerPartSim::put Part out of range!" << llendl;
- llwarns << part->mPosAgent << llendl;
+ LL_WARNS() << "LLViewerPartSim::put Part out of range!" << LL_ENDL;
+ LL_WARNS() << part->mPosAgent << LL_ENDL;
#endif
}
else
@@ -593,9 +607,9 @@ LLViewerPartGroup *LLViewerPartSim::put(LLViewerPart* part)
!(part->mFlags & LLPartData::LL_PART_FOLLOW_VELOCITY_MASK));
if (!groupp->addPart(part))
{
- llwarns << "LLViewerPartSim::put - Particle didn't go into its box!" << llendl;
- llinfos << groupp->getCenterAgent() << llendl;
- llinfos << part->mPosAgent << llendl;
+ LL_WARNS() << "LLViewerPartSim::put - Particle didn't go into its box!" << LL_ENDL;
+ LL_INFOS() << groupp->getCenterAgent() << LL_ENDL;
+ LL_INFOS() << part->mPosAgent << LL_ENDL;
mViewerPartGroups.pop_back() ;
delete groupp;
groupp = NULL ;
@@ -643,7 +657,7 @@ void LLViewerPartSim::shift(const LLVector3 &offset)
}
}
-static LLFastTimer::DeclareTimer FTM_SIMULATE_PARTICLES("Simulate Particles");
+static LLTrace::BlockTimerStatHandle FTM_SIMULATE_PARTICLES("Simulate Particles");
void LLViewerPartSim::updateSimulation()
{
@@ -659,7 +673,7 @@ void LLViewerPartSim::updateSimulation()
return;
}
- LLFastTimer ftm(FTM_SIMULATE_PARTICLES);
+ LL_RECORD_BLOCK_TIME(FTM_SIMULATE_PARTICLES);
// Start at a random particle system so the same
// particle system doesn't always get first pick at the
@@ -780,7 +794,7 @@ void LLViewerPartSim::updateSimulation()
updatePartBurstRate() ;
- //llinfos << "Particles: " << sParticleCount << " Adaptive Rate: " << sParticleAdaptiveRate << llendl;
+ //LL_INFOS() << "Particles: " << sParticleCount << " Adaptive Rate: " << sParticleAdaptiveRate << LL_ENDL;
}
void LLViewerPartSim::updatePartBurstRate()
@@ -818,7 +832,7 @@ void LLViewerPartSim::addPartSource(LLPointer<LLViewerPartSource> sourcep)
{
if (!sourcep)
{
- llwarns << "Null part source!" << llendl;
+ LL_WARNS() << "Null part source!" << LL_ENDL;
return;
}
sourcep->setStart() ;
diff --git a/indra/newview/llviewerpartsim.h b/indra/newview/llviewerpartsim.h
index 2daa07ed8c..40e8e1d45d 100755
--- a/indra/newview/llviewerpartsim.h
+++ b/indra/newview/llviewerpartsim.h
@@ -27,7 +27,6 @@
#ifndef LL_LLVIEWERPARTSIM_H
#define LL_LLVIEWERPARTSIM_H
-#include "lldarrayptr.h"
#include "llframetimer.h"
#include "llpointer.h"
#include "llpartdata.h"
@@ -36,7 +35,6 @@
class LLViewerTexture;
class LLViewerPart;
class LLViewerRegion;
-class LLViewerTexture;
class LLVOPartGroup;
#define LL_MAX_PARTICLE_COUNT 8192
@@ -145,6 +143,8 @@ public:
typedef std::vector<LLViewerPartGroup *> group_list_t;
typedef std::vector<LLPointer<LLViewerPartSource> > source_list_t;
+ void enable(bool enabled);
+
void shift(const LLVector3 &offset);
void updateSimulation();
diff --git a/indra/newview/llviewerpartsource.cpp b/indra/newview/llviewerpartsource.cpp
index b6bbd6140d..a7fd2e0fe4 100755
--- a/indra/newview/llviewerpartsource.cpp
+++ b/indra/newview/llviewerpartsource.cpp
@@ -69,7 +69,7 @@ void LLViewerPartSource::updatePart(LLViewerPart &part, const F32 dt)
void LLViewerPartSource::update(const F32 dt)
{
- llerrs << "Creating default part source!" << llendl;
+ LL_ERRS() << "Creating default part source!" << LL_ENDL;
}
LLUUID LLViewerPartSource::getImageUUID() const
@@ -396,7 +396,7 @@ void LLViewerPartSourceScript::update(const F32 dt)
{
part->mPosAgent = mPosAgent;
part->mVelocity.setVec(0.f, 0.f, 0.f);
- //llwarns << "Unknown source pattern " << (S32)mPartSysData.mPattern << llendl;
+ //LL_WARNS() << "Unknown source pattern " << (S32)mPartSysData.mPattern << LL_ENDL;
}
if (part->mFlags & LLPartData::LL_PART_FOLLOW_SRC_MASK || // SVC-193, VWR-717
diff --git a/indra/newview/llviewerprecompiledheaders.h b/indra/newview/llviewerprecompiledheaders.h
index a565005f30..999d9092bd 100755
--- a/indra/newview/llviewerprecompiledheaders.h
+++ b/indra/newview/llviewerprecompiledheaders.h
@@ -51,12 +51,8 @@
#endif
// Library headers from llcommon project:
-#include "bitpack.h"
-#include "lldeleteutils.h"
-#include "imageids.h"
#include "indra_constants.h"
#include "llinitparam.h"
-
#include "llallocator.h"
#include "llapp.h"
#include "llcriticaldamp.h"
@@ -65,11 +61,7 @@
#include "llerror.h"
#include "llfasttimer.h"
#include "llframetimer.h"
-#include "llhash.h"
-#include "lllocalidhashmap.h"
-#include "llnametable.h"
#include "llpointer.h"
-#include "llpriqueuemap.h"
#include "llprocessor.h"
#include "llrefcount.h"
#include "llsafehandle.h"
@@ -79,12 +71,8 @@
#include "llstrider.h"
#include "llstring.h"
#include "llsys.h"
-#include "llthread.h"
#include "lltimer.h"
-#include "lluuidhashmap.h"
-#include "stdenums.h"
#include "stdtypes.h"
-#include "timing.h"
#include "u64.h"
// Library includes from llmath project
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index a271690349..11cbf3fc24 100755
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -30,6 +30,7 @@
// linden libraries
#include "indra_constants.h"
+#include "llaisapi.h"
#include "llavatarnamecache.h" // name lookup cap url
#include "llfloaterreg.h"
#include "llmath.h"
@@ -71,11 +72,21 @@
#include "stringize.h"
#include "llviewercontrol.h"
#include "llsdserialize.h"
+#include "llfloaterperms.h"
+#include "llvieweroctree.h"
+#include "llviewerdisplay.h"
+#include "llviewerwindow.h"
+#include "llprogressview.h"
#ifdef LL_WINDOWS
#pragma warning(disable:4355)
#endif
+// When we receive a base grant of capabilities that has a different number of
+// capabilities than the original base grant received for the region, print
+// out the two lists of capabilities for analysis.
+//#define DEBUG_CAPS_GRANTS
+
const F32 WATER_TEXTURE_SCALE = 8.f; // Number of times to repeat the water texture across a region
const S16 MAX_MAP_DIST = 10;
// The server only keeps our pending agent info for 60 seconds.
@@ -85,9 +96,16 @@ const S32 MAX_SEED_CAP_ATTEMPTS_BEFORE_LOGIN = 3;
const F32 CAP_REQUEST_TIMEOUT = 18;
// Even though we gave up on login, keep trying for caps after we are logged in:
const S32 MAX_CAP_REQUEST_ATTEMPTS = 30;
+const U32 DEFAULT_MAX_REGION_WIDE_PRIM_COUNT = 15000;
+
+BOOL LLViewerRegion::sVOCacheCullingEnabled = FALSE;
+S32 LLViewerRegion::sLastCameraUpdated = 0;
+S32 LLViewerRegion::sNewObjectCreationThrottle = -1;
typedef std::map<std::string, std::string> CapabilityMap;
+static void log_capabilities(const CapabilityMap &capmap);
+
class LLViewerRegionImpl {
public:
LLViewerRegionImpl(LLViewerRegion * region, LLHost const & host)
@@ -98,6 +116,10 @@ public:
mSeedCapMaxAttemptsBeforeLogin(MAX_SEED_CAP_ATTEMPTS_BEFORE_LOGIN),
mSeedCapAttempts(0),
mHttpResponderID(0),
+ mLastCameraUpdate(0),
+ mLastCameraOrigin(),
+ mVOCachePartition(NULL),
+ mLandp(NULL),
// I'd prefer to set the LLCapabilityListener name to match the region
// name -- it's disappointing that's not available at construction time.
// We could instead store an LLCapabilityListener*, making
@@ -109,8 +131,7 @@ public:
// construction time.
mCapabilityListener(host.getString(), gMessageSystem, *region,
gAgent.getID(), gAgent.getSessionID())
- {
- }
+ {}
void buildCapabilityNames(LLSD& capabilityNames);
@@ -134,7 +155,15 @@ public:
// Misc
LLVLComposition *mCompositionp; // Composition layer for the surface
- LLVOCacheEntry::vocache_entry_map_t mCacheMap;
+ LLVOCacheEntry::vocache_entry_map_t mCacheMap; //all cached entries
+ LLVOCacheEntry::vocache_entry_set_t mActiveSet; //all active entries;
+ LLVOCacheEntry::vocache_entry_set_t mWaitingSet; //entries waiting for LLDrawable to be generated.
+ std::set< LLPointer<LLViewerOctreeGroup> > mVisibleGroups; //visible groupa
+ LLVOCachePartition* mVOCachePartition;
+ LLVOCacheEntry::vocache_entry_set_t mVisibleEntries; //must-be-created visible entries wait for objects creation.
+ LLVOCacheEntry::vocache_entry_priority_list_t mWaitingList; //transient list storing sorted visible entries waiting for object creation.
+ std::set<U32> mNonCacheableCreatedList; //list of local ids of all non-cacheable objects
+
// time?
// LRU info?
@@ -144,7 +173,7 @@ public:
CapabilityMap mCapabilities;
CapabilityMap mSecondCapabilitiesTracker;
-
+
LLEventPoll* mEventPoll;
S32 mSeedCapMaxAttempts;
@@ -159,7 +188,10 @@ public:
LLCapabilityListener mCapabilityListener;
//spatial partitions for objects in this region
- std::vector<LLSpatialPartition*> mObjectPartition;
+ std::vector<LLViewerOctreePartition*> mObjectPartition;
+
+ LLVector3 mLastCameraOrigin;
+ U32 mLastCameraUpdate;
};
// support for secondlife:///app/region/{REGION} SLapps
@@ -205,44 +237,56 @@ class BaseCapabilitiesComplete : public LLHTTPClient::Responder
{
LOG_CLASS(BaseCapabilitiesComplete);
public:
- BaseCapabilitiesComplete(U64 region_handle, S32 id)
+ BaseCapabilitiesComplete(U64 region_handle, S32 id)
: mRegionHandle(region_handle), mID(id)
- { }
+ { }
virtual ~BaseCapabilitiesComplete()
{ }
- void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content)
- {
- LL_WARNS2("AppInit", "Capabilities") << "[status:" << statusNum << ":] " << content << LL_ENDL;
+ static BaseCapabilitiesComplete* build( U64 region_handle, S32 id )
+ {
+ return new BaseCapabilitiesComplete(region_handle, id);
+ }
+
+private:
+ /* virtual */void httpFailure()
+ {
+ LL_WARNS("AppInit", "Capabilities") << dumpResponse() << LL_ENDL;
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
if (regionp)
{
regionp->failedSeedCapability();
}
- }
+ }
- void result(const LLSD& content)
- {
+ /* virtual */ void httpSuccess()
+ {
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
if(!regionp) //region was removed
{
- LL_WARNS2("AppInit", "Capabilities") << "Received results for region that no longer exists!" << LL_ENDL;
+ LL_WARNS("AppInit", "Capabilities") << "Received results for region that no longer exists!" << LL_ENDL;
return ;
}
if( mID != regionp->getHttpResponderID() ) // region is no longer referring to this responder
{
- LL_WARNS2("AppInit", "Capabilities") << "Received results for a stale http responder!" << LL_ENDL;
+ LL_WARNS("AppInit", "Capabilities") << "Received results for a stale http responder!" << LL_ENDL;
regionp->failedSeedCapability();
return ;
}
+ const LLSD& content = getContent();
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
LLSD::map_const_iterator iter;
for(iter = content.beginMap(); iter != content.endMap(); ++iter)
{
regionp->setCapability(iter->first, iter->second);
-
- LL_DEBUGS2("AppInit", "Capabilities") << "got capability for "
- << iter->first << LL_ENDL;
+
+ LL_DEBUGS("AppInit", "Capabilities")
+ << "Capability '" << iter->first << "' is '" << iter->second << "'" << LL_ENDL;
/* HACK we're waiting for the ServerReleaseNotes */
if (iter->first == "ServerReleaseNotes" && regionp->getReleaseNotesRequested())
@@ -259,11 +303,6 @@ public:
}
}
- static BaseCapabilitiesComplete* build( U64 region_handle, S32 id )
- {
- return new BaseCapabilitiesComplete(region_handle, id);
- }
-
private:
U64 mRegionHandle;
S32 mID;
@@ -280,54 +319,81 @@ public:
virtual ~BaseCapabilitiesCompleteTracker()
{ }
- void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content)
+ static BaseCapabilitiesCompleteTracker* build( U64 region_handle )
{
- llwarns << "BaseCapabilitiesCompleteTracker error [status:"
- << statusNum << "]: " << content << llendl;
+ return new BaseCapabilitiesCompleteTracker( region_handle );
}
- void result(const LLSD& content)
+private:
+ /* virtual */ void httpFailure()
+ {
+ LL_WARNS() << dumpResponse() << LL_ENDL;
+ }
+
+ /* virtual */ void httpSuccess()
{
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
if( !regionp )
{
+ LL_WARNS("AppInit", "Capabilities") << "Received results for region that no longer exists!" << LL_ENDL;
return ;
- }
+ }
+
+ const LLSD& content = getContent();
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
LLSD::map_const_iterator iter;
for(iter = content.beginMap(); iter != content.endMap(); ++iter)
{
regionp->setCapabilityDebug(iter->first, iter->second);
- //llinfos<<"BaseCapabilitiesCompleteTracker New Caps "<<iter->first<<" "<< iter->second<<llendl;
+ //LL_INFOS()<<"BaseCapabilitiesCompleteTracker New Caps "<<iter->first<<" "<< iter->second<<LL_ENDL;
}
if ( regionp->getRegionImpl()->mCapabilities.size() != regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() )
{
- llinfos << "BaseCapabilitiesCompleteTracker " << "sim " << regionp->getName()
- << " sent duplicate seed caps that differs in size - most likely content. "
- << (S32) regionp->getRegionImpl()->mCapabilities.size() << " vs " << regionp->getRegionImpl()->mSecondCapabilitiesTracker.size()
- << llendl;
-
- //todo#add cap debug versus original check?
- /*
- CapabilityMap::const_iterator iter = regionp->getRegionImpl()->mCapabilities.begin();
- while (iter!=regionp->getRegionImpl()->mCapabilities.end() )
+ LL_WARNS("AppInit", "Capabilities")
+ << "Sim sent duplicate base caps that differ in size from what we initially received - most likely content. "
+ << "mCapabilities == " << regionp->getRegionImpl()->mCapabilities.size()
+ << " mSecondCapabilitiesTracker == " << regionp->getRegionImpl()->mSecondCapabilitiesTracker.size()
+ << LL_ENDL;
+#ifdef DEBUG_CAPS_GRANTS
+ LL_WARNS("AppInit", "Capabilities")
+ << "Initial Base capabilities: " << LL_ENDL;
+
+ log_capabilities(regionp->getRegionImpl()->mCapabilities);
+
+ LL_WARNS("AppInit", "Capabilities")
+ << "Latest base capabilities: " << LL_ENDL;
+
+ log_capabilities(regionp->getRegionImpl()->mSecondCapabilitiesTracker);
+
+#endif
+
+ if (regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() > regionp->getRegionImpl()->mCapabilities.size() )
{
- llinfos << "BaseCapabilitiesCompleteTracker Original " << iter->first << " " << iter->second<<llendl;
- ++iter;
+ // *HACK Since we were granted more base capabilities in this grant request than the initial, replace
+ // the old with the new. This shouldn't happen i.e. we should always get the same capabilities from a
+ // sim. The simulator fix from SH-3895 should prevent it from happening, at least in the case of the
+ // inventory api capability grants.
+
+ // Need to clear a std::map before copying into it because old keys take precedence.
+ regionp->getRegionImplNC()->mCapabilities.clear();
+ regionp->getRegionImplNC()->mCapabilities = regionp->getRegionImpl()->mSecondCapabilitiesTracker;
}
- */
- regionp->getRegionImplNC()->mSecondCapabilitiesTracker.clear();
}
-
+ else
+ {
+ LL_DEBUGS("CrossingCaps") << "Sim sent multiple base cap grants with matching sizes." << LL_ENDL;
+ }
+ regionp->getRegionImplNC()->mSecondCapabilitiesTracker.clear();
}
- static BaseCapabilitiesCompleteTracker* build( U64 region_handle )
- {
- return new BaseCapabilitiesCompleteTracker( region_handle );
- }
private:
- U64 mRegionHandle;
+ U64 mRegionHandle;
};
@@ -347,7 +413,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
mSimAccess( SIM_ACCESS_MIN ),
mBillableFactor(1.0),
mMaxTasks(DEFAULT_MAX_REGION_WIDE_PRIM_COUNT),
- mCentralBakeVersion(0),
+ mCentralBakeVersion(1),
mClassID(0),
mCPURatio(0),
mColoName("unknown"),
@@ -357,7 +423,13 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
mCacheLoaded(FALSE),
mCacheDirty(FALSE),
mReleaseNotesRequested(FALSE),
- mCapabilitiesReceived(false)
+ mCapabilitiesReceived(false),
+ mBitsReceived(0.f),
+ mPacketsReceived(0.f),
+ mDead(FALSE),
+ mLastVisitedEntry(NULL),
+ mInvisibilityCheckHistory(-1),
+ mPaused(FALSE)
{
mWidth = region_width_meters;
mImpl->mOriginGlobal = from_region_handle(handle);
@@ -389,17 +461,19 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
//create object partitions
//MUST MATCH declaration of eObjectPartitions
- mImpl->mObjectPartition.push_back(new LLHUDPartition()); //PARTITION_HUD
- mImpl->mObjectPartition.push_back(new LLTerrainPartition()); //PARTITION_TERRAIN
- mImpl->mObjectPartition.push_back(new LLVoidWaterPartition()); //PARTITION_VOIDWATER
- mImpl->mObjectPartition.push_back(new LLWaterPartition()); //PARTITION_WATER
- mImpl->mObjectPartition.push_back(new LLTreePartition()); //PARTITION_TREE
- mImpl->mObjectPartition.push_back(new LLParticlePartition()); //PARTITION_PARTICLE
- mImpl->mObjectPartition.push_back(new LLGrassPartition()); //PARTITION_GRASS
- mImpl->mObjectPartition.push_back(new LLVolumePartition()); //PARTITION_VOLUME
- mImpl->mObjectPartition.push_back(new LLBridgePartition()); //PARTITION_BRIDGE
- mImpl->mObjectPartition.push_back(new LLHUDParticlePartition());//PARTITION_HUD_PARTICLE
- mImpl->mObjectPartition.push_back(NULL); //PARTITION_NONE
+ mImpl->mObjectPartition.push_back(new LLHUDPartition(this)); //PARTITION_HUD
+ mImpl->mObjectPartition.push_back(new LLTerrainPartition(this)); //PARTITION_TERRAIN
+ mImpl->mObjectPartition.push_back(new LLVoidWaterPartition(this)); //PARTITION_VOIDWATER
+ mImpl->mObjectPartition.push_back(new LLWaterPartition(this)); //PARTITION_WATER
+ mImpl->mObjectPartition.push_back(new LLTreePartition(this)); //PARTITION_TREE
+ mImpl->mObjectPartition.push_back(new LLParticlePartition(this)); //PARTITION_PARTICLE
+ mImpl->mObjectPartition.push_back(new LLGrassPartition(this)); //PARTITION_GRASS
+ mImpl->mObjectPartition.push_back(new LLVolumePartition(this)); //PARTITION_VOLUME
+ mImpl->mObjectPartition.push_back(new LLBridgePartition(this)); //PARTITION_BRIDGE
+ mImpl->mObjectPartition.push_back(new LLHUDParticlePartition(this));//PARTITION_HUD_PARTICLE
+ mImpl->mObjectPartition.push_back(new LLVOCachePartition(this)); //PARTITION_VO_CACHE
+ mImpl->mObjectPartition.push_back(NULL); //PARTITION_NONE
+ mImpl->mVOCachePartition = getVOCachePartition();
mRenderInfoRequestTimer.resetWithExpiry(0.f); // Set timer to be expired
setCapabilitiesReceivedCallback(boost::bind(&LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer, _1));
@@ -410,19 +484,25 @@ void LLViewerRegion::initStats()
{
mImpl->mLastNetUpdate.reset();
mPacketsIn = 0;
- mBitsIn = 0;
- mLastBitsIn = 0;
+ mBitsIn = (U32Bits)0;
+ mLastBitsIn = (U32Bits)0;
mLastPacketsIn = 0;
mPacketsOut = 0;
mLastPacketsOut = 0;
mPacketsLost = 0;
mLastPacketsLost = 0;
- mPingDelay = 0;
+ mPingDelay = (U32Seconds)0;
mAlive = false; // can become false if circuit disconnects
}
LLViewerRegion::~LLViewerRegion()
{
+ mDead = TRUE;
+ mImpl->mActiveSet.clear();
+ mImpl->mVisibleEntries.clear();
+ mImpl->mVisibleGroups.clear();
+ mImpl->mWaitingSet.clear();
+
gVLManager.cleanupData(this);
// Can't do this on destruction, because the neighbor pointers might be invalid.
// This should be reference counted...
@@ -437,10 +517,10 @@ LLViewerRegion::~LLViewerRegion()
delete mImpl->mEventPoll;
LLHTTPSender::clearSender(mImpl->mHost);
- saveObjectCache();
-
std::for_each(mImpl->mObjectPartition.begin(), mImpl->mObjectPartition.end(), DeletePointer());
+ saveObjectCache();
+
delete mImpl;
mImpl = NULL;
}
@@ -481,9 +561,13 @@ void LLViewerRegion::loadObjectCache()
// Presume success. If it fails, we don't want to try again.
mCacheLoaded = TRUE;
- if(LLVOCache::hasInstance())
+ if(LLVOCache::instanceExists())
{
LLVOCache::getInstance()->readFromCache(mHandle, mImpl->mCacheID, mImpl->mCacheMap) ;
+ if (mImpl->mCacheMap.empty())
+ {
+ mCacheDirty = TRUE;
+ }
}
}
@@ -500,16 +584,15 @@ void LLViewerRegion::saveObjectCache()
return;
}
- if(LLVOCache::hasInstance())
+ if(LLVOCache::instanceExists())
{
- LLVOCache::getInstance()->writeToCache(mHandle, mImpl->mCacheID, mImpl->mCacheMap, mCacheDirty) ;
+ const F32 start_time_threshold = 600.0f; //seconds
+ bool removal_enabled = sVOCacheCullingEnabled && (mRegionTimer.getElapsedTimeF32() > start_time_threshold); //allow to remove invalid objects from object cache file.
+
+ LLVOCache::getInstance()->writeToCache(mHandle, mImpl->mCacheID, mImpl->mCacheMap, mCacheDirty, removal_enabled) ;
mCacheDirty = FALSE;
}
- for(LLVOCacheEntry::vocache_entry_map_t::iterator iter = mImpl->mCacheMap.begin(); iter != mImpl->mCacheMap.end(); ++iter)
- {
- delete iter->second;
- }
mImpl->mCacheMap.clear();
}
@@ -741,7 +824,7 @@ void LLViewerRegion::processRegionInfo(LLMessageSystem* msg, void**)
{
// send it to 'observers'
// *TODO: switch the floaters to using LLRegionInfoModel
- llinfos << "Processing region info" << llendl;
+ LL_INFOS() << "Processing region info" << LL_ENDL;
LLRegionInfoModel::instance().update(msg);
LLFloaterGodTools::processRegionInfo(msg);
LLFloaterRegionInfo::processRegionInfo(msg);
@@ -775,10 +858,459 @@ void LLViewerRegion::dirtyHeights()
}
}
-BOOL LLViewerRegion::idleUpdate(F32 max_update_time)
+//physically delete the cache entry
+void LLViewerRegion::killCacheEntry(LLVOCacheEntry* entry, bool for_rendering)
+{
+ if(!entry || !entry->isValid())
+ {
+ return;
+ }
+
+ if(for_rendering && !entry->isState(LLVOCacheEntry::ACTIVE))
+ {
+ addNewObject(entry); //force to add to rendering pipeline
+ }
+
+ //remove from active list and waiting list
+ if(entry->isState(LLVOCacheEntry::ACTIVE))
+ {
+ mImpl->mActiveSet.erase(entry);
+ }
+ else
+ {
+ if(entry->isState(LLVOCacheEntry::WAITING))
+ {
+ mImpl->mWaitingSet.erase(entry);
+ }
+
+ //remove from mVOCachePartition
+ removeFromVOCacheTree(entry);
+ }
+
+ //remove from the forced visible list
+ mImpl->mVisibleEntries.erase(entry);
+
+ //disconnect from parent if it is a child
+ if(entry->getParentID() > 0)
+ {
+ LLVOCacheEntry* parent = getCacheEntry(entry->getParentID());
+ if(parent)
+ {
+ parent->removeChild(entry);
+ }
+ }
+ else if(entry->getNumOfChildren() > 0)//remove children from cache if has any
+ {
+ LLVOCacheEntry* child = entry->getChild();
+ while(child != NULL)
+ {
+ killCacheEntry(child, for_rendering);
+ child = entry->getChild();
+ }
+ }
+
+ //will remove it from the object cache, real deletion
+ entry->setState(LLVOCacheEntry::INACTIVE);
+ entry->removeOctreeEntry();
+ entry->setValid(FALSE);
+}
+
+//physically delete the cache entry
+void LLViewerRegion::killCacheEntry(U32 local_id)
+{
+ killCacheEntry(getCacheEntry(local_id));
+}
+
+U32 LLViewerRegion::getNumOfActiveCachedObjects() const
+{
+ return mImpl->mActiveSet.size();
+}
+
+void LLViewerRegion::addActiveCacheEntry(LLVOCacheEntry* entry)
+{
+ if(!entry || mDead)
+ {
+ return;
+ }
+ if(entry->isState(LLVOCacheEntry::ACTIVE))
+ {
+ return; //already inserted.
+ }
+
+ if(entry->isState(LLVOCacheEntry::WAITING))
+ {
+ mImpl->mWaitingSet.erase(entry);
+ }
+
+ entry->setState(LLVOCacheEntry::ACTIVE);
+ entry->setVisible();
+
+ llassert(entry->getEntry()->hasDrawable());
+ mImpl->mActiveSet.insert(entry);
+}
+
+void LLViewerRegion::removeActiveCacheEntry(LLVOCacheEntry* entry, LLDrawable* drawablep)
+{
+ if(mDead || !entry || !entry->isValid())
+ {
+ return;
+ }
+ if(!entry->isState(LLVOCacheEntry::ACTIVE))
+ {
+ return; //not an active entry.
+ }
+
+ //shift to the local regional space from agent space
+ if(drawablep != NULL && drawablep->getVObj().notNull())
+ {
+ const LLVector3& pos = drawablep->getVObj()->getPositionRegion();
+ LLVector4a shift;
+ shift.load3(pos.mV);
+ shift.sub(entry->getPositionGroup());
+ entry->shift(shift);
+ }
+
+ if(entry->getParentID() > 0) //is a child
+ {
+ LLVOCacheEntry* parent = getCacheEntry(entry->getParentID());
+ if(parent)
+ {
+ parent->addChild(entry);
+ }
+ else //parent not in cache.
+ {
+ //this happens only when parent is not cacheable.
+ mOrphanMap[entry->getParentID()].push_back(entry->getLocalID());
+ }
+ }
+ else //insert to vo cache tree.
+ {
+ entry->updateParentBoundingInfo();
+ entry->saveBoundingSphere();
+ addToVOCacheTree(entry);
+ }
+
+ mImpl->mVisibleEntries.erase(entry);
+ mImpl->mActiveSet.erase(entry);
+ mImpl->mWaitingSet.erase(entry);
+ entry->setState(LLVOCacheEntry::INACTIVE);
+}
+
+bool LLViewerRegion::addVisibleGroup(LLViewerOctreeGroup* group)
+{
+ if(mDead || group->isEmpty())
+ {
+ return false;
+ }
+
+ mImpl->mVisibleGroups.insert(group);
+
+ return true;
+}
+
+U32 LLViewerRegion::getNumOfVisibleGroups() const
+{
+ return mImpl ? mImpl->mVisibleGroups.size() : 0;
+}
+
+void LLViewerRegion::addToVOCacheTree(LLVOCacheEntry* entry)
+{
+ if(!sVOCacheCullingEnabled)
+ {
+ return;
+ }
+
+ if(mDead || !entry || !entry->getEntry() || !entry->isValid())
+ {
+ return;
+ }
+ if(entry->getParentID() > 0)
+ {
+ return; //no child prim in cache octree.
+ }
+
+ if(entry->hasState(LLVOCacheEntry::IN_VO_TREE))
+ {
+ return; //already in the tree.
+ }
+
+ llassert_always(!entry->getGroup()); //not in octree.
+ llassert(!entry->getEntry()->hasDrawable()); //not have drawables
+
+ if(mImpl->mVOCachePartition->addEntry(entry->getEntry()))
+ {
+ entry->setState(LLVOCacheEntry::IN_VO_TREE);
+ }
+}
+
+void LLViewerRegion::removeFromVOCacheTree(LLVOCacheEntry* entry)
+{
+ if(mDead || !entry || !entry->getEntry())
+ {
+ return;
+ }
+
+ if(!entry->hasState(LLVOCacheEntry::IN_VO_TREE))
+ {
+ return; //not in the tree.
+ }
+ entry->clearState(LLVOCacheEntry::IN_VO_TREE);
+
+ mImpl->mVOCachePartition->removeEntry(entry->getEntry());
+}
+
+//add child objects as visible entries
+void LLViewerRegion::addVisibleChildCacheEntry(LLVOCacheEntry* parent, LLVOCacheEntry* child)
+{
+ if(mDead)
+ {
+ return;
+ }
+
+ if(parent && (!parent->isValid() || !parent->isState(LLVOCacheEntry::ACTIVE)))
+ {
+ return; //parent must be valid and in rendering pipeline
+ }
+
+ if(child && (!child->getEntry() || !child->isValid() || !child->isState(LLVOCacheEntry::INACTIVE)))
+ {
+ return; //child must be valid and not in the rendering pipeline
+ }
+
+ if(child)
+ {
+ child->setState(LLVOCacheEntry::IN_QUEUE);
+ mImpl->mVisibleEntries.insert(child);
+ }
+ else if(parent && parent->getNumOfChildren() > 0) //add all children
+ {
+ child = parent->getChild();
+ while(child != NULL)
+ {
+ addVisibleChildCacheEntry(NULL, child);
+ child = parent->getChild();
+ }
+ }
+}
+
+void LLViewerRegion::updateVisibleEntries(F32 max_time)
+{
+ if(mDead)
+ {
+ return;
+ }
+
+ if(mImpl->mVisibleGroups.empty() && mImpl->mVisibleEntries.empty())
+ {
+ return;
+ }
+
+ if(!sNewObjectCreationThrottle)
+ {
+ return;
+ }
+
+ const F32 LARGE_SCENE_CONTRIBUTION = 1000.f; //a large number to force to load the object.
+ const LLVector3 camera_origin = LLViewerCamera::getInstance()->getOrigin();
+ const U32 cur_frame = LLViewerOctreeEntryData::getCurrentFrame();
+ bool needs_update = ((cur_frame - mImpl->mLastCameraUpdate) > 5) && ((camera_origin - mImpl->mLastCameraOrigin).lengthSquared() > 10.f);
+ U32 last_update = mImpl->mLastCameraUpdate;
+ LLVector4a local_origin;
+ local_origin.load3((camera_origin - getOriginAgent()).mV);
+
+ //process visible entries
+ for(LLVOCacheEntry::vocache_entry_set_t::iterator iter = mImpl->mVisibleEntries.begin(); iter != mImpl->mVisibleEntries.end();)
+ {
+ LLVOCacheEntry* vo_entry = *iter;
+
+ if(vo_entry->isValid() && vo_entry->getState() < LLVOCacheEntry::WAITING)
+ {
+ //set a large number to force to load this object.
+ vo_entry->setSceneContribution(LARGE_SCENE_CONTRIBUTION);
+
+ mImpl->mWaitingList.insert(vo_entry);
+ ++iter;
+ }
+ else
+ {
+ LLVOCacheEntry::vocache_entry_set_t::iterator next_iter = iter;
+ ++next_iter;
+ mImpl->mVisibleEntries.erase(iter);
+ iter = next_iter;
+ }
+ }
+
+ //
+ //process visible groups
+ //
+ //object projected area threshold
+ F32 projection_threshold = LLVOCacheEntry::getSquaredPixelThreshold(mImpl->mVOCachePartition->isFrontCull());
+ F32 dist_threshold = mImpl->mVOCachePartition->isFrontCull() ? gAgentCamera.mDrawDistance : LLVOCacheEntry::sRearFarRadius;
+
+ std::set< LLPointer<LLViewerOctreeGroup> >::iterator group_iter = mImpl->mVisibleGroups.begin();
+ for(; group_iter != mImpl->mVisibleGroups.end(); ++group_iter)
+ {
+ LLPointer<LLViewerOctreeGroup> group = *group_iter;
+ if(group->getNumRefs() < 3 || //group to be deleted
+ !group->getOctreeNode() || group->isEmpty()) //group empty
+{
+ continue;
+ }
+
+ for (LLViewerOctreeGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
+ {
+ if((*i)->hasVOCacheEntry())
+ {
+ LLVOCacheEntry* vo_entry = (LLVOCacheEntry*)(*i)->getVOCacheEntry();
+
+ if(vo_entry->getParentID() > 0) //is a child
+ {
+ //child visibility depends on its parent.
+ continue;
+ }
+ if(!vo_entry->isValid())
+ {
+ continue; //skip invalid entry.
+ }
+
+ vo_entry->calcSceneContribution(local_origin, needs_update, last_update, dist_threshold);
+ if(vo_entry->getSceneContribution() > projection_threshold)
+ {
+ mImpl->mWaitingList.insert(vo_entry);
+ }
+ }
+ }
+ }
+
+ if(needs_update)
+ {
+ mImpl->mLastCameraOrigin = camera_origin;
+ mImpl->mLastCameraUpdate = cur_frame;
+ }
+
+ return;
+}
+
+void LLViewerRegion::createVisibleObjects(F32 max_time)
+{
+ if(mDead)
+ {
+ return;
+ }
+ if(mImpl->mWaitingList.empty())
+ {
+ mImpl->mVOCachePartition->setCullHistory(FALSE);
+ return;
+ }
+
+ S32 throttle = sNewObjectCreationThrottle;
+ BOOL has_new_obj = FALSE;
+ LLTimer update_timer;
+ for(LLVOCacheEntry::vocache_entry_priority_list_t::iterator iter = mImpl->mWaitingList.begin();
+ iter != mImpl->mWaitingList.end(); ++iter)
+ {
+ LLVOCacheEntry* vo_entry = *iter;
+
+ if(vo_entry->getState() < LLVOCacheEntry::WAITING)
+ {
+ addNewObject(vo_entry);
+ has_new_obj = TRUE;
+ if(throttle > 0 && !(--throttle) && update_timer.getElapsedTimeF32() > max_time)
+ {
+ break;
+ }
+ }
+ }
+
+ mImpl->mVOCachePartition->setCullHistory(has_new_obj);
+
+ return;
+}
+
+void LLViewerRegion::clearCachedVisibleObjects()
+{
+ mImpl->mWaitingList.clear();
+ mImpl->mVisibleGroups.clear();
+
+ //reset all occluders
+ mImpl->mVOCachePartition->resetOccluders();
+ mPaused = TRUE;
+
+ //clean visible entries
+ for(LLVOCacheEntry::vocache_entry_set_t::iterator iter = mImpl->mVisibleEntries.begin(); iter != mImpl->mVisibleEntries.end();)
+ {
+ LLVOCacheEntry* entry = *iter;
+ LLVOCacheEntry* parent = getCacheEntry(entry->getParentID());
+
+ if(!entry->getParentID() || parent) //no child or parent is cache-able
+ {
+ if(parent) //has a cache-able parent
+ {
+ parent->addChild(entry);
+ }
+
+ LLVOCacheEntry::vocache_entry_set_t::iterator next_iter = iter;
+ ++next_iter;
+ mImpl->mVisibleEntries.erase(iter);
+ iter = next_iter;
+ }
+ else //parent is not cache-able, leave it.
+ {
+ ++iter;
+ }
+ }
+
+ //remove all visible entries.
+ mLastVisitedEntry = NULL;
+ std::vector<LLDrawable*> delete_list;
+ for(LLVOCacheEntry::vocache_entry_set_t::iterator iter = mImpl->mActiveSet.begin();
+ iter != mImpl->mActiveSet.end(); ++iter)
+ {
+ LLDrawable* drawablep = (LLDrawable*)(*iter)->getEntry()->getDrawable();
+
+ if(drawablep && !drawablep->getParent())
+ {
+ delete_list.push_back(drawablep);
+ }
+ }
+
+ if(!delete_list.empty())
+ {
+ for(S32 i = 0; i < delete_list.size(); i++)
+ {
+ gObjectList.killObject(delete_list[i]->getVObj());
+ }
+ delete_list.clear();
+ }
+
+ return;
+}
+
+//perform some necessary but very light updates.
+//to replace the function idleUpdate(...) in case there is no enough time.
+void LLViewerRegion::lightIdleUpdate()
{
- // did_update returns TRUE if we did at least one significant update
- BOOL did_update = mImpl->mLandp->idleUpdate(max_update_time);
+ if(!sVOCacheCullingEnabled)
+ {
+ return;
+ }
+ if(mImpl->mCacheMap.empty())
+ {
+ return;
+ }
+
+ //reset all occluders
+ mImpl->mVOCachePartition->resetOccluders();
+}
+
+void LLViewerRegion::idleUpdate(F32 max_update_time)
+{
+ LLTimer update_timer;
+ F32 max_time;
+
+ mLastUpdate = LLViewerOctreeEntryData::getCurrentFrame();
+
+ mImpl->mLandp->idleUpdate(max_update_time);
if (mParcelOverlay)
{
@@ -786,9 +1318,276 @@ BOOL LLViewerRegion::idleUpdate(F32 max_update_time)
mParcelOverlay->idleUpdate();
}
- return did_update;
+ if(!sVOCacheCullingEnabled)
+ {
+ return;
+ }
+ if(mImpl->mCacheMap.empty())
+ {
+ return;
+ }
+ if(mPaused)
+ {
+ mPaused = FALSE; //unpause.
+ }
+
+ LLViewerCamera::eCameraID old_camera_id = LLViewerCamera::sCurCameraID;
+ LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
+
+ //reset all occluders
+ mImpl->mVOCachePartition->resetOccluders();
+
+ max_time = max_update_time - update_timer.getElapsedTimeF32();
+
+ //kill invisible objects
+ killInvisibleObjects(max_time * 0.4f);
+ max_time = max_update_time - update_timer.getElapsedTimeF32();
+
+ updateVisibleEntries(max_time);
+ max_time = max_update_time - update_timer.getElapsedTimeF32();
+
+ createVisibleObjects(max_time);
+
+ mImpl->mWaitingList.clear();
+ mImpl->mVisibleGroups.clear();
+
+ LLViewerCamera::sCurCameraID = old_camera_id;
+ return;
}
+//update the throttling number for new object creation
+void LLViewerRegion::calcNewObjectCreationThrottle()
+{
+ static LLCachedControl<S32> new_object_creation_throttle(gSavedSettings,"NewObjectCreationThrottle");
+ static LLCachedControl<F32> throttle_delay_time(gSavedSettings,"NewObjectCreationThrottleDelayTime");
+ static LLFrameTimer timer;
+
+ //
+ //sNewObjectCreationThrottle =
+ //-2: throttle is disabled because either the screen is showing progress view, or immediate after the screen is not black
+ //-1: throttle is disabled by the debug setting
+ //0: no new object creation is allowed
+ //>0: valid throttling number
+ //
+
+ if(gViewerWindow->getProgressView()->getVisible() && throttle_delay_time > 0.f)
+ {
+ sNewObjectCreationThrottle = -2; //cancel the throttling
+ timer.reset();
+ }
+ else if(sNewObjectCreationThrottle < -1) //just recoved from the login/teleport screen
+ {
+ if(timer.getElapsedTimeF32() > throttle_delay_time) //wait for throttle_delay_time to reset the throttle
+ {
+ sNewObjectCreationThrottle = new_object_creation_throttle; //reset
+ if(sNewObjectCreationThrottle < -1)
+ {
+ sNewObjectCreationThrottle = -1;
+ }
+ }
+ }
+
+ //update some LLVOCacheEntry debug setting factors.
+ LLVOCacheEntry::updateDebugSettings();
+}
+
+BOOL LLViewerRegion::isViewerCameraStatic()
+{
+ return sLastCameraUpdated < LLViewerOctreeEntryData::getCurrentFrame();
+}
+
+void LLViewerRegion::killInvisibleObjects(F32 max_time)
+{
+ if(!sVOCacheCullingEnabled)
+ {
+ return;
+ }
+ if(mImpl->mActiveSet.empty())
+ {
+ return;
+ }
+ if(sNewObjectCreationThrottle < 0)
+ {
+ return;
+ }
+
+ LLTimer update_timer;
+ LLVector4a camera_origin;
+ camera_origin.load3(LLViewerCamera::getInstance()->getOrigin().mV);
+ LLVector4a local_origin;
+ local_origin.load3((LLViewerCamera::getInstance()->getOrigin() - getOriginAgent()).mV);
+ F32 back_threshold = LLVOCacheEntry::sRearFarRadius;
+
+ size_t max_update = 64;
+ if(!mInvisibilityCheckHistory && isViewerCameraStatic())
+ {
+ //history is clean, reduce number of checking
+ max_update /= 2;
+ }
+
+ std::vector<LLDrawable*> delete_list;
+ S32 update_counter = llmin(max_update, mImpl->mActiveSet.size());
+ LLVOCacheEntry::vocache_entry_set_t::iterator iter = mImpl->mActiveSet.upper_bound(mLastVisitedEntry);
+
+ for(; update_counter > 0; --update_counter, ++iter)
+ {
+ if(iter == mImpl->mActiveSet.end())
+ {
+ iter = mImpl->mActiveSet.begin();
+ }
+ if((*iter)->getParentID() > 0)
+ {
+ continue; //skip child objects, they are removed with their parent.
+ }
+
+ LLVOCacheEntry* vo_entry = *iter;
+ if(!vo_entry->isAnyVisible(camera_origin, local_origin, back_threshold) && vo_entry->mLastCameraUpdated < sLastCameraUpdated)
+ {
+ killObject(vo_entry, delete_list);
+ }
+
+ if(max_time < update_timer.getElapsedTimeF32()) //time out
+ {
+ break;
+ }
+ }
+
+ if(iter == mImpl->mActiveSet.end())
+ {
+ mLastVisitedEntry = NULL;
+ }
+ else
+ {
+ mLastVisitedEntry = *iter;
+ }
+
+ mInvisibilityCheckHistory <<= 1;
+ if(!delete_list.empty())
+ {
+ mInvisibilityCheckHistory |= 1;
+ S32 count = delete_list.size();
+ for(S32 i = 0; i < count; i++)
+ {
+ gObjectList.killObject(delete_list[i]->getVObj());
+ }
+ delete_list.clear();
+ }
+
+ return;
+}
+
+void LLViewerRegion::killObject(LLVOCacheEntry* entry, std::vector<LLDrawable*>& delete_list)
+{
+ //kill the object.
+ LLDrawable* drawablep = (LLDrawable*)entry->getEntry()->getDrawable();
+ llassert(drawablep);
+ llassert(drawablep->getRegion() == this);
+
+ if(drawablep && !drawablep->getParent())
+ {
+ LLViewerObject::const_child_list_t& child_list = drawablep->getVObj()->getChildren();
+ for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
+ iter != child_list.end(); iter++)
+ {
+ LLViewerObject* child = *iter;
+ if(child->mDrawable)
+ {
+ if(!child->mDrawable->getEntry() || !child->mDrawable->getEntry()->hasVOCacheEntry())
+ {
+ //do not remove parent if any of its children non-cacheable
+ //especially for the case that an avatar sits on a cache-able object
+ ((LLViewerOctreeEntryData*)drawablep)->setVisible();
+ return;
+ }
+
+ LLOcclusionCullingGroup* group = (LLOcclusionCullingGroup*)child->mDrawable->getGroup();
+ if(group && group->isAnyRecentlyVisible())
+ {
+ //set the parent visible if any of its children visible.
+ ((LLViewerOctreeEntryData*)drawablep)->setVisible();
+ return;
+ }
+ }
+ }
+ delete_list.push_back(drawablep);
+ }
+}
+
+LLViewerObject* LLViewerRegion::addNewObject(LLVOCacheEntry* entry)
+{
+ if(!entry || !entry->getEntry())
+ {
+ if(entry)
+ {
+ mImpl->mVisibleEntries.erase(entry);
+ entry->setState(LLVOCacheEntry::INACTIVE);
+ }
+ return NULL;
+ }
+
+ LLViewerObject* obj = NULL;
+ if(!entry->getEntry()->hasDrawable()) //not added to the rendering pipeline yet
+ {
+ //add the object
+ obj = gObjectList.processObjectUpdateFromCache(entry, this);
+ if(obj)
+ {
+ if(!entry->isState(LLVOCacheEntry::ACTIVE))
+ {
+ mImpl->mWaitingSet.insert(entry);
+ entry->setState(LLVOCacheEntry::WAITING);
+ }
+ }
+ }
+ else
+ {
+ LLViewerRegion* old_regionp = ((LLDrawable*)entry->getEntry()->getDrawable())->getRegion();
+ if(old_regionp != this)
+ {
+ //this object exists in two regions at the same time;
+ //this case can be safely ignored here because
+ //server should soon send update message to remove one region for this object.
+
+ LL_WARNS() << "Entry: " << entry->getLocalID() << " exists in two regions at the same time." << LL_ENDL;
+ return NULL;
+ }
+
+ LL_WARNS() << "Entry: " << entry->getLocalID() << " in rendering pipeline but not set to be active." << LL_ENDL;
+
+ //should not hit here any more, but does not hurt either, just put it back to active list
+ addActiveCacheEntry(entry);
+ }
+ return obj;
+}
+
+//update object cache if the object receives a full-update or terse update
+//update_type == EObjectUpdateType::OUT_TERSE_IMPROVED or EObjectUpdateType::OUT_FULL
+LLViewerObject* LLViewerRegion::updateCacheEntry(U32 local_id, LLViewerObject* objectp, U32 update_type)
+{
+ if(objectp && update_type != (U32)OUT_TERSE_IMPROVED)
+ {
+ return objectp; //no need to access cache
+ }
+
+ LLVOCacheEntry* entry = getCacheEntry(local_id);
+ if (!entry)
+ {
+ return objectp; //not in the cache, do nothing.
+ }
+ if(!objectp) //object not created
+ {
+ //create a new object from cache.
+ objectp = addNewObject(entry);
+ }
+
+ //remove from cache if terse update
+ if(update_type == (U32)OUT_TERSE_IMPROVED)
+ {
+ killCacheEntry(entry, true);
+ }
+
+ return objectp;
+}
// As above, but forcibly do the update.
void LLViewerRegion::forceUpdate()
@@ -966,9 +1765,8 @@ void LLViewerRegion::updateNetStats()
mPacketsLost = cdp->getPacketsLost();
mPingDelay = cdp->getPingDelay();
- mBitStat.addValue(mBitsIn - mLastBitsIn);
- mPacketsStat.addValue(mPacketsIn - mLastPacketsIn);
- mPacketsLostStat.addValue(mPacketsLost);
+ mBitsReceived += mBitsIn - mLastBitsIn;
+ mPacketsReceived += mPacketsIn - mLastPacketsIn;
}
@@ -977,7 +1775,7 @@ U32 LLViewerRegion::getPacketsLost() const
LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(mImpl->mHost);
if (!cdp)
{
- llinfos << "LLViewerRegion::getPacketsLost couldn't find circuit for " << mImpl->mHost << llendl;
+ LL_INFOS() << "LLViewerRegion::getPacketsLost couldn't find circuit for " << mImpl->mHost << LL_ENDL;
return 0;
}
else
@@ -1090,14 +1888,14 @@ public:
S32 target_index = input["body"]["Index"][0]["Prey"].asInteger();
S32 you_index = input["body"]["Index"][0]["You" ].asInteger();
- LLDynamicArray<U32>* avatar_locs = &region->mMapAvatars;
- LLDynamicArray<LLUUID>* avatar_ids = &region->mMapAvatarIDs;
- avatar_locs->reset();
- avatar_ids->reset();
+ std::vector<U32>* avatar_locs = &region->mMapAvatars;
+ std::vector<LLUUID>* avatar_ids = &region->mMapAvatarIDs;
+ avatar_locs->clear();
+ avatar_ids->clear();
- //llinfos << "coarse locations agent[0] " << input["body"]["AgentData"][0]["AgentID"].asUUID() << llendl;
- //llinfos << "my agent id = " << gAgent.getID() << llendl;
- //llinfos << ll_pretty_print_sd(input) << llendl;
+ //LL_INFOS() << "coarse locations agent[0] " << input["body"]["AgentData"][0]["AgentID"].asUUID() << LL_ENDL;
+ //LL_INFOS() << "my agent id = " << gAgent.getID() << LL_ENDL;
+ //LL_INFOS() << ll_pretty_print_sd(input) << LL_ENDL;
LLSD
locs = input["body"]["Location"],
@@ -1133,13 +1931,13 @@ public:
pos |= y;
pos <<= 8;
pos |= z;
- avatar_locs->put(pos);
- //llinfos << "next pos: " << x << "," << y << "," << z << ": " << pos << llendl;
+ avatar_locs->push_back(pos);
+ //LL_INFOS() << "next pos: " << x << "," << y << "," << z << ": " << pos << LL_ENDL;
if(has_agent_data) // for backwards compatibility with old message format
{
LLUUID agent_id(agents_it->get("AgentID").asUUID());
- //llinfos << "next agent: " << agent_id.asString() << llendl;
- avatar_ids->put(agent_id);
+ //LL_INFOS() << "next agent: " << agent_id.asString() << LL_ENDL;
+ avatar_ids->push_back(agent_id);
}
}
if (has_agent_data)
@@ -1159,9 +1957,9 @@ LLHTTPRegistration<CoarseLocationUpdate>
// the deprecated coarse location handler
void LLViewerRegion::updateCoarseLocations(LLMessageSystem* msg)
{
- //llinfos << "CoarseLocationUpdate" << llendl;
- mMapAvatars.reset();
- mMapAvatarIDs.reset(); // only matters in a rare case but it's good to be safe.
+ //LL_INFOS() << "CoarseLocationUpdate" << LL_ENDL;
+ mMapAvatars.clear();
+ mMapAvatarIDs.clear(); // only matters in a rare case but it's good to be safe.
U8 x_pos = 0;
U8 y_pos = 0;
@@ -1187,9 +1985,9 @@ void LLViewerRegion::updateCoarseLocations(LLMessageSystem* msg)
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id, i);
}
- //llinfos << " object X: " << (S32)x_pos << " Y: " << (S32)y_pos
+ //LL_INFOS() << " object X: " << (S32)x_pos << " Y: " << (S32)y_pos
// << " Z: " << (S32)(z_pos * 4)
- // << llendl;
+ // << LL_ENDL;
// treat the target specially for the map
if(i == target_index)
@@ -1210,10 +2008,10 @@ void LLViewerRegion::updateCoarseLocations(LLMessageSystem* msg)
pos |= y_pos;
pos <<= 8;
pos |= z_pos;
- mMapAvatars.put(pos);
+ mMapAvatars.push_back(pos);
if(has_agent_data)
{
- mMapAvatarIDs.put(agent_id);
+ mMapAvatarIDs.push_back(agent_id);
}
}
}
@@ -1240,59 +2038,322 @@ void LLViewerRegion::setSimulatorFeatures(const LLSD& sim_features)
std::stringstream str;
LLSDSerialize::toPrettyXML(sim_features, str);
- llinfos << str.str() << llendl;
+ LL_INFOS() << str.str() << LL_ENDL;
mSimulatorFeatures = sim_features;
}
-LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp)
+//this is called when the parent is not cacheable.
+//move all orphan children out of cache and insert to rendering octree.
+void LLViewerRegion::findOrphans(U32 parent_id)
+{
+ orphan_list_t::iterator iter = mOrphanMap.find(parent_id);
+ if(iter != mOrphanMap.end())
+ {
+ std::vector<U32>* children = &mOrphanMap[parent_id];
+ for(S32 i = 0; i < children->size(); i++)
+ {
+ //parent is visible, so is the child.
+ addVisibleChildCacheEntry(NULL, getCacheEntry((*children)[i]));
+ }
+ children->clear();
+ mOrphanMap.erase(parent_id);
+ }
+}
+
+void LLViewerRegion::decodeBoundingInfo(LLVOCacheEntry* entry)
+{
+ if(!sVOCacheCullingEnabled)
+ {
+ gObjectList.processObjectUpdateFromCache(entry, this);
+ return;
+ }
+ if(!entry || !entry->isValid())
+ {
+ return;
+ }
+
+ if(!entry->getEntry())
+ {
+ entry->setOctreeEntry(NULL);
+ }
+
+ if(entry->getEntry()->hasDrawable()) //already in the rendering pipeline
+ {
+ LLViewerRegion* old_regionp = ((LLDrawable*)entry->getEntry()->getDrawable())->getRegion();
+ if(old_regionp != this && old_regionp)
+{
+ LLViewerObject* obj = ((LLDrawable*)entry->getEntry()->getDrawable())->getVObj();
+ if(obj)
+ {
+ //remove from old region
+ old_regionp->killCacheEntry(obj->getLocalID());
+
+ //change region
+ obj->setRegion(this);
+ }
+ }
+
+ addActiveCacheEntry(entry);
+
+ //set parent id
+ U32 parent_id = 0;
+ LLViewerObject::unpackParentID(entry->getDP(), parent_id);
+ if(parent_id != entry->getParentID())
+ {
+ entry->setParentID(parent_id);
+ }
+
+ //update the object
+ gObjectList.processObjectUpdateFromCache(entry, this);
+ return; //done
+ }
+
+ //must not be active.
+ llassert_always(!entry->isState(LLVOCacheEntry::ACTIVE));
+ removeFromVOCacheTree(entry); //remove from cache octree if it is in.
+
+ LLVector3 pos;
+ LLVector3 scale;
+ LLQuaternion rot;
+
+ //decode spatial info and parent info
+ U32 parent_id = LLViewerObject::extractSpatialExtents(entry->getDP(), pos, scale, rot);
+
+ U32 old_parent_id = entry->getParentID();
+ bool same_old_parent = false;
+ if(parent_id != old_parent_id) //parent changed.
+ {
+ if(old_parent_id > 0) //has an old parent, disconnect it
+ {
+ LLVOCacheEntry* old_parent = getCacheEntry(old_parent_id);
+ if(old_parent)
+ {
+ old_parent->removeChild(entry);
+ if(!old_parent->isState(LLVOCacheEntry::INACTIVE))
+ {
+ mImpl->mVisibleEntries.erase(entry);
+ entry->setState(LLVOCacheEntry::INACTIVE);
+ }
+ }
+ }
+ entry->setParentID(parent_id);
+ }
+ else
+ {
+ same_old_parent = true;
+ }
+
+ if(parent_id > 0) //has a new parent
+ {
+ //1, find the parent in cache
+ LLVOCacheEntry* parent = getCacheEntry(parent_id);
+
+ //2, parent is not in the cache, put into the orphan list.
+ if(!parent)
+ {
+ if(!same_old_parent)
+ {
+ //check if parent is non-cacheable and already created
+ if(isNonCacheableObjectCreated(parent_id))
+ {
+ //parent is visible, so is the child.
+ addVisibleChildCacheEntry(NULL, entry);
+ }
+ else
+ {
+ entry->setBoundingInfo(pos, scale);
+ mOrphanMap[parent_id].push_back(entry->getLocalID());
+ }
+ }
+ else
+ {
+ entry->setBoundingInfo(pos, scale);
+ }
+ }
+ else //parent in cache.
+ {
+ if(!parent->isState(LLVOCacheEntry::INACTIVE))
+ {
+ //parent is visible, so is the child.
+ addVisibleChildCacheEntry(parent, entry);
+ }
+ else
+ {
+ entry->setBoundingInfo(pos, scale);
+ parent->addChild(entry);
+
+ if(parent->getGroup()) //re-insert parent to vo-cache tree because its bounding info changed.
+ {
+ removeFromVOCacheTree(parent);
+ addToVOCacheTree(parent);
+ }
+ }
+ }
+
+ return;
+ }
+
+ //
+ //no parent
+ //
+ entry->setBoundingInfo(pos, scale);
+
+ if(!parent_id) //a potential parent
+ {
+ //find all children and update their bounding info
+ orphan_list_t::iterator iter = mOrphanMap.find(entry->getLocalID());
+ if(iter != mOrphanMap.end())
+ {
+ std::vector<U32>* orphans = &mOrphanMap[entry->getLocalID()];
+ S32 size = orphans->size();
+ for(S32 i = 0; i < size; i++)
+ {
+ LLVOCacheEntry* child = getCacheEntry((*orphans)[i]);
+ if(child)
+ {
+ entry->addChild(child);
+ }
+ }
+ orphans->clear();
+ mOrphanMap.erase(entry->getLocalID());
+ }
+ }
+
+ if(!entry->getGroup() && entry->isState(LLVOCacheEntry::INACTIVE))
+ {
+ addToVOCacheTree(entry);
+ }
+ return ;
+}
+
+LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLDataPackerBinaryBuffer &dp, U32 flags)
{
- U32 local_id = objectp->getLocalID();
- U32 crc = objectp->getCRC();
+ eCacheUpdateResult result;
+ U32 crc;
+ U32 local_id;
- LLVOCacheEntry* entry = get_if_there(mImpl->mCacheMap, local_id, (LLVOCacheEntry*)NULL);
+ LLViewerObject::unpackU32(&dp, local_id, "LocalID");
+ LLViewerObject::unpackU32(&dp, crc, "CRC");
+
+ LLVOCacheEntry* entry = getCacheEntry(local_id, false);
if (entry)
{
+ entry->setValid();
+
// we've seen this object before
if (entry->getCRC() == crc)
{
// Record a hit
entry->recordDupe();
- return CACHE_UPDATE_DUPE;
+ result = CACHE_UPDATE_DUPE;
}
+ else //CRC changed
+ {
+ // Update the cache entry
+ entry->updateEntry(crc, dp);
- // Update the cache entry
- mImpl->mCacheMap.erase(local_id);
- delete entry;
+ decodeBoundingInfo(entry);
+
+ result = CACHE_UPDATE_CHANGED;
+ }
+ }
+ else
+ {
+ // we haven't seen this object before
+ // Create new entry and add to map
+ result = CACHE_UPDATE_ADDED;
entry = new LLVOCacheEntry(local_id, crc, dp);
+ record(LLStatViewer::OBJECT_CACHE_HIT_RATE, LLUnits::Ratio::fromValue(0));
+
mImpl->mCacheMap[local_id] = entry;
- return CACHE_UPDATE_CHANGED;
+
+ decodeBoundingInfo(entry);
}
+ entry->setUpdateFlags(flags);
- // we haven't seen this object before
+ return result;
+ }
+
+LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp, U32 flags)
+{
+ eCacheUpdateResult result = cacheFullUpdate(dp, flags);
+
+ return result;
+}
- // Create new entry and add to map
- eCacheUpdateResult result = CACHE_UPDATE_ADDED;
- if (mImpl->mCacheMap.size() > MAX_OBJECT_CACHE_ENTRIES)
+LLVOCacheEntry* LLViewerRegion::getCacheEntryForOctree(U32 local_id)
+{
+ if(!sVOCacheCullingEnabled)
{
- delete mImpl->mCacheMap.begin()->second ;
- mImpl->mCacheMap.erase(mImpl->mCacheMap.begin());
- result = CACHE_UPDATE_REPLACED;
+ return NULL;
+ }
+
+ LLVOCacheEntry* entry = getCacheEntry(local_id);
+ removeFromVOCacheTree(entry);
+ return entry;
+}
+
+LLVOCacheEntry* LLViewerRegion::getCacheEntry(U32 local_id, bool valid)
+{
+ LLVOCacheEntry::vocache_entry_map_t::iterator iter = mImpl->mCacheMap.find(local_id);
+ if(iter != mImpl->mCacheMap.end())
+ {
+ if(!valid || iter->second->isValid())
+ {
+ return iter->second;
+ }
+ }
+ return NULL;
}
- entry = new LLVOCacheEntry(local_id, crc, dp);
- mImpl->mCacheMap[local_id] = entry;
- return result;
+void LLViewerRegion::addCacheMiss(U32 id, LLViewerRegion::eCacheMissType miss_type)
+{
+#if 0
+ mCacheMissList.insert(CacheMissItem(id, miss_type));
+#else
+ mCacheMissList.push_back(CacheMissItem(id, miss_type));
+#endif
+}
+
+//check if a non-cacheable object is already created.
+bool LLViewerRegion::isNonCacheableObjectCreated(U32 local_id)
+{
+ if(mImpl && local_id > 0 && mImpl->mNonCacheableCreatedList.find(local_id) != mImpl->mNonCacheableCreatedList.end())
+ {
+ return true;
+ }
+ return false;
+}
+
+void LLViewerRegion::removeFromCreatedList(U32 local_id)
+{
+ if(mImpl && local_id > 0)
+ {
+ std::set<U32>::iterator iter = mImpl->mNonCacheableCreatedList.find(local_id);
+ if(iter != mImpl->mNonCacheableCreatedList.end())
+ {
+ mImpl->mNonCacheableCreatedList.erase(iter);
+ }
+ }
+ }
+
+void LLViewerRegion::addToCreatedList(U32 local_id)
+{
+ if(mImpl && local_id > 0)
+ {
+ mImpl->mNonCacheableCreatedList.insert(local_id);
+ }
}
// Get data packer for this object, if we have cached data
// AND the CRC matches. JC
-LLDataPacker *LLViewerRegion::getDP(U32 local_id, U32 crc, U8 &cache_miss_type)
+bool LLViewerRegion::probeCache(U32 local_id, U32 crc, U32 flags, U8 &cache_miss_type)
{
//llassert(mCacheLoaded); This assert failes often, changing to early-out -- davep, 2010/10/18
- LLVOCacheEntry* entry = get_if_there(mImpl->mCacheMap, local_id, (LLVOCacheEntry*)NULL);
+ LLVOCacheEntry* entry = getCacheEntry(local_id, false);
if (entry)
{
@@ -1302,44 +2363,57 @@ LLDataPacker *LLViewerRegion::getDP(U32 local_id, U32 crc, U8 &cache_miss_type)
// Record a hit
entry->recordHit();
cache_miss_type = CACHE_MISS_TYPE_NONE;
- return entry->getDP(crc);
+ entry->setUpdateFlags(flags);
+
+ if(entry->isState(LLVOCacheEntry::ACTIVE))
+ {
+ ((LLDrawable*)entry->getEntry()->getDrawable())->getVObj()->loadFlags(flags);
+ return true;
+ }
+
+ if(entry->isValid())
+ {
+ return true; //already probed
+ }
+
+ entry->setValid();
+ decodeBoundingInfo(entry);
+ return true;
}
else
{
- // llinfos << "CRC miss for " << local_id << llendl;
- cache_miss_type = CACHE_MISS_TYPE_CRC;
- mCacheMissCRC.put(local_id);
+ // LL_INFOS() << "CRC miss for " << local_id << LL_ENDL;
+
+ addCacheMiss(local_id, CACHE_MISS_TYPE_CRC);
}
}
else
{
- // llinfos << "Cache miss for " << local_id << llendl;
- cache_miss_type = CACHE_MISS_TYPE_FULL;
- mCacheMissFull.put(local_id);
+ // LL_INFOS() << "Cache miss for " << local_id << LL_ENDL;
+ addCacheMiss(local_id, CACHE_MISS_TYPE_FULL);
}
- return NULL;
+ return false;
}
void LLViewerRegion::addCacheMissFull(const U32 local_id)
{
- mCacheMissFull.put(local_id);
+ addCacheMiss(local_id, CACHE_MISS_TYPE_FULL);
}
void LLViewerRegion::requestCacheMisses()
{
- S32 full_count = mCacheMissFull.count();
- S32 crc_count = mCacheMissCRC.count();
- if (full_count == 0 && crc_count == 0) return;
+ if (!mCacheMissList.size())
+ {
+ return;
+ }
LLMessageSystem* msg = gMessageSystem;
BOOL start_new_message = TRUE;
S32 blocks = 0;
- S32 i;
- // Send full cache miss updates. For these, we KNOW we don't
- // have a viewer object.
- for (i = 0; i < full_count; i++)
+ //send requests for all cache-missed objects
+ for (CacheMissItem::cache_miss_list_t::iterator iter = mCacheMissList.begin(); iter != mCacheMissList.end(); ++iter)
{
if (start_new_message)
{
@@ -1351,34 +2425,8 @@ void LLViewerRegion::requestCacheMisses()
}
msg->nextBlockFast(_PREHASH_ObjectData);
- msg->addU8Fast(_PREHASH_CacheMissType, CACHE_MISS_TYPE_FULL);
- msg->addU32Fast(_PREHASH_ID, mCacheMissFull[i]);
- blocks++;
-
- if (blocks >= 255)
- {
- sendReliableMessage();
- start_new_message = TRUE;
- blocks = 0;
- }
- }
-
- // Send CRC miss updates. For these, we _might_ have a viewer object,
- // but probably not.
- for (i = 0; i < crc_count; i++)
- {
- if (start_new_message)
- {
- msg->newMessageFast(_PREHASH_RequestMultipleObjects);
- msg->nextBlockFast(_PREHASH_AgentData);
- msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
- msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
- start_new_message = FALSE;
- }
-
- msg->nextBlockFast(_PREHASH_ObjectData);
- msg->addU8Fast(_PREHASH_CacheMissType, CACHE_MISS_TYPE_CRC);
- msg->addU32Fast(_PREHASH_ID, mCacheMissCRC[i]);
+ msg->addU8Fast(_PREHASH_CacheMissType, (*iter).mType);
+ msg->addU32Fast(_PREHASH_ID, (*iter).mID);
blocks++;
if (blocks >= 255)
@@ -1394,13 +2442,13 @@ void LLViewerRegion::requestCacheMisses()
{
sendReliableMessage();
}
- mCacheMissFull.reset();
- mCacheMissCRC.reset();
mCacheDirty = TRUE ;
- // llinfos << "KILLDEBUG Sent cache miss full " << full_count << " crc " << crc_count << llendl;
- LLViewerStatsRecorder::instance().requestCacheMissesEvent(full_count + crc_count);
+ // LL_INFOS() << "KILLDEBUG Sent cache miss full " << full_count << " crc " << crc_count << LL_ENDL;
+ LLViewerStatsRecorder::instance().requestCacheMissesEvent(mCacheMissList.size());
LLViewerStatsRecorder::instance().log(0.2f);
+
+ mCacheMissList.clear();
}
void LLViewerRegion::dumpCache()
@@ -1431,14 +2479,14 @@ void LLViewerRegion::dumpCache()
change_bin[changes]++;
}
- llinfos << "Count " << mImpl->mCacheMap.size() << llendl;
+ LL_INFOS() << "Count " << mImpl->mCacheMap.size() << LL_ENDL;
for (i = 0; i < BINS; i++)
{
- llinfos << "Hits " << i << " " << hit_bin[i] << llendl;
+ LL_INFOS() << "Hits " << i << " " << hit_bin[i] << LL_ENDL;
}
for (i = 0; i < BINS; i++)
{
- llinfos << "Changes " << i << " " << change_bin[i] << llendl;
+ LL_INFOS() << "Changes " << i << " " << change_bin[i] << LL_ENDL;
}
}
@@ -1523,40 +2571,69 @@ void LLViewerRegion::unpackRegionHandshake()
{
LLUUID tmp_id;
+ bool changed = false;
+
+ // Get the 4 textures for land
msg->getUUID("RegionInfo", "TerrainDetail0", tmp_id);
+ changed |= (tmp_id != compp->getDetailTextureID(0));
compp->setDetailTextureID(0, tmp_id);
+
msg->getUUID("RegionInfo", "TerrainDetail1", tmp_id);
+ changed |= (tmp_id != compp->getDetailTextureID(1));
compp->setDetailTextureID(1, tmp_id);
+
msg->getUUID("RegionInfo", "TerrainDetail2", tmp_id);
+ changed |= (tmp_id != compp->getDetailTextureID(2));
compp->setDetailTextureID(2, tmp_id);
+
msg->getUUID("RegionInfo", "TerrainDetail3", tmp_id);
+ changed |= (tmp_id != compp->getDetailTextureID(3));
compp->setDetailTextureID(3, tmp_id);
+ // Get the start altitude and range values for land textures
F32 tmp_f32;
msg->getF32("RegionInfo", "TerrainStartHeight00", tmp_f32);
+ changed |= (tmp_f32 != compp->getStartHeight(0));
compp->setStartHeight(0, tmp_f32);
+
msg->getF32("RegionInfo", "TerrainStartHeight01", tmp_f32);
+ changed |= (tmp_f32 != compp->getStartHeight(1));
compp->setStartHeight(1, tmp_f32);
+
msg->getF32("RegionInfo", "TerrainStartHeight10", tmp_f32);
+ changed |= (tmp_f32 != compp->getStartHeight(2));
compp->setStartHeight(2, tmp_f32);
+
msg->getF32("RegionInfo", "TerrainStartHeight11", tmp_f32);
+ changed |= (tmp_f32 != compp->getStartHeight(3));
compp->setStartHeight(3, tmp_f32);
+
msg->getF32("RegionInfo", "TerrainHeightRange00", tmp_f32);
+ changed |= (tmp_f32 != compp->getHeightRange(0));
compp->setHeightRange(0, tmp_f32);
+
msg->getF32("RegionInfo", "TerrainHeightRange01", tmp_f32);
+ changed |= (tmp_f32 != compp->getHeightRange(1));
compp->setHeightRange(1, tmp_f32);
+
msg->getF32("RegionInfo", "TerrainHeightRange10", tmp_f32);
+ changed |= (tmp_f32 != compp->getHeightRange(2));
compp->setHeightRange(2, tmp_f32);
+
msg->getF32("RegionInfo", "TerrainHeightRange11", tmp_f32);
+ changed |= (tmp_f32 != compp->getHeightRange(3));
compp->setHeightRange(3, tmp_f32);
// If this is an UPDATE (params already ready, we need to regenerate
// all of our terrain stuff, by
if (compp->getParamsReady())
{
- //this line creates frame stalls on region crossing and removing it appears to have no effect
- //getLand().dirtyAllPatches();
+ // Update if the land changed
+ if (changed)
+ {
+ getLand().dirtyAllPatches();
+ }
}
else
{
@@ -1578,12 +2655,27 @@ void LLViewerRegion::unpackRegionHandshake()
msg->addUUID("AgentID", gAgent.getID());
msg->addUUID("SessionID", gAgent.getSessionID());
msg->nextBlock("RegionInfo");
- msg->addU32("Flags", 0x0 );
+
+ U32 flags = 0;
+ flags |= REGION_HANDSHAKE_SUPPORTS_SELF_APPEARANCE;
+
+ if(sVOCacheCullingEnabled)
+ {
+ flags |= 0x00000001; //set the bit 0 to be 1 to ask sim to send all cacheable objects.
+ }
+ if(mImpl->mCacheMap.empty())
+ {
+ flags |= 0x00000002; //set the bit 1 to be 1 to tell sim the cache file is empty, no need to send cache probes.
+ }
+ msg->addU32("Flags", flags );
msg->sendReliable(host);
+
+ mRegionTimer.reset(); //reset region timer.
}
void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
{
+ capabilityNames.append("AgentPreferences");
capabilityNames.append("AgentState");
capabilityNames.append("AttachmentResources");
capabilityNames.append("AvatarPickerSearch");
@@ -1597,15 +2689,17 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
capabilityNames.append("EstateChangeInfo");
capabilityNames.append("EventQueueGet");
capabilityNames.append("FacebookConnect");
- //capabilityNames.append("FacebookRedirect");
+ capabilityNames.append("FlickrConnect");
+ capabilityNames.append("TwitterConnect");
if (gSavedSettings.getBOOL("UseHTTPInventory"))
- {
+ {
capabilityNames.append("FetchLib2");
capabilityNames.append("FetchLibDescendents2");
capabilityNames.append("FetchInventory2");
capabilityNames.append("FetchInventoryDescendents2");
capabilityNames.append("IncrementCOFVersion");
+ AISCommand::getCapabilityNames(capabilityNames);
}
capabilityNames.append("GetDisplayNames");
@@ -1614,13 +2708,15 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
capabilityNames.append("GetObjectCost");
capabilityNames.append("GetObjectPhysicsData");
capabilityNames.append("GetTexture");
+ capabilityNames.append("GroupAPIv1");
capabilityNames.append("GroupMemberData");
capabilityNames.append("GroupProposalBallot");
capabilityNames.append("HomeLocation");
capabilityNames.append("LandResources");
+ capabilityNames.append("LSLSyntax");
capabilityNames.append("MapLayer");
capabilityNames.append("MapLayerGod");
- capabilityNames.append("MeshUploadFlag");
+ capabilityNames.append("MeshUploadFlag");
capabilityNames.append("NavMeshGenerationStatus");
capabilityNames.append("NewFileAgentInventory");
capabilityNames.append("ObjectMedia");
@@ -1661,7 +2757,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
capabilityNames.append("ViewerMetrics");
capabilityNames.append("ViewerStartAuction");
capabilityNames.append("ViewerStats");
-
+
// Please add new capabilities alphabetically to reduce
// merge conflicts.
}
@@ -1669,8 +2765,11 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
void LLViewerRegion::setSeedCapability(const std::string& url)
{
if (getCapability("Seed") == url)
- {
- // llwarns << "Ignoring duplicate seed capability" << llendl;
+ {
+ setCapabilityDebug("Seed", url);
+ LL_DEBUGS("CrossingCaps") << "Received duplicate seed capability, posting to seed " <<
+ url << LL_ENDL;
+
//Instead of just returning we build up a second set of seed caps and compare them
//to the "original" seed cap received and determine why there is problem!
LLSD capabilityNames = LLSD::emptyArray();
@@ -1689,7 +2788,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
LLSD capabilityNames = LLSD::emptyArray();
mImpl->buildCapabilityNames(capabilityNames);
- llinfos << "posting to seed " << url << llendl;
+ LL_INFOS() << "posting to seed " << url << LL_ENDL;
S32 id = ++mImpl->mHttpResponderID;
LLHTTPClient::post(url, capabilityNames,
@@ -1709,7 +2808,7 @@ void LLViewerRegion::failedSeedCapability()
std::string url = getCapability("Seed");
if ( url.empty() )
{
- LL_WARNS2("AppInit", "Capabilities") << "Failed to get seed capabilities, and can not determine url for retries!" << LL_ENDL;
+ LL_WARNS("AppInit", "Capabilities") << "Failed to get seed capabilities, and can not determine url for retries!" << LL_ENDL;
return;
}
// After a few attempts, continue login. We will keep trying once in-world:
@@ -1724,8 +2823,8 @@ void LLViewerRegion::failedSeedCapability()
LLSD capabilityNames = LLSD::emptyArray();
mImpl->buildCapabilityNames(capabilityNames);
- llinfos << "posting to seed " << url << " (retry "
- << mImpl->mSeedCapAttempts << ")" << llendl;
+ LL_INFOS() << "posting to seed " << url << " (retry "
+ << mImpl->mSeedCapAttempts << ")" << LL_ENDL;
S32 id = ++mImpl->mHttpResponderID;
LLHTTPClient::post(url, capabilityNames,
@@ -1735,7 +2834,7 @@ void LLViewerRegion::failedSeedCapability()
else
{
// *TODO: Give a user pop-up about this error?
- LL_WARNS2("AppInit", "Capabilities") << "Failed to get seed capabilities from '" << url << "' after " << mImpl->mSeedCapAttempts << " attempts. Giving up!" << LL_ENDL;
+ LL_WARNS("AppInit", "Capabilities") << "Failed to get seed capabilities from '" << url << "' after " << mImpl->mSeedCapAttempts << " attempts. Giving up!" << LL_ENDL;
}
}
@@ -1743,41 +2842,46 @@ class SimulatorFeaturesReceived : public LLHTTPClient::Responder
{
LOG_CLASS(SimulatorFeaturesReceived);
public:
- SimulatorFeaturesReceived(const std::string& retry_url, U64 region_handle,
- S32 attempt = 0, S32 max_attempts = MAX_CAP_REQUEST_ATTEMPTS)
- : mRetryURL(retry_url), mRegionHandle(region_handle), mAttempt(attempt), mMaxAttempts(max_attempts)
- { }
-
-
- void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content)
- {
- LL_WARNS2("AppInit", "SimulatorFeatures") << "[status:" << statusNum << "]: " << content << LL_ENDL;
+ SimulatorFeaturesReceived(const std::string& retry_url, U64 region_handle,
+ S32 attempt = 0, S32 max_attempts = MAX_CAP_REQUEST_ATTEMPTS)
+ : mRetryURL(retry_url), mRegionHandle(region_handle), mAttempt(attempt), mMaxAttempts(max_attempts)
+ { }
+
+ /* virtual */ void httpFailure()
+ {
+ LL_WARNS("AppInit", "SimulatorFeatures") << dumpResponse() << LL_ENDL;
retry();
- }
+ }
- void result(const LLSD& content)
- {
+ /* virtual */ void httpSuccess()
+ {
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
if(!regionp) //region is removed or responder is not created.
{
- LL_WARNS2("AppInit", "SimulatorFeatures") << "Received results for region that no longer exists!" << LL_ENDL;
+ LL_WARNS("AppInit", "SimulatorFeatures")
+ << "Received results for region that no longer exists!" << LL_ENDL;
return ;
}
-
+
+ const LLSD& content = getContent();
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
regionp->setSimulatorFeatures(content);
}
-private:
void retry()
{
if (mAttempt < mMaxAttempts)
{
mAttempt++;
- LL_WARNS2("AppInit", "SimulatorFeatures") << "Re-trying '" << mRetryURL << "'. Retry #" << mAttempt << LL_ENDL;
+ LL_WARNS("AppInit", "SimulatorFeatures") << "Re-trying '" << mRetryURL << "'. Retry #" << mAttempt << LL_ENDL;
LLHTTPClient::get(mRetryURL, new SimulatorFeaturesReceived(*this), LLSD(), CAP_REQUEST_TIMEOUT);
}
}
-
+
std::string mRetryURL;
U64 mRegionHandle;
S32 mAttempt;
@@ -1814,7 +2918,16 @@ void LLViewerRegion::setCapability(const std::string& name, const std::string& u
void LLViewerRegion::setCapabilityDebug(const std::string& name, const std::string& url)
{
- mImpl->mSecondCapabilitiesTracker[name] = url;
+ // Continue to not add certain caps, as we do in setCapability. This is so they match up when we check them later.
+ if ( ! ( name == "EventQueueGet" || name == "UntrustedSimulatorMessage" || name == "SimulatorFeatures" ) )
+ {
+ mImpl->mSecondCapabilitiesTracker[name] = url;
+ if(name == "GetTexture")
+ {
+ mHttpUrl = url ;
+ }
+ }
+
}
bool LLViewerRegion::isSpecialCapabilityName(const std::string &name)
@@ -1826,7 +2939,7 @@ std::string LLViewerRegion::getCapability(const std::string& name) const
{
if (!capabilitiesReceived() && (name!=std::string("Seed")) && (name!=std::string("ObjectMedia")))
{
- llwarns << "getCapability called before caps received" << llendl;
+ LL_WARNS() << "getCapability called before caps received for " << name << LL_ENDL;
}
CapabilityMap::const_iterator iter = mImpl->mCapabilities.find(name);
@@ -1838,6 +2951,22 @@ std::string LLViewerRegion::getCapability(const std::string& name) const
return iter->second;
}
+bool LLViewerRegion::isCapabilityAvailable(const std::string& name) const
+{
+ if (!capabilitiesReceived() && (name!=std::string("Seed")) && (name!=std::string("ObjectMedia")))
+ {
+ LL_WARNS() << "isCapabilityAvailable called before caps received for " << name << LL_ENDL;
+ }
+
+ CapabilityMap::const_iterator iter = mImpl->mCapabilities.find(name);
+ if(iter == mImpl->mCapabilities.end())
+ {
+ return false;
+ }
+
+ return true;
+}
+
bool LLViewerRegion::capabilitiesReceived() const
{
return mCapabilitiesReceived;
@@ -1853,6 +2982,8 @@ void LLViewerRegion::setCapabilitiesReceived(bool received)
{
mCapabilitiesReceivedSignal(getRegionID());
+ LLFloaterPermsDefault::sendInitialPerms();
+
// This is a single-shot signal. Forget callbacks to save resources.
mCapabilitiesReceivedSignal.disconnect_all_slots();
}
@@ -1865,23 +2996,23 @@ boost::signals2::connection LLViewerRegion::setCapabilitiesReceivedCallback(cons
void LLViewerRegion::logActiveCapabilities() const
{
- int count = 0;
- CapabilityMap::const_iterator iter;
- for (iter = mImpl->mCapabilities.begin(); iter != mImpl->mCapabilities.end(); ++iter, ++count)
+ log_capabilities(mImpl->mCapabilities);
+}
+
+LLSpatialPartition* LLViewerRegion::getSpatialPartition(U32 type)
+{
+ if (type < mImpl->mObjectPartition.size() && type < PARTITION_VO_CACHE)
{
- if (!iter->second.empty())
- {
- llinfos << iter->first << " URL is " << iter->second << llendl;
- }
+ return (LLSpatialPartition*)mImpl->mObjectPartition[type];
}
- llinfos << "Dumped " << count << " entries." << llendl;
+ return NULL;
}
-LLSpatialPartition* LLViewerRegion::getSpatialPartition(U32 type)
+LLVOCachePartition* LLViewerRegion::getVOCachePartition()
{
- if (type < mImpl->mObjectPartition.size())
+ if(PARTITION_VO_CACHE < mImpl->mObjectPartition.size())
{
- return mImpl->mObjectPartition[type];
+ return (LLVOCachePartition*)mImpl->mObjectPartition[PARTITION_VO_CACHE];
}
return NULL;
}
@@ -1957,7 +3088,21 @@ bool LLViewerRegion::dynamicPathfindingEnabled() const
return ( mSimulatorFeatures.has("DynamicPathfindingEnabled") &&
mSimulatorFeatures["DynamicPathfindingEnabled"].asBoolean());
}
+/* Static Functions */
+void log_capabilities(const CapabilityMap &capmap)
+{
+ S32 count = 0;
+ CapabilityMap::const_iterator iter;
+ for (iter = capmap.begin(); iter != capmap.end(); ++iter, ++count)
+ {
+ if (!iter->second.empty())
+ {
+ LL_INFOS() << "log_capabilities: " << iter->first << " URL is " << iter->second << LL_ENDL;
+ }
+ }
+ LL_INFOS() << "log_capabilities: Dumped " << count << " entries." << LL_ENDL;
+}
void LLViewerRegion::resetMaterialsCapThrottle()
{
F32 requests_per_sec = 1.0f; // original default;
@@ -2002,3 +3147,4 @@ U32 LLViewerRegion::getMaxMaterialsPerTransaction() const
}
+
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index 8f8bfa23c1..1e225553b8 100755
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -32,9 +32,7 @@
#include <string>
#include <boost/signals2.hpp>
-#include "lldarray.h"
#include "llwind.h"
-#include "llstat.h"
#include "v3dmath.h"
#include "llstring.h"
#include "llregionflags.h"
@@ -50,6 +48,8 @@
#define WATER 2
const U32 MAX_OBJECT_CACHE_ENTRIES = 50000;
+// Region handshake flags
+const U32 REGION_HANDSHAKE_SUPPORTS_SELF_APPEARANCE = 1U << 2;
class LLEventPoll;
class LLVLComposition;
@@ -67,8 +67,11 @@ class LLDataPacker;
class LLDataPackerBinaryBuffer;
class LLHost;
class LLBBox;
-
+class LLSpatialGroup;
+class LLDrawable;
class LLViewerRegionImpl;
+class LLViewerOctreeGroup;
+class LLVOCachePartition;
class LLViewerRegion: public LLCapabilityProvider // implements this interface
{
@@ -86,6 +89,7 @@ public:
PARTITION_VOLUME,
PARTITION_BRIDGE,
PARTITION_HUD_PARTICLE,
+ PARTITION_VO_CACHE,
PARTITION_NONE,
NUM_PARTITIONS
} eObjectPartitions;
@@ -115,7 +119,7 @@ public:
void setAllowSetHome(BOOL b) { setRegionFlag(REGION_FLAGS_ALLOW_SET_HOME, b); }
void setResetHomeOnTeleport(BOOL b) { setRegionFlag(REGION_FLAGS_RESET_HOME_ON_TELEPORT, b); }
void setSunFixed(BOOL b) { setRegionFlag(REGION_FLAGS_SUN_FIXED, b); }
- void setBlockFly(BOOL b) { setRegionFlag(REGION_FLAGS_BLOCK_FLY, b); }
+ //void setBlockFly(BOOL b) { setRegionFlag(REGION_FLAGS_BLOCK_FLY, b); } Never used
void setAllowDirectTeleport(BOOL b) { setRegionFlag(REGION_FLAGS_ALLOW_DIRECT_TELEPORT, b); }
@@ -219,11 +223,21 @@ public:
// can process the message.
static void processRegionInfo(LLMessageSystem* msg, void**);
+ //check if the viewer camera is static
+ static BOOL isViewerCameraStatic();
+ static void calcNewObjectCreationThrottle();
+
void setCacheID(const LLUUID& id);
F32 getWidth() const { return mWidth; }
- BOOL idleUpdate(F32 max_update_time);
+ void idleUpdate(F32 max_update_time);
+ void lightIdleUpdate();
+ bool addVisibleGroup(LLViewerOctreeGroup* group);
+ void addVisibleChildCacheEntry(LLVOCacheEntry* parent, LLVOCacheEntry* child);
+ void addActiveCacheEntry(LLVOCacheEntry* entry);
+ void removeActiveCacheEntry(LLVOCacheEntry* entry, LLDrawable* drawablep);
+ void killCacheEntry(U32 local_id); //physically delete the cache entry
// Like idleUpdate, but forces everything to complete regardless of
// how long it takes.
@@ -243,6 +257,7 @@ public:
S32 getNumSeedCapRetries();
void setCapability(const std::string& name, const std::string& url);
void setCapabilityDebug(const std::string& name, const std::string& url);
+ bool isCapabilityAvailable(const std::string& name) const;
// implements LLCapabilityProvider
virtual std::string getCapability(const std::string& name) const;
@@ -316,11 +331,17 @@ public:
} eCacheUpdateResult;
// handle a full update message
- eCacheUpdateResult cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp);
- LLDataPacker *getDP(U32 local_id, U32 crc, U8 &cache_miss_type);
+ eCacheUpdateResult cacheFullUpdate(LLDataPackerBinaryBuffer &dp, U32 flags);
+ eCacheUpdateResult cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp, U32 flags);
+ LLVOCacheEntry* getCacheEntryForOctree(U32 local_id);
+ LLVOCacheEntry* getCacheEntry(U32 local_id, bool valid = true);
+ bool probeCache(U32 local_id, U32 crc, U32 flags, U8 &cache_miss_type);
void requestCacheMisses();
void addCacheMissFull(const U32 local_id);
-
+ //update object cache if the object receives a full-update or terse update
+ LLViewerObject* updateCacheEntry(U32 local_id, LLViewerObject* objectp, U32 update_type);
+ void findOrphans(U32 parent_id);
+ void clearCachedVisibleObjects();
void dumpCache();
void unpackRegionHandshake();
@@ -333,7 +354,10 @@ public:
virtual std::string getDescription() const;
std::string getHttpUrl() const { return mHttpUrl ;}
+ U32 getNumOfVisibleGroups() const;
+ U32 getNumOfActiveCachedObjects() const;
LLSpatialPartition* getSpatialPartition(U32 type);
+ LLVOCachePartition* getVOCachePartition();
bool objectIsReturnable(const LLVector3& pos, const std::vector<LLBBox>& boxes) const;
bool childrenObjectReturnable( const std::vector<LLBBox>& boxes ) const;
@@ -343,12 +367,35 @@ public:
void getNeighboringRegionsStatus( std::vector<S32>& regions );
const LLViewerRegionImpl * getRegionImpl() const { return mImpl; }
LLViewerRegionImpl * getRegionImplNC() { return mImpl; }
-
+
// implements the materials capability throttle
bool materialsCapThrottled() const { return !mMaterialsCapThrottleTimer.hasExpired(); }
void resetMaterialsCapThrottle();
U32 getMaxMaterialsPerTransaction() const;
+
+ void removeFromCreatedList(U32 local_id);
+ void addToCreatedList(U32 local_id);
+
+ BOOL isPaused() const {return mPaused;}
+ S32 getLastUpdate() const {return mLastUpdate;}
+
+ static BOOL isNewObjectCreationThrottleDisabled() {return sNewObjectCreationThrottle < 0;}
+
+private:
+ void addToVOCacheTree(LLVOCacheEntry* entry);
+ LLViewerObject* addNewObject(LLVOCacheEntry* entry);
+ void killObject(LLVOCacheEntry* entry, std::vector<LLDrawable*>& delete_list);
+ void removeFromVOCacheTree(LLVOCacheEntry* entry);
+ void killCacheEntry(LLVOCacheEntry* entry, bool for_rendering = false); //physically delete the cache entry
+ void killInvisibleObjects(F32 max_time);
+ void createVisibleObjects(F32 max_time);
+ void updateVisibleEntries(F32 max_time); //update visible entries
+
+ void addCacheMiss(U32 id, LLViewerRegion::eCacheMissType miss_type);
+ void decodeBoundingInfo(LLVOCacheEntry* entry);
+ bool isNonCacheableObjectCreated(U32 local_id);
+
public:
struct CompareDistance
{
@@ -368,9 +415,8 @@ public:
LLWind mWind;
LLViewerParcelOverlay *mParcelOverlay;
- LLStat mBitStat;
- LLStat mPacketsStat;
- LLStat mPacketsLostStat;
+ F32Bits mBitsReceived;
+ F32 mPacketsReceived;
LLMatrix4 mRenderMatrix;
@@ -379,17 +425,47 @@ public:
// messaging system in which the previous message only sends and parses the
// positions stored in the first array so they're maintained separately until
// we stop supporting the old CoarseLocationUpdate message.
- LLDynamicArray<U32> mMapAvatars;
- LLDynamicArray<LLUUID> mMapAvatarIDs;
+ std::vector<U32> mMapAvatars;
+ std::vector<LLUUID> mMapAvatarIDs;
+
+ static BOOL sVOCacheCullingEnabled; //vo cache culling enabled or not.
+ static S32 sLastCameraUpdated;
LLFrameTimer & getRenderInfoRequestTimer() { return mRenderInfoRequestTimer; };
+ struct CompareRegionByLastUpdate
+ {
+ bool operator()(const LLViewerRegion* const& lhs, const LLViewerRegion* const& rhs)
+ {
+ S32 lpa = lhs->getLastUpdate();
+ S32 rpa = rhs->getLastUpdate();
+
+ //small mLastUpdate first
+ if(lpa < rpa)
+ {
+ return true;
+ }
+ else if(lpa > rpa)
+ {
+ return false;
+ }
+ else
+ {
+ return lhs < rhs;
+ }
+ }
+ };
+ typedef std::set<LLViewerRegion*, CompareRegionByLastUpdate> region_priority_list_t;
+
private:
+ static S32 sNewObjectCreationThrottle;
LLViewerRegionImpl * mImpl;
+ LLFrameTimer mRegionTimer;
F32 mWidth; // Width of region on a side (meters)
U64 mHandle;
F32 mTimeDilation; // time dilation of physics simulation on simulator
+ S32 mLastUpdate; //last time called idleUpdate()
// simulator name
std::string mName;
@@ -399,14 +475,14 @@ private:
BOOL mIsEstateManager;
U32 mPacketsIn;
- U32 mBitsIn;
- U32 mLastBitsIn;
+ U32Bits mBitsIn,
+ mLastBitsIn;
U32 mLastPacketsIn;
U32 mPacketsOut;
U32 mLastPacketsOut;
S32 mPacketsLost;
S32 mLastPacketsLost;
- U32 mPingDelay;
+ U32Milliseconds mPingDelay;
F32 mDeltaTime; // Time since last measurement of lastPackets, Bits, etc
U64 mRegionFlags; // includes damage flags
@@ -417,6 +493,9 @@ private:
F32 mCameraDistanceSquared; // updated once per frame
U8 mCentralBakeVersion;
+ LLVOCacheEntry* mLastVisitedEntry;
+ U32 mInvisibilityCheckHistory;
+
// Information for Homestead / CR-53
S32 mClassID;
S32 mCPURatio;
@@ -431,16 +510,28 @@ private:
// a structure of size 2^14 = 16,000
BOOL mCacheLoaded;
BOOL mCacheDirty;
+ BOOL mAlive; // can become false if circuit disconnects
+ BOOL mCapabilitiesReceived;
+ BOOL mReleaseNotesRequested;
+ BOOL mDead; //if true, this region is in the process of deleting.
+ BOOL mPaused; //pause processing the objects in the region
- LLDynamicArray<U32> mCacheMissFull;
- LLDynamicArray<U32> mCacheMissCRC;
+ typedef std::map<U32, std::vector<U32> > orphan_list_t;
+ orphan_list_t mOrphanMap;
- bool mAlive; // can become false if circuit disconnects
- bool mCapabilitiesReceived;
- caps_received_signal_t mCapabilitiesReceivedSignal;
+ class CacheMissItem
+ {
+ public:
+ CacheMissItem(U32 id, LLViewerRegion::eCacheMissType miss_type) : mID(id), mType(miss_type){}
- BOOL mReleaseNotesRequested;
+ U32 mID; //local object id
+ LLViewerRegion::eCacheMissType mType; //cache miss type
+
+ typedef std::list<CacheMissItem> cache_miss_list_t;
+ };
+ CacheMissItem::cache_miss_list_t mCacheMissList;
+ caps_received_signal_t mCapabilitiesReceivedSignal;
LLSD mSimulatorFeatures;
// the materials capability throttle
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index e88b22b461..dafe2cafec 100755
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -52,6 +52,7 @@ static LLStaticHashedString sTexture0("texture0");
static LLStaticHashedString sTexture1("texture1");
static LLStaticHashedString sTex0("tex0");
static LLStaticHashedString sTex1("tex1");
+static LLStaticHashedString sDitherTex("dither_tex");
static LLStaticHashedString sGlowMap("glowMap");
static LLStaticHashedString sScreenMap("screenMap");
@@ -81,6 +82,8 @@ LLGLSLShader gGlowCombineProgram;
LLGLSLShader gSplatTextureRectProgram;
LLGLSLShader gGlowCombineFXAAProgram;
LLGLSLShader gTwoTextureAddProgram;
+LLGLSLShader gTwoTextureCompareProgram;
+LLGLSLShader gOneTextureFilterProgram;
LLGLSLShader gOneTextureNoColorProgram;
LLGLSLShader gDebugProgram;
LLGLSLShader gClipProgram;
@@ -352,6 +355,16 @@ LLViewerShaderMgr * LLViewerShaderMgr::instance()
return static_cast<LLViewerShaderMgr*>(sInstance);
}
+// static
+void LLViewerShaderMgr::releaseInstance()
+{
+ if (sInstance != NULL)
+ {
+ delete sInstance;
+ sInstance = NULL;
+ }
+}
+
void LLViewerShaderMgr::initAttribsAndUniforms(void)
{
if (mReservedAttribs.empty())
@@ -437,7 +450,7 @@ void LLViewerShaderMgr::setShaders()
// Shaders
LL_INFOS("ShaderLoading") << "\n~~~~~~~~~~~~~~~~~~\n Loading Shaders:\n~~~~~~~~~~~~~~~~~~" << LL_ENDL;
- LL_INFOS("ShaderLoading") << llformat("Using GLSL %d.%d", gGLManager.mGLSLVersionMajor, gGLManager.mGLSLVersionMinor) << llendl;
+ LL_INFOS("ShaderLoading") << llformat("Using GLSL %d.%d", gGLManager.mGLSLVersionMajor, gGLManager.mGLSLVersionMinor) << LL_ENDL;
for (S32 i = 0; i < SHADER_COUNT; i++)
{
@@ -693,6 +706,8 @@ void LLViewerShaderMgr::unloadShaders()
gSplatTextureRectProgram.unload();
gGlowCombineFXAAProgram.unload();
gTwoTextureAddProgram.unload();
+ gTwoTextureCompareProgram.unload();
+ gOneTextureFilterProgram.unload();
gOneTextureNoColorProgram.unload();
gSolidColorProgram.unload();
@@ -854,7 +869,7 @@ BOOL LLViewerShaderMgr::loadBasicShaders()
shaders.push_back( make_pair( "objects/indexedTextureV.glsl", 1 ) );
}
shaders.push_back( make_pair( "objects/nonindexedTextureV.glsl", 1 ) );
-
+
boost::unordered_map<std::string, std::string> attribs;
// We no longer have to bind the shaders to global glhandles, they are automatically added to a map now.
@@ -909,7 +924,7 @@ BOOL LLViewerShaderMgr::loadBasicShaders()
index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightFullbrightShinyF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) );
index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightShinyWaterF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) );
index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightFullbrightShinyWaterF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) );
-
+
for (U32 i = 0; i < shaders.size(); i++)
{
// Note usage of GL_FRAGMENT_SHADER_ARB
@@ -1264,7 +1279,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredBumpProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
success = gDeferredBumpProgram.createShader(NULL, NULL);
}
-
+
gDeferredMaterialProgram[1].mFeatures.hasLighting = false;
gDeferredMaterialProgram[5].mFeatures.hasLighting = false;
gDeferredMaterialProgram[9].mFeatures.hasLighting = false;
@@ -1869,7 +1884,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredAvatarAlphaProgram.mFeatures.calculatesLighting = true;
gDeferredAvatarAlphaProgram.mFeatures.hasLighting = true;
}
-
+
if (success)
{
gDeferredPostGammaCorrectProgram.mName = "Deferred Gamma Correction Post Process";
@@ -3110,6 +3125,40 @@ BOOL LLViewerShaderMgr::loadShadersInterface()
}
}
+#ifdef LL_WINDOWS
+ if (success)
+ {
+ gTwoTextureCompareProgram.mName = "Two Texture Compare Shader";
+ gTwoTextureCompareProgram.mShaderFiles.clear();
+ gTwoTextureCompareProgram.mShaderFiles.push_back(make_pair("interface/twotexturecompareV.glsl", GL_VERTEX_SHADER_ARB));
+ gTwoTextureCompareProgram.mShaderFiles.push_back(make_pair("interface/twotexturecompareF.glsl", GL_FRAGMENT_SHADER_ARB));
+ gTwoTextureCompareProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE];
+ success = gTwoTextureCompareProgram.createShader(NULL, NULL);
+ if (success)
+ {
+ gTwoTextureCompareProgram.bind();
+ gTwoTextureCompareProgram.uniform1i(sTex0, 0);
+ gTwoTextureCompareProgram.uniform1i(sTex1, 1);
+ gTwoTextureCompareProgram.uniform1i(sDitherTex, 2);
+ }
+ }
+
+ if (success)
+ {
+ gOneTextureFilterProgram.mName = "One Texture Filter Shader";
+ gOneTextureFilterProgram.mShaderFiles.clear();
+ gOneTextureFilterProgram.mShaderFiles.push_back(make_pair("interface/onetexturefilterV.glsl", GL_VERTEX_SHADER_ARB));
+ gOneTextureFilterProgram.mShaderFiles.push_back(make_pair("interface/onetexturefilterF.glsl", GL_FRAGMENT_SHADER_ARB));
+ gOneTextureFilterProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE];
+ success = gOneTextureFilterProgram.createShader(NULL, NULL);
+ if (success)
+ {
+ gOneTextureFilterProgram.bind();
+ gOneTextureFilterProgram.uniform1i(sTex0, 0);
+ }
+ }
+#endif
+
if (success)
{
gOneTextureNoColorProgram.mName = "One Texture No Color Shader";
diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h
index 53569ca7ab..923aa522ad 100755
--- a/indra/newview/llviewershadermgr.h
+++ b/indra/newview/llviewershadermgr.h
@@ -43,6 +43,7 @@ public:
// singleton pattern implementation
static LLViewerShaderMgr * instance();
+ static void releaseInstance();
void initAttribsAndUniforms(void);
void setShaders();
@@ -187,6 +188,10 @@ extern LLGLSLShader gBenchmarkProgram;
//output tex0[tc0] + tex1[tc1]
extern LLGLSLShader gTwoTextureAddProgram;
+//output tex0[tc0] - tex1[tc1]
+extern LLGLSLShader gTwoTextureCompareProgram;
+//discard some fragments based on user-set color tolerance
+extern LLGLSLShader gOneTextureFilterProgram;
extern LLGLSLShader gOneTextureNoColorProgram;
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
index 35bba4184e..f60829e9e8 100755
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -61,363 +61,251 @@
#include "llviewernetwork.h"
#include "llmeshrepository.h" //for LLMeshRepository::sBytesReceived
-
-class StatAttributes
+namespace LLStatViewer
{
-public:
- StatAttributes(const char* name,
- const BOOL enabled,
- const BOOL is_timer)
- : mName(name),
- mEnabled(enabled),
- mIsTimer(is_timer)
- {
- }
+
+LLTrace::CountStatHandle<> FPS("FPS", "Frames rendered"),
+ PACKETS_IN("Packets In", "Packets received"),
+ PACKETS_LOST("packetsloststat", "Packets lost"),
+ PACKETS_OUT("packetsoutstat", "Packets sent"),
+ TEXTURE_PACKETS("texturepacketsstat", "Texture data packets received"),
+ CHAT_COUNT("chatcount", "Chat messages sent"),
+ IM_COUNT("imcount", "IMs sent"),
+ OBJECT_CREATE("objectcreate", "Number of objects created"),
+ OBJECT_REZ("objectrez", "Object rez count"),
+ LOGIN_TIMEOUTS("logintimeouts", "Number of login attempts that timed out"),
+ LSL_SAVES("lslsaves", "Number of times user has saved a script"),
+ ANIMATION_UPLOADS("animationuploads", "Animations uploaded"),
+ FLY("fly", "Fly count"),
+ TELEPORT("teleport", "Teleport count"),
+ DELETE_OBJECT("deleteobject", "Objects deleted"),
+ SNAPSHOT("snapshot", "Snapshots taken"),
+ UPLOAD_SOUND("uploadsound", "Sounds uploaded"),
+ UPLOAD_TEXTURE("uploadtexture", "Textures uploaded"),
+ EDIT_TEXTURE("edittexture", "Changes to textures on objects"),
+ KILLED("killed", "Number of times killed"),
+ FRAMETIME_DOUBLED("frametimedoubled", "Ratio of frames 2x longer than previous"),
+ TEX_BAKES("texbakes", "Number of times avatar textures have been baked"),
+ TEX_REBAKES("texrebakes", "Number of times avatar textures have been forced to rebake"),
+ NUM_NEW_OBJECTS("numnewobjectsstat", "Number of objects in scene that were not previously in cache");
+
+LLTrace::CountStatHandle<LLUnit<F64, LLUnits::Kilotriangles> >
+ TRIANGLES_DRAWN("trianglesdrawnstat");
+
+LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Kilotriangles> >
+ TRIANGLES_DRAWN_PER_FRAME("trianglesdrawnperframestat");
+
+LLTrace::CountStatHandle<F64Kilobytes >
+ ACTIVE_MESSAGE_DATA_RECEIVED("activemessagedatareceived", "Message system data received on all active regions"),
+ LAYERS_NETWORK_DATA_RECEIVED("layersdatareceived", "Network data received for layer data (terrain)"),
+ OBJECT_NETWORK_DATA_RECEIVED("objectdatareceived", "Network data received for objects"),
+ ASSET_UDP_DATA_RECEIVED("assetudpdatareceived", "Network data received for assets (animations, sounds) over UDP message system"),
+ TEXTURE_NETWORK_DATA_RECEIVED("texturedatareceived", "Network data received for textures"),
+ MESSAGE_SYSTEM_DATA_IN("messagedatain", "Incoming message system network data"),
+ MESSAGE_SYSTEM_DATA_OUT("messagedataout", "Outgoing message system network data");
+
+LLTrace::CountStatHandle<F64Seconds >
+ SIM_20_FPS_TIME("sim20fpstime", "Seconds with sim FPS below 20"),
+ SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime", "Seconds with physics FPS below 20"),
+ LOSS_5_PERCENT_TIME("loss5percenttime", "Seconds with packet loss > 5%");
+
+SimMeasurement<> SIM_TIME_DILATION("simtimedilation", "Simulator time scale", LL_SIM_STAT_TIME_DILATION),
+ SIM_FPS("simfps", "Simulator framerate", LL_SIM_STAT_FPS),
+ SIM_PHYSICS_FPS("simphysicsfps", "Simulator physics framerate", LL_SIM_STAT_PHYSFPS),
+ SIM_AGENT_UPS("simagentups", "", LL_SIM_STAT_AGENTUPS),
+ SIM_SCRIPT_EPS("simscripteps", "", LL_SIM_STAT_SCRIPT_EPS),
+ SIM_SKIPPED_SILHOUETTE("simsimskippedsilhouettesteps", "", LL_SIM_STAT_SKIPPEDAISILSTEPS_PS),
+ SIM_MAIN_AGENTS("simmainagents", "Number of avatars in current region", LL_SIM_STAT_NUMAGENTMAIN),
+ SIM_CHILD_AGENTS("simchildagents", "Number of avatars in neighboring regions", LL_SIM_STAT_NUMAGENTCHILD),
+ SIM_OBJECTS("simobjects", "", LL_SIM_STAT_NUMTASKS),
+ SIM_ACTIVE_OBJECTS("simactiveobjects", "Number of scripted and/or mocing objects", LL_SIM_STAT_NUMTASKSACTIVE),
+ SIM_ACTIVE_SCRIPTS("simactivescripts", "Number of scripted objects", LL_SIM_STAT_NUMSCRIPTSACTIVE),
+ SIM_IN_PACKETS_PER_SEC("siminpps", "", LL_SIM_STAT_INPPS),
+ SIM_OUT_PACKETS_PER_SEC("simoutpps", "", LL_SIM_STAT_OUTPPS),
+ SIM_PENDING_DOWNLOADS("simpendingdownloads", "", LL_SIM_STAT_PENDING_DOWNLOADS),
+ SIM_PENDING_UPLOADS("simpendinguploads", "", LL_SIM_STAT_PENDING_UPLOADS),
+ SIM_PENDING_LOCAL_UPLOADS("simpendinglocaluploads", "", LL_SIM_STAT_PENDING_LOCAL_UPLOADS),
+ SIM_PHYSICS_PINNED_TASKS("physicspinnedtasks", "", LL_SIM_STAT_PHYSICS_PINNED_TASKS),
+ SIM_PHYSICS_LOD_TASKS("physicslodtasks", "", LL_SIM_STAT_PHYSICS_LOD_TASKS);
+
+SimMeasurement<LLUnit<F64, LLUnits::Percent> >
+ SIM_PERCENTAGE_SCRIPTS_RUN("simpctscriptsrun", "", LL_SIM_STAT_PCTSCRIPTSRUN),
+ SIM_SKIPPED_CHARACTERS_PERCENTAGE("simsimpctsteppedcharacters", "", LL_SIM_STAT_PCTSTEPPEDCHARACTERS);
+
+LLTrace::SampleStatHandle<> FPS_SAMPLE("fpssample"),
+ NUM_IMAGES("numimagesstat"),
+ NUM_RAW_IMAGES("numrawimagesstat"),
+ NUM_OBJECTS("numobjectsstat"),
+ NUM_ACTIVE_OBJECTS("numactiveobjectsstat"),
+ ENABLE_VBO("enablevbo", "Vertex Buffers Enabled"),
+ LIGHTING_DETAIL("lightingdetail", "Lighting Detail"),
+ VISIBLE_AVATARS("visibleavatars", "Visible Avatars"),
+ SHADER_OBJECTS("shaderobjects", "Object Shaders"),
+ DRAW_DISTANCE("drawdistance", "Draw Distance"),
+ PENDING_VFS_OPERATIONS("vfspendingoperations"),
+ WINDOW_WIDTH("windowwidth", "Window width"),
+ WINDOW_HEIGHT("windowheight", "Window height");
+
+LLTrace::SampleStatHandle<LLUnit<F32, LLUnits::Percent> >
+ PACKETS_LOST_PERCENT("packetslostpercentstat");
+
+static LLTrace::SampleStatHandle<bool>
+ CHAT_BUBBLES("chatbubbles", "Chat Bubbles Enabled");
+
+LLTrace::SampleStatHandle<F64Megabytes > GL_TEX_MEM("gltexmemstat"),
+ GL_BOUND_MEM("glboundmemstat"),
+ RAW_MEM("rawmemstat"),
+ FORMATTED_MEM("formattedmemstat");
+LLTrace::SampleStatHandle<F64Kilobytes > DELTA_BANDWIDTH("deltabandwidth", "Increase/Decrease in bandwidth based on packet loss"),
+ MAX_BANDWIDTH("maxbandwidth", "Max bandwidth setting");
+
- std::string mName;
- BOOL mEnabled;
- BOOL mIsTimer;
-};
+SimMeasurement<F64Milliseconds > SIM_FRAME_TIME("simframemsec", "", LL_SIM_STAT_FRAMEMS),
+ SIM_NET_TIME("simnetmsec", "", LL_SIM_STAT_NETMS),
+ SIM_OTHER_TIME("simsimothermsec", "", LL_SIM_STAT_SIMOTHERMS),
+ SIM_PHYSICS_TIME("simsimphysicsmsec", "", LL_SIM_STAT_SIMPHYSICSMS),
+ SIM_PHYSICS_STEP_TIME("simsimphysicsstepmsec", "", LL_SIM_STAT_SIMPHYSICSSTEPMS),
+ SIM_PHYSICS_SHAPE_UPDATE_TIME("simsimphysicsshapeupdatemsec", "", LL_SIM_STAT_SIMPHYSICSSHAPEMS),
+ SIM_PHYSICS_OTHER_TIME("simsimphysicsothermsec", "", LL_SIM_STAT_SIMPHYSICSOTHERMS),
+ SIM_AI_TIME("simsimaistepmsec", "", LL_SIM_STAT_SIMAISTEPTIMEMS),
+ SIM_AGENTS_TIME("simagentmsec", "", LL_SIM_STAT_AGENTMS),
+ SIM_IMAGES_TIME("simimagesmsec", "", LL_SIM_STAT_IMAGESMS),
+ SIM_SCRIPTS_TIME("simscriptmsec", "", LL_SIM_STAT_SCRIPTMS),
+ SIM_SPARE_TIME("simsparemsec", "", LL_SIM_STAT_SIMSPARETIME),
+ SIM_SLEEP_TIME("simsleepmsec", "", LL_SIM_STAT_SIMSLEEPTIME),
+ SIM_PUMP_IO_TIME("simpumpiomsec", "", LL_SIM_STAT_IOPUMPTIME);
+
+SimMeasurement<F64Kilobytes > SIM_UNACKED_BYTES("simtotalunackedbytes", "", LL_SIM_STAT_TOTAL_UNACKED_BYTES);
+SimMeasurement<F64Megabytes > SIM_PHYSICS_MEM("physicsmemoryallocated", "", LL_SIM_STAT_SIMPHYSICSMEMORY);
-const StatAttributes STAT_INFO[LLViewerStats::ST_COUNT] =
-{
- // ST_VERSION
- StatAttributes("Version", TRUE, FALSE),
- // ST_AVATAR_EDIT_SECONDS
- StatAttributes("Seconds in Edit Appearence", FALSE, TRUE),
- // ST_TOOLBOX_SECONDS
- StatAttributes("Seconds using Toolbox", FALSE, TRUE),
- // ST_CHAT_COUNT
- StatAttributes("Chat messages sent", FALSE, FALSE),
- // ST_IM_COUNT
- StatAttributes("IMs sent", FALSE, FALSE),
- // ST_FULLSCREEN_BOOL
- StatAttributes("Fullscreen mode", FALSE, FALSE),
- // ST_RELEASE_COUNT
- StatAttributes("Object release count", FALSE, FALSE),
- // ST_CREATE_COUNT
- StatAttributes("Object create count", FALSE, FALSE),
- // ST_REZ_COUNT
- StatAttributes("Object rez count", FALSE, FALSE),
- // ST_FPS_10_SECONDS
- StatAttributes("Seconds below 10 FPS", FALSE, TRUE),
- // ST_FPS_2_SECONDS
- StatAttributes("Seconds below 2 FPS", FALSE, TRUE),
- // ST_MOUSELOOK_SECONDS
- StatAttributes("Seconds in Mouselook", FALSE, TRUE),
- // ST_FLY_COUNT
- StatAttributes("Fly count", FALSE, FALSE),
- // ST_TELEPORT_COUNT
- StatAttributes("Teleport count", FALSE, FALSE),
- // ST_OBJECT_DELETE_COUNT
- StatAttributes("Objects deleted", FALSE, FALSE),
- // ST_SNAPSHOT_COUNT
- StatAttributes("Snapshots taken", FALSE, FALSE),
- // ST_UPLOAD_SOUND_COUNT
- StatAttributes("Sounds uploaded", FALSE, FALSE),
- // ST_UPLOAD_TEXTURE_COUNT
- StatAttributes("Textures uploaded", FALSE, FALSE),
- // ST_EDIT_TEXTURE_COUNT
- StatAttributes("Changes to textures on objects", FALSE, FALSE),
- // ST_KILLED_COUNT
- StatAttributes("Number of times killed", FALSE, FALSE),
- // ST_FRAMETIME_JITTER
- StatAttributes("Average delta between sucessive frame times", FALSE, FALSE),
- // ST_FRAMETIME_SLEW
- StatAttributes("Average delta between frame time and mean", FALSE, FALSE),
- // ST_INVENTORY_TOO_LONG
- StatAttributes("Inventory took too long to load", FALSE, FALSE),
- // ST_WEARABLES_TOO_LONG
- StatAttributes("Wearables took too long to load", FALSE, FALSE),
- // ST_LOGIN_SECONDS
- StatAttributes("Time between LoginRequest and LoginReply", FALSE, FALSE),
- // ST_LOGIN_TIMEOUT_COUNT
- StatAttributes("Number of login attempts that timed out", FALSE, FALSE),
- // ST_HAS_BAD_TIMER
- StatAttributes("Known bad timer if != 0.0", FALSE, FALSE),
- // ST_DOWNLOAD_FAILED
- StatAttributes("Number of times LLAssetStorage::getAssetData() has failed", FALSE, FALSE),
- // ST_LSL_SAVE_COUNT
- StatAttributes("Number of times user has saved a script", FALSE, FALSE),
- // ST_UPLOAD_ANIM_COUNT
- StatAttributes("Animations uploaded", FALSE, FALSE),
- // ST_FPS_8_SECONDS
- StatAttributes("Seconds below 8 FPS", FALSE, TRUE),
- // ST_SIM_FPS_20_SECONDS
- StatAttributes("Seconds with sim FPS below 20", FALSE, TRUE),
- // ST_PHYS_FPS_20_SECONDS
- StatAttributes("Seconds with physics FPS below 20", FALSE, TRUE),
- // ST_LOSS_05_SECONDS
- StatAttributes("Seconds with packet loss > 5%", FALSE, TRUE),
- // ST_FPS_DROP_50_RATIO
- StatAttributes("Ratio of frames 2x longer than previous", FALSE, FALSE),
- // ST_ENABLE_VBO
- StatAttributes("Vertex Buffers Enabled", TRUE, FALSE),
- // ST_DELTA_BANDWIDTH
- StatAttributes("Increase/Decrease in bandwidth based on packet loss", FALSE, FALSE),
- // ST_MAX_BANDWIDTH
- StatAttributes("Max bandwidth setting", FALSE, FALSE),
- // ST_LIGHTING_DETAIL
- StatAttributes("Lighting Detail", FALSE, FALSE),
- // ST_VISIBLE_AVATARS
- StatAttributes("Visible Avatars", FALSE, FALSE),
- // ST_SHADER_OJECTS
- StatAttributes("Object Shaders", FALSE, FALSE),
- // ST_SHADER_ENVIRONMENT
- StatAttributes("Environment Shaders", FALSE, FALSE),
- // ST_VISIBLE_DRAW_DIST
- StatAttributes("Draw Distance", FALSE, FALSE),
- // ST_VISIBLE_CHAT_BUBBLES
- StatAttributes("Chat Bubbles Enabled", FALSE, FALSE),
- // ST_SHADER_AVATAR
- StatAttributes("Avatar Shaders", FALSE, FALSE),
- // ST_FRAME_SECS
- StatAttributes("FRAME_SECS", FALSE, FALSE),
- // ST_UPDATE_SECS
- StatAttributes("UPDATE_SECS", FALSE, FALSE),
- // ST_NETWORK_SECS
- StatAttributes("NETWORK_SECS", FALSE, FALSE),
- // ST_IMAGE_SECS
- StatAttributes("IMAGE_SECS", FALSE, FALSE),
- // ST_REBUILD_SECS
- StatAttributes("REBUILD_SECS", FALSE, FALSE),
- // ST_RENDER_SECS
- StatAttributes("RENDER_SECS", FALSE, FALSE),
- // ST_CROSSING_AVG
- StatAttributes("CROSSING_AVG", FALSE, FALSE),
- // ST_CROSSING_MAX
- StatAttributes("CROSSING_MAX", FALSE, FALSE),
- // ST_LIBXUL_WIDGET_USED
- StatAttributes("LibXUL Widget used", FALSE, FALSE), // Unused
- // ST_WINDOW_WIDTH
- StatAttributes("Window width", FALSE, FALSE),
- // ST_WINDOW_HEIGHT
- StatAttributes("Window height", FALSE, FALSE),
- // ST_TEX_BAKES
- StatAttributes("Texture Bakes", FALSE, FALSE),
- // ST_TEX_REBAKES
- StatAttributes("Texture Rebakes", FALSE, FALSE)
+LLTrace::SampleStatHandle<F64Milliseconds > FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"),
+ FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"),
+ SIM_PING("simpingstat");
-};
+LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Meters> > AGENT_POSITION_SNAP("agentpositionsnap", "agent position corrections");
-LLViewerStats::LLViewerStats() :
- mKBitStat("kbitstat"),
- mLayersKBitStat("layerskbitstat"),
- mObjectKBitStat("objectkbitstat"),
- mAssetKBitStat("assetkbitstat"),
- mTextureKBitStat("texturekbitstat"),
- mVFSPendingOperations("vfspendingoperations"),
- mObjectsDrawnStat("objectsdrawnstat"),
- mObjectsCulledStat("objectsculledstat"),
- mObjectsTestedStat("objectstestedstat"),
- mObjectsComparedStat("objectscomparedstat"),
- mObjectsOccludedStat("objectsoccludedstat"),
- mFPSStat("fpsstat"),
- mPacketsInStat("packetsinstat"),
- mPacketsLostStat("packetsloststat"),
- mPacketsOutStat("packetsoutstat"),
- mPacketsLostPercentStat("packetslostpercentstat", 64),
- mTexturePacketsStat("texturepacketsstat"),
- mActualInKBitStat("actualinkbitstat"),
- mActualOutKBitStat("actualoutkbitstat"),
- mTrianglesDrawnStat("trianglesdrawnstat"),
- mSimTimeDilation("simtimedilation"),
- mSimFPS("simfps"),
- mSimPhysicsFPS("simphysicsfps"),
- mSimAgentUPS("simagentups"),
- mSimScriptEPS("simscripteps"),
- mSimFrameMsec("simframemsec"),
- mSimNetMsec("simnetmsec"),
- mSimSimOtherMsec("simsimothermsec"),
- mSimSimPhysicsMsec("simsimphysicsmsec"),
- mSimSimPhysicsStepMsec("simsimphysicsstepmsec"),
- mSimSimPhysicsShapeUpdateMsec("simsimphysicsshapeupdatemsec"),
- mSimSimPhysicsOtherMsec("simsimphysicsothermsec"),
- mSimSimAIStepMsec("simsimaistepmsec"),
- mSimSimSkippedSilhouetteSteps("simsimskippedsilhouettesteps"),
- mSimSimPctSteppedCharacters("simsimpctsteppedcharacters"),
- mSimAgentMsec("simagentmsec"),
- mSimImagesMsec("simimagesmsec"),
- mSimScriptMsec("simscriptmsec"),
- mSimSpareMsec("simsparemsec"),
- mSimSleepMsec("simsleepmsec"),
- mSimPumpIOMsec("simpumpiomsec"),
- mSimMainAgents("simmainagents"),
- mSimChildAgents("simchildagents"),
- mSimObjects("simobjects"),
- mSimActiveObjects("simactiveobjects"),
- mSimActiveScripts("simactivescripts"),
- mSimPctScriptsRun("simpctscriptsrun"),
- mSimInPPS("siminpps"),
- mSimOutPPS("simoutpps"),
- mSimPendingDownloads("simpendingdownloads"),
- mSimPendingUploads("simpendinguploads"),
- mSimPendingLocalUploads("simpendinglocaluploads"),
- mSimTotalUnackedBytes("simtotalunackedbytes"),
- mPhysicsPinnedTasks("physicspinnedtasks"),
- mPhysicsLODTasks("physicslodtasks"),
- mPhysicsMemoryAllocated("physicsmemoryallocated"),
- mSimPingStat("simpingstat"),
- mNumImagesStat("numimagesstat", 32, TRUE),
- mNumRawImagesStat("numrawimagesstat", 32, TRUE),
- mGLTexMemStat("gltexmemstat", 32, TRUE),
- mGLBoundMemStat("glboundmemstat", 32, TRUE),
- mRawMemStat("rawmemstat", 32, TRUE),
- mFormattedMemStat("formattedmemstat", 32, TRUE),
- mNumObjectsStat("numobjectsstat"),
- mNumActiveObjectsStat("numactiveobjectsstat"),
- mNumNewObjectsStat("numnewobjectsstat"),
- mNumSizeCulledStat("numsizeculledstat"),
- mNumVisCulledStat("numvisculledstat"),
- mLastTimeDiff(0.0)
-{
- for (S32 i = 0; i < ST_COUNT; i++)
- {
- mStats[i] = 0.0;
- }
+LLTrace::EventStatHandle<> LOADING_WEARABLES_LONG_DELAY("loadingwearableslongdelay", "Wearables took too long to load");
- if (LLTimer::knownBadTimer())
- {
- mStats[ST_HAS_BAD_TIMER] = 1.0;
- }
+LLTrace::EventStatHandle<F64Milliseconds > REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"),
+ FRAME_STACKTIME("framestacktime", "FRAME_SECS"),
+ UPDATE_STACKTIME("updatestacktime", "UPDATE_SECS"),
+ NETWORK_STACKTIME("networkstacktime", "NETWORK_SECS"),
+ IMAGE_STACKTIME("imagestacktime", "IMAGE_SECS"),
+ REBUILD_STACKTIME("rebuildstacktime", "REBUILD_SECS"),
+ RENDER_STACKTIME("renderstacktime", "RENDER_SECS");
- mAgentPositionSnaps.reset();
-}
+LLTrace::EventStatHandle<F64Seconds > AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearance"),
+ TOOLBOX_TIME("toolboxtime", "Seconds using Toolbox"),
+ MOUSELOOK_TIME("mouselooktime", "Seconds in Mouselook"),
+ FPS_10_TIME("fps10time", "Seconds below 10 FPS"),
+ FPS_8_TIME("fps8time", "Seconds below 8 FPS"),
+ FPS_2_TIME("fps2time", "Seconds below 2 FPS");
-LLViewerStats::~LLViewerStats()
-{
-}
+LLTrace::EventStatHandle<LLUnit<F32, LLUnits::Percent> > OBJECT_CACHE_HIT_RATE("object_cache_hits");
-void LLViewerStats::resetStats()
-{
- LLViewerStats& stats = LLViewerStats::instance();
- stats.mKBitStat.reset();
- stats.mLayersKBitStat.reset();
- stats.mObjectKBitStat.reset();
- stats.mTextureKBitStat.reset();
- stats.mVFSPendingOperations.reset();
- stats.mAssetKBitStat.reset();
- stats.mPacketsInStat.reset();
- stats.mPacketsLostStat.reset();
- stats.mPacketsOutStat.reset();
- stats.mFPSStat.reset();
- stats.mTexturePacketsStat.reset();
- stats.mAgentPositionSnaps.reset();
}
-
-F64 LLViewerStats::getStat(EStatType type) const
+LLViewerStats::LLViewerStats()
+: mLastTimeDiff(0.0)
{
- return mStats[type];
+ getRecording().start();
}
-F64 LLViewerStats::setStat(EStatType type, F64 value)
-{
- mStats[type] = value;
- return mStats[type];
-}
+LLViewerStats::~LLViewerStats()
+{}
-F64 LLViewerStats::incStat(EStatType type, F64 value)
+void LLViewerStats::resetStats()
{
- mStats[type] += value;
- return mStats[type];
+ getRecording().reset();
}
-void LLViewerStats::updateFrameStats(const F64 time_diff)
+void LLViewerStats::updateFrameStats(const F64Seconds time_diff)
{
- if (mPacketsLostPercentStat.getCurrent() > 5.0)
+ if (getRecording().getLastValue(LLStatViewer::PACKETS_LOST_PERCENT) > F32Percent(5.0))
{
- incStat(ST_LOSS_05_SECONDS, time_diff);
+ add(LLStatViewer::LOSS_5_PERCENT_TIME, time_diff);
}
- if (mSimFPS.getCurrent() < 20.f && mSimFPS.getCurrent() > 0.f)
+ F32 sim_fps = getRecording().getLastValue(LLStatViewer::SIM_FPS);
+ if (0.f < sim_fps && sim_fps < 20.f)
{
- incStat(ST_SIM_FPS_20_SECONDS, time_diff);
+ add(LLStatViewer::SIM_20_FPS_TIME, time_diff);
}
- if (mSimPhysicsFPS.getCurrent() < 20.f && mSimPhysicsFPS.getCurrent() > 0.f)
+ F32 sim_physics_fps = getRecording().getLastValue(LLStatViewer::SIM_PHYSICS_FPS);
+
+ if (0.f < sim_physics_fps && sim_physics_fps < 20.f)
{
- incStat(ST_PHYS_FPS_20_SECONDS, time_diff);
+ add(LLStatViewer::SIM_PHYSICS_20_FPS_TIME, time_diff);
}
- if (time_diff >= 0.5)
+ if (time_diff >= (F64Seconds)0.5)
{
- incStat(ST_FPS_2_SECONDS, time_diff);
+ record(LLStatViewer::FPS_2_TIME, time_diff);
}
- if (time_diff >= 0.125)
+ if (time_diff >= (F64Seconds)0.125)
{
- incStat(ST_FPS_8_SECONDS, time_diff);
+ record(LLStatViewer::FPS_8_TIME, time_diff);
}
- if (time_diff >= 0.1)
+ if (time_diff >= (F64Seconds)0.1)
{
- incStat(ST_FPS_10_SECONDS, time_diff);
+ record(LLStatViewer::FPS_10_TIME, time_diff);
}
- if (gFrameCount && mLastTimeDiff > 0.0)
+ if (gFrameCount && mLastTimeDiff > (F64Seconds)0.0)
{
// new "stutter" meter
- setStat(ST_FPS_DROP_50_RATIO,
- (getStat(ST_FPS_DROP_50_RATIO) * (F64)(gFrameCount - 1) +
- (time_diff >= 2.0 * mLastTimeDiff ? 1.0 : 0.0)) / gFrameCount);
-
+ add(LLStatViewer::FRAMETIME_DOUBLED, time_diff >= 2.0 * mLastTimeDiff ? 1 : 0);
// old stats that were never really used
- setStat(ST_FRAMETIME_JITTER,
- (getStat(ST_FRAMETIME_JITTER) * (gFrameCount - 1) +
- fabs(mLastTimeDiff - time_diff) / mLastTimeDiff) / gFrameCount);
+ sample(LLStatViewer::FRAMETIME_JITTER, F64Milliseconds (mLastTimeDiff - time_diff));
- F32 average_frametime = gRenderStartTime.getElapsedTimeF32() / (F32)gFrameCount;
- setStat(ST_FRAMETIME_SLEW,
- (getStat(ST_FRAMETIME_SLEW) * (gFrameCount - 1) +
- fabs(average_frametime - time_diff) / average_frametime) / gFrameCount);
+ F32Seconds average_frametime = gRenderStartTime.getElapsedTimeF32() / (F32)gFrameCount;
+ sample(LLStatViewer::FRAMETIME_SLEW, F64Milliseconds (average_frametime - time_diff));
F32 max_bandwidth = gViewerThrottle.getMaxBandwidth();
F32 delta_bandwidth = gViewerThrottle.getCurrentBandwidth() - max_bandwidth;
- setStat(ST_DELTA_BANDWIDTH, delta_bandwidth / 1024.f);
-
- setStat(ST_MAX_BANDWIDTH, max_bandwidth / 1024.f);
-
+ sample(LLStatViewer::DELTA_BANDWIDTH, F64Bits(delta_bandwidth));
+ sample(LLStatViewer::MAX_BANDWIDTH, F64Bits(max_bandwidth));
}
mLastTimeDiff = time_diff;
-
}
-void LLViewerStats::addToMessage(LLSD &body) const
+void LLViewerStats::addToMessage(LLSD &body)
{
LLSD &misc = body["misc"];
- for (S32 i = 0; i < ST_COUNT; i++)
- {
- if (STAT_INFO[i].mEnabled)
- {
- // TODO: send timer value so dataserver can normalize
- misc[STAT_INFO[i].mName] = mStats[i];
- llinfos << "STAT: " << STAT_INFO[i].mName << ": " << mStats[i]
- << llendl;
- }
- }
+ misc["Version"] = TRUE;
+ //TODO RN: get last value, not mean
+ misc["Vertex Buffers Enabled"] = getRecording().getMean(LLStatViewer::ENABLE_VBO);
- body["AgentPositionSnaps"] = mAgentPositionSnaps.getData();
- llinfos << "STAT: AgentPositionSnaps: Mean = " << mAgentPositionSnaps.getMean() << "; StdDev = " << mAgentPositionSnaps.getStdDev()
- << "; Count = " << mAgentPositionSnaps.getCount() << llendl;
+ body["AgentPositionSnaps"] = getRecording().getSum(LLStatViewer::AGENT_POSITION_SNAP).value(); //mAgentPositionSnaps.asLLSD();
+ LL_INFOS() << "STAT: AgentPositionSnaps: Mean = " << getRecording().getMean(LLStatViewer::AGENT_POSITION_SNAP).value() << "; StdDev = " << getRecording().getStandardDeviation(LLStatViewer::AGENT_POSITION_SNAP).value()
+ << "; Count = " << getRecording().getSampleCount(LLStatViewer::AGENT_POSITION_SNAP) << LL_ENDL;
}
// *NOTE:Mani The following methods used to exist in viewer.cpp
// Moving them here, but not merging them into LLViewerStats yet.
-U32 gTotalLandIn = 0, gTotalLandOut = 0;
-U32 gTotalWaterIn = 0, gTotalWaterOut = 0;
-
-F32 gAveLandCompression = 0.f, gAveWaterCompression = 0.f;
-F32 gBestLandCompression = 1.f, gBestWaterCompression = 1.f;
-F32 gWorstLandCompression = 0.f, gWorstWaterCompression = 0.f;
-
-
-
-U32 gTotalWorldBytes = 0, gTotalObjectBytes = 0, gTotalTextureBytes = 0, gSimPingCount = 0;
-U32 gObjectBits = 0;
-F32 gAvgSimPing = 0.f;
-U32 gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {0};
+U32 gTotalLandIn = 0,
+ gTotalLandOut = 0,
+ gTotalWaterIn = 0,
+ gTotalWaterOut = 0;
+
+F32 gAveLandCompression = 0.f,
+ gAveWaterCompression = 0.f,
+ gBestLandCompression = 1.f,
+ gBestWaterCompression = 1.f,
+ gWorstLandCompression = 0.f,
+ gWorstWaterCompression = 0.f;
+
+U32Bytes gTotalWorldData,
+ gTotalObjectData,
+ gTotalTextureData;
+U32 gSimPingCount = 0;
+U32Bits gObjectData;
+F32Milliseconds gAvgSimPing(0.f);
+U32Bytes gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {U32Bytes(0)};
extern U32 gVisCompared;
extern U32 gVisTested;
@@ -426,59 +314,70 @@ LLFrameTimer gTextureTimer;
void update_statistics()
{
- gTotalWorldBytes += gVLManager.getTotalBytes();
- gTotalObjectBytes += gObjectBits / 8;
-
- LLViewerStats& stats = LLViewerStats::instance();
+ gTotalWorldData += gVLManager.getTotalBytes();
+ gTotalObjectData += gObjectData;
// make sure we have a valid time delta for this frame
if (gFrameIntervalSeconds > 0.f)
{
if (gAgentCamera.getCameraMode() == CAMERA_MODE_MOUSELOOK)
{
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_MOUSELOOK_SECONDS, gFrameIntervalSeconds);
+ record(LLStatViewer::MOUSELOOK_TIME, gFrameIntervalSeconds);
}
else if (gAgentCamera.getCameraMode() == CAMERA_MODE_CUSTOMIZE_AVATAR)
{
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_AVATAR_EDIT_SECONDS, gFrameIntervalSeconds);
+ record(LLStatViewer::AVATAR_EDIT_TIME, gFrameIntervalSeconds);
}
else if (LLFloaterReg::instanceVisible("build"))
{
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TOOLBOX_SECONDS, gFrameIntervalSeconds);
+ record(LLStatViewer::TOOLBOX_TIME, gFrameIntervalSeconds);
}
}
- stats.setStat(LLViewerStats::ST_ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable"));
- stats.setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gPipeline.getLightingDetail());
- stats.setStat(LLViewerStats::ST_DRAW_DIST, (F64)gSavedSettings.getF32("RenderFarClip"));
- stats.setStat(LLViewerStats::ST_CHAT_BUBBLES, (F64)gSavedSettings.getBOOL("UseChatBubbles"));
-
- stats.setStat(LLViewerStats::ST_FRAME_SECS, gDebugView->mFastTimerView->getTime("Frame"));
- F64 idle_secs = gDebugView->mFastTimerView->getTime("Idle");
- F64 network_secs = gDebugView->mFastTimerView->getTime("Network");
- stats.setStat(LLViewerStats::ST_UPDATE_SECS, idle_secs - network_secs);
- stats.setStat(LLViewerStats::ST_NETWORK_SECS, network_secs);
- stats.setStat(LLViewerStats::ST_IMAGE_SECS, gDebugView->mFastTimerView->getTime("Update Images"));
- stats.setStat(LLViewerStats::ST_REBUILD_SECS, gDebugView->mFastTimerView->getTime("Sort Draw State"));
- stats.setStat(LLViewerStats::ST_RENDER_SECS, gDebugView->mFastTimerView->getTime("Geometry"));
+
+ LLTrace::Recording& last_frame_recording = LLTrace::get_frame_recording().getLastRecording();
+
+ record(LLStatViewer::TRIANGLES_DRAWN_PER_FRAME, last_frame_recording.getSum(LLStatViewer::TRIANGLES_DRAWN));
+
+ sample(LLStatViewer::ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable"));
+ sample(LLStatViewer::LIGHTING_DETAIL, (F64)gPipeline.getLightingDetail());
+ sample(LLStatViewer::DRAW_DISTANCE, (F64)gSavedSettings.getF32("RenderFarClip"));
+ sample(LLStatViewer::CHAT_BUBBLES, gSavedSettings.getBOOL("UseChatBubbles"));
+
+ typedef LLTrace::StatType<LLTrace::TimeBlockAccumulator>::instance_tracker_t stat_type_t;
+
+ F64Seconds idle_secs = last_frame_recording.getSum(*stat_type_t::getInstance("Idle"));
+ F64Seconds network_secs = last_frame_recording.getSum(*stat_type_t::getInstance("Network"));
+
+ record(LLStatViewer::FRAME_STACKTIME, last_frame_recording.getSum(*stat_type_t::getInstance("Frame")));
+ record(LLStatViewer::UPDATE_STACKTIME, idle_secs - network_secs);
+ record(LLStatViewer::NETWORK_STACKTIME, network_secs);
+ record(LLStatViewer::IMAGE_STACKTIME, last_frame_recording.getSum(*stat_type_t::getInstance("Update Images")));
+ record(LLStatViewer::REBUILD_STACKTIME, last_frame_recording.getSum(*stat_type_t::getInstance("Sort Draw State")));
+ record(LLStatViewer::RENDER_STACKTIME, last_frame_recording.getSum(*stat_type_t::getInstance("Render Geometry")));
LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost());
if (cdp)
{
- stats.mSimPingStat.addValue(cdp->getPingDelay());
- gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1);
+ sample(LLStatViewer::SIM_PING, F64Milliseconds (cdp->getPingDelay()));
+ gAvgSimPing = ((gAvgSimPing * gSimPingCount) + cdp->getPingDelay()) / (gSimPingCount + 1);
gSimPingCount++;
}
else
{
- stats.mSimPingStat.addValue(10000);
+ sample(LLStatViewer::SIM_PING, U32Seconds(10));
+ }
+
+ if (LLViewerStats::instance().getRecording().getSum(LLStatViewer::FPS))
+ {
+ sample(LLStatViewer::FPS_SAMPLE, LLTrace::get_frame_recording().getPeriodMeanPerSec(LLStatViewer::FPS));
}
+ add(LLStatViewer::FPS, 1);
- stats.mFPSStat.addValue(1);
- F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits());
- stats.mLayersKBitStat.addValue(layer_bits/1024.f);
- stats.mObjectKBitStat.addValue(gObjectBits/1024.f);
- stats.mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending());
- stats.mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f);
+ F64Bits layer_bits = gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits();
+ add(LLStatViewer::LAYERS_NETWORK_DATA_RECEIVED, layer_bits);
+ add(LLStatViewer::OBJECT_NETWORK_DATA_RECEIVED, gObjectData);
+ sample(LLStatViewer::PENDING_VFS_OPERATIONS, LLVFile::getVFSThread()->getPending());
+ add(LLStatViewer::ASSET_UDP_DATA_RECEIVED, F64Bits(gTransferManager.getTransferBitsIn(LLTCT_ASSET)));
gTransferManager.resetTransferBitsIn(LLTCT_ASSET);
if (LLAppViewer::getTextureFetch()->getNumRequests() == 0)
@@ -490,23 +389,13 @@ void update_statistics()
gTextureTimer.unpause();
}
- {
- static F32 visible_avatar_frames = 0.f;
- static F32 avg_visible_avatars = 0;
- F32 visible_avatars = (F32)LLVOAvatar::sNumVisibleAvatars;
- if (visible_avatars > 0.f)
- {
- visible_avatar_frames = 1.f;
- avg_visible_avatars = (avg_visible_avatars * (F32)(visible_avatar_frames - 1.f) + visible_avatars) / visible_avatar_frames;
- }
- stats.setStat(LLViewerStats::ST_VISIBLE_AVATARS, (F64)avg_visible_avatars);
- }
+ sample(LLStatViewer::VISIBLE_AVATARS, LLVOAvatar::sNumVisibleAvatars);
LLWorld::getInstance()->updateNetStats();
LLWorld::getInstance()->requestCacheMisses();
// Reset all of these values.
gVLManager.resetBitCounts();
- gObjectBits = 0;
+ gObjectData = (U32Bytes)0;
// gDecodedBits = 0;
// Only update texture stats periodically so that they are less noisy
@@ -515,11 +404,7 @@ void update_statistics()
static LLFrameTimer texture_stats_timer;
if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq)
{
- stats.mTextureKBitStat.addValue(LLViewerTextureList::sTextureBits/1024.f);
- stats.mTexturePacketsStat.addValue(LLViewerTextureList::sTexturePackets);
- gTotalTextureBytes += LLViewerTextureList::sTextureBits / 8;
- LLViewerTextureList::sTextureBits = 0;
- LLViewerTextureList::sTexturePackets = 0;
+ gTotalTextureData = LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_NETWORK_DATA_RECEIVED);
texture_stats_timer.reset();
}
}
@@ -527,18 +412,19 @@ void update_statistics()
class ViewerStatsResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(ViewerStatsResponder);
public:
- ViewerStatsResponder() { }
+ ViewerStatsResponder() { }
- void error(U32 statusNum, const std::string& reason)
- {
- llinfos << "ViewerStatsResponder::error " << statusNum << " "
- << reason << llendl;
- }
+private:
+ /* virtual */ void httpFailure()
+ {
+ LL_WARNS() << dumpResponse() << LL_ENDL;
+ }
- void result(const LLSD& content)
- {
- llinfos << "ViewerStatsResponder::result" << llendl;
+ /* virtual */ void httpSuccess()
+ {
+ LL_INFOS() << "OK" << LL_ENDL;
}
};
@@ -568,10 +454,12 @@ void send_stats()
std::string url = gAgent.getRegion()->getCapability("ViewerStats");
if (url.empty()) {
- llwarns << "Could not get ViewerStats capability" << llendl;
+ LL_WARNS() << "Could not get ViewerStats capability" << LL_ENDL;
return;
}
+ LLViewerStats::instance().getRecording().pause();
+
body["session_id"] = gAgentSessionID;
LLSD &agent = body["agent"];
@@ -609,14 +497,14 @@ void send_stats()
gSimFrames = (F32) gFrameCount;
agent["agents_in_view"] = LLVOAvatar::sNumVisibleAvatars;
- agent["ping"] = gAvgSimPing;
+ agent["ping"] = gAvgSimPing.value();
agent["meters_traveled"] = gAgent.getDistanceTraveled();
agent["regions_visited"] = gAgent.getRegionsVisited();
agent["mem_use"] = LLMemory::getCurrentRSS() / 1024.0;
LLSD &system = body["system"];
- system["ram"] = (S32) gSysMemory.getPhysicalMemoryKB();
+ system["ram"] = (S32) gSysMemory.getPhysicalMemoryKB().value();
system["os"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple();
system["cpu"] = gSysCPU.getCPUString();
unsigned char MACAddress[MAC_ADDRESS_BYTES];
@@ -668,9 +556,9 @@ void send_stats()
LLSD &download = body["downloads"];
- download["world_kbytes"] = gTotalWorldBytes / 1024.0;
- download["object_kbytes"] = gTotalObjectBytes / 1024.0;
- download["texture_kbytes"] = gTotalTextureBytes / 1024.0;
+ download["world_kbytes"] = F64Kilobytes(gTotalWorldData).value();
+ download["object_kbytes"] = F64Kilobytes(gTotalObjectData).value();
+ download["texture_kbytes"] = F64Kilobytes(gTotalTextureData).value();
download["mesh_kbytes"] = LLMeshRepository::sBytesReceived/1024.0;
LLSD &in = body["stats"]["net"]["in"];
@@ -711,7 +599,7 @@ void send_stats()
S32 window_height = gViewerWindow->getWindowHeightRaw();
S32 window_size = (window_width * window_height) / 1024;
misc["string_1"] = llformat("%d", window_size);
- misc["string_2"] = llformat("Texture Time: %.2f, Total Time: %.2f", gTextureTimer.getElapsedTimeF32(), gFrameTimeSeconds);
+ misc["string_2"] = llformat("Texture Time: %.2f, Total Time: %.2f", gTextureTimer.getElapsedTimeF32(), gFrameTimeSeconds.value());
// misc["int_1"] = LLSD::Integer(gSavedSettings.getU32("RenderQualityPerformance")); // Steve: 1.21
// misc["int_2"] = LLSD::Integer(gFrameStalls); // Steve: 1.21
@@ -721,8 +609,8 @@ void send_stats()
F32 grey_time = LLVOAvatar::sGreyTime * 1000.f / gFrameTimeSeconds;
misc["int_2"] = LLSD::Integer(grey_time); // Steve: 1.22
- llinfos << "Misc Stats: int_1: " << misc["int_1"] << " int_2: " << misc["int_2"] << llendl;
- llinfos << "Misc Stats: string_1: " << misc["string_1"] << " string_2: " << misc["string_2"] << llendl;
+ LL_INFOS() << "Misc Stats: int_1: " << misc["int_1"] << " int_2: " << misc["int_2"] << LL_ENDL;
+ LL_INFOS() << "Misc Stats: string_1: " << misc["string_1"] << " string_2: " << misc["string_2"] << LL_ENDL;
body["DisplayNamesEnabled"] = gSavedSettings.getBOOL("UseDisplayNames");
body["DisplayNamesShowUsername"] = gSavedSettings.getBOOL("NameTagShowUsernames");
@@ -731,51 +619,37 @@ void send_stats()
LLViewerStats::getInstance()->addToMessage(body);
LLHTTPClient::post(url, body, new ViewerStatsResponder());
+
+ LLViewerStats::instance().getRecording().resume();
}
-LLFrameTimer& LLViewerStats::PhaseMap::getPhaseTimer(const std::string& phase_name)
+LLTimer& LLViewerStats::PhaseMap::getPhaseTimer(const std::string& phase_name)
{
phase_map_t::iterator iter = mPhaseMap.find(phase_name);
if (iter == mPhaseMap.end())
{
- LLFrameTimer timer;
+ LLTimer timer;
mPhaseMap[phase_name] = timer;
}
- LLFrameTimer& timer = mPhaseMap[phase_name];
+ LLTimer& timer = mPhaseMap[phase_name];
return timer;
}
void LLViewerStats::PhaseMap::startPhase(const std::string& phase_name)
{
- LLFrameTimer& timer = getPhaseTimer(phase_name);
- lldebugs << "startPhase " << phase_name << llendl;
- timer.unpause();
-}
-
-void LLViewerStats::PhaseMap::stopAllPhases()
-{
- for (phase_map_t::iterator iter = mPhaseMap.begin();
- iter != mPhaseMap.end(); ++iter)
- {
- const std::string& phase_name = iter->first;
- if (iter->second.getStarted())
- {
- // Going from started to paused state - record stats.
- recordPhaseStat(phase_name,iter->second.getElapsedTimeF32());
- }
- lldebugs << "stopPhase (all) " << phase_name << llendl;
- iter->second.pause();
- }
+ LLTimer& timer = getPhaseTimer(phase_name);
+ timer.start();
+ //LL_DEBUGS("Avatar") << "startPhase " << phase_name << LL_ENDL;
}
void LLViewerStats::PhaseMap::clearPhases()
{
- lldebugs << "clearPhases" << llendl;
+ //LL_DEBUGS("Avatar") << "clearPhases" << LL_ENDL;
mPhaseMap.clear();
}
-LLSD LLViewerStats::PhaseMap::dumpPhases()
+LLSD LLViewerStats::PhaseMap::asLLSD()
{
LLSD result;
for (phase_map_t::iterator iter = mPhaseMap.begin(); iter != mPhaseMap.end(); ++iter)
@@ -795,7 +669,6 @@ LLViewerStats::PhaseMap::PhaseMap()
{
}
-
void LLViewerStats::PhaseMap::stopPhase(const std::string& phase_name)
{
phase_map_t::iterator iter = mPhaseMap.find(phase_name);
@@ -808,6 +681,7 @@ void LLViewerStats::PhaseMap::stopPhase(const std::string& phase_name)
}
}
}
+
// static
LLViewerStats::StatsAccumulator& LLViewerStats::PhaseMap::getPhaseStats(const std::string& phase_name)
{
@@ -831,14 +705,18 @@ void LLViewerStats::PhaseMap::recordPhaseStat(const std::string& phase_name, F32
bool LLViewerStats::PhaseMap::getPhaseValues(const std::string& phase_name, F32& elapsed, bool& completed)
{
phase_map_t::iterator iter = mPhaseMap.find(phase_name);
+ bool found = false;
if (iter != mPhaseMap.end())
{
+ found = true;
elapsed = iter->second.getElapsedTimeF32();
completed = !iter->second.getStarted();
- return true;
+ //LL_DEBUGS("Avatar") << " phase_name " << phase_name << " elapsed " << elapsed << " completed " << completed << " timer addr " << (S32)(&iter->second) << LL_ENDL;
}
else
{
- return false;
+ //LL_DEBUGS("Avatar") << " phase_name " << phase_name << " NOT FOUND" << LL_ENDL;
}
+
+ return found;
}
diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h
index 6b2461be41..7843652589 100755
--- a/indra/newview/llviewerstats.h
+++ b/indra/newview/llviewerstats.h
@@ -1,5 +1,5 @@
/**
- * @file llviewerstats.h
+ * @file llviewerim_peningtats.h
* @brief LLViewerStats class header file
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
@@ -27,171 +27,236 @@
#ifndef LL_LLVIEWERSTATS_H
#define LL_LLVIEWERSTATS_H
-#include "llstat.h"
#include "lltextureinfo.h"
+#include "lltracerecording.h"
+#include "lltrace.h"
+
+
+enum ESimStatID
+{
+ LL_SIM_STAT_TIME_DILATION = 0,
+ LL_SIM_STAT_FPS = 1,
+ LL_SIM_STAT_PHYSFPS = 2,
+ LL_SIM_STAT_AGENTUPS = 3,
+ LL_SIM_STAT_FRAMEMS = 4,
+ LL_SIM_STAT_NETMS = 5,
+ LL_SIM_STAT_SIMOTHERMS = 6,
+ LL_SIM_STAT_SIMPHYSICSMS = 7,
+ LL_SIM_STAT_AGENTMS = 8,
+ LL_SIM_STAT_IMAGESMS = 9,
+ LL_SIM_STAT_SCRIPTMS = 10,
+ LL_SIM_STAT_NUMTASKS = 11,
+ LL_SIM_STAT_NUMTASKSACTIVE = 12,
+ LL_SIM_STAT_NUMAGENTMAIN = 13,
+ LL_SIM_STAT_NUMAGENTCHILD = 14,
+ LL_SIM_STAT_NUMSCRIPTSACTIVE = 15,
+ LL_SIM_STAT_LSLIPS = 16,
+ LL_SIM_STAT_INPPS = 17,
+ LL_SIM_STAT_OUTPPS = 18,
+ LL_SIM_STAT_PENDING_DOWNLOADS = 19,
+ LL_SIM_STAT_PENDING_UPLOADS = 20,
+ LL_SIM_STAT_VIRTUAL_SIZE_KB = 21,
+ LL_SIM_STAT_RESIDENT_SIZE_KB = 22,
+ LL_SIM_STAT_PENDING_LOCAL_UPLOADS = 23,
+ LL_SIM_STAT_TOTAL_UNACKED_BYTES = 24,
+ LL_SIM_STAT_PHYSICS_PINNED_TASKS = 25,
+ LL_SIM_STAT_PHYSICS_LOD_TASKS = 26,
+ LL_SIM_STAT_SIMPHYSICSSTEPMS = 27,
+ LL_SIM_STAT_SIMPHYSICSSHAPEMS = 28,
+ LL_SIM_STAT_SIMPHYSICSOTHERMS = 29,
+ LL_SIM_STAT_SIMPHYSICSMEMORY = 30,
+ LL_SIM_STAT_SCRIPT_EPS = 31,
+ LL_SIM_STAT_SIMSPARETIME = 32,
+ LL_SIM_STAT_SIMSLEEPTIME = 33,
+ LL_SIM_STAT_IOPUMPTIME = 34,
+ LL_SIM_STAT_PCTSCRIPTSRUN = 35,
+ LL_SIM_STAT_REGION_IDLE = 36, // dataserver only
+ LL_SIM_STAT_REGION_IDLE_POSSIBLE = 37, // dataserver only
+ LL_SIM_STAT_SIMAISTEPTIMEMS = 38,
+ LL_SIM_STAT_SKIPPEDAISILSTEPS_PS = 39,
+ LL_SIM_STAT_PCTSTEPPEDCHARACTERS = 40
+};
+
+namespace LLStatViewer
+{
+
+struct SimMeasurementSampler : public LLInstanceTracker<SimMeasurementSampler, ESimStatID>
+{
+ SimMeasurementSampler(ESimStatID id)
+ : LLInstanceTracker<SimMeasurementSampler, ESimStatID>(id)
+ {}
+ virtual ~SimMeasurementSampler() {}
+
+ virtual void sample(F64 value) = 0;
+};
+
+template<typename T = F64>
+struct SimMeasurement : public LLTrace::SampleStatHandle<T>, public SimMeasurementSampler
+{
+ typedef SimMeasurement<T> self_t;
+
+ SimMeasurement(const char* name, const char* description, ESimStatID stat_id)
+ : LLTrace::SampleStatHandle<T>(name, description),
+ SimMeasurementSampler(stat_id)
+ {}
+
+ using SimMeasurementSampler::getInstance;
+
+ //friend void sample(self_t& measurement, T value)
+ //{
+ // LLTrace::sample(static_cast<LLTrace::SampleStatHandle<T>& >(measurement), value);
+ //}
+
+ /*virtual*/ void sample(F64 value)
+ {
+ LLTrace::sample(static_cast<LLTrace::SampleStatHandle<T>& >(*this), value);
+ //LLStatViewer::sample(*this, value);
+ }
+
+};
+
+extern LLTrace::CountStatHandle<> FPS,
+ PACKETS_IN,
+ PACKETS_LOST,
+ PACKETS_OUT,
+ TEXTURE_PACKETS,
+ CHAT_COUNT,
+ IM_COUNT,
+ OBJECT_CREATE,
+ OBJECT_REZ,
+ LOGIN_TIMEOUTS,
+ LSL_SAVES,
+ ANIMATION_UPLOADS,
+ FLY,
+ TELEPORT,
+ DELETE_OBJECT,
+ SNAPSHOT,
+ UPLOAD_SOUND,
+ UPLOAD_TEXTURE,
+ EDIT_TEXTURE,
+ KILLED,
+ FRAMETIME_DOUBLED,
+ TEX_BAKES,
+ TEX_REBAKES,
+ NUM_NEW_OBJECTS;
+
+extern LLTrace::CountStatHandle<LLUnit<F64, LLUnits::Kilotriangles> > TRIANGLES_DRAWN;
+
+extern LLTrace::CountStatHandle<F64Kilobytes > ACTIVE_MESSAGE_DATA_RECEIVED,
+ LAYERS_NETWORK_DATA_RECEIVED,
+ OBJECT_NETWORK_DATA_RECEIVED,
+ ASSET_UDP_DATA_RECEIVED,
+ TEXTURE_NETWORK_DATA_RECEIVED,
+ MESSAGE_SYSTEM_DATA_IN,
+ MESSAGE_SYSTEM_DATA_OUT;
+
+extern LLTrace::CountStatHandle<F64Seconds > SIM_20_FPS_TIME,
+ SIM_PHYSICS_20_FPS_TIME,
+ LOSS_5_PERCENT_TIME;
+
+extern SimMeasurement<> SIM_TIME_DILATION,
+ SIM_FPS,
+ SIM_PHYSICS_FPS,
+ SIM_AGENT_UPS,
+ SIM_SCRIPT_EPS,
+ SIM_SKIPPED_SILHOUETTE,
+ SIM_MAIN_AGENTS,
+ SIM_CHILD_AGENTS,
+ SIM_OBJECTS,
+ SIM_ACTIVE_OBJECTS,
+ SIM_ACTIVE_SCRIPTS,
+ SIM_IN_PACKETS_PER_SEC,
+ SIM_OUT_PACKETS_PER_SEC,
+ SIM_PENDING_DOWNLOADS,
+ SIM_PENDING_UPLOADS,
+ SIM_PENDING_LOCAL_UPLOADS,
+ SIM_PHYSICS_PINNED_TASKS,
+ SIM_PHYSICS_LOD_TASKS;
+
+extern SimMeasurement<LLUnit<F64, LLUnits::Percent> > SIM_PERCENTAGE_SCRIPTS_RUN,
+ SIM_SKIPPED_CHARACTERS_PERCENTAGE;
+
+extern LLTrace::SampleStatHandle<> FPS_SAMPLE,
+ NUM_IMAGES,
+ NUM_RAW_IMAGES,
+ NUM_OBJECTS,
+ NUM_ACTIVE_OBJECTS,
+ ENABLE_VBO,
+ LIGHTING_DETAIL,
+ VISIBLE_AVATARS,
+ SHADER_OBJECTS,
+ DRAW_DISTANCE,
+ PENDING_VFS_OPERATIONS,
+ WINDOW_WIDTH,
+ WINDOW_HEIGHT;
+
+extern LLTrace::SampleStatHandle<LLUnit<F32, LLUnits::Percent> > PACKETS_LOST_PERCENT;
+
+extern LLTrace::SampleStatHandle<F64Megabytes > GL_TEX_MEM,
+ GL_BOUND_MEM,
+ RAW_MEM,
+ FORMATTED_MEM;
+extern LLTrace::SampleStatHandle<F64Kilobytes > DELTA_BANDWIDTH,
+ MAX_BANDWIDTH;
+extern SimMeasurement<F64Milliseconds > SIM_FRAME_TIME,
+ SIM_NET_TIME,
+ SIM_OTHER_TIME,
+ SIM_PHYSICS_TIME,
+ SIM_PHYSICS_STEP_TIME,
+ SIM_PHYSICS_SHAPE_UPDATE_TIME,
+ SIM_PHYSICS_OTHER_TIME,
+ SIM_AI_TIME,
+ SIM_AGENTS_TIME,
+ SIM_IMAGES_TIME,
+ SIM_SCRIPTS_TIME,
+ SIM_SPARE_TIME,
+ SIM_SLEEP_TIME,
+ SIM_PUMP_IO_TIME;
+
+extern SimMeasurement<F64Kilobytes > SIM_UNACKED_BYTES;
+extern SimMeasurement<F64Megabytes > SIM_PHYSICS_MEM;
+
+
+extern LLTrace::SampleStatHandle<F64Milliseconds > FRAMETIME_JITTER,
+ FRAMETIME_SLEW,
+ SIM_PING;
+
+extern LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Meters> > AGENT_POSITION_SNAP;
+
+extern LLTrace::EventStatHandle<> LOADING_WEARABLES_LONG_DELAY;
+
+extern LLTrace::EventStatHandle<F64Milliseconds > REGION_CROSSING_TIME,
+ FRAME_STACKTIME,
+ UPDATE_STACKTIME,
+ NETWORK_STACKTIME,
+ IMAGE_STACKTIME,
+ REBUILD_STACKTIME,
+ RENDER_STACKTIME;
+
+extern LLTrace::EventStatHandle<F64Seconds > AVATAR_EDIT_TIME,
+ TOOLBOX_TIME,
+ MOUSELOOK_TIME,
+ FPS_10_TIME,
+ FPS_8_TIME,
+ FPS_2_TIME;
+
+extern LLTrace::EventStatHandle<LLUnit<F32, LLUnits::Percent> > OBJECT_CACHE_HIT_RATE;
+
+}
class LLViewerStats : public LLSingleton<LLViewerStats>
{
public:
- LLStat mKBitStat,
- mLayersKBitStat,
- mObjectKBitStat,
- mAssetKBitStat,
- mTextureKBitStat,
- mVFSPendingOperations,
- mObjectsDrawnStat,
- mObjectsCulledStat,
- mObjectsTestedStat,
- mObjectsComparedStat,
- mObjectsOccludedStat,
- mFPSStat,
- mPacketsInStat,
- mPacketsLostStat,
- mPacketsOutStat,
- mPacketsLostPercentStat,
- mTexturePacketsStat,
- mActualInKBitStat, // From the packet ring (when faking a bad connection)
- mActualOutKBitStat, // From the packet ring (when faking a bad connection)
- mTrianglesDrawnStat;
-
- // Simulator stats
- LLStat mSimTimeDilation,
-
- mSimFPS,
- mSimPhysicsFPS,
- mSimAgentUPS,
- mSimScriptEPS,
-
- mSimFrameMsec,
- mSimNetMsec,
- mSimSimOtherMsec,
- mSimSimPhysicsMsec,
-
- mSimSimPhysicsStepMsec,
- mSimSimPhysicsShapeUpdateMsec,
- mSimSimPhysicsOtherMsec,
- mSimSimAIStepMsec,
- mSimSimSkippedSilhouetteSteps,
- mSimSimPctSteppedCharacters,
-
- mSimAgentMsec,
- mSimImagesMsec,
- mSimScriptMsec,
- mSimSpareMsec,
- mSimSleepMsec,
- mSimPumpIOMsec,
-
- mSimMainAgents,
- mSimChildAgents,
- mSimObjects,
- mSimActiveObjects,
- mSimActiveScripts,
- mSimPctScriptsRun,
-
- mSimInPPS,
- mSimOutPPS,
- mSimPendingDownloads,
- mSimPendingUploads,
- mSimPendingLocalUploads,
- mSimTotalUnackedBytes,
-
- mPhysicsPinnedTasks,
- mPhysicsLODTasks,
- mPhysicsMemoryAllocated,
-
- mSimPingStat,
-
- mNumImagesStat,
- mNumRawImagesStat,
- mGLTexMemStat,
- mGLBoundMemStat,
- mRawMemStat,
- mFormattedMemStat,
-
- mNumObjectsStat,
- mNumActiveObjectsStat,
- mNumNewObjectsStat,
- mNumSizeCulledStat,
- mNumVisCulledStat;
-
void resetStats();
+
public:
- // If you change this, please also add a corresponding text label in llviewerstats.cpp
- enum EStatType
- {
- ST_VERSION = 0,
- ST_AVATAR_EDIT_SECONDS = 1,
- ST_TOOLBOX_SECONDS = 2,
- ST_CHAT_COUNT = 3,
- ST_IM_COUNT = 4,
- ST_FULLSCREEN_BOOL = 5,
- ST_RELEASE_COUNT= 6,
- ST_CREATE_COUNT = 7,
- ST_REZ_COUNT = 8,
- ST_FPS_10_SECONDS = 9,
- ST_FPS_2_SECONDS = 10,
- ST_MOUSELOOK_SECONDS = 11,
- ST_FLY_COUNT = 12,
- ST_TELEPORT_COUNT = 13,
- ST_OBJECT_DELETE_COUNT = 14,
- ST_SNAPSHOT_COUNT = 15,
- ST_UPLOAD_SOUND_COUNT = 16,
- ST_UPLOAD_TEXTURE_COUNT = 17,
- ST_EDIT_TEXTURE_COUNT = 18,
- ST_KILLED_COUNT = 19,
- ST_FRAMETIME_JITTER = 20,
- ST_FRAMETIME_SLEW = 21,
- ST_INVENTORY_TOO_LONG = 22,
- ST_WEARABLES_TOO_LONG = 23,
- ST_LOGIN_SECONDS = 24,
- ST_LOGIN_TIMEOUT_COUNT = 25,
- ST_HAS_BAD_TIMER = 26,
- ST_DOWNLOAD_FAILED = 27,
- ST_LSL_SAVE_COUNT = 28,
- ST_UPLOAD_ANIM_COUNT = 29,
- ST_FPS_8_SECONDS = 30,
- ST_SIM_FPS_20_SECONDS = 31,
- ST_PHYS_FPS_20_SECONDS = 32,
- ST_LOSS_05_SECONDS = 33,
- ST_FPS_DROP_50_RATIO = 34,
- ST_ENABLE_VBO = 35,
- ST_DELTA_BANDWIDTH = 36,
- ST_MAX_BANDWIDTH = 37,
- ST_LIGHTING_DETAIL = 38,
- ST_VISIBLE_AVATARS = 39,
- ST_SHADER_OBJECTS = 40,
- ST_SHADER_ENVIRONMENT = 41,
- ST_DRAW_DIST = 42,
- ST_CHAT_BUBBLES = 43,
- ST_SHADER_AVATAR = 44,
- ST_FRAME_SECS = 45,
- ST_UPDATE_SECS = 46,
- ST_NETWORK_SECS = 47,
- ST_IMAGE_SECS = 48,
- ST_REBUILD_SECS = 49,
- ST_RENDER_SECS = 50,
- ST_CROSSING_AVG = 51,
- ST_CROSSING_MAX = 52,
- ST_LIBXUL_WIDGET_USED = 53, // Unused
- ST_WINDOW_WIDTH = 54,
- ST_WINDOW_HEIGHT = 55,
- ST_TEX_BAKES = 56,
- ST_TEX_REBAKES = 57,
-
- ST_COUNT = 58
- };
LLViewerStats();
~LLViewerStats();
- // all return latest value of given stat
- F64 getStat(EStatType type) const;
- F64 setStat(EStatType type, F64 value); // set the stat to value
- F64 incStat(EStatType type, F64 value = 1.f); // add value to the stat
-
- void updateFrameStats(const F64 time_diff);
+ void updateFrameStats(const F64Seconds time_diff);
- void addToMessage(LLSD &body) const;
+ void addToMessage(LLSD &body);
struct StatsAccumulator
{
@@ -263,7 +328,7 @@ public:
mCountOfNextUpdatesToIgnore = 0;
}
- inline LLSD getData() const
+ inline LLSD asLLSD() const
{
LLSD data;
data["mean"] = getMean();
@@ -275,11 +340,9 @@ public:
}
};
- StatsAccumulator mAgentPositionSnaps;
-
// Phase tracking (originally put in for avatar rezzing), tracking
// progress of active/completed phases for activities like outfit changing.
- typedef std::map<std::string,LLFrameTimer> phase_map_t;
+ typedef std::map<std::string,LLTimer> phase_map_t;
typedef std::map<std::string,StatsAccumulator> phase_stats_t;
class PhaseMap
{
@@ -288,24 +351,25 @@ public:
static phase_stats_t sStats;
public:
PhaseMap();
- LLFrameTimer& getPhaseTimer(const std::string& phase_name);
+ LLTimer& getPhaseTimer(const std::string& phase_name);
bool getPhaseValues(const std::string& phase_name, F32& elapsed, bool& completed);
void startPhase(const std::string& phase_name);
void stopPhase(const std::string& phase_name);
- void stopAllPhases();
void clearPhases();
- LLSD dumpPhases();
+ LLSD asLLSD();
static StatsAccumulator& getPhaseStats(const std::string& phase_name);
static void recordPhaseStat(const std::string& phase_name, F32 value);
phase_map_t::iterator begin() { return mPhaseMap.begin(); }
phase_map_t::iterator end() { return mPhaseMap.end(); }
};
+ LLTrace::Recording& getRecording() { return mRecording; }
+ const LLTrace::Recording& getRecording() const { return mRecording; }
private:
- F64 mStats[ST_COUNT];
+ LLTrace::Recording mRecording;
- F64 mLastTimeDiff; // used for time stat updates
+ F64Seconds mLastTimeDiff; // used for time stat updates
};
static const F32 SEND_STATS_PERIOD = 300.0f;
@@ -315,7 +379,7 @@ void update_statistics();
void send_stats();
extern LLFrameTimer gTextureTimer;
-extern U32 gTotalTextureBytes;
-extern U32 gTotalObjectBytes;
-extern U32 gTotalTextureBytesPerBoostLevel[] ;
+extern U32Bytes gTotalTextureData;
+extern U32Bytes gTotalObjectData;
+extern U32Bytes gTotalTextureBytesPerBoostLevel[] ;
#endif // LL_LLVIEWERSTATS_H
diff --git a/indra/newview/llviewerstatsrecorder.cpp b/indra/newview/llviewerstatsrecorder.cpp
index 2b3e293229..b5ccf4ffa0 100755
--- a/indra/newview/llviewerstatsrecorder.cpp
+++ b/indra/newview/llviewerstatsrecorder.cpp
@@ -49,7 +49,7 @@ LLViewerStatsRecorder::LLViewerStatsRecorder() :
{
if (NULL != sInstance)
{
- llerrs << "Attempted to create multiple instances of LLViewerStatsRecorder!" << llendl;
+ LL_ERRS() << "Attempted to create multiple instances of LLViewerStatsRecorder!" << LL_ENDL;
}
sInstance = this;
clearStats();
@@ -132,7 +132,7 @@ void LLViewerStatsRecorder::recordObjectUpdateEvent(U32 local_id, const EObjectU
mObjectCacheHitSize += msg_size;
break;
default:
- llwarns << "Unknown update_type" << llendl;
+ LL_WARNS() << "Unknown update_type" << LL_ENDL;
break;
};
}
@@ -154,7 +154,7 @@ void LLViewerStatsRecorder::recordCacheFullUpdate(U32 local_id, const EObjectUpd
mObjectCacheUpdateReplacements++;
break;
default:
- llwarns << "Unknown update_result type" << llendl;
+ LL_WARNS() << "Unknown update_result type" << LL_ENDL;
break;
};
}
@@ -173,7 +173,7 @@ void LLViewerStatsRecorder::writeToLog( F32 interval )
if ( delta_time < interval || total_objects == 0) return;
mLastSnapshotTime = LLTimer::getTotalSeconds();
- lldebugs << "ILX: "
+ LL_DEBUGS() << "ILX: "
<< mObjectCacheHitCount << " hits, "
<< mObjectCacheMissFullCount << " full misses, "
<< mObjectCacheMissCrcCount << " crc misses, "
@@ -186,7 +186,7 @@ void LLViewerStatsRecorder::writeToLog( F32 interval )
<< mObjectCacheUpdateAdds << " cache update adds, "
<< mObjectCacheUpdateReplacements << " cache update replacements, "
<< mObjectUpdateFailures << " update failures"
- << llendl;
+ << LL_ENDL;
if (mObjectCacheFile == NULL)
{
@@ -220,12 +220,12 @@ void LLViewerStatsRecorder::writeToLog( F32 interval )
data_size = data_msg.str().size();
if (fwrite(data_msg.str().c_str(), 1, data_size, mObjectCacheFile ) != data_size)
{
- llwarns << "failed to write full headers to " << STATS_FILE_NAME << llendl;
+ LL_WARNS() << "failed to write full headers to " << STATS_FILE_NAME << LL_ENDL;
}
}
else
{
- llwarns << "Couldn't open " << STATS_FILE_NAME << " for logging." << llendl;
+ //LL_WARNS() << "Couldn't open " << STATS_FILE_NAME << " for logging." << LL_ENDL;
return;
}
}
@@ -257,7 +257,7 @@ void LLViewerStatsRecorder::writeToLog( F32 interval )
data_size = data_msg.str().size();
if ( data_size != fwrite(data_msg.str().c_str(), 1, data_size, mObjectCacheFile ))
{
- llwarns << "Unable to write complete column data to " << STATS_FILE_NAME << llendl;
+ LL_WARNS() << "Unable to write complete column data to " << STATS_FILE_NAME << LL_ENDL;
}
clearStats();
diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp
index 777e1f9c76..65ba3fb6e5 100755
--- a/indra/newview/llviewertexlayer.cpp
+++ b/indra/newview/llviewertexlayer.cpp
@@ -37,7 +37,6 @@
#include "llglslshader.h"
#include "llvoavatarself.h"
#include "pipeline.h"
-#include "llassetuploadresponders.h"
#include "llviewercontrol.h"
static const S32 BAKE_UPLOAD_ATTEMPTS = 7;
@@ -46,22 +45,6 @@ static const F32 BAKE_UPLOAD_RETRY_DELAY = 2.f; // actual delay grows by power o
// runway consolidate
extern std::string self_av_string();
-
-//-----------------------------------------------------------------------------
-// LLBakedUploadData()
-//-----------------------------------------------------------------------------
-LLBakedUploadData::LLBakedUploadData(const LLVOAvatarSelf* avatar,
- LLViewerTexLayerSet* layerset,
- const LLUUID& id,
- bool highest_res) :
- mAvatar(avatar),
- mTexLayerSet(layerset),
- mID(id),
- mStartTime(LLFrameTimer::getTotalTime()), // Record starting time
- mIsHighestRes(highest_res)
-{
-}
-
//-----------------------------------------------------------------------------
// LLViewerTexLayerSetBuffer
// The composite image that a LLViewerTexLayerSet writes to. Each LLViewerTexLayerSet has one.
@@ -75,15 +58,10 @@ LLViewerTexLayerSetBuffer::LLViewerTexLayerSetBuffer(LLTexLayerSet* const owner,
// ORDER_LAST => must render these after the hints are created.
LLTexLayerSetBuffer(owner),
LLViewerDynamicTexture( width, height, 4, LLViewerDynamicTexture::ORDER_LAST, TRUE ),
- mUploadPending(FALSE), // Not used for any logic here, just to sync sending of updates
- mNeedsUpload(FALSE),
- mNumLowresUploads(0),
- mUploadFailCount(0),
mNeedsUpdate(TRUE),
mNumLowresUpdates(0)
{
LLViewerTexLayerSetBuffer::sGLByteCount += getSize();
- mNeedsUploadTimer.start();
mNeedsUpdateTimer.start();
}
@@ -118,7 +96,7 @@ void LLViewerTexLayerSetBuffer::destroyGLTexture()
// static
void LLViewerTexLayerSetBuffer::dumpTotalByteCount()
{
- llinfos << "Composite System GL Buffers: " << (LLViewerTexLayerSetBuffer::sGLByteCount/1024) << "KB" << llendl;
+ LL_INFOS() << "Composite System GL Buffers: " << (LLViewerTexLayerSetBuffer::sGLByteCount/1024) << "KB" << LL_ENDL;
}
void LLViewerTexLayerSetBuffer::requestUpdate()
@@ -126,33 +104,6 @@ void LLViewerTexLayerSetBuffer::requestUpdate()
restartUpdateTimer();
mNeedsUpdate = TRUE;
mNumLowresUpdates = 0;
- // If we're in the middle of uploading a baked texture, we don't care about it any more.
- // When it's downloaded, ignore it.
- mUploadID.setNull();
-}
-
-void LLViewerTexLayerSetBuffer::requestUpload()
-{
- conditionalRestartUploadTimer();
- mNeedsUpload = TRUE;
- mNumLowresUploads = 0;
- mUploadPending = TRUE;
-}
-
-void LLViewerTexLayerSetBuffer::conditionalRestartUploadTimer()
-{
- // If we requested a new upload but haven't even uploaded
- // a low res version of our last upload request, then
- // keep the timer ticking instead of resetting it.
- if (mNeedsUpload && (mNumLowresUploads == 0))
- {
- mNeedsUploadTimer.unpause();
- }
- else
- {
- mNeedsUploadTimer.reset();
- mNeedsUploadTimer.start();
- }
}
void LLViewerTexLayerSetBuffer::restartUpdateTimer()
@@ -161,25 +112,16 @@ void LLViewerTexLayerSetBuffer::restartUpdateTimer()
mNeedsUpdateTimer.start();
}
-void LLViewerTexLayerSetBuffer::cancelUpload()
-{
- mNeedsUpload = FALSE;
- mUploadPending = FALSE;
- mNeedsUploadTimer.pause();
- mUploadRetryTimer.reset();
-}
-
// virtual
BOOL LLViewerTexLayerSetBuffer::needsRender()
{
llassert(mTexLayerSet->getAvatarAppearance() == gAgentAvatarp);
if (!isAgentAvatarValid()) return FALSE;
- const BOOL upload_now = mNeedsUpload && isReadyToUpload();
const BOOL update_now = mNeedsUpdate && isReadyToUpdate();
- // Don't render if we don't want to (or aren't ready to) upload or update.
- if (!(update_now || upload_now))
+ // Don't render if we don't want to (or aren't ready to) update.
+ if (!update_now)
{
return FALSE;
}
@@ -190,11 +132,10 @@ BOOL LLViewerTexLayerSetBuffer::needsRender()
return FALSE;
}
- // Don't render if we are trying to create a shirt texture but aren't wearing a skirt.
+ // Don't render if we are trying to create a skirt texture but aren't wearing a skirt.
if (gAgentAvatarp->getBakedTE(getViewerTexLayerSet()) == LLAvatarAppearanceDefines::TEX_SKIRT_BAKED &&
!gAgentAvatarp->isWearingWearableType(LLWearableType::WT_SKIRT))
{
- cancelUpload();
return FALSE;
}
@@ -222,36 +163,7 @@ void LLViewerTexLayerSetBuffer::postRenderTexLayerSet(BOOL success)
// virtual
void LLViewerTexLayerSetBuffer::midRenderTexLayerSet(BOOL success)
{
- // do we need to upload, and do we have sufficient data to create an uploadable composite?
- // TODO: When do we upload the texture if gAgent.mNumPendingQueries is non-zero?
- const BOOL upload_now = mNeedsUpload && isReadyToUpload();
const BOOL update_now = mNeedsUpdate && isReadyToUpdate();
-
- if(upload_now)
- {
- if (!success)
- {
- llinfos << "Failed attempt to bake " << mTexLayerSet->getBodyRegionName() << llendl;
- mUploadPending = FALSE;
- }
- else
- {
- LLViewerTexLayerSet* layer_set = getViewerTexLayerSet();
- if (layer_set->isVisible())
- {
- layer_set->getAvatar()->debugBakedTextureUpload(layer_set->getBakedTexIndex(), FALSE); // FALSE for start of upload, TRUE for finish.
- doUpload();
- }
- else
- {
- mUploadPending = FALSE;
- mNeedsUpload = FALSE;
- mNeedsUploadTimer.pause();
- layer_set->getAvatar()->setNewBakedTexture(layer_set->getBakedTexIndex(),IMG_INVISIBLE);
- }
- }
- }
-
if (update_now)
{
doUpdate();
@@ -267,60 +179,6 @@ BOOL LLViewerTexLayerSetBuffer::isInitialized(void) const
return mGLTexturep.notNull() && mGLTexturep->isGLTextureCreated();
}
-BOOL LLViewerTexLayerSetBuffer::uploadPending() const
-{
- return mUploadPending;
-}
-
-BOOL LLViewerTexLayerSetBuffer::uploadNeeded() const
-{
- return mNeedsUpload;
-}
-
-BOOL LLViewerTexLayerSetBuffer::uploadInProgress() const
-{
- return !mUploadID.isNull();
-}
-
-BOOL LLViewerTexLayerSetBuffer::isReadyToUpload() const
-{
- if (!gAgentQueryManager.hasNoPendingQueries()) return FALSE; // Can't upload if there are pending queries.
- if (isAgentAvatarValid() && gAgentAvatarp->isEditingAppearance()) return FALSE; // Don't upload if avatar is being edited.
-
- BOOL ready = FALSE;
- if (getViewerTexLayerSet()->isLocalTextureDataFinal())
- {
- // If we requested an upload and have the final LOD ready, upload (or wait a while if this is a retry)
- if (mUploadFailCount == 0)
- {
- ready = TRUE;
- }
- else
- {
- ready = mUploadRetryTimer.getElapsedTimeF32() >= BAKE_UPLOAD_RETRY_DELAY * (1 << (mUploadFailCount - 1));
- }
- }
- else
- {
- // Upload if we've hit a timeout. Upload is a pretty expensive process so we need to make sure
- // we aren't doing uploads too frequently.
- const U32 texture_timeout = gSavedSettings.getU32("AvatarBakedTextureUploadTimeout");
- if (texture_timeout != 0)
- {
- // The timeout period increases exponentially between every lowres upload in order to prevent
- // spamming the server with frequent uploads.
- const U32 texture_timeout_threshold = texture_timeout*(1 << mNumLowresUploads);
-
- // If we hit our timeout and have textures available at even lower resolution, then upload.
- const BOOL is_upload_textures_timeout = mNeedsUploadTimer.getElapsedTimeF32() >= texture_timeout_threshold;
- const BOOL has_lower_lod = getViewerTexLayerSet()->isLocalTextureDataAvailable();
- ready = has_lower_lod && is_upload_textures_timeout;
- }
- }
-
- return ready;
-}
-
BOOL LLViewerTexLayerSetBuffer::isReadyToUpdate() const
{
// If we requested an update and have the final LOD ready, then update.
@@ -358,159 +216,6 @@ BOOL LLViewerTexLayerSetBuffer::requestUpdateImmediate()
return result;
}
-// Create the baked texture, send it out to the server, then wait for it to come
-// back so we can switch to using it.
-void LLViewerTexLayerSetBuffer::doUpload()
-{
- LLViewerTexLayerSet* layer_set = getViewerTexLayerSet();
- LL_DEBUGS("Avatar") << "Uploading baked " << layer_set->getBodyRegionName() << llendl;
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TEX_BAKES);
-
- // Don't need caches since we're baked now. (note: we won't *really* be baked
- // until this image is sent to the server and the Avatar Appearance message is received.)
- layer_set->deleteCaches();
-
- // Get the COLOR information from our texture
- U8* baked_color_data = new U8[ mFullWidth * mFullHeight * 4 ];
- glReadPixels(mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight, GL_RGBA, GL_UNSIGNED_BYTE, baked_color_data );
- stop_glerror();
-
- // Get the MASK information from our texture
- LLGLSUIDefault gls_ui;
- LLPointer<LLImageRaw> baked_mask_image = new LLImageRaw(mFullWidth, mFullHeight, 1 );
- U8* baked_mask_data = baked_mask_image->getData();
- layer_set->gatherMorphMaskAlpha(baked_mask_data,
- mOrigin.mX, mOrigin.mY,
- mFullWidth, mFullHeight);
-
-
- // Create the baked image from our color and mask information
- const S32 baked_image_components = 5; // red green blue [bump] clothing
- LLPointer<LLImageRaw> baked_image = new LLImageRaw( mFullWidth, mFullHeight, baked_image_components );
- U8* baked_image_data = baked_image->getData();
- S32 i = 0;
- for (S32 u=0; u < mFullWidth; u++)
- {
- for (S32 v=0; v < mFullHeight; v++)
- {
- baked_image_data[5*i + 0] = baked_color_data[4*i + 0];
- baked_image_data[5*i + 1] = baked_color_data[4*i + 1];
- baked_image_data[5*i + 2] = baked_color_data[4*i + 2];
- baked_image_data[5*i + 3] = baked_color_data[4*i + 3]; // alpha should be correct for eyelashes.
- baked_image_data[5*i + 4] = baked_mask_data[i];
- i++;
- }
- }
-
- LLPointer<LLImageJ2C> compressedImage = new LLImageJ2C;
- const char* comment_text = LINDEN_J2C_COMMENT_PREFIX "RGBHM"; // writes into baked_color_data. 5 channels (rgb, heightfield/alpha, mask)
- if (compressedImage->encode(baked_image, comment_text))
- {
- LLTransactionID tid;
- tid.generate();
- const LLAssetID asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
- if (LLVFile::writeFile(compressedImage->getData(), compressedImage->getDataSize(),
- gVFS, asset_id, LLAssetType::AT_TEXTURE))
- {
- // Read back the file and validate.
- BOOL valid = FALSE;
- LLPointer<LLImageJ2C> integrity_test = new LLImageJ2C;
- S32 file_size = 0;
- LLVFile file(gVFS, asset_id, LLAssetType::AT_TEXTURE);
- file_size = file.getSize();
- U8* data = integrity_test->allocateData(file_size);
- file.read(data, file_size);
- if (data)
- {
- valid = integrity_test->validate(data, file_size); // integrity_test will delete 'data'
- }
- else
- {
- integrity_test->setLastError("Unable to read entire file");
- }
-
- if (valid)
- {
- const bool highest_lod = layer_set->isLocalTextureDataFinal();
- // Baked_upload_data is owned by the responder and deleted after the request completes.
- LLBakedUploadData* baked_upload_data = new LLBakedUploadData(gAgentAvatarp,
- layer_set,
- asset_id,
- highest_lod);
- // upload ID is used to avoid overlaps, e.g. when the user rapidly makes two changes outside of Face Edit.
- mUploadID = asset_id;
-
- // Upload the image
- const std::string url = gAgent.getRegion()->getCapability("UploadBakedTexture");
- if(!url.empty()
- && !LLPipeline::sForceOldBakedUpload // toggle debug setting UploadBakedTexOld to change between the new caps method and old method
- && (mUploadFailCount < (BAKE_UPLOAD_ATTEMPTS - 1))) // Try last ditch attempt via asset store if cap upload is failing.
- {
- LLSD body = LLSD::emptyMap();
- // The responder will call LLViewerTexLayerSetBuffer::onTextureUploadComplete()
- LLHTTPClient::post(url, body, new LLSendTexLayerResponder(body, mUploadID, LLAssetType::AT_TEXTURE, baked_upload_data));
- llinfos << "Baked texture upload via capability of " << mUploadID << " to " << url << llendl;
- }
- else
- {
- gAssetStorage->storeAssetData(tid,
- LLAssetType::AT_TEXTURE,
- LLViewerTexLayerSetBuffer::onTextureUploadComplete,
- baked_upload_data,
- TRUE, // temp_file
- TRUE, // is_priority
- TRUE); // store_local
- llinfos << "Baked texture upload via Asset Store." << llendl;
- }
-
- if (highest_lod)
- {
- // Sending the final LOD for the baked texture. All done, pause
- // the upload timer so we know how long it took.
- mNeedsUpload = FALSE;
- mNeedsUploadTimer.pause();
- }
- else
- {
- // Sending a lower level LOD for the baked texture. Restart the upload timer.
- mNumLowresUploads++;
- mNeedsUploadTimer.unpause();
- mNeedsUploadTimer.reset();
- }
-
- // Print out notification that we uploaded this texture.
- if (gSavedSettings.getBOOL("DebugAvatarRezTime"))
- {
- const std::string lod_str = highest_lod ? "HighRes" : "LowRes";
- LLSD args;
- args["EXISTENCE"] = llformat("%d",(U32)layer_set->getAvatar()->debugGetExistenceTimeElapsedF32());
- args["TIME"] = llformat("%d",(U32)mNeedsUploadTimer.getElapsedTimeF32());
- args["BODYREGION"] = layer_set->getBodyRegionName();
- args["RESOLUTION"] = lod_str;
- LLNotificationsUtil::add("AvatarRezSelfBakedTextureUploadNotification",args);
- LL_DEBUGS("Avatar") << self_av_string() << "Uploading [ name: " << layer_set->getBodyRegionName() << " res:" << lod_str << " time:" << (U32)mNeedsUploadTimer.getElapsedTimeF32() << " ]" << LL_ENDL;
- }
- }
- else
- {
- // The read back and validate operation failed. Remove the uploaded file.
- mUploadPending = FALSE;
- LLVFile file(gVFS, asset_id, LLAssetType::AT_TEXTURE, LLVFile::WRITE);
- file.remove();
- llinfos << "Unable to create baked upload file (reason: corrupted)." << llendl;
- }
- }
- }
- else
- {
- // The VFS write file operation failed.
- mUploadPending = FALSE;
- llinfos << "Unable to create baked upload file (reason: failed to write file)" << llendl;
- }
-
- delete [] baked_color_data;
-}
-
// Mostly bookkeeping; don't need to actually "do" anything since
// render() will actually do the update.
void LLViewerTexLayerSetBuffer::doUpdate()
@@ -547,82 +252,6 @@ void LLViewerTexLayerSetBuffer::doUpdate()
}
}
-// static
-void LLViewerTexLayerSetBuffer::onTextureUploadComplete(const LLUUID& uuid,
- void* userdata,
- S32 result,
- LLExtStat ext_status) // StoreAssetData callback (not fixed)
-{
- LLBakedUploadData* baked_upload_data = (LLBakedUploadData*)userdata;
-
- if (isAgentAvatarValid() &&
- !gAgentAvatarp->isDead() &&
- (baked_upload_data->mAvatar == gAgentAvatarp) && // Sanity check: only the user's avatar should be uploading textures.
- (baked_upload_data->mTexLayerSet->hasComposite()))
- {
- LLViewerTexLayerSetBuffer* layerset_buffer = baked_upload_data->mTexLayerSet->getViewerComposite();
- S32 failures = layerset_buffer->mUploadFailCount;
- layerset_buffer->mUploadFailCount = 0;
-
- if (layerset_buffer->mUploadID.isNull())
- {
- // The upload got canceled, we should be in the
- // process of baking a new texture so request an
- // upload with the new data
-
- // BAP: does this really belong in this callback, as
- // opposed to where the cancellation takes place?
- // suspect this does nothing.
- layerset_buffer->requestUpload();
- }
- else if (baked_upload_data->mID == layerset_buffer->mUploadID)
- {
- // This is the upload we're currently waiting for.
- layerset_buffer->mUploadID.setNull();
- const std::string name(baked_upload_data->mTexLayerSet->getBodyRegionName());
- const std::string resolution = baked_upload_data->mIsHighestRes ? " full res " : " low res ";
- if (result >= 0)
- {
- layerset_buffer->mUploadPending = FALSE; // Allows sending of AgentSetAppearance later
- LLAvatarAppearanceDefines::ETextureIndex baked_te = gAgentAvatarp->getBakedTE(layerset_buffer->getViewerTexLayerSet());
- // Update baked texture info with the new UUID
- U64 now = LLFrameTimer::getTotalTime(); // Record starting time
- llinfos << "Baked" << resolution << "texture upload for " << name << " took " << (S32)((now - baked_upload_data->mStartTime) / 1000) << " ms" << llendl;
- gAgentAvatarp->setNewBakedTexture(baked_te, uuid);
- }
- else
- {
- ++failures;
- S32 max_attempts = baked_upload_data->mIsHighestRes ? BAKE_UPLOAD_ATTEMPTS : 1; // only retry final bakes
- llwarns << "Baked" << resolution << "texture upload for " << name << " failed (attempt " << failures << "/" << max_attempts << ")" << llendl;
- if (failures < max_attempts)
- {
- layerset_buffer->mUploadFailCount = failures;
- layerset_buffer->mUploadRetryTimer.start();
- layerset_buffer->requestUpload();
- }
- }
- }
- else
- {
- llinfos << "Received baked texture out of date, ignored." << llendl;
- }
-
- gAgentAvatarp->dirtyMesh();
- }
- else
- {
- // Baked texture failed to upload (in which case since we
- // didn't set the new baked texture, it means that they'll try
- // and rebake it at some point in the future (after login?)),
- // or this response to upload is out of date, in which case a
- // current response should be on the way or already processed.
- llwarns << "Baked upload failed" << llendl;
- }
-
- delete baked_upload_data;
-}
-
//-----------------------------------------------------------------------------
// LLViewerTexLayerSet
// An ordered set of texture layers that get composited into a single texture.
@@ -664,20 +293,6 @@ void LLViewerTexLayerSet::requestUpdate()
}
}
-void LLViewerTexLayerSet::requestUpload()
-{
- createComposite();
- getViewerComposite()->requestUpload();
-}
-
-void LLViewerTexLayerSet::cancelUpload()
-{
- if(mComposite)
- {
- getViewerComposite()->cancelUpload();
- }
-}
-
void LLViewerTexLayerSet::updateComposite()
{
createComposite();
@@ -694,7 +309,7 @@ void LLViewerTexLayerSet::createComposite()
// Composite other avatars at reduced resolution
if( !mAvatarAppearance->isSelf() )
{
- llerrs << "composites should not be created for non-self avatars!" << llendl;
+ LL_ERRS() << "composites should not be created for non-self avatars!" << LL_ENDL;
}
mComposite = new LLViewerTexLayerSetBuffer( this, width, height );
}
@@ -730,19 +345,12 @@ const std::string LLViewerTexLayerSetBuffer::dumpTextureInfo() const
{
if (!isAgentAvatarValid()) return "";
- const BOOL is_high_res = !mNeedsUpload;
- const U32 num_low_res = mNumLowresUploads;
- const U32 upload_time = (U32)mNeedsUploadTimer.getElapsedTimeF32();
+ const BOOL is_high_res = TRUE;
+ const U32 num_low_res = 0;
const std::string local_texture_info = gAgentAvatarp->debugDumpLocalTextureDataInfo(getViewerTexLayerSet());
- std::string status = "CREATING ";
- if (!uploadNeeded()) status = "DONE ";
- if (uploadInProgress()) status = "UPLOADING";
-
- std::string text = llformat("[%s] [HiRes:%d LoRes:%d] [Elapsed:%d] %s",
- status.c_str(),
+ std::string text = llformat("[HiRes:%d LoRes:%d] %s",
is_high_res, num_low_res,
- upload_time,
local_texture_info.c_str());
return text;
}
diff --git a/indra/newview/llviewertexlayer.h b/indra/newview/llviewertexlayer.h
index 959c883da8..027ae255ec 100644..100755
--- a/indra/newview/llviewertexlayer.h
+++ b/indra/newview/llviewertexlayer.h
@@ -47,8 +47,6 @@ public:
virtual ~LLViewerTexLayerSet();
/*virtual*/void requestUpdate();
- void requestUpload();
- void cancelUpload();
BOOL isLocalTextureDataAvailable() const;
BOOL isLocalTextureDataFinal() const;
void updateComposite();
@@ -116,31 +114,6 @@ protected:
virtual BOOL render() { return renderTexLayerSet(); }
//--------------------------------------------------------------------
- // Uploads
- //--------------------------------------------------------------------
-public:
- void requestUpload();
- void cancelUpload();
- BOOL uploadNeeded() const; // We need to upload a new texture
- BOOL uploadInProgress() const; // We have started uploading a new texture and are awaiting the result
- BOOL uploadPending() const; // We are expecting a new texture to be uploaded at some point
- static void onTextureUploadComplete(const LLUUID& uuid,
- void* userdata,
- S32 result, LLExtStat ext_status);
-protected:
- BOOL isReadyToUpload() const;
- void doUpload(); // Does a read back and upload.
- void conditionalRestartUploadTimer();
-private:
- BOOL mNeedsUpload; // Whether we need to send our baked textures to the server
- U32 mNumLowresUploads; // Number of times we've sent a lowres version of our baked textures to the server
- BOOL mUploadPending; // Whether we have received back the new baked textures
- LLUUID mUploadID; // The current upload process (null if none).
- LLFrameTimer mNeedsUploadTimer; // Tracks time since upload was requested and performed.
- S32 mUploadFailCount; // Number of consecutive upload failures
- LLFrameTimer mUploadRetryTimer; // Tracks time since last upload failure.
-
- //--------------------------------------------------------------------
// Updates
//--------------------------------------------------------------------
public:
@@ -156,25 +129,5 @@ private:
LLFrameTimer mNeedsUpdateTimer; // Tracks time since update was requested and performed.
};
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// LLBakedUploadData
-//
-// Used by LLTexLayerSetBuffer for a callback.
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-struct LLBakedUploadData
-{
- LLBakedUploadData(const LLVOAvatarSelf* avatar,
- LLViewerTexLayerSet* layerset,
- const LLUUID& id,
- bool highest_res);
- ~LLBakedUploadData() {}
- const LLUUID mID;
- const LLVOAvatarSelf* mAvatar; // note: backlink only; don't LLPointer
- LLViewerTexLayerSet* mTexLayerSet;
- const U64 mStartTime; // for measuring baked texture upload time
- const bool mIsHighestRes; // whether this is a "final" bake, or intermediate low res
-};
-
#endif // LL_VIEWER_TEXLAYER_H
diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp
index e51f7b2c71..0c4f55d704 100755
--- a/indra/newview/llviewertexteditor.cpp
+++ b/indra/newview/llviewertexteditor.cpp
@@ -100,7 +100,7 @@ public:
if (item_ptr.isNull())
{
// check to prevent a crash. See EXT-8459.
- llwarns << "Passed handle contains a dead inventory item. Most likely notecard has been closed and embedded item was destroyed." << llendl;
+ LL_WARNS() << "Passed handle contains a dead inventory item. Most likely notecard has been closed and embedded item was destroyed." << LL_ENDL;
}
else
{
@@ -143,7 +143,7 @@ public:
LLInventoryItem* item = gInventory.getItem(inv_item);
if(!item)
{
- llwarns << "Item add reported, but not found in inventory!: " << inv_item << llendl;
+ LL_WARNS() << "Item add reported, but not found in inventory!: " << inv_item << LL_ENDL;
}
else
{
@@ -438,7 +438,7 @@ llwchar LLEmbeddedItems::getEmbeddedCharFromIndex(S32 index)
{
if (index >= (S32)mEmbeddedIndexedChars.size())
{
- llwarns << "No item for embedded char " << index << " using LL_UNKNOWN_CHAR" << llendl;
+ LL_WARNS() << "No item for embedded char " << index << " using LL_UNKNOWN_CHAR" << LL_ENDL;
return LL_UNKNOWN_CHAR;
}
return mEmbeddedIndexedChars[index];
@@ -494,7 +494,7 @@ S32 LLEmbeddedItems::getIndexFromEmbeddedChar(llwchar wch)
}
else
{
- llwarns << "Embedded char " << wch << " not found, using 0" << llendl;
+ LL_WARNS() << "Embedded char " << wch << " not found, using 0" << LL_ENDL;
return 0;
}
}
@@ -542,8 +542,8 @@ LLUIImagePtr LLEmbeddedItems::getItemImage(llwchar ext_char) const
case LLAssetType::AT_BODYPART: img_name = "Inv_Skin"; break;
case LLAssetType::AT_ANIMATION: img_name = "Inv_Animation"; break;
case LLAssetType::AT_GESTURE: img_name = "Inv_Gesture"; break;
- case LLAssetType::AT_MESH: img_name = "Inv_Mesh"; break;
- default: llassert(0);
+ case LLAssetType::AT_MESH: img_name = "Inv_Mesh"; break;
+ default: img_name = "Inv_Invalid"; break; // use the Inv_Invalid icon for undefined object types (see MAINT-3981)
}
return LLUI::getUIImage(img_name);
@@ -689,9 +689,9 @@ void LLViewerTextEditor::makePristine()
LLTextEditor::makePristine();
}
-void LLViewerTextEditor::handleVisibilityChange( BOOL new_visibility )
+void LLViewerTextEditor::onVisibilityChange( BOOL new_visibility )
{
- LLUICtrl::handleVisibilityChange(new_visibility);
+ LLUICtrl::onVisibilityChange(new_visibility);
}
BOOL LLViewerTextEditor::handleMouseDown(S32 x, S32 y, MASK mask)
@@ -925,7 +925,7 @@ BOOL LLViewerTextEditor::handleDragAndDrop(S32 x, S32 y, MASK mask,
}
handled = TRUE;
- lldebugst(LLERR_USER_INPUT) << "dragAndDrop handled by LLViewerTextEditor " << getName() << llendl;
+ LL_DEBUGS("UserInput") << "dragAndDrop handled by LLViewerTextEditor " << getName() << LL_ENDL;
return handled;
}
diff --git a/indra/newview/llviewertexteditor.h b/indra/newview/llviewertexteditor.h
index 33b78a5964..477119d4f2 100755
--- a/indra/newview/llviewertexteditor.h
+++ b/indra/newview/llviewertexteditor.h
@@ -47,7 +47,7 @@ public:
virtual void makePristine();
- /*virtual*/ void handleVisibilityChange( BOOL new_visibility );
+ /*virtual*/ void onVisibilityChange( BOOL new_visibility );
// mousehandler overrides
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 3da6d33d72..4e2eef39d6 100755
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -29,7 +29,6 @@
#include "llviewertexture.h"
// Library includes
-#include "imageids.h"
#include "llmath.h"
#include "llerror.h"
#include "llgl.h"
@@ -63,6 +62,11 @@
#include "lltexturecache.h"
///////////////////////////////////////////////////////////////////////////////
+// extern
+const S32Megabytes gMinVideoRam(32);
+const S32Megabytes gMaxVideoRam(512);
+
+
// statics
LLPointer<LLViewerTexture> LLViewerTexture::sNullImagep = NULL;
LLPointer<LLViewerTexture> LLViewerTexture::sBlackImagep = NULL;
@@ -72,8 +76,8 @@ LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sWhiteImagep = NULL;
LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sDefaultImagep = NULL;
LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sSmokeImagep = NULL;
LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sFlatNormalImagep = NULL;
-LLViewerMediaTexture::media_map_t LLViewerMediaTexture::sMediaMap ;
-LLTexturePipelineTester* LLViewerTextureManager::sTesterp = NULL ;
+LLViewerMediaTexture::media_map_t LLViewerMediaTexture::sMediaMap;
+LLTexturePipelineTester* LLViewerTextureManager::sTesterp = NULL;
const std::string sTesterName("TextureTester");
S32 LLViewerTexture::sImageCount = 0;
@@ -82,21 +86,21 @@ S32 LLViewerTexture::sAuxCount = 0;
LLFrameTimer LLViewerTexture::sEvaluationTimer;
F32 LLViewerTexture::sDesiredDiscardBias = 0.f;
F32 LLViewerTexture::sDesiredDiscardScale = 1.1f;
-S32 LLViewerTexture::sBoundTextureMemoryInBytes = 0;
-S32 LLViewerTexture::sTotalTextureMemoryInBytes = 0;
-S32 LLViewerTexture::sMaxBoundTextureMemInMegaBytes = 0;
-S32 LLViewerTexture::sMaxTotalTextureMemInMegaBytes = 0;
-S32 LLViewerTexture::sMaxDesiredTextureMemInBytes = 0 ;
-S8 LLViewerTexture::sCameraMovingDiscardBias = 0 ;
-F32 LLViewerTexture::sCameraMovingBias = 0.0f ;
-S32 LLViewerTexture::sMaxSculptRez = 128 ; //max sculpt image size
-const S32 MAX_CACHED_RAW_IMAGE_AREA = 64 * 64 ;
-const S32 MAX_CACHED_RAW_SCULPT_IMAGE_AREA = LLViewerTexture::sMaxSculptRez * LLViewerTexture::sMaxSculptRez ;
-const S32 MAX_CACHED_RAW_TERRAIN_IMAGE_AREA = 128 * 128 ;
-S32 LLViewerTexture::sMinLargeImageSize = 65536 ; //256 * 256.
-S32 LLViewerTexture::sMaxSmallImageSize = MAX_CACHED_RAW_IMAGE_AREA ;
-BOOL LLViewerTexture::sFreezeImageScalingDown = FALSE ;
-F32 LLViewerTexture::sCurrentTime = 0.0f ;
+S32Bytes LLViewerTexture::sBoundTextureMemory;
+S32Bytes LLViewerTexture::sTotalTextureMemory;
+S32Megabytes LLViewerTexture::sMaxBoundTextureMemory;
+S32Megabytes LLViewerTexture::sMaxTotalTextureMem;
+S32Bytes LLViewerTexture::sMaxDesiredTextureMem;
+S8 LLViewerTexture::sCameraMovingDiscardBias = 0;
+F32 LLViewerTexture::sCameraMovingBias = 0.0f;
+S32 LLViewerTexture::sMaxSculptRez = 128; //max sculpt image size
+const S32 MAX_CACHED_RAW_IMAGE_AREA = 64 * 64;
+const S32 MAX_CACHED_RAW_SCULPT_IMAGE_AREA = LLViewerTexture::sMaxSculptRez * LLViewerTexture::sMaxSculptRez;
+const S32 MAX_CACHED_RAW_TERRAIN_IMAGE_AREA = 128 * 128;
+S32 LLViewerTexture::sMinLargeImageSize = 65536; //256 * 256.
+S32 LLViewerTexture::sMaxSmallImageSize = MAX_CACHED_RAW_IMAGE_AREA;
+BOOL LLViewerTexture::sFreezeImageScalingDown = FALSE;
+F32 LLViewerTexture::sCurrentTime = 0.0f;
F32 LLViewerTexture::sTexelPixelRatio = 1.0f;
LLViewerTexture::EDebugTexels LLViewerTexture::sDebugTexelsMode = LLViewerTexture::DEBUG_TEXELS_OFF;
@@ -138,7 +142,7 @@ void LLLoadedCallbackEntry::removeTexture(LLViewerFetchedTexture* tex)
{
if(mSourceCallbackList)
{
- mSourceCallbackList->erase(tex->getID()) ;
+ mSourceCallbackList->erase(tex->getID());
}
}
@@ -151,33 +155,33 @@ void LLLoadedCallbackEntry::cleanUpCallbackList(LLLoadedCallbackEntry::source_ca
for(LLLoadedCallbackEntry::source_callback_list_t::iterator iter = callback_list->begin();
iter != callback_list->end(); ++iter)
{
- LLViewerFetchedTexture* tex = gTextureList.findImage(*iter) ;
+ LLViewerFetchedTexture* tex = gTextureList.findImage(*iter);
if(tex)
{
- tex->deleteCallbackEntry(callback_list) ;
+ tex->deleteCallbackEntry(callback_list);
}
}
- callback_list->clear() ;
+ callback_list->clear();
}
}
LLViewerMediaTexture* LLViewerTextureManager::createMediaTexture(const LLUUID &media_id, BOOL usemipmaps, LLImageGL* gl_image)
{
- return new LLViewerMediaTexture(media_id, usemipmaps, gl_image) ;
+ return new LLViewerMediaTexture(media_id, usemipmaps, gl_image);
}
LLViewerTexture* LLViewerTextureManager::findTexture(const LLUUID& id)
{
- LLViewerTexture* tex ;
+ LLViewerTexture* tex;
//search fetched texture list
- tex = gTextureList.findImage(id) ;
+ tex = gTextureList.findImage(id);
//search media texture list
if(!tex)
{
- tex = LLViewerTextureManager::findMediaTexture(id) ;
+ tex = LLViewerTextureManager::findMediaTexture(id);
}
- return tex ;
+ return tex;
}
LLViewerFetchedTexture* LLViewerTextureManager::findFetchedTexture(const LLUUID& id)
@@ -187,78 +191,78 @@ LLViewerFetchedTexture* LLViewerTextureManager::findFetchedTexture(const LLUUID
LLViewerMediaTexture* LLViewerTextureManager::findMediaTexture(const LLUUID &media_id)
{
- return LLViewerMediaTexture::findMediaTexture(media_id) ;
+ return LLViewerMediaTexture::findMediaTexture(media_id);
}
LLViewerMediaTexture* LLViewerTextureManager::getMediaTexture(const LLUUID& id, BOOL usemipmaps, LLImageGL* gl_image)
{
- LLViewerMediaTexture* tex = LLViewerMediaTexture::findMediaTexture(id) ;
+ LLViewerMediaTexture* tex = LLViewerMediaTexture::findMediaTexture(id);
if(!tex)
{
- tex = LLViewerTextureManager::createMediaTexture(id, usemipmaps, gl_image) ;
+ tex = LLViewerTextureManager::createMediaTexture(id, usemipmaps, gl_image);
}
- tex->initVirtualSize() ;
+ tex->initVirtualSize();
- return tex ;
+ return tex;
}
LLViewerFetchedTexture* LLViewerTextureManager::staticCastToFetchedTexture(LLTexture* tex, BOOL report_error)
{
if(!tex)
{
- return NULL ;
+ return NULL;
}
- S8 type = tex->getType() ;
+ S8 type = tex->getType();
if(type == LLViewerTexture::FETCHED_TEXTURE || type == LLViewerTexture::LOD_TEXTURE)
{
- return static_cast<LLViewerFetchedTexture*>(tex) ;
+ return static_cast<LLViewerFetchedTexture*>(tex);
}
if(report_error)
{
- llerrs << "not a fetched texture type: " << type << llendl ;
+ LL_ERRS() << "not a fetched texture type: " << type << LL_ENDL;
}
- return NULL ;
+ return NULL;
}
LLPointer<LLViewerTexture> LLViewerTextureManager::getLocalTexture(BOOL usemipmaps, BOOL generate_gl_tex)
{
- LLPointer<LLViewerTexture> tex = new LLViewerTexture(usemipmaps) ;
+ LLPointer<LLViewerTexture> tex = new LLViewerTexture(usemipmaps);
if(generate_gl_tex)
{
- tex->generateGLTexture() ;
- tex->setCategory(LLGLTexture::LOCAL) ;
+ tex->generateGLTexture();
+ tex->setCategory(LLGLTexture::LOCAL);
}
- return tex ;
+ return tex;
}
LLPointer<LLViewerTexture> LLViewerTextureManager::getLocalTexture(const LLUUID& id, BOOL usemipmaps, BOOL generate_gl_tex)
{
- LLPointer<LLViewerTexture> tex = new LLViewerTexture(id, usemipmaps) ;
+ LLPointer<LLViewerTexture> tex = new LLViewerTexture(id, usemipmaps);
if(generate_gl_tex)
{
- tex->generateGLTexture() ;
- tex->setCategory(LLGLTexture::LOCAL) ;
+ tex->generateGLTexture();
+ tex->setCategory(LLGLTexture::LOCAL);
}
- return tex ;
+ return tex;
}
LLPointer<LLViewerTexture> LLViewerTextureManager::getLocalTexture(const LLImageRaw* raw, BOOL usemipmaps)
{
- LLPointer<LLViewerTexture> tex = new LLViewerTexture(raw, usemipmaps) ;
- tex->setCategory(LLGLTexture::LOCAL) ;
- return tex ;
+ LLPointer<LLViewerTexture> tex = new LLViewerTexture(raw, usemipmaps);
+ tex->setCategory(LLGLTexture::LOCAL);
+ return tex;
}
LLPointer<LLViewerTexture> LLViewerTextureManager::getLocalTexture(const U32 width, const U32 height, const U8 components, BOOL usemipmaps, BOOL generate_gl_tex)
{
- LLPointer<LLViewerTexture> tex = new LLViewerTexture(width, height, components, usemipmaps) ;
+ LLPointer<LLViewerTexture> tex = new LLViewerTexture(width, height, components, usemipmaps);
if(generate_gl_tex)
{
- tex->generateGLTexture() ;
- tex->setCategory(LLGLTexture::LOCAL) ;
+ tex->generateGLTexture();
+ tex->setCategory(LLGLTexture::LOCAL);
}
- return tex ;
+ return tex;
}
LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTexture(
@@ -271,11 +275,11 @@ LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTexture(
LLGLenum primary_format,
LLHost request_from_host)
{
- return gTextureList.getImage(image_id, f_type, usemipmaps, boost_priority, texture_type, internal_format, primary_format, request_from_host) ;
+ return gTextureList.getImage(image_id, f_type, usemipmaps, boost_priority, texture_type, internal_format, primary_format, request_from_host);
}
LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTextureFromFile(
- const std::string& filename,
+ const std::string& filename,
FTType f_type,
BOOL usemipmaps,
LLViewerTexture::EBoostLevel boost_priority,
@@ -284,11 +288,11 @@ LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTextureFromFile(
LLGLenum primary_format,
const LLUUID& force_id)
{
- return gTextureList.getImageFromFile(filename, f_type, usemipmaps, boost_priority, texture_type, internal_format, primary_format, force_id) ;
+ return gTextureList.getImageFromFile(filename, f_type, usemipmaps, boost_priority, texture_type, internal_format, primary_format, force_id);
}
//static
-LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTextureFromUrl(const std::string& url,
+LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTextureFromUrl(const std::string& url,
FTType f_type,
BOOL usemipmaps,
LLViewerTexture::EBoostLevel boost_priority,
@@ -298,12 +302,12 @@ LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTextureFromUrl(const s
const LLUUID& force_id
)
{
- return gTextureList.getImageFromUrl(url, f_type, usemipmaps, boost_priority, texture_type, internal_format, primary_format, force_id) ;
+ return gTextureList.getImageFromUrl(url, f_type, usemipmaps, boost_priority, texture_type, internal_format, primary_format, force_id);
}
LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTextureFromHost(const LLUUID& image_id, FTType f_type, LLHost host)
{
- return gTextureList.getImageFromHost(image_id, f_type, host) ;
+ return gTextureList.getImageFromHost(image_id, f_type, host);
}
// Create a bridge to the viewer texture manager.
@@ -331,15 +335,15 @@ void LLViewerTextureManager::init()
{
LLPointer<LLImageRaw> raw = new LLImageRaw(1,1,3);
raw->clear(0x77, 0x77, 0x77, 0xFF);
- LLViewerTexture::sNullImagep = LLViewerTextureManager::getLocalTexture(raw.get(), TRUE) ;
+ LLViewerTexture::sNullImagep = LLViewerTextureManager::getLocalTexture(raw.get(), TRUE);
}
const S32 dim = 128;
LLPointer<LLImageRaw> image_raw = new LLImageRaw(dim,dim,3);
U8* data = image_raw->getData();
- memset(data, 0, dim * dim * 3) ;
- LLViewerTexture::sBlackImagep = LLViewerTextureManager::getLocalTexture(image_raw.get(), TRUE) ;
+ memset(data, 0, dim * dim * 3);
+ LLViewerTexture::sBlackImagep = LLViewerTextureManager::getLocalTexture(image_raw.get(), TRUE);
#if 1
LLPointer<LLViewerFetchedTexture> imagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT);
@@ -368,16 +372,16 @@ void LLViewerTextureManager::init()
}
imagep->createGLTexture(0, image_raw);
//cache the raw image
- imagep->setCachedRawImage(0, image_raw) ;
+ imagep->setCachedRawImage(0, image_raw);
image_raw = NULL;
#else
LLViewerFetchedTexture::sDefaultImagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, TRUE, LLGLTexture::BOOST_UI);
#endif
LLViewerFetchedTexture::sDefaultImagep->dontDiscard();
- LLViewerFetchedTexture::sDefaultImagep->setCategory(LLGLTexture::OTHER) ;
+ LLViewerFetchedTexture::sDefaultImagep->setCategory(LLGLTexture::OTHER);
LLViewerFetchedTexture::sSmokeImagep = LLViewerTextureManager::getFetchedTexture(IMG_SMOKE, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI);
- LLViewerFetchedTexture::sSmokeImagep->setNoDelete() ;
+ LLViewerFetchedTexture::sSmokeImagep->setNoDelete();
image_raw = new LLImageRaw(32,32,3);
data = image_raw->getData();
@@ -394,14 +398,14 @@ void LLViewerTextureManager::init()
LLViewerTexture::sCheckerBoardImagep = LLViewerTextureManager::getLocalTexture(image_raw.get(), TRUE);
- LLViewerTexture::initClass() ;
-
+ LLViewerTexture::initClass();
+
// Create a texture manager bridge.
gTextureManagerBridgep = new LLViewerTextureManagerBridge;
if (LLMetricPerformanceTesterBasic::isMetricLogRequested(sTesterName) && !LLMetricPerformanceTesterBasic::getTester(sTesterName))
{
- sTesterp = new LLTexturePipelineTester() ;
+ sTesterp = new LLTexturePipelineTester();
if (!sTesterp->isValid())
{
delete sTesterp;
@@ -415,7 +419,7 @@ void LLViewerTextureManager::cleanup()
stop_glerror();
delete gTextureManagerBridgep;
- LLImageGL::sDefaultGLTexture = NULL ;
+ LLImageGL::sDefaultGLTexture = NULL;
LLViewerTexture::sNullImagep = NULL;
LLViewerTexture::sBlackImagep = NULL;
LLViewerTexture::sCheckerBoardImagep = NULL;
@@ -427,7 +431,7 @@ void LLViewerTextureManager::cleanup()
LLViewerFetchedTexture::sFlatNormalImagep = NULL;
- LLViewerMediaTexture::cleanUpClass() ;
+ LLViewerMediaTexture::cleanUpClass();
}
//----------------------------------------------------------------------------------------------
@@ -437,7 +441,7 @@ void LLViewerTextureManager::cleanup()
// static
void LLViewerTexture::initClass()
{
- LLImageGL::sDefaultGLTexture = LLViewerFetchedTexture::sDefaultImagep->getGLTexture() ;
+ LLImageGL::sDefaultGLTexture = LLViewerFetchedTexture::sDefaultImagep->getGLTexture();
if(gSavedSettings.getBOOL("TextureFetchDebuggerEnabled"))
{
@@ -453,42 +457,42 @@ const S32 min_non_tex_system_mem = (128<<20); // 128 MB
F32 texmem_lower_bound_scale = 0.85f;
F32 texmem_middle_bound_scale = 0.925f;
-static LLFastTimer::DeclareTimer FTM_TEXTURE_MEMORY_CHECK("Memory Check");
+static LLTrace::BlockTimerStatHandle FTM_TEXTURE_MEMORY_CHECK("Memory Check");
//static
bool LLViewerTexture::isMemoryForTextureLow()
{
- const F32 WAIT_TIME = 1.0f ; //second
- static LLFrameTimer timer ;
+ const F32 WAIT_TIME = 1.0f; //second
+ static LLFrameTimer timer;
if(timer.getElapsedTimeF32() < WAIT_TIME) //call this once per second.
{
return false;
}
- timer.reset() ;
+ timer.reset();
- LLFastTimer t(FTM_TEXTURE_MEMORY_CHECK);
+ LL_RECORD_BLOCK_TIME(FTM_TEXTURE_MEMORY_CHECK);
- const S32 MIN_FREE_TEXTURE_MEMORY = 5 ; //MB
- const S32 MIN_FREE_MAIN_MEMORy = 100 ; //MB
+ const S32Megabytes MIN_FREE_TEXTURE_MEMORY(5); //MB
+ const S32Megabytes MIN_FREE_MAIN_MEMORY(100); //MB
- bool low_mem = false ;
+ bool low_mem = false;
if (gGLManager.mHasATIMemInfo)
{
S32 meminfo[4];
glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI, meminfo);
- if(meminfo[0] / 1024 < MIN_FREE_TEXTURE_MEMORY)
+ if((S32Megabytes)meminfo[0] < MIN_FREE_TEXTURE_MEMORY)
{
- low_mem = true ;
+ low_mem = true;
}
if(!low_mem) //check main memory, only works for windows.
{
- LLMemory::updateMemoryInfo() ;
- if(LLMemory::getAvailableMemKB() / 1024 < MIN_FREE_MAIN_MEMORy)
+ LLMemory::updateMemoryInfo();
+ if(LLMemory::getAvailableMemKB() < MIN_FREE_TEXTURE_MEMORY)
{
- low_mem = true ;
+ low_mem = true;
}
}
}
@@ -500,45 +504,45 @@ bool LLViewerTexture::isMemoryForTextureLow()
if(free_memory / 1024 < MIN_FREE_TEXTURE_MEMORY)
{
- low_mem = true ;
+ low_mem = true;
}
}
#endif
- return low_mem ;
+ return low_mem;
}
-static LLFastTimer::DeclareTimer FTM_TEXTURE_UPDATE_MEDIA("Media");
-static LLFastTimer::DeclareTimer FTM_TEXTURE_UPDATE_TEST("Test");
+static LLTrace::BlockTimerStatHandle FTM_TEXTURE_UPDATE_MEDIA("Media");
+static LLTrace::BlockTimerStatHandle FTM_TEXTURE_UPDATE_TEST("Test");
//static
void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity)
{
- sCurrentTime = gFrameTimeSeconds ;
+ sCurrentTime = gFrameTimeSeconds;
LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName);
if (tester)
{
- LLFastTimer t(FTM_TEXTURE_UPDATE_TEST);
- tester->update() ;
+ LL_RECORD_BLOCK_TIME(FTM_TEXTURE_UPDATE_TEST);
+ tester->update();
}
{
- LLFastTimer t(FTM_TEXTURE_UPDATE_MEDIA);
- LLViewerMediaTexture::updateClass() ;
+ LL_RECORD_BLOCK_TIME(FTM_TEXTURE_UPDATE_MEDIA);
+ LLViewerMediaTexture::updateClass();
}
- sBoundTextureMemoryInBytes = LLImageGL::sBoundTextureMemoryInBytes;//in bytes
- sTotalTextureMemoryInBytes = LLImageGL::sGlobalTextureMemoryInBytes;//in bytes
- sMaxBoundTextureMemInMegaBytes = gTextureList.getMaxResidentTexMem();//in MB
- sMaxTotalTextureMemInMegaBytes = gTextureList.getMaxTotalTextureMem() ;//in MB
- sMaxDesiredTextureMemInBytes = MEGA_BYTES_TO_BYTES(sMaxTotalTextureMemInMegaBytes) ; //in Bytes, by default and when total used texture memory is small.
+ sBoundTextureMemory = LLImageGL::sBoundTextureMemory;
+ sTotalTextureMemory = LLImageGL::sGlobalTextureMemory;
+ sMaxBoundTextureMemory = gTextureList.getMaxResidentTexMem();
+ sMaxTotalTextureMem = gTextureList.getMaxTotalTextureMem();
+ sMaxDesiredTextureMem = sMaxTotalTextureMem; //in Bytes, by default and when total used texture memory is small.
- if (BYTES_TO_MEGA_BYTES(sBoundTextureMemoryInBytes) >= sMaxBoundTextureMemInMegaBytes ||
- BYTES_TO_MEGA_BYTES(sTotalTextureMemoryInBytes) >= sMaxTotalTextureMemInMegaBytes)
+ if (sBoundTextureMemory >= sMaxBoundTextureMemory ||
+ sTotalTextureMemory >= sMaxTotalTextureMem)
{
- //when texture memory overflows, lower down the threashold to release the textures more aggressively.
- sMaxDesiredTextureMemInBytes = llmin((S32)(sMaxDesiredTextureMemInBytes * 0.75f) , MEGA_BYTES_TO_BYTES(MAX_VIDEO_RAM_IN_MEGA_BYTES)) ;//512 MB
+ //when texture memory overflows, lower down the threshold to release the textures more aggressively.
+ sMaxDesiredTextureMem = llmin(sMaxDesiredTextureMem * 0.75f, F32Bytes(gMaxVideoRam));
// If we are using more texture memory than we should,
// scale up the desired discard level
@@ -554,8 +558,8 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity
sEvaluationTimer.reset();
}
else if (sDesiredDiscardBias > 0.0f &&
- BYTES_TO_MEGA_BYTES(sBoundTextureMemoryInBytes) < sMaxBoundTextureMemInMegaBytes * texmem_lower_bound_scale &&
- BYTES_TO_MEGA_BYTES(sTotalTextureMemoryInBytes) < sMaxTotalTextureMemInMegaBytes * texmem_lower_bound_scale)
+ sBoundTextureMemory < sMaxBoundTextureMemory * texmem_lower_bound_scale &&
+ sTotalTextureMemory < sMaxTotalTextureMem * texmem_lower_bound_scale)
{
// If we are using less texture memory than we should,
// scale down the desired discard level
@@ -566,14 +570,14 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity
}
}
sDesiredDiscardBias = llclamp(sDesiredDiscardBias, desired_discard_bias_min, desired_discard_bias_max);
-
- F32 camera_moving_speed = LLViewerCamera::getInstance()->getAverageSpeed() ;
+
+ F32 camera_moving_speed = LLViewerCamera::getInstance()->getAverageSpeed();
F32 camera_angular_speed = LLViewerCamera::getInstance()->getAverageAngularSpeed();
sCameraMovingBias = llmax(0.2f * camera_moving_speed, 2.0f * camera_angular_speed - 1);
sCameraMovingDiscardBias = (S8)(sCameraMovingBias);
- LLViewerTexture::sFreezeImageScalingDown = (BYTES_TO_MEGA_BYTES(sBoundTextureMemoryInBytes) < 0.75f * sMaxBoundTextureMemInMegaBytes * texmem_middle_bound_scale) &&
- (BYTES_TO_MEGA_BYTES(sTotalTextureMemoryInBytes) < 0.75f * sMaxTotalTextureMemInMegaBytes * texmem_middle_bound_scale) ;
+ LLViewerTexture::sFreezeImageScalingDown = (sBoundTextureMemory < 0.75f * sMaxBoundTextureMemory * texmem_middle_bound_scale) &&
+ (sTotalTextureMemory < 0.75f * sMaxTotalTextureMem * texmem_middle_bound_scale);
}
//end of static functions
@@ -618,7 +622,7 @@ LLViewerTexture::LLViewerTexture(const LLImageRaw* raw, BOOL usemipmaps) :
LLViewerTexture::~LLViewerTexture()
{
- // LL_DEBUGS("Avatar") << mID << llendl;
+ // LL_DEBUGS("Avatar") << mID << LL_ENDL;
cleanup();
sImageCount--;
}
@@ -629,31 +633,31 @@ void LLViewerTexture::init(bool firstinit)
mSelectedTime = 0.f;
mMaxVirtualSize = 0.f;
mMaxVirtualSizeResetInterval = 1;
- mMaxVirtualSizeResetCounter = mMaxVirtualSizeResetInterval ;
- mAdditionalDecodePriority = 0.f ;
- mParcelMedia = NULL ;
+ mMaxVirtualSizeResetCounter = mMaxVirtualSizeResetInterval;
+ mAdditionalDecodePriority = 0.f;
+ mParcelMedia = NULL;
mNumVolumes = 0;
- mFaceList[LLRender::DIFFUSE_MAP].clear() ;
- mFaceList[LLRender::NORMAL_MAP].clear() ;
- mFaceList[LLRender::SPECULAR_MAP].clear() ;
+ mFaceList[LLRender::DIFFUSE_MAP].clear();
+ mFaceList[LLRender::NORMAL_MAP].clear();
+ mFaceList[LLRender::SPECULAR_MAP].clear();
mNumFaces[LLRender::DIFFUSE_MAP] =
mNumFaces[LLRender::NORMAL_MAP] =
- mNumFaces[LLRender::SPECULAR_MAP] = 0 ;
+ mNumFaces[LLRender::SPECULAR_MAP] = 0;
mVolumeList.clear();
}
//virtual
S8 LLViewerTexture::getType() const
{
- return LLViewerTexture::LOCAL_TEXTURE ;
+ return LLViewerTexture::LOCAL_TEXTURE;
}
void LLViewerTexture::cleanup()
{
- mFaceList[LLRender::DIFFUSE_MAP].clear() ;
- mFaceList[LLRender::NORMAL_MAP].clear() ;
- mFaceList[LLRender::SPECULAR_MAP].clear() ;
+ mFaceList[LLRender::DIFFUSE_MAP].clear();
+ mFaceList[LLRender::NORMAL_MAP].clear();
+ mFaceList[LLRender::SPECULAR_MAP].clear();
mVolumeList.clear();
}
@@ -662,20 +666,20 @@ void LLViewerTexture::dump()
{
LLGLTexture::dump();
- llinfos << "LLViewerTexture"
+ LL_INFOS() << "LLViewerTexture"
<< " mID " << mID
- << llendl;
+ << LL_ENDL;
}
void LLViewerTexture::setBoostLevel(S32 level)
{
if(mBoostLevel != level)
{
- mBoostLevel = level ;
+ mBoostLevel = level;
if(mBoostLevel != LLViewerTexture::BOOST_NONE &&
mBoostLevel != LLViewerTexture::BOOST_SELECTED)
{
- setNoDelete() ;
+ setNoDelete();
}
}
@@ -683,6 +687,30 @@ void LLViewerTexture::setBoostLevel(S32 level)
{
mSelectedTime = gFrameTimeSeconds;
}
+
+}
+
+bool LLViewerTexture::isActiveFetching()
+{
+ return false;
+}
+
+bool LLViewerTexture::bindDebugImage(const S32 stage)
+{
+ if (stage < 0) return false;
+
+ bool res = true;
+ if (LLViewerTexture::sCheckerBoardImagep.notNull() && (this != LLViewerTexture::sCheckerBoardImagep.get()))
+ {
+ res = gGL.getTexUnit(stage)->bind(LLViewerTexture::sCheckerBoardImagep);
+ }
+
+ if(!res)
+ {
+ return bindDefaultImage(stage);
+ }
+
+ return res;
}
bool LLViewerTexture::bindDefaultImage(S32 stage)
@@ -701,17 +729,17 @@ bool LLViewerTexture::bindDefaultImage(S32 stage)
}
if (!res)
{
- llwarns << "LLViewerTexture::bindDefaultImage failed." << llendl;
+ LL_WARNS() << "LLViewerTexture::bindDefaultImage failed." << LL_ENDL;
}
stop_glerror();
//check if there is cached raw image and switch to it if possible
- switchToCachedImage() ;
+ switchToCachedImage();
LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName);
if (tester)
{
- tester->updateGrayTextureBinding() ;
+ tester->updateGrayTextureBinding();
}
return res;
}
@@ -731,17 +759,17 @@ void LLViewerTexture::addTextureStats(F32 virtual_size, BOOL needs_gltexture) co
{
if(needs_gltexture)
{
- mNeedsGLTexture = TRUE ;
+ mNeedsGLTexture = TRUE;
}
virtual_size *= sTexelPixelRatio;
if(!mMaxVirtualSizeResetCounter)
{
//flag to reset the values because the old values are used.
- resetMaxVirtualSizeResetCounter() ;
+ resetMaxVirtualSizeResetCounter();
mMaxVirtualSize = virtual_size;
- mAdditionalDecodePriority = 0.f ;
- mNeedsGLTexture = needs_gltexture ;
+ mAdditionalDecodePriority = 0.f;
+ mNeedsGLTexture = needs_gltexture;
}
else if (virtual_size > mMaxVirtualSize)
{
@@ -751,15 +779,15 @@ void LLViewerTexture::addTextureStats(F32 virtual_size, BOOL needs_gltexture) co
void LLViewerTexture::resetTextureStats()
{
- mMaxVirtualSize = 0.0f ;
- mAdditionalDecodePriority = 0.f ;
- mMaxVirtualSizeResetCounter = 0 ;
+ mMaxVirtualSize = 0.0f;
+ mAdditionalDecodePriority = 0.f;
+ mMaxVirtualSizeResetCounter = 0;
}
//virtual
F32 LLViewerTexture::getMaxVirtualSize()
{
- return mMaxVirtualSize ;
+ return mMaxVirtualSize;
}
//virtual
@@ -775,12 +803,12 @@ void LLViewerTexture::addFace(U32 ch, LLFace* facep)
if(mNumFaces[ch] >= mFaceList[ch].size())
{
- mFaceList[ch].resize(2 * mNumFaces[ch] + 1) ;
+ mFaceList[ch].resize(2 * mNumFaces[ch] + 1);
}
- mFaceList[ch][mNumFaces[ch]] = facep ;
- facep->setIndexInTex(ch, mNumFaces[ch]) ;
- mNumFaces[ch]++ ;
- mLastFaceListUpdateTimer.reset() ;
+ mFaceList[ch][mNumFaces[ch]] = facep;
+ facep->setIndexInTex(ch, mNumFaces[ch]);
+ mNumFaces[ch]++;
+ mLastFaceListUpdateTimer.reset();
}
//virtual
@@ -790,18 +818,18 @@ void LLViewerTexture::removeFace(U32 ch, LLFace* facep)
if(mNumFaces[ch] > 1)
{
- S32 index = facep->getIndexInTex(ch) ;
+ S32 index = facep->getIndexInTex(ch);
llassert(index < mFaceList[ch].size());
llassert(index < mNumFaces[ch]);
- mFaceList[ch][index] = mFaceList[ch][--mNumFaces[ch]] ;
- mFaceList[ch][index]->setIndexInTex(ch, index) ;
+ mFaceList[ch][index] = mFaceList[ch][--mNumFaces[ch]];
+ mFaceList[ch][index]->setIndexInTex(ch, index);
}
else
{
- mFaceList[ch].clear() ;
- mNumFaces[ch] = 0 ;
+ mFaceList[ch].clear();
+ mNumFaces[ch] = 0;
}
- mLastFaceListUpdateTimer.reset() ;
+ mLastFaceListUpdateTimer.reset();
}
S32 LLViewerTexture::getTotalNumFaces() const
@@ -828,12 +856,12 @@ void LLViewerTexture::addVolume(LLVOVolume* volumep)
{
if( mNumVolumes >= mVolumeList.size())
{
- mVolumeList.resize(2 * mNumVolumes + 1) ;
+ mVolumeList.resize(2 * mNumVolumes + 1);
}
- mVolumeList[mNumVolumes] = volumep ;
- volumep->setIndexInTex(mNumVolumes) ;
- mNumVolumes++ ;
- mLastVolumeListUpdateTimer.reset() ;
+ mVolumeList[mNumVolumes] = volumep;
+ volumep->setIndexInTex(mNumVolumes);
+ mNumVolumes++;
+ mLastVolumeListUpdateTimer.reset();
}
//virtual
@@ -841,29 +869,29 @@ void LLViewerTexture::removeVolume(LLVOVolume* volumep)
{
if(mNumVolumes > 1)
{
- S32 index = volumep->getIndexInTex() ;
+ S32 index = volumep->getIndexInTex();
llassert(index < mVolumeList.size());
llassert(index < mNumVolumes);
- mVolumeList[index] = mVolumeList[--mNumVolumes] ;
- mVolumeList[index]->setIndexInTex(index) ;
+ mVolumeList[index] = mVolumeList[--mNumVolumes];
+ mVolumeList[index]->setIndexInTex(index);
}
else
{
- mVolumeList.clear() ;
- mNumVolumes = 0 ;
+ mVolumeList.clear();
+ mNumVolumes = 0;
}
- mLastVolumeListUpdateTimer.reset() ;
+ mLastVolumeListUpdateTimer.reset();
}
S32 LLViewerTexture::getNumVolumes() const
{
- return mNumVolumes ;
+ return mNumVolumes;
}
void LLViewerTexture::reorganizeFaceList()
{
static const F32 MAX_WAIT_TIME = 20.f; // seconds
- static const U32 MAX_EXTRA_BUFFER_SIZE = 4 ;
+ static const U32 MAX_EXTRA_BUFFER_SIZE = 4;
if(mLastFaceListUpdateTimer.getElapsedTimeF32() < MAX_WAIT_TIME)
{
@@ -873,32 +901,32 @@ void LLViewerTexture::reorganizeFaceList()
for (U32 i = 0; i < LLRender::NUM_TEXTURE_CHANNELS; ++i)
{
if(mNumFaces[i] + MAX_EXTRA_BUFFER_SIZE > mFaceList[i].size())
- {
- return ;
- }
-
+ {
+ return;
+ }
+
mFaceList[i].erase(mFaceList[i].begin() + mNumFaces[i], mFaceList[i].end());
}
- mLastFaceListUpdateTimer.reset() ;
+ mLastFaceListUpdateTimer.reset();
}
void LLViewerTexture::reorganizeVolumeList()
{
static const F32 MAX_WAIT_TIME = 20.f; // seconds
- static const U32 MAX_EXTRA_BUFFER_SIZE = 4 ;
+ static const U32 MAX_EXTRA_BUFFER_SIZE = 4;
if(mNumVolumes + MAX_EXTRA_BUFFER_SIZE > mVolumeList.size())
{
- return ;
+ return;
}
if(mLastVolumeListUpdateTimer.getElapsedTimeF32() < MAX_WAIT_TIME)
{
- return ;
+ return;
}
- mLastVolumeListUpdateTimer.reset() ;
+ mLastVolumeListUpdateTimer.reset();
mVolumeList.erase(mVolumeList.begin() + mNumVolumes, mVolumeList.end());
}
@@ -916,7 +944,7 @@ void LLViewerTexture::setCachedRawImage(S32 discard_level, LLImageRaw* imageraw)
BOOL LLViewerTexture::isLargeImage()
{
- return (S32)mTexelsPerImage > LLViewerTexture::sMinLargeImageSize ;
+ return (S32)mTexelsPerImage > LLViewerTexture::sMinLargeImageSize;
}
//virtual
@@ -925,7 +953,7 @@ void LLViewerTexture::updateBindStatsForTester()
LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName);
if (tester)
{
- tester->updateTextureBindingStats(this) ;
+ tester->updateTextureBindingStats(this);
}
}
@@ -933,6 +961,27 @@ void LLViewerTexture::updateBindStatsForTester()
//end of LLViewerTexture
//----------------------------------------------------------------------------------------------
+const std::string& fttype_to_string(const FTType& fttype)
+{
+ static const std::string ftt_unknown("FTT_UNKNOWN");
+ static const std::string ftt_default("FTT_DEFAULT");
+ static const std::string ftt_server_bake("FTT_SERVER_BAKE");
+ static const std::string ftt_host_bake("FTT_HOST_BAKE");
+ static const std::string ftt_map_tile("FTT_MAP_TILE");
+ static const std::string ftt_local_file("FTT_LOCAL_FILE");
+ static const std::string ftt_error("FTT_ERROR");
+ switch(fttype)
+ {
+ case FTT_UNKNOWN: return ftt_unknown; break;
+ case FTT_DEFAULT: return ftt_default; break;
+ case FTT_SERVER_BAKE: return ftt_server_bake; break;
+ case FTT_HOST_BAKE: return ftt_host_bake; break;
+ case FTT_MAP_TILE: return ftt_map_tile; break;
+ case FTT_LOCAL_FILE: return ftt_local_file; break;
+ }
+ return ftt_error;
+}
+
//----------------------------------------------------------------------------------------------
//start of LLViewerFetchedTexture
//----------------------------------------------------------------------------------------------
@@ -941,19 +990,19 @@ LLViewerFetchedTexture::LLViewerFetchedTexture(const LLUUID& id, FTType f_type,
: LLViewerTexture(id, usemipmaps),
mTargetHost(host)
{
- init(TRUE) ;
+ init(TRUE);
mFTType = f_type;
if (mFTType == FTT_HOST_BAKE)
{
- mCanUseHTTP = false;
+ LL_WARNS() << "Unsupported fetch type " << mFTType << LL_ENDL;
}
- generateGLTexture() ;
+ generateGLTexture();
}
LLViewerFetchedTexture::LLViewerFetchedTexture(const LLImageRaw* raw, FTType f_type, BOOL usemipmaps)
: LLViewerTexture(raw, usemipmaps)
{
- init(TRUE) ;
+ init(TRUE);
mFTType = f_type;
}
@@ -961,20 +1010,21 @@ LLViewerFetchedTexture::LLViewerFetchedTexture(const std::string& url, FTType f_
: LLViewerTexture(id, usemipmaps),
mUrl(url)
{
- init(TRUE) ;
+ init(TRUE);
mFTType = f_type;
- generateGLTexture() ;
+ generateGLTexture();
}
void LLViewerFetchedTexture::init(bool firstinit)
{
mOrigWidth = 0;
mOrigHeight = 0;
+ mHasAux = FALSE;
mNeedsAux = FALSE;
mRequestedDiscardLevel = -1;
mRequestedDownloadPriority = 0.f;
mFullyLoaded = FALSE;
- mCanUseHTTP = true ;
+ mCanUseHTTP = true;
mDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1;
mMinDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1;
@@ -982,7 +1032,7 @@ void LLViewerFetchedTexture::init(bool firstinit)
mKnownDrawWidth = 0;
mKnownDrawHeight = 0;
- mKnownDrawSizeChanged = FALSE ;
+ mKnownDrawSizeChanged = FALSE;
if (firstinit)
{
@@ -995,7 +1045,7 @@ void LLViewerFetchedTexture::init(bool firstinit)
mIsMissingAsset = FALSE;
mLoadedCallbackDesiredDiscardLevel = S8_MAX;
- mPauseLoadedCallBacks = FALSE ;
+ mPauseLoadedCallBacks = FALSE;
mNeedsCreateTexture = FALSE;
@@ -1010,23 +1060,23 @@ void LLViewerFetchedTexture::init(bool firstinit)
mDownloadProgress = 0.f;
mFetchDeltaTime = 999999.f;
mRequestDeltaTime = 0.f;
- mForSculpt = FALSE ;
- mIsFetched = FALSE ;
+ mForSculpt = FALSE;
+ mIsFetched = FALSE;
mInFastCacheList = FALSE;
- mCachedRawImage = NULL ;
- mCachedRawDiscardLevel = -1 ;
- mCachedRawImageReady = FALSE ;
+ mCachedRawImage = NULL;
+ mCachedRawDiscardLevel = -1;
+ mCachedRawImageReady = FALSE;
- mSavedRawImage = NULL ;
- mForceToSaveRawImage = FALSE ;
- mSaveRawImage = FALSE ;
- mSavedRawDiscardLevel = -1 ;
- mDesiredSavedRawDiscardLevel = -1 ;
- mLastReferencedSavedRawImageTime = 0.0f ;
- mKeptSavedRawImageTime = 0.f ;
+ mSavedRawImage = NULL;
+ mForceToSaveRawImage = FALSE;
+ mSaveRawImage = FALSE;
+ mSavedRawDiscardLevel = -1;
+ mDesiredSavedRawDiscardLevel = -1;
+ mLastReferencedSavedRawImageTime = 0.0f;
+ mKeptSavedRawImageTime = 0.f;
mLastCallBackActiveTime = 0.f;
-
+ mForceCallbackFetch = FALSE;
mInDebug = FALSE;
mFTType = FTT_UNKNOWN;
@@ -1047,7 +1097,7 @@ LLViewerFetchedTexture::~LLViewerFetchedTexture()
//virtual
S8 LLViewerFetchedTexture::getType() const
{
- return LLViewerTexture::FETCHED_TEXTURE ;
+ return LLViewerTexture::FETCHED_TEXTURE;
}
FTType LLViewerFetchedTexture::getFTType() const
@@ -1064,7 +1114,7 @@ void LLViewerFetchedTexture::cleanup()
// We never finished loading the image. Indicate failure.
// Note: this allows mLoadedCallbackUserData to be cleaned up.
entryp->mCallback( FALSE, this, NULL, NULL, 0, TRUE, entryp->mUserData );
- entryp->removeTexture(this) ;
+ entryp->removeTexture(this);
delete entryp;
}
mLoadedCallbackList.clear();
@@ -1072,10 +1122,10 @@ void LLViewerFetchedTexture::cleanup()
// Clean up image data
destroyRawImage();
- mCachedRawImage = NULL ;
- mCachedRawDiscardLevel = -1 ;
- mCachedRawImageReady = FALSE ;
- mSavedRawImage = NULL ;
+ mCachedRawImage = NULL;
+ mCachedRawDiscardLevel = -1;
+ mCachedRawImageReady = FALSE;
+ mSavedRawImage = NULL;
mSavedRawDiscardLevel = -1;
}
@@ -1088,7 +1138,7 @@ void LLViewerFetchedTexture::loadFromFastCache()
}
mInFastCacheList = FALSE;
- mRawImage = LLAppViewer::getTextureCache()->readFromFastCache(getID(), mRawDiscardLevel) ;
+ mRawImage = LLAppViewer::getTextureCache()->readFromFastCache(getID(), mRawDiscardLevel);
if(mRawImage.notNull())
{
mFullWidth = mRawImage->getWidth() << mRawDiscardLevel;
@@ -1099,58 +1149,58 @@ void LLViewerFetchedTexture::loadFromFastCache()
{
//discard all oversized textures.
destroyRawImage();
- llwarns << "oversized, setting as missing" << llendl;
+ LL_WARNS() << "oversized, setting as missing" << LL_ENDL;
setIsMissingAsset();
- mRawDiscardLevel = INVALID_DISCARD_LEVEL ;
+ mRawDiscardLevel = INVALID_DISCARD_LEVEL;
}
else
{
mRequestedDiscardLevel = mDesiredDiscardLevel + 1;
mIsRawImageValid = TRUE;
- addToCreateTexture() ;
+ addToCreateTexture();
}
}
}
void LLViewerFetchedTexture::setForSculpt()
{
- static const S32 MAX_INTERVAL = 8 ; //frames
+ static const S32 MAX_INTERVAL = 8; //frames
- mForSculpt = TRUE ;
+ mForSculpt = TRUE;
if(isForSculptOnly() && hasGLTexture() && !getBoundRecently())
{
- destroyGLTexture() ; //sculpt image does not need gl texture.
+ destroyGLTexture(); //sculpt image does not need gl texture.
mTextureState = ACTIVE;
}
- checkCachedRawSculptImage() ;
- setMaxVirtualSizeResetInterval(MAX_INTERVAL) ;
+ checkCachedRawSculptImage();
+ setMaxVirtualSizeResetInterval(MAX_INTERVAL);
}
BOOL LLViewerFetchedTexture::isForSculptOnly() const
{
- return mForSculpt && !mNeedsGLTexture ;
+ return mForSculpt && !mNeedsGLTexture;
}
BOOL LLViewerFetchedTexture::isDeleted()
{
- return mTextureState == DELETED ;
+ return mTextureState == DELETED;
}
BOOL LLViewerFetchedTexture::isInactive()
{
- return mTextureState == INACTIVE ;
+ return mTextureState == INACTIVE;
}
BOOL LLViewerFetchedTexture::isDeletionCandidate()
{
- return mTextureState == DELETION_CANDIDATE ;
+ return mTextureState == DELETION_CANDIDATE;
}
void LLViewerFetchedTexture::setDeletionCandidate()
{
if(mGLTexturep.notNull() && mGLTexturep->getTexName() && (mTextureState == INACTIVE))
{
- mTextureState = DELETION_CANDIDATE ;
+ mTextureState = DELETION_CANDIDATE;
}
}
@@ -1159,7 +1209,7 @@ void LLViewerFetchedTexture::setInactive()
{
if(mTextureState == ACTIVE && mGLTexturep.notNull() && mGLTexturep->getTexName() && !mGLTexturep->getBoundRecently())
{
- mTextureState = INACTIVE ;
+ mTextureState = INACTIVE;
}
}
@@ -1176,84 +1226,84 @@ void LLViewerFetchedTexture::dump()
{
LLViewerTexture::dump();
- llinfos << "Dump : " << mID
+ LL_INFOS() << "Dump : " << mID
<< ", mIsMissingAsset = " << (S32)mIsMissingAsset
<< ", mFullWidth = " << (S32)mFullWidth
<< ", mFullHeight = " << (S32)mFullHeight
<< ", mOrigWidth = " << (S32)mOrigWidth
<< ", mOrigHeight = " << (S32)mOrigHeight
- << llendl;
- llinfos << " : "
+ << LL_ENDL;
+ LL_INFOS() << " : "
<< " mFullyLoaded = " << (S32)mFullyLoaded
<< ", mFetchState = " << (S32)mFetchState
<< ", mFetchPriority = " << (S32)mFetchPriority
<< ", mDownloadProgress = " << (F32)mDownloadProgress
- << llendl;
- llinfos << " : "
+ << LL_ENDL;
+ LL_INFOS() << " : "
<< " mHasFetcher = " << (S32)mHasFetcher
<< ", mIsFetching = " << (S32)mIsFetching
<< ", mIsFetched = " << (S32)mIsFetched
<< ", mBoostLevel = " << (S32)mBoostLevel
- << llendl;
+ << LL_ENDL;
}
///////////////////////////////////////////////////////////////////////////////
// ONLY called from LLViewerFetchedTextureList
void LLViewerFetchedTexture::destroyTexture()
{
- if(LLImageGL::sGlobalTextureMemoryInBytes < sMaxDesiredTextureMemInBytes * 0.95f)//not ready to release unused memory.
+ if(LLImageGL::sGlobalTextureMemory < sMaxDesiredTextureMem * 0.95f)//not ready to release unused memory.
{
return ;
}
if (mNeedsCreateTexture)//return if in the process of generating a new texture.
{
- return ;
+ return;
}
-
- //LL_DEBUGS("Avatar") << mID << llendl;
- destroyGLTexture() ;
- mFullyLoaded = FALSE ;
+
+ //LL_DEBUGS("Avatar") << mID << LL_ENDL;
+ destroyGLTexture();
+ mFullyLoaded = FALSE;
}
void LLViewerFetchedTexture::addToCreateTexture()
{
- bool force_update = false ;
+ bool force_update = false;
if (getComponents() != mRawImage->getComponents())
{
// We've changed the number of components, so we need to move any
// objects using this pool to a different pool.
mComponents = mRawImage->getComponents();
- mGLTexturep->setComponents(mComponents) ;
- force_update = true ;
+ mGLTexturep->setComponents(mComponents);
+ force_update = true;
for (U32 j = 0; j < LLRender::NUM_TEXTURE_CHANNELS; ++j)
{
llassert(mNumFaces[j] <= mFaceList[j].size());
- for(U32 i = 0 ; i < mNumFaces[j]; i++)
- {
- mFaceList[j][i]->dirtyTexture() ;
+ for(U32 i = 0; i < mNumFaces[j]; i++)
+ {
+ mFaceList[j][i]->dirtyTexture();
}
}
//discard the cached raw image and the saved raw image
- mCachedRawImageReady = FALSE ;
- mCachedRawDiscardLevel = -1 ;
- mCachedRawImage = NULL ;
- mSavedRawDiscardLevel = -1 ;
- mSavedRawImage = NULL ;
+ mCachedRawImageReady = FALSE;
+ mCachedRawDiscardLevel = -1;
+ mCachedRawImage = NULL;
+ mSavedRawDiscardLevel = -1;
+ mSavedRawImage = NULL;
}
if(isForSculptOnly())
{
//just update some variables, not to create a real GL texture.
- createGLTexture(mRawDiscardLevel, mRawImage, 0, FALSE) ;
- mNeedsCreateTexture = FALSE ;
+ createGLTexture(mRawDiscardLevel, mRawImage, 0, FALSE);
+ mNeedsCreateTexture = FALSE;
destroyRawImage();
}
else if(!force_update && getDiscardLevel() > -1 && getDiscardLevel() <= mRawDiscardLevel)
{
- mNeedsCreateTexture = FALSE ;
+ mNeedsCreateTexture = FALSE;
destroyRawImage();
}
else
@@ -1273,11 +1323,11 @@ void LLViewerFetchedTexture::addToCreateTexture()
//scale it down to size >= LLViewerTexture::sMinLargeImageSize
if(w * h > LLViewerTexture::sMinLargeImageSize)
{
- S32 d_level = llmin(mRequestedDiscardLevel, (S32)mDesiredDiscardLevel) - mRawDiscardLevel ;
+ S32 d_level = llmin(mRequestedDiscardLevel, (S32)mDesiredDiscardLevel) - mRawDiscardLevel;
if(d_level > 0)
{
- S32 i = 0 ;
+ S32 i = 0;
while((d_level > 0) && ((w >> i) * (h >> i) > LLViewerTexture::sMinLargeImageSize))
{
i++;
@@ -1285,12 +1335,12 @@ void LLViewerFetchedTexture::addToCreateTexture()
}
if(i > 0)
{
- mRawDiscardLevel += i ;
+ mRawDiscardLevel += i;
if(mRawDiscardLevel >= getDiscardLevel() && getDiscardLevel() > 0)
{
- mNeedsCreateTexture = FALSE ;
+ mNeedsCreateTexture = FALSE;
destroyRawImage();
- return ;
+ return;
}
{
@@ -1306,7 +1356,7 @@ void LLViewerFetchedTexture::addToCreateTexture()
mNeedsCreateTexture = TRUE;
gTextureList.mCreateTextureList.insert(this);
}
- return ;
+ return;
}
// ONLY called from LLViewerTextureList
@@ -1320,12 +1370,12 @@ BOOL LLViewerFetchedTexture::createTexture(S32 usename/*= 0*/)
mNeedsCreateTexture = FALSE;
if (mRawImage.isNull())
{
- llerrs << "LLViewerTexture trying to create texture with no Raw Image" << llendl;
+ LL_ERRS() << "LLViewerTexture trying to create texture with no Raw Image" << LL_ENDL;
}
-// llinfos << llformat("IMAGE Creating (%d) [%d x %d] Bytes: %d ",
+// LL_INFOS() << llformat("IMAGE Creating (%d) [%d x %d] Bytes: %d ",
// mRawDiscardLevel,
// mRawImage->getWidth(), mRawImage->getHeight(),mRawImage->getDataSize())
-// << mID.getString() << llendl;
+// << mID.getString() << LL_ENDL;
BOOL res = TRUE;
// store original size only for locally-sourced images
@@ -1360,14 +1410,14 @@ BOOL LLViewerFetchedTexture::createTexture(S32 usename/*= 0*/)
U32 raw_height = mRawImage->getHeight() << mRawDiscardLevel;
if( raw_width > MAX_IMAGE_SIZE || raw_height > MAX_IMAGE_SIZE )
{
- llinfos << "Width or height is greater than " << MAX_IMAGE_SIZE << ": (" << raw_width << "," << raw_height << ")" << llendl;
+ LL_INFOS() << "Width or height is greater than " << MAX_IMAGE_SIZE << ": (" << raw_width << "," << raw_height << ")" << LL_ENDL;
size_okay = false;
}
if (!LLImageGL::checkSize(mRawImage->getWidth(), mRawImage->getHeight()))
{
// A non power-of-two image was uploaded (through a non standard client)
- llinfos << "Non power of two width or height: (" << mRawImage->getWidth() << "," << mRawImage->getHeight() << ")" << llendl;
+ LL_INFOS() << "Non power of two width or height: (" << mRawImage->getWidth() << "," << mRawImage->getHeight() << ")" << LL_ENDL;
size_okay = false;
}
@@ -1376,15 +1426,15 @@ BOOL LLViewerFetchedTexture::createTexture(S32 usename/*= 0*/)
// An inappropriately-sized image was uploaded (through a non standard client)
// We treat these images as missing assets which causes them to
// be renderd as 'missing image' and to stop requesting data
- llwarns << "!size_ok, setting as missing" << llendl;
+ LL_WARNS() << "!size_ok, setting as missing" << LL_ENDL;
setIsMissingAsset();
destroyRawImage();
return FALSE;
}
- res = mGLTexturep->createGLTexture(mRawDiscardLevel, mRawImage, usename, TRUE, mBoostLevel);
+ res = mGLTexturep->createGLTexture(mRawDiscardLevel, mRawImage, usename, TRUE, mBoostLevel);
- setActive() ;
+ setActive();
if (!needsToSaveRawImage())
{
@@ -1400,11 +1450,11 @@ void LLViewerFetchedTexture::setKnownDrawSize(S32 width, S32 height)
{
if(mKnownDrawWidth < width || mKnownDrawHeight < height)
{
- mKnownDrawWidth = llmax(mKnownDrawWidth, width) ;
- mKnownDrawHeight = llmax(mKnownDrawHeight, height) ;
+ mKnownDrawWidth = llmax(mKnownDrawWidth, width);
+ mKnownDrawHeight = llmax(mKnownDrawHeight, height);
- mKnownDrawSizeChanged = TRUE ;
- mFullyLoaded = FALSE ;
+ mKnownDrawSizeChanged = TRUE;
+ mFullyLoaded = FALSE;
}
addTextureStats((F32)(mKnownDrawWidth * mKnownDrawHeight));
}
@@ -1416,13 +1466,13 @@ void LLViewerFetchedTexture::processTextureStats()
{
if(mDesiredDiscardLevel > mMinDesiredDiscardLevel)//need to load more
{
- mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel) ;
- mFullyLoaded = FALSE ;
+ mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel);
+ mFullyLoaded = FALSE;
}
}
else
{
- updateVirtualSize() ;
+ updateVirtualSize();
static LLCachedControl<bool> textures_fullres(gSavedSettings,"TextureLoadFullRes", false);
@@ -1432,7 +1482,7 @@ void LLViewerFetchedTexture::processTextureStats()
}
else if(!mFullWidth || !mFullHeight)
{
- mDesiredDiscardLevel = llmin(getMaxDiscardLevel(), (S32)mLoadedCallbackDesiredDiscardLevel) ;
+ mDesiredDiscardLevel = llmin(getMaxDiscardLevel(), (S32)mLoadedCallbackDesiredDiscardLevel);
}
else
{
@@ -1450,36 +1500,36 @@ void LLViewerFetchedTexture::processTextureStats()
else if(mKnownDrawSizeChanged)//known draw size is set
{
mDesiredDiscardLevel = (S8)llmin(log((F32)mFullWidth / mKnownDrawWidth) / log_2,
- log((F32)mFullHeight / mKnownDrawHeight) / log_2) ;
- mDesiredDiscardLevel = llclamp(mDesiredDiscardLevel, (S8)0, (S8)getMaxDiscardLevel()) ;
- mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel) ;
+ log((F32)mFullHeight / mKnownDrawHeight) / log_2);
+ mDesiredDiscardLevel = llclamp(mDesiredDiscardLevel, (S8)0, (S8)getMaxDiscardLevel());
+ mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel);
}
- mKnownDrawSizeChanged = FALSE ;
+ mKnownDrawSizeChanged = FALSE;
if(getDiscardLevel() >= 0 && (getDiscardLevel() <= mDesiredDiscardLevel))
{
- mFullyLoaded = TRUE ;
+ mFullyLoaded = TRUE;
}
}
}
if(mForceToSaveRawImage && mDesiredSavedRawDiscardLevel >= 0) //force to refetch the texture.
{
- mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S8)mDesiredSavedRawDiscardLevel) ;
+ mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S8)mDesiredSavedRawDiscardLevel);
if(getDiscardLevel() < 0 || getDiscardLevel() > mDesiredDiscardLevel)
{
- mFullyLoaded = FALSE ;
+ mFullyLoaded = FALSE;
}
}
}
-const F32 MAX_PRIORITY_PIXEL = 999.f ; //pixel area
-const F32 PRIORITY_BOOST_LEVEL_FACTOR = 1000.f ; //boost level
-const F32 PRIORITY_DELTA_DISCARD_LEVEL_FACTOR = 100000.f ; //delta discard
-const S32 MAX_DELTA_DISCARD_LEVEL_FOR_PRIORITY = 4 ;
-const F32 PRIORITY_ADDITIONAL_FACTOR = 1000000.f ; //additional
-const S32 MAX_ADDITIONAL_LEVEL_FOR_PRIORITY = 8 ;
-const F32 PRIORITY_BOOST_HIGH_FACTOR = 10000000.f ;//boost high
+const F32 MAX_PRIORITY_PIXEL = 999.f; //pixel area
+const F32 PRIORITY_BOOST_LEVEL_FACTOR = 1000.f; //boost level
+const F32 PRIORITY_DELTA_DISCARD_LEVEL_FACTOR = 100000.f; //delta discard
+const S32 MAX_DELTA_DISCARD_LEVEL_FOR_PRIORITY = 4;
+const F32 PRIORITY_ADDITIONAL_FACTOR = 1000000.f; //additional
+const S32 MAX_ADDITIONAL_LEVEL_FOR_PRIORITY = 8;
+const F32 PRIORITY_BOOST_HIGH_FACTOR = 10000000.f;//boost high
F32 LLViewerFetchedTexture::calcDecodePriority()
{
#ifndef LL_RELEASE_FOR_DOWNLOAD
@@ -1495,7 +1545,7 @@ F32 LLViewerFetchedTexture::calcDecodePriority()
}
if(mFullyLoaded && !mForceToSaveRawImage)//already loaded for static texture
{
- return -1.0f ; //alreay fetched
+ return -1.0f; //alreay fetched
}
S32 cur_discard = getCurrentDiscardLevelForFetching();
@@ -1510,7 +1560,7 @@ F32 LLViewerFetchedTexture::calcDecodePriority()
}
else if(mDesiredDiscardLevel >= cur_discard && cur_discard > -1)
{
- priority = -2.0f ;
+ priority = -2.0f;
}
else if(mCachedRawDiscardLevel > -1 && mDesiredDiscardLevel >= mCachedRawDiscardLevel)
{
@@ -1547,7 +1597,7 @@ F32 LLViewerFetchedTexture::calcDecodePriority()
S32 ddiscard = MAX_DISCARD_LEVEL - (S32)desired;
ddiscard = llclamp(ddiscard, 0, MAX_DELTA_DISCARD_LEVEL_FOR_PRIORITY);
priority = (ddiscard + 1) * PRIORITY_DELTA_DISCARD_LEVEL_FACTOR;
- setAdditionalDecodePriority(0.1f) ;//boost the textures without any data so far.
+ setAdditionalDecodePriority(0.1f);//boost the textures without any data so far.
}
else if ((mMinDiscardLevel > 0) && (cur_discard <= mMinDiscardLevel))
{
@@ -1582,13 +1632,13 @@ F32 LLViewerFetchedTexture::calcDecodePriority()
// [10,000,000] + [1,000,000-9,000,000] + [100,000-500,000] + [1-20,000] + [0-999]
if (priority > 0.0f)
{
- bool large_enough = mCachedRawImageReady && ((S32)mTexelsPerImage > sMinLargeImageSize) ;
+ bool large_enough = mCachedRawImageReady && ((S32)mTexelsPerImage > sMinLargeImageSize);
if(large_enough)
{
//Note:
//to give small, low-priority textures some chance to be fetched,
//cut the priority in half if the texture size is larger than 256 * 256 and has a 64*64 ready.
- priority *= 0.5f ;
+ priority *= 0.5f;
}
pixel_priority = llclamp(pixel_priority, 0.0f, MAX_PRIORITY_PIXEL);
@@ -1607,7 +1657,7 @@ F32 LLViewerFetchedTexture::calcDecodePriority()
//Note:
//to give small, low-priority textures some chance to be fetched,
//if high priority texture has a 64*64 ready, lower its fetching priority.
- setAdditionalDecodePriority(0.5f) ;
+ setAdditionalDecodePriority(0.5f);
}
else
{
@@ -1624,7 +1674,7 @@ F32 LLViewerFetchedTexture::calcDecodePriority()
//Note:
//to give small, low-priority textures some chance to be fetched,
//cut the additional priority to a quarter if the texture size is larger than 256 * 256 and has a 64*64 ready.
- additional *= 0.25f ;
+ additional *= 0.25f;
}
priority += additional;
}
@@ -1639,9 +1689,9 @@ F32 LLViewerFetchedTexture::maxDecodePriority()
PRIORITY_ADDITIONAL_FACTOR * (MAX_ADDITIONAL_LEVEL_FOR_PRIORITY + 1) + //additional (view dependent factors)
PRIORITY_DELTA_DISCARD_LEVEL_FACTOR * (MAX_DELTA_DISCARD_LEVEL_FOR_PRIORITY + 1) + //delta discard
PRIORITY_BOOST_LEVEL_FACTOR * (BOOST_MAX_LEVEL - 1) + //boost level
- MAX_PRIORITY_PIXEL + 1.0f ; //pixel area.
+ MAX_PRIORITY_PIXEL + 1.0f; //pixel area.
- return max_priority ;
+ return max_priority;
}
//============================================================================
@@ -1652,7 +1702,7 @@ void LLViewerFetchedTexture::setDecodePriority(F32 priority)
if(mDecodePriority < F_ALMOST_ZERO)
{
- mStopFetchingTimer.reset() ;
+ mStopFetchingTimer.reset();
}
}
@@ -1669,35 +1719,35 @@ void LLViewerFetchedTexture::updateVirtualSize()
{
if(!mMaxVirtualSizeResetCounter)
{
- addTextureStats(0.f, FALSE) ;//reset
+ addTextureStats(0.f, FALSE);//reset
}
for (U32 ch = 0; ch < LLRender::NUM_TEXTURE_CHANNELS; ++ch)
- {
+ {
llassert(mNumFaces[ch] <= mFaceList[ch].size());
- for(U32 i = 0 ; i < mNumFaces[ch]; i++)
+ for(U32 i = 0; i < mNumFaces[ch]; i++)
{
- LLFace* facep = mFaceList[ch][i] ;
- if( facep )
+ LLFace* facep = mFaceList[ch][i];
+ if( facep )
+ {
+ LLDrawable* drawable = facep->getDrawable();
+ if (drawable)
{
- LLDrawable* drawable = facep->getDrawable();
- if (drawable)
+ if(drawable->isRecentlyVisible())
{
- if(drawable->isRecentlyVisible())
+ if (getBoostLevel() == LLViewerTexture::BOOST_NONE &&
+ drawable->getVObj() && drawable->getVObj()->isSelected())
{
- if (getBoostLevel() == LLViewerTexture::BOOST_NONE &&
- drawable->getVObj() && drawable->getVObj()->isSelected())
- {
- setBoostLevel(LLViewerTexture::BOOST_SELECTED);
- }
- addTextureStats(facep->getVirtualSize()) ;
- setAdditionalDecodePriority(facep->getImportanceToCamera()) ;
+ setBoostLevel(LLViewerTexture::BOOST_SELECTED);
}
+ addTextureStats(facep->getVirtualSize());
+ setAdditionalDecodePriority(facep->getImportanceToCamera());
}
}
}
}
+ }
//reset whether or not a face was selected after 10 seconds
const F32 SELECTION_RESET_TIME = 10.f;
@@ -1711,26 +1761,26 @@ void LLViewerFetchedTexture::updateVirtualSize()
{
mMaxVirtualSizeResetCounter--;
}
- reorganizeFaceList() ;
+ reorganizeFaceList();
reorganizeVolumeList();
}
S32 LLViewerFetchedTexture::getCurrentDiscardLevelForFetching()
{
- S32 current_discard = getDiscardLevel() ;
+ S32 current_discard = getDiscardLevel();
if(mForceToSaveRawImage)
{
if(mSavedRawDiscardLevel < 0 || current_discard < 0)
{
- current_discard = -1 ;
+ current_discard = -1;
}
else
{
- current_discard = llmax(current_discard, mSavedRawDiscardLevel) ;
+ current_discard = llmax(current_discard, mSavedRawDiscardLevel);
}
}
- return current_discard ;
+ return current_discard;
}
bool LLViewerFetchedTexture::setDebugFetching(S32 debug_level)
@@ -1747,6 +1797,13 @@ bool LLViewerFetchedTexture::setDebugFetching(S32 debug_level)
return true;
}
+bool LLViewerFetchedTexture::isActiveFetching()
+{
+ static LLCachedControl<bool> monitor_enabled(gSavedSettings,"DebugShowTextureInfo");
+
+ return mFetchState > 7 && mFetchState < 10 && monitor_enabled; //in state of WAIT_HTTP_REQ or DECODE_IMAGE.
+}
+
bool LLViewerFetchedTexture::updateFetch()
{
static LLCachedControl<bool> textures_decode_disabled(gSavedSettings,"TextureDecodeDisabled", false);
@@ -1754,7 +1811,7 @@ bool LLViewerFetchedTexture::updateFetch()
static LLCachedControl<S32> sCameraMotionBoost(gSavedSettings,"TextureCameraMotionBoost", 3);
if(textures_decode_disabled)
{
- return false ;
+ return false;
}
mFetchState = 0;
@@ -1789,7 +1846,7 @@ bool LLViewerFetchedTexture::updateFetch()
return false;
}
- S32 current_discard = getCurrentDiscardLevelForFetching() ;
+ S32 current_discard = getCurrentDiscardLevelForFetching();
S32 desired_discard = getDesiredDiscardLevel();
F32 decode_priority = getDecodePriority();
decode_priority = llclamp(decode_priority, 0.0f, maxDecodePriority());
@@ -1801,13 +1858,18 @@ bool LLViewerFetchedTexture::updateFetch()
if (mRawImage.notNull()) sRawCount--;
if (mAuxRawImage.notNull()) sAuxCount--;
- bool finished = LLAppViewer::getTextureFetch()->getRequestFinished(getID(), fetch_discard, mRawImage, mAuxRawImage);
+ bool finished = LLAppViewer::getTextureFetch()->getRequestFinished(getID(), fetch_discard, mRawImage, mAuxRawImage,
+ mLastHttpGetStatus);
if (mRawImage.notNull()) sRawCount++;
- if (mAuxRawImage.notNull()) sAuxCount++;
+ if (mAuxRawImage.notNull())
+ {
+ mHasAux = TRUE;
+ sAuxCount++;
+ }
if (finished)
{
mIsFetching = FALSE;
- mLastPacketTimer.reset() ;
+ mLastPacketTimer.reset();
}
else
{
@@ -1821,8 +1883,8 @@ bool LLViewerFetchedTexture::updateFetch()
LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName);
if (tester)
{
- mIsFetched = TRUE ;
- tester->updateTextureLoadingStats(this, mRawImage, LLAppViewer::getTextureFetch()->isFromLocalCache(mID)) ;
+ mIsFetched = TRUE;
+ tester->updateTextureLoadingStats(this, mRawImage, LLAppViewer::getTextureFetch()->isFromLocalCache(mID));
}
mRawDiscardLevel = fetch_discard;
if ((mRawImage->getDataSize() > 0 && mRawDiscardLevel >= 0) &&
@@ -1836,19 +1898,19 @@ bool LLViewerFetchedTexture::updateFetch()
{
//discard all oversized textures.
destroyRawImage();
- llwarns << "oversize, setting as missing" << llendl;
+ LL_WARNS() << "oversize, setting as missing" << LL_ENDL;
setIsMissingAsset();
- mRawDiscardLevel = INVALID_DISCARD_LEVEL ;
- mIsFetching = FALSE ;
+ mRawDiscardLevel = INVALID_DISCARD_LEVEL;
+ mIsFetching = FALSE;
mLastPacketTimer.reset();
}
else
{
mIsRawImageValid = TRUE;
- addToCreateTexture() ;
+ addToCreateTexture();
}
- return TRUE ;
+ return TRUE;
}
else
{
@@ -1864,20 +1926,34 @@ bool LLViewerFetchedTexture::updateFetch()
if ((decode_priority > 0) && (mRawDiscardLevel < 0 || mRawDiscardLevel == INVALID_DISCARD_LEVEL))
{
// We finished but received no data
- if (current_discard < 0)
+ if (getDiscardLevel() < 0)
{
- llwarns << "!mIsFetching, setting as missing, decode_priority " << decode_priority
- << " mRawDiscardLevel " << mRawDiscardLevel
- << " current_discard " << current_discard
- << llendl;
+ if (getFTType() != FTT_MAP_TILE)
+ {
+ LL_WARNS() << mID
+ << " Fetch failure, setting as missing, decode_priority " << decode_priority
+ << " mRawDiscardLevel " << mRawDiscardLevel
+ << " current_discard " << current_discard
+ << " stats " << mLastHttpGetStatus.toHex()
+ << LL_ENDL;
+ }
setIsMissingAsset();
desired_discard = -1;
}
else
{
- //llwarns << mID << ": Setting min discard to " << current_discard << llendl;
- mMinDiscardLevel = current_discard;
- desired_discard = current_discard;
+ //LL_WARNS() << mID << ": Setting min discard to " << current_discard << LL_ENDL;
+ if(current_discard >= 0)
+ {
+ mMinDiscardLevel = current_discard;
+ desired_discard = current_discard;
+ }
+ else
+ {
+ S32 dis_level = getDiscardLevel();
+ mMinDiscardLevel = dis_level;
+ desired_discard = dis_level;
+ }
}
destroyRawImage();
}
@@ -1893,13 +1969,13 @@ bool LLViewerFetchedTexture::updateFetch()
// // Useful debugging code for undesired deprioritization of textures.
// if (decode_priority <= 0.0f && desired_discard >= 0 && desired_discard < current_discard)
// {
-// llinfos << "Calling updateRequestPriority() with decode_priority = 0.0f" << llendl;
+// LL_INFOS() << "Calling updateRequestPriority() with decode_priority = 0.0f" << LL_ENDL;
// calcDecodePriority();
// }
- static const F32 MAX_HOLD_TIME = 5.0f ; //seconds to wait before canceling fecthing if decode_priority is 0.f.
+ static const F32 MAX_HOLD_TIME = 5.0f; //seconds to wait before canceling fecthing if decode_priority is 0.f.
if(decode_priority > 0.0f || mStopFetchingTimer.getElapsedTimeF32() > MAX_HOLD_TIME)
{
- mStopFetchingTimer.reset() ;
+ mStopFetchingTimer.reset();
LLAppViewer::getTextureFetch()->updateRequestPriority(mID, decode_priority);
}
}
@@ -1925,7 +2001,7 @@ bool LLViewerFetchedTexture::updateFetch()
else if(mCachedRawImage.notNull() && (current_discard < 0 || current_discard > mCachedRawDiscardLevel))
{
make_request = false;
- switchToCachedImage() ; //use the cached raw data first
+ switchToCachedImage(); //use the cached raw data first
}
//else if (!isJustBound() && mCachedRawImageReady)
//{
@@ -1937,7 +2013,7 @@ bool LLViewerFetchedTexture::updateFetch()
// Load the texture progressively: we try not to rush to the desired discard too fast.
// If the camera is not moving, we do not tweak the discard level notch by notch but go to the desired discard with larger boosted steps
// This mitigates the "textures stay blurry" problem when loading while not killing the texture memory while moving around
- S32 delta_level = (mBoostLevel > LLGLTexture::BOOST_NONE) ? 2 : 1 ;
+ S32 delta_level = (mBoostLevel > LLGLTexture::BOOST_NONE) ? 2 : 1;
if (current_discard < 0)
{
desired_discard = llmax(desired_discard, getMaxDiscardLevel() - delta_level);
@@ -2008,7 +2084,7 @@ bool LLViewerFetchedTexture::updateFetch()
const F32 FETCH_IDLE_TIME = 5.f;
if (mLastPacketTimer.getElapsedTimeF32() > FETCH_IDLE_TIME)
{
- LL_DEBUGS("Texture") << "exceeded idle time " << FETCH_IDLE_TIME << ", deleting request: " << getID() << llendl;
+ LL_DEBUGS("Texture") << "exceeded idle time " << FETCH_IDLE_TIME << ", deleting request: " << getID() << LL_ENDL;
LLAppViewer::getTextureFetch()->deleteRequest(getID(), true);
mHasFetcher = FALSE;
}
@@ -2023,7 +2099,7 @@ void LLViewerFetchedTexture::clearFetchedResults()
{
if(mNeedsCreateTexture || mIsFetching)
{
- return ;
+ return;
}
cleanup();
@@ -2040,7 +2116,7 @@ void LLViewerFetchedTexture::forceToDeleteRequest()
if (mHasFetcher)
{
mHasFetcher = FALSE;
- mIsFetching = FALSE ;
+ mIsFetching = FALSE;
}
resetTextureStats();
@@ -2048,29 +2124,43 @@ void LLViewerFetchedTexture::forceToDeleteRequest()
mDesiredDiscardLevel = getMaxDiscardLevel() + 1;
}
-void LLViewerFetchedTexture::setIsMissingAsset()
+void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing)
{
- if (mUrl.empty())
+ if (is_missing == mIsMissingAsset)
{
- llwarns << mID << ": Marking image as missing" << llendl;
+ return;
}
- else
+ if (is_missing)
{
- // This may or may not be an error - it is normal to have no
- // map tile on an empty region, but bad if we're failing on a
- // server bake texture.
- llwarns << mUrl << ": Marking image as missing" << llendl;
+ if (mUrl.empty())
+ {
+ LL_WARNS() << mID << ": Marking image as missing" << LL_ENDL;
+ }
+ else
+ {
+ // This may or may not be an error - it is normal to have no
+ // map tile on an empty region, but bad if we're failing on a
+ // server bake texture.
+ if (getFTType() != FTT_MAP_TILE)
+ {
+ LL_WARNS() << mUrl << ": Marking image as missing" << LL_ENDL;
+ }
+ }
+ if (mHasFetcher)
+ {
+ LLAppViewer::getTextureFetch()->deleteRequest(getID(), true);
+ mHasFetcher = FALSE;
+ mIsFetching = FALSE;
+ mLastPacketTimer.reset();
+ mFetchState = 0;
+ mFetchPriority = 0;
+ }
}
- if (mHasFetcher)
+ else
{
- LLAppViewer::getTextureFetch()->deleteRequest(getID(), true);
- mHasFetcher = FALSE;
- mIsFetching = FALSE;
- mLastPacketTimer.reset();
- mFetchState = 0;
- mFetchPriority = 0;
+ LL_INFOS() << mID << ": un-flagging missing asset" << LL_ENDL;
}
- mIsMissingAsset = TRUE;
+ mIsMissingAsset = is_missing;
}
void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_callback,
@@ -2088,19 +2178,19 @@ void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_call
}
else
{
- mLoadedCallbackDesiredDiscardLevel = llmin(mLoadedCallbackDesiredDiscardLevel, (S8)discard_level) ;
+ mLoadedCallbackDesiredDiscardLevel = llmin(mLoadedCallbackDesiredDiscardLevel, (S8)discard_level);
}
if(mPauseLoadedCallBacks)
{
if(!pause)
{
- unpauseLoadedCallbacks(src_callback_list) ;
+ unpauseLoadedCallbacks(src_callback_list);
}
}
else if(pause)
{
- pauseLoadedCallbacks(src_callback_list) ;
+ pauseLoadedCallbacks(src_callback_list);
}
LLLoadedCallbackEntry* entryp = new LLLoadedCallbackEntry(loaded_callback, discard_level, keep_imageraw, userdata, src_callback_list, this, pause);
@@ -2109,21 +2199,30 @@ void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_call
mNeedsAux |= needs_aux;
if(keep_imageraw)
{
- mSaveRawImage = TRUE ;
+ mSaveRawImage = TRUE;
}
if (mNeedsAux && mAuxRawImage.isNull() && getDiscardLevel() >= 0)
{
- // We need aux data, but we've already loaded the image, and it didn't have any
- llwarns << "No aux data available for callback for image:" << getID() << llendl;
+ if(mHasAux)
+ {
+ //trigger a refetch
+ forceToRefetchTexture();
+ }
+ else
+ {
+ // We need aux data, but we've already loaded the image, and it didn't have any
+ LL_WARNS() << "No aux data available for callback for image:" << getID() << LL_ENDL;
+ }
}
mLastCallBackActiveTime = sCurrentTime ;
+ mLastReferencedSavedRawImageTime = sCurrentTime;
}
void LLViewerFetchedTexture::clearCallbackEntryList()
{
if(mLoadedCallbackList.empty())
{
- return ;
+ return;
}
for(callback_list_t::iterator iter = mLoadedCallbackList.begin();
@@ -2134,29 +2233,29 @@ void LLViewerFetchedTexture::clearCallbackEntryList()
// We never finished loading the image. Indicate failure.
// Note: this allows mLoadedCallbackUserData to be cleaned up.
entryp->mCallback(FALSE, this, NULL, NULL, 0, TRUE, entryp->mUserData);
- iter = mLoadedCallbackList.erase(iter) ;
+ iter = mLoadedCallbackList.erase(iter);
delete entryp;
}
gTextureList.mCallbackList.erase(this);
- mLoadedCallbackDesiredDiscardLevel = S8_MAX ;
+ mLoadedCallbackDesiredDiscardLevel = S8_MAX;
if(needsToSaveRawImage())
{
- destroySavedRawImage() ;
+ destroySavedRawImage();
}
- return ;
+ return;
}
void LLViewerFetchedTexture::deleteCallbackEntry(const LLLoadedCallbackEntry::source_callback_list_t* callback_list)
{
if(mLoadedCallbackList.empty() || !callback_list)
{
- return ;
+ return;
}
- S32 desired_discard = S8_MAX ;
- S32 desired_raw_discard = INVALID_DISCARD_LEVEL ;
+ S32 desired_discard = S8_MAX;
+ S32 desired_raw_discard = INVALID_DISCARD_LEVEL;
for(callback_list_t::iterator iter = mLoadedCallbackList.begin();
iter != mLoadedCallbackList.end(); )
{
@@ -2166,17 +2265,17 @@ void LLViewerFetchedTexture::deleteCallbackEntry(const LLLoadedCallbackEntry::so
// We never finished loading the image. Indicate failure.
// Note: this allows mLoadedCallbackUserData to be cleaned up.
entryp->mCallback(FALSE, this, NULL, NULL, 0, TRUE, entryp->mUserData);
- iter = mLoadedCallbackList.erase(iter) ;
+ iter = mLoadedCallbackList.erase(iter);
delete entryp;
}
else
{
++iter;
- desired_discard = llmin(desired_discard, entryp->mDesiredDiscard) ;
+ desired_discard = llmin(desired_discard, entryp->mDesiredDiscard);
if(entryp->mNeedsImageRaw)
{
- desired_raw_discard = llmin(desired_raw_discard, entryp->mDesiredDiscard) ;
+ desired_raw_discard = llmin(desired_raw_discard, entryp->mDesiredDiscard);
}
}
}
@@ -2189,18 +2288,18 @@ void LLViewerFetchedTexture::deleteCallbackEntry(const LLLoadedCallbackEntry::so
if(needsToSaveRawImage())
{
- destroySavedRawImage() ;
+ destroySavedRawImage();
}
}
else if(needsToSaveRawImage() && mBoostLevel != LLGLTexture::BOOST_PREVIEW)
{
if(desired_raw_discard != INVALID_DISCARD_LEVEL)
{
- mDesiredSavedRawDiscardLevel = desired_raw_discard ;
+ mDesiredSavedRawDiscardLevel = desired_raw_discard;
}
else
{
- destroySavedRawImage() ;
+ destroySavedRawImage();
}
}
}
@@ -2209,29 +2308,30 @@ void LLViewerFetchedTexture::unpauseLoadedCallbacks(const LLLoadedCallbackEntry:
{
if(!callback_list)
{
- mPauseLoadedCallBacks = FALSE ;
- return ;
+ mPauseLoadedCallBacks = FALSE;
+ return;
}
- BOOL need_raw = FALSE ;
+ BOOL need_raw = FALSE;
for(callback_list_t::iterator iter = mLoadedCallbackList.begin();
iter != mLoadedCallbackList.end(); )
{
LLLoadedCallbackEntry *entryp = *iter++;
if(entryp->mSourceCallbackList == callback_list)
{
- entryp->mPaused = FALSE ;
+ entryp->mPaused = FALSE;
if(entryp->mNeedsImageRaw)
{
- need_raw = TRUE ;
+ need_raw = TRUE;
}
}
}
mPauseLoadedCallBacks = FALSE ;
mLastCallBackActiveTime = sCurrentTime ;
+ mForceCallbackFetch = TRUE;
if(need_raw)
{
- mSaveRawImage = TRUE ;
+ mSaveRawImage = TRUE;
}
}
@@ -2239,10 +2339,10 @@ void LLViewerFetchedTexture::pauseLoadedCallbacks(const LLLoadedCallbackEntry::s
{
if(!callback_list)
{
- return ;
+ return;
}
- bool paused = true ;
+ bool paused = true;
for(callback_list_t::iterator iter = mLoadedCallbackList.begin();
iter != mLoadedCallbackList.end(); )
@@ -2250,25 +2350,26 @@ void LLViewerFetchedTexture::pauseLoadedCallbacks(const LLLoadedCallbackEntry::s
LLLoadedCallbackEntry *entryp = *iter++;
if(entryp->mSourceCallbackList == callback_list)
{
- entryp->mPaused = TRUE ;
+ entryp->mPaused = TRUE;
}
else if(!entryp->mPaused)
{
- paused = false ;
+ paused = false;
}
}
if(paused)
{
- mPauseLoadedCallBacks = TRUE ;//when set, loaded callback is paused.
+ mPauseLoadedCallBacks = TRUE;//when set, loaded callback is paused.
resetTextureStats();
- mSaveRawImage = FALSE ;
+ mSaveRawImage = FALSE;
}
}
bool LLViewerFetchedTexture::doLoadedCallbacks()
{
static const F32 MAX_INACTIVE_TIME = 900.f ; //seconds
+ static const F32 MAX_IDLE_WAIT_TIME = 5.f ; //seconds
if (mNeedsCreateTexture)
{
@@ -2281,6 +2382,15 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()
}
if(sCurrentTime - mLastCallBackActiveTime > MAX_INACTIVE_TIME && !mIsFetching)
{
+ if (mFTType == FTT_SERVER_BAKE)
+ {
+ //output some debug info
+ LL_INFOS() << "baked texture: " << mID << "clears all call backs due to inactivity." << LL_ENDL;
+ LL_INFOS() << mUrl << LL_ENDL;
+ LL_INFOS() << "current discard: " << getDiscardLevel() << " current discard for fetch: " << getCurrentDiscardLevelForFetching() <<
+ " Desired discard: " << getDesiredDiscardLevel() << "decode Pri: " << getDecodePriority() << LL_ENDL;
+ }
+
clearCallbackEntryList() ; //remove all callbacks.
return false ;
}
@@ -2289,6 +2399,13 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()
if (isMissingAsset())
{
+ if (mFTType == FTT_SERVER_BAKE)
+ {
+ //output some debug info
+ LL_INFOS() << "baked texture: " << mID << "is missing." << LL_ENDL;
+ LL_INFOS() << mUrl << LL_ENDL;
+ }
+
for(callback_list_t::iterator iter = mLoadedCallbackList.begin();
iter != mLoadedCallbackList.end(); )
{
@@ -2302,7 +2419,7 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()
// Remove ourself from the global list of textures with callbacks
gTextureList.mCallbackList.erase(this);
- return false ;
+ return false;
}
S32 gl_discard = getDiscardLevel();
@@ -2409,7 +2526,7 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()
if (run_raw_callbacks && mIsRawImageValid && (mRawDiscardLevel <= getMaxDiscardLevel()))
{
// Do callbacks which require raw image data.
- //llinfos << "doLoadedCallbacks raw for " << getID() << llendl;
+ //LL_INFOS() << "doLoadedCallbacks raw for " << getID() << LL_ENDL;
// Call each party interested in the raw data.
for(callback_list_t::iterator iter = mLoadedCallbackList.begin();
@@ -2423,15 +2540,15 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()
// to satisfy the interested party, then this is the last time that
// we're going to call them.
- mLastCallBackActiveTime = sCurrentTime ;
+ mLastCallBackActiveTime = sCurrentTime;
//llassert_always(mRawImage.notNull());
if(mNeedsAux && mAuxRawImage.isNull())
{
- llwarns << "Raw Image with no Aux Data for callback" << llendl;
+ LL_WARNS() << "Raw Image with no Aux Data for callback" << LL_ENDL;
}
BOOL final = mRawDiscardLevel <= entryp->mDesiredDiscard ? TRUE : FALSE;
- //llinfos << "Running callback for " << getID() << llendl;
- //llinfos << mRawImage->getWidth() << "x" << mRawImage->getHeight() << llendl;
+ //LL_INFOS() << "Running callback for " << getID() << LL_ENDL;
+ //LL_INFOS() << mRawImage->getWidth() << "x" << mRawImage->getHeight() << LL_ENDL;
entryp->mLastUsedDiscard = mRawDiscardLevel;
entryp->mCallback(TRUE, this, mRawImage, mAuxRawImage, mRawDiscardLevel, final, entryp->mUserData);
if (final)
@@ -2449,7 +2566,7 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()
//
if (run_gl_callbacks && (gl_discard <= getMaxDiscardLevel()))
{
- //llinfos << "doLoadedCallbacks GL for " << getID() << llendl;
+ //LL_INFOS() << "doLoadedCallbacks GL for " << getID() << LL_ENDL;
// Call the callbacks interested in GL data.
for(callback_list_t::iterator iter = mLoadedCallbackList.begin();
@@ -2459,7 +2576,7 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()
LLLoadedCallbackEntry *entryp = *curiter;
if (!entryp->mNeedsImageRaw && (entryp->mLastUsedDiscard > gl_discard))
{
- mLastCallBackActiveTime = sCurrentTime ;
+ mLastCallBackActiveTime = sCurrentTime;
BOOL final = gl_discard <= entryp->mDesiredDiscard ? TRUE : FALSE;
entryp->mLastUsedDiscard = gl_discard;
entryp->mCallback(TRUE, this, NULL, NULL, gl_discard, final, entryp->mUserData);
@@ -2473,6 +2590,9 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()
}
}
+ // Done with any raw image data at this point (will be re-created if we still have callbacks)
+ destroyRawImage();
+
//
// If we have no callbacks, take us off of the image callback list.
//
@@ -2480,10 +2600,13 @@ bool LLViewerFetchedTexture::doLoadedCallbacks()
{
gTextureList.mCallbackList.erase(this);
}
+ else if(!res && mForceCallbackFetch && sCurrentTime - mLastCallBackActiveTime > MAX_IDLE_WAIT_TIME && !mIsFetching)
+ {
+ //wait for long enough but no fetching request issued, force one.
+ forceToRefetchTexture(mLoadedCallbackDesiredDiscardLevel, 5.f);
+ mForceCallbackFetch = FALSE; //fire once.
+ }
- // Done with any raw image data at this point (will be re-created if we still have callbacks)
- destroyRawImage();
-
return res;
}
@@ -2493,66 +2616,66 @@ void LLViewerFetchedTexture::forceImmediateUpdate()
//only immediately update a deleted texture which is now being re-used.
if(!isDeleted())
{
- return ;
+ return;
}
//if already called forceImmediateUpdate()
if(mInImageList && mDecodePriority == LLViewerFetchedTexture::maxDecodePriority())
{
- return ;
+ return;
}
- gTextureList.forceImmediateUpdate(this) ;
- return ;
+ gTextureList.forceImmediateUpdate(this);
+ return;
}
LLImageRaw* LLViewerFetchedTexture::reloadRawImage(S8 discard_level)
{
- llassert_always(mGLTexturep.notNull()) ;
+ llassert_always(mGLTexturep.notNull());
llassert_always(discard_level >= 0);
llassert_always(mComponents > 0);
if (mRawImage.notNull())
{
//mRawImage is in use by somebody else, do not delete it.
- return NULL ;
+ return NULL;
}
if(mSavedRawDiscardLevel >= 0 && mSavedRawDiscardLevel <= discard_level)
{
if(mSavedRawDiscardLevel != discard_level)
{
- mRawImage = new LLImageRaw(getWidth(discard_level), getHeight(discard_level), getComponents()) ;
- mRawImage->copy(getSavedRawImage()) ;
+ mRawImage = new LLImageRaw(getWidth(discard_level), getHeight(discard_level), getComponents());
+ mRawImage->copy(getSavedRawImage());
}
else
{
- mRawImage = getSavedRawImage() ;
+ mRawImage = getSavedRawImage();
}
- mRawDiscardLevel = discard_level ;
+ mRawDiscardLevel = discard_level;
}
else
{
//force to fetch raw image again if cached raw image is not good enough.
if(mCachedRawDiscardLevel > discard_level)
{
- mRawImage = mCachedRawImage ;
+ mRawImage = mCachedRawImage;
mRawDiscardLevel = mCachedRawDiscardLevel;
}
else //cached raw image is good enough, copy it.
{
if(mCachedRawDiscardLevel != discard_level)
{
- mRawImage = new LLImageRaw(getWidth(discard_level), getHeight(discard_level), getComponents()) ;
- mRawImage->copy(mCachedRawImage) ;
+ mRawImage = new LLImageRaw(getWidth(discard_level), getHeight(discard_level), getComponents());
+ mRawImage->copy(mCachedRawImage);
}
else
{
- mRawImage = mCachedRawImage ;
+ mRawImage = mCachedRawImage;
}
- mRawDiscardLevel = discard_level ;
+ mRawDiscardLevel = discard_level;
}
}
- mIsRawImageValid = TRUE ;
+ mIsRawImageValid = TRUE;
sRawCount++;
return mRawImage;
@@ -2560,12 +2683,12 @@ LLImageRaw* LLViewerFetchedTexture::reloadRawImage(S8 discard_level)
bool LLViewerFetchedTexture::needsToSaveRawImage()
{
- return mForceToSaveRawImage || mSaveRawImage ;
+ return mForceToSaveRawImage || mSaveRawImage;
}
void LLViewerFetchedTexture::destroyRawImage()
{
- if (mAuxRawImage.notNull())
+ if (mAuxRawImage.notNull() && !needsToSaveRawImage())
{
sAuxCount--;
mAuxRawImage = NULL;
@@ -2579,9 +2702,9 @@ void LLViewerFetchedTexture::destroyRawImage()
{
if(needsToSaveRawImage())
{
- saveRawImage() ;
+ saveRawImage();
}
- setCachedRawImage() ;
+ setCachedRawImage();
}
mRawImage = NULL;
@@ -2597,19 +2720,19 @@ void LLViewerFetchedTexture::switchToCachedImage()
{
if(mCachedRawImage.notNull())
{
- mRawImage = mCachedRawImage ;
+ mRawImage = mCachedRawImage;
if (getComponents() != mRawImage->getComponents())
{
// We've changed the number of components, so we need to move any
// objects using this pool to a different pool.
mComponents = mRawImage->getComponents();
- mGLTexturep->setComponents(mComponents) ;
+ mGLTexturep->setComponents(mComponents);
gTextureList.dirtyImage(this);
}
mIsRawImageValid = TRUE;
- mRawDiscardLevel = mCachedRawDiscardLevel ;
+ mRawDiscardLevel = mCachedRawDiscardLevel;
gTextureList.mCreateTextureList.insert(this);
mNeedsCreateTexture = TRUE;
}
@@ -2621,9 +2744,9 @@ void LLViewerFetchedTexture::setCachedRawImage(S32 discard_level, LLImageRaw* im
{
if(imageraw != mRawImage.get())
{
- mCachedRawImage = imageraw ;
- mCachedRawDiscardLevel = discard_level ;
- mCachedRawImageReady = TRUE ;
+ mCachedRawImage = imageraw;
+ mCachedRawDiscardLevel = discard_level;
+ mCachedRawImageReady = TRUE;
}
}
@@ -2631,49 +2754,49 @@ void LLViewerFetchedTexture::setCachedRawImage()
{
if(mRawImage == mCachedRawImage)
{
- return ;
+ return;
}
if(!mIsRawImageValid)
{
- return ;
+ return;
}
if(mCachedRawImageReady)
{
- return ;
+ return;
}
if(mCachedRawDiscardLevel < 0 || mCachedRawDiscardLevel > mRawDiscardLevel)
{
- S32 i = 0 ;
- S32 w = mRawImage->getWidth() ;
- S32 h = mRawImage->getHeight() ;
+ S32 i = 0;
+ S32 w = mRawImage->getWidth();
+ S32 h = mRawImage->getHeight();
- S32 max_size = MAX_CACHED_RAW_IMAGE_AREA ;
+ S32 max_size = MAX_CACHED_RAW_IMAGE_AREA;
if(LLGLTexture::BOOST_TERRAIN == mBoostLevel)
{
- max_size = MAX_CACHED_RAW_TERRAIN_IMAGE_AREA ;
+ max_size = MAX_CACHED_RAW_TERRAIN_IMAGE_AREA;
}
if(mForSculpt)
{
- max_size = MAX_CACHED_RAW_SCULPT_IMAGE_AREA ;
- mCachedRawImageReady = !mRawDiscardLevel ;
+ max_size = MAX_CACHED_RAW_SCULPT_IMAGE_AREA;
+ mCachedRawImageReady = !mRawDiscardLevel;
}
else
{
- mCachedRawImageReady = (!mRawDiscardLevel || ((w * h) >= max_size)) ;
+ mCachedRawImageReady = (!mRawDiscardLevel || ((w * h) >= max_size));
}
while(((w >> i) * (h >> i)) > max_size)
{
- ++i ;
+ ++i;
}
if(i)
{
if(!(w >> i) || !(h >> i))
{
- --i ;
+ --i;
}
{
@@ -2682,9 +2805,9 @@ void LLViewerFetchedTexture::setCachedRawImage()
mRawImage->scale(w >> i, h >> i) ;
}
}
- mCachedRawImage = mRawImage ;
- mRawDiscardLevel += i ;
- mCachedRawDiscardLevel = mRawDiscardLevel ;
+ mCachedRawImage = mRawImage;
+ mRawDiscardLevel += i;
+ mCachedRawDiscardLevel = mRawDiscardLevel;
}
}
@@ -2694,11 +2817,11 @@ void LLViewerFetchedTexture::checkCachedRawSculptImage()
{
if(getDiscardLevel() != 0)
{
- mCachedRawImageReady = FALSE ;
+ mCachedRawImageReady = FALSE;
}
else if(isForSculptOnly())
{
- resetTextureStats() ; //do not update this image any more.
+ resetTextureStats(); //do not update this image any more.
}
}
}
@@ -2707,45 +2830,63 @@ void LLViewerFetchedTexture::saveRawImage()
{
if(mRawImage.isNull() || mRawImage == mSavedRawImage || (mSavedRawDiscardLevel >= 0 && mSavedRawDiscardLevel <= mRawDiscardLevel))
{
- return ;
+ return;
}
- mSavedRawDiscardLevel = mRawDiscardLevel ;
- mSavedRawImage = new LLImageRaw(mRawImage->getData(), mRawImage->getWidth(), mRawImage->getHeight(), mRawImage->getComponents()) ;
+ mSavedRawDiscardLevel = mRawDiscardLevel;
+ mSavedRawImage = new LLImageRaw(mRawImage->getData(), mRawImage->getWidth(), mRawImage->getHeight(), mRawImage->getComponents());
if(mForceToSaveRawImage && mSavedRawDiscardLevel <= mDesiredSavedRawDiscardLevel)
{
- mForceToSaveRawImage = FALSE ;
+ mForceToSaveRawImage = FALSE;
+ }
+
+ mLastReferencedSavedRawImageTime = sCurrentTime;
+}
+
+//force to refetch the texture to the discard level
+void LLViewerFetchedTexture::forceToRefetchTexture(S32 desired_discard, F32 kept_time)
+{
+ if(mForceToSaveRawImage)
+ {
+ desired_discard = llmin(desired_discard, mDesiredSavedRawDiscardLevel);
+ kept_time = llmax(kept_time, mKeptSavedRawImageTime);
}
+ //trigger a new fetch.
+ mForceToSaveRawImage = TRUE ;
+ mDesiredSavedRawDiscardLevel = desired_discard ;
+ mKeptSavedRawImageTime = kept_time ;
mLastReferencedSavedRawImageTime = sCurrentTime ;
+ mSavedRawImage = NULL ;
+ mSavedRawDiscardLevel = -1 ;
}
void LLViewerFetchedTexture::forceToSaveRawImage(S32 desired_discard, F32 kept_time)
{
- mKeptSavedRawImageTime = kept_time ;
- mLastReferencedSavedRawImageTime = sCurrentTime ;
+ mKeptSavedRawImageTime = kept_time;
+ mLastReferencedSavedRawImageTime = sCurrentTime;
if(mSavedRawDiscardLevel > -1 && mSavedRawDiscardLevel <= desired_discard)
{
- return ; //raw imge is ready.
+ return; //raw imge is ready.
}
if(!mForceToSaveRawImage || mDesiredSavedRawDiscardLevel < 0 || mDesiredSavedRawDiscardLevel > desired_discard)
{
- mForceToSaveRawImage = TRUE ;
- mDesiredSavedRawDiscardLevel = desired_discard ;
+ mForceToSaveRawImage = TRUE;
+ mDesiredSavedRawDiscardLevel = desired_discard;
//copy from the cached raw image if exists.
if(mCachedRawImage.notNull() && mRawImage.isNull() )
{
- mRawImage = mCachedRawImage ;
- mRawDiscardLevel = mCachedRawDiscardLevel ;
+ mRawImage = mCachedRawImage;
+ mRawDiscardLevel = mCachedRawDiscardLevel;
- saveRawImage() ;
+ saveRawImage();
- mRawImage = NULL ;
- mRawDiscardLevel = INVALID_DISCARD_LEVEL ;
+ mRawImage = NULL;
+ mRawDiscardLevel = INVALID_DISCARD_LEVEL;
}
}
}
@@ -2753,13 +2894,13 @@ void LLViewerFetchedTexture::destroySavedRawImage()
{
if(mLastReferencedSavedRawImageTime < mKeptSavedRawImageTime)
{
- return ; //keep the saved raw image.
+ return; //keep the saved raw image.
}
- mForceToSaveRawImage = FALSE ;
- mSaveRawImage = FALSE ;
+ mForceToSaveRawImage = FALSE;
+ mSaveRawImage = FALSE;
- clearCallbackEntryList() ;
+ clearCallbackEntryList();
mSavedRawImage = NULL ;
mForceToSaveRawImage = FALSE ;
@@ -2768,23 +2909,29 @@ void LLViewerFetchedTexture::destroySavedRawImage()
mDesiredSavedRawDiscardLevel = -1 ;
mLastReferencedSavedRawImageTime = 0.0f ;
mKeptSavedRawImageTime = 0.f ;
+
+ if(mAuxRawImage.notNull())
+ {
+ sAuxCount--;
+ mAuxRawImage = NULL;
+ }
}
LLImageRaw* LLViewerFetchedTexture::getSavedRawImage()
{
- mLastReferencedSavedRawImageTime = sCurrentTime ;
+ mLastReferencedSavedRawImageTime = sCurrentTime;
- return mSavedRawImage ;
+ return mSavedRawImage;
}
BOOL LLViewerFetchedTexture::hasSavedRawImage() const
{
- return mSavedRawImage.notNull() ;
+ return mSavedRawImage.notNull();
}
F32 LLViewerFetchedTexture::getElapsedLastReferencedSavedRawImageTime() const
{
- return sCurrentTime - mLastReferencedSavedRawImageTime ;
+ return sCurrentTime - mLastReferencedSavedRawImageTime;
}
//----------------------------------------------------------------------------------------------
@@ -2797,13 +2944,13 @@ F32 LLViewerFetchedTexture::getElapsedLastReferencedSavedRawImageTime() const
LLViewerLODTexture::LLViewerLODTexture(const LLUUID& id, FTType f_type, const LLHost& host, BOOL usemipmaps)
: LLViewerFetchedTexture(id, f_type, host, usemipmaps)
{
- init(TRUE) ;
+ init(TRUE);
}
LLViewerLODTexture::LLViewerLODTexture(const std::string& url, FTType f_type, const LLUUID& id, BOOL usemipmaps)
: LLViewerFetchedTexture(url, f_type, id, usemipmaps)
{
- init(TRUE) ;
+ init(TRUE);
}
void LLViewerLODTexture::init(bool firstinit)
@@ -2816,19 +2963,19 @@ void LLViewerLODTexture::init(bool firstinit)
//virtual
S8 LLViewerLODTexture::getType() const
{
- return LLViewerTexture::LOD_TEXTURE ;
+ return LLViewerTexture::LOD_TEXTURE;
}
BOOL LLViewerLODTexture::isUpdateFrozen()
{
- return LLViewerTexture::sFreezeImageScalingDown && !getDiscardLevel() ;
+ return LLViewerTexture::sFreezeImageScalingDown && !getDiscardLevel();
}
// This is gauranteed to get called periodically for every texture
//virtual
void LLViewerLODTexture::processTextureStats()
{
- updateVirtualSize() ;
+ updateVirtualSize();
static LLCachedControl<bool> textures_fullres(gSavedSettings,"TextureLoadFullRes", false);
@@ -2850,7 +2997,7 @@ void LLViewerLODTexture::processTextureStats()
}
else if (!mFullWidth || !mFullHeight)
{
- mDesiredDiscardLevel = getMaxDiscardLevel() ;
+ mDesiredDiscardLevel = getMaxDiscardLevel();
}
else
{
@@ -2876,7 +3023,7 @@ void LLViewerLODTexture::processTextureStats()
if(isLargeImage() && !isJustBound() && mAdditionalDecodePriority < 0.3f)
{
//if is a big image and not being used recently, nor close to the view point, do not load hi-res data.
- mMaxVirtualSize = llmin(mMaxVirtualSize, (F32)LLViewerTexture::sMinLargeImageSize) ;
+ mMaxVirtualSize = llmin(mMaxVirtualSize, (F32)LLViewerTexture::sMinLargeImageSize);
}
if ((mCalculatedDiscardLevel >= 0.f) &&
@@ -2897,7 +3044,7 @@ void LLViewerLODTexture::processTextureStats()
{
discard_level += sDesiredDiscardBias;
discard_level *= sDesiredDiscardScale; // scale
- discard_level += sCameraMovingDiscardBias ;
+ discard_level += sCameraMovingDiscardBias;
}
discard_level = floorf(discard_level);
@@ -2924,19 +3071,19 @@ void LLViewerLODTexture::processTextureStats()
if(desired_discard_bias_max <= sDesiredDiscardBias && !mForceToSaveRawImage)
{
//needs to release texture memory urgently
- scaleDown() ;
+ scaleDown();
}
// Limit the amount of GL memory bound each frame
- else if ( BYTES_TO_MEGA_BYTES(sBoundTextureMemoryInBytes) > sMaxBoundTextureMemInMegaBytes * texmem_middle_bound_scale &&
+ else if ( sBoundTextureMemory > sMaxBoundTextureMemory * texmem_middle_bound_scale &&
(!getBoundRecently() || mDesiredDiscardLevel >= mCachedRawDiscardLevel))
{
- scaleDown() ;
+ scaleDown();
}
// Only allow GL to have 2x the video card memory
- else if ( BYTES_TO_MEGA_BYTES(sTotalTextureMemoryInBytes) > sMaxTotalTextureMemInMegaBytes*texmem_middle_bound_scale &&
+ else if ( sTotalTextureMemory > sMaxTotalTextureMem * texmem_middle_bound_scale &&
(!getBoundRecently() || mDesiredDiscardLevel >= mCachedRawDiscardLevel))
{
- scaleDown() ;
+ scaleDown();
}
}
@@ -2944,13 +3091,13 @@ void LLViewerLODTexture::processTextureStats()
if(mForceToSaveRawImage && mDesiredSavedRawDiscardLevel >= 0)
{
- mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S8)mDesiredSavedRawDiscardLevel) ;
+ mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S8)mDesiredSavedRawDiscardLevel);
}
else if(LLPipeline::sMemAllocationThrottled)//release memory of large textures by decrease their resolutions.
{
if(scaleDown())
{
- mDesiredDiscardLevel = mCachedRawDiscardLevel ;
+ mDesiredDiscardLevel = mCachedRawDiscardLevel;
}
}
}
@@ -2959,17 +3106,17 @@ bool LLViewerLODTexture::scaleDown()
{
if(hasGLTexture() && mCachedRawDiscardLevel > getDiscardLevel())
{
- switchToCachedImage() ;
+ switchToCachedImage();
LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName);
if (tester)
{
- tester->setStablizingTime() ;
+ tester->setStablizingTime();
}
- return true ;
+ return true;
}
- return false ;
+ return false;
}
//----------------------------------------------------------------------------------------------
//end of LLViewerLODTexture
@@ -2981,14 +3128,14 @@ bool LLViewerLODTexture::scaleDown()
//static
void LLViewerMediaTexture::updateClass()
{
- static const F32 MAX_INACTIVE_TIME = 30.f ;
+ static const F32 MAX_INACTIVE_TIME = 30.f;
#if 0
//force to play media.
- gSavedSettings.setBOOL("AudioStreamingMedia", true) ;
+ gSavedSettings.setBOOL("AudioStreamingMedia", true);
#endif
- for(media_map_t::iterator iter = sMediaMap.begin() ; iter != sMediaMap.end(); )
+ for(media_map_t::iterator iter = sMediaMap.begin(); iter != sMediaMap.end(); )
{
LLViewerMediaTexture* mediap = iter->second;
@@ -2999,29 +3146,29 @@ void LLViewerMediaTexture::updateClass()
//
if(mediap->getLastReferencedTimer()->getElapsedTimeF32() > MAX_INACTIVE_TIME)
{
- media_map_t::iterator cur = iter++ ;
- sMediaMap.erase(cur) ;
- continue ;
+ media_map_t::iterator cur = iter++;
+ sMediaMap.erase(cur);
+ continue;
}
}
- ++iter ;
+ ++iter;
}
}
//static
void LLViewerMediaTexture::removeMediaImplFromTexture(const LLUUID& media_id)
{
- LLViewerMediaTexture* media_tex = findMediaTexture(media_id) ;
+ LLViewerMediaTexture* media_tex = findMediaTexture(media_id);
if(media_tex)
{
- media_tex->invalidateMediaImpl() ;
+ media_tex->invalidateMediaImpl();
}
}
//static
void LLViewerMediaTexture::cleanUpClass()
{
- sMediaMap.clear() ;
+ sMediaMap.clear();
}
//static
@@ -3033,9 +3180,9 @@ LLViewerMediaTexture* LLViewerMediaTexture::findMediaTexture(const LLUUID& media
return NULL;
}
- LLViewerMediaTexture* media_tex = iter->second ;
- media_tex->setMediaImpl() ;
- media_tex->getLastReferencedTimer()->reset() ;
+ LLViewerMediaTexture* media_tex = iter->second;
+ media_tex->setMediaImpl();
+ media_tex->getLastReferencedTimer()->reset();
return media_tex;
}
@@ -3047,48 +3194,48 @@ LLViewerMediaTexture::LLViewerMediaTexture(const LLUUID& id, BOOL usemipmaps, LL
{
sMediaMap.insert(std::make_pair(id, this));
- mGLTexturep = gl_image ;
+ mGLTexturep = gl_image;
if(mGLTexturep.isNull())
{
- generateGLTexture() ;
+ generateGLTexture();
}
mGLTexturep->setAllowCompression(false);
- mGLTexturep->setNeedsAlphaAndPickMask(FALSE) ;
+ mGLTexturep->setNeedsAlphaAndPickMask(FALSE);
- mIsPlaying = FALSE ;
+ mIsPlaying = FALSE;
- setMediaImpl() ;
+ setMediaImpl();
- setCategory(LLGLTexture::MEDIA) ;
+ setCategory(LLGLTexture::MEDIA);
- LLViewerTexture* tex = gTextureList.findImage(mID) ;
+ LLViewerTexture* tex = gTextureList.findImage(mID);
if(tex) //this media is a parcel media for tex.
{
- tex->setParcelMedia(this) ;
+ tex->setParcelMedia(this);
}
}
//virtual
LLViewerMediaTexture::~LLViewerMediaTexture()
{
- LLViewerTexture* tex = gTextureList.findImage(mID) ;
+ LLViewerTexture* tex = gTextureList.findImage(mID);
if(tex) //this media is a parcel media for tex.
{
- tex->setParcelMedia(NULL) ;
+ tex->setParcelMedia(NULL);
}
}
void LLViewerMediaTexture::reinit(BOOL usemipmaps /* = TRUE */)
{
- llassert(mGLTexturep.notNull()) ;
+ llassert(mGLTexturep.notNull());
- mUseMipMaps = usemipmaps ;
- getLastReferencedTimer()->reset() ;
- mGLTexturep->setUseMipMaps(mUseMipMaps) ;
- mGLTexturep->setNeedsAlphaAndPickMask(FALSE) ;
+ mUseMipMaps = usemipmaps;
+ getLastReferencedTimer()->reset();
+ mGLTexturep->setUseMipMaps(mUseMipMaps);
+ mGLTexturep->setNeedsAlphaAndPickMask(FALSE);
}
void LLViewerMediaTexture::setUseMipMaps(BOOL mipmap)
@@ -3097,26 +3244,26 @@ void LLViewerMediaTexture::setUseMipMaps(BOOL mipmap)
if(mGLTexturep.notNull())
{
- mGLTexturep->setUseMipMaps(mipmap) ;
+ mGLTexturep->setUseMipMaps(mipmap);
}
}
//virtual
S8 LLViewerMediaTexture::getType() const
{
- return LLViewerTexture::MEDIA_TEXTURE ;
+ return LLViewerTexture::MEDIA_TEXTURE;
}
void LLViewerMediaTexture::invalidateMediaImpl()
{
- mMediaImplp = NULL ;
+ mMediaImplp = NULL;
}
void LLViewerMediaTexture::setMediaImpl()
{
if(!mMediaImplp)
{
- mMediaImplp = LLViewerMedia::getMediaImplFromTextureID(mID) ;
+ mMediaImplp = LLViewerMedia::getMediaImplFromTextureID(mID);
}
}
@@ -3125,71 +3272,71 @@ void LLViewerMediaTexture::setMediaImpl()
// because it does not check the face validity after the current frame.
BOOL LLViewerMediaTexture::findFaces()
{
- mMediaFaceList.clear() ;
+ mMediaFaceList.clear();
- BOOL ret = TRUE ;
+ BOOL ret = TRUE;
- LLViewerTexture* tex = gTextureList.findImage(mID) ;
+ LLViewerTexture* tex = gTextureList.findImage(mID);
if(tex) //this media is a parcel media for tex.
{
for (U32 ch = 0; ch < LLRender::NUM_TEXTURE_CHANNELS; ++ch)
{
- const ll_face_list_t* face_list = tex->getFaceList(ch) ;
- U32 end = tex->getNumFaces(ch) ;
- for(U32 i = 0 ; i < end ; i++)
- {
- mMediaFaceList.push_back((*face_list)[i]) ;
- }
+ const ll_face_list_t* face_list = tex->getFaceList(ch);
+ U32 end = tex->getNumFaces(ch);
+ for(U32 i = 0; i < end; i++)
+ {
+ mMediaFaceList.push_back((*face_list)[i]);
}
}
+ }
if(!mMediaImplp)
{
- return TRUE ;
+ return TRUE;
}
//for media on a face.
- const std::list< LLVOVolume* >* obj_list = mMediaImplp->getObjectList() ;
- std::list< LLVOVolume* >::const_iterator iter = obj_list->begin() ;
+ const std::list< LLVOVolume* >* obj_list = mMediaImplp->getObjectList();
+ std::list< LLVOVolume* >::const_iterator iter = obj_list->begin();
for(; iter != obj_list->end(); ++iter)
{
- LLVOVolume* obj = *iter ;
+ LLVOVolume* obj = *iter;
if(obj->mDrawable.isNull())
{
- ret = FALSE ;
- continue ;
+ ret = FALSE;
+ continue;
}
- S32 face_id = -1 ;
- S32 num_faces = obj->mDrawable->getNumFaces() ;
+ S32 face_id = -1;
+ S32 num_faces = obj->mDrawable->getNumFaces();
while((face_id = obj->getFaceIndexWithMediaImpl(mMediaImplp, face_id)) > -1 && face_id < num_faces)
{
- LLFace* facep = obj->mDrawable->getFace(face_id) ;
+ LLFace* facep = obj->mDrawable->getFace(face_id);
if(facep)
{
- mMediaFaceList.push_back(facep) ;
+ mMediaFaceList.push_back(facep);
}
else
{
- ret = FALSE ;
+ ret = FALSE;
}
}
}
- return ret ;
+ return ret;
}
void LLViewerMediaTexture::initVirtualSize()
{
if(mIsPlaying)
{
- return ;
+ return;
}
- findFaces() ;
+ findFaces();
for(std::list< LLFace* >::iterator iter = mMediaFaceList.begin(); iter!= mMediaFaceList.end(); ++iter)
{
- addTextureStats((*iter)->getVirtualSize()) ;
+ addTextureStats((*iter)->getVirtualSize());
}
}
@@ -3197,77 +3344,77 @@ void LLViewerMediaTexture::addMediaToFace(LLFace* facep)
{
if(facep)
{
- facep->setHasMedia(true) ;
+ facep->setHasMedia(true);
}
if(!mIsPlaying)
{
- return ; //no need to add the face because the media is not in playing.
+ return; //no need to add the face because the media is not in playing.
}
- switchTexture(LLRender::DIFFUSE_MAP, facep) ;
+ switchTexture(LLRender::DIFFUSE_MAP, facep);
}
void LLViewerMediaTexture::removeMediaFromFace(LLFace* facep)
{
if(!facep)
{
- return ;
+ return;
}
- facep->setHasMedia(false) ;
+ facep->setHasMedia(false);
if(!mIsPlaying)
{
- return ; //no need to remove the face because the media is not in playing.
+ return; //no need to remove the face because the media is not in playing.
}
- mIsPlaying = FALSE ; //set to remove the media from the face.
- switchTexture(LLRender::DIFFUSE_MAP, facep) ;
- mIsPlaying = TRUE ; //set the flag back.
+ mIsPlaying = FALSE; //set to remove the media from the face.
+ switchTexture(LLRender::DIFFUSE_MAP, facep);
+ mIsPlaying = TRUE; //set the flag back.
if(getTotalNumFaces() < 1) //no face referencing to this media
{
- stopPlaying() ;
+ stopPlaying();
}
}
//virtual
void LLViewerMediaTexture::addFace(U32 ch, LLFace* facep)
{
- LLViewerTexture::addFace(ch, facep) ;
+ LLViewerTexture::addFace(ch, facep);
- const LLTextureEntry* te = facep->getTextureEntry() ;
+ const LLTextureEntry* te = facep->getTextureEntry();
if(te && te->getID().notNull())
{
- LLViewerTexture* tex = gTextureList.findImage(te->getID()) ;
+ LLViewerTexture* tex = gTextureList.findImage(te->getID());
if(tex)
{
- mTextureList.push_back(tex) ;//increase the reference number by one for tex to avoid deleting it.
- return ;
+ mTextureList.push_back(tex);//increase the reference number by one for tex to avoid deleting it.
+ return;
}
}
//check if it is a parcel media
if(facep->getTexture() && facep->getTexture() != this && facep->getTexture()->getID() == mID)
{
- mTextureList.push_back(facep->getTexture()) ; //a parcel media.
- return ;
+ mTextureList.push_back(facep->getTexture()); //a parcel media.
+ return;
}
if(te && te->getID().notNull()) //should have a texture
{
- llerrs << "The face does not have a valid texture before media texture." << llendl ;
+ LL_ERRS() << "The face does not have a valid texture before media texture." << LL_ENDL;
}
}
//virtual
void LLViewerMediaTexture::removeFace(U32 ch, LLFace* facep)
{
- LLViewerTexture::removeFace(ch, facep) ;
+ LLViewerTexture::removeFace(ch, facep);
- const LLTextureEntry* te = facep->getTextureEntry() ;
+ const LLTextureEntry* te = facep->getTextureEntry();
if(te && te->getID().notNull())
{
- LLViewerTexture* tex = gTextureList.findImage(te->getID()) ;
+ LLViewerTexture* tex = gTextureList.findImage(te->getID());
if(tex)
{
for(std::list< LLPointer<LLViewerTexture> >::iterator iter = mTextureList.begin();
@@ -3275,8 +3422,8 @@ void LLViewerMediaTexture::removeFace(U32 ch, LLFace* facep)
{
if(*iter == tex)
{
- mTextureList.erase(iter) ; //decrease the reference number for tex by one.
- return ;
+ mTextureList.erase(iter); //decrease the reference number for tex by one.
+ return;
}
}
@@ -3284,13 +3431,13 @@ void LLViewerMediaTexture::removeFace(U32 ch, LLFace* facep)
for (U32 ch = 0; ch < 3; ++ch)
{
- //
- //we have some trouble here: the texture of the face is changed.
- //we need to find the former texture, and remove it from the list to avoid memory leaking.
+ //
+ //we have some trouble here: the texture of the face is changed.
+ //we need to find the former texture, and remove it from the list to avoid memory leaking.
llassert(mNumFaces[ch] <= mFaceList[ch].size());
- for(U32 j = 0 ; j < mNumFaces[ch] ; j++)
+ for(U32 j = 0; j < mNumFaces[ch]; j++)
{
te_list.push_back(mFaceList[ch][j]->getTextureEntry());//all textures are in use.
}
@@ -3298,8 +3445,8 @@ void LLViewerMediaTexture::removeFace(U32 ch, LLFace* facep)
if (te_list.empty())
{
- mTextureList.clear() ;
- return ;
+ mTextureList.clear();
+ return;
}
S32 end = te_list.size();
@@ -3309,18 +3456,18 @@ void LLViewerMediaTexture::removeFace(U32 ch, LLFace* facep)
{
S32 i = 0;
- for(i = 0 ; i < end ; i++)
+ for(i = 0; i < end; i++)
{
if(te_list[i] && te_list[i]->getID() == (*iter)->getID())//the texture is in use.
{
- te_list[i] = NULL ;
- break ;
+ te_list[i] = NULL;
+ break;
}
}
if(i == end) //no hit for this texture, remove it.
{
- mTextureList.erase(iter) ; //decrease the reference number for tex by one.
- return ;
+ mTextureList.erase(iter); //decrease the reference number for tex by one.
+ return;
}
}
}
@@ -3332,14 +3479,14 @@ void LLViewerMediaTexture::removeFace(U32 ch, LLFace* facep)
{
if((*iter)->getID() == mID)
{
- mTextureList.erase(iter) ; //decrease the reference number for tex by one.
- return ;
+ mTextureList.erase(iter); //decrease the reference number for tex by one.
+ return;
}
}
if(te && te->getID().notNull()) //should have a texture
{
- llerrs << "mTextureList texture reference number is corrupted." << llendl ;
+ LL_ERRS() << "mTextureList texture reference number is corrupted." << LL_ENDL;
}
}
@@ -3348,9 +3495,9 @@ void LLViewerMediaTexture::stopPlaying()
// Don't stop the media impl playing here -- this breaks non-inworld media (login screen, search, and media browser).
// if(mMediaImplp)
// {
-// mMediaImplp->stop() ;
+// mMediaImplp->stop();
// }
- mIsPlaying = FALSE ;
+ mIsPlaying = FALSE;
}
void LLViewerMediaTexture::switchTexture(U32 ch, LLFace* facep)
@@ -3363,29 +3510,29 @@ void LLViewerMediaTexture::switchTexture(U32 ch, LLFace* facep)
{
if(mID == facep->getTexture()->getID()) //this is a parcel media
{
- return ; //let the prim media win.
+ return; //let the prim media win.
}
}
if(mIsPlaying) //old textures switch to the media texture
{
- facep->switchTexture(ch, this) ;
+ facep->switchTexture(ch, this);
}
else //switch to old textures.
{
- const LLTextureEntry* te = facep->getTextureEntry() ;
+ const LLTextureEntry* te = facep->getTextureEntry();
if(te)
{
- LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID()) : NULL ;
+ LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID()) : NULL;
if(!tex && te->getID() != mID)//try parcel media.
{
- tex = gTextureList.findImage(mID) ;
+ tex = gTextureList.findImage(mID);
}
if(!tex)
{
- tex = LLViewerFetchedTexture::sDefaultImagep ;
+ tex = LLViewerFetchedTexture::sDefaultImagep;
}
- facep->switchTexture(ch, tex) ;
+ facep->switchTexture(ch, tex);
}
}
}
@@ -3395,36 +3542,36 @@ void LLViewerMediaTexture::setPlaying(BOOL playing)
{
if(!mMediaImplp)
{
- return ;
+ return;
}
if(!playing && !mIsPlaying)
{
- return ; //media is already off
+ return; //media is already off
}
if(playing == mIsPlaying && !mMediaImplp->isUpdated())
{
- return ; //nothing has changed since last time.
+ return; //nothing has changed since last time.
}
- mIsPlaying = playing ;
+ mIsPlaying = playing;
if(mIsPlaying) //is about to play this media
{
if(findFaces())
{
//about to update all faces.
- mMediaImplp->setUpdated(FALSE) ;
+ mMediaImplp->setUpdated(FALSE);
}
if(mMediaFaceList.empty())//no face pointing to this media
{
- stopPlaying() ;
- return ;
+ stopPlaying();
+ return;
}
for(std::list< LLFace* >::iterator iter = mMediaFaceList.begin(); iter!= mMediaFaceList.end(); ++iter)
{
- switchTexture(LLRender::DIFFUSE_MAP, *iter) ;
+ switchTexture(LLRender::DIFFUSE_MAP, *iter);
}
}
else //stop playing this media
@@ -3432,12 +3579,12 @@ void LLViewerMediaTexture::setPlaying(BOOL playing)
U32 ch = LLRender::DIFFUSE_MAP;
llassert(mNumFaces[ch] <= mFaceList[ch].size());
- for(U32 i = mNumFaces[ch] ; i ; i--)
+ for(U32 i = mNumFaces[ch]; i; i--)
{
- switchTexture(ch, mFaceList[ch][i - 1]) ; //current face could be removed in this function.
+ switchTexture(ch, mFaceList[ch][i - 1]); //current face could be removed in this function.
}
}
- return ;
+ return;
}
//virtual
@@ -3445,13 +3592,13 @@ F32 LLViewerMediaTexture::getMaxVirtualSize()
{
if(LLFrameTimer::getFrameCount() == mUpdateVirtualSizeTime)
{
- return mMaxVirtualSize ;
+ return mMaxVirtualSize;
}
- mUpdateVirtualSizeTime = LLFrameTimer::getFrameCount() ;
+ mUpdateVirtualSizeTime = LLFrameTimer::getFrameCount();
if(!mMaxVirtualSizeResetCounter)
{
- addTextureStats(0.f, FALSE) ;//reset
+ addTextureStats(0.f, FALSE);//reset
}
if(mIsPlaying) //media is playing
@@ -3459,28 +3606,28 @@ F32 LLViewerMediaTexture::getMaxVirtualSize()
for (U32 ch = 0; ch < LLRender::NUM_TEXTURE_CHANNELS; ++ch)
{
llassert(mNumFaces[ch] <= mFaceList[ch].size());
- for(U32 i = 0 ; i < mNumFaces[ch] ; i++)
+ for(U32 i = 0; i < mNumFaces[ch]; i++)
{
- LLFace* facep = mFaceList[ch][i] ;
- if(facep->getDrawable()->isRecentlyVisible())
- {
- addTextureStats(facep->getVirtualSize()) ;
- }
- }
- }
+ LLFace* facep = mFaceList[ch][i];
+ if(facep->getDrawable()->isRecentlyVisible())
+ {
+ addTextureStats(facep->getVirtualSize());
+ }
+ }
+ }
}
else //media is not in playing
{
- findFaces() ;
+ findFaces();
if(!mMediaFaceList.empty())
{
for(std::list< LLFace* >::iterator iter = mMediaFaceList.begin(); iter!= mMediaFaceList.end(); ++iter)
{
- LLFace* facep = *iter ;
+ LLFace* facep = *iter;
if(facep->getDrawable()->isRecentlyVisible())
{
- addTextureStats(facep->getVirtualSize()) ;
+ addTextureStats(facep->getVirtualSize());
}
}
}
@@ -3490,10 +3637,10 @@ F32 LLViewerMediaTexture::getMaxVirtualSize()
{
mMaxVirtualSizeResetCounter--;
}
- reorganizeFaceList() ;
+ reorganizeFaceList();
reorganizeVolumeList();
- return mMaxVirtualSize ;
+ return mMaxVirtualSize;
}
//----------------------------------------------------------------------------------------------
//end of LLViewerMediaTexture
@@ -3504,27 +3651,27 @@ F32 LLViewerMediaTexture::getMaxVirtualSize()
//----------------------------------------------------------------------------------------------
LLTexturePipelineTester::LLTexturePipelineTester() : LLMetricPerformanceTesterWithSession(sTesterName)
{
- addMetric("TotalBytesLoaded") ;
- addMetric("TotalBytesLoadedFromCache") ;
- addMetric("TotalBytesLoadedForLargeImage") ;
- addMetric("TotalBytesLoadedForSculpties") ;
- addMetric("StartFetchingTime") ;
- addMetric("TotalGrayTime") ;
- addMetric("TotalStablizingTime") ;
- addMetric("StartTimeLoadingSculpties") ;
- addMetric("EndTimeLoadingSculpties") ;
-
- addMetric("Time") ;
- addMetric("TotalBytesBound") ;
- addMetric("TotalBytesBoundForLargeImage") ;
- addMetric("PercentageBytesBound") ;
+ addMetric("TotalBytesLoaded");
+ addMetric("TotalBytesLoadedFromCache");
+ addMetric("TotalBytesLoadedForLargeImage");
+ addMetric("TotalBytesLoadedForSculpties");
+ addMetric("StartFetchingTime");
+ addMetric("TotalGrayTime");
+ addMetric("TotalStablizingTime");
+ addMetric("StartTimeLoadingSculpties");
+ addMetric("EndTimeLoadingSculpties");
+
+ addMetric("Time");
+ addMetric("TotalBytesBound");
+ addMetric("TotalBytesBoundForLargeImage");
+ addMetric("PercentageBytesBound");
- mTotalBytesLoaded = 0 ;
- mTotalBytesLoadedFromCache = 0 ;
- mTotalBytesLoadedForLargeImage = 0 ;
- mTotalBytesLoadedForSculpties = 0 ;
+ mTotalBytesLoaded = (S32Bytes)0;
+ mTotalBytesLoadedFromCache = (S32Bytes)0;
+ mTotalBytesLoadedForLargeImage = (S32Bytes)0;
+ mTotalBytesLoadedForSculpties = (S32Bytes)0;
- reset() ;
+ reset();
}
LLTexturePipelineTester::~LLTexturePipelineTester()
@@ -3534,222 +3681,222 @@ LLTexturePipelineTester::~LLTexturePipelineTester()
void LLTexturePipelineTester::update()
{
- mLastTotalBytesUsed = mTotalBytesUsed ;
- mLastTotalBytesUsedForLargeImage = mTotalBytesUsedForLargeImage ;
- mTotalBytesUsed = 0 ;
- mTotalBytesUsedForLargeImage = 0 ;
+ mLastTotalBytesUsed = mTotalBytesUsed;
+ mLastTotalBytesUsedForLargeImage = mTotalBytesUsedForLargeImage;
+ mTotalBytesUsed = (S32Bytes)0;
+ mTotalBytesUsedForLargeImage = (S32Bytes)0;
if(LLAppViewer::getTextureFetch()->getNumRequests() > 0) //fetching list is not empty
{
if(mPause)
{
//start a new fetching session
- reset() ;
- mStartFetchingTime = LLImageGL::sLastFrameTime ;
- mPause = FALSE ;
+ reset();
+ mStartFetchingTime = LLImageGL::sLastFrameTime;
+ mPause = FALSE;
}
//update total gray time
if(mUsingDefaultTexture)
{
- mUsingDefaultTexture = FALSE ;
- mTotalGrayTime = LLImageGL::sLastFrameTime - mStartFetchingTime ;
+ mUsingDefaultTexture = FALSE;
+ mTotalGrayTime = LLImageGL::sLastFrameTime - mStartFetchingTime;
}
//update the stablizing timer.
- updateStablizingTime() ;
+ updateStablizingTime();
- outputTestResults() ;
+ outputTestResults();
}
else if(!mPause)
{
//stop the current fetching session
- mPause = TRUE ;
- outputTestResults() ;
- reset() ;
+ mPause = TRUE;
+ outputTestResults();
+ reset();
}
}
void LLTexturePipelineTester::reset()
{
- mPause = TRUE ;
+ mPause = TRUE;
- mUsingDefaultTexture = FALSE ;
- mStartStablizingTime = 0.0f ;
- mEndStablizingTime = 0.0f ;
+ mUsingDefaultTexture = FALSE;
+ mStartStablizingTime = 0.0f;
+ mEndStablizingTime = 0.0f;
- mTotalBytesUsed = 0 ;
- mTotalBytesUsedForLargeImage = 0 ;
- mLastTotalBytesUsed = 0 ;
- mLastTotalBytesUsedForLargeImage = 0 ;
+ mTotalBytesUsed = (S32Bytes)0;
+ mTotalBytesUsedForLargeImage = (S32Bytes)0;
+ mLastTotalBytesUsed = (S32Bytes)0;
+ mLastTotalBytesUsedForLargeImage = (S32Bytes)0;
- mStartFetchingTime = 0.0f ;
+ mStartFetchingTime = 0.0f;
- mTotalGrayTime = 0.0f ;
- mTotalStablizingTime = 0.0f ;
+ mTotalGrayTime = 0.0f;
+ mTotalStablizingTime = 0.0f;
- mStartTimeLoadingSculpties = 1.0f ;
- mEndTimeLoadingSculpties = 0.0f ;
+ mStartTimeLoadingSculpties = 1.0f;
+ mEndTimeLoadingSculpties = 0.0f;
}
//virtual
void LLTexturePipelineTester::outputTestRecord(LLSD *sd)
{
std::string currentLabel = getCurrentLabelName();
- (*sd)[currentLabel]["TotalBytesLoaded"] = (LLSD::Integer)mTotalBytesLoaded ;
- (*sd)[currentLabel]["TotalBytesLoadedFromCache"] = (LLSD::Integer)mTotalBytesLoadedFromCache ;
- (*sd)[currentLabel]["TotalBytesLoadedForLargeImage"] = (LLSD::Integer)mTotalBytesLoadedForLargeImage ;
- (*sd)[currentLabel]["TotalBytesLoadedForSculpties"] = (LLSD::Integer)mTotalBytesLoadedForSculpties ;
+ (*sd)[currentLabel]["TotalBytesLoaded"] = (LLSD::Integer)mTotalBytesLoaded.value();
+ (*sd)[currentLabel]["TotalBytesLoadedFromCache"] = (LLSD::Integer)mTotalBytesLoadedFromCache.value();
+ (*sd)[currentLabel]["TotalBytesLoadedForLargeImage"] = (LLSD::Integer)mTotalBytesLoadedForLargeImage.value();
+ (*sd)[currentLabel]["TotalBytesLoadedForSculpties"] = (LLSD::Integer)mTotalBytesLoadedForSculpties.value();
- (*sd)[currentLabel]["StartFetchingTime"] = (LLSD::Real)mStartFetchingTime ;
- (*sd)[currentLabel]["TotalGrayTime"] = (LLSD::Real)mTotalGrayTime ;
- (*sd)[currentLabel]["TotalStablizingTime"] = (LLSD::Real)mTotalStablizingTime ;
+ (*sd)[currentLabel]["StartFetchingTime"] = (LLSD::Real)mStartFetchingTime;
+ (*sd)[currentLabel]["TotalGrayTime"] = (LLSD::Real)mTotalGrayTime;
+ (*sd)[currentLabel]["TotalStablizingTime"] = (LLSD::Real)mTotalStablizingTime;
- (*sd)[currentLabel]["StartTimeLoadingSculpties"] = (LLSD::Real)mStartTimeLoadingSculpties ;
- (*sd)[currentLabel]["EndTimeLoadingSculpties"] = (LLSD::Real)mEndTimeLoadingSculpties ;
+ (*sd)[currentLabel]["StartTimeLoadingSculpties"] = (LLSD::Real)mStartTimeLoadingSculpties;
+ (*sd)[currentLabel]["EndTimeLoadingSculpties"] = (LLSD::Real)mEndTimeLoadingSculpties;
- (*sd)[currentLabel]["Time"] = LLImageGL::sLastFrameTime ;
- (*sd)[currentLabel]["TotalBytesBound"] = (LLSD::Integer)mLastTotalBytesUsed ;
- (*sd)[currentLabel]["TotalBytesBoundForLargeImage"] = (LLSD::Integer)mLastTotalBytesUsedForLargeImage ;
- (*sd)[currentLabel]["PercentageBytesBound"] = (LLSD::Real)(100.f * mLastTotalBytesUsed / mTotalBytesLoaded) ;
+ (*sd)[currentLabel]["Time"] = LLImageGL::sLastFrameTime;
+ (*sd)[currentLabel]["TotalBytesBound"] = (LLSD::Integer)mLastTotalBytesUsed.value();
+ (*sd)[currentLabel]["TotalBytesBoundForLargeImage"] = (LLSD::Integer)mLastTotalBytesUsedForLargeImage.value();
+ (*sd)[currentLabel]["PercentageBytesBound"] = (LLSD::Real)(100.f * mLastTotalBytesUsed / mTotalBytesLoaded);
}
void LLTexturePipelineTester::updateTextureBindingStats(const LLViewerTexture* imagep)
{
- U32 mem_size = (U32)imagep->getTextureMemory() ;
- mTotalBytesUsed += mem_size ;
+ U32Bytes mem_size = imagep->getTextureMemory();
+ mTotalBytesUsed += mem_size;
- if(MIN_LARGE_IMAGE_AREA <= (U32)(mem_size / (U32)imagep->getComponents()))
+ if(MIN_LARGE_IMAGE_AREA <= (U32)(mem_size.value() / (U32)imagep->getComponents()))
{
- mTotalBytesUsedForLargeImage += mem_size ;
+ mTotalBytesUsedForLargeImage += mem_size;
}
}
void LLTexturePipelineTester::updateTextureLoadingStats(const LLViewerFetchedTexture* imagep, const LLImageRaw* raw_imagep, BOOL from_cache)
{
- U32 data_size = (U32)raw_imagep->getDataSize() ;
- mTotalBytesLoaded += data_size ;
+ U32Bytes data_size = (U32Bytes)raw_imagep->getDataSize();
+ mTotalBytesLoaded += data_size;
if(from_cache)
{
- mTotalBytesLoadedFromCache += data_size ;
+ mTotalBytesLoadedFromCache += data_size;
}
- if(MIN_LARGE_IMAGE_AREA <= (U32)(data_size / (U32)raw_imagep->getComponents()))
+ if(MIN_LARGE_IMAGE_AREA <= (U32)(data_size.value() / (U32)raw_imagep->getComponents()))
{
- mTotalBytesLoadedForLargeImage += data_size ;
+ mTotalBytesLoadedForLargeImage += data_size;
}
if(imagep->forSculpt())
{
- mTotalBytesLoadedForSculpties += data_size ;
+ mTotalBytesLoadedForSculpties += data_size;
if(mStartTimeLoadingSculpties > mEndTimeLoadingSculpties)
{
- mStartTimeLoadingSculpties = LLImageGL::sLastFrameTime ;
+ mStartTimeLoadingSculpties = LLImageGL::sLastFrameTime;
}
- mEndTimeLoadingSculpties = LLImageGL::sLastFrameTime ;
+ mEndTimeLoadingSculpties = LLImageGL::sLastFrameTime;
}
}
void LLTexturePipelineTester::updateGrayTextureBinding()
{
- mUsingDefaultTexture = TRUE ;
+ mUsingDefaultTexture = TRUE;
}
void LLTexturePipelineTester::setStablizingTime()
{
if(mStartStablizingTime <= mStartFetchingTime)
{
- mStartStablizingTime = LLImageGL::sLastFrameTime ;
+ mStartStablizingTime = LLImageGL::sLastFrameTime;
}
- mEndStablizingTime = LLImageGL::sLastFrameTime ;
+ mEndStablizingTime = LLImageGL::sLastFrameTime;
}
void LLTexturePipelineTester::updateStablizingTime()
{
if(mStartStablizingTime > mStartFetchingTime)
{
- F32 t = mEndStablizingTime - mStartStablizingTime ;
+ F32 t = mEndStablizingTime - mStartStablizingTime;
if(t > F_ALMOST_ZERO && (t - mTotalStablizingTime) < F_ALMOST_ZERO)
{
//already stablized
- mTotalStablizingTime = LLImageGL::sLastFrameTime - mStartStablizingTime ;
+ mTotalStablizingTime = LLImageGL::sLastFrameTime - mStartStablizingTime;
//cancel the timer
- mStartStablizingTime = 0.f ;
- mEndStablizingTime = 0.f ;
+ mStartStablizingTime = 0.f;
+ mEndStablizingTime = 0.f;
}
else
{
- mTotalStablizingTime = t ;
+ mTotalStablizingTime = t;
}
}
- mTotalStablizingTime = 0.f ;
+ mTotalStablizingTime = 0.f;
}
//virtual
void LLTexturePipelineTester::compareTestSessions(std::ofstream* os)
{
- LLTexturePipelineTester::LLTextureTestSession* base_sessionp = dynamic_cast<LLTexturePipelineTester::LLTextureTestSession*>(mBaseSessionp) ;
- LLTexturePipelineTester::LLTextureTestSession* current_sessionp = dynamic_cast<LLTexturePipelineTester::LLTextureTestSession*>(mCurrentSessionp) ;
+ LLTexturePipelineTester::LLTextureTestSession* base_sessionp = dynamic_cast<LLTexturePipelineTester::LLTextureTestSession*>(mBaseSessionp);
+ LLTexturePipelineTester::LLTextureTestSession* current_sessionp = dynamic_cast<LLTexturePipelineTester::LLTextureTestSession*>(mCurrentSessionp);
if(!base_sessionp || !current_sessionp)
{
- llerrs << "type of test session does not match!" << llendl ;
+ LL_ERRS() << "type of test session does not match!" << LL_ENDL;
}
//compare and output the comparison
- *os << llformat("%s\n", getTesterName().c_str()) ;
- *os << llformat("AggregateResults\n") ;
+ *os << llformat("%s\n", getTesterName().c_str());
+ *os << llformat("AggregateResults\n");
- compareTestResults(os, "TotalFetchingTime", base_sessionp->mTotalFetchingTime, current_sessionp->mTotalFetchingTime) ;
- compareTestResults(os, "TotalGrayTime", base_sessionp->mTotalGrayTime, current_sessionp->mTotalGrayTime) ;
+ compareTestResults(os, "TotalFetchingTime", base_sessionp->mTotalFetchingTime, current_sessionp->mTotalFetchingTime);
+ compareTestResults(os, "TotalGrayTime", base_sessionp->mTotalGrayTime, current_sessionp->mTotalGrayTime);
compareTestResults(os, "TotalStablizingTime", base_sessionp->mTotalStablizingTime, current_sessionp->mTotalStablizingTime);
- compareTestResults(os, "StartTimeLoadingSculpties", base_sessionp->mStartTimeLoadingSculpties, current_sessionp->mStartTimeLoadingSculpties) ;
- compareTestResults(os, "TotalTimeLoadingSculpties", base_sessionp->mTotalTimeLoadingSculpties, current_sessionp->mTotalTimeLoadingSculpties) ;
+ compareTestResults(os, "StartTimeLoadingSculpties", base_sessionp->mStartTimeLoadingSculpties, current_sessionp->mStartTimeLoadingSculpties);
+ compareTestResults(os, "TotalTimeLoadingSculpties", base_sessionp->mTotalTimeLoadingSculpties, current_sessionp->mTotalTimeLoadingSculpties);
- compareTestResults(os, "TotalBytesLoaded", base_sessionp->mTotalBytesLoaded, current_sessionp->mTotalBytesLoaded) ;
- compareTestResults(os, "TotalBytesLoadedFromCache", base_sessionp->mTotalBytesLoadedFromCache, current_sessionp->mTotalBytesLoadedFromCache) ;
- compareTestResults(os, "TotalBytesLoadedForLargeImage", base_sessionp->mTotalBytesLoadedForLargeImage, current_sessionp->mTotalBytesLoadedForLargeImage) ;
- compareTestResults(os, "TotalBytesLoadedForSculpties", base_sessionp->mTotalBytesLoadedForSculpties, current_sessionp->mTotalBytesLoadedForSculpties) ;
+ compareTestResults(os, "TotalBytesLoaded", base_sessionp->mTotalBytesLoaded, current_sessionp->mTotalBytesLoaded);
+ compareTestResults(os, "TotalBytesLoadedFromCache", base_sessionp->mTotalBytesLoadedFromCache, current_sessionp->mTotalBytesLoadedFromCache);
+ compareTestResults(os, "TotalBytesLoadedForLargeImage", base_sessionp->mTotalBytesLoadedForLargeImage, current_sessionp->mTotalBytesLoadedForLargeImage);
+ compareTestResults(os, "TotalBytesLoadedForSculpties", base_sessionp->mTotalBytesLoadedForSculpties, current_sessionp->mTotalBytesLoadedForSculpties);
- *os << llformat("InstantResults\n") ;
- S32 size = llmin(base_sessionp->mInstantPerformanceListCounter, current_sessionp->mInstantPerformanceListCounter) ;
- for(S32 i = 0 ; i < size ; i++)
+ *os << llformat("InstantResults\n");
+ S32 size = llmin(base_sessionp->mInstantPerformanceListCounter, current_sessionp->mInstantPerformanceListCounter);
+ for(S32 i = 0; i < size; i++)
{
- *os << llformat("Time(B-T)-%.4f-%.4f\n", base_sessionp->mInstantPerformanceList[i].mTime, current_sessionp->mInstantPerformanceList[i].mTime) ;
+ *os << llformat("Time(B-T)-%.4f-%.4f\n", base_sessionp->mInstantPerformanceList[i].mTime, current_sessionp->mInstantPerformanceList[i].mTime);
compareTestResults(os, "AverageBytesUsedPerSecond", base_sessionp->mInstantPerformanceList[i].mAverageBytesUsedPerSecond,
- current_sessionp->mInstantPerformanceList[i].mAverageBytesUsedPerSecond) ;
+ current_sessionp->mInstantPerformanceList[i].mAverageBytesUsedPerSecond);
compareTestResults(os, "AverageBytesUsedForLargeImagePerSecond", base_sessionp->mInstantPerformanceList[i].mAverageBytesUsedForLargeImagePerSecond,
- current_sessionp->mInstantPerformanceList[i].mAverageBytesUsedForLargeImagePerSecond) ;
+ current_sessionp->mInstantPerformanceList[i].mAverageBytesUsedForLargeImagePerSecond);
compareTestResults(os, "AveragePercentageBytesUsedPerSecond", base_sessionp->mInstantPerformanceList[i].mAveragePercentageBytesUsedPerSecond,
- current_sessionp->mInstantPerformanceList[i].mAveragePercentageBytesUsedPerSecond) ;
+ current_sessionp->mInstantPerformanceList[i].mAveragePercentageBytesUsedPerSecond);
}
if(size < base_sessionp->mInstantPerformanceListCounter)
{
- for(S32 i = size ; i < base_sessionp->mInstantPerformanceListCounter ; i++)
+ for(S32 i = size; i < base_sessionp->mInstantPerformanceListCounter; i++)
{
- *os << llformat("Time(B-T)-%.4f- \n", base_sessionp->mInstantPerformanceList[i].mTime) ;
+ *os << llformat("Time(B-T)-%.4f- \n", base_sessionp->mInstantPerformanceList[i].mTime);
- *os << llformat(", AverageBytesUsedPerSecond, %d, N/A \n", base_sessionp->mInstantPerformanceList[i].mAverageBytesUsedPerSecond) ;
- *os << llformat(", AverageBytesUsedForLargeImagePerSecond, %d, N/A \n", base_sessionp->mInstantPerformanceList[i].mAverageBytesUsedForLargeImagePerSecond) ;
- *os << llformat(", AveragePercentageBytesUsedPerSecond, %.4f, N/A \n", base_sessionp->mInstantPerformanceList[i].mAveragePercentageBytesUsedPerSecond) ;
+ *os << llformat(", AverageBytesUsedPerSecond, %d, N/A \n", base_sessionp->mInstantPerformanceList[i].mAverageBytesUsedPerSecond);
+ *os << llformat(", AverageBytesUsedForLargeImagePerSecond, %d, N/A \n", base_sessionp->mInstantPerformanceList[i].mAverageBytesUsedForLargeImagePerSecond);
+ *os << llformat(", AveragePercentageBytesUsedPerSecond, %.4f, N/A \n", base_sessionp->mInstantPerformanceList[i].mAveragePercentageBytesUsedPerSecond);
}
}
else if(size < current_sessionp->mInstantPerformanceListCounter)
{
- for(S32 i = size ; i < current_sessionp->mInstantPerformanceListCounter ; i++)
+ for(S32 i = size; i < current_sessionp->mInstantPerformanceListCounter; i++)
{
- *os << llformat("Time(B-T)- -%.4f\n", current_sessionp->mInstantPerformanceList[i].mTime) ;
+ *os << llformat("Time(B-T)- -%.4f\n", current_sessionp->mInstantPerformanceList[i].mTime);
- *os << llformat(", AverageBytesUsedPerSecond, N/A, %d\n", current_sessionp->mInstantPerformanceList[i].mAverageBytesUsedPerSecond) ;
- *os << llformat(", AverageBytesUsedForLargeImagePerSecond, N/A, %d\n", current_sessionp->mInstantPerformanceList[i].mAverageBytesUsedForLargeImagePerSecond) ;
- *os << llformat(", AveragePercentageBytesUsedPerSecond, N/A, %.4f\n", current_sessionp->mInstantPerformanceList[i].mAveragePercentageBytesUsedPerSecond) ;
+ *os << llformat(", AverageBytesUsedPerSecond, N/A, %d\n", current_sessionp->mInstantPerformanceList[i].mAverageBytesUsedPerSecond);
+ *os << llformat(", AverageBytesUsedForLargeImagePerSecond, N/A, %d\n", current_sessionp->mInstantPerformanceList[i].mAverageBytesUsedForLargeImagePerSecond);
+ *os << llformat(", AveragePercentageBytesUsedPerSecond, N/A, %.4f\n", current_sessionp->mInstantPerformanceList[i].mAveragePercentageBytesUsedPerSecond);
}
}
}
@@ -3757,144 +3904,144 @@ void LLTexturePipelineTester::compareTestSessions(std::ofstream* os)
//virtual
LLMetricPerformanceTesterWithSession::LLTestSession* LLTexturePipelineTester::loadTestSession(LLSD* log)
{
- LLTexturePipelineTester::LLTextureTestSession* sessionp = new LLTexturePipelineTester::LLTextureTestSession() ;
+ LLTexturePipelineTester::LLTextureTestSession* sessionp = new LLTexturePipelineTester::LLTextureTestSession();
if(!sessionp)
{
- return NULL ;
+ return NULL;
}
- F32 total_fetching_time = 0.f ;
- F32 total_gray_time = 0.f ;
- F32 total_stablizing_time = 0.f ;
- F32 total_loading_sculpties_time = 0.f ;
-
- F32 start_fetching_time = -1.f ;
- F32 start_fetching_sculpties_time = 0.f ;
-
- F32 last_time = 0.0f ;
- S32 frame_count = 0 ;
-
- sessionp->mInstantPerformanceListCounter = 0 ;
- sessionp->mInstantPerformanceList.resize(128) ;
- sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAverageBytesUsedPerSecond = 0 ;
- sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAverageBytesUsedForLargeImagePerSecond = 0 ;
- sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAveragePercentageBytesUsedPerSecond = 0.f ;
- sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mTime = 0.f ;
+ F32 total_fetching_time = 0.f;
+ F32 total_gray_time = 0.f;
+ F32 total_stablizing_time = 0.f;
+ F32 total_loading_sculpties_time = 0.f;
+
+ F32 start_fetching_time = -1.f;
+ F32 start_fetching_sculpties_time = 0.f;
+
+ F32 last_time = 0.0f;
+ S32 frame_count = 0;
+
+ sessionp->mInstantPerformanceListCounter = 0;
+ sessionp->mInstantPerformanceList.resize(128);
+ sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAverageBytesUsedPerSecond = 0;
+ sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAverageBytesUsedForLargeImagePerSecond = 0;
+ sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAveragePercentageBytesUsedPerSecond = 0.f;
+ sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mTime = 0.f;
//load a session
std::string currentLabel = getCurrentLabelName();
- BOOL in_log = (*log).has(currentLabel) ;
+ BOOL in_log = (*log).has(currentLabel);
while (in_log)
{
- LLSD::String label = currentLabel ;
+ LLSD::String label = currentLabel;
if(sessionp->mInstantPerformanceListCounter >= (S32)sessionp->mInstantPerformanceList.size())
{
- sessionp->mInstantPerformanceList.resize(sessionp->mInstantPerformanceListCounter + 128) ;
+ sessionp->mInstantPerformanceList.resize(sessionp->mInstantPerformanceListCounter + 128);
}
//time
- F32 start_time = (*log)[label]["StartFetchingTime"].asReal() ;
- F32 cur_time = (*log)[label]["Time"].asReal() ;
+ F32 start_time = (*log)[label]["StartFetchingTime"].asReal();
+ F32 cur_time = (*log)[label]["Time"].asReal();
if(start_time - start_fetching_time > F_ALMOST_ZERO) //fetching has paused for a while
{
- sessionp->mTotalFetchingTime += total_fetching_time ;
- sessionp->mTotalGrayTime += total_gray_time ;
- sessionp->mTotalStablizingTime += total_stablizing_time ;
+ sessionp->mTotalFetchingTime += total_fetching_time;
+ sessionp->mTotalGrayTime += total_gray_time;
+ sessionp->mTotalStablizingTime += total_stablizing_time;
- sessionp->mStartTimeLoadingSculpties = start_fetching_sculpties_time ;
- sessionp->mTotalTimeLoadingSculpties += total_loading_sculpties_time ;
+ sessionp->mStartTimeLoadingSculpties = start_fetching_sculpties_time;
+ sessionp->mTotalTimeLoadingSculpties += total_loading_sculpties_time;
- start_fetching_time = start_time ;
- total_fetching_time = 0.0f ;
- total_gray_time = 0.f ;
- total_stablizing_time = 0.f ;
- total_loading_sculpties_time = 0.f ;
+ start_fetching_time = start_time;
+ total_fetching_time = 0.0f;
+ total_gray_time = 0.f;
+ total_stablizing_time = 0.f;
+ total_loading_sculpties_time = 0.f;
}
else
{
- total_fetching_time = cur_time - start_time ;
- total_gray_time = (*log)[label]["TotalGrayTime"].asReal() ;
- total_stablizing_time = (*log)[label]["TotalStablizingTime"].asReal() ;
+ total_fetching_time = cur_time - start_time;
+ total_gray_time = (*log)[label]["TotalGrayTime"].asReal();
+ total_stablizing_time = (*log)[label]["TotalStablizingTime"].asReal();
- total_loading_sculpties_time = (*log)[label]["EndTimeLoadingSculpties"].asReal() - (*log)[label]["StartTimeLoadingSculpties"].asReal() ;
+ total_loading_sculpties_time = (*log)[label]["EndTimeLoadingSculpties"].asReal() - (*log)[label]["StartTimeLoadingSculpties"].asReal();
if(start_fetching_sculpties_time < 0.f && total_loading_sculpties_time > 0.f)
{
- start_fetching_sculpties_time = (*log)[label]["StartTimeLoadingSculpties"].asReal() ;
+ start_fetching_sculpties_time = (*log)[label]["StartTimeLoadingSculpties"].asReal();
}
}
//total loaded bytes
- sessionp->mTotalBytesLoaded = (*log)[label]["TotalBytesLoaded"].asInteger() ;
- sessionp->mTotalBytesLoadedFromCache = (*log)[label]["TotalBytesLoadedFromCache"].asInteger() ;
- sessionp->mTotalBytesLoadedForLargeImage = (*log)[label]["TotalBytesLoadedForLargeImage"].asInteger() ;
- sessionp->mTotalBytesLoadedForSculpties = (*log)[label]["TotalBytesLoadedForSculpties"].asInteger() ;
+ sessionp->mTotalBytesLoaded = (*log)[label]["TotalBytesLoaded"].asInteger();
+ sessionp->mTotalBytesLoadedFromCache = (*log)[label]["TotalBytesLoadedFromCache"].asInteger();
+ sessionp->mTotalBytesLoadedForLargeImage = (*log)[label]["TotalBytesLoadedForLargeImage"].asInteger();
+ sessionp->mTotalBytesLoadedForSculpties = (*log)[label]["TotalBytesLoadedForSculpties"].asInteger();
//instant metrics
sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAverageBytesUsedPerSecond +=
- (*log)[label]["TotalBytesBound"].asInteger() ;
+ (*log)[label]["TotalBytesBound"].asInteger();
sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAverageBytesUsedForLargeImagePerSecond +=
- (*log)[label]["TotalBytesBoundForLargeImage"].asInteger() ;
+ (*log)[label]["TotalBytesBoundForLargeImage"].asInteger();
sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAveragePercentageBytesUsedPerSecond +=
- (*log)[label]["PercentageBytesBound"].asReal() ;
- frame_count++ ;
+ (*log)[label]["PercentageBytesBound"].asReal();
+ frame_count++;
if(cur_time - last_time >= 1.0f)
{
- sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAverageBytesUsedPerSecond /= frame_count ;
- sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAverageBytesUsedForLargeImagePerSecond /= frame_count ;
- sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAveragePercentageBytesUsedPerSecond /= frame_count ;
- sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mTime = last_time ;
+ sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAverageBytesUsedPerSecond /= frame_count;
+ sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAverageBytesUsedForLargeImagePerSecond /= frame_count;
+ sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAveragePercentageBytesUsedPerSecond /= frame_count;
+ sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mTime = last_time;
- frame_count = 0 ;
- last_time = cur_time ;
- sessionp->mInstantPerformanceListCounter++ ;
- sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAverageBytesUsedPerSecond = 0 ;
- sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAverageBytesUsedForLargeImagePerSecond = 0 ;
- sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAveragePercentageBytesUsedPerSecond = 0.f ;
- sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mTime = 0.f ;
+ frame_count = 0;
+ last_time = cur_time;
+ sessionp->mInstantPerformanceListCounter++;
+ sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAverageBytesUsedPerSecond = 0;
+ sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAverageBytesUsedForLargeImagePerSecond = 0;
+ sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAveragePercentageBytesUsedPerSecond = 0.f;
+ sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mTime = 0.f;
}
// Next label
- incrementCurrentCount() ;
+ incrementCurrentCount();
currentLabel = getCurrentLabelName();
- in_log = (*log).has(currentLabel) ;
+ in_log = (*log).has(currentLabel);
}
- sessionp->mTotalFetchingTime += total_fetching_time ;
- sessionp->mTotalGrayTime += total_gray_time ;
- sessionp->mTotalStablizingTime += total_stablizing_time ;
+ sessionp->mTotalFetchingTime += total_fetching_time;
+ sessionp->mTotalGrayTime += total_gray_time;
+ sessionp->mTotalStablizingTime += total_stablizing_time;
if(sessionp->mStartTimeLoadingSculpties < 0.f)
{
- sessionp->mStartTimeLoadingSculpties = start_fetching_sculpties_time ;
+ sessionp->mStartTimeLoadingSculpties = start_fetching_sculpties_time;
}
- sessionp->mTotalTimeLoadingSculpties += total_loading_sculpties_time ;
+ sessionp->mTotalTimeLoadingSculpties += total_loading_sculpties_time;
return sessionp;
}
LLTexturePipelineTester::LLTextureTestSession::LLTextureTestSession()
{
- reset() ;
+ reset();
}
LLTexturePipelineTester::LLTextureTestSession::~LLTextureTestSession()
{
}
void LLTexturePipelineTester::LLTextureTestSession::reset()
{
- mTotalFetchingTime = 0.0f ;
+ mTotalFetchingTime = 0.0f;
- mTotalGrayTime = 0.0f ;
- mTotalStablizingTime = 0.0f ;
+ mTotalGrayTime = 0.0f;
+ mTotalStablizingTime = 0.0f;
- mStartTimeLoadingSculpties = 0.0f ;
- mTotalTimeLoadingSculpties = 0.0f ;
+ mStartTimeLoadingSculpties = 0.0f;
+ mTotalTimeLoadingSculpties = 0.0f;
- mTotalBytesLoaded = 0 ;
- mTotalBytesLoadedFromCache = 0 ;
- mTotalBytesLoadedForLargeImage = 0 ;
- mTotalBytesLoadedForSculpties = 0 ;
+ mTotalBytesLoaded = 0;
+ mTotalBytesLoadedFromCache = 0;
+ mTotalBytesLoadedForLargeImage = 0;
+ mTotalBytesLoadedForSculpties = 0;
- mInstantPerformanceListCounter = 0 ;
+ mInstantPerformanceListCounter = 0;
}
//----------------------------------------------------------------------------------------------
//end of LLTexturePipelineTester
diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h
index 10101a4b9b..05912404e4 100755
--- a/indra/newview/llviewertexture.h
+++ b/indra/newview/llviewertexture.h
@@ -34,14 +34,15 @@
#include "llgltypes.h"
#include "llrender.h"
#include "llmetricperformancetester.h"
-#include "llface.h"
+#include "httpcommon.h"
#include <map>
#include <list>
-#define MIN_VIDEO_RAM_IN_MEGA_BYTES 32
-#define MAX_VIDEO_RAM_IN_MEGA_BYTES 512 // 512MB max for performance reasons.
+extern const S32Megabytes gMinVideoRam;
+extern const S32Megabytes gMaxVideoRam;
+class LLFace;
class LLImageGL ;
class LLImageRaw;
class LLViewerObject;
@@ -98,11 +99,11 @@ public:
DYNAMIC_TEXTURE,
FETCHED_TEXTURE,
LOD_TEXTURE,
+ ATLAS_TEXTURE,
INVALID_TEXTURE_TYPE
};
-
- typedef std::vector<LLFace*> ll_face_list_t;
+ typedef std::vector<class LLFace*> ll_face_list_t;
typedef std::vector<LLVOVolume*> ll_volume_list_t;
@@ -120,11 +121,13 @@ public:
LLViewerTexture(const U32 width, const U32 height, const U8 components, BOOL usemipmaps) ;
virtual S8 getType() const;
- virtual BOOL isMissingAsset()const ;
- virtual void dump(); // debug info to llinfos
+ virtual BOOL isMissingAsset() const ;
+ virtual void dump(); // debug info to LL_INFOS()
/*virtual*/ bool bindDefaultImage(const S32 stage = 0) ;
+ /*virtual*/ bool bindDebugImage(const S32 stage = 0) ;
/*virtual*/ void forceImmediateUpdate() ;
+ /*virtual*/ bool isActiveFetching();
/*virtual*/ const LLUUID& getID() const { return mID; }
void setBoostLevel(S32 level);
@@ -205,11 +208,11 @@ public:
static LLFrameTimer sEvaluationTimer;
static F32 sDesiredDiscardBias;
static F32 sDesiredDiscardScale;
- static S32 sBoundTextureMemoryInBytes;
- static S32 sTotalTextureMemoryInBytes;
- static S32 sMaxBoundTextureMemInMegaBytes;
- static S32 sMaxTotalTextureMemInMegaBytes;
- static S32 sMaxDesiredTextureMemInBytes ;
+ static S32Bytes sBoundTextureMemory;
+ static S32Bytes sTotalTextureMemory;
+ static S32Megabytes sMaxBoundTextureMemory;
+ static S32Megabytes sMaxTotalTextureMem;
+ static S32Bytes sMaxDesiredTextureMem ;
static S8 sCameraMovingDiscardBias;
static F32 sCameraMovingBias;
static S32 sMaxSculptRez ;
@@ -217,7 +220,7 @@ public:
static S32 sMaxSmallImageSize ;
static BOOL sFreezeImageScalingDown ;//do not scale down image res if set.
static F32 sCurrentTime ;
-
+
enum EDebugTexels
{
DEBUG_TEXELS_OFF,
@@ -244,6 +247,8 @@ enum FTType
FTT_LOCAL_FILE // fetch directly from a local file.
};
+const std::string& fttype_to_string(const FTType& fttype);
+
//
//textures are managed in gTextureList.
//raw image data is fetched from remote or local cache
@@ -340,8 +345,8 @@ public:
// more data.
/*virtual*/ void setKnownDrawSize(S32 width, S32 height);
- void setIsMissingAsset();
- /*virtual*/ BOOL isMissingAsset() const { return mIsMissingAsset; }
+ void setIsMissingAsset(BOOL is_missing = true);
+ /*virtual*/ BOOL isMissingAsset() const { return mIsMissingAsset; }
// returns dimensions of original image for local files (before power of two scaling)
// and returns 0 for all asset system images
@@ -383,6 +388,7 @@ public:
BOOL isCachedRawImageReady() const {return mCachedRawImageReady ;}
BOOL isRawImageValid()const { return mIsRawImageValid ; }
void forceToSaveRawImage(S32 desired_discard = 0, F32 kept_time = 0.f) ;
+ void forceToRefetchTexture(S32 desired_discard = 0, F32 kept_time = 60.f);
/*virtual*/ void setCachedRawImage(S32 discard_level, LLImageRaw* imageraw) ;
void destroySavedRawImage() ;
LLImageRaw* getSavedRawImage() ;
@@ -397,21 +403,30 @@ public:
void loadFromFastCache();
void setInFastCacheList(bool in_list) { mInFastCacheList = in_list; }
bool isInFastCacheList() { return mInFastCacheList; }
+
+ /*virtual*/bool isActiveFetching(); //is actively in fetching by the fetching pipeline.
+
protected:
/*virtual*/ void switchToCachedImage();
S32 getCurrentDiscardLevelForFetching() ;
private:
- void init(bool firstinit) ;
+ void init(bool firstinit) ;
void cleanup() ;
void saveRawImage() ;
void setCachedRawImage() ;
+ //for atlas
+ void resetFaceAtlas() ;
+ void invalidateAtlas(BOOL rebuild_geom) ;
+ BOOL insertToAtlas() ;
+
private:
BOOL mFullyLoaded;
BOOL mInDebug;
BOOL mInFastCacheList;
+ BOOL mForceCallbackFetch;
protected:
std::string mLocalFileName;
@@ -439,12 +454,14 @@ protected:
S8 mMinDesiredDiscardLevel; // The minimum discard level we'd like to have
S8 mNeedsAux; // We need to decode the auxiliary channels
+ S8 mHasAux; // We have aux channels
S8 mDecodingAux; // Are we decoding high components
S8 mIsRawImageValid;
S8 mHasFetcher; // We've made a fecth request
S8 mIsFetching; // Fetch request is active
- bool mCanUseHTTP ; //This texture can be fetched through http if true.
-
+ bool mCanUseHTTP; //This texture can be fetched through http if true.
+ LLCore::HttpStatus mLastHttpGetStatus; // Result of the most recently completed http request for this texture.
+
FTType mFTType; // What category of image is this - map tile, server bake, etc?
mutable S8 mIsMissingAsset; // True if we know that there is no image asset with this image id in the database.
@@ -687,18 +704,18 @@ private:
private:
BOOL mUsingDefaultTexture; //if set, some textures are still gray.
- U32 mTotalBytesUsed ; //total bytes of textures bound/used for the current frame.
- U32 mTotalBytesUsedForLargeImage ; //total bytes of textures bound/used for the current frame for images larger than 256 * 256.
- U32 mLastTotalBytesUsed ; //total bytes of textures bound/used for the previous frame.
- U32 mLastTotalBytesUsedForLargeImage ; //total bytes of textures bound/used for the previous frame for images larger than 256 * 256.
+ U32Bytes mTotalBytesUsed ; //total bytes of textures bound/used for the current frame.
+ U32Bytes mTotalBytesUsedForLargeImage ; //total bytes of textures bound/used for the current frame for images larger than 256 * 256.
+ U32Bytes mLastTotalBytesUsed ; //total bytes of textures bound/used for the previous frame.
+ U32Bytes mLastTotalBytesUsedForLargeImage ; //total bytes of textures bound/used for the previous frame for images larger than 256 * 256.
//
//data size
//
- U32 mTotalBytesLoaded ; //total bytes fetched by texture pipeline
- U32 mTotalBytesLoadedFromCache ; //total bytes fetched by texture pipeline from local cache
- U32 mTotalBytesLoadedForLargeImage ; //total bytes fetched by texture pipeline for images larger than 256 * 256.
- U32 mTotalBytesLoadedForSculpties ; //total bytes fetched by texture pipeline for sculpties
+ U32Bytes mTotalBytesLoaded ; //total bytes fetched by texture pipeline
+ U32Bytes mTotalBytesLoadedFromCache ; //total bytes fetched by texture pipeline from local cache
+ U32Bytes mTotalBytesLoadedForLargeImage ; //total bytes fetched by texture pipeline for images larger than 256 * 256.
+ U32Bytes mTotalBytesLoadedForSculpties ; //total bytes fetched by texture pipeline for sculpties
//
//time
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index 783d1f2202..b98726900f 100755
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -30,7 +30,6 @@
#include "llviewertexturelist.h"
-#include "imageids.h"
#include "llgl.h" // fot gathering stats from GL
#include "llimagegl.h"
#include "llimagebmp.h"
@@ -58,24 +57,19 @@
#include "pipeline.h"
#include "llappviewer.h"
#include "llxuiparser.h"
+#include "lltracerecording.h"
#include "llviewerdisplay.h"
-
+#include "llviewerwindow.h"
+#include "llprogressview.h"
////////////////////////////////////////////////////////////////////////////
void (*LLViewerTextureList::sUUIDCallback)(void **, const LLUUID&) = NULL;
-U32 LLViewerTextureList::sTextureBits = 0;
-U32 LLViewerTextureList::sTexturePackets = 0;
S32 LLViewerTextureList::sNumImages = 0;
-LLStat LLViewerTextureList::sNumImagesStat("Num Images", 32, TRUE);
-LLStat LLViewerTextureList::sNumRawImagesStat("Num Raw Images", 32, TRUE);
-LLStat LLViewerTextureList::sGLTexMemStat("GL Texture Mem", 32, TRUE);
-LLStat LLViewerTextureList::sGLBoundMemStat("GL Bound Mem", 32, TRUE);
-LLStat LLViewerTextureList::sRawMemStat("Raw Image Mem", 32, TRUE);
-LLStat LLViewerTextureList::sFormattedMemStat("Formatted Image Mem", 32, TRUE);
LLViewerTextureList gTextureList;
-static LLFastTimer::DeclareTimer FTM_PROCESS_IMAGES("Process Images");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_IMAGES("Process Images");
+
///////////////////////////////////////////////////////////////////////////////
@@ -93,11 +87,11 @@ void LLViewerTextureList::init()
mInitialized = TRUE ;
sNumImages = 0;
mUpdateStats = TRUE;
- mMaxResidentTexMemInMegaBytes = 0;
- mMaxTotalTextureMemInMegaBytes = 0 ;
+ mMaxResidentTexMemInMegaBytes = (U32Bytes)0;
+ mMaxTotalTextureMemInMegaBytes = (U32Bytes)0;
// Update how much texture RAM we're allowed to use.
- updateMaxResidentTexMem(0); // 0 = use current
+ updateMaxResidentTexMem(S32Megabytes(0)); // 0 = use current
doPreloadImages();
}
@@ -292,18 +286,18 @@ void LLViewerTextureList::shutdown()
void LLViewerTextureList::dump()
{
- llinfos << "LLViewerTextureList::dump()" << llendl;
+ LL_INFOS() << "LLViewerTextureList::dump()" << LL_ENDL;
for (image_priority_list_t::iterator it = mImageList.begin(); it != mImageList.end(); ++it)
{
LLViewerFetchedTexture* image = *it;
- llinfos << "priority " << image->getDecodePriority()
+ LL_INFOS() << "priority " << image->getDecodePriority()
<< " boost " << image->getBoostLevel()
<< " size " << image->getWidth() << "x" << image->getHeight()
<< " discard " << image->getDiscardLevel()
<< " desired " << image->getDesiredDiscardLevel()
<< " http://asset.siva.lindenlab.com/" << image->getID() << ".texture"
- << llendl;
+ << LL_ENDL;
}
}
@@ -327,7 +321,7 @@ void LLViewerTextureList::restoreGL()
///////////////////////////////////////////////////////////////////////////////
-LLViewerFetchedTexture* LLViewerTextureList::getImageFromFile(const std::string& filename,
+LLViewerFetchedTexture* LLViewerTextureList::getImageFromFile(const std::string& filename,
FTType f_type,
BOOL usemipmaps,
LLViewerTexture::EBoostLevel boost_priority,
@@ -344,7 +338,7 @@ LLViewerFetchedTexture* LLViewerTextureList::getImageFromFile(const std::string&
std::string full_path = gDirUtilp->findSkinnedFilename("textures", filename);
if (full_path.empty())
{
- llwarns << "Failed to find local image file: " << filename << llendl;
+ LL_WARNS() << "Failed to find local image file: " << filename << LL_ENDL;
return LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI);
}
@@ -379,13 +373,13 @@ LLViewerFetchedTexture* LLViewerTextureList::getImageFromUrl(const std::string&
}
LLPointer<LLViewerFetchedTexture> imagep = findImage(new_id);
-
+
if (!imagep.isNull())
{
LLViewerFetchedTexture *texture = imagep.get();
if (texture->getUrl().empty())
{
- llwarns << "Requested texture " << new_id << " already exists but does not have a URL" << llendl;
+ LL_WARNS() << "Requested texture " << new_id << " already exists but does not have a URL" << LL_ENDL;
}
else if (texture->getUrl() != url)
{
@@ -393,7 +387,7 @@ LLViewerFetchedTexture* LLViewerTextureList::getImageFromUrl(const std::string&
// e.g. could be two avatars wearing the same outfit.
LL_DEBUGS("Avatar") << "Requested texture " << new_id
<< " already exists with a different url, requested: " << url
- << " current: " << texture->getUrl() << llendl;
+ << " current: " << texture->getUrl() << LL_ENDL;
}
}
@@ -408,7 +402,7 @@ LLViewerFetchedTexture* LLViewerTextureList::getImageFromUrl(const std::string&
imagep = new LLViewerLODTexture(url, f_type, new_id, usemipmaps);
break ;
default:
- llerrs << "Invalid texture type " << texture_type << llendl ;
+ LL_ERRS() << "Invalid texture type " << texture_type << LL_ENDL ;
}
if (internal_format && primary_format)
@@ -435,7 +429,7 @@ LLViewerFetchedTexture* LLViewerTextureList::getImageFromUrl(const std::string&
}
-LLViewerFetchedTexture* LLViewerTextureList::getImage(const LLUUID &image_id,
+LLViewerFetchedTexture* LLViewerTextureList::getImage(const LLUUID &image_id,
FTType f_type,
BOOL usemipmaps,
LLViewerTexture::EBoostLevel boost_priority,
@@ -465,20 +459,20 @@ LLViewerFetchedTexture* LLViewerTextureList::getImage(const LLUUID &image_id,
if (request_from_host.isOk() &&
!texture->getTargetHost().isOk())
{
- llwarns << "Requested texture " << image_id << " already exists but does not have a host" << llendl;
+ LL_WARNS() << "Requested texture " << image_id << " already exists but does not have a host" << LL_ENDL;
}
else if (request_from_host.isOk() &&
texture->getTargetHost().isOk() &&
request_from_host != texture->getTargetHost())
{
- llwarns << "Requested texture " << image_id << " already exists with a different target host, requested: "
- << request_from_host << " current: " << texture->getTargetHost() << llendl;
+ LL_WARNS() << "Requested texture " << image_id << " already exists with a different target host, requested: "
+ << request_from_host << " current: " << texture->getTargetHost() << LL_ENDL;
}
if (f_type != FTT_DEFAULT && imagep->getFTType() != f_type)
{
- llwarns << "FTType mismatch: requested " << f_type << " image has " << imagep->getFTType() << llendl;
+ LL_WARNS() << "FTType mismatch: requested " << f_type << " image has " << imagep->getFTType() << LL_ENDL;
}
-
+
}
if (imagep.isNull())
{
@@ -491,7 +485,7 @@ LLViewerFetchedTexture* LLViewerTextureList::getImage(const LLUUID &image_id,
}
//when this function is called, there is no such texture in the gTextureList with image_id.
-LLViewerFetchedTexture* LLViewerTextureList::createImage(const LLUUID &image_id,
+LLViewerFetchedTexture* LLViewerTextureList::createImage(const LLUUID &image_id,
FTType f_type,
BOOL usemipmaps,
LLViewerTexture::EBoostLevel boost_priority,
@@ -512,7 +506,7 @@ LLViewerFetchedTexture* LLViewerTextureList::createImage(const LLUUID &image_id,
imagep = new LLViewerLODTexture(image_id, f_type, request_from_host, usemipmaps);
break ;
default:
- llerrs << "Invalid texture type " << texture_type << llendl ;
+ LL_ERRS() << "Invalid texture type " << texture_type << LL_ENDL ;
}
if (internal_format && primary_format)
@@ -562,13 +556,13 @@ void LLViewerTextureList::addImageToList(LLViewerFetchedTexture *image)
llassert(image);
if (image->isInImageList())
{ // Flag is already set?
- llwarns << "LLViewerTextureList::addImageToList - image " << image->getID() << " already in list" << llendl;
+ LL_WARNS() << "LLViewerTextureList::addImageToList - image " << image->getID() << " already in list" << LL_ENDL;
}
else
{
if((mImageList.insert(image)).second != true)
{
- llwarns << "Error happens when insert image " << image->getID() << " into mImageList!" << llendl ;
+ LL_WARNS() << "Error happens when insert image " << image->getID() << " into mImageList!" << LL_ENDL ;
}
image->setInImageList(TRUE) ;
}
@@ -586,36 +580,36 @@ void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image)
count = mImageList.erase(image) ;
if(count != 1)
{
- llinfos << "Image " << image->getID()
+ LL_INFOS() << "Image " << image->getID()
<< " had mInImageList set but mImageList.erase() returned " << count
- << llendl;
+ << LL_ENDL;
}
}
else
{ // Something is wrong, image is expected in list or callers should check first
- llinfos << "Calling removeImageFromList() for " << image->getID()
+ LL_INFOS() << "Calling removeImageFromList() for " << image->getID()
<< " but doesn't have mInImageList set"
<< " ref count is " << image->getNumRefs()
- << llendl;
+ << LL_ENDL;
uuid_map_t::iterator iter = mUUIDMap.find(image->getID());
if(iter == mUUIDMap.end())
{
- llinfos << "Image " << image->getID() << " is also not in mUUIDMap!" << llendl ;
+ LL_INFOS() << "Image " << image->getID() << " is also not in mUUIDMap!" << LL_ENDL ;
}
else if (iter->second != image)
{
- llinfos << "Image " << image->getID() << " was in mUUIDMap but with different pointer" << llendl ;
+ LL_INFOS() << "Image " << image->getID() << " was in mUUIDMap but with different pointer" << LL_ENDL ;
}
else
{
- llinfos << "Image " << image->getID() << " was in mUUIDMap with same pointer" << llendl ;
+ LL_INFOS() << "Image " << image->getID() << " was in mUUIDMap with same pointer" << LL_ENDL ;
}
count = mImageList.erase(image) ;
if(count != 0)
{ // it was in the list already?
- llwarns << "Image " << image->getID()
+ LL_WARNS() << "Image " << image->getID()
<< " had mInImageList false but mImageList.erase() returned " << count
- << llendl;
+ << LL_ENDL;
}
}
@@ -634,7 +628,7 @@ void LLViewerTextureList::addImage(LLViewerFetchedTexture *new_image)
LLViewerFetchedTexture *image = findImage(image_id);
if (image)
{
- llinfos << "Image with ID " << image_id << " already in list" << llendl;
+ LL_INFOS() << "Image with ID " << image_id << " already in list" << LL_ENDL;
}
sNumImages++;
@@ -669,16 +663,18 @@ void LLViewerTextureList::dirtyImage(LLViewerFetchedTexture *image)
}
////////////////////////////////////////////////////////////////////////////
-static LLFastTimer::DeclareTimer FTM_IMAGE_MARK_DIRTY("Dirty Images");
-static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_PRIORITIES("Prioritize");
-static LLFastTimer::DeclareTimer FTM_IMAGE_CALLBACKS("Callbacks");
-static LLFastTimer::DeclareTimer FTM_IMAGE_FETCH("Fetch");
-static LLFastTimer::DeclareTimer FTM_FAST_CACHE_IMAGE_FETCH("Fast Cache Fetch");
-static LLFastTimer::DeclareTimer FTM_IMAGE_CREATE("Create");
-static LLFastTimer::DeclareTimer FTM_IMAGE_STATS("Stats");
+static LLTrace::BlockTimerStatHandle FTM_IMAGE_MARK_DIRTY("Dirty Images");
+static LLTrace::BlockTimerStatHandle FTM_IMAGE_UPDATE_PRIORITIES("Prioritize");
+static LLTrace::BlockTimerStatHandle FTM_IMAGE_CALLBACKS("Callbacks");
+static LLTrace::BlockTimerStatHandle FTM_IMAGE_FETCH("Fetch");
+static LLTrace::BlockTimerStatHandle FTM_FAST_CACHE_IMAGE_FETCH("Fast Cache Fetch");
+static LLTrace::BlockTimerStatHandle FTM_IMAGE_CREATE("Create");
+static LLTrace::BlockTimerStatHandle FTM_IMAGE_STATS("Stats");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_TEXTURES("Update Textures");
void LLViewerTextureList::updateImages(F32 max_time)
{
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_TEXTURES);
static BOOL cleared = FALSE;
if(gTeleportDisplay)
{
@@ -692,48 +688,51 @@ void LLViewerTextureList::updateImages(F32 max_time)
}
cleared = FALSE;
- LLAppViewer::getTextureFetch()->setTextureBandwidth(LLViewerStats::getInstance()->mTextureKBitStat.getMeanPerSec());
+ LLAppViewer::getTextureFetch()->setTextureBandwidth(LLTrace::get_frame_recording().getPeriodMeanPerSec(LLStatViewer::TEXTURE_NETWORK_DATA_RECEIVED).value());
- LLViewerStats::getInstance()->mNumImagesStat.addValue(sNumImages);
- LLViewerStats::getInstance()->mNumRawImagesStat.addValue(LLImageRaw::sRawImageCount);
- LLViewerStats::getInstance()->mGLTexMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageGL::sGlobalTextureMemoryInBytes));
- LLViewerStats::getInstance()->mGLBoundMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageGL::sBoundTextureMemoryInBytes));
- LLViewerStats::getInstance()->mRawMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageRaw::sGlobalRawMemory));
- LLViewerStats::getInstance()->mFormattedMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageFormatted::sGlobalFormattedMemory));
+ {
+ using namespace LLStatViewer;
+ sample(NUM_IMAGES, sNumImages);
+ sample(NUM_RAW_IMAGES, LLImageRaw::sRawImageCount);
+ sample(GL_TEX_MEM, LLImageGL::sGlobalTextureMemory);
+ sample(GL_BOUND_MEM, LLImageGL::sBoundTextureMemory);
+ sample(RAW_MEM, F64Bytes(LLImageRaw::sGlobalRawMemory));
+ sample(FORMATTED_MEM, F64Bytes(LLImageFormatted::sGlobalFormattedMemory));
+ }
{
//loading from fast cache
- LLFastTimer t(FTM_FAST_CACHE_IMAGE_FETCH);
+ LL_RECORD_BLOCK_TIME(FTM_FAST_CACHE_IMAGE_FETCH);
max_time -= updateImagesLoadingFastCache(max_time);
}
{
- LLFastTimer t(FTM_IMAGE_UPDATE_PRIORITIES);
+ LL_RECORD_BLOCK_TIME(FTM_IMAGE_UPDATE_PRIORITIES);
updateImagesDecodePriorities();
}
F32 total_max_time = max_time;
{
- LLFastTimer t(FTM_IMAGE_FETCH);
+ LL_RECORD_BLOCK_TIME(FTM_IMAGE_FETCH);
max_time -= updateImagesFetchTextures(max_time);
}
{
- LLFastTimer t(FTM_IMAGE_CREATE);
+ LL_RECORD_BLOCK_TIME(FTM_IMAGE_CREATE);
max_time = llmax(max_time, total_max_time*.50f); // at least 50% of max_time
max_time -= updateImagesCreateTextures(max_time);
}
if (!mDirtyTextureList.empty())
{
- LLFastTimer t(FTM_IMAGE_MARK_DIRTY);
+ LL_RECORD_BLOCK_TIME(FTM_IMAGE_MARK_DIRTY);
gPipeline.dirtyPoolObjectTextures(mDirtyTextureList);
mDirtyTextureList.clear();
}
{
- LLFastTimer t(FTM_IMAGE_CALLBACKS);
+ LL_RECORD_BLOCK_TIME(FTM_IMAGE_CALLBACKS);
bool didone = false;
for (image_list_t::iterator iter = mCallbackList.begin();
iter != mCallbackList.end(); )
@@ -754,7 +753,7 @@ void LLViewerTextureList::updateImages(F32 max_time)
}
{
- LLFastTimer t(FTM_IMAGE_STATS);
+ LL_RECORD_BLOCK_TIME(FTM_IMAGE_STATS);
updateImagesUpdateStats();
}
}
@@ -780,8 +779,15 @@ void LLViewerTextureList::updateImagesDecodePriorities()
{
// Update the decode priority for N images each frame
{
+ F32 lazy_flush_timeout = 30.f; // stop decoding
+ F32 max_inactive_time = 20.f; // actually delete
+ S32 min_refs = 3; // 1 for mImageList, 1 for mUUIDMap, 1 for local reference
+
+ //reset imagep->getLastReferencedTimer() when screen is showing the progress view to avoid removing pre-fetched textures too soon.
+ bool reset_timer = gViewerWindow->getProgressView()->getVisible();
+
static const S32 MAX_PRIO_UPDATES = gSavedSettings.getS32("TextureFetchUpdatePriorities"); // default: 32
- const size_t max_update_count = llmin((S32) (MAX_PRIO_UPDATES*MAX_PRIO_UPDATES*gFrameIntervalSeconds) + 1, MAX_PRIO_UPDATES);
+ const size_t max_update_count = llmin((S32) (MAX_PRIO_UPDATES*MAX_PRIO_UPDATES*gFrameIntervalSeconds.value()) + 1, MAX_PRIO_UPDATES);
S32 update_counter = llmin(max_update_count, mUUIDMap.size());
uuid_map_t::iterator iter = mUUIDMap.upper_bound(mLastUpdateUUID);
while ((update_counter-- > 0) && !mUUIDMap.empty())
@@ -803,14 +809,14 @@ void LLViewerTextureList::updateImagesDecodePriorities()
//
// Flush formatted images using a lazy flush
//
- const F32 LAZY_FLUSH_TIMEOUT = 30.f; // stop decoding
- const F32 MAX_INACTIVE_TIME = 20.f; // actually delete
- S32 min_refs = 3; // 1 for mImageList, 1 for mUUIDMap, 1 for local reference
-
S32 num_refs = imagep->getNumRefs();
if (num_refs == min_refs)
{
- if (imagep->getLastReferencedTimer()->getElapsedTimeF32() > LAZY_FLUSH_TIMEOUT)
+ if(reset_timer)
+ {
+ imagep->getLastReferencedTimer()->reset();
+ }
+ else if (imagep->getLastReferencedTimer()->getElapsedTimeF32() > lazy_flush_timeout)
{
// Remove the unused image from the image list
deleteImage(imagep);
@@ -822,7 +828,7 @@ void LLViewerTextureList::updateImagesDecodePriorities()
{
if(imagep->hasSavedRawImage())
{
- if(imagep->getElapsedLastReferencedSavedRawImageTime() > MAX_INACTIVE_TIME)
+ if(imagep->getElapsedLastReferencedSavedRawImageTime() > max_inactive_time)
{
imagep->destroySavedRawImage() ;
}
@@ -839,7 +845,11 @@ void LLViewerTextureList::updateImagesDecodePriorities()
}
else if(imagep->isInactive())
{
- if (imagep->getLastReferencedTimer()->getElapsedTimeF32() > MAX_INACTIVE_TIME)
+ if(reset_timer)
+ {
+ imagep->getLastReferencedTimer()->reset();
+ }
+ else if (imagep->getLastReferencedTimer()->getElapsedTimeF32() > max_inactive_time)
{
imagep->setDeletionCandidate() ;
}
@@ -917,11 +927,11 @@ void LLViewerTextureList::setDebugFetching(LLViewerFetchedTexture* tex, S32 debu
if (type_from_host == LLImageBase::TYPE_NORMAL
&& type_from_boost == LLImageBase::TYPE_AVATAR_BAKE)
{
- llwarns << "TAT: get_image_type() type_from_host doesn't match type_from_boost"
+ LL_WARNS() << "TAT: get_image_type() type_from_host doesn't match type_from_boost"
<< " host " << target_host
<< " boost " << imagep->getBoostLevel()
<< " imageid " << imagep->getID()
- << llendl;
+ << LL_ENDL;
imagep->dump();
}
return type_from_host;
@@ -1015,11 +1025,11 @@ F32 LLViewerTextureList::updateImagesFetchTextures(F32 max_time)
static const F32 MIN_PRIORITY_THRESHOLD = gSavedSettings.getF32("TextureFetchUpdatePriorityThreshold"); // default: 0.0
static const bool SKIP_LOW_PRIO = gSavedSettings.getBOOL("TextureFetchUpdateSkipLowPriority"); // default: false
- size_t max_priority_count = llmin((S32) (MAX_HIGH_PRIO_COUNT*MAX_HIGH_PRIO_COUNT*gFrameIntervalSeconds)+1, MAX_HIGH_PRIO_COUNT);
+ size_t max_priority_count = llmin((S32) (MAX_HIGH_PRIO_COUNT*MAX_HIGH_PRIO_COUNT*gFrameIntervalSeconds.value())+1, MAX_HIGH_PRIO_COUNT);
max_priority_count = llmin(max_priority_count, mImageList.size());
size_t total_update_count = mUUIDMap.size();
- size_t max_update_count = llmin((S32) (MAX_UPDATE_COUNT*MAX_UPDATE_COUNT*gFrameIntervalSeconds)+1, MAX_UPDATE_COUNT);
+ size_t max_update_count = llmin((S32) (MAX_UPDATE_COUNT*MAX_UPDATE_COUNT*gFrameIntervalSeconds.value())+1, MAX_UPDATE_COUNT);
max_update_count = llmin(max_update_count, total_update_count);
// MAX_HIGH_PRIO_COUNT high priority entries
@@ -1195,13 +1205,13 @@ BOOL LLViewerTextureList::createUploadFile(const std::string& filename,
if (compressedImage.isNull())
{
image->setLastError("Couldn't convert the image to jpeg2000.");
- llinfos << "Couldn't convert to j2c, file : " << filename << llendl;
+ LL_INFOS() << "Couldn't convert to j2c, file : " << filename << LL_ENDL;
return FALSE;
}
if (!compressedImage->save(out_filename))
{
image->setLastError("Couldn't create the jpeg2000 image for upload.");
- llinfos << "Couldn't create output file : " << out_filename << llendl;
+ LL_INFOS() << "Couldn't create output file : " << out_filename << LL_ENDL;
return FALSE;
}
// Test to see if the encode and save worked
@@ -1209,7 +1219,7 @@ BOOL LLViewerTextureList::createUploadFile(const std::string& filename,
if (!integrity_test->loadAndValidate( out_filename ))
{
image->setLastError("The created jpeg2000 image is corrupt.");
- llinfos << "Image file : " << out_filename << " is corrupt" << llendl;
+ LL_INFOS() << "Image file : " << out_filename << " is corrupt" << LL_ENDL;
return FALSE;
}
return TRUE;
@@ -1234,13 +1244,13 @@ LLPointer<LLImageJ2C> LLViewerTextureList::convertToUploadFile(LLPointer<LLImage
// Read the blocks and precincts size settings
S32 block_size = gSavedSettings.getS32("Jpeg2000BlocksSize");
S32 precinct_size = gSavedSettings.getS32("Jpeg2000PrecinctsSize");
- llinfos << "Advanced JPEG2000 Compression: precinct = " << precinct_size << ", block = " << block_size << llendl;
+ LL_INFOS() << "Advanced JPEG2000 Compression: precinct = " << precinct_size << ", block = " << block_size << LL_ENDL;
compressedImage->initEncode(*raw_image, block_size, precinct_size, 0);
}
if (!compressedImage->encode(raw_image, 0.0f))
{
- llinfos << "convertToUploadFile : encode returns with error!!" << llendl;
+ LL_INFOS() << "convertToUploadFile : encode returns with error!!" << LL_ENDL;
// Clear up the pointer so we don't leak that one
compressedImage = NULL;
}
@@ -1252,28 +1262,28 @@ const S32 MIN_VIDEO_RAM = 32;
const S32 MAX_VIDEO_RAM = 512; // 512MB max for performance reasons.
// Returns min setting for TextureMemory (in MB)
-S32 LLViewerTextureList::getMinVideoRamSetting()
+S32Megabytes LLViewerTextureList::getMinVideoRamSetting()
{
- S32 system_ram = (S32)BYTES_TO_MEGA_BYTES(gSysMemory.getPhysicalMemoryClamped());
+ S32Megabytes system_ram = gSysMemory.getPhysicalMemoryClamped();
//min texture mem sets to 64M if total physical mem is more than 1.5GB
- return (system_ram > 1500) ? 64 : MIN_VIDEO_RAM_IN_MEGA_BYTES ;
+ return (system_ram > S32Megabytes(1500)) ? S32Megabytes(64) : gMinVideoRam ;
}
//static
// Returns max setting for TextureMemory (in MB)
-S32 LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended, float mem_multiplier)
+S32Megabytes LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended, float mem_multiplier)
{
- S32 max_texmem;
+ S32Megabytes max_texmem;
if (gGLManager.mVRAM != 0)
{
// Treat any card with < 32 MB (shudder) as having 32 MB
// - it's going to be swapping constantly regardless
- S32 max_vram = gGLManager.mVRAM;
+ S32Megabytes max_vram(gGLManager.mVRAM);
if(gGLManager.mIsATI)
{
//shrink the availabe vram for ATI cards because some of them do not handel texture swapping well.
- max_vram = (S32)(max_vram * 0.75f);
+ max_vram = max_vram * 0.75f;
}
max_vram = llmax(max_vram, getMinVideoRamSetting());
@@ -1285,48 +1295,48 @@ S32 LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended, float mem_m
{
if (!get_recommended)
{
- max_texmem = 512;
+ max_texmem = (S32Megabytes)512;
}
else if (gSavedSettings.getBOOL("NoHardwareProbe")) //did not do hardware detection at startup
{
- max_texmem = 512;
+ max_texmem = (S32Megabytes)512;
}
else
{
- max_texmem = 128;
+ max_texmem = (S32Megabytes)128;
}
- llwarns << "VRAM amount not detected, defaulting to " << max_texmem << " MB" << llendl;
+ LL_WARNS() << "VRAM amount not detected, defaulting to " << max_texmem << " MB" << LL_ENDL;
}
- S32 system_ram = (S32)BYTES_TO_MEGA_BYTES(gSysMemory.getPhysicalMemoryClamped()); // In MB
- //llinfos << "*** DETECTED " << system_ram << " MB of system memory." << llendl;
+ S32Megabytes system_ram = gSysMemory.getPhysicalMemoryClamped(); // In MB
+ //LL_INFOS() << "*** DETECTED " << system_ram << " MB of system memory." << LL_ENDL;
if (get_recommended)
- max_texmem = llmin(max_texmem, (S32)(system_ram/2));
+ max_texmem = llmin(max_texmem, system_ram/2);
else
- max_texmem = llmin(max_texmem, (S32)(system_ram));
-
+ max_texmem = llmin(max_texmem, system_ram);
+
// limit the texture memory to a multiple of the default if we've found some cards to behave poorly otherwise
- max_texmem = llmin(max_texmem, (S32) (mem_multiplier * (F32) max_texmem));
+ max_texmem = llmin(max_texmem, (S32Megabytes) (mem_multiplier * max_texmem));
- max_texmem = llclamp(max_texmem, getMinVideoRamSetting(), MAX_VIDEO_RAM_IN_MEGA_BYTES);
+ max_texmem = llclamp(max_texmem, getMinVideoRamSetting(), gMaxVideoRam);
return max_texmem;
}
-const S32 VIDEO_CARD_FRAMEBUFFER_MEM = 12; // MB
-const S32 MIN_MEM_FOR_NON_TEXTURE = 512 ; //MB
-void LLViewerTextureList::updateMaxResidentTexMem(S32 mem)
+const S32Megabytes VIDEO_CARD_FRAMEBUFFER_MEM(12);
+const S32Megabytes MIN_MEM_FOR_NON_TEXTURE(512);
+void LLViewerTextureList::updateMaxResidentTexMem(S32Megabytes mem)
{
// Initialize the image pipeline VRAM settings
- S32 cur_mem = gSavedSettings.getS32("TextureMemory");
+ S32Megabytes cur_mem(gSavedSettings.getS32("TextureMemory"));
F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple");
- S32 default_mem = getMaxVideoRamSetting(true, mem_multiplier); // recommended default
- if (mem == 0)
+ S32Megabytes default_mem = getMaxVideoRamSetting(true, mem_multiplier); // recommended default
+ if (mem == (S32Bytes)0)
{
- mem = cur_mem > 0 ? cur_mem : default_mem;
+ mem = cur_mem > (S32Bytes)0 ? cur_mem : default_mem;
}
- else if (mem < 0)
+ else if (mem < (S32Bytes)0)
{
mem = default_mem;
}
@@ -1334,38 +1344,38 @@ void LLViewerTextureList::updateMaxResidentTexMem(S32 mem)
mem = llclamp(mem, getMinVideoRamSetting(), getMaxVideoRamSetting(false, mem_multiplier));
if (mem != cur_mem)
{
- gSavedSettings.setS32("TextureMemory", mem);
+ gSavedSettings.setS32("TextureMemory", mem.value());
return; //listener will re-enter this function
}
// TODO: set available resident texture mem based on use by other subsystems
// currently max(12MB, VRAM/4) assumed...
- S32 vb_mem = mem;
- S32 fb_mem = llmax(VIDEO_CARD_FRAMEBUFFER_MEM, vb_mem/4);
+ S32Megabytes vb_mem = mem;
+ S32Megabytes fb_mem = llmax(VIDEO_CARD_FRAMEBUFFER_MEM, vb_mem/4);
mMaxResidentTexMemInMegaBytes = (vb_mem - fb_mem) ; //in MB
mMaxTotalTextureMemInMegaBytes = mMaxResidentTexMemInMegaBytes * 2;
- if (mMaxResidentTexMemInMegaBytes > 640)
+ if (mMaxResidentTexMemInMegaBytes > (S32Megabytes)640)
{
- mMaxTotalTextureMemInMegaBytes -= (mMaxResidentTexMemInMegaBytes >> 2);
+ mMaxTotalTextureMemInMegaBytes -= (mMaxResidentTexMemInMegaBytes / 4);
}
//system mem
- S32 system_ram = (S32)BYTES_TO_MEGA_BYTES(gSysMemory.getPhysicalMemoryClamped()); // In MB
+ S32Megabytes system_ram = gSysMemory.getPhysicalMemoryClamped();
//minimum memory reserved for non-texture use.
//if system_raw >= 1GB, reserve at least 512MB for non-texture use;
//otherwise reserve half of the system_ram for non-texture use.
- S32 min_non_texture_mem = llmin(system_ram / 2, MIN_MEM_FOR_NON_TEXTURE) ;
+ S32Megabytes min_non_texture_mem = llmin(system_ram / 2, MIN_MEM_FOR_NON_TEXTURE) ;
if (mMaxTotalTextureMemInMegaBytes > system_ram - min_non_texture_mem)
{
mMaxTotalTextureMemInMegaBytes = system_ram - min_non_texture_mem ;
}
- llinfos << "Total Video Memory set to: " << vb_mem << " MB" << llendl;
- llinfos << "Available Texture Memory set to: " << (vb_mem - fb_mem) << " MB" << llendl;
+ LL_INFOS() << "Total Video Memory set to: " << vb_mem << " MB" << LL_ENDL;
+ LL_INFOS() << "Available Texture Memory set to: " << (vb_mem - fb_mem) << " MB" << LL_ENDL;
}
///////////////////////////////////////////////////////////////////////////////
@@ -1375,7 +1385,7 @@ void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_d
{
static LLCachedControl<bool> log_texture_traffic(gSavedSettings,"LogTextureNetworkTraffic", false) ;
- LLFastTimer t(FTM_PROCESS_IMAGES);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_IMAGES);
// Receive image header, copy into image object and decompresses
// if this is a one-packet image.
@@ -1385,17 +1395,17 @@ void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_d
char ip_string[256];
u32_to_ip_string(msg->getSenderIP(),ip_string);
- U32 received_size ;
+ U32Bytes received_size ;
if (msg->getReceiveCompressedSize())
{
- received_size = msg->getReceiveCompressedSize() ;
+ received_size = (U32Bytes)msg->getReceiveCompressedSize() ;
}
else
{
- received_size = msg->getReceiveSize() ;
+ received_size = (U32Bytes)msg->getReceiveSize() ;
}
- gTextureList.sTextureBits += received_size * 8;
- gTextureList.sTexturePackets++;
+ add(LLStatViewer::TEXTURE_NETWORK_DATA_RECEIVED, received_size);
+ add(LLStatViewer::TEXTURE_PACKETS, 1);
U8 codec;
U16 packets;
@@ -1414,8 +1424,8 @@ void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_d
{
// msg->getSizeFast() is probably trying to tell us there
// was an error.
- llerrs << "image header chunk size was negative: "
- << data_size << llendl;
+ LL_ERRS() << "image header chunk size was negative: "
+ << data_size << LL_ENDL;
return;
}
@@ -1447,7 +1457,7 @@ void LLViewerTextureList::receiveImagePacket(LLMessageSystem *msg, void **user_d
{
static LLCachedControl<bool> log_texture_traffic(gSavedSettings,"LogTextureNetworkTraffic", false) ;
- LLFastTimer t(FTM_PROCESS_IMAGES);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_IMAGES);
// Receives image packet, copy into image object,
// checks if all packets received, decompresses if so.
@@ -1458,17 +1468,18 @@ void LLViewerTextureList::receiveImagePacket(LLMessageSystem *msg, void **user_d
char ip_string[256];
u32_to_ip_string(msg->getSenderIP(),ip_string);
- U32 received_size ;
+ U32Bytes received_size ;
if (msg->getReceiveCompressedSize())
{
- received_size = msg->getReceiveCompressedSize() ;
+ received_size = (U32Bytes)msg->getReceiveCompressedSize() ;
}
else
{
- received_size = msg->getReceiveSize() ;
+ received_size = (U32Bytes)msg->getReceiveSize() ;
}
- gTextureList.sTextureBits += received_size * 8;
- gTextureList.sTexturePackets++;
+
+ add(LLStatViewer::TEXTURE_NETWORK_DATA_RECEIVED, F64Bytes(received_size));
+ add(LLStatViewer::TEXTURE_PACKETS, 1);
//llprintline("Start decode, image header...");
msg->getUUIDFast(_PREHASH_ImageID, _PREHASH_ID, id);
@@ -1483,13 +1494,13 @@ void LLViewerTextureList::receiveImagePacket(LLMessageSystem *msg, void **user_d
{
// msg->getSizeFast() is probably trying to tell us there
// was an error.
- llerrs << "image data chunk size was negative: "
- << data_size << llendl;
+ LL_ERRS() << "image data chunk size was negative: "
+ << data_size << LL_ENDL;
return;
}
if (data_size > MTUBYTES)
{
- llerrs << "image data chunk too large: " << data_size << " bytes" << llendl;
+ LL_ERRS() << "image data chunk too large: " << data_size << " bytes" << LL_ENDL;
return;
}
U8 *data = new U8[data_size];
@@ -1519,35 +1530,18 @@ void LLViewerTextureList::receiveImagePacket(LLMessageSystem *msg, void **user_d
// static
void LLViewerTextureList::processImageNotInDatabase(LLMessageSystem *msg,void **user_data)
{
- LLFastTimer t(FTM_PROCESS_IMAGES);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_IMAGES);
LLUUID image_id;
msg->getUUIDFast(_PREHASH_ImageID, _PREHASH_ID, image_id);
LLViewerFetchedTexture* image = gTextureList.findImage( image_id );
if( image )
{
- llwarns << "not in db" << llendl;
+ LL_WARNS() << "not in db" << LL_ENDL;
image->setIsMissingAsset();
}
}
-///////////////////////////////////////////////////////////////////////////////
-
-//static
-const U32 SIXTEEN_MEG = 0x1000000;
-S32 LLViewerTextureList::calcMaxTextureRAM()
-{
- // Decide the maximum amount of RAM we should allow the user to allocate to texture cache
- LLMemoryInfo memory_info;
- U32 available_memory = memory_info.getPhysicalMemoryClamped();
-
- clamp_rescale((F32)available_memory,
- (F32)(SIXTEEN_MEG * 16),
- (F32)U32_MAX,
- (F32)(SIXTEEN_MEG * 4),
- (F32)(U32_MAX >> 1));
- return available_memory;
-}
///////////////////////////////////////////////////////////////////////////////
@@ -1594,28 +1588,31 @@ LLUIImagePtr LLUIImageList::getUIImage(const std::string& image_name, S32 priori
}
LLUIImagePtr LLUIImageList::loadUIImageByName(const std::string& name, const std::string& filename,
- BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect, LLViewerTexture::EBoostLevel boost_priority )
+ BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect, LLViewerTexture::EBoostLevel boost_priority,
+ LLUIImage::EScaleStyle scale_style)
{
if (boost_priority == LLGLTexture::BOOST_NONE)
{
boost_priority = LLGLTexture::BOOST_UI;
}
LLViewerFetchedTexture* imagep = LLViewerTextureManager::getFetchedTextureFromFile(filename, FTT_LOCAL_FILE, MIPMAP_NO, boost_priority);
- return loadUIImage(imagep, name, use_mips, scale_rect, clip_rect);
+ return loadUIImage(imagep, name, use_mips, scale_rect, clip_rect, scale_style);
}
LLUIImagePtr LLUIImageList::loadUIImageByID(const LLUUID& id,
- BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect, LLViewerTexture::EBoostLevel boost_priority)
+ BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect, LLViewerTexture::EBoostLevel boost_priority,
+ LLUIImage::EScaleStyle scale_style)
{
if (boost_priority == LLGLTexture::BOOST_NONE)
{
boost_priority = LLGLTexture::BOOST_UI;
}
LLViewerFetchedTexture* imagep = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, MIPMAP_NO, boost_priority);
- return loadUIImage(imagep, id.asString(), use_mips, scale_rect, clip_rect);
+ return loadUIImage(imagep, id.asString(), use_mips, scale_rect, clip_rect, scale_style);
}
-LLUIImagePtr LLUIImageList::loadUIImage(LLViewerFetchedTexture* imagep, const std::string& name, BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect)
+LLUIImagePtr LLUIImageList::loadUIImage(LLViewerFetchedTexture* imagep, const std::string& name, BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect,
+ LLUIImage::EScaleStyle scale_style)
{
if (!imagep) return NULL;
@@ -1628,6 +1625,8 @@ LLUIImagePtr LLUIImageList::loadUIImage(LLViewerFetchedTexture* imagep, const st
imagep->setNoDelete();
LLUIImagePtr new_imagep = new LLUIImage(name, imagep);
+ new_imagep->setScaleStyle(scale_style);
+
mUIImages.insert(std::make_pair(name, new_imagep));
mUITextureList.push_back(imagep);
@@ -1646,17 +1645,17 @@ LLUIImagePtr LLUIImageList::loadUIImage(LLViewerFetchedTexture* imagep, const st
return new_imagep;
}
-LLUIImagePtr LLUIImageList::preloadUIImage(const std::string& name, const std::string& filename, BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect)
+LLUIImagePtr LLUIImageList::preloadUIImage(const std::string& name, const std::string& filename, BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect, LLUIImage::EScaleStyle scale_style)
{
// look for existing image
uuid_ui_image_map_t::iterator found_it = mUIImages.find(name);
if (found_it != mUIImages.end())
{
// image already loaded!
- llerrs << "UI Image " << name << " already loaded." << llendl;
+ LL_ERRS() << "UI Image " << name << " already loaded." << LL_ENDL;
}
- return loadUIImageByName(name, filename, use_mips, scale_rect, clip_rect);
+ return loadUIImageByName(name, filename, use_mips, scale_rect, clip_rect, LLGLTexture::BOOST_UI, scale_style);
}
//static
@@ -1716,14 +1715,28 @@ void LLUIImageList::onUIImageLoaded( BOOL success, LLViewerFetchedTexture *src_v
}
}
+namespace LLInitParam
+{
+ template<>
+ struct TypeValues<LLUIImage::EScaleStyle> : public TypeValuesHelper<LLUIImage::EScaleStyle>
+ {
+ static void declareValues()
+ {
+ declare("scale_inner", LLUIImage::SCALE_INNER);
+ declare("scale_outer", LLUIImage::SCALE_OUTER);
+ }
+ };
+}
+
struct UIImageDeclaration : public LLInitParam::Block<UIImageDeclaration>
{
- Mandatory<std::string> name;
- Optional<std::string> file_name;
- Optional<bool> preload;
- Optional<LLRect> scale;
- Optional<LLRect> clip;
- Optional<bool> use_mips;
+ Mandatory<std::string> name;
+ Optional<std::string> file_name;
+ Optional<bool> preload;
+ Optional<LLRect> scale;
+ Optional<LLRect> clip;
+ Optional<bool> use_mips;
+ Optional<LLUIImage::EScaleStyle> scale_type;
UIImageDeclaration()
: name("name"),
@@ -1731,7 +1744,8 @@ struct UIImageDeclaration : public LLInitParam::Block<UIImageDeclaration>
preload("preload", false),
scale("scale"),
clip("clip"),
- use_mips("use_mips", false)
+ use_mips("use_mips", false),
+ scale_type("scale_type", LLUIImage::SCALE_INNER)
{}
};
@@ -1756,7 +1770,7 @@ bool LLUIImageList::initFromFile()
std::vector<std::string>::const_iterator pi(textures_paths.begin()), pend(textures_paths.end());
if (pi == pend)
{
- llwarns << "No textures.xml found in skins directories" << llendl;
+ LL_WARNS() << "No textures.xml found in skins directories" << LL_ENDL;
return false;
}
@@ -1764,12 +1778,12 @@ bool LLUIImageList::initFromFile()
LLXMLNodePtr root;
if (!LLXMLNode::parseFile(*pi, root, NULL))
{
- llwarns << "Unable to parse UI image list file " << *pi << llendl;
+ LL_WARNS() << "Unable to parse UI image list file " << *pi << LL_ENDL;
return false;
}
if (!root->hasAttribute("version"))
{
- llwarns << "No valid version number in UI image list file " << *pi << llendl;
+ LL_WARNS() << "No valid version number in UI image list file " << *pi << LL_ENDL;
return false;
}
@@ -1819,7 +1833,7 @@ bool LLUIImageList::initFromFile()
{
continue;
}
- preloadUIImage(image.name, file_name, image.use_mips, image.scale, image.clip);
+ preloadUIImage(image.name, file_name, image.use_mips, image.scale, image.clip, image.scale_type);
}
if (cur_pass == PASS_DECODE_NOW && !gSavedSettings.getBOOL("NoPreload"))
diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h
index 26dc6dcbe2..2f84d0947a 100755
--- a/indra/newview/llviewertexturelist.h
+++ b/indra/newview/llviewertexturelist.h
@@ -1,5 +1,5 @@
/**
- * @file llviewertexturelist.h
+ * @file llviewertexturelinumimagest.h
* @brief Object for managing the list of images within a region
*
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
@@ -30,11 +30,11 @@
#include "lluuid.h"
//#include "message.h"
#include "llgl.h"
-#include "llstat.h"
#include "llviewertexture.h"
#include "llui.h"
#include <list>
#include <set>
+#include "lluiimage.h"
const U32 LL_IMAGE_REZ_LOSSLESS_CUTOFF = 128;
@@ -71,7 +71,6 @@ public:
static BOOL createUploadFile(const std::string& filename, const std::string& out_filename, const U8 codec);
static LLPointer<LLImageJ2C> convertToUploadFile(LLPointer<LLImageRaw> raw_image);
static void processImageNotInDatabase( LLMessageSystem *msg, void **user_data );
- static S32 calcMaxTextureRAM();
static void receiveImageHeader(LLMessageSystem *msg, void **user_data);
static void receiveImagePacket(LLMessageSystem *msg, void **user_data);
@@ -101,11 +100,11 @@ public:
void setUpdateStats(BOOL b) { mUpdateStats = b; }
- S32 getMaxResidentTexMem() const { return mMaxResidentTexMemInMegaBytes; }
- S32 getMaxTotalTextureMem() const { return mMaxTotalTextureMemInMegaBytes;}
+ S32Megabytes getMaxResidentTexMem() const { return mMaxResidentTexMemInMegaBytes; }
+ S32Megabytes getMaxTotalTextureMem() const { return mMaxTotalTextureMemInMegaBytes;}
S32 getNumImages() { return mImageList.size(); }
- void updateMaxResidentTexMem(S32 mem);
+ void updateMaxResidentTexMem(S32Megabytes mem);
void doPreloadImages();
void doPrefetchImages();
@@ -113,8 +112,8 @@ public:
void clearFetchingRequests();
void setDebugFetching(LLViewerFetchedTexture* tex, S32 debug_level);
- static S32 getMinVideoRamSetting();
- static S32 getMaxVideoRamSetting(bool get_recommended, float mem_multiplier);
+ static S32Megabytes getMinVideoRamSetting();
+ static S32Megabytes getMaxVideoRamSetting(bool get_recommended, float mem_multiplier);
private:
void updateImagesDecodePriorities();
@@ -200,21 +199,10 @@ private:
BOOL mInitialized ;
BOOL mUpdateStats;
- S32 mMaxResidentTexMemInMegaBytes;
- S32 mMaxTotalTextureMemInMegaBytes;
+ S32Megabytes mMaxResidentTexMemInMegaBytes;
+ S32Megabytes mMaxTotalTextureMemInMegaBytes;
LLFrameTimer mForceDecodeTimer;
-public:
- static U32 sTextureBits;
- static U32 sTexturePackets;
-
- static LLStat sNumImagesStat;
- static LLStat sNumRawImagesStat;
- static LLStat sGLTexMemStat;
- static LLStat sGLBoundMemStat;
- static LLStat sRawMemStat;
- static LLStat sFormattedMemStat;
-
private:
static S32 sNumImages;
static void (*sUUIDCallback)(void**, const LLUUID &);
@@ -230,20 +218,22 @@ public:
bool initFromFile();
- LLPointer<LLUIImage> preloadUIImage(const std::string& name, const std::string& filename, BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect);
+ LLPointer<LLUIImage> preloadUIImage(const std::string& name, const std::string& filename, BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect, LLUIImage::EScaleStyle stype);
static void onUIImageLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata );
private:
LLPointer<LLUIImage> loadUIImageByName(const std::string& name, const std::string& filename,
BOOL use_mips = FALSE, const LLRect& scale_rect = LLRect::null,
const LLRect& clip_rect = LLRect::null,
- LLViewerTexture::EBoostLevel boost_priority = LLGLTexture::BOOST_UI);
+ LLViewerTexture::EBoostLevel boost_priority = LLGLTexture::BOOST_UI,
+ LLUIImage::EScaleStyle = LLUIImage::SCALE_INNER);
LLPointer<LLUIImage> loadUIImageByID(const LLUUID& id,
BOOL use_mips = FALSE, const LLRect& scale_rect = LLRect::null,
const LLRect& clip_rect = LLRect::null,
- LLViewerTexture::EBoostLevel boost_priority = LLGLTexture::BOOST_UI);
+ LLViewerTexture::EBoostLevel boost_priority = LLGLTexture::BOOST_UI,
+ LLUIImage::EScaleStyle = LLUIImage::SCALE_INNER);
- LLPointer<LLUIImage> loadUIImage(LLViewerFetchedTexture* imagep, const std::string& name, BOOL use_mips = FALSE, const LLRect& scale_rect = LLRect::null, const LLRect& clip_rect = LLRect::null);
+ LLPointer<LLUIImage> loadUIImage(LLViewerFetchedTexture* imagep, const std::string& name, BOOL use_mips = FALSE, const LLRect& scale_rect = LLRect::null, const LLRect& clip_rect = LLRect::null, LLUIImage::EScaleStyle = LLUIImage::SCALE_INNER);
struct LLUIImageLoadData
diff --git a/indra/newview/llviewerthrottle.cpp b/indra/newview/llviewerthrottle.cpp
index 5147272122..22de7e150b 100755
--- a/indra/newview/llviewerthrottle.cpp
+++ b/indra/newview/llviewerthrottle.cpp
@@ -48,8 +48,8 @@ const F32 MIN_FRACTIONAL = 0.2f;
const F32 MIN_BANDWIDTH = 50.f;
const F32 MAX_BANDWIDTH = 3000.f;
const F32 STEP_FRACTIONAL = 0.1f;
-const F32 TIGHTEN_THROTTLE_THRESHOLD = 3.0f; // packet loss % per s
-const F32 EASE_THROTTLE_THRESHOLD = 0.5f; // packet loss % per s
+const LLUnit<F32, LLUnits::Percent> TIGHTEN_THROTTLE_THRESHOLD(3.0f); // packet loss % per s
+const LLUnit<F32, LLUnits::Percent> EASE_THROTTLE_THRESHOLD(0.5f); // packet loss % per s
const F32 DYNAMIC_UPDATE_DURATION = 5.0f; // seconds
LLViewerThrottle gViewerThrottle;
@@ -146,7 +146,7 @@ LLViewerThrottleGroup LLViewerThrottleGroup::operator-(const LLViewerThrottleGro
void LLViewerThrottleGroup::sendToSim() const
{
- llinfos << "Sending throttle settings, total BW " << mThrottleTotal << llendl;
+ LL_INFOS() << "Sending throttle settings, total BW " << mThrottleTotal << LL_ENDL;
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_AgentThrottle);
@@ -304,7 +304,8 @@ void LLViewerThrottle::updateDynamicThrottle()
}
mUpdateTimer.reset();
- if (LLViewerStats::getInstance()->mPacketsLostPercentStat.getMean() > TIGHTEN_THROTTLE_THRESHOLD)
+ LLUnit<F32, LLUnits::Percent> mean_packets_lost = LLViewerStats::instance().getRecording().getMean(LLStatViewer::PACKETS_LOST_PERCENT);
+ if (mean_packets_lost > TIGHTEN_THROTTLE_THRESHOLD)
{
if (mThrottleFrac <= MIN_FRACTIONAL || mCurrentBandwidth / 1024.0f <= MIN_BANDWIDTH)
{
@@ -315,9 +316,9 @@ void LLViewerThrottle::updateDynamicThrottle()
mCurrentBandwidth = mMaxBandwidth * mThrottleFrac;
mCurrent = getThrottleGroup(mCurrentBandwidth / 1024.0f);
mCurrent.sendToSim();
- llinfos << "Tightening network throttle to " << mCurrentBandwidth << llendl;
+ LL_INFOS() << "Tightening network throttle to " << mCurrentBandwidth << LL_ENDL;
}
- else if (LLViewerStats::getInstance()->mPacketsLostPercentStat.getMean() <= EASE_THROTTLE_THRESHOLD)
+ else if (mean_packets_lost <= EASE_THROTTLE_THRESHOLD)
{
if (mThrottleFrac >= MAX_FRACTIONAL || mCurrentBandwidth / 1024.0f >= MAX_BANDWIDTH)
{
@@ -328,6 +329,6 @@ void LLViewerThrottle::updateDynamicThrottle()
mCurrentBandwidth = mMaxBandwidth * mThrottleFrac;
mCurrent = getThrottleGroup(mCurrentBandwidth/1024.0f);
mCurrent.sendToSim();
- llinfos << "Easing network throttle to " << mCurrentBandwidth << llendl;
+ LL_INFOS() << "Easing network throttle to " << mCurrentBandwidth << LL_ENDL;
}
}
diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp
index e8425dc76a..7de82a4710 100644..100755
--- a/indra/newview/llviewerwearable.cpp
+++ b/indra/newview/llviewerwearable.cpp
@@ -30,6 +30,7 @@
#include "llagentcamera.h"
#include "llagentwearables.h"
#include "llfloatersidepanelcontainer.h"
+#include "lllocaltextureobject.h"
#include "llnotificationsutil.h"
#include "llsidepanelappearance.h"
#include "lltextureentry.h"
@@ -72,14 +73,16 @@ private:
static std::string asset_id_to_filename(const LLUUID &asset_id);
LLViewerWearable::LLViewerWearable(const LLTransactionID& transaction_id) :
- LLWearable()
+ LLWearable(),
+ mVolatile(FALSE)
{
mTransactionID = transaction_id;
mAssetID = mTransactionID.makeAssetID(gAgent.getSecureSessionID());
}
LLViewerWearable::LLViewerWearable(const LLAssetID& asset_id) :
- LLWearable()
+ LLWearable(),
+ mVolatile(FALSE)
{
mAssetID = asset_id;
mTransactionID.setNull();
@@ -103,7 +106,7 @@ LLWearable::EImportResult LLViewerWearable::importStream( std::istream& input_st
{
// Shouldn't really log the asset id for security reasons, but
// we need it in this case.
- llwarns << "Bad Wearable asset header: " << mAssetID << llendl;
+ LL_WARNS() << "Bad Wearable asset header: " << mAssetID << LL_ENDL;
//gVFS->dumpMap();
return result;
}
@@ -143,7 +146,7 @@ BOOL LLViewerWearable::isOldVersion() const
if( LLWearable::sCurrentDefinitionVersion < mDefinitionVersion )
{
- llwarns << "Wearable asset has newer version (" << mDefinitionVersion << ") than XML (" << LLWearable::sCurrentDefinitionVersion << ")" << llendl;
+ LL_WARNS() << "Wearable asset has newer version (" << mDefinitionVersion << ") than XML (" << LLWearable::sCurrentDefinitionVersion << ")" << LL_ENDL;
llassert(0);
}
@@ -264,7 +267,7 @@ void LLViewerWearable::setParamsToDefaults()
{
if( (((LLViewerVisualParam*)param)->getWearableType() == mType ) && (param->isTweakable() ) )
{
- setVisualParamWeight(param->getID(),param->getDefaultWeight(), FALSE);
+ setVisualParamWeight(param->getID(),param->getDefaultWeight());
}
}
}
@@ -320,16 +323,6 @@ void LLViewerWearable::writeToAvatar(LLAvatarAppearance *avatarp)
if (!viewer_avatar->isValid()) return;
-#if 0
- // FIXME DRANO - kludgy way to avoid overwriting avatar state from wearables.
- // Ideally would avoid calling this func in the first place.
- if (viewer_avatar->isUsingServerBakes() &&
- !viewer_avatar->isUsingLocalAppearance())
- {
- return;
- }
-#endif
-
ESex old_sex = avatarp->getSex();
LLWearable::writeToAvatar(avatarp);
@@ -359,19 +352,14 @@ void LLViewerWearable::writeToAvatar(LLAvatarAppearance *avatarp)
ESex new_sex = avatarp->getSex();
if( old_sex != new_sex )
{
- viewer_avatar->updateSexDependentLayerSets( FALSE );
+ viewer_avatar->updateSexDependentLayerSets();
}
-
-// if( upload_bake )
-// {
-// gAgent.sendAgentSetAppearance();
-// }
}
// Updates the user's avatar's appearance, replacing this wearables' parameters and textures with default values.
// static
-void LLViewerWearable::removeFromAvatar( LLWearableType::EType type, BOOL upload_bake )
+void LLViewerWearable::removeFromAvatar( LLWearableType::EType type)
{
if (!isAgentAvatarValid()) return;
@@ -390,7 +378,7 @@ void LLViewerWearable::removeFromAvatar( LLWearableType::EType type, BOOL upload
if( (((LLViewerVisualParam*)param)->getWearableType() == type) && (param->isTweakable() ) )
{
S32 param_id = param->getID();
- gAgentAvatarp->setVisualParamWeight( param_id, param->getDefaultWeight(), upload_bake );
+ gAgentAvatarp->setVisualParamWeight( param_id, param->getDefaultWeight());
}
}
@@ -400,12 +388,7 @@ void LLViewerWearable::removeFromAvatar( LLWearableType::EType type, BOOL upload
}
gAgentAvatarp->updateVisualParams();
- gAgentAvatarp->wearableUpdated(type, FALSE);
-
-// if( upload_bake )
-// {
-// gAgent.sendAgentSetAppearance();
-// }
+ gAgentAvatarp->wearableUpdated(type);
}
// Does not copy mAssetID.
@@ -478,13 +461,6 @@ void LLViewerWearable::setItemID(const LLUUID& item_id)
void LLViewerWearable::revertValues()
{
-#if 0
- // DRANO avoid overwrite when not in local appearance
- if (isAgentAvatarValid() && gAgentAvatarp->isUsingServerBakes() && !gAgentAvatarp->isUsingLocalAppearance())
- {
- return;
- }
-#endif
LLWearable::revertValues();
@@ -522,13 +498,6 @@ void LLViewerWearable::refreshName()
}
}
-// virtual
-void LLViewerWearable::addToBakedTextureHash(LLMD5& hash) const
-{
- LLUUID asset_id = getAssetID();
- hash.update((const unsigned char*)asset_id.mData, UUID_BYTES);
-}
-
struct LLWearableSaveData
{
LLWearableType::EType mType;
@@ -536,8 +505,8 @@ struct LLWearableSaveData
void LLViewerWearable::saveNewAsset() const
{
-// llinfos << "LLViewerWearable::saveNewAsset() type: " << getTypeName() << llendl;
- //llinfos << *this << llendl;
+// LL_INFOS() << "LLViewerWearable::saveNewAsset() type: " << getTypeName() << LL_ENDL;
+ //LL_INFOS() << *this << LL_ENDL;
const std::string filename = asset_id_to_filename(mAssetID);
LLFILE* fp = LLFile::fopen(filename, "wb"); /* Flawfinder: ignore */
@@ -554,7 +523,7 @@ void LLViewerWearable::saveNewAsset() const
if(!successful_save)
{
std::string buffer = llformat("Unable to save '%s' to wearable file.", mName.c_str());
- llwarns << buffer << llendl;
+ LL_WARNS() << buffer << LL_ENDL;
LLSD args;
args["NAME"] = mName;
@@ -569,7 +538,7 @@ void LLViewerWearable::saveNewAsset() const
std::string url = gAgent.getRegion()->getCapability("NewAgentInventory");
if (!url.empty())
{
- llinfos << "Update Agent Inventory via capability" << llendl;
+ LL_INFOS() << "Update Agent Inventory via capability" << LL_ENDL;
LLSD body;
body["folder_id"] = gInventory.findCategoryUUIDForType(LLFolderType::assetToFolderType(getAssetType()));
body["asset_type"] = LLAssetType::lookup(getAssetType());
@@ -598,12 +567,12 @@ void LLViewerWearable::onSaveNewAssetComplete(const LLUUID& new_asset_id, void*
if(0 == status)
{
// Success
- llinfos << "Saved wearable " << type_name << llendl;
+ LL_INFOS() << "Saved wearable " << type_name << LL_ENDL;
}
else
{
std::string buffer = llformat("Unable to save %s to central asset store.", type_name.c_str());
- llwarns << buffer << " Status: " << status << llendl;
+ LL_WARNS() << buffer << " Status: " << status << LL_ENDL;
LLSD args;
args["NAME"] = type_name;
LLNotificationsUtil::add("CannotSaveToAssetStore", args);
diff --git a/indra/newview/llviewerwearable.h b/indra/newview/llviewerwearable.h
index 65566f23a5..62cd5e21ad 100644..100755
--- a/indra/newview/llviewerwearable.h
+++ b/indra/newview/llviewerwearable.h
@@ -29,6 +29,7 @@
#include "llwearable.h"
#include "llavatarappearancedefines.h"
+#include "llextendedstatus.h"
class LLVOAvatar;
@@ -61,13 +62,15 @@ public:
BOOL isOldVersion() const;
/*virtual*/ void writeToAvatar(LLAvatarAppearance *avatarp);
- void removeFromAvatar( BOOL upload_bake ) { LLViewerWearable::removeFromAvatar( mType, upload_bake ); }
- static void removeFromAvatar( LLWearableType::EType type, BOOL upload_bake );
+ void removeFromAvatar() { LLViewerWearable::removeFromAvatar( mType); }
+ static void removeFromAvatar( LLWearableType::EType type);
/*virtual*/ EImportResult importStream( std::istream& input_stream, LLAvatarAppearance* avatarp );
void setParamsToDefaults();
void setTexturesToDefaults();
+ void setVolatile(BOOL is_volatile) { mVolatile = is_volatile; } // TRUE when doing preview renders, some updates will be suppressed.
+ BOOL getVolatile() { return mVolatile; }
/*virtual*/ LLUUID getDefaultTextureImageID(LLAvatarAppearanceDefines::ETextureIndex index) const;
@@ -88,14 +91,14 @@ public:
// the wearable was worn. make sure the name of the wearable object matches the LLViewerInventoryItem,
// not the wearable asset itself.
void refreshName();
-
- // Update the baked texture hash.
- /*virtual*/void addToBakedTextureHash(LLMD5& hash) const;
+ /*virtual*/void addToBakedTextureHash(LLMD5& hash) const {}
protected:
LLAssetID mAssetID;
LLTransactionID mTransactionID;
+ BOOL mVolatile; // True when rendering preview images. Can suppress some updates.
+
LLUUID mItemID; // ID of the inventory item in the agent's inventory
};
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 3193a2955b..9dcd0b81e0 100755
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -40,6 +40,7 @@
#include "llagentcamera.h"
#include "llcommunicationchannel.h"
#include "llfloaterreg.h"
+#include "llhudicon.h"
#include "llmeshrepository.h"
#include "llnotificationhandler.h"
#include "llpanellogin.h"
@@ -75,13 +76,11 @@
#include "message.h"
#include "object_flags.h"
#include "lltimer.h"
-#include "timing.h"
#include "llviewermenu.h"
#include "lltooltip.h"
#include "llmediaentry.h"
#include "llurldispatcher.h"
#include "raytrace.h"
-#include "llstat.h"
// newview includes
#include "llagent.h"
@@ -218,6 +217,7 @@
// Globals
//
void render_ui(F32 zoom_factor = 1.f, int subfield = 0);
+void swap();
extern BOOL gDebugClicks;
extern BOOL gDisplaySwapBuffers;
@@ -238,7 +238,7 @@ LLVector4a gDebugRaycastParticleIntersection;
LLVector2 gDebugRaycastTexCoord;
LLVector4a gDebugRaycastNormal;
LLVector4a gDebugRaycastTangent;
-S32 gDebugRaycastFaceHit;
+S32 gDebugRaycastFaceHit;
LLVector4a gDebugRaycastStart;
LLVector4a gDebugRaycastEnd;
@@ -258,7 +258,10 @@ std::string LLViewerWindow::sSnapshotDir;
std::string LLViewerWindow::sMovieBaseName;
-class RecordToChatConsole : public LLError::Recorder, public LLSingleton<RecordToChatConsole>
+LLTrace::SampleStatHandle<> LLViewerWindow::sMouseVelocityStat("Mouse Velocity");
+
+
+class RecordToChatConsoleRecorder : public LLError::Recorder
{
public:
virtual void recordMessage(LLError::ELevel level,
@@ -282,11 +285,29 @@ public:
}
};
+class RecordToChatConsole : public LLSingleton<RecordToChatConsole>
+{
+public:
+ RecordToChatConsole()
+ : LLSingleton<RecordToChatConsole>(),
+ mRecorder(new RecordToChatConsoleRecorder())
+ {
+ }
+
+ void startRecorder() { LLError::addRecorder(mRecorder); }
+ void stopRecorder() { LLError::removeRecorder(mRecorder); }
+
+private:
+ LLError::RecorderPtr mRecorder;
+};
+
////////////////////////////////////////////////////////////////////////////
//
// LLDebugText
//
+static LLTrace::BlockTimerStatHandle FTM_DISPLAY_DEBUG_TEXT("Display Debug Text");
+
class LLDebugText
{
private:
@@ -438,10 +459,7 @@ public:
}
if (gDisplayWindInfo)
{
- if (gAudiop)
- {
- audio_text= llformat("Audio for wind: %d", gAudiop->isWindEnabled());
- }
+ audio_text = llformat("Audio for wind: %d", gAudiop ? gAudiop->isWindEnabled() : -1);
addText(xpos, ypos, audio_text); ypos += y_inc;
}
if (gDisplayFOV)
@@ -463,6 +481,8 @@ public:
if (gSavedSettings.getBOOL("DebugShowRenderInfo"))
{
+ LLTrace::Recording& last_frame_recording = LLTrace::get_frame_recording().getLastRecording();
+
if (gPipeline.getUseVertexShaders() == 0)
{
addText(xpos, ypos, "Shaders Disabled");
@@ -568,7 +588,7 @@ public:
addText(xpos, ypos, llformat("%d Unique Textures", LLImageGL::sUniqueCount));
ypos += y_inc;
- addText(xpos, ypos, llformat("%d Render Calls", gPipeline.mBatchCount));
+ addText(xpos, ypos, llformat("%d Render Calls", last_frame_recording.getSampleCount(LLPipeline::sStatBatchSize)));
ypos += y_inc;
addText(xpos, ypos, llformat("%d/%d Objects Active", gObjectList.getNumActiveObjects(), gObjectList.getNumObjects()));
@@ -583,14 +603,9 @@ public:
gPipeline.mTextureMatrixOps = 0;
gPipeline.mMatrixOpCount = 0;
- if (gPipeline.mBatchCount > 0)
+ if (last_frame_recording.getSampleCount(LLPipeline::sStatBatchSize) > 0)
{
- addText(xpos, ypos, llformat("Batch min/max/mean: %d/%d/%d", gPipeline.mMinBatchSize, gPipeline.mMaxBatchSize,
- gPipeline.mTrianglesDrawn/gPipeline.mBatchCount));
-
- gPipeline.mMinBatchSize = gPipeline.mMaxBatchSize;
- gPipeline.mMaxBatchSize = 0;
- gPipeline.mBatchCount = 0;
+ addText(xpos, ypos, llformat("Batch min/max/mean: %d/%d/%d", last_frame_recording.getMin(LLPipeline::sStatBatchSize), last_frame_recording.getMax(LLPipeline::sStatBatchSize), last_frame_recording.getMean(LLPipeline::sStatBatchSize)));
}
ypos += y_inc;
@@ -602,9 +617,9 @@ public:
ypos += y_inc;
- if (!LLSpatialGroup::sPendingQueries.empty())
+ if (!LLOcclusionCullingGroup::sPendingQueries.empty())
{
- addText(xpos,ypos, llformat("%d Queries pending", LLSpatialGroup::sPendingQueries.size()));
+ addText(xpos,ypos, llformat("%d Queries pending", LLOcclusionCullingGroup::sPendingQueries.size()));
ypos += y_inc;
}
@@ -778,9 +793,9 @@ public:
U32 old_y = ypos ;
for(S32 i = LLViewerTexture::BOOST_NONE; i < LLViewerTexture::MAX_GL_IMAGE_CATEGORY; i++)
{
- if(gTotalTextureBytesPerBoostLevel[i] > 0)
+ if(gTotalTextureBytesPerBoostLevel[i] > (S32Bytes)0)
{
- addText(xpos, ypos, llformat("Boost_Level %d: %.3f MB", i, (F32)gTotalTextureBytesPerBoostLevel[i] / (1024 * 1024)));
+ addText(xpos, ypos, llformat("Boost_Level %d: %.3f MB", i, F32Megabytes(gTotalTextureBytesPerBoostLevel[i]).value()));
ypos += y_inc;
}
}
@@ -839,6 +854,7 @@ public:
void draw()
{
+ LL_RECORD_BLOCK_TIME(FTM_DISPLAY_DEBUG_TEXT);
for (line_list_t::iterator iter = mLineList.begin();
iter != mLineList.end(); ++iter)
{
@@ -928,7 +944,7 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK
if (gDebugClicks)
{
- llinfos << "ViewerWindow " << buttonname << " mouse " << buttonstatestr << " at " << x << "," << y << llendl;
+ LL_INFOS() << "ViewerWindow " << buttonname << " mouse " << buttonstatestr << " at " << x << "," << y << LL_ENDL;
}
// Make sure we get a corresponding mouseup event, even if the mouse leaves the window
@@ -954,13 +970,13 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK
mouse_captor->screenPointToLocal( x, y, &local_x, &local_y );
if (LLView::sDebugMouseHandling)
{
- llinfos << buttonname << " Mouse " << buttonstatestr << " handled by captor " << mouse_captor->getName() << llendl;
+ LL_INFOS() << buttonname << " Mouse " << buttonstatestr << " handled by captor " << mouse_captor->getName() << LL_ENDL;
}
BOOL r = mouse_captor->handleAnyMouseClick(local_x, local_y, mask, clicktype, down);
if (r) {
- lldebugs << "LLViewerWindow::handleAnyMouseClick viewer with mousecaptor calling updatemouseeventinfo - local_x|global x "<< local_x << " " << x << "local/global y " << local_y << " " << y << llendl;
+ LL_DEBUGS() << "LLViewerWindow::handleAnyMouseClick viewer with mousecaptor calling updatemouseeventinfo - local_x|global x "<< local_x << " " << x << "local/global y " << local_y << " " << y << LL_ENDL;
LLViewerEventRecorder::instance().setMouseGlobalCoords(x,y);
LLViewerEventRecorder::instance().logMouseEvent(std::string(buttonstatestr),std::string(buttonname));
@@ -980,7 +996,7 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK
if (r)
{
- lldebugs << "LLViewerWindow::handleAnyMouseClick calling updatemouseeventinfo - global x "<< " " << x << "global y " << y << "buttonstate: " << buttonstatestr << " buttonname " << buttonname << llendl;
+ LL_DEBUGS() << "LLViewerWindow::handleAnyMouseClick calling updatemouseeventinfo - global x "<< " " << x << "global y " << y << "buttonstate: " << buttonstatestr << " buttonname " << buttonname << LL_ENDL;
LLViewerEventRecorder::instance().setMouseGlobalCoords(x,y);
@@ -996,12 +1012,12 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK
if (LLView::sDebugMouseHandling)
{
- llinfos << buttonname << " Mouse " << buttonstatestr << " " << LLViewerEventRecorder::instance().get_xui() << llendl;
+ LL_INFOS() << buttonname << " Mouse " << buttonstatestr << " " << LLViewerEventRecorder::instance().get_xui() << LL_ENDL;
}
return TRUE;
} else if (LLView::sDebugMouseHandling)
{
- llinfos << buttonname << " Mouse " << buttonstatestr << " not handled by view" << llendl;
+ LL_INFOS() << buttonname << " Mouse " << buttonstatestr << " not handled by view" << LL_ENDL;
}
}
@@ -1059,7 +1075,7 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK
// *HACK: this should be rolled into the composite tool logic, not
// hardcoded at the top level.
- if (CAMERA_MODE_CUSTOMIZE_AVATAR != gAgentCamera.getCameraMode() && LLToolMgr::getInstance()->getCurrentTool() != LLToolPie::getInstance())
+ if (CAMERA_MODE_CUSTOMIZE_AVATAR != gAgentCamera.getCameraMode() && LLToolMgr::getInstance()->getCurrentTool() != LLToolPie::getInstance() && gAgent.isInitialized())
{
// If the current tool didn't process the click, we should show
// the pie menu. This can be done by passing the event to the pie
@@ -1127,7 +1143,7 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi
S32 object_face = pick_info.mObjectFace;
std::string url = data;
- lldebugs << "Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << llendl;
+ LL_DEBUGS() << "Object: picked at " << pos.mX << ", " << pos.mY << " - face = " << object_face << " - URL = " << url << LL_ENDL;
LLVOVolume *obj = dynamic_cast<LLVOVolume*>(static_cast<LLViewerObject*>(pick_info.getObject()));
@@ -1376,6 +1392,13 @@ BOOL LLViewerWindow::handleTranslatedKeyUp(KEY key, MASK mask)
// Let the voice chat code check for its PTT key. Note that this never affects event processing.
LLVoiceClient::getInstance()->keyUp(key, mask);
+ // Let the inspect tool code check for ALT key to set LLToolSelectRect active instead LLToolCamera
+ LLToolCompInspect * tool_inspectp = LLToolCompInspect::getInstance();
+ if (LLToolMgr::getInstance()->getCurrentTool() == tool_inspectp)
+ {
+ tool_inspectp->keyUp(key, mask);
+ }
+
return FALSE;
}
@@ -1460,10 +1483,11 @@ BOOL LLViewerWindow::handlePaint(LLWindow *window, S32 x, S32 y, S32 width, S
FillRect(hdc, &wnd_rect, CreateSolidBrush(RGB(255, 255, 255)));
std::string temp_str;
+ LLTrace::Recording& recording = LLViewerStats::instance().getRecording();
temp_str = llformat( "FPS %3.1f Phy FPS %2.1f Time Dil %1.3f", /* Flawfinder: ignore */
- LLViewerStats::getInstance()->mFPSStat.getMeanPerSec(),
- LLViewerStats::getInstance()->mSimPhysicsFPS.getPrev(0),
- LLViewerStats::getInstance()->mSimTimeDilation.getPrev(0));
+ recording.getPerSec(LLStatViewer::FPS), //mFPSStat.getMeanPerSec(),
+ recording.getLastValue(LLStatViewer::SIM_PHYSICS_FPS),
+ recording.getLastValue(LLStatViewer::SIM_TIME_DILATION));
S32 len = temp_str.length();
TextOutA(hdc, 0, 0, temp_str.c_str(), len);
@@ -1598,8 +1622,7 @@ LLViewerWindow::LLViewerWindow(const Params& p)
mResDirty(false),
mStatesDirty(false),
mCurrResolutionIndex(0),
- mProgressView(NULL),
- mMouseVelocityStat(new LLStat("Mouse Velocity"))
+ mProgressView(NULL)
{
// gKeyboard is still NULL, so it doesn't do LLWindowListener any good to
// pass its value right now. Instead, pass it a nullary function that
@@ -1617,7 +1640,7 @@ LLViewerWindow::LLViewerWindow(const Params& p)
LLNotifications::instance().setIgnoreAllNotifications(ignore);
if (ignore)
{
- llinfos << "NOTE: ALL NOTIFICATIONS THAT OCCUR WILL GET ADDED TO IGNORE LIST FOR LATER RUNS." << llendl;
+ LL_INFOS() << "NOTE: ALL NOTIFICATIONS THAT OCCUR WILL GET ADDED TO IGNORE LIST FOR LATER RUNS." << LL_ENDL;
}
// Default to application directory.
@@ -1655,14 +1678,14 @@ LLViewerWindow::LLViewerWindow(const Params& p)
{
LLSplashScreen::update(LLTrans::getString("StartupRequireDriverUpdate"));
- LL_WARNS("Window") << "Failed to create window, to be shutting Down, be sure your graphics driver is updated." << llendl ;
+ LL_WARNS("Window") << "Failed to create window, to be shutting Down, be sure your graphics driver is updated." << LL_ENDL ;
ms_sleep(5000) ; //wait for 5 seconds.
LLSplashScreen::update(LLTrans::getString("ShuttingDown"));
#if LL_LINUX || LL_SOLARIS
- llwarns << "Unable to create window, be sure screen is set at 32-bit color and your graphics driver is configured correctly. See README-linux.txt or README-solaris.txt for further information."
- << llendl;
+ LL_WARNS() << "Unable to create window, be sure screen is set at 32-bit color and your graphics driver is configured correctly. See README-linux.txt or README-solaris.txt for further information."
+ << LL_ENDL;
#else
LL_WARNS("Window") << "Unable to create window, be sure screen is set at 32-bit color in Control Panels->Display->Settings"
<< LL_ENDL;
@@ -1682,7 +1705,7 @@ LLViewerWindow::LLViewerWindow(const Params& p)
if(p.fullscreen && ( scr.mX!=p.width || scr.mY!=p.height))
{
- llwarns << "Fullscreen has forced us in to a different resolution now using "<<scr.mX<<" x "<<scr.mY<<llendl;
+ LL_WARNS() << "Fullscreen has forced us in to a different resolution now using "<<scr.mX<<" x "<<scr.mY<<LL_ENDL;
gSavedSettings.setS32("FullScreenWidth",scr.mX);
gSavedSettings.setS32("FullScreenHeight",scr.mY);
}
@@ -1886,11 +1909,11 @@ void LLViewerWindow::initBase()
// optionally forward warnings to chat console/chat floater
// for qa runs and dev builds
#if !LL_RELEASE_FOR_DOWNLOAD
- LLError::addRecorder(RecordToChatConsole::getInstance());
+ RecordToChatConsole::getInstance()->startRecorder();
#else
if(gSavedSettings.getBOOL("QAMode"))
{
- LLError::addRecorder(RecordToChatConsole::getInstance());
+ RecordToChatConsole::getInstance()->startRecorder();
}
#endif
@@ -1907,9 +1930,7 @@ void LLViewerWindow::initBase()
setProgressCancelButtonVisible(FALSE);
gMenuHolder = getRootView()->getChild<LLViewerMenuHolderGL>("Menu Holder");
-
LLMenuGL::sMenuContainer = gMenuHolder;
-
}
void LLViewerWindow::initWorldUI()
@@ -1948,7 +1969,7 @@ void LLViewerWindow::initWorldUI()
// Force gFloaterTools to initialize
LLFloaterReg::getInstance("build");
- LLFloaterReg::hideInstance("build");
+
// Status bar
LLPanel* status_bar_container = getRootView()->getChild<LLPanel>("status_bar_container");
@@ -2023,7 +2044,7 @@ void LLViewerWindow::initWorldUI()
destinations->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL"));
std::string url = gSavedSettings.getString("DestinationGuideURL");
url = LLWeb::expandURLSubstitutions(url, LLSD());
- destinations->navigateTo(url, "text/html");
+ destinations->navigateTo(url, HTTP_CONTENT_TEXT_HTML);
}
LLMediaCtrl* avatar_picker = LLFloaterReg::getInstance("avatar")->findChild<LLMediaCtrl>("avatar_picker_contents");
if (avatar_picker)
@@ -2031,7 +2052,7 @@ void LLViewerWindow::initWorldUI()
avatar_picker->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL"));
std::string url = gSavedSettings.getString("AvatarPickerURL");
url = LLWeb::expandURLSubstitutions(url, LLSD());
- avatar_picker->navigateTo(url, "text/html");
+ avatar_picker->navigateTo(url, HTTP_CONTENT_TEXT_HTML);
}
}
@@ -2039,29 +2060,28 @@ void LLViewerWindow::initWorldUI()
void LLViewerWindow::shutdownViews()
{
// clean up warning logger
- LLError::removeRecorder(RecordToChatConsole::getInstance());
-
- llinfos << "Warning logger is cleaned." << llendl ;
+ RecordToChatConsole::getInstance()->stopRecorder();
+ LL_INFOS() << "Warning logger is cleaned." << LL_ENDL ;
delete mDebugText;
mDebugText = NULL;
- llinfos << "DebugText deleted." << llendl ;
+ LL_INFOS() << "DebugText deleted." << LL_ENDL ;
// Cleanup global views
if (gMorphView)
{
gMorphView->setVisible(FALSE);
}
- llinfos << "Global views cleaned." << llendl ;
+ LL_INFOS() << "Global views cleaned." << LL_ENDL ;
LLNotificationsUI::LLToast::cleanupToasts();
- llinfos << "Leftover toast cleaned up." << llendl;
+ LL_INFOS() << "Leftover toast cleaned up." << LL_ENDL;
// DEV-40930: Clear sModalStack. Otherwise, any LLModalDialog left open
// will crump with LL_ERRS.
LLModalDialog::shutdownModals();
- llinfos << "LLModalDialog shut down." << llendl;
+ LL_INFOS() << "LLModalDialog shut down." << LL_ENDL;
// destroy the nav bar, not currently part of gViewerWindow
// *TODO: Make LLNavigationBar part of gViewerWindow
@@ -2069,17 +2089,20 @@ void LLViewerWindow::shutdownViews()
{
delete LLNavigationBar::getInstance();
}
- llinfos << "LLNavigationBar destroyed." << llendl ;
+ LL_INFOS() << "LLNavigationBar destroyed." << LL_ENDL ;
// destroy menus after instantiating navbar above, as it needs
// access to gMenuHolder
cleanup_menus();
- llinfos << "menus destroyed." << llendl ;
+ LL_INFOS() << "menus destroyed." << LL_ENDL ;
+
+ view_listener_t::cleanup();
+ LL_INFOS() << "view listeners destroyed." << LL_ENDL ;
// Delete all child views.
delete mRootView;
mRootView = NULL;
- llinfos << "RootView deleted." << llendl ;
+ LL_INFOS() << "RootView deleted." << LL_ENDL ;
LLMenuOptionPathfindingRebakeNavmesh::getInstance()->quit();
@@ -2107,12 +2130,12 @@ void LLViewerWindow::shutdownGL()
gSky.cleanup();
stop_glerror();
- llinfos << "Cleaning up pipeline" << llendl;
+ LL_INFOS() << "Cleaning up pipeline" << LL_ENDL;
gPipeline.cleanup();
stop_glerror();
//MUST clean up pipeline before cleaning up wearables
- llinfos << "Cleaning up wearables" << llendl;
+ LL_INFOS() << "Cleaning up wearables" << LL_ENDL;
LLWearableList::instance().cleanup() ;
gTextureList.shutdown();
@@ -2126,12 +2149,12 @@ void LLViewerWindow::shutdownGL()
LLViewerTextureManager::cleanup() ;
LLImageGL::cleanupClass() ;
- llinfos << "All textures and llimagegl images are destroyed!" << llendl ;
+ LL_INFOS() << "All textures and llimagegl images are destroyed!" << LL_ENDL ;
- llinfos << "Cleaning up select manager" << llendl;
+ LL_INFOS() << "Cleaning up select manager" << LL_ENDL;
LLSelectMgr::getInstance()->cleanup();
- llinfos << "Stopping GL during shutdown" << llendl;
+ LL_INFOS() << "Stopping GL during shutdown" << LL_ENDL;
stopGL(FALSE);
stop_glerror();
@@ -2139,19 +2162,23 @@ void LLViewerWindow::shutdownGL()
LLVertexBuffer::cleanupClass();
- llinfos << "LLVertexBuffer cleaned." << llendl ;
+ LL_INFOS() << "LLVertexBuffer cleaned." << LL_ENDL ;
}
// shutdownViews() and shutdownGL() need to be called first
LLViewerWindow::~LLViewerWindow()
{
- llinfos << "Destroying Window" << llendl;
+ LL_INFOS() << "Destroying Window" << LL_ENDL;
destroyWindow();
delete mDebugText;
mDebugText = NULL;
- delete mMouseVelocityStat;
+ if (LLViewerShaderMgr::sInitialized)
+ {
+ LLViewerShaderMgr::releaseInstance();
+ LLViewerShaderMgr::sInitialized = FALSE;
+ }
}
@@ -2262,8 +2289,8 @@ void LLViewerWindow::reshape(S32 width, S32 height)
}
}
- LLViewerStats::getInstance()->setStat(LLViewerStats::ST_WINDOW_WIDTH, (F64)width);
- LLViewerStats::getInstance()->setStat(LLViewerStats::ST_WINDOW_HEIGHT, (F64)height);
+ sample(LLStatViewer::WINDOW_WIDTH, width);
+ sample(LLStatViewer::WINDOW_HEIGHT, height);
LLLayoutStack::updateClass();
}
@@ -2538,7 +2565,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
||(gLoginMenuBarView && gLoginMenuBarView->handleKey(key, mask, TRUE))
||(gMenuHolder && gMenuHolder->handleKey(key, mask, TRUE)))
{
- lldebugs << "LLviewerWindow::handleKey handle nav keys for nav" << llendl;
+ LL_DEBUGS() << "LLviewerWindow::handleKey handle nav keys for nav" << LL_ENDL;
LLViewerEventRecorder::instance().logKeyEvent(key,mask);
return TRUE;
}
@@ -2571,7 +2598,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
// if nothing has focus, go to first or last UI element as appropriate
if (key == KEY_TAB && (mask & MASK_CONTROL || gFocusMgr.getKeyboardFocus() == NULL))
{
- llwarns << "LLviewerWindow::handleKey give floaters first chance at tab key " << llendl;
+ LL_WARNS() << "LLviewerWindow::handleKey give floaters first chance at tab key " << LL_ENDL;
if (gMenuHolder) gMenuHolder->hideMenus();
// if CTRL-tabbing (and not just TAB with no focus), go into window cycle mode
@@ -2633,17 +2660,17 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
if (keyboard_focus->handleKey(key, mask, FALSE))
{
- lldebugs << "LLviewerWindow::handleKey - in 'traverse up' - no loops seen... just called keyboard_focus->handleKey an it returned true" << llendl;
+ LL_DEBUGS() << "LLviewerWindow::handleKey - in 'traverse up' - no loops seen... just called keyboard_focus->handleKey an it returned true" << LL_ENDL;
LLViewerEventRecorder::instance().logKeyEvent(key,mask);
return TRUE;
} else {
- lldebugs << "LLviewerWindow::handleKey - in 'traverse up' - no loops seen... just called keyboard_focus->handleKey an it returned FALSE" << llendl;
+ LL_DEBUGS() << "LLviewerWindow::handleKey - in 'traverse up' - no loops seen... just called keyboard_focus->handleKey an it returned FALSE" << LL_ENDL;
}
}
if( LLToolMgr::getInstance()->getCurrentTool()->handleKey(key, mask) )
{
- lldebugs << "LLviewerWindow::handleKey toolbar handling?" << llendl;
+ LL_DEBUGS() << "LLviewerWindow::handleKey toolbar handling?" << LL_ENDL;
LLViewerEventRecorder::instance().logKeyEvent(key,mask);
return TRUE;
}
@@ -2651,7 +2678,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
// Try for a new-format gesture
if (LLGestureMgr::instance().triggerGesture(key, mask))
{
- lldebugs << "LLviewerWindow::handleKey new gesture feature" << llendl;
+ LL_DEBUGS() << "LLviewerWindow::handleKey new gesture feature" << LL_ENDL;
LLViewerEventRecorder::instance().logKeyEvent(key,mask);
return TRUE;
}
@@ -2660,7 +2687,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
// don't pass it down to the menus.
if (gGestureList.trigger(key, mask))
{
- lldebugs << "LLviewerWindow::handleKey check gesture trigger" << llendl;
+ LL_DEBUGS() << "LLviewerWindow::handleKey check gesture trigger" << LL_ENDL;
LLViewerEventRecorder::instance().logKeyEvent(key,mask);
return TRUE;
}
@@ -2753,7 +2780,7 @@ void LLViewerWindow::handleScrollWheel(S32 clicks)
mouse_captor->handleScrollWheel(local_x, local_y, clicks);
if (LLView::sDebugMouseHandling)
{
- llinfos << "Scroll Wheel handled by captor " << mouse_captor->getName() << llendl;
+ LL_INFOS() << "Scroll Wheel handled by captor " << mouse_captor->getName() << LL_ENDL;
}
return;
}
@@ -2771,13 +2798,13 @@ void LLViewerWindow::handleScrollWheel(S32 clicks)
{
if (LLView::sDebugMouseHandling)
{
- llinfos << "Scroll Wheel" << LLView::sMouseHandlerMessage << llendl;
+ LL_INFOS() << "Scroll Wheel" << LLView::sMouseHandlerMessage << LL_ENDL;
}
return;
}
else if (LLView::sDebugMouseHandling)
{
- llinfos << "Scroll Wheel not handled by view" << llendl;
+ LL_INFOS() << "Scroll Wheel not handled by view" << LL_ENDL;
}
// Zoom the camera in and out behavior
@@ -2866,12 +2893,13 @@ void append_xui_tooltip(LLView* viewp, LLToolTip::Params& params)
}
}
+static LLTrace::BlockTimerStatHandle ftm("Update UI");
+
// Update UI based on stored mouse position from mouse-move
// event processing.
void LLViewerWindow::updateUI()
{
- static LLFastTimer::DeclareTimer ftm("Update UI");
- LLFastTimer t(ftm);
+ LL_RECORD_BLOCK_TIME(ftm);
static std::string last_handle_msg;
@@ -3092,12 +3120,12 @@ void LLViewerWindow::updateUI()
handled = mouse_captor->handleHover(local_x, local_y, mask);
if (LLView::sDebugMouseHandling)
{
- llinfos << "Hover handled by captor " << mouse_captor->getName() << llendl;
+ LL_INFOS() << "Hover handled by captor " << mouse_captor->getName() << LL_ENDL;
}
if( !handled )
{
- lldebugst(LLERR_USER_INPUT) << "hover not handled by mouse captor" << llendl;
+ LL_DEBUGS("UserInput") << "hover not handled by mouse captor" << LL_ENDL;
}
}
else
@@ -3118,7 +3146,7 @@ void LLViewerWindow::updateUI()
if (LLView::sDebugMouseHandling && LLView::sMouseHandlerMessage != last_handle_msg)
{
last_handle_msg = LLView::sMouseHandlerMessage;
- llinfos << "Hover" << LLView::sMouseHandlerMessage << llendl;
+ LL_INFOS() << "Hover" << LLView::sMouseHandlerMessage << LL_ENDL;
}
handled = TRUE;
}
@@ -3127,7 +3155,7 @@ void LLViewerWindow::updateUI()
if (last_handle_msg != LLStringUtil::null)
{
last_handle_msg.clear();
- llinfos << "Hover not handled by view" << llendl;
+ LL_INFOS() << "Hover not handled by view" << LL_ENDL;
}
}
}
@@ -3195,6 +3223,8 @@ void LLViewerWindow::updateUI()
}
append_xui_tooltip(tooltip_view, params);
+ params.styled_message.add().text("\n");
+
screen_sticky_rect.intersectWith(tooltip_view->calcScreenRect());
params.sticky_rect = screen_sticky_rect;
@@ -3244,6 +3274,8 @@ void LLViewerWindow::updateUI()
updateLayout();
+ mLastMousePoint = mCurrentMousePoint;
+
// cleanup unused selections when no modal dialogs are open
if (LLModalDialog::activeCount() == 0)
{
@@ -3338,8 +3370,8 @@ void LLViewerWindow::updateMouseDelta()
static F32 fdy = 0.f;
F32 amount = 16.f;
- fdx = fdx + ((F32) dx - fdx) * llmin(gFrameIntervalSeconds*amount,1.f);
- fdy = fdy + ((F32) dy - fdy) * llmin(gFrameIntervalSeconds*amount,1.f);
+ fdx = fdx + ((F32) dx - fdx) * llmin(gFrameIntervalSeconds.value()*amount,1.f);
+ fdy = fdy + ((F32) dy - fdy) * llmin(gFrameIntervalSeconds.value()*amount,1.f);
mCurrentMouseDelta.set(llround(fdx), llround(fdy));
mouse_vel.setVec(fdx,fdy);
@@ -3350,7 +3382,7 @@ void LLViewerWindow::updateMouseDelta()
mouse_vel.setVec((F32) dx, (F32) dy);
}
- mMouseVelocityStat->addValue(mouse_vel.magVec());
+ sample(sMouseVelocityStat, mouse_vel.magVec());
}
void LLViewerWindow::updateKeyboardFocus()
@@ -3441,10 +3473,10 @@ void LLViewerWindow::updateKeyboardFocus()
}
}
-static LLFastTimer::DeclareTimer FTM_UPDATE_WORLD_VIEW("Update World View");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_WORLD_VIEW("Update World View");
void LLViewerWindow::updateWorldViewRect(bool use_full_window)
{
- LLFastTimer ft(FTM_UPDATE_WORLD_VIEW);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_WORLD_VIEW);
// start off using whole window to render world
LLRect new_world_rect = mWindowRectRaw;
@@ -3482,8 +3514,6 @@ void LLViewerWindow::saveLastMouse(const LLCoordGL &point)
// Store last mouse location.
// If mouse leaves window, pretend last point was on edge of window
- mLastMousePoint = mCurrentMousePoint;
-
if (point.mX < 0)
{
mCurrentMousePoint.mX = 0;
@@ -3717,11 +3747,11 @@ BOOL LLViewerWindow::clickPointOnSurfaceGlobal(const S32 x, const S32 y, LLViewe
if (!intersect)
{
point_global = clickPointInWorldGlobal(x, y, objectp);
- llinfos << "approx intersection at " << (objectp->getPositionGlobal() - point_global) << llendl;
+ LL_INFOS() << "approx intersection at " << (objectp->getPositionGlobal() - point_global) << LL_ENDL;
}
else
{
- llinfos << "good intersection at " << (objectp->getPositionGlobal() - point_global) << llendl;
+ LL_INFOS() << "good intersection at " << (objectp->getPositionGlobal() - point_global) << LL_ENDL;
}
return intersect;
@@ -3941,7 +3971,7 @@ LLViewerObject* LLViewerWindow::cursorIntersect(S32 mouse_x, S32 mouse_y, F32 de
}
}
}
-
+
return found;
}
@@ -4089,13 +4119,13 @@ BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d
S32 grids_per_edge = (S32) regionp->getLand().mGridsPerEdge;
if ((i >= grids_per_edge) || (j >= grids_per_edge))
{
- //llinfos << "LLViewerWindow::mousePointOnLand probe_point is out of region" << llendl;
+ //LL_INFOS() << "LLViewerWindow::mousePointOnLand probe_point is out of region" << LL_ENDL;
continue;
}
land_z = regionp->getLand().resolveHeightRegion(probe_point_region);
- //llinfos << "mousePointOnLand initial z " << land_z << llendl;
+ //LL_INFOS() << "mousePointOnLand initial z " << land_z << LL_ENDL;
if (probe_point_region.mV[VZ] < land_z)
{
@@ -4136,7 +4166,7 @@ BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d
j = (S32) (local_probe_point.mV[VY]/regionp->getLand().getMetersPerGrid());
if ((i >= regionp->getLand().mGridsPerEdge) || (j >= regionp->getLand().mGridsPerEdge))
{
- // llinfos << "LLViewerWindow::mousePointOnLand probe_point is out of region" << llendl;
+ // LL_INFOS() << "LLViewerWindow::mousePointOnLand probe_point is out of region" << LL_ENDL;
continue;
}
land_z = regionp->getLand().mSurfaceZ[ i + j * (regionp->getLand().mGridsPerEdge) ];
@@ -4144,7 +4174,7 @@ BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d
land_z = regionp->getLand().resolveHeightRegion(probe_point_region);
- //llinfos << "mousePointOnLand refine z " << land_z << llendl;
+ //LL_INFOS() << "mousePointOnLand refine z " << land_z << LL_ENDL;
if (probe_point_region.mV[VZ] < land_z)
{
@@ -4164,7 +4194,7 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, bool force_picke
{
if (!image)
{
- llwarns << "No image to save" << llendl;
+ LL_WARNS() << "No image to save" << LL_ENDL;
return FALSE;
}
@@ -4224,7 +4254,7 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, bool force_picke
}
while( -1 != err ); // search until the file is not found (i.e., stat() gives an error).
- llinfos << "Saving snapshot to " << filepath << llendl;
+ LL_INFOS() << "Saving snapshot to " << filepath << LL_ENDL;
return image->save(filepath);
}
@@ -4247,7 +4277,7 @@ void LLViewerWindow::movieSize(S32 new_width, S32 new_height)
BOOL LLViewerWindow::saveSnapshot( const std::string& filepath, S32 image_width, S32 image_height, BOOL show_ui, BOOL do_rebuild, ESnapshotType type)
{
- llinfos << "Saving snapshot to: " << filepath << llendl;
+ LL_INFOS() << "Saving snapshot to: " << filepath << LL_ENDL;
LLPointer<LLImageRaw> raw = new LLImageRaw;
BOOL success = rawSnapshot(raw, image_width, image_height, TRUE, FALSE, show_ui, do_rebuild);
@@ -4262,12 +4292,12 @@ BOOL LLViewerWindow::saveSnapshot( const std::string& filepath, S32 image_width,
}
else
{
- llwarns << "Unable to encode bmp snapshot" << llendl;
+ LL_WARNS() << "Unable to encode bmp snapshot" << LL_ENDL;
}
}
else
{
- llwarns << "Unable to capture raw snapshot" << llendl;
+ LL_WARNS() << "Unable to capture raw snapshot" << LL_ENDL;
}
return success;
@@ -4308,7 +4338,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
{
if(!LLMemory::tryToAlloc(NULL, image_width * image_height * 3))
{
- llwarns << "No enough memory to take the snapshot with size (w : h): " << image_width << " : " << image_height << llendl ;
+ LL_WARNS() << "No enough memory to take the snapshot with size (w : h): " << image_width << " : " << image_height << LL_ENDL ;
return FALSE ; //there is no enough memory for taking this snapshot.
}
}
@@ -4405,7 +4435,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
if (show_ui && scale_factor > 1.f)
{
// Note: we should never get there...
- llwarns << "over scaling UI not supported." << llendl;
+ LL_WARNS() << "over scaling UI not supported." << LL_ENDL;
}
S32 buffer_x_offset = llfloor(((window_width - snapshot_width) * scale_factor) / 2.f);
@@ -4437,7 +4467,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
if (high_res && show_ui)
{
// Note: we should never get there...
- llwarns << "High res UI snapshot not supported. " << llendl;
+ LL_WARNS() << "High res UI snapshot not supported. " << LL_ENDL;
/*send_agent_pause();
//rescale fonts
initFonts(scale_factor);
@@ -4482,6 +4512,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
// Required for showing the GUI in snapshots and performing bloom composite overlay
// Call even if show_ui is FALSE
render_ui(scale_factor, subfield);
+ swap();
}
for (U32 out_y = 0; out_y < read_height ; out_y++)
@@ -4803,10 +4834,10 @@ LLProgressView *LLViewerWindow::getProgressView() const
void LLViewerWindow::dumpState()
{
- llinfos << "LLViewerWindow Active " << S32(mActive) << llendl;
- llinfos << "mWindow visible " << S32(mWindow->getVisible())
+ LL_INFOS() << "LLViewerWindow Active " << S32(mActive) << LL_ENDL;
+ LL_INFOS() << "mWindow visible " << S32(mWindow->getVisible())
<< " minimized " << S32(mWindow->getMinimized())
- << llendl;
+ << LL_ENDL;
}
void LLViewerWindow::stopGL(BOOL save_state)
@@ -4817,7 +4848,7 @@ void LLViewerWindow::stopGL(BOOL save_state)
//especially be careful to put anything behind gTextureList.destroyGL(save_state);
if (!gGLManager.mIsDisabled)
{
- llinfos << "Shutting down GL..." << llendl;
+ LL_INFOS() << "Shutting down GL..." << LL_ENDL;
// Pause texture decode threads (will get unpaused during main loop)
LLAppViewer::getTextureCache()->pause();
@@ -4862,7 +4893,7 @@ void LLViewerWindow::stopGL(BOOL save_state)
gGLManager.mIsDisabled = TRUE;
stop_glerror();
- llinfos << "Remaining allocated texture memory: " << LLImageGL::sGlobalTextureMemoryInBytes << " bytes" << llendl;
+ LL_INFOS() << "Remaining allocated texture memory: " << LLImageGL::sGlobalTextureMemory.value() << " bytes" << LL_ENDL;
}
}
@@ -4874,7 +4905,7 @@ void LLViewerWindow::restoreGL(const std::string& progress_message)
//especially, be careful to put something before gTextureList.restoreGL();
if (gGLManager.mIsDisabled)
{
- llinfos << "Restoring GL..." << llendl;
+ LL_INFOS() << "Restoring GL..." << LL_ENDL;
gGLManager.mIsDisabled = FALSE;
initGLDefaults();
@@ -4911,10 +4942,10 @@ void LLViewerWindow::restoreGL(const std::string& progress_message)
setShowProgress(TRUE);
setProgressString(progress_message);
}
- llinfos << "...Restoring GL done" << llendl;
+ LL_INFOS() << "...Restoring GL done" << LL_ENDL;
if(!LLAppViewer::instance()->restoreErrorTrap())
{
- llwarns << " Someone took over my signal/exception handler (post restoreGL)!" << llendl;
+ LL_WARNS() << " Someone took over my signal/exception handler (post restoreGL)!" << LL_ENDL;
}
}
@@ -4940,11 +4971,11 @@ void LLViewerWindow::requestResolutionUpdate()
mResDirty = true;
}
-static LLFastTimer::DeclareTimer FTM_WINDOW_CHECK_SETTINGS("Window Settings");
+static LLTrace::BlockTimerStatHandle FTM_WINDOW_CHECK_SETTINGS("Window Settings");
void LLViewerWindow::checkSettings()
{
- LLFastTimer t(FTM_WINDOW_CHECK_SETTINGS);
+ LL_RECORD_BLOCK_TIME(FTM_WINDOW_CHECK_SETTINGS);
if (mStatesDirty)
{
gGL.refreshState();
@@ -4962,7 +4993,7 @@ void LLViewerWindow::checkSettings()
void LLViewerWindow::restartDisplay(BOOL show_progress_bar)
{
- llinfos << "Restaring GL" << llendl;
+ LL_INFOS() << "Restaring GL" << LL_ENDL;
stopGL();
if (show_progress_bar)
{
@@ -5005,7 +5036,7 @@ BOOL LLViewerWindow::changeDisplaySettings(LLCoordScreen size, BOOL disable_vsyn
LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
send_agent_pause();
- llinfos << "Stopping GL during changeDisplaySettings" << llendl;
+ LL_INFOS() << "Stopping GL during changeDisplaySettings" << LL_ENDL;
stopGL();
mIgnoreActivate = TRUE;
LLCoordScreen old_size;
@@ -5031,7 +5062,7 @@ BOOL LLViewerWindow::changeDisplaySettings(LLCoordScreen size, BOOL disable_vsyn
}
send_agent_resume();
- llinfos << "Restoring GL during resolution change" << llendl;
+ LL_INFOS() << "Restoring GL during resolution change" << LL_ENDL;
if (show_progress_bar)
{
restoreGL(LLTrans::getString("ProgressChangingResolution"));
@@ -5097,7 +5128,7 @@ void LLViewerWindow::calcDisplayScale()
if (display_scale != mDisplayScale)
{
- llinfos << "Setting display scale to " << display_scale << llendl;
+ LL_INFOS() << "Setting display scale to " << display_scale << LL_ENDL;
mDisplayScale = display_scale;
// Init default fonts
@@ -5400,7 +5431,7 @@ void LLPickInfo::getSurfaceInfo()
tangent.clear();
normal.clear();
intersection.clear();
-
+
LLViewerObject* objectp = getObject();
if (objectp)
@@ -5421,7 +5452,7 @@ void LLPickInfo::getSurfaceInfo()
if (facep)
{
mUVCoords = facep->surfaceToTexture(mSTCoords, intersection, normal);
- }
+ }
}
mIntersection.set(intersection.getF32ptr());
diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h
index c16b80b214..5d2df2dfd7 100755
--- a/indra/newview/llviewerwindow.h
+++ b/indra/newview/llviewerwindow.h
@@ -45,12 +45,12 @@
#include "llnotifications.h"
#include "llhandle.h"
#include "llinitparam.h"
+#include "lltrace.h"
#include <boost/function.hpp>
#include <boost/signals2.hpp>
#include <boost/scoped_ptr.hpp>
-class LLStat;
class LLView;
class LLViewerObject;
class LLUUID;
@@ -257,7 +257,7 @@ public:
S32 getCurrentMouseDX() const { return mCurrentMouseDelta.mX; }
S32 getCurrentMouseDY() const { return mCurrentMouseDelta.mY; }
LLCoordGL getCurrentMouseDelta() const { return mCurrentMouseDelta; }
- LLStat* getMouseVelocityStat() { return mMouseVelocityStat; }
+ static LLTrace::SampleStatHandle<>* getMouseVelocityStat() { return &sMouseVelocityStat; }
BOOL getLeftMouseDown() const { return mLeftMouseDown; }
BOOL getMiddleMouseDown() const { return mMiddleMouseDown; }
BOOL getRightMouseDown() const { return mRightMouseDown; }
@@ -438,7 +438,6 @@ private:
LLCoordGL mCurrentMousePoint; // last mouse position in GL coords
LLCoordGL mLastMousePoint; // Mouse point at last frame.
LLCoordGL mCurrentMouseDelta; //amount mouse moved this frame
- LLStat* mMouseVelocityStat;
BOOL mLeftMouseDown;
BOOL mMiddleMouseDown;
BOOL mRightMouseDown;
@@ -493,6 +492,8 @@ private:
// Object temporarily hovered over while dragging
LLPointer<LLViewerObject> mDragHoveredObject;
+
+ static LLTrace::SampleStatHandle<> sMouseVelocityStat;
};
//
diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp
index 94760e3c83..4e9400872a 100755
--- a/indra/newview/llvlcomposition.cpp
+++ b/indra/newview/llvlcomposition.cpp
@@ -28,7 +28,6 @@
#include "llvlcomposition.h"
-#include "imageids.h"
#include "llerror.h"
#include "v3math.h"
#include "llsurface.h"
@@ -288,7 +287,7 @@ BOOL LLVLComposition::generateTexture(const F32 x, const F32 y,
{
mDetailTextures[i]->destroyRawImage() ;
}
- lldebugs << "cached raw data for terrain detail texture is not ready yet: " << mDetailTextures[i]->getID() << llendl;
+ LL_DEBUGS() << "cached raw data for terrain detail texture is not ready yet: " << mDetailTextures[i]->getID() << LL_ENDL;
return FALSE;
}
@@ -324,12 +323,12 @@ BOOL LLVLComposition::generateTexture(const F32 x, const F32 y,
if (x_end > mWidth)
{
- llwarns << "x end > width" << llendl;
+ LL_WARNS() << "x end > width" << LL_ENDL;
x_end = mWidth;
}
if (y_end > mWidth)
{
- llwarns << "y end > width" << llendl;
+ LL_WARNS() << "y end > width" << LL_ENDL;
y_end = mWidth;
}
@@ -359,7 +358,7 @@ BOOL LLVLComposition::generateTexture(const F32 x, const F32 y,
if (tex_comps != st_comps)
{
- llwarns << "Base texture comps != input texture comps" << llendl;
+ LL_WARNS() << "Base texture comps != input texture comps" << LL_ENDL;
return FALSE;
}
@@ -417,8 +416,8 @@ BOOL LLVLComposition::generateTexture(const F32 x, const F32 y,
if (st_offset >= st_data_size[tex0] || st_offset >= st_data_size[tex1])
{
// SJB: This shouldn't be happening, but does... Rounding error?
- //llwarns << "offset 0 [" << tex0 << "] =" << st_offset << " >= size=" << st_data_size[tex0] << llendl;
- //llwarns << "offset 1 [" << tex1 << "] =" << st_offset << " >= size=" << st_data_size[tex1] << llendl;
+ //LL_WARNS() << "offset 0 [" << tex0 << "] =" << st_offset << " >= size=" << st_data_size[tex0] << LL_ENDL;
+ //LL_WARNS() << "offset 1 [" << tex1 << "] =" << st_offset << " >= size=" << st_data_size[tex1] << LL_ENDL;
}
else
{
diff --git a/indra/newview/llvlmanager.cpp b/indra/newview/llvlmanager.cpp
index d8de979f56..895ceed880 100755
--- a/indra/newview/llvlmanager.cpp
+++ b/indra/newview/llvlmanager.cpp
@@ -29,45 +29,49 @@
#include "llvlmanager.h"
#include "indra_constants.h"
-#include "bitpack.h"
#include "patch_code.h"
#include "patch_dct.h"
#include "llviewerregion.h"
#include "llframetimer.h"
#include "llsurface.h"
+#include "llbitpack.h"
+
+const char LAND_LAYER_CODE = 'L';
+const char WIND_LAYER_CODE = '7';
+const char CLOUD_LAYER_CODE = '8';
LLVLManager gVLManager;
LLVLManager::~LLVLManager()
{
S32 i;
- for (i = 0; i < mPacketData.count(); i++)
+ for (i = 0; i < mPacketData.size(); i++)
{
delete mPacketData[i];
}
- mPacketData.reset();
+ mPacketData.clear();
}
-void LLVLManager::addLayerData(LLVLData *vl_datap, const S32 mesg_size)
+void LLVLManager::addLayerData(LLVLData *vl_datap, const S32Bytes mesg_size)
{
if (LAND_LAYER_CODE == vl_datap->mType)
{
- mLandBits += mesg_size * 8;
+ mLandBits += mesg_size;
}
else if (WIND_LAYER_CODE == vl_datap->mType)
{
- mWindBits += mesg_size * 8;
+ mWindBits += mesg_size;
}
else if (CLOUD_LAYER_CODE == vl_datap->mType)
{
- mCloudBits += mesg_size * 8;
+ mCloudBits += mesg_size;
}
else
{
- llerrs << "Unknown layer type!" << (S32)vl_datap->mType << llendl;
+ LL_ERRS() << "Unknown layer type!" << (S32)vl_datap->mType << LL_ENDL;
}
- mPacketData.put(vl_datap);
+ mPacketData.push_back(vl_datap);
}
void LLVLManager::unpackData(const S32 num_packets)
@@ -75,7 +79,7 @@ void LLVLManager::unpackData(const S32 num_packets)
static LLFrameTimer decode_timer;
S32 i;
- for (i = 0; i < mPacketData.count(); i++)
+ for (i = 0; i < mPacketData.size(); i++)
{
LLVLData *datap = mPacketData[i];
@@ -98,35 +102,35 @@ void LLVLManager::unpackData(const S32 num_packets)
}
}
- for (i = 0; i < mPacketData.count(); i++)
+ for (i = 0; i < mPacketData.size(); i++)
{
delete mPacketData[i];
}
- mPacketData.reset();
+ mPacketData.clear();
}
void LLVLManager::resetBitCounts()
{
- mLandBits = mWindBits = mCloudBits = 0;
+ mLandBits = mWindBits = mCloudBits = (S32Bits)0;
}
-S32 LLVLManager::getLandBits() const
+U32Bits LLVLManager::getLandBits() const
{
return mLandBits;
}
-S32 LLVLManager::getWindBits() const
+U32Bits LLVLManager::getWindBits() const
{
return mWindBits;
}
-S32 LLVLManager::getCloudBits() const
+U32Bits LLVLManager::getCloudBits() const
{
return mCloudBits;
}
-S32 LLVLManager::getTotalBytes() const
+S32Bytes LLVLManager::getTotalBytes() const
{
return mLandBits + mWindBits + mCloudBits;
}
@@ -134,12 +138,12 @@ S32 LLVLManager::getTotalBytes() const
void LLVLManager::cleanupData(LLViewerRegion *regionp)
{
S32 cur = 0;
- while (cur < mPacketData.count())
+ while (cur < mPacketData.size())
{
if (mPacketData[cur]->mRegionp == regionp)
{
delete mPacketData[cur];
- mPacketData.remove(cur);
+ mPacketData.erase(mPacketData.begin() + cur);
}
else
{
diff --git a/indra/newview/llvlmanager.h b/indra/newview/llvlmanager.h
index 74b4823a5c..5e7fadc522 100755
--- a/indra/newview/llvlmanager.h
+++ b/indra/newview/llvlmanager.h
@@ -30,7 +30,6 @@
// This class manages the data coming in for viewer layers from the network.
#include "stdtypes.h"
-#include "lldarray.h"
class LLVLData;
class LLViewerRegion;
@@ -40,25 +39,25 @@ class LLVLManager
public:
~LLVLManager();
- void addLayerData(LLVLData *vl_datap, const S32 mesg_size);
+ void addLayerData(LLVLData *vl_datap, const S32Bytes mesg_size);
void unpackData(const S32 num_packets = 10);
- S32 getTotalBytes() const;
+ S32Bytes getTotalBytes() const;
- S32 getLandBits() const;
- S32 getWindBits() const;
- S32 getCloudBits() const;
+ U32Bits getLandBits() const;
+ U32Bits getWindBits() const;
+ U32Bits getCloudBits() const;
void resetBitCounts();
void cleanupData(LLViewerRegion *regionp);
protected:
- LLDynamicArray<LLVLData *> mPacketData;
- U32 mLandBits;
- U32 mWindBits;
- U32 mCloudBits;
+ std::vector<LLVLData *> mPacketData;
+ U32Bits mLandBits;
+ U32Bits mWindBits;
+ U32Bits mCloudBits;
};
class LLVLData
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index c47b6d2335..22b979aa09 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -51,7 +51,6 @@
#include "llpolyskeletaldistortion.h"
#include "lleditingmotion.h"
#include "llemote.h"
-//#include "llfirstuse.h"
#include "llfloatertools.h"
#include "llheadrotmotion.h"
#include "llhudeffecttrail.h"
@@ -68,6 +67,7 @@
#include "llmutelist.h"
#include "llmoveview.h"
#include "llnotificationsutil.h"
+#include "llphysicsshapebuilderutil.h"
#include "llquantize.h"
#include "llrand.h"
#include "llregionhandle.h"
@@ -82,6 +82,7 @@
#include "llviewermenu.h"
#include "llviewerobjectlist.h"
#include "llviewerparcelmgr.h"
+#include "llviewerregion.h"
#include "llviewershadermgr.h"
#include "llviewerstats.h"
#include "llviewerwearable.h"
@@ -101,13 +102,14 @@
#include "lldebugmessagebox.h"
#include "llsdutil.h"
+#include "llscenemonitor.h"
#include "llsdserialize.h"
extern F32 SPEED_ADJUST_MAX;
extern F32 SPEED_ADJUST_MAX_SEC;
extern F32 ANIM_SPEED_MAX;
extern F32 ANIM_SPEED_MIN;
-
+extern U32 JOINT_COUNT_REQUIRED_FOR_FULLRIG;
// #define OUTPUT_BREAST_DATA
@@ -116,16 +118,16 @@ using namespace LLAvatarAppearanceDefines;
//-----------------------------------------------------------------------------
// Global constants
//-----------------------------------------------------------------------------
-const LLUUID ANIM_AGENT_BODY_NOISE = LLUUID("9aa8b0a6-0c6f-9518-c7c3-4f41f2c001ad"); //"body_noise"
-const LLUUID ANIM_AGENT_BREATHE_ROT = LLUUID("4c5a103e-b830-2f1c-16bc-224aa0ad5bc8"); //"breathe_rot"
-const LLUUID ANIM_AGENT_EDITING = LLUUID("2a8eba1d-a7f8-5596-d44a-b4977bf8c8bb"); //"editing"
-const LLUUID ANIM_AGENT_EYE = LLUUID("5c780ea8-1cd1-c463-a128-48c023f6fbea"); //"eye"
-const LLUUID ANIM_AGENT_FLY_ADJUST = LLUUID("db95561f-f1b0-9f9a-7224-b12f71af126e"); //"fly_adjust"
-const LLUUID ANIM_AGENT_HAND_MOTION = LLUUID("ce986325-0ba7-6e6e-cc24-b17c4b795578"); //"hand_motion"
-const LLUUID ANIM_AGENT_HEAD_ROT = LLUUID("e6e8d1dd-e643-fff7-b238-c6b4b056a68d"); //"head_rot"
-const LLUUID ANIM_AGENT_PELVIS_FIX = LLUUID("0c5dd2a2-514d-8893-d44d-05beffad208b"); //"pelvis_fix"
-const LLUUID ANIM_AGENT_TARGET = LLUUID("0e4896cb-fba4-926c-f355-8720189d5b55"); //"target"
-const LLUUID ANIM_AGENT_WALK_ADJUST = LLUUID("829bc85b-02fc-ec41-be2e-74cc6dd7215d"); //"walk_adjust"
+const LLUUID ANIM_AGENT_BODY_NOISE = LLUUID("9aa8b0a6-0c6f-9518-c7c3-4f41f2c001ad"); //"body_noise"
+const LLUUID ANIM_AGENT_BREATHE_ROT = LLUUID("4c5a103e-b830-2f1c-16bc-224aa0ad5bc8"); //"breathe_rot"
+const LLUUID ANIM_AGENT_EDITING = LLUUID("2a8eba1d-a7f8-5596-d44a-b4977bf8c8bb"); //"editing"
+const LLUUID ANIM_AGENT_EYE = LLUUID("5c780ea8-1cd1-c463-a128-48c023f6fbea"); //"eye"
+const LLUUID ANIM_AGENT_FLY_ADJUST = LLUUID("db95561f-f1b0-9f9a-7224-b12f71af126e"); //"fly_adjust"
+const LLUUID ANIM_AGENT_HAND_MOTION = LLUUID("ce986325-0ba7-6e6e-cc24-b17c4b795578"); //"hand_motion"
+const LLUUID ANIM_AGENT_HEAD_ROT = LLUUID("e6e8d1dd-e643-fff7-b238-c6b4b056a68d"); //"head_rot"
+const LLUUID ANIM_AGENT_PELVIS_FIX = LLUUID("0c5dd2a2-514d-8893-d44d-05beffad208b"); //"pelvis_fix"
+const LLUUID ANIM_AGENT_TARGET = LLUUID("0e4896cb-fba4-926c-f355-8720189d5b55"); //"target"
+const LLUUID ANIM_AGENT_WALK_ADJUST = LLUUID("829bc85b-02fc-ec41-be2e-74cc6dd7215d"); //"walk_adjust"
const LLUUID ANIM_AGENT_PHYSICS_MOTION = LLUUID("7360e029-3cb8-ebc4-863e-212df440d987"); //"physics_motion"
@@ -253,7 +255,7 @@ struct LLAppearanceMessageContents
};
struct LLVOAvatarChildJoint : public LLInitParam::ChoiceBlock<LLVOAvatarChildJoint>
-{
+ {
Alternative<Lazy<struct LLVOAvatarBoneInfo, IS_A_BLOCK> > bone;
Alternative<LLVOAvatarCollisionVolumeInfo> collision_volume;
@@ -711,7 +713,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mLastRezzedStatus(-1),
mIsEditingAppearance(FALSE),
mUseLocalAppearance(FALSE),
- mUseServerBakes(FALSE), // FIXME DRANO consider using boost::optional, defaulting to unknown.
mLastUpdateRequestCOFVersion(-1),
mLastUpdateReceivedCOFVersion(-1)
{
@@ -721,7 +722,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
const BOOL needsSendToSim = false; // currently, this HUD effect doesn't need to pack and unpack data to do its job
mVoiceVisualizer = ( LLVoiceVisualizer *)LLHUDManager::getInstance()->createViewerEffect( LLHUDObject::LL_HUD_EFFECT_VOICE_VISUALIZER, needsSendToSim );
- lldebugs << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << llendl;
+ LL_DEBUGS("Avatar") << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << LL_ENDL;
mPelvisp = NULL;
@@ -774,6 +775,11 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mPelvisFixup = 0.0f;
mLastPelvisFixup = 0.0f;
+ if(LLSceneMonitor::getInstance()->isEnabled())
+ {
+ LLSceneMonitor::getInstance()->freezeAvatar((LLCharacter*)this);
+ }
+
mCachedVisualMute = !isSelf();
mCachedVisualMuteUpdateTime = LLFrameTimer::getTotalSeconds() + 5.0;
mVisuallyMuteSetting = VISUAL_MUTE_NOT_SET;
@@ -796,7 +802,7 @@ void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string c
<< "RuthTimer " << (U32)mRuthDebugTimer.getElapsedTimeF32()
<< " Notification " << notification_name
<< " : " << comment
- << llendl;
+ << LL_ENDL;
if (gSavedSettings.getBOOL("DebugAvatarRezTime"))
{
@@ -813,18 +819,18 @@ void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string c
//------------------------------------------------------------------------
LLVOAvatar::~LLVOAvatar()
{
- if (!mFullyLoaded)
- {
+ if (!mFullyLoaded)
+ {
debugAvatarRezTime("AvatarRezLeftCloudNotification","left after ruth seconds as cloud");
- }
- else
- {
+ }
+ else
+ {
debugAvatarRezTime("AvatarRezLeftNotification","left sometime after declouding");
- }
+ }
logPendingPhases();
- lldebugs << "LLVOAvatar Destructor (0x" << this << ") id:" << mID << llendl;
+ LL_DEBUGS("Avatar") << "LLVOAvatar Destructor (0x" << this << ") id:" << mID << LL_ENDL;
std::for_each(mAttachmentPoints.begin(), mAttachmentPoints.end(), DeletePairedPointer());
mAttachmentPoints.clear();
@@ -836,7 +842,7 @@ LLVOAvatar::~LLVOAvatar()
getPhases().clearPhases();
- lldebugs << "LLVOAvatar Destructor end" << llendl;
+ LL_DEBUGS() << "LLVOAvatar Destructor end" << LL_ENDL;
}
void LLVOAvatar::markDead()
@@ -1000,54 +1006,54 @@ void LLVOAvatar::dumpBakedStatus()
iter != LLCharacter::sInstances.end(); ++iter)
{
LLVOAvatar* inst = (LLVOAvatar*) *iter;
- llinfos << "Avatar ";
+ LL_INFOS() << "Avatar ";
LLNameValue* firstname = inst->getNVPair("FirstName");
LLNameValue* lastname = inst->getNVPair("LastName");
if( firstname )
{
- llcont << firstname->getString();
+ LL_CONT << firstname->getString();
}
if( lastname )
{
- llcont << " " << lastname->getString();
+ LL_CONT << " " << lastname->getString();
}
- llcont << " " << inst->mID;
+ LL_CONT << " " << inst->mID;
if( inst->isDead() )
{
- llcont << " DEAD ("<< inst->getNumRefs() << " refs)";
+ LL_CONT << " DEAD ("<< inst->getNumRefs() << " refs)";
}
if( inst->isSelf() )
{
- llcont << " (self)";
+ LL_CONT << " (self)";
}
F64 dist_to_camera = (inst->getPositionGlobal() - camera_pos_global).length();
- llcont << " " << dist_to_camera << "m ";
+ LL_CONT << " " << dist_to_camera << "m ";
- llcont << " " << inst->mPixelArea << " pixels";
+ LL_CONT << " " << inst->mPixelArea << " pixels";
if( inst->isVisible() )
{
- llcont << " (visible)";
+ LL_CONT << " (visible)";
}
else
{
- llcont << " (not visible)";
+ LL_CONT << " (not visible)";
}
if( inst->isFullyBaked() )
{
- llcont << " Baked";
+ LL_CONT << " Baked";
}
else
{
- llcont << " Unbaked (";
+ LL_CONT << " Unbaked (";
for (LLAvatarAppearanceDictionary::BakedTextures::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().begin();
iter != LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().end();
@@ -1057,16 +1063,16 @@ void LLVOAvatar::dumpBakedStatus()
const ETextureIndex index = baked_dict->mTextureIndex;
if (!inst->isTextureDefined(index))
{
- llcont << " " << LLAvatarAppearanceDictionary::getInstance()->getTexture(index)->mName;
+ LL_CONT << " " << LLAvatarAppearanceDictionary::getInstance()->getTexture(index)->mName;
}
}
- llcont << " ) " << inst->getUnbakedPixelAreaRank();
+ LL_CONT << " ) " << inst->getUnbakedPixelAreaRank();
if( inst->isCulled() )
{
- llcont << " culled";
+ LL_CONT << " culled";
}
}
- llcont << llendl;
+ LL_CONT << LL_ENDL;
}
}
@@ -1078,7 +1084,7 @@ void LLVOAvatar::restoreGL()
gAgentAvatarp->setCompositeUpdatesEnabled(TRUE);
for (U32 i = 0; i < gAgentAvatarp->mBakedTextureDatas.size(); i++)
{
- gAgentAvatarp->invalidateComposite(gAgentAvatarp->getTexLayerSet(i), FALSE);
+ gAgentAvatarp->invalidateComposite(gAgentAvatarp->getTexLayerSet(i));
}
gAgentAvatarp->updateMeshTextures();
}
@@ -1107,7 +1113,7 @@ void LLVOAvatar::deleteCachedImages(bool clearAll)
{
if (LLViewerTexLayerSet::sHasCaches)
{
- lldebugs << "Deleting layer set caches" << llendl;
+ LL_DEBUGS() << "Deleting layer set caches" << LL_ENDL;
for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
iter != LLCharacter::sInstances.end(); ++iter)
{
@@ -1207,7 +1213,7 @@ void LLVOAvatar::initInstance(void)
registerMotion( ANIM_AGENT_TARGET, LLTargetingMotion::create );
registerMotion( ANIM_AGENT_WALK_ADJUST, LLWalkAdjustMotion::create );
}
-
+
LLAvatarAppearance::initInstance();
// preload specific motions here
@@ -1245,6 +1251,7 @@ LLTexLayerSet* LLVOAvatar::createTexLayerSet()
const LLVector3 LLVOAvatar::getRenderPosition() const
{
+
if (mDrawable.isNull() || mDrawable->getGeneration() < 0)
{
return getPositionAgent();
@@ -1267,6 +1274,8 @@ const LLVector3 LLVOAvatar::getRenderPosition() const
{
return getPosition() * mDrawable->getParent()->getRenderMatrix();
}
+
+
}
void LLVOAvatar::updateDrawable(BOOL force_damped)
@@ -1302,6 +1311,8 @@ void LLVOAvatar::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newMax)
mImpostorOffset = LLVector3(pos_group.getF32ptr())-getRenderPosition();
mDrawable->setPositionGroup(pos_group);
}
+
+
}
void LLVOAvatar::getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax)
@@ -1318,7 +1329,7 @@ void LLVOAvatar::getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax)
for (polymesh_map_t::iterator i = mPolyMeshes.begin(); i != mPolyMeshes.end(); ++i)
{
LLPolyMesh* mesh = i->second;
- for (S32 joint_num = 0; joint_num < mesh->mJointRenderData.count(); joint_num++)
+ for (S32 joint_num = 0; joint_num < mesh->mJointRenderData.size(); joint_num++)
{
LLVector4a trans;
trans.load3( mesh->mJointRenderData[joint_num]->mWorldMatrix->getTranslation().mV);
@@ -1646,7 +1657,7 @@ LLViewerObject* LLVOAvatar::lineSegmentIntersectRiggedAttachments(const LLVector
return hit;
}
-
+
LLVOAvatar* LLVOAvatar::asAvatar()
{
return this;
@@ -1700,14 +1711,14 @@ void LLVOAvatar::buildCharacter()
// If we don't have the Ooh morph, use the Kiss morph
if (!mOohMorph)
{
- llwarns << "Missing 'Ooh' morph for lipsync, using fallback." << llendl;
+ LL_WARNS() << "Missing 'Ooh' morph for lipsync, using fallback." << LL_ENDL;
mOohMorph = getVisualParam( "Express_Kiss" );
}
// If we don't have the Aah morph, use the Open Mouth morph
if (!mAahMorph)
{
- llwarns << "Missing 'Aah' morph for lipsync, using fallback." << llendl;
+ LL_WARNS() << "Missing 'Aah' morph for lipsync, using fallback." << LL_ENDL;
mAahMorph = getVisualParam( "Express_Open_Mouth" );
}
@@ -1735,7 +1746,7 @@ void LLVOAvatar::releaseMeshData()
return;
}
- //llinfos << "Releasing" << llendl;
+ LL_DEBUGS() << "Releasing mesh data" << LL_ENDL;
// cleanup mesh data
for (avatar_joint_list_t::iterator iter = mMeshLOD.begin();
@@ -1785,7 +1796,7 @@ void LLVOAvatar::restoreMeshData()
{
llassert(!isSelf());
- //llinfos << "Restoring" << llendl;
+ //LL_INFOS() << "Restoring" << LL_ENDL;
mMeshValid = TRUE;
updateJointLODs();
@@ -1896,7 +1907,7 @@ void LLVOAvatar::updateMeshData()
// the case of more than one avatar in the pool (thus > 0 instead of >= 0)
if (facep->getGeomIndex() > 0)
{
- llerrs << "non-zero geom index: " << facep->getGeomIndex() << " in LLVOAvatar::restoreMeshData" << llendl;
+ LL_ERRS() << "non-zero geom index: " << facep->getGeomIndex() << " in LLVOAvatar::restoreMeshData" << LL_ENDL;
}
for(S32 k = j ; k < part_index ; k++)
@@ -1962,8 +1973,8 @@ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys,
}
}
- //llinfos << getRotation() << llendl;
- //llinfos << getPosition() << llendl;
+ //LL_INFOS() << getRotation() << LL_ENDL;
+ //LL_INFOS() << getPosition() << LL_ENDL;
return retval;
}
@@ -1979,22 +1990,21 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU
// Should already exist, don't need to find it on sim or baked-texture host.
result = gTextureList.findImage(uuid);
}
-
if (!result)
- {
+{
const std::string url = getImageURL(te,uuid);
- if (!url.empty())
+
+ if (url.empty())
{
- LL_DEBUGS("Avatar") << avString() << "from URL " << url << llendl;
- result = LLViewerTextureManager::getFetchedTextureFromUrl(
- url, FTT_SERVER_BAKE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid);
+ LL_WARNS() << "unable to determine URL for te " << te << " uuid " << uuid << LL_ENDL;
+ return NULL;
}
- else
+ LL_DEBUGS("Avatar") << avString() << "get server-bake image from URL " << url << LL_ENDL;
+ result = LLViewerTextureManager::getFetchedTextureFromUrl(
+ url, FTT_SERVER_BAKE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid);
+ if (result->isMissingAsset())
{
- LL_DEBUGS("Avatar") << avString() << "from host " << uuid << llendl;
- LLHost host = getObjectHost();
- result = LLViewerTextureManager::getFetchedTexture(
- uuid, FTT_HOST_BAKE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, host);
+ result->setIsMissingAsset(false);
}
}
return result;
@@ -2014,15 +2024,15 @@ S32 LLVOAvatar::setTETexture(const U8 te, const LLUUID& uuid)
return setTETextureCore(te, image);
}
-static LLFastTimer::DeclareTimer FTM_AVATAR_UPDATE("Avatar Update");
-static LLFastTimer::DeclareTimer FTM_JOINT_UPDATE("Update Joints");
+static LLTrace::BlockTimerStatHandle FTM_AVATAR_UPDATE("Avatar Update");
+static LLTrace::BlockTimerStatHandle FTM_JOINT_UPDATE("Update Joints");
//------------------------------------------------------------------------
// LLVOAvatar::dumpAnimationState()
//------------------------------------------------------------------------
void LLVOAvatar::dumpAnimationState()
{
- llinfos << "==============================================" << llendl;
+ LL_INFOS() << "==============================================" << LL_ENDL;
for (LLVOAvatar::AnimIterator it = mSignaledAnimations.begin(); it != mSignaledAnimations.end(); ++it)
{
LLUUID id = it->first;
@@ -2031,7 +2041,7 @@ void LLVOAvatar::dumpAnimationState()
{
playtag = "*";
}
- llinfos << gAnimLibrary.animationName(id) << playtag << llendl;
+ LL_INFOS() << gAnimLibrary.animationName(id) << playtag << LL_ENDL;
}
for (LLVOAvatar::AnimIterator it = mPlayingAnimations.begin(); it != mPlayingAnimations.end(); ++it)
{
@@ -2039,7 +2049,7 @@ void LLVOAvatar::dumpAnimationState()
bool is_signaled = mSignaledAnimations.find(id) != mSignaledAnimations.end();
if (!is_signaled)
{
- llinfos << gAnimLibrary.animationName(id) << "!S" << llendl;
+ LL_INFOS() << gAnimLibrary.animationName(id) << "!S" << LL_ENDL;
}
}
}
@@ -2049,16 +2059,16 @@ void LLVOAvatar::dumpAnimationState()
//------------------------------------------------------------------------
void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time)
{
- LLFastTimer t(FTM_AVATAR_UPDATE);
+ LL_RECORD_BLOCK_TIME(FTM_AVATAR_UPDATE);
if (isDead())
{
- llinfos << "Warning! Idle on dead avatar" << llendl;
+ LL_INFOS() << "Warning! Idle on dead avatar" << LL_ENDL;
return;
}
if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_AVATAR))
- && !(gSavedSettings.getBOOL("DisableAllRenderTypes")))
+ && !(gSavedSettings.getBOOL("DisableAllRenderTypes")) && !isSelf())
{
return;
}
@@ -2071,7 +2081,7 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time)
// force asynchronous drawable update
if(mDrawable.notNull())
{
- LLFastTimer t(FTM_JOINT_UPDATE);
+ LL_RECORD_BLOCK_TIME(FTM_JOINT_UPDATE);
if (mIsSitting && getParent())
{
@@ -2184,7 +2194,7 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled)
if ( mCurrentGesticulationLevel == 0 ) { gestureString = "/voicelevel1"; }
else if ( mCurrentGesticulationLevel == 1 ) { gestureString = "/voicelevel2"; }
else if ( mCurrentGesticulationLevel == 2 ) { gestureString = "/voicelevel3"; }
- else { llinfos << "oops - CurrentGesticulationLevel can be only 0, 1, or 2" << llendl; }
+ else { LL_INFOS() << "oops - CurrentGesticulationLevel can be only 0, 1, or 2" << LL_ENDL; }
// this is the call that Karl S. created for triggering gestures from within the code.
LLGestureMgr::instance().triggerAndReviseString( gestureString );
@@ -2224,8 +2234,8 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled)
if ( mLipSyncActive )
{
- if( mOohMorph ) mOohMorph->setWeight(mOohMorph->getMinWeight(), FALSE);
- if( mAahMorph ) mAahMorph->setWeight(mAahMorph->getMinWeight(), FALSE);
+ if( mOohMorph ) mOohMorph->setWeight(mOohMorph->getMinWeight());
+ if( mAahMorph ) mAahMorph->setWeight(mAahMorph->getMinWeight());
mLipSyncActive = false;
LLCharacter::updateVisualParams();
@@ -2248,19 +2258,19 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled)
{
LLVector3 tagPos = mRoot->getWorldPosition();
tagPos[VZ] -= mPelvisToFoot;
- tagPos[VZ] += ( mBodySize[VZ] + 0.125f );
+ tagPos[VZ] += ( mBodySize[VZ] + 0.125f ); // does not need mAvatarOffset -Nyx
mVoiceVisualizer->setVoiceSourceWorldPosition( tagPos );
}
}//if ( voiceEnabled )
}
-static LLFastTimer::DeclareTimer FTM_ATTACHMENT_UPDATE("Update Attachments");
+static LLTrace::BlockTimerStatHandle FTM_ATTACHMENT_UPDATE("Update Attachments");
void LLVOAvatar::idleUpdateMisc(bool detailed_update)
{
if (LLVOAvatar::sJointDebug)
{
- llinfos << getFullname() << ": joint touches: " << LLJoint::sNumTouches << " updates: " << LLJoint::sNumUpdates << llendl;
+ LL_INFOS() << getFullname() << ": joint touches: " << LLJoint::sNumTouches << " updates: " << LLJoint::sNumUpdates << LL_ENDL;
}
LLJoint::sNumUpdates = 0;
@@ -2271,7 +2281,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update)
// update attachments positions
if (detailed_update || !sUseImpostors)
{
- LLFastTimer t(FTM_ATTACHMENT_UPDATE);
+ LL_RECORD_BLOCK_TIME(FTM_ATTACHMENT_UPDATE);
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
++iter)
@@ -2388,14 +2398,10 @@ void LLVOAvatar::idleUpdateAppearanceAnimation()
{
if (param->isTweakable())
{
- param->stopAnimating(FALSE);
+ param->stopAnimating();
}
}
updateVisualParams();
- if (isSelf())
- {
- gAgent.sendAgentSetAppearance();
- }
}
else
{
@@ -2411,7 +2417,7 @@ void LLVOAvatar::idleUpdateAppearanceAnimation()
{
if (param->isTweakable())
{
- param->animate(morph_amt, FALSE);
+ param->animate(morph_amt);
}
}
}
@@ -2464,7 +2470,7 @@ void LLVOAvatar::idleUpdateLipSync(bool voice_enabled)
F32 ooh_weight = mOohMorph->getMinWeight()
+ ooh_morph_amount * (mOohMorph->getMaxWeight() - mOohMorph->getMinWeight());
- mOohMorph->setWeight( ooh_weight, FALSE );
+ mOohMorph->setWeight( ooh_weight);
}
if( mAahMorph )
@@ -2472,7 +2478,7 @@ void LLVOAvatar::idleUpdateLipSync(bool voice_enabled)
F32 aah_weight = mAahMorph->getMinWeight()
+ aah_morph_amount * (mAahMorph->getMaxWeight() - mAahMorph->getMinWeight());
- mAahMorph->setWeight( aah_weight, FALSE );
+ mAahMorph->setWeight( aah_weight);
}
mLipSyncActive = true;
@@ -2550,7 +2556,7 @@ void LLVOAvatar::idleUpdateWindEffect()
LLVector3 velocity = getVelocity();
F32 speed = velocity.length();
//RN: velocity varies too much frame to frame for this to work
- mRippleAccel.clearVec();//lerp(mRippleAccel, (velocity - mLastVel) * time_delta, LLCriticalDamp::getInterpolant(0.02f));
+ mRippleAccel.clearVec();//lerp(mRippleAccel, (velocity - mLastVel) * time_delta, LLSmoothInterpolation::getInterpolant(0.02f));
mLastVel = velocity;
LLVector4 wind;
wind.setVec(getRegion()->mWind.getVelocityNoisy(getPositionAgent(), 4.f) - velocity);
@@ -2573,11 +2579,11 @@ void LLVOAvatar::idleUpdateWindEffect()
F32 interp;
if (wind.mV[VW] > mWindVec.mV[VW])
{
- interp = LLCriticalDamp::getInterpolant(0.2f);
+ interp = LLSmoothInterpolation::getInterpolant(0.2f);
}
else
{
- interp = LLCriticalDamp::getInterpolant(0.4f);
+ interp = LLSmoothInterpolation::getInterpolant(0.4f);
}
mWindVec = lerp(mWindVec, wind, interp);
@@ -2989,6 +2995,8 @@ void LLVOAvatar::idleUpdateNameTagPosition(const LLVector3& root_pos_last)
local_camera_up.normalize();
local_camera_up = local_camera_up * inv_root_rot;
+
+ // position is based on head position, does not require mAvatarOffset here. - Nyx
LLVector3 avatar_ellipsoid(mBodySize.mV[VX] * 0.4f,
mBodySize.mV[VY] * 0.4f,
mBodySize.mV[VZ] * NAMETAG_VERT_OFFSET_WEIGHT);
@@ -3003,7 +3011,7 @@ void LLVOAvatar::idleUpdateNameTagPosition(const LLVector3& root_pos_last)
mTargetRootToHeadOffset = head_offset;
}
- mCurRootToHeadOffset = lerp(mCurRootToHeadOffset, mTargetRootToHeadOffset, LLCriticalDamp::getInterpolant(0.2f));
+ mCurRootToHeadOffset = lerp(mCurRootToHeadOffset, mTargetRootToHeadOffset, LLSmoothInterpolation::getInterpolant(0.2f));
LLVector3 name_position = mRoot->getLastWorldPosition() + (mCurRootToHeadOffset * root_rot);
name_position += (local_camera_up * root_rot) - (projected_vec(local_camera_at * root_rot, camera_to_av));
@@ -3168,7 +3176,10 @@ void LLVOAvatar::forceUpdateVisualMuteSettings()
// called on both your avatar and other avatars
//------------------------------------------------------------------------
BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
-{
+{
+ // clear debug text
+ mDebugText.clear();
+
if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"))
{
S32 central_bake_version = -1;
@@ -3182,7 +3193,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
isSelf() ? (all_local_downloaded ? "L" : "l") : "-",
all_baked_downloaded ? "B" : "b",
mUseLocalAppearance, mIsEditingAppearance,
- mUseServerBakes, central_bake_version);
+ 1, central_bake_version);
std::string origin_string = bakedTextureOriginInfo();
debug_line += " [" + origin_string + "]";
S32 curr_cof_version = LLAppearanceMgr::instance().getCOFVersion();
@@ -3324,7 +3335,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
removeAnimationData("Walk Speed");
}
mMotionController.setTimeStep(time_step);
-// llinfos << "Setting timestep to " << time_quantum * pixel_area_scale << llendl;
+// LL_INFOS() << "Setting timestep to " << time_quantum * pixel_area_scale << LL_ENDL;
}
if (getParent() && !mIsSitting)
@@ -3544,7 +3555,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
// Set the root rotation, but do so incrementally so that it
// lags in time by some fixed amount.
- //F32 u = LLCriticalDamp::getInterpolant(PELVIS_LAG);
+ //F32 u = LLSmoothInterpolation::getInterpolant(PELVIS_LAG);
F32 pelvis_lag_time = 0.f;
if (self_in_mouselook)
{
@@ -3682,6 +3693,9 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
//mesh vertices need to be reskinned
mNeedsSkin = TRUE;
+
+
+
return TRUE;
}
//-----------------------------------------------------------------------------
@@ -3715,9 +3729,9 @@ void LLVOAvatar::setPelvisOffset( bool hasOffset, const LLVector3& offsetAmount,
{
mHasPelvisOffset = hasOffset;
if ( mHasPelvisOffset )
- {
+ {
//Store off last pelvis to foot value
- mLastPelvisToFoot = mPelvisToFoot;
+ mLastPelvisToFoot = mPelvisToFoot;
mPelvisOffset = offsetAmount;
mLastPelvisFixup = mPelvisFixup;
mPelvisFixup = pelvisFixup;
@@ -3727,18 +3741,16 @@ void LLVOAvatar::setPelvisOffset( bool hasOffset, const LLVector3& offsetAmount,
// postPelvisSetRecalc
//------------------------------------------------------------------------
void LLVOAvatar::postPelvisSetRecalc( void )
-{
- computeBodySize();
- mRoot->touch();
- mRoot->updateWorldMatrixChildren();
- dirtyMesh();
- updateHeadOffset();
+{
+ mRoot->updateWorldMatrixChildren();
+ computeBodySize();
+ dirtyMesh(2);
}
//------------------------------------------------------------------------
-// pelisPoke
+// setPelvisOffset
//------------------------------------------------------------------------
void LLVOAvatar::setPelvisOffset( F32 pelvisFixupAmount )
-{
+{
mHasPelvisOffset = true;
mLastPelvisFixup = mPelvisFixup;
mPelvisFixup = pelvisFixupAmount;
@@ -3790,42 +3802,42 @@ void LLVOAvatar::updateVisibility()
}
else
{
- llinfos << "Avatar " << this << " updating visiblity" << llendl;
+ LL_INFOS() << "Avatar " << this << " updating visiblity" << LL_ENDL;
}
if (visible)
{
- llinfos << "Visible" << llendl;
+ LL_INFOS() << "Visible" << LL_ENDL;
}
else
{
- llinfos << "Not visible" << llendl;
+ LL_INFOS() << "Not visible" << LL_ENDL;
}
/*if (avatar_in_frustum)
{
- llinfos << "Avatar in frustum" << llendl;
+ LL_INFOS() << "Avatar in frustum" << LL_ENDL;
}
else
{
- llinfos << "Avatar not in frustum" << llendl;
+ LL_INFOS() << "Avatar not in frustum" << LL_ENDL;
}*/
/*if (LLViewerCamera::getInstance()->sphereInFrustum(sel_pos_agent, 2.0f))
{
- llinfos << "Sel pos visible" << llendl;
+ LL_INFOS() << "Sel pos visible" << LL_ENDL;
}
if (LLViewerCamera::getInstance()->sphereInFrustum(wrist_right_pos_agent, 0.2f))
{
- llinfos << "Wrist pos visible" << llendl;
+ LL_INFOS() << "Wrist pos visible" << LL_ENDL;
}
if (LLViewerCamera::getInstance()->sphereInFrustum(getPositionAgent(), getMaxScale()*2.f))
{
- llinfos << "Agent visible" << llendl;
+ LL_INFOS() << "Agent visible" << LL_ENDL;
}*/
- llinfos << "PA: " << getPositionAgent() << llendl;
- /*llinfos << "SPA: " << sel_pos_agent << llendl;
- llinfos << "WPA: " << wrist_right_pos_agent << llendl;*/
+ LL_INFOS() << "PA: " << getPositionAgent() << LL_ENDL;
+ /*LL_INFOS() << "SPA: " << sel_pos_agent << LL_ENDL;
+ LL_INFOS() << "WPA: " << wrist_right_pos_agent << LL_ENDL;*/
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
++iter)
@@ -3840,11 +3852,11 @@ void LLVOAvatar::updateVisibility()
{
if(attached_object->mDrawable->isVisible())
{
- llinfos << attachment->getName() << " visible" << llendl;
+ LL_INFOS() << attachment->getName() << " visible" << LL_ENDL;
}
else
{
- llinfos << attachment->getName() << " not visible at " << mDrawable->getWorldPosition() << " and radius " << mDrawable->getRadius() << llendl;
+ LL_INFOS() << attachment->getName() << " not visible at " << mDrawable->getWorldPosition() << " and radius " << mDrawable->getRadius() << LL_ENDL;
}
}
}
@@ -3888,7 +3900,7 @@ bool LLVOAvatar::shouldAlphaMask()
//-----------------------------------------------------------------------------
// renderSkinned()
//-----------------------------------------------------------------------------
-U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass)
+U32 LLVOAvatar::renderSkinned()
{
U32 num_indices = 0;
@@ -3984,19 +3996,19 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass)
}
else
{
- llinfos << "Avatar " << this << " in render" << llendl;
+ LL_INFOS() << "Avatar " << this << " in render" << LL_ENDL;
}
if (!mIsBuilt)
{
- llinfos << "Not built!" << llendl;
+ LL_INFOS() << "Not built!" << LL_ENDL;
}
else if (!gAgent.needsRenderAvatar())
{
- llinfos << "Doesn't need avatar render!" << llendl;
+ LL_INFOS() << "Doesn't need avatar render!" << LL_ENDL;
}
else
{
- llinfos << "Rendering!" << llendl;
+ LL_INFOS() << "Rendering!" << LL_ENDL;
}
}
@@ -4049,12 +4061,6 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass)
//--------------------------------------------------------------------
// render all geometry attached to the skeleton
//--------------------------------------------------------------------
- static LLStat render_stat;
-
- LLViewerJointMesh::sRenderPass = pass;
-
- if (pass == AVATAR_RENDER_PASS_SINGLE)
- {
bool should_alpha_mask = shouldAlphaMask();
LLGLState test(GL_ALPHA_TEST, should_alpha_mask);
@@ -4113,13 +4119,6 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass)
LLGLState test(GL_ALPHA_TEST, !mIsDummy);
num_indices += renderTransparent(first_pass);
}
- }
-
- LLViewerJointMesh::sRenderPass = AVATAR_RENDER_PASS_SINGLE;
-
- //llinfos << "Avatar render: " << render_timer.getElapsedTimeF32() << llendl;
-
- //render_stat.addValue(render_timer.getElapsedTimeF32()*1000.f);
return num_indices;
}
@@ -4162,7 +4161,7 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass)
{
LLViewerJoint* hair_mesh = getViewerJoint(MESH_ID_HAIR);
if (hair_mesh)
- {
+ {
num_indices += hair_mesh->render(mAdjustedPixelArea, first_pass, mIsDummy);
}
first_pass = FALSE;
@@ -4172,7 +4171,7 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass)
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
}
}
-
+
return num_indices;
}
@@ -4291,34 +4290,6 @@ bool LLVOAvatar::allBakedTexturesCompletelyDownloaded() const
return allTexturesCompletelyDownloaded(baked_ids);
}
-void LLVOAvatar::bakedTextureOriginCounts(S32 &sb_count, // server-bake, has origin URL.
- S32 &host_count, // host-based bake, has host.
- S32 &both_count, // error - both host and URL set.
- S32 &neither_count) // error - neither set.
-{
- sb_count = host_count = both_count = neither_count = 0;
-
- std::set<LLUUID> baked_ids;
- collectBakedTextureUUIDs(baked_ids);
- for (std::set<LLUUID>::const_iterator it = baked_ids.begin(); it != baked_ids.end(); ++it)
- {
- LLViewerFetchedTexture *imagep = gTextureList.findImage(*it);
- bool has_url = false, has_host = false;
- if (!imagep->getUrl().empty())
- {
- has_url = true;
- }
- if (imagep->getTargetHost().isOk())
- {
- has_host = true;
- }
- if (has_url && !has_host) sb_count++;
- else if (has_host && !has_url) host_count++;
- else if (has_host && has_url) both_count++;
- else if (!has_host && !has_url) neither_count++;
- }
-}
-
std::string LLVOAvatar::bakedTextureOriginInfo()
{
std::string result;
@@ -4363,9 +4334,9 @@ std::string LLVOAvatar::bakedTextureOriginInfo()
return result;
}
-S32 LLVOAvatar::totalTextureMemForUUIDS(std::set<LLUUID>& ids)
+S32Bytes LLVOAvatar::totalTextureMemForUUIDS(std::set<LLUUID>& ids)
{
- S32 result = 0;
+ S32Bytes result(0);
for (std::set<LLUUID>::const_iterator it = ids.begin(); it != ids.end(); ++it)
{
LLViewerFetchedTexture *imagep = gTextureList.findImage(*it);
@@ -4430,12 +4401,12 @@ void LLVOAvatar::collectTextureUUIDs(std::set<LLUUID>& ids)
void LLVOAvatar::releaseOldTextures()
{
- S32 current_texture_mem = 0;
+ S32Bytes current_texture_mem;
// Any textures that we used to be using but are no longer using should no longer be flagged as "NO_DELETE"
std::set<LLUUID> baked_texture_ids;
collectBakedTextureUUIDs(baked_texture_ids);
- S32 new_baked_mem = totalTextureMemForUUIDS(baked_texture_ids);
+ S32Bytes new_baked_mem = totalTextureMemForUUIDS(baked_texture_ids);
std::set<LLUUID> local_texture_ids;
collectLocalTextureUUIDs(local_texture_ids);
@@ -4444,13 +4415,13 @@ void LLVOAvatar::releaseOldTextures()
std::set<LLUUID> new_texture_ids;
new_texture_ids.insert(baked_texture_ids.begin(),baked_texture_ids.end());
new_texture_ids.insert(local_texture_ids.begin(),local_texture_ids.end());
- S32 new_total_mem = totalTextureMemForUUIDS(new_texture_ids);
+ S32Bytes new_total_mem = totalTextureMemForUUIDS(new_texture_ids);
//S32 old_total_mem = totalTextureMemForUUIDS(mTextureIDs);
- //LL_DEBUGS("Avatar") << getFullname() << " old_total_mem: " << old_total_mem << " new_total_mem (L/B): " << new_total_mem << " (" << new_local_mem <<", " << new_baked_mem << ")" << llendl;
+ //LL_DEBUGS("Avatar") << getFullname() << " old_total_mem: " << old_total_mem << " new_total_mem (L/B): " << new_total_mem << " (" << new_local_mem <<", " << new_baked_mem << ")" << LL_ENDL;
if (!isSelf() && new_total_mem > new_baked_mem)
{
- llwarns << "extra local textures stored for non-self av" << llendl;
+ LL_WARNS() << "extra local textures stored for non-self av" << LL_ENDL;
}
for (std::set<LLUUID>::iterator it = mTextureIDs.begin(); it != mTextureIDs.end(); ++it)
{
@@ -4538,7 +4509,7 @@ void LLVOAvatar::updateTextures()
}
else
{
- llwarns << "getTE( " << texture_index << " ) returned 0" <<llendl;
+ LL_WARNS() << "getTE( " << texture_index << " ) returned 0" <<LL_ENDL;
}
LLViewerFetchedTexture *imagep = NULL;
@@ -4559,19 +4530,6 @@ void LLVOAvatar::updateTextures()
{
const S32 boost_level = getAvatarBakedBoostLevel();
imagep = LLViewerTextureManager::staticCastToFetchedTexture(getImage(texture_index,0), TRUE);
- // Spam if this is a baked texture, not set to default image, without valid host info
- if (isIndexBakedTexture((ETextureIndex)texture_index)
- && imagep->getID() != IMG_DEFAULT_AVATAR
- && imagep->getID() != IMG_INVISIBLE
- && !isUsingServerBakes()
- && !imagep->getTargetHost().isOk())
- {
- LL_WARNS_ONCE("Texture") << "LLVOAvatar::updateTextures No host for texture "
- << imagep->getID() << " for avatar "
- << (isSelf() ? "<myself>" : getID().asString())
- << " on host " << getRegion()->getHost() << llendl;
- }
-
addBakedTextureStats( imagep, mPixelArea, texel_area_ratio, boost_level );
}
}
@@ -4591,7 +4549,7 @@ void LLVOAvatar::addLocalTextureStats( ETextureIndex idx, LLViewerFetchedTexture
}
const S32 MAX_TEXTURE_UPDATE_INTERVAL = 64 ; //need to call updateTextures() at least every 32 frames.
-const S32 MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL = S32_MAX ; //frames
+const S32 MAX_TEXTURE_VIRTUAL_SIZE_RESET_INTERVAL = S32_MAX ; //frames
void LLVOAvatar::checkTextureLoading()
{
static const F32 MAX_INVISIBLE_WAITING_TIME = 15.f ; //seconds
@@ -4654,11 +4612,11 @@ const F32 ADDITIONAL_PRI = 0.5f;
void LLVOAvatar::addBakedTextureStats( LLViewerFetchedTexture* imagep, F32 pixel_area, F32 texel_area_ratio, S32 boost_level)
{
//Note:
- //if this function is not called for the last MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL frames,
+ //if this function is not called for the last MAX_TEXTURE_VIRTUAL_SIZE_RESET_INTERVAL frames,
//the texture pipeline will stop fetching this texture.
imagep->resetTextureStats();
- imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL);
+ imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTUAL_SIZE_RESET_INTERVAL);
imagep->resetMaxVirtualSizeResetCounter() ;
mMaxPixelArea = llmax(pixel_area, mMaxPixelArea);
@@ -4703,22 +4661,19 @@ const std::string LLVOAvatar::getImageURL(const U8 te, const LLUUID &uuid)
{
llassert(isIndexBakedTexture(ETextureIndex(te)));
std::string url = "";
- if (isUsingServerBakes())
+ const std::string& appearance_service_url = LLAppearanceMgr::instance().getAppearanceServiceURL();
+ if (appearance_service_url.empty())
{
- const std::string& appearance_service_url = LLAppearanceMgr::instance().getAppearanceServiceURL();
- if (appearance_service_url.empty())
- {
- // Probably a server-side issue if we get here:
- llwarns << "AgentAppearanceServiceURL not set - Baked texture requests will fail" << llendl;
- return url;
- }
+ // Probably a server-side issue if we get here:
+ LL_WARNS() << "AgentAppearanceServiceURL not set - Baked texture requests will fail" << LL_ENDL;
+ return url;
+ }
- const LLAvatarAppearanceDictionary::TextureEntry* texture_entry = LLAvatarAppearanceDictionary::getInstance()->getTexture((ETextureIndex)te);
- if (texture_entry != NULL)
- {
- url = appearance_service_url + "texture/" + getID().asString() + "/" + texture_entry->mDefaultImageName + "/" + uuid.asString();
- //llinfos << "baked texture url: " << url << llendl;
- }
+ const LLAvatarAppearanceDictionary::TextureEntry* texture_entry = LLAvatarAppearanceDictionary::getInstance()->getTexture((ETextureIndex)te);
+ if (texture_entry != NULL)
+ {
+ url = appearance_service_url + "texture/" + getID().asString() + "/" + texture_entry->mDefaultImageName + "/" + uuid.asString();
+ //LL_INFOS() << "baked texture url: " << url << LL_ENDL;
}
return url;
}
@@ -4767,7 +4722,7 @@ void LLVOAvatar::resolveHeightGlobal(const LLVector3d &inPos, LLVector3d &outPos
LLVector3 relativePos = gAgent.getPosAgentFromGlobal(outPos) - obj->getPositionAgent();
LLVector3 linearComponent = angularVelocity % relativePos;
-// llinfos << "Linear Component of Rotation Velocity " << linearComponent << llendl;
+// LL_INFOS() << "Linear Component of Rotation Velocity " << linearComponent << LL_ENDL;
mStepObjectVelocity = obj->getVelocity() + linearComponent;
}
}
@@ -4920,7 +4875,7 @@ BOOL LLVOAvatar::processSingleAnimationStateChange( const LLUUID& anim_id, BOOL
}
else
{
- llwarns << "Failed to start motion!" << llendl;
+ LL_WARNS() << "Failed to start motion!" << LL_ENDL;
}
}
else //stop animation
@@ -5016,13 +4971,13 @@ LLUUID LLVOAvatar::remapMotionID(const LLUUID& id)
//-----------------------------------------------------------------------------
BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset)
{
- lldebugs << "motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << llendl;
+ LL_DEBUGS() << "motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << LL_ENDL;
LLUUID remap_id = remapMotionID(id);
if (remap_id != id)
{
- lldebugs << "motion resultant " << remap_id.asString() << " " << gAnimLibrary.animationName(remap_id) << llendl;
+ LL_DEBUGS() << "motion resultant " << remap_id.asString() << " " << gAnimLibrary.animationName(remap_id) << LL_ENDL;
}
if (isSelf() && remap_id == ANIM_AGENT_AWAY)
@@ -5038,13 +4993,13 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset)
//-----------------------------------------------------------------------------
BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate)
{
- lldebugs << "motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << llendl;
+ LL_DEBUGS() << "motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << LL_ENDL;
LLUUID remap_id = remapMotionID(id);
if (remap_id != id)
{
- lldebugs << "motion resultant " << remap_id.asString() << " " << gAnimLibrary.animationName(remap_id) << llendl;
+ LL_DEBUGS() << "motion resultant " << remap_id.asString() << " " << gAnimLibrary.animationName(remap_id) << LL_ENDL;
}
if (isSelf())
@@ -5102,70 +5057,39 @@ LLJoint *LLVOAvatar::getJoint( const std::string &name )
return jointp;
}
-
-//-----------------------------------------------------------------------------
-// resetJointPositions
-//-----------------------------------------------------------------------------
-void LLVOAvatar::resetJointPositions( void )
-{
- avatar_joint_list_t::iterator iter = mSkeleton.begin();
- avatar_joint_list_t::iterator end = mSkeleton.end();
- for (; iter != end; ++iter)
- {
- (*iter)->restoreOldXform();
- (*iter)->setId( LLUUID::null );
- }
- mHasPelvisOffset = false;
- mPelvisFixup = mLastPelvisFixup;
-}
-//-----------------------------------------------------------------------------
-// resetSpecificJointPosition
-//-----------------------------------------------------------------------------
-void LLVOAvatar::resetSpecificJointPosition( const std::string& name )
-{
- LLJoint* pJoint = mRoot->findJoint( name );
-
- if ( pJoint && pJoint->doesJointNeedToBeReset() )
- {
- pJoint->restoreOldXform();
- pJoint->setId( LLUUID::null );
- //If we're reseting the pelvis position make sure not to apply offset
- if ( name == "mPelvis" )
- {
- mHasPelvisOffset = false;
- }
- }
- else
- {
- llinfos<<"Did not find "<< name.c_str()<<llendl;
- }
-}
//-----------------------------------------------------------------------------
// resetJointPositionsToDefault
//-----------------------------------------------------------------------------
void LLVOAvatar::resetJointPositionsToDefault( void )
-{
+{
//Subsequent joints are relative to pelvis
avatar_joint_list_t::iterator iter = mSkeleton.begin();
avatar_joint_list_t::iterator end = mSkeleton.end();
+
+ LLJoint* pJointPelvis = getJoint("mPelvis");
+
for (; iter != end; ++iter)
{
LLJoint* pJoint = (*iter);
- if ( pJoint->doesJointNeedToBeReset() )
+ //Reset joints except for pelvis
+ if ( pJoint && pJoint != pJointPelvis && pJoint->doesJointNeedToBeReset() )
+ {
+ pJoint->setId( LLUUID::null );
+ pJoint->restoreOldXform();
+ }
+ else
+ if ( pJoint && pJoint == pJointPelvis && pJoint->doesJointNeedToBeReset() )
{
pJoint->setId( LLUUID::null );
- //restore joints to default positions, however skip over the pelvis
- // *TODO: How does this pointer check skip over pelvis?
- if ( pJoint )
- {
- pJoint->restoreOldXform();
- }
- }
- }
+ pJoint->setPosition( LLVector3( 0.0f, 0.0f, 0.0f) );
+ pJoint->setJointResetFlag( false );
+ }
+ }
+
//make sure we don't apply the joint offset
mHasPelvisOffset = false;
mPelvisFixup = mLastPelvisFixup;
- postPelvisSetRecalc();
+ postPelvisSetRecalc();
}
//-----------------------------------------------------------------------------
// getCharacterPosition()
@@ -5289,9 +5213,9 @@ BOOL LLVOAvatar::loadSkeletonNode ()
{
if (!LLAvatarAppearance::loadSkeletonNode())
{
- return FALSE;
- }
-
+ return FALSE;
+ }
+
// ATTACHMENTS
{
LLAvatarXmlInfo::attachment_info_list_t::iterator iter;
@@ -5311,7 +5235,7 @@ BOOL LLVOAvatar::loadSkeletonNode ()
LLJoint *parentJoint = getJoint(info->mJointName);
if (!parentJoint)
{
- llwarns << "No parent joint by name " << info->mJointName << " found for attachment point " << info->mName << llendl;
+ LL_WARNS() << "No parent joint by name " << info->mJointName << " found for attachment point " << info->mName << LL_ENDL;
delete attachment;
continue;
}
@@ -5320,7 +5244,7 @@ BOOL LLVOAvatar::loadSkeletonNode ()
{
attachment->setOriginalPosition(info->mPosition);
}
-
+
if (info->mHasRotation)
{
LLQuaternion rotation;
@@ -5335,7 +5259,7 @@ BOOL LLVOAvatar::loadSkeletonNode ()
{
if (group < 0 || group >= 9)
{
- llwarns << "Invalid group number (" << group << ") for attachment point " << info->mName << llendl;
+ LL_WARNS() << "Invalid group number (" << group << ") for attachment point " << info->mName << LL_ENDL;
}
else
{
@@ -5346,13 +5270,13 @@ BOOL LLVOAvatar::loadSkeletonNode ()
S32 attachmentID = info->mAttachmentID;
if (attachmentID < 1 || attachmentID > 255)
{
- llwarns << "Attachment point out of range [1-255]: " << attachmentID << " on attachment point " << info->mName << llendl;
+ LL_WARNS() << "Attachment point out of range [1-255]: " << attachmentID << " on attachment point " << info->mName << LL_ENDL;
delete attachment;
continue;
}
if (mAttachmentPoints.find(attachmentID) != mAttachmentPoints.end())
{
- llwarns << "Attachment point redefined with id " << attachmentID << " on attachment point " << info->mName << llendl;
+ LL_WARNS() << "Attachment point redefined with id " << attachmentID << " on attachment point " << info->mName << LL_ENDL;
delete attachment;
continue;
}
@@ -5390,7 +5314,6 @@ void LLVOAvatar::updateVisualParams()
dirtyMesh();
updateHeadOffset();
}
-
//-----------------------------------------------------------------------------
// isActive()
//-----------------------------------------------------------------------------
@@ -5522,10 +5445,10 @@ void LLVOAvatar::updateGL()
//-----------------------------------------------------------------------------
// updateGeometry()
//-----------------------------------------------------------------------------
-static LLFastTimer::DeclareTimer FTM_UPDATE_AVATAR("Update Avatar");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_AVATAR("Update Avatar");
BOOL LLVOAvatar::updateGeometry(LLDrawable *drawable)
{
- LLFastTimer ftm(FTM_UPDATE_AVATAR);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_AVATAR);
if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_AVATAR)))
{
return TRUE;
@@ -5538,7 +5461,7 @@ BOOL LLVOAvatar::updateGeometry(LLDrawable *drawable)
if (!drawable)
{
- llerrs << "LLVOAvatar::updateGeometry() called with NULL drawable" << llendl;
+ LL_ERRS() << "LLVOAvatar::updateGeometry() called with NULL drawable" << LL_ENDL;
}
return TRUE;
@@ -5547,11 +5470,11 @@ BOOL LLVOAvatar::updateGeometry(LLDrawable *drawable)
//-----------------------------------------------------------------------------
// updateSexDependentLayerSets()
//-----------------------------------------------------------------------------
-void LLVOAvatar::updateSexDependentLayerSets( BOOL upload_bake )
+void LLVOAvatar::updateSexDependentLayerSets()
{
- invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet, upload_bake );
- invalidateComposite( mBakedTextureDatas[BAKED_UPPER].mTexLayerSet, upload_bake );
- invalidateComposite( mBakedTextureDatas[BAKED_LOWER].mTexLayerSet, upload_bake );
+ invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet);
+ invalidateComposite( mBakedTextureDatas[BAKED_UPPER].mTexLayerSet);
+ invalidateComposite( mBakedTextureDatas[BAKED_LOWER].mTexLayerSet);
}
//-----------------------------------------------------------------------------
@@ -5613,10 +5536,10 @@ void LLVOAvatar::addChild(LLViewerObject *childp)
{
if (!attachObject(childp))
{
- llwarns << "addChild() failed for "
+ LL_WARNS() << "addChild() failed for "
<< childp->getID()
<< " item " << childp->getAttachmentItemID()
- << llendl;
+ << LL_ENDL;
// MAINT-3312 backout
// mPendingAttachment.push_back(childp);
}
@@ -5632,7 +5555,7 @@ void LLVOAvatar::removeChild(LLViewerObject *childp)
LLViewerObject::removeChild(childp);
if (!detachObject(childp))
{
- llwarns << "Calling detach on non-attached object " << llendl;
+ LL_WARNS() << "Calling detach on non-attached object " << LL_ENDL;
}
}
@@ -5644,7 +5567,7 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi
// correctly, but putting this check in here to be safe.
if (attachmentID & ATTACHMENT_ADD)
{
- llwarns << "Got an attachment with ATTACHMENT_ADD mask, removing ( attach pt:" << attachmentID << " )" << llendl;
+ LL_WARNS() << "Got an attachment with ATTACHMENT_ADD mask, removing ( attach pt:" << attachmentID << " )" << LL_ENDL;
attachmentID &= ~ATTACHMENT_ADD;
}
@@ -5652,26 +5575,26 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi
if (!attachment)
{
- llwarns << "Object attachment point invalid: " << attachmentID
+ LL_WARNS() << "Object attachment point invalid: " << attachmentID
<< " trying to use 1 (chest)"
- << llendl;
+ << LL_ENDL;
attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest)
if (attachment)
{
- llwarns << "Object attachment point invalid: " << attachmentID
+ LL_WARNS() << "Object attachment point invalid: " << attachmentID
<< " on object " << viewer_object->getID()
<< " attachment item " << viewer_object->getAttachmentItemID()
<< " falling back to 1 (chest)"
- << llendl;
+ << LL_ENDL;
}
else
{
- llwarns << "Object attachment point invalid: " << attachmentID
+ LL_WARNS() << "Object attachment point invalid: " << attachmentID
<< " on object " << viewer_object->getID()
<< " attachment item " << viewer_object->getAttachmentItemID()
<< "Unable to use fallback attachment point 1 (chest)"
- << llendl;
+ << LL_ENDL;
}
}
@@ -5748,10 +5671,10 @@ void LLVOAvatar::lazyAttach()
{
if (!attachObject(cur_attachment))
{ // Drop it
- llwarns << "attachObject() failed for "
+ LL_WARNS() << "attachObject() failed for "
<< cur_attachment->getID()
<< " item " << cur_attachment->getAttachmentItemID()
- << llendl;
+ << LL_ENDL;
// MAINT-3312 backout
//still_pending.push_back(cur_attachment);
}
@@ -5767,6 +5690,7 @@ void LLVOAvatar::lazyAttach()
void LLVOAvatar::resetHUDAttachments()
{
+
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
++iter)
@@ -5819,10 +5743,10 @@ void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO )
{
const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( pVObj->getVolume()->getParams().getSculptID(), pVObj );
if (pSkinData
- && pSkinData->mJointNames.size() > 20 // full rig
- && pSkinData->mAlternateBindMatrix.size() > 0)
- {
- LLVOAvatar::resetJointPositionsToDefault();
+ && pSkinData->mJointNames.size() > JOINT_COUNT_REQUIRED_FOR_FULLRIG // full rig
+ && pSkinData->mAlternateBindMatrix.size() > 0 )
+ {
+ LLVOAvatar::resetJointPositionsToDefault();
//Need to handle the repositioning of the cam, updating rig data etc during outfit editing
//This handles the case where we detach a replacement rig.
if ( gAgentCamera.cameraCustomizeAvatar() )
@@ -5834,13 +5758,14 @@ void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO )
}
}
}
-}
+ }
//-----------------------------------------------------------------------------
// detachObject()
//-----------------------------------------------------------------------------
BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object)
{
+
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
++iter)
@@ -5851,8 +5776,9 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object)
{
mVisualComplexityStale = TRUE;
cleanupAttachedMesh( viewer_object );
+
attachment->removeObject(viewer_object);
- lldebugs << "Detaching object " << viewer_object->mID << " from " << attachment->getName() << llendl;
+ LL_DEBUGS() << "Detaching object " << viewer_object->mID << " from " << attachment->getName() << LL_ENDL;
return TRUE;
}
}
@@ -6048,24 +5974,22 @@ BOOL LLVOAvatar::isWearingWearableType(LLWearableType::EType type) const
{
const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = tex_iter->second;
if (texture_dict->mWearableType == type)
- {
+ {
// Thus, you must check to see if the corresponding baked texture is defined.
// NOTE: this is a poor substitute if you actually want to know about individual pieces of clothing
// this works for detecting a skirt (most important), but is ineffective at any piece of clothing that
// gets baked into a texture that always exists (upper or lower).
if (texture_dict->mIsUsedByBakedTexture)
- {
+ {
const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex;
return isTextureDefined(LLAvatarAppearanceDictionary::getInstance()->getBakedTexture(baked_index)->mTextureIndex);
- }
+ }
return FALSE;
- }
+ }
}
return FALSE;
}
-
-
LLViewerObject * LLVOAvatar::findAttachmentByID( const LLUUID & target_id ) const
{
for(attachment_map_t::const_iterator attachment_points_iter = mAttachmentPoints.begin();
@@ -6089,9 +6013,8 @@ LLViewerObject * LLVOAvatar::findAttachmentByID( const LLUUID & target_id ) cons
return NULL;
}
-
// virtual
-void LLVOAvatar::invalidateComposite( LLTexLayerSet* layerset, BOOL upload_result )
+void LLVOAvatar::invalidateComposite( LLTexLayerSet* layerset)
{
}
@@ -6100,18 +6023,18 @@ void LLVOAvatar::invalidateAll()
}
// virtual
-void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake )
+void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color)
{
if (global_color == mTexSkinColor)
{
- invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet, upload_bake );
- invalidateComposite( mBakedTextureDatas[BAKED_UPPER].mTexLayerSet, upload_bake );
- invalidateComposite( mBakedTextureDatas[BAKED_LOWER].mTexLayerSet, upload_bake );
+ invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet);
+ invalidateComposite( mBakedTextureDatas[BAKED_UPPER].mTexLayerSet);
+ invalidateComposite( mBakedTextureDatas[BAKED_LOWER].mTexLayerSet);
}
else if (global_color == mTexHairColor)
{
- invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet, upload_bake );
- invalidateComposite( mBakedTextureDatas[BAKED_HAIR].mTexLayerSet, upload_bake );
+ invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet);
+ invalidateComposite( mBakedTextureDatas[BAKED_HAIR].mTexLayerSet);
// ! BACKWARDS COMPATIBILITY !
// Fix for dealing with avatars from viewers that don't bake hair.
@@ -6124,7 +6047,7 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL
{
LLAvatarJointMesh* mesh = (*iter);
if (mesh)
- {
+ {
mesh->setColor( color );
}
}
@@ -6132,8 +6055,8 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL
}
else if (global_color == mTexEyeColor)
{
-// llinfos << "invalidateComposite cause: onGlobalColorChanged( eyecolor )" << llendl;
- invalidateComposite( mBakedTextureDatas[BAKED_EYES].mTexLayerSet, upload_bake );
+// LL_INFOS() << "invalidateComposite cause: onGlobalColorChanged( eyecolor )" << LL_ENDL;
+ invalidateComposite( mBakedTextureDatas[BAKED_EYES].mTexLayerSet);
}
updateMeshTextures();
}
@@ -6192,9 +6115,9 @@ void LLVOAvatar::updateRezzedStatusTimers()
{
// load level has decreased. start phase timers for higher load levels.
for (S32 i = rez_status+1; i <= mLastRezzedStatus; i++)
- {
+ {
startPhase("load_" + LLVOAvatar::rezStatusToString(i));
- }
+ }
}
else if (rez_status > mLastRezzedStatus)
{
@@ -6203,16 +6126,16 @@ void LLVOAvatar::updateRezzedStatusTimers()
{
stopPhase("load_" + LLVOAvatar::rezStatusToString(i));
stopPhase("first_load_" + LLVOAvatar::rezStatusToString(i), false);
- }
+ }
if (rez_status == 3)
- {
+ {
// "fully loaded", mark any pending appearance change complete.
selfStopPhase("update_appearance_from_cof");
selfStopPhase("wear_inventory_category", false);
selfStopPhase("process_initial_wearables_update", false);
}
}
-
+
mLastRezzedStatus = rez_status;
}
}
@@ -6224,24 +6147,27 @@ void LLVOAvatar::clearPhases()
void LLVOAvatar::startPhase(const std::string& phase_name)
{
- F32 elapsed;
- bool completed;
- if (getPhases().getPhaseValues(phase_name, elapsed, completed))
+ F32 elapsed = 0.0;
+ bool completed = false;
+ bool found = getPhases().getPhaseValues(phase_name, elapsed, completed);
+ //LL_DEBUGS("Avatar") << avString() << " phase state " << phase_name
+ // << " found " << found << " elapsed " << elapsed << " completed " << completed << LL_ENDL;
+ if (found)
{
if (!completed)
{
- LL_DEBUGS("Avatar") << avString() << "no-op, start when started already for " << phase_name << llendl;
+ LL_DEBUGS("Avatar") << avString() << "no-op, start when started already for " << phase_name << LL_ENDL;
return;
}
}
- LL_DEBUGS("Avatar") << "started phase " << phase_name << llendl;
+ LL_DEBUGS("Avatar") << "started phase " << phase_name << LL_ENDL;
getPhases().startPhase(phase_name);
}
void LLVOAvatar::stopPhase(const std::string& phase_name, bool err_check)
{
- F32 elapsed;
- bool completed;
+ F32 elapsed = 0.0;
+ bool completed = false;
if (getPhases().getPhaseValues(phase_name, elapsed, completed))
{
if (!completed)
@@ -6249,13 +6175,13 @@ void LLVOAvatar::stopPhase(const std::string& phase_name, bool err_check)
getPhases().stopPhase(phase_name);
completed = true;
logMetricsTimerRecord(phase_name, elapsed, completed);
- LL_DEBUGS("Avatar") << avString() << "stopped phase " << phase_name << " elapsed " << elapsed << llendl;
+ LL_DEBUGS("Avatar") << avString() << "stopped phase " << phase_name << " elapsed " << elapsed << LL_ENDL;
}
else
{
if (err_check)
{
- LL_DEBUGS("Avatar") << "no-op, stop when stopped already for " << phase_name << llendl;
+ LL_DEBUGS("Avatar") << "no-op, stop when stopped already for " << phase_name << LL_ENDL;
}
}
}
@@ -6263,7 +6189,7 @@ void LLVOAvatar::stopPhase(const std::string& phase_name, bool err_check)
{
if (err_check)
{
- LL_DEBUGS("Avatar") << "no-op, stop when not started for " << phase_name << llendl;
+ LL_DEBUGS("Avatar") << "no-op, stop when not started for " << phase_name << LL_ENDL;
}
}
}
@@ -6271,7 +6197,7 @@ void LLVOAvatar::stopPhase(const std::string& phase_name, bool err_check)
void LLVOAvatar::logPendingPhases()
{
if (!isAgentAvatarValid())
- {
+ {
return;
}
@@ -6287,14 +6213,14 @@ void LLVOAvatar::logPendingPhases()
if (!completed)
{
logMetricsTimerRecord(phase_name, elapsed, completed);
- }
+ }
}
}
-}
+ }
//static
void LLVOAvatar::logPendingPhasesAllAvatars()
-{
+ {
for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
iter != LLCharacter::sInstances.end(); ++iter)
{
@@ -6305,14 +6231,14 @@ void LLVOAvatar::logPendingPhasesAllAvatars()
}
inst->logPendingPhases();
}
-}
+ }
void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapsed, bool completed)
-{
+ {
if (!isAgentAvatarValid())
- {
+ {
return;
- }
+ }
LLSD record;
record["timer_name"] = phase_name;
@@ -6321,15 +6247,15 @@ void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapse
record["completed"] = completed;
U32 grid_x(0), grid_y(0);
if (getRegion())
- {
+ {
record["central_bake_version"] = LLSD::Integer(getRegion()->getCentralBakeVersion());
grid_from_region_handle(getRegion()->getHandle(), &grid_x, &grid_y);
- }
+ }
record["grid_x"] = LLSD::Integer(grid_x);
record["grid_y"] = LLSD::Integer(grid_y);
- record["is_using_server_bakes"] = ((bool) isUsingServerBakes());
+ record["is_using_server_bakes"] = true;
record["is_self"] = isSelf();
-
+
if (isAgentAvatarValid())
{
gAgentAvatarp->addMetricsTimerRecord(record);
@@ -6537,28 +6463,28 @@ void LLVOAvatar::updateMeshTextures()
use_lkg_baked_layer[i],
last_id_string.c_str());
}
-
+
for (U32 i=0; i < mBakedTextureDatas.size(); i++)
{
debugColorizeSubMeshes(i, LLColor4::white);
LLViewerTexLayerSet* layerset = getTexLayerSet(i);
if (use_lkg_baked_layer[i] && !isUsingLocalAppearance() )
- {
+ {
LLViewerFetchedTexture* baked_img = LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[i].mLastTextureID);
mBakedTextureDatas[i].mIsUsed = TRUE;
debugColorizeSubMeshes(i,LLColor4::red);
-
+
avatar_joint_mesh_list_t::iterator iter = mBakedTextureDatas[i].mJointMeshes.begin();
avatar_joint_mesh_list_t::iterator end = mBakedTextureDatas[i].mJointMeshes.end();
for (; iter != end; ++iter)
- {
+ {
LLAvatarJointMesh* mesh = (*iter);
if (mesh)
- {
+ {
mesh->setTexture( baked_img );
- }
+ }
}
}
else if (!isUsingLocalAppearance() && is_layer_baked[i])
@@ -6572,6 +6498,8 @@ void LLVOAvatar::updateMeshTextures()
// we'll consider it loaded and use it (rather than
// doing compositing).
useBakedTexture( baked_img->getID() );
+ mLoadedCallbacksPaused |= !isVisible();
+ checkTextureLoading();
}
else
{
@@ -6584,6 +6512,10 @@ void LLVOAvatar::updateMeshTextures()
}
baked_img->setLoadedCallback(onBakedTextureLoaded, SWITCH_TO_BAKED_DISCARD, FALSE, FALSE, new LLUUID( mID ),
src_callback_list, paused );
+
+ // this could add paused texture callbacks
+ mLoadedCallbacksPaused |= paused;
+ checkTextureLoading();
}
}
else if (layerset && isUsingLocalAppearance())
@@ -6602,7 +6534,7 @@ void LLVOAvatar::updateMeshTextures()
if (mesh)
{
mesh->setLayerSet( layerset );
- }
+ }
}
}
else
@@ -6624,7 +6556,7 @@ void LLVOAvatar::updateMeshTextures()
{
LLAvatarJointMesh* mesh = (*iter);
if (mesh)
- {
+ {
mesh->setColor( color );
mesh->setTexture( hair_img );
}
@@ -6714,24 +6646,22 @@ void LLVOAvatar::applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_com
{
if (index >= BAKED_NUM_INDICES)
{
- llwarns << "invalid baked texture index passed to applyMorphMask" << llendl;
+ LL_WARNS() << "invalid baked texture index passed to applyMorphMask" << LL_ENDL;
return;
}
for (morph_list_t::const_iterator iter = mBakedTextureDatas[index].mMaskedMorphs.begin();
iter != mBakedTextureDatas[index].mMaskedMorphs.end(); ++iter)
- {
+{
const LLMaskedMorph* maskedMorph = (*iter);
LLPolyMorphTarget* morph_target = dynamic_cast<LLPolyMorphTarget*>(maskedMorph->mMorphTarget);
if (morph_target)
- {
+ {
morph_target->applyMask(tex_data, width, height, num_components, maskedMorph->mInvert);
- }
+}
}
}
-
-
// returns TRUE if morph masks are present and not valid for a given baked texture, FALSE otherwise
BOOL LLVOAvatar::morphMaskNeedsUpdate(LLAvatarAppearanceDefines::EBakedTextureIndex index)
{
@@ -6883,7 +6813,7 @@ LLBBox LLVOAvatar::getHUDBBox() const
const LLViewerObject* attached_object = (*attachment_iter);
if (attached_object == NULL)
{
- llwarns << "HUD attached object is NULL!" << llendl;
+ LL_WARNS() << "HUD attached object is NULL!" << LL_ENDL;
continue;
}
// initialize bounding box to contain identity orientation and center point for attached object
@@ -6942,6 +6872,9 @@ void LLVOAvatar::onFirstTEMessageReceived()
LL_DEBUGS("Avatar") << avString() << "layer_baked, setting onInitialBakedTextureLoaded as callback" << LL_ENDL;
image->setLoadedCallback( onInitialBakedTextureLoaded, MAX_DISCARD_LEVEL, FALSE, FALSE, new LLUUID( mID ),
src_callback_list, paused );
+
+ // this could add paused texture callbacks
+ mLoadedCallbacksPaused |= paused;
}
}
@@ -6972,14 +6905,14 @@ bool LLVOAvatar::visualParamWeightsAreDefault()
// we have to not care whether skirt weights are default, if we're not actually wearing a skirt
(is_wearing_skirt || !is_skirt_param))
{
- //llinfos << "param '" << param->getName() << "'=" << param->getWeight() << " which differs from default=" << param->getDefaultWeight() << llendl;
+ //LL_INFOS() << "param '" << param->getName() << "'=" << param->getWeight() << " which differs from default=" << param->getDefaultWeight() << LL_ENDL;
rtn = false;
break;
}
}
}
- //llinfos << "params are default ? " << int(rtn) << llendl;
+ //LL_INFOS() << "params are default ? " << int(rtn) << LL_ENDL;
return rtn;
}
@@ -7009,12 +6942,12 @@ void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value)
LLWearableType::getTypeName(LLWearableType::EType(wtype)).c_str()
// param_location_name(vparam->getParamLocation()).c_str()
);
-}
-
+ }
+
void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix,
const LLAppearanceMessageContents& contents)
- {
+{
std::string outfilename = get_sequential_numbered_file_name(dump_prefix,".xml");
const std::vector<F32>& params_for_dump = contents.mParamWeights;
const LLTEContents& tec = contents.mTEContents;
@@ -7024,12 +6957,12 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix,
outfile.open(fullpath, LL_APR_WB );
apr_file_t* file = outfile.getFileHandle();
if (!file)
- {
- return;
- }
+ {
+ return;
+ }
else
{
- LL_DEBUGS("Avatar") << "dumping appearance message to " << fullpath << llendl;
+ LL_DEBUGS("Avatar") << "dumping appearance message to " << fullpath << LL_ENDL;
}
apr_file_printf(file, "<header>\n");
@@ -7041,7 +6974,8 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix,
LLVisualParam* param = getFirstVisualParam();
for (S32 i = 0; i < params_for_dump.size(); i++)
{
- while( param && (param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) ) // should not be any of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT
+ while( param && ((param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) &&
+ (param->getGroup() != VISUAL_PARAM_GROUP_TRANSMIT_NOT_TWEAKABLE)) ) // should not be any of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT
{
param = getNextVisualParam();
}
@@ -7060,7 +6994,7 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix,
apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", i, uuid_str.c_str());
}
apr_file_printf(file, "</textures>\n");
-}
+ }
void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMessageContents& contents)
{
@@ -7072,12 +7006,12 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe
U8 av_u8;
mesgsys->getU8Fast(_PREHASH_AppearanceData, _PREHASH_AppearanceVersion, av_u8, 0);
contents.mAppearanceVersion = av_u8;
- LL_DEBUGS("Avatar") << "appversion set by AppearanceData field: " << contents.mAppearanceVersion << llendl;
+ LL_DEBUGS("Avatar") << "appversion set by AppearanceData field: " << contents.mAppearanceVersion << LL_ENDL;
mesgsys->getS32Fast(_PREHASH_AppearanceData, _PREHASH_CofVersion, contents.mCOFVersion, 0);
// For future use:
//mesgsys->getU32Fast(_PREHASH_AppearanceData, _PREHASH_Flags, appearance_flags, 0);
}
-
+
// Parse visual params, if any.
S32 num_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_VisualParam);
bool drop_visual_params_debug = gSavedSettings.getBOOL("BlockSomeAvatarAppearanceVisualParams") && (ll_rand(2) == 0); // pretend that ~12% of AvatarAppearance messages arrived without a VisualParam block, for testing
@@ -7089,13 +7023,14 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe
llassert(param); // if this ever fires, we should do the same as when num_blocks<=1
if (!param)
{
- llwarns << "No visual params!" << llendl;
+ LL_WARNS() << "No visual params!" << LL_ENDL;
}
else
{
for( S32 i = 0; i < num_blocks; i++ )
{
- while( param && (param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) ) // should not be any of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT
+ while( param && ((param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) &&
+ (param->getGroup() != VISUAL_PARAM_GROUP_TRANSMIT_NOT_TWEAKABLE)) ) // should not be any of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT
{
param = getNextVisualParam();
}
@@ -7116,21 +7051,22 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe
}
}
- const S32 expected_tweakable_count = getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TWEAKABLE); // don't worry about VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT
+ const S32 expected_tweakable_count = getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TWEAKABLE) +
+ getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TRANSMIT_NOT_TWEAKABLE); // don't worry about VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT
if (num_blocks != expected_tweakable_count)
{
- LL_DEBUGS("Avatar") << "Number of params in AvatarAppearance msg (" << num_blocks << ") does not match number of tweakable params in avatar xml file (" << expected_tweakable_count << "). Processing what we can. object: " << getID() << llendl;
+ LL_DEBUGS("Avatar") << "Number of params in AvatarAppearance msg (" << num_blocks << ") does not match number of tweakable params in avatar xml file (" << expected_tweakable_count << "). Processing what we can. object: " << getID() << LL_ENDL;
}
}
else
{
if (drop_visual_params_debug)
{
- llinfos << "Debug-faked lack of parameters on AvatarAppearance for object: " << getID() << llendl;
+ LL_INFOS() << "Debug-faked lack of parameters on AvatarAppearance for object: " << getID() << LL_ENDL;
}
else
{
- LL_DEBUGS("Avatar") << "AvatarAppearance msg received without any parameters, object: " << getID() << llendl;
+ LL_DEBUGS("Avatar") << "AvatarAppearance msg received without any parameters, object: " << getID() << LL_ENDL;
}
}
@@ -7142,7 +7078,7 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe
{
S32 index = it - contents.mParams.begin();
contents.mParamAppearanceVersion = llround(contents.mParamWeights[index]);
- LL_DEBUGS("Avatar") << "appversion req by appearance_version param: " << contents.mParamAppearanceVersion << llendl;
+ LL_DEBUGS("Avatar") << "appversion req by appearance_version param: " << contents.mParamAppearanceVersion << LL_ENDL;
}
}
}
@@ -7155,25 +7091,25 @@ bool resolve_appearance_version(const LLAppearanceMessageContents& contents, S32
(contents.mParamAppearanceVersion >= 0) &&
(contents.mAppearanceVersion != contents.mParamAppearanceVersion))
{
- llwarns << "inconsistent appearance_version settings - field: " <<
- contents.mAppearanceVersion << ", param: " << contents.mParamAppearanceVersion << llendl;
+ LL_WARNS() << "inconsistent appearance_version settings - field: " <<
+ contents.mAppearanceVersion << ", param: " << contents.mParamAppearanceVersion << LL_ENDL;
return false;
}
if (contents.mParamAppearanceVersion >= 0) // use visual param if available.
{
appearance_version = contents.mParamAppearanceVersion;
}
- if (contents.mAppearanceVersion >= 0)
+ else if (contents.mAppearanceVersion > 0)
{
appearance_version = contents.mAppearanceVersion;
}
- if (appearance_version < 0) // still not set, go with 0.
+ else // still not set, go with 1.
{
- appearance_version = 0;
+ appearance_version = 1;
}
LL_DEBUGS("Avatar") << "appearance version info - field " << contents.mAppearanceVersion
<< " param: " << contents.mParamAppearanceVersion
- << " final: " << appearance_version << llendl;
+ << " final: " << appearance_version << LL_ENDL;
return true;
}
@@ -7182,13 +7118,13 @@ bool resolve_appearance_version(const LLAppearanceMessageContents& contents, S32
//-----------------------------------------------------------------------------
void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
{
- LL_DEBUGS("Avatar") << "starts" << llendl;
+ LL_DEBUGS("Avatar") << "starts" << LL_ENDL;
bool enable_verbose_dumps = gSavedSettings.getBOOL("DebugAvatarAppearanceMessage");
std::string dump_prefix = getFullname() + "_" + (isSelf()?"s":"o") + "_";
if (gSavedSettings.getBOOL("BlockAvatarAppearanceMessages"))
{
- llwarns << "Blocking AvatarAppearance message" << llendl;
+ LL_WARNS() << "Blocking AvatarAppearance message" << LL_ENDL;
return;
}
@@ -7204,49 +7140,46 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
S32 appearance_version;
if (!resolve_appearance_version(contents, appearance_version))
{
- llwarns << "bad appearance version info, discarding" << llendl;
+ LL_WARNS() << "bad appearance version info, discarding" << LL_ENDL;
+ return;
+ }
+ llassert(appearance_version > 0);
+ if (appearance_version > 1)
+ {
+ LL_WARNS() << "unsupported appearance version " << appearance_version << ", discarding appearance message" << LL_ENDL;
return;
}
+
S32 this_update_cof_version = contents.mCOFVersion;
S32 last_update_request_cof_version = mLastUpdateRequestCOFVersion;
- // Only now that we have result of appearance_version can we decide whether to bail out.
if( isSelf() )
{
LL_DEBUGS("Avatar") << "this_update_cof_version " << this_update_cof_version
<< " last_update_request_cof_version " << last_update_request_cof_version
- << " my_cof_version " << LLAppearanceMgr::instance().getCOFVersion() << llendl;
-
- if (getRegion() && (getRegion()->getCentralBakeVersion()==0))
- {
- llwarns << avString() << "Received AvatarAppearance message for self in non-server-bake region" << llendl;
- }
- if( mFirstTEMessageReceived && (appearance_version == 0))
- {
- return;
- }
+ << " my_cof_version " << LLAppearanceMgr::instance().getCOFVersion() << LL_ENDL;
}
else
{
- LL_DEBUGS("Avatar") << "appearance message received" << llendl;
+ LL_DEBUGS("Avatar") << "appearance message received" << LL_ENDL;
}
// Check for stale update.
if (isSelf()
- && (appearance_version>0)
&& (this_update_cof_version < last_update_request_cof_version))
{
- llwarns << "Stale appearance update, wanted version " << last_update_request_cof_version
- << ", got " << this_update_cof_version << llendl;
+ LL_WARNS() << "Stale appearance update, wanted version " << last_update_request_cof_version
+ << ", got " << this_update_cof_version << LL_ENDL;
return;
}
if (isSelf() && isEditingAppearance())
{
- LL_DEBUGS("Avatar") << "ignoring appearance message while in appearance edit" << llendl;
+ LL_DEBUGS("Avatar") << "ignoring appearance message while in appearance edit" << LL_ENDL;
return;
}
+ // SUNSHINE CLEANUP - is this case OK now?
S32 num_params = contents.mParamWeights.size();
if (num_params <= 1)
{
@@ -7254,14 +7187,18 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
// appearance version, which may cause us to look for baked
// textures in the wrong place and flag them as missing
// assets.
- LL_DEBUGS("Avatar") << "ignoring appearance message due to lack of params" << llendl;
+ LL_DEBUGS("Avatar") << "ignoring appearance message due to lack of params" << LL_ENDL;
return;
}
+ // No backsies zone - if we get here, the message should be valid and usable, will be processed.
+
+ // Note:
+ // RequestAgentUpdateAppearanceResponder::onRequestRequested()
+ // assumes that cof version is only updated with server-bake
+ // appearance messages.
mLastUpdateReceivedCOFVersion = this_update_cof_version;
- setIsUsingServerBakes(appearance_version > 0);
-
applyParsedTEMessage(contents.mTEContents);
// prevent the overwriting of valid baked textures with invalid baked textures
@@ -7271,9 +7208,15 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
&& mBakedTextureDatas[baked_index].mLastTextureID != IMG_DEFAULT
&& baked_index != BAKED_SKIRT)
{
+ LL_DEBUGS("Avatar") << avString() << " baked_index " << (S32) baked_index << " using mLastTextureID " << mBakedTextureDatas[baked_index].mLastTextureID << LL_ENDL;
setTEImage(mBakedTextureDatas[baked_index].mTextureIndex,
LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[baked_index].mLastTextureID, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE));
}
+ else
+ {
+ LL_DEBUGS("Avatar") << avString() << " baked_index " << (S32) baked_index << " using texture id "
+ << getTE(mBakedTextureDatas[baked_index].mTextureIndex)->getID() << LL_ENDL;
+ }
}
// runway - was
@@ -7299,6 +7242,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
LL_DEBUGS("Avatar") << avString() << " handle visual params, num_params " << num_params << LL_ENDL;
BOOL params_changed = FALSE;
BOOL interp_params = FALSE;
+ S32 params_changed_count = 0;
for( S32 i = 0; i < num_params; i++ )
{
@@ -7308,23 +7252,28 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
if (is_first_appearance_message || (param->getWeight() != newWeight))
{
params_changed = TRUE;
+ params_changed_count++;
+
if(is_first_appearance_message)
{
- param->setWeight(newWeight, FALSE);
+ //LL_DEBUGS("Avatar") << "param slam " << i << " " << newWeight << LL_ENDL;
+ param->setWeight(newWeight);
}
else
{
interp_params = TRUE;
- param->setAnimationTarget(newWeight, FALSE);
+ param->setAnimationTarget(newWeight);
}
}
}
- const S32 expected_tweakable_count = getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TWEAKABLE); // don't worry about VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT
+ const S32 expected_tweakable_count = getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TWEAKABLE) +
+ getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TRANSMIT_NOT_TWEAKABLE); // don't worry about VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT
if (num_params != expected_tweakable_count)
{
- LL_DEBUGS("Avatar") << "Number of params in AvatarAppearance msg (" << num_params << ") does not match number of tweakable params in avatar xml file (" << expected_tweakable_count << "). Processing what we can. object: " << getID() << llendl;
+ LL_DEBUGS("Avatar") << "Number of params in AvatarAppearance msg (" << num_params << ") does not match number of tweakable params in avatar xml file (" << expected_tweakable_count << "). Processing what we can. object: " << getID() << LL_ENDL;
}
+ LL_DEBUGS("Avatar") << "Changed " << params_changed_count << " params" << LL_ENDL;
if (params_changed)
{
if (interp_params)
@@ -7336,7 +7285,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
ESex new_sex = getSex();
if( old_sex != new_sex )
{
- updateSexDependentLayerSets( FALSE );
+ updateSexDependentLayerSets();
}
}
@@ -7352,13 +7301,13 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
if (visualParamWeightsAreDefault() && mRuthTimer.getElapsedTimeF32() > LOADING_TIMEOUT_SECONDS)
{
// re-request appearance, hoping that it comes back with a shape next time
- llinfos << "Re-requesting AvatarAppearance for object: " << getID() << llendl;
+ LL_INFOS() << "Re-requesting AvatarAppearance for object: " << getID() << LL_ENDL;
LLAvatarPropertiesProcessor::getInstance()->sendAvatarTexturesRequest(getID());
mRuthTimer.reset();
}
else
{
- llinfos << "That's okay, we already have a non-default shape for object: " << getID() << llendl;
+ LL_INFOS() << "That's okay, we already have a non-default shape for object: " << getID() << LL_ENDL;
// we don't really care.
}
}
@@ -7374,35 +7323,36 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
}
updateMeshTextures();
-
//if (enable_verbose_dumps) dumpArchetypeXML(dump_prefix + "process_end");
}
// static
-void LLVOAvatar::getAnimLabels( LLDynamicArray<std::string>* labels )
+void LLVOAvatar::getAnimLabels( std::vector<std::string>* labels )
{
S32 i;
+ labels->reserve(gUserAnimStatesCount);
for( i = 0; i < gUserAnimStatesCount; i++ )
{
- labels->put( LLAnimStateLabels::getStateLabel( gUserAnimStates[i].mName ) );
+ labels->push_back( LLAnimStateLabels::getStateLabel( gUserAnimStates[i].mName ) );
}
// Special case to trigger away (AFK) state
- labels->put( "Away From Keyboard" );
+ labels->push_back( "Away From Keyboard" );
}
// static
-void LLVOAvatar::getAnimNames( LLDynamicArray<std::string>* names )
+void LLVOAvatar::getAnimNames( std::vector<std::string>* names )
{
S32 i;
+ names->reserve(gUserAnimStatesCount);
for( i = 0; i < gUserAnimStatesCount; i++ )
{
- names->put( std::string(gUserAnimStates[i].mName) );
+ names->push_back( std::string(gUserAnimStates[i].mName) );
}
// Special case to trigger away (AFK) state
- names->put( "enter_away_from_keyboard_state" );
+ names->push_back( "enter_away_from_keyboard_state" );
}
// static
@@ -7410,7 +7360,7 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture
{
if (!userdata) return;
- //llinfos << "onBakedTextureMasksLoaded: " << src_vi->getID() << llendl;
+ //LL_INFOS() << "onBakedTextureMasksLoaded: " << src_vi->getID() << LL_ENDL;
const LLUUID id = src_vi->getID();
LLTextureMaskData* maskData = (LLTextureMaskData*) userdata;
@@ -7424,7 +7374,7 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture
{
if (!aux_src->getData())
{
- llerrs << "No auxiliary source (morph mask) data for image id " << id << llendl;
+ LL_ERRS() << "No auxiliary source (morph mask) data for image id " << id << LL_ENDL;
return;
}
@@ -7445,7 +7395,7 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture
/* if( id == head_baked->getID() )
if (self->mBakedTextureDatas[BAKED_HEAD].mTexLayerSet)
- //llinfos << "onBakedTextureMasksLoaded for head " << id << " discard = " << discard_level << llendl;
+ //LL_INFOS() << "onBakedTextureMasksLoaded for head " << id << " discard = " << discard_level << LL_ENDL;
self->mBakedTextureDatas[BAKED_HEAD].mTexLayerSet->applyMorphMask(aux_src->getData(), aux_src->getWidth(), aux_src->getHeight(), 1);
maskData->mLastDiscardLevel = discard_level; */
BOOL found_texture_id = false;
@@ -7476,7 +7426,7 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture
}
if (!found_texture_id)
{
- llinfos << "unexpected image id: " << id << llendl;
+ LL_INFOS() << "unexpected image id: " << id << LL_ENDL;
}
self->dirtyMesh();
}
@@ -7484,7 +7434,7 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture
{
// this can happen when someone uses an old baked texture possibly provided by
// viewer-side baked texture caching
- llwarns << "Masks loaded callback but NO aux source, id " << id << llendl;
+ LL_WARNS() << "Masks loaded callback but NO aux source, id " << id << LL_ENDL;
}
}
@@ -7557,14 +7507,14 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id )
LLViewerTexture* image_baked = getImage( mBakedTextureDatas[i].mTextureIndex, 0 );
if (id == image_baked->getID())
{
- LL_DEBUGS("Avatar") << avString() << " i " << i << " id " << id << LL_ENDL;
+ //LL_DEBUGS("Avatar") << avString() << " i " << i << " id " << id << LL_ENDL;
mBakedTextureDatas[i].mIsLoaded = true;
mBakedTextureDatas[i].mLastTextureID = id;
mBakedTextureDatas[i].mIsUsed = true;
if (isUsingLocalAppearance())
{
- llinfos << "not changing to baked texture while isUsingLocalAppearance" << llendl;
+ LL_INFOS() << "not changing to baked texture while isUsingLocalAppearance" << LL_ENDL;
}
else
{
@@ -7573,12 +7523,12 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id )
avatar_joint_mesh_list_t::iterator iter = mBakedTextureDatas[i].mJointMeshes.begin();
avatar_joint_mesh_list_t::iterator end = mBakedTextureDatas[i].mJointMeshes.end();
for (; iter != end; ++iter)
- {
+ {
LLAvatarJointMesh* mesh = (*iter);
if (mesh)
- {
+ {
mesh->setTexture( image_baked );
- }
+ }
}
}
@@ -7602,7 +7552,7 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id )
{
LLAvatarJointMesh* mesh = (*iter);
if (mesh)
- {
+ {
mesh->setColor( LLColor4::white );
}
}
@@ -7621,7 +7571,7 @@ std::string get_sequential_numbered_file_name(const std::string& prefix,
file_num_type::iterator it = file_nums.find(prefix);
S32 num = 0;
if (it != file_nums.end())
- {
+{
num = it->second;
}
file_nums[prefix] = num+1;
@@ -7630,6 +7580,15 @@ std::string get_sequential_numbered_file_name(const std::string& prefix,
return outfilename;
}
+void dump_sequential_xml(const std::string outprefix, const LLSD& content)
+{
+ std::string outfilename = get_sequential_numbered_file_name(outprefix,".xml");
+ std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename);
+ std::ofstream ofs(fullpath.c_str(), std::ios_base::out);
+ ofs << LLSDOStreamer<LLSDXMLFormatter>(content, LLSDFormatter::OPTIONS_PRETTY);
+ LL_DEBUGS("Avatar") << "results saved to: " << fullpath << LL_ENDL;
+}
+
void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_wearables )
{
std::string outprefix(prefix);
@@ -7639,10 +7598,6 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara
}
if (outprefix.empty())
{
- outprefix = getFullname() + (isSelf()?"_s":"_o");
- }
- if (outprefix.empty())
- {
outprefix = std::string("new_archetype");
}
std::string outfilename = get_sequential_numbered_file_name(outprefix,".xml");
@@ -7657,7 +7612,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara
}
else
{
- llinfos << "xmlfile write handle obtained : " << fullpath << llendl;
+ LL_INFOS() << "xmlfile write handle obtained : " << fullpath << LL_ENDL;
}
apr_file_printf( file, "<?xml version=\"1.0\" encoding=\"US-ASCII\" standalone=\"yes\"?>\n" );
@@ -7667,36 +7622,36 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara
if (group_by_wearables)
{
for (S32 type = LLWearableType::WT_SHAPE; type < LLWearableType::WT_COUNT; type++)
- {
- const std::string& wearable_name = LLWearableType::getTypeName((LLWearableType::EType)type);
- apr_file_printf( file, "\n\t\t<!-- wearable: %s -->\n", wearable_name.c_str() );
+ {
+ const std::string& wearable_name = LLWearableType::getTypeName((LLWearableType::EType)type);
+ apr_file_printf( file, "\n\t\t<!-- wearable: %s -->\n", wearable_name.c_str() );
for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam())
+ {
+ LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param;
+ if( (viewer_param->getWearableType() == type) &&
+ (viewer_param->isTweakable() ) )
{
- LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param;
- if( (viewer_param->getWearableType() == type) &&
- (viewer_param->isTweakable() ) )
- {
dump_visual_param(file, viewer_param, viewer_param->getWeight());
- }
}
+ }
- for (U8 te = 0; te < TEX_NUM_INDICES; te++)
- {
+ for (U8 te = 0; te < TEX_NUM_INDICES; te++)
+ {
if (LLAvatarAppearanceDictionary::getTEWearableType((ETextureIndex)te) == type)
- {
- // MULTIPLE_WEARABLES: extend to multiple wearables?
+ {
+ // MULTIPLE_WEARABLES: extend to multiple wearables?
LLViewerTexture* te_image = getImage((ETextureIndex)te, 0);
- if( te_image )
- {
- std::string uuid_str;
- te_image->getID().toString( uuid_str );
- apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", te, uuid_str.c_str());
- }
+ if( te_image )
+ {
+ std::string uuid_str;
+ te_image->getID().toString( uuid_str );
+ apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", te, uuid_str.c_str());
}
}
}
}
+ }
else
{
// Just dump all params sequentially.
@@ -7708,6 +7663,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara
for (U8 te = 0; te < TEX_NUM_INDICES; te++)
{
+ {
// MULTIPLE_WEARABLES: extend to multiple wearables?
LLViewerTexture* te_image = getImage((ETextureIndex)te, 0);
if( te_image )
@@ -7719,6 +7675,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara
}
}
+ }
apr_file_printf( file, "\t</archetype>\n" );
apr_file_printf( file, "\n</linden_genepool>\n" );
@@ -7796,7 +7753,7 @@ void LLVOAvatar::cullAvatarsByPixelArea()
if (inst->mCulled != culled)
{
inst->mCulled = culled;
- lldebugs << "avatar " << inst->getID() << (culled ? " start culled" : " start not culled" ) << llendl;
+ LL_DEBUGS() << "avatar " << inst->getID() << (culled ? " start culled" : " start not culled" ) << LL_ENDL;
inst->updateMeshTextures();
}
@@ -7817,14 +7774,14 @@ void LLVOAvatar::cullAvatarsByPixelArea()
if (gFrameTimeSeconds != sUnbakedUpdateTime) // only update once per frame
{
sUnbakedUpdateTime = gFrameTimeSeconds;
- sUnbakedTime += gFrameIntervalSeconds;
+ sUnbakedTime += gFrameIntervalSeconds.value();
}
if (grey_avatars > 0)
{
if (gFrameTimeSeconds != sGreyUpdateTime) // only update once per frame
{
sGreyUpdateTime = gFrameTimeSeconds;
- sGreyTime += gFrameIntervalSeconds;
+ sGreyTime += gFrameIntervalSeconds.value();
}
}
}
@@ -7841,43 +7798,8 @@ void LLVOAvatar::startAppearanceAnimation()
}
// virtual
-void LLVOAvatar::bodySizeChanged()
-{
- if (isSelf() && !LLAppearanceMgr::instance().isInUpdateAppearanceFromCOF())
- { // notify simulator of change in size
- // but not if we are in the middle of updating appearance
- gAgent.sendAgentSetAppearance();
- }
-}
-
-BOOL LLVOAvatar::isUsingServerBakes() const
-{
-#if 1
- // Sanity check - visual param for appearance version should match mUseServerBakes
- LLVisualParam* appearance_version_param = getVisualParam(11000);
- llassert(appearance_version_param);
- F32 wt = appearance_version_param->getWeight();
- F32 expect_wt = mUseServerBakes ? 1.0 : 0.0;
- if (!is_approx_equal(wt,expect_wt))
- {
- llwarns << "wt " << wt << " differs from expected " << expect_wt << llendl;
- }
-#endif
-
- return mUseServerBakes;
-}
-
-void LLVOAvatar::setIsUsingServerBakes(BOOL newval)
-{
- mUseServerBakes = newval;
- LLVisualParam* appearance_version_param = getVisualParam(11000);
- llassert(appearance_version_param);
- appearance_version_param->setWeight(newval ? 1.0 : 0.0, false);
-}
-
-// virtual
void LLVOAvatar::removeMissingBakedTextures()
-{
+ {
}
//virtual
@@ -8148,7 +8070,7 @@ void LLVOAvatar::calculateUpdateRenderCost()
if (all_textures.find(image_id) == all_textures.end())
{
// attachment texture not previously seen.
- llinfos << "attachment_texture: " << image_id.asString() << llendl;
+ LL_INFOS() << "attachment_texture: " << image_id.asString() << LL_ENDL;
all_textures.insert(image_id);
}
}
@@ -8168,7 +8090,7 @@ void LLVOAvatar::calculateUpdateRenderCost()
continue;
if (all_textures.find(image_id) == all_textures.end())
{
- llinfos << "local_texture: " << texture_dict->mName << ": " << image_id << llendl;
+ LL_INFOS() << "local_texture: " << texture_dict->mName << ": " << image_id << LL_ENDL;
all_textures.insert(image_id);
}
}
@@ -8200,10 +8122,10 @@ LLColor4 LLVOAvatar::calcMutedAVColor(F32 value, S32 range_low, S32 range_high)
new_color.normalize();
new_color *= 0.7f; // Tone it down a bit
- //llinfos << "From value " << std::setprecision(3) << value << " returning color " << new_color
+ //LL_INFOS() << "From value " << std::setprecision(3) << value << " returning color " << new_color
// << " using indexes " << spectrum_index_1 << ", " << spectrum_index_2
// << " and fractBetween " << fractBetween
- // << llendl;
+ // << LL_ENDL;
return new_color;
}
@@ -8272,7 +8194,7 @@ BOOL LLVOAvatar::isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex te, U
if( !getImage( te, index ) )
{
- llwarns << "getImage( " << te << ", " << index << " ) returned 0" << llendl;
+ LL_WARNS() << "getImage( " << te << ", " << index << " ) returned 0" << LL_ENDL;
return FALSE;
}
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index cd8a5ecdf2..42ff7bff92 100755
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -33,9 +33,8 @@
#include <string>
#include <vector>
-#include <boost/signals2.hpp>
+#include <boost/signals2/trackable.hpp>
-#include "imageids.h" // IMG_INVISIBLE
#include "llavatarappearance.h"
#include "llchat.h"
#include "lldrawpoolalpha.h"
@@ -74,6 +73,7 @@ struct LLVOAvatarChildJoint;
//class LLViewerJoint;
struct LLAppearanceMessageContents;
struct LLVOAvatarSkeletonInfo;
+class LLViewerJointMesh;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// LLVOAvatar
@@ -97,12 +97,12 @@ public:
public:
void* operator new(size_t size)
{
- return ll_aligned_malloc_16(size);
+ return LLTrace::MemTrackable<LLViewerObject>::aligned_new<16>(size);
}
- void operator delete(void* ptr)
+ void operator delete(void* ptr, size_t size)
{
- ll_aligned_free_16(ptr);
+ LLTrace::MemTrackable<LLViewerObject>::aligned_delete<16>(ptr, size);
}
LLVOAvatar(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
@@ -129,28 +129,28 @@ public:
/*virtual*/ void updateGL();
/*virtual*/ LLVOAvatar* asAvatar();
virtual U32 processUpdateMessage(LLMessageSystem *mesgsys,
- void **user_data,
- U32 block_num,
- const EObjectUpdateType update_type,
- LLDataPacker *dp);
+ void **user_data,
+ U32 block_num,
+ const EObjectUpdateType update_type,
+ LLDataPacker *dp);
virtual void idleUpdate(LLAgent &agent, const F64 &time);
/*virtual*/ BOOL updateLOD();
BOOL updateJointLODs();
void updateLODRiggedAttachments( void );
/*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate.
- S32 totalTextureMemForUUIDS(std::set<LLUUID>& ids);
- bool allTexturesCompletelyDownloaded(std::set<LLUUID>& ids) const;
- bool allLocalTexturesCompletelyDownloaded() const;
- bool allBakedTexturesCompletelyDownloaded() const;
- void bakedTextureOriginCounts(S32 &sb_count, S32 &host_count,
- S32 &both_count, S32 &neither_count);
- std::string bakedTextureOriginInfo();
- void collectLocalTextureUUIDs(std::set<LLUUID>& ids) const;
- void collectBakedTextureUUIDs(std::set<LLUUID>& ids) const;
- void collectTextureUUIDs(std::set<LLUUID>& ids);
- void releaseOldTextures();
+ S32Bytes totalTextureMemForUUIDS(std::set<LLUUID>& ids);
+ bool allTexturesCompletelyDownloaded(std::set<LLUUID>& ids) const;
+ bool allLocalTexturesCompletelyDownloaded() const;
+ bool allBakedTexturesCompletelyDownloaded() const;
+ void bakedTextureOriginCounts(S32 &sb_count, S32 &host_count,
+ S32 &both_count, S32 &neither_count);
+ std::string bakedTextureOriginInfo();
+ void collectLocalTextureUUIDs(std::set<LLUUID>& ids) const;
+ void collectBakedTextureUUIDs(std::set<LLUUID>& ids) const;
+ void collectTextureUUIDs(std::set<LLUUID>& ids);
+ void releaseOldTextures();
/*virtual*/ void updateTextures();
- LLViewerFetchedTexture* getBakedTextureImage(const U8 te, const LLUUID& uuid);
+ LLViewerFetchedTexture* getBakedTextureImage(const U8 te, const LLUUID& uuid);
/*virtual*/ S32 setTETexture(const U8 te, const LLUUID& uuid); // If setting a baked texture, need to request it from a non-local sim.
/*virtual*/ void onShift(const LLVector4a& shift_vector);
/*virtual*/ U32 getPartitionType() const;
@@ -199,9 +199,7 @@ public:
virtual LLJoint* getJoint(const std::string &name);
- void resetJointPositions( void );
void resetJointPositionsToDefault( void );
- void resetSpecificJointPosition( const std::string& name );
/*virtual*/ const LLUUID& getID() const;
/*virtual*/ void addDebugText(const std::string& text);
@@ -210,7 +208,7 @@ public:
/*virtual*/ F32 getPixelArea() const;
/*virtual*/ LLVector3d getPosGlobalFromAgent(const LLVector3 &position);
/*virtual*/ LLVector3 getPosAgentFromGlobal(const LLVector3d &position);
- virtual void updateVisualParams();
+ virtual void updateVisualParams();
/** Inherited
@@ -402,7 +400,7 @@ public:
VisualMuteSettings getVisualMuteSettings() { return mVisuallyMuteSetting; };
U32 renderRigid();
- U32 renderSkinned(EAvatarRenderPass pass);
+ U32 renderSkinned();
F32 getLastSkinTime() { return mLastSkinTime; }
U32 renderTransparent(BOOL first_pass);
void renderCollisionVolumes();
@@ -442,7 +440,7 @@ public:
// Global colors
//--------------------------------------------------------------------
public:
- /*virtual*/void onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake);
+ /*virtual*/void onGlobalColorChanged(const LLTexGlobalColor* global_color);
//--------------------------------------------------------------------
// Visibility
@@ -602,7 +600,7 @@ protected:
// Composites
//--------------------------------------------------------------------
public:
- virtual void invalidateComposite(LLTexLayerSet* layerset, BOOL upload_result);
+ virtual void invalidateComposite(LLTexLayerSet* layerset);
virtual void invalidateAll();
virtual void setCompositeUpdatesEnabled(bool b) {}
virtual void setCompositeUpdatesEnabled(U32 index, bool b) {}
@@ -639,7 +637,7 @@ private:
public:
void debugColorizeSubMeshes(U32 i, const LLColor4& color);
virtual void updateMeshTextures();
- void updateSexDependentLayerSets(BOOL upload_bake);
+ void updateSexDependentLayerSets();
virtual void dirtyMesh(); // Dirty the avatar mesh
void updateMeshData();
protected:
@@ -672,7 +670,6 @@ public:
void processAvatarAppearance(LLMessageSystem* mesgsys);
void hideSkirt();
void startAppearanceAnimation();
- /*virtual*/ void bodySizeChanged();
//--------------------------------------------------------------------
// Appearance morphing
@@ -685,12 +682,6 @@ public:
// editing or when waiting for a subsequent server rebake.
/*virtual*/ BOOL isUsingLocalAppearance() const { return mUseLocalAppearance; }
- // True if this avatar should fetch its baked textures via the new
- // appearance mechanism.
- BOOL isUsingServerBakes() const;
- void setIsUsingServerBakes(BOOL newval);
-
-
// True if we are currently in appearance editing mode. Often but
// not always the same as isUsingLocalAppearance().
/*virtual*/ BOOL isEditingAppearance() const { return mIsEditingAppearance; }
@@ -703,7 +694,6 @@ private:
F32 mLastAppearanceBlendTime;
BOOL mIsEditingAppearance; // flag for if we're actively in appearance editing mode
BOOL mUseLocalAppearance; // flag for if we're using a local composite
- BOOL mUseServerBakes; // flag for if baked textures should be fetched from baking service (false if they're temporary uploads)
//--------------------------------------------------------------------
// Visibility
@@ -892,8 +882,8 @@ public:
std::string getFullname() const; // Returns "FirstName LastName"
std::string avString() const; // Frequently used string in log messages "Avatar '<full name'"
protected:
- static void getAnimLabels(LLDynamicArray<std::string>* labels);
- static void getAnimNames(LLDynamicArray<std::string>* names);
+ static void getAnimLabels(std::vector<std::string>* labels);
+ static void getAnimNames(std::vector<std::string>* names);
private:
bool mNameIsSet;
std::string mTitle;
@@ -1031,10 +1021,11 @@ protected: // Shared with LLVOAvatarSelf
}; // LLVOAvatar
extern const F32 SELF_ADDITIONAL_PRI;
-extern const S32 MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL;
+extern const S32 MAX_TEXTURE_VIRTUAL_SIZE_RESET_INTERVAL;
std::string get_sequential_numbered_file_name(const std::string& prefix,
const std::string& suffix);
+void dump_sequential_xml(const std::string outprefix, const LLSD& content);
void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value);
#endif // LL_VOAVATAR_H
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 082a85e217..42a7c2e576 100755
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -43,6 +43,7 @@
#include "llhudeffecttrail.h"
#include "llhudmanager.h"
#include "llinventoryfunctions.h"
+#include "lllocaltextureobject.h"
#include "llnotificationsutil.h"
#include "llselectmgr.h"
#include "lltoolgrab.h" // for needsRenderBeam
@@ -141,9 +142,8 @@ struct LocalTextureData
//-----------------------------------------------------------------------------
// Static Data
//-----------------------------------------------------------------------------
-S32 LLVOAvatarSelf::sScratchTexBytes = 0;
-LLMap< LLGLenum, LLGLuint*> LLVOAvatarSelf::sScratchTexNames;
-LLMap< LLGLenum, F32*> LLVOAvatarSelf::sScratchTexLastBindTime;
+S32Bytes LLVOAvatarSelf::sScratchTexBytes(0);
+std::map< LLGLenum, LLGLuint*> LLVOAvatarSelf::sScratchTexNames;
/*********************************************************************************
@@ -161,11 +161,9 @@ LLVOAvatarSelf::LLVOAvatarSelf(const LLUUID& id,
mRegionCrossingCount(0),
mInitialBakesLoaded(false)
{
- gAgentWearables.setAvatarObject(this);
-
mMotionController.mIsSelf = TRUE;
- lldebugs << "Marking avatar as self " << id << llendl;
+ LL_DEBUGS() << "Marking avatar as self " << id << LL_ENDL;
}
// Called periodically for diagnostics, return true when done.
@@ -188,15 +186,6 @@ bool update_avatar_rez_metrics()
return false;
}
-bool check_for_unsupported_baked_appearance()
-{
- if (!isAgentAvatarValid())
- return true;
-
- gAgentAvatarp->checkForUnsupportedServerBakeAppearance();
- return false;
-}
-
void LLVOAvatarSelf::initInstance()
{
BOOL status = TRUE;
@@ -206,7 +195,7 @@ void LLVOAvatarSelf::initInstance()
// adds attachment points to mScreen among other things
LLVOAvatar::initInstance();
- llinfos << "Self avatar object created. Starting timer." << llendl;
+ LL_INFOS() << "Self avatar object created. Starting timer." << LL_ENDL;
mDebugSelfLoadTimer.reset();
// clear all times to -1 for debugging
for (U32 i =0; i < LLAvatarAppearanceDefines::TEX_NUM_INDICES; ++i)
@@ -227,13 +216,39 @@ void LLVOAvatarSelf::initInstance()
status &= buildMenus();
if (!status)
{
- llerrs << "Unable to load user's avatar" << llendl;
+ LL_ERRS() << "Unable to load user's avatar" << LL_ENDL;
return;
}
//doPeriodically(output_self_av_texture_diagnostics, 30.0);
doPeriodically(update_avatar_rez_metrics, 5.0);
- doPeriodically(check_for_unsupported_baked_appearance, 120.0);
+ doPeriodically(boost::bind(&LLVOAvatarSelf::checkStuckAppearance, this), 30.0);
+}
+
+bool LLVOAvatarSelf::checkStuckAppearance()
+{
+ const F32 CONDITIONAL_UNSTICK_INTERVAL = 300.0;
+ const F32 UNCONDITIONAL_UNSTICK_INTERVAL = 600.0;
+
+ if (gAgentWearables.isCOFChangeInProgress())
+ {
+ LL_DEBUGS("Avatar") << "checking for stuck appearance" << LL_ENDL;
+ F32 change_time = gAgentWearables.getCOFChangeTime();
+ LL_DEBUGS("Avatar") << "change in progress for " << change_time << " seconds" << LL_ENDL;
+ S32 active_hp = LLAppearanceMgr::instance().countActiveHoldingPatterns();
+ LL_DEBUGS("Avatar") << "active holding patterns " << active_hp << " seconds" << LL_ENDL;
+ S32 active_copies = LLAppearanceMgr::instance().getActiveCopyOperations();
+ LL_DEBUGS("Avatar") << "active copy operations " << active_copies << LL_ENDL;
+
+ if ((change_time > CONDITIONAL_UNSTICK_INTERVAL && active_copies == 0) ||
+ (change_time > UNCONDITIONAL_UNSTICK_INTERVAL))
+ {
+ gAgentWearables.notifyLoadingFinished();
+ }
+ }
+
+ // Return false to continue running check periodically.
+ return LLApp::isExiting();
}
// virtual
@@ -271,7 +286,7 @@ BOOL LLVOAvatarSelf::loadAvatarSelf()
// avatar_skeleton.xml
if (!buildSkeletonSelf(sAvatarSkeletonInfo))
{
- llwarns << "avatar file: buildSkeleton() failed" << llendl;
+ LL_WARNS() << "avatar file: buildSkeleton() failed" << LL_ENDL;
return FALSE;
}
@@ -602,7 +617,7 @@ LLVOAvatarSelf::~LLVOAvatarSelf()
** **
*********************************************************************************/
-//virtual
+// virtual
BOOL LLVOAvatarSelf::updateCharacter(LLAgent &agent)
{
// update screen joint size
@@ -644,55 +659,42 @@ LLJoint *LLVOAvatarSelf::getJoint(const std::string &name)
}
return LLVOAvatar::getJoint(name);
}
-//virtual
-void LLVOAvatarSelf::resetJointPositions( void )
-{
- return LLVOAvatar::resetJointPositions();
-}
// virtual
-BOOL LLVOAvatarSelf::setVisualParamWeight(const LLVisualParam *which_param, F32 weight, BOOL upload_bake )
+BOOL LLVOAvatarSelf::setVisualParamWeight(const LLVisualParam *which_param, F32 weight)
{
if (!which_param)
{
return FALSE;
}
LLViewerVisualParam *param = (LLViewerVisualParam*) LLCharacter::getVisualParam(which_param->getID());
- return setParamWeight(param,weight,upload_bake);
+ return setParamWeight(param,weight);
}
// virtual
-BOOL LLVOAvatarSelf::setVisualParamWeight(const char* param_name, F32 weight, BOOL upload_bake )
+BOOL LLVOAvatarSelf::setVisualParamWeight(const char* param_name, F32 weight)
{
if (!param_name)
{
return FALSE;
}
LLViewerVisualParam *param = (LLViewerVisualParam*) LLCharacter::getVisualParam(param_name);
- return setParamWeight(param,weight,upload_bake);
+ return setParamWeight(param,weight);
}
// virtual
-BOOL LLVOAvatarSelf::setVisualParamWeight(S32 index, F32 weight, BOOL upload_bake )
+BOOL LLVOAvatarSelf::setVisualParamWeight(S32 index, F32 weight)
{
LLViewerVisualParam *param = (LLViewerVisualParam*) LLCharacter::getVisualParam(index);
- return setParamWeight(param,weight,upload_bake);
+ return setParamWeight(param,weight);
}
-BOOL LLVOAvatarSelf::setParamWeight(const LLViewerVisualParam *param, F32 weight, BOOL upload_bake )
+BOOL LLVOAvatarSelf::setParamWeight(const LLViewerVisualParam *param, F32 weight)
{
if (!param)
{
return FALSE;
}
-#if 0
- // FIXME DRANO - kludgy way to avoid overwriting avatar state from wearables.
- if (isUsingServerBakes() && !isUsingLocalAppearance())
- {
- return FALSE;
- }
-#endif
-
if (param->getCrossWearable())
{
LLWearableType::EType type = (LLWearableType::EType)param->getWearableType();
@@ -702,12 +704,12 @@ BOOL LLVOAvatarSelf::setParamWeight(const LLViewerVisualParam *param, F32 weight
LLViewerWearable *wearable = gAgentWearables.getViewerWearable(type,count);
if (wearable)
{
- wearable->setVisualParamWeight(param->getID(), weight, upload_bake);
+ wearable->setVisualParamWeight(param->getID(), weight);
}
}
}
- return LLCharacter::setVisualParamWeight(param,weight,upload_bake);
+ return LLCharacter::setVisualParamWeight(param,weight);
}
/*virtual*/
@@ -720,7 +722,7 @@ void LLVOAvatarSelf::updateVisualParams()
void LLVOAvatarSelf::idleUpdateAppearanceAnimation()
{
// Animate all top-level wearable visual parameters
- gAgentWearables.animateAllWearableParams(calcMorphAmount(), FALSE);
+ gAgentWearables.animateAllWearableParams(calcMorphAmount());
// apply wearable visual params to avatar
for (U32 type = 0; type < LLWearableType::WT_COUNT; type++)
@@ -762,54 +764,6 @@ void LLVOAvatarSelf::stopMotionFromSource(const LLUUID& source_id)
}
}
-//virtual
-U32 LLVOAvatarSelf::processUpdateMessage(LLMessageSystem *mesgsys,
- void **user_data,
- U32 block_num,
- const EObjectUpdateType update_type,
- LLDataPacker *dp)
-{
- U32 retval = LLVOAvatar::processUpdateMessage(mesgsys,user_data,block_num,update_type,dp);
-
-#if 0
- // DRANO - it's not clear this does anything useful. If we wait
- // until an appearance message has been received, we already have
- // the texture ids. If we don't wait, we don't yet know where to
- // look for baked textures, because we haven't received the
- // appearance version data from the appearance message. This looks
- // like an old optimization that's incompatible with server-side
- // texture baking.
-
- // FIXME DRANO - skipping in the case of !mFirstAppearanceMessageReceived prevents us from trying to
- // load textures before we know where they come from (ie, from baking service or not);
- // unknown impact on performance.
- if (mInitialBakesLoaded == false && retval == 0x0 && mFirstAppearanceMessageReceived)
- {
- // call update textures to force the images to be created
- updateMeshTextures();
-
- // unpack the texture UUIDs to the texture slots
- retval = unpackTEMessage(mesgsys, _PREHASH_ObjectData, (S32) block_num);
-
- // need to trigger a few operations to get the avatar to use the new bakes
- for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
- {
- const LLAvatarAppearanceDefines::ETextureIndex te = mBakedTextureDatas[i].mTextureIndex;
- LLUUID texture_id = getTEImage(te)->getID();
- setNewBakedTexture(te, texture_id);
- mInitialBakeIDs[i] = texture_id;
- }
-
- onFirstTEMessageReceived();
-
- mInitialBakesLoaded = true;
- }
-#endif
-
- return retval;
-}
-
-
void LLVOAvatarSelf::setLocalTextureTE(U8 te, LLViewerTexture* image, U32 index)
{
if (te >= TEX_NUM_INDICES)
@@ -861,13 +815,9 @@ void LLVOAvatarSelf::removeMissingBakedTextures()
{
LLViewerTexLayerSet *layerset = getTexLayerSet(i);
layerset->setUpdatesEnabled(TRUE);
- invalidateComposite(layerset, FALSE);
- }
- updateMeshTextures(); // may call back into this function
- if (getRegion() && !getRegion()->getCentralBakeVersion())
- {
- requestLayerSetUploads();
+ invalidateComposite(layerset);
}
+ updateMeshTextures();
}
}
@@ -886,9 +836,9 @@ void LLVOAvatarSelf::updateRegion(LLViewerRegion *regionp)
// Diagnostic info
//LLVector3d pos_from_new_region = getPositionGlobal();
- //llinfos << "pos_from_old_region is " << global_pos_from_old_region
+ //LL_INFOS() << "pos_from_old_region is " << global_pos_from_old_region
// << " while pos_from_new_region is " << pos_from_new_region
- // << llendl;
+ // << LL_ENDL;
}
if (!regionp || (regionp->getHandle() != mLastRegionHandle))
@@ -896,17 +846,11 @@ void LLVOAvatarSelf::updateRegion(LLViewerRegion *regionp)
if (mLastRegionHandle != 0)
{
++mRegionCrossingCount;
- F64 delta = (F64)mRegionCrossingTimer.getElapsedTimeF32();
- F64 avg = (mRegionCrossingCount == 1) ? 0 : LLViewerStats::getInstance()->getStat(LLViewerStats::ST_CROSSING_AVG);
- F64 delta_avg = (delta + avg*(mRegionCrossingCount-1)) / mRegionCrossingCount;
- LLViewerStats::getInstance()->setStat(LLViewerStats::ST_CROSSING_AVG, delta_avg);
-
- F64 max = (mRegionCrossingCount == 1) ? 0 : LLViewerStats::getInstance()->getStat(LLViewerStats::ST_CROSSING_MAX);
- max = llmax(delta, max);
- LLViewerStats::getInstance()->setStat(LLViewerStats::ST_CROSSING_MAX, max);
+ F64Seconds delta(mRegionCrossingTimer.getElapsedTimeF32());
+ record(LLStatViewer::REGION_CROSSING_TIME, delta);
// Diagnostics
- llinfos << "Region crossing took " << (F32)(delta * 1000.0) << " ms " << llendl;
+ LL_INFOS() << "Region crossing took " << (F32)(delta * 1000.0).value() << " ms " << LL_ENDL;
}
if (regionp)
{
@@ -990,7 +934,7 @@ void LLVOAvatarSelf::idleUpdateTractorBeam()
// virtual
void LLVOAvatarSelf::restoreMeshData()
{
- //llinfos << "Restoring" << llendl;
+ //LL_INFOS() << "Restoring" << LL_ENDL;
mMeshValid = TRUE;
updateJointLODs();
updateAttachmentVisibility(gAgentCamera.getCameraMode());
@@ -1042,7 +986,7 @@ void LLVOAvatarSelf::updateAttachmentVisibility(U32 camera_mode)
// forces an update to any baked textures relevant to type.
// will force an upload of the resulting bake if the second parameter is TRUE
//-----------------------------------------------------------------------------
-void LLVOAvatarSelf::wearableUpdated( LLWearableType::EType type, BOOL upload_result )
+void LLVOAvatarSelf::wearableUpdated(LLWearableType::EType type)
{
for (LLAvatarAppearanceDictionary::BakedTextures::const_iterator baked_iter = LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().begin();
baked_iter != LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().end();
@@ -1064,20 +1008,13 @@ void LLVOAvatarSelf::wearableUpdated( LLWearableType::EType type, BOOL upload_re
if (layerset)
{
layerset->setUpdatesEnabled(true);
- invalidateComposite(layerset, upload_result);
+ invalidateComposite(layerset);
}
break;
}
}
}
}
-
- // Physics type has no associated baked textures, but change of params needs to be sent to
- // other avatars.
- if (type == LLWearableType::WT_PHYSICS)
- {
- gAgent.sendAgentSetAppearance();
- }
}
//-----------------------------------------------------------------------------
@@ -1230,7 +1167,7 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object)
// Update COF contents, don't trigger appearance update.
if (!isValid())
{
- llinfos << "removeItemLinks skipped, avatar is under destruction" << llendl;
+ LL_INFOS() << "removeItemLinks skipped, avatar is under destruction" << LL_ENDL;
}
else
{
@@ -1489,15 +1426,6 @@ BOOL LLVOAvatarSelf::isAllLocalTextureDataFinal() const
return TRUE;
}
-BOOL LLVOAvatarSelf::isBakedTextureFinal(const LLAvatarAppearanceDefines::EBakedTextureIndex index) const
-{
- const LLViewerTexLayerSet *layerset = getLayerSet(index);
- if (!layerset) return FALSE;
- const LLViewerTexLayerSetBuffer *layerset_buffer = layerset->getViewerComposite();
- if (!layerset_buffer) return FALSE;
- return !layerset_buffer->uploadNeeded();
-}
-
BOOL LLVOAvatarSelf::isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const
{
LLUUID id;
@@ -1555,69 +1483,22 @@ BOOL LLVOAvatarSelf::isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex t
return isTextureVisible(type,index);
}
-
-//-----------------------------------------------------------------------------
-// requestLayerSetUploads()
-//-----------------------------------------------------------------------------
-void LLVOAvatarSelf::requestLayerSetUploads()
-{
- for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
- {
- requestLayerSetUpload((EBakedTextureIndex)i);
- }
-}
-
-void LLVOAvatarSelf::requestLayerSetUpload(LLAvatarAppearanceDefines::EBakedTextureIndex i)
-{
- ETextureIndex tex_index = mBakedTextureDatas[i].mTextureIndex;
- const BOOL layer_baked = isTextureDefined(tex_index, gAgentWearables.getWearableCount(tex_index));
- LLViewerTexLayerSet *layerset = getLayerSet(i);
- if (!layer_baked && layerset)
- {
- layerset->requestUpload();
- }
-}
-
bool LLVOAvatarSelf::areTexturesCurrent() const
{
- return !hasPendingBakedUploads() && gAgentWearables.areWearablesLoaded();
+ return gAgentWearables.areWearablesLoaded();
}
-// virtual
-bool LLVOAvatarSelf::hasPendingBakedUploads() const
-{
- for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
- {
- LLViewerTexLayerSet* layerset = getTexLayerSet(i);
- if (layerset && layerset->getViewerComposite() && layerset->getViewerComposite()->uploadPending())
- {
- return true;
- }
- }
- return false;
-}
-
-void LLVOAvatarSelf::invalidateComposite( LLTexLayerSet* layerset, BOOL upload_result )
+void LLVOAvatarSelf::invalidateComposite( LLTexLayerSet* layerset)
{
LLViewerTexLayerSet *layer_set = dynamic_cast<LLViewerTexLayerSet*>(layerset);
if( !layer_set || !layer_set->getUpdatesEnabled() )
{
return;
}
- // llinfos << "LLVOAvatar::invalidComposite() " << layerset->getBodyRegionName() << llendl;
+ // LL_INFOS() << "LLVOAvatar::invalidComposite() " << layerset->getBodyRegionName() << LL_ENDL;
layer_set->requestUpdate();
layer_set->invalidateMorphMasks();
-
- if( upload_result && (getRegion() && !getRegion()->getCentralBakeVersion()))
- {
- llassert(isSelf());
-
- ETextureIndex baked_te = getBakedTE( layer_set );
- setTEImage( baked_te, LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT_AVATAR) );
- layer_set->requestUpload();
- updateMeshTextures();
- }
}
void LLVOAvatarSelf::invalidateAll()
@@ -1625,7 +1506,7 @@ void LLVOAvatarSelf::invalidateAll()
for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
{
LLViewerTexLayerSet *layerset = getTexLayerSet(i);
- invalidateComposite(layerset, TRUE);
+ invalidateComposite(layerset);
}
//mDebugSelfLoadTimer.reset();
}
@@ -1757,7 +1638,7 @@ void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerTexture* src_te
{
if (type >= TEX_NUM_INDICES)
{
- llerrs << "Tried to set local texture with invalid type: (" << (U32) type << ", " << index << ")" << llendl;
+ LL_ERRS() << "Tried to set local texture with invalid type: (" << (U32) type << ", " << index << ")" << LL_ENDL;
return;
}
LLWearableType::EType wearable_type = LLAvatarAppearanceDictionary::getInstance()->getTEWearableType(type);
@@ -1770,7 +1651,7 @@ void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerTexture* src_te
local_tex_obj = getLocalTextureObject(type,index);
if (!local_tex_obj)
{
- llerrs << "Unable to create LocalTextureObject for wearable type & index: (" << (U32) wearable_type << ", " << index << ")" << llendl;
+ LL_ERRS() << "Unable to create LocalTextureObject for wearable type & index: (" << (U32) wearable_type << ", " << index << ")" << LL_ENDL;
return;
}
@@ -1832,7 +1713,7 @@ void LLVOAvatarSelf::setBakedReady(LLAvatarAppearanceDefines::ETextureIndex type
// virtual
void LLVOAvatarSelf::dumpLocalTextures() const
{
- llinfos << "Local Textures:" << llendl;
+ LL_INFOS() << "Local Textures:" << LL_ENDL;
/* ETextureIndex baked_equiv[] = {
TEX_UPPER_BAKED,
@@ -1856,22 +1737,22 @@ void LLVOAvatarSelf::dumpLocalTextures() const
#if LL_RELEASE_FOR_DOWNLOAD
// End users don't get to trivially see avatar texture IDs, makes textures
// easier to steal. JC
- llinfos << "LocTex " << name << ": Baked " << llendl;
+ LL_INFOS() << "LocTex " << name << ": Baked " << LL_ENDL;
#else
- llinfos << "LocTex " << name << ": Baked " << getTEImage(baked_equiv)->getID() << llendl;
+ LL_INFOS() << "LocTex " << name << ": Baked " << getTEImage(baked_equiv)->getID() << LL_ENDL;
#endif
}
else if (local_tex_obj && local_tex_obj->getImage() != NULL)
{
if (local_tex_obj->getImage()->getID() == IMG_DEFAULT_AVATAR)
{
- llinfos << "LocTex " << name << ": None" << llendl;
+ LL_INFOS() << "LocTex " << name << ": None" << LL_ENDL;
}
else
{
const LLViewerFetchedTexture* image = dynamic_cast<LLViewerFetchedTexture*>( local_tex_obj->getImage() );
- llinfos << "LocTex " << name << ": "
+ LL_INFOS() << "LocTex " << name << ": "
<< "Discard " << image->getDiscardLevel() << ", "
<< "(" << image->getWidth() << ", " << image->getHeight() << ") "
#if !LL_RELEASE_FOR_DOWNLOAD
@@ -1880,12 +1761,12 @@ void LLVOAvatarSelf::dumpLocalTextures() const
<< image->getID() << " "
#endif
<< "Priority: " << image->getDecodePriority()
- << llendl;
+ << LL_ENDL;
}
}
else
{
- llinfos << "LocTex " << name << ": No LLViewerTexture" << llendl;
+ LL_INFOS() << "LocTex " << name << ": No LLViewerTexture" << LL_ENDL;
}
}
}
@@ -1941,7 +1822,7 @@ void LLVOAvatarSelf::dumpTotalLocalTextureByteCount()
{
S32 gl_bytes = 0;
gAgentAvatarp->getLocalTextureByteCount(&gl_bytes);
- llinfos << "Total Avatar LocTex GL:" << (gl_bytes/1024) << "KB" << llendl;
+ LL_INFOS() << "Total Avatar LocTex GL:" << (gl_bytes/1024) << "KB" << LL_ENDL;
}
BOOL LLVOAvatarSelf::getIsCloud() const
@@ -1965,12 +1846,12 @@ BOOL LLVOAvatarSelf::getIsCloud() const
{
if (do_warn)
{
- llinfos << "Self is clouded due to missing one or more required body parts: "
+ LL_INFOS() << "Self is clouded due to missing one or more required body parts: "
<< (shape_count ? "" : "SHAPE ")
<< (hair_count ? "" : "HAIR ")
<< (eye_count ? "" : "EYES ")
<< (skin_count ? "" : "SKIN ")
- << llendl;
+ << LL_ENDL;
}
return TRUE;
}
@@ -1979,7 +1860,7 @@ BOOL LLVOAvatarSelf::getIsCloud() const
{
if (do_warn)
{
- llinfos << "Self is clouded because of no hair texture" << llendl;
+ LL_INFOS() << "Self is clouded because of no hair texture" << LL_ENDL;
}
return TRUE;
}
@@ -1991,7 +1872,7 @@ BOOL LLVOAvatarSelf::getIsCloud() const
{
if (do_warn)
{
- llinfos << "Self is clouded because lower textures not baked" << llendl;
+ LL_INFOS() << "Self is clouded because lower textures not baked" << LL_ENDL;
}
return TRUE;
}
@@ -2001,7 +1882,7 @@ BOOL LLVOAvatarSelf::getIsCloud() const
{
if (do_warn)
{
- llinfos << "Self is clouded because upper textures not baked" << llendl;
+ LL_INFOS() << "Self is clouded because upper textures not baked" << LL_ENDL;
}
return TRUE;
}
@@ -2021,14 +1902,14 @@ BOOL LLVOAvatarSelf::getIsCloud() const
{
if (do_warn)
{
- llinfos << "Self is clouded because texture at index " << i
- << " (texture index is " << texture_data.mTextureIndex << ") is not loaded" << llendl;
+ LL_INFOS() << "Self is clouded because texture at index " << i
+ << " (texture index is " << texture_data.mTextureIndex << ") is not loaded" << LL_ENDL;
}
return TRUE;
}
}
- lldebugs << "Avatar de-clouded" << llendl;
+ LL_DEBUGS() << "Avatar de-clouded" << LL_ENDL;
}
return FALSE;
}
@@ -2036,7 +1917,10 @@ BOOL LLVOAvatarSelf::getIsCloud() const
/*static*/
void LLVOAvatarSelf::debugOnTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata)
{
- gAgentAvatarp->debugTimingLocalTexLoaded(success, src_vi, src, aux_src, discard_level, final, userdata);
+ if (gAgentAvatarp.notNull())
+ {
+ gAgentAvatarp->debugTimingLocalTexLoaded(success, src_vi, src, aux_src, discard_level, final, userdata);
+ }
}
void LLVOAvatarSelf::debugTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata)
@@ -2149,7 +2033,7 @@ void LLVOAvatarSelf::dumpAllTextures() const
if (!layerset_buffer) continue;
vd_text += verboseDebugDumpLocalTextureDataInfo(layerset);
}
- LL_DEBUGS("Avatar") << vd_text << llendl;
+ LL_DEBUGS("Avatar") << vd_text << LL_ENDL;
}
const std::string LLVOAvatarSelf::debugDumpLocalTextureDataInfo(const LLViewerTexLayerSet* layerset) const
@@ -2220,27 +2104,9 @@ const std::string LLVOAvatarSelf::debugDumpAllLocalTextureDataInfo() const
return text;
}
-
-#if 0
-// Dump avatar metrics data.
-LLSD LLVOAvatarSelf::metricsData()
-{
- // runway - add region info
- LLSD result;
- result["rez_status"] = LLVOAvatar::rezStatusToString(getRezzedStatus());
- result["timers"]["debug_existence"] = mDebugExistenceTimer.getElapsedTimeF32();
- result["timers"]["ruth_debug"] = mRuthDebugTimer.getElapsedTimeF32();
- result["timers"]["ruth"] = mRuthTimer.getElapsedTimeF32();
- result["timers"]["invisible"] = mInvisibleTimer.getElapsedTimeF32();
- result["timers"]["fully_loaded"] = mFullyLoadedTimer.getElapsedTimeF32();
- result["startup"] = LLStartUp::getPhases().dumpPhases();
-
- return result;
-}
-#endif
-
class ViewerAppearanceChangeMetricsResponder: public LLCurl::Responder
{
+ LOG_CLASS(ViewerAppearanceChangeMetricsResponder);
public:
ViewerAppearanceChangeMetricsResponder( S32 expected_sequence,
volatile const S32 & live_sequence,
@@ -2251,32 +2117,25 @@ public:
{
}
- virtual void completed(U32 status,
- const std::string& reason,
- const LLSD& content)
+private:
+ /* virtual */ void httpSuccess()
{
- gPendingMetricsUploads--; // if we add retry, this should be moved to the isGoodStatus case.
- if (isGoodStatus(status))
- {
- LL_DEBUGS("Avatar") << "OK" << LL_ENDL;
- result(content);
- }
- else
- {
- LL_WARNS("Avatar") << "Failed " << status << " reason " << reason << LL_ENDL;
- errorWithContent(status,reason,content);
- }
- }
+ LL_DEBUGS("Avatar") << "OK" << LL_ENDL;
- // virtual
- void result(const LLSD & content)
- {
+ gPendingMetricsUploads--;
if (mLiveSequence == mExpectedSequence)
{
mReportingStarted = true;
}
}
+ /* virtual */ void httpFailure()
+ {
+ // if we add retry, this should be removed from the httpFailure case
+ LL_WARNS("Avatar") << dumpResponse() << LL_ENDL;
+ gPendingMetricsUploads--;
+ }
+
private:
S32 mExpectedSequence;
volatile const S32 & mLiveSequence;
@@ -2351,7 +2210,7 @@ LLSD summarize_by_buckets(std::vector<LLSD> in_records,
accum_it != accum.end(); ++accum_it)
{
LLSD out_record = accum_it->first;
- out_record["stats"] = accum_it->second.getData();
+ out_record["stats"] = accum_it->second.asLLSD();
result.append(out_record);
}
return result;
@@ -2359,11 +2218,10 @@ LLSD summarize_by_buckets(std::vector<LLSD> in_records,
void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics()
{
- // gAgentAvatarp->stopAllPhases();
static volatile bool reporting_started(false);
static volatile S32 report_sequence(0);
- LLSD msg; // = metricsData();
+ LLSD msg;
msg["message"] = "ViewerAppearanceChangeMetrics";
msg["session_id"] = gAgentSessionID;
msg["agent_id"] = gAgentID;
@@ -2423,63 +2281,6 @@ void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics()
}
}
-class CheckAgentAppearanceServiceResponder: public LLHTTPClient::Responder
-{
-public:
- CheckAgentAppearanceServiceResponder()
- {
- }
-
- virtual ~CheckAgentAppearanceServiceResponder()
- {
- }
-
- /* virtual */ void result(const LLSD& content)
- {
- LL_DEBUGS("Avatar") << "status OK" << llendl;
- }
-
- // Error
- /*virtual*/ void errorWithContent(U32 status, const std::string& reason, const LLSD& content)
- {
- if (isAgentAvatarValid())
- {
- LL_DEBUGS("Avatar") << "failed, will rebake [status:"
- << status << "]: " << content << llendl;
- forceAppearanceUpdate();
- }
- }
-
- static void forceAppearanceUpdate()
- {
- // Trying to rebake immediately after crossing region boundary
- // seems to be failure prone; adding a delay factor. Yes, this
- // fix is ad-hoc and not guaranteed to work in all cases.
- doAfterInterval(boost::bind(&LLVOAvatarSelf::forceBakeAllTextures,
- gAgentAvatarp.get(), true), 5.0);
- }
-};
-
-void LLVOAvatarSelf::checkForUnsupportedServerBakeAppearance()
-{
- // Need to check only if we have a server baked appearance and are
- // in a non-baking region.
- if (!gAgentAvatarp->isUsingServerBakes())
- return;
- if (!gAgent.getRegion() || gAgent.getRegion()->getCentralBakeVersion()!=0)
- return;
-
- // if baked image service is unknown, need to refresh.
- if (LLAppearanceMgr::instance().getAppearanceServiceURL().empty())
- {
- CheckAgentAppearanceServiceResponder::forceAppearanceUpdate();
- }
- // query baked image service to check status.
- std::string image_url = gAgentAvatarp->getImageURL(TEX_HEAD_BAKED,
- getTE(TEX_HEAD_BAKED)->getID());
- LLHTTPClient::head(image_url, new CheckAgentAppearanceServiceResponder);
-}
-
const LLUUID& LLVOAvatarSelf::grabBakedTexture(EBakedTextureIndex baked_index) const
{
if (canGrabBakedTexture(baked_index))
@@ -2504,7 +2305,7 @@ BOOL LLVOAvatarSelf::canGrabBakedTexture(EBakedTextureIndex baked_index) const
// Check if the texture hasn't been baked yet.
if (!isTextureDefined(tex_index, 0))
{
- lldebugs << "getTEImage( " << (U32) tex_index << " )->getID() == IMG_DEFAULT_AVATAR" << llendl;
+ LL_DEBUGS() << "getTEImage( " << (U32) tex_index << " )->getID() == IMG_DEFAULT_AVATAR" << LL_ENDL;
return FALSE;
}
@@ -2523,7 +2324,7 @@ BOOL LLVOAvatarSelf::canGrabBakedTexture(EBakedTextureIndex baked_index) const
const ETextureIndex t_index = (*iter);
LLWearableType::EType wearable_type = LLAvatarAppearanceDictionary::getTEWearableType(t_index);
U32 count = gAgentWearables.getWearableCount(wearable_type);
- lldebugs << "Checking index " << (U32) t_index << " count: " << count << llendl;
+ LL_DEBUGS() << "Checking index " << (U32) t_index << " count: " << count << LL_ENDL;
for (U32 wearable_index = 0; wearable_index < count; ++wearable_index)
{
@@ -2545,11 +2346,11 @@ BOOL LLVOAvatarSelf::canGrabBakedTexture(EBakedTextureIndex baked_index) const
asset_id_matches);
BOOL can_grab = FALSE;
- lldebugs << "item count for asset " << texture_id << ": " << items.count() << llendl;
- if (items.count())
+ LL_DEBUGS() << "item count for asset " << texture_id << ": " << items.size() << LL_ENDL;
+ if (items.size())
{
// search for full permissions version
- for (S32 i = 0; i < items.count(); i++)
+ for (S32 i = 0; i < items.size(); i++)
{
LLViewerInventoryItem* itemp = items[i];
if (itemp->getIsFullPerm())
@@ -2590,7 +2391,7 @@ void LLVOAvatarSelf::addLocalTextureStats( ETextureIndex type, LLViewerFetchedTe
imagep->setBoostLevel(getAvatarBoostLevel());
imagep->setAdditionalDecodePriority(SELF_ADDITIONAL_PRI) ;
imagep->resetTextureStats();
- imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL);
+ imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTUAL_SIZE_RESET_INTERVAL);
imagep->addTextureStats( desired_pixels / texel_area_ratio );
imagep->forceUpdateBindStats() ;
if (imagep->getDiscardLevel() < 0)
@@ -2636,82 +2437,6 @@ ETextureIndex LLVOAvatarSelf::getBakedTE( const LLViewerTexLayerSet* layerset )
return TEX_HEAD_BAKED;
}
-
-void LLVOAvatarSelf::setNewBakedTexture(LLAvatarAppearanceDefines::EBakedTextureIndex i, const LLUUID &uuid)
-{
- ETextureIndex index = LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(i);
- setNewBakedTexture(index, uuid);
-}
-
-
-//-----------------------------------------------------------------------------
-// setNewBakedTexture()
-// A new baked texture has been successfully uploaded and we can start using it now.
-//-----------------------------------------------------------------------------
-void LLVOAvatarSelf::setNewBakedTexture( ETextureIndex te, const LLUUID& uuid )
-{
- // Baked textures live on other sims.
- LLHost target_host = getObjectHost();
- setTEImage( te, LLViewerTextureManager::getFetchedTextureFromHost( uuid, FTT_HOST_BAKE, target_host ) );
- updateMeshTextures();
- dirtyMesh();
-
- LLVOAvatar::cullAvatarsByPixelArea();
-
- /* switch(te)
- case TEX_HEAD_BAKED:
- llinfos << "New baked texture: HEAD" << llendl; */
- const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture(te);
- if (texture_dict->mIsBakedTexture)
- {
- debugBakedTextureUpload(texture_dict->mBakedTextureIndex, TRUE); // FALSE for start of upload, TRUE for finish.
- llinfos << "New baked texture: " << texture_dict->mName << " UUID: " << uuid <<llendl;
- }
- else
- {
- llwarns << "New baked texture: unknown te " << te << llendl;
- }
-
- // dumpAvatarTEs( "setNewBakedTexture() send" );
- // RN: throttle uploads
- if (!hasPendingBakedUploads())
- {
- gAgent.sendAgentSetAppearance();
-
- if (gSavedSettings.getBOOL("DebugAvatarRezTime"))
- {
- LLSD args;
- args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32());
- args["TIME"] = llformat("%d",(U32)mDebugSelfLoadTimer.getElapsedTimeF32());
- if (isAllLocalTextureDataFinal())
- {
- LLNotificationsUtil::add("AvatarRezSelfBakedDoneNotification",args);
- LL_DEBUGS("Avatar") << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32()
- << "sec ]"
- << avString()
- << "RuthTimer " << (U32)mRuthDebugTimer.getElapsedTimeF32()
- << " SelfLoadTimer " << (U32)mDebugSelfLoadTimer.getElapsedTimeF32()
- << " Notification " << "AvatarRezSelfBakedDoneNotification"
- << llendl;
- }
- else
- {
- args["STATUS"] = debugDumpAllLocalTextureDataInfo();
- LLNotificationsUtil::add("AvatarRezSelfBakedUpdateNotification",args);
- LL_DEBUGS("Avatar") << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32()
- << "sec ]"
- << avString()
- << "RuthTimer " << (U32)mRuthDebugTimer.getElapsedTimeF32()
- << " SelfLoadTimer " << (U32)mDebugSelfLoadTimer.getElapsedTimeF32()
- << " Notification " << "AvatarRezSelfBakedUpdateNotification"
- << llendl;
- }
- }
-
- outputRezDiagnostics();
- }
-}
-
// FIXME: This is not called consistently. Something may be broken.
void LLVOAvatarSelf::outputRezDiagnostics() const
{
@@ -2721,11 +2446,11 @@ void LLVOAvatarSelf::outputRezDiagnostics() const
}
const F32 final_time = mDebugSelfLoadTimer.getElapsedTimeF32();
- LL_DEBUGS("Avatar") << "REZTIME: Myself rez stats:" << llendl;
- LL_DEBUGS("Avatar") << "\t Time from avatar creation to load wearables: " << (S32)mDebugTimeWearablesLoaded << llendl;
- LL_DEBUGS("Avatar") << "\t Time from avatar creation to de-cloud: " << (S32)mDebugTimeAvatarVisible << llendl;
- LL_DEBUGS("Avatar") << "\t Time from avatar creation to de-cloud for others: " << (S32)final_time << llendl;
- LL_DEBUGS("Avatar") << "\t Load time for each texture: " << llendl;
+ LL_DEBUGS("Avatar") << "REZTIME: Myself rez stats:" << LL_ENDL;
+ LL_DEBUGS("Avatar") << "\t Time from avatar creation to load wearables: " << (S32)mDebugTimeWearablesLoaded << LL_ENDL;
+ LL_DEBUGS("Avatar") << "\t Time from avatar creation to de-cloud: " << (S32)mDebugTimeAvatarVisible << LL_ENDL;
+ LL_DEBUGS("Avatar") << "\t Time from avatar creation to de-cloud for others: " << (S32)final_time << LL_ENDL;
+ LL_DEBUGS("Avatar") << "\t Load time for each texture: " << LL_ENDL;
for (U32 i = 0; i < LLAvatarAppearanceDefines::TEX_NUM_INDICES; ++i)
{
std::stringstream out;
@@ -2753,10 +2478,10 @@ void LLVOAvatarSelf::outputRezDiagnostics() const
LL_DEBUGS("Avatar") << out.str() << LL_ENDL;
}
}
- LL_DEBUGS("Avatar") << "\t Time points for each upload (start / finish)" << llendl;
+ LL_DEBUGS("Avatar") << "\t Time points for each upload (start / finish)" << LL_ENDL;
for (U32 i = 0; i < LLAvatarAppearanceDefines::BAKED_NUM_INDICES; ++i)
{
- LL_DEBUGS("Avatar") << "\t\t (" << i << ") \t" << (S32)mDebugBakedTextureTimes[i][0] << " / " << (S32)mDebugBakedTextureTimes[i][1] << llendl;
+ LL_DEBUGS("Avatar") << "\t\t (" << i << ") \t" << (S32)mDebugBakedTextureTimes[i][0] << " / " << (S32)mDebugBakedTextureTimes[i][1] << LL_ENDL;
}
for (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::BakedTextures::const_iterator baked_iter = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().begin();
@@ -2768,7 +2493,7 @@ void LLVOAvatarSelf::outputRezDiagnostics() const
if (!layerset) continue;
const LLViewerTexLayerSetBuffer *layerset_buffer = layerset->getViewerComposite();
if (!layerset_buffer) continue;
- LL_DEBUGS("Avatar") << layerset_buffer->dumpTextureInfo() << llendl;
+ LL_DEBUGS("Avatar") << layerset_buffer->dumpTextureInfo() << LL_ENDL;
}
dumpAllTextures();
@@ -2787,92 +2512,10 @@ void LLVOAvatarSelf::reportAvatarRezTime() const
// TODO: report mDebugSelfLoadTimer.getElapsedTimeF32() somehow.
}
-//-----------------------------------------------------------------------------
-// setCachedBakedTexture()
-// A baked texture id was received from a cache query, make it active
-//-----------------------------------------------------------------------------
-void LLVOAvatarSelf::setCachedBakedTexture( ETextureIndex te, const LLUUID& uuid )
-{
- setTETexture( te, uuid );
-
- /* switch(te)
- case TEX_HEAD_BAKED:
- if( mHeadLayerSet )
- mHeadLayerSet->cancelUpload(); */
- for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
- {
- LLViewerTexLayerSet *layerset = getTexLayerSet(i);
- if ( mBakedTextureDatas[i].mTextureIndex == te && layerset)
- {
- if (mInitialBakeIDs[i] != LLUUID::null)
- {
- if (mInitialBakeIDs[i] == uuid)
- {
- llinfos << "baked texture correctly loaded at login! " << i << llendl;
- }
- else
- {
- llwarns << "baked texture does not match id loaded at login!" << i << llendl;
- }
- mInitialBakeIDs[i] = LLUUID::null;
- }
- layerset->cancelUpload();
- }
- }
-}
-
-// static
-void LLVOAvatarSelf::processRebakeAvatarTextures(LLMessageSystem* msg, void**)
-{
- LLUUID texture_id;
- msg->getUUID("TextureData", "TextureID", texture_id);
- if (!isAgentAvatarValid()) return;
-
- // If this is a texture corresponding to one of our baked entries,
- // just rebake that layer set.
- BOOL found = FALSE;
-
- /* ETextureIndex baked_texture_indices[BAKED_NUM_INDICES] =
- TEX_HEAD_BAKED,
- TEX_UPPER_BAKED, */
- for (LLAvatarAppearanceDictionary::Textures::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getTextures().begin();
- iter != LLAvatarAppearanceDictionary::getInstance()->getTextures().end();
- ++iter)
- {
- const ETextureIndex index = iter->first;
- const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter->second;
- if (texture_dict->mIsBakedTexture)
- {
- if (texture_id == gAgentAvatarp->getTEImage(index)->getID())
- {
- LLViewerTexLayerSet* layer_set = gAgentAvatarp->getLayerSet(index);
- if (layer_set)
- {
- llinfos << "TAT: rebake - matched entry " << (S32)index << llendl;
- gAgentAvatarp->invalidateComposite(layer_set, TRUE);
- found = TRUE;
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TEX_REBAKES);
- }
- }
- }
- }
-
- // If texture not found, rebake all entries.
- if (!found)
- {
- gAgentAvatarp->forceBakeAllTextures();
- }
- else
- {
- // Not sure if this is necessary, but forceBakeAllTextures() does it.
- gAgentAvatarp->updateMeshTextures();
- }
-}
-
-
+// SUNSHINE CLEANUP - not clear we need any of this, may be sufficient to request server appearance in llviewermenu.cpp:handle_rebake_textures()
void LLVOAvatarSelf::forceBakeAllTextures(bool slam_for_debug)
{
- llinfos << "TAT: forced full rebake. " << llendl;
+ LL_INFOS() << "TAT: forced full rebake. " << LL_ENDL;
for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
{
@@ -2883,15 +2526,14 @@ void LLVOAvatarSelf::forceBakeAllTextures(bool slam_for_debug)
if (slam_for_debug)
{
layer_set->setUpdatesEnabled(TRUE);
- layer_set->cancelUpload();
}
- invalidateComposite(layer_set, TRUE);
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TEX_REBAKES);
+ invalidateComposite(layer_set);
+ add(LLStatViewer::TEX_REBAKES, 1);
}
else
{
- llwarns << "TAT: NO LAYER SET FOR " << (S32)baked_index << llendl;
+ LL_WARNS() << "TAT: NO LAYER SET FOR " << (S32)baked_index << LL_ENDL;
}
}
@@ -2955,6 +2597,11 @@ void LLVOAvatarSelf::onCustomizeStart(bool disable_camera_switch)
{
if (isAgentAvatarValid())
{
+ if (!gAgentAvatarp->mEndCustomizeCallback.get())
+ {
+ gAgentAvatarp->mEndCustomizeCallback = new LLUpdateAppearanceOnDestroy;
+ }
+
gAgentAvatarp->mIsEditingAppearance = true;
gAgentAvatarp->mUseLocalAppearance = true;
@@ -2981,12 +2628,6 @@ void LLVOAvatarSelf::onCustomizeEnd(bool disable_camera_switch)
if (isAgentAvatarValid())
{
gAgentAvatarp->mIsEditingAppearance = false;
- if (gAgentAvatarp->getRegion() && !gAgentAvatarp->getRegion()->getCentralBakeVersion())
- {
- // FIXME DRANO - move to sendAgentSetAppearance, make conditional on upload complete.
- gAgentAvatarp->mUseLocalAppearance = false;
- }
-
gAgentAvatarp->invalidateAll();
if (gSavedSettings.getBOOL("AppearanceCameraMovement") && !disable_camera_switch)
@@ -2994,8 +2635,11 @@ void LLVOAvatarSelf::onCustomizeEnd(bool disable_camera_switch)
gAgentCamera.changeCameraToDefault();
gAgentCamera.resetView();
}
-
- LLAppearanceMgr::instance().updateAppearanceFromCOF();
+
+ // Dereferencing the previous callback will cause
+ // updateAppearanceFromCOF to be called, whenever all refs
+ // have resolved.
+ gAgentAvatarp->mEndCustomizeCallback = NULL;
}
}
@@ -3062,29 +2706,28 @@ BOOL LLVOAvatarSelf::needsRenderBeam()
// static
void LLVOAvatarSelf::deleteScratchTextures()
{
- for( LLGLuint* namep = sScratchTexNames.getFirstData();
- namep;
- namep = sScratchTexNames.getNextData() )
+ for(std::map< LLGLenum, LLGLuint*>::iterator it = sScratchTexNames.begin(), end_it = sScratchTexNames.end();
+ it != end_it;
+ ++it)
{
- LLImageGL::deleteTextures(1, (U32 *)namep );
+ LLImageGL::deleteTextures(1, (U32 *)it->second );
stop_glerror();
}
- if( sScratchTexBytes )
+ if( sScratchTexBytes.value() )
{
- lldebugs << "Clearing Scratch Textures " << (sScratchTexBytes/1024) << "KB" << llendl;
+ LL_DEBUGS() << "Clearing Scratch Textures " << (S32Kilobytes)sScratchTexBytes << LL_ENDL;
- sScratchTexNames.deleteAllData();
- sScratchTexLastBindTime.deleteAllData();
- LLImageGL::sGlobalTextureMemoryInBytes -= sScratchTexBytes;
- sScratchTexBytes = 0;
+ delete_and_clear(sScratchTexNames);
+ LLImageGL::sGlobalTextureMemory -= sScratchTexBytes;
+ sScratchTexBytes = S32Bytes(0);
}
}
// static
void LLVOAvatarSelf::dumpScratchTextureByteCount()
{
- llinfos << "Scratch Texture GL: " << (sScratchTexBytes/1024) << "KB" << llendl;
+ LL_INFOS() << "Scratch Texture GL: " << (sScratchTexBytes/1024) << "KB" << LL_ENDL;
}
void LLVOAvatarSelf::dumpWearableInfo(LLAPRFile& outfile)
diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h
index 521c86e1c3..e03de9fa0b 100755
--- a/indra/newview/llvoavatarself.h
+++ b/indra/newview/llvoavatarself.h
@@ -30,8 +30,10 @@
#include "llviewertexture.h"
#include "llvoavatar.h"
+#include <map>
struct LocalTextureData;
+class LLInventoryCallback;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -49,16 +51,6 @@ class LLVOAvatarSelf :
**/
public:
- void* operator new(size_t size)
- {
- return ll_aligned_malloc_16(size);
- }
-
- void operator delete(void* ptr)
- {
- ll_aligned_free_16(ptr);
- }
-
LLVOAvatarSelf(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
virtual ~LLVOAvatarSelf();
virtual void markDead();
@@ -96,21 +88,15 @@ public:
void resetJointPositions( void );
- /*virtual*/ BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight, BOOL upload_bake = FALSE );
- /*virtual*/ BOOL setVisualParamWeight(const char* param_name, F32 weight, BOOL upload_bake = FALSE );
- /*virtual*/ BOOL setVisualParamWeight(S32 index, F32 weight, BOOL upload_bake = FALSE );
+ /*virtual*/ BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight);
+ /*virtual*/ BOOL setVisualParamWeight(const char* param_name, F32 weight);
+ /*virtual*/ BOOL setVisualParamWeight(S32 index, F32 weight);
/*virtual*/ void updateVisualParams();
/*virtual*/ void idleUpdateAppearanceAnimation();
- /*virtual*/ U32 processUpdateMessage(LLMessageSystem *mesgsys,
- void **user_data,
- U32 block_num,
- const EObjectUpdateType update_type,
- LLDataPacker *dp);
-
private:
// helper function. Passed in param is assumed to be in avatar's parameter list.
- BOOL setParamWeight(const LLViewerVisualParam *param, F32 weight, BOOL upload_bake = FALSE );
+ BOOL setParamWeight(const LLViewerVisualParam *param, F32 weight);
@@ -138,6 +124,7 @@ public:
public:
/*virtual*/ BOOL updateCharacter(LLAgent &agent);
/*virtual*/ void idleUpdateTractorBeam();
+ bool checkStuckAppearance();
//--------------------------------------------------------------------
// Loading state
@@ -194,12 +181,10 @@ public:
// Loading status
//--------------------------------------------------------------------
public:
- /*virtual*/ bool hasPendingBakedUploads() const;
S32 getLocalDiscardLevel(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const;
bool areTexturesCurrent() const;
BOOL isLocalTextureDataAvailable(const LLViewerTexLayerSet* layerset) const;
BOOL isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset) const;
- BOOL isBakedTextureFinal(const LLAvatarAppearanceDefines::EBakedTextureIndex index) const;
// If you want to check all textures of a given type, pass gAgentWearables.getWearableCount() for index
/*virtual*/ BOOL isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const;
/*virtual*/ BOOL isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, U32 index = 0) const;
@@ -234,11 +219,8 @@ private:
//--------------------------------------------------------------------
public:
LLAvatarAppearanceDefines::ETextureIndex getBakedTE(const LLViewerTexLayerSet* layerset ) const;
- void setNewBakedTexture(LLAvatarAppearanceDefines::EBakedTextureIndex i, const LLUUID &uuid);
- void setNewBakedTexture(LLAvatarAppearanceDefines::ETextureIndex i, const LLUUID& uuid);
- void setCachedBakedTexture(LLAvatarAppearanceDefines::ETextureIndex i, const LLUUID& uuid);
+ // SUNSHINE CLEANUP - dead? or update to just call request appearance update?
void forceBakeAllTextures(bool slam_for_debug = false);
- static void processRebakeAvatarTextures(LLMessageSystem* msg, void**);
protected:
/*virtual*/ void removeMissingBakedTextures();
@@ -246,8 +228,6 @@ protected:
// Layers
//--------------------------------------------------------------------
public:
- void requestLayerSetUploads();
- void requestLayerSetUpload(LLAvatarAppearanceDefines::EBakedTextureIndex i);
void requestLayerSetUpdate(LLAvatarAppearanceDefines::ETextureIndex i);
LLViewerTexLayerSet* getLayerSet(LLAvatarAppearanceDefines::EBakedTextureIndex baked_index) const;
LLViewerTexLayerSet* getLayerSet(LLAvatarAppearanceDefines::ETextureIndex index) const;
@@ -257,7 +237,7 @@ public:
// Composites
//--------------------------------------------------------------------
public:
- /* virtual */ void invalidateComposite(LLTexLayerSet* layerset, BOOL upload_result);
+ /* virtual */ void invalidateComposite(LLTexLayerSet* layerset);
/* virtual */ void invalidateAll();
/* virtual */ void setCompositeUpdatesEnabled(bool b); // only works for self
/* virtual */ void setCompositeUpdatesEnabled(U32 index, bool b);
@@ -275,9 +255,8 @@ public:
public:
static void deleteScratchTextures();
private:
- static S32 sScratchTexBytes;
- static LLMap< LLGLenum, LLGLuint*> sScratchTexNames;
- static LLMap< LLGLenum, F32*> sScratchTexLastBindTime;
+ static S32Bytes sScratchTexBytes;
+ static std::map< LLGLenum, LLGLuint*> sScratchTexNames;
/** Textures
** **
@@ -300,7 +279,7 @@ protected:
**/
public:
- void wearableUpdated(LLWearableType::EType type, BOOL upload_result);
+ void wearableUpdated(LLWearableType::EType type);
protected:
U32 getNumWearables(LLAvatarAppearanceDefines::ETextureIndex i) const;
@@ -341,6 +320,7 @@ private:
public:
static void onCustomizeStart(bool disable_camera_switch = false);
static void onCustomizeEnd(bool disable_camera_switch = false);
+ LLPointer<LLInventoryCallback> mEndCustomizeCallback;
//--------------------------------------------------------------------
// Visibility
@@ -402,7 +382,6 @@ public:
const std::string debugDumpLocalTextureDataInfo(const LLViewerTexLayerSet* layerset) const; // Lists out state of this particular baked texture layer
const std::string debugDumpAllLocalTextureDataInfo() const; // Lists out which baked textures are at highest LOD
void sendViewerAppearanceChangeMetrics(); // send data associated with completing a change.
- void checkForUnsupportedServerBakeAppearance();
private:
LLFrameTimer mDebugSelfLoadTimer;
F32 mDebugTimeWearablesLoaded;
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index 7db19c5c1b..fd1d57a9d0 100755
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -29,6 +29,20 @@
#include "llerror.h"
#include "llregionhandle.h"
#include "llviewercontrol.h"
+#include "llviewerobjectlist.h"
+#include "lldrawable.h"
+#include "llviewerregion.h"
+#include "pipeline.h"
+#include "llagentcamera.h"
+#include "llmemory.h"
+
+//static variables
+U32 LLVOCacheEntry::sMinFrameRange = 0;
+F32 LLVOCacheEntry::sNearRadius = 1.0f;
+F32 LLVOCacheEntry::sRearFarRadius = 1.0f;
+F32 LLVOCacheEntry::sFrontPixelThreshold = 1.0f;
+F32 LLVOCacheEntry::sRearPixelThreshold = 1.0f;
+BOOL LLVOCachePartition::sNeedsOcclusionCheck = FALSE;
BOOL check_read(LLAPRFile* apr_file, void* src, S32 n_bytes)
{
@@ -46,12 +60,19 @@ BOOL check_write(LLAPRFile* apr_file, void* src, S32 n_bytes)
//---------------------------------------------------------------------------
LLVOCacheEntry::LLVOCacheEntry(U32 local_id, U32 crc, LLDataPackerBinaryBuffer &dp)
- :
+: LLTrace::MemTrackable<LLVOCacheEntry, 16>("LLVOCacheEntry"),
+ LLViewerOctreeEntryData(LLViewerOctreeEntry::LLVOCACHEENTRY),
mLocalID(local_id),
mCRC(crc),
+ mUpdateFlags(-1),
mHitCount(0),
mDupeCount(0),
- mCRCChangeCount(0)
+ mCRCChangeCount(0),
+ mState(INACTIVE),
+ mSceneContrib(0.f),
+ mValid(TRUE),
+ mParentID(0),
+ mBSphereRadius(-1.0f)
{
mBuffer = new U8[dp.getBufferSize()];
mDP.assignBuffer(mBuffer, dp.getBufferSize());
@@ -59,24 +80,40 @@ LLVOCacheEntry::LLVOCacheEntry(U32 local_id, U32 crc, LLDataPackerBinaryBuffer &
}
LLVOCacheEntry::LLVOCacheEntry()
- :
+: LLTrace::MemTrackable<LLVOCacheEntry, 16>("LLVOCacheEntry"),
+ LLViewerOctreeEntryData(LLViewerOctreeEntry::LLVOCACHEENTRY),
mLocalID(0),
mCRC(0),
+ mUpdateFlags(-1),
mHitCount(0),
mDupeCount(0),
mCRCChangeCount(0),
- mBuffer(NULL)
+ mBuffer(NULL),
+ mState(INACTIVE),
+ mSceneContrib(0.f),
+ mValid(TRUE),
+ mParentID(0),
+ mBSphereRadius(-1.0f)
{
mDP.assignBuffer(mBuffer, 0);
}
LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file)
- : mBuffer(NULL)
+: LLTrace::MemTrackable<LLVOCacheEntry, 16>("LLVOCacheEntry"),
+ LLViewerOctreeEntryData(LLViewerOctreeEntry::LLVOCACHEENTRY),
+ mBuffer(NULL),
+ mUpdateFlags(-1),
+ mState(INACTIVE),
+ mSceneContrib(0.f),
+ mValid(FALSE),
+ mParentID(0),
+ mBSphereRadius(-1.0f)
{
S32 size = -1;
BOOL success;
mDP.assignBuffer(mBuffer, 0);
+
success = check_read(apr_file, &mLocalID, sizeof(U32));
if(success)
{
@@ -104,7 +141,7 @@ LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file)
// We've got a bogus size, skip reading it.
// We won't bother seeking, because the rest of this file
// is likely bogus, and will be tossed anyway.
- llwarns << "Bogus cache entry, size " << size << ", aborting!" << llendl;
+ LL_WARNS() << "Bogus cache entry, size " << size << ", aborting!" << LL_ENDL;
success = FALSE;
}
}
@@ -132,6 +169,8 @@ LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file)
mDupeCount = 0;
mCRCChangeCount = 0;
mBuffer = NULL;
+ mEntry = NULL;
+ mState = INACTIVE;
}
}
@@ -140,37 +179,156 @@ LLVOCacheEntry::~LLVOCacheEntry()
mDP.freeBuffer();
}
-
-// New CRC means the object has changed.
-void LLVOCacheEntry::assignCRC(U32 crc, LLDataPackerBinaryBuffer &dp)
+void LLVOCacheEntry::updateEntry(U32 crc, LLDataPackerBinaryBuffer &dp)
{
- if ( (mCRC != crc)
- ||(mDP.getBufferSize() == 0))
+ if(mCRC != crc)
{
mCRC = crc;
- mHitCount = 0;
mCRCChangeCount++;
+ }
+
+ mDP.freeBuffer();
+
+ llassert_always(dp.getBufferSize() > 0);
+ mBuffer = new U8[dp.getBufferSize()];
+ mDP.assignBuffer(mBuffer, dp.getBufferSize());
+ mDP = dp;
+}
+
+void LLVOCacheEntry::setParentID(U32 id)
+{
+ if(mParentID != id)
+ {
+ removeAllChildren();
+ mParentID = id;
+ }
+}
+
+void LLVOCacheEntry::removeAllChildren()
+{
+ if(mChildrenList.empty())
+ {
+ return;
+ }
+
+ for(vocache_entry_set_t::iterator iter = mChildrenList.begin(); iter != mChildrenList.end(); ++iter)
+ {
+ (*iter)->setParentID(0);
+ }
+ mChildrenList.clear();
+
+ return;
+}
- mDP.freeBuffer();
- mBuffer = new U8[dp.getBufferSize()];
- mDP.assignBuffer(mBuffer, dp.getBufferSize());
- mDP = dp;
+//virtual
+void LLVOCacheEntry::setOctreeEntry(LLViewerOctreeEntry* entry)
+{
+ if(!entry && mDP.getBufferSize() > 0)
+ {
+ LLUUID fullid;
+ LLViewerObject::unpackUUID(&mDP, fullid, "ID");
+
+ LLViewerObject* obj = gObjectList.findObject(fullid);
+ if(obj && obj->mDrawable)
+ {
+ entry = obj->mDrawable->getEntry();
+ }
}
+
+ LLViewerOctreeEntryData::setOctreeEntry(entry);
}
-LLDataPackerBinaryBuffer *LLVOCacheEntry::getDP(U32 crc)
+void LLVOCacheEntry::setState(U32 state)
{
- if ( (mCRC != crc)
- ||(mDP.getBufferSize() == 0))
+ if(state > LOW_BITS) //special states
{
- //llinfos << "Not getting cache entry, invalid!" << llendl;
+ mState |= (HIGH_BITS & state);
+ return;
+ }
+
+ //
+ //otherwise LOW_BITS states
+ //
+ clearState(LOW_BITS);
+ mState |= (LOW_BITS & state);
+
+ if(getState() == ACTIVE)
+ {
+ const S32 MIN_INTERVAL = 64 + sMinFrameRange;
+ U32 last_visible = getVisible();
+
+ setVisible();
+
+ U32 cur_visible = getVisible();
+ if(cur_visible - last_visible > MIN_INTERVAL ||
+ cur_visible < MIN_INTERVAL)
+ {
+ mLastCameraUpdated = 0; //reset
+ }
+ else
+ {
+ mLastCameraUpdated = LLViewerRegion::sLastCameraUpdated;
+ }
+ }
+}
+
+void LLVOCacheEntry::addChild(LLVOCacheEntry* entry)
+{
+ llassert(entry != NULL);
+ llassert(entry->getParentID() == mLocalID);
+ llassert(entry->getEntry() != NULL);
+
+ if(!entry || !entry->getEntry() || entry->getParentID() != mLocalID)
+ {
+ return;
+ }
+
+ mChildrenList.insert(entry);
+
+ //update parent bbox
+ if(getEntry() != NULL && isState(INACTIVE))
+ {
+ updateParentBoundingInfo(entry);
+ resetVisible();
+ }
+}
+
+void LLVOCacheEntry::removeChild(LLVOCacheEntry* entry)
+{
+ entry->setParentID(0);
+
+ vocache_entry_set_t::iterator iter = mChildrenList.find(entry);
+ if(iter != mChildrenList.end())
+ {
+ mChildrenList.erase(iter);
+ }
+}
+
+//remove the first child, and return it.
+LLVOCacheEntry* LLVOCacheEntry::getChild()
+{
+ LLVOCacheEntry* child = NULL;
+ vocache_entry_set_t::iterator iter = mChildrenList.begin();
+ if(iter != mChildrenList.end())
+ {
+ child = *iter;
+ mChildrenList.erase(iter);
+ }
+
+ return child;
+}
+
+LLDataPackerBinaryBuffer *LLVOCacheEntry::getDP()
+{
+ if (mDP.getBufferSize() == 0)
+ {
+ //LL_INFOS() << "Not getting cache entry, invalid!" << LL_ENDL;
return NULL;
}
- mHitCount++;
+
return &mDP;
}
-
void LLVOCacheEntry::recordHit()
{
mHitCount++;
@@ -179,12 +337,12 @@ void LLVOCacheEntry::recordHit()
void LLVOCacheEntry::dump() const
{
- llinfos << "local " << mLocalID
+ LL_INFOS() << "local " << mLocalID
<< " crc " << mCRC
<< " hits " << mHitCount
<< " dupes " << mDupeCount
<< " change " << mCRCChangeCount
- << llendl;
+ << LL_ENDL;
}
BOOL LLVOCacheEntry::writeToFile(LLAPRFile* apr_file) const
@@ -221,49 +379,675 @@ BOOL LLVOCacheEntry::writeToFile(LLAPRFile* apr_file) const
return success ;
}
+//static
+void LLVOCacheEntry::updateDebugSettings()
+{
+ static LLFrameTimer timer;
+ if(timer.getElapsedTimeF32() < 1.0f) //update frequency once per second.
+ {
+ return;
+ }
+ timer.reset();
+
+ //the number of frames invisible objects stay in memory
+ static LLCachedControl<U32> inv_obj_time(gSavedSettings,"NonvisibleObjectsInMemoryTime");
+ sMinFrameRange = inv_obj_time - 1; //make 0 to be the maximum
+
+ //min radius: all objects within this radius remain loaded in memory
+ static LLCachedControl<F32> min_radius(gSavedSettings,"SceneLoadMinRadius");
+ sNearRadius = llmin((F32)min_radius, gAgentCamera.mDrawDistance); //can not exceed the draw distance
+ sNearRadius = llmax(sNearRadius, 1.f); //minimum value is 1.0m
+
+ //objects within the view frustum whose visible area is greater than this threshold will be loaded
+ static LLCachedControl<F32> front_pixel_threshold(gSavedSettings,"SceneLoadFrontPixelThreshold");
+ sFrontPixelThreshold = front_pixel_threshold;
+
+ //objects out of the view frustum whose visible area is greater than this threshold will remain loaded
+ static LLCachedControl<F32> rear_pixel_threshold(gSavedSettings,"SceneLoadRearPixelThreshold");
+ sRearPixelThreshold = rear_pixel_threshold;
+ sRearPixelThreshold = llmax(sRearPixelThreshold, sFrontPixelThreshold); //can not be smaller than sFrontPixelThreshold.
+
+ // a percentage of draw distance beyond which all objects outside of view frustum will be unloaded, regardless of pixel threshold
+ static LLCachedControl<F32> rear_max_radius_frac(gSavedSettings,"SceneLoadRearMaxRadiusFraction");
+ sRearFarRadius = llmax(rear_max_radius_frac * gAgentCamera.mDrawDistance / 100.f, 1.0f); //minimum value is 1.0m
+ sRearFarRadius = llmax(sRearFarRadius, (F32)min_radius); //can not be less than "SceneLoadMinRadius".
+ sRearFarRadius = llmin(sRearFarRadius, gAgentCamera.mDrawDistance); //can not be more than the draw distance.
+
+ //make the above parameters adaptive to memory usage
+ //starts to put restrictions from low_mem_bound_MB, apply tightest restrictions when hits high_mem_bound_MB
+ static LLCachedControl<U32> low_mem_bound_MB(gSavedSettings,"SceneLoadLowMemoryBound");
+ static LLCachedControl<U32> high_mem_bound_MB(gSavedSettings,"SceneLoadHighMemoryBound");
+
+ LLMemory::updateMemoryInfo() ;
+ U32 allocated_mem = LLMemory::getAllocatedMemKB().value();
+ allocated_mem /= 1024; //convert to MB.
+ if(allocated_mem < low_mem_bound_MB)
+ {
+ return;
+ }
+ F32 adjust_factor = llmax(0.f, (F32)(high_mem_bound_MB - allocated_mem) / (high_mem_bound_MB - low_mem_bound_MB));
+
+ sRearFarRadius = llmin(adjust_factor * sRearFarRadius, 96.f); //[0.f, 96.f]
+ sMinFrameRange = (U32)llclamp(adjust_factor * sMinFrameRange, 10.f, 64.f); //[10, 64]
+ sNearRadius = llmax(adjust_factor * sNearRadius, 1.0f);
+}
+
+//static
+F32 LLVOCacheEntry::getSquaredPixelThreshold(bool is_front)
+{
+ F32 threshold;
+ if(is_front)
+ {
+ threshold = sFrontPixelThreshold;
+ }
+ else
+ {
+ threshold = sRearPixelThreshold;
+ }
+
+ //object projected area threshold
+ F32 pixel_meter_ratio = LLViewerCamera::getInstance()->getPixelMeterRatio();
+ F32 projection_threshold = pixel_meter_ratio > 0.f ? threshold / pixel_meter_ratio : 0.f;
+ projection_threshold *= projection_threshold;
+
+ return projection_threshold;
+}
+
+bool LLVOCacheEntry::isAnyVisible(const LLVector4a& camera_origin, const LLVector4a& local_camera_origin, F32 dist_threshold)
+{
+ LLOcclusionCullingGroup* group = (LLOcclusionCullingGroup*)getGroup();
+ if(!group)
+ {
+ return false;
+ }
+
+ //any visible
+ bool vis = group->isAnyRecentlyVisible();
+
+ //not ready to remove
+ if(!vis)
+ {
+ S32 cur_vis = llmax(group->getAnyVisible(), (S32)getVisible());
+ vis = (cur_vis + sMinFrameRange > LLViewerOctreeEntryData::getCurrentFrame());
+ }
+
+ //within the back sphere
+ if(!vis && !mParentID && !group->isOcclusionState(LLOcclusionCullingGroup::OCCLUDED))
+ {
+ LLVector4a lookAt;
+
+ if(mBSphereRadius > 0.f)
+ {
+ lookAt.setSub(mBSphereCenter, local_camera_origin);
+ dist_threshold += mBSphereRadius;
+ }
+ else
+ {
+ lookAt.setSub(getPositionGroup(), camera_origin);
+ dist_threshold += getBinRadius();
+ }
+
+ vis = (lookAt.dot3(lookAt).getF32() < dist_threshold * dist_threshold);
+ }
+
+ return vis;
+}
+
+void LLVOCacheEntry::calcSceneContribution(const LLVector4a& camera_origin, bool needs_update, U32 last_update, F32 max_dist)
+{
+ if(!needs_update && getVisible() >= last_update)
+ {
+ return; //no need to update
+ }
+
+ LLVector4a lookAt;
+ lookAt.setSub(getPositionGroup(), camera_origin);
+ F32 distance = lookAt.getLength3().getF32();
+ distance -= sNearRadius;
+
+ if(distance <= 0.f)
+ {
+ //nearby objects, set a large number
+ const F32 LARGE_SCENE_CONTRIBUTION = 1000.f; //a large number to force to load the object.
+ mSceneContrib = LARGE_SCENE_CONTRIBUTION;
+ }
+ else
+ {
+ F32 rad = getBinRadius();
+ max_dist += rad;
+
+ if(distance + sNearRadius < max_dist)
+ {
+ mSceneContrib = (rad * rad) / distance;
+ }
+ else
+ {
+ mSceneContrib = 0.f; //out of draw distance, not to load
+ }
+ }
+
+ setVisible();
+}
+
+void LLVOCacheEntry::saveBoundingSphere()
+{
+ mBSphereCenter = getPositionGroup();
+ mBSphereRadius = getBinRadius();
+}
+
+void LLVOCacheEntry::setBoundingInfo(const LLVector3& pos, const LLVector3& scale)
+{
+ LLVector4a center, newMin, newMax;
+ center.load3(pos.mV);
+ LLVector4a size;
+ size.load3(scale.mV);
+ newMin.setSub(center, size);
+ newMax.setAdd(center, size);
+
+ setPositionGroup(center);
+ setSpatialExtents(newMin, newMax);
+
+ if(getNumOfChildren() > 0) //has children
+ {
+ updateParentBoundingInfo();
+ }
+ else
+ {
+ setBinRadius(llmin(size.getLength3().getF32() * 4.f, 256.f));
+ }
+}
+
+//make the parent bounding box to include all children
+void LLVOCacheEntry::updateParentBoundingInfo()
+{
+ if(mChildrenList.empty())
+ {
+ return;
+ }
+
+ for(vocache_entry_set_t::iterator iter = mChildrenList.begin(); iter != mChildrenList.end(); ++iter)
+ {
+ updateParentBoundingInfo(*iter);
+ }
+ resetVisible();
+}
+
+//make the parent bounding box to include this child
+void LLVOCacheEntry::updateParentBoundingInfo(const LLVOCacheEntry* child)
+{
+ const LLVector4a* child_exts = child->getSpatialExtents();
+ LLVector4a newMin, newMax;
+ newMin = child_exts[0];
+ newMax = child_exts[1];
+
+ //move to regional space.
+ {
+ const LLVector4a& parent_pos = getPositionGroup();
+ newMin.add(parent_pos);
+ newMax.add(parent_pos);
+ }
+
+ //update parent's bbox(min, max)
+ const LLVector4a* parent_exts = getSpatialExtents();
+ update_min_max(newMin, newMax, parent_exts[0]);
+ update_min_max(newMin, newMax, parent_exts[1]);
+ for(S32 i = 0; i < 4; i++)
+ {
+ llclamp(newMin[i], 0.f, 256.f);
+ llclamp(newMax[i], 0.f, 256.f);
+ }
+ setSpatialExtents(newMin, newMax);
+
+ //update parent's bbox center
+ LLVector4a center;
+ center.setAdd(newMin, newMax);
+ center.mul(0.5f);
+ setPositionGroup(center);
+
+ //update parent's bbox size vector
+ LLVector4a size;
+ size.setSub(newMax, newMin);
+ size.mul(0.5f);
+ setBinRadius(llmin(size.getLength3().getF32() * 4.f, 256.f));
+}
//-------------------------------------------------------------------
-//LLVOCache
+//LLVOCachePartition
//-------------------------------------------------------------------
-// Format string used to construct filename for the object cache
-static const char OBJECT_CACHE_FILENAME[] = "objects_%d_%d.slc";
+LLVOCacheGroup::~LLVOCacheGroup()
+{
+ if(mOcclusionState[LLViewerCamera::CAMERA_WORLD] & ACTIVE_OCCLUSION)
+ {
+ ((LLVOCachePartition*)mSpatialPartition)->removeOccluder(this);
+ }
+}
-const U32 MAX_NUM_OBJECT_ENTRIES = 128 ;
-const U32 MIN_ENTRIES_TO_PURGE = 16 ;
-const U32 INVALID_TIME = 0 ;
-const char* object_cache_dirname = "objectcache";
-const char* header_filename = "object.cache";
+//virtual
+void LLVOCacheGroup::handleChildAddition(const OctreeNode* parent, OctreeNode* child)
+{
+ if (child->getListenerCount() == 0)
+ {
+ new LLVOCacheGroup(child, mSpatialPartition);
+ }
+ else
+ {
+ OCT_ERRS << "LLVOCacheGroup redundancy detected." << LL_ENDL;
+ }
-LLVOCache* LLVOCache::sInstance = NULL;
+ unbound();
+
+ ((LLViewerOctreeGroup*)child->getListener(0))->unbound();
+}
-//static
-LLVOCache* LLVOCache::getInstance()
-{
- if(!sInstance)
+LLVOCachePartition::LLVOCachePartition(LLViewerRegion* regionp)
+: LLTrace::MemTrackable<LLVOCachePartition>("LLVOCachePartition")
+{
+ mLODPeriod = 16;
+ mRegionp = regionp;
+ mPartitionType = LLViewerRegion::PARTITION_VO_CACHE;
+ mBackSlectionEnabled = -1;
+ mIdleHash = 0;
+
+ for(S32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++)
{
- sInstance = new LLVOCache() ;
+ mCulledTime[i] = 0;
}
- return sInstance ;
+ mCullHistory = -1;
+
+ new LLVOCacheGroup(mOctree, this);
}
-//static
-BOOL LLVOCache::hasInstance()
+bool LLVOCachePartition::addEntry(LLViewerOctreeEntry* entry)
{
- return sInstance != NULL ;
+ llassert(entry->hasVOCacheEntry());
+
+ if(!llfinite(entry->getBinRadius()) || !entry->getPositionGroup().isFinite3())
+ {
+ return false; //data corrupted
+ }
+
+ mOctree->insert(entry);
+
+ return true;
}
+
+void LLVOCachePartition::removeEntry(LLViewerOctreeEntry* entry)
+{
+ entry->getVOCacheEntry()->setGroup(NULL);
-//static
-void LLVOCache::destroyClass()
+ llassert(!entry->getGroup());
+}
+
+class LLVOCacheOctreeCull : public LLViewerOctreeCull
+{
+public:
+ LLVOCacheOctreeCull(LLCamera* camera, LLViewerRegion* regionp,
+ const LLVector3& shift, bool use_object_cache_occlusion, F32 pixel_threshold, LLVOCachePartition* part)
+ : LLViewerOctreeCull(camera),
+ mRegionp(regionp),
+ mPartition(part),
+ mPixelThreshold(pixel_threshold)
+ {
+ mLocalShift = shift;
+ mUseObjectCacheOcclusion = use_object_cache_occlusion;
+ mNearRadius = LLVOCacheEntry::sNearRadius;
+ }
+
+ virtual bool earlyFail(LLViewerOctreeGroup* base_group)
+ {
+ if( mUseObjectCacheOcclusion &&
+ base_group->getOctreeNode()->getParent()) //never occlusion cull the root node
+ {
+ LLOcclusionCullingGroup* group = (LLOcclusionCullingGroup*)base_group;
+ if(group->needsUpdate())
+ {
+ //needs to issue new occlusion culling check, perform view culling check first.
+ return false;
+ }
+
+ group->checkOcclusion();
+
+ if (group->isOcclusionState(LLOcclusionCullingGroup::OCCLUDED))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ virtual S32 frustumCheck(const LLViewerOctreeGroup* group)
+ {
+#if 0
+ S32 res = AABBInRegionFrustumGroupBounds(group);
+#else
+ S32 res = AABBInRegionFrustumNoFarClipGroupBounds(group);
+ if (res != 0)
+ {
+ res = llmin(res, AABBRegionSphereIntersectGroupExtents(group, mLocalShift));
+ }
+#endif
+
+ return res;
+ }
+
+ virtual S32 frustumCheckObjects(const LLViewerOctreeGroup* group)
+ {
+#if 0
+ S32 res = AABBInRegionFrustumObjectBounds(group);
+#else
+ S32 res = AABBInRegionFrustumNoFarClipObjectBounds(group);
+ if (res != 0)
+ {
+ res = llmin(res, AABBRegionSphereIntersectObjectExtents(group, mLocalShift));
+ }
+#endif
+
+ if(res != 0)
+ {
+ //check if the objects projection large enough
+ const LLVector4a* exts = group->getObjectExtents();
+ res = checkProjectionArea(exts[0], exts[1], mLocalShift, mPixelThreshold, mNearRadius);
+ }
+
+ return res;
+ }
+
+ virtual void processGroup(LLViewerOctreeGroup* base_group)
+ {
+ if( !mUseObjectCacheOcclusion ||
+ !base_group->getOctreeNode()->getParent())
+ {
+ //no occlusion check
+ if(mRegionp->addVisibleGroup(base_group))
+ {
+ base_group->setVisible();
+ }
+ return;
+ }
+
+ LLOcclusionCullingGroup* group = (LLOcclusionCullingGroup*)base_group;
+ if(group->needsUpdate() || !group->isRecentlyVisible())//needs to issue new occlusion culling check.
+ {
+ mPartition->addOccluders(group);
+ group->setVisible();
+ return ; //wait for occlusion culling result
+ }
+
+ if(group->isOcclusionState(LLOcclusionCullingGroup::QUERY_PENDING) ||
+ group->isOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION))
+ {
+ //keep waiting
+ group->setVisible();
+ }
+ else
+ {
+ if(mRegionp->addVisibleGroup(base_group))
+ {
+ base_group->setVisible();
+ }
+ }
+ }
+
+private:
+ LLVOCachePartition* mPartition;
+ LLViewerRegion* mRegionp;
+ LLVector3 mLocalShift; //shift vector from agent space to local region space.
+ F32 mPixelThreshold;
+ F32 mNearRadius;
+ bool mUseObjectCacheOcclusion;
+};
+
+//select objects behind camera
+class LLVOCacheOctreeBackCull : public LLViewerOctreeCull
+{
+public:
+ LLVOCacheOctreeBackCull(LLCamera* camera, const LLVector3& shift, LLViewerRegion* regionp, F32 pixel_threshold, bool use_occlusion)
+ : LLViewerOctreeCull(camera), mRegionp(regionp), mPixelThreshold(pixel_threshold), mUseObjectCacheOcclusion(use_occlusion)
+ {
+ mLocalShift = shift;
+ mSphereRadius = LLVOCacheEntry::sRearFarRadius;
+ }
+
+ virtual bool earlyFail(LLViewerOctreeGroup* base_group)
+ {
+ if( mUseObjectCacheOcclusion &&
+ base_group->getOctreeNode()->getParent()) //never occlusion cull the root node
+ {
+ LLOcclusionCullingGroup* group = (LLOcclusionCullingGroup*)base_group;
+
+ if (group->getOcclusionState() > 0) //occlusion state is not clear.
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ virtual S32 frustumCheck(const LLViewerOctreeGroup* group)
+ {
+ const LLVector4a* exts = group->getExtents();
+ return backSphereCheck(exts[0], exts[1]);
+ }
+
+ virtual S32 frustumCheckObjects(const LLViewerOctreeGroup* group)
+ {
+ const LLVector4a* exts = group->getObjectExtents();
+ if(backSphereCheck(exts[0], exts[1]))
+ {
+ //check if the objects projection large enough
+ const LLVector4a* exts = group->getObjectExtents();
+ return checkProjectionArea(exts[0], exts[1], mLocalShift, mPixelThreshold, mSphereRadius);
+ }
+ return false;
+ }
+
+ virtual void processGroup(LLViewerOctreeGroup* base_group)
+ {
+ mRegionp->addVisibleGroup(base_group);
+ return;
+ }
+
+private:
+ //a sphere around the camera origin, including objects behind camera.
+ S32 backSphereCheck(const LLVector4a& min, const LLVector4a& max)
+ {
+ return AABBSphereIntersect(min, max, mCamera->getOrigin() - mLocalShift, mSphereRadius);
+ }
+
+private:
+ F32 mSphereRadius;
+ LLViewerRegion* mRegionp;
+ LLVector3 mLocalShift; //shift vector from agent space to local region space.
+ F32 mPixelThreshold;
+ bool mUseObjectCacheOcclusion;
+};
+
+void LLVOCachePartition::selectBackObjects(LLCamera &camera, F32 pixel_threshold, bool use_occlusion)
+{
+ if(LLViewerCamera::sCurCameraID != LLViewerCamera::CAMERA_WORLD)
+ {
+ return;
+ }
+
+ if(mBackSlectionEnabled < 0)
+ {
+ mBackSlectionEnabled = LLVOCacheEntry::sMinFrameRange - 1;
+ mBackSlectionEnabled = llmax(mBackSlectionEnabled, (S32)1);
+ }
+
+ if(!mBackSlectionEnabled)
+ {
+ return;
+ }
+
+ //localize the camera
+ LLVector3 region_agent = mRegionp->getOriginAgent();
+
+ LLVOCacheOctreeBackCull culler(&camera, region_agent, mRegionp, pixel_threshold, use_occlusion);
+ culler.traverse(mOctree);
+
+ mBackSlectionEnabled--;
+ if(!mRegionp->getNumOfVisibleGroups())
+ {
+ mBackSlectionEnabled = 0;
+ }
+
+ return;
+}
+
+S32 LLVOCachePartition::cull(LLCamera &camera, bool do_occlusion)
+{
+ static LLCachedControl<bool> use_object_cache_occlusion(gSavedSettings,"UseObjectCacheOcclusion");
+
+ if(!LLViewerRegion::sVOCacheCullingEnabled)
+ {
+ return 0;
+ }
+ if(mRegionp->isPaused())
+ {
+ return 0;
+ }
+
+ ((LLViewerOctreeGroup*)mOctree->getListener(0))->rebound();
+
+ if(LLViewerCamera::sCurCameraID != LLViewerCamera::CAMERA_WORLD)
+ {
+ return 0; //no need for those cameras.
+ }
+
+ if(mCulledTime[LLViewerCamera::sCurCameraID] == LLViewerOctreeEntryData::getCurrentFrame())
+ {
+ return 0; //already culled
+ }
+ mCulledTime[LLViewerCamera::sCurCameraID] = LLViewerOctreeEntryData::getCurrentFrame();
+
+ if(!mCullHistory && LLViewerRegion::isViewerCameraStatic())
+ {
+ U32 seed = llmax(mLODPeriod >> 1, (U32)4);
+ if(LLViewerCamera::sCurCameraID == LLViewerCamera::CAMERA_WORLD)
+ {
+ if(!(LLViewerOctreeEntryData::getCurrentFrame() % seed))
+ {
+ mIdleHash = (mIdleHash + 1) % seed;
+ }
+ }
+ if(LLViewerOctreeEntryData::getCurrentFrame() % seed != mIdleHash)
+ {
+ mFrontCull = FALSE;
+
+ //process back objects selection
+ selectBackObjects(camera, LLVOCacheEntry::getSquaredPixelThreshold(mFrontCull),
+ do_occlusion && use_object_cache_occlusion);
+ return 0; //nothing changed, reduce frequency of culling
+ }
+ }
+ else
+ {
+ mBackSlectionEnabled = -1; //reset it.
+ }
+
+ //localize the camera
+ LLVector3 region_agent = mRegionp->getOriginAgent();
+ camera.calcRegionFrustumPlanes(region_agent, gAgentCamera.mDrawDistance);
+
+ mFrontCull = TRUE;
+ LLVOCacheOctreeCull culler(&camera, mRegionp, region_agent, do_occlusion && use_object_cache_occlusion,
+ LLVOCacheEntry::getSquaredPixelThreshold(mFrontCull), this);
+ culler.traverse(mOctree);
+
+ if(!sNeedsOcclusionCheck)
+ {
+ sNeedsOcclusionCheck = !mOccludedGroups.empty();
+ }
+ return 1;
+}
+
+void LLVOCachePartition::setCullHistory(BOOL has_new_object)
{
- if(sInstance)
+ mCullHistory <<= 1;
+ mCullHistory |= has_new_object;
+}
+
+void LLVOCachePartition::addOccluders(LLViewerOctreeGroup* gp)
+{
+ LLVOCacheGroup* group = (LLVOCacheGroup*)gp;
+
+ if(!group->isOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION))
{
- delete sInstance ;
- sInstance = NULL ;
+ group->setOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION);
+ mOccludedGroups.insert(group);
}
}
+void LLVOCachePartition::processOccluders(LLCamera* camera)
+{
+ if(mOccludedGroups.empty())
+ {
+ return;
+ }
+ if(LLViewerCamera::sCurCameraID != LLViewerCamera::CAMERA_WORLD)
+ {
+ return; //no need for those cameras.
+ }
+
+ LLVector3 region_agent = mRegionp->getOriginAgent();
+ LLVector4a shift(region_agent[0], region_agent[1], region_agent[2]);
+ for(std::set<LLVOCacheGroup*>::iterator iter = mOccludedGroups.begin(); iter != mOccludedGroups.end(); ++iter)
+ {
+ LLVOCacheGroup* group = *iter;
+ if(group->isOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION))
+ {
+ group->doOcclusion(camera, &shift);
+ group->clearOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION);
+ }
+ }
+
+ //safe to clear mOccludedGroups here because only the world camera accesses it.
+ mOccludedGroups.clear();
+ sNeedsOcclusionCheck = FALSE;
+}
+
+void LLVOCachePartition::resetOccluders()
+{
+ if(mOccludedGroups.empty())
+ {
+ return;
+ }
+
+ for(std::set<LLVOCacheGroup*>::iterator iter = mOccludedGroups.begin(); iter != mOccludedGroups.end(); ++iter)
+ {
+ LLVOCacheGroup* group = *iter;
+ group->clearOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION);
+ }
+ mOccludedGroups.clear();
+ sNeedsOcclusionCheck = FALSE;
+}
+
+void LLVOCachePartition::removeOccluder(LLVOCacheGroup* group)
+{
+ if(mOccludedGroups.empty())
+ {
+ return;
+ }
+ mOccludedGroups.erase(group);
+}
+//-------------------------------------------------------------------
+//LLVOCache
+//-------------------------------------------------------------------
+// Format string used to construct filename for the object cache
+static const char OBJECT_CACHE_FILENAME[] = "objects_%d_%d.slc";
+
+const U32 MAX_NUM_OBJECT_ENTRIES = 128 ;
+const U32 MIN_ENTRIES_TO_PURGE = 16 ;
+const U32 INVALID_TIME = 0 ;
+const char* object_cache_dirname = "objectcache";
+const char* header_filename = "object.cache";
+
+
LLVOCache::LLVOCache():
- mInitialized(FALSE),
- mReadOnly(TRUE),
+ mInitialized(false),
+ mReadOnly(true),
mNumEntries(0),
mCacheSize(1)
{
@@ -291,16 +1075,16 @@ void LLVOCache::initCache(ELLPath location, U32 size, U32 cache_version)
{
if(!mEnabled)
{
- llwarns << "Not initializing cache: Cache is currently disabled." << llendl;
+ LL_WARNS() << "Not initializing cache: Cache is currently disabled." << LL_ENDL;
return ;
}
if(mInitialized)
{
- llwarns << "Cache already initialized." << llendl;
+ LL_WARNS() << "Cache already initialized." << LL_ENDL;
return ;
}
- mInitialized = TRUE ;
+ mInitialized = true;
setDirNames(location);
if (!mReadOnly)
@@ -325,39 +1109,48 @@ void LLVOCache::initCache(ELLPath location, U32 size, U32 cache_version)
}
}
-void LLVOCache::removeCache(ELLPath location)
+void LLVOCache::removeCache(ELLPath location, bool started)
{
+ if(started)
+ {
+ removeCache();
+ return;
+ }
+
if(mReadOnly)
{
- llwarns << "Not removing cache at " << location << ": Cache is currently in read-only mode." << llendl;
+ LL_WARNS() << "Not removing cache at " << location << ": Cache is currently in read-only mode." << LL_ENDL;
return ;
- }
+ }
- llinfos << "about to remove the object cache due to settings." << llendl ;
+ LL_INFOS() << "about to remove the object cache due to settings." << LL_ENDL ;
std::string mask = "*";
std::string cache_dir = gDirUtilp->getExpandedFilename(location, object_cache_dirname);
- llinfos << "Removing cache at " << cache_dir << llendl;
+ LL_INFOS() << "Removing cache at " << cache_dir << LL_ENDL;
gDirUtilp->deleteFilesInDir(cache_dir, mask); //delete all files
LLFile::rmdir(cache_dir);
clearCacheInMemory();
- mInitialized = FALSE ;
+ mInitialized = false;
}
void LLVOCache::removeCache()
{
- llassert_always(mInitialized) ;
+ if(!mInitialized)
+ {
+ //OK to remove cache even it is not initialized.
+ LL_WARNS() << "Object cache is not initialized yet." << LL_ENDL;
+ }
+
if(mReadOnly)
{
- llwarns << "Not clearing object cache: Cache is currently in read-only mode." << llendl;
+ LL_WARNS() << "Not clearing object cache: Cache is currently in read-only mode." << LL_ENDL;
return ;
}
- llinfos << "about to remove the object cache due to some error." << llendl ;
-
std::string mask = "*";
- llinfos << "Removing cache at " << mObjectCacheDirName << llendl;
+ LL_INFOS() << "Removing object cache at " << mObjectCacheDirName << LL_ENDL;
gDirUtilp->deleteFilesInDir(mObjectCacheDirName, mask);
clearCacheInMemory() ;
@@ -366,23 +1159,23 @@ void LLVOCache::removeCache()
void LLVOCache::removeEntry(HeaderEntryInfo* entry)
{
- llassert_always(mInitialized) ;
+ llassert_always(mInitialized);
if(mReadOnly)
{
- return ;
+ return;
}
if(!entry)
{
- return ;
+ return;
}
- header_entry_queue_t::iterator iter = mHeaderEntryQueue.find(entry) ;
+ header_entry_queue_t::iterator iter = mHeaderEntryQueue.find(entry);
if(iter != mHeaderEntryQueue.end())
{
- mHandleEntryMap.erase(entry->mHandle) ;
- mHeaderEntryQueue.erase(iter) ;
- removeFromCache(entry) ;
- delete entry ;
+ mHandleEntryMap.erase(entry->mHandle);
+ mHeaderEntryQueue.erase(iter);
+ removeFromCache(entry);
+ delete entry;
mNumEntries = mHandleEntryMap.size() ;
}
@@ -429,7 +1222,7 @@ void LLVOCache::removeFromCache(HeaderEntryInfo* entry)
{
if(mReadOnly)
{
- llwarns << "Not removing cache for handle " << entry->mHandle << ": Cache is currently in read-only mode." << llendl;
+ LL_WARNS() << "Not removing cache for handle " << entry->mHandle << ": Cache is currently in read-only mode." << LL_ENDL;
return ;
}
@@ -444,7 +1237,7 @@ void LLVOCache::readCacheHeader()
{
if(!mEnabled)
{
- llwarns << "Not reading cache header: Cache is currently disabled." << llendl;
+ LL_WARNS() << "Not reading cache header: Cache is currently disabled." << LL_ENDL;
return;
}
@@ -474,7 +1267,7 @@ void LLVOCache::readCacheHeader()
if(!success) //failed
{
- llwarns << "Error reading cache header entry. (entry_index=" << mNumEntries << ")" << llendl;
+ LL_WARNS() << "Error reading cache header entry. (entry_index=" << mNumEntries << ")" << LL_ENDL;
delete entry ;
entry = NULL ;
break ;
@@ -502,7 +1295,7 @@ void LLVOCache::readCacheHeader()
//for(header_entry_queue_t::iterator iter = mHeaderEntryQueue.begin() ; success && iter != mHeaderEntryQueue.end(); ++iter)
//{
// getObjectCacheFilename((*iter)->mHandle, name) ;
- // llinfos << name << llendl ;
+ // LL_INFOS() << name << LL_ENDL ;
//}
//-----------
}
@@ -527,13 +1320,13 @@ void LLVOCache::writeCacheHeader()
{
if (!mEnabled)
{
- llwarns << "Not writing cache header: Cache is currently disabled." << llendl;
+ LL_WARNS() << "Not writing cache header: Cache is currently disabled." << LL_ENDL;
return;
}
if(mReadOnly)
{
- llwarns << "Not writing cache header: Cache is currently in read-only mode." << llendl;
+ LL_WARNS() << "Not writing cache header: Cache is currently in read-only mode." << LL_ENDL;
return;
}
@@ -587,7 +1380,7 @@ void LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::voca
{
if(!mEnabled)
{
- llwarns << "Not reading cache for handle " << handle << "): Cache is currently disabled." << llendl;
+ LL_WARNS() << "Not reading cache for handle " << handle << "): Cache is currently disabled." << LL_ENDL;
return ;
}
llassert_always(mInitialized);
@@ -595,7 +1388,7 @@ void LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::voca
handle_entry_map_t::iterator iter = mHandleEntryMap.find(handle) ;
if(iter == mHandleEntryMap.end()) //no cache
{
- llwarns << "No handle map entry for " << handle << llendl;
+ LL_WARNS() << "No handle map entry for " << handle << LL_ENDL;
return ;
}
@@ -612,7 +1405,7 @@ void LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::voca
{
if(cache_id != id)
{
- llinfos << "Cache ID doesn't match for this region, discarding"<< llendl;
+ LL_INFOS() << "Cache ID doesn't match for this region, discarding"<< LL_ENDL;
success = false ;
}
@@ -623,13 +1416,12 @@ void LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::voca
if(success)
{
- for (S32 i = 0; i < num_entries; i++)
+ for (S32 i = 0; i < num_entries && apr_file.eof() != APR_EOF; i++)
{
- LLVOCacheEntry* entry = new LLVOCacheEntry(&apr_file);
+ LLPointer<LLVOCacheEntry> entry = new LLVOCacheEntry(&apr_file);
if (!entry->getLocalID())
{
- llwarns << "Aborting cache file load for " << filename << ", cache file corruption!" << llendl;
- delete entry ;
+ LL_WARNS() << "Aborting cache file load for " << filename << ", cache file corruption!" << LL_ENDL;
success = false ;
break ;
}
@@ -665,18 +1457,18 @@ void LLVOCache::purgeEntries(U32 size)
mNumEntries = mHandleEntryMap.size() ;
}
-void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry::vocache_entry_map_t& cache_entry_map, BOOL dirty_cache)
+void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry::vocache_entry_map_t& cache_entry_map, BOOL dirty_cache, bool removal_enabled)
{
if(!mEnabled)
{
- llwarns << "Not writing cache for handle " << handle << "): Cache is currently disabled." << llendl;
+ LL_WARNS() << "Not writing cache for handle " << handle << "): Cache is currently disabled." << LL_ENDL;
return ;
}
llassert_always(mInitialized);
if(mReadOnly)
{
- llwarns << "Not writing cache for handle " << handle << "): Cache is currently in read-only mode." << llendl;
+ LL_WARNS() << "Not writing cache for handle " << handle << "): Cache is currently in read-only mode." << LL_ENDL;
return ;
}
@@ -711,13 +1503,13 @@ void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry:
//update cache header
if(!updateEntry(entry))
{
- llwarns << "Failed to update cache header index " << entry->mIndex << ". handle = " << handle << llendl;
+ LL_WARNS() << "Failed to update cache header index " << entry->mIndex << ". handle = " << handle << LL_ENDL;
return ; //update failed.
}
if(!dirty_cache)
{
- llwarns << "Skipping write to cache for handle " << handle << ": cache not dirty" << llendl;
+ LL_WARNS() << "Skipping write to cache for handle " << handle << ": cache not dirty" << LL_ENDL;
return ; //nothing changed, no need to update.
}
@@ -738,7 +1530,14 @@ void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry:
for (LLVOCacheEntry::vocache_entry_map_t::const_iterator iter = cache_entry_map.begin(); success && iter != cache_entry_map.end(); ++iter)
{
- success = iter->second->writeToFile(&apr_file) ;
+ if(!removal_enabled || iter->second->isValid())
+ {
+ success = iter->second->writeToFile(&apr_file) ;
+ if(!success)
+ {
+ break;
+ }
+ }
}
}
}
@@ -746,7 +1545,6 @@ void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry:
if(!success)
{
removeEntry(entry) ;
-
}
return ;
diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h
index 14e3b4c793..082f5f0b1d 100755
--- a/indra/newview/llvocache.h
+++ b/indra/newview/llvocache.h
@@ -29,51 +29,199 @@
#include "lluuid.h"
#include "lldatapacker.h"
-#include "lldlinked.h"
#include "lldir.h"
-
+#include "llvieweroctree.h"
+#include "llapr.h"
//---------------------------------------------------------------------------
// Cache entries
-class LLVOCacheEntry;
+class LLCamera;
-class LLVOCacheEntry
+class LLVOCacheEntry
+: public LLViewerOctreeEntryData,
+ public LLTrace::MemTrackable<LLVOCacheEntry, 16>
{
public:
+ enum
+ {
+ //low 16-bit state
+ INACTIVE = 0x00000000, //not visible
+ IN_QUEUE = 0x00000001, //in visible queue, object to be created
+ WAITING = 0x00000002, //object creation request sent
+ ACTIVE = 0x00000004, //object created, and in rendering pipeline.
+
+ //high 16-bit state
+ IN_VO_TREE = 0x00010000, //the entry is in the object cache tree.
+
+ LOW_BITS = 0x0000ffff,
+ HIGH_BITS = 0xffff0000
+ };
+
+ struct CompareVOCacheEntry
+ {
+ bool operator()(const LLVOCacheEntry* const& lhs, const LLVOCacheEntry* const& rhs)
+ {
+ F32 lpa = lhs->getSceneContribution();
+ F32 rpa = rhs->getSceneContribution();
+
+ //larger pixel area first
+ if(lpa > rpa)
+ {
+ return true;
+ }
+ else if(lpa < rpa)
+ {
+ return false;
+ }
+ else
+ {
+ return lhs < rhs;
+ }
+ }
+ };
+protected:
+ ~LLVOCacheEntry();
+public:
LLVOCacheEntry(U32 local_id, U32 crc, LLDataPackerBinaryBuffer &dp);
LLVOCacheEntry(LLAPRFile* apr_file);
- LLVOCacheEntry();
- ~LLVOCacheEntry();
+ LLVOCacheEntry();
+
+ void updateEntry(U32 crc, LLDataPackerBinaryBuffer &dp);
+
+ void clearState(U32 state) {mState &= ~state;}
+ bool hasState(U32 state) {return mState & state;}
+ void setState(U32 state);
+ bool isState(U32 state) {return (mState & LOW_BITS) == state;}
+ U32 getState() const {return mState & LOW_BITS;}
+
+ bool isAnyVisible(const LLVector4a& camera_origin, const LLVector4a& local_camera_origin, F32 dist_threshold);
U32 getLocalID() const { return mLocalID; }
U32 getCRC() const { return mCRC; }
S32 getHitCount() const { return mHitCount; }
S32 getCRCChangeCount() const { return mCRCChangeCount; }
+
+ void calcSceneContribution(const LLVector4a& camera_origin, bool needs_update, U32 last_update, F32 dist_threshold);
+ void setSceneContribution(F32 scene_contrib) {mSceneContrib = scene_contrib;}
+ F32 getSceneContribution() const { return mSceneContrib;}
void dump() const;
BOOL writeToFile(LLAPRFile* apr_file) const;
- void assignCRC(U32 crc, LLDataPackerBinaryBuffer &dp);
- LLDataPackerBinaryBuffer *getDP(U32 crc);
+ LLDataPackerBinaryBuffer *getDP();
void recordHit();
void recordDupe() { mDupeCount++; }
+
+ /*virtual*/ void setOctreeEntry(LLViewerOctreeEntry* entry);
+
+ void setParentID(U32 id);
+ U32 getParentID() const {return mParentID;}
+ bool isChild() const {return mParentID > 0;}
+
+ void addChild(LLVOCacheEntry* entry);
+ void removeChild(LLVOCacheEntry* entry);
+ void removeAllChildren();
+ LLVOCacheEntry* getChild(); //remove the first child, and return it.
+ S32 getNumOfChildren() const {return mChildrenList.size();}
+
+ void setBoundingInfo(const LLVector3& pos, const LLVector3& scale); //called from processing object update message
+ void updateParentBoundingInfo();
+ void saveBoundingSphere();
+
+ void setValid(BOOL valid = TRUE) {mValid = valid;}
+ BOOL isValid() const {return mValid;}
+
+ void setUpdateFlags(U32 flags) {mUpdateFlags = flags;}
+ U32 getUpdateFlags() const {return mUpdateFlags;}
+
+ static void updateDebugSettings();
+ static F32 getSquaredPixelThreshold(bool is_front);
+
+private:
+ void updateParentBoundingInfo(const LLVOCacheEntry* child);
public:
- typedef std::map<U32, LLVOCacheEntry*> vocache_entry_map_t;
+ typedef std::map<U32, LLPointer<LLVOCacheEntry> > vocache_entry_map_t;
+ typedef std::set<LLVOCacheEntry*> vocache_entry_set_t;
+ typedef std::set<LLVOCacheEntry*, CompareVOCacheEntry> vocache_entry_priority_list_t;
+ S32 mLastCameraUpdated;
protected:
U32 mLocalID;
+ U32 mParentID;
U32 mCRC;
+ U32 mUpdateFlags; //receive from sim
S32 mHitCount;
S32 mDupeCount;
S32 mCRCChangeCount;
LLDataPackerBinaryBuffer mDP;
U8 *mBuffer;
+
+ F32 mSceneContrib; //projected scene contributuion of this object.
+ U32 mState; //high 16 bits reserved for special use.
+ vocache_entry_set_t mChildrenList; //children entries in a linked set.
+
+ BOOL mValid; //if set, this entry is valid, otherwise it is invalid and will be removed.
+
+ LLVector4a mBSphereCenter; //bounding sphere center
+ F32 mBSphereRadius; //bounding sphere radius
+
+public:
+ static U32 sMinFrameRange;
+ static F32 sNearRadius;
+ static F32 sRearFarRadius;
+ static F32 sFrontPixelThreshold;
+ static F32 sRearPixelThreshold;
+};
+
+class LLVOCacheGroup : public LLOcclusionCullingGroup
+{
+public:
+ LLVOCacheGroup(OctreeNode* node, LLViewerOctreePartition* part) : LLOcclusionCullingGroup(node, part){}
+
+ //virtual
+ void handleChildAddition(const OctreeNode* parent, OctreeNode* child);
+
+protected:
+ virtual ~LLVOCacheGroup();
+};
+
+class LLVOCachePartition : public LLViewerOctreePartition, public LLTrace::MemTrackable<LLVOCachePartition>
+{
+public:
+ LLVOCachePartition(LLViewerRegion* regionp);
+
+ bool addEntry(LLViewerOctreeEntry* entry);
+ void removeEntry(LLViewerOctreeEntry* entry);
+ /*virtual*/ S32 cull(LLCamera &camera, bool do_occlusion);
+ void addOccluders(LLViewerOctreeGroup* gp);
+ void resetOccluders();
+ void processOccluders(LLCamera* camera);
+ void removeOccluder(LLVOCacheGroup* group);
+
+ void setCullHistory(BOOL has_new_object);
+
+ bool isFrontCull() const {return mFrontCull;}
+
+private:
+ void selectBackObjects(LLCamera &camera, F32 projection_area_cutoff, bool use_occlusion); //select objects behind camera.
+
+public:
+ static BOOL sNeedsOcclusionCheck;
+
+private:
+ BOOL mFrontCull; //the view frustum cull if set, otherwise is back sphere cull.
+ U32 mCullHistory;
+ U32 mCulledTime[LLViewerCamera::NUM_CAMERAS];
+ std::set<LLVOCacheGroup*> mOccludedGroups;
+
+ S32 mBackSlectionEnabled; //enable to select back objects if > 0.
+ U32 mIdleHash;
};
//
//Note: LLVOCache is not thread-safe
//
-class LLVOCache
+class LLVOCache : public LLSingleton<LLVOCache>
{
private:
struct HeaderEntryInfo
@@ -106,19 +254,20 @@ private:
typedef std::set<HeaderEntryInfo*, header_entry_less> header_entry_queue_t;
typedef std::map<U64, HeaderEntryInfo*> handle_entry_map_t;
private:
+ friend class LLSingleton<LLVOCache>;
LLVOCache() ;
public:
~LLVOCache() ;
void initCache(ELLPath location, U32 size, U32 cache_version) ;
- void removeCache(ELLPath location) ;
+ void removeCache(ELLPath location, bool started = false) ;
void readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::vocache_entry_map_t& cache_entry_map) ;
- void writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry::vocache_entry_map_t& cache_entry_map, BOOL dirty_cache) ;
+ void writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry::vocache_entry_map_t& cache_entry_map, BOOL dirty_cache, bool removal_enabled);
void removeEntry(U64 handle) ;
- void setReadOnly(BOOL read_only) {mReadOnly = read_only;}
+ void setReadOnly(bool read_only) {mReadOnly = read_only;}
private:
void setDirNames(ELLPath location);
@@ -134,9 +283,9 @@ private:
BOOL updateEntry(const HeaderEntryInfo* entry);
private:
- BOOL mEnabled;
- BOOL mInitialized ;
- BOOL mReadOnly ;
+ bool mEnabled;
+ bool mInitialized ;
+ bool mReadOnly ;
HeaderMetaInfo mMetaInfo;
U32 mCacheSize;
U32 mNumEntries;
@@ -145,12 +294,6 @@ private:
LLVolatileAPRPool* mLocalAPRFilePoolp ;
header_entry_queue_t mHeaderEntryQueue;
handle_entry_map_t mHandleEntryMap;
-
- static LLVOCache* sInstance ;
-public:
- static LLVOCache* getInstance() ;
- static BOOL hasInstance() ;
- static void destroyClass() ;
};
#endif
diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp
index 600b44d371..b79a48012a 100755
--- a/indra/newview/llvograss.cpp
+++ b/indra/newview/llvograss.cpp
@@ -28,7 +28,6 @@
#include "llvograss.h"
-#include "imageids.h"
#include "llviewercontrol.h"
#include "llagentcamera.h"
@@ -98,7 +97,7 @@ void LLVOGrass::updateSpecies()
if (!sSpeciesTable.count(mSpecies))
{
- llinfos << "Unknown grass type, substituting grass type." << llendl;
+ LL_INFOS() << "Unknown grass type, substituting grass type." << LL_ENDL;
SpeciesMap::const_iterator it = sSpeciesTable.begin();
mSpecies = (*it).first;
}
@@ -120,7 +119,7 @@ void LLVOGrass::initClass()
if (!grass_def_grass.parseFile(xml_filename))
{
- llerrs << "Failed to parse grass file." << llendl;
+ LL_ERRS() << "Failed to parse grass file." << LL_ENDL;
return;
}
@@ -132,7 +131,7 @@ void LLVOGrass::initClass()
{
if (!grass_def->hasName("grass"))
{
- llwarns << "Invalid grass definition node " << grass_def->getName() << llendl;
+ LL_WARNS() << "Invalid grass definition node " << grass_def->getName() << LL_ENDL;
continue;
}
F32 F32_val;
@@ -144,13 +143,13 @@ void LLVOGrass::initClass()
static LLStdStringHandle species_id_string = LLXmlTree::addAttributeString("species_id");
if (!grass_def->getFastAttributeS32(species_id_string, species))
{
- llwarns << "No species id defined" << llendl;
+ LL_WARNS() << "No species id defined" << LL_ENDL;
continue;
}
if (species < 0)
{
- llwarns << "Invalid species id " << species << llendl;
+ LL_WARNS() << "Invalid species id " << species << LL_ENDL;
continue;
}
@@ -171,7 +170,7 @@ void LLVOGrass::initClass()
if (sSpeciesTable.count(species))
{
- llinfos << "Grass species " << species << " already defined! Duplicate discarded." << llendl;
+ LL_INFOS() << "Grass species " << species << " already defined! Duplicate discarded." << LL_ENDL;
delete newGrass;
continue;
}
@@ -187,7 +186,7 @@ void LLVOGrass::initClass()
std::string name;
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
grass_def->getFastAttributeString(name_string, name);
- llwarns << "Incomplete definition of grass " << name << llendl;
+ LL_WARNS() << "Incomplete definition of grass " << name << LL_ENDL;
}
}
@@ -259,7 +258,7 @@ U32 LLVOGrass::processUpdateMessage(LLMessageSystem *mesgsys,
||(getAcceleration().lengthSquared() > 0.f)
||(getAngularVelocity().lengthSquared() > 0.f))
{
- llinfos << "ACK! Moving grass!" << llendl;
+ LL_INFOS() << "ACK! Moving grass!" << LL_ENDL;
setVelocity(LLVector3::zero);
setAcceleration(LLVector3::zero);
setAngularVelocity(LLVector3::zero);
@@ -414,11 +413,11 @@ LLDrawable* LLVOGrass::createDrawable(LLPipeline *pipeline)
return mDrawable;
}
-static LLFastTimer::DeclareTimer FTM_UPDATE_GRASS("Update Grass");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_GRASS("Update Grass");
BOOL LLVOGrass::updateGeometry(LLDrawable *drawable)
{
- LLFastTimer ftm(FTM_UPDATE_GRASS);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_GRASS);
dirtySpatialGroup();
@@ -446,7 +445,7 @@ void LLVOGrass::plantBlades()
// This is bad, but not the end of the world.
if (!sSpeciesTable.count(mSpecies))
{
- llinfos << "Unknown grass species " << mSpecies << llendl;
+ LL_INFOS() << "Unknown grass species " << mSpecies << LL_ENDL;
return;
}
@@ -605,8 +604,8 @@ U32 LLVOGrass::getPartitionType() const
return LLViewerRegion::PARTITION_GRASS;
}
-LLGrassPartition::LLGrassPartition()
-: LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, GL_STREAM_DRAW_ARB)
+LLGrassPartition::LLGrassPartition(LLViewerRegion* regionp)
+: LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, GL_STREAM_DRAW_ARB, regionp)
{
mDrawableType = LLPipeline::RENDER_TYPE_GRASS;
mPartitionType = LLViewerRegion::PARTITION_GRASS;
@@ -626,9 +625,9 @@ void LLGrassPartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_count
LLViewerCamera* camera = LLViewerCamera::getInstance();
for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
{
- LLDrawable* drawablep = *i;
+ LLDrawable* drawablep = (LLDrawable*)(*i)->getDrawable();
- if (drawablep->isDead())
+ if (!drawablep || drawablep->isDead())
{
continue;
}
@@ -673,11 +672,11 @@ void LLGrassPartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_count
}
}
-static LLFastTimer::DeclareTimer FTM_REBUILD_GRASS_VB("Grass VB");
+static LLTrace::BlockTimerStatHandle FTM_REBUILD_GRASS_VB("Grass VB");
void LLGrassPartition::getGeometry(LLSpatialGroup* group)
{
- LLFastTimer ftm(FTM_REBUILD_GRASS_VB);
+ LL_RECORD_BLOCK_TIME(FTM_REBUILD_GRASS_VB);
std::sort(mFaceList.begin(), mFaceList.end(), LLFace::CompareDistanceGreater());
@@ -744,8 +743,10 @@ void LLGrassPartition::getGeometry(LLSpatialGroup* group)
LLDrawInfo* info = new LLDrawInfo(start,end,count,offset,facep->getTexture(),
//facep->getTexture(),
buffer, fullbright);
- info->mExtents[0] = group->mObjectExtents[0];
- info->mExtents[1] = group->mObjectExtents[1];
+
+ const LLVector4a* exts = group->getObjectExtents();
+ info->mExtents[0] = exts[0];
+ info->mExtents[1] = exts[1];
info->mVSize = vsize;
draw_vec.push_back(info);
//for alpha sorting
diff --git a/indra/newview/llvograss.h b/indra/newview/llvograss.h
index ff4fa6b00d..71d358362d 100755
--- a/indra/newview/llvograss.h
+++ b/indra/newview/llvograss.h
@@ -28,7 +28,6 @@
#define LL_LLVOGRASS_H
#include "llviewerobject.h"
-#include "lldarray.h"
#include <map>
class LLSurfacePatch;
diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp
index ac2a34ba1e..9a84cae403 100755
--- a/indra/newview/llvoicechannel.cpp
+++ b/indra/newview/llvoicechannel.cpp
@@ -28,12 +28,14 @@
#include "llagent.h"
#include "llfloaterreg.h"
+#include "llhttpclient.h"
#include "llimview.h"
#include "llnotifications.h"
#include "llnotificationsutil.h"
#include "llpanel.h"
#include "llrecentpeople.h"
#include "llviewercontrol.h"
+#include "llviewerregion.h"
#include "llvoicechannel.h"
@@ -53,26 +55,27 @@ const U32 DEFAULT_RETRIES_COUNT = 3;
class LLVoiceCallCapResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(LLVoiceCallCapResponder);
public:
LLVoiceCallCapResponder(const LLUUID& session_id) : mSessionID(session_id) {};
+protected:
// called with bad status codes
- virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content);
- virtual void result(const LLSD& content);
+ virtual void httpFailure();
+ virtual void httpSuccess();
private:
LLUUID mSessionID;
};
-void LLVoiceCallCapResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+void LLVoiceCallCapResponder::httpFailure()
{
- LL_WARNS("Voice") << "LLVoiceCallCapResponder error [status:"
- << status << "]: " << content << LL_ENDL;
+ LL_WARNS("Voice") << dumpResponse() << LL_ENDL;
LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(mSessionID);
if ( channelp )
{
- if ( 403 == status )
+ if ( HTTP_FORBIDDEN == getStatus() )
{
//403 == no ability
LLNotificationsUtil::add(
@@ -89,12 +92,18 @@ void LLVoiceCallCapResponder::errorWithContent(U32 status, const std::string& re
}
}
-void LLVoiceCallCapResponder::result(const LLSD& content)
+void LLVoiceCallCapResponder::httpSuccess()
{
LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(mSessionID);
if (channelp)
{
//*TODO: DEBUG SPAM
+ const LLSD& content = getContent();
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
LLSD::map_const_iterator iter;
for(iter = content.beginMap(); iter != content.endMap(); ++iter)
{
@@ -271,14 +280,14 @@ void LLVoiceChannel::deactivate()
if (callStarted())
{
setState(STATE_HUNG_UP);
-
+
//Default mic is OFF when leaving voice calls
- if (gSavedSettings.getBOOL("AutoDisengageMic") &&
+ if (gSavedSettings.getBOOL("AutoDisengageMic") &&
sCurrentVoiceChannel == this &&
LLVoiceClient::getInstance()->getUserPTTState())
{
gSavedSettings.setBOOL("PTTCurrentlyEnabled", true);
- LLVoiceClient::getInstance()->inputUserControlState(true);
+ LLVoiceClient::getInstance()->setUserPTTState(false);
}
}
LLVoiceClient::getInstance()->removeObserver(this);
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index 815965fb0a..0bf373f478 100755
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -36,6 +36,7 @@
#include "llsdserialize.h"
#include "llui.h"
#include "llkeyboard.h"
+#include "llagent.h"
const F32 LLVoiceClient::OVERDRIVEN_POWER_LEVEL = 0.7f;
@@ -635,7 +636,7 @@ void LLVoiceClient::keyDown(KEY key, MASK mask)
return;
}
- if(!mPTTIsMiddleMouse)
+ if(!mPTTIsMiddleMouse && LLAgent::isActionAllowed("speak"))
{
bool down = (mPTTKey != KEY_NONE)
&& gKeyboard->getKeyDown(mPTTKey);
@@ -654,12 +655,9 @@ void LLVoiceClient::keyUp(KEY key, MASK mask)
}
void LLVoiceClient::middleMouseState(bool down)
{
- if(mPTTIsMiddleMouse)
+ if(mPTTIsMiddleMouse && LLAgent::isActionAllowed("speak"))
{
- if(mPTTIsMiddleMouse)
- {
- inputUserControlState(down);
- }
+ inputUserControlState(down);
}
}
diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h
index e17da9cecd..1e20a814a0 100755
--- a/indra/newview/llvoiceclient.h
+++ b/indra/newview/llvoiceclient.h
@@ -34,7 +34,6 @@ class LLVOAvatar;
#include "lliosocket.h"
#include "v3math.h"
#include "llframetimer.h"
-#include "llviewerregion.h"
#include "llcallingcard.h" // for LLFriendObserver
#include "llsecapi.h"
#include "llcontrol.h"
diff --git a/indra/newview/llvoicevisualizer.cpp b/indra/newview/llvoicevisualizer.cpp
index 9281334d81..23a8a61b85 100755
--- a/indra/newview/llvoicevisualizer.cpp
+++ b/indra/newview/llvoicevisualizer.cpp
@@ -310,7 +310,7 @@ void LLVoiceVisualizer::lipSyncOohAah( F32& ooh, F32& aah )
aah = transfer_aah * sAah[elapsed_aahs];
/*
- llinfos << " elapsed frames " << elapsed_frames
+ LL_INFOS() << " elapsed frames " << elapsed_frames
<< " ooh " << ooh
<< " aah " << aah
<< " transfer ooh" << transfer_ooh
@@ -320,7 +320,7 @@ void LLVoiceVisualizer::lipSyncOohAah( F32& ooh, F32& aah )
<< " elapsed time " << elapsed_time
<< " elapsed oohs " << elapsed_oohs
<< " elapsed aahs " << elapsed_aahs
- << llendl;
+ << LL_ENDL;
*/
}
else
@@ -590,7 +590,7 @@ void LLVoiceVisualizer::unpackData(LLMessageSystem *mesgsys, S32 blocknum)
S32 size = mesgsys->getSizeFast(_PREHASH_Effect, blocknum, _PREHASH_TypeData);
if (size != 1)
{
- llwarns << "Voice effect with bad size " << size << llendl;
+ LL_WARNS() << "Voice effect with bad size " << size << LL_ENDL;
return;
}
mesgsys->getBinaryDataFast(_PREHASH_Effect, _PREHASH_TypeData, packed_data, 1, blocknum);
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 050d9dd785..54b4119331 100755
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -35,7 +35,7 @@
#include "llbufferstream.h"
#include "llfile.h"
#include "llmenugl.h"
-#ifdef LL_STANDALONE
+#ifdef LL_USESYSTEMLIBS
# include "expat.h"
#else
# include "expat/expat.h"
@@ -124,17 +124,19 @@ static int scale_speaker_volume(float volume)
class LLVivoxVoiceAccountProvisionResponder :
public LLHTTPClient::Responder
{
+ LOG_CLASS(LLVivoxVoiceAccountProvisionResponder);
public:
LLVivoxVoiceAccountProvisionResponder(int retries)
{
mRetries = retries;
}
- virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+private:
+ /* virtual */ void httpFailure()
{
LL_WARNS("Voice") << "ProvisionVoiceAccountRequest returned an error, "
<< ( (mRetries > 0) ? "retrying" : "too many retries (giving up)" )
- << status << "]: " << content << LL_ENDL;
+ << " " << dumpResponse() << LL_ENDL;
if ( mRetries > 0 )
{
@@ -146,14 +148,19 @@ public:
}
}
- virtual void result(const LLSD& content)
+ /* virtual */ void httpSuccess()
{
-
std::string voice_sip_uri_hostname;
std::string voice_account_server_uri;
- LL_DEBUGS("Voice") << "ProvisionVoiceAccountRequest response:" << ll_pretty_print_sd(content) << LL_ENDL;
+ LL_DEBUGS("Voice") << "ProvisionVoiceAccountRequest response:" << dumpResponse() << LL_ENDL;
+ const LLSD& content = getContent();
+ if (!content.isMap())
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
if(content.has("voice_sip_uri_hostname"))
voice_sip_uri_hostname = content["voice_sip_uri_hostname"].asString();
@@ -166,7 +173,6 @@ public:
content["password"].asString(),
voice_sip_uri_hostname,
voice_account_server_uri);
-
}
private:
@@ -190,33 +196,34 @@ static bool sMuteListListener_listening = false;
class LLVivoxVoiceClientCapResponder : public LLHTTPClient::Responder
{
+ LOG_CLASS(LLVivoxVoiceClientCapResponder);
public:
LLVivoxVoiceClientCapResponder(LLVivoxVoiceClient::state requesting_state) : mRequestingState(requesting_state) {};
+private:
// called with bad status codes
- virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content);
- virtual void result(const LLSD& content);
+ /* virtual */ void httpFailure();
+ /* virtual */ void httpSuccess();
-private:
LLVivoxVoiceClient::state mRequestingState; // state
};
-void LLVivoxVoiceClientCapResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+void LLVivoxVoiceClientCapResponder::httpFailure()
{
- LL_WARNS("Voice") << "LLVivoxVoiceClientCapResponder error [status:"
- << status << "]: " << content << LL_ENDL;
+ LL_WARNS("Voice") << dumpResponse() << LL_ENDL;
LLVivoxVoiceClient::getInstance()->sessionTerminate();
}
-void LLVivoxVoiceClientCapResponder::result(const LLSD& content)
+void LLVivoxVoiceClientCapResponder::httpSuccess()
{
LLSD::map_const_iterator iter;
- LL_DEBUGS("Voice") << "ParcelVoiceInfoRequest response:" << ll_pretty_print_sd(content) << LL_ENDL;
+ LL_DEBUGS("Voice") << "ParcelVoiceInfoRequest response:" << dumpResponse() << LL_ENDL;
std::string uri;
std::string credentials;
+ const LLSD& content = getContent();
if ( content.has("voice_credentials") )
{
LLSD voice_credentials = content["voice_credentials"];
@@ -1343,7 +1350,7 @@ void LLVivoxVoiceClient::stateMachine()
{
// Notify observers to let them know there is problem with voice
notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_VOICE_DISABLED);
- llwarns << "There seems to be problem with connection to voice server. Disabling voice chat abilities." << llendl;
+ LL_WARNS() << "There seems to be problem with connection to voice server. Disabling voice chat abilities." << LL_ENDL;
}
// Increase mSpatialJoiningNum only for spatial sessions- it's normal to reach this case for
@@ -2651,7 +2658,7 @@ void LLVivoxVoiceClient::loginResponse(int statusCode, std::string &statusString
// Status code of 20200 means "bad password". We may want to special-case that at some point.
- if ( statusCode == 401 )
+ if ( statusCode == HTTP_UNAUTHORIZED )
{
// Login failure which is probably caused by the delay after a user's password being updated.
LL_INFOS("Voice") << "Account.Login response failure (" << statusCode << "): " << statusString << LL_ENDL;
@@ -3153,7 +3160,7 @@ void LLVivoxVoiceClient::mediaStreamUpdatedEvent(
switch(statusCode)
{
case 0:
- case 200:
+ case HTTP_OK:
// generic success
// Don't change the saved error code (it may have been set elsewhere)
break;
@@ -3426,7 +3433,7 @@ void LLVivoxVoiceClient::messageEvent(
LL_DEBUGS("Voice") << "Message event, session " << sessionHandle << " from " << uriString << LL_ENDL;
// LL_DEBUGS("Voice") << " header " << messageHeader << ", body: \n" << messageBody << LL_ENDL;
- if(messageHeader.find("text/html") != std::string::npos)
+ if(messageHeader.find(HTTP_CONTENT_TEXT_HTML) != std::string::npos)
{
std::string message;
@@ -5393,9 +5400,10 @@ void LLVivoxVoiceClient::notifyStatusObservers(LLVoiceClientStatusObserver::ESta
{
switch(mAudioSession->mErrorStatusCode)
{
- case 404: // NOT_FOUND
+ case HTTP_NOT_FOUND: // NOT_FOUND
+ // *TODO: Should this be 503?
case 480: // TEMPORARILY_UNAVAILABLE
- case 408: // REQUEST_TIMEOUT
+ case HTTP_REQUEST_TIME_OUT: // REQUEST_TIMEOUT
// call failed because other user was not available
// treat this as an error case
status = LLVoiceClientStatusObserver::ERROR_NOT_AVAILABLE;
@@ -5824,8 +5832,8 @@ void LLVivoxVoiceClient::expireVoiceFonts()
// Give a warning notification if any voice fonts are due to expire.
if (will_expire)
{
- S32 seconds = gSavedSettings.getS32("VoiceEffectExpiryWarningTime");
- args["INTERVAL"] = llformat("%d", seconds / SEC_PER_DAY);
+ S32Seconds seconds(gSavedSettings.getS32("VoiceEffectExpiryWarningTime"));
+ args["INTERVAL"] = llformat("%d", LLUnit<S32, LLUnits::Days>(seconds).value());
LLNotificationsUtil::add("VoiceEffectsWillExpire", args);
}
@@ -6318,7 +6326,7 @@ LLVivoxProtocolParser::~LLVivoxProtocolParser()
XML_ParserFree(parser);
}
-static LLFastTimer::DeclareTimer FTM_VIVOX_PROCESS("Vivox Process");
+static LLTrace::BlockTimerStatHandle FTM_VIVOX_PROCESS("Vivox Process");
// virtual
LLIOPipe::EStatus LLVivoxProtocolParser::process_impl(
@@ -6328,7 +6336,7 @@ LLIOPipe::EStatus LLVivoxProtocolParser::process_impl(
LLSD& context,
LLPumpIO* pump)
{
- LLFastTimer t(FTM_VIVOX_PROCESS);
+ LL_RECORD_BLOCK_TIME(FTM_VIVOX_PROCESS);
LLBufferStream istr(channels, buffer.get());
std::ostringstream ostr;
while (istr.good())
diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h
index c325d72ba6..5e876fa2ef 100755
--- a/indra/newview/llvoicevivox.h
+++ b/indra/newview/llvoicevivox.h
@@ -38,7 +38,7 @@ class LLVivoxProtocolParser;
#include "llviewerregion.h"
#include "llcallingcard.h" // for LLFriendObserver
-#ifdef LL_STANDALONE
+#ifdef LL_USESYSTEMLIBS
# include "expat.h"
#else
# include "expat/expat.h"
diff --git a/indra/newview/llvoinventorylistener.h b/indra/newview/llvoinventorylistener.h
index bf14d19b01..c50c475478 100755
--- a/indra/newview/llvoinventorylistener.h
+++ b/indra/newview/llvoinventorylistener.h
@@ -30,7 +30,9 @@
#ifndef LL_LLVOINVENTORYLISTENER_H
#define LL_LLVOINVENTORYLISTENER_H
-#include "llviewerobject.h"
+#include "llinventory.h"
+
+class LLViewerObject;
class LLVOInventoryListener
{
diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp
index 54e27ff4c6..c1593fa5fc 100755
--- a/indra/newview/llvopartgroup.cpp
+++ b/indra/newview/llvopartgroup.cpp
@@ -46,7 +46,7 @@
const F32 MAX_PART_LIFETIME = 120.f;
-extern U64 gFrameTime;
+extern U64MicrosecondsImplicit gFrameTime;
LLPointer<LLVertexBuffer> LLVOPartGroup::sVB = NULL;
S32 LLVOPartGroup::sVBSlotCursor = 0;
@@ -292,10 +292,10 @@ LLVector3 LLVOPartGroup::getCameraPosition() const
return gAgentCamera.getCameraPositionAgent();
}
-static LLFastTimer::DeclareTimer FTM_UPDATE_PARTICLES("Update Particles");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_PARTICLES("Update Particles");
BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable)
{
- LLFastTimer ftm(FTM_UPDATE_PARTICLES);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_PARTICLES);
dirtySpatialGroup();
@@ -405,7 +405,7 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable)
facep = drawable->getFace(i);
if (!facep)
{
- llwarns << "No face found for index " << i << "!" << llendl;
+ LL_WARNS() << "No face found for index " << i << "!" << LL_ENDL;
continue;
}
@@ -451,7 +451,7 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable)
LLFace* facep = drawable->getFace(i);
if (!facep)
{
- llwarns << "No face found for index " << i << "!" << llendl;
+ LL_WARNS() << "No face found for index " << i << "!" << LL_ENDL;
continue;
}
facep->setTEOffset(i);
@@ -722,8 +722,8 @@ U32 LLVOPartGroup::getPartitionType() const
return LLViewerRegion::PARTITION_PARTICLE;
}
-LLParticlePartition::LLParticlePartition()
-: LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, GL_STREAM_DRAW_ARB)
+LLParticlePartition::LLParticlePartition(LLViewerRegion* regionp)
+: LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, GL_STREAM_DRAW_ARB, regionp)
{
mRenderPass = LLRenderPass::PASS_ALPHA;
mDrawableType = LLPipeline::RENDER_TYPE_PARTICLES;
@@ -732,18 +732,18 @@ LLParticlePartition::LLParticlePartition()
mLODPeriod = 1;
}
-LLHUDParticlePartition::LLHUDParticlePartition() :
- LLParticlePartition()
+LLHUDParticlePartition::LLHUDParticlePartition(LLViewerRegion* regionp) :
+ LLParticlePartition(regionp)
{
mDrawableType = LLPipeline::RENDER_TYPE_HUD_PARTICLES;
mPartitionType = LLViewerRegion::PARTITION_HUD_PARTICLE;
}
-static LLFastTimer::DeclareTimer FTM_REBUILD_PARTICLE_VBO("Particle VBO");
+static LLTrace::BlockTimerStatHandle FTM_REBUILD_PARTICLE_VBO("Particle VBO");
void LLParticlePartition::rebuildGeom(LLSpatialGroup* group)
{
- if (group->isDead() || !group->isState(LLSpatialGroup::GEOM_DIRTY))
+ if (group->isDead() || !group->hasState(LLSpatialGroup::GEOM_DIRTY))
{
return;
}
@@ -754,7 +754,7 @@ void LLParticlePartition::rebuildGeom(LLSpatialGroup* group)
group->mLastUpdateViewAngle = group->mViewAngle;
}
- LLFastTimer ftm(FTM_REBUILD_PARTICLE_VBO);
+ LL_RECORD_BLOCK_TIME(FTM_REBUILD_PARTICLE_VBO);
group->clearDrawMap();
@@ -791,9 +791,9 @@ void LLParticlePartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_co
LLViewerCamera* camera = LLViewerCamera::getInstance();
for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
{
- LLDrawable* drawablep = *i;
+ LLDrawable* drawablep = (LLDrawable*)(*i)->getDrawable();
- if (drawablep->isDead())
+ if (!drawablep || drawablep->isDead())
{
continue;
}
@@ -828,11 +828,11 @@ void LLParticlePartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_co
}
-static LLFastTimer::DeclareTimer FTM_REBUILD_PARTICLE_GEOM("Particle Geom");
+static LLTrace::BlockTimerStatHandle FTM_REBUILD_PARTICLE_GEOM("Particle Geom");
void LLParticlePartition::getGeometry(LLSpatialGroup* group)
{
- LLFastTimer ftm(FTM_REBUILD_PARTICLE_GEOM);
+ LL_RECORD_BLOCK_TIME(FTM_REBUILD_PARTICLE_GEOM);
std::sort(mFaceList.begin(), mFaceList.end(), LLFace::CompareDistanceGreater());
@@ -958,8 +958,10 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group)
LLDrawInfo* info = new LLDrawInfo(start,end,count,offset,facep->getTexture(),
//facep->getTexture(),
buffer, fullbright);
- info->mExtents[0] = group->mObjectExtents[0];
- info->mExtents[1] = group->mObjectExtents[1];
+
+ const LLVector4a* exts = group->getObjectExtents();
+ info->mExtents[0] = exts[0];
+ info->mExtents[1] = exts[1];
info->mVSize = vsize;
info->mBlendFuncDst = bf_dst;
info->mBlendFuncSrc = bf_src;
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index 93f0e50336..07c2f0d44d 100755
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -28,11 +28,9 @@
#include "llvosky.h"
-#include "imageids.h"
#include "llfeaturemanager.h"
#include "llviewercontrol.h"
#include "llframetimer.h"
-#include "timing.h"
#include "llagent.h"
#include "llagentcamera.h"
@@ -1245,7 +1243,7 @@ void LLVOSky::createDummyVertexBuffer()
}
}
-static LLFastTimer::DeclareTimer FTM_RENDER_FAKE_VBO_UPDATE("Fake VBO Update");
+static LLTrace::BlockTimerStatHandle FTM_RENDER_FAKE_VBO_UPDATE("Fake VBO Update");
void LLVOSky::updateDummyVertexBuffer()
{
@@ -1258,7 +1256,7 @@ void LLVOSky::updateDummyVertexBuffer()
return ;
}
- LLFastTimer t(FTM_RENDER_FAKE_VBO_UPDATE) ;
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_FAKE_VBO_UPDATE) ;
if(!mFace[FACE_DUMMY] || !mFace[FACE_DUMMY]->getVertexBuffer())
createDummyVertexBuffer() ;
@@ -1271,11 +1269,11 @@ void LLVOSky::updateDummyVertexBuffer()
//----------------------------------
//end of fake vertex buffer updating
//----------------------------------
-static LLFastTimer::DeclareTimer FTM_GEO_SKY("Sky Geometry");
+static LLTrace::BlockTimerStatHandle FTM_GEO_SKY("Sky Geometry");
BOOL LLVOSky::updateGeometry(LLDrawable *drawable)
{
- LLFastTimer ftm(FTM_GEO_SKY);
+ LL_RECORD_BLOCK_TIME(FTM_GEO_SKY);
if (mFace[FACE_REFLECTION] == NULL)
{
LLDrawPoolWater *poolp = (LLDrawPoolWater*) gPipeline.getPool(LLDrawPool::POOL_WATER);
@@ -2146,7 +2144,7 @@ void LLVOSky::updateFog(const F32 distance)
// get the water param manager variables
float water_fog_density = LLWaterParamManager::getInstance()->getFogDensity();
- LLColor4 water_fog_color = LLDrawPoolWater::sWaterFogColor.mV;
+ LLColor4 water_fog_color(LLDrawPoolWater::sWaterFogColor.mV);
// adjust the color based on depth. We're doing linear approximations
float depth_scale = gSavedSettings.getF32("WaterGLFogDepthScale");
diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp
index 9a5c5831ca..79e1921f1b 100755
--- a/indra/newview/llvosurfacepatch.cpp
+++ b/indra/newview/llvosurfacepatch.cpp
@@ -72,7 +72,7 @@ public:
if ((data_mask & type_mask) != data_mask)
{
- llerrs << "LLVertexBuffer::setupVertexBuffer missing required components for supplied data mask." << llendl;
+ LL_ERRS() << "LLVertexBuffer::setupVertexBuffer missing required components for supplied data mask." << LL_ENDL;
}
if (data_mask & MAP_NORMAL)
@@ -212,7 +212,7 @@ LLDrawable *LLVOSurfacePatch::createDrawable(LLPipeline *pipeline)
return mDrawable;
}
-static LLFastTimer::DeclareTimer FTM_UPDATE_TERRAIN("Update Terrain");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_TERRAIN("Update Terrain");
void LLVOSurfacePatch::updateGL()
{
@@ -224,7 +224,7 @@ void LLVOSurfacePatch::updateGL()
BOOL LLVOSurfacePatch::updateGeometry(LLDrawable *drawable)
{
- LLFastTimer ftm(FTM_UPDATE_TERRAIN);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_TERRAIN);
dirtySpatialGroup(TRUE);
@@ -291,7 +291,7 @@ void LLVOSurfacePatch::updateFaceSize(S32 idx)
{
if (idx != 0)
{
- llwarns << "Terrain partition requested invalid face!!!" << llendl;
+ LL_WARNS() << "Terrain partition requested invalid face!!!" << LL_ENDL;
return;
}
@@ -1056,8 +1056,8 @@ U32 LLVOSurfacePatch::getPartitionType() const
return LLViewerRegion::PARTITION_TERRAIN;
}
-LLTerrainPartition::LLTerrainPartition()
-: LLSpatialPartition(LLDrawPoolTerrain::VERTEX_DATA_MASK, FALSE, GL_DYNAMIC_DRAW_ARB)
+LLTerrainPartition::LLTerrainPartition(LLViewerRegion* regionp)
+: LLSpatialPartition(LLDrawPoolTerrain::VERTEX_DATA_MASK, FALSE, GL_DYNAMIC_DRAW_ARB, regionp)
{
mOcclusionEnabled = FALSE;
mInfiniteFarClip = TRUE;
@@ -1070,10 +1070,10 @@ LLVertexBuffer* LLTerrainPartition::createVertexBuffer(U32 type_mask, U32 usage)
return new LLVertexBufferTerrain();
}
-static LLFastTimer::DeclareTimer FTM_REBUILD_TERRAIN_VB("Terrain VB");
+static LLTrace::BlockTimerStatHandle FTM_REBUILD_TERRAIN_VB("Terrain VB");
void LLTerrainPartition::getGeometry(LLSpatialGroup* group)
{
- LLFastTimer ftm(FTM_REBUILD_TERRAIN_VB);
+ LL_RECORD_BLOCK_TIME(FTM_REBUILD_TERRAIN_VB);
LLVertexBuffer* buffer = group->mVertexBuffer;
diff --git a/indra/newview/llvosurfacepatch.h b/indra/newview/llvosurfacepatch.h
index 7b53219be8..3383b16dd9 100755
--- a/indra/newview/llvosurfacepatch.h
+++ b/indra/newview/llvosurfacepatch.h
@@ -33,6 +33,8 @@
class LLSurfacePatch;
class LLDrawPool;
class LLVector2;
+class LLFacePool;
+class LLFace;
class LLVOSurfacePatch : public LLStaticViewerObject
{
diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp
index b82c4fe769..66c0ace79d 100755
--- a/indra/newview/llvotree.cpp
+++ b/indra/newview/llvotree.cpp
@@ -112,7 +112,7 @@ void LLVOTree::initClass()
if (!tree_def_tree.parseFile(xml_filename))
{
- llerrs << "Failed to parse tree file." << llendl;
+ LL_ERRS() << "Failed to parse tree file." << LL_ENDL;
}
LLXmlTreeNode* rootp = tree_def_tree.getRoot();
@@ -123,7 +123,7 @@ void LLVOTree::initClass()
{
if (!tree_def->hasName("tree"))
{
- llwarns << "Invalid tree definition node " << tree_def->getName() << llendl;
+ LL_WARNS() << "Invalid tree definition node " << tree_def->getName() << LL_ENDL;
continue;
}
F32 F32_val;
@@ -138,19 +138,19 @@ void LLVOTree::initClass()
static LLStdStringHandle species_id_string = LLXmlTree::addAttributeString("species_id");
if (!tree_def->getFastAttributeS32(species_id_string, species))
{
- llwarns << "No species id defined" << llendl;
+ LL_WARNS() << "No species id defined" << LL_ENDL;
continue;
}
if (species < 0)
{
- llwarns << "Invalid species id " << species << llendl;
+ LL_WARNS() << "Invalid species id " << species << LL_ENDL;
continue;
}
if (sSpeciesTable.count(species))
{
- llwarns << "Tree species " << species << " already defined! Duplicate discarded." << llendl;
+ LL_WARNS() << "Tree species " << species << " already defined! Duplicate discarded." << LL_ENDL;
continue;
}
@@ -241,7 +241,7 @@ void LLVOTree::initClass()
std::string name;
static LLStdStringHandle name_string = LLXmlTree::addAttributeString("name");
tree_def->getFastAttributeString(name_string, name);
- llwarns << "Incomplete definition of tree " << name << llendl;
+ LL_WARNS() << "Incomplete definition of tree " << name << LL_ENDL;
}
}
@@ -284,7 +284,7 @@ U32 LLVOTree::processUpdateMessage(LLMessageSystem *mesgsys,
||(getAcceleration().lengthSquared() > 0.f)
||(getAngularVelocity().lengthSquared() > 0.f))
{
- llinfos << "ACK! Moving tree!" << llendl;
+ LL_INFOS() << "ACK! Moving tree!" << LL_ENDL;
setVelocity(LLVector3::zero);
setAcceleration(LLVector3::zero);
setAngularVelocity(LLVector3::zero);
@@ -480,11 +480,11 @@ LLDrawable* LLVOTree::createDrawable(LLPipeline *pipeline)
const S32 LEAF_INDICES = 24;
const S32 LEAF_VERTICES = 16;
-static LLFastTimer::DeclareTimer FTM_UPDATE_TREE("Update Tree");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_TREE("Update Tree");
BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
{
- LLFastTimer ftm(FTM_UPDATE_TREE);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_TREE);
if(mTrunkLOD >= sMAX_NUM_TREE_LOD_LEVELS) //do not display the tree.
{
@@ -698,8 +698,8 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
slices = sLODSlices[lod];
F32 base_radius = 0.65f;
F32 top_radius = base_radius * sSpeciesTable[mSpecies]->mTaper;
- //llinfos << "Species " << ((U32) mSpecies) << ", taper = " << sSpeciesTable[mSpecies].mTaper << llendl;
- //llinfos << "Droop " << mDroop << ", branchlength: " << mBranchLength << llendl;
+ //LL_INFOS() << "Species " << ((U32) mSpecies) << ", taper = " << sSpeciesTable[mSpecies].mTaper << LL_ENDL;
+ //LL_INFOS() << "Droop " << mDroop << ", branchlength: " << mBranchLength << LL_ENDL;
F32 angle = 0;
F32 angle_inc = 360.f/(slices-1);
F32 z = 0.f;
@@ -1168,8 +1168,8 @@ U32 LLVOTree::getPartitionType() const
return LLViewerRegion::PARTITION_TREE;
}
-LLTreePartition::LLTreePartition()
-: LLSpatialPartition(0, FALSE, GL_DYNAMIC_DRAW_ARB)
+LLTreePartition::LLTreePartition(LLViewerRegion* regionp)
+: LLSpatialPartition(0, FALSE, GL_DYNAMIC_DRAW_ARB, regionp)
{
mDrawableType = LLPipeline::RENDER_TYPE_TREE;
mPartitionType = LLViewerRegion::PARTITION_TREE;
diff --git a/indra/newview/llvotree.h b/indra/newview/llvotree.h
index 6137ae412d..c862de8230 100755
--- a/indra/newview/llvotree.h
+++ b/indra/newview/llvotree.h
@@ -28,7 +28,6 @@
#define LL_LLVOTREE_H
#include "llviewerobject.h"
-#include "lldarray.h"
#include "xform.h"
class LLFace;
diff --git a/indra/newview/llvotreenew.h b/indra/newview/llvotreenew.h
deleted file mode 100755
index 0bb07008ca..0000000000
--- a/indra/newview/llvotreenew.h
+++ /dev/null
@@ -1,218 +0,0 @@
-/**
- * @file llvotreenew.h
- * @brief LLVOTreeNew class header file
- *
- * $LicenseInfo:firstyear=2003&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLVOTREENEW_H
-#define LL_LLVOTREENEW_H
-
-#include "llviewerobject.h"
-#include "lldarray.h"
-#include "xform.h"
-
-#include "lltreeparams.h"
-#include "llstrider.h"
-#include "v2math.h"
-#include "v3math.h"
-#include "llviewertexture.h"
-
-class LLFace;
-class LLDrawPool;
-
-// number of static arrays created
-const U8 MAX_SPECIES = 16; // max species of trees
-const U8 MAX_PARTS = 15; // trunk, 2 or 3 branches per species?
-const U8 MAX_RES = 6; // max # cross sections for a branch curve
-const U8 MAX_FLARE = 6; // max # cross sections for flare of trunk
-const U8 MAX_LEVELS = 3;
-
-// initial vertex array allocations
-const U32 NUM_INIT_VERTS = 5000; // number of vertices/normals/texcoords
-const U32 NUM_INIT_INDICES = 15000; // number of indices to vert array (3 vertices per triangle, roughly 3x)
-const U32 NUM_TIMES_TO_DOUBLE = 2; // if we go over initial allocations, num times to double each step
-
-// for finding the closest parts...
-
-// the parts are searched based on:
-const F32 MAX_LOBES_DIFF = 2;
-const F32 MAX_LOBEDEPTH_DIFF = .3f;
-const F32 MAX_CURVEBACK_DIFF = 20.0f;
-const F32 MAX_CURVE_DIFF = 15.0f;
-const F32 MAX_CURVE_V_DIFF = 20.0f;
-
-const F32 CURVEV_DIVIDER = 10.0f; // curveV/CURVEV_DIVIDER = # branch variances...
-const U8 MAX_VARS = 3; // max number of variations of branches
-
-const U8 MAX_RAND_NUMS = 100; // max number of rand numbers to pregenerate and store
-
-// texture params
-const F32 WIDTH_OF_BARK = .48f;
-
-class LLVOTreeNew : public LLViewerObject
-{
-public:
-
- // Some random number generators using the pre-generated random numbers
- // return +- negPos
- static S32 llrand_signed(S32 negPos)
- {
- return (ll_rand((U32)negPos * 2) - negPos);
- };
-
- static S32 llrand_signed(S32 negPos, U32 index)
- {
- return lltrunc((sRandNums[index % MAX_RAND_NUMS] * (negPos * 2.0f) - negPos));
- };
-
- static S32 llrand_unsigned(S32 pos, U32 index)
- {
- return lltrunc((sRandNums[index % MAX_RAND_NUMS] * pos));
- };
-
- // return +- negPos
- static F32 llfrand_signed(F32 negPos)
- {
- return (ll_frand(negPos * 2.0f) - negPos);
- };
-
- static F32 llfrand_signed(F32 negPos, U32 index)
- {
- return (sRandNums[index % MAX_RAND_NUMS] * negPos * 2.0f) - negPos;
- };
-
- static F32 llfrand_unsigned(F32 pos, U32 index)
- {
- return sRandNums[index % MAX_RAND_NUMS] * pos;
- };
-
- // return between 0-pos
- static F32 llfrand_unsigned(F32 pos)
- {
- return ll_frand(pos);
- };
-
- static void cleanupTextures() {}; // not needed anymore
-
- struct TreePart
- {
- F32 mRadius; // scale x/y
- F32 mLength; // scale z
- F32 mCurve;
- F32 mCurveV;
- F32 mCurveRes;
- F32 mCurveBack;
- U8 mLobes;
- F32 mLobeDepth;
- U8 mLevel;
- U32 mNumTris;
- U8 mVertsPerSection;
- U8 mNumVariants;
-
- // first index into the drawpool arrays for this particular branch
- U32 mIndiceIndex[MAX_VARS];
- U32 mOffsets[MAX_VARS][MAX_RES]; // offsets for the partial branch pieces
- // local section frames for this branch
- LLMatrix4 mFrames[MAX_VARS][(MAX_RES*(MAX_RES + 1))/2]; // (0...n) + (1...n) + ... + (n-1..n)
- LLDynamicArray<LLVector3> mFaceNormals;
-
- };
-
- LLVOTreeNew(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
- virtual ~LLVOTreeNew();
-
- /*virtual*/
- U32 processUpdateMessage(LLMessageSystem *mesgsys,
- void **user_data,
- U32 block_num, const EObjectUpdateType update_type,
- LLDataPacker *dp);
-
- /*virtual*/ BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time);
-
- /*virtual*/ void render(LLAgent &agent);
- /*virtual*/ void updateTextures();
-
- /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline);
- /*virtual*/ BOOL updateGeometry(LLDrawable *drawable);
-
- F32 CalcZStep(TreePart *part, U8 section);
-
- void createPart(U8 level, F32 length, F32 radius, LLStrider<LLVector3> &vertices, LLStrider<LLVector3> &normals,
- LLStrider<LLVector2> &tex_coords, U32 *indices,
- U32 &curVertexIndex, U32 &curTexCoordIndex,
- U32 &curNormalIndex, U32 &curIndiceIndex);
-
- S32 findSimilarPart(U8 level);
-
- F32 CalculateSectionRadius(U8 level, F32 y, F32 stemLength, F32 stemRadius);
- //F32 CalculateVerticalAttraction(U8 level, LLMatrix4 &sectionFrame);
-
- void createSection(LLMatrix4 &frame, TreePart *part, F32 sectionRadius, F32 stemZ,
- LLStrider<LLVector3> &vertices, LLStrider<LLVector2> &tex_coords, U32 *indices,
- U32 &curVertexIndex, U32 &curTexCoordIndex, U32 &curIndiceIndex, U8 curSection, BOOL firstBranch);
-
- void genIndicesAndFaceNormalsForLastSection(TreePart *part, U8 numVerts, LLStrider<LLVector3> &vertices, U32 curVertexIndex, U32 *indices, U32 &curIndiceIndex, BOOL firstBranch);
-
- void genVertexNormals(TreePart *part, LLStrider<LLVector3> &normals, U8 numSections, U32 curNormalOffset);
-
- void drawTree(LLDrawPool &draw_pool, const LLMatrix4 &frame, U8 level, F32 offsetChild, F32 curLength, F32 parentLength, F32 curRadius, F32 parentRadius, U8 part, U8 variant, U8 startSection);
- void drawTree(LLDrawPool &draw_pool);
-
-
- //LLTreeParams mParams;
- U8 mSpecies;
- LLPointer<LLViewerTexture> mTreeImagep;
- LLMatrix4 mTrunkFlareFrames[MAX_FLARE];
- F32 mSegSplitsError[3];
- U32 mRandOffset[MAX_LEVELS];
-
- U32 mNumTrisDrawn;
- U32 mTotalIndices;
- U32 mTotalVerts;
-
- static void initClass();
-
- // tree params
- static LLTreeParams sParameters;
-
- // next indexes used to drawpool arrays
- static U32 sNextVertexIndex[MAX_SPECIES];
- static U32 sNextIndiceIndex[MAX_SPECIES];
-
- // tree parts
- static U32 sNextPartIndex[MAX_PARTS];
- static TreePart sTreeParts[MAX_SPECIES][MAX_PARTS];
-
- // species images
- static LLUUID sTreeImageIDs[MAX_SPECIES];
-
- // random numbers
- static F32 sRandNums[MAX_RAND_NUMS];
-
- // usage data
- static U32 sTreePartsUsed[MAX_SPECIES][MAX_PARTS][MAX_VARS];
-
-
-};
-
-#endif
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index c233221e5f..a83e2e020e 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -47,7 +47,6 @@
#include "message.h"
#include "llpluginclassmedia.h" // for code in the mediaEvent handler
#include "object_flags.h"
-#include "llagentconstants.h"
#include "lldrawable.h"
#include "lldrawpoolavatar.h"
#include "lldrawpoolbump.h"
@@ -83,7 +82,7 @@ const S32 MIN_QUIET_FRAMES_COALESCE = 30;
const F32 FORCE_SIMPLE_RENDER_AREA = 512.f;
const F32 FORCE_CULL_AREA = 8.f;
const F32 MAX_LOD_DISTANCE = 24.f;
-
+U32 JOINT_COUNT_REQUIRED_FOR_FULLRIG = 20;
BOOL gAnimateTextures = TRUE;
//extern BOOL gHideSelectedObjects;
@@ -97,9 +96,9 @@ S32 LLVOVolume::mRenderComplexity_current = 0;
LLPointer<LLObjectMediaDataClient> LLVOVolume::sObjectMediaClient = NULL;
LLPointer<LLObjectMediaNavigateClient> LLVOVolume::sObjectMediaNavigateClient = NULL;
-static LLFastTimer::DeclareTimer FTM_GEN_TRIANGLES("Generate Triangles");
-static LLFastTimer::DeclareTimer FTM_GEN_VOLUME("Generate Volumes");
-static LLFastTimer::DeclareTimer FTM_VOLUME_TEXTURES("Volume Textures");
+static LLTrace::BlockTimerStatHandle FTM_GEN_TRIANGLES("Generate Triangles");
+static LLTrace::BlockTimerStatHandle FTM_GEN_VOLUME("Generate Volumes");
+static LLTrace::BlockTimerStatHandle FTM_VOLUME_TEXTURES("Volume Textures");
extern BOOL gGLDebugLoggingEnabled;
@@ -393,8 +392,8 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
BOOL res = LLVolumeMessage::unpackVolumeParams(&volume_params, *dp);
if (!res)
{
- llwarns << "Bogus volume parameters in object " << getID() << llendl;
- llwarns << getRegion()->getOriginGlobal() << llendl;
+ LL_WARNS() << "Bogus volume parameters in object " << getID() << LL_ENDL;
+ LL_WARNS() << getRegion()->getOriginGlobal() << LL_ENDL;
}
volume_params.setSculptID(sculpt_id, sculpt_type);
@@ -408,14 +407,14 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
{
// There's something bogus in the data that we're unpacking.
dp->dumpBufferToLog();
- llwarns << "Flushing cache files" << llendl;
+ LL_WARNS() << "Flushing cache files" << LL_ENDL;
- if(LLVOCache::hasInstance() && getRegion())
+ if(LLVOCache::instanceExists() && getRegion())
{
LLVOCache::getInstance()->removeEntry(getRegion()->getHandle()) ;
}
- llwarns << "Bogus TE data in " << getID() << llendl;
+ LL_WARNS() << "Bogus TE data in " << getID() << LL_ENDL;
}
else
{
@@ -563,9 +562,9 @@ void LLVOVolume::animateTextures()
tex_mat.setIdentity();
LLVector3 trans ;
- trans.set(LLVector3(off_s+0.5f, off_t+0.5f, 0.f));
- tex_mat.translate(LLVector3(-0.5f, -0.5f, 0.f));
-
+ trans.set(LLVector3(off_s+0.5f, off_t+0.5f, 0.f));
+ tex_mat.translate(LLVector3(-0.5f, -0.5f, 0.f));
+
LLVector3 scale(scale_s, scale_t, 1.f);
LLQuaternion quat;
quat.setQuat(rot, 0, 0, -1.f);
@@ -667,7 +666,7 @@ BOOL LLVOVolume::isVisible() const
void LLVOVolume::updateTextureVirtualSize(bool forced)
{
- LLFastTimer ftm(FTM_VOLUME_TEXTURES);
+ LL_RECORD_BLOCK_TIME(FTM_VOLUME_TEXTURES);
// Update the pixel area of all faces
if(!forced)
@@ -1142,11 +1141,11 @@ void LLVOVolume::sculpt()
if ( low_sculpty_discard_warning_count < 10 ||
(low_sculpty_discard_warning_count % interval) == 0)
{ // Log first 10 time, then decreasing intervals afterwards otherwise this can flood the logs
- llwarns << "WARNING!!: Current discard for sculpty " << mSculptTexture->getID()
+ LL_WARNS() << "WARNING!!: Current discard for sculpty " << mSculptTexture->getID()
<< " at " << current_discard
<< " is less than -2."
<< " Hit this " << low_sculpty_discard_warning_count << " times"
- << llendl;
+ << LL_ENDL;
}
low_sculpty_discard_warning_count++;
@@ -1161,11 +1160,11 @@ void LLVOVolume::sculpt()
if ( high_sculpty_discard_warning_count < 10 ||
(high_sculpty_discard_warning_count % interval) == 0)
{ // Log first 10 time, then decreasing intervals afterwards otherwise this can flood the logs
- llwarns << "WARNING!!: Current discard for sculpty " << mSculptTexture->getID()
+ LL_WARNS() << "WARNING!!: Current discard for sculpty " << mSculptTexture->getID()
<< " at " << current_discard
<< " is more than than allowed max of " << MAX_DISCARD_LEVEL
<< ". Hit this " << high_sculpty_discard_warning_count << " times"
- << llendl;
+ << LL_ENDL;
}
high_sculpty_discard_warning_count++;
@@ -1288,9 +1287,9 @@ BOOL LLVOVolume::calcLOD()
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_LOD_INFO) &&
mDrawable->getFace(0))
{
- //setDebugText(llformat("%.2f:%.2f, %d", debug_distance, radius, cur_detail));
+ //setDebugText(llformat("%.2f:%.2f, %d", mDrawable->mDistanceWRTCamera, radius, cur_detail));
- //setDebugText(llformat("%d", mDrawable->getFace(0)->getTextureIndex()));
+ setDebugText(llformat("%d", mDrawable->getFace(0)->getTextureIndex()));
}
if (cur_detail != mLOD)
@@ -1299,10 +1298,8 @@ BOOL LLVOVolume::calcLOD()
mLOD = cur_detail;
return TRUE;
}
- else
- {
- return FALSE;
- }
+
+ return FALSE;
}
BOOL LLVOVolume::updateLOD()
@@ -1625,18 +1622,18 @@ void LLVOVolume::updateRelativeXform(bool force_identity)
}
}
-static LLFastTimer::DeclareTimer FTM_GEN_FLEX("Generate Flexies");
-static LLFastTimer::DeclareTimer FTM_UPDATE_PRIMITIVES("Update Primitives");
-static LLFastTimer::DeclareTimer FTM_UPDATE_RIGGED_VOLUME("Update Rigged");
+static LLTrace::BlockTimerStatHandle FTM_GEN_FLEX("Generate Flexies");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_PRIMITIVES("Update Primitives");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_RIGGED_VOLUME("Update Rigged");
BOOL LLVOVolume::updateGeometry(LLDrawable *drawable)
{
- LLFastTimer t(FTM_UPDATE_PRIMITIVES);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_PRIMITIVES);
if (mDrawable->isState(LLDrawable::REBUILD_RIGGED))
{
{
- LLFastTimer t(FTM_UPDATE_RIGGED_VOLUME);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_RIGGED_VOLUME);
updateRiggedVolume();
}
genBBoxes(FALSE);
@@ -1647,7 +1644,7 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable)
{
BOOL res;
{
- LLFastTimer t(FTM_GEN_FLEX);
+ LL_RECORD_BLOCK_TIME(FTM_GEN_FLEX);
res = mVolumeImpl->doUpdateGeometry(drawable);
}
updateFaceFlags();
@@ -1677,14 +1674,14 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable)
if (mVolumeChanged)
{
- LLFastTimer ftm(FTM_GEN_VOLUME);
+ LL_RECORD_BLOCK_TIME(FTM_GEN_VOLUME);
LLVolumeParams volume_params = getVolume()->getParams();
setVolume(volume_params, 0);
drawable->setState(LLDrawable::REBUILD_VOLUME);
}
{
- LLFastTimer t(FTM_GEN_TRIANGLES);
+ LL_RECORD_BLOCK_TIME(FTM_GEN_TRIANGLES);
regenFaces();
genBBoxes(FALSE);
}
@@ -1703,7 +1700,7 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable)
old_volumep = NULL ;
{
- LLFastTimer ftm(FTM_GEN_VOLUME);
+ LL_RECORD_BLOCK_TIME(FTM_GEN_VOLUME);
LLVolumeParams volume_params = getVolume()->getParams();
setVolume(volume_params, 0);
}
@@ -1726,7 +1723,7 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable)
drawable->setState(LLDrawable::REBUILD_VOLUME); // for face->genVolumeTriangles()
{
- LLFastTimer t(FTM_GEN_TRIANGLES);
+ LL_RECORD_BLOCK_TIME(FTM_GEN_TRIANGLES);
if (new_num_faces != old_num_faces || mNumFaces != (S32)getNumTEs())
{
regenFaces();
@@ -1751,7 +1748,7 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable)
{
compiled = TRUE;
// All it did was move or we changed the texture coordinate offset
- LLFastTimer t(FTM_GEN_TRIANGLES);
+ LL_RECORD_BLOCK_TIME(FTM_GEN_TRIANGLES);
genBBoxes(FALSE);
}
@@ -2177,7 +2174,7 @@ void LLVOVolume::updateObjectMediaData(const LLSD &media_data_array, const std::
if ( (S32)fetched_version > mLastFetchedMediaVersion)
{
mLastFetchedMediaVersion = fetched_version;
- //llinfos << "updating:" << this->getID() << " " << ll_pretty_print_sd(media_data_array) << llendl;
+ //LL_INFOS() << "updating:" << this->getID() << " " << ll_pretty_print_sd(media_data_array) << LL_ENDL;
LLSD::array_const_iterator iter = media_data_array.beginArray();
LLSD::array_const_iterator end = media_data_array.endArray();
@@ -2205,7 +2202,7 @@ void LLVOVolume::syncMediaData(S32 texture_index, const LLSD &media_data, bool m
LL_DEBUGS("MediaOnAPrim") << "BEFORE: texture_index = " << texture_index
<< " hasMedia = " << te->hasMedia() << " : "
- << ((NULL == te->getMediaData()) ? "NULL MEDIA DATA" : ll_pretty_print_sd(te->getMediaData()->asLLSD())) << llendl;
+ << ((NULL == te->getMediaData()) ? "NULL MEDIA DATA" : ll_pretty_print_sd(te->getMediaData()->asLLSD())) << LL_ENDL;
std::string previous_url;
LLMediaEntry* mep = te->getMediaData();
@@ -2247,7 +2244,7 @@ void LLVOVolume::syncMediaData(S32 texture_index, const LLSD &media_data, bool m
LL_DEBUGS("MediaOnAPrim") << "AFTER: texture_index = " << texture_index
<< " hasMedia = " << te->hasMedia() << " : "
- << ((NULL == te->getMediaData()) ? "NULL MEDIA DATA" : ll_pretty_print_sd(te->getMediaData()->asLLSD())) << llendl;
+ << ((NULL == te->getMediaData()) ? "NULL MEDIA DATA" : ll_pretty_print_sd(te->getMediaData()->asLLSD())) << LL_ENDL;
}
void LLVOVolume::mediaNavigateBounceBack(U8 texture_index)
@@ -3684,7 +3681,7 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a&
{
LLVector4a local_start = start;
LLVector4a local_end = end;
-
+
if (transform)
{
LLVector3 v_start(start.getF32ptr());
@@ -3696,7 +3693,7 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a&
local_start.load3(v_start.mV);
local_end.load3(v_end.mV);
}
-
+
LLVector4a p;
LLVector4a n;
LLVector2 tc;
@@ -3912,8 +3909,8 @@ void LLVOVolume::updateRiggedVolume()
}
-static LLFastTimer::DeclareTimer FTM_SKIN_RIGGED("Skin");
-static LLFastTimer::DeclareTimer FTM_RIGGED_OCTREE("Octree");
+static LLTrace::BlockTimerStatHandle FTM_SKIN_RIGGED("Skin");
+static LLTrace::BlockTimerStatHandle FTM_RIGGED_OCTREE("Octree");
void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, const LLVolume* volume)
{
@@ -3974,7 +3971,7 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons
if( pos && weight && dst_face.mExtents )
{
- LLFastTimer t(FTM_SKIN_RIGGED);
+ LL_RECORD_BLOCK_TIME(FTM_SKIN_RIGGED);
for (U32 j = 0; j < dst_face.mNumVertices; ++j)
{
@@ -4037,7 +4034,7 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons
}
{
- LLFastTimer t(FTM_RIGGED_OCTREE);
+ LL_RECORD_BLOCK_TIME(FTM_RIGGED_OCTREE);
delete dst_face.mOctree;
dst_face.mOctree = NULL;
@@ -4061,8 +4058,9 @@ U32 LLVOVolume::getPartitionType() const
return LLViewerRegion::PARTITION_VOLUME;
}
-LLVolumePartition::LLVolumePartition()
-: LLSpatialPartition(LLVOVolume::VERTEX_DATA_MASK, TRUE, GL_DYNAMIC_DRAW_ARB)
+LLVolumePartition::LLVolumePartition(LLViewerRegion* regionp)
+: LLSpatialPartition(LLVOVolume::VERTEX_DATA_MASK, TRUE, GL_DYNAMIC_DRAW_ARB, regionp),
+LLVolumeGeometryManager()
{
mLODPeriod = 32;
mDepthMask = FALSE;
@@ -4072,8 +4070,9 @@ LLVolumePartition::LLVolumePartition()
mBufferUsage = GL_DYNAMIC_DRAW_ARB;
}
-LLVolumeBridge::LLVolumeBridge(LLDrawable* drawablep)
-: LLSpatialBridge(drawablep, TRUE, LLVOVolume::VERTEX_DATA_MASK)
+LLVolumeBridge::LLVolumeBridge(LLDrawable* drawablep, LLViewerRegion* regionp)
+: LLSpatialBridge(drawablep, TRUE, LLVOVolume::VERTEX_DATA_MASK, regionp),
+LLVolumeGeometryManager()
{
mDepthMask = FALSE;
mLODPeriod = 32;
@@ -4110,16 +4109,80 @@ bool can_batch_texture(LLFace* facep)
return true;
}
-static LLFastTimer::DeclareTimer FTM_REGISTER_FACE("Register Face");
+const static U32 MAX_FACE_COUNT = 4096U;
+int32_t LLVolumeGeometryManager::sInstanceCount = 0;
+LLFace** LLVolumeGeometryManager::sFullbrightFaces = NULL;
+LLFace** LLVolumeGeometryManager::sBumpFaces = NULL;
+LLFace** LLVolumeGeometryManager::sSimpleFaces = NULL;
+LLFace** LLVolumeGeometryManager::sNormFaces = NULL;
+LLFace** LLVolumeGeometryManager::sSpecFaces = NULL;
+LLFace** LLVolumeGeometryManager::sNormSpecFaces = NULL;
+LLFace** LLVolumeGeometryManager::sAlphaFaces = NULL;
+
+LLVolumeGeometryManager::LLVolumeGeometryManager()
+ : LLGeometryManager()
+{
+ llassert(sInstanceCount >= 0);
+ if (sInstanceCount == 0)
+ {
+ allocateFaces(MAX_FACE_COUNT);
+ }
+
+ ++sInstanceCount;
+}
+
+LLVolumeGeometryManager::~LLVolumeGeometryManager()
+{
+ llassert(sInstanceCount > 0);
+ --sInstanceCount;
+
+ if (sInstanceCount <= 0)
+ {
+ freeFaces();
+ sInstanceCount = 0;
+ }
+}
+
+void LLVolumeGeometryManager::allocateFaces(U32 pMaxFaceCount)
+{
+ sFullbrightFaces = static_cast<LLFace**>(ll_aligned_malloc<64>(pMaxFaceCount*sizeof(LLFace*)));
+ sBumpFaces = static_cast<LLFace**>(ll_aligned_malloc<64>(pMaxFaceCount*sizeof(LLFace*)));
+ sSimpleFaces = static_cast<LLFace**>(ll_aligned_malloc<64>(pMaxFaceCount*sizeof(LLFace*)));
+ sNormFaces = static_cast<LLFace**>(ll_aligned_malloc<64>(pMaxFaceCount*sizeof(LLFace*)));
+ sSpecFaces = static_cast<LLFace**>(ll_aligned_malloc<64>(pMaxFaceCount*sizeof(LLFace*)));
+ sNormSpecFaces = static_cast<LLFace**>(ll_aligned_malloc<64>(pMaxFaceCount*sizeof(LLFace*)));
+ sAlphaFaces = static_cast<LLFace**>(ll_aligned_malloc<64>(pMaxFaceCount*sizeof(LLFace*)));
+}
+
+void LLVolumeGeometryManager::freeFaces()
+{
+ ll_aligned_free<64>(sFullbrightFaces);
+ ll_aligned_free<64>(sBumpFaces);
+ ll_aligned_free<64>(sSimpleFaces);
+ ll_aligned_free<64>(sNormFaces);
+ ll_aligned_free<64>(sSpecFaces);
+ ll_aligned_free<64>(sNormSpecFaces);
+ ll_aligned_free<64>(sAlphaFaces);
+
+ sFullbrightFaces = NULL;
+ sBumpFaces = NULL;
+ sSimpleFaces = NULL;
+ sNormFaces = NULL;
+ sSpecFaces = NULL;
+ sNormSpecFaces = NULL;
+ sAlphaFaces = NULL;
+}
+
+static LLTrace::BlockTimerStatHandle FTM_REGISTER_FACE("Register Face");
void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, U32 type)
{
- LLFastTimer t(FTM_REGISTER_FACE);
+ LL_RECORD_BLOCK_TIME(FTM_REGISTER_FACE);
if (type == LLRenderPass::PASS_ALPHA && facep->getTextureEntry()->getMaterialParams().notNull() && !facep->getVertexBuffer()->hasDataType(LLVertexBuffer::TYPE_TANGENT))
{
LL_WARNS("RenderMaterials") << "Oh no! No binormals for this alpha blended face!" << LL_ENDL;
}
-
+
if (facep->getViewerObject()->isSelected() && LLSelectMgr::getInstance()->mHideSelectedObjects)
{
return;
@@ -4138,7 +4201,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
if (!fullbright && type != LLRenderPass::PASS_GLOW && !facep->getVertexBuffer()->hasDataType(LLVertexBuffer::TYPE_NORMAL))
{
- llwarns << "Non fullbright face has no normals!" << llendl;
+ LL_WARNS() << "Non fullbright face has no normals!" << LL_ENDL;
return;
}
@@ -4169,11 +4232,11 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
U8 bump = (type == LLRenderPass::PASS_BUMP || type == LLRenderPass::PASS_POST_BUMP) ? facep->getTextureEntry()->getBumpmap() : 0;
U8 shiny = facep->getTextureEntry()->getShiny();
-
+
LLViewerTexture* tex = facep->getTexture();
U8 index = facep->getTextureIndex();
-
+
LLMaterial* mat = facep->getTextureEntry()->getMaterialParams().get();
LLMaterialID mat_id = facep->getTextureEntry()->getMaterialID();
@@ -4229,7 +4292,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
draw_vec[idx]->mMaterial == mat &&
draw_vec[idx]->mMaterialID == mat_id &&
draw_vec[idx]->mFullbright == fullbright &&
- draw_vec[idx]->mBump == bump &&
+ draw_vec[idx]->mBump == bump &&
(!mat || (draw_vec[idx]->mShiny == shiny)) && // need to break batches when a material is shared, but legacy settings are different
draw_vec[idx]->mTextureMatrix == tex_mat &&
draw_vec[idx]->mModelMatrix == model_mat &&
@@ -4255,7 +4318,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
U32 offset = facep->getIndicesStart();
U32 count = facep->getIndicesCount();
LLPointer<LLDrawInfo> draw_info = new LLDrawInfo(start,end,count,offset, tex,
- facep->getVertexBuffer(), fullbright, bump);
+ facep->getVertexBuffer(), fullbright, bump);
draw_info->mGroup = group;
draw_info->mVSize = facep->getVirtualSize();
draw_vec.push_back(draw_info);
@@ -4341,9 +4404,9 @@ void LLVolumeGeometryManager::getGeometry(LLSpatialGroup* group)
}
-static LLFastTimer::DeclareTimer FTM_REBUILD_VOLUME_VB("Volume VB");
-static LLFastTimer::DeclareTimer FTM_REBUILD_VOLUME_FACE_LIST("Build Face List");
-static LLFastTimer::DeclareTimer FTM_REBUILD_VOLUME_GEN_DRAW_INFO("Gen Draw Info");
+static LLTrace::BlockTimerStatHandle FTM_REBUILD_VOLUME_VB("Volume VB");
+static LLTrace::BlockTimerStatHandle FTM_REBUILD_VOLUME_FACE_LIST("Build Face List");
+static LLTrace::BlockTimerStatHandle FTM_REBUILD_VOLUME_GEN_DRAW_INFO("Gen Draw Info");
static LLDrawPoolAvatar* get_avatar_drawpool(LLViewerObject* vobj)
{
@@ -4383,22 +4446,22 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
group->mLastUpdateViewAngle = group->mViewAngle;
- if (!group->isState(LLSpatialGroup::GEOM_DIRTY | LLSpatialGroup::ALPHA_DIRTY))
+ if (!group->hasState(LLSpatialGroup::GEOM_DIRTY | LLSpatialGroup::ALPHA_DIRTY))
{
- if (group->isState(LLSpatialGroup::MESH_DIRTY) && !LLPipeline::sDelayVBUpdate)
+ if (group->hasState(LLSpatialGroup::MESH_DIRTY) && !LLPipeline::sDelayVBUpdate)
{
rebuildMesh(group);
}
return;
}
- LLFastTimer ftm(FTM_REBUILD_VOLUME_VB);
+ LL_RECORD_BLOCK_TIME(FTM_REBUILD_VOLUME_VB);
group->mBuilt = 1.f;
LLVOAvatar* pAvatarVO = NULL;
- LLSpatialBridge* bridge = group->mSpatialPartition->asBridge();
+ LLSpatialBridge* bridge = group->getSpatialPartition()->asBridge();
if (bridge)
{
if (bridge->mAvatar.isNull())
@@ -4425,22 +4488,13 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
group->mSurfaceArea = 0;
//cache object box size since it might be used for determining visibility
- group->mObjectBoxSize = group->mObjectBounds[1].getLength3().getF32();
+ const LLVector4a* bounds = group->getObjectBounds();
+ group->mObjectBoxSize = bounds[1].getLength3().getF32();
group->clearDrawMap();
mFaceList.clear();
- const U32 MAX_FACE_COUNT = 4096;
-
- static LLFace** fullbright_faces = (LLFace**) ll_aligned_malloc(MAX_FACE_COUNT*sizeof(LLFace*),64);
- static LLFace** bump_faces = (LLFace**) ll_aligned_malloc(MAX_FACE_COUNT*sizeof(LLFace*),64);
- static LLFace** simple_faces = (LLFace**) ll_aligned_malloc(MAX_FACE_COUNT*sizeof(LLFace*),64);
- static LLFace** norm_faces = (LLFace**) ll_aligned_malloc(MAX_FACE_COUNT*sizeof(LLFace*), 64);
- static LLFace** spec_faces = (LLFace**) ll_aligned_malloc(MAX_FACE_COUNT*sizeof(LLFace*), 64);
- static LLFace** normspec_faces = (LLFace**) ll_aligned_malloc(MAX_FACE_COUNT*sizeof(LLFace*), 64);
- static LLFace** alpha_faces = (LLFace**) ll_aligned_malloc(MAX_FACE_COUNT*sizeof(LLFace*),64);
-
U32 fullbright_count = 0;
U32 bump_count = 0;
U32 simple_count = 0;
@@ -4450,27 +4504,30 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
U32 normspec_count = 0;
- U32 useage = group->mSpatialPartition->mBufferUsage;
+ U32 useage = group->getSpatialPartition()->mBufferUsage;
- U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcVertexSize(group->mSpatialPartition->mVertexDataMask);
- U32 max_total = (gSavedSettings.getS32("RenderMaxNodeSize")*1024)/LLVertexBuffer::calcVertexSize(group->mSpatialPartition->mVertexDataMask);
+ U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcVertexSize(group->getSpatialPartition()->mVertexDataMask);
+ U32 max_total = (gSavedSettings.getS32("RenderMaxNodeSize")*1024)/LLVertexBuffer::calcVertexSize(group->getSpatialPartition()->mVertexDataMask);
max_vertices = llmin(max_vertices, (U32) 65535);
U32 cur_total = 0;
bool emissive = false;
-
+ //Determine if we've received skininfo that contains an
+ //alternate bind matrix - if it does then apply the translational component
+ //to the joints of the avatar.
+ bool pelvisGotSet = false;
{
- LLFastTimer t(FTM_REBUILD_VOLUME_FACE_LIST);
+ LL_RECORD_BLOCK_TIME(FTM_REBUILD_VOLUME_FACE_LIST);
//get all the faces into a list
for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter)
{
- LLDrawable* drawablep = *drawable_iter;
+ LLDrawable* drawablep = (LLDrawable*)(*drawable_iter)->getDrawable();
- if (drawablep->isDead() || drawablep->isState(LLDrawable::FORCE_INVISIBLE) )
+ if (!drawablep || drawablep->isDead() || drawablep->isState(LLDrawable::FORCE_INVISIBLE) )
{
continue;
}
@@ -4543,18 +4600,12 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
is_rigged = true;
//get drawpool of avatar with rigged face
- LLDrawPoolAvatar* pool = get_avatar_drawpool(vobj);
-
- //Determine if we've received skininfo that contains an
- //alternate bind matrix - if it does then apply the translational component
- //to the joints of the avatar.
- bool pelvisGotSet = false;
-
+ LLDrawPoolAvatar* pool = get_avatar_drawpool(vobj);
+
if ( pAvatarVO )
{
- LLUUID currentId = vobj->getVolume()->getParams().getSculptID();
+ LLUUID currentId = vobj->getVolume()->getParams().getSculptID();
const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( currentId, vobj );
-
if ( pSkinData )
{
const int bindCnt = pSkinData->mAlternateBindMatrix.size();
@@ -4562,43 +4613,42 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
{
const int jointCnt = pSkinData->mJointNames.size();
const F32 pelvisZOffset = pSkinData->mPelvisOffset;
- bool fullRig = (jointCnt>=20) ? true : false;
+ bool fullRig = (jointCnt>=JOINT_COUNT_REQUIRED_FOR_FULLRIG) ? true : false;
if ( fullRig )
- {
+ {
for ( int i=0; i<jointCnt; ++i )
{
std::string lookingForJoint = pSkinData->mJointNames[i].c_str();
- //llinfos<<"joint name "<<lookingForJoint.c_str()<<llendl;
LLJoint* pJoint = pAvatarVO->getJoint( lookingForJoint );
if ( pJoint && pJoint->getId() != currentId )
{
pJoint->setId( currentId );
const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation();
+
//Set the joint position
- pJoint->storeCurrentXform( jointPos );
+ pJoint->storeCurrentXform( jointPos );
+
//If joint is a pelvis then handle old/new pelvis to foot values
if ( lookingForJoint == "mPelvis" )
{
- pJoint->storeCurrentXform( jointPos );
if ( !pAvatarVO->hasPelvisOffset() )
{
pAvatarVO->setPelvisOffset( true, jointPos, pelvisZOffset );
- //Trigger to rebuild viewer AV
pelvisGotSet = true;
}
}
- }
- }
+ }
+ }
}
}
}
}
- //If we've set the pelvis to a new position we need to also rebuild some information that the
- //viewer does at launch (e.g. body size etc.)
- if ( pelvisGotSet )
+
+ //Rebuild body data if we altered joints/pelvis
+ if ( pelvisGotSet && pAvatarVO )
{
pAvatarVO->postPelvisSetRecalc();
- }
+ }
if (pool)
{
@@ -4675,67 +4725,67 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
}
else
{
- if (type == LLDrawPool::POOL_ALPHA)
- {
- if (te->getColor().mV[3] > 0.f)
- {
- if (te->getFullbright())
- {
- pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_FULLBRIGHT_ALPHA);
- }
- else
- {
- pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_ALPHA);
- }
- }
- }
- else if (te->getShiny())
+ if (type == LLDrawPool::POOL_ALPHA)
+ {
+ if (te->getColor().mV[3] > 0.f)
{
if (te->getFullbright())
{
- pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_FULLBRIGHT_SHINY);
+ pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_FULLBRIGHT_ALPHA);
}
else
{
- if (LLPipeline::sRenderDeferred)
- {
- pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_SIMPLE);
- }
- else
- {
- pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_SHINY);
- }
+ pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_ALPHA);
}
}
+ }
+ else if (te->getShiny())
+ {
+ if (te->getFullbright())
+ {
+ pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_FULLBRIGHT_SHINY);
+ }
else
{
- if (te->getFullbright())
+ if (LLPipeline::sRenderDeferred)
{
- pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_FULLBRIGHT);
+ pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_SIMPLE);
}
else
{
- pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_SIMPLE);
+ pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_SHINY);
}
}
+ }
+ else
+ {
+ if (te->getFullbright())
+ {
+ pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_FULLBRIGHT);
+ }
+ else
+ {
+ pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_SIMPLE);
+ }
+ }
-
- if (LLPipeline::sRenderDeferred)
+
+ if (LLPipeline::sRenderDeferred)
+ {
+ if (type != LLDrawPool::POOL_ALPHA && !te->getFullbright())
{
- if (type != LLDrawPool::POOL_ALPHA && !te->getFullbright())
+ if (te->getBumpmap())
{
- if (te->getBumpmap())
- {
- pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_DEFERRED_BUMP);
- }
- else
- {
- pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_DEFERRED_SIMPLE);
- }
+ pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_DEFERRED_BUMP);
+ }
+ else
+ {
+ pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_DEFERRED_SIMPLE);
}
}
}
}
+ }
continue;
}
@@ -4822,7 +4872,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
{ //can be treated as alpha mask
if (simple_count < MAX_FACE_COUNT)
{
- simple_faces[simple_count++] = facep;
+ sSimpleFaces[simple_count++] = facep;
}
}
else
@@ -4833,7 +4883,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
}
if (alpha_count < MAX_FACE_COUNT)
{
- alpha_faces[alpha_count++] = facep;
+ sAlphaFaces[alpha_count++] = facep;
}
}
}
@@ -4856,14 +4906,14 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
{ //has normal and specular maps (needs texcoord1, texcoord2, and tangent)
if (normspec_count < MAX_FACE_COUNT)
{
- normspec_faces[normspec_count++] = facep;
+ sNormSpecFaces[normspec_count++] = facep;
}
}
else
{ //has normal map (needs texcoord1 and tangent)
if (norm_count < MAX_FACE_COUNT)
{
- norm_faces[norm_count++] = facep;
+ sNormFaces[norm_count++] = facep;
}
}
}
@@ -4871,14 +4921,14 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
{ //has specular map but no normal map, needs texcoord2
if (spec_count < MAX_FACE_COUNT)
{
- spec_faces[spec_count++] = facep;
+ sSpecFaces[spec_count++] = facep;
}
}
else
{ //has neither specular map nor normal map, only needs texcoord0
if (simple_count < MAX_FACE_COUNT)
{
- simple_faces[simple_count++] = facep;
+ sSimpleFaces[simple_count++] = facep;
}
}
}
@@ -4886,14 +4936,14 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
{ //needs normal + tangent
if (bump_count < MAX_FACE_COUNT)
{
- bump_faces[bump_count++] = facep;
+ sBumpFaces[bump_count++] = facep;
}
}
else if (te->getShiny() || !te->getFullbright())
{ //needs normal
if (simple_count < MAX_FACE_COUNT)
{
- simple_faces[simple_count++] = facep;
+ sSimpleFaces[simple_count++] = facep;
}
}
else
@@ -4901,7 +4951,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
facep->setState(LLFace::FULLBRIGHT);
if (fullbright_count < MAX_FACE_COUNT)
{
- fullbright_faces[fullbright_count++] = facep;
+ sFullbrightFaces[fullbright_count++] = facep;
}
}
}
@@ -4911,7 +4961,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
{ //needs normal + tangent
if (bump_count < MAX_FACE_COUNT)
{
- bump_faces[bump_count++] = facep;
+ sBumpFaces[bump_count++] = facep;
}
}
else if ((te->getShiny() && LLPipeline::sRenderBump) ||
@@ -4919,7 +4969,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
{ //needs normal
if (simple_count < MAX_FACE_COUNT)
{
- simple_faces[simple_count++] = facep;
+ sSimpleFaces[simple_count++] = facep;
}
}
else
@@ -4927,7 +4977,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
facep->setState(LLFace::FULLBRIGHT);
if (fullbright_count < MAX_FACE_COUNT)
{
- fullbright_faces[fullbright_count++] = facep;
+ sFullbrightFaces[fullbright_count++] = facep;
}
}
}
@@ -4954,7 +5004,16 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
{
drawablep->clearState(LLDrawable::RIGGED);
}
+
}
+
+
+
+
+
+
+
+
}
group->mBufferUsage = useage;
@@ -4990,23 +5049,26 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
fullbright_mask = fullbright_mask | LLVertexBuffer::MAP_TEXTURE_INDEX;
}
- genDrawInfo(group, simple_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, simple_faces, simple_count, FALSE, batch_textures, FALSE);
- genDrawInfo(group, fullbright_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, fullbright_faces, fullbright_count, FALSE, batch_textures);
- genDrawInfo(group, alpha_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, alpha_faces, alpha_count, TRUE, batch_textures);
- genDrawInfo(group, bump_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, bump_faces, bump_count, FALSE, FALSE);
- genDrawInfo(group, norm_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, norm_faces, norm_count, FALSE, FALSE);
- genDrawInfo(group, spec_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, spec_faces, spec_count, FALSE, FALSE);
- genDrawInfo(group, normspec_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, normspec_faces, normspec_count, FALSE, FALSE);
+ genDrawInfo(group, simple_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, sSimpleFaces, simple_count, FALSE, batch_textures, FALSE);
+ genDrawInfo(group, fullbright_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, sFullbrightFaces, fullbright_count, FALSE, batch_textures);
+ genDrawInfo(group, alpha_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, sAlphaFaces, alpha_count, TRUE, batch_textures);
+ genDrawInfo(group, bump_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, sBumpFaces, bump_count, FALSE, FALSE);
+ genDrawInfo(group, norm_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, sNormFaces, norm_count, FALSE, FALSE);
+ genDrawInfo(group, spec_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, sSpecFaces, spec_count, FALSE, FALSE);
+ genDrawInfo(group, normspec_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, sNormSpecFaces, normspec_count, FALSE, FALSE);
if (!LLPipeline::sDelayVBUpdate)
{
//drawables have been rebuilt, clear rebuild status
for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter)
{
- LLDrawable* drawablep = *drawable_iter;
+ LLDrawable* drawablep = (LLDrawable*)(*drawable_iter)->getDrawable();
+ if(drawablep)
+ {
drawablep->clearState(LLDrawable::REBUILD_ALL);
}
}
+ }
group->mLastUpdateTime = gFrameTimeSeconds;
group->mBuilt = 1.f;
@@ -5040,15 +5102,15 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
}
}
-static LLFastTimer::DeclareTimer FTM_REBUILD_MESH_FLUSH("Flush Mesh");
+static LLTrace::BlockTimerStatHandle FTM_REBUILD_MESH_FLUSH("Flush Mesh");
void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
{
llassert(group);
- if (group && group->isState(LLSpatialGroup::MESH_DIRTY) && !group->isState(LLSpatialGroup::GEOM_DIRTY))
+ if (group && group->hasState(LLSpatialGroup::MESH_DIRTY) && !group->hasState(LLSpatialGroup::GEOM_DIRTY))
{
- LLFastTimer ftm(FTM_REBUILD_VOLUME_VB);
- LLFastTimer t(FTM_REBUILD_VOLUME_GEN_DRAW_INFO); //make sure getgeometryvolume shows up in the right place in timers
+ LL_RECORD_BLOCK_TIME(FTM_REBUILD_VOLUME_VB);
+ LL_RECORD_BLOCK_TIME(FTM_REBUILD_VOLUME_GEN_DRAW_INFO); //make sure getgeometryvolume shows up in the right place in timers
group->mBuilt = 1.f;
@@ -5061,9 +5123,9 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter)
{
- LLDrawable* drawablep = *drawable_iter;
+ LLDrawable* drawablep = (LLDrawable*)(*drawable_iter)->getDrawable();
- if (!drawablep->isDead() && drawablep->isState(LLDrawable::REBUILD_ALL) && !drawablep->isState(LLDrawable::RIGGED) )
+ if (drawablep && !drawablep->isDead() && drawablep->isState(LLDrawable::REBUILD_ALL) && !drawablep->isState(LLDrawable::RIGGED) )
{
LLVOVolume* vobj = drawablep->getVOVolume();
vobj->preRebuild();
@@ -5111,7 +5173,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
}
{
- LLFastTimer t(FTM_REBUILD_MESH_FLUSH);
+ LL_RECORD_BLOCK_TIME(FTM_REBUILD_MESH_FLUSH);
for (LLVertexBuffer** iter = locked_buffer, ** end_iter = locked_buffer+buffer_count; iter != end_iter; ++iter)
{
(*iter)->flush();
@@ -5129,10 +5191,14 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
//if not all buffers are unmapped
if(num_mapped_vertex_buffer != LLVertexBuffer::sMappedCount)
{
- llwarns << "Not all mapped vertex buffers are unmapped!" << llendl ;
+ LL_WARNS() << "Not all mapped vertex buffers are unmapped!" << LL_ENDL ;
for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter)
{
- LLDrawable* drawablep = *drawable_iter;
+ LLDrawable* drawablep = (LLDrawable*)(*drawable_iter)->getDrawable();
+ if(!drawablep)
+ {
+ continue;
+ }
for (S32 i = 0; i < drawablep->getNumFaces(); ++i)
{
LLFace* face = drawablep->getFace(i);
@@ -5184,11 +5250,11 @@ struct CompareBatchBreakerModified
}
};
-static LLFastTimer::DeclareTimer FTM_GEN_DRAW_INFO_SORT("Draw Info Face Sort");
-static LLFastTimer::DeclareTimer FTM_GEN_DRAW_INFO_FACE_SIZE("Face Sizing");
-static LLFastTimer::DeclareTimer FTM_GEN_DRAW_INFO_ALLOCATE("Allocate VB");
-static LLFastTimer::DeclareTimer FTM_GEN_DRAW_INFO_FIND_VB("Find VB");
-static LLFastTimer::DeclareTimer FTM_GEN_DRAW_INFO_RESIZE_VB("Resize VB");
+static LLTrace::BlockTimerStatHandle FTM_GEN_DRAW_INFO_SORT("Draw Info Face Sort");
+static LLTrace::BlockTimerStatHandle FTM_GEN_DRAW_INFO_FACE_SIZE("Face Sizing");
+static LLTrace::BlockTimerStatHandle FTM_GEN_DRAW_INFO_ALLOCATE("Allocate VB");
+static LLTrace::BlockTimerStatHandle FTM_GEN_DRAW_INFO_FIND_VB("Find VB");
+static LLTrace::BlockTimerStatHandle FTM_GEN_DRAW_INFO_RESIZE_VB("Resize VB");
@@ -5196,7 +5262,7 @@ static LLFastTimer::DeclareTimer FTM_GEN_DRAW_INFO_RESIZE_VB("Resize VB");
void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace** faces, U32 face_count, BOOL distance_sort, BOOL batch_textures, BOOL no_materials)
{
- LLFastTimer t(FTM_REBUILD_VOLUME_GEN_DRAW_INFO);
+ LL_RECORD_BLOCK_TIME(FTM_REBUILD_VOLUME_GEN_DRAW_INFO);
U32 buffer_usage = group->mBufferUsage;
@@ -5222,11 +5288,11 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac
#endif
//calculate maximum number of vertices to store in a single buffer
- U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcVertexSize(group->mSpatialPartition->mVertexDataMask);
+ U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcVertexSize(group->getSpatialPartition()->mVertexDataMask);
max_vertices = llmin(max_vertices, (U32) 65535);
{
- LLFastTimer t(FTM_GEN_DRAW_INFO_SORT);
+ LL_RECORD_BLOCK_TIME(FTM_GEN_DRAW_INFO_SORT);
if (!distance_sort)
{
//sort faces by things that break batches
@@ -5311,7 +5377,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac
U32 texture_count = 0;
{
- LLFastTimer t(FTM_GEN_DRAW_INFO_FACE_SIZE);
+ LL_RECORD_BLOCK_TIME(FTM_GEN_DRAW_INFO_FACE_SIZE);
if (batch_textures)
{
U8 cur_tex = 0;
@@ -5434,7 +5500,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac
LLVertexBuffer* buffer = NULL;
{
- LLFastTimer t(FTM_GEN_DRAW_INFO_ALLOCATE);
+ LL_RECORD_BLOCK_TIME(FTM_GEN_DRAW_INFO_ALLOCATE);
buffer = createVertexBuffer(mask, buffer_usage);
buffer->allocateBuffer(geom_count, index_count, TRUE);
}
@@ -5458,7 +5524,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac
if (batch_textures && facep->getTextureIndex() == 255)
{
- llerrs << "Invalid texture index." << llendl;
+ LL_ERRS() << "Invalid texture index." << LL_ENDL;
}
{
@@ -5483,7 +5549,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac
if (!facep->getGeometryVolume(*volume, te_idx,
vobj->getRelativeXform(), vobj->getRelativeXformInvTrans(), index_offset,true))
{
- llwarns << "Failed to get geometry for face!" << llendl;
+ LL_WARNS() << "Failed to get geometry for face!" << LL_ENDL;
}
if (drawablep->isState(LLDrawable::ANIMATED_CHILD))
@@ -5495,7 +5561,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac
index_offset += facep->getGeomCount();
indices_index += facep->getIndicesCount();
-
+
//append face to appropriate render batch
BOOL force_simple = facep->getPixelArea() < FORCE_SIMPLE_RENDER_AREA;
@@ -5719,7 +5785,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac
}
else
{
- registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT);
+ registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT);
}
if (LLPipeline::sRenderDeferred && !hud_group && LLPipeline::sRenderBump && use_legacy_bump)
{ //if this is the deferred render and a bump map is present, register in post deferred bump
@@ -5741,10 +5807,10 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac
}
else
{
- registerFace(group, facep, LLRenderPass::PASS_SIMPLE);
- }
+ registerFace(group, facep, LLRenderPass::PASS_SIMPLE);
}
}
+ }
if (!gPipeline.canUseVertexShaders() &&
@@ -5789,7 +5855,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac
void LLGeometryManager::addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32 &index_count)
{
//initialize to default usage for this partition
- U32 usage = group->mSpatialPartition->mBufferUsage;
+ U32 usage = group->getSpatialPartition()->mBufferUsage;
//clear off any old faces
mFaceList.clear();
@@ -5798,9 +5864,9 @@ void LLGeometryManager::addGeometryCount(LLSpatialGroup* group, U32 &vertex_coun
for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter)
{
- LLDrawable* drawablep = *drawable_iter;
+ LLDrawable* drawablep = (LLDrawable*)(*drawable_iter)->getDrawable();
- if (drawablep->isDead())
+ if (!drawablep || drawablep->isDead())
{
continue;
}
@@ -5838,7 +5904,7 @@ void LLGeometryManager::addGeometryCount(LLSpatialGroup* group, U32 &vertex_coun
group->mBufferUsage = usage;
}
-LLHUDPartition::LLHUDPartition()
+LLHUDPartition::LLHUDPartition(LLViewerRegion* regionp) : LLBridgePartition(regionp)
{
mPartitionType = LLViewerRegion::PARTITION_HUD;
mDrawableType = LLPipeline::RENDER_TYPE_HUD;
diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp
index 21595ee0bc..e3419af10d 100755
--- a/indra/newview/llvowater.cpp
+++ b/indra/newview/llvowater.cpp
@@ -28,7 +28,6 @@
#include "llvowater.h"
-#include "imageids.h"
#include "llviewercontrol.h"
#include "lldrawable.h"
@@ -124,11 +123,11 @@ LLDrawable *LLVOWater::createDrawable(LLPipeline *pipeline)
return mDrawable;
}
-static LLFastTimer::DeclareTimer FTM_UPDATE_WATER("Update Water");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_WATER("Update Water");
BOOL LLVOWater::updateGeometry(LLDrawable *drawable)
{
- LLFastTimer ftm(FTM_UPDATE_WATER);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_WATER);
LLFace *face;
if (drawable->getNumFaces() < 1)
@@ -298,15 +297,15 @@ U32 LLVOVoidWater::getPartitionType() const
return LLViewerRegion::PARTITION_VOIDWATER;
}
-LLWaterPartition::LLWaterPartition()
-: LLSpatialPartition(0, FALSE, GL_DYNAMIC_DRAW_ARB)
+LLWaterPartition::LLWaterPartition(LLViewerRegion* regionp)
+: LLSpatialPartition(0, FALSE, GL_DYNAMIC_DRAW_ARB, regionp)
{
mInfiniteFarClip = TRUE;
mDrawableType = LLPipeline::RENDER_TYPE_WATER;
mPartitionType = LLViewerRegion::PARTITION_WATER;
}
-LLVoidWaterPartition::LLVoidWaterPartition()
+LLVoidWaterPartition::LLVoidWaterPartition(LLViewerRegion* regionp) : LLWaterPartition(regionp)
{
mOcclusionEnabled = FALSE;
mDrawableType = LLPipeline::RENDER_TYPE_VOIDWATER;
diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp
index e7435b6860..90bc6509a6 100755
--- a/indra/newview/llvowlsky.cpp
+++ b/indra/newview/llvowlsky.cpp
@@ -301,11 +301,11 @@ void LLVOWLSky::restoreGL()
gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE);
}
-static LLFastTimer::DeclareTimer FTM_GEO_SKY("Windlight Sky Geometry");
+static LLTrace::BlockTimerStatHandle FTM_GEO_SKY("Windlight Sky Geometry");
BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable)
{
- LLFastTimer ftm(FTM_GEO_SKY);
+ LL_RECORD_BLOCK_TIME(FTM_GEO_SKY);
LLStrider<LLVector3> vertices;
LLStrider<LLVector2> texCoords;
LLStrider<U16> indices;
@@ -321,7 +321,7 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable)
if(!success)
{
- llerrs << "Failed updating WindLight sky geometry." << llendl;
+ LL_ERRS() << "Failed updating WindLight sky geometry." << LL_ENDL;
}
buildFanBuffer(vertices, texCoords, indices);
@@ -345,7 +345,7 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable)
// round up to a whole number of segments
const U32 strips_segments = (total_stacks+stacks_per_seg-1) / stacks_per_seg;
- llinfos << "WL Skydome strips in " << strips_segments << " batches." << llendl;
+ LL_INFOS() << "WL Skydome strips in " << strips_segments << " batches." << LL_ENDL;
mStripsVerts.resize(strips_segments, NULL);
@@ -384,7 +384,7 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable)
if(!success)
{
- llerrs << "Failed updating WindLight sky geometry." << llendl;
+ LL_ERRS() << "Failed updating WindLight sky geometry." << LL_ENDL;
}
// fill it
@@ -394,7 +394,7 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable)
segment->flush();
}
- llinfos << "completed in " << llformat("%.2f", timer.getElapsedTimeF32()) << "seconds" << llendl;
+ LL_INFOS() << "completed in " << llformat("%.2f", timer.getElapsedTimeF32().value()) << "seconds" << LL_ENDL;
}
#else
mStripsVerts = new LLVertexBuffer(LLDrawPoolWLSky::SKY_VERTEX_DATA_MASK, GL_STATIC_DRAW_ARB);
@@ -786,7 +786,7 @@ BOOL LLVOWLSky::updateStarGeometry(LLDrawable *drawable)
if(!success)
{
- llerrs << "Failed updating star geometry." << llendl;
+ LL_ERRS() << "Failed updating star geometry." << LL_ENDL;
}
// *TODO: fix LLStrider with a real prefix increment operator so it can be
@@ -795,7 +795,7 @@ BOOL LLVOWLSky::updateStarGeometry(LLDrawable *drawable)
if (mStarVertices.size() < getStarsNumVerts())
{
- llerrs << "Star reference geometry insufficient." << llendl;
+ LL_ERRS() << "Star reference geometry insufficient." << LL_ENDL;
}
for (U32 vtx = 0; vtx < getStarsNumVerts(); ++vtx)
diff --git a/indra/newview/llwatchdog.cpp b/indra/newview/llwatchdog.cpp
index 4f582fc2db..7b5bcf4db0 100755
--- a/indra/newview/llwatchdog.cpp
+++ b/indra/newview/llwatchdog.cpp
@@ -27,6 +27,7 @@
#include "llviewerprecompiledheaders.h"
#include "llwatchdog.h"
+#include "llthread.h"
const U32 WATCHDOG_SLEEP_TIME_USEC = 1000000;
@@ -221,7 +222,7 @@ void LLWatchdog::run()
if(current_run_delta > (WATCHDOG_SLEEP_TIME_USEC * TIME_ELAPSED_MULTIPLIER))
{
- llinfos << "Watchdog thread delayed: resetting entries." << llendl;
+ LL_INFOS() << "Watchdog thread delayed: resetting entries." << LL_ENDL;
std::for_each(mSuspects.begin(),
mSuspects.end(),
std::mem_fun(&LLWatchdogEntry::reset)
@@ -243,7 +244,7 @@ void LLWatchdog::run()
mTimer->stop();
}
- llinfos << "Watchdog detected error:" << llendl;
+ LL_INFOS() << "Watchdog detected error:" << LL_ENDL;
mKillerCallback();
}
}
diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp
index 72d628fb88..c854e1fc66 100755
--- a/indra/newview/llwaterparammanager.cpp
+++ b/indra/newview/llwaterparammanager.cpp
@@ -89,7 +89,7 @@ void LLWaterParamManager::loadAllPresets()
void LLWaterParamManager::loadPresetsFromDir(const std::string& dir)
{
- LL_INFOS2("AppInit", "Shaders") << "Loading water presets from " << dir << LL_ENDL;
+ LL_INFOS("AppInit", "Shaders") << "Loading water presets from " << dir << LL_ENDL;
LLDirIterator dir_iter(dir, "*.xml");
while (1)
@@ -103,7 +103,7 @@ void LLWaterParamManager::loadPresetsFromDir(const std::string& dir)
std::string path = gDirUtilp->add(dir, file);
if (!loadPreset(path))
{
- llwarns << "Error loading water preset from " << path << llendl;
+ LL_WARNS() << "Error loading water preset from " << path << LL_ENDL;
}
}
}
@@ -119,7 +119,7 @@ bool LLWaterParamManager::loadPreset(const std::string& path)
return false;
}
- LL_DEBUGS2("AppInit", "Shaders") << "Loading water " << name << LL_ENDL;
+ LL_DEBUGS("AppInit", "Shaders") << "Loading water " << name << LL_ENDL;
LLSD params_data;
LLPointer<LLSDParser> parser = new LLSDXMLParser();
@@ -201,7 +201,7 @@ void LLWaterParamManager::applyParams(const LLSD& params, bool interpolate)
{
if (params.size() == 0)
{
- llwarns << "Undefined water params" << llendl;
+ LL_WARNS() << "Undefined water params" << LL_ENDL;
return;
}
@@ -215,11 +215,11 @@ void LLWaterParamManager::applyParams(const LLSD& params, bool interpolate)
}
}
-static LLFastTimer::DeclareTimer FTM_UPDATE_WATERPARAM("Update Water Params");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_WATERPARAM("Update Water Params");
void LLWaterParamManager::update(LLViewerCamera * cam)
{
- LLFastTimer ftm(FTM_UPDATE_WATERPARAM);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_WATERPARAM);
// update the shaders and the menu
propagateParameters();
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index c196d70617..ca60b79f9d 100755
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -558,7 +558,7 @@ LLWearableItemTypeNameComparator::ETypeListOrder LLWearableItemTypeNameComparato
if(const_it == mWearableOrder.end())
{
- llwarns<<"Absent information about order rang of items of "<<LLAssetType::getDesc(item_type)<<" type"<<llendl;
+ LL_WARNS()<<"Absent information about order rang of items of "<<LLAssetType::getDesc(item_type)<<" type"<<LL_ENDL;
return ORDER_RANK_UNKNOWN;
}
@@ -572,7 +572,7 @@ bool LLWearableItemTypeNameComparator::sortAssetTypeByName(LLAssetType::EType it
if(const_it == mWearableOrder.end())
{
- llwarns<<"Absent information about sorting items of "<<LLAssetType::getDesc(item_type)<<" type"<<llendl;
+ LL_WARNS()<<"Absent information about sorting items of "<<LLAssetType::getDesc(item_type)<<" type"<<LL_ENDL;
return true;
}
@@ -588,7 +588,7 @@ bool LLWearableItemTypeNameComparator::sortWearableTypeByName(LLAssetType::EType
if(const_it == mWearableOrder.end())
{
- llwarns<<"Absent information about sorting items of "<<LLAssetType::getDesc(item_type)<<" type"<<llendl;
+ LL_WARNS()<<"Absent information about sorting items of "<<LLAssetType::getDesc(item_type)<<" type"<<LL_ENDL;
return true;
}
@@ -648,7 +648,7 @@ void LLWearableItemsList::addNewItem(LLViewerInventoryItem* item, bool rearrange
{
if (!item)
{
- llwarns << "No inventory item. Couldn't create flat list item." << llendl;
+ LL_WARNS() << "No inventory item. Couldn't create flat list item." << LL_ENDL;
llassert(item != NULL);
}
@@ -659,7 +659,7 @@ void LLWearableItemsList::addNewItem(LLViewerInventoryItem* item, bool rearrange
bool is_item_added = addItem(list_item, item->getUUID(), ADD_BOTTOM, rearrange);
if (!is_item_added)
{
- llwarns << "Couldn't add flat list item." << llendl;
+ LL_WARNS() << "Couldn't add flat list item." << LL_ENDL;
llassert(is_item_added);
}
}
@@ -825,7 +825,7 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
{
if (!menu)
{
- llwarns << "Invalid menu" << llendl;
+ LL_WARNS() << "Invalid menu" << LL_ENDL;
return;
}
@@ -846,7 +846,7 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
if (!item)
{
- llwarns << "Invalid item" << llendl;
+ LL_WARNS() << "Invalid item" << LL_ENDL;
// *NOTE: the logic below may not work in this case
continue;
}
@@ -919,7 +919,7 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
if (mask & MASK_UNKNOWN)
{
- llwarns << "Non-wearable items passed." << llendl;
+ LL_WARNS() << "Non-wearable items passed." << LL_ENDL;
}
U32 num_visible_items = 0;
@@ -1026,7 +1026,7 @@ bool LLWearableItemsList::ContextMenu::canAddWearables(const uuid_vec_t& item_id
}
else
{
- llwarns << "Unexpected wearable type" << llendl;
+ LL_WARNS() << "Unexpected wearable type" << LL_ENDL;
return false;
}
}
diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h
index a8a5ef3117..58a00c5be0 100755
--- a/indra/newview/llwearableitemslist.h
+++ b/indra/newview/llwearableitemslist.h
@@ -258,7 +258,7 @@ public:
if (!wearable_item1 || !wearable_item2)
{
- llwarning("item1 and item2 cannot be null", 0);
+ LL_WARNS() << "item1 and item2 cannot be null" << LL_ENDL;
return true;
}
diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp
index ef1a953f59..b61fbbd073 100755
--- a/indra/newview/llwearablelist.cpp
+++ b/indra/newview/llwearablelist.cpp
@@ -81,6 +81,7 @@ void LLWearableList::getAsset(const LLAssetID& assetID, const std::string& weara
LLViewerWearable* instance = get_if_there(mList, assetID, (LLViewerWearable*)NULL );
if( instance )
{
+ LL_DEBUGS("Avatar") << "wearable " << assetID << " found in LLWearableList" << LL_ENDL;
asset_arrived_callback( instance, userdata );
}
else
@@ -148,7 +149,6 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID
{
LLFile::remove(std::string(filename));
}
- LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED );
LL_WARNS("Wearable") << "Wearable download failed: " << LLAssetStorage::getErrorString( status ) << " " << uuid << LL_ENDL;
switch( status )
@@ -217,7 +217,7 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID
LLViewerWearable* LLWearableList::createCopy(const LLViewerWearable* old_wearable, const std::string& new_name)
{
- lldebugs << "LLWearableList::createCopy()" << llendl;
+ LL_DEBUGS() << "LLWearableList::createCopy()" << LL_ENDL;
LLViewerWearable *wearable = generateNewWearable();
wearable->copyDataFrom(old_wearable);
@@ -236,7 +236,7 @@ LLViewerWearable* LLWearableList::createCopy(const LLViewerWearable* old_wearabl
LLViewerWearable* LLWearableList::createNewWearable( LLWearableType::EType type, LLAvatarAppearance *avatarp )
{
- lldebugs << "LLWearableList::createNewWearable()" << llendl;
+ LL_DEBUGS() << "LLWearableList::createNewWearable()" << LL_ENDL;
LLViewerWearable *wearable = generateNewWearable();
wearable->setType( type, avatarp );
diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp
index 83337b386d..0312972a22 100755
--- a/indra/newview/llweb.cpp
+++ b/indra/newview/llweb.cpp
@@ -50,6 +50,8 @@
#include "llviewerwindow.h"
#include "llnotificationsutil.h"
+#include <boost/regex.hpp>
+
bool on_load_url_external_response(const LLSD& notification, const LLSD& response, bool async );
@@ -87,7 +89,8 @@ void LLWeb::loadURL(const std::string& url, const std::string& target, const std
// Force load in the internal browser, as if with a blank target.
loadURLInternal(url, "", uuid);
}
- else if (gSavedSettings.getBOOL("UseExternalBrowser") || (target == "_external"))
+
+ else if (useExternalBrowser(url) || (target == "_external"))
{
loadURLExternal(url);
}
@@ -121,7 +124,7 @@ void LLWeb::loadURLExternal(const std::string& url, bool async, const std::strin
if(gSavedSettings.getBOOL("DisableExternalBrowser"))
{
// Don't open an external browser under any circumstances.
- llwarns << "Blocked attempt to open external browser." << llendl;
+ LL_WARNS() << "Blocked attempt to open external browser." << LL_ENDL;
return;
}
@@ -225,3 +228,19 @@ std::string LLWeb::expandURLSubstitutions(const std::string &url,
return LLWeb::escapeURL(expanded_url);
}
+
+//static
+bool LLWeb::useExternalBrowser(const std::string &url)
+{
+ if (gSavedSettings.getU32("PreferredBrowserBehavior") == BROWSER_EXTERNAL_ONLY)
+ {
+ return true;
+ }
+ else if (gSavedSettings.getU32("PreferredBrowserBehavior") == BROWSER_INT_LL_EXT_OTHERS)
+ {
+ boost::regex pattern = boost::regex("\\b(lindenlab.com|secondlife.com)\\b", boost::regex::perl|boost::regex::icase);
+ boost::match_results<std::string::const_iterator> matches;
+ return !(boost::regex_search(url, matches, pattern));
+ }
+ return false;
+}
diff --git a/indra/newview/llweb.h b/indra/newview/llweb.h
index 0b95f664d6..7c90badbfe 100755
--- a/indra/newview/llweb.h
+++ b/indra/newview/llweb.h
@@ -40,6 +40,13 @@
class LLWeb
{
public:
+ enum PreferredBrowser
+ {
+ BROWSER_EXTERNAL_ONLY = 0,
+ BROWSER_INT_LL_EXT_OTHERS = 1,
+ BROWSER_INTERNAL_ONLY = 2
+ };
+
static void initClass();
/// Load the given url in the operating system's web browser, async if we want to return immediately
@@ -57,6 +64,7 @@ public:
/// Expands various strings like [LANG], [VERSION], etc. in a URL
static std::string expandURLSubstitutions(const std::string &url,
const LLSD &default_subs);
+ static bool useExternalBrowser(const std::string &url);
};
#endif
diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp
index 69255af179..ddb7f7bfce 100755
--- a/indra/newview/llwebprofile.cpp
+++ b/indra/newview/llwebprofile.cpp
@@ -67,9 +67,8 @@ public:
{
}
+ // *TODO: Check for 'application/json' content type, and parse json at the base class.
/*virtual*/ void completedRaw(
- U32 status,
- const std::string& reason,
const LLChannelDescriptors& channels,
const LLIOPipe::buffer_ptr_t& buffer)
{
@@ -78,9 +77,9 @@ public:
strstrm << istr.rdbuf();
const std::string body = strstrm.str();
- if (status != 200)
+ if (getStatus() != HTTP_OK)
{
- llwarns << "Failed to get upload config (" << status << ")" << llendl;
+ LL_WARNS() << "Failed to get upload config " << dumpResponse() << LL_ENDL;
LLWebProfile::reportImageUploadStatus(false);
return;
}
@@ -89,7 +88,7 @@ public:
Json::Reader reader;
if (!reader.parse(body, root))
{
- llwarns << "Failed to parse upload config: " << reader.getFormatedErrorMessages() << llendl;
+ LL_WARNS() << "Failed to parse upload config: " << reader.getFormatedErrorMessages() << LL_ENDL;
LLWebProfile::reportImageUploadStatus(false);
return;
}
@@ -112,7 +111,7 @@ public:
config["caption"] = data.get("caption", "").asString();
// Do the actual image upload using the configuration.
- LL_DEBUGS("Snapshots") << "Got upload config, POSTing image to " << upload_url << ", config=[" << config << "]" << llendl;
+ LL_DEBUGS("Snapshots") << "Got upload config, POSTing image to " << upload_url << ", config=[" << config << "]" << LL_ENDL;
LLWebProfile::post(mImagep, config, upload_url);
}
@@ -128,14 +127,12 @@ class LLWebProfileResponders::PostImageRedirectResponder : public LLHTTPClient::
public:
/*virtual*/ void completedRaw(
- U32 status,
- const std::string& reason,
const LLChannelDescriptors& channels,
const LLIOPipe::buffer_ptr_t& buffer)
{
- if (status != 200)
+ if (getStatus() != HTTP_OK)
{
- llwarns << "Failed to upload image: " << status << " " << reason << llendl;
+ LL_WARNS() << "Failed to upload image " << dumpResponse() << LL_ENDL;
LLWebProfile::reportImageUploadStatus(false);
return;
}
@@ -144,8 +141,8 @@ public:
std::stringstream strstrm;
strstrm << istr.rdbuf();
const std::string body = strstrm.str();
- llinfos << "Image uploaded." << llendl;
- LL_DEBUGS("Snapshots") << "Uploading image succeeded. Response: [" << body << "]" << llendl;
+ LL_INFOS() << "Image uploaded." << LL_ENDL;
+ LL_DEBUGS("Snapshots") << "Uploading image succeeded. Response: [" << body << "]" << LL_ENDL;
LLWebProfile::reportImageUploadStatus(true);
}
};
@@ -158,33 +155,36 @@ class LLWebProfileResponders::PostImageResponder : public LLHTTPClient::Responde
LOG_CLASS(LLWebProfileResponders::PostImageResponder);
public:
- /*virtual*/ void completedHeader(U32 status, const std::string& reason, const LLSD& content)
+ /*virtual*/ void completedRaw(const LLChannelDescriptors& channels,
+ const LLIOPipe::buffer_ptr_t& buffer)
{
// Viewer seems to fail to follow a 303 redirect on POST request
// (URLRequest Error: 65, Send failed since rewinding of the data stream failed).
// Handle it manually.
- if (status == 303)
+ if (getStatus() == HTTP_SEE_OTHER)
{
LLSD headers = LLViewerMedia::getHeaders();
- headers["Cookie"] = LLWebProfile::getAuthCookie();
- const std::string& redir_url = content["location"];
- LL_DEBUGS("Snapshots") << "Got redirection URL: " << redir_url << llendl;
- LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder(), headers);
+ headers[HTTP_OUT_HEADER_COOKIE] = LLWebProfile::getAuthCookie();
+ const std::string& redir_url = getResponseHeader(HTTP_IN_HEADER_LOCATION);
+ if (redir_url.empty())
+ {
+ LL_WARNS() << "Received empty redirection URL " << dumpResponse() << LL_ENDL;
+ LL_DEBUGS("Snapshots") << "[headers:" << getResponseHeaders() << "]" << LL_ENDL;
+ LLWebProfile::reportImageUploadStatus(false);
+ }
+ else
+ {
+ LL_DEBUGS("Snapshots") << "Got redirection URL: " << redir_url << LL_ENDL;
+ LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder, headers);
+ }
}
else
{
- llwarns << "Unexpected POST status: " << status << " " << reason << llendl;
- LL_DEBUGS("Snapshots") << "headers: [" << content << "]" << llendl;
+ LL_WARNS() << "Unexpected POST response " << dumpResponse() << LL_ENDL;
+ LL_DEBUGS("Snapshots") << "[headers:" << getResponseHeaders() << "]" << LL_ENDL;
LLWebProfile::reportImageUploadStatus(false);
}
}
-
- // Override just to suppress warnings.
- /*virtual*/ void completedRaw(U32 status, const std::string& reason,
- const LLChannelDescriptors& channels,
- const LLIOPipe::buffer_ptr_t& buffer)
- {
- }
};
///////////////////////////////////////////////////////////////////////////////
@@ -201,16 +201,16 @@ void LLWebProfile::uploadImage(LLPointer<LLImageFormatted> image, const std::str
config_url += "?caption=" + LLURI::escape(caption);
config_url += "&add_loc=" + std::string(add_location ? "1" : "0");
- LL_DEBUGS("Snapshots") << "Requesting " << config_url << llendl;
+ LL_DEBUGS("Snapshots") << "Requesting " << config_url << LL_ENDL;
LLSD headers = LLViewerMedia::getHeaders();
- headers["Cookie"] = getAuthCookie();
+ headers[HTTP_OUT_HEADER_COOKIE] = getAuthCookie();
LLHTTPClient::get(config_url, new LLWebProfileResponders::ConfigResponder(image), headers);
}
// static
void LLWebProfile::setAuthCookie(const std::string& cookie)
{
- LL_DEBUGS("Snapshots") << "Setting auth cookie: " << cookie << llendl;
+ LL_DEBUGS("Snapshots") << "Setting auth cookie: " << cookie << LL_ENDL;
sAuthCookie = cookie;
}
@@ -219,7 +219,7 @@ void LLWebProfile::post(LLPointer<LLImageFormatted> image, const LLSD& config, c
{
if (dynamic_cast<LLImagePNG*>(image.get()) == 0)
{
- llwarns << "Image to upload is not a PNG" << llendl;
+ LL_WARNS() << "Image to upload is not a PNG" << LL_ENDL;
llassert(dynamic_cast<LLImagePNG*>(image.get()) != 0);
return;
}
@@ -227,8 +227,8 @@ void LLWebProfile::post(LLPointer<LLImageFormatted> image, const LLSD& config, c
const std::string boundary = "----------------------------0123abcdefab";
LLSD headers = LLViewerMedia::getHeaders();
- headers["Cookie"] = getAuthCookie();
- headers["Content-Type"] = "multipart/form-data; boundary=" + boundary;
+ headers[HTTP_OUT_HEADER_COOKIE] = getAuthCookie();
+ headers[HTTP_OUT_HEADER_CONTENT_TYPE] = "multipart/form-data; boundary=" + boundary;
std::ostringstream body;
diff --git a/indra/newview/llwebsharing.cpp b/indra/newview/llwebsharing.cpp
deleted file mode 100755
index 3a80051b9b..0000000000
--- a/indra/newview/llwebsharing.cpp
+++ /dev/null
@@ -1,603 +0,0 @@
-/**
- * @file llwebsharing.cpp
- * @author Aimee
- * @brief Web Snapshot Sharing
- *
- * $LicenseInfo:firstyear=2010&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llwebsharing.h"
-
-#include "llagentui.h"
-#include "llbufferstream.h"
-#include "llhttpclient.h"
-#include "llhttpstatuscodes.h"
-#include "llsdserialize.h"
-#include "llsdutil.h"
-#include "llurl.h"
-#include "llviewercontrol.h"
-
-#include <boost/regex.hpp>
-#include <boost/algorithm/string/replace.hpp>
-
-
-
-///////////////////////////////////////////////////////////////////////////////
-//
-class LLWebSharingConfigResponder : public LLHTTPClient::Responder
-{
- LOG_CLASS(LLWebSharingConfigResponder);
-public:
- /// Overrides the default LLSD parsing behaviour, to allow parsing a JSON response.
- virtual void completedRaw(U32 status, const std::string& reason,
- const LLChannelDescriptors& channels,
- const LLIOPipe::buffer_ptr_t& buffer)
- {
- LLSD content;
- LLBufferStream istr(channels, buffer.get());
- LLPointer<LLSDParser> parser = new LLSDNotationParser();
-
- if (parser->parse(istr, content, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE)
- {
- LL_WARNS("WebSharing") << "Failed to deserialize LLSD from JSON response. " << " [" << status << "]: " << reason << LL_ENDL;
- }
- else
- {
- completed(status, reason, content);
- }
- }
-
- virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content)
- {
- LL_WARNS("WebSharing") << "Error [status:" << status << "]: " << content << LL_ENDL;
- }
-
- virtual void result(const LLSD& content)
- {
- LLWebSharing::instance().receiveConfig(content);
- }
-};
-
-
-
-///////////////////////////////////////////////////////////////////////////////
-//
-class LLWebSharingOpenIDAuthResponder : public LLHTTPClient::Responder
-{
- LOG_CLASS(LLWebSharingOpenIDAuthResponder);
-public:
- /* virtual */ void completedHeader(U32 status, const std::string& reason, const LLSD& content)
- {
- completed(status, reason, content);
- }
-
- /* virtual */ void completedRaw(U32 status, const std::string& reason,
- const LLChannelDescriptors& channels,
- const LLIOPipe::buffer_ptr_t& buffer)
- {
- /// Left empty to override the default LLSD parsing behaviour.
- }
-
- virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content)
- {
- if (HTTP_UNAUTHORIZED == status)
- {
- LL_WARNS("WebSharing") << "AU account not authenticated." << LL_ENDL;
- // *TODO: No account found on AU, so start the account creation process here.
- }
- else
- {
- LL_WARNS("WebSharing") << "Error [status:" << status << "]: " << content << LL_ENDL;
- LLWebSharing::instance().retryOpenIDAuth();
- }
-
- }
-
- virtual void result(const LLSD& content)
- {
- if (content.has("set-cookie"))
- {
- // OpenID request succeeded and returned a session cookie.
- LLWebSharing::instance().receiveSessionCookie(content["set-cookie"].asString());
- }
- }
-};
-
-
-
-///////////////////////////////////////////////////////////////////////////////
-//
-class LLWebSharingSecurityTokenResponder : public LLHTTPClient::Responder
-{
- LOG_CLASS(LLWebSharingSecurityTokenResponder);
-public:
- /// Overrides the default LLSD parsing behaviour, to allow parsing a JSON response.
- virtual void completedRaw(U32 status, const std::string& reason,
- const LLChannelDescriptors& channels,
- const LLIOPipe::buffer_ptr_t& buffer)
- {
- LLSD content;
- LLBufferStream istr(channels, buffer.get());
- LLPointer<LLSDParser> parser = new LLSDNotationParser();
-
- if (parser->parse(istr, content, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE)
- {
- LL_WARNS("WebSharing") << "Failed to deserialize LLSD from JSON response. " << " [" << status << "]: " << reason << LL_ENDL;
- LLWebSharing::instance().retryOpenIDAuth();
- }
- else
- {
- completed(status, reason, content);
- }
- }
-
- virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content)
- {
- LL_WARNS("WebSharing") << "Error [status:" << status << "]: " << content << LL_ENDL;
- LLWebSharing::instance().retryOpenIDAuth();
- }
-
- virtual void result(const LLSD& content)
- {
- if (content[0].has("st") && content[0].has("expires"))
- {
- const std::string& token = content[0]["st"].asString();
- const std::string& expires = content[0]["expires"].asString();
- if (LLWebSharing::instance().receiveSecurityToken(token, expires))
- {
- // Sucessfully received a valid security token.
- return;
- }
- }
- else
- {
- LL_WARNS("WebSharing") << "No security token received." << LL_ENDL;
- }
-
- LLWebSharing::instance().retryOpenIDAuth();
- }
-};
-
-
-
-///////////////////////////////////////////////////////////////////////////////
-//
-class LLWebSharingUploadResponder : public LLHTTPClient::Responder
-{
- LOG_CLASS(LLWebSharingUploadResponder);
-public:
- /// Overrides the default LLSD parsing behaviour, to allow parsing a JSON response.
- virtual void completedRaw(U32 status, const std::string& reason,
- const LLChannelDescriptors& channels,
- const LLIOPipe::buffer_ptr_t& buffer)
- {
-/*
- // Dump the body, for debugging.
-
- LLBufferStream istr1(channels, buffer.get());
- std::ostringstream ostr;
- std::string body;
-
- while (istr1.good())
- {
- char buf[1024];
- istr1.read(buf, sizeof(buf));
- body.append(buf, istr1.gcount());
- }
- LL_DEBUGS("WebSharing") << body << LL_ENDL;
-*/
- LLSD content;
- LLBufferStream istr(channels, buffer.get());
- LLPointer<LLSDParser> parser = new LLSDNotationParser();
-
- if (parser->parse(istr, content, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE)
- {
- LL_WARNS("WebSharing") << "Failed to deserialize LLSD from JSON response. " << " [" << status << "]: " << reason << LL_ENDL;
- }
- else
- {
- completed(status, reason, content);
- }
- }
-
- virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content)
- {
- LL_WARNS("WebSharing") << "Error [status:" << status << "]: " << content << LL_ENDL;
- }
-
- virtual void result(const LLSD& content)
- {
- if (content[0].has("result") && content[0].has("id") &&
- content[0]["id"].asString() == "newMediaItem")
- {
- // *TODO: Upload successful, continue from here to post metadata and create AU activity.
- }
- else
- {
- LL_WARNS("WebSharing") << "Error [" << content[0]["code"].asString()
- << "]: " << content[0]["message"].asString() << LL_ENDL;
- }
- }
-};
-
-
-
-///////////////////////////////////////////////////////////////////////////////
-//
-LLWebSharing::LLWebSharing()
-: mConfig(),
- mSecurityToken(LLSD::emptyMap()),
- mEnabled(false),
- mRetries(0),
- mImage(NULL),
- mMetadata(LLSD::emptyMap())
-{
-}
-
-void LLWebSharing::init()
-{
- if (!mEnabled)
- {
- sendConfigRequest();
- }
-}
-
-bool LLWebSharing::shareSnapshot(LLImageJPEG* snapshot, LLSD& metadata)
-{
- LL_INFOS("WebSharing") << metadata << LL_ENDL;
-
- if (mImage)
- {
- // *TODO: Handle this possibility properly, queue them up?
- LL_WARNS("WebSharing") << "Snapshot upload already in progress." << LL_ENDL;
- return false;
- }
-
- mImage = snapshot;
- mMetadata = metadata;
-
- // *TODO: Check whether we have a valid security token already and re-use it.
- sendOpenIDAuthRequest();
- return true;
-}
-
-bool LLWebSharing::setOpenIDCookie(const std::string& cookie)
-{
- LL_DEBUGS("WebSharing") << "Setting OpenID cookie " << cookie << LL_ENDL;
- mOpenIDCookie = cookie;
- return validateConfig();
-}
-
-bool LLWebSharing::receiveConfig(const LLSD& config)
-{
- LL_DEBUGS("WebSharing") << "Received config data: " << config << LL_ENDL;
- mConfig = config;
- return validateConfig();
-}
-
-bool LLWebSharing::receiveSessionCookie(const std::string& cookie)
-{
- LL_DEBUGS("WebSharing") << "Received AU session cookie: " << cookie << LL_ENDL;
- mSessionCookie = cookie;
-
- // Fetch a security token using the new session cookie.
- LLWebSharing::instance().sendSecurityTokenRequest();
-
- return (!mSessionCookie.empty());
-}
-
-bool LLWebSharing::receiveSecurityToken(const std::string& token, const std::string& expires)
-{
- mSecurityToken["st"] = token;
- mSecurityToken["expires"] = LLDate(expires);
-
- if (!securityTokenIsValid(mSecurityToken))
- {
- LL_WARNS("WebSharing") << "Invalid security token received: \"" << token << "\" Expires: " << expires << LL_ENDL;
- return false;
- }
-
- LL_DEBUGS("WebSharing") << "Received security token: \"" << token << "\" Expires: " << expires << LL_ENDL;
- mRetries = 0;
-
- // Continue the upload process now that we have a security token.
- sendUploadRequest();
-
- return true;
-}
-
-void LLWebSharing::sendConfigRequest()
-{
- std::string config_url = gSavedSettings.getString("SnapshotConfigURL");
- LL_DEBUGS("WebSharing") << "Requesting Snapshot Sharing config data from: " << config_url << LL_ENDL;
-
- LLSD headers = LLSD::emptyMap();
- headers["Accept"] = "application/json";
-
- LLHTTPClient::get(config_url, new LLWebSharingConfigResponder(), headers);
-}
-
-void LLWebSharing::sendOpenIDAuthRequest()
-{
- std::string auth_url = mConfig["openIdAuthUrl"];
- LL_DEBUGS("WebSharing") << "Starting OpenID Auth: " << auth_url << LL_ENDL;
-
- LLSD headers = LLSD::emptyMap();
- headers["Cookie"] = mOpenIDCookie;
- headers["Accept"] = "*/*";
-
- // Send request, successful login will trigger fetching a security token.
- LLHTTPClient::get(auth_url, new LLWebSharingOpenIDAuthResponder(), headers);
-}
-
-bool LLWebSharing::retryOpenIDAuth()
-{
- if (mRetries++ >= MAX_AUTH_RETRIES)
- {
- LL_WARNS("WebSharing") << "Exceeded maximum number of authorization attempts, aborting." << LL_ENDL;
- mRetries = 0;
- return false;
- }
-
- LL_WARNS("WebSharing") << "Authorization failed, retrying (" << mRetries << "/" << MAX_AUTH_RETRIES << ")" << LL_ENDL;
- sendOpenIDAuthRequest();
- return true;
-}
-
-void LLWebSharing::sendSecurityTokenRequest()
-{
- std::string token_url = mConfig["securityTokenUrl"];
- LL_DEBUGS("WebSharing") << "Fetching security token from: " << token_url << LL_ENDL;
-
- LLSD headers = LLSD::emptyMap();
- headers["Cookie"] = mSessionCookie;
-
- headers["Accept"] = "application/json";
- headers["Content-Type"] = "application/json";
-
- std::ostringstream body;
- body << "{ \"gadgets\": [{ \"url\":\""
- << mConfig["gadgetSpecUrl"].asString()
- << "\" }] }";
-
- // postRaw() takes ownership of the buffer and releases it later.
- size_t size = body.str().size();
- U8 *data = new U8[size];
- memcpy(data, body.str().data(), size);
-
- // Send request, receiving a valid token will trigger snapshot upload.
- LLHTTPClient::postRaw(token_url, data, size, new LLWebSharingSecurityTokenResponder(), headers);
-}
-
-void LLWebSharing::sendUploadRequest()
-{
- LLUriTemplate upload_template(mConfig["openSocialRpcUrlTemplate"].asString());
- std::string upload_url(upload_template.buildURI(mSecurityToken));
-
- LL_DEBUGS("WebSharing") << "Posting upload to: " << upload_url << LL_ENDL;
-
- static const std::string BOUNDARY("------------abcdef012345xyZ");
-
- LLSD headers = LLSD::emptyMap();
- headers["Cookie"] = mSessionCookie;
-
- headers["Accept"] = "application/json";
- headers["Content-Type"] = "multipart/form-data; boundary=" + BOUNDARY;
-
- std::ostringstream body;
- body << "--" << BOUNDARY << "\r\n"
- << "Content-Disposition: form-data; name=\"request\"\r\n\r\n"
- << "[{"
- << "\"method\":\"mediaItems.create\","
- << "\"params\": {"
- << "\"userId\":[\"@me\"],"
- << "\"groupId\":\"@self\","
- << "\"mediaItem\": {"
- << "\"mimeType\":\"image/jpeg\","
- << "\"type\":\"image\","
- << "\"url\":\"@field:image1\""
- << "}"
- << "},"
- << "\"id\":\"newMediaItem\""
- << "}]"
- << "--" << BOUNDARY << "\r\n"
- << "Content-Disposition: form-data; name=\"image1\"\r\n\r\n";
-
- // Insert the image data.
- // *FIX: Treating this as a string will probably screw it up ...
- U8* image_data = mImage->getData();
- for (S32 i = 0; i < mImage->getDataSize(); ++i)
- {
- body << image_data[i];
- }
-
- body << "\r\n--" << BOUNDARY << "--\r\n";
-
- // postRaw() takes ownership of the buffer and releases it later.
- size_t size = body.str().size();
- U8 *data = new U8[size];
- memcpy(data, body.str().data(), size);
-
- // Send request, successful upload will trigger posting metadata.
- LLHTTPClient::postRaw(upload_url, data, size, new LLWebSharingUploadResponder(), headers);
-}
-
-bool LLWebSharing::validateConfig()
-{
- // Check the OpenID Cookie has been set.
- if (mOpenIDCookie.empty())
- {
- mEnabled = false;
- return mEnabled;
- }
-
- if (!mConfig.isMap())
- {
- mEnabled = false;
- return mEnabled;
- }
-
- // Template to match the received config against.
- LLSD required(LLSD::emptyMap());
- required["gadgetSpecUrl"] = "";
- required["loginTokenUrl"] = "";
- required["openIdAuthUrl"] = "";
- required["photoPageUrlTemplate"] = "";
- required["openSocialRpcUrlTemplate"] = "";
- required["securityTokenUrl"] = "";
- required["tokenBasedLoginUrlTemplate"] = "";
- required["viewerIdUrl"] = "";
-
- std::string mismatch(llsd_matches(required, mConfig));
- if (!mismatch.empty())
- {
- LL_WARNS("WebSharing") << "Malformed config data response: " << mismatch << LL_ENDL;
- mEnabled = false;
- return mEnabled;
- }
-
- mEnabled = true;
- return mEnabled;
-}
-
-// static
-bool LLWebSharing::securityTokenIsValid(LLSD& token)
-{
- return (token.has("st") &&
- token.has("expires") &&
- (token["st"].asString() != "") &&
- (token["expires"].asDate() > LLDate::now()));
-}
-
-
-
-///////////////////////////////////////////////////////////////////////////////
-//
-LLUriTemplate::LLUriTemplate(const std::string& uri_template)
- :
- mTemplate(uri_template)
-{
-}
-
-std::string LLUriTemplate::buildURI(const LLSD& vars)
-{
- // *TODO: Separate parsing the template from building the URI.
- // Parsing only needs to happen on construction/assignnment.
-
- static const std::string VAR_NAME_REGEX("[[:alpha:]][[:alnum:]\\._-]*");
- // Capture var name with and without surrounding {}
- static const std::string VAR_REGEX("\\{(" + VAR_NAME_REGEX + ")\\}");
- // Capture delimiter and comma separated list of var names.
- static const std::string JOIN_REGEX("\\{-join\\|(&)\\|(" + VAR_NAME_REGEX + "(?:," + VAR_NAME_REGEX + ")*)\\}");
-
- std::string uri = mTemplate;
- boost::smatch results;
-
- // Validate and expand join operators : {-join|&|var1,var2,...}
-
- boost::regex join_regex(JOIN_REGEX);
-
- while (boost::regex_search(uri, results, join_regex))
- {
- // Extract the list of var names from the results.
- std::string delim = results[1].str();
- std::string var_list = results[2].str();
-
- // Expand the list of vars into a query string with their values
- std::string query = expandJoin(delim, var_list, vars);
-
- // Substitute the query string into the template.
- uri = boost::regex_replace(uri, join_regex, query, boost::format_first_only);
- }
-
- // Expand vars : {var1}
-
- boost::regex var_regex(VAR_REGEX);
-
- std::set<std::string> var_names;
- std::string::const_iterator start = uri.begin();
- std::string::const_iterator end = uri.end();
-
- // Extract the var names used.
- while (boost::regex_search(start, end, results, var_regex))
- {
- var_names.insert(results[1].str());
- start = results[0].second;
- }
-
- // Replace each var with its value.
- for (std::set<std::string>::const_iterator it = var_names.begin(); it != var_names.end(); ++it)
- {
- std::string var = *it;
- if (vars.has(var))
- {
- boost::replace_all(uri, "{" + var + "}", vars[var].asString());
- }
- }
-
- return uri;
-}
-
-std::string LLUriTemplate::expandJoin(const std::string& delim, const std::string& var_list, const LLSD& vars)
-{
- std::ostringstream query;
-
- typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
- boost::char_separator<char> sep(",");
- tokenizer var_names(var_list, sep);
- tokenizer::const_iterator it = var_names.begin();
-
- // First var does not need a delimiter
- if (it != var_names.end())
- {
- const std::string& name = *it;
- if (vars.has(name))
- {
- // URL encode the value before appending the name=value pair.
- query << name << "=" << escapeURL(vars[name].asString());
- }
- }
-
- for (++it; it != var_names.end(); ++it)
- {
- const std::string& name = *it;
- if (vars.has(name))
- {
- // URL encode the value before appending the name=value pair.
- query << delim << name << "=" << escapeURL(vars[name].asString());
- }
- }
-
- return query.str();
-}
-
-// static
-std::string LLUriTemplate::escapeURL(const std::string& unescaped)
-{
- char* escaped = curl_escape(unescaped.c_str(), unescaped.size());
- std::string result = escaped;
- curl_free(escaped);
- return result;
-}
-
diff --git a/indra/newview/llwebsharing.h b/indra/newview/llwebsharing.h
deleted file mode 100755
index ad9c99c224..0000000000
--- a/indra/newview/llwebsharing.h
+++ /dev/null
@@ -1,224 +0,0 @@
-/**
- * @file llwebsharing.h
- * @author Aimee
- * @brief Web Snapshot Sharing
- *
- * $LicenseInfo:firstyear=2010&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLWEBSHARING_H
-#define LL_LLWEBSHARING_H
-
-#include "llimagejpeg.h"
-#include "llsingleton.h"
-
-
-
-/**
- * @class LLWebSharing
- *
- * Manages authentication to, and interaction with, a web service allowing the
- * upload of snapshot images taken within the viewer, using OpenID and the
- * OpenSocial APIs.
- * http://www.opensocial.org/Technical-Resources/opensocial-spec-v09/RPC-Protocol.html
- */
-class LLWebSharing : public LLSingleton<LLWebSharing>
-{
- LOG_CLASS(LLWebSharing);
-public:
- /*
- * Performs initial setup, by requesting config data from the web service if
- * it has not already been received.
- */
- void init();
-
- /*
- * @return true if both the OpenID cookie and config data have been received.
- */
- bool enabled() const { return mEnabled; };
-
- /*
- * Sets the OpenID cookie to use for login to the web service.
- *
- * @param cookie a string containing the OpenID cookie.
- *
- * @return true if both the OpenID cookie and config data have been received.
- */
- bool setOpenIDCookie(const std::string& cookie);
-
- /*
- * Receive config data used to connect to the web service.
- *
- * @param config an LLSD map of URL templates for the web service end-points.
- *
- * @return true if both the OpenID cookie and config data have been received.
- *
- * @see sendConfigRequest()
- */
- bool receiveConfig(const LLSD& config);
-
- /*
- * Receive the session cookie from the web service, which is the result of
- * the OpenID login process.
- *
- * @see sendOpenIDAuthRequest()
- */
- bool receiveSessionCookie(const std::string& cookie);
-
- /*
- * Receive a security token for the upload service.
- *
- * @see sendSecurityTokenRequest()
- */
- bool receiveSecurityToken(const std::string& token, const std::string& expires);
-
- /*
- * Restarts the authentication process if the maximum number of retries has
- * not been exceeded.
- *
- * @return true if retrying, false if LLWebSharing::MAX_AUTH_RETRIES has been exceeded.
- */
- bool retryOpenIDAuth();
-
- /*
- * Post a snapshot to the upload service.
- *
- * @return true if accepted for upload, false if already uploading another image.
- */
- bool shareSnapshot(LLImageJPEG* snapshot, LLSD& metadata);
-
-private:
- static const S32 MAX_AUTH_RETRIES = 4;
-
- friend class LLSingleton<LLWebSharing>;
-
- LLWebSharing();
- ~LLWebSharing() {};
-
- /*
- * Request a map of URLs and URL templates to the web service end-points.
- *
- * @see receiveConfig()
- */
- void sendConfigRequest();
-
- /*
- * Initiate the OpenID login process.
- *
- * @see receiveSessionCookie()
- */
- void sendOpenIDAuthRequest();
-
- /*
- * Request a security token for the upload service.
- *
- * @see receiveSecurityToken()
- */
- void sendSecurityTokenRequest();
-
- /*
- * Request a security token for the upload service.
- *
- * @see receiveSecurityToken()
- */
- void sendUploadRequest();
-
- /*
- * Checks all necessary config information has been received, and sets mEnabled.
- *
- * @return true if both the OpenID cookie and config data have been received.
- */
- bool validateConfig();
-
- /*
- * Checks the security token is present and has not expired.
- *
- * @param token an LLSD map containing the token string and the time it expires.
- *
- * @return true if the token is not empty and has not expired.
- */
- static bool securityTokenIsValid(LLSD& token);
-
- std::string mOpenIDCookie;
- std::string mSessionCookie;
- LLSD mSecurityToken;
-
- LLSD mConfig;
- bool mEnabled;
-
- LLPointer<LLImageJPEG> mImage;
- LLSD mMetadata;
-
- S32 mRetries;
-};
-
-/**
- * @class LLUriTemplate
- *
- * @brief Builds complete URIs, given URI template and a map of keys and values
- * to use for substition.
- * Note: This is only a partial implementation of a draft standard required
- * by the web API used by LLWebSharing.
- * See: http://tools.ietf.org/html/draft-gregorio-uritemplate-03
- *
- * @see LLWebSharing
- */
-class LLUriTemplate
-{
- LOG_CLASS(LLUriTemplate);
-public:
- LLUriTemplate(const std::string& uri_template);
- ~LLUriTemplate() {};
-
- /*
- * Builds a complete URI from the template.
- *
- * @param vars an LLSD map of keys and values for substitution.
- *
- * @return a string containing the complete URI.
- */
- std::string buildURI(const LLSD& vars);
-
-private:
- /*
- * Builds a URL query string.
- *
- * @param delim a string containing the separator to use between name=value pairs.
- * @param var_list a string containing a comma separated list of variable names.
- * @param vars an LLSD map of keys and values for substitution.
- *
- * @return a URL query string.
- */
- std::string expandJoin(const std::string& delim, const std::string& var_list, const LLSD& vars);
-
- /*
- * URL escape the given string.
- * LLWeb::escapeURL() only does a partial escape, so this uses curl_escape() instead.
- */
- static std::string escapeURL(const std::string& unescaped);
-
- std::string mTemplate;
-};
-
-
-
-#endif // LL_LLWEBSHARING_H
diff --git a/indra/newview/llwind.h b/indra/newview/llwind.h
index 3b57f07124..e73d1baa58 100755
--- a/indra/newview/llwind.h
+++ b/indra/newview/llwind.h
@@ -35,6 +35,8 @@ class LLVector3;
class LLBitPack;
class LLGroupHeader;
+const F32 WIND_SCALE_HACK = 2.0f; // hack to make wind speeds more realistic
+
class LLWind
{
diff --git a/indra/newview/llwindebug.cpp b/indra/newview/llwindebug.cpp
index 551d0be8d7..eff70ca0b2 100755
--- a/indra/newview/llwindebug.cpp
+++ b/indra/newview/llwindebug.cpp
@@ -45,7 +45,7 @@ public:
~LLMemoryReserve();
void reserve();
void release();
-protected:
+private:
unsigned char *mReserve;
static const size_t MEMORY_RESERVATION_SIZE;
};
@@ -53,7 +53,7 @@ protected:
LLMemoryReserve::LLMemoryReserve() :
mReserve(NULL)
{
-};
+}
LLMemoryReserve::~LLMemoryReserve()
{
@@ -66,14 +66,19 @@ const size_t LLMemoryReserve::MEMORY_RESERVATION_SIZE = 5 * 1024 * 1024;
void LLMemoryReserve::reserve()
{
if(NULL == mReserve)
+ {
mReserve = new unsigned char[MEMORY_RESERVATION_SIZE];
-};
+ }
+}
void LLMemoryReserve::release()
{
- delete [] mReserve;
+ if (NULL != mReserve)
+ {
+ delete [] mReserve;
+ }
mReserve = NULL;
-};
+}
static LLMemoryReserve gEmergencyMemoryReserve;
@@ -130,6 +135,11 @@ void LLWinDebug::init()
}
}
+void LLWinDebug::cleanup ()
+{
+ gEmergencyMemoryReserve.release();
+}
+
void LLWinDebug::writeDumpToFile(MINIDUMP_TYPE type, MINIDUMP_EXCEPTION_INFORMATION *ExInfop, const std::string& filename)
{
// Temporary fix to switch out the code that writes the DMP file.
diff --git a/indra/newview/llwindebug.h b/indra/newview/llwindebug.h
index 3837825d31..a3cbf6dc03 100755
--- a/indra/newview/llwindebug.h
+++ b/indra/newview/llwindebug.h
@@ -28,6 +28,7 @@
#define LL_LLWINDEBUG_H
#include "stdtypes.h"
+#include "llwin32headerslean.h"
#include <dbghelp.h>
class LLWinDebug:
@@ -36,6 +37,7 @@ class LLWinDebug:
public:
static void init();
static void generateMinidump(struct _EXCEPTION_POINTERS *pExceptionInfo = NULL);
+ static void cleanup();
private:
static void writeDumpToFile(MINIDUMP_TYPE type, MINIDUMP_EXCEPTION_INFORMATION *ExInfop, const std::string& filename);
};
diff --git a/indra/newview/llwldaycycle.cpp b/indra/newview/llwldaycycle.cpp
index 4c0cb7c0f4..e9b0baf612 100755
--- a/indra/newview/llwldaycycle.cpp
+++ b/indra/newview/llwldaycycle.cpp
@@ -46,7 +46,7 @@ LLWLDayCycle::~LLWLDayCycle()
void LLWLDayCycle::loadDayCycle(const LLSD& day_data, LLWLParamKey::EScope scope)
{
- lldebugs << "Loading day cycle (day_data.size() = " << day_data.size() << ", scope = " << scope << ")" << llendl;
+ LL_DEBUGS() << "Loading day cycle (day_data.size() = " << day_data.size() << ", scope = " << scope << ")" << LL_ENDL;
mTimeMap.clear();
// add each key frame
@@ -128,7 +128,7 @@ LLSD LLWLDayCycle::loadDayCycleFromPath(const std::string& file_path)
void LLWLDayCycle::saveDayCycle(const std::string & fileName)
{
std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/days", fileName));
- //llinfos << "Saving WindLight settings to " << pathName << llendl;
+ //LL_INFOS() << "Saving WindLight settings to " << pathName << LL_ENDL;
save(pathName);
}
@@ -154,7 +154,7 @@ LLSD LLWLDayCycle::asLLSD()
day_data.append(key);
}
- lldebugs << "Dumping day cycle (" << mTimeMap.size() << ") to LLSD: " << day_data << llendl;
+ LL_DEBUGS() << "Dumping day cycle (" << mTimeMap.size() << ") to LLSD: " << day_data << LL_ENDL;
return day_data;
}
@@ -169,7 +169,7 @@ bool LLWLDayCycle::getSkyRefs(std::map<LLWLParamKey, LLWLParamSet>& refs) const
const LLWLParamKey& key = iter->second;
if (!wl_mgr.getParamSet(key, refs[key]))
{
- llwarns << "Cannot find sky [" << key.name << "] referenced by a day cycle" << llendl;
+ LL_WARNS() << "Cannot find sky [" << key.name << "] referenced by a day cycle" << LL_ENDL;
result = false;
}
}
@@ -192,7 +192,7 @@ bool LLWLDayCycle::getSkyMap(LLSD& sky_map) const
void LLWLDayCycle::clearKeyframes()
{
- lldebugs << "Clearing key frames" << llendl;
+ LL_DEBUGS() << "Clearing key frames" << LL_ENDL;
mTimeMap.clear();
}
@@ -209,18 +209,18 @@ bool LLWLDayCycle::addKeyframe(F32 newTime, LLWLParamKey frame)
if(mTimeMap.find(newTime) == mTimeMap.end())
{
mTimeMap.insert(std::pair<F32, LLWLParamKey>(newTime, frame));
- lldebugs << "Adding key frame (" << newTime << ", " << frame.toLLSD() << ")" << llendl;
+ LL_DEBUGS() << "Adding key frame (" << newTime << ", " << frame.toLLSD() << ")" << LL_ENDL;
return true;
}
// otherwise, don't add, and return error
- llwarns << "Error adding key frame (" << newTime << ", " << frame.toLLSD() << ")" << llendl;
+ LL_WARNS() << "Error adding key frame (" << newTime << ", " << frame.toLLSD() << ")" << LL_ENDL;
return false;
}
bool LLWLDayCycle::changeKeyframeTime(F32 oldTime, F32 newTime)
{
- lldebugs << "Changing key frame time (" << oldTime << " => " << newTime << ")" << llendl;
+ LL_DEBUGS() << "Changing key frame time (" << oldTime << " => " << newTime << ")" << LL_ENDL;
// just remove and add back
LLWLParamKey frame = mTimeMap[oldTime];
@@ -228,7 +228,7 @@ bool LLWLDayCycle::changeKeyframeTime(F32 oldTime, F32 newTime)
bool stat = removeKeyframe(oldTime);
if(stat == false)
{
- lldebugs << "Failed to change key frame time (" << oldTime << " => " << newTime << ")" << llendl;
+ LL_DEBUGS() << "Failed to change key frame time (" << oldTime << " => " << newTime << ")" << LL_ENDL;
return stat;
}
@@ -237,7 +237,7 @@ bool LLWLDayCycle::changeKeyframeTime(F32 oldTime, F32 newTime)
bool LLWLDayCycle::changeKeyframeParam(F32 time, LLWLParamKey key)
{
- lldebugs << "Changing key frame param (" << time << ", " << key.toLLSD() << ")" << llendl;
+ LL_DEBUGS() << "Changing key frame param (" << time << ", " << key.toLLSD() << ")" << LL_ENDL;
// just remove and add back
// make sure param exists
@@ -245,7 +245,7 @@ bool LLWLDayCycle::changeKeyframeParam(F32 time, LLWLParamKey key)
bool stat = LLWLParamManager::getInstance()->getParamSet(key, tmp);
if(stat == false)
{
- lldebugs << "Failed to change key frame param (" << time << ", " << key.toLLSD() << ")" << llendl;
+ LL_DEBUGS() << "Failed to change key frame param (" << time << ", " << key.toLLSD() << ")" << LL_ENDL;
return stat;
}
@@ -256,7 +256,7 @@ bool LLWLDayCycle::changeKeyframeParam(F32 time, LLWLParamKey key)
bool LLWLDayCycle::removeKeyframe(F32 time)
{
- lldebugs << "Removing key frame (" << time << ")" << llendl;
+ LL_DEBUGS() << "Removing key frame (" << time << ")" << LL_ENDL;
// look for the time. If there, erase it
std::map<F32, LLWLParamKey>::iterator mIt = mTimeMap.find(time);
@@ -295,7 +295,7 @@ bool LLWLDayCycle::getKeyedParam(F32 time, LLWLParamSet& param)
}
// return error if not found
- lldebugs << "Key " << time << " not found" << llendl;
+ LL_DEBUGS() << "Key " << time << " not found" << LL_ENDL;
return false;
}
@@ -310,7 +310,7 @@ bool LLWLDayCycle::getKeyedParamName(F32 time, std::string & name)
}
// return error if not found
- lldebugs << "Key " << time << " not found" << llendl;
+ LL_DEBUGS() << "Key " << time << " not found" << LL_ENDL;
return false;
}
@@ -322,7 +322,7 @@ bool LLWLDayCycle::hasReferencesTo(const LLWLParamKey& keyframe) const
void LLWLDayCycle::removeReferencesTo(const LLWLParamKey& keyframe)
{
- lldebugs << "Removing references to key frame " << keyframe.toLLSD() << llendl;
+ LL_DEBUGS() << "Removing references to key frame " << keyframe.toLLSD() << LL_ENDL;
F32 keytime;
bool might_exist;
do
diff --git a/indra/newview/llwlhandlers.cpp b/indra/newview/llwlhandlers.cpp
index 93eba5b604..3bedfbe502 100755
--- a/indra/newview/llwlhandlers.cpp
+++ b/indra/newview/llwlhandlers.cpp
@@ -95,8 +95,9 @@ LLEnvironmentRequestResponder::LLEnvironmentRequestResponder()
{
mID = ++sCount;
}
-/*virtual*/ void LLEnvironmentRequestResponder::result(const LLSD& unvalidated_content)
+/*virtual*/ void LLEnvironmentRequestResponder::httpSuccess()
{
+ const LLSD& unvalidated_content = getContent();
LL_INFOS("WindlightCaps") << "Received region windlight settings" << LL_ENDL;
if (mID != sCount)
@@ -122,10 +123,10 @@ LLEnvironmentRequestResponder::LLEnvironmentRequestResponder()
LLEnvManagerNew::getInstance()->onRegionSettingsResponse(unvalidated_content);
}
/*virtual*/
-void LLEnvironmentRequestResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+void LLEnvironmentRequestResponder::httpFailure()
{
- LL_INFOS("WindlightCaps") << "Got an error, not using region windlight... [status:"
- << status << "]: " << content << LL_ENDL;
+ LL_WARNS("WindlightCaps") << "Got an error, not using region windlight... "
+ << dumpResponse() << LL_ENDL;
LLEnvManagerNew::getInstance()->onRegionSettingsResponse(LLSD());
}
@@ -169,8 +170,14 @@ bool LLEnvironmentApply::initiateRequest(const LLSD& content)
/****
* LLEnvironmentApplyResponder
****/
-/*virtual*/ void LLEnvironmentApplyResponder::result(const LLSD& content)
+/*virtual*/ void LLEnvironmentApplyResponder::httpSuccess()
{
+ const LLSD& content = getContent();
+ if (!content.isMap() || !content.has("regionID"))
+ {
+ failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content);
+ return;
+ }
if (content["regionID"].asUUID() != gAgent.getRegion()->getRegionID())
{
LL_WARNS("WindlightCaps") << "No longer in the region where data was sent (currently "
@@ -185,7 +192,7 @@ bool LLEnvironmentApply::initiateRequest(const LLSD& content)
}
else
{
- LL_WARNS("WindlightCaps") << "Region couldn't apply windlight settings! Reason from sim: " << content["fail_reason"].asString() << LL_ENDL;
+ LL_WARNS("WindlightCaps") << "Region couldn't apply windlight settings! " << dumpResponse() << LL_ENDL;
LLSD args(LLSD::emptyMap());
args["FAIL_REASON"] = content["fail_reason"].asString();
LLNotificationsUtil::add("WLRegionApplyFail", args);
@@ -193,14 +200,14 @@ bool LLEnvironmentApply::initiateRequest(const LLSD& content)
}
}
/*virtual*/
-void LLEnvironmentApplyResponder::errorWithContent(U32 status, const std::string& reason, const LLSD& content)
+void LLEnvironmentApplyResponder::httpFailure()
{
- LL_WARNS("WindlightCaps") << "Couldn't apply windlight settings to region! [status:"
- << status << "]: " << content << LL_ENDL;
+ LL_WARNS("WindlightCaps") << "Couldn't apply windlight settings to region! "
+ << dumpResponse() << LL_ENDL;
LLSD args(LLSD::emptyMap());
std::stringstream msg;
- msg << reason << " (Code " << status << ")";
+ msg << getReason() << " (Code " << getStatus() << ")";
args["FAIL_REASON"] = msg.str();
LLNotificationsUtil::add("WLRegionApplyFail", args);
}
diff --git a/indra/newview/llwlhandlers.h b/indra/newview/llwlhandlers.h
index 598ce6d52a..089c799da7 100755
--- a/indra/newview/llwlhandlers.h
+++ b/indra/newview/llwlhandlers.h
@@ -45,9 +45,9 @@ private:
class LLEnvironmentRequestResponder: public LLHTTPClient::Responder
{
LOG_CLASS(LLEnvironmentRequestResponder);
-public:
- virtual void result(const LLSD& content);
- virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content);
+private:
+ /* virtual */ void httpSuccess();
+ /* virtual */ void httpFailure();
private:
friend class LLEnvironmentRequest;
@@ -72,7 +72,7 @@ private:
class LLEnvironmentApplyResponder: public LLHTTPClient::Responder
{
LOG_CLASS(LLEnvironmentApplyResponder);
-public:
+private:
/*
* Expecting reply from sim in form of:
* {
@@ -87,10 +87,10 @@ public:
* fail_reason : string
* }
*/
- virtual void result(const LLSD& content);
+ /* virtual */ void httpSuccess();
- // non-200 errors only
- virtual void errorWithContent(U32 status, const std::string& reason, const LLSD& content);
+ // non-2xx errors only
+ /* virtual */ void httpFailure();
private:
friend class LLEnvironmentApply;
diff --git a/indra/newview/llwlparammanager.cpp b/indra/newview/llwlparammanager.cpp
index ce9f61c0af..91ea10d43d 100755
--- a/indra/newview/llwlparammanager.cpp
+++ b/indra/newview/llwlparammanager.cpp
@@ -128,12 +128,12 @@ void LLWLParamManager::clearParamSetsOfScope(LLWLParamKey::EScope scope)
// side effect: applies changes to all internal structures!
std::map<LLWLParamKey, LLWLParamSet> LLWLParamManager::finalizeFromDayCycle(LLWLParamKey::EScope scope)
{
- lldebugs << "mDay before finalizing:" << llendl;
+ LL_DEBUGS() << "mDay before finalizing:" << LL_ENDL;
{
for (std::map<F32, LLWLParamKey>::iterator iter = mDay.mTimeMap.begin(); iter != mDay.mTimeMap.end(); ++iter)
{
LLWLParamKey& key = iter->second;
- lldebugs << iter->first << "->" << key.name << llendl;
+ LL_DEBUGS() << iter->first << "->" << key.name << LL_ENDL;
}
}
@@ -219,12 +219,12 @@ std::map<LLWLParamKey, LLWLParamSet> LLWLParamManager::finalizeFromDayCycle(LLWL
final_references[new_key] = iter->second;
}
- lldebugs << "mDay after finalizing:" << llendl;
+ LL_DEBUGS() << "mDay after finalizing:" << LL_ENDL;
{
for (std::map<F32, LLWLParamKey>::iterator iter = mDay.mTimeMap.begin(); iter != mDay.mTimeMap.end(); ++iter)
{
LLWLParamKey& key = iter->second;
- lldebugs << iter->first << "->" << key.name << llendl;
+ LL_DEBUGS() << iter->first << "->" << key.name << LL_ENDL;
}
}
@@ -272,7 +272,7 @@ void LLWLParamManager::loadAllPresets()
void LLWLParamManager::loadPresetsFromDir(const std::string& dir)
{
- LL_INFOS2("AppInit", "Shaders") << "Loading sky presets from " << dir << LL_ENDL;
+ LL_INFOS("AppInit", "Shaders") << "Loading sky presets from " << dir << LL_ENDL;
LLDirIterator dir_iter(dir, "*.xml");
while (1)
@@ -286,7 +286,7 @@ void LLWLParamManager::loadPresetsFromDir(const std::string& dir)
std::string path = gDirUtilp->add(dir, file);
if (!loadPreset(path))
{
- llwarns << "Error loading sky preset from " << path << llendl;
+ LL_WARNS() << "Error loading sky preset from " << path << LL_ENDL;
}
}
}
@@ -302,7 +302,7 @@ bool LLWLParamManager::loadPreset(const std::string& path)
return false;
}
- LL_DEBUGS2("AppInit", "Shaders") << "Loading sky " << name << LL_ENDL;
+ LL_DEBUGS("AppInit", "Shaders") << "Loading sky " << name << LL_ENDL;
LLSD params_data;
LLPointer<LLSDParser> parser = new LLSDXMLParser();
@@ -364,11 +364,11 @@ void LLWLParamManager::updateShaderUniforms(LLGLSLShader * shader)
}
-static LLFastTimer::DeclareTimer FTM_UPDATE_WLPARAM("Update Windlight Params");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_WLPARAM("Update Windlight Params");
void LLWLParamManager::propagateParameters(void)
{
- LLFastTimer ftm(FTM_UPDATE_WLPARAM);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_WLPARAM);
LLVector4 sunDir;
LLVector4 moonDir;
@@ -439,7 +439,7 @@ void LLWLParamManager::propagateParameters(void)
void LLWLParamManager::update(LLViewerCamera * cam)
{
- LLFastTimer ftm(FTM_UPDATE_WLPARAM);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_WLPARAM);
// update clouds, sun, and general
mCurParams.updateCloudScrolling();
@@ -577,7 +577,7 @@ void LLWLParamManager::removeParamSet(const LLWLParamKey& key, bool delete_from_
if (key.scope == LLEnvKey::SCOPE_REGION)
{
- llwarns << "Removing region skies not supported" << llendl;
+ LL_WARNS() << "Removing region skies not supported" << LL_ENDL;
llassert(key.scope == LLEnvKey::SCOPE_LOCAL);
return;
}
@@ -677,7 +677,7 @@ void LLWLParamManager::initSingleton()
if (!LLDayCycleManager::instance().getPreset(preferred_day, mDay))
{
// Fall back to default.
- llwarns << "No day cycle named " << preferred_day << ", falling back to defaults" << llendl;
+ LL_WARNS() << "No day cycle named " << preferred_day << ", falling back to defaults" << LL_ENDL;
mDay.loadDayCycleFromFile("Default.xml");
// *TODO: Fix user preferences accordingly.
@@ -687,7 +687,7 @@ void LLWLParamManager::initSingleton()
std::string sky = LLEnvManagerNew::instance().getSkyPresetName();
if (!getParamSet(LLWLParamKey(sky, LLWLParamKey::SCOPE_LOCAL), mCurParams))
{
- llwarns << "No sky preset named " << sky << ", falling back to defaults" << llendl;
+ LL_WARNS() << "No sky preset named " << sky << ", falling back to defaults" << LL_ENDL;
getParamSet(LLWLParamKey("Default", LLWLParamKey::SCOPE_LOCAL), mCurParams);
// *TODO: Fix user preferences accordingly.
diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp
index 8529a4614b..066cb9a0ac 100755
--- a/indra/newview/llwlparamset.cpp
+++ b/indra/newview/llwlparamset.cpp
@@ -60,11 +60,11 @@ LLWLParamSet::LLWLParamSet(void) :
mCloudScrollXOffset(0.f), mCloudScrollYOffset(0.f)
{}
-static LLFastTimer::DeclareTimer FTM_WL_PARAM_UPDATE("WL Param Update");
+static LLTrace::BlockTimerStatHandle FTM_WL_PARAM_UPDATE("WL Param Update");
void LLWLParamSet::update(LLGLSLShader * shader) const
{
- LLFastTimer t(FTM_WL_PARAM_UPDATE);
+ LL_RECORD_BLOCK_TIME(FTM_WL_PARAM_UPDATE);
LLSD::map_const_iterator i = mParamValues.beginMap();
std::vector<LLStaticHashedString>::const_iterator n = mParamHashedNames.begin();
for(;(i != mParamValues.endMap()) && (n != mParamHashedNames.end());++i, n++)
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index 85614f397c..b4e8114a5f 100755
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -55,7 +55,7 @@
#include "message.h"
#include "pipeline.h"
#include "llappviewer.h" // for do_disconnect()
-
+#include "llscenemonitor.h"
#include <deque>
#include <queue>
#include <map>
@@ -110,6 +110,7 @@ LLWorld::LLWorld() :
gGL.getTexUnit(0)->bind(mDefaultWaterTexturep);
mDefaultWaterTexturep->setAddressMode(LLTexUnit::TAM_CLAMP);
+ LLViewerRegion::sVOCacheCullingEnabled = gSavedSettings.getBOOL("RequestFullRegionCache") && gSavedSettings.getBOOL("ObjectCacheEnabled");
}
@@ -122,10 +123,7 @@ void LLWorld::destroyClass()
LLViewerRegion* region_to_delete = *region_it++;
removeRegion(region_to_delete->getHost());
}
- if(LLVOCache::hasInstance())
- {
- LLVOCache::getInstance()->destroyClass() ;
- }
+
LLViewerPartSim::getInstance()->destroyClass();
mDefaultWaterTexturep = NULL ;
@@ -133,12 +131,17 @@ void LLWorld::destroyClass()
{
mEdgeWaterObjects[i] = NULL;
}
+
+ //make all visible drawbles invisible.
+ LLDrawable::incrementVisible();
+
+ LLSceneMonitor::deleteSingleton();
}
LLViewerRegion* LLWorld::addRegion(const U64 &region_handle, const LLHost &host)
{
- llinfos << "Add region with handle: " << region_handle << " on host " << host << llendl;
+ LL_INFOS() << "Add region with handle: " << region_handle << " on host " << host << LL_ENDL;
LLViewerRegion *regionp = getRegionFromHandle(region_handle);
std::string seedUrl;
if (regionp)
@@ -148,19 +151,19 @@ LLViewerRegion* LLWorld::addRegion(const U64 &region_handle, const LLHost &host)
if (host == old_host && regionp->isAlive())
{
// This is a duplicate for the same host and it's alive, don't bother.
- llinfos << "Region already exists and is alive, using existing region" << llendl;
+ LL_INFOS() << "Region already exists and is alive, using existing region" << LL_ENDL;
return regionp;
}
if (host != old_host)
{
- llwarns << "LLWorld::addRegion exists, but old host " << old_host
+ LL_WARNS() << "LLWorld::addRegion exists, but old host " << old_host
<< " does not match new host " << host
- << ", removing old region and creating new" << llendl;
+ << ", removing old region and creating new" << LL_ENDL;
}
if (!regionp->isAlive())
{
- llwarns << "LLWorld::addRegion exists, but isn't alive. Removing old region and creating new" << llendl;
+ LL_WARNS() << "LLWorld::addRegion exists, but isn't alive. Removing old region and creating new" << LL_ENDL;
}
// Save capabilities seed URL
@@ -172,7 +175,7 @@ LLViewerRegion* LLWorld::addRegion(const U64 &region_handle, const LLHost &host)
}
else
{
- llinfos << "Region does not exist, creating new one" << llendl;
+ LL_INFOS() << "Region does not exist, creating new one" << LL_ENDL;
}
U32 iindex = 0;
@@ -180,8 +183,8 @@ LLViewerRegion* LLWorld::addRegion(const U64 &region_handle, const LLHost &host)
from_region_handle(region_handle, &iindex, &jindex);
S32 x = (S32)(iindex/mWidth);
S32 y = (S32)(jindex/mWidth);
- llinfos << "Adding new region (" << x << ":" << y << ")"
- << " on host: " << host << llendl;
+ LL_INFOS() << "Adding new region (" << x << ":" << y << ")"
+ << " on host: " << host << LL_ENDL;
LLVector3d origin_global;
@@ -194,7 +197,7 @@ LLViewerRegion* LLWorld::addRegion(const U64 &region_handle, const LLHost &host)
getRegionWidthInMeters() );
if (!regionp)
{
- llerrs << "Unable to create new region!" << llendl;
+ LL_ERRS() << "Unable to create new region!" << LL_ENDL;
}
if ( !seedUrl.empty() )
@@ -232,7 +235,7 @@ LLViewerRegion* LLWorld::addRegion(const U64 &region_handle, const LLHost &host)
neighborp = getRegionFromHandle(adj_handle);
if (neighborp)
{
- //llinfos << "Connecting " << region_x << ":" << region_y << " -> " << adj_x << ":" << adj_y << llendl;
+ //LL_INFOS() << "Connecting " << region_x << ":" << region_y << " -> " << adj_x << ":" << adj_y << LL_ENDL;
regionp->connectNeighbor(neighborp, dir);
}
}
@@ -250,7 +253,7 @@ void LLWorld::removeRegion(const LLHost &host)
LLViewerRegion *regionp = getRegion(host);
if (!regionp)
{
- llwarns << "Trying to remove region that doesn't exist!" << llendl;
+ LL_WARNS() << "Trying to remove region that doesn't exist!" << LL_ENDL;
return;
}
@@ -260,21 +263,21 @@ void LLWorld::removeRegion(const LLHost &host)
iter != mRegionList.end(); ++iter)
{
LLViewerRegion* reg = *iter;
- llwarns << "RegionDump: " << reg->getName()
+ LL_WARNS() << "RegionDump: " << reg->getName()
<< " " << reg->getHost()
<< " " << reg->getOriginGlobal()
- << llendl;
+ << LL_ENDL;
}
- llwarns << "Agent position global " << gAgent.getPositionGlobal()
+ LL_WARNS() << "Agent position global " << gAgent.getPositionGlobal()
<< " agent " << gAgent.getPositionAgent()
- << llendl;
+ << LL_ENDL;
- llwarns << "Regions visited " << gAgent.getRegionsVisited() << llendl;
+ LL_WARNS() << "Regions visited " << gAgent.getRegionsVisited() << LL_ENDL;
- llwarns << "gFrameTimeSeconds " << gFrameTimeSeconds << llendl;
+ LL_WARNS() << "gFrameTimeSeconds " << gFrameTimeSeconds << LL_ENDL;
- llwarns << "Disabling region " << regionp->getName() << " that agent is in!" << llendl;
+ LL_WARNS() << "Disabling region " << regionp->getName() << " that agent is in!" << LL_ENDL;
LLAppViewer::instance()->forceDisconnect(LLTrans::getString("YouHaveBeenDisconnected"));
regionp->saveObjectCache() ; //force to save objects here in case that the object cache is about to be destroyed.
@@ -282,7 +285,7 @@ void LLWorld::removeRegion(const LLHost &host)
}
from_region_handle(regionp->getHandle(), &x, &y);
- llinfos << "Removing region " << x << ":" << y << llendl;
+ LL_INFOS() << "Removing region " << x << ":" << y << LL_ENDL;
mRegionList.remove(regionp);
mActiveRegionList.remove(regionp);
@@ -628,7 +631,8 @@ void LLWorld::updateVisibilities()
if (part)
{
LLSpatialGroup* group = (LLSpatialGroup*) part->mOctree->getListener(0);
- if (LLViewerCamera::getInstance()->AABBInFrustum(group->mBounds[0], group->mBounds[1]))
+ const LLVector4a* bounds = group->getBounds();
+ if (LLViewerCamera::getInstance()->AABBInFrustum(bounds[0], bounds[1]))
{
mCulledRegionList.erase(curiter);
mVisibleRegionList.push_back(regionp);
@@ -651,7 +655,8 @@ void LLWorld::updateVisibilities()
if (part)
{
LLSpatialGroup* group = (LLSpatialGroup*) part->mOctree->getListener(0);
- if (LLViewerCamera::getInstance()->AABBInFrustum(group->mBounds[0], group->mBounds[1]))
+ const LLVector4a* bounds = group->getBounds();
+ if (LLViewerCamera::getInstance()->AABBInFrustum(bounds[0], bounds[1]))
{
regionp->calculateCameraDistance();
regionp->getLand().updatePatchVisibilities(gAgent);
@@ -670,24 +675,75 @@ void LLWorld::updateVisibilities()
LLViewerCamera::getInstance()->setFar(cur_far_clip);
}
+static LLTrace::SampleStatHandle<> sNumActiveCachedObjects("numactivecachedobjects", "Number of objects loaded from cache");
+
void LLWorld::updateRegions(F32 max_update_time)
{
LLTimer update_timer;
- BOOL did_one = FALSE;
+ mNumOfActiveCachedObjects = 0;
- // Perform idle time updates for the regions (and associated surfaces)
+ if(LLViewerCamera::getInstance()->isChanged())
+ {
+ LLViewerRegion::sLastCameraUpdated = LLViewerOctreeEntryData::getCurrentFrame() + 1;
+ }
+ LLViewerRegion::calcNewObjectCreationThrottle();
+ if(LLViewerRegion::isNewObjectCreationThrottleDisabled())
+ {
+ max_update_time = llmax(max_update_time, 1.0f); //seconds, loosen the time throttle.
+ }
+
+ F32 max_time = llmin((F32)(max_update_time - update_timer.getElapsedTimeF32()), max_update_time * 0.25f);
+ //update the self avatar region
+ LLViewerRegion* self_regionp = gAgent.getRegion();
+ if(self_regionp)
+ {
+ self_regionp->idleUpdate(max_time);
+ }
+
+ //sort regions by its mLastUpdate
+ //smaller mLastUpdate first to make sure every region has chance to get updated.
+ LLViewerRegion::region_priority_list_t region_list;
for (region_list_t::iterator iter = mRegionList.begin();
iter != mRegionList.end(); ++iter)
{
LLViewerRegion* regionp = *iter;
- F32 max_time = max_update_time - update_timer.getElapsedTimeF32();
- if (did_one && max_time <= 0.f)
- break;
- max_time = llmin(max_time, max_update_time*.1f);
- if (regionp->idleUpdate(max_update_time))
+ if(regionp != self_regionp)
{
- did_one = TRUE;
+ region_list.insert(regionp);
}
+ mNumOfActiveCachedObjects += regionp->getNumOfActiveCachedObjects();
+ }
+
+ // Perform idle time updates for the regions (and associated surfaces)
+ for (LLViewerRegion::region_priority_list_t::iterator iter = region_list.begin();
+ iter != region_list.end(); ++iter)
+ {
+ if(max_time > 0.f)
+ {
+ max_time = llmin((F32)(max_update_time - update_timer.getElapsedTimeF32()), max_update_time * 0.25f);
+ }
+
+ if(max_time > 0.f)
+ {
+ (*iter)->idleUpdate(max_time);
+ }
+ else
+ {
+ //perform some necessary but very light updates.
+ (*iter)->lightIdleUpdate();
+ }
+ }
+
+ sample(sNumActiveCachedObjects, mNumOfActiveCachedObjects);
+ }
+
+void LLWorld::clearAllVisibleObjects()
+{
+ for (region_list_t::iterator iter = mRegionList.begin();
+ iter != mRegionList.end(); ++iter)
+ {
+ //clear all cached visible objects.
+ (*iter)->clearCachedVisibleObjects();
}
}
@@ -713,7 +769,7 @@ void LLWorld::renderPropertyLines()
void LLWorld::updateNetStats()
{
- F32 bits = 0.f;
+ F64Bits bits;
U32 packets = 0;
for (region_list_t::iterator iter = mActiveRegionList.begin();
@@ -721,29 +777,28 @@ void LLWorld::updateNetStats()
{
LLViewerRegion* regionp = *iter;
regionp->updateNetStats();
- bits += regionp->mBitStat.getCurrent();
- packets += llfloor( regionp->mPacketsStat.getCurrent() );
+ bits += regionp->mBitsReceived;
+ packets += llfloor( regionp->mPacketsReceived );
+ regionp->mBitsReceived = (F32Bits)0.f;
+ regionp->mPacketsReceived = 0.f;
}
S32 packets_in = gMessageSystem->mPacketsIn - mLastPacketsIn;
S32 packets_out = gMessageSystem->mPacketsOut - mLastPacketsOut;
S32 packets_lost = gMessageSystem->mDroppedPackets - mLastPacketsLost;
- S32 actual_in_bits = gMessageSystem->mPacketRing.getAndResetActualInBits();
- S32 actual_out_bits = gMessageSystem->mPacketRing.getAndResetActualOutBits();
- LLViewerStats::getInstance()->mActualInKBitStat.addValue(actual_in_bits/1024.f);
- LLViewerStats::getInstance()->mActualOutKBitStat.addValue(actual_out_bits/1024.f);
- LLViewerStats::getInstance()->mKBitStat.addValue(bits/1024.f);
- LLViewerStats::getInstance()->mPacketsInStat.addValue(packets_in);
- LLViewerStats::getInstance()->mPacketsOutStat.addValue(packets_out);
- LLViewerStats::getInstance()->mPacketsLostStat.addValue(gMessageSystem->mDroppedPackets);
+ F64Bits actual_in_bits(gMessageSystem->mPacketRing.getAndResetActualInBits());
+ F64Bits actual_out_bits(gMessageSystem->mPacketRing.getAndResetActualOutBits());
+
+ add(LLStatViewer::MESSAGE_SYSTEM_DATA_IN, actual_in_bits);
+ add(LLStatViewer::MESSAGE_SYSTEM_DATA_OUT, actual_out_bits);
+ add(LLStatViewer::ACTIVE_MESSAGE_DATA_RECEIVED, bits);
+ add(LLStatViewer::PACKETS_IN, packets_in);
+ add(LLStatViewer::PACKETS_OUT, packets_out);
+ add(LLStatViewer::PACKETS_LOST, packets_lost);
if (packets_in)
{
- LLViewerStats::getInstance()->mPacketsLostPercentStat.addValue(100.f*((F32)packets_lost/(F32)packets_in));
- }
- else
- {
- LLViewerStats::getInstance()->mPacketsLostPercentStat.addValue(0.f);
+ sample(LLStatViewer::PACKETS_LOST_PERCENT, LLUnits::Ratio::fromValue((F32)packets_lost/(F32)packets_in));
}
mLastPacketsIn = gMessageSystem->mPacketsIn;
@@ -754,8 +809,8 @@ void LLWorld::updateNetStats()
void LLWorld::printPacketsLost()
{
- llinfos << "Simulators:" << llendl;
- llinfos << "----------" << llendl;
+ LL_INFOS() << "Simulators:" << LL_ENDL;
+ LL_INFOS() << "----------" << LL_ENDL;
LLCircuitData *cdp = NULL;
for (region_list_t::iterator iter = mActiveRegionList.begin();
@@ -767,8 +822,8 @@ void LLWorld::printPacketsLost()
{
LLVector3d range = regionp->getCenterGlobal() - gAgent.getPositionGlobal();
- llinfos << regionp->getHost() << ", range: " << range.length()
- << " packets lost: " << cdp->getPacketsLost() << llendl;
+ LL_INFOS() << regionp->getHost() << ", range: " << range.length()
+ << " packets lost: " << cdp->getPacketsLost() << LL_ENDL;
}
}
}
@@ -824,7 +879,7 @@ void LLWorld::updateWaterObjects()
}
if (mRegionList.empty())
{
- llwarns << "No regions!" << llendl;
+ LL_WARNS() << "No regions!" << LL_ENDL;
return;
}
@@ -974,12 +1029,12 @@ LLViewerTexture* LLWorld::getDefaultWaterTexture()
return mDefaultWaterTexturep;
}
-void LLWorld::setSpaceTimeUSec(const U64 space_time_usec)
+void LLWorld::setSpaceTimeUSec(const U64MicrosecondsImplicit space_time_usec)
{
mSpaceTimeUSec = space_time_usec;
}
-U64 LLWorld::getSpaceTimeUSec() const
+U64MicrosecondsImplicit LLWorld::getSpaceTimeUSec() const
{
return mSpaceTimeUSec;
}
@@ -1019,7 +1074,7 @@ void LLWorld::disconnectRegions()
continue;
}
- llinfos << "Sending AgentQuitCopy to: " << regionp->getHost() << llendl;
+ LL_INFOS() << "Sending AgentQuitCopy to: " << regionp->getHost() << LL_ENDL;
msg->newMessageFast(_PREHASH_AgentQuitCopy);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
@@ -1030,11 +1085,11 @@ void LLWorld::disconnectRegions()
}
}
-static LLFastTimer::DeclareTimer FTM_ENABLE_SIMULATOR("Enable Sim");
+static LLTrace::BlockTimerStatHandle FTM_ENABLE_SIMULATOR("Enable Sim");
void process_enable_simulator(LLMessageSystem *msg, void **user_data)
{
- LLFastTimer t(FTM_ENABLE_SIMULATOR);
+ LL_RECORD_BLOCK_TIME(FTM_ENABLE_SIMULATOR);
// enable the appropriate circuit for this simulator and
// add its values into the gSimulator structure
U64 handle;
@@ -1053,7 +1108,7 @@ void process_enable_simulator(LLMessageSystem *msg, void **user_data)
LLWorld::getInstance()->addRegion(handle, sim);
// give the simulator a message it can use to get ip and port
- llinfos << "simulator_enable() Enabling " << sim << " with code " << msg->getOurCircuitCode() << llendl;
+ LL_INFOS() << "simulator_enable() Enabling " << sim << " with code " << msg->getOurCircuitCode() << LL_ENDL;
msg->newMessageFast(_PREHASH_UseCircuitCode);
msg->nextBlockFast(_PREHASH_CircuitCode);
msg->addU32Fast(_PREHASH_Code, msg->getOurCircuitCode());
@@ -1081,7 +1136,7 @@ public:
!input["body"].has("sim-ip-and-port") ||
!input["body"].has("seed-capability"))
{
- llwarns << "invalid parameters" << llendl;
+ LL_WARNS() << "invalid parameters" << LL_ENDL;
return;
}
@@ -1090,10 +1145,12 @@ public:
LLViewerRegion* regionp = LLWorld::getInstance()->getRegion(sim);
if (!regionp)
{
- llwarns << "Got EstablishAgentCommunication for unknown region "
- << sim << llendl;
+ LL_WARNS() << "Got EstablishAgentCommunication for unknown region "
+ << sim << LL_ENDL;
return;
}
+ LL_DEBUGS("CrossingCaps") << "Calling setSeedCapability from LLEstablishAgentCommunication::post. Seed cap == "
+ << input["body"]["seed-capability"] << LL_ENDL;
regionp->setSeedCapability(input["body"]["seed-capability"]);
}
};
@@ -1104,7 +1161,7 @@ void process_disable_simulator(LLMessageSystem *mesgsys, void **user_data)
{
LLHost host = mesgsys->getSender();
- //llinfos << "Disabling simulator with message from " << host << llendl;
+ //LL_INFOS() << "Disabling simulator with message from " << host << LL_ENDL;
LLWorld::getInstance()->removeRegion(host);
mesgsys->disableCircuit(host);
@@ -1117,8 +1174,8 @@ void process_region_handshake(LLMessageSystem* msg, void** user_data)
LLViewerRegion* regionp = LLWorld::getInstance()->getRegion(host);
if (!regionp)
{
- llwarns << "Got region handshake for unknown region "
- << host << llendl;
+ LL_WARNS() << "Got region handshake for unknown region "
+ << host << LL_ENDL;
return;
}
@@ -1156,6 +1213,7 @@ void send_agent_pause()
}
gObjectList.mWasPaused = TRUE;
+ LLViewerStats::instance().getRecording().stop();
}
@@ -1185,8 +1243,8 @@ void send_agent_resume()
gMessageSystem->sendReliable(regionp->getHost());
}
- // Reset the FPS counter to avoid an invalid fps
- LLViewerStats::getInstance()->mFPSStat.start();
+ // Resume data collection to ignore invalid rates
+ LLViewerStats::instance().getRecording().resume();
LLAppViewer::instance()->resumeMainloopTimeout();
}
@@ -1246,13 +1304,13 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi
{
LLViewerRegion* regionp = *iter;
const LLVector3d& origin_global = regionp->getOriginGlobal();
- S32 count = regionp->mMapAvatars.count();
+ S32 count = regionp->mMapAvatars.size();
for (S32 i = 0; i < count; i++)
{
- LLVector3d pos_global = unpackLocalToGlobalPosition(regionp->mMapAvatars.get(i), origin_global);
+ LLVector3d pos_global = unpackLocalToGlobalPosition(regionp->mMapAvatars.at(i), origin_global);
if(dist_vec_squared(pos_global, relative_to) <= radius_squared)
{
- LLUUID uuid = regionp->mMapAvatarIDs.get(i);
+ LLUUID uuid = regionp->mMapAvatarIDs.at(i);
// if this avatar doesn't already exist in the list, add it
if(uuid.notNull() && avatar_ids != NULL && std::find(avatar_ids->begin(), avatar_ids->end(), uuid) == avatar_ids->end())
{
diff --git a/indra/newview/llworld.h b/indra/newview/llworld.h
index d0b001ba44..b2d8418064 100755
--- a/indra/newview/llworld.h
+++ b/indra/newview/llworld.h
@@ -141,11 +141,13 @@ public:
void waterHeightRegionInfo(std::string const& sim_name, F32 water_height);
void shiftRegions(const LLVector3& offset);
- void setSpaceTimeUSec(const U64 space_time_usec);
- U64 getSpaceTimeUSec() const;
+ void setSpaceTimeUSec(const U64MicrosecondsImplicit space_time_usec);
+ U64MicrosecondsImplicit getSpaceTimeUSec() const;
void getInfo(LLSD& info);
+ U32 getNumOfActiveCachedObjects() const {return mNumOfActiveCachedObjects;}
+ void clearAllVisibleObjects();
public:
typedef std::list<LLViewerRegion*> region_list_t;
const region_list_t& getRegionList() const { return mActiveRegionList; }
@@ -187,8 +189,8 @@ private:
S32 mLastPacketsIn;
S32 mLastPacketsOut;
S32 mLastPacketsLost;
-
- U64 mSpaceTimeUSec;
+ U32 mNumOfActiveCachedObjects;
+ U64MicrosecondsImplicit mSpaceTimeUSec;
BOOL mClassicCloudsEnabled;
diff --git a/indra/newview/llworldmap.h b/indra/newview/llworldmap.h
index d514b2f14c..1a168e4b4d 100755
--- a/indra/newview/llworldmap.h
+++ b/indra/newview/llworldmap.h
@@ -38,6 +38,18 @@
#include "llviewertexture.h"
#include "llgltexture.h"
+// map item types
+const U32 MAP_ITEM_TELEHUB = 0x01;
+const U32 MAP_ITEM_PG_EVENT = 0x02;
+const U32 MAP_ITEM_MATURE_EVENT = 0x03;
+//const U32 MAP_ITEM_POPULAR = 0x04; // No longer supported, 2009-03-02 KLW
+//const U32 MAP_ITEM_AGENT_COUNT = 0x05;
+const U32 MAP_ITEM_AGENT_LOCATIONS = 0x06;
+const U32 MAP_ITEM_LAND_FOR_SALE = 0x07;
+const U32 MAP_ITEM_CLASSIFIED = 0x08;
+const U32 MAP_ITEM_ADULT_EVENT = 0x09;
+const U32 MAP_ITEM_LAND_FOR_SALE_ADULT = 0x0a;
+
// Description of objects like hubs, events, land for sale, people and more (TBD).
// Note: we don't store a "type" in there so we need to store instances of this class in
// well known objects (i.e. list of objects which type is "well known").
diff --git a/indra/newview/llworldmapmessage.cpp b/indra/newview/llworldmapmessage.cpp
index 8307d32336..865292fa90 100755
--- a/indra/newview/llworldmapmessage.cpp
+++ b/indra/newview/llworldmapmessage.cpp
@@ -156,7 +156,7 @@ void LLWorldMapMessage::processMapBlockReply(LLMessageSystem* msg, void**)
// There's only one flag that we ever use here
if (agent_flags != LAYER_FLAG)
{
- llwarns << "Invalid map image type returned! layer = " << agent_flags << llendl;
+ LL_WARNS() << "Invalid map image type returned! layer = " << agent_flags << LL_ENDL;
return;
}
diff --git a/indra/newview/llworldmapmessage.h b/indra/newview/llworldmapmessage.h
index 12b6ef4792..ac1ea1607c 100755
--- a/indra/newview/llworldmapmessage.h
+++ b/indra/newview/llworldmapmessage.h
@@ -27,6 +27,8 @@
#ifndef LL_LLWORLDMAPMESSAGE_H
#define LL_LLWORLDMAPMESSAGE_H
+#include "boost/function.hpp"
+
// Handling of messages (send and process) as well as SLURL callback if necessary
class LLMessageSystem;
diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp
index 786e4f2de6..7cb53a0706 100755
--- a/indra/newview/llworldmapview.cpp
+++ b/indra/newview/llworldmapview.cpp
@@ -302,8 +302,8 @@ void LLWorldMapView::draw()
mVisibleRegions.clear();
// animate pan if necessary
- sPanX = lerp(sPanX, sTargetPanX, LLCriticalDamp::getInterpolant(0.1f));
- sPanY = lerp(sPanY, sTargetPanY, LLCriticalDamp::getInterpolant(0.1f));
+ sPanX = lerp(sPanX, sTargetPanX, LLSmoothInterpolation::getInterpolant(0.1f));
+ sPanY = lerp(sPanY, sTargetPanY, LLSmoothInterpolation::getInterpolant(0.1f));
const S32 width = getRect().getWidth();
const S32 height = getRect().getHeight();
@@ -1694,6 +1694,8 @@ BOOL LLWorldMapView::handleHover( S32 x, S32 y, MASK mask )
sPanY += delta_y;
sTargetPanX = sPanX;
sTargetPanY = sPanY;
+
+ gViewerWindow->moveCursorToCenter();
}
// doesn't matter, cursor should be hidden
@@ -1713,7 +1715,7 @@ BOOL LLWorldMapView::handleHover( S32 x, S32 y, MASK mask )
{
gViewerWindow->setCursor( UI_CURSOR_CROSS );
}
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLWorldMapView" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLWorldMapView" << LL_ENDL;
return TRUE;
}
}
diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp
index 0da70d398b..c12c2cc24c 100755
--- a/indra/newview/llxmlrpctransaction.cpp
+++ b/indra/newview/llxmlrpctransaction.cpp
@@ -25,6 +25,8 @@
*/
#include "llviewerprecompiledheaders.h"
+// include this to get winsock2 because openssl attempts to include winsock1
+#include "llwin32headerslean.h"
#include <openssl/x509_vfy.h>
#include <openssl/ssl.h>
#include "llsecapi.h"
@@ -307,7 +309,7 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip)
}
if(!mCurlRequest->isValid())
{
- llwarns << "mCurlRequest is invalid." << llendl ;
+ LL_WARNS() << "mCurlRequest is invalid." << LL_ENDL ;
delete mCurlRequest ;
mCurlRequest = NULL ;
@@ -331,7 +333,7 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip)
This might help with bug #503 */
mCurlRequest->setopt(CURLOPT_DNS_CACHE_TIMEOUT, -1);
- mCurlRequest->slist_append("Content-Type: text/xml");
+ mCurlRequest->slist_append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_TEXT_XML);
if (useGzip)
{
@@ -373,7 +375,7 @@ bool LLXMLRPCTransaction::Impl::process()
{
if(!mCurlRequest || !mCurlRequest->isValid())
{
- llwarns << "transaction failed." << llendl ;
+ LL_WARNS() << "transaction failed." << LL_ENDL ;
delete mCurlRequest ;
mCurlRequest = NULL ;
@@ -423,10 +425,10 @@ bool LLXMLRPCTransaction::Impl::process()
// appropriate
setCurlStatus(result);
- llwarns << "LLXMLRPCTransaction CURL error "
- << mCurlCode << ": " << mCurlRequest->getErrorString() << llendl;
- llwarns << "LLXMLRPCTransaction request URI: "
- << mURI << llendl;
+ LL_WARNS() << "LLXMLRPCTransaction CURL error "
+ << mCurlCode << ": " << mCurlRequest->getErrorString() << LL_ENDL;
+ LL_WARNS() << "LLXMLRPCTransaction request URI: "
+ << mURI << LL_ENDL;
}
return true;
@@ -460,12 +462,12 @@ bool LLXMLRPCTransaction::Impl::process()
{
setStatus(LLXMLRPCTransaction::StatusXMLRPCError);
- llwarns << "LLXMLRPCTransaction XMLRPC "
+ LL_WARNS() << "LLXMLRPCTransaction XMLRPC "
<< (hasError ? "error " : "fault ")
<< faultCode << ": "
- << faultString << llendl;
- llwarns << "LLXMLRPCTransaction request URI: "
- << mURI << llendl;
+ << faultString << LL_ENDL;
+ LL_WARNS() << "LLXMLRPCTransaction request URI: "
+ << mURI << LL_ENDL;
}
return true;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 5da8a78b1b..3dfe1e5992 100755
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -30,7 +30,6 @@
// library includes
#include "llaudioengine.h" // For debugging.
-#include "imageids.h"
#include "llerror.h"
#include "llviewercontrol.h"
#include "llfasttimer.h"
@@ -40,7 +39,6 @@
#include "llprimitive.h"
#include "llvolume.h"
#include "material_codes.h"
-#include "timing.h"
#include "v3color.h"
#include "llui.h"
#include "llglheaders.h"
@@ -87,6 +85,7 @@
#include "llviewerregion.h" // for audio debugging.
#include "llviewerwindow.h" // For getSpinAxis
#include "llvoavatarself.h"
+#include "llvocache.h"
#include "llvoground.h"
#include "llvosky.h"
#include "llvotree.h"
@@ -114,6 +113,8 @@
#include "llfloatertools.h"
#include "llpanelface.h"
#include "llpathfindingpathtool.h"
+#include "llscenemonitor.h"
+#include "llprogressview.h"
#ifdef _DEBUG
// Debug indices is disabled for now for debug performance - djs 4/24/02
@@ -204,6 +205,7 @@ BOOL LLPipeline::CameraOffset;
F32 LLPipeline::CameraMaxCoF;
F32 LLPipeline::CameraDoFResScale;
F32 LLPipeline::RenderAutoHideSurfaceAreaLimit;
+LLTrace::EventStatHandle<S64> LLPipeline::sStatBatchSize("renderbatchsize");
const F32 BACKLIGHT_DAY_MAGNITUDE_AVATAR = 0.2f;
const F32 BACKLIGHT_NIGHT_MAGNITUDE_AVATAR = 0.1f;
@@ -226,40 +228,40 @@ BOOL gDebugPipeline = FALSE;
LLPipeline gPipeline;
const LLMatrix4* gGLLastMatrix = NULL;
-LLFastTimer::DeclareTimer FTM_RENDER_GEOMETRY("Render Geometry");
-LLFastTimer::DeclareTimer FTM_RENDER_GRASS("Grass");
-LLFastTimer::DeclareTimer FTM_RENDER_INVISIBLE("Invisible");
-LLFastTimer::DeclareTimer FTM_RENDER_OCCLUSION("Occlusion");
-LLFastTimer::DeclareTimer FTM_RENDER_SHINY("Shiny");
-LLFastTimer::DeclareTimer FTM_RENDER_SIMPLE("Simple");
-LLFastTimer::DeclareTimer FTM_RENDER_TERRAIN("Terrain");
-LLFastTimer::DeclareTimer FTM_RENDER_TREES("Trees");
-LLFastTimer::DeclareTimer FTM_RENDER_UI("UI");
-LLFastTimer::DeclareTimer FTM_RENDER_WATER("Water");
-LLFastTimer::DeclareTimer FTM_RENDER_WL_SKY("Windlight Sky");
-LLFastTimer::DeclareTimer FTM_RENDER_ALPHA("Alpha Objects");
-LLFastTimer::DeclareTimer FTM_RENDER_CHARACTERS("Avatars");
-LLFastTimer::DeclareTimer FTM_RENDER_BUMP("Bump");
-LLFastTimer::DeclareTimer FTM_RENDER_MATERIALS("Materials");
-LLFastTimer::DeclareTimer FTM_RENDER_FULLBRIGHT("Fullbright");
-LLFastTimer::DeclareTimer FTM_RENDER_GLOW("Glow");
-LLFastTimer::DeclareTimer FTM_GEO_UPDATE("Geo Update");
-LLFastTimer::DeclareTimer FTM_PIPELINE_CREATE("Pipeline Create");
-LLFastTimer::DeclareTimer FTM_POOLRENDER("RenderPool");
-LLFastTimer::DeclareTimer FTM_POOLS("Pools");
-LLFastTimer::DeclareTimer FTM_DEFERRED_POOLRENDER("RenderPool (Deferred)");
-LLFastTimer::DeclareTimer FTM_DEFERRED_POOLS("Pools (Deferred)");
-LLFastTimer::DeclareTimer FTM_POST_DEFERRED_POOLRENDER("RenderPool (Post)");
-LLFastTimer::DeclareTimer FTM_POST_DEFERRED_POOLS("Pools (Post)");
-LLFastTimer::DeclareTimer FTM_RENDER_BLOOM_FBO("First FBO");
-LLFastTimer::DeclareTimer FTM_STATESORT("Sort Draw State");
-LLFastTimer::DeclareTimer FTM_PIPELINE("Pipeline");
-LLFastTimer::DeclareTimer FTM_CLIENT_COPY("Client Copy");
-LLFastTimer::DeclareTimer FTM_RENDER_DEFERRED("Deferred Shading");
-
-
-static LLFastTimer::DeclareTimer FTM_STATESORT_DRAWABLE("Sort Drawables");
-static LLFastTimer::DeclareTimer FTM_STATESORT_POSTSORT("Post Sort");
+LLTrace::BlockTimerStatHandle FTM_RENDER_GEOMETRY("Render Geometry");
+LLTrace::BlockTimerStatHandle FTM_RENDER_GRASS("Grass");
+LLTrace::BlockTimerStatHandle FTM_RENDER_INVISIBLE("Invisible");
+LLTrace::BlockTimerStatHandle FTM_RENDER_OCCLUSION("Occlusion");
+LLTrace::BlockTimerStatHandle FTM_RENDER_SHINY("Shiny");
+LLTrace::BlockTimerStatHandle FTM_RENDER_SIMPLE("Simple");
+LLTrace::BlockTimerStatHandle FTM_RENDER_TERRAIN("Terrain");
+LLTrace::BlockTimerStatHandle FTM_RENDER_TREES("Trees");
+LLTrace::BlockTimerStatHandle FTM_RENDER_UI("UI");
+LLTrace::BlockTimerStatHandle FTM_RENDER_WATER("Water");
+LLTrace::BlockTimerStatHandle FTM_RENDER_WL_SKY("Windlight Sky");
+LLTrace::BlockTimerStatHandle FTM_RENDER_ALPHA("Alpha Objects");
+LLTrace::BlockTimerStatHandle FTM_RENDER_CHARACTERS("Avatars");
+LLTrace::BlockTimerStatHandle FTM_RENDER_BUMP("Bump");
+LLTrace::BlockTimerStatHandle FTM_RENDER_MATERIALS("Render Materials");
+LLTrace::BlockTimerStatHandle FTM_RENDER_FULLBRIGHT("Fullbright");
+LLTrace::BlockTimerStatHandle FTM_RENDER_GLOW("Glow");
+LLTrace::BlockTimerStatHandle FTM_GEO_UPDATE("Geo Update");
+LLTrace::BlockTimerStatHandle FTM_PIPELINE_CREATE("Pipeline Create");
+LLTrace::BlockTimerStatHandle FTM_POOLRENDER("RenderPool");
+LLTrace::BlockTimerStatHandle FTM_POOLS("Pools");
+LLTrace::BlockTimerStatHandle FTM_DEFERRED_POOLRENDER("RenderPool (Deferred)");
+LLTrace::BlockTimerStatHandle FTM_DEFERRED_POOLS("Pools (Deferred)");
+LLTrace::BlockTimerStatHandle FTM_POST_DEFERRED_POOLRENDER("RenderPool (Post)");
+LLTrace::BlockTimerStatHandle FTM_POST_DEFERRED_POOLS("Pools (Post)");
+LLTrace::BlockTimerStatHandle FTM_RENDER_BLOOM_FBO("First FBO");
+LLTrace::BlockTimerStatHandle FTM_STATESORT("Sort Draw State");
+LLTrace::BlockTimerStatHandle FTM_PIPELINE("Pipeline");
+LLTrace::BlockTimerStatHandle FTM_CLIENT_COPY("Client Copy");
+LLTrace::BlockTimerStatHandle FTM_RENDER_DEFERRED("Deferred Shading");
+
+
+static LLTrace::BlockTimerStatHandle FTM_STATESORT_DRAWABLE("Sort Drawables");
+static LLTrace::BlockTimerStatHandle FTM_STATESORT_POSTSORT("Post Sort");
static LLStaticHashedString sTint("tint");
static LLStaticHashedString sAmbiance("ambiance");
@@ -429,17 +431,9 @@ bool addDeferredAttachments(LLRenderTarget& target)
LLPipeline::LLPipeline() :
mBackfaceCull(FALSE),
- mBatchCount(0),
mMatrixOpCount(0),
mTextureMatrixOps(0),
- mMaxBatchSize(0),
- mMinBatchSize(0),
- mMeanBatchSize(0),
- mTrianglesDrawn(0),
mNumVisibleNodes(0),
- mVerticesRelit(0),
- mLightingChanges(0),
- mGeometryChanges(0),
mNumVisibleFaces(0),
mInitialized(FALSE),
@@ -485,7 +479,7 @@ void LLPipeline::connectRefreshCachedSettingsSafe(const std::string name)
LLPointer<LLControlVariable> cntrl_ptr = gSavedSettings.getControl(name);
if ( cntrl_ptr.isNull() )
{
- llwarns << "Global setting name not found:" << name << llendl;
+ LL_WARNS() << "Global setting name not found:" << name << LL_ENDL;
}
else
{
@@ -498,6 +492,7 @@ void LLPipeline::init()
refreshCachedSettings();
gOctreeMaxCapacity = gSavedSettings.getU32("OctreeMaxNodeCapacity");
+ gOctreeMinSize = gSavedSettings.getF32("OctreeMinimumNodeSize");
sDynamicLOD = gSavedSettings.getBOOL("RenderDynamicLOD");
sRenderBump = gSavedSettings.getBOOL("RenderObjectBump");
sUseTriStrips = gSavedSettings.getBOOL("RenderUseTriStrips");
@@ -523,7 +518,6 @@ void LLPipeline::init()
getPool(LLDrawPool::POOL_MATERIALS);
getPool(LLDrawPool::POOL_GLOW);
- LLViewerStats::getInstance()->mTrianglesDrawnStat.reset();
resetFrameStats();
if (gSavedSettings.getBOOL("DisableAllRenderFeatures"))
@@ -709,11 +703,11 @@ void LLPipeline::cleanup()
if (!mTerrainPools.empty())
{
- llwarns << "Terrain Pools not cleaned up" << llendl;
+ LL_WARNS() << "Terrain Pools not cleaned up" << LL_ENDL;
}
if (!mTreePools.empty())
{
- llwarns << "Tree Pools not cleaned up" << llendl;
+ LL_WARNS() << "Tree Pools not cleaned up" << LL_ENDL;
}
delete mAlphaPool;
@@ -779,7 +773,7 @@ void LLPipeline::destroyGL()
}
}
-static LLFastTimer::DeclareTimer FTM_RESIZE_SCREEN_TEXTURE("Resize Screen Texture");
+static LLTrace::BlockTimerStatHandle FTM_RESIZE_SCREEN_TEXTURE("Resize Screen Texture");
//static
void LLPipeline::throttleNewMemoryAllocation(BOOL disable)
@@ -801,7 +795,7 @@ void LLPipeline::throttleNewMemoryAllocation(BOOL disable)
void LLPipeline::resizeScreenTexture()
{
- LLFastTimer ft(FTM_RESIZE_SCREEN_TEXTURE);
+ LL_RECORD_BLOCK_TIME(FTM_RESIZE_SCREEN_TEXTURE);
if (gPipeline.canUseVertexShaders() && assertInitialized())
{
GLuint resX = gViewerWindow->getWorldViewWidthRaw();
@@ -922,7 +916,7 @@ LLPipeline::eFBOStatus LLPipeline::doAllocateScreenBuffer(U32 resX, U32 resY)
releaseScreenBuffers();
}
- llwarns << "Unable to allocate screen buffer at any resolution!" << llendl;
+ LL_WARNS() << "Unable to allocate screen buffer at any resolution!" << LL_ENDL;
}
return ret;
@@ -964,7 +958,7 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
if (!mDeferredDepth.allocate(resX, resY, 0, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE, samples)) return false;
if (!mOcclusionDepth.allocate(resX/occlusion_divisor, resY/occlusion_divisor, 0, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE, samples)) return false;
if (!addDeferredAttachments(mDeferredScreen)) return false;
-
+
GLuint screenFormat = GL_RGBA16;
if (gGLManager.mIsATI)
{
@@ -1083,7 +1077,7 @@ void LLPipeline::updateRenderDeferred()
{
BOOL deferred = ((RenderDeferred &&
LLRenderTarget::sUseFBO &&
- LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") &&
+ LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") &&
LLPipeline::sRenderBump &&
VertexShaderEnable &&
RenderAvatarVP &&
@@ -1300,7 +1294,7 @@ void LLPipeline::createGLBuffers()
for (U32 i = 0; i < 3; i++)
{
- mGlow[i].allocate(512,glow_res, GL_RGBA,FALSE,FALSE);
+ mGlow[i].allocate(512,glow_res,GL_RGBA,FALSE,FALSE);
}
allocateScreenBuffer(resX,resY);
@@ -1362,49 +1356,10 @@ void LLPipeline::createLUTBuffers()
{
if (!mLightFunc)
{
- /*U32 lightResX = gSavedSettings.getU32("RenderSpecularResX");
- U32 lightResY = gSavedSettings.getU32("RenderSpecularResY");
- U8* ls = new U8[lightResX*lightResY];
- F32 specExp = gSavedSettings.getF32("RenderSpecularExponent");
- // Calculate the (normalized) Blinn-Phong specular lookup texture.
- for (U32 y = 0; y < lightResY; ++y)
- {
- for (U32 x = 0; x < lightResX; ++x)
- {
- ls[y*lightResX+x] = 0;
- F32 sa = (F32) x/(lightResX-1);
- F32 spec = (F32) y/(lightResY-1);
- F32 n = spec * spec * specExp;
-
- // Nothing special here. Just your typical blinn-phong term.
- spec = powf(sa, n);
-
- // Apply our normalization function.
- // Note: This is the full equation that applies the full normalization curve, not an approximation.
- // This is fine, given we only need to create our LUT once per buffer initialization.
- // The only trade off is we have a really low dynamic range.
- // This means we have to account for things not being able to exceed 0 to 1 in our shaders.
- spec *= (((n + 2) * (n + 4)) / (8 * F_PI * (powf(2, -n/2) + n)));
-
- // Always sample at a 1.0/2.2 curve.
- // This "Gamma corrects" our specular term, boosting our lower exponent reflections.
- spec = powf(spec, 1.f/2.2f);
-
- // Easy fix for our dynamic range problem: divide by 6 here, multiply by 6 in our shaders.
- // This allows for our specular term to exceed a value of 1 in our shaders.
- // This is something that can be important for energy conserving specular models where higher exponents can result in highlights that exceed a range of 0 to 1.
- // Technically, we could just use an R16F texture, but driver support for R16F textures can be somewhat spotty at times.
- // This works remarkably well for higher specular exponents, though banding can sometimes be seen on lower exponents.
- // Combined with a bit of noise and trilinear filtering, the banding is hardly noticable.
- ls[y*lightResX+x] = (U8)(llclamp(spec * (1.f / 6), 0.f, 1.f) * 255);
- }
- }*/
-
-
U32 lightResX = gSavedSettings.getU32("RenderSpecularResX");
U32 lightResY = gSavedSettings.getU32("RenderSpecularResY");
F32* ls = new F32[lightResX*lightResY];
- //F32 specExp = gSavedSettings.getF32("RenderSpecularExponent"); // Note: only use this when creating new specular lighting functions.
+ F32 specExp = gSavedSettings.getF32("RenderSpecularExponent");
// Calculate the (normalized) blinn-phong specular lookup texture. (with a few tweaks)
for (U32 y = 0; y < lightResY; ++y)
{
@@ -1413,7 +1368,7 @@ void LLPipeline::createLUTBuffers()
ls[y*lightResX+x] = 0;
F32 sa = (F32) x/(lightResX-1);
F32 spec = (F32) y/(lightResY-1);
- F32 n = spec * spec * 368;
+ F32 n = spec * spec * specExp;
// Nothing special here. Just your typical blinn-phong term.
spec = powf(sa, n);
@@ -1426,23 +1381,6 @@ void LLPipeline::createLUTBuffers()
// Since we use R16F, we no longer have a dynamic range issue we need to work around here.
// Though some older drivers may not like this, newer drivers shouldn't have this problem.
ls[y*lightResX+x] = spec;
-
-
- //beckmann distribution
- /*F32 alpha = acosf((F32) x/(lightResX-1));
- F32 m = 1.f - (F32) y/(lightResY-1);
-
- F32 cos4_alpha = cosf(alpha);
- cos4_alpha *= cos4_alpha;
- cos4_alpha *= cos4_alpha;
-
- F32 tan_alpha = tanf(alpha);
- F32 tan2_alpha = tan_alpha*tan_alpha;
-
- F32 k = expf(-(tan2_alpha)/(m*m)) /
- (3.14159f*m*m*cos4_alpha);
-
- ls[y*lightResX+x] = k;*/
}
}
@@ -1455,7 +1393,6 @@ void LLPipeline::createLUTBuffers()
LLImageGL::generateTextures(1, &mLightFunc);
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mLightFunc);
LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, pix_format, lightResX, lightResY, GL_RED, GL_FLOAT, ls, false);
- //LLImageGL::setManualImage(LLTexUnit::getInternalType(LLTexUnit::TT_TEXTURE), 0, GL_UNSIGNED_BYTE, lightResX, lightResY, GL_RED, GL_UNSIGNED_BYTE, ls, false);
gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP);
gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_TRILINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
@@ -1537,7 +1474,7 @@ void LLPipeline::unloadShaders()
void LLPipeline::assertInitializedDoError()
{
- llerrs << "LLPipeline used when uninitialized." << llendl;
+ LL_ERRS() << "LLPipeline used when uninitialized." << LL_ENDL;
}
//============================================================================
@@ -1580,18 +1517,18 @@ S32 LLPipeline::setLightingDetail(S32 level)
return mLightingDetail;
}
-class LLOctreeDirtyTexture : public LLOctreeTraveler<LLDrawable>
+class LLOctreeDirtyTexture : public OctreeTraveler
{
public:
const std::set<LLViewerFetchedTexture*>& mTextures;
LLOctreeDirtyTexture(const std::set<LLViewerFetchedTexture*>& textures) : mTextures(textures) { }
- virtual void visit(const LLOctreeNode<LLDrawable>* node)
+ virtual void visit(const OctreeNode* node)
{
LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0);
- if (!group->isState(LLSpatialGroup::GEOM_DIRTY) && !group->isEmpty())
+ if (!group->hasState(LLSpatialGroup::GEOM_DIRTY) && !group->isEmpty())
{
for (LLSpatialGroup::draw_map_t::iterator i = group->mDrawMap.begin(); i != group->mDrawMap.end(); ++i)
{
@@ -1722,7 +1659,7 @@ LLDrawPool *LLPipeline::findPool(const U32 type, LLViewerTexture *tex0)
default:
llassert(0);
- llerrs << "Invalid Pool Type in LLPipeline::findPool() type=" << type << llendl;
+ LL_ERRS() << "Invalid Pool Type in LLPipeline::findPool() type=" << type << LL_ENDL;
break;
}
@@ -1768,7 +1705,7 @@ U32 LLPipeline::getPoolTypeFromTE(const LLTextureEntry* te, LLViewerTexture* ima
{
alpha = alpha || (imagep->getComponents() == 4 && imagep->getType() != LLViewerTexture::MEDIA_TEXTURE) || (imagep->getComponents() == 2);
}
-
+
if (alpha && mat)
{
switch (mat->getDiffuseAlphaMode())
@@ -1814,11 +1751,9 @@ void LLPipeline::addPool(LLDrawPool *new_poolp)
void LLPipeline::allocDrawable(LLViewerObject *vobj)
{
- LLDrawable *drawable = new LLDrawable();
+ LLDrawable *drawable = new LLDrawable(vobj);
vobj->mDrawable = drawable;
- drawable->mVObjp = vobj;
-
//encompass completely sheared objects by taking
//the most extreme point possible (<1,1,0.5>)
drawable->setRadius(LLVector3(1,1,0.5f).scaleVec(vobj->getScale()).length());
@@ -1830,15 +1765,15 @@ void LLPipeline::allocDrawable(LLViewerObject *vobj)
}
-static LLFastTimer::DeclareTimer FTM_UNLINK("Unlink");
-static LLFastTimer::DeclareTimer FTM_REMOVE_FROM_MOVE_LIST("Movelist");
-static LLFastTimer::DeclareTimer FTM_REMOVE_FROM_SPATIAL_PARTITION("Spatial Partition");
-static LLFastTimer::DeclareTimer FTM_REMOVE_FROM_LIGHT_SET("Light Set");
-static LLFastTimer::DeclareTimer FTM_REMOVE_FROM_HIGHLIGHT_SET("Highlight Set");
+static LLTrace::BlockTimerStatHandle FTM_UNLINK("Unlink");
+static LLTrace::BlockTimerStatHandle FTM_REMOVE_FROM_MOVE_LIST("Movelist");
+static LLTrace::BlockTimerStatHandle FTM_REMOVE_FROM_SPATIAL_PARTITION("Spatial Partition");
+static LLTrace::BlockTimerStatHandle FTM_REMOVE_FROM_LIGHT_SET("Light Set");
+static LLTrace::BlockTimerStatHandle FTM_REMOVE_FROM_HIGHLIGHT_SET("Highlight Set");
void LLPipeline::unlinkDrawable(LLDrawable *drawable)
{
- LLFastTimer t(FTM_UNLINK);
+ LL_RECORD_BLOCK_TIME(FTM_UNLINK);
assertInitialized();
@@ -1847,7 +1782,7 @@ void LLPipeline::unlinkDrawable(LLDrawable *drawable)
// Based on flags, remove the drawable from the queues that it's on.
if (drawablep->isState(LLDrawable::ON_MOVE_LIST))
{
- LLFastTimer t(FTM_REMOVE_FROM_MOVE_LIST);
+ LL_RECORD_BLOCK_TIME(FTM_REMOVE_FROM_MOVE_LIST);
LLDrawable::drawable_vector_t::iterator iter = std::find(mMovedList.begin(), mMovedList.end(), drawablep);
if (iter != mMovedList.end())
{
@@ -1857,19 +1792,19 @@ void LLPipeline::unlinkDrawable(LLDrawable *drawable)
if (drawablep->getSpatialGroup())
{
- LLFastTimer t(FTM_REMOVE_FROM_SPATIAL_PARTITION);
- if (!drawablep->getSpatialGroup()->mSpatialPartition->remove(drawablep, drawablep->getSpatialGroup()))
+ LL_RECORD_BLOCK_TIME(FTM_REMOVE_FROM_SPATIAL_PARTITION);
+ if (!drawablep->getSpatialGroup()->getSpatialPartition()->remove(drawablep, drawablep->getSpatialGroup()))
{
#ifdef LL_RELEASE_FOR_DOWNLOAD
- llwarns << "Couldn't remove object from spatial group!" << llendl;
+ LL_WARNS() << "Couldn't remove object from spatial group!" << LL_ENDL;
#else
- llerrs << "Couldn't remove object from spatial group!" << llendl;
+ LL_ERRS() << "Couldn't remove object from spatial group!" << LL_ENDL;
#endif
}
}
{
- LLFastTimer t(FTM_REMOVE_FROM_LIGHT_SET);
+ LL_RECORD_BLOCK_TIME(FTM_REMOVE_FROM_LIGHT_SET);
mLights.erase(drawablep);
for (light_set_t::iterator iter = mNearbyLights.begin();
@@ -1884,7 +1819,7 @@ void LLPipeline::unlinkDrawable(LLDrawable *drawable)
}
{
- LLFastTimer t(FTM_REMOVE_FROM_HIGHLIGHT_SET);
+ LL_RECORD_BLOCK_TIME(FTM_REMOVE_FROM_HIGHLIGHT_SET);
HighlightItem item(drawablep);
mHighlightSet.erase(item);
@@ -1913,7 +1848,7 @@ void LLPipeline::unlinkDrawable(LLDrawable *drawable)
//static
void LLPipeline::removeMutedAVsLights(LLVOAvatar* muted_avatar)
{
- LLFastTimer t(FTM_REMOVE_FROM_LIGHT_SET);
+ LL_RECORD_BLOCK_TIME(FTM_REMOVE_FROM_LIGHT_SET);
for (light_set_t::iterator iter = gPipeline.mNearbyLights.begin();
iter != gPipeline.mNearbyLights.end(); iter++)
{
@@ -1941,7 +1876,7 @@ U32 LLPipeline::addObject(LLViewerObject *vobj)
void LLPipeline::createObjects(F32 max_dtime)
{
- LLFastTimer ftm(FTM_PIPELINE_CREATE);
+ LL_RECORD_BLOCK_TIME(FTM_PIPELINE_CREATE);
LLTimer update_timer;
@@ -1973,7 +1908,7 @@ void LLPipeline::createObject(LLViewerObject* vobj)
}
else
{
- llerrs << "Redundant drawable creation!" << llendl;
+ LL_ERRS() << "Redundant drawable creation!" << LL_ENDL;
}
llassert(drawablep);
@@ -2004,17 +1939,7 @@ void LLPipeline::resetFrameStats()
{
assertInitialized();
- LLViewerStats::getInstance()->mTrianglesDrawnStat.addValue(mTrianglesDrawn/1000.f);
-
- if (mBatchCount > 0)
- {
- mMeanBatchSize = gPipeline.mTrianglesDrawn/gPipeline.mBatchCount;
- }
- mTrianglesDrawn = 0;
sCompiles = 0;
- mVerticesRelit = 0;
- mLightingChanges = 0;
- mGeometryChanges = 0;
mNumVisibleFaces = 0;
if (mOldRenderDebugMask != mRenderDebugMask)
@@ -2022,7 +1947,6 @@ void LLPipeline::resetFrameStats()
gObjectList.clearDebugText();
mOldRenderDebugMask = mRenderDebugMask;
}
-
}
//external functions for asynchronous updating
@@ -2034,7 +1958,7 @@ void LLPipeline::updateMoveDampedAsync(LLDrawable* drawablep)
}
if (!drawablep)
{
- llerrs << "updateMove called with NULL drawablep" << llendl;
+ LL_ERRS() << "updateMove called with NULL drawablep" << LL_ENDL;
return;
}
if (drawablep->isState(LLDrawable::EARLY_MOVE))
@@ -2064,7 +1988,7 @@ void LLPipeline::updateMoveNormalAsync(LLDrawable* drawablep)
}
if (!drawablep)
{
- llerrs << "updateMove called with NULL drawablep" << llendl;
+ LL_ERRS() << "updateMove called with NULL drawablep" << LL_ENDL;
return;
}
if (drawablep->isState(LLDrawable::EARLY_MOVE))
@@ -2121,12 +2045,14 @@ void LLPipeline::updateMovedList(LLDrawable::drawable_vector_t& moved_list)
}
}
-static LLFastTimer::DeclareTimer FTM_OCTREE_BALANCE("Balance Octree");
-static LLFastTimer::DeclareTimer FTM_UPDATE_MOVE("Update Move");
+static LLTrace::BlockTimerStatHandle FTM_OCTREE_BALANCE("Balance Octree");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_MOVE("Update Move");
+static LLTrace::BlockTimerStatHandle FTM_RETEXTURE("Retexture");
+static LLTrace::BlockTimerStatHandle FTM_MOVED_LIST("Moved List");
void LLPipeline::updateMove()
{
- LLFastTimer t(FTM_UPDATE_MOVE);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_MOVE);
if (FreezeTime)
{
@@ -2136,8 +2062,7 @@ void LLPipeline::updateMove()
assertInitialized();
{
- static LLFastTimer::DeclareTimer ftm("Retexture");
- LLFastTimer t(ftm);
+ LL_RECORD_BLOCK_TIME(FTM_RETEXTURE);
for (LLDrawable::drawable_set_t::iterator iter = mRetexturedList.begin();
iter != mRetexturedList.end(); ++iter)
@@ -2152,14 +2077,13 @@ void LLPipeline::updateMove()
}
{
- static LLFastTimer::DeclareTimer ftm("Moved List");
- LLFastTimer t(ftm);
+ LL_RECORD_BLOCK_TIME(FTM_MOVED_LIST);
updateMovedList(mMovedList);
}
//balance octrees
{
- LLFastTimer ot(FTM_OCTREE_BALANCE);
+ LL_RECORD_BLOCK_TIME(FTM_OCTREE_BALANCE);
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
@@ -2173,6 +2097,13 @@ void LLPipeline::updateMove()
part->mOctree->balance();
}
}
+
+ //balance the VO Cache tree
+ LLVOCachePartition* vo_part = region->getVOCachePartition();
+ if(vo_part)
+ {
+ vo_part->mOctree->balance();
+ }
}
}
}
@@ -2242,9 +2173,9 @@ void check_references(LLSpatialGroup* group, LLDrawable* drawable)
{
for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
{
- if (drawable == *i)
+ if (drawable == (LLDrawable*)(*i)->getDrawable())
{
- llerrs << "LLDrawable deleted while actively reference by LLPipeline." << llendl;
+ LL_ERRS() << "LLDrawable deleted while actively reference by LLPipeline." << LL_ENDL;
}
}
}
@@ -2255,7 +2186,7 @@ void check_references(LLDrawable* drawable, LLFace* face)
{
if (drawable->getFace(i) == face)
{
- llerrs << "LLFace deleted while actively referenced by LLPipeline." << llendl;
+ LL_ERRS() << "LLFace deleted while actively referenced by LLPipeline." << LL_ENDL;
}
}
}
@@ -2264,10 +2195,13 @@ void check_references(LLSpatialGroup* group, LLFace* face)
{
for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
{
- LLDrawable* drawable = *i;
+ LLDrawable* drawable = (LLDrawable*)(*i)->getDrawable();
+ if(drawable)
+ {
check_references(drawable, face);
}
}
+}
void LLPipeline::checkReferences(LLFace* face)
{
@@ -2328,7 +2262,7 @@ void LLPipeline::checkReferences(LLDrawable* drawable)
{
if (drawable == *iter)
{
- llerrs << "LLDrawable deleted while actively referenced by LLPipeline." << llendl;
+ LL_ERRS() << "LLDrawable deleted while actively referenced by LLPipeline." << LL_ENDL;
}
}
}
@@ -2345,7 +2279,7 @@ void check_references(LLSpatialGroup* group, LLDrawInfo* draw_info)
LLDrawInfo* params = *j;
if (params == draw_info)
{
- llerrs << "LLDrawInfo deleted while actively referenced by LLPipeline." << llendl;
+ LL_ERRS() << "LLDrawInfo deleted while actively referenced by LLPipeline." << LL_ENDL;
}
}
}
@@ -2387,7 +2321,7 @@ void LLPipeline::checkReferences(LLSpatialGroup* group)
{
if (group == *iter)
{
- llerrs << "LLSpatialGroup deleted while actively referenced by LLPipeline." << llendl;
+ LL_ERRS() << "LLSpatialGroup deleted while actively referenced by LLPipeline." << LL_ENDL;
}
}
@@ -2395,7 +2329,7 @@ void LLPipeline::checkReferences(LLSpatialGroup* group)
{
if (group == *iter)
{
- llerrs << "LLSpatialGroup deleted while actively referenced by LLPipeline." << llendl;
+ LL_ERRS() << "LLSpatialGroup deleted while actively referenced by LLPipeline." << LL_ENDL;
}
}
@@ -2403,7 +2337,7 @@ void LLPipeline::checkReferences(LLSpatialGroup* group)
{
if (group == *iter)
{
- llerrs << "LLSpatialGroup deleted while actively referenced by LLPipeline." << llendl;
+ LL_ERRS() << "LLSpatialGroup deleted while actively referenced by LLPipeline." << LL_ENDL;
}
}
}
@@ -2444,7 +2378,7 @@ BOOL LLPipeline::getVisibleExtents(LLCamera& camera, LLVector3& min, LLVector3&
min = LLVector3(X,X,X);
max = LLVector3(-X,-X,-X);
- U32 saved_camera_id = LLViewerCamera::sCurCameraID;
+ LLViewerCamera::eCameraID saved_camera_id = LLViewerCamera::sCurCameraID;
LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
BOOL res = TRUE;
@@ -2475,11 +2409,16 @@ BOOL LLPipeline::getVisibleExtents(LLCamera& camera, LLVector3& min, LLVector3&
return res;
}
-static LLFastTimer::DeclareTimer FTM_CULL("Object Culling");
+static LLTrace::BlockTimerStatHandle FTM_CULL("Object Culling");
void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_clip, LLPlane* planep)
{
- LLFastTimer t(FTM_CULL);
+ static LLCachedControl<bool> use_occlusion(gSavedSettings,"UseOcclusion");
+ static bool can_use_occlusion = LLGLSLShader::sNoFixedFunction
+ && LLFeatureManager::getInstance()->isFeatureAvailable("UseOcclusion")
+ && gGLManager.mHasOcclusionQuery;
+
+ LL_RECORD_BLOCK_TIME(FTM_CULL);
grabReferences(result);
@@ -2596,6 +2535,14 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl
}
}
}
+
+ //scan the VO Cache tree
+ LLVOCachePartition* vo_part = region->getVOCachePartition();
+ if(vo_part)
+ {
+ bool do_occlusion_cull = can_use_occlusion && use_occlusion && !gUseWireframe/* && !gViewerWindow->getProgressView()->getVisible()*/;
+ vo_part->cull(camera, do_occlusion_cull);
+ }
}
if (bound_shader)
@@ -2670,15 +2617,16 @@ void LLPipeline::markNotCulled(LLSpatialGroup* group, LLCamera& camera)
return;
}
+ const LLVector4a* bounds = group->getBounds();
if (sMinRenderSize > 0.f &&
- llmax(llmax(group->mBounds[1][0], group->mBounds[1][1]), group->mBounds[1][2]) < sMinRenderSize)
+ llmax(llmax(bounds[1][0], bounds[1][1]), bounds[1][2]) < sMinRenderSize)
{
return;
}
assertInitialized();
- if (!group->mSpatialPartition->mRenderByGroup)
+ if (!group->getSpatialPartition()->mRenderByGroup)
{ //render by drawable
sCull->pushDrawableGroup(group);
}
@@ -2782,7 +2730,8 @@ void LLPipeline::doOcclusion(LLCamera& camera, LLRenderTarget& source, LLRenderT
void LLPipeline::doOcclusion(LLCamera& camera)
{
- if (LLPipeline::sUseOcclusion > 1 && sCull->hasOcclusionGroups())
+ if (LLPipeline::sUseOcclusion > 1 && !LLSpatialPartition::sTeleportRequested &&
+ (sCull->hasOcclusionGroups() || LLVOCachePartition::sNeedsOcclusionCheck))
{
LLVertexBuffer::unbind();
@@ -2828,6 +2777,17 @@ void LLPipeline::doOcclusion(LLCamera& camera)
group->clearOcclusionState(LLSpatialGroup::ACTIVE_OCCLUSION);
}
+ //apply occlusion culling to object cache tree
+ for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
+ iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
+ {
+ LLVOCachePartition* vo_part = (*iter)->getVOCachePartition();
+ if(vo_part)
+ {
+ vo_part->processOccluders(&camera);
+ }
+ }
+
if (bind_shader)
{
if (LLPipeline::sShadowRender)
@@ -2850,19 +2810,18 @@ BOOL LLPipeline::updateDrawableGeom(LLDrawable* drawablep, BOOL priority)
if (update_complete && assertInitialized())
{
drawablep->setState(LLDrawable::BUILT);
- mGeometryChanges++;
}
return update_complete;
}
-static LLFastTimer::DeclareTimer FTM_SEED_VBO_POOLS("Seed VBO Pool");
+static LLTrace::BlockTimerStatHandle FTM_SEED_VBO_POOLS("Seed VBO Pool");
-static LLFastTimer::DeclareTimer FTM_UPDATE_GL("Update GL");
+static LLTrace::BlockTimerStatHandle FTM_UPDATE_GL("Update GL");
void LLPipeline::updateGL()
{
{
- LLFastTimer t(FTM_UPDATE_GL);
+ LL_RECORD_BLOCK_TIME(FTM_UPDATE_GL);
while (!LLGLUpdate::sGLQ.empty())
{
LLGLUpdate* glu = LLGLUpdate::sGLQ.front();
@@ -2873,12 +2832,12 @@ void LLPipeline::updateGL()
}
{ //seed VBO Pools
- LLFastTimer t(FTM_SEED_VBO_POOLS);
+ LL_RECORD_BLOCK_TIME(FTM_SEED_VBO_POOLS);
LLVertexBuffer::seedPools();
}
}
-static LLFastTimer::DeclareTimer FTM_REBUILD_PRIORITY_GROUPS("Rebuild Priority Groups");
+static LLTrace::BlockTimerStatHandle FTM_REBUILD_PRIORITY_GROUPS("Rebuild Priority Groups");
void LLPipeline::clearRebuildGroups()
{
@@ -2938,9 +2897,55 @@ void LLPipeline::clearRebuildGroups()
mGroupQ2Locked = false;
}
+void LLPipeline::clearRebuildDrawables()
+{
+ // Clear all drawables on the priority build queue,
+ for (LLDrawable::drawable_list_t::iterator iter = mBuildQ1.begin();
+ iter != mBuildQ1.end(); ++iter)
+ {
+ LLDrawable* drawablep = *iter;
+ if (drawablep && !drawablep->isDead())
+ {
+ drawablep->clearState(LLDrawable::IN_REBUILD_Q2);
+ drawablep->clearState(LLDrawable::IN_REBUILD_Q1);
+ }
+ }
+ mBuildQ1.clear();
+
+ // clear drawables on the non-priority build queue
+ for (LLDrawable::drawable_list_t::iterator iter = mBuildQ2.begin();
+ iter != mBuildQ2.end(); ++iter)
+ {
+ LLDrawable* drawablep = *iter;
+ if (!drawablep->isDead())
+ {
+ drawablep->clearState(LLDrawable::IN_REBUILD_Q2);
+ }
+ }
+ mBuildQ2.clear();
+
+ //clear all moving bridges
+ for (LLDrawable::drawable_vector_t::iterator iter = mMovedBridge.begin();
+ iter != mMovedBridge.end(); ++iter)
+ {
+ LLDrawable *drawablep = *iter;
+ drawablep->clearState(LLDrawable::EARLY_MOVE | LLDrawable::MOVE_UNDAMPED | LLDrawable::ON_MOVE_LIST | LLDrawable::ANIMATED_CHILD);
+ }
+ mMovedBridge.clear();
+
+ //clear all moving drawables
+ for (LLDrawable::drawable_vector_t::iterator iter = mMovedList.begin();
+ iter != mMovedList.end(); ++iter)
+ {
+ LLDrawable *drawablep = *iter;
+ drawablep->clearState(LLDrawable::EARLY_MOVE | LLDrawable::MOVE_UNDAMPED | LLDrawable::ON_MOVE_LIST | LLDrawable::ANIMATED_CHILD);
+ }
+ mMovedList.clear();
+}
+
void LLPipeline::rebuildPriorityGroups()
{
- LLFastTimer t(FTM_REBUILD_PRIORITY_GROUPS);
+ LL_RECORD_BLOCK_TIME(FTM_REBUILD_PRIORITY_GROUPS);
LLTimer update_timer;
assertInitialized();
@@ -2962,7 +2967,7 @@ void LLPipeline::rebuildPriorityGroups()
}
-static LLFastTimer::DeclareTimer FTM_REBUILD_GROUPS("Rebuild Groups");
+static LLTrace::BlockTimerStatHandle FTM_REBUILD_GROUPS("Rebuild Groups");
void LLPipeline::rebuildGroups()
{
@@ -2971,7 +2976,7 @@ void LLPipeline::rebuildGroups()
return;
}
- LLFastTimer t(FTM_REBUILD_GROUPS);
+ LL_RECORD_BLOCK_TIME(FTM_REBUILD_GROUPS);
mGroupQ2Locked = true;
// Iterate through some drawables on the non-priority build queue
S32 size = (S32) mGroupQ2.size();
@@ -2994,7 +2999,7 @@ void LLPipeline::rebuildGroups()
{
group->rebuildGeom();
- if (group->mSpatialPartition->mRenderByGroup)
+ if (group->getSpatialPartition()->mRenderByGroup)
{
count++;
}
@@ -3015,7 +3020,7 @@ void LLPipeline::updateGeom(F32 max_dtime)
LLTimer update_timer;
LLPointer<LLDrawable> drawablep;
- LLFastTimer t(FTM_GEO_UPDATE);
+ LL_RECORD_BLOCK_TIME(FTM_GEO_UPDATE);
assertInitialized();
@@ -3063,7 +3068,7 @@ void LLPipeline::updateGeom(F32 max_dtime)
S32 count = 0;
- max_dtime = llmax(update_timer.getElapsedTimeF32()+0.001f, max_dtime);
+ max_dtime = llmax(update_timer.getElapsedTimeF32()+0.001f, F32SecondsImplicit(max_dtime));
LLSpatialGroup* last_group = NULL;
LLSpatialBridge* last_bridge = NULL;
@@ -3147,13 +3152,13 @@ void LLPipeline::markMoved(LLDrawable *drawablep, BOOL damped_motion)
{
if (!drawablep)
{
- //llerrs << "Sending null drawable to moved list!" << llendl;
+ //LL_ERRS() << "Sending null drawable to moved list!" << LL_ENDL;
return;
}
if (drawablep->isDead())
{
- llwarns << "Marking NULL or dead drawable moved!" << llendl;
+ LL_WARNS() << "Marking NULL or dead drawable moved!" << LL_ENDL;
return;
}
@@ -3208,9 +3213,9 @@ void LLPipeline::markShift(LLDrawable *drawablep)
}
}
-static LLFastTimer::DeclareTimer FTM_SHIFT_DRAWABLE("Shift Drawable");
-static LLFastTimer::DeclareTimer FTM_SHIFT_OCTREE("Shift Octree");
-static LLFastTimer::DeclareTimer FTM_SHIFT_HUD("Shift HUD");
+static LLTrace::BlockTimerStatHandle FTM_SHIFT_DRAWABLE("Shift Drawable");
+static LLTrace::BlockTimerStatHandle FTM_SHIFT_OCTREE("Shift Octree");
+static LLTrace::BlockTimerStatHandle FTM_SHIFT_HUD("Shift HUD");
void LLPipeline::shiftObjects(const LLVector3 &offset)
{
@@ -3223,7 +3228,7 @@ void LLPipeline::shiftObjects(const LLVector3 &offset)
offseta.load3(offset.mV);
{
- LLFastTimer t(FTM_SHIFT_DRAWABLE);
+ LL_RECORD_BLOCK_TIME(FTM_SHIFT_DRAWABLE);
for (LLDrawable::drawable_vector_t::iterator iter = mShiftList.begin();
iter != mShiftList.end(); iter++)
@@ -3241,7 +3246,7 @@ void LLPipeline::shiftObjects(const LLVector3 &offset)
{
- LLFastTimer t(FTM_SHIFT_OCTREE);
+ LL_RECORD_BLOCK_TIME(FTM_SHIFT_OCTREE);
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
{
@@ -3258,7 +3263,7 @@ void LLPipeline::shiftObjects(const LLVector3 &offset)
}
{
- LLFastTimer t(FTM_SHIFT_HUD);
+ LL_RECORD_BLOCK_TIME(FTM_SHIFT_HUD);
LLHUDText::shiftAll(offset);
LLHUDNameTag::shiftAll(offset);
}
@@ -3292,10 +3297,10 @@ void LLPipeline::markPartitionMove(LLDrawable* drawable)
}
}
-static LLFastTimer::DeclareTimer FTM_PROCESS_PARTITIONQ("PartitionQ");
+static LLTrace::BlockTimerStatHandle FTM_PROCESS_PARTITIONQ("PartitionQ");
void LLPipeline::processPartitionQ()
{
- LLFastTimer t(FTM_PROCESS_PARTITIONQ);
+ LL_RECORD_BLOCK_TIME(FTM_PROCESS_PARTITIONQ);
for (LLDrawable::drawable_list_t::iterator iter = mPartitionQ.begin(); iter != mPartitionQ.end(); ++iter)
{
LLDrawable* drawable = *iter;
@@ -3317,23 +3322,23 @@ void LLPipeline::markMeshDirty(LLSpatialGroup* group)
void LLPipeline::markRebuild(LLSpatialGroup* group, BOOL priority)
{
- if (group && !group->isDead() && group->mSpatialPartition)
+ if (group && !group->isDead() && group->getSpatialPartition())
{
- if (group->mSpatialPartition->mPartitionType == LLViewerRegion::PARTITION_HUD)
+ if (group->getSpatialPartition()->mPartitionType == LLViewerRegion::PARTITION_HUD)
{
priority = TRUE;
}
if (priority)
{
- if (!group->isState(LLSpatialGroup::IN_BUILD_Q1))
+ if (!group->hasState(LLSpatialGroup::IN_BUILD_Q1))
{
llassert_always(!mGroupQ1Locked);
mGroupQ1.push_back(group);
group->setState(LLSpatialGroup::IN_BUILD_Q1);
- if (group->isState(LLSpatialGroup::IN_BUILD_Q2))
+ if (group->hasState(LLSpatialGroup::IN_BUILD_Q2))
{
LLSpatialGroup::sg_vector_t::iterator iter = std::find(mGroupQ2.begin(), mGroupQ2.end(), group);
if (iter != mGroupQ2.end())
@@ -3344,7 +3349,7 @@ void LLPipeline::markRebuild(LLSpatialGroup* group, BOOL priority)
}
}
}
- else if (!group->isState(LLSpatialGroup::IN_BUILD_Q2 | LLSpatialGroup::IN_BUILD_Q1))
+ else if (!group->hasState(LLSpatialGroup::IN_BUILD_Q2 | LLSpatialGroup::IN_BUILD_Q1))
{
llassert_always(!mGroupQ2Locked);
mGroupQ2.push_back(group);
@@ -3383,7 +3388,7 @@ void LLPipeline::markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags f
}
}
-static LLFastTimer::DeclareTimer FTM_RESET_DRAWORDER("Reset Draw Order");
+static LLTrace::BlockTimerStatHandle FTM_RESET_DRAWORDER("Reset Draw Order");
void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result)
{
@@ -3397,11 +3402,11 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result)
LLPipeline::END_RENDER_TYPES))
{
//clear faces from face pools
- LLFastTimer t(FTM_RESET_DRAWORDER);
+ LL_RECORD_BLOCK_TIME(FTM_RESET_DRAWORDER);
gPipeline.resetDrawOrders();
}
- LLFastTimer ftm(FTM_STATESORT);
+ LL_RECORD_BLOCK_TIME(FTM_STATESORT);
//LLVertexBuffer::unbind();
@@ -3419,7 +3424,7 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result)
group->setVisible();
for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
{
- markVisible(*i, camera);
+ markVisible((LLDrawable*)(*i)->getDrawable(), camera);
}
if (!sDelayVBUpdate)
@@ -3485,7 +3490,7 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result)
}
{
- LLFastTimer ftm(FTM_STATESORT_DRAWABLE);
+ LL_RECORD_BLOCK_TIME(FTM_STATESORT_DRAWABLE);
for (LLCullResult::drawable_iterator iter = sCull->beginVisibleList();
iter != sCull->endVisibleList(); ++iter)
{
@@ -3506,8 +3511,7 @@ void LLPipeline::stateSort(LLSpatialGroup* group, LLCamera& camera)
{
for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i)
{
- LLDrawable* drawablep = *i;
- stateSort(drawablep, camera);
+ stateSort((LLDrawable*)(*i)->getDrawable(), camera);
}
if (LLViewerCamera::sCurCameraID == LLViewerCamera::CAMERA_WORLD)
@@ -3608,7 +3612,6 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera)
}
}
-
mNumVisibleFaces += drawablep->getNumFaces();
}
@@ -3621,7 +3624,10 @@ void forAllDrawables(LLCullResult::sg_iterator begin,
{
for (LLSpatialGroup::element_iter j = (*i)->getDataBegin(); j != (*i)->getDataEnd(); ++j)
{
- func(*j);
+ if((*j)->hasDrawable())
+ {
+ func((LLDrawable*)(*j)->getDrawable());
+ }
}
}
}
@@ -3814,11 +3820,11 @@ void renderSoundHighlights(LLDrawable* drawablep)
void LLPipeline::postSort(LLCamera& camera)
{
- LLFastTimer ftm(FTM_STATESORT_POSTSORT);
+ LL_RECORD_BLOCK_TIME(FTM_STATESORT_POSTSORT);
assertInitialized();
- llpushcallstacks ;
+ LL_PUSH_CALLSTACKS();
//rebuild drawable geometry
for (LLCullResult::sg_iterator i = sCull->beginDrawableGroups(); i != sCull->endDrawableGroups(); ++i)
{
@@ -3829,12 +3835,12 @@ void LLPipeline::postSort(LLCamera& camera)
group->rebuildGeom();
}
}
- llpushcallstacks ;
+ LL_PUSH_CALLSTACKS();
//rebuild groups
sCull->assertDrawMapsEmpty();
rebuildPriorityGroups();
- llpushcallstacks ;
+ LL_PUSH_CALLSTACKS();
//build render map
@@ -3849,7 +3855,7 @@ void LLPipeline::postSort(LLCamera& camera)
continue;
}
- if (group->isState(LLSpatialGroup::NEW_DRAWINFO) && group->isState(LLSpatialGroup::GEOM_DIRTY))
+ if (group->hasState(LLSpatialGroup::NEW_DRAWINFO) && group->hasState(LLSpatialGroup::GEOM_DIRTY))
{ //no way this group is going to be drawable without a rebuild
group->rebuildGeom();
}
@@ -3887,7 +3893,7 @@ void LLPipeline::postSort(LLCamera& camera)
if (alpha != group->mDrawMap.end())
{ //store alpha groups for sorting
- LLSpatialBridge* bridge = group->mSpatialPartition->asBridge();
+ LLSpatialBridge* bridge = group->getSpatialPartition()->asBridge();
if (LLViewerCamera::sCurCameraID == LLViewerCamera::CAMERA_WORLD)
{
if (bridge)
@@ -3945,7 +3951,7 @@ void LLPipeline::postSort(LLCamera& camera)
std::sort(sCull->beginAlphaGroups(), sCull->endAlphaGroups(), LLSpatialGroup::CompareDepthGreater());
}
- llpushcallstacks ;
+ LL_PUSH_CALLSTACKS();
// only render if the flag is set. The flag is only set if we are in edit mode or the toggle is set in the menus
if (LLFloaterReg::instanceVisible("beacons") && !sShadowRender)
{
@@ -3998,7 +4004,7 @@ void LLPipeline::postSort(LLCamera& camera)
forAllVisibleDrawables(renderSoundHighlights);
}
}
- llpushcallstacks ;
+ LL_PUSH_CALLSTACKS();
// If managing your telehub, draw beacons at telehub and currently selected spawnpoint.
if (LLFloaterTelehub::renderBeacons())
{
@@ -4033,41 +4039,14 @@ void LLPipeline::postSort(LLCamera& camera)
}
}
- /*static LLFastTimer::DeclareTimer FTM_TRANSFORM_WAIT("Transform Fence");
- static LLFastTimer::DeclareTimer FTM_TRANSFORM_DO_WORK("Transform Work");
- if (use_transform_feedback)
- { //using transform feedback, wait for transform feedback to complete
- LLFastTimer t(FTM_TRANSFORM_WAIT);
-
- S32 done = 0;
- //glGetQueryivARB(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, GL_CURRENT_QUERY, &count);
-
- glGetQueryObjectivARB(mMeshDirtyQueryObject, GL_QUERY_RESULT_AVAILABLE, &done);
-
- while (!done)
- {
- {
- LLFastTimer t(FTM_TRANSFORM_DO_WORK);
- F32 max_time = llmin(gFrameIntervalSeconds*10.f, 1.f);
- //do some useful work while we wait
- LLAppViewer::getTextureCache()->update(max_time); // unpauses the texture cache thread
- LLAppViewer::getImageDecodeThread()->update(max_time); // unpauses the image thread
- LLAppViewer::getTextureFetch()->update(max_time); // unpauses the texture fetch thread
- }
- glGetQueryObjectivARB(mMeshDirtyQueryObject, GL_QUERY_RESULT_AVAILABLE, &done);
- }
-
- mTransformFeedbackPrimitives = 0;
- }*/
-
//LLSpatialGroup::sNoDelete = FALSE;
- llpushcallstacks ;
+ LL_PUSH_CALLSTACKS();
}
void render_hud_elements()
{
- LLFastTimer t(FTM_RENDER_UI);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_UI);
gPipeline.disableLights();
LLGLDisable fog(GL_FOG);
@@ -4234,9 +4213,9 @@ void LLPipeline::renderHighlights()
}
if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED) && !mFaceSelectImagep)
- {
- mFaceSelectImagep = LLViewerTextureManager::getFetchedTexture(IMG_FACE_SELECT);
- }
+ {
+ mFaceSelectImagep = LLViewerTextureManager::getFetchedTexture(IMG_FACE_SELECT);
+ }
if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED) && (sRenderHighlightTextureChannel == LLRender::DIFFUSE_MAP))
{
@@ -4249,14 +4228,14 @@ void LLPipeline::renderHighlights()
LLFace *facep = mSelectedFaces[i];
if (!facep || facep->getDrawable()->isDead())
{
- llerrs << "Bad face on selection" << llendl;
+ LL_ERRS() << "Bad face on selection" << LL_ENDL;
return;
}
facep->renderSelected(mFaceSelectImagep, color);
}
}
-
+
if (hasRenderDebugFeatureMask(RENDER_DEBUG_FEATURE_SELECTED))
{
// Paint 'em red!
@@ -4297,7 +4276,7 @@ void LLPipeline::renderHighlights()
LLFace *facep = mSelectedFaces[i];
if (!facep || facep->getDrawable()->isDead())
{
- llerrs << "Bad face on selection" << llendl;
+ LL_ERRS() << "Bad face on selection" << LL_ENDL;
return;
}
@@ -4327,7 +4306,7 @@ void LLPipeline::renderHighlights()
LLFace *facep = mSelectedFaces[i];
if (!facep || facep->getDrawable()->isDead())
{
- llerrs << "Bad face on selection" << llendl;
+ LL_ERRS() << "Bad face on selection" << LL_ENDL;
return;
}
@@ -4346,7 +4325,7 @@ U32 LLPipeline::sCurRenderPoolType = 0 ;
void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
{
- LLFastTimer t(FTM_RENDER_GEOMETRY);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_GEOMETRY);
assertInitialized();
@@ -4381,7 +4360,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
{
if (!verify())
{
- llerrs << "Pipeline verification failed!" << llendl;
+ LL_ERRS() << "Pipeline verification failed!" << LL_ENDL;
}
}
@@ -4433,7 +4412,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
}
{
- LLFastTimer t(FTM_POOLS);
+ LL_RECORD_BLOCK_TIME(FTM_POOLS);
// HACK: don't calculate local lights if we're rendering the HUD!
// Removing this check will cause bad flickering when there are
@@ -4469,7 +4448,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
pool_set_t::iterator iter2 = iter1;
if (hasRenderType(poolp->getType()) && poolp->getNumPasses() > 0)
{
- LLFastTimer t(FTM_POOLRENDER);
+ LL_RECORD_BLOCK_TIME(FTM_POOLRENDER);
gGLLastMatrix = NULL;
gGL.loadMatrix(gGLModelView);
@@ -4598,9 +4577,9 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera)
{
LLAppViewer::instance()->pingMainloopTimeout("Pipeline:RenderGeomDeferred");
- LLFastTimer t(FTM_RENDER_GEOMETRY);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_GEOMETRY);
- LLFastTimer t2(FTM_DEFERRED_POOLS);
+ LL_RECORD_BLOCK_TIME(FTM_DEFERRED_POOLS);
LLGLEnable cull(GL_CULL_FACE);
@@ -4642,7 +4621,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera)
pool_set_t::iterator iter2 = iter1;
if (hasRenderType(poolp->getType()) && poolp->getNumDeferredPasses() > 0)
{
- LLFastTimer t(FTM_DEFERRED_POOLRENDER);
+ LL_RECORD_BLOCK_TIME(FTM_DEFERRED_POOLRENDER);
gGLLastMatrix = NULL;
gGL.loadMatrix(gGLModelView);
@@ -4694,7 +4673,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera)
void LLPipeline::renderGeomPostDeferred(LLCamera& camera, bool do_occlusion)
{
- LLFastTimer t(FTM_POST_DEFERRED_POOLS);
+ LL_RECORD_BLOCK_TIME(FTM_POST_DEFERRED_POOLS);
U32 cur_type = 0;
LLGLEnable cull(GL_CULL_FACE);
@@ -4728,7 +4707,7 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera, bool do_occlusion)
pool_set_t::iterator iter2 = iter1;
if (hasRenderType(poolp->getType()) && poolp->getNumPostDeferredPasses() > 0)
{
- LLFastTimer t(FTM_POST_DEFERRED_POOLRENDER);
+ LL_RECORD_BLOCK_TIME(FTM_POST_DEFERRED_POOLRENDER);
gGLLastMatrix = NULL;
gGL.loadMatrix(gGLModelView);
@@ -4865,10 +4844,8 @@ void LLPipeline::addTrianglesDrawn(S32 index_count, U32 render_type)
count = index_count/3;
}
- mTrianglesDrawn += count;
- mBatchCount++;
- mMaxBatchSize = llmax(mMaxBatchSize, count);
- mMinBatchSize = llmin(mMinBatchSize, count);
+ record(sStatBatchSize, count);
+ add(LLStatViewer::TRIANGLES_DRAWN, LLUnits::Triangles::fromValue(count));
if (LLPipeline::sRenderFrameTest)
{
@@ -5286,7 +5263,7 @@ void LLPipeline::renderDebug()
{
DebugBlip& blip = *iter;
- blip.mAge += gFrameIntervalSeconds;
+ blip.mAge += gFrameIntervalSeconds.value();
if (blip.mAge > 2.f)
{
mDebugBlips.erase(iter++);
@@ -5296,7 +5273,7 @@ void LLPipeline::renderDebug()
iter++;
}
- blip.mPosition.mV[2] += gFrameIntervalSeconds*2.f;
+ blip.mPosition.mV[2] += gFrameIntervalSeconds.value()*2.f;
gGL.color4fv(blip.mColor.mV);
gGL.vertex3fv(blip.mPosition.mV);
@@ -5351,9 +5328,10 @@ void LLPipeline::renderDebug()
fudge.splat(0.25f); //SG_OCCLUSION_FUDGE
LLVector4a size;
- size.setAdd(fudge, group->mBounds[1]);
-
- drawBox(group->mBounds[0], size);
+ const LLVector4a* bounds = group->getBounds();
+ size.setAdd(fudge, bounds[1]);
+
+ drawBox(bounds[0], size);
}
}
@@ -5595,7 +5573,7 @@ void LLPipeline::renderDebug()
continue;
}
- LLSpatialBridge* bridge = group->mSpatialPartition->asBridge();
+ LLSpatialBridge* bridge = group->getSpatialPartition()->asBridge();
if (bridge && (!bridge->mDrawable || bridge->mDrawable->isDead()))
{
@@ -5635,11 +5613,11 @@ void LLPipeline::renderDebug()
}
}
-static LLFastTimer::DeclareTimer FTM_REBUILD_POOLS("Rebuild Pools");
+static LLTrace::BlockTimerStatHandle FTM_REBUILD_POOLS("Rebuild Pools");
void LLPipeline::rebuildPools()
{
- LLFastTimer t(FTM_REBUILD_POOLS);
+ LL_RECORD_BLOCK_TIME(FTM_REBUILD_POOLS);
assertInitialized();
@@ -5682,7 +5660,7 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
if (mSimplePool)
{
llassert(0);
- llwarns << "Ignoring duplicate simple pool." << llendl;
+ LL_WARNS() << "Ignoring duplicate simple pool." << LL_ENDL;
}
else
{
@@ -5694,7 +5672,7 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
if (mAlphaMaskPool)
{
llassert(0);
- llwarns << "Ignoring duplicate alpha mask pool." << llendl;
+ LL_WARNS() << "Ignoring duplicate alpha mask pool." << LL_ENDL;
break;
}
else
@@ -5707,7 +5685,7 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
if (mFullbrightAlphaMaskPool)
{
llassert(0);
- llwarns << "Ignoring duplicate alpha mask pool." << llendl;
+ LL_WARNS() << "Ignoring duplicate alpha mask pool." << LL_ENDL;
break;
}
else
@@ -5720,7 +5698,7 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
if (mGrassPool)
{
llassert(0);
- llwarns << "Ignoring duplicate grass pool." << llendl;
+ LL_WARNS() << "Ignoring duplicate grass pool." << LL_ENDL;
}
else
{
@@ -5732,7 +5710,7 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
if (mFullbrightPool)
{
llassert(0);
- llwarns << "Ignoring duplicate simple pool." << llendl;
+ LL_WARNS() << "Ignoring duplicate simple pool." << LL_ENDL;
}
else
{
@@ -5744,7 +5722,7 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
if (mInvisiblePool)
{
llassert(0);
- llwarns << "Ignoring duplicate simple pool." << llendl;
+ LL_WARNS() << "Ignoring duplicate simple pool." << LL_ENDL;
}
else
{
@@ -5756,7 +5734,7 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
if (mGlowPool)
{
llassert(0);
- llwarns << "Ignoring duplicate glow pool." << llendl;
+ LL_WARNS() << "Ignoring duplicate glow pool." << LL_ENDL;
}
else
{
@@ -5776,7 +5754,7 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
if (mBumpPool)
{
llassert(0);
- llwarns << "Ignoring duplicate bump pool." << llendl;
+ LL_WARNS() << "Ignoring duplicate bump pool." << LL_ENDL;
}
else
{
@@ -5787,7 +5765,7 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
if (mMaterialsPool)
{
llassert(0);
- llwarns << "Ignorning duplicate materials pool." << llendl;
+ LL_WARNS() << "Ignorning duplicate materials pool." << LL_ENDL;
}
else
{
@@ -5798,7 +5776,7 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
if( mAlphaPool )
{
llassert(0);
- llwarns << "LLPipeline::addPool(): Ignoring duplicate Alpha pool" << llendl;
+ LL_WARNS() << "LLPipeline::addPool(): Ignoring duplicate Alpha pool" << LL_ENDL;
}
else
{
@@ -5813,7 +5791,7 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
if( mSkyPool )
{
llassert(0);
- llwarns << "LLPipeline::addPool(): Ignoring duplicate Sky pool" << llendl;
+ LL_WARNS() << "LLPipeline::addPool(): Ignoring duplicate Sky pool" << LL_ENDL;
}
else
{
@@ -5825,7 +5803,7 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
if( mWaterPool )
{
llassert(0);
- llwarns << "LLPipeline::addPool(): Ignoring duplicate Water pool" << llendl;
+ LL_WARNS() << "LLPipeline::addPool(): Ignoring duplicate Water pool" << LL_ENDL;
}
else
{
@@ -5837,7 +5815,7 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
if( mGroundPool )
{
llassert(0);
- llwarns << "LLPipeline::addPool(): Ignoring duplicate Ground Pool" << llendl;
+ LL_WARNS() << "LLPipeline::addPool(): Ignoring duplicate Ground Pool" << LL_ENDL;
}
else
{
@@ -5849,7 +5827,7 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
if( mWLSkyPool )
{
llassert(0);
- llwarns << "LLPipeline::addPool(): Ignoring duplicate WLSky Pool" << llendl;
+ LL_WARNS() << "LLPipeline::addPool(): Ignoring duplicate WLSky Pool" << LL_ENDL;
}
else
{
@@ -5859,7 +5837,7 @@ void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
default:
llassert(0);
- llwarns << "Invalid Pool Type in LLPipeline::addPool()" << llendl;
+ LL_WARNS() << "Invalid Pool Type in LLPipeline::addPool()" << LL_ENDL;
break;
}
}
@@ -5943,7 +5921,7 @@ void LLPipeline::removeFromQuickLookup( LLDrawPool* poolp )
llassert( poolp == mBumpPool );
mBumpPool = NULL;
break;
-
+
case LLDrawPool::POOL_MATERIALS:
llassert(poolp == mMaterialsPool);
mMaterialsPool = NULL;
@@ -5974,7 +5952,7 @@ void LLPipeline::removeFromQuickLookup( LLDrawPool* poolp )
default:
llassert(0);
- llwarns << "Invalid Pool Type in LLPipeline::removeFromQuickLookup() type=" << poolp->getType() << llendl;
+ LL_WARNS() << "Invalid Pool Type in LLPipeline::removeFromQuickLookup() type=" << poolp->getType() << LL_ENDL;
break;
}
}
@@ -6019,7 +5997,7 @@ void LLPipeline::setupAvatarLights(BOOL for_edit)
}
mHWLightColors[1] = diffuse;
-
+
light->setDiffuse(diffuse);
light->setAmbient(LLColor4::black);
light->setSpecular(LLColor4::black);
@@ -6224,7 +6202,7 @@ void LLPipeline::calcNearbyLights(LLCamera& camera)
{
if (farthest_light->fade >= 0.f)
{
- farthest_light->fade = -gFrameIntervalSeconds;
+ farthest_light->fade = -(gFrameIntervalSeconds.value());
}
}
else
@@ -6234,6 +6212,13 @@ void LLPipeline::calcNearbyLights(LLCamera& camera)
}
}
+ //mark nearby lights not-removable.
+ for (light_set_t::iterator iter = mNearbyLights.begin();
+ iter != mNearbyLights.end(); iter++)
+ {
+ const Light* light = &(*iter);
+ ((LLViewerOctreeEntryData*) light->drawable)->setVisible();
+ }
}
}
@@ -6328,12 +6313,12 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
if (fade >= 0.f)
{
fade = fade / LIGHT_FADE_TIME;
- ((Light*) (&(*iter)))->fade += gFrameIntervalSeconds;
+ ((Light*) (&(*iter)))->fade += gFrameIntervalSeconds.value();
}
else
{
fade = 1.f + fade / LIGHT_FADE_TIME;
- ((Light*) (&(*iter)))->fade -= gFrameIntervalSeconds;
+ ((Light*) (&(*iter)))->fade -= gFrameIntervalSeconds.value();
}
fade = llclamp(fade,0.f,1.f);
light_color *= fade;
@@ -6645,28 +6630,28 @@ void LLPipeline::findReferences(LLDrawable *drawablep)
assertInitialized();
if (mLights.find(drawablep) != mLights.end())
{
- llinfos << "In mLights" << llendl;
+ LL_INFOS() << "In mLights" << LL_ENDL;
}
if (std::find(mMovedList.begin(), mMovedList.end(), drawablep) != mMovedList.end())
{
- llinfos << "In mMovedList" << llendl;
+ LL_INFOS() << "In mMovedList" << LL_ENDL;
}
if (std::find(mShiftList.begin(), mShiftList.end(), drawablep) != mShiftList.end())
{
- llinfos << "In mShiftList" << llendl;
+ LL_INFOS() << "In mShiftList" << LL_ENDL;
}
if (mRetexturedList.find(drawablep) != mRetexturedList.end())
{
- llinfos << "In mRetexturedList" << llendl;
+ LL_INFOS() << "In mRetexturedList" << LL_ENDL;
}
if (std::find(mBuildQ1.begin(), mBuildQ1.end(), drawablep) != mBuildQ1.end())
{
- llinfos << "In mBuildQ1" << llendl;
+ LL_INFOS() << "In mBuildQ1" << LL_ENDL;
}
if (std::find(mBuildQ2.begin(), mBuildQ2.end(), drawablep) != mBuildQ2.end())
{
- llinfos << "In mBuildQ2" << llendl;
+ LL_INFOS() << "In mBuildQ2" << LL_ENDL;
}
S32 count;
@@ -6674,7 +6659,7 @@ void LLPipeline::findReferences(LLDrawable *drawablep)
count = gObjectList.findReferences(drawablep);
if (count)
{
- llinfos << "In other drawables: " << count << " references" << llendl;
+ LL_INFOS() << "In other drawables: " << count << " references" << LL_ENDL;
}
}
@@ -6695,7 +6680,7 @@ BOOL LLPipeline::verify()
if (!ok)
{
- llwarns << "Pipeline verify failed!" << llendl;
+ LL_WARNS() << "Pipeline verify failed!" << LL_ENDL;
}
return ok;
}
@@ -6833,11 +6818,11 @@ void LLPipeline::toggleRenderTypeControl(void* data)
U32 bit = (1<<type);
if (gPipeline.hasRenderType(type))
{
- llinfos << "Toggling render type mask " << std::hex << bit << " off" << std::dec << llendl;
+ LL_INFOS() << "Toggling render type mask " << std::hex << bit << " off" << std::dec << LL_ENDL;
}
else
{
- llinfos << "Toggling render type mask " << std::hex << bit << " on" << std::dec << llendl;
+ LL_INFOS() << "Toggling render type mask " << std::hex << bit << " on" << std::dec << LL_ENDL;
}
gPipeline.toggleRenderType(type);
}
@@ -6863,11 +6848,11 @@ void LLPipeline::toggleRenderDebug(void* data)
U32 bit = (U32)(intptr_t)data;
if (gPipeline.hasRenderDebugMask(bit))
{
- llinfos << "Toggling render debug mask " << std::hex << bit << " off" << std::dec << llendl;
+ LL_INFOS() << "Toggling render debug mask " << std::hex << bit << " off" << std::dec << LL_ENDL;
}
else
{
- llinfos << "Toggling render debug mask " << std::hex << bit << " on" << std::dec << llendl;
+ LL_INFOS() << "Toggling render debug mask " << std::hex << bit << " on" << std::dec << LL_ENDL;
}
gPipeline.mRenderDebugMask ^= bit;
}
@@ -6916,7 +6901,7 @@ void LLPipeline::popRenderDebugFeatureMask()
{
if (mRenderDebugFeatureStack.empty())
{
- llerrs << "Depleted render feature stack." << llendl;
+ LL_ERRS() << "Depleted render feature stack." << LL_ENDL;
}
mRenderDebugFeatureMask = mRenderDebugFeatureStack.top();
@@ -7343,16 +7328,30 @@ void LLPipeline::resetVertexBuffers()
mResetVertexBuffers = true;
}
-static LLFastTimer::DeclareTimer FTM_RESET_VB("Reset VB");
+static LLTrace::BlockTimerStatHandle FTM_RESET_VB("Reset VB");
-void LLPipeline::doResetVertexBuffers()
+void LLPipeline::doResetVertexBuffers(bool forced)
{
if (!mResetVertexBuffers)
{
return;
}
+ if(!forced && LLSpatialPartition::sTeleportRequested)
+ {
+ if(gAgent.getTeleportState() != LLAgent::TELEPORT_NONE)
+ {
+ return; //wait for teleporting to finish
+ }
+ else
+ {
+ //teleporting aborted
+ LLSpatialPartition::sTeleportRequested = FALSE;
+ mResetVertexBuffers = false;
+ return;
+ }
+ }
- LLFastTimer t(FTM_RESET_VB);
+ LL_RECORD_BLOCK_TIME(FTM_RESET_VB);
mResetVertexBuffers = false;
mCubeVB = NULL;
@@ -7370,6 +7369,13 @@ void LLPipeline::doResetVertexBuffers()
}
}
}
+ if(LLSpatialPartition::sTeleportRequested)
+ {
+ LLSpatialPartition::sTeleportRequested = FALSE;
+
+ LLWorld::getInstance()->clearAllVisibleObjects();
+ clearRebuildDrawables();
+ }
resetDrawOrders();
@@ -7392,7 +7398,7 @@ void LLPipeline::doResetVertexBuffers()
if (LLVertexBuffer::sGLCount > 0)
{
- llwarns << "VBO wipe failed -- " << LLVertexBuffer::sGLCount << " buffers remaining." << llendl;
+ LL_WARNS() << "VBO wipe failed -- " << LLVertexBuffer::sGLCount << " buffers remaining." << LL_ENDL;
}
LLVertexBuffer::unbind();
@@ -7475,18 +7481,18 @@ void validate_framebuffer_object()
break;
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
// frame buffer not OK: probably means unsupported depth buffer format
- llerrs << "Framebuffer Incomplete Missing Attachment." << llendl;
+ LL_ERRS() << "Framebuffer Incomplete Missing Attachment." << LL_ENDL;
break;
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
// frame buffer not OK: probably means unsupported depth buffer format
- llerrs << "Framebuffer Incomplete Attachment." << llendl;
+ LL_ERRS() << "Framebuffer Incomplete Attachment." << LL_ENDL;
break;
case GL_FRAMEBUFFER_UNSUPPORTED:
/* choose different formats */
- llerrs << "Framebuffer unsupported." << llendl;
+ LL_ERRS() << "Framebuffer unsupported." << LL_ENDL;
break;
default:
- llerrs << "Unknown framebuffer status." << llendl;
+ LL_ERRS() << "Unknown framebuffer status." << LL_ENDL;
break;
}
}
@@ -7496,7 +7502,7 @@ void LLPipeline::bindScreenToTexture()
}
-static LLFastTimer::DeclareTimer FTM_RENDER_BLOOM("Bloom");
+static LLTrace::BlockTimerStatHandle FTM_RENDER_BLOOM("Bloom");
void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
{
@@ -7521,7 +7527,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
LLVector2 tc2((F32) mScreen.getWidth()*2,
(F32) mScreen.getHeight()*2);
- LLFastTimer ftm(FTM_RENDER_BLOOM);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_BLOOM);
gGL.color4f(1,1,1,1);
LLGLDepthTest depth(GL_FALSE);
LLGLDisable blend(GL_BLEND);
@@ -7537,13 +7543,13 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
gGL.loadIdentity();
LLGLDisable test(GL_ALPHA_TEST);
-
+
gGL.setColorMask(true, true);
glClearColor(0,0,0,0);
-
+
{
{
- LLFastTimer ftm(FTM_RENDER_BLOOM_FBO);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_BLOOM_FBO);
mGlow[2].bindTarget();
mGlow[2].clear();
}
@@ -7611,7 +7617,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
for (S32 i = 0; i < kernel; i++)
{
{
- LLFastTimer ftm(FTM_RENDER_BLOOM_FBO);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_BLOOM_FBO);
mGlow[i%2].bindTarget();
mGlow[i%2].clear();
}
@@ -7653,7 +7659,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
/*if (LLRenderTarget::sUseFBO)
{
- LLFastTimer ftm(FTM_RENDER_BLOOM_FBO);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_BLOOM_FBO);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
}*/
@@ -7751,7 +7757,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
}
else if (transition_time < 1.f)
{ //currently in a transition, continue interpolating
- transition_time += 1.f/CameraFocusTransitionTime*gFrameIntervalSeconds;
+ transition_time += 1.f/CameraFocusTransitionTime*gFrameIntervalSeconds.value();
transition_time = llmin(transition_time, 1.f);
F32 t = cosf(transition_time*F_PI+F_PI)*0.5f+0.5f;
@@ -7887,7 +7893,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
mScreen.bindTexture(0, channel);
gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
}
-
+
if (!LLViewerCamera::getInstance()->cameraUnderWater())
{
shader->uniform1f(LLShaderMgr::GLOBAL_GAMMA, 2.2);
@@ -7935,7 +7941,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
{
mScreen.bindTexture(0, channel);
}
-
+
if (!LLViewerCamera::getInstance()->cameraUnderWater())
{
shader->uniform1f(LLShaderMgr::GLOBAL_GAMMA, 2.2);
@@ -8153,11 +8159,11 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
}
-static LLFastTimer::DeclareTimer FTM_BIND_DEFERRED("Bind Deferred");
+static LLTrace::BlockTimerStatHandle FTM_BIND_DEFERRED("Bind Deferred");
void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, U32 noise_map)
{
- LLFastTimer t(FTM_BIND_DEFERRED);
+ LL_RECORD_BLOCK_TIME(FTM_BIND_DEFERRED);
if (noise_map == 0xFFFFFFFF)
{
@@ -8378,16 +8384,16 @@ LLVector4 pow4fsrgb(LLVector4 v, F32 f)
return v;
}
-static LLFastTimer::DeclareTimer FTM_GI_TRACE("Trace");
-static LLFastTimer::DeclareTimer FTM_GI_GATHER("Gather");
-static LLFastTimer::DeclareTimer FTM_SUN_SHADOW("Shadow Map");
-static LLFastTimer::DeclareTimer FTM_SOFTEN_SHADOW("Shadow Soften");
-static LLFastTimer::DeclareTimer FTM_EDGE_DETECTION("Find Edges");
-static LLFastTimer::DeclareTimer FTM_LOCAL_LIGHTS("Local Lights");
-static LLFastTimer::DeclareTimer FTM_ATMOSPHERICS("Atmospherics");
-static LLFastTimer::DeclareTimer FTM_FULLSCREEN_LIGHTS("Fullscreen Lights");
-static LLFastTimer::DeclareTimer FTM_PROJECTORS("Projectors");
-static LLFastTimer::DeclareTimer FTM_POST("Post");
+static LLTrace::BlockTimerStatHandle FTM_GI_TRACE("Trace");
+static LLTrace::BlockTimerStatHandle FTM_GI_GATHER("Gather");
+static LLTrace::BlockTimerStatHandle FTM_SUN_SHADOW("Shadow Map");
+static LLTrace::BlockTimerStatHandle FTM_SOFTEN_SHADOW("Shadow Soften");
+static LLTrace::BlockTimerStatHandle FTM_EDGE_DETECTION("Find Edges");
+static LLTrace::BlockTimerStatHandle FTM_LOCAL_LIGHTS("Local Lights");
+static LLTrace::BlockTimerStatHandle FTM_ATMOSPHERICS("Atmospherics");
+static LLTrace::BlockTimerStatHandle FTM_FULLSCREEN_LIGHTS("Fullscreen Lights");
+static LLTrace::BlockTimerStatHandle FTM_PROJECTORS("Projectors");
+static LLTrace::BlockTimerStatHandle FTM_POST("Post");
void LLPipeline::renderDeferredLighting()
@@ -8398,7 +8404,7 @@ void LLPipeline::renderDeferredLighting()
}
{
- LLFastTimer ftm(FTM_RENDER_DEFERRED);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_DEFERRED);
LLViewerCamera* camera = LLViewerCamera::getInstance();
{
@@ -8454,7 +8460,7 @@ void LLPipeline::renderDeferredLighting()
{
mDeferredLight.bindTarget();
{ //paint shadow/SSAO light map (direct lighting lightmap)
- LLFastTimer ftm(FTM_SUN_SHADOW);
+ LL_RECORD_BLOCK_TIME(FTM_SUN_SHADOW);
bindDeferredShader(gDeferredSunProgram, 0);
mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
glClearColor(1,1,1,1);
@@ -8498,7 +8504,7 @@ void LLPipeline::renderDeferredLighting()
if (RenderDeferredSSAO)
{ //soften direct lighting lightmap
- LLFastTimer ftm(FTM_SOFTEN_SHADOW);
+ LL_RECORD_BLOCK_TIME(FTM_SOFTEN_SHADOW);
//blur lightmap
mScreen.bindTarget();
glClearColor(1,1,1,1);
@@ -8573,7 +8579,7 @@ void LLPipeline::renderDeferredLighting()
if (RenderDeferredAtmospheric)
{ //apply sunlight contribution
- LLFastTimer ftm(FTM_ATMOSPHERICS);
+ LL_RECORD_BLOCK_TIME(FTM_ATMOSPHERICS);
bindDeferredShader(LLPipeline::sUnderWaterRender ? gDeferredSoftenWaterProgram : gDeferredSoftenProgram);
{
LLGLDepthTest depth(GL_FALSE);
@@ -8710,7 +8716,7 @@ void LLPipeline::renderDeferredLighting()
col.mV[1] = powf(col.mV[1], 2.2f);
col.mV[2] = powf(col.mV[2], 2.2f);*/
- LLFastTimer ftm(FTM_LOCAL_LIGHTS);
+ LL_RECORD_BLOCK_TIME(FTM_LOCAL_LIGHTS);
gDeferredLightProgram.uniform3fv(LLShaderMgr::LIGHT_CENTER, 1, c);
gDeferredLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s);
gDeferredLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV);
@@ -8751,7 +8757,7 @@ void LLPipeline::renderDeferredLighting()
for (LLDrawable::drawable_list_t::iterator iter = spot_lights.begin(); iter != spot_lights.end(); ++iter)
{
- LLFastTimer ftm(FTM_PROJECTORS);
+ LL_RECORD_BLOCK_TIME(FTM_PROJECTORS);
LLDrawable* drawablep = *iter;
LLVOVolume* volume = drawablep->getVOVolume();
@@ -8808,12 +8814,12 @@ void LLPipeline::renderDeferredLighting()
while (!fullscreen_lights.empty())
{
- LLFastTimer ftm(FTM_FULLSCREEN_LIGHTS);
+ LL_RECORD_BLOCK_TIME(FTM_FULLSCREEN_LIGHTS);
light[count] = fullscreen_lights.front();
fullscreen_lights.pop_front();
col[count] = light_colors.front();
light_colors.pop_front();
-
+
/*col[count].mV[0] = powf(col[count].mV[0], 2.2f);
col[count].mV[1] = powf(col[count].mV[1], 2.2f);
col[count].mV[2] = powf(col[count].mV[2], 2.2f);*/
@@ -8845,7 +8851,7 @@ void LLPipeline::renderDeferredLighting()
for (LLDrawable::drawable_list_t::iterator iter = fullscreen_spot_lights.begin(); iter != fullscreen_spot_lights.end(); ++iter)
{
- LLFastTimer ftm(FTM_PROJECTORS);
+ LL_RECORD_BLOCK_TIME(FTM_PROJECTORS);
LLDrawable* drawablep = *iter;
LLVOVolume* volume = drawablep->getVOVolume();
@@ -9006,7 +9012,7 @@ void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target)
}
{
- LLFastTimer ftm(FTM_RENDER_DEFERRED);
+ LL_RECORD_BLOCK_TIME(FTM_RENDER_DEFERRED);
LLViewerCamera* camera = LLViewerCamera::getInstance();
@@ -9063,7 +9069,7 @@ void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target)
{
mDeferredLight.bindTarget();
{ //paint shadow/SSAO light map (direct lighting lightmap)
- LLFastTimer ftm(FTM_SUN_SHADOW);
+ LL_RECORD_BLOCK_TIME(FTM_SUN_SHADOW);
bindDeferredShader(gDeferredSunProgram);
mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX);
glClearColor(1,1,1,1);
@@ -9121,7 +9127,7 @@ void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target)
if (RenderDeferredAtmospheric)
{ //apply sunlight contribution
- LLFastTimer ftm(FTM_ATMOSPHERICS);
+ LL_RECORD_BLOCK_TIME(FTM_ATMOSPHERICS);
bindDeferredShader(gDeferredSoftenProgram);
{
LLGLDepthTest depth(GL_FALSE);
@@ -9258,7 +9264,7 @@ void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target)
col.mV[1] = powf(col.mV[1], 2.2f);
col.mV[2] = powf(col.mV[2], 2.2f);*/
- LLFastTimer ftm(FTM_LOCAL_LIGHTS);
+ LL_RECORD_BLOCK_TIME(FTM_LOCAL_LIGHTS);
gDeferredLightProgram.uniform3fv(LLShaderMgr::LIGHT_CENTER, 1, c);
gDeferredLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s);
gDeferredLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV);
@@ -9299,7 +9305,7 @@ void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target)
for (LLDrawable::drawable_list_t::iterator iter = spot_lights.begin(); iter != spot_lights.end(); ++iter)
{
- LLFastTimer ftm(FTM_PROJECTORS);
+ LL_RECORD_BLOCK_TIME(FTM_PROJECTORS);
LLDrawable* drawablep = *iter;
LLVOVolume* volume = drawablep->getVOVolume();
@@ -9356,7 +9362,7 @@ void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target)
while (!fullscreen_lights.empty())
{
- LLFastTimer ftm(FTM_FULLSCREEN_LIGHTS);
+ LL_RECORD_BLOCK_TIME(FTM_FULLSCREEN_LIGHTS);
light[count] = fullscreen_lights.front();
fullscreen_lights.pop_front();
col[count] = light_colors.front();
@@ -9394,7 +9400,7 @@ void LLPipeline::renderDeferredLightingToRT(LLRenderTarget* target)
for (LLDrawable::drawable_list_t::iterator iter = fullscreen_spot_lights.begin(); iter != fullscreen_spot_lights.end(); ++iter)
{
- LLFastTimer ftm(FTM_PROJECTORS);
+ LL_RECORD_BLOCK_TIME(FTM_PROJECTORS);
LLDrawable* drawablep = *iter;
LLVOVolume* volume = drawablep->getVOVolume();
@@ -10095,13 +10101,13 @@ glh::matrix4f scale_translate_to_fit(const LLVector3 min, const LLVector3 max)
return ret;
}
-static LLFastTimer::DeclareTimer FTM_SHADOW_RENDER("Render Shadows");
-static LLFastTimer::DeclareTimer FTM_SHADOW_ALPHA("Alpha Shadow");
-static LLFastTimer::DeclareTimer FTM_SHADOW_SIMPLE("Simple Shadow");
+static LLTrace::BlockTimerStatHandle FTM_SHADOW_RENDER("Render Shadows");
+static LLTrace::BlockTimerStatHandle FTM_SHADOW_ALPHA("Alpha Shadow");
+static LLTrace::BlockTimerStatHandle FTM_SHADOW_SIMPLE("Simple Shadow");
void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera& shadow_cam, LLCullResult &result, BOOL use_shader, BOOL use_occlusion, U32 target_width)
{
- LLFastTimer t(FTM_SHADOW_RENDER);
+ LL_RECORD_BLOCK_TIME(FTM_SHADOW_RENDER);
//clip out geometry on the same side of water as the camera
S32 occlude = LLPipeline::sUseOcclusion;
@@ -10176,7 +10182,7 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
gGL.diffuseColor4f(1,1,1,1);
gGL.setColorMask(false, false);
- LLFastTimer ftm(FTM_SHADOW_SIMPLE);
+ LL_RECORD_BLOCK_TIME(FTM_SHADOW_SIMPLE);
gGL.getTexUnit(0)->disable();
for (U32 i = 0; i < sizeof(types)/sizeof(U32); ++i)
@@ -10202,7 +10208,7 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
}
{
- LLFastTimer ftm(FTM_SHADOW_ALPHA);
+ LL_RECORD_BLOCK_TIME(FTM_SHADOW_ALPHA);
gDeferredShadowAlphaMaskProgram.bind();
gDeferredShadowAlphaMaskProgram.uniform1f(LLShaderMgr::DEFERRED_SHADOW_TARGET_WIDTH, (float)target_width);
@@ -10255,10 +10261,10 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
LLPipeline::sShadowRender = FALSE;
}
-static LLFastTimer::DeclareTimer FTM_VISIBLE_CLOUD("Visible Cloud");
+static LLTrace::BlockTimerStatHandle FTM_VISIBLE_CLOUD("Visible Cloud");
BOOL LLPipeline::getVisiblePointCloud(LLCamera& camera, LLVector3& min, LLVector3& max, std::vector<LLVector3>& fp, LLVector3 light_dir)
{
- LLFastTimer t(FTM_VISIBLE_CLOUD);
+ LL_RECORD_BLOCK_TIME(FTM_VISIBLE_CLOUD);
//get point cloud of intersection of frust and min, max
if (getVisibleExtents(camera, min, max))
@@ -10461,7 +10467,7 @@ void LLPipeline::generateHighlight(LLCamera& camera)
if (!mHighlightSet.empty())
{
- F32 transition = gFrameIntervalSeconds/RenderHighlightFadeTime;
+ F32 transition = gFrameIntervalSeconds.value()/RenderHighlightFadeTime;
LLGLDisable test(GL_ALPHA_TEST);
LLGLDepthTest depth(GL_FALSE);
@@ -10505,7 +10511,7 @@ void LLPipeline::generateHighlight(LLCamera& camera)
}
-static LLFastTimer::DeclareTimer FTM_GEN_SUN_SHADOW("Gen Sun Shadow");
+static LLTrace::BlockTimerStatHandle FTM_GEN_SUN_SHADOW("Gen Sun Shadow");
void LLPipeline::generateSunShadow(LLCamera& camera)
{
@@ -10514,7 +10520,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
return;
}
- LLFastTimer t(FTM_GEN_SUN_SHADOW);
+ LL_RECORD_BLOCK_TIME(FTM_GEN_SUN_SHADOW);
BOOL skip_avatar_update = FALSE;
if (!isAgentAvatarValid() || gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK || !LLVOAvatar::sVisibleInFirstPerson)
@@ -10735,7 +10741,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
mShadowFrustPoints[j].clear();
}
- LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_SHADOW0+j;
+ LLViewerCamera::sCurCameraID = (LLViewerCamera::eCameraID)(LLViewerCamera::CAMERA_SHADOW0+j);
//restore render matrices
glh_set_current_modelview(saved_view);
@@ -11111,12 +11117,14 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
if (gen_shadow)
{
- F32 fade_amt = gFrameIntervalSeconds * llmax(LLViewerCamera::getInstance()->getVelocityStat()->getCurrentPerSec(), 1.f);
+ LLTrace::CountStatHandle<>* velocity_stat = LLViewerCamera::getVelocityStat();
+ F32 fade_amt = gFrameIntervalSeconds.value()
+ * llmax(LLTrace::get_frame_recording().getLastRecording().getSum(*velocity_stat) / LLTrace::get_frame_recording().getLastRecording().getDuration().value(), 1.0);
//update shadow targets
for (U32 i = 0; i < 2; i++)
{ //for each current shadow
- LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_SHADOW4+i;
+ LLViewerCamera::sCurCameraID = (LLViewerCamera::eCameraID)(LLViewerCamera::CAMERA_SHADOW4+i);
if (mShadowSpotLight[i].notNull() &&
(mShadowSpotLight[i] == mTargetShadowSpotLight[0] ||
@@ -11235,7 +11243,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
static LLCullResult result[2];
- LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_SHADOW0+i+4;
+ LLViewerCamera::sCurCameraID = (LLViewerCamera::eCameraID)(LLViewerCamera::CAMERA_SHADOW0 + i + 4);
renderShadow(view[i+4], proj[i+4], shadow_cam, result[i], FALSE, FALSE, target_width);
@@ -11285,7 +11293,7 @@ void LLPipeline::renderGroups(LLRenderPass* pass, U32 type, U32 mask, BOOL textu
LLSpatialGroup* group = *i;
if (!group->isDead() &&
(!sUseOcclusion || !group->isOcclusionState(LLSpatialGroup::OCCLUDED)) &&
- gPipeline.hasRenderType(group->mSpatialPartition->mDrawableType) &&
+ gPipeline.hasRenderType(group->getSpatialPartition()->mDrawableType) &&
group->mDrawMap.find(type) != group->mDrawMap.end())
{
pass->renderGroup(group,type,mask,texture);
@@ -11293,11 +11301,11 @@ void LLPipeline::renderGroups(LLRenderPass* pass, U32 type, U32 mask, BOOL textu
}
}
-static LLFastTimer::DeclareTimer FTM_IMPOSTOR_MARK_VISIBLE("Impostor Mark Visible");
-static LLFastTimer::DeclareTimer FTM_IMPOSTOR_SETUP("Impostor Setup");
-static LLFastTimer::DeclareTimer FTM_IMPOSTOR_BACKGROUND("Impostor Background");
-static LLFastTimer::DeclareTimer FTM_IMPOSTOR_ALLOCATE("Impostor Allocate");
-static LLFastTimer::DeclareTimer FTM_IMPOSTOR_RESIZE("Impostor Resize");
+static LLTrace::BlockTimerStatHandle FTM_IMPOSTOR_MARK_VISIBLE("Impostor Mark Visible");
+static LLTrace::BlockTimerStatHandle FTM_IMPOSTOR_SETUP("Impostor Setup");
+static LLTrace::BlockTimerStatHandle FTM_IMPOSTOR_BACKGROUND("Impostor Background");
+static LLTrace::BlockTimerStatHandle FTM_IMPOSTOR_ALLOCATE("Impostor Allocate");
+static LLTrace::BlockTimerStatHandle FTM_IMPOSTOR_RESIZE("Impostor Resize");
void LLPipeline::generateImpostor(LLVOAvatar* avatar)
{
@@ -11363,7 +11371,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
LLViewerCamera* viewer_camera = LLViewerCamera::getInstance();
{
- LLFastTimer t(FTM_IMPOSTOR_MARK_VISIBLE);
+ LL_RECORD_BLOCK_TIME(FTM_IMPOSTOR_MARK_VISIBLE);
markVisible(avatar->mDrawable, *viewer_camera);
LLVOAvatar::sUseImpostors = FALSE;
@@ -11393,7 +11401,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
U32 resX = 0;
{
- LLFastTimer t(FTM_IMPOSTOR_SETUP);
+ LL_RECORD_BLOCK_TIME(FTM_IMPOSTOR_SETUP);
const LLVector4a* ext = avatar->mDrawable->getSpatialExtents();
LLVector3 pos(avatar->getRenderPosition()+avatar->getImpostorOffset());
@@ -11450,7 +11458,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
if (!avatar->mImpostor.isComplete())
{
- LLFastTimer t(FTM_IMPOSTOR_ALLOCATE);
+ LL_RECORD_BLOCK_TIME(FTM_IMPOSTOR_ALLOCATE);
if (LLPipeline::sRenderDeferred)
@@ -11469,7 +11477,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
}
else if(resX != avatar->mImpostor.getWidth() || resY != avatar->mImpostor.getHeight())
{
- LLFastTimer t(FTM_IMPOSTOR_RESIZE);
+ LL_RECORD_BLOCK_TIME(FTM_IMPOSTOR_RESIZE);
avatar->mImpostor.resize(resX,resY);
}
@@ -11531,8 +11539,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
LLDrawPoolAvatar::sMinimumAlpha = old_alpha;
{ //create alpha mask based on depth buffer (grey out if muted)
- LLFastTimer t(FTM_IMPOSTOR_BACKGROUND);
-
+ LL_RECORD_BLOCK_TIME(FTM_IMPOSTOR_BACKGROUND);
if (LLPipeline::sRenderDeferred)
{
GLuint buff = GL_COLOR_ATTACHMENT0;
@@ -11671,7 +11678,7 @@ void LLPipeline::setRenderTypeMask(U32 type, ...)
if (type > END_RENDER_TYPES)
{
- llerrs << "Invalid render type." << llendl;
+ LL_ERRS() << "Invalid render type." << LL_ENDL;
}
}
@@ -11692,7 +11699,7 @@ BOOL LLPipeline::hasAnyRenderType(U32 type, ...) const
if (type > END_RENDER_TYPES)
{
- llerrs << "Invalid render type." << llendl;
+ LL_ERRS() << "Invalid render type." << LL_ENDL;
}
return FALSE;
@@ -11709,7 +11716,7 @@ void LLPipeline::popRenderTypeMask()
{
if (mRenderTypeEnableStack.empty())
{
- llerrs << "Depleted render type stack." << llendl;
+ LL_ERRS() << "Depleted render type stack." << LL_ENDL;
}
memcpy(mRenderTypeEnabled, mRenderTypeEnableStack.top().data(), sizeof(mRenderTypeEnabled));
@@ -11740,7 +11747,7 @@ void LLPipeline::andRenderTypeMask(U32 type, ...)
if (type > END_RENDER_TYPES)
{
- llerrs << "Invalid render type." << llendl;
+ LL_ERRS() << "Invalid render type." << LL_ENDL;
}
for (U32 i = 0; i < LLPipeline::NUM_RENDER_TYPES; ++i)
@@ -11765,7 +11772,7 @@ void LLPipeline::clearRenderTypeMask(U32 type, ...)
if (type > END_RENDER_TYPES)
{
- llerrs << "Invalid render type." << llendl;
+ LL_ERRS() << "Invalid render type." << LL_ENDL;
}
}
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 1c7154d413..ce2f4b17b1 100755
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -29,8 +29,6 @@
#include "llcamera.h"
#include "llerror.h"
-#include "lldarrayptr.h"
-#include "lldqueueptr.h"
#include "lldrawpool.h"
#include "llspatialpartition.h"
#include "m4math.h"
@@ -43,28 +41,16 @@
#include <stack>
-#include <stack>
-
-#include <stack>
-
class LLViewerTexture;
-class LLEdge;
class LLFace;
class LLViewerObject;
-class LLAgent;
-class LLDisplayPrimitive;
class LLTextureEntry;
-class LLRenderFunc;
-class LLCubeMap;
class LLCullResult;
class LLVOAvatar;
class LLVOPartGroup;
class LLGLSLShader;
-class LLCurlRequest;
class LLDrawPoolAlpha;
-class LLMeshResponder;
-
typedef enum e_avatar_skinning_method
{
SKIN_METHOD_SOFTWARE,
@@ -84,26 +70,26 @@ glh::matrix4f gl_ortho(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top,
glh::matrix4f gl_perspective(GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloat zFar);
glh::matrix4f gl_lookat(LLVector3 eye, LLVector3 center, LLVector3 up);
-extern LLFastTimer::DeclareTimer FTM_RENDER_GEOMETRY;
-extern LLFastTimer::DeclareTimer FTM_RENDER_GRASS;
-extern LLFastTimer::DeclareTimer FTM_RENDER_INVISIBLE;
-extern LLFastTimer::DeclareTimer FTM_RENDER_OCCLUSION;
-extern LLFastTimer::DeclareTimer FTM_RENDER_SHINY;
-extern LLFastTimer::DeclareTimer FTM_RENDER_SIMPLE;
-extern LLFastTimer::DeclareTimer FTM_RENDER_TERRAIN;
-extern LLFastTimer::DeclareTimer FTM_RENDER_TREES;
-extern LLFastTimer::DeclareTimer FTM_RENDER_UI;
-extern LLFastTimer::DeclareTimer FTM_RENDER_WATER;
-extern LLFastTimer::DeclareTimer FTM_RENDER_WL_SKY;
-extern LLFastTimer::DeclareTimer FTM_RENDER_ALPHA;
-extern LLFastTimer::DeclareTimer FTM_RENDER_CHARACTERS;
-extern LLFastTimer::DeclareTimer FTM_RENDER_BUMP;
-extern LLFastTimer::DeclareTimer FTM_RENDER_MATERIALS;
-extern LLFastTimer::DeclareTimer FTM_RENDER_FULLBRIGHT;
-extern LLFastTimer::DeclareTimer FTM_RENDER_GLOW;
-extern LLFastTimer::DeclareTimer FTM_STATESORT;
-extern LLFastTimer::DeclareTimer FTM_PIPELINE;
-extern LLFastTimer::DeclareTimer FTM_CLIENT_COPY;
+extern LLTrace::BlockTimerStatHandle FTM_RENDER_GEOMETRY;
+extern LLTrace::BlockTimerStatHandle FTM_RENDER_GRASS;
+extern LLTrace::BlockTimerStatHandle FTM_RENDER_INVISIBLE;
+extern LLTrace::BlockTimerStatHandle FTM_RENDER_OCCLUSION;
+extern LLTrace::BlockTimerStatHandle FTM_RENDER_SHINY;
+extern LLTrace::BlockTimerStatHandle FTM_RENDER_SIMPLE;
+extern LLTrace::BlockTimerStatHandle FTM_RENDER_TERRAIN;
+extern LLTrace::BlockTimerStatHandle FTM_RENDER_TREES;
+extern LLTrace::BlockTimerStatHandle FTM_RENDER_UI;
+extern LLTrace::BlockTimerStatHandle FTM_RENDER_WATER;
+extern LLTrace::BlockTimerStatHandle FTM_RENDER_WL_SKY;
+extern LLTrace::BlockTimerStatHandle FTM_RENDER_ALPHA;
+extern LLTrace::BlockTimerStatHandle FTM_RENDER_CHARACTERS;
+extern LLTrace::BlockTimerStatHandle FTM_RENDER_BUMP;
+extern LLTrace::BlockTimerStatHandle FTM_RENDER_MATERIALS;
+extern LLTrace::BlockTimerStatHandle FTM_RENDER_FULLBRIGHT;
+extern LLTrace::BlockTimerStatHandle FTM_RENDER_GLOW;
+extern LLTrace::BlockTimerStatHandle FTM_STATESORT;
+extern LLTrace::BlockTimerStatHandle FTM_PIPELINE;
+extern LLTrace::BlockTimerStatHandle FTM_CLIENT_COPY;
class LLPipeline
@@ -115,7 +101,7 @@ public:
void destroyGL();
void restoreGL();
void resetVertexBuffers();
- void doResetVertexBuffers();
+ void doResetVertexBuffers(bool forced = false);
void resizeScreenTexture();
void releaseGLBuffers();
void releaseLUTBuffers();
@@ -259,6 +245,7 @@ public:
void rebuildPriorityGroups();
void rebuildGroups();
void clearRebuildGroups();
+ void clearRebuildDrawables();
//calculate pixel area of given box from vantage point of given camera
static F32 calcPixelArea(LLVector3 center, LLVector3 size, LLCamera& camera);
@@ -557,23 +544,14 @@ public:
LLQuaternion mFlyCamRotation;
BOOL mBackfaceCull;
- S32 mBatchCount;
S32 mMatrixOpCount;
S32 mTextureMatrixOps;
- S32 mMaxBatchSize;
- S32 mMinBatchSize;
- S32 mMeanBatchSize;
- S32 mTrianglesDrawn;
S32 mNumVisibleNodes;
- S32 mVerticesRelit;
S32 mDebugTextureUploadCost;
S32 mDebugSculptUploadCost;
S32 mDebugMeshUploadCost;
- S32 mLightingChanges;
- S32 mGeometryChanges;
-
S32 mNumVisibleFaces;
static S32 sCompiles;
@@ -609,6 +587,8 @@ public:
static F32 sMinRenderSize;
static BOOL sRenderingHUDs;
+ static LLTrace::EventStatHandle<S64> sStatBatchSize;
+
//screen texture
U32 mScreenWidth;
U32 mScreenHeight;
diff --git a/indra/newview/roles_constants.h b/indra/newview/roles_constants.h
new file mode 100644
index 0000000000..8fd7978fa1
--- /dev/null
+++ b/indra/newview/roles_constants.h
@@ -0,0 +1,194 @@
+/**
+ * @file roles_constants.h
+ * @brief General Roles Constants
+ *
+ * $LicenseInfo:firstyear=2006&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_ROLES_CONSTANTS_H
+#define LL_ROLES_CONSTANTS_H
+
+// This value includes the everyone group.
+const S32 MAX_ROLES = 10;
+
+enum LLRoleMemberChangeType
+{
+ RMC_ADD,
+ RMC_REMOVE,
+ RMC_NONE
+};
+
+enum LLRoleChangeType
+{
+ RC_UPDATE_NONE,
+ RC_UPDATE_DATA,
+ RC_UPDATE_POWERS,
+ RC_UPDATE_ALL,
+ RC_CREATE,
+ RC_DELETE
+};
+
+//
+// Powers
+//
+
+// KNOWN HOLES: use these for any single bit powers you need
+// bit 0x1 << 46
+// bit 0x1 << 52 and above
+
+// These powers were removed to make group roles simpler
+// bit 0x1 << 41 (GP_ACCOUNTING_VIEW)
+// bit 0x1 << 46 (GP_PROPOSAL_VIEW)
+
+const U64 GP_NO_POWERS = 0x0;
+const U64 GP_ALL_POWERS = 0xFFFFffffFFFFffffLL;
+
+// Membership
+const U64 GP_MEMBER_INVITE = 0x1LL << 1; // Invite member
+const U64 GP_MEMBER_EJECT = 0x1LL << 2; // Eject member from group
+const U64 GP_MEMBER_OPTIONS = 0x1LL << 3; // Toggle "Open enrollment" and change "Signup Fee"
+const U64 GP_MEMBER_VISIBLE_IN_DIR = 0x1LL << 47;
+
+// Roles
+const U64 GP_ROLE_CREATE = 0x1LL << 4; // Create new roles
+const U64 GP_ROLE_DELETE = 0x1LL << 5; // Delete roles
+const U64 GP_ROLE_PROPERTIES = 0x1LL << 6; // Change Role Names, Titles, and Descriptions (Of roles the user is in, only, or any role in group?)
+const U64 GP_ROLE_ASSIGN_MEMBER_LIMITED = 0x1LL << 7; // Assign Member to a Role that the assigner is in
+const U64 GP_ROLE_ASSIGN_MEMBER = 0x1LL << 8; // Assign Member to Role
+const U64 GP_ROLE_REMOVE_MEMBER = 0x1LL << 9; // Remove Member from Role
+const U64 GP_ROLE_CHANGE_ACTIONS = 0x1LL << 10; // Change actions a role can perform
+
+// Group Identity
+const U64 GP_GROUP_CHANGE_IDENTITY = 0x1LL << 11; // Charter, insignia, 'Show In Group List', 'Publish on the web', 'Mature', all 'Show Member In Group Profile' checkboxes
+
+// Parcel Management
+const U64 GP_LAND_DEED = 0x1LL << 12; // Deed Land and Buy Land for Group
+const U64 GP_LAND_RELEASE = 0x1LL << 13; // Release Land (to Gov. Linden)
+const U64 GP_LAND_SET_SALE_INFO = 0x1LL << 14; // Set for sale info (Toggle "For Sale", Set Price, Set Target, Toggle "Sell objects with the land")
+const U64 GP_LAND_DIVIDE_JOIN = 0x1LL << 15; // Divide and Join Parcels
+
+// Parcel Identity
+const U64 GP_LAND_FIND_PLACES = 0x1LL << 17; // Toggle "Show in Find Places" and Set Category.
+const U64 GP_LAND_CHANGE_IDENTITY = 0x1LL << 18; // Change Parcel Identity: Parcel Name, Parcel Description, Snapshot, 'Publish on the web', and 'Mature' checkbox
+const U64 GP_LAND_SET_LANDING_POINT = 0x1LL << 19; // Set Landing Point
+
+// Parcel Settings
+const U64 GP_LAND_CHANGE_MEDIA = 0x1LL << 20; // Change Media Settings
+const U64 GP_LAND_EDIT = 0x1LL << 21; // Toggle Edit Land
+const U64 GP_LAND_OPTIONS = 0x1LL << 22; // Toggle Set Home Point, Fly, Outside Scripts, Create/Edit Objects, Landmark, and Damage checkboxes
+
+// Parcel Powers
+const U64 GP_LAND_ALLOW_EDIT_LAND = 0x1LL << 23; // Bypass Edit Land Restriction
+const U64 GP_LAND_ALLOW_FLY = 0x1LL << 24; // Bypass Fly Restriction
+const U64 GP_LAND_ALLOW_CREATE = 0x1LL << 25; // Bypass Create/Edit Objects Restriction
+const U64 GP_LAND_ALLOW_LANDMARK = 0x1LL << 26; // Bypass Landmark Restriction
+const U64 GP_LAND_ALLOW_SET_HOME = 0x1LL << 28; // Bypass Set Home Point Restriction
+const U64 GP_LAND_ALLOW_HOLD_EVENT = 0x1LL << 41; // Allowed to hold events on group-owned land
+
+// Parcel Access
+const U64 GP_LAND_MANAGE_ALLOWED = 0x1LL << 29; // Manage Allowed List
+const U64 GP_LAND_MANAGE_BANNED = 0x1LL << 30; // Manage Banned List
+const U64 GP_LAND_MANAGE_PASSES = 0x1LL << 31; // Change Sell Pass Settings
+const U64 GP_LAND_ADMIN = 0x1LL << 32; // Eject and Freeze Users on the land
+
+// Parcel Content
+const U64 GP_LAND_RETURN_GROUP_SET = 0x1LL << 33; // Return objects on parcel that are set to group
+const U64 GP_LAND_RETURN_NON_GROUP = 0x1LL << 34; // Return objects on parcel that are not set to group
+const U64 GP_LAND_RETURN_GROUP_OWNED = 0x1LL << 48; // Return objects on parcel that are owned by the group
+
+// Select a power-bit based on an object's relationship to a parcel.
+const U64 GP_LAND_RETURN = GP_LAND_RETURN_GROUP_OWNED
+ | GP_LAND_RETURN_GROUP_SET
+ | GP_LAND_RETURN_NON_GROUP;
+
+const U64 GP_LAND_GARDENING = 0x1LL << 35; // Parcel Gardening - plant and move linden trees
+
+// Object Management
+const U64 GP_OBJECT_DEED = 0x1LL << 36; // Deed Object
+const U64 GP_OBJECT_MANIPULATE = 0x1LL << 38; // Manipulate Group Owned Objects (Move, Copy, Mod)
+const U64 GP_OBJECT_SET_SALE = 0x1LL << 39; // Set Group Owned Object for Sale
+
+// Accounting
+const U64 GP_ACCOUNTING_ACCOUNTABLE = 0x1LL << 40; // Pay Group Liabilities and Receive Group Dividends
+
+// Notices
+const U64 GP_NOTICES_SEND = 0x1LL << 42; // Send Notices
+const U64 GP_NOTICES_RECEIVE = 0x1LL << 43; // Receive Notices and View Notice History
+
+// Proposals
+// TODO: _DEPRECATED suffix as part of vote removal - DEV-24856:
+const U64 GP_PROPOSAL_START = 0x1LL << 44; // Start Proposal
+// TODO: _DEPRECATED suffix as part of vote removal - DEV-24856:
+const U64 GP_PROPOSAL_VOTE = 0x1LL << 45; // Vote on Proposal
+
+// Group chat moderation related
+const U64 GP_SESSION_JOIN = 0x1LL << 16; //can join session
+const U64 GP_SESSION_VOICE = 0x1LL << 27; //can hear/talk
+const U64 GP_SESSION_MODERATOR = 0x1LL << 37; //can mute people's session
+
+// Group Banning
+const U64 GP_GROUP_BAN_ACCESS = 0x1LL << 51; // Allows access to ban / un-ban agents from a group.
+
+const U64 GP_DEFAULT_MEMBER = GP_ACCOUNTING_ACCOUNTABLE
+ | GP_LAND_ALLOW_SET_HOME
+ | GP_NOTICES_RECEIVE
+ | GP_SESSION_JOIN
+ | GP_SESSION_VOICE
+ ;
+
+const U64 GP_DEFAULT_OFFICER = GP_DEFAULT_MEMBER // Superset of GP_DEFAULT_MEMBER
+ | GP_GROUP_CHANGE_IDENTITY
+ | GP_LAND_ADMIN
+ | GP_LAND_ALLOW_EDIT_LAND
+ | GP_LAND_ALLOW_FLY
+ | GP_LAND_ALLOW_CREATE
+ | GP_LAND_ALLOW_LANDMARK
+ | GP_LAND_CHANGE_IDENTITY
+ | GP_LAND_CHANGE_MEDIA
+ | GP_LAND_DEED
+ | GP_LAND_DIVIDE_JOIN
+ | GP_LAND_EDIT
+ | GP_LAND_FIND_PLACES
+ | GP_LAND_GARDENING
+ | GP_LAND_MANAGE_ALLOWED
+ | GP_LAND_MANAGE_BANNED
+ | GP_LAND_MANAGE_PASSES
+ | GP_LAND_OPTIONS
+ | GP_LAND_RELEASE
+ | GP_LAND_RETURN_GROUP_OWNED
+ | GP_LAND_RETURN_GROUP_SET
+ | GP_LAND_RETURN_NON_GROUP
+ | GP_LAND_SET_LANDING_POINT
+ | GP_LAND_SET_SALE_INFO
+ | GP_MEMBER_EJECT
+ | GP_MEMBER_INVITE
+ | GP_MEMBER_OPTIONS
+ | GP_MEMBER_VISIBLE_IN_DIR
+ | GP_NOTICES_SEND
+ | GP_OBJECT_DEED
+ | GP_OBJECT_MANIPULATE
+ | GP_OBJECT_SET_SALE
+ | GP_ROLE_ASSIGN_MEMBER_LIMITED
+ | GP_ROLE_PROPERTIES
+ | GP_SESSION_MODERATOR
+ ;
+#endif
diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml
index 3ebb64e3fa..bdc884885f 100755
--- a/indra/newview/skins/default/colors.xml
+++ b/indra/newview/skins/default/colors.xml
@@ -56,7 +56,7 @@
<color
name="Black"
value="0 0 0 1" />
- <colork
+ <color
name="Black_10"
value="0 0 0 0.1" />
<color
@@ -904,5 +904,45 @@
<color
name="ResizebarBody"
value="0.208 0.208 0.208 1"/>
-
+
+ <!-- syntax highlighting (LSL Scripts) -->
+ <color
+ name="ScriptText"
+ reference="Black" />
+ <color
+ name="ScriptBackground"
+ reference="White" />
+ <color
+ name="ScriptCursorColor"
+ reference="Black" />
+ <color
+ name="SyntaxLslComment"
+ value="0 0.5 0 1" />
+ <color
+ name="SyntaxLslConstant"
+ value="0 0.6 0.6 1" />
+ <color
+ name="SyntaxLslControlFlow"
+ value="0.4 0 0.8 1" />
+ <color
+ name="SyntaxLslControlLabel"
+ value="0 0 0.8 1" />
+ <color
+ name="SyntaxLslDataType"
+ value="0.8 0.4 0 1" />
+ <color
+ name="SyntaxLslDeprecated"
+ value="0.9 0.0 0.66, 1" />
+ <color
+ name="SyntaxLslEvent"
+ value="0 0.3 0.5 1" />
+ <color
+ name="SyntaxLslFunction"
+ value="0.3 0 0.5 1" />
+ <color
+ name="SyntaxLslGodMode"
+ value="0.7 .2 .35 1" />
+ <color
+ name="SyntaxLslStringLiteral"
+ value="1 0.14 0 1" />
</colors>
diff --git a/indra/newview/skins/default/textures/bottomtray/ChatBarHandle.png b/indra/newview/skins/default/textures/bottomtray/ChatBarHandle.png
index 8b58db0cba..50239c8af8 100755
--- a/indra/newview/skins/default/textures/bottomtray/ChatBarHandle.png
+++ b/indra/newview/skins/default/textures/bottomtray/ChatBarHandle.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/bottomtray/Move_Fly_Off.png b/indra/newview/skins/default/textures/bottomtray/Move_Fly_Off.png
index 9e7291d6fb..fade065ce7 100755
--- a/indra/newview/skins/default/textures/bottomtray/Move_Fly_Off.png
+++ b/indra/newview/skins/default/textures/bottomtray/Move_Fly_Off.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/bottomtray/Notices_Unread.png b/indra/newview/skins/default/textures/bottomtray/Notices_Unread.png
index 0ac5b72b8f..eb2f3dbaa4 100755
--- a/indra/newview/skins/default/textures/bottomtray/Notices_Unread.png
+++ b/indra/newview/skins/default/textures/bottomtray/Notices_Unread.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/bottomtray/Snapshot_Off.png b/indra/newview/skins/default/textures/bottomtray/Snapshot_Off.png
index d7ec04237b..4ab4bbe4af 100755
--- a/indra/newview/skins/default/textures/bottomtray/Snapshot_Off.png
+++ b/indra/newview/skins/default/textures/bottomtray/Snapshot_Off.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/down_arrow.png b/indra/newview/skins/default/textures/down_arrow.png
index 155f80c97e..21a0fc5ec0 100755
--- a/indra/newview/skins/default/textures/down_arrow.png
+++ b/indra/newview/skins/default/textures/down_arrow.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Edit_Wrench.png b/indra/newview/skins/default/textures/icons/Edit_Wrench.png
index edb40b9c96..42f8466969 100755
--- a/indra/newview/skins/default/textures/icons/Edit_Wrench.png
+++ b/indra/newview/skins/default/textures/icons/Edit_Wrench.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Generic_Group_Large.png b/indra/newview/skins/default/textures/icons/Generic_Group_Large.png
index 75833eccf3..46ee6dfe2c 100755
--- a/indra/newview/skins/default/textures/icons/Generic_Group_Large.png
+++ b/indra/newview/skins/default/textures/icons/Generic_Group_Large.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Generic_Person.png b/indra/newview/skins/default/textures/icons/Generic_Person.png
index 45b491ab59..e1411354af 100755
--- a/indra/newview/skins/default/textures/icons/Generic_Person.png
+++ b/indra/newview/skins/default/textures/icons/Generic_Person.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Hierarchy_View_On.png b/indra/newview/skins/default/textures/icons/Hierarchy_View_On.png
index 296311e797..ae8c8b4c1a 100755
--- a/indra/newview/skins/default/textures/icons/Hierarchy_View_On.png
+++ b/indra/newview/skins/default/textures/icons/Hierarchy_View_On.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Inv_Link.png b/indra/newview/skins/default/textures/icons/Inv_Link.png
index c1543dacb5..26bf4086fb 100755
--- a/indra/newview/skins/default/textures/icons/Inv_Link.png
+++ b/indra/newview/skins/default/textures/icons/Inv_Link.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Inv_LostClosed.png b/indra/newview/skins/default/textures/icons/Inv_LostClosed.png
index a800217e0d..42b5c88fdd 100755
--- a/indra/newview/skins/default/textures/icons/Inv_LostClosed.png
+++ b/indra/newview/skins/default/textures/icons/Inv_LostClosed.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Inv_LostOpen.png b/indra/newview/skins/default/textures/icons/Inv_LostOpen.png
index 8c4a1a9ac0..a52168d6c7 100755
--- a/indra/newview/skins/default/textures/icons/Inv_LostOpen.png
+++ b/indra/newview/skins/default/textures/icons/Inv_LostOpen.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Inv_Mesh.png b/indra/newview/skins/default/textures/icons/Inv_Mesh.png
index f1f21f7941..77e52264c3 100755
--- a/indra/newview/skins/default/textures/icons/Inv_Mesh.png
+++ b/indra/newview/skins/default/textures/icons/Inv_Mesh.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Inv_SysClosed.png b/indra/newview/skins/default/textures/icons/Inv_SysClosed.png
index dcf998449f..57eafc4047 100755
--- a/indra/newview/skins/default/textures/icons/Inv_SysClosed.png
+++ b/indra/newview/skins/default/textures/icons/Inv_SysClosed.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Inv_SysOpen.png b/indra/newview/skins/default/textures/icons/Inv_SysOpen.png
index 0efd403c95..b080688e55 100755
--- a/indra/newview/skins/default/textures/icons/Inv_SysOpen.png
+++ b/indra/newview/skins/default/textures/icons/Inv_SysOpen.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Inv_TrashClosed.png b/indra/newview/skins/default/textures/icons/Inv_TrashClosed.png
index c5201e6f9a..7a958c1ec0 100755
--- a/indra/newview/skins/default/textures/icons/Inv_TrashClosed.png
+++ b/indra/newview/skins/default/textures/icons/Inv_TrashClosed.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Inv_TrashOpen.png b/indra/newview/skins/default/textures/icons/Inv_TrashOpen.png
index 4a886a3f37..11e6bf33bc 100755
--- a/indra/newview/skins/default/textures/icons/Inv_TrashOpen.png
+++ b/indra/newview/skins/default/textures/icons/Inv_TrashOpen.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Parcel_FlyNo_Dark.png b/indra/newview/skins/default/textures/icons/Parcel_FlyNo_Dark.png
index e0b18b2451..af65873cb6 100755
--- a/indra/newview/skins/default/textures/icons/Parcel_FlyNo_Dark.png
+++ b/indra/newview/skins/default/textures/icons/Parcel_FlyNo_Dark.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Parcel_FlyNo_Light.png b/indra/newview/skins/default/textures/icons/Parcel_FlyNo_Light.png
index 101aaa42b1..6ceb9d3d8f 100755
--- a/indra/newview/skins/default/textures/icons/Parcel_FlyNo_Light.png
+++ b/indra/newview/skins/default/textures/icons/Parcel_FlyNo_Light.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Parcel_Fly_Dark.png b/indra/newview/skins/default/textures/icons/Parcel_Fly_Dark.png
index c27f18e3c7..7084e2f591 100755
--- a/indra/newview/skins/default/textures/icons/Parcel_Fly_Dark.png
+++ b/indra/newview/skins/default/textures/icons/Parcel_Fly_Dark.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOff_Dark.png b/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOff_Dark.png
index 956e02b14d..60d056b573 100755
--- a/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOff_Dark.png
+++ b/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOff_Dark.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOff_Light.png b/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOff_Light.png
index 434caeda8b..d004b0f750 100755
--- a/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOff_Light.png
+++ b/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOff_Light.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOn_Dark.png b/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOn_Dark.png
index 064687ed0f..eed28765f7 100755
--- a/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOn_Dark.png
+++ b/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOn_Dark.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOn_Light.png b/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOn_Light.png
index 5465650d0c..e35de3c2fa 100755
--- a/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOn_Light.png
+++ b/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOn_Light.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Person_Check.png b/indra/newview/skins/default/textures/icons/Person_Check.png
index f8638540d4..d40eafe793 100755
--- a/indra/newview/skins/default/textures/icons/Person_Check.png
+++ b/indra/newview/skins/default/textures/icons/Person_Check.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Person_Star.png b/indra/newview/skins/default/textures/icons/Person_Star.png
index ad10580ac4..e02935672f 100755
--- a/indra/newview/skins/default/textures/icons/Person_Star.png
+++ b/indra/newview/skins/default/textures/icons/Person_Star.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/SL_Logo.png b/indra/newview/skins/default/textures/icons/SL_Logo.png
index 8342d7cfee..5e376c72f9 100755
--- a/indra/newview/skins/default/textures/icons/SL_Logo.png
+++ b/indra/newview/skins/default/textures/icons/SL_Logo.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Shop.png b/indra/newview/skins/default/textures/icons/Shop.png
index 81c13eeabd..8977c49195 100755
--- a/indra/newview/skins/default/textures/icons/Shop.png
+++ b/indra/newview/skins/default/textures/icons/Shop.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Web_Profile_Off.png b/indra/newview/skins/default/textures/icons/Web_Profile_Off.png
index f5fb774a6f..5716dd6d22 100755
--- a/indra/newview/skins/default/textures/icons/Web_Profile_Off.png
+++ b/indra/newview/skins/default/textures/icons/Web_Profile_Off.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/back_arrow_off.png b/indra/newview/skins/default/textures/icons/back_arrow_off.png
index 422f67cf83..e7cea49d73 100755
--- a/indra/newview/skins/default/textures/icons/back_arrow_off.png
+++ b/indra/newview/skins/default/textures/icons/back_arrow_off.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/back_arrow_over.png b/indra/newview/skins/default/textures/icons/back_arrow_over.png
index b4cc170f37..4e5a93a25f 100755
--- a/indra/newview/skins/default/textures/icons/back_arrow_over.png
+++ b/indra/newview/skins/default/textures/icons/back_arrow_over.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/back_arrow_press.png b/indra/newview/skins/default/textures/icons/back_arrow_press.png
index a9e2f326a7..289b8c20e6 100755
--- a/indra/newview/skins/default/textures/icons/back_arrow_press.png
+++ b/indra/newview/skins/default/textures/icons/back_arrow_press.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/check_mark.png b/indra/newview/skins/default/textures/icons/check_mark.png
index 2c05297f4f..4d927cb29e 100755
--- a/indra/newview/skins/default/textures/icons/check_mark.png
+++ b/indra/newview/skins/default/textures/icons/check_mark.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/pop_up_caution.png b/indra/newview/skins/default/textures/icons/pop_up_caution.png
index 78b681cb33..8364bcc328 100755
--- a/indra/newview/skins/default/textures/icons/pop_up_caution.png
+++ b/indra/newview/skins/default/textures/icons/pop_up_caution.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/menu_separator.png b/indra/newview/skins/default/textures/menu_separator.png
index 89dcdcdff5..7bb27c499d 100755
--- a/indra/newview/skins/default/textures/menu_separator.png
+++ b/indra/newview/skins/default/textures/menu_separator.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/model_wizard/progress_bar_bg.png b/indra/newview/skins/default/textures/model_wizard/progress_bar_bg.png
index d0b213cdc5..7c6920205f 100755
--- a/indra/newview/skins/default/textures/model_wizard/progress_bar_bg.png
+++ b/indra/newview/skins/default/textures/model_wizard/progress_bar_bg.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/model_wizard/progress_light.png b/indra/newview/skins/default/textures/model_wizard/progress_light.png
index 019344f812..c8ab151c44 100755
--- a/indra/newview/skins/default/textures/model_wizard/progress_light.png
+++ b/indra/newview/skins/default/textures/model_wizard/progress_light.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/navbar/Search.png b/indra/newview/skins/default/textures/navbar/Search.png
index 0d0e330bc7..4c29e57f7b 100755
--- a/indra/newview/skins/default/textures/navbar/Search.png
+++ b/indra/newview/skins/default/textures/navbar/Search.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/navbar/separator.png b/indra/newview/skins/default/textures/navbar/separator.png
index b93e5791a7..c1d74e5a64 100755
--- a/indra/newview/skins/default/textures/navbar/separator.png
+++ b/indra/newview/skins/default/textures/navbar/separator.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/taskpanel/Sidebar_Icon_Dock_Foreground.png b/indra/newview/skins/default/textures/taskpanel/Sidebar_Icon_Dock_Foreground.png
index 50c01062a5..4e59042e33 100755
--- a/indra/newview/skins/default/textures/taskpanel/Sidebar_Icon_Dock_Foreground.png
+++ b/indra/newview/skins/default/textures/taskpanel/Sidebar_Icon_Dock_Foreground.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/taskpanel/Sidebar_Icon_Dock_Press.png b/indra/newview/skins/default/textures/taskpanel/Sidebar_Icon_Dock_Press.png
index bf2065cd37..be7b298bb8 100755
--- a/indra/newview/skins/default/textures/taskpanel/Sidebar_Icon_Dock_Press.png
+++ b/indra/newview/skins/default/textures/taskpanel/Sidebar_Icon_Dock_Press.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/taskpanel/Sidebar_Icon_Undock_Foreground.png b/indra/newview/skins/default/textures/taskpanel/Sidebar_Icon_Undock_Foreground.png
index 8b48258142..1e234ff09b 100755
--- a/indra/newview/skins/default/textures/taskpanel/Sidebar_Icon_Undock_Foreground.png
+++ b/indra/newview/skins/default/textures/taskpanel/Sidebar_Icon_Undock_Foreground.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/taskpanel/Sidebar_Icon_Undock_Press.png b/indra/newview/skins/default/textures/taskpanel/Sidebar_Icon_Undock_Press.png
index 09efe779fe..48c78b453d 100755
--- a/indra/newview/skins/default/textures/taskpanel/Sidebar_Icon_Undock_Press.png
+++ b/indra/newview/skins/default/textures/taskpanel/Sidebar_Icon_Undock_Press.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index 94c187e21a..1f10d966d5 100755
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -133,6 +133,8 @@ with the same filename but different name
<texture name="Command_Chat_Icon" file_name="toolbar_icons/chat.png" preload="true" />
<texture name="Command_Compass_Icon" file_name="toolbar_icons/land.png" preload="true" />
<texture name="Command_Destinations_Icon" file_name="toolbar_icons/destinations.png" preload="true" />
+ <texture name="Command_Facebook_Icon" file_name="toolbar_icons/facebook.png" preload="true" />
+ <texture name="Command_Flickr_Icon" file_name="toolbar_icons/flickr.png" preload="true" />
<texture name="Command_Gestures_Icon" file_name="toolbar_icons/gestures.png" preload="true" />
<texture name="Command_HowTo_Icon" file_name="toolbar_icons/howto.png" preload="true" />
<texture name="Command_Inventory_Icon" file_name="toolbar_icons/inventory.png" preload="true" />
@@ -148,9 +150,9 @@ with the same filename but different name
<texture name="Command_Preferences_Icon" file_name="toolbar_icons/preferences.png" preload="true" />
<texture name="Command_Profile_Icon" file_name="toolbar_icons/profile.png" preload="true" />
<texture name="Command_Search_Icon" file_name="toolbar_icons/search.png" preload="true" />
- <texture name="Command_Social_Icon" file_name="toolbar_icons/facebook.png" preload="true" />
<texture name="Command_Snapshot_Icon" file_name="toolbar_icons/snapshot.png" preload="true" />
<texture name="Command_Speak_Icon" file_name="toolbar_icons/speak.png" preload="true" />
+ <texture name="Command_Twitter_Icon" file_name="toolbar_icons/twitter.png" preload="true" />
<texture name="Command_View_Icon" file_name="toolbar_icons/view.png" preload="true" />
<texture name="Command_Voice_Icon" file_name="toolbar_icons/nearbyvoice.png" preload="true" />
<texture name="Caret_Bottom_Icon" file_name="toolbar_icons/caret_bottom.png" preload="true" scale.left="1" scale.top="23" scale.right="15" scale.bottom="1" />
@@ -234,6 +236,7 @@ with the same filename but different name
<texture name="Home_Off" file_name="navbar/Home_Off.png" preload="false" />
+ <texture name="Horizontal Drag Handle" file_name="widgets/horizontal_drag_handle.png" scale.left="8" scale.right="120" scale.bottom="1" scale.top="6" scale_type="scale_outer"/>
<texture name="Icon_Close_Foreground" file_name="windows/Icon_Close_Foreground.png" preload="true" />
<texture name="Icon_Close_Press" file_name="windows/Icon_Close_Press.png" preload="true" />
@@ -242,7 +245,7 @@ with the same filename but different name
<texture name="Icon_Dock_Foreground" file_name="windows/Icon_Dock_Foreground.png" preload="true" />
<texture name="Icon_Dock_Press" file_name="windows/Icon_Dock_Press.png" preload="true" />
- <texture name="Icon_For_Sale" file_name="icons/Icon_For_sale.png" preload="false" />
+ <texture name="Icon_For_Sale" file_name="icons/Icon_For_Sale.png" preload="false" />
<texture name="Icon_Gear_Background" file_name="windows/Icon_Gear_Background.png" preload="false" />
<texture name="Icon_Gear_Foreground" file_name="windows/Icon_Gear_Foreground.png" preload="false" />
@@ -343,8 +346,8 @@ with the same filename but different name
<texture name="ModelImport_Status_Warning" file_name="lag_status_warning.tga" preload="false"/>
<texture name="ModelImport_Status_Error" file_name="red_x.png" preload="false"/>
- <texture name="MouseLook_View_Off" file_name="bottomtray/MouseLook_view_off.png" preload="false" />
- <texture name="MouseLook_View_On" file_name="bottomtray/MouseLook_view_on.png" preload="false" />
+ <texture name="MouseLook_View_Off" file_name="bottomtray/Mouselook_View_Off.png" preload="false" />
+ <texture name="MouseLook_View_On" file_name="bottomtray/Mouselook_View_On.png" preload="false" />
<texture name="Move_Fly_Off" file_name="bottomtray/Move_Fly_Off.png" preload="false" />
<texture name="Move_Run_Off" file_name="bottomtray/Move_Run_Off.png" preload="false" />
@@ -486,6 +489,11 @@ with the same filename but different name
<texture name="PushButton_Selected_Press" file_name="widgets/PushButton_Selected_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" />
<texture name="PushButton_Selected_Disabled" file_name="widgets/PushButton_Selected_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" />
+ <texture name="PushButton_Login" file_name="widgets/PushButton_Login.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" />
+ <texture name="PushButton_Login_Over" file_name="widgets/PushButton_Login_Over.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" />
+ <texture name="PushButton_Login_Pressed" file_name="widgets/PushButton_Login_Pressed.png" preload="true" scale.left="4" scale.top="19" scale.right="28" scale.bottom="4" />
+
+
<texture name="RadioButton_Press" file_name="widgets/RadioButton_Press.png" preload="true" />
<texture name="RadioButton_On_Press" file_name="widgets/RadioButton_On_Press.png" preload="true" />
<texture name="RadioButton_Off" file_name="widgets/RadioButton_Off.png" preload="true" />
@@ -574,6 +582,11 @@ with the same filename but different name
<texture name="startup_logo" file_name="windows/startup_logo.png" preload="true" />
+ <texture name="login_sl_logo" file_name="windows/login_sl_logo.png" preload="true" />
+ <texture name="login_sl_logo_small" file_name="windows/login_sl_logo_small.png" preload="true" />
+ <texture name="first_login_image_left" file_name="windows/first_login_image_left.png" preload="true" />
+ <texture name="first_login_image_right" file_name="windows/first_login_image_right.png" preload="true" />
+
<texture name="Stepper_Down_Off" file_name="widgets/Stepper_Down_Off.png" preload="false" />
<texture name="Stepper_Down_Press" file_name="widgets/Stepper_Down_Press.png" preload="false" />
<texture name="Stepper_Up_Off" file_name="widgets/Stepper_Up_Off.png" preload="false" />
@@ -652,6 +665,7 @@ with the same filename but different name
<texture name="Unread_Chiclet" file_name="bottomtray/Unread_Chiclet.png" preload="false" />
<texture name="UpArrow_Off" file_name="icons/UpArrow_Off.png" preload="false" />
+ <texture name="Vertical Drag Handle" file_name="widgets/vertical_drag_handle.png" scale.left="2" scale.right="7" scale.bottom="8" scale.top="120" scale_type="scale_outer"/>
<texture name="Volume_Background" file_name="windows/Volume_Background.png" preload="false"
scale.left="6" scale.top="33" scale.right="63" scale.bottom="10" />
@@ -781,6 +795,4 @@ with the same filename but different name
<texture name="Camera_Drag_Dot" file_name="world/CameraDragDot.png"/>
<texture name="NavBar Separator" file_name="navbar/separator.png"/>
- <texture name="Horizontal Drag Handle" file_name="widgets/horizontal_drag_handle.png"/>
- <texture name="Vertical Drag Handle" file_name="widgets/vertical_drag_handle.png"/>
</textures>
diff --git a/indra/newview/skins/default/textures/toolbar_icons/facebook.png b/indra/newview/skins/default/textures/toolbar_icons/facebook.png
index b960b834dc..ae524b643f 100644
--- a/indra/newview/skins/default/textures/toolbar_icons/facebook.png
+++ b/indra/newview/skins/default/textures/toolbar_icons/facebook.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/toolbar_icons/flickr.png b/indra/newview/skins/default/textures/toolbar_icons/flickr.png
new file mode 100644
index 0000000000..7fce9f0df2
--- /dev/null
+++ b/indra/newview/skins/default/textures/toolbar_icons/flickr.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/toolbar_icons/mini_cart.png b/indra/newview/skins/default/textures/toolbar_icons/mini_cart.png
index 9fcf46794d..9eeb1d4e09 100755
--- a/indra/newview/skins/default/textures/toolbar_icons/mini_cart.png
+++ b/indra/newview/skins/default/textures/toolbar_icons/mini_cart.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/toolbar_icons/twitter.png b/indra/newview/skins/default/textures/toolbar_icons/twitter.png
new file mode 100644
index 0000000000..a99c490887
--- /dev/null
+++ b/indra/newview/skins/default/textures/toolbar_icons/twitter.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/up_arrow.png b/indra/newview/skins/default/textures/up_arrow.png
index fe68ad49dc..76f839510e 100755
--- a/indra/newview/skins/default/textures/up_arrow.png
+++ b/indra/newview/skins/default/textures/up_arrow.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/Arrow_Down.png b/indra/newview/skins/default/textures/widgets/Arrow_Down.png
index e10f6472eb..cb4eea953c 100755
--- a/indra/newview/skins/default/textures/widgets/Arrow_Down.png
+++ b/indra/newview/skins/default/textures/widgets/Arrow_Down.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Left_Disabled.png b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Left_Disabled.png
index c7c0eaa96b..3897e16801 100755
--- a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Left_Disabled.png
+++ b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Left_Disabled.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Left_Off.png b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Left_Off.png
index 4a73c254fc..95a4a36c9d 100755
--- a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Left_Off.png
+++ b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Left_Off.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Left_Over.png b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Left_Over.png
index 6fb5c432de..20d1ebf53d 100755
--- a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Left_Over.png
+++ b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Left_Over.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Left_Press.png b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Left_Press.png
index fa18517933..63f4b503e2 100755
--- a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Left_Press.png
+++ b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Left_Press.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Middle_Disabled.png b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Middle_Disabled.png
index bed1a701bd..d570f77f6d 100755
--- a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Middle_Disabled.png
+++ b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Middle_Disabled.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Middle_Off.png b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Middle_Off.png
index 57ce9af574..28a002b118 100755
--- a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Middle_Off.png
+++ b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Middle_Off.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Middle_Over.png b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Middle_Over.png
index 2c43022f0e..a195e80b0e 100755
--- a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Middle_Over.png
+++ b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Middle_Over.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Middle_Press.png b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Middle_Press.png
index 6b8c1baca4..9863ee32cb 100755
--- a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Middle_Press.png
+++ b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Middle_Press.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Right_Disabled.png b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Right_Disabled.png
index 51505e80c5..2ffbc4a16f 100755
--- a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Right_Disabled.png
+++ b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Right_Disabled.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Right_Off.png b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Right_Off.png
index 9f93efbd93..ce47da169b 100755
--- a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Right_Off.png
+++ b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Right_Off.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Right_Over.png b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Right_Over.png
index 3a4ec1a315..2225150983 100755
--- a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Right_Over.png
+++ b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Right_Over.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Right_Press.png b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Right_Press.png
index 1f1b4c2ed5..2d541d0f70 100755
--- a/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Right_Press.png
+++ b/indra/newview/skins/default/textures/widgets/BreadCrumbBtn_Right_Press.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/PushButton_Login.png b/indra/newview/skins/default/textures/widgets/PushButton_Login.png
new file mode 100644
index 0000000000..6f8b5a0770
--- /dev/null
+++ b/indra/newview/skins/default/textures/widgets/PushButton_Login.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/PushButton_Login_Over.png b/indra/newview/skins/default/textures/widgets/PushButton_Login_Over.png
new file mode 100644
index 0000000000..e9e8af13d4
--- /dev/null
+++ b/indra/newview/skins/default/textures/widgets/PushButton_Login_Over.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/PushButton_Login_Pressed.png b/indra/newview/skins/default/textures/widgets/PushButton_Login_Pressed.png
new file mode 100644
index 0000000000..4a9f1052b3
--- /dev/null
+++ b/indra/newview/skins/default/textures/widgets/PushButton_Login_Pressed.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/Tooltip.png b/indra/newview/skins/default/textures/widgets/Tooltip.png
index f989ac9083..3c4d6a965d 100755
--- a/indra/newview/skins/default/textures/widgets/Tooltip.png
+++ b/indra/newview/skins/default/textures/widgets/Tooltip.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/horizontal_drag_handle.png b/indra/newview/skins/default/textures/widgets/horizontal_drag_handle.png
index 642eac4065..5f5a33be42 100644
--- a/indra/newview/skins/default/textures/widgets/horizontal_drag_handle.png
+++ b/indra/newview/skins/default/textures/widgets/horizontal_drag_handle.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/vertical_drag_handle.png b/indra/newview/skins/default/textures/widgets/vertical_drag_handle.png
index b06b70cf36..2ce5208c21 100644
--- a/indra/newview/skins/default/textures/widgets/vertical_drag_handle.png
+++ b/indra/newview/skins/default/textures/widgets/vertical_drag_handle.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/Icon_Close_Foreground.png b/indra/newview/skins/default/textures/windows/Icon_Close_Foreground.png
index 2292b79eda..3534b716fd 100755
--- a/indra/newview/skins/default/textures/windows/Icon_Close_Foreground.png
+++ b/indra/newview/skins/default/textures/windows/Icon_Close_Foreground.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/Icon_Help_Foreground.png b/indra/newview/skins/default/textures/windows/Icon_Help_Foreground.png
index 1a514742d3..177c0675bb 100755
--- a/indra/newview/skins/default/textures/windows/Icon_Help_Foreground.png
+++ b/indra/newview/skins/default/textures/windows/Icon_Help_Foreground.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/Icon_Help_Press.png b/indra/newview/skins/default/textures/windows/Icon_Help_Press.png
index 7478644b6a..aa21a1c789 100755
--- a/indra/newview/skins/default/textures/windows/Icon_Help_Press.png
+++ b/indra/newview/skins/default/textures/windows/Icon_Help_Press.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/Icon_Minimize_Foreground.png b/indra/newview/skins/default/textures/windows/Icon_Minimize_Foreground.png
index 9f72a5422b..a98a3a98c2 100755
--- a/indra/newview/skins/default/textures/windows/Icon_Minimize_Foreground.png
+++ b/indra/newview/skins/default/textures/windows/Icon_Minimize_Foreground.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/Icon_Minimize_Press.png b/indra/newview/skins/default/textures/windows/Icon_Minimize_Press.png
index 07db8be1b0..5df0e7691c 100755
--- a/indra/newview/skins/default/textures/windows/Icon_Minimize_Press.png
+++ b/indra/newview/skins/default/textures/windows/Icon_Minimize_Press.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/Icon_Restore_Foreground.png b/indra/newview/skins/default/textures/windows/Icon_Restore_Foreground.png
index 1e753aaf1d..b4d4ef01fc 100755
--- a/indra/newview/skins/default/textures/windows/Icon_Restore_Foreground.png
+++ b/indra/newview/skins/default/textures/windows/Icon_Restore_Foreground.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/Icon_Restore_Press.png b/indra/newview/skins/default/textures/windows/Icon_Restore_Press.png
index be66b05230..0d0238dc32 100755
--- a/indra/newview/skins/default/textures/windows/Icon_Restore_Press.png
+++ b/indra/newview/skins/default/textures/windows/Icon_Restore_Press.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/first_login_image_left.png b/indra/newview/skins/default/textures/windows/first_login_image_left.png
new file mode 100644
index 0000000000..b405a88245
--- /dev/null
+++ b/indra/newview/skins/default/textures/windows/first_login_image_left.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/first_login_image_right.png b/indra/newview/skins/default/textures/windows/first_login_image_right.png
new file mode 100644
index 0000000000..22a6dd8a53
--- /dev/null
+++ b/indra/newview/skins/default/textures/windows/first_login_image_right.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/hint_arrow_down.png b/indra/newview/skins/default/textures/windows/hint_arrow_down.png
index ddadef0978..0cb5a819ec 100755
--- a/indra/newview/skins/default/textures/windows/hint_arrow_down.png
+++ b/indra/newview/skins/default/textures/windows/hint_arrow_down.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/hint_arrow_left.png b/indra/newview/skins/default/textures/windows/hint_arrow_left.png
index 2794b967e8..45204d9132 100755
--- a/indra/newview/skins/default/textures/windows/hint_arrow_left.png
+++ b/indra/newview/skins/default/textures/windows/hint_arrow_left.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/hint_arrow_lower_left.png b/indra/newview/skins/default/textures/windows/hint_arrow_lower_left.png
index 0dfc99898d..3e3ae9f42d 100755
--- a/indra/newview/skins/default/textures/windows/hint_arrow_lower_left.png
+++ b/indra/newview/skins/default/textures/windows/hint_arrow_lower_left.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/hint_arrow_right.png b/indra/newview/skins/default/textures/windows/hint_arrow_right.png
index 7ac57f805b..3fe7a773c3 100755
--- a/indra/newview/skins/default/textures/windows/hint_arrow_right.png
+++ b/indra/newview/skins/default/textures/windows/hint_arrow_right.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/hint_arrow_up.png b/indra/newview/skins/default/textures/windows/hint_arrow_up.png
index bb3e1c07fa..44f003dc63 100755
--- a/indra/newview/skins/default/textures/windows/hint_arrow_up.png
+++ b/indra/newview/skins/default/textures/windows/hint_arrow_up.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/hint_background.png b/indra/newview/skins/default/textures/windows/hint_background.png
index cfac5deacb..e25f354347 100755
--- a/indra/newview/skins/default/textures/windows/hint_background.png
+++ b/indra/newview/skins/default/textures/windows/hint_background.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/login_sl_logo.png b/indra/newview/skins/default/textures/windows/login_sl_logo.png
new file mode 100644
index 0000000000..9810d00237
--- /dev/null
+++ b/indra/newview/skins/default/textures/windows/login_sl_logo.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/login_sl_logo_small.png b/indra/newview/skins/default/textures/windows/login_sl_logo_small.png
new file mode 100644
index 0000000000..0a245442d5
--- /dev/null
+++ b/indra/newview/skins/default/textures/windows/login_sl_logo_small.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/yellow_gradient.png b/indra/newview/skins/default/textures/windows/yellow_gradient.png
index 5fd847aaef..5bd21b4297 100755
--- a/indra/newview/skins/default/textures/windows/yellow_gradient.png
+++ b/indra/newview/skins/default/textures/windows/yellow_gradient.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/world/CameraDragDot.png b/indra/newview/skins/default/textures/world/CameraDragDot.png
index 57698e1956..2ccf098e0f 100755
--- a/indra/newview/skins/default/textures/world/CameraDragDot.png
+++ b/indra/newview/skins/default/textures/world/CameraDragDot.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/world/NoEntryLines.png b/indra/newview/skins/default/textures/world/NoEntryLines.png
index 18e270bde5..d7496b8bd0 100755
--- a/indra/newview/skins/default/textures/world/NoEntryLines.png
+++ b/indra/newview/skins/default/textures/world/NoEntryLines.png
Binary files differ
diff --git a/indra/newview/skins/default/xui/da/floater_lagmeter.xml b/indra/newview/skins/default/xui/da/floater_lagmeter.xml
index 149d174c34..149d174c34 100755..100644
--- a/indra/newview/skins/default/xui/da/floater_lagmeter.xml
+++ b/indra/newview/skins/default/xui/da/floater_lagmeter.xml
diff --git a/indra/newview/skins/default/xui/da/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/da/panel_preferences_privacy.xml
index 0df330b016..6d48180707 100755
--- a/indra/newview/skins/default/xui/da/panel_preferences_privacy.xml
+++ b/indra/newview/skins/default/xui/da/panel_preferences_privacy.xml
@@ -7,7 +7,7 @@
<text name="cache_size_label_l">
(Lokationer, billeder, web, søge historik)
</text>
- <check_box label="Vis dig selv i søgeresultater" name="online_searchresults"/>
+ <check_box label="Vis min profil info i søgeresultater" name="online_searchresults"/>
<check_box label="Kun venner og grupper ved jeg er online" name="online_visibility"/>
<check_box label="Kun venner og grupper kan sende besked til mig" name="voice_call_friends_only_check"/>
<check_box label="Slå mikrofon fra når opkald slutter" name="auto_disengage_mic_check"/>
diff --git a/indra/newview/skins/default/xui/da/sidepanel_inventory.xml b/indra/newview/skins/default/xui/da/sidepanel_inventory.xml
index b3293b981e..b4b494cafa 100755
--- a/indra/newview/skins/default/xui/da/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/da/sidepanel_inventory.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel label="Ting" name="objects panel">
- <panel label="" name="sidepanel__inventory_panel">
+ <panel label="" name="sidepanel_inventory_panel">
<panel name="button_panel">
<layout_stack name="button_panel_ls">
<layout_panel name="info_btn_lp">
diff --git a/indra/newview/skins/default/xui/da/strings.xml b/indra/newview/skins/default/xui/da/strings.xml
index 11d100eeff..74d160dfae 100755
--- a/indra/newview/skins/default/xui/da/strings.xml
+++ b/indra/newview/skins/default/xui/da/strings.xml
@@ -1172,7 +1172,8 @@ Prøv venligst om lidt igen.
<string name="InventoryNoTexture">
Du har ikke en kopi af denne tekstur i din beholdning
</string>
- <string name="no_transfer" value=" (ikke overdragbar)"/>
+ <string name="Unconstrained">Ikke låst</string>
+ <string name="no_transfer" value=" (ikke overdragbar)"/>
<string name="no_modify" value=" (ikke redigere)"/>
<string name="no_copy" value=" (ikke kopiere)"/>
<string name="worn" value=" (båret)"/>
diff --git a/indra/newview/skins/default/xui/de/floater_big_preview.xml b/indra/newview/skins/default/xui/de/floater_big_preview.xml
new file mode 100644
index 0000000000..c5ce56d1d9
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/floater_big_preview.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_big_preview" title="VORSCHAU"/>
diff --git a/indra/newview/skins/default/xui/de/floater_facebook.xml b/indra/newview/skins/default/xui/de/floater_facebook.xml
new file mode 100644
index 0000000000..25b11536eb
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/floater_facebook.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_facebook" title="AUF FACEBOOK POSTEN">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="STATUS" name="panel_facebook_status"/>
+ <panel label="FOTO" name="panel_facebook_photo"/>
+ <panel label="EINCHECKEN" name="panel_facebook_place"/>
+ <panel label="FREUNDE" name="panel_facebook_friends"/>
+ <panel label="KONTO" name="panel_facebook_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ Fehler
+ </text>
+ <text name="connection_loading_text">
+ Laden...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/de/floater_flickr.xml b/indra/newview/skins/default/xui/de/floater_flickr.xml
new file mode 100644
index 0000000000..b50fa19ec8
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/floater_flickr.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_flickr" title="AUF FLICKR HOCHLADEN">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="FOTO" name="panel_flickr_photo"/>
+ <panel label="KONTO" name="panel_flickr_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ Fehler
+ </text>
+ <text name="connection_loading_text">
+ Laden...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/de/floater_lagmeter.xml b/indra/newview/skins/default/xui/de/floater_lagmeter.xml
index 45ff37c147..45ff37c147 100755..100644
--- a/indra/newview/skins/default/xui/de/floater_lagmeter.xml
+++ b/indra/newview/skins/default/xui/de/floater_lagmeter.xml
diff --git a/indra/newview/skins/default/xui/de/floater_perms_default.xml b/indra/newview/skins/default/xui/de/floater_perms_default.xml
new file mode 100644
index 0000000000..6d6c89172d
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/floater_perms_default.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="perms default" title="STANDARD-ERSTELLUNGSBERECHTIGUNGEN">
+ <panel label="Standardberechtigungen" name="default permissions"/>
+ <button label="OK" label_selected="OK" name="ok"/>
+ <button label="Abbrechen" label_selected="Abbrechen" name="cancel"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/de/floater_region_restarting.xml b/indra/newview/skins/default/xui/de/floater_region_restarting.xml
new file mode 100644
index 0000000000..890391c508
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/floater_region_restarting.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="region_restarting" title="REGION WIRD NEU GESTARTET">
+ <string name="RegionName">
+ Die Region, in der Sie sich gerade befinden ([NAME]), wird gleich neu gestartet.
+
+Wenn Sie in dieser Region bleiben, werden Sie abgemeldet.
+ </string>
+ <string name="RestartSeconds">
+ Sekunden bis Neustart
+[SECONDS]
+ </string>
+ <panel name="layout_panel_1">
+ <text name="region_name">
+ Die Region, in der Sie sich gerade befinden (-längster Regionsname-), wird gleich neu gestartet.
+
+Wenn Sie in dieser Region bleiben, werden Sie abgemeldet.
+ </text>
+ <text name="restart_seconds">
+ Sekunden bis Neustart
+ 32767
+ </text>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/de/floater_report_abuse.xml b/indra/newview/skins/default/xui/de/floater_report_abuse.xml
index e37e298478..34cb3d1cc2 100755
--- a/indra/newview/skins/default/xui/de/floater_report_abuse.xml
+++ b/indra/newview/skins/default/xui/de/floater_report_abuse.xml
@@ -45,7 +45,7 @@ Objekt:
<combo_box.item label="Alter &gt; Erwachsener Einwohner in Teen Second Life" name="Age__Adult_resident_on_Teen_Second_Life"/>
<combo_box.item label="Alter &gt; Minderjähriger Einwohner außerhalb Teen Second Life" name="Age__Underage_resident_outside_of_Teen_Second_Life"/>
<combo_box.item label="Angriff &gt; Kampf-Sandbox / unsichere Region" name="Assault__Combat_sandbox___unsafe_area"/>
- <combo_box.item label="Angriff &gt; Sichere Region" name="Assault__Safe_area"/>
+ <combo_box.item label="Angriff &gt; Anschießen, Schubsen oder Anrempeln eines anderen Einwohners in einer sicheren Gegend" name="Assault__Safe_area"/>
<combo_box.item label="Angriff &gt; Sandbox für Waffentest" name="Assault__Weapons_testing_sandbox"/>
<combo_box.item label="Handel &gt; Produkt nicht geliefert oder Dienstleistung nicht erbracht" name="Commerce__Failure_to_deliver_product_or_service"/>
<combo_box.item label="Offenlegung &gt; Informationen aus realer Welt" name="Disclosure__Real_world_information"/>
@@ -59,22 +59,22 @@ Objekt:
<combo_box.item label="Betrug &gt; L$" name="Fraud__L$"/>
<combo_box.item label="Betrug &gt; Land" name="Fraud__Land"/>
<combo_box.item label="Betrug &gt; Schneeballsystem oder Kettenbrief" name="Fraud__Pyramid_scheme_or_chain_letter"/>
- <combo_box.item label="Betrug &gt; US$" name="Fraud__US$"/>
+ <combo_box.item label="Betrug &gt; L$ oder US$" name="Fraud__US$"/>
<combo_box.item label="Belästigung &gt; Werbefarmen / visueller Spam" name="Harassment__Advert_farms___visual_spam"/>
<combo_box.item label="Belästigung &gt; Diffamieren von Einzelpersonen/Gruppen" name="Harassment__Defaming_individuals_or_groups"/>
<combo_box.item label="Belästigung &gt; Bewegungseinschränkung" name="Harassment__Impeding_movement"/>
<combo_box.item label="Belästigung &gt; Sexuelle Belästigung" name="Harassment__Sexual_harassment"/>
- <combo_box.item label="Belästigung &gt; Anstiften Dritter zur Missachtung der Nutzungsbedingungen" name="Harassment__Solicting_inciting_others_to_violate_ToS"/>
+ <combo_box.item label="Nötigung &gt; Böswilliges Störverhalten" name="Harassment__Solicting_inciting_others_to_violate_ToS"/>
<combo_box.item label="Belästigung &gt; Beschimpfung" name="Harassment__Verbal_abuse"/>
<combo_box.item label="Unanständigkeit &gt; Anstößige Inhalte oder Handlungen in der Öffentlichkeit" name="Indecency__Broadly_offensive_content_or_conduct"/>
<combo_box.item label="Unanständigkeit &gt; Anstößiger Avatarname" name="Indecency__Inappropriate_avatar_name"/>
- <combo_box.item label="Unanständigkeit &gt; Unangemessener Inhalt oder unangemessenes Verhalten in PG-Region" name="Indecency__Mature_content_in_PG_region"/>
+ <combo_box.item label="Unsittliches Verhalten &gt; Für Regionseinstufung unpassende Inhalte/Verhaltensweisen" name="Indecency__Mature_content_in_PG_region"/>
<combo_box.item label="Unanständigkeit &gt; Unangemessener Inhalt oder unangemessenes Verhalten in moderater Region" name="Indecency__Inappropriate_content_in_Mature_region"/>
<combo_box.item label="Urheberrechtsverletzung &gt; Entfernen von Inhalten" name="Intellectual_property_infringement_Content_Removal"/>
<combo_box.item label="Urheberrechtsverletzung &gt; CopyBot oder Berechtigungs-Exploit" name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit"/>
<combo_box.item label="Intoleranz" name="Intolerance"/>
<combo_box.item label="Land &gt; Missbrauch der Sandbox-Ressourcen" name="Land__Abuse_of_sandbox_resources"/>
- <combo_box.item label="Land &gt; Unbefugte Nutzung &gt; Objekte/Texturen" name="Land__Encroachment__Objects_textures"/>
+ <combo_box.item label="Land &gt; Unbefugte Nutzung &gt; Objekte oder Texturen" name="Land__Encroachment__Objects_textures"/>
<combo_box.item label="Land &gt; Unbefugte Nutzung &gt; Partikel" name="Land__Encroachment__Particles"/>
<combo_box.item label="Land &gt; Unbefugte Nutzung &gt; Bäume/Pflanzen" name="Land__Encroachment__Trees_plants"/>
<combo_box.item label="Wetten/Glücksspiel" name="Wagering_gambling"/>
diff --git a/indra/newview/skins/default/xui/de/floater_scene_load_stats.xml b/indra/newview/skins/default/xui/de/floater_scene_load_stats.xml
new file mode 100644
index 0000000000..dff462a594
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/floater_scene_load_stats.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Scene Load Statistics" title="STATISTIKEN ZUM LADEN VON SZENEN">
+ <button label="Anhalten" name="playpause"/>
+ <scroll_container name="statistics_scroll">
+ <container_view name="statistics_view">
+ <stat_view label="Standard" name="basic">
+ <stat_bar label="Frame-Pixel-Differenz" name="frame difference"/>
+ <stat_bar label="Empfangene UDP-Daten" name="bandwidth"/>
+ <stat_bar label="Paketverlust" name="packet_loss"/>
+ </stat_view>
+ <stat_view label="Erweitert" name="advanced">
+ <stat_view label="Darstellung" name="render">
+ <stat_bar label="Objektanzahl" name="objs"/>
+ <stat_bar label="Neue Objekte" name="newobjs"/>
+ <stat_bar label="Objektcache-Trefferrate" name="object_cache_hits"/>
+ </stat_view>
+ <stat_view label="Textur" name="texture">
+ <stat_bar label="Cache-Trefferrate" name="texture_cache_hits"/>
+ <stat_bar label="Cache-Leselatenz" name="texture_cache_read_latency"/>
+ <stat_bar label="Anzahl" name="numimagesstat"/>
+ <stat_bar label="Rohanzahl" name="numrawimagesstat"/>
+ </stat_view>
+ <stat_view label="Netzwerk" name="network">
+ <stat_bar label="Paketeingang" name="packetsinstat"/>
+ <stat_bar label="Paketausgang" name="packetsoutstat"/>
+ <stat_bar label="Objekte" name="objectdatareceived"/>
+ <stat_bar label="Textur" name="texturedatareceived"/>
+ <stat_bar label="Asset" name="assetudpdatareceived"/>
+ <stat_bar label="Ebenen" name="layersdatareceived"/>
+ <stat_bar label="Tatsächlicher Eingang" name="messagedatain"/>
+ <stat_bar label="Tatsächlicher Ausgang" name="messagedataout"/>
+ <stat_bar label="Ausstehende Vorgänge im VFS" name="vfspendingoperations"/>
+ </stat_view>
+ </stat_view>
+ <stat_view label="Simulator" name="sim">
+ <stat_bar label="Objekte" name="simobjects"/>
+ <stat_bar label="Aktive Objekte" name="simactiveobjects"/>
+ <stat_bar label="Aktive Skripts" name="simactivescripts"/>
+ <stat_bar label="Paketeingang" name="siminpps"/>
+ <stat_bar label="Paketausgang" name="simoutpps"/>
+ <stat_bar label="Ausstehende Downloads" name="simpendingdownloads"/>
+ <stat_bar label="Ausstehende Uploads" name="simpendinguploads"/>
+ <stat_bar label="Gesamtanzahl nicht bestätigter Bytes" name="simtotalunackedbytes"/>
+ <stat_view label="Zeit (ms)" name="simperf">
+ <stat_bar label="Gesamt-Framezeit" name="simframemsec"/>
+ <stat_bar label="Nettozeit" name="simnetmsec"/>
+ <stat_bar label="Physikzeit" name="simsimphysicsmsec"/>
+ <stat_bar label="Simulationszeit" name="simsimothermsec"/>
+ <stat_bar label="Agentenzeit" name="simagentmsec"/>
+ <stat_bar label="Bilderzeit" name="simimagesmsec"/>
+ <stat_bar label="Skriptzeit" name="simscriptmsec"/>
+ <stat_bar label="Verbleib. Zeit" name="simsparemsec"/>
+ <stat_view label="Zeitdetails (ms)" name="timedetails">
+ <stat_bar label="Physikschritt" name="simsimphysicsstepmsec"/>
+ <stat_bar label="Phys. Formen aktualisieren" name="simsimphysicsshapeupdatemsec"/>
+ <stat_bar label="Physik – andere" name="simsimphysicsothermsec"/>
+ <stat_bar label="Schlafzeit" name="simsleepmsec"/>
+ <stat_bar label="Pump IO" name="simpumpiomsec"/>
+ </stat_view>
+ </stat_view>
+ </stat_view>
+ </container_view>
+ </scroll_container>
+</floater>
diff --git a/indra/newview/skins/default/xui/de/floater_script_ed_prefs.xml b/indra/newview/skins/default/xui/de/floater_script_ed_prefs.xml
new file mode 100644
index 0000000000..2f9182980b
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/floater_script_ed_prefs.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_script_colors" title="SKRIPTFARBEN">
+ <text name="color_pickers_label">
+ Gewünschte Farben auswählen:
+ </text>
+ <text name="text_label">
+ Text
+ </text>
+ <text name="cursor_label">
+ Cursor
+ </text>
+ <text name="background_label">
+ Hintergrund
+ </text>
+ <text name="datatype_label">
+ Datentypen
+ </text>
+ <text name="event_label">
+ Events
+ </text>
+ <text name="string_literal_label">
+ String-Literale
+ </text>
+ <text name="constant_label">
+ Konstante
+ </text>
+ <text name="flow_control_label">
+ Flusskontrolle
+ </text>
+ <text name="function_label">
+ Funktion
+ </text>
+ <text name="comment_label">
+ Kommentar
+ </text>
+ <script_editor name="Script Preview">
+ /* Ein Beispielskript */
+default
+{
+ state_entry()
+ {
+ // Kommentar
+ string greeting = &quot;Hallo&quot;;
+ llSay(PUBLIC_CHANNEL, greeting);
+ }
+}
+ </script_editor>
+</floater>
diff --git a/indra/newview/skins/default/xui/de/floater_snapshot.xml b/indra/newview/skins/default/xui/de/floater_snapshot.xml
index 798461c007..51614f1e8d 100755
--- a/indra/newview/skins/default/xui/de/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/de/floater_snapshot.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Snapshot" title="FOTO-ANZEIGE">
+<floater name="Snapshot" title="SCHNAPPSCHUSS">
<floater.string name="unknown">
unbekannt
</floater.string>
@@ -41,25 +41,28 @@
</string>
<button name="advanced_options_btn" tool_tip="Erweiterte Optionen"/>
<text name="image_res_text">
- [WIDTH] x [HEIGHT] px
+ [WIDTH]px (Breite) x [HEIGHT]px (Höhe)
</text>
<text name="file_size_label">
[SIZE] KB
</text>
<panel name="advanced_options_panel">
- <text name="advanced_options_label">
- ERWEITERTE OPTIONEN
- </text>
<text name="layer_type_label">
- Aufnahme:
+ Aufnehmen:
</text>
<combo_box label="Bildebenen" name="layer_types">
<combo_box.item label="Farben" name="Colors"/>
<combo_box.item label="Tiefe" name="Depth"/>
</combo_box>
- <check_box label="Schnittstelle" name="ui_check"/>
+ <check_box label="Benutzeroberfläche" name="ui_check"/>
<check_box label="HUDs" name="hud_check"/>
<check_box label="Standbild (Vollbild)" name="freeze_frame_check"/>
<check_box label="Automatisch aktualisieren" name="auto_snapshot_check"/>
+ <text name="filter_list_label">
+ Filter:
+ </text>
+ <combo_box label="Filter" name="filters_combobox" tool_tip="Bildfilter">
+ <combo_box.item label="Kein Filter" name="NoFilter"/>
+ </combo_box>
</panel>
</floater>
diff --git a/indra/newview/skins/default/xui/de/floater_stats.xml b/indra/newview/skins/default/xui/de/floater_stats.xml
index f3239f73c7..993316134a 100755
--- a/indra/newview/skins/default/xui/de/floater_stats.xml
+++ b/indra/newview/skins/default/xui/de/floater_stats.xml
@@ -4,17 +4,21 @@
<container_view name="statistics_view" width="280">
<stat_view label="Basic" name="basic">
<stat_bar label="FPS" name="fps"/>
- <stat_bar label="Bandbreite" name="bandwidth"/>
+ <stat_bar label="Empfangene UDP-Daten" name="bandwidth"/>
<stat_bar label="Paketverlust" name="packet_loss"/>
<stat_bar label="Ping Sim" name="ping"/>
</stat_view>
<stat_view label="Erweitert" name="advanced">
<stat_view label="Darstellung" name="render">
- <stat_bar label="Pro Frame gezeichnete KTris" name="ktrisframe"/>
- <stat_bar label="Pro Sek. gezeichnete KTris" name="ktrissec"/>
- <stat_bar label="Objektanzahl" name="objs"/>
+ <stat_bar label="KTris pro Frame" name="ktrisframe"/>
+ <stat_bar label="KTris pro Sekunden" name="ktrissec"/>
+ <stat_bar label="Objekte gesamt" name="totalobjs"/>
+ <stat_bar label="Zwischengespeicherte Objekte" name="cachedobjs"/>
<stat_bar label="Neue Objekte" name="newobjs"/>
<stat_bar label="Objektcache-Trefferrate" name="object_cache_hits"/>
+ <stat_bar label="Durchgeführte Okklusionsabfragen" name="occlusion_queries"/>
+ <stat_bar label="Okkludierte Objekte" name="occluded"/>
+ <stat_bar label="Nicht okkludierte Objekte" name="unoccluded"/>
</stat_view>
<stat_view label="Textur" name="texture">
<stat_bar label="Cache-Trefferrate" name="texture_cache_hits"/>
@@ -26,15 +30,32 @@
<stat_bar label="Rohsp" name="rawmemstat"/>
<stat_bar label="Zugeteilter Sp" name="glboundmemstat"/>
</stat_view>
+ <stat_view label="Speichernutzung" name="memory">
+ <stat_bar label="LLTrace" name="LLTrace"/>
+ <stat_bar label="UI" name="LLView"/>
+ <stat_bar label="Schriftarten" name="LLFontFreetype"/>
+ <stat_bar label="Inventar" name="LLInventoryObject"/>
+ <stat_bar label="Viewer-Objekte" name="LLViewerObject"/>
+ <stat_bar label="Octree-Gruppendaten" name="LLViewerOctreeGroup"/>
+ <stat_bar label="Octree-Daten" name="LLViewerOctreeEntry"/>
+ <stat_bar label="Viewer-Objekt-Cache" name="LLVOCacheEntry"/>
+ <stat_bar label="Zeichnungsobjekte" name="LLDrawable"/>
+ <stat_bar label="Gesichtsdaten" name="LLFace"/>
+ <stat_bar label="Zeichnungsinfos" name="LLDrawInfo"/>
+ <stat_bar label="Texturdaten" name="LLTexture"/>
+ <stat_bar label="Bilddaten" name="LLImage"/>
+ <stat_bar label="GL-Bilddaten" name="LLImageGL"/>
+ <stat_bar label="Vertex-Buffer" name="LLVertexBuffer"/>
+ </stat_view>
<stat_view label="Netzwerk" name="network">
<stat_bar label="Paketeingang" name="packetsinstat"/>
<stat_bar label="Paketausgang" name="packetsoutstat"/>
- <stat_bar label="Objekte" name="objectkbitstat"/>
- <stat_bar label="Textur" name="texturekbitstat"/>
- <stat_bar label="Bestand" name="assetkbitstat"/>
- <stat_bar label="Ebenen" name="layerskbitstat"/>
- <stat_bar label="Tatsächlicher Eingang" name="actualinkbitstat"/>
- <stat_bar label="Tatsächlicher Ausgang" name="actualoutkbitstat"/>
+ <stat_bar label="Objekte" name="objectdatareceived"/>
+ <stat_bar label="Textur" name="texturedatareceived"/>
+ <stat_bar label="Asset" name="assetudpdatareceived"/>
+ <stat_bar label="Ebenen" name="layersdatareceived"/>
+ <stat_bar label="Tatsächlicher Eingang" name="messagedatain"/>
+ <stat_bar label="Tatsächlicher Ausgang" name="messagedataout"/>
<stat_bar label="Ausstehende Vorgänge im VFS" name="vfspendingoperations"/>
</stat_view>
</stat_view>
@@ -64,8 +85,8 @@
<stat_bar label="Paketausgang" name="simoutpps"/>
<stat_bar label="Ausstehende Downloads" name="simpendingdownloads"/>
<stat_bar label="Ausstehende Uploads" name="simpendinguploads"/>
- <stat_bar label="Gesamtanzahl „Unacked&quot; Bytes" name="simtotalunackedbytes"/>
- <stat_view label="Zeit (ms)" name="simperf">
+ <stat_bar label="Gesamtmenge unbestätigter Daten" name="simtotalunackedbytes"/>
+ <stat_view label="Zeit" name="simperf">
<stat_bar label="Gesamtzeit Frame" name="simframemsec"/>
<stat_bar label="Netto-Zeit" name="simnetmsec"/>
<stat_bar label="Physik-Zeit" name="simsimphysicsmsec"/>
@@ -74,7 +95,7 @@
<stat_bar label="Bilder-Zeit" name="simimagesmsec"/>
<stat_bar label="Skript-Zeit" name="simscriptmsec"/>
<stat_bar label="Verbleib. Zeit" name="simsparemsec"/>
- <stat_view label="Zeitdetails (ms)" name="timedetails">
+ <stat_view label="Zeitdetails" name="timedetails">
<stat_bar label="Physik-Schritt" name="simsimphysicsstepmsec"/>
<stat_bar label="Phys. Formen aktualisieren" name="simsimphysicsshapeupdatemsec"/>
<stat_bar label="Physik – andere" name="simsimphysicsothermsec"/>
diff --git a/indra/newview/skins/default/xui/de/floater_tools.xml b/indra/newview/skins/default/xui/de/floater_tools.xml
index 6634a4bd90..7dd5938601 100755
--- a/indra/newview/skins/default/xui/de/floater_tools.xml
+++ b/indra/newview/skins/default/xui/de/floater_tools.xml
@@ -72,7 +72,7 @@
<check_box label="Verknüpfte Teile bearbeiten" name="checkbox edit linked parts"/>
<button label="Link" name="link_btn" width="30"/>
<button label="Verknüpfung auflösen" name="unlink_btn" width="126"/>
- <check_box label="" name="checkbox uniform"/>
+ <check_box label="Beide Seiten dehnen" name="checkbox uniform"/>
<text label="Beide Seiten dehnen" name="checkbox uniform label">
Beide Seiten dehnen
</text>
diff --git a/indra/newview/skins/default/xui/de/floater_twitter.xml b/indra/newview/skins/default/xui/de/floater_twitter.xml
new file mode 100644
index 0000000000..a79a5d3cac
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/floater_twitter.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_twitter" title="TWITTER">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="ERSTELLEN" name="panel_twitter_photo"/>
+ <panel label="KONTO" name="panel_twitter_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ Fehler
+ </text>
+ <text name="connection_loading_text">
+ Laden...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/de/menu_avatar_icon.xml b/indra/newview/skins/default/xui/de/menu_avatar_icon.xml
index c036cf5515..ad47f1d37d 100755
--- a/indra/newview/skins/default/xui/de/menu_avatar_icon.xml
+++ b/indra/newview/skins/default/xui/de/menu_avatar_icon.xml
@@ -2,6 +2,7 @@
<menu name="Avatar Icon Menu">
<menu_item_call label="Profil anzeigen" name="Show Profile"/>
<menu_item_call label="IM senden..." name="Send IM"/>
+ <menu_item_call label="Teleport anfordern" name="Request Teleport"/>
<menu_item_call label="Freund hinzufügen..." name="Add Friend"/>
<menu_item_call label="Freund entfernen..." name="Remove Friend"/>
</menu>
diff --git a/indra/newview/skins/default/xui/de/menu_conversation.xml b/indra/newview/skins/default/xui/de/menu_conversation.xml
index bdfa66c23b..0a7995198e 100644
--- a/indra/newview/skins/default/xui/de/menu_conversation.xml
+++ b/indra/newview/skins/default/xui/de/menu_conversation.xml
@@ -29,4 +29,5 @@
<menu_item_call label="Alle stummschalten" name="ModerateVoiceMute"/>
<menu_item_call label="Stummschaltung für alle aufheben" name="ModerateVoiceUnmute"/>
</context_menu>
+ <menu_item_call label="Mitglied verbannen" name="BanMember"/>
</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/de/menu_inventory.xml b/indra/newview/skins/default/xui/de/menu_inventory.xml
index cd2fca313e..d838f736f8 100755
--- a/indra/newview/skins/default/xui/de/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/de/menu_inventory.xml
@@ -70,6 +70,7 @@
<menu_item_call label="Wiedergeben/Abspielen" name="Sound Play"/>
<menu_item_call label="SLurl kopieren" name="url_copy"/>
<menu_item_call label="Landmarken-Info" name="About Landmark"/>
+ <menu_item_call label="Auf Karte anzeigen" name="show_on_map"/>
<menu_item_call label="Inworld abspielen" name="Animation Play"/>
<menu_item_call label="Lokal abspielen" name="Animation Audition"/>
<menu_item_call label="Instant Message senden" name="Send Instant Message"/>
diff --git a/indra/newview/skins/default/xui/de/menu_login.xml b/indra/newview/skins/default/xui/de/menu_login.xml
index 62358cc5a8..329ea20179 100755
--- a/indra/newview/skins/default/xui/de/menu_login.xml
+++ b/indra/newview/skins/default/xui/de/menu_login.xml
@@ -5,7 +5,15 @@
<menu_item_call label="[APP_NAME] schließen" name="Quit"/>
</menu>
<menu label="Hilfe" name="Help">
- <menu_item_call label="[SECOND_LIFE]-Hilfe" name="Second Life Help"/>
+ <menu_item_call label="Anweisungen..." name="How To"/>
+ <menu_item_call label="Kurzanleitung" name="Quickstart"/>
+ <menu_item_call label="Knowledge Base" name="Knowledge Base"/>
+ <menu_item_call label="Wiki" name="Wiki"/>
+ <menu_item_call label="Community-Foren" name="Community Forums"/>
+ <menu_item_call label="Support-Portal" name="Support portal"/>
+ <menu_item_call label="[SECOND_LIFE]-Neuigkeiten" name="Second Life News"/>
+ <menu_item_call label="[SECOND_LIFE]-Blogs" name="Second Life Blogs"/>
+ <menu_item_call label="Fehler melden" name="Report Bug"/>
<menu_item_call label="INFO ÜBER [APP_NAME]" name="About Second Life"/>
</menu>
<menu_item_check label="Debug-Menü anzeigen" name="Show Debug Menu"/>
diff --git a/indra/newview/skins/default/xui/de/menu_object.xml b/indra/newview/skins/default/xui/de/menu_object.xml
index de2b409678..dbf78f406b 100755
--- a/indra/newview/skins/default/xui/de/menu_object.xml
+++ b/indra/newview/skins/default/xui/de/menu_object.xml
@@ -21,6 +21,7 @@
<context_menu label="Verwalten" name="Remove">
<menu_item_call label="Missbrauch melden" name="Report Abuse..."/>
<menu_item_call label="Ignorieren" name="Object Mute"/>
+ <menu_item_call label="Freischalten" name="Object Unmute"/>
<menu_item_call label="Zurückgeben" name="Return..."/>
</context_menu>
<menu_item_call label="Nehmen" name="Pie Object Take"/>
diff --git a/indra/newview/skins/default/xui/de/menu_teleport_history_item.xml b/indra/newview/skins/default/xui/de/menu_teleport_history_item.xml
index ff8fb0b181..1d7e3059c0 100755
--- a/indra/newview/skins/default/xui/de/menu_teleport_history_item.xml
+++ b/indra/newview/skins/default/xui/de/menu_teleport_history_item.xml
@@ -2,5 +2,5 @@
<context_menu name="Teleport History Item Context Menu">
<menu_item_call label="Teleportieren" name="Teleport"/>
<menu_item_call label="Weitere Informationen" name="More Information"/>
- <menu_item_call label="In Zwischenablage kopieren" name="CopyToClipboard"/>
+ <menu_item_call label="SLurl kopieren" name="CopyToClipboard"/>
</context_menu>
diff --git a/indra/newview/skins/default/xui/de/menu_viewer.xml b/indra/newview/skins/default/xui/de/menu_viewer.xml
index be5d4891d7..c9fad9c9d3 100755
--- a/indra/newview/skins/default/xui/de/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/de/menu_viewer.xml
@@ -36,6 +36,9 @@
<menu_item_check label="Chat in der Nähe..." name="Nearby Chat"/>
<menu_item_check label="Sprechen" name="Speak"/>
<menu_item_check label="Unterhaltungsprotokoll..." name="Conversation Log..."/>
+ <menu_item_call label="Facebook..." name="Facebook"/>
+ <menu_item_call label="Twitter..." name="Twitter"/>
+ <menu_item_call label="Flickr..." name="Flickr"/>
<menu label="Voice-Morphing" name="VoiceMorphing">
<menu_item_check label="Kein Voice-Morphing" name="NoVoiceMorphing"/>
<menu_item_check label="Vorschau..." name="Preview"/>
@@ -72,11 +75,11 @@
<menu_item_check label="Menü „Erweitert“" name="Show Advanced Menu"/>
</menu>
<menu label="Sonne" name="Sun">
- <menu_item_call label="Sonnenaufgang" name="Sunrise"/>
- <menu_item_call label="Mittag" name="Noon"/>
- <menu_item_call label="Sonnenuntergang" name="Sunset"/>
- <menu_item_call label="Mitternacht" name="Midnight"/>
- <menu_item_call label="Regionseinstellungen verwenden" name="Use Region Settings"/>
+ <menu_item_check label="Sonnenaufgang" name="Sunrise"/>
+ <menu_item_check label="Mittag" name="Noon"/>
+ <menu_item_check label="Sonnenuntergang" name="Sunset"/>
+ <menu_item_check label="Mitternacht" name="Midnight"/>
+ <menu_item_check label="Regionseinstellungen verwenden" name="Use Region Settings"/>
</menu>
<menu label="Umwelt-Editor" name="Environment Editor">
<menu_item_call label="Umwelt-Einstellungen..." name="Environment Settings"/>
@@ -150,7 +153,8 @@
<menu_item_check label="An Raster ausrichten" name="Snap to Grid"/>
<menu_item_call label="Objekt-XY an Raster ausrichten" name="Snap Object XY to Grid"/>
<menu_item_call label="Auswahl für Raster verwenden" name="Use Selection for Grid"/>
- <menu_item_call label="Rasteroptionen" name="Grid Options"/>
+ <menu_item_call label="Rasteroptionen..." name="Grid Options"/>
+ <menu_item_call label="Standard-Berechtigungen einstellen..." name="Set default permissions"/>
</menu>
<menu label="Hochladen" name="Upload">
<menu_item_call label="Bild ([COST] L$)..." name="Upload Image"/>
@@ -158,15 +162,12 @@
<menu_item_call label="Animation ([COST] L$)..." name="Upload Animation"/>
<menu_item_call label="Modell..." name="Upload Model"/>
<menu_item_call label="Mehrfach-Upload ([COST] L$ pro Datei)..." name="Bulk Upload"/>
- <menu_item_call label="Hochlade-Berechtigungen (Standard) festlegen" name="perm prefs"/>
</menu>
<menu_item_call label="Rückgängig" name="Undo"/>
<menu_item_call label="Wiederholen" name="Redo"/>
</menu>
<menu label="Hilfe" name="Help">
<menu_item_call label="Anweisungen..." name="How To"/>
- <menu_item_call label="[SECOND_LIFE]-Hilfe" name="Second Life Help"/>
- <menu_item_call label="Benutzerhandbuch" name="User’s guide"/>
<menu_item_call label="Knowledge Base" name="Knowledge Base"/>
<menu_item_call label="Wiki" name="Wiki"/>
<menu_item_call label="Community-Foren" name="Community Forums"/>
@@ -188,6 +189,7 @@
<menu label="Performance Tools" name="Performance Tools">
<menu_item_call label="Lag-Anzeige" name="Lag Meter"/>
<menu_item_check label="Statistikleiste" name="Statistics Bar"/>
+ <menu_item_call label="Statistiken zum Laden von Szenen" name="Scene Load Statistics"/>
<menu_item_check label="Zuggewicht für Avatare anzeigen" name="Avatar Rendering Cost"/>
</menu>
<menu label="Hervorhebung und Sichtbarkeit" name="Highlighting and Visibility">
@@ -250,6 +252,7 @@
<menu_item_check label="Schnelle Timer" name="Fast Timers"/>
<menu_item_check label="Speicher" name="Memory"/>
<menu_item_check label="Szenestatistiken" name="Scene Statistics"/>
+ <menu_item_check label="Monitor zum Laden von Szenen" name="Scene Loading Monitor"/>
<menu_item_call label="Debug-Konsole für Texturabruffehler" name="Texture Fetch Debug Console"/>
<menu_item_call label="Info zu Region in Fenster Fehler beseitigen" name="Region Info to Debug Console"/>
<menu_item_call label="Gruppeninfo in Fenster Fehler beseitigen" name="Group Info to Debug Console"/>
@@ -286,6 +289,7 @@
<menu_item_check label="Periodic Slow Frame" name="Periodic Slow Frame"/>
<menu_item_check label="Frame-Test" name="Frame Test"/>
<menu_item_call label="Rahmenprofil" name="Frame Profile"/>
+ <menu_item_call label="Benchmark" name="Benchmark"/>
</menu>
<menu label="Metadaten darstellen" name="Render Metadata">
<menu_item_check label="Bonding Boxes" name="Bounding Boxes"/>
@@ -303,7 +307,9 @@
<menu_item_check label="Detailstufeninfos" name="LOD Info"/>
<menu_item_check label="Konstruktionswarteschlange" name="Build Queue"/>
<menu_item_check label="Lichter" name="Lights"/>
+ <menu_item_check label="Partikel" name="Particles"/>
<menu_item_check label="Gelenkpunkte" name="Collision Skeleton"/>
+ <menu_item_check label="Gelenke" name="Joints"/>
<menu_item_check label="Raycast" name="Raycast"/>
<menu_item_check label="Windvektoren" name="Wind Vectors"/>
<menu_item_check label="Komplexität beim Rendern" name="rendercomplexity"/>
@@ -336,6 +342,7 @@
<menu_item_check label="Angehängte Lichter rendern" name="Render Attached Lights"/>
<menu_item_check label="Angehängte Partikel rendern" name="Render Attached Particles"/>
<menu_item_check label="Leucht-Objekte schweben lassen" name="Hover Glow Objects"/>
+ <menu_item_call label="Cache sofort leeren" name="Cache Clear"/>
</menu>
<menu label="Netzwerk" name="Network">
<menu_item_check label="Agent pausieren" name="AgentPause"/>
@@ -368,7 +375,6 @@
<menu_item_call label="Fokus ausgeben" name="Dump Focus Holder"/>
<menu_item_call label="Ausgewählte Objektinfo drucken" name="Print Selected Object Info"/>
<menu_item_call label="Agent-Info drucken" name="Print Agent Info"/>
- <menu_item_check label="Regions-Debug-Konsole" name="Region Debug Console"/>
<menu_item_check label="Fehler in SelectMgr beseitigen" name="Debug SelectMgr"/>
<menu_item_check label="Fehler in Klicks beseitigen" name="Debug Clicks"/>
<menu_item_check label="Debug-Ansichten" name="Debug Views"/>
diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml
index b3ae98f633..2fa5005d15 100755
--- a/indra/newview/skins/default/xui/de/notifications.xml
+++ b/indra/newview/skins/default/xui/de/notifications.xml
@@ -114,13 +114,13 @@ Weitere Informationen finden Sie im [[MARKETPLACE_IMPORTS_URL] Fehlerprotokoll].
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="OutboxImportFailed">
- Übertragung fehlgeschlagen
+ Übertragung fehlgeschlagen mit Fehler „[ERROR_CODE]“
Aufgrund eines System- oder Netzwerkfehlers wurden keine Ordner an den Marktplatz übertragen. Versuchen Sie es später erneut.
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="OutboxInitFailed">
- Marktplatzinitialisierung fehlgeschlagen
+ Marktplatzinitialisierung fehlgeschlagen mit Fehler „[ERROR_CODE]“
Marktplatzinitialisierung aufgrund eines System- oder Netzwerkfehlers fehlgeschlagen. Versuchen Sie es später erneut.
<usetemplate name="okbutton" yestext="OK"/>
@@ -216,6 +216,22 @@ Der Rolle „[ROLE_NAME]“ diese Fähigkeit zuweisen?
Der Rolle „[ROLE_NAME]“ diese Fähigkeit zuweisen?
<usetemplate name="okcancelbuttons" notext="Nein" yestext="Ja"/>
</notification>
+ <notification name="AssignBanAbilityWarning">
+ Sie sind im Begriff, der Rolle „[ROLE_NAME]“ die Fähigkeit „[ACTION_NAME]“ zuzuweisen.
+
+ *ACHTUNG*
+Jedem Mitglied in einer Rolle mit dieser Fähigkeit werden auch die Fähigkeiten „[ACTION_NAME_2]“ und „[ACTION_NAME_3]“ zugewiesen.
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
+ <notification name="RemoveBanAbilityWarning">
+ Sie sind im Begriff, die Fähigkeit „[ACTION_NAME]“ aus der Rolle „[ROLE_NAME]“ zu entfernen.
+
+ *ACHTUNG*
+Durch Entfernen dieser Fähigkeit werden die Fähigkeiten „[ACTION_NAME_2]“ und „[ACTION_NAME_3]“ NICHT entfernt.
+
+Wenn diese Rolle nicht mehr diese Fähigkeiten haben soll, deaktivieren Sie sie bitte umgehend.
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
<notification name="EjectGroupMemberWarning">
Sie sind dabei, [AVATAR_NAME] aus der Gruppe hinauszuwerfen.
<usetemplate ignoretext="Hinauswerfen eines einzelnen Gruppenmitglieds bestätigen" name="okcancelignore" notext="Abbrechen" yestext="Hinauswerfen"/>
@@ -1591,6 +1607,14 @@ Diese Gruppe verlassen?
Sie können die Gruppe nicht verlassen, da Sie der letzte Besitzer der Gruppe sind. Weisen Sie die Besitzerrolle zuerst einem anderen Mitglied zu.
<usetemplate name="okbutton" yestext="OK"/>
</notification>
+ <notification name="GroupDepartError">
+ Kann Gruppe nicht verlassen: [reason].
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
+ <notification name="GroupDepart">
+ Sie haben die Gruppe „[group_name]“ verlassen.
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
<notification name="ConfirmKick">
Möchten Sie WIRKLICH alle Benutzer aus dem Grid werfen?
<usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="Alle Benutzer hinauswerfen"/>
@@ -1744,6 +1768,10 @@ womit Sie die Höchstgrenze von [LIMIT] überschreiten.
Sind Sie sicher, dass Sie zu &lt;nolink&gt;[LOCATION]&lt;/nolink&gt; teleportieren möchten?
<usetemplate ignoretext="Bestätigen, dass ich zu einer Landmarke teleportieren möchte" name="okcancelignore" notext="Abbrechen" yestext="Teleportieren"/>
</notification>
+ <notification name="TeleportViaSLAPP">
+ Möchten Sie wirklich zu &lt;nolink&gt;[LOCATION]&lt;/nolink&gt; teleportieren?
+ <usetemplate ignoretext="Bestätigen, dass ich via SLAPP teleportieren möchte" name="okcancelignore" notext="Abbrechen" yestext="Teleportieren"/>
+ </notification>
<notification name="TeleportToPick">
Nach [PICK] teleportieren?
<usetemplate ignoretext="Bestätigen, dass ich zu einer Position in Auswahl teleportieren möchte" name="okcancelignore" notext="Abbrechen" yestext="Teleportieren"/>
@@ -1954,6 +1982,9 @@ Tausende Regionen werden verändert und der Spaceserver wird dadurch stark belas
<notification name="ProblemAddingEstateManager">
Es gibt Probleme beim Hinzufügen eines neuen Grundbesitzverwalters. Bei mindestens einem Grundbesitz ist die Verwalterliste voll.
</notification>
+ <notification name="ProblemAddingEstateBanManager">
+ Grundbesitzer oder Grundstücksverwalter kann nicht auf die Bannliste gesetzt werden.
+ </notification>
<notification name="ProblemAddingEstateGeneric">
Problem beim Hinzufügen zu dieser Grundbesitzliste. Bei mindestens einem Grundbesitz ist die Liste voll.
</notification>
@@ -2467,6 +2498,12 @@ Wählen Sie eine kleinere Landfläche.
<notification name="SystemMessage">
[MESSAGE]
</notification>
+ <notification name="FlickrConnect">
+ [MESSAGE]
+ </notification>
+ <notification name="TwitterConnect">
+ [MESSAGE]
+ </notification>
<notification name="PaymentReceived">
[MESSAGE]
</notification>
@@ -3038,13 +3075,13 @@ Details finden Sie in der Protokolldatei.
Regionsfähigkeit „[CAPABILITY]“ konnte nicht abgerufen werden.
</notification>
<notification name="ShareItemsConfirmation">
- Möchten Sie wirklich die folgenden Objekte:
+ Möchten Sie wirklich die folgenden Artikel:
&lt;nolink&gt;[ITEMS]&lt;/nolink&gt;
-für folgende Einwohner freigeben:
+mit den folgenden Einwohnern teilen:
-[RESIDENTS]
+&lt;nolink&gt;[RESIDENTS]&lt;/nolink&gt;
<usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/>
</notification>
<notification name="ShareFolderConfirmation">
@@ -3056,7 +3093,7 @@ Möchten Sie wirklich die folgenden Artikel:
mit den folgenden Einwohnern teilen:
-[RESIDENTS]
+&lt;nolink&gt;[RESIDENTS]&lt;/nolink&gt;
<usetemplate name="okcancelbuttons" notext="Abbrechen" yestext="OK"/>
</notification>
<notification name="ItemsShared">
@@ -3510,10 +3547,6 @@ Warten Sie kurz und versuchen Sie es noch einmal.
<notification name="EjectComingSoon">
Sie nicht hier nicht mehr zugelassen und haben [EJECT_TIME] Sekunden Zeit, um zu gehen.
</notification>
- <notification name="NoEnterServerFull">
- Sie können diese Region nicht betreten, da
-der Server voll ist.
- </notification>
<notification name="SaveBackToInvDisabled">
Erneutes Speichern im Inventar ist deaktiviert.
</notification>
@@ -3703,6 +3736,9 @@ der Server voll ist.
<notification name="LinkFailedTooMuchPhysics">
Objekt verwendet zu viele Physikressourcen – seine Dynamik wurde deaktiviert.
</notification>
+ <notification name="EstateManagerFailedllTeleportHome">
+ Das Objekt „[OBJECT_NAME]“ auf [SLURL] kann Grundstücksverwalter nicht nach Hause teleportieren.
+ </notification>
<notification name="TeleportedHomeByObjectOnParcel">
Sie wurden vom Objekt „[OBJECT_NAME]“ auf der Parzelle „[PARCEL_NAME]“ nach Hause teleportiert
</notification>
@@ -3893,13 +3929,18 @@ der Server voll ist.
Auswahl enthält nicht genügend gemietete Parzellen zum Zusammenlegen.
</notification>
<notification name="CantDivideLandMultipleParcelsSelected">
- Land kann nicht geteilt werden.\nMehr als eine Parzelle ist ausgewählt.\nWählen Sie ein kleineres Stück Land aus.
+ Land kann nicht geteilt werden.
+Mehr als eine Parzelle ist ausgewählt.
+Wählen Sie eine kleinere Landfläche aus.
</notification>
<notification name="CantDivideLandCantFindParcel">
- Land kann nicht geteilt werden.\nParzelle nicht auffindbar.\nMelden Sie das Problem über „Hilfe“ -&gt; „Fehler melden“...
+ Land kann nicht geteilt werden.
+Parzelle kann nicht gefunden werden.
+Bitte melden Sie den Fehler über „Hilfe“ -&gt; „Fehler melden“.
</notification>
<notification name="CantDivideLandWholeParcelSelected">
- Land kann nicht geteilt werden. Die gesamte Parzelle ist ausgewählt.\nWählen Sie ein kleineres Stück Land aus.
+ Land kann nicht geteilt werden. Die gesamte Parzelle ist ausgewählt.
+Wählen Sie eine kleinere Landfläche aus.
</notification>
<notification name="LandHasBeenDivided">
Land wurde geteilt.
@@ -4039,4 +4080,12 @@ der Server voll ist.
Dateien können nicht verschoben werden. Vorheriger Pfad wurde wiederhergestellt.
<usetemplate ignoretext="Dateien können nicht verschoben werden. Vorheriger Pfad wurde wiederhergestellt." name="okignore" yestext="OK"/>
</notification>
+ <notification name="DefaultObjectPermissions">
+ Die Standardberechtigungen konnten aus folgendem Grund nicht gespeichert werden: [REASON]. Versuchen Sie später, die Standardberechtigungen einzustellen.
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
+ <notification name="ChatHistoryIsBusyAlert">
+ Chatverlaufsdatei ist noch mit vorheriger Operation beschäftigt. Versuchen Sie es in ein paar Minuten noch einmal oder chatten Sie mit einer anderen Person.
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
</notifications>
diff --git a/indra/newview/skins/default/xui/de/panel_facebook_account.xml b/indra/newview/skins/default/xui/de/panel_facebook_account.xml
new file mode 100644
index 0000000000..caa5f55186
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/panel_facebook_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_account">
+ <string name="facebook_connected" value="Sie sind mit Facebook verbunden als:"/>
+ <string name="facebook_disconnected" value="Nicht mit Facebook verbunden"/>
+ <text name="account_caption_label">
+ Nicht mit Facebook verbunden.
+ </text>
+ <panel name="panel_buttons">
+ <button label="Verbinden..." name="connect_btn"/>
+ <button label="Trennen" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Facebook/ta-p/2149711 Anweisungen zum Posten auf Facebook]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_facebook_friends.xml b/indra/newview/skins/default/xui/de/panel_facebook_friends.xml
new file mode 100644
index 0000000000..9712d681c7
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/panel_facebook_friends.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_friends">
+ <string name="facebook_friends_empty" value="Sie haben gegenwärtig keine Facebook-Freunde, die gleichzeitig Einwohner von Second Life sind. Laden Sie Ihre Facebook-Freunde ein, Second Life beizutreten!"/>
+ <string name="facebook_friends_no_connected" value="Sie sind gegenwärtig nicht mit Facebook verbunden. Um eine Verbindung herzustellen und diese Funktion zu aktivieren, gehen Sie zur Registerkarte „Konto“."/>
+ <accordion name="friends_accordion">
+ <accordion_tab name="tab_second_life_friends" title="SL-Freunde"/>
+ <accordion_tab name="tab_suggested_friends" title="Diese Personen als SL-Freunde hinzufügen"/>
+ </accordion>
+ <text name="facebook_friends_status">
+ Nicht mit Facebook verbunden.
+ </text>
+</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_facebook_photo.xml b/indra/newview/skins/default/xui/de/panel_facebook_photo.xml
new file mode 100644
index 0000000000..a1aabcd29c
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/panel_facebook_photo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="Bildauflösung">
+ <combo_box.item label="Aktuelles Fenster" name="CurrentWindow"/>
+ <combo_box.item label="640x480" name="640x480"/>
+ <combo_box.item label="800x600" name="800x600"/>
+ <combo_box.item label="1024x768" name="1024x768"/>
+ <combo_box.item label="1200x630" name="1200x630"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="Bildfilter">
+ <combo_box.item label="Kein Filter" name="NoFilter"/>
+ </combo_box>
+ <button label="Aktualisieren" name="new_snapshot_btn" tool_tip="Zum Aktualisieren klicken"/>
+ <button label="Vorschau" name="big_preview_btn" tool_tip="Klicken, um Vorschau ein-/auszuschalten"/>
+ <text name="caption_label">
+ Kommentar (optional):
+ </text>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="Posten" name="post_photo_btn"/>
+ <button label="Abbrechen" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_facebook_place.xml b/indra/newview/skins/default/xui/de/panel_facebook_place.xml
new file mode 100644
index 0000000000..0f556565b4
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/panel_facebook_place.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_place">
+ <layout_stack name="stack_place">
+ <layout_panel name="place_detail_panel">
+ <text name="place_caption_label">
+ Details zu Ihrem aktuellen Standort:
+ </text>
+ </layout_panel>
+ <layout_panel name="place_map_panel">
+ <check_box initial_value="false" label="" name="add_place_view_cb"/>
+ </layout_panel>
+ <layout_panel name="place_button_panel">
+ <button label="Posten" name="post_place_btn"/>
+ <button label="Abbrechen" name="cancel_place_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_facebook_status.xml b/indra/newview/skins/default/xui/de/panel_facebook_status.xml
new file mode 100644
index 0000000000..437243c360
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/panel_facebook_status.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_status">
+ <layout_stack name="stack_status">
+ <layout_panel name="status_detail_panel">
+ <text name="status_caption_label">
+ Was machst du gerade?
+ </text>
+ </layout_panel>
+ <layout_panel name="status_button_panel">
+ <button label="Posten" name="post_status_btn"/>
+ <button label="Abbrechen" name="cancel_status_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_flickr_account.xml b/indra/newview/skins/default/xui/de/panel_flickr_account.xml
new file mode 100644
index 0000000000..416761f0da
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/panel_flickr_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_flickr_account">
+ <string name="flickr_connected" value="Sie sind mit Flickr verbunden als:"/>
+ <string name="flickr_disconnected" value="Nicht mit Flickr verbunden"/>
+ <text name="account_caption_label">
+ Nicht mit Flickr verbunden.
+ </text>
+ <panel name="panel_buttons">
+ <button label="Verbinden..." name="connect_btn"/>
+ <button label="Trennen" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Flickr/ta-p/2435609 Anweisungen zum Posten auf Flickr]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_flickr_photo.xml b/indra/newview/skins/default/xui/de/panel_flickr_photo.xml
new file mode 100644
index 0000000000..1627f405c5
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/panel_flickr_photo.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_flickr_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="Bildauflösung">
+ <combo_box.item label="Aktuelles Fenster" name="CurrentWindow"/>
+ <combo_box.item label="640x480" name="640x480"/>
+ <combo_box.item label="800x600" name="800x600"/>
+ <combo_box.item label="1024x768" name="1024x768"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="Bildfilter">
+ <combo_box.item label="Kein Filter" name="NoFilter"/>
+ </combo_box>
+ <button label="Aktualisieren" name="new_snapshot_btn" tool_tip="Zum Aktualisieren klicken"/>
+ <button label="Vorschau" name="big_preview_btn" tool_tip="Klicken, um Vorschau ein-/auszuschalten"/>
+ <text name="title_label">
+ Titel:
+ </text>
+ <text name="description_label">
+ Beschreibung:
+ </text>
+ <check_box initial_value="true" label="SL-Standort am Ende der Beschreibung hinzufügen" name="add_location_cb"/>
+ <text name="tags_label">
+ Markierungen:
+ </text>
+ <text name="tags_help_label">
+ Markierungen durch Leerzeichen trennen.
+Für Markierungen, die aus mehreren Wörtern bestehen, &quot;&quot; verwenden.
+ </text>
+ <combo_box name="rating_combobox" tool_tip="Flickr-Inhaltseinstufung">
+ <combo_box.item label="Sichere Flickr-Einstufung" name="SafeRating"/>
+ <combo_box.item label="Moderate Flickr-Einstufung" name="ModerateRating"/>
+ <combo_box.item label="Beschränkte Flickr-Einstufung" name="RestrictedRating"/>
+ </combo_box>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="Hochladen" name="post_photo_btn"/>
+ <button label="Abbrechen" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_group_bulk_ban.xml b/indra/newview/skins/default/xui/de/panel_group_bulk_ban.xml
new file mode 100644
index 0000000000..fb1d89f08a
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/panel_group_bulk_ban.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel label="Einwohner verbannen" name="bulk_ban_panel">
+ <panel.string name="loading">
+ (wird geladen...)
+ </panel.string>
+ <panel.string name="ban_selection_too_large">
+ Gruppenverbannungen nicht gesendet: zu viele Einwohner ausgewählt. Gruppenverbannungen sind auf 100 pro Anfrage beschränkt.
+ </panel.string>
+ <panel.string name="ban_not_permitted">
+ Gruppenverbannung nicht gesendet: Sie sind nicht zur Verwaltung der Bannliste berechtigt.
+ </panel.string>
+ <panel.string name="ban_limit_fail">
+ Gruppenverbannung nicht gesendet: Ihre Gruppe hat die Höchstzahl möglicher Verbannungen erreicht.
+ </panel.string>
+ <panel.string name="partial_ban">
+ Einige Gruppenverbannungen wurden nicht gesendet:
+[REASONS]
+ </panel.string>
+ <panel.string name="ban_failed">
+ Gruppenverbannungen nicht gesendet:
+[REASONS]
+ </panel.string>
+ <panel.string name="residents_already_banned">
+ - Folgende(r) Einwohner ist/sind bereits verbannt: [RESIDENTS]
+ </panel.string>
+ <panel.string name="ban_limit_reached">
+ - Höchstzahl Verbannungen erreicht; folgende Agenten wurden nicht verbannt: [RESIDENTS].
+ </panel.string>
+ <panel.string name="cant_ban_yourself">
+ - Sie können sich nicht selbst aus einer Gruppe verbannen.
+ </panel.string>
+ <text name="help_text">
+ Sie können mehrere Einwohner auswählen, um sie aus Ihrer Gruppe zu verbannen. Klicken Sie hierzu auf „Einwohnerliste öffnen“.
+ </text>
+ <button label="Einwohnerliste öffnen" name="add_button"/>
+ <name_list name="banned_agent_list" tool_tip="Halten Sie zur Mehrfachauswahl die Strg-Taste gedrückt und klicken Sie auf die Namen."/>
+ <button label="Ausgewählte Einwohner aus Liste entfernen" name="remove_button" tool_tip="Dadurch werden die oben ausgewählten Einwohner aus der Bannliste entfernt."/>
+ <button label="Einwohner verbannen" name="ban_button"/>
+ <button label="Abbrechen" name="cancel_button"/>
+ <string name="GroupBulkBan">
+ Gruppenverbannung
+ </string>
+</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/de/panel_group_info_sidetray.xml
index bf4d44af52..1775394ecd 100755
--- a/indra/newview/skins/default/xui/de/panel_group_info_sidetray.xml
+++ b/indra/newview/skins/default/xui/de/panel_group_info_sidetray.xml
@@ -20,7 +20,7 @@
<layout_panel name="group_accordions">
<accordion name="groups_accordion">
<accordion_tab name="group_general_tab" title="Allgemein"/>
- <accordion_tab name="group_roles_tab" title="Rollen"/>
+ <accordion_tab name="group_roles_tab" title="Rollen und Mitglieder"/>
<accordion_tab name="group_notices_tab" title="Mitteilungen"/>
<accordion_tab name="group_land_tab" title="Land/Kapital"/>
</accordion>
diff --git a/indra/newview/skins/default/xui/de/panel_group_invite.xml b/indra/newview/skins/default/xui/de/panel_group_invite.xml
index c32d2fe4bf..d67eaa662c 100755
--- a/indra/newview/skins/default/xui/de/panel_group_invite.xml
+++ b/indra/newview/skins/default/xui/de/panel_group_invite.xml
@@ -22,7 +22,7 @@
Wählen Sie eine Rolle aus:
</text>
<combo_box name="role_name" tool_tip="Wählen Sie aus der Liste der Rollen, die Sie an Mitglieder vergeben dürfen."/>
- <button label="Einladungen versenden" name="ok_button"/>
+ <button label="Einladungen versenden" name="invite_button"/>
<button label="Abbrechen" name="cancel_button"/>
<string name="GroupInvitation">
Gruppeneinladung
diff --git a/indra/newview/skins/default/xui/de/panel_group_roles.xml b/indra/newview/skins/default/xui/de/panel_group_roles.xml
index f297d32a91..2f3268164c 100755
--- a/indra/newview/skins/default/xui/de/panel_group_roles.xml
+++ b/indra/newview/skins/default/xui/de/panel_group_roles.xml
@@ -21,16 +21,18 @@ um mehrere Mitglieder auszuwählen.
<name_list.columns label="Mitglied" name="name" relative_width="0.30"/>
<name_list.columns label="Übereignung" name="donated" relative_width="0.33"/>
<name_list.columns label="Status" name="online"/>
+ <name_list.columns label="Titel" name="title"/>
</name_list>
<button label="Einladen" name="member_invite"/>
<button label="Hinauswerfen" name="member_eject"/>
+ <button label="Mitglied(er) verbannen" name="member_ban"/>
</panel>
<panel label="ROLLEN" name="roles_sub_tab">
<panel.string name="help_text">
Rollen haben einen Titel und umfassen bestimmte
-Fähigkeiten. Mitglieder können mehrere
-Rollen innehaben. Eine Gruppe kann bis zu 10 Rollen
-definieren, darunter &apos;Jeder &apos; und &apos;Eigentümer &apos;.
+ Fähigkeiten. Mitglieder können mehrere
+ Rollen innehaben. Eine Gruppe kann bis zu 10 Rollen
+ aufweisen, darunter „Jeder“ und „Eigentümer“.
</panel.string>
<panel.string name="cant_delete_role">
Die Rollen „Jeder&quot; und „Eigentuemer&quot; sind besondere Rollen und können nicht gelöscht werden.
@@ -56,13 +58,28 @@ definieren, darunter &apos;Jeder &apos; und &apos;Eigentümer &apos;.
<panel label="FÄHIGKEITEN" name="actions_sub_tab" tool_tip="Sie können eine Beschreibung der Fähigkeit anzeigen und welche Rollen bzw. Mitglieder über diese Fähigkeit verfügen.">
<panel.string name="help_text">
Fähigkeiten verleihen Mitgliedern in Rollen bestimmte
-Rechte in einer Gruppe. Es gibt viele verschiedene Fähigkeiten.
+ Rechte in einer Gruppe. Es gibt viele verschiedene Fähigkeiten.
</panel.string>
<filter_editor label="Fähigkeiten filtern" name="filter_input"/>
<scroll_list name="action_list" tool_tip="Eine Fähigkeit auswählen, um mehr Details anzuzeigen.">
<scroll_list.columns label="" name="action"/>
</scroll_list>
</panel>
+ <panel label="VERBANNTE EINWOHNER" name="banlist_sub_tab" tool_tip="Verbannte Einwohner in dieser Gruppe anzeigen.">
+ <panel.string name="help_text">
+ Einwohner auf der Bannliste können nicht der Gruppe beitreten.
+ </panel.string>
+ <panel.string name="ban_count_template">
+ Anzahl Verbannungen: [COUNT]/[LIMIT]
+ </panel.string>
+ <name_list name="ban_list">
+ <name_list.columns label="Einwohner" name="name"/>
+ <name_list.columns label="Datum der Verbannung" name="ban_date"/>
+ </name_list>
+ <button label="Einwohner verbannen" name="ban_create" tool_tip="Einwohner Ihrer Gruppe verbannen"/>
+ <button label="Verbannung(en) entfernen" name="ban_delete" tool_tip="Verbannung für bestimmte Einwohner in Ihrer Gruppe aufheben"/>
+ <button name="ban_refresh" tool_tip="Bannliste aktualisieren"/>
+ </panel>
</tab_container>
<panel name="members_footer">
<text name="static">
diff --git a/indra/newview/skins/default/xui/de/panel_login.xml b/indra/newview/skins/default/xui/de/panel_login.xml
index 8cc467185c..816f22178c 100755
--- a/indra/newview/skins/default/xui/de/panel_login.xml
+++ b/indra/newview/skins/default/xui/de/panel_login.xml
@@ -1,46 +1,27 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8"?>
<panel name="panel_login">
<panel.string name="forgot_password_url">
http://secondlife.com/account/request.php?lang=de
</panel.string>
- <layout_stack name="login_widgets">
- <layout_panel name="login">
- <text name="log_in_text">
- ANMELDEN
- </text>
- <text name="username_text">
- Benutzername:
- </text>
- <combo_box name="username_combo" tool_tip="Bei der Registrierung gewählter Benutzername wie „berndschmidt12“ oder „Liebe Sonne“"/>
- <text name="password_text">
- Kennwort:
- </text>
- </layout_panel>
- <layout_panel name="start_location_panel">
- <text name="start_location_text">
- Hier starten:
- </text>
- <combo_box name="start_location_combo">
- <combo_box.item label="Mein letzter Standort" name="MyLastLocation"/>
- <combo_box.item label="Mein Zuhause" name="MyHome"/>
- <combo_box.item label="&lt;Region eingeben&gt;" name="Typeregionname"/>
- </combo_box>
- </layout_panel>
- <layout_panel name="links_login_panel">
- <text name="login_help">
- Brauchen Sie Hilfe beim Anmelden?
- </text>
+ <layout_stack name="ui_stack">
+ <layout_panel name="ui_container">
+ <combo_box label="Benutzername" name="username_combo" tool_tip="Bei der Registrierung gewählter Benutzername wie „berndschmidt12“ oder „Liebe Sonne“"/>
+ <line_editor label="Kennwort" name="password_edit"/>
+ <check_box label="Details speichern" name="remember_check"/>
<text name="forgot_password_text">
- Benutzernamen oder Kennwort vergessen?
+ Kennwort vergessen
</text>
<button label="Anmelden" name="connect_btn"/>
- <check_box label="Kennwort speichern" name="remember_check"/>
- </layout_panel>
- <layout_panel name="links">
- <text name="create_account_text">
- IHR KONTO ERSTELLEN
+ <text name="At_My_Last_Location_Label">
+ bei letztem Ort
</text>
- <button label="Jetzt starten" name="create_new_account_btn"/>
+ <combo_box label="Meine Lieblingsorte" name="start_location_combo">
+ <combo_box.item label="Mein Zuhause" name="MyHome"/>
+ </combo_box>
+ <button label="Anmelden" name="connect_favorite_btn"/>
+ <line_editor label="Ort eingeben" name="location_edit"/>
+ <button label="Anmelden" name="connect_location_btn"/>
+ <combo_box label="Grid auswählen" name="server_combo"/>
</layout_panel>
</layout_stack>
</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_login_first.xml b/indra/newview/skins/default/xui/de/panel_login_first.xml
new file mode 100644
index 0000000000..44637d5159
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/panel_login_first.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_login">
+ <panel.string name="forgot_password_url">
+ http://secondlife.com/account/request.php?lang=de
+ </panel.string>
+ <layout_stack name="logo_stack">
+ <layout_panel name="parent_panel2">
+ <layout_stack name="widget_stack">
+ <layout_panel name="widget_container">
+ <combo_box label="Benutzername" name="username_combo" tool_tip="Bei der Registrierung gewählter Benutzername wie „berndschmidt12“ oder „Liebe Sonne“"/>
+ <line_editor label="Kennwort" name="password_edit"/>
+ <button label="Anmelden" name="connect_btn"/>
+ <check_box label="Details speichern" name="remember_check"/>
+ <text name="forgot_password_text">
+ Kennwort vergessen
+ </text>
+ </layout_panel>
+ </layout_stack>
+ </layout_panel>
+ <layout_panel name="parent_panel3">
+ <layout_stack name="images_stack">
+ <layout_panel name="images_container">
+ <text name="image_caption_left">
+ Ihr erster Schritt ist Learning Island. Suchen Sie die Pforte!
+ </text>
+ <text name="image_caption_right">
+ Erkunden Sie dann Social Island und lernen Sie andere Einwohner kennen!
+ </text>
+ </layout_panel>
+ </layout_stack>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_postcard_message.xml b/indra/newview/skins/default/xui/de/panel_postcard_message.xml
index 6eeef8af71..b34dc776de 100755
--- a/indra/newview/skins/default/xui/de/panel_postcard_message.xml
+++ b/indra/newview/skins/default/xui/de/panel_postcard_message.xml
@@ -9,13 +9,11 @@
<text name="subject_label">
Betreff:
</text>
- <line_editor label="Betreff hier eingeben." name="subject_form"/>
+ <line_editor label="Betreff hier rein." name="subject_form"/>
<text name="msg_label">
Nachricht:
</text>
<text_editor name="msg_form">
Nachricht hier eingeben.
</text_editor>
- <button label="Abbrechen" name="cancel_btn"/>
- <button label="Senden" name="send_btn"/>
</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_postcard_settings.xml b/indra/newview/skins/default/xui/de/panel_postcard_settings.xml
index c1a1c0cc46..e6d3b7de66 100755
--- a/indra/newview/skins/default/xui/de/panel_postcard_settings.xml
+++ b/indra/newview/skins/default/xui/de/panel_postcard_settings.xml
@@ -7,17 +7,10 @@
<combo_box.item label="1024x768" name="1024x768"/>
<combo_box.item label="Benutzerdefiniert" name="Custom"/>
</combo_box>
- <layout_stack name="postcard_image_params_ls">
- <layout_panel name="postcard_image_size_lp">
- <spinner label="Breite" name="postcard_snapshot_width"/>
- <spinner label="Höhe" name="postcard_snapshot_height"/>
- <check_box label="Seitenverhältnis beibehalten" name="postcard_keep_aspect_check"/>
- </layout_panel>
- <layout_panel name="postcard_image_format_quality_lp">
- <slider label="Bildqualität" name="image_quality_slider"/>
- <text name="image_quality_level">
- ([QLVL])
- </text>
- </layout_panel>
- </layout_stack>
+ <spinner label="Breite x Höhe" name="postcard_snapshot_width"/>
+ <check_box label="Seitenverhältnis beibehalten" name="postcard_keep_aspect_check"/>
+ <slider label="Qualität" name="image_quality_slider"/>
+ <text name="image_quality_level">
+ ([QLVL])
+ </text>
</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/de/panel_preferences_advanced.xml
index 8a5c175f2f..60e4fb19a7 100755
--- a/indra/newview/skins/default/xui/de/panel_preferences_advanced.xml
+++ b/indra/newview/skins/default/xui/de/panel_preferences_advanced.xml
@@ -28,4 +28,5 @@
<check_box label="Bei Anmeldung Rasterauswahl anzeigen" name="show_grid_selection_check"/>
<check_box label="Menü „Erweitert“ anzeigen" name="show_advanced_menu_check"/>
<check_box label="Menü „Entwickler“ anzeigen" name="show_develop_menu_check"/>
+ <button label="Standard-Erstellungsberechtigungen" name="default_creation_permissions"/>
</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_preferences_general.xml b/indra/newview/skins/default/xui/de/panel_preferences_general.xml
index 4e453b6969..2587ea0ced 100755
--- a/indra/newview/skins/default/xui/de/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/de/panel_preferences_general.xml
@@ -30,14 +30,10 @@
<combo_box.item label="Generell und Moderat" name="Desired_Mature"/>
<combo_box.item label="Generell" name="Desired_PG"/>
</combo_box>
- <text name="start_location_textbox">
- Startstandort:
+ <check_box label="Lieblingsstandorte auf dem Anmeldebildschirm anzeigen" name="favorites_on_login_check"/>
+ <text name="favorites_check_extra_text">
+ (Andere, die Ihren Computer benutzen, sehen sie ebenfalls)
</text>
- <combo_box name="start_location_combo">
- <combo_box.item label="Mein letzter Standort" name="MyLastLocation" tool_tip="Als Standardeinstellung in letztem Standort anmelden."/>
- <combo_box.item label="Mein Zuhause" name="MyHome" tool_tip="Als Standardeinstellung in Zuhauseposition anmelden."/>
- </combo_box>
- <check_box initial_value="true" label="Beim Anmelden anzeigen" name="show_location_checkbox"/>
<text name="name_tags_textbox">
Avatarnamen:
</text>
diff --git a/indra/newview/skins/default/xui/de/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/de/panel_preferences_privacy.xml
index e21bed6bb5..7ac6708321 100755
--- a/indra/newview/skins/default/xui/de/panel_preferences_privacy.xml
+++ b/indra/newview/skins/default/xui/de/panel_preferences_privacy.xml
@@ -7,11 +7,11 @@
<text name="cache_size_label_l">
(Standorte, Bilder, Web, Suchverlauf)
</text>
- <check_box label="In Suchergebnissen anzeigen" name="online_searchresults"/>
+ <check_box label="Meine Profilinfos in Suchergebnissen anzeigen" name="online_searchresults"/>
<check_box label="Nur Freunde und Gruppen wissen, dass ich online bin" name="online_visibility"/>
<check_box label="Nur Freunde und Gruppen können mich anrufen oder mir eine IM schicken" name="voice_call_friends_only_check"/>
<check_box label="Mikrofon ausschalten, wenn Anrufe beendet werden" name="auto_disengage_mic_check"/>
- <check_box label="Meine Lieblingslandmarken bei Anmeldung anzeigen (im Dropdown-Menü &#10;„Hier anfangen“)" name="favorites_on_login_check" top_pad="15"/>
+ <check_box label="Meine Lieblingslandmarken bei Anmeldung anzeigen (im Dropdown-Menü „Hier anfangen“)" name="favorites_on_login_check" top_pad="15"/>
<text name="Logs:">
Chatprotokolle:
</text>
diff --git a/indra/newview/skins/default/xui/de/panel_region_debug.xml b/indra/newview/skins/default/xui/de/panel_region_debug.xml
index a03a0b8b7b..d4b0ed907e 100755
--- a/indra/newview/skins/default/xui/de/panel_region_debug.xml
+++ b/indra/newview/skins/default/xui/de/panel_region_debug.xml
@@ -7,11 +7,8 @@
unbekannt
</text>
<check_box label="Skripts deaktivieren" name="disable_scripts_check" tool_tip="Skripts in dieser Region deaktivieren"/>
- <button label="?" name="disable_scripts_help"/>
<check_box label="Kollisionen deaktivieren" name="disable_collisions_check" tool_tip="Nicht-Avatar-Kollisionen in dieser Region deaktivieren"/>
- <button label="?" name="disable_collisions_help"/>
<check_box label="Physik deaktivieren" name="disable_physics_check" tool_tip="Physik in dieser Region deaktivieren"/>
- <button label="?" name="disable_physics_help"/>
<button label="Übernehmen" name="apply_btn"/>
<text name="objret_text_lbl" width="110">
Objekt zurückgeben
@@ -31,10 +28,8 @@
<check_box label="In jeder Region auf diesem Grundbesitz" name="return_estate_wide" tool_tip="Es werden die Objekte in allen Regionen dieses Grundbesitzes zurückgegeben"/>
<button label="Zurückgeben" name="return_btn" width="90"/>
<button label="Top-Kollisionsobjekte..." name="top_colliders_btn" tool_tip="Liste der Objekte mit den meisten potenziellen Kollisionen"/>
- <button label="?" name="top_colliders_help"/>
- <button label="Top-Skripts..." name="top_scripts_btn" tool_tip="Zeigt eine Liste der Objekte an, die die meiste Zeit benötigen, um Skripts auszuführen."/>
- <button label="?" name="top_scripts_help"/>
<button label="Region neu starten" name="restart_btn" tool_tip="2-Minuten-Countdown und Region neu starten"/>
- <button label="?" name="restart_help"/>
+ <button label="Top-Skripts..." name="top_scripts_btn" tool_tip="Zeigt eine Liste der Objekte an, die die meiste Zeit benötigen, um Skripts auszuführen."/>
<button label="Neustart abbrechen" name="cancel_restart_btn" tool_tip="Regionsneustart abbrechen"/>
+ <button label="Regions-Debug-Konsole" name="region_debug_console_btn" tool_tip="Regions-Debug-Konsole öffnen"/>
</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_region_general.xml b/indra/newview/skins/default/xui/de/panel_region_general.xml
index f383be992b..6324e90029 100755
--- a/indra/newview/skins/default/xui/de/panel_region_general.xml
+++ b/indra/newview/skins/default/xui/de/panel_region_general.xml
@@ -20,12 +20,12 @@
</text>
<check_box label="Terraformen blockieren" name="block_terraform_check"/>
<check_box label="Fliegen blockieren" name="block_fly_check"/>
+ <check_box label="Überfliegen von Parzellen blockieren" name="block_fly_over_check" tool_tip="Zugangsprüfungen nach oben ausdehnen, um Überfliegen einer Parzelle zu verhindern"/>
<check_box label="Schaden zulassen" name="allow_damage_check"/>
<check_box label="Stoßen beschränken" name="restrict_pushobject"/>
<check_box label="Landwiederverkauf zulassen" name="allow_land_resell_check"/>
<check_box label="Landumverteilung zulassen" name="allow_parcel_changes_check"/>
<check_box label="Landanzeige in Suche blockieren" name="block_parcel_search_check" tool_tip="Diese Region und ihre Parzellen in Suchergebnissen anzeigen"/>
- <check_box label="Netzobjekte zulassen" name="mesh_rez_enabled_check" tool_tip="Anderen das Rezzen von Netzobjekten in dieser Region gestatten"/>
<spinner label="Avatar-Limit" name="agent_limit_spin"/>
<spinner label="Objektbonus" name="object_bonus_spin"/>
<text label="Inhaltseinstufung" name="access_text">
diff --git a/indra/newview/skins/default/xui/de/panel_script_ed.xml b/indra/newview/skins/default/xui/de/panel_script_ed.xml
index d688bedd5c..8975cd40f8 100755
--- a/indra/newview/skins/default/xui/de/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/de/panel_script_ed.xml
@@ -24,6 +24,7 @@
<menu_item_call label="Alle Änderungen zurücksetzen" name="Revert All Changes"/>
<menu_item_call label="Aus Datei laden..." name="LoadFromFile"/>
<menu_item_call label="In Datei speichern..." name="SaveToFile"/>
+ <menu_item_call label="Farben..." name="Colors"/>
</menu>
<menu label="Bearbeiten" name="Edit">
<menu_item_call label="Rückgängig" name="Undo"/>
@@ -41,9 +42,9 @@
<menu_item_call label="Schlüsselwort-Hilfe" name="Keyword Help..."/>
</menu>
</menu_bar>
- <text_editor name="Script Editor">
+ <script_editor name="Script Editor">
Wird geladen...
- </text_editor>
+ </script_editor>
<combo_box label="Einfügen..." name="Insert..."/>
<button label="Speichern" label_selected="Speichern" name="Save_btn"/>
<button label="Bearbeiten..." name="Edit_btn"/>
diff --git a/indra/newview/skins/default/xui/de/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/de/panel_snapshot_inventory.xml
index 10827ce6f2..d13f56ed3d 100755
--- a/indra/newview/skins/default/xui/de/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/de/panel_snapshot_inventory.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_inventory">
<text name="title">
- In meinem Inventar speichern
+ Inventar
</text>
<text name="hint_lbl">
Das Speichern eines Bilds in Ihrem Inventar kostet [UPLOAD_COST] L$. Um das Bild als Textur zu speichern, wählen Sie eines der quadratischen Formate aus.
@@ -13,8 +13,7 @@
<combo_box.item label="Groß (512x512)" name="Large(512x512)"/>
<combo_box.item label="Benutzerdefiniert" name="Custom"/>
</combo_box>
- <spinner label="Breite" name="inventory_snapshot_width"/>
- <spinner label="Höhe" name="inventory_snapshot_height"/>
+ <spinner label="Breite x Höhe" name="inventory_snapshot_width"/>
<check_box label="Seitenverhältnis beibehalten" name="inventory_keep_aspect_check"/>
<button label="Abbrechen" name="cancel_btn"/>
<button label="Speichern" name="save_btn"/>
diff --git a/indra/newview/skins/default/xui/de/panel_snapshot_local.xml b/indra/newview/skins/default/xui/de/panel_snapshot_local.xml
index 3aeae80388..53e78ba290 100755
--- a/indra/newview/skins/default/xui/de/panel_snapshot_local.xml
+++ b/indra/newview/skins/default/xui/de/panel_snapshot_local.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_local">
<text name="title">
- Auf meinem Computer speichern
+ Festplatte
</text>
<combo_box label="Auflösung" name="local_size_combo">
<combo_box.item label="Aktuelles Fenster" name="CurrentWindow"/>
@@ -13,24 +13,17 @@
<combo_box.item label="1600x1200" name="1600x1200"/>
<combo_box.item label="Benutzerdefiniert" name="Custom"/>
</combo_box>
- <layout_stack name="local_image_params_ls">
- <layout_panel name="local_image_size_lp">
- <spinner label="Breite" name="local_snapshot_width"/>
- <spinner label="Höhe" name="local_snapshot_height"/>
- <check_box label="Seitenverhältnis beibehalten" name="local_keep_aspect_check"/>
- </layout_panel>
- <layout_panel name="local_image_format_quality_lp">
- <combo_box label="Format" name="local_format_combo">
- <combo_box.item label="PNG (verlustfrei)" name="PNG"/>
- <combo_box.item label="JPEG" name="JPEG"/>
- <combo_box.item label="BMP (verlustfrei)" name="BMP"/>
- </combo_box>
- <slider label="Bildqualität" name="image_quality_slider"/>
- <text name="image_quality_level">
- ([QLVL])
- </text>
- </layout_panel>
- </layout_stack>
+ <spinner label="Breite x Höhe" name="local_snapshot_width"/>
+ <check_box label="Seitenverhältnis beibehalten" name="local_keep_aspect_check"/>
+ <combo_box label="Format" name="local_format_combo">
+ <combo_box.item label="PNG (verlustfrei)" name="PNG"/>
+ <combo_box.item label="JPEG" name="JPEG"/>
+ <combo_box.item label="BMP (verlustfrei)" name="BMP"/>
+ </combo_box>
+ <slider label="Qualität" name="image_quality_slider"/>
+ <text name="image_quality_level">
+ ([QLVL])
+ </text>
<button label="Abbrechen" name="cancel_btn"/>
<flyout_button label="Speichern" name="save_btn" tool_tip="Bild als Datei speichern">
<flyout_button.item label="Speichern" name="save_item"/>
diff --git a/indra/newview/skins/default/xui/de/panel_snapshot_options.xml b/indra/newview/skins/default/xui/de/panel_snapshot_options.xml
index e1d8a5dc6d..7ec22adc4c 100755
--- a/indra/newview/skins/default/xui/de/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/de/panel_snapshot_options.xml
@@ -1,7 +1,16 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_options">
- <button label="In meinem Profil posten" name="save_to_profile_btn"/>
- <button label="E-Mail" name="save_to_email_btn"/>
- <button label="In meinem Inventar speichern ([AMOUNT] L$)" name="save_to_inventory_btn"/>
- <button label="Auf meinem Computer speichern" name="save_to_computer_btn"/>
+ <button label="Ins Profil hochladen" name="save_to_profile_btn"/>
+ <button label="Per E-Mail senden" name="save_to_email_btn"/>
+ <button label="Im Inventar speichern" name="save_to_inventory_btn"/>
+ <button label="Auf Festplatte speichern" name="save_to_computer_btn"/>
+ <text name="send_to_facebook_textbox">
+ Senden an: [secondlife:/// Facebook]
+ </text>
+ <text name="send_to_twitter_textbox">
+ [secondlife:/// Twitter]
+ </text>
+ <text name="send_to_flickr_textbox">
+ [secondlife:/// Flickr]
+ </text>
</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/de/panel_snapshot_postcard.xml
index c9afe86d7f..ead56f2885 100755
--- a/indra/newview/skins/default/xui/de/panel_snapshot_postcard.xml
+++ b/indra/newview/skins/default/xui/de/panel_snapshot_postcard.xml
@@ -12,6 +12,10 @@
<text name="title">
E-Mail
</text>
- <button label="Nachricht" name="message_btn"/>
- <button label="Einstellungen" name="settings_btn"/>
+ <tab_container name="postcard_tabs">
+ <panel name="panel_postcard_message" label="Nachricht"/>
+ <panel name="panel_postcard_settings" label="Einstellungen"/>
+ </tab_container>
+ <button name="cancel_btn" label="Abbrechen"/>
+ <button name="send_btn" label="Absenden"/>
</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/de/panel_snapshot_profile.xml
index 8d1c52dea8..0f21edd1b6 100755
--- a/indra/newview/skins/default/xui/de/panel_snapshot_profile.xml
+++ b/indra/newview/skins/default/xui/de/panel_snapshot_profile.xml
@@ -1,28 +1,21 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_profile">
<text name="title">
- In meinem Profil posten
+ Profil
</text>
<combo_box label="Auflösung" name="profile_size_combo">
- <combo_box.item label="Aktuelles Fenster" name="CurrentWindow"/>
- <combo_box.item label="640x480" name="640x480"/>
- <combo_box.item label="800x600" name="800x600"/>
- <combo_box.item label="1024x768" name="1024x768"/>
- <combo_box.item label="Benutzerdefiniert" name="Custom"/>
+ <combo_box.item label="Aktuelles Fenster" name="CurrentWindow"/>
+ <combo_box.item label="640x480" name="640x480"/>
+ <combo_box.item label="800x600" name="800x600"/>
+ <combo_box.item label="1024x768" name="1024x768"/>
+ <combo_box.item label="Benutzerdefiniert" name="Custom"/>
</combo_box>
- <layout_stack name="profile_image_params_ls">
- <layout_panel name="profile_image_size_lp">
- <spinner label="Breite" name="profile_snapshot_width"/>
- <spinner label="Höhe" name="profile_snapshot_height"/>
- <check_box label="Seitenverhältnis beibehalten" name="profile_keep_aspect_check"/>
- </layout_panel>
- <layout_panel name="profile_image_metadata_lp">
- <text name="caption_label">
- Bildunterschrift:
- </text>
- <check_box initial_value="true" label="Ort einschließen" name="add_location_cb"/>
- </layout_panel>
- </layout_stack>
+ <spinner label="Breite x Höhe" name="profile_snapshot_width"/>
+ <check_box label="Seitenverhältnis beibehalten" name="profile_keep_aspect_check"/>
+ <text name="caption_label">
+ Bildunterschrift:
+ </text>
+ <check_box initial_value="true" label="Ort einschließen" name="add_location_cb"/>
<button label="Abbrechen" name="cancel_btn"/>
<button label="Posten" name="post_btn"/>
</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_teleport_history_item.xml b/indra/newview/skins/default/xui/de/panel_teleport_history_item.xml
index 4b57aa69b6..5a402d02a1 100755
--- a/indra/newview/skins/default/xui/de/panel_teleport_history_item.xml
+++ b/indra/newview/skins/default/xui/de/panel_teleport_history_item.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="teleport_history_item">
<text name="region" value="..."/>
+ <text name="timestamp" value="..."/>
<button name="profile_btn" tool_tip="Objektinfo anzeigen"/>
</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_twitter_account.xml b/indra/newview/skins/default/xui/de/panel_twitter_account.xml
new file mode 100644
index 0000000000..f2cbf3eb55
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/panel_twitter_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_twitter_account">
+ <string name="twitter_connected" value="Sie sind mit Twitter verbunden als:"/>
+ <string name="twitter_disconnected" value="Nicht mit Twitter verbunden"/>
+ <text name="account_caption_label">
+ Nicht mit Twitter verbunden.
+ </text>
+ <panel name="panel_buttons">
+ <button label="Verbinden..." name="connect_btn"/>
+ <button label="Trennen" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Twitter/ta-p/2435453 Anweisungen zum Posten auf Twitter]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/de/panel_twitter_photo.xml b/indra/newview/skins/default/xui/de/panel_twitter_photo.xml
new file mode 100644
index 0000000000..89c4b98ffc
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/panel_twitter_photo.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_twitter_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="text_panel">
+ <text name="status_label">
+ Was ist los?
+ </text>
+ <text name="status_counter_label">
+ 140
+ </text>
+ <check_box initial_value="true" label="SL-Standort hinzufügen" name="add_location_cb"/>
+ <check_box initial_value="true" label="Foto hinzufügen" name="add_photo_cb"/>
+ </layout_panel>
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="Bildauflösung">
+ <combo_box.item label="Aktuelles Fenster" name="CurrentWindow"/>
+ <combo_box.item label="640x480" name="640x480"/>
+ <combo_box.item label="800x600" name="800x600"/>
+ <combo_box.item label="1024x768" name="1024x768"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="Bildfilter">
+ <combo_box.item label="Kein Filter" name="NoFilter"/>
+ </combo_box>
+ <button label="Aktualisieren" name="new_snapshot_btn" tool_tip="Zum Aktualisieren klicken"/>
+ <button label="Vorschau" name="big_preview_btn" tool_tip="Klicken, um Vorschau ein-/auszuschalten"/>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="Tweeten" name="post_photo_btn"/>
+ <button label="Abbrechen" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/de/role_actions.xml b/indra/newview/skins/default/xui/de/role_actions.xml
index 3e9d406e5f..d834fc57ca 100755
--- a/indra/newview/skins/default/xui/de/role_actions.xml
+++ b/indra/newview/skins/default/xui/de/role_actions.xml
@@ -3,6 +3,7 @@
<action_set description="Diese Fähigkeiten ermöglichen das Hinzufügen und Entfernen von Mitgliedern sowie den Beitritt ohne Einladung." name="Membership">
<action description="Personen in diese Gruppe einladen" longdescription="Leute in diese Gruppe mit der Schaltfläche „Einladen“ im Abschnitt „Rollen“ &gt; Registerkarte „Mitglieder“ in die Gruppe einladen." name="member invite" value="1"/>
<action description="Mitglieder aus dieser Gruppe werfen" longdescription="Leute aus dieser Gruppe mit der Schaltfläche „Hinauswerfen“ im Abschnitt „Rollen“ &gt; Registerkarte „Mitglieder“ aus der Gruppe werfen. Ein Eigentümer kann jeden, außer einen anderen Eigentümer, ausschließen. Wenn Sie kein Eigentümer sind, können Sie ein Mitglied nur dann aus der Gruppe werfen, wenn es die Rolle Jeder inne hat, jedoch KEINE andere Rolle. Um Mitgliedern Rollen entziehen zu können, müssen Sie über die Fähigkeit „Mitgliedern Rollen entziehen“ verfügen." name="member eject" value="2"/>
+ <action description="Bannliste verwalten" longdescription="Gruppenmitglied das Verbannen/Zulassen von Einwohnern aus dieser Gruppe gestatten." name="allow ban" value="51"/>
<action description="„Registrierung offen“ aktivieren/deaktivieren und „Beitrittsgebühr“ ändern." longdescription="„Registrierung offen“ aktivieren, um damit neue Mitglieder ohne Einladung beitreten können, und die „Beitrittsgebühr“ im Abschnitt „Allgemein“ ändern." name="member options" value="3"/>
</action_set>
<action_set description="Diese Fähigkeiten ermöglichen das Hinzufügen, Entfernen und Ändern von Gruppenrollen, das Zuweisen und Entfernen von Rollen und das Zuweisen von Fähigkeiten zu Rollen." name="Roles">
diff --git a/indra/newview/skins/default/xui/de/sidepanel_inventory.xml b/indra/newview/skins/default/xui/de/sidepanel_inventory.xml
index 18aad64f96..94c3c75254 100755
--- a/indra/newview/skins/default/xui/de/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/de/sidepanel_inventory.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel label="Sonstiges" name="objects panel">
- <panel label="" name="sidepanel__inventory_panel">
+ <panel label="" name="sidepanel_inventory_panel">
<layout_stack name="inventory_layout_stack">
<layout_panel name="inbox_layout_panel">
<panel label="" name="marketplace_inbox">
@@ -28,12 +28,12 @@
<button label="Profil" name="info_btn" tool_tip="Objektprofil anzeigen"/>
</layout_panel>
<layout_panel name="share_btn_lp">
- <button label="Teilen" name="share_btn" tool_tip="Inventarobjekt teilen"/>
+ <button label="Freigeben" name="share_btn" tool_tip="Inventarobjekt freigeben"/>
</layout_panel>
<layout_panel name="shop_btn_lp">
<button label="Einkaufen" name="shop_btn" tool_tip="Marktplatz-Webseite öffnen"/>
<button label="Anziehen" name="wear_btn" tool_tip="Ausgewähltes Outfit tragen"/>
- <button label="Wiedergeben" name="play_btn"/>
+ <button label="Spielen" name="play_btn"/>
<button label="Teleportieren" name="teleport_btn" tool_tip="Zu ausgewähltem Standort teleportieren"/>
</layout_panel>
</layout_stack>
diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml
index 4268b95370..d4ce7b3fc3 100755
--- a/indra/newview/skins/default/xui/de/strings.xml
+++ b/indra/newview/skins/default/xui/de/strings.xml
@@ -37,6 +37,45 @@
<string name="StartupRequireDriverUpdate">
Grafikinitialisierung fehlgeschlagen. Bitte aktualisieren Sie Ihren Grafiktreiber.
</string>
+ <string name="AboutHeader">
+ [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2] ([VIEWER_VERSION_3]) [BUILD_DATE] [BUILD_TIME] ([CHANNEL])
+[[VIEWER_RELEASE_NOTES_URL] [ReleaseNotes]]
+ </string>
+ <string name="AboutCompiler">
+ Kompiliert mit [COMPILER], Version [COMPILER_VERSION]
+ </string>
+ <string name="AboutPosition">
+ Sie befinden sich an [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] in [REGION] auf &lt;nolink&gt;[HOSTNAME]&lt;/nolink&gt; ([HOSTIP])
+SLURL: &lt;nolink&gt;[SLURL]&lt;/nolink&gt;
+(globale Koordinaten [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1])
+[SERVER_VERSION]
+[SERVER_RELEASE_NOTES_URL]
+ </string>
+ <string name="AboutSystem">
+ CPU: [CPU]
+Speicher: [MEMORY_MB] MB
+Betriebssystemversion: [OS_VERSION]
+Grafikkartenhersteller: [GRAPHICS_CARD_VENDOR]
+Grafikkarte: [GRAPHICS_CARD]
+ </string>
+ <string name="AboutDriver">
+ Windows-Grafiktreiberversion: [GRAPHICS_DRIVER_VERSION]
+ </string>
+ <string name="AboutLibs">
+ OpenGL-Version: [OPENGL_VERSION]
+
+libcurl-Version: [LIBCURL_VERSION]
+J2C-Decoderversion: [J2C_VERSION]
+Audiotreiberversion: [AUDIO_DRIVER_VERSION]
+Qt-Webkit-Version: [QT_WEBKIT_VERSION]
+Voice-Server-Version: [VOICE_VERSION]
+ </string>
+ <string name="AboutTraffic">
+ Paketverlust: [PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number,1] %)
+ </string>
+ <string name="ErrorFetchingServerReleaseNotesURL">
+ Fehler beim Abrufen der URL für die Server-Versionshinweise.
+ </string>
<string name="ProgressRestoring">
Wird wiederhergestellt...
</string>
@@ -296,6 +335,75 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden.
<string name="TestingDisconnect">
Verbindungsabbruch wird getestet
</string>
+ <string name="SocialFlickrConnecting">
+ Verbinden mit Flickr...
+ </string>
+ <string name="SocialFlickrPosting">
+ Posten...
+ </string>
+ <string name="SocialFlickrDisconnecting">
+ Flickr-Verbindung wird getrennt...
+ </string>
+ <string name="SocialFlickrErrorConnecting">
+ Problem beim Verbinden mit Flickr
+ </string>
+ <string name="SocialFlickrErrorPosting">
+ Problem beim Posten auf Flickr
+ </string>
+ <string name="SocialFlickrErrorDisconnecting">
+ Problem beim Trennen der Flickr-Verbindung
+ </string>
+ <string name="SocialTwitterConnecting">
+ Verbinden mit Twitter...
+ </string>
+ <string name="SocialTwitterPosting">
+ Posten...
+ </string>
+ <string name="SocialTwitterDisconnecting">
+ Twitter-Verbindung wird getrennt...
+ </string>
+ <string name="SocialTwitterErrorConnecting">
+ Problem beim Verbinden mit Twitter
+ </string>
+ <string name="SocialTwitterErrorPosting">
+ Problem beim Posten auf Twitter
+ </string>
+ <string name="SocialTwitterErrorDisconnecting">
+ Problem beim Trennen der Twitter-Verbindung
+ </string>
+ <string name="BlackAndWhite">
+ Schwarzweiß
+ </string>
+ <string name="Colors1970">
+ Farben der Siebziger Jahre
+ </string>
+ <string name="Intense">
+ Intensiv
+ </string>
+ <string name="Newspaper">
+ Zeitungspapier
+ </string>
+ <string name="Sepia">
+ Sepia
+ </string>
+ <string name="Spotlight">
+ Spotlight
+ </string>
+ <string name="Video">
+ Video
+ </string>
+ <string name="Autocontrast">
+ Autokontrast
+ </string>
+ <string name="LensFlare">
+ Blendenfleck
+ </string>
+ <string name="Miniature">
+ Miniatur
+ </string>
+ <string name="Toycamera">
+ Spielzeugkamera
+ </string>
<string name="TooltipPerson">
Person
</string>
@@ -847,6 +955,12 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden.
<string name="use_texture">
Textur verwenden
</string>
+ <string name="manip_hint1">
+ Zum Einrasten Mauscursor
+ </string>
+ <string name="manip_hint2">
+ über Lineal bewegen
+ </string>
<string name="texture_loading">
Wird geladen...
</string>
@@ -937,15 +1051,15 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden.
<string name="ControlYourCamera">
Kamerasteuerung
</string>
+ <string name="TeleportYourAgent">
+ Sie teleportieren
+ </string>
<string name="NotConnected">
Nicht verbunden
</string>
<string name="AgentNameSubst">
(Sie)
</string>
- <string name="TeleportYourAgent">
- Sie teleportieren
- </string>
<string name="JoinAnExperience">
Bei einem Erlebnis mitmachen
</string>
@@ -1299,6 +1413,18 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden.
<string name="InventoryOutboxNoItems">
Ziehen Sie Ordner in dien Bereich und klicken Sie auf „In Marktplatz übertragen“, um sie im [[MARKETPLACE_DASHBOARD_URL] Marktplatz] zum Verkauf anzubieten.
</string>
+ <string name="InventoryOutboxInitializingTitle">
+ Marktplatz wird initialisiert.
+ </string>
+ <string name="InventoryOutboxInitializing">
+ Wir greifen auf Ihr Konto im [[MARKETPLACE_CREATE_STORE_URL] Marktplatz-Laden] zu.
+ </string>
+ <string name="InventoryOutboxErrorTitle">
+ Marktplatzfehler.
+ </string>
+ <string name="InventoryOutboxError">
+ Der [[MARKETPLACE_CREATE_STORE_URL] Marktplatz-Laden] gibt Fehler zurück.
+ </string>
<string name="Marketplace Error None">
Keine Fehler
</string>
@@ -1326,6 +1452,9 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden.
<string name="Open landmarks">
Landmarken öffnen
</string>
+ <string name="Unconstrained">
+ Variabel
+ </string>
<string name="no_transfer" value=" (kein Transferieren)"/>
<string name="no_modify" value=" (kein Bearbeiten)"/>
<string name="no_copy" value=" (kein Kopieren)"/>
@@ -1726,6 +1855,9 @@ Warten Sie kurz und versuchen Sie dann noch einmal, sich anzumelden.
<string name="CompileQueueDownloadedCompiling">
Heruntergeladen, wird kompiliert
</string>
+ <string name="CompileQueueServiceUnavailable">
+ Kein Skriptkompilierungsdienst verfügbar
+ </string>
<string name="CompileQueueScriptNotFound">
Skript wurde auf Server nicht gefunden.
</string>
@@ -4026,6 +4158,12 @@ Falls diese Meldung weiterhin angezeigt wird, wenden Sie sich bitte an [SUPPORT_
<string name="share_alert">
Objekte aus dem Inventar hier her ziehen
</string>
+ <string name="flickr_post_success">
+ Sie haben auf Flickr gepostet.
+ </string>
+ <string name="twitter_post_success">
+ Sie haben auf Twitter gepostet.
+ </string>
<string name="no_session_message">
(IM-Session nicht vorhanden)
</string>
@@ -4482,6 +4620,9 @@ Missbrauchsbericht
<string name="LocalEstimateUSD">
[AMOUNT] US$
</string>
+ <string name="Group Ban">
+ Gruppenverbannung
+ </string>
<string name="Membership">
Mitgliedschaft
</string>
@@ -4904,6 +5045,12 @@ Setzen Sie den Editorpfad in Anführungszeichen
<string name="Command_Destinations_Label">
Ziele
</string>
+ <string name="Command_Facebook_Label">
+ Facebook
+ </string>
+ <string name="Command_Flickr_Label">
+ Flickr
+ </string>
<string name="Command_Gestures_Label">
Gesten
</string>
@@ -4952,6 +5099,9 @@ Setzen Sie den Editorpfad in Anführungszeichen
<string name="Command_Speak_Label">
Sprechen
</string>
+ <string name="Command_Twitter_Label">
+ Twitter
+ </string>
<string name="Command_View_Label">
Kamerasteuerungen
</string>
@@ -4982,6 +5132,12 @@ Setzen Sie den Editorpfad in Anführungszeichen
<string name="Command_Destinations_Tooltip">
Ziele von Interesse
</string>
+ <string name="Command_Facebook_Tooltip">
+ Auf Facebook posten
+ </string>
+ <string name="Command_Flickr_Tooltip">
+ Auf Flickr hochladen
+ </string>
<string name="Command_Gestures_Tooltip">
Gesten für Ihren Avatar
</string>
@@ -5030,6 +5186,9 @@ Setzen Sie den Editorpfad in Anführungszeichen
<string name="Command_Speak_Tooltip">
Über Ihr Mikrofon mit Leuten in der Nähe sprechen
</string>
+ <string name="Command_Twitter_Tooltip">
+ Twitter
+ </string>
<string name="Command_View_Tooltip">
Kamerawinkel ändern
</string>
diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml
index 9668cfa526..ef2f158a86 100755
--- a/indra/newview/skins/default/xui/en/floater_about.xml
+++ b/indra/newview/skins/default/xui/en/floater_about.xml
@@ -72,7 +72,7 @@ Second Life is brought to you by the Lindens:
top_pad="10"
width="435"
word_wrap="true">
-Philip, Andrew, Doug, Richard, Phoenix, Ian, Mark, Robin, Dan, Char, Ryan, Eric, Jim, Lee, Jeff, Michael, Kelly, Steve, Catherine, Bub, Ramzi, Jill, Jeska, Don, Kona, Callum, Charity, Jack, Shawn, babbage, James, Lauren, Blue, Brent, Reuben, Pathfinder, Jesse, Patsy, Torley, Bo, Cyn, Jonathan, Gia, Annette, Ginsu, Harry, Lex, Runitai, Guy, Cornelius, Beth, Swiss, Thumper, Wendy, Teeple, Seth, Dee, Mia, Sally, Liana, Aura, Beez, Milo, Red, Gulliver, Marius, Joe, Jose, Dore, Justin, Nora, Morpheus, Lexie, Amber, Chris, Xan, Leyla, Walker, Sabin, Joshua, Hiromi, Tofu, Fritz, June, Jean, Ivy, Dez, Ken, Betsy, Which, Spike, Rob, Zee, Dustin, George, Claudia, del, Matthew, jane, jay, Adrian, Yool, Rika, Yoz, siobhan, Qarl, Benjamin, Beast, Everett, madhavi, Christopher, Izzy, stephany, Jeremy, sean, adreanne, Pramod, Tobin, sejong, Iridium, maurice, kj, Meta, kari, JP, bert, kyle, Jon, Socrates, Bridie, Ivan, maria, Aric, Coco, Periapse, sandy, Storrs, Lotte, Colossus, Brad, Pastrami, Zen, BigPapi, Banzai, Sardonyx, Mani, Garry, Jaime, Neuro, Samuel, Niko, CeeLo, Austin, Soft, Poppy, emma, tessa, angelo, kurz, alexa, Sue, CG, Blake, Erica, Brett, Bevis, kristen, Q, simon, Enus, MJ, laurap, Kip, Scouse, Ron, Ram, kend, Marty, Prospero, melissa, kraft, Nat, Seraph, Hamilton, Lordan, Green, miz, Ashlei, Trinity, Ekim, Echo, Charlie, Rowan, Rome, Jt, Doris, benoc, Christy, Bao, Kate, Tj, Patch, Cheah, Johan, Brandy, Angela, Oreh, Cogsworth, Lan, Mitchell, Space, Bambers, Einstein, Bender, Malbers, Matias, Maggie, Rothman, Milton, Niall, Marin, Allison, Mango, Andrea, Katt, Yi, Ambroff, Rico, Raymond, Gail, Christa, William, Dawn, Usi, Dynamike, M, Corr, Dante, Molly, kaylee, Danica, Kelv, Lil, jacob, Nya, Rodney, elsie, Blondin, Grant, Nyx, Devin, Monty, Minerva, Keira, Katie, Jenn, Makai, Clare, Joy, Cody, Gayathri, FJ, spider, Oskar, Landon, Jarv, Noelle, Al, Doc, Gray, Vir, t, Maestro, Simone, Shannon, yang, Courtney, Scott, charlene, Quixote, Susan, Zed, Amanda, Katelin, Esbee, JoRoan, Enkidu, roxie, Scarlet, Merov, Kevin, Judy, Rand, Newell, Les, Dessie, Galen, Michon, Geo, Siz, Calyle, Pete, Praveen, Callen, Sheldon, Pink, Nelson, jenelle, Terrence, Nathan, Juan, Sascha, Huseby, Karina, Kaye, Kotler, Lis, Darv, Charrell, Dakota, Kimmora, Theeba, Taka, Mae, Perry, Ducot, dana, Esther, Dough, gisele, Doten, Viale, Fisher, jessieann, ashley, Torres, delby, rountree, kurt, Slaton, Madison, Rue, Gino, Wen, Casssandra, Brodesky, Squid, Gez, Rakesh, Gecko, Ladan, Tony, Tatem, Squire, Falcon, BK, Crimp, Tiggs, Bacon, Coyot, Carmilla, Webb, Sea, Arch, Jillian, Jason, Bernard, Vogt, Peggy, dragon, Pup, xandix, Wallace, Bewest, Inoshiro, Rhett, AG, Aimee, Ghengis, Itiaes, Eli, Steffan, Epic, Grapes, Stone, Prep, Scobu, Robert, Alain, Carla, Vicky, Tia, Alec, Taras, Lisa, Oz, Ariane, Log, House, Kazu, Kim, Drofnas, Tyler, Campbell, Michele, Madeline, Nelly, Baron, Thor, Lori, Hele, Fredrik, Teddy, Pixie, Berry, Gabrielle, Alfonso, Brooke, Wolf, Ringo, Cru, Charlar, Rodvik, Gibson, Elise, Bagman, Greger, Leonidas, Jerm, Leslie, CB, Brenda, Durian, Carlo, mm, Zeeshan, Caleb, Max, Elikak, Mercille, Steph, Chase
+Philip, Andrew, Doug, Richard, Phoenix, Ian, Mark, Robin, Dan, Char, Ryan, Eric, Jim, Lee, Jeff, Michael, Kelly, Steve, Catherine, Bub, Ramzi, Jill, Jeska, Don, Kona, Callum, Charity, Jack, Shawn, babbage, James, Lauren, Blue, Brent, Reuben, Pathfinder, Jesse, Patsy, Torley, Bo, Cyn, Jonathan, Gia, Annette, Ginsu, Harry, Lex, Runitai, Guy, Cornelius, Beth, Swiss, Thumper, Wendy, Teeple, Seth, Dee, Mia, Sally, Liana, Aura, Beez, Milo, Red, Gulliver, Marius, Joe, Jose, Dore, Justin, Nora, Morpheus, Lexie, Amber, Chris, Xan, Leyla, Walker, Sabin, Joshua, Hiromi, Tofu, Fritz, June, Jean, Ivy, Dez, Ken, Betsy, Which, Spike, Rob, Zee, Dustin, George, Claudia, del, Matthew, jane, jay, Adrian, Yool, Rika, Yoz, siobhan, Qarl, Benjamin, Beast, Everett, madhavi, Christopher, Izzy, stephany, Jeremy, sean, adreanne, Pramod, Tobin, sejong, Iridium, maurice, kj, Meta, kari, JP, bert, kyle, Jon, Socrates, Bridie, Ivan, maria, Aric, Coco, Periapse, sandy, Storrs, Lotte, Colossus, Brad, Pastrami, Zen, BigPapi, Banzai, Sardonyx, Mani, Garry, Jaime, Neuro, Samuel, Niko, CeeLo, Austin, Soft, Poppy, emma, tessa, angelo, kurz, alexa, Sue, CG, Blake, Erica, Brett, Bevis, kristen, Q, simon, Enus, MJ, laurap, Kip, Scouse, Ron, Ram, kend, Marty, Prospero, melissa, kraft, Nat, Seraph, Hamilton, Lordan, Green, miz, Ashlei, Trinity, Ekim, Echo, Charlie, Rowan, Rome, Jt, Doris, benoc, Christy, Bao, Kate, Tj, Patch, Cheah, Johan, Brandy, Angela, Oreh, Cogsworth, Lan, Mitchell, Space, Bambers, Einstein, Bender, Malbers, Matias, Maggie, Rothman, Milton, Niall, Marin, Allison, Mango, Andrea, Katt, Yi, Ambroff, Rico, Raymond, Gail, Christa, William, Dawn, Usi, Dynamike, M, Corr, Dante, Molly, kaylee, Danica, Kelv, Lil, jacob, Nya, Rodney, elsie, Blondin, Grant, Nyx, Devin, Monty, Minerva, Keira, Katie, Jenn, Makai, Clare, Joy, Cody, Gayathri, FJ, spider, Oskar, Landon, Jarv, Noelle, Al, Doc, Gray, Vir, t, Maestro, Simone, Shannon, yang, Courtney, Scott, charlene, Quixote, Susan, Zed, Amanda, Katelin, Esbee, JoRoan, Enkidu, roxie, Scarlet, Merov, Kevin, Judy, Rand, Newell, Les, Dessie, Galen, Michon, Geo, Siz, Calyle, Pete, Praveen, Callen, Sheldon, Pink, Nelson, jenelle, Terrence, Nathan, Juan, Sascha, Huseby, Karina, Kaye, Kotler, Lis, Darv, Charrell, Dakota, Kimmora, Theeba, Taka, Mae, Perry, Ducot, dana, Esther, Dough, gisele, Doten, Viale, Fisher, jessieann, ashley, Torres, delby, rountree, kurt, Slaton, Madison, Rue, Gino, Wen, Casssandra, Brodesky, Squid, Gez, Rakesh, Gecko, Ladan, Tony, Tatem, Squire, Falcon, BK, Crimp, Tiggs, Bacon, Coyot, Carmilla, Webb, Sea, Arch, Jillian, Jason, Bernard, Vogt, Peggy, dragon, Pup, xandix, Wallace, Bewest, Inoshiro, Rhett, AG, Aimee, Ghengis, Itiaes, Eli, Steffan, Epic, Grapes, Stone, Prep, Scobu, Robert, Alain, Carla, Vicky, Tia, Alec, Taras, Lisa, Oz, Ariane, Log, House, Kazu, Kim, Drofnas, Tyler, Campbell, Michele, Madeline, Nelly, Baron, Thor, Lori, Hele, Fredrik, Teddy, Pixie, Berry, Gabrielle, Alfonso, Brooke, Wolf, Ringo, Cru, Charlar, Rodvik, Gibson, Elise, Bagman, Greger, Leonidas, Jerm, Leslie, CB, Brenda, Durian, Carlo, mm, Zeeshan, Caleb, Max, Elikak, Mercille, Steph, Chase, Baker
</text_editor>
<text
follows="top|left"
diff --git a/indra/newview/skins/default/xui/en/floater_big_preview.xml b/indra/newview/skins/default/xui/en/floater_big_preview.xml
new file mode 100644
index 0000000000..c0bdd3d9bd
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_big_preview.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<floater
+ positioning="cascading"
+ can_close="true"
+ can_resize="true"
+ can_minimize="false"
+ help_topic="floater_big_preview"
+ layout="topleft"
+ name="floater_big_preview"
+ save_rect="true"
+ single_instance="true"
+ reuse_instance="true"
+ title="PREVIEW"
+ height="465"
+ width="770">
+ <panel
+ height="450"
+ width="750"
+ visible="true"
+ name="big_preview_placeholder"
+ top="5"
+ follows="all"
+ left="10">
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_buy_object.xml b/indra/newview/skins/default/xui/en/floater_buy_object.xml
index 5fdd4aa49d..49be4290c7 100755
--- a/indra/newview/skins/default/xui/en/floater_buy_object.xml
+++ b/indra/newview/skins/default/xui/en/floater_buy_object.xml
@@ -47,7 +47,7 @@
width="16" />
<scroll_list.columns
name="text"
- width="234" />
+ relative_width="1" />
</scroll_list>
<text
type="string"
@@ -77,7 +77,7 @@
width="16" />
<scroll_list.columns
name="text"
- width="234" />
+ relative_width="1" />
</scroll_list>
<text
type="string"
diff --git a/indra/newview/skins/default/xui/en/floater_conversation_preview.xml b/indra/newview/skins/default/xui/en/floater_conversation_preview.xml
index 764b9d8385..99ad59a7a3 100755
--- a/indra/newview/skins/default/xui/en/floater_conversation_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_conversation_preview.xml
@@ -2,7 +2,6 @@
<floater
legacy_header_height="18"
can_resize="true"
- default_tab_group="1"
help_topic="conversation_preview"
height="391"
layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/floater_facebook.xml b/indra/newview/skins/default/xui/en/floater_facebook.xml
new file mode 100644
index 0000000000..2ea34fb751
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_facebook.xml
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<floater
+ positioning="cascading"
+ can_close="true"
+ help_topic="floater_facebook"
+ layout="topleft"
+ name="floater_facebook"
+ save_rect="true"
+ single_instance="true"
+ reuse_instance="true"
+ title="POST TO FACEBOOK"
+ min_height="462"
+ min_width="304"
+ height="462"
+ width="272">
+ <tab_container
+ name="tabs"
+ tab_group="1"
+ tab_min_width="64"
+ tab_height="21"
+ tab_position="top"
+ top="7"
+ height="437"
+ follows="all"
+ halign="center"
+ use_highlighting_on_hover="true">
+ <panel
+ filename="panel_facebook_status.xml"
+ class="llfacebookstatuspanel"
+ follows="all"
+ label="STATUS"
+ name="panel_facebook_status"/>
+ <panel
+ filename="panel_facebook_photo.xml"
+ class="llfacebookphotopanel"
+ follows="all"
+ label="PHOTO"
+ name="panel_facebook_photo"/>
+ <panel
+ filename="panel_facebook_place.xml"
+ class="llfacebookcheckinpanel"
+ follows="all"
+ label="CHECK IN"
+ name="panel_facebook_place"/>
+ <panel
+ filename="panel_facebook_friends.xml"
+ class="llfacebookfriendspanel"
+ follows="all"
+ label="FRIENDS"
+ name="panel_facebook_friends"/>
+ <!--<panel
+ filename="panel_facebook_account.xml"
+ class="llfacebookaccountpanel"
+ follows="all"
+ label="ACCOUNT"
+ name="panel_facebook_account"/>-->
+ </tab_container>
+ <text
+ name="connection_error_text"
+ type="string"
+ follows="left|bottom|right"
+ bottom="-5"
+ left="10"
+ width="250"
+ height="20"
+ wrap="true"
+ halign="left"
+ valign="center"
+ text_color="DrYellow"
+ font="SansSerif">
+ Error
+ </text>
+ <loading_indicator
+ follows="left|bottom"
+ height="24"
+ width="24"
+ name="connection_loading_indicator"
+ top_delta="-2"
+ left="10"
+ visible="true"/>
+ <text
+ name="connection_loading_text"
+ type="string"
+ follows="left|bottom|right"
+ top_delta="2"
+ left_pad="5"
+ width="250"
+ height="20"
+ wrap="true"
+ halign="left"
+ valign="center"
+ text_color="EmphasisColor"
+ font="SansSerif">
+ Loading...
+ </text>
+</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_fast_timers.xml b/indra/newview/skins/default/xui/en/floater_fast_timers.xml
index 77adb5524e..671f116df3 100755
--- a/indra/newview/skins/default/xui/en/floater_fast_timers.xml
+++ b/indra/newview/skins/default/xui/en/floater_fast_timers.xml
@@ -16,6 +16,27 @@
width="700">
<string name="pause" >Pause</string>
<string name="run">Run</string>
+ <combo_box name="time_scale_combo"
+ follows="left|top"
+ left="10"
+ top="5"
+ width="150"
+ height="20">
+ <item label="2x Average"/>
+ <item label="Max"/>
+ <item label="Recent Max"/>
+ <item label="100ms"/>
+ </combo_box>
+ <combo_box name="metric_combo"
+ follows="left|top"
+ left_pad="10"
+ top="5"
+ width="150"
+ height="20">
+ <item label="Time"/>
+ <item label="Number of Calls"/>
+ <item label="Hz"/>
+ </combo_box>
<button follows="top|right"
name="pause_btn"
left="-200"
@@ -24,4 +45,52 @@
height="40"
label="Pause"
font="SansSerifHuge"/>
+ <layout_stack name="legend_stack"
+ orientation="horizontal"
+ left="0"
+ top="50"
+ right="695"
+ bottom="500"
+ follows="all">
+ <layout_panel name="legend_panel"
+ auto_resize="false"
+ user_resize="true"
+ width="220"
+ height="450"
+ min_width="100">
+ <panel top="0"
+ left="0"
+ width="220"
+ height="440"
+ name="legend"
+ follows="all"/>
+ </layout_panel>
+ <layout_panel name="timers_panel"
+ auto_resize="true"
+ user_resize="true"
+ height="450"
+ width="475"
+ min_width="100">
+ <layout_stack name="timer_bars_stack"
+ orientation="vertical"
+ left="0"
+ top="0"
+ width="475"
+ height="445"
+ follows="all">
+ <layout_panel name="bars_panel"
+ auto_resize="true"
+ user_resize="true"
+ top="0"
+ width="475"
+ height="210"/>
+ <layout_panel name="lines_panel"
+ auto_resize="false"
+ user_resize="true"
+ width="475"
+ min_height="50"
+ height="240"/>
+ </layout_stack>
+ </layout_panel>
+ </layout_stack>
</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_flickr.xml
index b7ff374d5f..24de3ddd8d 100644
--- a/indra/newview/skins/default/xui/en/floater_social.xml
+++ b/indra/newview/skins/default/xui/en/floater_flickr.xml
@@ -3,18 +3,18 @@
positioning="cascading"
can_close="true"
can_resize="false"
- help_topic="floater_social"
+ help_topic="floater_flickr"
layout="topleft"
- name="floater_social"
+ name="floater_flickr"
save_rect="true"
single_instance="true"
reuse_instance="true"
- title="POST TO FACEBOOK"
- height="482"
- width="304">
+ title="UPLOAD TO FLICKR"
+ height="590"
+ width="272">
<panel
- height="482"
- width="304"
+ height="590"
+ width="272"
visible="true"
name="background"
follows="all"
@@ -24,35 +24,25 @@
name="tabs"
tab_group="1"
tab_min_width="70"
- tab_height="30"
+ tab_height="21"
tab_position="top"
top="7"
- height="437"
- halign="center">
+ height="555"
+ follows="all"
+ halign="center"
+ use_highlighting_on_hover="true">
<panel
- filename="panel_social_status.xml"
- class="llsocialstatuspanel"
- follows="all"
- label="STATUS"
- name="panel_social_status"/>
- <panel
- filename="panel_social_photo.xml"
- class="llsocialphotopanel"
+ filename="panel_flickr_photo.xml"
+ class="llflickrphotopanel"
follows="all"
label="PHOTO"
- name="panel_social_photo"/>
- <panel
- filename="panel_social_place.xml"
- class="llsocialcheckinpanel"
- follows="all"
- label="CHECK IN"
- name="panel_social_place"/>
+ name="panel_flickr_photo"/>
<panel
- filename="panel_social_account.xml"
- class="llsocialaccountpanel"
+ filename="panel_flickr_account.xml"
+ class="llflickraccountpanel"
follows="all"
label="ACCOUNT"
- name="panel_social_account"/>
+ name="panel_flickr_account"/>
</tab_container>
<panel
name="connection_status_panel"
@@ -62,8 +52,8 @@
name="connection_error_text"
type="string"
follows="left|bottom|right"
- top="5"
- left="9"
+ bottom="-5"
+ left="10"
width="250"
height="20"
wrap="true"
@@ -78,14 +68,14 @@
height="24"
width="24"
name="connection_loading_indicator"
- top="2"
- left="9"
+ top_delta="-2"
+ left="10"
visible="true"/>
<text
name="connection_loading_text"
type="string"
follows="left|bottom|right"
- top="5"
+ top_delta="2"
left_pad="5"
width="250"
height="20"
diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml
index 7076de55e3..c64ee5565a 100755
--- a/indra/newview/skins/default/xui/en/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_session.xml
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater
background_visible="true"
- default_tab_group="1"
height="355"
help_topic="floater_im_box"
layout="topleft"
@@ -210,10 +209,9 @@
default_tab_group="3"
tab_group="2"
name="right_part_holder"
- min_width="230">
+ min_width="207">
<layout_stack
animate="true"
- default_tab_group="2"
follows="all"
orientation="vertical"
name="translate_and_chat_stack"
diff --git a/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml b/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml
index c86ed595a7..17bc818cc1 100755
--- a/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml
+++ b/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml
@@ -2,7 +2,7 @@
<floater
legacy_header_height="18"
can_minimize="false"
- height="408"
+ height="440"
layout="topleft"
name="Inventory Finder"
help_topic="inventory_finder"
@@ -95,36 +95,36 @@
width="126" />
<icon
height="16"
- image_name="Inv_Mesh"
+ image_name="Inv_Notecard"
layout="topleft"
left="8"
mouse_opaque="true"
- name="icon_mesh"
- top="142"
+ name="icon_notecard"
+ top="122"
width="16" />
<check_box
height="16"
- label="Meshes"
+ label="Notecards"
layout="topleft"
left_pad="2"
- name="check_mesh"
+ name="check_notecard"
top_delta="0"
width="126" />
<icon
height="16"
- image_name="Inv_Notecard"
+ image_name="Inv_Mesh"
layout="topleft"
left="8"
mouse_opaque="true"
- name="icon_notecard"
- top="122"
+ name="icon_mesh"
+ top="142"
width="16" />
<check_box
height="16"
- label="Notecards"
+ label="Meshes"
layout="topleft"
left_pad="2"
- name="check_notecard"
+ name="check_mesh"
top_delta="0"
width="126" />
<icon
@@ -223,25 +223,33 @@
top="262"
width="100" />
<button
- follows="left|top"
height="20"
label="None"
label_selected="None"
- layout="topleft"
left_delta="0"
name="None"
- top_pad="4"
+ left_pad="10"
width="100" />
<check_box
height="16"
label="Always show folders"
layout="topleft"
- left_delta="0"
+ left="8"
name="check_show_empty"
- top_pad="4"
+ top_pad="6"
width="144" />
+ <view_border
+ bevel_style="none"
+ follows="top|left"
+ height="0"
+ layout="topleft"
+ left="10"
+ name="horiz_separator"
+ top_pad="8"
+ width="260"/>
<check_box
height="16"
+ top="324"
label="Since Logoff"
layout="topleft"
left_delta="0"
@@ -257,36 +265,74 @@
layout="topleft"
left_delta="0"
name="- OR -"
- top_delta="16"
+ top="342"
width="144">
- OR -
</text>
+ <radio_group
+ height="16"
+ layout="topleft"
+ name="date_search_direction"
+ top="360"
+ left="8"
+ width="270">
+ <radio_item
+ label="Newer than"
+ layout="topleft"
+ name="newer"
+ top_pad="6"
+ left="0" />
+ <radio_item
+ label="Older than"
+ layout="topleft"
+ name="older"
+ top_delta="0"
+ left="120" />
+ </radio_group>
<spinner
follows="left|top"
height="16"
increment="1"
initial_value="0"
- label="Hours Ago"
- label_width="64"
layout="topleft"
left_delta="0"
max_val="240000"
name="spin_hours_ago"
top_pad="4"
- width="144" />
+ width="64" />
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left_pad="3"
+ top_delta="4"
+ width="80">
+ Hours
+ </text>
<spinner
follows="left|top"
height="16"
increment="1"
initial_value="0"
- label="Days Ago"
- label_width="64"
layout="topleft"
- left_delta="0"
max_val="10000"
name="spin_days_ago"
top_pad="4"
- width="144" />
+ left="8"
+ width="64" />
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left_pad="3"
+ top_delta="4"
+ width="80">
+ Days
+ </text>
<button
follows="top|right"
height="20"
@@ -295,6 +341,6 @@
layout="topleft"
name="Close"
right="-6"
- top="382"
+ top="406"
width="76" />
</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_joystick.xml b/indra/newview/skins/default/xui/en/floater_joystick.xml
index 59f6a9434c..259acccb68 100755
--- a/indra/newview/skins/default/xui/en/floater_joystick.xml
+++ b/indra/newview/skins/default/xui/en/floater_joystick.xml
@@ -197,18 +197,18 @@
name="JoystickFlycamEnabled"
width="60" />
<stat_view
- height="250"
+ height="270"
label="Joystick Monitor"
layout="topleft"
left="359"
name="axis_view"
show_label="true"
- top="142"
+ top="135"
width="200">
<stat_bar
bar_max="2"
bar_min="-2"
- height="0"
+ show_bar="true"
label="Axis 0"
label_spacing="1"
layout="topleft"
@@ -220,6 +220,7 @@
<stat_bar
bar_max="2"
bar_min="-2"
+ show_bar="true"
label="Axis 1"
label_spacing="1"
layout="topleft"
@@ -228,6 +229,7 @@
<stat_bar
bar_max="2"
bar_min="-2"
+ show_bar="true"
label="Axis 2"
label_spacing="1"
layout="topleft"
@@ -236,6 +238,7 @@
<stat_bar
bar_max="2"
bar_min="-2"
+ show_bar="true"
label="Axis 3"
label_spacing="1"
layout="topleft"
@@ -244,6 +247,7 @@
<stat_bar
bar_max="2"
bar_min="-2"
+ show_bar="true"
label="Axis 4"
label_spacing="1"
layout="topleft"
@@ -253,6 +257,7 @@
bar_max="2"
bar_min="-2"
label="Axis 5"
+ show_bar="true"
label_spacing="1"
layout="topleft"
name="axis5"
diff --git a/indra/newview/skins/default/xui/en/floater_lagmeter.xml b/indra/newview/skins/default/xui/en/floater_lagmeter.xml
index b24c745bdd..b24c745bdd 100755..100644
--- a/indra/newview/skins/default/xui/en/floater_lagmeter.xml
+++ b/indra/newview/skins/default/xui/en/floater_lagmeter.xml
diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index 9fa416012c..a4acd1df78 100755
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -212,7 +212,7 @@
follows="top|left"
height="20"
layout="topleft"
- left="222"
+ left="225"
name="lod_mode_high"
top_delta="0"
visible="false"
@@ -342,7 +342,7 @@
follows="top|left"
height="20"
layout="topleft"
- left="222"
+ left="225"
name="lod_mode_medium"
top_delta="0"
width="130">
@@ -470,7 +470,7 @@
follows="top|left"
height="20"
layout="topleft"
- left="222"
+ left="225"
name="lod_mode_low"
top_delta="0"
width="130">
@@ -598,7 +598,7 @@
follows="top|left"
height="20"
layout="topleft"
- left="222"
+ left="225"
name="lod_mode_lowest"
top_delta="0"
width="130">
diff --git a/indra/newview/skins/default/xui/en/floater_openobject.xml b/indra/newview/skins/default/xui/en/floater_openobject.xml
index f526970ad0..bf6e0c4917 100755
--- a/indra/newview/skins/default/xui/en/floater_openobject.xml
+++ b/indra/newview/skins/default/xui/en/floater_openobject.xml
@@ -6,7 +6,7 @@
height="350"
layout="topleft"
min_height="160"
- min_width="270"
+ min_width="280"
name="objectcontents"
help_topic="objectcontents"
save_rect="true"
@@ -40,10 +40,10 @@
<button
follows="bottom|left"
height="23"
- label="Copy To Inventory"
- label_selected="Copy To Inventory"
+ label="Copy to inventory"
+ label_selected="Copy to inventory"
layout="topleft"
- left="20"
+ left="15"
name="copy_to_inventory_button"
tab_group="1"
top_pad="5"
@@ -54,12 +54,12 @@
<button
follows="bottom|left"
height="23"
- label="Copy And Wear"
- label_selected="Copy And Wear"
+ label="Copy and add to outfit"
+ label_selected="Copy and add to outfit"
layout="topleft"
- left_pad="10"
+ left_pad="5"
name="copy_and_wear_button"
- width="120">
+ width="135">
<button.commit_callback
function="OpenObject.MoveAndWear" />
</button>
diff --git a/indra/newview/skins/default/xui/en/floater_perm_prefs.xml b/indra/newview/skins/default/xui/en/floater_perm_prefs.xml
deleted file mode 100755
index ff454e3ebf..0000000000
--- a/indra/newview/skins/default/xui/en/floater_perm_prefs.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<floater
- legacy_header_height="18"
- height="180"
- layout="topleft"
- name="perm prefs"
- help_topic="perm_prefs"
- save_rect="true"
- title="DEFAULT UPLOAD PERMISSIONS"
- width="315">
- <panel
- follows="left|top|right|bottom"
- height="120"
- label="Permissions"
- layout="topleft"
- left="10"
- name="permissions"
- top="20"
- width="315">
- <check_box
- control_name="ShareWithGroup"
- height="16"
- label="Share with group"
- layout="topleft"
- left="10"
- name="share_with_group"
- top="5"
- width="150" />
- <check_box
- control_name="EveryoneCopy"
- height="16"
- label="Allow anyone to copy"
- layout="topleft"
- left_delta="0"
- name="everyone_copy"
- top_pad="5"
- width="150" />
- <text
- type="string"
- length="1"
- follows="left|top"
- height="10"
- layout="topleft"
- left_delta="0"
- name="NextOwnerLabel"
- top_pad="5"
- width="200">
- Next owner can:
- </text>
- <check_box
- control_name="NextOwnerModify"
- height="16"
- label="Modify"
- layout="topleft"
- left_delta="0"
- name="next_owner_modify"
- top_pad="5"
- width="150" />
- <check_box
- control_name="NextOwnerCopy"
- height="16"
- label="Copy"
- layout="topleft"
- left_delta="0"
- name="next_owner_copy"
- top_pad="5"
- width="150" >
- <check_box.commit_callback
- function="Perms.Copy" />
- </check_box>
- <check_box
- enabled_control="NextOwnerCopy"
- control_name="NextOwnerTransfer"
- enabled="false"
- height="16"
- initial_value="true"
- label="Resell/Give away"
- layout="topleft"
- left_delta="0"
- name="next_owner_transfer"
- top_pad="5"
- width="150" />
- </panel>
- <button
- height="20"
- label="OK"
- label_selected="OK"
- layout="topleft"
- left="90"
- name="ok"
- top="150"
- width="100">
- <button.commit_callback
- function="Perms.OK" />
- </button>
- <button
- height="20"
- label="Cancel"
- label_selected="Cancel"
- layout="topleft"
- left_pad="5"
- name="cancel"
- top_delta="0"
- width="100">
- <button.commit_callback
- function="Perms.Cancel" />
- </button>
-</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_perms_default.xml b/indra/newview/skins/default/xui/en/floater_perms_default.xml
new file mode 100644
index 0000000000..ceb260fffb
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_perms_default.xml
@@ -0,0 +1,503 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+ legacy_header_height="18"
+ height="250"
+ layout="topleft"
+ name="perms default"
+ help_topic="perms_default"
+ save_rect="true"
+ title="DEFAULT CREATION PERMISSIONS"
+ width="700">
+ <panel
+ follows="left|top|right|bottom"
+ height="200"
+ label="Default Permissions"
+ layout="topleft"
+ left="10"
+ name="default permissions"
+ top="20"
+ width="690">
+ <view_border
+ bevel_style="none"
+ height="18"
+ top="8"
+ left="0"
+ width="430" />
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="16"
+ halign="right"
+ layout="topleft"
+ left="0"
+ top="10"
+ width="115">
+ Next owner:
+ </text>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="16"
+ halign="center"
+ layout="topleft"
+ left_pad="5"
+ top="10"
+ width="100">
+ Copy
+ </text>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="16"
+ halign="center"
+ layout="topleft"
+ left_pad="5"
+ top="10"
+ width="100">
+ Modify
+ </text>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="16"
+ halign="center"
+ layout="topleft"
+ left_pad="5"
+ top="10"
+ width="100">
+ Transfer
+ </text>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="32"
+ halign="center"
+ layout="topleft"
+ left_pad="5"
+ top="10"
+ word_wrap="true"
+ width="100">
+ Share with group
+ </text>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="32"
+ halign="center"
+ layout="topleft"
+ left_pad="5"
+ top="10"
+ word_wrap="true"
+ width="120">
+ Allow anyone to copy
+ </text>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left="0"
+ top_pad="10"
+ tool_tip="Set default permissions for when Objects are created"
+ width="100">
+ Objects
+ </text>
+ <icon
+ follows="left|top"
+ height="16"
+ image_name="Inv_Object"
+ layout="topleft"
+ left_pad="2"
+ width="18"/>
+ <check_box
+ control_name="ObjectsNextOwnerCopy"
+ height="16"
+ layout="topleft"
+ name="objects_c"
+ left_pad="45"
+ top_delta="0"
+ width="100">
+ <check_box.commit_callback
+ function="PermsDefault.Copy"
+ parameter="Objects" />
+ </check_box>
+ <check_box
+ control_name="ObjectsNextOwnerModify"
+ height="16"
+ layout="topleft"
+ name="objects_m"
+ left_pad="0"
+ top_delta="0"
+ width="100" />
+ <check_box
+ enabled_control="ObjectsNextOwnerCopy"
+ control_name="ObjectsNextOwnerTransfer"
+ height="16"
+ layout="topleft"
+ name="objects_t"
+ left_pad="0"
+ top_delta="0"
+ width="100" />
+ <check_box
+ control_name="ObjectsShareWithGroup"
+ height="16"
+ layout="topleft"
+ name="objects_s"
+ left_pad="0"
+ top_delta="0"
+ width="120" />
+ <check_box
+ control_name="ObjectsEveryoneCopy"
+ height="16"
+ layout="topleft"
+ name="objects_e"
+ left_pad="0"
+ top_delta="0"
+ width="100" />
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left="0"
+ tool_tip="Set default permissions for uploaded items"
+ width="100">
+ Uploads
+ </text>
+ <icon
+ follows="left|top"
+ height="16"
+ image_name="Inv_Texture"
+ layout="topleft"
+ left_pad="2"
+ width="18"/>
+ <check_box
+ control_name="UploadsNextOwnerCopy"
+ height="16"
+ layout="topleft"
+ name="uploads_c"
+ left_pad="45"
+ top_delta="0"
+ width="100">
+ <check_box.commit_callback
+ function="PermsDefault.Copy"
+ parameter="Uploads" />
+ </check_box>
+ <check_box
+ control_name="UploadsNextOwnerModify"
+ height="16"
+ layout="topleft"
+ name="uploads_m"
+ left_pad="0"
+ top_delta="0"
+ width="100" />
+ <check_box
+ enabled_control="UploadsNextOwnerCopy"
+ control_name="UploadsNextOwnerTransfer"
+ height="16"
+ layout="topleft"
+ name="uploads_t"
+ left_pad="0"
+ top_delta="0"
+ width="100" />
+ <check_box
+ control_name="UploadsShareWithGroup"
+ height="16"
+ layout="topleft"
+ name="uploads_s"
+ left_pad="0"
+ top_delta="0"
+ width="120" />
+ <check_box
+ control_name="UploadsEveryoneCopy"
+ height="16"
+ layout="topleft"
+ name="uploads_e"
+ left_pad="0"
+ top_delta="0"
+ width="100" />
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left="0"
+ tool_tip="Set default permissions for when Scripts are created"
+ width="100">
+ Scripts
+ </text>
+ <icon
+ follows="left|top"
+ height="16"
+ image_name="Inv_Script"
+ layout="topleft"
+ left_pad="2"
+ width="18"/>
+ <check_box
+ control_name="ScriptsNextOwnerCopy"
+ height="16"
+ layout="topleft"
+ name="scripts_c"
+ left_pad="45"
+ top_delta="0"
+ width="100">
+ <check_box.commit_callback
+ function="PermsDefault.Copy"
+ parameter="Scripts" />
+ </check_box>
+ <check_box
+ control_name="ScriptsNextOwnerModify"
+ height="16"
+ layout="topleft"
+ name="scripts_m"
+ left_pad="0"
+ top_delta="0"
+ width="100" />
+ <check_box
+ enabled_control="ScriptsNextOwnerCopy"
+ control_name="ScriptsNextOwnerTransfer"
+ height="16"
+ layout="topleft"
+ name="scripts_t"
+ left_pad="0"
+ top_delta="0"
+ width="100" />
+ <check_box
+ control_name="ScriptsShareWithGroup"
+ height="16"
+ layout="topleft"
+ name="scripts_s"
+ left_pad="0"
+ top_delta="0"
+ width="120" />
+ <check_box
+ control_name="ScriptsEveryoneCopy"
+ height="16"
+ layout="topleft"
+ name="scripts_e"
+ left_pad="0"
+ top_delta="0"
+ width="100" />
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left="0"
+ tool_tip="Set default permissions for when Notecards are created"
+ width="100">
+ Notecards
+ </text>
+ <icon
+ follows="left|top"
+ height="16"
+ image_name="Inv_Notecard"
+ layout="topleft"
+ left_pad="2"
+ width="18"/>
+ <check_box
+ control_name="NotecardsNextOwnerCopy"
+ height="16"
+ layout="topleft"
+ name="notecards_c"
+ left_pad="45"
+ top_delta="0"
+ width="100">
+ <check_box.commit_callback
+ function="PermsDefault.Copy"
+ parameter="Notecards" />
+ </check_box>
+ <check_box
+ control_name="NotecardsNextOwnerModify"
+ height="16"
+ layout="topleft"
+ name="notecards_m"
+ left_pad="0"
+ top_delta="0"
+ width="100" />
+ <check_box
+ enabled_control="NotecardsNextOwnerCopy"
+ control_name="NotecardsNextOwnerTransfer"
+ height="16"
+ layout="topleft"
+ name="notecards_t"
+ left_pad="0"
+ top_delta="0"
+ width="100" />
+ <check_box
+ control_name="NotecardsShareWithGroup"
+ height="16"
+ layout="topleft"
+ name="notecards_s"
+ left_pad="0"
+ top_delta="0"
+ width="120" />
+ <check_box
+ control_name="NotecardsEveryoneCopy"
+ height="16"
+ layout="topleft"
+ name="notecards_e"
+ left_pad="0"
+ top_delta="0"
+ width="100" />
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left="0"
+ tool_tip="Set default permissions for when Gestures are created"
+ width="100">
+ Gestures
+ </text>
+ <icon
+ follows="left|top"
+ height="16"
+ image_name="Inv_Gesture"
+ layout="topleft"
+ left_pad="2"
+ width="18"/>
+ <check_box
+ control_name="GesturesNextOwnerCopy"
+ height="16"
+ layout="topleft"
+ name="gestures_c"
+ left_pad="45"
+ top_delta="0"
+ width="100">
+ <check_box.commit_callback
+ function="PermsDefault.Copy"
+ parameter="Gestures" />
+ </check_box>
+ <check_box
+ control_name="GesturesNextOwnerModify"
+ height="16"
+ layout="topleft"
+ name="gestures_m"
+ left_pad="0"
+ top_delta="0"
+ width="100" />
+ <check_box
+ enabled_control="GesturesNextOwnerCopy"
+ control_name="GesturesNextOwnerTransfer"
+ height="16"
+ layout="topleft"
+ name="gestures_t"
+ left_pad="0"
+ top_delta="0"
+ width="100" />
+ <check_box
+ control_name="GesturesShareWithGroup"
+ height="16"
+ layout="topleft"
+ name="gestures_s"
+ left_pad="0"
+ top_delta="0"
+ width="120" />
+ <check_box
+ control_name="GesturesEveryoneCopy"
+ height="16"
+ layout="topleft"
+ name="gestures_a"
+ left_pad="0"
+ top_delta="0"
+ width="100" />
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left="0"
+ tool_tip="Set default permissions for when Clothing or Body Parts are created"
+ width="100">
+ Wearables
+ </text>
+ <icon
+ follows="left|top"
+ height="16"
+ image_name="Inv_BodyShape"
+ layout="topleft"
+ left_pad="2"
+ width="18"/>
+ <check_box
+ control_name="WearablesNextOwnerCopy"
+ height="16"
+ layout="topleft"
+ name="wearables_c"
+ left_pad="45"
+ top_delta="0"
+ width="100">
+ <check_box.commit_callback
+ function="PermsDefault.Copy"
+ parameter="Wearables" />
+ </check_box>
+ <check_box
+ control_name="WearablesNextOwnerModify"
+ height="16"
+ layout="topleft"
+ name="wearables_m"
+ left_pad="0"
+ top_delta="0"
+ width="100" />
+ <check_box
+ enabled_control="WearablesNextOwnerCopy"
+ control_name="WearablesNextOwnerTransfer"
+ height="16"
+ layout="topleft"
+ name="wearables_t"
+ left_pad="0"
+ top_delta="0"
+ width="100" />
+ <check_box
+ control_name="WearablesShareWithGroup"
+ height="16"
+ layout="topleft"
+ name="wearables_s"
+ left_pad="0"
+ top_delta="0"
+ width="120" />
+ <check_box
+ control_name="WearablesEveryoneCopy"
+ height="16"
+ layout="topleft"
+ name="wearables_e"
+ left_pad="0"
+ top_delta="0"
+ width="100" />
+ </panel>
+ <button
+ height="20"
+ label="OK"
+ label_selected="OK"
+ layout="topleft"
+ name="ok"
+ left="475"
+ width="100">
+ <button.commit_callback
+ function="PermsDefault.OK" />
+ </button>
+ <button
+ height="20"
+ label="Cancel"
+ label_selected="Cancel"
+ layout="topleft"
+ left_pad="5"
+ name="cancel"
+ top_delta="0"
+ width="100">
+ <button.commit_callback
+ function="PermsDefault.Cancel" />
+ </button>
+</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_places.xml b/indra/newview/skins/default/xui/en/floater_places.xml
index b241e265a9..31dd6d2c64 100755
--- a/indra/newview/skins/default/xui/en/floater_places.xml
+++ b/indra/newview/skins/default/xui/en/floater_places.xml
@@ -2,6 +2,7 @@
<floater
positioning="cascading"
+ default_tab_group="1"
legacy_header_height="18"
can_resize="true"
height="588"
@@ -16,6 +17,7 @@
width="333">
<panel
top="18"
+ tab_group="1"
class="panel_places"
name="main_panel"
filename="panel_places.xml"
diff --git a/indra/newview/skins/default/xui/en/floater_preview_texture.xml b/indra/newview/skins/default/xui/en/floater_preview_texture.xml
index 137e278ddc..e1e7e1c8c8 100755
--- a/indra/newview/skins/default/xui/en/floater_preview_texture.xml
+++ b/indra/newview/skins/default/xui/en/floater_preview_texture.xml
@@ -79,30 +79,6 @@
width="108"
name="combo_aspect_ratio"
tool_tip="Preview at a fixed aspect ratio">
- <combo_item name="Unconstrained" value="Unconstrained">
- Unconstrained
- </combo_item>
- <combo_item name="1:1" value="1:1" tool_tip="Group insignia or Real World profile">
- 1:1
- </combo_item>
- <combo_item name="4:3" value="4:3" tool_tip="[SECOND_LIFE] profile">
- 4:3
- </combo_item>
- <combo_item name="10:7" value="10:7" tool_tip="Classifieds and search listings, landmarks">
- 10:7
- </combo_item>
- <combo_item name="3:2" value="3:2" tool_tip="About land">
- 3:2
- </combo_item>
- <combo_item name="16:10" value="16:10">
- 16:10
- </combo_item>
- <combo_item name="16:9" value="16:9" tool_tip="Profile picks">
- 16:9
- </combo_item>
- <combo_item name="2:1" value="2:1">
- 2:1
- </combo_item>
</combo_box>
<button
follows="right|bottom"
diff --git a/indra/newview/skins/default/xui/en/floater_region_debug_console.xml b/indra/newview/skins/default/xui/en/floater_region_debug_console.xml
index 99b812a880..11172d8a3e 100755
--- a/indra/newview/skins/default/xui/en/floater_region_debug_console.xml
+++ b/indra/newview/skins/default/xui/en/floater_region_debug_console.xml
@@ -21,7 +21,6 @@
layout="topleft"
max_length="65536"
name="region_debug_console_output"
- show_line_numbers="false"
word_wrap="true"
track_end="true"
read_only="true">
diff --git a/indra/newview/skins/default/xui/en/floater_report_abuse.xml b/indra/newview/skins/default/xui/en/floater_report_abuse.xml
index 9561f67941..af62c7a9bc 100755
--- a/indra/newview/skins/default/xui/en/floater_report_abuse.xml
+++ b/indra/newview/skins/default/xui/en/floater_report_abuse.xml
@@ -203,47 +203,15 @@
<combo_box.item
label="Age &gt; Age play"
name="Age__Age_play"
- value="31" />
+ value="31" />
<combo_box.item
- label="Age &gt; Adult Resident on Teen Second Life"
- name="Age__Adult_resident_on_Teen_Second_Life"
- value="32" />
- <combo_box.item
- label="Age &gt; Underage Resident outside of Teen Second Life"
- name="Age__Underage_resident_outside_of_Teen_Second_Life"
- value="33" />
- <combo_box.item
- label="Assault &gt; Combat sandbox / unsafe area"
- name="Assault__Combat_sandbox___unsafe_area"
- value="34" />
- <combo_box.item
- label="Assault &gt; Safe area"
+ label="Assault &gt; Shooting, pushing, or shoving another Resident in a Safe Area"
name="Assault__Safe_area"
- value="35" />
- <combo_box.item
- label="Assault &gt; Weapons testing sandbox"
- name="Assault__Weapons_testing_sandbox"
- value="36" />
- <combo_box.item
- label="Commerce &gt; Failure to deliver product or service"
- name="Commerce__Failure_to_deliver_product_or_service"
- value="38" />
+ value="35" />
<combo_box.item
label="Disclosure &gt; Real world information"
name="Disclosure__Real_world_information"
- value="39" />
- <combo_box.item
- label="Disclosure &gt; Remotely monitoring chat"
- name="Disclosure__Remotely_monitoring chat"
- value="40" />
- <combo_box.item
- label="Disclosure &gt; Second Life information/chat/IMs"
- name="Disclosure__Second_Life_information_chat_IMs"
- value="41" />
- <combo_box.item
- label="Disturbing the peace &gt; Unfair use of region resources"
- name="Disturbing_the_peace__Unfair_use_of_region_resources"
- value="42" />
+ value="39" />
<combo_box.item
label="Disturbing the peace &gt; Excessive scripted objects"
name="Disturbing_the_peace__Excessive_scripted_objects"
@@ -255,51 +223,15 @@
<combo_box.item
label="Disturbing the peace &gt; Repetitive spam"
name="Disturbing_the_peace__Repetitive_spam"
- value="45" />
- <combo_box.item
- label="Disturbing the peace &gt; Unwanted advert spam"
- name="Disturbing_the_peace__Unwanted_advert_spam"
- value="46" />
- <combo_box.item
- label="Fraud &gt; L$"
- name="Fraud__L$"
- value="47" />
- <combo_box.item
- label="Fraud &gt; Land"
- name="Fraud__Land"
- value="48" />
- <combo_box.item
- label="Fraud &gt; Pyramid scheme or chain letter"
- name="Fraud__Pyramid_scheme_or_chain_letter"
- value="49" />
+ value="45" />
<combo_box.item
- label="Fraud &gt; US$"
+ label="Fraud &gt; L$ or USD $"
name="Fraud__US$"
- value="50" />
+ value="50" />
<combo_box.item
- label="Harassment &gt; Advert farms / visual spam"
- name="Harassment__Advert_farms___visual_spam"
- value="51" />
- <combo_box.item
- label="Harassment &gt; Defaming individuals or groups"
- name="Harassment__Defaming_individuals_or_groups"
- value="52" />
- <combo_box.item
- label="Harassment &gt; Impeding movement"
- name="Harassment__Impeding_movement"
- value="53" />
- <combo_box.item
- label="Harassment &gt; Sexual harassment"
- name="Harassment__Sexual_harassment"
- value="54" />
- <combo_box.item
- label="Harassment &gt; Solicting/inciting others to violate ToS"
+ label="Harassment &gt; Targeted behavior intended to disrupt"
name="Harassment__Solicting_inciting_others_to_violate_ToS"
- value="55" />
- <combo_box.item
- label="Harassment &gt; Verbal abuse"
- name="Harassment__Verbal_abuse"
- value="56" />
+ value="55" />
<combo_box.item
label="Indecency &gt; Broadly offensive content or conduct"
name="Indecency__Broadly_offensive_content_or_conduct"
@@ -309,49 +241,21 @@
name="Indecency__Inappropriate_avatar_name"
value="59" />
<combo_box.item
- label="Indecency &gt; Inappropriate content or conduct in a PG region"
+ label="Indecency &gt; Inappropriate content or conduct for Region Rating"
name="Indecency__Mature_content_in_PG_region"
- value="60" />
- <combo_box.item
- label="Indecency &gt; Inappropriate content or conduct in a Moderate region"
- name="Indecency__Inappropriate_content_in_Mature_region"
- value="69" />
- <combo_box.item
- label="Intellectual property infringement &gt; Content Removal"
- name="Intellectual_property_infringement_Content_Removal"
- value="66" />
- <combo_box.item
- label="Intellectual property infringement &gt; CopyBot or Permissions Exploit"
- name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit"
- value="37" />
+ value="60" />
<combo_box.item
label="Intolerance"
name="Intolerance"
- value="61" />
- <combo_box.item
- label="Land &gt; Abuse of sandbox resources"
- name="Land__Abuse_of_sandbox_resources"
- value="62" />
+ value="61" />
<combo_box.item
- label="Land &gt; Encroachment &gt; Objects/textures"
+ label="Land &gt; Encroachment &gt; Objects or textures"
name="Land__Encroachment__Objects_textures"
- value="63" />
+ value="63" />
<combo_box.item
- label="Land &gt; Encroachment &gt; Particles"
- name="Land__Encroachment__Particles"
- value="64" />
- <combo_box.item
- label="Land &gt; Encroachment &gt; Trees/plants"
- name="Land__Encroachment__Trees_plants"
- value="65" />
- <combo_box.item
- label="Wagering/gambling"
+ label="Gaming Policy Violation"
name="Wagering_gambling"
- value="67" />
- <combo_box.item
- label="Other"
- name="Other"
- value="68" />
+ value="67" />
</combo_box>
<text
type="string"
diff --git a/indra/newview/skins/default/xui/en/floater_scene_load_stats.xml b/indra/newview/skins/default/xui/en/floater_scene_load_stats.xml
new file mode 100644
index 0000000000..71ff961c59
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_scene_load_stats.xml
@@ -0,0 +1,446 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater legacy_header_height="18"
+ can_resize="true"
+ height="400"
+ layout="topleft"
+ name="Scene Load Statistics"
+ save_rect="true"
+ save_visibility="true"
+ title="SCENE LOAD STATISTICS"
+ width="260">
+ <button follows="top|left"
+ top="20"
+ bottom="60"
+ left="10"
+ width="100"
+ label="Pause"
+ name="playpause"/>
+ <scroll_container follows="top|left|bottom|right"
+ bottom="400"
+ layout="topleft"
+ left="0"
+ name="statistics_scroll"
+ reserve_scroll_corner="true"
+ top="60"
+ width="260">
+ <container_view follows="top|left|bottom|right"
+ height="378"
+ layout="topleft"
+ left="2"
+ name="statistics_view"
+ top="20"
+ width="245" >
+<!--Basic Section-->
+ <stat_view name="basic"
+ label="Basic"
+ show_label="true"
+ setting="OpenDebugStatBasic">
+ <stat_bar name="frame difference"
+ label="Frame Pixel Difference"
+ orientation="horizontal"
+ unit_label="%"
+ stat="FramePixelDifference"
+ bar_max="100"
+ tick_spacing="10"
+ unit_scale="100"
+ precision="0"/>
+ <stat_bar name="bandwidth"
+ label="UDP Data Received"
+ orientation="horizontal"
+ unit_label="kbps"
+ stat="activemessagedatareceived"
+ bar_max="5000"
+ tick_spacing="500"
+ precision="0"/>
+ <stat_bar name="packet_loss"
+ label="Packet Loss"
+ orientation="horizontal"
+ unit_label=" %"
+ stat="packetslostpercentstat"
+ bar_max="5"
+ tick_spacing="0.5"
+ precision="3"
+ show_bar="false"
+ show_mean="true"/>
+ </stat_view>
+<!--Advanced Section-->
+ <stat_view name="advanced"
+ label="Advanced"
+ show_label="true"
+ setting="OpenDebugStatAdvanced">
+ <stat_view name="render"
+ label="Render"
+ show_label="true"
+ setting="OpenDebugStatRender">
+ <stat_bar name="objs"
+ label="Total Objects"
+ orientation="horizontal"
+ unit_label=""
+ stat="numobjectsstat"
+ bar_max="50000"
+ tick_spacing="5000"
+ precision="0"
+ show_bar="false"/>
+ <stat_bar name="newobjs"
+ label="New Objects"
+ orientation="horizontal"
+ unit_label="/sec"
+ stat="numnewobjectsstat"
+ bar_max="2000"
+ tick_spacing="200"
+ show_bar="false"/>
+ <stat_bar name="object_cache_hits"
+ label="Object Cache Hit Rate"
+ orientation="horizontal"
+ stat="object_cache_hits"
+ bar_max="100"
+ unit_label="%"
+ tick_spacing="20"
+ show_history="true"
+ show_bar="false"/>
+ </stat_view>
+<!--Texture Stats-->
+ <stat_view name="texture"
+ label="Texture"
+ show_label="true">
+ <stat_bar name="texture_cache_hits"
+ label="Cache Hit Rate"
+ orientation="horizontal"
+ stat="texture_cache_hits"
+ bar_max="100.f"
+ unit_label="%"
+ tick_spacing="20"
+ show_history="true"
+ show_bar="false"/>
+ <stat_bar name="texture_cache_read_latency"
+ label="Cache Read Latency"
+ orientation="horizontal"
+ unit_label="msec"
+ stat="texture_cache_read_latency"
+ bar_max="1000.f"
+ tick_spacing="100"
+ show_history="true"
+ show_bar="false"/>
+ <stat_bar name="numimagesstat"
+ label="Count"
+ orientation="horizontal"
+ stat="numimagesstat"
+ bar_max="8000.f"
+ tick_spacing="2000.f"
+ show_bar="false"/>
+ <stat_bar name="numrawimagesstat"
+ label="Raw Count"
+ orientation="horizontal"
+ stat="numrawimagesstat"
+ bar_max="8000.f"
+ tick_spacing="2000.f"
+ show_bar="false"/>
+ </stat_view>
+<!--Network Stats-->
+ <stat_view name="network"
+ label="Network"
+ show_label="true"
+ setting="OpenDebugStatNet">
+ <stat_bar name="packetsinstat"
+ label="Packets In"
+ orientation="horizontal"
+ stat="packetsinstat"
+ unit_label="/sec"
+ bar_max="1024.f"
+ tick_spacing="128.f"
+ precision="1"
+ show_bar="false"/>
+ <stat_bar name="packetsoutstat"
+ label="Packets Out"
+ orientation="horizontal"
+ stat="packetsoutstat"
+ unit_label="/sec"
+ bar_max="1024.f"
+ tick_spacing="128.f"
+ precision="1"
+ show_bar="false"/>
+ <stat_bar name="objectdatareceived"
+ label="Objects"
+ orientation="horizontal"
+ stat="objectdatareceived"
+ unit_label="kbps"
+ bar_max="1024.f"
+ tick_spacing="128.f"
+ precision="1"
+ show_bar="false"/>
+ <stat_bar name="texturedatareceived"
+ label="Texture"
+ orientation="horizontal"
+ stat="texturedatareceived"
+ unit_label="kbps"
+ bar_max="1024.f"
+ tick_spacing="128.f"
+ precision="1"
+ show_bar="false"/>
+ <stat_bar name="assetudpdatareceived"
+ label="Asset"
+ orientation="horizontal"
+ stat="assetudpdatareceived"
+ unit_label="kbps"
+ bar_max="1024.f"
+ tick_spacing="128.f"
+ precision="1"
+ show_bar="false"/>
+ <stat_bar name="layersdatareceived"
+ label="Layers"
+ orientation="horizontal"
+ stat="layersdatareceived"
+ unit_label="kbps"
+ bar_max="1024.f"
+ tick_spacing="128.f"
+ precision="1"
+ show_bar="false"/>
+ <stat_bar name="messagedatain"
+ label="Actual In"
+ orientation="horizontal"
+ stat="messagedatain"
+ unit_label="kbps"
+ bar_max="1024.f"
+ tick_spacing="128.f"
+ precision="1"
+ show_bar="false"/>
+ <stat_bar name="messagedataout"
+ label="Actual Out"
+ orientation="horizontal"
+ stat="messagedataout"
+ unit_label="kbps"
+ bar_max="1024.f"
+ tick_spacing="128.f"
+ precision="1"
+ show_bar="false"/>
+ <stat_bar name="vfspendingoperations"
+ label="VFS Pending Operations"
+ orientation="horizontal"
+ stat="vfspendingoperations"
+ unit_label=" Ops."
+ show_bar="false"/>
+ </stat_view>
+ </stat_view>
+<!--Sim Stats-->
+ <stat_view name="sim"
+ label="Simulator"
+ show_label="true"
+ setting="OpenDebugStatSim">
+ <stat_bar name="simobjects"
+ label="Objects"
+ orientation="horizontal"
+ stat="simobjects"
+ precision="0"
+ bar_max="30000.f"
+ tick_spacing="5000.f"
+ show_bar="false"
+ show_mean="false"/>
+ <stat_bar name="simactiveobjects"
+ label="Active Objects"
+ orientation="horizontal"
+ stat="simactiveobjects"
+ precision="0"
+ bar_max="5000.f"
+ tick_spacing="750.f"
+ show_bar="false"
+ show_mean="false"/>
+ <stat_bar name="simactivescripts"
+ label="Active Scripts"
+ orientation="horizontal"
+ stat="simactivescripts"
+ precision="0"
+ bar_max="15000.f"
+ tick_spacing="1875.f"
+ show_bar="false"
+ show_mean="false"/>
+ <stat_bar name="siminpps"
+ label="Packets In"
+ orientation="horizontal"
+ stat="siminpps"
+ unit_label="pps"
+ precision="0"
+ bar_max="2000.f"
+ tick_spacing="250.f"
+ show_bar="false"
+ show_mean="false"/>
+ <stat_bar name="simoutpps"
+ label="Packets Out"
+ orientation="horizontal"
+ stat="simoutpps"
+ unit_label="pps"
+ precision="0"
+ bar_max="2000.f"
+ tick_spacing="250.f"
+ show_bar="false"
+ show_mean="false"/>
+ <stat_bar name="simpendingdownloads"
+ label="Pending Downloads"
+ orientation="horizontal"
+ stat="simpendingdownloads"
+ precision="0"
+ bar_max="800.f"
+ tick_spacing="100.f"
+ show_bar="false"
+ show_mean="false"/>
+ <stat_bar name="simpendinguploads"
+ label="Pending Uploads"
+ orientation="horizontal"
+ stat="simpendinguploads"
+ precision="0"
+ bar_max="100.f"
+ tick_spacing="25.f"
+ show_bar="false"
+ show_mean="false"/>
+ <stat_bar name="simtotalunackedbytes"
+ label="Total Unacked Bytes"
+ orientation="horizontal"
+ stat="simtotalunackedbytes"
+ unit_label="kb"
+ precision="1"
+ bar_max="100000.f"
+ tick_spacing="25000.f"
+ show_bar="false"
+ show_mean="false"/>
+ <stat_view name="simperf"
+ label="Time (ms)"
+ show_label="true">
+ <stat_bar name="simframemsec"
+ label="Total Frame Time"
+ orientation="horizontal"
+ stat="simframemsec"
+ unit_label="ms"
+ precision="3"
+ bar_max="40.f"
+ tick_spacing="10.f"
+ show_bar="false"
+ show_mean="false"/>
+ <stat_bar name="simnetmsec"
+ label="Net Time"
+ orientation="horizontal"
+ stat="simnetmsec"
+ unit_label="ms"
+ precision="3"
+ bar_max="40.f"
+ tick_spacing="10.f"
+ show_bar="false"
+ show_mean="false"/>
+ <stat_bar name="simsimphysicsmsec"
+ label="Physics Time"
+ orientation="horizontal"
+ stat="simsimphysicsmsec"
+ unit_label="ms"
+ precision="3"
+ bar_max="40.f"
+ tick_spacing="10.f"
+ show_bar="false"
+ show_mean="false"/>
+ <stat_bar name="simsimothermsec"
+ label="Simulation Time"
+ orientation="horizontal"
+ stat="simsimothermsec"
+ unit_label="ms"
+ precision="3"
+ bar_max="40.f"
+ tick_spacing="10.f"
+ show_bar="false"
+ show_mean="false"/>
+ <stat_bar name="simagentmsec"
+ label="Agent Time"
+ orientation="horizontal"
+ stat="simagentmsec"
+ unit_label="ms"
+ precision="3"
+ bar_max="40.f"
+ tick_spacing="10.f"
+ show_bar="false"
+ show_mean="false"/>
+ <stat_bar name="simimagesmsec"
+ label="Images Time"
+ orientation="horizontal"
+ stat="simimagesmsec"
+ unit_label="ms"
+ precision="3"
+ bar_max="40.f"
+ tick_spacing="10.f"
+ show_bar="false"
+ show_mean="false"/>
+ <stat_bar name="simscriptmsec"
+ label="Script Time"
+ orientation="horizontal"
+ stat="simscriptmsec"
+ unit_label="ms"
+ precision="3"
+ bar_max="40.f"
+ tick_spacing="10.f"
+ show_bar="false"
+ show_mean="false"/>
+ <stat_bar name="simsparemsec"
+ label="Spare Time"
+ orientation="horizontal"
+ stat="simsparemsec"
+ unit_label="ms"
+ precision="3"
+ bar_max="40.f"
+ tick_spacing="10.f"
+ show_bar="false"
+ show_mean="false"/>
+<!--2nd level time blocks under 'Details' second-->
+ <stat_view name="timedetails"
+ label="Time Details (ms)"
+ show_label="true">
+ <stat_bar name="simsimphysicsstepmsec"
+ label=" Physics Step"
+ orientation="horizontal"
+ stat="simsimphysicsstepmsec"
+ unit_label="ms"
+ precision="3"
+ bar_max="40.f"
+ tick_spacing="10.f"
+ show_bar="false"
+ show_mean="false"/>
+ <stat_bar name="simsimphysicsshapeupdatemsec"
+ label=" Update Phys Shapes"
+ orientation="horizontal"
+ stat="simsimphysicsshapeupdatemsec"
+ unit_label="ms"
+ precision="3"
+ bar_max="40.f"
+ tick_spacing="10.f"
+ show_bar="false"
+ show_mean="false"/>
+ <stat_bar name="simsimphysicsothermsec"
+ label=" Physics Other"
+ orientation="horizontal"
+ stat="simsimphysicsothermsec"
+ unit_label="ms"
+ precision="3"
+ bar_max="40.f"
+ tick_spacing="10.f"
+ show_bar="false"
+ show_mean="false"/>
+ <stat_bar name="simsleepmsec"
+ label=" Sleep Time"
+ orientation="horizontal"
+ stat="simsleepmsec"
+ unit_label="ms"
+ precision="3"
+ bar_max="40.f"
+ tick_spacing="10.f"
+ show_bar="false"
+ show_mean="false"/>
+ <stat_bar name="simpumpiomsec"
+ label=" Pump IO"
+ orientation="horizontal"
+ stat="simpumpiomsec"
+ unit_label="ms"
+ precision="3"
+ bar_max="40.f"
+ tick_spacing="10.f"
+ show_bar="false"
+ show_mean="false"/>
+ </stat_view>
+ </stat_view>
+ </stat_view>
+ </container_view>
+ </scroll_container>
+</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_script_ed_prefs.xml b/indra/newview/skins/default/xui/en/floater_script_ed_prefs.xml
new file mode 100644
index 0000000000..8e4bcb3eb0
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_script_ed_prefs.xml
@@ -0,0 +1,359 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+ legacy_header_height="18"
+ can_resize="false"
+ height="354"
+ layout="topleft"
+ name="floater_script_colors"
+ help_topic="script_colors"
+ save_rect="true"
+ title="SCRIPT COLORS"
+ width="320">
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="12"
+ name="color_pickers_label"
+ top="30"
+ width="200">
+ Choose desired colors:
+ </text>
+
+ <color_swatch
+ can_apply_immediately="true"
+ follows="left|top"
+ height="24"
+ label_height="0"
+ layout="topleft"
+ left="15"
+ name="text"
+ top="45"
+ width="44" >
+ <color_swatch.init_callback
+ function="ScriptPref.getUIColor"
+ parameter="ScriptText" />
+ <color_swatch.commit_callback
+ function="ScriptPref.applyUIColor"
+ parameter="ScriptText" />
+ </color_swatch>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="10"
+ layout="topleft"
+ left_pad="5"
+ mouse_opaque="false"
+ name="text_label"
+ top_delta="5"
+ width="100">
+ Text
+ </text>
+ <color_swatch
+ can_apply_immediately="true"
+ follows="left|top"
+ height="24"
+ label_height="0"
+ layout="topleft"
+ left="15"
+ name="cursor"
+ top_pad="10"
+ width="44" >
+ <color_swatch.init_callback
+ function="ScriptPref.getUIColor"
+ parameter="ScriptCursorColor" />
+ <color_swatch.commit_callback
+ function="ScriptPref.applyUIColor"
+ parameter="ScriptCursorColor" />
+ </color_swatch>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="10"
+ layout="topleft"
+ left_pad="5"
+ mouse_opaque="false"
+ name="cursor_label"
+ top_delta="5"
+ width="100">
+ Cursor
+ </text>
+ <color_swatch
+ can_apply_immediately="true"
+ follows="left|top"
+ height="24"
+ label_height="0"
+ layout="topleft"
+ left="15"
+ name="background"
+ top_pad="10"
+ width="44" >
+ <color_swatch.init_callback
+ function="ScriptPref.getUIColor"
+ parameter="ScriptBackground" />
+ <color_swatch.commit_callback
+ function="ScriptPref.applyUIColor"
+ parameter="ScriptBackground" />
+ </color_swatch>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="10"
+ layout="topleft"
+ left_pad="5"
+ mouse_opaque="false"
+ name="background_label"
+ top_delta="5"
+ width="100">
+ Background
+ </text>
+ <color_swatch
+ can_apply_immediately="true"
+ follows="left|top"
+ height="24"
+ label_height="0"
+ layout="topleft"
+ left="15"
+ name="datatype"
+ top_pad="10"
+ width="44" >
+ <color_swatch.init_callback
+ function="ScriptPref.getUIColor"
+ parameter="SyntaxLslDataType" />
+ <color_swatch.commit_callback
+ function="ScriptPref.applyUIColor"
+ parameter="SyntaxLslDataType" />
+ </color_swatch>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="10"
+ layout="topleft"
+ left_pad="5"
+ mouse_opaque="false"
+ name="datatype_label"
+ top_delta="5"
+ width="100">
+ Data Types
+ </text>
+ <color_swatch
+ can_apply_immediately="true"
+ follows="left|top"
+ height="24"
+ label_height="0"
+ layout="topleft"
+ left="15"
+ name="event"
+ top_pad="10"
+ width="44" >
+ <color_swatch.init_callback
+ function="ScriptPref.getUIColor"
+ parameter="SyntaxLslEvent" />
+ <color_swatch.commit_callback
+ function="ScriptPref.applyUIColor"
+ parameter="SyntaxLslEvent" />
+ </color_swatch>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="10"
+ layout="topleft"
+ left_pad="5"
+ mouse_opaque="false"
+ name="event_label"
+ top_delta="5"
+ width="100">
+ Events
+ </text>
+ <color_swatch
+ can_apply_immediately="true"
+ follows="left|top"
+ height="24"
+ label_height="0"
+ layout="topleft"
+ left="190"
+ name="string_literal"
+ top="45"
+ width="44" >
+ <color_swatch.init_callback
+ function="ScriptPref.getUIColor"
+ parameter="SyntaxLslStringLiteral" />
+ <color_swatch.commit_callback
+ function="ScriptPref.applyUIColor"
+ parameter="SyntaxLslStringLiteral" />
+ </color_swatch>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="10"
+ layout="topleft"
+ left_pad="5"
+ mouse_opaque="false"
+ name="string_literal_label"
+ top_delta="5"
+ width="100">
+ String Literals
+ </text>
+ <color_swatch
+ can_apply_immediately="true"
+ follows="left|top"
+ height="24"
+ label_height="0"
+ layout="topleft"
+ left="190"
+ name="constant"
+ top_pad="10"
+ width="44" >
+ <color_swatch.init_callback
+ function="ScriptPref.getUIColor"
+ parameter="SyntaxLslConstant" />
+ <color_swatch.commit_callback
+ function="ScriptPref.applyUIColor"
+ parameter="SyntaxLslConstant" />
+ </color_swatch>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="10"
+ layout="topleft"
+ left_pad="5"
+ mouse_opaque="false"
+ name="constant_label"
+ top_delta="5"
+ width="100">
+ Constant
+ </text>
+ <color_swatch
+ can_apply_immediately="true"
+ follows="left|top"
+ height="24"
+ label_height="0"
+ layout="topleft"
+ left="190"
+ name="flow_control"
+ top_pad="10"
+ width="44" >
+ <color_swatch.init_callback
+ function="ScriptPref.getUIColor"
+ parameter="SyntaxLslControlFlow" />
+ <color_swatch.commit_callback
+ function="ScriptPref.applyUIColor"
+ parameter="SyntaxLslControlFlow" />
+ </color_swatch>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="10"
+ layout="topleft"
+ left_pad="5"
+ mouse_opaque="false"
+ name="flow_control_label"
+ top_delta="5"
+ width="100">
+ Flow Control
+ </text>
+ <color_swatch
+ can_apply_immediately="true"
+ follows="left|top"
+ height="24"
+ label_height="0"
+ layout="topleft"
+ left="190"
+ name="function"
+ top_pad="10"
+ width="44" >
+ <color_swatch.init_callback
+ function="ScriptPref.getUIColor"
+ parameter="SyntaxLslFunction" />
+ <color_swatch.commit_callback
+ function="ScriptPref.applyUIColor"
+ parameter="SyntaxLslFunction" />
+ </color_swatch>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="10"
+ layout="topleft"
+ left_pad="5"
+ mouse_opaque="false"
+ name="function_label"
+ top_delta="5"
+ width="100">
+ Function
+ </text>
+ <color_swatch
+ can_apply_immediately="true"
+ follows="left|top"
+ height="24"
+ label_height="0"
+ layout="topleft"
+ left="190"
+ name="comment"
+ top_pad="10"
+ width="44" >
+ <color_swatch.init_callback
+ function="ScriptPref.getUIColor"
+ parameter="SyntaxLslComment" />
+ <color_swatch.commit_callback
+ function="ScriptPref.applyUIColor"
+ parameter="SyntaxLslComment" />
+ </color_swatch>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="10"
+ layout="topleft"
+ left_pad="5"
+ mouse_opaque="false"
+ name="comment_label"
+ top_delta="5"
+ width="100">
+ Comment
+ </text>
+
+ <script_editor
+ left="8"
+ right="-8"
+ top="176"
+ bottom="-8"
+ type="string"
+ length="1"
+ follows="left|top|right|bottom"
+ font="Monospace"
+ height="100"
+ ignore_tab="false"
+ layout="topleft"
+ max_length="300"
+ name="Script Preview"
+ text_color="ScriptText"
+ default_color="ScriptText"
+ bg_writeable_color="ScriptBackground"
+ bg_focus_color="ScriptBackground"
+ text_readonly_color="ScriptText"
+ bg_readonly_color="ScriptBackground"
+ bg_selected_color="ScriptSelectedColor"
+ cursor_color="ScriptCursorColor"
+ enable_tooltip_paste="true"
+ word_wrap="true">
+/* A sample script */
+default
+{
+ state_entry()
+ {
+ // Comment
+ string greeting = "Hello";
+ llSay(PUBLIC_CHANNEL, greeting);
+ }
+}
+ </script_editor>
+</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml
index 853c209bca..76adaad57c 100755
--- a/indra/newview/skins/default/xui/en/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml
@@ -3,15 +3,18 @@
positioning="cascading"
legacy_header_height="18"
can_minimize="true"
+ can_resize="false"
can_close="true"
- height="500"
+ height="455"
layout="topleft"
name="Snapshot"
+ single_instance="true"
help_topic="snapshot"
save_rect="true"
save_visibility="false"
- title="SNAPSHOT PREVIEW"
- width="470">
+ title="SNAPSHOT"
+ width="624"
+ min_height="455">
<floater.string
name="unknown">
unknown
@@ -57,11 +60,11 @@
Saved to Computer!
</string>
<string
- name="facebook_failed_str">
+ name="facebook_failed_str">
Failed to upload image to your Facebook timeline.
</string>
<string
- name="profile_failed_str">
+ name="profile_failed_str">
Failed to upload image to your Profile Feed.
</string>
<string
@@ -78,35 +81,231 @@
</string>
<button
follows="left|top"
- height="23"
- image_overlay="TabIcon_Close_Off"
+ height="25"
+ image_overlay="Refresh_Off"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ image_overlay_alignment="left"
+ imgoverlay_label_space="5"
+ pad_bottom="0"
+ halign="left"
layout="topleft"
- left="236"
- name="advanced_options_btn"
- tool_tip="Advanced options"
- top="25"
- width="23" />
- <ui_ctrl
- height="160"
- width="250"
- layout="topleft"
- name="thumbnail_placeholder"
- top="50"
- follows="left|top"
- left="10">
+ left="10"
+ label="REFRESH"
+ name="new_snapshot_btn"
+ top_pad="26"
+ width="167" />
+ <button
+ follows="left|top"
+ control_name="AdvanceSnapshot"
+ invisibility_control="AdvanceSnapshot"
+ height="25"
+ is_toggle="true"
+ layout="topleft"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_selected="Toolbar_Middle_Off"
+ image_unselected="Toolbar_Middle_Off"
+ image_overlay="Conv_toolbar_expand"
+ name="retract_btn"
+ left_pad="1"
+ top_delta="0"
+ width="31" />
+ <button
+ follows="left|top"
+ control_name="AdvanceSnapshot"
+ visibility_control="AdvanceSnapshot"
+ height="25"
+ is_toggle="true"
+ layout="topleft"
+ image_overlay="Conv_toolbar_collapse"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_selected="Toolbar_Middle_Off"
+ image_unselected="Toolbar_Middle_Off"
+ name="extend_btn"
+ left_delta="0"
+ top_delta="0"
+ width="31" />
+ <panel
+ height="154"
+ layout="topleft"
+ follows="top|left"
+ left="0"
+ name="advanced_options_panel"
+ top_pad="-6"
+ width="210">
+ <view_border
+ bevel_style="in"
+ follows="left|top|right"
+ height="1"
+ left="10"
+ layout="topleft"
+ name="advanced_options_hr"
+ right="-1"
+ top_pad="5"
+ />
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="13"
+ layout="topleft"
+ left="10"
+ name="layer_type_label"
+ top_pad="10"
+ width="100">
+ Capture:
+ </text>
+ <combo_box
+ follows="left|top|right"
+ height="23"
+ label="Image Layers"
+ layout="topleft"
+ left="30"
+ name="layer_types"
+ right="-2">
+ <combo_box.item
+ label="Colors"
+ name="Colors"
+ value="colors" />
+ <combo_box.item
+ label="Depth"
+ name="Depth"
+ value="depth" />
+ </combo_box>
+ <check_box
+ label="Interface"
+ layout="topleft"
+ left="30"
+ height="16"
+ top_pad="8"
+ width="180"
+ name="ui_check" />
+ <check_box
+ label="HUDs"
+ layout="topleft"
+ height="16"
+ left="30"
+ top_pad="1"
+ width="180"
+ name="hud_check" />
+ <check_box
+ label="Freeze frame (fullscreen)"
+ layout="topleft"
+ height="16"
+ left="10"
+ top_pad="1"
+ width="180"
+ name="freeze_frame_check" />
+ <check_box
+ label="Auto-refresh"
+ layout="topleft"
+ height="16"
+ left="10"
+ top_pad="1"
+ width="180"
+ name="auto_snapshot_check" />
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="13"
+ layout="topleft"
+ left="10"
+ name="filter_list_label"
+ top_pad="10"
+ width="50">
+ Filter:
+ </text>
+ <combo_box
+ control_name="PhotoFilters"
+ follows="left|right|top"
+ name="filters_combobox"
+ tool_tip="Image filters"
+ top_delta="-3"
+ left="50"
+ right="-1"
+ height="21"
+ width="135">
+ <combo_box.item
+ label="No Filter"
+ name="NoFilter"
+ value="NoFilter" />
+ </combo_box>
+ <view_border
+ bevel_style="in"
+ follows="left|top|right"
+ height="1"
+ left="10"
+ layout="topleft"
+ name="advanced_options_hr"
+ right="-1"
+ top_pad="7"
+ />
+ </panel>
+ <panel_container
+ follows="left|top"
+ height="230"
+ layout="topleft"
+ left="0"
+ name="panel_container"
+ default_panel_name="panel_snapshot_options"
+ top_pad="10"
+ width="215">
<panel
- background_visible="true"
- bg_alpha_color="0.9 1 0.9 1"
+ class="llpanelsnapshotoptions"
+ filename="panel_snapshot_options.xml"
+ follows="all"
+ layout="topleft"
+ left="0"
+ name="panel_snapshot_options"
+ top="0" />
+ <panel
+ class="llpanelsnapshotprofile"
+ follows="all"
+ layout="topleft"
+ name="panel_snapshot_profile"
+ filename="panel_snapshot_profile.xml" />
+ <panel
+ class="llpanelsnapshotpostcard"
+ follows="all"
+ layout="topleft"
+ name="panel_snapshot_postcard"
+ filename="panel_snapshot_postcard.xml" />
+ <panel
+ class="llpanelsnapshotinventory"
+ follows="all"
+ layout="topleft"
+ name="panel_snapshot_inventory"
+ filename="panel_snapshot_inventory.xml" />
+ <panel
+ class="llpanelsnapshotlocal"
+ follows="all"
+ layout="topleft"
+ name="panel_snapshot_local"
+ filename="panel_snapshot_local.xml" />
+ </panel_container>
+ <view_border
+ bevel_style="in"
+ follows="left|top"
+ height="1"
+ left="10"
+ layout="topleft"
+ name="status_hr"
+ width="199"
+ top_pad="-16"/>
+ <panel
+ background_visible="false"
follows="left|top"
font="SansSerifLarge"
halign="center"
height="20"
layout="topleft"
- left="0"
+ left="10"
length="1"
name="succeeded_panel"
- right="-1"
- top="0"
+ width="198"
+ top_pad="1"
type="string"
visible="false">
<text
@@ -119,7 +318,7 @@
length="1"
name="succeeded_lbl"
right="-1"
- text_color="0.2 0.5 0.2 1"
+ text_color="0.2 0.85 0.2 1"
top="4"
translate="false"
type="string">
@@ -127,18 +326,17 @@
</text>
</panel>
<panel
- background_visible="true"
- bg_alpha_color="1 0.9 0.9 1"
+ background_visible="false"
follows="left|top"
font="SansSerifLarge"
halign="center"
height="20"
layout="topleft"
- left_delta="0"
+ left="10"
length="1"
name="failed_panel"
- right="-1"
- top="0"
+ width="198"
+ top_delta="0"
type="string"
visible="false">
<text
@@ -151,7 +349,7 @@
length="1"
name="failed_lbl"
right="-1"
- text_color="0.5 0.2 0.2 1"
+ text_color="0.95 0.4 0.4 1"
top="4"
translate="false"
type="string">
@@ -160,51 +358,39 @@
</panel>
<loading_indicator
follows="left|top"
- height="48"
+ height="24"
layout="topleft"
name="working_indicator"
- left="101"
- top="46"
+ left="10"
+ top_delta="0"
visible="false"
- width="48" />
+ width="24" />
<text
- follows="left|top|right"
+ follows="left|top"
font="SansSerifBold"
height="14"
layout="topleft"
- left="5"
+ left_pad="3"
length="1"
- halign="center"
+ halign="left"
name="working_lbl"
- right="-5"
- top="98"
+ top_delta="5"
translate="false"
type="string"
visible="false"
- width="130">
+ width="162">
Working
</text>
- <button
- follows="left|top"
- height="22"
- image_overlay="Refresh_Off"
- layout="topleft"
- left="20"
- name="new_snapshot_btn"
- bottom="-20"
- visible="false"
- width="22" />
<text
follows="left|top"
font="SansSerifBold"
halign="left"
height="18"
layout="topleft"
- left_pad="10"
+ left="10"
length="1"
name="refresh_lbl"
- right="-5"
- text_color="red"
+ text_color="0.95 0.4 0.4 1"
top_delta="0"
translate="false"
type="string"
@@ -212,37 +398,44 @@
width="130">
Refresh to save.
</text>
- </ui_ctrl>
+ <ui_ctrl
+ layout="topleft"
+ name="thumbnail_placeholder"
+ top="23"
+ left="215"
+ width="400"
+ height="400"
+ follows="top|left"/>
<view_border
bevel_style="in"
height="21"
- width="250"
layout="topleft"
name="img_info_border"
- top_pad="3"
- follows="left|top"
- left_delta="0"
- />
+ top_pad="0"
+ right="-10"
+ follows="left|top|right"
+ left_delta="0"/>
<text
type="string"
font="SansSerifSmall"
length="1"
- follows="left|top"
+ follows="left|top|right"
height="14"
layout="topleft"
- left_delta="5"
+ left="220"
+ right="-20"
halign="left"
name="image_res_text"
top_delta="5"
- width="100">
- [WIDTH] x [HEIGHT] px
+ width="200">
+ [WIDTH]px (width) x [HEIGHT]px (height)
</text>
<text
- follows="left|top"
+ follows="right|top"
font="SansSerifSmall"
height="14"
layout="topleft"
- left="200"
+ left="-65"
length="1"
halign="right"
name="file_size_label"
@@ -251,135 +444,4 @@
width="50">
[SIZE] KB
</text>
- <panel_container
- follows="left|top"
- height="260"
- layout="topleft"
- left="0"
- name="panel_container"
- default_panel_name="panel_snapshot_options"
- top_pad="10"
- width="270">
- <panel
- class="llpanelsnapshotoptions"
- filename="panel_snapshot_options.xml"
- follows="all"
- layout="topleft"
- left="0"
- name="panel_snapshot_options"
- top="0" />
- <panel
- class="llpanelsnapshotprofile"
- follows="all"
- layout="topleft"
- name="panel_snapshot_profile"
- filename="panel_snapshot_profile.xml" />
- <panel
- class="llpanelsnapshotpostcard"
- follows="all"
- layout="topleft"
- name="panel_snapshot_postcard"
- filename="panel_snapshot_postcard.xml" />
- <panel
- class="llpanelsnapshotinventory"
- follows="all"
- layout="topleft"
- name="panel_snapshot_inventory"
- filename="panel_snapshot_inventory.xml" />
- <panel
- class="llpanelsnapshotlocal"
- follows="all"
- layout="topleft"
- name="panel_snapshot_local"
- filename="panel_snapshot_local.xml" />
- </panel_container>
- <panel
- height="295"
- layout="topleft"
- left="270"
- name="advanced_options_panel"
- top="20"
- width="200">
- <text
- type="string"
- font="SansSerifSmall"
- length="1"
- follows="left|top"
- height="14"
- layout="topleft"
- left="10"
- halign="left"
- name="advanced_options_label"
- right="-10"
- top="10">
- ADVANCED OPTIONS
- </text>
- <view_border
- bevel_style="in"
- follows="left|top|right"
- height="1"
- left="10"
- layout="topleft"
- name="advanced_options_hr"
- right="-10"
- top_pad="5"
- />
- <text
- type="string"
- length="1"
- follows="left|top"
- height="13"
- layout="topleft"
- left="10"
- name="layer_type_label"
- top_pad="10"
- width="50">
- Capture:
- </text>
- <combo_box
- follows="left|top|right"
- height="23"
- label="Image Layers"
- layout="topleft"
- left="30"
- name="layer_types"
- right="-10">
- <combo_box.item
- label="Colors"
- name="Colors"
- value="colors" />
- <combo_box.item
- label="Depth"
- name="Depth"
- value="depth" />
- </combo_box>
- <check_box
- label="Interface"
- layout="topleft"
- left="30"
- top_pad="10"
- width="180"
- name="ui_check" />
- <check_box
- label="HUDs"
- layout="topleft"
- left="30"
- top_pad="10"
- width="180"
- name="hud_check" />
- <check_box
- label="Freeze frame (fullscreen)"
- layout="topleft"
- left="10"
- top_pad="8"
- width="180"
- name="freeze_frame_check" />
- <check_box
- label="Auto-refresh"
- layout="topleft"
- left="10"
- top_pad="8"
- width="180"
- name="auto_snapshot_check" />
- </panel>
</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_stats.xml b/indra/newview/skins/default/xui/en/floater_stats.xml
index f9eb16d224..fbf262441f 100755
--- a/indra/newview/skins/default/xui/en/floater_stats.xml
+++ b/indra/newview/skins/default/xui/en/floater_stats.xml
@@ -1,927 +1,341 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<floater
- legacy_header_height="18"
- can_resize="true"
- height="400"
- layout="topleft"
- name="Statistics"
- help_topic="statistics"
- save_rect="true"
- save_visibility="true"
- title="STATISTICS"
- width="260">
- <scroll_container
- follows="top|left|bottom|right"
- height="380"
- layout="topleft"
- left="0"
- name="statistics_scroll"
- reserve_scroll_corner="true"
- top="20"
- width="260">
- <container_view
- follows="top|left|bottom|right"
- height="378"
- layout="topleft"
- left="2"
- name="statistics_view"
- top="20"
- width="245" >
- <!--Basic Section-->
- <stat_view
- name="basic"
- label="Basic"
- show_label="true"
- setting="OpenDebugStatBasic">
- <stat_bar
- name="fps"
- label="FPS"
- unit_label="fps"
- stat="fpsstat"
- bar_min="0"
- bar_max="60"
- tick_spacing="6"
- label_spacing="12"
- precision="1"
- show_bar="true"
- show_history="true">
- </stat_bar>
- <stat_bar
- name="bandwidth"
- label="Bandwidth"
- unit_label="kbps"
- stat="kbitstat"
- bar_min="0"
- bar_max="5000"
- tick_spacing="500"
- label_spacing="1000"
- precision="0"
- show_bar="true"
- show_history="false">
- </stat_bar>
- <stat_bar
- name="packet_loss"
- label="Packet Loss"
- unit_label=" %"
- stat="packetslostpercentstat"
- bar_min="0"
- bar_max="5"
- tick_spacing="0.5"
- label_spacing="1"
- precision="3"
- show_per_sec="false"
- show_bar="false"
- show_mean="true">
- </stat_bar>
- <stat_bar
- name="ping"
- label="Ping Sim"
- unit_label="msec"
- stat="simpingstat"
- bar_min="0"
- bar_max="5000"
- tick_spacing="500"
- label_spacing="1000"
- precision="0"
- show_bar="false"
- show_per_sec="false"
- show_mean="false">
- </stat_bar>
- </stat_view>
- <!--Advanced Section-->
- <stat_view
- name="advanced"
- label="Advanced"
- show_label="true"
- setting="OpenDebugStatAdvanced">
- <stat_view
- name="render"
- label="Render"
- show_label="true"
- setting="OpenDebugStatRender">
- <stat_bar
- name="ktrisframe"
- label="KTris Drawn per Frame"
- unit_label="/fr"
- stat="trianglesdrawnstat"
- bar_min="0"
- bar_max="10000"
- tick_spacing="1000"
- label_spacing="2000"
- precision="0"
- show_per_sec="false"
- show_bar="false">
- </stat_bar>
- <stat_bar
- name="ktrissec"
- label="KTris Drawn per Sec"
- unit_label="/sec"
- stat="trianglesdrawnstat"
- bar_min="0"
- bar_max="200000"
- tick_spacing="25000"
- label_spacing="50000"
- precision="0"
- show_bar="false">
- </stat_bar>
- <stat_bar
- name="objs"
- label="Total Objects"
- unit_label=""
- stat="numobjectsstat"
- bar_min="0"
- bar_max="50000"
- tick_spacing="5000"
- label_spacing="10000"
- precision="0"
- show_per_sec="false"
- show_bar="false">
- </stat_bar>
- <stat_bar
- name="newobjs"
- label="New Objects"
- unit_label="/sec"
- stat="numnewobjectsstat"
- bar_min="0"
- bar_max="2000"
- tick_spacing="200"
- label_spacing="400"
- show_per_sec="true"
- show_bar="false">
- </stat_bar>
- <stat_bar
- name="object_cache_hits"
- label="Object Cache Hit Rate"
- stat="object_cache_hits"
- bar_min="0"
- bar_max="100"
- unit_label="%"
- tick_spacing="20"
- label_spacing="20"
- show_history="true"
- show_per_sec="false"
- show_bar="false">
- </stat_bar>
- </stat_view>
- <!--Texture Stats-->
- <stat_view
- name="texture"
- label="Texture"
- show_label="true">
- <stat_bar
- name="texture_cache_hits"
- label="Cache Hit Rate"
- stat="texture_cache_hits"
- bar_min="0.f"
- bar_max="100.f"
- unit_label="%"
- tick_spacing="20"
- label_spacing="20"
- show_history="true"
- show_per_sec="false"
- show_bar="false">
- </stat_bar>
- <stat_bar
- name="texture_cache_read_latency"
- label="Cache Read Latency"
- unit_label="msec"
- stat="texture_cache_read_latency"
- bar_min="0.f"
- bar_max="1000.f"
- tick_spacing="100"
- label_spacing="200"
- show_history="true"
- show_per_sec="false"
- show_bar="false">
- </stat_bar>
- <stat_bar
- name="numimagesstat"
- label="Count"
- stat="numimagesstat"
- bar_min="0.f"
- bar_max="8000.f"
- tick_spacing="2000.f"
- label_spacing="4000.f"
- show_per_sec="false"
- show_bar="false">
- </stat_bar>
-
- <stat_bar
- name="numrawimagesstat"
- label="Raw Count"
- stat="numrawimagesstat"
- bar_min="0.f"
- bar_max="8000.f"
- tick_spacing="2000.f"
- label_spacing="4000.f"
- show_per_sec="false"
- show_bar="false">
- </stat_bar>
-
- <stat_bar
- name="gltexmemstat"
- label="GL Mem"
- stat="gltexmemstat"
- bar_min="0.f"
- bar_max="400.f"
- tick_spacing="100.f"
- label_spacing="200.f"
- precision="1"
- show_per_sec="false"
- show_bar="false">
- </stat_bar>
-
- <stat_bar
- name="formattedmemstat"
- label="Formatted Mem"
- stat="formattedmemstat"
- bar_min="0.f"
- bar_max="400.f"
- tick_spacing="100.f"
- label_spacing="200.f"
- precision="1"
- show_per_sec="false"
- show_bar="false">
- </stat_bar>
-
- <stat_bar
- name="rawmemstat"
- label="Raw Mem"
- stat="rawmemstat"
- bar_min="0.f"
- bar_max="400.f"
- tick_spacing="100.f"
- label_spacing="200.f"
- precision="1"
- show_per_sec="false"
- show_bar="false">
- </stat_bar>
-
- <stat_bar
- name="glboundmemstat"
- label="Bound Mem"
- stat="glboundmemstat"
- bar_min="0.f"
- bar_max="400.f"
- tick_spacing="100.f"
- label_spacing="200.f"
- precision="1"
- show_per_sec="false"
- show_bar="false">
- </stat_bar>
- </stat_view>
- <!--Network Stats-->
- <stat_view
- name="network"
- label="Network"
- show_label="true"
- setting="OpenDebugStatNet">
- <stat_bar
- name="packetsinstat"
- label="Packets In"
- stat="packetsinstat"
- unit_label="/sec"
- bar_min="0.f"
- bar_max="1024.f"
- tick_spacing="128.f"
- label_spacing="256.f"
- precision="1"
- show_bar="false">
- </stat_bar>
-
- <stat_bar
- name="packetsoutstat"
- label="Packets Out"
- stat="packetsoutstat"
- unit_label="/sec"
- bar_min="0.f"
- bar_max="1024.f"
- tick_spacing="128.f"
- label_spacing="256.f"
- precision="1"
- show_bar="false" >
- </stat_bar>
-
- <stat_bar
- name="objectkbitstat"
- label="Objects"
- stat="objectkbitstat"
- unit_label="kbps"
- bar_min="0.f"
- bar_max="1024.f"
- tick_spacing="128.f"
- label_spacing="256.f"
- precision="1"
- show_bar="false" >
- </stat_bar>
-
- <stat_bar
- name="texturekbitstat"
- label="Texture"
- stat="texturekbitstat"
- unit_label="kbps"
- bar_min="0.f"
- bar_max="1024.f"
- tick_spacing="128.f"
- label_spacing="256.f"
- precision="1"
- show_bar="false" >
- </stat_bar>
-
- <stat_bar
- name="assetkbitstat"
- label="Asset"
- stat="assetkbitstat"
- unit_label="kbps"
- bar_min="0.f"
- bar_max="1024.f"
- tick_spacing="128.f"
- label_spacing="256.f"
- precision="1"
- show_bar="false" >
- </stat_bar>
-
- <stat_bar
- name="layerskbitstat"
- label="Layers"
- stat="layerskbitstat"
- unit_label="kbps"
- bar_min="0.f"
- bar_max="1024.f"
- tick_spacing="128.f"
- label_spacing="256.f"
- precision="1"
- show_bar="false" >
- </stat_bar>
-
- <stat_bar
- name="actualinkbitstat"
- label="Actual In"
- stat="actualinkbitstat"
- unit_label="kbps"
- bar_min="0.f"
- bar_max="1024.f"
- tick_spacing="128.f"
- label_spacing="256.f"
- precision="1"
- show_bar="false"
- show_history="false" >
- </stat_bar>
-
- <stat_bar
- name="actualoutkbitstat"
- label="Actual Out"
- stat="actualoutkbitstat"
- unit_label="kbps"
- bar_min="0.f"
- bar_max="1024.f"
- tick_spacing="128.f"
- label_spacing="256.f"
- precision="1"
- show_bar="false"
- show_history="false">
- </stat_bar>
-
- <stat_bar
- name="vfspendingoperations"
- label="VFS Pending Operations"
- stat="vfspendingoperations"
- unit_label=" Ops."
- show_per_sec="false"
- show_bar="false" >
- </stat_bar>
- </stat_view>
- </stat_view>
- <!--Sim Stats-->
- <stat_view
- name="sim"
- label="Simulator"
- show_label="true"
- setting="OpenDebugStatSim">
- <stat_bar
- name="simtimedilation"
- label="Time Dilation"
- stat="simtimedilation"
- precision="3"
- bar_min="0.f"
- bar_max="1.f"
- tick_spacing="0.16666f"
- label_spacing="0.33333f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_bar
- name="simfps"
- label="Sim FPS"
- stat="simfps"
- precision="1"
- bar_min="0.f"
- bar_max="45.f"
- tick_spacing="7.5f"
- label_spacing="15.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_bar
- name="simphysicsfps"
- label="Physics FPS"
- stat="simphysicsfps"
- precision="1"
- bar_min="0.f"
- bar_max="45.f"
- tick_spacing="7.5.f"
- label_spacing="15.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_view
- name="physicsdetail"
- label="Physics Details"
- show_label="true">
- <stat_bar
- name="physicspinnedtasks"
- label="Pinned Objects"
- stat="physicspinnedtasks"
- precision="0"
- bar_min="0.f"
- bar_max="500.f"
- tick_spacing="50.f"
- label_spacing="100.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_bar
- name="physicslodtasks"
- label="Low LOD Objects"
- stat="physicslodtasks"
- precision="0"
- bar_min="0.f"
- bar_max="500.f"
- tick_spacing="50.f"
- label_spacing="100.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_bar
- name="physicsmemoryallocated"
- label="Memory Allocated"
- stat="physicsmemoryallocated"
- unit_label="MB"
- precision="1"
- bar_min="0.f"
- bar_max="1024.f"
- tick_spacing="128.f"
- label_spacing="256.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
- </stat_view>
-
- <stat_bar
- name="simagentups"
- label="Agent Updates/Sec"
- stat="simagentups"
- precision="1"
- bar_min="0.f"
- bar_max="100.f"
- tick_spacing="25.f"
- label_spacing="50.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_bar
- name="simmainagents"
- label="Main Agents"
- stat="simmainagents"
- precision="0"
- bar_min="0.f"
- bar_max="80.f"
- tick_spacing="10.f"
- label_spacing="40.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_bar
- name="simchildagents"
- label="Child Agents"
- stat="simchildagents"
- precision="0"
- bar_min="0.f"
- bar_max="40.f"
- tick_spacing="5.f"
- label_spacing="10.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_bar
- name="simobjects"
- label="Objects"
- stat="simobjects"
- precision="0"
- bar_min="0.f"
- bar_max="30000.f"
- tick_spacing="5000.f"
- label_spacing="10000.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_bar
- name="simactiveobjects"
- label="Active Objects"
- stat="simactiveobjects"
- precision="0"
- bar_min="0.f"
- bar_max="5000.f"
- tick_spacing="750.f"
- label_spacing="1250.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_bar
- name="simactivescripts"
- label="Active Scripts"
- stat="simactivescripts"
- precision="0"
- bar_min="0.f"
- bar_max="15000.f"
- tick_spacing="1875.f"
- label_spacing="3750.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
- <stat_bar
- name="simpctscriptsrun"
- label="Scripts Run"
- unit_label=" %"
- stat="simpctscriptsrun"
- bar_min="0"
- bar_max="100"
- tick_spacing="10"
- label_spacing="20"
- precision="3"
- show_per_sec="false"
- show_bar="false"
- show_mean="true">
- </stat_bar>
-
- <stat_bar
- name="simscripteps"
- label="Script Events"
- stat="simscripteps"
- unit_label="eps"
- precision="0"
- bar_min="0.f"
- bar_max="5000.f"
- tick_spacing="750.f"
- label_spacing="1250.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_view
- name="simpathfinding"
- label="Pathfinding"
- show_label="true">
- <stat_bar
- name="simsimaistepmsec"
- label=" AI Step Time"
- stat="simsimaistepmsec"
- unit_label="ms"
- precision="3"
- bar_min="0.f"
- bar_max="40.f"
- tick_spacing="10.f"
- label_spacing="20.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
- <stat_bar
- name="simsimskippedsilhouettesteps"
- label=" Skipped Silhouette Steps"
- stat="simsimskippedsilhouettesteps"
- unit_label="/sec"
- precision="0"
- bar_min="0"
- bar_max="45"
- tick_spacing="4"
- label_spacing="8"
- show_per_sec="false"
- show_bar="false">
- </stat_bar>
- <stat_bar
- name="simsimpctsteppedcharacters"
- label=" Characters Updated"
- unit_label=" %"
- stat="simsimpctsteppedcharacters"
- bar_min="0"
- bar_max="100"
- tick_spacing="10"
- label_spacing="20"
- precision="1"
- show_per_sec="false"
- show_bar="false"
- show_mean="true">
- </stat_bar>
+<floater legacy_header_height="18"
+ can_resize="true"
+ height="400"
+ layout="topleft"
+ name="Statistics"
+ help_topic="statistics"
+ save_rect="true"
+ save_visibility="true"
+ title="STATISTICS"
+ width="260">
+ <scroll_container follows="all"
+ height="380"
+ layout="topleft"
+ left="0"
+ name="statistics_scroll"
+ reserve_scroll_corner="true"
+ top="20"
+ width="260">
+ <container_view follows="all"
+ height="378"
+ layout="topleft"
+ left="2"
+ name="statistics_view"
+ top="20"
+ width="245" >
+ <stat_view name="basic"
+ label="Basic"
+ setting="OpenDebugStatBasic">
+ <stat_bar name="fps"
+ label="FPS"
+ unit_label="fps"
+ stat="FPS"
+ decimal_digits="1"
+ show_bar="true"
+ show_history="true"/>
+ <stat_bar name="bandwidth"
+ label="UDP Data Received"
+ stat="activemessagedatareceived"
+ show_bar="true"/>
+ <stat_bar name="packet_loss"
+ label="Packet Loss"
+ stat="packetslostpercentstat"/>
+ <stat_bar name="ping"
+ label="Ping Sim"
+ stat="simpingstat"/>
+ </stat_view>
+
+ <stat_view name="advanced"
+ label="Advanced"
+ setting="OpenDebugStatAdvanced">
+ <stat_view name="render"
+ label="Render"
+ setting="OpenDebugStatRender">
+ <stat_bar name="ktrisframe"
+ label="KTris per Frame"
+ unit_label="ktris/fr"
+ stat="trianglesdrawnperframestat"/>
+ <stat_bar name="ktrissec"
+ label="KTris per Sec"
+ stat="trianglesdrawnstat"/>
+ <stat_bar name="totalobjs"
+ label="Total Objects"
+ stat="numobjectsstat"/>
+ <stat_bar name="cachedobjs"
+ label="Cached Objects"
+ stat="numactivecachedobjects"/>
+ <stat_bar name="newobjs"
+ label="New Objects"
+ stat="numnewobjectsstat"/>
+ <stat_bar name="object_cache_hits"
+ label="Object Cache Hit Rate"
+ stat="object_cache_hits"
+ show_history="true"/>
+ <stat_bar name="occlusion_queries"
+ label="Occlusion Queries Performed"
+ stat="occlusion_queries"/>
+ <stat_bar name="occluded"
+ label="Objects Occluded"
+ stat="occluded_objects"/>
+ <stat_bar name="unoccluded"
+ label="Object Unoccluded"
+ stat="unoccluded_objects"/>
+ </stat_view>
+ <stat_view name="texture"
+ label="Texture">
+ <stat_bar name="texture_cache_hits"
+ label="Cache Hit Rate"
+ stat="texture_cache_hits"
+ show_history="true"/>
+ <stat_bar name="texture_cache_read_latency"
+ label="Cache Read Latency"
+ stat="texture_cache_read_latency"
+ show_history="true"/>
+ <stat_bar name="numimagesstat"
+ label="Count"
+ stat="numimagesstat"/>
+ <stat_bar name="numrawimagesstat"
+ label="Raw Count"
+ stat="numrawimagesstat"/>
+ <stat_bar name="gltexmemstat"
+ label="GL Mem"
+ stat="gltexmemstat"/>
+ <stat_bar name="formattedmemstat"
+ label="Formatted Mem"
+ stat="formattedmemstat"/>
+ <stat_bar name="rawmemstat"
+ label="Raw Mem"
+ stat="rawmemstat"/>
+ <stat_bar name="glboundmemstat"
+ label="Bound Mem"
+ stat="glboundmemstat"/>
</stat_view>
-
- <stat_bar
- name="siminpps"
- label="Packets In"
- stat="siminpps"
- unit_label="pps"
- precision="0"
- bar_min="0.f"
- bar_max="2000.f"
- tick_spacing="250.f"
- label_spacing="1000.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_bar
- name="simoutpps"
- label="Packets Out"
- stat="simoutpps"
- unit_label="pps"
- precision="0"
- bar_min="0.f"
- bar_max="2000.f"
- tick_spacing="250.f"
- label_spacing="1000.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_bar
- name="simpendingdownloads"
- label="Pending Downloads"
- stat="simpendingdownloads"
- precision="0"
- bar_min="0.f"
- bar_max="800.f"
- tick_spacing="100.f"
- label_spacing="200.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_bar
- name="simpendinguploads"
- label="Pending Uploads"
- stat="simpendinguploads"
- precision="0"
- bar_min="0.f"
- bar_max="100.f"
- tick_spacing="25.f"
- label_spacing="50.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_bar
- name="simtotalunackedbytes"
- label="Total Unacked Bytes"
- stat="simtotalunackedbytes"
- unit_label="kb"
- precision="1"
- bar_min="0.f"
- bar_max="100000.f"
- tick_spacing="25000.f"
- label_spacing="50000.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_view
- name="simperf"
- label="Time (ms)"
- show_label="true">
- <stat_bar
- name="simframemsec"
- label="Total Frame Time"
- stat="simframemsec"
- unit_label="ms"
- precision="3"
- bar_min="0.f"
- bar_max="40.f"
- tick_spacing="10.f"
- label_spacing="20.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_bar
- name="simnetmsec"
- label="Net Time"
- stat="simnetmsec"
- unit_label="ms"
- precision="3"
- bar_min="0.f"
- bar_max="40.f"
- tick_spacing="10.f"
- label_spacing="20.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_bar
- name="simsimphysicsmsec"
- label="Physics Time"
- stat="simsimphysicsmsec"
- unit_label="ms"
- precision="3"
- bar_min="0.f"
- bar_max="40.f"
- tick_spacing="10.f"
- label_spacing="20.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_bar
- name="simsimothermsec"
- label="Simulation Time"
- stat="simsimothermsec"
- unit_label="ms"
- precision="3"
- bar_min="0.f"
- bar_max="40.f"
- tick_spacing="10.f"
- label_spacing="20.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_bar
- name="simagentmsec"
- label="Agent Time"
- stat="simagentmsec"
- unit_label="ms"
- precision="3"
- bar_min="0.f"
- bar_max="40.f"
- tick_spacing="10.f"
- label_spacing="20.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_bar
- name="simimagesmsec"
- label="Images Time"
- stat="simimagesmsec"
- unit_label="ms"
- precision="3"
- bar_min="0.f"
- bar_max="40.f"
- tick_spacing="10.f"
- label_spacing="20.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_bar
- name="simscriptmsec"
- label="Script Time"
- stat="simscriptmsec"
- unit_label="ms"
- precision="3"
- bar_min="0.f"
- bar_max="40.f"
- tick_spacing="10.f"
- label_spacing="20.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
-
- <stat_bar
- name="simsparemsec"
- label="Spare Time"
- stat="simsparemsec"
- unit_label="ms"
- precision="3"
- bar_min="0.f"
- bar_max="40.f"
- tick_spacing="10.f"
- label_spacing="20.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
- <!--2nd level time blocks under 'Details' second-->
- <stat_view
- name="timedetails"
- label="Time Details (ms)"
- show_label="true">
- <stat_bar
- name="simsimphysicsstepmsec"
- label=" Physics Step"
- stat="simsimphysicsstepmsec"
- unit_label="ms"
- precision="3"
- bar_min="0.f"
- bar_max="40.f"
- tick_spacing="10.f"
- label_spacing="20.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
- <stat_bar
- name="simsimphysicsshapeupdatemsec"
- label=" Update Phys Shapes"
- stat="simsimphysicsshapeupdatemsec"
- unit_label="ms"
- precision="3"
- bar_min="0.f"
- bar_max="40.f"
- tick_spacing="10.f"
- label_spacing="20.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
- <stat_bar
- name="simsimphysicsothermsec"
- label=" Physics Other"
- stat="simsimphysicsothermsec"
- unit_label="ms"
- precision="3"
- bar_min="0.f"
- bar_max="40.f"
- tick_spacing="10.f"
- label_spacing="20.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
- <stat_bar
- name="simsleepmsec"
- label=" Sleep Time"
- stat="simsleepmsec"
- unit_label="ms"
- precision="3"
- bar_min="0.f"
- bar_max="40.f"
- tick_spacing="10.f"
- label_spacing="20.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
- <stat_bar
- name="simpumpiomsec"
- label=" Pump IO"
- stat="simpumpiomsec"
- unit_label="ms"
- precision="3"
- bar_min="0.f"
- bar_max="40.f"
- tick_spacing="10.f"
- label_spacing="20.f"
- show_per_sec="false"
- show_bar="false"
- show_mean="false" >
- </stat_bar>
- </stat_view>
- </stat_view>
- </stat_view>
- </container_view>
- </scroll_container>
+ <stat_view name="memory"
+ label="Memory Usage">
+ <stat_bar name="LLTrace"
+ label="LLTrace"
+ stat="LLTrace"/>
+ <stat_bar name="LLView"
+ label="UI"
+ stat="LLView"/>
+ <stat_bar name="LLFontFreetype"
+ label="Fonts"
+ stat="LLFontFreetype"/>
+ <stat_bar name="LLInventoryObject"
+ label="Inventory"
+ stat="LLInventoryObject"/>
+ <stat_bar name="LLViewerObject"
+ label="Viewer Objects"
+ stat="LLViewerObject"/>
+ <stat_bar name="LLViewerOctreeGroup"
+ label="Octree Group Data"
+ stat="LLViewerOctreeGroup"/>
+ <stat_bar name="LLViewerOctreeEntry"
+ label="Octree Data"
+ stat="LLViewerOctreeEntry"/>
+ <stat_bar name="LLVOCacheEntry"
+ label="Viewer Object Cache"
+ stat="LLVOCacheEntry"/>
+ <stat_bar name="LLDrawable"
+ label="Drawables"
+ stat="LLDrawable"/>
+ <stat_bar name="LLFace"
+ label="Face Data"
+ stat="LLFace"/>
+ <stat_bar name="LLDrawInfo"
+ label="Draw Info"
+ stat="LLDrawInfo"/>
+ <stat_bar name="LLTexture"
+ label="Texture Data"
+ stat="LLTexture"/>
+ <stat_bar name="LLImage"
+ label="Image Data"
+ stat="LLImage"/>
+ <stat_bar name="LLImageGL"
+ label="GL Image Data"
+ stat="LLImageGL"/>
+ <stat_bar name="LLVertexBuffer"
+ label="Vertex Buffers"
+ stat="LLVertexBuffer"/>
+ </stat_view>
+ <stat_view name="network"
+ label="Network"
+ setting="OpenDebugStatNet">
+ <stat_bar name="packetsinstat"
+ label="Packets In"
+ stat="Packets In"
+ decimal_digits="1"/>
+ <stat_bar name="packetsoutstat"
+ label="Packets Out"
+ stat="packetsoutstat"
+ decimal_digits="1"/>
+ <stat_bar name="objectdatareceived"
+ label="Objects"
+ stat="objectdatareceived"
+ decimal_digits="1"/>
+ <stat_bar name="texturedatareceived"
+ label="Texture"
+ stat="texturedatareceived"
+ decimal_digits="1"/>
+ <stat_bar name="assetudpdatareceived"
+ label="Asset"
+ stat="assetudpdatareceived"
+ decimal_digits="1"/>
+ <stat_bar name="layersdatareceived"
+ label="Layers"
+ stat="layersdatareceived"
+ decimal_digits="1"/>
+ <stat_bar name="messagedatain"
+ label="Actual In"
+ stat="messagedatain"
+ decimal_digits="1"/>
+ <stat_bar name="messagedataout"
+ label="Actual Out"
+ stat="messagedataout"
+ decimal_digits="1"
+ show_history="false"/>
+ <stat_bar name="vfspendingoperations"
+ label="VFS Pending Operations"
+ stat="vfspendingoperations"
+ unit_label="Ops."/>
+ </stat_view>
+ </stat_view>
+
+ <stat_view name="sim"
+ label="Simulator"
+ setting="OpenDebugStatSim">
+ <stat_bar name="simtimedilation"
+ label="Time Dilation"
+ stat="simtimedilation"/>
+ <stat_bar name="simfps"
+ label="Sim FPS"
+ stat="simfps"
+ decimal_digits="1"
+ bar_max="45" />
+ <stat_bar name="simphysicsfps"
+ label="Physics FPS"
+ stat="simphysicsfps"
+ decimal_digits="1"
+ bar_max="45" />
+ <stat_view name="physicsdetail"
+ label="Physics Details">
+ <stat_bar name="physicspinnedtasks"
+ label="Pinned Objects"
+ stat="physicspinnedtasks"/>
+ <stat_bar name="physicslodtasks"
+ label="Low LOD Objects"
+ stat="physicslodtasks"/>
+ <stat_bar name="physicsmemoryallocated"
+ label="Memory Allocated"
+ stat="physicsmemoryallocated"
+ decimal_digits="1"/>
+ </stat_view>
+ <stat_bar name="simagentups"
+ label="Agent Updates/Sec"
+ stat="simagentups"
+ decimal_digits="1"/>
+ <stat_bar name="simmainagents"
+ label="Main Agents"
+ stat="simmainagents"/>
+ <stat_bar name="simchildagents"
+ label="Child Agents"
+ stat="simchildagents"/>
+ <stat_bar name="simobjects"
+ label="Objects"
+ stat="simobjects"/>
+ <stat_bar name="simactiveobjects"
+ label="Active Objects"
+ stat="simactiveobjects"/>
+ <stat_bar name="simactivescripts"
+ label="Active Scripts"
+ stat="simactivescripts"/>
+ <stat_bar name="simpctscriptsrun"
+ label="Scripts Run"
+ stat="simpctscriptsrun"/>
+ <stat_bar name="simscripteps"
+ label="Script Events"
+ stat="simscripteps"
+ unit_label="eps"/>
+ <stat_view name="simpathfinding"
+ label="Pathfinding">
+ <stat_bar name="simsimaistepmsec"
+ label="AI Step Time"
+ stat="simsimaistepmsec"/>
+ <stat_bar name="simsimskippedsilhouettesteps"
+ label="Skipped Silhouette Steps"
+ stat="simsimskippedsilhouettesteps"
+ unit_label="/sec"/>
+ <stat_bar name="simsimpctsteppedcharacters"
+ label="Characters Updated"
+ stat="simsimpctsteppedcharacters"
+ unit_label="%"
+ decimal_digits="1"/>
+ </stat_view>
+ <stat_bar name="siminpps"
+ label="Packets In"
+ stat="siminpps"
+ unit_label="pkt/sec"/>
+ <stat_bar name="simoutpps"
+ label="Packets Out"
+ stat="simoutpps"
+ unit_label="pkt/sec"/>
+ <stat_bar name="simpendingdownloads"
+ label="Pending Downloads"
+ stat="simpendingdownloads"/>
+ <stat_bar name="simpendinguploads"
+ label="Pending Uploads"
+ stat="simpendinguploads"/>
+ <stat_bar name="simtotalunackedbytes"
+ label="Total Unacked Data"
+ stat="simtotalunackedbytes"
+ decimal_digits="1"/>
+ <stat_view name="simperf"
+ label="Time">
+ <stat_bar name="simframemsec"
+ label="Total Frame Time"
+ stat="simframemsec"/>
+ <stat_bar name="simnetmsec"
+ label="Net Time"
+ stat="simnetmsec"/>
+ <stat_bar name="simsimphysicsmsec"
+ label="Physics Time"
+ stat="simsimphysicsmsec"/>
+ <stat_bar name="simsimothermsec"
+ label="Simulation Time"
+ stat="simsimothermsec"/>
+ <stat_bar name="simagentmsec"
+ label="Agent Time"
+ stat="simagentmsec"/>
+ <stat_bar name="simimagesmsec"
+ label="Images Time"
+ stat="simimagesmsec"/>
+ <stat_bar name="simscriptmsec"
+ label="Script Time"
+ stat="simscriptmsec"/>
+ <stat_bar name="simsparemsec"
+ label="Spare Time"
+ stat="simsparemsec"/>
+ <stat_view name="timedetails"
+ label="Time Details">
+ <stat_bar name="simsimphysicsstepmsec"
+ label="Physics Step"
+ stat="simsimphysicsstepmsec"/>
+ <stat_bar name="simsimphysicsshapeupdatemsec"
+ label="Update Phys Shapes"
+ stat="simsimphysicsshapeupdatemsec"/>
+ <stat_bar name="simsimphysicsothermsec"
+ label="Physics Other"
+ stat="simsimphysicsothermsec"/>
+ <stat_bar name="simsleepmsec"
+ label="Sleep Time"
+ stat="simsleepmsec"/>
+ <stat_bar name="simpumpiomsec"
+ label="Pump IO"
+ stat="simpumpiomsec"/>
+ </stat_view>
+ </stat_view>
+ </stat_view>
+ </container_view>
+ </scroll_container>
</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index 8b9733df17..3c28233875 100755
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -150,7 +150,7 @@
parameter="Land" />
</button>
<text
- height="30"
+ height="20"
word_wrap="true"
use_ellipses="true"
type="string"
@@ -294,24 +294,14 @@
<check_box
control_name="ScaleUniform"
height="19"
- label=""
+ label="Stretch Both Sides"
layout="topleft"
left="143"
name="checkbox uniform"
top="48"
- width="20" />
- <text
- height="19"
- label="Stretch Both Sides"
- left_delta="20"
- name="checkbox uniform label"
- top_delta="2"
- width="120"
- layout="topleft"
- follows="top|left"
- wrap="true">
- Stretch Both Sides
- </text>
+ label_text.wrap="true"
+ label_text.width="100"
+ width="134" />
<check_box
control_name="ScaleStretchTextures"
height="19"
diff --git a/indra/newview/skins/default/xui/en/floater_top_objects.xml b/indra/newview/skins/default/xui/en/floater_top_objects.xml
index 0b71177345..36ceddd305 100755
--- a/indra/newview/skins/default/xui/en/floater_top_objects.xml
+++ b/indra/newview/skins/default/xui/en/floater_top_objects.xml
@@ -38,6 +38,18 @@
name="none_descriptor">
None found.
</floater.string>
+ <floater.string
+ name="URLs">
+ URLs
+ </floater.string>
+ <floater.string
+ name="memory">
+ Memory (KB)
+ </floater.string>
+
+
+
+
<text
type="string"
length="1"
@@ -82,7 +94,7 @@
name="parcel"
width="120" />
<scroll_list.columns
- label="Time"
+ label="Date"
name="time"
width="130" />
<scroll_list.columns
diff --git a/indra/newview/skins/default/xui/en/floater_toybox.xml b/indra/newview/skins/default/xui/en/floater_toybox.xml
index d8211c24a7..bc19d6e79f 100755
--- a/indra/newview/skins/default/xui/en/floater_toybox.xml
+++ b/indra/newview/skins/default/xui/en/floater_toybox.xml
@@ -4,7 +4,6 @@
can_dock="false"
can_minimize="false"
can_resize="false"
- default_tab_group="1"
height="375"
help_topic="toybox"
layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/floater_twitter.xml b/indra/newview/skins/default/xui/en/floater_twitter.xml
new file mode 100644
index 0000000000..3e1a91e58d
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_twitter.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<floater
+ positioning="cascading"
+ can_close="true"
+ can_resize="false"
+ help_topic="floater_twitter"
+ layout="topleft"
+ name="floater_twitter"
+ save_rect="true"
+ single_instance="true"
+ reuse_instance="true"
+ title="TWITTER"
+ height="462"
+ width="272">
+ <tab_container
+ name="tabs"
+ tab_group="1"
+ tab_min_width="70"
+ tab_height="21"
+ tab_position="top"
+ top="7"
+ height="457"
+ halign="center"
+ use_highlighting_on_hover="true">
+ <panel
+ filename="panel_twitter_photo.xml"
+ class="lltwitterphotopanel"
+ follows="all"
+ label="COMPOSE"
+ name="panel_twitter_photo"/>
+ <panel
+ filename="panel_twitter_account.xml"
+ class="lltwitteraccountpanel"
+ follows="all"
+ label="ACCOUNT"
+ name="panel_twitter_account"/>
+ </tab_container>
+ <text
+ name="connection_error_text"
+ type="string"
+ follows="left|bottom|right"
+ bottom="-5"
+ left="10"
+ width="252"
+ height="20"
+ wrap="true"
+ halign="left"
+ valign="center"
+ text_color="DrYellow"
+ font="SansSerif">
+ Error
+ </text>
+ <loading_indicator
+ follows="left|bottom|right"
+ height="24"
+ width="24"
+ name="connection_loading_indicator"
+ top_delta="-2"
+ left="10"
+ visible="true"/>
+ <text
+ name="connection_loading_text"
+ type="string"
+ follows="left|bottom|right"
+ top_delta="2"
+ left_pad="5"
+ width="223"
+ height="20"
+ wrap="true"
+ halign="left"
+ valign="center"
+ text_color="EmphasisColor"
+ font="SansSerif">
+ Loading...
+ </text>
+</floater>
diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml
index a87027a113..9885e37cea 100755
--- a/indra/newview/skins/default/xui/en/main_view.xml
+++ b/indra/newview/skins/default/xui/en/main_view.xml
@@ -68,6 +68,7 @@
left="0"
follows="all"
height="500"
+ layout="topleft"
mouse_opaque="false"
name="login_panel_holder"
width="1024"/>
diff --git a/indra/newview/skins/default/xui/en/menu_conversation.xml b/indra/newview/skins/default/xui/en/menu_conversation.xml
index 31b1d091ee..ed362b36e5 100755
--- a/indra/newview/skins/default/xui/en/menu_conversation.xml
+++ b/indra/newview/skins/default/xui/en/menu_conversation.xml
@@ -17,6 +17,7 @@
layout="topleft"
name="open_voice_conversation">
<on_click function="Avatar.DoToSelected" parameter="open_voice_conversation"/>
+ <on_enable function="Avatar.EnableItem" parameter="can_open_voice_conversation"/>
</menu_item_call>
<menu_item_call
label="Disconnect from voice"
@@ -213,4 +214,12 @@
<on_enable function="Avatar.EnableItem" parameter="can_moderate_voice" />
</menu_item_call>
</context_menu>
+ <menu_item_separator layout="topleft" name="Group Ban Separator"/>
+ <menu_item_call
+ label="Ban member"
+ layout="topleft"
+ name="BanMember">
+ <on_click function="Avatar.DoToSelected" parameter="ban_member" />
+ <on_enable function="Avatar.EnableItem" parameter="can_ban_member" />
+ </menu_item_call>
</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_inventory_add.xml b/indra/newview/skins/default/xui/en/menu_inventory_add.xml
index 29720a680b..afeb1bf226 100755
--- a/indra/newview/skins/default/xui/en/menu_inventory_add.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory_add.xml
@@ -63,13 +63,6 @@
function="File.UploadBulk"
parameter="" />
</menu_item_call>
- <menu_item_call
- label="Set Default Upload Permissions"
- name="perm prefs">
- <menu_item_call.on_click
- function="Floater.Toggle"
- parameter="perm_prefs" />
- </menu_item_call>
</menu>
<menu_item_call
diff --git a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml
index d2519a5aa4..06d0b849a3 100755
--- a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml
@@ -63,7 +63,7 @@
<menu_item_separator
layout="topleft" />
<menu_item_call
- label="Show Filters"
+ label="Show Filters..."
layout="topleft"
name="show_filters">
<on_click
diff --git a/indra/newview/skins/default/xui/en/menu_login.xml b/indra/newview/skins/default/xui/en/menu_login.xml
index 52c4fb1613..e91eea04d1 100755
--- a/indra/newview/skins/default/xui/en/menu_login.xml
+++ b/indra/newview/skins/default/xui/en/menu_login.xml
@@ -35,14 +35,72 @@
tear_off="true"
name="Help">
<menu_item_call
- label="[SECOND_LIFE] Help"
- name="Second Life Help"
+ label="How to..."
+ name="How To"
shortcut="F1">
<menu_item_call.on_click
- function="ShowHelp"
- parameter="f1_help" />
+ function="Help.ToggleHowTo"
+ parameter="" />
</menu_item_call>
- <menu_item_separator />
+ <menu_item_call
+ label="Quickstart"
+ name="Quickstart">
+ <menu_item_call.on_click
+ function="Advanced.ShowURL"
+ parameter="http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Quickstart/ta-p/1087919"/>
+ </menu_item_call>
+ <menu_item_separator/>
+ <menu_item_call
+ label="Knowledge Base"
+ name="Knowledge Base">
+ <menu_item_call.on_click
+ function="Advanced.ShowURL"
+ parameter="http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-User-s-Guide/ta-p/1244857"/>
+ </menu_item_call>
+ <menu_item_call
+ label="Wiki"
+ name="Wiki">
+ <menu_item_call.on_click
+ function="Advanced.ShowURL"
+ parameter="http://wiki.secondlife.com"/>
+ </menu_item_call>
+ <menu_item_call
+ label="Community Forums"
+ name="Community Forums">
+ <menu_item_call.on_click
+ function="Advanced.ShowURL"
+ parameter="http://community.secondlife.com/t5/Forums/ct-p/Forums"/>
+ </menu_item_call>
+ <menu_item_call
+ label="Support portal"
+ name="Support portal">
+ <menu_item_call.on_click
+ function="Advanced.ShowURL"
+ parameter="https://support.secondlife.com/"/>
+ </menu_item_call>
+ <menu_item_separator/>
+ <menu_item_call
+ label="[SECOND_LIFE] News"
+ name="Second Life News">
+ <menu_item_call.on_click
+ function="Advanced.ShowURL"
+ parameter="http://community.secondlife.com/t5/Featured-News/bg-p/blog_feature_news"/>
+ </menu_item_call>
+ <menu_item_call
+ label="[SECOND_LIFE] Blogs"
+ name="Second Life Blogs">
+ <menu_item_call.on_click
+ function="Advanced.ShowURL"
+ parameter="http://community.secondlife.com/t5/Blogs/ct-p/Blogs"/>
+ </menu_item_call>
+ <menu_item_separator/>
+ <menu_item_call
+ label="Report Bug"
+ name="Report Bug">
+ <menu_item_call.on_click
+ function="Advanced.ReportBug"/>
+ </menu_item_call>
+ <menu_item_separator/>
<menu_item_call
label="About [APP_NAME]"
name="About Second Life">
diff --git a/indra/newview/skins/default/xui/en/menu_object.xml b/indra/newview/skins/default/xui/en/menu_object.xml
index 52ab7da515..5c98a98d3d 100755
--- a/indra/newview/skins/default/xui/en/menu_object.xml
+++ b/indra/newview/skins/default/xui/en/menu_object.xml
@@ -130,17 +130,24 @@
function="Object.ReportAbuse" />
<menu_item_call.on_enable
function="Object.EnableReportAbuse" />
- </menu_item_call>
+ </menu_item_call>
<menu_item_call
- enabled="false"
- label="Block"
- name="Object Mute">
- <menu_item_call.on_click
+ label="Block"
+ name="Object Mute">
+ <menu_item_call.on_click
function="Object.Mute" />
- <menu_item_call.on_enable
+ <menu_item_call.on_visible
function="Object.EnableMute" />
</menu_item_call>
<menu_item_call
+ label="Unblock"
+ name="Object Unmute">
+ <menu_item_call.on_click
+ function="Object.Mute" />
+ <menu_item_call.on_visible
+ function="Object.EnableUnmute" />
+ </menu_item_call>
+ <menu_item_call
enabled="false"
label="Return"
name="Return...">
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 7e8d2aaf9a..de441983d0 100755
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -16,14 +16,6 @@
parameter="agent" />
</menu_item_call>
<menu_item_call
- label="Post to Facebook..."
- name="PostToFacebook">
- <menu_item_call.on_click
- function="Floater.Toggle"
- parameter="social"/>
- </menu_item_call>
- <menu_item_separator/>
- <menu_item_call
label="Appearance..."
name="ChangeOutfit">
<menu_item_call.on_click
@@ -259,8 +251,7 @@
function="Floater.Visible"
parameter="nearby_chat" />
<menu_item_check.on_click
- function="Floater.ToggleOrBringToFront"
- parameter="nearby_chat" />
+ function="Communicate.NearbyChat"/>
</menu_item_check>
<menu_item_check
label="Speak"
@@ -288,6 +279,28 @@
parameter="conversation" />
</menu_item_check>
<menu_item_separator/>
+ <menu_item_call
+ label="Facebook..."
+ name="Facebook">
+ <menu_item_call.on_click
+ function="Floater.Toggle"
+ parameter="facebook"/>
+ </menu_item_call>
+ <menu_item_call
+ label="Twitter..."
+ name="Twitter">
+ <menu_item_call.on_click
+ function="Floater.Toggle"
+ parameter="twitter"/>
+ </menu_item_call>
+ <menu_item_call
+ label="Flickr..."
+ name="Flickr">
+ <menu_item_call.on_click
+ function="Floater.Toggle"
+ parameter="flickr"/>
+ </menu_item_call>
+ <menu_item_separator/>
<menu
label="Voice morphing"
name="VoiceMorphing"
@@ -363,13 +376,16 @@
function="SideTray.PanelPeopleTab"
parameter="nearby_panel" />
</menu_item_check>
- <menu_item_call
+ <menu_item_check
label="Block List"
name="Block List">
- <menu_item_call.on_click
+ <menu_item_check.on_check
+ function="SideTray.CheckPanelPeopleTab"
+ parameter="blocked_panel" />
+ <menu_item_check.on_click
function="SideTray.PanelPeopleTab"
parameter="blocked_panel" />
- </menu_item_call>
+ </menu_item_check>
<menu_item_separator/>
<menu_item_check
name="Do Not Disturb"
@@ -606,44 +622,59 @@
label="Sun"
name="Sun"
tear_off="true">
- <menu_item_call
+ <menu_item_check
label="Sunrise"
name="Sunrise">
- <menu_item_call.on_click
+ <menu_item_check.on_click
function="World.EnvSettings"
parameter="sunrise" />
- </menu_item_call>
- <menu_item_call
+ <menu_item_check.on_check
+ function="World.EnableEnvSettings"
+ parameter="sunrise" />
+ </menu_item_check>
+ <menu_item_check
label="Midday"
name="Noon"
shortcut="control|shift|Y">
- <menu_item_call.on_click
+ <menu_item_check.on_click
function="World.EnvSettings"
parameter="noon" />
- </menu_item_call>
- <menu_item_call
+ <menu_item_check.on_check
+ function="World.EnableEnvSettings"
+ parameter="noon" />
+ </menu_item_check>
+ <menu_item_check
label="Sunset"
name="Sunset"
shortcut="control|shift|N">
- <menu_item_call.on_click
+ <menu_item_check.on_click
function="World.EnvSettings"
parameter="sunset" />
- </menu_item_call>
- <menu_item_call
+ <menu_item_check.on_check
+ function="World.EnableEnvSettings"
+ parameter="sunset" />
+ </menu_item_check>
+ <menu_item_check
label="Midnight"
name="Midnight">
- <menu_item_call.on_click
+ <menu_item_check.on_click
function="World.EnvSettings"
parameter="midnight" />
- </menu_item_call>
+ <menu_item_check.on_check
+ function="World.EnableEnvSettings"
+ parameter="midnight" />
+ </menu_item_check>
<menu_item_separator/>
- <menu_item_call
+ <menu_item_check
label="Use Region Settings"
name="Use Region Settings">
- <menu_item_call.on_click
+ <menu_item_check.on_click
function="World.EnvSettings"
parameter="region" />
- </menu_item_call>
+ <menu_item_check.on_check
+ function="World.EnableEnvSettings"
+ parameter="region" />
+ </menu_item_check>
</menu>
@@ -1187,16 +1218,24 @@
<menu_item_call.on_enable
function="SomethingSelected" />
</menu_item_call>
+ <menu_item_separator/>
<menu_item_call
- label="Grid Options"
+ label="Grid Options..."
name="Grid Options"
shortcut="control|shift|B">
<menu_item_call.on_click
- function="Floater.Show"
+ function="Floater.Toggle"
parameter="build_options" />
<menu_item_call.on_enable
function="Tools.EnableToolNotPie" />
</menu_item_call>
+ <menu_item_call
+ label="Set Default Permissions..."
+ name="Set default permissions">
+ <menu_item_call.on_click
+ function="Floater.ToggleOrBringToFront"
+ parameter="perms_default" />
+ </menu_item_call>
</menu>
<menu
create_jump_keys="true"
@@ -1264,13 +1303,6 @@
function="File.UploadBulk"
parameter="" />
</menu_item_call>
- <menu_item_call
- label="Set Default Upload Permissions"
- name="perm prefs">
- <menu_item_call.on_click
- function="Floater.Toggle"
- parameter="perm_prefs" />
- </menu_item_call>
</menu>
<menu_item_separator/>
<menu_item_call
@@ -1492,6 +1524,14 @@
function="Floater.Toggle"
parameter="stats" />
</menu_item_check>
+ <menu_item_call
+ label="Scene Load Statistics"
+ name="Scene Load Statistics"
+ shortcut="control|shift|2">
+ <on_click
+ function="Floater.Show"
+ parameter="scene_load_stats" />
+ </menu_item_call>
<menu_item_check
label="Show Draw Weight for Avatars"
name="Avatar Rendering Cost">
@@ -1542,7 +1582,8 @@
<menu_item_check
label="Highlight Transparent"
name="Highlight Transparent"
- shortcut="control|alt|T">
+ shortcut="control|alt|T"
+ use_mac_ctrl="true">
<menu_item_check.on_check
function="View.CheckHighlightTransparent" />
<menu_item_check.on_click
@@ -2097,6 +2138,16 @@
function="Advanced.ToggleConsole"
parameter="scene view" />
</menu_item_check>
+ <menu_item_check
+ label="Scene Loading Monitor"
+ name="Scene Loading Monitor">
+ <menu_item_check.on_check
+ function="Advanced.CheckConsole"
+ parameter="scene monitor" />
+ <menu_item_check.on_click
+ function="Advanced.ToggleConsole"
+ parameter="scene monitor" />
+ </menu_item_check>
<menu_item_call
enabled="false"
visible="false"
@@ -2559,6 +2610,16 @@
parameter="lights" />
</menu_item_check>
<menu_item_check
+ label="Particles"
+ name="Particles">
+ <menu_item_check.on_check
+ function="Advanced.CheckInfoDisplay"
+ parameter="particles" />
+ <menu_item_check.on_click
+ function="Advanced.ToggleInfoDisplay"
+ parameter="particles" />
+ </menu_item_check>
+ <menu_item_check
label="Collision Skeleton"
name="Collision Skeleton">
<menu_item_check.on_check
@@ -2877,6 +2938,16 @@
function="ToggleControl"
parameter="RenderHoverGlowEnable" />
</menu_item_check>
+ <menu_item_separator />
+
+ <menu_item_call
+ enabled="true"
+ label="Clear Cache Immediately"
+ name="Cache Clear">
+ <menu_item_call.on_click
+ function="Develop.ClearCache" />
+ </menu_item_call>
+
</menu>
<menu
@@ -3136,18 +3207,6 @@
<menu_item_call.on_click
function="Advanced.PrintAgentInfo" />
</menu_item_call>
- <menu_item_check
- label="Region Debug Console"
- name="Region Debug Console"
- shortcut="control|shift|`"
- use_mac_ctrl="true">
- <menu_item_check.on_check
- function="Floater.Visible"
- parameter="region_debug_console" />
- <menu_item_check.on_click
- function="Floater.Toggle"
- parameter="region_debug_console" />
- </menu_item_check>
<menu_item_separator />
<menu_item_check
diff --git a/indra/newview/skins/default/xui/en/mime_types.xml b/indra/newview/skins/default/xui/en/mime_types.xml
index a585069faa..f5f2223330 100755
--- a/indra/newview/skins/default/xui/en/mime_types.xml
+++ b/indra/newview/skins/default/xui/en/mime_types.xml
@@ -101,6 +101,27 @@
true
</allow_looping>
</widgetset>
+ <widgetset name="none">
+ <label name="none_label">
+ No Content
+ </label>
+ <default_type>
+ none/none
+ </default_type>
+ <icon>
+ icn_media_web.tga
+ </icon>
+ <tooltip name="none_tooltip">
+ No media here
+ </tooltip>
+ <playtip name="none_playtip" />
+ <allow_resize>
+ false
+ </allow_resize>
+ <allow_looping>
+ false
+ </allow_looping>
+ </widgetset>
<scheme name="rtsp">
<label name="rtsp_label">
Real Time Streaming
diff --git a/indra/newview/skins/default/xui/en/mime_types_linux.xml b/indra/newview/skins/default/xui/en/mime_types_linux.xml
index e95b371d00..84aeaf3b54 100755
--- a/indra/newview/skins/default/xui/en/mime_types_linux.xml
+++ b/indra/newview/skins/default/xui/en/mime_types_linux.xml
@@ -101,6 +101,27 @@
true
</allow_looping>
</widgetset>
+ <widgetset name="none">
+ <label name="none_label">
+ No Content
+ </label>
+ <default_type>
+ none/none
+ </default_type>
+ <icon>
+ icn_media_web.tga
+ </icon>
+ <tooltip name="none_tooltip">
+ No media here
+ </tooltip>
+ <playtip name="none_playtip" />
+ <allow_resize>
+ false
+ </allow_resize>
+ <allow_looping>
+ false
+ </allow_looping>
+ </widgetset>
<scheme name="rtsp">
<label name="rtsp_label">
Real Time Streaming
diff --git a/indra/newview/skins/default/xui/en/mime_types_mac.xml b/indra/newview/skins/default/xui/en/mime_types_mac.xml
index 7931e55c0a..90230f12dd 100755
--- a/indra/newview/skins/default/xui/en/mime_types_mac.xml
+++ b/indra/newview/skins/default/xui/en/mime_types_mac.xml
@@ -101,6 +101,27 @@
true
</allow_looping>
</widgetset>
+ <widgetset name="none">
+ <label name="none_label">
+ No Content
+ </label>
+ <default_type>
+ none/none
+ </default_type>
+ <icon>
+ icn_media_web.tga
+ </icon>
+ <tooltip name="none_tooltip">
+ No media here
+ </tooltip>
+ <playtip name="none_playtip" />
+ <allow_resize>
+ false
+ </allow_resize>
+ <allow_looping>
+ false
+ </allow_looping>
+ </widgetset>
<scheme name="rtsp">
<label name="rtsp_label">
Real Time Streaming
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 370a2af5e0..f1d34a1449 100755
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -169,6 +169,16 @@ No tutorial is currently available.
<notification
icon="alertmodal.tga"
+ name="GenericAlertOK"
+ type="alertmodal">
+[MESSAGE]
+ <usetemplate
+ name="okbutton"
+ yestext="OK"/>
+ </notification>
+
+ <notification
+ icon="alertmodal.tga"
name="BadInstallation"
type="alertmodal">
An error occurred while updating [APP_NAME]. Please [http://get.secondlife.com download the latest version] of the Viewer.
@@ -506,7 +516,35 @@ Add this Ability to &apos;[ROLE_NAME]&apos;?
notext="No"
yestext="Yes"/>
</notification>
-
+
+ <notification
+ icon="alertmodal.tga"
+ name="AssignBanAbilityWarning"
+ type="alertmodal">
+You are about to add the Ability &apos;[ACTION_NAME]&apos; to the Role &apos;[ROLE_NAME]&apos;.
+
+ *WARNING*
+Any Member in a Role with this Ability will also be granted the Abilities &apos;[ACTION_NAME_2]&apos; and &apos;[ACTION_NAME_3]&apos;
+ <usetemplate
+ name="okbutton"
+ yestext="OK"/>
+ </notification>
+
+ <notification
+ icon="alertmodal.tga"
+ name="RemoveBanAbilityWarning"
+ type="alertmodal">
+You are removing the Ability &apos;[ACTION_NAME]&apos; to the Role &apos;[ROLE_NAME]&apos;.
+
+ *WARNING*
+Removing this ability will NOT remove the Abilities &apos;[ACTION_NAME_2]&apos; and &apos;[ACTION_NAME_3]&apos;.
+
+If you no longer wish to have these abilities granted to this role, disable them immediately!
+ <usetemplate
+ name="okbutton"
+ yestext="OK"/>
+ </notification>
+
<notification
icon="alertmodal.tga"
name="EjectGroupMemberWarning"
@@ -1389,6 +1427,14 @@ Graphics Quality can be raised in Preferences &gt; Graphics.
The region [REGION] does not allow terraforming.
<tag>fail</tag>
</notification>
+
+ <notification
+ icon="alertmodal.tga"
+ name="ParcelNoTerraforming"
+ type="notify">
+You are not allowed to terraform parcel [PARCEL].
+ <tag>fail</tag>
+ </notification>
<notification
icon="alertmodal.tga"
@@ -3747,6 +3793,50 @@ Leave Group?
</notification>
<notification
+ icon="aler.tga"
+ name="GroupDepartError"
+ type="alert">
+Unable to leave group: [reason].
+ <tag>reason</tag>
+ <usetemplate
+ name="okbutton"
+ yestext="OK"/>
+ </notification>
+
+ <notification
+ icon="alert.tga"
+ name="GroupDepart"
+ type="alert">
+You have left the group [group_name].
+ <tag>group_name</tag>
+ <usetemplate
+ name="okbutton"
+ yestext="OK"/>
+ </notification>
+
+ <notification
+ icon="aler.tga"
+ name="GroupDepartError"
+ type="alert">
+Unable to leave group: [reason].
+ <tag>reason</tag>
+ <usetemplate
+ name="okbutton"
+ yestext="OK"/>
+ </notification>
+
+ <notification
+ icon="alert.tga"
+ name="GroupDepart"
+ type="alert">
+You have left the group [group_name].
+ <tag>group_name</tag>
+ <usetemplate
+ name="okbutton"
+ yestext="OK"/>
+ </notification>
+
+ <notification
icon="alert.tga"
name="ConfirmKick"
type="alert">
@@ -4137,6 +4227,19 @@ Are you sure you want to teleport to &lt;nolink&gt;[LOCATION]&lt;/nolink&gt;?
notext="Cancel"
yestext="Teleport"/>
</notification>
+
+ <notification
+ icon="alertmodal.tga"
+ name="TeleportViaSLAPP"
+ type="alertmodal">
+Are you sure you want to teleport to &lt;nolink&gt;[LOCATION]&lt;/nolink&gt;?
+ <tag>confirm</tag>
+ <usetemplate
+ ignoretext="Confirm that I want to teleport via SLAPP"
+ name="okcancelignore"
+ notext="Cancel"
+ yestext="Teleport"/>
+ </notification>
<notification
icon="alertmodal.tga"
@@ -4568,6 +4671,17 @@ The region you're trying to visit contains [REGIONMATURITY] content, but your cu
<notification
icon="alertmodal.tga"
+ name="RegionTPSpecialUsageBlocked"
+ type="alertmodal">
+ <tag>fail</tag>
+ Unable to enter region. '[REGION_NAME]' is a Skill Gaming Region, and you must meet certain criteria in order to enter. For details, please review the [http://wiki.secondlife.com/wiki/Linden_Lab_Official:Skill_Gaming_in_Second_Life Skill Gaming FAQ].
+ <usetemplate
+ name="okbutton"
+ yestext="OK"/>
+ </notification>
+
+ <notification
+ icon="alertmodal.tga"
name="PreferredMaturityChanged"
type="alertmodal">
You won't receive any more notifications that you're about to visit a region with [RATING] content. You may change your content preferences in the future by using Me &gt; Preferences &gt; General from the menu bar.
@@ -5333,6 +5447,14 @@ Do you want to replace it with the selected object?
</notification>
<notification
+ icon="alertmodal.tga"
+ name="TooManyWearables"
+ type="alertmodal">
+ You can't wear a folder containing more than [AMOUNT] items. You can change this limit in Advanced > Show Debug Settings > WearFolderLimit.
+ <tag>fail</tag>
+ </notification>
+
+ <notification
icon="alert.tga"
label="Do Not Disturb Mode Warning"
name="DoNotDisturbModePay"
@@ -6052,7 +6174,21 @@ Please select at least one type of content to search (General, Moderate, or Adul
type="notifytip">
[MESSAGE]
</notification>
-
+
+ <notification
+ icon="notify.tga"
+ name="FlickrConnect"
+ type="notifytip">
+ [MESSAGE]
+ </notification>
+
+ <notification
+ icon="notify.tga"
+ name="TwitterConnect"
+ type="notifytip">
+ [MESSAGE]
+ </notification>
+
<notification
icon="notify.tga"
name="PaymentReceived"
@@ -6923,11 +7059,11 @@ If you stay in this region you will be logged out.
name="LoadWebPage"
show_toast="false"
type="notify">
-Load web page [URL]?
+Load web page [URL] ?
[MESSAGE]
-From object: &lt;nolink&gt;[OBJECTNAME]&lt;/nolink&gt;, owner: [NAME]?
+From object: &lt;nolink&gt;[OBJECTNAME]&lt;/nolink&gt;, owner: [NAME]
<tag>confirm</tag>
<form name="form">
<button
@@ -7634,7 +7770,7 @@ Are you sure you want to share the following items:
With the following Residents:
-[RESIDENTS]
+&lt;nolink&gt;[RESIDENTS]&lt;/nolink&gt;
<tag>confirm</tag>
<usetemplate
name="okcancelbuttons"
@@ -7654,7 +7790,7 @@ Are you sure you want to share the following items:
With the following Residents:
-[RESIDENTS]
+&lt;nolink&gt;[RESIDENTS]&lt;/nolink&gt;
<tag>confirm</tag>
<usetemplate
name="okcancelbuttons"
@@ -7823,7 +7959,16 @@ You uploaded a [RESOLUTION] baked texture for '[BODYREGION]' after [TIME] second
( [EXISTENCE] seconds alive )
You locally updated a [RESOLUTION] baked texture for '[BODYREGION]' after [TIME] seconds.
</notification>
-
+
+ <notification
+ icon="alertmodal.tga"
+ name="CannotUploadTexture"
+ type="alertmodal">
+Unable to upload texture.
+[REASON]
+ <tag>fail</tag>
+ </notification>
+
<notification
icon="alertmodal.tga"
name="LivePreviewUnavailable"
@@ -10223,5 +10368,26 @@ Cannot create large prims that intersect other players. Please re-try when othe
name="okignore"
yestext="OK"/>
</notification>
+
+ <notification
+ icon="alertmodal.tga"
+ name="DefaultObjectPermissions"
+ type="alert">
+ There was a problem saving the default permissions due to the following reason: [REASON]. Please try setting the default permissions later.
+ <tag>fail</tag>
+ <usetemplate
+ name="okbutton"
+ yestext="OK"/>
+ </notification>
+
+ <notification
+ icon="alert.tga"
+ name="ChatHistoryIsBusyAlert"
+ type="alertmodal">
+ Chat history file is busy with previous operation. Please try again in a few minutes or choose chat with another person.
+ <usetemplate
+ name="okbutton"
+ yestext="OK"/>
+ </notification>
</notifications>
diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml b/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml
index 27a27473d8..1c0b205c4f 100755
--- a/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml
+++ b/indra/newview/skins/default/xui/en/panel_bottomtray_lite.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel
- default_tab_group="2"
mouse_opaque="true"
background_visible="true"
bg_alpha_color="DkGray"
diff --git a/indra/newview/skins/default/xui/en/panel_facebook_friends.xml b/indra/newview/skins/default/xui/en/panel_facebook_friends.xml
new file mode 100644
index 0000000000..97994fb08b
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_facebook_friends.xml
@@ -0,0 +1,73 @@
+<panel
+ height="400"
+ width="272"
+ layout="topleft"
+ follows="all"
+ name="panel_facebook_friends">
+ <string
+ name="facebook_friends_empty"
+ value="You currently do not have any Facebook friends who are also Second Life residents. Ask your Facebook friends to join Second Life today!" />
+ <string
+ name="facebook_friends_no_connected"
+ value="You're currently not connected to Facebook. Please go to the Status tab to connect and enable this feature." />
+ <accordion
+ background_visible="false"
+ bg_alpha_color="DkGray2"
+ bg_opaque_color="DkGray2"
+ follows="all"
+ height="383"
+ layout="topleft"
+ left="10"
+ name="friends_accordion"
+ right="-10"
+ top_pad="2">
+ <accordion_tab
+ layout="topleft"
+ height="173"
+ name="tab_second_life_friends"
+ title="SL friends">
+ <avatar_list
+ ignore_online_status="true"
+ allow_select="true"
+ follows="all"
+ height="173"
+ layout="topleft"
+ left="0"
+ name="second_life_friends"
+ show_permissions_granted="true"
+ top="0"
+ width="272" />
+ </accordion_tab>
+ <accordion_tab
+ layout="topleft"
+ height="173"
+ name="tab_suggested_friends"
+ title="Add these people as SL friends">
+ <avatar_list
+ ignore_online_status="true"
+ allow_select="true"
+ follows="all"
+ height="173"
+ layout="topleft"
+ left="0"
+ name="suggested_friends"
+ show_permissions_granted="true"
+ top="0"
+ width="272" />
+ </accordion_tab>
+ </accordion>
+ <text
+ layout="topleft"
+ word_wrap="true"
+ height="64"
+ width="250"
+ follows="top|left|right"
+ font="SansSerif"
+ left="10"
+ right="-10"
+ name="facebook_friends_status"
+ top="5"
+ type="string">
+ Not connected to Facebook.
+ </text>
+</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_social_photo.xml b/indra/newview/skins/default/xui/en/panel_facebook_photo.xml
index c79a246d9d..22e6598352 100644
--- a/indra/newview/skins/default/xui/en/panel_social_photo.xml
+++ b/indra/newview/skins/default/xui/en/panel_facebook_photo.xml
@@ -1,28 +1,19 @@
<panel
height="400"
- width="304"
+ width="272"
layout="topleft"
- name="panel_social_photo">
- <layout_stack
- layout="topleft"
- border_size="0"
- height="392"
- follows="all"
- orientation="vertical"
- name="stack_photo"
- top="8">
- <layout_panel
- name="snapshot_panel"
- height="367">
+ follows="all"
+ name="panel_facebook_photo">
<combo_box
- control_name="SocialPhotoResolution"
+ control_name="FacebookPhotoResolution"
follows="left|top"
- top="6"
- left="9"
+ layout="topleft"
+ top="7"
+ left="10"
name="resolution_combobox"
tool_tip="Image resolution"
height="21"
- width="135">
+ width="124">
<combo_box.item
label="Current Window"
name="CurrentWindow"
@@ -39,34 +30,69 @@
label="1024x768"
name="1024x768"
value="[i1024,i768]" />
+ <combo_box.item
+ label="1200x630"
+ name="1200x630"
+ value="[i1200,i630]" />
+ </combo_box>
+ <combo_box
+ control_name="FacebookPhotoFilters"
+ follows="left|top"
+ layout="topleft"
+ name="filters_combobox"
+ tool_tip="Image filters"
+ top="7"
+ left_pad="4"
+ height="21"
+ width="124">
+ <combo_box.item
+ label="No Filter"
+ name="NoFilter"
+ value="NoFilter" />
</combo_box>
- <text
- follows="left|top"
- font="SansSerifSmall"
- height="14"
- left="208"
- length="1"
- halign="right"
- name="file_size_label"
- top="9"
- type="string"
- width="50">
- [SIZE] KB
- </text>
<panel
height="150"
- width="250"
+ width="252"
visible="true"
+ layout="topleft"
name="thumbnail_placeholder"
- top="33"
- follows="left|top"
- left="9">
+ top_pad="5"
+ follows="left|top|rith"
+ right="-10"
+ left="10">
</panel>
+ <text
+ follows="left|top"
+ layout="topleft"
+ font="SansSerif"
+ text_color="EmphasisColor"
+ height="14"
+ top_pad="2"
+ left="10"
+ length="1"
+ halign="center"
+ name="working_lbl"
+ translate="false"
+ type="string"
+ visible="true"
+ width="251">
+ Refreshing...
+ </text>
+ <view_border
+ bevel_style="in"
+ follows="left|top"
+ layout="topleft"
+ height="1"
+ left="10"
+ name="refresh_border"
+ width="250"
+ top_pad="0"/>
<button
follows="left|top"
+ layout="topleft"
height="23"
label="Refresh"
- left="9"
+ left="10"
top_pad="5"
name="new_snapshot_btn"
tool_tip="Click to refresh"
@@ -75,52 +101,51 @@
<button.commit_callback
function="SocialSharing.RefreshPhoto" />
</button>
- <text
- follows="left|top"
- font="SansSerif"
- text_color="EmphasisColor"
- height="14"
- top_pad="-19"
- left_pad="-20"
- length="1"
- halign="center"
- name="working_lbl"
- translate="false"
- type="string"
+ <button
+ follows="right|top"
+ layout="topleft"
+ height="23"
+ label="Preview"
+ right="-10"
+ top_delta="0"
+ name="big_preview_btn"
+ tool_tip="Click to toggle preview"
+ is_toggle="true"
visible="true"
- width="150">
- Refreshing...
- </text>
+ width="100" >
+ <button.commit_callback
+ function="SocialSharing.BigPreview" />
+ </button>
<text
length="1"
follows="top|left|right"
+ layout="topleft"
font="SansSerif"
height="16"
- left="9"
+ left="10"
name="caption_label"
top_pad="20"
type="string">
Comment (optional):
</text>
<text_editor
- follows="left|top"
+ follows="left|top|right|bottom"
+ layout="topleft"
height="87"
width="250"
- left="9"
+ left="10"
+ right="-10"
length="1"
max_length="700"
name="photo_caption"
type="string"
word_wrap="true">
</text_editor>
- </layout_panel>
- <layout_panel
- name="photo_button_panel"
- height="25">
<button
follows="left|top"
- top="0"
- left="9"
+ layout="topleft"
+ top_pad="22"
+ left="10"
height="23"
label="Post"
name="post_photo_btn"
@@ -129,16 +154,15 @@
function="SocialSharing.SendPhoto" />
</button>
<button
- follows="left|top"
+ follows="right|top"
+ layout="topleft"
height="23"
label="Cancel"
name="cancel_photo_btn"
- left_pad="15"
+ right="-10"
top_delta="0"
width="100">
<button.commit_callback
function="SocialSharing.Cancel" />
- </button>
- </layout_panel>
- </layout_stack>
+ </button>
</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_social_place.xml b/indra/newview/skins/default/xui/en/panel_facebook_place.xml
index 13e94f6998..f87b008c4e 100644
--- a/indra/newview/skins/default/xui/en/panel_social_place.xml
+++ b/indra/newview/skins/default/xui/en/panel_facebook_place.xml
@@ -1,114 +1,96 @@
<panel
height="400"
- width="304"
+ width="272"
layout="topleft"
- name="panel_social_place">
- <layout_stack
- layout="topleft"
- border_size="0"
- height="392"
- follows="all"
- orientation="vertical"
- name="stack_place"
- top="8">
- <layout_panel
- name="place_detail_panel"
- height="181">
+ follows="all"
+ name="panel_facebook_place">
<text
length="1"
follows="top|left|right"
+ layout="topleft"
font="SansSerif"
height="16"
- left="9"
+ left="10"
name="place_caption_label"
- top="13"
+ top="5"
type="string">
Say something about where you are:
</text>
<text_editor
- follows="top|left"
- height="150"
+ follows="top|left|right"
+ layout="topleft"
+ height="70"
width="250"
- left="9"
+ left="10"
+ right="-10"
length="1"
max_length="700"
name="place_caption"
type="string"
word_wrap="true">
</text_editor>
- </layout_panel>
- <layout_panel
- name="place_map_panel"
- height="186">
+ <check_box
+ follows="left|top"
+ layout="topleft"
+ initial_value="false"
+ height="16"
+ top_pad="8"
+ width="8"
+ label="Include overhead view of location"
+ name="add_place_view_cb"
+ left="10"/>
<panel
follows="left|top"
- height="128"
- width="128"
+ layout="topleft"
+ height="243"
+ width="250"
background_visible="true"
bg_opaque_color="Black"
bg_alpha_color="Black"
- top="20"
- left="9"
+ top_pad="8"
+ left="10"
+ right="-12"
visible="true"
name="map_border">
</panel>
- <loading_indicator
- follows="left|top"
- height="24"
- width="24"
- name="map_loading_indicator"
- top="77"
- left="61"
- visible="true"/>
<icon
follows="left|top"
- height="128"
- width="128"
+ layout="topleft"
+ height="243"
+ width="250"
image_name="Map_Placeholder_Icon"
- layout="topleft"
- top="20"
- left="9"
+ top_delta="0"
+ right="-12"
+ left="10"
visible="true"
name="map_placeholder">
</icon>
<icon
follows="left|top"
- height="128"
- width="128"
+ layout="topleft"
+ height="243"
+ width="250"
image_name="Map_Placeholder_Icon"
- layout="topleft"
- top="20"
- left="9"
+ top_delta="0"
+ left="10"
+ right="-12"
visible="true"
name="map_default">
</icon>
- <check_box
+ <loading_indicator
follows="left|top"
- initial_value="false"
- top_delta="8"
- width="8"
- label=""
- name="add_place_view_cb"
- left_pad="5"/>
- <text
- follows="left|top"
- font="SansSerif"
- height="32"
- width="130"
- word_wrap="true"
- left_pad="12"
- top_delta="-8"
- type="string">
- Include overhead view of location
- </text>
- </layout_panel>
- <layout_panel
- name="place_button_panel"
- height="25">
+ layout="topleft"
+ height="24"
+ width="24"
+ name="map_loading_indicator"
+ top_delta="116"
+ left="126"
+ visible="false"/>
<button
- follows="left|top"
- top="0"
- left="9"
+ follows="left|bottom"
+ layout="topleft"
+ top_pad="95"
+ left="10"
height="23"
label="Post"
name="post_place_btn"
@@ -117,16 +99,15 @@
function="SocialSharing.SendCheckin" />
</button>
<button
- follows="left|top"
+ follows="right|bottom"
+ layout="topleft"
height="23"
label="Cancel"
name="cancel_place_btn"
- left_pad="15"
+ right="-10"
top_delta="0"
width="100">
<button.commit_callback
function="SocialSharing.Cancel" />
</button>
- </layout_panel>
- </layout_stack>
</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_facebook_status.xml b/indra/newview/skins/default/xui/en/panel_facebook_status.xml
new file mode 100644
index 0000000000..fe0f3c9279
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_facebook_status.xml
@@ -0,0 +1,130 @@
+ <panel
+ height="400"
+ width="272"
+ follows="all"
+ layout="topleft"
+ name="panel_facebook_status">
+ <string
+ name="facebook_connected"
+ value="You are connected to Facebook as:" />
+ <string
+ name="facebook_disconnected"
+ value="Not connected to Facebook" />
+ <text
+ layout="topleft"
+ length="1"
+ follows="top|left"
+ font="SansSerif"
+ height="16"
+ left="10"
+ name="account_caption_label"
+ top="5"
+ type="string">
+ Not connected to Facebook.
+ </text>
+ <text
+ layout="topleft"
+ top_pad="2"
+ length="1"
+ follows="top|left"
+ font="SansSerif"
+ height="16"
+ left="10"
+ name="account_name_label"
+ parse_urls="true"
+ type="string"/>
+ <panel
+ layout="topleft"
+ follows="left|top"
+ name="panel_buttons"
+ height="60"
+ left="0">
+ <button
+ layout="topleft"
+ follows="left|top"
+ top_pad="9"
+ left="10"
+ visible="true"
+ height="23"
+ label="Connect..."
+ name="connect_btn"
+ width="251">
+ <commit_callback function="SocialSharing.Connect"/>
+ </button>
+
+ <button
+ layout="topleft"
+ follows="left|top|right"
+ top_delta="0"
+ left="10"
+ right="-10"
+ height="23"
+ label="Disconnect"
+ name="disconnect_btn"
+ width="210"
+ visible="false">
+ <commit_callback function="SocialSharing.Disconnect"/>
+ </button>
+ <text
+ layout="topleft"
+ length="1"
+ follows="top|left|right"
+ left="10"
+ right="-10"
+ height="16"
+ name="account_learn_more_label"
+ top_pad="5"
+ type="string">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Facebook/ta-p/2149711 Learn about posting to Facebook]
+ </text>
+ </panel>
+
+ <text
+ length="1"
+ layout="topleft"
+ follows="top|left|right"
+ font="SansSerif"
+ height="16"
+ left="10"
+ name="status_caption_label"
+ top_pad="5"
+ type="string">
+ What's on your mind?
+ </text>
+ <text_editor
+ follows="left|top|right"
+ layout="topleft"
+ height="150"
+ width="252"
+ left="10"
+ length="1"
+ max_length="700"
+ name="status_message"
+ type="string"
+ word_wrap="true">
+ </text_editor>
+ <button
+ follows="left|top"
+ layout="topleft"
+ top_pad="6"
+ left="10"
+ height="23"
+ label="Post"
+ name="post_status_btn"
+ width="100">
+ <button.commit_callback
+ function="SocialSharing.SendStatus" />
+ </button>
+ <button
+ follows="right|top"
+ layout="topleft"
+ height="23"
+ label="Cancel"
+ name="cancel_status_btn"
+ right="-10"
+ top_delta="0"
+ width="100">
+ <button.commit_callback
+ function="SocialSharing.Cancel" />
+ </button>
+ </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_social_account.xml b/indra/newview/skins/default/xui/en/panel_flickr_account.xml
index d7235396fe..5c2f335780 100644
--- a/indra/newview/skins/default/xui/en/panel_social_account.xml
+++ b/indra/newview/skins/default/xui/en/panel_flickr_account.xml
@@ -1,25 +1,25 @@
<panel
- height="400"
- width="304"
+ height="540"
+ width="272"
layout="topleft"
- name="panel_social_account">
+ name="panel_flickr_account">
<string
- name="facebook_connected"
- value="You are connected to Facebook as:" />
+ name="flickr_connected"
+ value="You are connected to Flickr as:" />
<string
- name="facebook_disconnected"
- value="Not connected to Facebook" />
+ name="flickr_disconnected"
+ value="Not connected to Flickr" />
<text
layout="topleft"
length="1"
follows="top|left"
font="SansSerif"
height="16"
- left="9"
+ left="10"
name="account_caption_label"
- top="21"
+ top="5"
type="string">
- Not connected to Facebook.
+ Not connected to Flickr.
</text>
<text
layout="topleft"
@@ -28,7 +28,7 @@
follows="top|left"
font="SansSerif"
height="16"
- left="9"
+ left="10"
name="account_name_label"
parse_urls="true"
type="string"/>
@@ -36,12 +36,14 @@
layout="topleft"
name="panel_buttons"
height="345"
- left="9">
+ left="0">
<button
layout="topleft"
- follows="left|top"
+ follows="left|top|right"
top_pad="9"
visible="true"
+ left="10"
+ right="-10"
height="23"
label="Connect..."
name="connect_btn"
@@ -51,8 +53,10 @@
<button
layout="topleft"
- follows="left|top"
+ follows="left|top|right"
top_delta="0"
+ left="10"
+ right="-10"
height="23"
label="Disconnect"
name="disconnect_btn"
@@ -65,11 +69,11 @@
length="1"
follows="top|left"
height="16"
- left="0"
+ left="10"
name="account_learn_more_label"
- top_pad="20"
+ top_pad="5"
type="string">
- [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share/ta-p/2149711 Learn about posting to Facebook]
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Flickr/ta-p/2435609 Learn about posting to Flickr]
</text>
</panel>
</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_flickr_photo.xml b/indra/newview/skins/default/xui/en/panel_flickr_photo.xml
new file mode 100644
index 0000000000..e31695645d
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_flickr_photo.xml
@@ -0,0 +1,258 @@
+ <panel
+ height="540"
+ width="272"
+ follows="all"
+ layout="topleft"
+ name="panel_flickr_photo">
+ <combo_box
+ control_name="FlickrPhotoResolution"
+ follows="left|top"
+ layout="topleft"
+ top="7"
+ left="10"
+ name="resolution_combobox"
+ tool_tip="Image resolution"
+ height="21"
+ width="124">
+ <combo_box.item
+ label="Current Window"
+ name="CurrentWindow"
+ value="[i0,i0]" />
+ <combo_box.item
+ label="640x480"
+ name="640x480"
+ value="[i640,i480]" />
+ <combo_box.item
+ label="800x600"
+ name="800x600"
+ value="[i800,i600]" />
+ <combo_box.item
+ label="1024x768"
+ name="1024x768"
+ value="[i1024,i768]" />
+ </combo_box>
+ <combo_box
+ control_name="FlickrPhotoFilters"
+ follows="left|top"
+ layout="topleft"
+ name="filters_combobox"
+ tool_tip="Image filters"
+ top_delta="0"
+ left_pad="4"
+ height="21"
+ width="124">
+ <combo_box.item
+ label="No Filter"
+ name="NoFilter"
+ value="NoFilter" />
+ </combo_box>
+ <panel
+ height="150"
+ width="250"
+ visible="true"
+ name="thumbnail_placeholder"
+ top_pad="5"
+ follows="left|top|right"
+ layout="topleft"
+ right="-10"
+ left="10">
+ </panel>
+ <text
+ follows="left|top"
+ layout="topleft"
+ font="SansSerif"
+ text_color="EmphasisColor"
+ height="14"
+ top_pad="2"
+ left="10"
+ length="1"
+ halign="center"
+ name="working_lbl"
+ translate="false"
+ type="string"
+ visible="true"
+ width="251">
+ Refreshing...
+ </text>
+ <view_border
+ bevel_style="in"
+ follows="left|top"
+ layout="topleft"
+ height="1"
+ left="10"
+ name="refresh_border"
+ width="250"
+ top_pad="0"/>
+ <button
+ follows="left|top"
+ layout="topleft"
+ height="23"
+ label="Refresh"
+ left="10"
+ top_pad="5"
+ name="new_snapshot_btn"
+ tool_tip="Click to refresh"
+ visible="true"
+ width="100" >
+ <button.commit_callback
+ function="SocialSharing.RefreshPhoto" />
+ </button>
+ <button
+ follows="right|top"
+ layout="topleft"
+ height="23"
+ label="Preview"
+ right="-10"
+ top_delta="0"
+ name="big_preview_btn"
+ tool_tip="Click to toggle preview"
+ is_toggle="true"
+ visible="true"
+ width="100" >
+ <button.commit_callback
+ function="SocialSharing.BigPreview" />
+ </button>
+ <text
+ length="1"
+ follows="top|left|right"
+ layout="topleft"
+ font="SansSerif"
+ height="16"
+ left="10"
+ name="title_label"
+ top_pad="10"
+ type="string">
+ Title:
+ </text>
+ <line_editor
+ follows="left|top"
+ layout="topleft"
+ height="20"
+ width="250"
+ left="10"
+ length="1"
+ max_length="256"
+ name="photo_title"
+ type="string">
+ </line_editor>
+ <text
+ length="1"
+ follows="top|left|right"
+ layout="topleft"
+ font="SansSerif"
+ height="16"
+ left="10"
+ right="-10"
+ name="description_label"
+ top_pad="10"
+ width="25"
+ type="string">
+ Description:
+ </text>
+ <text_editor
+ follows="left|top"
+ layout="topleft"
+ height="50"
+ width="249"
+ left="10"
+ length="1"
+ max_length="700"
+ name="photo_description"
+ type="string"
+ word_wrap="true">
+ </text_editor>
+ <check_box
+ follows="left|top"
+ layout="topleft"
+ initial_value="true"
+ label="Include SL location at end of description"
+ name="add_location_cb"
+ left="9"
+ height="16"
+ top_pad="8"/>
+ <text
+ length="1"
+ follows="top|left"
+ layout="topleft"
+ font="SansSerif"
+ height="16"
+ left="10"
+ name="tags_label"
+ top_pad="6"
+ type="string">
+ Tags:
+ </text>
+ <text
+ length="1"
+ follows="top|left"
+ layout="topleft"
+ font="SansSerifSmall"
+ text_color="White_50"
+ height="30"
+ name="tags_help_label"
+ left="51"
+ top_pad="-16"
+ type="string">
+Separate tags with spaces
+Use "" for multi-word tags
+ </text>
+ <text_editor
+ follows="left|top"
+ layout="topleft"
+ height="50"
+ width="249"
+ left="10"
+ length="1"
+ max_length="700"
+ name="photo_tags"
+ type="string"
+ word_wrap="true">
+ </text_editor>
+ <combo_box
+ control_name="FlickrPhotoRating"
+ follows="left|top"
+ layout="topleft"
+ top_pad="7"
+ left="10"
+ name="rating_combobox"
+ tool_tip="Flickr content rating"
+ height="21"
+ width="250">
+ <combo_box.item
+ label="Safe Flickr rating"
+ name="SafeRating"
+ value="1" />
+ <combo_box.item
+ label="Moderate Flickr rating"
+ name="ModerateRating"
+ value="2" />
+ <combo_box.item
+ label="Restricted Flickr rating"
+ name="RestrictedRating"
+ value="3" />
+ </combo_box>
+ <button
+ follows="left|top"
+ layout="topleft"
+ top_pad="7"
+ left="10"
+ height="23"
+ label="Upload"
+ name="post_photo_btn"
+ width="100">
+ <button.commit_callback
+ function="SocialSharing.SendPhoto" />
+ </button>
+ <button
+ follows="right|top"
+ layout="topleft"
+ height="23"
+ label="Cancel"
+ name="cancel_photo_btn"
+ right="-10"
+ top_delta="0"
+ width="100">
+ <button.commit_callback
+ function="SocialSharing.Cancel" />
+ </button>
+ </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_group_bulk_ban.xml b/indra/newview/skins/default/xui/en/panel_group_bulk_ban.xml
new file mode 100644
index 0000000000..509dcf354e
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_group_bulk_ban.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<panel
+ height="330"
+ label="Ban Residents"
+ layout="topleft"
+ left="0"
+ name="bulk_ban_panel"
+ top="330"
+ width="210">
+ <panel.string
+ name="loading">
+ (loading...)
+ </panel.string>
+ <panel.string
+ name="ban_selection_too_large">
+ Group bans not sent: too many Residents selected. Group bans are limited to 100 per request.
+ </panel.string>
+ <panel.string
+ name="ban_not_permitted">
+ Group ban not sent: you do not have 'Manage ban list' ability.
+ </panel.string>
+ <panel.string
+ name="ban_limit_fail">
+ Group ban not sent: your group have reached limit of allowed ban records.
+ </panel.string>
+ <panel.string
+ name="partial_ban">
+ Some group bans were not sent:
+[REASONS]
+ </panel.string>
+ <panel.string
+ name="ban_failed">
+ Group bans were not sent:
+[REASONS]
+ </panel.string>
+ <panel.string
+ name="residents_already_banned">
+ - The following resident(s) are already banned: [RESIDENTS].
+ </panel.string>
+ <panel.string
+ name="ban_limit_reached">
+ - Ban limit reached, following agents not banned: [RESIDENTS].
+ </panel.string>
+ <panel.string
+ name="cant_ban_yourself">
+ - You cannot ban yourself from a group.
+ </panel.string>
+ <text
+ type="string"
+ length="1"
+ height="54"
+ layout="topleft"
+ left="7"
+ name="help_text"
+ top="28"
+ word_wrap="true"
+ width="200">
+ You can select multiple Residents to ban from your group. Click &apos;Open Resident Chooser&apos; to start.
+ </text>
+ <button
+ height="20"
+ label="Open Resident Chooser"
+ layout="topleft"
+ left_delta="-2"
+ name="add_button"
+ top_delta="44"
+ width="200" />
+ <name_list
+ allow_calling_card_drop="true"
+ column_padding="0"
+ height="174"
+ layout="topleft"
+ left_delta="0"
+ multi_select="true"
+ name="banned_agent_list"
+ tool_tip="Hold the Ctrl key and click Resident names to multi-select"
+ top_pad="4"
+ width="200" />
+ <button
+ height="20"
+ label="Remove Selected from List"
+ layout="topleft"
+ left_delta="0"
+ name="remove_button"
+ tool_tip="Removes the Residents selected above from the ban list"
+ top_pad="4"
+ width="200" />
+ <button
+ height="20"
+ label="Ban Residents"
+ layout="topleft"
+ left="4"
+ name="ban_button"
+ top_delta="30"
+ width="135" />
+ <button
+ height="20"
+ label="Cancel"
+ layout="topleft"
+ left_pad="2"
+ name="cancel_button"
+ top_delta="0"
+ width="65" />
+ <string
+ name="GroupBulkBan">
+ Group Ban
+ </string>
+</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_group_invite.xml b/indra/newview/skins/default/xui/en/panel_group_invite.xml
index 124c0596c3..ebb460deb0 100755
--- a/indra/newview/skins/default/xui/en/panel_group_invite.xml
+++ b/indra/newview/skins/default/xui/en/panel_group_invite.xml
@@ -76,7 +76,7 @@
Choose what Role to assign them to:
</text>
<combo_box
- height="16"
+ height="20"
layout="topleft"
left_delta="0"
name="role_name"
@@ -88,7 +88,7 @@
label="Send Invitations"
layout="topleft"
left="4"
- name="ok_button"
+ name="invite_button"
top="356"
width="135" />
<button
diff --git a/indra/newview/skins/default/xui/en/panel_group_roles.xml b/indra/newview/skins/default/xui/en/panel_group_roles.xml
index 9ac5b8800e..dac4371a38 100755
--- a/indra/newview/skins/default/xui/en/panel_group_roles.xml
+++ b/indra/newview/skins/default/xui/en/panel_group_roles.xml
@@ -118,6 +118,13 @@ clicking on their names.
left_pad="10"
name="member_eject"
width="100" />
+ <button
+ height="23"
+ label="Ban Member(s)"
+ follows="top|left"
+ left_pad="10"
+ name="member_ban"
+ width="100" />
</panel>
<panel
border="false"
@@ -138,454 +145,535 @@ clicking on their names.
right="-5"
name="show_all_button"
width="100" />-->
- <panel.string
- name="help_text">
- Roles have a title and an allowed list of Abilities
-that Members can perform. Members can belong to
-one or more Roles. A group can have up to 10 Roles,
-including the Everyone and Owner Roles.
- </panel.string>
- <panel.string
- name="cant_delete_role">
- The &apos;Everyone&apos; and &apos;Owners&apos; Roles are special and can't be deleted.
- </panel.string>
- <panel.string
- name="power_folder_icon" translate="false">
- Inv_FolderClosed
- </panel.string>
- <panel.string
- name="power_all_have_icon" translate="false">
- Checkbox_On
- </panel.string>
- <panel.string
- name="power_partial_icon" translate="false">
- Checkbox_Off
- </panel.string>
- <filter_editor
- layout="topleft"
- top="5"
- left="5"
- right="-5"
- height="22"
- search_button_visible="false"
- follows="left|top|right"
- label="Filter Roles"
- name="filter_input" />
- <scroll_list
- column_padding="0"
- draw_heading="true"
- draw_stripes="false"
- heading_height="23"
- height="132"
- layout="topleft"
- search_column="1"
- left="0"
- follows="left|top|right"
- right="-1"
- name="role_list"
- top_pad="2"
- width="310">
- <scroll_list.columns
- label="Role"
- name="name"
- relative_width="0.45" />
- <scroll_list.columns
- label="Title"
- name="title"
- relative_width="0.45" />
- <scroll_list.columns
- label="#"
- name="members"
- relative_width="0.15" />
- </scroll_list>
- <button
- follows="top|left"
- height="23"
- label="New Role"
- layout="topleft"
- left="0"
- name="role_create"
- width="120" />
- <button
- height="23"
- follows="top|left"
- label="Delete Role"
- layout="topleft"
- left_pad="10"
- name="role_delete"
- width="120" />
- </panel>
- <panel
- border="false"
- height="303"
- label="ABILITIES"
- layout="topleft"
- left="0"
- right="-1"
- help_topic="roles_actions_tab"
- name="actions_sub_tab"
- class="panel_group_actions_subtab"
- tool_tip="You can view an Ability&apos;s Description and which Roles and Members can execute the Ability."
- width="310">
- <panel.string
- name="help_text">
- Abilities allow Members in Roles to do specific
-things in this group. There&apos;s a broad variety of Abilities.
- </panel.string>
- <panel.string
- name="power_folder_icon" translate="false">
- Inv_FolderClosed
- </panel.string>
- <panel.string
- name="power_all_have_icon" translate="false">
- Checkbox_On
- </panel.string>
- <panel.string
- name="power_partial_icon" translate="false">
- Checkbox_Off
- </panel.string>
- <filter_editor
- layout="topleft"
- top="5"
- left="5"
- right="-5"
- height="22"
- search_button_visible="false"
- follows="left|top|right"
- label="Filter Abilities"
- name="filter_input" />
- <scroll_list
- column_padding="0"
- draw_stripes="true"
- height="200"
- follows="left|top|right"
- layout="topleft"
- left="0"
- right="-1"
- name="action_list"
- search_column="2"
- tool_tip="Select an Ability to view more details"
- top_pad="5"
- width="300">
- <scroll_list.columns
- label=""
- name="icon"
- width="2" />
- <scroll_list.columns
- label=""
- name="checkbox"
- width="20" />
- <scroll_list.columns
- label=""
- name="action"
- width="270" />
- </scroll_list>
- </panel>
- </tab_container>
+ <panel.string
+ name="help_text">
+ Roles have a title and an allowed list of Abilities
+ that Members can perform. Members can belong to
+ one or more Roles. A group can have up to 10 Roles,
+ including the Everyone and Owner Roles.
+ </panel.string>
+ <panel.string
+ name="cant_delete_role">
+ The &apos;Everyone&apos; and &apos;Owners&apos; Roles are special and can't be deleted.
+ </panel.string>
+ <panel.string
+ name="power_folder_icon" translate="false">
+ Inv_FolderClosed
+ </panel.string>
+ <panel.string
+ name="power_all_have_icon" translate="false">
+ Checkbox_On
+ </panel.string>
+ <panel.string
+ name="power_partial_icon" translate="false">
+ Checkbox_Off
+ </panel.string>
+ <filter_editor
+ layout="topleft"
+ top="5"
+ left="5"
+ right="-5"
+ height="22"
+ search_button_visible="false"
+ follows="left|top|right"
+ label="Filter Roles"
+ name="filter_input" />
+ <scroll_list
+ column_padding="0"
+ draw_heading="true"
+ draw_stripes="false"
+ heading_height="23"
+ height="132"
+ layout="topleft"
+ search_column="1"
+ left="0"
+ follows="left|top|right"
+ right="-1"
+ name="role_list"
+ top_pad="2"
+ width="310">
+ <scroll_list.columns
+ label="Role"
+ name="name"
+ relative_width="0.45" />
+ <scroll_list.columns
+ label="Title"
+ name="title"
+ relative_width="0.45" />
+ <scroll_list.columns
+ label="#"
+ name="members"
+ relative_width="0.15" />
+ </scroll_list>
+ <button
+ follows="top|left"
+ height="23"
+ label="New Role"
+ layout="topleft"
+ left="0"
+ name="role_create"
+ width="120" />
+ <button
+ height="23"
+ follows="top|left"
+ label="Delete Role"
+ layout="topleft"
+ left_pad="10"
+ name="role_delete"
+ width="120" />
+ </panel>
<panel
- height="350"
- background_visible="false"
- bg_alpha_color="FloaterUnfocusBorderColor"
+ border="false"
+ height="303"
+ label="ABILITIES"
layout="topleft"
- follows="top|left|right"
left="0"
right="-1"
- width="313"
- mouse_opaque="false"
- name="members_footer"
- top="325"
- visible="false">
- <text
- type="string"
- height="16"
- layout="topleft"
- follows="left|top"
- left="5"
- top="8"
- text_color="EmphasisColor"
- name="static"
- width="300">
- Assigned Roles
- </text>
- <scroll_list
- draw_stripes="true"
- follows="left|top|right"
- height="150"
- layout="topleft"
- left="0"
- right="-1"
- name="member_assigned_roles"
- top_pad="0">
- <scroll_list.columns
- label=""
- name="checkbox"
- width="20" />
- <scroll_list.columns
- label=""
- name="role"
- width="270" />
- </scroll_list>
- <text
- type="string"
- height="16"
- layout="topleft"
- follows="left|top"
- left="5"
- top_pad="5"
- text_color="EmphasisColor"
- name="static2"
- width="285">
- Allowed Abilities
- </text>
- <scroll_list
- draw_stripes="true"
- follows="left|top|right"
- height="150"
- layout="topleft"
- left="0"
- right="-1"
- name="member_allowed_actions"
- search_column="2"
- tool_tip="For details of each allowed ability see the abilities tab"
- top_pad="0">
- <scroll_list.columns
- label=""
- name="icon"
- width="2" />
- <scroll_list.columns
- label=""
- name="checkbox"
- width="20" />
- <scroll_list.columns
- label=""
- name="action"
- width="270" />
- </scroll_list>
+ help_topic="roles_actions_tab"
+ name="actions_sub_tab"
+ class="panel_group_actions_subtab"
+ tool_tip="You can view an Ability&apos;s Description and which Roles and Members can execute the Ability."
+ width="310">
+ <panel.string
+ name="help_text">
+ Abilities allow Members in Roles to do specific
+ things in this group. There&apos;s a broad variety of Abilities.
+ </panel.string>
+ <panel.string
+ name="power_folder_icon" translate="false">
+ Inv_FolderClosed
+ </panel.string>
+ <panel.string
+ name="power_all_have_icon" translate="false">
+ Checkbox_On
+ </panel.string>
+ <panel.string
+ name="power_partial_icon" translate="false">
+ Checkbox_Off
+ </panel.string>
+ <filter_editor
+ layout="topleft"
+ top="5"
+ left="5"
+ right="-5"
+ height="22"
+ search_button_visible="false"
+ follows="left|top|right"
+ label="Filter Abilities"
+ name="filter_input" />
+ <scroll_list
+ column_padding="0"
+ draw_stripes="true"
+ height="200"
+ follows="left|top|right"
+ layout="topleft"
+ left="0"
+ right="-1"
+ name="action_list"
+ search_column="2"
+ tool_tip="Select an Ability to view more details"
+ top_pad="5"
+ width="300">
+ <scroll_list.columns
+ label=""
+ name="icon"
+ width="2" />
+ <scroll_list.columns
+ label=""
+ name="checkbox"
+ width="20" />
+ <scroll_list.columns
+ label=""
+ name="action"
+ width="270" />
+ </scroll_list>
</panel>
<panel
- height="550"
- background_visible="false"
- bg_alpha_color="FloaterUnfocusBorderColor"
+ border="false"
+ height="303"
+ label="BANNED RESIDENTS"
layout="topleft"
- follows="top|left|right"
left="0"
right="-1"
- width="313"
- mouse_opaque="false"
- name="roles_footer"
- top_delta="0"
- top="209"
- visible="false">
- <text
- type="string"
- height="16"
- layout="topleft"
- follows="left|top"
- left="5"
- top="5"
- name="static"
- width="300">
- Role Name
- </text>
- <line_editor
- type="string"
- height="20"
- layout="topleft"
- left="0"
- follows="left|top|right"
- right="-1"
- max_length_bytes="20"
- name="role_name"
- top_pad="0"
- width="300">
- </line_editor>
- <text
- type="string"
- height="16"
- layout="topleft"
- follows="left|top"
- left="5"
- name="static3"
- top_pad="5"
- width="300">
- Role Title
- </text>
- <line_editor
- type="string"
- height="20"
- layout="topleft"
- left="0"
- follows="left|top|right"
- right="-1"
- max_length_bytes="20"
- name="role_title"
- top_pad="0"
- width="300">
- </line_editor>
- <text
- type="string"
- height="16"
- layout="topleft"
- follows="left|top"
- left="5"
- name="static2"
- top_pad="5"
- width="200">
- Description
- </text>
- <text_editor
- type="string"
- layout="topleft"
- left="0"
- follows="left|top|right"
- right="-1"
- max_length="295"
- height="35"
- name="role_description"
- top_pad="0"
- width="300"
- word_wrap="true">
- </text_editor>
- <text
- type="string"
- height="16"
- layout="topleft"
- follows="left|top"
- left="5"
- text_color="EmphasisColor"
- name="static4"
- top_pad="5"
- width="300">
- Assigned Members
- </text>
- <name_list
- draw_stripes="true"
- height="128"
- layout="topleft"
- left="0"
- follows="left|top|right"
- right="-1"
- name="role_assigned_members"
- top_pad="0"
- width="300" />
- <check_box
- height="15"
- label="Reveal members"
- left="5"
- layout="topleft"
- name="role_visible_in_list"
- tool_tip="Sets whether members of this role are visible in the General tab to people outside of the group."
- top_pad="4"
- width="300" />
- <text
- type="string"
- height="16"
- layout="topleft"
- follows="left|top"
- left="5"
- text_color="EmphasisColor"
- name="static5"
- top_pad="2"
- width="300">
- Allowed Abilities
- </text>
- <scroll_list
- draw_stripes="true"
- height="140"
- layout="topleft"
- left="0"
- follows="left|top|right"
- right="-1"
- name="role_allowed_actions"
- search_column="2"
- tool_tip="For details of each allowed ability see the abilities tab"
- top_pad="0"
- width="300">
- <scroll_list.columns
- label=""
- name="icon"
- width="2" />
- <scroll_list.columns
- label=""
- name="checkbox"
- width="20" />
- <scroll_list.columns
- label=""
- name="action"
- width="270" />
- </scroll_list>
+ help_topic="roles_banlist_tab"
+ name="banlist_sub_tab"
+ class="panel_group_banlist_subtab"
+ tool_tip="View the banned residents from this group."
+ width="310">
+ <panel.string
+ name="help_text">
+ Any resident on the ban list will be unable to join the group.
+ </panel.string>
+ <panel.string
+ name="ban_count_template">
+ Ban count: [COUNT]/[LIMIT]
+ </panel.string>
+ <name_list
+ column_padding="0"
+ draw_heading="true"
+ height="400"
+ follows="left|top|right"
+ layout="topleft"
+ left="0"
+ right="-1"
+ multi_select="true"
+ name="ban_list"
+ short_names="false"
+ top_pad="5">
+ <name_list.columns
+ label="Resident"
+ name="name"
+ font.name="SANSSERIF_SMALL"
+ font.style="NORMAL"
+ relative_width="0.7" />
+ <name_list.columns
+ label="Date Banned"
+ name="ban_date"
+ relative_width="0.3" />
+ </name_list>
+ <button
+ follows="top|left"
+ height="23"
+ label="Ban Resident(s)"
+ layout="topleft"
+ left="3"
+ name="ban_create"
+ tool_tip="Ban residents from your group"
+ width="120" />
+ <button
+ follows="top|left"
+ height="23"
+ label="Remove Ban(s)"
+ layout="topleft"
+ left_pad="5"
+ name="ban_delete"
+ tool_tip="Unban selected residents from your group"
+ width="120" />
+ <button
+ follows="top|left"
+ height="23"
+ width="23"
+ image_overlay="Refresh_Off"
+ layout="topleft"
+ left_pad="5"
+ name="ban_refresh"
+ tool_tip="Refresh the ban list"
+ />
+ <text
+ type="string"
+ height="18"
+ left_pad="5"
+ follows="top|left"
+ layout="topleft"
+ name="ban_count"
+ width="100">
+ </text>
</panel>
- <panel
- height="424"
- background_visible="false"
- bg_alpha_color="FloaterUnfocusBorderColor"
+ </tab_container>
+ <panel
+ height="350"
+ background_visible="false"
+ bg_alpha_color="FloaterUnfocusBorderColor"
+ layout="topleft"
+ follows="top|left|right"
+ left="0"
+ right="-1"
+ width="313"
+ mouse_opaque="false"
+ name="members_footer"
+ top="325"
+ visible="false">
+ <text
+ type="string"
+ height="16"
+ layout="topleft"
+ follows="left|top"
+ left="5"
+ top="8"
+ text_color="EmphasisColor"
+ name="static"
+ width="300">
+ Assigned Roles
+ </text>
+ <scroll_list
+ draw_stripes="true"
+ follows="left|top|right"
+ height="150"
layout="topleft"
- follows="top|left|right"
left="0"
right="-1"
- width="313"
- mouse_opaque="false"
- name="actions_footer"
- top_delta="0"
- top="255"
- visible="false">
- <text_editor
- bg_readonly_color="Transparent"
- text_readonly_color="EmphasisColor"
- font="SansSerifSmall"
- type="string"
- enabled="false"
- halign="left"
- layout="topleft"
+ name="member_assigned_roles"
+ top_pad="0">
+ <scroll_list.columns
+ label=""
+ name="checkbox"
+ width="20" />
+ <scroll_list.columns
+ label=""
+ name="role"
+ width="270" />
+ </scroll_list>
+ <text
+ type="string"
+ height="16"
+ layout="topleft"
+ follows="left|top"
+ left="5"
+ top_pad="5"
+ text_color="EmphasisColor"
+ name="static2"
+ width="285">
+ Allowed Abilities
+ </text>
+ <scroll_list
+ draw_stripes="true"
follows="left|top|right"
- left="0"
- right="-1"
- height="90"
- max_length="512"
- name="action_description"
- top="0"
- word_wrap="true">
- This Ability is &apos;Eject Members from this Group&apos;. Only an Owner can eject another Owner.
- </text_editor>
- <text
+ height="150"
+ layout="topleft"
+ left="0"
+ right="-1"
+ name="member_allowed_actions"
+ search_column="2"
+ tool_tip="For details of each allowed ability see the abilities tab"
+ top_pad="0">
+ <scroll_list.columns
+ label=""
+ name="icon"
+ width="2" />
+ <scroll_list.columns
+ label=""
+ name="checkbox"
+ width="20" />
+ <scroll_list.columns
+ label=""
+ name="action"
+ width="270" />
+ </scroll_list>
+ </panel>
+ <panel
+ height="550"
+ background_visible="false"
+ bg_alpha_color="FloaterUnfocusBorderColor"
+ layout="topleft"
+ follows="top|left|right"
+ left="0"
+ right="-1"
+ width="313"
+ mouse_opaque="false"
+ name="roles_footer"
+ top_delta="0"
+ top="209"
+ visible="false">
+ <text
+ type="string"
+ height="16"
+ layout="topleft"
+ follows="left|top"
+ left="5"
+ top="5"
+ name="static"
+ width="300">
+ Role Name
+ </text>
+ <line_editor
+ type="string"
+ height="20"
+ layout="topleft"
+ left="0"
+ follows="left|top|right"
+ right="-1"
+ max_length_bytes="20"
+ name="role_name"
+ top_pad="0"
+ width="300">
+ </line_editor>
+ <text
+ type="string"
+ height="16"
+ layout="topleft"
+ follows="left|top"
+ left="5"
+ name="static3"
+ top_pad="5"
+ width="300">
+ Role Title
+ </text>
+ <line_editor
+ type="string"
+ height="20"
+ layout="topleft"
+ left="0"
+ follows="left|top|right"
+ right="-1"
+ max_length_bytes="20"
+ name="role_title"
+ top_pad="0"
+ width="300">
+ </line_editor>
+ <text
type="string"
height="16"
layout="topleft"
follows="left|top"
left="5"
name="static2"
- top_pad="1"
- width="300">
- Roles with this ability
- </text>
- <scroll_list
- height="172"
- layout="topleft"
- follows="left|top|right"
- left="5"
- right="-1"
- name="action_roles"
- top_pad="0"
- width="300" />
- <text
- type="string"
- height="16"
- layout="topleft"
- follows="left|top"
- left="5"
- name="static3"
top_pad="5"
- width="300">
- Members with this ability
- </text>
- <name_list
- height="122"
- follows="left|top|right"
- layout="topleft"
- left="5"
- right="-1"
- name="action_members"
- top_pad="0"
- width="300" />
- </panel>
+ width="200">
+ Description
+ </text>
+ <text_editor
+ type="string"
+ layout="topleft"
+ left="0"
+ follows="left|top|right"
+ right="-1"
+ max_length="295"
+ height="35"
+ name="role_description"
+ top_pad="0"
+ width="300"
+ word_wrap="true">
+ </text_editor>
+ <text
+ type="string"
+ height="16"
+ layout="topleft"
+ follows="left|top"
+ left="5"
+ text_color="EmphasisColor"
+ name="static4"
+ top_pad="5"
+ width="300">
+ Assigned Members
+ </text>
+ <name_list
+ draw_stripes="true"
+ height="128"
+ layout="topleft"
+ left="0"
+ follows="left|top|right"
+ right="-1"
+ name="role_assigned_members"
+ top_pad="0"
+ width="300" />
+ <check_box
+ height="15"
+ label="Reveal members"
+ left="5"
+ layout="topleft"
+ name="role_visible_in_list"
+ tool_tip="Sets whether members of this role are visible in the General tab to people outside of the group."
+ top_pad="4"
+ width="300" />
+ <text
+ type="string"
+ height="16"
+ layout="topleft"
+ follows="left|top"
+ left="5"
+ text_color="EmphasisColor"
+ name="static5"
+ top_pad="2"
+ width="300">
+ Allowed Abilities
+ </text>
+ <scroll_list
+ draw_stripes="true"
+ height="140"
+ layout="topleft"
+ left="0"
+ follows="left|top|right"
+ right="-1"
+ name="role_allowed_actions"
+ search_column="2"
+ tool_tip="For details of each allowed ability see the abilities tab"
+ top_pad="0"
+ width="300">
+ <scroll_list.columns
+ label=""
+ name="icon"
+ width="2" />
+ <scroll_list.columns
+ label=""
+ name="checkbox"
+ width="20" />
+ <scroll_list.columns
+ label=""
+ name="action"
+ width="270" />
+ </scroll_list>
+ </panel>
+ <panel
+ height="424"
+ background_visible="false"
+ bg_alpha_color="FloaterUnfocusBorderColor"
+ layout="topleft"
+ follows="top|left|right"
+ left="0"
+ right="-1"
+ width="313"
+ mouse_opaque="false"
+ name="actions_footer"
+ top_delta="0"
+ top="255"
+ visible="false">
+ <text_editor
+ bg_readonly_color="Transparent"
+ text_readonly_color="EmphasisColor"
+ font="SansSerifSmall"
+ type="string"
+ enabled="false"
+ halign="left"
+ layout="topleft"
+ follows="left|top|right"
+ left="0"
+ right="-1"
+ height="90"
+ max_length="512"
+ name="action_description"
+ top="0"
+ word_wrap="true">
+ This Ability is &apos;Eject Members from this Group&apos;. Only an Owner can eject another Owner.
+ </text_editor>
+ <text
+ type="string"
+ height="16"
+ layout="topleft"
+ follows="left|top"
+ left="5"
+ name="static2"
+ top_pad="1"
+ width="300">
+ Roles with this ability
+ </text>
+ <scroll_list
+ height="172"
+ layout="topleft"
+ follows="left|top|right"
+ left="5"
+ right="-1"
+ name="action_roles"
+ top_pad="0"
+ width="300" />
+ <text
+ type="string"
+ height="16"
+ layout="topleft"
+ follows="left|top"
+ left="5"
+ name="static3"
+ top_pad="5"
+ width="300">
+ Members with this ability
+ </text>
+ <name_list
+ height="122"
+ follows="left|top|right"
+ layout="topleft"
+ left="5"
+ right="-1"
+ name="action_members"
+ top_pad="0"
+ width="300" />
+ </panel>
</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml
index 134ca75018..a258a874b0 100755
--- a/indra/newview/skins/default/xui/en/panel_login.xml
+++ b/indra/newview/skins/default/xui/en/panel_login.xml
@@ -1,265 +1,214 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel
- follows="all"
- height="600"
- layout="topleft"
- left="0"
- name="panel_login"
- focus_root="true"
- top="600"
- width="1130">
- <string name="reg_in_client_url" translate="false">
- http://secondlife.eniac15.lindenlab.com/reg-in-client/
- </string>
+ follows="all"
+ height="768"
+ layout="topleft"
+ name="panel_login"
+ focus_root="true"
+ background_visible="true"
+ bg_opaque_color="0.16 0.16 0.16 1"
+ background_opaque="true"
+ width="1024">
<panel.string
- name="forgot_password_url">
+ name="forgot_password_url">
http://secondlife.com/account/request.php
</panel.string>
- <!-- *NOTE: Custom resize logic for login_html in llpanellogin.cpp -->
- <web_browser
- tab_stop="false"
- trusted_content="true"
- bg_opaque_color="Black"
- border_visible="false"
- bottom="600"
- follows="all"
- left="0"
- name="login_html"
- start_url=""
- top="0"
- height="600"
- width="996"/>
<layout_stack
- animate="false"
- clip="false"
- follows="left|bottom|right"
- name="login_widgets"
- layout="topleft"
- orientation="horizontal"
- top="519"
- width="1130"
- height="80">
- <layout_panel
- auto_resize="false"
- follows="left|bottom"
- name="login"
- layout="topleft"
- width="310"
- min_width="310"
- height="80">
- <text
- follows="left|bottom"
- font="SansSerif"
- font.style="BOLD"
- font.size="Large"
- height="16"
- name="log_in_text"
- top="8"
- left="15"
- width="150">
- LOG IN
- </text>
- <text
- follows="left|bottom"
- font="SansSerifSmall"
- height="16"
- name="username_text"
- top="35"
- left="15"
- width="150">
- Username:
- </text>
- <!-- STEAM-14: Turn off commit_on_focus_lost so if user presses Enter
- with focus in this combo_box, we can use commit action to initiate
- login -->
- <combo_box
- allow_text_entry="true"
- follows="left|bottom"
- height="22"
- left_delta="0"
- max_chars="128"
- commit_on_focus_lost="false"
- combo_editor.prevalidate_callback="ascii"
- tool_tip="The username you chose when you registered, like bobsmith12 or Steller Sunshine"
- top_pad="0"
- name="username_combo"
- width="178">
-<!-- empirically, displayed width is 150 anyway?!? -->
- <combo_box.combo_button
- visible ="false"/>
- <combo_box.drop_down_button
- visible ="false"/>
- </combo_box>
-<!-- left="175" based on actual "username_combo" width of 150 vs. 178 -->
- <text
- follows="left|bottom"
- font="SansSerifSmall"
- height="16"
- name="password_text"
- top="35"
- left="175"
- width="150">
- Password:
- </text>
- <!-- STEAM-14: Turn off commit_on_focus_lost so if user presses Enter
- with focus in this line_editor, we can use commit action to
- initiate login -->
- <line_editor
- follows="left|bottom"
- height="22"
- max_length_bytes="16"
- name="password_edit"
- is_password="true"
- select_on_focus="true"
- commit_on_focus_lost="false"
- top_pad="0"
- width="135" />
- </layout_panel>
- <layout_panel
- auto_resize="false"
- follows="left|bottom"
- name="start_location_panel"
- layout="topleft"
- width="175"
- min_width="175"
- height="80">
- <text
- follows="left|bottom"
- font="SansSerifSmall"
- height="16"
- left="10"
- name="start_location_text"
- top="35"
- width="130">
- Start at:
- </text>
- <combo_box
- allow_text_entry="true"
- control_name="NextLoginLocation"
- follows="left|bottom"
- height="22"
- max_chars="128"
- top_pad="0"
- name="start_location_combo"
- width="165">
- <combo_box.item
- label="My last location"
- name="MyLastLocation"
- value="last" />
- <combo_box.item
- label="My home"
- name="MyHome"
- value="home" />
- <combo_box.item
- label="&lt;Type region name&gt;"
- name="Typeregionname" value="" />
- </combo_box>
- </layout_panel>
+ follows="left|right|top"
+ height="172"
+ min_height="172"
+ left="0"
+ name="ui_stack"
+ orientation="horizontal"
+ top="0"
+ width="1024">
<layout_panel
- auto_resize="false"
- follows="left|bottom"
- name="grid_panel"
- layout="topleft"
- width="145"
- height="80"
- visible="false">
- <combo_box
- allow_text_entry="false"
- font="SansSerifSmall"
- follows="left|right|bottom"
- height="23"
- max_chars="256"
- left="10"
- top="51"
- layout="topleft"
- top_pad="2"
- name="server_combo"
- width="135" />
- </layout_panel>
+ height="172"
+ auto_resize="true"
+ name="ui_elastic_pad_left"
+ width="32" />
<layout_panel
- auto_resize="false"
- follows="left|bottom"
- name="links_login_panel"
- layout="topleft"
- width="290"
- height="80">
- <text
- follows="left|bottom"
- font="SansSerifSmall"
- text_color="EmphasisColor"
- left="10"
- height="16"
- name="login_help"
- top="19"
- width="280">
- Need help logging in?
- </text>
- <text
- follows="left|bottom"
- font="SansSerifSmall"
- text_color="EmphasisColor"
- height="16"
- name="forgot_password_text"
- top="35"
- width="280">
- Forgot your username or password?
- </text>
- <button
- follows="left|bottom"
- top_pad="0"
- height="23"
- image_unselected="PushButton_On"
- image_selected="PushButton_On_Selected"
- label="Log In"
- label_color="White"
- layout="topleft"
- name="connect_btn"
- width="90" />
- <check_box
- control_name="RememberPassword"
- follows="left|bottom"
- font="SansSerifSmall"
- left="110"
- top="56"
- height="16"
- label="Remember password"
- top_pad="3"
- name="remember_check"
- width="145" />
+ auto_resize="false"
+ follows="left|right|top"
+ name="ui_container"
+ width="960"
+ left="0"
+ top="0"
+ height="172">
+ <icon
+ height="73"
+ width="165"
+ image_name="login_sl_logo"
+ left="0"
+ top="25"
+ name="sl_logo_small" />
+ <combo_box
+ left_pad="22"
+ bottom_delta="-7"
+ allow_text_entry="true"
+ follows="left|top"
+ height="32"
+ label="Username"
+ combo_editor.font="SansSerifLarge"
+ max_chars="128"
+ commit_on_focus_lost="false"
+ combo_editor.prevalidate_callback="ascii"
+ tool_tip="The username you chose when you registered, like bobsmith12 or Steller Sunshine"
+ name="username_combo"
+ width="232">
+ <combo_box.combo_editor
+ text_pad_left="8" />
+ <combo_box.combo_button
+ visible="false" />
+ <combo_box.drop_down_button
+ visible="false" />
+ </combo_box>
+ <line_editor
+ follows="left|top"
+ height="32"
+ left_pad="0"
+ max_length_bytes="16"
+ text_pad_left="8"
+ name="password_edit"
+ label="Password"
+ font="SansSerifLarge"
+ is_password="true"
+ select_on_focus="true"
+ commit_on_focus_lost="false"
+ bottom_delta="0"
+ width="200" />
+ <check_box
+ control_name="RememberPassword"
+ follows="left|top"
+ font="SansSerifMedium"
+ left_pad="20"
+ bottom_delta="-14"
+ height="24"
+ label="Remember me"
+ check_button.bottom="3"
+ name="remember_check"
+ width="145" />
+ <text
+ follows="left|top"
+ font="SansSerifMedium"
+ text_color="EmphasisColor"
+ height="16"
+ name="forgot_password_text"
+ left_delta="0"
+ bottom_delta="16"
+ width="200">
+ Forgotten password
+ </text>
+ <button
+ follows="left|top"
+ image_unselected="PushButton_Login"
+ image_pressed="PushButton_Login_Pressed"
+ image_hover="PushButton_Login_Over"
+ label="Log In"
+ label_color="White"
+ font="SansSerifMedium"
+ name="connect_btn"
+ enabled="true"
+ left="0"
+ width="80"
+ height="26"
+ bottom_delta="44" />
+ <text
+ follows="left|top"
+ font="SansSerifLarge"
+ height="24"
+ name="At_My_Last_Location_Label"
+ left_pad="8"
+ bottom_delta="1"
+ width="120">
+ at last location
+ </text>
+ <combo_box
+ control_name="NextLoginLocation"
+ follows="left|top"
+ label="My favorite places"
+ height="26"
+ max_chars="128"
+ combo_editor.font="SansSerifMedium"
+ left_pad="20"
+ bottom_delta="0"
+ name="start_location_combo"
+ width="175"
+ combo_button.scale_image="true">
+ <combo_box.item
+ label="My home"
+ name="MyHome"
+ value="home" />
+ </combo_box>
+ <button
+ follows="left|top"
+ image_unselected="PushButton_Login"
+ image_pressed="PushButton_Login_Pressed"
+ image_hover="PushButton_Login_Over"
+ label="Log In"
+ label_color="White"
+ font="SansSerifMedium"
+ name="connect_favorite_btn"
+ left_pad="8"
+ width="80"
+ enabled="false"
+ height="26"
+ bottom_delta="0" />
+ <line_editor
+ follows="left|top"
+ width="170"
+ height="26"
+ left_pad="40"
+ text_pad_left="8"
+ name="location_edit"
+ label="Type a location"
+ font="SansSerifMedium"
+ select_on_focus="true"
+ commit_on_focus_lost="false"
+ bottom_delta="0" />
+ <button
+ follows="left|top"
+ image_unselected="PushButton_Login"
+ image_pressed="PushButton_Login_Pressed"
+ image_hover="PushButton_Login_Over"
+ label="Log In"
+ enabled="false"
+ label_color="White"
+ font="SansSerifMedium"
+ name="connect_location_btn"
+ left_pad="8"
+ width="80"
+ height="26"
+ bottom_delta="0" />
+ <combo_box
+ allow_text_entry="false"
+ font="SansSerifTiny"
+ follows="left|top"
+ height="26"
+ max_chars="128"
+ label="Select grid"
+ left_pad="40"
+ bottom_delta="0"
+ layout="topleft"
+ top_pad="2"
+ name="server_combo"
+ width="128" />
</layout_panel>
<layout_panel
- tab_stop="false"
- follows="right|bottom"
- name="links"
- width="210"
- min_width="100"
- height="80">
- <text
- follows="right|bottom"
- font="SansSerif"
- font.style="BOLD"
- font.size="Large"
- halign="right"
- height="16"
- name="create_account_text"
- top="8"
- right="-15"
- width="200">
- CREATE YOUR ACCOUNT
- </text>
- <button
- follows="right|bottom"
- top="35"
- right="-15"
- height="23"
- image_unselected="PushButton_On"
- image_selected="PushButton_On_Selected"
- label="Start now"
- label_color="White"
- layout="topleft"
- left_pad="10"
- name="create_new_account_btn"
- width="90" />
- </layout_panel>
+ height="172"
+ auto_resize="true"
+ name="ui_elastic_pad_right"
+ width="32" />
</layout_stack>
+ <web_browser
+ tab_stop="false"
+ trusted_content="true"
+ bg_opaque_color="Black"
+ border_visible="false"
+ follows="all"
+ left="0"
+ name="login_html"
+ start_url=""
+ top="154"
+ height="600"
+ width="1024" />
</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_login_first.xml b/indra/newview/skins/default/xui/en/panel_login_first.xml
new file mode 100644
index 0000000000..84753c55a3
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_login_first.xml
@@ -0,0 +1,265 @@
+<panel
+ follows="all"
+ height="768"
+ layout="topleft"
+ name="panel_login"
+ focus_root="true"
+ background_visible="true"
+ bg_opaque_color="0.16 0.16 0.16 1"
+ background_opaque="true"
+ width="1024">
+ <panel.string
+ name="forgot_password_url">
+ http://secondlife.com/account/request.php
+ </panel.string>
+ <layout_stack
+ follows="left|right|top|bottom"
+ width="1024"
+ height="768"
+ left="0"
+ name="logo_stack"
+ orientation="vertical"
+ top="0">
+ <layout_panel
+ height="18"
+ auto_resize="false"
+ name="page_top"
+ width="1024" />
+ <!-- start of logo stack -->
+ <layout_panel
+ height="130"
+ min_height="10"
+ auto_resize="false"
+ name="parent_panel"
+ width="1024">
+ <layout_stack
+ follows="left|right|top|bottom"
+ height="100"
+ left="0"
+ name="logo_stack"
+ orientation="horizontal"
+ top="0"
+ width="1024">
+ <layout_panel
+ height="110"
+ min_height="10"
+ auto_resize="true"
+ name="logo_left"
+ width="300" />
+ <layout_panel
+ auto_resize="false"
+ follows="left|right|top"
+ name="logo_container"
+ width="225"
+ left="0"
+ top="0"
+ height="105">
+ <icon
+ height="94"
+ image_name="login_sl_logo"
+ left="0"
+ name="sl_logo"
+ top="0" />
+ </layout_panel>
+ <layout_panel
+ height="100"
+ name="logo_right"
+ auto_resize="true"
+ width="300" />
+ </layout_stack>
+ </layout_panel>
+ <!-- end of logo stack -->
+ <!-- start of widget stack -->
+ <layout_panel
+ height="100"
+ min_height="10"
+ auto_resize="false"
+ name="parent_panel2"
+ width="1024">
+ <layout_stack
+ follows="left|right|top|bottom"
+ height="80"
+ left="0"
+ name="widget_stack"
+ orientation="horizontal"
+ top="0"
+ width="1024">
+ <layout_panel
+ height="80"
+ min_height="10"
+ auto_resize="true"
+ name="widget_left"
+ width="200" />
+ <layout_panel
+ auto_resize="false"
+ follows="left|right|top"
+ name="widget_container"
+ width="532"
+ left="0"
+ top="0"
+ height="80">
+ <combo_box
+ allow_text_entry="true"
+ follows="left|bottom"
+ height="32"
+ left="0"
+ label="Username"
+ combo_editor.font="SansSerifLarge"
+ max_chars="128"
+ top="0"
+ commit_on_focus_lost="false"
+ combo_editor.prevalidate_callback="ascii"
+ tool_tip="The username you chose when you registered, like bobsmith12 or Steller Sunshine"
+ name="username_combo"
+ width="232">
+ <combo_box.combo_editor
+ text_pad_left="8" />
+ <combo_box.combo_button
+ visible ="false"/>
+ <combo_box.drop_down_button
+ visible ="false"/>
+ </combo_box>
+ <line_editor
+ follows="left|top"
+ width="200"
+ height="32"
+ left="220"
+ max_length_bytes="16"
+ name="password_edit"
+ label="Password"
+ text_pad_left="8"
+ font="SansSerifLarge"
+ is_password="true"
+ select_on_focus="true"
+ commit_on_focus_lost="false"
+ top="0" />
+ <button
+ follows="left|top"
+ image_unselected="PushButton_Login"
+ image_pressed="PushButton_Login_Pressed"
+ image_hover="PushButton_Login_Over"
+ label="Log In"
+ label_color="White"
+ font="SansSerifLarge"
+ name="connect_btn"
+ left="432"
+ width="100"
+ height="32"
+ top="0" />
+ <check_box
+ control_name="RememberPassword"
+ follows="left|top"
+ font="SansSerifLarge"
+ left="0"
+ top="32"
+ height="24"
+ label="Remember me"
+ check_button.bottom="3"
+ name="remember_check"
+ width="145" />
+ <text
+ follows="left|top"
+ font="SansSerifLarge"
+ text_color="EmphasisColor"
+ height="16"
+ name="forgot_password_text"
+ left="216"
+ top="34"
+ width="200">
+ Forgotten password
+ </text>
+ </layout_panel>
+ <layout_panel
+ height="100"
+ name="widget_right"
+ auto_resize="true"
+ width="200" />
+ </layout_stack>
+ </layout_panel>
+ <!-- end of widget stack -->
+ <!-- start of images stack -->
+ <layout_panel
+ height="500"
+ min_height="10"
+ auto_resize="false"
+ name="parent_panel3"
+ width="1024">
+ <layout_stack
+ follows="left|right|top|bottom"
+ height="500"
+ left="0"
+ name="images_stack"
+ orientation="horizontal"
+ top="0"
+ width="1024">
+ <layout_panel
+ height="500"
+ min_height="10"
+ auto_resize="true"
+ name="images_left"
+ width="96" />
+ <layout_panel
+ auto_resize="false"
+ follows="left|right|top"
+ name="images_container"
+ width="832"
+ left="0"
+ top="0"
+ height="500">
+ <icon
+ height="400"
+ width="400"
+ image_name="first_login_image_left"
+ left="0"
+ name="image_left"
+ top="0" />
+ <icon
+ height="400"
+ width="400"
+ image_name="first_login_image_right"
+ left_pad="32"
+ name="image_right"
+ top="0" />
+ <text
+ follows="left|top"
+ font="SansSerifLarge"
+ text_color="White"
+ height="64"
+ name="image_caption_left"
+ left="0"
+ halign="center"
+ top="408"
+ word_wrap="true"
+ width="400">
+ Your first step is Learning Island. Find the exit portal!
+ </text>
+ <text
+ follows="left|top"
+ font="SansSerifLarge"
+ text_color="White"
+ height="64"
+ name="image_caption_right"
+ left="432"
+ halign="center"
+ top="408"
+ word_wrap="true"
+ width="400">
+ Then explore Social Island and meet other new residents!
+ </text>
+ </layout_panel>
+ <layout_panel
+ height="100"
+ name="images_right"
+ auto_resize="true"
+ width="96" />
+ </layout_stack>
+ </layout_panel>
+ <!-- end of images stack -->
+ <layout_panel
+ height="400"
+ min_height="10"
+ auto_resize="true"
+ name="page_bottom"
+ width="1024" />
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
index 1c882bb099..0518688f45 100755
--- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel
- default_tab_group="1"
follows="all"
height="423"
label="Things"
@@ -57,7 +56,6 @@
left="7"
name="inventory filter tabs"
tab_height="30"
- tab_group="1"
tab_position="top"
tab_min_width="100"
top_pad="10"
diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml
index 19143cef89..1e43db08f7 100755
--- a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel
- default_tab_group="1"
follows="left|bottom|right"
height="25"
layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml
index b61f110e32..3f13cea58e 100755
--- a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml
+++ b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml
@@ -12,32 +12,32 @@
name="outfit_edit"
top="0"
width="320">
- <string
- name="No Outfit"
- value="No Outfit"/>
- <string
- name="unsaved_changes"
- value="Unsaved Changes"/>
- <string
- name="now_editing"
- value="Now Editing"/>
- <string
- name="folder_view_off"
- value="Hierarchy_View_Disabled"
- translate="false"/>
- <string
- name="folder_view_on"
- value="Hierarchy_View_On"
- translate="false"/>
- <string
- name="list_view_off"
- value="List_View_Disabled"
- translate="false"/>
- <string
- name="list_view_on"
- value="List_View_On"
- translate="false"/>
-
+ <string
+ name="No Outfit"
+ value="No Outfit"/>
+ <string
+ name="unsaved_changes"
+ value="Unsaved Changes"/>
+ <string
+ name="now_editing"
+ value="Now Editing"/>
+ <string
+ name="folder_view_off"
+ value="Hierarchy_View_Disabled"
+ translate="false"/>
+ <string
+ name="folder_view_on"
+ value="Hierarchy_View_On"
+ translate="false"/>
+ <string
+ name="list_view_off"
+ value="List_View_Disabled"
+ translate="false"/>
+ <string
+ name="list_view_on"
+ value="List_View_On"
+ translate="false"/>
+
<panel.string
name="not_available">
(N\A)
@@ -47,475 +47,466 @@
(unknown)
</panel.string>
- <!-- Wearables filtering strings -->
- <string name="Filter.All" value="All"/>
- <string name="Filter.Clothes/Body" value="Clothes/Body"/>
- <string name="Filter.Objects" value="Objects"/>
- <string name="Filter.Clothing" value="Clothing"/>
- <string name="Filter.Bodyparts" value="Body parts"/>
+ <!-- Wearables filtering strings -->
+ <string name="Filter.All" value="All"/>
+ <string name="Filter.Clothes/Body" value="Clothes/Body"/>
+ <string name="Filter.Objects" value="Objects"/>
+ <string name="Filter.Clothing" value="Clothing"/>
+ <string name="Filter.Bodyparts" value="Body parts"/>
+
+ <string
+ name="replace_body_part"
+ value="Click to replace your existing shape"/>
- <string
- name="replace_body_part"
- value="Click to replace your existing shape"/>
-
- <button
- follows="top|left"
- height="24"
- image_hover_unselected="BackButton_Over"
- image_pressed="BackButton_Press"
- image_unselected="BackButton_Off"
- layout="topleft"
- name="back_btn"
- left="5"
- tab_stop="false"
- top="1"
- width="30"
- use_draw_context_alpha="false" />
- <text
- follows="top|left|right"
- font="SansSerifHugeBold"
- height="26"
- layout="topleft"
- left_pad="10"
- name="title"
- text_color="LtGray"
- top="0"
- value="Edit Outfit"
- use_ellipses="true"
- width="275" />
+ <button
+ follows="top|left"
+ height="24"
+ image_hover_unselected="BackButton_Over"
+ image_pressed="BackButton_Press"
+ image_unselected="BackButton_Off"
+ layout="topleft"
+ name="back_btn"
+ left="5"
+ tab_stop="false"
+ top="1"
+ width="30"
+ use_draw_context_alpha="false" />
+ <text
+ follows="top|left|right"
+ font="SansSerifHugeBold"
+ height="26"
+ layout="topleft"
+ left_pad="10"
+ name="title"
+ text_color="LtGray"
+ top="0"
+ value="Edit Outfit"
+ use_ellipses="true"
+ width="275" />
-<!-- "HEADER WITH ICON, STATUS TEXT AND OUTFIT NAME" -->
- <panel
- background_visible="true"
- bg_alpha_color="DkGray2"
- bevel_style="none"
- follows="top|left|right"
- height="40"
- layout="topleft"
- left="6"
- name="header_panel"
- top_pad="5"
- width="311">
- <icon
- follows="left|top"
- height="31"
- image_name="Shirt_Large"
- left="2"
- mouse_opaque="false"
- name="outfit_icon"
- top="2"
- scale_image="true"
- visible="true"
- width="31" />
- <panel
- bevel_style="none"
- follows="top|left|right"
- height="37"
- layout="topleft"
- left_pad="5"
- name="outfit_name_and_status"
- top="2"
- width="270">
- <text
- follows="top|left|right"
- font="SansSerifSmallBold"
- height="13"
- layout="topleft"
- name="status"
- text_color="EmphasisColor"
- top="2"
- value="Now editing..."
- use_ellipses="true"
- width="245" />
- <text
- follows="bottom|left|right"
- font="SansSerifLargeBold"
- height="18"
- layout="topleft"
- name="curr_outfit_name"
- parse_urls="false"
- text_color="LtGray"
- top_pad="2"
- value="[Current Outfit]"
- use_ellipses="true"
- width="245" />
- <loading_indicator
- follows="right|top"
- height="24"
- layout="topleft"
- right="-2"
- name="edit_outfit_loading_indicator"
- top="6"
- width="24" />
- </panel>
- </panel>
+ <!-- "HEADER WITH ICON, STATUS TEXT AND OUTFIT NAME" -->
+ <panel
+ background_visible="true"
+ bg_alpha_color="DkGray2"
+ bevel_style="none"
+ follows="top|left|right"
+ height="40"
+ layout="topleft"
+ left="6"
+ name="header_panel"
+ top_pad="5"
+ width="311">
+ <icon
+ follows="left|top"
+ height="31"
+ image_name="Shirt_Large"
+ left="2"
+ mouse_opaque="false"
+ name="outfit_icon"
+ top="2"
+ scale_image="true"
+ visible="true"
+ width="31" />
+ <panel
+ bevel_style="none"
+ follows="top|left|right"
+ height="37"
+ layout="topleft"
+ left_pad="5"
+ name="outfit_name_and_status"
+ top="2"
+ width="270">
+ <text
+ follows="top|left|right"
+ font="SansSerifSmallBold"
+ height="13"
+ layout="topleft"
+ name="status"
+ text_color="EmphasisColor"
+ top="2"
+ value="Now editing..."
+ use_ellipses="true"
+ width="245" />
+ <text
+ follows="bottom|left|right"
+ font="SansSerifLargeBold"
+ height="18"
+ layout="topleft"
+ name="curr_outfit_name"
+ parse_urls="false"
+ text_color="LtGray"
+ top_pad="2"
+ value="[Current Outfit]"
+ use_ellipses="true"
+ width="245" />
+ <loading_indicator
+ follows="right|top"
+ height="24"
+ layout="topleft"
+ right="-2"
+ name="edit_outfit_loading_indicator"
+ top="6"
+ width="24" />
+ </panel>
+ </panel>
-<!-- LIST OF WEARABLES (CURRENT OUTFIT/ WEARABLES TO ADD) -->
-<!-- *NOTE: border_size is used to calculate space between layout panels and also to calculate resize bar's height.
+ <!-- LIST OF WEARABLES (CURRENT OUTFIT/ WEARABLES TO ADD) -->
+ <!-- *NOTE: border_size is used to calculate space between layout panels and also to calculate resize bar's height.
Required height for dragbar (icon in spec) is 10, so resizebar height should be 10 px.
It is calculated as border_size + 2*UIResizeBarOverlap
-->
- <layout_stack
- animate="true"
- border_size="8"
- clip="false"
- default_tab_group="2"
- follows="all"
- height="465"
- width="313"
- layout="topleft"
- orientation="vertical"
- name="im_panels"
- tab_group="1"
- top_pad="5"
- left="5">
- <layout_panel
- layout="topleft"
- height="187"
- min_height="155"
- name="outfit_wearables_panel"
- width="313"
- auto_resize="true"
- user_resize="true">
+ <layout_stack
+ animate="true"
+ border_size="8"
+ clip="false"
+ default_tab_group="2"
+ follows="all"
+ height="465"
+ width="313"
+ layout="topleft"
+ orientation="vertical"
+ name="im_panels"
+ tab_group="1"
+ top_pad="5"
+ left="5">
+ <layout_panel
+ layout="topleft"
+ height="187"
+ min_height="155"
+ name="outfit_wearables_panel"
+ width="313"
+ auto_resize="true"
+ user_resize="true">
- <layout_stack
- animate="true"
- border_size="0"
- follows="all"
- height="185"
- width="313"
- orientation="vertical"
- layout="topleft"
- name="filter_panels"
- top="0"
- left="0">
- <layout_panel
- auto_resize="true"
- background_visible="false"
- layout="topleft"
- height="154"
- name="add_button_and_combobox"
- width="311"
- visible="true">
+ <layout_stack
+ animate="true"
+ border_size="0"
+ follows="all"
+ height="185"
+ width="313"
+ orientation="vertical"
+ layout="topleft"
+ name="filter_panels"
+ top="0"
+ left="0">
+ <layout_panel
+ auto_resize="true"
+ background_visible="false"
+ layout="topleft"
+ height="154"
+ name="add_button_and_combobox"
+ width="311"
+ visible="true">
- <!-- List containing items from the COF and Base outfit -->
- <panel
- background_visible="false"
- class="cof_wearables"
- filename="panel_cof_wearables.xml"
- follows="all"
- height="129"
- layout="topleft"
- left="1"
- name="cof_wearables_list"
- top="0"
- width="311" />
+ <!-- List containing items from the COF and Base outfit -->
+ <panel
+ background_visible="false"
+ class="cof_wearables"
+ filename="panel_cof_wearables.xml"
+ follows="all"
+ height="129"
+ layout="topleft"
+ left="1"
+ name="cof_wearables_list"
+ top="0"
+ width="311" />
- <button
- follows="left|bottom"
- height="22"
- image_pressed="PushButton_Press"
- image_pressed_selected="PushButton_Selected_Press"
- image_selected="PushButton_Selected_Press"
- is_toggle="true"
- label="Add More..."
- layout="topleft"
- left="2"
- name="show_add_wearables_btn"
- top_pad="2"
- tool_tip="Open/Close"
- width="125" />
+ <button
+ follows="left|bottom"
+ height="22"
+ image_pressed="PushButton_Press"
+ image_pressed_selected="PushButton_Selected_Press"
+ image_selected="PushButton_Selected_Press"
+ is_toggle="true"
+ label="Add More..."
+ layout="topleft"
+ left="2"
+ name="show_add_wearables_btn"
+ top_pad="2"
+ tool_tip="Open/Close"
+ width="125" />
- <combo_box
- follows="left|right|bottom"
- height="22"
- layout="topleft"
- left_pad="5"
- name="list_view_filter_combobox"
- top_delta="0"
- visible="false"
- width="152"/>
- <combo_box
- follows="left|right|bottom"
- height="22"
- layout="topleft"
- left_delta="0"
- name="folder_view_filter_combobox"
- top_delta="0"
- visible="false"
- width="152"/>
-
- <button
- follows="bottom|right"
- height="22"
- image_overlay="Search_Icon"
- image_pressed="PushButton_Press"
- image_pressed_selected="PushButton_Selected_Press"
- image_selected="PushButton_Selected_Press"
- is_toggle="true"
- layout="topleft"
- name="filter_button"
- right="-5"
- top_delta="0"
- visible="false"
- width="20" />
- </layout_panel>
+ <combo_box
+ follows="left|right|bottom"
+ height="22"
+ layout="topleft"
+ left_pad="5"
+ name="list_view_filter_combobox"
+ top_delta="0"
+ visible="false"
+ width="152"/>
+ <combo_box
+ follows="left|right|bottom"
+ height="22"
+ layout="topleft"
+ left_delta="0"
+ name="folder_view_filter_combobox"
+ top_delta="0"
+ visible="false"
+ width="152"/>
- <layout_panel
- auto_resize="false"
- background_visible="true"
- bg_alpha_color="DkGray2"
- height="30"
- name="filter_panel"
- width="311"
- visible="false">
+ <button
+ follows="bottom|right"
+ height="22"
+ image_overlay="Search_Icon"
+ image_pressed="PushButton_Press"
+ image_pressed_selected="PushButton_Selected_Press"
+ image_selected="PushButton_Selected_Press"
+ is_toggle="true"
+ layout="topleft"
+ name="filter_button"
+ right="-5"
+ top_delta="0"
+ visible="false"
+ width="20" />
+ </layout_panel>
- <filter_editor
- background_image="TextField_Search_Off"
- enabled="true"
- follows="left|right|top"
- label="Filter Inventory Wearables"
- layout="topleft"
- left="5"
- width="290"
- height="25"
- name="look_item_filter"
- search_button_visible="true"
- text_color="black"
- visible="true"/>
-
- </layout_panel>
- </layout_stack>
- </layout_panel>
+ <layout_panel
+ auto_resize="false"
+ background_visible="true"
+ bg_alpha_color="DkGray2"
+ height="30"
+ name="filter_panel"
+ width="311"
+ visible="false">
+ <filter_editor
+ background_image="TextField_Search_Off"
+ enabled="true"
+ follows="left|right|top"
+ label="Filter Inventory Wearables"
+ layout="topleft"
+ left="5"
+ width="290"
+ height="25"
+ name="look_item_filter"
+ search_button_visible="true"
+ text_color="black"
+ visible="true"/>
- <layout_panel
- background_visible="false"
- bg_alpha_color="DkGray2"
- auto_resize="true"
- default_tab_group="3"
- height="450"
- min_height="80"
- name="add_wearables_panel"
- width="313"
- tab_group="2"
- user_resize="true"
- visible="false">
+ </layout_panel>
+ </layout_stack>
+ </layout_panel>
+
+
+ <layout_panel background_visible="false"
+ bg_alpha_color="DkGray2"
+ auto_resize="true"
+ height="450"
+ min_height="80"
+ name="add_wearables_panel"
+ width="313"
+ tab_group="2"
+ user_resize="true"
+ visible="false">
<!-- this icon represent dragbar between layout panels.
This is a workaround implemented in EXT-7255 becouse of an issue with layout stack (EXT-7471) -->
- <icon
- follows="left|top|right"
- height="10"
- image_name="Dragbar"
- left="0"
- top_pad="-9"
- width="313" />
+ <icon follows="left|top|right"
+ height="10"
+ image_name="Dragbar"
+ left="0"
+ top_pad="-9"
+ width="313" />
+ <inventory_panel allow_multi_select="true"
+ background_visible="false"
+ border="false"
+ follows="left|top|right|bottom"
+ height="418"
+ layout="topleft"
+ left="0"
+ mouse_opaque="false"
+ name="folder_view"
+ top_pad="0"
+ width="313"
+ visible="false"/>
+ <panel name="filtered_wearables_panel"
+ background_opaque="true"
+ background_visible="false"
+ layout="topleft"
+ follows="left|top|right|bottom"
+ border="false"
+ height="418"
+ left="0"
+ mouse_opaque="false"
+ width="310"
+ top_delta="0"
+ visible="true">
+ <wearable_items_list color="0.107 0.107 0.107 1"
+ name="list_view"
+ allow_select="true"
+ layout="topleft"
+ follows="all"
+ multi_select="true"
+ width="313"
+ height="418"
+ left="0"
+ top="0"/>
+ </panel>
+ <button follows="bottom|left"
+ height="22"
+ left="2"
+ label="Wear Item"
+ layout="topleft"
+ name="plus_btn"
+ top_pad="5"
+ width="130" />
+ </layout_panel>
+ </layout_stack>
- <inventory_panel
- allow_multi_select="true"
- background_visible="false"
- border="false"
- follows="left|top|right|bottom"
- height="418"
- layout="topleft"
- left="0"
- mouse_opaque="false"
- name="folder_view"
- top_pad="0"
- width="313"
- visible="false"/>
- <panel
- name="filtered_wearables_panel"
- background_opaque="true"
- background_visible="false"
- layout="topleft"
- follows="left|top|right|bottom"
- border="false"
- height="418"
- left="0"
- mouse_opaque="false"
- width="310"
- top_delta="0"
- visible="true">
- <wearable_items_list
- color="0.107 0.107 0.107 1"
- name="list_view"
- allow_select="true"
- layout="topleft"
- follows="all"
- multi_select="true"
- width="313"
- height="418"
- left="0"
- top="0"/>
- </panel>
- <button
- follows="bottom|left"
- height="22"
- left="2"
- label="Wear Item"
- layout="topleft"
- name="plus_btn"
- top_pad="5"
- width="130" />
- </layout_panel>
- </layout_stack>
+ <!-- BUTTON BAR -->
+ <panel
+ background_visible="true"
+ bevel_style="none"
+ follows="bottom|left|right"
+ height="27"
+ layout="topleft"
+ left="5"
+ name="no_add_wearables_button_bar"
+ top_pad="0"
+ width="313">
+ <menu_button
+ follows="bottom|left"
+ height="25"
+ image_hover_unselected="Toolbar_Left_Over"
+ image_overlay="OptionsMenu_Off"
+ image_selected="Toolbar_Left_Selected"
+ image_unselected="Toolbar_Left_Off"
+ layout="topleft"
+ left="0"
+ name="gear_menu_btn"
+ top="1"
+ width="31" />
+ <icon
+ follows="bottom|left|right"
+ height="25"
+ image_name="Toolbar_Middle_Off"
+ layout="topleft"
+ left_pad="1"
+ name="dummy_right_icon"
+ width="250" />
+ <button
+ follows="bottom|right"
+ height="25"
+ image_hover_unselected="Toolbar_Right_Over"
+ image_overlay="Shop"
+ image_selected="Toolbar_Right_Selected"
+ image_unselected="Toolbar_Right_Off"
+ layout="topleft"
+ left_pad="1"
+ name="shop_btn_1"
+ top="1"
+ tool_tip="Visit the SL Marketplace. You can also select something you are wearing, then click here to see more things like it"
+ width="31" />
+ </panel>
- <!-- BUTTON BAR -->
- <panel
- background_visible="true"
- bevel_style="none"
- follows="bottom|left|right"
- height="27"
- layout="topleft"
- left="5"
- name="no_add_wearables_button_bar"
- top_pad="0"
- width="313">
- <menu_button
- follows="bottom|left"
- height="25"
- image_hover_unselected="Toolbar_Left_Over"
- image_overlay="OptionsMenu_Off"
- image_selected="Toolbar_Left_Selected"
- image_unselected="Toolbar_Left_Off"
- layout="topleft"
- left="0"
- name="gear_menu_btn"
- top="1"
- width="31" />
- <icon
- follows="bottom|left|right"
- height="25"
- image_name="Toolbar_Middle_Off"
- layout="topleft"
- left_pad="1"
- name="dummy_right_icon"
- width="250" />
- <button
- follows="bottom|right"
- height="25"
- image_hover_unselected="Toolbar_Right_Over"
- image_overlay="Shop"
- image_selected="Toolbar_Right_Selected"
- image_unselected="Toolbar_Right_Off"
- layout="topleft"
- left_pad="1"
- name="shop_btn_1"
- top="1"
- tool_tip="Visit the SL Marketplace. You can also select something you are wearing, then click here to see more things like it"
- width="31" />
- </panel>
-
-
- <!-- BUTTON BAR - WEARABLES ADDING MODE -->
- <panel
- background_visible="true"
- bevel_style="none"
- follows="left|right|bottom"
- height="27"
- layout="topleft"
- left="5"
- name="add_wearables_button_bar"
- top_delta="0"
- visible="false"
- width="313">
- <menu_button
- follows="bottom|left"
- height="25"
- image_hover_unselected="Toolbar_Left_Over"
- image_overlay="OptionsMenu_Off"
- image_selected="Toolbar_Left_Selected"
- image_unselected="Toolbar_Left_Off"
- layout="topleft"
- left="0"
- name="wearables_gear_menu_btn"
- top="1"
- width="31" />
- <button
- follows="bottom|left"
- height="25"
- image_hover_unselected="Toolbar_Middle_Over"
- image_overlay="Hierarchy_View_Disabled"
- image_selected="Toolbar_Middle_Selected"
- image_unselected="Toolbar_Middle_Off"
- is_toggle="true"
- layout="topleft"
- left_pad="1"
- name="folder_view_btn"
- top="1"
- width="31" />
- <button
- follows="bottom|left"
- height="25"
- image_hover_unselected="Toolbar_Middle_Over"
- image_overlay="List_View_On"
- image_selected="Toolbar_Middle_Selected"
- image_unselected="Toolbar_Middle_Off"
- is_toggle="true"
- layout="topleft"
- left_pad="1"
- name="list_view_btn"
- top="1"
- width="31" />
- <icon
- follows="bottom|left|right"
- height="25"
- image_name="Toolbar_Middle_Off"
- layout="topleft"
- left_pad="1"
- name="dummy_right_icon"
- width="186" >
- </icon>
- <button
- follows="bottom|right"
- height="25"
- image_hover_unselected="Toolbar_Right_Over"
- image_overlay="Shop"
- image_selected="Toolbar_Right_Selected"
- image_unselected="Toolbar_Right_Off"
- layout="topleft"
- left_pad="1"
- name="shop_btn_2"
- top="1"
- tool_tip="Visit the SL Marketplace. You can also select something you are wearing, then click here to see more things like it"
- width="31" />
- </panel>
+ <!-- BUTTON BAR - WEARABLES ADDING MODE -->
+ <panel
+ background_visible="true"
+ bevel_style="none"
+ follows="left|right|bottom"
+ height="27"
+ layout="topleft"
+ left="5"
+ name="add_wearables_button_bar"
+ top_delta="0"
+ visible="false"
+ width="313">
+ <menu_button
+ follows="bottom|left"
+ height="25"
+ image_hover_unselected="Toolbar_Left_Over"
+ image_overlay="OptionsMenu_Off"
+ image_selected="Toolbar_Left_Selected"
+ image_unselected="Toolbar_Left_Off"
+ layout="topleft"
+ left="0"
+ name="wearables_gear_menu_btn"
+ top="1"
+ width="31" />
+ <button
+ follows="bottom|left"
+ height="25"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="Hierarchy_View_Disabled"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ is_toggle="true"
+ layout="topleft"
+ left_pad="1"
+ name="folder_view_btn"
+ top="1"
+ width="31" />
+ <button
+ follows="bottom|left"
+ height="25"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="List_View_On"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ is_toggle="true"
+ layout="topleft"
+ left_pad="1"
+ name="list_view_btn"
+ top="1"
+ width="31" />
+ <icon
+ follows="bottom|left|right"
+ height="25"
+ image_name="Toolbar_Middle_Off"
+ layout="topleft"
+ left_pad="1"
+ name="dummy_right_icon"
+ width="186" >
+ </icon>
+ <button
+ follows="bottom|right"
+ height="25"
+ image_hover_unselected="Toolbar_Right_Over"
+ image_overlay="Shop"
+ image_selected="Toolbar_Right_Selected"
+ image_unselected="Toolbar_Right_Off"
+ layout="topleft"
+ left_pad="1"
+ name="shop_btn_2"
+ top="1"
+ tool_tip="Visit the SL Marketplace. You can also select something you are wearing, then click here to see more things like it"
+ width="31" />
+ </panel>
- <!-- SAVE AND REVERT BUTTONS -->
- <panel
- follows="left|right|bottom"
- height="30"
- layout="topleft"
- left="4"
- top_pad="2"
- name="save_revert_button_bar"
- width="300">
- <layout_stack
- follows="bottom|left|right"
- height="23"
- layout="topleft"
- mouse_opaque="false"
- name="button_bar_ls"
- left="0"
- orientation="horizontal"
- top="0"
- width="313">
- <layout_panel
- follows="bottom|left|right"
- height="23"
- layout="bottomleft"
- left="0"
- mouse_opaque="false"
- name="save_btn_lp"
- auto_resize="true"
- width="156">
- <button
+ <!-- SAVE AND REVERT BUTTONS -->
+ <panel
+ follows="left|right|bottom"
+ height="30"
+ layout="topleft"
+ left="4"
+ top_pad="2"
+ name="save_revert_button_bar"
+ width="300">
+ <layout_stack
+ follows="bottom|left|right"
+ height="23"
+ layout="topleft"
+ mouse_opaque="false"
+ name="button_bar_ls"
+ left="0"
+ orientation="horizontal"
+ top="0"
+ width="313">
+ <layout_panel
+ follows="bottom|left|right"
+ height="23"
+ layout="bottomleft"
+ left="0"
+ mouse_opaque="false"
+ name="save_btn_lp"
+ auto_resize="true"
+ width="156">
+ <button
follows="bottom|left|right"
height="23"
label="Save"
@@ -524,7 +515,7 @@ It is calculated as border_size + 2*UIResizeBarOverlap
name="save_btn"
top="0"
width="155" />
- <button
+ <button
follows="bottom|right"
height="23"
name="save_flyout_btn"
@@ -539,17 +530,17 @@ It is calculated as border_size + 2*UIResizeBarOverlap
image_pressed_selected="SegmentedBtn_Right_Selected_Press"
image_overlay="Arrow_Small_Up"
width="20"/>
- </layout_panel>
- <layout_panel
- follows="bottom|left|right"
- height="23"
- layout="bottomleft"
- left_pad="3"
- mouse_opaque="false"
- name="revert_btn_lp"
- auto_resize="true"
- width="147">
- <button
+ </layout_panel>
+ <layout_panel
+ follows="bottom|left|right"
+ height="23"
+ layout="bottomleft"
+ left_pad="3"
+ mouse_opaque="false"
+ name="revert_btn_lp"
+ auto_resize="true"
+ width="147">
+ <button
follows="bottom|left|right"
height="23"
left="0"
@@ -559,7 +550,7 @@ It is calculated as border_size + 2*UIResizeBarOverlap
top="0"
tool_tip="Revert to last saved version"
width="147" />
- </layout_panel>
- </layout_stack>
- </panel>
+ </layout_panel>
+ </layout_stack>
+ </panel>
</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml
index d2caf63052..2d4665c128 100755
--- a/indra/newview/skins/default/xui/en/panel_people.xml
+++ b/indra/newview/skins/default/xui/en/panel_people.xml
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<!-- Side tray panel -->
<panel
- default_tab_group="1"
follows="all"
height="449"
label="People"
@@ -60,7 +59,6 @@ Looking for people to hang out with? Try the [secondlife:///app/worldmap World M
layout="topleft"
left="3"
name="tabs"
- tab_group="1"
tab_min_width="70"
tab_height="30"
tab_position="top"
diff --git a/indra/newview/skins/default/xui/en/panel_place_profile.xml b/indra/newview/skins/default/xui/en/panel_place_profile.xml
index 308acf0c0c..0dd75b1b55 100755
--- a/indra/newview/skins/default/xui/en/panel_place_profile.xml
+++ b/indra/newview/skins/default/xui/en/panel_place_profile.xml
@@ -220,7 +220,7 @@
<layout_stack
border_size="0"
clip="false"
- follows="left|top|right"
+ follows="left|top"
height="50"
layout="topleft"
mouse_opaque="false"
@@ -251,10 +251,10 @@
</layout_panel>
<layout_panel
follows="left|right"
- height="60"
+ height="50"
layout="topleft"
min_height="50"
- min_width="60"
+ min_width="50"
mouse_opaque="false"
name="for_sale_panel"
top="0"
@@ -264,7 +264,7 @@
height="50"
image_name="ForSale_Badge"
layout="topleft"
- left="10"
+ left="0"
name="icon_for_sale"
top="0"
width="50" />
@@ -295,14 +295,14 @@
value="SampleParcel, Name Long (145, 228, 26)"
width="285" />
<expandable_text
- follows="left|top|right"
+ follows="left|top"
height="50"
layout="topleft"
left="5"
name="description"
top_pad="10"
value="Du waltz die spritz"
- width="300" />
+ width="285" />
<text
follows="left|top"
height="14"
@@ -762,11 +762,19 @@
top_pad="5"
value="Rating:"
width="80" />
+ <icon
+ follows="top|left"
+ height="16"
+ image_name="Parcel_PG_Dark"
+ layout="topleft"
+ left_pad="0"
+ name="estate_rating_icon"
+ width="18" />
<text
follows="left|top|right"
height="15"
layout="topleft"
- left_pad="0"
+ left_pad="10"
name="estate_rating"
top_delta="0"
width="187" />
diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml
index f169dbb702..7d171490e8 100755
--- a/indra/newview/skins/default/xui/en/panel_places.xml
+++ b/indra/newview/skins/default/xui/en/panel_places.xml
@@ -27,6 +27,7 @@ background_visible="true"
label="Filter My Places"
max_length_chars="300"
name="Filter"
+ tab_group="1"
top="3"
width="303" />
<tab_container
@@ -39,7 +40,7 @@ background_visible="true"
tab_min_width="80"
tab_max_width="157"
tab_height="30"
- tab_group="1"
+ tab_group="2"
tab_position="top"
top_pad="10"
width="315" />
diff --git a/indra/newview/skins/default/xui/en/panel_postcard_message.xml b/indra/newview/skins/default/xui/en/panel_postcard_message.xml
index ab2a42ea01..331a08b4bb 100755
--- a/indra/newview/skins/default/xui/en/panel_postcard_message.xml
+++ b/indra/newview/skins/default/xui/en/panel_postcard_message.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel
- height="380"
+ height="319"
layout="topleft"
name="panel_postcard_message"
width="490">
@@ -12,7 +12,7 @@
font="SansSerif"
height="16"
layout="topleft"
- left="12"
+ left="5"
name="to_label"
top="10"
width="60">
@@ -25,7 +25,7 @@
layout="topleft"
left_pad="10"
name="to_form"
- right="-10"
+ right="-3"
top_delta="-4" />
<text
type="string"
@@ -35,7 +35,7 @@
font="SansSerif"
height="16"
layout="topleft"
- left="12"
+ left="5"
name="name_label"
width="60">
From:
@@ -47,7 +47,7 @@
left_pad="10"
max_length_bytes="100"
name="name_form"
- right="-10"
+ right="-3"
top_delta="-4" />
<text
type="string"
@@ -57,7 +57,7 @@
font="SansSerif"
height="16"
layout="topleft"
- left="12"
+ left="5"
name="subject_label"
width="60">
Subject:
@@ -65,61 +65,24 @@
<line_editor
follows="left|top|right"
height="20"
- label="Type your subject here."
layout="topleft"
left_pad="10"
max_length_bytes="100"
name="subject_form"
- right="-10"
+ right="-3"
top_delta="-4" />
- <text
- type="string"
- length="1"
- bottom_delta="23"
- follows="top|left|right"
- font="SansSerif"
- layout="topleft"
- left="12"
- name="msg_label"
- right="-10">
- Message:
- </text>
<text_editor
type="string"
length="1"
follows="left|top|right"
- height="60"
+ height="48"
layout="topleft"
- left_delta="0"
+ left="5"
max_length="700"
name="msg_form"
- right="-10"
- top_pad="10"
+ right="-4"
+ top_pad="5"
word_wrap="true">
Type your message here.
</text_editor>
- <button
- follows="right|bottom"
- height="23"
- label="Cancel"
- layout="topleft"
- name="cancel_btn"
- right="-32"
- top="350"
- width="100">
- <button.commit_callback
- function="Postcard.Cancel" />
- </button>
- <button
- follows="right|bottom"
- height="23"
- label="Send"
- layout="topleft"
- left_delta="-106"
- name="send_btn"
- top_delta="0"
- width="100">
- <button.commit_callback
- function="Postcard.Send" />
- </button>
</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
index 3f67a48b14..525149d7ee 100755
--- a/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
+++ b/indra/newview/skins/default/xui/en/panel_postcard_settings.xml
@@ -9,10 +9,10 @@
height="23"
label="Resolution"
layout="topleft"
- left="10"
+ left="5"
name="postcard_size_combo"
- right="-10"
- top_pad="10">
+ right="-3"
+ top_pad="5">
<combo_box.item
label="Current Window"
name="CurrentWindow"
@@ -34,103 +34,55 @@
name="Custom"
value="[i-1,i-1]" />
</combo_box>
- <layout_stack
- animate="false"
- follows="all"
- height="275"
- layout="bottomleft"
- name="postcard_image_params_ls"
- left_delta="0"
- orientation="vertical"
- top_pad="10"
- right="-10">
- <layout_panel
- follows="top|left|right"
- height="60"
- layout="topleft"
- left="0"
- name="postcard_image_size_lp"
- auto_resize="false"
- top="0"
- right="-1"
- visible="true">
- <spinner
- allow_text_entry="false"
- decimal_digits="0"
- follows="left|top"
- height="20"
- increment="32"
- label="Width"
- label_width="40"
- layout="topleft"
- left="10"
- max_val="6016"
- min_val="32"
- name="postcard_snapshot_width"
- top_pad="10"
- width="95" />
- <spinner
- allow_text_entry="false"
- decimal_digits="0"
- follows="left|top"
- height="20"
- increment="32"
- label="Height"
- label_width="40"
- layout="topleft"
- left_pad="5"
- max_val="6016"
- min_val="32"
- name="postcard_snapshot_height"
- top_delta="0"
- width="95" />
- <check_box
- height="10"
- bottom_delta="20"
- follows="left|top"
- label="Constrain proportions"
- layout="topleft"
- left="10"
- name="postcard_keep_aspect_check" />
- </layout_panel>
- <layout_panel
- follows="top|left|right"
- height="23"
- layout="topleft"
- left="0"
- name="postcard_image_format_quality_lp"
- auto_resize="true"
- top="0"
- right="-1"
- visible="true">
- <slider
- decimal_digits="0"
- follows="left|top"
- height="15"
- increment="1"
- initial_value="75"
- label="Image quality"
- label_width="80"
- layout="topleft"
- left="0"
- max_val="100"
- name="image_quality_slider"
- top_pad="7"
- width="190" />
- <text
- type="string"
- follows="left|top"
- font="SansSerifSmall"
- length="1"
- height="14"
- layout="topleft"
- left_pad="-5"
- halign="left"
- name="image_quality_level"
- top_delta="0"
- width="60">
- ([QLVL])
- </text>
- </layout_panel>
- </layout_stack>
+ <spinner
+ allow_text_entry="false"
+ decimal_digits="0"
+ follows="left|top"
+ height="20"
+ increment="32"
+ label="Width x Height"
+ label_width="90"
+ layout="topleft"
+ left="5"
+ max_val="6016"
+ min_val="32"
+ name="postcard_snapshot_width"
+ top_pad="5"
+ width="144" />
+ <spinner
+ allow_text_entry="false"
+ decimal_digits="0"
+ follows="left|top"
+ height="20"
+ increment="32"
+ label=""
+ label_width="0"
+ layout="topleft"
+ left_pad="0"
+ max_val="6016"
+ min_val="32"
+ name="postcard_snapshot_height"
+ top_delta="0"
+ width="52" />
+ <check_box
+ top_pad="12"
+ follows="left|top"
+ label="Constrain proportions"
+ layout="topleft"
+ left="5"
+ name="postcard_keep_aspect_check" />
+ <slider
+ decimal_digits="0"
+ follows="left|top"
+ height="15"
+ increment="1"
+ initial_value="75"
+ label="Quality:"
+ label_width="45"
+ layout="topleft"
+ left="5"
+ max_val="100"
+ name="image_quality_slider"
+ top_pad="6"
+ width="190" />
</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml
index 50fd57494f..2e778014c5 100755
--- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml
@@ -222,4 +222,15 @@
name="show_develop_menu_check"
top_pad="5"
width="237"/>
+ <button
+ height="20"
+ label="Default Creation Permissions"
+ layout="topleft"
+ name="default_creation_permissions"
+ left="30"
+ top_pad = "20"
+ width="250">
+ <button.commit_callback
+ function="Pref.PermsDefault" />
+ </button>
</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml
index ea0f7d8593..9da044ab64 100755
--- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml
@@ -179,46 +179,29 @@
left_pad="2"
name="rating_icon_adult"
width="18"/>
- <text
- type="string"
- length="1"
- follows="left|top"
- height="15"
- layout="topleft"
- left="30"
- name="start_location_textbox"
- top_pad="8"
- width="394">
- Start location:
- </text>
- <combo_box
- control_name="LoginLocation"
- follows="left|top"
- height="23"
- layout="topleft"
- name="start_location_combo"
- left="50"
- width="200">
- <combo_box.item
- label="My Last Location"
- name="MyLastLocation"
- value="last" />
- <combo_box.item
- label="My Home"
- name="MyHome"
- value="home" />
- </combo_box>
- <check_box
- control_name="ShowStartLocation"
- height="16"
- initial_value="true"
- label="Show on login"
- layout="topleft"
- left_pad="5"
- name="show_location_checkbox"
- top_delta="5"
- width="256" />
- <text
+ <check_box
+ control_name="ShowFavoritesOnLogin"
+ enabled="false"
+ height="16"
+ layout="topleft"
+ label="Show favorite locations on login screen"
+ left="30"
+ name="favorites_on_login_check"
+ top_pad="10"
+ width="350" />
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="52"
+ name="favorites_check_extra_text"
+ top_pad="0"
+ width="400">
+ (Others using this computer will also see them)
+ </text>
+ <text
type="string"
length="1"
follows="left|top"
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml
index 78743d26bb..323da2be38 100755
--- a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml
@@ -47,7 +47,7 @@
<check_box
height="16"
enabled="false"
- label="Show me in Search results"
+ label="Show my profile info in Search results"
layout="topleft"
left="30"
name="online_searchresults"
@@ -74,17 +74,6 @@
name="auto_disengage_mic_check"
top_pad="10"
width="350" />
- <check_box
- control_name="ShowFavoritesOnLogin"
- enabled="false"
- height="16"
- layout="topleft"
- label="Show my Favorite Landmarks at Login (via &apos;Start At&apos; drop-down menu)"
- left="30"
- name="favorites_on_login_check"
- top_pad="10"
- width="350" />
-
<button
follows="left|bottom"
height="23"
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
index dd4533ae74..1e9a1aa27c 100755
--- a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
@@ -106,7 +106,7 @@
width="300">
Web:
</text>
- <radio_group
+ <!-- <radio_group
control_name="UseExternalBrowser"
draw_border="false"
follows="top|left"
@@ -136,6 +136,48 @@
tool_tip="Use the built-in web browser for help, web links, etc. This browser opens as a new window inside [APP_NAME]."
top_delta="20"
width="480" />
+ </radio_group> -->
+
+ <radio_group
+ control_name="PreferredBrowserBehavior"
+ draw_border="false"
+ follows="left|top"
+ height="60"
+ layout="topleft"
+ left_delta="50"
+ name="preferred_browser_behavior"
+ top_pad="0"
+ width="480">
+ <radio_item
+ height="20"
+ label="Use my browser (Chrome, Firefox, IE) for all links"
+ layout="topleft"
+ left="0"
+ name="internal"
+ value="0"
+ tool_tip="Use the default system web browser for help, web links, etc. Not recommended if running full screen."
+ top="0"
+ width="480" />
+ <radio_item
+ height="20"
+ label="Use built-in browser for Second Life links only"
+ layout="topleft"
+ left_delta="0"
+ name="external"
+ value="1"
+ tool_tip="Use the default system web browser for help, web links, etc. Builtin browser will be used only for LindenLab/SecondLife links."
+ top_delta="20"
+ width="480" />
+ <radio_item
+ height="20"
+ label="Use built-in browser for all links"
+ layout="topleft"
+ left="0"
+ name="internal"
+ value="2"
+ tool_tip="Use the built-in web browser for help, web links, etc. This browser opens as a new window inside [APP_NAME]."
+ top_delta="20"
+ width="480" />
</radio_group>
<check_box
diff --git a/indra/newview/skins/default/xui/en/panel_region_debug.xml b/indra/newview/skins/default/xui/en/panel_region_debug.xml
index 81b2281adb..fea5f1b19f 100755
--- a/indra/newview/skins/default/xui/en/panel_region_debug.xml
+++ b/indra/newview/skins/default/xui/en/panel_region_debug.xml
@@ -201,4 +201,14 @@
tool_tip="Cancel region restart"
top_delta="0"
width="150" />
+ <button
+ follows="left|top"
+ height="20"
+ label="Region Debug Console"
+ layout="topleft"
+ left="10"
+ name="region_debug_console_btn"
+ tool_tip="Open Region Debug Console"
+ top_pad="5"
+ width="150" />
</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_region_general.xml b/indra/newview/skins/default/xui/en/panel_region_general.xml
index 44c84e69a1..489d286e67 100755
--- a/indra/newview/skins/default/xui/en/panel_region_general.xml
+++ b/indra/newview/skins/default/xui/en/panel_region_general.xml
@@ -94,11 +94,20 @@
width="80" />
<check_box
height="20"
+ label="Block Parcel Fly Over"
+ layout="topleft"
+ left="10"
+ name="block_fly_over_check"
+ tool_tip="Extend access checks upwards to prevent flying over a parcel"
+ top="110"
+ width="90" />
+ <check_box
+ height="20"
label="Allow Damage"
layout="topleft"
left="10"
name="allow_damage_check"
- top="110"
+ top="130"
width="80" />
<check_box
height="20"
@@ -106,7 +115,7 @@
layout="topleft"
left="10"
name="restrict_pushobject"
- top="130"
+ top="150"
width="80" />
<check_box
height="20"
@@ -114,7 +123,7 @@
layout="topleft"
left="10"
name="allow_land_resell_check"
- top="150"
+ top="170"
width="80" />
<check_box
height="20"
@@ -122,7 +131,7 @@
layout="topleft"
left="10"
name="allow_parcel_changes_check"
- top="170"
+ top="190"
width="80" />
<check_box
height="20"
@@ -131,7 +140,7 @@
left="10"
name="block_parcel_search_check"
tool_tip="Let people see this region and its parcels in search results"
- top="190"
+ top="210"
width="80" />
<spinner
decimal_digits="0"
@@ -145,7 +154,7 @@
max_val="100"
min_val="1"
name="agent_limit_spin"
- top="240"
+ top="260"
width="170" />
<spinner
follows="left|top"
@@ -158,7 +167,7 @@
max_val="10"
min_val="1"
name="object_bonus_spin"
- top="260"
+ top="280"
width="170" />
<text
follows="left|top"
@@ -167,7 +176,7 @@
layout="topleft"
left="10"
name="access_text"
- top="290"
+ top="310"
width="100">
Rating:
</text>
@@ -224,7 +233,7 @@
layout="topleft"
left="108"
name="apply_btn"
- top="320"
+ top="340"
width="100"/>
<button
follows="left|top"
diff --git a/indra/newview/skins/default/xui/en/panel_script_ed.xml b/indra/newview/skins/default/xui/en/panel_script_ed.xml
index bcdef96138..eb1b954e61 100755
--- a/indra/newview/skins/default/xui/en/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/en/panel_script_ed.xml
@@ -70,6 +70,16 @@
label="Save to file..."
layout="topleft"
name="SaveToFile" />
+ <menu_item_separator
+ layout="topleft" />
+ <menu_item_call
+ label="Colors..."
+ layout="topleft"
+ name="Colors">
+ <menu_item_call.on_click
+ function="Floater.Toggle"
+ parameter="script_colors"/>
+ </menu_item_call>
</menu>
<menu
top="0"
@@ -148,8 +158,8 @@
name="Keyword Help..." />
</menu>
</menu_bar>
- <text_editor
- left="0"
+ <script_editor
+ left="0"
type="string"
length="1"
follows="left|top|right|bottom"
@@ -157,15 +167,21 @@
height="376"
ignore_tab="false"
layout="topleft"
- max_length="65536"
+ max_length="262144"
name="Script Editor"
- text_readonly_color="DkGray"
width="487"
- show_line_numbers="true"
+ text_color="ScriptText"
+ default_color="ScriptText"
+ bg_writeable_color="ScriptBackground"
+ bg_focus_color="ScriptBackground"
+ text_readonly_color="ScriptText"
+ bg_readonly_color="ScriptBackground"
+ cursor_color="ScriptCursorColor"
enable_tooltip_paste="true"
- word_wrap="true">
+ word_wrap="true"
+ show_context_menu="true">
Loading...
- </text_editor>
+ </script_editor>
<scroll_list
top_pad="10"
left="0"
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
index 71d808fa4b..ea579c6dae 100755
--- a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
@@ -12,12 +12,12 @@
left="12"
mouse_opaque="true"
name="title_icon"
- top="5"
+ top="6"
width="18" />
<text
follows="top|left|right"
font="SansSerifBold"
- height="20"
+ height="14"
layout="topleft"
left_pad="12"
length="1"
@@ -25,46 +25,28 @@
right="-10"
text_color="white"
type="string"
- top_delta="5">
- Save to My Inventory
+ top_delta="3">
+ Inventory
</text>
<view_border
bevel_style="in"
follows="left|top|right"
height="1"
- left="10"
+ left="9"
layout="topleft"
name="hr"
- right="-10"
+ right="-5"
top_pad="5"
/>
- <text
- bottom="35"
- follows="top|left|right"
- font="SansSerif"
- height="56"
- layout="topleft"
- left="12"
- length="1"
- name="hint_lbl"
- top_pad="10"
- type="string"
- word_wrap="true">
- Saving an image to your inventory costs L$[UPLOAD_COST]. To save your image as a texture select one of the square formats.
- </text>
<combo_box
follows="top|left|right"
- height="23"
+ height="20"
label="Resolution"
layout="topleft"
left_delta="0"
name="texture_size_combo"
- right="-10"
- top_pad="10">
- <combo_box.item
- label="Current Window"
- name="CurrentWindow"
- value="[i0,i0]" />
+ right="-5"
+ top_pad="5">
<combo_box.item
label="Small (128x128)"
name="Small(128x128)"
@@ -88,61 +70,74 @@
follows="left|top"
height="20"
increment="32"
- label="Width"
- label_width="40"
+ label="Width x Height"
+ label_width="90"
layout="topleft"
left="10"
max_val="6016"
min_val="32"
name="inventory_snapshot_width"
- top_pad="10"
- width="95" />
+ top_pad="7"
+ width="144" />
<spinner
allow_text_entry="false"
decimal_digits="0"
follows="left|top"
height="20"
increment="32"
- label="Height"
- label_width="40"
+ label=""
+ label_width="0"
layout="topleft"
- left_pad="5"
+ left_pad="0"
max_val="6016"
min_val="32"
name="inventory_snapshot_height"
top_delta="0"
- width="95" />
+ width="54" />
<check_box
- bottom_delta="20"
- height="10"
+ top_pad="12"
follows="left|top"
label="Constrain proportions"
layout="topleft"
left="10"
name="inventory_keep_aspect_check"
visible="false" />
+ <text
+ follows="top|left"
+ font="SansSerif"
+ height="56"
+ layout="topleft"
+ left="10"
+ length="1"
+ name="hint_lbl"
+ top_pad="6"
+ width="200"
+ type="string"
+ word_wrap="true">
+ Saving an image to your inventory costs L$[UPLOAD_COST]. To save your image as a texture select one of the square formats.
+ </text>
<button
follows="right|bottom"
height="23"
label="Cancel"
layout="topleft"
name="cancel_btn"
- right="-32"
- top="350"
- width="100">
+ right="-5"
+ top="337"
+ width="97">
<button.commit_callback
function="Inventory.Cancel" />
</button>
<button
- follows="right|bottom"
+ follows="left|bottom"
height="23"
label="Save"
layout="topleft"
- left_delta="-106"
+ left="10"
name="save_btn"
top_delta="0"
- width="100">
+ width="97">
<button.commit_callback
function="Inventory.Save" />
</button>
-</panel>
+</panel> \ No newline at end of file
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
index 781ab17403..188c9f8707 100755
--- a/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_local.xml
@@ -12,12 +12,12 @@
left="12"
mouse_opaque="true"
name="title_icon"
- top="5"
+ top="7"
width="18" />
<text
follows="top|left|right"
font="SansSerifBold"
- height="20"
+ height="14"
layout="topleft"
left_pad="12"
length="1"
@@ -25,28 +25,27 @@
right="-10"
text_color="white"
type="string"
- top_delta="4">
- Save to My Computer
+ top_delta="2">
+ Disk
</text>
<view_border
bevel_style="in"
follows="left|top|right"
height="1"
- left="10"
+ left="9"
layout="topleft"
name="hr"
- right="-10"
- top_pad="5"
- />
+ right="-5"
+ top_pad="5"/>
<combo_box
follows="left|top|right"
- height="23"
+ height="20"
label="Resolution"
layout="topleft"
left_delta="0"
name="local_size_combo"
- right="-10"
- top_pad="10">
+ right="-5"
+ top_pad="5">
<combo_box.item
label="Current Window"
name="CurrentWindow"
@@ -80,149 +79,114 @@
name="Custom"
value="[i-1,i-1]" />
</combo_box>
- <layout_stack
- animate="false"
- follows="all"
- height="275"
- layout="bottomleft"
- name="local_image_params_ls"
- left_delta="0"
- orientation="vertical"
- top_pad="10"
- right="-10">
- <layout_panel
- follows="top|left|right"
- height="60"
- layout="topleft"
- left="0"
- name="local_image_size_lp"
- auto_resize="false"
- top="0"
- right="-1"
- visible="true">
- <spinner
- allow_text_entry="false"
- decimal_digits="0"
- follows="left|top"
- height="20"
- increment="32"
- label="Width"
- label_width="40"
- layout="topleft"
- left="10"
- max_val="6016"
- min_val="32"
- name="local_snapshot_width"
- top_pad="10"
- width="95" />
- <spinner
- allow_text_entry="false"
- decimal_digits="0"
- follows="left|top"
- height="20"
- increment="32"
- label="Height"
- label_width="40"
- layout="topleft"
- left_pad="5"
- max_val="6016"
- min_val="32"
- name="local_snapshot_height"
- top_delta="0"
- width="95" />
- <check_box
- bottom_delta="20"
- height="10"
- follows="left|top"
- label="Constrain proportions"
- layout="topleft"
- left="10"
- name="local_keep_aspect_check" />
- </layout_panel>
- <layout_panel
- follows="top|left|right"
- height="23"
- layout="topleft"
- left="0"
- name="local_image_format_quality_lp"
- auto_resize="true"
- top="0"
- right="-1"
- visible="true">
- <combo_box
- follows="left|top"
- height="23"
- label="Format"
- layout="topleft"
- left_delta="0"
- name="local_format_combo"
- top_pad="0"
- width="120">
- <combo_box.item
- label="PNG (Lossless)"
- name="PNG"
- value="PNG" />
- <combo_box.item
- label="JPEG"
- name="JPEG"
- value="JPEG" />
- <combo_box.item
- label="BMP (Lossless)"
- name="BMP"
- value="BMP" />
- </combo_box>
- <slider
- decimal_digits="0"
- follows="left|top"
- height="15"
- increment="1"
- initial_value="75"
- label="Image quality"
- label_width="80"
- layout="topleft"
- left="10"
- max_val="100"
- name="image_quality_slider"
- top_pad="7"
- width="200" />
- <text
- type="string"
- follows="left|top"
- font="SansSerifSmall"
- length="1"
- height="14"
- layout="topleft"
- left_pad="-5"
- halign="left"
- name="image_quality_level"
- top_delta="0"
- width="60">
- ([QLVL])
- </text>
- </layout_panel>
- </layout_stack>
+ <spinner
+ allow_text_entry="false"
+ decimal_digits="0"
+ follows="left|top"
+ height="20"
+ increment="32"
+ label="Width x Height"
+ label_width="90"
+ layout="topleft"
+ left="10"
+ max_val="6016"
+ min_val="32"
+ name="local_snapshot_width"
+ top_pad="7"
+ width="144" />
+ <spinner
+ allow_text_entry="false"
+ decimal_digits="0"
+ follows="left|top"
+ height="20"
+ increment="32"
+ label=""
+ label_width="0"
+ layout="topleft"
+ left_pad="0"
+ max_val="6016"
+ min_val="32"
+ name="local_snapshot_height"
+ top_delta="0"
+ width="54" />
+ <check_box
+ top_pad="12"
+ follows="left|top"
+ label="Constrain proportions"
+ layout="topleft"
+ left="10"
+ name="local_keep_aspect_check" />
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="13"
+ layout="topleft"
+ left="10"
+ name="local_format_label"
+ top_pad="7"
+ width="50">
+ Format:
+ </text>
+ <combo_box
+ follows="left|top|right"
+ height="20"
+ label="Format"
+ layout="topleft"
+ left="65"
+ right="-5"
+ name="local_format_combo"
+ top_delta="-3"
+ width="120">
+ <combo_box.item
+ label="PNG (Lossless)"
+ name="PNG"
+ value="PNG" />
+ <combo_box.item
+ label="JPEG"
+ name="JPEG"
+ value="JPEG" />
+ <combo_box.item
+ label="BMP (Lossless)"
+ name="BMP"
+ value="BMP" />
+ </combo_box>
+ <slider
+ decimal_digits="0"
+ follows="left|top"
+ height="15"
+ increment="1"
+ initial_value="75"
+ label="Quality:"
+ label_width="45"
+ layout="topleft"
+ left="10"
+ max_val="100"
+ name="image_quality_slider"
+ top_pad="6"
+ width="203" />
<button
follows="right|bottom"
height="23"
label="Cancel"
layout="topleft"
name="cancel_btn"
- right="-32"
- top="350"
- width="100">
+ right="-5"
+ top="337"
+ width="97">
<button.commit_callback
function="Local.Cancel" />
</button>
<flyout_button
- follows="right|bottom"
+ follows="left|bottom"
height="23"
label="Save"
layout="topleft"
- left_delta="-106"
+ left="10"
name="save_btn"
tool_tip="Save image to a file"
top_delta="0"
- width="100">
+ width="97">
<flyout_button.item
label="Save"
name="save_item"
@@ -232,4 +196,4 @@
name="saveas_item"
value="save as" />
</flyout_button>
-</panel>
+</panel> \ No newline at end of file
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
index 61c8c971c2..265217ef60 100755
--- a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
@@ -4,81 +4,124 @@
height="240"
layout="topleft"
name="panel_snapshot_options"
- width="490">
+ width="208">
+ <button
+ follows="left|top"
+ font="SansSerif"
+ halign="left"
+ height="22"
+ image_overlay="Snapshot_Download"
+ image_overlay_alignment="left"
+ image_top_pad="-0"
+ imgoverlay_label_space="10"
+ label="Save to Disk"
+ layout="topleft"
+ left="9"
+ name="save_to_computer_btn"
+ top_pad="9">
+ <button.commit_callback
+ function="Snapshot.SaveToComputer" />
+ </button>
<button
- follows="left|top|right"
+ follows="left|top"
font="SansSerif"
halign="left"
- height="38"
- image_overlay="Snapshot_Profile"
+ height="22"
+ image_overlay="Snapshot_Inventory"
image_overlay_alignment="left"
- image_top_pad="-2"
+ image_top_pad="-1"
imgoverlay_label_space="10"
- label="Post to My Profile Feed"
+ label="Save to Inventory (L$[AMOUNT])"
layout="topleft"
left_delta="0"
+ name="save_to_inventory_btn"
+ top_pad="5">
+ <button.commit_callback
+ function="Snapshot.SaveToInventory" />
+ </button>
+ <button
+ follows="left|top"
+ font="SansSerif"
+ halign="left"
+ height="22"
+ image_overlay="Snapshot_Profile"
+ image_overlay_alignment="left"
+ image_top_pad="-1"
+ imgoverlay_label_space="10"
+ label="Upload to Profile"
+ layout="topleft"
name="save_to_profile_btn"
- pad_left="10"
- right="-10"
- top_pad="10">
+ left_delta="0"
+ top_pad="5">
<button.commit_callback
function="Snapshot.SaveToProfile" />
</button>
<button
- follows="left|top|right"
+ follows="left|top"
font="SansSerif"
halign="left"
- height="38"
- image_overlay="Snapshot_Email"
+ height="22"
+ image_overlay="Snapshot_Facebook"
image_overlay_alignment="left"
- image_top_pad="-2"
+ image_top_pad="0"
imgoverlay_label_space="10"
- label="Email"
+ label="Upload to Facebook"
layout="topleft"
left_delta="0"
- name="save_to_email_btn"
- pad_left="10"
- right="-10"
- top_pad="10">
+ name="send_to_facebook_btn"
+ top_pad="5">
<button.commit_callback
- function="Snapshot.SaveToEmail" />
+ function="Snapshot.SendToFacebook"/>
</button>
<button
- follows="left|top|right"
+ follows="left|top"
font="SansSerif"
halign="left"
- height="38"
- image_overlay="Snapshot_Inventory"
+ height="22"
+ image_overlay="Command_Twitter_Icon"
image_overlay_alignment="left"
- image_top_pad="-2"
+ image_top_pad="0"
imgoverlay_label_space="10"
- label="Save to My Inventory (L$[AMOUNT])"
+ label="Upload to Twitter"
layout="topleft"
left_delta="0"
- name="save_to_inventory_btn"
- pad_left="10"
- right="-10"
- top_pad="10">
+ name="send_to_twitter_btn"
+ top_pad="5">
<button.commit_callback
- function="Snapshot.SaveToInventory" />
+ function="Snapshot.SendToTwitter"/>
</button>
<button
- follows="left|top|right"
+ follows="left|top"
font="SansSerif"
halign="left"
- height="38"
- image_overlay="Snapshot_Download"
+ height="22"
+ image_overlay="Command_Flickr_Icon"
image_overlay_alignment="left"
- image_top_pad="-2"
+ image_top_pad="0"
imgoverlay_label_space="10"
- label="Save to My Computer"
+ label="Upload to Flickr"
layout="topleft"
left_delta="0"
- name="save_to_computer_btn"
- pad_left="10"
- right="-10"
- top_pad="10">
+ name="send_to_flickr_btn"
+ top_pad="5">
<button.commit_callback
- function="Snapshot.SaveToComputer" />
+ function="Snapshot.SendToFlickr"/>
+ </button>
+ <button
+ follows="left|top"
+ font="SansSerif"
+ halign="left"
+ height="22"
+ image_overlay="Snapshot_Email"
+ image_overlay_alignment="left"
+ image_top_pad="0"
+ imgoverlay_label_space="10"
+ label="Send via E-mail"
+ layout="topleft"
+ left_delta="0"
+ name="save_to_email_btn"
+ top_pad="5">
+ <button.commit_callback
+ function="Snapshot.SaveToEmail" />
</button>
-</panel>
+</panel> \ No newline at end of file
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml b/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml
index ebba292a93..975b08be05 100755
--- a/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_postcard.xml
@@ -24,12 +24,12 @@
left="12"
mouse_opaque="true"
name="title_icon"
- top="5"
+ top="7"
width="18" />
<text
follows="top|left|right"
font="SansSerifBold"
- height="20"
+ height="14"
layout="topleft"
left_pad="12"
length="1"
@@ -37,63 +37,67 @@
right="-10"
text_color="white"
type="string"
- top_delta="3">
- Email
+ top_delta="2">
+ E-mail
</text>
- <button
- follows="right|top"
- height="23"
- is_toggle="true"
- label="Message"
- layout="topleft"
- name="message_btn"
- right="-82"
- top_delta="-7"
- width="70">
- <button.commit_callback
- function="Postcard.Message" />
- </button>
- <button
- follows="right|top"
- height="23"
- is_toggle="true"
- label="Settings"
- layout="topleft"
- name="settings_btn"
- top_delta="0"
- right="-10"
- width="70">
- <button.commit_callback
- function="Postcard.Settings" />
- </button>
<view_border
bevel_style="in"
follows="left|top|right"
height="1"
- left="10"
+ left="9"
layout="topleft"
name="hr"
- right="-10"
+ right="-5"
top_pad="5"
/>
- <panel_container
+ <tab_container
+ name="postcard_tabs"
+ tab_group="1"
+ tab_min_width="97"
+ tab_height="21"
+ tab_position="top"
+ top_pad="7"
+ left="5"
+ right="-2"
+ height="319"
follows="all"
- height="340"
- layout="topleft"
- left="0"
- name="postcard_panel_container"
- default_panel_name="panel_postcard_message"
- top_pad="10"
- width="490">
+ halign="center"
+ use_highlighting_on_hover="true">
<panel
follows="all"
layout="topleft"
+ label="Message"
name="panel_postcard_message"
filename="panel_postcard_message.xml" />
<panel
follows="all"
layout="topleft"
+ label="Settings"
name="panel_postcard_settings"
filename="panel_postcard_settings.xml" />
- </panel_container>
-</panel>
+ </tab_container>
+ <button
+ follows="right|bottom"
+ height="23"
+ label="Cancel"
+ layout="topleft"
+ name="cancel_btn"
+ right="-6"
+ bottom="-20"
+ width="97">
+ <button.commit_callback
+ function="Postcard.Cancel" />
+ </button>
+ <button
+ follows="left|bottom"
+ height="23"
+ label="Send"
+ layout="topleft"
+ left="10"
+ name="send_btn"
+ top_delta="0"
+ width="97">
+ <button.commit_callback
+ function="Postcard.Send" />
+ </button>
+</panel> \ No newline at end of file
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
index 0dd357aa1a..d86cb92981 100755
--- a/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_profile.xml
@@ -12,12 +12,12 @@
left="12"
mouse_opaque="true"
name="title_icon"
- top="5"
+ top="7"
width="18" />
<text
follows="top|left|right"
font="SansSerifBold"
- height="20"
+ height="14"
layout="topleft"
left_pad="12"
length="1"
@@ -26,27 +26,28 @@
text_color="white"
type="string"
top_delta="4">
- Post to My Profile Feed
+ Profile
</text>
<view_border
bevel_style="in"
follows="left|top|right"
height="1"
- left="10"
+ left="9"
layout="topleft"
name="hr"
- right="-10"
+ right="-5"
top_pad="5"
/>
<combo_box
- follows="left|top"
+ follows="left|top|right"
height="23"
label="Resolution"
layout="topleft"
- left_delta="0"
+ left="10"
+ right="-5"
name="profile_size_combo"
- top_pad="10"
- width="250">
+ top_pad="5"
+ width="180">
<combo_box.item
label="Current Window"
name="CurrentWindow"
@@ -68,132 +69,99 @@
name="Custom"
value="[i-1,i-1]" />
</combo_box>
- <layout_stack
- animate="false"
- follows="all"
- height="270"
- layout="bottomleft"
- name="profile_image_params_ls"
+ <spinner
+ allow_text_entry="false"
+ decimal_digits="0"
+ follows="left|top"
+ height="20"
+ increment="32"
+ label="Width x Height"
+ label_width="90"
+ layout="topleft"
+ left="10"
+ max_val="6016"
+ min_val="32"
+ name="profile_snapshot_width"
+ top_pad="7"
+ width="144" />
+ <spinner
+ allow_text_entry="false"
+ decimal_digits="0"
+ follows="left|top"
+ height="20"
+ increment="32"
+ label=""
+ label_width="0"
+ layout="topleft"
+ left_pad="0"
+ max_val="6016"
+ min_val="32"
+ name="profile_snapshot_height"
+ top_delta="0"
+ width="54" />
+ <check_box
+ top_pad="12"
+ label="Constrain proportions"
+ layout="topleft"
+ left="10"
+ name="profile_keep_aspect_check" />
+ <text
+ length="1"
+ follows="top|left|right"
+ height="16"
+ layout="topleft"
+ left="12"
+ name="caption_label"
+ right="-10"
+ top_pad="4"
+ type="string">
+ Caption:
+ </text>
+ <text_editor
+ follows="top|left|right"
+ height="35"
+ layout="topleft"
+ left="10"
+ right="-5"
+ length="1"
+ max_length="700"
+ name="caption"
+ width="200"
+ top_pad="2"
+ type="string"
+ word_wrap="true">
+ </text_editor>
+ <check_box
+ follows="left|top"
+ initial_value="true"
+ label="Include location"
+ layout="topleft"
left_delta="0"
- orientation="vertical"
- top_pad="10"
- right="-10">
- <layout_panel
- follows="top|left|right"
- height="55"
- layout="topleft"
- left="0"
- name="profile_image_size_lp"
- auto_resize="false"
- top="0"
- right="-1"
- visible="true">
- <spinner
- allow_text_entry="false"
- decimal_digits="0"
- follows="left|top"
- height="20"
- increment="32"
- label="Width"
- label_width="40"
- layout="topleft"
- left="10"
- max_val="6016"
- min_val="32"
- name="profile_snapshot_width"
- top_pad="10"
- width="95" />
- <spinner
- allow_text_entry="false"
- decimal_digits="0"
- follows="left|top"
- height="20"
- increment="32"
- label="Height"
- label_width="40"
- layout="topleft"
- left_pad="5"
- max_val="6016"
- min_val="32"
- name="profile_snapshot_height"
- top_delta="0"
- width="95" />
- <check_box
- height="10"
- bottom_delta="20"
- label="Constrain proportions"
- layout="topleft"
- left="10"
- name="profile_keep_aspect_check" />
- </layout_panel>
- <layout_panel
- follows="top|left|right"
- height="200"
- layout="topleft"
- left="0"
- name="profile_image_metadata_lp"
- auto_resize="true"
- top="0"
- right="-1"
- visible="true">
- <text
- length="1"
- follows="top|left|right"
- font="SansSerif"
- height="16"
- layout="topleft"
- left="0"
- name="caption_label"
- right="-10"
- top_pad="0"
- type="string">
- Caption:
- </text>
- <text_editor
- follows="all"
- height="155"
- layout="topleft"
- left_delta="0"
- length="1"
- max_length="700"
- name="caption"
- right="-10"
- top_pad="5"
- type="string"
- word_wrap="true">
- </text_editor>
- <check_box
- follows="left|bottom"
- initial_value="true"
- label="Include location"
- layout="topleft"
- left_delta="0"
- name="add_location_cb"
- top_pad="15" />
- </layout_panel>
- </layout_stack>
+ height="18"
+ name="add_location_cb"
+ top_pad="3" />
<button
follows="right|bottom"
height="23"
label="Cancel"
layout="topleft"
name="cancel_btn"
- right="-32"
- top="350"
- width="100">
+ right="-5"
+ top="337"
+ width="97">
<button.commit_callback
function="PostToProfile.Cancel" />
</button>
<button
- follows="right|bottom"
+ follows="left|bottom"
height="23"
label="Post"
layout="topleft"
- left_delta="-106"
+ left="10"
name="post_btn"
top_delta="0"
- width="100">
+ width="97">
<button.commit_callback
function="PostToProfile.Send" />
</button>
-</panel>
+</panel> \ No newline at end of file
diff --git a/indra/newview/skins/default/xui/en/panel_social_status.xml b/indra/newview/skins/default/xui/en/panel_social_status.xml
deleted file mode 100644
index 54cfa3f524..0000000000
--- a/indra/newview/skins/default/xui/en/panel_social_status.xml
+++ /dev/null
@@ -1,67 +0,0 @@
- <panel
- height="400"
- width="304"
- layout="topleft"
- name="panel_social_status">
- <layout_stack
- layout="topleft"
- border_size="0"
- height="392"
- follows="all"
- orientation="vertical"
- name="stack_status"
- top="8">
- <layout_panel
- name="status_detail_panel"
- height="367">
- <text
- length="1"
- follows="top|left|right"
- font="SansSerif"
- height="16"
- left="9"
- name="status_caption_label"
- top="13"
- type="string">
- What's on your mind?
- </text>
- <text_editor
- follows="left|top"
- height="150"
- width="250"
- left="9"
- length="1"
- max_length="700"
- name="status_message"
- type="string"
- word_wrap="true">
- </text_editor>
- </layout_panel>
- <layout_panel
- name="status_button_panel"
- height="25">
- <button
- follows="left|top"
- top="0"
- left="9"
- height="23"
- label="Post"
- name="post_status_btn"
- width="100">
- <button.commit_callback
- function="SocialSharing.SendStatus" />
- </button>
- <button
- follows="left|top"
- height="23"
- label="Cancel"
- name="cancel_status_btn"
- left_pad="15"
- top_delta="0"
- width="100">
- <button.commit_callback
- function="SocialSharing.Cancel" />
- </button>
- </layout_panel>
- </layout_stack>
- </panel>
diff --git a/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml b/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml
index c5b0be0616..26cac06648 100755
--- a/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml
+++ b/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml
@@ -47,7 +47,20 @@
text_color="White"
top="4"
value="..."
- width="330" />
+ width="290" />
+ <text
+ follows="right"
+ height="20"
+ layout="topleft"
+ left_pad="5"
+ right="-20"
+ parse_urls="false"
+ use_ellipses="true"
+ name="timestamp"
+ text_color="White"
+ top="4"
+ value="..."
+ width="45" />
<button
follows="right"
height="20"
diff --git a/indra/newview/skins/default/xui/en/panel_tools_texture.xml b/indra/newview/skins/default/xui/en/panel_tools_texture.xml
index 426c0c4915..cb6b2fafd8 100644
--- a/indra/newview/skins/default/xui/en/panel_tools_texture.xml
+++ b/indra/newview/skins/default/xui/en/panel_tools_texture.xml
@@ -36,8 +36,9 @@
<color_swatch
can_apply_immediately="true"
follows="left|top"
- height="45"
+ height="22"
label=""
+ label_height="0"
layout="topleft"
left="10"
name="colorswatch"
diff --git a/indra/newview/skins/default/xui/en/panel_twitter_account.xml b/indra/newview/skins/default/xui/en/panel_twitter_account.xml
new file mode 100644
index 0000000000..b9049a0bba
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_twitter_account.xml
@@ -0,0 +1,81 @@
+<panel
+ height="400"
+ width="272"
+ layout="topleft"
+ name="panel_twitter_account">
+ <string
+ name="twitter_connected"
+ value="You are connected to Twitter as:" />
+ <string
+ name="twitter_disconnected"
+ value="Not connected to Twitter" />
+ <text
+ layout="topleft"
+ length="1"
+ follows="top|left"
+ font="SansSerif"
+ height="16"
+ left="10"
+ name="account_caption_label"
+ top="5"
+ type="string">
+ Not connected to Twitter.
+ </text>
+ <text
+ layout="topleft"
+ top_pad="2"
+ length="1"
+ follows="top|left"
+ font="SansSerif"
+ height="16"
+ left="10"
+ name="account_name_label"
+ parse_urls="true"
+ type="string"/>
+ <panel
+ layout="topleft"
+ follows="top|left"
+ name="panel_buttons"
+ height="345"
+ top_pad="3"
+ left="0">
+ <button
+ layout="topleft"
+ follows="left|top|right"
+ top_pad="9"
+ left="10"
+ right="-10"
+ visible="true"
+ height="23"
+ label="Connect..."
+ name="connect_btn"
+ width="210">
+ <commit_callback function="SocialSharing.Connect"/>
+ </button>
+
+ <button
+ layout="topleft"
+ follows="left|top|right"
+ top_delta="0"
+ left="10"
+ right="-10"
+ height="23"
+ label="Disconnect"
+ name="disconnect_btn"
+ width="210"
+ visible="false">
+ <commit_callback function="SocialSharing.Disconnect"/>
+ </button>
+ <text
+ layout="topleft"
+ length="1"
+ follows="top|left"
+ height="16"
+ left="10"
+ name="account_learn_more_label"
+ top_pad="5"
+ type="string">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Twitter/ta-p/2435453 Learn about posting to Twitter]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_twitter_photo.xml b/indra/newview/skins/default/xui/en/panel_twitter_photo.xml
new file mode 100644
index 0000000000..9a460ceead
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_twitter_photo.xml
@@ -0,0 +1,195 @@
+ <panel
+ height="420"
+ width="304"
+ layout="topleft"
+ name="panel_twitter_photo">
+ <text
+ length="1"
+ layout="topleft"
+ follows="top|left|right"
+ font="SansSerif"
+ height="16"
+ left="10"
+ name="status_label"
+ top="5"
+ type="string">
+ What's happening?
+ </text>
+ <text
+ length="1"
+ follows="top|left"
+ layout="topleft"
+ font="SansSerif"
+ text_color="EmphasisColor"
+ halign="right"
+ height="16"
+ width="30"
+ left="227"
+ name="status_counter_label"
+ top="5"
+ type="string">
+ 140
+ </text>
+ <text_editor
+ follows="left|top"
+ layout="topleft"
+ height="87"
+ width="250"
+ left="10"
+ length="1"
+ max_length="140"
+ name="photo_status"
+ type="string"
+ word_wrap="true">
+ </text_editor>
+ <check_box
+ follows="left|top"
+ layout="topleft"
+ initial_value="true"
+ label="Include SL location"
+ name="add_location_cb"
+ left="10"
+ height="16"
+ top_pad="8"/>
+ <check_box
+ follows="left|top"
+ layout="topleft"
+ initial_value="true"
+ label="Include a photo"
+ name="add_photo_cb"
+ left="10"
+ height="16"
+ top_pad="1"/>
+ <combo_box
+ control_name="TwitterPhotoResolution"
+ follows="left|top"
+ layout="topleft"
+ top_pad="5"
+ left="10"
+ name="resolution_combobox"
+ tool_tip="Image resolution"
+ height="21"
+ width="124">
+ <combo_box.item
+ label="Current Window"
+ name="CurrentWindow"
+ value="[i0,i0]" />
+ <combo_box.item
+ label="640x480"
+ name="640x480"
+ value="[i640,i480]" />
+ <combo_box.item
+ label="800x600"
+ name="800x600"
+ value="[i800,i600]" />
+ <combo_box.item
+ label="1024x768"
+ name="1024x768"
+ value="[i1024,i768]" />
+ </combo_box>
+ <combo_box
+ control_name="TwitterPhotoFilters"
+ follows="right|top"
+ layout="topleft"
+ name="filters_combobox"
+ tool_tip="Image filters"
+ top_delta="0"
+ right="-10"
+ height="21"
+ width="124">
+ <combo_box.item
+ label="No Filter"
+ name="NoFilter"
+ value="NoFilter" />
+ </combo_box>
+ <panel
+ layout="topleft"
+ height="150"
+ width="250"
+ visible="true"
+ name="thumbnail_placeholder"
+ top_pad="5"
+ right="-10"
+ follows="left|top|right"
+ left="10">
+ </panel>
+ <text
+ follows="left|top"
+ layout="topleft"
+ font="SansSerif"
+ text_color="EmphasisColor"
+ height="14"
+ top_pad="2"
+ left="10"
+ length="1"
+ halign="center"
+ name="working_lbl"
+ translate="false"
+ type="string"
+ visible="true"
+ width="251">
+ Refreshing...
+ </text>
+ <view_border
+ bevel_style="in"
+ follows="left|top"
+ layout="topleft"
+ height="1"
+ left="10"
+ name="refresh_border"
+ width="250"
+ top_pad="0"/>
+ <button
+ follows="left|top"
+ layout="topleft"
+ height="23"
+ label="Refresh"
+ left="10"
+ top_pad="5"
+ name="new_snapshot_btn"
+ tool_tip="Click to refresh"
+ visible="true"
+ width="100" >
+ <button.commit_callback
+ function="SocialSharing.RefreshPhoto" />
+ </button>
+ <button
+ follows="right|top"
+ layout="topleft"
+ height="23"
+ label="Preview"
+ right="-10"
+ top_delta="0"
+ name="big_preview_btn"
+ tool_tip="Click to toggle preview"
+ is_toggle="true"
+ visible="true"
+ width="100" >
+ <button.commit_callback
+ function="SocialSharing.BigPreview" />
+ </button>
+ <button
+ follows="left|top"
+ layout="topleft"
+ top_pad="3"
+ left="10"
+ height="23"
+ label="Tweet"
+ name="post_photo_btn"
+ width="100">
+ <button.commit_callback
+ function="SocialSharing.SendPhoto" />
+ </button>
+ <button
+ follows="right|top"
+ layout="topleft"
+ height="23"
+ label="Cancel"
+ name="cancel_photo_btn"
+ right="-10"
+ top_delta="0"
+ width="100">
+ <button.commit_callback
+ function="SocialSharing.Cancel" />
+ </button>
+ </panel>
diff --git a/indra/newview/skins/default/xui/en/role_actions.xml b/indra/newview/skins/default/xui/en/role_actions.xml
index 0eeccbeac5..1044cbfd2e 100755
--- a/indra/newview/skins/default/xui/en/role_actions.xml
+++ b/indra/newview/skins/default/xui/en/role_actions.xml
@@ -9,7 +9,10 @@
<action description="Eject Members from this Group"
longdescription="Eject Members from this Group using the &apos;Eject&apos; button in the Roles section &gt; Members tab. An Owner can eject anyone except another Owner. If you&apos;re not an Owner, a Member can be ejected from a group if, and only if, they&apos;re only in the Everyone Role, and NO other Roles. To remove Members from Roles, you need to have the &apos;Remove Members from Roles&apos; Ability."
name="member eject" value="2" />
- <action
+ <action description="Manage ban list"
+ longdescription="Allows the group member to ban / un-ban Residents from this group."
+ name="allow ban" value="51" />
+ <action
description="Toggle &apos;Open Enrollment&apos; and change &apos;Enrollment fee&apos;"
longdescription="Toggle &apos;Open Enrollment&apos; to let new Members join without an invitation, and change the &apos;Enrollment fee&apos; in the General section."
name="member options" value="3" />
diff --git a/indra/newview/skins/default/xui/en/script_editor.xml b/indra/newview/skins/default/xui/en/script_editor.xml
new file mode 100644
index 0000000000..f1c6161711
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/script_editor.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<script_editor
+ name="script_editor"
+ parse_urls="false"
+ show_context_menu="true"
+ show_line_numbers="true"
+ text_color="ScriptText"
+ default_color="ScriptText"
+ bg_writeable_color="ScriptBackground"
+ bg_focus_color="ScriptBackground">
+</script_editor>
diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
index 14bd349480..d3e24a19ef 100755
--- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
@@ -12,17 +12,19 @@
follows="all"
layout="topleft"
left="0"
- name="sidepanel__inventory_panel"
+ name="sidepanel_inventory_panel"
top="0"
label=""
height="570"
visible="true"
+ default_tab_group="1"
width="330">
- <layout_stack
+ <layout_stack
follows="left|right|top|bottom"
layout="topleft"
left="0"
top="0"
+ tab_group="1"
orientation="vertical"
name="inventory_layout_stack"
height="535"
@@ -75,7 +77,7 @@
<button
control_name="InventoryInboxToggleState"
label="Received items"
- font="SansSerifMedium"
+ font="SansSerifMedium"
name="inbox_btn"
height="35"
width="308"
@@ -116,61 +118,56 @@
background_opaque="true"
tool_tip="Drag and drop items to your inventory to use them"
>
- <text
- name="inbox_inventory_placeholder"
- type="string"
- follows="all"
- layout="topleft"
- top="0"
- left="0"
- width="308"
- height="200"
- wrap="true"
- halign="center">
- Purchases from the marketplace will be delivered here.
- </text>
+ <text name="inbox_inventory_placeholder"
+ type="string"
+ follows="all"
+ layout="topleft"
+ top="0"
+ left="0"
+ width="308"
+ height="200"
+ wrap="true"
+ halign="center">
+Purchases from the marketplace will be delivered here.
+ </text>
</panel>
</panel>
</layout_panel>
</layout_stack>
- <panel
- follows="bottom|left|right"
- height="30"
- layout="topleft"
- name="button_panel"
- left="9"
- top_pad="7"
- width="308">
- <layout_stack
- follows="bottom|left|right"
- height="23"
- layout="topleft"
- mouse_opaque="false"
- name="button_panel_ls"
- left="0"
- orientation="horizontal"
- top="0"
- width="308">
- <layout_panel
- follows="bottom|left|right"
- height="23"
- layout="bottomleft"
- left="0"
- mouse_opaque="false"
- name="info_btn_lp"
- auto_resize="true"
- width="101">
- <button
- enabled="true"
- follows="bottom|left|right"
- height="23"
- label="Profile"
- layout="topleft"
- left="1"
- name="info_btn"
- tool_tip="Show object profile"
- top="0"
- width="100" />
+ <panel follows="bottom|left|right"
+ height="30"
+ layout="topleft"
+ name="button_panel"
+ left="9"
+ top_pad="7"
+ width="308">
+ <layout_stack follows="bottom|left|right"
+ height="23"
+ layout="topleft"
+ mouse_opaque="false"
+ name="button_panel_ls"
+ left="0"
+ orientation="horizontal"
+ top="0"
+ width="308">
+ <layout_panel follows="bottom|left|right"
+ height="23"
+ layout="bottomleft"
+ left="0"
+ mouse_opaque="false"
+ name="info_btn_lp"
+ auto_resize="true"
+ width="101">
+ <button enabled="true"
+ follows="bottom|left|right"
+ height="23"
+ label="Profile"
+ layout="topleft"
+ left="1"
+ name="info_btn"
+ tool_tip="Show object profile"
+ top="0"
+ width="100" />
</layout_panel>
<layout_panel
follows="bottom|left|right"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 3252ed2b62..5dcb8e2cdf 100755
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -184,15 +184,40 @@ Please try logging in again in a minute.</string>
<string name="SentToInvalidRegion">You were sent to an invalid region.</string>
<string name="TestingDisconnect">Testing viewer disconnect</string>
- <!-- Facebook Connect and, eventually, other Social Network -->
- <string name="SocialFacebookConnecting">Connecting to Facebook...</string>
- <string name="SocialFacebookPosting">Posting...</string>
- <string name="SocialFacebookDisconnecting">Disconnecting from Facebook...</string>
- <string name="SocialFacebookErrorConnecting">Problem connecting to Facebook</string>
- <string name="SocialFacebookErrorPosting">Problem posting to Facebook</string>
- <string name="SocialFacebookErrorDisconnecting">Problem disconnecting from Facebook</string>
+ <!-- SLShare: Facebook, Flickr, and Twitter -->
+ <string name="SocialFacebookConnecting">Connecting to Facebook...</string>
+ <string name="SocialFacebookPosting">Posting...</string>
+ <string name="SocialFacebookDisconnecting">Disconnecting from Facebook...</string>
+ <string name="SocialFacebookErrorConnecting">Problem connecting to Facebook</string>
+ <string name="SocialFacebookErrorPosting">Problem posting to Facebook</string>
+ <string name="SocialFacebookErrorDisconnecting">Problem disconnecting from Facebook</string>
+ <string name="SocialFlickrConnecting">Connecting to Flickr...</string>
+ <string name="SocialFlickrPosting">Posting...</string>
+ <string name="SocialFlickrDisconnecting">Disconnecting from Flickr...</string>
+ <string name="SocialFlickrErrorConnecting">Problem connecting to Flickr</string>
+ <string name="SocialFlickrErrorPosting">Problem posting to Flickr</string>
+ <string name="SocialFlickrErrorDisconnecting">Problem disconnecting from Flickr</string>
+ <string name="SocialTwitterConnecting">Connecting to Twitter...</string>
+ <string name="SocialTwitterPosting">Posting...</string>
+ <string name="SocialTwitterDisconnecting">Disconnecting from Twitter...</string>
+ <string name="SocialTwitterErrorConnecting">Problem connecting to Twitter</string>
+ <string name="SocialTwitterErrorPosting">Problem posting to Twitter</string>
+ <string name="SocialTwitterErrorDisconnecting">Problem disconnecting from Twitter</string>
- <!-- Tooltip -->
+ <!-- SLShare: User Friendly Filter Names Translation -->
+ <string name="BlackAndWhite">Black &amp; White</string>
+ <string name="Colors1970">1970&apos;s Colors</string>
+ <string name="Intense">Intense</string>
+ <string name="Newspaper">Newsprint</string>
+ <string name="Sepia">Sepia</string>
+ <string name="Spotlight">Spotlight</string>
+ <string name="Video">Video</string>
+ <string name="Autocontrast">Autocontrast</string>
+ <string name="LensFlare">Lens Flare</string>
+ <string name="Miniature">Miniature</string>
+ <string name="Toycamera">Toy Camera</string>
+
+ <!-- Tooltip -->
<string name="TooltipPerson">Person</string><!-- Object under mouse pointer is an avatar -->
<string name="TooltipNoName">(no name)</string> <!-- No name on an object -->
<string name="TooltipOwner">Owner:</string> <!-- Owner name follows -->
@@ -208,6 +233,7 @@ Please try logging in again in a minute.</string>
<string name="TooltipFlagNoScripts">No Scripts</string>
<string name="TooltipLand">Land:</string>
<string name="TooltipMustSingleDrop">Only a single item can be dragged here</string>
+ <string name="TooltipTooManyWearables">You can't wear a folder containing more than [AMOUNT] items. You can change this limit in Advanced > Show Debug Settings > WearFolderLimit.</string>
<string name="TooltipPrice" value="L$[AMOUNT]: "/>
<string name="TooltipOutboxDragToWorld">You can not rez items in your merchant outbox</string>
@@ -419,6 +445,8 @@ Please try logging in again in a minute.</string>
<string name="multiple_textures">Multiple</string>
<string name="use_texture">Use texture</string>
+ <string name="manip_hint1">Move mouse cursor over ruler</string>
+ <string name="manip_hint2">to snap to grid</string>
<!-- world map -->
<string name="texture_loading">Loading...</string>
@@ -2267,6 +2295,7 @@ The [[MARKETPLACE_CREATE_STORE_URL] Marketplace store] is returning errors.
<string name="Marketplace Error Internal Import">Error: There was a problem with this item. Try again later.</string>
<string name="Open landmarks">Open landmarks</string>
+ <string name="Unconstrained">Unconstrained</string>
<!-- use value="" because they have preceding spaces -->
<string name="no_transfer" value=" (no transfer)" />
@@ -2461,6 +2490,7 @@ The [[MARKETPLACE_CREATE_STORE_URL] Marketplace store] is returning errors.
<!-- compile queue-->
<string name="CompileQueueDownloadedCompiling">Downloaded, now compiling</string>
+ <string name="CompileQueueServiceUnavailable">Script compilation service not available</string>
<string name="CompileQueueScriptNotFound">Script not found on server.</string>
<string name="CompileQueueProblemDownloading">Problem downloading</string>
<string name="CompileQueueInsufficientPermDownload">Insufficient permissions to download a script.</string>
@@ -3489,6 +3519,12 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
<string name="facebook_post_success">
You posted to Facebook.
</string>
+ <string name="flickr_post_success">
+ You posted to Flickr.
+ </string>
+ <string name="twitter_post_success">
+ You posted to Twitter.
+ </string>
<string name="no_session_message">
(IM Session Doesn't Exist)
@@ -3740,6 +3776,7 @@ Abuse Report</string>
<string name="LocalEstimateUSD">US$ [AMOUNT]</string>
<!-- Group Profile roles and powers -->
+ <string name="Group Ban">Group Ban</string>
<string name="Membership">Membership</string>
<string name="Roles">Roles</string>
<string name="Group Identity">Group Identity</string>
@@ -3906,6 +3943,8 @@ Try enclosing path to the editor with double quotes.
<string name="Command_Conversations_Label">Conversations</string>
<string name="Command_Compass_Label">Compass</string>
<string name="Command_Destinations_Label">Destinations</string>
+ <string name="Command_Facebook_Label">Facebook</string>
+ <string name="Command_Flickr_Label">Flickr</string>
<string name="Command_Gestures_Label">Gestures</string>
<string name="Command_HowTo_Label">How to</string>
<string name="Command_Inventory_Label">Inventory</string>
@@ -3921,8 +3960,8 @@ Try enclosing path to the editor with double quotes.
<string name="Command_Profile_Label">Profile</string>
<string name="Command_Search_Label">Search</string>
<string name="Command_Snapshot_Label">Snapshot</string>
- <string name="Command_Social_Label">Facebook</string>
<string name="Command_Speak_Label">Speak</string>
+ <string name="Command_Twitter_Label">Twitter</string>
<string name="Command_View_Label">Camera controls</string>
<string name="Command_Voice_Label">Voice settings</string>
@@ -3934,6 +3973,8 @@ Try enclosing path to the editor with double quotes.
<string name="Command_Conversations_Tooltip">Converse with everyone</string>
<string name="Command_Compass_Tooltip">Compass</string>
<string name="Command_Destinations_Tooltip">Destinations of interest</string>
+ <string name="Command_Facebook_Tooltip">Post to Facebook</string>
+ <string name="Command_Flickr_Tooltip">Upload to Flickr</string>
<string name="Command_Gestures_Tooltip">Gestures for your avatar</string>
<string name="Command_HowTo_Tooltip">How to do common tasks</string>
<string name="Command_Inventory_Tooltip">View and use your belongings</string>
@@ -3949,8 +3990,8 @@ Try enclosing path to the editor with double quotes.
<string name="Command_Profile_Tooltip">Edit or view your profile</string>
<string name="Command_Search_Tooltip">Find places, events, people</string>
<string name="Command_Snapshot_Tooltip">Take a picture</string>
- <string name="Command_Social_Tooltip">Post to Facebook</string>
<string name="Command_Speak_Tooltip">Speak with people nearby using your microphone</string>
+ <string name="Command_Twitter_Tooltip">Twitter</string>
<string name="Command_View_Tooltip">Changing camera angle</string>
<string name="Command_Voice_Tooltip">Volume controls for calls and people near you in world</string>
diff --git a/indra/newview/skins/default/xui/en/teleport_strings.xml b/indra/newview/skins/default/xui/en/teleport_strings.xml
index fdf41991cd..5a9a16d344 100755
--- a/indra/newview/skins/default/xui/en/teleport_strings.xml
+++ b/indra/newview/skins/default/xui/en/teleport_strings.xml
@@ -48,7 +48,10 @@ Go to &apos;Welcome Island Public&apos; to repeat the tutorial.
<message name="MustGetAgeRegion">
You must be age 18 or over to enter this region.
</message>
- </message_set>
+ <message name="RegionTPSpecialUsageBlocked">
+ Unable to enter region. '[REGION_NAME]' is a Skill Gaming Region, and you must meet certain criteria in order to enter. For details, please review the [http://wiki.secondlife.com/wiki/Linden_Lab_Official:Skill_Gaming_in_Second_Life Skill Gaming FAQ].
+ </message>
+ </message_set>
<message_set name="progress">
<message name="sending_dest">
Sending to destination.
diff --git a/indra/newview/skins/default/xui/en/widgets/avatar_icon.xml b/indra/newview/skins/default/xui/en/widgets/avatar_icon.xml
index 4d69dda7eb..7f8fac04d0 100755
--- a/indra/newview/skins/default/xui/en/widgets/avatar_icon.xml
+++ b/indra/newview/skins/default/xui/en/widgets/avatar_icon.xml
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<avatar_icon
- name="avatar_icon"
- default_icon_name="Generic_Person_Large"
- use_draw_context_alpha="false">
-</avatar_icon>
+<avatar_icon name="avatar_icon"
+ default_icon_name="Generic_Person_Large"
+ use_draw_context_alpha="false"
+ symbol_hpad = "2"
+ symbol_vpad = "1"
+ symbol_size = "5"/>
+
diff --git a/indra/newview/skins/default/xui/en/widgets/combo_box.xml b/indra/newview/skins/default/xui/en/widgets/combo_box.xml
index 82d620d1e6..65f9a143e9 100755
--- a/indra/newview/skins/default/xui/en/widgets/combo_box.xml
+++ b/indra/newview/skins/default/xui/en/widgets/combo_box.xml
@@ -7,7 +7,7 @@
<combo_box.combo_button name="Combobox Button"
hover_glow_amount="0.15"
font="SansSerifSmall"
- scale_image="false"
+ scale_image="true"
image_unselected="ComboButton_Off"
image_selected="ComboButton_Selected"
image_disabled="ComboButton_Disabled" />
diff --git a/indra/newview/skins/default/xui/en/widgets/floater.xml b/indra/newview/skins/default/xui/en/widgets/floater.xml
index 97a5ae7d4e..807b67d112 100755
--- a/indra/newview/skins/default/xui/en/widgets/floater.xml
+++ b/indra/newview/skins/default/xui/en/widgets/floater.xml
@@ -2,7 +2,6 @@
<!-- See also settings.xml UIFloater* settings for configuration -->
<floater
name="floater"
- positioning="none"
layout="topleft"
bg_opaque_color="FloaterFocusBackgroundColor"
bg_alpha_color="FloaterDefaultBackgroundColor"
diff --git a/indra/newview/skins/default/xui/es/floater_big_preview.xml b/indra/newview/skins/default/xui/es/floater_big_preview.xml
new file mode 100644
index 0000000000..b112243d7a
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/floater_big_preview.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_big_preview" title="VISTA PREVIA"/>
diff --git a/indra/newview/skins/default/xui/es/floater_facebook.xml b/indra/newview/skins/default/xui/es/floater_facebook.xml
new file mode 100644
index 0000000000..3b0e05b193
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/floater_facebook.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_facebook" title="PUBLICAR EN FACEBOOK">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="ESTADO" name="panel_facebook_status"/>
+ <panel label="FOTO" name="panel_facebook_photo"/>
+ <panel label="ESTOY AQUÃ" name="panel_facebook_place"/>
+ <panel label="AMIGOS" name="panel_facebook_friends"/>
+ <panel label="CUENTA" name="panel_facebook_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ Error
+ </text>
+ <text name="connection_loading_text">
+ Cargando...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_flickr.xml b/indra/newview/skins/default/xui/es/floater_flickr.xml
new file mode 100644
index 0000000000..7f95d948fe
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/floater_flickr.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_flickr" title="SUBIR A FLICKR">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="FOTO" name="panel_flickr_photo"/>
+ <panel label="CUENTA" name="panel_flickr_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ Error
+ </text>
+ <text name="connection_loading_text">
+ Cargando...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_lagmeter.xml b/indra/newview/skins/default/xui/es/floater_lagmeter.xml
index 227689a194..227689a194 100755..100644
--- a/indra/newview/skins/default/xui/es/floater_lagmeter.xml
+++ b/indra/newview/skins/default/xui/es/floater_lagmeter.xml
diff --git a/indra/newview/skins/default/xui/es/floater_perms_default.xml b/indra/newview/skins/default/xui/es/floater_perms_default.xml
new file mode 100644
index 0000000000..71c3f239ea
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/floater_perms_default.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="perms default" title="PERMISOS DE CREACIÓN PREDETERMINADOS">
+ <panel label="Permisos predeterminados" name="default permissions"/>
+ <button label="OK" label_selected="OK" name="ok"/>
+ <button label="Cancelar" label_selected="Cancelar" name="cancel"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_region_restarting.xml b/indra/newview/skins/default/xui/es/floater_region_restarting.xml
new file mode 100644
index 0000000000..d55c8eff17
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/floater_region_restarting.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="region_restarting" title="REGIÓN REINICIANDO">
+ <string name="RegionName">
+ La región en la que te encuentras ([NAME]) se va a reiniciar.
+
+Si permaneces en esta región serás desconectado.
+ </string>
+ <string name="RestartSeconds">
+ Segundos hasta el reinicio
+[SECONDS]
+ </string>
+ <panel name="layout_panel_1">
+ <text name="region_name">
+ La región en la que te encuentras (-el nombre de región más largo-) se va a reiniciar.
+
+Si permaneces en esta región serás desconectado.
+ </text>
+ <text name="restart_seconds">
+ Segundos hasta el reinicio
+ 32767
+ </text>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_report_abuse.xml b/indra/newview/skins/default/xui/es/floater_report_abuse.xml
index dc5d430375..fe37f125b8 100755
--- a/indra/newview/skins/default/xui/es/floater_report_abuse.xml
+++ b/indra/newview/skins/default/xui/es/floater_report_abuse.xml
@@ -44,7 +44,7 @@
<combo_box.item label="Edad &gt; Residente adulto en Teen Second Life" name="Age__Adult_resident_on_Teen_Second_Life"/>
<combo_box.item label="Edad &gt; Residente menor de edad fuera de Teen Second Life" name="Age__Underage_resident_outside_of_Teen_Second_Life"/>
<combo_box.item label="Ataque &gt; Sandbox de combate / Zona no segura" name="Assault__Combat_sandbox___unsafe_area"/>
- <combo_box.item label="Ataque &gt; Zona segura" name="Assault__Safe_area"/>
+ <combo_box.item label="Atacar &gt; Disparar o empujar a otro residente en una zona segura" name="Assault__Safe_area"/>
<combo_box.item label="Ataque &gt; Sandbox de prueba de armas" name="Assault__Weapons_testing_sandbox"/>
<combo_box.item label="Comercio &gt; Error en la entrega de productos o servicios" name="Commerce__Failure_to_deliver_product_or_service"/>
<combo_box.item label="Indiscreción &gt; Información del mundo real" name="Disclosure__Real_world_information"/>
@@ -58,25 +58,25 @@
<combo_box.item label="Fraude &gt; L$" name="Fraud__L$"/>
<combo_box.item label="Fraude &gt; Terreno" name="Fraud__Land"/>
<combo_box.item label="Fraude &gt; Esquemas piramidales o cadenas de cartas" name="Fraud__Pyramid_scheme_or_chain_letter"/>
- <combo_box.item label="Fraude &gt; US$" name="Fraud__US$"/>
+ <combo_box.item label="Fraude &gt; L$ o USD" name="Fraud__US$"/>
<combo_box.item label="Acoso &gt; Anuncios múltiples / Spam visual" name="Harassment__Advert_farms___visual_spam"/>
<combo_box.item label="Acoso &gt; Difamación de individuos o grupos" name="Harassment__Defaming_individuals_or_groups"/>
<combo_box.item label="Acoso &gt; Impedir el movimiento" name="Harassment__Impeding_movement"/>
<combo_box.item label="Acoso &gt; Acoso sexual" name="Harassment__Sexual_harassment"/>
- <combo_box.item label="Acoso &gt; Incitar a, o pedir, que otros violen las Condiciones del Servicio" name="Harassment__Solicting_inciting_others_to_violate_ToS"/>
+ <combo_box.item label="Acosar &gt; Molestar deliberadamente a alguien concreto" name="Harassment__Solicting_inciting_others_to_violate_ToS"/>
<combo_box.item label="Acoso &gt; Abuso verbal" name="Harassment__Verbal_abuse"/>
<combo_box.item label="Indecencia &gt; En general, contenido o conducta ofensivos" name="Indecency__Broadly_offensive_content_or_conduct"/>
<combo_box.item label="Indecencia &gt; Nombre inapropiado del avatar" name="Indecency__Inappropriate_avatar_name"/>
- <combo_box.item label="Indecencia &gt; Contenido o conducta inapropiada en una región General" name="Indecency__Mature_content_in_PG_region"/>
+ <combo_box.item label="Indecencia &gt; Conducta o contenido inapropiado para la calificación de una región" name="Indecency__Mature_content_in_PG_region"/>
<combo_box.item label="Indecencia &gt; Contenido o conducta inapropiada en una región Moderado" name="Indecency__Inappropriate_content_in_Mature_region"/>
<combo_box.item label="Infracción de la propiedad intelectual &gt; Eliminación de contenidos" name="Intellectual_property_infringement_Content_Removal"/>
<combo_box.item label="Infracción de la propiedad intelectual &gt; CopyBot o Exploit (programa malicioso) de permisos" name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit"/>
<combo_box.item label="Intolerancia" name="Intolerance"/>
<combo_box.item label="Terreno &gt; Abuso de los recursos de un sandbox" name="Land__Abuse_of_sandbox_resources"/>
- <combo_box.item label="Terreno &gt; Invasión &gt; Objetos/Texturas" name="Land__Encroachment__Objects_textures"/>
+ <combo_box.item label="Terreno &gt; Invasión &gt; Objetos o texturas" name="Land__Encroachment__Objects_textures"/>
<combo_box.item label="Terreno &gt; Invasión &gt; Partículas" name="Land__Encroachment__Particles"/>
<combo_box.item label="Terreno &gt; Invasión &gt; Ãrboles/Plantas" name="Land__Encroachment__Trees_plants"/>
- <combo_box.item label="Apuestas/Juego" name="Wagering_gambling"/>
+ <combo_box.item label="Apostar" name="Wagering_gambling"/>
<combo_box.item label="Otra" name="Other"/>
</combo_box>
<text name="abuser_name_title">
diff --git a/indra/newview/skins/default/xui/es/floater_scene_load_stats.xml b/indra/newview/skins/default/xui/es/floater_scene_load_stats.xml
new file mode 100644
index 0000000000..f625d5257c
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/floater_scene_load_stats.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Scene Load Statistics" title="ESTADÃSTICAS DE CARGA DE ESCENA">
+ <button label="Pausa" name="playpause"/>
+ <scroll_container name="statistics_scroll">
+ <container_view name="statistics_view">
+ <stat_view label="Básica" name="basic">
+ <stat_bar label="Diferencia de píxeles de fotograma" name="frame difference"/>
+ <stat_bar label="Datos de UDP recibidos" name="bandwidth"/>
+ <stat_bar label="Pérdida de paquetes" name="packet_loss"/>
+ </stat_view>
+ <stat_view label="Avanzado" name="advanced">
+ <stat_view label="Renderización" name="render">
+ <stat_bar label="Objetos en total" name="objs"/>
+ <stat_bar label="Objetos nuevos" name="newobjs"/>
+ <stat_bar label="Ãndice de aciertos de caché de objetos" name="object_cache_hits"/>
+ </stat_view>
+ <stat_view label="Textura" name="texture">
+ <stat_bar label="Ãndice de aciertos de caché" name="texture_cache_hits"/>
+ <stat_bar label="Latencia de lectura de caché" name="texture_cache_read_latency"/>
+ <stat_bar label="Número" name="numimagesstat"/>
+ <stat_bar label="Raw: número" name="numrawimagesstat"/>
+ </stat_view>
+ <stat_view label="Red" name="network">
+ <stat_bar label="Paquetes salientes" name="packetsinstat"/>
+ <stat_bar label="Paquetes entrantes" name="packetsoutstat"/>
+ <stat_bar label="Objetos" name="objectdatareceived"/>
+ <stat_bar label="Textura" name="texturedatareceived"/>
+ <stat_bar label="Asset" name="assetudpdatareceived"/>
+ <stat_bar label="Capas" name="layersdatareceived"/>
+ <stat_bar label="Entrando ahora" name="messagedatain"/>
+ <stat_bar label="Saliendo ahora" name="messagedataout"/>
+ <stat_bar label="Operaciones VFS pendientes" name="vfspendingoperations"/>
+ </stat_view>
+ </stat_view>
+ <stat_view label="Simulador" name="sim">
+ <stat_bar label="Objetos" name="simobjects"/>
+ <stat_bar label="Objetos activos" name="simactiveobjects"/>
+ <stat_bar label="Scripts activos" name="simactivescripts"/>
+ <stat_bar label="Paquetes salientes" name="siminpps"/>
+ <stat_bar label="Paquetes entrantes" name="simoutpps"/>
+ <stat_bar label="Descargas pendientes" name="simpendingdownloads"/>
+ <stat_bar label="Subidas pendientes" name="simpendinguploads"/>
+ <stat_bar label="Total de bytes no reconocidos" name="simtotalunackedbytes"/>
+ <stat_view label="Tiempo (ms)" name="simperf">
+ <stat_bar label="Tiempo total de los frames" name="simframemsec"/>
+ <stat_bar label="Tiempo de red" name="simnetmsec"/>
+ <stat_bar label="Physics Time" name="simsimphysicsmsec"/>
+ <stat_bar label="Tiempo de la simulación" name="simsimothermsec"/>
+ <stat_bar label="Tiempo de los agentes" name="simagentmsec"/>
+ <stat_bar label="Tiempo de las imágenes" name="simimagesmsec"/>
+ <stat_bar label="Tiempo de los scripts" name="simscriptmsec"/>
+ <stat_bar label="Tiempo libre" name="simsparemsec"/>
+ <stat_view label="Datos de tiempo (ms)" name="timedetails">
+ <stat_bar label="Paso de física" name="simsimphysicsstepmsec"/>
+ <stat_bar label="Actualizar formas físicas" name="simsimphysicsshapeupdatemsec"/>
+ <stat_bar label="Otros (Física)" name="simsimphysicsothermsec"/>
+ <stat_bar label="Tiempo de suspensión" name="simsleepmsec"/>
+ <stat_bar label="Bombea E/S" name="simpumpiomsec"/>
+ </stat_view>
+ </stat_view>
+ </stat_view>
+ </container_view>
+ </scroll_container>
+</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_script_ed_prefs.xml b/indra/newview/skins/default/xui/es/floater_script_ed_prefs.xml
new file mode 100644
index 0000000000..fe808dea1b
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/floater_script_ed_prefs.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_script_colors" title="COLORES DE SCRIPT">
+ <text name="color_pickers_label">
+ Elige los colores que desees:
+ </text>
+ <text name="text_label">
+ Texto
+ </text>
+ <text name="cursor_label">
+ Cursor
+ </text>
+ <text name="background_label">
+ Fondo
+ </text>
+ <text name="datatype_label">
+ Tipos de datos
+ </text>
+ <text name="event_label">
+ Eventos
+ </text>
+ <text name="string_literal_label">
+ Literales de cadena
+ </text>
+ <text name="constant_label">
+ Constante
+ </text>
+ <text name="flow_control_label">
+ Control de flujo
+ </text>
+ <text name="function_label">
+ Función
+ </text>
+ <text name="comment_label">
+ Comentar
+ </text>
+ <script_editor name="Script Preview">
+ /* Un ejemplo de script */
+default
+{
+ state_entry()
+ {
+ // Comment
+ string greeting = &quot;Hola&quot;;
+ llSay(PUBLIC_CHANNEL, greeting);
+ }
+}
+ </script_editor>
+</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_snapshot.xml b/indra/newview/skins/default/xui/es/floater_snapshot.xml
index 23078b3a55..5e02bc52b7 100755
--- a/indra/newview/skins/default/xui/es/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/es/floater_snapshot.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Snapshot" title="VISTA PREVIA DE LA FOTO">
+<floater name="Snapshot" title="FOTO">
<floater.string name="unknown">
desconocido
</floater.string>
@@ -61,5 +61,11 @@
<check_box label="HUDs" name="hud_check"/>
<check_box label="Congelar la toma (pantalla completa)" name="freeze_frame_check"/>
<check_box label="Actualizar automáticamente" name="auto_snapshot_check"/>
+ <text name="filter_list_label">
+ Filtro:
+ </text>
+ <combo_box name="filters_combobox" tool_tip="Filtros de imagen">
+ <combo_box.item label="Sin filtro" name="NoFilter"/>
+ </combo_box>
</panel>
</floater>
diff --git a/indra/newview/skins/default/xui/es/floater_stats.xml b/indra/newview/skins/default/xui/es/floater_stats.xml
index 00601920f2..d1c5e867db 100755
--- a/indra/newview/skins/default/xui/es/floater_stats.xml
+++ b/indra/newview/skins/default/xui/es/floater_stats.xml
@@ -4,17 +4,21 @@
<container_view name="statistics_view">
<stat_view label="Básico" name="basic">
<stat_bar label="FPS" name="fps"/>
- <stat_bar label="Ancho de banda" name="bandwidth"/>
+ <stat_bar label="Datos de UDP recibidos" name="bandwidth"/>
<stat_bar label="Pérdida de paquetes" name="packet_loss"/>
<stat_bar label="Ping del Sim" name="ping"/>
</stat_view>
<stat_view label="Avanzado" name="advanced">
<stat_view label="Renderización" name="render">
- <stat_bar label="KTris generados por fotograma" name="ktrisframe"/>
- <stat_bar label="KTris generados por segundo" name="ktrissec"/>
- <stat_bar label="Objetos en total" name="objs"/>
+ <stat_bar label="KTris por fotograma" name="ktrisframe"/>
+ <stat_bar label="KTris por segundo" name="ktrissec"/>
+ <stat_bar label="Objetos en total" name="totalobjs"/>
+ <stat_bar label="Objetos en caché" name="cachedobjs"/>
<stat_bar label="Objetos nuevos" name="newobjs"/>
<stat_bar label="Ãndice de aciertos de caché de objetos" name="object_cache_hits"/>
+ <stat_bar label="Consultas de oclusión realizadas" name="occlusion_queries"/>
+ <stat_bar label="Objetos ocluidos" name="occluded"/>
+ <stat_bar label="Objeto no ocluido" name="unoccluded"/>
</stat_view>
<stat_view label="Textura" name="texture">
<stat_bar label="Ãndice de aciertos de caché" name="texture_cache_hits"/>
@@ -26,15 +30,32 @@
<stat_bar label="Raw Mem" name="rawmemstat"/>
<stat_bar label="Bound Mem" name="glboundmemstat"/>
</stat_view>
+ <stat_view label="Memoria utilizada" name="memory">
+ <stat_bar label="LLTrace" name="LLTrace"/>
+ <stat_bar label="UI" name="LLView"/>
+ <stat_bar label="Fuentes" name="LLFontFreetype"/>
+ <stat_bar label="Inventario" name="LLInventoryObject"/>
+ <stat_bar label="Objetos del visor" name="LLViewerObject"/>
+ <stat_bar label="Datos de grupo de árbol octal" name="LLViewerOctreeGroup"/>
+ <stat_bar label="Datos de árbol octal" name="LLViewerOctreeEntry"/>
+ <stat_bar label="Caché de objetos del visor" name="LLVOCacheEntry"/>
+ <stat_bar label="Objetos dibujables" name="LLDrawable"/>
+ <stat_bar label="Datos de cara" name="LLFace"/>
+ <stat_bar label="Información de dibujo" name="LLDrawInfo"/>
+ <stat_bar label="Datos de textura" name="LLTexture"/>
+ <stat_bar label="Datos de imagen" name="LLImage"/>
+ <stat_bar label="Datos de imagen GL" name="LLImageGL"/>
+ <stat_bar label="Memorias intermedias de vértice" name="LLVertexBuffer"/>
+ </stat_view>
<stat_view label="Red" name="network">
<stat_bar label="Paquetes salientes" name="packetsinstat"/>
<stat_bar label="Paquetes entrantes" name="packetsoutstat"/>
- <stat_bar label="Objetos" name="objectkbitstat"/>
- <stat_bar label="Textura" name="texturekbitstat"/>
- <stat_bar label="Asset" name="assetkbitstat"/>
- <stat_bar label="Capas" name="layerskbitstat"/>
- <stat_bar label="Entrando ahora" name="actualinkbitstat"/>
- <stat_bar label="Saliendo ahora" name="actualoutkbitstat"/>
+ <stat_bar label="Objetos" name="objectdatareceived"/>
+ <stat_bar label="Textura" name="texturedatareceived"/>
+ <stat_bar label="Asset" name="assetudpdatareceived"/>
+ <stat_bar label="Capas" name="layersdatareceived"/>
+ <stat_bar label="Entrando ahora" name="messagedatain"/>
+ <stat_bar label="Saliendo ahora" name="messagedataout"/>
<stat_bar label="Operaciones VFS pendientes" name="vfspendingoperations"/>
</stat_view>
</stat_view>
@@ -53,7 +74,8 @@
<stat_bar label="Pasos de silueta omitidos" name="simsimskippedsilhouettesteps"/>
<stat_bar label="Personajes actualizados" name="simsimpctsteppedcharacters"/>
</stat_view>
- <stat_view label="Tiempo (ms)" name="simperf">
+ <stat_bar label="Total de datos no reconocidos" name="simtotalunackedbytes"/>
+ <stat_view label="Tiempo" name="simperf">
<stat_bar label="Tiempo total de los frames" name="simframemsec"/>
<stat_bar label="Tiempo de red" name="simnetmsec"/>
<stat_bar label="Physics Time" name="simsimphysicsmsec"/>
@@ -62,7 +84,7 @@
<stat_bar label="Tiempo de las imágenes" name="simimagesmsec"/>
<stat_bar label="Tiempo de los scripts" name="simscriptmsec"/>
<stat_bar label="Tiempo libre" name="simsparemsec"/>
- <stat_view label="Datos de tiempo (ms)" name="timedetails">
+ <stat_view label="Detalles de tiempo" name="timedetails">
<stat_bar label="Paso de física" name="simsimphysicsstepmsec"/>
<stat_bar label="Actualizar formas físicas" name="simsimphysicsshapeupdatemsec"/>
<stat_bar label="Otros (Física)" name="simsimphysicsothermsec"/>
diff --git a/indra/newview/skins/default/xui/es/floater_tools.xml b/indra/newview/skins/default/xui/es/floater_tools.xml
index 32baa5bb7d..159619decc 100755
--- a/indra/newview/skins/default/xui/es/floater_tools.xml
+++ b/indra/newview/skins/default/xui/es/floater_tools.xml
@@ -57,7 +57,7 @@
<check_box label="Editar las partes enlazadas" name="checkbox edit linked parts"/>
<button label="Enlazar" name="link_btn"/>
<button label="Desenlazar" name="unlink_btn" width="95"/>
- <check_box label="" name="checkbox uniform"/>
+ <check_box label="Estirar ambos lados" name="checkbox uniform"/>
<text label="Estirar ambos lados" name="checkbox uniform label">
Estirar ambos lados
</text>
diff --git a/indra/newview/skins/default/xui/es/floater_twitter.xml b/indra/newview/skins/default/xui/es/floater_twitter.xml
new file mode 100644
index 0000000000..050ee1a391
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/floater_twitter.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_twitter" title="TWITTER">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="REDACTAR" name="panel_twitter_photo"/>
+ <panel label="CUENTA" name="panel_twitter_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ Error
+ </text>
+ <text name="connection_loading_text">
+ Cargando...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/es/menu_avatar_icon.xml b/indra/newview/skins/default/xui/es/menu_avatar_icon.xml
index fe7331a108..e3299b0a6b 100755
--- a/indra/newview/skins/default/xui/es/menu_avatar_icon.xml
+++ b/indra/newview/skins/default/xui/es/menu_avatar_icon.xml
@@ -2,6 +2,7 @@
<menu name="Avatar Icon Menu">
<menu_item_call label="Ver el perfil" name="Show Profile"/>
<menu_item_call label="Enviar un MI..." name="Send IM"/>
+ <menu_item_call label="Petición de teleporte" name="Request Teleport"/>
<menu_item_call label="Añadir como amigo..." name="Add Friend"/>
<menu_item_call label="Quitar de los amigos..." name="Remove Friend"/>
</menu>
diff --git a/indra/newview/skins/default/xui/es/menu_conversation.xml b/indra/newview/skins/default/xui/es/menu_conversation.xml
index b63711589d..5bcf249226 100644
--- a/indra/newview/skins/default/xui/es/menu_conversation.xml
+++ b/indra/newview/skins/default/xui/es/menu_conversation.xml
@@ -29,4 +29,5 @@
<menu_item_call label="Silenciar a todos" name="ModerateVoiceMute"/>
<menu_item_call label="Quitar el silencio a todos" name="ModerateVoiceUnmute"/>
</context_menu>
+ <menu_item_call label="Expulsar a miembro" name="BanMember"/>
</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/es/menu_inventory.xml b/indra/newview/skins/default/xui/es/menu_inventory.xml
index 803d3f1331..cd5bc7917d 100755
--- a/indra/newview/skins/default/xui/es/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/es/menu_inventory.xml
@@ -69,6 +69,7 @@
<menu_item_call label="Escuchar" name="Sound Play"/>
<menu_item_call label="Copiar la SLurl" name="url_copy"/>
<menu_item_call label="Acerca del hito" name="About Landmark"/>
+ <menu_item_call label="Mostrar en el mapa" name="show_on_map"/>
<menu_item_call label="Escuchar en el mundo" name="Animation Play"/>
<menu_item_call label="Ejecutarla para usted" name="Animation Audition"/>
<menu_item_call label="Enviar un mensaje instantáneo" name="Send Instant Message"/>
diff --git a/indra/newview/skins/default/xui/es/menu_login.xml b/indra/newview/skins/default/xui/es/menu_login.xml
index 2286d0527a..336572f0cb 100755
--- a/indra/newview/skins/default/xui/es/menu_login.xml
+++ b/indra/newview/skins/default/xui/es/menu_login.xml
@@ -5,7 +5,15 @@
<menu_item_call label="Salir de [APP_NAME]" name="Quit"/>
</menu>
<menu label="Ayuda" name="Help">
- <menu_item_call label="Ayuda de [SECOND_LIFE]" name="Second Life Help"/>
+ <menu_item_call label="Cómo..." name="How To"/>
+ <menu_item_call label="Guía rápida" name="Quickstart"/>
+ <menu_item_call label="Base de Conocimientos" name="Knowledge Base"/>
+ <menu_item_call label="Wiki" name="Wiki"/>
+ <menu_item_call label="Foros comunitarios" name="Community Forums"/>
+ <menu_item_call label="Portal de soporte" name="Support portal"/>
+ <menu_item_call label="Noticias de [SECOND_LIFE]" name="Second Life News"/>
+ <menu_item_call label="Blogs de [SECOND_LIFE]" name="Second Life Blogs"/>
+ <menu_item_call label="Informar de un fallo" name="Report Bug"/>
<menu_item_call label="Acerca de [APP_NAME]" name="About Second Life"/>
</menu>
<menu_item_check label="Mostrar el menú &apos;Debug&apos;" name="Show Debug Menu"/>
diff --git a/indra/newview/skins/default/xui/es/menu_object.xml b/indra/newview/skins/default/xui/es/menu_object.xml
index e75c7283af..0de9907660 100755
--- a/indra/newview/skins/default/xui/es/menu_object.xml
+++ b/indra/newview/skins/default/xui/es/menu_object.xml
@@ -21,6 +21,7 @@
<context_menu label="Gestionar" name="Remove">
<menu_item_call label="Denunciar una infracción" name="Report Abuse..."/>
<menu_item_call label="Ignorar" name="Object Mute"/>
+ <menu_item_call label="No ignorar" name="Object Unmute"/>
<menu_item_call label="Devolver" name="Return..."/>
</context_menu>
<menu_item_call label="Tomar" name="Pie Object Take"/>
diff --git a/indra/newview/skins/default/xui/es/menu_teleport_history_item.xml b/indra/newview/skins/default/xui/es/menu_teleport_history_item.xml
index c482907812..1ff555b727 100755
--- a/indra/newview/skins/default/xui/es/menu_teleport_history_item.xml
+++ b/indra/newview/skins/default/xui/es/menu_teleport_history_item.xml
@@ -2,5 +2,5 @@
<context_menu name="Teleport History Item Context Menu">
<menu_item_call label="Teleportar" name="Teleport"/>
<menu_item_call label="Más información" name="More Information"/>
- <menu_item_call label="Copiar al portapapeles" name="CopyToClipboard"/>
+ <menu_item_call label="Copiar la SLurl" name="CopyToClipboard"/>
</context_menu>
diff --git a/indra/newview/skins/default/xui/es/menu_viewer.xml b/indra/newview/skins/default/xui/es/menu_viewer.xml
index e4fe871683..d2117f08b6 100755
--- a/indra/newview/skins/default/xui/es/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/es/menu_viewer.xml
@@ -35,6 +35,9 @@
<menu_item_check label="Chat..." name="Nearby Chat"/>
<menu_item_check label="Hablar" name="Speak"/>
<menu_item_check label="Registro de conversación..." name="Conversation Log..."/>
+ <menu_item_call label="Facebook..." name="Facebook"/>
+ <menu_item_call label="Twitter..." name="Twitter"/>
+ <menu_item_call label="Flickr..." name="Flickr"/>
<menu label="Transformación de voz" name="VoiceMorphing">
<menu_item_check label="Sin transformación de voz" name="NoVoiceMorphing"/>
<menu_item_check label="Probar..." name="Preview"/>
@@ -71,11 +74,11 @@
<menu_item_check label="Menú Avanzado" name="Show Advanced Menu"/>
</menu>
<menu label="Sol" name="Sun">
- <menu_item_call label="Amanecer" name="Sunrise"/>
- <menu_item_call label="Mediodía" name="Noon"/>
- <menu_item_call label="Atardecer" name="Sunset"/>
- <menu_item_call label="Medianoche" name="Midnight"/>
- <menu_item_call label="Usar configuración de región" name="Use Region Settings"/>
+ <menu_item_check label="Amanecer" name="Sunrise"/>
+ <menu_item_check label="Mediodía" name="Noon"/>
+ <menu_item_check label="Atardecer" name="Sunset"/>
+ <menu_item_check label="Medianoche" name="Midnight"/>
+ <menu_item_check label="Usar configuración de región" name="Use Region Settings"/>
</menu>
<menu label="Editor de entorno" name="Environment Editor">
<menu_item_call label="Configuración del entorno..." name="Environment Settings"/>
@@ -149,7 +152,8 @@
<menu_item_check label="Ajustar a la cuadrícula" name="Snap to Grid"/>
<menu_item_call label="Ajustar a la cuadrícula los ejes X e Y" name="Snap Object XY to Grid"/>
<menu_item_call label="Usar lo seleccionado como cuadrícula" name="Use Selection for Grid"/>
- <menu_item_call label="Opciones de la cuadrícula" name="Grid Options"/>
+ <menu_item_call label="Opciones de la cuadrícula..." name="Grid Options"/>
+ <menu_item_call label="Definir permisos predeterminados..." name="Set default permissions"/>
</menu>
<menu label="Subir" name="Upload">
<menu_item_call label="Imagen ([COST] L$)..." name="Upload Image"/>
@@ -157,15 +161,12 @@
<menu_item_call label="Animación ([COST] L$)..." name="Upload Animation"/>
<menu_item_call label="Modelo..." name="Upload Model"/>
<menu_item_call label="Masivo ([COST] L$ por archivo)..." name="Bulk Upload"/>
- <menu_item_call label="Configurar los permisos por defecto de subida" name="perm prefs"/>
</menu>
<menu_item_call label="Deshacer" name="Undo"/>
<menu_item_call label="Rehacer" name="Redo"/>
</menu>
<menu label="Ayuda" name="Help">
<menu_item_call label="Cómo..." name="How To"/>
- <menu_item_call label="Ayuda de [SECOND_LIFE]" name="Second Life Help"/>
- <menu_item_call label="Guía del usuario" name="User’s guide"/>
<menu_item_call label="Base de Conocimientos" name="Knowledge Base"/>
<menu_item_call label="Wiki" name="Wiki"/>
<menu_item_call label="Foros comunitarios" name="Community Forums"/>
@@ -187,6 +188,7 @@
<menu label="Herramientas de rendimiento" name="Performance Tools">
<menu_item_call label="Medidor de lag" name="Lag Meter"/>
<menu_item_check label="Estadísticas" name="Statistics Bar"/>
+ <menu_item_call label="Estadísticas de carga de escenas" name="Scene Load Statistics"/>
<menu_item_check label="Mostrar el peso del dibujo de los avatares" name="Avatar Rendering Cost"/>
</menu>
<menu label="Realzado y Visibilidad" name="Highlighting and Visibility">
@@ -248,6 +250,7 @@
<menu_item_check label="Fast Timers" name="Fast Timers"/>
<menu_item_check label="Memory" name="Memory"/>
<menu_item_check label="Datos de la escena" name="Scene Statistics"/>
+ <menu_item_check label="Monitor de carga de escenas" name="Scene Loading Monitor"/>
<menu_item_call label="Consola de depuración de obtención de texturas" name="Texture Fetch Debug Console"/>
<menu_item_call label="Region Info to Debug Console" name="Region Info to Debug Console"/>
<menu_item_check label="Camera" name="Camera"/>
@@ -279,6 +282,7 @@
<menu_item_check label="Randomize Framerate" name="Randomize Framerate"/>
<menu_item_check label="Frame Test" name="Frame Test"/>
<menu_item_call label="Perfil del fotograma" name="Frame Profile"/>
+ <menu_item_call label="Criterio de referencia" name="Benchmark"/>
</menu>
<menu label="Render Metadata" name="Render Metadata">
<menu_item_check label="Normales" name="Normals"/>
@@ -286,6 +290,8 @@
<menu_item_check label="Actualizar el tipo" name="Update Type"/>
<menu_item_check label="Información sobre el nivel de detalle" name="LOD Info"/>
<menu_item_check label="Crear cola" name="Build Queue"/>
+ <menu_item_check label="Partículas" name="Particles"/>
+ <menu_item_check label="Articulaciones" name="Joints"/>
<menu_item_check label="Vectores de viento" name="Wind Vectors"/>
<menu_item_check label="Complejidad del renderizado" name="rendercomplexity"/>
<menu_item_check label="Bytes de adjunto" name="attachment bytes"/>
@@ -311,6 +317,7 @@
<menu_item_check label="Render Attached Lights" name="Render Attached Lights"/>
<menu_item_check label="Render Attached Particles" name="Render Attached Particles"/>
<menu_item_check label="Hover Glow Objects" name="Hover Glow Objects"/>
+ <menu_item_call label="Limpiar caché inmediatamente" name="Cache Clear"/>
</menu>
<menu label="Red" name="Network">
<menu_item_check label="Pause Avatar" name="AgentPause"/>
@@ -326,7 +333,6 @@
<menu_item_call label="Prueba de navegadores de medios" name="Web Browser Test"/>
<menu_item_call label="Navegador de contenido web" name="Web Content Browser"/>
<menu_item_call label="Print Selected Object Info" name="Print Selected Object Info"/>
- <menu_item_check label="Consola de depuración de región" name="Region Debug Console"/>
<menu_item_check label="Debug Clicks" name="Debug Clicks"/>
<menu_item_check label="Debug Mouse Events" name="Debug Mouse Events"/>
</menu>
diff --git a/indra/newview/skins/default/xui/es/notifications.xml b/indra/newview/skins/default/xui/es/notifications.xml
index d4451ad251..01407dc69e 100755
--- a/indra/newview/skins/default/xui/es/notifications.xml
+++ b/indra/newview/skins/default/xui/es/notifications.xml
@@ -114,15 +114,15 @@ Puedes consultar más información en el [[MARKETPLACE_IMPORTS_URL] registro de
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="OutboxImportFailed">
- Error de transferencia
+ Error de la transferencia: &apos;[ERROR_CODE]&apos;
-No se han enviado carpetas al Mercado a causa de un error del sistema o de la red. Vuelve a intentarlo más tarde.
+No se han enviado carpetas al Mercado a causa de un error del sistema o de la red. Vuelve a intentarlo más tarde.
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="OutboxInitFailed">
- Error al inicializar el mercado
+ Error de inicialización del Mercado: &apos;[ERROR_CODE]&apos;
-La inicialización del mercado ha fallado por un error del sistema o de la red. Vuelve a intentarlo más tarde.
+La inicialización del mercado ha fallado por un error del sistema o de la red. Vuelve a intentarlo más tarde.
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="CompileQueueSaveText">
@@ -206,6 +206,22 @@ No podrás removérseles de ese rol, sino que deberán renunciar a él por sí m
¿Añadir esta capacidad a &apos;[ROLE_NAME]&apos;?
<usetemplate name="okcancelbuttons" notext="No" yestext="Sí"/>
</notification>
+ <notification name="AssignBanAbilityWarning">
+ Vas a agregar la capacidad &apos;[ACTION_NAME]&apos; al rol &apos;[ROLE_NAME]&apos;.
+
+ *ATENCIÓN*
+Cualquier miembro de un rol que tenga esta capacidad también recibirá las capacidades &apos;[ACTION_NAME_2]&apos; y &apos;[ACTION_NAME_3]&apos;
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
+ <notification name="RemoveBanAbilityWarning">
+ Vas a quitar la capacidad &apos;[ACTION_NAME]&apos; del rol &apos;[ROLE_NAME]&apos;.
+
+ *ATENCIÓN*
+Al quitar esta capacidad NO se quitan las capacidades &apos;[ACTION_NAME_2]&apos; y &apos;[ACTION_NAME_3]&apos;.
+
+Si no quieres que este rol siga teniendo dichas capacidades, deshabilítalas inmediatamente.
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
<notification name="EjectGroupMemberWarning">
Estás a punto de expulsar a [AVATAR_NAME] del grupo.
<usetemplate ignoretext="Confirmar la expulsión de un miembro del grupo" name="okcancelignore" notext="Cancelar" yestext="Expulsar"/>
@@ -1585,6 +1601,14 @@ Consulta [[INFO_URL] Información sobre esta actualización].
No es posible abandonar el grupo. No puedes abandonarlo porque eres su último propietario. Antes tienes que asignar el papel de propietario a otro miembro.
<usetemplate name="okbutton" yestext="OK"/>
</notification>
+ <notification name="GroupDepartError">
+ No se puede abandonar el grupo: [reason].
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
+ <notification name="GroupDepart">
+ Has abandonado el grupo [group_name].
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
<notification name="ConfirmKick">
¿Quieres realmente expulsar a todos los residentes de la cuadrícula?
<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="Expulsar a todos los Residentes"/>
@@ -1739,6 +1763,10 @@ excediendo el límite de [LIMIT].
¿Seguro que quieres teleportarte a &lt;nolink&gt;[LOCATION]&lt;/nolink&gt;?
<usetemplate ignoretext="Confirmar que quiero teleportarme a un hito" name="okcancelignore" notext="Cancelar" yestext="Teleportar"/>
</notification>
+ <notification name="TeleportViaSLAPP">
+ ¿Seguro que quieres teleportarte a &lt;nolink&gt;[LOCATION]&lt;/nolink&gt;?
+ <usetemplate ignoretext="Confirmar el teleporte mediante SLAPP" name="okcancelignore" notext="Cancelar" yestext="Teleportarte"/>
+ </notification>
<notification name="TeleportToPick">
¿Teleportarte a [PICK]?
<usetemplate ignoretext="Confirmar el teleporte a una localización de los Destacados" name="okcancelignore" notext="Cancelar" yestext="Teleportar"/>
@@ -1949,6 +1977,9 @@ Se cambiarán miles de regiones, y se provocará un colapso en el espacio del se
<notification name="ProblemAddingEstateManager">
Hay problemas al añadir un administrador nuevo del estado. Uno o más estados deben de tener llena la lista de administradores.
</notification>
+ <notification name="ProblemAddingEstateBanManager">
+ No se puede añadir el administrador o propietario de un estado a la lista de expulsados.
+ </notification>
<notification name="ProblemAddingEstateGeneric">
Hay problemas al añadir a la lista del estado. Uno o más estados deben de tener llena la lista.
</notification>
@@ -2461,6 +2492,12 @@ Inténtalo seleccionando un trozo más pequeño de terreno.
<notification name="SystemMessage">
[MESSAGE]
</notification>
+ <notification name="FlickrConnect">
+ [MESSAGE]
+ </notification>
+ <notification name="TwitterConnect">
+ [MESSAGE]
+ </notification>
<notification name="PaymentReceived">
[MESSAGE]
</notification>
@@ -3028,9 +3065,9 @@ Consulta los detalles en el archivo de registro.
&lt;nolink&gt;[ITEMS]&lt;/nolink&gt;
-Con los siguientes residentes:
+Con los siguientes Residentes:
-[RESIDENTS]
+&lt;nolink&gt;[RESIDENTS]&lt;/nolink&gt;
<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/>
</notification>
<notification name="ShareFolderConfirmation">
@@ -3042,7 +3079,7 @@ Con los siguientes residentes:
Con los siguientes Residentes:
-[RESIDENTS]
+&lt;nolink&gt;[RESIDENTES]&lt;/nolink&gt;
<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="Aceptar"/>
</notification>
<notification name="ItemsShared">
@@ -3495,10 +3532,6 @@ Prueba otra vez dentro de un minuto.
<notification name="EjectComingSoon">
Te han expulsado de aquí y tienes [EJECT_TIME] segundos para salir.
</notification>
- <notification name="NoEnterServerFull">
- No puedes entrar en esta región porque
-el servidor está lleno.
- </notification>
<notification name="SaveBackToInvDisabled">
Se ha deshabilitado Devolver el objeto a mi inventario.
</notification>
@@ -3688,6 +3721,9 @@ el servidor está lleno.
<notification name="LinkFailedTooMuchPhysics">
El objeto utiliza una cantidad excesiva de recursos de física; se ha desactivado su dinámica.
</notification>
+ <notification name="EstateManagerFailedllTeleportHome">
+ El objeto &apos;[OBJECT_NAME]&apos; de [SLURL] no puede teleportar a los administradores del estado a la base.
+ </notification>
<notification name="TeleportedHomeByObjectOnParcel">
Has sido teleportado al origen por el objeto &apos;[OBJECT_NAME]&apos; de la parcela &apos;[PARCEL_NAME]&apos;
</notification>
@@ -3878,13 +3914,18 @@ el servidor está lleno.
La selección no contiene suficientes parcelas alquiladas para unirlas.
</notification>
<notification name="CantDivideLandMultipleParcelsSelected">
- No se puede dividir el terreno.\nHay varias parcelas seleccionadas.\nPrueba a seleccionar un terreno más pequeño.
+ No se puede dividir el terreno.
+Hay varias parcelas seleccionadas.
+Prueba a seleccionar un terreno más pequeño.
</notification>
<notification name="CantDivideLandCantFindParcel">
- No se puede dividir el terreno.\nNo se encuentra la parcela.\nAvísanos con Ayuda -&gt; Notificar fallo...
+ No se puede dividir el terreno.
+No se encuentra la parcela.
+Notifícalo con Ayuda -&gt; Informar de un fallo...
</notification>
<notification name="CantDivideLandWholeParcelSelected">
- No se puede dividir el terreno. Está seleccionada la parcela completa.\nPrueba a seleccionar un terreno más pequeño.
+ No se puede dividir el terreno. Esta seleccionada una parcela completa.
+Prueba a seleccionar un terreno más pequeño.
</notification>
<notification name="LandHasBeenDivided">
El terreno se ha dividido.
@@ -4024,4 +4065,12 @@ el servidor está lleno.
No se pueden mover los archivos. Ruta anterior restaurada.
<usetemplate ignoretext="No se pueden mover los archivos. Ruta anterior restaurada." name="okignore" yestext="OK"/>
</notification>
+ <notification name="DefaultObjectPermissions">
+ Ha ocurrido un problema al guardar los permisos predeterminados por el siguiente motivo: [REASON]. Intenta configurar los permisos predeterminados más adelante.
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
+ <notification name="ChatHistoryIsBusyAlert">
+ El archivo de historial de chat todavía está realizando la operación anterior. Repite la operación dentro de unos minutos o inicia un chat con otra persona.
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
</notifications>
diff --git a/indra/newview/skins/default/xui/es/panel_facebook_account.xml b/indra/newview/skins/default/xui/es/panel_facebook_account.xml
new file mode 100644
index 0000000000..2b6d407ad7
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/panel_facebook_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_account">
+ <string name="facebook_connected" value="Estás conectado a Facebook como:"/>
+ <string name="facebook_disconnected" value="No conectado a Facebook"/>
+ <text name="account_caption_label">
+ No conectado a Facebook.
+ </text>
+ <panel name="panel_buttons">
+ <button label="Conectar..." name="connect_btn"/>
+ <button label="Desconectar" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Facebook/ta-p/2149711 Aprende a publicar en Facebook]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_facebook_friends.xml b/indra/newview/skins/default/xui/es/panel_facebook_friends.xml
new file mode 100644
index 0000000000..6913e87aba
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/panel_facebook_friends.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_friends">
+ <string name="facebook_friends_empty" value="Actualmente no tienes amigos en Facebook que también sean residentes de Second Life. Invita a tus amigos de Facebook a que se unan a Second Life."/>
+ <string name="facebook_friends_no_connected" value="Actualmente no estás conectado a Facebook. Selecciona la pestaña Cuenta para conectarte y habilitar esta función."/>
+ <accordion name="friends_accordion">
+ <accordion_tab name="tab_second_life_friends" title="Amigos de SL"/>
+ <accordion_tab name="tab_suggested_friends" title="Agregar estas personas como amigos de SL"/>
+ </accordion>
+ <text name="facebook_friends_status">
+ No conectado a Facebook.
+ </text>
+</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_facebook_photo.xml b/indra/newview/skins/default/xui/es/panel_facebook_photo.xml
new file mode 100644
index 0000000000..f9e7265d34
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/panel_facebook_photo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="Resolución de imagen">
+ <combo_box.item label="Ventana actual" name="CurrentWindow"/>
+ <combo_box.item label="640 × 480" name="640x480"/>
+ <combo_box.item label="800 × 600" name="800x600"/>
+ <combo_box.item label="1024 × 768" name="1024x768"/>
+ <combo_box.item label="1200 × 630" name="1200x630"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="Filtros de imagen">
+ <combo_box.item label="Sin filtro" name="NoFilter"/>
+ </combo_box>
+ <button label="Actualizar" name="new_snapshot_btn" tool_tip="Pulsa para actualizar"/>
+ <button label="Vista previa" name="big_preview_btn" tool_tip="Pulsa para alternar entre vista previa sí/no"/>
+ <text name="caption_label">
+ Comentario (opcional):
+ </text>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="Publicar" name="post_photo_btn"/>
+ <button label="Cancelar" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_facebook_place.xml b/indra/newview/skins/default/xui/es/panel_facebook_place.xml
new file mode 100644
index 0000000000..639825818a
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/panel_facebook_place.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_place">
+ <layout_stack name="stack_place">
+ <layout_panel name="place_detail_panel">
+ <text name="place_caption_label">
+ Cuenta algo del lugar donde te encuentras:
+ </text>
+ </layout_panel>
+ <layout_panel name="place_map_panel">
+ <check_box initial_value="false" label="" name="add_place_view_cb"/>
+ </layout_panel>
+ <layout_panel name="place_button_panel">
+ <button label="Publicar" name="post_place_btn"/>
+ <button label="Cancelar" name="cancel_place_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_facebook_status.xml b/indra/newview/skins/default/xui/es/panel_facebook_status.xml
new file mode 100644
index 0000000000..dfaf4089fc
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/panel_facebook_status.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_status">
+ <layout_stack name="stack_status">
+ <layout_panel name="status_detail_panel">
+ <text name="status_caption_label">
+ ¿En qué estás pensando?
+ </text>
+ </layout_panel>
+ <layout_panel name="status_button_panel">
+ <button label="Publicar" name="post_status_btn"/>
+ <button label="Cancelar" name="cancel_status_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_flickr_account.xml b/indra/newview/skins/default/xui/es/panel_flickr_account.xml
new file mode 100644
index 0000000000..7dcf5b5595
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/panel_flickr_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_flickr_account">
+ <string name="flickr_connected" value="Estás conectado a Flickr como:"/>
+ <string name="flickr_disconnected" value="No conectado a Flickr"/>
+ <text name="account_caption_label">
+ No estás conectado a Flickr.
+ </text>
+ <panel name="panel_buttons">
+ <button label="Conectar..." name="connect_btn"/>
+ <button label="Desconectar" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Flickr/ta-p/2435609 Aprende a publicar en Flickr]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_flickr_photo.xml b/indra/newview/skins/default/xui/es/panel_flickr_photo.xml
new file mode 100644
index 0000000000..465e80667b
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/panel_flickr_photo.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_flickr_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="Resolución de imagen">
+ <combo_box.item label="Ventana actual" name="CurrentWindow"/>
+ <combo_box.item label="640 × 480" name="640x480"/>
+ <combo_box.item label="800 × 600" name="800x600"/>
+ <combo_box.item label="1024 × 768" name="1024x768"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="Filtros de imagen">
+ <combo_box.item label="Sin filtro" name="NoFilter"/>
+ </combo_box>
+ <button label="Actualizar" name="new_snapshot_btn" tool_tip="Pulsa para actualizar"/>
+ <button label="Vista previa" name="big_preview_btn" tool_tip="Pulsa para alternar entre vista previa sí/no"/>
+ <text name="title_label">
+ Título:
+ </text>
+ <text name="description_label">
+ Descripción:
+ </text>
+ <check_box initial_value="true" label="Incluir la ubicación de SL al final de la descripción" name="add_location_cb"/>
+ <text name="tags_label">
+ Etiquetas:
+ </text>
+ <text name="tags_help_label">
+ Separa las etiquetas con espacios
+Usa &quot;&quot; para las etiquetas con varias palabras
+ </text>
+ <combo_box name="rating_combobox" tool_tip="Calificación de contenido de Flickr">
+ <combo_box.item label="Calificación segura de Flickr" name="SafeRating"/>
+ <combo_box.item label="Calificación moderada de Flickr" name="ModerateRating"/>
+ <combo_box.item label="Calificación restringida de Flickr" name="RestrictedRating"/>
+ </combo_box>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="Subir" name="post_photo_btn"/>
+ <button label="Cancelar" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_group_bulk_ban.xml b/indra/newview/skins/default/xui/es/panel_group_bulk_ban.xml
new file mode 100644
index 0000000000..2d308a43c3
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/panel_group_bulk_ban.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel label="Expulsar residentes" name="bulk_ban_panel">
+ <panel.string name="loading">
+ (cargando...)
+ </panel.string>
+ <panel.string name="ban_selection_too_large">
+ Las expulsiones del grupo no se han enviado: has seleccionado demasiados residentes. Solo se permiten 100 expulsiones del grupo por solicitud.
+ </panel.string>
+ <panel.string name="ban_not_permitted">
+ La expulsión del grupo no se ha enviado: no tienes la capacidad &apos;Administrar la lista de expulsados&apos;.
+ </panel.string>
+ <panel.string name="ban_limit_fail">
+ La expulsión del grupo no se ha enviado: tu grupo ha alcanzado el límite máximo permitido de expulsiones.
+ </panel.string>
+ <panel.string name="partial_ban">
+ No se han enviado algunas expulsiones del grupo:
+[REASONS]
+ </panel.string>
+ <panel.string name="ban_failed">
+ Las expulsiones del grupo no se enviaron:
+[REASONS]
+ </panel.string>
+ <panel.string name="residents_already_banned">
+ - Los siguientes residentes ya han sido expulsados: [RESIDENTS].
+ </panel.string>
+ <panel.string name="ban_limit_reached">
+ - Se ha alcanzado el límite de expulsiones. Los agentes siguientes no se han expulsado: [RESIDENTS].
+ </panel.string>
+ <panel.string name="cant_ban_yourself">
+ - No te puedes expulsar a ti mismo del grupo.
+ </panel.string>
+ <text name="help_text">
+ Puedes seleccionar varios residentes para su expulsión del grupo. Para empezar, pulsa &apos;Abrir el selector de residentes&apos;.
+ </text>
+ <button label="Abrir el selector de residentes" name="add_button"/>
+ <name_list name="banned_agent_list" tool_tip="Para seleccionar varios residentes, pulsa sus nombres mientras mantienes apretada la tecla Ctrl"/>
+ <button label="Quitar seleccionados de la lista" name="remove_button" tool_tip="Quita los residentes seleccionados de la lista de expulsados"/>
+ <button label="Expulsar residentes" name="ban_button"/>
+ <button label="Cancelar" name="cancel_button"/>
+ <string name="GroupBulkBan">
+ Expulsión de grupo
+ </string>
+</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/es/panel_group_info_sidetray.xml
index 09c4eec4d9..18eaa834da 100755
--- a/indra/newview/skins/default/xui/es/panel_group_info_sidetray.xml
+++ b/indra/newview/skins/default/xui/es/panel_group_info_sidetray.xml
@@ -20,7 +20,7 @@
<layout_panel name="group_accordions">
<accordion name="groups_accordion">
<accordion_tab name="group_general_tab" title="General"/>
- <accordion_tab name="group_roles_tab" title="Roles"/>
+ <accordion_tab name="group_roles_tab" title="Miembros y Roles"/>
<accordion_tab name="group_notices_tab" title="Avisos"/>
<accordion_tab name="group_land_tab" title="Terreno/Bienes"/>
</accordion>
diff --git a/indra/newview/skins/default/xui/es/panel_group_invite.xml b/indra/newview/skins/default/xui/es/panel_group_invite.xml
index 319e9d0f1b..8ddeb5a1de 100755
--- a/indra/newview/skins/default/xui/es/panel_group_invite.xml
+++ b/indra/newview/skins/default/xui/es/panel_group_invite.xml
@@ -22,7 +22,7 @@
Elegir qué rol asignarles:
</text>
<combo_box name="role_name" tool_tip="Elige el rol de entre la lista de aquellos que estás autorizado a asignar"/>
- <button label="Enviar las invitaciones" name="ok_button"/>
+ <button label="Enviar invitaciones" name="invite_button"/>
<button label="Cancelar" name="cancel_button"/>
<string name="GroupInvitation">
Invitar al grupo
diff --git a/indra/newview/skins/default/xui/es/panel_group_roles.xml b/indra/newview/skins/default/xui/es/panel_group_roles.xml
index 390b4e2e9d..54a5566600 100755
--- a/indra/newview/skins/default/xui/es/panel_group_roles.xml
+++ b/indra/newview/skins/default/xui/es/panel_group_roles.xml
@@ -20,16 +20,18 @@ Seleccione varios nombres manteniendo pulsada la tecla Ctrl y pulsando en cada u
<name_list.columns label="Miembro" name="name"/>
<name_list.columns label="Donaciones" name="donated"/>
<name_list.columns label="Estatus" name="online"/>
+ <name_list.columns label="Cargo" name="title"/>
</name_list>
<button label="Invitar" name="member_invite"/>
<button label="Expulsar" name="member_eject"/>
+ <button label="Expulsar miembro(s)" name="member_ban"/>
</panel>
<panel label="ROLES" name="roles_sub_tab">
<panel.string name="help_text">
Los roles tienen una etiqueta propia y unas capacidades que se
-permiten ejercer a sus miembros. Los miembros pueden
-tener más de un rol. Un grupo puede tener hasta 10 roles,
-incluyendo el de Todos y el de Propietarios.
+ permiten ejercer a sus miembros. Los miembros pueden
+ tener más de un rol. Un grupo puede tener hasta 10 roles,
+ incluidos los roles Todos y Propietarios.
</panel.string>
<panel.string name="cant_delete_role">
Los roles de &apos;Todos&apos; y &apos;Propietarios&apos; son especiales, y no pueden eliminarse.
@@ -48,7 +50,8 @@ incluyendo el de Todos y el de Propietarios.
</panel>
<panel height="148" label="CAPACIDADES" name="actions_sub_tab" tool_tip="Puedes ver una descripción de la capacidad y qué miembros y roles la tienen.">
<panel.string name="help_text">
- Las capacidades permiten a los miembros que tienen ese rol el hacer tareas específicas dentro de este grupo. Hay una gran variedad de capacidades.
+ Las capacidades permiten a los miembros con roles hacer
+ cosas concretas en el grupo. Las hay de muchos tipos.
</panel.string>
<filter_editor label="Filtrar las capacidades" name="filter_input"/>
<scroll_list bottom_delta="-120" height="118" name="action_list" tool_tip="Elige una capacidad para verla más en detalle">
@@ -56,6 +59,21 @@ incluyendo el de Todos y el de Propietarios.
<scroll_list.columns label="" name="action"/>
</scroll_list>
</panel>
+ <panel label="RESIDENTES EXPULSADOS" name="banlist_sub_tab" tool_tip="Muestra los residentes expulsados de este grupo.">
+ <panel.string name="help_text">
+ Los residentes que figuren en la lista de expulsados no podrán unirse al grupo.
+ </panel.string>
+ <panel.string name="ban_count_template">
+ Número de expulsados: [COUNT]/[LIMIT]
+ </panel.string>
+ <name_list name="ban_list">
+ <name_list.columns label="Residente" name="name"/>
+ <name_list.columns label="Fecha de expulsión" name="ban_date"/>
+ </name_list>
+ <button label="Expulsar residente(s)" name="ban_create" tool_tip="Expulsa residentes del grupo"/>
+ <button label="Anular expulsión" name="ban_delete" tool_tip="Readmite en el grupo a los residentes seleccionados"/>
+ <button name="ban_refresh" tool_tip="Actualiza la lista de expulsados"/>
+ </panel>
</tab_container>
<panel name="members_footer">
<text name="static">
diff --git a/indra/newview/skins/default/xui/es/panel_login.xml b/indra/newview/skins/default/xui/es/panel_login.xml
index 1d7f077fe7..253d0800e1 100755
--- a/indra/newview/skins/default/xui/es/panel_login.xml
+++ b/indra/newview/skins/default/xui/es/panel_login.xml
@@ -1,46 +1,27 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8"?>
<panel name="panel_login">
<panel.string name="forgot_password_url">
http://secondlife.com/account/request.php?lang=es
</panel.string>
- <layout_stack name="login_widgets">
- <layout_panel name="login">
- <text name="log_in_text">
- INICIAR SESIÓN
- </text>
- <text name="username_text">
- Nombre de usuario:
- </text>
- <combo_box name="username_combo" tool_tip="El nombre de usuario que elegiste al registrarte, como bobsmith12 o Steller Sunshine"/>
- <text name="password_text">
- Contraseña:
- </text>
- </layout_panel>
- <layout_panel name="start_location_panel">
- <text name="start_location_text">
- Empezar en:
- </text>
- <combo_box name="start_location_combo">
- <combo_box.item label="Mi última posición" name="MyLastLocation"/>
- <combo_box.item label="Mi Base" name="MyHome"/>
- <combo_box.item label="&lt;Escribe el nombre de la región&gt;" name="Typeregionname"/>
- </combo_box>
- </layout_panel>
- <layout_panel name="links_login_panel">
- <text name="login_help">
- ¿Necesitas ayuda para conectarte?
- </text>
+ <layout_stack name="ui_stack">
+ <layout_panel name="ui_container">
+ <combo_box label="Nombre de usuario" name="username_combo" tool_tip="El nombre de usuario que elegiste al registrarte, como bobsmith12 o Steller Sunshine"/>
+ <line_editor label="Contraseña" name="password_edit"/>
+ <check_box label="Recordarme" name="remember_check"/>
<text name="forgot_password_text">
- ¿Olvidaste el nombre de usuario o la contraseña?
+ Contraseña olvidada
</text>
<button label="Iniciar sesión" name="connect_btn"/>
- <check_box label="Recordar la contraseña" name="remember_check"/>
- </layout_panel>
- <layout_panel name="links">
- <text name="create_account_text">
- CREA TU CUENTA
+ <text name="At_My_Last_Location_Label">
+ en mi última posición
</text>
- <button label="Iniciar ahora" name="create_new_account_btn"/>
+ <combo_box label="Mis lugares favoritos" name="start_location_combo">
+ <combo_box.item label="Mi Base" name="MyHome"/>
+ </combo_box>
+ <button label="Iniciar sesión" name="connect_favorite_btn"/>
+ <line_editor label="Especifica una ubicación" name="location_edit"/>
+ <button label="Iniciar sesión" name="connect_location_btn"/>
+ <combo_box label="Seleccionar cuadrícula" name="server_combo"/>
</layout_panel>
</layout_stack>
</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_login_first.xml b/indra/newview/skins/default/xui/es/panel_login_first.xml
new file mode 100644
index 0000000000..7787c6526f
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/panel_login_first.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_login">
+ <panel.string name="forgot_password_url">
+ http://secondlife.com/account/request.php?lang=es
+ </panel.string>
+ <layout_stack name="logo_stack">
+ <layout_panel name="parent_panel2">
+ <layout_stack name="widget_stack">
+ <layout_panel name="widget_container">
+ <combo_box label="Nombre de usuario" name="username_combo" tool_tip="El nombre de usuario que elegiste al registrarte, como bobsmith12 o Steller Sunshine"/>
+ <line_editor label="Contraseña" name="password_edit"/>
+ <button label="Iniciar sesión" name="connect_btn"/>
+ <check_box label="Recordarme" name="remember_check"/>
+ <text name="forgot_password_text">
+ Contraseña olvidada
+ </text>
+ </layout_panel>
+ </layout_stack>
+ </layout_panel>
+ <layout_panel name="parent_panel3">
+ <layout_stack name="images_stack">
+ <layout_panel name="images_container">
+ <text name="image_caption_left">
+ Tu primer destino es la Isla de aprendizaje. ¡Encuentra el portal de salida!
+ </text>
+ <text name="image_caption_right">
+ A continuación, puedes explorar la Isla social y hablar con otros residentes nuevos.
+ </text>
+ </layout_panel>
+ </layout_stack>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/es/panel_preferences_advanced.xml
index 620a95de4d..2599d951d7 100755
--- a/indra/newview/skins/default/xui/es/panel_preferences_advanced.xml
+++ b/indra/newview/skins/default/xui/es/panel_preferences_advanced.xml
@@ -28,4 +28,5 @@
<check_box label="Mostrar la selección de cuadrícula al iniciar sesión" name="show_grid_selection_check"/>
<check_box label="Mostrar el menú Avanzado" name="show_advanced_menu_check"/>
<check_box label="Mostrar el menú Develop" name="show_develop_menu_check"/>
+ <button label="Permisos de creación predeterminados" name="default_creation_permissions"/>
</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_preferences_general.xml b/indra/newview/skins/default/xui/es/panel_preferences_general.xml
index 98b0081da9..e68faf6e99 100755
--- a/indra/newview/skins/default/xui/es/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/es/panel_preferences_general.xml
@@ -30,14 +30,10 @@
<combo_box.item label="General y Moderado" name="Desired_Mature"/>
<combo_box.item label="General" name="Desired_PG"/>
</combo_box>
- <text name="start_location_textbox">
- Localización inicial:
+ <check_box label="Mostrar los lugares favoritos en la pantalla de inicio de sesión" name="favorites_on_login_check"/>
+ <text name="favorites_check_extra_text">
+ (También los verán los demás usuarios de este equipo)
</text>
- <combo_box name="start_location_combo">
- <combo_box.item label="Mi última posición" name="MyLastLocation" tool_tip="Por defecto, iniciar sesión en mi última posición."/>
- <combo_box.item label="Mi Base" name="MyHome" tool_tip="Por defecto, iniciar sesión en mi Base."/>
- </combo_box>
- <check_box initial_value="true" label="Mostrar en la pantalla de conexión" name="show_location_checkbox"/>
<text name="name_tags_textbox">
Etiquetas de los nombres:
</text>
diff --git a/indra/newview/skins/default/xui/es/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/es/panel_preferences_privacy.xml
index c162130af6..db98ee088e 100755
--- a/indra/newview/skins/default/xui/es/panel_preferences_privacy.xml
+++ b/indra/newview/skins/default/xui/es/panel_preferences_privacy.xml
@@ -7,11 +7,11 @@
<text name="cache_size_label_l">
(Localizaciones, imágenes, web, historial de búsqueda)
</text>
- <check_box label="Mostrarme en los resultados de la búsqueda" name="online_searchresults"/>
+ <check_box label="Mostrar datos de mi perfil en los resultados de la búsqueda" name="online_searchresults"/>
<check_box label="Sólo saben si estoy conectado mis amigos y grupos" name="online_visibility"/>
<check_box label="Sólo pueden llamarme o mandarme un MI mis amigos y grupos" name="voice_call_friends_only_check"/>
<check_box label="Desconectar el micrófono cuando finalicen las llamadas" name="auto_disengage_mic_check"/>
- <check_box label="Mostrar mis Hitos favoritos al Inicio de sesión (menú desplegable &quot;Empezar &#10;en&quot;)" name="favorites_on_login_check" top_pad="15"/>
+ <check_box label="Mostrar mis Hitos favoritos al Inicio de sesión (menú desplegable &quot;Empezar en&quot;)" name="favorites_on_login_check" top_pad="15"/>
<text name="Logs:">
Registros de chat:
</text>
diff --git a/indra/newview/skins/default/xui/es/panel_region_debug.xml b/indra/newview/skins/default/xui/es/panel_region_debug.xml
index 71bdba1a25..f6676967f5 100755
--- a/indra/newview/skins/default/xui/es/panel_region_debug.xml
+++ b/indra/newview/skins/default/xui/es/panel_region_debug.xml
@@ -7,11 +7,8 @@
desconocida
</text>
<check_box label="Desactivar los scripts" name="disable_scripts_check" tool_tip="Descativar todos los scripts en esta región"/>
- <button label="?" left="215" name="disable_scripts_help"/>
<check_box label="Desactivar las colisiones" name="disable_collisions_check" tool_tip="Desactiva las colisiones (no las de avatares) en esta región"/>
- <button label="?" left="215" name="disable_collisions_help"/>
<check_box label="Desactivar las propiedades físicas" name="disable_physics_check" tool_tip="Desactiva toda la física en esta región"/>
- <button label="?" left="215" name="disable_physics_help"/>
<button label="Aplicar" name="apply_btn"/>
<text name="objret_text_lbl" width="130">
Devolver el objeto
@@ -31,10 +28,8 @@
<check_box label="En cada región de este estado" name="return_estate_wide" tool_tip="Devolver los objetos de todas las regiones que forman este estado"/>
<button label="Devolver" name="return_btn"/>
<button label="Listar los objetos que colisionan..." name="top_colliders_btn" tool_tip="Lista de los objetos con más posibles colisiones potenciales" width="280"/>
- <button label="?" left="297" name="top_colliders_help"/>
- <button label="Listar los scripts según su uso..." name="top_scripts_btn" tool_tip="Lista de los objetos que más tiempo emplean ejecutando scripts" width="280"/>
- <button label="?" left="297" name="top_scripts_help"/>
<button label="Reiniciar la región" name="restart_btn" tool_tip="Cuenta atrás de 2 minutos y reiniciar la región"/>
- <button label="?" name="restart_help"/>
+ <button label="Listar los scripts según su uso..." name="top_scripts_btn" tool_tip="Lista de los objetos que más tiempo emplean ejecutando scripts" width="280"/>
<button label="Cancelar reinicio" name="cancel_restart_btn" tool_tip="Cancelar el reinicio de región"/>
+ <button label="Consola de depuración de región" name="region_debug_console_btn" tool_tip="Abrir consola de depuración de región"/>
</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_region_general.xml b/indra/newview/skins/default/xui/es/panel_region_general.xml
index 453d1fe43c..82149e1c7c 100755
--- a/indra/newview/skins/default/xui/es/panel_region_general.xml
+++ b/indra/newview/skins/default/xui/es/panel_region_general.xml
@@ -20,12 +20,12 @@
</text>
<check_box label="No permitir modificar el terreno" name="block_terraform_check"/>
<check_box label="Prohibir volar" name="block_fly_check"/>
+ <check_box label="Bloquear el vuelo sobre parcelas" name="block_fly_over_check" tool_tip="Extender las comprobaciones de acceso en vertical para impedir el vuelo sobre una parcela"/>
<check_box label="Permitir el daño" name="allow_damage_check"/>
<check_box label="Impedir los &apos;empujones&apos;" name="restrict_pushobject"/>
<check_box label="Permitir la reventa del terreno" name="allow_land_resell_check"/>
<check_box label="Permitir unir/dividir el terreno" name="allow_parcel_changes_check"/>
<check_box label="Bloquear el mostrar el terreno en la búsqueda" name="block_parcel_search_check" tool_tip="Permitir que la gente vea esta región y sus parcelas en los resultados de la búsqueda."/>
- <check_box label="Permitir objetos de red" name="mesh_rez_enabled_check" tool_tip="Permitir que los usuarios creen objetos de red en esta región"/>
<spinner label="Nº máximo de avatares" label_width="120" name="agent_limit_spin" width="180"/>
<spinner label="Plus de objetos" label_width="120" name="object_bonus_spin" width="180"/>
<text label="Calificación" name="access_text">
diff --git a/indra/newview/skins/default/xui/es/panel_script_ed.xml b/indra/newview/skins/default/xui/es/panel_script_ed.xml
index 87314820a6..89e9304693 100755
--- a/indra/newview/skins/default/xui/es/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/es/panel_script_ed.xml
@@ -24,6 +24,7 @@
<menu_item_call label="Deshacer todos los cambios" name="Revert All Changes"/>
<menu_item_call label="Cargar desde archivo..." name="LoadFromFile"/>
<menu_item_call label="Guardar en archivo..." name="SaveToFile"/>
+ <menu_item_call label="Colores..." name="Colors"/>
</menu>
<menu label="Editar" name="Edit">
<menu_item_call label="Deshacer" name="Undo"/>
@@ -41,9 +42,9 @@
<menu_item_call label="Ayuda de palabras clave..." name="Keyword Help..."/>
</menu>
</menu_bar>
- <text_editor name="Script Editor">
+ <script_editor name="Script Editor">
Cargando...
- </text_editor>
+ </script_editor>
<combo_box label="Insertar..." name="Insert..."/>
<button label="Guardar" label_selected="Guardar" name="Save_btn"/>
<button label="Editar..." name="Edit_btn"/>
diff --git a/indra/newview/skins/default/xui/es/panel_snapshot_options.xml b/indra/newview/skins/default/xui/es/panel_snapshot_options.xml
index 2b2584f66c..f4bfc0e0b5 100755
--- a/indra/newview/skins/default/xui/es/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/es/panel_snapshot_options.xml
@@ -4,4 +4,13 @@
<button label="Correo-e" name="save_to_email_btn"/>
<button label="Guardar en Mi inventario ([AMOUNT] L$)" name="save_to_inventory_btn"/>
<button label="Guardar en mi ordenador" name="save_to_computer_btn"/>
+ <text name="send_to_facebook_textbox">
+ Enviar a: [secondlife:/// Facebook]
+ </text>
+ <text name="send_to_twitter_textbox">
+ [secondlife:/// Twitter]
+ </text>
+ <text name="send_to_flickr_textbox">
+ [secondlife:/// Flickr]
+ </text>
</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_teleport_history_item.xml b/indra/newview/skins/default/xui/es/panel_teleport_history_item.xml
index 10b37b6880..b5917319e0 100755
--- a/indra/newview/skins/default/xui/es/panel_teleport_history_item.xml
+++ b/indra/newview/skins/default/xui/es/panel_teleport_history_item.xml
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="teleport_history_item">
+ <text name="timestamp" value="..."/>
<button name="profile_btn" tool_tip="Mostrar la información del ítem"/>
</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_twitter_account.xml b/indra/newview/skins/default/xui/es/panel_twitter_account.xml
new file mode 100644
index 0000000000..f51af64b05
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/panel_twitter_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_twitter_account">
+ <string name="twitter_connected" value="Estás conectado a Twitter como:"/>
+ <string name="twitter_disconnected" value="No conectado a Twitter"/>
+ <text name="account_caption_label">
+ No estás conectado a Twitter.
+ </text>
+ <panel name="panel_buttons">
+ <button label="Conectar..." name="connect_btn"/>
+ <button label="Desconectar" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Twitter/ta-p/2435453 Aprende a publicar en Twitter]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/es/panel_twitter_photo.xml b/indra/newview/skins/default/xui/es/panel_twitter_photo.xml
new file mode 100644
index 0000000000..be1896b33b
--- /dev/null
+++ b/indra/newview/skins/default/xui/es/panel_twitter_photo.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_twitter_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="text_panel">
+ <text name="status_label">
+ ¿Qué está ocurriendo?
+ </text>
+ <text name="status_counter_label">
+ 140
+ </text>
+ <check_box initial_value="true" label="Incluir ubicación de SL" name="add_location_cb"/>
+ <check_box initial_value="true" label="Incluir una foto" name="add_photo_cb"/>
+ </layout_panel>
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="Resolución de imagen">
+ <combo_box.item label="Ventana actual" name="CurrentWindow"/>
+ <combo_box.item label="640 × 480" name="640x480"/>
+ <combo_box.item label="800 × 600" name="800x600"/>
+ <combo_box.item label="1024 × 768" name="1024x768"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="Filtros de imagen">
+ <combo_box.item label="Sin filtro" name="NoFilter"/>
+ </combo_box>
+ <button label="Actualizar" name="new_snapshot_btn" tool_tip="Pulsa para actualizar"/>
+ <button label="Vista previa" name="big_preview_btn" tool_tip="Pulsa para alternar entre vista previa sí/no"/>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="Tuitear" name="post_photo_btn"/>
+ <button label="Cancelar" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/es/role_actions.xml b/indra/newview/skins/default/xui/es/role_actions.xml
index 902ed4df52..5e0c21992d 100755
--- a/indra/newview/skins/default/xui/es/role_actions.xml
+++ b/indra/newview/skins/default/xui/es/role_actions.xml
@@ -3,6 +3,7 @@
<action_set description="Estas capacidades incluyen poderes para añadir o quitar miembros del grupo, y para pemitir que se sumen nuevos miembros sin necesidad de invitación." name="Membership">
<action description="Invitar personas al grupo" longdescription="Invitar a gente a este grupo usando el botón &apos;Invitar&apos; en la sección Roles &gt; pestaña Miembros." name="member invite" value="1"/>
<action description="Expulsar a miembros del grupo" longdescription="Expulsar a miembros de este grupo usando el botón &apos;Expulsar&apos; en la sección Roles &gt; pestaña Miembros. Un propietario puede expulsar a cualquiera, excepto a otro propietario. Si no eres un propietario, un miembro puede ser expulsado única y exclusivamente si está en el rol de Cualquiera y NO en otros roles. Para quitar roles a los miembros, tienes que tener la capacidad de &apos;Quitar roles a los miembros&apos;." name="member eject" value="2"/>
+ <action description="Administra la lista de expulsados" longdescription="Permite que el miembro del grupo expulse a residentes de este grupo o los readmita." name="allow ban" value="51"/>
<action description="Cambiar &apos;Inscripción abierta&apos; y &apos;Cuota de inscripción&apos;" longdescription="En la sección General, cambiar la &apos;Inscripción abierta&apos; -que permite entrar al grupo sin invitación- y la &apos;Cuota de inscripción&apos;." name="member options" value="3"/>
</action_set>
<action_set description="Estas habilidades incluyen el poder añadir, quitar y cambiar roles, asignarlos a miembros, y darles capacidades." name="Roles">
diff --git a/indra/newview/skins/default/xui/es/sidepanel_inventory.xml b/indra/newview/skins/default/xui/es/sidepanel_inventory.xml
index f68dcc65e3..1e25a4a4a2 100755
--- a/indra/newview/skins/default/xui/es/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/es/sidepanel_inventory.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel label="Cosas" name="objects panel">
- <panel label="" name="sidepanel__inventory_panel">
+ <panel label="" name="sidepanel_inventory_panel">
<layout_stack name="inventory_layout_stack">
<layout_panel name="inbox_layout_panel">
<panel label="" name="marketplace_inbox">
@@ -14,7 +14,7 @@
<text name="inbox_fresh_new_count">
[NUM] nuevos
</text>
- <panel tool_tip="Drag and drop items to your inventory to manage and use them">
+ <panel name="inbox_inventory_placeholder_panel" tool_tip="Arrastra y coloca los artículos en tu inventario para poder utilizarlos">
<text name="inbox_inventory_placeholder">
Aquí se entregarán las compras realizadas en el mercado.
</text>
@@ -33,8 +33,8 @@
<layout_panel name="shop_btn_lp">
<button label="Comprar" name="shop_btn" tool_tip="Abrir la página web del mercado"/>
<button label="Ponerme" name="wear_btn" tool_tip="Ponerme el vestuario seleccionado"/>
- <button label="Play" name="play_btn"/>
- <button label="Teleporte" name="teleport_btn" tool_tip="Teleportar a la zona elegida"/>
+ <button label="Jugar" name="play_btn"/>
+ <button label="Teleportarte" name="teleport_btn" tool_tip="Teleportar a la zona elegida"/>
</layout_panel>
</layout_stack>
</panel>
diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml
index 484511a08b..bd339513b3 100755
--- a/indra/newview/skins/default/xui/es/strings.xml
+++ b/indra/newview/skins/default/xui/es/strings.xml
@@ -28,6 +28,45 @@
<string name="StartupRequireDriverUpdate">
Error de inicialización de gráficos. Actualiza tu controlador de gráficos.
</string>
+ <string name="AboutHeader">
+ [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2] ([VIEWER_VERSION_3]) [BUILD_DATE] [BUILD_TIME] ([CHANNEL])
+[[VIEWER_RELEASE_NOTES_URL] [ReleaseNotes]]
+ </string>
+ <string name="AboutCompiler">
+ Compilado con [COMPILER], versión [COMPILER_VERSION]
+ </string>
+ <string name="AboutPosition">
+ Estás en la posición [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1], de [REGION], alojada en &lt;nolink&gt;[HOSTNAME]&lt;/nolink&gt; ([HOSTIP])
+SLURL: &lt;nolink&gt;[SLURL]&lt;/nolink&gt;
+(coordenadas globales [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1])
+[SERVER_VERSION]
+[SERVER_RELEASE_NOTES_URL]
+ </string>
+ <string name="AboutSystem">
+ CPU: [CPU]
+Memoria: [MEMORY_MB] MB
+Versión del Sistema Operativo: [OS_VERSION]
+Fabricante de la tarjeta gráfica: [GRAPHICS_CARD_VENDOR]
+Tarjeta gráfica: [GRAPHICS_CARD]
+ </string>
+ <string name="AboutDriver">
+ Versión de Windows Graphics Driver: [GRAPHICS_DRIVER_VERSION]
+ </string>
+ <string name="AboutLibs">
+ Versión de OpenGL: [OPENGL_VERSION]
+
+Versión de libcurl: [LIBCURL_VERSION]
+Versión de J2C Decoder: [J2C_VERSION]
+Versión de Audio Driver: [AUDIO_DRIVER_VERSION]
+Versión de Qt Webkit: [QT_WEBKIT_VERSION]
+Versión del servidor de voz: [VOICE_VERSION]
+ </string>
+ <string name="AboutTraffic">
+ Paquetes perdidos: [PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number,1]%)
+ </string>
+ <string name="ErrorFetchingServerReleaseNotesURL">
+ Error al obtener la URL de las notas de la versión del servidor.
+ </string>
<string name="ProgressRestoring">
Restaurando...
</string>
@@ -287,6 +326,75 @@ Intenta iniciar sesión de nuevo en unos instantes.
<string name="TestingDisconnect">
Probando la desconexión del visor
</string>
+ <string name="SocialFlickrConnecting">
+ Conectándose a Flickr...
+ </string>
+ <string name="SocialFlickrPosting">
+ Publicando...
+ </string>
+ <string name="SocialFlickrDisconnecting">
+ Desconectándose de Flickr...
+ </string>
+ <string name="SocialFlickrErrorConnecting">
+ Problema con la conexión a Flickr
+ </string>
+ <string name="SocialFlickrErrorPosting">
+ Problema al publicar en Flickr
+ </string>
+ <string name="SocialFlickrErrorDisconnecting">
+ Problema con la desconexión de Flickr
+ </string>
+ <string name="SocialTwitterConnecting">
+ Conectándose a Twitter...
+ </string>
+ <string name="SocialTwitterPosting">
+ Publicando...
+ </string>
+ <string name="SocialTwitterDisconnecting">
+ Desconectándose de Twitter...
+ </string>
+ <string name="SocialTwitterErrorConnecting">
+ Problema con la conexión a Twitter
+ </string>
+ <string name="SocialTwitterErrorPosting">
+ Problema al publicar en Twitter
+ </string>
+ <string name="SocialTwitterErrorDisconnecting">
+ Problema con la desconexión de Twitter
+ </string>
+ <string name="BlackAndWhite">
+ Blanco y negro
+ </string>
+ <string name="Colors1970">
+ Colores de los 70
+ </string>
+ <string name="Intense">
+ Intenso
+ </string>
+ <string name="Newspaper">
+ Periódico
+ </string>
+ <string name="Sepia">
+ Sepia
+ </string>
+ <string name="Spotlight">
+ Foco
+ </string>
+ <string name="Video">
+ Vídeo
+ </string>
+ <string name="Autocontrast">
+ Contraste automático
+ </string>
+ <string name="LensFlare">
+ Destello de lente
+ </string>
+ <string name="Miniature">
+ Miniatura
+ </string>
+ <string name="Toycamera">
+ Cámara de juguete
+ </string>
<string name="TooltipPerson">
Persona
</string>
@@ -832,6 +940,12 @@ Intenta iniciar sesión de nuevo en unos instantes.
<string name="use_texture">
Usar textura
</string>
+ <string name="manip_hint1">
+ Pasa el cursor del ratón sobre la regla
+ </string>
+ <string name="manip_hint2">
+ para ajustar a la cuadrícula
+ </string>
<string name="texture_loading">
Cargando...
</string>
@@ -922,12 +1036,12 @@ Intenta iniciar sesión de nuevo en unos instantes.
<string name="ControlYourCamera">
Controlar su cámara
</string>
- <string name="AgentNameSubst">
- (Tú)
- </string>
<string name="TeleportYourAgent">
Teleportarte
</string>
+ <string name="AgentNameSubst">
+ (Tú)
+ </string>
<string name="JoinAnExperience">
Únete a una experiencia
</string>
@@ -1281,6 +1395,18 @@ Intenta iniciar sesión de nuevo en unos instantes.
<string name="InventoryOutboxNoItems">
Arrastra carpetas a esta sección y pulsa en &quot;Enviar al Mercado&quot; para incluirlas en la lista de venta del [[MARKETPLACE_DASHBOARD_URL] Mercado].
</string>
+ <string name="InventoryOutboxInitializingTitle">
+ Inicializando el Mercado.
+ </string>
+ <string name="InventoryOutboxInitializing">
+ Estamos accediendo a tu cuenta de la [[MARKETPLACE_CREATE_STORE_URL] tienda del Mercado].
+ </string>
+ <string name="InventoryOutboxErrorTitle">
+ Errores del Mercado.
+ </string>
+ <string name="InventoryOutboxError">
+ La [[MARKETPLACE_CREATE_STORE_URL] tienda del Mercado] devuelve errores.
+ </string>
<string name="Marketplace Error None">
Sin errores
</string>
@@ -1308,6 +1434,9 @@ Intenta iniciar sesión de nuevo en unos instantes.
<string name="Open landmarks">
Abrir hitos
</string>
+ <string name="Unconstrained">
+ Sin restricciones
+ </string>
<string name="no_transfer" value="(no transferible)"/>
<string name="no_modify" value="(no modificable)"/>
<string name="no_copy" value="(no copiable)"/>
@@ -1702,6 +1831,9 @@ Intenta iniciar sesión de nuevo en unos instantes.
<string name="CompileQueueDownloadedCompiling">
Descargado, compilándolo
</string>
+ <string name="CompileQueueServiceUnavailable">
+ El servicio de compilación de scripts no está disponible
+ </string>
<string name="CompileQueueScriptNotFound">
No se encuentra el script en el servidor.
</string>
@@ -3936,6 +4068,12 @@ Si sigues recibiendo este mensaje, contacta con [SUPPORT_SITE].
<string name="share_alert">
Arrastra los ítems desde el invenbtario hasta aquí
</string>
+ <string name="flickr_post_success">
+ Has publicado en Flickr.
+ </string>
+ <string name="twitter_post_success">
+ Has publicado en Twitter.
+ </string>
<string name="no_session_message">
(La sesión de MI no existe)
</string>
@@ -4392,6 +4530,9 @@ Denuncia de infracción
<string name="LocalEstimateUSD">
[AMOUNT] US$
</string>
+ <string name="Group Ban">
+ Expulsión de grupo
+ </string>
<string name="Membership">
Membresía
</string>
@@ -4814,6 +4955,12 @@ Inténtalo incluyendo la ruta de acceso al editor entre comillas
<string name="Command_Destinations_Label">
Destinos
</string>
+ <string name="Command_Facebook_Label">
+ Facebook
+ </string>
+ <string name="Command_Flickr_Label">
+ Flickr
+ </string>
<string name="Command_Gestures_Label">
Gestos
</string>
@@ -4862,6 +5009,9 @@ Inténtalo incluyendo la ruta de acceso al editor entre comillas
<string name="Command_Speak_Label">
Hablar
</string>
+ <string name="Command_Twitter_Label">
+ Twitter
+ </string>
<string name="Command_View_Label">
Controles de la cámara
</string>
@@ -4892,6 +5042,12 @@ Inténtalo incluyendo la ruta de acceso al editor entre comillas
<string name="Command_Destinations_Tooltip">
Destinos de interés
</string>
+ <string name="Command_Facebook_Tooltip">
+ Publicar en Facebook
+ </string>
+ <string name="Command_Flickr_Tooltip">
+ Subir a Flickr
+ </string>
<string name="Command_Gestures_Tooltip">
Gestos para tu avatar
</string>
@@ -4940,6 +5096,9 @@ Inténtalo incluyendo la ruta de acceso al editor entre comillas
<string name="Command_Speak_Tooltip">
Utiliza el micrófono para hablar con las personas próximas
</string>
+ <string name="Command_Twitter_Tooltip">
+ Twitter
+ </string>
<string name="Command_View_Tooltip">
Cambiando el ángulo de la cámara
</string>
diff --git a/indra/newview/skins/default/xui/fr/floater_big_preview.xml b/indra/newview/skins/default/xui/fr/floater_big_preview.xml
new file mode 100644
index 0000000000..0c09a4c188
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/floater_big_preview.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_big_preview" title="APERÇU"/>
diff --git a/indra/newview/skins/default/xui/fr/floater_facebook.xml b/indra/newview/skins/default/xui/fr/floater_facebook.xml
new file mode 100644
index 0000000000..12a3c9ae61
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/floater_facebook.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_facebook" title="PUBLIER SUR FACEBOOK">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="STATUT" name="panel_facebook_status"/>
+ <panel label="PHOTO" name="panel_facebook_photo"/>
+ <panel label="INDIQUER VOTRE PRÉSENCE" name="panel_facebook_place"/>
+ <panel label="AMIS" name="panel_facebook_friends"/>
+ <panel label="COMPTE" name="panel_facebook_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ Erreur
+ </text>
+ <text name="connection_loading_text">
+ Chargement...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/fr/floater_flickr.xml b/indra/newview/skins/default/xui/fr/floater_flickr.xml
new file mode 100644
index 0000000000..0432ae9459
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/floater_flickr.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_flickr" title="CHARGER DANS FLICKR">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="PHOTO" name="panel_flickr_photo"/>
+ <panel label="COMPTE" name="panel_flickr_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ Erreur
+ </text>
+ <text name="connection_loading_text">
+ Chargement...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/fr/floater_lagmeter.xml b/indra/newview/skins/default/xui/fr/floater_lagmeter.xml
index 39a861d8bd..39a861d8bd 100755..100644
--- a/indra/newview/skins/default/xui/fr/floater_lagmeter.xml
+++ b/indra/newview/skins/default/xui/fr/floater_lagmeter.xml
diff --git a/indra/newview/skins/default/xui/fr/floater_perms_default.xml b/indra/newview/skins/default/xui/fr/floater_perms_default.xml
new file mode 100644
index 0000000000..005daf7ec1
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/floater_perms_default.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="perms default" title="PERMISSIONS DE CRÉATION PAR DÉFAUT">
+ <panel label="Permissions par défaut" name="default permissions"/>
+ <button label="OK" label_selected="OK" name="ok"/>
+ <button label="Annuler" label_selected="Annuler" name="cancel"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/fr/floater_region_restarting.xml b/indra/newview/skins/default/xui/fr/floater_region_restarting.xml
new file mode 100644
index 0000000000..3a56a83c22
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/floater_region_restarting.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="region_restarting" title="REDÉMARRAGE DE LA RÉGION">
+ <string name="RegionName">
+ La région dans laquelle vous vous trouvez actuellement ([NAME]) est sur le point de redémarrer.
+
+Si vous restez dans cette région, vous serez déconnecté(e).
+ </string>
+ <string name="RestartSeconds">
+ Secondes avant le redémarrage
+[SECONDS]
+ </string>
+ <panel name="layout_panel_1">
+ <text name="region_name">
+ La région dans laquelle vous vous trouvez actuellement (-le nom de région le plus long-) est sur le point de redémarrer.
+
+Si vous restez dans cette région, vous serez déconnecté(e).
+ </text>
+ <text name="restart_seconds">
+ Secondes avant le redémarrage
+ 32767
+ </text>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/fr/floater_report_abuse.xml b/indra/newview/skins/default/xui/fr/floater_report_abuse.xml
index 78c35dc303..153be444e5 100755
--- a/indra/newview/skins/default/xui/fr/floater_report_abuse.xml
+++ b/indra/newview/skins/default/xui/fr/floater_report_abuse.xml
@@ -44,7 +44,7 @@
<combo_box.item label="Âge &gt; Résident adulte sur Second Life pour adolescents" name="Age__Adult_resident_on_Teen_Second_Life"/>
<combo_box.item label="Âge &gt; Résident mineur en dehors de Second Life pour adolescents" name="Age__Underage_resident_outside_of_Teen_Second_Life"/>
<combo_box.item label="Assaut &gt; Bac à sable utilisé pour des combats/zone non sécurisée" name="Assault__Combat_sandbox___unsafe_area"/>
- <combo_box.item label="Assaut &gt; Zone sécurisée" name="Assault__Safe_area"/>
+ <combo_box.item label="Assaut &gt; Tirer sur une personne avec une arme, pousser ou bousculer un résident dans une zone « sécurisée »" name="Assault__Safe_area"/>
<combo_box.item label="Assaut &gt; Bac à sable pour tests d&apos;armes à feu" name="Assault__Weapons_testing_sandbox"/>
<combo_box.item label="Commerce &gt; Incapacité à fournir un produit ou service" name="Commerce__Failure_to_deliver_product_or_service"/>
<combo_box.item label="Divulgation &gt; Informations sur la vie réelle" name="Disclosure__Real_world_information"/>
@@ -58,25 +58,25 @@
<combo_box.item label="Fraude &gt; L$" name="Fraud__L$"/>
<combo_box.item label="Fraude &gt; Terrain" name="Fraud__Land"/>
<combo_box.item label="Fraude &gt; Vente pyramidale ou lettre-chaîne" name="Fraud__Pyramid_scheme_or_chain_letter"/>
- <combo_box.item label="Fraude &gt; US$" name="Fraud__US$"/>
+ <combo_box.item label="Fraude &gt; L$ ou US$" name="Fraud__US$"/>
<combo_box.item label="Harcèlement &gt; Spam visuel" name="Harassment__Advert_farms___visual_spam"/>
<combo_box.item label="Harcèlement &gt; Diffamation envers des individus ou des groupes" name="Harassment__Defaming_individuals_or_groups"/>
<combo_box.item label="Harcèlement &gt; Immobilisation" name="Harassment__Impeding_movement"/>
<combo_box.item label="Harcèlement &gt; Harcèlement sexuel" name="Harassment__Sexual_harassment"/>
- <combo_box.item label="Harcèlement &gt; Incitation à enfreindre les Conditions d&apos;utilisation" name="Harassment__Solicting_inciting_others_to_violate_ToS"/>
+ <combo_box.item label="Harcèlement &gt; Comportement ciblé fait pour déranger" name="Harassment__Solicting_inciting_others_to_violate_ToS"/>
<combo_box.item label="Harcèlement &gt; Abus verbal" name="Harassment__Verbal_abuse"/>
<combo_box.item label="Indécence &gt; Contenu ou comportement offensifs" name="Indecency__Broadly_offensive_content_or_conduct"/>
<combo_box.item label="Indécence &gt; Nom d&apos;avatar inapproprié" name="Indecency__Inappropriate_avatar_name"/>
- <combo_box.item label="Indécence &gt; Contenu ou conduite inappropriés dans une région PG" name="Indecency__Mature_content_in_PG_region"/>
+ <combo_box.item label="Indécence &gt; Contenu ou conduite inappropriés pour la catégorie de région" name="Indecency__Mature_content_in_PG_region"/>
<combo_box.item label="Indécence &gt; Contenu ou conduite inappropriés dans une région modérée" name="Indecency__Inappropriate_content_in_Mature_region"/>
<combo_box.item label="Violation de droits de propriété intellectuelle &gt; Suppression de contenu" name="Intellectual_property_infringement_Content_Removal"/>
<combo_box.item label="Violation de droits de propriété intellectuelle &gt; CopyBot ou exploitation abusive des droits" name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit"/>
<combo_box.item label="Intolérance" name="Intolerance"/>
<combo_box.item label="Terrain &gt; Utilisation abusive des ressources du bac à sable" name="Land__Abuse_of_sandbox_resources"/>
- <combo_box.item label="Terrain &gt; Empiètement &gt; Objets/textures" name="Land__Encroachment__Objects_textures"/>
+ <combo_box.item label="Terrain &gt; Empiètement &gt; Objets ou textures" name="Land__Encroachment__Objects_textures"/>
<combo_box.item label="Terrain &gt; Empiètement &gt; Particules" name="Land__Encroachment__Particles"/>
<combo_box.item label="Terrain &gt; Empiètement &gt; Arbres/plantes" name="Land__Encroachment__Trees_plants"/>
- <combo_box.item label="Paris/jeux d&apos;argent" name="Wagering_gambling"/>
+ <combo_box.item label="Paris ou jeux d&apos;argent" name="Wagering_gambling"/>
<combo_box.item label="Autre" name="Other"/>
</combo_box>
<text name="abuser_name_title">
diff --git a/indra/newview/skins/default/xui/fr/floater_scene_load_stats.xml b/indra/newview/skins/default/xui/fr/floater_scene_load_stats.xml
new file mode 100644
index 0000000000..62830054bf
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/floater_scene_load_stats.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Scene Load Statistics" title="STATISTIQUES DE CHARGEMENT DE SCÈNE">
+ <button label="Pauser" name="playpause"/>
+ <scroll_container name="statistics_scroll">
+ <container_view name="statistics_view">
+ <stat_view label="Basique" name="basic">
+ <stat_bar label="Différence en pixels entre les images" name="frame difference"/>
+ <stat_bar label="Données UDP reçues" name="bandwidth"/>
+ <stat_bar label="Perte de paquets" name="packet_loss"/>
+ </stat_view>
+ <stat_view label="Avancé" name="advanced">
+ <stat_view label="Rendu" name="render">
+ <stat_bar label="Total des objets" name="objs"/>
+ <stat_bar label="Nouveaux objets" name="newobjs"/>
+ <stat_bar label="Taux de réussite du cache des objets" name="object_cache_hits"/>
+ </stat_view>
+ <stat_view label="Texture" name="texture">
+ <stat_bar label="Taux de réussite du cache" name="texture_cache_hits"/>
+ <stat_bar label="Latence de lecture du cache" name="texture_cache_read_latency"/>
+ <stat_bar label="Nombre" name="numimagesstat"/>
+ <stat_bar label="Nombre brut" name="numrawimagesstat"/>
+ </stat_view>
+ <stat_view label="Réseau" name="network">
+ <stat_bar label="Paquets en entrée" name="packetsinstat"/>
+ <stat_bar label="Paquets en sortie" name="packetsoutstat"/>
+ <stat_bar label="Objets" name="objectdatareceived"/>
+ <stat_bar label="Texture" name="texturedatareceived"/>
+ <stat_bar label="Actif" name="assetudpdatareceived"/>
+ <stat_bar label="Couches" name="layersdatareceived"/>
+ <stat_bar label="Arrivés" name="messagedatain"/>
+ <stat_bar label="Sortis" name="messagedataout"/>
+ <stat_bar label="Opérations VFS en attente" name="vfspendingoperations"/>
+ </stat_view>
+ </stat_view>
+ <stat_view label="Simulateur" name="sim">
+ <stat_bar label="Objets" name="simobjects"/>
+ <stat_bar label="Objets actifs" name="simactiveobjects"/>
+ <stat_bar label="Scripts actifs" name="simactivescripts"/>
+ <stat_bar label="Paquets en entrée" name="siminpps"/>
+ <stat_bar label="Paquets en sortie" name="simoutpps"/>
+ <stat_bar label="Téléchargements en attente" name="simpendingdownloads"/>
+ <stat_bar label="Chargements en attente" name="simpendinguploads"/>
+ <stat_bar label="Total d&apos;octets non reconnus" name="simtotalunackedbytes"/>
+ <stat_view label="Temps (ms)" name="simperf">
+ <stat_bar label="Durée totale de l&apos;image" name="simframemsec"/>
+ <stat_bar label="Durée nette" name="simnetmsec"/>
+ <stat_bar label="Durée physique" name="simsimphysicsmsec"/>
+ <stat_bar label="Durée de la simulation" name="simsimothermsec"/>
+ <stat_bar label="Durée des avatars" name="simagentmsec"/>
+ <stat_bar label="Durée des images" name="simimagesmsec"/>
+ <stat_bar label="Durée des scripts" name="simscriptmsec"/>
+ <stat_bar label="Temps d&apos;inactivité" name="simsparemsec"/>
+ <stat_view label="Détails de la durée (ms)" name="timedetails">
+ <stat_bar label="Étape propr. physiques" name="simsimphysicsstepmsec"/>
+ <stat_bar label="Mettre à jour les formes phys" name="simsimphysicsshapeupdatemsec"/>
+ <stat_bar label="Propriétés physiques Autre" name="simsimphysicsothermsec"/>
+ <stat_bar label="Temps de sommeil" name="simsleepmsec"/>
+ <stat_bar label="ES pompe" name="simpumpiomsec"/>
+ </stat_view>
+ </stat_view>
+ </stat_view>
+ </container_view>
+ </scroll_container>
+</floater>
diff --git a/indra/newview/skins/default/xui/fr/floater_script_ed_prefs.xml b/indra/newview/skins/default/xui/fr/floater_script_ed_prefs.xml
new file mode 100644
index 0000000000..d1e3de5f95
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/floater_script_ed_prefs.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_script_colors" title="COULEURS DE SCRIPT">
+ <text name="color_pickers_label">
+ Choisissez les couleurs :
+ </text>
+ <text name="text_label">
+ Texte
+ </text>
+ <text name="cursor_label">
+ Curseur
+ </text>
+ <text name="background_label">
+ Arrière-plan
+ </text>
+ <text name="datatype_label">
+ Types de données
+ </text>
+ <text name="event_label">
+ Événements
+ </text>
+ <text name="string_literal_label">
+ Littéraux de chaîne
+ </text>
+ <text name="constant_label">
+ Constante
+ </text>
+ <text name="flow_control_label">
+ Contrôle du flux
+ </text>
+ <text name="function_label">
+ Fonction
+ </text>
+ <text name="comment_label">
+ Commentaire
+ </text>
+ <script_editor name="Script Preview">
+ /* Un exemple de script */
+default
+{
+ state_entry()
+ {
+ // Comment
+ string greeting = &quot;Bonjour&quot;;
+ llSay(PUBLIC_CHANNEL, greeting);
+ }
+}
+ </script_editor>
+</floater>
diff --git a/indra/newview/skins/default/xui/fr/floater_snapshot.xml b/indra/newview/skins/default/xui/fr/floater_snapshot.xml
index 9244051edc..ab2256e356 100755
--- a/indra/newview/skins/default/xui/fr/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/fr/floater_snapshot.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Snapshot" title="APERÇU DE LA PHOTO">
+<floater name="Snapshot" title="PHOTO">
<floater.string name="unknown">
inconnu
</floater.string>
@@ -61,5 +61,11 @@
<check_box label="HUD" name="hud_check"/>
<check_box label="Arrêt sur image (plein écran)" name="freeze_frame_check"/>
<check_box label="Actualisation automatique" name="auto_snapshot_check"/>
+ <text name="filter_list_label">
+ Filtre :
+ </text>
+ <combo_box name="filters_combobox" tool_tip="Filtres d&apos;image">
+ <combo_box.item label="Aucun filtre" name="NoFilter"/>
+ </combo_box>
</panel>
</floater>
diff --git a/indra/newview/skins/default/xui/fr/floater_stats.xml b/indra/newview/skins/default/xui/fr/floater_stats.xml
index d6bd187956..fae17e3608 100755
--- a/indra/newview/skins/default/xui/fr/floater_stats.xml
+++ b/indra/newview/skins/default/xui/fr/floater_stats.xml
@@ -4,7 +4,7 @@
<container_view name="statistics_view">
<stat_view label="De base" name="basic">
<stat_bar label="FPS" name="fps"/>
- <stat_bar label="Bande passante" name="bandwidth"/>
+ <stat_bar label="Données UDP reçues" name="bandwidth"/>
<stat_bar label="Perte de paquets" name="packet_loss"/>
<stat_bar label="Ping sim" name="ping"/>
</stat_view>
@@ -12,9 +12,13 @@
<stat_view label="Rendu" name="render">
<stat_bar label="KTris par image" name="ktrisframe"/>
<stat_bar label="KTris par s" name="ktrissec"/>
- <stat_bar label="Objets totaux" name="objs"/>
+ <stat_bar label="Total des objets" name="totalobjs"/>
+ <stat_bar label="Objets en cache" name="cachedobjs"/>
<stat_bar label="Nouveaux objets" name="newobjs"/>
<stat_bar label="Taux de réussite du cache des objets" name="object_cache_hits"/>
+ <stat_bar label="Requêtes d&apos;occlusion effectuées" name="occlusion_queries"/>
+ <stat_bar label="Objets occlus" name="occluded"/>
+ <stat_bar label="Objets non occlus" name="unoccluded"/>
</stat_view>
<stat_view label="Texture" name="texture">
<stat_bar label="Taux de réussite du cache" name="texture_cache_hits"/>
@@ -26,15 +30,32 @@
<stat_bar label="Mém brute" name="rawmemstat"/>
<stat_bar label="Mém liée" name="glboundmemstat"/>
</stat_view>
+ <stat_view label="Utilisation de la mémoire" name="memory">
+ <stat_bar label="LLTrace" name="LLTrace"/>
+ <stat_bar label="Interface" name="LLView"/>
+ <stat_bar label="Polices" name="LLFontFreetype"/>
+ <stat_bar label="Inventaire" name="LLInventoryObject"/>
+ <stat_bar label="Objets du client" name="LLViewerObject"/>
+ <stat_bar label="Données de groupe Octree" name="LLViewerOctreeGroup"/>
+ <stat_bar label="Données Octree" name="LLViewerOctreeEntry"/>
+ <stat_bar label="Cache des objets du client" name="LLVOCacheEntry"/>
+ <stat_bar label="Dessinables" name="LLDrawable"/>
+ <stat_bar label="Données de visage" name="LLFace"/>
+ <stat_bar label="Informations de tracé" name="LLDrawInfo"/>
+ <stat_bar label="Données de texture" name="LLTexture"/>
+ <stat_bar label="Données d&apos;image" name="LLImage"/>
+ <stat_bar label="Données d&apos;image GL" name="LLImageGL"/>
+ <stat_bar label="Tampon des sommets" name="LLVertexBuffer"/>
+ </stat_view>
<stat_view label="Réseau" name="network">
<stat_bar label="Paquets en entrée" name="packetsinstat"/>
<stat_bar label="Paquets en sortie" name="packetsoutstat"/>
- <stat_bar label="Objets" name="objectkbitstat"/>
- <stat_bar label="Texture" name="texturekbitstat"/>
- <stat_bar label="Actif" name="assetkbitstat"/>
- <stat_bar label="Couches" name="layerskbitstat"/>
- <stat_bar label="Arrivés" name="actualinkbitstat"/>
- <stat_bar label="Sortis" name="actualoutkbitstat"/>
+ <stat_bar label="Objets" name="objectdatareceived"/>
+ <stat_bar label="Texture" name="texturedatareceived"/>
+ <stat_bar label="Actif" name="assetudpdatareceived"/>
+ <stat_bar label="Couches" name="layersdatareceived"/>
+ <stat_bar label="Arrivés" name="messagedatain"/>
+ <stat_bar label="Sortis" name="messagedataout"/>
<stat_bar label="Opérations VFS en attente" name="vfspendingoperations"/>
</stat_view>
</stat_view>
@@ -64,8 +85,8 @@
<stat_bar label="Paquets en sortie" name="simoutpps"/>
<stat_bar label="Téléchargements en attente" name="simpendingdownloads"/>
<stat_bar label="Chargements en attente" name="simpendinguploads"/>
- <stat_bar label="Total Unacked Bytes" name="simtotalunackedbytes"/>
- <stat_view label="Temps (ms)" name="simperf">
+ <stat_bar label="Total de données non reconnues" name="simtotalunackedbytes"/>
+ <stat_view label="Durée" name="simperf">
<stat_bar label="Durée totale de l&apos;image" name="simframemsec"/>
<stat_bar label="Durée nette" name="simnetmsec"/>
<stat_bar label="Durée sim (physique)" name="simsimphysicsmsec"/>
@@ -74,7 +95,7 @@
<stat_bar label="Durée des images" name="simimagesmsec"/>
<stat_bar label="Durée des scripts" name="simscriptmsec"/>
<stat_bar label="Temps d&apos;inactivité" name="simsparemsec"/>
- <stat_view label="Détails Temps (ms)" name="timedetails">
+ <stat_view label="Détails de la durée" name="timedetails">
<stat_bar label="Etape propr. physiques" name="simsimphysicsstepmsec"/>
<stat_bar label="Mettre à jour les formes phys" name="simsimphysicsshapeupdatemsec"/>
<stat_bar label="Propriétés physiques Autre" name="simsimphysicsothermsec"/>
diff --git a/indra/newview/skins/default/xui/fr/floater_tools.xml b/indra/newview/skins/default/xui/fr/floater_tools.xml
index 421e14d51b..b254a178f9 100755
--- a/indra/newview/skins/default/xui/fr/floater_tools.xml
+++ b/indra/newview/skins/default/xui/fr/floater_tools.xml
@@ -72,7 +72,7 @@
<check_box label="Modification liée" name="checkbox edit linked parts"/>
<button label="Lien" name="link_btn"/>
<button label="Annuler le lien" name="unlink_btn"/>
- <check_box label="" name="checkbox uniform"/>
+ <check_box label="Étirer les deux côtés" name="checkbox uniform"/>
<text label="Étirer les deux côtés" name="checkbox uniform label">
Étirer les deux côtés
</text>
diff --git a/indra/newview/skins/default/xui/fr/floater_twitter.xml b/indra/newview/skins/default/xui/fr/floater_twitter.xml
new file mode 100644
index 0000000000..9ca2b0d48d
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/floater_twitter.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_twitter" title="TWITTER">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="COMPOSER" name="panel_twitter_photo"/>
+ <panel label="COMPTE" name="panel_twitter_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ Erreur
+ </text>
+ <text name="connection_loading_text">
+ Chargement...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/fr/menu_avatar_icon.xml b/indra/newview/skins/default/xui/fr/menu_avatar_icon.xml
index 3bac25c79b..072ac0a6ae 100755
--- a/indra/newview/skins/default/xui/fr/menu_avatar_icon.xml
+++ b/indra/newview/skins/default/xui/fr/menu_avatar_icon.xml
@@ -2,6 +2,7 @@
<menu name="Avatar Icon Menu">
<menu_item_call label="Voir le profil" name="Show Profile"/>
<menu_item_call label="Envoyer IM..." name="Send IM"/>
+ <menu_item_call label="Demander téléportation" name="Request Teleport"/>
<menu_item_call label="Devenir amis..." name="Add Friend"/>
<menu_item_call label="Supprimer cet ami..." name="Remove Friend"/>
</menu>
diff --git a/indra/newview/skins/default/xui/fr/menu_conversation.xml b/indra/newview/skins/default/xui/fr/menu_conversation.xml
index 09109f4555..be110777c0 100644
--- a/indra/newview/skins/default/xui/fr/menu_conversation.xml
+++ b/indra/newview/skins/default/xui/fr/menu_conversation.xml
@@ -29,4 +29,5 @@
<menu_item_call label="Ignorer les autres" name="ModerateVoiceMute"/>
<menu_item_call label="Ne plus ignorer les autres" name="ModerateVoiceUnmute"/>
</context_menu>
+ <menu_item_call label="Bannir le membre" name="BanMember"/>
</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/fr/menu_inventory.xml b/indra/newview/skins/default/xui/fr/menu_inventory.xml
index 627d3068c3..87b11bdaa5 100755
--- a/indra/newview/skins/default/xui/fr/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/fr/menu_inventory.xml
@@ -70,6 +70,7 @@
<menu_item_call label="Jouer" name="Sound Play"/>
<menu_item_call label="Copier la SLurl" name="url_copy"/>
<menu_item_call label="À propos du repère" name="About Landmark"/>
+ <menu_item_call label="Voir sur la carte" name="show_on_map"/>
<menu_item_call label="Jouer dans Second Life" name="Animation Play"/>
<menu_item_call label="Jouer localement" name="Animation Audition"/>
<menu_item_call label="Envoyer un message instantané" name="Send Instant Message"/>
diff --git a/indra/newview/skins/default/xui/fr/menu_login.xml b/indra/newview/skins/default/xui/fr/menu_login.xml
index 7b1e106474..5e9969627d 100755
--- a/indra/newview/skins/default/xui/fr/menu_login.xml
+++ b/indra/newview/skins/default/xui/fr/menu_login.xml
@@ -5,7 +5,15 @@
<menu_item_call label="Quitter [APP_NAME]" name="Quit"/>
</menu>
<menu label="Aide" name="Help">
- <menu_item_call label="Aide de [SECOND_LIFE]" name="Second Life Help"/>
+ <menu_item_call label="Aide rapide..." name="How To"/>
+ <menu_item_call label="Démarrage rapide" name="Quickstart"/>
+ <menu_item_call label="Base de connaissances" name="Knowledge Base"/>
+ <menu_item_call label="Wiki" name="Wiki"/>
+ <menu_item_call label="Forums de la communauté" name="Community Forums"/>
+ <menu_item_call label="Portail d&apos;assistance" name="Support portal"/>
+ <menu_item_call label="Actualités [SECOND_LIFE]" name="Second Life News"/>
+ <menu_item_call label="Blogs [SECOND_LIFE]" name="Second Life Blogs"/>
+ <menu_item_call label="Signaler un bug" name="Report Bug"/>
<menu_item_call label="À propos de [APP_NAME]" name="About Second Life"/>
</menu>
<menu_item_check label="Afficher le menu de débogage" name="Show Debug Menu"/>
diff --git a/indra/newview/skins/default/xui/fr/menu_object.xml b/indra/newview/skins/default/xui/fr/menu_object.xml
index d7b69e495a..27e801d959 100755
--- a/indra/newview/skins/default/xui/fr/menu_object.xml
+++ b/indra/newview/skins/default/xui/fr/menu_object.xml
@@ -21,6 +21,7 @@
<context_menu label="Gérer" name="Remove">
<menu_item_call label="Signaler une infraction" name="Report Abuse..."/>
<menu_item_call label="Ignorer" name="Object Mute"/>
+ <menu_item_call label="Ne plus ignorer" name="Object Unmute"/>
<menu_item_call label="Retour" name="Return..."/>
</context_menu>
<menu_item_call label="Prendre" name="Pie Object Take"/>
diff --git a/indra/newview/skins/default/xui/fr/menu_teleport_history_item.xml b/indra/newview/skins/default/xui/fr/menu_teleport_history_item.xml
index fb4582dbce..ba8ed9b3f8 100755
--- a/indra/newview/skins/default/xui/fr/menu_teleport_history_item.xml
+++ b/indra/newview/skins/default/xui/fr/menu_teleport_history_item.xml
@@ -2,5 +2,5 @@
<context_menu name="Teleport History Item Context Menu">
<menu_item_call label="Téléporter" name="Teleport"/>
<menu_item_call label="Plus d&apos;informations" name="More Information"/>
- <menu_item_call label="Copier dans le presse-papiers" name="CopyToClipboard"/>
+ <menu_item_call label="Copier la SLurl" name="CopyToClipboard"/>
</context_menu>
diff --git a/indra/newview/skins/default/xui/fr/menu_viewer.xml b/indra/newview/skins/default/xui/fr/menu_viewer.xml
index 5d0026ace0..6e36d19ba9 100755
--- a/indra/newview/skins/default/xui/fr/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/fr/menu_viewer.xml
@@ -36,6 +36,9 @@
<menu_item_check label="Chat près de moi..." name="Nearby Chat"/>
<menu_item_check label="Parler" name="Speak"/>
<menu_item_check label="Journal des conversations..." name="Conversation Log..."/>
+ <menu_item_call label="Facebook..." name="Facebook"/>
+ <menu_item_call label="Twitter..." name="Twitter"/>
+ <menu_item_call label="Flickr..." name="Flickr"/>
<menu label="Effet de voix" name="VoiceMorphing">
<menu_item_check label="Aucun effet de voix" name="NoVoiceMorphing"/>
<menu_item_check label="Aperçu..." name="Preview"/>
@@ -72,11 +75,11 @@
<menu_item_check label="Menu Avancé" name="Show Advanced Menu"/>
</menu>
<menu label="Luminosité" name="Sun">
- <menu_item_call label="Aube" name="Sunrise"/>
- <menu_item_call label="Milieu de journée" name="Noon"/>
- <menu_item_call label="Coucher de soleil" name="Sunset"/>
- <menu_item_call label="Minuit" name="Midnight"/>
- <menu_item_call label="Utiliser les réglages de la région" name="Use Region Settings"/>
+ <menu_item_check label="Aube" name="Sunrise"/>
+ <menu_item_check label="Milieu de journée" name="Noon"/>
+ <menu_item_check label="Coucher de soleil" name="Sunset"/>
+ <menu_item_check label="Minuit" name="Midnight"/>
+ <menu_item_check label="Utiliser les réglages de la région" name="Use Region Settings"/>
</menu>
<menu label="Éditeur d&apos;environnement" name="Environment Editor">
<menu_item_call label="Paramètres d&apos;environnement..." name="Environment Settings"/>
@@ -150,7 +153,8 @@
<menu_item_check label="Fixer sur la grille" name="Snap to Grid"/>
<menu_item_call label="Fixer les coordonnées XY de l&apos;objet sur la grille" name="Snap Object XY to Grid"/>
<menu_item_call label="Utiliser la sélection pour la grille" name="Use Selection for Grid"/>
- <menu_item_call label="Options de la grille" name="Grid Options"/>
+ <menu_item_call label="Options de la grille..." name="Grid Options"/>
+ <menu_item_call label="Définir les permissions par défaut..." name="Set default permissions"/>
</menu>
<menu label="Charger" name="Upload">
<menu_item_call label="Image ([COST] L$)..." name="Upload Image"/>
@@ -158,15 +162,12 @@
<menu_item_call label="Animation ([COST] L$)..." name="Upload Animation"/>
<menu_item_call label="Modèle..." name="Upload Model"/>
<menu_item_call label="Lot ([COST] L$ par fichier)..." name="Bulk Upload"/>
- <menu_item_call label="Définir les droits de chargement par défaut" name="perm prefs"/>
</menu>
<menu_item_call label="Annuler" name="Undo"/>
<menu_item_call label="Refaire" name="Redo"/>
</menu>
<menu label="Aide" name="Help">
<menu_item_call label="Aide rapide..." name="How To"/>
- <menu_item_call label="Aide de [SECOND_LIFE]" name="Second Life Help"/>
- <menu_item_call label="Guide de l&apos;utilisateur" name="User’s guide"/>
<menu_item_call label="Base de connaissances" name="Knowledge Base"/>
<menu_item_call label="Wiki" name="Wiki"/>
<menu_item_call label="Forums de la communauté" name="Community Forums"/>
@@ -188,6 +189,7 @@
<menu label="Outils de performance" name="Performance Tools">
<menu_item_call label="Mesure du lag" name="Lag Meter"/>
<menu_item_check label="Barre de statistiques" name="Statistics Bar"/>
+ <menu_item_call label="Statistiques de chargement de scène" name="Scene Load Statistics"/>
<menu_item_check label="Afficher le poids de dessin pour les avatars" name="Avatar Rendering Cost"/>
</menu>
<menu label="Surbrillance et visibilité" name="Highlighting and Visibility">
@@ -250,6 +252,7 @@
<menu_item_check label="Chronos" name="Fast Timers"/>
<menu_item_check label="Mémoire" name="Memory"/>
<menu_item_check label="Statistiques de la scène" name="Scene Statistics"/>
+ <menu_item_check label="Moniteur de chargement de scène" name="Scene Loading Monitor"/>
<menu_item_call label="Console de débogage de la récupération des textures" name="Texture Fetch Debug Console"/>
<menu_item_call label="Infos de région vers la console de débogage" name="Region Info to Debug Console"/>
<menu_item_call label="Infos de groupe vers la console de débogage" name="Group Info to Debug Console"/>
@@ -286,6 +289,7 @@
<menu_item_check label="Cadre lent périodique" name="Periodic Slow Frame"/>
<menu_item_check label="Test cadre" name="Frame Test"/>
<menu_item_call label="Profil du cadre" name="Frame Profile"/>
+ <menu_item_call label="Référence" name="Benchmark"/>
</menu>
<menu label="Métadonnées de rendu" name="Render Metadata">
<menu_item_check label="Cadres" name="Bounding Boxes"/>
@@ -303,7 +307,9 @@
<menu_item_check label="Infos sur le niveau de détail" name="LOD Info"/>
<menu_item_check label="File d&apos;attente pour la construction" name="Build Queue"/>
<menu_item_check label="Lumières" name="Lights"/>
+ <menu_item_check label="Particules" name="Particles"/>
<menu_item_check label="Squelette de collision" name="Collision Skeleton"/>
+ <menu_item_check label="Articulations" name="Joints"/>
<menu_item_check label="Rayons" name="Raycast"/>
<menu_item_check label="Vecteurs de vent" name="Wind Vectors"/>
<menu_item_check label="Complexité du rendu" name="rendercomplexity"/>
@@ -336,6 +342,7 @@
<menu_item_check label="Rendu des lumières jointes" name="Render Attached Lights"/>
<menu_item_check label="Rendu des particules jointes" name="Render Attached Particles"/>
<menu_item_check label="Objets en surbrillance avec le pointeur" name="Hover Glow Objects"/>
+ <menu_item_call label="Vider le cache immédiatement" name="Cache Clear"/>
</menu>
<menu label="Réseau" name="Network">
<menu_item_check label="Pauser l&apos;avatar" name="AgentPause"/>
@@ -368,7 +375,6 @@
<menu_item_call label="Dump Focus Holder" name="Dump Focus Holder"/>
<menu_item_call label="Imprimer les infos sur l&apos;objet sélectionné" name="Print Selected Object Info"/>
<menu_item_call label="Imprimer les infos sur l&apos;avatar" name="Print Agent Info"/>
- <menu_item_check label="Console de débogage de région" name="Region Debug Console"/>
<menu_item_check label="Débogage SelectMgr" name="Debug SelectMgr"/>
<menu_item_check label="Débogage clics" name="Debug Clicks"/>
<menu_item_check label="Débogage des vues" name="Debug Views"/>
diff --git a/indra/newview/skins/default/xui/fr/notifications.xml b/indra/newview/skins/default/xui/fr/notifications.xml
index c295a6f5a7..2325c8e34d 100755
--- a/indra/newview/skins/default/xui/fr/notifications.xml
+++ b/indra/newview/skins/default/xui/fr/notifications.xml
@@ -114,15 +114,15 @@ Pour plus d&apos;informations, consultez le [[MARKETPLACE_IMPORTS_URL] journal d
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="OutboxImportFailed">
- Échec de transfert
+ Échec du transfert avec l&apos;erreur « [ERROR_CODE] »
-Aucun dossier n&apos;a été envoyé vers la Place du marché en raison d&apos;une erreur système ou réseau. Veuillez réessayer ultérieurement.
+Aucun dossier n&apos;a été envoyé vers la Place du marché en raison d&apos;une erreur système ou réseau. Réessayez ultérieurement.
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="OutboxInitFailed">
- Échec d&apos;initialisation de la Place du marché
+ Échec de l&apos;initialisation de la Place du marché avec l&apos;erreur « [ERROR_CODE] »
-L&apos;initialisation de la Place du marché a échoué en raison d&apos;une erreur système ou réseau. Veuillez réessayer ultérieurement.
+L&apos;initialisation de la Place du marché a échoué en raison d&apos;une erreur système ou réseau. Réessayez ultérieurement.
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="CompileQueueSaveText">
@@ -209,6 +209,22 @@ Ajouter ce pouvoir à « [ROLE_NAME] » ?
Ajouter ce pouvoir à « [ROLE_NAME] » ?
<usetemplate name="okcancelbuttons" notext="Non" yestext="Oui"/>
</notification>
+ <notification name="AssignBanAbilityWarning">
+ Vous êtes sur le point d&apos;ajouter le pouvoir « [ACTION_NAME] » au rôle « [ROLE_NAME] ».
+
+ *AVERTISSEMENT*
+Tout membre ayant un rôle doté de ce pouvoir disposera aussi des pouvoirs « [ACTION_NAME_2] » et « [ACTION_NAME_3] ».
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
+ <notification name="RemoveBanAbilityWarning">
+ Vous êtes sur le point de supprimer le pouvoir « [ACTION_NAME] » du rôle « [ROLE_NAME] ».
+
+ *AVERTISSEMENT*
+En supprimant ce pouvoir, vous ne supprimez PAS les pouvoirs « [ACTION_NAME_2] » et « [ACTION_NAME_3] ».
+
+Si vous ne voulez plus que ce rôle dispose de ces pouvoirs, désactivez-les immédiatement.
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
<notification name="EjectGroupMemberWarning">
Vous allez expulser [AVATAR_NAME] du groupe.
<usetemplate ignoretext="Confirmer l&apos;expulsion d&apos;un membre du groupe" name="okcancelignore" notext="Annuler" yestext="Expulser"/>
@@ -1576,6 +1592,14 @@ Quitter le groupe ?
Impossible de quitter le groupe. Vous ne pouvez pas quitter le groupe car vous en êtes le dernier propriétaire. Vous devez d&apos;abord affecter le rôle de propriétaire à un autre membre.
<usetemplate name="okbutton" yestext="OK"/>
</notification>
+ <notification name="GroupDepartError">
+ Impossible de quitter le groupe : [reason].
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
+ <notification name="GroupDepart">
+ Vous avez quitté le groupe [group_name].
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
<notification name="ConfirmKick">
Souhaitez-vous vraiment éjecter tous les résidents de la grille ?
<usetemplate name="okcancelbuttons" notext="Annuler" yestext="Éjecter tous les résidents"/>
@@ -1729,6 +1753,10 @@ or ce nombre dépasse la limite autorisée fixée à [LIMIT].
Souhaitez-vous vraiment vous téléporter vers &lt;nolink&gt;[LOCATION]&lt;/nolink&gt; ?
<usetemplate ignoretext="Confirmer que je veux me téléporter à un repère" name="okcancelignore" notext="Annuler" yestext="Téléporter"/>
</notification>
+ <notification name="TeleportViaSLAPP">
+ Voulez-vous vraiment vous téléporter jusqu&apos;à &lt;nolink&gt;[LOCATION]&lt;/nolink&gt; ?
+ <usetemplate ignoretext="Confirmer que je veux me téléporter en utilisant SLAPP" name="okcancelignore" notext="Annuler" yestext="Téléporter"/>
+ </notification>
<notification name="TeleportToPick">
Vous téléporter vers [PICK] ?
<usetemplate ignoretext="Confirmer que je veux me téléporter à un endroit dans mes Favoris" name="okcancelignore" notext="Annuler" yestext="Téléporter"/>
@@ -1939,6 +1967,9 @@ Cette action modifiera des milliers de régions et sera difficile à digérer po
<notification name="ProblemAddingEstateManager">
Problèmes lors de l&apos;ajout d&apos;un nouveau gérant de domaine. Il est possible qu&apos;au moins un des domaines ait une liste de gérants complète.
</notification>
+ <notification name="ProblemAddingEstateBanManager">
+ Impossible d&apos;ajouter le propriétaire ou le gérant du domaine à la liste des résidents bannis.
+ </notification>
<notification name="ProblemAddingEstateGeneric">
Problème lors de l&apos;ajout à la liste de ce domaine. Il est possible qu&apos;au moins un des domaines ait une liste complète.
</notification>
@@ -2453,6 +2484,12 @@ Veuillez sélectionner un terrain plus petit.
<notification name="SystemMessage">
[MESSAGE]
</notification>
+ <notification name="FlickrConnect">
+ [MESSAGE]
+ </notification>
+ <notification name="TwitterConnect">
+ [MESSAGE]
+ </notification>
<notification name="PaymentReceived">
[MESSAGE]
</notification>
@@ -3029,7 +3066,7 @@ Voir le fichier journal pour plus de détails.
avec les résidents suivants :
-[RESIDENTS] ?
+&lt;nolink&gt;[RESIDENTS]&lt;/nolink&gt;
<usetemplate name="okcancelbuttons" notext="Annuler" yestext="OK"/>
</notification>
<notification name="ShareFolderConfirmation">
@@ -3041,7 +3078,7 @@ Voulez-vous vraiment partager les articles suivants :
avec les résidents suivants :
-[RESIDENTS] ?
+&lt;nolink&gt;[RESIDENTS]&lt;/nolink&gt;
<usetemplate name="okcancelbuttons" notext="Annuler" yestext="Ok"/>
</notification>
<notification name="ItemsShared">
@@ -3496,10 +3533,6 @@ Veuillez réessayer dans une minute.
<notification name="EjectComingSoon">
Votre présence ici n&apos;est plus autorisée et vous disposez de [EJECT_TIME] secondes pour partir.
</notification>
- <notification name="NoEnterServerFull">
- Vous ne pouvez pas pénétrer dans cette région car
-le serveur est plein.
- </notification>
<notification name="SaveBackToInvDisabled">
Le réenregistrement dans l&apos;inventaire a été désactivé.
</notification>
@@ -3689,6 +3722,9 @@ le serveur est plein.
<notification name="LinkFailedTooMuchPhysics">
Cet objet utilise trop de ressources physiques - sa dynamique a été désactivée.
</notification>
+ <notification name="EstateManagerFailedllTeleportHome">
+ L&apos;objet « [OBJECT_NAME] » à [SLURL] ne peut pas téléporter les gérants de domaines chez eux.
+ </notification>
<notification name="TeleportedHomeByObjectOnParcel">
Vous avez été téléporté chez vous par l&apos;objet [OBJECT_NAME] sur la parcelle [PARCEL_NAME].
</notification>
@@ -3879,13 +3915,18 @@ le serveur est plein.
Pas suffisamment de parcelles louées dans la sélection pour effectuer la fusion.
</notification>
<notification name="CantDivideLandMultipleParcelsSelected">
- Division du terrain impossible.\nPlusieurs parcelles sont sélectionnées.\nVeuillez sélectionner un terrain plus petit.
+ Division du terrain impossible.
+Plusieurs parcelles sont sélectionnées.
+Veuillez sélectionner un terrain plus petit.
</notification>
<notification name="CantDivideLandCantFindParcel">
- Division du terrain impossible.\nParcelle introuvable.\nSignalez-le en allant à Aide -&gt; Signaler un bug...
+ Division du terrain impossible.
+Parcelle introuvable.
+Veuillez utiliser Aide &gt; Signaler un bug pour signaler le problème...
</notification>
<notification name="CantDivideLandWholeParcelSelected">
- Division du terrain impossible. Toute la parcelle est sélectionnée.\nVeuillez sélectionner un terrain plus petit.
+ Division du terrain impossible. La parcelle entière est sélectionnée.
+Veuillez sélectionner un terrain plus petit.
</notification>
<notification name="LandHasBeenDivided">
Le terrain a été divisé.
@@ -4025,4 +4066,12 @@ le serveur est plein.
Impossible de déplacer les fichiers. Chemin précédent rétabli.
<usetemplate ignoretext="Impossible de déplacer les fichiers. Chemin précédent rétabli." name="okignore" yestext="OK"/>
</notification>
+ <notification name="DefaultObjectPermissions">
+ Une erreur est survenue lors de l&apos;enregistrement des droits par défaut, suite au problème suivant : [REASON]. Réessayez de définir les droits par défaut ultérieurement.
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
+ <notification name="ChatHistoryIsBusyAlert">
+ Le fichier d&apos;historique des chats est occupé à traiter l&apos;opération précédente. Réessayez dans quelques minutes ou choisissez une autre personne pour le chat.
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
</notifications>
diff --git a/indra/newview/skins/default/xui/fr/panel_facebook_account.xml b/indra/newview/skins/default/xui/fr/panel_facebook_account.xml
new file mode 100644
index 0000000000..6406ae4ae7
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/panel_facebook_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_account">
+ <string name="facebook_connected" value="Vous êtes connecté(e) à Facebook en tant que :"/>
+ <string name="facebook_disconnected" value="Pas connecté(e) à Facebook"/>
+ <text name="account_caption_label">
+ Pas connecté(e) à Facebook.
+ </text>
+ <panel name="panel_buttons">
+ <button label="Connexion..." name="connect_btn"/>
+ <button label="Déconnexion" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Facebook/ta-p/2149711 Apprenez comment publier sur Facebook]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_facebook_friends.xml b/indra/newview/skins/default/xui/fr/panel_facebook_friends.xml
new file mode 100644
index 0000000000..3ac0ce229c
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/panel_facebook_friends.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_friends">
+ <string name="facebook_friends_empty" value="Vous n&apos;avez actuellement aucun ami Facebook qui est également résident de Second Life. Invitez vos amis Facebook à rejoindre Second Life !"/>
+ <string name="facebook_friends_no_connected" value="Vous n&apos;êtes pas connecté(e) à Facebook. Allez à l&apos;onglet Compte pour vous connecter et activer cette fonctionnalité."/>
+ <accordion name="friends_accordion">
+ <accordion_tab name="tab_second_life_friends" title="Amis SL"/>
+ <accordion_tab name="tab_suggested_friends" title="Ajouter ces personnes en tant qu&apos;amis SL"/>
+ </accordion>
+ <text name="facebook_friends_status">
+ Pas connecté(e) à Facebook.
+ </text>
+</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_facebook_photo.xml b/indra/newview/skins/default/xui/fr/panel_facebook_photo.xml
new file mode 100644
index 0000000000..c5b09c4bcc
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/panel_facebook_photo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="Résolution d’image">
+ <combo_box.item label="Fenêtre actuelle" name="CurrentWindow"/>
+ <combo_box.item label="640 x 480" name="640x480"/>
+ <combo_box.item label="800 x 600" name="800x600"/>
+ <combo_box.item label="1 024 x 768" name="1024x768"/>
+ <combo_box.item label="1 200 x 630" name="1200x630"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="Filtres d&apos;image">
+ <combo_box.item label="Aucun filtre" name="NoFilter"/>
+ </combo_box>
+ <button label="Actualiser" name="new_snapshot_btn" tool_tip="Cliquer pour actualiser"/>
+ <button label="Aperçu" name="big_preview_btn" tool_tip="Cliquer pour activer/désactiver l&apos;aperçu"/>
+ <text name="caption_label">
+ Commentaire (facultatif) :
+ </text>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="Publier" name="post_photo_btn"/>
+ <button label="Annuler" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_facebook_place.xml b/indra/newview/skins/default/xui/fr/panel_facebook_place.xml
new file mode 100644
index 0000000000..0eaea66ad4
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/panel_facebook_place.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_place">
+ <layout_stack name="stack_place">
+ <layout_panel name="place_detail_panel">
+ <text name="place_caption_label">
+ Dites quelque chose au sujet du lieu où vous vous trouvez :
+ </text>
+ </layout_panel>
+ <layout_panel name="place_map_panel">
+ <check_box initial_value="false" label="" name="add_place_view_cb"/>
+ </layout_panel>
+ <layout_panel name="place_button_panel">
+ <button label="Publier" name="post_place_btn"/>
+ <button label="Annuler" name="cancel_place_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_facebook_status.xml b/indra/newview/skins/default/xui/fr/panel_facebook_status.xml
new file mode 100644
index 0000000000..260378978b
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/panel_facebook_status.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_status">
+ <layout_stack name="stack_status">
+ <layout_panel name="status_detail_panel">
+ <text name="status_caption_label">
+ À quoi pensez-vous ?
+ </text>
+ </layout_panel>
+ <layout_panel name="status_button_panel">
+ <button label="Publier" name="post_status_btn"/>
+ <button label="Annuler" name="cancel_status_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_flickr_account.xml b/indra/newview/skins/default/xui/fr/panel_flickr_account.xml
new file mode 100644
index 0000000000..7082223b14
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/panel_flickr_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_flickr_account">
+ <string name="flickr_connected" value="Vous êtes connecté(e) à Flickr en tant que :"/>
+ <string name="flickr_disconnected" value="Pas connecté(e) à Flickr"/>
+ <text name="account_caption_label">
+ Pas connecté(e) à Flickr.
+ </text>
+ <panel name="panel_buttons">
+ <button label="Connexion..." name="connect_btn"/>
+ <button label="Déconnexion" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Flickr/ta-p/2435609 Apprenez comment publier sur Flickr]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_flickr_photo.xml b/indra/newview/skins/default/xui/fr/panel_flickr_photo.xml
new file mode 100644
index 0000000000..63738a773a
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/panel_flickr_photo.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_flickr_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="Résolution d’image">
+ <combo_box.item label="Fenêtre actuelle" name="CurrentWindow"/>
+ <combo_box.item label="640 x 480" name="640x480"/>
+ <combo_box.item label="800 x 600" name="800x600"/>
+ <combo_box.item label="1 024 x 768" name="1024x768"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="Filtres d&apos;image">
+ <combo_box.item label="Aucun filtre" name="NoFilter"/>
+ </combo_box>
+ <button label="Actualiser" name="new_snapshot_btn" tool_tip="Cliquer pour actualiser"/>
+ <button label="Aperçu" name="big_preview_btn" tool_tip="Cliquer pour activer/désactiver l&apos;aperçu"/>
+ <text name="title_label">
+ Titre :
+ </text>
+ <text name="description_label">
+ Description :
+ </text>
+ <check_box initial_value="true" label="Inclure l&apos;emplacement SL à la fin de la description" name="add_location_cb"/>
+ <text name="tags_label">
+ Balises :
+ </text>
+ <text name="tags_help_label">
+ Séparer les balises par des espaces
+Utiliser &quot;&quot; pour les balises contenant plusieurs mots
+ </text>
+ <combo_box name="rating_combobox" tool_tip="Catégorie de contenu Flickr">
+ <combo_box.item label="Catégorie de contenu Flickr sûr" name="SafeRating"/>
+ <combo_box.item label="Catégorie de contenu Flickr modéré" name="ModerateRating"/>
+ <combo_box.item label="Catégorie de contenu Flickr réservé aux adultes" name="RestrictedRating"/>
+ </combo_box>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="Charger" name="post_photo_btn"/>
+ <button label="Annuler" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_group_bulk_ban.xml b/indra/newview/skins/default/xui/fr/panel_group_bulk_ban.xml
new file mode 100644
index 0000000000..ee5b949995
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/panel_group_bulk_ban.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel label="Bannir des résidents" name="bulk_ban_panel">
+ <panel.string name="loading">
+ (en cours de chargement...)
+ </panel.string>
+ <panel.string name="ban_selection_too_large">
+ Bannissements de groupe non envoyés : trop de résidents sélectionnés. Les bannissements de groupe sont limités à 100 par demande.
+ </panel.string>
+ <panel.string name="ban_not_permitted">
+ Bannissement de groupe non envoyé : vous ne disposez pas du pouvoir Gérer la liste des résidents bannis.
+ </panel.string>
+ <panel.string name="ban_limit_fail">
+ Bannissement de groupe non envoyé : votre groupe a atteint la limite des bannissements autorisés.
+ </panel.string>
+ <panel.string name="partial_ban">
+ Certains bannissements de groupe n&apos;ont pas été envoyés :
+[REASONS]
+ </panel.string>
+ <panel.string name="ban_failed">
+ Les bannissements de groupe n&apos;ont pas été envoyés :
+[REASONS]
+ </panel.string>
+ <panel.string name="residents_already_banned">
+ - Le ou les résidents suivants sont déjà bannis : [RESIDENTS].
+ </panel.string>
+ <panel.string name="ban_limit_reached">
+ - Limite de bannissements atteinte, les agents suivants ne sont pas bannis : [RESIDENTS].
+ </panel.string>
+ <panel.string name="cant_ban_yourself">
+ - Vous ne pouvez pas vous bannir vous-même d&apos;un groupe.
+ </panel.string>
+ <text name="help_text">
+ Vous pouvez sélectionner plusieurs résidents à bannir de votre groupe. Cliquez sur Choisir un résident pour commencer.
+ </text>
+ <button label="Choisir un résident" name="add_button"/>
+ <name_list name="banned_agent_list" tool_tip="Pour sélectionner plusieurs résidents, maintenez la touche Ctrl enfoncée et cliquez sur leurs noms"/>
+ <button label="Supprimer la sélection de la liste" name="remove_button" tool_tip="Supprime les résidents sélectionnés ci-dessus de la liste des résidents bannis"/>
+ <button label="Bannir des résidents" name="ban_button"/>
+ <button label="Annuler" name="cancel_button"/>
+ <string name="GroupBulkBan">
+ Bannissement de groupe
+ </string>
+</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/fr/panel_group_info_sidetray.xml
index 047cd692e8..7c3b852de1 100755
--- a/indra/newview/skins/default/xui/fr/panel_group_info_sidetray.xml
+++ b/indra/newview/skins/default/xui/fr/panel_group_info_sidetray.xml
@@ -20,7 +20,7 @@
<layout_panel name="group_accordions">
<accordion name="groups_accordion">
<accordion_tab name="group_general_tab" title="Général"/>
- <accordion_tab name="group_roles_tab" title="Rôles"/>
+ <accordion_tab name="group_roles_tab" title="Rôles et membres"/>
<accordion_tab name="group_notices_tab" title="Notices"/>
<accordion_tab name="group_land_tab" title="Terrain/Actifs"/>
</accordion>
diff --git a/indra/newview/skins/default/xui/fr/panel_group_invite.xml b/indra/newview/skins/default/xui/fr/panel_group_invite.xml
index d792439220..5851856a03 100755
--- a/indra/newview/skins/default/xui/fr/panel_group_invite.xml
+++ b/indra/newview/skins/default/xui/fr/panel_group_invite.xml
@@ -22,7 +22,7 @@
Assignez-leur un rôle :
</text>
<combo_box name="role_name" tool_tip="Choisissez dans la liste de rôles que vous êtes autorisé(e) à attribuer aux membres"/>
- <button label="Envoyer les invitations" name="ok_button"/>
+ <button label="Envoyer des invitations" name="invite_button"/>
<button label="Annuler" name="cancel_button"/>
<string name="GroupInvitation">
Invitations au groupe
diff --git a/indra/newview/skins/default/xui/fr/panel_group_roles.xml b/indra/newview/skins/default/xui/fr/panel_group_roles.xml
index 0bd2e0bdab..3e66190c8d 100755
--- a/indra/newview/skins/default/xui/fr/panel_group_roles.xml
+++ b/indra/newview/skins/default/xui/fr/panel_group_roles.xml
@@ -20,16 +20,18 @@ Pour sélectionner plusieurs membres, cliquez sur leurs noms en maintenant la to
<name_list.columns label="Membre" name="name"/>
<name_list.columns label="Donation" name="donated"/>
<name_list.columns label="Statut" name="online"/>
+ <name_list.columns label="Titre" name="title"/>
</name_list>
<button label="Inviter" name="member_invite"/>
<button label="Expulser" name="member_eject"/>
+ <button label="Bannir un ou plusieurs membres" name="member_ban"/>
</panel>
<panel label="RÔLES" name="roles_sub_tab">
<panel.string name="help_text">
Chaque rôle possède un titre et des
-pouvoirs. Les membres peuvent avoir
-un ou plusieurs rôles. Un groupe peut avoir jusqu&apos;à 10 rôles,
-notamment les rôles Tous et Propriétaire.
+ pouvoirs. Les membres peuvent avoir
+ un ou plusieurs rôles. Un groupe peut avoir jusqu’à 10 rôles,
+ notamment les rôles Tous et Propriétaire.
</panel.string>
<panel.string name="cant_delete_role">
Les rôles Tous et Propriétaires sont spéciaux et ne peuvent pas être supprimés.
@@ -54,13 +56,29 @@ notamment les rôles Tous et Propriétaire.
</panel>
<panel height="148" label="POUVOIRS" name="actions_sub_tab" tool_tip="Vous pouvez afficher une description du pouvoir et voir quels membres et rôles peuvent s&apos;en servir.">
<panel.string name="help_text">
- Les pouvoirs déterminent les facultés de chaque membre dans le groupe.
+ Les pouvoirs déterminent les facultés de chaque membre
+ dans le groupe. Il existe une vaste gamme de pouvoirs.
</panel.string>
<filter_editor label="Filtrer les pouvoirs" name="filter_input"/>
<scroll_list bottom_delta="-120" height="118" name="action_list" tool_tip="Sélectionnez un pouvoir pour en savoir plus">
<scroll_list.columns label="" name="action"/>
</scroll_list>
</panel>
+ <panel label="RÉSIDENTS BANNIS" name="banlist_sub_tab" tool_tip="Affiche les résidents bannis de ce groupe.">
+ <panel.string name="help_text">
+ Les résidents figurant sur la liste des résidents bannis ne peuvent pas rejoindre le groupe.
+ </panel.string>
+ <panel.string name="ban_count_template">
+ Nombre de résidents bannis : [COUNT]/[LIMIT]
+ </panel.string>
+ <name_list name="ban_list">
+ <name_list.columns label="Résident(e)" name="name"/>
+ <name_list.columns label="Date de bannissement" name="ban_date"/>
+ </name_list>
+ <button label="Bannir un ou plusieurs résidents" name="ban_create" tool_tip="Bannir des résidents de votre groupe"/>
+ <button label="Annuler le bannissement d&apos;un ou plusieurs membres" name="ban_delete" tool_tip="Annuler le bannissement de certains résidents de votre groupe"/>
+ <button name="ban_refresh" tool_tip="Actualiser la liste des résidents bannis"/>
+ </panel>
</tab_container>
<panel name="members_footer">
<text name="static">
diff --git a/indra/newview/skins/default/xui/fr/panel_login.xml b/indra/newview/skins/default/xui/fr/panel_login.xml
index c8a1fe8751..b39920fe13 100755
--- a/indra/newview/skins/default/xui/fr/panel_login.xml
+++ b/indra/newview/skins/default/xui/fr/panel_login.xml
@@ -1,46 +1,27 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8"?>
<panel name="panel_login">
<panel.string name="forgot_password_url">
http://secondlife.com/account/request.php?lang=fr
</panel.string>
- <layout_stack name="login_widgets">
- <layout_panel name="login">
- <text name="log_in_text">
- CONNEXION
- </text>
- <text name="username_text">
- Nom d&apos;utilisateur :
- </text>
- <combo_box name="username_combo" tool_tip="Nom d&apos;utilisateur que vous avez choisi lors de votre inscription (par exemple, bobsmith12 ou Steller Sunshine)."/>
- <text name="password_text">
- Mot de passe :
- </text>
- </layout_panel>
- <layout_panel name="start_location_panel">
- <text name="start_location_text">
- Lieu de départ :
- </text>
- <combo_box name="start_location_combo">
- <combo_box.item label="Dernier emplacement" name="MyLastLocation"/>
- <combo_box.item label="Domicile" name="MyHome"/>
- <combo_box.item label="&lt;Nom de la région&gt;" name="Typeregionname"/>
- </combo_box>
- </layout_panel>
- <layout_panel name="links_login_panel">
- <text name="login_help">
- Besoin d&apos;aide ?
- </text>
+ <layout_stack name="ui_stack">
+ <layout_panel name="ui_container">
+ <combo_box label="Nom d&apos;utilisateur" name="username_combo" tool_tip="Nom d&apos;utilisateur que vous avez choisi lors de votre inscription (par exemple, bobsmith12 ou Steller Sunshine)."/>
+ <line_editor label="Mot de passe" name="password_edit"/>
+ <check_box label="Mémoriser mes informations" name="remember_check"/>
<text name="forgot_password_text">
- Nom d&apos;utilisateur ou mot de passe oublié ?
+ Mot de passe oublié
</text>
<button label="Connexion" name="connect_btn"/>
- <check_box label="Enregistrer" name="remember_check"/>
- </layout_panel>
- <layout_panel name="links">
- <text name="create_account_text">
- CRÉER VOTRE COMPTE
+ <text name="At_My_Last_Location_Label" font="SansSerifSmall" width="140">
+ au dernier emplacement
</text>
- <button label="Commencer" name="create_new_account_btn"/>
+ <combo_box label="Mes lieux préférés" name="start_location_combo">
+ <combo_box.item label="Domicile" name="MyHome"/>
+ </combo_box>
+ <button label="Connexion" name="connect_favorite_btn"/>
+ <line_editor label="Tapez un emplacement" name="location_edit"/>
+ <button label="Connexion" name="connect_location_btn"/>
+ <combo_box label="Sélectionner la grille" name="server_combo"/>
</layout_panel>
</layout_stack>
</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_login_first.xml b/indra/newview/skins/default/xui/fr/panel_login_first.xml
new file mode 100644
index 0000000000..9534ac7b83
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/panel_login_first.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_login">
+ <panel.string name="forgot_password_url">
+ http://secondlife.com/account/request.php?lang=fr
+ </panel.string>
+ <layout_stack name="logo_stack">
+ <layout_panel name="parent_panel2">
+ <layout_stack name="widget_stack">
+ <layout_panel name="widget_container">
+ <combo_box label="Nom d&apos;utilisateur" name="username_combo" tool_tip="Nom d&apos;utilisateur que vous avez choisi lors de votre inscription (par exemple, bobsmith12 ou Steller Sunshine)."/>
+ <line_editor label="Mot de passe" name="password_edit"/>
+ <button label="Connexion" name="connect_btn"/>
+ <check_box label="Mémoriser mes informations" name="remember_check" font="SansSerifSmall"/>
+ <text name="forgot_password_text">
+ Mot de passe oublié
+ </text>
+ </layout_panel>
+ </layout_stack>
+ </layout_panel>
+ <layout_panel name="parent_panel3">
+ <layout_stack name="images_stack">
+ <layout_panel name="images_container">
+ <text name="image_caption_left">
+ Votre première étape est Learning Island. Trouvez le portail de sortie.
+ </text>
+ <text name="image_caption_right">
+ Puis explorez Social Island et faites la connaissance d&apos;autres résidents.
+ </text>
+ </layout_panel>
+ </layout_stack>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/fr/panel_preferences_advanced.xml
index 3f3d0f51f4..67bcfb0879 100755
--- a/indra/newview/skins/default/xui/fr/panel_preferences_advanced.xml
+++ b/indra/newview/skins/default/xui/fr/panel_preferences_advanced.xml
@@ -28,4 +28,5 @@
<check_box label="Liste de sélection de grille affichée à la connexion" name="show_grid_selection_check"/>
<check_box label="Menu Avancé affiché" name="show_advanced_menu_check"/>
<check_box label="Menu Développeurs affiché" name="show_develop_menu_check"/>
+ <button label="Permissions de création par défaut" name="default_creation_permissions"/>
</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_general.xml b/indra/newview/skins/default/xui/fr/panel_preferences_general.xml
index 533c392d6b..11b1bd9b87 100755
--- a/indra/newview/skins/default/xui/fr/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/fr/panel_preferences_general.xml
@@ -30,14 +30,10 @@
<combo_box.item label="Général et Modéré" name="Desired_Mature"/>
<combo_box.item label="Général" name="Desired_PG"/>
</combo_box>
- <text name="start_location_textbox">
- Lieu de départ :
+ <check_box label="Afficher les lieux préférés sur l&apos;écran de connexion" name="favorites_on_login_check"/>
+ <text name="favorites_check_extra_text">
+ (Les autres personnes utilisant cet ordinateur les verront aussi.)
</text>
- <combo_box name="start_location_combo">
- <combo_box.item label="Dernier emplacement" name="MyLastLocation" tool_tip="Par défaut, choisir mon dernier emplacement comme lieu de départ."/>
- <combo_box.item label="Domicile" name="MyHome" tool_tip="Par défaut, choisir mon domicile comme lieu de départ."/>
- </combo_box>
- <check_box initial_value="true" label="Afficher à la connexion" name="show_location_checkbox"/>
<text name="name_tags_textbox">
Affichage des noms :
</text>
diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/fr/panel_preferences_privacy.xml
index cf1a374da6..0a78a1bb93 100755
--- a/indra/newview/skins/default/xui/fr/panel_preferences_privacy.xml
+++ b/indra/newview/skins/default/xui/fr/panel_preferences_privacy.xml
@@ -3,17 +3,17 @@
<panel.string name="log_in_to_change">
se connecter pour changer
</panel.string>
- <button label="Vider l'historique" name="clear_cache" tool_tip="Effacer le cache de l&apos;image de connexion, du dernier lieu, de l&apos;historique des téléportations, Web et de texture."/>
+ <button label="Vider l&apos;historique" name="clear_cache" tool_tip="Effacer le cache de l&apos;image de connexion, du dernier lieu, de l&apos;historique des téléportations, Web et de texture."/>
<text name="cache_size_label_l">
(endroits, images, web, historique des recherches)
</text>
- <check_box label="M&apos;afficher dans les résultats de recherche" name="online_searchresults"/>
+ <check_box label="Afficher mon profil dans les résultats de recherche" name="online_searchresults"/>
<check_box label="Seuls mes amis et groupes voient quand je suis en ligne" name="online_visibility"/>
<check_box label="Seuls mes amis et groupes peuvent m&apos;appeler ou m&apos;envoyer un IM" name="voice_call_friends_only_check"/>
<check_box label="Fermer le micro à la fin d&apos;un appel" name="auto_disengage_mic_check"/>
<check_box label="Afficher mes repères favoris à la connexion (liste déroulante Lieu de départ)" name="favorites_on_login_check"/>
<text name="Logs:">
- Journaux de chat :
+ Journaux de chat :
</text>
<check_box label="Sauvegarder les chats près de moi sur mon ordinateur" name="log_nearby_chat"/>
<check_box label="Sauvegarder les IM sur mon ordinateur" name="log_instant_messages"/>
diff --git a/indra/newview/skins/default/xui/fr/panel_region_debug.xml b/indra/newview/skins/default/xui/fr/panel_region_debug.xml
index 98ae250215..d21695e9aa 100755
--- a/indra/newview/skins/default/xui/fr/panel_region_debug.xml
+++ b/indra/newview/skins/default/xui/fr/panel_region_debug.xml
@@ -7,11 +7,8 @@
(inconnue)
</text>
<check_box label="Désactiver les scripts" name="disable_scripts_check" tool_tip="Désactiver tous les scripts dans cette région"/>
- <button label="?" name="disable_scripts_help"/>
<check_box label="Désactiver les collisions" name="disable_collisions_check" tool_tip="Désactiver les collisions entre non-avatars dans cette région"/>
- <button label="?" name="disable_collisions_help"/>
<check_box label="Désactiver la physique" name="disable_physics_check" tool_tip="Désactiver tous les effets liés à la physique dans cette région"/>
- <button label="?" name="disable_physics_help"/>
<button bottom_delta="-38" label="Appliquer" name="apply_btn"/>
<text bottom_delta="-42" name="objret_text_lbl" width="260">
Renvoi de l&apos;objet
@@ -31,10 +28,8 @@
<check_box label="Dans toutes les régions de ce domaine" name="return_estate_wide" tool_tip="Renvoyer les objets dans toutes les régions qui constituent ce domaine"/>
<button label="Renvoyer" name="return_btn"/>
<button label="Collisions les plus consommatrices" name="top_colliders_btn" tool_tip="Liste des objets avec le plus de collisions potentielles" width="320"/>
- <button label="?" left="337" name="top_colliders_help"/>
- <button label="Scripts les plus consommateurs" name="top_scripts_btn" tool_tip="Liste des objets passant le plus de temps à exécuter des scripts" width="320"/>
- <button label="?" left="337" name="top_scripts_help"/>
<button label="Redémarrer la région" name="restart_btn" tool_tip="Redémarrer la région au bout de 2 minutes" width="160"/>
- <button label="?" left="177" name="restart_help"/>
+ <button label="Scripts les plus consommateurs" name="top_scripts_btn" tool_tip="Liste des objets passant le plus de temps à exécuter des scripts" width="320"/>
<button label="Annuler le redémarrage" name="cancel_restart_btn" tool_tip="Annuler le redémarrage de la région." width="160"/>
+ <button label="Console de débogage de région" name="region_debug_console_btn" tool_tip="Ouvrir la console de débogage de région"/>
</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_region_general.xml b/indra/newview/skins/default/xui/fr/panel_region_general.xml
index 234d316069..e9dcd6ab5a 100755
--- a/indra/newview/skins/default/xui/fr/panel_region_general.xml
+++ b/indra/newview/skins/default/xui/fr/panel_region_general.xml
@@ -20,12 +20,12 @@
</text>
<check_box label="Interdire le terraformage" name="block_terraform_check"/>
<check_box label="Interdire le vol" name="block_fly_check"/>
+ <check_box label="Bloquer le survol des parcelles" name="block_fly_over_check" tool_tip="Étendre les vérifications d&apos;accès vers le haut pour empêcher le survol d&apos;une parcelle"/>
<check_box label="Autoriser les dégâts" name="allow_damage_check"/>
<check_box label="Interdire les bousculades" name="restrict_pushobject"/>
<check_box label="Autoriser la revente de terrain" name="allow_land_resell_check"/>
<check_box label="Autoriser la fusion/division" name="allow_parcel_changes_check"/>
<check_box label="Ne pas afficher dans la recherche" name="block_parcel_search_check" tool_tip="Afficher cette région et ses parcelles dans les résultats de recherche"/>
- <check_box label="Autoriser les objets de maillage" name="mesh_rez_enabled_check" tool_tip="Laisser les gens rezzer des objets de maillage dans cette région."/>
<spinner label="Nombre maximum d&apos;avatars" label_width="160" name="agent_limit_spin" width="240"/>
<spinner label="Bonus objet" label_width="160" name="object_bonus_spin" width="240"/>
<text label="Maturité" name="access_text">
diff --git a/indra/newview/skins/default/xui/fr/panel_script_ed.xml b/indra/newview/skins/default/xui/fr/panel_script_ed.xml
index 38e5cbe1f1..0a33463cbb 100755
--- a/indra/newview/skins/default/xui/fr/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/fr/panel_script_ed.xml
@@ -24,6 +24,7 @@
<menu_item_call label="Annuler tous les changements" name="Revert All Changes"/>
<menu_item_call label="Charger depuis un fichier..." name="LoadFromFile"/>
<menu_item_call label="Enregistrer sous..." name="SaveToFile"/>
+ <menu_item_call label="Couleurs..." name="Colors"/>
</menu>
<menu label="Modifier" name="Edit">
<menu_item_call label="Annuler" name="Undo"/>
@@ -41,9 +42,9 @@
<menu_item_call label="Aide par mots-clés..." name="Keyword Help..."/>
</menu>
</menu_bar>
- <text_editor name="Script Editor">
+ <script_editor name="Script Editor">
Chargement...
- </text_editor>
+ </script_editor>
<combo_box label="Insérer..." name="Insert..."/>
<button label="Enregistrer" label_selected="Enregistrer" name="Save_btn"/>
<button label="Modifier..." name="Edit_btn"/>
diff --git a/indra/newview/skins/default/xui/fr/panel_snapshot_options.xml b/indra/newview/skins/default/xui/fr/panel_snapshot_options.xml
index befe1b3bc6..bb858d5d23 100755
--- a/indra/newview/skins/default/xui/fr/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/fr/panel_snapshot_options.xml
@@ -4,4 +4,13 @@
<button label="Envoyer par e-mail" name="save_to_email_btn"/>
<button label="Enreg. dans l&apos;inventaire ([AMOUNT] L$)" name="save_to_inventory_btn"/>
<button label="Enreg. sur l&apos;ordinateur" name="save_to_computer_btn"/>
+ <text name="send_to_facebook_textbox">
+ Envoyer à : [secondlife:/// Facebook]
+ </text>
+ <text name="send_to_twitter_textbox">
+ [secondlife:/// Twitter]
+ </text>
+ <text name="send_to_flickr_textbox">
+ [secondlife:/// Flickr]
+ </text>
</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_teleport_history_item.xml b/indra/newview/skins/default/xui/fr/panel_teleport_history_item.xml
index 21eb7ff62c..b3b528d448 100755
--- a/indra/newview/skins/default/xui/fr/panel_teleport_history_item.xml
+++ b/indra/newview/skins/default/xui/fr/panel_teleport_history_item.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="teleport_history_item">
<text name="region" value="..."/>
+ <text name="timestamp" value="..."/>
<button name="profile_btn" tool_tip="Afficher les infos de l&apos;objet"/>
</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_twitter_account.xml b/indra/newview/skins/default/xui/fr/panel_twitter_account.xml
new file mode 100644
index 0000000000..ed2208c69f
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/panel_twitter_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_twitter_account">
+ <string name="twitter_connected" value="Vous êtes connecté(e) à Twitter en tant que :"/>
+ <string name="twitter_disconnected" value="Pas connecté(e) à Twitter"/>
+ <text name="account_caption_label">
+ Pas connecté(e) à Twitter.
+ </text>
+ <panel name="panel_buttons">
+ <button label="Connexion..." name="connect_btn"/>
+ <button label="Déconnexion" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Twitter/ta-p/2435453 Apprenez comment publier sur Twitter]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/fr/panel_twitter_photo.xml b/indra/newview/skins/default/xui/fr/panel_twitter_photo.xml
new file mode 100644
index 0000000000..2d3888f4c2
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/panel_twitter_photo.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_twitter_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="text_panel">
+ <text name="status_label">
+ Que se passe-t-il ?
+ </text>
+ <text name="status_counter_label">
+ 140
+ </text>
+ <check_box initial_value="true" label="Inclure l&apos;emplacement SL" name="add_location_cb"/>
+ <check_box initial_value="true" label="Inclure une photo" name="add_photo_cb"/>
+ </layout_panel>
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="Résolution d’image">
+ <combo_box.item label="Fenêtre actuelle" name="CurrentWindow"/>
+ <combo_box.item label="640 x 480" name="640x480"/>
+ <combo_box.item label="800 x 600" name="800x600"/>
+ <combo_box.item label="1 024 x 768" name="1024x768"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="Filtres d&apos;image">
+ <combo_box.item label="Aucun filtre" name="NoFilter"/>
+ </combo_box>
+ <button label="Actualiser" name="new_snapshot_btn" tool_tip="Cliquer pour actualiser"/>
+ <button label="Aperçu" name="big_preview_btn" tool_tip="Cliquer pour activer/désactiver l&apos;aperçu"/>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="Envoyer tweet" name="post_photo_btn"/>
+ <button label="Annuler" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/fr/role_actions.xml b/indra/newview/skins/default/xui/fr/role_actions.xml
index 2a68ca0ddb..25920da4c3 100755
--- a/indra/newview/skins/default/xui/fr/role_actions.xml
+++ b/indra/newview/skins/default/xui/fr/role_actions.xml
@@ -3,6 +3,7 @@
<action_set description="Ces pouvoirs permettent d&apos;ajouter et de supprimer des membres du groupe et permettent aux nouveaux membres de rejoindre le groupe sans recevoir d&apos;invitation." name="Membership">
<action description="Inviter des membres dans ce groupe" longdescription="Invitez des personnes à rejoindre ce groupe en utilisant le bouton Inviter dans l&apos;onglet Membres de la section Rôles." name="member invite" value="1"/>
<action description="Expulser des membres du groupe" longdescription="Expulsez des personnes de ce groupe en utilisant le bouton Expulser dans l&apos;onglet Membres de la section Rôles. Un propriétaire peut expulser tout le monde à l&apos;exception des autres propriétaires. Si vous n&apos;êtes pas propriétaire, vous pouvez expulser un membre d&apos;un groupe uniquement si il n&apos;a que le rôle Tous et AUCUN autre rôle. Pour supprimer des membres des rôles, vous devez disposer du pouvoir correspondant." name="member eject" value="2"/>
+ <action description="Gérer la liste des résidents bannis" longdescription="Permet au membre du groupe de bannir / d&apos;annuler le bannissement des résidents de ce groupe." name="allow ban" value="51"/>
<action description="Activer Inscription libre et modifier les frais d&apos;inscription" longdescription="Activez Inscription libre pour permettre aux nouveaux membres de s&apos;inscrire sans invitation, et changez les frais d&apos;inscription dans la section Général." name="member options" value="3"/>
</action_set>
<action_set description="Ces pouvoirs permettent d&apos;ajouter, de supprimer et de modifier les rôles dans le groupe et d&apos;y assigner des membres et des pouvoirs." name="Roles">
diff --git a/indra/newview/skins/default/xui/fr/sidepanel_inventory.xml b/indra/newview/skins/default/xui/fr/sidepanel_inventory.xml
index 1b9c832679..372d61263f 100755
--- a/indra/newview/skins/default/xui/fr/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/fr/sidepanel_inventory.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel label="Choses" name="objects panel">
- <panel label="" name="sidepanel__inventory_panel">
+ <panel label="" name="sidepanel_inventory_panel">
<layout_stack name="inventory_layout_stack">
<layout_panel name="inbox_layout_panel">
<panel label="" name="marketplace_inbox">
@@ -31,10 +31,10 @@
<button label="Partager" name="share_btn" tool_tip="Partager un article de l&apos;inventaire"/>
</layout_panel>
<layout_panel name="shop_btn_lp">
- <button label="Acheter" name="shop_btn" tool_tip="Accéder à la place du marché sur le Web"/>
+ <button label="Faire des achats" name="shop_btn" tool_tip="Accéder à la Place du marché sur le Web"/>
<button label="Porter" name="wear_btn" tool_tip="Porter la tenue sélectionnée"/>
- <button label="Lire" name="play_btn"/>
- <button label="Téléportation" name="teleport_btn" tool_tip="Me téléporter jusqu&apos;à la zone sélectionnée"/>
+ <button label="Jouer" name="play_btn"/>
+ <button label="Téléporter" name="teleport_btn" tool_tip="Me téléporter jusqu&apos;à la zone sélectionnée"/>
</layout_panel>
</layout_stack>
</panel>
diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml
index 78d846ff4f..b3ce171633 100755
--- a/indra/newview/skins/default/xui/fr/strings.xml
+++ b/indra/newview/skins/default/xui/fr/strings.xml
@@ -37,6 +37,45 @@
<string name="StartupRequireDriverUpdate">
Échec d&apos;initialisation des graphiques. Veuillez mettre votre pilote graphique à jour.
</string>
+ <string name="AboutHeader">
+ [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2] ([VIEWER_VERSION_3]) [BUILD_DATE] [BUILD_TIME] ([CHANNEL])
+[[VIEWER_RELEASE_NOTES_URL] [Notes de version]]
+ </string>
+ <string name="AboutCompiler">
+ Compilé avec [COMPILER] version [COMPILER_VERSION]
+ </string>
+ <string name="AboutPosition">
+ Vous êtes à [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] dans [REGION], se trouvant à &lt;nolink&gt;[HOSTNAME]&lt;/nolink&gt; ([HOSTIP])
+SLURL : &lt;nolink&gt;[SLURL]&lt;/nolink&gt;
+(coordonnées globales [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1])
+[SERVER_VERSION]
+[SERVER_RELEASE_NOTES_URL]
+ </string>
+ <string name="AboutSystem">
+ CPU : [CPU]
+Mémoire : [MEMORY_MB] Mo
+Version OS : [OS_VERSION]
+Distributeur de cartes graphiques : [GRAPHICS_CARD_VENDOR]
+Carte graphique : [GRAPHICS_CARD]
+ </string>
+ <string name="AboutDriver">
+ Version Windows Graphics Driver : [GRAPHICS_DRIVER_VERSION]
+ </string>
+ <string name="AboutLibs">
+ Version OpenGL : [OPENGL_VERSION]
+
+Version libcurl : [LIBCURL_VERSION]
+Version J2C Decoder : [J2C_VERSION]
+Version Audio Driver : [AUDIO_DRIVER_VERSION]
+Version Qt Webkit : [QT_WEBKIT_VERSION]
+Version serveur vocal : [VOICE_VERSION]
+ </string>
+ <string name="AboutTraffic">
+ Paquets perdus : [PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number,1]%)
+ </string>
+ <string name="ErrorFetchingServerReleaseNotesURL">
+ Erreur lors de la récupération de l&apos;URL des notes de version du serveur.
+ </string>
<string name="ProgressRestoring">
Restauration...
</string>
@@ -296,6 +335,75 @@ Veuillez réessayer de vous connecter dans une minute.
<string name="TestingDisconnect">
Test de déconnexion du client
</string>
+ <string name="SocialFlickrConnecting">
+ Connexion à Flickr...
+ </string>
+ <string name="SocialFlickrPosting">
+ Publication…
+ </string>
+ <string name="SocialFlickrDisconnecting">
+ Déconnexion de Flickr...
+ </string>
+ <string name="SocialFlickrErrorConnecting">
+ Un problème est survenu lors de la connexion à Flickr.
+ </string>
+ <string name="SocialFlickrErrorPosting">
+ Un problème est survenu lors de la publication sur Flickr.
+ </string>
+ <string name="SocialFlickrErrorDisconnecting">
+ Un problème est survenu lors de la déconnexion de Flickr.
+ </string>
+ <string name="SocialTwitterConnecting">
+ Connexion à Twitter...
+ </string>
+ <string name="SocialTwitterPosting">
+ Publication…
+ </string>
+ <string name="SocialTwitterDisconnecting">
+ Déconnexion de Twitter...
+ </string>
+ <string name="SocialTwitterErrorConnecting">
+ Un problème est survenu lors de la connexion à Twitter.
+ </string>
+ <string name="SocialTwitterErrorPosting">
+ Un problème est survenu lors de la publication sur Twitter.
+ </string>
+ <string name="SocialTwitterErrorDisconnecting">
+ Un problème est survenu lors de la déconnexion de Twitter.
+ </string>
+ <string name="BlackAndWhite">
+ Noir et blanc
+ </string>
+ <string name="Colors1970">
+ Couleurs des années 1970
+ </string>
+ <string name="Intense">
+ Intense
+ </string>
+ <string name="Newspaper">
+ Presse
+ </string>
+ <string name="Sepia">
+ Sépia
+ </string>
+ <string name="Spotlight">
+ Projecteur
+ </string>
+ <string name="Video">
+ Vidéo
+ </string>
+ <string name="Autocontrast">
+ Contraste automatique
+ </string>
+ <string name="LensFlare">
+ Halo
+ </string>
+ <string name="Miniature">
+ Miniature
+ </string>
+ <string name="Toycamera">
+ Toy Camera
+ </string>
<string name="TooltipPerson">
Personne
</string>
@@ -847,6 +955,12 @@ Veuillez réessayer de vous connecter dans une minute.
<string name="use_texture">
Utiliser la texture
</string>
+ <string name="manip_hint1">
+ Faites glisser le curseur sur l&apos;axe
+ </string>
+ <string name="manip_hint2">
+ pour le fixer sur la grille
+ </string>
<string name="texture_loading">
Chargement...
</string>
@@ -937,15 +1051,15 @@ Veuillez réessayer de vous connecter dans une minute.
<string name="ControlYourCamera">
Contrôler votre caméra
</string>
+ <string name="TeleportYourAgent">
+ Vous téléporter
+ </string>
<string name="NotConnected">
Pas connecté(e)
</string>
<string name="AgentNameSubst">
(Vous)
</string>
- <string name="TeleportYourAgent">
- Vous téléporter
- </string>
<string name="JoinAnExperience">
Rejoindre une expérience
</string>
@@ -1299,6 +1413,18 @@ Veuillez réessayer de vous connecter dans une minute.
<string name="InventoryOutboxNoItems">
Pour mettre des dossiers en vente sur la [[MARKETPLACE_DASHBOARD_URL] Place du marché], faites-les glisser vers cette zone et cliquez sur &quot;Envoyer vers la Place du marché&quot;.
</string>
+ <string name="InventoryOutboxInitializingTitle">
+ Initialisation de la Place du marché...
+ </string>
+ <string name="InventoryOutboxInitializing">
+ Nous sommes en train d&apos;accéder à votre compte dans la [[MARKETPLACE_CREATE_STORE_URL] boutique de la Place du marché].
+ </string>
+ <string name="InventoryOutboxErrorTitle">
+ Erreurs de la Place du marché.
+ </string>
+ <string name="InventoryOutboxError">
+ La [[MARKETPLACE_CREATE_STORE_URL] boutique de la Place du marché] renvoie des erreurs.
+ </string>
<string name="Marketplace Error None">
Aucune erreur
</string>
@@ -1326,6 +1452,9 @@ Veuillez réessayer de vous connecter dans une minute.
<string name="Open landmarks">
Ouvrir les repères
</string>
+ <string name="Unconstrained">
+ Sans contraintes
+ </string>
<string name="no_transfer" value=" (pas de transfert)"/>
<string name="no_modify" value=" (pas de modification)"/>
<string name="no_copy" value=" (pas de copie)"/>
@@ -1726,6 +1855,9 @@ Veuillez réessayer de vous connecter dans une minute.
<string name="CompileQueueDownloadedCompiling">
Téléchargé, compilation en cours
</string>
+ <string name="CompileQueueServiceUnavailable">
+ Service de compilation de script indisponible.
+ </string>
<string name="CompileQueueScriptNotFound">
Script introuvable sur le serveur.
</string>
@@ -4026,6 +4158,12 @@ Si ce message persiste, veuillez aller sur la page [SUPPORT_SITE].
<string name="share_alert">
Faire glisser les objets de l&apos;inventaire ici
</string>
+ <string name="flickr_post_success">
+ Vous avez publié sur Flickr.
+ </string>
+ <string name="twitter_post_success">
+ Vous avez publié sur Twitter.
+ </string>
<string name="no_session_message">
(Session IM inexistante)
</string>
@@ -4482,6 +4620,9 @@ du rapport d&apos;infraction
<string name="LocalEstimateUSD">
[AMOUNT] US$
</string>
+ <string name="Group Ban">
+ Bannissement de groupe
+ </string>
<string name="Membership">
Inscription
</string>
@@ -4904,6 +5045,12 @@ Essayez avec le chemin d&apos;accès à l&apos;éditeur entre guillemets doubles
<string name="Command_Destinations_Label">
Destinations
</string>
+ <string name="Command_Facebook_Label">
+ Facebook
+ </string>
+ <string name="Command_Flickr_Label">
+ Flickr
+ </string>
<string name="Command_Gestures_Label">
Gestes
</string>
@@ -4952,6 +5099,9 @@ Essayez avec le chemin d&apos;accès à l&apos;éditeur entre guillemets doubles
<string name="Command_Speak_Label">
Parler
</string>
+ <string name="Command_Twitter_Label">
+ Twitter
+ </string>
<string name="Command_View_Label">
Caméra
</string>
@@ -4982,6 +5132,12 @@ Essayez avec le chemin d&apos;accès à l&apos;éditeur entre guillemets doubles
<string name="Command_Destinations_Tooltip">
Destinations intéressantes
</string>
+ <string name="Command_Facebook_Tooltip">
+ Publier sur Facebook
+ </string>
+ <string name="Command_Flickr_Tooltip">
+ Charger sur Flickr
+ </string>
<string name="Command_Gestures_Tooltip">
Gestes de votre avatar
</string>
@@ -5030,6 +5186,9 @@ Essayez avec le chemin d&apos;accès à l&apos;éditeur entre guillemets doubles
<string name="Command_Speak_Tooltip">
Parler aux personnes près de vous en utilisant votre micro
</string>
+ <string name="Command_Twitter_Tooltip">
+ Twitter
+ </string>
<string name="Command_View_Tooltip">
Changer l&apos;angle de la caméra
</string>
diff --git a/indra/newview/skins/default/xui/it/floater_big_preview.xml b/indra/newview/skins/default/xui/it/floater_big_preview.xml
new file mode 100644
index 0000000000..7bc50a6d39
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/floater_big_preview.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_big_preview" title="ANTEPRIMA"/>
diff --git a/indra/newview/skins/default/xui/it/floater_facebook.xml b/indra/newview/skins/default/xui/it/floater_facebook.xml
new file mode 100644
index 0000000000..89d58f4e67
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/floater_facebook.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_facebook" title="PUBBLICA SU FACEBOOK">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="STATO" name="panel_facebook_status"/>
+ <panel label="FOTO" name="panel_facebook_photo"/>
+ <panel label="REGISTRATI" name="panel_facebook_place"/>
+ <panel label="AMICI" name="panel_facebook_friends"/>
+ <panel label="ACCOUNT" name="panel_facebook_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ Errore
+ </text>
+ <text name="connection_loading_text">
+ Caricamento...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_flickr.xml b/indra/newview/skins/default/xui/it/floater_flickr.xml
new file mode 100644
index 0000000000..c19eb337af
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/floater_flickr.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_flickr" title="CARICA SU FLICKR">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="FOTO" name="panel_flickr_photo"/>
+ <panel label="ACCOUNT" name="panel_flickr_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ Errore
+ </text>
+ <text name="connection_loading_text">
+ Caricamento...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_lagmeter.xml b/indra/newview/skins/default/xui/it/floater_lagmeter.xml
index f7b2b1ab4a..f7b2b1ab4a 100755..100644
--- a/indra/newview/skins/default/xui/it/floater_lagmeter.xml
+++ b/indra/newview/skins/default/xui/it/floater_lagmeter.xml
diff --git a/indra/newview/skins/default/xui/it/floater_perms_default.xml b/indra/newview/skins/default/xui/it/floater_perms_default.xml
new file mode 100644
index 0000000000..3d1fd94b69
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/floater_perms_default.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="perms default" title="DIRITTI DI CREAZIONE PREDEFINITI">
+ <panel label="Diritti predefiniti" name="default permissions"/>
+ <button label="OK" label_selected="OK" name="ok"/>
+ <button label="Annulla" label_selected="Annulla" name="cancel"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_region_restarting.xml b/indra/newview/skins/default/xui/it/floater_region_restarting.xml
new file mode 100644
index 0000000000..d4497288e0
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/floater_region_restarting.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="region_restarting" title="RIAVVIO REGIONE IN CORSO">
+ <string name="RegionName">
+ La regione in cui ti trovi ([NAME]) verrà riavviata tra breve.
+
+Se rimani in questa regione verrai scollegato da Second Life.
+ </string>
+ <string name="RestartSeconds">
+ Secondi prima del riavvio
+[SECONDS]
+ </string>
+ <panel name="layout_panel_1">
+ <text name="region_name">
+ La regione in cui ti trovi (il nome di regione più lungo) verrà riavviata tra breve.
+
+Se rimani in questa regione verrai scollegato da Second Life.
+ </text>
+ <text name="restart_seconds">
+ Secondi prima del riavvio
+ 32767
+ </text>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_report_abuse.xml b/indra/newview/skins/default/xui/it/floater_report_abuse.xml
index eeba54b0ca..728d089205 100755
--- a/indra/newview/skins/default/xui/it/floater_report_abuse.xml
+++ b/indra/newview/skins/default/xui/it/floater_report_abuse.xml
@@ -44,7 +44,7 @@
<combo_box.item label="Età &gt; Residente adulto in Teen Second Life" name="Age__Adult_resident_on_Teen_Second_Life"/>
<combo_box.item label="Età &gt; Residente minorenne fuori da Teen Second Life" name="Age__Underage_resident_outside_of_Teen_Second_Life"/>
<combo_box.item label="Assalto &gt; sandbox da combattimento / area pericolosa" name="Assault__Combat_sandbox___unsafe_area"/>
- <combo_box.item label="Assalto &gt; Area sicura" name="Assault__Safe_area"/>
+ <combo_box.item label="Assalto &gt; Colpire, spingere o urtare un altro residente in un&apos;area Sicura" name="Assault__Safe_area"/>
<combo_box.item label="Assalto &gt; Test di armi in sandbox" name="Assault__Weapons_testing_sandbox"/>
<combo_box.item label="Commercio &gt; Problema nella consegna di un prodotto o servizio" name="Commerce__Failure_to_deliver_product_or_service"/>
<combo_box.item label="Divulgazione &gt; Informazioni del mondo reale" name="Disclosure__Real_world_information"/>
@@ -58,25 +58,25 @@
<combo_box.item label="Truffa &gt; L$" name="Fraud__L$"/>
<combo_box.item label="Truffa &gt; Terreno" name="Fraud__Land"/>
<combo_box.item label="Truffa &gt; Multilivello o catena di Sant&apos;Antonio" name="Fraud__Pyramid_scheme_or_chain_letter"/>
- <combo_box.item label="Truffa &gt; Dollari US$" name="Fraud__US$"/>
+ <combo_box.item label="Frode &gt; L$ o USD $" name="Fraud__US$"/>
<combo_box.item label="Molestie &gt; Territori adibiti a pubblicità / spam visivo" name="Harassment__Advert_farms___visual_spam"/>
<combo_box.item label="Molestie &gt; Diffamazione di individui o gruppi" name="Harassment__Defaming_individuals_or_groups"/>
<combo_box.item label="Molestie &gt; Impedimento di movimenti" name="Harassment__Impeding_movement"/>
<combo_box.item label="Molestie &gt; Molestie sessuali" name="Harassment__Sexual_harassment"/>
- <combo_box.item label="Molestie &gt; Sollecitare/incitare altri a violare i Termini di Servizio" name="Harassment__Solicting_inciting_others_to_violate_ToS"/>
+ <combo_box.item label="Molestia &gt; Comportamento mirato a disturbare" name="Harassment__Solicting_inciting_others_to_violate_ToS"/>
<combo_box.item label="Molestie &gt; Abusi verbali" name="Harassment__Verbal_abuse"/>
<combo_box.item label="Indecenza &gt; Condotta o contenuti largamente offensivi" name="Indecency__Broadly_offensive_content_or_conduct"/>
<combo_box.item label="Indecenza &gt; Nome di un avatar inappropriato" name="Indecency__Inappropriate_avatar_name"/>
- <combo_box.item label="Indecenza &gt; Contenuto o condotta inappropriata in una regione con accesso Generale" name="Indecency__Mature_content_in_PG_region"/>
+ <combo_box.item label="Indecenza &gt; Comportamenti o contenuti non appropriati per la categoria di accesso della regione" name="Indecency__Mature_content_in_PG_region"/>
<combo_box.item label="Indecenza &gt; Contenuto o condotta inappropriata in una regione con accesso Moderato" name="Indecency__Inappropriate_content_in_Mature_region"/>
<combo_box.item label="Violazione della proprietà intellettuale &gt; Rimozione contenuti" name="Intellectual_property_infringement_Content_Removal"/>
<combo_box.item label="Violazione della proprietà intellettuale &gt; CopyBot o sblocco di permessi" name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit"/>
<combo_box.item label="Intolleranza" name="Intolerance"/>
<combo_box.item label="Terreno &gt; Abuso delle risorse di una sandbox" name="Land__Abuse_of_sandbox_resources"/>
- <combo_box.item label="Terreno &gt; Invasione &gt; Oggetti/textures" name="Land__Encroachment__Objects_textures"/>
+ <combo_box.item label="Terreno &gt; Invasione &gt; Oggetti o texture" name="Land__Encroachment__Objects_textures"/>
<combo_box.item label="Terreno &gt; Invasione &gt; Particelle" name="Land__Encroachment__Particles"/>
<combo_box.item label="Terreno &gt; Invasione &gt; Alberi/piante" name="Land__Encroachment__Trees_plants"/>
- <combo_box.item label="Chiedere l&apos;elemosina/gioco d&apos;azzardo" name="Wagering_gambling"/>
+ <combo_box.item label="Scommesse o gioco d&apos;azzardo" name="Wagering_gambling"/>
<combo_box.item label="Altro" name="Other"/>
</combo_box>
<text name="abuser_name_title">
diff --git a/indra/newview/skins/default/xui/it/floater_scene_load_stats.xml b/indra/newview/skins/default/xui/it/floater_scene_load_stats.xml
new file mode 100644
index 0000000000..ca18812eb7
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/floater_scene_load_stats.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Scene Load Statistics" title="STATISTICHE CARICAMENTO SCENA">
+ <button label="In pausa" name="playpause"/>
+ <scroll_container name="statistics_scroll">
+ <container_view name="statistics_view">
+ <stat_view label="Di base" name="basic">
+ <stat_bar label="Differenza pixel tra fotogrammi" name="frame difference"/>
+ <stat_bar label="Dati UDP ricevuti" name="bandwidth"/>
+ <stat_bar label="Perdita pacchetti" name="packet_loss"/>
+ </stat_view>
+ <stat_view label="Avanzata" name="advanced">
+ <stat_view label="Render" name="render">
+ <stat_bar label="Totale oggetti" name="objs"/>
+ <stat_bar label="Nuovi oggetti" name="newobjs"/>
+ <stat_bar label="Hit rate della cache per l&apos;oggetto" name="object_cache_hits"/>
+ </stat_view>
+ <stat_view label="Texture" name="texture">
+ <stat_bar label="Hit rate della cache" name="texture_cache_hits"/>
+ <stat_bar label="Latenza di lettura della cache" name="texture_cache_read_latency"/>
+ <stat_bar label="Conteggio" name="numimagesstat"/>
+ <stat_bar label="Conteggio grezzo" name="numrawimagesstat"/>
+ </stat_view>
+ <stat_view label="Rete" name="network">
+ <stat_bar label="Pacchetti in ingresso" name="packetsinstat"/>
+ <stat_bar label="Pacchetti in uscita" name="packetsoutstat"/>
+ <stat_bar label="Oggetti" name="objectdatareceived"/>
+ <stat_bar label="Texture" name="texturedatareceived"/>
+ <stat_bar label="Risorsa" name="assetudpdatareceived"/>
+ <stat_bar label="Livelli" name="layersdatareceived"/>
+ <stat_bar label="Effettivi in ingresso" name="messagedatain"/>
+ <stat_bar label="Effettivi in uscita" name="messagedataout"/>
+ <stat_bar label="Operazioni VFS in sospeso" name="vfspendingoperations"/>
+ </stat_view>
+ </stat_view>
+ <stat_view label="Simulatore" name="sim">
+ <stat_bar label="Oggetti" name="simobjects"/>
+ <stat_bar label="Oggetti attivi" name="simactiveobjects"/>
+ <stat_bar label="Script attivi" name="simactivescripts"/>
+ <stat_bar label="Pacchetti in ingresso" name="siminpps"/>
+ <stat_bar label="Pacchetti in uscita" name="simoutpps"/>
+ <stat_bar label="Download in attesa" name="simpendingdownloads"/>
+ <stat_bar label="Caricamenti in attesa" name="simpendinguploads"/>
+ <stat_bar label="Numero totale byte non confermati (Unacked)" name="simtotalunackedbytes"/>
+ <stat_view label="Tempo (ms)" name="simperf">
+ <stat_bar label="Tempo totale Frame" name="simframemsec"/>
+ <stat_bar label="Tempo netto" name="simnetmsec"/>
+ <stat_bar label="Tempo motore fisico" name="simsimphysicsmsec"/>
+ <stat_bar label="Tempo simulazione" name="simsimothermsec"/>
+ <stat_bar label="Tempo agente" name="simagentmsec"/>
+ <stat_bar label="Tempo immagini" name="simimagesmsec"/>
+ <stat_bar label="Tempo script" name="simscriptmsec"/>
+ <stat_bar label="Tempo libero" name="simsparemsec"/>
+ <stat_view label="Dettagli tempo (ms)" name="timedetails">
+ <stat_bar label="Passaggio fisica" name="simsimphysicsstepmsec"/>
+ <stat_bar label="Aggiorna forme fisica" name="simsimphysicsshapeupdatemsec"/>
+ <stat_bar label="Altro fisica" name="simsimphysicsothermsec"/>
+ <stat_bar label="Tempo pausa" name="simsleepmsec"/>
+ <stat_bar label="IO pompa" name="simpumpiomsec"/>
+ </stat_view>
+ </stat_view>
+ </stat_view>
+ </container_view>
+ </scroll_container>
+</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_script_ed_prefs.xml b/indra/newview/skins/default/xui/it/floater_script_ed_prefs.xml
new file mode 100644
index 0000000000..4f95ef88b1
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/floater_script_ed_prefs.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_script_colors" title="COLORI SCRIPT">
+ <text name="color_pickers_label">
+ Seleziona i colori desiderati:
+ </text>
+ <text name="text_label">
+ Testo
+ </text>
+ <text name="cursor_label">
+ Cursore
+ </text>
+ <text name="background_label">
+ Sfondo
+ </text>
+ <text name="datatype_label">
+ Tipi di dati
+ </text>
+ <text name="event_label">
+ Eventi
+ </text>
+ <text name="string_literal_label">
+ Espressioni letterali stringa
+ </text>
+ <text name="constant_label">
+ Costante
+ </text>
+ <text name="flow_control_label">
+ Controllo di flusso
+ </text>
+ <text name="function_label">
+ Funzione
+ </text>
+ <text name="comment_label">
+ Commento
+ </text>
+ <script_editor name="Script Preview">
+ /* Uno script di esempio */
+default
+{
+ state_entry()
+ {
+ // Comment
+ string greeting = &quot;Salve&quot;;
+ llSay(PUBLIC_CHANNEL, greeting);
+ }
+}
+ </script_editor>
+</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_snapshot.xml b/indra/newview/skins/default/xui/it/floater_snapshot.xml
index bff6081bdf..16289ac7af 100755
--- a/indra/newview/skins/default/xui/it/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/it/floater_snapshot.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Snapshot" title="ANTEPRIMA FOTOGRAFIA">
+<floater name="Snapshot" title="ISTANTANEA">
<floater.string name="unknown">
sconosciuto
</floater.string>
@@ -61,5 +61,11 @@
<check_box label="HUD" name="hud_check"/>
<check_box label="Congela il frame (tutto schermo)" name="freeze_frame_check"/>
<check_box label="Aggiornamento automatico" name="auto_snapshot_check"/>
+ <text name="filter_list_label">
+ Filtro:
+ </text>
+ <combo_box name="filters_combobox" tool_tip="Filtri immagini">
+ <combo_box.item label="Nessun filtro" name="NoFilter"/>
+ </combo_box>
</panel>
</floater>
diff --git a/indra/newview/skins/default/xui/it/floater_stats.xml b/indra/newview/skins/default/xui/it/floater_stats.xml
index 825b2ce57a..7516af957e 100755
--- a/indra/newview/skins/default/xui/it/floater_stats.xml
+++ b/indra/newview/skins/default/xui/it/floater_stats.xml
@@ -4,17 +4,21 @@
<container_view name="statistics_view">
<stat_view label="Di base" name="basic">
<stat_bar label="FPS" name="fps"/>
- <stat_bar label="Larghezza banda" name="bandwidth"/>
+ <stat_bar label="Dati UDP ricevuti" name="bandwidth"/>
<stat_bar label="Perdita pacchetti" name="packet_loss"/>
<stat_bar label="Tempo Ping Sim" name="ping"/>
</stat_view>
<stat_view label="Avanzata" name="advanced">
<stat_view label="Render" name="render">
- <stat_bar label="KTris disegnato per fotogramma" name="ktrisframe"/>
- <stat_bar label="KTris disegnato per secondo" name="ktrissec"/>
- <stat_bar label="Totale oggetti" name="objs"/>
+ <stat_bar label="KTris per fotogramma" name="ktrisframe"/>
+ <stat_bar label="KTris per secondo" name="ktrissec"/>
+ <stat_bar label="Totale oggetti" name="totalobjs"/>
+ <stat_bar label="Oggetti nella cache" name="cachedobjs"/>
<stat_bar label="Nuovi oggetti" name="newobjs"/>
<stat_bar label="Hit rate della cache per l&apos;oggetto" name="object_cache_hits"/>
+ <stat_bar label="Occlusion query eseguite" name="occlusion_queries"/>
+ <stat_bar label="Oggetti in occlusion" name="occluded"/>
+ <stat_bar label="Oggetti non in occlusion" name="unoccluded"/>
</stat_view>
<stat_view label="Texture" name="texture">
<stat_bar label="Hit rate della cache" name="texture_cache_hits"/>
@@ -26,15 +30,32 @@
<stat_bar label="Memoria complessiva" name="rawmemstat"/>
<stat_bar label="Memoria impegnata" name="glboundmemstat"/>
</stat_view>
+ <stat_view label="Utilizzo memoria" name="memory">
+ <stat_bar label="LLTrace" name="LLTrace"/>
+ <stat_bar label="Interfaccia utente" name="LLView"/>
+ <stat_bar label="Font" name="LLFontFreetype"/>
+ <stat_bar label="Inventario" name="LLInventoryObject"/>
+ <stat_bar label="Oggetti Viewer" name="LLViewerObject"/>
+ <stat_bar label="Dati gruppo octree" name="LLViewerOctreeGroup"/>
+ <stat_bar label="Dati octree" name="LLViewerOctreeEntry"/>
+ <stat_bar label="Cache oggetti Viewer" name="LLVOCacheEntry"/>
+ <stat_bar label="Disegnabili" name="LLDrawable"/>
+ <stat_bar label="Dati viso" name="LLFace"/>
+ <stat_bar label="Info disegno" name="LLDrawInfo"/>
+ <stat_bar label="Dati texture" name="LLTexture"/>
+ <stat_bar label="Dati immagine" name="LLImage"/>
+ <stat_bar label="Dati immagine GL" name="LLImageGL"/>
+ <stat_bar label="Buffer vertici" name="LLVertexBuffer"/>
+ </stat_view>
<stat_view label="Rete" name="network">
<stat_bar label="Pacchetti in ingresso" name="packetsinstat"/>
<stat_bar label="Pacchetti in uscita" name="packetsoutstat"/>
- <stat_bar label="Oggetti" name="objectkbitstat"/>
- <stat_bar label="Texture" name="texturekbitstat"/>
- <stat_bar label="Risorse server" name="assetkbitstat"/>
- <stat_bar label="Layer" name="layerskbitstat"/>
- <stat_bar label="Effettivi in ingresso" name="actualinkbitstat"/>
- <stat_bar label="Effettivi in uscita" name="actualoutkbitstat"/>
+ <stat_bar label="Oggetti" name="objectdatareceived"/>
+ <stat_bar label="Texture" name="texturedatareceived"/>
+ <stat_bar label="Risorsa" name="assetudpdatareceived"/>
+ <stat_bar label="Livelli" name="layersdatareceived"/>
+ <stat_bar label="Effettivi in ingresso" name="messagedatain"/>
+ <stat_bar label="Effettivi in uscita" name="messagedataout"/>
<stat_bar label="Operazioni VFS in sospeso" name="vfspendingoperations"/>
</stat_view>
</stat_view>
@@ -53,7 +74,8 @@
<stat_bar label="Passaggi silhouette saltati" name="simsimskippedsilhouettesteps"/>
<stat_bar label="Personaggi aggiornati" name="simsimpctsteppedcharacters"/>
</stat_view>
- <stat_view label="Tempo (ms)" name="simperf">
+ <stat_bar label="Totale dati non confermati (unacked)" name="simtotalunackedbytes"/>
+ <stat_view label="Orario" name="simperf">
<stat_bar label="Tempo totale Frame" name="simframemsec"/>
<stat_bar label="Tempo netto" name="simnetmsec"/>
<stat_bar label="Tempo motore fisico" name="simsimphysicsmsec"/>
@@ -62,7 +84,7 @@
<stat_bar label="Tempo immagini" name="simimagesmsec"/>
<stat_bar label="Tempo script" name="simscriptmsec"/>
<stat_bar label="Tempo libero" name="simsparemsec"/>
- <stat_view label="Dettagli tempo (ms)" name="timedetails">
+ <stat_view label="Dettagli orario" name="timedetails">
<stat_bar label="Passaggio fisica" name="simsimphysicsstepmsec"/>
<stat_bar label="Aggiorna forme fisica" name="simsimphysicsshapeupdatemsec"/>
<stat_bar label="Altro fisica" name="simsimphysicsothermsec"/>
diff --git a/indra/newview/skins/default/xui/it/floater_tools.xml b/indra/newview/skins/default/xui/it/floater_tools.xml
index 468f284ccb..efd1ea808a 100755
--- a/indra/newview/skins/default/xui/it/floater_tools.xml
+++ b/indra/newview/skins/default/xui/it/floater_tools.xml
@@ -72,7 +72,7 @@
<check_box label="Modifica parti collegate" name="checkbox edit linked parts"/>
<button label="Collegamento" name="link_btn"/>
<button label="Scollega" name="unlink_btn"/>
- <check_box label="" name="checkbox uniform"/>
+ <check_box label="Allunga entrambi i lati" name="checkbox uniform"/>
<text label="Allunga entrambi i lati" name="checkbox uniform label">
Allunga entrambi i lati
</text>
diff --git a/indra/newview/skins/default/xui/it/floater_twitter.xml b/indra/newview/skins/default/xui/it/floater_twitter.xml
new file mode 100644
index 0000000000..c903705e69
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/floater_twitter.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_twitter" title="TWITTER">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="COMPONI" name="panel_twitter_photo"/>
+ <panel label="ACCOUNT" name="panel_twitter_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ Errore
+ </text>
+ <text name="connection_loading_text">
+ Caricamento...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/it/menu_avatar_icon.xml b/indra/newview/skins/default/xui/it/menu_avatar_icon.xml
index b93b695300..215eb836c8 100755
--- a/indra/newview/skins/default/xui/it/menu_avatar_icon.xml
+++ b/indra/newview/skins/default/xui/it/menu_avatar_icon.xml
@@ -2,6 +2,7 @@
<menu name="Avatar Icon Menu">
<menu_item_call label="Vedi profilo" name="Show Profile"/>
<menu_item_call label="Manda IM..." name="Send IM"/>
+ <menu_item_call label="Richiedi teleport" name="Request Teleport"/>
<menu_item_call label="Aggiungi come amico..." name="Add Friend"/>
<menu_item_call label="Togli amicizia..." name="Remove Friend"/>
</menu>
diff --git a/indra/newview/skins/default/xui/it/menu_conversation.xml b/indra/newview/skins/default/xui/it/menu_conversation.xml
index 24486f2af2..d4b8d66785 100644
--- a/indra/newview/skins/default/xui/it/menu_conversation.xml
+++ b/indra/newview/skins/default/xui/it/menu_conversation.xml
@@ -29,4 +29,5 @@
<menu_item_call label="Disattiva audio di tutti" name="ModerateVoiceMute"/>
<menu_item_call label="Riattiva audio di tutti" name="ModerateVoiceUnmute"/>
</context_menu>
+ <menu_item_call label="Espelli membro" name="BanMember"/>
</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/it/menu_inventory.xml b/indra/newview/skins/default/xui/it/menu_inventory.xml
index b31e35771d..c8042f4253 100755
--- a/indra/newview/skins/default/xui/it/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/it/menu_inventory.xml
@@ -70,6 +70,7 @@
<menu_item_call label="Esegui" name="Sound Play"/>
<menu_item_call label="Copia SLurl" name="url_copy"/>
<menu_item_call label="Informazioni sul punto di riferimento" name="About Landmark"/>
+ <menu_item_call label="Mostra sulla mappa" name="show_on_map"/>
<menu_item_call label="Riproduci in Second Life" name="Animation Play"/>
<menu_item_call label="Esegui localmente" name="Animation Audition"/>
<menu_item_call label="Invia un Instant Message" name="Send Instant Message"/>
diff --git a/indra/newview/skins/default/xui/it/menu_login.xml b/indra/newview/skins/default/xui/it/menu_login.xml
index 35053ec499..126089aa6a 100755
--- a/indra/newview/skins/default/xui/it/menu_login.xml
+++ b/indra/newview/skins/default/xui/it/menu_login.xml
@@ -5,7 +5,15 @@
<menu_item_call label="Esci da [APP_NAME]" name="Quit"/>
</menu>
<menu label="Aiuto" name="Help">
- <menu_item_call label="Aiuto di [SECOND_LIFE]" name="Second Life Help"/>
+ <menu_item_call label="Istruzioni..." name="How To"/>
+ <menu_item_call label="Guida introduttiva" name="Quickstart"/>
+ <menu_item_call label="Base di conoscenza" name="Knowledge Base"/>
+ <menu_item_call label="Wiki" name="Wiki"/>
+ <menu_item_call label="Forum della comunità" name="Community Forums"/>
+ <menu_item_call label="Portale assistenza" name="Support portal"/>
+ <menu_item_call label="[SECOND_LIFE] Notizie" name="Second Life News"/>
+ <menu_item_call label="[SECOND_LIFE] Blog" name="Second Life Blogs"/>
+ <menu_item_call label="Segnala bug" name="Report Bug"/>
<menu_item_call label="Informazioni su [APP_NAME]" name="About Second Life"/>
</menu>
<menu_item_check label="Mostra menu Debug" name="Show Debug Menu"/>
diff --git a/indra/newview/skins/default/xui/it/menu_object.xml b/indra/newview/skins/default/xui/it/menu_object.xml
index 9bcc0879d2..537cc2dd8e 100755
--- a/indra/newview/skins/default/xui/it/menu_object.xml
+++ b/indra/newview/skins/default/xui/it/menu_object.xml
@@ -21,6 +21,7 @@
<context_menu label="Gestisci" name="Remove">
<menu_item_call label="Segnala abuso" name="Report Abuse..."/>
<menu_item_call label="Blocca" name="Object Mute"/>
+ <menu_item_call label="Sblocca" name="Object Unmute"/>
<menu_item_call label="Restituisci" name="Return..."/>
</context_menu>
<menu_item_call label="Prendi" name="Pie Object Take"/>
diff --git a/indra/newview/skins/default/xui/it/menu_teleport_history_item.xml b/indra/newview/skins/default/xui/it/menu_teleport_history_item.xml
index 81053fbd65..31236895fa 100755
--- a/indra/newview/skins/default/xui/it/menu_teleport_history_item.xml
+++ b/indra/newview/skins/default/xui/it/menu_teleport_history_item.xml
@@ -2,5 +2,5 @@
<context_menu name="Teleport History Item Context Menu">
<menu_item_call label="Teleport" name="Teleport"/>
<menu_item_call label="Maggiori informazioni" name="More Information"/>
- <menu_item_call label="Copia negli appunti" name="CopyToClipboard"/>
+ <menu_item_call label="Copia SLurl" name="CopyToClipboard"/>
</context_menu>
diff --git a/indra/newview/skins/default/xui/it/menu_viewer.xml b/indra/newview/skins/default/xui/it/menu_viewer.xml
index 52247d6c9c..f535a53e66 100755
--- a/indra/newview/skins/default/xui/it/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/it/menu_viewer.xml
@@ -36,6 +36,9 @@
<menu_item_check label="Chat nei dintorni..." name="Nearby Chat"/>
<menu_item_check label="Parla" name="Speak"/>
<menu_item_check label="Registro conversazioni..." name="Conversation Log..."/>
+ <menu_item_call label="Facebook..." name="Facebook"/>
+ <menu_item_call label="Twitter..." name="Twitter"/>
+ <menu_item_call label="Flickr..." name="Flickr"/>
<menu label="Manipolazione voce" name="VoiceMorphing">
<menu_item_check label="Nessuna manipolazione voce" name="NoVoiceMorphing"/>
<menu_item_check label="Anteprima..." name="Preview"/>
@@ -72,11 +75,11 @@
<menu_item_check label="Menu Avanzato" name="Show Advanced Menu"/>
</menu>
<menu label="Sole" name="Sun">
- <menu_item_call label="Alba" name="Sunrise"/>
- <menu_item_call label="Mezzogiorno" name="Noon"/>
- <menu_item_call label="Tramonto" name="Sunset"/>
- <menu_item_call label="Mezzanotte" name="Midnight"/>
- <menu_item_call label="Usa impostazioni regione" name="Use Region Settings"/>
+ <menu_item_check label="Alba" name="Sunrise"/>
+ <menu_item_check label="Mezzogiorno" name="Noon"/>
+ <menu_item_check label="Tramonto" name="Sunset"/>
+ <menu_item_check label="Mezzanotte" name="Midnight"/>
+ <menu_item_check label="Usa impostazioni regione" name="Use Region Settings"/>
</menu>
<menu label="Editor ambiente" name="Environment Editor">
<menu_item_call label="Impostazioni ambiente..." name="Environment Settings"/>
@@ -150,7 +153,8 @@
<menu_item_check label="Posiziona nella griglia" name="Snap to Grid"/>
<menu_item_call label="Posiziona coordinate XY dell&apos;oggetto sulla griglia" name="Snap Object XY to Grid"/>
<menu_item_call label="Usa la selezione per la griglia" name="Use Selection for Grid"/>
- <menu_item_call label="Opzioni della griglia" name="Grid Options"/>
+ <menu_item_call label="Opzioni della griglia..." name="Grid Options"/>
+ <menu_item_call label="Imposta diritti predefiniti..." name="Set default permissions"/>
</menu>
<menu label="Carica sul server" name="Upload">
<menu_item_call label="Immagine ([COST] L$)..." name="Upload Image"/>
@@ -158,15 +162,12 @@
<menu_item_call label="Animazione ([COST] L$)..." name="Upload Animation"/>
<menu_item_call label="Modella..." name="Upload Model"/>
<menu_item_call label="In blocco ([COST] L$ per file)..." name="Bulk Upload"/>
- <menu_item_call label="Definisci diritti di caricamento predefiniti" name="perm prefs"/>
</menu>
<menu_item_call label="Annulla" name="Undo"/>
<menu_item_call label="Ripeti" name="Redo"/>
</menu>
<menu label="Aiuto" name="Help">
<menu_item_call label="Istruzioni..." name="How To"/>
- <menu_item_call label="Aiuto di [SECOND_LIFE]" name="Second Life Help"/>
- <menu_item_call label="Guida dell&apos;utente" name="User’s guide"/>
<menu_item_call label="Base di conoscenza" name="Knowledge Base"/>
<menu_item_call label="Wiki" name="Wiki"/>
<menu_item_call label="Forum della comunità" name="Community Forums"/>
@@ -188,6 +189,7 @@
<menu label="Strumenti di performance" name="Performance Tools">
<menu_item_call label="Misuratore lag" name="Lag Meter"/>
<menu_item_check label="Barra statistiche" name="Statistics Bar"/>
+ <menu_item_call label="Statistiche caricamento scena" name="Scene Load Statistics"/>
<menu_item_check label="Mostra peso visualizzazione per avatar" name="Avatar Rendering Cost"/>
</menu>
<menu label="Evidenziazione e visibilità" name="Highlighting and Visibility">
@@ -249,6 +251,7 @@
<menu_item_check label="Timer veloci" name="Fast Timers"/>
<menu_item_check label="Memoria" name="Memory"/>
<menu_item_check label="Statistiche scena" name="Scene Statistics"/>
+ <menu_item_check label="Monitoraggio caricamento scena" name="Scene Loading Monitor"/>
<menu_item_call label="Console di debug recupero texture" name="Texture Fetch Debug Console"/>
<menu_item_call label="Informazioni regione sulla console di debug" name="Region Info to Debug Console"/>
<menu_item_check label="Fotocamera" name="Camera"/>
@@ -280,6 +283,7 @@
<menu_item_check label="Veloc. di visualizzazione casuale" name="Randomize Framerate"/>
<menu_item_check label="Test frame" name="Frame Test"/>
<menu_item_call label="Profilo frame" name="Frame Profile"/>
+ <menu_item_call label="Benchmark" name="Benchmark"/>
</menu>
<menu label="Render Metadata" name="Render Metadata">
<menu_item_check label="Normali" name="Normals"/>
@@ -287,6 +291,8 @@
<menu_item_check label="Aggiorna tipo" name="Update Type"/>
<menu_item_check label="Info livello dettaglio" name="LOD Info"/>
<menu_item_check label="Crea coda" name="Build Queue"/>
+ <menu_item_check label="Particelle" name="Particles"/>
+ <menu_item_check label="Giunti" name="Joints"/>
<menu_item_check label="Vettori vento" name="Wind Vectors"/>
<menu_item_check label="Complessità rendering" name="rendercomplexity"/>
<menu_item_check label="Byte collegamento" name="attachment bytes"/>
@@ -312,6 +318,7 @@
<menu_item_check label="Rendering delle luci unite" name="Render Attached Lights"/>
<menu_item_check label="Rendering particelle unite" name="Render Attached Particles"/>
<menu_item_check label="Gli oggetti brillano quando sono sotto il cursore" name="Hover Glow Objects"/>
+ <menu_item_call label="Pulisci cache immediatamente" name="Cache Clear"/>
</menu>
<menu label="Rete" name="Network">
<menu_item_check label="Metti in pausa" name="AgentPause"/>
@@ -327,7 +334,6 @@
<menu_item_call label="Test browser multimedia" name="Web Browser Test"/>
<menu_item_call label="Browser contenuto Web" name="Web Content Browser"/>
<menu_item_call label="Stampa informazioni oggetto selezionato" name="Print Selected Object Info"/>
- <menu_item_check label="Console di debug regione" name="Region Debug Console"/>
<menu_item_check label="Debug clic" name="Debug Clicks"/>
<menu_item_check label="Debug eventi mouse" name="Debug Mouse Events"/>
</menu>
diff --git a/indra/newview/skins/default/xui/it/notifications.xml b/indra/newview/skins/default/xui/it/notifications.xml
index 96b8c96595..11211e01fe 100755
--- a/indra/newview/skins/default/xui/it/notifications.xml
+++ b/indra/newview/skins/default/xui/it/notifications.xml
@@ -114,13 +114,13 @@ Per ulteriori informazioni consulta il [[MARKETPLACE_IMPORTS_URL] registro error
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="OutboxImportFailed">
- Trasferimento non riuscito
+ Trasferimento non riuscito, errore &apos;[ERROR_CODE]&apos;
Nessuna cartella è stata inviata a Marketplace, a causa di un errore di sistema o di rete. Riprova più tardi.
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="OutboxInitFailed">
- Inizializzazione Marketplace non riuscita
+ Inizializzazione Marketplace non riuscita, errore &apos;[ERROR_CODE]&apos;
L&apos;inizializzazione con il Marketplace non ha avuto successo a causa di un errore di sistema o di rete. Riprova più tardi.
<usetemplate name="okbutton" yestext="OK"/>
@@ -210,6 +210,22 @@ Aggiungi questo potere a &apos;[ROLE_NAME]&apos;?
Aggiungi questo potere a &apos;[ROLE_NAME]&apos;?
<usetemplate name="okcancelbuttons" notext="No" yestext="Si"/>
</notification>
+ <notification name="AssignBanAbilityWarning">
+ Stai per aggiungere l&apos;abilità &apos;[ACTION_NAME]&apos; al ruolo &apos;[ROLE_NAME]&apos;.
+
+ *AVVISO*
+A tutti i membri che in un ruolo hanno questa abilità verranno concesse anche le abilità &apos;[ACTION_NAME_2]&apos; e &apos;[ACTION_NAME_3]&apos;
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
+ <notification name="RemoveBanAbilityWarning">
+ Stai rimuovendo l&apos;abilità &apos;[ACTION_NAME]&apos; dal ruolo &apos;[ROLE_NAME]&apos;.
+
+ *AVVISO*
+Rimuovendo questa abilità, NON rimuovi le abilità &apos;[ACTION_NAME_2]&apos; e &apos;[ACTION_NAME_3]&apos;.
+
+Se non desideri che queste abilità siano assegnate a questo ruolo, disattivale immediatamente.
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
<notification name="EjectGroupMemberWarning">
Stai per espellere [AVATAR_NAME] dal gruppo.
<usetemplate ignoretext="Conferma l&apos;espulsione di un partecipante dal gruppo" name="okcancelignore" notext="Annulla" yestext="Espelli"/>
@@ -1580,6 +1596,14 @@ Lasciare il gruppo?
Impossibile abbandonare il gruppo. Non puoi abbandonare il gruppo perché sei l&apos;ultimo proprietario del gruppo. Devi prima assegnare a un altro membro il ruolo di proprietario.
<usetemplate name="okbutton" yestext="OK"/>
</notification>
+ <notification name="GroupDepartError">
+ Impossibile abbandonare il gruppo: [reason].
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
+ <notification name="GroupDepart">
+ Hai abbandonato il gruppo [group_name].
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
<notification name="ConfirmKick">
Vuoi veramente espellere tutti i residenti dalla griglia?
<usetemplate name="okcancelbuttons" notext="Annulla" yestext="Espelli tutti i residenti"/>
@@ -1734,6 +1758,10 @@ più del limite [LIMIT].
Sei sicuro di volere il teleport a &lt;nolink&gt;[LOCATION]&lt;/nolink&gt;?
<usetemplate ignoretext="Conferma il teleport verso un punto di riferimento" name="okcancelignore" notext="Annulla" yestext="Teleportati"/>
</notification>
+ <notification name="TeleportViaSLAPP">
+ Sei sicuro di volere il teleport a &lt;nolink&gt;[LOCATION]&lt;/nolink&gt;?
+ <usetemplate ignoretext="Confermo di voler usare il teleport tramite SLAPP" name="okcancelignore" notext="Annulla" yestext="Teleport"/>
+ </notification>
<notification name="TeleportToPick">
Teleport a [PICK]?
<usetemplate ignoretext="Conferma che voglio il teleport verso l&apos;ubicazione nei Luoghi preferiti" name="okcancelignore" notext="Annulla" yestext="Teleport"/>
@@ -1944,6 +1972,9 @@ Cambierà migliaia di regioni e produrrà seri problemi ai vari server.
<notification name="ProblemAddingEstateManager">
Si sono riscontrati problemi nell&apos;aggiungere un nuovo manager della proprietà. Una o più proprietà potrebbero avere la lista dei manager piena.
</notification>
+ <notification name="ProblemAddingEstateBanManager">
+ Impossibile aggiungere il gestore o il proprietario della proprietà alla lista degli espulsi.
+ </notification>
<notification name="ProblemAddingEstateGeneric">
Si sono riscontrati problemi nell&apos;aggiunta a questo elenco della proprietà. Una o più proprietà potrebbe avere una lista piena.
</notification>
@@ -2458,6 +2489,12 @@ Prova a selezionare una parte di terreno più piccola.
<notification name="SystemMessage">
[MESSAGE]
</notification>
+ <notification name="FlickrConnect">
+ [MESSAGE]
+ </notification>
+ <notification name="TwitterConnect">
+ [MESSAGE]
+ </notification>
<notification name="PaymentReceived">
[MESSAGE]
</notification>
@@ -3028,13 +3065,13 @@ Per informazioni dettagliate, vedi il file del registro.
Non è stata ottenuta la capacità della regione &apos;[CAPABILITY]&apos;.
</notification>
<notification name="ShareItemsConfirmation">
- Sei sicuro di volere condividere gli oggetti
+ Sei sicuro di volere condividere gli oggetti seguenti:
-&lt;nolink&gt;[MSG]&lt;/nolink&gt;
+&lt;nolink&gt;[ITEMS]&lt;/nolink&gt;
-Con i seguenti residenti?
+Con i seguenti residenti:
-[RESIDENTS]
+&lt;nolink&gt;[RESIDENTS]&lt;/nolink&gt;
<usetemplate name="okcancelbuttons" notext="Annulla" yestext="OK"/>
</notification>
<notification name="ShareFolderConfirmation">
@@ -3046,7 +3083,7 @@ Sei sicuro di volere condividere gli oggetti seguenti:
Con i seguenti residenti:
-[RESIDENTS]
+&lt;nolink&gt;[RESIDENTS]&lt;/nolink&gt;
<usetemplate name="okcancelbuttons" notext="Annulla" yestext="Ok"/>
</notification>
<notification name="ItemsShared">
@@ -3502,10 +3539,6 @@ Riprova tra un minuto.
<notification name="EjectComingSoon">
Non sei più benvenuto qui e hai [EJECT_TIME] secondi per andartene.
</notification>
- <notification name="NoEnterServerFull">
- Non puoi entrare in questa regione perché
-il server è pieno.
- </notification>
<notification name="SaveBackToInvDisabled">
Opzione Salva nell&apos;inventario disattivata
</notification>
@@ -3695,6 +3728,9 @@ il server è pieno.
<notification name="LinkFailedTooMuchPhysics">
L&apos;oggetto usa troppe risorse per la fisica -- le sue dinamiche sono state disattivate.
</notification>
+ <notification name="EstateManagerFailedllTeleportHome">
+ L&apos;oggetto &apos;[OBJECT_NAME]&apos; a [SLURL] non può eseguire il teleport del gestore della proprietà alla sua casa.
+ </notification>
<notification name="TeleportedHomeByObjectOnParcel">
Sei stato teleportato nella posizione iniziale dall&apos;oggetto &apos;[OBJECT_NAME]&apos; del lotto &apos;[PARCEL_NAME]&apos;
</notification>
@@ -3885,13 +3921,18 @@ il server è pieno.
Non sono stati selezionati abbastanza lotti affittati da collegare.
</notification>
<notification name="CantDivideLandMultipleParcelsSelected">
- Terreno non divisibile.\nHai selezionato più di un lotto.\nProva a selezionare una quantità di terreno più piccola.
+ Impossibile suddividere il terreno.
+È stato selezionato più di un lotto.
+Prova a selezionare un pezzo di terreno più piccolo.
</notification>
<notification name="CantDivideLandCantFindParcel">
- impossibile suddividere il terreno.\nimpossibile trovare il lotto.\nInvia una segnalazione con Aiuto -&gt; Segnala bug...
+ Impossibile suddividere il terreno.
+Lotto non trovato.
+Invia una segnalazione con Aiuto -&gt; Segnala Bug...
</notification>
<notification name="CantDivideLandWholeParcelSelected">
- Impossibile suddividere il terreno. È stato selezionato l&apos;intero lotto.\nProva a selezionare un pezzo di terreno più piccolo.
+ Impossibile suddividere il terreno. È stato selezionato un intero lotto.
+Prova a selezionare un pezzo di terreno più piccolo.
</notification>
<notification name="LandHasBeenDivided">
Il terreno è stato diviso.
@@ -4031,4 +4072,12 @@ il server è pieno.
Impossibile spostare i file. Il percorso precedente è stato ripristinato.
<usetemplate ignoretext="Impossibile spostare i file. Il percorso precedente è stato ripristinato." name="okignore" yestext="OK"/>
</notification>
+ <notification name="DefaultObjectPermissions">
+ Si è verificato un problema nel salvare i diritti predefiniti per il motivo seguente: [REASON]. Riprova più tardi.
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
+ <notification name="ChatHistoryIsBusyAlert">
+ Il file della cronologia del file sta ancora eseguendo l&apos;operazione precedente. Riprova nuovamente tra qualche minuto oppure chatta con un&apos;altra persona.
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
</notifications>
diff --git a/indra/newview/skins/default/xui/it/panel_facebook_account.xml b/indra/newview/skins/default/xui/it/panel_facebook_account.xml
new file mode 100644
index 0000000000..e887e7e4dc
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/panel_facebook_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_account">
+ <string name="facebook_connected" value="Sei in collegamento con Facebook come:"/>
+ <string name="facebook_disconnected" value="Non in collegamento con Facebook"/>
+ <text name="account_caption_label">
+ Non in collegamento con Facebook.
+ </text>
+ <panel name="panel_buttons">
+ <button label="Collegamento..." name="connect_btn"/>
+ <button label="Interrompi collegamento" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Facebook/ta-p/2149711 Come pubblicare su Facebook]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_facebook_friends.xml b/indra/newview/skins/default/xui/it/panel_facebook_friends.xml
new file mode 100644
index 0000000000..917dbec4d9
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/panel_facebook_friends.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_friends">
+ <string name="facebook_friends_empty" value="Attualmente non hai amici su Facebook che sono anche residenti in Second Life. Invita i tuoi amici di Facebook a partecipare a Second Life!"/>
+ <string name="facebook_friends_no_connected" value="Attualmente non sei in collegamento con Facebook. Accedi alla scheda Account per collegarti e attivare questa funzionalità."/>
+ <accordion name="friends_accordion">
+ <accordion_tab name="tab_second_life_friends" title="Amici SL"/>
+ <accordion_tab name="tab_suggested_friends" title="Aggiungi queste persone come amici SL"/>
+ </accordion>
+ <text name="facebook_friends_status">
+ Non in collegamento con Facebook.
+ </text>
+</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_facebook_photo.xml b/indra/newview/skins/default/xui/it/panel_facebook_photo.xml
new file mode 100644
index 0000000000..20ec7f0a70
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/panel_facebook_photo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="Risoluzione immagini">
+ <combo_box.item label="Finestra attuale" name="CurrentWindow"/>
+ <combo_box.item label="640x480" name="640x480"/>
+ <combo_box.item label="800x600" name="800x600"/>
+ <combo_box.item label="1024x768" name="1024x768"/>
+ <combo_box.item label="1200x630" name="1200x630"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="Filtri immagini">
+ <combo_box.item label="Nessun filtro" name="NoFilter"/>
+ </combo_box>
+ <button label="Aggiorna" name="new_snapshot_btn" tool_tip="Fai clic per aggiornare"/>
+ <button label="Anteprima" name="big_preview_btn" tool_tip="Fai clic per alternare l&apos;anteprima"/>
+ <text name="caption_label">
+ Commento (facoltativo):
+ </text>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="Pubblica" name="post_photo_btn"/>
+ <button label="Annulla" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_facebook_place.xml b/indra/newview/skins/default/xui/it/panel_facebook_place.xml
new file mode 100644
index 0000000000..297f0caccc
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/panel_facebook_place.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_place">
+ <layout_stack name="stack_place">
+ <layout_panel name="place_detail_panel">
+ <text name="place_caption_label">
+ Racconta dove ti trovi:
+ </text>
+ </layout_panel>
+ <layout_panel name="place_map_panel">
+ <check_box initial_value="false" label="" name="add_place_view_cb"/>
+ </layout_panel>
+ <layout_panel name="place_button_panel">
+ <button label="Pubblica" name="post_place_btn"/>
+ <button label="Annulla" name="cancel_place_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_facebook_status.xml b/indra/newview/skins/default/xui/it/panel_facebook_status.xml
new file mode 100644
index 0000000000..d373fb0717
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/panel_facebook_status.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_status">
+ <layout_stack name="stack_status">
+ <layout_panel name="status_detail_panel">
+ <text name="status_caption_label">
+ A cosa stai pensando?
+ </text>
+ </layout_panel>
+ <layout_panel name="status_button_panel">
+ <button label="Pubblica" name="post_status_btn"/>
+ <button label="Annulla" name="cancel_status_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_flickr_account.xml b/indra/newview/skins/default/xui/it/panel_flickr_account.xml
new file mode 100644
index 0000000000..573754a68e
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/panel_flickr_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_flickr_account">
+ <string name="flickr_connected" value="Sei in collegamento con Flickr come:"/>
+ <string name="flickr_disconnected" value="Non in collegamento con Flickr"/>
+ <text name="account_caption_label">
+ Non in collegamento con Flickr.
+ </text>
+ <panel name="panel_buttons">
+ <button label="Collegamento..." name="connect_btn"/>
+ <button label="Interrompi collegamento" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Flickr/ta-p/2435609 Come pubblicare su Flickr]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_flickr_photo.xml b/indra/newview/skins/default/xui/it/panel_flickr_photo.xml
new file mode 100644
index 0000000000..064c302b14
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/panel_flickr_photo.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_flickr_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="Risoluzione immagini">
+ <combo_box.item label="Finestra attuale" name="CurrentWindow"/>
+ <combo_box.item label="640x480" name="640x480"/>
+ <combo_box.item label="800x600" name="800x600"/>
+ <combo_box.item label="1024x768" name="1024x768"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="Filtri immagini">
+ <combo_box.item label="Nessun filtro" name="NoFilter"/>
+ </combo_box>
+ <button label="Aggiorna" name="new_snapshot_btn" tool_tip="Fai clic per aggiornare"/>
+ <button label="Anteprima" name="big_preview_btn" tool_tip="Fai clic per alternare l&apos;anteprima"/>
+ <text name="title_label">
+ Titolo:
+ </text>
+ <text name="description_label">
+ Descrizione:
+ </text>
+ <check_box initial_value="true" label="Includi l&apos;ubicazione SL al termine della descrizione" name="add_location_cb"/>
+ <text name="tags_label">
+ Tag:
+ </text>
+ <text name="tags_help_label">
+ Separa tag con spazi
+Usa &quot;&quot; per tag con più di una parola
+ </text>
+ <combo_box name="rating_combobox" tool_tip="Categoria del contenuto di Flickr">
+ <combo_box.item label="Categoria Flickr Sicuro" name="SafeRating"/>
+ <combo_box.item label="Categoria Flickr Moderato" name="ModerateRating"/>
+ <combo_box.item label="Categoria Flickr Censurato" name="RestrictedRating"/>
+ </combo_box>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="Carica" name="post_photo_btn"/>
+ <button label="Annulla" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_group_bulk_ban.xml b/indra/newview/skins/default/xui/it/panel_group_bulk_ban.xml
new file mode 100644
index 0000000000..f4aab7991d
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/panel_group_bulk_ban.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel label="Espelli residenti" name="bulk_ban_panel">
+ <panel.string name="loading">
+ (caricamento...)
+ </panel.string>
+ <panel.string name="ban_selection_too_large">
+ Espulsioni di gruppo non inviate: troppi residenti selezionati Le espulsioni di gruppo possono includere un massimo di 100 persone per ciascuna richiesta.
+ </panel.string>
+ <panel.string name="ban_not_permitted">
+ Espulsione di gruppo non inviata: non hai l&apos;abilità &apos;Gestisci lista espulsi&apos;.
+ </panel.string>
+ <panel.string name="ban_limit_fail">
+ Espulsione di gruppo non inviata: il gruppo ha raggiunto il numero massimo di espulsioni consentite.
+ </panel.string>
+ <panel.string name="partial_ban">
+ Alcune espulsioni di gruppo non sono state inviate:
+[REASONS]
+ </panel.string>
+ <panel.string name="ban_failed">
+ Le espulsioni di gruppo non sono state inviate:
+[REASONS]
+ </panel.string>
+ <panel.string name="residents_already_banned">
+ - I residenti seguenti sono già stati espulsi: [RESIDENTS].
+ </panel.string>
+ <panel.string name="ban_limit_reached">
+ - È stato raggiunto il numero massimo di espulsioni; i seguenti agenti non sono stati espulsi: [RESIDENTS].
+ </panel.string>
+ <panel.string name="cant_ban_yourself">
+ - Non puoi espellerti dal gruppo.
+ </panel.string>
+ <text name="help_text">
+ Puoi selezionare più residenti da espellere dal gruppo. Per iniziare, fai clic su &apos;Apri il selettore di residenti&apos;.
+ </text>
+ <button label="Apri il selettore di residenti" name="add_button"/>
+ <name_list name="banned_agent_list" tool_tip="Tieni premuto Ctrl e fai clic sui nomi dei residenti per selezionare più nomi"/>
+ <button label="Rimuovi i selezionati dalla lista" name="remove_button" tool_tip="Rimuove i residenti selezionati dalla lista espulsi"/>
+ <button label="Espelli residenti" name="ban_button"/>
+ <button label="Annulla" name="cancel_button"/>
+ <string name="GroupBulkBan">
+ Espulsione di gruppo
+ </string>
+</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/it/panel_group_info_sidetray.xml
index 34ee3c2dca..138edc3a26 100755
--- a/indra/newview/skins/default/xui/it/panel_group_info_sidetray.xml
+++ b/indra/newview/skins/default/xui/it/panel_group_info_sidetray.xml
@@ -20,7 +20,7 @@
<layout_panel name="group_accordions">
<accordion name="groups_accordion">
<accordion_tab name="group_general_tab" title="Generale"/>
- <accordion_tab name="group_roles_tab" title="Ruoli"/>
+ <accordion_tab name="group_roles_tab" title="Ruoli e membri"/>
<accordion_tab name="group_notices_tab" title="Avvisi"/>
<accordion_tab name="group_land_tab" title="Terra/Beni"/>
</accordion>
diff --git a/indra/newview/skins/default/xui/it/panel_group_invite.xml b/indra/newview/skins/default/xui/it/panel_group_invite.xml
index 1b57eba3f0..01edb7391a 100755
--- a/indra/newview/skins/default/xui/it/panel_group_invite.xml
+++ b/indra/newview/skins/default/xui/it/panel_group_invite.xml
@@ -22,7 +22,7 @@
Scegli che ruolo assegnare loro:
</text>
<combo_box name="role_name" tool_tip="Scegli dall&apos;elenco dei ruoli ai quali ti è consentito assegnare i membri"/>
- <button label="Manda gli inviti" name="ok_button"/>
+ <button label="Invia inviti" name="invite_button"/>
<button label="Annulla" name="cancel_button"/>
<string name="GroupInvitation">
Invito di gruppo
diff --git a/indra/newview/skins/default/xui/it/panel_group_roles.xml b/indra/newview/skins/default/xui/it/panel_group_roles.xml
index 478b35e628..4d414d47ce 100755
--- a/indra/newview/skins/default/xui/it/panel_group_roles.xml
+++ b/indra/newview/skins/default/xui/it/panel_group_roles.xml
@@ -21,16 +21,18 @@ cliccando sui loro nomi.
<name_list.columns label="Socio" name="name"/>
<name_list.columns label="Donazioni" name="donated"/>
<name_list.columns label="Stato" name="online"/>
+ <name_list.columns label="Titolo" name="title"/>
</name_list>
<button label="Invita" name="member_invite"/>
<button label="Espelli" name="member_eject"/>
+ <button label="Espelli membri" name="member_ban"/>
</panel>
<panel label="RUOLI" name="roles_sub_tab">
<panel.string name="help_text">
I ruoli hanno un titolo con un elenco di abilità permesse
-che i membri possono eseguire. I membri possono avere
-uno o più ruoli. Un gruppo può avere fino a 10 ruoli,
-fra cui il ruolo base o &quot;Tutti&quot; e il ruolo del Proprietario, ovvero il capogruppo.
+ che i membri possono eseguire. I membri possono avere
+ uno o più ruoli. Un gruppo può avere fino a 10 ruoli,
+ fra cui il ruolo &apos;Tutti&apos; e il ruolo &apos;Proprietario&apos;, ovvero il capogruppo.
</panel.string>
<panel.string name="cant_delete_role">
I ruoli &apos;Tutti&apos; e &apos;Proprietari&apos; sono speciali e non possono essere eliminati.
@@ -49,12 +51,27 @@ fra cui il ruolo base o &quot;Tutti&quot; e il ruolo del Proprietario, ovvero il
</panel>
<panel height="148" label="ABILITÀ" name="actions_sub_tab" tool_tip="Puoi vedere la descrizione dell&apos;abilità e quali ruoli o membri possono eseguirla.">
<panel.string name="help_text">
- Le abilità permettono ai membri nei ruoli di fare cose specifiche
-in questo gruppo. C&apos;è una vasta gamma di abilità.
+ Le abilità consentono ai membri nei ruoli di eseguire specifiche
+ attività nel gruppo. Ci sono vari tipi di abilità.
</panel.string>
<filter_editor label="Filtra Abilità" name="filter_input"/>
<scroll_list bottom_delta="-120" height="118" name="action_list" tool_tip="Seleziona un&apos;abilità per vedere maggiori dettagli."/>
</panel>
+ <panel label="RESIDENTI ESPULSI" name="banlist_sub_tab" tool_tip="Visualizza i residenti espulsi dal gruppo.">
+ <panel.string name="help_text">
+ Nessun residente incluso nella lista espulsi potrà iscriversi al gruppo.
+ </panel.string>
+ <panel.string name="ban_count_template">
+ Numero espulsi: [COUNT]/[LIMIT]
+ </panel.string>
+ <name_list name="ban_list">
+ <name_list.columns label="Residente" name="name"/>
+ <name_list.columns label="Data espulsione" name="ban_date"/>
+ </name_list>
+ <button label="Espelli residenti" name="ban_create" tool_tip="Espelli residenti dal gruppo"/>
+ <button label="Annulla espulsioni" name="ban_delete" tool_tip="Annulla l&apos;espulsione dal gruppo per i residenti selezionati"/>
+ <button name="ban_refresh" tool_tip="Aggiorna la lista espulsi"/>
+ </panel>
</tab_container>
<panel name="members_footer">
<text name="static">
diff --git a/indra/newview/skins/default/xui/it/panel_login.xml b/indra/newview/skins/default/xui/it/panel_login.xml
index 2afde40940..1ce38ac40c 100755
--- a/indra/newview/skins/default/xui/it/panel_login.xml
+++ b/indra/newview/skins/default/xui/it/panel_login.xml
@@ -1,46 +1,27 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8"?>
<panel name="panel_login">
<panel.string name="forgot_password_url">
http://secondlife.com/account/request.php?lang=it
</panel.string>
- <layout_stack name="login_widgets">
- <layout_panel name="login">
- <text name="log_in_text">
- ACCEDI
- </text>
- <text name="username_text">
- Nome utente:
- </text>
- <combo_box name="username_combo" tool_tip="Il nome utente che hai scelto durante la registrazione, come robby12 o Stella Soleggiato"/>
- <text name="password_text">
- Password:
- </text>
- </layout_panel>
- <layout_panel name="start_location_panel">
- <text name="start_location_text">
- Inizia da:
- </text>
- <combo_box name="start_location_combo">
- <combo_box.item label="La mia ultima ubicazione" name="MyLastLocation"/>
- <combo_box.item label="Casa mia" name="MyHome"/>
- <combo_box.item label="&lt;Scrivi nome regione&gt;" name="Typeregionname"/>
- </combo_box>
- </layout_panel>
- <layout_panel name="links_login_panel">
- <text name="login_help">
- Ti serve aiuto con la fase di accesso?
- </text>
+ <layout_stack name="ui_stack">
+ <layout_panel name="ui_container">
+ <combo_box label="Nome utente" name="username_combo" tool_tip="Il nome utente che hai scelto durante la registrazione, come roby12 o Stella Solare"/>
+ <line_editor label="Password" name="password_edit"/>
+ <check_box label="Ricordami" name="remember_check"/>
<text name="forgot_password_text">
- Hai dimenticato il nome utente o la password?
+ Password dimenticata
</text>
<button label="Accedi" name="connect_btn"/>
- <check_box label="Ricorda password" name="remember_check"/>
- </layout_panel>
- <layout_panel name="links">
- <text name="create_account_text">
- CREA IL TUO ACCOUNT
+ <text name="At_My_Last_Location_Label">
+ all&apos;ultima ubicazione
</text>
- <button label="Inizia adesso" name="create_new_account_btn"/>
+ <combo_box label="I miei luoghi preferiti" name="start_location_combo">
+ <combo_box.item label="Casa mia" name="MyHome"/>
+ </combo_box>
+ <button label="Accedi" name="connect_favorite_btn"/>
+ <line_editor label="Digita un&apos;ubicazione" name="location_edit"/>
+ <button label="Accedi" name="connect_location_btn"/>
+ <combo_box label="Seleziona griglia" name="server_combo"/>
</layout_panel>
</layout_stack>
</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_login_first.xml b/indra/newview/skins/default/xui/it/panel_login_first.xml
new file mode 100644
index 0000000000..6f120a17fc
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/panel_login_first.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_login">
+ <panel.string name="forgot_password_url">
+ http://secondlife.com/account/request.php?lang=it
+ </panel.string>
+ <layout_stack name="logo_stack">
+ <layout_panel name="parent_panel2">
+ <layout_stack name="widget_stack">
+ <layout_panel name="widget_container">
+ <combo_box label="Nome utente" name="username_combo" tool_tip="Il nome utente che hai scelto durante la registrazione, come roby12 o Stella Solare"/>
+ <line_editor label="Password" name="password_edit"/>
+ <button label="Accedi" name="connect_btn"/>
+ <check_box label="Ricordami" name="remember_check"/>
+ <text name="forgot_password_text">
+ Password dimenticata
+ </text>
+ </layout_panel>
+ </layout_stack>
+ </layout_panel>
+ <layout_panel name="parent_panel3">
+ <layout_stack name="images_stack">
+ <layout_panel name="images_container">
+ <text name="image_caption_left">
+ Il primo passo è a Learning Island. Trova il portale di uscita!
+ </text>
+ <text name="image_caption_right">
+ Quindi esplora Social Island e incontra altri nuovi residenti.
+ </text>
+ </layout_panel>
+ </layout_stack>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/it/panel_preferences_advanced.xml
index 224780f234..ccca27cbfd 100755
--- a/indra/newview/skins/default/xui/it/panel_preferences_advanced.xml
+++ b/indra/newview/skins/default/xui/it/panel_preferences_advanced.xml
@@ -28,4 +28,5 @@
<check_box label="Mostra selezione griglia all&apos;accesso" name="show_grid_selection_check"/>
<check_box label="Mostra menu Avanzato" name="show_advanced_menu_check"/>
<check_box label="Mostra menu Sviluppatore" name="show_develop_menu_check"/>
+ <button label="Diritti di creazione predefiniti" name="default_creation_permissions"/>
</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_preferences_general.xml b/indra/newview/skins/default/xui/it/panel_preferences_general.xml
index 45cc06c2ea..ef999d03c0 100755
--- a/indra/newview/skins/default/xui/it/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/it/panel_preferences_general.xml
@@ -30,14 +30,10 @@
<combo_box.item label="Generale e Moderato" name="Desired_Mature"/>
<combo_box.item label="Generale" name="Desired_PG"/>
</combo_box>
- <text name="start_location_textbox">
- Luogo di partenza:
+ <check_box label="Mostra le ubicazioni preferite sulla schermata di accesso" name="favorites_on_login_check"/>
+ <text name="favorites_check_extra_text">
+ (Le vedranno anche gli altri utenti che usano questo computer)
</text>
- <combo_box name="start_location_combo">
- <combo_box.item label="Ultimo luogo visitato" name="MyLastLocation" tool_tip="Vai automaticamente all&apos;ultimo luogo visitato quando effettui l&apos;accesso."/>
- <combo_box.item label="Casa mia" name="MyHome" tool_tip="Vai automaticamente a casa quando effettui l&apos;accesso"/>
- </combo_box>
- <check_box initial_value="true" label="Mostra con il login" name="show_location_checkbox"/>
<text name="name_tags_textbox">
Nome:
</text>
diff --git a/indra/newview/skins/default/xui/it/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/it/panel_preferences_privacy.xml
index 41e7a59139..2a73b66c9e 100755
--- a/indra/newview/skins/default/xui/it/panel_preferences_privacy.xml
+++ b/indra/newview/skins/default/xui/it/panel_preferences_privacy.xml
@@ -7,7 +7,7 @@
<text name="cache_size_label_l">
(Luoghi, immagini, web, cronologia ricerche)
</text>
- <check_box label="Mostrami nei risultati della ricerca" name="online_searchresults"/>
+ <check_box label="Mostra il mio profilo nei risultati delle ricerche" name="online_searchresults"/>
<check_box label="Solo amici e gruppi mi vedono online" name="online_visibility"/>
<check_box label="Solo amici e gruppi possono chiamarmi o mandarmi IM" name="voice_call_friends_only_check"/>
<check_box label="Spegnere il microfono alla chiusura delle chiamate" name="auto_disengage_mic_check"/>
diff --git a/indra/newview/skins/default/xui/it/panel_region_debug.xml b/indra/newview/skins/default/xui/it/panel_region_debug.xml
index aba60d03aa..88c056bf5e 100755
--- a/indra/newview/skins/default/xui/it/panel_region_debug.xml
+++ b/indra/newview/skins/default/xui/it/panel_region_debug.xml
@@ -7,11 +7,8 @@
sconosciuta
</text>
<check_box label="Disabilita gli script" name="disable_scripts_check" tool_tip="Disabilita tutti gli script in questa regione"/>
- <button label="?" name="disable_scripts_help"/>
<check_box label="Disabilita le collisioni" name="disable_collisions_check" tool_tip="Disabilita tutte le collisioni non di avatar in questa regione"/>
- <button label="?" name="disable_collisions_help"/>
<check_box label="Disabilita la fisica" name="disable_physics_check" tool_tip="Disabilita tutta la fisica dei corpi in questa regione"/>
- <button label="?" name="disable_physics_help"/>
<button label="Applica" name="apply_btn"/>
<text name="objret_text_lbl" width="130">
Restituisci oggetti
@@ -31,10 +28,8 @@
<check_box label="In tutte le regioni di questa proprietà" name="return_estate_wide" tool_tip="Restituisci tutti gli oggetti nelle varie regioni che costituiscono l&apos;insieme dei possedimenti terrieri"/>
<button label="Restituisci" name="return_btn"/>
<button label="Visualizza l&apos;elenco dei maggiori collidenti..." name="top_colliders_btn" tool_tip="Elenco degli oggetti che stanno potenzialmente subendo le maggiori collisioni" width="280"/>
- <button label="?" left="297" name="top_colliders_help"/>
- <button label="Visualizza l&apos;elenco degli script più pesanti..." name="top_scripts_btn" tool_tip="Elenco degli oggetti che impiegano più tempo a far girare gli script" width="280"/>
- <button label="?" left="297" name="top_scripts_help"/>
<button label="Riavvia la regione" name="restart_btn" tool_tip="Dai 2 minuti di tempo massimo e fai riavviare la regione"/>
- <button label="?" name="restart_help"/>
+ <button label="Visualizza l&apos;elenco degli script più pesanti..." name="top_scripts_btn" tool_tip="Elenco degli oggetti che impiegano più tempo a far girare gli script" width="280"/>
<button label="Annulla riavvio" name="cancel_restart_btn" tool_tip="Annulla riavvio regione"/>
+ <button label="Console di debug regione" name="region_debug_console_btn" tool_tip="Apri console di debug regione"/>
</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_region_general.xml b/indra/newview/skins/default/xui/it/panel_region_general.xml
index c550e005ae..3e2f593d2f 100755
--- a/indra/newview/skins/default/xui/it/panel_region_general.xml
+++ b/indra/newview/skins/default/xui/it/panel_region_general.xml
@@ -20,12 +20,12 @@
</text>
<check_box label="Proibisci la modifica del terreno" name="block_terraform_check"/>
<check_box label="Impedisci il volo" name="block_fly_check"/>
+ <check_box label="Blocca il volo sul lotto" name="block_fly_over_check" tool_tip="Espandi il controllo dell&apos;accesso in alto per impedire il volo sopra un lotto"/>
<check_box label="Abilita i danni" name="allow_damage_check"/>
<check_box label="Limita gli urti" name="restrict_pushobject"/>
<check_box label="Abilita la rivendita del terreno" name="allow_land_resell_check"/>
<check_box label="Abilita unione/suddivisione del terreno" name="allow_parcel_changes_check"/>
<check_box label="Proibisci che il terreno appaia nelle ricerche" name="block_parcel_search_check" tool_tip="Permetti che le persone vedano questa regione e le sue suddivisioni nei risultati delle ricerche"/>
- <check_box label="Consenti oggetti con reticolo" name="mesh_rez_enabled_check" tool_tip="Permetti alle persone di rezzare oggetti con reticolo su questa regione"/>
<spinner label="Limite massimo di avatar" label_width="135" name="agent_limit_spin" width="190"/>
<spinner label="Bonus di oggetti" label_width="135" name="object_bonus_spin" width="190"/>
<text label="Maturità" name="access_text" width="120">
diff --git a/indra/newview/skins/default/xui/it/panel_script_ed.xml b/indra/newview/skins/default/xui/it/panel_script_ed.xml
index feee8b1927..3cbdadbac8 100755
--- a/indra/newview/skins/default/xui/it/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/it/panel_script_ed.xml
@@ -24,6 +24,7 @@
<menu_item_call label="Annulla tutte le modifiche" name="Revert All Changes"/>
<menu_item_call label="Carica da file..." name="LoadFromFile"/>
<menu_item_call label="Salva su file..." name="SaveToFile"/>
+ <menu_item_call label="Colori..." name="Colors"/>
</menu>
<menu label="Modifica" name="Edit">
<menu_item_call label="Annulla" name="Undo"/>
@@ -41,9 +42,9 @@
<menu_item_call label="Aiuto con parole chiave..." name="Keyword Help..."/>
</menu>
</menu_bar>
- <text_editor name="Script Editor">
+ <script_editor name="Script Editor">
Caricamento in corso...
- </text_editor>
+ </script_editor>
<combo_box label="Inserisci..." name="Insert..."/>
<button label="Salva" label_selected="Salva" name="Save_btn"/>
<button label="Modifica..." name="Edit_btn"/>
diff --git a/indra/newview/skins/default/xui/it/panel_snapshot_options.xml b/indra/newview/skins/default/xui/it/panel_snapshot_options.xml
index f2d42c5197..a043e5add6 100755
--- a/indra/newview/skins/default/xui/it/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/it/panel_snapshot_options.xml
@@ -4,4 +4,13 @@
<button label="E-mail" name="save_to_email_btn"/>
<button label="Salva nell&apos;inventario (L$[AMOUNT])" name="save_to_inventory_btn"/>
<button label="Salva sul mio computer" name="save_to_computer_btn"/>
+ <text name="send_to_facebook_textbox">
+ Invia a: [secondlife:/// Facebook]
+ </text>
+ <text name="send_to_twitter_textbox">
+ [secondlife:/// Twitter]
+ </text>
+ <text name="send_to_flickr_textbox">
+ [secondlife:/// Flickr]
+ </text>
</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_teleport_history_item.xml b/indra/newview/skins/default/xui/it/panel_teleport_history_item.xml
index 2ba4baacaf..050298ffcf 100755
--- a/indra/newview/skins/default/xui/it/panel_teleport_history_item.xml
+++ b/indra/newview/skins/default/xui/it/panel_teleport_history_item.xml
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="teleport_history_item">
+ <text name="timestamp" value="..."/>
<button name="profile_btn" tool_tip="Mostra informazioni dell&apos;oggetto"/>
</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_twitter_account.xml b/indra/newview/skins/default/xui/it/panel_twitter_account.xml
new file mode 100644
index 0000000000..7eb3968f75
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/panel_twitter_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_twitter_account">
+ <string name="twitter_connected" value="Sei in collegamento con Twitter come:"/>
+ <string name="twitter_disconnected" value="Non in collegamento con Twitter"/>
+ <text name="account_caption_label">
+ Non in collegamento con Twitter.
+ </text>
+ <panel name="panel_buttons">
+ <button label="Collegamento..." name="connect_btn"/>
+ <button label="Interrompi collegamento" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Twitter/ta-p/2435453 Come pubblicare su Twitter]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/it/panel_twitter_photo.xml b/indra/newview/skins/default/xui/it/panel_twitter_photo.xml
new file mode 100644
index 0000000000..740ec3961f
--- /dev/null
+++ b/indra/newview/skins/default/xui/it/panel_twitter_photo.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_twitter_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="text_panel">
+ <text name="status_label">
+ Cosa sta succedendo?
+ </text>
+ <text name="status_counter_label">
+ 140
+ </text>
+ <check_box initial_value="true" label="Includi l&apos;ubicazione in SL" name="add_location_cb"/>
+ <check_box initial_value="true" label="Includi una foto" name="add_photo_cb"/>
+ </layout_panel>
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="Risoluzione immagini">
+ <combo_box.item label="Finestra attuale" name="CurrentWindow"/>
+ <combo_box.item label="640x480" name="640x480"/>
+ <combo_box.item label="800x600" name="800x600"/>
+ <combo_box.item label="1024x768" name="1024x768"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="Filtri immagini">
+ <combo_box.item label="Nessun filtro" name="NoFilter"/>
+ </combo_box>
+ <button label="Aggiorna" name="new_snapshot_btn" tool_tip="Fai clic per aggiornare"/>
+ <button label="Anteprima" name="big_preview_btn" tool_tip="Fai clic per alternare l&apos;anteprima"/>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="Tweetta" name="post_photo_btn"/>
+ <button label="Annulla" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/it/role_actions.xml b/indra/newview/skins/default/xui/it/role_actions.xml
index 3ccb674ed0..80d65a9c74 100755
--- a/indra/newview/skins/default/xui/it/role_actions.xml
+++ b/indra/newview/skins/default/xui/it/role_actions.xml
@@ -3,6 +3,7 @@
<action_set description="Queste abilità permettono di aggiungere e rimuovere membri dal gruppo e consentono ai nuovi membri di aderire al gruppo senza invito." name="Membership">
<action description="Invita persone in questo gruppo" longdescription="Invita persone in questo gruppo usando il pulsante Invita nella sezione Ruoli &gt; scheda membri." name="member invite" value="1"/>
<action description="Espelli membri da questo gruppo" longdescription="Espelli membri dal gruppo usando il pulsante Espelli nella sezione Ruoli &gt; scheda membri. Un proprietario può espellere chiunque tranne un altro proprietario. Se non sei un proprietario, un membro può essere espulso da un gruppo soltanto qualora abbia soltanto il ruolo Tutti, e nessun altro ruolo. Per rimuovere membri dai ruoli, devi avere l&apos;Abilità corrispondente." name="member eject" value="2"/>
+ <action description="Gestisci lista espulsi" longdescription="Consenti ai membri del gruppo di espellere / riammettere i residenti nel gruppo." name="allow ban" value="51"/>
<action description="Seleziona Iscrizione libera e modifica la Quota d&apos;iscrizione" longdescription="Seleziona Iscrizione libera per permettere ai nuovi membri di aderire senza invito e modifica la quota d&apos;iscrizione nella scheda Generale." name="member options" value="3"/>
</action_set>
<action_set description="Queste Abilità permettono di aggiungere, rimuovere, cambiare i ruoli del gruppo, aggiungere e rimuovere membri dai ruoli, nonché assegnare abilità ai ruoli." name="Roles">
diff --git a/indra/newview/skins/default/xui/it/sidepanel_inventory.xml b/indra/newview/skins/default/xui/it/sidepanel_inventory.xml
index 5ac0961bd7..2f00a023bb 100755
--- a/indra/newview/skins/default/xui/it/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/it/sidepanel_inventory.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel label="Cose" name="objects panel">
- <panel label="" name="sidepanel__inventory_panel">
+ <panel label="" name="sidepanel_inventory_panel">
<layout_stack name="inventory_layout_stack">
<layout_panel name="inbox_layout_panel">
<panel label="" name="marketplace_inbox">
@@ -33,7 +33,7 @@
<layout_panel name="shop_btn_lp">
<button label="Acquisti" name="shop_btn" tool_tip="Apri pagina web di Marketplace"/>
<button label="Indossa" name="wear_btn" tool_tip="Indossa il vestiario selezionato"/>
- <button label="Riproduci" name="play_btn"/>
+ <button label="Gioca" name="play_btn"/>
<button label="Teleport" name="teleport_btn" tool_tip="Teleport alla zona selezionata"/>
</layout_panel>
</layout_stack>
diff --git a/indra/newview/skins/default/xui/it/strings.xml b/indra/newview/skins/default/xui/it/strings.xml
index 60ed2b0929..17ce8aaf5e 100755
--- a/indra/newview/skins/default/xui/it/strings.xml
+++ b/indra/newview/skins/default/xui/it/strings.xml
@@ -34,6 +34,45 @@
<string name="StartupRequireDriverUpdate">
Inizializzazione grafica non riuscita. Aggiorna il driver della scheda grafica!
</string>
+ <string name="AboutHeader">
+ [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2] ([VIEWER_VERSION_3]) [BUILD_DATE] [BUILD_TIME] ([CHANNEL])
+[[VIEWER_RELEASE_NOTES_URL] [ReleaseNotes]]
+ </string>
+ <string name="AboutCompiler">
+ Generato con [COMPILER] versione [COMPILER_VERSION]
+ </string>
+ <string name="AboutPosition">
+ Tu sei a [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] in [REGION] che si trova a &lt;nolink&gt;[HOSTNAME]&lt;/nolink&gt; ([HOSTIP])
+SLURL: &lt;nolink&gt;[SLURL]&lt;/nolink&gt;
+(coordinate globali [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1])
+[SERVER_VERSION]
+[SERVER_RELEASE_NOTES_URL]
+ </string>
+ <string name="AboutSystem">
+ CPU: [CPU]
+Memoria: [MEMORY_MB] MB
+Versione sistema operativo: [OS_VERSION]
+Venditore scheda grafica: [GRAPHICS_CARD_VENDOR]
+Scheda grafica: [GRAPHICS_CARD]
+ </string>
+ <string name="AboutDriver">
+ Versione driver Windows per grafica: [GRAPHICS_DRIVER_VERSION]
+ </string>
+ <string name="AboutLibs">
+ Versione OpenGL: [OPENGL_VERSION]
+
+Versione libcurl: [LIBCURL_VERSION]
+Versione J2C Decoder: [J2C_VERSION]
+Versione Driver audio: [AUDIO_DRIVER_VERSION]
+Versione Qt Webkit: [QT_WEBKIT_VERSION]
+Versione Server voice: [VOICE_VERSION]
+ </string>
+ <string name="AboutTraffic">
+ Pacchetti perduti: [PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number,1]%)
+ </string>
+ <string name="ErrorFetchingServerReleaseNotesURL">
+ Errore nel recupero URL note rilascio versione
+ </string>
<string name="ProgressRestoring">
Ripristino in corso...
</string>
@@ -293,6 +332,75 @@ Prova ad accedere nuovamente tra un minuto.
<string name="TestingDisconnect">
Verifica scollegamento viewer
</string>
+ <string name="SocialFlickrConnecting">
+ Collegamento a Flickr...
+ </string>
+ <string name="SocialFlickrPosting">
+ Caricamento post...
+ </string>
+ <string name="SocialFlickrDisconnecting">
+ Interruzione del collegamento con Flickr...
+ </string>
+ <string name="SocialFlickrErrorConnecting">
+ Problema nel collegamento a Flickr
+ </string>
+ <string name="SocialFlickrErrorPosting">
+ Problema nel caricamento post su Flickr
+ </string>
+ <string name="SocialFlickrErrorDisconnecting">
+ Problema nell&apos;interruzione del collegamento da Flickr
+ </string>
+ <string name="SocialTwitterConnecting">
+ Collegamento a Twitter...
+ </string>
+ <string name="SocialTwitterPosting">
+ Caricamento post...
+ </string>
+ <string name="SocialTwitterDisconnecting">
+ Interruzione del collegamento con Twitter...
+ </string>
+ <string name="SocialTwitterErrorConnecting">
+ Problema nel collegamento a Twitter
+ </string>
+ <string name="SocialTwitterErrorPosting">
+ Problema nel caricamento post su Twitter
+ </string>
+ <string name="SocialTwitterErrorDisconnecting">
+ Problema nell&apos;interruzione del collegamento da Twitter
+ </string>
+ <string name="BlackAndWhite">
+ Bianco e nero
+ </string>
+ <string name="Colors1970">
+ Colori anni &apos;70
+ </string>
+ <string name="Intense">
+ Intenso
+ </string>
+ <string name="Newspaper">
+ Giornale
+ </string>
+ <string name="Sepia">
+ Seppia
+ </string>
+ <string name="Spotlight">
+ Faretto
+ </string>
+ <string name="Video">
+ Video
+ </string>
+ <string name="Autocontrast">
+ Auto contrasto
+ </string>
+ <string name="LensFlare">
+ Bagliore
+ </string>
+ <string name="Miniature">
+ Miniatura
+ </string>
+ <string name="Toycamera">
+ Toy camera
+ </string>
<string name="TooltipPerson">
Persona
</string>
@@ -841,6 +949,12 @@ Prova ad accedere nuovamente tra un minuto.
<string name="use_texture">
Usa texture
</string>
+ <string name="manip_hint1">
+ Sposta il cursore sul righello
+ </string>
+ <string name="manip_hint2">
+ per bloccare sulla griglia
+ </string>
<string name="texture_loading">
Caricamento in corso...
</string>
@@ -931,12 +1045,12 @@ Prova ad accedere nuovamente tra un minuto.
<string name="ControlYourCamera">
Controllare la tua fotocamera
</string>
- <string name="AgentNameSubst">
- (Tu)
- </string>
<string name="TeleportYourAgent">
Teleportarti
</string>
+ <string name="AgentNameSubst">
+ (Tu)
+ </string>
<string name="JoinAnExperience">
Partecipa a un&apos;esperienza
</string>
@@ -1290,6 +1404,18 @@ Prova ad accedere nuovamente tra un minuto.
<string name="InventoryOutboxNoItems">
Trascina le cartelle in questa area e clicca su &quot;Invia a Marketplace&quot; per metterle in vendita su [[MARKETPLACE_DASHBOARD_URL] Marketplace].
</string>
+ <string name="InventoryOutboxInitializingTitle">
+ Inizializzazione Marketplace.in corso
+ </string>
+ <string name="InventoryOutboxInitializing">
+ Stiamo eseguendo l&apos;accesso al tuo account sul [[MARKETPLACE_CREATE_STORE_URL] negozio Marketplace].
+ </string>
+ <string name="InventoryOutboxErrorTitle">
+ Errori in Marketplace.
+ </string>
+ <string name="InventoryOutboxError">
+ Il [[MARKETPLACE_CREATE_STORE_URL] negozio nel Marketplace] ha riportato errori.
+ </string>
<string name="Marketplace Error None">
Nessun errore
</string>
@@ -1317,6 +1443,9 @@ Prova ad accedere nuovamente tra un minuto.
<string name="Open landmarks">
Apri luoghi di riferimento
</string>
+ <string name="Unconstrained">
+ Libero
+ </string>
<string name="no_transfer" value="(nessun trasferimento)"/>
<string name="no_modify" value="(nessuna modifica)"/>
<string name="no_copy" value="(nessuna copia)"/>
@@ -1711,6 +1840,9 @@ Prova ad accedere nuovamente tra un minuto.
<string name="CompileQueueDownloadedCompiling">
Scaricato, in compilazione
</string>
+ <string name="CompileQueueServiceUnavailable">
+ Il servizio di compilazione degli script non è disponibile
+ </string>
<string name="CompileQueueScriptNotFound">
Script non trovato sul server.
</string>
@@ -3939,6 +4071,12 @@ Se il messaggio persiste, contatta [SUPPORT_SITE].
<string name="conference-title-incoming">
Chiamata in conferenza con [AGENT_NAME]
</string>
+ <string name="flickr_post_success">
+ Hai pubblicato su Flickr.
+ </string>
+ <string name="twitter_post_success">
+ Hai pubblicato su Twitter.
+ </string>
<string name="no_session_message">
(La sessione IM non esiste)
</string>
@@ -4395,6 +4533,9 @@ Segnala abuso
<string name="LocalEstimateUSD">
US$ [AMOUNT]
</string>
+ <string name="Group Ban">
+ Espulsione di gruppo
+ </string>
<string name="Membership">
Abbonamento
</string>
@@ -4817,6 +4958,12 @@ Prova a racchiudere il percorso dell&apos;editor in doppie virgolette.
<string name="Command_Destinations_Label">
Destinazioni
</string>
+ <string name="Command_Facebook_Label">
+ Facebook
+ </string>
+ <string name="Command_Flickr_Label">
+ Flickr
+ </string>
<string name="Command_Gestures_Label">
Gesture
</string>
@@ -4865,6 +5012,9 @@ Prova a racchiudere il percorso dell&apos;editor in doppie virgolette.
<string name="Command_Speak_Label">
Parla
</string>
+ <string name="Command_Twitter_Label">
+ Twitter
+ </string>
<string name="Command_View_Label">
Controlli fotocamera
</string>
@@ -4895,6 +5045,12 @@ Prova a racchiudere il percorso dell&apos;editor in doppie virgolette.
<string name="Command_Destinations_Tooltip">
Destinazioni interessanti
</string>
+ <string name="Command_Facebook_Tooltip">
+ Pubblica su Facebook
+ </string>
+ <string name="Command_Flickr_Tooltip">
+ Carica su Flickr
+ </string>
<string name="Command_Gestures_Tooltip">
Gesti per il tuo avatar
</string>
@@ -4943,6 +5099,9 @@ Prova a racchiudere il percorso dell&apos;editor in doppie virgolette.
<string name="Command_Speak_Tooltip">
Parla con persone vicine usando il microfono
</string>
+ <string name="Command_Twitter_Tooltip">
+ Twitter
+ </string>
<string name="Command_View_Tooltip">
Modifica angolo fotocamera
</string>
diff --git a/indra/newview/skins/default/xui/ja/floater_big_preview.xml b/indra/newview/skins/default/xui/ja/floater_big_preview.xml
new file mode 100644
index 0000000000..bb55db7a13
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/floater_big_preview.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_big_preview" title="プレビュー"/>
diff --git a/indra/newview/skins/default/xui/ja/floater_facebook.xml b/indra/newview/skins/default/xui/ja/floater_facebook.xml
new file mode 100644
index 0000000000..d99841f0de
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/floater_facebook.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_facebook" title="FACEBOOK ã«æŠ•ç¨¿">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="ステータス" name="panel_facebook_status"/>
+ <panel label="写真" name="panel_facebook_photo"/>
+ <panel label="ãƒã‚§ãƒƒã‚¯ã‚¤ãƒ³" name="panel_facebook_place"/>
+ <panel label="フレンド" name="panel_facebook_friends"/>
+ <panel label="アカウント" name="panel_facebook_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ エラー
+ </text>
+ <text name="connection_loading_text">
+ ロード中...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/ja/floater_flickr.xml b/indra/newview/skins/default/xui/ja/floater_flickr.xml
new file mode 100644
index 0000000000..e406d17d37
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/floater_flickr.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_flickr" title="FLICKR ã«ã‚¢ãƒƒãƒ—ロード">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="写真" name="panel_flickr_photo"/>
+ <panel label="アカウント" name="panel_flickr_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ エラー
+ </text>
+ <text name="connection_loading_text">
+ ロード中...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/ja/floater_lagmeter.xml b/indra/newview/skins/default/xui/ja/floater_lagmeter.xml
index e3546cd837..e3546cd837 100755..100644
--- a/indra/newview/skins/default/xui/ja/floater_lagmeter.xml
+++ b/indra/newview/skins/default/xui/ja/floater_lagmeter.xml
diff --git a/indra/newview/skins/default/xui/ja/floater_perms_default.xml b/indra/newview/skins/default/xui/ja/floater_perms_default.xml
new file mode 100644
index 0000000000..1eac6b9e35
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/floater_perms_default.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="perms default" title="デフォルトã®ä½œæˆæ¨©é™">
+ <panel label="デフォルト権é™" name="default permissions"/>
+ <button label="OK" label_selected="OK" name="ok"/>
+ <button label="å–り消ã—" label_selected="å–り消ã—" name="cancel"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/ja/floater_region_restarting.xml b/indra/newview/skins/default/xui/ja/floater_region_restarting.xml
new file mode 100644
index 0000000000..e9ba9d230d
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/floater_region_restarting.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="region_restarting" title="リージョンã®å†èµ·å‹•">
+ <string name="RegionName">
+ 今 ([NAME]) ãŒã„るリージョンをå†èµ·å‹•ã—よã†ã¨ã—ã¦ã„ã¾ã™ã€‚
+
+ã“ã®ã¾ã¾ã“ã“ã«ã„ã‚‹ã¨ãƒ­ã‚°ã‚¢ã‚¦ãƒˆã•れã¾ã™ã€‚
+ </string>
+ <string name="RestartSeconds">
+ å†èµ·å‹•ã¾ã§ã®ç§’æ•°
+[SECONDS]
+ </string>
+ <panel name="layout_panel_1">
+ <text name="region_name">
+ 今 (-最長リージョンå-) ãŒã„るリージョンをå†èµ·å‹•ã—よã†ã¨ã—ã¦ã„ã¾ã™ã€‚
+
+ã“ã®ã¾ã¾ã“ã“ã«ã„ã‚‹ã¨ãƒ­ã‚°ã‚¢ã‚¦ãƒˆã•れã¾ã™ã€‚
+ </text>
+ <text name="restart_seconds">
+ å†èµ·å‹•ã¾ã§ã®ç§’æ•°
+ 32767
+ </text>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/ja/floater_report_abuse.xml b/indra/newview/skins/default/xui/ja/floater_report_abuse.xml
index dc34441535..9021be5dda 100755
--- a/indra/newview/skins/default/xui/ja/floater_report_abuse.xml
+++ b/indra/newview/skins/default/xui/ja/floater_report_abuse.xml
@@ -44,7 +44,7 @@
<combo_box.item label="å¹´é½¢ &gt; æˆäººã®ä½äººãŒ Teen Second Life ã«ã„ã‚‹" name="Age__Adult_resident_on_Teen_Second_Life"/>
<combo_box.item label="å¹´é½¢ &gt; 未æˆå¹´ã®ä½äººãŒTeen Second Life ã®å¤–ã«ã„ã‚‹" name="Age__Underage_resident_outside_of_Teen_Second_Life"/>
<combo_box.item label="攻撃>コンãƒãƒƒãƒˆãƒ»ã‚µãƒ³ãƒ‰ãƒœãƒƒã‚¯ã‚¹/å±é™ºãªã‚¨ãƒªã‚¢" name="Assault__Combat_sandbox___unsafe_area"/>
- <combo_box.item label="攻撃>安全ãªã‚¨ãƒªã‚¢" name="Assault__Safe_area"/>
+ <combo_box.item label="攻撃 &gt; 安全エリアã§ä»–ã®ä½äººã‚’銃撃ã€ãƒ—ッシュã€ã¾ãŸã¯çªã飛ã°ã™" name="Assault__Safe_area"/>
<combo_box.item label="攻撃>武器テスト用サンドボックス" name="Assault__Weapons_testing_sandbox"/>
<combo_box.item label="商å–引>製å“ã¾ãŸã¯ã‚µãƒ¼ãƒ“ã‚¹ã®æä¾›ãŒè¡Œã‚れãªã„" name="Commerce__Failure_to_deliver_product_or_service"/>
<combo_box.item label="é–‹ç¤ºï¼žãƒªã‚¢ãƒ«ãƒ¯ãƒ¼ãƒ«ãƒ‰ã®æƒ…å ±" name="Disclosure__Real_world_information"/>
@@ -58,25 +58,25 @@
<combo_box.item label="è©æ¬ºï¼ž L$" name="Fraud__L$"/>
<combo_box.item label="è©æ¬ºï¼žåœŸåœ°" name="Fraud__Land"/>
<combo_box.item label="è©æ¬ºï¼žãƒžãƒ«ãƒå•†æ³•ã¾ãŸã¯ãƒã‚§ãƒ¼ãƒ³ãƒ¡ãƒ¼ãƒ«" name="Fraud__Pyramid_scheme_or_chain_letter"/>
- <combo_box.item label="è©æ¬ºï¼ž US$" name="Fraud__US$"/>
+ <combo_box.item label="è©æ¬º &gt; リンデンドルã¾ãŸã¯ç±³ãƒ‰ãƒ«" name="Fraud__US$"/>
<combo_box.item label="嫌ãŒã‚‰ã›ï¼žåºƒå‘Šå§”託/視覚的ãªã‚¹ãƒ‘ム" name="Harassment__Advert_farms___visual_spam"/>
<combo_box.item label="嫌ãŒã‚‰ã›ï¼žå€‹äººã¾ãŸã¯ã‚°ãƒ«ãƒ¼ãƒ—ã®ä¸­å‚·" name="Harassment__Defaming_individuals_or_groups"/>
<combo_box.item label="嫌ãŒã‚‰ã›ï¼žç§»å‹•ã®å¦¨å®³" name="Harassment__Impeding_movement"/>
<combo_box.item label="嫌ãŒã‚‰ã›ï¼žæ€§çš„ãªå«ŒãŒã‚‰ã›" name="Harassment__Sexual_harassment"/>
- <combo_box.item label="嫌ãŒã‚‰ã›ï¼žåˆ©ç”¨è¦ç´„(ToS)ã«é•åã™ã‚‹è¡Œç‚ºã‚’行ã†ã‚ˆã†ä»–者を勧誘/扇動" name="Harassment__Solicting_inciting_others_to_violate_ToS"/>
+ <combo_box.item label="ãƒãƒ©ã‚¹ãƒ¡ãƒ³ãƒˆ &gt; 対象者を定ã‚ã¦å«ŒãŒã‚‰ã›ã‚’目的ã¨ã—ãŸè¡Œç‚º" name="Harassment__Solicting_inciting_others_to_violate_ToS"/>
<combo_box.item label="嫌ãŒã‚‰ã›ï¼žæš´è¨€" name="Harassment__Verbal_abuse"/>
<combo_box.item label="ã‚ã„ã›ã¤ï¼žè‘—ã—ãä¸å¿«ã§ã‚ã‚‹ã¨è¦‹ãªã•れるコンテンツã¾ãŸã¯è¡Œç‚º" name="Indecency__Broadly_offensive_content_or_conduct"/>
<combo_box.item label="ã‚ã„ã›ã¤ï¼žä¸é©åˆ‡ãªã‚¢ãƒã‚¿ãƒ¼å" name="Indecency__Inappropriate_avatar_name"/>
- <combo_box.item label="ã‚ã„ã›ã¤ï¼žPG地域ã§ã®ä¸é©åˆ‡ãªã‚³ãƒ³ãƒ†ãƒ³ãƒ„ã¾ãŸã¯è¡Œç‚º" name="Indecency__Mature_content_in_PG_region"/>
+ <combo_box.item label="ã‚ã„ã›ã¤ &gt; 地域(リージョン)ã®ãƒ¬ãƒ¼ãƒ†ã‚£ãƒ³ã‚°åŒºåˆ†ã«å¯¾ã—ã¦ä¸é©åˆ‡ãªã‚³ãƒ³ãƒ†ãƒ³ãƒ„ã¾ãŸã¯è¡Œç‚º" name="Indecency__Mature_content_in_PG_region"/>
<combo_box.item label="ã‚ã„ã›ã¤ &gt; 「Moderateã€æŒ‡å®šã®åœ°åŸŸã§ã®ä¸é©åˆ‡ãªã‚³ãƒ³ãƒ†ãƒ³ãƒ„ã¾ãŸã¯è¡Œç‚º" name="Indecency__Inappropriate_content_in_Mature_region"/>
<combo_box.item label="知的財産ã®ä¾µå®³ï¼žã‚³ãƒ³ãƒ†ãƒ³ãƒ„ã®æ’¤åŽ»" name="Intellectual_property_infringement_Content_Removal"/>
<combo_box.item label="知的財産ã®ä¾µå®³ï¼žã‚³ãƒ”ーBotåŠã³æ¨©é™ã®æ‚ªç”¨" name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit"/>
<combo_box.item label="ä¸å¯›å®¹" name="Intolerance"/>
<combo_box.item label="土地>サンドボックスã®ãƒªã‚½ãƒ¼ã‚¹ã®ä¹±ç”¨" name="Land__Abuse_of_sandbox_resources"/>
- <combo_box.item label="åœŸåœ°ï¼žä¸æ³•侵入>オブジェクト/テクスãƒãƒ£ãƒ¼" name="Land__Encroachment__Objects_textures"/>
+ <combo_box.item label="土地 &gt; 䏿³•侵入 &gt; オブジェクトã¾ãŸã¯ãƒ†ã‚¯ã‚¹ãƒãƒ£" name="Land__Encroachment__Objects_textures"/>
<combo_box.item label="åœŸåœ°ï¼žä¸æ³•侵入>パーティクル" name="Land__Encroachment__Particles"/>
<combo_box.item label="åœŸåœ°ï¼žä¸æ³•侵入>樹木/æ¤ç‰©" name="Land__Encroachment__Trees_plants"/>
- <combo_box.item label="è³­ã‘/ギャンブル" name="Wagering_gambling"/>
+ <combo_box.item label="è³­ã‘ã¾ãŸã¯ã‚®ãƒ£ãƒ³ãƒ–ル" name="Wagering_gambling"/>
<combo_box.item label="ãã®ä»–" name="Other"/>
</combo_box>
<text name="abuser_name_title">
diff --git a/indra/newview/skins/default/xui/ja/floater_scene_load_stats.xml b/indra/newview/skins/default/xui/ja/floater_scene_load_stats.xml
new file mode 100644
index 0000000000..f6edce026f
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/floater_scene_load_stats.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Scene Load Statistics" title="シーン ロード統計情報">
+ <button label="ä¸€æ™‚åœæ­¢" name="playpause"/>
+ <scroll_container name="statistics_scroll">
+ <container_view name="statistics_view">
+ <stat_view label="ベーシック" name="basic">
+ <stat_bar label="フレーム ピクセル差" name="frame difference"/>
+ <stat_bar label="UDP データをå—ã‘å–りã¾ã—ãŸ" name="bandwidth"/>
+ <stat_bar label="パケットロス" name="packet_loss"/>
+ </stat_view>
+ <stat_view label="アドãƒãƒ³ã‚¹" name="advanced">
+ <stat_view label="æç”»" name="render">
+ <stat_bar label="オブジェクトåˆè¨ˆ" name="objs"/>
+ <stat_bar label="æ–°è¦ã‚ªãƒ–ジェクト" name="newobjs"/>
+ <stat_bar label="オブジェクト キャッシュ ヒット率" name="object_cache_hits"/>
+ </stat_view>
+ <stat_view label="テクスãƒãƒ£" name="texture">
+ <stat_bar label="キャッシュ ヒット率" name="texture_cache_hits"/>
+ <stat_bar label="キャッシュ読ã¿è¾¼ã¿é…å»¶" name="texture_cache_read_latency"/>
+ <stat_bar label="カウント" name="numimagesstat"/>
+ <stat_bar label="Raw カウント" name="numrawimagesstat"/>
+ </stat_view>
+ <stat_view label="ãƒãƒƒãƒˆãƒ¯ãƒ¼ã‚¯" name="network">
+ <stat_bar label="パケットイン" name="packetsinstat"/>
+ <stat_bar label="パケットアウト" name="packetsoutstat"/>
+ <stat_bar label="オブジェクト" name="objectdatareceived"/>
+ <stat_bar label="テクスãƒãƒ£" name="texturedatareceived"/>
+ <stat_bar label="資産" name="assetudpdatareceived"/>
+ <stat_bar label="レイヤー" name="layersdatareceived"/>
+ <stat_bar label="実際ã®å—ä¿¡" name="messagedatain"/>
+ <stat_bar label="実際ã®é€ä¿¡" name="messagedataout"/>
+ <stat_bar label="VFS ä¿ç•™ä¸­ã®æ“作" name="vfspendingoperations"/>
+ </stat_view>
+ </stat_view>
+ <stat_view label="シミュレーター" name="sim">
+ <stat_bar label="オブジェクト" name="simobjects"/>
+ <stat_bar label="アクティブãªã‚ªãƒ–ジェクト" name="simactiveobjects"/>
+ <stat_bar label="アクティブãªã‚¹ã‚¯ãƒªãƒ—ト" name="simactivescripts"/>
+ <stat_bar label="パケットイン" name="siminpps"/>
+ <stat_bar label="パケットアウト" name="simoutpps"/>
+ <stat_bar label="ä¿ç•™ä¸­ã®ãƒ€ã‚¦ãƒ³ãƒ­ãƒ¼ãƒ‰" name="simpendingdownloads"/>
+ <stat_bar label="ä¿ç•™ä¸­ã®ã‚¢ãƒƒãƒ—ロード" name="simpendinguploads"/>
+ <stat_bar label="未é€ä¿¡ãƒã‚¤ãƒˆåˆè¨ˆ" name="simtotalunackedbytes"/>
+ <stat_view label="時間(ms)" name="simperf">
+ <stat_bar label="フレーム時間åˆè¨ˆ" name="simframemsec"/>
+ <stat_bar label="ç·æ™‚é–“æ•°" name="simnetmsec"/>
+ <stat_bar label="物ç†çš„作用時間" name="simsimphysicsmsec"/>
+ <stat_bar label="シミュレーション時間" name="simsimothermsec"/>
+ <stat_bar label="エージェント時間" name="simagentmsec"/>
+ <stat_bar label="イメージ時間" name="simimagesmsec"/>
+ <stat_bar label="スクリプト時間" name="simscriptmsec"/>
+ <stat_bar label="余暇" name="simsparemsec"/>
+ <stat_view label="時間ã®è©³ç´°ï¼ˆms)" name="timedetails">
+ <stat_bar label="物ç†åŠ¹æžœã®å˜ä½" name="simsimphysicsstepmsec"/>
+ <stat_bar label="物ç†å½¢çŠ¶ã‚’æ›´æ–°" name="simsimphysicsshapeupdatemsec"/>
+ <stat_bar label="ä»–ã®ç‰©ç†åŠ¹æžœ" name="simsimphysicsothermsec"/>
+ <stat_bar label="スリープ時間" name="simsleepmsec"/>
+ <stat_bar label="ãƒãƒ³ãƒ— I/O" name="simpumpiomsec"/>
+ </stat_view>
+ </stat_view>
+ </stat_view>
+ </container_view>
+ </scroll_container>
+</floater>
diff --git a/indra/newview/skins/default/xui/ja/floater_script_ed_prefs.xml b/indra/newview/skins/default/xui/ja/floater_script_ed_prefs.xml
new file mode 100644
index 0000000000..3a90e673ae
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/floater_script_ed_prefs.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_script_colors" title="スクリプトã®è‰²">
+ <text name="color_pickers_label">
+ 希望ã®è‰²ã‚’é¸æŠž:
+ </text>
+ <text name="text_label">
+ テキスト
+ </text>
+ <text name="cursor_label">
+ カーソル
+ </text>
+ <text name="background_label">
+ 背景
+ </text>
+ <text name="datatype_label">
+ データ型
+ </text>
+ <text name="event_label">
+ イベント
+ </text>
+ <text name="string_literal_label">
+ 文字列リテラル
+ </text>
+ <text name="constant_label">
+ 定数
+ </text>
+ <text name="flow_control_label">
+ フロー制御
+ </text>
+ <text name="function_label">
+ 関数
+ </text>
+ <text name="comment_label">
+ コメント
+ </text>
+ <script_editor name="Script Preview">
+ /* サンプル スクリプト */
+default
+{
+state_entry()
+ {
+// コメント
+string greeting = &quot;ã“ã‚“ã«ã¡ã¯&quot;;
+llSay(PUBLIC_CHANNEL, greeting);
+ }
+}
+ </script_editor>
+</floater>
diff --git a/indra/newview/skins/default/xui/ja/floater_snapshot.xml b/indra/newview/skins/default/xui/ja/floater_snapshot.xml
index f145a2e8b8..7d0fb27932 100755
--- a/indra/newview/skins/default/xui/ja/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/ja/floater_snapshot.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Snapshot" title="スナップショットã®ãƒ—レビュー">
+<floater name="Snapshot" title="スナップショット">
<floater.string name="unknown">
䏿˜Ž
</floater.string>
@@ -61,5 +61,11 @@
<check_box label="HUD" name="hud_check"/>
<check_box label="ç”»é¢å…¨ä½“ã‚’é™æ­¢" name="freeze_frame_check"/>
<check_box label="自動更新" name="auto_snapshot_check"/>
+ <text name="filter_list_label">
+ フィルター:
+ </text>
+ <combo_box name="filters_combobox" tool_tip="ç”»åƒãƒ•ィルター">
+ <combo_box.item label="フィルターãªã—" name="NoFilter"/>
+ </combo_box>
</panel>
</floater>
diff --git a/indra/newview/skins/default/xui/ja/floater_stats.xml b/indra/newview/skins/default/xui/ja/floater_stats.xml
index 1922e4841a..3bc343639b 100755
--- a/indra/newview/skins/default/xui/ja/floater_stats.xml
+++ b/indra/newview/skins/default/xui/ja/floater_stats.xml
@@ -4,17 +4,21 @@
<container_view name="statistics_view">
<stat_view label="ベーシック" name="basic">
<stat_bar label="FPS" name="fps"/>
- <stat_bar label="帯域幅" name="bandwidth"/>
+ <stat_bar label="UDP データをå—ã‘å–りã¾ã—ãŸ" name="bandwidth"/>
<stat_bar label="パケットロス" name="packet_loss"/>
<stat_bar label="Pingシム" name="ping"/>
</stat_view>
<stat_view label="アドãƒãƒ³ã‚¹" name="advanced">
<stat_view label="æç”»" name="render">
- <stat_bar label="フレームã”ã¨ã® KTris æç”»" name="ktrisframe"/>
- <stat_bar label="ç§’ã”ã¨ã® KTris æç”»" name="ktrissec"/>
- <stat_bar label="オブジェクトåˆè¨ˆ" name="objs"/>
+ <stat_bar label="KTris (フレームã”ã¨)" name="ktrisframe"/>
+ <stat_bar label="KTris (ç§’ã”ã¨)" name="ktrissec"/>
+ <stat_bar label="オブジェクトåˆè¨ˆ" name="totalobjs"/>
+ <stat_bar label="キャッシュã•れãŸã‚ªãƒ–ジェクト" name="cachedobjs"/>
<stat_bar label="æ–°è¦ã‚ªãƒ–ジェクト" name="newobjs"/>
<stat_bar label="オブジェクトキャッシュヒット率" name="object_cache_hits"/>
+ <stat_bar label="閉鎖クエリ実行" name="occlusion_queries"/>
+ <stat_bar label="閉鎖オブジェクト" name="occluded"/>
+ <stat_bar label="éžé–‰éŽ–ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆ" name="unoccluded"/>
</stat_view>
<stat_view label="テクスãƒãƒ£" name="texture">
<stat_bar label="キャッシュヒット率" name="texture_cache_hits"/>
@@ -26,15 +30,32 @@
<stat_bar label="Raw メモリ" name="rawmemstat"/>
<stat_bar label="çµ±åˆãƒ¡ãƒ¢ãƒª" name="glboundmemstat"/>
</stat_view>
+ <stat_view label="メモリ使用é‡" name="memory">
+ <stat_bar label="LLTrace" name="LLTrace"/>
+ <stat_bar label="UI" name="LLView"/>
+ <stat_bar label="フォント" name="LLFontFreetype"/>
+ <stat_bar label="インベントリ" name="LLInventoryObject"/>
+ <stat_bar label="ビューワ オブジェクト" name="LLViewerObject"/>
+ <stat_bar label="Octree グループ データ" name="LLViewerOctreeGroup"/>
+ <stat_bar label="Octree データ" name="LLViewerOctreeEntry"/>
+ <stat_bar label="ビューワ オブジェクト キャッシュ" name="LLVOCacheEntry"/>
+ <stat_bar label="æç”»å¯èƒ½ã‚ªãƒ–ジェクト" name="LLDrawable"/>
+ <stat_bar label="顔データ" name="LLFace"/>
+ <stat_bar label="æç”»æƒ…å ±" name="LLDrawInfo"/>
+ <stat_bar label="テクスãƒãƒ£ データ" name="LLTexture"/>
+ <stat_bar label="ç”»åƒãƒ‡ãƒ¼ã‚¿" name="LLImage"/>
+ <stat_bar label="GL ç”»åƒãƒ‡ãƒ¼ã‚¿" name="LLImageGL"/>
+ <stat_bar label="頂点ãƒãƒƒãƒ•ã‚¡" name="LLVertexBuffer"/>
+ </stat_view>
<stat_view label="ãƒãƒƒãƒˆãƒ¯ãƒ¼ã‚¯" name="network">
<stat_bar label="パケットイン" name="packetsinstat"/>
<stat_bar label="パケットアウト" name="packetsoutstat"/>
- <stat_bar label="オブジェクト" name="objectkbitstat"/>
- <stat_bar label="テクスãƒãƒ£" name="texturekbitstat"/>
- <stat_bar label="アセット" name="assetkbitstat"/>
- <stat_bar label="レイヤー" name="layerskbitstat"/>
- <stat_bar label="実際ã®å—ä¿¡" name="actualinkbitstat"/>
- <stat_bar label="実際ã®é€ä¿¡" name="actualoutkbitstat"/>
+ <stat_bar label="オブジェクト" name="objectdatareceived"/>
+ <stat_bar label="テクスãƒãƒ£" name="texturedatareceived"/>
+ <stat_bar label="資産" name="assetudpdatareceived"/>
+ <stat_bar label="レイヤー" name="layersdatareceived"/>
+ <stat_bar label="実際ã®å—ä¿¡" name="messagedatain"/>
+ <stat_bar label="実際ã®é€ä¿¡" name="messagedataout"/>
<stat_bar label="VFS ä¿ç•™ä¸­ã®æ“作" name="vfspendingoperations"/>
</stat_view>
</stat_view>
@@ -64,8 +85,8 @@
<stat_bar label="パケットアウト" name="simoutpps"/>
<stat_bar label="ä¿ç•™ä¸­ã®ãƒ€ã‚¦ãƒ³ãƒ­ãƒ¼ãƒ‰" name="simpendingdownloads"/>
<stat_bar label="ä¿ç•™ä¸­ã®ã‚¢ãƒƒãƒ—ロード" name="simpendinguploads"/>
- <stat_bar label="未é€ä¿¡ãƒã‚¤ãƒˆåˆè¨ˆ" name="simtotalunackedbytes"/>
- <stat_view label="時間(ms)" name="simperf">
+ <stat_bar label="åˆè¨ˆæœªæ‰¿èªãƒ‡ãƒ¼ã‚¿" name="simtotalunackedbytes"/>
+ <stat_view label="時間" name="simperf">
<stat_bar label="フレーム時間åˆè¨ˆ" name="simframemsec"/>
<stat_bar label="ç·æ™‚é–“æ•°" name="simnetmsec"/>
<stat_bar label="物ç†çš„作用時間" name="simsimphysicsmsec"/>
@@ -74,7 +95,7 @@
<stat_bar label="イメージ時間" name="simimagesmsec"/>
<stat_bar label="スクリプト時間" name="simscriptmsec"/>
<stat_bar label="余暇" name="simsparemsec"/>
- <stat_view label="時間ã®è©³ç´°ï¼ˆms)" name="timedetails">
+ <stat_view label="時間ã®è©³ç´°" name="timedetails">
<stat_bar label="物ç†åŠ¹æžœã®å˜ä½" name="simsimphysicsstepmsec"/>
<stat_bar label="物ç†å½¢çŠ¶ã‚’æ›´æ–°" name="simsimphysicsshapeupdatemsec"/>
<stat_bar label="ä»–ã®ç‰©ç†åŠ¹æžœ" name="simsimphysicsothermsec"/>
diff --git a/indra/newview/skins/default/xui/ja/floater_tools.xml b/indra/newview/skins/default/xui/ja/floater_tools.xml
index 5511433ae3..eeaa361649 100755
--- a/indra/newview/skins/default/xui/ja/floater_tools.xml
+++ b/indra/newview/skins/default/xui/ja/floater_tools.xml
@@ -72,7 +72,7 @@
<check_box label="リンク部分を編集" name="checkbox edit linked parts"/>
<button label="リンク" name="link_btn"/>
<button label="リンクを外ã™" name="unlink_btn"/>
- <check_box label="" name="checkbox uniform"/>
+ <check_box label="両å´ã‚’引ã伸ã°ã™" name="checkbox uniform"/>
<text label="両å´ã‚’å»¶ã°ã™" name="checkbox uniform label">
両å´ã‚’å»¶ã°ã™
</text>
diff --git a/indra/newview/skins/default/xui/ja/floater_twitter.xml b/indra/newview/skins/default/xui/ja/floater_twitter.xml
new file mode 100644
index 0000000000..7cd71df800
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/floater_twitter.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_twitter" title="TWITTER">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="作æˆ" name="panel_twitter_photo"/>
+ <panel label="アカウント" name="panel_twitter_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ エラー
+ </text>
+ <text name="connection_loading_text">
+ ロード中...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/ja/menu_avatar_icon.xml b/indra/newview/skins/default/xui/ja/menu_avatar_icon.xml
index b04f602134..80ce080e39 100755
--- a/indra/newview/skins/default/xui/ja/menu_avatar_icon.xml
+++ b/indra/newview/skins/default/xui/ja/menu_avatar_icon.xml
@@ -2,6 +2,7 @@
<menu name="Avatar Icon Menu">
<menu_item_call label="プロフィールã®è¡¨ç¤º" name="Show Profile"/>
<menu_item_call label="IMã‚’é€ä¿¡..." name="Send IM"/>
+ <menu_item_call label="テレãƒãƒ¼ãƒˆã‚’リクエスト" name="Request Teleport"/>
<menu_item_call label="フレンドを追加..." name="Add Friend"/>
<menu_item_call label="フレンドを削除..." name="Remove Friend"/>
</menu>
diff --git a/indra/newview/skins/default/xui/ja/menu_conversation.xml b/indra/newview/skins/default/xui/ja/menu_conversation.xml
index 66940471da..0de6a5f22f 100644
--- a/indra/newview/skins/default/xui/ja/menu_conversation.xml
+++ b/indra/newview/skins/default/xui/ja/menu_conversation.xml
@@ -29,4 +29,5 @@
<menu_item_call label="全員ã®éŸ³å£°ã‚’ミュートã™ã‚‹" name="ModerateVoiceMute"/>
<menu_item_call label="全員ã®ãƒŸãƒ¥ãƒ¼ãƒˆã‚’解除ã™ã‚‹" name="ModerateVoiceUnmute"/>
</context_menu>
+ <menu_item_call label="メンãƒãƒ¼ã‚’ç«‹å…¥ç¦æ­¢" name="BanMember"/>
</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/ja/menu_inventory.xml b/indra/newview/skins/default/xui/ja/menu_inventory.xml
index 106b09453a..8d6c983aa7 100755
--- a/indra/newview/skins/default/xui/ja/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/ja/menu_inventory.xml
@@ -70,6 +70,7 @@
<menu_item_call label="å†ç”Ÿã™ã‚‹" name="Sound Play"/>
<menu_item_call label="SLurl をコピー" name="url_copy"/>
<menu_item_call label="ãƒ©ãƒ³ãƒ‰ãƒžãƒ¼ã‚¯ã®æƒ…å ±" name="About Landmark"/>
+ <menu_item_call label="地図ã«è¡¨ç¤º" name="show_on_map"/>
<menu_item_call label="インワールドã§å†ç”Ÿã™ã‚‹" name="Animation Play"/>
<menu_item_call label="ローカルã§å†ç”Ÿã™ã‚‹" name="Animation Audition"/>
<menu_item_call label="インスタントメッセージをé€ä¿¡ã™ã‚‹" name="Send Instant Message"/>
diff --git a/indra/newview/skins/default/xui/ja/menu_login.xml b/indra/newview/skins/default/xui/ja/menu_login.xml
index 3918732fa8..cd8bd52f91 100755
--- a/indra/newview/skins/default/xui/ja/menu_login.xml
+++ b/indra/newview/skins/default/xui/ja/menu_login.xml
@@ -5,7 +5,15 @@
<menu_item_call label="[APP_NAME] を終了" name="Quit"/>
</menu>
<menu label="ヘルプ" name="Help">
- <menu_item_call label="[SECOND_LIFE] ヘルプ" name="Second Life Help"/>
+ <menu_item_call label="ãƒã‚¦ãƒ„ー..." name="How To"/>
+ <menu_item_call label="クイックスタート" name="Quickstart"/>
+ <menu_item_call label="ナレッジベース" name="Knowledge Base"/>
+ <menu_item_call label="Wiki" name="Wiki"/>
+ <menu_item_call label="コミュニティ フォーラム" name="Community Forums"/>
+ <menu_item_call label="日本語サãƒãƒ¼ãƒˆãƒšãƒ¼ã‚¸" name="Support portal"/>
+ <menu_item_call label="[SECOND_LIFE] ニュース" name="Second Life News"/>
+ <menu_item_call label="[SECOND_LIFE] ブログ" name="Second Life Blogs"/>
+ <menu_item_call label="ãƒã‚°ã‚’報告ã™ã‚‹" name="Report Bug"/>
<menu_item_call label="[APP_NAME] ã«ã¤ã„ã¦" name="About Second Life"/>
</menu>
<menu_item_check label="デãƒãƒƒã‚°ãƒ¡ãƒ‹ãƒ¥ãƒ¼ã‚’表示ã™ã‚‹" name="Show Debug Menu"/>
diff --git a/indra/newview/skins/default/xui/ja/menu_object.xml b/indra/newview/skins/default/xui/ja/menu_object.xml
index 39c32bc41e..ae02edefe2 100755
--- a/indra/newview/skins/default/xui/ja/menu_object.xml
+++ b/indra/newview/skins/default/xui/ja/menu_object.xml
@@ -21,6 +21,7 @@
<context_menu label="管ç†" name="Remove">
<menu_item_call label="嫌ãŒã‚‰ã›ã®å ±å‘Š" name="Report Abuse..."/>
<menu_item_call label="ブロック" name="Object Mute"/>
+ <menu_item_call label="ブロック解除" name="Object Unmute"/>
<menu_item_call label="è¿”å´" name="Return..."/>
</context_menu>
<menu_item_call label="å–ã‚‹" name="Pie Object Take"/>
diff --git a/indra/newview/skins/default/xui/ja/menu_teleport_history_item.xml b/indra/newview/skins/default/xui/ja/menu_teleport_history_item.xml
index 66bc32214f..61642048b8 100755
--- a/indra/newview/skins/default/xui/ja/menu_teleport_history_item.xml
+++ b/indra/newview/skins/default/xui/ja/menu_teleport_history_item.xml
@@ -2,5 +2,5 @@
<context_menu name="Teleport History Item Context Menu">
<menu_item_call label="テレãƒãƒ¼ãƒˆ" name="Teleport"/>
<menu_item_call label="ã‚‚ã£ã¨è©³ã—ã" name="More Information"/>
- <menu_item_call label="クリップボードã«ã‚³ãƒ”ー" name="CopyToClipboard"/>
+ <menu_item_call label="SLurl をコピー" name="CopyToClipboard"/>
</context_menu>
diff --git a/indra/newview/skins/default/xui/ja/menu_viewer.xml b/indra/newview/skins/default/xui/ja/menu_viewer.xml
index b1ec62115c..4e6c6808c6 100755
--- a/indra/newview/skins/default/xui/ja/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/ja/menu_viewer.xml
@@ -36,6 +36,9 @@
<menu_item_check label="è¿‘ãã®ãƒãƒ£ãƒƒãƒˆ..." name="Nearby Chat"/>
<menu_item_check label="話ã™" name="Speak"/>
<menu_item_check label="会話ログ..." name="Conversation Log..."/>
+ <menu_item_call label="Facebook..." name="Facebook"/>
+ <menu_item_call label="Twitter..." name="Twitter"/>
+ <menu_item_call label="Flickr..." name="Flickr"/>
<menu label="ボイスモーフィング" name="VoiceMorphing">
<menu_item_check label="ボイスモーフィングãªã—" name="NoVoiceMorphing"/>
<menu_item_check label="プレビュー..." name="Preview"/>
@@ -72,11 +75,11 @@
<menu_item_check label="アドãƒãƒ³ã‚¹ãƒ¡ãƒ‹ãƒ¥ãƒ¼" name="Show Advanced Menu"/>
</menu>
<menu label="太陽" name="Sun">
- <menu_item_call label="æ—¥ã®å‡º" name="Sunrise"/>
- <menu_item_call label="æ­£åˆ" name="Noon"/>
- <menu_item_call label="日没" name="Sunset"/>
- <menu_item_call label="真夜中" name="Midnight"/>
- <menu_item_call label="リージョンã®è¨­å®šã‚’使用" name="Use Region Settings"/>
+ <menu_item_check label="æ—¥ã®å‡º" name="Sunrise"/>
+ <menu_item_check label="æ­£åˆ" name="Noon"/>
+ <menu_item_check label="日没" name="Sunset"/>
+ <menu_item_check label="真夜中" name="Midnight"/>
+ <menu_item_check label="リージョンã®è¨­å®šã‚’使用" name="Use Region Settings"/>
</menu>
<menu label="自然環境エディター" name="Environment Editor">
<menu_item_call label="自然環境ã®è¨­å®š..." name="Environment Settings"/>
@@ -150,7 +153,8 @@
<menu_item_check label="グリッドãƒã‚¤ãƒ³ãƒˆã«ã‚¹ãƒŠãƒƒãƒ—ã™ã‚‹" name="Snap to Grid"/>
<menu_item_call label="オブジェクト㮠XY 軸をグリッドã«ã‚¹ãƒŠãƒƒãƒ—ã™ã‚‹" name="Snap Object XY to Grid"/>
<menu_item_call label="é¸æŠžã‚’ã‚°ãƒªãƒƒãƒ‰ã«ä½¿ç”¨ã™ã‚‹" name="Use Selection for Grid"/>
- <menu_item_call label="グリッドオプション" name="Grid Options"/>
+ <menu_item_call label="グリッドオプション..." name="Grid Options"/>
+ <menu_item_call label="デフォルト権é™ã®è¨­å®š..." name="Set default permissions"/>
</menu>
<menu label="アップロード" name="Upload">
<menu_item_call label="ç”»åƒï¼ˆL$[COST])..." name="Upload Image"/>
@@ -158,15 +162,12 @@
<menu_item_call label="アニメーション(L$[COST])..." name="Upload Animation"/>
<menu_item_call label="モデル" name="Upload Model"/>
<menu_item_call label="一括 (ファイルã«ã¤ãL$[COST])..." name="Bulk Upload"/>
- <menu_item_call label="デフォルトã®ã‚¢ãƒƒãƒ—ロード権é™ã‚’設定" name="perm prefs"/>
</menu>
<menu_item_call label="å…ƒã«æˆ»ã™" name="Undo"/>
<menu_item_call label="やり直ã—" name="Redo"/>
</menu>
<menu label="ヘルプ" name="Help">
<menu_item_call label="ãƒã‚¦ãƒ„ー..." name="How To"/>
- <menu_item_call label="[SECOND_LIFE] ヘルプ" name="Second Life Help"/>
- <menu_item_call label="ユーザーガイド" name="User’s guide"/>
<menu_item_call label="ナレッジベース" name="Knowledge Base"/>
<menu_item_call label="Wiki" name="Wiki"/>
<menu_item_call label="コミュニティフォーラム" name="Community Forums"/>
@@ -188,6 +189,7 @@
<menu label="パフォーマンスツール" name="Performance Tools">
<menu_item_call label="ラグ計測器" name="Lag Meter"/>
<menu_item_check label="統計ãƒãƒ¼" name="Statistics Bar"/>
+ <menu_item_call label="シーン ロード統計情報" name="Scene Load Statistics"/>
<menu_item_check label="ã‚¢ãƒã‚¿ãƒ¼ã®æç”»ã‚¦ã‚§ã‚¤ãƒˆã‚’表示" name="Avatar Rendering Cost"/>
</menu>
<menu label="ãƒã‚¤ãƒ©ã‚¤ãƒˆã¨ç›®ã«è¦‹ãˆã‚‹ã‚‚ã®" name="Highlighting and Visibility">
@@ -250,6 +252,7 @@
<menu_item_check label="ファーストタイマー" name="Fast Timers"/>
<menu_item_check label="メモリ" name="Memory"/>
<menu_item_check label="風景ã®çµ±è¨ˆ" name="Scene Statistics"/>
+ <menu_item_check label="シーン ローディング モニター" name="Scene Loading Monitor"/>
<menu_item_call label="テクスãƒãƒ£å–得デãƒãƒƒã‚°ã‚³ãƒ³ã‚½ãƒ¼ãƒ«" name="Texture Fetch Debug Console"/>
<menu_item_call label="リージョン情報をデãƒãƒƒã‚°ã‚³ãƒ³ã‚½ãƒ¼ãƒ«ã¸" name="Region Info to Debug Console"/>
<menu_item_call label="グループ情報をデãƒãƒƒã‚°ã‚³ãƒ³ã‚½ãƒ¼ãƒ«ã¸" name="Group Info to Debug Console"/>
@@ -286,6 +289,7 @@
<menu_item_check label="定期的ã«é…ã„フレームを挿入ã™ã‚‹" name="Periodic Slow Frame"/>
<menu_item_check label="フレームテスト" name="Frame Test"/>
<menu_item_call label="フレームプロフィール" name="Frame Profile"/>
+ <menu_item_call label="ベンãƒãƒžãƒ¼ã‚¯" name="Benchmark"/>
</menu>
<menu label="メタデータã®ãƒ¬ãƒ³ãƒ€ãƒ¼" name="Render Metadata">
<menu_item_check label="ãƒã‚¦ãƒ³ãƒ‡ã‚£ãƒ³ã‚°ãƒœãƒƒã‚¯ã‚¹" name="Bounding Boxes"/>
@@ -303,7 +307,9 @@
<menu_item_check label="LOD 情報" name="LOD Info"/>
<menu_item_check label="制作キュー" name="Build Queue"/>
<menu_item_check label="å…‰" name="Lights"/>
+ <menu_item_check label="パーティクル" name="Particles"/>
<menu_item_check label="骨組ã¿ã®è¡çªåˆ¤å®š" name="Collision Skeleton"/>
+ <menu_item_check label="ジョイント" name="Joints"/>
<menu_item_check label="レイキャスト" name="Raycast"/>
<menu_item_check label="風ã®ãƒ™ã‚¯ãƒˆãƒ«" name="Wind Vectors"/>
<menu_item_check label="æç”»ã®è©³ç´°åº¦" name="rendercomplexity"/>
@@ -336,6 +342,7 @@
<menu_item_check label="装ç€ã•れãŸå…‰æºã‚’æç”»ã™ã‚‹" name="Render Attached Lights"/>
<menu_item_check label="å–り付ã‘られãŸãƒ‘ーティクルをæç”»ã™ã‚‹" name="Render Attached Particles"/>
<menu_item_check label="マウスオーãƒãƒ¼ã§å¼·èª¿è¡¨ç¤ºã™ã‚‹" name="Hover Glow Objects"/>
+ <menu_item_call label="キャッシュをã™ãã«ã‚¯ãƒªã‚¢" name="Cache Clear"/>
</menu>
<menu label="ãƒãƒƒãƒˆãƒ¯ãƒ¼ã‚¯" name="Network">
<menu_item_check label="ã‚¨ãƒ¼ã‚¸ã‚§ãƒ³ãƒˆã‚’ä¸€æ™‚åœæ­¢ã™ã‚‹" name="AgentPause"/>
@@ -368,7 +375,6 @@
<menu_item_call label="フォーカスホールダーをダンプ" name="Dump Focus Holder"/>
<menu_item_call label="é¸æŠžã—ãŸã‚ªãƒ–ジェクト情報をプリント" name="Print Selected Object Info"/>
<menu_item_call label="エージェント情報をプリント" name="Print Agent Info"/>
- <menu_item_check label="地域デãƒãƒƒã‚°ã‚³ãƒ³ã‚½ãƒ¼ãƒ«" name="Region Debug Console"/>
<menu_item_check label="SelectMgr ã®ãƒ‡ãƒãƒƒã‚°" name="Debug SelectMgr"/>
<menu_item_check label="ダブルクリック" name="Debug Clicks"/>
<menu_item_check label="デãƒãƒƒã‚°è¡¨ç¤º" name="Debug Views"/>
diff --git a/indra/newview/skins/default/xui/ja/notifications.xml b/indra/newview/skins/default/xui/ja/notifications.xml
index f1c916bf53..1d52b42039 100755
--- a/indra/newview/skins/default/xui/ja/notifications.xml
+++ b/indra/newview/skins/default/xui/ja/notifications.xml
@@ -113,13 +113,13 @@
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="OutboxImportFailed">
- 転é€ã«å¤±æ•—
+ &apos;[ERROR_CODE]&apos; エラーã§è»¢é€ã§ãã¾ã›ã‚“ã§ã—ãŸ
システムã¾ãŸã¯ãƒãƒƒãƒˆãƒ¯ãƒ¼ã‚¯ã®ã‚¨ãƒ©ãƒ¼ã®ãŸã‚ã€ãƒ•ォルダã¯ãƒžãƒ¼ã‚±ãƒƒãƒˆãƒ—レイスã«é€ä¿¡ã•れã¾ã›ã‚“ã§ã—ãŸã€‚後ã§ã‚‚ã†ä¸€åº¦ãŠè©¦ã—ãã ã•ã„。
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="OutboxInitFailed">
- マーケットプレイスã®åˆæœŸåŒ–ã«å¤±æ•—
+ &apos;[ERROR_CODE]&apos; エラーã§ãƒžãƒ¼ã‚±ãƒƒãƒˆãƒ—ãƒ¬ã‚¤ã‚¹ã‚’åˆæœŸåŒ–ã§ãã¾ã›ã‚“ã§ã—ãŸ
システムã¾ãŸã¯ãƒãƒƒãƒˆãƒ¯ãƒ¼ã‚¯ã®ã‚¨ãƒ©ãƒ¼ã®ãŸã‚ã€ãƒžãƒ¼ã‚±ãƒƒãƒˆãƒ—レイスã®åˆæœŸåŒ–ã«å¤±æ•—ã—ã¾ã—ãŸã€‚後ã§ã‚‚ã†ä¸€åº¦ãŠè©¦ã—ãã ã•ã„。
<usetemplate name="okbutton" yestext="OK"/>
@@ -221,6 +221,22 @@
ã“ã®èƒ½åŠ›ã‚’ [ROLE_NAME] ã«å‰²ã‚Šå½“ã¦ã¾ã™ã‹ï¼Ÿ
<usetemplate name="okcancelbuttons" notext="ã„ã„ãˆ" yestext="ã¯ã„"/>
</notification>
+ <notification name="AssignBanAbilityWarning">
+ 役割 &apos;[ROLE_NAME]&apos; ã«èƒ½åŠ› &apos;[ACTION_NAME]&apos; を追加ã—よã†ã¨ã—ã¦ã„ã¾ã™ã€‚
+
+*警告*
+ã“ã®èƒ½åŠ›ã‚’æŒã¤å½¹å‰²ã®ãƒ¡ãƒ³ãƒãƒ¼ã«ã‚‚能力 &apos;[ACTION_NAME_2]&apos; 㨠&apos;[ACTION_NAME_3]&apos; ãŒè¨±å¯ã•れã¾ã™
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
+ <notification name="RemoveBanAbilityWarning">
+ 役割 &apos;[ROLE_NAME]&apos; ã‹ã‚‰èƒ½åŠ› &apos;[ACTION_NAME]&apos; を削除ã—よã†ã¨ã—ã¦ã„ã¾ã™ã€‚
+
+*警告*
+ã“ã®èƒ½åŠ›ã‚’å‰Šé™¤ã—ã¦ã‚‚能力 &apos;[ACTION_NAME_2]&apos; 㨠&apos;[ACTION_NAME_3]&apos; ã¯å‰Šé™¤ã•れã¾ã›ã‚“。
+
+ã“れらã®èƒ½åŠ›ã‚’ã“ã®å½¹å‰²ã«è¨±å¯ã—ãªã„å ´åˆã¯ã€ã™ãã«å‰Šé™¤ã—ã¦ãã ã•ã„!
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
<notification name="EjectGroupMemberWarning">
[AVATAR_NAME] をグループã‹ã‚‰è¿½æ”¾ã—よã†ã¨ã—ã¦ã„ã¾ã™ã€‚
<usetemplate ignoretext="グループã‹ã‚‰ã®å‚加者ã®è¿½æ”¾ã‚’確èªã—ã¾ã™" name="okcancelignore" notext="å–り消ã—" yestext="追放"/>
@@ -1614,6 +1630,14 @@ http://secondlife.com/download ã‹ã‚‰æœ€æ–°ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’ダウンロードã
グループを抜ã‘ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“ã€‚ã‚°ãƒ«ãƒ¼ãƒ—ã®æœ€å¾Œã®ã‚ªãƒ¼ãƒŠãƒ¼ã§ã‚ã‚‹ãŸã‚ã€ã‚°ãƒ«ãƒ¼ãƒ—を抜ã‘ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“。最åˆã«ã€åˆ¥ã®ãƒ¡ãƒ³ãƒãƒ¼ã‚’オーナーã®å½¹å‰²ã«å‰²ã‚Šå½“ã¦ã¦ãã ã•ã„。
<usetemplate name="okbutton" yestext="OK"/>
</notification>
+ <notification name="GroupDepartError">
+ グループを抜ã‘ã‚‹ã“ã¨ãŒã§ãã¾ã›ã‚“: [reason]。
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
+ <notification name="GroupDepart">
+ グループ [group_name] を抜ã‘ã¾ã—ãŸã€‚
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
<notification name="ConfirmKick">
本当ã«ä½äººå…¨å“¡ã‚’グリッドã‹ã‚‰è¿½ã„出ã—ã¾ã™ã‹ï¼Ÿ
<usetemplate name="okcancelbuttons" notext="キャンセル" yestext="ä½äººå…¨å“¡ã‚’追ã„出ã™"/>
@@ -1768,6 +1792,10 @@ http://wiki.secondlife.com/wiki/Setting_your_display_name ã‚’å‚ç…§ã—ã¦ãã ã
ã“ã®ã¾ã¾ &lt;nolink&gt;[LOCATION]&lt;/nolink&gt; ã«ãƒ†ãƒ¬ãƒãƒ¼ãƒˆã—ã¾ã™ã‹ï¼Ÿ
<usetemplate ignoretext="ランドマークã«ãƒ†ãƒ¬ãƒãƒ¼ãƒˆã—ãŸã„ã‹ã©ã†ã‹ã®ç¢ºèª" name="okcancelignore" notext="キャンセル" yestext="テレãƒãƒ¼ãƒˆ"/>
</notification>
+ <notification name="TeleportViaSLAPP">
+ ã“ã®ã¾ã¾ &lt;nolink&gt;[LOCATION]&lt;/nolink&gt; ã«ãƒ†ãƒ¬ãƒãƒ¼ãƒˆã—ã¾ã™ã‹ï¼Ÿ
+ <usetemplate ignoretext="SLAPP ã§ãƒ†ãƒ¬ãƒãƒ¼ãƒˆã™ã‚‹ã“ã¨ã‚’確èª" name="okcancelignore" notext="å–り消ã—" yestext="テレãƒãƒ¼ãƒˆ"/>
+ </notification>
<notification name="TeleportToPick">
[PICK] ã«ãƒ†ãƒ¬ãƒãƒ¼ãƒˆã—ã¾ã™ã‹ï¼Ÿ
<usetemplate ignoretext="ピックã®å ´æ‰€ã«ãƒ†ãƒ¬ãƒãƒ¼ãƒˆã—ãŸã„ã‹ã©ã†ã‹ã®ç¢ºèª" name="okcancelignore" notext="キャンセル" yestext="テレãƒãƒ¼ãƒˆ"/>
@@ -1979,6 +2007,9 @@ http://wiki.secondlife.com/wiki/Setting_your_display_name ã‚’å‚ç…§ã—ã¦ãã ã
æ–°ã—ã„ä¸å‹•産マãƒãƒ¼ã‚¸ãƒ£ãƒ¼ã®è¿½åŠ ã«é–¢ã™ã‚‹å•題:
ã„ãšã‚Œã‹ã®ä¸å‹•産ã®ãƒžãƒãƒ¼ã‚¸ãƒ£ãƒ¼ãƒªã‚¹ãƒˆãŒæº€æ¯ã«ãªã£ã¦ã„ã¾ã™ã€‚
</notification>
+ <notification name="ProblemAddingEstateBanManager">
+ ä¸å‹•産所有者ã¾ãŸã¯ç®¡ç†è€…ã‚’ç¦æ­¢ãƒªã‚¹ãƒˆã«è¿½åŠ ã§ãã¾ã›ã‚“。
+ </notification>
<notification name="ProblemAddingEstateGeneric">
ä¸å‹•産リストã®è¿½åŠ ã«é–¢ã™ã‚‹å•題:
ã„ãšã‚Œã‹ã®ä¸å‹•産ã®ãƒªã‚¹ãƒˆãŒæº€æ¯ã«ãªã£ã¦ã„ã¾ã™ã€‚
@@ -2500,6 +2531,12 @@ Web ページã«ãƒªãƒ³ã‚¯ã™ã‚‹ã¨ã€ä»–人ãŒã“ã®å ´æ‰€ã«ç°¡å˜ã«ã‚¢ã‚¯ã‚»ã
<notification name="SystemMessage">
[MESSAGE]
</notification>
+ <notification name="FlickrConnect">
+ [MESSAGE]
+ </notification>
+ <notification name="TwitterConnect">
+ [MESSAGE]
+ </notification>
<notification name="PaymentReceived">
[MESSAGE]
</notification>
@@ -3072,9 +3109,9 @@ M キーを押ã—ã¦å¤‰æ›´ã—ã¾ã™ã€‚
&lt;nolink&gt;[ITEMS]&lt;/nolink&gt;
-次ã®ä½äººã¨å…±æœ‰ã—ã¾ã™ã‹ï¼Ÿ
+次ã®ä½äººã¨å…±æœ‰ï¼š
-[RESIDENTS]
+&lt;nolink&gt;[RESIDENTS]&lt;/nolink&gt;
<usetemplate name="okcancelbuttons" notext="å–り消ã—" yestext="OK"/>
</notification>
<notification name="ShareFolderConfirmation">
@@ -3086,7 +3123,7 @@ M キーを押ã—ã¦å¤‰æ›´ã—ã¾ã™ã€‚
次ã®ä½äººã¨å…±æœ‰ï¼š
-[RESIDENTS]
+&lt;nolink&gt;[RESIDENTS]&lt;/nolink&gt;
<usetemplate name="okcancelbuttons" notext="å–り消ã—" yestext="Ok"/>
</notification>
<notification name="ItemsShared">
@@ -3541,10 +3578,6 @@ M キーを押ã—ã¦å¤‰æ›´ã—ã¾ã™ã€‚
<notification name="EjectComingSoon">
ã“ã“ã¸ã®å…¥å ´ãŒè¨±å¯ã•れã¦ã„ãªã„ãŸã‚ã€[EJECT_TIME] 秒後ã«è¿½æ”¾ã•れã¾ã™ã€‚
</notification>
- <notification name="NoEnterServerFull">
- サーãƒãƒ¼ãŒåŸ‹ã¾ã£ã¦ã„ã‚‹ãŸã‚ã€
-ã“ã®ãƒªãƒ¼ã‚¸ãƒ§ãƒ³ã«å…¥å ´ã™ã‚‹ã“ã¨ã¯ã§ãã¾ã›ã‚“。
- </notification>
<notification name="SaveBackToInvDisabled">
「「æŒã¡ç‰©ã€ã«ä¿å­˜ã€ãŒç„¡åйã«ãªã£ã¦ã„ã¾ã™ã€‚
</notification>
@@ -3729,6 +3762,9 @@ M キーを押ã—ã¦å¤‰æ›´ã—ã¾ã™ã€‚
<notification name="LinkFailedTooMuchPhysics">
オブジェクトãŒä½¿ç”¨ã—ã¦ã„る物ç†ãƒªã‚½ãƒ¼ã‚¹ãŒå¤šã™ãŽãŸãŸã‚ã€ãƒ€ã‚¤ãƒŠãƒŸãƒƒã‚¯ã‚¹ãŒç„¡åйã«ã•れã¾ã—ãŸã€‚
</notification>
+ <notification name="EstateManagerFailedllTeleportHome">
+ [SLURL] ã®ã‚ªãƒ–ジェクト &apos;[OBJECT_NAME]&apos; ã§ä¸å‹•産マãƒãƒ¼ã‚¸ãƒ£ãƒ¼ã®ãƒ›ãƒ¼ãƒ ã‚’テレãƒãƒ¼ãƒˆã§ãã¾ã›ã‚“。
+ </notification>
<notification name="TeleportedHomeByObjectOnParcel">
区画 &apos;[PARCEL_NAME]&apos; ã®ã‚ªãƒ–ジェクト &apos;[OBJECT_NAME]&apos; ã«ã‚ˆã£ã¦ã€ã‚ãªãŸã¯ãƒ›ãƒ¼ãƒ ã«ãƒ†ãƒ¬ãƒãƒ¼ãƒˆã•れã¾ã—ãŸã€‚
</notification>
@@ -3919,13 +3955,18 @@ M キーを押ã—ã¦å¤‰æ›´ã—ã¾ã™ã€‚
é¸æŠžç¯„å›²ã®ãƒªãƒ¼ã‚¹åŒºç”»ã®æ•°ãŒå°‘ãªã„ãŸã‚ã€å‚加ã§ãã¾ã›ã‚“。
</notification>
<notification name="CantDivideLandMultipleParcelsSelected">
- 土地を分割ã§ãã¾ã›ã‚“。\n区画ãŒè¤‡æ•°é¸æŠžã•れã¦ã„ã¾ã™ã€‚\nã‚‚ã£ã¨å°ã•ã„åœŸåœ°ã‚’é¸æŠžã—ã¦ã¿ã¦ãã ã•ã„。
+ 土地を分割ã§ãã¾ã›ã‚“。
+複数ã®åŒºç”»ãŒé¸æŠžã•れã¾ã—ãŸã€‚
+å°ã•ã„åŒºç”»ã‚’é¸æŠžã—ã¦ãã ã•ã„。
</notification>
<notification name="CantDivideLandCantFindParcel">
- 土地を分解ã§ãã¾ã›ã‚“。\n区画ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。\n「Helpã€&gt;「Reprt Bug...ã€ã§ãƒ¬ãƒãƒ¼ãƒˆã‚’行ã£ã¦ãã ã•ã„。
+ 土地を分割ã§ãã¾ã›ã‚“。
+区画ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。
+「ヘルプ〠-&gt; 「ãƒã‚°ã®å ±å‘Šã€ã§å ±å‘Šã—ã¦ãã ã•ã„。
</notification>
<notification name="CantDivideLandWholeParcelSelected">
- 土地を分割ã§ãã¾ã›ã‚“ã€‚åŒºç”»å…¨ä½“ã‚’é¸æŠžã—ã¾ã™ã€‚\nå°ã•ã„åœŸåœ°ã‚’é¸æŠžã—ã¦ã¿ã¦ãã ã•ã„。
+ 土地を分割ã§ãã¾ã›ã‚“。区画全体ãŒé¸æŠžã•れã¦ã„ã¾ã™ã€‚
+å°ã•ã„åŒºç”»ã‚’é¸æŠžã—ã¦ãã ã•ã„。
</notification>
<notification name="LandHasBeenDivided">
土地ãŒåˆ†å‰²ã•れã¦ã„ã¾ã™ã€‚
@@ -4065,4 +4106,12 @@ M キーを押ã—ã¦å¤‰æ›´ã—ã¾ã™ã€‚
ファイルを移動ã§ãã¾ã›ã‚“。以å‰ã®ãƒ‘スãŒãƒªã‚¹ãƒˆã‚¢ã•れã¾ã—ãŸã€‚
<usetemplate ignoretext="ファイルを移動ã§ãã¾ã›ã‚“。以å‰ã®ãƒ‘スãŒãƒªã‚¹ãƒˆã‚¢ã•れã¾ã—ãŸã€‚" name="okignore" yestext="OK"/>
</notification>
+ <notification name="DefaultObjectPermissions">
+ 次ã®ç†ç”±ã«ã‚ˆã‚Šã€ãƒ‡ãƒ•ォルト権é™ã‚’ä¿å­˜ã™ã‚‹ã¨ãã«å•題ãŒã‚りã¾ã—ãŸ: [REASON]。後ã§ãƒ‡ãƒ•ォルト権é™ã‚’設定ã—ã¦ãã ã•ã„。
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
+ <notification name="ChatHistoryIsBusyAlert">
+ ãƒãƒ£ãƒƒãƒˆå±¥æ­´ãƒ•ァイルãŒå‰ã®æ“作ã§ãƒ“ジーã§ã™ã€‚2ã€3 分経ã£ã¦ã‹ã‚‰ã‚‚ã†ä¸€åº¦è©¦ã™ã‹ã€åˆ¥ã®äººã¨ã®ãƒãƒ£ãƒƒãƒˆã‚’é¸æŠžã—ã¦ãã ã•ã„。
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
</notifications>
diff --git a/indra/newview/skins/default/xui/ja/panel_facebook_account.xml b/indra/newview/skins/default/xui/ja/panel_facebook_account.xml
new file mode 100644
index 0000000000..5269e5a2da
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/panel_facebook_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_account">
+ <string name="facebook_connected" value="次ã®ãƒ¦ãƒ¼ã‚¶ãƒ¼ã¨ã—㦠Facebook ã«æŽ¥ç¶š:"/>
+ <string name="facebook_disconnected" value="Facebook ã«æŽ¥ç¶šã—ã¦ã„ã¾ã›ã‚“"/>
+ <text name="account_caption_label">
+ Facebook ã«æŽ¥ç¶šã—ã¦ã„ã¾ã›ã‚“。
+ </text>
+ <panel name="panel_buttons">
+ <button label="接続..." name="connect_btn"/>
+ <button label="切断" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Facebook/ta-p/2149711 Facebook ã¸ã®æŠ•稿ã«ã¤ã„ã¦]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_facebook_friends.xml b/indra/newview/skins/default/xui/ja/panel_facebook_friends.xml
new file mode 100644
index 0000000000..18ae4f9295
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/panel_facebook_friends.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_friends">
+ <string name="facebook_friends_empty" value="Second Life ã®ä½äººã«ã‚‚ãªã£ã¦ã„ã‚‹ Facebook ã®å‹ã ã¡ãŒã„ã¾ã›ã‚“。今ã™ã Facebook ã®å‹ã ã¡ã« Second Life ã«å‚加ã—ã¦ã‚‚らã„ã¾ã—ょã†ï¼"/>
+ <string name="facebook_friends_no_connected" value="ç¾åœ¨ Facebook ã«æŽ¥ç¶šã•れã¦ã„ã¾ã›ã‚“。「アカウントã€ã‚¿ãƒ–ã«é€²ã‚“ã§ã€ã“ã®æ©Ÿèƒ½ã‚’有効ã«ã—ã¦ãã ã•ã„。"/>
+ <accordion name="friends_accordion">
+ <accordion_tab name="tab_second_life_friends" title="SL ã®å‹ã ã¡"/>
+ <accordion_tab name="tab_suggested_friends" title="ã“れらã®äººã‚’ SL ã®å‹ã ã¡ã¨ã—ã¦è¿½åŠ "/>
+ </accordion>
+ <text name="facebook_friends_status">
+ Facebook ã«æŽ¥ç¶šã—ã¦ã„ã¾ã›ã‚“。
+ </text>
+</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_facebook_photo.xml b/indra/newview/skins/default/xui/ja/panel_facebook_photo.xml
new file mode 100644
index 0000000000..f6d920bd5e
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/panel_facebook_photo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="ç”»åƒè§£åƒåº¦">
+ <combo_box.item label="ç¾åœ¨ã®ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦" name="CurrentWindow"/>
+ <combo_box.item label="640x480" name="640x480"/>
+ <combo_box.item label="800x600" name="800x600"/>
+ <combo_box.item label="1024x768" name="1024x768"/>
+ <combo_box.item label="1200x630" name="1200x630"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="ç”»åƒãƒ•ィルター">
+ <combo_box.item label="フィルターãªã—" name="NoFilter"/>
+ </combo_box>
+ <button label="æ›´æ–°" name="new_snapshot_btn" tool_tip="クリックã—ã¦æ›´æ–°"/>
+ <button label="プレビュー" name="big_preview_btn" tool_tip="クリックã—ã¦ãƒ—レビューを切り替ãˆã‚‹"/>
+ <text name="caption_label">
+ コメント (オプション):
+ </text>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="投稿" name="post_photo_btn"/>
+ <button label="å–り消ã—" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_facebook_place.xml b/indra/newview/skins/default/xui/ja/panel_facebook_place.xml
new file mode 100644
index 0000000000..e29f69101f
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/panel_facebook_place.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_place">
+ <layout_stack name="stack_place">
+ <layout_panel name="place_detail_panel">
+ <text name="place_caption_label">
+ 自分ãŒã„る場所ã«ã¤ã„ã¦ä½•ã‹è¨€ã£ã¦ãã ã•ã„:
+ </text>
+ </layout_panel>
+ <layout_panel name="place_map_panel">
+ <check_box initial_value="false" label="" name="add_place_view_cb"/>
+ </layout_panel>
+ <layout_panel name="place_button_panel">
+ <button label="投稿" name="post_place_btn"/>
+ <button label="å–り消ã—" name="cancel_place_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_facebook_status.xml b/indra/newview/skins/default/xui/ja/panel_facebook_status.xml
new file mode 100644
index 0000000000..84e5ae0474
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/panel_facebook_status.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_status">
+ <layout_stack name="stack_status">
+ <layout_panel name="status_detail_panel">
+ <text name="status_caption_label">
+ 今ã€ä½•を考ãˆã¦ã„ã‚‹?
+ </text>
+ </layout_panel>
+ <layout_panel name="status_button_panel">
+ <button label="投稿" name="post_status_btn"/>
+ <button label="å–り消ã—" name="cancel_status_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_flickr_account.xml b/indra/newview/skins/default/xui/ja/panel_flickr_account.xml
new file mode 100644
index 0000000000..bd2e96d58c
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/panel_flickr_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_flickr_account">
+ <string name="flickr_connected" value="次ã®ãƒ¦ãƒ¼ã‚¶ãƒ¼ã¨ã—㦠Flickr ã«æŽ¥ç¶š:"/>
+ <string name="flickr_disconnected" value="Flickr ã«æŽ¥ç¶šã—ã¦ã„ãªã„"/>
+ <text name="account_caption_label">
+ Flickr ã«æŽ¥ç¶šã—ã¦ã„ã¾ã›ã‚“。
+ </text>
+ <panel name="panel_buttons">
+ <button label="接続..." name="connect_btn"/>
+ <button label="切断" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Flickr/ta-p/2435609 Flickr ã¸ã®æŠ•稿ã«ã¤ã„ã¦]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_flickr_photo.xml b/indra/newview/skins/default/xui/ja/panel_flickr_photo.xml
new file mode 100644
index 0000000000..0deadad91d
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/panel_flickr_photo.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_flickr_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="ç”»åƒè§£åƒåº¦">
+ <combo_box.item label="ç¾åœ¨ã®ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦" name="CurrentWindow"/>
+ <combo_box.item label="640x480" name="640x480"/>
+ <combo_box.item label="800x600" name="800x600"/>
+ <combo_box.item label="1024x768" name="1024x768"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="ç”»åƒãƒ•ィルター">
+ <combo_box.item label="フィルターãªã—" name="NoFilter"/>
+ </combo_box>
+ <button label="æ›´æ–°" name="new_snapshot_btn" tool_tip="クリックã—ã¦æ›´æ–°"/>
+ <button label="プレビュー" name="big_preview_btn" tool_tip="クリックã—ã¦ãƒ—レビューを切り替ãˆã‚‹"/>
+ <text name="title_label">
+ タイトル:
+ </text>
+ <text name="description_label">
+ 説明:
+ </text>
+ <check_box initial_value="true" label="SL ã®å ´æ‰€ã‚’èª¬æ˜Žã®æœ€å¾Œã«å«ã‚ã‚‹" name="add_location_cb"/>
+ <text name="tags_label">
+ ã‚¿ã‚°:
+ </text>
+ <text name="tags_help_label">
+ タグをスペースã§åŒºåˆ‡ã‚‹
+複数å˜èªžã®ã‚¿ã‚°ã« &quot;&quot; を使用
+ </text>
+ <combo_box name="rating_combobox" tool_tip="Flickr コンテンツã®ãƒ¬ãƒ¼ãƒ†ã‚£ãƒ³ã‚°åŒºåˆ†">
+ <combo_box.item label="Flickr レーティング区分「Safeã€" name="SafeRating"/>
+ <combo_box.item label="Flickr レーティング区分「Moderateã€" name="ModerateRating"/>
+ <combo_box.item label="Flickr レーティング区分「Restrictedã€" name="RestrictedRating"/>
+ </combo_box>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="アップロード" name="post_photo_btn"/>
+ <button label="å–り消ã—" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_group_bulk_ban.xml b/indra/newview/skins/default/xui/ja/panel_group_bulk_ban.xml
new file mode 100644
index 0000000000..343db03030
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/panel_group_bulk_ban.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel label="ä½äººã‚’ç«‹å…¥ç¦æ­¢" name="bulk_ban_panel">
+ <panel.string name="loading">
+ (ロード中...)
+ </panel.string>
+ <panel.string name="ban_selection_too_large">
+ グループã¸ã®ç«‹å…¥ç¦æ­¢ãŒé€ä¿¡ã•れã¦ã„ã¾ã›ã‚“: é¸æŠžã—ãŸä½äººãŒå¤šã™ãŽã¾ã™ã€‚グループã¸ã®ç«‹å…¥ç¦æ­¢ã®æ•°ã¯ 1 リクエスト当ãŸã‚Š 100 人ã«åˆ¶é™ã•れã¦ã„ã¾ã™ã€‚
+ </panel.string>
+ <panel.string name="ban_not_permitted">
+ グループã¸ã®ç«‹å…¥ç¦æ­¢ãŒé€ä¿¡ã•れã¦ã„ã¾ã›ã‚“: ã€Œç«‹å…¥ç¦æ­¢ãƒªã‚¹ãƒˆã®ç®¡ç†ã€ã®èƒ½åŠ›ãŒã‚りã¾ã›ã‚“。
+ </panel.string>
+ <panel.string name="ban_limit_fail">
+ グループã¸ã®ç«‹å…¥ç¦æ­¢ãŒé€ä¿¡ã•れã¦ã„ã¾ã›ã‚“: グループã¸ã®ç«‹å…¥ç¦æ­¢ã®ç™»éŒ²è¨±å®¹æ•°ã«é”ã—ã¾ã—ãŸã€‚
+ </panel.string>
+ <panel.string name="partial_ban">
+ グループã¸ã®ç«‹å…¥ç¦æ­¢ã®ä¸€éƒ¨ãŒé€ä¿¡ã•れã¾ã›ã‚“ã§ã—ãŸ: [REASONS]
+ </panel.string>
+ <panel.string name="ban_failed">
+ グループã¸ã®ç«‹å…¥ç¦æ­¢ãŒé€ä¿¡ã•れã¾ã›ã‚“ã§ã—ãŸ: [REASONS]
+ </panel.string>
+ <panel.string name="residents_already_banned">
+ - 次ã®ä½æ°‘ã¯æ—¢ã«ç«‹å…¥ç¦æ­¢ã«ã•れã¦ã„ã¾ã™: [RESIDENTS]。
+ </panel.string>
+ <panel.string name="ban_limit_reached">
+ - ç«‹å…¥ç¦æ­¢ã®è¨±å®¹å€¤ã«é”ã—ã¾ã—ãŸã€‚次ã®ã‚¨ãƒ¼ã‚¸ã‚§ãƒ³ãƒˆã¯ç«‹å…¥ç¦æ­¢ã«ã•れã¾ã›ã‚“: [RESIDENTS]。
+ </panel.string>
+ <panel.string name="cant_ban_yourself">
+ - グループã‹ã‚‰è‡ªåˆ†è‡ªèº«ã‚’ç«‹å…¥ç¦æ­¢ã«ã™ã‚‹ã“ã¨ã¯ã§ãã¾ã›ã‚“。
+ </panel.string>
+ <text name="help_text">
+ グループã‹ã‚‰ä¸€åº¦ã«è¤‡æ•°ã®ä½äººã‚’ç«‹å…¥ç¦æ­¢ã«ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚「リストã‹ã‚‰ä½äººã‚’é¸æŠžã€ã‚’クリックã—ã¦ãã ã•ã„。
+ </text>
+ <button label="リストã‹ã‚‰ä½äººã‚’é¸æŠž" name="add_button"/>
+ <name_list name="banned_agent_list" tool_tip="Ctrl キーを押ã—ãªãŒã‚‰è¤‡æ•°ã®ä½äººã‚’クリックã§ãã¾ã™"/>
+ <button label="é¸æŠžã—ãŸä½äººã‚’リストã‹ã‚‰å‰Šé™¤" name="remove_button" tool_tip="ç«‹å…¥ç¦æ­¢ãƒªã‚¹ãƒˆã‹ã‚‰ä¸Šã§é¸æŠžã—ãŸä½äººã‚’削除ã—ã¾ã™"/>
+ <button label="ä½äººã‚’ç«‹å…¥ç¦æ­¢" name="ban_button"/>
+ <button label="å–り消ã—" name="cancel_button"/>
+ <string name="GroupBulkBan">
+ グループã¸ã®ç«‹å…¥ç¦æ­¢
+ </string>
+</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/ja/panel_group_info_sidetray.xml
index 7aa1aec6d0..ebcb36d950 100755
--- a/indra/newview/skins/default/xui/ja/panel_group_info_sidetray.xml
+++ b/indra/newview/skins/default/xui/ja/panel_group_info_sidetray.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel label="グループインベントリ" name="GroupInfo">
<panel.string name="default_needs_apply_text">
ä¿å­˜ã—ã¦ã„ãªã„変更ãŒã‚りã¾ã™
@@ -20,7 +20,7 @@
<layout_panel name="group_accordions">
<accordion name="groups_accordion">
<accordion_tab name="group_general_tab" title="一般"/>
- <accordion_tab name="group_roles_tab" title="役割"/>
+ <accordion_tab name="group_roles_tab" title="役割 &amp; メンãƒãƒ¼"/>
<accordion_tab name="group_notices_tab" title="通知"/>
<accordion_tab name="group_land_tab" title="土地・資産"/>
</accordion>
diff --git a/indra/newview/skins/default/xui/ja/panel_group_invite.xml b/indra/newview/skins/default/xui/ja/panel_group_invite.xml
index cc9ebc405b..2639454a01 100755
--- a/indra/newview/skins/default/xui/ja/panel_group_invite.xml
+++ b/indra/newview/skins/default/xui/ja/panel_group_invite.xml
@@ -22,7 +22,7 @@
割り当ã¦å…ˆã®å½¹å‰²ã‚’é¸æŠžï¼š
</text>
<combo_box name="role_name" tool_tip="メンãƒãƒ¼ã«å‰²ã‚Šå½“ã¦ãŸã„役割をリストã‹ã‚‰é¸ã‚“ãã ã•ã„"/>
- <button label="招待をé€ä¿¡" name="ok_button"/>
+ <button label="招待状をé€ä¿¡" name="invite_button"/>
<button label="å–り消ã—" name="cancel_button"/>
<string name="GroupInvitation">
グループã¸ã®æ‹›å¾…
diff --git a/indra/newview/skins/default/xui/ja/panel_group_roles.xml b/indra/newview/skins/default/xui/ja/panel_group_roles.xml
index d40dedf566..0e231b5b4f 100755
--- a/indra/newview/skins/default/xui/ja/panel_group_roles.xml
+++ b/indra/newview/skins/default/xui/ja/panel_group_roles.xml
@@ -21,15 +21,17 @@ Ctrl キーを押ã—ãªãŒã‚‰ãƒ¡ãƒ³ãƒãƒ¼åをクリックã™ã‚‹ã¨
<name_list.columns label="メンãƒãƒ¼" name="name"/>
<name_list.columns label="寄付" name="donated"/>
<name_list.columns label="ステータス" name="online"/>
+ <name_list.columns label="è·å" name="title"/>
</name_list>
<button label="招待" name="member_invite"/>
<button label="追放" name="member_eject"/>
+ <button label="メンãƒãƒ¼ã®ç«‹å…¥ç¦æ­¢" name="member_ban"/>
</panel>
<panel label="役割" name="roles_sub_tab">
<panel.string name="help_text">
役割ã«ã¯ã€ã‚¿ã‚¤ãƒˆãƒ«ã¨è¨±å¯ã•れãŸèƒ½åŠ›ãŒ
-割り当ã¦ã‚‰ã‚Œã¦ã„ã¾ã™ã€‚ メンãƒãƒ¼ã¯
-1ã¤ä»¥ä¸Šã®å½¹å‰²ã‚’æŒã¤ã“ã¨ãŒã§ãã¾ã™ã€‚ グループã§ä½¿ãˆã‚‹å½¹å‰²ã¯10ã¤ã¾ã§ã§ã€
+割り当ã¦ã‚‰ã‚Œã¦ã„ã¾ã™ã€‚メンãƒãƒ¼ã¯
+1ã¤ä»¥ä¸Šã®å½¹å‰²ã‚’æŒã¤ã“ã¨ãŒã§ãã¾ã™ã€‚グループã§ä½¿ãˆã‚‹å½¹å‰²ã¯10ã¤ã¾ã§ã§ã€
「全員(Everyone)ã€ã¨ã€Œã‚ªãƒ¼ãƒŠãƒ¼ï¼ˆOwner)ã€ãŒãれã«å«ã¾ã‚Œã¦ã„ã¾ã™ã€‚
</panel.string>
<panel.string name="cant_delete_role">
@@ -55,14 +57,29 @@ Ctrl キーを押ã—ãªãŒã‚‰ãƒ¡ãƒ³ãƒãƒ¼åをクリックã™ã‚‹ã¨
</panel>
<panel label="能力" name="actions_sub_tab" tool_tip="能力ã®èª¬æ˜Žæ–‡ã«ã¯ã€ã©ã®å½¹å‰²ãƒ»ãƒ¡ãƒ³ãƒãƒ¼ãŒãã®èƒ½åŠ›ã‚’æŒã¤ã‹ãŒæ›¸ã‹ã‚Œã¦ã„ã¾ã™ã€‚">
<panel.string name="help_text">
- ã“ã®ã‚°ãƒ«ãƒ¼ãƒ—内ã§å½¹å‰²ã‚’与ãˆã‚‰ã‚Œã¦ã„るメンãƒãƒ¼ãŒå®Ÿè¡Œã§ãã‚‹æ“作ã¯ã€
-能力ã«ã‚ˆã£ã¦æ±ºã¾ã‚Šã¾ã™ã€‚ ã•ã¾ã–ã¾ãªèƒ½åŠ›ãŒç”¨æ„ã•れã¦ã„ã¾ã™ã€‚
+ 役割ã«å«ã¾ã‚ŒãŸãƒ¡ãƒ³ãƒãƒ¼ã«ã€ã“ã®ã‚°ãƒ«ãƒ¼ãƒ—ã§ç‰¹å®šã®
+活動を行ã†ã“ã¨ã‚’許å¯ã™ã‚‹èƒ½åŠ›ã€‚ã•ã¾ã–ã¾ãªèƒ½åŠ›ãŒæä¾›ã•れã¾ã™ã€‚
</panel.string>
<filter_editor label="能力をé¸åˆ¥" name="filter_input"/>
<scroll_list name="action_list" tool_tip="詳細を見るã«ã¯ã€èƒ½åŠ›ã‚’é¸ã‚“ã§ãã ã•ã„。">
<scroll_list.columns label="" name="action"/>
</scroll_list>
</panel>
+ <panel label="ç«‹å…¥ç¦æ­¢ã«ã•れãŸä½äºº" name="banlist_sub_tab" tool_tip="ã“ã®ã‚°ãƒ«ãƒ¼ãƒ—ã‹ã‚‰ç«‹ã¡å…¥ã‚Šç¦æ­¢ã«ã•れãŸä½äººã‚’表示ã—ã¾ã™ã€‚">
+ <panel.string name="help_text">
+ ç«‹å…¥ç¦æ­¢ãƒªã‚¹ãƒˆã«ç™»éŒ²ã•れãŸä½äººã¯ã‚°ãƒ«ãƒ¼ãƒ—ã«å‚加ã§ãã¾ã›ã‚“。
+ </panel.string>
+ <panel.string name="ban_count_template">
+ ç«‹å…¥ç¦æ­¢ã®äººæ•°: [COUNT]/[LIMIT]
+ </panel.string>
+ <name_list name="ban_list">
+ <name_list.columns label="ä½äºº" name="name"/>
+ <name_list.columns label="ç«‹å…¥ç¦æ­¢ã«ã•ã‚ŒãŸæ—¥ä»˜" name="ban_date"/>
+ </name_list>
+ <button label="ä½äººã®ç«‹å…¥ç¦æ­¢" name="ban_create" tool_tip="グループã‹ã‚‰ä½äººã‚’ç«‹å…¥ç¦æ­¢ã«ã™ã‚‹"/>
+ <button label="ç«‹å…¥ç¦æ­¢ã®è§£é™¤" name="ban_delete" tool_tip="é¸æŠžã—ãŸä½äººã®ã‚°ãƒ«ãƒ¼ãƒ—ã¸ã®ç«‹ã¡å…¥ã‚Šç¦æ­¢ã‚’解除"/>
+ <button name="ban_refresh" tool_tip="ç«‹å…¥ç¦æ­¢ãƒªã‚¹ãƒˆã®æ›´æ–°"/>
+ </panel>
</tab_container>
<panel name="members_footer">
<text name="static">
diff --git a/indra/newview/skins/default/xui/ja/panel_login.xml b/indra/newview/skins/default/xui/ja/panel_login.xml
index 396d9e65b1..c5d5330eb4 100755
--- a/indra/newview/skins/default/xui/ja/panel_login.xml
+++ b/indra/newview/skins/default/xui/ja/panel_login.xml
@@ -1,46 +1,27 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8"?>
<panel name="panel_login">
<panel.string name="forgot_password_url">
http://secondlife.com/account/request.php?lang=ja
</panel.string>
- <layout_stack name="login_widgets">
- <layout_panel name="login">
- <text name="log_in_text">
- ログイン
- </text>
- <text name="username_text">
- ユーザーãƒãƒ¼ãƒ ï¼š
+ <layout_stack name="ui_stack">
+ <layout_panel name="ui_container">
+ <combo_box label="ユーザーå" name="username_combo" tool_tip="登録時ã«è‡ªåˆ†ã§é¸ã‚“ã ãƒ¦ãƒ¼ã‚¶ãƒ¼å(例:bobsmith12ã€Steller Sunshineãªã©ï¼‰"/>
+ <line_editor label="パスワード" name="password_edit"/>
+ <check_box label="記憶ã™ã‚‹" name="remember_check"/>
+ <text name="forgot_password_text">
+ パスワードを忘れãŸå ´åˆ
</text>
- <combo_box name="username_combo" tool_tip="登録時ã«è‡ªåˆ†ã§é¸ã‚“ã ãƒ¦ãƒ¼ã‚¶ãƒ¼å(例:bobsmith12ã€Steller Sunshineãªã©ï¼‰"/>
- <text name="password_text">
- パスワード:
+ <button label="ログイン" name="connect_btn"/>
+ <text name="At_My_Last_Location_Label">
+ å‰å›žã®å ´æ‰€
</text>
- </layout_panel>
- <layout_panel name="start_location_panel">
- <text name="start_location_text">
- 開始地点:
- </text>
- <combo_box name="start_location_combo">
- <combo_box.item label="最後ã«ãƒ­ã‚°ã‚¢ã‚¦ãƒˆã—ãŸå ´æ‰€" name="MyLastLocation"/>
+ <combo_box label="ãŠæ°—ã«å…¥ã‚Šã®å ´æ‰€" name="start_location_combo">
<combo_box.item label="ホーム" name="MyHome"/>
- <combo_box.item label="<地域åを入力>" name="Typeregionname"/>
</combo_box>
- </layout_panel>
- <layout_panel name="links_login_panel">
- <text name="login_help">
- ãƒ­ã‚°ã‚¤ãƒ³ã®æ–¹æ³•
- </text>
- <text name="forgot_password_text">
- ユーザーåã¾ãŸã¯ãƒ‘スワードをãŠå¿˜ã‚Œã§ã™ã‹ï¼Ÿ
- </text>
- <button label="ログイン" left_pad="30" name="connect_btn" width="60"/>
- <check_box label="パスワードを記憶" name="remember_check"/>
- </layout_panel>
- <layout_panel name="links">
- <text name="create_account_text">
- アカウントを作æˆã—ã¦ãã ã•ã„
- </text>
- <button label="今ã™ãé–‹å§‹" name="create_new_account_btn"/>
+ <button label="ログイン" name="connect_favorite_btn"/>
+ <line_editor label="場所を入力" name="location_edit"/>
+ <button label="ログイン" name="connect_location_btn"/>
+ <combo_box label="ã‚°ãƒªãƒƒãƒ‰ã‚’é¸æŠž" name="server_combo"/>
</layout_panel>
</layout_stack>
</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_login_first.xml b/indra/newview/skins/default/xui/ja/panel_login_first.xml
new file mode 100644
index 0000000000..d350e2f9a2
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/panel_login_first.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_login">
+ <panel.string name="forgot_password_url">
+ http://secondlife.com/account/request.php?lang=ja
+ </panel.string>
+ <layout_stack name="logo_stack">
+ <layout_panel name="parent_panel2">
+ <layout_stack name="widget_stack">
+ <layout_panel name="widget_container">
+ <combo_box label="ユーザーå" name="username_combo" tool_tip="登録時ã«è‡ªåˆ†ã§é¸ã‚“ã ãƒ¦ãƒ¼ã‚¶ãƒ¼å(例:bobsmith12ã€Steller Sunshineãªã©ï¼‰"/>
+ <line_editor label="パスワード" name="password_edit"/>
+ <button label="ログイン" name="connect_btn"/>
+ <check_box label="記憶ã™ã‚‹" name="remember_check"/>
+ <text name="forgot_password_text">
+ パスワードを忘れãŸå ´åˆ
+ </text>
+ </layout_panel>
+ </layout_stack>
+ </layout_panel>
+ <layout_panel name="parent_panel3">
+ <layout_stack name="images_stack">
+ <layout_panel name="images_container">
+ <text name="image_caption_left">
+ 最åˆã®ã‚¹ãƒ†ãƒƒãƒ—ã¯ã€ã‚¢ã‚¤ãƒ©ãƒ³ãƒ‰ã«ã¤ã„ã¦å­¦ã¶ã“ã¨ã§ã™ã€‚ã•ã‚ã€ã‚¢ã‚¤ãƒ©ãƒ³ãƒ‰æŽ¢æ¤œã®å…¥å£ã‚’見ã¤ã‘ã¦ãã ã•ã„!
+ </text>
+ <text name="image_caption_right">
+ ソーシャル アイランドを探検ã—ã¦ã€ä»–ã®æ–°ã—ã„ä½äººã‚’探ã—ã¦ãã ã•ã„!
+ </text>
+ </layout_panel>
+ </layout_stack>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/ja/panel_preferences_advanced.xml
index dcaa23fee5..6e8797ec5e 100755
--- a/indra/newview/skins/default/xui/ja/panel_preferences_advanced.xml
+++ b/indra/newview/skins/default/xui/ja/panel_preferences_advanced.xml
@@ -28,4 +28,5 @@
<check_box label="ログイン時ã«ã‚°ãƒªãƒƒãƒ‰é¸æŠžã‚’表示" name="show_grid_selection_check"/>
<check_box label="アドãƒãƒ³ã‚¹ãƒ¡ãƒ‹ãƒ¥ãƒ¼ã‚’表示" name="show_advanced_menu_check"/>
<check_box label="デベロッパーメニューを表示" name="show_develop_menu_check"/>
+ <button label="デフォルト作æˆè¨±å¯" name="default_creation_permissions"/>
</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_preferences_general.xml b/indra/newview/skins/default/xui/ja/panel_preferences_general.xml
index d70af7e099..39bc05c845 100755
--- a/indra/newview/skins/default/xui/ja/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/ja/panel_preferences_general.xml
@@ -30,14 +30,10 @@
<combo_box.item label="General 㨠Moderate" name="Desired_Mature"/>
<combo_box.item label="General" name="Desired_PG"/>
</combo_box>
- <text name="start_location_textbox">
- ログインä½ç½®ï¼š
+ <check_box label="ログイン画é¢ã«ãŠæ°—ã«å…¥ã‚Šã®å ´æ‰€ã‚’表示" name="favorites_on_login_check"/>
+ <text name="favorites_check_extra_text">
+ (ã“ã®ã‚³ãƒ³ãƒ”ュータを使用ã™ã‚‹ä»–ã®äººã«ã‚‚表示ã•れã¾ã™)
</text>
- <combo_box name="start_location_combo">
- <combo_box.item label="最後ã«ãƒ­ã‚°ã‚¢ã‚¦ãƒˆã—ãŸå ´æ‰€" name="MyLastLocation" tool_tip="å¸¸ã«æœ€å¾Œã«ã„ãŸå ´æ‰€ã«ãƒ­ã‚°ã‚¤ãƒ³"/>
- <combo_box.item label="ホーム" name="MyHome" tool_tip="常ã«ãƒ›ãƒ¼ãƒ ï¼ˆè‡ªå®…)ã«ãƒ­ã‚°ã‚¤ãƒ³"/>
- </combo_box>
- <check_box initial_value="true" label="ログイン画é¢ã«è¡¨ç¤ºã™ã‚‹" name="show_location_checkbox"/>
<text name="name_tags_textbox">
åå‰ã®è¡¨ç¤ºï¼š
</text>
diff --git a/indra/newview/skins/default/xui/ja/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/ja/panel_preferences_privacy.xml
index 420bbed572..2db6a688f3 100755
--- a/indra/newview/skins/default/xui/ja/panel_preferences_privacy.xml
+++ b/indra/newview/skins/default/xui/ja/panel_preferences_privacy.xml
@@ -7,7 +7,7 @@
<text name="cache_size_label_l">
(ä½ç½®ã€ç”»åƒã€webã€æ¤œç´¢å±¥æ­´ï¼‰
</text>
- <check_box label="æ¤œç´¢çµæžœã«è¡¨ç¤º" name="online_searchresults"/>
+ <check_box label="ãƒ—ãƒ­ãƒ•ã‚£ãƒ¼ãƒ«ã‚’æ¤œç´¢çµæžœã«è¡¨ç¤ºã™ã‚‹" name="online_searchresults"/>
<check_box label="ç§ã®ã‚ªãƒ³ãƒ©ã‚¤ãƒ³çŠ¶æ…‹ã‚’ç¢ºèªã§ãã‚‹ã®ã¯ã€ãƒ•レンドã¨ã‚°ãƒ«ãƒ¼ãƒ—ã ã‘" name="online_visibility"/>
<check_box label="フレンドã¨ã‚°ãƒ«ãƒ¼ãƒ—以外ã‹ã‚‰ã¯ã‚³ãƒ¼ãƒ«ã¨ IM ã‚’å—ä¿¡ã—ãªã„" name="voice_call_friends_only_check"/>
<check_box label="コールãŒçµ‚了ã—ãŸã‚‰è‡ªå‹•çš„ã«ãƒžã‚¤ã‚¯ã®ã‚¹ã‚¤ãƒƒãƒã‚’切る" name="auto_disengage_mic_check"/>
diff --git a/indra/newview/skins/default/xui/ja/panel_region_debug.xml b/indra/newview/skins/default/xui/ja/panel_region_debug.xml
index 169da27ce5..908af3d66a 100755
--- a/indra/newview/skins/default/xui/ja/panel_region_debug.xml
+++ b/indra/newview/skins/default/xui/ja/panel_region_debug.xml
@@ -7,11 +7,8 @@
未知
</text>
<check_box label="スクリプト無効化" name="disable_scripts_check" tool_tip="ã“ã®åœ°åŸŸã®ã‚¹ã‚¯ãƒªãƒ—トをã™ã¹ã¦ç„¡åйã«ã—ã¾ã™"/>
- <button label="?" name="disable_scripts_help"/>
<check_box label="è¡çªã‚’無効化" name="disable_collisions_check" tool_tip="ã“ã®åœ°åŸŸã®éžã‚¢ãƒã‚¿ãƒ¼è¡çªã‚’無効ã«ã—ã¾ã™"/>
- <button label="?" name="disable_collisions_help"/>
<check_box label="物ç†ä½œç”¨ã‚’無効化" name="disable_physics_check" tool_tip="ã“ã®åœ°åŸŸã®ç‰©ç†ä½œç”¨ã‚’ã™ã¹ã¦ç„¡åйã«ã—ã¾ã™"/>
- <button label="?" name="disable_physics_help"/>
<button label="é©ç”¨" name="apply_btn"/>
<text name="objret_text_lbl" width="120">
オブジェクトã®è¿”å´
@@ -31,10 +28,8 @@
<check_box label="ã“ã®ä¸å‹•産ã«å±žã™ã‚‹ã™ã¹ã¦ã®ãƒªãƒ¼ã‚¸ãƒ§ãƒ³ã®ã‚‚ã®" name="return_estate_wide" tool_tip="ã“ã®ä¸å‹•産ã«å«ã¾ã‚Œã¦ã„ã‚‹ã™ã¹ã¦ã®åœ°åŸŸã®ã‚ªãƒ–ジェクトを返å´ã—ã¾ã™"/>
<button label="è¿”å´" name="return_btn"/>
<button label="上部コライダーå–å¾—" name="top_colliders_btn" tool_tip="è¡çªã™ã‚‹å¯èƒ½æ€§ãŒæœ€ã‚‚高ã„オブジェクトã®ãƒªã‚¹ãƒˆ"/>
- <button label="?" name="top_colliders_help"/>
- <button label="上部スクリプトå–å¾—" name="top_scripts_btn" tool_tip="スクリプトã®å®Ÿè¡Œã«æœ€ã‚‚時間を費やã—ã¦ã„るオブジェクトã®ãƒªã‚¹ãƒˆ"/>
- <button label="?" name="top_scripts_help"/>
<button label="地域å†èµ·å‹•" name="restart_btn" tool_tip="2分間ã®ã‚«ã‚¦ãƒ³ãƒˆãƒ€ã‚¦ãƒ³å¾Œã€åœ°åŸŸã‚’å†èµ·å‹•ã—ã¾ã™"/>
- <button label="?" name="restart_help"/>
+ <button label="上部スクリプトå–å¾—" name="top_scripts_btn" tool_tip="スクリプトã®å®Ÿè¡Œã«æœ€ã‚‚時間を費やã—ã¦ã„るオブジェクトã®ãƒªã‚¹ãƒˆ"/>
<button label="å†èµ·å‹•をキャンセル" name="cancel_restart_btn" tool_tip="リージョンã®å†èµ·å‹•をキャンセル"/>
+ <button label="地域デãƒãƒƒã‚°ã‚³ãƒ³ã‚½ãƒ¼ãƒ«" name="region_debug_console_btn" tool_tip="地域デãƒãƒƒã‚°ã‚³ãƒ³ã‚½ãƒ¼ãƒ«ã‚’é–‹ã"/>
</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_region_general.xml b/indra/newview/skins/default/xui/ja/panel_region_general.xml
index 65148cf1ee..d23007dc6b 100755
--- a/indra/newview/skins/default/xui/ja/panel_region_general.xml
+++ b/indra/newview/skins/default/xui/ja/panel_region_general.xml
@@ -20,12 +20,12 @@
</text>
<check_box label="地形編集をブロック" name="block_terraform_check"/>
<check_box label="飛行をブロック" name="block_fly_check"/>
+ <check_box label="区画ã®é£›è¡Œã‚’ブロック" name="block_fly_over_check" tool_tip="アクセス ãƒã‚§ãƒƒã‚¯ã‚’上方å‘ã«æ‹¡å¤§ã—ã€åŒºç”»ã‚’è¶…ãˆã‚‹é£›è¡Œã‚’防ãŽã¾ã™"/>
<check_box label="ダメージを許å¯" name="allow_damage_check"/>
<check_box label="プッシュを制é™" name="restrict_pushobject"/>
<check_box label="土地ã®å†è²©ã‚’許å¯" name="allow_land_resell_check"/>
<check_box label="土地ã®çµ±åˆãƒ»åˆ†å‰²ã‚’許å¯" name="allow_parcel_changes_check"/>
<check_box label="åœŸåœ°ã®æ¤œç´¢è¡¨ç¤ºã‚’ブロック" name="block_parcel_search_check" tool_tip="æ¤œç´¢çµæžœã§ã€ã“ã®åœ°åŸŸã¨åŒºç”»ã‚’表示ã™ã‚‹ã‹ã©ã†ã‹ã®è¨­å®šã§ã™"/>
- <check_box label="メッシュオブジェクトを許å¯" name="mesh_rez_enabled_check" tool_tip="ã“ã®ãƒªãƒ¼ã‚¸ãƒ§ãƒ³ã§ãƒ¡ãƒƒã‚·ãƒ¥ã‚ªãƒ–ジェクト㮠Rez を許å¯ã™ã‚‹"/>
<spinner label="ã‚¢ãƒã‚¿ãƒ¼æ•°ä¸Šé™" name="agent_limit_spin"/>
<spinner label="物体ボーナス" name="object_bonus_spin"/>
<text label="æˆäººæŒ‡å®š" name="access_text">
diff --git a/indra/newview/skins/default/xui/ja/panel_script_ed.xml b/indra/newview/skins/default/xui/ja/panel_script_ed.xml
index b6d51085eb..3aa20d0a3c 100755
--- a/indra/newview/skins/default/xui/ja/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/ja/panel_script_ed.xml
@@ -24,6 +24,7 @@
<menu_item_call label="å¤‰æ›´ã‚’å…ƒã«æˆ»ã™" name="Revert All Changes"/>
<menu_item_call label="ファイルã‹ã‚‰ãƒ­ãƒ¼ãƒ‰..." name="LoadFromFile"/>
<menu_item_call label="ファイルã«ä¿å­˜..." name="SaveToFile"/>
+ <menu_item_call label="色..." name="Colors"/>
</menu>
<menu label="編集" name="Edit">
<menu_item_call label="å…ƒã«æˆ»ã™" name="Undo"/>
@@ -41,9 +42,9 @@
<menu_item_call label="キーワードヘルプ..." name="Keyword Help..."/>
</menu>
</menu_bar>
- <text_editor name="Script Editor">
+ <script_editor name="Script Editor">
ローディング...
- </text_editor>
+ </script_editor>
<combo_box label="挿入..." name="Insert..."/>
<button label="ä¿å­˜" label_selected="ä¿å­˜" name="Save_btn"/>
<button label="編集..." name="Edit_btn"/>
diff --git a/indra/newview/skins/default/xui/ja/panel_snapshot_options.xml b/indra/newview/skins/default/xui/ja/panel_snapshot_options.xml
index c3b1cd91e7..6ce492476b 100755
--- a/indra/newview/skins/default/xui/ja/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/ja/panel_snapshot_options.xml
@@ -1,7 +1,16 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_options">
<button label="ãƒ—ãƒ­ãƒ•ã‚£ãƒ¼ãƒ«ãƒ•ã‚£ãƒ¼ãƒ‰ã«æŠ•ç¨¿ã™ã‚‹" name="save_to_profile_btn"/>
<button label="メール" name="save_to_email_btn"/>
<button label="インベントリã«ä¿å­˜ï¼ˆL$[Amount])" name="save_to_inventory_btn"/>
<button label="コンピューターã«ä¿å­˜" name="save_to_computer_btn"/>
+ <text name="send_to_facebook_textbox">
+ 宛先: [secondlife:/// Facebook]
+ </text>
+ <text name="send_to_twitter_textbox">
+ [secondlife:/// Twitter]
+ </text>
+ <text name="send_to_flickr_textbox">
+ [secondlife:/// Flickr]
+ </text>
</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_teleport_history_item.xml b/indra/newview/skins/default/xui/ja/panel_teleport_history_item.xml
index c570cd5696..0340bfe754 100755
--- a/indra/newview/skins/default/xui/ja/panel_teleport_history_item.xml
+++ b/indra/newview/skins/default/xui/ja/panel_teleport_history_item.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="teleport_history_item">
<text name="region" value="..."/>
+ <text name="timestamp" value="..."/>
<button name="profile_btn" tool_tip="アイテム情報を表示"/>
</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_twitter_account.xml b/indra/newview/skins/default/xui/ja/panel_twitter_account.xml
new file mode 100644
index 0000000000..b140b7463f
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/panel_twitter_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_twitter_account">
+ <string name="twitter_connected" value="次ã®ãƒ¦ãƒ¼ã‚¶ãƒ¼ã¨ã—㦠Twitter ã«æŽ¥ç¶š:"/>
+ <string name="twitter_disconnected" value="Twitter ã«æŽ¥ç¶šã—ã¦ã„ãªã„"/>
+ <text name="account_caption_label">
+ Twitter ã«æŽ¥ç¶šã—ã¦ã„ã¾ã›ã‚“。
+ </text>
+ <panel name="panel_buttons">
+ <button label="接続..." name="connect_btn"/>
+ <button label="切断" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Twitter/ta-p/2435453 Twitter ã¸ã®æŠ•稿ã«ã¤ã„ã¦]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_twitter_photo.xml b/indra/newview/skins/default/xui/ja/panel_twitter_photo.xml
new file mode 100644
index 0000000000..8e67d8fd19
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/panel_twitter_photo.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_twitter_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="text_panel">
+ <text name="status_label">
+ 何ãŒèµ·ãã¦ã„ã‚‹ã®ã§ã—ょã†ã‹?
+ </text>
+ <text name="status_counter_label">
+ 140
+ </text>
+ <check_box initial_value="true" label="SL ã®å ´æ‰€ã‚’å«ã‚€" name="add_location_cb"/>
+ <check_box initial_value="true" label="写真を掲載ã™ã‚‹" name="add_photo_cb"/>
+ </layout_panel>
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="ç”»åƒè§£åƒåº¦">
+ <combo_box.item label="ç¾åœ¨ã®ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦" name="CurrentWindow"/>
+ <combo_box.item label="640x480" name="640x480"/>
+ <combo_box.item label="800x600" name="800x600"/>
+ <combo_box.item label="1024x768" name="1024x768"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="ç”»åƒãƒ•ィルター">
+ <combo_box.item label="フィルターãªã—" name="NoFilter"/>
+ </combo_box>
+ <button label="æ›´æ–°" name="new_snapshot_btn" tool_tip="クリックã—ã¦æ›´æ–°"/>
+ <button label="プレビュー" name="big_preview_btn" tool_tip="クリックã—ã¦ãƒ—レビューを切り替ãˆã‚‹"/>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="ツイート" name="post_photo_btn"/>
+ <button label="å–り消ã—" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/ja/role_actions.xml b/indra/newview/skins/default/xui/ja/role_actions.xml
index 5c2e18df03..e64460470c 100755
--- a/indra/newview/skins/default/xui/ja/role_actions.xml
+++ b/indra/newview/skins/default/xui/ja/role_actions.xml
@@ -3,6 +3,7 @@
<action_set description="ã“れらã®èƒ½åŠ›ã«ã¯ã€ã‚°ãƒ«ãƒ¼ãƒ—メンãƒãƒ¼ã‚’è¿½åŠ ã€æŽ’é™¤ã—ã€æ‹›å¾…状ãªã—ã«æ–°ãƒ¡ãƒ³ãƒãƒ¼ã®å‚加をèªã‚る権é™ãŒå«ã¾ã‚Œã¾ã™ã€‚" name="Membership">
<action description="ã“ã®ã‚°ãƒ«ãƒ¼ãƒ—ã«äººã‚’招待" longdescription="「役割ã€ã‚»ã‚¯ã‚·ãƒ§ãƒ³ã®ã€Œãƒ¡ãƒ³ãƒãƒ¼ã€ã‚¿ãƒ–内ã«ã‚る「招待ã€ãƒœã‚¿ãƒ³ã‚’押ã—ã¦ã€ã“ã®ã‚°ãƒ«ãƒ¼ãƒ—ã«ãƒ¡ãƒ³ãƒãƒ¼ã‚’招待ã—ã¾ã™ã€‚" name="member invite" value="1"/>
<action description="メンãƒãƒ¼ã‚’ã“ã®ã‚°ãƒ«ãƒ¼ãƒ—ã‹ã‚‰è¿½æ”¾" longdescription="「役割ã€ã‚»ã‚¯ã‚·ãƒ§ãƒ³ã®ã€Œãƒ¡ãƒ³ãƒãƒ¼ã€ã‚¿ãƒ–内ã«ã‚る「追放ã€ãƒœã‚¿ãƒ³ã‚’押ã—ã¦ã€ã“ã®ã‚°ãƒ«ãƒ¼ãƒ—ã‹ã‚‰ãƒ¡ãƒ³ãƒãƒ¼ã‚’追放ã—ã¾ã™ã€‚ 「オーナーã€ã¯ã€ä»–ã®ã€Œã‚ªãƒ¼ãƒŠãƒ¼ã€ä»¥å¤–ã¯èª°ã§ã‚‚追放ã§ãã¾ã™ã€‚ 「オーナーã€ã§ã¯ãªã„人ãŒã€Œå…¨å“¡ï¼ˆEveryone)ã€ã«ã—ã‹å½¹å‰²ãŒãªã„å ´åˆã€ãƒ¡ãƒ³ãƒãƒ¼ã¯ã‚°ãƒ«ãƒ¼ãƒ—ã‹ã‚‰è¿½æ”¾ã•れるã“ã¨ãŒã‚りã¾ã™ã€‚ 「役割ã€ã‹ã‚‰ãƒ¡ãƒ³ãƒãƒ¼ã‚’削除ã™ã‚‹ã«ã¯ã€ã€Œå½¹å‰²ã‹ã‚‰ãƒ¡ãƒ³ãƒãƒ¼ã‚’削除ã€ã®èƒ½åŠ›ãŒä¸Žãˆã‚‰ã‚Œã¦ã„ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚" name="member eject" value="2"/>
+ <action description="ç«‹å…¥ç¦æ­¢ãƒªã‚¹ãƒˆã®ç®¡ç†" longdescription="グループã®ãƒ¡ãƒ³ãƒãƒ¼ã«ã€ã“ã®ã‚°ãƒ«ãƒ¼ãƒ—ã‹ã‚‰ä½äººã‚’ç«‹å…¥ç¦æ­¢/ç«‹å…¥ç¦æ­¢è§£é™¤ã§ãるよã†ã«ã—ã¾ã™ã€‚" name="allow ban" value="51"/>
<action description="「自由å‚加ã€ã¨ã€Œå…¥ä¼šè²»ã€ã®åˆ‡ã‚Šæ›¿ãˆ" longdescription="「自由å‚加ã€ã«åˆ‡ã‚Šæ›¿ãˆã‚‹ã¨ã€æ‹›å¾…ã•れãªãã¦ã‚‚æ–°ã—ã„メンãƒãƒ¼ãŒå…¥ä¼šã§ãã¾ã™ã€‚「入会費ã€ã¯ã€Œä¸€èˆ¬ã€ã‚»ã‚¯ã‚·ãƒ§ãƒ³ã§å¤‰æ›´ã—ã¾ã™ã€‚" name="member options" value="3"/>
</action_set>
<action_set description="ã“れらã®èƒ½åŠ›ã«ã¯ã€ã‚°ãƒ«ãƒ¼ãƒ—内ã®å½¹å‰²ã‚’追加ã€å‰Šé™¤ã€å¤‰æ›´ã—ã€å½¹å‰²ã«ãƒ¡ãƒ³ãƒãƒ¼ã‚’追加ã€å‰Šé™¤ã—ã€ã•らã«å½¹å‰²ã¸èƒ½åŠ›ã‚’å‰²ã‚Šå½“ã¦ã‚‹æ¨©é™ãŒå«ã¾ã‚Œã¾ã™ã€‚" name="Roles">
diff --git a/indra/newview/skins/default/xui/ja/sidepanel_inventory.xml b/indra/newview/skins/default/xui/ja/sidepanel_inventory.xml
index 51d6d48f90..5aa0e86a5b 100755
--- a/indra/newview/skins/default/xui/ja/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/ja/sidepanel_inventory.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel label="ã‚‚ã®" name="objects panel">
- <panel label="" name="sidepanel__inventory_panel">
+ <panel label="" name="sidepanel_inventory_panel">
<layout_stack name="inventory_layout_stack">
<layout_panel name="inbox_layout_panel">
<panel label="" name="marketplace_inbox">
@@ -28,12 +28,12 @@
<button label="プロフィール" name="info_btn" tool_tip="オブジェクトã®ãƒ—ロフィールを表示ã™ã‚‹"/>
</layout_panel>
<layout_panel name="share_btn_lp">
- <button label="共有" name="share_btn" tool_tip="インベントリã®ã‚¢ã‚¤ãƒ†ãƒ ã‚’共有ã™ã‚‹"/>
+ <button label="共有" name="share_btn" tool_tip="「æŒã¡ç‰©ã€ã®ã‚¢ã‚¤ãƒ†ãƒ ã‚’共有ã™ã‚‹"/>
</layout_panel>
<layout_panel name="shop_btn_lp">
- <button label="店" name="shop_btn" tool_tip="マーケットプレイスã®ã‚µã‚¤ãƒˆã‚’é–‹ã"/>
+ <button label="ショッピング" name="shop_btn" tool_tip="マーケットプレイスã®ã‚µã‚¤ãƒˆã‚’é–‹ã"/>
<button label="装ç€" name="wear_btn" tool_tip="é¸æŠžã—ãŸã‚¢ã‚¦ãƒˆãƒ•ィットをç€ç”¨ã™ã‚‹"/>
- <button label="プレイ" name="play_btn"/>
+ <button label="å†ç”Ÿ" name="play_btn"/>
<button label="テレãƒãƒ¼ãƒˆ" name="teleport_btn" tool_tip="該当ã™ã‚‹ã‚¨ãƒªã‚¢ã«ãƒ†ãƒ¬ãƒãƒ¼ãƒˆã™ã‚‹"/>
</layout_panel>
</layout_stack>
diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml
index a0f45e5a55..d046e11571 100755
--- a/indra/newview/skins/default/xui/ja/strings.xml
+++ b/indra/newview/skins/default/xui/ja/strings.xml
@@ -37,6 +37,44 @@
<string name="StartupRequireDriverUpdate">
ã‚°ãƒ©ãƒ•ã‚£ãƒƒã‚¯ã‚’åˆæœŸåŒ–ã§ãã¾ã›ã‚“ã§ã—ãŸã€‚グラフィックドライãƒã‚’æ›´æ–°ã—ã¦ãã ã•ã„。
</string>
+ <string name="AboutHeader">
+ [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2] ([VIEWER_VERSION_3]) [BUILD_DATE] [BUILD_TIME] ([CHANNEL])[[VIEWER_RELEASE_NOTES_URL] [ReleaseNotes]]
+ </string>
+ <string name="AboutCompiler">
+ コンパイラー [COMPILER] [COMPILER_VERSION] ãƒãƒ¼ã‚¸ãƒ§ãƒ³
+ </string>
+ <string name="AboutPosition">
+ ã‚ãªãŸã®ç¾åœ¨åœ°ã¯ã€[POSITION_LOCAL_0,number,1]ã€[POSITION_LOCAL_1,number,1]ã€[POSITION_LOCAL_2,number,1] ã® [REGION] ã§ã™ã€‚ä½ç½®ã¯ &lt;nolink&gt;[HOSTNAME]&lt;/nolink&gt; ã§ã™ã€‚([HOSTIP])
+SLURL:&lt;nolink&gt;[SLURL]&lt;/nolink&gt;
+(グローãƒãƒ«åº§æ¨™ [POSITION_0,number,1]ã€[POSITION_1,number,1]ã€[POSITION_2,number,1])
+[SERVER_VERSION]
+[SERVER_RELEASE_NOTES_URL]
+ </string>
+ <string name="AboutSystem">
+ CPU:[CPU]
+メモリ:[MEMORY_MB] MB
+OS ãƒãƒ¼ã‚¸ãƒ§ãƒ³ï¼š[OS_VERSION]
+グラフィックカード製造元:[GRAPHICS_CARD_VENDOR]
+グラフィックカード:[GRAPHICS_CARD]
+ </string>
+ <string name="AboutDriver">
+ Windows グラフィックドライãƒãƒãƒ¼ã‚¸ãƒ§ãƒ³ï¼š[GRAPHICS_DRIVER_VERSION]
+ </string>
+ <string name="AboutLibs">
+ OpenGL ãƒãƒ¼ã‚¸ãƒ§ãƒ³ï¼š[OPENGL_VERSION]
+
+libcurl ãƒãƒ¼ã‚¸ãƒ§ãƒ³ï¼š[LIBCURL_VERSION]
+J2C デコーダãƒãƒ¼ã‚¸ãƒ§ãƒ³ï¼š[J2C_VERSION]
+オーディオドライãƒãƒãƒ¼ã‚¸ãƒ§ãƒ³ï¼š[AUDIO_DRIVER_VERSION]
+Qt Webkit ãƒãƒ¼ã‚¸ãƒ§ãƒ³ï¼š[QT_WEBKIT_VERSION]
+ボイスサーãƒãƒ¼ãƒãƒ¼ã‚¸ãƒ§ãƒ³:[VOICE_VERSION]
+ </string>
+ <string name="AboutTraffic">
+ パケットロス:[PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number,1]%)
+ </string>
+ <string name="ErrorFetchingServerReleaseNotesURL">
+ サーãƒãƒ¼ã®ãƒªãƒªãƒ¼ã‚¹ãƒŽãƒ¼ãƒˆã® URL ã‚’å–得中ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚
+ </string>
<string name="ProgressRestoring">
復元中ã§ã™...
</string>
@@ -296,6 +334,75 @@ support@secondlife.com ã«ãŠå•ã„åˆã‚ã›ãã ã•ã„。
<string name="TestingDisconnect">
ãƒ“ãƒ¥ãƒ¼ãƒ¯ã®æŽ¥ç¶šã‚’åˆ‡ã‚‹ãƒ†ã‚¹ãƒˆä¸­
</string>
+ <string name="SocialFlickrConnecting">
+ Flickr ã«æŽ¥ç¶šä¸­...
+ </string>
+ <string name="SocialFlickrPosting">
+ 投稿中...
+ </string>
+ <string name="SocialFlickrDisconnecting">
+ Flickr ã‹ã‚‰åˆ‡æ–­ä¸­...
+ </string>
+ <string name="SocialFlickrErrorConnecting">
+ Flickr ã¸ã®æŽ¥ç¶šæ™‚ã®ã‚¨ãƒ©ãƒ¼
+ </string>
+ <string name="SocialFlickrErrorPosting">
+ Flickr ã¸ã®æŠ•稿時ã®ã‚¨ãƒ©ãƒ¼
+ </string>
+ <string name="SocialFlickrErrorDisconnecting">
+ Flickr ã‹ã‚‰ã®åˆ‡æ–­æ™‚ã®ã‚¨ãƒ©ãƒ¼
+ </string>
+ <string name="SocialTwitterConnecting">
+ Twitter ã«æŽ¥ç¶šä¸­...
+ </string>
+ <string name="SocialTwitterPosting">
+ 投稿中...
+ </string>
+ <string name="SocialTwitterDisconnecting">
+ Twitter ã‹ã‚‰åˆ‡æ–­ä¸­...
+ </string>
+ <string name="SocialTwitterErrorConnecting">
+ Twitter ã¸ã®æŽ¥ç¶šæ™‚ã®ã‚¨ãƒ©ãƒ¼
+ </string>
+ <string name="SocialTwitterErrorPosting">
+ Twitter ã¸ã®æŠ•稿時ã®ã‚¨ãƒ©ãƒ¼
+ </string>
+ <string name="SocialTwitterErrorDisconnecting">
+ Twitter ã‹ã‚‰ã®åˆ‡æ–­æ™‚ã®ã‚¨ãƒ©ãƒ¼
+ </string>
+ <string name="BlackAndWhite">
+ 白黒
+ </string>
+ <string name="Colors1970">
+ 1970 年代ã®ã‚«ãƒ©ãƒ¼
+ </string>
+ <string name="Intense">
+ 強調
+ </string>
+ <string name="Newspaper">
+ æ–°èžç´™
+ </string>
+ <string name="Sepia">
+ セピア
+ </string>
+ <string name="Spotlight">
+ スãƒãƒƒãƒˆãƒ©ã‚¤ãƒˆ
+ </string>
+ <string name="Video">
+ ビデオ
+ </string>
+ <string name="Autocontrast">
+ オートコントラスト
+ </string>
+ <string name="LensFlare">
+ レンズフレア
+ </string>
+ <string name="Miniature">
+ ミニãƒãƒ¥ã‚¢
+ </string>
+ <string name="Toycamera">
+ ãŠã‚‚ã¡ã‚ƒã®ã‚«ãƒ¡ãƒ©
+ </string>
<string name="TooltipPerson">
人
</string>
@@ -847,6 +954,12 @@ support@secondlife.com ã«ãŠå•ã„åˆã‚ã›ãã ã•ã„。
<string name="use_texture">
テクスãƒãƒ£ã‚’使用
</string>
+ <string name="manip_hint1">
+ マウスカーソルをルーラã«åˆã‚ã›ã¦
+ </string>
+ <string name="manip_hint2">
+ グリッドã«ã‚¹ãƒŠãƒƒãƒ—
+ </string>
<string name="texture_loading">
ローディング...
</string>
@@ -937,15 +1050,15 @@ support@secondlife.com ã«ãŠå•ã„åˆã‚ã›ãã ã•ã„。
<string name="ControlYourCamera">
カメラã®ã‚³ãƒ³ãƒˆãƒ­ãƒ¼ãƒ«
</string>
+ <string name="TeleportYourAgent">
+ ã‚ãªãŸã‚’テレãƒãƒ¼ãƒˆ
+ </string>
<string name="NotConnected">
接続ã•れã¦ã„ã¾ã›ã‚“
</string>
<string name="AgentNameSubst">
(ã‚ãªãŸ)
</string>
- <string name="TeleportYourAgent">
- ã‚ãªãŸã‚’テレãƒãƒ¼ãƒˆ
- </string>
<string name="JoinAnExperience">
体験ã«å‚加ã™ã‚‹
</string>
@@ -1299,6 +1412,18 @@ support@secondlife.com ã«ãŠå•ã„åˆã‚ã›ãã ã•ã„。
<string name="InventoryOutboxNoItems">
[[MARKETPLACE_DASHBOARD_URL] マーケットプレイス]ã«è²©å£²ã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã‚’一覧ã™ã‚‹ã«ã¯ã€ãƒ•ォルダをã“ã®ã‚¨ãƒªã‚¢ã«ãƒ‰ãƒ©ãƒƒã‚°ã—ã€ã€Œãƒžãƒ¼ã‚±ãƒƒãƒˆãƒ—レイスã«é€ä¿¡ã€ã‚’クリックã—ã¾ã™ã€‚
</string>
+ <string name="InventoryOutboxInitializingTitle">
+ マーケットプレイスã®åˆæœŸåŒ–。
+ </string>
+ <string name="InventoryOutboxInitializing">
+ [[MARKETPLACE_CREATE_STORE_URL] マーケットプレイス ストア] ã®ã‚¢ã‚«ã‚¦ãƒ³ãƒˆã«ã‚¢ã‚¯ã‚»ã‚¹ã—ã¦ã„ã¾ã™ã€‚
+ </string>
+ <string name="InventoryOutboxErrorTitle">
+ マーケットプレイス エラー。
+ </string>
+ <string name="InventoryOutboxError">
+ [[MARKETPLACE_CREATE_STORE_URL] マーケットプレイス ストア] ãŒã‚¨ãƒ©ãƒ¼ã‚’è¿”ã—ã¦ã„ã¾ã™ã€‚
+ </string>
<string name="Marketplace Error None">
エラーãªã—
</string>
@@ -1326,6 +1451,9 @@ support@secondlife.com ã«ãŠå•ã„åˆã‚ã›ãã ã•ã„。
<string name="Open landmarks">
ランドマークを開ã
</string>
+ <string name="Unconstrained">
+ éžæ‹˜æŸ
+ </string>
<string name="no_transfer" value=" (å†è²©ãƒ»ãƒ—レゼントä¸å¯ï¼‰"/>
<string name="no_modify" value=" (編集ä¸å¯ï¼‰"/>
<string name="no_copy" value=" (コピーä¸å¯ï¼‰"/>
@@ -1726,6 +1854,9 @@ support@secondlife.com ã«ãŠå•ã„åˆã‚ã›ãã ã•ã„。
<string name="CompileQueueDownloadedCompiling">
ダウンロード完了ã€ã‚³ãƒ³ãƒ‘イル中
</string>
+ <string name="CompileQueueServiceUnavailable">
+ スクリプト コンパイル サービスを利用ã§ãã¾ã›ã‚“
+ </string>
<string name="CompileQueueScriptNotFound">
サーãƒãƒ¼ä¸Šã«ã‚¹ã‚¯ãƒªãƒ—トãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。
</string>
@@ -4026,6 +4157,12 @@ www.secondlife.com ã‹ã‚‰æœ€æ–°ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’ダウンロードã—ã¦ãã ã
<string name="share_alert">
インベントリã‹ã‚‰ã“ã“ã«ã‚¢ã‚¤ãƒ†ãƒ ã‚’ドラッグã—ã¾ã™
</string>
+ <string name="flickr_post_success">
+ Flickr ã«æŠ•ç¨¿ã—ã¾ã—ãŸã€‚
+ </string>
+ <string name="twitter_post_success">
+ Twitter ã«æŠ•ç¨¿ã—ã¾ã—ãŸã€‚
+ </string>
<string name="no_session_message">
(IM セッションãŒå­˜åœ¨ã—ã¾ã›ã‚“)
</string>
@@ -4482,6 +4619,9 @@ www.secondlife.com ã‹ã‚‰æœ€æ–°ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’ダウンロードã—ã¦ãã ã
<string name="LocalEstimateUSD">
US$ [AMOUNT]
</string>
+ <string name="Group Ban">
+ グループã¸ã®ç«‹å…¥ç¦æ­¢
+ </string>
<string name="Membership">
会員
</string>
@@ -4904,6 +5044,12 @@ www.secondlife.com ã‹ã‚‰æœ€æ–°ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’ダウンロードã—ã¦ãã ã
<string name="Command_Destinations_Label">
行ãå…ˆ
</string>
+ <string name="Command_Facebook_Label">
+ Facebook
+ </string>
+ <string name="Command_Flickr_Label">
+ Flickr
+ </string>
<string name="Command_Gestures_Label">
ジェスãƒãƒ£ãƒ¼
</string>
@@ -4952,6 +5098,9 @@ www.secondlife.com ã‹ã‚‰æœ€æ–°ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’ダウンロードã—ã¦ãã ã
<string name="Command_Speak_Label">
話ã™
</string>
+ <string name="Command_Twitter_Label">
+ Twitter
+ </string>
<string name="Command_View_Label">
カメラコントロール
</string>
@@ -4982,6 +5131,12 @@ www.secondlife.com ã‹ã‚‰æœ€æ–°ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’ダウンロードã—ã¦ãã ã
<string name="Command_Destinations_Tooltip">
行ã£ã¦ã¿ãŸã„場所
</string>
+ <string name="Command_Facebook_Tooltip">
+ Facebook ã¸æŠ•ç¨¿
+ </string>
+ <string name="Command_Flickr_Tooltip">
+ Flickr ã«ã‚¢ãƒƒãƒ—ロード
+ </string>
<string name="Command_Gestures_Tooltip">
ã‚¢ãƒã‚¿ãƒ¼ã®ã‚¸ã‚§ã‚¹ãƒãƒ£ãƒ¼
</string>
@@ -5030,6 +5185,9 @@ www.secondlife.com ã‹ã‚‰æœ€æ–°ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’ダウンロードã—ã¦ãã ã
<string name="Command_Speak_Tooltip">
マイクを使ã£ã¦è¿‘ãã®äººã¨è©±ã™
</string>
+ <string name="Command_Twitter_Tooltip">
+ Twitter
+ </string>
<string name="Command_View_Tooltip">
カメラã®è§’度を変更
</string>
diff --git a/indra/newview/skins/default/xui/pl/floater_lagmeter.xml b/indra/newview/skins/default/xui/pl/floater_lagmeter.xml
index 8038550bcb..8038550bcb 100755..100644
--- a/indra/newview/skins/default/xui/pl/floater_lagmeter.xml
+++ b/indra/newview/skins/default/xui/pl/floater_lagmeter.xml
diff --git a/indra/newview/skins/default/xui/pl/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/pl/panel_preferences_privacy.xml
index 5af2fed142..30b64bc977 100755
--- a/indra/newview/skins/default/xui/pl/panel_preferences_privacy.xml
+++ b/indra/newview/skins/default/xui/pl/panel_preferences_privacy.xml
@@ -7,7 +7,7 @@
<text name="cache_size_label_l">
(Miejsca, obrazy, przeglÄ…darka internetowa, wyszukiwarka historii)
</text>
- <check_box label="Pokaż mój profil w wynikach wyszukiwarki" name="online_searchresults"/>
+ <check_box label="Pokaż mój informacje profilu w wynikach wyszukiwania" name="online_searchresults"/>
<check_box label="Mój status online jest dostępny tylko dla znajomych i grup do których należę" name="online_visibility"/>
<check_box label="Możliwość wysyłania wiadomości prywatnej (IM) oraz rozmowy głosowej tylko dla &#10;znajomych i grup do których należę" name="voice_call_friends_only_check" top_pad="15"/>
<check_box label="Wyłącz mikrofon po zakończeniu rozmowy głosowej" name="auto_disengage_mic_check"/>
diff --git a/indra/newview/skins/default/xui/pl/sidepanel_inventory.xml b/indra/newview/skins/default/xui/pl/sidepanel_inventory.xml
index c2e50473a5..1034a06f1f 100755
--- a/indra/newview/skins/default/xui/pl/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/pl/sidepanel_inventory.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel label="Rzeczy" name="objects panel">
- <panel label="" name="sidepanel__inventory_panel">
+ <panel label="" name="sidepanel_inventory_panel">
<panel name="button_panel">
<layout_stack name="button_panel_ls">
<layout_panel name="info_btn_lp">
diff --git a/indra/newview/skins/default/xui/pl/strings.xml b/indra/newview/skins/default/xui/pl/strings.xml
index f6dec8536b..f86e393646 100755
--- a/indra/newview/skins/default/xui/pl/strings.xml
+++ b/indra/newview/skins/default/xui/pl/strings.xml
@@ -1035,6 +1035,7 @@
<string name="InventoryNoTexture">
Nie posiadasz kopii tej tekstury w Twojej Szafie.
</string>
+ <string name="Unconstrained">Swobodny</string>
<string name="no_transfer" value=" (brak oddawania)"/>
<string name="no_modify" value=" (brak modyfikowania)"/>
<string name="no_copy" value=" (brak kopiowania)"/>
diff --git a/indra/newview/skins/default/xui/pt/floater_big_preview.xml b/indra/newview/skins/default/xui/pt/floater_big_preview.xml
new file mode 100644
index 0000000000..76ca176689
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/floater_big_preview.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_big_preview" title="VISUALIZAR"/>
diff --git a/indra/newview/skins/default/xui/pt/floater_facebook.xml b/indra/newview/skins/default/xui/pt/floater_facebook.xml
new file mode 100644
index 0000000000..c211d75e9b
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/floater_facebook.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_facebook" title="PUBLICAR NO FACEBOOK">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="STATUS" name="panel_facebook_status"/>
+ <panel label="FOTO" name="panel_facebook_photo"/>
+ <panel label="FAZER CHECK IN" name="panel_facebook_place"/>
+ <panel label="AMIGOS" name="panel_facebook_friends"/>
+ <panel label="CONTA" name="panel_facebook_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ Erro
+ </text>
+ <text name="connection_loading_text">
+ Carregando...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_flickr.xml b/indra/newview/skins/default/xui/pt/floater_flickr.xml
new file mode 100644
index 0000000000..67d2295e41
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/floater_flickr.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_flickr" title="CARREGAR NO FLICKR">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="FOTO" name="panel_flickr_photo"/>
+ <panel label="CONTA" name="panel_flickr_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ Erro
+ </text>
+ <text name="connection_loading_text">
+ Carregando...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_lagmeter.xml b/indra/newview/skins/default/xui/pt/floater_lagmeter.xml
index 9932318293..9932318293 100755..100644
--- a/indra/newview/skins/default/xui/pt/floater_lagmeter.xml
+++ b/indra/newview/skins/default/xui/pt/floater_lagmeter.xml
diff --git a/indra/newview/skins/default/xui/pt/floater_perms_default.xml b/indra/newview/skins/default/xui/pt/floater_perms_default.xml
new file mode 100644
index 0000000000..762f8320c4
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/floater_perms_default.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="perms default" title="PERMISSÕES DE CRIAÇÃO PADRÃO">
+ <panel label="Permissões padrão" name="default permissions"/>
+ <button label="OK" label_selected="OK" name="ok"/>
+ <button label="Cancelar" label_selected="Cancelar" name="cancel"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_region_restarting.xml b/indra/newview/skins/default/xui/pt/floater_region_restarting.xml
new file mode 100644
index 0000000000..7fd13c0d75
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/floater_region_restarting.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="region_restarting" title="REINICIANDO REGIÃO">
+ <string name="RegionName">
+ A região na qual você está ([NAME]) está prestes a ser reiniciada.
+
+Se permanecer aqui, você será desconectado.
+ </string>
+ <string name="RestartSeconds">
+ Segundos até o reinício
+[SECONDS]
+ </string>
+ <panel name="layout_panel_1">
+ <text name="region_name">
+ A região na qual você está (-Nome mais longo da região-) está prestes a ser reiniciada.
+
+Se permanecer aqui, você será desconectado.
+ </text>
+ <text name="restart_seconds">
+ Segundos até o reinício
+ 32767
+ </text>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_report_abuse.xml b/indra/newview/skins/default/xui/pt/floater_report_abuse.xml
index 08413a9231..e6d9961d0b 100755
--- a/indra/newview/skins/default/xui/pt/floater_report_abuse.xml
+++ b/indra/newview/skins/default/xui/pt/floater_report_abuse.xml
@@ -44,7 +44,7 @@
<combo_box.item label="Idade &gt; Residente adulto ou adolescente" name="Age__Adult_resident_on_Teen_Second_Life"/>
<combo_box.item label="Idade &gt; Residente menor de idade, fora do Second Life teen" name="Age__Underage_resident_outside_of_Teen_Second_Life"/>
<combo_box.item label="Assalto &gt; Sandbox de combate / área não segura" name="Assault__Combat_sandbox___unsafe_area"/>
- <combo_box.item label="Assalto &gt; Ãrea segura" name="Assault__Safe_area"/>
+ <combo_box.item label="Agressões &gt; Atirar, empurrar ou bater em outro residente em uma área segura" name="Assault__Safe_area"/>
<combo_box.item label="Assalto &gt; Testando armas em sandbox" name="Assault__Weapons_testing_sandbox"/>
<combo_box.item label="Comércio &gt; Falha em enviar produto ou serviço" name="Commerce__Failure_to_deliver_product_or_service"/>
<combo_box.item label="Revelar &gt; Informação do mundo real" name="Disclosure__Real_world_information"/>
@@ -58,25 +58,25 @@
<combo_box.item label="Fraude &gt; L$" name="Fraud__L$"/>
<combo_box.item label="Fraude &gt; Terra" name="Fraud__Land"/>
<combo_box.item label="Fraude &gt; Esquema de pirâmide ou cartas encadeadas" name="Fraud__Pyramid_scheme_or_chain_letter"/>
- <combo_box.item label="Fraude &gt; R$" name="Fraud__US$"/>
+ <combo_box.item label="Fraude &gt; L$ ou US$" name="Fraud__US$"/>
<combo_box.item label="Perturbação &gt; Fazendas de Anúncios / spam visual" name="Harassment__Advert_farms___visual_spam"/>
<combo_box.item label="Perturbação &gt; Difamação de indivíduos ou grupos" name="Harassment__Defaming_individuals_or_groups"/>
<combo_box.item label="Perturbação &gt; Impedindo movimentos" name="Harassment__Impeding_movement"/>
<combo_box.item label="Perturbação &gt; Perturbação sexual" name="Harassment__Sexual_harassment"/>
- <combo_box.item label="Perturbação &gt; Solicitando/incitando outros a violarem o ToS" name="Harassment__Solicting_inciting_others_to_violate_ToS"/>
+ <combo_box.item label="Assédio &gt; Comportamento direcionado destinado à perturbação" name="Harassment__Solicting_inciting_others_to_violate_ToS"/>
<combo_box.item label="Perturbação &gt; Abuso verbal" name="Harassment__Verbal_abuse"/>
<combo_box.item label="Indecência &gt; Conteúdo ou conduta amplamente ofensivos" name="Indecency__Broadly_offensive_content_or_conduct"/>
<combo_box.item label="Indecência &gt; Nome de avatar inapropriado" name="Indecency__Inappropriate_avatar_name"/>
- <combo_box.item label="Indecência &gt; Conduta ou conteúdo inapropriados numa região PG" name="Indecency__Mature_content_in_PG_region"/>
+ <combo_box.item label="Indecência &gt; Conteúdo ou conduta inapropriada para a classificação da região" name="Indecency__Mature_content_in_PG_region"/>
<combo_box.item label="Indecência &gt; Conduta ou conteúdo inapropriados numa região Mature" name="Indecency__Inappropriate_content_in_Mature_region"/>
<combo_box.item label="Violação de propriedade intelectual &gt; Remoção de Conteúdo" name="Intellectual_property_infringement_Content_Removal"/>
<combo_box.item label="Violação de Propriedade intelectual &gt; Cópia Ilegal ou Aproveitar-se de Permissões" name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit"/>
<combo_box.item label="Intolerância" name="Intolerance"/>
<combo_box.item label="Terra &gt; Abuso dos recursos da sandbox" name="Land__Abuse_of_sandbox_resources"/>
- <combo_box.item label="Terra &gt; Invasão &gt; Objetos/texturas" name="Land__Encroachment__Objects_textures"/>
+ <combo_box.item label="Terreno &gt; Invasão &gt; Objetos ou texturas" name="Land__Encroachment__Objects_textures"/>
<combo_box.item label="Terra &gt; Invasão &gt; Partículas" name="Land__Encroachment__Particles"/>
<combo_box.item label="Terra &gt; Violação &gt; Ãrvores/plantas" name="Land__Encroachment__Trees_plants"/>
- <combo_box.item label="Apostas/jogos de azar" name="Wagering_gambling"/>
+ <combo_box.item label="Apostas ou jogos de azar" name="Wagering_gambling"/>
<combo_box.item label="Outro" name="Other"/>
</combo_box>
<text name="abuser_name_title">
diff --git a/indra/newview/skins/default/xui/pt/floater_scene_load_stats.xml b/indra/newview/skins/default/xui/pt/floater_scene_load_stats.xml
new file mode 100644
index 0000000000..027e1ef311
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/floater_scene_load_stats.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Scene Load Statistics" title="ESTATÃSTICAS DE CARREGAMENTO DE CENA">
+ <button label="Pausar" name="playpause"/>
+ <scroll_container name="statistics_scroll">
+ <container_view name="statistics_view">
+ <stat_view label="Básico" name="basic">
+ <stat_bar label="Diferença de frame em pixels" name="frame difference"/>
+ <stat_bar label="Dados de UDP recebidos" name="bandwidth"/>
+ <stat_bar label="Bandwidth" name="packet_loss"/>
+ </stat_view>
+ <stat_view label="Avançado" name="advanced">
+ <stat_view label="Render" name="render">
+ <stat_bar label="Total Objects" name="objs"/>
+ <stat_bar label="New Objects" name="newobjs"/>
+ <stat_bar label="Taxa de acertos do cache do objeto" name="object_cache_hits"/>
+ </stat_view>
+ <stat_view label="Textura" name="texture">
+ <stat_bar label="Taxa de acertos do cache" name="texture_cache_hits"/>
+ <stat_bar label="Latência de leitura do cache" name="texture_cache_read_latency"/>
+ <stat_bar label="Contagem" name="numimagesstat"/>
+ <stat_bar label="Raw Count" name="numrawimagesstat"/>
+ </stat_view>
+ <stat_view label="Network" name="network">
+ <stat_bar label="Packets In" name="packetsinstat"/>
+ <stat_bar label="Packets Out" name="packetsoutstat"/>
+ <stat_bar label="Objetos" name="objectdatareceived"/>
+ <stat_bar label="Textura" name="texturedatareceived"/>
+ <stat_bar label="Asset" name="assetudpdatareceived"/>
+ <stat_bar label="Layers" name="layersdatareceived"/>
+ <stat_bar label="Actual In" name="messagedatain"/>
+ <stat_bar label="Actual Out" name="messagedataout"/>
+ <stat_bar label="Operações pendentes do VFS" name="vfspendingoperations"/>
+ </stat_view>
+ </stat_view>
+ <stat_view label="Simulator" name="sim">
+ <stat_bar label="Objetos" name="simobjects"/>
+ <stat_bar label="Active Objects" name="simactiveobjects"/>
+ <stat_bar label="Active Scripts" name="simactivescripts"/>
+ <stat_bar label="Packets In" name="siminpps"/>
+ <stat_bar label="Packets Out" name="simoutpps"/>
+ <stat_bar label="Pending Downloads" name="simpendingdownloads"/>
+ <stat_bar label="Pending Uploads" name="simpendinguploads"/>
+ <stat_bar label="Total Unacked Bytes" name="simtotalunackedbytes"/>
+ <stat_view label="Time (ms)" name="simperf">
+ <stat_bar label="Total Frame Time" name="simframemsec"/>
+ <stat_bar label="Net Time" name="simnetmsec"/>
+ <stat_bar label="Physics Time" name="simsimphysicsmsec"/>
+ <stat_bar label="Simulation Time" name="simsimothermsec"/>
+ <stat_bar label="Agent Time" name="simagentmsec"/>
+ <stat_bar label="Images Time" name="simimagesmsec"/>
+ <stat_bar label="Script Time" name="simscriptmsec"/>
+ <stat_bar label="Tempo restante" name="simsparemsec"/>
+ <stat_view label="Detalhes de tempo (ms)" name="timedetails">
+ <stat_bar label="Etapa física" name="simsimphysicsstepmsec"/>
+ <stat_bar label="Atualizar formas físicas" name="simsimphysicsshapeupdatemsec"/>
+ <stat_bar label="Física - outros" name="simsimphysicsothermsec"/>
+ <stat_bar label="Tempo de espera" name="simsleepmsec"/>
+ <stat_bar label="Bombear ES" name="simpumpiomsec"/>
+ </stat_view>
+ </stat_view>
+ </stat_view>
+ </container_view>
+ </scroll_container>
+</floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_script_ed_prefs.xml b/indra/newview/skins/default/xui/pt/floater_script_ed_prefs.xml
new file mode 100644
index 0000000000..ae4ac7b8df
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/floater_script_ed_prefs.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_script_colors" title="CORES DE SCRIPT">
+ <text name="color_pickers_label">
+ Escolha as cores desejadas:
+ </text>
+ <text name="text_label">
+ Texto
+ </text>
+ <text name="cursor_label">
+ Cursor
+ </text>
+ <text name="background_label">
+ Segundo plano
+ </text>
+ <text name="datatype_label">
+ Tipos de dados
+ </text>
+ <text name="event_label">
+ Eventos
+ </text>
+ <text name="string_literal_label">
+ Sequência literal
+ </text>
+ <text name="constant_label">
+ Constante
+ </text>
+ <text name="flow_control_label">
+ Controle de fluxo
+ </text>
+ <text name="function_label">
+ Função
+ </text>
+ <text name="comment_label">
+ Comentário
+ </text>
+ <script_editor name="Script Preview">
+ /* Um script de exemplo */
+default
+{
+ state_entry()
+ {
+ // Comment
+ string greeting = &quot;Olá&quot;;
+ llSay(PUBLIC_CHANNEL, greeting);
+ }
+}
+ </script_editor>
+</floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_snapshot.xml b/indra/newview/skins/default/xui/pt/floater_snapshot.xml
index 4110e69068..3dd7f69d50 100755
--- a/indra/newview/skins/default/xui/pt/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/pt/floater_snapshot.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Snapshot" title="VISUALIZAR FOTO">
+<floater name="Snapshot" title="FOTO">
<floater.string name="unknown">
desconhecido
</floater.string>
@@ -61,5 +61,11 @@
<check_box label="HUDs" name="hud_check"/>
<check_box label="Gerar quadro (tela inteira)" name="freeze_frame_check"/>
<check_box label="Atualização automática" name="auto_snapshot_check"/>
+ <text name="filter_list_label">
+ Filtro:
+ </text>
+ <combo_box name="filters_combobox" tool_tip="Filtros de imagem">
+ <combo_box.item label="Sem filtro" name="NoFilter"/>
+ </combo_box>
</panel>
</floater>
diff --git a/indra/newview/skins/default/xui/pt/floater_stats.xml b/indra/newview/skins/default/xui/pt/floater_stats.xml
index be53624145..f41fe17778 100755
--- a/indra/newview/skins/default/xui/pt/floater_stats.xml
+++ b/indra/newview/skins/default/xui/pt/floater_stats.xml
@@ -4,17 +4,21 @@
<container_view name="statistics_view">
<stat_view label="Básico" name="basic">
<stat_bar label="FPS" name="fps"/>
- <stat_bar label="Bandwidth" name="bandwidth"/>
+ <stat_bar label="Dados de UDP recebidos" name="bandwidth"/>
<stat_bar label="Bandwidth" name="packet_loss"/>
<stat_bar label="Ping Sim" name="ping"/>
</stat_view>
<stat_view label="Avançado" name="advanced">
<stat_view label="Render" name="render">
- <stat_bar label="KTris desenhados por quadro" name="ktrisframe"/>
- <stat_bar label="KTris desenhados por segundo" name="ktrissec"/>
- <stat_bar label="Total Objects" name="objs"/>
+ <stat_bar label="KTris por quadro" name="ktrisframe"/>
+ <stat_bar label="KTris por segundo" name="ktrissec"/>
+ <stat_bar label="Objetos totais" name="totalobjs"/>
+ <stat_bar label="Objetos em cache" name="cachedobjs"/>
<stat_bar label="New Objects" name="newobjs"/>
<stat_bar label="Taxa de acertos do cache do objeto" name="object_cache_hits"/>
+ <stat_bar label="Consultas de oclusão realizadas" name="occlusion_queries"/>
+ <stat_bar label="Objetos ocultos" name="occluded"/>
+ <stat_bar label="Objeto não oculto" name="unoccluded"/>
</stat_view>
<stat_view label="Texture" name="texture">
<stat_bar label="Taxa de acertos do cache" name="texture_cache_hits"/>
@@ -26,15 +30,32 @@
<stat_bar label="Raw Mem" name="rawmemstat"/>
<stat_bar label="Bound Mem" name="glboundmemstat"/>
</stat_view>
+ <stat_view label="Uso de memória" name="memory">
+ <stat_bar label="LLTrace" name="LLTrace"/>
+ <stat_bar label="Interface" name="LLView"/>
+ <stat_bar label="Fontes" name="LLFontFreetype"/>
+ <stat_bar label="Inventário" name="LLInventoryObject"/>
+ <stat_bar label="Objetos do visualizador" name="LLViewerObject"/>
+ <stat_bar label="Dados do grupo de octrees" name="LLViewerOctreeGroup"/>
+ <stat_bar label="Dados da octree" name="LLViewerOctreeEntry"/>
+ <stat_bar label="Cache de objetos do visualizador" name="LLVOCacheEntry"/>
+ <stat_bar label="Drawables" name="LLDrawable"/>
+ <stat_bar label="Dados do rosto" name="LLFace"/>
+ <stat_bar label="Informações de desenho" name="LLDrawInfo"/>
+ <stat_bar label="Dados de textura" name="LLTexture"/>
+ <stat_bar label="Dados de imagem" name="LLImage"/>
+ <stat_bar label="Dados de imagem do GL" name="LLImageGL"/>
+ <stat_bar label="Buffers do Vertex" name="LLVertexBuffer"/>
+ </stat_view>
<stat_view label="Rede" name="network">
<stat_bar label="Packets In" name="packetsinstat"/>
<stat_bar label="Packets Out" name="packetsoutstat"/>
- <stat_bar label="Objects" name="objectkbitstat"/>
- <stat_bar label="Texture" name="texturekbitstat"/>
- <stat_bar label="Asset" name="assetkbitstat"/>
- <stat_bar label="Layers" name="layerskbitstat"/>
- <stat_bar label="Actual In" name="actualinkbitstat"/>
- <stat_bar label="Actual Out" name="actualoutkbitstat"/>
+ <stat_bar label="Objetos" name="objectdatareceived"/>
+ <stat_bar label="Textura" name="texturedatareceived"/>
+ <stat_bar label="Asset" name="assetudpdatareceived"/>
+ <stat_bar label="Layers" name="layersdatareceived"/>
+ <stat_bar label="Actual In" name="messagedatain"/>
+ <stat_bar label="Actual Out" name="messagedataout"/>
<stat_bar label="Operações pendentes do VFS" name="vfspendingoperations"/>
</stat_view>
</stat_view>
@@ -53,7 +74,8 @@
<stat_bar label="Etapas de silhueta ignoradas" name="simsimskippedsilhouettesteps"/>
<stat_bar label="Personagens atualizados" name="simsimpctsteppedcharacters"/>
</stat_view>
- <stat_view label="Time (ms)" name="simperf">
+ <stat_bar label="Total de dados não reconhecidos" name="simtotalunackedbytes"/>
+ <stat_view label="Hora" name="simperf">
<stat_bar label="Total Frame Time" name="simframemsec"/>
<stat_bar label="Net Time" name="simnetmsec"/>
<stat_bar label="Physics Time" name="simsimphysicsmsec"/>
@@ -62,7 +84,7 @@
<stat_bar label="Images Time" name="simimagesmsec"/>
<stat_bar label="Script Time" name="simscriptmsec"/>
<stat_bar label="Tempo restante" name="simsparemsec"/>
- <stat_view label="Detalhes de tempo (ms)" name="timedetails">
+ <stat_view label="Detalhes de hora" name="timedetails">
<stat_bar label="Etapa física" name="simsimphysicsstepmsec"/>
<stat_bar label="Atualizar formas físicas" name="simsimphysicsshapeupdatemsec"/>
<stat_bar label="Física - outros" name="simsimphysicsothermsec"/>
diff --git a/indra/newview/skins/default/xui/pt/floater_tools.xml b/indra/newview/skins/default/xui/pt/floater_tools.xml
index 66c14cdecf..356063a94f 100755
--- a/indra/newview/skins/default/xui/pt/floater_tools.xml
+++ b/indra/newview/skins/default/xui/pt/floater_tools.xml
@@ -72,7 +72,7 @@
<check_box label="Editar partes linkadas" name="checkbox edit linked parts"/>
<button label="Link" name="link_btn"/>
<button label="Desconectar links" name="unlink_btn"/>
- <check_box label="" name="checkbox uniform"/>
+ <check_box label="Esticar ambos lados" name="checkbox uniform"/>
<text label="Esticar ambos lados" name="checkbox uniform label">
Esticar ambos lados
</text>
diff --git a/indra/newview/skins/default/xui/pt/floater_twitter.xml b/indra/newview/skins/default/xui/pt/floater_twitter.xml
new file mode 100644
index 0000000000..4d7f9e323c
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/floater_twitter.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_twitter" title="TWITTER">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="REDIGIR" name="panel_twitter_photo"/>
+ <panel label="CONTA" name="panel_twitter_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ Erro
+ </text>
+ <text name="connection_loading_text">
+ Carregando...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/pt/menu_avatar_icon.xml b/indra/newview/skins/default/xui/pt/menu_avatar_icon.xml
index beba969b7e..f6211790a8 100755
--- a/indra/newview/skins/default/xui/pt/menu_avatar_icon.xml
+++ b/indra/newview/skins/default/xui/pt/menu_avatar_icon.xml
@@ -2,6 +2,7 @@
<menu name="Avatar Icon Menu">
<menu_item_call label="Ver perfil" name="Show Profile"/>
<menu_item_call label="Enviar MI..." name="Send IM"/>
+ <menu_item_call label="Solicitar teletransporte" name="Request Teleport"/>
<menu_item_call label="Adicionar amigo..." name="Add Friend"/>
<menu_item_call label="Remover amigo..." name="Remove Friend"/>
</menu>
diff --git a/indra/newview/skins/default/xui/pt/menu_conversation.xml b/indra/newview/skins/default/xui/pt/menu_conversation.xml
index 2dd150a61e..d594f3313f 100644
--- a/indra/newview/skins/default/xui/pt/menu_conversation.xml
+++ b/indra/newview/skins/default/xui/pt/menu_conversation.xml
@@ -29,4 +29,5 @@
<menu_item_call label="Silenciar todos" name="ModerateVoiceMute"/>
<menu_item_call label="Desfazer silenciar para todos" name="ModerateVoiceUnmute"/>
</context_menu>
+ <menu_item_call label="Banir membro" name="BanMember"/>
</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/pt/menu_inventory.xml b/indra/newview/skins/default/xui/pt/menu_inventory.xml
index a3a648eb34..636b356c8b 100755
--- a/indra/newview/skins/default/xui/pt/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/pt/menu_inventory.xml
@@ -70,6 +70,7 @@
<menu_item_call label="Executar som" name="Sound Play"/>
<menu_item_call label="Copiar SLurl" name="url_copy"/>
<menu_item_call label="Sobre o marco" name="About Landmark"/>
+ <menu_item_call label="Mostrar no mapa" name="show_on_map"/>
<menu_item_call label="Executar animação" name="Animation Play"/>
<menu_item_call label="Executar áudio" name="Animation Audition"/>
<menu_item_call label="Mandar MI" name="Send Instant Message"/>
diff --git a/indra/newview/skins/default/xui/pt/menu_login.xml b/indra/newview/skins/default/xui/pt/menu_login.xml
index cd840f3137..29dae6292a 100755
--- a/indra/newview/skins/default/xui/pt/menu_login.xml
+++ b/indra/newview/skins/default/xui/pt/menu_login.xml
@@ -5,7 +5,15 @@
<menu_item_call label="Sair do [APP_NAME]" name="Quit"/>
</menu>
<menu label="Ajuda" name="Help">
- <menu_item_call label="Ajuda do [SECOND_LIFE]" name="Second Life Help"/>
+ <menu_item_call label="Como..." name="How To"/>
+ <menu_item_call label="Início rápido" name="Quickstart"/>
+ <menu_item_call label="Base de conhecimento" name="Knowledge Base"/>
+ <menu_item_call label="Wiki" name="Wiki"/>
+ <menu_item_call label="Fóruns da comunidade" name="Community Forums"/>
+ <menu_item_call label="Portal de suporte" name="Support portal"/>
+ <menu_item_call label="Notícias do [SECOND_LIFE]" name="Second Life News"/>
+ <menu_item_call label="Blogs do [SECOND_LIFE]" name="Second Life Blogs"/>
+ <menu_item_call label="Relatar bug" name="Report Bug"/>
<menu_item_call label="Sobre [APP_NAME]" name="About Second Life"/>
</menu>
<menu_item_check label="Exibir menu de depuração" name="Show Debug Menu"/>
diff --git a/indra/newview/skins/default/xui/pt/menu_object.xml b/indra/newview/skins/default/xui/pt/menu_object.xml
index a552a5de5a..47b08a170c 100755
--- a/indra/newview/skins/default/xui/pt/menu_object.xml
+++ b/indra/newview/skins/default/xui/pt/menu_object.xml
@@ -21,6 +21,7 @@
<context_menu label="Gerenciar" name="Remove">
<menu_item_call label="Denunciar abuso" name="Report Abuse..."/>
<menu_item_call label="Bloquear" name="Object Mute"/>
+ <menu_item_call label="Desbloquear" name="Object Unmute"/>
<menu_item_call label="Devolver" name="Return..."/>
</context_menu>
<menu_item_call label="Pegar" name="Pie Object Take"/>
diff --git a/indra/newview/skins/default/xui/pt/menu_teleport_history_item.xml b/indra/newview/skins/default/xui/pt/menu_teleport_history_item.xml
index ec1e7a0950..3a2b3a8847 100755
--- a/indra/newview/skins/default/xui/pt/menu_teleport_history_item.xml
+++ b/indra/newview/skins/default/xui/pt/menu_teleport_history_item.xml
@@ -2,5 +2,5 @@
<context_menu name="Teleport History Item Context Menu">
<menu_item_call label="Teletransportar" name="Teleport"/>
<menu_item_call label="Mais informações" name="More Information"/>
- <menu_item_call label="Copiar" name="CopyToClipboard"/>
+ <menu_item_call label="Copiar SLurl" name="CopyToClipboard"/>
</context_menu>
diff --git a/indra/newview/skins/default/xui/pt/menu_viewer.xml b/indra/newview/skins/default/xui/pt/menu_viewer.xml
index e6eceb5f2f..a761cfa177 100755
--- a/indra/newview/skins/default/xui/pt/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/pt/menu_viewer.xml
@@ -36,6 +36,9 @@
<menu_item_check label="Bate-papo local..." name="Nearby Chat"/>
<menu_item_check label="Falar" name="Speak"/>
<menu_item_check label="Registro de conversas..." name="Conversation Log..."/>
+ <menu_item_call label="Facebook..." name="Facebook"/>
+ <menu_item_call label="Twitter..." name="Twitter"/>
+ <menu_item_call label="Flickr..." name="Flickr"/>
<menu label="Distorção de voz" name="VoiceMorphing">
<menu_item_check label="Não distorcer voz" name="NoVoiceMorphing"/>
<menu_item_check label="Visualizar..." name="Preview"/>
@@ -72,11 +75,11 @@
<menu_item_check label="Menu avançado" name="Show Advanced Menu"/>
</menu>
<menu label="Sol" name="Sun">
- <menu_item_call label="Amanhecer" name="Sunrise"/>
- <menu_item_call label="Meio-dia" name="Noon"/>
- <menu_item_call label="Pôr-do-sol" name="Sunset"/>
- <menu_item_call label="Meia-noite" name="Midnight"/>
- <menu_item_call label="Usar configurações da região" name="Use Region Settings"/>
+ <menu_item_check label="Amanhecer" name="Sunrise"/>
+ <menu_item_check label="Meio-dia" name="Noon"/>
+ <menu_item_check label="Pôr-do-sol" name="Sunset"/>
+ <menu_item_check label="Meia-noite" name="Midnight"/>
+ <menu_item_check label="Usar configurações da região" name="Use Region Settings"/>
</menu>
<menu label="Editor de ambientes" name="Environment Editor">
<menu_item_call label="Configurações do ambiente..." name="Environment Settings"/>
@@ -150,7 +153,8 @@
<menu_item_check label="Encaixar em grade" name="Snap to Grid"/>
<menu_item_call label="Encaixar objeto XY em grade" name="Snap Object XY to Grid"/>
<menu_item_call label="Usar seleção em grade" name="Use Selection for Grid"/>
- <menu_item_call label="Opções de grade" name="Grid Options"/>
+ <menu_item_call label="Opções de grade..." name="Grid Options"/>
+ <menu_item_call label="Definir permissões padrão..." name="Set default permissions"/>
</menu>
<menu label="Upload" name="Upload">
<menu_item_call label="Imagem (L$[COST])..." name="Upload Image"/>
@@ -158,15 +162,12 @@
<menu_item_call label="Animação (L$[COST])..." name="Upload Animation"/>
<menu_item_call label="Modelar..." name="Upload Model"/>
<menu_item_call label="Volume (L$[COST] por arquivo)..." name="Bulk Upload"/>
- <menu_item_call label="Autorizações de upload padrão" name="perm prefs"/>
</menu>
<menu_item_call label="Desfazer" name="Undo"/>
<menu_item_call label="Repetir" name="Redo"/>
</menu>
<menu label="Ajuda" name="Help">
<menu_item_call label="Como..." name="How To"/>
- <menu_item_call label="[SECOND_LIFE] Ajuda" name="Second Life Help"/>
- <menu_item_call label="Guia do usuário" name="User’s guide"/>
<menu_item_call label="Base de conhecimento" name="Knowledge Base"/>
<menu_item_call label="Wiki" name="Wiki"/>
<menu_item_call label="Fóruns da comunidade" name="Community Forums"/>
@@ -188,6 +189,7 @@
<menu label="Ferramentas de desempenho" name="Performance Tools">
<menu_item_call label="Medidor de lag" name="Lag Meter"/>
<menu_item_check label="Barra de estatísticas" name="Statistics Bar"/>
+ <menu_item_call label="Estatísticas de carregamento de cena" name="Scene Load Statistics"/>
<menu_item_check label="Mostrar peso do desenho para avatares" name="Avatar Rendering Cost"/>
</menu>
<menu label="Realces e visibilidade" name="Highlighting and Visibility">
@@ -249,6 +251,7 @@
<menu_item_check label="Tempos" name="Fast Timers"/>
<menu_item_check label="Memória" name="Memory"/>
<menu_item_check label="Estatísticas da cena" name="Scene Statistics"/>
+ <menu_item_check label="Monitor de carregamento de cena" name="Scene Loading Monitor"/>
<menu_item_call label="Painel de depuração de obtenção de textura" name="Texture Fetch Debug Console"/>
<menu_item_call label="Region Info to Debug Console" name="Region Info to Debug Console"/>
<menu_item_check label="Câmera:" name="Camera"/>
@@ -280,6 +283,7 @@
<menu_item_check label="Taxa de quadros aleatória" name="Randomize Framerate"/>
<menu_item_check label="Frame Test" name="Frame Test"/>
<menu_item_call label="Perfil do quadro" name="Frame Profile"/>
+ <menu_item_call label="Benchmark" name="Benchmark"/>
</menu>
<menu label="Render Metadata" name="Render Metadata">
<menu_item_check label="Normais" name="Normals"/>
@@ -287,6 +291,8 @@
<menu_item_check label="Tipo de atualização" name="Update Type"/>
<menu_item_check label="Dados LOD" name="LOD Info"/>
<menu_item_check label="Fila de construção" name="Build Queue"/>
+ <menu_item_check label="Partículas" name="Particles"/>
+ <menu_item_check label="Junções" name="Joints"/>
<menu_item_check label="Vetores de vento" name="Wind Vectors"/>
<menu_item_check label="Renderizar complexidade" name="rendercomplexity"/>
<menu_item_check label="Bytes do anexo" name="attachment bytes"/>
@@ -312,6 +318,7 @@
<menu_item_check label="Render Attached Lights" name="Render Attached Lights"/>
<menu_item_check label="Render Attached Particles" name="Render Attached Particles"/>
<menu_item_check label="Objetos iridescentes" name="Hover Glow Objects"/>
+ <menu_item_call label="Limpar cache imediatamente" name="Cache Clear"/>
</menu>
<menu label="Rede" name="Network">
<menu_item_check label="Pausar avatar" name="AgentPause"/>
@@ -327,7 +334,6 @@
<menu_item_call label="Teste de mídia do navegador" name="Web Browser Test"/>
<menu_item_call label="Navegador de conteúdo web" name="Web Content Browser"/>
<menu_item_call label="Print Selected Object Info" name="Print Selected Object Info"/>
- <menu_item_check label="Console de depuração de região" name="Region Debug Console"/>
<menu_item_check label="Debug Clicks" name="Debug Clicks"/>
<menu_item_check label="Debug Mouse Events" name="Debug Mouse Events"/>
</menu>
diff --git a/indra/newview/skins/default/xui/pt/notifications.xml b/indra/newview/skins/default/xui/pt/notifications.xml
index d5096ec858..00c0b13670 100755
--- a/indra/newview/skins/default/xui/pt/notifications.xml
+++ b/indra/newview/skins/default/xui/pt/notifications.xml
@@ -113,15 +113,15 @@ Consulte o [[MARKETPLACE_IMPORTS_URL] log de erros] para mais informações.
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="OutboxImportFailed">
- Falha de transferência
+ Falha na transferência com o erro &apos;[ERROR_CODE]&apos;
-Nenhuma pasta enviada para o Mercado devido a um erro do sistema ou da rede. Tente novamente mais tarde.
+Nenhuma pasta foi enviada ao Marketplace devido a um erro do sistema ou da rede. Tente novamente mais tarde.
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="OutboxInitFailed">
- Falha na inicialização do Mercado
+ Falha na inicialização do Marketplace com o erro &apos;[ERROR_CODE]&apos;
-Falha na inicialização do mercado devido a um erro do sistema ou da rede. Tente novamente mais tarde.
+Ocorreu uma falha na inicialização do Marketplace devido a um erro do sistema ou da rede. Tente novamente mais tarde.
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="CompileQueueSaveText">
@@ -209,6 +209,22 @@ Qualquer membro numa função com esta habilidade, pode atribuir a sí mesmo --
Adicionar esta habilidade a &apos;[ROLE_NAME]&apos;?
<usetemplate name="okcancelbuttons" notext="Não" yestext="Sim"/>
</notification>
+ <notification name="AssignBanAbilityWarning">
+ Você está prestes a adicionar a função &apos;[ACTION_NAME]&apos; ao cargo &apos;[ROLE_NAME]&apos;.
+
+ *AVISO*
+Qualquer membro em um cargo com essa função também terá as funções &apos;[ACTION_NAME_2]&apos; e &apos;[ACTION_NAME_3]&apos;
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
+ <notification name="RemoveBanAbilityWarning">
+ Você está removendo a função &apos;[ACTION_NAME]&apos; do cargo &apos;[ROLE_NAME]&apos;.
+
+ *AVISO*
+Remover essa função NÃO removerá as funções &apos;[ACTION_NAME_2]&apos; e &apos;[ACTION_NAME_3]&apos;.
+
+Se você não quiser que essas funções sejam concedidas a esse cargo, desative-as imediatamente.
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
<notification name="EjectGroupMemberWarning">
Você está prestes a expulsar [AVATAR_NAME] do grupo.
<usetemplate ignoretext="Confirmar expulsão de um participante do grupo" name="okcancelignore" notext="Cancelar" yestext="Expulsar"/>
@@ -1570,6 +1586,14 @@ consulte a informação [[INFO_URL] sobre essa atualização]
Não foi possível deixar o grupo. Você não pode deixar o grupo pois é o último proprietário dele. Primeiramente, atribua outro membro à função de proprietário.
<usetemplate name="okbutton" yestext="OK"/>
</notification>
+ <notification name="GroupDepartError">
+ Não foi possível deixar o grupo: [reason].
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
+ <notification name="GroupDepart">
+ Você deixou o grupo [group_name].
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
<notification name="ConfirmKick">
Tem CERTEZA de que deseja expulsar todos os residentes do grid?
<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="Chutar todos"/>
@@ -1722,6 +1746,10 @@ Por favor volte mais tarde.
Tem certeza de quer ser teletransportado para &lt;nolink&gt;[LOCATION]&lt;/nolink&gt;?
<usetemplate ignoretext="Confirmar se eu quero ser teletransportado para marcos" name="okcancelignore" notext="Cancelar" yestext="Teletransportar"/>
</notification>
+ <notification name="TeleportViaSLAPP">
+ Tem certeza de quer ser teletransportado para &lt;nolink&gt;[LOCATION]&lt;/nolink&gt;?
+ <usetemplate ignoretext="Confirmo que desejo me teleportar via SLAPP" name="okcancelignore" notext="Cancelar" yestext="Teletransportar"/>
+ </notification>
<notification name="TeleportToPick">
Teletransportar para [PICK]?
<usetemplate ignoretext="Confirmar se eu quero ser teletransportado para Destaques" name="okcancelignore" notext="Cancelar" yestext="Teletransportar"/>
@@ -1932,6 +1960,9 @@ Isto mudará milhares de regiões e fará o spaceserver soluçar.
<notification name="ProblemAddingEstateManager">
Problemas em adicionar um novo gerente da propriedade. Uma ou mais propriedades podem ter uma lista de gerentes cheia.
</notification>
+ <notification name="ProblemAddingEstateBanManager">
+ Não é possível adicionar proprietários ou gerentes de terreno à lista de bloqueio.
+ </notification>
<notification name="ProblemAddingEstateGeneric">
Problemas em adicionar a esta lista de propriedades. Uma ou mais propriedades podem ter uma lista cheia.
</notification>
@@ -2444,6 +2475,12 @@ Selecione só um objeto.
<notification name="SystemMessage">
[MESSAGE]
</notification>
+ <notification name="FlickrConnect">
+ [MESSAGE]
+ </notification>
+ <notification name="TwitterConnect">
+ [MESSAGE]
+ </notification>
<notification name="PaymentReceived">
[MESSAGE]
</notification>
@@ -3012,19 +3049,25 @@ Mais detalhes no log.
Não foi possível obter o recurso &apos;[CAPABILITY]&apos; da região.
</notification>
<notification name="ShareItemsConfirmation">
- Tem certeza de que quer compartilhar os itens abaixo?
+ Tem certeza de que deseja compartilhar os itens abaixo?
&lt;nolink&gt;[ITEMS]&lt;/nolink&gt;
Com os seguintes residentes:
-[RESIDENTS]
+&lt;nolink&gt;[RESIDENTS]&lt;/nolink&gt;
<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/>
</notification>
<notification name="ShareFolderConfirmation">
- Apenas uma pasta pode ser compartilhada por vez.
+ É possível compartilhar apenas uma pasta de cada vez.
+
+Tem certeza de que deseja compartilhar os itens abaixo?
+
+&lt;nolink&gt;[ITEMS]&lt;/nolink&gt;
+
+Com os seguintes residentes:
-Tem certeza de que quer compartilhar os itens abaixo?
+&lt;nolink&gt;[RESIDENTS]&lt;/nolink&gt;
<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="OK"/>
</notification>
<notification name="ItemsShared">
@@ -3478,10 +3521,6 @@ Tente novamente em instantes.
<notification name="EjectComingSoon">
Você não tem mais permissão para ficar aqui e tem [EJECT_TIME] segundos para sair.
</notification>
- <notification name="NoEnterServerFull">
- Você não pode entrar nesta região porque
-o servidor está cheio.
- </notification>
<notification name="SaveBackToInvDisabled">
Salvar no inventário foi desativado.
</notification>
@@ -3671,6 +3710,9 @@ o servidor está cheio.
<notification name="LinkFailedTooMuchPhysics">
O objeto usa muitos recursos físicos – sua dinâmica foi desativada.
</notification>
+ <notification name="EstateManagerFailedllTeleportHome">
+ O objeto &apos;[OBJECT_NAME]&apos; em [SLURL] não pode teleportar gerentes de terreno de volta para casa.
+ </notification>
<notification name="TeleportedHomeByObjectOnParcel">
Você foi teletransportado para seu início pelo objeto &apos;[OBJECT_NAME]&apos; no lote &apos;[PARCEL_NAME]&apos;
</notification>
@@ -3861,13 +3903,18 @@ o servidor está cheio.
Não há lotes alugados suficientes na seleção para reunir.
</notification>
<notification name="CantDivideLandMultipleParcelsSelected">
- Não é possível dividir o terreno.\nHá mais de um lote selecionado.\nTente selecionar um pedaço menor de terreno.
+ Não é possível dividir o terreno.
+Mais de um lote foi selecionado.
+Tente selecionar uma quantidade menor de terreno.
</notification>
<notification name="CantDivideLandCantFindParcel">
- Não é possível dividir o terreno.\nNão é possível encontrar o lote.\nComunique isso em Ajuda -&gt; Relatar bug...
+ Não é possível dividir o terreno.
+Não é possível encontrar o lote.
+Reporte em Ajuda -&gt; Relatar bug...
</notification>
<notification name="CantDivideLandWholeParcelSelected">
- Não é possível dividir o terreno. O lote inteiro está selecionado.\nTente selecionar um pedaço menor do terreno.
+ Não é possível dividir o terreno. Todo o lote foi selecionado.
+Tente selecionar uma quantidade menor de terreno.
</notification>
<notification name="LandHasBeenDivided">
O terreno foi dividido.
@@ -4007,4 +4054,12 @@ o servidor está cheio.
Não foi possível mover arquivos. Caminho anterior restaurado.
<usetemplate ignoretext="Não foi possível mover arquivos. Caminho anterior restaurado." name="okignore" yestext="OK"/>
</notification>
+ <notification name="DefaultObjectPermissions">
+ Ocorreu um problema ao salvar as permissões padrão devido ao seguinte motivo: [REASON]. Tente definir as permissões padrão mais tarde.
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
+ <notification name="ChatHistoryIsBusyAlert">
+ O arquivo de histórico de bate-papo está ocupado com uma operação anterior. Tente novamente em alguns minutos ou selecione outra pessoa para bater papo.
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
</notifications>
diff --git a/indra/newview/skins/default/xui/pt/panel_facebook_account.xml b/indra/newview/skins/default/xui/pt/panel_facebook_account.xml
new file mode 100644
index 0000000000..b449e7959d
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/panel_facebook_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_account">
+ <string name="facebook_connected" value="Você está conectado ao Facebook como:"/>
+ <string name="facebook_disconnected" value="Não conectado ao Facebook"/>
+ <text name="account_caption_label">
+ Não conectado ao Facebook.
+ </text>
+ <panel name="panel_buttons">
+ <button label="Conectar..." name="connect_btn"/>
+ <button label="Desconectar" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Facebook/ta-p/2149711 Aprenda a publicar no Facebook]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_facebook_friends.xml b/indra/newview/skins/default/xui/pt/panel_facebook_friends.xml
new file mode 100644
index 0000000000..9cb7a8b7d1
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/panel_facebook_friends.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_friends">
+ <string name="facebook_friends_empty" value="No momento, você não tem amigos do Facebook que também são residentes do Second Life. Convide seus amigos do Facebook para ingressar no Second Life hoje mesmo!"/>
+ <string name="facebook_friends_no_connected" value="No momento, você não está conectado ao Facebook. Vá para a aba Conta para se conectar e ativar esse recurso."/>
+ <accordion name="friends_accordion">
+ <accordion_tab name="tab_second_life_friends" title="Amigos do SL"/>
+ <accordion_tab name="tab_suggested_friends" title="Adicionar essas pessoas como amigos do SL"/>
+ </accordion>
+ <text name="facebook_friends_status">
+ Não conectado ao Facebook.
+ </text>
+</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_facebook_photo.xml b/indra/newview/skins/default/xui/pt/panel_facebook_photo.xml
new file mode 100644
index 0000000000..22615e0769
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/panel_facebook_photo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="Resolução da imagem">
+ <combo_box.item label="Janela atual" name="CurrentWindow"/>
+ <combo_box.item label="640x480" name="640x480"/>
+ <combo_box.item label="800x600" name="800x600"/>
+ <combo_box.item label="1024x768" name="1024x768"/>
+ <combo_box.item label="1200x630" name="1200x630"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="Filtros de imagem">
+ <combo_box.item label="Sem filtro" name="NoFilter"/>
+ </combo_box>
+ <button label="Atualizar" name="new_snapshot_btn" tool_tip="Clique para atualizar"/>
+ <button label="Visualizar" name="big_preview_btn" tool_tip="Clique para alternar entre visualizações"/>
+ <text name="caption_label">
+ Comentário (opcional):
+ </text>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="Postar" name="post_photo_btn"/>
+ <button label="Cancelar" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_facebook_place.xml b/indra/newview/skins/default/xui/pt/panel_facebook_place.xml
new file mode 100644
index 0000000000..97596d64c6
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/panel_facebook_place.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_place">
+ <layout_stack name="stack_place">
+ <layout_panel name="place_detail_panel">
+ <text name="place_caption_label">
+ Diga algo sobre onde você está:
+ </text>
+ </layout_panel>
+ <layout_panel name="place_map_panel">
+ <check_box initial_value="false" label="" name="add_place_view_cb"/>
+ </layout_panel>
+ <layout_panel name="place_button_panel">
+ <button label="Postar" name="post_place_btn"/>
+ <button label="Cancelar" name="cancel_place_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_facebook_status.xml b/indra/newview/skins/default/xui/pt/panel_facebook_status.xml
new file mode 100644
index 0000000000..251580666e
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/panel_facebook_status.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_status">
+ <layout_stack name="stack_status">
+ <layout_panel name="status_detail_panel">
+ <text name="status_caption_label">
+ No que você está pensando?
+ </text>
+ </layout_panel>
+ <layout_panel name="status_button_panel">
+ <button label="Postar" name="post_status_btn"/>
+ <button label="Cancelar" name="cancel_status_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_flickr_account.xml b/indra/newview/skins/default/xui/pt/panel_flickr_account.xml
new file mode 100644
index 0000000000..ed240b0013
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/panel_flickr_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_flickr_account">
+ <string name="flickr_connected" value="Você está conectado ao Flickr como:"/>
+ <string name="flickr_disconnected" value="Não conectado ao Flickr"/>
+ <text name="account_caption_label">
+ Não conectado ao Flickr.
+ </text>
+ <panel name="panel_buttons">
+ <button label="Conectar..." name="connect_btn"/>
+ <button label="Desconectar" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Flickr/ta-p/2435609 Aprenda a publicar no Flickr]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_flickr_photo.xml b/indra/newview/skins/default/xui/pt/panel_flickr_photo.xml
new file mode 100644
index 0000000000..77d8afb47c
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/panel_flickr_photo.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_flickr_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="Resolução da imagem">
+ <combo_box.item label="Janela atual" name="CurrentWindow"/>
+ <combo_box.item label="640x480" name="640x480"/>
+ <combo_box.item label="800x600" name="800x600"/>
+ <combo_box.item label="1024x768" name="1024x768"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="Filtros de imagem">
+ <combo_box.item label="Sem filtro" name="NoFilter"/>
+ </combo_box>
+ <button label="Atualizar" name="new_snapshot_btn" tool_tip="Clique para atualizar"/>
+ <button label="Visualizar" name="big_preview_btn" tool_tip="Clique para alternar entre visualizações"/>
+ <text name="title_label">
+ Título:
+ </text>
+ <text name="description_label">
+ Descrição:
+ </text>
+ <check_box initial_value="true" label="Incluir localização do SL no final da descrição" name="add_location_cb"/>
+ <text name="tags_label">
+ Tags:
+ </text>
+ <text name="tags_help_label">
+ Separe as tags com espaços
+Use &quot;&quot; para tags com várias palavras
+ </text>
+ <combo_box name="rating_combobox" tool_tip="Classificação de conteúdo do Flickr">
+ <combo_box.item label="Classificação segura do Flickr" name="SafeRating"/>
+ <combo_box.item label="Classificação moderada do Flickr" name="ModerateRating"/>
+ <combo_box.item label="Classificação restrita do Flickr" name="RestrictedRating"/>
+ </combo_box>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="Enviar" name="post_photo_btn"/>
+ <button label="Cancelar" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_group_bulk_ban.xml b/indra/newview/skins/default/xui/pt/panel_group_bulk_ban.xml
new file mode 100644
index 0000000000..20cc2fe6e6
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/panel_group_bulk_ban.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel label="Banir residentes" name="bulk_ban_panel">
+ <panel.string name="loading">
+ (carregando...)
+ </panel.string>
+ <panel.string name="ban_selection_too_large">
+ Os bloqueios do grupo não foram enviados: muitos residentes selecionados. Os banimentos do grupo são limitados a 100 por solicitação.
+ </panel.string>
+ <panel.string name="ban_not_permitted">
+ O banimento do grupo não foi enviado: você não tem a função &quot;Gerenciar lista de banidos&quot;.
+ </panel.string>
+ <panel.string name="ban_limit_fail">
+ O banimento do grupo não foi enviado: seu grupo atingiu o limite de banimentos.
+ </panel.string>
+ <panel.string name="partial_ban">
+ Alguns banimentos do grupo não foram enviados:
+[REASONS]
+ </panel.string>
+ <panel.string name="ban_failed">
+ Os banimentos do grupo não foram enviados:
+[REASONS]
+ </panel.string>
+ <panel.string name="residents_already_banned">
+ - O(s) seguinte(s) residente(s) já estão banidos: [RESIDENTS].
+ </panel.string>
+ <panel.string name="ban_limit_reached">
+ - Limite de banimentos atingido, os seguintes agentes não foram banidos: [RESIDENTS].
+ </panel.string>
+ <panel.string name="cant_ban_yourself">
+ - Você não pode banir a si próprio.
+ </panel.string>
+ <text name="help_text">
+ Selecione um ou mais residentes para banir do grupo. Clique em &quot;Abrir seletor de residentes&quot; para começar.
+ </text>
+ <button label="Abrir seletor de residentes" name="add_button"/>
+ <name_list name="banned_agent_list" tool_tip="Pressione Ctrl enquanto clica nos nomes dos residentes"/>
+ <button label="Remover selecionados da lista" name="remove_button" tool_tip="Exclui os residentes selecionados acima da lista de bloqueios"/>
+ <button label="Banir residentes" name="ban_button"/>
+ <button label="Cancelar" name="cancel_button"/>
+ <string name="GroupBulkBan">
+ Banimento do grupo
+ </string>
+</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/pt/panel_group_info_sidetray.xml
index 30c825723b..7d8531a482 100755
--- a/indra/newview/skins/default/xui/pt/panel_group_info_sidetray.xml
+++ b/indra/newview/skins/default/xui/pt/panel_group_info_sidetray.xml
@@ -20,7 +20,7 @@
<layout_panel name="group_accordions">
<accordion name="groups_accordion">
<accordion_tab name="group_general_tab" title="Geral"/>
- <accordion_tab name="group_roles_tab" title="Cargos"/>
+ <accordion_tab name="group_roles_tab" title="Funções e membros"/>
<accordion_tab name="group_notices_tab" title="Avisos"/>
<accordion_tab name="group_land_tab" title="Terrenos/Bens"/>
</accordion>
diff --git a/indra/newview/skins/default/xui/pt/panel_group_invite.xml b/indra/newview/skins/default/xui/pt/panel_group_invite.xml
index de057481de..08bd4a3b6b 100755
--- a/indra/newview/skins/default/xui/pt/panel_group_invite.xml
+++ b/indra/newview/skins/default/xui/pt/panel_group_invite.xml
@@ -22,7 +22,7 @@
Escolha que Função atribuir a eles:
</text>
<combo_box name="role_name" tool_tip="Selecione o cargo da lista de cargos que você pode designar a membros"/>
- <button label="Mandar convites" name="ok_button"/>
+ <button label="Enviar convites" name="invite_button"/>
<button label="Cancelar" name="cancel_button"/>
<string name="GroupInvitation">
Convite
diff --git a/indra/newview/skins/default/xui/pt/panel_group_roles.xml b/indra/newview/skins/default/xui/pt/panel_group_roles.xml
index 11a31570d1..162c4743ec 100755
--- a/indra/newview/skins/default/xui/pt/panel_group_roles.xml
+++ b/indra/newview/skins/default/xui/pt/panel_group_roles.xml
@@ -19,15 +19,18 @@
<name_list.columns label="Membro" name="name"/>
<name_list.columns label="Doações" name="donated"/>
<name_list.columns label="Status" name="online"/>
+ <name_list.columns label="Título" name="title"/>
</name_list>
- <button label="Convidar" name="member_invite" />
+ <button label="Convidar" name="member_invite"/>
<button label="Ejetar" name="member_eject"/>
+ <button label="Banir membro(s)" name="member_ban"/>
</panel>
<panel label="CARGOS" name="roles_sub_tab">
<panel.string name="help_text">
- Cada cargo tem um nome e uma lista das funções que membros designados podem desempenhar.
- Os membros podem ter um ou mais cargos.
- Cada grupo pode ter 10 cargos, incluindo Membro e Dono do Grupo.
+ Os cargos têm um título e uma lista de funções permitidas
+ que os membros podem realizar. Os membros podem pertencer a
+ um ou mais cargos. Um grupo pode ter até 10 cargos,
+ inclusive Todos e Proprietário.
</panel.string>
<panel.string name="cant_delete_role">
As funções &apos;Todos&apos; e &apos;Owners&apos; são especiais e não podem ser apagadas.
@@ -46,12 +49,27 @@
</panel>
<panel height="148" label="FUNÇÕES" name="actions_sub_tab" tool_tip="Você pode ver a descrição de uma função e quais cargos e membros podem desempenhá-la.">
<panel.string name="help_text">
- As habilidades permitem que os membros nas funções façam coisas específicas dentro do grupo.
-Há uma grande variedade de habilidades.
+ As funções permitem que os membros em cargos realizem
+ tarefas específicas neste grupo. Existem diversas funções.
</panel.string>
<filter_editor label="Filtrar por função" name="filter_input"/>
<scroll_list bottom_delta="-120" height="118" name="action_list" tool_tip="Selecione uma função para ver mais detalhes"/>
</panel>
+ <panel label="RESIDENTES BANIDOS" name="banlist_sub_tab" tool_tip="Visualizar os residentes banidos deste grupo.">
+ <panel.string name="help_text">
+ Qualquer residente na lista de banidos não poderá entrar no grupo.
+ </panel.string>
+ <panel.string name="ban_count_template">
+ Número de banimentos: [COUNT]/[LIMIT]
+ </panel.string>
+ <name_list name="ban_list">
+ <name_list.columns label="Residente" name="name"/>
+ <name_list.columns label="Data do banimento" name="ban_date"/>
+ </name_list>
+ <button label="Banir residente(s)" name="ban_create" tool_tip="Banir residentes do seu grupo"/>
+ <button label="Cancelar banimento(s)" name="ban_delete" tool_tip="Cancelar o banimento de residentes selecionados do seu grupo"/>
+ <button name="ban_refresh" tool_tip="Atualizar a lista de banidos"/>
+ </panel>
</tab_container>
<panel name="members_footer">
<text name="static">
diff --git a/indra/newview/skins/default/xui/pt/panel_login.xml b/indra/newview/skins/default/xui/pt/panel_login.xml
index d7e9fa76ea..8ac3e57c4c 100755
--- a/indra/newview/skins/default/xui/pt/panel_login.xml
+++ b/indra/newview/skins/default/xui/pt/panel_login.xml
@@ -1,46 +1,27 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8"?>
<panel name="panel_login">
<panel.string name="forgot_password_url">
http://secondlife.com/account/request.php?lang=pt
</panel.string>
- <layout_stack name="login_widgets">
- <layout_panel name="login">
- <text name="log_in_text">
- LOGIN
- </text>
- <text name="username_text">
- Nome de usuário:
- </text>
- <combo_box name="username_combo" tool_tip="O nome de usuário que você escolheu ao fazer seu cadastro, como zecazc12 or Magia Solar"/>
- <text name="password_text">
- Senha:
- </text>
- </layout_panel>
- <layout_panel name="start_location_panel">
- <text name="start_location_text">
- Começar em:
- </text>
- <combo_box name="start_location_combo">
- <combo_box.item label="Última posição" name="MyLastLocation"/>
- <combo_box.item label="Minha casa" name="MyHome"/>
- <combo_box.item label="&lt;Digite o nome da região&gt;" name="Typeregionname"/>
- </combo_box>
- </layout_panel>
- <layout_panel name="links_login_panel">
- <text name="login_help">
- Precisa de ajuda com o login?
- </text>
+ <layout_stack name="ui_stack">
+ <layout_panel name="ui_container">
+ <combo_box label="Nome de usuário" name="username_combo" tool_tip="O nome de usuário que você escolheu ao fazer seu cadastro, como zecazc12 ou Magia Solar"/>
+ <line_editor label="Senha" name="password_edit"/>
+ <check_box label="Lembrar-me" name="remember_check"/>
<text name="forgot_password_text">
- Esqueceu seu nome ou senha?
+ Senha esquecida
</text>
<button label="Login" name="connect_btn"/>
- <check_box label="Lembrar senha" name="remember_check"/>
- </layout_panel>
- <layout_panel name="links">
- <text name="create_account_text">
- CRIE SUA CONTA
+ <text name="At_My_Last_Location_Label">
+ no último local
</text>
- <button label="Comece agora" name="create_new_account_btn"/>
+ <combo_box label="Meus locais favoritos" name="start_location_combo">
+ <combo_box.item label="Minha casa" name="MyHome"/>
+ </combo_box>
+ <button label="Login" name="connect_favorite_btn"/>
+ <line_editor label="Digite um local" name="location_edit"/>
+ <button label="Login" name="connect_location_btn"/>
+ <combo_box label="Selecionar grade" name="server_combo"/>
</layout_panel>
</layout_stack>
</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_login_first.xml b/indra/newview/skins/default/xui/pt/panel_login_first.xml
new file mode 100644
index 0000000000..6e4ef65bea
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/panel_login_first.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_login">
+ <panel.string name="forgot_password_url">
+ http://secondlife.com/account/request.php?lang=pt
+ </panel.string>
+ <layout_stack name="logo_stack">
+ <layout_panel name="parent_panel2">
+ <layout_stack name="widget_stack">
+ <layout_panel name="widget_container">
+ <combo_box label="Nome de usuário" name="username_combo" tool_tip="O nome de usuário que você escolheu ao fazer seu cadastro, como zecazc12 ou Magia Solar"/>
+ <line_editor label="Senha" name="password_edit"/>
+ <button label="Login" name="connect_btn"/>
+ <check_box label="Lembrar-me" name="remember_check"/>
+ <text name="forgot_password_text">
+ Senha esquecida
+ </text>
+ </layout_panel>
+ </layout_stack>
+ </layout_panel>
+ <layout_panel name="parent_panel3">
+ <layout_stack name="images_stack">
+ <layout_panel name="images_container">
+ <text name="image_caption_left">
+ Sua primeira parada é a Ilha da Educação. Encontre o portal de saída!
+ </text>
+ <text name="image_caption_right">
+ Em seguida, explore a Ilha Social e encontre novos residentes!
+ </text>
+ </layout_panel>
+ </layout_stack>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/pt/panel_preferences_advanced.xml
index c72928fc35..3ea592a957 100755
--- a/indra/newview/skins/default/xui/pt/panel_preferences_advanced.xml
+++ b/indra/newview/skins/default/xui/pt/panel_preferences_advanced.xml
@@ -28,4 +28,5 @@
<check_box label="Mostrar grade selecionada ao entrar" name="show_grid_selection_check"/>
<check_box label="Exibir menu avançado" name="show_advanced_menu_check"/>
<check_box label="Exibir menu desenvolvedor" name="show_develop_menu_check"/>
+ <button label="Permissões de criação padrão" name="default_creation_permissions"/>
</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_preferences_general.xml b/indra/newview/skins/default/xui/pt/panel_preferences_general.xml
index 8a0495f9bb..68fbd049b1 100755
--- a/indra/newview/skins/default/xui/pt/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/pt/panel_preferences_general.xml
@@ -30,14 +30,10 @@
<combo_box.item label="Geral e Moderado" name="Desired_Mature"/>
<combo_box.item label="Geral" name="Desired_PG"/>
</combo_box>
- <text name="start_location_textbox">
- Posição inicial:
+ <check_box label="Mostrar locais favoritos na tela de logon" name="favorites_on_login_check"/>
+ <text name="favorites_check_extra_text">
+ (Outras pessoas que usarem esse computador também poderão vê-los)
</text>
- <combo_box name="start_location_combo">
- <combo_box.item label="Última localização" name="MyLastLocation" tool_tip="Voltar ao lugar onde estava antes."/>
- <combo_box.item label="Meu início" name="MyHome" tool_tip="Voltar ao meu início."/>
- </combo_box>
- <check_box initial_value="true" label="Mostrar ao entrar" name="show_location_checkbox"/>
<text name="name_tags_textbox">
Mostrar nomes:
</text>
diff --git a/indra/newview/skins/default/xui/pt/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/pt/panel_preferences_privacy.xml
index d7fb585e35..78323fc47d 100755
--- a/indra/newview/skins/default/xui/pt/panel_preferences_privacy.xml
+++ b/indra/newview/skins/default/xui/pt/panel_preferences_privacy.xml
@@ -7,7 +7,7 @@
<text name="cache_size_label_l">
(Locações, imagens, web, histórico de busca)
</text>
- <check_box label="Mostrar nos resultados de busca" name="online_searchresults"/>
+ <check_box label="Exibir meu perfil em resultados de Pesquisa" name="online_searchresults"/>
<check_box label="Apenas amigos e grupos sabem que estou online" name="online_visibility"/>
<check_box label="Apenas amigos e grupos podem me chamar ou enviar MI" name="voice_call_friends_only_check"/>
<check_box label="Desligar o microfone quando terminar chamadas" name="auto_disengage_mic_check"/>
diff --git a/indra/newview/skins/default/xui/pt/panel_region_debug.xml b/indra/newview/skins/default/xui/pt/panel_region_debug.xml
index be15d40d74..9070563fd0 100755
--- a/indra/newview/skins/default/xui/pt/panel_region_debug.xml
+++ b/indra/newview/skins/default/xui/pt/panel_region_debug.xml
@@ -7,11 +7,8 @@
desconhecido
</text>
<check_box label="Desativar scripts" name="disable_scripts_check" tool_tip="Desativar todos os scripts nesta região"/>
- <button label="?" name="disable_scripts_help"/>
<check_box label="Desativar colisões" name="disable_collisions_check" tool_tip="Desabilitar colisões de não-avatares nessa região"/>
- <button label="?" name="disable_collisions_help"/>
<check_box label="Desativar física" name="disable_physics_check" tool_tip="Desativar toda a físíca nesta região"/>
- <button label="?" name="disable_physics_help"/>
<button label="Aplicar" name="apply_btn"/>
<text name="objret_text_lbl" width="130">
Devolver objeto
@@ -31,10 +28,8 @@
<check_box label="Em todas as regiões desta propriedade" name="return_estate_wide" tool_tip="Devolver objetos em todas as regiões que constituem esta propriedade"/>
<button label="Devolver" name="return_btn"/>
<button label="Principais colidentes..." name="top_colliders_btn" tool_tip="Lista dos objetos com maior potencial de colisão" width="280"/>
- <button label="?" left="297" name="top_colliders_help"/>
- <button label="Principais scripts..." name="top_scripts_btn" tool_tip="Lista de objetos que mais passam tempo executando scripts" width="280"/>
- <button label="?" left="297" name="top_scripts_help"/>
<button label="Reiniciar a região" name="restart_btn" tool_tip="Após 2 minutos de contagem regressiva, reiniciar a região"/>
- <button label="?" name="restart_help"/>
+ <button label="Principais scripts..." name="top_scripts_btn" tool_tip="Lista de objetos que mais passam tempo executando scripts" width="280"/>
<button label="Cancelar reinício" name="cancel_restart_btn" tool_tip="Cancelar reinício da região"/>
+ <button label="Console de depuração de região" name="region_debug_console_btn" tool_tip="Abrir console de depuração de região"/>
</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_region_general.xml b/indra/newview/skins/default/xui/pt/panel_region_general.xml
index 4be1cd11c0..a0d4579a04 100755
--- a/indra/newview/skins/default/xui/pt/panel_region_general.xml
+++ b/indra/newview/skins/default/xui/pt/panel_region_general.xml
@@ -20,12 +20,12 @@
</text>
<check_box label="Bloquear terraplenagem" name="block_terraform_check"/>
<check_box label="Bloquear voos" name="block_fly_check"/>
+ <check_box label="Bloquear sobrevoo no terreno" name="block_fly_over_check" tool_tip="Estender verificações de acesso para cima para evitar que voem sobre um terreno"/>
<check_box label="Permitir dano" name="allow_damage_check"/>
<check_box label="Restringir empurrões" name="restrict_pushobject"/>
<check_box label="Permitir revenda do terreno" name="allow_land_resell_check"/>
<check_box label="Permitir junção/divisão do terreno" name="allow_parcel_changes_check"/>
<check_box label="Bloquear exibição do terreno na busca" name="block_parcel_search_check" tool_tip="Permitir que as pessoas vejam esta região e seus lotes nos resultados de busca"/>
- <check_box label="Permitir objetos mesh" name="mesh_rez_enabled_check" tool_tip="Permitir que que outras pessoas renderizem objectos mesh nessa região"/>
<spinner label="Limite do agente" name="agent_limit_spin"/>
<spinner label="Bônus de objetos" name="object_bonus_spin"/>
<text label="Maturidade" name="access_text">
diff --git a/indra/newview/skins/default/xui/pt/panel_script_ed.xml b/indra/newview/skins/default/xui/pt/panel_script_ed.xml
index 39bb5edc75..c546adcf8b 100755
--- a/indra/newview/skins/default/xui/pt/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/pt/panel_script_ed.xml
@@ -24,6 +24,7 @@
<menu_item_call label="Reverter todas as alterações" name="Revert All Changes"/>
<menu_item_call label="Carregar do arquivo..." name="LoadFromFile"/>
<menu_item_call label="Salvar para o arquivo..." name="SaveToFile"/>
+ <menu_item_call label="Cores..." name="Colors"/>
</menu>
<menu label="Editar" name="Edit">
<menu_item_call label="desfazer" name="Undo"/>
@@ -41,9 +42,9 @@
<menu_item_call label="ajuda palavra- chave..." name="Keyword Help..."/>
</menu>
</menu_bar>
- <text_editor name="Script Editor">
+ <script_editor name="Script Editor">
Carregando...
- </text_editor>
+ </script_editor>
<combo_box label="Inserir..." name="Insert..."/>
<button label="Salvar" label_selected="Salvar" name="Save_btn"/>
<button label="Editar..." name="Edit_btn"/>
diff --git a/indra/newview/skins/default/xui/pt/panel_snapshot_options.xml b/indra/newview/skins/default/xui/pt/panel_snapshot_options.xml
index 7f1452e992..bce44d2ed6 100755
--- a/indra/newview/skins/default/xui/pt/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/pt/panel_snapshot_options.xml
@@ -4,4 +4,13 @@
<button label="E-mail" name="save_to_email_btn"/>
<button label="Salvar em Meu inventário (L$[AMOUNT])" name="save_to_inventory_btn"/>
<button label="Salvar no meu PC" name="save_to_computer_btn"/>
+ <text name="send_to_facebook_textbox">
+ Enviar para: [secondlife:/// Facebook]
+ </text>
+ <text name="send_to_twitter_textbox">
+ [secondlife:/// Twitter]
+ </text>
+ <text name="send_to_flickr_textbox">
+ [secondlife:/// Flickr]
+ </text>
</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_teleport_history_item.xml b/indra/newview/skins/default/xui/pt/panel_teleport_history_item.xml
index 65f80fddd2..5d8a024754 100755
--- a/indra/newview/skins/default/xui/pt/panel_teleport_history_item.xml
+++ b/indra/newview/skins/default/xui/pt/panel_teleport_history_item.xml
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="teleport_history_item">
+ <text name="timestamp" value="..."/>
<button name="profile_btn" tool_tip="Mostrar dados do item"/>
</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_twitter_account.xml b/indra/newview/skins/default/xui/pt/panel_twitter_account.xml
new file mode 100644
index 0000000000..32ab437786
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/panel_twitter_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_twitter_account">
+ <string name="twitter_connected" value="Você está conectado ao Twitter como:"/>
+ <string name="twitter_disconnected" value="Não conectado ao Twitter"/>
+ <text name="account_caption_label">
+ Não conectado ao Twitter.
+ </text>
+ <panel name="panel_buttons">
+ <button label="Conectar..." name="connect_btn"/>
+ <button label="Desconectar" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Twitter/ta-p/2435453 Aprenda a publicar no Twitter]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/pt/panel_twitter_photo.xml b/indra/newview/skins/default/xui/pt/panel_twitter_photo.xml
new file mode 100644
index 0000000000..3958d5f0f9
--- /dev/null
+++ b/indra/newview/skins/default/xui/pt/panel_twitter_photo.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_twitter_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="text_panel">
+ <text name="status_label">
+ Próximas etapas?
+ </text>
+ <text name="status_counter_label">
+ 140
+ </text>
+ <check_box initial_value="true" label="Incluir localização do SL" name="add_location_cb"/>
+ <check_box initial_value="true" label="Incluir uma foto" name="add_photo_cb"/>
+ </layout_panel>
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="Resolução da imagem">
+ <combo_box.item label="Janela atual" name="CurrentWindow"/>
+ <combo_box.item label="640x480" name="640x480"/>
+ <combo_box.item label="800x600" name="800x600"/>
+ <combo_box.item label="1024x768" name="1024x768"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="Filtros de imagem">
+ <combo_box.item label="Sem filtro" name="NoFilter"/>
+ </combo_box>
+ <button label="Atualizar" name="new_snapshot_btn" tool_tip="Clique para atualizar"/>
+ <button label="Visualizar" name="big_preview_btn" tool_tip="Clique para alternar entre visualizações"/>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="Enviar tweet" name="post_photo_btn"/>
+ <button label="Cancelar" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/pt/role_actions.xml b/indra/newview/skins/default/xui/pt/role_actions.xml
index e45a3bd21f..90e2264940 100755
--- a/indra/newview/skins/default/xui/pt/role_actions.xml
+++ b/indra/newview/skins/default/xui/pt/role_actions.xml
@@ -3,6 +3,7 @@
<action_set description="Esta habilidades incluem poderes de adicionar ou remover membros do grupo e permitir que novos membros se juntem sem um convite." name="Membership">
<action description="Convidar pessoas para este grupo" longdescription="Em Membros &gt; Cargos, use o botão &apos;Convidar&apos; para convidar pessoas para entrar no grupo." name="member invite" value="1"/>
<action description="Expulsar membros deste grupo" longdescription="Em Membros &gt; Cargos, use o botão &apos;Ejetar&apos; para tirar pessoas do grupo. Proprietários podem expulsar qualquer pessoa, menos outro proprietário. Se você não é Proprietário, um membro só pode ser expulso se tiver cargo &apos;Todos&apos; e nenhum outro cargo. Para destituir um membro de seu cargo, você precisa ter a função &apos;Destituir membro com cargo&apos;." name="member eject" value="2"/>
+ <action description="Gerenciar lista de banidos" longdescription="Permite que membros do grupo banam residentes ou revoguem o banimento neste grupo." name="allow ban" value="51"/>
<action description="Alterna entre &apos;Inscrições abertas&apos; e &apos;Taxa de associação&apos;." longdescription="Ative &apos;Inscrições abertas&apos; para que novos membros entrem no grupo sem convite, mude a &apos;Taxa de associação&apos; na seção Geral." name="member options" value="3"/>
</action_set>
<action_set description="Estas habilidades incluem poderes de adicionar, remover e mudar funções do grupo; adicionar e remover membros em funções e designar habilidades a funções." name="Roles">
diff --git a/indra/newview/skins/default/xui/pt/sidepanel_inventory.xml b/indra/newview/skins/default/xui/pt/sidepanel_inventory.xml
index 7908ea5f3a..4747d14101 100755
--- a/indra/newview/skins/default/xui/pt/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/pt/sidepanel_inventory.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel label="Coisas" name="objects panel">
- <panel label="" name="sidepanel__inventory_panel">
+ <panel label="" name="sidepanel_inventory_panel">
<layout_stack name="inventory_layout_stack">
<layout_panel name="inbox_layout_panel">
<panel label="" name="marketplace_inbox">
@@ -33,7 +33,7 @@
<layout_panel name="shop_btn_lp">
<button label="Comprar" name="shop_btn" tool_tip="Abrir página do Marketplace"/>
<button label="Vestir" name="wear_btn" tool_tip="Vestir visual selecionado"/>
- <button label="Tocar" name="play_btn"/>
+ <button label="Jogar" name="play_btn"/>
<button label="Teletransportar" name="teleport_btn" tool_tip="Teletransportar para a área selecionada"/>
</layout_panel>
</layout_stack>
diff --git a/indra/newview/skins/default/xui/pt/strings.xml b/indra/newview/skins/default/xui/pt/strings.xml
index 2eb4c0a02e..577143b0dc 100755
--- a/indra/newview/skins/default/xui/pt/strings.xml
+++ b/indra/newview/skins/default/xui/pt/strings.xml
@@ -28,6 +28,45 @@
<string name="StartupRequireDriverUpdate">
Falha na inicialização dos gráficos. Atualize seu driver gráfico!
</string>
+ <string name="AboutHeader">
+ [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2] ([VIEWER_VERSION_3]) [BUILD_DATE] [BUILD_TIME] ([CHANNEL])
+[[VIEWER_RELEASE_NOTES_URL] [Notas da versão]]
+ </string>
+ <string name="AboutCompiler">
+ Construído com [COMPILER] versão [COMPILER_VERSION]
+ </string>
+ <string name="AboutPosition">
+ Você está em [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] em [REGION] localizado em &lt;nolink&gt;[HOSTNAME]&lt;/nolink&gt; ([HOSTIP])
+SLURL: &lt;nolink&gt;[SLURL]&lt;/nolink&gt;
+(coordenadas globais [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1])
+[SERVER_VERSION]
+[SERVER_RELEASE_NOTES_URL]
+ </string>
+ <string name="AboutSystem">
+ CPU: [CPU]
+Memória: [MEMORY_MB] MBs
+Versão OS: [OS_VERSION]
+Placa de vídeo: [GRAPHICS_CARD_VENDOR]
+Placa gráfica: [GRAPHICS_CARD]
+ </string>
+ <string name="AboutDriver">
+ Versão do driver de vídeo Windows: [GRAPHICS_CARD_VENDOR]
+ </string>
+ <string name="AboutLibs">
+ Versão OpenGL: [OPENGL_VERSION]
+
+Versão libcurl: [LIBCURL_VERSION]
+Versão J2C Decoder: [J2C_VERSION]
+Versão do driver de áudio: [AUDIO_DRIVER_VERSION]
+Versão Qt Webkit: [QT_WEBKIT_VERSION]
+Versão do servidor de voz: [VOICE_VERSION]
+ </string>
+ <string name="AboutTraffic">
+ Packets Lost: [PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number,1]%)
+ </string>
+ <string name="ErrorFetchingServerReleaseNotesURL">
+ Erro ao obter URL de notas de versão do servidor.
+ </string>
<string name="ProgressRestoring">
Restaurando...
</string>
@@ -248,6 +287,75 @@ Pessoas com contas gratuitas não poderão acessar o Second Life no momento para
<string name="TestingDisconnect">
Teste de desconexão
</string>
+ <string name="SocialFlickrConnecting">
+ Conectando ao Flickr...
+ </string>
+ <string name="SocialFlickrPosting">
+ Publicando...
+ </string>
+ <string name="SocialFlickrDisconnecting">
+ Desconectando do Flickr...
+ </string>
+ <string name="SocialFlickrErrorConnecting">
+ Problema ao conectar ao Flickr
+ </string>
+ <string name="SocialFlickrErrorPosting">
+ Problema ao publicar no Flickr
+ </string>
+ <string name="SocialFlickrErrorDisconnecting">
+ Problema ao desconectar do Flickr
+ </string>
+ <string name="SocialTwitterConnecting">
+ Conectando ao Twitter...
+ </string>
+ <string name="SocialTwitterPosting">
+ Publicando...
+ </string>
+ <string name="SocialTwitterDisconnecting">
+ Desconectando do Twitter...
+ </string>
+ <string name="SocialTwitterErrorConnecting">
+ Problema ao conectar ao Twitter
+ </string>
+ <string name="SocialTwitterErrorPosting">
+ Problema ao publicar no Twitter
+ </string>
+ <string name="SocialTwitterErrorDisconnecting">
+ Problema ao desconectar do Twitter
+ </string>
+ <string name="BlackAndWhite">
+ Preto e branco
+ </string>
+ <string name="Colors1970">
+ Cores dos anos 1970
+ </string>
+ <string name="Intense">
+ Intenso
+ </string>
+ <string name="Newspaper">
+ Retícula
+ </string>
+ <string name="Sepia">
+ Sépia
+ </string>
+ <string name="Spotlight">
+ Destaque
+ </string>
+ <string name="Video">
+ Vídeo
+ </string>
+ <string name="Autocontrast">
+ Autocontraste
+ </string>
+ <string name="LensFlare">
+ Reflexo de flash
+ </string>
+ <string name="Miniature">
+ Miniatura
+ </string>
+ <string name="Toycamera">
+ Câmera de brinquedo
+ </string>
<string name="TooltipPerson">
Pessoa
</string>
@@ -796,6 +904,12 @@ Pessoas com contas gratuitas não poderão acessar o Second Life no momento para
<string name="use_texture">
Usar textura
</string>
+ <string name="manip_hint1">
+ Mova o cursor do mouse sobre a regra
+ </string>
+ <string name="manip_hint2">
+ para ajustar à grade
+ </string>
<string name="texture_loading">
Carregando...
</string>
@@ -886,12 +1000,12 @@ Pessoas com contas gratuitas não poderão acessar o Second Life no momento para
<string name="ControlYourCamera">
Controle sua camera
</string>
- <string name="AgentNameSubst">
- (Você)
- </string>
<string name="TeleportYourAgent">
Teletransportá-lo
</string>
+ <string name="AgentNameSubst">
+ (Você)
+ </string>
<string name="JoinAnExperience">
Participar de uma experiência
</string>
@@ -1245,6 +1359,18 @@ Pessoas com contas gratuitas não poderão acessar o Second Life no momento para
<string name="InventoryOutboxNoItems">
Arraste as pastas para estas áreas e então clique em &quot;Enviar para Mercado&quot; para listar os itens para venda no [[MARKETPLACE_DASHBOARD_URL] Mercado].
</string>
+ <string name="InventoryOutboxInitializingTitle">
+ Inicializando o Marketplace.
+ </string>
+ <string name="InventoryOutboxInitializing">
+ Estamos acessando sua conta na [loja [MARKETPLACE_CREATE_STORE_URL] do Marketplace].
+ </string>
+ <string name="InventoryOutboxErrorTitle">
+ Erros do Marketplace.
+ </string>
+ <string name="InventoryOutboxError">
+ A loja [[MARKETPLACE_CREATE_STORE_URL] no Marketplace] está retornando erros.
+ </string>
<string name="Marketplace Error None">
Sem erros
</string>
@@ -1272,6 +1398,9 @@ Pessoas com contas gratuitas não poderão acessar o Second Life no momento para
<string name="Open landmarks">
Marcos abertos
</string>
+ <string name="Unconstrained">
+ Sem limites
+ </string>
<string name="no_transfer" value="(não transferível)"/>
<string name="no_modify" value="(não modificável)"/>
<string name="no_copy" value="(não copiável)"/>
@@ -1666,6 +1795,9 @@ Pessoas com contas gratuitas não poderão acessar o Second Life no momento para
<string name="CompileQueueDownloadedCompiling">
Baixado, agora compilando
</string>
+ <string name="CompileQueueServiceUnavailable">
+ Serviço de compilação de scripts não disponível
+ </string>
<string name="CompileQueueScriptNotFound">
Script não encontrado no servidor.
</string>
@@ -3896,6 +4028,12 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
<string name="inventory_item_offered-im">
Oferta de item de inventário
</string>
+ <string name="flickr_post_success">
+ Você publicou no Flickr.
+ </string>
+ <string name="twitter_post_success">
+ Você publicou no Twitter.
+ </string>
<string name="no_session_message">
(Sessão de MI inexistente)
</string>
@@ -4352,6 +4490,9 @@ Denunciar abuso
<string name="LocalEstimateUSD">
US$ [AMOUNT]
</string>
+ <string name="Group Ban">
+ Banimento do grupo
+ </string>
<string name="Membership">
Plano
</string>
@@ -4774,6 +4915,12 @@ Tente colocar o caminho do editor entre aspas.
<string name="Command_Destinations_Label">
Destinos
</string>
+ <string name="Command_Facebook_Label">
+ Facebook
+ </string>
+ <string name="Command_Flickr_Label">
+ Flickr
+ </string>
<string name="Command_Gestures_Label">
Gestos
</string>
@@ -4822,6 +4969,9 @@ Tente colocar o caminho do editor entre aspas.
<string name="Command_Speak_Label">
Falar
</string>
+ <string name="Command_Twitter_Label">
+ Twitter
+ </string>
<string name="Command_View_Label">
Controles da câmera
</string>
@@ -4852,6 +5002,12 @@ Tente colocar o caminho do editor entre aspas.
<string name="Command_Destinations_Tooltip">
Destinos de interesse
</string>
+ <string name="Command_Facebook_Tooltip">
+ Publicar no Facebook
+ </string>
+ <string name="Command_Flickr_Tooltip">
+ Carregar no Flickr
+ </string>
<string name="Command_Gestures_Tooltip">
Gestos para seu avatar
</string>
@@ -4900,6 +5056,9 @@ Tente colocar o caminho do editor entre aspas.
<string name="Command_Speak_Tooltip">
Fale com pessoas próximas usando seu microfone
</string>
+ <string name="Command_Twitter_Tooltip">
+ Twitter
+ </string>
<string name="Command_View_Tooltip">
Alterar o ângulo da câmera
</string>
diff --git a/indra/newview/skins/default/xui/ru/floater_big_preview.xml b/indra/newview/skins/default/xui/ru/floater_big_preview.xml
new file mode 100644
index 0000000000..cdacebadef
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/floater_big_preview.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_big_preview" title="ПРОСМОТР"/>
diff --git a/indra/newview/skins/default/xui/ru/floater_facebook.xml b/indra/newview/skins/default/xui/ru/floater_facebook.xml
new file mode 100644
index 0000000000..20b9e4e151
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/floater_facebook.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_facebook" title="ОПУБЛИКОВÐТЬ Ð’ FACEBOOK">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="СТÐТУС" name="panel_facebook_status"/>
+ <panel label="ФОТО" name="panel_facebook_photo"/>
+ <panel label="ВХОД" name="panel_facebook_place"/>
+ <panel label="ДРУЗЬЯ" name="panel_facebook_friends"/>
+ <panel label="ÐККÐУÐТ" name="panel_facebook_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ Ошибка
+ </text>
+ <text name="connection_loading_text">
+ Загрузка...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/ru/floater_flickr.xml b/indra/newview/skins/default/xui/ru/floater_flickr.xml
new file mode 100644
index 0000000000..4f020399fb
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/floater_flickr.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_flickr" title="ЗÐГРУЗИТЬ ÐÐ FLICKR">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="ФОТО" name="panel_flickr_photo"/>
+ <panel label="ÐККÐУÐТ" name="panel_flickr_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ Ошибка
+ </text>
+ <text name="connection_loading_text">
+ Загрузка...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/ru/floater_lagmeter.xml b/indra/newview/skins/default/xui/ru/floater_lagmeter.xml
index c420006a03..c420006a03 100755..100644
--- a/indra/newview/skins/default/xui/ru/floater_lagmeter.xml
+++ b/indra/newview/skins/default/xui/ru/floater_lagmeter.xml
diff --git a/indra/newview/skins/default/xui/ru/floater_perms_default.xml b/indra/newview/skins/default/xui/ru/floater_perms_default.xml
new file mode 100644
index 0000000000..3a88788712
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/floater_perms_default.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="perms default" title="СТÐÐДÐРТÐЫЕ РÐЗРЕШЕÐИЯ ÐРСОЗДÐÐИЕ">
+ <panel label="Стандартные разрешениÑ" name="default permissions"/>
+ <button label="OK" label_selected="OK" name="ok"/>
+ <button label="Отмена" label_selected="Отмена" name="cancel"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/ru/floater_region_restarting.xml b/indra/newview/skins/default/xui/ru/floater_region_restarting.xml
new file mode 100644
index 0000000000..1b4c0e33dc
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/floater_region_restarting.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="region_restarting" title="ПЕРЕЗÐПУСК РЕГИОÐÐ">
+ <string name="RegionName">
+ Регион, в котором вы находитеÑÑŒ ([NAME]), будет перезапущен.
+
+ЕÑли вы оÑтанетеÑÑŒ в Ñтом регионе, вы выйдете из ÑиÑтемы.
+ </string>
+ <string name="RestartSeconds">
+ Секунд до перезапуÑка
+[SECONDS]
+ </string>
+ <panel name="layout_panel_1">
+ <text name="region_name">
+ Регион, в котором вы находитеÑÑŒ (-длинное название региона-), будет перезапущен.
+
+ЕÑли вы оÑтанетеÑÑŒ в Ñтом регионе, вы выйдете из ÑиÑтемы.
+ </text>
+ <text name="restart_seconds">
+ Секунд до перезапуÑка
+ 32767
+ </text>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/ru/floater_report_abuse.xml b/indra/newview/skins/default/xui/ru/floater_report_abuse.xml
index 6fdbdacadc..abbdeca180 100755
--- a/indra/newview/skins/default/xui/ru/floater_report_abuse.xml
+++ b/indra/newview/skins/default/xui/ru/floater_report_abuse.xml
@@ -35,7 +35,7 @@
<combo_box.item label="ВозраÑÑ‚ &gt; ВзроÑлый житель в Second Life Ð´Ð»Ñ Ð¿Ð¾Ð´Ñ€Ð¾Ñтков" name="Age__Adult_resident_on_Teen_Second_Life"/>
<combo_box.item label="ВозраÑÑ‚ &gt; Малолетний житель в Second Life Ð´Ð»Ñ Ð¿Ð¾Ð´Ñ€Ð¾Ñтков" name="Age__Underage_resident_outside_of_Teen_Second_Life"/>
<combo_box.item label="Ðападение &gt; Ð‘Ð¾ÐµÐ²Ð°Ñ Â«Ð¿ÐµÑочница»/небезопаÑÐ½Ð°Ñ Ð¾Ð±Ð»Ð°Ñть" name="Assault__Combat_sandbox___unsafe_area"/>
- <combo_box.item label="Ðападение &gt; БезопаÑÐ½Ð°Ñ Ð¾Ð±Ð»Ð°Ñть" name="Assault__Safe_area"/>
+ <combo_box.item label="Ðападение &gt; Стрельба, нанеÑение ударов или толкание другого Ð¶Ð¸Ñ‚ÐµÐ»Ñ Ð² безопаÑной облаÑти" name="Assault__Safe_area"/>
<combo_box.item label="Ðападение &gt; «ПеÑочница» иÑÐ¿Ñ‹Ñ‚Ð°Ð½Ð¸Ñ Ð¾Ñ€ÑƒÐ¶Ð¸Ñ" name="Assault__Weapons_testing_sandbox"/>
<combo_box.item label="ÐšÐ¾Ð¼Ð¼ÐµÑ€Ñ†Ð¸Ñ &gt; Ðе удалоÑÑŒ доÑтавить продукт или уÑлугу" name="Commerce__Failure_to_deliver_product_or_service"/>
<combo_box.item label="РаÑкрытие &gt; Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¾ реальном мире" name="Disclosure__Real_world_information"/>
@@ -49,25 +49,25 @@
<combo_box.item label="МошенничеÑтво &gt; L$" name="Fraud__L$"/>
<combo_box.item label="МошенничеÑтво &gt; ЗемлÑ" name="Fraud__Land"/>
<combo_box.item label="МошенничеÑтво &gt; «Пирамида» или «пиÑьмо ÑчаÑтьÑ»" name="Fraud__Pyramid_scheme_or_chain_letter"/>
- <combo_box.item label="МошенничеÑтво &gt; US$" name="Fraud__US$"/>
+ <combo_box.item label="МошенничеÑтво &gt; Линден-доллары (L$) или доллары СШÐ" name="Fraud__US$"/>
<combo_box.item label="БеÑпокойÑтво &gt; Ð ÐµÐºÐ»Ð°Ð¼Ð½Ð°Ñ Ñ„ÐµÑ€Ð¼Ð°/видимый Ñпам" name="Harassment__Advert_farms___visual_spam"/>
<combo_box.item label="БеÑпокойÑтво &gt; Клевета на отдельных лиц или группы" name="Harassment__Defaming_individuals_or_groups"/>
<combo_box.item label="БеÑпокойÑтво &gt; ПрепÑÑ‚Ñтвие движению" name="Harassment__Impeding_movement"/>
<combo_box.item label="БеÑпокойÑтво &gt; СекÑуальное домогательÑтво" name="Harassment__Sexual_harassment"/>
- <combo_box.item label="БеÑпокойÑтво &gt; ПодÑтрекательÑтво
/призыв к нарушению лицензионного ÑоглашениÑ" name="Harassment__Solicting_inciting_others_to_violate_ToS"/>
+ <combo_box.item label="ПреÑледование &gt; Ðамеренное поведение Ñ Ñ†ÐµÐ»ÑŒÑŽ нарушить привычный образ жизни" name="Harassment__Solicting_inciting_others_to_violate_ToS"/>
<combo_box.item label="БеÑпокойÑтво &gt; ОÑкорбление Ñловом" name="Harassment__Verbal_abuse"/>
<combo_box.item label="ÐеприÑтойноÑть &gt; Откровенно оÑкорбительное Ñодержимое или поведение" name="Indecency__Broadly_offensive_content_or_conduct"/>
<combo_box.item label="ÐеприÑтойноÑть &gt; Ðекорректное Ð¸Ð¼Ñ Ð°Ð²Ð°Ñ‚Ð°Ñ€Ð°" name="Indecency__Inappropriate_avatar_name"/>
- <combo_box.item label="ÐеприÑтойноÑть &gt; Ðекорректное Ñодержимое или поведение в регионе PG" name="Indecency__Mature_content_in_PG_region"/>
+ <combo_box.item label="ÐеприÑтойноÑть &gt; Ðекорректное Ð´Ð»Ñ Ñ€ÐµÐ¹Ñ‚Ð¸Ð½Ð³Ð° данного региона Ñодержимое или поведение" name="Indecency__Mature_content_in_PG_region"/>
<combo_box.item label="ÐеприÑтойноÑть &gt; Ðекорректное Ñодержимое или поведение в регионе Moderate" name="Indecency__Inappropriate_content_in_Mature_region"/>
<combo_box.item label="Ðарушение прав интеллектуальной ÑобÑтвенноÑти &gt; Удаление Ñодержимого" name="Intellectual_property_infringement_Content_Removal"/>
<combo_box.item label="Ðарушение прав интеллектуальной ÑобÑтвенноÑти &gt; CopyBot или нарушение разрешений" name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit"/>
<combo_box.item label="ÐетерпимоÑть" name="Intolerance"/>
<combo_box.item label="Ð—ÐµÐ¼Ð»Ñ &gt; Злоупотребление реÑурÑами «пеÑочницы»" name="Land__Abuse_of_sandbox_resources"/>
- <combo_box.item label="Ð—ÐµÐ¼Ð»Ñ &gt; ПоÑÑгательÑтво &gt; Объекты/текÑтуры" name="Land__Encroachment__Objects_textures"/>
+ <combo_box.item label="Ð—ÐµÐ¼Ð»Ñ &gt; ПоÑÑгательÑтво &gt; Объекты или текÑтуры" name="Land__Encroachment__Objects_textures"/>
<combo_box.item label="Ð—ÐµÐ¼Ð»Ñ &gt; ПоÑÑгательÑтво &gt; ЧаÑтицы" name="Land__Encroachment__Particles"/>
<combo_box.item label="Ð—ÐµÐ¼Ð»Ñ &gt; ПоÑÑгательÑтво &gt; ДеревьÑ/раÑтениÑ" name="Land__Encroachment__Trees_plants"/>
- <combo_box.item label="Пари/азартные игры" name="Wagering_gambling"/>
+ <combo_box.item label="Пари или азартные игры" name="Wagering_gambling"/>
<combo_box.item label="Другое" name="Other"/>
</combo_box>
<text name="abuser_name_title">
diff --git a/indra/newview/skins/default/xui/ru/floater_scene_load_stats.xml b/indra/newview/skins/default/xui/ru/floater_scene_load_stats.xml
new file mode 100644
index 0000000000..a101e62627
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/floater_scene_load_stats.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Scene Load Statistics" title="СТÐТИСТИКРЗÐГРУЗКИ СЦЕÐ">
+ <button label="Пауза" name="playpause"/>
+ <scroll_container name="statistics_scroll">
+ <container_view name="statistics_view">
+ <stat_view label="ОÑновной" name="basic">
+ <stat_bar label="Разница в пикÑелах на кадр" name="frame difference"/>
+ <stat_bar label="Получены данные UDP" name="bandwidth"/>
+ <stat_bar label="Потери пакетов" name="packet_loss"/>
+ </stat_view>
+ <stat_view label="РаÑширенный" name="advanced">
+ <stat_view label="ОтриÑовка" name="render">
+ <stat_bar label="Ð’Ñего объектов" name="objs"/>
+ <stat_bar label="Ðовых объектов" name="newobjs"/>
+ <stat_bar label="ЧаÑтота попаданий в кÑш объектов" name="object_cache_hits"/>
+ </stat_view>
+ <stat_view label="ТекÑтура" name="texture">
+ <stat_bar label="ЧаÑтота попаданий в кÑш" name="texture_cache_hits"/>
+ <stat_bar label="Задержка Ñ‡Ñ‚ÐµÐ½Ð¸Ñ ÐºÑша" name="texture_cache_read_latency"/>
+ <stat_bar label="Кол-во" name="numimagesstat"/>
+ <stat_bar label="Ðеобраб. изображений" name="numrawimagesstat"/>
+ </stat_view>
+ <stat_view label="Сеть" name="network">
+ <stat_bar label="ВходÑщие пакеты" name="packetsinstat"/>
+ <stat_bar label="ИÑходÑщие пакеты" name="packetsoutstat"/>
+ <stat_bar label="Объекты" name="objectdatareceived"/>
+ <stat_bar label="ТекÑтура" name="texturedatareceived"/>
+ <stat_bar label="Ðктив" name="assetudpdatareceived"/>
+ <stat_bar label="Слои" name="layersdatareceived"/>
+ <stat_bar label="ДейÑтвительный ввод" name="messagedatain"/>
+ <stat_bar label="ДейÑтвительный вывод" name="messagedataout"/>
+ <stat_bar label="Ожидающие операции VFS" name="vfspendingoperations"/>
+ </stat_view>
+ </stat_view>
+ <stat_view label="СимулÑтор" name="sim">
+ <stat_bar label="Объекты" name="simobjects"/>
+ <stat_bar label="Ðктивные объекты" name="simactiveobjects"/>
+ <stat_bar label="Ðктивные Ñкрипты" name="simactivescripts"/>
+ <stat_bar label="ВходÑщие пакеты" name="siminpps"/>
+ <stat_bar label="ИÑходÑщие пакеты" name="simoutpps"/>
+ <stat_bar label="Отложенные загрузки" name="simpendingdownloads"/>
+ <stat_bar label="Отложенные передачи" name="simpendinguploads"/>
+ <stat_bar label="Общий нераÑпакованный объем (байт)" name="simtotalunackedbytes"/>
+ <stat_view label="Ð’Ñ€ÐµÐ¼Ñ (мÑ)" name="simperf">
+ <stat_bar label="Общее Ð²Ñ€ÐµÐ¼Ñ ÐºÐ°Ð´Ñ€Ð°" name="simframemsec"/>
+ <stat_bar label="ЧиÑтое времÑ" name="simnetmsec"/>
+ <stat_bar label="Ð’Ñ€ÐµÐ¼Ñ Ð½Ð° физику" name="simsimphysicsmsec"/>
+ <stat_bar label="Ð’Ñ€ÐµÐ¼Ñ Ð½Ð° ÑимулÑцию" name="simsimothermsec"/>
+ <stat_bar label="Ð’Ñ€ÐµÐ¼Ñ Ð½Ð° клиент" name="simagentmsec"/>
+ <stat_bar label="Ð’Ñ€ÐµÐ¼Ñ Ð½Ð° изображениÑ" name="simimagesmsec"/>
+ <stat_bar label="Ð’Ñ€ÐµÐ¼Ñ Ð½Ð° Ñкрипт" name="simscriptmsec"/>
+ <stat_bar label="Резервное времÑ" name="simsparemsec"/>
+ <stat_view label="Данные времени (мÑ)" name="timedetails">
+ <stat_bar label="Шаг физики" name="simsimphysicsstepmsec"/>
+ <stat_bar label="Обновить физ. формы" name="simsimphysicsshapeupdatemsec"/>
+ <stat_bar label="Физика - прочее" name="simsimphysicsothermsec"/>
+ <stat_bar label="Ð’Ñ€ÐµÐ¼Ñ Ñна" name="simsleepmsec"/>
+ <stat_bar label="Ð’Ñ€ÐµÐ¼Ñ Ð²Ð²Ð¾Ð´Ð°/вывода" name="simpumpiomsec"/>
+ </stat_view>
+ </stat_view>
+ </stat_view>
+ </container_view>
+ </scroll_container>
+</floater>
diff --git a/indra/newview/skins/default/xui/ru/floater_script_ed_prefs.xml b/indra/newview/skins/default/xui/ru/floater_script_ed_prefs.xml
new file mode 100644
index 0000000000..666827927f
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/floater_script_ed_prefs.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_script_colors" title="ЦВЕТРСКРИПТÐ">
+ <text name="color_pickers_label">
+ Выберите желаемые цвета:
+ </text>
+ <text name="text_label">
+ ТекÑÑ‚
+ </text>
+ <text name="cursor_label">
+ КурÑор
+ </text>
+ <text name="background_label">
+ Фон
+ </text>
+ <text name="datatype_label">
+ Типы данных
+ </text>
+ <text name="event_label">
+ СобытиÑ
+ </text>
+ <text name="string_literal_label">
+ Строковые литералы
+ </text>
+ <text name="constant_label">
+ КонÑтанта
+ </text>
+ <text name="flow_control_label">
+ Управление выполнением
+ </text>
+ <text name="function_label">
+ ФункциÑ
+ </text>
+ <text name="comment_label">
+ Комментарий
+ </text>
+ <script_editor name="Script Preview">
+ /* Пример Ñкрипта */
+default
+{
+ state_entry()
+ {
+ // Комментарий
+ string greeting = &quot;Hello&quot;;
+ llSay(PUBLIC_CHANNEL, greeting);
+ }
+}
+ </script_editor>
+</floater>
diff --git a/indra/newview/skins/default/xui/ru/floater_snapshot.xml b/indra/newview/skins/default/xui/ru/floater_snapshot.xml
index 7e88630b32..8933f94c0b 100755
--- a/indra/newview/skins/default/xui/ru/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/ru/floater_snapshot.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Snapshot" title="ПРОСМОТР СÐИМКÐ">
+<floater name="Snapshot" title="СÐИМОК">
<floater.string name="unknown">
неизвеÑтно
</floater.string>
@@ -61,5 +61,11 @@
<check_box label="Данные в игре" name="hud_check"/>
<check_box label="Стоп-кадр (полноÑкранный)" name="freeze_frame_check"/>
<check_box label="Ðвтообновление" name="auto_snapshot_check"/>
+ <text name="filter_list_label">
+ Фильтр:
+ </text>
+ <combo_box name="filters_combobox" tool_tip="Фильтры изображений">
+ <combo_box.item label="Без фильтра" name="NoFilter"/>
+ </combo_box>
</panel>
</floater>
diff --git a/indra/newview/skins/default/xui/ru/floater_stats.xml b/indra/newview/skins/default/xui/ru/floater_stats.xml
index 46426495dc..10e9f5a7f4 100755
--- a/indra/newview/skins/default/xui/ru/floater_stats.xml
+++ b/indra/newview/skins/default/xui/ru/floater_stats.xml
@@ -4,7 +4,7 @@
<container_view name="statistics_view">
<stat_view label="БазоваÑ" name="basic">
<stat_bar label="Кадров/Ñ" name="fps"/>
- <stat_bar label="Ширина канала" name="bandwidth"/>
+ <stat_bar label="Получены данные UDP" name="bandwidth"/>
<stat_bar label="Потери пакетов" name="packet_loss"/>
<stat_bar label="Пинг" name="ping"/>
</stat_view>
@@ -12,9 +12,13 @@
<stat_view label="ОтриÑовка" name="render">
<stat_bar label="Треугольников на кадр" name="ktrisframe"/>
<stat_bar label="Треугольников в Ñекунду" name="ktrissec"/>
- <stat_bar label="Ð’Ñего объектов" name="objs"/>
+ <stat_bar label="Ð’Ñего объектов" name="totalobjs"/>
+ <stat_bar label="КÑшированных объектов" name="cachedobjs"/>
<stat_bar label="Ðовых объектов" name="newobjs"/>
<stat_bar label="ЧаÑтота попаданий в кÑш объектов" name="object_cache_hits"/>
+ <stat_bar label="Выполненные запроÑÑ‹ на Ñмыкание" name="occlusion_queries"/>
+ <stat_bar label="Объекты Ñомкнуты" name="occluded"/>
+ <stat_bar label="Объект разомкнут" name="unoccluded"/>
</stat_view>
<stat_view label="ТекÑтура" name="texture">
<stat_bar label="ЧаÑтота попаданий в кÑш" name="texture_cache_hits"/>
@@ -26,15 +30,32 @@
<stat_bar label="ÐÐµÑ„Ð¾Ñ€Ð¼Ð°Ñ‚Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð½Ð°Ñ Ð¿Ð°Ð¼Ñть" name="rawmemstat"/>
<stat_bar label="Ограничение памÑти" name="glboundmemstat"/>
</stat_view>
+ <stat_view label="ИÑпользование памÑти" name="memory">
+ <stat_bar label="LLTrace" name="LLTrace"/>
+ <stat_bar label="Ð˜Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ" name="LLView"/>
+ <stat_bar label="Шрифты" name="LLFontFreetype"/>
+ <stat_bar label="Инвентарь" name="LLInventoryObject"/>
+ <stat_bar label="Объекты клиента" name="LLViewerObject"/>
+ <stat_bar label="Данные группы октадеревьев" name="LLViewerOctreeGroup"/>
+ <stat_bar label="Данные октадерева" name="LLViewerOctreeEntry"/>
+ <stat_bar label="КÑш объектов клиента" name="LLVOCacheEntry"/>
+ <stat_bar label="РиÑуемые предметы" name="LLDrawable"/>
+ <stat_bar label="Данные лица" name="LLFace"/>
+ <stat_bar label="Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¾Ñ‚Ñ€Ð¸Ñовки" name="LLDrawInfo"/>
+ <stat_bar label="Данные текÑтуры" name="LLTexture"/>
+ <stat_bar label="Данные изображениÑ" name="LLImage"/>
+ <stat_bar label="Данные Ð¸Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ GL" name="LLImageGL"/>
+ <stat_bar label="Вершинные буферы" name="LLVertexBuffer"/>
+ </stat_view>
<stat_view label="Сеть" name="network">
<stat_bar label="ВходÑщие пакеты" name="packetsinstat"/>
<stat_bar label="ИÑходÑщие пакеты" name="packetsoutstat"/>
- <stat_bar label="Объекты" name="objectkbitstat"/>
- <stat_bar label="ТекÑтура" name="texturekbitstat"/>
- <stat_bar label="Ðктив" name="assetkbitstat"/>
- <stat_bar label="Слои" name="layerskbitstat"/>
- <stat_bar label="ДейÑтвительный ввод" name="actualinkbitstat"/>
- <stat_bar label="ДейÑтвительный вывод" name="actualoutkbitstat"/>
+ <stat_bar label="Объекты" name="objectdatareceived"/>
+ <stat_bar label="ТекÑтура" name="texturedatareceived"/>
+ <stat_bar label="Ðктив" name="assetudpdatareceived"/>
+ <stat_bar label="Слои" name="layersdatareceived"/>
+ <stat_bar label="ДейÑтвительный ввод" name="messagedatain"/>
+ <stat_bar label="ДейÑтвительный вывод" name="messagedataout"/>
<stat_bar label="Ожидающие операции VFS" name="vfspendingoperations"/>
</stat_view>
</stat_view>
@@ -64,8 +85,8 @@
<stat_bar label="ИÑходÑщие пакеты" name="simoutpps"/>
<stat_bar label="Отложенные загрузки" name="simpendingdownloads"/>
<stat_bar label="Отложенные передачи" name="simpendinguploads"/>
- <stat_bar label="Общий нераÑпакованный объем (байт)" name="simtotalunackedbytes"/>
- <stat_view label="Ð’Ñ€ÐµÐ¼Ñ (мÑ)" name="simperf">
+ <stat_bar label="Общий неподтвержденный объем" name="simtotalunackedbytes"/>
+ <stat_view label="ВремÑ" name="simperf">
<stat_bar label="Общее Ð²Ñ€ÐµÐ¼Ñ ÐºÐ°Ð´Ñ€Ð°" name="simframemsec"/>
<stat_bar label="ЧиÑтое времÑ" name="simnetmsec"/>
<stat_bar label="Ð’Ñ€ÐµÐ¼Ñ Ð½Ð° физику" name="simsimphysicsmsec"/>
@@ -74,7 +95,7 @@
<stat_bar label="Ð’Ñ€ÐµÐ¼Ñ Ð½Ð° изображениÑ" name="simimagesmsec"/>
<stat_bar label="Ð’Ñ€ÐµÐ¼Ñ Ð½Ð° Ñкрипт" name="simscriptmsec"/>
<stat_bar label="Резервное времÑ" name="simsparemsec"/>
- <stat_view label="Данные времени (мÑ)" name="timedetails">
+ <stat_view label="Данные времени" name="timedetails">
<stat_bar label="Шаг физики" name="simsimphysicsstepmsec"/>
<stat_bar label="Обновить физ. формы" name="simsimphysicsshapeupdatemsec"/>
<stat_bar label="Физика - прочее" name="simsimphysicsothermsec"/>
diff --git a/indra/newview/skins/default/xui/ru/floater_tools.xml b/indra/newview/skins/default/xui/ru/floater_tools.xml
index 35921d147f..a67745534c 100755
--- a/indra/newview/skins/default/xui/ru/floater_tools.xml
+++ b/indra/newview/skins/default/xui/ru/floater_tools.xml
@@ -73,9 +73,7 @@
<check_box label="Редактировать объединенные" name="checkbox edit linked parts"/>
<button label="Объединить" name="link_btn"/>
<button label="Разъединить" name="unlink_btn"/>
- <text label="РаÑÑ‚Ñжка обеих Ñторон" name="checkbox uniform label">
- РаÑÑ‚Ñжка обеих Ñторон
- </text>
+ <check_box label="РаÑÑ‚Ñнуть Ñ Ð¾Ð±ÐµÐ¸Ñ… Ñторон" name="checkbox uniform"/>
<check_box initial_value="true" label="РаÑÑ‚Ñгивать текÑтуры" name="checkbox stretch textures"/>
<check_box initial_value="true" label="ПривÑзка" name="checkbox snap to grid"/>
<combo_box name="combobox grid mode" tool_tip="Выберите тип линейки Ñетки Ð´Ð»Ñ Ñ€Ð°Ð·Ð¼ÐµÑ‰ÐµÐ½Ð¸Ñ Ð¾Ð±ÑŠÐµÐºÑ‚Ð°">
@@ -410,82 +408,7 @@
<spinner label="ПлотноÑть в 100 кг/м^3" name="Physics Density"/>
<spinner label="ВоÑÑтанавливаемоÑть" name="Physics Restitution"/>
</panel>
- <panel label="ТекÑтура" name="Texture">
- <panel.string name="string repeats per meter">
- Повторений на метр
- </panel.string>
- <panel.string name="string repeats per face">
- Повторений на грань
- </panel.string>
- <texture_picker label="ТекÑтура" name="texture control" tool_tip="Щелкните Ð´Ð»Ñ Ð²Ñ‹Ð±Ð¾Ñ€Ð° изображениÑ"/>
- <color_swatch label="Цвет" name="colorswatch" tool_tip="Щелкните Ð´Ð»Ñ Ð²Ñ‹Ð±Ð¾Ñ€Ð° цвета"/>
- <text name="color trans">
- ПрозрачноÑть %
- </text>
- <text name="glow label">
- Свечение
- </text>
- <check_box label="СобÑтв. ÑркоÑть" name="checkbox fullbright"/>
- <text name="tex gen">
- Ðаложение
- </text>
- <combo_box name="combobox texgen">
- <combo_box.item label="По умолчанию" name="Default"/>
- <combo_box.item label="Ðа плоÑкоÑть" name="Planar"/>
- </combo_box>
- <text name="label shininess">
- БлеÑк
- </text>
- <combo_box name="combobox shininess">
- <combo_box.item label="Ðет" name="None"/>
- <combo_box.item label="Ðизко" name="Low"/>
- <combo_box.item label="Средний" name="Medium"/>
- <combo_box.item label="Ð’Ñ‹Ñоко" name="High"/>
- </combo_box>
- <text name="label bumpiness">
- РельефноÑть
- </text>
- <combo_box name="combobox bumpiness">
- <combo_box.item label="Ðет" name="None"/>
- <combo_box.item label="ЯркоÑть" name="Brightness"/>
- <combo_box.item label="По темному" name="Darkness"/>
- <combo_box.item label="дерево" name="woodgrain"/>
- <combo_box.item label="кора" name="bark"/>
- <combo_box.item label="кирпич" name="bricks"/>
- <combo_box.item label="ÑˆÐ°Ñ…Ð¼Ð°Ñ‚Ð½Ð°Ñ Ð´Ð¾Ñка" name="checker"/>
- <combo_box.item label="бетон" name="concrete"/>
- <combo_box.item label="ÑÑ‚Ð°Ñ€Ð°Ñ Ð¿Ð»Ð¸Ñ‚ÐºÐ°" name="crustytile"/>
- <combo_box.item label="теÑаный камень" name="cutstone"/>
- <combo_box.item label="диÑки" name="discs"/>
- <combo_box.item label="гравий" name="gravel"/>
- <combo_box.item label="чашка Петри" name="petridish"/>
- <combo_box.item label="Ñайдинг" name="siding"/>
- <combo_box.item label="ÐºÐ°Ð¼ÐµÐ½Ð½Ð°Ñ Ð¿Ð»Ð¸Ñ‚ÐºÐ°" name="stonetile"/>
- <combo_box.item label="штукатурка" name="stucco"/>
- <combo_box.item label="приÑоÑка" name="suction"/>
- <combo_box.item label="переплетение" name="weave"/>
- </combo_box>
- <spinner label="По горизонтали (U)" name="TexScaleU"/>
- <check_box label="Разворот" name="checkbox flip s"/>
- <spinner label="По вертикали (V)" name="TexScaleV"/>
- <check_box label="Разворот" name="checkbox flip t"/>
- <spinner label="Вращение˚" name="TexRot"/>
- <button label="Применить" label_selected="Применить" name="button apply"/>
- <text name="tex offset">
- Сдвиг текÑтуры
- </text>
- <spinner label="По горизонтали (U)" name="TexOffsetU"/>
- <spinner label="По вертикали (V)" name="TexOffsetV"/>
- <panel name="Add_Media">
- <text name="media_tex">
- Медиа
- </text>
- <button name="add_media" tool_tip="Добавить медиа"/>
- <button name="delete_media" tool_tip="Удалить медиа-текÑтуру"/>
- <button name="edit_media" tool_tip="Редактировать медиа"/>
- <button label="ВыровнÑть" label_selected="ВыровнÑть медиа" name="button align" tool_tip="МаÑштабирование медиа-текÑтуры (Ñначала нужно загрузить)"/>
- </panel>
- </panel>
+ <panel label="ТекÑтура" name="Texture"/>
<panel label="Контент" name="Contents">
<button label="Создать Ñкрипт" label_selected="Создать Ñкрипт" name="button new script"/>
<button label="РазрешениÑ" name="button permissions"/>
diff --git a/indra/newview/skins/default/xui/ru/floater_twitter.xml b/indra/newview/skins/default/xui/ru/floater_twitter.xml
new file mode 100644
index 0000000000..748092ff1f
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/floater_twitter.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_twitter" title="TWITTER">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="ÐÐПИСÐТЬ" name="panel_twitter_photo"/>
+ <panel label="ÐККÐУÐТ" name="panel_twitter_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ Ошибка
+ </text>
+ <text name="connection_loading_text">
+ Загрузка...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/ru/menu_avatar_icon.xml b/indra/newview/skins/default/xui/ru/menu_avatar_icon.xml
index ac2b4be003..049001e8c3 100755
--- a/indra/newview/skins/default/xui/ru/menu_avatar_icon.xml
+++ b/indra/newview/skins/default/xui/ru/menu_avatar_icon.xml
@@ -2,6 +2,7 @@
<menu name="Avatar Icon Menu">
<menu_item_call label="Открыть профиль" name="Show Profile"/>
<menu_item_call label="Отправить Ñообщение..." name="Send IM"/>
+ <menu_item_call label="Ð—Ð°Ð¿Ñ€Ð¾Ñ Ñ‚ÐµÐ»ÐµÐ¿Ð¾Ñ€Ñ‚Ð°Ñ†Ð¸Ð¸" name="Request Teleport"/>
<menu_item_call label="Добавить в друзьÑ..." name="Add Friend"/>
<menu_item_call label="Удалить из друзей..." name="Remove Friend"/>
</menu>
diff --git a/indra/newview/skins/default/xui/ru/menu_conversation.xml b/indra/newview/skins/default/xui/ru/menu_conversation.xml
index 4d1240db98..c9df8b6844 100644
--- a/indra/newview/skins/default/xui/ru/menu_conversation.xml
+++ b/indra/newview/skins/default/xui/ru/menu_conversation.xml
@@ -29,4 +29,5 @@
<menu_item_call label="Заглушить вÑех" name="ModerateVoiceMute"/>
<menu_item_call label="Позволить говорить вÑем" name="ModerateVoiceUnmute"/>
</context_menu>
+ <menu_item_call label="Заблокировать учаÑтника" name="BanMember"/>
</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/ru/menu_inventory.xml b/indra/newview/skins/default/xui/ru/menu_inventory.xml
index 37ee19fc1d..308549c254 100755
--- a/indra/newview/skins/default/xui/ru/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/ru/menu_inventory.xml
@@ -70,6 +70,7 @@
<menu_item_call label="ВоÑпроизвеÑти" name="Sound Play"/>
<menu_item_call label="Копировать URL SL" name="url_copy"/>
<menu_item_call label="О закладке" name="About Landmark"/>
+ <menu_item_call label="Показать на карте" name="show_on_map"/>
<menu_item_call label="Проиграть Ð´Ð»Ñ Ð²Ñех" name="Animation Play"/>
<menu_item_call label="Проиграть Ð´Ð»Ñ ÑебÑ" name="Animation Audition"/>
<menu_item_call label="Отправить IM-Ñообщение" name="Send Instant Message"/>
diff --git a/indra/newview/skins/default/xui/ru/menu_login.xml b/indra/newview/skins/default/xui/ru/menu_login.xml
index 835c4e186e..885f6195b6 100755
--- a/indra/newview/skins/default/xui/ru/menu_login.xml
+++ b/indra/newview/skins/default/xui/ru/menu_login.xml
@@ -5,7 +5,15 @@
<menu_item_call label="Выход из [APP_NAME]" name="Quit"/>
</menu>
<menu label="Справка" name="Help">
- <menu_item_call label="Справка [SECOND_LIFE]" name="Second Life Help"/>
+ <menu_item_call label="ИнÑтрукции..." name="How To"/>
+ <menu_item_call label="Краткое руководÑтво" name="Quickstart"/>
+ <menu_item_call label="База знаний" name="Knowledge Base"/>
+ <menu_item_call label="Wiki" name="Wiki"/>
+ <menu_item_call label="Форумы ÑообщеÑтва" name="Community Forums"/>
+ <menu_item_call label="Портал поддержки" name="Support portal"/>
+ <menu_item_call label="ÐовоÑти [SECOND_LIFE]" name="Second Life News"/>
+ <menu_item_call label="Блоги [SECOND_LIFE]" name="Second Life Blogs"/>
+ <menu_item_call label="Сообщить об ошибке" name="Report Bug"/>
<menu_item_call label="О [APP_NAME]" name="About Second Life"/>
</menu>
<menu_item_check label="Показать меню отладки" name="Show Debug Menu"/>
diff --git a/indra/newview/skins/default/xui/ru/menu_object.xml b/indra/newview/skins/default/xui/ru/menu_object.xml
index 056dab74c1..5f31941b2b 100755
--- a/indra/newview/skins/default/xui/ru/menu_object.xml
+++ b/indra/newview/skins/default/xui/ru/menu_object.xml
@@ -19,6 +19,7 @@
<context_menu label="Управление" name="Remove">
<menu_item_call label="Жалоба" name="Report Abuse..."/>
<menu_item_call label="Заблокировать" name="Object Mute"/>
+ <menu_item_call label="Разблокировать" name="Object Unmute"/>
<menu_item_call label="Возврат" name="Return..."/>
</context_menu>
<menu_item_call label="ВзÑть" name="Pie Object Take"/>
diff --git a/indra/newview/skins/default/xui/ru/menu_teleport_history_item.xml b/indra/newview/skins/default/xui/ru/menu_teleport_history_item.xml
index 6a22fd00dc..f495d27bf3 100755
--- a/indra/newview/skins/default/xui/ru/menu_teleport_history_item.xml
+++ b/indra/newview/skins/default/xui/ru/menu_teleport_history_item.xml
@@ -2,5 +2,5 @@
<context_menu name="Teleport History Item Context Menu">
<menu_item_call label="Телепорт" name="Teleport"/>
<menu_item_call label="ИнформациÑ" name="More Information"/>
- <menu_item_call label="Копировать в буфер обмена" name="CopyToClipboard"/>
+ <menu_item_call label="Копировать URL SL" name="CopyToClipboard"/>
</context_menu>
diff --git a/indra/newview/skins/default/xui/ru/menu_viewer.xml b/indra/newview/skins/default/xui/ru/menu_viewer.xml
index fcb7c4e531..fad1ea51e0 100755
--- a/indra/newview/skins/default/xui/ru/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/ru/menu_viewer.xml
@@ -34,6 +34,9 @@
<menu_item_check label="Локальный чат..." name="Nearby Chat"/>
<menu_item_check label="Говорить" name="Speak"/>
<menu_item_check label="Журнал разговора..." name="Conversation Log..."/>
+ <menu_item_call label="Facebook..." name="Facebook"/>
+ <menu_item_call label="Twitter..." name="Twitter"/>
+ <menu_item_call label="Flickr..." name="Flickr"/>
<menu label="Изменение голоÑа" name="VoiceMorphing">
<menu_item_check label="Без Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð³Ð¾Ð»Ð¾Ñа" name="NoVoiceMorphing"/>
<menu_item_check label="ПроÑмотр..." name="Preview"/>
@@ -70,11 +73,11 @@
<menu_item_check label="Меню «Дополнительно»" name="Show Advanced Menu"/>
</menu>
<menu label="Солнце" name="Sun">
- <menu_item_call label="ВоÑход" name="Sunrise"/>
- <menu_item_call label="Полдень" name="Noon"/>
- <menu_item_call label="Закат" name="Sunset"/>
- <menu_item_call label="Полночь" name="Midnight"/>
- <menu_item_call label="ИÑпользовать наÑтройки региона" name="Use Region Settings"/>
+ <menu_item_check label="ВоÑход" name="Sunrise"/>
+ <menu_item_check label="Полдень" name="Noon"/>
+ <menu_item_check label="Закат" name="Sunset"/>
+ <menu_item_check label="Полночь" name="Midnight"/>
+ <menu_item_check label="ИÑпользовать наÑтройки региона" name="Use Region Settings"/>
</menu>
<menu label="Редактор Ñреды" name="Environment Editor">
<menu_item_call label="ÐаÑтройки Ñреды..." name="Environment Settings"/>
@@ -147,7 +150,8 @@
<menu_item_check label="ПривÑзка к Ñетке" name="Snap to Grid"/>
<menu_item_call label="Сдвиг к ближайшему узлу XY Ñетки" name="Snap Object XY to Grid"/>
<menu_item_call label="ИÑпользовать выбранное Ð´Ð»Ñ Ñетки" name="Use Selection for Grid"/>
- <menu_item_call label="Параметры Ñетки" name="Grid Options"/>
+ <menu_item_call label="Параметры Ñетки..." name="Grid Options"/>
+ <menu_item_call label="УÑтановить Ñтандартные разрешениÑ..." name="Set default permissions"/>
</menu>
<menu label="Передача" name="Upload">
<menu_item_call label="Изображение (L$[COST])..." name="Upload Image"/>
@@ -155,14 +159,12 @@
<menu_item_call label="ÐÐ½Ð¸Ð¼Ð°Ñ†Ð¸Ñ (L$[COST])..." name="Upload Animation"/>
<menu_item_call label="Модель..." name="Upload Model"/>
<menu_item_call label="Ð’Ñе Ñразу (L$[COST] за файл)..." name="Bulk Upload"/>
- <menu_item_call label="УÑтановить Ñ€Ð°Ð·Ñ€ÐµÑˆÐµÐ½Ð¸Ñ Ð½Ð° передачу по умолчанию" name="perm prefs"/>
</menu>
<menu_item_call label="Отменить" name="Undo"/>
<menu_item_call label="Вернуть" name="Redo"/>
</menu>
<menu label="Справка" name="Help">
<menu_item_call label="ИнÑтрукции..." name="How To"/>
- <menu_item_call label="Справка по [SECOND_LIFE]" name="Second Life Help"/>
<menu_item_call label="Жалоба" name="Report Abuse"/>
<menu_item_call label="Сообщить об ошибке" name="Report Bug"/>
<menu_item_call label="О [APP_NAME]" name="About Second Life"/>
@@ -178,6 +180,7 @@
<menu label="ПроизводительноÑть" name="Performance Tools">
<menu_item_call label="Запаздывание" name="Lag Meter"/>
<menu_item_check label="СтатиÑтика" name="Statistics Bar"/>
+ <menu_item_call label="СтатиÑтика загрузки Ñцен" name="Scene Load Statistics"/>
<menu_item_check label="Показать Ð²ÐµÑ Ð¾Ñ‚Ñ€Ð¸Ñовки Ð´Ð»Ñ Ð°Ð²Ð°Ñ‚Ð°Ñ€Ð¾Ð²" name="Avatar Rendering Cost"/>
</menu>
<menu label="ПодÑветка и видимоÑть" name="Highlighting and Visibility">
@@ -240,6 +243,7 @@
<menu_item_check label="Оперативные таймеры" name="Fast Timers"/>
<menu_item_check label="ПамÑть" name="Memory"/>
<menu_item_check label="СтатиÑтика по Ñцене" name="Scene Statistics"/>
+ <menu_item_check label="Монитор загрузки Ñцен" name="Scene Loading Monitor"/>
<menu_item_call label="КонÑоль отладки Ð¸Ð·Ð²Ð»ÐµÑ‡ÐµÐ½Ð¸Ñ Ñ‚ÐµÐºÑтур" name="Texture Fetch Debug Console"/>
<menu_item_call label="Данные о регионе на конÑоль отладки" name="Region Info to Debug Console"/>
<menu_item_call label="Данны о группе на конÑоль отладки" name="Group Info to Debug Console"/>
@@ -276,6 +280,7 @@
<menu_item_check label="ПериодичеÑкое замедление кадров" name="Periodic Slow Frame"/>
<menu_item_check label="ТеÑÑ‚ кадров" name="Frame Test"/>
<menu_item_call label="Профиль кадра" name="Frame Profile"/>
+ <menu_item_call label="ТеÑÑ‚" name="Benchmark"/>
</menu>
<menu label="Визуализировать метаданные" name="Render Metadata">
<menu_item_check label="Рамки" name="Bounding Boxes"/>
@@ -293,7 +298,9 @@
<menu_item_check label="Данные об уровнÑÑ… детализации" name="LOD Info"/>
<menu_item_check label="Очередь поÑтроителÑ" name="Build Queue"/>
<menu_item_check label="ОÑвещение" name="Lights"/>
+ <menu_item_check label="ЧаÑтицы" name="Particles"/>
<menu_item_check label="ÐšÐ°Ñ€ÐºÐ°Ñ Ñтолкновений" name="Collision Skeleton"/>
+ <menu_item_check label="СуÑтавы" name="Joints"/>
<menu_item_check label="Лучи" name="Raycast"/>
<menu_item_check label="ÐÐ°Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð²ÐµÑ‚Ñ€Ð°" name="Wind Vectors"/>
<menu_item_check label="СложноÑть визуализации" name="rendercomplexity"/>
@@ -326,6 +333,7 @@
<menu_item_check label="Ð’Ð¸Ð·ÑƒÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ Ð¿Ñ€Ð¸Ñоединенных иÑточников Ñвета" name="Render Attached Lights"/>
<menu_item_check label="Ð’Ð¸Ð·ÑƒÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ Ð¿Ñ€Ð¸Ñоединенных чаÑтиц" name="Render Attached Particles"/>
<menu_item_check label="ПарÑщие ÑветÑщиеÑÑ Ð¾Ð±ÑŠÐµÐºÑ‚Ñ‹" name="Hover Glow Objects"/>
+ <menu_item_call label="Ðемедленно очиÑтить кÑш" name="Cache Clear"/>
</menu>
<menu label="Сеть" name="Network">
<menu_item_check label="ПриоÑтановить клиент" name="AgentPause"/>
@@ -358,7 +366,6 @@
<menu_item_call label="Вывод ÑредÑтва фокуÑировки" name="Dump Focus Holder"/>
<menu_item_call label="Печать информации о выбранных объектах" name="Print Selected Object Info"/>
<menu_item_call label="Печать информации об агенте" name="Print Agent Info"/>
- <menu_item_check label="КонÑоль отладки региона" name="Region Debug Console"/>
<menu_item_check label="Отладка SelectMgr" name="Debug SelectMgr"/>
<menu_item_check label="Отладка щелчков мышью" name="Debug Clicks"/>
<menu_item_check label="Отладка обзора" name="Debug Views"/>
diff --git a/indra/newview/skins/default/xui/ru/notifications.xml b/indra/newview/skins/default/xui/ru/notifications.xml
index 1dc8202b00..c312bcbef4 100755
--- a/indra/newview/skins/default/xui/ru/notifications.xml
+++ b/indra/newview/skins/default/xui/ru/notifications.xml
@@ -114,13 +114,13 @@
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="OutboxImportFailed">
- Ошибка при передаче
+ Ðе удалоÑÑŒ передать, ошибка: «[ERROR_CODE]»
Папки не отправлены в торговый центр из-за ошибки ÑиÑтемы или Ñети. Повторите попытку позже.
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="OutboxInitFailed">
- Ошибка инициализации торгового центра
+ Ðе удалоÑÑŒ инициализировать торговый центр, ошибка: «[ERROR_CODE]»
Ðе удалоÑÑŒ инициализировать торговый центр из-за ошибки ÑиÑтемы или Ñети. Повторите попытку позже.
<usetemplate name="okbutton" yestext="OK"/>
@@ -210,6 +210,22 @@
Добавить Ñту ÑпоÑобноÑть к роли «[ROLE_NAME]»?
<usetemplate name="okcancelbuttons" notext="Ðет" yestext="Да"/>
</notification>
+ <notification name="AssignBanAbilityWarning">
+ Ð’Ñ‹ ÑобираетеÑÑŒ добавить ÑпоÑобноÑть «[ACTION_NAME]» к роли «[ROLE_NAME]».
+
+ *ПРЕДУПРЕЖДЕÐИЕ*
+Любой учаÑтник в роли Ñ Ñтой ÑпоÑобноÑтью также получает ÑпоÑобноÑти «[ACTION_NAME_2]» и «[ACTION_NAME_3]»
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
+ <notification name="RemoveBanAbilityWarning">
+ Ð’Ñ‹ удалÑете ÑпоÑобноÑть «[ACTION_NAME]» Ð´Ð»Ñ Ñ€Ð¾Ð»Ð¸ «[ROLE_NAME]».
+
+ *ПРЕДУПРЕЖДЕÐИЕ*
+При удалении Ñтой ÑпоÑобноÑти ÐЕ БУДУТ удалены ÑпоÑобноÑти «[ACTION_NAME_2]» и «[ACTION_NAME_3]».
+
+ЕÑли вам больше не нужны Ñти ÑпоÑобноÑти Ð´Ð»Ñ Ð´Ð°Ð½Ð½Ð¾Ð¹ роли, немедленно отключите их!
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
<notification name="EjectGroupMemberWarning">
Ð’Ñ‹ ÑобираетеÑÑŒ иÑключить [AVATAR_NAME] из группы.
<usetemplate ignoretext="Подтвердите иÑключение учаÑтника из группы" name="okcancelignore" notext="Отмена" yestext="Выкинуть"/>
@@ -1579,6 +1595,14 @@ http://secondlife.com/download.
Ðевозможно покинуть группу. Ð’Ñ‹ не можете покинуть группу, так как вы ее поÑледний владелец. Сначала назначьте владельцем другого учаÑтника.
<usetemplate name="okbutton" yestext="OK"/>
</notification>
+ <notification name="GroupDepartError">
+ Ðевозможно покинуть группу: [reason].
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
+ <notification name="GroupDepart">
+ Вы покинули группу [group_name].
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
<notification name="ConfirmKick">
Ð’Ñ‹ ДЕЙСТВИТЕЛЬÐО хотите выброÑить вÑех жителей Ñ Ñетки?
<usetemplate name="okcancelbuttons" notext="Отмена" yestext="ВыброÑить вÑех жителей"/>
@@ -1731,6 +1755,10 @@ http://secondlife.com/download.
Ð’Ñ‹ дейÑтвительно хотите телепортироватьÑÑ Ð² &lt;nolink&gt;[LOCATION]&lt;/nolink&gt;?
<usetemplate ignoretext="Подтверждать телепортацию на закладку" name="okcancelignore" notext="Отмена" yestext="ТелепортациÑ"/>
</notification>
+ <notification name="TeleportViaSLAPP">
+ Ð’Ñ‹ дейÑтвительно хотите телепортироватьÑÑ Ð² &lt;nolink&gt;[LOCATION]&lt;/nolink&gt;?
+ <usetemplate ignoretext="Подтверждать телепортацию через SLAPP" name="okcancelignore" notext="Отмена" yestext="ТелепортациÑ"/>
+ </notification>
<notification name="TeleportToPick">
ТелепортироватьÑÑ Ð² [PICK]?
<usetemplate ignoretext="Подтверждать телепортацию на меÑто в подборке" name="okcancelignore" notext="Отмена" yestext="ТелепортациÑ"/>
@@ -1940,6 +1968,9 @@ http://secondlife.com/download.
<notification name="ProblemAddingEstateManager">
Проблема при добавлении нового менеджера землевладениÑ. Возможно, в одном или неÑкольких землевладениÑÑ… ÑпиÑок менеджеров уже заполнен.
</notification>
+ <notification name="ProblemAddingEstateBanManager">
+ Ðевозможно добавить землевладельца или менеджера в ÑпиÑок запрета доÑтупа.
+ </notification>
<notification name="ProblemAddingEstateGeneric">
Проблема при добавлении в Ñтот ÑпиÑок землевладениÑ. Возможно, в одном или неÑкольких землевладениÑÑ… ÑпиÑок уже заполнен.
</notification>
@@ -2453,6 +2484,12 @@ http://secondlife.com/download.
<notification name="SystemMessage">
[MESSAGE]
</notification>
+ <notification name="FlickrConnect">
+ [MESSAGE]
+ </notification>
+ <notification name="TwitterConnect">
+ [MESSAGE]
+ </notification>
<notification name="PaymentReceived">
[MESSAGE]
</notification>
@@ -3029,7 +3066,7 @@ http://secondlife.com/download.
Со Ñледующими жителÑми:
-[RESIDENTS]
+&lt;nolink&gt;[RESIDENTS]&lt;/nolink&gt;
<usetemplate name="okcancelbuttons" notext="Отмена" yestext="OK"/>
</notification>
<notification name="ShareFolderConfirmation">
@@ -3041,7 +3078,7 @@ http://secondlife.com/download.
Со Ñледующими жителÑми:
-[RESIDENTS]
+&lt;nolink&gt;[RESIDENTS]&lt;/nolink&gt;
<usetemplate name="okcancelbuttons" notext="Отмена" yestext="ОК"/>
</notification>
<notification name="ItemsShared">
@@ -3497,10 +3534,6 @@ http://secondlife.com/download.
<notification name="EjectComingSoon">
Вам запрещено здеÑÑŒ приÑутÑтвовать; у Ð²Ð°Ñ ÐµÑть [EJECT_TIME] Ñек, чтобы покинуть Ñто меÑто.
</notification>
- <notification name="NoEnterServerFull">
- Вам нет доÑтупа в Ñтот регион:
-Ñерпер переполнен.
- </notification>
<notification name="SaveBackToInvDisabled">
Сохранение в инвентаре отключено.
</notification>
@@ -3689,6 +3722,9 @@ http://secondlife.com/download.
<notification name="LinkFailedTooMuchPhysics">
Объект иÑпользует Ñлишком много реÑурÑов физики -- динамичеÑкое поведение отключено.
</notification>
+ <notification name="EstateManagerFailedllTeleportHome">
+ Объект «[OBJECT_NAME]» по адреÑу [SLURL] не может телепортировать менеджеров землевладений домой.
+ </notification>
<notification name="TeleportedHomeByObjectOnParcel">
Ð’Ñ‹ были телепортированы домой объектом «[OBJECT_NAME]» на учаÑтке «[PARCEL_NAME]»
</notification>
@@ -3879,13 +3915,18 @@ http://secondlife.com/download.
Выбрано недоÑтаточно арендуемых учаÑтков Ð´Ð»Ñ Ð²ÑтуплениÑ.
</notification>
<notification name="CantDivideLandMultipleParcelsSelected">
- ÐÐµÐ»ÑŒÐ·Ñ Ñ€Ð°Ð·Ð´ÐµÐ»Ð¸Ñ‚ÑŒ землю.\nВыбрано больше одного учаÑтка.\nВыберите меньшую территорию.
+ Ðевозможно разделить землю.
+Выбрано неÑколько учаÑтков.
+Попробуйте выбрать облаÑть поменьше.
</notification>
<notification name="CantDivideLandCantFindParcel">
- ÐÐµÐ»ÑŒÐ·Ñ Ñ€Ð°Ð·Ð´ÐµÐ»Ð¸Ñ‚ÑŒ землю.\nÐе удалоÑÑŒ найти учаÑток.\nСообщите об Ñтой неполадке: Справка -&gt; Сообщить об ошибке...
+ Ðевозможно разделить землю.
+Ðе удаетÑÑ Ð½Ð°Ð¹Ñ‚Ð¸ учаÑток.
+Сообщите об Ñтом: Справка -&gt; Сообщить об ошибке...
</notification>
<notification name="CantDivideLandWholeParcelSelected">
- Ðевозможно разделить землю. Выбран веÑÑŒ учаÑток.\nПопробуйте выбрать территорию поменьше.
+ Ðевозможно разделить землю. Выбран веÑÑŒ учаÑток.
+Попробуйте выбрать облаÑть поменьше.
</notification>
<notification name="LandHasBeenDivided">
Ð—ÐµÐ¼Ð»Ñ Ñ€Ð°Ð·Ð´ÐµÐ»ÐµÐ½Ð°.
@@ -4025,4 +4066,12 @@ http://secondlife.com/download.
Ðевозможно перемеÑтить файлы. ВоÑÑтановлен прежний путь.
<usetemplate ignoretext="Ðевозможно перемеÑтить файлы. ВоÑÑтановлен прежний путь." name="okignore" yestext="OK"/>
</notification>
+ <notification name="DefaultObjectPermissions">
+ Ошибка при Ñохранении Ñтандартных разрешений по Ñледующей причине: [REASON]. Попробуйте задать Ñтандартные Ñ€Ð°Ð·Ñ€ÐµÑˆÐµÐ½Ð¸Ñ Ñ‡ÐµÑ€ÐµÐ· некоторое времÑ.
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
+ <notification name="ChatHistoryIsBusyAlert">
+ Файл журнала чата занÑÑ‚ предыдущей операцией. Повторите попытку через неÑколько минут или выберите чат Ñ Ð´Ñ€ÑƒÐ³Ð¸Ð¼ лицом.
+ <usetemplate name="okbutton" yestext="OK"/>
+ </notification>
</notifications>
diff --git a/indra/newview/skins/default/xui/ru/panel_facebook_account.xml b/indra/newview/skins/default/xui/ru/panel_facebook_account.xml
new file mode 100644
index 0000000000..22b4e46897
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/panel_facebook_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_account">
+ <string name="facebook_connected" value="Ð’Ñ‹ подключилиÑÑŒ к Facebook как:"/>
+ <string name="facebook_disconnected" value="Ðе подключено к Facebook"/>
+ <text name="account_caption_label">
+ Ðе подключено к Facebook.
+ </text>
+ <panel name="panel_buttons">
+ <button label="Подключение..." name="connect_btn"/>
+ <button label="Отключить" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Facebook/ta-p/2149711 О публикации в Facebook]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_facebook_friends.xml b/indra/newview/skins/default/xui/ru/panel_facebook_friends.xml
new file mode 100644
index 0000000000..518452953d
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/panel_facebook_friends.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_friends">
+ <string name="facebook_friends_empty" value="Ð¡ÐµÐ¹Ñ‡Ð°Ñ Ñƒ Ð²Ð°Ñ Ð½ÐµÑ‚ друзей по Facebook, которые также были бы жителÑми Second Life. Предложите Ñвоим друзьÑм по Facebook приÑоединитьÑÑ Ðº Second Life!"/>
+ <string name="facebook_friends_no_connected" value="Ð¡ÐµÐ¹Ñ‡Ð°Ñ Ð²Ñ‹ не подключены к Facebook. Перейдите на вкладку «Ðккаунт», чтобы подключитьÑÑ Ð¸ включить Ñту функцию."/>
+ <accordion name="friends_accordion">
+ <accordion_tab name="tab_second_life_friends" title="Ð”Ñ€ÑƒÐ·ÑŒÑ Ð¿Ð¾ SL"/>
+ <accordion_tab name="tab_suggested_friends" title="Добавить Ñтих людей как друзей по SL"/>
+ </accordion>
+ <text name="facebook_friends_status">
+ Ðе подключено к Facebook.
+ </text>
+</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_facebook_photo.xml b/indra/newview/skins/default/xui/ru/panel_facebook_photo.xml
new file mode 100644
index 0000000000..783294be86
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/panel_facebook_photo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="Разрешение изображениÑ">
+ <combo_box.item label="Текущее окно" name="CurrentWindow"/>
+ <combo_box.item label="640x480" name="640x480"/>
+ <combo_box.item label="800x600" name="800x600"/>
+ <combo_box.item label="1024x768" name="1024x768"/>
+ <combo_box.item label="1200x630" name="1200x630"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="Фильтры изображений">
+ <combo_box.item label="Без фильтра" name="NoFilter"/>
+ </combo_box>
+ <button label="Обновить" name="new_snapshot_btn" tool_tip="Щелкните Ð´Ð»Ñ Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ"/>
+ <button label="ПроÑмотр" name="big_preview_btn" tool_tip="Щелкните Ð´Ð»Ñ Ñмены вида"/>
+ <text name="caption_label">
+ Комментарий (не обÑзательно):
+ </text>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="Опубликовать" name="post_photo_btn"/>
+ <button label="Отмена" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_facebook_place.xml b/indra/newview/skins/default/xui/ru/panel_facebook_place.xml
new file mode 100644
index 0000000000..913d327e92
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/panel_facebook_place.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_place">
+ <layout_stack name="stack_place">
+ <layout_panel name="place_detail_panel">
+ <text name="place_caption_label">
+ Ðапишите о том, где вы:
+ </text>
+ </layout_panel>
+ <layout_panel name="place_map_panel">
+ <check_box initial_value="false" label="" name="add_place_view_cb"/>
+ </layout_panel>
+ <layout_panel name="place_button_panel">
+ <button label="Опубликовать" name="post_place_btn"/>
+ <button label="Отмена" name="cancel_place_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_facebook_status.xml b/indra/newview/skins/default/xui/ru/panel_facebook_status.xml
new file mode 100644
index 0000000000..a59f132a01
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/panel_facebook_status.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_status">
+ <layout_stack name="stack_status">
+ <layout_panel name="status_detail_panel">
+ <text name="status_caption_label">
+ О чем вы думаете?
+ </text>
+ </layout_panel>
+ <layout_panel name="status_button_panel">
+ <button label="Опубликовать" name="post_status_btn"/>
+ <button label="Отмена" name="cancel_status_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_flickr_account.xml b/indra/newview/skins/default/xui/ru/panel_flickr_account.xml
new file mode 100644
index 0000000000..9f70bf8042
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/panel_flickr_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_flickr_account">
+ <string name="flickr_connected" value="Ð’Ñ‹ подключилиÑÑŒ к Flickr как:"/>
+ <string name="flickr_disconnected" value="Ðе подключено к Flickr"/>
+ <text name="account_caption_label">
+ Ðе подключено к Flickr.
+ </text>
+ <panel name="panel_buttons">
+ <button label="Подключение..." name="connect_btn"/>
+ <button label="Отключить" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Flickr/ta-p/2435609 О публикации в Flickr]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_flickr_photo.xml b/indra/newview/skins/default/xui/ru/panel_flickr_photo.xml
new file mode 100644
index 0000000000..0c93e28911
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/panel_flickr_photo.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_flickr_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="Разрешение изображениÑ">
+ <combo_box.item label="Текущее окно" name="CurrentWindow"/>
+ <combo_box.item label="640x480" name="640x480"/>
+ <combo_box.item label="800x600" name="800x600"/>
+ <combo_box.item label="1024x768" name="1024x768"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="Фильтры изображений">
+ <combo_box.item label="Без фильтра" name="NoFilter"/>
+ </combo_box>
+ <button label="Обновить" name="new_snapshot_btn" tool_tip="Щелкните Ð´Ð»Ñ Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ"/>
+ <button label="ПроÑмотр" name="big_preview_btn" tool_tip="Щелкните Ð´Ð»Ñ Ñмены вида"/>
+ <text name="title_label">
+ Ðазвание:
+ </text>
+ <text name="description_label">
+ ОпиÑание:
+ </text>
+ <check_box initial_value="true" label="Добавить в конец опиÑÐ°Ð½Ð¸Ñ Ñ€Ð°Ñположение в SL" name="add_location_cb"/>
+ <text name="tags_label">
+ Теги:
+ </text>
+ <text name="tags_help_label">
+ РазделÑйте теги пробелами. Теги из неÑкольких Ñлов заключайте в кавычки.
+ </text>
+ <combo_box name="rating_combobox" tool_tip="Рейтинг контента Flickr">
+ <combo_box.item label="БезопаÑный рейтинг Flickr" name="SafeRating"/>
+ <combo_box.item label="Умеренный рейтинг Flickr" name="ModerateRating"/>
+ <combo_box.item label="Ограниченный рейтинг Flickr" name="RestrictedRating"/>
+ </combo_box>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="Передать" name="post_photo_btn"/>
+ <button label="Отмена" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_group_bulk_ban.xml b/indra/newview/skins/default/xui/ru/panel_group_bulk_ban.xml
new file mode 100644
index 0000000000..e1fcb17f67
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/panel_group_bulk_ban.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel label="Заблокировать жителей" name="bulk_ban_panel">
+ <panel.string name="loading">
+ (загрузка…)
+ </panel.string>
+ <panel.string name="ban_selection_too_large">
+ Ð“Ñ€ÑƒÐ¿Ð¿Ð¾Ð²Ð°Ñ Ð±Ð»Ð¾ÐºÐ¸Ñ€Ð¾Ð²ÐºÐ° не отправлена: выбрано Ñлишком много жителей. Ð“Ñ€ÑƒÐ¿Ð¿Ð¾Ð²Ð°Ñ Ð±Ð»Ð¾ÐºÐ¸Ñ€Ð¾Ð²ÐºÐ° может охватывать не более 100 пользователей за один запроÑ.
+ </panel.string>
+ <panel.string name="ban_not_permitted">
+ Ð“Ñ€ÑƒÐ¿Ð¿Ð¾Ð²Ð°Ñ Ð±Ð»Ð¾ÐºÐ¸Ñ€Ð¾Ð²ÐºÐ° не отправлена: у Ð²Ð°Ñ Ð½ÐµÑ‚ ÑпоÑобноÑти «Управление ÑпиÑком заблокированных пользователей».
+ </panel.string>
+ <panel.string name="ban_limit_fail">
+ Ð“Ñ€ÑƒÐ¿Ð¿Ð¾Ð²Ð°Ñ Ð±Ð»Ð¾ÐºÐ¸Ñ€Ð¾Ð²ÐºÐ° не отправлена: в вашей группе доÑтигнуто предельное количеÑтво блокировок.
+ </panel.string>
+ <panel.string name="partial_ban">
+ Ðекоторые групповые блокировки не отправлены: [REASONS]
+ </panel.string>
+ <panel.string name="ban_failed">
+ Групповые блокировки не отправлены: [REASONS]
+ </panel.string>
+ <panel.string name="residents_already_banned">
+ - Следующие жители уже заблокированы: [RESIDENTS].
+ </panel.string>
+ <panel.string name="ban_limit_reached">
+ - ДоÑтигнут лимит блокировок, Ñледующие агенты не заблокированы: [RESIDENTS].
+ </panel.string>
+ <panel.string name="cant_ban_yourself">
+ - Ð’Ñ‹ не можете заблокировать Ñебе доÑтуп в группу.
+ </panel.string>
+ <text name="help_text">
+ Можно заблокировать доÑтуп в группу Ð´Ð»Ñ Ð½ÐµÑкольких жителей. Ð”Ð»Ñ Ñтого щелкните «Выбрать жителей».
+ </text>
+ <button label="Выбрать жителей" name="add_button"/>
+ <name_list name="banned_agent_list" tool_tip="Чтобы выбрать неÑкольких жителей, нажмите и удерживайте клавишу CTRL, а затем щелкните их имена"/>
+ <button label="Удалить выбранных из ÑпиÑка" name="remove_button" tool_tip="Удаление выбранных жителей из ÑпиÑка заблокированных пользователей"/>
+ <button label="Заблокировать жителей" name="ban_button"/>
+ <button label="Отмена" name="cancel_button"/>
+ <string name="GroupBulkBan">
+ Ð“Ñ€ÑƒÐ¿Ð¿Ð¾Ð²Ð°Ñ Ð±Ð»Ð¾ÐºÐ¸Ñ€Ð¾Ð²ÐºÐ°
+ </string>
+</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/ru/panel_group_info_sidetray.xml
index d8cf1b4756..16aaa71268 100755
--- a/indra/newview/skins/default/xui/ru/panel_group_info_sidetray.xml
+++ b/indra/newview/skins/default/xui/ru/panel_group_info_sidetray.xml
@@ -20,7 +20,7 @@
<layout_panel name="group_accordions">
<accordion name="groups_accordion">
<accordion_tab name="group_general_tab" title="Общие"/>
- <accordion_tab name="group_roles_tab" title="Роли"/>
+ <accordion_tab name="group_roles_tab" title="Роли и учаÑтники"/>
<accordion_tab name="group_notices_tab" title="УведомлениÑ"/>
<accordion_tab name="group_land_tab" title="ЗемлÑ/активы"/>
</accordion>
diff --git a/indra/newview/skins/default/xui/ru/panel_group_invite.xml b/indra/newview/skins/default/xui/ru/panel_group_invite.xml
index 68dac5cd7e..46424c168b 100755
--- a/indra/newview/skins/default/xui/ru/panel_group_invite.xml
+++ b/indra/newview/skins/default/xui/ru/panel_group_invite.xml
@@ -22,7 +22,7 @@
Выберите назначаемую им роль:
</text>
<combo_box name="role_name" tool_tip="Выберите в ÑпиÑке роли, которые вы можете назначать учаÑтникам"/>
- <button label="Отправить приглашениÑ" name="ok_button"/>
+ <button label="Отправить приглашениÑ" name="invite_button"/>
<button label="Отмена" name="cancel_button"/>
<string name="GroupInvitation">
Групповое приглашение
diff --git a/indra/newview/skins/default/xui/ru/panel_group_roles.xml b/indra/newview/skins/default/xui/ru/panel_group_roles.xml
index c57f21679f..88af469fbd 100755
--- a/indra/newview/skins/default/xui/ru/panel_group_roles.xml
+++ b/indra/newview/skins/default/xui/ru/panel_group_roles.xml
@@ -21,16 +21,18 @@
<name_list.columns label="УчаÑтник" name="name"/>
<name_list.columns label="Вклад" name="donated"/>
<name_list.columns label="СтатуÑ" name="online"/>
+ <name_list.columns label="Роль" name="title"/>
</name_list>
<button label="ПриглаÑить" name="member_invite"/>
<button label="Выкинуть" name="member_eject"/>
+ <button label="Заблокировать учаÑтников" name="member_ban"/>
</panel>
<panel label="РОЛИ" name="roles_sub_tab">
<panel.string name="help_text">
У ролей еÑть название и ÑпиÑок ÑпоÑобноÑтей,
-доÑтупных учаÑтникам. У учаÑтников может быть
-одна или неÑколько ролей. У группы может быть до 10 ролей,
-в том чиÑле роли «ВÑе» и «Владелец».
+ доÑтупных учаÑтникам. У учаÑтников может быть
+ одна или неÑколько ролей. У группы может быть до 10 ролей,
+ в том чиÑле роли «ВÑе» и «Владелец».
</panel.string>
<panel.string name="cant_delete_role">
Роли «ВÑе» и «Владелец» ÑвлÑÑŽÑ‚ÑÑ Ð¾Ñобыми и не могут быть удалены.
@@ -47,11 +49,26 @@
<panel label="СПОСОБÐОСТИ" name="actions_sub_tab" tool_tip="Можно проÑмотреть опиÑание ÑпоÑобноÑти, а также какие учаÑтники и роли ею обладают.">
<panel.string name="help_text">
СпоÑобноÑти позволÑÑŽÑ‚ учаÑтникам, которым назначены ÑоответÑтвующие роли, выполнÑть оÑобые
-дейÑÑ‚Ð²Ð¸Ñ Ð² группе. ИмеетÑÑ ÑˆÐ¸Ñ€Ð¾ÐºÐ¸Ð¹ выбор ÑпоÑобноÑтей.
+ дейÑÑ‚Ð²Ð¸Ñ Ð² группе. ИмеетÑÑ ÑˆÐ¸Ñ€Ð¾ÐºÐ¸Ð¹ выбор ÑпоÑобноÑтей.
</panel.string>
<filter_editor label="Фильтр ÑпоÑобноÑтей" name="filter_input"/>
<scroll_list name="action_list" tool_tip="Выберите ÑпоÑобноÑть, чтобы проÑмотреть данные о ней"/>
</panel>
+ <panel label="ЗÐБЛОКИРОВÐÐÐЫЕ ЖИТЕЛИ" name="banlist_sub_tab" tool_tip="ПроÑмотреть заблокированных жителей из Ñтой группы.">
+ <panel.string name="help_text">
+ Любой житель из ÑпиÑка заблокированных пользователей не Ñможет приÑоединитьÑÑ Ðº группе.
+ </panel.string>
+ <panel.string name="ban_count_template">
+ Кол-во заблокированных: [COUNT]/[LIMIT]
+ </panel.string>
+ <name_list name="ban_list">
+ <name_list.columns label="Житель" name="name"/>
+ <name_list.columns label="Дата блокировки" name="ban_date"/>
+ </name_list>
+ <button label="Заблокировать жителей" name="ban_create" tool_tip="Заблокировать жителей из вашей группы"/>
+ <button label="Разблокировать" name="ban_delete" tool_tip="Разблокировать выбранных жителей из вашей группы"/>
+ <button name="ban_refresh" tool_tip="Обновить ÑпиÑок заблокированных пользователей"/>
+ </panel>
</tab_container>
<panel name="members_footer">
<text name="static">
diff --git a/indra/newview/skins/default/xui/ru/panel_login.xml b/indra/newview/skins/default/xui/ru/panel_login.xml
index f0877731c6..a19304f2fd 100755
--- a/indra/newview/skins/default/xui/ru/panel_login.xml
+++ b/indra/newview/skins/default/xui/ru/panel_login.xml
@@ -1,46 +1,27 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8"?>
<panel name="panel_login">
<panel.string name="forgot_password_url">
http://secondlife.com/account/request.php
</panel.string>
- <layout_stack name="login_widgets">
- <layout_panel name="login">
- <text name="log_in_text">
- ВОЙТИ
- </text>
- <text name="username_text">
- Ð˜Ð¼Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ:
- </text>
- <combo_box name="username_combo" tool_tip="Ð˜Ð¼Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ, которое вы выбрали при региÑтрации, например, «bobsmith12» или «Steller Sunshine»"/>
- <text name="password_text">
- Пароль:
- </text>
- </layout_panel>
- <layout_panel name="start_location_panel">
- <text name="start_location_text">
- МеÑто Ñтарта:
- </text>
- <combo_box name="start_location_combo">
- <combo_box.item label="ПоÑледнее меÑтоположение" name="MyLastLocation"/>
- <combo_box.item label="Мой дом" name="MyHome"/>
- <combo_box.item label="&lt;Введите название региона&gt;" name="Typeregionname"/>
- </combo_box>
- </layout_panel>
- <layout_panel name="links_login_panel">
- <text name="login_help">
- Ðужна помощь при входе?
- </text>
+ <layout_stack name="ui_stack">
+ <layout_panel name="ui_container">
+ <combo_box label="Ð˜Ð¼Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ" name="username_combo" tool_tip="Ð˜Ð¼Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ, которое вы выбрали при региÑтрации, например, «bobsmith12» или «Steller Sunshine»"/>
+ <line_editor label="Пароль" name="password_edit"/>
+ <check_box label="Запомнить менÑ" name="remember_check"/>
<text name="forgot_password_text">
- Забыли Ð¸Ð¼Ñ Ð¸Ð»Ð¸ пароль?
+ Забыли пароль?
</text>
<button label="Войти" name="connect_btn"/>
- <check_box label="Запомнить пароль" name="remember_check"/>
- </layout_panel>
- <layout_panel name="links">
- <text name="create_account_text">
- СОЗДÐЙТЕ СВОЙ ÐККÐУÐТ
+ <text name="At_My_Last_Location_Label" font="SansSerifSmall">
+ Ð’ поÑледнее меÑто
</text>
- <button label="Ðачать" name="create_new_account_btn"/>
+ <combo_box label="Мои любимые меÑта" name="start_location_combo">
+ <combo_box.item label="Мой дом" name="MyHome"/>
+ </combo_box>
+ <button label="Войти" name="connect_favorite_btn"/>
+ <line_editor label="Введите меÑтоположение" name="location_edit" font="SansSerifSmall" />
+ <button label="Войти" name="connect_location_btn"/>
+ <combo_box label="Выберите Ñетку" name="server_combo"/>
</layout_panel>
</layout_stack>
</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_login_first.xml b/indra/newview/skins/default/xui/ru/panel_login_first.xml
new file mode 100644
index 0000000000..bb4875373a
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/panel_login_first.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_login">
+ <panel.string name="forgot_password_url">
+ http://secondlife.com/account/request.php
+ </panel.string>
+ <layout_stack name="logo_stack">
+ <layout_panel name="parent_panel2">
+ <layout_stack name="widget_stack">
+ <layout_panel name="widget_container">
+ <combo_box label="Ð˜Ð¼Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ" name="username_combo" tool_tip="Ð˜Ð¼Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ, которое вы выбрали при региÑтрации, например, «bobsmith12» или «Steller Sunshine»"/>
+ <line_editor label="Пароль" name="password_edit"/>
+ <button label="Войти" name="connect_btn"/>
+ <check_box label="Запомнить менÑ" name="remember_check"/>
+ <text name="forgot_password_text">
+ Забытый пароль
+ </text>
+ </layout_panel>
+ </layout_stack>
+ </layout_panel>
+ <layout_panel name="parent_panel3">
+ <layout_stack name="images_stack">
+ <layout_panel name="images_container">
+ <text name="image_caption_left">
+ Ваш первый шаг – Учебный оÑтров. Ðайдите портал выхода!
+ </text>
+ <text name="image_caption_right">
+ Затем иÑÑледуйте Социальный оÑтров и познакомьтеÑÑŒ Ñ Ð´Ñ€ÑƒÐ³Ð¸Ð¼Ð¸ новичками!
+ </text>
+ </layout_panel>
+ </layout_stack>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/ru/panel_preferences_advanced.xml
index 7d8ee96924..90743646fd 100755
--- a/indra/newview/skins/default/xui/ru/panel_preferences_advanced.xml
+++ b/indra/newview/skins/default/xui/ru/panel_preferences_advanced.xml
@@ -28,4 +28,5 @@
<check_box label="Выбор Ñетки при входе" name="show_grid_selection_check"/>
<check_box label="Показывать раÑширенное меню" name="show_advanced_menu_check"/>
<check_box label="Показывать меню разработчика" name="show_develop_menu_check"/>
+ <button label="Стандартные Ñ€Ð°Ð·Ñ€ÐµÑˆÐµÐ½Ð¸Ñ Ð½Ð° Ñоздание" name="default_creation_permissions"/>
</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_general.xml b/indra/newview/skins/default/xui/ru/panel_preferences_general.xml
index 62617caed3..b15d0e3abf 100755
--- a/indra/newview/skins/default/xui/ru/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/ru/panel_preferences_general.xml
@@ -29,14 +29,10 @@
<combo_box.item label="Общий и умеренный" name="Desired_Mature"/>
<combo_box.item label="Общий" name="Desired_PG"/>
</combo_box>
- <text name="start_location_textbox">
- МеÑто Ñтарта:
+ <check_box label="Показывать любимые меÑта на Ñкране входа" name="favorites_on_login_check"/>
+ <text name="favorites_check_extra_text">
+ (Другие пользователи Ñтого компьютера также увидÑÑ‚ их)
</text>
- <combo_box name="start_location_combo">
- <combo_box.item label="Мое поÑледнее меÑто" name="MyLastLocation"/>
- <combo_box.item label="Мой дом" name="MyHome"/>
- </combo_box>
- <check_box initial_value="true" label="Показывать на Ñкране входа" name="show_location_checkbox"/>
<text name="name_tags_textbox">
Теги имен:
</text>
diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/ru/panel_preferences_privacy.xml
index 20bb839eed..0a5974eed1 100755
--- a/indra/newview/skins/default/xui/ru/panel_preferences_privacy.xml
+++ b/indra/newview/skins/default/xui/ru/panel_preferences_privacy.xml
@@ -7,7 +7,7 @@
<text name="cache_size_label_l">
(МеÑта, картинки, Ñтраницы, журнал поиÑка)
</text>
- <check_box label="Показывать Ð¼ÐµÐ½Ñ Ð² результатах поиÑка" name="online_searchresults"/>
+ <check_box label="Показывать данные моего Ð¿Ñ€Ð¾Ñ„Ð¸Ð»Ñ Ð² результатах поиÑка" name="online_searchresults"/>
<check_box label="Только Ð´Ñ€ÑƒÐ·ÑŒÑ Ð¸ группы видÑÑ‚, когда Ñ Ð½Ð° ÑвÑзи" name="online_visibility"/>
<check_box label="Только Ð´Ñ€ÑƒÐ·ÑŒÑ Ð¸ группы могут звонить мне и отправлÑть IM" name="voice_call_friends_only_check"/>
<check_box label="Отключать микрофон по окончании разговора" name="auto_disengage_mic_check"/>
diff --git a/indra/newview/skins/default/xui/ru/panel_region_debug.xml b/indra/newview/skins/default/xui/ru/panel_region_debug.xml
index 4be1e781fa..d294a9e22e 100755
--- a/indra/newview/skins/default/xui/ru/panel_region_debug.xml
+++ b/indra/newview/skins/default/xui/ru/panel_region_debug.xml
@@ -28,7 +28,8 @@
<check_box label="С каждого региона Ñтого землевладениÑ" name="return_estate_wide" tool_tip="ВозвращаютÑÑ Ð¾Ð±ÑŠÐµÐºÑ‚Ñ‹ Ñо вÑех регионов, образующих Ñто землевладение"/>
<button label="Возврат" name="return_btn"/>
<button label="Самые активные учаÑтники Ñтолкновений..." name="top_colliders_btn" tool_tip="СпиÑок объектов, Ð´Ð»Ñ ÐºÐ¾Ñ‚Ð¾Ñ€Ñ‹Ñ… ÑÑ‚Ð¾Ð»ÐºÐ½Ð¾Ð²ÐµÐ½Ð¸Ñ Ð½Ð°Ð¸Ð±Ð¾Ð»ÐµÐµ вероÑтны"/>
- <button label="СпиÑок лучших Ñкриптов..." name="top_scripts_btn" tool_tip="Объекты, в которых Ñкрипты выполнÑÑŽÑ‚ÑÑ Ð´Ð¾Ð»ÑŒÑˆÐµ вÑего"/>
<button label="Перезагрузить регион" name="restart_btn" tool_tip="ОтÑчитать 2 минуты и перезагрузить регион"/>
+ <button label="СпиÑок лучших Ñкриптов..." name="top_scripts_btn" tool_tip="Объекты, в которых Ñкрипты выполнÑÑŽÑ‚ÑÑ Ð´Ð¾Ð»ÑŒÑˆÐµ вÑего"/>
<button label="Отменить перезапуÑк" name="cancel_restart_btn" tool_tip="Отменить перезапуÑк региона"/>
+ <button label="КонÑоль отладки региона" name="region_debug_console_btn" tool_tip="Открыть конÑоль отладки региона"/>
</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_region_general.xml b/indra/newview/skins/default/xui/ru/panel_region_general.xml
index 8559be6c9e..8b4a127d7e 100755
--- a/indra/newview/skins/default/xui/ru/panel_region_general.xml
+++ b/indra/newview/skins/default/xui/ru/panel_region_general.xml
@@ -20,12 +20,12 @@
</text>
<check_box label="Запретить терраформирование" name="block_terraform_check"/>
<check_box label="Запретить полеты" name="block_fly_check"/>
+ <check_box label="Запретить пролет над учаÑтком" name="block_fly_over_check" tool_tip="ПоднÑть проверку доÑтупа вверх Ð´Ð»Ñ Ð¿Ñ€ÐµÐ´Ð¾Ñ‚Ð²Ñ€Ð°Ñ‰ÐµÐ½Ð¸Ñ Ð¿Ñ€Ð¾Ð»ÐµÑ‚Ð° над учаÑтком"/>
<check_box label="Разрешить повреждениÑ" name="allow_damage_check"/>
<check_box label="Запретить толкание" name="restrict_pushobject"/>
<check_box label="Разрешить перепродажу земли" name="allow_land_resell_check"/>
<check_box label="Разрешить объединение/разделение земли" name="allow_parcel_changes_check"/>
<check_box label="Ðе показывать землю в поиÑке" name="block_parcel_search_check" tool_tip="Отображать регион и его учаÑтки в результатах поиÑка"/>
- <check_box label="Разрешить меши-объекты" name="mesh_rez_enabled_check" tool_tip="Разрешить жителÑм выкладывать меши в Ñтом регионе"/>
<spinner label="Лимит агентов" name="agent_limit_spin"/>
<spinner label="Льгота Ð´Ð»Ñ Ð¾Ð±ÑŠÐµÐºÑ‚Ð°" name="object_bonus_spin"/>
<text label="ДозволенноÑть" name="access_text">
diff --git a/indra/newview/skins/default/xui/ru/panel_script_ed.xml b/indra/newview/skins/default/xui/ru/panel_script_ed.xml
index a9e5d9ef10..54a1eaab75 100755
--- a/indra/newview/skins/default/xui/ru/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/ru/panel_script_ed.xml
@@ -24,6 +24,7 @@
<menu_item_call label="Отменить вÑе изменениÑ" name="Revert All Changes"/>
<menu_item_call label="Загрузить из файла..." name="LoadFromFile"/>
<menu_item_call label="Сохранить в файл..." name="SaveToFile"/>
+ <menu_item_call label="Цвета..." name="Colors"/>
</menu>
<menu label="Изменить" name="Edit">
<menu_item_call label="Отменить" name="Undo"/>
@@ -41,9 +42,9 @@
<menu_item_call label="Справка по ключевым Ñловам..." name="Keyword Help..."/>
</menu>
</menu_bar>
- <text_editor name="Script Editor">
+ <script_editor name="Script Editor">
Загрузка...
- </text_editor>
+ </script_editor>
<combo_box label="Ð’Ñтавить..." name="Insert..."/>
<button label="Сохранить" label_selected="Сохранить" name="Save_btn"/>
<button label="Изменить..." name="Edit_btn"/>
diff --git a/indra/newview/skins/default/xui/ru/panel_snapshot_options.xml b/indra/newview/skins/default/xui/ru/panel_snapshot_options.xml
index 250a76cd21..8cd69951ca 100755
--- a/indra/newview/skins/default/xui/ru/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/ru/panel_snapshot_options.xml
@@ -4,4 +4,13 @@
<button label="Отправить по почте" name="save_to_email_btn"/>
<button label="Сохранить в моем инвентаре (L$[AMOUNT])" name="save_to_inventory_btn"/>
<button label="Сохранить на моем компьютере" name="save_to_computer_btn"/>
+ <text name="send_to_facebook_textbox">
+ Отправить: [secondlife:/// Facebook]
+ </text>
+ <text name="send_to_twitter_textbox">
+ [secondlife:/// Twitter]
+ </text>
+ <text name="send_to_flickr_textbox">
+ [secondlife:/// Flickr]
+ </text>
</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_teleport_history_item.xml b/indra/newview/skins/default/xui/ru/panel_teleport_history_item.xml
index 90fb720068..fdcaa843ec 100755
--- a/indra/newview/skins/default/xui/ru/panel_teleport_history_item.xml
+++ b/indra/newview/skins/default/xui/ru/panel_teleport_history_item.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="teleport_history_item">
<text name="region" value="..."/>
+ <text name="timestamp" value="..."/>
<button name="profile_btn" tool_tip="Показать информацию"/>
</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_twitter_account.xml b/indra/newview/skins/default/xui/ru/panel_twitter_account.xml
new file mode 100644
index 0000000000..140554f5c6
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/panel_twitter_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_twitter_account">
+ <string name="twitter_connected" value="Ð’Ñ‹ подключилиÑÑŒ к Twitter как:"/>
+ <string name="twitter_disconnected" value="Ðе подключено к Twitter"/>
+ <text name="account_caption_label">
+ Ðе подключено к Twitter.
+ </text>
+ <panel name="panel_buttons">
+ <button label="Подключение..." name="connect_btn"/>
+ <button label="Отключить" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Twitter/ta-p/2435453 О публикации в Twitter]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/ru/panel_twitter_photo.xml b/indra/newview/skins/default/xui/ru/panel_twitter_photo.xml
new file mode 100644
index 0000000000..564d02411d
--- /dev/null
+++ b/indra/newview/skins/default/xui/ru/panel_twitter_photo.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_twitter_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="text_panel">
+ <text name="status_label">
+ Что ÑлучилоÑÑŒ?
+ </text>
+ <text name="status_counter_label">
+ 140
+ </text>
+ <check_box initial_value="true" label="Включить раÑположение в SL" name="add_location_cb"/>
+ <check_box initial_value="true" label="Включить фото" name="add_photo_cb"/>
+ </layout_panel>
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="Разрешение изображениÑ">
+ <combo_box.item label="Текущее окно" name="CurrentWindow"/>
+ <combo_box.item label="640x480" name="640x480"/>
+ <combo_box.item label="800x600" name="800x600"/>
+ <combo_box.item label="1024x768" name="1024x768"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="Фильтры изображений">
+ <combo_box.item label="Без фильтра" name="NoFilter"/>
+ </combo_box>
+ <button label="Обновить" name="new_snapshot_btn" tool_tip="Щелкните Ð´Ð»Ñ Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ"/>
+ <button label="ПроÑмотр" name="big_preview_btn" tool_tip="Щелкните Ð´Ð»Ñ Ñмены вида"/>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="Твит" name="post_photo_btn"/>
+ <button label="Отмена" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/ru/role_actions.xml b/indra/newview/skins/default/xui/ru/role_actions.xml
index 3f31ecfa10..a4ac7411a3 100755
--- a/indra/newview/skins/default/xui/ru/role_actions.xml
+++ b/indra/newview/skins/default/xui/ru/role_actions.xml
@@ -3,6 +3,7 @@
<action_set description="Эти ÑпоÑобноÑти позволÑÑŽÑ‚ добавлÑть и удалÑть учаÑтников группы, а также вÑтупать в группы без приглашениÑ." name="Membership">
<action description="Приглашение людей в Ñту группу" longdescription="ПриглаÑите людей в группу Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ кнопки «ПриглаÑить» в разделе «Роли» на вкладке «УчаÑтники»." name="member invite" value="1"/>
<action description="Удаление учаÑтников из группы" longdescription="Удалите учаÑтников из группы Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ кнопки «Выкинуть» в разделе «Роли» на вкладке «УчаÑтники». Владелец может удалÑть вÑех, кроме другого владельца. ЕÑли вы не владелец, то удалить учаÑтника из группы можно только в том Ñлучае, еÑли ему назначена ТОЛЬКО роль «ВÑе». Чтобы удалÑть учаÑтников из ролей, необходима ÑпоÑобноÑть «Удаление учаÑтников из ролей»." name="member eject" value="2"/>
+ <action description="Управление ÑпиÑком заблокированных пользователей" longdescription="Разрешить учаÑтнику группы блокировать/разблокировать жителей из Ñтой группы." name="allow ban" value="51"/>
<action description="Включение-отключение Ñвободного вÑÑ‚ÑƒÐ¿Ð»ÐµÐ½Ð¸Ñ Ð¸ изменение платы за вÑтупление" longdescription="Включение-отключение Ñвободного вÑтуплениÑ, что обеÑпечит вÑтупление новых учаÑтников без приглашениÑ, а также изменение платы за вÑтупление в разделе «Общие»." name="member options" value="3"/>
</action_set>
<action_set description="Эти ÑпоÑобноÑти позволÑÑŽÑ‚ добавлÑть, удалÑть и изменÑть роли группы, добавлÑть и удалÑть учаÑтников ролей, а также назначать ролÑм ÑпоÑобноÑти." name="Roles">
diff --git a/indra/newview/skins/default/xui/ru/sidepanel_inventory.xml b/indra/newview/skins/default/xui/ru/sidepanel_inventory.xml
index c106c2de79..725b680050 100755
--- a/indra/newview/skins/default/xui/ru/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/ru/sidepanel_inventory.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel label="Вещи" name="objects panel">
- <panel label="" name="sidepanel__inventory_panel">
+ <panel label="" name="sidepanel_inventory_panel">
<layout_stack name="inventory_layout_stack">
<layout_panel name="inbox_layout_panel">
<panel label="" name="marketplace_inbox">
@@ -28,13 +28,13 @@
<button label="Профиль" name="info_btn" tool_tip="Показать профиль объекта"/>
</layout_panel>
<layout_panel name="share_btn_lp">
- <button label="ПоделитьÑÑ" name="share_btn" tool_tip="ПоделитьÑÑ Ð²ÐµÑ‰ÑŒÑŽ из инвентарÑ"/>
+ <button label="ПоделитьÑÑ" name="share_btn" tool_tip="ПоделитьÑÑ Ð¾Ð±ÑŠÐµÐºÑ‚Ð¾Ð¼ из инвентарÑ"/>
</layout_panel>
<layout_panel name="shop_btn_lp">
- <button label="Торговый центр" name="shop_btn" tool_tip="Открыть Ñтраницу торгового центра"/>
+ <button label="Купить" name="shop_btn" tool_tip="Открыть Ñтраницу торгового центра"/>
<button label="Ðадеть" name="wear_btn" tool_tip="Ðадеть выбранный коÑтюм"/>
- <button label="Проиграть" name="play_btn"/>
- <button label="Телепорт" name="teleport_btn" tool_tip="ТелепортироватьÑÑ Ð² выбранную облаÑть"/>
+ <button label="Играть" name="play_btn"/>
+ <button label="ТелепортациÑ" name="teleport_btn" tool_tip="ТелепортироватьÑÑ Ð² выбранную облаÑть"/>
</layout_panel>
</layout_stack>
</panel>
diff --git a/indra/newview/skins/default/xui/ru/strings.xml b/indra/newview/skins/default/xui/ru/strings.xml
index 0f71edcee0..b7daab33a9 100755
--- a/indra/newview/skins/default/xui/ru/strings.xml
+++ b/indra/newview/skins/default/xui/ru/strings.xml
@@ -37,6 +37,45 @@
<string name="StartupRequireDriverUpdate">
Ошибка инициализации графики. Обновите графичеÑкий драйвер!
</string>
+ <string name="AboutHeader">
+ [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2] ([VIEWER_VERSION_3]) [BUILD_DATE] [BUILD_TIME] ([CHANNEL])
+[[VIEWER_RELEASE_NOTES_URL] [ReleaseNotes]]
+ </string>
+ <string name="AboutCompiler">
+ ИÑпользован компилÑтор [COMPILER], верÑÐ¸Ñ [COMPILER_VERSION]
+ </string>
+ <string name="AboutPosition">
+ Ð’Ñ‹ в точке [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] в регионе «[REGION]», раÑположенном на &lt;nolink&gt;[HOSTNAME]&lt;/nolink&gt; ([HOSTIP])
+SLURL: &lt;nolink&gt;[SLURL]&lt;/nolink&gt;
+(глобальные координаты [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1])
+[SERVER_VERSION]
+[SERVER_RELEASE_NOTES_URL]
+ </string>
+ <string name="AboutSystem">
+ ЦП: [CPU]
+ПамÑть: [MEMORY_MB] МБ
+ВерÑÐ¸Ñ ÐžÐ¡: [OS_VERSION]
+Производитель графичеÑкой платы: [GRAPHICS_CARD_VENDOR]
+ГрафичеÑÐºÐ°Ñ Ð¿Ð»Ð°Ñ‚Ð°: [GRAPHICS_CARD]
+ </string>
+ <string name="AboutDriver">
+ ВерÑÐ¸Ñ Ð³Ñ€Ð°Ñ„Ð¸Ñ‡ÐµÑкого драйвера Windows: [GRAPHICS_DRIVER_VERSION]
+ </string>
+ <string name="AboutLibs">
+ ВерÑÐ¸Ñ OpenGL: [OPENGL_VERSION]
+
+ВерÑÐ¸Ñ libcurl: [LIBCURL_VERSION]
+ВерÑÐ¸Ñ Ð´ÐµÐºÐ¾Ð´ÐµÑ€Ð° J2C: [J2C_VERSION]
+ВерÑÐ¸Ñ Ð´Ñ€Ð°Ð¹Ð²ÐµÑ€Ð° звука: [AUDIO_DRIVER_VERSION]
+ВерÑÐ¸Ñ Qt Webkit: [QT_WEBKIT_VERSION]
+ВерÑÐ¸Ñ Ð³Ð¾Ð»Ð¾Ñового Ñервера: [VOICE_VERSION]
+ </string>
+ <string name="AboutTraffic">
+ ПотерÑно пакетов: [PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number,1]%)
+ </string>
+ <string name="ErrorFetchingServerReleaseNotesURL">
+ Ошибка при получении URL-адреÑа заметок о выпуÑке Ñервера.
+ </string>
<string name="ProgressRestoring">
ВоÑÑтановление...
</string>
@@ -296,6 +335,75 @@ support@secondlife.com.
<string name="TestingDisconnect">
ТеÑтирование Ð¾Ñ‚ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ ÐºÐ»Ð¸ÐµÐ½Ñ‚Ð°
</string>
+ <string name="SocialFlickrConnecting">
+ Подключение к Flickr...
+ </string>
+ <string name="SocialFlickrPosting">
+ ПубликациÑ...
+ </string>
+ <string name="SocialFlickrDisconnecting">
+ Отключение от Flickr...
+ </string>
+ <string name="SocialFlickrErrorConnecting">
+ Ðеполадка при подключении к Flickr
+ </string>
+ <string name="SocialFlickrErrorPosting">
+ Ðеполадка при публикации в Flickr
+ </string>
+ <string name="SocialFlickrErrorDisconnecting">
+ Ðеполадка при отключении от Flickr
+ </string>
+ <string name="SocialTwitterConnecting">
+ Подключение к Twitter...
+ </string>
+ <string name="SocialTwitterPosting">
+ ПубликациÑ...
+ </string>
+ <string name="SocialTwitterDisconnecting">
+ Отключение от Twitter...
+ </string>
+ <string name="SocialTwitterErrorConnecting">
+ Ðеполадка при подключении к Twitter
+ </string>
+ <string name="SocialTwitterErrorPosting">
+ Ðеполадка при публикации в Twitter
+ </string>
+ <string name="SocialTwitterErrorDisconnecting">
+ Ðеполадка при отключении от Twitter
+ </string>
+ <string name="BlackAndWhite">
+ Черно-белый
+ </string>
+ <string name="Colors1970">
+ Цвета 1970-х
+ </string>
+ <string name="Intense">
+ ИнтенÑивный
+ </string>
+ <string name="Newspaper">
+ Газета
+ </string>
+ <string name="Sepia">
+ СепиÑ
+ </string>
+ <string name="Spotlight">
+ Прожектор
+ </string>
+ <string name="Video">
+ Видео
+ </string>
+ <string name="Autocontrast">
+ ÐвтоконтраÑÑ‚
+ </string>
+ <string name="LensFlare">
+ Блик
+ </string>
+ <string name="Miniature">
+ Миниатюра
+ </string>
+ <string name="Toycamera">
+ Ð˜Ð³Ñ€ÑƒÑˆÐµÑ‡Ð½Ð°Ñ ÐºÐ°Ð¼ÐµÑ€Ð°
+ </string>
<string name="TooltipPerson">
Человек
</string>
@@ -844,6 +952,12 @@ support@secondlife.com.
<string name="use_texture">
ИÑпользовать текÑтуру
</string>
+ <string name="manip_hint1">
+ Ðаведите указатель мыши на линейку
+ </string>
+ <string name="manip_hint2">
+ Ð´Ð»Ñ Ð¿Ñ€Ð¸Ð²Ñзки к Ñетке
+ </string>
<string name="texture_loading">
Загрузка...
</string>
@@ -934,15 +1048,15 @@ support@secondlife.com.
<string name="ControlYourCamera">
УправлÑть камерой
</string>
+ <string name="TeleportYourAgent">
+ Телепортировать ваÑ
+ </string>
<string name="NotConnected">
Ðет подключениÑ
</string>
<string name="AgentNameSubst">
(Ð’Ñ‹)
</string>
- <string name="TeleportYourAgent">
- Телепортировать ваÑ
- </string>
<string name="JoinAnExperience">
ПриÑоединитеÑÑŒ
</string>
@@ -1296,6 +1410,18 @@ support@secondlife.com.
<string name="InventoryOutboxNoItems">
Перетащите папки в Ñту облаÑть и щелкните «Отправить в торговый центр», чтобы выÑтавить их на продажу в [[MARKETPLACE_DASHBOARD_URL] Торговом центре].
</string>
+ <string name="InventoryOutboxInitializingTitle">
+ Ð˜Ð½Ð¸Ñ†Ð¸Ð°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ Ð¢Ð¾Ñ€Ð³Ð¾Ð²Ð¾Ð³Ð¾ центра.
+ </string>
+ <string name="InventoryOutboxInitializing">
+ Мы обращаемÑÑ Ðº вашему аккаунту в [[MARKETPLACE_CREATE_STORE_URL] магазине].
+ </string>
+ <string name="InventoryOutboxErrorTitle">
+ Ошибки торгового центра.
+ </string>
+ <string name="InventoryOutboxError">
+ [[MARKETPLACE_CREATE_STORE_URL] Магазин] возвращает ошибки.
+ </string>
<string name="Marketplace Error None">
Ошибок нет
</string>
@@ -1323,6 +1449,9 @@ support@secondlife.com.
<string name="Open landmarks">
Открыть закладки
</string>
+ <string name="Unconstrained">
+ Без ограничениÑ
+ </string>
<string name="no_transfer" value="(не передаетÑÑ)"/>
<string name="no_modify" value="(не изменÑетÑÑ)"/>
<string name="no_copy" value="(не копируетÑÑ)"/>
@@ -1723,6 +1852,9 @@ support@secondlife.com.
<string name="CompileQueueDownloadedCompiling">
Загружено, компилируетÑÑ
</string>
+ <string name="CompileQueueServiceUnavailable">
+ Служба ÐºÐ¾Ð¼Ð¿Ð¸Ð»Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ñкриптов недоÑтупна
+ </string>
<string name="CompileQueueScriptNotFound">
Скрипт не найден на Ñервере.
</string>
@@ -4020,6 +4152,12 @@ support@secondlife.com.
<string name="share_alert">
ПеретаÑкивайте вещи из Ð¸Ð½Ð²ÐµÐ½Ñ‚Ð°Ñ€Ñ Ñюда
</string>
+ <string name="flickr_post_success">
+ Ð’Ñ‹ опубликовали Ñообщение в Flickr.
+ </string>
+ <string name="twitter_post_success">
+ Ð’Ñ‹ опубликовали Ñообщение в Twitter.
+ </string>
<string name="no_session_message">
(Ð¡ÐµÐ°Ð½Ñ IM не ÑущеÑтвует)
</string>
@@ -4476,6 +4614,9 @@ support@secondlife.com.
<string name="LocalEstimateUSD">
[AMOUNT] US$
</string>
+ <string name="Group Ban">
+ Ð“Ñ€ÑƒÐ¿Ð¿Ð¾Ð²Ð°Ñ Ð±Ð»Ð¾ÐºÐ¸Ñ€Ð¾Ð²ÐºÐ°
+ </string>
<string name="Membership">
ЧленÑтво
</string>
@@ -4910,6 +5051,12 @@ support@secondlife.com.
<string name="Command_Destinations_Label">
Пункты
</string>
+ <string name="Command_Facebook_Label">
+ Facebook
+ </string>
+ <string name="Command_Flickr_Label">
+ Flickr
+ </string>
<string name="Command_Gestures_Label">
ЖеÑты
</string>
@@ -4958,6 +5105,9 @@ support@secondlife.com.
<string name="Command_Speak_Label">
Говорить
</string>
+ <string name="Command_Twitter_Label">
+ Twitter
+ </string>
<string name="Command_View_Label">
Управление камерой
</string>
@@ -4988,6 +5138,12 @@ support@secondlife.com.
<string name="Command_Destinations_Tooltip">
ИнтереÑные меÑта
</string>
+ <string name="Command_Facebook_Tooltip">
+ Опубликовать в Facebook
+ </string>
+ <string name="Command_Flickr_Tooltip">
+ Загрузить на Flickr
+ </string>
<string name="Command_Gestures_Tooltip">
ЖеÑты Ð´Ð»Ñ Ð°Ð²Ð°Ñ‚Ð°Ñ€Ð°
</string>
@@ -5036,6 +5192,9 @@ support@secondlife.com.
<string name="Command_Speak_Tooltip">
Говорите Ñ Ð»ÑŽÐ´ÑŒÐ¼Ð¸ вокруг Ð²Ð°Ñ Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ микрофона
</string>
+ <string name="Command_Twitter_Tooltip">
+ Twitter
+ </string>
<string name="Command_View_Tooltip">
Изменение угла камеры
</string>
diff --git a/indra/newview/skins/default/xui/tr/floater_big_preview.xml b/indra/newview/skins/default/xui/tr/floater_big_preview.xml
new file mode 100644
index 0000000000..c99a71d3c2
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/floater_big_preview.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_big_preview" title="ÖNİZLEME"/>
diff --git a/indra/newview/skins/default/xui/tr/floater_facebook.xml b/indra/newview/skins/default/xui/tr/floater_facebook.xml
new file mode 100644
index 0000000000..87f69fc731
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/floater_facebook.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_facebook" title="FACEBOOK&apos;TA YAYINLA">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="DURUM" name="panel_facebook_status"/>
+ <panel label="FOTOÄžRAF" name="panel_facebook_photo"/>
+ <panel label="KONUMA GİRİŞ YAPIN" name="panel_facebook_place"/>
+ <panel label="ARKADAÅžLAR" name="panel_facebook_friends"/>
+ <panel label="HESAP" name="panel_facebook_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ Hata
+ </text>
+ <text name="connection_loading_text">
+ Yükleniyor...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/tr/floater_flickr.xml b/indra/newview/skins/default/xui/tr/floater_flickr.xml
new file mode 100644
index 0000000000..4fa6770673
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/floater_flickr.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_flickr" title="FLICKR&apos;A YÜKLE">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="FOTOÄžRAF" name="panel_flickr_photo"/>
+ <panel label="HESAP" name="panel_flickr_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ Hata
+ </text>
+ <text name="connection_loading_text">
+ Yükleniyor...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/tr/floater_lagmeter.xml b/indra/newview/skins/default/xui/tr/floater_lagmeter.xml
index 736c50be90..736c50be90 100755..100644
--- a/indra/newview/skins/default/xui/tr/floater_lagmeter.xml
+++ b/indra/newview/skins/default/xui/tr/floater_lagmeter.xml
diff --git a/indra/newview/skins/default/xui/tr/floater_perms_default.xml b/indra/newview/skins/default/xui/tr/floater_perms_default.xml
new file mode 100644
index 0000000000..2f371c056c
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/floater_perms_default.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="perms default" title="VARSAYILAN OLUŞTURMA İZİNLERİ">
+ <panel label="Varsayılan İzinler" name="default permissions"/>
+ <button label="Tamam" label_selected="Tamam" name="ok"/>
+ <button label="İptal" label_selected="İptal" name="cancel"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/tr/floater_region_restarting.xml b/indra/newview/skins/default/xui/tr/floater_region_restarting.xml
new file mode 100644
index 0000000000..1f9ead8bdd
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/floater_region_restarting.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="region_restarting" title="BÖLGEYİ YENİDEN BAŞLAT">
+ <string name="RegionName">
+ Şu anda içinde bulunduğunuz bölge ([NAME]) yeniden başlatılmak üzere.
+
+Bu bölgede kalmaya devam ederseniz oturumunuz sonlandırılacak.
+ </string>
+ <string name="RestartSeconds">
+ Yeniden başlatma için kalan süre
+[SECONDS]
+ </string>
+ <panel name="layout_panel_1">
+ <text name="region_name">
+ Şu anda içinde bulunduğunuz bölge (-Bölgenin uzun adı-) yeniden başlatılmak üzere.
+
+Bu bölgede kalmaya devam ederseniz oturumunuz sonlandırılacak.
+ </text>
+ <text name="restart_seconds">
+ Yeniden başlatma için kalan süre
+ 32767
+ </text>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/tr/floater_report_abuse.xml b/indra/newview/skins/default/xui/tr/floater_report_abuse.xml
index c5765883c4..ea598a5669 100755
--- a/indra/newview/skins/default/xui/tr/floater_report_abuse.xml
+++ b/indra/newview/skins/default/xui/tr/floater_report_abuse.xml
@@ -35,7 +35,7 @@
<combo_box.item label="Yaş &gt; 18 Yaş Altı Second Life&apos;ında Yetişkin Sakin" name="Age__Adult_resident_on_Teen_Second_Life"/>
<combo_box.item label="Yaş &gt; 18 Yaş Altı Second Life&apos;ı dışında Reşit Olmayan Sakin" name="Age__Underage_resident_outside_of_Teen_Second_Life"/>
<combo_box.item label="Saldırı &gt; Çarpışma koruma alanı / güvensiz alan" name="Assault__Combat_sandbox___unsafe_area"/>
- <combo_box.item label="Saldırı &gt; Güvenli alan" name="Assault__Safe_area"/>
+ <combo_box.item label="Şiddet &gt; Güvenli bir Alanda başka bir LS Sakinini ateşli silahla vurmak ya da itip kakmak" name="Assault__Safe_area"/>
<combo_box.item label="Saldırı &gt; Silah test güvenli alanı" name="Assault__Weapons_testing_sandbox"/>
<combo_box.item label="Ticaret &gt; Ürün veya hizmet verilemedi" name="Commerce__Failure_to_deliver_product_or_service"/>
<combo_box.item label="İfşa &gt; Gerçek dünya bilgileri" name="Disclosure__Real_world_information"/>
@@ -49,25 +49,25 @@
<combo_box.item label="Dolandırıcılık &gt; L$" name="Fraud__L$"/>
<combo_box.item label="Dolandırıcılık &gt; Arazi" name="Fraud__Land"/>
<combo_box.item label="Dolandırıcılık &gt; Piramid planı veya zincirleme mektup" name="Fraud__Pyramid_scheme_or_chain_letter"/>
- <combo_box.item label="Dolandırıcılık &gt; US$" name="Fraud__US$"/>
+ <combo_box.item label="Dolandırıcılık &gt; L$ veya USD $" name="Fraud__US$"/>
<combo_box.item label="Taciz &gt; reklam çiftlikleri / görsel spam" name="Harassment__Advert_farms___visual_spam"/>
<combo_box.item label="Taciz &gt; Kişi ya da grupları aşağılama" name="Harassment__Defaming_individuals_or_groups"/>
<combo_box.item label="Taciz &gt; Tehditkâr hareket" name="Harassment__Impeding_movement"/>
<combo_box.item label="Taciz &gt; Cinsel taciz" name="Harassment__Sexual_harassment"/>
- <combo_box.item label="Taciz &gt; Başkalarını Hizmet Koşullarını ihlal etmeye kışkırtma/teşvik" name="Harassment__Solicting_inciting_others_to_violate_ToS"/>
+ <combo_box.item label="Taciz &gt; Birini rahatsız etmeye yönelik kasti hareket" name="Harassment__Solicting_inciting_others_to_violate_ToS"/>
<combo_box.item label="Taciz &gt; Sözlü istismar" name="Harassment__Verbal_abuse"/>
<combo_box.item label="Uygunsuzluk &gt; Genel anlamda rahatsız edici içerik veya davranış" name="Indecency__Broadly_offensive_content_or_conduct"/>
<combo_box.item label="Uygunsuzluk &gt; Uygunsuz avatar adı" name="Indecency__Inappropriate_avatar_name"/>
- <combo_box.item label="Uygunsuzluk &gt; PG bölgesinde rahatsız edici içerik veya davranış" name="Indecency__Mature_content_in_PG_region"/>
+ <combo_box.item label="Uygunsuzluk &gt; Bölge Seviyesine uygun olmayan rahatsız edici içerik veya davranış" name="Indecency__Mature_content_in_PG_region"/>
<combo_box.item label="Uygunsuzluk &gt; Orta bölgede rahatsız edici içerik veya davranış" name="Indecency__Inappropriate_content_in_Mature_region"/>
<combo_box.item label="Fikri mülkiyet ihlali &gt; İçerik Silme" name="Intellectual_property_infringement_Content_Removal"/>
<combo_box.item label="Fikri mülkiyet ihlali &gt; CopyBot veya İzinlerin Kötüye Kullanılması" name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit"/>
<combo_box.item label="Tahammülsüzlük" name="Intolerance"/>
<combo_box.item label="Arazi &gt; Koruma alanı kaynaklarının istismarı" name="Land__Abuse_of_sandbox_resources"/>
- <combo_box.item label="Arazi &gt; Tecavvüz &gt; Nesneler/dokular" name="Land__Encroachment__Objects_textures"/>
+ <combo_box.item label="Arazi &gt; Tecavüz &gt; Nesneler veya dokular" name="Land__Encroachment__Objects_textures"/>
<combo_box.item label="Arazi &gt; Tecavvüz &gt; Parçacıklar" name="Land__Encroachment__Particles"/>
<combo_box.item label="Arazi &gt; Tecavvüz &gt; Ağaçlar/bitkiler" name="Land__Encroachment__Trees_plants"/>
- <combo_box.item label="Bahis oynatma/kumar" name="Wagering_gambling"/>
+ <combo_box.item label="Bahis veya Kumar" name="Wagering_gambling"/>
<combo_box.item label="DiÄŸer" name="Other"/>
</combo_box>
<text name="abuser_name_title">
diff --git a/indra/newview/skins/default/xui/tr/floater_scene_load_stats.xml b/indra/newview/skins/default/xui/tr/floater_scene_load_stats.xml
new file mode 100644
index 0000000000..ae0a94595d
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/floater_scene_load_stats.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Scene Load Statistics" title="SAHNE YÜKLEME İSTATİSTİKLERİ">
+ <button label="Duraklat" name="playpause"/>
+ <scroll_container name="statistics_scroll">
+ <container_view name="statistics_view">
+ <stat_view label="Temel" name="basic">
+ <stat_bar label="Çerçeve Piksel Farkı" name="frame difference"/>
+ <stat_bar label="UDP Verileri Alındı" name="bandwidth"/>
+ <stat_bar label="Paket Kaybı" name="packet_loss"/>
+ </stat_view>
+ <stat_view label="GeliÅŸmiÅŸ" name="advanced">
+ <stat_view label="İşle" name="render">
+ <stat_bar label="Toplam Nesne" name="objs"/>
+ <stat_bar label="Yeni Nesne" name="newobjs"/>
+ <stat_bar label="Nesne Önbellek İsabet Oranı" name="object_cache_hits"/>
+ </stat_view>
+ <stat_view label="Doku" name="texture">
+ <stat_bar label="Önbellek İsabet Oranı" name="texture_cache_hits"/>
+ <stat_bar label="Önbellek Okuma Gecikme Süresi" name="texture_cache_read_latency"/>
+ <stat_bar label="Sayım" name="numimagesstat"/>
+ <stat_bar label="Ham Sayım" name="numrawimagesstat"/>
+ </stat_view>
+ <stat_view label="AÄŸ" name="network">
+ <stat_bar label="Gelen Paketler" name="packetsinstat"/>
+ <stat_bar label="Giden Paketler" name="packetsoutstat"/>
+ <stat_bar label="Nesneler" name="objectdatareceived"/>
+ <stat_bar label="Doku" name="texturedatareceived"/>
+ <stat_bar label="Varlık" name="assetudpdatareceived"/>
+ <stat_bar label="Katmanlar" name="layersdatareceived"/>
+ <stat_bar label="Gerçekte Gelen" name="messagedatain"/>
+ <stat_bar label="Gerçekte Giden" name="messagedataout"/>
+ <stat_bar label="VFS Bekleyen İşlemler" name="vfspendingoperations"/>
+ </stat_view>
+ </stat_view>
+ <stat_view label="Simülatör" name="sim">
+ <stat_bar label="Nesneler" name="simobjects"/>
+ <stat_bar label="Etkin Nesneler" name="simactiveobjects"/>
+ <stat_bar label="Etkin Komut Dosyaları" name="simactivescripts"/>
+ <stat_bar label="Gelen Paketler" name="siminpps"/>
+ <stat_bar label="Giden Paketler" name="simoutpps"/>
+ <stat_bar label="Bekleyen Karşıdan Yüklemeler" name="simpendingdownloads"/>
+ <stat_bar label="Bekleyen Karşıya Yüklemeler" name="simpendinguploads"/>
+ <stat_bar label="Toplam BildirilmiÅŸ Bayt" name="simtotalunackedbytes"/>
+ <stat_view label="Zaman (ms)" name="simperf">
+ <stat_bar label="Toplam Çerçeve Süresi" name="simframemsec"/>
+ <stat_bar label="Net Süre" name="simnetmsec"/>
+ <stat_bar label="Fizik Süresi" name="simsimphysicsmsec"/>
+ <stat_bar label="Simülasyon Süresi" name="simsimothermsec"/>
+ <stat_bar label="Aracı Süresi" name="simagentmsec"/>
+ <stat_bar label="Görüntü Süresi" name="simimagesmsec"/>
+ <stat_bar label="Komut Dosyası Süresi" name="simscriptmsec"/>
+ <stat_bar label="Yedek Zaman" name="simsparemsec"/>
+ <stat_view label="Zaman Ayrıntıları (ms)" name="timedetails">
+ <stat_bar label="Fizik Adımı" name="simsimphysicsstepmsec"/>
+ <stat_bar label="Fizik Şekillerini Güncelle" name="simsimphysicsshapeupdatemsec"/>
+ <stat_bar label="Fizik DiÄŸer" name="simsimphysicsothermsec"/>
+ <stat_bar label="Uyku Zamanı" name="simsleepmsec"/>
+ <stat_bar label="Pompa Giriş Çıkış" name="simpumpiomsec"/>
+ </stat_view>
+ </stat_view>
+ </stat_view>
+ </container_view>
+ </scroll_container>
+</floater>
diff --git a/indra/newview/skins/default/xui/tr/floater_script_ed_prefs.xml b/indra/newview/skins/default/xui/tr/floater_script_ed_prefs.xml
new file mode 100644
index 0000000000..2d0d8d580a
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/floater_script_ed_prefs.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_script_colors" title="YAZI RENKLERİ">
+ <text name="color_pickers_label">
+ İstediğiniz renkleri seçin:
+ </text>
+ <text name="text_label">
+ Metin
+ </text>
+ <text name="cursor_label">
+ İmleç
+ </text>
+ <text name="background_label">
+ Arka Plan
+ </text>
+ <text name="datatype_label">
+ Veri Türleri
+ </text>
+ <text name="event_label">
+ Etkinlikler
+ </text>
+ <text name="string_literal_label">
+ Dize DeÄŸiÅŸmezleri
+ </text>
+ <text name="constant_label">
+ Sabit
+ </text>
+ <text name="flow_control_label">
+ Akış Denetimi
+ </text>
+ <text name="function_label">
+ İşlev
+ </text>
+ <text name="comment_label">
+ Yorum
+ </text>
+ <script_editor name="Script Preview">
+ /* Örnek yazı */
+default
+{
+ state_entry()
+ {
+ // Yorum
+ string greeting = &quot;Merhaba&quot;;
+ llSay(PUBLIC_CHANNEL, greeting);
+ }
+}
+ </script_editor>
+</floater>
diff --git a/indra/newview/skins/default/xui/tr/floater_snapshot.xml b/indra/newview/skins/default/xui/tr/floater_snapshot.xml
index fa51f15d16..3f588522eb 100755
--- a/indra/newview/skins/default/xui/tr/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/tr/floater_snapshot.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Snapshot" title="ANLIK GÖRÜNTÜ ÖNİZLEME">
+<floater name="Snapshot" title="ANLIK GÖRÜNTÜ">
<floater.string name="unknown">
bilinmiyor
</floater.string>
@@ -61,5 +61,11 @@
<check_box label="BÜG&apos;ler" name="hud_check"/>
<check_box label="Kare dondur (tam ekran)" name="freeze_frame_check"/>
<check_box label="Otomatik yenile" name="auto_snapshot_check"/>
+ <text name="filter_list_label">
+ Filtre:
+ </text>
+ <combo_box name="filters_combobox" tool_tip="Görüntü filtreleri">
+ <combo_box.item label="Filtre Yok" name="NoFilter"/>
+ </combo_box>
</panel>
</floater>
diff --git a/indra/newview/skins/default/xui/tr/floater_stats.xml b/indra/newview/skins/default/xui/tr/floater_stats.xml
index afce87bdaa..1ae42ad382 100755
--- a/indra/newview/skins/default/xui/tr/floater_stats.xml
+++ b/indra/newview/skins/default/xui/tr/floater_stats.xml
@@ -4,17 +4,21 @@
<container_view name="statistics_view">
<stat_view label="Temel" name="basic">
<stat_bar label="FPS" name="fps"/>
- <stat_bar label="Bant geniÅŸliÄŸi" name="bandwidth"/>
+ <stat_bar label="UDP Verileri Alındı" name="bandwidth"/>
<stat_bar label="Paket Kaybı" name="packet_loss"/>
<stat_bar label="Sim Pingi" name="ping"/>
</stat_view>
<stat_view label="GeliÅŸmiÅŸ" name="advanced">
<stat_view label="İşle" name="render">
- <stat_bar label="Çerçeve Başına Çizilen Üçgenler" name="ktrisframe"/>
- <stat_bar label="Saniyede Bir Çizilen Üçgenler" name="ktrissec"/>
- <stat_bar label="Toplam Nesne" name="objs"/>
+ <stat_bar label="Çerçeve Başına Üçgenler" name="ktrisframe"/>
+ <stat_bar label="Saniye Başına Üçgenler" name="ktrissec"/>
+ <stat_bar label="Toplam Nesne" name="totalobjs"/>
+ <stat_bar label="Önbelleğe Alınan Nesne" name="cachedobjs"/>
<stat_bar label="Yeni Nesne" name="newobjs"/>
<stat_bar label="Nesne Önbellek İsabet Oranı" name="object_cache_hits"/>
+ <stat_bar label="Gerçekleştirilen Gölgeleme Sorguları" name="occlusion_queries"/>
+ <stat_bar label="Gölgelenen Nesneler" name="occluded"/>
+ <stat_bar label="Gölgelenmeye Nesneler" name="unoccluded"/>
</stat_view>
<stat_view label="Doku" name="texture">
<stat_bar label="Önbellek İsabet Oranı" name="texture_cache_hits"/>
@@ -26,15 +30,32 @@
<stat_bar label="Ham Bellek" name="rawmemstat"/>
<stat_bar label="Bağlı Doku Belleği" name="glboundmemstat"/>
</stat_view>
+ <stat_view label="Bellek Kullanımı" name="memory">
+ <stat_bar label="LLTrace" name="LLTrace"/>
+ <stat_bar label="KA" name="LLView"/>
+ <stat_bar label="Fontlar" name="LLFontFreetype"/>
+ <stat_bar label="Envanter" name="LLInventoryObject"/>
+ <stat_bar label="Görüntüleyici Nesneleri" name="LLViewerObject"/>
+ <stat_bar label="Gölgeleme Ağacı Grup Verileri" name="LLViewerOctreeGroup"/>
+ <stat_bar label="Gölgeleme Ağacı Verileri" name="LLViewerOctreeEntry"/>
+ <stat_bar label="Görüntüleyici Nesne Önbelleği" name="LLVOCacheEntry"/>
+ <stat_bar label="Çizilebilir nesneler" name="LLDrawable"/>
+ <stat_bar label="Yüz Verileri" name="LLFace"/>
+ <stat_bar label="Çizim Bilgileri" name="LLDrawInfo"/>
+ <stat_bar label="Doku Verileri" name="LLTexture"/>
+ <stat_bar label="Görüntü Verileri" name="LLImage"/>
+ <stat_bar label="GL Görüntü Verileri" name="LLImageGL"/>
+ <stat_bar label="Vertex Tamponları" name="LLVertexBuffer"/>
+ </stat_view>
<stat_view label="AÄŸ" name="network">
<stat_bar label="Gelen Paketler" name="packetsinstat"/>
<stat_bar label="Giden Paketler" name="packetsoutstat"/>
- <stat_bar label="Nesneler" name="objectkbitstat"/>
- <stat_bar label="Doku" name="texturekbitstat"/>
- <stat_bar label="Varlık" name="assetkbitstat"/>
- <stat_bar label="Katmanlar" name="layerskbitstat"/>
- <stat_bar label="Gerçekte Gelen" name="actualinkbitstat"/>
- <stat_bar label="Gerçekte Giden" name="actualoutkbitstat"/>
+ <stat_bar label="Nesneler" name="objectdatareceived"/>
+ <stat_bar label="Doku" name="texturedatareceived"/>
+ <stat_bar label="Varlık" name="assetudpdatareceived"/>
+ <stat_bar label="Katmanlar" name="layersdatareceived"/>
+ <stat_bar label="Gerçekte Gelen" name="messagedatain"/>
+ <stat_bar label="Gerçekte Giden" name="messagedataout"/>
<stat_bar label="VFS Bekleyen İşlemler" name="vfspendingoperations"/>
</stat_view>
</stat_view>
@@ -64,8 +85,8 @@
<stat_bar label="Giden Paketler" name="simoutpps"/>
<stat_bar label="Bekleyen Karşıdan Yüklemeler" name="simpendingdownloads"/>
<stat_bar label="Bekleyen Karşıya Yüklemeler" name="simpendinguploads"/>
- <stat_bar label="Toplam BildirilmiÅŸ Bayt" name="simtotalunackedbytes"/>
- <stat_view label="Zaman (ms)" name="simperf">
+ <stat_bar label="Toplam BildirilmiÅŸ Veriler" name="simtotalunackedbytes"/>
+ <stat_view label="Süre" name="simperf">
<stat_bar label="Toplam Çerçeve Süresi" name="simframemsec"/>
<stat_bar label="Net Süre" name="simnetmsec"/>
<stat_bar label="Fizik Süresi" name="simsimphysicsmsec"/>
@@ -74,7 +95,7 @@
<stat_bar label="Görüntü Süresi" name="simimagesmsec"/>
<stat_bar label="Komut Dosyası Süresi" name="simscriptmsec"/>
<stat_bar label="Yedek Zaman" name="simsparemsec"/>
- <stat_view label="Zaman Ayrıntıları (ms)" name="timedetails">
+ <stat_view label="Zaman Ayrıntıları" name="timedetails">
<stat_bar label="Fizik Adımı" name="simsimphysicsstepmsec"/>
<stat_bar label="Fizik Şekillerini Güncelle" name="simsimphysicsshapeupdatemsec"/>
<stat_bar label="Fizik DiÄŸer" name="simsimphysicsothermsec"/>
diff --git a/indra/newview/skins/default/xui/tr/floater_tools.xml b/indra/newview/skins/default/xui/tr/floater_tools.xml
index 39a3569efa..56df06f83b 100755
--- a/indra/newview/skins/default/xui/tr/floater_tools.xml
+++ b/indra/newview/skins/default/xui/tr/floater_tools.xml
@@ -73,9 +73,7 @@
<check_box label="Bağlantılıları düzenle" name="checkbox edit linked parts"/>
<button label="BaÄŸla" name="link_btn"/>
<button label="Bağlantıyı Kopar" name="unlink_btn"/>
- <text label="Her İki Tarafı Uzat" name="checkbox uniform label">
- Her İki Tarafı Uzat
- </text>
+ <check_box label="Her İki Tarafı Uzat" name="checkbox uniform"/>
<check_box initial_value="true" label="Dokuları Uzat" name="checkbox stretch textures"/>
<check_box initial_value="true" label="Yasla" name="checkbox snap to grid"/>
<combo_box name="combobox grid mode" tool_tip="Nesneyi konumlandırmak için ağ cetvelini seçin">
@@ -410,82 +408,7 @@
<spinner label="100 kg/m3 cinsinden yoÄŸunluk" name="Physics Density"/>
<spinner label="Restitüsyon" name="Physics Restitution"/>
</panel>
- <panel label="Doku" name="Texture">
- <panel.string name="string repeats per meter">
- Metrede Kaç Kez Tekrarlandığı
- </panel.string>
- <panel.string name="string repeats per face">
- Bir Yüzde Kaç Kez Tekrarlandığı
- </panel.string>
- <texture_picker label="Doku" name="texture control" tool_tip="Bir resim seçmek için tıklayın"/>
- <color_swatch label="Renk" name="colorswatch" tool_tip="Renk seçiciyi açmak için tıklayın"/>
- <text name="color trans">
- Saydamlık %
- </text>
- <text name="glow label">
- Parıltı
- </text>
- <check_box label="Tam Parlak" name="checkbox fullbright"/>
- <text name="tex gen">
- EÅŸleÅŸtirme
- </text>
- <combo_box name="combobox texgen">
- <combo_box.item label="Varsayılan" name="Default"/>
- <combo_box.item label="Planar" name="Planar"/>
- </combo_box>
- <text name="label shininess">
- Parıldama
- </text>
- <combo_box name="combobox shininess">
- <combo_box.item label="Hiçbiri" name="None"/>
- <combo_box.item label="Düşük" name="Low"/>
- <combo_box.item label="Orta" name="Medium"/>
- <combo_box.item label="Yüksek" name="High"/>
- </combo_box>
- <text name="label bumpiness">
- Yumruluk
- </text>
- <combo_box name="combobox bumpiness">
- <combo_box.item label="Hiçbiri" name="None"/>
- <combo_box.item label="Parlaklık" name="Brightness"/>
- <combo_box.item label="Koyuluk" name="Darkness"/>
- <combo_box.item label="damarlı ahşap" name="woodgrain"/>
- <combo_box.item label="ağaç kabuğu" name="bark"/>
- <combo_box.item label="tuÄŸlalar" name="bricks"/>
- <combo_box.item label="dama tahtası" name="checker"/>
- <combo_box.item label="beton" name="concrete"/>
- <combo_box.item label="sert çini" name="crustytile"/>
- <combo_box.item label="kesilmiÅŸ taÅŸ" name="cutstone"/>
- <combo_box.item label="diskler" name="discs"/>
- <combo_box.item label="çakıl" name="gravel"/>
- <combo_box.item label="petri kabı" name="petridish"/>
- <combo_box.item label="dış kaplama" name="siding"/>
- <combo_box.item label="taş çini" name="stonetile"/>
- <combo_box.item label="stükko" name="stucco"/>
- <combo_box.item label="vakum" name="suction"/>
- <combo_box.item label="örgü" name="weave"/>
- </combo_box>
- <spinner label="Yatay (U)" name="TexScaleU"/>
- <check_box label="Çevir" name="checkbox flip s"/>
- <spinner label="Dikey (V)" name="TexScaleV"/>
- <check_box label="Çevir" name="checkbox flip t"/>
- <spinner label="Döndürme*" name="TexRot"/>
- <button label="Uygula" label_selected="Uygula" name="button apply"/>
- <text name="tex offset">
- Doku Dengeleyicisi
- </text>
- <spinner label="Yatay (U)" name="TexOffsetU"/>
- <spinner label="Dikey (V)" name="TexOffsetV"/>
- <panel name="Add_Media">
- <text name="media_tex">
- Ortam
- </text>
- <button name="add_media" tool_tip="Ortam Ekle"/>
- <button name="delete_media" tool_tip="Bu ortam dokusunu sil"/>
- <button name="edit_media" tool_tip="Bu Ortamı Düzenle"/>
- <button label="Hizala" label_selected="Ortamı Hizala" name="button align" tool_tip="Ortam dokusunu hizala (önce yüklenmelidir)"/>
- </panel>
- </panel>
+ <panel label="Doku" name="Texture"/>
<panel label="İçerik" name="Contents">
<button label="Yeni Komut Dosyası" label_selected="Yeni Komut Dosyası" name="button new script"/>
<button label="İzinler" name="button permissions"/>
diff --git a/indra/newview/skins/default/xui/tr/floater_twitter.xml b/indra/newview/skins/default/xui/tr/floater_twitter.xml
new file mode 100644
index 0000000000..3060bd1c84
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/floater_twitter.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_twitter" title="TWITTER">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="OLUÅžTUR" name="panel_twitter_photo"/>
+ <panel label="HESAP" name="panel_twitter_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ Hata
+ </text>
+ <text name="connection_loading_text">
+ Yükleniyor...
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/tr/menu_avatar_icon.xml b/indra/newview/skins/default/xui/tr/menu_avatar_icon.xml
index d3ef490735..dc3724cfc8 100755
--- a/indra/newview/skins/default/xui/tr/menu_avatar_icon.xml
+++ b/indra/newview/skins/default/xui/tr/menu_avatar_icon.xml
@@ -2,6 +2,7 @@
<menu name="Avatar Icon Menu">
<menu_item_call label="Profili Göster" name="Show Profile"/>
<menu_item_call label="Aİ Gönder..." name="Send IM"/>
+ <menu_item_call label="Işınlanma Talep Et" name="Request Teleport"/>
<menu_item_call label="ArkadaÅŸ Ekle..." name="Add Friend"/>
<menu_item_call label="Arkadaşı Çıkar..." name="Remove Friend"/>
</menu>
diff --git a/indra/newview/skins/default/xui/tr/menu_conversation.xml b/indra/newview/skins/default/xui/tr/menu_conversation.xml
index c2773cdc26..68c9af15b5 100644
--- a/indra/newview/skins/default/xui/tr/menu_conversation.xml
+++ b/indra/newview/skins/default/xui/tr/menu_conversation.xml
@@ -29,4 +29,5 @@
<menu_item_call label="Herkesi engelle" name="ModerateVoiceMute"/>
<menu_item_call label="Herkesin engellemesini kaldır" name="ModerateVoiceUnmute"/>
</context_menu>
+ <menu_item_call label="Üyeyi yasakla" name="BanMember"/>
</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/tr/menu_inventory.xml b/indra/newview/skins/default/xui/tr/menu_inventory.xml
index 51049427af..7239c4be06 100755
--- a/indra/newview/skins/default/xui/tr/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/tr/menu_inventory.xml
@@ -70,6 +70,7 @@
<menu_item_call label="Oyna" name="Sound Play"/>
<menu_item_call label="SLurl&apos;i Kopyala" name="url_copy"/>
<menu_item_call label="Yer İmi Hakkında" name="About Landmark"/>
+ <menu_item_call label="Haritada Göster" name="show_on_map"/>
<menu_item_call label="SL Dünyasında Oynat" name="Animation Play"/>
<menu_item_call label="Yerel Olarak Oynat" name="Animation Audition"/>
<menu_item_call label="Anlık İleti Gönder" name="Send Instant Message"/>
diff --git a/indra/newview/skins/default/xui/tr/menu_login.xml b/indra/newview/skins/default/xui/tr/menu_login.xml
index 79c95407e8..ecd29370a5 100755
--- a/indra/newview/skins/default/xui/tr/menu_login.xml
+++ b/indra/newview/skins/default/xui/tr/menu_login.xml
@@ -5,7 +5,15 @@
<menu_item_call label="[APP_NAME]&apos;den Çık" name="Quit"/>
</menu>
<menu label="Yardım" name="Help">
- <menu_item_call label="[SECOND_LIFE] Yardımı" name="Second Life Help"/>
+ <menu_item_call label="Nasıl yapılır..." name="How To"/>
+ <menu_item_call label="Hızlı Başlangıç" name="Quickstart"/>
+ <menu_item_call label="Bilgi Bankası" name="Knowledge Base"/>
+ <menu_item_call label="Wiki" name="Wiki"/>
+ <menu_item_call label="Topluluk Forumları" name="Community Forums"/>
+ <menu_item_call label="Destek porteli" name="Support portal"/>
+ <menu_item_call label="[SECOND_LIFE] Haberler" name="Second Life News"/>
+ <menu_item_call label="[SECOND_LIFE] Bloklar" name="Second Life Blogs"/>
+ <menu_item_call label="Hata Bildir" name="Report Bug"/>
<menu_item_call label="[APP_NAME] Hakkında" name="About Second Life"/>
</menu>
<menu_item_check label="Hata Ayıklama Menüsünü Göster" name="Show Debug Menu"/>
diff --git a/indra/newview/skins/default/xui/tr/menu_object.xml b/indra/newview/skins/default/xui/tr/menu_object.xml
index 2f8b5c0362..cfc9515d8f 100755
--- a/indra/newview/skins/default/xui/tr/menu_object.xml
+++ b/indra/newview/skins/default/xui/tr/menu_object.xml
@@ -19,6 +19,7 @@
<context_menu label="Yönet" name="Remove">
<menu_item_call label="Kötüye Kullanımı Bildir" name="Report Abuse..."/>
<menu_item_call label="Engelle" name="Object Mute"/>
+ <menu_item_call label="Engellemeyi Kaldır" name="Object Unmute"/>
<menu_item_call label="İade Et" name="Return..."/>
</context_menu>
<menu_item_call label="Al" name="Pie Object Take"/>
diff --git a/indra/newview/skins/default/xui/tr/menu_teleport_history_item.xml b/indra/newview/skins/default/xui/tr/menu_teleport_history_item.xml
index 93984162e7..d7ff807c3d 100755
--- a/indra/newview/skins/default/xui/tr/menu_teleport_history_item.xml
+++ b/indra/newview/skins/default/xui/tr/menu_teleport_history_item.xml
@@ -2,5 +2,5 @@
<context_menu name="Teleport History Item Context Menu">
<menu_item_call label="Işınla" name="Teleport"/>
<menu_item_call label="Ek Bilgi" name="More Information"/>
- <menu_item_call label="Panoya Kopyala" name="CopyToClipboard"/>
+ <menu_item_call label="SLurl&apos;i Kopyala" name="CopyToClipboard"/>
</context_menu>
diff --git a/indra/newview/skins/default/xui/tr/menu_viewer.xml b/indra/newview/skins/default/xui/tr/menu_viewer.xml
index 4236f91636..23e2903e03 100755
--- a/indra/newview/skins/default/xui/tr/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/tr/menu_viewer.xml
@@ -34,6 +34,9 @@
<menu_item_check label="Yakındaki Sohbet..." name="Nearby Chat"/>
<menu_item_check label="KonuÅŸ" name="Speak"/>
<menu_item_check label="Sohbet Günlüğü..." name="Conversation Log..."/>
+ <menu_item_call label="Facebook..." name="Facebook"/>
+ <menu_item_call label="Twitter..." name="Twitter"/>
+ <menu_item_call label="Flickr..." name="Flickr"/>
<menu label="Ses ÅŸekillendirme" name="VoiceMorphing">
<menu_item_check label="Ses ÅŸekillendirme yok" name="NoVoiceMorphing"/>
<menu_item_check label="Önizleme..." name="Preview"/>
@@ -70,11 +73,11 @@
<menu_item_check label="Gelişmiş Menü" name="Show Advanced Menu"/>
</menu>
<menu label="Güneş" name="Sun">
- <menu_item_call label="Gün Doğumu" name="Sunrise"/>
- <menu_item_call label="Gün Ortası" name="Noon"/>
- <menu_item_call label="Gün Batımı" name="Sunset"/>
- <menu_item_call label="Gece Yarısı" name="Midnight"/>
- <menu_item_call label="Bölge Ayarlarını Kullan" name="Use Region Settings"/>
+ <menu_item_check label="Gün Doğumu" name="Sunrise"/>
+ <menu_item_check label="Gün Ortası" name="Noon"/>
+ <menu_item_check label="Gün Batımı" name="Sunset"/>
+ <menu_item_check label="Gece Yarısı" name="Midnight"/>
+ <menu_item_check label="Bölge Ayarlarını Kullan" name="Use Region Settings"/>
</menu>
<menu label="Ortam Düzenleyici" name="Environment Editor">
<menu_item_call label="Ortam Ayarları..." name="Environment Settings"/>
@@ -148,7 +151,8 @@
<menu_item_check label="AÄŸa Uydur" name="Snap to Grid"/>
<menu_item_call label="XY Nesnesini AÄŸa Uydur" name="Snap Object XY to Grid"/>
<menu_item_call label="Ağ İçin Seçimi Kullan" name="Use Selection for Grid"/>
- <menu_item_call label="Ağ Seçenekleri" name="Grid Options"/>
+ <menu_item_call label="Ağ Seçenekleri..." name="Grid Options"/>
+ <menu_item_call label="Varsayılan İzinleri Ayarla..." name="Set default permissions"/>
</menu>
<menu label="Karşıya Yükle" name="Upload">
<menu_item_call label="Görüntü (L$[COST])..." name="Upload Image"/>
@@ -156,15 +160,12 @@
<menu_item_call label="Animasyon (L$[COST])..." name="Upload Animation"/>
<menu_item_call label="Model..." name="Upload Model"/>
<menu_item_call label="Toplu (dosya başına L$[COST])..." name="Bulk Upload"/>
- <menu_item_call label="Varsayılan Karşıya Yükleme İzinlerini Ayarla" name="perm prefs"/>
</menu>
<menu_item_call label="Geri Al" name="Undo"/>
<menu_item_call label="Yinele" name="Redo"/>
</menu>
<menu label="Yardım" name="Help">
<menu_item_call label="Nasıl yapılır..." name="How To"/>
- <menu_item_call label="[SECOND_LIFE] Yardımı" name="Second Life Help"/>
- <menu_item_call label="Kullanıcı kılavuzu" name="User’s guide"/>
<menu_item_call label="Bilgi Bankası" name="Knowledge Base"/>
<menu_item_call label="Wiki" name="Wiki"/>
<menu_item_call label="Topluluk Forumları" name="Community Forums"/>
@@ -186,6 +187,7 @@
<menu label="Performans Araçları" name="Performance Tools">
<menu_item_call label="Gecikme Ölçer" name="Lag Meter"/>
<menu_item_check label="İstatistik Çubuğu" name="Statistics Bar"/>
+ <menu_item_call label="Sahne Yükleme İstatistikleri" name="Scene Load Statistics"/>
<menu_item_check label="Avatarlar İçin Çizim Ağırlığını Göster" name="Avatar Rendering Cost"/>
</menu>
<menu label="Vurgulama ve Görünürlük" name="Highlighting and Visibility">
@@ -248,6 +250,7 @@
<menu_item_check label="Hızlı Zamanlayıcılar" name="Fast Timers"/>
<menu_item_check label="Bellek" name="Memory"/>
<menu_item_check label="Sahne İstatistikleri" name="Scene Statistics"/>
+ <menu_item_check label="Sahne Yükleme Ekranı" name="Scene Loading Monitor"/>
<menu_item_call label="Doku Alınması Hata Ayıklama Konsolu" name="Texture Fetch Debug Console"/>
<menu_item_call label="Hata Ayıklama Konsoluna giden Bölge Bilgisi" name="Region Info to Debug Console"/>
<menu_item_call label="Hata Ayıklama Konsoluna giden Grup Bilgisi" name="Group Info to Debug Console"/>
@@ -284,6 +287,7 @@
<menu_item_check label="Düzenli Yavaş Çerçeve" name="Periodic Slow Frame"/>
<menu_item_check label="Çerçeve Testi" name="Frame Test"/>
<menu_item_call label="Çerçeve Profili..." name="Frame Profile"/>
+ <menu_item_call label="DeÄŸerlendirme" name="Benchmark"/>
</menu>
<menu label="Meta Verileri İşle" name="Render Metadata">
<menu_item_check label="Sınırlama Kutuları" name="Bounding Boxes"/>
@@ -301,7 +305,9 @@
<menu_item_check label="Ayrıntı Seviyesi Bilgisi" name="LOD Info"/>
<menu_item_check label="İnşa Kuyruğu" name="Build Queue"/>
<menu_item_check label="Işıklar" name="Lights"/>
+ <menu_item_check label="Parçacıklar" name="Particles"/>
<menu_item_check label="Çarpışma İskeleti" name="Collision Skeleton"/>
+ <menu_item_check label="Eklemler" name="Joints"/>
<menu_item_check label="Işın Yayını" name="Raycast"/>
<menu_item_check label="Rüzgar Vektörleri" name="Wind Vectors"/>
<menu_item_check label="İşleme Karmaşıklığı" name="rendercomplexity"/>
@@ -334,6 +340,7 @@
<menu_item_check label="Eklenmiş Işıkları İşle" name="Render Attached Lights"/>
<menu_item_check label="Eklenmiş Parçacıkları İşle" name="Render Attached Particles"/>
<menu_item_check label="Parıldayan Nesneler Üzerine Gel" name="Hover Glow Objects"/>
+ <menu_item_call label="Önbelleği Hemen Temizle" name="Cache Clear"/>
</menu>
<menu label="AÄŸ" name="Network">
<menu_item_check label="Aracıyı Durdur" name="AgentPause"/>
@@ -366,7 +373,6 @@
<menu_item_call label="Odaklayıcı Tutucunun Dökümünü Al" name="Dump Focus Holder"/>
<menu_item_call label="Seçilen Nesne Bilgisini Yazdır" name="Print Selected Object Info"/>
<menu_item_call label="Aracı Bilgisini Yazdır" name="Print Agent Info"/>
- <menu_item_check label="Bölge Hata Ayıklama Konsolu" name="Region Debug Console"/>
<menu_item_check label="SelectMgr İçin Hata Ayıklama" name="Debug SelectMgr"/>
<menu_item_check label="Tıklamalar İçin Hata Ayıklama" name="Debug Clicks"/>
<menu_item_check label="Görünümler için Hata Ayıklama" name="Debug Views"/>
diff --git a/indra/newview/skins/default/xui/tr/notifications.xml b/indra/newview/skins/default/xui/tr/notifications.xml
index 492178ab82..2364bd5acf 100755
--- a/indra/newview/skins/default/xui/tr/notifications.xml
+++ b/indra/newview/skins/default/xui/tr/notifications.xml
@@ -114,13 +114,13 @@ Daha fazla bilgi için bkz. [[MARKETPLACE_IMPORTS_URL] hata günlüğü].
<usetemplate name="okbutton" yestext="Tamam"/>
</notification>
<notification name="OutboxImportFailed">
- Aktarım başarılamadı
+ Aktarım &apos;[ERROR_CODE]&apos; hatası nedeniyle başarısız oldu
Bir sistem veya ağ hatası nedeniyle Pazaryerine hiçbir klasör gönderilemedi. Daha sonra tekrar deneyin.
<usetemplate name="okbutton" yestext="Tamam"/>
</notification>
<notification name="OutboxInitFailed">
- Pazaryeri başlatılamadı.
+ Pazaryeri başlatılması &apos;[ERROR_CODE]&apos; hatası nedeniyle başarısız oldu
Bir sistem veya ağ hatası nedeniyle Pazaryeri başlatılamadı. Daha sonra tekrar deneyin.
<usetemplate name="okbutton" yestext="Tamam"/>
@@ -210,6 +210,22 @@ Bu Yetenek &apos;[ROLE_NAME]&apos; rolüne eklensin mi?
Bu Yetenek &apos;[ROLE_NAME]&apos; rolüne eklensin mi?
<usetemplate name="okcancelbuttons" notext="Hayır" yestext="Evet"/>
</notification>
+ <notification name="AssignBanAbilityWarning">
+ &quot;[ROLE_NAME]&quot; rolüne &quot;[ACTION_NAME]&quot; yeteneğini eklemek üzeresiniz.
+
+ *UYARI*
+Bu Yeteneğe sahip bir Roldeki Üyeler &quot;[ACTION_NAME_2]&quot; ve &quot;[ACTION_NAME_3]&quot; yeteneklerine de sahip olacak.
+ <usetemplate name="okbutton" yestext="Tamam"/>
+ </notification>
+ <notification name="RemoveBanAbilityWarning">
+ &quot;[ROLE_NAME]&quot; rolünden &quot;[ACTION_NAME]&quot; yeteneğini kaldırıyorsunuz.
+
+ *UYARI*
+Bu yeteneğin kaldırılması &quot;[ACTION_NAME_2]&quot; ve &quot;[ACTION_NAME_3]&quot; yeteneklerini kaldırmaz.
+
+Bu yeteneklerin artık bu rolde bulunmasını istemiyorsanız, onları hemen devre dışı bırakın!
+ <usetemplate name="okbutton" yestext="Tamam"/>
+ </notification>
<notification name="EjectGroupMemberWarning">
Gruptan [AVATAR_NAME] adlı üyeyi çıkarmak üzeresiniz.
<usetemplate ignoretext="Gruptan bir katılımcının çıkarılmasını doğrulayın" name="okcancelignore" notext="İptal" yestext="Çıkar"/>
@@ -1579,6 +1595,14 @@ Gruptan ayrılmak istiyor musunuz?
Gruptan ayrılınamıyor. Gruptan ayrılamazsınız çünkü grubun son sahibisiniz. Lütfen önce sahip rolüne başka bir üye atayın.
<usetemplate name="okbutton" yestext="Tamam"/>
</notification>
+ <notification name="GroupDepartError">
+ Gruptan ayrılma işlemi yapılamıyor: [reason].
+ <usetemplate name="okbutton" yestext="Tamam"/>
+ </notification>
+ <notification name="GroupDepart">
+ [group_name] grubundan ayrıldınız.
+ <usetemplate name="okbutton" yestext="Tamam"/>
+ </notification>
<notification name="ConfirmKick">
Tüm Sakinleri GERÇEKTEN ağ dışına çıkarmak istiyor musunuz?
<usetemplate name="okcancelbuttons" notext="İptal Et" yestext="Tüm Sakinleri Çıkar"/>
@@ -1731,6 +1755,10 @@ Lütfen daha sonra tekrar deneyin.
&lt;nolink&gt;[LOCATION]&lt;/nolink&gt; konumuna ışınlanmak istediğinize emin misiniz?
<usetemplate ignoretext="Bir yer imine ışınlanma istediğimde doğrulama iste" name="okcancelignore" notext="İptal Et" yestext="Işınla"/>
</notification>
+ <notification name="TeleportViaSLAPP">
+ &lt;nolink&gt;[LOCATION]&lt;/nolink&gt; konumuna ışınlanmak istediğinize emin misiniz?
+ <usetemplate ignoretext="SLAPP ile ışınlanma istediğimde doğrulama iste" name="okcancelignore" notext="İptal" yestext="Işınla"/>
+ </notification>
<notification name="TeleportToPick">
[PICK] konumuna ışınlanılsın mı?
<usetemplate ignoretext="Seçme sekmesindeki bir konuma ışınlanma istediğimde doğrulama iste" name="okcancelignore" notext="İptal Et" yestext="Işınla"/>
@@ -1940,6 +1968,9 @@ Binlerce bölgeyi değiştirecek ve alan sunucusunu kesintiye uğratacaktır.
<notification name="ProblemAddingEstateManager">
Yeni bir gayrimenkul yöneticisi eklenirken problem oluştu. Bir veya birden fazla gayrimenkulün yönetici listesi dolu olabilir.
</notification>
+ <notification name="ProblemAddingEstateBanManager">
+ Gayri menkul sahibi ya da yöneticisi yasaklı listesine eklenemedi.
+ </notification>
<notification name="ProblemAddingEstateGeneric">
Bu gayrimenkul listesine eklenirken problem oluştu. Bir veya birden fazla gayrimenkulün listesi dolu olabilir.
</notification>
@@ -2453,6 +2484,12 @@ Daha küçük bir arazi parçası seçmeyi deneyin.
<notification name="SystemMessage">
[MESSAGE]
</notification>
+ <notification name="FlickrConnect">
+ [MESSAGE]
+ </notification>
+ <notification name="TwitterConnect">
+ [MESSAGE]
+ </notification>
<notification name="PaymentReceived">
[MESSAGE]
</notification>
@@ -3027,9 +3064,9 @@ Ayrıntılar için günlük dosyasına bakın.
&lt;nolink&gt;[ITEMS]&lt;/nolink&gt;
-Paylaşmanın yapılacağı Sakinler:
+Paylaşmanın yapılacağı Second Life Sakinleri:
-[RESIDENTS]
+&lt;nolink&gt;[RESIDENTS]&lt;/nolink&gt;
<usetemplate name="okcancelbuttons" notext="İptal" yestext="Tamam"/>
</notification>
<notification name="ShareFolderConfirmation">
@@ -3041,7 +3078,7 @@ Aşağıdaki öğeleri paylaşmak istediğinize emin misiniz?
Paylaşmanın yapılacağı Second Life Sakinleri:
-[RESIDENTS]
+&lt;nolink&gt;[RESIDENTS]&lt;/nolink&gt;
<usetemplate name="okcancelbuttons" notext="İptal" yestext="Tamam"/>
</notification>
<notification name="ItemsShared">
@@ -3496,10 +3533,6 @@ Lütfen bir dakika sonra tekrar deneyin.
<notification name="EjectComingSoon">
Daha fazla burada olma izniniz yok ve ayrılmak için [EJECT_TIME] saniyeniz var.
</notification>
- <notification name="NoEnterServerFull">
- Bu bölgeye giremezsiniz çünkü
-sunucu dolu.
- </notification>
<notification name="SaveBackToInvDisabled">
Envantere Geri Kaydet devre dışı bırakıldı.
</notification>
@@ -3683,6 +3716,9 @@ sunucu dolu.
<notification name="LinkFailedTooMuchPhysics">
Nesne çok fazla fizik kaynağı kullanıyor -- dinamikleri devre dışı bırakıldı.
</notification>
+ <notification name="EstateManagerFailedllTeleportHome">
+ [SLURL] adresindeki &apos;[OBJECT_NAME]&apos; nesnesi gayri menkul yöneticilerini ana konuma ışınlayamıyor.
+ </notification>
<notification name="TeleportedHomeByObjectOnParcel">
&apos;[PARCEL_NAME]&apos; parseli üzerindeki &apos;[OBJECT_NAME]&apos; nesnesi tarafından ana konuma ışınlandınız
</notification>
@@ -3873,13 +3909,18 @@ sunucu dolu.
Seçimde birleştirilecek yeterli sayıda lease edilmiş parsel yok.
</notification>
<notification name="CantDivideLandMultipleParcelsSelected">
- Arazi bölünemedi.\nBirden fazla parsel seçili durumda.\nDaha küçük bir arazi parçası seçmeyi deneyin.
+ Arazi bölünemiyor.
+Birden fazla parsel seçili.
+Daha küçük bir arazi parçası seçmeyi deneyin.
</notification>
<notification name="CantDivideLandCantFindParcel">
- Arazi bölünemiyor.\nParsel bulunamıyor.\nLütfen Yardım -&gt; Hata Bildir ile bildirin...
+ Arazi bölünemiyor.
+Parsel bulunamıyor.
+Lütfen Yardım -&gt; Hata Bildir... sekmesinden hatayı bildirin
</notification>
<notification name="CantDivideLandWholeParcelSelected">
- Arazi bölünemiyor. Tüm parsel seçilidir.\nDaha küçük bir arazi parçası seçmeyi deneyin.
+ Arazi bölünemiyor. Tüm parsel seçili.
+Daha küçük bir arazi parçası seçmeyi deneyin.
</notification>
<notification name="LandHasBeenDivided">
Arazi bölündü.
@@ -4019,4 +4060,12 @@ sunucu dolu.
Dosyalar taşınamıyor. Önceki yol geri yüklendi.
<usetemplate ignoretext="Dosyalar taşınamıyor. Önceki yol geri yüklendi." name="okignore" yestext="Tamam"/>
</notification>
+ <notification name="DefaultObjectPermissions">
+ Aşağıdaki nedenden dolayı, varsayılan izinler kaydedilirken bir sorun oluştu: [REASON]. Varsayılan izinleri ayarlamayı lütfen daha sonra tekrar deneyin.
+ <usetemplate name="okbutton" yestext="Tamam"/>
+ </notification>
+ <notification name="ChatHistoryIsBusyAlert">
+ Sohbet geçmişi dosyası önceki işlemi gerçekleştirmekle meşgul. Lütfen bir kaç dakika sonra tekrar deneyin veya başka bir kişiyle sohbet etmeyi deneyin.
+ <usetemplate name="okbutton" yestext="Tamam"/>
+ </notification>
</notifications>
diff --git a/indra/newview/skins/default/xui/tr/panel_facebook_account.xml b/indra/newview/skins/default/xui/tr/panel_facebook_account.xml
new file mode 100644
index 0000000000..e2d2b193a6
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/panel_facebook_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_account">
+ <string name="facebook_connected" value="Facebook&apos;a şu kimlikle bağlandınız:"/>
+ <string name="facebook_disconnected" value="Facebook&apos;a bağlanılmadı"/>
+ <text name="account_caption_label">
+ Facebook&apos;a bağlanılmadı.
+ </text>
+ <panel name="panel_buttons">
+ <button label="BaÄŸlan..." name="connect_btn"/>
+ <button label="Bağlantıyı kes" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Facebook/ta-p/2149711 Facebook&apos;ta içerik yayınlama hakkında bilgi edinin]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_facebook_friends.xml b/indra/newview/skins/default/xui/tr/panel_facebook_friends.xml
new file mode 100644
index 0000000000..0a6b9ac600
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/panel_facebook_friends.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_friends">
+ <string name="facebook_friends_empty" value="Şu an için aynı zamanda bir Second Life sakini olan hiçbir Facebook arkadaşınız yok. Facebook arkadaşlarınızı bugün Second Life&apos;a katılmaya davet edin!"/>
+ <string name="facebook_friends_no_connected" value="Şu anda Facebook&apos;a bağlı değilsiniz. Bağlanmak ve bu özelliği etkinleştirmek için lütfen Hesap sekmesine gidin."/>
+ <accordion name="friends_accordion">
+ <accordion_tab name="tab_second_life_friends" title="SL arkadaşları"/>
+ <accordion_tab name="tab_suggested_friends" title="Bu kişileri SL arkadaşları olarak ekle"/>
+ </accordion>
+ <text name="facebook_friends_status">
+ Facebook&apos;a bağlanılmadı.
+ </text>
+</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_facebook_photo.xml b/indra/newview/skins/default/xui/tr/panel_facebook_photo.xml
new file mode 100644
index 0000000000..64732c5fc7
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/panel_facebook_photo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="Görüntü çözünürlüğü">
+ <combo_box.item label="Mevcut Pencere" name="CurrentWindow"/>
+ <combo_box.item label="640x480" name="640x480"/>
+ <combo_box.item label="800x600" name="800x600"/>
+ <combo_box.item label="1024x768" name="1024x768"/>
+ <combo_box.item label="1200x630" name="1200x630"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="Görüntü filtreleri">
+ <combo_box.item label="Filtre Yok" name="NoFilter"/>
+ </combo_box>
+ <button label="Yenile" name="new_snapshot_btn" tool_tip="Yenilemek için tıklayın"/>
+ <button label="Önizleme" name="big_preview_btn" tool_tip="Önizleme ayarları arasında geçiş yapmak için tıklayın"/>
+ <text name="caption_label">
+ Yorum (isteğe bağlı):
+ </text>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="Yayınla" name="post_photo_btn"/>
+ <button label="İptal" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_facebook_place.xml b/indra/newview/skins/default/xui/tr/panel_facebook_place.xml
new file mode 100644
index 0000000000..54c392c9d8
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/panel_facebook_place.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_place">
+ <layout_stack name="stack_place">
+ <layout_panel name="place_detail_panel">
+ <text name="place_caption_label">
+ Bulunduğunuz yer hakkında bir şeyler söyleyin:
+ </text>
+ </layout_panel>
+ <layout_panel name="place_map_panel">
+ <check_box initial_value="false" label="" name="add_place_view_cb"/>
+ </layout_panel>
+ <layout_panel name="place_button_panel">
+ <button label="Yayınla" name="post_place_btn"/>
+ <button label="İptal" name="cancel_place_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_facebook_status.xml b/indra/newview/skins/default/xui/tr/panel_facebook_status.xml
new file mode 100644
index 0000000000..9b95fe3a35
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/panel_facebook_status.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_status">
+ <layout_stack name="stack_status">
+ <layout_panel name="status_detail_panel">
+ <text name="status_caption_label">
+ Ne düşünüyorsunuz?
+ </text>
+ </layout_panel>
+ <layout_panel name="status_button_panel">
+ <button label="Yayınla" name="post_status_btn"/>
+ <button label="İptal" name="cancel_status_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_flickr_account.xml b/indra/newview/skins/default/xui/tr/panel_flickr_account.xml
new file mode 100644
index 0000000000..57b940d5f1
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/panel_flickr_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_flickr_account">
+ <string name="flickr_connected" value="Flickr&apos;a şu kimlikle bağlandınız:"/>
+ <string name="flickr_disconnected" value="Flickr&apos;la bağlantı kurulmadı"/>
+ <text name="account_caption_label">
+ Flickr&apos;la bağlantı kurulmadı.
+ </text>
+ <panel name="panel_buttons">
+ <button label="BaÄŸlan..." name="connect_btn"/>
+ <button label="Bağlantıyı kes" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Flickr/ta-p/2435609 Flickr&apos;da içerik yayınlama hakkında bilgi edinin]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_flickr_photo.xml b/indra/newview/skins/default/xui/tr/panel_flickr_photo.xml
new file mode 100644
index 0000000000..9ebc70c67c
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/panel_flickr_photo.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_flickr_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="Görüntü çözünürlüğü">
+ <combo_box.item label="Mevcut Pencere" name="CurrentWindow"/>
+ <combo_box.item label="640x480" name="640x480"/>
+ <combo_box.item label="800x600" name="800x600"/>
+ <combo_box.item label="1024x768" name="1024x768"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="Görüntü filtreleri">
+ <combo_box.item label="Filtre Yok" name="NoFilter"/>
+ </combo_box>
+ <button label="Yenile" name="new_snapshot_btn" tool_tip="Yenilemek için tıklayın"/>
+ <button label="Önizleme" name="big_preview_btn" tool_tip="Önizleme ayarları arasında geçiş yapmak için tıklayın"/>
+ <text name="title_label">
+ Başlık:
+ </text>
+ <text name="description_label">
+ Açıklama:
+ </text>
+ <check_box initial_value="true" label="Açıklamanın sonuna SL konumunu ekle" name="add_location_cb"/>
+ <text name="tags_label">
+ Etiketler:
+ </text>
+ <text name="tags_help_label">
+ Etiketleri boşlukla ayır
+Birden çok kelime içeren etiketler için &quot;&quot; kullan
+ </text>
+ <combo_box name="rating_combobox" tool_tip="Filckr içerik seviyesi">
+ <combo_box.item label="Güvenli Flickr seviyesi" name="SafeRating"/>
+ <combo_box.item label="Orta Flickr seviyesi" name="ModerateRating"/>
+ <combo_box.item label="Kısıtlı Flickr seviyesi" name="RestrictedRating"/>
+ </combo_box>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="Karşıya Yükle" name="post_photo_btn"/>
+ <button label="İptal" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_group_bulk_ban.xml b/indra/newview/skins/default/xui/tr/panel_group_bulk_ban.xml
new file mode 100644
index 0000000000..214cd15ec4
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/panel_group_bulk_ban.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel label="Sakinleri Yasakla" name="bulk_ban_panel">
+ <panel.string name="loading">
+ (yükleniyor...)
+ </panel.string>
+ <panel.string name="ban_selection_too_large">
+ Grup yasaklama talepleri gönderilmedi: çok fazla Sakin seçilmiş. Her talepte en fazla 100 kişiye grup giriş yasağı koyabilirsiniz.
+ </panel.string>
+ <panel.string name="ban_not_permitted">
+ Gruptan yasaklama talebi gönderilmedi: &quot;Yasaklı listesini yönetme&quot; yetkisine sahip değilsiniz.
+ </panel.string>
+ <panel.string name="ban_limit_fail">
+ Gruptan yasaklama talebi gönderilmedi: grubunuz izin verilen yasaklama limitine ulaştı.
+ </panel.string>
+ <panel.string name="partial_ban">
+ Gruptan yasaklama taleplerinin bazıları gönderilmedi:
+[REASONS]
+ </panel.string>
+ <panel.string name="ban_failed">
+ Gruptan yasaklama talepleri gönderilmedi:
+[REASONS]
+ </panel.string>
+ <panel.string name="residents_already_banned">
+ - Aşağıdaki sakinler zaten yasaklı: [RESIDENTS].
+ </panel.string>
+ <panel.string name="ban_limit_reached">
+ - Yasaklama limitine ulaşıldığı için aşağıdaki kişiler yasaklanmadı: [RESIDENTS].
+ </panel.string>
+ <panel.string name="cant_ban_yourself">
+ - Kendinizi bir grubun yasaklı listesine ekleyemezsiniz.
+ </panel.string>
+ <text name="help_text">
+ Birden fazla Sakin seçip grubunuza girişlerini yasaklayabilirsiniz. Başlamak için &quot;Sakin Seçiciyi Aç&quot; üzerine tıklayın.
+ </text>
+ <button label="Sakin Seçiciyi Aç" name="add_button"/>
+ <name_list name="banned_agent_list" tool_tip="Ctrl tuşunu basılı tutun ve seçmek istediğiniz Sakinlerin adlarına tıklayın"/>
+ <button label="Seçilenleri Listeden Çıkar" name="remove_button" tool_tip="Yukarıda seçilen Sakinleri yasaklı listesinden çıkarır"/>
+ <button label="Sakinleri Yasakla" name="ban_button"/>
+ <button label="İptal" name="cancel_button"/>
+ <string name="GroupBulkBan">
+ Gruptan Yasakla
+ </string>
+</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/tr/panel_group_info_sidetray.xml
index 32f39da490..e4697eaa21 100755
--- a/indra/newview/skins/default/xui/tr/panel_group_info_sidetray.xml
+++ b/indra/newview/skins/default/xui/tr/panel_group_info_sidetray.xml
@@ -20,7 +20,7 @@
<layout_panel name="group_accordions">
<accordion name="groups_accordion">
<accordion_tab name="group_general_tab" title="Genel"/>
- <accordion_tab name="group_roles_tab" title="Roller"/>
+ <accordion_tab name="group_roles_tab" title="Roller ve Üyeler"/>
<accordion_tab name="group_notices_tab" title="Bildirimler"/>
<accordion_tab name="group_land_tab" title="Arazi/Varlıklar"/>
</accordion>
diff --git a/indra/newview/skins/default/xui/tr/panel_group_invite.xml b/indra/newview/skins/default/xui/tr/panel_group_invite.xml
index 4ba5761edb..77c4db2cdc 100755
--- a/indra/newview/skins/default/xui/tr/panel_group_invite.xml
+++ b/indra/newview/skins/default/xui/tr/panel_group_invite.xml
@@ -22,7 +22,7 @@
Onları hala Role atayacağınızı seçin:
</text>
<combo_box name="role_name" tool_tip="Üyeleri atamanıza izin verilen Roller listesinden seçin"/>
- <button label="Davetiye Gönder" name="ok_button"/>
+ <button label="Davetiye Gönder" name="invite_button"/>
<button label="İptal" name="cancel_button"/>
<string name="GroupInvitation">
Grup Davetiyesi
diff --git a/indra/newview/skins/default/xui/tr/panel_group_roles.xml b/indra/newview/skins/default/xui/tr/panel_group_roles.xml
index fb03107da8..59a48bbdc2 100755
--- a/indra/newview/skins/default/xui/tr/panel_group_roles.xml
+++ b/indra/newview/skins/default/xui/tr/panel_group_roles.xml
@@ -20,15 +20,17 @@ Ctrl tuşuna basıp adlarına tıklayarak birden fazla Üye seçebilirsiniz.
<name_list.columns label="Üye" name="name"/>
<name_list.columns label="Bağış" name="donated"/>
<name_list.columns label="Durum" name="online"/>
+ <name_list.columns label="Ünvan" name="title"/>
</name_list>
<button label="Davet Et" name="member_invite"/>
<button label="Çıkar" name="member_eject"/>
+ <button label="Üyeyi/Üyeleri Yasakla" name="member_ban"/>
</panel>
<panel label="ROLLER" name="roles_sub_tab">
<panel.string name="help_text">
- Roller, birer başlığa ve Üyelerin gerçekleştirmesine izin verilen Yetenekler listesine sahiptir.
+ Rollerde, birer başlık ve Üyelerin gerçekleştirmesine izin verilen bir Yetenekler listesi vardır.
Bir Üye bir veya daha fazla sayıda Role ait olabilir.
- Bir grupta 10&apos;a kadar Rol olabilir, buna Herkes ve Sahip Rolü de dahildir.
+ Bir grupta, Herkes ve Sahip Rolü dahil, en fazla 10 Rol olabilir.
</panel.string>
<panel.string name="cant_delete_role">
&apos;Herkes&apos; ve &apos;Sahipler&apos; Rolleri özeldir, silinemez.
@@ -44,12 +46,27 @@ Ctrl tuşuna basıp adlarına tıklayarak birden fazla Üye seçebilirsiniz.
</panel>
<panel label="YETENEKLER" name="actions_sub_tab" tool_tip="Bir Yeteneğin Açıklamasını ve bu Yeteneğe hangi Rollerin ve Üyelerin sahip olabileceğini görebilirsiniz.">
<panel.string name="help_text">
- Yetenekler sayesinde Rollerle ilişkili Üyeler bu grup içerisinde belirli şeyler yapabilir.
+ Yetenekler sayesinde Rollerle İlişkili Üyeler bu grup içerisinde belirli şeyler yapabilir.
Yeteneklerin kapsamı oldukça geniştir.
</panel.string>
<filter_editor label="Yetenekleri Filtrele" name="filter_input"/>
<scroll_list name="action_list" tool_tip="Bir Yeteneği seçerek daha çok ayrıntı görebilirsiniz"/>
</panel>
+ <panel label="YASAKLI SAKİNLER" name="banlist_sub_tab" tool_tip="Bu gruba girişleri yasaklanan sakinleri görüntüle">
+ <panel.string name="help_text">
+ Yasaklı listesindeki sakinler gruba katılamaz.
+ </panel.string>
+ <panel.string name="ban_count_template">
+ Yasaklama sayısı: [COUNT]/[LIMIT]
+ </panel.string>
+ <name_list name="ban_list">
+ <name_list.columns label="Sakin" name="name"/>
+ <name_list.columns label="Yasaklama Tarihi" name="ban_date"/>
+ </name_list>
+ <button label="Sakini/Sakinleri Yasakla" name="ban_create" tool_tip="Grubunuzdaki sakinleri yasaklayın"/>
+ <button label="Yasaklamayı Kaldır" name="ban_delete" tool_tip="Seçilen sakinlerin gruba giriş yasağını kaldır"/>
+ <button name="ban_refresh" tool_tip="Yasaklı listesini yenile"/>
+ </panel>
</tab_container>
<panel name="members_footer">
<text name="static">
diff --git a/indra/newview/skins/default/xui/tr/panel_login.xml b/indra/newview/skins/default/xui/tr/panel_login.xml
index 28d316e46b..ce1519be89 100755
--- a/indra/newview/skins/default/xui/tr/panel_login.xml
+++ b/indra/newview/skins/default/xui/tr/panel_login.xml
@@ -1,46 +1,27 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8"?>
<panel name="panel_login">
<panel.string name="forgot_password_url">
http://secondlife.com/account/request.php
</panel.string>
- <layout_stack name="login_widgets">
- <layout_panel name="login">
- <text name="log_in_text">
- OTURUM AÇ
- </text>
- <text name="username_text">
- Kullanıcı Adı:
- </text>
- <combo_box name="username_combo" tool_tip="Kaydolduğunuzda seçtiğiniz kullanıcı adı, örn. mustafayalcin12 veya Faruk Gungoren"/>
- <text name="password_text">
- Parola:
- </text>
- </layout_panel>
- <layout_panel name="start_location_panel">
- <text name="start_location_text">
- Buradan baÅŸla:
- </text>
- <combo_box name="start_location_combo">
- <combo_box.item label="Son konumum" name="MyLastLocation"/>
- <combo_box.item label="Ana Konumum" name="MyHome"/>
- <combo_box.item label="&lt;Bölge adını girin&gt;" name="Typeregionname"/>
- </combo_box>
- </layout_panel>
- <layout_panel name="links_login_panel">
- <text name="login_help">
- Oturum açarken yardım mı gerekiyor?
- </text>
+ <layout_stack name="ui_stack">
+ <layout_panel name="ui_container">
+ <combo_box label="Kullanıcı Adı" name="username_combo" tool_tip="Kaydolduğunuzda seçtiğiniz kullanıcı adı, örn. mustafayalcin12 veya Faruk Gungoren"/>
+ <line_editor label="Parola" name="password_edit"/>
+ <check_box label="Beni hatırla" name="remember_check"/>
<text name="forgot_password_text">
- Kullanıcı adınızı veya parolanızı mı unuttunuz?
+ Parolamı unuttum
</text>
<button label="Oturum Aç" name="connect_btn"/>
- <check_box label="Parolayı hatırla" name="remember_check"/>
- </layout_panel>
- <layout_panel name="links">
- <text name="create_account_text">
- HESABINIZI OLUÅžTURUN
+ <text name="At_My_Last_Location_Label">
+ son konumum
</text>
- <button label="Åžimdi baÅŸla" name="create_new_account_btn"/>
+ <combo_box label="Sık kullandığım yerler" name="start_location_combo">
+ <combo_box.item label="Ana konumum" name="MyHome"/>
+ </combo_box>
+ <button label="Oturum Aç" name="connect_favorite_btn"/>
+ <line_editor label="Bir yer adı yazın" name="location_edit"/>
+ <button label="Oturum Aç" name="connect_location_btn"/>
+ <combo_box label="Ağ seç" name="server_combo"/>
</layout_panel>
</layout_stack>
</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_login_first.xml b/indra/newview/skins/default/xui/tr/panel_login_first.xml
new file mode 100644
index 0000000000..622edd0a8d
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/panel_login_first.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_login">
+ <panel.string name="forgot_password_url">
+ http://secondlife.com/account/request.php
+ </panel.string>
+ <layout_stack name="logo_stack">
+ <layout_panel name="parent_panel2">
+ <layout_stack name="widget_stack">
+ <layout_panel name="widget_container">
+ <combo_box label="Kullanıcı Adı" name="username_combo" tool_tip="Kaydolduğunuzda seçtiğiniz kullanıcı adı, örn. mustafayalcin12 veya Faruk Gungoren"/>
+ <line_editor label="Parola" name="password_edit"/>
+ <button label="Oturum Aç" name="connect_btn"/>
+ <check_box label="Beni hatırla" name="remember_check"/>
+ <text name="forgot_password_text">
+ Parolamı unuttum
+ </text>
+ </layout_panel>
+ </layout_stack>
+ </layout_panel>
+ <layout_panel name="parent_panel3">
+ <layout_stack name="images_stack">
+ <layout_panel name="images_container">
+ <text name="image_caption_left">
+ Başlangıç yeriniz Eğitim Adası. Haydi çıkış portalını bulun!
+ </text>
+ <text name="image_caption_right">
+ Sonra da Sosyal Ada&apos;yı keşfe çıkın ve diğer LS sakinleriyle tanışın!
+ </text>
+ </layout_panel>
+ </layout_stack>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/tr/panel_preferences_advanced.xml
index 770cdc6efd..82c7b87c9a 100755
--- a/indra/newview/skins/default/xui/tr/panel_preferences_advanced.xml
+++ b/indra/newview/skins/default/xui/tr/panel_preferences_advanced.xml
@@ -28,4 +28,5 @@
<check_box label="Oturum açarken Ağ Seçimini göster" name="show_grid_selection_check"/>
<check_box label="Gelişmiş Menüyü Göster" name="show_advanced_menu_check"/>
<check_box label="Geliştirici Menüsünü Göster" name="show_develop_menu_check"/>
+ <button label="Varsayılan Oluşturma İzinleri" name="default_creation_permissions"/>
</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_preferences_general.xml b/indra/newview/skins/default/xui/tr/panel_preferences_general.xml
index 1a13cf8f71..2c05e8a47a 100755
--- a/indra/newview/skins/default/xui/tr/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/tr/panel_preferences_general.xml
@@ -29,14 +29,10 @@
<combo_box.item label="Genel ve Orta" name="Desired_Mature"/>
<combo_box.item label="Genel" name="Desired_PG"/>
</combo_box>
- <text name="start_location_textbox">
- Standart konum:
+ <check_box label="Sık kullanılan yerleri oturum açma ekranında göster" name="favorites_on_login_check"/>
+ <text name="favorites_check_extra_text">
+ (Bu bilgisayarı kullanan diğer kişiler de bunları görecek)
</text>
- <combo_box name="start_location_combo">
- <combo_box.item label="Son konumum" name="MyLastLocation"/>
- <combo_box.item label="Ana Konumum" name="MyHome"/>
- </combo_box>
- <check_box initial_value="true" label="Oturumu açarken göster" name="show_location_checkbox"/>
<text name="name_tags_textbox">
Ad etiketleri:
</text>
diff --git a/indra/newview/skins/default/xui/tr/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/tr/panel_preferences_privacy.xml
index 9111594979..185d557567 100755
--- a/indra/newview/skins/default/xui/tr/panel_preferences_privacy.xml
+++ b/indra/newview/skins/default/xui/tr/panel_preferences_privacy.xml
@@ -7,7 +7,7 @@
<text name="cache_size_label_l">
(Konumlar, görüntüler, web, arama geçmişi)
</text>
- <check_box label="Arama sonuçlarında beni göster" name="online_searchresults"/>
+ <check_box label="Profil bilgilerimi Arama sonuçlarında göster" name="online_searchresults"/>
<check_box label="Çevrimiçi olduğumu sadece arkadaşlar ve gruplar bilsin" name="online_visibility"/>
<check_box label="Sadece arkadaşlar ve gruplar beni arasın veya Aİ göndersin" name="voice_call_friends_only_check"/>
<check_box label="Aramaları sonlandırırken mikrofonu kapat" name="auto_disengage_mic_check"/>
diff --git a/indra/newview/skins/default/xui/tr/panel_region_debug.xml b/indra/newview/skins/default/xui/tr/panel_region_debug.xml
index 834ece563f..74a0a1569e 100755
--- a/indra/newview/skins/default/xui/tr/panel_region_debug.xml
+++ b/indra/newview/skins/default/xui/tr/panel_region_debug.xml
@@ -28,7 +28,8 @@
<check_box label="Bu gayrimenkulu oluşturan bölgelerin tümünde" name="return_estate_wide" tool_tip="Bu gayrimenkulu oluşturan bölgelerin tümündeki nesneler iade edilsin"/>
<button label="İade Et" name="return_btn"/>
<button label="En Çok Çarpışanlar..." name="top_colliders_btn" tool_tip="En çok potansiyel çarpışma yaşayan nesnelerin listesi"/>
- <button label="En Çok Komut Dsy. Çalştr...." name="top_scripts_btn" tool_tip="Komut dosyalarını çalıştırırken en çok zaman harcayan nesnelerin listesi"/>
<button label="Bölgeyi Yeniden Başlat" name="restart_btn" tool_tip="2 dakikalık bir geri sayımdan sonra bölgeyi yeniden başlat"/>
+ <button label="En Çok Komut Dsy. Çalştr...." name="top_scripts_btn" tool_tip="Komut dosyalarını çalıştırırken en çok zaman harcayan nesnelerin listesi"/>
<button label="Yeniden Başlatmayı İptal Et" name="cancel_restart_btn" tool_tip="Bölge yeniden başlatmasını iptal et"/>
+ <button label="Bölge Hata Ayıklama Konsolu" name="region_debug_console_btn" tool_tip="Açık Bölge Hata Ayıklama Konsolu"/>
</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_region_general.xml b/indra/newview/skins/default/xui/tr/panel_region_general.xml
index 37da0f2cca..e6abef883d 100755
--- a/indra/newview/skins/default/xui/tr/panel_region_general.xml
+++ b/indra/newview/skins/default/xui/tr/panel_region_general.xml
@@ -20,12 +20,12 @@
</text>
<check_box label="Yer Åžekillendirmeyi Engelle" name="block_terraform_check"/>
<check_box label="Uçmayı Engelle" name="block_fly_check"/>
+ <check_box label="Parselin Üzerinde Uçmayı Engelle" name="block_fly_over_check" tool_tip="Bir parselin üzerinden uçulmasını engellemek için onay işaretlerini yukarı doğru genişletin"/>
<check_box label="Hasara İzin Ver" name="allow_damage_check"/>
<check_box label="İtmeyi Kısıtla" name="restrict_pushobject"/>
<check_box label="Arazinin Tekrar Satışına İzin Ver" name="allow_land_resell_check"/>
<check_box label="Arazinin Birleşmesine/Bölünmesine İzin Ver" name="allow_parcel_changes_check"/>
<check_box label="Aramada Arazinin Gösterilmesini Engelle" name="block_parcel_search_check" tool_tip="Arama sonuçlarında bu bölge ve parselleri görünsün"/>
- <check_box label="Örgü Nesnelere İzin Ver" name="mesh_rez_enabled_check" tool_tip="Bu bölgede insanların örgü nesneleri oluşturmasına izin verilsin"/>
<spinner label="Aracı Limiti" name="agent_limit_spin"/>
<spinner label="Nesne Bonusu" name="object_bonus_spin"/>
<text label="EriÅŸkinlik" name="access_text">
diff --git a/indra/newview/skins/default/xui/tr/panel_script_ed.xml b/indra/newview/skins/default/xui/tr/panel_script_ed.xml
index 79cd86c3f0..83040d06e4 100755
--- a/indra/newview/skins/default/xui/tr/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/tr/panel_script_ed.xml
@@ -24,6 +24,7 @@
<menu_item_call label="Tüm Değişiklikleri Geri Çevir" name="Revert All Changes"/>
<menu_item_call label="Dosyadan yükle..." name="LoadFromFile"/>
<menu_item_call label="Dosyaya kaydet..." name="SaveToFile"/>
+ <menu_item_call label="Renkler..." name="Colors"/>
</menu>
<menu label="Düzenle" name="Edit">
<menu_item_call label="Geri Al" name="Undo"/>
@@ -41,9 +42,9 @@
<menu_item_call label="Anahtar Sözcük Yardımı..." name="Keyword Help..."/>
</menu>
</menu_bar>
- <text_editor name="Script Editor">
+ <script_editor name="Script Editor">
Yükleniyor...
- </text_editor>
+ </script_editor>
<combo_box label="Ekle..." name="Insert..."/>
<button label="Kaydet" label_selected="Kaydet" name="Save_btn"/>
<button label="Düzenle..." name="Edit_btn"/>
diff --git a/indra/newview/skins/default/xui/tr/panel_snapshot_options.xml b/indra/newview/skins/default/xui/tr/panel_snapshot_options.xml
index fd2e85fce5..4bc1098ce9 100755
--- a/indra/newview/skins/default/xui/tr/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/tr/panel_snapshot_options.xml
@@ -4,4 +4,13 @@
<button label="E-posta" name="save_to_email_btn"/>
<button label="Envanterime Kaydet (L$[AMOUNT])" name="save_to_inventory_btn"/>
<button label="Bilgisayarıma Kaydet" name="save_to_computer_btn"/>
+ <text name="send_to_facebook_textbox">
+ Gönder: [secondlife:/// Facebook]
+ </text>
+ <text name="send_to_twitter_textbox">
+ [secondlife:/// Twitter]
+ </text>
+ <text name="send_to_flickr_textbox">
+ [secondlife:/// Flickr]
+ </text>
</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_teleport_history_item.xml b/indra/newview/skins/default/xui/tr/panel_teleport_history_item.xml
index a3a5c70c7e..311cee53c6 100755
--- a/indra/newview/skins/default/xui/tr/panel_teleport_history_item.xml
+++ b/indra/newview/skins/default/xui/tr/panel_teleport_history_item.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="teleport_history_item">
<text name="region" value="..."/>
+ <text name="timestamp" value="..."/>
<button name="profile_btn" tool_tip="Envanter bilgilerini göster"/>
</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_twitter_account.xml b/indra/newview/skins/default/xui/tr/panel_twitter_account.xml
new file mode 100644
index 0000000000..704027e1ba
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/panel_twitter_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_twitter_account">
+ <string name="twitter_connected" value="Twitter&apos;a şu kimlikle bağlandınız:"/>
+ <string name="twitter_disconnected" value="Twitter&apos;la bağlantı kurulmadı"/>
+ <text name="account_caption_label">
+ Twitter&apos;la bağlantı kurulmadı.
+ </text>
+ <panel name="panel_buttons">
+ <button label="BaÄŸlan..." name="connect_btn"/>
+ <button label="Bağlantıyı kes" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Twitter/ta-p/2435453 Tweet atma hakkında bilgi edinin]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/tr/panel_twitter_photo.xml b/indra/newview/skins/default/xui/tr/panel_twitter_photo.xml
new file mode 100644
index 0000000000..966e9b906d
--- /dev/null
+++ b/indra/newview/skins/default/xui/tr/panel_twitter_photo.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_twitter_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="text_panel">
+ <text name="status_label">
+ Neler oluyor?
+ </text>
+ <text name="status_counter_label">
+ 140
+ </text>
+ <check_box initial_value="true" label="SL konumunu dahil et" name="add_location_cb"/>
+ <check_box initial_value="true" label="FotoÄŸraf ekle" name="add_photo_cb"/>
+ </layout_panel>
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="Görüntü çözünürlüğü">
+ <combo_box.item label="Mevcut Pencere" name="CurrentWindow"/>
+ <combo_box.item label="640x480" name="640x480"/>
+ <combo_box.item label="800x600" name="800x600"/>
+ <combo_box.item label="1024x768" name="1024x768"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="Görüntü filtreleri">
+ <combo_box.item label="Filtre Yok" name="NoFilter"/>
+ </combo_box>
+ <button label="Yenile" name="new_snapshot_btn" tool_tip="Yenilemek için tıklayın"/>
+ <button label="Önizleme" name="big_preview_btn" tool_tip="Önizleme ayarları arasında geçiş yapmak için tıklayın"/>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="Tweet" name="post_photo_btn"/>
+ <button label="İptal" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/tr/role_actions.xml b/indra/newview/skins/default/xui/tr/role_actions.xml
index 76ca58c319..8f063122dc 100755
--- a/indra/newview/skins/default/xui/tr/role_actions.xml
+++ b/indra/newview/skins/default/xui/tr/role_actions.xml
@@ -3,6 +3,7 @@
<action_set description="Bu Yetenekler arasında gruba Üye ekleme ve çıkarma ile davetiye olmadan yeni Üyelerin katılmasına imkan tanıma yer alır." name="Membership">
<action description="Kişileri Bu Gruba Davet Et" longdescription="Roller bölümü &gt; Üyeler sekmesindeki &quot;Davet Et&quot; düğmesini kullanarak Kişileri Bu Gruba davet et" name="member invite" value="1"/>
<action description="Üyeleri Bu Gruptan Çıkar" longdescription="Roller bölümü &gt; Üyeler sekmesindeki &quot;Çıkar&quot; düğmesini kullanarak Üyeleri Bu Gruptan çıkar. Bir Sahip, başka bir Sahip dışında herkesi çıkartabilir. Eğer bir Sahip değilseniz, bir Üyenin bir gruptan çıkarılmasının tek yolu, Herkes Rolünde olmaları ve başka hiçbir Rolde OLMAMALARIDIR. Üyeleri Rollerden çıkarmak için, &quot;Üyeleri Rollerden Çıkar&quot; Yeteneğine sahip olmalısınız." name="member eject" value="2"/>
+ <action description="Yasaklı listesini yönet" longdescription="Grup üyelerinin, grupta sakinleri yasaklamalarına / bu yasaklamaları kaldırmalarına izin verir" name="allow ban" value="51"/>
<action description="&quot;Katılıma Açık&quot; için Aç/Kapa yapın ve &quot;Kayıt Ücretini&quot; değiştirin" longdescription="Yeni üyelerin davetiye olmadan katılmasına imkan tanımak amacıyla &quot;Katılıma Açık&quot; için Aç/Kapa yapın ve Genel bölümünde &quot;Kayıt Ücretini&quot; değiştirin" name="member options" value="3"/>
</action_set>
<action_set description="Bu Yetenekler arasında grup Rolleri ekleme, kaldırma ve değiştirme; Rollere Üye ekleme ve kaldırma ile Rollere Yetenek atama imkanları yer alır." name="Roles">
diff --git a/indra/newview/skins/default/xui/tr/sidepanel_inventory.xml b/indra/newview/skins/default/xui/tr/sidepanel_inventory.xml
index 938b5a76d8..3241d52c81 100755
--- a/indra/newview/skins/default/xui/tr/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/tr/sidepanel_inventory.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel label="EÅŸyalar" name="objects panel">
- <panel label="" name="sidepanel__inventory_panel">
+ <panel label="" name="sidepanel_inventory_panel">
<layout_stack name="inventory_layout_stack">
<layout_panel name="inbox_layout_panel">
<panel label="" name="marketplace_inbox">
diff --git a/indra/newview/skins/default/xui/tr/strings.xml b/indra/newview/skins/default/xui/tr/strings.xml
index c4b1530b2b..c4fc76fe29 100755
--- a/indra/newview/skins/default/xui/tr/strings.xml
+++ b/indra/newview/skins/default/xui/tr/strings.xml
@@ -37,6 +37,45 @@
<string name="StartupRequireDriverUpdate">
Grafik başlatma başarılamadı. Lütfen grafik sürücünüzü güncelleştirin!
</string>
+ <string name="AboutHeader">
+ [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2] ([VIEWER_VERSION_3]) [BUILD_DATE] [BUILD_TIME] ([CHANNEL])
+[[VIEWER_RELEASE_NOTES_URL] [Sürüm Notları]]
+ </string>
+ <string name="AboutCompiler">
+ [COMPILER] [COMPILER_VERSION] sürümü ile oluşturuldu
+ </string>
+ <string name="AboutPosition">
+ &lt;nolink&gt;[HOSTNAME]&lt;/nolink&gt; ([HOSTIP]) üzerinde bulunan [REGION] içerisinde [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1] konumundasınız
+SLURL: &lt;nolink&gt;[SLURL]&lt;/nolink&gt;
+(küresel koordinatlar [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1])
+[SERVER_VERSION]
+[SERVER_RELEASE_NOTES_URL]
+ </string>
+ <string name="AboutSystem">
+ CPU: [CPU]
+Bellek: [MEMORY_MB] MB
+İşl. Sis. Sürümü: [OS_VERSION]
+Grafik Kartı Üreticisi: [GRAPHICS_CARD_VENDOR]
+Grafik Kartı: [GRAPHICS_CARD]
+ </string>
+ <string name="AboutDriver">
+ Windows Grafik Sürücüsü Sürümü: [GRAPHICS_DRIVER_VERSION]
+ </string>
+ <string name="AboutLibs">
+ OpenGL Sürümü: [OPENGL_VERSION]
+
+libcurl Sürümü: [LIBCURL_VERSION]
+J2C Kod Çözücü Sürümü: [J2C_VERSION]
+Ses Sürücüsü Sürümü: [AUDIO_DRIVER_VERSION]
+Qt Web Kit Sürümü: [QT_WEBKIT_VERSION]
+Ses Sunucusu Sürümü: [VOICE_VERSION]
+ </string>
+ <string name="AboutTraffic">
+ Kaybolan Paketler: [PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number,1]%)
+ </string>
+ <string name="ErrorFetchingServerReleaseNotesURL">
+ Sunucu sürümü notları URL&apos;si alınırken hata oluştu.
+ </string>
<string name="ProgressRestoring">
Geri yükleniyor...
</string>
@@ -296,6 +335,75 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin.
<string name="TestingDisconnect">
Görüntüleyici bağlantısının kesilmesi test ediliyor
</string>
+ <string name="SocialFlickrConnecting">
+ Flickr bağlantısı kuruluyor...
+ </string>
+ <string name="SocialFlickrPosting">
+ Yayınlanıyor...
+ </string>
+ <string name="SocialFlickrDisconnecting">
+ Flickr bağlantısı kesiliyor...
+ </string>
+ <string name="SocialFlickrErrorConnecting">
+ Flickr bağlantısı kurulurken sorun çıktı
+ </string>
+ <string name="SocialFlickrErrorPosting">
+ Flickr&apos;da yayınlarken sorun çıktı
+ </string>
+ <string name="SocialFlickrErrorDisconnecting">
+ Flickr bağlantısı kesilirken sorun çıktı
+ </string>
+ <string name="SocialTwitterConnecting">
+ Twitter bağlantısı kuruluyor...
+ </string>
+ <string name="SocialTwitterPosting">
+ Yayınlanıyor...
+ </string>
+ <string name="SocialTwitterDisconnecting">
+ Twitter bağlantısı kesiliyor...
+ </string>
+ <string name="SocialTwitterErrorConnecting">
+ Twitter bağlantısı kurulurken sorun çıktı
+ </string>
+ <string name="SocialTwitterErrorPosting">
+ Twitter&apos;da yayınlarken sorun çıktı
+ </string>
+ <string name="SocialTwitterErrorDisconnecting">
+ Twitter bağlantısı kesilirken sorun çıktı
+ </string>
+ <string name="BlackAndWhite">
+ Siyah Beyaz
+ </string>
+ <string name="Colors1970">
+ 70&apos;lerin Renkleri
+ </string>
+ <string name="Intense">
+ YoÄŸun
+ </string>
+ <string name="Newspaper">
+ Gazete Baskısı
+ </string>
+ <string name="Sepia">
+ Sepya
+ </string>
+ <string name="Spotlight">
+ Spot Işıkları
+ </string>
+ <string name="Video">
+ Video
+ </string>
+ <string name="Autocontrast">
+ Otomatik Kontrast
+ </string>
+ <string name="LensFlare">
+ Mercek Parlaması
+ </string>
+ <string name="Miniature">
+ Minyatür
+ </string>
+ <string name="Toycamera">
+ Eğlence Kamerası
+ </string>
<string name="TooltipPerson">
KiÅŸi
</string>
@@ -844,6 +952,12 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin.
<string name="use_texture">
Dokuyu kullan
</string>
+ <string name="manip_hint1">
+ Fare imlecini cetvelin üzerine getirerek
+ </string>
+ <string name="manip_hint2">
+ aÄŸa uydur
+ </string>
<string name="texture_loading">
Yükleniyor...
</string>
@@ -934,15 +1048,15 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin.
<string name="ControlYourCamera">
Kameranızı kontrol etmek
</string>
+ <string name="TeleportYourAgent">
+ Sizi ışınlama
+ </string>
<string name="NotConnected">
Bağlı Değil
</string>
<string name="AgentNameSubst">
(Siz)
</string>
- <string name="TeleportYourAgent">
- Sizi ışınlama
- </string>
<string name="JoinAnExperience">
Bir tecrübeye katıl
</string>
@@ -1296,6 +1410,18 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin.
<string name="InventoryOutboxNoItems">
Bu alana klasörleri sürükleyin ve bunları [[MARKETPLACE_DASHBOARD_URL] Pazaryerinde] satılık olarak duyurmak için &quot;Pazaryerine Gönder&quot; üzerine tıklayın.
</string>
+ <string name="InventoryOutboxInitializingTitle">
+ Pazaryeri Başlatılıyor.
+ </string>
+ <string name="InventoryOutboxInitializing">
+ [[MARKETPLACE_CREATE_STORE_URL] Mağazası] üzerindeki hesabınıza erişiyoruz.
+ </string>
+ <string name="InventoryOutboxErrorTitle">
+ Pazaryeri Hataları
+ </string>
+ <string name="InventoryOutboxError">
+ [[MARKETPLACE_CREATE_STORE_URL] Mağazası] hata döndürüyor.
+ </string>
<string name="Marketplace Error None">
Hata yok
</string>
@@ -1323,6 +1449,9 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin.
<string name="Open landmarks">
Açık yer imleri
</string>
+ <string name="Unconstrained">
+ Kısıtsız
+ </string>
<string name="no_transfer" value="(aktarım yok)"/>
<string name="no_modify" value="(deÄŸiÅŸtirme yok)"/>
<string name="no_copy" value="(kopya yok)"/>
@@ -1723,6 +1852,9 @@ Lütfen bir dakika içerisinde tekrar oturum açmayı deneyin.
<string name="CompileQueueDownloadedCompiling">
Karşıdan yüklendi, şimdi derleniyor
</string>
+ <string name="CompileQueueServiceUnavailable">
+ Komut dosyası derleme hizmeti kullanılamıyor
+ </string>
<string name="CompileQueueScriptNotFound">
Komut dosyası sunucuda bulunamadı.
</string>
@@ -4023,6 +4155,12 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
<string name="share_alert">
Envanterinizden buraya öğeler sürükleyin
</string>
+ <string name="flickr_post_success">
+ Flickr&apos;da yayınladınız.
+ </string>
+ <string name="twitter_post_success">
+ Twitter&apos;da yayınladınız.
+ </string>
<string name="no_session_message">
(Aİ Oturumu Mevcut Değil)
</string>
@@ -4477,6 +4615,9 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
<string name="LocalEstimateUSD">
US$ [AMOUNT]
</string>
+ <string name="Group Ban">
+ Gruptan Yasakla
+ </string>
<string name="Membership">
Üyelik
</string>
@@ -4911,6 +5052,12 @@ Düzenleyici yolunu çift tırnakla çevrelemeyi deneyin.
<string name="Command_Destinations_Label">
Hedef Konum
</string>
+ <string name="Command_Facebook_Label">
+ Facebook
+ </string>
+ <string name="Command_Flickr_Label">
+ Flickr
+ </string>
<string name="Command_Gestures_Label">
Mimikler
</string>
@@ -4959,6 +5106,9 @@ Düzenleyici yolunu çift tırnakla çevrelemeyi deneyin.
<string name="Command_Speak_Label">
KonuÅŸ
</string>
+ <string name="Command_Twitter_Label">
+ Twitter
+ </string>
<string name="Command_View_Label">
Kamera denetimleri
</string>
@@ -4989,6 +5139,12 @@ Düzenleyici yolunu çift tırnakla çevrelemeyi deneyin.
<string name="Command_Destinations_Tooltip">
İlgilendiğiniz hedef konumlar
</string>
+ <string name="Command_Facebook_Tooltip">
+ Facebook&apos;ta Yayınla
+ </string>
+ <string name="Command_Flickr_Tooltip">
+ Flickr&apos;a yükle
+ </string>
<string name="Command_Gestures_Tooltip">
Avatarınız için mimikler
</string>
@@ -5037,6 +5193,9 @@ Düzenleyici yolunu çift tırnakla çevrelemeyi deneyin.
<string name="Command_Speak_Tooltip">
Mikrofonunuzu kullanarak yakındaki kişilerle konuşun
</string>
+ <string name="Command_Twitter_Tooltip">
+ Twitter
+ </string>
<string name="Command_View_Tooltip">
Kamera açısını değiştirmek
</string>
diff --git a/indra/newview/skins/default/xui/zh/floater_big_preview.xml b/indra/newview/skins/default/xui/zh/floater_big_preview.xml
new file mode 100644
index 0000000000..ae68cd7ddf
--- /dev/null
+++ b/indra/newview/skins/default/xui/zh/floater_big_preview.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_big_preview" title="é è¦½"/>
diff --git a/indra/newview/skins/default/xui/zh/floater_facebook.xml b/indra/newview/skins/default/xui/zh/floater_facebook.xml
new file mode 100644
index 0000000000..9847db9124
--- /dev/null
+++ b/indra/newview/skins/default/xui/zh/floater_facebook.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_facebook" title="發佈到臉書">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="狀態" name="panel_facebook_status"/>
+ <panel label="相片" name="panel_facebook_photo"/>
+ <panel label="打å¡" name="panel_facebook_place"/>
+ <panel label="朋å‹" name="panel_facebook_friends"/>
+ <panel label="帳號" name="panel_facebook_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ 錯誤
+ </text>
+ <text name="connection_loading_text">
+ 載入中…
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/zh/floater_flickr.xml b/indra/newview/skins/default/xui/zh/floater_flickr.xml
new file mode 100644
index 0000000000..b02d02c7bb
--- /dev/null
+++ b/indra/newview/skins/default/xui/zh/floater_flickr.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_flickr" title="上傳到 FLICKR">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="相片" name="panel_flickr_photo"/>
+ <panel label="帳號" name="panel_flickr_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ 錯誤
+ </text>
+ <text name="connection_loading_text">
+ 載入中…
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/zh/floater_lagmeter.xml b/indra/newview/skins/default/xui/zh/floater_lagmeter.xml
index e9a082288a..6e58e7332f 100755..100644
--- a/indra/newview/skins/default/xui/zh/floater_lagmeter.xml
+++ b/indra/newview/skins/default/xui/zh/floater_lagmeter.xml
@@ -7,7 +7,7 @@
360
</floater.string>
<floater.string name="min_title_msg">
- å»¶é²
+ Lag
</floater.string>
<floater.string name="min_width_px">
90
@@ -22,28 +22,28 @@
15
</floater.string>
<floater.string name="client_frame_time_window_bg_msg">
- æ­£å¸¸ï¼Œè¦–çª—ä½æ–¼èƒŒæ™¯
+ Normal, window in background
</floater.string>
<floater.string name="client_frame_time_critical_msg">
- 客戶端幀率低於 [CLIENT_FRAME_RATE_CRITICAL]
+ Client frame rate below [CLIENT_FRAME_RATE_CRITICAL]
</floater.string>
<floater.string name="client_frame_time_warning_msg">
- 客戶端幀率介於 [CLIENT_FRAME_RATE_CRITICAL] 和 [CLIENT_FRAME_RATE_WARNING] 之間
+ Client frame rate between [CLIENT_FRAME_RATE_CRITICAL] and [CLIENT_FRAME_RATE_WARNING]
</floater.string>
<floater.string name="client_frame_time_normal_msg">
正常
</floater.string>
<floater.string name="client_draw_distance_cause_msg">
- å¯èƒ½åŽŸå› ï¼šå¯è¦–è·é›¢è¨­å¾—太é 
+ Possible cause: Draw distance set too high
</floater.string>
<floater.string name="client_texture_loading_cause_msg">
- å¯èƒ½åŽŸå› ï¼šæ­£åœ¨è¼‰å…¥åœ–åƒ
+ Possible cause: Images loading
</floater.string>
<floater.string name="client_texture_memory_cause_msg">
- å¯èƒ½åŽŸå› ï¼šè¨˜æ†¶é«”è£¡åœ–åƒå¤ªå¤š
+ Possible cause: Too many images in memory
</floater.string>
<floater.string name="client_complex_objects_cause_msg">
- å¯èƒ½åŽŸå› ï¼šå ´æ™¯å…§è¤‡é›œç‰©ä»¶å¤ªå¤š
+ Possible cause: Too many complex objects in scene
</floater.string>
<floater.string name="network_text_msg">
網路
@@ -55,10 +55,10 @@
5
</floater.string>
<floater.string name="network_packet_loss_critical_msg">
- 這次連通丟失了至少 [NETWORK_PACKET_LOSS_CRITICAL]% çš„å°åŒ…
+ Connection is dropping over [NETWORK_PACKET_LOSS_CRITICAL]% of packets
</floater.string>
<floater.string name="network_packet_loss_warning_msg">
- 這次連通丟失了 [NETWORK_PACKET_LOSS_WARNING]%-[NETWORK_PACKET_LOSS_CRITICAL]% çš„å°åŒ…
+ Connection is dropping [NETWORK_PACKET_LOSS_WARNING]%-[NETWORK_PACKET_LOSS_CRITICAL]% of packets
</floater.string>
<floater.string name="network_performance_normal_msg">
正常
@@ -70,16 +70,16 @@
300
</floater.string>
<floater.string name="network_ping_critical_msg">
- æŽ¢æ¸¬é€£é€šå›žæ‡‰æ™‚é–“è¶…éŽ [NETWORK_PING_CRITICAL] 毫秒
+ Connection ping time is over [NETWORK_PING_CRITICAL] ms
</floater.string>
<floater.string name="network_ping_warning_msg">
- 探測連通回應時間為 [NETWORK_PING_WARNING]-[NETWORK_PING_CRITICAL] 毫秒
+ Connection ping time is [NETWORK_PING_WARNING]-[NETWORK_PING_CRITICAL] ms
</floater.string>
<floater.string name="network_packet_loss_cause_msg">
- å¯èƒ½é€£é€šä¸è‰¯ï¼Œæˆ–所設的å好連通頻寬éŽé«˜ã€‚
+ Possible bad connection or &apos;Bandwidth&apos; pref too high.
</floater.string>
<floater.string name="network_ping_cause_msg">
- å¯èƒ½é€£é€šä¸è‰¯ï¼Œæˆ–使用檔案分享應用程å¼ã€‚
+ Possible bad connection or file-sharing app.
</floater.string>
<floater.string name="server_text_msg">
伺æœå™¨
diff --git a/indra/newview/skins/default/xui/zh/floater_perms_default.xml b/indra/newview/skins/default/xui/zh/floater_perms_default.xml
new file mode 100644
index 0000000000..78696be482
--- /dev/null
+++ b/indra/newview/skins/default/xui/zh/floater_perms_default.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="perms default" title="é è¨­çš„創建權é™">
+ <panel label="é è¨­çš„æ¬Šé™" name="default permissions"/>
+ <button label="確定" label_selected="確定" name="ok"/>
+ <button label="å–æ¶ˆ" label_selected="å–æ¶ˆ" name="cancel"/>
+</floater>
diff --git a/indra/newview/skins/default/xui/zh/floater_region_restarting.xml b/indra/newview/skins/default/xui/zh/floater_region_restarting.xml
new file mode 100644
index 0000000000..afac7da203
--- /dev/null
+++ b/indra/newview/skins/default/xui/zh/floater_region_restarting.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="region_restarting" title="地å€é‡æ–°å•Ÿå‹•中">
+ <string name="RegionName">
+ 你所在的地å€([NAME])å³å°‡é‡æ–°å•Ÿå‹•。
+
+如果你繼續留在這地å€ï¼Œä½ å°‡æœƒè¢«ç™»å‡ºã€‚
+ </string>
+ <string name="RestartSeconds">
+ 釿–°å•Ÿå‹•倒數秒數:
+[SECONDS]
+ </string>
+ <panel name="layout_panel_1">
+ <text name="region_name">
+ 你所在的地å€(-最長地å€å-)å³å°‡é‡æ–°å•Ÿå‹•。
+
+如果你繼續留在這地å€ï¼Œä½ å°‡æœƒè¢«ç™»å‡ºã€‚
+ </text>
+ <text name="restart_seconds">
+ 釿–°å•Ÿå‹•倒數秒數:
+ 32767
+ </text>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/zh/floater_report_abuse.xml b/indra/newview/skins/default/xui/zh/floater_report_abuse.xml
index 8dbc216ab5..d4b5a2f990 100755
--- a/indra/newview/skins/default/xui/zh/floater_report_abuse.xml
+++ b/indra/newview/skins/default/xui/zh/floater_report_abuse.xml
@@ -35,7 +35,7 @@
<combo_box.item label="年齡 &gt; æˆäººå±…民出ç¾åœ¨é’少年專用第二人生" name="Age__Adult_resident_on_Teen_Second_Life"/>
<combo_box.item label="年齡 &gt; 未æˆå¹´å±…民出ç¾åœ¨é’少年專用第二人生以外場所" name="Age__Underage_resident_outside_of_Teen_Second_Life"/>
<combo_box.item label="攻擊 &gt; 戰鬥沙盤 / ä¸å®‰å…¨å€åŸŸ" name="Assault__Combat_sandbox___unsafe_area"/>
- <combo_box.item label="攻擊 &gt; 安全å€åŸŸ" name="Assault__Safe_area"/>
+ <combo_box.item label="攻擊 &gt; 在安全地å€å°„æ“Šã€æŽ¨æ“ æˆ–æŽ¨æ’žå¦ä¸€åå±…æ°‘" name="Assault__Safe_area"/>
<combo_box.item label="攻擊 &gt; 測試武器的沙盤" name="Assault__Weapons_testing_sandbox"/>
<combo_box.item label="商業 &gt; 未é€äº¤ç”¢å“或履行æœå‹™" name="Commerce__Failure_to_deliver_product_or_service"/>
<combo_box.item label="æ­éœ² &gt; 真實世界資訊" name="Disclosure__Real_world_information"/>
@@ -49,25 +49,25 @@
<combo_box.item label="è©æ¬º &gt; L$" name="Fraud__L$"/>
<combo_box.item label="è©æ¬º &gt; 土地" name="Fraud__Land"/>
<combo_box.item label="è©æ¬º &gt; å±¤å£“å¼æŽ¨éŠ·æˆ–é€£ç’°ä¿¡" name="Fraud__Pyramid_scheme_or_chain_letter"/>
- <combo_box.item label="è©æ¬º &gt; 美金" name="Fraud__US$"/>
+ <combo_box.item label="è©æ¬º &gt; L$ 或美元" name="Fraud__US$"/>
<combo_box.item label="騷擾 &gt; 廣告農場 / 視覺轟炸" name="Harassment__Advert_farms___visual_spam"/>
<combo_box.item label="騷擾 &gt; 詆譭個人或群組" name="Harassment__Defaming_individuals_or_groups"/>
<combo_box.item label="騷擾 &gt; 阻撓移動" name="Harassment__Impeding_movement"/>
<combo_box.item label="騷擾 &gt; 性騷擾" name="Harassment__Sexual_harassment"/>
- <combo_box.item label="騷擾 &gt; é¼“å¹ / 教唆他人é•åæœå‹™æ¢æ¬¾" name="Harassment__Solicting_inciting_others_to_violate_ToS"/>
+ <combo_box.item label="騷擾 &gt; æ„圖滋事的有é‡å°æ€§çš„行為" name="Harassment__Solicting_inciting_others_to_violate_ToS"/>
<combo_box.item label="騷擾 &gt; 言語暴力" name="Harassment__Verbal_abuse"/>
<combo_box.item label="ä¸é›… &gt; 令大多人ä¸å¿«çš„內容或行為" name="Indecency__Broadly_offensive_content_or_conduct"/>
<combo_box.item label="ä¸é›… &gt; 冒犯人的化身å稱" name="Indecency__Inappropriate_avatar_name"/>
- <combo_box.item label="ä¸é›… &gt; 在一般普級地å€å‡ºç¾å†’犯人的內容或行為" name="Indecency__Mature_content_in_PG_region"/>
+ <combo_box.item label="失當 &gt; å°ä¸€åœ°å€çš„åˆ†ç´šä¸æ°ç•¶çš„的內容或行為" name="Indecency__Mature_content_in_PG_region"/>
<combo_box.item label="ä¸é›… &gt; 在é©åº¦æˆäººåœ°å€å‡ºç¾å†’犯人的內容或行為" name="Indecency__Inappropriate_content_in_Mature_region"/>
<combo_box.item label="侵犯智產權 &gt; 移除內容" name="Intellectual_property_infringement_Content_Removal"/>
<combo_box.item label="侵犯智產權 &gt; 複製機器程å¼ç¢¼ CopyBot 或濫用權é™" name="Intellectual_property_infringement_CopyBot_or_Permissions_Exploit"/>
<combo_box.item label="ä¸å®¹ç•°å·±" name="Intolerance"/>
<combo_box.item label="土地 &gt; ä¸ç•¶ä½¿ç”¨æ²™ç›¤è³‡æº" name="Land__Abuse_of_sandbox_resources"/>
- <combo_box.item label="土地 &gt; 侵佔 &gt; 物件 / æè³ª" name="Land__Encroachment__Objects_textures"/>
+ <combo_box.item label="土地 &gt; 侵佔 &gt; 物件或æè³ª" name="Land__Encroachment__Objects_textures"/>
<combo_box.item label="土地 &gt; 侵佔 &gt; ç²’å­" name="Land__Encroachment__Particles"/>
<combo_box.item label="土地 &gt; 侵佔 &gt; 樹種 / æ¤ç‰©" name="Land__Encroachment__Trees_plants"/>
- <combo_box.item label="下注 / è³­åš" name="Wagering_gambling"/>
+ <combo_box.item label="下注或賭åš" name="Wagering_gambling"/>
<combo_box.item label="å…¶ä»–" name="Other"/>
</combo_box>
<text name="abuser_name_title">
diff --git a/indra/newview/skins/default/xui/zh/floater_scene_load_stats.xml b/indra/newview/skins/default/xui/zh/floater_scene_load_stats.xml
new file mode 100644
index 0000000000..1a5c20abeb
--- /dev/null
+++ b/indra/newview/skins/default/xui/zh/floater_scene_load_stats.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="Scene Load Statistics" title="場景負載統計資料">
+ <button label="æš«åœ" name="playpause"/>
+ <scroll_container name="statistics_scroll">
+ <container_view name="statistics_view">
+ <stat_view label="基本" name="basic">
+ <stat_bar label="å¹€åƒç´ å·®" name="frame difference"/>
+ <stat_bar label="已收到UDP資料" name="bandwidth"/>
+ <stat_bar label="å°åŒ…æå¤±" name="packet_loss"/>
+ </stat_view>
+ <stat_view label="進階" name="advanced">
+ <stat_view label="呈åƒ" name="render">
+ <stat_bar label="物件總計" name="objs"/>
+ <stat_bar label="新物件" name="newobjs"/>
+ <stat_bar label="物件快å–讀å–率" name="object_cache_hits"/>
+ </stat_view>
+ <stat_view label="æè³ª" name="texture">
+ <stat_bar label="å¿«å–讀å–率" name="texture_cache_hits"/>
+ <stat_bar label="å¿«å–讀å–å»¶é²" name="texture_cache_read_latency"/>
+ <stat_bar label="計數" name="numimagesstat"/>
+ <stat_bar label="原始計數" name="numrawimagesstat"/>
+ </stat_view>
+ <stat_view label="網路" name="network">
+ <stat_bar label="進入å°åŒ…" name="packetsinstat"/>
+ <stat_bar label="出去å°åŒ…" name="packetsoutstat"/>
+ <stat_bar label="物件" name="objectdatareceived"/>
+ <stat_bar label="æè³ª" name="texturedatareceived"/>
+ <stat_bar label="資產" name="assetudpdatareceived"/>
+ <stat_bar label="層次" name="layersdatareceived"/>
+ <stat_bar label="實入" name="messagedatain"/>
+ <stat_bar label="實出" name="messagedataout"/>
+ <stat_bar label="VFS 待行作業" name="vfspendingoperations"/>
+ </stat_view>
+ </stat_view>
+ <stat_view label="模擬器" name="sim">
+ <stat_bar label="物件" name="simobjects"/>
+ <stat_bar label="使用中物件" name="simactiveobjects"/>
+ <stat_bar label="使用中腳本" name="simactivescripts"/>
+ <stat_bar label="進入å°åŒ…" name="siminpps"/>
+ <stat_bar label="出去å°åŒ…" name="simoutpps"/>
+ <stat_bar label="擱置下載" name="simpendingdownloads"/>
+ <stat_bar label="擱置上傳" name="simpendinguploads"/>
+ <stat_bar label="未承èªçš„總ä½å…ƒçµ„數" name="simtotalunackedbytes"/>
+ <stat_view label="時間(毫秒)" name="simperf">
+ <stat_bar label="總幀時間" name="simframemsec"/>
+ <stat_bar label="淨時間" name="simnetmsec"/>
+ <stat_bar label="ç‰©ç†æ™‚é–“" name="simsimphysicsmsec"/>
+ <stat_bar label="模擬時間" name="simsimothermsec"/>
+ <stat_bar label="用戶時間" name="simagentmsec"/>
+ <stat_bar label="åœ–åƒæ™‚é–“" name="simimagesmsec"/>
+ <stat_bar label="腳本時間" name="simscriptmsec"/>
+ <stat_bar label="閒置時間" name="simsparemsec"/>
+ <stat_view label="時間細節(毫秒)" name="timedetails">
+ <stat_bar label="ç‰©ç†æ­¥é©Ÿ" name="simsimphysicsstepmsec"/>
+ <stat_bar label="更新物ç†å½¢ç‹€" name="simsimphysicsshapeupdatemsec"/>
+ <stat_bar label="物ç†ï¼ˆå…¶ä»–)" name="simsimphysicsothermsec"/>
+ <stat_bar label="ç¡çœ æ™‚é–“" name="simsleepmsec"/>
+ <stat_bar label="基礎網路輸出入" name="simpumpiomsec"/>
+ </stat_view>
+ </stat_view>
+ </stat_view>
+ </container_view>
+ </scroll_container>
+</floater>
diff --git a/indra/newview/skins/default/xui/zh/floater_script_ed_prefs.xml b/indra/newview/skins/default/xui/zh/floater_script_ed_prefs.xml
new file mode 100644
index 0000000000..cca41cc96d
--- /dev/null
+++ b/indra/newview/skins/default/xui/zh/floater_script_ed_prefs.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_script_colors" title="腳本文字色彩">
+ <text name="color_pickers_label">
+ 鏿“‡æ‰€è¦çš„色彩:
+ </text>
+ <text name="text_label">
+ 文字
+ </text>
+ <text name="cursor_label">
+ 游標
+ </text>
+ <text name="background_label">
+ 背景
+ </text>
+ <text name="datatype_label">
+ 資料類型
+ </text>
+ <text name="event_label">
+ 活動
+ </text>
+ <text name="string_literal_label">
+ 字串常值
+ </text>
+ <text name="constant_label">
+ 常數
+ </text>
+ <text name="flow_control_label">
+ æµç¨‹æŽ§åˆ¶
+ </text>
+ <text name="function_label">
+ 函å¼
+ </text>
+ <text name="comment_label">
+ 註解
+ </text>
+ <script_editor name="Script Preview">
+ /* 範例腳本 */
+default
+{
+ state_entry()
+ {
+ // 註解
+ string greeting = &quot;大家好&quot;;
+ llSay(PUBLIC_CHANNEL, greeting);
+ }
+}
+ </script_editor>
+</floater>
diff --git a/indra/newview/skins/default/xui/zh/floater_snapshot.xml b/indra/newview/skins/default/xui/zh/floater_snapshot.xml
index e86e20829f..a65227bbd4 100755
--- a/indra/newview/skins/default/xui/zh/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/zh/floater_snapshot.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater name="Snapshot" title="å¿«ç…§é è¦½">
+<floater name="Snapshot" title="å¿«ç…§">
<floater.string name="unknown">
未知
</floater.string>
@@ -61,5 +61,11 @@
<check_box label="擡頭顯示" name="hud_check"/>
<check_box label="將幀å‡çµï¼ˆå…¨èž¢å¹•)" name="freeze_frame_check"/>
<check_box label="自動刷新" name="auto_snapshot_check"/>
+ <text name="filter_list_label">
+ 濾é¡ï¼š
+ </text>
+ <combo_box name="filters_combobox" tool_tip="åœ–åƒæ¿¾é¡">
+ <combo_box.item label="ä¸ç”¨æ¿¾é¡" name="NoFilter"/>
+ </combo_box>
</panel>
</floater>
diff --git a/indra/newview/skins/default/xui/zh/floater_stats.xml b/indra/newview/skins/default/xui/zh/floater_stats.xml
index 4af5684ec1..f06eb5e78f 100755
--- a/indra/newview/skins/default/xui/zh/floater_stats.xml
+++ b/indra/newview/skins/default/xui/zh/floater_stats.xml
@@ -4,17 +4,21 @@
<container_view name="statistics_view">
<stat_view label="基本" name="basic">
<stat_bar label="æ¯ç§’幀數" name="fps"/>
- <stat_bar label="頻寬" name="bandwidth"/>
+ <stat_bar label="已收到UDP資料" name="bandwidth"/>
<stat_bar label="å°åŒ…æå¤±" name="packet_loss"/>
<stat_bar label="æŽ¢è©¢æ¨¡æ“¬å™¨æœ‰ç„¡åæ‡‰" name="ping"/>
</stat_view>
<stat_view label="進階" name="advanced">
<stat_view label="呈åƒ" name="render">
- <stat_bar label="繪出的 KTris(æ¯å¹€ï¼‰" name="ktrisframe"/>
- <stat_bar label="繪出的 KTris(æ¯ç§’)" name="ktrissec"/>
- <stat_bar label="物件總計" name="objs"/>
+ <stat_bar label="KTris(æ¯å¹€ï¼‰" name="ktrisframe"/>
+ <stat_bar label="KTris(æ¯ç§’)" name="ktrissec"/>
+ <stat_bar label="物件總計" name="totalobjs"/>
+ <stat_bar label="存入快å–的物件" name="cachedobjs"/>
<stat_bar label="新物件" name="newobjs"/>
<stat_bar label="物件快å–讀å–率" name="object_cache_hits"/>
+ <stat_bar label="已執行é®è”½æŸ¥è©¢" name="occlusion_queries"/>
+ <stat_bar label="物件已é®è”½" name="occluded"/>
+ <stat_bar label="物件已解除é®è”½" name="unoccluded"/>
</stat_view>
<stat_view label="æè³ª" name="texture">
<stat_bar label="å¿«å–讀å–率" name="texture_cache_hits"/>
@@ -26,15 +30,32 @@
<stat_bar label="原始記憶" name="rawmemstat"/>
<stat_bar label="界é™è¨˜æ†¶" name="glboundmemstat"/>
</stat_view>
+ <stat_view label="記憶體使用狀æ³" name="memory">
+ <stat_bar label="LLTrace" name="LLTrace"/>
+ <stat_bar label="使用者界é¢" name="LLView"/>
+ <stat_bar label="å­—åž‹" name="LLFontFreetype"/>
+ <stat_bar label="æ”¶ç´å€" name="LLInventoryObject"/>
+ <stat_bar label="Viewer物件" name="LLViewerObject"/>
+ <stat_bar label="八剿¨¹ç¾¤è³‡æ–™" name="LLViewerOctreeGroup"/>
+ <stat_bar label="八剿¨¹è³‡æ–™" name="LLViewerOctreeEntry"/>
+ <stat_bar label="Viewer物件快å–" name="LLVOCacheEntry"/>
+ <stat_bar label="å¯ç¹ªç‰©ä»¶" name="LLDrawable"/>
+ <stat_bar label="臉部資料" name="LLFace"/>
+ <stat_bar label="æç¹ªè³‡è¨Š" name="LLDrawInfo"/>
+ <stat_bar label="æè³ªè³‡æ–™" name="LLTexture"/>
+ <stat_bar label="圖åƒè³‡æ–™" name="LLImage"/>
+ <stat_bar label="GL圖åƒè³‡æ–™" name="LLImageGL"/>
+ <stat_bar label="頂點緩è¡" name="LLVertexBuffer"/>
+ </stat_view>
<stat_view label="網路" name="network">
<stat_bar label="進入å°åŒ…" name="packetsinstat"/>
<stat_bar label="出去å°åŒ…" name="packetsoutstat"/>
- <stat_bar label="物件" name="objectkbitstat"/>
- <stat_bar label="æè³ª" name="texturekbitstat"/>
- <stat_bar label="資產" name="assetkbitstat"/>
- <stat_bar label="層次" name="layerskbitstat"/>
- <stat_bar label="實入" name="actualinkbitstat"/>
- <stat_bar label="實出" name="actualoutkbitstat"/>
+ <stat_bar label="物件" name="objectdatareceived"/>
+ <stat_bar label="æè³ª" name="texturedatareceived"/>
+ <stat_bar label="資產" name="assetudpdatareceived"/>
+ <stat_bar label="層次" name="layersdatareceived"/>
+ <stat_bar label="實入" name="messagedatain"/>
+ <stat_bar label="實出" name="messagedataout"/>
<stat_bar label="VFS 待行作業" name="vfspendingoperations"/>
</stat_view>
</stat_view>
@@ -64,8 +85,8 @@
<stat_bar label="出去å°åŒ…" name="simoutpps"/>
<stat_bar label="擱置下載" name="simpendingdownloads"/>
<stat_bar label="擱置上傳" name="simpendinguploads"/>
- <stat_bar label="未承èªçš„總ä½å…ƒçµ„數" name="simtotalunackedbytes"/>
- <stat_view label="時間(毫秒)" name="simperf">
+ <stat_bar label="未承èªçš„總資料" name="simtotalunackedbytes"/>
+ <stat_view label="時間" name="simperf">
<stat_bar label="總禎時間" name="simframemsec"/>
<stat_bar label="淨時間" name="simnetmsec"/>
<stat_bar label="ç‰©ç†æ™‚é–“" name="simsimphysicsmsec"/>
@@ -74,7 +95,7 @@
<stat_bar label="åœ–åƒæ™‚é–“" name="simimagesmsec"/>
<stat_bar label="腳本時間" name="simscriptmsec"/>
<stat_bar label="閒置時間" name="simsparemsec"/>
- <stat_view label="時間細節(毫秒)" name="timedetails">
+ <stat_view label="時間細節" name="timedetails">
<stat_bar label="ç‰©ç†æ­¥é©Ÿ" name="simsimphysicsstepmsec"/>
<stat_bar label="更新物ç†å½¢ç‹€" name="simsimphysicsshapeupdatemsec"/>
<stat_bar label="物ç†ï¼ˆå…¶ä»–)" name="simsimphysicsothermsec"/>
diff --git a/indra/newview/skins/default/xui/zh/floater_tools.xml b/indra/newview/skins/default/xui/zh/floater_tools.xml
index 7e6c972f40..175e2bf7a4 100755
--- a/indra/newview/skins/default/xui/zh/floater_tools.xml
+++ b/indra/newview/skins/default/xui/zh/floater_tools.xml
@@ -73,9 +73,7 @@
<check_box label="編輯è¯çµéƒ¨åˆ†" name="checkbox edit linked parts"/>
<button label="è¯çµ" name="link_btn"/>
<button label="å–æ¶ˆè¯çµ" name="unlink_btn"/>
- <text label="åŒæ™‚伸展兩å´" name="checkbox uniform label">
- åŒæ™‚伸展兩å´
- </text>
+ <check_box label="åŒæ™‚伸展兩å´" name="checkbox uniform"/>
<check_box initial_value="true" label="伸展æè³ª" name="checkbox stretch textures"/>
<check_box initial_value="true" label="Snap" name="checkbox snap to grid"/>
<combo_box name="combobox grid mode" tool_tip="鏿“‡ç‰©ä»¶å®šä½åƒè€ƒçš„æ ¼ç·šå°ºåº¦é¡žåž‹">
@@ -410,82 +408,7 @@
<spinner label="密度(100 公斤 / 立方公尺)" name="Physics Density"/>
<spinner label="æ¢å¾©" name="Physics Restitution"/>
</panel>
- <panel label="æè³ª" name="Texture">
- <panel.string name="string repeats per meter">
- æ¯å…¬å°ºé‡è¦†æ¬¡æ•¸
- </panel.string>
- <panel.string name="string repeats per face">
- æ¯ä¸€é¢é‡è¦†æ¬¡æ•¸
- </panel.string>
- <texture_picker label="æè³ª" name="texture control" tool_tip="點按以挑é¸åœ–片"/>
- <color_swatch label="é¡è‰²" name="colorswatch" tool_tip="點按以開啟é¡è‰²æŒ‘é¸å™¨"/>
- <text name="color trans">
- 逿˜Žåº¦ %
- </text>
- <text name="glow label">
- 光暈
- </text>
- <check_box label="全亮" name="checkbox fullbright"/>
- <text name="tex gen">
- 映射方å¼
- </text>
- <combo_box name="combobox texgen">
- <combo_box.item label="é è¨­" name="Default"/>
- <combo_box.item label="å¹³é¢" name="Planar"/>
- </combo_box>
- <text name="label shininess">
- 光澤
- </text>
- <combo_box name="combobox shininess">
- <combo_box.item label="ç„¡" name="None"/>
- <combo_box.item label="低" name="Low"/>
- <combo_box.item label="中" name="Medium"/>
- <combo_box.item label="高" name="High"/>
- </combo_box>
- <text name="label bumpiness">
- 凹凸貼圖
- </text>
- <combo_box name="combobox bumpiness">
- <combo_box.item label="ç„¡" name="None"/>
- <combo_box.item label="亮度" name="Brightness"/>
- <combo_box.item label="暗度" name="Darkness"/>
- <combo_box.item label="木紋" name="woodgrain"/>
- <combo_box.item label="樹皮" name="bark"/>
- <combo_box.item label="磚" name="bricks"/>
- <combo_box.item label="æ ¼å­" name="checker"/>
- <combo_box.item label="æ··å‡åœŸ" name="concrete"/>
- <combo_box.item label="粗花磚" name="crustytile"/>
- <combo_box.item label="石磚" name="cutstone"/>
- <combo_box.item label="圓盤" name="discs"/>
- <combo_box.item label="碎石" name="gravel"/>
- <combo_box.item label="培養皿" name="petridish"/>
- <combo_box.item label="å´é‚Šç‰‡" name="siding"/>
- <combo_box.item label="石磚格" name="stonetile"/>
- <combo_box.item label="彩色沙岩" name="stucco"/>
- <combo_box.item label="å¸é™„" name="suction"/>
- <combo_box.item label="編織" name="weave"/>
- </combo_box>
- <spinner label="水平(U)" name="TexScaleU"/>
- <check_box label="翻轉" name="checkbox flip s"/>
- <spinner label="垂直(V)" name="TexScaleV"/>
- <check_box label="翻轉" name="checkbox flip t"/>
- <spinner label="旋轉˚" name="TexRot"/>
- <button label="套用" label_selected="套用" name="button apply"/>
- <text name="tex offset">
- æè³ªä½ç§»
- </text>
- <spinner label="水平(U)" name="TexOffsetU"/>
- <spinner label="垂直(V)" name="TexOffsetV"/>
- <panel name="Add_Media">
- <text name="media_tex">
- 媒體
- </text>
- <button name="add_media" tool_tip="添加媒體"/>
- <button name="delete_media" tool_tip="刪除這個媒體æè³ª"/>
- <button name="edit_media" tool_tip="編輯這個媒體"/>
- <button label="å°é½Š" label_selected="å°é½Šåª’é«”" name="button align" tool_tip="å°é½Šåª’é«”æè³ªï¼ˆé ˆå…ˆè¼‰å…¥ï¼‰"/>
- </panel>
- </panel>
+ <panel label="æè³ª" name="Texture"/>
<panel label="內容" name="Contents">
<button label="新腳本" label_selected="新腳本" name="button new script"/>
<button label="權é™" name="button permissions"/>
diff --git a/indra/newview/skins/default/xui/zh/floater_twitter.xml b/indra/newview/skins/default/xui/zh/floater_twitter.xml
new file mode 100644
index 0000000000..0df68ba9be
--- /dev/null
+++ b/indra/newview/skins/default/xui/zh/floater_twitter.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<floater name="floater_twitter" title="推特">
+ <panel name="background">
+ <tab_container name="tabs">
+ <panel label="編撰" name="panel_twitter_photo"/>
+ <panel label="帳號" name="panel_twitter_account"/>
+ </tab_container>
+ <panel name="connection_status_panel">
+ <text name="connection_error_text">
+ 錯誤
+ </text>
+ <text name="connection_loading_text">
+ 載入中…
+ </text>
+ </panel>
+ </panel>
+</floater>
diff --git a/indra/newview/skins/default/xui/zh/menu_avatar_icon.xml b/indra/newview/skins/default/xui/zh/menu_avatar_icon.xml
index ef0986a13b..cefb395256 100755
--- a/indra/newview/skins/default/xui/zh/menu_avatar_icon.xml
+++ b/indra/newview/skins/default/xui/zh/menu_avatar_icon.xml
@@ -2,6 +2,7 @@
<menu name="Avatar Icon Menu">
<menu_item_call label="察看檔案" name="Show Profile"/>
<menu_item_call label="é€å‡º IM..." name="Send IM"/>
+ <menu_item_call label="è¦æ±‚瞬間傳é€" name="Request Teleport"/>
<menu_item_call label="加為朋å‹..." name="Add Friend"/>
<menu_item_call label="移除朋å‹..." name="Remove Friend"/>
</menu>
diff --git a/indra/newview/skins/default/xui/zh/menu_conversation.xml b/indra/newview/skins/default/xui/zh/menu_conversation.xml
index adfeefc337..04538dfdee 100644
--- a/indra/newview/skins/default/xui/zh/menu_conversation.xml
+++ b/indra/newview/skins/default/xui/zh/menu_conversation.xml
@@ -29,4 +29,5 @@
<menu_item_call label="所有人消音" name="ModerateVoiceMute"/>
<menu_item_call label="å–æ¶ˆæ‰€æœ‰äººçš„æ¶ˆéŸ³" name="ModerateVoiceUnmute"/>
</context_menu>
+ <menu_item_call label="å°éŽ–å±…æ°‘" name="BanMember"/>
</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/zh/menu_inventory.xml b/indra/newview/skins/default/xui/zh/menu_inventory.xml
index 7f745ffaa7..478f987035 100755
--- a/indra/newview/skins/default/xui/zh/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/zh/menu_inventory.xml
@@ -70,6 +70,7 @@
<menu_item_call label="播放" name="Sound Play"/>
<menu_item_call label="覆製 SLurl" name="url_copy"/>
<menu_item_call label="添加地標" name="About Landmark"/>
+ <menu_item_call label="顯示在地圖上" name="show_on_map"/>
<menu_item_call label="在虛擬世界播放" name="Animation Play"/>
<menu_item_call label="在本地播放" name="Animation Audition"/>
<menu_item_call label="é€å‡ºå³æ™‚訊æ¯" name="Send Instant Message"/>
diff --git a/indra/newview/skins/default/xui/zh/menu_login.xml b/indra/newview/skins/default/xui/zh/menu_login.xml
index 1d3d771efb..4a1e2f4364 100755
--- a/indra/newview/skins/default/xui/zh/menu_login.xml
+++ b/indra/newview/skins/default/xui/zh/menu_login.xml
@@ -5,7 +5,15 @@
<menu_item_call label="退出 [APP_NAME]" name="Quit"/>
</menu>
<menu label="幫助" name="Help">
- <menu_item_call label="[SECOND_LIFE] 幫助" name="Second Life Help"/>
+ <menu_item_call label="簡易教學…" name="How To"/>
+ <menu_item_call label="快速上手" name="Quickstart"/>
+ <menu_item_call label="知識庫" name="Knowledge Base"/>
+ <menu_item_call label="維基" name="Wiki"/>
+ <menu_item_call label="社群論壇" name="Community Forums"/>
+ <menu_item_call label="支æ´å…¥å£" name="Support portal"/>
+ <menu_item_call label="[SECOND_LIFE] 最新消æ¯" name="Second Life News"/>
+ <menu_item_call label="[SECOND_LIFE] éƒ¨è½æ ¼" name="Second Life Blogs"/>
+ <menu_item_call label="回報錯誤" name="Report Bug"/>
<menu_item_call label="關於 [APP_NAME]" name="About Second Life"/>
</menu>
<menu_item_check label="顯示除錯é¸å–®" name="Show Debug Menu"/>
diff --git a/indra/newview/skins/default/xui/zh/menu_object.xml b/indra/newview/skins/default/xui/zh/menu_object.xml
index f6657d876e..4e4e55e6f4 100755
--- a/indra/newview/skins/default/xui/zh/menu_object.xml
+++ b/indra/newview/skins/default/xui/zh/menu_object.xml
@@ -19,6 +19,7 @@
<context_menu label="管ç†" name="Remove">
<menu_item_call label="é•è¦èˆ‰å ±" name="Report Abuse..."/>
<menu_item_call label="å°éŽ–" name="Object Mute"/>
+ <menu_item_call label="解除å°éŽ–" name="Object Unmute"/>
<menu_item_call label="退回" name="Return..."/>
</context_menu>
<menu_item_call label="å–å¾—" name="Pie Object Take"/>
diff --git a/indra/newview/skins/default/xui/zh/menu_teleport_history_item.xml b/indra/newview/skins/default/xui/zh/menu_teleport_history_item.xml
index c636e108ad..bf60983896 100755
--- a/indra/newview/skins/default/xui/zh/menu_teleport_history_item.xml
+++ b/indra/newview/skins/default/xui/zh/menu_teleport_history_item.xml
@@ -2,5 +2,5 @@
<context_menu name="Teleport History Item Context Menu">
<menu_item_call label="瞬間傳é€" name="Teleport"/>
<menu_item_call label="更多資訊" name="More Information"/>
- <menu_item_call label="覆製到剪貼簿" name="CopyToClipboard"/>
+ <menu_item_call label="覆製 SLurl" name="CopyToClipboard"/>
</context_menu>
diff --git a/indra/newview/skins/default/xui/zh/menu_viewer.xml b/indra/newview/skins/default/xui/zh/menu_viewer.xml
index b267bda2bb..46d46e901c 100755
--- a/indra/newview/skins/default/xui/zh/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/zh/menu_viewer.xml
@@ -34,6 +34,9 @@
<menu_item_check label="附近的èŠå¤©â€¦â€¦" name="Nearby Chat"/>
<menu_item_check label="說話" name="Speak"/>
<menu_item_check label="交談記錄…" name="Conversation Log..."/>
+ <menu_item_call label="臉書…" name="Facebook"/>
+ <menu_item_call label="推特…" name="Twitter"/>
+ <menu_item_call label="Flickr…" name="Flickr"/>
<menu label="語音變è²" name="VoiceMorphing">
<menu_item_check label="æ²’æœ‰è®Šè²æ•ˆæžœ" name="NoVoiceMorphing"/>
<menu_item_check label="é è¦½â€¦â€¦" name="Preview"/>
@@ -70,11 +73,11 @@
<menu_item_check label="進階é¸å–®" name="Show Advanced Menu"/>
</menu>
<menu label="太陽" name="Sun">
- <menu_item_call label="日出" name="Sunrise"/>
- <menu_item_call label="中åˆ" name="Noon"/>
- <menu_item_call label="æ—¥è½" name="Sunset"/>
- <menu_item_call label="åˆå¤œ" name="Midnight"/>
- <menu_item_call label="使用地å€è¨­å®š" name="Use Region Settings"/>
+ <menu_item_check label="日出" name="Sunrise"/>
+ <menu_item_check label="中åˆ" name="Noon"/>
+ <menu_item_check label="æ—¥è½" name="Sunset"/>
+ <menu_item_check label="åˆå¤œ" name="Midnight"/>
+ <menu_item_check label="使用地å€è¨­å®š" name="Use Region Settings"/>
</menu>
<menu label="環境編輯器" name="Environment Editor">
<menu_item_call label="環境設定…" name="Environment Settings"/>
@@ -148,7 +151,8 @@
<menu_item_check label="貼齊格線" name="Snap to Grid"/>
<menu_item_call label="貼齊物件 XY 軸到格線" name="Snap Object XY to Grid"/>
<menu_item_call label="ä»¥æ‰€é¸æ“‡ä½œç‚ºæ ¼ç·š" name="Use Selection for Grid"/>
- <menu_item_call label="格線é¸é …" name="Grid Options"/>
+ <menu_item_call label="格線é¸é ……" name="Grid Options"/>
+ <menu_item_call label="設定é è¨­æ¬Šé™â€¦" name="Set default permissions"/>
</menu>
<menu label="上傳" name="Upload">
<menu_item_call label="圖åƒï¼ˆL$[COST])..." name="Upload Image"/>
@@ -156,15 +160,12 @@
<menu_item_call label="動作(L$[COST])..." name="Upload Animation"/>
<menu_item_call label="模型…" name="Upload Model"/>
<menu_item_call label="批é‡ï¼ˆæ¯æª”案 L$[COST] )..." name="Bulk Upload"/>
- <menu_item_call label="設定é è¨­ä¸Šå‚³æ¬Šé™" name="perm prefs"/>
</menu>
<menu_item_call label="復原" name="Undo"/>
<menu_item_call label="é‡åš" name="Redo"/>
</menu>
<menu label="幫助" name="Help">
<menu_item_call label="簡易教學…" name="How To"/>
- <menu_item_call label="[SECOND_LIFE] 幫助" name="Second Life Help"/>
- <menu_item_call label="使用者指å—" name="User’s guide"/>
<menu_item_call label="知識庫" name="Knowledge Base"/>
<menu_item_call label="維基" name="Wiki"/>
<menu_item_call label="社群論壇" name="Community Forums"/>
@@ -186,6 +187,7 @@
<menu label="效能工具" name="Performance Tools">
<menu_item_call label="Lag 測é‡å™¨" name="Lag Meter"/>
<menu_item_check label="統計列" name="Statistics Bar"/>
+ <menu_item_call label="場景負載統計資料" name="Scene Load Statistics"/>
<menu_item_check label="顯示化身的繪製é‡é‡" name="Avatar Rendering Cost"/>
</menu>
<menu label="高亮顯示與å¯è¦‹åº¦" name="Highlighting and Visibility">
@@ -248,6 +250,7 @@
<menu_item_check label="快速碼錶" name="Fast Timers"/>
<menu_item_check label="記憶體" name="Memory"/>
<menu_item_check label="場景統計資料" name="Scene Statistics"/>
+ <menu_item_check label="場景載入監控器" name="Scene Loading Monitor"/>
<menu_item_call label="æè³ªæ“·å–除錯控制å°" name="Texture Fetch Debug Console"/>
<menu_item_call label="地å€è³‡è¨Šå‚³è‡³é™¤éŒ¯æŽ§åˆ¶å°" name="Region Info to Debug Console"/>
<menu_item_call label="群組資訊至除錯控制å°" name="Group Info to Debug Console"/>
@@ -284,6 +287,7 @@
<menu_item_check label="å®šæœŸå‡ºç¾æ…¢å¹€çއ" name="Periodic Slow Frame"/>
<menu_item_check label="ç•«é¢æ¸¬è©¦" name="Frame Test"/>
<menu_item_call label="幀特性" name="Frame Profile"/>
+ <menu_item_call label="標竿測試" name="Benchmark"/>
</menu>
<menu label="呈åƒçš„元資料" name="Render Metadata">
<menu_item_check label="外框箱" name="Bounding Boxes"/>
@@ -301,7 +305,9 @@
<menu_item_check label="細節層次資訊" name="LOD Info"/>
<menu_item_check label="建製佇列" name="Build Queue"/>
<menu_item_check label="燈光" name="Lights"/>
+ <menu_item_check label="ç²’å­æ•ˆæžœ" name="Particles"/>
<menu_item_check label="碰撞骨架" name="Collision Skeleton"/>
+ <menu_item_check label="接點" name="Joints"/>
<menu_item_check label="光線投射" name="Raycast"/>
<menu_item_check label="風力å‘é‡" name="Wind Vectors"/>
<menu_item_check label="繪出複雜度" name="rendercomplexity"/>
@@ -334,6 +340,7 @@
<menu_item_check label="使附著燈光呈åƒ" name="Render Attached Lights"/>
<menu_item_check label="ä½¿é™„è‘—ä¾‹å­æ•ˆæžœå‘ˆåƒ" name="Render Attached Particles"/>
<menu_item_check label="åœæ‡¸ç™¼å…‰ç‰©ä»¶" name="Hover Glow Objects"/>
+ <menu_item_call label="ç«‹å³æ¸…除快å–" name="Cache Clear"/>
</menu>
<menu label="網路" name="Network">
<menu_item_check label="æš«åœç”¨æˆ¶" name="AgentPause"/>
@@ -366,7 +373,6 @@
<menu_item_call label="傾å°ç„¦é»žå®¹å™¨" name="Dump Focus Holder"/>
<menu_item_call label="åˆ—å°æ‰€é¸ç‰©ä»¶è³‡è¨Š" name="Print Selected Object Info"/>
<menu_item_call label="列å°ç”¨æˆ¶è³‡è¨Š" name="Print Agent Info"/>
- <menu_item_check label="地å€é™¤éŒ¯æŽ§åˆ¶å°" name="Region Debug Console"/>
<menu_item_check label="除錯 SelectMgr" name="Debug SelectMgr"/>
<menu_item_check label="除錯點按動作" name="Debug Clicks"/>
<menu_item_check label="視角除錯" name="Debug Views"/>
diff --git a/indra/newview/skins/default/xui/zh/notifications.xml b/indra/newview/skins/default/xui/zh/notifications.xml
index 864f20fc15..bd05725e2b 100755
--- a/indra/newview/skins/default/xui/zh/notifications.xml
+++ b/indra/newview/skins/default/xui/zh/notifications.xml
@@ -114,15 +114,15 @@
<usetemplate name="okbutton" yestext="確定"/>
</notification>
<notification name="OutboxImportFailed">
- 轉移失敗
+ 傳é€å¤±æ•—,錯誤碼 &apos;[ERROR_CODE]&apos;
未將任何資料夾é€å¾€ç¬¬äºŒäººç”Ÿè³¼ç‰©å¸‚集,系統或網路出錯。 è«‹ç¨å€™å†è©¦ä¸€æ¬¡ã€‚
<usetemplate name="okbutton" yestext="確定"/>
</notification>
<notification name="OutboxInitFailed">
- 第二人生購物市集åˆå§‹åŒ–失敗
+ 購物市集åˆå§‹åŒ–失敗,錯誤碼 &apos;[ERROR_CODE]&apos;
-第二人生購物市集åˆå§‹åŒ–失敗,系統或網路出錯。 è«‹ç¨å€™å†è©¦ä¸€æ¬¡ã€‚
+購物市集åˆå§‹åŒ–失敗,系統或網路出錯。 è«‹ç¨å€™å†è©¦ä¸€æ¬¡ã€‚
<usetemplate name="okbutton" yestext="確定"/>
</notification>
<notification name="CompileQueueSaveText">
@@ -210,6 +210,22 @@
ä½ ä»è¦æ–°å¢žé€™é …能力給「[ROLE_NAME]ã€ï¼Ÿ
<usetemplate name="okcancelbuttons" notext="å¦" yestext="是"/>
</notification>
+ <notification name="AssignBanAbilityWarning">
+ ä½ å³å°‡æŠŠã€Œ[ACTION_NAME]ã€èƒ½åŠ›å¢žåŠ çµ¦ã€Œ[ROLE_NAME]ã€è§’色。
+
+ *警告*
+任何擔任帶有此能力的角色的æˆå“¡ï¼Œå°‡é€£å¸¶å¾—到「[ACTION_NAME_2]ã€å’Œã€Œ[ACTION_NAME_3]ã€èƒ½åŠ›ã€‚
+ <usetemplate name="okbutton" yestext="確定"/>
+ </notification>
+ <notification name="RemoveBanAbilityWarning">
+ ä½ å³å°‡å‰é™¤ã€Œ[ROLE_NAME]ã€è§’色的「[ACTION_NAME]ã€èƒ½åŠ›ã€‚
+
+ *警告*
+å‰é™¤é€™å€‹èƒ½åŠ›ï¼Œå°‡ä¸é€£å¸¶å‰é™¤ã€Œ[ACTION_NAME_2]ã€å’Œã€Œ[ACTION_NAME_3]ã€èƒ½åŠ›ã€‚
+
+如果你ä¸å¸Œæœ›è®“é€™å€‹è§’è‰²ç¹¼çºŒæ“æœ‰é€™äº›èƒ½åŠ›ï¼Œè«‹ç«‹å³å–消它們ï¼
+ <usetemplate name="okbutton" yestext="確定"/>
+ </notification>
<notification name="EjectGroupMemberWarning">
ä½ å³å°‡æŠŠ [AVATAR_NAME] 踢出群組。
<usetemplate ignoretext="確定將æŸäººè¸¢å‡ºç¾¤çµ„" name="okcancelignore" notext="å–æ¶ˆ" yestext="踢出"/>
@@ -1569,6 +1585,14 @@ SHA1 指紋:[MD5_DIGEST]
無法離開群組。 你是此群組僅存的所有人,ä¸å¾—離開群組。 請先把所有人è·éŠœæŒ‡æ´¾çµ¦å¦ä¸€äººã€‚
<usetemplate name="okbutton" yestext="確定"/>
</notification>
+ <notification name="GroupDepartError">
+ 無法離開群組:[reason]。
+ <usetemplate name="okbutton" yestext="確定"/>
+ </notification>
+ <notification name="GroupDepart">
+ 你已經離開[group_name]群組。
+ <usetemplate name="okbutton" yestext="確定"/>
+ </notification>
<notification name="ConfirmKick">
你確定è¦è¸¢å‡ºé€™ç¶²æ ¼å…§çš„全部居民?
<usetemplate name="okcancelbuttons" notext="å–æ¶ˆ" yestext="踢出全部居民"/>
@@ -1722,6 +1746,10 @@ SHA1 指紋:[MD5_DIGEST]
你確定è¦çž¬é–“傳é€åˆ°&lt;nolink&gt;[LOCATION]&lt;/nolink&gt;?
<usetemplate ignoretext="ç¢ºèªæˆ‘è¦çž¬é–“傳é€åˆ°æŸå€‹åœ°æ¨™" name="okcancelignore" notext="å–æ¶ˆ" yestext="瞬間傳é€"/>
</notification>
+ <notification name="TeleportViaSLAPP">
+ 你確定è¦çž¬é–“傳é€åˆ°&lt;nolink&gt;[LOCATION]&lt;/nolink&gt;?
+ <usetemplate ignoretext="ç¢ºèªæˆ‘è¦é€éŽSLAPP瞬間傳é€" name="okcancelignore" notext="å–æ¶ˆ" yestext="瞬間傳é€"/>
+ </notification>
<notification name="TeleportToPick">
瞬間傳é€åˆ° [PICK]?
<usetemplate ignoretext="ç¢ºèªæˆ‘è¦çž¬é–“傳é€åˆ°ç²¾é¸åœ°é»žçš„æ‰€åœ¨ä½ç½®" name="okcancelignore" notext="å–æ¶ˆ" yestext="瞬間傳é€"/>
@@ -1931,6 +1959,9 @@ SHA1 指紋:[MD5_DIGEST]
<notification name="ProblemAddingEstateManager">
新增領地管ç†äººæ™‚出å•題。 其中一個領地的管ç†äººæ¸…å–®å¯èƒ½å·²ç¶“顿»¿ã€‚
</notification>
+ <notification name="ProblemAddingEstateBanManager">
+ 無法把領地所有人或管ç†å“¡åŠ å…¥é ˜åœ°çš„å°éŽ–å單中。
+ </notification>
<notification name="ProblemAddingEstateGeneric">
新增到這個領地清單時出å•題。 其中一個領地的清單å¯èƒ½å·²æ»¿ã€‚
</notification>
@@ -2443,6 +2474,12 @@ SHA1 指紋:[MD5_DIGEST]
<notification name="SystemMessage">
[MESSAGE]
</notification>
+ <notification name="FlickrConnect">
+ [MESSAGE]
+ </notification>
+ <notification name="TwitterConnect">
+ [MESSAGE]
+ </notification>
<notification name="PaymentReceived">
[MESSAGE]
</notification>
@@ -3019,7 +3056,7 @@ SHA1 指紋:[MD5_DIGEST]
居民:
-[RESIDENTS]
+&lt;nolink&gt;[RESIDENTS]&lt;/nolink&gt;
<usetemplate name="okcancelbuttons" notext="å–æ¶ˆ" yestext="確定"/>
</notification>
<notification name="ShareFolderConfirmation">
@@ -3031,7 +3068,7 @@ SHA1 指紋:[MD5_DIGEST]
居民:
-[RESIDENTS]
+&lt;nolink&gt;[RESIDENTS]&lt;/nolink&gt;
<usetemplate name="okcancelbuttons" notext="å–æ¶ˆ" yestext="確定"/>
</notification>
<notification name="ItemsShared">
@@ -3487,10 +3524,6 @@ SHA1 指紋:[MD5_DIGEST]
<notification name="EjectComingSoon">
ä½ ä¸å†å…許待在這裡,必須在 [EJECT_TIME] 秒內離開。
</notification>
- <notification name="NoEnterServerFull">
- 你無法進入這地å€ï¼Œå› ç‚º
-伺æœå™¨æ»¿è¼‰ã€‚
- </notification>
<notification name="SaveBackToInvDisabled">
「儲存回收ç´å€ã€åŠŸèƒ½å·²è¢«åœç”¨ã€‚
</notification>
@@ -3680,6 +3713,9 @@ SHA1 指紋:[MD5_DIGEST]
<notification name="LinkFailedTooMuchPhysics">
物件使用了éŽå¤šç‰©ç†è³‡æºï¼Œå…¶å‹•態特性已被åœç”¨ã€‚
</notification>
+ <notification name="EstateManagerFailedllTeleportHome">
+ 使–¼[SLURL]的物件&apos;[OBJECT_NAME]&apos;無法將領地管ç†å“¡çž¬é–“傳é€å›žå®¶ã€‚
+ </notification>
<notification name="TeleportedHomeByObjectOnParcel">
你已被 &apos;[PARCEL_NAME]&apos; 地段的物件 &apos;[OBJECT_NAME]&apos; æˆåŠŸçž¬é–“å‚³é€å›žå®¶
</notification>
@@ -3870,13 +3906,18 @@ SHA1 指紋:[MD5_DIGEST]
未é¸å–足夠租用地段,無法åˆä½µã€‚
</notification>
<notification name="CantDivideLandMultipleParcelsSelected">
- 無法分割土地,\n因為你é¸å–了多個地段,\nè«‹ç¸®å°æ‰€é¸åœŸåœ°ã€‚
+ 無法分割土地。
+é¸å–了超éŽä¸€å€‹åœ°æ®µã€‚
+è«‹è©¦è‘—ç¸®å°æ‰€é¸çš„土地。
</notification>
<notification name="CantDivideLandCantFindParcel">
- 無法分割土地。\n找ä¸åˆ°åœ°æ®µã€‚\n請到「幫助 &gt; 回報錯誤……ã€å›žå ±å•題
+ 無法分割土地。
+找ä¸åˆ°åœ°æ®µã€‚
+請到「幫助-&gt;回報錯誤ã€å›žå ±å•題
</notification>
<notification name="CantDivideLandWholeParcelSelected">
- 無法分割土地。 é¸å–了整個地段。\nè«‹è©¦è‘—ç¸®å°æ‰€é¸çš„土地。
+ 無法分割土地。 鏿“‡äº†æ•´å€‹åœ°æ®µã€‚
+è«‹è©¦è‘—ç¸®å°æ‰€é¸çš„土地。
</notification>
<notification name="LandHasBeenDivided">
土地分割æˆåŠŸã€‚
@@ -4016,4 +4057,12 @@ SHA1 指紋:[MD5_DIGEST]
無法移動檔案。 å·²æ¢å¾©å‰ä¸€å€‹è·¯å¾‘。
<usetemplate ignoretext="無法移動檔案。 å·²æ¢å¾©å‰ä¸€å€‹è·¯å¾‘。" name="okignore" yestext="確定"/>
</notification>
+ <notification name="DefaultObjectPermissions">
+ 儲存é è¨­æ¬Šé™æ™‚出å•題,原因:[REASON]。 è«‹ç¨å¾Œå†å˜—試儲存é è¨­æ¬Šé™ã€‚
+ <usetemplate name="okbutton" yestext="確定"/>
+ </notification>
+ <notification name="ChatHistoryIsBusyAlert">
+ èŠå¤©ç´€éŒ„檔案還在處ç†å‰ä¸€å€‹å‹•作。 è«‹ç¨å€™å†è©¦ï¼Œæˆ–è«‹æ›ä¸€å€‹èŠå¤©å°è±¡ã€‚
+ <usetemplate name="okbutton" yestext="確定"/>
+ </notification>
</notifications>
diff --git a/indra/newview/skins/default/xui/zh/panel_facebook_account.xml b/indra/newview/skins/default/xui/zh/panel_facebook_account.xml
new file mode 100644
index 0000000000..e8c31c69c5
--- /dev/null
+++ b/indra/newview/skins/default/xui/zh/panel_facebook_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_account">
+ <string name="facebook_connected" value="å·²æˆåŠŸé€£é€šè‡‰æ›¸ï¼Œèº«åˆ†ç‚ºï¼š"/>
+ <string name="facebook_disconnected" value="未連通臉書"/>
+ <text name="account_caption_label">
+ 未連通臉書。
+ </text>
+ <panel name="panel_buttons">
+ <button label="連通…" name="connect_btn"/>
+ <button label="中斷" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share-Facebook/ta-p/2149711 如何發佈到臉書]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_facebook_friends.xml b/indra/newview/skins/default/xui/zh/panel_facebook_friends.xml
new file mode 100644
index 0000000000..2cf3eb0cf5
--- /dev/null
+++ b/indra/newview/skins/default/xui/zh/panel_facebook_friends.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_friends">
+ <string name="facebook_friends_empty" value="你的臉書朋å‹ä¸­ï¼Œæ²’æœ‰åŒæ™‚也是第二人生居民的人。 今天就請你的臉書朋å‹åŠ å…¥ç¬¬äºŒäººç”Ÿï¼"/>
+ <string name="facebook_friends_no_connected" value="ä½ ç›®å‰å°šæœªé€£çµè‡‰æ›¸ã€‚ 請到「帳戶ã€é ç±¤é–‹å•Ÿé€™é …功能並進行連çµã€‚"/>
+ <accordion name="friends_accordion">
+ <accordion_tab name="tab_second_life_friends" title="第二人生的朋å‹"/>
+ <accordion_tab name="tab_suggested_friends" title="把這些人加為第二人生的朋å‹"/>
+ </accordion>
+ <text name="facebook_friends_status">
+ 未連通臉書。
+ </text>
+</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_facebook_photo.xml b/indra/newview/skins/default/xui/zh/panel_facebook_photo.xml
new file mode 100644
index 0000000000..d43fcf4665
--- /dev/null
+++ b/indra/newview/skins/default/xui/zh/panel_facebook_photo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="圖åƒè§£æžåº¦">
+ <combo_box.item label="ç›®å‰è¦–窗" name="CurrentWindow"/>
+ <combo_box.item label="640x480" name="640x480"/>
+ <combo_box.item label="800x600" name="800x600"/>
+ <combo_box.item label="1024x768" name="1024x768"/>
+ <combo_box.item label="1200x630" name="1200x630"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="åœ–åƒæ¿¾é¡">
+ <combo_box.item label="ä¸ç”¨æ¿¾é¡" name="NoFilter"/>
+ </combo_box>
+ <button label="釿–°æ•´ç†" name="new_snapshot_btn" tool_tip="點按å³å¯åˆ·æ–°"/>
+ <button label="é è¦½" name="big_preview_btn" tool_tip="點按å³å¯åˆ‡æ›é è¦½"/>
+ <text name="caption_label">
+ 說明(å¯ç•™ç©ºï¼‰ï¼š
+ </text>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="發佈" name="post_photo_btn"/>
+ <button label="å–æ¶ˆ" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_facebook_place.xml b/indra/newview/skins/default/xui/zh/panel_facebook_place.xml
new file mode 100644
index 0000000000..27bd789af1
--- /dev/null
+++ b/indra/newview/skins/default/xui/zh/panel_facebook_place.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_place">
+ <layout_stack name="stack_place">
+ <layout_panel name="place_detail_panel">
+ <text name="place_caption_label">
+ æè¿°ä¸€ä¸‹ä½ æ‰€åœ¨çš„地方:
+ </text>
+ </layout_panel>
+ <layout_panel name="place_map_panel">
+ <check_box initial_value="false" label="" name="add_place_view_cb"/>
+ </layout_panel>
+ <layout_panel name="place_button_panel">
+ <button label="發佈" name="post_place_btn"/>
+ <button label="å–æ¶ˆ" name="cancel_place_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_facebook_status.xml b/indra/newview/skins/default/xui/zh/panel_facebook_status.xml
new file mode 100644
index 0000000000..b947b49a4f
--- /dev/null
+++ b/indra/newview/skins/default/xui/zh/panel_facebook_status.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_facebook_status">
+ <layout_stack name="stack_status">
+ <layout_panel name="status_detail_panel">
+ <text name="status_caption_label">
+ 你在想些什麼?
+ </text>
+ </layout_panel>
+ <layout_panel name="status_button_panel">
+ <button label="發佈" name="post_status_btn"/>
+ <button label="å–æ¶ˆ" name="cancel_status_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_flickr_account.xml b/indra/newview/skins/default/xui/zh/panel_flickr_account.xml
new file mode 100644
index 0000000000..63cd547cd0
--- /dev/null
+++ b/indra/newview/skins/default/xui/zh/panel_flickr_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_flickr_account">
+ <string name="flickr_connected" value="ä½ å·²æˆåŠŸé€£é€š Flickr,身分為:"/>
+ <string name="flickr_disconnected" value="尚未連通 Flickr"/>
+ <text name="account_caption_label">
+ 尚未連通 Flickr。
+ </text>
+ <panel name="panel_buttons">
+ <button label="連通…" name="connect_btn"/>
+ <button label="中斷" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share/ta-p/2435609 瞭解如何發佈到 Flickr]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_flickr_photo.xml b/indra/newview/skins/default/xui/zh/panel_flickr_photo.xml
new file mode 100644
index 0000000000..75738abebc
--- /dev/null
+++ b/indra/newview/skins/default/xui/zh/panel_flickr_photo.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_flickr_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="圖åƒè§£æžåº¦">
+ <combo_box.item label="ç›®å‰è¦–窗" name="CurrentWindow"/>
+ <combo_box.item label="640x480" name="640x480"/>
+ <combo_box.item label="800x600" name="800x600"/>
+ <combo_box.item label="1024x768" name="1024x768"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="åœ–åƒæ¿¾é¡">
+ <combo_box.item label="ä¸ç”¨æ¿¾é¡" name="NoFilter"/>
+ </combo_box>
+ <button label="刷新" name="new_snapshot_btn" tool_tip="點按å³å¯åˆ·æ–°"/>
+ <button label="é è¦½" name="big_preview_btn" tool_tip="點按å³å¯åˆ‡æ›é è¦½"/>
+ <text name="title_label">
+ 標題:
+ </text>
+ <text name="description_label">
+ æè¿°ï¼š
+ </text>
+ <check_box initial_value="true" label="在æè¿°çµå°¾åŠ ä¸Šç¬¬äºŒäººç”Ÿçš„åœ°é»ž" name="add_location_cb"/>
+ <text name="tags_label">
+ 標籤:
+ </text>
+ <text name="tags_help_label">
+ ä¸åŒæ¨™ç±¤ä¹‹é–“以åŠå½¢ç©ºæ ¼åˆ†éš”
+標籤若å«ç©ºæ ¼ï¼Œç”¨ &quot;&quot; åŠå½¢ç¬¦è™Ÿæ‹¬ä½
+ </text>
+ <combo_box name="rating_combobox" tool_tip="Flickr 內容分級">
+ <combo_box.item label="安全級 Flickr 內容" name="SafeRating"/>
+ <combo_box.item label="é©ä¸­ç´š Flickr 內容" name="ModerateRating"/>
+ <combo_box.item label="é™åˆ¶ç´š Flickr 內容" name="RestrictedRating"/>
+ </combo_box>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="上傳" name="post_photo_btn"/>
+ <button label="å–æ¶ˆ" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_group_bulk_ban.xml b/indra/newview/skins/default/xui/zh/panel_group_bulk_ban.xml
new file mode 100644
index 0000000000..dedc900939
--- /dev/null
+++ b/indra/newview/skins/default/xui/zh/panel_group_bulk_ban.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel label="å°éŽ–å±…æ°‘" name="bulk_ban_panel">
+ <panel.string name="loading">
+ (載入中...)
+ </panel.string>
+ <panel.string name="ban_selection_too_large">
+ 未é€å‡ºç¾¤çµ„ç¦å…¥ä»¤ï¼šæ‰€é¸çš„居民人數太多。 群組ç¦å…¥ä»¤æ¯æ¬¡ä»¥ 100 人為上é™ã€‚
+ </panel.string>
+ <panel.string name="ban_not_permitted">
+ 群組ç¦å…¥ä»¤æœªé€å‡ºï¼šä½ æ²’有「管ç†ç¦å…¥æ¸…å–®ã€çš„能力。
+ </panel.string>
+ <panel.string name="ban_limit_fail">
+ 群組ç¦å…¥ä»¤æœªé€å‡ºï¼šä½ çš„群組已é”å…許ç¦å…¥æ•¸ç›®çš„上é™ã€‚
+ </panel.string>
+ <panel.string name="partial_ban">
+ 部分群組ç¦å…¥ä»¤æœªé€å‡ºï¼š
+[REASONS]
+ </panel.string>
+ <panel.string name="ban_failed">
+ 群組ç¦å…¥ä»¤æœªé€å‡ºï¼š
+[REASONS]
+ </panel.string>
+ <panel.string name="residents_already_banned">
+ - 以下居民之å‰å·²é­ç¦ï¼š[RESIDENTS]。
+ </panel.string>
+ <panel.string name="ban_limit_reached">
+ - å·²é”ç¦å…¥æ•¸ç›®ä¸Šé™ï¼Œä»¥ä¸‹ç”¨æˆ¶æœªèƒ½åŠ ç¦ï¼š[RESIDENTS]。
+ </panel.string>
+ <panel.string name="cant_ban_yourself">
+ - ä½ ä¸èƒ½æŠŠè‡ªå·±è¨­ç‚ºç¦å…¥ç¾¤çµ„。
+ </panel.string>
+ <text name="help_text">
+ ä½ å¯ä»¥é¸æ“‡æŠŠå¤šä½å±…民設為ç¦å…¥ç¾¤çµ„。 é»žæŒ‰ã€Œé–‹å•Ÿå±…æ°‘é¸æ“‡å·¥å…·ã€é–‹å§‹é¸æ“‡ã€‚
+ </text>
+ <button label="é–‹å•Ÿå±…æ°‘é¸æ“‡å·¥å…·" name="add_button"/>
+ <name_list name="banned_agent_list" tool_tip="按下 Ctrl éµåŒæ™‚點é¸å±…æ°‘çš„å字,å³å¯é¸å–多個人"/>
+ <button label="將所é¸çš„從å單移除" name="remove_button" tool_tip="å°‡ä¸Šé¢æ‰€é¸å±…民從ç¦å…¥å單中移除"/>
+ <button label="å°éŽ–å±…æ°‘" name="ban_button"/>
+ <button label="å–æ¶ˆ" name="cancel_button"/>
+ <string name="GroupBulkBan">
+ å°ç¾¤çµ„設ç¦
+ </string>
+</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/zh/panel_group_info_sidetray.xml
index f979a4c53e..43e3507961 100755
--- a/indra/newview/skins/default/xui/zh/panel_group_info_sidetray.xml
+++ b/indra/newview/skins/default/xui/zh/panel_group_info_sidetray.xml
@@ -20,7 +20,7 @@
<layout_panel name="group_accordions">
<accordion name="groups_accordion">
<accordion_tab name="group_general_tab" title="基本資料"/>
- <accordion_tab name="group_roles_tab" title="角色"/>
+ <accordion_tab name="group_roles_tab" title="角色與æˆå“¡"/>
<accordion_tab name="group_notices_tab" title="通知"/>
<accordion_tab name="group_land_tab" title="土地 / 資產"/>
</accordion>
diff --git a/indra/newview/skins/default/xui/zh/panel_group_invite.xml b/indra/newview/skins/default/xui/zh/panel_group_invite.xml
index 8921978b20..250bbaab6a 100755
--- a/indra/newview/skins/default/xui/zh/panel_group_invite.xml
+++ b/indra/newview/skins/default/xui/zh/panel_group_invite.xml
@@ -22,7 +22,7 @@
鏿“‡æŒ‡æ´¾çµ¦ä»–們的角色:
</text>
<combo_box name="role_name" tool_tip="å¾žè§’è‰²æ¸…å–®é¸æ“‡ä½ æœ‰æ¬ŠæŒ‡æ´¾çµ¦æˆå“¡çš„角色:"/>
- <button label="é€å‡ºé‚€è«‹" name="ok_button"/>
+ <button label="é€å‡ºé‚€è«‹" name="invite_button"/>
<button label="å–æ¶ˆ" name="cancel_button"/>
<string name="GroupInvitation">
群組邀請
diff --git a/indra/newview/skins/default/xui/zh/panel_group_roles.xml b/indra/newview/skins/default/xui/zh/panel_group_roles.xml
index 59086c3de2..b4b32c204a 100755
--- a/indra/newview/skins/default/xui/zh/panel_group_roles.xml
+++ b/indra/newview/skins/default/xui/zh/panel_group_roles.xml
@@ -21,15 +21,18 @@
<name_list.columns label="æˆå“¡" name="name"/>
<name_list.columns label="ææ¬¾" name="donated"/>
<name_list.columns label="狀態" name="online"/>
+ <name_list.columns label="頭銜" name="title"/>
</name_list>
<button label="邀請" name="member_invite"/>
<button label="踢出" name="member_eject"/>
+ <button label="ç¦çµ•æˆå“¡" name="member_ban"/>
</panel>
<panel label="角色" name="roles_sub_tab">
<panel.string name="help_text">
- 一個角色具備è·ç¨±å’Œè©²è§’色å¯ä½¿ç”¨çš„能力。
-䏀使ˆå“¡å¯æœ‰ä¸€åˆ°å¤šå€‹è§’色。
-ä¸€å€‹ç¾¤çµ„è‡³å¤šå¯æœ‰ 10 個角色,包括「任何人ã€å’Œã€Œæ‰€æœ‰äººã€ã€‚
+ 一個角色具備è·ç¨±å’Œè©²è§’色å¯ä½¿ç”¨çš„能力
+ å¯ä¾›æˆå“¡è¡Œä½¿ã€‚ æˆå“¡å¯ä»¥æ“”ä»»
+ 一或多個角色。 ä¸€å€‹ç¾¤çµ„æœ€å¤šå¯æœ‰ 10 個角色,
+ 包括「任何人ã€å’Œã€Œæ“有人ã€è§’色。
</panel.string>
<panel.string name="cant_delete_role">
「任何人ã€å’Œã€Œæ‰€æœ‰äººã€æ˜¯ç‰¹è¨­è§’色,ä¸å¾—刪除。
@@ -45,12 +48,27 @@
</panel>
<panel label="能力" name="actions_sub_tab" tool_tip="ä½ å¯å¯Ÿçœ‹é—œæ–¼æŸä¸€èƒ½åŠ›çš„èªªæ˜Žï¼Œä¸¦å¾—çŸ¥å“ªäº›è§’è‰²å’Œæˆå“¡æ“有該能力。">
<panel.string name="help_text">
- 「能力ã€å¯è®“群組的æˆå“¡é€éŽè§’è‰²è¡Œä½¿ä¸€å®šçš„è·æ¬Šã€‚
-能力的種類ç¹å¤šã€‚
+ 能力å¯è®“æˆå“¡åœ¨é€™å€‹ç¾¤çµ„裡é€éŽè§’色åš
+ 一定的事。 能力的種類ç¹å¤šã€‚
</panel.string>
<filter_editor label="èƒ½åŠ›éŽæ¿¾å™¨" name="filter_input"/>
<scroll_list name="action_list" tool_tip="è«‹é¸å–一個能力以察看詳情。"/>
</panel>
+ <panel label="é­ç¦çš„å±…æ°‘" name="banlist_sub_tab" tool_tip="檢視ç¦å…¥æœ¬ç¾¤çµ„的居民åå–®">
+ <panel.string name="help_text">
+ ç¦å…¥å單上的任何居民將無法加入此群組。
+ </panel.string>
+ <panel.string name="ban_count_template">
+ ç¦æ­¢æ•¸ç›®ï¼š [COUNT]/[LIMIT]
+ </panel.string>
+ <name_list name="ban_list">
+ <name_list.columns label="å±…æ°‘" name="name"/>
+ <name_list.columns label="é­ç¦æ—¥æœŸ" name="ban_date"/>
+ </name_list>
+ <button label="ç¦çµ•æˆå“¡" name="ban_create" tool_tip="ç¦æ­¢æˆå“¡åŠ å…¥ä½ çš„ç¾¤çµ„"/>
+ <button label="å–æ¶ˆç¦å…¥" name="ban_delete" tool_tip="å–æ¶ˆéƒ¨åˆ†æˆå“¡ç¦å…¥ä½ çš„群組"/>
+ <button name="ban_refresh" tool_tip="æ›´æ–°ç¦å…¥æ¸…å–®"/>
+ </panel>
</tab_container>
<panel name="members_footer">
<text name="static">
diff --git a/indra/newview/skins/default/xui/zh/panel_login.xml b/indra/newview/skins/default/xui/zh/panel_login.xml
index 672d9bb1a2..09a1af5cf8 100755
--- a/indra/newview/skins/default/xui/zh/panel_login.xml
+++ b/indra/newview/skins/default/xui/zh/panel_login.xml
@@ -1,46 +1,27 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml version="1.0" encoding="utf-8"?>
<panel name="panel_login">
<panel.string name="forgot_password_url">
http://secondlife.com/account/request.php
</panel.string>
- <layout_stack name="login_widgets">
- <layout_panel name="login">
- <text name="log_in_text">
- 登入
- </text>
- <text name="username_text">
- 使用者å稱:
- </text>
- <combo_box name="username_combo" tool_tip="使用者å稱是你註冊時所挑é¸çš„ï¼Œåƒæ˜¯ bobsmith12 或 Steller Sunshine"/>
- <text name="password_text">
- 密碼:
- </text>
- </layout_panel>
- <layout_panel name="start_location_panel">
- <text name="start_location_text">
- 開始地點:
- </text>
- <combo_box name="start_location_combo">
- <combo_box.item label="我上一次ä½ç½®" name="MyLastLocation"/>
- <combo_box.item label="我的家" name="MyHome"/>
- <combo_box.item label="&lt;請輸入地å€å稱&gt;" name="Typeregionname"/>
- </combo_box>
- </layout_panel>
- <layout_panel name="links_login_panel">
- <text name="login_help">
- 登入時需è¦å¹«åŠ©ï¼Ÿ
- </text>
+ <layout_stack name="ui_stack">
+ <layout_panel name="ui_container">
+ <combo_box label="使用者å稱" name="username_combo" tool_tip="使用者å稱是你註冊時所挑é¸çš„,例如 bobsmith12 或 Steller Sunshine"/>
+ <line_editor label="密碼" name="password_edit"/>
+ <check_box label="記得我" name="remember_check"/>
<text name="forgot_password_text">
- 忘記你的使用者å稱或密碼?
+ 忘記密碼
</text>
<button label="登入" name="connect_btn"/>
- <check_box label="記ä½å¯†ç¢¼ï¼š" name="remember_check"/>
- </layout_panel>
- <layout_panel name="links">
- <text name="create_account_text">
- 建立你的帳號
+ <text name="At_My_Last_Location_Label">
+ 到我上次去的地點
</text>
- <button label="ç¾åœ¨å°±é–‹å§‹" name="create_new_account_btn"/>
+ <combo_box label="我的最愛" name="start_location_combo">
+ <combo_box.item label="我的家" name="MyHome"/>
+ </combo_box>
+ <button label="登入" name="connect_favorite_btn"/>
+ <line_editor label="éµå…¥ä¸€å€‹åœ°é»ž" name="location_edit"/>
+ <button label="登入" name="connect_location_btn"/>
+ <combo_box label="鏿“‡æ¨¡æ“¬ä¸–界" name="server_combo"/>
</layout_panel>
</layout_stack>
</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_login_first.xml b/indra/newview/skins/default/xui/zh/panel_login_first.xml
new file mode 100644
index 0000000000..a8af615b7c
--- /dev/null
+++ b/indra/newview/skins/default/xui/zh/panel_login_first.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_login">
+ <panel.string name="forgot_password_url">
+ http://secondlife.com/account/request.php
+ </panel.string>
+ <layout_stack name="logo_stack">
+ <layout_panel name="parent_panel2">
+ <layout_stack name="widget_stack">
+ <layout_panel name="widget_container">
+ <combo_box label="使用者å稱" name="username_combo" tool_tip="使用者å稱是你註冊時所挑é¸çš„,例如 bobsmith12 或 Steller Sunshine"/>
+ <line_editor label="密碼" name="password_edit"/>
+ <button label="登入" name="connect_btn"/>
+ <check_box label="記得我" name="remember_check"/>
+ <text name="forgot_password_text">
+ 忘記密碼
+ </text>
+ </layout_panel>
+ </layout_stack>
+ </layout_panel>
+ <layout_panel name="parent_panel3">
+ <layout_stack name="images_stack">
+ <layout_panel name="images_container">
+ <text name="image_caption_left">
+ 你在「學習島ã€çš„第一步。 找到離開的傳é€é–€ï¼
+ </text>
+ <text name="image_caption_right">
+ æŽ¥è‘—ï¼Œåˆ°ã€Œç¤¾äº¤å³¶ã€æŽ¢ç´¢ï¼Œèªè­˜æ–°çš„居民朋å‹ï¼
+ </text>
+ </layout_panel>
+ </layout_stack>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/zh/panel_preferences_advanced.xml
index 3a7d79e04b..170cdddb8c 100755
--- a/indra/newview/skins/default/xui/zh/panel_preferences_advanced.xml
+++ b/indra/newview/skins/default/xui/zh/panel_preferences_advanced.xml
@@ -28,4 +28,5 @@
<check_box label="ç™»å…¥æ™‚é¡¯ç¤ºç¶²æ ¼é¸æ“‡" name="show_grid_selection_check"/>
<check_box label="顯示進階é¸å–®" name="show_advanced_menu_check"/>
<check_box label="顯示開發é¸å–®" name="show_develop_menu_check"/>
+ <button label="é è¨­çš„創建權é™" name="default_creation_permissions"/>
</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_preferences_general.xml b/indra/newview/skins/default/xui/zh/panel_preferences_general.xml
index 044edbed70..20335d82ae 100755
--- a/indra/newview/skins/default/xui/zh/panel_preferences_general.xml
+++ b/indra/newview/skins/default/xui/zh/panel_preferences_general.xml
@@ -29,14 +29,10 @@
<combo_box.item label="一般普級與é©åº¦æˆäºº" name="Desired_Mature"/>
<combo_box.item label="一般普級" name="Desired_PG"/>
</combo_box>
- <text name="start_location_textbox">
- é–‹å§‹ä½ç½®ï¼š
+ <check_box label="登入時顯示最愛的地點" name="favorites_on_login_check"/>
+ <text name="favorites_check_extra_text">
+ (使用此電腦的其他人也會看到)
</text>
- <combo_box name="start_location_combo">
- <combo_box.item label="我上一次ä½ç½®" name="MyLastLocation"/>
- <combo_box.item label="我的家" name="MyHome"/>
- </combo_box>
- <check_box initial_value="true" label="登入時顯示" name="show_location_checkbox"/>
<text name="name_tags_textbox">
å稱標籤:
</text>
diff --git a/indra/newview/skins/default/xui/zh/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/zh/panel_preferences_privacy.xml
index 07fdfd87e3..aa2486e988 100755
--- a/indra/newview/skins/default/xui/zh/panel_preferences_privacy.xml
+++ b/indra/newview/skins/default/xui/zh/panel_preferences_privacy.xml
@@ -7,7 +7,7 @@
<text name="cache_size_label_l">
(ä½ç½®ã€åœ–åƒã€ç¶²é ã€æœå°‹çš„æ­·å²ç´€éŒ„)
</text>
- <check_box label="將我顯示在æœå°‹çš„çµæžœä¸­" name="online_searchresults"/>
+ <check_box label="å°‡æˆ‘çš„å€‹äººå°æª”案顯示在æœå°‹çµæžœä¸­" name="online_searchresults"/>
<check_box label="åªæœ‰æˆ‘的朋å‹å’Œç¾¤çµ„çŸ¥é“æˆ‘上線" name="online_visibility"/>
<check_box label="åªæœ‰æˆ‘的朋å‹å’Œç¾¤çµ„å¯ä»¥ IM 或與我通話。" name="voice_call_friends_only_check"/>
<check_box label="ç•¶é€šè©±çµæŸæ™‚關閉麥克風" name="auto_disengage_mic_check"/>
diff --git a/indra/newview/skins/default/xui/zh/panel_region_debug.xml b/indra/newview/skins/default/xui/zh/panel_region_debug.xml
index e5d5e6eaf7..0bb59a7b14 100755
--- a/indra/newview/skins/default/xui/zh/panel_region_debug.xml
+++ b/indra/newview/skins/default/xui/zh/panel_region_debug.xml
@@ -28,7 +28,8 @@
<check_box label="於這個領地內的æ¯ä¸€å€‹åœ°å€" name="return_estate_wide" tool_tip="退回這個領地內全部地å€ä¸­æ¨™è¨˜ç‚ºä»–的物件"/>
<button label="退回" name="return_btn"/>
<button label="å–得最常碰撞的物件..." name="top_colliders_btn" tool_tip="æ¢åˆ—出目å‰é‹ä½œä¸­æœ€å¸¸ç¢°æ’žçš„物件清單"/>
- <button label="å–得最耗能腳本..." name="top_scripts_btn" tool_tip="æ¢åˆ—���目å‰é‹ä½œä¸­æœ€è€—能的腳本清單"/>
<button label="地å€é‡æ–°å•Ÿå‹•" name="restart_btn" tool_tip="給予兩分é˜å€’æ•¸è¨ˆæ™‚ä¸¦é‡æ–°å•Ÿå‹•"/>
+ <button label="å–得最耗能腳本..." name="top_scripts_btn" tool_tip="æ¢åˆ—���目å‰é‹ä½œä¸­æœ€è€—能的腳本清單"/>
<button label="å–æ¶ˆé‡æ–°å•Ÿå‹•" name="cancel_restart_btn" tool_tip="å–æ¶ˆåœ°å€é‡æ–°å•Ÿå‹•"/>
+ <button label="地å€é™¤éŒ¯æŽ§åˆ¶å°" name="region_debug_console_btn" tool_tip="開啟地å€é™¤éŒ¯æŽ§åˆ¶å°"/>
</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_region_general.xml b/indra/newview/skins/default/xui/zh/panel_region_general.xml
index f6b2c46354..0ce3b659b2 100755
--- a/indra/newview/skins/default/xui/zh/panel_region_general.xml
+++ b/indra/newview/skins/default/xui/zh/panel_region_general.xml
@@ -20,12 +20,12 @@
</text>
<check_box label="阻止土地變形" name="block_terraform_check"/>
<check_box label="阻止飛行" name="block_fly_check"/>
+ <check_box label="ç¦æ­¢é£›è¶Šåœ°æ®µ" name="block_fly_over_check" tool_tip="å°‡å‡ºå…¥ç®¡åˆ¶å¾€ä¸Šç©ºæ“´å¤§ï¼Œä¸€ä½µç¦æ­¢é£›è¶Šåœ°æ®µ"/>
<check_box label="å…許傷害" name="allow_damage_check"/>
<check_box label="é™åˆ¶æŽ¨æ’ž" name="restrict_pushobject"/>
<check_box label="å…許土地轉售" name="allow_land_resell_check"/>
<check_box label="å…許土地 åˆä½µ/分割" name="allow_parcel_changes_check"/>
<check_box label="阻擋土地顯示於æœå°‹ä¸­" name="block_parcel_search_check" tool_tip="讓其他人å¯ä»¥åœ¨æœå°‹çµæžœä¸­çœ‹åˆ°é€™å€‹åœ°å€èˆ‡å…¶ä¸­çš„地段"/>
- <check_box label="å…許網é¢ç‰©ä»¶" name="mesh_rez_enabled_check" tool_tip="å…許大家在此地å€ç”¢ç”Ÿç¶²é¢ç‰©ä»¶"/>
<spinner label="人數上é™" name="agent_limit_spin"/>
<spinner label="物件紅利" name="object_bonus_spin"/>
<text label="分級" name="access_text">
diff --git a/indra/newview/skins/default/xui/zh/panel_script_ed.xml b/indra/newview/skins/default/xui/zh/panel_script_ed.xml
index 198e59be7b..c64982b397 100755
--- a/indra/newview/skins/default/xui/zh/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/zh/panel_script_ed.xml
@@ -24,6 +24,7 @@
<menu_item_call label="還原全部變更" name="Revert All Changes"/>
<menu_item_call label="從檔案載入…" name="LoadFromFile"/>
<menu_item_call label="存入檔案…" name="SaveToFile"/>
+ <menu_item_call label="é¡è‰²â€¦" name="Colors"/>
</menu>
<menu label="編輯" name="Edit">
<menu_item_call label="復原" name="Undo"/>
@@ -41,9 +42,9 @@
<menu_item_call label="é—œéµå­—幫助..." name="Keyword Help..."/>
</menu>
</menu_bar>
- <text_editor name="Script Editor">
+ <script_editor name="Script Editor">
載入中...
- </text_editor>
+ </script_editor>
<combo_box label="æ’å…¥..." name="Insert..."/>
<button label="儲存" label_selected="儲存" name="Save_btn"/>
<button label="編輯..." name="Edit_btn"/>
diff --git a/indra/newview/skins/default/xui/zh/panel_snapshot_options.xml b/indra/newview/skins/default/xui/zh/panel_snapshot_options.xml
index 82c2b10d8d..43d7280373 100755
--- a/indra/newview/skins/default/xui/zh/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/zh/panel_snapshot_options.xml
@@ -4,4 +4,13 @@
<button label="電郵" name="save_to_email_btn"/>
<button label="儲存到我的收ç´å€ï¼ˆL$[AMOUNT])" name="save_to_inventory_btn"/>
<button label="儲存到電腦上" name="save_to_computer_btn"/>
+ <text name="send_to_facebook_textbox">
+ [secondlife:/// 臉書(Facebook)]
+ </text>
+ <text name="send_to_twitter_textbox">
+ [secondlife:/// 推特(Twitter)]
+ </text>
+ <text name="send_to_flickr_textbox">
+ [secondlife:/// Flickr]
+ </text>
</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_teleport_history_item.xml b/indra/newview/skins/default/xui/zh/panel_teleport_history_item.xml
index c251994906..93c02900e2 100755
--- a/indra/newview/skins/default/xui/zh/panel_teleport_history_item.xml
+++ b/indra/newview/skins/default/xui/zh/panel_teleport_history_item.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="teleport_history_item">
<text name="region" value="..."/>
+ <text name="timestamp" value="..."/>
<button name="profile_btn" tool_tip="顯示物å“資訊"/>
</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_twitter_account.xml b/indra/newview/skins/default/xui/zh/panel_twitter_account.xml
new file mode 100644
index 0000000000..a8b57d7453
--- /dev/null
+++ b/indra/newview/skins/default/xui/zh/panel_twitter_account.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_twitter_account">
+ <string name="twitter_connected" value="ä½ å·²æˆåŠŸé€£é€šæŽ¨ç‰¹ï¼Œèº«åˆ†ç‚ºï¼š"/>
+ <string name="twitter_disconnected" value="尚未連通推特。"/>
+ <text name="account_caption_label">
+ 尚未連通推特。
+ </text>
+ <panel name="panel_buttons">
+ <button label="連通…" name="connect_btn"/>
+ <button label="中斷" name="disconnect_btn"/>
+ <text name="account_learn_more_label">
+ [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share/ta-p/2435453 瞭解如何發佈到推特]
+ </text>
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/zh/panel_twitter_photo.xml b/indra/newview/skins/default/xui/zh/panel_twitter_photo.xml
new file mode 100644
index 0000000000..d015f4aa95
--- /dev/null
+++ b/indra/newview/skins/default/xui/zh/panel_twitter_photo.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<panel name="panel_twitter_photo">
+ <layout_stack name="stack_photo">
+ <layout_panel name="text_panel">
+ <text name="status_label">
+ 說一說你正在åšä»€éº¼
+ </text>
+ <text name="status_counter_label">
+ 140
+ </text>
+ <check_box initial_value="true" label="加入所在ä½ç½®" name="add_location_cb"/>
+ <check_box initial_value="true" label="附上照片" name="add_photo_cb"/>
+ </layout_panel>
+ <layout_panel name="snapshot_panel">
+ <combo_box name="resolution_combobox" tool_tip="圖åƒè§£æžåº¦">
+ <combo_box.item label="ç›®å‰è¦–窗" name="CurrentWindow"/>
+ <combo_box.item label="640x480" name="640x480"/>
+ <combo_box.item label="800x600" name="800x600"/>
+ <combo_box.item label="1024x768" name="1024x768"/>
+ </combo_box>
+ <combo_box name="filters_combobox" tool_tip="åœ–åƒæ¿¾é¡">
+ <combo_box.item label="ä¸ç”¨æ¿¾é¡" name="NoFilter"/>
+ </combo_box>
+ <button label="刷新" name="new_snapshot_btn" tool_tip="點按å³å¯åˆ·æ–°"/>
+ <button label="é è¦½" name="big_preview_btn" tool_tip="點按å³å¯åˆ‡æ›é è¦½"/>
+ </layout_panel>
+ <layout_panel name="photo_button_panel">
+ <button label="發到推特" name="post_photo_btn"/>
+ <button label="å–æ¶ˆ" name="cancel_photo_btn"/>
+ </layout_panel>
+ </layout_stack>
+</panel>
diff --git a/indra/newview/skins/default/xui/zh/role_actions.xml b/indra/newview/skins/default/xui/zh/role_actions.xml
index 9587981444..96f931f73f 100755
--- a/indra/newview/skins/default/xui/zh/role_actions.xml
+++ b/indra/newview/skins/default/xui/zh/role_actions.xml
@@ -3,6 +3,7 @@
<action_set description="這些能力包括新增或移除群組æˆå“¡å’Œå…許新æˆå“¡ä¸å—é‚€å³å¯åŠ å…¥ç¾¤çµ„çš„ç­‰æ¬ŠåŠ›ã€‚" name="Membership">
<action description="邀請他人加入這個群組" longdescription="欲邀請他人加入這個群組,請按下角色欄下的æˆå“¡é ç±¤ä¸­çš„ã€Œé‚€è«‹ã€æŒ‰éˆ•。" name="member invite" value="1"/>
<action description="將會員由這個群組中踢出" longdescription="欲將æˆå“¡å¾žç¾¤çµ„踢出,請按下角色欄下的æˆå“¡é ç±¤ä¸­çš„ã€Œè¸¢å‡ºã€æŒ‰éˆ•。 所有人å¯è¸¢å‡ºä»»ä½•ä¸å…·æ‰€æœ‰äººè§’色的人。 å¦‚æžœä½ ä¸æ˜¯æ‰€æœ‰äººï¼Œä¸€ä½æˆå“¡åªåœ¨ä»–僅屬於「任何人ã€è§’色且沒有其他角色的情æ³ä¸‹è¢«è¸¢å‡ºç¾¤çµ„。 欲å¸é™¤æˆå“¡çš„角色,你必須有「å¸é™¤æˆå“¡è§’色ã€çš„能力。" name="member eject" value="2"/>
+ <action description="管ç†ç¦å…¥æ¸…å–®" longdescription="å…許群組æˆå“¡æŽ§åˆ¶æ˜¯å¦ç¦æ­¢æˆ–釿–°å…許居民加入這個群組。" name="allow ban" value="51"/>
<action description="切æ›ã€Œå…費自由加入ã€è¨­å®šï¼Œæ›´æ”¹ã€ŒåŠ å…¥è²»ã€ã€‚" longdescription="切æ›ã€Œå…費自由加入ã€è¨­å®šï¼Œè®“æˆå“¡ä¸å—邀也å¯åŠ å…¥ï¼Œä¸¦åœ¨åŸºæœ¬è¨­å®šæ¬„æ›´æ”¹ã€ŒåŠ å…¥è²»ã€ã€‚" name="member options" value="3"/>
</action_set>
<action_set description="這些能力包括新增ã€ç§»é™¤ã€æ›´æ”¹ç¾¤çµ„角色,新增或移除æˆå“¡çš„角色,和為角色設定能力等權力。" name="Roles">
diff --git a/indra/newview/skins/default/xui/zh/sidepanel_inventory.xml b/indra/newview/skins/default/xui/zh/sidepanel_inventory.xml
index c8aae15011..54ea7cab22 100755
--- a/indra/newview/skins/default/xui/zh/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/zh/sidepanel_inventory.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel label="事物" name="objects panel">
- <panel label="" name="sidepanel__inventory_panel">
+ <panel label="" name="sidepanel_inventory_panel">
<layout_stack name="inventory_layout_stack">
<layout_panel name="inbox_layout_panel">
<panel label="" name="marketplace_inbox">
@@ -25,15 +25,15 @@
<panel name="button_panel">
<layout_stack name="button_panel_ls">
<layout_panel name="info_btn_lp">
- <button label="檔案" name="info_btn" tool_tip="顯示物件檔案"/>
+ <button label="檔案" name="info_btn" tool_tip="顯示物件簡介"/>
</layout_panel>
<layout_panel name="share_btn_lp">
<button label="分享" name="share_btn" tool_tip="分享一個收ç´å€ç‰©å“"/>
</layout_panel>
<layout_panel name="shop_btn_lp">
- <button label="購物" name="shop_btn" tool_tip="開啟 Marketplace 購物市集網é "/>
+ <button label="購物" name="shop_btn" tool_tip="開啟購物市集網é "/>
<button label="穿上" name="wear_btn" tool_tip="ç©¿ä¸Šæ‰€é¸æ“‡çš„è£æ‰®"/>
- <button label="播放" name="play_btn"/>
+ <button label="éŠæˆ²" name="play_btn"/>
<button label="瞬間傳é€" name="teleport_btn" tool_tip="瞬間傳é€åˆ°æ‰€é¸çš„å€åŸŸ"/>
</layout_panel>
</layout_stack>
diff --git a/indra/newview/skins/default/xui/zh/strings.xml b/indra/newview/skins/default/xui/zh/strings.xml
index d9fa105ef4..ad2c331ee4 100755
--- a/indra/newview/skins/default/xui/zh/strings.xml
+++ b/indra/newview/skins/default/xui/zh/strings.xml
@@ -37,6 +37,45 @@
<string name="StartupRequireDriverUpdate">
顯åƒåˆå§‹åŒ–失敗。 請更新你的顯åƒå¡é©…動程å¼ï¼
</string>
+ <string name="AboutHeader">
+ [APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2] ([VIEWER_VERSION_3]) [BUILD_DATE] [BUILD_TIME] ([CHANNEL])
+[[VIEWER_RELEASE_NOTES_URL] [ReleaseNotes]]
+ </string>
+ <string name="AboutCompiler">
+ 以 [COMPILER_VERSION] 版本 [COMPILER] 建置
+ </string>
+ <string name="AboutPosition">
+ ä½ çš„æ–¹ä½æ˜¯ [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_LOCAL_2,number,1],地å€å:[REGION],主機:&lt;nolink&gt;[HOSTNAME]&lt;/nolink&gt; ([HOSTIP])
+第二人生URL:&lt;nolink&gt;[SLURL]&lt;/nolink&gt;
+ï¼ˆå…¨åŸŸåæ¨™ï¼š[POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1])
+[SERVER_VERSION]
+[SERVER_RELEASE_NOTES_URL]
+ </string>
+ <string name="AboutSystem">
+ CPU:[CPU]
+記憶體:[MEMORY_MB] MB
+作業系統版本:[OS_VERSION]
+顯示å¡ä¾›æ‡‰å•†ï¼š[GRAPHICS_CARD_VENDOR]
+顯示å¡ï¼š[GRAPHICS_CARD]
+ </string>
+ <string name="AboutDriver">
+ Windows 顯示驅動程å¼ç‰ˆæœ¬ï¼š[GRAPHICS_DRIVER_VERSION]
+ </string>
+ <string name="AboutLibs">
+ OpenGL 版本:[OPENGL_VERSION]
+
+libcurl 版本: [LIBCURL_VERSION]
+J2C 解碼器版本: [J2C_VERSION]
+音效驅動程å¼ç‰ˆæœ¬ï¼š [AUDIO_DRIVER_VERSION]
+Qt Webkit 版本: [QT_WEBKIT_VERSION]
+語音伺æœå™¨ç‰ˆæœ¬ï¼š [VOICE_VERSION]
+ </string>
+ <string name="AboutTraffic">
+ å°åŒ…丟失:[PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number,1]%)
+ </string>
+ <string name="ErrorFetchingServerReleaseNotesURL">
+ æ“·å–伺æœå™¨ç‰ˆæœ¬èªªæ˜Ž URL 時出錯。
+ </string>
<string name="ProgressRestoring">
回存中...
</string>
@@ -291,6 +330,75 @@ http://secondlife.com/viewer-access-faq
<string name="TestingDisconnect">
測試ç€è¦½å™¨æ–·ç·š
</string>
+ <string name="SocialFlickrConnecting">
+ 連通 Flickr 中…
+ </string>
+ <string name="SocialFlickrPosting">
+ 發佈中…
+ </string>
+ <string name="SocialFlickrDisconnecting">
+ Flickr 連通中斷中…
+ </string>
+ <string name="SocialFlickrErrorConnecting">
+ 連通臉書時出å•題
+ </string>
+ <string name="SocialFlickrErrorPosting">
+ 發佈到 Flickr 時出å•題
+ </string>
+ <string name="SocialFlickrErrorDisconnecting">
+ 試圖中斷 Flickr 連通時出å•題
+ </string>
+ <string name="SocialTwitterConnecting">
+ 連通推特中…
+ </string>
+ <string name="SocialTwitterPosting">
+ 發佈中…
+ </string>
+ <string name="SocialTwitterDisconnecting">
+ 推特連通中斷中…
+ </string>
+ <string name="SocialTwitterErrorConnecting">
+ 連通推特時出å•題
+ </string>
+ <string name="SocialTwitterErrorPosting">
+ 發佈到推特時出å•題
+ </string>
+ <string name="SocialTwitterErrorDisconnecting">
+ 試圖中斷推特連通時出å•題
+ </string>
+ <string name="BlackAndWhite">
+ 黑白
+ </string>
+ <string name="Colors1970">
+ 1970年代色調
+ </string>
+ <string name="Intense">
+ 強烈感
+ </string>
+ <string name="Newspaper">
+ 黑白報紙
+ </string>
+ <string name="Sepia">
+ 懷舊
+ </string>
+ <string name="Spotlight">
+ èšå…‰ç„¦é»ž
+ </string>
+ <string name="Video">
+ 舊影片
+ </string>
+ <string name="Autocontrast">
+ è‡ªå‹•å°æ¯”
+ </string>
+ <string name="LensFlare">
+ 光暈
+ </string>
+ <string name="Miniature">
+ å°æ¨¡åž‹ç§»è»¸ç‰¹æ•ˆ
+ </string>
+ <string name="Toycamera">
+ 玩具相機
+ </string>
<string name="TooltipPerson">
人
</string>
@@ -839,6 +947,12 @@ http://secondlife.com/viewer-access-faq
<string name="use_texture">
使用æè³ª
</string>
+ <string name="manip_hint1">
+ 把滑鼠游標移到é‡å°ºä¸Š
+ </string>
+ <string name="manip_hint2">
+ å°±å¯è²¼é½Šæ ¼ç·š
+ </string>
<string name="texture_loading">
載入中...
</string>
@@ -929,15 +1043,15 @@ http://secondlife.com/viewer-access-faq
<string name="ControlYourCamera">
控制你的æ”影機
</string>
+ <string name="TeleportYourAgent">
+ 瞬間傳é€ä½ æœ¬äºº
+ </string>
<string name="NotConnected">
æœªè¯æŽ¥
</string>
<string name="AgentNameSubst">
(你)
</string>
- <string name="TeleportYourAgent">
- 瞬間傳é€ä½ æœ¬äºº
- </string>
<string name="JoinAnExperience">
加入體驗
</string>
@@ -1291,6 +1405,18 @@ http://secondlife.com/viewer-access-faq
<string name="InventoryOutboxNoItems">
將資料夾拖曳到這個å€åŸŸï¼Œå†é»žæŒ‰ã€Œé€å¾€ç¬¬äºŒäººç”Ÿè³¼ç‰©å¸‚集ã€ï¼Œå³å¯åœ¨[[MARKETPLACE_DASHBOARD_URL]第二人生購物市集]登列出售。
</string>
+ <string name="InventoryOutboxInitializingTitle">
+ 正在åˆå§‹åŒ–購物市集。
+ </string>
+ <string name="InventoryOutboxInitializing">
+ 我們正在求å–ä½ çš„[[MARKETPLACE_CREATE_STORE_URL] 購物市集商店]帳戶。
+ </string>
+ <string name="InventoryOutboxErrorTitle">
+ 購物市集出錯。
+ </string>
+ <string name="InventoryOutboxError">
+ [[MARKETPLACE_CREATE_STORE_URL] 購物市集商店]正傳回錯誤。
+ </string>
<string name="Marketplace Error None">
零錯誤
</string>
@@ -1318,6 +1444,9 @@ http://secondlife.com/viewer-access-faq
<string name="Open landmarks">
開啟地標
</string>
+ <string name="Unconstrained">
+ ä¸å—é™
+ </string>
<string name="no_transfer" value="ï¼ˆç¦æ­¢è½‰è®“)"/>
<string name="no_modify" value="ï¼ˆç¦æ­¢ä¿®æ”¹ï¼‰"/>
<string name="no_copy" value="ï¼ˆç¦æ­¢è¤‡è£½ï¼‰"/>
@@ -1718,6 +1847,9 @@ http://secondlife.com/viewer-access-faq
<string name="CompileQueueDownloadedCompiling">
已下載,正在編譯中
</string>
+ <string name="CompileQueueServiceUnavailable">
+ 腳本編譯æœå‹™ç„¡æ³•使用
+ </string>
<string name="CompileQueueScriptNotFound">
伺æœå™¨ä¸Šæœªç™¼ç¾è…³æœ¬ã€‚
</string>
@@ -4018,6 +4150,12 @@ http://secondlife.com/viewer-access-faq
<string name="share_alert">
將收ç´å€ç‰©å“拖曳到這裡
</string>
+ <string name="flickr_post_success">
+ æˆåŠŸç™¼ä½ˆåˆ° Flickr。
+ </string>
+ <string name="twitter_post_success">
+ å·²æˆåŠŸç™¼ä½ˆåˆ°æŽ¨ç‰¹ã€‚
+ </string>
<string name="no_session_message">
(IM 會話ä¸å­˜åœ¨ï¼‰
</string>
@@ -4474,6 +4612,9 @@ http://secondlife.com/viewer-access-faq
<string name="LocalEstimateUSD">
$ [AMOUNT] 美元
</string>
+ <string name="Group Ban">
+ å°ç¾¤çµ„設ç¦
+ </string>
<string name="Membership">
æˆå“¡è³‡æ ¼
</string>
@@ -4908,6 +5049,12 @@ http://secondlife.com/viewer-access-faq
<string name="Command_Destinations_Label">
目的地
</string>
+ <string name="Command_Facebook_Label">
+ 臉書
+ </string>
+ <string name="Command_Flickr_Label">
+ Flickr
+ </string>
<string name="Command_Gestures_Label">
å§¿å‹¢
</string>
@@ -4956,6 +5103,9 @@ http://secondlife.com/viewer-access-faq
<string name="Command_Speak_Label">
說話
</string>
+ <string name="Command_Twitter_Label">
+ 推特
+ </string>
<string name="Command_View_Label">
æ”影機控制
</string>
@@ -4986,6 +5136,12 @@ http://secondlife.com/viewer-access-faq
<string name="Command_Destinations_Tooltip">
ä½ å¯èƒ½æ„Ÿèˆˆè¶£çš„目的地
</string>
+ <string name="Command_Facebook_Tooltip">
+ 發佈到臉書
+ </string>
+ <string name="Command_Flickr_Tooltip">
+ 上傳到 Flickr
+ </string>
<string name="Command_Gestures_Tooltip">
你化身å¯ç”¨çš„å§¿å‹¢
</string>
@@ -5034,6 +5190,9 @@ http://secondlife.com/viewer-access-faq
<string name="Command_Speak_Tooltip">
用麥克風和附近人們交談
</string>
+ <string name="Command_Twitter_Tooltip">
+ 推特
+ </string>
<string name="Command_View_Tooltip">
調整æ”影機角度
</string>
diff --git a/indra/newview/tests/llcapabilitylistener_test.cpp b/indra/newview/tests/llcapabilitylistener_test.cpp
index e1cbd28f92..bde991a01e 100755
--- a/indra/newview/tests/llcapabilitylistener_test.cpp
+++ b/indra/newview/tests/llcapabilitylistener_test.cpp
@@ -134,10 +134,10 @@ namespace tut
std::string threw;
try
{
- WrapLL_ERRS capture;
+ WrapLLErrs capture;
regionPump.post(request);
}
- catch (const WrapLL_ERRS::FatalException& e)
+ catch (const WrapLLErrs::FatalException& e)
{
threw = e.what();
}
@@ -181,10 +181,10 @@ namespace tut
std::string threw;
try
{
- WrapLL_ERRS capture;
+ WrapLLErrs capture;
regionPump.post(request);
}
- catch (const WrapLL_ERRS::FatalException& e)
+ catch (const WrapLLErrs::FatalException& e)
{
threw = e.what();
}
@@ -243,10 +243,10 @@ namespace tut
std::string threw;
try
{
- WrapLL_ERRS capture;
+ WrapLLErrs capture;
regionPump.post(request);
}
- catch (const WrapLL_ERRS::FatalException& e)
+ catch (const WrapLLErrs::FatalException& e)
{
threw = e.what();
}
diff --git a/indra/newview/tests/llhttpretrypolicy_test.cpp b/indra/newview/tests/llhttpretrypolicy_test.cpp
new file mode 100755
index 0000000000..25e6de46d9
--- /dev/null
+++ b/indra/newview/tests/llhttpretrypolicy_test.cpp
@@ -0,0 +1,328 @@
+/**
+ * @file llhttpretrypolicy_test.cpp
+ * @brief Header tests to exercise the LLHTTPRetryPolicy classes.
+ *
+ * $LicenseInfo:firstyear=2013&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2013, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "../llviewerprecompiledheaders.h"
+#include "../llhttpretrypolicy.h"
+#include "lltut.h"
+
+namespace tut
+{
+struct TestData
+{
+};
+
+typedef test_group<TestData> RetryPolicyTestGroup;
+typedef RetryPolicyTestGroup::object RetryPolicyTestObject;
+RetryPolicyTestGroup retryPolicyTestGroup("retry_policy");
+
+template<> template<>
+void RetryPolicyTestObject::test<1>()
+{
+ LLAdaptiveRetryPolicy never_retry(1.0,1.0,1.0,0);
+ LLSD headers;
+ F32 wait_seconds;
+
+ // No retry until we've failed a try.
+ ensure("never retry 0", !never_retry.shouldRetry(wait_seconds));
+
+ // 0 retries max.
+ never_retry.onFailure(500,headers);
+ ensure("never retry 1", !never_retry.shouldRetry(wait_seconds));
+}
+
+template<> template<>
+void RetryPolicyTestObject::test<2>()
+{
+ LLSD headers;
+ F32 wait_seconds;
+
+ // Normally only retry on server error (5xx)
+ LLAdaptiveRetryPolicy noRetry404(1.0,2.0,3.0,10);
+ noRetry404.onFailure(404,headers);
+ ensure("no retry on 404", !noRetry404.shouldRetry(wait_seconds));
+
+ // Can retry on 4xx errors if enabled by flag.
+ bool do_retry_4xx = true;
+ LLAdaptiveRetryPolicy doRetry404(1.0,2.0,3.0,10,do_retry_4xx);
+ doRetry404.onFailure(404,headers);
+ ensure("do retry on 404", doRetry404.shouldRetry(wait_seconds));
+}
+
+template<> template<>
+void RetryPolicyTestObject::test<3>()
+{
+ // Should retry after 1.0, 2.0, 3.0, 3.0 seconds.
+ LLAdaptiveRetryPolicy basic_retry(1.0,3.0,2.0,4);
+ LLSD headers;
+ F32 wait_seconds;
+ bool should_retry;
+ U32 frac_bits = 6;
+
+ // No retry until we've failed a try.
+ ensure("basic_retry 0", !basic_retry.shouldRetry(wait_seconds));
+
+ // Starting wait 1.0
+ basic_retry.onFailure(500,headers);
+ should_retry = basic_retry.shouldRetry(wait_seconds);
+ ensure("basic_retry 1", should_retry);
+ ensure_approximately_equals("basic_retry 1", wait_seconds, 1.0F, frac_bits);
+
+ // Double wait to 2.0
+ basic_retry.onFailure(500,headers);
+ should_retry = basic_retry.shouldRetry(wait_seconds);
+ ensure("basic_retry 2", should_retry);
+ ensure_approximately_equals("basic_retry 2", wait_seconds, 2.0F, frac_bits);
+
+ // Hit max wait of 3.0 (4.0 clamped to max 3)
+ basic_retry.onFailure(500,headers);
+ should_retry = basic_retry.shouldRetry(wait_seconds);
+ ensure("basic_retry 3", should_retry);
+ ensure_approximately_equals("basic_retry 3", wait_seconds, 3.0F, frac_bits);
+
+ // At max wait, should stay at 3.0
+ basic_retry.onFailure(500,headers);
+ should_retry = basic_retry.shouldRetry(wait_seconds);
+ ensure("basic_retry 4", should_retry);
+ ensure_approximately_equals("basic_retry 4", wait_seconds, 3.0F, frac_bits);
+
+ // Max retries, should fail now.
+ basic_retry.onFailure(500,headers);
+ should_retry = basic_retry.shouldRetry(wait_seconds);
+ ensure("basic_retry 5", !should_retry);
+
+ // Max retries, should fail now.
+ basic_retry.onFailure(500,headers);
+ should_retry = basic_retry.shouldRetry(wait_seconds);
+ ensure("basic_retry 5", !should_retry);
+
+ // After a success, should reset to the starting state.
+ basic_retry.onSuccess();
+
+ // No retry until we've failed a try.
+ ensure("basic_retry 6", !basic_retry.shouldRetry(wait_seconds));
+
+ // Starting wait 1.0
+ basic_retry.onFailure(500,headers);
+ should_retry = basic_retry.shouldRetry(wait_seconds);
+ ensure("basic_retry 7", should_retry);
+ ensure_approximately_equals("basic_retry 7", wait_seconds, 1.0F, frac_bits);
+
+ // Double wait to 2.0
+ basic_retry.onFailure(500,headers);
+ should_retry = basic_retry.shouldRetry(wait_seconds);
+ ensure("basic_retry 8", should_retry);
+ ensure_approximately_equals("basic_retry 8", wait_seconds, 2.0F, frac_bits);
+}
+
+// Retries should stop as soon as a non-5xx error is received.
+template<> template<>
+void RetryPolicyTestObject::test<4>()
+{
+ // Should retry after 1.0, 2.0, 3.0, 3.0 seconds.
+ LLAdaptiveRetryPolicy killer404(1.0,3.0,2.0,4);
+ LLSD headers;
+ F32 wait_seconds;
+ bool should_retry;
+ U32 frac_bits = 6;
+
+ // Starting wait 1.0
+ killer404.onFailure(500,headers);
+ should_retry = killer404.shouldRetry(wait_seconds);
+ ensure("killer404 1", should_retry);
+ ensure_approximately_equals("killer404 1", wait_seconds, 1.0F, frac_bits);
+
+ // Double wait to 2.0
+ killer404.onFailure(500,headers);
+ should_retry = killer404.shouldRetry(wait_seconds);
+ ensure("killer404 2", should_retry);
+ ensure_approximately_equals("killer404 2", wait_seconds, 2.0F, frac_bits);
+
+ // Should fail on non-5xx
+ killer404.onFailure(404,headers);
+ should_retry = killer404.shouldRetry(wait_seconds);
+ ensure("killer404 3", !should_retry);
+
+ // After a non-5xx, should keep failing.
+ killer404.onFailure(500,headers);
+ should_retry = killer404.shouldRetry(wait_seconds);
+ ensure("killer404 4", !should_retry);
+}
+
+// Test handling of "retry-after" header. If present, this header
+// value overrides the computed delay, but does not affect the
+// progression of delay values. For example, if the normal
+// progression of delays would be 1,2,4,8..., but the 2nd and 3rd calls
+// get a retry header of 33, the pattern would become 1,33,33,8...
+template<> template<>
+void RetryPolicyTestObject::test<5>()
+{
+ LLAdaptiveRetryPolicy policy(1.0,25.0,2.0,6);
+ LLSD headers_with_retry;
+ headers_with_retry[HTTP_IN_HEADER_RETRY_AFTER] = "666";
+ LLSD headers_without_retry;
+ F32 wait_seconds;
+ bool should_retry;
+ U32 frac_bits = 6;
+
+ policy.onFailure(500,headers_without_retry);
+ should_retry = policy.shouldRetry(wait_seconds);
+ ensure("retry header 1", should_retry);
+ ensure_approximately_equals("retry header 1", wait_seconds, 1.0F, frac_bits);
+
+ policy.onFailure(500,headers_without_retry);
+ should_retry = policy.shouldRetry(wait_seconds);
+ ensure("retry header 2", should_retry);
+ ensure_approximately_equals("retry header 2", wait_seconds, 2.0F, frac_bits);
+
+ policy.onFailure(500,headers_with_retry);
+ should_retry = policy.shouldRetry(wait_seconds);
+ ensure("retry header 3", should_retry);
+ // 4.0 overrides by header -> 666.0
+ ensure_approximately_equals("retry header 3", wait_seconds, 666.0F, frac_bits);
+
+ policy.onFailure(500,headers_with_retry);
+ should_retry = policy.shouldRetry(wait_seconds);
+ ensure("retry header 4", should_retry);
+ // 8.0 overrides by header -> 666.0
+ ensure_approximately_equals("retry header 4", wait_seconds, 666.0F, frac_bits);
+
+ policy.onFailure(500,headers_without_retry);
+ should_retry = policy.shouldRetry(wait_seconds);
+ ensure("retry header 5", should_retry);
+ ensure_approximately_equals("retry header 5", wait_seconds, 16.0F, frac_bits);
+
+ policy.onFailure(500,headers_without_retry);
+ should_retry = policy.shouldRetry(wait_seconds);
+ ensure("retry header 6", should_retry);
+ ensure_approximately_equals("retry header 6", wait_seconds, 25.0F, frac_bits);
+
+ policy.onFailure(500,headers_with_retry);
+ should_retry = policy.shouldRetry(wait_seconds);
+ ensure("retry header 7", !should_retry);
+}
+
+// Test getSecondsUntilRetryAfter(const std::string& retry_after, F32& seconds_to_wait),
+// used by header parsing of the retry policy.
+template<> template<>
+void RetryPolicyTestObject::test<6>()
+{
+ F32 seconds_to_wait;
+ bool success;
+
+ std::string str1("0");
+ seconds_to_wait = F32_MAX;
+ success = getSecondsUntilRetryAfter(str1, seconds_to_wait);
+ ensure("parse 1", success);
+ ensure_equals("parse 1", seconds_to_wait, 0.0);
+
+ std::string str2("999.9");
+ seconds_to_wait = F32_MAX;
+ success = getSecondsUntilRetryAfter(str2, seconds_to_wait);
+ ensure("parse 2", success);
+ ensure_approximately_equals("parse 2", seconds_to_wait, 999.9F, 8);
+
+ time_t nowseconds;
+ time(&nowseconds);
+ std::string str3 = LLDate((F64)(nowseconds+44)).asRFC1123();
+ seconds_to_wait = F32_MAX;
+ success = getSecondsUntilRetryAfter(str3, seconds_to_wait);
+ std::cerr << " str3 [" << str3 << "]" << std::endl;
+ ensure("parse 3", success);
+ ensure_approximately_equals_range("parse 3", seconds_to_wait, 44.0F, 2.0F);
+}
+
+// Test retry-after field in both llmessage and CoreHttp headers.
+template<> template<>
+void RetryPolicyTestObject::test<7>()
+{
+ std::cerr << "7 starts" << std::endl;
+
+ LLSD sd_headers;
+ time_t nowseconds;
+ time(&nowseconds);
+ LLAdaptiveRetryPolicy policy(17.0,644.0,3.0,5);
+ F32 seconds_to_wait;
+ bool should_retry;
+
+ // No retry until we've failed a try.
+ ensure("header 0", !policy.shouldRetry(seconds_to_wait));
+
+ // no retry header, use default.
+ policy.onFailure(500,LLSD());
+ should_retry = policy.shouldRetry(seconds_to_wait);
+ ensure("header 1", should_retry);
+ ensure_approximately_equals("header 1", seconds_to_wait, 17.0F, 6);
+
+ // retry header should override, give delay of 0
+ std::string date_string = LLDate((F64)(nowseconds+7)).asRFC1123();
+ sd_headers[HTTP_IN_HEADER_RETRY_AFTER] = date_string;
+ policy.onFailure(503,sd_headers);
+ should_retry = policy.shouldRetry(seconds_to_wait);
+ ensure("header 2", should_retry);
+ ensure_approximately_equals_range("header 2", seconds_to_wait, 7.0F, 2.0F);
+
+ LLCore::HttpResponse *response;
+ LLCore::HttpHeaders *headers;
+
+ response = new LLCore::HttpResponse();
+ headers = new LLCore::HttpHeaders();
+ response->setStatus(503);
+ response->setHeaders(headers);
+ headers->append(HTTP_IN_HEADER_RETRY_AFTER, std::string("600"));
+ policy.onFailure(response);
+ should_retry = policy.shouldRetry(seconds_to_wait);
+ ensure("header 3",should_retry);
+ ensure_approximately_equals("header 3", seconds_to_wait, 600.0F, 6);
+ response->release();
+
+ response = new LLCore::HttpResponse();
+ headers = new LLCore::HttpHeaders();
+ response->setStatus(503);
+ response->setHeaders(headers);
+ time(&nowseconds);
+ date_string = LLDate((F64)(nowseconds+77)).asRFC1123();
+ std::cerr << "date_string [" << date_string << "]" << std::endl;
+ headers->append(HTTP_IN_HEADER_RETRY_AFTER,date_string);
+ policy.onFailure(response);
+ should_retry = policy.shouldRetry(seconds_to_wait);
+ ensure("header 4",should_retry);
+ ensure_approximately_equals_range("header 4", seconds_to_wait, 77.0F, 2.0F);
+ response->release();
+
+ // Timeout should be clamped at max.
+ policy.onFailure(500,LLSD());
+ should_retry = policy.shouldRetry(seconds_to_wait);
+ ensure("header 5", should_retry);
+ ensure_approximately_equals("header 5", seconds_to_wait, 644.0F, 6);
+
+ // No more retries.
+ policy.onFailure(500,LLSD());
+ should_retry = policy.shouldRetry(seconds_to_wait);
+ ensure("header 6", !should_retry);
+}
+
+}
+
diff --git a/indra/newview/tests/llmediadataclient_test.cpp b/indra/newview/tests/llmediadataclient_test.cpp
index 3e55336f2d..6f57daf151 100755
--- a/indra/newview/tests/llmediadataclient_test.cpp
+++ b/indra/newview/tests/llmediadataclient_test.cpp
@@ -33,7 +33,7 @@
#include "llsdserialize.h"
#include "llsdutil.h"
#include "llerrorcontrol.h"
-#include "llhttpstatuscodes.h"
+#include "llhttpconstants.h"
#include "../llmediadataclient.h"
#include "../llvovolume.h"
@@ -129,7 +129,7 @@ void LLHTTPClient::post(
{
LLSD content;
content["reason"] = "fake reason";
- responder->errorWithContent(HTTP_SERVICE_UNAVAILABLE, "fake reason", content);
+ responder->failureResult(HTTP_SERVICE_UNAVAILABLE, "fake reason", content);
return;
}
else if (url == FAKE_OBJECT_MEDIA_NAVIGATE_CAP_URL_ERROR)
@@ -137,8 +137,8 @@ void LLHTTPClient::post(
LLSD error;
error["code"] = LLObjectMediaNavigateClient::ERROR_PERMISSION_DENIED_CODE;
result["error"] = error;
- }
- responder->result(result);
+ }
+ responder->successResult(result);
}
const F32 HTTP_REQUEST_EXPIRY_SECS = 60.0f;
diff --git a/indra/newview/tests/llremoteparcelrequest_test.cpp b/indra/newview/tests/llremoteparcelrequest_test.cpp
index ed66066b0a..c49b0350e9 100755
--- a/indra/newview/tests/llremoteparcelrequest_test.cpp
+++ b/indra/newview/tests/llremoteparcelrequest_test.cpp
@@ -40,12 +40,14 @@ namespace {
LLCurl::Responder::Responder() { }
LLCurl::Responder::~Responder() { }
-void LLCurl::Responder::error(U32,std::string const &) { }
-void LLCurl::Responder::result(LLSD const &) { }
-void LLCurl::Responder::errorWithContent(U32 status,std::string const &,LLSD const &) { }
-void LLCurl::Responder::completedRaw(U32 status, std::string const &, LLChannelDescriptors const &,boost::shared_ptr<LLBufferArray> const &) { }
-void LLCurl::Responder::completed(U32 status, std::string const &, LLSD const &) { }
-void LLCurl::Responder::completedHeader(U32 status, std::string const &, LLSD const &) { }
+void LLCurl::Responder::httpFailure() { }
+void LLCurl::Responder::httpSuccess() { }
+void LLCurl::Responder::httpCompleted() { }
+void LLCurl::Responder::failureResult(S32 status, const std::string& reason, const LLSD& content) { }
+void LLCurl::Responder::successResult(const LLSD& content) { }
+void LLCurl::Responder::completeResult(S32 status, const std::string& reason, const LLSD& content) { }
+std::string LLCurl::Responder::dumpResponse() const { return "(failure)"; }
+void LLCurl::Responder::completedRaw(LLChannelDescriptors const &,boost::shared_ptr<LLBufferArray> const &) { }
void LLMessageSystem::getF32(char const *,char const *,F32 &,S32) { }
void LLMessageSystem::getU8(char const *,char const *,U8 &,S32) { }
void LLMessageSystem::getS32(char const *,char const *,S32 &,S32) { }
@@ -85,7 +87,7 @@ namespace tut
virtual void setParcelID(const LLUUID& parcel_id) { }
- virtual void setErrorStatus(U32 status, const std::string& reason) { }
+ virtual void setErrorStatus(S32 status, const std::string& reason) { }
bool mProcessed;
};
diff --git a/indra/newview/tests/llsimplestat_test.cpp b/indra/newview/tests/llsimplestat_test.cpp
deleted file mode 100755
index b556941f4a..0000000000
--- a/indra/newview/tests/llsimplestat_test.cpp
+++ /dev/null
@@ -1,580 +0,0 @@
-/**
- * @file llsimplestats_test.cpp
- * @date 2010-10-22
- * @brief Test cases for some of llsimplestat.h
- *
- * $LicenseInfo:firstyear=2010&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "linden_common.h"
-
-#include <tut/tut.hpp>
-
-#include "lltut.h"
-#include "../llsimplestat.h"
-#include "llsd.h"
-#include "llmath.h"
-
-// @brief Used as a pointer cast type to get access to LLSimpleStatCounter
-class TutStatCounter: public LLSimpleStatCounter
-{
-public:
- TutStatCounter(); // Not defined
- ~TutStatCounter(); // Not defined
- void operator=(const TutStatCounter &); // Not defined
-
- void setRawCount(U32 c) { mCount = c; }
- U32 getRawCount() const { return mCount; }
-};
-
-
-namespace tut
-{
- struct stat_counter_index
- {};
- typedef test_group<stat_counter_index> stat_counter_index_t;
- typedef stat_counter_index_t::object stat_counter_index_object_t;
- tut::stat_counter_index_t tut_stat_counter_index("stat_counter_test");
-
- // Testing LLSimpleStatCounter's external interface
- template<> template<>
- void stat_counter_index_object_t::test<1>()
- {
- LLSimpleStatCounter c1;
- ensure("Initialized counter is zero", (0 == c1.getCount()));
-
- ensure("Counter increment return is 1", (1 == ++c1));
- ensure("Counter increment return is 2", (2 == ++c1));
-
- ensure("Current counter is 2", (2 == c1.getCount()));
-
- c1.reset();
- ensure("Counter is 0 after reset", (0 == c1.getCount()));
-
- ensure("Counter increment return is 1", (1 == ++c1));
- }
-
- // Testing LLSimpleStatCounter's internal state
- template<> template<>
- void stat_counter_index_object_t::test<2>()
- {
- LLSimpleStatCounter c1;
- TutStatCounter * tc1 = (TutStatCounter *) &c1;
-
- ensure("Initialized private counter is zero", (0 == tc1->getRawCount()));
-
- ++c1;
- ++c1;
-
- ensure("Current private counter is 2", (2 == tc1->getRawCount()));
-
- c1.reset();
- ensure("Raw counter is 0 after reset", (0 == tc1->getRawCount()));
- }
-
- // Testing LLSimpleStatCounter's wrapping behavior
- template<> template<>
- void stat_counter_index_object_t::test<3>()
- {
- LLSimpleStatCounter c1;
- TutStatCounter * tc1 = (TutStatCounter *) &c1;
-
- tc1->setRawCount(U32_MAX);
- ensure("Initialized private counter is zero", (U32_MAX == c1.getCount()));
-
- ensure("Increment of max value wraps to 0", (0 == ++c1));
- }
-
- // Testing LLSimpleStatMMM's external behavior
- template<> template<>
- void stat_counter_index_object_t::test<4>()
- {
- LLSimpleStatMMM<> m1;
- typedef LLSimpleStatMMM<>::Value lcl_float;
- lcl_float zero(0);
-
- // Freshly-constructed
- ensure("Constructed MMM<> has 0 count", (0 == m1.getCount()));
- ensure("Constructed MMM<> has 0 min", (zero == m1.getMin()));
- ensure("Constructed MMM<> has 0 max", (zero == m1.getMax()));
- ensure("Constructed MMM<> has 0 mean no div-by-zero", (zero == m1.getMean()));
-
- // Single insert
- m1.record(1.0);
- ensure("Single insert MMM<> has 1 count", (1 == m1.getCount()));
- ensure("Single insert MMM<> has 1.0 min", (1.0 == m1.getMin()));
- ensure("Single insert MMM<> has 1.0 max", (1.0 == m1.getMax()));
- ensure("Single insert MMM<> has 1.0 mean", (1.0 == m1.getMean()));
-
- // Second insert
- m1.record(3.0);
- ensure("2nd insert MMM<> has 2 count", (2 == m1.getCount()));
- ensure("2nd insert MMM<> has 1.0 min", (1.0 == m1.getMin()));
- ensure("2nd insert MMM<> has 3.0 max", (3.0 == m1.getMax()));
- ensure_approximately_equals("2nd insert MMM<> has 2.0 mean", m1.getMean(), lcl_float(2.0), 1);
-
- // Third insert
- m1.record(5.0);
- ensure("3rd insert MMM<> has 3 count", (3 == m1.getCount()));
- ensure("3rd insert MMM<> has 1.0 min", (1.0 == m1.getMin()));
- ensure("3rd insert MMM<> has 5.0 max", (5.0 == m1.getMax()));
- ensure_approximately_equals("3rd insert MMM<> has 3.0 mean", m1.getMean(), lcl_float(3.0), 1);
-
- // Fourth insert
- m1.record(1000000.0);
- ensure("4th insert MMM<> has 4 count", (4 == m1.getCount()));
- ensure("4th insert MMM<> has 1.0 min", (1.0 == m1.getMin()));
- ensure("4th insert MMM<> has 100000.0 max", (1000000.0 == m1.getMax()));
- ensure_approximately_equals("4th insert MMM<> has 250002.0 mean", m1.getMean(), lcl_float(250002.0), 1);
-
- // Reset
- m1.reset();
- ensure("Reset MMM<> has 0 count", (0 == m1.getCount()));
- ensure("Reset MMM<> has 0 min", (zero == m1.getMin()));
- ensure("Reset MMM<> has 0 max", (zero == m1.getMax()));
- ensure("Reset MMM<> has 0 mean no div-by-zero", (zero == m1.getMean()));
- }
-
- // Testing LLSimpleStatMMM's response to large values
- template<> template<>
- void stat_counter_index_object_t::test<5>()
- {
- LLSimpleStatMMM<> m1;
- typedef LLSimpleStatMMM<>::Value lcl_float;
- lcl_float zero(0);
-
- // Insert overflowing values
- const lcl_float bignum(F32_MAX / 2);
-
- m1.record(bignum);
- m1.record(bignum);
- m1.record(bignum);
- m1.record(bignum);
- m1.record(bignum);
- m1.record(bignum);
- m1.record(bignum);
- m1.record(zero);
-
- ensure("Overflowed MMM<> has 8 count", (8 == m1.getCount()));
- ensure("Overflowed MMM<> has 0 min", (zero == m1.getMin()));
- ensure("Overflowed MMM<> has huge max", (bignum == m1.getMax()));
- ensure("Overflowed MMM<> has fetchable mean", (1.0 == m1.getMean() || true));
- // We should be infinte but not interested in proving the IEEE standard here.
- LLSD sd1(m1.getMean());
- // std::cout << "Thingy: " << m1.getMean() << " and as LLSD: " << sd1 << std::endl;
- ensure("Overflowed MMM<> produces LLSDable Real", (sd1.isReal()));
- }
-
- // Testing LLSimpleStatMMM<F32>'s external behavior
- template<> template<>
- void stat_counter_index_object_t::test<6>()
- {
- LLSimpleStatMMM<F32> m1;
- typedef LLSimpleStatMMM<F32>::Value lcl_float;
- lcl_float zero(0);
-
- // Freshly-constructed
- ensure("Constructed MMM<F32> has 0 count", (0 == m1.getCount()));
- ensure("Constructed MMM<F32> has 0 min", (zero == m1.getMin()));
- ensure("Constructed MMM<F32> has 0 max", (zero == m1.getMax()));
- ensure("Constructed MMM<F32> has 0 mean no div-by-zero", (zero == m1.getMean()));
-
- // Single insert
- m1.record(1.0);
- ensure("Single insert MMM<F32> has 1 count", (1 == m1.getCount()));
- ensure("Single insert MMM<F32> has 1.0 min", (1.0 == m1.getMin()));
- ensure("Single insert MMM<F32> has 1.0 max", (1.0 == m1.getMax()));
- ensure("Single insert MMM<F32> has 1.0 mean", (1.0 == m1.getMean()));
-
- // Second insert
- m1.record(3.0);
- ensure("2nd insert MMM<F32> has 2 count", (2 == m1.getCount()));
- ensure("2nd insert MMM<F32> has 1.0 min", (1.0 == m1.getMin()));
- ensure("2nd insert MMM<F32> has 3.0 max", (3.0 == m1.getMax()));
- ensure_approximately_equals("2nd insert MMM<F32> has 2.0 mean", m1.getMean(), lcl_float(2.0), 1);
-
- // Third insert
- m1.record(5.0);
- ensure("3rd insert MMM<F32> has 3 count", (3 == m1.getCount()));
- ensure("3rd insert MMM<F32> has 1.0 min", (1.0 == m1.getMin()));
- ensure("3rd insert MMM<F32> has 5.0 max", (5.0 == m1.getMax()));
- ensure_approximately_equals("3rd insert MMM<F32> has 3.0 mean", m1.getMean(), lcl_float(3.0), 1);
-
- // Fourth insert
- m1.record(1000000.0);
- ensure("4th insert MMM<F32> has 4 count", (4 == m1.getCount()));
- ensure("4th insert MMM<F32> has 1.0 min", (1.0 == m1.getMin()));
- ensure("4th insert MMM<F32> has 1000000.0 max", (1000000.0 == m1.getMax()));
- ensure_approximately_equals("4th insert MMM<F32> has 250002.0 mean", m1.getMean(), lcl_float(250002.0), 1);
-
- // Reset
- m1.reset();
- ensure("Reset MMM<F32> has 0 count", (0 == m1.getCount()));
- ensure("Reset MMM<F32> has 0 min", (zero == m1.getMin()));
- ensure("Reset MMM<F32> has 0 max", (zero == m1.getMax()));
- ensure("Reset MMM<F32> has 0 mean no div-by-zero", (zero == m1.getMean()));
- }
-
- // Testing LLSimpleStatMMM's response to large values
- template<> template<>
- void stat_counter_index_object_t::test<7>()
- {
- LLSimpleStatMMM<F32> m1;
- typedef LLSimpleStatMMM<F32>::Value lcl_float;
- lcl_float zero(0);
-
- // Insert overflowing values
- const lcl_float bignum(F32_MAX / 2);
-
- m1.record(bignum);
- m1.record(bignum);
- m1.record(bignum);
- m1.record(bignum);
- m1.record(bignum);
- m1.record(bignum);
- m1.record(bignum);
- m1.record(zero);
-
- ensure("Overflowed MMM<F32> has 8 count", (8 == m1.getCount()));
- ensure("Overflowed MMM<F32> has 0 min", (zero == m1.getMin()));
- ensure("Overflowed MMM<F32> has huge max", (bignum == m1.getMax()));
- ensure("Overflowed MMM<F32> has fetchable mean", (1.0 == m1.getMean() || true));
- // We should be infinte but not interested in proving the IEEE standard here.
- LLSD sd1(m1.getMean());
- // std::cout << "Thingy: " << m1.getMean() << " and as LLSD: " << sd1 << std::endl;
- ensure("Overflowed MMM<F32> produces LLSDable Real", (sd1.isReal()));
- }
-
- // Testing LLSimpleStatMMM<F64>'s external behavior
- template<> template<>
- void stat_counter_index_object_t::test<8>()
- {
- LLSimpleStatMMM<F64> m1;
- typedef LLSimpleStatMMM<F64>::Value lcl_float;
- lcl_float zero(0);
-
- // Freshly-constructed
- ensure("Constructed MMM<F64> has 0 count", (0 == m1.getCount()));
- ensure("Constructed MMM<F64> has 0 min", (zero == m1.getMin()));
- ensure("Constructed MMM<F64> has 0 max", (zero == m1.getMax()));
- ensure("Constructed MMM<F64> has 0 mean no div-by-zero", (zero == m1.getMean()));
-
- // Single insert
- m1.record(1.0);
- ensure("Single insert MMM<F64> has 1 count", (1 == m1.getCount()));
- ensure("Single insert MMM<F64> has 1.0 min", (1.0 == m1.getMin()));
- ensure("Single insert MMM<F64> has 1.0 max", (1.0 == m1.getMax()));
- ensure("Single insert MMM<F64> has 1.0 mean", (1.0 == m1.getMean()));
-
- // Second insert
- m1.record(3.0);
- ensure("2nd insert MMM<F64> has 2 count", (2 == m1.getCount()));
- ensure("2nd insert MMM<F64> has 1.0 min", (1.0 == m1.getMin()));
- ensure("2nd insert MMM<F64> has 3.0 max", (3.0 == m1.getMax()));
- ensure_approximately_equals("2nd insert MMM<F64> has 2.0 mean", m1.getMean(), lcl_float(2.0), 1);
-
- // Third insert
- m1.record(5.0);
- ensure("3rd insert MMM<F64> has 3 count", (3 == m1.getCount()));
- ensure("3rd insert MMM<F64> has 1.0 min", (1.0 == m1.getMin()));
- ensure("3rd insert MMM<F64> has 5.0 max", (5.0 == m1.getMax()));
- ensure_approximately_equals("3rd insert MMM<F64> has 3.0 mean", m1.getMean(), lcl_float(3.0), 1);
-
- // Fourth insert
- m1.record(1000000.0);
- ensure("4th insert MMM<F64> has 4 count", (4 == m1.getCount()));
- ensure("4th insert MMM<F64> has 1.0 min", (1.0 == m1.getMin()));
- ensure("4th insert MMM<F64> has 1000000.0 max", (1000000.0 == m1.getMax()));
- ensure_approximately_equals("4th insert MMM<F64> has 250002.0 mean", m1.getMean(), lcl_float(250002.0), 1);
-
- // Reset
- m1.reset();
- ensure("Reset MMM<F64> has 0 count", (0 == m1.getCount()));
- ensure("Reset MMM<F64> has 0 min", (zero == m1.getMin()));
- ensure("Reset MMM<F64> has 0 max", (zero == m1.getMax()));
- ensure("Reset MMM<F64> has 0 mean no div-by-zero", (zero == m1.getMean()));
- }
-
- // Testing LLSimpleStatMMM's response to large values
- template<> template<>
- void stat_counter_index_object_t::test<9>()
- {
- LLSimpleStatMMM<F64> m1;
- typedef LLSimpleStatMMM<F64>::Value lcl_float;
- lcl_float zero(0);
-
- // Insert overflowing values
- const lcl_float bignum(F64_MAX / 2);
-
- m1.record(bignum);
- m1.record(bignum);
- m1.record(bignum);
- m1.record(bignum);
- m1.record(bignum);
- m1.record(bignum);
- m1.record(bignum);
- m1.record(zero);
-
- ensure("Overflowed MMM<F64> has 8 count", (8 == m1.getCount()));
- ensure("Overflowed MMM<F64> has 0 min", (zero == m1.getMin()));
- ensure("Overflowed MMM<F64> has huge max", (bignum == m1.getMax()));
- ensure("Overflowed MMM<F64> has fetchable mean", (1.0 == m1.getMean() || true));
- // We should be infinte but not interested in proving the IEEE standard here.
- LLSD sd1(m1.getMean());
- // std::cout << "Thingy: " << m1.getMean() << " and as LLSD: " << sd1 << std::endl;
- ensure("Overflowed MMM<F64> produces LLSDable Real", (sd1.isReal()));
- }
-
- // Testing LLSimpleStatMMM<U64>'s external behavior
- template<> template<>
- void stat_counter_index_object_t::test<10>()
- {
- LLSimpleStatMMM<U64> m1;
- typedef LLSimpleStatMMM<U64>::Value lcl_int;
- lcl_int zero(0);
-
- // Freshly-constructed
- ensure("Constructed MMM<U64> has 0 count", (0 == m1.getCount()));
- ensure("Constructed MMM<U64> has 0 min", (zero == m1.getMin()));
- ensure("Constructed MMM<U64> has 0 max", (zero == m1.getMax()));
- ensure("Constructed MMM<U64> has 0 mean no div-by-zero", (zero == m1.getMean()));
-
- // Single insert
- m1.record(1);
- ensure("Single insert MMM<U64> has 1 count", (1 == m1.getCount()));
- ensure("Single insert MMM<U64> has 1 min", (1 == m1.getMin()));
- ensure("Single insert MMM<U64> has 1 max", (1 == m1.getMax()));
- ensure("Single insert MMM<U64> has 1 mean", (1 == m1.getMean()));
-
- // Second insert
- m1.record(3);
- ensure("2nd insert MMM<U64> has 2 count", (2 == m1.getCount()));
- ensure("2nd insert MMM<U64> has 1 min", (1 == m1.getMin()));
- ensure("2nd insert MMM<U64> has 3 max", (3 == m1.getMax()));
- ensure("2nd insert MMM<U64> has 2 mean", (2 == m1.getMean()));
-
- // Third insert
- m1.record(5);
- ensure("3rd insert MMM<U64> has 3 count", (3 == m1.getCount()));
- ensure("3rd insert MMM<U64> has 1 min", (1 == m1.getMin()));
- ensure("3rd insert MMM<U64> has 5 max", (5 == m1.getMax()));
- ensure("3rd insert MMM<U64> has 3 mean", (3 == m1.getMean()));
-
- // Fourth insert
- m1.record(U64L(1000000000000));
- ensure("4th insert MMM<U64> has 4 count", (4 == m1.getCount()));
- ensure("4th insert MMM<U64> has 1 min", (1 == m1.getMin()));
- ensure("4th insert MMM<U64> has 1000000000000ULL max", (U64L(1000000000000) == m1.getMax()));
- ensure("4th insert MMM<U64> has 250000000002ULL mean", (U64L( 250000000002) == m1.getMean()));
-
- // Reset
- m1.reset();
- ensure("Reset MMM<U64> has 0 count", (0 == m1.getCount()));
- ensure("Reset MMM<U64> has 0 min", (zero == m1.getMin()));
- ensure("Reset MMM<U64> has 0 max", (zero == m1.getMax()));
- ensure("Reset MMM<U64> has 0 mean no div-by-zero", (zero == m1.getMean()));
- }
-
- // Testing LLSimpleStatMMM's response to large values
- template<> template<>
- void stat_counter_index_object_t::test<11>()
- {
- LLSimpleStatMMM<U64> m1;
- typedef LLSimpleStatMMM<U64>::Value lcl_int;
- lcl_int zero(0);
-
- // Insert overflowing values
- const lcl_int bignum(U64L(0xffffffffffffffff) / 2);
-
- m1.record(bignum);
- m1.record(bignum);
- m1.record(bignum);
- m1.record(bignum);
- m1.record(bignum);
- m1.record(bignum);
- m1.record(bignum);
- m1.record(zero);
-
- ensure("Overflowed MMM<U64> has 8 count", (8 == m1.getCount()));
- ensure("Overflowed MMM<U64> has 0 min", (zero == m1.getMin()));
- ensure("Overflowed MMM<U64> has huge max", (bignum == m1.getMax()));
- ensure("Overflowed MMM<U64> has fetchable mean", (zero == m1.getMean() || true));
- }
-
- // Testing LLSimpleStatCounter's merge() method
- template<> template<>
- void stat_counter_index_object_t::test<12>()
- {
- LLSimpleStatCounter c1;
- LLSimpleStatCounter c2;
-
- ++c1;
- ++c1;
- ++c1;
- ++c1;
-
- ++c2;
- ++c2;
- c2.merge(c1);
-
- ensure_equals("4 merged into 2 results in 6", 6, c2.getCount());
-
- ensure_equals("Source of merge is undamaged", 4, c1.getCount());
- }
-
- // Testing LLSimpleStatMMM's merge() method
- template<> template<>
- void stat_counter_index_object_t::test<13>()
- {
- LLSimpleStatMMM<> m1;
- LLSimpleStatMMM<> m2;
-
- m1.record(3.5);
- m1.record(4.5);
- m1.record(5.5);
- m1.record(6.5);
-
- m2.record(5.0);
- m2.record(7.0);
- m2.record(9.0);
-
- m2.merge(m1);
-
- ensure_equals("Count after merge (p1)", 7, m2.getCount());
- ensure_approximately_equals("Min after merge (p1)", F32(3.5), m2.getMin(), 22);
- ensure_approximately_equals("Max after merge (p1)", F32(9.0), m2.getMax(), 22);
- ensure_approximately_equals("Mean after merge (p1)", F32(41.000/7.000), m2.getMean(), 22);
-
-
- ensure_equals("Source count of merge is undamaged (p1)", 4, m1.getCount());
- ensure_approximately_equals("Source min of merge is undamaged (p1)", F32(3.5), m1.getMin(), 22);
- ensure_approximately_equals("Source max of merge is undamaged (p1)", F32(6.5), m1.getMax(), 22);
- ensure_approximately_equals("Source mean of merge is undamaged (p1)", F32(5.0), m1.getMean(), 22);
-
- m2.reset();
-
- m2.record(-22.0);
- m2.record(-1.0);
- m2.record(30.0);
-
- m2.merge(m1);
-
- ensure_equals("Count after merge (p2)", 7, m2.getCount());
- ensure_approximately_equals("Min after merge (p2)", F32(-22.0), m2.getMin(), 22);
- ensure_approximately_equals("Max after merge (p2)", F32(30.0), m2.getMax(), 22);
- ensure_approximately_equals("Mean after merge (p2)", F32(27.000/7.000), m2.getMean(), 22);
-
- }
-
- // Testing LLSimpleStatMMM's merge() method when src contributes nothing
- template<> template<>
- void stat_counter_index_object_t::test<14>()
- {
- LLSimpleStatMMM<> m1;
- LLSimpleStatMMM<> m2;
-
- m2.record(5.0);
- m2.record(7.0);
- m2.record(9.0);
-
- m2.merge(m1);
-
- ensure_equals("Count after merge (p1)", 3, m2.getCount());
- ensure_approximately_equals("Min after merge (p1)", F32(5.0), m2.getMin(), 22);
- ensure_approximately_equals("Max after merge (p1)", F32(9.0), m2.getMax(), 22);
- ensure_approximately_equals("Mean after merge (p1)", F32(7.000), m2.getMean(), 22);
-
- ensure_equals("Source count of merge is undamaged (p1)", 0, m1.getCount());
- ensure_approximately_equals("Source min of merge is undamaged (p1)", F32(0), m1.getMin(), 22);
- ensure_approximately_equals("Source max of merge is undamaged (p1)", F32(0), m1.getMax(), 22);
- ensure_approximately_equals("Source mean of merge is undamaged (p1)", F32(0), m1.getMean(), 22);
-
- m2.reset();
-
- m2.record(-22.0);
- m2.record(-1.0);
-
- m2.merge(m1);
-
- ensure_equals("Count after merge (p2)", 2, m2.getCount());
- ensure_approximately_equals("Min after merge (p2)", F32(-22.0), m2.getMin(), 22);
- ensure_approximately_equals("Max after merge (p2)", F32(-1.0), m2.getMax(), 22);
- ensure_approximately_equals("Mean after merge (p2)", F32(-11.5), m2.getMean(), 22);
- }
-
- // Testing LLSimpleStatMMM's merge() method when dst contributes nothing
- template<> template<>
- void stat_counter_index_object_t::test<15>()
- {
- LLSimpleStatMMM<> m1;
- LLSimpleStatMMM<> m2;
-
- m1.record(5.0);
- m1.record(7.0);
- m1.record(9.0);
-
- m2.merge(m1);
-
- ensure_equals("Count after merge (p1)", 3, m2.getCount());
- ensure_approximately_equals("Min after merge (p1)", F32(5.0), m2.getMin(), 22);
- ensure_approximately_equals("Max after merge (p1)", F32(9.0), m2.getMax(), 22);
- ensure_approximately_equals("Mean after merge (p1)", F32(7.000), m2.getMean(), 22);
-
- ensure_equals("Source count of merge is undamaged (p1)", 3, m1.getCount());
- ensure_approximately_equals("Source min of merge is undamaged (p1)", F32(5.0), m1.getMin(), 22);
- ensure_approximately_equals("Source max of merge is undamaged (p1)", F32(9.0), m1.getMax(), 22);
- ensure_approximately_equals("Source mean of merge is undamaged (p1)", F32(7.0), m1.getMean(), 22);
-
- m1.reset();
- m2.reset();
-
- m1.record(-22.0);
- m1.record(-1.0);
-
- m2.merge(m1);
-
- ensure_equals("Count after merge (p2)", 2, m2.getCount());
- ensure_approximately_equals("Min after merge (p2)", F32(-22.0), m2.getMin(), 22);
- ensure_approximately_equals("Max after merge (p2)", F32(-1.0), m2.getMax(), 22);
- ensure_approximately_equals("Mean after merge (p2)", F32(-11.5), m2.getMean(), 22);
- }
-
- // Testing LLSimpleStatMMM's merge() method when neither dst nor src contributes
- template<> template<>
- void stat_counter_index_object_t::test<16>()
- {
- LLSimpleStatMMM<> m1;
- LLSimpleStatMMM<> m2;
-
- m2.merge(m1);
-
- ensure_equals("Count after merge (p1)", 0, m2.getCount());
- ensure_approximately_equals("Min after merge (p1)", F32(0), m2.getMin(), 22);
- ensure_approximately_equals("Max after merge (p1)", F32(0), m2.getMax(), 22);
- ensure_approximately_equals("Mean after merge (p1)", F32(0), m2.getMean(), 22);
-
- ensure_equals("Source count of merge is undamaged (p1)", 0, m1.getCount());
- ensure_approximately_equals("Source min of merge is undamaged (p1)", F32(0), m1.getMin(), 22);
- ensure_approximately_equals("Source max of merge is undamaged (p1)", F32(0), m1.getMax(), 22);
- ensure_approximately_equals("Source mean of merge is undamaged (p1)", F32(0), m1.getMean(), 22);
- }
-}
diff --git a/indra/newview/tests/lltexturestatsuploader_test.cpp b/indra/newview/tests/lltexturestatsuploader_test.cpp
index cfb2c267cc..4438523022 100755
--- a/indra/newview/tests/lltexturestatsuploader_test.cpp
+++ b/indra/newview/tests/lltexturestatsuploader_test.cpp
@@ -111,7 +111,7 @@ namespace tut
void texturestatsuploader_object_t::test<1>()
{
LLTextureStatsUploader tsu;
- llinfos << &tsu << llendl;
+ LL_INFOS() << &tsu << LL_ENDL;
ensure("have we crashed?", true);
}
diff --git a/indra/newview/tests/lltranslate_test.cpp b/indra/newview/tests/lltranslate_test.cpp
index 8ce56326d8..5e73dbb981 100755
--- a/indra/newview/tests/lltranslate_test.cpp
+++ b/indra/newview/tests/lltranslate_test.cpp
@@ -34,6 +34,8 @@
#include "lltrans.h"
#include "llui.h"
+#include "../../llmessage/llhttpconstants.cpp"
+
static const std::string GOOGLE_VALID_RESPONSE1 =
"{\
\"data\": {\
@@ -300,12 +302,10 @@ std::string LLControlGroup::getString(const std::string& name) { return "dummy";
LLControlGroup::~LLControlGroup() {}
LLCurl::Responder::Responder() {}
-void LLCurl::Responder::completedHeader(U32, std::string const&, LLSD const&) {}
-void LLCurl::Responder::completedRaw(U32, const std::string&, const LLChannelDescriptors&, const LLIOPipe::buffer_ptr_t& buffer) {}
-void LLCurl::Responder::completed(U32, std::string const&, LLSD const&) {}
-void LLCurl::Responder::error(U32, std::string const&) {}
-void LLCurl::Responder::errorWithContent(U32, std::string const&, LLSD const&) {}
-void LLCurl::Responder::result(LLSD const&) {}
+void LLCurl::Responder::httpFailure() { }
+void LLCurl::Responder::httpSuccess() { }
+void LLCurl::Responder::httpCompleted() { }
+void LLCurl::Responder::completedRaw(LLChannelDescriptors const &,boost::shared_ptr<LLBufferArray> const &) { }
LLCurl::Responder::~Responder() {}
void LLHTTPClient::get(const std::string&, const LLSD&, ResponderPtr, const LLSD&, const F32, bool) {}
diff --git a/indra/newview/tests/llviewerassetstats_test.cpp b/indra/newview/tests/llviewerassetstats_test.cpp
index a331d9aa9e..a08e32cb49 100755
--- a/indra/newview/tests/llviewerassetstats_test.cpp
+++ b/indra/newview/tests/llviewerassetstats_test.cpp
@@ -35,8 +35,38 @@
#include "lluuid.h"
#include "llsdutil.h"
#include "llregionhandle.h"
+#include "lltracethreadrecorder.h"
#include "../llvoavatar.h"
+namespace LLStatViewer
+{
+ LLTrace::SampleStatHandle<> FPS_SAMPLE("fpssample");
+}
+
+void LLVOAvatar::getNearbyRezzedStats(std::vector<S32>& counts)
+{
+ counts.resize(3);
+ counts[0] = 0;
+ counts[1] = 0;
+ counts[2] = 1;
+}
+
+// static
+std::string LLVOAvatar::rezStatusToString(S32 rez_status)
+{
+ if (rez_status==0) return "cloud";
+ if (rez_status==1) return "gray";
+ if (rez_status==2) return "textured";
+ return "unknown";
+}
+
+// static
+LLViewerStats::StatsAccumulator& LLViewerStats::PhaseMap::getPhaseStats(const std::string& phase_name)
+{
+ static LLViewerStats::StatsAccumulator junk;
+ return junk;
+}
+
static const char * all_keys[] =
{
"duration",
@@ -199,7 +229,19 @@ get_region(const LLSD & sd, U64 region_handle1)
namespace tut
{
struct tst_viewerassetstats_index
- {};
+ {
+ tst_viewerassetstats_index()
+ {
+ LLTrace::set_master_thread_recorder(&mThreadRecorder);
+ }
+
+ ~tst_viewerassetstats_index()
+ {
+ LLTrace::set_master_thread_recorder(NULL);
+ }
+
+ LLTrace::ThreadRecorder mThreadRecorder;
+ };
typedef test_group<tst_viewerassetstats_index> tst_viewerassetstats_index_t;
typedef tst_viewerassetstats_index_t::object tst_viewerassetstats_index_object_t;
tut::tst_viewerassetstats_index_t tut_tst_viewerassetstats_index("tst_viewerassetstats_test");
@@ -209,24 +251,24 @@ namespace tut
void tst_viewerassetstats_index_object_t::test<1>()
{
// Check that helpers aren't bothered by missing global stats
- ensure("Global gViewerAssetStatsMain should be NULL", (NULL == gViewerAssetStatsMain));
+ ensure("Global gViewerAssetStats should be NULL", (NULL == gViewerAssetStats));
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_TEXTURE, false, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_TEXTURE, false, false);
- LLViewerAssetStatsFF::record_dequeue_main(LLViewerAssetType::AT_TEXTURE, false, false);
+ LLViewerAssetStatsFF::record_dequeue(LLViewerAssetType::AT_TEXTURE, false, false);
- LLViewerAssetStatsFF::record_response_main(LLViewerAssetType::AT_GESTURE, false, false, 12300000ULL);
+ LLViewerAssetStatsFF::record_response(LLViewerAssetType::AT_GESTURE, false, false, (U64Microseconds)12300000ULL);
}
// Create a non-global instance and check the structure
template<> template<>
void tst_viewerassetstats_index_object_t::test<2>()
{
- ensure("Global gViewerAssetStatsMain should be NULL", (NULL == gViewerAssetStatsMain));
+ ensure("Global gViewerAssetStats should be NULL", (NULL == gViewerAssetStats));
LLViewerAssetStats * it = new LLViewerAssetStats();
- ensure("Global gViewerAssetStatsMain should still be NULL", (NULL == gViewerAssetStatsMain));
+ ensure("Global gViewerAssetStats should still be NULL", (NULL == gViewerAssetStats));
LLSD sd_full = it->asLLSD(false);
@@ -293,16 +335,16 @@ namespace tut
template<> template<>
void tst_viewerassetstats_index_object_t::test<4>()
{
- gViewerAssetStatsMain = new LLViewerAssetStats();
- LLViewerAssetStatsFF::set_region_main(region1_handle);
+ gViewerAssetStats = new LLViewerAssetStats();
+ LLViewerAssetStatsFF::set_region(region1_handle);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_TEXTURE, false, false);
- LLViewerAssetStatsFF::record_dequeue_main(LLViewerAssetType::AT_TEXTURE, false, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_TEXTURE, false, false);
+ LLViewerAssetStatsFF::record_dequeue(LLViewerAssetType::AT_TEXTURE, false, false);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_BODYPART, false, false);
- LLViewerAssetStatsFF::record_dequeue_main(LLViewerAssetType::AT_BODYPART, false, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_BODYPART, false, false);
+ LLViewerAssetStatsFF::record_dequeue(LLViewerAssetType::AT_BODYPART, false, false);
- LLSD sd = gViewerAssetStatsMain->asLLSD(false);
+ LLSD sd = gViewerAssetStats->asLLSD(false);
ensure("Correct single-key LLSD map root", is_double_key_map(sd, "regions", "duration"));
ensure("Correct single-slot LLSD array regions", is_single_slot_array(sd["regions"], region1_handle));
sd = sd["regions"][0];
@@ -316,80 +358,38 @@ namespace tut
// Reset and check zeros...
// Reset leaves current region in place
- gViewerAssetStatsMain->reset();
- sd = gViewerAssetStatsMain->asLLSD(false)["regions"][region1_handle_str];
+ gViewerAssetStats->reset();
+ sd = gViewerAssetStats->asLLSD(false)["regions"][region1_handle_str];
- delete gViewerAssetStatsMain;
- gViewerAssetStatsMain = NULL;
+ delete gViewerAssetStats;
+ gViewerAssetStats = NULL;
ensure("sd[get_texture_non_temp_udp][enqueued] is reset", (0 == sd["get_texture_non_temp_udp"]["enqueued"].asInteger()));
ensure("sd[get_gesture_udp][dequeued] is reset", (0 == sd["get_gesture_udp"]["dequeued"].asInteger()));
}
- // Create two global instances and verify no interactions
+ // Check multiple region collection
template<> template<>
void tst_viewerassetstats_index_object_t::test<5>()
{
- gViewerAssetStatsThread1 = new LLViewerAssetStats();
- gViewerAssetStatsMain = new LLViewerAssetStats();
- LLViewerAssetStatsFF::set_region_main(region1_handle);
+ gViewerAssetStats = new LLViewerAssetStats();
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_TEXTURE, false, false);
- LLViewerAssetStatsFF::record_dequeue_main(LLViewerAssetType::AT_TEXTURE, false, false);
+ LLViewerAssetStatsFF::set_region(region1_handle);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_BODYPART, false, false);
- LLViewerAssetStatsFF::record_dequeue_main(LLViewerAssetType::AT_BODYPART, false, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_TEXTURE, false, false);
+ LLViewerAssetStatsFF::record_dequeue(LLViewerAssetType::AT_TEXTURE, false, false);
- LLSD sd = gViewerAssetStatsThread1->asLLSD(false);
- ensure("Other collector is empty", is_no_stats_map(sd));
- sd = gViewerAssetStatsMain->asLLSD(false);
- ensure("Correct single-key LLSD map root", is_double_key_map(sd, "regions", "duration"));
- ensure("Correct single-slot LLSD array regions", is_single_slot_array(sd["regions"], region1_handle));
- sd = sd["regions"][0];
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_BODYPART, false, false);
+ LLViewerAssetStatsFF::record_dequeue(LLViewerAssetType::AT_BODYPART, false, false);
- // Check a few points on the tree for content
- ensure("sd[get_texture_non_temp_udp][enqueued] is 1", (1 == sd["get_texture_non_temp_udp"]["enqueued"].asInteger()));
- ensure("sd[get_texture_temp_udp][enqueued] is 0", (0 == sd["get_texture_temp_udp"]["enqueued"].asInteger()));
- ensure("sd[get_texture_non_temp_http][enqueued] is 0", (0 == sd["get_texture_non_temp_http"]["enqueued"].asInteger()));
- ensure("sd[get_texture_temp_http][enqueued] is 0", (0 == sd["get_texture_temp_http"]["enqueued"].asInteger()));
- ensure("sd[get_gesture_udp][dequeued] is 0", (0 == sd["get_gesture_udp"]["dequeued"].asInteger()));
-
- // Reset and check zeros...
- // Reset leaves current region in place
- gViewerAssetStatsMain->reset();
- sd = gViewerAssetStatsMain->asLLSD(false)["regions"][0];
-
- delete gViewerAssetStatsMain;
- gViewerAssetStatsMain = NULL;
- delete gViewerAssetStatsThread1;
- gViewerAssetStatsThread1 = NULL;
-
- ensure("sd[get_texture_non_temp_udp][enqueued] is reset", (0 == sd["get_texture_non_temp_udp"]["enqueued"].asInteger()));
- ensure("sd[get_gesture_udp][dequeued] is reset", (0 == sd["get_gesture_udp"]["dequeued"].asInteger()));
- }
-
- // Check multiple region collection
- template<> template<>
- void tst_viewerassetstats_index_object_t::test<6>()
- {
- gViewerAssetStatsMain = new LLViewerAssetStats();
-
- LLViewerAssetStatsFF::set_region_main(region1_handle);
+ LLViewerAssetStatsFF::set_region(region2_handle);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_TEXTURE, false, false);
- LLViewerAssetStatsFF::record_dequeue_main(LLViewerAssetType::AT_TEXTURE, false, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_GESTURE, false, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_GESTURE, false, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_GESTURE, false, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_GESTURE, false, false);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_BODYPART, false, false);
- LLViewerAssetStatsFF::record_dequeue_main(LLViewerAssetType::AT_BODYPART, false, false);
-
- LLViewerAssetStatsFF::set_region_main(region2_handle);
-
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_GESTURE, false, false);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_GESTURE, false, false);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_GESTURE, false, false);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_GESTURE, false, false);
-
- LLSD sd = gViewerAssetStatsMain->asLLSD(false);
+ LLSD sd = gViewerAssetStats->asLLSD(false);
// std::cout << sd << std::endl;
@@ -414,14 +414,14 @@ namespace tut
// Reset and check zeros...
// Reset leaves current region in place
- gViewerAssetStatsMain->reset();
- sd = gViewerAssetStatsMain->asLLSD(false);
+ gViewerAssetStats->reset();
+ sd = gViewerAssetStats->asLLSD(false);
ensure("Correct single-key LLSD map root", is_double_key_map(sd, "regions", "duration"));
ensure("Correct single-slot LLSD array regions (p2)", is_single_slot_array(sd["regions"], region2_handle));
sd2 = sd["regions"][0];
- delete gViewerAssetStatsMain;
- gViewerAssetStatsMain = NULL;
+ delete gViewerAssetStats;
+ gViewerAssetStats = NULL;
ensure("sd2[get_texture_non_temp_udp][enqueued] is reset", (0 == sd2["get_texture_non_temp_udp"]["enqueued"].asInteger()));
ensure("sd2[get_gesture_udp][enqueued] is reset", (0 == sd2["get_gesture_udp"]["enqueued"].asInteger()));
@@ -429,41 +429,41 @@ namespace tut
// Check multiple region collection jumping back-and-forth between regions
template<> template<>
- void tst_viewerassetstats_index_object_t::test<7>()
+ void tst_viewerassetstats_index_object_t::test<6>()
{
- gViewerAssetStatsMain = new LLViewerAssetStats();
+ gViewerAssetStats = new LLViewerAssetStats();
- LLViewerAssetStatsFF::set_region_main(region1_handle);
+ LLViewerAssetStatsFF::set_region(region1_handle);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_TEXTURE, false, false);
- LLViewerAssetStatsFF::record_dequeue_main(LLViewerAssetType::AT_TEXTURE, false, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_TEXTURE, false, false);
+ LLViewerAssetStatsFF::record_dequeue(LLViewerAssetType::AT_TEXTURE, false, false);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_BODYPART, false, false);
- LLViewerAssetStatsFF::record_dequeue_main(LLViewerAssetType::AT_BODYPART, false, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_BODYPART, false, false);
+ LLViewerAssetStatsFF::record_dequeue(LLViewerAssetType::AT_BODYPART, false, false);
- LLViewerAssetStatsFF::set_region_main(region2_handle);
+ LLViewerAssetStatsFF::set_region(region2_handle);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_GESTURE, false, false);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_GESTURE, false, false);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_GESTURE, false, false);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_GESTURE, false, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_GESTURE, false, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_GESTURE, false, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_GESTURE, false, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_GESTURE, false, false);
- LLViewerAssetStatsFF::set_region_main(region1_handle);
+ LLViewerAssetStatsFF::set_region(region1_handle);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_TEXTURE, true, true);
- LLViewerAssetStatsFF::record_dequeue_main(LLViewerAssetType::AT_TEXTURE, true, true);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_TEXTURE, true, true);
+ LLViewerAssetStatsFF::record_dequeue(LLViewerAssetType::AT_TEXTURE, true, true);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_BODYPART, false, false);
- LLViewerAssetStatsFF::record_dequeue_main(LLViewerAssetType::AT_BODYPART, false, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_BODYPART, false, false);
+ LLViewerAssetStatsFF::record_dequeue(LLViewerAssetType::AT_BODYPART, false, false);
- LLViewerAssetStatsFF::set_region_main(region2_handle);
+ LLViewerAssetStatsFF::set_region(region2_handle);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_GESTURE, false, false);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_GESTURE, false, false);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_GESTURE, false, false);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_GESTURE, false, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_GESTURE, false, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_GESTURE, false, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_GESTURE, false, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_GESTURE, false, false);
- LLSD sd = gViewerAssetStatsMain->asLLSD(false);
+ LLSD sd = gViewerAssetStats->asLLSD(false);
ensure("Correct double-key LLSD map root", is_double_key_map(sd, "duration", "regions"));
ensure("Correct double-slot LLSD array regions", is_double_slot_array(sd["regions"], region1_handle, region2_handle));
@@ -486,15 +486,15 @@ namespace tut
// Reset and check zeros...
// Reset leaves current region in place
- gViewerAssetStatsMain->reset();
- sd = gViewerAssetStatsMain->asLLSD(false);
+ gViewerAssetStats->reset();
+ sd = gViewerAssetStats->asLLSD(false);
ensure("Correct single-key LLSD map root", is_double_key_map(sd, "duration", "regions"));
ensure("Correct single-slot LLSD array regions (p2)", is_single_slot_array(sd["regions"], region2_handle));
sd2 = get_region(sd, region2_handle);
ensure("Region2 is present in results", sd2.isMap());
- delete gViewerAssetStatsMain;
- gViewerAssetStatsMain = NULL;
+ delete gViewerAssetStats;
+ gViewerAssetStats = NULL;
ensure_equals("sd2[get_texture_non_temp_udp][enqueued] is reset", sd2["get_texture_non_temp_udp"]["enqueued"].asInteger(), 0);
ensure_equals("sd2[get_gesture_udp][enqueued] is reset", sd2["get_gesture_udp"]["enqueued"].asInteger(), 0);
@@ -502,38 +502,35 @@ namespace tut
// Non-texture assets ignore transport and persistence flags
template<> template<>
- void tst_viewerassetstats_index_object_t::test<8>()
+ void tst_viewerassetstats_index_object_t::test<7>()
{
- gViewerAssetStatsThread1 = new LLViewerAssetStats();
- gViewerAssetStatsMain = new LLViewerAssetStats();
- LLViewerAssetStatsFF::set_region_main(region1_handle);
+ gViewerAssetStats = new LLViewerAssetStats();
+ LLViewerAssetStatsFF::set_region(region1_handle);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_TEXTURE, false, false);
- LLViewerAssetStatsFF::record_dequeue_main(LLViewerAssetType::AT_TEXTURE, false, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_TEXTURE, false, false);
+ LLViewerAssetStatsFF::record_dequeue(LLViewerAssetType::AT_TEXTURE, false, false);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_BODYPART, false, false);
- LLViewerAssetStatsFF::record_dequeue_main(LLViewerAssetType::AT_BODYPART, false, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_BODYPART, false, false);
+ LLViewerAssetStatsFF::record_dequeue(LLViewerAssetType::AT_BODYPART, false, false);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_BODYPART, false, true);
- LLViewerAssetStatsFF::record_dequeue_main(LLViewerAssetType::AT_BODYPART, false, true);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_BODYPART, false, true);
+ LLViewerAssetStatsFF::record_dequeue(LLViewerAssetType::AT_BODYPART, false, true);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_BODYPART, true, false);
- LLViewerAssetStatsFF::record_dequeue_main(LLViewerAssetType::AT_BODYPART, true, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_BODYPART, true, false);
+ LLViewerAssetStatsFF::record_dequeue(LLViewerAssetType::AT_BODYPART, true, false);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_BODYPART, true, true);
- LLViewerAssetStatsFF::record_dequeue_main(LLViewerAssetType::AT_BODYPART, true, true);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_BODYPART, true, true);
+ LLViewerAssetStatsFF::record_dequeue(LLViewerAssetType::AT_BODYPART, true, true);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_LSL_BYTECODE, false, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_LSL_BYTECODE, false, false);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_LSL_BYTECODE, false, true);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_LSL_BYTECODE, false, true);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_LSL_BYTECODE, true, false);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_LSL_BYTECODE, true, false);
- LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
+ LLViewerAssetStatsFF::record_enqueue(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- LLSD sd = gViewerAssetStatsThread1->asLLSD(false);
- ensure("Other collector is empty", is_no_stats_map(sd));
- sd = gViewerAssetStatsMain->asLLSD(false);
+ LLSD sd = gViewerAssetStats->asLLSD(false);
ensure("Correct single-key LLSD map root", is_double_key_map(sd, "regions", "duration"));
ensure("Correct single-slot LLSD array regions", is_single_slot_array(sd["regions"], region1_handle));
sd = get_region(sd, region1_handle);
@@ -551,445 +548,14 @@ namespace tut
// Reset and check zeros...
// Reset leaves current region in place
- gViewerAssetStatsMain->reset();
- sd = get_region(gViewerAssetStatsMain->asLLSD(false), region1_handle);
+ gViewerAssetStats->reset();
+ sd = get_region(gViewerAssetStats->asLLSD(false), region1_handle);
ensure("Region1 is present in results", sd.isMap());
- delete gViewerAssetStatsMain;
- gViewerAssetStatsMain = NULL;
- delete gViewerAssetStatsThread1;
- gViewerAssetStatsThread1 = NULL;
+ delete gViewerAssetStats;
+ gViewerAssetStats = NULL;
ensure_equals("sd[get_texture_non_temp_udp][enqueued] is reset", sd["get_texture_non_temp_udp"]["enqueued"].asInteger(), 0);
ensure_equals("sd[get_gesture_udp][dequeued] is reset", sd["get_gesture_udp"]["dequeued"].asInteger(), 0);
}
-
-
- // LLViewerAssetStats::merge() basic functions work
- template<> template<>
- void tst_viewerassetstats_index_object_t::test<9>()
- {
- LLViewerAssetStats s1;
- LLViewerAssetStats s2;
-
- s1.setRegion(region1_handle);
- s2.setRegion(region1_handle);
-
- s1.recordGetServiced(LLViewerAssetType::AT_TEXTURE, true, true, 5000000);
- s1.recordGetServiced(LLViewerAssetType::AT_TEXTURE, true, true, 6000000);
- s1.recordGetServiced(LLViewerAssetType::AT_TEXTURE, true, true, 8000000);
- s1.recordGetServiced(LLViewerAssetType::AT_TEXTURE, true, true, 7000000);
- s1.recordGetServiced(LLViewerAssetType::AT_TEXTURE, true, true, 9000000);
-
- s2.recordGetServiced(LLViewerAssetType::AT_TEXTURE, true, true, 2000000);
- s2.recordGetServiced(LLViewerAssetType::AT_TEXTURE, true, true, 3000000);
- s2.recordGetServiced(LLViewerAssetType::AT_TEXTURE, true, true, 4000000);
-
- s2.merge(s1);
-
- LLSD s2_llsd = get_region(s2.asLLSD(false), region1_handle);
- ensure("Region1 is present in results", s2_llsd.isMap());
-
- ensure_equals("count after merge", s2_llsd["get_texture_temp_http"]["resp_count"].asInteger(), 8);
- ensure_approximately_equals("min after merge", s2_llsd["get_texture_temp_http"]["resp_min"].asReal(), 2.0, 22);
- ensure_approximately_equals("max after merge", s2_llsd["get_texture_temp_http"]["resp_max"].asReal(), 9.0, 22);
- ensure_approximately_equals("max after merge", s2_llsd["get_texture_temp_http"]["resp_mean"].asReal(), 5.5, 22);
- }
-
- // LLViewerAssetStats::merge() basic functions work without corrupting source data
- template<> template<>
- void tst_viewerassetstats_index_object_t::test<10>()
- {
- LLViewerAssetStats s1;
- LLViewerAssetStats s2;
-
- s1.setRegion(region1_handle);
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- s1.recordGetServiced(LLViewerAssetType::AT_LSL_BYTECODE, true, true, 23289200);
- s1.recordGetServiced(LLViewerAssetType::AT_LSL_BYTECODE, true, true, 282900);
-
-
- s2.setRegion(region2_handle);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- s2.recordGetServiced(LLViewerAssetType::AT_LSL_BYTECODE, true, true, 6500000);
- s2.recordGetServiced(LLViewerAssetType::AT_LSL_BYTECODE, true, true, 10000);
-
- {
- s2.merge(s1);
-
- LLSD src = s1.asLLSD(false);
- LLSD dst = s2.asLLSD(false);
-
- ensure_equals("merge src has single region", src["regions"].size(), 1);
- ensure_equals("merge dst has dual regions", dst["regions"].size(), 2);
-
- // Remove time stamps, they're a problem
- src.erase("duration");
- src["regions"][0].erase("duration");
- dst.erase("duration");
- dst["regions"][0].erase("duration");
- dst["regions"][1].erase("duration");
-
- LLSD s1_llsd = get_region(src, region1_handle);
- ensure("Region1 is present in src", s1_llsd.isMap());
- LLSD s2_llsd = get_region(dst, region1_handle);
- ensure("Region1 is present in dst", s2_llsd.isMap());
-
- ensure("result from src is in dst", llsd_equals(s1_llsd, s2_llsd));
- }
-
- s1.setRegion(region1_handle);
- s2.setRegion(region1_handle);
- s1.reset();
- s2.reset();
-
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- s1.recordGetServiced(LLViewerAssetType::AT_LSL_BYTECODE, true, true, 23289200);
- s1.recordGetServiced(LLViewerAssetType::AT_LSL_BYTECODE, true, true, 282900);
-
-
- s2.setRegion(region1_handle);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- s2.recordGetServiced(LLViewerAssetType::AT_LSL_BYTECODE, true, true, 6500000);
- s2.recordGetServiced(LLViewerAssetType::AT_LSL_BYTECODE, true, true, 10000);
-
- {
- s2.merge(s1);
-
- LLSD src = s1.asLLSD(false);
- LLSD dst = s2.asLLSD(false);
-
- ensure_equals("merge src has single region (p2)", src["regions"].size(), 1);
- ensure_equals("merge dst has single region (p2)", dst["regions"].size(), 1);
-
- // Remove time stamps, they're a problem
- src.erase("duration");
- src["regions"][0].erase("duration");
- dst.erase("duration");
- dst["regions"][0].erase("duration");
-
- LLSD s1_llsd = get_region(src, region1_handle);
- ensure("Region1 is present in src", s1_llsd.isMap());
- LLSD s2_llsd = get_region(dst, region1_handle);
- ensure("Region1 is present in dst", s2_llsd.isMap());
-
- ensure_equals("src counts okay (enq)", s1_llsd["get_other"]["enqueued"].asInteger(), 4);
- ensure_equals("src counts okay (deq)", s1_llsd["get_other"]["dequeued"].asInteger(), 4);
- ensure_equals("src resp counts okay", s1_llsd["get_other"]["resp_count"].asInteger(), 2);
- ensure_approximately_equals("src respmin okay", s1_llsd["get_other"]["resp_min"].asReal(), 0.2829, 20);
- ensure_approximately_equals("src respmax okay", s1_llsd["get_other"]["resp_max"].asReal(), 23.2892, 20);
-
- ensure_equals("dst counts okay (enq)", s2_llsd["get_other"]["enqueued"].asInteger(), 12);
- ensure_equals("src counts okay (deq)", s2_llsd["get_other"]["dequeued"].asInteger(), 11);
- ensure_equals("dst resp counts okay", s2_llsd["get_other"]["resp_count"].asInteger(), 4);
- ensure_approximately_equals("dst respmin okay", s2_llsd["get_other"]["resp_min"].asReal(), 0.010, 20);
- ensure_approximately_equals("dst respmax okay", s2_llsd["get_other"]["resp_max"].asReal(), 23.2892, 20);
- }
- }
-
-
- // Maximum merges are interesting when one side contributes nothing
- template<> template<>
- void tst_viewerassetstats_index_object_t::test<11>()
- {
- LLViewerAssetStats s1;
- LLViewerAssetStats s2;
-
- s1.setRegion(region1_handle);
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- // Want to test negative numbers here but have to work in U64
- s1.recordGetServiced(LLViewerAssetType::AT_LSL_BYTECODE, true, true, 0);
- s1.recordGetServiced(LLViewerAssetType::AT_LSL_BYTECODE, true, true, 0);
- s1.recordGetServiced(LLViewerAssetType::AT_LSL_BYTECODE, true, true, 0);
-
- s2.setRegion(region1_handle);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- {
- s2.merge(s1);
-
- LLSD src = s1.asLLSD(false);
- LLSD dst = s2.asLLSD(false);
-
- ensure_equals("merge src has single region", src["regions"].size(), 1);
- ensure_equals("merge dst has single region", dst["regions"].size(), 1);
-
- // Remove time stamps, they're a problem
- src.erase("duration");
- src["regions"][0].erase("duration");
- dst.erase("duration");
- dst["regions"][0].erase("duration");
-
- LLSD s2_llsd = get_region(dst, region1_handle);
- ensure("Region1 is present in dst", s2_llsd.isMap());
-
- ensure_equals("dst counts come from src only", s2_llsd["get_other"]["resp_count"].asInteger(), 3);
-
- ensure_approximately_equals("dst maximum with count 0 does not contribute to merged maximum",
- s2_llsd["get_other"]["resp_max"].asReal(), F64(0.0), 20);
- }
-
- // Other way around
- s1.setRegion(region1_handle);
- s2.setRegion(region1_handle);
- s1.reset();
- s2.reset();
-
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- // Want to test negative numbers here but have to work in U64
- s1.recordGetServiced(LLViewerAssetType::AT_LSL_BYTECODE, true, true, 0);
- s1.recordGetServiced(LLViewerAssetType::AT_LSL_BYTECODE, true, true, 0);
- s1.recordGetServiced(LLViewerAssetType::AT_LSL_BYTECODE, true, true, 0);
-
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- {
- s1.merge(s2);
-
- LLSD src = s2.asLLSD(false);
- LLSD dst = s1.asLLSD(false);
-
- ensure_equals("merge src has single region", src["regions"].size(), 1);
- ensure_equals("merge dst has single region", dst["regions"].size(), 1);
-
- // Remove time stamps, they're a problem
- src.erase("duration");
- src["regions"][0].erase("duration");
- dst.erase("duration");
- dst["regions"][0].erase("duration");
-
- LLSD s2_llsd = get_region(dst, region1_handle);
- ensure("Region1 is present in dst", s2_llsd.isMap());
-
- ensure_equals("dst counts come from src only (flipped)", s2_llsd["get_other"]["resp_count"].asInteger(), 3);
-
- ensure_approximately_equals("dst maximum with count 0 does not contribute to merged maximum (flipped)",
- s2_llsd["get_other"]["resp_max"].asReal(), F64(0.0), 20);
- }
- }
-
- // Minimum merges are interesting when one side contributes nothing
- template<> template<>
- void tst_viewerassetstats_index_object_t::test<12>()
- {
- LLViewerAssetStats s1;
- LLViewerAssetStats s2;
-
- s1.setRegion(region1_handle);
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- s1.recordGetServiced(LLViewerAssetType::AT_LSL_BYTECODE, true, true, 3800000);
- s1.recordGetServiced(LLViewerAssetType::AT_LSL_BYTECODE, true, true, 2700000);
- s1.recordGetServiced(LLViewerAssetType::AT_LSL_BYTECODE, true, true, 2900000);
-
- s2.setRegion(region1_handle);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- {
- s2.merge(s1);
-
- LLSD src = s1.asLLSD(false);
- LLSD dst = s2.asLLSD(false);
-
- ensure_equals("merge src has single region", src["regions"].size(), 1);
- ensure_equals("merge dst has single region", dst["regions"].size(), 1);
-
- // Remove time stamps, they're a problem
- src.erase("duration");
- src["regions"][0].erase("duration");
- dst.erase("duration");
- dst["regions"][0].erase("duration");
-
- LLSD s2_llsd = get_region(dst, region1_handle);
- ensure("Region1 is present in dst", s2_llsd.isMap());
-
- ensure_equals("dst counts come from src only", s2_llsd["get_other"]["resp_count"].asInteger(), 3);
-
- ensure_approximately_equals("dst minimum with count 0 does not contribute to merged minimum",
- s2_llsd["get_other"]["resp_min"].asReal(), F64(2.7), 20);
- }
-
- // Other way around
- s1.setRegion(region1_handle);
- s2.setRegion(region1_handle);
- s1.reset();
- s2.reset();
-
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s1.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- s1.recordGetServiced(LLViewerAssetType::AT_LSL_BYTECODE, true, true, 3800000);
- s1.recordGetServiced(LLViewerAssetType::AT_LSL_BYTECODE, true, true, 2700000);
- s1.recordGetServiced(LLViewerAssetType::AT_LSL_BYTECODE, true, true, 2900000);
-
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetEnqueued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
- s2.recordGetDequeued(LLViewerAssetType::AT_LSL_BYTECODE, true, true);
-
- {
- s1.merge(s2);
-
- LLSD src = s2.asLLSD(false);
- LLSD dst = s1.asLLSD(false);
-
- ensure_equals("merge src has single region", src["regions"].size(), 1);
- ensure_equals("merge dst has single region", dst["regions"].size(), 1);
-
- // Remove time stamps, they're a problem
- src.erase("duration");
- src["regions"][0].erase("duration");
- dst.erase("duration");
- dst["regions"][0].erase("duration");
-
- LLSD s2_llsd = get_region(dst, region1_handle);
- ensure("Region1 is present in dst", s2_llsd.isMap());
-
- ensure_equals("dst counts come from src only (flipped)", s2_llsd["get_other"]["resp_count"].asInteger(), 3);
-
- ensure_approximately_equals("dst minimum with count 0 does not contribute to merged minimum (flipped)",
- s2_llsd["get_other"]["resp_min"].asReal(), F64(2.7), 20);
- }
- }
-
}
diff --git a/indra/newview/tests/llxmlrpclistener_test.cpp b/indra/newview/tests/llxmlrpclistener_test.cpp
index 20f913b670..6e9756e7d5 100755
--- a/indra/newview/tests/llxmlrpclistener_test.cpp
+++ b/indra/newview/tests/llxmlrpclistener_test.cpp
@@ -85,7 +85,7 @@ namespace tut
void object::test<1>()
{
set_test_name("request validation");
- WrapLL_ERRS capture;
+ WrapLLErrs capture;
LLSD request;
request["uri"] = uri;
std::string threw;
@@ -93,7 +93,7 @@ namespace tut
{
pumps.obtain("LLXMLRPCTransaction").post(request);
}
- catch (const WrapLL_ERRS::FatalException& e)
+ catch (const WrapLLErrs::FatalException& e)
{
threw = e.what();
}
@@ -106,7 +106,7 @@ namespace tut
void object::test<2>()
{
set_test_name("param types validation");
- WrapLL_ERRS capture;
+ WrapLLErrs capture;
LLSD request;
request["uri"] = uri;
request["method"] = "hello";
@@ -118,7 +118,7 @@ namespace tut
{
pumps.obtain("LLXMLRPCTransaction").post(request);
}
- catch (const WrapLL_ERRS::FatalException& e)
+ catch (const WrapLLErrs::FatalException& e)
{
threw = e.what();
}
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index f7b3a45e8d..7544fe1c41 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -98,6 +98,9 @@ class ViewerManifest(LLManifest):
# ... and the entire windlight directory
self.path("windlight")
+ # ... and the entire image filters directory
+ self.path("filters")
+
# ... and the included spell checking dictionaries
pkgdir = os.path.join(self.args['build'], os.pardir, 'packages')
if self.prefix(src=pkgdir,dst=""):
@@ -795,15 +798,42 @@ class Darwin_i386_Manifest(ViewerManifest):
for libfile in dylibs:
symlinkf(os.path.join(os.pardir, os.pardir, os.pardir, libfile),
os.path.join(resource_path, libfile))
-
- # plugins
+ # SLPlugin.app/Contents/Resources gets those Qt4 libraries it needs.
+ if self.prefix(src="", dst="SLPlugin.app/Contents/Resources"):
+ for libfile in ('libQtCore.4.dylib',
+ 'libQtCore.4.7.1.dylib',
+ 'libQtGui.4.dylib',
+ 'libQtGui.4.7.1.dylib',
+ 'libQtNetwork.4.dylib',
+ 'libQtNetwork.4.7.1.dylib',
+ 'libQtOpenGL.4.dylib',
+ 'libQtOpenGL.4.7.1.dylib',
+ 'libQtSvg.4.dylib',
+ 'libQtSvg.4.7.1.dylib',
+ 'libQtWebKit.4.dylib',
+ 'libQtWebKit.4.7.1.dylib',
+ 'libQtXml.4.dylib',
+ 'libQtXml.4.7.1.dylib'):
+ self.path2basename("../packages/lib/release", libfile)
+ self.end_prefix("SLPlugin.app/Contents/Resources")
+
+ # Qt4 codecs go to llplugin. Not certain why but this is the first
+ # location probed according to dtruss so we'll go with that.
+ if self.prefix(src="../packages/plugins/codecs/", dst="llplugin/codecs"):
+ self.path("libq*.dylib")
+ self.end_prefix("llplugin/codecs")
+
+ # Similarly for imageformats.
+ if self.prefix(src="../packages/plugins/imageformats/", dst="llplugin/imageformats"):
+ self.path("libq*.dylib")
+ self.end_prefix("llplugin/imageformats")
+
+ # SLPlugin plugins proper
if self.prefix(src="", dst="llplugin"):
self.path2basename("../media_plugins/quicktime/" + self.args['configuration'],
"media_plugin_quicktime.dylib")
self.path2basename("../media_plugins/webkit/" + self.args['configuration'],
"media_plugin_webkit.dylib")
- self.path2basename("../packages/lib/release", "libllqtwebkit.dylib")
-
self.end_prefix("llplugin")
self.end_prefix("Resources")
@@ -1008,6 +1038,7 @@ class LinuxManifest(ViewerManifest):
self.path("../media_plugins/gstreamer010/libmedia_plugin_gstreamer010.so", "libmedia_plugin_gstreamer.so")
self.end_prefix("bin/llplugin")
+ # llcommon
if not self.path("../llcommon/libllcommon.so", "lib/libllcommon.so"):
print "Skipping llcommon.so (assuming llcommon was linked statically)"
@@ -1073,20 +1104,9 @@ class Linux_i686_Manifest(LinuxManifest):
self.path("libaprutil-1.so")
self.path("libaprutil-1.so.0")
self.path("libaprutil-1.so.0.4.1")
- self.path("libboost_context-mt.so.*")
- self.path("libboost_filesystem-mt.so.*")
- self.path("libboost_program_options-mt.so.*")
- self.path("libboost_regex-mt.so.*")
- self.path("libboost_signals-mt.so.*")
- self.path("libboost_system-mt.so.*")
- self.path("libboost_thread-mt.so.*")
- self.path("libcollada14dom.so")
self.path("libdb*.so")
- self.path("libcrypto.so.*")
self.path("libexpat.so.*")
- self.path("libssl.so.1.0.0")
self.path("libGLOD.so")
- self.path("libminizip.so")
self.path("libuuid.so*")
self.path("libSDL-1.2.so.*")
self.path("libdirectfb-1.*.so.*")
@@ -1118,6 +1138,10 @@ class Linux_i686_Manifest(LinuxManifest):
# previous call did, without having to explicitly state the
# version number.
self.path("libfontconfig.so.*.*")
+
+ # Include libfreetype.so. but have it work as libfontconfig does.
+ self.path("libfreetype.so.*.*")
+
try:
self.path("libtcmalloc.so*") #formerly called google perf tools
pass
@@ -1126,26 +1150,55 @@ class Linux_i686_Manifest(LinuxManifest):
pass
try:
- self.path("libfmodex-*.so")
- self.path("libfmodex.so")
- pass
+ self.path("libfmodex-*.so")
+ self.path("libfmodex.so")
+ pass
except:
- print "Skipping libfmodex.so - not found"
- pass
+ print "Skipping libfmodex.so - not found"
+ pass
self.end_prefix("lib")
# Vivox runtimes
if self.prefix(src="../packages/lib/release", dst="bin"):
- self.path("SLVoice")
- self.end_prefix()
+ self.path("SLVoice")
+ self.end_prefix()
+ if self.prefix(src="../packages/lib/release", dst="lib"):
+ self.path("libortp.so")
+ self.path("libsndfile.so.1")
+ #self.path("libvivoxoal.so.1") # no - we'll re-use the viewer's own OpenAL lib
+ self.path("libvivoxsdk.so")
+ self.path("libvivoxplatform.so")
+ self.end_prefix("lib")
+
+ # plugin runtime
if self.prefix(src="../packages/lib/release", dst="lib"):
- self.path("libortp.so")
- self.path("libsndfile.so.1")
- #self.path("libvivoxoal.so.1") # no - we'll re-use the viewer's own OpenAL lib
- self.path("libvivoxsdk.so")
- self.path("libvivoxplatform.so")
- self.end_prefix("lib")
+ self.path("libQtCore.so*")
+ self.path("libQtGui.so*")
+ self.path("libQtNetwork.so*")
+ self.path("libQtOpenGL.so*")
+ self.path("libQtSvg.so*")
+ self.path("libQtWebKit.so*")
+ self.path("libQtXml.so*")
+ self.end_prefix("lib")
+
+ # For WebKit/Qt plugin runtimes (image format plugins)
+ if self.prefix(src="../packages/plugins/imageformats", dst="bin/llplugin/imageformats"):
+ self.path("libqgif.so")
+ self.path("libqico.so")
+ self.path("libqjpeg.so")
+ self.path("libqmng.so")
+ self.path("libqsvg.so")
+ self.path("libqtiff.so")
+ self.end_prefix("bin/llplugin/imageformats")
+
+ # For WebKit/Qt plugin runtimes (codec/character encoding plugins)
+ if self.prefix(src="../packages/plugins/codecs", dst="bin/llplugin/codecs"):
+ self.path("libqcncodecs.so")
+ self.path("libqjpcodecs.so")
+ self.path("libqkrcodecs.so")
+ self.path("libqtwcodecs.so")
+ self.end_prefix("bin/llplugin/codecs")
self.strip_binaries()
diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt
index 31e1d89c68..62b1d9db62 100755
--- a/indra/test/CMakeLists.txt
+++ b/indra/test/CMakeLists.txt
@@ -56,7 +56,6 @@ set(test_SOURCE_FILES
llstreamtools_tut.cpp
lltemplatemessagebuilder_tut.cpp
lltut.cpp
- lluuidhashmap_tut.cpp
message_tut.cpp
test.cpp
)
diff --git a/indra/test/io.cpp b/indra/test/io.cpp
index e776a2a3be..97726c2b92 100755
--- a/indra/test/io.cpp
+++ b/indra/test/io.cpp
@@ -44,6 +44,7 @@
#include "llsdrpcclient.h"
#include "llsdrpcserver.h"
#include "llsdserialize.h"
+#include "llcommon.h"
#include "lluuid.h"
#include "llinstantmessage.h"
@@ -876,11 +877,11 @@ namespace tut
public:
double_construct()
{
- llinfos << "constructed" << llendl;
+ LL_INFOS() << "constructed" << LL_ENDL;
}
~double_construct()
{
- llinfos << "destroyed" << llendl;
+ LL_INFOS() << "destroyed" << LL_ENDL;
}
};
typedef test_group<double_construct> double_construct_test_group;
@@ -937,11 +938,11 @@ namespace tut
template<> template<>
void fitness_test_object::test<1>()
{
- lldebugs << "fitness_test_object::test<1>()" << llendl;
+ LL_DEBUGS() << "fitness_test_object::test<1>()" << LL_ENDL;
// Set up the server
- //lldebugs << "fitness_test_object::test<1> - setting up server."
- // << llendl;
+ //LL_DEBUGS() << "fitness_test_object::test<1> - setting up server."
+ // << LL_ENDL;
LLPumpIO::chain_t chain;
typedef LLCloneIOFactory<LLPipeStringInjector> emitter_t;
emitter_t* emitter = new emitter_t(
@@ -956,18 +957,18 @@ namespace tut
mPump->addChain(chain, NEVER_CHAIN_EXPIRY_SECS);
// We need to tickle the pump a little to set up the listen()
- //lldebugs << "fitness_test_object::test<1> - initializing server."
- // << llendl;
+ //LL_DEBUGS() << "fitness_test_object::test<1> - initializing server."
+ // << LL_ENDL;
pump_loop(mPump, 0.1f);
// Set up the client
- //lldebugs << "fitness_test_object::test<1> - connecting client."
- // << llendl;
+ //LL_DEBUGS() << "fitness_test_object::test<1> - connecting client."
+ // << LL_ENDL;
LLSocket::ptr_t client = LLSocket::create(mPool, LLSocket::STREAM_TCP);
LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT);
bool connected = client->blockingConnect(server_host);
ensure("Connected to server", connected);
- lldebugs << "connected" << llendl;
+ LL_DEBUGS() << "connected" << LL_ENDL;
// We have connected, since the socket reader does not block,
// the first call to read data will return EAGAIN, so we need
@@ -987,7 +988,7 @@ namespace tut
template<> template<>
void fitness_test_object::test<2>()
{
- lldebugs << "fitness_test_object::test<2>()" << llendl;
+ LL_DEBUGS() << "fitness_test_object::test<2>()" << LL_ENDL;
// Set up the server
LLPumpIO::chain_t chain;
@@ -1010,7 +1011,7 @@ namespace tut
LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT);
bool connected = client->blockingConnect(server_host);
ensure("Connected to server", connected);
- lldebugs << "connected" << llendl;
+ LL_DEBUGS() << "connected" << LL_ENDL;
// We have connected, since the socket reader does not block,
// the first call to read data will return EAGAIN, so we need
@@ -1030,7 +1031,7 @@ namespace tut
template<> template<>
void fitness_test_object::test<3>()
{
- lldebugs << "fitness_test_object::test<3>()" << llendl;
+ LL_DEBUGS() << "fitness_test_object::test<3>()" << LL_ENDL;
// Set up the server
LLPumpIO::chain_t chain;
@@ -1053,7 +1054,7 @@ namespace tut
LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT);
bool connected = client->blockingConnect(server_host);
ensure("Connected to server", connected);
- lldebugs << "connected" << llendl;
+ LL_DEBUGS() << "connected" << LL_ENDL;
// We have connected, since the socket reader does not block,
// the first call to read data will return EAGAIN, so we need
@@ -1073,7 +1074,7 @@ namespace tut
template<> template<>
void fitness_test_object::test<4>()
{
- lldebugs << "fitness_test_object::test<4>()" << llendl;
+ LL_DEBUGS() << "fitness_test_object::test<4>()" << LL_ENDL;
// Set up the server
LLPumpIO::chain_t chain;
@@ -1096,7 +1097,7 @@ namespace tut
LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT);
bool connected = client->blockingConnect(server_host);
ensure("Connected to server", connected);
- lldebugs << "connected" << llendl;
+ LL_DEBUGS() << "connected" << LL_ENDL;
// We have connected, since the socket reader does not block,
// the first call to read data will return EAGAIN, so we need
@@ -1132,18 +1133,18 @@ namespace tut
pump_loop(mPump, 0.1f);
U32 count = mPump->runningChains();
ensure_equals("server chain onboard", count, 1);
- lldebugs << "** Server is up." << llendl;
+ LL_DEBUGS() << "** Server is up." << LL_ENDL;
// Set up the client
LLSocket::ptr_t client = LLSocket::create(mPool, LLSocket::STREAM_TCP);
LLHost server_host("127.0.0.1", SERVER_LISTEN_PORT);
bool connected = client->blockingConnect(server_host);
ensure("Connected to server", connected);
- lldebugs << "connected" << llendl;
+ LL_DEBUGS() << "connected" << LL_ENDL;
pump_loop(mPump,0.1f);
count = mPump->runningChains();
ensure_equals("server chain onboard", count, 2);
- lldebugs << "** Client is connected." << llendl;
+ LL_DEBUGS() << "** Client is connected." << LL_ENDL;
// We have connected, since the socket reader does not block,
// the first call to read data will return EAGAIN, so we need
@@ -1159,20 +1160,20 @@ namespace tut
pump_loop(mPump,0.1f);
count = mPump->runningChains();
// ensure_equals("client chain onboard", count, 3); commented out because it fails frequently - appears to be timing sensitive
- lldebugs << "** request should have been sent." << llendl;
+ LL_DEBUGS() << "** request should have been sent." << LL_ENDL;
// pump for long enough the the client socket closes, and the
// server socket should not be closed yet.
pump_loop(mPump,0.2f);
count = mPump->runningChains();
ensure_equals("client chain timed out ", count, 2);
- lldebugs << "** client chain should be closed." << llendl;
+ LL_DEBUGS() << "** client chain should be closed." << LL_ENDL;
// At this point, the socket should be closed by the timeout
pump_loop(mPump,1.0f);
count = mPump->runningChains();
ensure_equals("accepted socked close", count, 1);
- lldebugs << "** Sleeper should have timed out.." << llendl;
+ LL_DEBUGS() << "** Sleeper should have timed out.." << LL_ENDL;
}
}
@@ -1187,7 +1188,9 @@ namespace tut
mResponsePtr(response)
{
}
- ~LLSimpleRPCResponse() {}
+ ~LLSimpleRPCResponse()
+ {
+ }
virtual bool response(LLPumpIO* pump)
{
*mResponsePtr = mReturnValue;
@@ -1302,8 +1305,8 @@ namespace tut
LLSD request;
request = 1;
pump_loop(request);
- //llinfos << "request: " << *request << llendl;
- //llinfos << "response: " << *mResponse << llendl;
+ //LL_INFOS() << "request: " << *request << LL_ENDL;
+ //LL_INFOS() << "response: " << *mResponse << LL_ENDL;
ensure_equals("integer request response", mResponse.asInteger(), 1);
}
@@ -1556,7 +1559,7 @@ namespace tut
mResponse->getString(actual);
if(actual != expected)
{
- //llwarns << "iteration " << i << llendl;
+ //LL_WARNS() << "iteration " << i << LL_ENDL;
std::ostringstream e_str;
std::string::iterator iter = expected.begin();
std::string::iterator end = expected.end();
@@ -1566,8 +1569,8 @@ namespace tut
}
e_str << std::endl;
llsd_serialize_string(e_str, expected);
- llwarns << "expected size: " << expected.size() << llendl;
- llwarns << "expected: " << e_str.str() << llendl;
+ LL_WARNS() << "expected size: " << expected.size() << LL_ENDL;
+ LL_WARNS() << "expected: " << e_str.str() << LL_ENDL;
std::ostringstream a_str;
iter = actual.begin();
@@ -1578,8 +1581,8 @@ namespace tut
}
a_str << std::endl;
llsd_serialize_string(a_str, actual);
- llwarns << "actual size: " << actual.size() << llendl;
- llwarns << "actual: " << a_str.str() << llendl;
+ LL_WARNS() << "actual size: " << actual.size() << LL_ENDL;
+ LL_WARNS() << "actual: " << a_str.str() << LL_ENDL;
}
ensure_equals("binary string request response", actual, expected);
delete request;
diff --git a/indra/test/llassetuploadqueue_tut.cpp b/indra/test/llassetuploadqueue_tut.cpp
index ec952e0058..25efe63d3f 100755
--- a/indra/test/llassetuploadqueue_tut.cpp
+++ b/indra/test/llassetuploadqueue_tut.cpp
@@ -45,11 +45,11 @@ LLAssetUploadResponder::~LLAssetUploadResponder()
{
}
-void LLAssetUploadResponder::error(U32 statusNum, const std::string& reason)
+void LLAssetUploadResponder::httpFailure()
{
}
-void LLAssetUploadResponder::result(const LLSD& content)
+void LLAssetUploadResponder::httpSuccess()
{
}
diff --git a/indra/test/llblowfish_tut.cpp b/indra/test/llblowfish_tut.cpp
index 2573cab81f..18eb01363f 100755
--- a/indra/test/llblowfish_tut.cpp
+++ b/indra/test/llblowfish_tut.cpp
@@ -65,14 +65,14 @@ namespace tut
}
if (!fp)
{
- llwarns << "unabled to open " << filename << llendl;
+ LL_WARNS() << "unable to open " << filename << LL_ENDL;
return false;
}
std::string good;
good.resize(256);
size_t got = fread(&good[0], 1, 256, fp);
- lldebugs << "matchFile read " << got << llendl;
+ LL_DEBUGS() << "matchFile read " << got << LL_ENDL;
fclose(fp);
good.resize(got);
diff --git a/indra/test/lldatapacker_tut.cpp b/indra/test/lldatapacker_tut.cpp
index cf2b7870ef..b403660c13 100755
--- a/indra/test/lldatapacker_tut.cpp
+++ b/indra/test/lldatapacker_tut.cpp
@@ -349,7 +349,7 @@ namespace tut
LLFILE* fp = LLFile::fopen(TEST_FILE_NAME, "w+");
if(!fp)
{
- llerrs << "File couldnt be open" <<llendl;
+ LL_ERRS() << "File couldnt be open" << LL_ENDL;
return;
}
@@ -404,7 +404,7 @@ namespace tut
LLFILE* fp = LLFile::fopen(TEST_FILE_NAME,"w+");
if(!fp)
{
- llerrs << "File couldnt be open" <<llendl;
+ LL_ERRS() << "File couldnt be open" << LL_ENDL;
return;
}
diff --git a/indra/test/llhttpdate_tut.cpp b/indra/test/llhttpdate_tut.cpp
index 46684bb9dc..ecf734ee90 100755
--- a/indra/test/llhttpdate_tut.cpp
+++ b/indra/test/llhttpdate_tut.cpp
@@ -29,6 +29,7 @@
#include "lltut.h"
#include "lldate.h"
+#include "llcommon.h"
#include "llframetimer.h"
#include <time.h>
@@ -38,6 +39,12 @@ namespace tut
{
struct httpdate_data
{
+ httpdate_data()
+ {
+ }
+ ~httpdate_data()
+ {
+ }
LLDate some_date;
};
typedef test_group<httpdate_data> httpdate_test;
diff --git a/indra/test/llhttpnode_tut.cpp b/indra/test/llhttpnode_tut.cpp
index 216c59d766..c528a34129 100755
--- a/indra/test/llhttpnode_tut.cpp
+++ b/indra/test/llhttpnode_tut.cpp
@@ -44,7 +44,7 @@ namespace tut
std::ostringstream pathOutput;
bool addSlash = false;
- LLSD& remainder = mContext["request"]["remainder"];
+ LLSD& remainder = mContext[CONTEXT_REQUEST]["remainder"];
for (LLSD::array_const_iterator i = remainder.beginArray();
i != remainder.endArray();
++i)
@@ -81,6 +81,7 @@ namespace tut
void result(const LLSD& result) { mResult = result; }
void status(S32 code, const std::string& message) { }
void extendedResult(S32 code, const std::string& message, const LLSD& headers) { }
+ void extendedResult(S32 code, const LLSD& result, const LLSD& headers) { }
private:
Response() {;} // Must be accessed through LLPointer.
diff --git a/indra/test/lliohttpserver_tut.cpp b/indra/test/lliohttpserver_tut.cpp
index 2fdc455f45..1513446788 100755
--- a/indra/test/lliohttpserver_tut.cpp
+++ b/indra/test/lliohttpserver_tut.cpp
@@ -31,6 +31,7 @@
#include "lliohttpserver.h"
#include "llsdhttpserver.h"
#include "llsdserialize.h"
+#include "llcommon.h"
#include "llpipeutil.h"
@@ -81,6 +82,10 @@ namespace tut
mRoot.addNode("/delayed/echo", new DelayedEcho(this));
mRoot.addNode("/wire/hello", new LLHTTPNodeForPipe<WireHello>);
}
+
+ ~HTTPServiceTestData()
+ {
+ }
LLHTTPNode mRoot;
LLHTTPNode::ResponsePtr mResponse;
@@ -316,8 +321,8 @@ namespace tut
stream << "<integer>42</integer>";
}
stream << "</array></llsd>";
- llinfos << "HTTPServiceTestObject::test<7>"
- << stream.str().length() << llendl;
+ LL_INFOS() << "HTTPServiceTestObject::test<7>"
+ << stream.str().length() << LL_ENDL;
std::string result = httpPOST("web/echo", stream.str());
ensure_starts_with("large echo status", result, "HTTP/1.0 200 OK\r\n");
}
diff --git a/indra/test/llmessagetemplateparser_tut.cpp b/indra/test/llmessagetemplateparser_tut.cpp
index da6d229fb5..39f834a9fc 100755
--- a/indra/test/llmessagetemplateparser_tut.cpp
+++ b/indra/test/llmessagetemplateparser_tut.cpp
@@ -171,7 +171,7 @@ namespace tut
delete var;
- // *NOTE: the parsers call llerrs on invalid input, so we can't really
+ // *NOTE: the parsers call LL_ERRS() on invalid input, so we can't really
// test that :-(
}
diff --git a/indra/test/llpermissions_tut.cpp b/indra/test/llpermissions_tut.cpp
index bc2c87ba46..8d8d47a667 100755
--- a/indra/test/llpermissions_tut.cpp
+++ b/indra/test/llpermissions_tut.cpp
@@ -407,7 +407,7 @@ namespace tut
LLFILE* fp = LLFile::fopen("linden_file.dat","w+");
if(!fp)
{
- llerrs << "file couldn't be opened\n" << llendl;
+ LL_ERRS() << "file couldn't be opened\n" << LL_ENDL;
return;
}
LLPermissions perm,perm1;
@@ -430,7 +430,7 @@ namespace tut
fp = LLFile::fopen("linden_file.dat","r+");
if(!fp)
{
- llerrs << "file couldn't be opened\n" << llendl;
+ LL_ERRS() << "file couldn't be opened\n" << LL_ENDL;
return;
}
ensure("Permissions import failed", perm1.importFile(fp));
diff --git a/indra/test/llpipeutil.cpp b/indra/test/llpipeutil.cpp
index db76a370e0..bb706b58d5 100755
--- a/indra/test/llpipeutil.cpp
+++ b/indra/test/llpipeutil.cpp
@@ -170,13 +170,13 @@ LLIOPipe::EStatus LLIOSleeper::process_impl(
{
if(!mRespond)
{
- lldebugs << "LLIOSleeper::process_impl() sleeping." << llendl;
+ LL_DEBUGS() << "LLIOSleeper::process_impl() sleeping." << LL_ENDL;
mRespond = true;
static const F64 SLEEP_TIME = 2.0;
pump->sleepChain(SLEEP_TIME);
return STATUS_BREAK;
}
- lldebugs << "LLIOSleeper::process_impl() responding." << llendl;
+ LL_DEBUGS() << "LLIOSleeper::process_impl() responding." << LL_ENDL;
LLBufferStream ostr(channels, buffer.get());
ostr << "huh? sorry, I was sleeping." << std::endl;
return STATUS_DONE;
diff --git a/indra/test/llsaleinfo_tut.cpp b/indra/test/llsaleinfo_tut.cpp
index 2488af1d7f..5f4d9186a8 100755
--- a/indra/test/llsaleinfo_tut.cpp
+++ b/indra/test/llsaleinfo_tut.cpp
@@ -111,7 +111,7 @@ namespace tut
LLFILE* fp = LLFile::fopen("linden_file.dat","w+");
if(!fp)
{
- llerrs << "file could not be opened\n" << llendl;
+ LL_ERRS() << "file could not be opened\n" << LL_ENDL;
return;
}
@@ -128,7 +128,7 @@ namespace tut
if(!fp)
{
- llerrs << "file coudnt be opened\n" << llendl;
+ LL_ERRS() << "file coudnt be opened\n" << LL_ENDL;
return;
}
diff --git a/indra/test/llsd_new_tut.cpp b/indra/test/llsd_new_tut.cpp
index f928a1bad0..03df1d339b 100755
--- a/indra/test/llsd_new_tut.cpp
+++ b/indra/test/llsd_new_tut.cpp
@@ -93,6 +93,18 @@ namespace tut
ensure( s + " type", traits.checkType(actual));
ensure_equals( s + " value", traits.get(actual), expectedValue);
}
+
+ template<class T>
+ static void ensureTypeAndRefValue(const char* msg, const LLSD& actual,
+ const T& expectedValue)
+ {
+ LLSDTraits<const T&> traits;
+
+ std::string s(msg);
+
+ ensure( s + " type", traits.checkType(actual));
+ ensure_equals( s + " value", traits.get(actual), expectedValue);
+ }
};
typedef test_group<SDTestData> SDTestGroup;
@@ -162,7 +174,7 @@ namespace tut
std::vector<U8> data;
copy(&source[0], &source[sizeof(source)], back_inserter(data));
- v = data; ensureTypeAndValue("set to data", v, data);
+ v = data; ensureTypeAndRefValue("set to data", v, data);
v.clear();
ensure("reset to undefined", v.type() == LLSD::TypeUndefined);
@@ -213,8 +225,8 @@ namespace tut
const char source[] = "once in a blue moon";
std::vector<U8> data;
copy(&source[0], &source[sizeof(source)], back_inserter(data));
- LLSD x1(data); ensureTypeAndValue("construct vector<U8>", x1, data);
- LLSD x2 = data; ensureTypeAndValue("initialize vector<U8>", x2, data);
+ LLSD x1(data); ensureTypeAndRefValue("construct vector<U8>", x1, data);
+ LLSD x2 = data; ensureTypeAndRefValue("initialize vector<U8>", x2, data);
}
void checkConversions(const char* msg, const LLSD& v,
@@ -757,42 +769,6 @@ namespace tut
{
SDAllocationCheck check("shared values test for threaded work", 9);
- //U32 start_llsd_count = llsd::outstandingCount();
-
- LLSD m = LLSD::emptyMap();
-
- m["one"] = 1;
- m["two"] = 2;
- m["one_copy"] = m["one"]; // 3 (m, "one" and "two")
-
- m["undef_one"] = LLSD();
- m["undef_two"] = LLSD();
- m["undef_one_copy"] = m["undef_one"];
-
- { // Ensure first_array gets freed to avoid counting it
- LLSD first_array = LLSD::emptyArray();
- first_array.append(1.0f);
- first_array.append(2.0f);
- first_array.append(3.0f); // 7
-
- m["array"] = first_array;
- m["array_clone"] = first_array;
- m["array_copy"] = m["array"]; // 7
- }
-
- m["string_one"] = "string one value";
- m["string_two"] = "string two value";
- m["string_one_copy"] = m["string_one"]; // 9
-
- //U32 llsd_object_count = llsd::outstandingCount();
- //std::cout << "Using " << (llsd_object_count - start_llsd_count) << " LLSD objects" << std::endl;
-
- //m.dumpStats();
- }
-
- {
- SDAllocationCheck check("shared values test for threaded work", 9);
-
//U32 start_llsd_count = LLSD::outstandingCount();
LLSD m = LLSD::emptyMap();
@@ -852,3 +828,4 @@ namespace tut
test serializations
*/
}
+
diff --git a/indra/test/llsdmessagebuilder_tut.cpp b/indra/test/llsdmessagebuilder_tut.cpp
index be0692557a..b7283f53a6 100755
--- a/indra/test/llsdmessagebuilder_tut.cpp
+++ b/indra/test/llsdmessagebuilder_tut.cpp
@@ -649,7 +649,7 @@ namespace tut
template<> template<>
void LLSDMessageBuilderTestObject::test<37>()
{
- LLQuaternion data(1,2,3,0);
+ LLQuaternion data(0.3713907f, 0.5570861f, 0.7427813f,0.0f);
//we send a quaternion packed into a vec3 (w is infered) - so sizeof(vec) == 12 bytes not 16.
LLVector3 vec = data.packToVector3();
diff --git a/indra/test/llsdtraits.h b/indra/test/llsdtraits.h
index 8144aaee94..07f6193ce2 100755
--- a/indra/test/llsdtraits.h
+++ b/indra/test/llsdtraits.h
@@ -93,7 +93,7 @@ LLSDTraits<LLSD::URI>::LLSDTraits()
{ }
template<> inline
-LLSDTraits<LLSD::Binary>::LLSDTraits()
+LLSDTraits<const LLSD::Binary&>::LLSDTraits()
: type(LLSD::TypeBinary), getter(&LLSD::asBinary)
{ }
diff --git a/indra/test/lltemplatemessagebuilder_tut.cpp b/indra/test/lltemplatemessagebuilder_tut.cpp
index dde70f98c8..7b4b6a8b70 100755
--- a/indra/test/lltemplatemessagebuilder_tut.cpp
+++ b/indra/test/lltemplatemessagebuilder_tut.cpp
@@ -35,7 +35,6 @@
#include "llquaternion.h"
#include "lltemplatemessagebuilder.h"
#include "lltemplatemessagereader.h"
-#include "llversionserver.h"
#include "message_prehash.h"
#include "u64.h"
#include "v3dmath.h"
@@ -59,9 +58,9 @@ namespace tut
const F32 circuit_timeout=100;
start_messaging_system("notafile", 13035,
- LL_VERSION_MAJOR,
- LL_VERSION_MINOR,
- LL_VERSION_PATCH,
+ 1,
+ 0,
+ 0,
FALSE,
"notasharedsecret",
NULL,
@@ -320,7 +319,7 @@ namespace tut
{
LLMessageTemplate messageTemplate = defaultTemplate();
messageTemplate.addBlock(defaultBlock(MVT_LLQuaternion, 12));
- LLQuaternion outValue, inValue = LLQuaternion(1,2,3,0);
+ LLQuaternion outValue, inValue = LLQuaternion(0.3713907f, 0.5570861f, 0.7427813f,0.0f);
LLTemplateMessageBuilder* builder = defaultBuilder(messageTemplate);
builder->addQuat(_PREHASH_Test0, inValue);
LLTemplateMessageReader* reader = setReader(messageTemplate, builder);
@@ -787,7 +786,7 @@ namespace tut
{
LLMessageTemplate messageTemplate = defaultTemplate();
messageTemplate.addBlock(defaultBlock(MVT_LLQuaternion, 12));
- LLQuaternion outValue, inValue = LLQuaternion(1,2,3,0);
+ LLQuaternion outValue, inValue = LLQuaternion(0.3713907f, 0.5570861f, 0.7427813f,0.0f);
LLTemplateMessageBuilder* builder = defaultBuilder(messageTemplate);
builder->addQuat(_PREHASH_Test0, inValue);
LLTemplateMessageReader* reader = setReader(
diff --git a/indra/test/lltut.h b/indra/test/lltut.h
index 55d84bcaca..243e869be7 100755
--- a/indra/test/lltut.h
+++ b/indra/test/lltut.h
@@ -65,6 +65,16 @@ namespace tut
ensure_approximately_equals(NULL, actual, expected, frac_bits);
}
+ inline void ensure_approximately_equals_range(const char *msg, F32 actual, F32 expected, F32 delta)
+ {
+ if (fabs(actual-expected)>delta)
+ {
+ std::stringstream ss;
+ ss << (msg?msg:"") << (msg?": ":"") << "not equal actual: " << actual << " expected: " << expected << " tolerance: " << delta;
+ throw tut::failure(ss.str().c_str());
+ }
+ }
+
inline void ensure_memory_matches(const char* msg,const void* actual, U32 actual_len, const void* expected,U32 expected_len)
{
if((expected_len != actual_len) ||
diff --git a/indra/test/lluuidhashmap_tut.cpp b/indra/test/lluuidhashmap_tut.cpp
deleted file mode 100755
index 9712a613f4..0000000000
--- a/indra/test/lluuidhashmap_tut.cpp
+++ /dev/null
@@ -1,455 +0,0 @@
-/**
- * @file lluuidhashmap_tut.cpp
- * @author Adroit
- * @date 2007-02
- * @brief Test cases for LLUUIDHashMap
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include <tut/tut.hpp>
-#include "linden_common.h"
-#include "lluuidhashmap.h"
-#include "llsdserialize.h"
-#include "lldir.h"
-#include "stringize.h"
-#include <iostream>
-#include <fstream>
-
-namespace tut
-{
- class UUIDTableEntry
- {
- public:
- UUIDTableEntry()
- {
- mID.setNull();
- mValue = 0;
- }
-
- UUIDTableEntry(const LLUUID& id, U32 value)
- {
- mID = id;
- mValue = value;
- }
-
- ~UUIDTableEntry(){};
-
- static BOOL uuidEq(const LLUUID &uuid, const UUIDTableEntry &id_pair)
- {
- if (uuid == id_pair.mID)
- {
- return TRUE;
- }
- return FALSE;
- }
-
- const LLUUID& getID() { return mID; }
- const U32& getValue() { return mValue; }
-
- protected:
- LLUUID mID;
- U32 mValue;
- };
-
- struct hashmap_test
- {
- };
-
- typedef test_group<hashmap_test> hash_index_t;
- typedef hash_index_t::object hash_index_object_t;
- tut::hash_index_t tut_hash_index("hashmap_test");
-
- // stress test
- template<> template<>
- void hash_index_object_t::test<1>()
- {
- set_test_name("stress test");
- // As of 2012-10-10, I (nat) have observed sporadic failures of this
- // test: "set/get did not work." The trouble is that since test data
- // are randomly generated with every run, it is impossible to debug a
- // test failure. One is left with the uneasy suspicion that
- // LLUUID::generate() can sometimes produce duplicates even within the
- // moderately small number requested here. Since rerunning the test
- // generally allows it to pass, it's too easy to shrug and forget it.
- // The following code is intended to support reproducing such test
- // failures. The idea is that, on test failure, we save the generated
- // data to a canonical filename in a temp directory. Then on every
- // subsequent run, we check for that filename. If it exists, we reload
- // that specific data rather than generating fresh data -- which
- // should presumably reproduce the same test failure. But we inform
- // the user that to resume normal (random) test runs, s/he need only
- // delete that file. And since it's in a temp directory, sooner or
- // later the system will clean it up anyway.
- const char* tempvar = "TEMP";
- const char* tempdir = getenv(tempvar); // Windows convention
- if (! tempdir)
- {
- tempvar = "TMPDIR";
- tempdir = getenv(tempvar); // Mac convention
- }
- if (! tempdir)
- {
- // reset tempvar to the first var we check; it's just a
- // recommendation
- tempvar = "TEMP";
- tempdir = "/tmp"; // Posix in general
- }
- std::string savefile(gDirUtilp->add(tempdir, "lluuidhashmap_tut.save.txt"));
- const int numElementsToCheck = 32*256*32;
- std::vector<LLUUID> idList;
- if ((! getenv("TEAMCITY_PROJECT_NAME")) && gDirUtilp->fileExists(savefile))
- {
- // This is not a TeamCity build, and we have saved data from a
- // previous failed run. Reload that data.
- std::ifstream inf(savefile.c_str());
- if (! inf.is_open())
- {
- fail(STRINGIZE("Although save file '" << savefile << "' exists, it cannot be opened"));
- }
- std::string item;
- while (std::getline(inf, item))
- {
- idList.push_back(LLUUID(item));
- }
- std::cout << "Reloaded " << idList.size() << " items from '" << savefile << "'";
- if (idList.size() != numElementsToCheck)
- {
- std::cout << " (expected " << numElementsToCheck << ")";
- }
- std::cout << " -- delete this file to generate new data" << std::endl;
- }
- else
- {
- // This is a TeamCity build, or (normal case) savefile does not
- // exist: regenerate idList from scratch.
- for (int i = 0; i < numElementsToCheck; ++i)
- {
- LLUUID id;
- id.generate();
- idList.push_back(id);
- }
- }
-
- LLUUIDHashMap<UUIDTableEntry, 32> hashTable(UUIDTableEntry::uuidEq, UUIDTableEntry());
- int i;
-
- for (i = 0; i < idList.size(); ++i)
- {
- UUIDTableEntry entry(idList[i], i);
- hashTable.set(idList[i], entry);
- }
-
- try
- {
- for (i = 0; i < idList.size(); i++)
- {
- LLUUID idToCheck = idList[i];
- UUIDTableEntry entryToCheck = hashTable.get(idToCheck);
- ensure_equals(STRINGIZE("set/get ID (entry " << i << ")").c_str(),
- entryToCheck.getID(), idToCheck);
- ensure_equals(STRINGIZE("set/get value (ID " << idToCheck << ")").c_str(),
- entryToCheck.getValue(), (size_t)i);
- }
-
- for (i = 0; i < idList.size(); i++)
- {
- LLUUID idToCheck = idList[i];
- if (i % 2 != 0)
- {
- hashTable.remove(idToCheck);
- }
- }
-
- for (i = 0; i < idList.size(); i++)
- {
- LLUUID idToCheck = idList[i];
- ensure("remove or check did not work", (i % 2 == 0 && hashTable.check(idToCheck)) || (i % 2 != 0 && !hashTable.check(idToCheck)));
- }
- }
- catch (const failure&)
- {
- // One of the above tests failed. Try to save idList to repro with
- // a later run.
- std::ofstream outf(savefile.c_str());
- if (! outf.is_open())
- {
- // Sigh, don't use fail() here because we want to preserve
- // the original test failure.
- std::cout << "Cannot open file '" << savefile
- << "' to save data -- check and fix " << tempvar << std::endl;
- }
- else
- {
- // outf.is_open()
- for (int i = 0; i < idList.size(); ++i)
- {
- outf << idList[i] << std::endl;
- }
- std::cout << "Saved " << idList.size() << " entries to '" << savefile
- << "' -- rerun test to debug with these" << std::endl;
- }
- // re-raise the same exception -- we WANT this test failure to
- // be reported! We just needed to save the data on the way out.
- throw;
- }
- }
-
- // test removing all but one element.
- template<> template<>
- void hash_index_object_t::test<2>()
- {
- LLUUIDHashMap<UUIDTableEntry, 2> hashTable(UUIDTableEntry::uuidEq, UUIDTableEntry());
- const int numElementsToCheck = 5;
- std::vector<LLUUID> idList(numElementsToCheck*10);
- int i;
-
- for (i = 0; i < numElementsToCheck; i++)
- {
- LLUUID id;
- id.generate();
- UUIDTableEntry entry(id, i);
- hashTable.set(id, entry);
- idList[i] = id;
- }
-
- ensure("getLength failed", hashTable.getLength() == numElementsToCheck);
-
- // remove all but the last element
- for (i = 0; i < numElementsToCheck-1; i++)
- {
- LLUUID idToCheck = idList[i];
- hashTable.remove(idToCheck);
- }
-
- // there should only be one element left now.
- ensure("getLength failed", hashTable.getLength() == 1);
-
- for (i = 0; i < numElementsToCheck; i++)
- {
- LLUUID idToCheck = idList[i];
- if (i != numElementsToCheck - 1)
- {
- ensure("remove did not work", hashTable.check(idToCheck) == FALSE);
- }
- else
- {
- UUIDTableEntry entryToCheck = hashTable.get(idToCheck);
- ensure("remove did not work", entryToCheck.getID() == idToCheck && entryToCheck.getValue() == (size_t)i);
- }
- }
- }
-
- // test overriding of value already set.
- template<> template<>
- void hash_index_object_t::test<3>()
- {
- LLUUIDHashMap<UUIDTableEntry, 5> hashTable(UUIDTableEntry::uuidEq, UUIDTableEntry());
- const int numElementsToCheck = 10;
- std::vector<LLUUID> idList(numElementsToCheck);
- int i;
-
- for (i = 0; i < numElementsToCheck; i++)
- {
- LLUUID id;
- id.generate();
- UUIDTableEntry entry(id, i);
- hashTable.set(id, entry);
- idList[i] = id;
- }
-
- for (i = 0; i < numElementsToCheck; i++)
- {
- LLUUID id = idList[i];
- // set new entry with value = i+numElementsToCheck
- UUIDTableEntry entry(id, i+numElementsToCheck);
- hashTable.set(id, entry);
- }
-
- for (i = 0; i < numElementsToCheck; i++)
- {
- LLUUID idToCheck = idList[i];
- UUIDTableEntry entryToCheck = hashTable.get(idToCheck);
- ensure("set/get did not work", entryToCheck.getID() == idToCheck && entryToCheck.getValue() == (size_t)(i+numElementsToCheck));
- }
- }
-
- // test removeAll()
- template<> template<>
- void hash_index_object_t::test<4>()
- {
- LLUUIDHashMap<UUIDTableEntry, 5> hashTable(UUIDTableEntry::uuidEq, UUIDTableEntry());
- const int numElementsToCheck = 10;
- std::vector<LLUUID> idList(numElementsToCheck);
- int i;
-
- for (i = 0; i < numElementsToCheck; i++)
- {
- LLUUID id;
- id.generate();
- UUIDTableEntry entry(id, i);
- hashTable.set(id, entry);
- idList[i] = id;
- }
-
- hashTable.removeAll();
- ensure("removeAll failed", hashTable.getLength() == 0);
- }
-
-
- // test sparse map - force it by creating 256 entries that fall into 256 different nodes
- template<> template<>
- void hash_index_object_t::test<5>()
- {
- LLUUIDHashMap<UUIDTableEntry, 2> hashTable(UUIDTableEntry::uuidEq, UUIDTableEntry());
- const int numElementsToCheck = 256;
- std::vector<LLUUID> idList(numElementsToCheck);
- int i;
-
- for (i = 0; i < numElementsToCheck; i++)
- {
- LLUUID id;
- id.generate();
- // LLUUIDHashMap uses mData[0] to pick the bucket
- // overwrite mData[0] so that it ranges from 0 to 255
- id.mData[0] = i;
- UUIDTableEntry entry(id, i);
- hashTable.set(id, entry);
- idList[i] = id;
- }
-
- for (i = 0; i < numElementsToCheck; i++)
- {
- LLUUID idToCheck = idList[i];
- UUIDTableEntry entryToCheck = hashTable.get(idToCheck);
- ensure("set/get did not work for sparse map", entryToCheck.getID() == idToCheck && entryToCheck.getValue() == (size_t)i);
- }
-
- for (i = 0; i < numElementsToCheck; i++)
- {
- LLUUID idToCheck = idList[i];
- if (i % 2 != 0)
- {
- hashTable.remove(idToCheck);
- }
- }
-
- for (i = 0; i < numElementsToCheck; i++)
- {
- LLUUID idToCheck = idList[i];
- ensure("remove or check did not work for sparse map", (i % 2 == 0 && hashTable.check(idToCheck)) || (i % 2 != 0 && !hashTable.check(idToCheck)));
- }
- }
-
- // iterator
- template<> template<>
- void hash_index_object_t::test<6>()
- {
- LLUUIDHashMap<UUIDTableEntry, 2> hashTable(UUIDTableEntry::uuidEq, UUIDTableEntry());
- LLUUIDHashMapIter<UUIDTableEntry, 2> hashIter(&hashTable);
- const int numElementsToCheck = 256;
- std::vector<LLUUID> idList(numElementsToCheck);
- int i;
-
- for (i = 0; i < numElementsToCheck; i++)
- {
- LLUUID id;
- id.generate();
- // LLUUIDHashMap uses mData[0] to pick the bucket
- // overwrite mData[0] so that it ranges from 0 to 255
- // to create a sparse map
- id.mData[0] = i;
- UUIDTableEntry entry(id, i);
- hashTable.set(id, entry);
- idList[i] = id;
- }
-
- hashIter.first();
- int numElementsIterated = 0;
- while(!hashIter.done())
- {
- numElementsIterated++;
- UUIDTableEntry tableEntry = *hashIter;
- LLUUID id = tableEntry.getID();
- hashIter.next();
- ensure("Iteration failed for sparse map", tableEntry.getValue() < (size_t)numElementsToCheck && idList[tableEntry.getValue()] == tableEntry.getID());
- }
-
- ensure("iteration count failed", numElementsIterated == numElementsToCheck);
- }
-
- // remove after middle of iteration
- template<> template<>
- void hash_index_object_t::test<7>()
- {
- LLUUIDHashMap<UUIDTableEntry, 2> hashTable(UUIDTableEntry::uuidEq, UUIDTableEntry());
- LLUUIDHashMapIter<UUIDTableEntry, 2> hashIter(&hashTable);
- const int numElementsToCheck = 256;
- std::vector<LLUUID> idList(numElementsToCheck);
- int i;
-
- LLUUID uuidtoSearch;
- for (i = 0; i < numElementsToCheck; i++)
- {
- LLUUID id;
- id.generate();
- // LLUUIDHashMap uses mData[0] to pick the bucket
- // overwrite mData[0] so that it ranges from 0 to 255
- // to create a sparse map
- id.mData[0] = i;
- UUIDTableEntry entry(id, i);
- hashTable.set(id, entry);
- idList[i] = id;
-
- // pick uuid somewhere in the middle
- if (i == 5)
- {
- uuidtoSearch = id;
- }
- }
-
- hashIter.first();
- int numElementsIterated = 0;
- while(!hashIter.done())
- {
- numElementsIterated++;
- UUIDTableEntry tableEntry = *hashIter;
- LLUUID id = tableEntry.getID();
- if (uuidtoSearch == id)
- {
- break;
- }
- hashIter.next();
- }
-
- // current iterator implementation will not allow any remove operations
- // until ALL elements have been iterated over. this seems to be
- // an unnecessary restriction. Iterator should have a method to
- // reset() its state so that further operations (inckuding remove)
- // can be performed on the HashMap without having to iterate thru
- // all the remaining nodes.
-
-// hashIter.reset();
-// hashTable.remove(uuidtoSearch);
-// ensure("remove after iteration reset failed", hashTable.check(uuidtoSearch) == FALSE);
- }
-}
diff --git a/indra/test/manageapr.h b/indra/test/manageapr.h
deleted file mode 100755
index 2452fb6ae4..0000000000
--- a/indra/test/manageapr.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * @file manageapr.h
- * @author Nat Goodspeed
- * @date 2012-01-13
- * @brief ManageAPR class for simple test programs
- *
- * $LicenseInfo:firstyear=2012&license=viewerlgpl$
- * Copyright (c) 2012, Linden Research, Inc.
- * $/LicenseInfo$
- */
-
-#if ! defined(LL_MANAGEAPR_H)
-#define LL_MANAGEAPR_H
-
-#include "llapr.h"
-#include <boost/noncopyable.hpp>
-
-/**
- * Declare a static instance of this class for dead-simple ll_init_apr() at
- * program startup, ll_cleanup_apr() at termination. This is recommended for
- * use only with simple test programs. Once you start introducing static
- * instances of other classes that depend on APR already being initialized,
- * the indeterminate static-constructor-order problem rears its ugly head.
- */
-class ManageAPR: public boost::noncopyable
-{
-public:
- ManageAPR()
- {
- ll_init_apr();
- }
-
- ~ManageAPR()
- {
- ll_cleanup_apr();
- }
-
- static std::string strerror(apr_status_t rv)
- {
- char errbuf[256];
- apr_strerror(rv, errbuf, sizeof(errbuf));
- return errbuf;
- }
-};
-
-#endif /* ! defined(LL_MANAGEAPR_H) */
diff --git a/indra/test/message_tut.cpp b/indra/test/message_tut.cpp
index d971b33475..57e423e550 100755
--- a/indra/test/message_tut.cpp
+++ b/indra/test/message_tut.cpp
@@ -32,7 +32,6 @@
#include "llapr.h"
#include "llmessageconfig.h"
#include "llsdserialize.h"
-#include "llversionserver.h"
#include "message.h"
#include "message_prehash.h"
@@ -46,6 +45,7 @@ namespace
mStatus = code;
}
virtual void extendedResult(S32 code, const std::string& message, const LLSD& headers) { }
+ virtual void extendedResult(S32 code, const LLSD& result, const LLSD& headers) { }
S32 mStatus;
};
}
@@ -72,9 +72,9 @@ namespace tut
// currently test disconnected message system
start_messaging_system("notafile", 13035,
- LL_VERSION_MAJOR,
- LL_VERSION_MINOR,
- LL_VERSION_PATCH,
+ 1,
+ 0,
+ 0,
FALSE,
"notasharedsecret",
NULL,
@@ -142,7 +142,7 @@ namespace tut
const LLSD message;
const LLPointer<Response> response = new Response();
gMessageSystem->dispatch(name, message, response);
- ensure_equals(response->mStatus, 404);
+ ensure_equals(response->mStatus, HTTP_NOT_FOUND);
}
}
diff --git a/indra/test/mock_http_client.cpp b/indra/test/mock_http_client.cpp
index d7ef407d52..e72902bfc2 100755
--- a/indra/test/mock_http_client.cpp
+++ b/indra/test/mock_http_client.cpp
@@ -25,8 +25,7 @@
*/
#include "linden_common.h"
-#include "llsdhttpserver.h"
-#include "lliohttpserver.h"
+#include "llhttpnode.h"
namespace tut
{
diff --git a/indra/test/mock_http_client.h b/indra/test/mock_http_client.h
index 7668a43fdf..a2b9b435fb 100755
--- a/indra/test/mock_http_client.h
+++ b/indra/test/mock_http_client.h
@@ -98,7 +98,7 @@ namespace tut
if (mSawError)
{
std::string msg =
- llformat("error() called when not expected, status %d",
+ llformat("httpFailure() called when not expected, status %d",
mStatus);
fail(msg);
}
@@ -108,7 +108,7 @@ namespace tut
{
if (!mSawError)
{
- fail("error() wasn't called");
+ fail("httpFailure() wasn't called");
}
}
@@ -119,7 +119,7 @@ namespace tut
protected:
bool mSawError;
- U32 mStatus;
+ S32 mStatus;
std::string mReason;
bool mSawCompleted;
LLSD mResult;
@@ -144,23 +144,22 @@ namespace tut
mClient.mResultDeleted = true;
}
- virtual void error(U32 status, const std::string& reason)
+ protected:
+ virtual void httpFailure()
{
mClient.mSawError = true;
- mClient.mStatus = status;
- mClient.mReason = reason;
+ mClient.mStatus = getStatus();
+ mClient.mReason = getReason();
}
- virtual void result(const LLSD& content)
+ virtual void httpSuccess()
{
- mClient.mResult = content;
+ mClient.mResult = getContent();
}
- virtual void completed(
- U32 status, const std::string& reason,
- const LLSD& content)
+ virtual void httpCompleted()
{
- LLHTTPClient::Responder::completed(status, reason, content);
+ LLHTTPClient::Responder::httpCompleted();
mClient.mSawCompleted = true;
}
diff --git a/indra/test/test.cpp b/indra/test/test.cpp
index dc8580fe69..e42374d56b 100755
--- a/indra/test/test.cpp
+++ b/indra/test/test.cpp
@@ -40,6 +40,8 @@
#include "tests/wrapllerrs.h" // RecorderProxy
#include "stringize.h"
#include "namedtempfile.h"
+#include "lltrace.h"
+#include "lltracethreadrecorder.h"
#include "apr_pools.h"
#include "apr_getopt.h"
@@ -93,25 +95,20 @@ public:
virtual void replay(std::ostream&) {}
};
-class LLReplayLogReal: public LLReplayLog, public LLError::Recorder, public boost::noncopyable
+class RecordToTempFile : public LLError::Recorder, public boost::noncopyable
{
public:
- LLReplayLogReal(LLError::ELevel level, apr_pool_t* pool):
- mOldSettings(LLError::saveAndResetSettings()),
- mProxy(new RecorderProxy(this)),
- mTempFile("log", "", pool), // create file
- mFile(mTempFile.getName().c_str()) // open it
+ RecordToTempFile(apr_pool_t* pPool)
+ : LLError::Recorder(),
+ boost::noncopyable(),
+ mTempFile("log", "", pPool),
+ mFile(mTempFile.getName().c_str())
{
- LLError::setFatalFunction(wouldHaveCrashed);
- LLError::setDefaultLevel(level);
- LLError::addRecorder(mProxy);
}
- virtual ~LLReplayLogReal()
+ virtual ~RecordToTempFile()
{
- LLError::removeRecorder(mProxy);
- delete mProxy;
- LLError::restoreSettings(mOldSettings);
+ mFile.close();
}
virtual void recordMessage(LLError::ELevel level, const std::string& message)
@@ -119,13 +116,13 @@ public:
mFile << message << std::endl;
}
- virtual void reset()
+ void reset()
{
mFile.close();
mFile.open(mTempFile.getName().c_str());
}
- virtual void replay(std::ostream& out)
+ void replay(std::ostream& out)
{
mFile.close();
std::ifstream inf(mTempFile.getName().c_str());
@@ -137,12 +134,45 @@ public:
}
private:
- LLError::Settings* mOldSettings;
- LLError::Recorder* mProxy;
NamedTempFile mTempFile;
std::ofstream mFile;
};
+class LLReplayLogReal: public LLReplayLog, public boost::noncopyable
+{
+public:
+ LLReplayLogReal(LLError::ELevel level, apr_pool_t* pool)
+ : LLReplayLog(),
+ boost::noncopyable(),
+ mOldSettings(LLError::saveAndResetSettings()),
+ mRecorder(new RecordToTempFile(pool))
+ {
+ LLError::setFatalFunction(wouldHaveCrashed);
+ LLError::setDefaultLevel(level);
+ LLError::addRecorder(mRecorder);
+ }
+
+ virtual ~LLReplayLogReal()
+ {
+ LLError::removeRecorder(mRecorder);
+ LLError::restoreSettings(mOldSettings);
+ }
+
+ virtual void reset()
+ {
+ boost::dynamic_pointer_cast<RecordToTempFile>(mRecorder)->reset();
+ }
+
+ virtual void replay(std::ostream& out)
+ {
+ boost::dynamic_pointer_cast<RecordToTempFile>(mRecorder)->replay(out);
+ }
+
+private:
+ LLError::SettingsStoragePtr mOldSettings;
+ LLError::RecorderPtr mRecorder;
+};
+
class LLTestCallback : public tut::callback
{
public:
@@ -482,6 +512,8 @@ void wouldHaveCrashed(const std::string& message)
tut::fail("llerrs message: " + message);
}
+static LLTrace::ThreadRecorder* sMasterThreadRecorder = NULL;
+
int main(int argc, char **argv)
{
// The following line must be executed to initialize Google Mock
@@ -512,15 +544,15 @@ int main(int argc, char **argv)
ctype_workaround();
#endif
- apr_initialize();
- apr_pool_t* pool = NULL;
- if(APR_SUCCESS != apr_pool_create(&pool, NULL))
+ ll_init_apr();
+
+ if (!sMasterThreadRecorder)
{
- std::cerr << "Unable to initialize pool" << std::endl;
- return 1;
+ sMasterThreadRecorder = new LLTrace::ThreadRecorder();
+ LLTrace::set_master_thread_recorder(sMasterThreadRecorder);
}
apr_getopt_t* os = NULL;
- if(APR_SUCCESS != apr_getopt_init(&os, pool, argc, argv))
+ if(APR_SUCCESS != apr_getopt_init(&os, gAPRPoolp, argc, argv))
{
std::cerr << "apr_getopt_init() failed" << std::endl;
return 1;
@@ -602,7 +634,7 @@ int main(int argc, char **argv)
if (LOGFAIL)
{
LLError::ELevel level = LLError::decodeLevel(LOGFAIL);
- replayer.reset(new LLReplayLogReal(level, pool));
+ replayer.reset(new LLReplayLogReal(level, gAPRPoolp));
}
else
{
@@ -646,7 +678,7 @@ int main(int argc, char **argv)
s.close();
}
- apr_terminate();
+ ll_cleanup_apr();
int retval = (success ? 0 : 1);
return retval;
diff --git a/indra/test_apps/llfbconnecttest/CMakeLists.txt b/indra/test_apps/llfbconnecttest/CMakeLists.txt
index f56329a010..512bf202ae 100644
--- a/indra/test_apps/llfbconnecttest/CMakeLists.txt
+++ b/indra/test_apps/llfbconnecttest/CMakeLists.txt
@@ -122,32 +122,24 @@ add_custom_command(TARGET llfbconnecttest POST_BUILD
)
-if (DARWIN OR WINDOWS)
- get_target_property(BUILT_WEBKIT_PLUGIN media_plugin_webkit LOCATION)
- add_custom_command(TARGET llfbconnecttest POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_WEBKIT_PLUGIN} ${PLUGINS_DESTINATION_DIR}
- DEPENDS ${BUILT_WEBKIT_PLUGIN}
- )
-
- # copy over bookmarks file if llfbconnecttest gets built
- get_target_property(BUILT_LLFBCONNECTTEST llfbconnecttest LOCATION)
- add_custom_command(TARGET llfbconnecttest POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bookmarks.txt ${CMAKE_CURRENT_BINARY_DIR}/
- DEPENDS ${BUILT_LLFBCONNECTTEST}
- )
- # also copy it to the same place as SLPlugin, which is what the mac wants...
- add_custom_command(TARGET llfbconnecttest POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bookmarks.txt ${PLUGINS_DESTINATION_DIR}
- DEPENDS ${BUILT_LLFBCONNECTTEST}
- )
-endif (DARWIN OR WINDOWS)
+get_target_property(BUILT_WEBKIT_PLUGIN media_plugin_webkit LOCATION)
+add_custom_command(TARGET llfbconnecttest POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_WEBKIT_PLUGIN} ${PLUGINS_DESTINATION_DIR}
+ DEPENDS ${BUILT_WEBKIT_PLUGIN}
+)
-if (DARWIN)
- add_custom_command(TARGET llfbconnecttest POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib ${PLUGINS_DESTINATION_DIR}
- DEPENDS ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib
- )
-endif (DARWIN)
+# copy over bookmarks file if llfbconnecttest gets built
+get_target_property(BUILT_LLFBCONNECTTEST llfbconnecttest LOCATION)
+add_custom_command(TARGET llfbconnecttest POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bookmarks.txt ${CMAKE_CURRENT_BINARY_DIR}/
+ DEPENDS ${BUILT_LLFBCONNECTTEST}
+)
+
+# also copy it to the same place as SLPlugin, which is what the mac wants...
+add_custom_command(TARGET llfbconnecttest POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bookmarks.txt ${PLUGINS_DESTINATION_DIR}
+ DEPENDS ${BUILT_LLFBCONNECTTEST}
+)
if(WINDOWS)
#********************
@@ -301,4 +293,80 @@ if(WINDOWS)
endif(WINDOWS)
+if (DARWIN)
+ set(fbconnecttest_release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
+ set(fbconnecttest_release_files
+ libexception_handler.dylib
+ libaprutil-1.0.dylib
+ libapr-1.0.dylib
+ libexpat.1.5.2.dylib
+ libQtCore.4.7.1.dylib
+ libQtCore.4.dylib
+ libQtGui.4.7.1.dylib
+ libQtGui.4.dylib
+ libQtNetwork.4.7.1.dylib
+ libQtNetwork.4.dylib
+ libQtOpenGL.4.7.1.dylib
+ libQtOpenGL.4.dylib
+ libQtWebKit.4.7.1.dylib
+ libQtWebKit.4.dylib
+ libQtSvg.4.7.1.dylib
+ libQtSvg.4.dylib
+ libQtXml.4.7.1.dylib
+ libQtXml.4.dylib
+ )
+ copy_if_different(
+ ${fbconnecttest_release_src_dir}
+ "${PLUGINS_DESTINATION_DIR}"
+ out_targets
+ ${fbconnecttest_release_files}
+ )
+ set(fbconnect_test_targets ${fbconnect_test_targets} ${out_targets})
+
+ # Release & ReleaseDebInfo config runtime files required for the FB connect test (Qt image format plugins)
+ set(fbconnecttest_release_src_dir "${ARCH_PREBUILT_DIRS_PLUGINS}/imageformats")
+ set(fbconnecttest_release_files
+ libqgif.dylib
+ libqico.dylib
+ libqjpeg.dylib
+ libqmng.dylib
+ libqsvg.dylib
+ libqtiff.dylib
+ )
+ copy_if_different(
+ ${fbconnecttest_release_src_dir}
+ "${PLUGINS_DESTINATION_DIR}/imageformats"
+ out_targets
+ ${fbconnecttest_release_files}
+ )
+ set(fbconnect_test_targets ${fbconnect_test_targets} ${out_targets})
+
+ # Release & ReleaseDebInfo config runtime files required for the FB connect test (Qt codec plugins)
+ set(fbconnecttest_release_src_dir "${ARCH_PREBUILT_DIRS_PLUGINS}/codecs")
+ set(fbconnecttest_release_files
+ libqcncodecs.dylib
+ libqjpcodecs.dylib
+ libqkrcodecs.dylib
+ libqtwcodecs.dylib
+ )
+ copy_if_different(
+ ${fbconnecttest_release_src_dir}
+ "${PLUGINS_DESTINATION_DIR}/codecs"
+ out_targets
+ ${fbconnecttest_release_files}
+ )
+ set(fbconnect_test_targets ${fbconnect_test_targets} ${out_targets})
+
+ add_custom_target(copy_fbconnecttest_libs ALL
+ DEPENDS
+ ${fbconnect_test_targets}
+ )
+
+ add_dependencies(llfbconnecttest copy_fbconnecttest_libs)
+endif (DARWIN)
+
+if (LINUX)
+
+endif (LINUX)
+
ll_deploy_sharedlibs_command(llfbconnecttest)
diff --git a/indra/test_apps/llfbconnecttest/README.Linden b/indra/test_apps/llfbconnecttest/README.Linden
new file mode 100644
index 0000000000..7488ce680a
--- /dev/null
+++ b/indra/test_apps/llfbconnecttest/README.Linden
@@ -0,0 +1,20 @@
+
+1. Description
+
+ Exercises SLPlugin. Specific functions and goals aren't clear
+ from the source.
+
+2. Running
+
+ 2.1 Mac
+
+ Make certain '.' is included in PATH. E.g.:
+
+ PATH=.:"$PATH" open build-darwin-i386/test_apps/llfbconnecttest/RelWithDebInfo/llfbconnecttest.app
+
+ Otherwise the program won't find SLPlugin and will timeout and
+ fail after 30 seconds and give you little information as to why.
+
+ Running 'dtruss' on plugin test applications will give you a great
+ deal of insight into why they aren't activating.
+
diff --git a/indra/test_apps/llplugintest/CMakeLists.txt b/indra/test_apps/llplugintest/CMakeLists.txt
index 8179be66f5..9d44563e26 100755
--- a/indra/test_apps/llplugintest/CMakeLists.txt
+++ b/indra/test_apps/llplugintest/CMakeLists.txt
@@ -346,44 +346,44 @@ add_custom_command(TARGET llmediaplugintest POST_BUILD
DEPENDS ${BUILT_LLCOMMON}
)
+get_target_property(BUILT_WEBKIT_PLUGIN media_plugin_webkit LOCATION)
+add_custom_command(TARGET llmediaplugintest POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_WEBKIT_PLUGIN} ${PLUGINS_DESTINATION_DIR}
+ DEPENDS ${BUILT_WEBKIT_PLUGIN}
+)
if (DARWIN OR WINDOWS)
- get_target_property(BUILT_WEBKIT_PLUGIN media_plugin_webkit LOCATION)
- add_custom_command(TARGET llmediaplugintest POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_WEBKIT_PLUGIN} ${PLUGINS_DESTINATION_DIR}
- DEPENDS ${BUILT_WEBKIT_PLUGIN}
- )
-
get_target_property(BUILT_QUICKTIME_PLUGIN media_plugin_quicktime LOCATION)
add_custom_command(TARGET llmediaplugintest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_QUICKTIME_PLUGIN} ${PLUGINS_DESTINATION_DIR}
DEPENDS ${BUILT_QUICKTIME_PLUGIN}
)
-
- get_target_property(BUILT_EXAMPLE_PLUGIN media_plugin_example LOCATION)
- add_custom_command(TARGET llmediaplugintest POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_EXAMPLE_PLUGIN} ${PLUGINS_DESTINATION_DIR}
- DEPENDS ${BUILT_EXAMPLE_PLUGIN}
- )
-
- # copy over bookmarks file if llmediaplugintest gets built
- get_target_property(BUILT_LLMEDIAPLUGINTEST llmediaplugintest LOCATION)
- add_custom_command(TARGET llmediaplugintest POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bookmarks.txt ${CMAKE_CURRENT_BINARY_DIR}/
- DEPENDS ${BUILT_LLMEDIAPLUGINTEST}
- )
- # also copy it to the same place as SLPlugin, which is what the mac wants...
- add_custom_command(TARGET llmediaplugintest POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bookmarks.txt ${PLUGINS_DESTINATION_DIR}
- DEPENDS ${BUILT_LLMEDIAPLUGINTEST}
- )
endif (DARWIN OR WINDOWS)
+get_target_property(BUILT_EXAMPLE_PLUGIN media_plugin_example LOCATION)
+add_custom_command(TARGET llmediaplugintest POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_EXAMPLE_PLUGIN} ${PLUGINS_DESTINATION_DIR}
+ DEPENDS ${BUILT_EXAMPLE_PLUGIN}
+)
+
+# copy over bookmarks file if llmediaplugintest gets built
+get_target_property(BUILT_LLMEDIAPLUGINTEST llmediaplugintest LOCATION)
+add_custom_command(TARGET llmediaplugintest POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bookmarks.txt ${CMAKE_CURRENT_BINARY_DIR}/
+ DEPENDS ${BUILT_LLMEDIAPLUGINTEST}
+)
+
+# also copy it to the same place as SLPlugin, which is what the mac wants...
+add_custom_command(TARGET llmediaplugintest POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bookmarks.txt ${PLUGINS_DESTINATION_DIR}
+ DEPENDS ${BUILT_LLMEDIAPLUGINTEST}
+)
+
if (DARWIN)
- add_custom_command(TARGET llmediaplugintest POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib ${PLUGINS_DESTINATION_DIR}
- DEPENDS ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib
- )
+# add_custom_command(TARGET llmediaplugintest POST_BUILD
+# COMMAND ${CMAKE_COMMAND} -E copy ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib ${PLUGINS_DESTINATION_DIR}
+# DEPENDS ${ARCH_PREBUILT_DIRS_RELEASE}/libllqtwebkit.dylib
+# )
endif (DARWIN)
if(WINDOWS)
@@ -538,4 +538,76 @@ if(WINDOWS)
endif(WINDOWS)
+if (DARWIN)
+ set(plugintest_release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
+ set(plugintest_release_files
+ libexception_handler.dylib
+ libaprutil-1.0.dylib
+ libapr-1.0.dylib
+ libexpat.1.5.2.dylib
+ libQtCore.4.7.1.dylib
+ libQtCore.4.dylib
+ libQtGui.4.7.1.dylib
+ libQtGui.4.dylib
+ libQtNetwork.4.7.1.dylib
+ libQtNetwork.4.dylib
+ libQtOpenGL.4.7.1.dylib
+ libQtOpenGL.4.dylib
+ libQtWebKit.4.7.1.dylib
+ libQtWebKit.4.dylib
+ libQtSvg.4.7.1.dylib
+ libQtSvg.4.dylib
+ libQtXml.4.7.1.dylib
+ libQtXml.4.dylib
+ )
+ copy_if_different(
+ ${plugintest_release_src_dir}
+ "${PLUGINS_DESTINATION_DIR}"
+ out_targets
+ ${plugintest_release_files}
+ )
+ set(plugin_test_targets ${plugin_test_targets} ${out_targets})
+
+ # Release & ReleaseDebInfo config runtime files required for the FB connect test (Qt image format plugins)
+ set(plugintest_release_src_dir "${ARCH_PREBUILT_DIRS_PLUGINS}/imageformats")
+ set(plugintest_release_files
+ libqgif.dylib
+ libqico.dylib
+ libqjpeg.dylib
+ libqmng.dylib
+ libqsvg.dylib
+ libqtiff.dylib
+ )
+ copy_if_different(
+ ${plugintest_release_src_dir}
+ "${PLUGINS_DESTINATION_DIR}/imageformats"
+ out_targets
+ ${plugintest_release_files}
+ )
+ set(plugin_test_targets ${plugin_test_targets} ${out_targets})
+
+ # Release & ReleaseDebInfo config runtime files required for the FB connect test (Qt codec plugins)
+ set(plugintest_release_src_dir "${ARCH_PREBUILT_DIRS_PLUGINS}/codecs")
+ set(plugintest_release_files
+ libqcncodecs.dylib
+ libqjpcodecs.dylib
+ libqkrcodecs.dylib
+ libqtwcodecs.dylib
+ )
+ copy_if_different(
+ ${plugintest_release_src_dir}
+ "${PLUGINS_DESTINATION_DIR}/codecs"
+ out_targets
+ ${plugintest_release_files}
+ )
+ set(plugin_test_targets ${plugin_test_targets} ${out_targets})
+
+ add_custom_target(copy_plugintest_libs ALL
+ DEPENDS
+ ${plugin_test_targets}
+ )
+
+ add_dependencies(llmediaplugintest copy_plugintest_libs)
+endif (DARWIN)
+
ll_deploy_sharedlibs_command(llmediaplugintest)
diff --git a/indra/test_apps/llplugintest/README.Linden b/indra/test_apps/llplugintest/README.Linden
new file mode 100644
index 0000000000..4a9f223c21
--- /dev/null
+++ b/indra/test_apps/llplugintest/README.Linden
@@ -0,0 +1,21 @@
+
+1. Description
+
+ Exercises SLPlugin. Demonstrates mediakit plugin reuse and
+ switchover as MIME type changes (web, quicktime, flash).
+
+
+2. Running
+
+ 2.1 Mac
+
+ Make certain '.' is included in PATH. E.g.:
+
+ PATH=.:"$PATH" open build-darwin-i386/test_apps/llmediaplugintest/RelWithDebInfo/llmediaplugintest.app
+
+ Otherwise the program won't find SLPlugin and will timeout and
+ fail after 30 seconds and give you little information as to why.
+
+ Running 'dtruss' on plugin test applications will give you a great
+ deal of insight into why they aren't activating.
+
diff --git a/indra/test_apps/llplugintest/llmediaplugintest.cpp b/indra/test_apps/llplugintest/llmediaplugintest.cpp
index 884b00f0cc..fa4f5abd28 100755
--- a/indra/test_apps/llplugintest/llmediaplugintest.cpp
+++ b/indra/test_apps/llplugintest/llmediaplugintest.cpp
@@ -37,6 +37,12 @@
#include "llmediaplugintest.h"
+
+#if LL_WINDOWS
+#pragma warning(disable: 4263)
+#pragma warning(disable: 4264)
+#endif
+
#if __APPLE__
#include <GLUT/glut.h>
#include <CoreFoundation/CoreFoundation.h>
@@ -46,10 +52,6 @@
#define GLUI_FREEGLUT
#endif
-#if LL_WINDOWS
-#pragma warning(disable: 4263)
-#pragma warning(disable: 4264)
-#endif
#include "glui.h"
diff --git a/indra/viewer_components/login/CMakeLists.txt b/indra/viewer_components/login/CMakeLists.txt
index 6f366677c9..ce80d55829 100755
--- a/indra/viewer_components/login/CMakeLists.txt
+++ b/indra/viewer_components/login/CMakeLists.txt
@@ -46,6 +46,8 @@ target_link_libraries(lllogin
${LLMATH_LIBRARIES}
${LLXML_LIBRARIES}
${BOOST_CONTEXT_LIBRARY}
+ ${BOOST_COROUTINE_LIBRARY}
+ ${BOOST_SYSTEM_LIBRARY}
)
if(LL_TESTS)
@@ -55,7 +57,7 @@ if(LL_TESTS)
set_source_files_properties(
lllogin.cpp
PROPERTIES
- LL_TEST_ADDITIONAL_LIBRARIES "${BOOST_CONTEXT_LIBRARY}"
+ LL_TEST_ADDITIONAL_LIBRARIES "${BOOST_CONTEXT_LIBRARY};${BOOST_COROUTINE_LIBRARY};${BOOST_SYSTEM_LIBRARY}"
)
LL_ADD_PROJECT_UNIT_TESTS(lllogin "${lllogin_TEST_SOURCE_FILES}")
diff --git a/indra/viewer_components/login/lllogin.cpp b/indra/viewer_components/login/lllogin.cpp
index 8f33b2ad58..b8408a6fb4 100755
--- a/indra/viewer_components/login/lllogin.cpp
+++ b/indra/viewer_components/login/lllogin.cpp
@@ -311,7 +311,7 @@ void LLLogin::Impl::login_(LLCoros::self& self, std::string uri, LLSD login_para
sendProgressEvent("offline", "fail.login", error_response);
}
catch (...) {
- llerrs << "login exception caught" << llendl;
+ LL_ERRS() << "login exception caught" << LL_ENDL;
}
}
diff --git a/indra/viewer_components/updater/llupdatechecker.cpp b/indra/viewer_components/updater/llupdatechecker.cpp
index dc8ff2f644..8da4f88905 100755
--- a/indra/viewer_components/updater/llupdatechecker.cpp
+++ b/indra/viewer_components/updater/llupdatechecker.cpp
@@ -130,12 +130,13 @@ void LLUpdateChecker::Implementation::checkVersion(std::string const & urlBase,
}
}
-void LLUpdateChecker::Implementation::completed(U32 status,
- const std::string & reason,
- const LLSD & content)
+void LLUpdateChecker::Implementation::httpCompleted()
{
mInProgress = false;
-
+
+ S32 status = getStatus();
+ const LLSD& content = getContent();
+ const std::string& reason = getReason();
if(status != 200)
{
std::string server_error;
@@ -162,8 +163,9 @@ void LLUpdateChecker::Implementation::completed(U32 status,
}
-void LLUpdateChecker::Implementation::error(U32 status, const std::string & reason)
+void LLUpdateChecker::Implementation::httpFailure()
{
+ const std::string& reason = getReason();
mInProgress = false;
LL_WARNS("UpdaterService") << "update check failed; " << reason << LL_ENDL;
mClient.error(reason);
diff --git a/indra/viewer_components/updater/llupdatechecker.h b/indra/viewer_components/updater/llupdatechecker.h
index 4244007340..3163a6d53c 100755
--- a/indra/viewer_components/updater/llupdatechecker.h
+++ b/indra/viewer_components/updater/llupdatechecker.h
@@ -52,11 +52,10 @@ public:
bool willing_to_test
);
+ protected:
// Responder:
- virtual void completed(U32 status,
- const std::string & reason,
- const LLSD& content);
- virtual void error(U32 status, const std::string & reason);
+ virtual void httpCompleted();
+ virtual void httpFailure();
private:
static const char * sLegacyProtocolVersion;
diff --git a/indra/win_crash_logger/llcrashloggerwindows.cpp b/indra/win_crash_logger/llcrashloggerwindows.cpp
index 6a272fd166..51e70f95b6 100644
--- a/indra/win_crash_logger/llcrashloggerwindows.cpp
+++ b/indra/win_crash_logger/llcrashloggerwindows.cpp
@@ -318,7 +318,7 @@ int LLCrashLoggerWindows::processingLoop() {
}
}
- llinfos << "session ending.." << llendl;
+ LL_INFOS() << "session ending.." << LL_ENDL;
std::string per_run_dir = options["dumpdir"].asString();
std::string per_run_file = per_run_dir + "\\SecondLife.log";
@@ -326,7 +326,7 @@ int LLCrashLoggerWindows::processingLoop() {
if (gDirUtilp->fileExists(per_run_dir))
{
- LL_INFOS ("CRASHREPORT") << "Copying " << log_file << " to " << per_run_file << llendl;
+ LL_INFOS ("CRASHREPORT") << "Copying " << log_file << " to " << per_run_file << LL_ENDL;
LLFile::copy(log_file, per_run_file);
}
return 0;
@@ -354,19 +354,19 @@ void LLCrashLoggerWindows::OnClientDumpRequest(void* context,
{
if (!file_path)
{
- llwarns << "dump with no file path" << llendl;
+ LL_WARNS() << "dump with no file path" << LL_ENDL;
return;
}
if (!client_info)
{
- llwarns << "dump with no client info" << llendl;
+ LL_WARNS() << "dump with no client info" << LL_ENDL;
return;
}
LLCrashLoggerWindows* self = static_cast<LLCrashLoggerWindows*>(context);
if (!self)
{
- llwarns << "dump with no context" << llendl;
+ LL_WARNS() << "dump with no context" << LL_ENDL;
return;
}
@@ -406,13 +406,13 @@ bool LLCrashLoggerWindows::initCrashServer()
if (!mCrashHandler) {
//Failed to start the crash server.
- llwarns << "Failed to init crash server." << llendl;
+ LL_WARNS() << "Failed to init crash server." << LL_ENDL;
return false;
}
// Start servicing clients.
if (!mCrashHandler->Start()) {
- llwarns << "Failed to start crash server." << llendl;
+ LL_WARNS() << "Failed to start crash server." << LL_ENDL;
return false;
}
@@ -433,7 +433,7 @@ bool LLCrashLoggerWindows::init(void)
swprintf(gProductName, L"Second Life");
*/
- llinfos << "Loading dialogs" << llendl;
+ LL_INFOS() << "Loading dialogs" << LL_ENDL;
// Initialize global strings
LoadString(mhInst, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
@@ -472,7 +472,8 @@ void LLCrashLoggerWindows::gatherPlatformSpecificFiles()
bool LLCrashLoggerWindows::mainLoop()
{
- llinfos << "CrashSubmitBehavior is " << mCrashBehavior << llendl;
+ LL_INFOS() << "CrashSubmitBehavior is " << mCrashBehavior << LL_ENDL;
+
// Note: parent hwnd is 0 (the desktop). No dlg proc. See Petzold (5th ed) HexCalc example, Chapter 11, p529
// win_crash_logger.rc has been edited by hand.
// Dialogs defined with CLASS "WIN_CRASH_LOGGER" (must be same as szWindowClass)
@@ -483,7 +484,7 @@ bool LLCrashLoggerWindows::mainLoop()
if (mCrashBehavior == CRASH_BEHAVIOR_ALWAYS_SEND)
{
- llinfos << "Showing crash report submit progress window." << llendl;
+ LL_INFOS() << "Showing crash report submit progress window." << LL_ENDL;
//ShowWindow(gHwndProgress, SW_SHOW ); Maint-5707
sendCrashLogs();
}
@@ -522,7 +523,7 @@ bool LLCrashLoggerWindows::mainLoop()
}
else
{
- llwarns << "Unknown crash behavior " << mCrashBehavior << llendl;
+ LL_WARNS() << "Unknown crash behavior " << mCrashBehavior << LL_ENDL;
return 1;
}
return 0;
diff --git a/indra/win_crash_logger/win_crash_logger.cpp b/indra/win_crash_logger/win_crash_logger.cpp
index 79b8514725..366edd894b 100755
--- a/indra/win_crash_logger/win_crash_logger.cpp
+++ b/indra/win_crash_logger/win_crash_logger.cpp
@@ -34,7 +34,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
- llinfos << "Starting crash reporter with args" << &lpCmdLine << llendl;
+ LL_INFOS() << "Starting crash reporter with args" << &lpCmdLine << LL_ENDL;
LLCrashLoggerWindows app;
app.setHandle(hInstance);
app.parseCommandOptions(__argc, __argv);
@@ -43,17 +43,17 @@ int APIENTRY WinMain(HINSTANCE hInstance,
LLApp::PRIORITY_COMMAND_LINE);
if (!(options.has("pid") && options.has("dumpdir")))
{
- llwarns << "Insufficient parameters to crash report." << llendl;
+ LL_WARNS() << "Insufficient parameters to crash report." << LL_ENDL;
}
if (! app.init())
{
- llwarns << "Unable to initialize application." << llendl;
- return 1;
+ LL_WARNS() << "Unable to initialize application." << LL_ENDL;
+ return -1;
}
app.processingLoop();
app.mainLoop();
app.cleanup();
- llinfos << "Crash reporter finished normally." << llendl;
+ LL_INFOS() << "Crash reporter finished normally." << LL_ENDL;
return 0;
}
diff --git a/indra/win_updater/CMakeLists.txt b/indra/win_updater/CMakeLists.txt
deleted file mode 100755
index 210486c668..0000000000
--- a/indra/win_updater/CMakeLists.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-# -*- cmake -*-
-
-project(win_updater)
-
-include(00-Common)
-include(LLCommon)
-include(Linking)
-
-# *HACK - override msvcrt implementation (intialized on 00-Common) to be
-# statically linked for the installer this relies on vc taking the last flag on
-# the command line
-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT")
-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
-
-include_directories(
- ${LLCOMMON_INCLUDE_DIRS}
- )
-
-set(win_updater_SOURCE_FILES updater.cpp)
-
-set(win_updater_HEADER_FILES CMakeLists.txt)
-
-set_source_files_properties(${win_updater_HEADER_FILES}
- PROPERTIES HEADER_FILE_ONLY TRUE)
-
-list(APPEND win_updater_SOURCE_FILES ${win_updater_HEADER_FILES})
-
-add_executable(windows-updater WIN32 ${win_updater_SOURCE_FILES})
-
-target_link_libraries(windows-updater
- wininet
- user32
- gdi32
- shell32
- )
-
-set_target_properties(windows-updater
- PROPERTIES
- LINK_FLAGS "/NODEFAULTLIB:MSVCRT"
- LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;MSVCRT\""
- )
-
-# The windows-updater doesn't link against anything non-system, apparently
-#ll_deploy_sharedlibs_command(windows-updater)
diff --git a/indra/win_updater/updater.cpp b/indra/win_updater/updater.cpp
deleted file mode 100755
index aeab5a3b13..0000000000
--- a/indra/win_updater/updater.cpp
+++ /dev/null
@@ -1,516 +0,0 @@
-/**
- * @file updater.cpp
- * @brief Windows auto-updater
- *
- * $LicenseInfo:firstyear=2002&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-//
-// Usage: updater -url <url>
-//
-
-// We use dangerous fopen, strtok, mbstowcs, sprintf
-// which generates warnings on VC2005.
-// *TODO: Switch to fopen_s, strtok_s, etc.
-#define _CRT_SECURE_NO_DEPRECATE
-
-#include <windows.h>
-#include <wininet.h>
-#include <stdio.h>
-#include <string>
-#include <iostream>
-#include <stdexcept>
-#include <sstream>
-#include <fstream>
-
-#define BUFSIZE 8192
-
-int gTotalBytesRead = 0;
-DWORD gTotalBytes = -1;
-HWND gWindow = NULL;
-WCHAR gProgress[256];
-char* gUpdateURL = NULL;
-
-#if _DEBUG
-std::ofstream logfile;
-#define DEBUG(expr) logfile << expr << std::endl
-#else
-#define DEBUG(expr) /**/
-#endif
-
-char* wchars_to_utf8chars(const WCHAR* in_chars)
-{
- int tlen = 0;
- const WCHAR* twc = in_chars;
- while (*twc++ != 0)
- {
- tlen++;
- }
- char* outchars = new char[tlen];
- char* res = outchars;
- for (int i=0; i<tlen; i++)
- {
- int cur_char = (int)(*in_chars++);
- if (cur_char < 0x80)
- {
- *outchars++ = (char)cur_char;
- }
- else
- {
- *outchars++ = '?';
- }
- }
- *outchars = 0;
- return res;
-}
-
-class Fetcher
-{
-public:
- Fetcher(const std::wstring& uri)
- {
- // These actions are broken out as separate methods not because it
- // makes the code clearer, but to avoid triggering AntiVir and
- // McAfee-GW-Edition virus scanners (DEV-31680).
- mInet = openInet();
- mDownload = openUrl(uri);
- }
-
- ~Fetcher()
- {
- DEBUG("Calling InternetCloseHandle");
- InternetCloseHandle(mDownload);
- InternetCloseHandle(mInet);
- }
-
- unsigned long read(char* buffer, size_t bufflen) const;
-
- DWORD getTotalBytes() const
- {
- DWORD totalBytes;
- DWORD sizeof_total_bytes = sizeof(totalBytes);
- HttpQueryInfo(mDownload, HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER,
- &totalBytes, &sizeof_total_bytes, NULL);
- return totalBytes;
- }
-
- struct InetError: public std::runtime_error
- {
- InetError(const std::string& what): std::runtime_error(what) {}
- };
-
-private:
- // We test results from a number of different MS functions with different
- // return types -- but the common characteristic is that 0 (i.e. (! result))
- // means an error of some kind.
- template <typename RESULT>
- static RESULT check(const std::string& desc, RESULT result)
- {
- if (result)
- {
- // success, show caller
- return result;
- }
- DWORD err = GetLastError();
- std::ostringstream out;
- out << desc << " Failed: " << err;
- DEBUG(out.str());
- throw InetError(out.str());
- }
-
- HINTERNET openUrl(const std::wstring& uri) const;
- HINTERNET openInet() const;
-
- HINTERNET mInet, mDownload;
-};
-
-HINTERNET Fetcher::openInet() const
-{
- DEBUG("Calling InternetOpen");
- // Init wininet subsystem
- return check("InternetOpen",
- InternetOpen(L"LindenUpdater", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0));
-}
-
-HINTERNET Fetcher::openUrl(const std::wstring& uri) const
-{
- DEBUG("Calling InternetOpenUrl: " << wchars_to_utf8chars(uri.c_str()));
- return check("InternetOpenUrl",
- InternetOpenUrl(mInet, uri.c_str(), NULL, 0, INTERNET_FLAG_NEED_FILE, NULL));
-}
-
-unsigned long Fetcher::read(char* buffer, size_t bufflen) const
-{
- unsigned long bytes_read = 0;
- DEBUG("Calling InternetReadFile");
- check("InternetReadFile",
- InternetReadFile(mDownload, buffer, bufflen, &bytes_read));
- return bytes_read;
-}
-
-int WINAPI get_url_into_file(const std::wstring& uri, const std::string& path, int *cancelled)
-{
- int success = FALSE;
- *cancelled = FALSE;
-
- DEBUG("Opening '" << path << "'");
-
- FILE* fp = fopen(path.c_str(), "wb"); /* Flawfinder: ignore */
-
- if (!fp)
- {
- DEBUG("Failed to open '" << path << "'");
- return success;
- }
-
- // Note, ctor can throw, since it uses check() function.
- Fetcher fetcher(uri);
- gTotalBytes = fetcher.getTotalBytes();
-
-/*==========================================================================*|
- // nobody uses total_bytes?!? What's this doing here?
- DWORD total_bytes = 0;
- success = check("InternetQueryDataAvailable",
- InternetQueryDataAvailable(hdownload, &total_bytes, 0, 0));
-|*==========================================================================*/
-
- success = FALSE;
- while(!success && !(*cancelled))
- {
- char data[BUFSIZE]; /* Flawfinder: ignore */
- unsigned long bytes_read = fetcher.read(data, sizeof(data));
-
- if (!bytes_read)
- {
- DEBUG("InternetReadFile Read " << bytes_read << " bytes.");
- }
-
- DEBUG("Reading Data, bytes_read = " << bytes_read);
-
- if (bytes_read == 0)
- {
- // If InternetFileRead returns TRUE AND bytes_read == 0
- // we've successfully downloaded the entire file
- wsprintf(gProgress, L"Download complete.");
- success = TRUE;
- }
- else
- {
- // write what we've got, then continue
- fwrite(data, sizeof(char), bytes_read, fp);
-
- gTotalBytesRead += int(bytes_read);
-
- if (gTotalBytes != -1)
- wsprintf(gProgress, L"Downloaded: %d%%", 100 * gTotalBytesRead / gTotalBytes);
- else
- wsprintf(gProgress, L"Downloaded: %dK", gTotalBytesRead / 1024);
-
- }
-
- DEBUG("Calling InvalidateRect");
-
- // Mark the window as needing redraw (of the whole thing)
- InvalidateRect(gWindow, NULL, TRUE);
-
- // Do the redraw
- DEBUG("Calling UpdateWindow");
- UpdateWindow(gWindow);
-
- DEBUG("Calling PeekMessage");
- MSG msg;
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
- {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
-
- if (msg.message == WM_QUIT)
- {
- // bail out, user cancelled
- *cancelled = TRUE;
- }
- }
- }
-
- fclose(fp);
- return success;
-}
-
-LRESULT CALLBACK WinProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
-{
- HDC hdc; // Drawing context
- PAINTSTRUCT ps;
-
- switch(message)
- {
- case WM_PAINT:
- {
- hdc = BeginPaint(hwnd, &ps);
-
- RECT rect;
- GetClientRect(hwnd, &rect);
- DrawText(hdc, gProgress, -1, &rect,
- DT_SINGLELINE | DT_CENTER | DT_VCENTER);
-
- EndPaint(hwnd, &ps);
- return 0;
- }
- case WM_CLOSE:
- case WM_DESTROY:
- // Get out of full screen
- // full_screen_mode(false);
- PostQuitMessage(0);
- return 0;
- }
- return DefWindowProc(hwnd, message, wparam, lparam);
-}
-
-#define win_class_name L"FullScreen"
-
-int parse_args(int argc, char **argv)
-{
- int j;
-
- for (j = 1; j < argc; j++)
- {
- if ((!strcmp(argv[j], "-url")) && (++j < argc))
- {
- gUpdateURL = argv[j];
- }
- }
-
- // If nothing was set, let the caller know.
- if (!gUpdateURL)
- {
- return 1;
- }
- return 0;
-}
-
-int WINAPI
-WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
-{
- // Parse the command line.
- LPSTR cmd_line_including_exe_name = GetCommandLineA();
-
- const int MAX_ARGS = 100;
- int argc = 0;
- char* argv[MAX_ARGS]; /* Flawfinder: ignore */
-
-#if _DEBUG
- logfile.open("updater.log", std::ios_base::out);
- DEBUG("Parsing command arguments");
-#endif
-
- char *token = NULL;
- if( cmd_line_including_exe_name[0] == '\"' )
- {
- // Exe name is enclosed in quotes
- token = strtok( cmd_line_including_exe_name, "\"" );
- argv[argc++] = token;
- token = strtok( NULL, " \t," );
- }
- else
- {
- // Exe name is not enclosed in quotes
- token = strtok( cmd_line_including_exe_name, " \t," );
- }
-
- while( (token != NULL) && (argc < MAX_ARGS) )
- {
- argv[argc++] = token;
- /* Get next token: */
- if (*(token + strlen(token) + 1) == '\"') /* Flawfinder: ignore */
- {
- token = strtok( NULL, "\"");
- }
- else
- {
- token = strtok( NULL, " \t," );
- }
- }
-
- gUpdateURL = NULL;
-
- /////////////////////////////////////////
- //
- // Process command line arguments
- //
-
- DEBUG("Processing command arguments");
-
- //
- // Parse the command line arguments
- //
- int parse_args_result = parse_args(argc, argv);
-
- WNDCLASSEX wndclassex = { 0 };
- //DEVMODE dev_mode = { 0 };
-
- const int WINDOW_WIDTH = 250;
- const int WINDOW_HEIGHT = 100;
-
- wsprintf(gProgress, L"Connecting...");
-
- /* Init the WNDCLASSEX */
- wndclassex.cbSize = sizeof(WNDCLASSEX);
- wndclassex.style = CS_HREDRAW | CS_VREDRAW;
- wndclassex.hInstance = hInstance;
- wndclassex.lpfnWndProc = WinProc;
- wndclassex.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
- wndclassex.lpszClassName = win_class_name;
-
- RegisterClassEx(&wndclassex);
-
- // Get the size of the screen
- //EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dev_mode);
-
- gWindow = CreateWindowEx(NULL, win_class_name,
- L"Second Life Updater",
- WS_OVERLAPPEDWINDOW,
- CW_USEDEFAULT,
- CW_USEDEFAULT,
- WINDOW_WIDTH,
- WINDOW_HEIGHT,
- NULL, NULL, hInstance, NULL);
-
- ShowWindow(gWindow, nShowCmd);
- UpdateWindow(gWindow);
-
- if (parse_args_result)
- {
- MessageBox(gWindow,
- L"Usage: updater -url <url> [-name <window_title>] [-program <program_name>] [-silent]",
- L"Usage", MB_OK);
- return parse_args_result;
- }
-
- // Did we get a userserver to work with?
- if (!gUpdateURL)
- {
- MessageBox(gWindow, L"Please specify the download url from the command line",
- L"Error", MB_OK);
- return 1;
- }
-
- // Can't feed GetTempPath into GetTempFile directly
- char temp_path[MAX_PATH]; /* Flawfinder: ignore */
- if (0 == GetTempPathA(sizeof(temp_path), temp_path))
- {
- MessageBox(gWindow, L"Problem with GetTempPath()",
- L"Error", MB_OK);
- return 1;
- }
- std::string update_exec_path(temp_path);
- update_exec_path.append("Second_Life_Updater.exe");
-
- WCHAR update_uri[4096];
- mbstowcs(update_uri, gUpdateURL, sizeof(update_uri));
-
- int success = 0;
- int cancelled = 0;
-
- // Actually do the download
- try
- {
- DEBUG("Calling get_url_into_file");
- success = get_url_into_file(update_uri, update_exec_path, &cancelled);
- }
- catch (const Fetcher::InetError& e)
- {
- (void)e;
- success = FALSE;
- DEBUG("Caught: " << e.what());
- }
-
- // WinInet can't tell us if we got a 404 or not. Therefor, we check
- // for the size of the downloaded file, and assume that our installer
- // will always be greater than 1MB.
- if (gTotalBytesRead < (1024 * 1024) && ! cancelled)
- {
- MessageBox(gWindow,
- L"The Second Life auto-update has failed.\n"
- L"The problem may be caused by other software installed \n"
- L"on your computer, such as a firewall.\n"
- L"Please visit http://secondlife.com/download/ \n"
- L"to download the latest version of Second Life.\n",
- NULL, MB_OK);
- return 1;
- }
-
- if (cancelled)
- {
- // silently exit
- return 0;
- }
-
- if (!success)
- {
- MessageBox(gWindow,
- L"Second Life download failed.\n"
- L"Please try again later.",
- NULL, MB_OK);
- return 1;
- }
-
- // TODO: Make updates silent (with /S to NSIS)
- //char params[256]; /* Flawfinder: ignore */
- //sprintf(params, "/S"); /* Flawfinder: ignore */
- //MessageBox(gWindow,
- // L"Updating Second Life.\n\nSecond Life will automatically start once the update is complete. This may take a minute...",
- // L"Download Complete",
- // MB_OK);
-
-/*==========================================================================*|
- // DEV-31680: ShellExecuteA() causes McAfee-GW-Edition and AntiVir
- // scanners to flag this executable as a probable virus vector.
- // Less than or equal to 32 means failure
- if (32 >= (int) ShellExecuteA(gWindow, "open", update_exec_path.c_str(), NULL,
- "C:\\", SW_SHOWDEFAULT))
-|*==========================================================================*/
- // from http://msdn.microsoft.com/en-us/library/ms682512(VS.85).aspx
- STARTUPINFOA si;
- PROCESS_INFORMATION pi;
- ZeroMemory(&si, sizeof(si));
- si.cb = sizeof(si);
- ZeroMemory(&pi, sizeof(pi));
-
- if (! CreateProcessA(update_exec_path.c_str(), // executable file
- NULL, // command line
- NULL, // process cannot be inherited
- NULL, // thread cannot be inherited
- FALSE, // do not inherit existing handles
- 0, // process creation flags
- NULL, // inherit parent's environment
- NULL, // inherit parent's current dir
- &si, // STARTUPINFO
- &pi)) // PROCESS_INFORMATION
- {
- MessageBox(gWindow, L"Update failed. Please try again later.", NULL, MB_OK);
- return 1;
- }
-
- // Give installer some time to open a window
- Sleep(1000);
-
- return 0;
-}